Modified to dynamically determine eligible charge accounts, instead of the two that were hardcoded.

git-svn-id: file:///svn-source/pmgr/branches/invoice_receipt_20090629@244 97e9348a-65ac-dc4b-aefc-98561f571b83
This commit is contained in:
abijah
2009-07-07 07:14:18 +00:00
parent a8c91d8b22
commit aab8a994c8
4 changed files with 89 additions and 46 deletions

View File

@@ -97,22 +97,8 @@ class Transaction extends AppModel {
= $A->currentLedgerID($A->invoiceAccountID());
// ...and credit the charge ledger
// REVISIT <AP> 20090706
// The charge page should have a list of all income types
// and thus the field _should_ contain a valid account
// name. At the moment, however, I'm still cobbling things
// together, and only have two types.
/* $entry['credit_ledger_id'] */
/* = $A->currentLedgerID($A->nameToID($entry['charge_account'])); */
if ($entry['charge_type'] === 'rent') {
$entry['credit_ledger_id']
= $A->currentLedgerID($A->rentAccountID());
} elseif ($entry['charge_type'] === 'late') {
$entry['credit_ledger_id']
= $A->currentLedgerID($A->lateChargeAccountID());
} else {
die("Invalid charge account");
}
$entry['credit_ledger_id']
= $A->currentLedgerID($entry['account_id']);
$entry['customer_id'] = $customer_id;
$entry['lease_id'] = $lease_id;