Suppressed all the debug print statements from transaction insertion.
git-svn-id: file:///svn-source/pmgr/branches/yafr_20090716@398 97e9348a-65ac-dc4b-aefc-98561f571b83
This commit is contained in:
@@ -19,25 +19,25 @@ class DoubleEntry extends AppModel {
|
||||
* (not in a pre-existing double entry)
|
||||
*/
|
||||
function verifyDoubleEntry($entry1, $entry2, $entry1_tender = null) {
|
||||
pr(array("DoubleEntry::verifyDoubleEntry()"
|
||||
=> compact('entry1', 'entry2', 'entry1_tender')));
|
||||
/* pr(array("DoubleEntry::verifyDoubleEntry()" */
|
||||
/* => compact('entry1', 'entry2', 'entry1_tender'))); */
|
||||
|
||||
$LE = new LedgerEntry();
|
||||
if (!$LE->verifyLedgerEntry($entry1, $entry1_tender)) {
|
||||
pr(array("DoubleEntry::verifyDoubleEntry()"
|
||||
=> "Entry1 verification failed"));
|
||||
/* pr(array("DoubleEntry::verifyDoubleEntry()" */
|
||||
/* => "Entry1 verification failed")); */
|
||||
return false;
|
||||
}
|
||||
if (!$LE->verifyLedgerEntry($entry2)) {
|
||||
pr(array("DoubleEntry::verifyDoubleEntry()"
|
||||
=> "Entry2 verification failed"));
|
||||
/* pr(array("DoubleEntry::verifyDoubleEntry()" */
|
||||
/* => "Entry2 verification failed")); */
|
||||
return false;
|
||||
}
|
||||
|
||||
if (!(($entry1['crdr'] === 'DEBIT' && $entry2['crdr'] === 'CREDIT') ||
|
||||
($entry1['crdr'] === 'CREDIT' && $entry2['crdr'] === 'DEBIT'))) {
|
||||
pr(array("DoubleEntry::verifyDoubleEntry()"
|
||||
=> "Double Entry verification failed"));
|
||||
/* pr(array("DoubleEntry::verifyDoubleEntry()" */
|
||||
/* => "Double Entry verification failed")); */
|
||||
return false;
|
||||
}
|
||||
|
||||
@@ -52,8 +52,8 @@ class DoubleEntry extends AppModel {
|
||||
*/
|
||||
|
||||
function addDoubleEntry($entry1, $entry2, $entry1_tender = null) {
|
||||
pr(array('DoubleEntry::addDoubleEntry' =>
|
||||
compact('entry1', 'entry2', 'entry1_tender')));
|
||||
/* pr(array('DoubleEntry::addDoubleEntry' => */
|
||||
/* compact('entry1', 'entry2', 'entry1_tender'))); */
|
||||
|
||||
$ret = array();
|
||||
if (!$this->verifyDoubleEntry($entry1, $entry2, $entry1_tender))
|
||||
@@ -81,9 +81,9 @@ class DoubleEntry extends AppModel {
|
||||
$double_entry['credit_entry_id'] =
|
||||
($entry1['crdr'] === 'CREDIT') ? $ret['Entry1']['ledger_entry_id'] : $ret['Entry2']['ledger_entry_id'];
|
||||
|
||||
pr(array('DoubleEntry::addDoubleEntry' =>
|
||||
array('checkpoint' => 'Pre-Save')
|
||||
+ compact('double_entry')));
|
||||
/* pr(array('DoubleEntry::addDoubleEntry' => */
|
||||
/* array('checkpoint' => 'Pre-Save') */
|
||||
/* + compact('double_entry'))); */
|
||||
|
||||
$this->create();
|
||||
if (!$this->save($double_entry))
|
||||
|
||||
Reference in New Issue
Block a user