|
@@ 35-47 (lines=13) @@
|
| 32 |
|
* |
| 33 |
|
* function to add an income and ledger at the same time |
| 34 |
|
*/ |
| 35 |
|
public function add_income(int $categoryid, string $income_title, int $amount, string $notes = "", $transaction_id = "0"): Income |
| 36 |
|
{ |
| 37 |
|
|
| 38 |
|
$income = $this->newIncome($categoryid, $income_title, $amount, $notes, $transaction_id); |
| 39 |
|
|
| 40 |
|
if ($transaction_id == 0) |
| 41 |
|
$transaction_id = $this->set_transaction_id($income); |
| 42 |
|
|
| 43 |
|
|
| 44 |
|
$ledger = $this->add_transaction_on_ledger($income, "INC", $transaction_id); |
| 45 |
|
|
| 46 |
|
return $income; |
| 47 |
|
} |
| 48 |
|
|
| 49 |
|
/** |
| 50 |
|
* @param int $categoryid |
|
@@ 60-72 (lines=13) @@
|
| 57 |
|
* function to add expense and to a ledger at the sametime |
| 58 |
|
*/ |
| 59 |
|
|
| 60 |
|
public function add_expense(int $categoryid, string $expense_title, int $amount, string $notes = "", $transaction_id = "0"): Expense |
| 61 |
|
{ |
| 62 |
|
|
| 63 |
|
$expense = $this->newExpense($categoryid, $expense_title, $amount, $notes, $transaction_id); |
| 64 |
|
|
| 65 |
|
if ($transaction_id == 0) |
| 66 |
|
$transaction_id = $this->set_transaction_id($expense); |
| 67 |
|
|
| 68 |
|
|
| 69 |
|
$ledger = $this->add_transaction_on_ledger($expense, "EXP", $transaction_id); |
| 70 |
|
|
| 71 |
|
return $expense; |
| 72 |
|
} |
| 73 |
|
|
| 74 |
|
|
| 75 |
|
/** |