Added ACH and Concession entry. Like everything else, I haven't tested too robustly, but it does seem to work. I might want to change the monetary source id for Concession. Right now each concession gets its own monetary source, but we could probably use a common one without issue.
git-svn-id: file:///svn-source/pmgr/branches/invoice_receipt_20090629@284 97e9348a-65ac-dc4b-aefc-98561f571b83
This commit is contained in:
@@ -180,12 +180,16 @@ class Transaction extends AppModel {
|
||||
$this->LedgerEntry->MonetarySource->MonetaryType
|
||||
->nameToID($entry['monetary_type_name']);
|
||||
|
||||
$entry['MonetarySource']['name'] =
|
||||
$this->LedgerEntry->MonetarySource->MonetaryType
|
||||
->nameToID($entry['monetary_type_name']);
|
||||
|
||||
if (!isset($entry['MonetarySource']['monetary_type_id'])) {
|
||||
$entry['MonetarySource']['name'] = 'Other';
|
||||
$entry['MonetarySource']['monetary_type_id'] =
|
||||
$this->LedgerEntry->MonetarySource->MonetaryType
|
||||
->nameToID('Other Non-Tillable');
|
||||
} else {
|
||||
$entry['MonetarySource']['name'] = $entry['monetary_type_name'];
|
||||
}
|
||||
|
||||
// Give it a fancy name based on the check number
|
||||
$entry['MonetarySource']['name'] = $entry['monetary_type_name'];
|
||||
if ($entry['monetary_type_name'] === 'Check' ||
|
||||
$entry['monetary_type_name'] === 'Money Order') {
|
||||
$entry['MonetarySource']['name'] .=
|
||||
@@ -193,6 +197,18 @@ class Transaction extends AppModel {
|
||||
}
|
||||
}
|
||||
|
||||
// Determine which account we'll use for the ledger entry
|
||||
$account_name = $entry['monetary_type_name'];
|
||||
|
||||
// REVISIT <AP>: 20090708
|
||||
// I _hate_ hardcoding values, but I'm not sure how
|
||||
// else to handle this at the moment. I'm pretty sure
|
||||
// what needs to happen is for the account information
|
||||
// to be figured out programatically on the receipt
|
||||
// presentation page, and then those values would flow
|
||||
// back after entry to here.
|
||||
if ($account_name === 'ACH')
|
||||
$account_name = 'Bank';
|
||||
|
||||
// This entry of physical money is part of the receipt transaction
|
||||
// debit: Cash/Check/Etc credit: Receipt
|
||||
@@ -200,7 +216,7 @@ class Transaction extends AppModel {
|
||||
|
||||
// Receipt must debit the "money" asset (bank, cash, check, etc)...
|
||||
$entry['debit_ledger_id']
|
||||
= $A->currentLedgerID($A->nameToID($entry['monetary_type_name']));
|
||||
= $A->currentLedgerID($A->nameToID($account_name));
|
||||
|
||||
// ...and credit the Receipt ledger
|
||||
$entry['credit_ledger_id']
|
||||
|
||||
Reference in New Issue
Block a user