From: <dai...@us...> - 2013-06-16 03:14:27
|
Revision: 6025 http://sourceforge.net/p/web-erp/reponame/6025 Author: daintree Date: 2013-06-16 03:14:24 +0000 (Sun, 16 Jun 2013) Log Message: ----------- fix GLTransInquiry.php for exchange diff double ups of analysis Modified Paths: -------------- trunk/CustomerReceipt.php trunk/GLTransInquiry.php Modified: trunk/CustomerReceipt.php =================================================================== --- trunk/CustomerReceipt.php 2013-06-16 02:37:05 UTC (rev 6024) +++ trunk/CustomerReceipt.php 2013-06-16 03:14:24 UTC (rev 6025) @@ -887,6 +887,9 @@ if (!isset($_SESSION['ReceiptBatch']->Narrative)) { $_SESSION['ReceiptBatch']->Narrative=''; } +if (!isset($_POST['Currency'])){ + $_POST['Currency'] = $_SESSION['CompanyRecord']['currencydefault']; +} echo '<tr> <td>' . _('Narrative') . ':</td> <td><input tabindex="7" type="text" name="BatchNarrative" maxlength="50" size="52" value="' . $_SESSION['ReceiptBatch']->Narrative . '" /></td> Modified: trunk/GLTransInquiry.php =================================================================== --- trunk/GLTransInquiry.php 2013-06-16 02:37:05 UTC (rev 6024) +++ trunk/GLTransInquiry.php 2013-06-16 03:14:24 UTC (rev 6025) @@ -69,6 +69,7 @@ $Posted = _('Yes'); $CreditTotal = 0; $DebitTotal = 0; + $AnalysisCompleted = 'Not Yet'; $j=1; while ( $TransRow = DB_fetch_array($TransResult) ) { $TranDate = ConvertSQLDate($TransRow['trandate']); @@ -86,7 +87,7 @@ if ( $TransRow['posted']==0 ){ $Posted = _('No'); } - if ( $TransRow['account'] == $_SESSION['CompanyRecord']['debtorsact'] ) { + if ( $TransRow['account'] == $_SESSION['CompanyRecord']['debtorsact'] AND $AnalysisCompleted == 'Not Yet') { $URL = $RootPath . '/CustomerInquiry.php?CustomerID='; $date = '&TransAfterDate=' . $TranDate; @@ -101,7 +102,8 @@ WHERE debtortrans.type = '" . $TransRow['type'] . "' AND debtortrans.transno = '" . $_GET['TransNo']. "'"; $DetailResult = DB_query($DetailSQL,$db); - } elseif ( $TransRow['account'] == $_SESSION['CompanyRecord']['creditorsact'] ) { + + } elseif ( $TransRow['account'] == $_SESSION['CompanyRecord']['creditorsact'] AND $AnalysisCompleted == 'Not Yet' ) { $URL = $RootPath . '/SupplierInquiry.php?SupplierID='; $date = '&FromDate=' . $TranDate; @@ -115,6 +117,7 @@ WHERE supptrans.type = '" . $TransRow['type'] . "' AND supptrans.transno = '" . $_GET['TransNo'] . "'"; $DetailResult = DB_query($DetailSQL,$db); + } else { $URL = $RootPath . '/GLAccountInquiry.php?Account=' . $TransRow['account']; @@ -139,14 +142,15 @@ </tr>'; } - if ($DetailResult) { + if ($DetailResult AND $AnalysisCompleted == 'Not Yet') { + while ( $DetailRow = DB_fetch_array($DetailResult) ) { if ( $TransRow['amount'] > 0){ if ($TransRow['account'] == $_SESSION['CompanyRecord']['debtorsact']) { $Debit = locale_number_format(($DetailRow['ovamount'] + $DetailRow['ovgst']+ $DetailRow['ovfreight']) / $DetailRow['rate'],$_SESSION['CompanyRecord']['decimalplaces']); $Credit = ' '; } else { - $Debit = locale_number_format((-$DetailRow['ovamount'] - $DetailRow['ovgst']) / $DetailRow['rate'],$_SESSION['CompanyRecord']['decimalplaces']); + $Debit = locale_number_format(($DetailRow['ovamount'] + $DetailRow['ovgst']) / $DetailRow['rate'],$_SESSION['CompanyRecord']['decimalplaces']); $Credit = ' '; } } else { @@ -154,7 +158,7 @@ $Credit = locale_number_format(-($DetailRow['ovamount'] + $DetailRow['ovgst'] + $DetailRow['ovfreight']) / $DetailRow['rate'],$_SESSION['CompanyRecord']['decimalplaces']); $Debit = ' '; } else { - $Credit = locale_number_format(($DetailRow['ovamount'] + $DetailRow['ovgst']) / $DetailRow['rate'],$_SESSION['CompanyRecord']['decimalplaces']); + $Credit = locale_number_format(-($DetailRow['ovamount'] + $DetailRow['ovgst']) / $DetailRow['rate'],$_SESSION['CompanyRecord']['decimalplaces']); $Debit = ' '; } } @@ -176,6 +180,7 @@ </tr>'; } DB_free_result($DetailResult); + $AnalysisCompleted = 'Done'; } } DB_free_result($TransResult); |