Added customer association to each tender

git-svn-id: file:///svn-source/pmgr/branches/yafr_20090716/site@413 97e9348a-65ac-dc4b-aefc-98561f571b83
This commit is contained in:
abijah
2009-07-29 09:33:29 +00:00
parent cdf6ce86e3
commit 438610bdf9
4 changed files with 26 additions and 12 deletions

View File

@@ -353,6 +353,7 @@ class Transaction extends AppModel {
foreach ($data['Entry'] AS $e_index => &$entry) {
extract($entry);
$le1['transaction_id'] = $le2['transaction_id'] = $ret['transaction_id'];
$le1_tender['customer_id'] = $transaction['customer_id'];
$result = $this->LedgerEntry->DoubleEntry->addDoubleEntry($le1, $le2, $le1_tender);
$ret['entries'][$e_index]['DoubleEntry'] = $result;
if ($result['error']) {
@@ -376,7 +377,7 @@ class Transaction extends AppModel {
!$ret['error']) {
$result = $this->StatementEntry->assignCredits
(array('link' => array('Customer'),
'conditions' => array('Customer.id' => $customer_id)),
'conditions' => array('Customer.id' => $transaction['customer_id'])),
($transaction['type'] == 'RECEIPT'
? $ret['transaction_id']
: null));