|
From: <dai...@us...> - 2012-11-03 00:09:48
|
Revision: 5733
http://sourceforge.net/p/web-erp/reponame/5733
Author: daintree
Date: 2012-11-03 00:09:44 +0000 (Sat, 03 Nov 2012)
Log Message:
-----------
David Short improvement to GLPostings.inc
Modified Paths:
--------------
trunk/doc/Change.log
trunk/includes/GLPostings.inc
Modified: trunk/doc/Change.log
===================================================================
--- trunk/doc/Change.log 2012-11-02 23:45:41 UTC (rev 5732)
+++ trunk/doc/Change.log 2012-11-03 00:09:44 UTC (rev 5733)
@@ -1,5 +1,6 @@
webERP Change Log
+3/11/12 David Short: improve GLPostings.inc just update all gltrans posted once the postings are done rather than a whole load of updates for each gltrans posted
25/10/12 Phil: Added telephone and email to supplier search - SelectSupplier.php
25/10/12 Phil: Rounding error prevented CounterSales.php from posting a sale where currency was rounding to 0 decimal places - reported by Arwan
20/10/12 Samudaya Nanayakkara: Fixed the problem of Authoriser drop down selection when try to edit a Internal Departments.
Modified: trunk/includes/GLPostings.inc
===================================================================
--- trunk/includes/GLPostings.inc 2012-11-02 23:45:41 UTC (rev 5732)
+++ trunk/includes/GLPostings.inc 2012-11-03 00:09:44 UTC (rev 5733)
@@ -82,13 +82,13 @@
for ( $CurrPeriod = $CreateFrom; $CurrPeriod <= $CreateTo; $CurrPeriod++ ) {
$sql = "SELECT counterindex,
- periodno,
- account,
- amount
- FROM gltrans
- WHERE posted=0
- AND periodno='" . $CurrPeriod . "'
- ORDER BY account";
+ periodno,
+ account,
+ amount
+ FROM gltrans
+ WHERE posted=0
+ AND periodno='" . $CurrPeriod . "'
+ ORDER BY account";
$UnpostedTransResult = DB_query($sql, $db);
@@ -99,23 +99,22 @@
if($CurrentAccount != $UnpostedTrans['account']) {
if($CurrentAccount != 0) {
$sql = "UPDATE chartdetails SET actual = actual + " . $TotalAmount . "
- WHERE accountcode = '" . $CurrentAccount . "'
- AND period= '" . $CurrPeriod . "'";
+ WHERE accountcode = '" . $CurrentAccount . "'
+ AND period= '" . $CurrPeriod . "'";
$PostPrd = DB_query($sql,$db);
/*Update the BFwd for all following ChartDetail records */
$sql = "UPDATE chartdetails SET bfwd = bfwd + " . $TotalAmount . "
- WHERE accountcode = '" . $CurrentAccount . "'
- AND period > '" . $CurrPeriod . "'";
+ WHERE accountcode = '" . $CurrentAccount . "'
+ AND period > '" . $CurrPeriod . "'";
$PostBFwds = DB_query($sql,$db);
}
$TotalAmount = 0;
$CurrentAccount = $UnpostedTrans['account'];
}
- $TotalAmount = filter_number_format($TotalAmount + $UnpostedTrans['amount']);
- /*Update the Actual charge in the period of the transaction */
- $sql = "UPDATE gltrans SET posted = 1 WHERE counterindex = '" . $UnpostedTrans['counterindex'] . "'";
- $Posted = DB_query($sql,$db);
+ $TotalAmount += $UnpostedTrans['amount'];
}
+ $sql = "UPDATE gltrans SET posted = 1 WHERE periodno = '" . $CurrPeriod . "' AND posted=0";
+ $Posted = DB_query($sql,$db);
// There will be one chartdetail update outstanding if we processed anything
if($CurrentAccount != 0) {
$sql = "UPDATE chartdetails SET actual = actual + " . $TotalAmount . "
|