From: <ex...@us...> - 2016-02-01 13:28:09
|
Revision: 7454 http://sourceforge.net/p/web-erp/reponame/7454 Author: exsonqu Date: 2016-02-01 13:28:07 +0000 (Mon, 01 Feb 2016) Log Message: ----------- 1/2/15 Exson: Make GL Posting really transaction in GLPostings.inc. Modified Paths: -------------- trunk/includes/GLPostings.inc Modified: trunk/includes/GLPostings.inc =================================================================== --- trunk/includes/GLPostings.inc 2016-02-01 13:18:28 UTC (rev 7453) +++ trunk/includes/GLPostings.inc 2016-02-01 13:28:07 UTC (rev 7454) @@ -93,12 +93,14 @@ $sql = "UPDATE chartdetails SET actual = actual + " . $TotalAmount . " WHERE accountcode = '" . $CurrentAccount . "' AND period= '" . $CurrPeriod . "'"; - $PostPrd = DB_query($sql); + $ErrMsg = _('Failed to update actual amount in chartdetails table'); + $PostPrd = DB_query($sql,$ErrMsg,'',true); /*Update the BFwd for all following ChartDetail records */ $sql = "UPDATE chartdetails SET bfwd = bfwd + " . $TotalAmount . " WHERE accountcode = '" . $CurrentAccount . "' AND period > '" . $CurrPeriod . "'"; - $PostBFwds = DB_query($sql); + $ErrMsg = _('Failed to update bfwd amount in chartdetails table'); + $PostBFwds = DB_query($sql,$ErrMsg,'',true); $TotalAmount = 0; } $CurrentAccount = $UnpostedTrans['account']; @@ -109,18 +111,21 @@ $sql = "UPDATE chartdetails SET actual = actual + " . $TotalAmount . " WHERE accountcode = '" . $CurrentAccount . "' AND period= '" . $CurrPeriod . "'"; - $PostPrd = DB_query($sql); + $ErrMsg = _('Failed to update actual amount in chartdetails table'); + $PostPrd = DB_query($sql,$ErrMsg,'',true); /*Update the BFwd for all following ChartDetail records */ $sql = "UPDATE chartdetails SET bfwd = bfwd + " . $TotalAmount . " WHERE accountcode = '" . $CurrentAccount . "' AND period > '" . $CurrPeriod . "'"; - $PostBFwds = DB_query($sql); + $ErrMsg = _('Failed to update actual amount in chartdetails table'); + $PostBFwds = DB_query($sql,$ErrMsg,'',true); } $sql = "UPDATE gltrans SET posted = 1 WHERE periodno = '" . $CurrPeriod . "' AND posted=0"; - $Posted = DB_query($sql); + $ErrMsg = _('Failed to update gltrans table'); + $Posted = DB_query($sql,$ErrMsg,'',true); $TransCommit = DB_Txn_Commit(); } -?> \ No newline at end of file +?> |