2017 © Pedro Peláez
 

library expenses

A money in money out thing

image

delboy1978uk/expenses

A money in money out thing

  • Friday, December 15, 2017
  • by delboy1978uk
  • Repository
  • 1 Watchers
  • 0 Stars
  • 31 Installations
  • PHP
  • 0 Dependents
  • 0 Suggesters
  • 0 Forks
  • 0 Open issues
  • 18 Versions
  • 0 % Grown

The README.md

Expenses

Build Status Code Coverage Scrutinizer Code Quality
A simple service for storing money in and money out., (*1)

Installation

Install the package using composer:, (*2)

composer require delboy1978uk/expenses

Database Setup

Create a migrant-cfg.php based on vendor/delboy1978uk/common/migrant-cfg.php.dist and add delboy1978uk/expenses in the packages section. Then run:, (*3)

migrant migrate

Common Package Registration

Expenses works with delboy1978uk/common, which has a Doctrine Entity Manager and a Pimple DIC. Register with the Del\Expenses\ExpensesPackage to the container., (*4)

use Del\Common\ContainerService;
use Del\Expenses\ExpensesPackage;

$package = new ExpensesPackage();
ContainerService::getInstance()->registerToContainer($package);

The Expenses Service

$container = ContainerService::getInstance()->getContainer();
$svc = $container['service.expenses'];

Service Methods

$svc->createIncomeFromArray($data);
$svc->createExpenditureFromArray($data);
$svc->createExpenseClaimFromArray($data);
$svc->toArray($entity);
$svc->saveIncome($entity);
$svc->saveExpenditure($entity);
$svc->saveExpenseClaim($entity);
$svc->deleteIncome($entity);
$svc->deleteExpenditure($entity);
$svc->deleteExpenseClaim($entity);
$svc->deleteEntry($entity);
$svc->findByCriteria($criteria);
$svc->findIncomeById($id);
$svc->findExpenditureById($id);
$svc->findExpenseClaimById($id);
$svc->findExpenseClaimById($id);
$svc->saveIncome($income);
$svc->saveExpenditure($expenditure);
$svc->saveExpenseClaim($claim);

Entities

There are three types of entity, which all extend abstract class Entry, Income, Expenditure, and Expense Claim. Income and Expenditure are enough for a sole trader, someone with a limited company can use a ExpenseClaim entity to make an Expenditure that came out your own pocket that you can claim back from the business. All in order to figure out your taxable pay. An EntryInterface has the following methods:, (*5)

$entity->getId();
$entity->getUserId();
$entity->getDate();
$entity->getAmount();
$entity->getDescription();
$entity->getNote();
$entity->getCategory();
$entity->getType();

Criteria

Searching the DB is simple using a Criteria object:, (*6)

use Del\Expenses\Criteria\EntryCriteria;

$criteria = new Criteria();
$criteria->setUserId(42);
$criteria->setType('IN'); // also OUT or CLAIM
$criteria->setOrder(Criteria::ORDER_DATE);
$criteria->setLimit(25);
$criteria->setOffset(74);

$results = $svc->findByCriteria($criteria);

The Versions

15/12 2017

dev-master

9999999-dev

A money in money out thing

  Sources   Download

MIT

The Requires

 

The Development Requires

by Derek McLean

15/12 2017

v2.1.9

2.1.9.0

A money in money out thing

  Sources   Download

MIT

The Requires

 

The Development Requires

by Derek McLean

10/12 2017

v2.1.8

2.1.8.0

A money in money out thing

  Sources   Download

MIT

The Requires

 

The Development Requires

by Derek McLean

10/12 2017

v2.1.7

2.1.7.0

A money in money out thing

  Sources   Download

MIT

The Requires

 

The Development Requires

by Derek McLean

19/10 2017

v2.1.6

2.1.6.0

A money in money out thing

  Sources   Download

MIT

The Requires

 

The Development Requires

by Derek McLean

19/10 2017

v2.1.5

2.1.5.0

A money in money out thing

  Sources   Download

MIT

The Requires

 

The Development Requires

by Derek McLean

01/07 2017

v2.1.4

2.1.4.0

A money in money out thing

  Sources   Download

MIT

The Requires

 

The Development Requires

by Derek McLean

24/06 2017

v2.1.3

2.1.3.0

A money in money out thing

  Sources   Download

MIT

The Requires

 

The Development Requires

by Derek McLean

24/06 2017

v2.1.2

2.1.2.0

A money in money out thing

  Sources   Download

MIT

The Requires

 

The Development Requires

by Derek McLean

24/06 2017

v2.1.1

2.1.1.0

A money in money out thing

  Sources   Download

MIT

The Requires

 

The Development Requires

by Derek McLean

22/06 2017

v2.1.0

2.1.0.0

A money in money out thing

  Sources   Download

MIT

The Requires

 

The Development Requires

by Derek McLean

19/06 2017

v2.0.1

2.0.1.0

A money in money out thing

  Sources   Download

MIT

The Requires

 

The Development Requires

by Derek McLean

19/06 2017

v2.0.0

2.0.0.0

A money in money out thing

  Sources   Download

MIT

The Requires

 

The Development Requires

by Derek McLean

05/04 2016

v1.0.3

1.0.3.0

A money in money out thing

  Sources   Download

MIT

The Requires

 

The Development Requires

by Derek McLean

04/04 2016

v1.0.2

1.0.2.0

A money in money out thing

  Sources   Download

MIT

The Requires

 

The Development Requires

by Derek McLean

20/03 2016

v1.0.1

1.0.1.0

A money in money out thing

  Sources   Download

MIT

The Requires

 

The Development Requires

by Derek McLean

20/03 2016

v1.0.0

1.0.0.0

A money in money out thing

  Sources   Download

MIT

The Requires

 

The Development Requires

by Derek McLean

20/03 2016

v1.0.0b

1.0.0.0-beta

A expenses project

  Sources   Download

MIT

The Requires

 

The Development Requires

by Derek McLean