From: <dai...@us...> - 2011-09-04 03:12:27
|
Revision: 4676 http://web-erp.svn.sourceforge.net/web-erp/?rev=4676&view=rev Author: daintree Date: 2011-09-04 03:12:20 +0000 (Sun, 04 Sep 2011) Log Message: ----------- 4/9/11 Marcos Skambraks: SelectOrderItems.php and CounterSales.php removed incorrect !== comparisons sh/been != comparisons 4/9/11 Marcos Skambraks: modified tcpdf.php to just send the pdf header - was causing issues with apache fastcgi module Modified Paths: -------------- trunk/CounterSales.php trunk/SelectOrderItems.php trunk/doc/Change.log trunk/includes/tcpdf/tcpdf.php Modified: trunk/CounterSales.php =================================================================== --- trunk/CounterSales.php 2011-09-03 11:07:57 UTC (rev 4675) +++ trunk/CounterSales.php 2011-09-04 03:12:20 UTC (rev 4676) @@ -85,7 +85,11 @@ exit; } if (isset($_GET['DebtorNo'])) { - $_SESSION['Items'.$identifier]->DebtorNo = $_GET['DebtorNo']; + $_SESSION['Items'.$identifier]->DebtorNo = $_GET['DebtorNo'];tcpdf.php line 5826: +// header('Content-Type: application/force-download'); +// header('Content-Type: application/octet-stream',false); +// header('Content-Type: application/download',false); + $_SESSION['Items'.$identifier]->Branch = $_GET['BranchNo']; } else { $_SESSION['Items'.$identifier]->Branch = $myrow['cashsalebranch']; @@ -221,9 +225,9 @@ if (isset($_POST['Search']) or isset($_POST['Next']) or isset($_POST['Prev'])){ - if ($_POST['Keywords']!=='' AND $_POST['StockCode']=='') { + if ($_POST['Keywords']!='' AND $_POST['StockCode']=='') { $msg='<div class="page_help_text">' . _('Item description has been used in search') . '.</div>'; - } else if ($_POST['StockCode']!=='' AND $_POST['Keywords']=='') { + } else if ($_POST['StockCode']!='' AND $_POST['Keywords']=='') { $msg='<div class="page_help_text">' . _('Item Code has been used in search') . '.</div>'; } else if ($_POST['Keywords']=='' AND $_POST['StockCode']=='') { $msg='<div class="page_help_text">' . _('Stock Category has been used in search') . '.</div>'; Modified: trunk/SelectOrderItems.php =================================================================== --- trunk/SelectOrderItems.php 2011-09-03 11:07:57 UTC (rev 4675) +++ trunk/SelectOrderItems.php 2011-09-04 03:12:20 UTC (rev 4676) @@ -757,9 +757,9 @@ $msg =''; if (isset($_POST['Search']) or isset($_POST['Next']) or isset($_POST['Prev'])){ - if ($_POST['Keywords']!=='' AND $_POST['StockCode']=='') { + if ($_POST['Keywords']!='' AND $_POST['StockCode']=='') { $msg='</b><div class="page_help_text">' . _('Order Item description has been used in search') . '.</div>'; - } elseif ($_POST['StockCode']!=='' AND $_POST['Keywords']=='') { + } elseif ($_POST['StockCode']!='' AND $_POST['Keywords']=='') { $msg='</b><div class="page_help_text">' . _('Stock Code has been used in search') . '.</div>'; } elseif ($_POST['Keywords']=='' AND $_POST['StockCode']=='') { $msg='</b><div class="page_help_text">' . _('Stock Category has been used in search') . '.</div>'; Modified: trunk/doc/Change.log =================================================================== --- trunk/doc/Change.log 2011-09-03 11:07:57 UTC (rev 4675) +++ trunk/doc/Change.log 2011-09-04 03:12:20 UTC (rev 4676) @@ -1,5 +1,7 @@ webERP Change Log +4/9/11 Marcos Skambraks: SelectOrderItems.php and CounterSales.php removed incorrect !== comparisons sh/been != comparisons +4/9/11 Marcos Skambraks: modified tcpdf.php to just send the pdf header - was causing issues with apache fastcgi module 3/9/11 Ricard: Changed SelectProduct.php to show just current prices 3/9/11 Phil: Changed SelectCustomer to use %% around each parameter to use just a single SQL statement rather than several which ignored other inputs - as suggested by Marcos Skambraks 2/9/11 Phil: Made locale_number_format() as per Tim's instruction that displays numbers in the format of the locale in includes/LanguageSetup.php and replaced all occurrences of number_format() with locale_number_format() @@ -14,7 +16,7 @@ 21/8/11 Phil: Fixed bug that duplicated purchase order items when more than one item was added to an existing purchase order 21/8/11 Phil: BackupDatabase.php Delete link now deletes any backup files in the company directory in case any were left there before - as this is a serious security issue if files are left on the web-server 19/8/11 Phil: Fixed bug in Stocks.php should have used Date($_SESSION['DefaultDateFormat']) instead of Date('Y-m-d') inside GetPeriod function as pointed out by Ricard -16/8/11 Tim: SelectCustomer.php fixed selection of customer where the first one was selected needed to kick off count at 0. +16/8/11 Tim: SelectCustomer.php fixed selection of customer where the first one was selected needed /to kick off count at 0. 19/8/11 Phil: Remove redundant field stockmaster.lastcurcostdate 19/8/11 Ricard: Fine tuning formatting PDFStockNegatives.php 19/8/11 Carlos Urbieta Cabrera: security.png image was missing now added Modified: trunk/includes/tcpdf/tcpdf.php =================================================================== --- trunk/includes/tcpdf/tcpdf.php 2011-09-03 11:07:57 UTC (rev 4675) +++ trunk/includes/tcpdf/tcpdf.php 2011-09-04 03:12:20 UTC (rev 4676) @@ -5823,9 +5823,9 @@ header('Expires: Sat, 26 Jul 1997 05:00:00 GMT'); // Date in the past header('Last-Modified: '.gmdate('D, d M Y H:i:s').' GMT'); // force download dialog - header('Content-Type: application/force-download'); - header('Content-Type: application/octet-stream', false); - header('Content-Type: application/download', false); + //header('Content-Type: application/force-download'); + //header('Content-Type: application/octet-stream', false); + //header('Content-Type: application/download', false); header('Content-Type: application/pdf', false); // use the Content-Disposition header to supply a recommended filename header('Content-Disposition: attachment; filename="'.basename($name).'";'); This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <dai...@us...> - 2011-09-04 10:10:20
|
Revision: 4677 http://web-erp.svn.sourceforge.net/web-erp/?rev=4677&view=rev Author: daintree Date: 2011-09-04 10:10:14 +0000 (Sun, 04 Sep 2011) Log Message: ----------- 4/9/11 Phil: Removed the stock code from form entities in SelectOrderItems.php and PO_Items.php to prevent issues with some characters in stock codes as suggested by Tim Modified Paths: -------------- trunk/GLTransInquiry.php trunk/PO_Items.php trunk/Payments.php trunk/SelectOrderItems.php Modified: trunk/GLTransInquiry.php =================================================================== --- trunk/GLTransInquiry.php 2011-09-04 03:12:20 UTC (rev 4676) +++ trunk/GLTransInquiry.php 2011-09-04 10:10:14 UTC (rev 4677) @@ -66,7 +66,7 @@ $Posted = _('Yes'); $CreditTotal = $DebitTotal = 0; - + $j=1; while ( $TransRow = DB_fetch_array($TransResult) ) { $TranDate = ConvertSQLDate($TransRow['trandate']); $DetailResult = false; @@ -120,7 +120,7 @@ if ( $TransRow['posted']==0 ) { $Posted = _('No'); } - $j=0; + if ($j==1) { echo '<tr class="OddTableRows">'; $j=0; Modified: trunk/PO_Items.php =================================================================== --- trunk/PO_Items.php 2011-09-04 03:12:20 UTC (rev 4676) +++ trunk/PO_Items.php 2011-09-04 10:10:14 UTC (rev 4677) @@ -524,10 +524,11 @@ */ foreach ($_POST as $FormVariableName => $Quantity) { - + /*The form entity name is of the format NewQtyX where X is the index number that identifies the stock item code held in the hidden StockIDX form variable + * */ if (mb_substr($FormVariableName, 0, 6)=='NewQty' AND $Quantity!=0) { //if the form variable represents a Qty to add to the order - $ItemCode = mb_substr($FormVariableName, 6, mb_strlen($FormVariableName)-6); + $ItemCode = $_POST['StockID' . mb_substr($FormVariableName, 6)]; $AlreadyOnThisOrder = 0; if ($_SESSION['PO_AllowSameItemMultipleTimes'] ==false){ @@ -1123,9 +1124,10 @@ <td class="number">' . $ConversionFactor .'</td> <td>' . $OrderUnits . '</td> <td>' . $ImageSource . '</td> - <td><input class="number" type="text" size="6" value="0" name="NewQty' . $myrow['stockid'] . '"></td> + <td><input class="number" type="text" size="6" value="0" name="NewQty' . $j . '"></td> + <input type="hidden" name="StockID' . $j .'" . value="' . $myrow['stockid'] . '" /> </tr>'; - + $j++; $PartsDisplayed++; if ($PartsDisplayed == $Maximum_Number_Of_Parts_To_Show){ break; Modified: trunk/Payments.php =================================================================== --- trunk/Payments.php 2011-09-04 03:12:20 UTC (rev 4676) +++ trunk/Payments.php 2011-09-04 10:10:14 UTC (rev 4677) @@ -112,10 +112,14 @@ $_SESSION['PaymentDetail']->Account=$_POST['BankAccount']; /*Get the bank account currency and set that too */ $ErrMsg = _('Could not get the currency of the bank account'); - $result = DB_query("SELECT currcode, decimalplaces + $result = DB_query("SELECT currcode, + decimalplaces FROM bankaccounts INNER JOIN currencies - ON bankaccounts.currcode=currencies.currabrev - WHERE accountcode ='" . $_POST['BankAccount'] . "'",$db,$ErrMsg); + ON bankaccounts.currcode = currencies.currabrev + WHERE accountcode ='" . $_POST['BankAccount'] . "'", + $db, + $ErrMsg); + $myrow = DB_fetch_array($result); $_SESSION['PaymentDetail']->AccountCurrency=$myrow['currcode']; $_SESSION['PaymentDetail']->CurrDecimalPlaces=$myrow['decimalplaces']; @@ -710,11 +714,11 @@ echo '<tr><th colspan="4"><font size="3" color="blue">' . _('Payment'); -if ($_SESSION['PaymentDetail']->SupplierID!=""){ +if ($_SESSION['PaymentDetail']->SupplierID!=''){ echo ' ' . _('to') . ' ' . $_SESSION['PaymentDetail']->SuppName; } -if ($_SESSION['PaymentDetail']->BankAccountName!=""){ +if ($_SESSION['PaymentDetail']->BankAccountName!=''){ echo ' ' . _('from the') . ' ' . $_SESSION['PaymentDetail']->BankAccountName; } @@ -752,7 +756,6 @@ echo '</select></td></tr>'; } - echo '<tr><td>' . _('Date Paid') . ':</td> <td><input type="text" name="DatePaid" class="date" alt="'.$_SESSION['DefaultDateFormat'].'" maxlength=10 size=11 onChange="isDate(this, this.value, '."'".$_SESSION['DefaultDateFormat']."'".')" value="' . $_SESSION['PaymentDetail']->DatePaid . '"></td> </tr>'; Modified: trunk/SelectOrderItems.php =================================================================== --- trunk/SelectOrderItems.php 2011-09-04 03:12:20 UTC (rev 4676) +++ trunk/SelectOrderItems.php 2011-09-04 10:10:14 UTC (rev 4677) @@ -22,10 +22,10 @@ unset($_POST['PartSearch']); } -if (isset($_POST['order_items'])){ - foreach ($_POST as $key => $value) { - if (mb_strstr($key,'itm')) { - $NewItem_array[mb_substr($key,3)] = trim($value); +if (isset($_POST['SelectingOrderItems'])){ + foreach ($_POST as $FormVariable => $Quantity) { + if (mb_strpos($FormVariable,'OrderQty')!==false) { + $NewItem_array[$_POST['StockID' . mb_substr($FormVariable,8)]] = trim($Quantity); } } } @@ -859,7 +859,7 @@ if (!isset($Offset) or $Offset<0) { $Offset=0; } - $SQL = $SQL . " LIMIT " . $_SESSION['DefaultDisplayRecordsMax'] . " OFFSET " . number_format($_SESSION['DefaultDisplayRecordsMax']*$Offset); + $SQL = $SQL . " LIMIT " . $_SESSION['DefaultDisplayRecordsMax'] . " OFFSET " . strval($_SESSION['DefaultDisplayRecordsMax']*$Offset); $ErrMsg = _('There is a problem selecting the part records to display because'); $DbgMsg = _('The SQL used to get the part selection was'); @@ -900,7 +900,7 @@ /*Process Quick Entry */ /* If enter is pressed on the quick entry screen, the default button may be Recalculate */ - if (isset($_POST['order_items']) + if (isset($_POST['SelectingOrderItems']) OR isset($_POST['QuickEntry']) OR isset($_POST['Recalculate'])){ @@ -1268,7 +1268,7 @@ } /*end of if its a new item */ - if (isset($NewItem_array) AND isset($_POST['order_items'])){ + if (isset($NewItem_array) AND isset($_POST['SelectingOrderItems'])){ /* get the item details from the database and hold them in the cart object make the quantity 1 by default then add it to the cart */ /*Now figure out if the item is a kit set - the field MBFlag='K'*/ $AlreadyWarnedAboutCredit = false; @@ -1524,7 +1524,8 @@ <th>' . _('Quantity') . '</th> </tr>'; echo $TableHeader; - $j = 1; + $i=0; + $j=1; $k=0; //row colour counter while ($myrow=DB_fetch_array($result2)) { @@ -1610,7 +1611,8 @@ <td class="number">%s</td> <td class="number">%s</td> <td class="number">%s</td> - <td><font size=1><input class="number" tabindex='. number_format($j+7).' type="textbox" size=6 name="itm'.$myrow['stockid'].'" value=0> + <td><font size=1><input class="number" tabindex='. strval($j+7).' type="textbox" size=6 name="OrderQty' . $i . '" value=0 /> + <input type="hidden" name="StockID' . $i . '" value="' . $myrow['stockid'] . '" /> </td> </tr>', $myrow['stockid'], @@ -1627,7 +1629,7 @@ #end of page full new headings if } #end of while loop for Frequently Ordered Items - echo '<td style="text-align:center" colspan=8><input type="hidden" name="order_items" value=1><input tabindex='.number_format($j+8).' type="submit" value="'._('Add to Sales Order').'"></td>'; + echo '<td style="text-align:center" colspan=8><input type="hidden" name="SelectingOrderItems" value=1><input tabindex='.strval($j+8).' type="submit" value="'._('Add to Sales Order').'"></td>'; echo '</table>'; } //end of if Frequently Ordered Items > 0 echo '<p><div class="centre"><b><p>' . $msg . '</b></p>'; @@ -1692,9 +1694,9 @@ echo '<form action="' . $_SERVER['PHP_SELF'] . '?identifier='.$identifier . '" method=post name="orderform">'; echo '<input type="hidden" name="FormID" value="' . $_SESSION['FormID'] . '" />'; echo '<table class="table1">'; - echo '<tr><td colspan=><input type="hidden" name="previous" value='.number_format($Offset-1).'><input tabindex='.number_format($j+8).' type="submit" name="Prev" value="'._('Prev').'"></td>'; - echo '<td style="text-align:center" colspan=6><input type="hidden" name="order_items" value=1><input tabindex='.number_format($j+9).' type="submit" value="'._('Add to Sales Order').'"></td>'; - echo '<td colspan=><input type="hidden" name="nextlist" value='.number_format($Offset+1).'><input tabindex='.number_format($j+10).' type="submit" name="Next" value="'._('Next').'"></td></tr>'; + echo '<tr><td colspan=><input type="hidden" name="previous" value='.strval($Offset-1).'><input tabindex='.strval($j+8).' type="submit" name="Prev" value="'._('Prev').'"></td>'; + echo '<td style="text-align:center" colspan=6><input type="hidden" name="SelectingOrderItems" value=1><input tabindex='.strval($j+9).' type="submit" value="'._('Add to Sales Order').'"></td>'; + echo '<td colspan=><input type="hidden" name="nextlist" value='.strval($Offset+1).'><input tabindex='.strval($j+10).' type="submit" name="Next" value="'._('Next').'"></td></tr>'; $TableHeader = '<tr> <th>' . _('Code') . '</th> <th>' . _('Description') . '</th> @@ -1707,7 +1709,7 @@ </tr>'; echo $TableHeader; $ImageSource = _('No Image'); - + $i=0; $k=0; //row colour counter while ($myrow=DB_fetch_array($SearchResult)) { @@ -1793,7 +1795,8 @@ <td class="number">%s</td> <td class="number">%s</td> <td class="number">%s</td> - <td><font size=1><input class="number" tabindex='.number_format($j+7).' type="textbox" size=6 name="itm'.$myrow['stockid'].'" value=0> + <td><font size=1><input class="number" tabindex='.strval($j+7).' type="textbox" size=6 name="OrderQty'. $i . '" value=0 /> + <input type="hidden" name="StockID'. $i . '" value="' . $myrow['stockid']. '" /> </td> </tr>', $myrow['stockid'], @@ -1803,6 +1806,7 @@ locale_number_format($DemandQty,$QOHRow['decimalplaces']), locale_number_format($OnOrder,$QOHRow['decimalplaces']), locale_number_format($Available,$QOHRow['decimalplaces']) ); + $i++; if ($j==1) { $jsCall = '<script type="text/javascript">if (document.SelectParts) {defaultControl(document.SelectParts.itm'.$myrow['stockid'].');}</script>'; } @@ -1810,9 +1814,9 @@ #end of page full new headings if } #end of while loop - echo '<tr><td><input type="hidden" name="previous" value='. number_format($Offset-1).'><input tabindex='. number_format($j+7).' type="submit" name="Prev" value="'._('Prev').'"></td>'; - echo '<td style="text-align:center" colspan=6><input type="hidden" name="order_items" value=1><input tabindex='. number_format($j+8).' type="submit" value="'._('Add to Sales Order').'"></td>'; - echo '<td><input type="hidden" name="nextlist" value='.number_format($Offset+1).'><input tabindex='.number_format($j+9).' type="submit" name="Next" value="'._('Next').'"></td></tr>'; + echo '<tr><td><input type="hidden" name="previous" value='. strval($Offset-1).'><input tabindex='. strval($j+7).' type="submit" name="Prev" value="'._('Prev').'"></td>'; + echo '<td style="text-align:center" colspan=6><input type="hidden" name="SelectingOrderItems" value=1><input tabindex='. strval($j+8).' type="submit" value="'._('Add to Sales Order').'"></td>'; + echo '<td><input type="hidden" name="nextlist" value='.strval($Offset+1).'><input tabindex='.strval($j+9).' type="submit" name="Next" value="'._('Next').'"></td></tr>'; echo '</table></form>'; echo $jsCall; This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <dai...@us...> - 2011-09-04 10:10:21
|
Revision: 4677 http://web-erp.svn.sourceforge.net/web-erp/?rev=4677&view=rev Author: daintree Date: 2011-09-04 10:10:14 +0000 (Sun, 04 Sep 2011) Log Message: ----------- 4/9/11 Phil: Removed the stock code from form entities in SelectOrderItems.php and PO_Items.php to prevent issues with some characters in stock codes as suggested by Tim Modified Paths: -------------- trunk/GLTransInquiry.php trunk/PO_Items.php trunk/Payments.php trunk/SelectOrderItems.php Modified: trunk/GLTransInquiry.php =================================================================== --- trunk/GLTransInquiry.php 2011-09-04 03:12:20 UTC (rev 4676) +++ trunk/GLTransInquiry.php 2011-09-04 10:10:14 UTC (rev 4677) @@ -66,7 +66,7 @@ $Posted = _('Yes'); $CreditTotal = $DebitTotal = 0; - + $j=1; while ( $TransRow = DB_fetch_array($TransResult) ) { $TranDate = ConvertSQLDate($TransRow['trandate']); $DetailResult = false; @@ -120,7 +120,7 @@ if ( $TransRow['posted']==0 ) { $Posted = _('No'); } - $j=0; + if ($j==1) { echo '<tr class="OddTableRows">'; $j=0; Modified: trunk/PO_Items.php =================================================================== --- trunk/PO_Items.php 2011-09-04 03:12:20 UTC (rev 4676) +++ trunk/PO_Items.php 2011-09-04 10:10:14 UTC (rev 4677) @@ -524,10 +524,11 @@ */ foreach ($_POST as $FormVariableName => $Quantity) { - + /*The form entity name is of the format NewQtyX where X is the index number that identifies the stock item code held in the hidden StockIDX form variable + * */ if (mb_substr($FormVariableName, 0, 6)=='NewQty' AND $Quantity!=0) { //if the form variable represents a Qty to add to the order - $ItemCode = mb_substr($FormVariableName, 6, mb_strlen($FormVariableName)-6); + $ItemCode = $_POST['StockID' . mb_substr($FormVariableName, 6)]; $AlreadyOnThisOrder = 0; if ($_SESSION['PO_AllowSameItemMultipleTimes'] ==false){ @@ -1123,9 +1124,10 @@ <td class="number">' . $ConversionFactor .'</td> <td>' . $OrderUnits . '</td> <td>' . $ImageSource . '</td> - <td><input class="number" type="text" size="6" value="0" name="NewQty' . $myrow['stockid'] . '"></td> + <td><input class="number" type="text" size="6" value="0" name="NewQty' . $j . '"></td> + <input type="hidden" name="StockID' . $j .'" . value="' . $myrow['stockid'] . '" /> </tr>'; - + $j++; $PartsDisplayed++; if ($PartsDisplayed == $Maximum_Number_Of_Parts_To_Show){ break; Modified: trunk/Payments.php =================================================================== --- trunk/Payments.php 2011-09-04 03:12:20 UTC (rev 4676) +++ trunk/Payments.php 2011-09-04 10:10:14 UTC (rev 4677) @@ -112,10 +112,14 @@ $_SESSION['PaymentDetail']->Account=$_POST['BankAccount']; /*Get the bank account currency and set that too */ $ErrMsg = _('Could not get the currency of the bank account'); - $result = DB_query("SELECT currcode, decimalplaces + $result = DB_query("SELECT currcode, + decimalplaces FROM bankaccounts INNER JOIN currencies - ON bankaccounts.currcode=currencies.currabrev - WHERE accountcode ='" . $_POST['BankAccount'] . "'",$db,$ErrMsg); + ON bankaccounts.currcode = currencies.currabrev + WHERE accountcode ='" . $_POST['BankAccount'] . "'", + $db, + $ErrMsg); + $myrow = DB_fetch_array($result); $_SESSION['PaymentDetail']->AccountCurrency=$myrow['currcode']; $_SESSION['PaymentDetail']->CurrDecimalPlaces=$myrow['decimalplaces']; @@ -710,11 +714,11 @@ echo '<tr><th colspan="4"><font size="3" color="blue">' . _('Payment'); -if ($_SESSION['PaymentDetail']->SupplierID!=""){ +if ($_SESSION['PaymentDetail']->SupplierID!=''){ echo ' ' . _('to') . ' ' . $_SESSION['PaymentDetail']->SuppName; } -if ($_SESSION['PaymentDetail']->BankAccountName!=""){ +if ($_SESSION['PaymentDetail']->BankAccountName!=''){ echo ' ' . _('from the') . ' ' . $_SESSION['PaymentDetail']->BankAccountName; } @@ -752,7 +756,6 @@ echo '</select></td></tr>'; } - echo '<tr><td>' . _('Date Paid') . ':</td> <td><input type="text" name="DatePaid" class="date" alt="'.$_SESSION['DefaultDateFormat'].'" maxlength=10 size=11 onChange="isDate(this, this.value, '."'".$_SESSION['DefaultDateFormat']."'".')" value="' . $_SESSION['PaymentDetail']->DatePaid . '"></td> </tr>'; Modified: trunk/SelectOrderItems.php =================================================================== --- trunk/SelectOrderItems.php 2011-09-04 03:12:20 UTC (rev 4676) +++ trunk/SelectOrderItems.php 2011-09-04 10:10:14 UTC (rev 4677) @@ -22,10 +22,10 @@ unset($_POST['PartSearch']); } -if (isset($_POST['order_items'])){ - foreach ($_POST as $key => $value) { - if (mb_strstr($key,'itm')) { - $NewItem_array[mb_substr($key,3)] = trim($value); +if (isset($_POST['SelectingOrderItems'])){ + foreach ($_POST as $FormVariable => $Quantity) { + if (mb_strpos($FormVariable,'OrderQty')!==false) { + $NewItem_array[$_POST['StockID' . mb_substr($FormVariable,8)]] = trim($Quantity); } } } @@ -859,7 +859,7 @@ if (!isset($Offset) or $Offset<0) { $Offset=0; } - $SQL = $SQL . " LIMIT " . $_SESSION['DefaultDisplayRecordsMax'] . " OFFSET " . number_format($_SESSION['DefaultDisplayRecordsMax']*$Offset); + $SQL = $SQL . " LIMIT " . $_SESSION['DefaultDisplayRecordsMax'] . " OFFSET " . strval($_SESSION['DefaultDisplayRecordsMax']*$Offset); $ErrMsg = _('There is a problem selecting the part records to display because'); $DbgMsg = _('The SQL used to get the part selection was'); @@ -900,7 +900,7 @@ /*Process Quick Entry */ /* If enter is pressed on the quick entry screen, the default button may be Recalculate */ - if (isset($_POST['order_items']) + if (isset($_POST['SelectingOrderItems']) OR isset($_POST['QuickEntry']) OR isset($_POST['Recalculate'])){ @@ -1268,7 +1268,7 @@ } /*end of if its a new item */ - if (isset($NewItem_array) AND isset($_POST['order_items'])){ + if (isset($NewItem_array) AND isset($_POST['SelectingOrderItems'])){ /* get the item details from the database and hold them in the cart object make the quantity 1 by default then add it to the cart */ /*Now figure out if the item is a kit set - the field MBFlag='K'*/ $AlreadyWarnedAboutCredit = false; @@ -1524,7 +1524,8 @@ <th>' . _('Quantity') . '</th> </tr>'; echo $TableHeader; - $j = 1; + $i=0; + $j=1; $k=0; //row colour counter while ($myrow=DB_fetch_array($result2)) { @@ -1610,7 +1611,8 @@ <td class="number">%s</td> <td class="number">%s</td> <td class="number">%s</td> - <td><font size=1><input class="number" tabindex='. number_format($j+7).' type="textbox" size=6 name="itm'.$myrow['stockid'].'" value=0> + <td><font size=1><input class="number" tabindex='. strval($j+7).' type="textbox" size=6 name="OrderQty' . $i . '" value=0 /> + <input type="hidden" name="StockID' . $i . '" value="' . $myrow['stockid'] . '" /> </td> </tr>', $myrow['stockid'], @@ -1627,7 +1629,7 @@ #end of page full new headings if } #end of while loop for Frequently Ordered Items - echo '<td style="text-align:center" colspan=8><input type="hidden" name="order_items" value=1><input tabindex='.number_format($j+8).' type="submit" value="'._('Add to Sales Order').'"></td>'; + echo '<td style="text-align:center" colspan=8><input type="hidden" name="SelectingOrderItems" value=1><input tabindex='.strval($j+8).' type="submit" value="'._('Add to Sales Order').'"></td>'; echo '</table>'; } //end of if Frequently Ordered Items > 0 echo '<p><div class="centre"><b><p>' . $msg . '</b></p>'; @@ -1692,9 +1694,9 @@ echo '<form action="' . $_SERVER['PHP_SELF'] . '?identifier='.$identifier . '" method=post name="orderform">'; echo '<input type="hidden" name="FormID" value="' . $_SESSION['FormID'] . '" />'; echo '<table class="table1">'; - echo '<tr><td colspan=><input type="hidden" name="previous" value='.number_format($Offset-1).'><input tabindex='.number_format($j+8).' type="submit" name="Prev" value="'._('Prev').'"></td>'; - echo '<td style="text-align:center" colspan=6><input type="hidden" name="order_items" value=1><input tabindex='.number_format($j+9).' type="submit" value="'._('Add to Sales Order').'"></td>'; - echo '<td colspan=><input type="hidden" name="nextlist" value='.number_format($Offset+1).'><input tabindex='.number_format($j+10).' type="submit" name="Next" value="'._('Next').'"></td></tr>'; + echo '<tr><td colspan=><input type="hidden" name="previous" value='.strval($Offset-1).'><input tabindex='.strval($j+8).' type="submit" name="Prev" value="'._('Prev').'"></td>'; + echo '<td style="text-align:center" colspan=6><input type="hidden" name="SelectingOrderItems" value=1><input tabindex='.strval($j+9).' type="submit" value="'._('Add to Sales Order').'"></td>'; + echo '<td colspan=><input type="hidden" name="nextlist" value='.strval($Offset+1).'><input tabindex='.strval($j+10).' type="submit" name="Next" value="'._('Next').'"></td></tr>'; $TableHeader = '<tr> <th>' . _('Code') . '</th> <th>' . _('Description') . '</th> @@ -1707,7 +1709,7 @@ </tr>'; echo $TableHeader; $ImageSource = _('No Image'); - + $i=0; $k=0; //row colour counter while ($myrow=DB_fetch_array($SearchResult)) { @@ -1793,7 +1795,8 @@ <td class="number">%s</td> <td class="number">%s</td> <td class="number">%s</td> - <td><font size=1><input class="number" tabindex='.number_format($j+7).' type="textbox" size=6 name="itm'.$myrow['stockid'].'" value=0> + <td><font size=1><input class="number" tabindex='.strval($j+7).' type="textbox" size=6 name="OrderQty'. $i . '" value=0 /> + <input type="hidden" name="StockID'. $i . '" value="' . $myrow['stockid']. '" /> </td> </tr>', $myrow['stockid'], @@ -1803,6 +1806,7 @@ locale_number_format($DemandQty,$QOHRow['decimalplaces']), locale_number_format($OnOrder,$QOHRow['decimalplaces']), locale_number_format($Available,$QOHRow['decimalplaces']) ); + $i++; if ($j==1) { $jsCall = '<script type="text/javascript">if (document.SelectParts) {defaultControl(document.SelectParts.itm'.$myrow['stockid'].');}</script>'; } @@ -1810,9 +1814,9 @@ #end of page full new headings if } #end of while loop - echo '<tr><td><input type="hidden" name="previous" value='. number_format($Offset-1).'><input tabindex='. number_format($j+7).' type="submit" name="Prev" value="'._('Prev').'"></td>'; - echo '<td style="text-align:center" colspan=6><input type="hidden" name="order_items" value=1><input tabindex='. number_format($j+8).' type="submit" value="'._('Add to Sales Order').'"></td>'; - echo '<td><input type="hidden" name="nextlist" value='.number_format($Offset+1).'><input tabindex='.number_format($j+9).' type="submit" name="Next" value="'._('Next').'"></td></tr>'; + echo '<tr><td><input type="hidden" name="previous" value='. strval($Offset-1).'><input tabindex='. strval($j+7).' type="submit" name="Prev" value="'._('Prev').'"></td>'; + echo '<td style="text-align:center" colspan=6><input type="hidden" name="SelectingOrderItems" value=1><input tabindex='. strval($j+8).' type="submit" value="'._('Add to Sales Order').'"></td>'; + echo '<td><input type="hidden" name="nextlist" value='.strval($Offset+1).'><input tabindex='.strval($j+9).' type="submit" name="Next" value="'._('Next').'"></td></tr>'; echo '</table></form>'; echo $jsCall; This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <dai...@us...> - 2011-09-05 10:11:07
|
Revision: 4678 http://web-erp.svn.sourceforge.net/web-erp/?rev=4678&view=rev Author: daintree Date: 2011-09-05 10:10:57 +0000 (Mon, 05 Sep 2011) Log Message: ----------- 5/9/11 Phil: Fixed supplier payment exchange rate ... was being calculated incorrectly from functional exchange rate and the exchange rate between the currency of the bank account and currency of payment. 5/9/11 Phil: GLTransInquiry posted was not retrieved correctly - now fixed Modified Paths: -------------- trunk/AgedDebtors.php trunk/AgedSuppliers.php trunk/BOMExtendedQty.php trunk/BOMIndented.php trunk/BOMIndentedReverse.php trunk/BOMInquiry.php trunk/BOMListing.php trunk/BOMs.php trunk/BankMatching.php trunk/BankReconciliation.php trunk/ConfirmDispatchControlled_Invoice.php trunk/ConfirmDispatch_Invoice.php trunk/ContractBOM.php trunk/ContractCosting.php trunk/ContractOtherReqts.php trunk/Contracts.php trunk/CounterSales.php trunk/Credit_Invoice.php trunk/Currencies.php trunk/CustWhereAlloc.php trunk/CustomerAllocations.php trunk/CustomerInquiry.php trunk/CustomerReceipt.php trunk/CustomerTransInquiry.php trunk/Customers.php trunk/DailyBankTransactions.php trunk/DailySalesInquiry.php trunk/DebtorsAtPeriodEnd.php trunk/DeliveryDetails.php trunk/EmailConfirmation.php trunk/FTP_RadioBeacon.php trunk/FixedAssetDepreciation.php trunk/FixedAssetItems.php trunk/FixedAssetRegister.php trunk/FixedAssetTransfer.php trunk/GLAccountInquiry.php trunk/GLAccountReport.php trunk/GLBalanceSheet.php trunk/GLBudgets.php trunk/GLJournal.php trunk/GLProfit_Loss.php trunk/GLTagProfit_Loss.php trunk/GLTransInquiry.php trunk/GLTrialBalance.php trunk/GoodsReceived.php trunk/InventoryPlanning.php trunk/InventoryPlanningPrefSupplier.php trunk/InventoryQuantities.php trunk/InventoryValuation.php trunk/MRPPlannedPurchaseOrders.php trunk/MRPPlannedWorkOrders.php trunk/MRPReport.php trunk/MRPReschedules.php trunk/MRPShortages.php trunk/MailInventoryValuation.php trunk/Numbers/Words/lang.bg.php trunk/Numbers/Words/lang.fr.php trunk/Numbers/Words/lang.fr_BE.php trunk/OffersReceived.php trunk/OrderDetails.php trunk/OutstandingGRNs.php trunk/PDFBankingSummary.php trunk/PDFChequeListing.php trunk/PDFCustTransListing.php trunk/PDFCustomerList.php trunk/PDFDIFOT.php trunk/PDFDeliveryDifferences.php trunk/PDFGrn.php trunk/PDFLowGP.php trunk/PDFOrderStatus.php trunk/PDFOrdersInvoiced.php trunk/PDFPeriodStockTransListing.php trunk/PDFPickingList.php trunk/PDFPriceList.php trunk/PDFPrintLabel.php trunk/PDFQuotation.php trunk/PDFQuotationPortrait.php trunk/PDFReceipt.php trunk/PDFRemittanceAdvice.php trunk/PDFSuppTransListing.php trunk/PDFTopItems.php trunk/POReport.php trunk/PO_AuthorisationLevels.php trunk/PO_AuthoriseMyOrders.php trunk/PO_Items.php trunk/PO_OrderDetails.php trunk/PO_PDFPurchOrder.php trunk/PO_SelectOSPurchOrder.php trunk/PO_SelectPurchOrder.php trunk/PaymentAllocations.php trunk/Payments.php trunk/PcAssignCashToTab.php trunk/PcAuthorizeExpenses.php trunk/PcClaimExpensesFromTab.php trunk/PcReportTab.php trunk/PcTabs.php trunk/Prices.php trunk/PricesByCost.php trunk/Prices_Customer.php trunk/PrintCheque.php trunk/PrintCustOrder.php trunk/PrintCustOrder_generic.php trunk/PrintCustStatements.php trunk/PrintCustTrans.php trunk/PrintCustTransPortrait.php trunk/PurchData.php trunk/RecurringSalesOrders.php trunk/ReorderLevel.php trunk/ReprintGRN.php trunk/ReverseGRN.php trunk/SalesByTypePeriodInquiry.php trunk/SalesCategoryPeriodInquiry.php trunk/SalesInquiry.php trunk/SalesTopItemsInquiry.php trunk/SelectCompletedOrder.php trunk/SelectCreditItems.php trunk/SelectCustomer.php trunk/SelectOrderItems.php trunk/SelectProduct.php trunk/SelectRecurringSalesOrder.php trunk/SelectSalesOrder.php trunk/SelectSupplier.php trunk/ShipmentCosting.php trunk/Shipments.php trunk/SpecialOrder.php trunk/StockAdjustments.php trunk/StockCheck.php trunk/StockCostUpdate.php trunk/StockDispatch.php trunk/StockLocMovements.php trunk/StockLocStatus.php trunk/StockLocTransferReceive.php trunk/StockMovements.php trunk/StockQuantityByDate.php trunk/StockReorderLevel.php trunk/StockSerialItems.php trunk/StockStatus.php trunk/StockUsage.php trunk/SuppContractChgs.php trunk/SuppCreditGRNs.php trunk/SuppFixedAssetChgs.php trunk/SuppInvGRNs.php trunk/SuppPaymentRun.php trunk/SuppPriceList.php trunk/SuppShiptChgs.php trunk/SuppTransGLAnalysis.php trunk/SupplierAllocations.php trunk/SupplierBalsAtPeriodEnd.php trunk/SupplierCredit.php trunk/SupplierInquiry.php trunk/SupplierInvoice.php trunk/SupplierTenders.php trunk/SupplierTransInquiry.php trunk/Tax.php trunk/TopItems.php trunk/WorkOrderCosting.php trunk/WorkOrderEntry.php trunk/WorkOrderIssue.php trunk/WorkOrderReceive.php trunk/WorkOrderStatus.php trunk/Z_CheckAllocs.php trunk/Z_CheckDebtorsControl.php trunk/Z_CheckGLTransBalance.php trunk/Z_CurrencyDebtorsBalances.php trunk/Z_CurrencySuppliersBalances.php trunk/doc/Change.log trunk/includes/InputSerialItemsFile.php trunk/includes/InputSerialItemsKeyed.php trunk/includes/LanguageSetup.php trunk/includes/MiscFunctions.php trunk/includes/OutputSerialItems.php trunk/includes/PDFPaymentRun_PymtFooter.php trunk/includes/PDFSalesAnalysis.inc trunk/includes/phplot/phplot.php trunk/includes/tcpdf/tcpdf.php trunk/reportwriter/WriteForm.inc Modified: trunk/AgedDebtors.php =================================================================== --- trunk/AgedDebtors.php 2011-09-04 10:10:14 UTC (rev 4677) +++ trunk/AgedDebtors.php 2011-09-05 10:10:57 UTC (rev 4678) @@ -291,11 +291,11 @@ while ($AgedAnalysis = DB_fetch_array($CustomerResult,$db)){ $DecimalPlaces = $AgedAnalysis['decimalplaces']; - $DisplayDue = locale_number_format($AgedAnalysis['due']-$AgedAnalysis['overdue1'],$DecimalPlaces); - $DisplayCurrent = locale_number_format($AgedAnalysis['balance']-$AgedAnalysis['due'],$DecimalPlaces); - $DisplayBalance = locale_number_format($AgedAnalysis['balance'],$DecimalPlaces); - $DisplayOverdue1 = locale_number_format($AgedAnalysis['overdue1']-$AgedAnalysis['overdue2'],$DecimalPlaces); - $DisplayOverdue2 = locale_number_format($AgedAnalysis['overdue2'],$DecimalPlaces); + $DisplayDue = number_format($AgedAnalysis['due']-$AgedAnalysis['overdue1'],$DecimalPlaces); + $DisplayCurrent = number_format($AgedAnalysis['balance']-$AgedAnalysis['due'],$DecimalPlaces); + $DisplayBalance = number_format($AgedAnalysis['balance'],$DecimalPlaces); + $DisplayOverdue1 = number_format($AgedAnalysis['overdue1']-$AgedAnalysis['overdue2'],$DecimalPlaces); + $DisplayOverdue2 = number_format($AgedAnalysis['overdue2'],$DecimalPlaces); $TotBal += $AgedAnalysis['balance']; $TotDue += ($AgedAnalysis['due']-$AgedAnalysis['overdue1']); @@ -384,11 +384,11 @@ $DisplayTranDate = ConvertSQLDate($DetailTrans['trandate']); $LeftOvers = $pdf->addTextWrap($Left_Margin+125,$YPos,75,$FontSize,$DisplayTranDate,'left'); - $DisplayDue = locale_number_format($DetailTrans['due']-$DetailTrans['overdue1'],$DecimalPlaces); - $DisplayCurrent = locale_number_format($DetailTrans['balance']-$DetailTrans['due'],$DecimalPlaces); - $DisplayBalance = locale_number_format($DetailTrans['balance'],$DecimalPlaces); - $DisplayOverdue1 = locale_number_format($DetailTrans['overdue1']-$DetailTrans['overdue2'],$DecimalPlaces); - $DisplayOverdue2 = locale_number_format($DetailTrans['overdue2'],$DecimalPlaces); + $DisplayDue = number_format($DetailTrans['due']-$DetailTrans['overdue1'],$DecimalPlaces); + $DisplayCurrent = number_format($DetailTrans['balance']-$DetailTrans['due'],$DecimalPlaces); + $DisplayBalance = number_format($DetailTrans['balance'],$DecimalPlaces); + $DisplayOverdue1 = number_format($DetailTrans['overdue1']-$DetailTrans['overdue2'],$DecimalPlaces); + $DisplayOverdue2 = number_format($DetailTrans['overdue2'],$DecimalPlaces); $LeftOvers = $pdf->addTextWrap(220,$YPos,60,$FontSize,$DisplayBalance,'right'); $LeftOvers = $pdf->addTextWrap(280,$YPos,60,$FontSize,$DisplayCurrent,'right'); @@ -418,11 +418,11 @@ $pdf->line($Page_Width-$Right_Margin, $YPos+10 ,220, $YPos+10); } - $DisplayTotBalance = locale_number_format($TotBal,$DecimalPlaces); - $DisplayTotDue = locale_number_format($TotDue,$DecimalPlaces); - $DisplayTotCurrent = locale_number_format($TotCurr,$DecimalPlaces); - $DisplayTotOverdue1 = locale_number_format($TotOD1,$DecimalPlaces); - $DisplayTotOverdue2 = locale_number_format($TotOD2,$DecimalPlaces); + $DisplayTotBalance = number_format($TotBal,$DecimalPlaces); + $DisplayTotDue = number_format($TotDue,$DecimalPlaces); + $DisplayTotCurrent = number_format($TotCurr,$DecimalPlaces); + $DisplayTotOverdue1 = number_format($TotOD1,$DecimalPlaces); + $DisplayTotOverdue2 = number_format($TotOD2,$DecimalPlaces); $LeftOvers = $pdf->addTextWrap(220,$YPos,60,$FontSize,$DisplayTotBalance,'right'); $LeftOvers = $pdf->addTextWrap(280,$YPos,60,$FontSize,$DisplayTotCurrent,'right'); Modified: trunk/AgedSuppliers.php =================================================================== --- trunk/AgedSuppliers.php 2011-09-04 10:10:14 UTC (rev 4677) +++ trunk/AgedSuppliers.php 2011-09-05 10:10:57 UTC (rev 4678) @@ -126,11 +126,11 @@ While ($AgedAnalysis = DB_fetch_array($SupplierResult,$db)){ - $DisplayDue = locale_number_format($AgedAnalysis['due']-$AgedAnalysis['overdue1'],2); - $DisplayCurrent = locale_number_format($AgedAnalysis['balance']-$AgedAnalysis['due'],2); - $DisplayBalance = locale_number_format($AgedAnalysis['balance'],2); - $DisplayOverdue1 = locale_number_format($AgedAnalysis['overdue1']-$AgedAnalysis['overdue2'],2); - $DisplayOverdue2 = locale_number_format($AgedAnalysis['overdue2'],2); + $DisplayDue = number_format($AgedAnalysis['due']-$AgedAnalysis['overdue1'],2); + $DisplayCurrent = number_format($AgedAnalysis['balance']-$AgedAnalysis['due'],2); + $DisplayBalance = number_format($AgedAnalysis['balance'],2); + $DisplayOverdue1 = number_format($AgedAnalysis['overdue1']-$AgedAnalysis['overdue2'],2); + $DisplayOverdue2 = number_format($AgedAnalysis['overdue2'],2); $TotBal += $AgedAnalysis['balance']; $TotDue += ($AgedAnalysis['due']-$AgedAnalysis['overdue1']); @@ -204,11 +204,11 @@ $DisplayTranDate = ConvertSQLDate($DetailTrans['trandate']); $LeftOvers = $pdf->addTextWrap($Left_Margin+105,$YPos,70,$FontSize,$DisplayTranDate,'left'); - $DisplayDue = locale_number_format($DetailTrans['due']-$DetailTrans['overdue1'],2); - $DisplayCurrent = locale_number_format($DetailTrans['balance']-$DetailTrans['due'],2); - $DisplayBalance = locale_number_format($DetailTrans['balance'],2); - $DisplayOverdue1 = locale_number_format($DetailTrans['overdue1']-$DetailTrans['overdue2'],2); - $DisplayOverdue2 = locale_number_format($DetailTrans['overdue2'],2); + $DisplayDue = number_format($DetailTrans['due']-$DetailTrans['overdue1'],2); + $DisplayCurrent = number_format($DetailTrans['balance']-$DetailTrans['due'],2); + $DisplayBalance = number_format($DetailTrans['balance'],2); + $DisplayOverdue1 = number_format($DetailTrans['overdue1']-$DetailTrans['overdue2'],2); + $DisplayOverdue2 = number_format($DetailTrans['overdue2'],2); $LeftOvers = $pdf->addTextWrap(220,$YPos,60,$FontSize,$DisplayBalance,'right'); $LeftOvers = $pdf->addTextWrap(280,$YPos,60,$FontSize,$DisplayCurrent,'right'); @@ -238,11 +238,11 @@ $pdf->line($Page_Width-$Right_Margin, $YPos+10 ,220, $YPos+10); } - $DisplayTotBalance = locale_number_format($TotBal,2); - $DisplayTotDue = locale_number_format($TotDue,2); - $DisplayTotCurrent = locale_number_format($TotCurr,2); - $DisplayTotOverdue1 = locale_number_format($TotOD1,2); - $DisplayTotOverdue2 = locale_number_format($TotOD2,2); + $DisplayTotBalance = number_format($TotBal,2); + $DisplayTotDue = number_format($TotDue,2); + $DisplayTotCurrent = number_format($TotCurr,2); + $DisplayTotOverdue1 = number_format($TotOD1,2); + $DisplayTotOverdue2 = number_format($TotOD2,2); $LeftOvers = $pdf->addTextWrap(220,$YPos,60,$FontSize,$DisplayTotBalance,'right'); $LeftOvers = $pdf->addTextWrap(280,$YPos,60,$FontSize,$DisplayTotCurrent,'right'); Modified: trunk/BOMExtendedQty.php =================================================================== --- trunk/BOMExtendedQty.php 2011-09-04 10:10:14 UTC (rev 4677) +++ trunk/BOMExtendedQty.php 2011-09-05 10:10:57 UTC (rev 4678) @@ -216,15 +216,15 @@ $pdf->addTextWrap($Left_Margin+1,$YPos,90,$FontSize,$myrow['component'],'',0,$fill); $pdf->addTextWrap(140,$YPos,30,$FontSize,$myrow['mbflag'],'',0,$fill); $pdf->addTextWrap(170,$YPos,140,$FontSize,$myrow['description'],'',0,$fill); - $pdf->addTextWrap(310,$YPos,50,$FontSize,locale_number_format($myrow['quantity'], + $pdf->addTextWrap(310,$YPos,50,$FontSize,number_format($myrow['quantity'], $myrow['decimalplaces']),'right',0,$fill); - $pdf->addTextWrap(360,$YPos,40,$FontSize,locale_number_format($myrow['qoh'], + $pdf->addTextWrap(360,$YPos,40,$FontSize,number_format($myrow['qoh'], $myrow['decimalplaces']),'right',0,$fill); - $pdf->addTextWrap(400,$YPos,40,$FontSize,locale_number_format($myrow['poqty'], + $pdf->addTextWrap(400,$YPos,40,$FontSize,number_format($myrow['poqty'], $myrow['decimalplaces']),'right',0,$fill); - $pdf->addTextWrap(440,$YPos,40,$FontSize,locale_number_format($myrow['woqty'], + $pdf->addTextWrap(440,$YPos,40,$FontSize,number_format($myrow['woqty'], $myrow['decimalplaces']),'right',0,$fill); - $pdf->addTextWrap(480,$YPos,50,$FontSize,locale_number_format($Difference, + $pdf->addTextWrap(480,$YPos,50,$FontSize,number_format($Difference, $myrow['decimalplaces']),'right',0,$fill); } if ($YPos < $Bottom_Margin + $line_height){ Modified: trunk/BOMIndented.php =================================================================== --- trunk/BOMIndented.php 2011-09-04 10:10:14 UTC (rev 4677) +++ trunk/BOMIndented.php 2011-09-05 10:10:57 UTC (rev 4678) @@ -208,7 +208,7 @@ $pdf->addTextWrap(180,$YPos,180,$FontSize,$myrow['description'],'',0,$fill); $pdf->addTextWrap(360,$YPos,30,$FontSize,$myrow['loccode'],'right',0,$fill); $pdf->addTextWrap(390,$YPos,25,$FontSize,$myrow['workcentreadded'],'right',0,$fill); - $pdf->addTextWrap(415,$YPos,45,$FontSize,locale_number_format($myrow['quantity'],2),'right',0,$fill); + $pdf->addTextWrap(415,$YPos,45,$FontSize,number_format($myrow['quantity'],2),'right',0,$fill); $pdf->addTextWrap(460,$YPos,55,$FontSize,$FormatedEffectiveAfter,'right',0,$fill); $pdf->addTextWrap(515,$YPos,50,$FontSize,$FormatedEffectiveTo,'right',0,$fill); Modified: trunk/BOMIndentedReverse.php =================================================================== --- trunk/BOMIndentedReverse.php 2011-09-04 10:10:14 UTC (rev 4677) +++ trunk/BOMIndentedReverse.php 2011-09-05 10:10:57 UTC (rev 4678) @@ -197,7 +197,7 @@ $pdf->addTextWrap(180,$YPos,180,$FontSize,$myrow['description'],'',0,$fill); $pdf->addTextWrap(360,$YPos,30,$FontSize,$myrow['loccode'],'right',0,$fill); $pdf->addTextWrap(390,$YPos,25,$FontSize,$myrow['workcentreadded'],'right',0,$fill); - $pdf->addTextWrap(415,$YPos,45,$FontSize,locale_number_format($myrow['quantity'],2),'right',0,$fill); + $pdf->addTextWrap(415,$YPos,45,$FontSize,number_format($myrow['quantity'],2),'right',0,$fill); $pdf->addTextWrap(460,$YPos,55,$FontSize,$FormatedEffectiveAfter,'right',0,$fill); $pdf->addTextWrap(515,$YPos,50,$FontSize,$FormatedEffectiveTo,'right',0,$fill); Modified: trunk/BOMInquiry.php =================================================================== --- trunk/BOMInquiry.php 2011-09-04 10:10:14 UTC (rev 4677) +++ trunk/BOMInquiry.php 2011-09-05 10:10:57 UTC (rev 4678) @@ -116,7 +116,7 @@ if ($myrow['mbflag']=='A' OR $myrow['mbflag']=='K'){ $StockOnHand = 'N/A'; } else { - $StockOnHand = locale_number_format($myrow['totalonhand'],2); + $StockOnHand = number_format($myrow['totalonhand'],2); } $tabindex=$j+4; printf('<td><input tabindex="' .$tabindex . '" type="submit" name="StockID" value="%s"</td> @@ -207,7 +207,7 @@ </tr>', $ComponentLink, $myrow['description'], - locale_number_format($myrow['quantity'],$myrow['decimalplaces']), + number_format($myrow['quantity'],$myrow['decimalplaces']), $myrow['standardcost'], $myrow['componentcost']); @@ -219,14 +219,14 @@ $TotalCost += $ParentLabourCost; echo '<tr> <td colspan="4" class="number"><b>' . _('Labour Cost') . '</b></td> - <td class=number><b>' . locale_number_format($ParentLabourCost,$_SESSION['CompanyRecord']['decimalplaces']) . '</b></td></tr>'; + <td class=number><b>' . number_format($ParentLabourCost,$_SESSION['CompanyRecord']['decimalplaces']) . '</b></td></tr>'; $TotalCost += $ParentOverheadCost; echo '<tr><td colspan="4" class="number"><b>' . _('Overhead Cost') . '</b></td> - <td class=number><b>' . locale_number_format($ParentOverheadCost,$_SESSION['CompanyRecord']['decimalplaces']) . '</b></td></tr>'; + <td class=number><b>' . number_format($ParentOverheadCost,$_SESSION['CompanyRecord']['decimalplaces']) . '</b></td></tr>'; echo '<tr> <td colspan=4 class=number><b>' . _('Total Cost') . '</b></td> - <td class=number><b>' . locale_number_format($TotalCost,$_SESSION['CompanyRecord']['decimalplaces']) . '</b></td> + <td class=number><b>' . number_format($TotalCost,$_SESSION['CompanyRecord']['decimalplaces']) . '</b></td> </tr>'; echo '</table>'; Modified: trunk/BOMListing.php =================================================================== --- trunk/BOMListing.php 2011-09-04 10:10:14 UTC (rev 4677) +++ trunk/BOMListing.php 2011-09-05 10:10:57 UTC (rev 4678) @@ -83,7 +83,7 @@ $LeftOvers = $pdf->addTextWrap($Left_Margin+5,$YPos,80,$FontSize,$BOMList['component'],'left'); $LeftOvers = $pdf->addTextWrap(110,$YPos,200,$FontSize,$BOMList['compdescription'],'left'); - $DisplayQuantity = locale_number_format($BOMList['quantity'],$BOMList['decimalplaces']); + $DisplayQuantity = number_format($BOMList['quantity'],$BOMList['decimalplaces']); $LeftOvers = $pdf->addTextWrap(320,$YPos,50,$FontSize,ConvertSQLDate($BOMList['eff_frm']),'left'); $LeftOvers = $pdf->addTextWrap(370,$YPos,50,$FontSize,ConvertSQLDate($BOMList['eff_to']),'left'); $LeftOvers = $pdf->addTextWrap(420,$YPos,20,$FontSize,$BOMList['loccode'],'left'); Modified: trunk/BOMs.php =================================================================== --- trunk/BOMs.php 2011-09-04 10:10:14 UTC (rev 4677) +++ trunk/BOMs.php 2011-09-05 10:10:57 UTC (rev 4678) @@ -129,7 +129,7 @@ if ($myrow[7]=='D' OR $myrow[7]=='K' OR $myrow[7]=='A' OR $myrow[7]=='G'){ $QuantityOnHand = _('N/A'); } else { - $QuantityOnHand = locale_number_format($myrow[10],$myrow[11]); + $QuantityOnHand = number_format($myrow[10],$myrow[11]); } printf('<td>%s</td> <td>%s</td> @@ -834,7 +834,7 @@ if ($myrow['mbflag']=='A' OR $myrow['mbflag']=='K' OR $myrow['mbflag']=='G'){ $StockOnHand = _('N/A'); } else { - $StockOnHand = locale_number_format($myrow['totalonhand'],2); + $StockOnHand = number_format($myrow['totalonhand'],2); } $tab = $j+3; printf('<td><input tabindex="' . $tab . '" type="submit" name="Select" value="%s"</td> Modified: trunk/BankMatching.php =================================================================== --- trunk/BankMatching.php 2011-09-04 10:10:14 UTC (rev 4677) +++ trunk/BankMatching.php 2011-09-05 10:10:57 UTC (rev 4678) @@ -257,8 +257,8 @@ $myrow['ref'], $myrow['banktranstype'], $DisplayTranDate, - locale_number_format($myrow['amt'],2), - locale_number_format($Outstanding,2), + number_format($myrow['amt'],2), + number_format($Outstanding,2), _('Unclear'), $i, $i, @@ -283,8 +283,8 @@ $myrow['ref'], $myrow['banktranstype'], $DisplayTranDate, - locale_number_format($myrow['amt'],2), - locale_number_format($Outstanding,2), + number_format($myrow['amt'],2), + number_format($Outstanding,2), $i, $i, $myrow['banktransid'], Modified: trunk/BankReconciliation.php =================================================================== --- trunk/BankReconciliation.php 2011-09-04 10:10:14 UTC (rev 4677) +++ trunk/BankReconciliation.php 2011-09-05 10:10:57 UTC (rev 4678) @@ -86,7 +86,7 @@ $result = DB_query($SQL,$db,$ErrMsg,$DbgMsg,true); $result = DB_Txn_Commit($db); - prnMsg(_('Exchange difference of') . ' ' . locale_number_format($ExchangeDifference,2) . ' ' . _('has been posted'),'success'); + prnMsg(_('Exchange difference of') . ' ' . number_format($ExchangeDifference,2) . ' ' . _('has been posted'),'success'); } //end if the bank statement balance was numeric } @@ -171,7 +171,7 @@ echo ' (' . $BankCurrCode . ' @ ' . $ExRate .')'; } echo '</b></td> - <td valign=bottom class="number"><b>' . locale_number_format($Balance*$ExRate,$CurrDecimalPlaces) . '</b></td></tr>'; + <td valign=bottom class="number"><b>' . number_format($Balance*$ExRate,$CurrDecimalPlaces) . '</b></td></tr>'; $SQL = "SELECT amount/exrate AS amt, amountcleared, @@ -229,8 +229,8 @@ $myrow['typename'], $myrow['transno'], $myrow['ref'], - locale_number_format($myrow['amt'],$CurrDecimalPlaces), - locale_number_format($myrow['outstanding'],$CurrDecimalPlaces)); + number_format($myrow['amt'],$CurrDecimalPlaces), + number_format($myrow['outstanding'],$CurrDecimalPlaces)); $TotalUnpresentedCheques +=$myrow['outstanding']; @@ -242,7 +242,7 @@ } //end of while loop echo '<tr></tr> - <tr class=EvenTableRows><td colspan=6>' . _('Total of all unpresented cheques') . '</td><td class="number">' . locale_number_format($TotalUnpresentedCheques,$CurrDecimalPlaces) . '</td></tr>'; + <tr class=EvenTableRows><td colspan=6>' . _('Total of all unpresented cheques') . '</td><td class="number">' . number_format($TotalUnpresentedCheques,$CurrDecimalPlaces) . '</td></tr>'; $SQL = "SELECT amount/exrate AS amt, amountcleared, @@ -301,8 +301,8 @@ $myrow['typename'], $myrow['transno'], $myrow['ref'], - locale_number_format($myrow['amt'],$CurrDecimalPlaces), - locale_number_format($myrow['outstanding'],$CurrDecimalPlaces) ); + number_format($myrow['amt'],$CurrDecimalPlaces), + number_format($myrow['outstanding'],$CurrDecimalPlaces) ); $TotalUnclearedDeposits +=$myrow['outstanding']; @@ -316,13 +316,13 @@ echo '<tr></tr> <tr class=EvenTableRows> <td colspan=6>' . _('Total of all uncleared deposits') . '</td> - <td class=number>' . locale_number_format($TotalUnclearedDeposits,$CurrDecimalPlaces) . '</td> + <td class=number>' . number_format($TotalUnclearedDeposits,$CurrDecimalPlaces) . '</td> </tr>'; $FXStatementBalance = ($Balance*$ExRate) - $TotalUnpresentedCheques -$TotalUnclearedDeposits; echo '<tr></tr> <tr class=EvenTableRows> <td colspan=6><b>' . _('Bank statement balance should be') . ' (' . $BankCurrCode . ')</b></td> - <td class=number>' . locale_number_format($FXStatementBalance,$CurrDecimalPlaces) . '</td></tr>'; + <td class=number>' . number_format($FXStatementBalance,$CurrDecimalPlaces) . '</td></tr>'; if (isset($_POST['DoExchangeDifference'])){ echo '<input type="hidden" name="DoExchangeDifference" value=' . $FXStatementBalance . '>'; Modified: trunk/ConfirmDispatchControlled_Invoice.php =================================================================== --- trunk/ConfirmDispatchControlled_Invoice.php 2011-09-04 10:10:14 UTC (rev 4677) +++ trunk/ConfirmDispatchControlled_Invoice.php 2011-09-05 10:10:57 UTC (rev 4678) @@ -55,7 +55,7 @@ echo '<br /><a href="'. $rootpath. '/ConfirmDispatch_Invoice.php">'. _('Back to Confirmation of Dispatch') . '/' . _('Invoice'). '</a>'; -echo '<br /><font size=2><b>'. _('Dispatch of up to').' '. locale_number_format($LineItem->Quantity-$LineItem->QtyInv, $LineItem->DecimalPlaces). ' '. _('Controlled items').' ' . $LineItem->StockID . ' - ' . $LineItem->ItemDescription . ' '. _('on order').' ' . $_SESSION['Items']->OrderNo . ' '. _('to'). ' ' . $_SESSION['Items']->CustomerName . '</b></font></div>'; +echo '<br /><font size=2><b>'. _('Dispatch of up to').' '. number_format($LineItem->Quantity-$LineItem->QtyInv, $LineItem->DecimalPlaces). ' '. _('Controlled items').' ' . $LineItem->StockID . ' - ' . $LineItem->ItemDescription . ' '. _('on order').' ' . $_SESSION['Items']->OrderNo . ' '. _('to'). ' ' . $_SESSION['Items']->CustomerName . '</b></font></div>'; /** vars needed by InputSerialItem : **/ $StockID = $LineItem->StockID; Modified: trunk/ConfirmDispatch_Invoice.php =================================================================== --- trunk/ConfirmDispatch_Invoice.php 2011-09-04 10:10:14 UTC (rev 4677) +++ trunk/ConfirmDispatch_Invoice.php 2011-09-05 10:10:57 UTC (rev 4678) @@ -304,9 +304,9 @@ echo '<td>'.$LnItm->StockID.'</td> <td>'.$LnItm->ItemDescription.'</td> - <td class="number">' . locale_number_format($LnItm->Quantity,$LnItm->DecimalPlaces) . '</td> + <td class="number">' . number_format($LnItm->Quantity,$LnItm->DecimalPlaces) . '</td> <td>'.$LnItm->Units.'</td> - <td class="number">' . locale_number_format($LnItm->QtyInv,$LnItm->DecimalPlaces) . '</td>'; + <td class="number">' . number_format($LnItm->QtyInv,$LnItm->DecimalPlaces) . '</td>'; if ($LnItm->Controlled==1){ @@ -322,9 +322,9 @@ echo '<td class="number"><input tabindex="'.$j.'" type="text" class="number" name="' . $LnItm->LineNumber . '_QtyDispatched" maxlength=12 size=12 value="' . $LnItm->QtyDispatched . '"></td>'; } } - $DisplayDiscountPercent = locale_number_format($LnItm->DiscountPercent*100,2) . '%'; - $DisplayLineNetTotal = locale_number_format($LineTotal,$_SESSION['Items']->CurrDecimalPlaces); - $DisplayPrice = locale_number_format($LnItm->Price,$_SESSION['Items']->CurrDecimalPlaces); + $DisplayDiscountPercent = number_format($LnItm->DiscountPercent*100,2) . '%'; + $DisplayLineNetTotal = number_format($LineTotal,$_SESSION['Items']->CurrDecimalPlaces); + $DisplayPrice = number_format($LnItm->Price,$_SESSION['Items']->CurrDecimalPlaces); echo '<td class="number">'.$DisplayPrice.'</td> <td class="number">'.$DisplayDiscountPercent.'</td> <td class="number">'.$DisplayLineNetTotal.'</td>'; @@ -373,9 +373,9 @@ $TaxTotal += $TaxLineTotal; - $DisplayTaxAmount = locale_number_format($TaxLineTotal ,$_SESSION['Items']->CurrDecimalPlaces); + $DisplayTaxAmount = number_format($TaxLineTotal ,$_SESSION['Items']->CurrDecimalPlaces); - $DisplayGrossLineTotal = locale_number_format($LineTotal+ $TaxLineTotal,$_SESSION['Items']->CurrDecimalPlaces); + $DisplayGrossLineTotal = number_format($LineTotal+ $TaxLineTotal,$_SESSION['Items']->CurrDecimalPlaces); echo '<td class="number">'.$DisplayTaxAmount.'</td><td class="number">'.$DisplayGrossLineTotal.'</td>'; @@ -511,13 +511,13 @@ } echo '</td>'; -echo '<td class="number">' . locale_number_format($FreightTaxTotal,$_SESSION['Items']->CurrDecimalPlaces) . '</td> - <td class="number">' . locale_number_format($FreightTaxTotal+ $_POST['ChargeFreightCost'],$_SESSION['Items']->CurrDecimalPlaces) . '</td> +echo '<td class="number">' . number_format($FreightTaxTotal,$_SESSION['Items']->CurrDecimalPlaces) . '</td> + <td class="number">' . number_format($FreightTaxTotal+ $_POST['ChargeFreightCost'],$_SESSION['Items']->CurrDecimalPlaces) . '</td> </tr>'; $TaxTotal += $FreightTaxTotal; -$DisplaySubTotal = locale_number_format(($_SESSION['Items']->total + $_POST['ChargeFreightCost']),$_SESSION['Items']->CurrDecimalPlaces); +$DisplaySubTotal = number_format(($_SESSION['Items']->total + $_POST['ChargeFreightCost']),$_SESSION['Items']->CurrDecimalPlaces); /* round the totals to avoid silly entries */ @@ -529,8 +529,8 @@ <td colspan="10" class="number">' . _('Invoice Totals'). '</td> <td class="number:><hr><b>'.$DisplaySubTotal.'</b><hr></td> <td colspan="2"></td> - <td class="number"><hr><b>' . locale_number_format($TaxTotal,$_SESSION['Items']->CurrDecimalPlaces) . '</b><hr></td> - <td class="number"><hr><b>' . locale_number_format($TaxTotal+($_SESSION['Items']->total + $_POST['ChargeFreightCost']),$_SESSION['Items']->CurrDecimalPlaces) . '</b><hr></td> + <td class="number"><hr><b>' . number_format($TaxTotal,$_SESSION['Items']->CurrDecimalPlaces) . '</b><hr></td> + <td class="number"><hr><b>' . number_format($TaxTotal+($_SESSION['Items']->total + $_POST['ChargeFreightCost']),$_SESSION['Items']->CurrDecimalPlaces) . '</b><hr></td> </tr>'; if (! isset($_POST['DispatchDate']) OR ! Is_Date($_POST['DispatchDate'])){ Modified: trunk/ContractBOM.php =================================================================== --- trunk/ContractBOM.php 2011-09-04 10:10:14 UTC (rev 4677) +++ trunk/ContractBOM.php 2011-09-05 10:10:57 UTC (rev 4678) @@ -247,7 +247,7 @@ $LineTotal = $ContractComponent->Quantity * $ContractComponent->ItemCost; - $DisplayLineTotal = locale_number_format($LineTotal,2); + $DisplayLineTotal = number_format($LineTotal,2); if ($k==1){ echo '<tr class="EvenTableRows">'; @@ -267,7 +267,7 @@ $TotalCost += $LineTotal; } - $DisplayTotal = locale_number_format($TotalCost,2); + $DisplayTotal = number_format($TotalCost,2); echo '<tr> <td colspan="6" class="number">' . _('Total Cost') . '</td> <td class="number"><b>' . $DisplayTotal . '</b></td> Modified: trunk/ContractCosting.php =================================================================== --- trunk... [truncated message content] |
From: <dai...@us...> - 2011-09-05 10:11:07
|
Revision: 4678 http://web-erp.svn.sourceforge.net/web-erp/?rev=4678&view=rev Author: daintree Date: 2011-09-05 10:10:57 +0000 (Mon, 05 Sep 2011) Log Message: ----------- 5/9/11 Phil: Fixed supplier payment exchange rate ... was being calculated incorrectly from functional exchange rate and the exchange rate between the currency of the bank account and currency of payment. 5/9/11 Phil: GLTransInquiry posted was not retrieved correctly - now fixed Modified Paths: -------------- trunk/AgedDebtors.php trunk/AgedSuppliers.php trunk/BOMExtendedQty.php trunk/BOMIndented.php trunk/BOMIndentedReverse.php trunk/BOMInquiry.php trunk/BOMListing.php trunk/BOMs.php trunk/BankMatching.php trunk/BankReconciliation.php trunk/ConfirmDispatchControlled_Invoice.php trunk/ConfirmDispatch_Invoice.php trunk/ContractBOM.php trunk/ContractCosting.php trunk/ContractOtherReqts.php trunk/Contracts.php trunk/CounterSales.php trunk/Credit_Invoice.php trunk/Currencies.php trunk/CustWhereAlloc.php trunk/CustomerAllocations.php trunk/CustomerInquiry.php trunk/CustomerReceipt.php trunk/CustomerTransInquiry.php trunk/Customers.php trunk/DailyBankTransactions.php trunk/DailySalesInquiry.php trunk/DebtorsAtPeriodEnd.php trunk/DeliveryDetails.php trunk/EmailConfirmation.php trunk/FTP_RadioBeacon.php trunk/FixedAssetDepreciation.php trunk/FixedAssetItems.php trunk/FixedAssetRegister.php trunk/FixedAssetTransfer.php trunk/GLAccountInquiry.php trunk/GLAccountReport.php trunk/GLBalanceSheet.php trunk/GLBudgets.php trunk/GLJournal.php trunk/GLProfit_Loss.php trunk/GLTagProfit_Loss.php trunk/GLTransInquiry.php trunk/GLTrialBalance.php trunk/GoodsReceived.php trunk/InventoryPlanning.php trunk/InventoryPlanningPrefSupplier.php trunk/InventoryQuantities.php trunk/InventoryValuation.php trunk/MRPPlannedPurchaseOrders.php trunk/MRPPlannedWorkOrders.php trunk/MRPReport.php trunk/MRPReschedules.php trunk/MRPShortages.php trunk/MailInventoryValuation.php trunk/Numbers/Words/lang.bg.php trunk/Numbers/Words/lang.fr.php trunk/Numbers/Words/lang.fr_BE.php trunk/OffersReceived.php trunk/OrderDetails.php trunk/OutstandingGRNs.php trunk/PDFBankingSummary.php trunk/PDFChequeListing.php trunk/PDFCustTransListing.php trunk/PDFCustomerList.php trunk/PDFDIFOT.php trunk/PDFDeliveryDifferences.php trunk/PDFGrn.php trunk/PDFLowGP.php trunk/PDFOrderStatus.php trunk/PDFOrdersInvoiced.php trunk/PDFPeriodStockTransListing.php trunk/PDFPickingList.php trunk/PDFPriceList.php trunk/PDFPrintLabel.php trunk/PDFQuotation.php trunk/PDFQuotationPortrait.php trunk/PDFReceipt.php trunk/PDFRemittanceAdvice.php trunk/PDFSuppTransListing.php trunk/PDFTopItems.php trunk/POReport.php trunk/PO_AuthorisationLevels.php trunk/PO_AuthoriseMyOrders.php trunk/PO_Items.php trunk/PO_OrderDetails.php trunk/PO_PDFPurchOrder.php trunk/PO_SelectOSPurchOrder.php trunk/PO_SelectPurchOrder.php trunk/PaymentAllocations.php trunk/Payments.php trunk/PcAssignCashToTab.php trunk/PcAuthorizeExpenses.php trunk/PcClaimExpensesFromTab.php trunk/PcReportTab.php trunk/PcTabs.php trunk/Prices.php trunk/PricesByCost.php trunk/Prices_Customer.php trunk/PrintCheque.php trunk/PrintCustOrder.php trunk/PrintCustOrder_generic.php trunk/PrintCustStatements.php trunk/PrintCustTrans.php trunk/PrintCustTransPortrait.php trunk/PurchData.php trunk/RecurringSalesOrders.php trunk/ReorderLevel.php trunk/ReprintGRN.php trunk/ReverseGRN.php trunk/SalesByTypePeriodInquiry.php trunk/SalesCategoryPeriodInquiry.php trunk/SalesInquiry.php trunk/SalesTopItemsInquiry.php trunk/SelectCompletedOrder.php trunk/SelectCreditItems.php trunk/SelectCustomer.php trunk/SelectOrderItems.php trunk/SelectProduct.php trunk/SelectRecurringSalesOrder.php trunk/SelectSalesOrder.php trunk/SelectSupplier.php trunk/ShipmentCosting.php trunk/Shipments.php trunk/SpecialOrder.php trunk/StockAdjustments.php trunk/StockCheck.php trunk/StockCostUpdate.php trunk/StockDispatch.php trunk/StockLocMovements.php trunk/StockLocStatus.php trunk/StockLocTransferReceive.php trunk/StockMovements.php trunk/StockQuantityByDate.php trunk/StockReorderLevel.php trunk/StockSerialItems.php trunk/StockStatus.php trunk/StockUsage.php trunk/SuppContractChgs.php trunk/SuppCreditGRNs.php trunk/SuppFixedAssetChgs.php trunk/SuppInvGRNs.php trunk/SuppPaymentRun.php trunk/SuppPriceList.php trunk/SuppShiptChgs.php trunk/SuppTransGLAnalysis.php trunk/SupplierAllocations.php trunk/SupplierBalsAtPeriodEnd.php trunk/SupplierCredit.php trunk/SupplierInquiry.php trunk/SupplierInvoice.php trunk/SupplierTenders.php trunk/SupplierTransInquiry.php trunk/Tax.php trunk/TopItems.php trunk/WorkOrderCosting.php trunk/WorkOrderEntry.php trunk/WorkOrderIssue.php trunk/WorkOrderReceive.php trunk/WorkOrderStatus.php trunk/Z_CheckAllocs.php trunk/Z_CheckDebtorsControl.php trunk/Z_CheckGLTransBalance.php trunk/Z_CurrencyDebtorsBalances.php trunk/Z_CurrencySuppliersBalances.php trunk/doc/Change.log trunk/includes/InputSerialItemsFile.php trunk/includes/InputSerialItemsKeyed.php trunk/includes/LanguageSetup.php trunk/includes/MiscFunctions.php trunk/includes/OutputSerialItems.php trunk/includes/PDFPaymentRun_PymtFooter.php trunk/includes/PDFSalesAnalysis.inc trunk/includes/phplot/phplot.php trunk/includes/tcpdf/tcpdf.php trunk/reportwriter/WriteForm.inc Modified: trunk/AgedDebtors.php =================================================================== --- trunk/AgedDebtors.php 2011-09-04 10:10:14 UTC (rev 4677) +++ trunk/AgedDebtors.php 2011-09-05 10:10:57 UTC (rev 4678) @@ -291,11 +291,11 @@ while ($AgedAnalysis = DB_fetch_array($CustomerResult,$db)){ $DecimalPlaces = $AgedAnalysis['decimalplaces']; - $DisplayDue = locale_number_format($AgedAnalysis['due']-$AgedAnalysis['overdue1'],$DecimalPlaces); - $DisplayCurrent = locale_number_format($AgedAnalysis['balance']-$AgedAnalysis['due'],$DecimalPlaces); - $DisplayBalance = locale_number_format($AgedAnalysis['balance'],$DecimalPlaces); - $DisplayOverdue1 = locale_number_format($AgedAnalysis['overdue1']-$AgedAnalysis['overdue2'],$DecimalPlaces); - $DisplayOverdue2 = locale_number_format($AgedAnalysis['overdue2'],$DecimalPlaces); + $DisplayDue = number_format($AgedAnalysis['due']-$AgedAnalysis['overdue1'],$DecimalPlaces); + $DisplayCurrent = number_format($AgedAnalysis['balance']-$AgedAnalysis['due'],$DecimalPlaces); + $DisplayBalance = number_format($AgedAnalysis['balance'],$DecimalPlaces); + $DisplayOverdue1 = number_format($AgedAnalysis['overdue1']-$AgedAnalysis['overdue2'],$DecimalPlaces); + $DisplayOverdue2 = number_format($AgedAnalysis['overdue2'],$DecimalPlaces); $TotBal += $AgedAnalysis['balance']; $TotDue += ($AgedAnalysis['due']-$AgedAnalysis['overdue1']); @@ -384,11 +384,11 @@ $DisplayTranDate = ConvertSQLDate($DetailTrans['trandate']); $LeftOvers = $pdf->addTextWrap($Left_Margin+125,$YPos,75,$FontSize,$DisplayTranDate,'left'); - $DisplayDue = locale_number_format($DetailTrans['due']-$DetailTrans['overdue1'],$DecimalPlaces); - $DisplayCurrent = locale_number_format($DetailTrans['balance']-$DetailTrans['due'],$DecimalPlaces); - $DisplayBalance = locale_number_format($DetailTrans['balance'],$DecimalPlaces); - $DisplayOverdue1 = locale_number_format($DetailTrans['overdue1']-$DetailTrans['overdue2'],$DecimalPlaces); - $DisplayOverdue2 = locale_number_format($DetailTrans['overdue2'],$DecimalPlaces); + $DisplayDue = number_format($DetailTrans['due']-$DetailTrans['overdue1'],$DecimalPlaces); + $DisplayCurrent = number_format($DetailTrans['balance']-$DetailTrans['due'],$DecimalPlaces); + $DisplayBalance = number_format($DetailTrans['balance'],$DecimalPlaces); + $DisplayOverdue1 = number_format($DetailTrans['overdue1']-$DetailTrans['overdue2'],$DecimalPlaces); + $DisplayOverdue2 = number_format($DetailTrans['overdue2'],$DecimalPlaces); $LeftOvers = $pdf->addTextWrap(220,$YPos,60,$FontSize,$DisplayBalance,'right'); $LeftOvers = $pdf->addTextWrap(280,$YPos,60,$FontSize,$DisplayCurrent,'right'); @@ -418,11 +418,11 @@ $pdf->line($Page_Width-$Right_Margin, $YPos+10 ,220, $YPos+10); } - $DisplayTotBalance = locale_number_format($TotBal,$DecimalPlaces); - $DisplayTotDue = locale_number_format($TotDue,$DecimalPlaces); - $DisplayTotCurrent = locale_number_format($TotCurr,$DecimalPlaces); - $DisplayTotOverdue1 = locale_number_format($TotOD1,$DecimalPlaces); - $DisplayTotOverdue2 = locale_number_format($TotOD2,$DecimalPlaces); + $DisplayTotBalance = number_format($TotBal,$DecimalPlaces); + $DisplayTotDue = number_format($TotDue,$DecimalPlaces); + $DisplayTotCurrent = number_format($TotCurr,$DecimalPlaces); + $DisplayTotOverdue1 = number_format($TotOD1,$DecimalPlaces); + $DisplayTotOverdue2 = number_format($TotOD2,$DecimalPlaces); $LeftOvers = $pdf->addTextWrap(220,$YPos,60,$FontSize,$DisplayTotBalance,'right'); $LeftOvers = $pdf->addTextWrap(280,$YPos,60,$FontSize,$DisplayTotCurrent,'right'); Modified: trunk/AgedSuppliers.php =================================================================== --- trunk/AgedSuppliers.php 2011-09-04 10:10:14 UTC (rev 4677) +++ trunk/AgedSuppliers.php 2011-09-05 10:10:57 UTC (rev 4678) @@ -126,11 +126,11 @@ While ($AgedAnalysis = DB_fetch_array($SupplierResult,$db)){ - $DisplayDue = locale_number_format($AgedAnalysis['due']-$AgedAnalysis['overdue1'],2); - $DisplayCurrent = locale_number_format($AgedAnalysis['balance']-$AgedAnalysis['due'],2); - $DisplayBalance = locale_number_format($AgedAnalysis['balance'],2); - $DisplayOverdue1 = locale_number_format($AgedAnalysis['overdue1']-$AgedAnalysis['overdue2'],2); - $DisplayOverdue2 = locale_number_format($AgedAnalysis['overdue2'],2); + $DisplayDue = number_format($AgedAnalysis['due']-$AgedAnalysis['overdue1'],2); + $DisplayCurrent = number_format($AgedAnalysis['balance']-$AgedAnalysis['due'],2); + $DisplayBalance = number_format($AgedAnalysis['balance'],2); + $DisplayOverdue1 = number_format($AgedAnalysis['overdue1']-$AgedAnalysis['overdue2'],2); + $DisplayOverdue2 = number_format($AgedAnalysis['overdue2'],2); $TotBal += $AgedAnalysis['balance']; $TotDue += ($AgedAnalysis['due']-$AgedAnalysis['overdue1']); @@ -204,11 +204,11 @@ $DisplayTranDate = ConvertSQLDate($DetailTrans['trandate']); $LeftOvers = $pdf->addTextWrap($Left_Margin+105,$YPos,70,$FontSize,$DisplayTranDate,'left'); - $DisplayDue = locale_number_format($DetailTrans['due']-$DetailTrans['overdue1'],2); - $DisplayCurrent = locale_number_format($DetailTrans['balance']-$DetailTrans['due'],2); - $DisplayBalance = locale_number_format($DetailTrans['balance'],2); - $DisplayOverdue1 = locale_number_format($DetailTrans['overdue1']-$DetailTrans['overdue2'],2); - $DisplayOverdue2 = locale_number_format($DetailTrans['overdue2'],2); + $DisplayDue = number_format($DetailTrans['due']-$DetailTrans['overdue1'],2); + $DisplayCurrent = number_format($DetailTrans['balance']-$DetailTrans['due'],2); + $DisplayBalance = number_format($DetailTrans['balance'],2); + $DisplayOverdue1 = number_format($DetailTrans['overdue1']-$DetailTrans['overdue2'],2); + $DisplayOverdue2 = number_format($DetailTrans['overdue2'],2); $LeftOvers = $pdf->addTextWrap(220,$YPos,60,$FontSize,$DisplayBalance,'right'); $LeftOvers = $pdf->addTextWrap(280,$YPos,60,$FontSize,$DisplayCurrent,'right'); @@ -238,11 +238,11 @@ $pdf->line($Page_Width-$Right_Margin, $YPos+10 ,220, $YPos+10); } - $DisplayTotBalance = locale_number_format($TotBal,2); - $DisplayTotDue = locale_number_format($TotDue,2); - $DisplayTotCurrent = locale_number_format($TotCurr,2); - $DisplayTotOverdue1 = locale_number_format($TotOD1,2); - $DisplayTotOverdue2 = locale_number_format($TotOD2,2); + $DisplayTotBalance = number_format($TotBal,2); + $DisplayTotDue = number_format($TotDue,2); + $DisplayTotCurrent = number_format($TotCurr,2); + $DisplayTotOverdue1 = number_format($TotOD1,2); + $DisplayTotOverdue2 = number_format($TotOD2,2); $LeftOvers = $pdf->addTextWrap(220,$YPos,60,$FontSize,$DisplayTotBalance,'right'); $LeftOvers = $pdf->addTextWrap(280,$YPos,60,$FontSize,$DisplayTotCurrent,'right'); Modified: trunk/BOMExtendedQty.php =================================================================== --- trunk/BOMExtendedQty.php 2011-09-04 10:10:14 UTC (rev 4677) +++ trunk/BOMExtendedQty.php 2011-09-05 10:10:57 UTC (rev 4678) @@ -216,15 +216,15 @@ $pdf->addTextWrap($Left_Margin+1,$YPos,90,$FontSize,$myrow['component'],'',0,$fill); $pdf->addTextWrap(140,$YPos,30,$FontSize,$myrow['mbflag'],'',0,$fill); $pdf->addTextWrap(170,$YPos,140,$FontSize,$myrow['description'],'',0,$fill); - $pdf->addTextWrap(310,$YPos,50,$FontSize,locale_number_format($myrow['quantity'], + $pdf->addTextWrap(310,$YPos,50,$FontSize,number_format($myrow['quantity'], $myrow['decimalplaces']),'right',0,$fill); - $pdf->addTextWrap(360,$YPos,40,$FontSize,locale_number_format($myrow['qoh'], + $pdf->addTextWrap(360,$YPos,40,$FontSize,number_format($myrow['qoh'], $myrow['decimalplaces']),'right',0,$fill); - $pdf->addTextWrap(400,$YPos,40,$FontSize,locale_number_format($myrow['poqty'], + $pdf->addTextWrap(400,$YPos,40,$FontSize,number_format($myrow['poqty'], $myrow['decimalplaces']),'right',0,$fill); - $pdf->addTextWrap(440,$YPos,40,$FontSize,locale_number_format($myrow['woqty'], + $pdf->addTextWrap(440,$YPos,40,$FontSize,number_format($myrow['woqty'], $myrow['decimalplaces']),'right',0,$fill); - $pdf->addTextWrap(480,$YPos,50,$FontSize,locale_number_format($Difference, + $pdf->addTextWrap(480,$YPos,50,$FontSize,number_format($Difference, $myrow['decimalplaces']),'right',0,$fill); } if ($YPos < $Bottom_Margin + $line_height){ Modified: trunk/BOMIndented.php =================================================================== --- trunk/BOMIndented.php 2011-09-04 10:10:14 UTC (rev 4677) +++ trunk/BOMIndented.php 2011-09-05 10:10:57 UTC (rev 4678) @@ -208,7 +208,7 @@ $pdf->addTextWrap(180,$YPos,180,$FontSize,$myrow['description'],'',0,$fill); $pdf->addTextWrap(360,$YPos,30,$FontSize,$myrow['loccode'],'right',0,$fill); $pdf->addTextWrap(390,$YPos,25,$FontSize,$myrow['workcentreadded'],'right',0,$fill); - $pdf->addTextWrap(415,$YPos,45,$FontSize,locale_number_format($myrow['quantity'],2),'right',0,$fill); + $pdf->addTextWrap(415,$YPos,45,$FontSize,number_format($myrow['quantity'],2),'right',0,$fill); $pdf->addTextWrap(460,$YPos,55,$FontSize,$FormatedEffectiveAfter,'right',0,$fill); $pdf->addTextWrap(515,$YPos,50,$FontSize,$FormatedEffectiveTo,'right',0,$fill); Modified: trunk/BOMIndentedReverse.php =================================================================== --- trunk/BOMIndentedReverse.php 2011-09-04 10:10:14 UTC (rev 4677) +++ trunk/BOMIndentedReverse.php 2011-09-05 10:10:57 UTC (rev 4678) @@ -197,7 +197,7 @@ $pdf->addTextWrap(180,$YPos,180,$FontSize,$myrow['description'],'',0,$fill); $pdf->addTextWrap(360,$YPos,30,$FontSize,$myrow['loccode'],'right',0,$fill); $pdf->addTextWrap(390,$YPos,25,$FontSize,$myrow['workcentreadded'],'right',0,$fill); - $pdf->addTextWrap(415,$YPos,45,$FontSize,locale_number_format($myrow['quantity'],2),'right',0,$fill); + $pdf->addTextWrap(415,$YPos,45,$FontSize,number_format($myrow['quantity'],2),'right',0,$fill); $pdf->addTextWrap(460,$YPos,55,$FontSize,$FormatedEffectiveAfter,'right',0,$fill); $pdf->addTextWrap(515,$YPos,50,$FontSize,$FormatedEffectiveTo,'right',0,$fill); Modified: trunk/BOMInquiry.php =================================================================== --- trunk/BOMInquiry.php 2011-09-04 10:10:14 UTC (rev 4677) +++ trunk/BOMInquiry.php 2011-09-05 10:10:57 UTC (rev 4678) @@ -116,7 +116,7 @@ if ($myrow['mbflag']=='A' OR $myrow['mbflag']=='K'){ $StockOnHand = 'N/A'; } else { - $StockOnHand = locale_number_format($myrow['totalonhand'],2); + $StockOnHand = number_format($myrow['totalonhand'],2); } $tabindex=$j+4; printf('<td><input tabindex="' .$tabindex . '" type="submit" name="StockID" value="%s"</td> @@ -207,7 +207,7 @@ </tr>', $ComponentLink, $myrow['description'], - locale_number_format($myrow['quantity'],$myrow['decimalplaces']), + number_format($myrow['quantity'],$myrow['decimalplaces']), $myrow['standardcost'], $myrow['componentcost']); @@ -219,14 +219,14 @@ $TotalCost += $ParentLabourCost; echo '<tr> <td colspan="4" class="number"><b>' . _('Labour Cost') . '</b></td> - <td class=number><b>' . locale_number_format($ParentLabourCost,$_SESSION['CompanyRecord']['decimalplaces']) . '</b></td></tr>'; + <td class=number><b>' . number_format($ParentLabourCost,$_SESSION['CompanyRecord']['decimalplaces']) . '</b></td></tr>'; $TotalCost += $ParentOverheadCost; echo '<tr><td colspan="4" class="number"><b>' . _('Overhead Cost') . '</b></td> - <td class=number><b>' . locale_number_format($ParentOverheadCost,$_SESSION['CompanyRecord']['decimalplaces']) . '</b></td></tr>'; + <td class=number><b>' . number_format($ParentOverheadCost,$_SESSION['CompanyRecord']['decimalplaces']) . '</b></td></tr>'; echo '<tr> <td colspan=4 class=number><b>' . _('Total Cost') . '</b></td> - <td class=number><b>' . locale_number_format($TotalCost,$_SESSION['CompanyRecord']['decimalplaces']) . '</b></td> + <td class=number><b>' . number_format($TotalCost,$_SESSION['CompanyRecord']['decimalplaces']) . '</b></td> </tr>'; echo '</table>'; Modified: trunk/BOMListing.php =================================================================== --- trunk/BOMListing.php 2011-09-04 10:10:14 UTC (rev 4677) +++ trunk/BOMListing.php 2011-09-05 10:10:57 UTC (rev 4678) @@ -83,7 +83,7 @@ $LeftOvers = $pdf->addTextWrap($Left_Margin+5,$YPos,80,$FontSize,$BOMList['component'],'left'); $LeftOvers = $pdf->addTextWrap(110,$YPos,200,$FontSize,$BOMList['compdescription'],'left'); - $DisplayQuantity = locale_number_format($BOMList['quantity'],$BOMList['decimalplaces']); + $DisplayQuantity = number_format($BOMList['quantity'],$BOMList['decimalplaces']); $LeftOvers = $pdf->addTextWrap(320,$YPos,50,$FontSize,ConvertSQLDate($BOMList['eff_frm']),'left'); $LeftOvers = $pdf->addTextWrap(370,$YPos,50,$FontSize,ConvertSQLDate($BOMList['eff_to']),'left'); $LeftOvers = $pdf->addTextWrap(420,$YPos,20,$FontSize,$BOMList['loccode'],'left'); Modified: trunk/BOMs.php =================================================================== --- trunk/BOMs.php 2011-09-04 10:10:14 UTC (rev 4677) +++ trunk/BOMs.php 2011-09-05 10:10:57 UTC (rev 4678) @@ -129,7 +129,7 @@ if ($myrow[7]=='D' OR $myrow[7]=='K' OR $myrow[7]=='A' OR $myrow[7]=='G'){ $QuantityOnHand = _('N/A'); } else { - $QuantityOnHand = locale_number_format($myrow[10],$myrow[11]); + $QuantityOnHand = number_format($myrow[10],$myrow[11]); } printf('<td>%s</td> <td>%s</td> @@ -834,7 +834,7 @@ if ($myrow['mbflag']=='A' OR $myrow['mbflag']=='K' OR $myrow['mbflag']=='G'){ $StockOnHand = _('N/A'); } else { - $StockOnHand = locale_number_format($myrow['totalonhand'],2); + $StockOnHand = number_format($myrow['totalonhand'],2); } $tab = $j+3; printf('<td><input tabindex="' . $tab . '" type="submit" name="Select" value="%s"</td> Modified: trunk/BankMatching.php =================================================================== --- trunk/BankMatching.php 2011-09-04 10:10:14 UTC (rev 4677) +++ trunk/BankMatching.php 2011-09-05 10:10:57 UTC (rev 4678) @@ -257,8 +257,8 @@ $myrow['ref'], $myrow['banktranstype'], $DisplayTranDate, - locale_number_format($myrow['amt'],2), - locale_number_format($Outstanding,2), + number_format($myrow['amt'],2), + number_format($Outstanding,2), _('Unclear'), $i, $i, @@ -283,8 +283,8 @@ $myrow['ref'], $myrow['banktranstype'], $DisplayTranDate, - locale_number_format($myrow['amt'],2), - locale_number_format($Outstanding,2), + number_format($myrow['amt'],2), + number_format($Outstanding,2), $i, $i, $myrow['banktransid'], Modified: trunk/BankReconciliation.php =================================================================== --- trunk/BankReconciliation.php 2011-09-04 10:10:14 UTC (rev 4677) +++ trunk/BankReconciliation.php 2011-09-05 10:10:57 UTC (rev 4678) @@ -86,7 +86,7 @@ $result = DB_query($SQL,$db,$ErrMsg,$DbgMsg,true); $result = DB_Txn_Commit($db); - prnMsg(_('Exchange difference of') . ' ' . locale_number_format($ExchangeDifference,2) . ' ' . _('has been posted'),'success'); + prnMsg(_('Exchange difference of') . ' ' . number_format($ExchangeDifference,2) . ' ' . _('has been posted'),'success'); } //end if the bank statement balance was numeric } @@ -171,7 +171,7 @@ echo ' (' . $BankCurrCode . ' @ ' . $ExRate .')'; } echo '</b></td> - <td valign=bottom class="number"><b>' . locale_number_format($Balance*$ExRate,$CurrDecimalPlaces) . '</b></td></tr>'; + <td valign=bottom class="number"><b>' . number_format($Balance*$ExRate,$CurrDecimalPlaces) . '</b></td></tr>'; $SQL = "SELECT amount/exrate AS amt, amountcleared, @@ -229,8 +229,8 @@ $myrow['typename'], $myrow['transno'], $myrow['ref'], - locale_number_format($myrow['amt'],$CurrDecimalPlaces), - locale_number_format($myrow['outstanding'],$CurrDecimalPlaces)); + number_format($myrow['amt'],$CurrDecimalPlaces), + number_format($myrow['outstanding'],$CurrDecimalPlaces)); $TotalUnpresentedCheques +=$myrow['outstanding']; @@ -242,7 +242,7 @@ } //end of while loop echo '<tr></tr> - <tr class=EvenTableRows><td colspan=6>' . _('Total of all unpresented cheques') . '</td><td class="number">' . locale_number_format($TotalUnpresentedCheques,$CurrDecimalPlaces) . '</td></tr>'; + <tr class=EvenTableRows><td colspan=6>' . _('Total of all unpresented cheques') . '</td><td class="number">' . number_format($TotalUnpresentedCheques,$CurrDecimalPlaces) . '</td></tr>'; $SQL = "SELECT amount/exrate AS amt, amountcleared, @@ -301,8 +301,8 @@ $myrow['typename'], $myrow['transno'], $myrow['ref'], - locale_number_format($myrow['amt'],$CurrDecimalPlaces), - locale_number_format($myrow['outstanding'],$CurrDecimalPlaces) ); + number_format($myrow['amt'],$CurrDecimalPlaces), + number_format($myrow['outstanding'],$CurrDecimalPlaces) ); $TotalUnclearedDeposits +=$myrow['outstanding']; @@ -316,13 +316,13 @@ echo '<tr></tr> <tr class=EvenTableRows> <td colspan=6>' . _('Total of all uncleared deposits') . '</td> - <td class=number>' . locale_number_format($TotalUnclearedDeposits,$CurrDecimalPlaces) . '</td> + <td class=number>' . number_format($TotalUnclearedDeposits,$CurrDecimalPlaces) . '</td> </tr>'; $FXStatementBalance = ($Balance*$ExRate) - $TotalUnpresentedCheques -$TotalUnclearedDeposits; echo '<tr></tr> <tr class=EvenTableRows> <td colspan=6><b>' . _('Bank statement balance should be') . ' (' . $BankCurrCode . ')</b></td> - <td class=number>' . locale_number_format($FXStatementBalance,$CurrDecimalPlaces) . '</td></tr>'; + <td class=number>' . number_format($FXStatementBalance,$CurrDecimalPlaces) . '</td></tr>'; if (isset($_POST['DoExchangeDifference'])){ echo '<input type="hidden" name="DoExchangeDifference" value=' . $FXStatementBalance . '>'; Modified: trunk/ConfirmDispatchControlled_Invoice.php =================================================================== --- trunk/ConfirmDispatchControlled_Invoice.php 2011-09-04 10:10:14 UTC (rev 4677) +++ trunk/ConfirmDispatchControlled_Invoice.php 2011-09-05 10:10:57 UTC (rev 4678) @@ -55,7 +55,7 @@ echo '<br /><a href="'. $rootpath. '/ConfirmDispatch_Invoice.php">'. _('Back to Confirmation of Dispatch') . '/' . _('Invoice'). '</a>'; -echo '<br /><font size=2><b>'. _('Dispatch of up to').' '. locale_number_format($LineItem->Quantity-$LineItem->QtyInv, $LineItem->DecimalPlaces). ' '. _('Controlled items').' ' . $LineItem->StockID . ' - ' . $LineItem->ItemDescription . ' '. _('on order').' ' . $_SESSION['Items']->OrderNo . ' '. _('to'). ' ' . $_SESSION['Items']->CustomerName . '</b></font></div>'; +echo '<br /><font size=2><b>'. _('Dispatch of up to').' '. number_format($LineItem->Quantity-$LineItem->QtyInv, $LineItem->DecimalPlaces). ' '. _('Controlled items').' ' . $LineItem->StockID . ' - ' . $LineItem->ItemDescription . ' '. _('on order').' ' . $_SESSION['Items']->OrderNo . ' '. _('to'). ' ' . $_SESSION['Items']->CustomerName . '</b></font></div>'; /** vars needed by InputSerialItem : **/ $StockID = $LineItem->StockID; Modified: trunk/ConfirmDispatch_Invoice.php =================================================================== --- trunk/ConfirmDispatch_Invoice.php 2011-09-04 10:10:14 UTC (rev 4677) +++ trunk/ConfirmDispatch_Invoice.php 2011-09-05 10:10:57 UTC (rev 4678) @@ -304,9 +304,9 @@ echo '<td>'.$LnItm->StockID.'</td> <td>'.$LnItm->ItemDescription.'</td> - <td class="number">' . locale_number_format($LnItm->Quantity,$LnItm->DecimalPlaces) . '</td> + <td class="number">' . number_format($LnItm->Quantity,$LnItm->DecimalPlaces) . '</td> <td>'.$LnItm->Units.'</td> - <td class="number">' . locale_number_format($LnItm->QtyInv,$LnItm->DecimalPlaces) . '</td>'; + <td class="number">' . number_format($LnItm->QtyInv,$LnItm->DecimalPlaces) . '</td>'; if ($LnItm->Controlled==1){ @@ -322,9 +322,9 @@ echo '<td class="number"><input tabindex="'.$j.'" type="text" class="number" name="' . $LnItm->LineNumber . '_QtyDispatched" maxlength=12 size=12 value="' . $LnItm->QtyDispatched . '"></td>'; } } - $DisplayDiscountPercent = locale_number_format($LnItm->DiscountPercent*100,2) . '%'; - $DisplayLineNetTotal = locale_number_format($LineTotal,$_SESSION['Items']->CurrDecimalPlaces); - $DisplayPrice = locale_number_format($LnItm->Price,$_SESSION['Items']->CurrDecimalPlaces); + $DisplayDiscountPercent = number_format($LnItm->DiscountPercent*100,2) . '%'; + $DisplayLineNetTotal = number_format($LineTotal,$_SESSION['Items']->CurrDecimalPlaces); + $DisplayPrice = number_format($LnItm->Price,$_SESSION['Items']->CurrDecimalPlaces); echo '<td class="number">'.$DisplayPrice.'</td> <td class="number">'.$DisplayDiscountPercent.'</td> <td class="number">'.$DisplayLineNetTotal.'</td>'; @@ -373,9 +373,9 @@ $TaxTotal += $TaxLineTotal; - $DisplayTaxAmount = locale_number_format($TaxLineTotal ,$_SESSION['Items']->CurrDecimalPlaces); + $DisplayTaxAmount = number_format($TaxLineTotal ,$_SESSION['Items']->CurrDecimalPlaces); - $DisplayGrossLineTotal = locale_number_format($LineTotal+ $TaxLineTotal,$_SESSION['Items']->CurrDecimalPlaces); + $DisplayGrossLineTotal = number_format($LineTotal+ $TaxLineTotal,$_SESSION['Items']->CurrDecimalPlaces); echo '<td class="number">'.$DisplayTaxAmount.'</td><td class="number">'.$DisplayGrossLineTotal.'</td>'; @@ -511,13 +511,13 @@ } echo '</td>'; -echo '<td class="number">' . locale_number_format($FreightTaxTotal,$_SESSION['Items']->CurrDecimalPlaces) . '</td> - <td class="number">' . locale_number_format($FreightTaxTotal+ $_POST['ChargeFreightCost'],$_SESSION['Items']->CurrDecimalPlaces) . '</td> +echo '<td class="number">' . number_format($FreightTaxTotal,$_SESSION['Items']->CurrDecimalPlaces) . '</td> + <td class="number">' . number_format($FreightTaxTotal+ $_POST['ChargeFreightCost'],$_SESSION['Items']->CurrDecimalPlaces) . '</td> </tr>'; $TaxTotal += $FreightTaxTotal; -$DisplaySubTotal = locale_number_format(($_SESSION['Items']->total + $_POST['ChargeFreightCost']),$_SESSION['Items']->CurrDecimalPlaces); +$DisplaySubTotal = number_format(($_SESSION['Items']->total + $_POST['ChargeFreightCost']),$_SESSION['Items']->CurrDecimalPlaces); /* round the totals to avoid silly entries */ @@ -529,8 +529,8 @@ <td colspan="10" class="number">' . _('Invoice Totals'). '</td> <td class="number:><hr><b>'.$DisplaySubTotal.'</b><hr></td> <td colspan="2"></td> - <td class="number"><hr><b>' . locale_number_format($TaxTotal,$_SESSION['Items']->CurrDecimalPlaces) . '</b><hr></td> - <td class="number"><hr><b>' . locale_number_format($TaxTotal+($_SESSION['Items']->total + $_POST['ChargeFreightCost']),$_SESSION['Items']->CurrDecimalPlaces) . '</b><hr></td> + <td class="number"><hr><b>' . number_format($TaxTotal,$_SESSION['Items']->CurrDecimalPlaces) . '</b><hr></td> + <td class="number"><hr><b>' . number_format($TaxTotal+($_SESSION['Items']->total + $_POST['ChargeFreightCost']),$_SESSION['Items']->CurrDecimalPlaces) . '</b><hr></td> </tr>'; if (! isset($_POST['DispatchDate']) OR ! Is_Date($_POST['DispatchDate'])){ Modified: trunk/ContractBOM.php =================================================================== --- trunk/ContractBOM.php 2011-09-04 10:10:14 UTC (rev 4677) +++ trunk/ContractBOM.php 2011-09-05 10:10:57 UTC (rev 4678) @@ -247,7 +247,7 @@ $LineTotal = $ContractComponent->Quantity * $ContractComponent->ItemCost; - $DisplayLineTotal = locale_number_format($LineTotal,2); + $DisplayLineTotal = number_format($LineTotal,2); if ($k==1){ echo '<tr class="EvenTableRows">'; @@ -267,7 +267,7 @@ $TotalCost += $LineTotal; } - $DisplayTotal = locale_number_format($TotalCost,2); + $DisplayTotal = number_format($TotalCost,2); echo '<tr> <td colspan="6" class="number">' . _('Total Cost') . '</td> <td class="number"><b>' . $DisplayTotal . '</b></td> Modified: trunk/ContractCosting.php =================================================================== --- trunk... [truncated message content] |
From: <dai...@us...> - 2011-09-09 03:39:14
|
Revision: 4682 http://web-erp.svn.sourceforge.net/web-erp/?rev=4682&view=rev Author: daintree Date: 2011-09-09 03:39:04 +0000 (Fri, 09 Sep 2011) Log Message: ----------- number formatting Modified Paths: -------------- trunk/AgedDebtors.php trunk/AgedSuppliers.php trunk/BOMExtendedQty.php trunk/BOMIndented.php trunk/BOMIndentedReverse.php trunk/BOMInquiry.php trunk/BOMListing.php trunk/BOMs.php trunk/BankMatching.php trunk/BankReconciliation.php trunk/ConfirmDispatchControlled_Invoice.php trunk/ConfirmDispatch_Invoice.php trunk/ContractBOM.php trunk/ContractCosting.php trunk/ContractOtherReqts.php trunk/Contracts.php trunk/CounterSales.php trunk/Credit_Invoice.php trunk/Currencies.php trunk/CustWhereAlloc.php trunk/CustomerAllocations.php trunk/CustomerInquiry.php trunk/CustomerReceipt.php trunk/CustomerTransInquiry.php trunk/Customers.php trunk/DailyBankTransactions.php trunk/DailySalesInquiry.php trunk/DebtorsAtPeriodEnd.php trunk/DeliveryDetails.php trunk/EmailConfirmation.php trunk/FTP_RadioBeacon.php trunk/FixedAssetDepreciation.php trunk/FixedAssetItems.php trunk/FixedAssetRegister.php trunk/FixedAssetTransfer.php trunk/GLAccountInquiry.php trunk/GLAccountReport.php trunk/GLBalanceSheet.php trunk/GLBudgets.php trunk/GLJournal.php trunk/GLProfit_Loss.php trunk/GLTagProfit_Loss.php trunk/GLTransInquiry.php trunk/GLTrialBalance.php trunk/GoodsReceived.php trunk/InventoryPlanning.php trunk/InventoryPlanningPrefSupplier.php trunk/InventoryQuantities.php trunk/InventoryValuation.php trunk/MRPPlannedPurchaseOrders.php trunk/MRPPlannedWorkOrders.php trunk/MRPReport.php trunk/MRPReschedules.php trunk/MRPShortages.php trunk/MailInventoryValuation.php trunk/Numbers/Words/lang.bg.php trunk/Numbers/Words/lang.fr.php trunk/Numbers/Words/lang.fr_BE.php trunk/OffersReceived.php trunk/OrderDetails.php trunk/OutstandingGRNs.php trunk/PDFBankingSummary.php trunk/PDFChequeListing.php trunk/PDFCustTransListing.php trunk/PDFCustomerList.php trunk/PDFDIFOT.php trunk/PDFDeliveryDifferences.php trunk/PDFGrn.php trunk/PDFLowGP.php trunk/PDFOrderStatus.php trunk/PDFOrdersInvoiced.php trunk/PDFPeriodStockTransListing.php trunk/PDFPickingList.php trunk/PDFPriceList.php trunk/PDFPrintLabel.php trunk/PDFQuotation.php trunk/PDFQuotationPortrait.php trunk/PDFReceipt.php trunk/PDFRemittanceAdvice.php trunk/PDFSuppTransListing.php trunk/PDFTopItems.php trunk/POReport.php trunk/PO_AuthorisationLevels.php trunk/PO_AuthoriseMyOrders.php trunk/PO_Items.php trunk/PO_OrderDetails.php trunk/PO_PDFPurchOrder.php trunk/PO_SelectOSPurchOrder.php trunk/PO_SelectPurchOrder.php trunk/PaymentAllocations.php trunk/Payments.php trunk/PcAssignCashToTab.php trunk/PcAuthorizeExpenses.php trunk/PcClaimExpensesFromTab.php trunk/PcReportTab.php trunk/PcTabs.php trunk/Prices.php trunk/PricesByCost.php trunk/Prices_Customer.php trunk/PrintCheque.php trunk/PrintCustOrder.php trunk/PrintCustOrder_generic.php trunk/PrintCustStatements.php trunk/PrintCustTrans.php trunk/PrintCustTransPortrait.php trunk/PurchData.php trunk/RecurringSalesOrders.php trunk/ReorderLevel.php trunk/ReprintGRN.php trunk/ReverseGRN.php trunk/SalesByTypePeriodInquiry.php trunk/SalesCategoryPeriodInquiry.php trunk/SalesInquiry.php trunk/SalesTopItemsInquiry.php trunk/SelectCompletedOrder.php trunk/SelectCreditItems.php trunk/SelectCustomer.php trunk/SelectOrderItems.php trunk/SelectProduct.php trunk/SelectRecurringSalesOrder.php trunk/SelectSalesOrder.php trunk/SelectSupplier.php trunk/ShipmentCosting.php trunk/Shipments.php trunk/SpecialOrder.php trunk/StockAdjustments.php trunk/StockCheck.php trunk/StockCostUpdate.php trunk/StockDispatch.php trunk/StockLocMovements.php trunk/StockLocStatus.php trunk/StockLocTransferReceive.php trunk/StockMovements.php trunk/StockQuantityByDate.php trunk/StockReorderLevel.php trunk/StockSerialItems.php trunk/StockStatus.php trunk/StockUsage.php trunk/SuppContractChgs.php trunk/SuppCreditGRNs.php trunk/SuppFixedAssetChgs.php trunk/SuppInvGRNs.php trunk/SuppPaymentRun.php trunk/SuppPriceList.php trunk/SuppShiptChgs.php trunk/SuppTransGLAnalysis.php trunk/SupplierAllocations.php trunk/SupplierBalsAtPeriodEnd.php trunk/SupplierCredit.php trunk/SupplierInquiry.php trunk/SupplierInvoice.php trunk/SupplierTenders.php trunk/SupplierTransInquiry.php trunk/Tax.php trunk/TopItems.php trunk/WorkOrderCosting.php trunk/WorkOrderEntry.php trunk/WorkOrderIssue.php trunk/WorkOrderReceive.php trunk/WorkOrderStatus.php trunk/Z_CheckAllocs.php trunk/Z_CheckDebtorsControl.php trunk/Z_CheckGLTransBalance.php trunk/Z_CurrencyDebtorsBalances.php trunk/Z_CurrencySuppliersBalances.php trunk/doc/Change.log trunk/includes/InputSerialItemsFile.php trunk/includes/InputSerialItemsKeyed.php trunk/includes/LanguageSetup.php trunk/includes/LanguagesArray.php trunk/includes/Login.php trunk/includes/MiscFunctions.php trunk/includes/OutputSerialItems.php trunk/includes/PDFPaymentRun_PymtFooter.php trunk/includes/PDFSalesAnalysis.inc trunk/includes/phplot/phplot.php trunk/includes/session.inc trunk/includes/tcpdf/tcpdf.php trunk/reportwriter/WriteForm.inc Modified: trunk/AgedDebtors.php =================================================================== --- trunk/AgedDebtors.php 2011-09-07 09:40:43 UTC (rev 4681) +++ trunk/AgedDebtors.php 2011-09-09 03:39:04 UTC (rev 4682) @@ -291,11 +291,11 @@ while ($AgedAnalysis = DB_fetch_array($CustomerResult,$db)){ $DecimalPlaces = $AgedAnalysis['decimalplaces']; - $DisplayDue = number_format($AgedAnalysis['due']-$AgedAnalysis['overdue1'],$DecimalPlaces); - $DisplayCurrent = number_format($AgedAnalysis['balance']-$AgedAnalysis['due'],$DecimalPlaces); - $DisplayBalance = number_format($AgedAnalysis['balance'],$DecimalPlaces); - $DisplayOverdue1 = number_format($AgedAnalysis['overdue1']-$AgedAnalysis['overdue2'],$DecimalPlaces); - $DisplayOverdue2 = number_format($AgedAnalysis['overdue2'],$DecimalPlaces); + $DisplayDue = locale_number_format($AgedAnalysis['due']-$AgedAnalysis['overdue1'],$DecimalPlaces); + $DisplayCurrent = locale_number_format($AgedAnalysis['balance']-$AgedAnalysis['due'],$DecimalPlaces); + $DisplayBalance = locale_number_format($AgedAnalysis['balance'],$DecimalPlaces); + $DisplayOverdue1 = locale_number_format($AgedAnalysis['overdue1']-$AgedAnalysis['overdue2'],$DecimalPlaces); + $DisplayOverdue2 = locale_number_format($AgedAnalysis['overdue2'],$DecimalPlaces); $TotBal += $AgedAnalysis['balance']; $TotDue += ($AgedAnalysis['due']-$AgedAnalysis['overdue1']); @@ -384,11 +384,11 @@ $DisplayTranDate = ConvertSQLDate($DetailTrans['trandate']); $LeftOvers = $pdf->addTextWrap($Left_Margin+125,$YPos,75,$FontSize,$DisplayTranDate,'left'); - $DisplayDue = number_format($DetailTrans['due']-$DetailTrans['overdue1'],$DecimalPlaces); - $DisplayCurrent = number_format($DetailTrans['balance']-$DetailTrans['due'],$DecimalPlaces); - $DisplayBalance = number_format($DetailTrans['balance'],$DecimalPlaces); - $DisplayOverdue1 = number_format($DetailTrans['overdue1']-$DetailTrans['overdue2'],$DecimalPlaces); - $DisplayOverdue2 = number_format($DetailTrans['overdue2'],$DecimalPlaces); + $DisplayDue = locale_number_format($DetailTrans['due']-$DetailTrans['overdue1'],$DecimalPlaces); + $DisplayCurrent = locale_number_format($DetailTrans['balance']-$DetailTrans['due'],$DecimalPlaces); + $DisplayBalance = locale_number_format($DetailTrans['balance'],$DecimalPlaces); + $DisplayOverdue1 = locale_number_format($DetailTrans['overdue1']-$DetailTrans['overdue2'],$DecimalPlaces); + $DisplayOverdue2 = locale_number_format($DetailTrans['overdue2'],$DecimalPlaces); $LeftOvers = $pdf->addTextWrap(220,$YPos,60,$FontSize,$DisplayBalance,'right'); $LeftOvers = $pdf->addTextWrap(280,$YPos,60,$FontSize,$DisplayCurrent,'right'); @@ -418,11 +418,11 @@ $pdf->line($Page_Width-$Right_Margin, $YPos+10 ,220, $YPos+10); } - $DisplayTotBalance = number_format($TotBal,$DecimalPlaces); - $DisplayTotDue = number_format($TotDue,$DecimalPlaces); - $DisplayTotCurrent = number_format($TotCurr,$DecimalPlaces); - $DisplayTotOverdue1 = number_format($TotOD1,$DecimalPlaces); - $DisplayTotOverdue2 = number_format($TotOD2,$DecimalPlaces); + $DisplayTotBalance = locale_number_format($TotBal,$DecimalPlaces); + $DisplayTotDue = locale_number_format($TotDue,$DecimalPlaces); + $DisplayTotCurrent = locale_number_format($TotCurr,$DecimalPlaces); + $DisplayTotOverdue1 = locale_number_format($TotOD1,$DecimalPlaces); + $DisplayTotOverdue2 = locale_number_format($TotOD2,$DecimalPlaces); $LeftOvers = $pdf->addTextWrap(220,$YPos,60,$FontSize,$DisplayTotBalance,'right'); $LeftOvers = $pdf->addTextWrap(280,$YPos,60,$FontSize,$DisplayTotCurrent,'right'); Modified: trunk/AgedSuppliers.php =================================================================== --- trunk/AgedSuppliers.php 2011-09-07 09:40:43 UTC (rev 4681) +++ trunk/AgedSuppliers.php 2011-09-09 03:39:04 UTC (rev 4682) @@ -126,11 +126,11 @@ While ($AgedAnalysis = DB_fetch_array($SupplierResult,$db)){ - $DisplayDue = number_format($AgedAnalysis['due']-$AgedAnalysis['overdue1'],2); - $DisplayCurrent = number_format($AgedAnalysis['balance']-$AgedAnalysis['due'],2); - $DisplayBalance = number_format($AgedAnalysis['balance'],2); - $DisplayOverdue1 = number_format($AgedAnalysis['overdue1']-$AgedAnalysis['overdue2'],2); - $DisplayOverdue2 = number_format($AgedAnalysis['overdue2'],2); + $DisplayDue = locale_number_format($AgedAnalysis['due']-$AgedAnalysis['overdue1'],2); + $DisplayCurrent = locale_number_format($AgedAnalysis['balance']-$AgedAnalysis['due'],2); + $DisplayBalance = locale_number_format($AgedAnalysis['balance'],2); + $DisplayOverdue1 = locale_number_format($AgedAnalysis['overdue1']-$AgedAnalysis['overdue2'],2); + $DisplayOverdue2 = locale_number_format($AgedAnalysis['overdue2'],2); $TotBal += $AgedAnalysis['balance']; $TotDue += ($AgedAnalysis['due']-$AgedAnalysis['overdue1']); @@ -204,11 +204,11 @@ $DisplayTranDate = ConvertSQLDate($DetailTrans['trandate']); $LeftOvers = $pdf->addTextWrap($Left_Margin+105,$YPos,70,$FontSize,$DisplayTranDate,'left'); - $DisplayDue = number_format($DetailTrans['due']-$DetailTrans['overdue1'],2); - $DisplayCurrent = number_format($DetailTrans['balance']-$DetailTrans['due'],2); - $DisplayBalance = number_format($DetailTrans['balance'],2); - $DisplayOverdue1 = number_format($DetailTrans['overdue1']-$DetailTrans['overdue2'],2); - $DisplayOverdue2 = number_format($DetailTrans['overdue2'],2); + $DisplayDue = locale_number_format($DetailTrans['due']-$DetailTrans['overdue1'],2); + $DisplayCurrent = locale_number_format($DetailTrans['balance']-$DetailTrans['due'],2); + $DisplayBalance = locale_number_format($DetailTrans['balance'],2); + $DisplayOverdue1 = locale_number_format($DetailTrans['overdue1']-$DetailTrans['overdue2'],2); + $DisplayOverdue2 = locale_number_format($DetailTrans['overdue2'],2); $LeftOvers = $pdf->addTextWrap(220,$YPos,60,$FontSize,$DisplayBalance,'right'); $LeftOvers = $pdf->addTextWrap(280,$YPos,60,$FontSize,$DisplayCurrent,'right'); @@ -238,11 +238,11 @@ $pdf->line($Page_Width-$Right_Margin, $YPos+10 ,220, $YPos+10); } - $DisplayTotBalance = number_format($TotBal,2); - $DisplayTotDue = number_format($TotDue,2); - $DisplayTotCurrent = number_format($TotCurr,2); - $DisplayTotOverdue1 = number_format($TotOD1,2); - $DisplayTotOverdue2 = number_format($TotOD2,2); + $DisplayTotBalance = locale_number_format($TotBal,2); + $DisplayTotDue = locale_number_format($TotDue,2); + $DisplayTotCurrent = locale_number_format($TotCurr,2); + $DisplayTotOverdue1 = locale_number_format($TotOD1,2); + $DisplayTotOverdue2 = locale_number_format($TotOD2,2); $LeftOvers = $pdf->addTextWrap(220,$YPos,60,$FontSize,$DisplayTotBalance,'right'); $LeftOvers = $pdf->addTextWrap(280,$YPos,60,$FontSize,$DisplayTotCurrent,'right'); Modified: trunk/BOMExtendedQty.php =================================================================== --- trunk/BOMExtendedQty.php 2011-09-07 09:40:43 UTC (rev 4681) +++ trunk/BOMExtendedQty.php 2011-09-09 03:39:04 UTC (rev 4682) @@ -216,15 +216,15 @@ $pdf->addTextWrap($Left_Margin+1,$YPos,90,$FontSize,$myrow['component'],'',0,$fill); $pdf->addTextWrap(140,$YPos,30,$FontSize,$myrow['mbflag'],'',0,$fill); $pdf->addTextWrap(170,$YPos,140,$FontSize,$myrow['description'],'',0,$fill); - $pdf->addTextWrap(310,$YPos,50,$FontSize,number_format($myrow['quantity'], + $pdf->addTextWrap(310,$YPos,50,$FontSize,locale_number_format($myrow['quantity'], $myrow['decimalplaces']),'right',0,$fill); - $pdf->addTextWrap(360,$YPos,40,$FontSize,number_format($myrow['qoh'], + $pdf->addTextWrap(360,$YPos,40,$FontSize,locale_number_format($myrow['qoh'], $myrow['decimalplaces']),'right',0,$fill); - $pdf->addTextWrap(400,$YPos,40,$FontSize,number_format($myrow['poqty'], + $pdf->addTextWrap(400,$YPos,40,$FontSize,locale_number_format($myrow['poqty'], $myrow['decimalplaces']),'right',0,$fill); - $pdf->addTextWrap(440,$YPos,40,$FontSize,number_format($myrow['woqty'], + $pdf->addTextWrap(440,$YPos,40,$FontSize,locale_number_format($myrow['woqty'], $myrow['decimalplaces']),'right',0,$fill); - $pdf->addTextWrap(480,$YPos,50,$FontSize,number_format($Difference, + $pdf->addTextWrap(480,$YPos,50,$FontSize,locale_number_format($Difference, $myrow['decimalplaces']),'right',0,$fill); } if ($YPos < $Bottom_Margin + $line_height){ Modified: trunk/BOMIndented.php =================================================================== --- trunk/BOMIndented.php 2011-09-07 09:40:43 UTC (rev 4681) +++ trunk/BOMIndented.php 2011-09-09 03:39:04 UTC (rev 4682) @@ -208,7 +208,7 @@ $pdf->addTextWrap(180,$YPos,180,$FontSize,$myrow['description'],'',0,$fill); $pdf->addTextWrap(360,$YPos,30,$FontSize,$myrow['loccode'],'right',0,$fill); $pdf->addTextWrap(390,$YPos,25,$FontSize,$myrow['workcentreadded'],'right',0,$fill); - $pdf->addTextWrap(415,$YPos,45,$FontSize,number_format($myrow['quantity'],2),'right',0,$fill); + $pdf->addTextWrap(415,$YPos,45,$FontSize,locale_number_format($myrow['quantity'],2),'right',0,$fill); $pdf->addTextWrap(460,$YPos,55,$FontSize,$FormatedEffectiveAfter,'right',0,$fill); $pdf->addTextWrap(515,$YPos,50,$FontSize,$FormatedEffectiveTo,'right',0,$fill); Modified: trunk/BOMIndentedReverse.php =================================================================== --- trunk/BOMIndentedReverse.php 2011-09-07 09:40:43 UTC (rev 4681) +++ trunk/BOMIndentedReverse.php 2011-09-09 03:39:04 UTC (rev 4682) @@ -197,7 +197,7 @@ $pdf->addTextWrap(180,$YPos,180,$FontSize,$myrow['description'],'',0,$fill); $pdf->addTextWrap(360,$YPos,30,$FontSize,$myrow['loccode'],'right',0,$fill); $pdf->addTextWrap(390,$YPos,25,$FontSize,$myrow['workcentreadded'],'right',0,$fill); - $pdf->addTextWrap(415,$YPos,45,$FontSize,number_format($myrow['quantity'],2),'right',0,$fill); + $pdf->addTextWrap(415,$YPos,45,$FontSize,locale_number_format($myrow['quantity'],2),'right',0,$fill); $pdf->addTextWrap(460,$YPos,55,$FontSize,$FormatedEffectiveAfter,'right',0,$fill); $pdf->addTextWrap(515,$YPos,50,$FontSize,$FormatedEffectiveTo,'right',0,$fill); Modified: trunk/BOMInquiry.php =================================================================== --- trunk/BOMInquiry.php 2011-09-07 09:40:43 UTC (rev 4681) +++ trunk/BOMInquiry.php 2011-09-09 03:39:04 UTC (rev 4682) @@ -116,7 +116,7 @@ if ($myrow['mbflag']=='A' OR $myrow['mbflag']=='K'){ $StockOnHand = 'N/A'; } else { - $StockOnHand = number_format($myrow['totalonhand'],2); + $StockOnHand = locale_number_format($myrow['totalonhand'],2); } $tabindex=$j+4; printf('<td><input tabindex="' .$tabindex . '" type="submit" name="StockID" value="%s"</td> @@ -207,7 +207,7 @@ </tr>', $ComponentLink, $myrow['description'], - number_format($myrow['quantity'],$myrow['decimalplaces']), + locale_number_format($myrow['quantity'],$myrow['decimalplaces']), $myrow['standardcost'], $myrow['componentcost']); @@ -219,14 +219,14 @@ $TotalCost += $ParentLabourCost; echo '<tr> <td colspan="4" class="number"><b>' . _('Labour Cost') . '</b></td> - <td class=number><b>' . number_format($ParentLabourCost,$_SESSION['CompanyRecord']['decimalplaces']) . '</b></td></tr>'; + <td class=number><b>' . locale_number_format($ParentLabourCost,$_SESSION['CompanyRecord']['decimalplaces']) . '</b></td></tr>'; $TotalCost += $ParentOverheadCost; echo '<tr><td colspan="4" class="number"><b>' . _('Overhead Cost') . '</b></td> - <td class=number><b>' . number_format($ParentOverheadCost,$_SESSION['CompanyRecord']['decimalplaces']) . '</b></td></tr>'; + <td class=number><b>' . locale_number_format($ParentOverheadCost,$_SESSION['CompanyRecord']['decimalplaces']) . '</b></td></tr>'; echo '<tr> <td colspan=4 class=number><b>' . _('Total Cost') . '</b></td> - <td class=number><b>' . number_format($TotalCost,$_SESSION['CompanyRecord']['decimalplaces']) . '</b></td> + <td class=number><b>' . locale_number_format($TotalCost,$_SESSION['CompanyRecord']['decimalplaces']) . '</b></td> </tr>'; echo '</table>'; Modified: trunk/BOMListing.php =================================================================== --- trunk/BOMListing.php 2011-09-07 09:40:43 UTC (rev 4681) +++ trunk/BOMListing.php 2011-09-09 03:39:04 UTC (rev 4682) @@ -83,7 +83,7 @@ $LeftOvers = $pdf->addTextWrap($Left_Margin+5,$YPos,80,$FontSize,$BOMList['component'],'left'); $LeftOvers = $pdf->addTextWrap(110,$YPos,200,$FontSize,$BOMList['compdescription'],'left'); - $DisplayQuantity = number_format($BOMList['quantity'],$BOMList['decimalplaces']); + $DisplayQuantity = locale_number_format($BOMList['quantity'],$BOMList['decimalplaces']); $LeftOvers = $pdf->addTextWrap(320,$YPos,50,$FontSize,ConvertSQLDate($BOMList['eff_frm']),'left'); $LeftOvers = $pdf->addTextWrap(370,$YPos,50,$FontSize,ConvertSQLDate($BOMList['eff_to']),'left'); $LeftOvers = $pdf->addTextWrap(420,$YPos,20,$FontSize,$BOMList['loccode'],'left'); Modified: trunk/BOMs.php =================================================================== --- trunk/BOMs.php 2011-09-07 09:40:43 UTC (rev 4681) +++ trunk/BOMs.php 2011-09-09 03:39:04 UTC (rev 4682) @@ -129,7 +129,7 @@ if ($myrow[7]=='D' OR $myrow[7]=='K' OR $myrow[7]=='A' OR $myrow[7]=='G'){ $QuantityOnHand = _('N/A'); } else { - $QuantityOnHand = number_format($myrow[10],$myrow[11]); + $QuantityOnHand = locale_number_format($myrow[10],$myrow[11]); } printf('<td>%s</td> <td>%s</td> @@ -834,7 +834,7 @@ if ($myrow['mbflag']=='A' OR $myrow['mbflag']=='K' OR $myrow['mbflag']=='G'){ $StockOnHand = _('N/A'); } else { - $StockOnHand = number_format($myrow['totalonhand'],2); + $StockOnHand = locale_number_format($myrow['totalonhand'],2); } $tab = $j+3; printf('<td><input tabindex="' . $tab . '" type="submit" name="Select" value="%s"</td> Modified: trunk/BankMatching.php =================================================================== --- trunk/BankMatching.php 2011-09-07 09:40:43 UTC (rev 4681) +++ trunk/BankMatching.php 2011-09-09 03:39:04 UTC (rev 4682) @@ -257,8 +257,8 @@ $myrow['ref'], $myrow['banktranstype'], $DisplayTranDate, - number_format($myrow['amt'],2), - number_format($Outstanding,2), + locale_number_format($myrow['amt'],2), + locale_number_format($Outstanding,2), _('Unclear'), $i, $i, @@ -283,8 +283,8 @@ $myrow['ref'], $myrow['banktranstype'], $DisplayTranDate, - number_format($myrow['amt'],2), - number_format($Outstanding,2), + locale_number_format($myrow['amt'],2), + locale_number_format($Outstanding,2), $i, $i, $myrow['banktransid'], Modified: trunk/BankReconciliation.php =================================================================== --- trunk/BankReconciliation.php 2011-09-07 09:40:43 UTC (rev 4681) +++ trunk/BankReconciliation.php 2011-09-09 03:39:04 UTC (rev 4682) @@ -86,7 +86,7 @@ $result = DB_query($SQL,$db,$ErrMsg,$DbgMsg,true); $result = DB_Txn_Commit($db); - prnMsg(_('Exchange difference of') . ' ' . number_format($ExchangeDifference,2) . ' ' . _('has been posted'),'success'); + prnMsg(_('Exchange difference of') . ' ' . locale_number_format($ExchangeDifference,2) . ' ' . _('has been posted'),'success'); } //end if the bank statement balance was numeric } @@ -171,7 +171,7 @@ echo ' (' . $BankCurrCode . ' @ ' . $ExRate .')'; } echo '</b></td> - <td valign=bottom class="number"><b>' . number_format($Balance*$ExRate,$CurrDecimalPlaces) . '</b></td></tr>'; + <td valign=bottom class="number"><b>' . locale_number_format($Balance*$ExRate,$CurrDecimalPlaces) . '</b></td></tr>'; $SQL = "SELECT amount/exrate AS amt, amountcleared, @@ -229,8 +229,8 @@ $myrow['typename'], $myrow['transno'], $myrow['ref'], - number_format($myrow['amt'],$CurrDecimalPlaces), - number_format($myrow['outstanding'],$CurrDecimalPlaces)); + locale_number_format($myrow['amt'],$CurrDecimalPlaces), + locale_number_format($myrow['outstanding'],$CurrDecimalPlaces)); $TotalUnpresentedCheques +=$myrow['outstanding']; @@ -242,7 +242,7 @@ } //end of while loop echo '<tr></tr> - <tr class=EvenTableRows><td colspan=6>' . _('Total of all unpresented cheques') . '</td><td class="number">' . number_format($TotalUnpresentedCheques,$CurrDecimalPlaces) . '</td></tr>'; + <tr class=EvenTableRows><td colspan=6>' . _('Total of all unpresented cheques') . '</td><td class="number">' . locale_number_format($TotalUnpresentedCheques,$CurrDecimalPlaces) . '</td></tr>'; $SQL = "SELECT amount/exrate AS amt, amountcleared, @@ -301,8 +301,8 @@ $myrow['typename'], $myrow['transno'], $myrow['ref'], - number_format($myrow['amt'],$CurrDecimalPlaces), - number_format($myrow['outstanding'],$CurrDecimalPlaces) ); + locale_number_format($myrow['amt'],$CurrDecimalPlaces), + locale_number_format($myrow['outstanding'],$CurrDecimalPlaces) ); $TotalUnclearedDeposits +=$myrow['outstanding']; @@ -316,13 +316,13 @@ echo '<tr></tr> <tr class=EvenTableRows> <td colspan=6>' . _('Total of all uncleared deposits') . '</td> - <td class=number>' . number_format($TotalUnclearedDeposits,$CurrDecimalPlaces) . '</td> + <td class=number>' . locale_number_format($TotalUnclearedDeposits,$CurrDecimalPlaces) . '</td> </tr>'; $FXStatementBalance = ($Balance*$ExRate) - $TotalUnpresentedCheques -$TotalUnclearedDeposits; echo '<tr></tr> <tr class=EvenTableRows> <td colspan=6><b>' . _('Bank statement balance should be') . ' (' . $BankCurrCode . ')</b></td> - <td class=number>' . number_format($FXStatementBalance,$CurrDecimalPlaces) . '</td></tr>'; + <td class=number>' . locale_number_format($FXStatementBalance,$CurrDecimalPlaces) . '</td></tr>'; if (isset($_POST['DoExchangeDifference'])){ echo '<input type="hidden" name="DoExchangeDifference" value=' . $FXStatementBalance . '>'; Modified: trunk/ConfirmDispatchControlled_Invoice.php =================================================================== --- trunk/ConfirmDispatchControlled_Invoice.php 2011-09-07 09:40:43 UTC (rev 4681) +++ trunk/ConfirmDispatchControlled_Invoice.php 2011-09-09 03:39:04 UTC (rev 4682) @@ -55,7 +55,7 @@ echo '<br /><a href="'. $rootpath. '/ConfirmDispatch_Invoice.php">'. _('Back to Confirmation of Dispatch') . '/' . _('Invoice'). '</a>'; -echo '<br /><font size=2><b>'. _('Dispatch of up to').' '. number_format($LineItem->Quantity-$LineItem->QtyInv, $LineItem->DecimalPlaces). ' '. _('Controlled items').' ' . $LineItem->StockID . ' - ' . $LineItem->ItemDescription . ' '. _('on order').' ' . $_SESSION['Items']->OrderNo . ' '. _('to'). ' ' . $_SESSION['Items']->CustomerName . '</b></font></div>'; +echo '<br /><font size=2><b>'. _('Dispatch of up to').' '. locale_number_format($LineItem->Quantity-$LineItem->QtyInv, $LineItem->DecimalPlaces). ' '. _('Controlled items').' ' . $LineItem->StockID . ' - ' . $LineItem->ItemDescription . ' '. _('on order').' ' . $_SESSION['Items']->OrderNo . ' '. _('to'). ' ' . $_SESSION['Items']->CustomerName . '</b></font></div>'; /** vars needed by InputSerialItem : **/ $StockID = $LineItem->StockID; Modified: trunk/ConfirmDispatch_Invoice.php =================================================================== --- trunk/ConfirmDispatch_Invoice.php 2011-09-07 09:40:43 UTC (rev 4681) +++ trunk/ConfirmDispatch_Invoice.php 2011-09-09 03:39:04 UTC (rev 4682) @@ -304,9 +304,9 @@ echo '<td>'.$LnItm->StockID.'</td> <td>'.$LnItm->ItemDescription.'</td> - <td class="number">' . number_format($LnItm->Quantity,$LnItm->DecimalPlaces) . '</td> + <td class="number">' . locale_number_format($LnItm->Quantity,$LnItm->DecimalPlaces) . '</td> <td>'.$LnItm->Units.'</td> - <td class="number">' . number_format($LnItm->QtyInv,$LnItm->DecimalPlaces) . '</td>'; + <td class="number">' . locale_number_format($LnItm->QtyInv,$LnItm->DecimalPlaces) . '</td>'; if ($LnItm->Controlled==1){ @@ -322,9 +322,9 @@ echo '<td class="number"><input tabindex="'.$j.'" type="text" class="number" name="' . $LnItm->LineNumber . '_QtyDispatched" maxlength=12 size=12 value="' . $LnItm->QtyDispatched . '"></td>'; } } - $DisplayDiscountPercent = number_format($LnItm->DiscountPercent*100,2) . '%'; - $DisplayLineNetTotal = number_format($LineTotal,$_SESSION['Items']->CurrDecimalPlaces); - $DisplayPrice = number_format($LnItm->Price,$_SESSION['Items']->CurrDecimalPlaces); + $DisplayDiscountPercent = locale_number_format($LnItm->DiscountPercent*100,2) . '%'; + $DisplayLineNetTotal = locale_number_format($LineTotal,$_SESSION['Items']->CurrDecimalPlaces); + $DisplayPrice = locale_number_format($LnItm->Price,$_SESSION['Items']->CurrDecimalPlaces); echo '<td class="number">'.$DisplayPrice.'</td> <td class="number">'.$DisplayDiscountPercent.'</td> <td class="number">'.$DisplayLineNetTotal.'</td>'; @@ -373,9 +373,9 @@ $TaxTotal += $TaxLineTotal; - $DisplayTaxAmount = number_format($TaxLineTotal ,$_SESSION['Items']->CurrDecimalPlaces); + $DisplayTaxAmount = locale_number_format($TaxLineTotal ,$_SESSION['Items']->CurrDecimalPlaces); - $DisplayGrossLineTotal = number_format($LineTotal+ $TaxLineTotal,$_SESSION['Items']->CurrDecimalPlaces); + $DisplayGrossLineTotal = locale_number_format($LineTotal+ $TaxLineTotal,$_SESSION['Items']->CurrDecimalPlaces); echo '<td class="number">'.$DisplayTaxAmount.'</td><td class="number">'.$DisplayGrossLineTotal.'</td>'; @@ -511,13 +511,13 @@ } echo '</td>'; -echo '<td class="number">' . number_format($FreightTaxTotal,$_SESSION['Items']->CurrDecimalPlaces) . '</td> - <td class="number">' . number_format($FreightTaxTotal+ $_POST['ChargeFreightCost'],$_SESSION['Items']->CurrDecimalPlaces) . '</td> +echo '<td class="number">' . locale_number_format($FreightTaxTotal,$_SESSION['Items']->CurrDecimalPlaces) . '</td> + <td class="number">' . locale_number_format($FreightTaxTotal+ $_POST['ChargeFreightCost'],$_SESSION['Items']->CurrDecimalPlaces) . '</td> </tr>'; $TaxTotal += $FreightTaxTotal; -$DisplaySubTotal = number_format(($_SESSION['Items']->total + $_POST['ChargeFreightCost']),$_SESSION['Items']->CurrDecimalPlaces); +$DisplaySubTotal = locale_number_format(($_SESSION['Items']->total + $_POST['ChargeFreightCost']),$_SESSION['Items']->CurrDecimalPlaces); /* round the totals to avoid silly entries */ @@ -529,8 +529,8 @@ <td colspan="10" class="number">' . _('Invoice Totals'). '</td> <td class="number:><hr><b>'.$DisplaySubTotal.'</b><hr></td> <td colspan="2"></td> - <td class="number"><hr><b>' . number_format($TaxTotal,$_SESSION['Items']->CurrDecimalPlaces) . '</b><hr></td> - <td class="number"><hr><b>' . number_format($TaxTotal+($_SESSION['Items']->total + $_POST['ChargeFreightCost']),$_SESSION['Items']->CurrDecimalPlaces) . '</b><hr></td> + <td class="number"><hr><b>' . locale_number_format($TaxTotal,$_SESSION['Items']->CurrDecimalPlaces) . '</b><hr></td> + <td class="number"><hr><b>' . locale_number_format($TaxTotal+($_SESSION['Items']->total + $_POST['ChargeFreightCost']),$_SESSION['Items']->CurrDecimalPlaces) . '</b><hr></td> </tr>'; if (! isset($_POST['DispatchDate']) OR ! Is_Date($_POST['DispatchDate'])){ Modified: trunk/ContractBOM.php =================================================================== --- trunk/ContractBOM.php 2011-09-07 09:40:43 UTC (rev 4681) +++ trunk/ContractBOM.php 2011-09-09 03:39:04 UTC (rev 4682) @@ -247,7 +247,7 @@ $LineTotal = $ContractComponent->Quantity * $ContractComponent->ItemCost; - $DisplayLineTotal = number_format($LineTotal,2); + $DisplayLineTotal = locale_number_format($LineTotal,2); if ($k==1){ echo '<tr class="EvenTableRows">'; @@ -267,7 +267,7 @@ $TotalCost += $LineTotal; } - $DisplayTotal = number_format($TotalCost,2); + $DisplayTotal = locale_number_format($TotalCost,2); echo '<tr> <td colspan="6" class="number">' . _('Total Cost') . '</td> <td class="number"><b>' . $DisplayTotal . '</b></td> Modified: trunk/ContractCosting.php =================================================================== --- trunk/ContractCosting.php 2011-09-07 09:40:43 UTC (rev 4681) +++ trunk/ContractCosting.php 2011-09-09 03:39:04 UTC (rev 4682) @@ -94,8 +94,8 @@ <td>' . $Component->I... [truncated message content] |
From: <dai...@us...> - 2011-09-09 03:39:14
|
Revision: 4682 http://web-erp.svn.sourceforge.net/web-erp/?rev=4682&view=rev Author: daintree Date: 2011-09-09 03:39:04 +0000 (Fri, 09 Sep 2011) Log Message: ----------- number formatting Modified Paths: -------------- trunk/AgedDebtors.php trunk/AgedSuppliers.php trunk/BOMExtendedQty.php trunk/BOMIndented.php trunk/BOMIndentedReverse.php trunk/BOMInquiry.php trunk/BOMListing.php trunk/BOMs.php trunk/BankMatching.php trunk/BankReconciliation.php trunk/ConfirmDispatchControlled_Invoice.php trunk/ConfirmDispatch_Invoice.php trunk/ContractBOM.php trunk/ContractCosting.php trunk/ContractOtherReqts.php trunk/Contracts.php trunk/CounterSales.php trunk/Credit_Invoice.php trunk/Currencies.php trunk/CustWhereAlloc.php trunk/CustomerAllocations.php trunk/CustomerInquiry.php trunk/CustomerReceipt.php trunk/CustomerTransInquiry.php trunk/Customers.php trunk/DailyBankTransactions.php trunk/DailySalesInquiry.php trunk/DebtorsAtPeriodEnd.php trunk/DeliveryDetails.php trunk/EmailConfirmation.php trunk/FTP_RadioBeacon.php trunk/FixedAssetDepreciation.php trunk/FixedAssetItems.php trunk/FixedAssetRegister.php trunk/FixedAssetTransfer.php trunk/GLAccountInquiry.php trunk/GLAccountReport.php trunk/GLBalanceSheet.php trunk/GLBudgets.php trunk/GLJournal.php trunk/GLProfit_Loss.php trunk/GLTagProfit_Loss.php trunk/GLTransInquiry.php trunk/GLTrialBalance.php trunk/GoodsReceived.php trunk/InventoryPlanning.php trunk/InventoryPlanningPrefSupplier.php trunk/InventoryQuantities.php trunk/InventoryValuation.php trunk/MRPPlannedPurchaseOrders.php trunk/MRPPlannedWorkOrders.php trunk/MRPReport.php trunk/MRPReschedules.php trunk/MRPShortages.php trunk/MailInventoryValuation.php trunk/Numbers/Words/lang.bg.php trunk/Numbers/Words/lang.fr.php trunk/Numbers/Words/lang.fr_BE.php trunk/OffersReceived.php trunk/OrderDetails.php trunk/OutstandingGRNs.php trunk/PDFBankingSummary.php trunk/PDFChequeListing.php trunk/PDFCustTransListing.php trunk/PDFCustomerList.php trunk/PDFDIFOT.php trunk/PDFDeliveryDifferences.php trunk/PDFGrn.php trunk/PDFLowGP.php trunk/PDFOrderStatus.php trunk/PDFOrdersInvoiced.php trunk/PDFPeriodStockTransListing.php trunk/PDFPickingList.php trunk/PDFPriceList.php trunk/PDFPrintLabel.php trunk/PDFQuotation.php trunk/PDFQuotationPortrait.php trunk/PDFReceipt.php trunk/PDFRemittanceAdvice.php trunk/PDFSuppTransListing.php trunk/PDFTopItems.php trunk/POReport.php trunk/PO_AuthorisationLevels.php trunk/PO_AuthoriseMyOrders.php trunk/PO_Items.php trunk/PO_OrderDetails.php trunk/PO_PDFPurchOrder.php trunk/PO_SelectOSPurchOrder.php trunk/PO_SelectPurchOrder.php trunk/PaymentAllocations.php trunk/Payments.php trunk/PcAssignCashToTab.php trunk/PcAuthorizeExpenses.php trunk/PcClaimExpensesFromTab.php trunk/PcReportTab.php trunk/PcTabs.php trunk/Prices.php trunk/PricesByCost.php trunk/Prices_Customer.php trunk/PrintCheque.php trunk/PrintCustOrder.php trunk/PrintCustOrder_generic.php trunk/PrintCustStatements.php trunk/PrintCustTrans.php trunk/PrintCustTransPortrait.php trunk/PurchData.php trunk/RecurringSalesOrders.php trunk/ReorderLevel.php trunk/ReprintGRN.php trunk/ReverseGRN.php trunk/SalesByTypePeriodInquiry.php trunk/SalesCategoryPeriodInquiry.php trunk/SalesInquiry.php trunk/SalesTopItemsInquiry.php trunk/SelectCompletedOrder.php trunk/SelectCreditItems.php trunk/SelectCustomer.php trunk/SelectOrderItems.php trunk/SelectProduct.php trunk/SelectRecurringSalesOrder.php trunk/SelectSalesOrder.php trunk/SelectSupplier.php trunk/ShipmentCosting.php trunk/Shipments.php trunk/SpecialOrder.php trunk/StockAdjustments.php trunk/StockCheck.php trunk/StockCostUpdate.php trunk/StockDispatch.php trunk/StockLocMovements.php trunk/StockLocStatus.php trunk/StockLocTransferReceive.php trunk/StockMovements.php trunk/StockQuantityByDate.php trunk/StockReorderLevel.php trunk/StockSerialItems.php trunk/StockStatus.php trunk/StockUsage.php trunk/SuppContractChgs.php trunk/SuppCreditGRNs.php trunk/SuppFixedAssetChgs.php trunk/SuppInvGRNs.php trunk/SuppPaymentRun.php trunk/SuppPriceList.php trunk/SuppShiptChgs.php trunk/SuppTransGLAnalysis.php trunk/SupplierAllocations.php trunk/SupplierBalsAtPeriodEnd.php trunk/SupplierCredit.php trunk/SupplierInquiry.php trunk/SupplierInvoice.php trunk/SupplierTenders.php trunk/SupplierTransInquiry.php trunk/Tax.php trunk/TopItems.php trunk/WorkOrderCosting.php trunk/WorkOrderEntry.php trunk/WorkOrderIssue.php trunk/WorkOrderReceive.php trunk/WorkOrderStatus.php trunk/Z_CheckAllocs.php trunk/Z_CheckDebtorsControl.php trunk/Z_CheckGLTransBalance.php trunk/Z_CurrencyDebtorsBalances.php trunk/Z_CurrencySuppliersBalances.php trunk/doc/Change.log trunk/includes/InputSerialItemsFile.php trunk/includes/InputSerialItemsKeyed.php trunk/includes/LanguageSetup.php trunk/includes/LanguagesArray.php trunk/includes/Login.php trunk/includes/MiscFunctions.php trunk/includes/OutputSerialItems.php trunk/includes/PDFPaymentRun_PymtFooter.php trunk/includes/PDFSalesAnalysis.inc trunk/includes/phplot/phplot.php trunk/includes/session.inc trunk/includes/tcpdf/tcpdf.php trunk/reportwriter/WriteForm.inc Modified: trunk/AgedDebtors.php =================================================================== --- trunk/AgedDebtors.php 2011-09-07 09:40:43 UTC (rev 4681) +++ trunk/AgedDebtors.php 2011-09-09 03:39:04 UTC (rev 4682) @@ -291,11 +291,11 @@ while ($AgedAnalysis = DB_fetch_array($CustomerResult,$db)){ $DecimalPlaces = $AgedAnalysis['decimalplaces']; - $DisplayDue = number_format($AgedAnalysis['due']-$AgedAnalysis['overdue1'],$DecimalPlaces); - $DisplayCurrent = number_format($AgedAnalysis['balance']-$AgedAnalysis['due'],$DecimalPlaces); - $DisplayBalance = number_format($AgedAnalysis['balance'],$DecimalPlaces); - $DisplayOverdue1 = number_format($AgedAnalysis['overdue1']-$AgedAnalysis['overdue2'],$DecimalPlaces); - $DisplayOverdue2 = number_format($AgedAnalysis['overdue2'],$DecimalPlaces); + $DisplayDue = locale_number_format($AgedAnalysis['due']-$AgedAnalysis['overdue1'],$DecimalPlaces); + $DisplayCurrent = locale_number_format($AgedAnalysis['balance']-$AgedAnalysis['due'],$DecimalPlaces); + $DisplayBalance = locale_number_format($AgedAnalysis['balance'],$DecimalPlaces); + $DisplayOverdue1 = locale_number_format($AgedAnalysis['overdue1']-$AgedAnalysis['overdue2'],$DecimalPlaces); + $DisplayOverdue2 = locale_number_format($AgedAnalysis['overdue2'],$DecimalPlaces); $TotBal += $AgedAnalysis['balance']; $TotDue += ($AgedAnalysis['due']-$AgedAnalysis['overdue1']); @@ -384,11 +384,11 @@ $DisplayTranDate = ConvertSQLDate($DetailTrans['trandate']); $LeftOvers = $pdf->addTextWrap($Left_Margin+125,$YPos,75,$FontSize,$DisplayTranDate,'left'); - $DisplayDue = number_format($DetailTrans['due']-$DetailTrans['overdue1'],$DecimalPlaces); - $DisplayCurrent = number_format($DetailTrans['balance']-$DetailTrans['due'],$DecimalPlaces); - $DisplayBalance = number_format($DetailTrans['balance'],$DecimalPlaces); - $DisplayOverdue1 = number_format($DetailTrans['overdue1']-$DetailTrans['overdue2'],$DecimalPlaces); - $DisplayOverdue2 = number_format($DetailTrans['overdue2'],$DecimalPlaces); + $DisplayDue = locale_number_format($DetailTrans['due']-$DetailTrans['overdue1'],$DecimalPlaces); + $DisplayCurrent = locale_number_format($DetailTrans['balance']-$DetailTrans['due'],$DecimalPlaces); + $DisplayBalance = locale_number_format($DetailTrans['balance'],$DecimalPlaces); + $DisplayOverdue1 = locale_number_format($DetailTrans['overdue1']-$DetailTrans['overdue2'],$DecimalPlaces); + $DisplayOverdue2 = locale_number_format($DetailTrans['overdue2'],$DecimalPlaces); $LeftOvers = $pdf->addTextWrap(220,$YPos,60,$FontSize,$DisplayBalance,'right'); $LeftOvers = $pdf->addTextWrap(280,$YPos,60,$FontSize,$DisplayCurrent,'right'); @@ -418,11 +418,11 @@ $pdf->line($Page_Width-$Right_Margin, $YPos+10 ,220, $YPos+10); } - $DisplayTotBalance = number_format($TotBal,$DecimalPlaces); - $DisplayTotDue = number_format($TotDue,$DecimalPlaces); - $DisplayTotCurrent = number_format($TotCurr,$DecimalPlaces); - $DisplayTotOverdue1 = number_format($TotOD1,$DecimalPlaces); - $DisplayTotOverdue2 = number_format($TotOD2,$DecimalPlaces); + $DisplayTotBalance = locale_number_format($TotBal,$DecimalPlaces); + $DisplayTotDue = locale_number_format($TotDue,$DecimalPlaces); + $DisplayTotCurrent = locale_number_format($TotCurr,$DecimalPlaces); + $DisplayTotOverdue1 = locale_number_format($TotOD1,$DecimalPlaces); + $DisplayTotOverdue2 = locale_number_format($TotOD2,$DecimalPlaces); $LeftOvers = $pdf->addTextWrap(220,$YPos,60,$FontSize,$DisplayTotBalance,'right'); $LeftOvers = $pdf->addTextWrap(280,$YPos,60,$FontSize,$DisplayTotCurrent,'right'); Modified: trunk/AgedSuppliers.php =================================================================== --- trunk/AgedSuppliers.php 2011-09-07 09:40:43 UTC (rev 4681) +++ trunk/AgedSuppliers.php 2011-09-09 03:39:04 UTC (rev 4682) @@ -126,11 +126,11 @@ While ($AgedAnalysis = DB_fetch_array($SupplierResult,$db)){ - $DisplayDue = number_format($AgedAnalysis['due']-$AgedAnalysis['overdue1'],2); - $DisplayCurrent = number_format($AgedAnalysis['balance']-$AgedAnalysis['due'],2); - $DisplayBalance = number_format($AgedAnalysis['balance'],2); - $DisplayOverdue1 = number_format($AgedAnalysis['overdue1']-$AgedAnalysis['overdue2'],2); - $DisplayOverdue2 = number_format($AgedAnalysis['overdue2'],2); + $DisplayDue = locale_number_format($AgedAnalysis['due']-$AgedAnalysis['overdue1'],2); + $DisplayCurrent = locale_number_format($AgedAnalysis['balance']-$AgedAnalysis['due'],2); + $DisplayBalance = locale_number_format($AgedAnalysis['balance'],2); + $DisplayOverdue1 = locale_number_format($AgedAnalysis['overdue1']-$AgedAnalysis['overdue2'],2); + $DisplayOverdue2 = locale_number_format($AgedAnalysis['overdue2'],2); $TotBal += $AgedAnalysis['balance']; $TotDue += ($AgedAnalysis['due']-$AgedAnalysis['overdue1']); @@ -204,11 +204,11 @@ $DisplayTranDate = ConvertSQLDate($DetailTrans['trandate']); $LeftOvers = $pdf->addTextWrap($Left_Margin+105,$YPos,70,$FontSize,$DisplayTranDate,'left'); - $DisplayDue = number_format($DetailTrans['due']-$DetailTrans['overdue1'],2); - $DisplayCurrent = number_format($DetailTrans['balance']-$DetailTrans['due'],2); - $DisplayBalance = number_format($DetailTrans['balance'],2); - $DisplayOverdue1 = number_format($DetailTrans['overdue1']-$DetailTrans['overdue2'],2); - $DisplayOverdue2 = number_format($DetailTrans['overdue2'],2); + $DisplayDue = locale_number_format($DetailTrans['due']-$DetailTrans['overdue1'],2); + $DisplayCurrent = locale_number_format($DetailTrans['balance']-$DetailTrans['due'],2); + $DisplayBalance = locale_number_format($DetailTrans['balance'],2); + $DisplayOverdue1 = locale_number_format($DetailTrans['overdue1']-$DetailTrans['overdue2'],2); + $DisplayOverdue2 = locale_number_format($DetailTrans['overdue2'],2); $LeftOvers = $pdf->addTextWrap(220,$YPos,60,$FontSize,$DisplayBalance,'right'); $LeftOvers = $pdf->addTextWrap(280,$YPos,60,$FontSize,$DisplayCurrent,'right'); @@ -238,11 +238,11 @@ $pdf->line($Page_Width-$Right_Margin, $YPos+10 ,220, $YPos+10); } - $DisplayTotBalance = number_format($TotBal,2); - $DisplayTotDue = number_format($TotDue,2); - $DisplayTotCurrent = number_format($TotCurr,2); - $DisplayTotOverdue1 = number_format($TotOD1,2); - $DisplayTotOverdue2 = number_format($TotOD2,2); + $DisplayTotBalance = locale_number_format($TotBal,2); + $DisplayTotDue = locale_number_format($TotDue,2); + $DisplayTotCurrent = locale_number_format($TotCurr,2); + $DisplayTotOverdue1 = locale_number_format($TotOD1,2); + $DisplayTotOverdue2 = locale_number_format($TotOD2,2); $LeftOvers = $pdf->addTextWrap(220,$YPos,60,$FontSize,$DisplayTotBalance,'right'); $LeftOvers = $pdf->addTextWrap(280,$YPos,60,$FontSize,$DisplayTotCurrent,'right'); Modified: trunk/BOMExtendedQty.php =================================================================== --- trunk/BOMExtendedQty.php 2011-09-07 09:40:43 UTC (rev 4681) +++ trunk/BOMExtendedQty.php 2011-09-09 03:39:04 UTC (rev 4682) @@ -216,15 +216,15 @@ $pdf->addTextWrap($Left_Margin+1,$YPos,90,$FontSize,$myrow['component'],'',0,$fill); $pdf->addTextWrap(140,$YPos,30,$FontSize,$myrow['mbflag'],'',0,$fill); $pdf->addTextWrap(170,$YPos,140,$FontSize,$myrow['description'],'',0,$fill); - $pdf->addTextWrap(310,$YPos,50,$FontSize,number_format($myrow['quantity'], + $pdf->addTextWrap(310,$YPos,50,$FontSize,locale_number_format($myrow['quantity'], $myrow['decimalplaces']),'right',0,$fill); - $pdf->addTextWrap(360,$YPos,40,$FontSize,number_format($myrow['qoh'], + $pdf->addTextWrap(360,$YPos,40,$FontSize,locale_number_format($myrow['qoh'], $myrow['decimalplaces']),'right',0,$fill); - $pdf->addTextWrap(400,$YPos,40,$FontSize,number_format($myrow['poqty'], + $pdf->addTextWrap(400,$YPos,40,$FontSize,locale_number_format($myrow['poqty'], $myrow['decimalplaces']),'right',0,$fill); - $pdf->addTextWrap(440,$YPos,40,$FontSize,number_format($myrow['woqty'], + $pdf->addTextWrap(440,$YPos,40,$FontSize,locale_number_format($myrow['woqty'], $myrow['decimalplaces']),'right',0,$fill); - $pdf->addTextWrap(480,$YPos,50,$FontSize,number_format($Difference, + $pdf->addTextWrap(480,$YPos,50,$FontSize,locale_number_format($Difference, $myrow['decimalplaces']),'right',0,$fill); } if ($YPos < $Bottom_Margin + $line_height){ Modified: trunk/BOMIndented.php =================================================================== --- trunk/BOMIndented.php 2011-09-07 09:40:43 UTC (rev 4681) +++ trunk/BOMIndented.php 2011-09-09 03:39:04 UTC (rev 4682) @@ -208,7 +208,7 @@ $pdf->addTextWrap(180,$YPos,180,$FontSize,$myrow['description'],'',0,$fill); $pdf->addTextWrap(360,$YPos,30,$FontSize,$myrow['loccode'],'right',0,$fill); $pdf->addTextWrap(390,$YPos,25,$FontSize,$myrow['workcentreadded'],'right',0,$fill); - $pdf->addTextWrap(415,$YPos,45,$FontSize,number_format($myrow['quantity'],2),'right',0,$fill); + $pdf->addTextWrap(415,$YPos,45,$FontSize,locale_number_format($myrow['quantity'],2),'right',0,$fill); $pdf->addTextWrap(460,$YPos,55,$FontSize,$FormatedEffectiveAfter,'right',0,$fill); $pdf->addTextWrap(515,$YPos,50,$FontSize,$FormatedEffectiveTo,'right',0,$fill); Modified: trunk/BOMIndentedReverse.php =================================================================== --- trunk/BOMIndentedReverse.php 2011-09-07 09:40:43 UTC (rev 4681) +++ trunk/BOMIndentedReverse.php 2011-09-09 03:39:04 UTC (rev 4682) @@ -197,7 +197,7 @@ $pdf->addTextWrap(180,$YPos,180,$FontSize,$myrow['description'],'',0,$fill); $pdf->addTextWrap(360,$YPos,30,$FontSize,$myrow['loccode'],'right',0,$fill); $pdf->addTextWrap(390,$YPos,25,$FontSize,$myrow['workcentreadded'],'right',0,$fill); - $pdf->addTextWrap(415,$YPos,45,$FontSize,number_format($myrow['quantity'],2),'right',0,$fill); + $pdf->addTextWrap(415,$YPos,45,$FontSize,locale_number_format($myrow['quantity'],2),'right',0,$fill); $pdf->addTextWrap(460,$YPos,55,$FontSize,$FormatedEffectiveAfter,'right',0,$fill); $pdf->addTextWrap(515,$YPos,50,$FontSize,$FormatedEffectiveTo,'right',0,$fill); Modified: trunk/BOMInquiry.php =================================================================== --- trunk/BOMInquiry.php 2011-09-07 09:40:43 UTC (rev 4681) +++ trunk/BOMInquiry.php 2011-09-09 03:39:04 UTC (rev 4682) @@ -116,7 +116,7 @@ if ($myrow['mbflag']=='A' OR $myrow['mbflag']=='K'){ $StockOnHand = 'N/A'; } else { - $StockOnHand = number_format($myrow['totalonhand'],2); + $StockOnHand = locale_number_format($myrow['totalonhand'],2); } $tabindex=$j+4; printf('<td><input tabindex="' .$tabindex . '" type="submit" name="StockID" value="%s"</td> @@ -207,7 +207,7 @@ </tr>', $ComponentLink, $myrow['description'], - number_format($myrow['quantity'],$myrow['decimalplaces']), + locale_number_format($myrow['quantity'],$myrow['decimalplaces']), $myrow['standardcost'], $myrow['componentcost']); @@ -219,14 +219,14 @@ $TotalCost += $ParentLabourCost; echo '<tr> <td colspan="4" class="number"><b>' . _('Labour Cost') . '</b></td> - <td class=number><b>' . number_format($ParentLabourCost,$_SESSION['CompanyRecord']['decimalplaces']) . '</b></td></tr>'; + <td class=number><b>' . locale_number_format($ParentLabourCost,$_SESSION['CompanyRecord']['decimalplaces']) . '</b></td></tr>'; $TotalCost += $ParentOverheadCost; echo '<tr><td colspan="4" class="number"><b>' . _('Overhead Cost') . '</b></td> - <td class=number><b>' . number_format($ParentOverheadCost,$_SESSION['CompanyRecord']['decimalplaces']) . '</b></td></tr>'; + <td class=number><b>' . locale_number_format($ParentOverheadCost,$_SESSION['CompanyRecord']['decimalplaces']) . '</b></td></tr>'; echo '<tr> <td colspan=4 class=number><b>' . _('Total Cost') . '</b></td> - <td class=number><b>' . number_format($TotalCost,$_SESSION['CompanyRecord']['decimalplaces']) . '</b></td> + <td class=number><b>' . locale_number_format($TotalCost,$_SESSION['CompanyRecord']['decimalplaces']) . '</b></td> </tr>'; echo '</table>'; Modified: trunk/BOMListing.php =================================================================== --- trunk/BOMListing.php 2011-09-07 09:40:43 UTC (rev 4681) +++ trunk/BOMListing.php 2011-09-09 03:39:04 UTC (rev 4682) @@ -83,7 +83,7 @@ $LeftOvers = $pdf->addTextWrap($Left_Margin+5,$YPos,80,$FontSize,$BOMList['component'],'left'); $LeftOvers = $pdf->addTextWrap(110,$YPos,200,$FontSize,$BOMList['compdescription'],'left'); - $DisplayQuantity = number_format($BOMList['quantity'],$BOMList['decimalplaces']); + $DisplayQuantity = locale_number_format($BOMList['quantity'],$BOMList['decimalplaces']); $LeftOvers = $pdf->addTextWrap(320,$YPos,50,$FontSize,ConvertSQLDate($BOMList['eff_frm']),'left'); $LeftOvers = $pdf->addTextWrap(370,$YPos,50,$FontSize,ConvertSQLDate($BOMList['eff_to']),'left'); $LeftOvers = $pdf->addTextWrap(420,$YPos,20,$FontSize,$BOMList['loccode'],'left'); Modified: trunk/BOMs.php =================================================================== --- trunk/BOMs.php 2011-09-07 09:40:43 UTC (rev 4681) +++ trunk/BOMs.php 2011-09-09 03:39:04 UTC (rev 4682) @@ -129,7 +129,7 @@ if ($myrow[7]=='D' OR $myrow[7]=='K' OR $myrow[7]=='A' OR $myrow[7]=='G'){ $QuantityOnHand = _('N/A'); } else { - $QuantityOnHand = number_format($myrow[10],$myrow[11]); + $QuantityOnHand = locale_number_format($myrow[10],$myrow[11]); } printf('<td>%s</td> <td>%s</td> @@ -834,7 +834,7 @@ if ($myrow['mbflag']=='A' OR $myrow['mbflag']=='K' OR $myrow['mbflag']=='G'){ $StockOnHand = _('N/A'); } else { - $StockOnHand = number_format($myrow['totalonhand'],2); + $StockOnHand = locale_number_format($myrow['totalonhand'],2); } $tab = $j+3; printf('<td><input tabindex="' . $tab . '" type="submit" name="Select" value="%s"</td> Modified: trunk/BankMatching.php =================================================================== --- trunk/BankMatching.php 2011-09-07 09:40:43 UTC (rev 4681) +++ trunk/BankMatching.php 2011-09-09 03:39:04 UTC (rev 4682) @@ -257,8 +257,8 @@ $myrow['ref'], $myrow['banktranstype'], $DisplayTranDate, - number_format($myrow['amt'],2), - number_format($Outstanding,2), + locale_number_format($myrow['amt'],2), + locale_number_format($Outstanding,2), _('Unclear'), $i, $i, @@ -283,8 +283,8 @@ $myrow['ref'], $myrow['banktranstype'], $DisplayTranDate, - number_format($myrow['amt'],2), - number_format($Outstanding,2), + locale_number_format($myrow['amt'],2), + locale_number_format($Outstanding,2), $i, $i, $myrow['banktransid'], Modified: trunk/BankReconciliation.php =================================================================== --- trunk/BankReconciliation.php 2011-09-07 09:40:43 UTC (rev 4681) +++ trunk/BankReconciliation.php 2011-09-09 03:39:04 UTC (rev 4682) @@ -86,7 +86,7 @@ $result = DB_query($SQL,$db,$ErrMsg,$DbgMsg,true); $result = DB_Txn_Commit($db); - prnMsg(_('Exchange difference of') . ' ' . number_format($ExchangeDifference,2) . ' ' . _('has been posted'),'success'); + prnMsg(_('Exchange difference of') . ' ' . locale_number_format($ExchangeDifference,2) . ' ' . _('has been posted'),'success'); } //end if the bank statement balance was numeric } @@ -171,7 +171,7 @@ echo ' (' . $BankCurrCode . ' @ ' . $ExRate .')'; } echo '</b></td> - <td valign=bottom class="number"><b>' . number_format($Balance*$ExRate,$CurrDecimalPlaces) . '</b></td></tr>'; + <td valign=bottom class="number"><b>' . locale_number_format($Balance*$ExRate,$CurrDecimalPlaces) . '</b></td></tr>'; $SQL = "SELECT amount/exrate AS amt, amountcleared, @@ -229,8 +229,8 @@ $myrow['typename'], $myrow['transno'], $myrow['ref'], - number_format($myrow['amt'],$CurrDecimalPlaces), - number_format($myrow['outstanding'],$CurrDecimalPlaces)); + locale_number_format($myrow['amt'],$CurrDecimalPlaces), + locale_number_format($myrow['outstanding'],$CurrDecimalPlaces)); $TotalUnpresentedCheques +=$myrow['outstanding']; @@ -242,7 +242,7 @@ } //end of while loop echo '<tr></tr> - <tr class=EvenTableRows><td colspan=6>' . _('Total of all unpresented cheques') . '</td><td class="number">' . number_format($TotalUnpresentedCheques,$CurrDecimalPlaces) . '</td></tr>'; + <tr class=EvenTableRows><td colspan=6>' . _('Total of all unpresented cheques') . '</td><td class="number">' . locale_number_format($TotalUnpresentedCheques,$CurrDecimalPlaces) . '</td></tr>'; $SQL = "SELECT amount/exrate AS amt, amountcleared, @@ -301,8 +301,8 @@ $myrow['typename'], $myrow['transno'], $myrow['ref'], - number_format($myrow['amt'],$CurrDecimalPlaces), - number_format($myrow['outstanding'],$CurrDecimalPlaces) ); + locale_number_format($myrow['amt'],$CurrDecimalPlaces), + locale_number_format($myrow['outstanding'],$CurrDecimalPlaces) ); $TotalUnclearedDeposits +=$myrow['outstanding']; @@ -316,13 +316,13 @@ echo '<tr></tr> <tr class=EvenTableRows> <td colspan=6>' . _('Total of all uncleared deposits') . '</td> - <td class=number>' . number_format($TotalUnclearedDeposits,$CurrDecimalPlaces) . '</td> + <td class=number>' . locale_number_format($TotalUnclearedDeposits,$CurrDecimalPlaces) . '</td> </tr>'; $FXStatementBalance = ($Balance*$ExRate) - $TotalUnpresentedCheques -$TotalUnclearedDeposits; echo '<tr></tr> <tr class=EvenTableRows> <td colspan=6><b>' . _('Bank statement balance should be') . ' (' . $BankCurrCode . ')</b></td> - <td class=number>' . number_format($FXStatementBalance,$CurrDecimalPlaces) . '</td></tr>'; + <td class=number>' . locale_number_format($FXStatementBalance,$CurrDecimalPlaces) . '</td></tr>'; if (isset($_POST['DoExchangeDifference'])){ echo '<input type="hidden" name="DoExchangeDifference" value=' . $FXStatementBalance . '>'; Modified: trunk/ConfirmDispatchControlled_Invoice.php =================================================================== --- trunk/ConfirmDispatchControlled_Invoice.php 2011-09-07 09:40:43 UTC (rev 4681) +++ trunk/ConfirmDispatchControlled_Invoice.php 2011-09-09 03:39:04 UTC (rev 4682) @@ -55,7 +55,7 @@ echo '<br /><a href="'. $rootpath. '/ConfirmDispatch_Invoice.php">'. _('Back to Confirmation of Dispatch') . '/' . _('Invoice'). '</a>'; -echo '<br /><font size=2><b>'. _('Dispatch of up to').' '. number_format($LineItem->Quantity-$LineItem->QtyInv, $LineItem->DecimalPlaces). ' '. _('Controlled items').' ' . $LineItem->StockID . ' - ' . $LineItem->ItemDescription . ' '. _('on order').' ' . $_SESSION['Items']->OrderNo . ' '. _('to'). ' ' . $_SESSION['Items']->CustomerName . '</b></font></div>'; +echo '<br /><font size=2><b>'. _('Dispatch of up to').' '. locale_number_format($LineItem->Quantity-$LineItem->QtyInv, $LineItem->DecimalPlaces). ' '. _('Controlled items').' ' . $LineItem->StockID . ' - ' . $LineItem->ItemDescription . ' '. _('on order').' ' . $_SESSION['Items']->OrderNo . ' '. _('to'). ' ' . $_SESSION['Items']->CustomerName . '</b></font></div>'; /** vars needed by InputSerialItem : **/ $StockID = $LineItem->StockID; Modified: trunk/ConfirmDispatch_Invoice.php =================================================================== --- trunk/ConfirmDispatch_Invoice.php 2011-09-07 09:40:43 UTC (rev 4681) +++ trunk/ConfirmDispatch_Invoice.php 2011-09-09 03:39:04 UTC (rev 4682) @@ -304,9 +304,9 @@ echo '<td>'.$LnItm->StockID.'</td> <td>'.$LnItm->ItemDescription.'</td> - <td class="number">' . number_format($LnItm->Quantity,$LnItm->DecimalPlaces) . '</td> + <td class="number">' . locale_number_format($LnItm->Quantity,$LnItm->DecimalPlaces) . '</td> <td>'.$LnItm->Units.'</td> - <td class="number">' . number_format($LnItm->QtyInv,$LnItm->DecimalPlaces) . '</td>'; + <td class="number">' . locale_number_format($LnItm->QtyInv,$LnItm->DecimalPlaces) . '</td>'; if ($LnItm->Controlled==1){ @@ -322,9 +322,9 @@ echo '<td class="number"><input tabindex="'.$j.'" type="text" class="number" name="' . $LnItm->LineNumber . '_QtyDispatched" maxlength=12 size=12 value="' . $LnItm->QtyDispatched . '"></td>'; } } - $DisplayDiscountPercent = number_format($LnItm->DiscountPercent*100,2) . '%'; - $DisplayLineNetTotal = number_format($LineTotal,$_SESSION['Items']->CurrDecimalPlaces); - $DisplayPrice = number_format($LnItm->Price,$_SESSION['Items']->CurrDecimalPlaces); + $DisplayDiscountPercent = locale_number_format($LnItm->DiscountPercent*100,2) . '%'; + $DisplayLineNetTotal = locale_number_format($LineTotal,$_SESSION['Items']->CurrDecimalPlaces); + $DisplayPrice = locale_number_format($LnItm->Price,$_SESSION['Items']->CurrDecimalPlaces); echo '<td class="number">'.$DisplayPrice.'</td> <td class="number">'.$DisplayDiscountPercent.'</td> <td class="number">'.$DisplayLineNetTotal.'</td>'; @@ -373,9 +373,9 @@ $TaxTotal += $TaxLineTotal; - $DisplayTaxAmount = number_format($TaxLineTotal ,$_SESSION['Items']->CurrDecimalPlaces); + $DisplayTaxAmount = locale_number_format($TaxLineTotal ,$_SESSION['Items']->CurrDecimalPlaces); - $DisplayGrossLineTotal = number_format($LineTotal+ $TaxLineTotal,$_SESSION['Items']->CurrDecimalPlaces); + $DisplayGrossLineTotal = locale_number_format($LineTotal+ $TaxLineTotal,$_SESSION['Items']->CurrDecimalPlaces); echo '<td class="number">'.$DisplayTaxAmount.'</td><td class="number">'.$DisplayGrossLineTotal.'</td>'; @@ -511,13 +511,13 @@ } echo '</td>'; -echo '<td class="number">' . number_format($FreightTaxTotal,$_SESSION['Items']->CurrDecimalPlaces) . '</td> - <td class="number">' . number_format($FreightTaxTotal+ $_POST['ChargeFreightCost'],$_SESSION['Items']->CurrDecimalPlaces) . '</td> +echo '<td class="number">' . locale_number_format($FreightTaxTotal,$_SESSION['Items']->CurrDecimalPlaces) . '</td> + <td class="number">' . locale_number_format($FreightTaxTotal+ $_POST['ChargeFreightCost'],$_SESSION['Items']->CurrDecimalPlaces) . '</td> </tr>'; $TaxTotal += $FreightTaxTotal; -$DisplaySubTotal = number_format(($_SESSION['Items']->total + $_POST['ChargeFreightCost']),$_SESSION['Items']->CurrDecimalPlaces); +$DisplaySubTotal = locale_number_format(($_SESSION['Items']->total + $_POST['ChargeFreightCost']),$_SESSION['Items']->CurrDecimalPlaces); /* round the totals to avoid silly entries */ @@ -529,8 +529,8 @@ <td colspan="10" class="number">' . _('Invoice Totals'). '</td> <td class="number:><hr><b>'.$DisplaySubTotal.'</b><hr></td> <td colspan="2"></td> - <td class="number"><hr><b>' . number_format($TaxTotal,$_SESSION['Items']->CurrDecimalPlaces) . '</b><hr></td> - <td class="number"><hr><b>' . number_format($TaxTotal+($_SESSION['Items']->total + $_POST['ChargeFreightCost']),$_SESSION['Items']->CurrDecimalPlaces) . '</b><hr></td> + <td class="number"><hr><b>' . locale_number_format($TaxTotal,$_SESSION['Items']->CurrDecimalPlaces) . '</b><hr></td> + <td class="number"><hr><b>' . locale_number_format($TaxTotal+($_SESSION['Items']->total + $_POST['ChargeFreightCost']),$_SESSION['Items']->CurrDecimalPlaces) . '</b><hr></td> </tr>'; if (! isset($_POST['DispatchDate']) OR ! Is_Date($_POST['DispatchDate'])){ Modified: trunk/ContractBOM.php =================================================================== --- trunk/ContractBOM.php 2011-09-07 09:40:43 UTC (rev 4681) +++ trunk/ContractBOM.php 2011-09-09 03:39:04 UTC (rev 4682) @@ -247,7 +247,7 @@ $LineTotal = $ContractComponent->Quantity * $ContractComponent->ItemCost; - $DisplayLineTotal = number_format($LineTotal,2); + $DisplayLineTotal = locale_number_format($LineTotal,2); if ($k==1){ echo '<tr class="EvenTableRows">'; @@ -267,7 +267,7 @@ $TotalCost += $LineTotal; } - $DisplayTotal = number_format($TotalCost,2); + $DisplayTotal = locale_number_format($TotalCost,2); echo '<tr> <td colspan="6" class="number">' . _('Total Cost') . '</td> <td class="number"><b>' . $DisplayTotal . '</b></td> Modified: trunk/ContractCosting.php =================================================================== --- trunk/ContractCosting.php 2011-09-07 09:40:43 UTC (rev 4681) +++ trunk/ContractCosting.php 2011-09-09 03:39:04 UTC (rev 4682) @@ -94,8 +94,8 @@ <td>' . $Component->I... [truncated message content] |
From: <dai...@us...> - 2011-09-10 04:39:26
|
Revision: 4683 http://web-erp.svn.sourceforge.net/web-erp/?rev=4683&view=rev Author: daintree Date: 2011-09-10 04:39:18 +0000 (Sat, 10 Sep 2011) Log Message: ----------- number formatting Modified Paths: -------------- trunk/DeliveryDetails.php trunk/SelectOrderItems.php trunk/includes/DefineCartClass.php trunk/includes/LanguageSetup.php trunk/includes/MiscFunctions.php Modified: trunk/DeliveryDetails.php =================================================================== --- trunk/DeliveryDetails.php 2011-09-09 03:39:04 UTC (rev 4682) +++ trunk/DeliveryDetails.php 2011-09-10 04:39:18 UTC (rev 4683) @@ -358,7 +358,7 @@ '". DB_escape_string($_SESSION['Items'.$identifier]->Comments) ."', '" . Date('Y-m-d H:i') . "', '" . $_SESSION['Items'.$identifier]->DefaultSalesType . "', - '" . $_POST['ShipVia'] ."', + '" . DB_escape_string($_POST['ShipVia']) ."', '". DB_escape_string($_SESSION['Items'.$identifier]->DeliverTo) . "', '" . DB_escape_string($_SESSION['Items'.$identifier]->BuyerName) . "', '" . DB_escape_string($_SESSION['Items'.$identifier]->DelAdd1) . "', @@ -367,9 +367,9 @@ '" . DB_escape_string($_SESSION['Items'.$identifier]->DelAdd4) . "', '" . DB_escape_string($_SESSION['Items'.$identifier]->DelAdd5) . "', '" . DB_escape_string($_SESSION['Items'.$identifier]->DelAdd6) . "', - '" . $_SESSION['Items'.$identifier]->PhoneNo . "', - '" . $_SESSION['Items'.$identifier]->Email . "', - '" . $_SESSION['Items'.$identifier]->FreightCost ."', + '" . DB_escape_string($_SESSION['Items'.$identifier]->PhoneNo) . "', + '" . DB_escape_string($_SESSION['Items'.$identifier]->Email) . "', + '" . filter_number_format($_SESSION['Items'.$identifier]->FreightCost) ."', '" . $_SESSION['Items'.$identifier]->Location ."', '" . $DelDate . "', '" . $QuotDate . "', @@ -400,9 +400,9 @@ '" . $StockItem->LineNumber . "', '" . $OrderNo . "', '" . $StockItem->StockID . "', - '" . $StockItem->Price . "', - '" . $StockItem->Quantity . "', - '" . floatval($StockItem->DiscountPercent) . "', + '" . filter_number_format($StockItem->Price) . "', + '" . filter_number_format($StockItem->Quantity) . "', + '" . filter_number_format(floatval($StockItem->DiscountPercent)) . "', '" . DB_escape_string($StockItem->Narrative) . "', '" . $StockItem->POLine . "', '" . FormatDateForSQL($StockItem->ItemDue) . "' @@ -511,8 +511,8 @@ stdcost) VALUES ( '" . $WONo . "', '" . $StockItem->StockID . "', - '" . $WOQuantity . "', - '" . $Cost . "')"; + '" . filter_number_format($WOQuantity) . "', + '" . filter_number_format($Cost) . "')"; $ErrMsg = _('The work order item could not be added'); $result = DB_query($sql,$db,$ErrMsg,$DbgMsg,true); @@ -699,7 +699,7 @@ VALUES ( '" . $WONo . "', '" . $ContractRow['contractref'] . "', '1', - '" . $Cost . "')"; + '" . filter_number_format($Cost) . "')"; $ErrMsg = _('The work order item could not be added'); $result = DB_query($sql,$db,$ErrMsg,$DbgMsg,true); @@ -727,9 +727,9 @@ deladd4 = '" . DB_escape_string($_SESSION['Items'.$identifier]->DelAdd4) . "', deladd5 = '" . DB_escape_string($_SESSION['Items'.$identifier]->DelAdd5) . "', deladd6 = '" . DB_escape_string($_SESSION['Items'.$identifier]->DelAdd6) . "', - contactphone = '" . $_SESSION['Items'.$identifier]->PhoneNo . "', - contactemail = '" . $_SESSION['Items'.$identifier]->Email . "', - freightcost = '" . $_SESSION['Items'.$identifier]->FreightCost ."', + contactphone = '" . DB_escape_string($_SESSION['Items'.$identifier]->PhoneNo) . "', + contactemail = '" . DB_escape_string($_SESSION['Items'.$identifier]->Email) . "', + freightcost = '" . filter_number_format($_SESSION['Items'.$identifier]->FreightCost) ."', fromstkloc = '" . $_SESSION['Items'.$identifier]->Location ."', printedpackingslip = '" . $_POST['ReprintPackingSlip'] . "', quotation = '" . $_SESSION['Items'.$identifier]->Quotation . "', @@ -751,9 +751,9 @@ $Completed = 0; } - $LineItemsSQL = "UPDATE salesorderdetails SET unitprice='" . $StockItem->Price . "', - quantity='" . $StockItem->Quantity . "', - discountpercent='" . floatval($StockItem->DiscountPercent) . "', + $LineItemsSQL = "UPDATE salesorderdetails SET unitprice='" . filter_number_format($StockItem->Price) . "', + quantity='" . filter_number_format($StockItem->Quantity) . "', + discountpercent='" . filter_number_format(floatval($StockItem->DiscountPercent)) . "', completed='" . $Completed . "', poline='" . $StockItem->POLine . "', itemdue='" . FormatDateForSQL($StockItem->ItemDue) . "' @@ -837,8 +837,8 @@ foreach ($_SESSION['Items'.$identifier]->LineItems as $StockItem) { $LineTotal = $StockItem->Quantity * $StockItem->Price * (1 - $StockItem->DiscountPercent); - $DisplayLineTotal = locale_number_format($LineTotal,$_SESSION['Items'.$identifier]->CurrDecimalPlaces); - $DisplayPrice = locale_number_format($StockItem->Price,$_SESSION['Items'.$identifier]->CurrDecimalPlaces); + $DisplayLineTotal = locale_money_format($LineTotal,$_SESSION['Items'.$identifier]->CurrDecimalPlaces); + $DisplayPrice = locale_money_format($StockItem->Price,$_SESSION['Items'.$identifier]->CurrDecimalPlaces); $DisplayQuantity = locale_number_format($StockItem->Quantity,$StockItem->DecimalPlaces); $DisplayDiscount = locale_number_format(($StockItem->DiscountPercent * 100),2); @@ -865,7 +865,7 @@ $_SESSION['Items'.$identifier]->totalWeight = $_SESSION['Items'.$identifier]->totalWeight + ($StockItem->Quantity * $StockItem->Weight); } - $DisplayTotal = locale_number_format($_SESSION['Items'.$identifier]->total,2); + $DisplayTotal = locale_money_format($_SESSION['Items'.$identifier]->total,2); echo '<tr class="EvenTableRows"> <td colspan=6 class=number><b>'. _('TOTAL Excl Tax/Freight') .'</b></td> <td class=number>'.$DisplayTotal.'</td> @@ -901,8 +901,8 @@ foreach ($_SESSION['Items'.$identifier]->LineItems as $StockItem) { $LineTotal = $StockItem->Quantity * $StockItem->Price * (1 - $StockItem->DiscountPercent); - $DisplayLineTotal = locale_number_format($LineTotal,$_SESSION['Items'.$identifier]->CurrDecimalPlaces); - $DisplayPrice = locale_number_format($StockItem->Price,$_SESSION['Items'.$identifier]->CurrDecimalPlaces); + $DisplayLineTotal = locale_money_format($LineTotal,$_SESSION['Items'.$identifier]->CurrDecimalPlaces); + $DisplayPrice = locale_money_format($StockItem->Price,$_SESSION['Items'.$identifier]->CurrDecimalPlaces); $DisplayQuantity = locale_number_format($StockItem->Quantity,$StockItem->DecimalPlaces); if ($k==1){ @@ -925,7 +925,7 @@ } - $DisplayTotal = locale_number_format($_SESSION['Items'.$identifier]->total,$_SESSION['Items'.$identifier]->CurrDecimalPlaces); + $DisplayTotal = locale_money_format($_SESSION['Items'.$identifier]->total,$_SESSION['Items'.$identifier]->CurrDecimalPlaces); echo '<table class="selection"> <tr> <td>'. _('Total Weight') .':</td> Modified: trunk/SelectOrderItems.php =================================================================== --- trunk/SelectOrderItems.php 2011-09-09 03:39:04 UTC (rev 4682) +++ trunk/SelectOrderItems.php 2011-09-10 04:39:18 UTC (rev 4683) @@ -25,13 +25,13 @@ if (isset($_POST['SelectingOrderItems'])){ foreach ($_POST as $FormVariable => $Quantity) { if (mb_strpos($FormVariable,'OrderQty')!==false) { - $NewItem_array[$_POST['StockID' . mb_substr($FormVariable,8)]] = trim($Quantity); + $NewItem_array[$_POST['StockID' . mb_substr($FormVariable,8)]] = filter_number_format(trim($Quantity)); } } } if (isset($_GET['NewItem'])){ - $NewItem = trim($_GET['NewItem']); + $NewItem = filter_number_format(trim($_GET['NewItem'])); } @@ -124,7 +124,7 @@ ON locations.loccode=salesorders.fromstkloc INNER JOIN currencies ON debtorsmaster.currcode=currencies.currabrev - WHERE salesorders.orderno = '" . $_GET['ModifyOrderNumber'] . "'"; + WHERE salesorders.orderno = '" . filter_number_format($_GET['ModifyOrderNumber']) . "'"; $ErrMsg = _('The order cannot be retrieved because'); $GetOrdHdrResult = DB_query($OrderHeaderSQL,$db,$ErrMsg); @@ -294,80 +294,34 @@ //Customer logins are not allowed to select other customers henc in_array(2,$_SESSION['AllowedPageSecurityTokens']) if (isset($_POST['SearchCust']) AND $_SESSION['RequireCustomerSelection']==1 AND in_array(2,$_SESSION['AllowedPageSecurityTokens'])){ - if (($_POST['CustKeywords']!='') AND (($_POST['CustCode']!='') OR ($_POST['CustPhone']!=''))) { - prnMsg( _('Customer Branch Name keywords have been used in preference to the Customer Branch Code or Branch Phone Number entered'), 'warn'); - } - if (($_POST['CustCode']!='') AND ($_POST['CustPhone']!='')) { - prnMsg(_('Customer Branch Code has been used in preference to the Customer Branch Phone Number entered'), 'warn'); - } if (($_POST['CustKeywords']=='') AND ($_POST['CustCode']=='') AND ($_POST['CustPhone']=='')) { prnMsg(_('At least one Customer Branch Name keyword OR an extract of a Customer Branch Code or Branch Phone Number must be entered for the search'), 'warn'); } else { - if (mb_strlen($_POST['CustKeywords'])>0) { //insert wildcard characters in spaces - $_POST['CustKeywords'] = mb_strtoupper(trim($_POST['CustKeywords'])); - $SearchString = '%' . str_replace(' ', '%', $_POST['CustKeywords']) . '%'; + $_POST['CustKeywords'] = mb_strtoupper(trim($_POST['CustKeywords'])); + $SearchString = str_replace(' ', '%', $_POST['CustKeywords']) ; + + $SQL = "SELECT custbranch.brname, + custbranch.contactname, + custbranch.phoneno, + custbranch.faxno, + custbranch.branchcode, + custbranch.debtorno, + debtorsmaster.name + FROM custbranch + LEFT JOIN debtorsmaster + ON custbranch.debtorno=debtorsmaster.debtorno + WHERE custbranch.brname " . LIKE . " '%" . $SearchString . "%' + AND custbranch.debtorno " . LIKE . " '%" . mb_strtoupper(trim($_POST['CustCode'])) . "%' + AND custbranch.branchcode " . LIKE . " '%" . mb_strtoupper(trim($_POST['CustCode'])) . "%' + AND custbranch.phoneno " . LIKE . " '%" . trim($_POST['CustPhone']) . "%'"; - $SQL = "SELECT custbranch.brname, - custbranch.contactname, - custbranch.phoneno, - custbranch.faxno, - custbranch.branchcode, - custbranch.debtorno, - debtorsmaster.name - FROM custbranch - LEFT JOIN debtorsmaster - ON custbranch.debtorno=debtorsmaster.debtorno - WHERE custbranch.brname " . LIKE . " '$SearchString'"; - if ($_SESSION['SalesmanLogin']!=''){ $SQL .= " AND custbranch.salesman='" . $_SESSION['SalesmanLogin'] . "'"; } $SQL .= " AND custbranch.disabletrans=0 ORDER BY custbranch.debtorno, custbranch.branchcode"; - } elseif (mb_strlen($_POST['CustCode'])>0){ - - $_POST['CustCode'] = mb_strtoupper(trim($_POST['CustCode'])); - - $SQL = "SELECT custbranch.brname, - custbranch.contactname, - custbranch.phoneno, - custbranch.faxno, - custbranch.branchcode, - custbranch.debtorno, - debtorsmaster.name - FROM custbranch - LEFT JOIN debtorsmaster - ON custbranch.debtorno=debtorsmaster.debtorno - WHERE custbranch.debtorno " . LIKE . " '%" . $_POST['CustCode'] . "%' OR custbranch.branchcode " . LIKE . " '%" . $_POST['CustCode'] . "%'"; - - if ($_SESSION['SalesmanLogin']!=''){ - $SQL .= " AND custbranch.salesman='" . $_SESSION['SalesmanLogin'] . "'"; - } - $SQL .= " AND custbranch.disabletrans=0 - ORDER BY custbranch.debtorno"; - } elseif (mb_strlen($_POST['CustPhone'])>0){ - $SQL = "SELECT custbranch.brname, - custbranch.contactname, - custbranch.phoneno, - custbranch.faxno, - custbranch.branchcode, - custbranch.debtorno, - debtorsmaster.name - FROM custbranch - INNER JOIN debtorsmaster - ON custbranch.debtorno=debtorsmaster.debtorno - WHERE custbranch.phoneno " . LIKE . " '%" . $_POST['CustPhone'] . "%'"; - - if ($_SESSION['SalesmanLogin']!=''){ - $SQL .= " AND custbranch.salesman='" . $_SESSION['SalesmanLogin'] . "'"; - } - - $SQL .= " AND custbranch.disabletrans=0 - ORDER BY custbranch.debtorno"; - } - $ErrMsg = _('The searched customer records requested cannot be retrieved because'); $result_CustSelect = DB_query($SQL,$db,$ErrMsg); @@ -399,7 +353,7 @@ record returned from a search so parse the $SelectCustomer string into customer code and branch code */ if (isset($SelectedCustomer)) { - $_SESSION['Items'.$identifier]->DebtorNo = trim($SelectedCustomer); + $_SESSION['Items'.$identifier]->DebtorNo = trim($SelectedCustomer); $_SESSION['Items'.$identifier]->Branch = trim($SelectedBranch); // Now check to ensure this account is not on hold */ @@ -922,7 +876,7 @@ $NewItem = mb_strtoupper($_POST[$QuickEntryCode]); } if (isset($_POST[$QuickEntryQty])) { - $NewItemQty = $_POST[$QuickEntryQty]; + $NewItemQty = filter_number_format($_POST[$QuickEntryQty]); } if (isset($_POST[$QuickEntryItemDue])) { $NewItemDue = $_POST[$QuickEntryItemDue]; @@ -941,7 +895,7 @@ } if(!Is_Date($NewItemDue)) { - prnMsg(_('An invalid date entry was made for ') . ' ' . $NewItem . ' ' . _('The date entry') . ' ' . $NewItemDue . ' ' . _('must be in the format') . ' ' . $_SESSION['DefaultDateFormat'],'warn'); + prnMsg(_('An invalid date entry was made for ') . ' ' . $NewItem . ' ' . _('The date entry') . ' ' . $NewItemDue . ' ' . _('must be in the format') . ' ' . $_SESSION['DefaultDateFormat'],'warn'); //Attempt to default the due date to something sensible? $NewItemDue = DateAdd (Date($_SESSION['DefaultDateFormat']),'d', $_SESSION['Items'.$identifier]->DeliveryDays); } @@ -1054,8 +1008,8 @@ taxcatid, materialcost) VALUES ('" . $AssetStockID . "', - '" . $AssetRow['description'] . "', - '" . $AssetRow['longdescription'] . "', + '" . DB_escape_string($AssetRow['description']) . "', + '" . DB_escape_string($AssetRow['longdescription']) . "', 'ASSETS', 'D', '0', @@ -1099,18 +1053,18 @@ if (isset($_POST['Quantity_' . $OrderLine->LineNumber])){ - $Quantity = $_POST['Quantity_' . $OrderLine->LineNumber]; + $Quantity = filter_number_format($_POST['Quantity_' . $OrderLine->LineNumber]); if (ABS($OrderLine->Price - $_POST['Price_' . $OrderLine->LineNumber])>0.01){ - $Price = $_POST['Price_' . $OrderLine->LineNumber]; - $_POST['GPPercent_' . $OrderLine->LineNumber] = (($Price*(1-($_POST['Discount_' . $OrderLine->LineNumber]/100))) - $OrderLine->StandardCost*$ExRate)/($Price *(1-$_POST['Discount_' . $OrderLine->LineNumber])/100); - } elseif (ABS($OrderLine->GPPercent - $_POST['GPPercent_' . $OrderLine->LineNumber])>=0.001) { + $Price = filter_number_format($_POST['Price_' . $OrderLine->LineNumber]); + $_POST['GPPercent_' . $OrderLine->LineNumber] = (($Price*(1-(filter_number_format($_POST['Discount_' . $OrderLine->LineNumber])/100))) - $OrderLine->StandardCost*$ExRate)/($Price *(1-filter_number_format($_POST['Discount_' . $OrderLine->LineNumber]))/100); + } elseif (ABS($OrderLine->GPPercent - filter_number_format($_POST['GPPercent_' . $OrderLine->LineNumber]))>=0.001) { //then do a recalculation of the price at this new GP Percentage - $Price = ($OrderLine->StandardCost*$ExRate)/(1 -(($_POST['GPPercent_' . $OrderLine->LineNumber] + $_POST['Discount_' . $OrderLine->LineNumber])/100)); + $Price = ($OrderLine->StandardCost*$ExRate)/(1 -((filter_number_format($_POST['GPPercent_' . $OrderLine->LineNumber]) + filter_number_format($_POST['Discount_' . $OrderLine->LineNumber]))/100)); } else { - $Price = $_POST['Price_' . $OrderLine->LineNumber]; + $Price = filter_number_format($_POST['Price_' . $OrderLine->LineNumber]); } - $DiscountPercentage = $_POST['Discount_' . $OrderLine->LineNumber]; + $DiscountPercentage = filter_number_format($_POST['Discount_' . $OrderLine->LineNumber]); if ($_SESSION['AllowOrderLineItemNarrative'] == 1) { $Narrative = $_POST['Narrative_' . $OrderLine->LineNumber]; } else { @@ -1171,7 +1125,7 @@ 'Yes', /*Update DB */ $_POST['ItemDue_' . $OrderLine->LineNumber], $_POST['POLine_' . $OrderLine->LineNumber], - $_POST['GPPercent_' . $OrderLine->LineNumber]); + filter_number_format($_POST['GPPercent_' . $OrderLine->LineNumber])); } //within credit limit so make changes } //there are changes to the order line to process } //page not called from itself - POST variables not set @@ -1382,7 +1336,7 @@ foreach ($_SESSION['Items'.$identifier]->LineItems as $OrderLine) { $LineTotal = $OrderLine->Quantity * $OrderLine->Price * (1 - $OrderLine->DiscountPercent); - $DisplayLineTotal = locale_number_format($LineTotal,$_SESSION['Items'.$identifier]->CurrDecimalPlaces); + $DisplayLineTotal = locale_money_format($LineTotal,$_SESSION['Items'.$identifier]->CurrDecimalPlaces); $DisplayDiscount = locale_number_format(($OrderLine->DiscountPercent * 100),2); $QtyOrdered = $OrderLine->Quantity; $QtyRemain = $QtyOrdered - $OrderLine->QtyInv; @@ -1454,7 +1408,7 @@ } /* end of loop around items */ - $DisplayTotal = locale_number_format($_SESSION['Items'.$identifier]->total,$_SESSION['Items'.$identifier]->CurrDecimalPlaces); + $DisplayTotal = locale_money_format($_SESSION['Items'.$identifier]->total,$_SESSION['Items'.$identifier]->CurrDecimalPlaces); if (in_array(2,$_SESSION['AllowedPageSecurityTokens'])){ $ColSpanNumber = 2; } else { Modified: trunk/includes/DefineCartClass.php =================================================================== --- trunk/includes/DefineCartClass.php 2011-09-09 03:39:04 UTC (rev 4682) +++ trunk/includes/DefineCartClass.php 2011-09-10 04:39:18 UTC (rev 4683) @@ -159,9 +159,9 @@ VALUES(" . $this->LineCounter . ", " . $_SESSION['ExistingOrder'] . ", '" . trim(mb_strtoupper($StockID)) ."', - " . $Qty . ", - " . $Price . ", - " . $Disc . ",' + " . filter_number_format($Qty) . ", + " . filter_number_format($Price) . ", + " . filter_number_format($Disc) . ",' " . $ItemDue . "', " . $POLine . ")"; $result = DB_query($sql, @@ -196,9 +196,9 @@ $this->LineItems[$UpdateLineNumber]->GPPercent = $GPPercent; if ($UpdateDB=='Yes'){ global $db; - $result = DB_query("UPDATE salesorderdetails SET quantity=" . $Qty . ", - unitprice=" . $Price . ", - discountpercent=" . $Disc . ", + $result = DB_query("UPDATE salesorderdetails SET quantity=" . filter_number_format($Qty) . ", + unitprice=" . filter_number_format($Price) . ", + discountpercent=" . filter_number_format($Disc) . ", narrative ='" . DB_escape_string($Narrative) . "', itemdue = '" . FormatDateForSQL($ItemDue) . "', poline = '" . DB_escape_string($POLine) . "' Modified: trunk/includes/LanguageSetup.php =================================================================== --- trunk/includes/LanguageSetup.php 2011-09-09 03:39:04 UTC (rev 4682) +++ trunk/includes/LanguageSetup.php 2011-09-10 04:39:18 UTC (rev 4683) @@ -24,22 +24,21 @@ $Language = $_SESSION['Language']; } +$Locale = setlocale (LC_ALL, $_SESSION['Language']); +$LocaleInfo = localeconv(); +if (defined('LC_MESSAGES')){ + $Locale = setlocale (LC_MESSAGES, $_SESSION['Language']); +} +//Turkish seems to be a special case +if ($_SESSION['Language']=='tr_TR.utf8') { + $Locale = setlocale(LC_CTYPE, 'C'); +} + +//$Locale = setlocale (LC_NUMERIC, 'en_US'); //currently need decimal points to be '.' + if (function_exists('gettext')){ - $Locale = setlocale (LC_ALL, $_SESSION['Language']); - $LocaleInfo = localeconv(); - if (defined('LC_MESSAGES')){ - $Locale = setlocale (LC_MESSAGES, $_SESSION['Language']); - } - - //Turkish seems to be a special case - if ($_SESSION['Language']=='tr_TR.utf8') { - $Locale = setlocale(LC_CTYPE, 'C'); - } - - //$Locale = setlocale (LC_NUMERIC, 'en_US'); //currently need decimal points to be '.' - // possibly even if locale fails the language will still switch by using Language instead of locale variable putenv('LANG=' . $_SESSION['Language']); putenv('LANGUAGE=' . $_SESSION['Language']); Modified: trunk/includes/MiscFunctions.php =================================================================== --- trunk/includes/MiscFunctions.php 2011-09-09 03:39:04 UTC (rev 4682) +++ trunk/includes/MiscFunctions.php 2011-09-10 04:39:18 UTC (rev 4683) @@ -315,6 +315,11 @@ /*Functions to display numbers in locale of the user */ function locale_number_format($Number, $DecimalPlaces) { + global $LocaleInfo; + return number_format($Number,$DecimalPlaces,$LocaleInfo['decimal_point'],$LocaleInfo['thousands_sep']); +} + +function locale_money_format($Number, $DecimalPlaces) { return money_format('%!.' . $DecimalPlaces . 'n',$Number); } This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <dai...@us...> - 2011-09-10 04:39:26
|
Revision: 4683 http://web-erp.svn.sourceforge.net/web-erp/?rev=4683&view=rev Author: daintree Date: 2011-09-10 04:39:18 +0000 (Sat, 10 Sep 2011) Log Message: ----------- number formatting Modified Paths: -------------- trunk/DeliveryDetails.php trunk/SelectOrderItems.php trunk/includes/DefineCartClass.php trunk/includes/LanguageSetup.php trunk/includes/MiscFunctions.php Modified: trunk/DeliveryDetails.php =================================================================== --- trunk/DeliveryDetails.php 2011-09-09 03:39:04 UTC (rev 4682) +++ trunk/DeliveryDetails.php 2011-09-10 04:39:18 UTC (rev 4683) @@ -358,7 +358,7 @@ '". DB_escape_string($_SESSION['Items'.$identifier]->Comments) ."', '" . Date('Y-m-d H:i') . "', '" . $_SESSION['Items'.$identifier]->DefaultSalesType . "', - '" . $_POST['ShipVia'] ."', + '" . DB_escape_string($_POST['ShipVia']) ."', '". DB_escape_string($_SESSION['Items'.$identifier]->DeliverTo) . "', '" . DB_escape_string($_SESSION['Items'.$identifier]->BuyerName) . "', '" . DB_escape_string($_SESSION['Items'.$identifier]->DelAdd1) . "', @@ -367,9 +367,9 @@ '" . DB_escape_string($_SESSION['Items'.$identifier]->DelAdd4) . "', '" . DB_escape_string($_SESSION['Items'.$identifier]->DelAdd5) . "', '" . DB_escape_string($_SESSION['Items'.$identifier]->DelAdd6) . "', - '" . $_SESSION['Items'.$identifier]->PhoneNo . "', - '" . $_SESSION['Items'.$identifier]->Email . "', - '" . $_SESSION['Items'.$identifier]->FreightCost ."', + '" . DB_escape_string($_SESSION['Items'.$identifier]->PhoneNo) . "', + '" . DB_escape_string($_SESSION['Items'.$identifier]->Email) . "', + '" . filter_number_format($_SESSION['Items'.$identifier]->FreightCost) ."', '" . $_SESSION['Items'.$identifier]->Location ."', '" . $DelDate . "', '" . $QuotDate . "', @@ -400,9 +400,9 @@ '" . $StockItem->LineNumber . "', '" . $OrderNo . "', '" . $StockItem->StockID . "', - '" . $StockItem->Price . "', - '" . $StockItem->Quantity . "', - '" . floatval($StockItem->DiscountPercent) . "', + '" . filter_number_format($StockItem->Price) . "', + '" . filter_number_format($StockItem->Quantity) . "', + '" . filter_number_format(floatval($StockItem->DiscountPercent)) . "', '" . DB_escape_string($StockItem->Narrative) . "', '" . $StockItem->POLine . "', '" . FormatDateForSQL($StockItem->ItemDue) . "' @@ -511,8 +511,8 @@ stdcost) VALUES ( '" . $WONo . "', '" . $StockItem->StockID . "', - '" . $WOQuantity . "', - '" . $Cost . "')"; + '" . filter_number_format($WOQuantity) . "', + '" . filter_number_format($Cost) . "')"; $ErrMsg = _('The work order item could not be added'); $result = DB_query($sql,$db,$ErrMsg,$DbgMsg,true); @@ -699,7 +699,7 @@ VALUES ( '" . $WONo . "', '" . $ContractRow['contractref'] . "', '1', - '" . $Cost . "')"; + '" . filter_number_format($Cost) . "')"; $ErrMsg = _('The work order item could not be added'); $result = DB_query($sql,$db,$ErrMsg,$DbgMsg,true); @@ -727,9 +727,9 @@ deladd4 = '" . DB_escape_string($_SESSION['Items'.$identifier]->DelAdd4) . "', deladd5 = '" . DB_escape_string($_SESSION['Items'.$identifier]->DelAdd5) . "', deladd6 = '" . DB_escape_string($_SESSION['Items'.$identifier]->DelAdd6) . "', - contactphone = '" . $_SESSION['Items'.$identifier]->PhoneNo . "', - contactemail = '" . $_SESSION['Items'.$identifier]->Email . "', - freightcost = '" . $_SESSION['Items'.$identifier]->FreightCost ."', + contactphone = '" . DB_escape_string($_SESSION['Items'.$identifier]->PhoneNo) . "', + contactemail = '" . DB_escape_string($_SESSION['Items'.$identifier]->Email) . "', + freightcost = '" . filter_number_format($_SESSION['Items'.$identifier]->FreightCost) ."', fromstkloc = '" . $_SESSION['Items'.$identifier]->Location ."', printedpackingslip = '" . $_POST['ReprintPackingSlip'] . "', quotation = '" . $_SESSION['Items'.$identifier]->Quotation . "', @@ -751,9 +751,9 @@ $Completed = 0; } - $LineItemsSQL = "UPDATE salesorderdetails SET unitprice='" . $StockItem->Price . "', - quantity='" . $StockItem->Quantity . "', - discountpercent='" . floatval($StockItem->DiscountPercent) . "', + $LineItemsSQL = "UPDATE salesorderdetails SET unitprice='" . filter_number_format($StockItem->Price) . "', + quantity='" . filter_number_format($StockItem->Quantity) . "', + discountpercent='" . filter_number_format(floatval($StockItem->DiscountPercent)) . "', completed='" . $Completed . "', poline='" . $StockItem->POLine . "', itemdue='" . FormatDateForSQL($StockItem->ItemDue) . "' @@ -837,8 +837,8 @@ foreach ($_SESSION['Items'.$identifier]->LineItems as $StockItem) { $LineTotal = $StockItem->Quantity * $StockItem->Price * (1 - $StockItem->DiscountPercent); - $DisplayLineTotal = locale_number_format($LineTotal,$_SESSION['Items'.$identifier]->CurrDecimalPlaces); - $DisplayPrice = locale_number_format($StockItem->Price,$_SESSION['Items'.$identifier]->CurrDecimalPlaces); + $DisplayLineTotal = locale_money_format($LineTotal,$_SESSION['Items'.$identifier]->CurrDecimalPlaces); + $DisplayPrice = locale_money_format($StockItem->Price,$_SESSION['Items'.$identifier]->CurrDecimalPlaces); $DisplayQuantity = locale_number_format($StockItem->Quantity,$StockItem->DecimalPlaces); $DisplayDiscount = locale_number_format(($StockItem->DiscountPercent * 100),2); @@ -865,7 +865,7 @@ $_SESSION['Items'.$identifier]->totalWeight = $_SESSION['Items'.$identifier]->totalWeight + ($StockItem->Quantity * $StockItem->Weight); } - $DisplayTotal = locale_number_format($_SESSION['Items'.$identifier]->total,2); + $DisplayTotal = locale_money_format($_SESSION['Items'.$identifier]->total,2); echo '<tr class="EvenTableRows"> <td colspan=6 class=number><b>'. _('TOTAL Excl Tax/Freight') .'</b></td> <td class=number>'.$DisplayTotal.'</td> @@ -901,8 +901,8 @@ foreach ($_SESSION['Items'.$identifier]->LineItems as $StockItem) { $LineTotal = $StockItem->Quantity * $StockItem->Price * (1 - $StockItem->DiscountPercent); - $DisplayLineTotal = locale_number_format($LineTotal,$_SESSION['Items'.$identifier]->CurrDecimalPlaces); - $DisplayPrice = locale_number_format($StockItem->Price,$_SESSION['Items'.$identifier]->CurrDecimalPlaces); + $DisplayLineTotal = locale_money_format($LineTotal,$_SESSION['Items'.$identifier]->CurrDecimalPlaces); + $DisplayPrice = locale_money_format($StockItem->Price,$_SESSION['Items'.$identifier]->CurrDecimalPlaces); $DisplayQuantity = locale_number_format($StockItem->Quantity,$StockItem->DecimalPlaces); if ($k==1){ @@ -925,7 +925,7 @@ } - $DisplayTotal = locale_number_format($_SESSION['Items'.$identifier]->total,$_SESSION['Items'.$identifier]->CurrDecimalPlaces); + $DisplayTotal = locale_money_format($_SESSION['Items'.$identifier]->total,$_SESSION['Items'.$identifier]->CurrDecimalPlaces); echo '<table class="selection"> <tr> <td>'. _('Total Weight') .':</td> Modified: trunk/SelectOrderItems.php =================================================================== --- trunk/SelectOrderItems.php 2011-09-09 03:39:04 UTC (rev 4682) +++ trunk/SelectOrderItems.php 2011-09-10 04:39:18 UTC (rev 4683) @@ -25,13 +25,13 @@ if (isset($_POST['SelectingOrderItems'])){ foreach ($_POST as $FormVariable => $Quantity) { if (mb_strpos($FormVariable,'OrderQty')!==false) { - $NewItem_array[$_POST['StockID' . mb_substr($FormVariable,8)]] = trim($Quantity); + $NewItem_array[$_POST['StockID' . mb_substr($FormVariable,8)]] = filter_number_format(trim($Quantity)); } } } if (isset($_GET['NewItem'])){ - $NewItem = trim($_GET['NewItem']); + $NewItem = filter_number_format(trim($_GET['NewItem'])); } @@ -124,7 +124,7 @@ ON locations.loccode=salesorders.fromstkloc INNER JOIN currencies ON debtorsmaster.currcode=currencies.currabrev - WHERE salesorders.orderno = '" . $_GET['ModifyOrderNumber'] . "'"; + WHERE salesorders.orderno = '" . filter_number_format($_GET['ModifyOrderNumber']) . "'"; $ErrMsg = _('The order cannot be retrieved because'); $GetOrdHdrResult = DB_query($OrderHeaderSQL,$db,$ErrMsg); @@ -294,80 +294,34 @@ //Customer logins are not allowed to select other customers henc in_array(2,$_SESSION['AllowedPageSecurityTokens']) if (isset($_POST['SearchCust']) AND $_SESSION['RequireCustomerSelection']==1 AND in_array(2,$_SESSION['AllowedPageSecurityTokens'])){ - if (($_POST['CustKeywords']!='') AND (($_POST['CustCode']!='') OR ($_POST['CustPhone']!=''))) { - prnMsg( _('Customer Branch Name keywords have been used in preference to the Customer Branch Code or Branch Phone Number entered'), 'warn'); - } - if (($_POST['CustCode']!='') AND ($_POST['CustPhone']!='')) { - prnMsg(_('Customer Branch Code has been used in preference to the Customer Branch Phone Number entered'), 'warn'); - } if (($_POST['CustKeywords']=='') AND ($_POST['CustCode']=='') AND ($_POST['CustPhone']=='')) { prnMsg(_('At least one Customer Branch Name keyword OR an extract of a Customer Branch Code or Branch Phone Number must be entered for the search'), 'warn'); } else { - if (mb_strlen($_POST['CustKeywords'])>0) { //insert wildcard characters in spaces - $_POST['CustKeywords'] = mb_strtoupper(trim($_POST['CustKeywords'])); - $SearchString = '%' . str_replace(' ', '%', $_POST['CustKeywords']) . '%'; + $_POST['CustKeywords'] = mb_strtoupper(trim($_POST['CustKeywords'])); + $SearchString = str_replace(' ', '%', $_POST['CustKeywords']) ; + + $SQL = "SELECT custbranch.brname, + custbranch.contactname, + custbranch.phoneno, + custbranch.faxno, + custbranch.branchcode, + custbranch.debtorno, + debtorsmaster.name + FROM custbranch + LEFT JOIN debtorsmaster + ON custbranch.debtorno=debtorsmaster.debtorno + WHERE custbranch.brname " . LIKE . " '%" . $SearchString . "%' + AND custbranch.debtorno " . LIKE . " '%" . mb_strtoupper(trim($_POST['CustCode'])) . "%' + AND custbranch.branchcode " . LIKE . " '%" . mb_strtoupper(trim($_POST['CustCode'])) . "%' + AND custbranch.phoneno " . LIKE . " '%" . trim($_POST['CustPhone']) . "%'"; - $SQL = "SELECT custbranch.brname, - custbranch.contactname, - custbranch.phoneno, - custbranch.faxno, - custbranch.branchcode, - custbranch.debtorno, - debtorsmaster.name - FROM custbranch - LEFT JOIN debtorsmaster - ON custbranch.debtorno=debtorsmaster.debtorno - WHERE custbranch.brname " . LIKE . " '$SearchString'"; - if ($_SESSION['SalesmanLogin']!=''){ $SQL .= " AND custbranch.salesman='" . $_SESSION['SalesmanLogin'] . "'"; } $SQL .= " AND custbranch.disabletrans=0 ORDER BY custbranch.debtorno, custbranch.branchcode"; - } elseif (mb_strlen($_POST['CustCode'])>0){ - - $_POST['CustCode'] = mb_strtoupper(trim($_POST['CustCode'])); - - $SQL = "SELECT custbranch.brname, - custbranch.contactname, - custbranch.phoneno, - custbranch.faxno, - custbranch.branchcode, - custbranch.debtorno, - debtorsmaster.name - FROM custbranch - LEFT JOIN debtorsmaster - ON custbranch.debtorno=debtorsmaster.debtorno - WHERE custbranch.debtorno " . LIKE . " '%" . $_POST['CustCode'] . "%' OR custbranch.branchcode " . LIKE . " '%" . $_POST['CustCode'] . "%'"; - - if ($_SESSION['SalesmanLogin']!=''){ - $SQL .= " AND custbranch.salesman='" . $_SESSION['SalesmanLogin'] . "'"; - } - $SQL .= " AND custbranch.disabletrans=0 - ORDER BY custbranch.debtorno"; - } elseif (mb_strlen($_POST['CustPhone'])>0){ - $SQL = "SELECT custbranch.brname, - custbranch.contactname, - custbranch.phoneno, - custbranch.faxno, - custbranch.branchcode, - custbranch.debtorno, - debtorsmaster.name - FROM custbranch - INNER JOIN debtorsmaster - ON custbranch.debtorno=debtorsmaster.debtorno - WHERE custbranch.phoneno " . LIKE . " '%" . $_POST['CustPhone'] . "%'"; - - if ($_SESSION['SalesmanLogin']!=''){ - $SQL .= " AND custbranch.salesman='" . $_SESSION['SalesmanLogin'] . "'"; - } - - $SQL .= " AND custbranch.disabletrans=0 - ORDER BY custbranch.debtorno"; - } - $ErrMsg = _('The searched customer records requested cannot be retrieved because'); $result_CustSelect = DB_query($SQL,$db,$ErrMsg); @@ -399,7 +353,7 @@ record returned from a search so parse the $SelectCustomer string into customer code and branch code */ if (isset($SelectedCustomer)) { - $_SESSION['Items'.$identifier]->DebtorNo = trim($SelectedCustomer); + $_SESSION['Items'.$identifier]->DebtorNo = trim($SelectedCustomer); $_SESSION['Items'.$identifier]->Branch = trim($SelectedBranch); // Now check to ensure this account is not on hold */ @@ -922,7 +876,7 @@ $NewItem = mb_strtoupper($_POST[$QuickEntryCode]); } if (isset($_POST[$QuickEntryQty])) { - $NewItemQty = $_POST[$QuickEntryQty]; + $NewItemQty = filter_number_format($_POST[$QuickEntryQty]); } if (isset($_POST[$QuickEntryItemDue])) { $NewItemDue = $_POST[$QuickEntryItemDue]; @@ -941,7 +895,7 @@ } if(!Is_Date($NewItemDue)) { - prnMsg(_('An invalid date entry was made for ') . ' ' . $NewItem . ' ' . _('The date entry') . ' ' . $NewItemDue . ' ' . _('must be in the format') . ' ' . $_SESSION['DefaultDateFormat'],'warn'); + prnMsg(_('An invalid date entry was made for ') . ' ' . $NewItem . ' ' . _('The date entry') . ' ' . $NewItemDue . ' ' . _('must be in the format') . ' ' . $_SESSION['DefaultDateFormat'],'warn'); //Attempt to default the due date to something sensible? $NewItemDue = DateAdd (Date($_SESSION['DefaultDateFormat']),'d', $_SESSION['Items'.$identifier]->DeliveryDays); } @@ -1054,8 +1008,8 @@ taxcatid, materialcost) VALUES ('" . $AssetStockID . "', - '" . $AssetRow['description'] . "', - '" . $AssetRow['longdescription'] . "', + '" . DB_escape_string($AssetRow['description']) . "', + '" . DB_escape_string($AssetRow['longdescription']) . "', 'ASSETS', 'D', '0', @@ -1099,18 +1053,18 @@ if (isset($_POST['Quantity_' . $OrderLine->LineNumber])){ - $Quantity = $_POST['Quantity_' . $OrderLine->LineNumber]; + $Quantity = filter_number_format($_POST['Quantity_' . $OrderLine->LineNumber]); if (ABS($OrderLine->Price - $_POST['Price_' . $OrderLine->LineNumber])>0.01){ - $Price = $_POST['Price_' . $OrderLine->LineNumber]; - $_POST['GPPercent_' . $OrderLine->LineNumber] = (($Price*(1-($_POST['Discount_' . $OrderLine->LineNumber]/100))) - $OrderLine->StandardCost*$ExRate)/($Price *(1-$_POST['Discount_' . $OrderLine->LineNumber])/100); - } elseif (ABS($OrderLine->GPPercent - $_POST['GPPercent_' . $OrderLine->LineNumber])>=0.001) { + $Price = filter_number_format($_POST['Price_' . $OrderLine->LineNumber]); + $_POST['GPPercent_' . $OrderLine->LineNumber] = (($Price*(1-(filter_number_format($_POST['Discount_' . $OrderLine->LineNumber])/100))) - $OrderLine->StandardCost*$ExRate)/($Price *(1-filter_number_format($_POST['Discount_' . $OrderLine->LineNumber]))/100); + } elseif (ABS($OrderLine->GPPercent - filter_number_format($_POST['GPPercent_' . $OrderLine->LineNumber]))>=0.001) { //then do a recalculation of the price at this new GP Percentage - $Price = ($OrderLine->StandardCost*$ExRate)/(1 -(($_POST['GPPercent_' . $OrderLine->LineNumber] + $_POST['Discount_' . $OrderLine->LineNumber])/100)); + $Price = ($OrderLine->StandardCost*$ExRate)/(1 -((filter_number_format($_POST['GPPercent_' . $OrderLine->LineNumber]) + filter_number_format($_POST['Discount_' . $OrderLine->LineNumber]))/100)); } else { - $Price = $_POST['Price_' . $OrderLine->LineNumber]; + $Price = filter_number_format($_POST['Price_' . $OrderLine->LineNumber]); } - $DiscountPercentage = $_POST['Discount_' . $OrderLine->LineNumber]; + $DiscountPercentage = filter_number_format($_POST['Discount_' . $OrderLine->LineNumber]); if ($_SESSION['AllowOrderLineItemNarrative'] == 1) { $Narrative = $_POST['Narrative_' . $OrderLine->LineNumber]; } else { @@ -1171,7 +1125,7 @@ 'Yes', /*Update DB */ $_POST['ItemDue_' . $OrderLine->LineNumber], $_POST['POLine_' . $OrderLine->LineNumber], - $_POST['GPPercent_' . $OrderLine->LineNumber]); + filter_number_format($_POST['GPPercent_' . $OrderLine->LineNumber])); } //within credit limit so make changes } //there are changes to the order line to process } //page not called from itself - POST variables not set @@ -1382,7 +1336,7 @@ foreach ($_SESSION['Items'.$identifier]->LineItems as $OrderLine) { $LineTotal = $OrderLine->Quantity * $OrderLine->Price * (1 - $OrderLine->DiscountPercent); - $DisplayLineTotal = locale_number_format($LineTotal,$_SESSION['Items'.$identifier]->CurrDecimalPlaces); + $DisplayLineTotal = locale_money_format($LineTotal,$_SESSION['Items'.$identifier]->CurrDecimalPlaces); $DisplayDiscount = locale_number_format(($OrderLine->DiscountPercent * 100),2); $QtyOrdered = $OrderLine->Quantity; $QtyRemain = $QtyOrdered - $OrderLine->QtyInv; @@ -1454,7 +1408,7 @@ } /* end of loop around items */ - $DisplayTotal = locale_number_format($_SESSION['Items'.$identifier]->total,$_SESSION['Items'.$identifier]->CurrDecimalPlaces); + $DisplayTotal = locale_money_format($_SESSION['Items'.$identifier]->total,$_SESSION['Items'.$identifier]->CurrDecimalPlaces); if (in_array(2,$_SESSION['AllowedPageSecurityTokens'])){ $ColSpanNumber = 2; } else { Modified: trunk/includes/DefineCartClass.php =================================================================== --- trunk/includes/DefineCartClass.php 2011-09-09 03:39:04 UTC (rev 4682) +++ trunk/includes/DefineCartClass.php 2011-09-10 04:39:18 UTC (rev 4683) @@ -159,9 +159,9 @@ VALUES(" . $this->LineCounter . ", " . $_SESSION['ExistingOrder'] . ", '" . trim(mb_strtoupper($StockID)) ."', - " . $Qty . ", - " . $Price . ", - " . $Disc . ",' + " . filter_number_format($Qty) . ", + " . filter_number_format($Price) . ", + " . filter_number_format($Disc) . ",' " . $ItemDue . "', " . $POLine . ")"; $result = DB_query($sql, @@ -196,9 +196,9 @@ $this->LineItems[$UpdateLineNumber]->GPPercent = $GPPercent; if ($UpdateDB=='Yes'){ global $db; - $result = DB_query("UPDATE salesorderdetails SET quantity=" . $Qty . ", - unitprice=" . $Price . ", - discountpercent=" . $Disc . ", + $result = DB_query("UPDATE salesorderdetails SET quantity=" . filter_number_format($Qty) . ", + unitprice=" . filter_number_format($Price) . ", + discountpercent=" . filter_number_format($Disc) . ", narrative ='" . DB_escape_string($Narrative) . "', itemdue = '" . FormatDateForSQL($ItemDue) . "', poline = '" . DB_escape_string($POLine) . "' Modified: trunk/includes/LanguageSetup.php =================================================================== --- trunk/includes/LanguageSetup.php 2011-09-09 03:39:04 UTC (rev 4682) +++ trunk/includes/LanguageSetup.php 2011-09-10 04:39:18 UTC (rev 4683) @@ -24,22 +24,21 @@ $Language = $_SESSION['Language']; } +$Locale = setlocale (LC_ALL, $_SESSION['Language']); +$LocaleInfo = localeconv(); +if (defined('LC_MESSAGES')){ + $Locale = setlocale (LC_MESSAGES, $_SESSION['Language']); +} +//Turkish seems to be a special case +if ($_SESSION['Language']=='tr_TR.utf8') { + $Locale = setlocale(LC_CTYPE, 'C'); +} + +//$Locale = setlocale (LC_NUMERIC, 'en_US'); //currently need decimal points to be '.' + if (function_exists('gettext')){ - $Locale = setlocale (LC_ALL, $_SESSION['Language']); - $LocaleInfo = localeconv(); - if (defined('LC_MESSAGES')){ - $Locale = setlocale (LC_MESSAGES, $_SESSION['Language']); - } - - //Turkish seems to be a special case - if ($_SESSION['Language']=='tr_TR.utf8') { - $Locale = setlocale(LC_CTYPE, 'C'); - } - - //$Locale = setlocale (LC_NUMERIC, 'en_US'); //currently need decimal points to be '.' - // possibly even if locale fails the language will still switch by using Language instead of locale variable putenv('LANG=' . $_SESSION['Language']); putenv('LANGUAGE=' . $_SESSION['Language']); Modified: trunk/includes/MiscFunctions.php =================================================================== --- trunk/includes/MiscFunctions.php 2011-09-09 03:39:04 UTC (rev 4682) +++ trunk/includes/MiscFunctions.php 2011-09-10 04:39:18 UTC (rev 4683) @@ -315,6 +315,11 @@ /*Functions to display numbers in locale of the user */ function locale_number_format($Number, $DecimalPlaces) { + global $LocaleInfo; + return number_format($Number,$DecimalPlaces,$LocaleInfo['decimal_point'],$LocaleInfo['thousands_sep']); +} + +function locale_money_format($Number, $DecimalPlaces) { return money_format('%!.' . $DecimalPlaces . 'n',$Number); } This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <dai...@us...> - 2011-09-11 04:06:57
|
Revision: 4685 http://web-erp.svn.sourceforge.net/web-erp/?rev=4685&view=rev Author: daintree Date: 2011-09-11 04:06:48 +0000 (Sun, 11 Sep 2011) Log Message: ----------- number_formatting Modified Paths: -------------- trunk/ConfirmDispatchControlled_Invoice.php trunk/ConfirmDispatch_Invoice.php trunk/CounterSales.php trunk/Credit_Invoice.php trunk/DeliveryDetails.php trunk/OutstandingGRNs.php trunk/PDFLowGP.php trunk/SelectOrderItems.php trunk/includes/DefineCartClass.php trunk/includes/footer.inc Modified: trunk/ConfirmDispatchControlled_Invoice.php =================================================================== --- trunk/ConfirmDispatchControlled_Invoice.php 2011-09-10 04:52:21 UTC (rev 4684) +++ trunk/ConfirmDispatchControlled_Invoice.php 2011-09-11 04:06:48 UTC (rev 4685) @@ -69,7 +69,7 @@ /*TotalQuantity set inside this include file from the sum of the bundles of the item selected for dispatch */ -$_SESSION['Items']->LineItems[$LineNo]->QtyDispatched = $TotalQuantity; +$_SESSION['Items']->LineItems[$LineNo]->QtyDispatched = filter_number_format($TotalQuantity); include('includes/footer.inc'); exit; Modified: trunk/ConfirmDispatch_Invoice.php =================================================================== --- trunk/ConfirmDispatch_Invoice.php 2011-09-10 04:52:21 UTC (rev 4684) +++ trunk/ConfirmDispatch_Invoice.php 2011-09-11 04:06:48 UTC (rev 4685) @@ -208,11 +208,11 @@ $_SESSION['Items']->ShipVia = $_POST['ShipVia']; } if (isset($_POST['ChargeFreightCost'])){ - $_SESSION['Items']->FreightCost = $_POST['ChargeFreightCost']; + $_SESSION['Items']->FreightCost = filter_number_format($_POST['ChargeFreightCost']); } foreach ($_SESSION['Items']->FreightTaxes as $FreightTaxLine) { if (isset($_POST['FreightTaxRate' . $FreightTaxLine->TaxCalculationOrder])){ - $_SESSION['Items']->FreightTaxes[$FreightTaxLine->TaxCalculationOrder]->TaxRate = $_POST['FreightTaxRate' . $FreightTaxLine->TaxCalculationOrder]/100; + $_SESSION['Items']->FreightTaxes[$FreightTaxLine->TaxCalculationOrder]->TaxRate = filter_number_format($_POST['FreightTaxRate' . $FreightTaxLine->TaxCalculationOrder]/100); } } @@ -220,14 +220,14 @@ if (sizeOf($Itm->SerialItems) > 0) { $_SESSION['Items']->LineItems[$Itm->LineNumber]->QtyDispatched = 0; //initialise QtyDispatched foreach ($Itm->SerialItems as $SerialItem) { //calculate QtyDispatched from bundle quantities - $_SESSION['Items']->LineItems[$Itm->LineNumber]->QtyDispatched += $SerialItem->BundleQty; + $_SESSION['Items']->LineItems[$Itm->LineNumber]->QtyDispatched += filter_number_format($SerialItem->BundleQty); } - } else if (is_numeric($_POST[$Itm->LineNumber . '_QtyDispatched' ])AND $_POST[$Itm->LineNumber . '_QtyDispatched'] <= ($_SESSION['Items']->LineItems[$Itm->LineNumber]->Quantity - $_SESSION['Items']->LineItems[$Itm->LineNumber]->QtyInv)){ - $_SESSION['Items']->LineItems[$Itm->LineNumber]->QtyDispatched = $_POST[$Itm->LineNumber . '_QtyDispatched']; + } else if (is_numeric($_POST[$Itm->LineNumber . '_QtyDispatched' ]) AND filter_number_format($_POST[$Itm->LineNumber . '_QtyDispatched']) <= ($_SESSION['Items']->LineItems[$Itm->LineNumber]->Quantity - $_SESSION['Items']->LineItems[$Itm->LineNumber]->QtyInv)){ + $_SESSION['Items']->LineItems[$Itm->LineNumber]->QtyDispatched = filter_number_format($_POST[$Itm->LineNumber . '_QtyDispatched']); } foreach ($Itm->Taxes as $TaxLine) { if (isset($_POST[$Itm->LineNumber . $TaxLine->TaxCalculationOrder . '_TaxRate'])){ - $_SESSION['Items']->LineItems[$Itm->LineNumber]->Taxes[$TaxLine->TaxCalculationOrder]->TaxRate = $_POST[$Itm->LineNumber . $TaxLine->TaxCalculationOrder . '_TaxRate']/100; + $_SESSION['Items']->LineItems[$Itm->LineNumber]->Taxes[$TaxLine->TaxCalculationOrder]->TaxRate = filter_number_format($_POST[$Itm->LineNumber . $TaxLine->TaxCalculationOrder . '_TaxRate']/100); } } } //end foreach lineitem @@ -323,8 +323,8 @@ } } $DisplayDiscountPercent = locale_number_format($LnItm->DiscountPercent*100,2) . '%'; - $DisplayLineNetTotal = locale_number_format($LineTotal,$_SESSION['Items']->CurrDecimalPlaces); - $DisplayPrice = locale_number_format($LnItm->Price,$_SESSION['Items']->CurrDecimalPlaces); + $DisplayLineNetTotal = locale_money_format($LineTotal,$_SESSION['Items']->CurrDecimalPlaces); + $DisplayPrice = locale_money_format($LnItm->Price,$_SESSION['Items']->CurrDecimalPlaces); echo '<td class="number">'.$DisplayPrice.'</td> <td class="number">'.$DisplayDiscountPercent.'</td> <td class="number">'.$DisplayLineNetTotal.'</td>'; @@ -373,9 +373,9 @@ $TaxTotal += $TaxLineTotal; - $DisplayTaxAmount = locale_number_format($TaxLineTotal ,$_SESSION['Items']->CurrDecimalPlaces); + $DisplayTaxAmount = locale_money_format($TaxLineTotal ,$_SESSION['Items']->CurrDecimalPlaces); - $DisplayGrossLineTotal = locale_number_format($LineTotal+ $TaxLineTotal,$_SESSION['Items']->CurrDecimalPlaces); + $DisplayGrossLineTotal = locale_money_format($LineTotal+ $TaxLineTotal,$_SESSION['Items']->CurrDecimalPlaces); echo '<td class="number">'.$DisplayTaxAmount.'</td><td class="number">'.$DisplayGrossLineTotal.'</td>'; @@ -392,8 +392,8 @@ } echo '</tr>'; if (mb_strlen($LnItm->Narrative)>1){ - $narrative=str_replace('\r\n','<br />', $LnItm->Narrative); - echo $RowStarter . '<td colspan=12>' . stripslashes($narrative) . '</td></tr>'; + $Narrative=str_replace('\r\n','<br />', $LnItm->Narrative); + echo $RowStarter . '<td colspan=12>' . stripslashes($Narrative) . '</td></tr>'; } }//end foreach ($line) @@ -511,13 +511,13 @@ } echo '</td>'; -echo '<td class="number">' . locale_number_format($FreightTaxTotal,$_SESSION['Items']->CurrDecimalPlaces) . '</td> - <td class="number">' . locale_number_format($FreightTaxTotal+ $_POST['ChargeFreightCost'],$_SESSION['Items']->CurrDecimalPlaces) . '</td> +echo '<td class="number">' . locale_money_format($FreightTaxTotal,$_SESSION['Items']->CurrDecimalPlaces) . '</td> + <td class="number">' . locale_money_format($FreightTaxTotal+ $_POST['ChargeFreightCost'],$_SESSION['Items']->CurrDecimalPlaces) . '</td> </tr>'; $TaxTotal += $FreightTaxTotal; -$DisplaySubTotal = locale_number_format(($_SESSION['Items']->total + $_POST['ChargeFreightCost']),$_SESSION['Items']->CurrDecimalPlaces); +$DisplaySubTotal = locale_money_format(($_SESSION['Items']->total + $_POST['ChargeFreightCost']),$_SESSION['Items']->CurrDecimalPlaces); /* round the totals to avoid silly entries */ @@ -529,8 +529,8 @@ <td colspan="10" class="number">' . _('Invoice Totals'). '</td> <td class="number:><hr><b>'.$DisplaySubTotal.'</b><hr></td> <td colspan="2"></td> - <td class="number"><hr><b>' . locale_number_format($TaxTotal,$_SESSION['Items']->CurrDecimalPlaces) . '</b><hr></td> - <td class="number"><hr><b>' . locale_number_format($TaxTotal+($_SESSION['Items']->total + $_POST['ChargeFreightCost']),$_SESSION['Items']->CurrDecimalPlaces) . '</b><hr></td> + <td class="number"><hr><b>' . locale_money_format($TaxTotal,$_SESSION['Items']->CurrDecimalPlaces) . '</b><hr></td> + <td class="number"><hr><b>' . locale_money_format($TaxTotal+($_SESSION['Items']->total + $_POST['ChargeFreightCost']),$_SESSION['Items']->CurrDecimalPlaces) . '</b><hr></td> </tr>'; if (! isset($_POST['DispatchDate']) OR ! Is_Date($_POST['DispatchDate'])){ @@ -587,7 +587,7 @@ /*Now look for assembly components that would go negative */ $SQL = "SELECT bom.component, stockmaster.description, - locstock.quantity-(" . $OrderLine->QtyDispatched . "*bom.quantity) AS qtyleft + locstock.quantity-(" . filter_number_format($OrderLine->QtyDispatched) . "*bom.quantity) AS qtyleft FROM bom INNER JOIN locstock ON bom.component=locstock.stockid @@ -763,13 +763,13 @@ '', '" . $_SESSION['Items']->DefaultSalesType . "', '" . $_SESSION['ProcessingOrder'] . "', - '" . $_SESSION['Items']->total . "', - '" . $TaxTotal . "', - '" . $_POST['ChargeFreightCost'] . "', - '" . $_SESSION['CurrencyRate'] . "', - '" . $_POST['InvoiceText'] . "', + '" . filter_number_format($_SESSION['Items']->total) . "', + '" . filter_number_format($TaxTotal) . "', + '" . filter_number_format($_POST['ChargeFreightCost']) . "', + '" . filter_number_format($_SESSION['CurrencyRate']) . "', + '" . DB_escape_string($_POST['InvoiceText']) . "', '" . $_SESSION['Items']->ShipVia . "', - '" . $_POST['Consignment'] . "' )"; + '" . DB_escape_string($_POST['Consignment']) . "' )"; $ErrMsg =_('CRITICAL ERROR') . '! ' . _('NOTE DOWN THIS ERROR AND SEEK ASSISTANCE') . ': ' . _('The debtor transaction record could not be inserted because'); $DbgMsg = _('The following SQL to insert the debtor transaction record was used'); @@ -785,7 +785,7 @@ taxamount) VALUES ('" . $DebtorTransID . "', '" . $TaxAuthID . "', - '" . $TaxAmount/$_SESSION['CurrencyRate'] . "')"; + '" . filter_number_format($TaxAmount/$_SESSION['CurrencyRate']) . "')"; $ErrMsg =_('CRITICAL ERROR') . '! ' . _('NOTE DOWN THIS ERROR AND SEEK ASSISTANCE') . ': ' . _('The debtor transaction taxes records could not be inserted because'); $DbgMsg = _('The following SQL to insert the debtor transaction taxes record was used'); @@ -815,7 +815,7 @@ if ($_POST['BOPolicy']=='CAN'){ $SQL = "UPDATE salesorderdetails - SET quantity = quantity - " . ($OrderLine->Quantity - $OrderLine->QtyDispatched) . " + SET quantity = quantity - " . filter_number_format($OrderLine->Quantity - $OrderLine->QtyDispatched) . " WHERE orderno = '" . $_SESSION['ProcessingOrder'] . " ' AND stkcode = '" . $OrderLine->StockID . "'"; @@ -837,7 +837,7 @@ '" . $_SESSION['ProcessingOrder'] . "', '" . $InvoiceNo . "', '" . $OrderLine->StockID . "', - '" . ($OrderLine->Quantity - $OrderLine->QtyDispatched) . "', + '" . filter_number_format($OrderLine->Quantity - $OrderLine->QtyDispatched) . "', '" . $_SESSION['Items']->DebtorNo . "', '" . $_SESSION['Items']->Branch . "', 'CAN')"; @@ -849,7 +849,7 @@ - } elseif (($OrderLine->Quantity - $OrderLine->QtyDispatched) >0 && DateDiff(ConvertSQLDate($DefaultDispatchDate),$_SESSION['Items']->DeliveryDate,'d') >0) { + } elseif (($OrderLine->Quantity - $OrderLine->QtyDispatched) >0 AND DateDiff(ConvertSQLDate($DefaultDispatchDate),$_SESSION['Items']->DeliveryDate,'d') > 0) { /*The order is being short delivered after the due date - need to insert a delivery differnce log */ @@ -865,7 +865,7 @@ '" . $_SESSION['ProcessingOrder'] . "', '" . $InvoiceNo . "', '" . $OrderLine->StockID . "', - '" . ($OrderLine->Quantity - $OrderLine->QtyDispatched) . "', + '" . filter_number_format($OrderLine->Quantity - $OrderLine->QtyDispatched) . "', '" . $_SESSION['Items']->DebtorNo . "', '" . $_SESSION['Items']->Branch . "', 'BO' @@ -883,14 +883,14 @@ // Test above to see if the line is completed or not if ($OrderLine->QtyDispatched>=($OrderLine->Quantity - $OrderLine->QtyInv) OR $_POST['BOPolicy']=='CAN'){ $SQL = "UPDATE salesorderdetails - SET qtyinvoiced = qtyinvoiced + " . $OrderLine->QtyDispatched . ", + SET qtyinvoiced = qtyinvoiced + " . filter_number_format($OrderLine->QtyDispatched) . ", actualdispatchdate = '" . $DefaultDispatchDate . "', completed=1 WHERE orderno = '" . $_SESSION['ProcessingOrder'] . "' AND orderlineno = '" . $OrderLine->LineNumber . "'"; } else { $SQL = "UPDATE salesorderdetails - SET qtyinvoiced = qtyinvoiced + " . $OrderLine->QtyDispatched . ", + SET qtyinvoiced = qtyinvoiced + " . filter_number_format($OrderLine->QtyDispatched) . ", actualdispatchdate = '" . $DefaultDispatchDate . "' WHERE orderno = '" . $_SESSION['ProcessingOrder'] . "' AND orderlineno = '" . $OrderLine->LineNumber . "'"; @@ -930,7 +930,7 @@ $QtyOnHandPrior = 0; } - $SQL = "UPDATE locstock SET quantity = locstock.quantity - " . $OrderLine->QtyDispatched . " + $SQL = "UPDATE locstock SET quantity = locstock.quantity - " . filter_number_format($OrderLine->QtyDispatched) . " WHERE locstock.stockid = '" . $OrderLine->StockID . "' AND loccode = '" . $_SESSION['Items']->Location . "'"; @@ -1002,10 +1002,10 @@ '" . $_SESSION['Items']->Branch . "', '" . $PeriodNo . "', '" . _('Assembly') . ': ' . $OrderLine->StockID . ' ' . _('Order') . ': ' . $_SESSION['ProcessingOrder'] . "', - '" . -$AssParts['quantity'] * $OrderLine->QtyDispatched . "', + '" . filter_number_format(-$AssParts['quantity'] * $OrderLine->QtyDispatched) . "', '" . $AssParts['standard'] . "', 0, - '" . ($QtyOnHandPrior - $AssParts['quantity'] * $OrderLine->QtyDispatched) . "' )"; + '" . filter_number_format($QtyOnHandPrior - $AssParts['quantity'] * $OrderLine->QtyDispatched) . "' )"; $ErrMsg = _('CRITICAL ERROR') . '! ' . _('NOTE DOWN THIS ERROR AND SEEK ASSISTANCE') . ': ' . _('Stock movement records for the assembly components of'). ' '. $OrderLine->StockID . ' ' . _('could not be inserted because'); $DbgMsg = _('The following SQL to insert the assembly components stock movement records was used'); @@ -1013,7 +1013,7 @@ $SQL = "UPDATE locstock - SET quantity = locstock.quantity - " . $AssParts['quantity'] * $OrderLine->QtyDispatched . " + SET quantity = locstock.quantity - " . filter_number_format($AssParts['quantity'] * $OrderLine->QtyDispatched) . " WHERE locstock.stockid = '" . $AssParts['component'] . "' AND loccode = '" . $_SESSION['Items']->Location . "'"; @@ -1028,7 +1028,7 @@ } /* end of its an assembly */ // Insert stock movements - with unit cost - $LocalCurrencyPrice= ($OrderLine->Price / $_SESSION['CurrencyRate']); + $LocalCurrencyPrice = ($OrderLine->Price / $_SESSION['CurrencyRate']); if (empty($OrderLine->StandardCost)) { $OrderLine->StandardCost=0; @@ -1056,13 +1056,13 @@ '" . $DefaultDispatchDate . "', '" . $_SESSION['Items']->DebtorNo . "', '" . $_SESSION['Items']->Branch . "', - '" . $LocalCurrencyPrice . "', + '" . filter_number_format($LocalCurrencyPrice) . "', '" . $PeriodNo . "', '" . $_SESSION['ProcessingOrder'] . "', - '" . -$OrderLine->QtyDispatched . "', - '" . $OrderLine->DiscountPercent . "', - '" . $OrderLine->StandardCost . "', - '" . ($QtyOnHandPrior - $OrderLine->QtyDispatched) . "', + '" . filter_number_format(-$OrderLine->QtyDispatched) . "', + '" . filter_number_format($OrderLine->DiscountPercent) . "', + '" . filter_number_format($OrderLine->StandardCost) . "', + '" . filter_number_format($QtyOnHandPrior - $OrderLine->QtyDispatched) . "', '" . DB_escape_string($OrderLine->Narrative) . "' )"; } else { // its an assembly or dummy and assemblies/dummies always have nil stock (by definition they are made up at the time of dispatch so new qty on hand will be nil @@ -1090,12 +1090,12 @@ '" . $DefaultDispatchDate . "', '" . $_SESSION['Items']->DebtorNo . "', '" . $_SESSION['Items']->Branch . "', - '" . $LocalCurrencyPrice . "', + '" . filter_number_format($LocalCurrencyPrice) . "', '" . $PeriodNo . "', '" . $_SESSION['ProcessingOrder'] . "', - '" . -$OrderLine->QtyDispatched . "', - '" . $OrderLine->DiscountPercent . "', - '" . $OrderLine->StandardCost . "', + '" . filter_number_format(-$OrderLine->QtyDispatched) . "', + '" . filter_number_format($OrderLine->DiscountPercent) . "', + '" . filter_number_format($OrderLine->StandardCost) . "', '" . DB_escape_string($OrderLine->Narrative) . "')"; } @@ -1117,7 +1117,7 @@ taxontax) VALUES ('" . $StkMoveNo . "', '" . $Tax->TaxAuthID . "', - '" . $Tax->TaxRate . "', + '" . filter_number_format($Tax->TaxRate) . "', '" . $Tax->TaxCalculationOrder . "', '" . $Tax->TaxOnTax . "')"; @@ -1133,10 +1133,10 @@ foreach($OrderLine->SerialItems as $Item){ /*We need to add the StockSerialItem record and the StockSerialMoves as well */ - $SQL = "UPDATE stockserialitems SET quantity= quantity - " . $Item->BundleQty . " + $SQL = "UPDATE stockserialitems SET quantity= quantity - " . filter_number_format($Item->BundleQty) . " WHERE stockid='" . $OrderLine->StockID . "' AND loccode='" . $_SESSION['Items']->Location . "' - AND serialno='" . $Item->BundleRef . "'"; + AND serialno='" . DB_escape_string($Item->BundleRef) . "'"; $ErrMsg = _('CRITICAL ERROR') . '! ' . _('NOTE DOWN THIS ERROR AND SEEK ASSISTANCE') . ': ' . _('The serial stock item record could not be updated because'); $DbgMsg = _('The following SQL to update the serial stock item record was used'); @@ -1150,8 +1150,8 @@ moveqty) VALUES ('" . $StkMoveNo . "', '" . $OrderLine->StockID . "', - '" . $Item->BundleRef . "', - '" . -$Item->BundleQty . "')"; + '" . DB_escape_string($Item->BundleRef) . "', + '" . filter_number_format(-$Item->BundleQty) . "')"; $ErrMsg = _('CRITICAL ERROR') . '! ' . _('NOTE DOWN THIS ERROR AND SEEK ASSISTANCE') . ': ' . _('The serial stock movement record could not be inserted because'); $DbgMsg = _('The following SQL to insert the serial stock movement records was used'); @@ -1202,10 +1202,10 @@ if ($myrow[0]>0){ /*Update the existing record that already exists */ - $SQL = "UPDATE salesanalysis SET amt=amt+" . ($OrderLine->Price * $OrderLine->QtyDispatched / $_SESSION['CurrencyRate']) . ", - cost=cost+" . ($OrderLine->StandardCost * $OrderLine->QtyDispatched) . ", - qty=qty +" . $OrderLine->QtyDispatched . ", - disc=disc+" . ($OrderLine->DiscountPercent * $OrderLine->Price * $OrderLine->QtyDispatched / $_SESSION['CurrencyRate']) . " + $SQL = "UPDATE salesanalysis SET amt=amt+" . filter_number_format($OrderLine->Price * $OrderLine->QtyDispatched / $_SESSION['CurrencyRate']) . ", + cost=cost+" . filter_number_format($OrderLine->StandardCost * $OrderLine->QtyDispatched) . ", + qty=qty +" . filter_number_format($OrderLine->QtyDispatched) . ", + disc=disc+" . filter_number_format($OrderLine->DiscountPercent * $OrderLine->Price * $OrderLine->QtyDispatched / $_SESSION['CurrencyRate']) . " WHERE salesanalysis.area='" . $myrow[5] . "' AND salesanalysis.salesperson='" . $myrow[8] . "' AND typeabbrev ='" . $_SESSION['Items']->DefaultSalesType . "' @@ -1233,12 +1233,12 @@ stkcategory ) SELECT '" . $_SESSION['Items']->DefaultSalesType . "', '" . $PeriodNo . "', - '" . ($OrderLine->Price * $OrderLine->QtyDispatched / $_SESSION['CurrencyRate']) . "', - '" . ($OrderLine->StandardCost * $OrderLine->QtyDispatched) . "', + '" . filter_number_format($OrderLine->Price * $OrderLine->QtyDispatched / $_SESSION['CurrencyRate']) . "', + '" . filter_number_format($OrderLine->StandardCost * $OrderLine->QtyDispatched) . "', '" . $_SESSION['Items']->DebtorNo . "', '" . $_SESSION['Items']->Branch . "', - '" . $OrderLine->QtyDispatched . "', - '" . ($OrderLine->DiscountPercent * $OrderLine->Price * $OrderLine->QtyDispatched / $_SESSION['CurrencyRate']) . "', + '" . filter_number_format($OrderLine->QtyDispatched) . "', + '" . filter_number_format($OrderLine->DiscountPercent * $OrderLine->Price * $OrderLine->QtyDispatched / $_SESSION['CurrencyRate']) . "', '" . $OrderLine->StockID . "', custbranch.area, 1, @@ -1275,7 +1275,7 @@ '" . $PeriodNo . "', '" . GetCOGSGLAccount($Area, $OrderLine->StockID, $_SESSION['Items']->DefaultSalesType, $db) . "', '" . $_SESSION['Items']->DebtorNo . " - " . $OrderLine->StockID . " x " . $OrderLine->QtyDispatched . " @ " . $OrderLine->StandardCost . "', - '" . $OrderLine->StandardCost * $OrderLine->QtyDispatched . "')"; + '" . filter_number_format($OrderLine->StandardCost * $OrderLine->QtyDispatched) . "')"; $ErrMsg = _('CRITICAL ERROR') . '! ' . _('NOTE DOWN THIS ERROR AND SEEK ASSISTANCE') . ': ' . _('The cost of sales GL posting could not be inserted because'); $DbgMsg = _('The following SQL to insert the GLTrans record was used'); @@ -1298,7 +1298,7 @@ '" . $PeriodNo . "', '" . $StockGLCode['stockact'] . "', '" . $_SESSION['Items']->DebtorNo . " - " . $OrderLine->StockID . " x " . $OrderLine->QtyDispatched . " @ " . $OrderLine->StandardCost . "', - '" . (-$OrderLine->StandardCost * $OrderLine->QtyDispatched) . "')"; + '" . filter_number_format(-$OrderLine->StandardCost * $OrderLine->QtyDispatched) . "')"; $ErrMsg = _('CRITICAL ERROR') . '! ' . _('NOTE DOWN THIS ERROR AND SEEK ASSISTANCE') . ': ' . _('The stock side of the cost of sales GL posting could not be inserted because'); $DbgMsg = _('The following SQL to insert the GLTrans record was used'); @@ -1325,7 +1325,7 @@ '" . $PeriodNo . "', '" . $SalesGLAccounts['salesglcode'] . "', '" . $_SESSION['Items']->DebtorNo . " - " . $OrderLine->StockID . " x " . $OrderLine->QtyDispatched . " @ " . $OrderLine->Price . "', - '" . (-$OrderLine->Price * $OrderLine->QtyDispatched/$_SESSION['CurrencyRate']) . "')"; + '" . filter_number_format(-$OrderLine->Price * $OrderLine->QtyDispatched/$_SESSION['CurrencyRate']) . "')"; $ErrMsg = _('CRITICAL ERROR') . '! ' . _('NOTE DOWN THIS ERROR AND SEEK ASSISTANCE') . ': ' . _('The sales GL posting could not be inserted because'); $DbgMsg = '<br />' ._('The following SQL to insert the GLTrans record was used'); @@ -1347,7 +1347,7 @@ '" . $PeriodNo . "', '" . $SalesGLAccounts['discountglcode'] . "', '" . $_SESSION['Items']->DebtorNo . " - " . $OrderLine->StockID . " @ " . ($OrderLine->DiscountPercent * 100) . "%', - '" . ($OrderLine->Price * $OrderLine->QtyDispatched * $OrderLine->DiscountPercent/$_SESSION['CurrencyRate']) . "')"; + '" . filter_number_format($OrderLine->Price * $OrderLine->QtyDispatched * $OrderLine->DiscountPercent/$_SESSION['CurrencyRate']) . "')"; $ErrMsg = _('CRITICAL ERROR') . '! ' . _('NOTE DOWN THIS ERROR AND SEEK ASSISTANCE') . ': ' . _('The sales discount GL posting could not be inserted because'); $DbgMsg = _('The following SQL to insert the GLTrans record was used'); @@ -1393,7 +1393,7 @@ '" . $PeriodNo . "', '" . $DisposalRow['accumdepnact'] . "', '" . $_SESSION['Items']->DebtorNo . ' - ' . $OrderLine->StockID . ' ' . _('disposal') . "', - '" . -$DisposalRow['accumdpen'] . "')"; + '" . filter_number_format(-$DisposalRow['accumdpen']) . "')"; $ErrMsg = _('CRITICAL ERROR') . '! ' . _('NOTE DOWN THIS ERROR AND SEEK ASSISTANCE') . ': ' . _('The reversal of accumulated depreciation GL posting on disposal could not be inserted because'); $DbgMsg = _('The following SQL to insert the GLTrans record was used'); @@ -1415,7 +1415,7 @@ '" . $PeriodNo . "', '" . $DisposalRow['costact'] . "', '" . $_SESSION['Items']->DebtorNo . " - " . $OrderLine->StockID . ' ' . _('disposal') . "', - '" . -$DisposalRow['cost'] . "')"; + '" . filter_number_format(-$DisposalRow['cost']) . "')"; $ErrMsg = _('CRITICAL ERROR') . '! ' . _('NOTE DOWN THIS ERROR AND SEEK ASSISTANCE') . ': ' . _('The reversal of asset cost on dispoal GL posting could not be inserted because'); $DbgMsg = _('The following SQL to insert the GLTrans record was used'); @@ -1437,7 +1437,7 @@ '" . $PeriodNo . "', '" . $DisposalRow['disposalact'] . "', '" . $_SESSION['Items']->DebtorNo . " - " . $OrderLine->StockID . ' ' . _('disposal') . "', - '" . ($DisposalRow['cost']-$DisposalRow['accumdepn']) . "')"; + '" . filter_number_format($DisposalRow['cost']-$DisposalRow['accumdepn']) . "')"; $ErrMsg = _('CRITICAL ERROR') . '! ' . _('NOTE DOWN THIS ERROR AND SEEK ASSISTANCE') . ': ' . _('The disposal net book value GL posting could not be inserted because'); $DbgMsg = '<br />' ._('The following SQL to insert the GLTrans record was used'); @@ -1459,7 +1459,7 @@ '" . $PeriodNo . "', '" . $DisposalRow['disposalact'] . "', '" . $_SESSION['Items']->DebtorNo . " - " . $OrderLine->StockID . ' ' . _('disposal') . "', - '" . (-$OrderLine->Price * $OrderLine->QtyDispatched* (1 - $OrderLine->DiscountPercent)/$_SESSION['CurrencyRate']) . "')"; + '" . filter_number_format(-$OrderLine->Price * $OrderLine->QtyDispatched* (1 - $OrderLine->DiscountPercent)/$_SESSION['CurrencyRate']) . "')"; $ErrMsg = _('CRITICAL ERROR') . '! ' . _('NOTE DOWN THIS ERROR AND SEEK ASSISTANCE') . ': ' . _('The disposal proceeds GL posting could not be inserted because'); $DbgMsg = '<br />' ._('The following SQL to insert the GLTrans record was used'); @@ -1487,14 +1487,14 @@ '" . $PeriodNo . "', '" . Date('Y-m-d') . "', 'disposal', - '" . ($OrderLine->Price * $OrderLine->QtyDispatched* (1 - $OrderLine->DiscountPercent)/$_SESSION['CurrencyRate']) . "', + '" . filter_number_format($OrderLine->Price * $OrderLine->QtyDispatched* (1 - $OrderLine->DiscountPercent)/$_SESSION['CurrencyRate']) . "', '" . $DefaultDispatchDate . "')"; $ErrMsg = _('CRITICAL ERROR') . '! ' . _('NOTE DOWN THIS ERROR AND SEEK ASSISTANCE') . ': ' . _('The fixed asset transaction could not be inserted because'); $DbgMsg = '<br />' ._('The following SQL to insert the fixed asset transaction record was used'); $Result = DB_query($SQL,$db,$ErrMsg,$DbgMsg,true); $SQL = "UPDATE fixedassets - SET disposalproceeds ='" . ($OrderLine->Price * $OrderLine->QtyDispatched* (1 - $OrderLine->DiscountPercent)/$_SESSION['CurrencyRate']) . "', + SET disposalproceeds ='" . filter_number_format($OrderLine->Price * $OrderLine->QtyDispatched* (1 - $OrderLine->DiscountPercent)/$_SESSION['CurrencyRate']) . "', disposaldate ='" . $DefaultDispatchDate . "' WHERE assetid ='" . $AssetNumber . "'"; @@ -1525,7 +1525,7 @@ '" . $PeriodNo . "', '" . $_SESSION['CompanyRecord']['debtorsact'] . "', '" . $_SESSION['Items']->DebtorNo . "', - '" . (($_SESSION['Items']->total + $_SESSION['Items']->FreightCost + $TaxTotal)/$_SESSION['CurrencyRate']) . "')"; + '" . filter_number_format(($_SESSION['Items']->total + $_SESSION['Items']->FreightCost + $TaxTotal)/$_SESSION['CurrencyRate']) . "')"; $ErrMsg = _('CRITICAL ERROR') . '! ' . _('NOTE DOWN THIS ERROR AND SEEK ASSISTANCE') . ': ' . _('The total debtor GL posting could not be inserted because'); $DbgMsg = _('The following SQL to insert the total debtors control GLTrans record was used'); @@ -1550,7 +1550,7 @@ '" . $PeriodNo . "', '" . $_SESSION['CompanyRecord']['freightact'] . "', '" . $_SESSION['Items']->DebtorNo . "', - '" . (-($_SESSION['Items']->FreightCost)/$_SESSION['CurrencyRate']) . "')"; + '" . filter_number_format(-($_SESSION['Items']->FreightCost)/$_SESSION['CurrencyRate']) . "')"; $ErrMsg = _('CRITICAL ERROR') . '! ' . _('NOTE DOWN THIS ERROR AND SEEK ASSISTANCE') . ': ' . _('The freight GL posting could not be inserted because'); $DbgMsg = _('The following SQL to insert the GLTrans record was used'); @@ -1572,7 +1572,7 @@ '" . $PeriodNo . "', '" . $TaxGLCodes[$TaxAuthID] . "', '" . $_SESSION['Items']->DebtorNo . "', - '" . (-$TaxAmount/$_SESSION['CurrencyRate']) . "')"; + '" . filter_number_format(-$TaxAmount/$_SESSION['CurrencyRate']) . "')"; $ErrMsg = _('CRITICAL ERROR') . '! ' . _('NOTE DOWN THIS ERROR AND SEEK ASSISTANCE') . ': ' . _('The tax GL posting could not be inserted because'); $DbgMsg = _('The following SQL to insert the GLTrans record was used'); Modified: trunk/CounterSales.php =================================================================== --- trunk/CounterSales.php 2011-09-10 04:52:21 UTC (rev 4684) +++ trunk/CounterSales.php 2011-09-11 04:06:48 UTC (rev 4685) @@ -33,10 +33,10 @@ unset($_POST['PartSearch']); } -if (isset($_POST['OrderItems'])){ - foreach ($_POST as $key => $value) { - if (mb_strstr($key,'itm')) { - $NewItemArray[mb_substr($key,3)] = trim($value); +if (isset($_POST['SelectingOrderItems'])){ + foreach ($_POST as $FormVariable => $Quantity) { + if (mb_strpos($FormVariable,'OrderQty')!==false) { + $NewItemArray[$_POST['StockID' . mb_substr($FormVariable,8)]] = filter_number_format(trim($Quantity)); } } } @@ -66,11 +66,11 @@ $_SESSION['PrintedPackingSlip'] = 0; /*Of course 'cos the order ain't even started !!*/ /*Get the default customer-branch combo from the user's default location record */ $sql = "SELECT cashsalecustomer, - cashsalebranch, - locationname, - taxprovinceid - FROM locations - WHERE loccode='" . $_SESSION['UserStockLocation'] ."'"; + cashsalebranch, + locationname, + taxprovinceid + FROM locations + WHERE loccode='" . $_SESSION['UserStockLoca... [truncated message content] |
From: <dai...@us...> - 2011-09-11 04:06:57
|
Revision: 4685 http://web-erp.svn.sourceforge.net/web-erp/?rev=4685&view=rev Author: daintree Date: 2011-09-11 04:06:48 +0000 (Sun, 11 Sep 2011) Log Message: ----------- number_formatting Modified Paths: -------------- trunk/ConfirmDispatchControlled_Invoice.php trunk/ConfirmDispatch_Invoice.php trunk/CounterSales.php trunk/Credit_Invoice.php trunk/DeliveryDetails.php trunk/OutstandingGRNs.php trunk/PDFLowGP.php trunk/SelectOrderItems.php trunk/includes/DefineCartClass.php trunk/includes/footer.inc Modified: trunk/ConfirmDispatchControlled_Invoice.php =================================================================== --- trunk/ConfirmDispatchControlled_Invoice.php 2011-09-10 04:52:21 UTC (rev 4684) +++ trunk/ConfirmDispatchControlled_Invoice.php 2011-09-11 04:06:48 UTC (rev 4685) @@ -69,7 +69,7 @@ /*TotalQuantity set inside this include file from the sum of the bundles of the item selected for dispatch */ -$_SESSION['Items']->LineItems[$LineNo]->QtyDispatched = $TotalQuantity; +$_SESSION['Items']->LineItems[$LineNo]->QtyDispatched = filter_number_format($TotalQuantity); include('includes/footer.inc'); exit; Modified: trunk/ConfirmDispatch_Invoice.php =================================================================== --- trunk/ConfirmDispatch_Invoice.php 2011-09-10 04:52:21 UTC (rev 4684) +++ trunk/ConfirmDispatch_Invoice.php 2011-09-11 04:06:48 UTC (rev 4685) @@ -208,11 +208,11 @@ $_SESSION['Items']->ShipVia = $_POST['ShipVia']; } if (isset($_POST['ChargeFreightCost'])){ - $_SESSION['Items']->FreightCost = $_POST['ChargeFreightCost']; + $_SESSION['Items']->FreightCost = filter_number_format($_POST['ChargeFreightCost']); } foreach ($_SESSION['Items']->FreightTaxes as $FreightTaxLine) { if (isset($_POST['FreightTaxRate' . $FreightTaxLine->TaxCalculationOrder])){ - $_SESSION['Items']->FreightTaxes[$FreightTaxLine->TaxCalculationOrder]->TaxRate = $_POST['FreightTaxRate' . $FreightTaxLine->TaxCalculationOrder]/100; + $_SESSION['Items']->FreightTaxes[$FreightTaxLine->TaxCalculationOrder]->TaxRate = filter_number_format($_POST['FreightTaxRate' . $FreightTaxLine->TaxCalculationOrder]/100); } } @@ -220,14 +220,14 @@ if (sizeOf($Itm->SerialItems) > 0) { $_SESSION['Items']->LineItems[$Itm->LineNumber]->QtyDispatched = 0; //initialise QtyDispatched foreach ($Itm->SerialItems as $SerialItem) { //calculate QtyDispatched from bundle quantities - $_SESSION['Items']->LineItems[$Itm->LineNumber]->QtyDispatched += $SerialItem->BundleQty; + $_SESSION['Items']->LineItems[$Itm->LineNumber]->QtyDispatched += filter_number_format($SerialItem->BundleQty); } - } else if (is_numeric($_POST[$Itm->LineNumber . '_QtyDispatched' ])AND $_POST[$Itm->LineNumber . '_QtyDispatched'] <= ($_SESSION['Items']->LineItems[$Itm->LineNumber]->Quantity - $_SESSION['Items']->LineItems[$Itm->LineNumber]->QtyInv)){ - $_SESSION['Items']->LineItems[$Itm->LineNumber]->QtyDispatched = $_POST[$Itm->LineNumber . '_QtyDispatched']; + } else if (is_numeric($_POST[$Itm->LineNumber . '_QtyDispatched' ]) AND filter_number_format($_POST[$Itm->LineNumber . '_QtyDispatched']) <= ($_SESSION['Items']->LineItems[$Itm->LineNumber]->Quantity - $_SESSION['Items']->LineItems[$Itm->LineNumber]->QtyInv)){ + $_SESSION['Items']->LineItems[$Itm->LineNumber]->QtyDispatched = filter_number_format($_POST[$Itm->LineNumber . '_QtyDispatched']); } foreach ($Itm->Taxes as $TaxLine) { if (isset($_POST[$Itm->LineNumber . $TaxLine->TaxCalculationOrder . '_TaxRate'])){ - $_SESSION['Items']->LineItems[$Itm->LineNumber]->Taxes[$TaxLine->TaxCalculationOrder]->TaxRate = $_POST[$Itm->LineNumber . $TaxLine->TaxCalculationOrder . '_TaxRate']/100; + $_SESSION['Items']->LineItems[$Itm->LineNumber]->Taxes[$TaxLine->TaxCalculationOrder]->TaxRate = filter_number_format($_POST[$Itm->LineNumber . $TaxLine->TaxCalculationOrder . '_TaxRate']/100); } } } //end foreach lineitem @@ -323,8 +323,8 @@ } } $DisplayDiscountPercent = locale_number_format($LnItm->DiscountPercent*100,2) . '%'; - $DisplayLineNetTotal = locale_number_format($LineTotal,$_SESSION['Items']->CurrDecimalPlaces); - $DisplayPrice = locale_number_format($LnItm->Price,$_SESSION['Items']->CurrDecimalPlaces); + $DisplayLineNetTotal = locale_money_format($LineTotal,$_SESSION['Items']->CurrDecimalPlaces); + $DisplayPrice = locale_money_format($LnItm->Price,$_SESSION['Items']->CurrDecimalPlaces); echo '<td class="number">'.$DisplayPrice.'</td> <td class="number">'.$DisplayDiscountPercent.'</td> <td class="number">'.$DisplayLineNetTotal.'</td>'; @@ -373,9 +373,9 @@ $TaxTotal += $TaxLineTotal; - $DisplayTaxAmount = locale_number_format($TaxLineTotal ,$_SESSION['Items']->CurrDecimalPlaces); + $DisplayTaxAmount = locale_money_format($TaxLineTotal ,$_SESSION['Items']->CurrDecimalPlaces); - $DisplayGrossLineTotal = locale_number_format($LineTotal+ $TaxLineTotal,$_SESSION['Items']->CurrDecimalPlaces); + $DisplayGrossLineTotal = locale_money_format($LineTotal+ $TaxLineTotal,$_SESSION['Items']->CurrDecimalPlaces); echo '<td class="number">'.$DisplayTaxAmount.'</td><td class="number">'.$DisplayGrossLineTotal.'</td>'; @@ -392,8 +392,8 @@ } echo '</tr>'; if (mb_strlen($LnItm->Narrative)>1){ - $narrative=str_replace('\r\n','<br />', $LnItm->Narrative); - echo $RowStarter . '<td colspan=12>' . stripslashes($narrative) . '</td></tr>'; + $Narrative=str_replace('\r\n','<br />', $LnItm->Narrative); + echo $RowStarter . '<td colspan=12>' . stripslashes($Narrative) . '</td></tr>'; } }//end foreach ($line) @@ -511,13 +511,13 @@ } echo '</td>'; -echo '<td class="number">' . locale_number_format($FreightTaxTotal,$_SESSION['Items']->CurrDecimalPlaces) . '</td> - <td class="number">' . locale_number_format($FreightTaxTotal+ $_POST['ChargeFreightCost'],$_SESSION['Items']->CurrDecimalPlaces) . '</td> +echo '<td class="number">' . locale_money_format($FreightTaxTotal,$_SESSION['Items']->CurrDecimalPlaces) . '</td> + <td class="number">' . locale_money_format($FreightTaxTotal+ $_POST['ChargeFreightCost'],$_SESSION['Items']->CurrDecimalPlaces) . '</td> </tr>'; $TaxTotal += $FreightTaxTotal; -$DisplaySubTotal = locale_number_format(($_SESSION['Items']->total + $_POST['ChargeFreightCost']),$_SESSION['Items']->CurrDecimalPlaces); +$DisplaySubTotal = locale_money_format(($_SESSION['Items']->total + $_POST['ChargeFreightCost']),$_SESSION['Items']->CurrDecimalPlaces); /* round the totals to avoid silly entries */ @@ -529,8 +529,8 @@ <td colspan="10" class="number">' . _('Invoice Totals'). '</td> <td class="number:><hr><b>'.$DisplaySubTotal.'</b><hr></td> <td colspan="2"></td> - <td class="number"><hr><b>' . locale_number_format($TaxTotal,$_SESSION['Items']->CurrDecimalPlaces) . '</b><hr></td> - <td class="number"><hr><b>' . locale_number_format($TaxTotal+($_SESSION['Items']->total + $_POST['ChargeFreightCost']),$_SESSION['Items']->CurrDecimalPlaces) . '</b><hr></td> + <td class="number"><hr><b>' . locale_money_format($TaxTotal,$_SESSION['Items']->CurrDecimalPlaces) . '</b><hr></td> + <td class="number"><hr><b>' . locale_money_format($TaxTotal+($_SESSION['Items']->total + $_POST['ChargeFreightCost']),$_SESSION['Items']->CurrDecimalPlaces) . '</b><hr></td> </tr>'; if (! isset($_POST['DispatchDate']) OR ! Is_Date($_POST['DispatchDate'])){ @@ -587,7 +587,7 @@ /*Now look for assembly components that would go negative */ $SQL = "SELECT bom.component, stockmaster.description, - locstock.quantity-(" . $OrderLine->QtyDispatched . "*bom.quantity) AS qtyleft + locstock.quantity-(" . filter_number_format($OrderLine->QtyDispatched) . "*bom.quantity) AS qtyleft FROM bom INNER JOIN locstock ON bom.component=locstock.stockid @@ -763,13 +763,13 @@ '', '" . $_SESSION['Items']->DefaultSalesType . "', '" . $_SESSION['ProcessingOrder'] . "', - '" . $_SESSION['Items']->total . "', - '" . $TaxTotal . "', - '" . $_POST['ChargeFreightCost'] . "', - '" . $_SESSION['CurrencyRate'] . "', - '" . $_POST['InvoiceText'] . "', + '" . filter_number_format($_SESSION['Items']->total) . "', + '" . filter_number_format($TaxTotal) . "', + '" . filter_number_format($_POST['ChargeFreightCost']) . "', + '" . filter_number_format($_SESSION['CurrencyRate']) . "', + '" . DB_escape_string($_POST['InvoiceText']) . "', '" . $_SESSION['Items']->ShipVia . "', - '" . $_POST['Consignment'] . "' )"; + '" . DB_escape_string($_POST['Consignment']) . "' )"; $ErrMsg =_('CRITICAL ERROR') . '! ' . _('NOTE DOWN THIS ERROR AND SEEK ASSISTANCE') . ': ' . _('The debtor transaction record could not be inserted because'); $DbgMsg = _('The following SQL to insert the debtor transaction record was used'); @@ -785,7 +785,7 @@ taxamount) VALUES ('" . $DebtorTransID . "', '" . $TaxAuthID . "', - '" . $TaxAmount/$_SESSION['CurrencyRate'] . "')"; + '" . filter_number_format($TaxAmount/$_SESSION['CurrencyRate']) . "')"; $ErrMsg =_('CRITICAL ERROR') . '! ' . _('NOTE DOWN THIS ERROR AND SEEK ASSISTANCE') . ': ' . _('The debtor transaction taxes records could not be inserted because'); $DbgMsg = _('The following SQL to insert the debtor transaction taxes record was used'); @@ -815,7 +815,7 @@ if ($_POST['BOPolicy']=='CAN'){ $SQL = "UPDATE salesorderdetails - SET quantity = quantity - " . ($OrderLine->Quantity - $OrderLine->QtyDispatched) . " + SET quantity = quantity - " . filter_number_format($OrderLine->Quantity - $OrderLine->QtyDispatched) . " WHERE orderno = '" . $_SESSION['ProcessingOrder'] . " ' AND stkcode = '" . $OrderLine->StockID . "'"; @@ -837,7 +837,7 @@ '" . $_SESSION['ProcessingOrder'] . "', '" . $InvoiceNo . "', '" . $OrderLine->StockID . "', - '" . ($OrderLine->Quantity - $OrderLine->QtyDispatched) . "', + '" . filter_number_format($OrderLine->Quantity - $OrderLine->QtyDispatched) . "', '" . $_SESSION['Items']->DebtorNo . "', '" . $_SESSION['Items']->Branch . "', 'CAN')"; @@ -849,7 +849,7 @@ - } elseif (($OrderLine->Quantity - $OrderLine->QtyDispatched) >0 && DateDiff(ConvertSQLDate($DefaultDispatchDate),$_SESSION['Items']->DeliveryDate,'d') >0) { + } elseif (($OrderLine->Quantity - $OrderLine->QtyDispatched) >0 AND DateDiff(ConvertSQLDate($DefaultDispatchDate),$_SESSION['Items']->DeliveryDate,'d') > 0) { /*The order is being short delivered after the due date - need to insert a delivery differnce log */ @@ -865,7 +865,7 @@ '" . $_SESSION['ProcessingOrder'] . "', '" . $InvoiceNo . "', '" . $OrderLine->StockID . "', - '" . ($OrderLine->Quantity - $OrderLine->QtyDispatched) . "', + '" . filter_number_format($OrderLine->Quantity - $OrderLine->QtyDispatched) . "', '" . $_SESSION['Items']->DebtorNo . "', '" . $_SESSION['Items']->Branch . "', 'BO' @@ -883,14 +883,14 @@ // Test above to see if the line is completed or not if ($OrderLine->QtyDispatched>=($OrderLine->Quantity - $OrderLine->QtyInv) OR $_POST['BOPolicy']=='CAN'){ $SQL = "UPDATE salesorderdetails - SET qtyinvoiced = qtyinvoiced + " . $OrderLine->QtyDispatched . ", + SET qtyinvoiced = qtyinvoiced + " . filter_number_format($OrderLine->QtyDispatched) . ", actualdispatchdate = '" . $DefaultDispatchDate . "', completed=1 WHERE orderno = '" . $_SESSION['ProcessingOrder'] . "' AND orderlineno = '" . $OrderLine->LineNumber . "'"; } else { $SQL = "UPDATE salesorderdetails - SET qtyinvoiced = qtyinvoiced + " . $OrderLine->QtyDispatched . ", + SET qtyinvoiced = qtyinvoiced + " . filter_number_format($OrderLine->QtyDispatched) . ", actualdispatchdate = '" . $DefaultDispatchDate . "' WHERE orderno = '" . $_SESSION['ProcessingOrder'] . "' AND orderlineno = '" . $OrderLine->LineNumber . "'"; @@ -930,7 +930,7 @@ $QtyOnHandPrior = 0; } - $SQL = "UPDATE locstock SET quantity = locstock.quantity - " . $OrderLine->QtyDispatched . " + $SQL = "UPDATE locstock SET quantity = locstock.quantity - " . filter_number_format($OrderLine->QtyDispatched) . " WHERE locstock.stockid = '" . $OrderLine->StockID . "' AND loccode = '" . $_SESSION['Items']->Location . "'"; @@ -1002,10 +1002,10 @@ '" . $_SESSION['Items']->Branch . "', '" . $PeriodNo . "', '" . _('Assembly') . ': ' . $OrderLine->StockID . ' ' . _('Order') . ': ' . $_SESSION['ProcessingOrder'] . "', - '" . -$AssParts['quantity'] * $OrderLine->QtyDispatched . "', + '" . filter_number_format(-$AssParts['quantity'] * $OrderLine->QtyDispatched) . "', '" . $AssParts['standard'] . "', 0, - '" . ($QtyOnHandPrior - $AssParts['quantity'] * $OrderLine->QtyDispatched) . "' )"; + '" . filter_number_format($QtyOnHandPrior - $AssParts['quantity'] * $OrderLine->QtyDispatched) . "' )"; $ErrMsg = _('CRITICAL ERROR') . '! ' . _('NOTE DOWN THIS ERROR AND SEEK ASSISTANCE') . ': ' . _('Stock movement records for the assembly components of'). ' '. $OrderLine->StockID . ' ' . _('could not be inserted because'); $DbgMsg = _('The following SQL to insert the assembly components stock movement records was used'); @@ -1013,7 +1013,7 @@ $SQL = "UPDATE locstock - SET quantity = locstock.quantity - " . $AssParts['quantity'] * $OrderLine->QtyDispatched . " + SET quantity = locstock.quantity - " . filter_number_format($AssParts['quantity'] * $OrderLine->QtyDispatched) . " WHERE locstock.stockid = '" . $AssParts['component'] . "' AND loccode = '" . $_SESSION['Items']->Location . "'"; @@ -1028,7 +1028,7 @@ } /* end of its an assembly */ // Insert stock movements - with unit cost - $LocalCurrencyPrice= ($OrderLine->Price / $_SESSION['CurrencyRate']); + $LocalCurrencyPrice = ($OrderLine->Price / $_SESSION['CurrencyRate']); if (empty($OrderLine->StandardCost)) { $OrderLine->StandardCost=0; @@ -1056,13 +1056,13 @@ '" . $DefaultDispatchDate . "', '" . $_SESSION['Items']->DebtorNo . "', '" . $_SESSION['Items']->Branch . "', - '" . $LocalCurrencyPrice . "', + '" . filter_number_format($LocalCurrencyPrice) . "', '" . $PeriodNo . "', '" . $_SESSION['ProcessingOrder'] . "', - '" . -$OrderLine->QtyDispatched . "', - '" . $OrderLine->DiscountPercent . "', - '" . $OrderLine->StandardCost . "', - '" . ($QtyOnHandPrior - $OrderLine->QtyDispatched) . "', + '" . filter_number_format(-$OrderLine->QtyDispatched) . "', + '" . filter_number_format($OrderLine->DiscountPercent) . "', + '" . filter_number_format($OrderLine->StandardCost) . "', + '" . filter_number_format($QtyOnHandPrior - $OrderLine->QtyDispatched) . "', '" . DB_escape_string($OrderLine->Narrative) . "' )"; } else { // its an assembly or dummy and assemblies/dummies always have nil stock (by definition they are made up at the time of dispatch so new qty on hand will be nil @@ -1090,12 +1090,12 @@ '" . $DefaultDispatchDate . "', '" . $_SESSION['Items']->DebtorNo . "', '" . $_SESSION['Items']->Branch . "', - '" . $LocalCurrencyPrice . "', + '" . filter_number_format($LocalCurrencyPrice) . "', '" . $PeriodNo . "', '" . $_SESSION['ProcessingOrder'] . "', - '" . -$OrderLine->QtyDispatched . "', - '" . $OrderLine->DiscountPercent . "', - '" . $OrderLine->StandardCost . "', + '" . filter_number_format(-$OrderLine->QtyDispatched) . "', + '" . filter_number_format($OrderLine->DiscountPercent) . "', + '" . filter_number_format($OrderLine->StandardCost) . "', '" . DB_escape_string($OrderLine->Narrative) . "')"; } @@ -1117,7 +1117,7 @@ taxontax) VALUES ('" . $StkMoveNo . "', '" . $Tax->TaxAuthID . "', - '" . $Tax->TaxRate . "', + '" . filter_number_format($Tax->TaxRate) . "', '" . $Tax->TaxCalculationOrder . "', '" . $Tax->TaxOnTax . "')"; @@ -1133,10 +1133,10 @@ foreach($OrderLine->SerialItems as $Item){ /*We need to add the StockSerialItem record and the StockSerialMoves as well */ - $SQL = "UPDATE stockserialitems SET quantity= quantity - " . $Item->BundleQty . " + $SQL = "UPDATE stockserialitems SET quantity= quantity - " . filter_number_format($Item->BundleQty) . " WHERE stockid='" . $OrderLine->StockID . "' AND loccode='" . $_SESSION['Items']->Location . "' - AND serialno='" . $Item->BundleRef . "'"; + AND serialno='" . DB_escape_string($Item->BundleRef) . "'"; $ErrMsg = _('CRITICAL ERROR') . '! ' . _('NOTE DOWN THIS ERROR AND SEEK ASSISTANCE') . ': ' . _('The serial stock item record could not be updated because'); $DbgMsg = _('The following SQL to update the serial stock item record was used'); @@ -1150,8 +1150,8 @@ moveqty) VALUES ('" . $StkMoveNo . "', '" . $OrderLine->StockID . "', - '" . $Item->BundleRef . "', - '" . -$Item->BundleQty . "')"; + '" . DB_escape_string($Item->BundleRef) . "', + '" . filter_number_format(-$Item->BundleQty) . "')"; $ErrMsg = _('CRITICAL ERROR') . '! ' . _('NOTE DOWN THIS ERROR AND SEEK ASSISTANCE') . ': ' . _('The serial stock movement record could not be inserted because'); $DbgMsg = _('The following SQL to insert the serial stock movement records was used'); @@ -1202,10 +1202,10 @@ if ($myrow[0]>0){ /*Update the existing record that already exists */ - $SQL = "UPDATE salesanalysis SET amt=amt+" . ($OrderLine->Price * $OrderLine->QtyDispatched / $_SESSION['CurrencyRate']) . ", - cost=cost+" . ($OrderLine->StandardCost * $OrderLine->QtyDispatched) . ", - qty=qty +" . $OrderLine->QtyDispatched . ", - disc=disc+" . ($OrderLine->DiscountPercent * $OrderLine->Price * $OrderLine->QtyDispatched / $_SESSION['CurrencyRate']) . " + $SQL = "UPDATE salesanalysis SET amt=amt+" . filter_number_format($OrderLine->Price * $OrderLine->QtyDispatched / $_SESSION['CurrencyRate']) . ", + cost=cost+" . filter_number_format($OrderLine->StandardCost * $OrderLine->QtyDispatched) . ", + qty=qty +" . filter_number_format($OrderLine->QtyDispatched) . ", + disc=disc+" . filter_number_format($OrderLine->DiscountPercent * $OrderLine->Price * $OrderLine->QtyDispatched / $_SESSION['CurrencyRate']) . " WHERE salesanalysis.area='" . $myrow[5] . "' AND salesanalysis.salesperson='" . $myrow[8] . "' AND typeabbrev ='" . $_SESSION['Items']->DefaultSalesType . "' @@ -1233,12 +1233,12 @@ stkcategory ) SELECT '" . $_SESSION['Items']->DefaultSalesType . "', '" . $PeriodNo . "', - '" . ($OrderLine->Price * $OrderLine->QtyDispatched / $_SESSION['CurrencyRate']) . "', - '" . ($OrderLine->StandardCost * $OrderLine->QtyDispatched) . "', + '" . filter_number_format($OrderLine->Price * $OrderLine->QtyDispatched / $_SESSION['CurrencyRate']) . "', + '" . filter_number_format($OrderLine->StandardCost * $OrderLine->QtyDispatched) . "', '" . $_SESSION['Items']->DebtorNo . "', '" . $_SESSION['Items']->Branch . "', - '" . $OrderLine->QtyDispatched . "', - '" . ($OrderLine->DiscountPercent * $OrderLine->Price * $OrderLine->QtyDispatched / $_SESSION['CurrencyRate']) . "', + '" . filter_number_format($OrderLine->QtyDispatched) . "', + '" . filter_number_format($OrderLine->DiscountPercent * $OrderLine->Price * $OrderLine->QtyDispatched / $_SESSION['CurrencyRate']) . "', '" . $OrderLine->StockID . "', custbranch.area, 1, @@ -1275,7 +1275,7 @@ '" . $PeriodNo . "', '" . GetCOGSGLAccount($Area, $OrderLine->StockID, $_SESSION['Items']->DefaultSalesType, $db) . "', '" . $_SESSION['Items']->DebtorNo . " - " . $OrderLine->StockID . " x " . $OrderLine->QtyDispatched . " @ " . $OrderLine->StandardCost . "', - '" . $OrderLine->StandardCost * $OrderLine->QtyDispatched . "')"; + '" . filter_number_format($OrderLine->StandardCost * $OrderLine->QtyDispatched) . "')"; $ErrMsg = _('CRITICAL ERROR') . '! ' . _('NOTE DOWN THIS ERROR AND SEEK ASSISTANCE') . ': ' . _('The cost of sales GL posting could not be inserted because'); $DbgMsg = _('The following SQL to insert the GLTrans record was used'); @@ -1298,7 +1298,7 @@ '" . $PeriodNo . "', '" . $StockGLCode['stockact'] . "', '" . $_SESSION['Items']->DebtorNo . " - " . $OrderLine->StockID . " x " . $OrderLine->QtyDispatched . " @ " . $OrderLine->StandardCost . "', - '" . (-$OrderLine->StandardCost * $OrderLine->QtyDispatched) . "')"; + '" . filter_number_format(-$OrderLine->StandardCost * $OrderLine->QtyDispatched) . "')"; $ErrMsg = _('CRITICAL ERROR') . '! ' . _('NOTE DOWN THIS ERROR AND SEEK ASSISTANCE') . ': ' . _('The stock side of the cost of sales GL posting could not be inserted because'); $DbgMsg = _('The following SQL to insert the GLTrans record was used'); @@ -1325,7 +1325,7 @@ '" . $PeriodNo . "', '" . $SalesGLAccounts['salesglcode'] . "', '" . $_SESSION['Items']->DebtorNo . " - " . $OrderLine->StockID . " x " . $OrderLine->QtyDispatched . " @ " . $OrderLine->Price . "', - '" . (-$OrderLine->Price * $OrderLine->QtyDispatched/$_SESSION['CurrencyRate']) . "')"; + '" . filter_number_format(-$OrderLine->Price * $OrderLine->QtyDispatched/$_SESSION['CurrencyRate']) . "')"; $ErrMsg = _('CRITICAL ERROR') . '! ' . _('NOTE DOWN THIS ERROR AND SEEK ASSISTANCE') . ': ' . _('The sales GL posting could not be inserted because'); $DbgMsg = '<br />' ._('The following SQL to insert the GLTrans record was used'); @@ -1347,7 +1347,7 @@ '" . $PeriodNo . "', '" . $SalesGLAccounts['discountglcode'] . "', '" . $_SESSION['Items']->DebtorNo . " - " . $OrderLine->StockID . " @ " . ($OrderLine->DiscountPercent * 100) . "%', - '" . ($OrderLine->Price * $OrderLine->QtyDispatched * $OrderLine->DiscountPercent/$_SESSION['CurrencyRate']) . "')"; + '" . filter_number_format($OrderLine->Price * $OrderLine->QtyDispatched * $OrderLine->DiscountPercent/$_SESSION['CurrencyRate']) . "')"; $ErrMsg = _('CRITICAL ERROR') . '! ' . _('NOTE DOWN THIS ERROR AND SEEK ASSISTANCE') . ': ' . _('The sales discount GL posting could not be inserted because'); $DbgMsg = _('The following SQL to insert the GLTrans record was used'); @@ -1393,7 +1393,7 @@ '" . $PeriodNo . "', '" . $DisposalRow['accumdepnact'] . "', '" . $_SESSION['Items']->DebtorNo . ' - ' . $OrderLine->StockID . ' ' . _('disposal') . "', - '" . -$DisposalRow['accumdpen'] . "')"; + '" . filter_number_format(-$DisposalRow['accumdpen']) . "')"; $ErrMsg = _('CRITICAL ERROR') . '! ' . _('NOTE DOWN THIS ERROR AND SEEK ASSISTANCE') . ': ' . _('The reversal of accumulated depreciation GL posting on disposal could not be inserted because'); $DbgMsg = _('The following SQL to insert the GLTrans record was used'); @@ -1415,7 +1415,7 @@ '" . $PeriodNo . "', '" . $DisposalRow['costact'] . "', '" . $_SESSION['Items']->DebtorNo . " - " . $OrderLine->StockID . ' ' . _('disposal') . "', - '" . -$DisposalRow['cost'] . "')"; + '" . filter_number_format(-$DisposalRow['cost']) . "')"; $ErrMsg = _('CRITICAL ERROR') . '! ' . _('NOTE DOWN THIS ERROR AND SEEK ASSISTANCE') . ': ' . _('The reversal of asset cost on dispoal GL posting could not be inserted because'); $DbgMsg = _('The following SQL to insert the GLTrans record was used'); @@ -1437,7 +1437,7 @@ '" . $PeriodNo . "', '" . $DisposalRow['disposalact'] . "', '" . $_SESSION['Items']->DebtorNo . " - " . $OrderLine->StockID . ' ' . _('disposal') . "', - '" . ($DisposalRow['cost']-$DisposalRow['accumdepn']) . "')"; + '" . filter_number_format($DisposalRow['cost']-$DisposalRow['accumdepn']) . "')"; $ErrMsg = _('CRITICAL ERROR') . '! ' . _('NOTE DOWN THIS ERROR AND SEEK ASSISTANCE') . ': ' . _('The disposal net book value GL posting could not be inserted because'); $DbgMsg = '<br />' ._('The following SQL to insert the GLTrans record was used'); @@ -1459,7 +1459,7 @@ '" . $PeriodNo . "', '" . $DisposalRow['disposalact'] . "', '" . $_SESSION['Items']->DebtorNo . " - " . $OrderLine->StockID . ' ' . _('disposal') . "', - '" . (-$OrderLine->Price * $OrderLine->QtyDispatched* (1 - $OrderLine->DiscountPercent)/$_SESSION['CurrencyRate']) . "')"; + '" . filter_number_format(-$OrderLine->Price * $OrderLine->QtyDispatched* (1 - $OrderLine->DiscountPercent)/$_SESSION['CurrencyRate']) . "')"; $ErrMsg = _('CRITICAL ERROR') . '! ' . _('NOTE DOWN THIS ERROR AND SEEK ASSISTANCE') . ': ' . _('The disposal proceeds GL posting could not be inserted because'); $DbgMsg = '<br />' ._('The following SQL to insert the GLTrans record was used'); @@ -1487,14 +1487,14 @@ '" . $PeriodNo . "', '" . Date('Y-m-d') . "', 'disposal', - '" . ($OrderLine->Price * $OrderLine->QtyDispatched* (1 - $OrderLine->DiscountPercent)/$_SESSION['CurrencyRate']) . "', + '" . filter_number_format($OrderLine->Price * $OrderLine->QtyDispatched* (1 - $OrderLine->DiscountPercent)/$_SESSION['CurrencyRate']) . "', '" . $DefaultDispatchDate . "')"; $ErrMsg = _('CRITICAL ERROR') . '! ' . _('NOTE DOWN THIS ERROR AND SEEK ASSISTANCE') . ': ' . _('The fixed asset transaction could not be inserted because'); $DbgMsg = '<br />' ._('The following SQL to insert the fixed asset transaction record was used'); $Result = DB_query($SQL,$db,$ErrMsg,$DbgMsg,true); $SQL = "UPDATE fixedassets - SET disposalproceeds ='" . ($OrderLine->Price * $OrderLine->QtyDispatched* (1 - $OrderLine->DiscountPercent)/$_SESSION['CurrencyRate']) . "', + SET disposalproceeds ='" . filter_number_format($OrderLine->Price * $OrderLine->QtyDispatched* (1 - $OrderLine->DiscountPercent)/$_SESSION['CurrencyRate']) . "', disposaldate ='" . $DefaultDispatchDate . "' WHERE assetid ='" . $AssetNumber . "'"; @@ -1525,7 +1525,7 @@ '" . $PeriodNo . "', '" . $_SESSION['CompanyRecord']['debtorsact'] . "', '" . $_SESSION['Items']->DebtorNo . "', - '" . (($_SESSION['Items']->total + $_SESSION['Items']->FreightCost + $TaxTotal)/$_SESSION['CurrencyRate']) . "')"; + '" . filter_number_format(($_SESSION['Items']->total + $_SESSION['Items']->FreightCost + $TaxTotal)/$_SESSION['CurrencyRate']) . "')"; $ErrMsg = _('CRITICAL ERROR') . '! ' . _('NOTE DOWN THIS ERROR AND SEEK ASSISTANCE') . ': ' . _('The total debtor GL posting could not be inserted because'); $DbgMsg = _('The following SQL to insert the total debtors control GLTrans record was used'); @@ -1550,7 +1550,7 @@ '" . $PeriodNo . "', '" . $_SESSION['CompanyRecord']['freightact'] . "', '" . $_SESSION['Items']->DebtorNo . "', - '" . (-($_SESSION['Items']->FreightCost)/$_SESSION['CurrencyRate']) . "')"; + '" . filter_number_format(-($_SESSION['Items']->FreightCost)/$_SESSION['CurrencyRate']) . "')"; $ErrMsg = _('CRITICAL ERROR') . '! ' . _('NOTE DOWN THIS ERROR AND SEEK ASSISTANCE') . ': ' . _('The freight GL posting could not be inserted because'); $DbgMsg = _('The following SQL to insert the GLTrans record was used'); @@ -1572,7 +1572,7 @@ '" . $PeriodNo . "', '" . $TaxGLCodes[$TaxAuthID] . "', '" . $_SESSION['Items']->DebtorNo . "', - '" . (-$TaxAmount/$_SESSION['CurrencyRate']) . "')"; + '" . filter_number_format(-$TaxAmount/$_SESSION['CurrencyRate']) . "')"; $ErrMsg = _('CRITICAL ERROR') . '! ' . _('NOTE DOWN THIS ERROR AND SEEK ASSISTANCE') . ': ' . _('The tax GL posting could not be inserted because'); $DbgMsg = _('The following SQL to insert the GLTrans record was used'); Modified: trunk/CounterSales.php =================================================================== --- trunk/CounterSales.php 2011-09-10 04:52:21 UTC (rev 4684) +++ trunk/CounterSales.php 2011-09-11 04:06:48 UTC (rev 4685) @@ -33,10 +33,10 @@ unset($_POST['PartSearch']); } -if (isset($_POST['OrderItems'])){ - foreach ($_POST as $key => $value) { - if (mb_strstr($key,'itm')) { - $NewItemArray[mb_substr($key,3)] = trim($value); +if (isset($_POST['SelectingOrderItems'])){ + foreach ($_POST as $FormVariable => $Quantity) { + if (mb_strpos($FormVariable,'OrderQty')!==false) { + $NewItemArray[$_POST['StockID' . mb_substr($FormVariable,8)]] = filter_number_format(trim($Quantity)); } } } @@ -66,11 +66,11 @@ $_SESSION['PrintedPackingSlip'] = 0; /*Of course 'cos the order ain't even started !!*/ /*Get the default customer-branch combo from the user's default location record */ $sql = "SELECT cashsalecustomer, - cashsalebranch, - locationname, - taxprovinceid - FROM locations - WHERE loccode='" . $_SESSION['UserStockLocation'] ."'"; + cashsalebranch, + locationname, + taxprovinceid + FROM locations + WHERE loccode='" . $_SESSION['UserStockLoca... [truncated message content] |
From: <dai...@us...> - 2011-09-12 08:03:30
|
Revision: 4686 http://web-erp.svn.sourceforge.net/web-erp/?rev=4686&view=rev Author: daintree Date: 2011-09-12 08:03:20 +0000 (Mon, 12 Sep 2011) Log Message: ----------- number_formatting Modified Paths: -------------- trunk/PDFBankingSummary.php trunk/PDFChequeListing.php trunk/PDFCustTransListing.php trunk/PDFCustomerList.php trunk/PDFDIFOT.php trunk/PcAuthorizeExpenses.php trunk/PcClaimExpensesFromTab.php trunk/PcExpenses.php trunk/PcExpensesTypeTab.php trunk/PcReportTab.php trunk/PcTabs.php trunk/StockLocTransferReceive.php trunk/doc/Change.log trunk/includes/LanguageSetup.php trunk/includes/MiscFunctions.php trunk/locale/cs_CZ.utf8/LC_MESSAGES/messages.mo trunk/locale/cs_CZ.utf8/LC_MESSAGES/messages.po trunk/locale/de_DE.utf8/LC_MESSAGES/messages.mo trunk/locale/de_DE.utf8/LC_MESSAGES/messages.po trunk/locale/el_GR.utf8/LC_MESSAGES/messages.mo trunk/locale/el_GR.utf8/LC_MESSAGES/messages.po trunk/locale/en_GB.utf8/LC_MESSAGES/messages.pot trunk/locale/en_US.utf8/LC_MESSAGES/messages.mo trunk/locale/en_US.utf8/LC_MESSAGES/messages.po trunk/locale/es_ES.utf8/LC_MESSAGES/messages.mo trunk/locale/es_ES.utf8/LC_MESSAGES/messages.po trunk/locale/et_EE.utf8/LC_MESSAGES/messages.mo trunk/locale/et_EE.utf8/LC_MESSAGES/messages.po trunk/locale/fa_IR.utf8/LC_MESSAGES/messages.mo trunk/locale/fa_IR.utf8/LC_MESSAGES/messages.po trunk/locale/fr_FR.utf8/LC_MESSAGES/messages.mo trunk/locale/fr_FR.utf8/LC_MESSAGES/messages.po trunk/locale/hi_IN.utf8/LC_MESSAGES/messages.mo trunk/locale/hi_IN.utf8/LC_MESSAGES/messages.po trunk/locale/hr_HR.utf8/LC_MESSAGES/messages.mo trunk/locale/hr_HR.utf8/LC_MESSAGES/messages.po trunk/locale/hu_HU.utf8/LC_MESSAGES/messages.mo trunk/locale/hu_HU.utf8/LC_MESSAGES/messages.po trunk/locale/id_ID.utf8/LC_MESSAGES/messages.mo trunk/locale/id_ID.utf8/LC_MESSAGES/messages.po trunk/locale/it_IT.utf8/LC_MESSAGES/messages.mo trunk/locale/it_IT.utf8/LC_MESSAGES/messages.po trunk/locale/ja_JP.utf8/LC_MESSAGES/messages.mo trunk/locale/ja_JP.utf8/LC_MESSAGES/messages.po trunk/locale/lv_LV.utf8/LC_MESSAGES/messages.mo trunk/locale/lv_LV.utf8/LC_MESSAGES/messages.po trunk/locale/nl_NL.utf8/LC_MESSAGES/messages.mo trunk/locale/nl_NL.utf8/LC_MESSAGES/messages.po trunk/locale/pl_PL.utf8/LC_MESSAGES/messages.mo trunk/locale/pl_PL.utf8/LC_MESSAGES/messages.po trunk/locale/pt_BR.utf8/LC_MESSAGES/messages.mo trunk/locale/pt_BR.utf8/LC_MESSAGES/messages.po trunk/locale/pt_PT.utf8/LC_MESSAGES/messages.mo trunk/locale/pt_PT.utf8/LC_MESSAGES/messages.po trunk/locale/ro_RO.utf8/LC_MESSAGES/messages.mo trunk/locale/ro_RO.utf8/LC_MESSAGES/messages.po trunk/locale/ru_RU.utf8/LC_MESSAGES/messages.mo trunk/locale/ru_RU.utf8/LC_MESSAGES/messages.po trunk/locale/sq_AL.utf8/LC_MESSAGES/messages.mo trunk/locale/sq_AL.utf8/LC_MESSAGES/messages.po trunk/locale/sv_SE.utf8/LC_MESSAGES/messages.mo trunk/locale/sv_SE.utf8/LC_MESSAGES/messages.po trunk/locale/sw_KE.utf8/LC_MESSAGES/messages.mo trunk/locale/sw_KE.utf8/LC_MESSAGES/messages.po trunk/locale/tr_TR.utf8/LC_MESSAGES/messages.mo trunk/locale/tr_TR.utf8/LC_MESSAGES/messages.po trunk/locale/vi_VN.utf8/LC_MESSAGES/messages.mo trunk/locale/vi_VN.utf8/LC_MESSAGES/messages.po trunk/locale/zh_CN.utf8/LC_MESSAGES/messages.mo trunk/locale/zh_CN.utf8/LC_MESSAGES/messages.po trunk/locale/zh_HK.utf8/LC_MESSAGES/messages.mo trunk/locale/zh_HK.utf8/LC_MESSAGES/messages.po trunk/sql/mysql/weberp-demo.sql trunk/sql/mysql/weberp-new.sql Modified: trunk/PDFBankingSummary.php =================================================================== --- trunk/PDFBankingSummary.php 2011-09-11 04:06:48 UTC (rev 4685) +++ trunk/PDFBankingSummary.php 2011-09-12 08:03:20 UTC (rev 4686) @@ -48,11 +48,13 @@ bankact, banktrans.exrate, banktrans.functionalexrate, - banktrans.currcode - FROM bankaccounts, - banktrans - WHERE bankaccounts.accountcode=banktrans.bankact - AND banktrans.transno='" . $_POST['BatchNo'] . "' + banktrans.currcode, + currencies.decimalplaces AS currdecimalplaces + FROM bankaccounts INNER JOIN banktrans + ON bankaccounts.accountcode=banktrans.bankact + INNER JOIN currencies + ON bankaccounts.currcode=currencies.currabrev + WHERE banktrans.transno='" . $_POST['BatchNo'] . "' AND banktrans.type=12"; $ErrMsg = _('An error occurred getting the header information about the receipt batch number') . ' ' . $_POST['BatchNo']; @@ -76,8 +78,8 @@ $BankActName = $myrow['bankaccountname']; $BankActNumber = $myrow['bankaccountnumber']; $BankingReference = $myrow['ref']; - - + $BankCurrDecimalPlaces = $myrow['currdecimalplaces']; + $SQL = "SELECT debtorsmaster.name, ovamount, invtext, @@ -117,30 +119,30 @@ include('includes/footer.inc'); exit; } - - + + include('includes/PDFStarter.php'); - + /*PDFStarter.php has all the variables for page size and width set up depending on the users default preferences for paper size */ - + $pdf->addInfo('Title',_('Banking Summary')); $pdf->addInfo('Subject',_('Banking Summary Number') . ' ' . $_POST['BatchNo']); $line_height=12; $PageNumber = 0; $TotalBanked = 0; - + include ('includes/PDFBankingSummaryPageHeader.inc'); - + while ($myrow=DB_fetch_array($CustRecs)){ - - $LeftOvers = $pdf->addTextWrap($Left_Margin,$YPos,60,$FontSize,locale_number_format(-$myrow['ovamount'],2), 'right'); + + $LeftOvers = $pdf->addTextWrap($Left_Margin,$YPos,60,$FontSize,locale_money_format(-$myrow['ovamount'],$BankCurrDecimalPlaces), 'right'); $LeftOvers = $pdf->addTextWrap($Left_Margin+65,$YPos,150,$FontSize,$myrow['name'], 'left'); $LeftOvers = $pdf->addTextWrap($Left_Margin+215,$YPos,100,$FontSize,$myrow['invtext'], 'left'); $LeftOvers = $pdf->addTextWrap($Left_Margin+315,$YPos,100,$FontSize,$myrow['reference'], 'left'); - + $YPos -= ($line_height); $TotalBanked -= $myrow['ovamount']; - + if ($YPos - (2 *$line_height) < $Bottom_Margin){ /*Then set up a new page */ include ('includes/PDFBankingSummaryPageHeader.inc'); @@ -150,24 +152,24 @@ /* Right now print out the GL receipt entries in the batch */ while ($myrow=DB_fetch_array($GLRecs)){ - $LeftOvers = $pdf->addTextWrap($Left_Margin,$YPos,60,$FontSize,locale_number_format((-$myrow['amount']*$ExRate*$FunctionalExRate),2), 'right'); + $LeftOvers = $pdf->addTextWrap($Left_Margin,$YPos,60,$FontSize,locale_money_format((-$myrow['amount']*$ExRate*$FunctionalExRate),$BankCurrDecimalPlaces), 'right'); $LeftOvers = $pdf->addTextWrap($Left_Margin+65,$YPos,300,$FontSize,$myrow['narrative'], 'left'); $YPos -= ($line_height); $TotalBanked += (-$myrow['amount']*$ExRate); - + if ($YPos - (2 *$line_height) < $Bottom_Margin){ /*Then set up a new page */ include ('includes/PDFBankingSummaryPageHeader.inc'); } /*end of new page header */ } /* end of while there are GL receipts in the batch to print */ - - + + $YPos-=$line_height; $LeftOvers = $pdf->addTextWrap($Left_Margin,$YPos,60,$FontSize,locale_number_format($TotalBanked,2), 'right'); $LeftOvers = $pdf->addTextWrap($Left_Margin+65,$YPos,300,$FontSize,_('TOTAL') . ' ' . $Currency . ' ' . _('BANKED'), 'left'); - + $pdf->OutputD($_SESSION['DatabaseName'] . '_BankingSummary_' . date('Y-m-d').'.pdf'); - $pdf->__destruct(); + $pdf->__destruct(); } ?> \ No newline at end of file Modified: trunk/PDFChequeListing.php =================================================================== --- trunk/PDFChequeListing.php 2011-09-11 04:06:48 UTC (rev 4685) +++ trunk/PDFChequeListing.php 2011-09-12 08:03:20 UTC (rev 4686) @@ -31,7 +31,7 @@ } echo '<form method="post" action="' . $_SERVER['PHP_SELF'] . '">'; - + echo '<input type="hidden" name="FormID" value="' . $_SESSION['FormID'] . '" />'; echo '<table class=selection> <tr> @@ -50,7 +50,7 @@ echo '<select name="BankAccount">'; while ($myrow=DB_fetch_array($result)){ - echo '<option VALUE=' . $myrow['accountcode'] . '>' . $myrow['bankaccountname'] . '</option>'; + echo '<option value="' . $myrow['accountcode'] . '">' . $myrow['bankaccountname'] . '</option>'; } @@ -72,12 +72,15 @@ include('includes/ConnectDB.inc'); } -$SQL = "SELECT bankaccountname - FROM bankaccounts +$SQL = "SELECT bankaccountname, + decimalplaces AS bankcurrdecimalplaces + FROM bankaccounts INNER JOIN currencies + ON bankaccounts.currcode=currencies.currabrev WHERE accountcode = '" .$_POST['BankAccount'] . "'"; $BankActResult = DB_query($SQL,$db); $myrow = DB_fetch_row($BankActResult); $BankAccountName = $myrow[0]; +$BankCurrDecimalPlaces = $myrow[1]; $SQL= "SELECT amount, ref, @@ -123,7 +126,7 @@ while ($myrow=DB_fetch_array($Result)){ - $LeftOvers = $pdf->addTextWrap($Left_Margin,$YPos,60,$FontSize,locale_number_format(-$myrow['amount'],2), 'right'); + $LeftOvers = $pdf->addTextWrap($Left_Margin,$YPos,60,$FontSize,locale_money_format(-$myrow['amount'],$BankCurrDecimalPlaces), 'right'); $LeftOvers = $pdf->addTextWrap($Left_Margin+65,$YPos,90,$FontSize,$myrow['ref'], 'left'); $sql = "SELECT accountname, @@ -148,7 +151,7 @@ } while ($GLRow=DB_fetch_array($GLTransResult)){ $LeftOvers = $pdf->addTextWrap($Left_Margin+150,$YPos,90,$FontSize,$GLRow['accountname'], 'left'); - $LeftOvers = $pdf->addTextWrap($Left_Margin+245,$YPos,60,$FontSize,locale_number_format($GLRow['amount'],2), 'right'); + $LeftOvers = $pdf->addTextWrap($Left_Margin+245,$YPos,60,$FontSize,locale_money_format($GLRow['amount'],$_SESSION['CompanyRecord']['decimalplaces']), 'right'); $LeftOvers = $pdf->addTextWrap($Left_Margin+310,$YPos,120,$FontSize,$GLRow['narrative'], 'left'); $YPos -= ($line_height); if ($YPos - (2 *$line_height) < $Bottom_Margin){ @@ -176,7 +179,7 @@ $ReportFileName = $_SESSION['DatabaseName'] . '_ChequeListing_' . date('Y-m-d').'.pdf'; $pdf->OutputD($ReportFileName); -$pdf->__destruct(); +$pdf->__destruct(); if ($_POST['Email']=='Yes'){ if (file_exists($_SESSION['reports_dir'] . '/'.$ReportFileName)){ unlink($_SESSION['reports_dir'] . '/'.$ReportFileName); Modified: trunk/PDFCustTransListing.php =================================================================== --- trunk/PDFCustTransListing.php 2011-09-11 04:06:48 UTC (rev 4685) +++ trunk/PDFCustTransListing.php 2011-09-12 08:03:20 UTC (rev 4686) @@ -26,7 +26,7 @@ echo '<form method="post" action="' . $_SERVER['PHP_SELF'] . '">'; echo '<input type="hidden" name="FormID" value="' . $_SESSION['FormID'] . '" />'; - echo '<table class=selection> + echo '<table class="selection"> <tr> <td>' . _('Enter the date for which the transactions are to be listed') . ':</td> <td><input type="text" name="Date" maxlength="10" size="10" class=date alt="' . $_SESSION['DefaultDateFormat'] . '" value="' . Date($_SESSION['DefaultDateFormat']) . '"></td> @@ -62,10 +62,10 @@ invtext, debtortrans.rate, decimalplaces - FROM debtortrans INNER JOIN debtorsmaster - ON debtortrans.debtorno=debtorsmaster.debtorno - INNER JOIN currencies - ON debtorsmaster.currcode=currencies.currabrev + FROM debtortrans INNER JOIN debtorsmaster + ON debtortrans.debtorno=debtorsmaster.debtorno + INNER JOIN currencies + ON debtorsmaster.currcode=currencies.currabrev WHERE type='" . $_POST['TransType'] . "' AND date_format(inputdate, '%Y-%m-%d')='".FormatDateForSQL($_POST['Date'])."'"; @@ -104,15 +104,15 @@ while ($myrow=DB_fetch_array($result)){ $sql="SELECT name FROM debtorsmaster WHERE debtorno='" . $myrow['debtorno'] . "'"; - $supplierresult=DB_query($sql, $db); - $supplierrow=DB_fetch_array($supplierresult); + $CustomerResult=DB_query($sql, $db); + $CustomerRow=DB_fetch_array($CustomerResult); - $LeftOvers = $pdf->addTextWrap($Left_Margin,$YPos,160,$FontSize,$supplierrow['name'], 'left'); + $LeftOvers = $pdf->addTextWrap($Left_Margin,$YPos,160,$FontSize,$CustomerRow['name'], 'left'); $LeftOvers = $pdf->addTextWrap($Left_Margin+162,$YPos,80,$FontSize,$myrow['transno'], 'left'); $LeftOvers = $pdf->addTextWrap($Left_Margin+242,$YPos,70,$FontSize,ConvertSQLDate($myrow['trandate']), 'left'); - $LeftOvers = $pdf->addTextWrap($Left_Margin+312,$YPos,70,$FontSize,locale_number_format($myrow['ovamount'],$myrow['decimalplaces']), 'right'); - $LeftOvers = $pdf->addTextWrap($Left_Margin+382,$YPos,70,$FontSize,locale_number_format($myrow['ovgst'],$myrow['decimalplaces']), 'right'); - $LeftOvers = $pdf->addTextWrap($Left_Margin+452,$YPos,70,$FontSize,locale_number_format($myrow['ovamount']+$myrow['ovgst'],$myrow['decimalplaces']), 'right'); + $LeftOvers = $pdf->addTextWrap($Left_Margin+312,$YPos,70,$FontSize,locale_money_format($myrow['ovamount'],$myrow['decimalplaces']), 'right'); + $LeftOvers = $pdf->addTextWrap($Left_Margin+382,$YPos,70,$FontSize,locale_money_format($myrow['ovgst'],$myrow['decimalplaces']), 'right'); + $LeftOvers = $pdf->addTextWrap($Left_Margin+452,$YPos,70,$FontSize,locale_money_format($myrow['ovamount']+$myrow['ovgst'],$myrow['decimalplaces']), 'right'); $YPos -= ($line_height); $TotalAmount = $TotalAmount + ($myrow['ovamount']/$myrow['rate']); Modified: trunk/PDFCustomerList.php =================================================================== --- trunk/PDFCustomerList.php 2011-09-11 04:06:48 UTC (rev 4685) +++ trunk/PDFCustomerList.php 2011-09-12 08:03:20 UTC (rev 4686) @@ -17,7 +17,7 @@ if (!is_numeric($_POST['ActivityAmount'])){ $title = _('Customer List') . ' - ' . _('Problem Report') . '....'; include('includes/header.inc'); - echo '<p>'; + echo '<p />'; prnMsg( _('The activity amount is not numeric and you elected to print customer relative to a certain amount of activity') . ' - ' . _('this level of activity must be specified in the local currency') .'.', 'error'); include('includes/footer.inc'); exit; @@ -230,7 +230,7 @@ $title = _('Customer List') . ' - ' . _('Problem Report') . '....'; include('includes/header.inc'); prnMsg( _('The customer List could not be retrieved by the SQL because') . ' - ' . DB_error_msg($db) ); - echo '<br /><a href="' .$rootpath .'/index.php?' . SID . '">'. _('Back to the menu'). '</a>'; + echo '<br /><a href="' .$rootpath .'/index.php">'. _('Back to the menu'). '</a>'; if ($debug==1){ echo '<br />'. $SQL; } @@ -242,7 +242,7 @@ $title = _('Customer List') . ' - ' . _('Problem Report') . '....'; include('includes/header.inc'); prnMsg( _('This report has no output because there were no customers retrieved'), 'error' ); - echo '<br /><a href="' .$rootpath .'/index.php?' . SID . '">'. _('Back to the menu'). '</a>'; + echo '<br /><a href="' .$rootpath .'/index.php">'. _('Back to the menu'). '</a>'; include('includes/footer.inc'); exit; } @@ -333,7 +333,7 @@ if ($_POST['Activity']!='All'){ $LeftOvers = $pdf->addTextWrap(230,$YPos-20,60,$FontSize,_('Turnover'),'right'); - $LeftOvers = $pdf->addTextWrap(230,$YPos-30,60,$FontSize,locale_number_format($LocalCurrencyTurnover), 'right'); + $LeftOvers = $pdf->addTextWrap(230,$YPos-30,60,$FontSize,locale_money_format($LocalCurrencyTurnover,0), 'right'); } $LeftOvers = $pdf->addTextWrap(290,$YPos,150,$FontSize,$Customers['brname']); @@ -368,11 +368,11 @@ echo '<p class="page_title_text"><img src="'.$rootpath.'/css/'.$theme.'/images/customer.png" title="' . $title . '" alt="" />' . ' ' . $title . '</p>'; - echo '<form action=' . $_SERVER['PHP_SELF'] . ' method="POST"><table class=selection>'; + echo '<form action=' . $_SERVER['PHP_SELF'] . ' method="POST"><table class="selection">'; echo '<input type="hidden" name="FormID" value="' . $_SESSION['FormID'] . '" />'; echo '<tr><td>' . _('For Sales Areas') . ':</td><td><select name=Areas[] multiple>'; - $sql='SELECT areacode, areadescription FROM areas'; + $sql="SELECT areacode, areadescription FROM areas"; $AreasResult= DB_query($sql,$db); echo '<option selected value="All">' . _('All Areas') . '</option>'; @@ -386,11 +386,11 @@ echo '<option selected value="All">'. _('All sales folk'); - $sql = 'SELECT salesmancode, salesmanname FROM salesman'; + $sql = "SELECT salesmancode, salesmanname FROM salesman"; $SalesFolkResult = DB_query($sql,$db); While ($myrow = DB_fetch_array($SalesFolkResult)){ - echo '<option VALUE="' . $myrow['salesmancode'] . '">' . $myrow['salesmanname']; + echo '<option value="' . $myrow['salesmancode'] . '">' . $myrow['salesmanname'] . '</option>'; } echo '</select></td></tr>'; Modified: trunk/PDFDIFOT.php =================================================================== --- trunk/PDFDIFOT.php 2011-09-11 04:06:48 UTC (rev 4685) +++ trunk/PDFDIFOT.php 2011-09-12 08:03:20 UTC (rev 4686) @@ -106,7 +106,7 @@ INNER JOIN salesorders ON salesorderdetails.orderno=salesorders.orderno WHERE salesorders.deliverydate >='" . FormatDateForSQL($_POST['FromDate']) . "' AND salesorders.deliverydate <='" . FormatDateForSQL($_POST['ToDate']) . "' - AND (TO_DAYS(salesorderdetails.actualdispatchdate) - TO_DAYS(salesorders.deliverydate)) >'" . $_POST['DaysAcceptable']."'"; + AND (TO_DAYS(salesorderdetails.actualdispatchdate) - TO_DAYS(salesorders.deliverydate)) >'" . filter_number_format($_POST['DaysAcceptable']) ."'"; } elseif ($_POST['CategoryID']!='All' AND $_POST['Location']=='All') { $sql= "SELECT salesorders.orderno, @@ -126,7 +126,7 @@ AND salesorders.deliverydate <='" . FormatDateForSQL($_POST['ToDate']) . "' AND stockmaster.categoryid='" . $_POST['CategoryID'] ."' AND (TO_DAYS(salesorderdetails.actualdispatchdate) - - TO_DAYS(salesorders.deliverydate)) >'" . $_POST['DaysAcceptable']."'"; + - TO_DAYS(salesorders.deliverydate)) >'" . filter_number_format($_POST['DaysAcceptable'])."'"; } elseif ($_POST['CategoryID']=='All' AND $_POST['Location']!='All') { @@ -147,7 +147,7 @@ AND salesorders.deliverydate <='" . FormatDateForSQL($_POST['ToDate']) . "' AND salesorders.fromstkloc='" . $_POST['Location'] . "' AND (TO_DAYS(salesorderdetails.actualdispatchdate) - - TO_DAYS(salesorders.deliverydate)) >'" . $_POST['DaysAcceptable'] . "'"; + - TO_DAYS(salesorders.deliverydate)) >'" . filter_number_format($_POST['DaysAcceptable']) . "'"; } elseif ($_POST['CategoryID']!='All' AND $_POST['Location']!='All'){ @@ -169,7 +169,7 @@ AND stockmaster.categoryid='" . $_POST['CategoryID'] ."' AND salesorders.fromstkloc='" . $_POST['Location'] . "' AND (TO_DAYS(salesorderdetails.actualdispatchdate) - - TO_DAYS(salesorders.deliverydate)) >'" . $_POST['DaysAcceptable'] . "'"; + - TO_DAYS(salesorders.deliverydate)) >'" . filter_number_format($_POST['DaysAcceptable']) . "'"; } Modified: trunk/PcAuthorizeExpenses.php =================================================================== --- trunk/PcAuthorizeExpenses.php 2011-09-11 04:06:48 UTC (rev 4685) +++ trunk/PcAuthorizeExpenses.php 2011-09-12 08:03:20 UTC (rev 4686) @@ -19,9 +19,9 @@ } if (isset($_POST['Days'])){ - $Days = $_POST['Days']; + $Days = filter_number_format($_POST['Days']); } elseif (isset($_GET['Days'])){ - $Days = $_GET['Days']; + $Days = filter_number_format($_GET['Days']); } if (isset($_POST['Process'])) { @@ -73,7 +73,8 @@ pctabs.glaccountpcash, pctabs.usercode, pctabs.currency, - currencies.rate + currencies.rate, + currencies.decimalplaces FROM pcashdetails, pctabs, currencies WHERE pcashdetails.tabcode = pctabs.tabcode AND pctabs.currency = currencies.currabrev @@ -98,7 +99,7 @@ echo '<input type="hidden" name="FormID" value="' . $_SESSION['FormID'] . '" />'; while ($myrow=DB_fetch_array($result)) { - + $CurrDecimalPlaces = $myrow['decimalplaces']; //update database if update pressed if ((isset($_POST['Submit']) AND $_POST['Submit']=='Update') AND isset($_POST[$myrow['counterindex']])){ @@ -107,7 +108,7 @@ if ($myrow['rate'] == 1){ // functional currency $Amount = $myrow['amount']; }else{ // other currencies - $Amount = $myrow['amount']/$myrow['rate']; + $Amount = filter_number_format($myrow['amount']/$myrow['rate']); } if ($myrow['codeexpense'] == 'ASSIGNCASH'){ @@ -158,7 +159,7 @@ 0, '', 0)"; - + $ResultFrom = DB_Query($sqlFrom, $db, '', '', true); $sqlTo="INSERT INTO `gltrans` (`counterindex`, @@ -185,7 +186,7 @@ 0, '', 0)"; - + $ResultTo = DB_Query($sqlTo, $db, '', '', true); if ($myrow['codeexpense'] == 'ASSIGNCASH'){ @@ -240,7 +241,7 @@ } echo'<td>'.ConvertSQLDate($myrow['date']).'</td> <td>'.$myrow['codeexpense'].'</td> - <td class="number">'.locale_number_format($myrow['amount'],2).'</td> + <td class="number">'.locale_money_format($myrow['amount'],$CurrDecimalPlaces).'</td> <td>' . $Posted . '</td> <td>' .$myrow['notes'] . '</td> <td>' . $myrow['receipt'] . '</td>'; @@ -276,13 +277,13 @@ } echo '<tr><td colspan=2 class="number">' . _('Current balance') . ':</td> - <td class=number>'.locale_number_format($Amount['0'],2).'</td></tr>'; + <td class=number>'.locale_money_format($Amount['0'],$CurrDecimalPlaces).'</td></tr>'; // Do the postings include ('includes/GLPostings.inc'); echo'</table><br /><div class="centre"><input type="submit" name="Submit" value=' . _('Update') . '></div></form>'; - + } else { /*The option to submit was not hit so display form */ Modified: trunk/PcClaimExpensesFromTab.php =================================================================== --- trunk/PcClaimExpensesFromTab.php 2011-09-11 04:06:48 UTC (rev 4685) +++ trunk/PcClaimExpensesFromTab.php 2011-09-12 08:03:20 UTC (rev 4686) @@ -20,9 +20,9 @@ } if (isset($_POST['Days'])){ - $Days = $_POST['Days']; + $Days = filter_number_format($_POST['Days']); } elseif (isset($_GET['Days'])){ - $Days = $_GET['Days']; + $Days = filter_number_format($_GET['Days']); } if (isset($_POST['Cancel'])) { @@ -71,9 +71,9 @@ $sql = "UPDATE pcashdetails SET date = '".FormatDateForSQL($_POST['Date'])."', codeexpense = '" . $_POST['SelectedExpense'] . "', - amount = '" .- $_POST['amount'] . "', - notes = '" . $_POST['Notes'] . "', - receipt = '" . $_POST['Receipt'] . "' + amount = '" .-filter_number_format($_POST['amount']) . "', + notes = '" . DB_escape_string($_POST['Notes']) . "', + receipt = '" . DB_escape_string($_POST['Receipt']) . "' WHERE counterindex = '".$SelectedIndex."'"; $msg = _('The Expense Claim on Tab') . ' ' . $SelectedTabs . ' ' . _('has been updated'); @@ -95,11 +95,11 @@ VALUES ('','" . $_POST['SelectedTabs'] . "', '".FormatDateForSQL($_POST['Date'])."', '" . $_POST['SelectedExpense'] . "', - '" .- $_POST['amount'] . "', + '" . -filter_number_format($_POST['amount']) . "', '', '', - '" . $_POST['Notes'] . "', - '" . $_POST['Receipt'] . "' + '" . DB_escape_string($_POST['Notes']) . "', + '" . DB_escape_string($_POST['Receipt']) . "' )"; $msg = _('The Expense Claim on Tab') . ' ' . $_POST['SelectedTabs'] . ' ' . _('has been created'); @@ -181,8 +181,8 @@ echo '<br /><table class=selection>'; echo '<tr><th colspan="8"><font color="navy" size="3">' . _('Petty Cash Tab') . ' ' .$SelectedTabs. '</font></th></tr>'; echo '<tr><th colspan="8">' . _('Detail Of Movements For Last ') .': '; - + if(!isset ($Days)){ $Days=30; } @@ -254,7 +254,7 @@ </tr>', ConvertSQLDate($myrow['2']), $Description['0'], - locale_number_format($myrow['4'],2), + locale_money_format($myrow['4'],$_SESSION['CompanyRecord']['decimalplaces']), $AuthorisedDate, $myrow['7'], $myrow['8'], @@ -270,7 +270,7 @@ </tr>', ConvertSQLDate($myrow['2']), $Description['0'], - locale_number_format($myrow['4'],2), + locale_money_format($myrow['4'],$_SESSION['CompanyRecord']['decimalplaces']), $AuthorisedDate, $myrow['7'], $myrow['8']); @@ -290,9 +290,9 @@ if (!isset($Amount['0'])) { $Amount['0']=0; } - + echo '<tr><td colspan="2" style="text-align:right" >' . _('Current balance') . ':</td> - <td class="number">'.locale_number_format($Amount['0'],2) . '</td></tr>'; + <td class="number">'.locale_money_format($Amount['0'],$_SESSION['CompanyRecord']['decimalplaces']) . '</td></tr>'; echo '</table>'; @@ -302,7 +302,7 @@ echo '<form method="post" action="' . $_SERVER['PHP_SELF'] . '">'; echo '<input type="hidden" name="FormID" value="' . $_SESSION['FormID'] . '" />'; - + echo '<br /><table class="selection">'; //Main table @@ -361,7 +361,7 @@ if (!isset($_POST['Amount'])) { $_POST['Amount']=0; } - + echo '<tr><td>' . _('Amount') . ':</td> <td><input type="text" class="number" name="amount" size="12" maxlength="11" value="' . $_POST['Amount'] . '"></td></tr>'; @@ -380,7 +380,7 @@ <td><input type="text" name="Receipt" size="50" maxlength="49" value="' . $_POST['Receipt'] . '"></td></tr>'; echo '<input type="hidden" name="SelectedTabs" value="' . $SelectedTabs . '">'; echo '<input type="hidden" name="Days" value="' .$Days. '">'; - + echo '</td></tr></table>'; // close main table echo '<p><div class="centre"><input type="submit" name="submit" value="' . _('Accept') . '"><input type=submit name="Cancel" value="' . _('Cancel') . '"></div>'; echo '</form>'; Modified: trunk/PcExpenses.php =================================================================== --- trunk/PcExpenses.php 2011-09-11 04:06:48 UTC (rev 4685) +++ trunk/PcExpenses.php 2011-09-12 08:03:20 UTC (rev 4686) @@ -86,7 +86,7 @@ if (isset($SelectedExpense) AND $InputError !=1) { $sql = "UPDATE pcexpenses - SET description = '" . $_POST['Description'] . "', + SET description = '" . DB_escape_string($_POST['Description']) . "', glaccount = '" . $_POST['GLAccount'] . "' WHERE codeexpense = '" . $SelectedExpense . "'"; @@ -113,7 +113,7 @@ (codeexpense, description,glaccount) VALUES ('" . $_POST['CodeExpense'] . "', - '" . $_POST['Description'] . "', + '" . DB_escape_string($_POST['Description']) . "', '" . $_POST['GLAccount'] . "')"; $msg = _('Expense ') . ' ' . $_POST['CodeExpense'] . ' ' . _('has been created'); @@ -154,7 +154,7 @@ } else { $sql="DELETE FROM pcexpenses - WHERE codeexpense='" . $SelectedExpense . "'"; + WHERE codeexpense='" . $SelectedExpense . "'"; $ErrMsg = _('The expense type record could not be deleted because'); $result = DB_query($sql,$db,$ErrMsg); prnMsg(_('Expense type') . ' ' . $SelectedExpense . ' ' . _('has been deleted') ,'success'); @@ -203,7 +203,7 @@ printf('<td>%s</td> <td>%s</td> - <td class=number>%s</td> + <td class="number">%s</td> <td>%s</td> <td><a href="%sSelectedExpense=%s">' . _('Edit') . '</td> <td><a href="%sSelectedExpense=%s&delete=yes" onclick="return confirm(\'' . _('Are you sure you wish to delete this expense code and all the details it may have set up?') . '\');">' . _('Delete') . '</td> @@ -249,7 +249,7 @@ echo '<input type=hidden name="SelectedExpense" value="' . $SelectedExpense . '">'; echo '<input type=hidden name="CodeExpense" VALUE="' . $_POST['CodeExpense']. '">'; // We dont allow the user to change an existing type code - echo '<table class="selection"> + echo '<table class="selection"> <tr> <td>' . _('Code Of Expense') . ':</td> <td>' . $_POST['CodeExpense'] . '</td></tr>'; @@ -285,9 +285,9 @@ echo '<option value="">' . _('Not Yet Selected') . '</option>'; while ($myrow = DB_fetch_array($result)) { if (isset($_POST['GLAccount']) and $myrow['accountcode']==$_POST['GLAccount']) { - echo '<option selected VALUE="'; + echo '<option selected value="'; } else { - echo '<option VALUE="'; + echo '<option value="'; } echo $myrow['accountcode'] . '">' . $myrow['accountcode'] . ' - ' . $myrow['accountname'] . '</option>'; @@ -297,7 +297,8 @@ echo '</td></tr></table>'; // close main table - echo '<p><div class="centre"><input type="submit" name=submit VALUE="' . _('Accept') . '"><input type=submit name=Cancel VALUE="' . _('Cancel') . '"></div>'; + echo '<p><div class="centre"><input type="submit" name="submit" value="' . _('Accept') . '"> + <input type="submit" name="Cancel" value="' . _('Cancel') . '"></div>'; echo '</form>'; Modified: trunk/PcExpensesTypeTab.php =================================================================== --- trunk/PcExpensesTypeTab.php 2011-09-11 04:06:48 UTC (rev 4685) +++ trunk/PcExpensesTypeTab.php 2011-09-12 08:03:20 UTC (rev 4686) @@ -20,7 +20,7 @@ if (!isset($_GET['delete']) and (ContainsIllegalCharacters($SelectedType) OR mb_strpos($SelectedType,' ')>0)){ $InputError = 1; prnMsg(_('The petty cash tab type contain any of the following characters " \' - & or a space'),'error'); -} +} if (isset($_POST['SelectedTab'])){ $SelectedTab = mb_strtoupper($_POST['SelectedTab']); @@ -46,7 +46,7 @@ if (isset($_POST['submit'])) { $InputError=0; - + if ($_POST['SelectedExpense']=='') { $InputError=1; echo prnMsg(_('You have not selected an expense to add to this tab'),'error'); @@ -111,7 +111,7 @@ echo '<form method="post" action="' . $_SERVER['PHP_SELF'] . '">'; echo '<input type="hidden" name="FormID" value="' . $_SESSION['FormID'] . '" />'; echo '<table class="selection">'; //Main table - + echo '<tr><td>' . _('Select Type of Tab') . ':</td><td><select name="SelectedTab">'; DB_free_result($result); @@ -136,8 +136,8 @@ echo '</table>'; // close table in first column echo '</td></tr></table>'; // close main table - echo '<p><div class="centre"><input type=submit name="Process" value="' . _('Accept') . '"> - <input type=submit name="Cancel" value="' . _('Cancel') . '"></div>'; + echo '<p><div class="centre"><inpu... [truncated message content] |
From: <dai...@us...> - 2011-09-12 08:03:31
|
Revision: 4686 http://web-erp.svn.sourceforge.net/web-erp/?rev=4686&view=rev Author: daintree Date: 2011-09-12 08:03:20 +0000 (Mon, 12 Sep 2011) Log Message: ----------- number_formatting Modified Paths: -------------- trunk/PDFBankingSummary.php trunk/PDFChequeListing.php trunk/PDFCustTransListing.php trunk/PDFCustomerList.php trunk/PDFDIFOT.php trunk/PcAuthorizeExpenses.php trunk/PcClaimExpensesFromTab.php trunk/PcExpenses.php trunk/PcExpensesTypeTab.php trunk/PcReportTab.php trunk/PcTabs.php trunk/StockLocTransferReceive.php trunk/doc/Change.log trunk/includes/LanguageSetup.php trunk/includes/MiscFunctions.php trunk/locale/cs_CZ.utf8/LC_MESSAGES/messages.mo trunk/locale/cs_CZ.utf8/LC_MESSAGES/messages.po trunk/locale/de_DE.utf8/LC_MESSAGES/messages.mo trunk/locale/de_DE.utf8/LC_MESSAGES/messages.po trunk/locale/el_GR.utf8/LC_MESSAGES/messages.mo trunk/locale/el_GR.utf8/LC_MESSAGES/messages.po trunk/locale/en_GB.utf8/LC_MESSAGES/messages.pot trunk/locale/en_US.utf8/LC_MESSAGES/messages.mo trunk/locale/en_US.utf8/LC_MESSAGES/messages.po trunk/locale/es_ES.utf8/LC_MESSAGES/messages.mo trunk/locale/es_ES.utf8/LC_MESSAGES/messages.po trunk/locale/et_EE.utf8/LC_MESSAGES/messages.mo trunk/locale/et_EE.utf8/LC_MESSAGES/messages.po trunk/locale/fa_IR.utf8/LC_MESSAGES/messages.mo trunk/locale/fa_IR.utf8/LC_MESSAGES/messages.po trunk/locale/fr_FR.utf8/LC_MESSAGES/messages.mo trunk/locale/fr_FR.utf8/LC_MESSAGES/messages.po trunk/locale/hi_IN.utf8/LC_MESSAGES/messages.mo trunk/locale/hi_IN.utf8/LC_MESSAGES/messages.po trunk/locale/hr_HR.utf8/LC_MESSAGES/messages.mo trunk/locale/hr_HR.utf8/LC_MESSAGES/messages.po trunk/locale/hu_HU.utf8/LC_MESSAGES/messages.mo trunk/locale/hu_HU.utf8/LC_MESSAGES/messages.po trunk/locale/id_ID.utf8/LC_MESSAGES/messages.mo trunk/locale/id_ID.utf8/LC_MESSAGES/messages.po trunk/locale/it_IT.utf8/LC_MESSAGES/messages.mo trunk/locale/it_IT.utf8/LC_MESSAGES/messages.po trunk/locale/ja_JP.utf8/LC_MESSAGES/messages.mo trunk/locale/ja_JP.utf8/LC_MESSAGES/messages.po trunk/locale/lv_LV.utf8/LC_MESSAGES/messages.mo trunk/locale/lv_LV.utf8/LC_MESSAGES/messages.po trunk/locale/nl_NL.utf8/LC_MESSAGES/messages.mo trunk/locale/nl_NL.utf8/LC_MESSAGES/messages.po trunk/locale/pl_PL.utf8/LC_MESSAGES/messages.mo trunk/locale/pl_PL.utf8/LC_MESSAGES/messages.po trunk/locale/pt_BR.utf8/LC_MESSAGES/messages.mo trunk/locale/pt_BR.utf8/LC_MESSAGES/messages.po trunk/locale/pt_PT.utf8/LC_MESSAGES/messages.mo trunk/locale/pt_PT.utf8/LC_MESSAGES/messages.po trunk/locale/ro_RO.utf8/LC_MESSAGES/messages.mo trunk/locale/ro_RO.utf8/LC_MESSAGES/messages.po trunk/locale/ru_RU.utf8/LC_MESSAGES/messages.mo trunk/locale/ru_RU.utf8/LC_MESSAGES/messages.po trunk/locale/sq_AL.utf8/LC_MESSAGES/messages.mo trunk/locale/sq_AL.utf8/LC_MESSAGES/messages.po trunk/locale/sv_SE.utf8/LC_MESSAGES/messages.mo trunk/locale/sv_SE.utf8/LC_MESSAGES/messages.po trunk/locale/sw_KE.utf8/LC_MESSAGES/messages.mo trunk/locale/sw_KE.utf8/LC_MESSAGES/messages.po trunk/locale/tr_TR.utf8/LC_MESSAGES/messages.mo trunk/locale/tr_TR.utf8/LC_MESSAGES/messages.po trunk/locale/vi_VN.utf8/LC_MESSAGES/messages.mo trunk/locale/vi_VN.utf8/LC_MESSAGES/messages.po trunk/locale/zh_CN.utf8/LC_MESSAGES/messages.mo trunk/locale/zh_CN.utf8/LC_MESSAGES/messages.po trunk/locale/zh_HK.utf8/LC_MESSAGES/messages.mo trunk/locale/zh_HK.utf8/LC_MESSAGES/messages.po trunk/sql/mysql/weberp-demo.sql trunk/sql/mysql/weberp-new.sql Modified: trunk/PDFBankingSummary.php =================================================================== --- trunk/PDFBankingSummary.php 2011-09-11 04:06:48 UTC (rev 4685) +++ trunk/PDFBankingSummary.php 2011-09-12 08:03:20 UTC (rev 4686) @@ -48,11 +48,13 @@ bankact, banktrans.exrate, banktrans.functionalexrate, - banktrans.currcode - FROM bankaccounts, - banktrans - WHERE bankaccounts.accountcode=banktrans.bankact - AND banktrans.transno='" . $_POST['BatchNo'] . "' + banktrans.currcode, + currencies.decimalplaces AS currdecimalplaces + FROM bankaccounts INNER JOIN banktrans + ON bankaccounts.accountcode=banktrans.bankact + INNER JOIN currencies + ON bankaccounts.currcode=currencies.currabrev + WHERE banktrans.transno='" . $_POST['BatchNo'] . "' AND banktrans.type=12"; $ErrMsg = _('An error occurred getting the header information about the receipt batch number') . ' ' . $_POST['BatchNo']; @@ -76,8 +78,8 @@ $BankActName = $myrow['bankaccountname']; $BankActNumber = $myrow['bankaccountnumber']; $BankingReference = $myrow['ref']; - - + $BankCurrDecimalPlaces = $myrow['currdecimalplaces']; + $SQL = "SELECT debtorsmaster.name, ovamount, invtext, @@ -117,30 +119,30 @@ include('includes/footer.inc'); exit; } - - + + include('includes/PDFStarter.php'); - + /*PDFStarter.php has all the variables for page size and width set up depending on the users default preferences for paper size */ - + $pdf->addInfo('Title',_('Banking Summary')); $pdf->addInfo('Subject',_('Banking Summary Number') . ' ' . $_POST['BatchNo']); $line_height=12; $PageNumber = 0; $TotalBanked = 0; - + include ('includes/PDFBankingSummaryPageHeader.inc'); - + while ($myrow=DB_fetch_array($CustRecs)){ - - $LeftOvers = $pdf->addTextWrap($Left_Margin,$YPos,60,$FontSize,locale_number_format(-$myrow['ovamount'],2), 'right'); + + $LeftOvers = $pdf->addTextWrap($Left_Margin,$YPos,60,$FontSize,locale_money_format(-$myrow['ovamount'],$BankCurrDecimalPlaces), 'right'); $LeftOvers = $pdf->addTextWrap($Left_Margin+65,$YPos,150,$FontSize,$myrow['name'], 'left'); $LeftOvers = $pdf->addTextWrap($Left_Margin+215,$YPos,100,$FontSize,$myrow['invtext'], 'left'); $LeftOvers = $pdf->addTextWrap($Left_Margin+315,$YPos,100,$FontSize,$myrow['reference'], 'left'); - + $YPos -= ($line_height); $TotalBanked -= $myrow['ovamount']; - + if ($YPos - (2 *$line_height) < $Bottom_Margin){ /*Then set up a new page */ include ('includes/PDFBankingSummaryPageHeader.inc'); @@ -150,24 +152,24 @@ /* Right now print out the GL receipt entries in the batch */ while ($myrow=DB_fetch_array($GLRecs)){ - $LeftOvers = $pdf->addTextWrap($Left_Margin,$YPos,60,$FontSize,locale_number_format((-$myrow['amount']*$ExRate*$FunctionalExRate),2), 'right'); + $LeftOvers = $pdf->addTextWrap($Left_Margin,$YPos,60,$FontSize,locale_money_format((-$myrow['amount']*$ExRate*$FunctionalExRate),$BankCurrDecimalPlaces), 'right'); $LeftOvers = $pdf->addTextWrap($Left_Margin+65,$YPos,300,$FontSize,$myrow['narrative'], 'left'); $YPos -= ($line_height); $TotalBanked += (-$myrow['amount']*$ExRate); - + if ($YPos - (2 *$line_height) < $Bottom_Margin){ /*Then set up a new page */ include ('includes/PDFBankingSummaryPageHeader.inc'); } /*end of new page header */ } /* end of while there are GL receipts in the batch to print */ - - + + $YPos-=$line_height; $LeftOvers = $pdf->addTextWrap($Left_Margin,$YPos,60,$FontSize,locale_number_format($TotalBanked,2), 'right'); $LeftOvers = $pdf->addTextWrap($Left_Margin+65,$YPos,300,$FontSize,_('TOTAL') . ' ' . $Currency . ' ' . _('BANKED'), 'left'); - + $pdf->OutputD($_SESSION['DatabaseName'] . '_BankingSummary_' . date('Y-m-d').'.pdf'); - $pdf->__destruct(); + $pdf->__destruct(); } ?> \ No newline at end of file Modified: trunk/PDFChequeListing.php =================================================================== --- trunk/PDFChequeListing.php 2011-09-11 04:06:48 UTC (rev 4685) +++ trunk/PDFChequeListing.php 2011-09-12 08:03:20 UTC (rev 4686) @@ -31,7 +31,7 @@ } echo '<form method="post" action="' . $_SERVER['PHP_SELF'] . '">'; - + echo '<input type="hidden" name="FormID" value="' . $_SESSION['FormID'] . '" />'; echo '<table class=selection> <tr> @@ -50,7 +50,7 @@ echo '<select name="BankAccount">'; while ($myrow=DB_fetch_array($result)){ - echo '<option VALUE=' . $myrow['accountcode'] . '>' . $myrow['bankaccountname'] . '</option>'; + echo '<option value="' . $myrow['accountcode'] . '">' . $myrow['bankaccountname'] . '</option>'; } @@ -72,12 +72,15 @@ include('includes/ConnectDB.inc'); } -$SQL = "SELECT bankaccountname - FROM bankaccounts +$SQL = "SELECT bankaccountname, + decimalplaces AS bankcurrdecimalplaces + FROM bankaccounts INNER JOIN currencies + ON bankaccounts.currcode=currencies.currabrev WHERE accountcode = '" .$_POST['BankAccount'] . "'"; $BankActResult = DB_query($SQL,$db); $myrow = DB_fetch_row($BankActResult); $BankAccountName = $myrow[0]; +$BankCurrDecimalPlaces = $myrow[1]; $SQL= "SELECT amount, ref, @@ -123,7 +126,7 @@ while ($myrow=DB_fetch_array($Result)){ - $LeftOvers = $pdf->addTextWrap($Left_Margin,$YPos,60,$FontSize,locale_number_format(-$myrow['amount'],2), 'right'); + $LeftOvers = $pdf->addTextWrap($Left_Margin,$YPos,60,$FontSize,locale_money_format(-$myrow['amount'],$BankCurrDecimalPlaces), 'right'); $LeftOvers = $pdf->addTextWrap($Left_Margin+65,$YPos,90,$FontSize,$myrow['ref'], 'left'); $sql = "SELECT accountname, @@ -148,7 +151,7 @@ } while ($GLRow=DB_fetch_array($GLTransResult)){ $LeftOvers = $pdf->addTextWrap($Left_Margin+150,$YPos,90,$FontSize,$GLRow['accountname'], 'left'); - $LeftOvers = $pdf->addTextWrap($Left_Margin+245,$YPos,60,$FontSize,locale_number_format($GLRow['amount'],2), 'right'); + $LeftOvers = $pdf->addTextWrap($Left_Margin+245,$YPos,60,$FontSize,locale_money_format($GLRow['amount'],$_SESSION['CompanyRecord']['decimalplaces']), 'right'); $LeftOvers = $pdf->addTextWrap($Left_Margin+310,$YPos,120,$FontSize,$GLRow['narrative'], 'left'); $YPos -= ($line_height); if ($YPos - (2 *$line_height) < $Bottom_Margin){ @@ -176,7 +179,7 @@ $ReportFileName = $_SESSION['DatabaseName'] . '_ChequeListing_' . date('Y-m-d').'.pdf'; $pdf->OutputD($ReportFileName); -$pdf->__destruct(); +$pdf->__destruct(); if ($_POST['Email']=='Yes'){ if (file_exists($_SESSION['reports_dir'] . '/'.$ReportFileName)){ unlink($_SESSION['reports_dir'] . '/'.$ReportFileName); Modified: trunk/PDFCustTransListing.php =================================================================== --- trunk/PDFCustTransListing.php 2011-09-11 04:06:48 UTC (rev 4685) +++ trunk/PDFCustTransListing.php 2011-09-12 08:03:20 UTC (rev 4686) @@ -26,7 +26,7 @@ echo '<form method="post" action="' . $_SERVER['PHP_SELF'] . '">'; echo '<input type="hidden" name="FormID" value="' . $_SESSION['FormID'] . '" />'; - echo '<table class=selection> + echo '<table class="selection"> <tr> <td>' . _('Enter the date for which the transactions are to be listed') . ':</td> <td><input type="text" name="Date" maxlength="10" size="10" class=date alt="' . $_SESSION['DefaultDateFormat'] . '" value="' . Date($_SESSION['DefaultDateFormat']) . '"></td> @@ -62,10 +62,10 @@ invtext, debtortrans.rate, decimalplaces - FROM debtortrans INNER JOIN debtorsmaster - ON debtortrans.debtorno=debtorsmaster.debtorno - INNER JOIN currencies - ON debtorsmaster.currcode=currencies.currabrev + FROM debtortrans INNER JOIN debtorsmaster + ON debtortrans.debtorno=debtorsmaster.debtorno + INNER JOIN currencies + ON debtorsmaster.currcode=currencies.currabrev WHERE type='" . $_POST['TransType'] . "' AND date_format(inputdate, '%Y-%m-%d')='".FormatDateForSQL($_POST['Date'])."'"; @@ -104,15 +104,15 @@ while ($myrow=DB_fetch_array($result)){ $sql="SELECT name FROM debtorsmaster WHERE debtorno='" . $myrow['debtorno'] . "'"; - $supplierresult=DB_query($sql, $db); - $supplierrow=DB_fetch_array($supplierresult); + $CustomerResult=DB_query($sql, $db); + $CustomerRow=DB_fetch_array($CustomerResult); - $LeftOvers = $pdf->addTextWrap($Left_Margin,$YPos,160,$FontSize,$supplierrow['name'], 'left'); + $LeftOvers = $pdf->addTextWrap($Left_Margin,$YPos,160,$FontSize,$CustomerRow['name'], 'left'); $LeftOvers = $pdf->addTextWrap($Left_Margin+162,$YPos,80,$FontSize,$myrow['transno'], 'left'); $LeftOvers = $pdf->addTextWrap($Left_Margin+242,$YPos,70,$FontSize,ConvertSQLDate($myrow['trandate']), 'left'); - $LeftOvers = $pdf->addTextWrap($Left_Margin+312,$YPos,70,$FontSize,locale_number_format($myrow['ovamount'],$myrow['decimalplaces']), 'right'); - $LeftOvers = $pdf->addTextWrap($Left_Margin+382,$YPos,70,$FontSize,locale_number_format($myrow['ovgst'],$myrow['decimalplaces']), 'right'); - $LeftOvers = $pdf->addTextWrap($Left_Margin+452,$YPos,70,$FontSize,locale_number_format($myrow['ovamount']+$myrow['ovgst'],$myrow['decimalplaces']), 'right'); + $LeftOvers = $pdf->addTextWrap($Left_Margin+312,$YPos,70,$FontSize,locale_money_format($myrow['ovamount'],$myrow['decimalplaces']), 'right'); + $LeftOvers = $pdf->addTextWrap($Left_Margin+382,$YPos,70,$FontSize,locale_money_format($myrow['ovgst'],$myrow['decimalplaces']), 'right'); + $LeftOvers = $pdf->addTextWrap($Left_Margin+452,$YPos,70,$FontSize,locale_money_format($myrow['ovamount']+$myrow['ovgst'],$myrow['decimalplaces']), 'right'); $YPos -= ($line_height); $TotalAmount = $TotalAmount + ($myrow['ovamount']/$myrow['rate']); Modified: trunk/PDFCustomerList.php =================================================================== --- trunk/PDFCustomerList.php 2011-09-11 04:06:48 UTC (rev 4685) +++ trunk/PDFCustomerList.php 2011-09-12 08:03:20 UTC (rev 4686) @@ -17,7 +17,7 @@ if (!is_numeric($_POST['ActivityAmount'])){ $title = _('Customer List') . ' - ' . _('Problem Report') . '....'; include('includes/header.inc'); - echo '<p>'; + echo '<p />'; prnMsg( _('The activity amount is not numeric and you elected to print customer relative to a certain amount of activity') . ' - ' . _('this level of activity must be specified in the local currency') .'.', 'error'); include('includes/footer.inc'); exit; @@ -230,7 +230,7 @@ $title = _('Customer List') . ' - ' . _('Problem Report') . '....'; include('includes/header.inc'); prnMsg( _('The customer List could not be retrieved by the SQL because') . ' - ' . DB_error_msg($db) ); - echo '<br /><a href="' .$rootpath .'/index.php?' . SID . '">'. _('Back to the menu'). '</a>'; + echo '<br /><a href="' .$rootpath .'/index.php">'. _('Back to the menu'). '</a>'; if ($debug==1){ echo '<br />'. $SQL; } @@ -242,7 +242,7 @@ $title = _('Customer List') . ' - ' . _('Problem Report') . '....'; include('includes/header.inc'); prnMsg( _('This report has no output because there were no customers retrieved'), 'error' ); - echo '<br /><a href="' .$rootpath .'/index.php?' . SID . '">'. _('Back to the menu'). '</a>'; + echo '<br /><a href="' .$rootpath .'/index.php">'. _('Back to the menu'). '</a>'; include('includes/footer.inc'); exit; } @@ -333,7 +333,7 @@ if ($_POST['Activity']!='All'){ $LeftOvers = $pdf->addTextWrap(230,$YPos-20,60,$FontSize,_('Turnover'),'right'); - $LeftOvers = $pdf->addTextWrap(230,$YPos-30,60,$FontSize,locale_number_format($LocalCurrencyTurnover), 'right'); + $LeftOvers = $pdf->addTextWrap(230,$YPos-30,60,$FontSize,locale_money_format($LocalCurrencyTurnover,0), 'right'); } $LeftOvers = $pdf->addTextWrap(290,$YPos,150,$FontSize,$Customers['brname']); @@ -368,11 +368,11 @@ echo '<p class="page_title_text"><img src="'.$rootpath.'/css/'.$theme.'/images/customer.png" title="' . $title . '" alt="" />' . ' ' . $title . '</p>'; - echo '<form action=' . $_SERVER['PHP_SELF'] . ' method="POST"><table class=selection>'; + echo '<form action=' . $_SERVER['PHP_SELF'] . ' method="POST"><table class="selection">'; echo '<input type="hidden" name="FormID" value="' . $_SESSION['FormID'] . '" />'; echo '<tr><td>' . _('For Sales Areas') . ':</td><td><select name=Areas[] multiple>'; - $sql='SELECT areacode, areadescription FROM areas'; + $sql="SELECT areacode, areadescription FROM areas"; $AreasResult= DB_query($sql,$db); echo '<option selected value="All">' . _('All Areas') . '</option>'; @@ -386,11 +386,11 @@ echo '<option selected value="All">'. _('All sales folk'); - $sql = 'SELECT salesmancode, salesmanname FROM salesman'; + $sql = "SELECT salesmancode, salesmanname FROM salesman"; $SalesFolkResult = DB_query($sql,$db); While ($myrow = DB_fetch_array($SalesFolkResult)){ - echo '<option VALUE="' . $myrow['salesmancode'] . '">' . $myrow['salesmanname']; + echo '<option value="' . $myrow['salesmancode'] . '">' . $myrow['salesmanname'] . '</option>'; } echo '</select></td></tr>'; Modified: trunk/PDFDIFOT.php =================================================================== --- trunk/PDFDIFOT.php 2011-09-11 04:06:48 UTC (rev 4685) +++ trunk/PDFDIFOT.php 2011-09-12 08:03:20 UTC (rev 4686) @@ -106,7 +106,7 @@ INNER JOIN salesorders ON salesorderdetails.orderno=salesorders.orderno WHERE salesorders.deliverydate >='" . FormatDateForSQL($_POST['FromDate']) . "' AND salesorders.deliverydate <='" . FormatDateForSQL($_POST['ToDate']) . "' - AND (TO_DAYS(salesorderdetails.actualdispatchdate) - TO_DAYS(salesorders.deliverydate)) >'" . $_POST['DaysAcceptable']."'"; + AND (TO_DAYS(salesorderdetails.actualdispatchdate) - TO_DAYS(salesorders.deliverydate)) >'" . filter_number_format($_POST['DaysAcceptable']) ."'"; } elseif ($_POST['CategoryID']!='All' AND $_POST['Location']=='All') { $sql= "SELECT salesorders.orderno, @@ -126,7 +126,7 @@ AND salesorders.deliverydate <='" . FormatDateForSQL($_POST['ToDate']) . "' AND stockmaster.categoryid='" . $_POST['CategoryID'] ."' AND (TO_DAYS(salesorderdetails.actualdispatchdate) - - TO_DAYS(salesorders.deliverydate)) >'" . $_POST['DaysAcceptable']."'"; + - TO_DAYS(salesorders.deliverydate)) >'" . filter_number_format($_POST['DaysAcceptable'])."'"; } elseif ($_POST['CategoryID']=='All' AND $_POST['Location']!='All') { @@ -147,7 +147,7 @@ AND salesorders.deliverydate <='" . FormatDateForSQL($_POST['ToDate']) . "' AND salesorders.fromstkloc='" . $_POST['Location'] . "' AND (TO_DAYS(salesorderdetails.actualdispatchdate) - - TO_DAYS(salesorders.deliverydate)) >'" . $_POST['DaysAcceptable'] . "'"; + - TO_DAYS(salesorders.deliverydate)) >'" . filter_number_format($_POST['DaysAcceptable']) . "'"; } elseif ($_POST['CategoryID']!='All' AND $_POST['Location']!='All'){ @@ -169,7 +169,7 @@ AND stockmaster.categoryid='" . $_POST['CategoryID'] ."' AND salesorders.fromstkloc='" . $_POST['Location'] . "' AND (TO_DAYS(salesorderdetails.actualdispatchdate) - - TO_DAYS(salesorders.deliverydate)) >'" . $_POST['DaysAcceptable'] . "'"; + - TO_DAYS(salesorders.deliverydate)) >'" . filter_number_format($_POST['DaysAcceptable']) . "'"; } Modified: trunk/PcAuthorizeExpenses.php =================================================================== --- trunk/PcAuthorizeExpenses.php 2011-09-11 04:06:48 UTC (rev 4685) +++ trunk/PcAuthorizeExpenses.php 2011-09-12 08:03:20 UTC (rev 4686) @@ -19,9 +19,9 @@ } if (isset($_POST['Days'])){ - $Days = $_POST['Days']; + $Days = filter_number_format($_POST['Days']); } elseif (isset($_GET['Days'])){ - $Days = $_GET['Days']; + $Days = filter_number_format($_GET['Days']); } if (isset($_POST['Process'])) { @@ -73,7 +73,8 @@ pctabs.glaccountpcash, pctabs.usercode, pctabs.currency, - currencies.rate + currencies.rate, + currencies.decimalplaces FROM pcashdetails, pctabs, currencies WHERE pcashdetails.tabcode = pctabs.tabcode AND pctabs.currency = currencies.currabrev @@ -98,7 +99,7 @@ echo '<input type="hidden" name="FormID" value="' . $_SESSION['FormID'] . '" />'; while ($myrow=DB_fetch_array($result)) { - + $CurrDecimalPlaces = $myrow['decimalplaces']; //update database if update pressed if ((isset($_POST['Submit']) AND $_POST['Submit']=='Update') AND isset($_POST[$myrow['counterindex']])){ @@ -107,7 +108,7 @@ if ($myrow['rate'] == 1){ // functional currency $Amount = $myrow['amount']; }else{ // other currencies - $Amount = $myrow['amount']/$myrow['rate']; + $Amount = filter_number_format($myrow['amount']/$myrow['rate']); } if ($myrow['codeexpense'] == 'ASSIGNCASH'){ @@ -158,7 +159,7 @@ 0, '', 0)"; - + $ResultFrom = DB_Query($sqlFrom, $db, '', '', true); $sqlTo="INSERT INTO `gltrans` (`counterindex`, @@ -185,7 +186,7 @@ 0, '', 0)"; - + $ResultTo = DB_Query($sqlTo, $db, '', '', true); if ($myrow['codeexpense'] == 'ASSIGNCASH'){ @@ -240,7 +241,7 @@ } echo'<td>'.ConvertSQLDate($myrow['date']).'</td> <td>'.$myrow['codeexpense'].'</td> - <td class="number">'.locale_number_format($myrow['amount'],2).'</td> + <td class="number">'.locale_money_format($myrow['amount'],$CurrDecimalPlaces).'</td> <td>' . $Posted . '</td> <td>' .$myrow['notes'] . '</td> <td>' . $myrow['receipt'] . '</td>'; @@ -276,13 +277,13 @@ } echo '<tr><td colspan=2 class="number">' . _('Current balance') . ':</td> - <td class=number>'.locale_number_format($Amount['0'],2).'</td></tr>'; + <td class=number>'.locale_money_format($Amount['0'],$CurrDecimalPlaces).'</td></tr>'; // Do the postings include ('includes/GLPostings.inc'); echo'</table><br /><div class="centre"><input type="submit" name="Submit" value=' . _('Update') . '></div></form>'; - + } else { /*The option to submit was not hit so display form */ Modified: trunk/PcClaimExpensesFromTab.php =================================================================== --- trunk/PcClaimExpensesFromTab.php 2011-09-11 04:06:48 UTC (rev 4685) +++ trunk/PcClaimExpensesFromTab.php 2011-09-12 08:03:20 UTC (rev 4686) @@ -20,9 +20,9 @@ } if (isset($_POST['Days'])){ - $Days = $_POST['Days']; + $Days = filter_number_format($_POST['Days']); } elseif (isset($_GET['Days'])){ - $Days = $_GET['Days']; + $Days = filter_number_format($_GET['Days']); } if (isset($_POST['Cancel'])) { @@ -71,9 +71,9 @@ $sql = "UPDATE pcashdetails SET date = '".FormatDateForSQL($_POST['Date'])."', codeexpense = '" . $_POST['SelectedExpense'] . "', - amount = '" .- $_POST['amount'] . "', - notes = '" . $_POST['Notes'] . "', - receipt = '" . $_POST['Receipt'] . "' + amount = '" .-filter_number_format($_POST['amount']) . "', + notes = '" . DB_escape_string($_POST['Notes']) . "', + receipt = '" . DB_escape_string($_POST['Receipt']) . "' WHERE counterindex = '".$SelectedIndex."'"; $msg = _('The Expense Claim on Tab') . ' ' . $SelectedTabs . ' ' . _('has been updated'); @@ -95,11 +95,11 @@ VALUES ('','" . $_POST['SelectedTabs'] . "', '".FormatDateForSQL($_POST['Date'])."', '" . $_POST['SelectedExpense'] . "', - '" .- $_POST['amount'] . "', + '" . -filter_number_format($_POST['amount']) . "', '', '', - '" . $_POST['Notes'] . "', - '" . $_POST['Receipt'] . "' + '" . DB_escape_string($_POST['Notes']) . "', + '" . DB_escape_string($_POST['Receipt']) . "' )"; $msg = _('The Expense Claim on Tab') . ' ' . $_POST['SelectedTabs'] . ' ' . _('has been created'); @@ -181,8 +181,8 @@ echo '<br /><table class=selection>'; echo '<tr><th colspan="8"><font color="navy" size="3">' . _('Petty Cash Tab') . ' ' .$SelectedTabs. '</font></th></tr>'; echo '<tr><th colspan="8">' . _('Detail Of Movements For Last ') .': '; - + if(!isset ($Days)){ $Days=30; } @@ -254,7 +254,7 @@ </tr>', ConvertSQLDate($myrow['2']), $Description['0'], - locale_number_format($myrow['4'],2), + locale_money_format($myrow['4'],$_SESSION['CompanyRecord']['decimalplaces']), $AuthorisedDate, $myrow['7'], $myrow['8'], @@ -270,7 +270,7 @@ </tr>', ConvertSQLDate($myrow['2']), $Description['0'], - locale_number_format($myrow['4'],2), + locale_money_format($myrow['4'],$_SESSION['CompanyRecord']['decimalplaces']), $AuthorisedDate, $myrow['7'], $myrow['8']); @@ -290,9 +290,9 @@ if (!isset($Amount['0'])) { $Amount['0']=0; } - + echo '<tr><td colspan="2" style="text-align:right" >' . _('Current balance') . ':</td> - <td class="number">'.locale_number_format($Amount['0'],2) . '</td></tr>'; + <td class="number">'.locale_money_format($Amount['0'],$_SESSION['CompanyRecord']['decimalplaces']) . '</td></tr>'; echo '</table>'; @@ -302,7 +302,7 @@ echo '<form method="post" action="' . $_SERVER['PHP_SELF'] . '">'; echo '<input type="hidden" name="FormID" value="' . $_SESSION['FormID'] . '" />'; - + echo '<br /><table class="selection">'; //Main table @@ -361,7 +361,7 @@ if (!isset($_POST['Amount'])) { $_POST['Amount']=0; } - + echo '<tr><td>' . _('Amount') . ':</td> <td><input type="text" class="number" name="amount" size="12" maxlength="11" value="' . $_POST['Amount'] . '"></td></tr>'; @@ -380,7 +380,7 @@ <td><input type="text" name="Receipt" size="50" maxlength="49" value="' . $_POST['Receipt'] . '"></td></tr>'; echo '<input type="hidden" name="SelectedTabs" value="' . $SelectedTabs . '">'; echo '<input type="hidden" name="Days" value="' .$Days. '">'; - + echo '</td></tr></table>'; // close main table echo '<p><div class="centre"><input type="submit" name="submit" value="' . _('Accept') . '"><input type=submit name="Cancel" value="' . _('Cancel') . '"></div>'; echo '</form>'; Modified: trunk/PcExpenses.php =================================================================== --- trunk/PcExpenses.php 2011-09-11 04:06:48 UTC (rev 4685) +++ trunk/PcExpenses.php 2011-09-12 08:03:20 UTC (rev 4686) @@ -86,7 +86,7 @@ if (isset($SelectedExpense) AND $InputError !=1) { $sql = "UPDATE pcexpenses - SET description = '" . $_POST['Description'] . "', + SET description = '" . DB_escape_string($_POST['Description']) . "', glaccount = '" . $_POST['GLAccount'] . "' WHERE codeexpense = '" . $SelectedExpense . "'"; @@ -113,7 +113,7 @@ (codeexpense, description,glaccount) VALUES ('" . $_POST['CodeExpense'] . "', - '" . $_POST['Description'] . "', + '" . DB_escape_string($_POST['Description']) . "', '" . $_POST['GLAccount'] . "')"; $msg = _('Expense ') . ' ' . $_POST['CodeExpense'] . ' ' . _('has been created'); @@ -154,7 +154,7 @@ } else { $sql="DELETE FROM pcexpenses - WHERE codeexpense='" . $SelectedExpense . "'"; + WHERE codeexpense='" . $SelectedExpense . "'"; $ErrMsg = _('The expense type record could not be deleted because'); $result = DB_query($sql,$db,$ErrMsg); prnMsg(_('Expense type') . ' ' . $SelectedExpense . ' ' . _('has been deleted') ,'success'); @@ -203,7 +203,7 @@ printf('<td>%s</td> <td>%s</td> - <td class=number>%s</td> + <td class="number">%s</td> <td>%s</td> <td><a href="%sSelectedExpense=%s">' . _('Edit') . '</td> <td><a href="%sSelectedExpense=%s&delete=yes" onclick="return confirm(\'' . _('Are you sure you wish to delete this expense code and all the details it may have set up?') . '\');">' . _('Delete') . '</td> @@ -249,7 +249,7 @@ echo '<input type=hidden name="SelectedExpense" value="' . $SelectedExpense . '">'; echo '<input type=hidden name="CodeExpense" VALUE="' . $_POST['CodeExpense']. '">'; // We dont allow the user to change an existing type code - echo '<table class="selection"> + echo '<table class="selection"> <tr> <td>' . _('Code Of Expense') . ':</td> <td>' . $_POST['CodeExpense'] . '</td></tr>'; @@ -285,9 +285,9 @@ echo '<option value="">' . _('Not Yet Selected') . '</option>'; while ($myrow = DB_fetch_array($result)) { if (isset($_POST['GLAccount']) and $myrow['accountcode']==$_POST['GLAccount']) { - echo '<option selected VALUE="'; + echo '<option selected value="'; } else { - echo '<option VALUE="'; + echo '<option value="'; } echo $myrow['accountcode'] . '">' . $myrow['accountcode'] . ' - ' . $myrow['accountname'] . '</option>'; @@ -297,7 +297,8 @@ echo '</td></tr></table>'; // close main table - echo '<p><div class="centre"><input type="submit" name=submit VALUE="' . _('Accept') . '"><input type=submit name=Cancel VALUE="' . _('Cancel') . '"></div>'; + echo '<p><div class="centre"><input type="submit" name="submit" value="' . _('Accept') . '"> + <input type="submit" name="Cancel" value="' . _('Cancel') . '"></div>'; echo '</form>'; Modified: trunk/PcExpensesTypeTab.php =================================================================== --- trunk/PcExpensesTypeTab.php 2011-09-11 04:06:48 UTC (rev 4685) +++ trunk/PcExpensesTypeTab.php 2011-09-12 08:03:20 UTC (rev 4686) @@ -20,7 +20,7 @@ if (!isset($_GET['delete']) and (ContainsIllegalCharacters($SelectedType) OR mb_strpos($SelectedType,' ')>0)){ $InputError = 1; prnMsg(_('The petty cash tab type contain any of the following characters " \' - & or a space'),'error'); -} +} if (isset($_POST['SelectedTab'])){ $SelectedTab = mb_strtoupper($_POST['SelectedTab']); @@ -46,7 +46,7 @@ if (isset($_POST['submit'])) { $InputError=0; - + if ($_POST['SelectedExpense']=='') { $InputError=1; echo prnMsg(_('You have not selected an expense to add to this tab'),'error'); @@ -111,7 +111,7 @@ echo '<form method="post" action="' . $_SERVER['PHP_SELF'] . '">'; echo '<input type="hidden" name="FormID" value="' . $_SESSION['FormID'] . '" />'; echo '<table class="selection">'; //Main table - + echo '<tr><td>' . _('Select Type of Tab') . ':</td><td><select name="SelectedTab">'; DB_free_result($result); @@ -136,8 +136,8 @@ echo '</table>'; // close table in first column echo '</td></tr></table>'; // close main table - echo '<p><div class="centre"><input type=submit name="Process" value="' . _('Accept') . '"> - <input type=submit name="Cancel" value="' . _('Cancel') . '"></div>'; + echo '<p><div class="centre"><inpu... [truncated message content] |
From: <fox...@us...> - 2011-09-12 23:37:59
|
Revision: 4688 http://web-erp.svn.sourceforge.net/web-erp/?rev=4688&view=rev Author: foxdeluxe Date: 2011-09-12 23:37:53 +0000 (Mon, 12 Sep 2011) Log Message: ----------- number formatting Modified Paths: -------------- trunk/AgedDebtors.php trunk/AgedSuppliers.php Modified: trunk/AgedDebtors.php =================================================================== --- trunk/AgedDebtors.php 2011-09-12 08:57:11 UTC (rev 4687) +++ trunk/AgedDebtors.php 2011-09-12 23:37:53 UTC (rev 4688) @@ -291,11 +291,11 @@ while ($AgedAnalysis = DB_fetch_array($CustomerResult,$db)){ $DecimalPlaces = $AgedAnalysis['decimalplaces']; - $DisplayDue = locale_number_format($AgedAnalysis['due']-$AgedAnalysis['overdue1'],$DecimalPlaces); - $DisplayCurrent = locale_number_format($AgedAnalysis['balance']-$AgedAnalysis['due'],$DecimalPlaces); - $DisplayBalance = locale_number_format($AgedAnalysis['balance'],$DecimalPlaces); - $DisplayOverdue1 = locale_number_format($AgedAnalysis['overdue1']-$AgedAnalysis['overdue2'],$DecimalPlaces); - $DisplayOverdue2 = locale_number_format($AgedAnalysis['overdue2'],$DecimalPlaces); + $DisplayDue = locale_money_format($AgedAnalysis['due']-$AgedAnalysis['overdue1'],$DecimalPlaces); + $DisplayCurrent = locale_money_format($AgedAnalysis['balance']-$AgedAnalysis['due'],$DecimalPlaces); + $DisplayBalance = locale_money_format($AgedAnalysis['balance'],$DecimalPlaces); + $DisplayOverdue1 = locale_money_format($AgedAnalysis['overdue1']-$AgedAnalysis['overdue2'],$DecimalPlaces); + $DisplayOverdue2 = locale_money_format($AgedAnalysis['overdue2'],$DecimalPlaces); $TotBal += $AgedAnalysis['balance']; $TotDue += ($AgedAnalysis['due']-$AgedAnalysis['overdue1']); @@ -384,11 +384,11 @@ $DisplayTranDate = ConvertSQLDate($DetailTrans['trandate']); $LeftOvers = $pdf->addTextWrap($Left_Margin+125,$YPos,75,$FontSize,$DisplayTranDate,'left'); - $DisplayDue = locale_number_format($DetailTrans['due']-$DetailTrans['overdue1'],$DecimalPlaces); - $DisplayCurrent = locale_number_format($DetailTrans['balance']-$DetailTrans['due'],$DecimalPlaces); - $DisplayBalance = locale_number_format($DetailTrans['balance'],$DecimalPlaces); - $DisplayOverdue1 = locale_number_format($DetailTrans['overdue1']-$DetailTrans['overdue2'],$DecimalPlaces); - $DisplayOverdue2 = locale_number_format($DetailTrans['overdue2'],$DecimalPlaces); + $DisplayDue = locale_money_format($DetailTrans['due']-$DetailTrans['overdue1'],$DecimalPlaces); + $DisplayCurrent = locale_money_format($DetailTrans['balance']-$DetailTrans['due'],$DecimalPlaces); + $DisplayBalance = locale_money_format($DetailTrans['balance'],$DecimalPlaces); + $DisplayOverdue1 = locale_money_format($DetailTrans['overdue1']-$DetailTrans['overdue2'],$DecimalPlaces); + $DisplayOverdue2 = locale_money_format($DetailTrans['overdue2'],$DecimalPlaces); $LeftOvers = $pdf->addTextWrap(220,$YPos,60,$FontSize,$DisplayBalance,'right'); $LeftOvers = $pdf->addTextWrap(280,$YPos,60,$FontSize,$DisplayCurrent,'right'); @@ -418,11 +418,11 @@ $pdf->line($Page_Width-$Right_Margin, $YPos+10 ,220, $YPos+10); } - $DisplayTotBalance = locale_number_format($TotBal,$DecimalPlaces); - $DisplayTotDue = locale_number_format($TotDue,$DecimalPlaces); - $DisplayTotCurrent = locale_number_format($TotCurr,$DecimalPlaces); - $DisplayTotOverdue1 = locale_number_format($TotOD1,$DecimalPlaces); - $DisplayTotOverdue2 = locale_number_format($TotOD2,$DecimalPlaces); + $DisplayTotBalance = locale_money_format($TotBal,$DecimalPlaces); + $DisplayTotDue = locale_money_format($TotDue,$DecimalPlaces); + $DisplayTotCurrent = locale_money_format($TotCurr,$DecimalPlaces); + $DisplayTotOverdue1 = locale_money_format($TotOD1,$DecimalPlaces); + $DisplayTotOverdue2 = locale_money_format($TotOD2,$DecimalPlaces); $LeftOvers = $pdf->addTextWrap(220,$YPos,60,$FontSize,$DisplayTotBalance,'right'); $LeftOvers = $pdf->addTextWrap(280,$YPos,60,$FontSize,$DisplayTotCurrent,'right'); @@ -516,4 +516,4 @@ } include('includes/footer.inc'); } /*end of else not PrintPDF */ -?> \ No newline at end of file +?> Modified: trunk/AgedSuppliers.php =================================================================== --- trunk/AgedSuppliers.php 2011-09-12 08:57:11 UTC (rev 4687) +++ trunk/AgedSuppliers.php 2011-09-12 23:37:53 UTC (rev 4688) @@ -126,11 +126,11 @@ While ($AgedAnalysis = DB_fetch_array($SupplierResult,$db)){ - $DisplayDue = locale_number_format($AgedAnalysis['due']-$AgedAnalysis['overdue1'],2); - $DisplayCurrent = locale_number_format($AgedAnalysis['balance']-$AgedAnalysis['due'],2); - $DisplayBalance = locale_number_format($AgedAnalysis['balance'],2); - $DisplayOverdue1 = locale_number_format($AgedAnalysis['overdue1']-$AgedAnalysis['overdue2'],2); - $DisplayOverdue2 = locale_number_format($AgedAnalysis['overdue2'],2); + $DisplayDue = locale_money_format($AgedAnalysis['due']-$AgedAnalysis['overdue1'],2); + $DisplayCurrent = locale_money_format($AgedAnalysis['balance']-$AgedAnalysis['due'],2); + $DisplayBalance = locale_money_format($AgedAnalysis['balance'],2); + $DisplayOverdue1 = locale_money_format($AgedAnalysis['overdue1']-$AgedAnalysis['overdue2'],2); + $DisplayOverdue2 = locale_money_format($AgedAnalysis['overdue2'],2); $TotBal += $AgedAnalysis['balance']; $TotDue += ($AgedAnalysis['due']-$AgedAnalysis['overdue1']); @@ -204,11 +204,11 @@ $DisplayTranDate = ConvertSQLDate($DetailTrans['trandate']); $LeftOvers = $pdf->addTextWrap($Left_Margin+105,$YPos,70,$FontSize,$DisplayTranDate,'left'); - $DisplayDue = locale_number_format($DetailTrans['due']-$DetailTrans['overdue1'],2); - $DisplayCurrent = locale_number_format($DetailTrans['balance']-$DetailTrans['due'],2); - $DisplayBalance = locale_number_format($DetailTrans['balance'],2); - $DisplayOverdue1 = locale_number_format($DetailTrans['overdue1']-$DetailTrans['overdue2'],2); - $DisplayOverdue2 = locale_number_format($DetailTrans['overdue2'],2); + $DisplayDue = locale_money_format($DetailTrans['due']-$DetailTrans['overdue1'],2); + $DisplayCurrent = locale_money_format($DetailTrans['balance']-$DetailTrans['due'],2); + $DisplayBalance = locale_money_format($DetailTrans['balance'],2); + $DisplayOverdue1 = locale_money_format($DetailTrans['overdue1']-$DetailTrans['overdue2'],2); + $DisplayOverdue2 = locale_money_format($DetailTrans['overdue2'],2); $LeftOvers = $pdf->addTextWrap(220,$YPos,60,$FontSize,$DisplayBalance,'right'); $LeftOvers = $pdf->addTextWrap(280,$YPos,60,$FontSize,$DisplayCurrent,'right'); @@ -238,11 +238,11 @@ $pdf->line($Page_Width-$Right_Margin, $YPos+10 ,220, $YPos+10); } - $DisplayTotBalance = locale_number_format($TotBal,2); - $DisplayTotDue = locale_number_format($TotDue,2); - $DisplayTotCurrent = locale_number_format($TotCurr,2); - $DisplayTotOverdue1 = locale_number_format($TotOD1,2); - $DisplayTotOverdue2 = locale_number_format($TotOD2,2); + $DisplayTotBalance = locale_money_format($TotBal,2); + $DisplayTotDue = locale_money_format($TotDue,2); + $DisplayTotCurrent = locale_money_format($TotCurr,2); + $DisplayTotOverdue1 = locale_money_format($TotOD1,2); + $DisplayTotOverdue2 = locale_money_format($TotOD2,2); $LeftOvers = $pdf->addTextWrap(220,$YPos,60,$FontSize,$DisplayTotBalance,'right'); $LeftOvers = $pdf->addTextWrap(280,$YPos,60,$FontSize,$DisplayTotCurrent,'right'); @@ -314,4 +314,4 @@ include('includes/footer.inc'); } /*end of else not PrintPDF */ -?> \ No newline at end of file +?> This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <fox...@us...> - 2011-09-12 23:37:59
|
Revision: 4688 http://web-erp.svn.sourceforge.net/web-erp/?rev=4688&view=rev Author: foxdeluxe Date: 2011-09-12 23:37:53 +0000 (Mon, 12 Sep 2011) Log Message: ----------- number formatting Modified Paths: -------------- trunk/AgedDebtors.php trunk/AgedSuppliers.php Modified: trunk/AgedDebtors.php =================================================================== --- trunk/AgedDebtors.php 2011-09-12 08:57:11 UTC (rev 4687) +++ trunk/AgedDebtors.php 2011-09-12 23:37:53 UTC (rev 4688) @@ -291,11 +291,11 @@ while ($AgedAnalysis = DB_fetch_array($CustomerResult,$db)){ $DecimalPlaces = $AgedAnalysis['decimalplaces']; - $DisplayDue = locale_number_format($AgedAnalysis['due']-$AgedAnalysis['overdue1'],$DecimalPlaces); - $DisplayCurrent = locale_number_format($AgedAnalysis['balance']-$AgedAnalysis['due'],$DecimalPlaces); - $DisplayBalance = locale_number_format($AgedAnalysis['balance'],$DecimalPlaces); - $DisplayOverdue1 = locale_number_format($AgedAnalysis['overdue1']-$AgedAnalysis['overdue2'],$DecimalPlaces); - $DisplayOverdue2 = locale_number_format($AgedAnalysis['overdue2'],$DecimalPlaces); + $DisplayDue = locale_money_format($AgedAnalysis['due']-$AgedAnalysis['overdue1'],$DecimalPlaces); + $DisplayCurrent = locale_money_format($AgedAnalysis['balance']-$AgedAnalysis['due'],$DecimalPlaces); + $DisplayBalance = locale_money_format($AgedAnalysis['balance'],$DecimalPlaces); + $DisplayOverdue1 = locale_money_format($AgedAnalysis['overdue1']-$AgedAnalysis['overdue2'],$DecimalPlaces); + $DisplayOverdue2 = locale_money_format($AgedAnalysis['overdue2'],$DecimalPlaces); $TotBal += $AgedAnalysis['balance']; $TotDue += ($AgedAnalysis['due']-$AgedAnalysis['overdue1']); @@ -384,11 +384,11 @@ $DisplayTranDate = ConvertSQLDate($DetailTrans['trandate']); $LeftOvers = $pdf->addTextWrap($Left_Margin+125,$YPos,75,$FontSize,$DisplayTranDate,'left'); - $DisplayDue = locale_number_format($DetailTrans['due']-$DetailTrans['overdue1'],$DecimalPlaces); - $DisplayCurrent = locale_number_format($DetailTrans['balance']-$DetailTrans['due'],$DecimalPlaces); - $DisplayBalance = locale_number_format($DetailTrans['balance'],$DecimalPlaces); - $DisplayOverdue1 = locale_number_format($DetailTrans['overdue1']-$DetailTrans['overdue2'],$DecimalPlaces); - $DisplayOverdue2 = locale_number_format($DetailTrans['overdue2'],$DecimalPlaces); + $DisplayDue = locale_money_format($DetailTrans['due']-$DetailTrans['overdue1'],$DecimalPlaces); + $DisplayCurrent = locale_money_format($DetailTrans['balance']-$DetailTrans['due'],$DecimalPlaces); + $DisplayBalance = locale_money_format($DetailTrans['balance'],$DecimalPlaces); + $DisplayOverdue1 = locale_money_format($DetailTrans['overdue1']-$DetailTrans['overdue2'],$DecimalPlaces); + $DisplayOverdue2 = locale_money_format($DetailTrans['overdue2'],$DecimalPlaces); $LeftOvers = $pdf->addTextWrap(220,$YPos,60,$FontSize,$DisplayBalance,'right'); $LeftOvers = $pdf->addTextWrap(280,$YPos,60,$FontSize,$DisplayCurrent,'right'); @@ -418,11 +418,11 @@ $pdf->line($Page_Width-$Right_Margin, $YPos+10 ,220, $YPos+10); } - $DisplayTotBalance = locale_number_format($TotBal,$DecimalPlaces); - $DisplayTotDue = locale_number_format($TotDue,$DecimalPlaces); - $DisplayTotCurrent = locale_number_format($TotCurr,$DecimalPlaces); - $DisplayTotOverdue1 = locale_number_format($TotOD1,$DecimalPlaces); - $DisplayTotOverdue2 = locale_number_format($TotOD2,$DecimalPlaces); + $DisplayTotBalance = locale_money_format($TotBal,$DecimalPlaces); + $DisplayTotDue = locale_money_format($TotDue,$DecimalPlaces); + $DisplayTotCurrent = locale_money_format($TotCurr,$DecimalPlaces); + $DisplayTotOverdue1 = locale_money_format($TotOD1,$DecimalPlaces); + $DisplayTotOverdue2 = locale_money_format($TotOD2,$DecimalPlaces); $LeftOvers = $pdf->addTextWrap(220,$YPos,60,$FontSize,$DisplayTotBalance,'right'); $LeftOvers = $pdf->addTextWrap(280,$YPos,60,$FontSize,$DisplayTotCurrent,'right'); @@ -516,4 +516,4 @@ } include('includes/footer.inc'); } /*end of else not PrintPDF */ -?> \ No newline at end of file +?> Modified: trunk/AgedSuppliers.php =================================================================== --- trunk/AgedSuppliers.php 2011-09-12 08:57:11 UTC (rev 4687) +++ trunk/AgedSuppliers.php 2011-09-12 23:37:53 UTC (rev 4688) @@ -126,11 +126,11 @@ While ($AgedAnalysis = DB_fetch_array($SupplierResult,$db)){ - $DisplayDue = locale_number_format($AgedAnalysis['due']-$AgedAnalysis['overdue1'],2); - $DisplayCurrent = locale_number_format($AgedAnalysis['balance']-$AgedAnalysis['due'],2); - $DisplayBalance = locale_number_format($AgedAnalysis['balance'],2); - $DisplayOverdue1 = locale_number_format($AgedAnalysis['overdue1']-$AgedAnalysis['overdue2'],2); - $DisplayOverdue2 = locale_number_format($AgedAnalysis['overdue2'],2); + $DisplayDue = locale_money_format($AgedAnalysis['due']-$AgedAnalysis['overdue1'],2); + $DisplayCurrent = locale_money_format($AgedAnalysis['balance']-$AgedAnalysis['due'],2); + $DisplayBalance = locale_money_format($AgedAnalysis['balance'],2); + $DisplayOverdue1 = locale_money_format($AgedAnalysis['overdue1']-$AgedAnalysis['overdue2'],2); + $DisplayOverdue2 = locale_money_format($AgedAnalysis['overdue2'],2); $TotBal += $AgedAnalysis['balance']; $TotDue += ($AgedAnalysis['due']-$AgedAnalysis['overdue1']); @@ -204,11 +204,11 @@ $DisplayTranDate = ConvertSQLDate($DetailTrans['trandate']); $LeftOvers = $pdf->addTextWrap($Left_Margin+105,$YPos,70,$FontSize,$DisplayTranDate,'left'); - $DisplayDue = locale_number_format($DetailTrans['due']-$DetailTrans['overdue1'],2); - $DisplayCurrent = locale_number_format($DetailTrans['balance']-$DetailTrans['due'],2); - $DisplayBalance = locale_number_format($DetailTrans['balance'],2); - $DisplayOverdue1 = locale_number_format($DetailTrans['overdue1']-$DetailTrans['overdue2'],2); - $DisplayOverdue2 = locale_number_format($DetailTrans['overdue2'],2); + $DisplayDue = locale_money_format($DetailTrans['due']-$DetailTrans['overdue1'],2); + $DisplayCurrent = locale_money_format($DetailTrans['balance']-$DetailTrans['due'],2); + $DisplayBalance = locale_money_format($DetailTrans['balance'],2); + $DisplayOverdue1 = locale_money_format($DetailTrans['overdue1']-$DetailTrans['overdue2'],2); + $DisplayOverdue2 = locale_money_format($DetailTrans['overdue2'],2); $LeftOvers = $pdf->addTextWrap(220,$YPos,60,$FontSize,$DisplayBalance,'right'); $LeftOvers = $pdf->addTextWrap(280,$YPos,60,$FontSize,$DisplayCurrent,'right'); @@ -238,11 +238,11 @@ $pdf->line($Page_Width-$Right_Margin, $YPos+10 ,220, $YPos+10); } - $DisplayTotBalance = locale_number_format($TotBal,2); - $DisplayTotDue = locale_number_format($TotDue,2); - $DisplayTotCurrent = locale_number_format($TotCurr,2); - $DisplayTotOverdue1 = locale_number_format($TotOD1,2); - $DisplayTotOverdue2 = locale_number_format($TotOD2,2); + $DisplayTotBalance = locale_money_format($TotBal,2); + $DisplayTotDue = locale_money_format($TotDue,2); + $DisplayTotCurrent = locale_money_format($TotCurr,2); + $DisplayTotOverdue1 = locale_money_format($TotOD1,2); + $DisplayTotOverdue2 = locale_money_format($TotOD2,2); $LeftOvers = $pdf->addTextWrap(220,$YPos,60,$FontSize,$DisplayTotBalance,'right'); $LeftOvers = $pdf->addTextWrap(280,$YPos,60,$FontSize,$DisplayTotCurrent,'right'); @@ -314,4 +314,4 @@ include('includes/footer.inc'); } /*end of else not PrintPDF */ -?> \ No newline at end of file +?> This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <dai...@us...> - 2011-09-14 08:06:54
|
Revision: 4689 http://web-erp.svn.sourceforge.net/web-erp/?rev=4689&view=rev Author: daintree Date: 2011-09-14 08:06:45 +0000 (Wed, 14 Sep 2011) Log Message: ----------- number_formatting Modified Paths: -------------- trunk/BankReconciliation.php trunk/PDFGrn.php trunk/PDFOrdersInvoiced.php trunk/PDFPeriodStockTransListing.php trunk/PDFPickingList.php trunk/PDFPriceList.php trunk/PDFPrintLabel.php trunk/PDFQuotation.php trunk/PDFQuotationPortrait.php trunk/PDFReceipt.php trunk/PDFRemittanceAdvice.php trunk/PDFStockCheckComparison.php trunk/PDFStockLocTransfer.php trunk/SelectOrderItems.php trunk/StockTransfers.php trunk/includes/GLPostings.inc trunk/includes/LanguageSetup.php trunk/includes/SQL_CommonFunctions.inc trunk/includes/SelectOrderItems_IntoCart.inc Modified: trunk/BankReconciliation.php =================================================================== --- trunk/BankReconciliation.php 2011-09-12 23:37:53 UTC (rev 4688) +++ trunk/BankReconciliation.php 2011-09-14 08:06:45 UTC (rev 4689) @@ -19,27 +19,26 @@ if (isset($_POST['PostExchangeDifference']) and is_numeric($_POST['DoExchangeDifference'])){ - if (!is_numeric($_POST['BankStatementBalance'])){ + if (!is_numeric(filter_number_format($_POST['BankStatementBalance']))){ prnMsg(_('The entry in the bank statement balance is not numeric. The balance on the bank statement should be entered. The exchange difference has not been calculated and no general ledger journal has been created'),'warn'); echo '<p>' . $_POST['BankStatementBalance']; } else { + $_POST['BankStatementBalance'] = filter_number_format($_POST['BankStatementBalance']); /* Now need to get the currency of the account and the current table ex rate */ $SQL = "SELECT rate, bankaccountname, - decimalplaces + decimalplaces AS currdecimalplaces FROM bankaccounts INNER JOIN currencies ON bankaccounts.currcode=currencies.currabrev WHERE bankaccounts.accountcode = '" . $_POST['BankAccount']."'"; $ErrMsg = _('Could not retrieve the exchange rate for the selected bank account'); $CurrencyResult = DB_query($SQL,$db); - $CurrencyRow = DB_fetch_row($CurrencyResult); - $ExRate = $CurrencyRow[0]; - $BankAccountName = $CurrencyRow[1]; - $CurrDecimalPlaces = $CurrencyRow[2]; - $CalculatedBalance = $_POST['DoExchangeDifference']; + $CurrencyRow = DB_fetch_array($CurrencyResult); + + $CalculatedBalance = filter_number_format($_POST['DoExchangeDifference']); - $ExchangeDifference = ($CalculatedBalance - $_POST['BankStatementBalance'])/$ExRate; + $ExchangeDifference = filter_number_format(($CalculatedBalance - $_POST['BankStatementBalance'])/$CurrencyRow['rate']); include ('includes/SQL_CommonFunctions.inc'); $ExDiffTransNo = GetNextTransNo(36,$db); @@ -62,7 +61,7 @@ '" . FormatDateForSQL($PostingDate) . "', '" . $PeriodNo . "', '" . $_SESSION['CompanyRecord']['exchangediffact'] . "', - '" . $BankAccountName . ' ' . _('reconciliation on') . " " . + '" . $CurrencyRow['bankaccountname'] . ' ' . _('reconciliation on') . " " . Date($_SESSION['DefaultDateFormat']) . "','" . $ExchangeDifference . "')"; $ErrMsg = _('Cannot insert a GL entry for the exchange difference because'); @@ -80,13 +79,13 @@ '" . FormatDateForSQL($PostingDate) . "', '" . $PeriodNo . "', '" . $_POST['BankAccount'] . "', - '" . $BankAccountName . ' ' . _('reconciliation on') . ' ' . Date($_SESSION['DefaultDateFormat']) . "', + '" . $CurrencyRow['bankaccountname'] . ' ' . _('reconciliation on') . ' ' . Date($_SESSION['DefaultDateFormat']) . "', '" . (-$ExchangeDifference) . "')"; $result = DB_query($SQL,$db,$ErrMsg,$DbgMsg,true); $result = DB_Txn_Commit($db); - prnMsg(_('Exchange difference of') . ' ' . locale_number_format($ExchangeDifference,2) . ' ' . _('has been posted'),'success'); + prnMsg(_('Exchange difference of') . ' ' . locale_money_format($ExchangeDifference,$_SESSION['CompanyRecord']['decimalplaces']) . ' ' . _('has been posted'),'success'); } //end if the bank statement balance was numeric } @@ -153,25 +152,24 @@ /* Now need to get the currency of the account and the current table ex rate */ $SQL = "SELECT rate, bankaccounts.currcode, - bankaccounts.bankaccountname + bankaccounts.bankaccountname, + currencies.decimalplaces AS currdecimalplaces FROM bankaccounts INNER JOIN currencies ON bankaccounts.currcode=currencies.currabrev WHERE bankaccounts.accountcode = '" . $_POST['BankAccount']."'"; $ErrMsg = _('Could not retrieve the currency and exchange rate for the selected bank account'); $CurrencyResult = DB_query($SQL,$db); - $CurrencyRow = DB_fetch_row($CurrencyResult); - $ExRate = $CurrencyRow[0]; - $BankCurrCode = $CurrencyRow[1]; - $BankAccountName = $CurrencyRow[2]; + $CurrencyRow = DB_fetch_array($CurrencyResult); + echo '<table class="selection"> - <tr class="EvenTableRows"><td colspan=6><b>' . $BankAccountName . ' ' . _('Balance as at') . ' ' . Date($_SESSION['DefaultDateFormat']); + <tr class="EvenTableRows"><td colspan=6><b>' . $CurrencyRow['bankaccountname'] . ' ' . _('Balance as at') . ' ' . Date($_SESSION['DefaultDateFormat']); - if ($_SESSION['CompanyRecord']['currencydefault']!=$BankCurrCode){ - echo ' (' . $BankCurrCode . ' @ ' . $ExRate .')'; + if ($_SESSION['CompanyRecord']['currencydefault']!=$CurrencyRow['currcode']){ + echo ' (' . $CurrencyRow['currcode'] . ' @ ' . $CurrencyRow['rate'] .')'; } echo '</b></td> - <td valign=bottom class="number"><b>' . locale_number_format($Balance*$ExRate,$CurrDecimalPlaces) . '</b></td></tr>'; + <td valign=bottom class="number"><b>' . locale_money_format($Balance*$CurrencyRow['rate'],$CurrencyRow['currdecimalplaces']) . '</b></td></tr>'; $SQL = "SELECT amount/exrate AS amt, amountcleared, @@ -222,15 +220,15 @@ <td>%s</td> <td>%s</td> <td>%s</td> - <td class=number>%s</td> - <td class=number>%s</td> + <td class="number">%s</td> + <td class="number">%s</td> </tr>', ConvertSQLDate($myrow['transdate']), $myrow['typename'], $myrow['transno'], $myrow['ref'], - locale_number_format($myrow['amt'],$CurrDecimalPlaces), - locale_number_format($myrow['outstanding'],$CurrDecimalPlaces)); + locale_money_format($myrow['amt'],$CurrencyRow['currdecimalplaces']), + locale_money_format($myrow['outstanding'],$CurrencyRow['currdecimalplaces'])); $TotalUnpresentedCheques +=$myrow['outstanding']; @@ -241,20 +239,20 @@ } } //end of while loop + $TotalUnpresentedCheques = filter_number_format($TotalUnpresentedCheques); echo '<tr></tr> - <tr class=EvenTableRows><td colspan=6>' . _('Total of all unpresented cheques') . '</td><td class="number">' . locale_number_format($TotalUnpresentedCheques,$CurrDecimalPlaces) . '</td></tr>'; + <tr class=EvenTableRows><td colspan=6>' . _('Total of all unpresented cheques') . '</td><td class="number">' . locale_money_format($TotalUnpresentedCheques,$CurrencyRow['currdecimalplaces']) . '</td></tr>'; $SQL = "SELECT amount/exrate AS amt, amountcleared, - (amount/exrate)-amountcleared as outstanding, + (amount/exrate)-amountcleared AS outstanding, ref, transdate, systypes.typename, transno - FROM banktrans, - systypes - WHERE banktrans.type = systypes.typeid - AND banktrans.bankact='" . $_POST['BankAccount'] . "' + FROM banktrans INNER JOIN systypes + ON banktrans.type = systypes.typeid + WHERE banktrans.bankact='" . $_POST['BankAccount'] . "' AND amount > 0 AND ABS((amount/exrate)-amountcleared)>0.009 ORDER BY transdate"; @@ -264,7 +262,7 @@ $UPChequesResult = DB_query($SQL,$db,$ErrMsg); - echo '<tr><td colspan=6><b>' . _('Less deposits not cleared') . ':</b></td></tr>'; + echo '<tr><td colspan="6"><b>' . _('Less deposits not cleared') . ':</b></td></tr>'; $TableHeader = '<tr> <th>' . _('Date') . '</th> @@ -294,15 +292,15 @@ <td>%s</td> <td>%s</td> <td>%s</td> - <td class=number>%s</td> - <td class=number>%s</td> + <td class="number">%s</td> + <td class="number">%s</td> </tr>', ConvertSQLDate($myrow['transdate']), $myrow['typename'], $myrow['transno'], $myrow['ref'], - locale_number_format($myrow['amt'],$CurrDecimalPlaces), - locale_number_format($myrow['outstanding'],$CurrDecimalPlaces) ); + locale_money_format($myrow['amt'],$CurrencyRow['currdecimalplaces']), + locale_money_format($myrow['outstanding'],$CurrencyRow['currdecimalplaces']) ); $TotalUnclearedDeposits +=$myrow['outstanding']; @@ -316,25 +314,28 @@ echo '<tr></tr> <tr class=EvenTableRows> <td colspan=6>' . _('Total of all uncleared deposits') . '</td> - <td class=number>' . locale_number_format($TotalUnclearedDeposits,$CurrDecimalPlaces) . '</td> + <td class="number">' . locale_money_format($TotalUnclearedDeposits,$CurrencyRow['currdecimalplaces']) . '</td> </tr>'; - $FXStatementBalance = ($Balance*$ExRate) - $TotalUnpresentedCheques -$TotalUnclearedDeposits; + $FXStatementBalance = filter_number_format(($Balance*$CurrencyRow['rate']) - $TotalUnpresentedCheques -$TotalUnclearedDeposits); echo '<tr></tr> <tr class=EvenTableRows> - <td colspan=6><b>' . _('Bank statement balance should be') . ' (' . $BankCurrCode . ')</b></td> - <td class=number>' . locale_number_format($FXStatementBalance,$CurrDecimalPlaces) . '</td></tr>'; + <td colspan=6><b>' . _('Bank statement balance should be') . ' (' . $CurrencyRow['currcode'] . ')</b></td> + <td class="number">' . locale_money_format($FXStatementBalance,$CurrencyRow['currdecimalplaces']) . '</td></tr>'; if (isset($_POST['DoExchangeDifference'])){ - echo '<input type="hidden" name="DoExchangeDifference" value=' . $FXStatementBalance . '>'; - echo '<tr><td colspan=6>' . _('Enter the actual bank statement balance') . ' (' . $BankCurrCode . ')</b></td> - <td class=number><input type="text" name="BankStatementBalance" maxlength=15 size=15 value=' . $_POST['BankStatementBalance'] . '><td></tr>'; + echo '<input type="hidden" name="DoExchangeDifference" value=' . $FXStatementBalance . ' />'; + if (!isset($_POST['BankStatementBalance'])){ + $_POST['BankStatementBalance'] =0; + } + echo '<tr><td colspan=6>' . _('Enter the actual bank statement balance') . ' (' . $CurrencyRow['currcode'] . ')</b></td> + <td class="number"><input type="text" name="BankStatementBalance" maxlength="15" size="15" value=' . locale_number_format($_POST['BankStatementBalance'],$CurrencyRow['currdecimalplaces']) . ' /><td></tr>'; echo '<tr><td colspan=7 align="center"><input type="submit" name="PostExchangeDifference" value="' . _('Calculate and Post Exchange Difference') . '" onclick="return confirm(\'' . _('This will create a general ledger journal to write off the exchange difference in the current balance of the account. It is important that the exchange rate above reflects the current value of the bank account currency') . ' - ' . _('Are You Sure?') . '\');"></td></tr>'; } - if ($_SESSION['CompanyRecord']['currencydefault']!=$BankCurrCode AND !isset($_POST['DoExchangeDifference'])){ + if ($_SESSION['CompanyRecord']['currencydefault']!=$CurrencyRow['currcode'] AND !isset($_POST['DoExchangeDifference'])){ echo '<tr><td colspan=7><hr></td></tr> <tr><td colspan=7>' . _('It is normal for foreign currency accounts to have exchange differences that need to be reflected as the exchange rate varies. This reconciliation is prepared using the exchange rate set up in the currencies table (see the set-up tab). This table must be maintained with the current exchange rate before running the reconciliation. If you wish to create a journal to reflect the exchange difference based on the current exchange rate to correct the reconciliation to the actual bank statement balance click below.') . '</td></tr>'; Modified: trunk/PDFGrn.php =================================================================== --- trunk/PDFGrn.php 2011-09-12 23:37:53 UTC (rev 4688) +++ trunk/PDFGrn.php 2011-09-14 08:06:45 UTC (rev 4689) @@ -54,12 +54,12 @@ ON grns.podetailitem=purchorderdetails.podetailitem LEFT JOIN stockmaster ON grns.itemcode=stockmaster.stockid - WHERE grnbatch='".$GRNNo."'"; - + WHERE grnbatch='".filter_number_format($GRNNo)."'"; + $GRNResult=DB_query($sql, $db); $NoOfGRNs = DB_num_rows($GRNResult); if($NoOfGRNs>0) { //there are GRNs to print - + $sql = "SELECT suppliers.suppname, suppliers.address1, suppliers.address2 , @@ -69,14 +69,14 @@ suppliers.address6 FROM grns INNER JOIN suppliers ON grns.supplierid=suppliers.supplierid - WHERE grnbatch='".$GRNNo."'"; + WHERE grnbatch='".filter_number_format($GRNNo)."'"; $SuppResult = DB_query($sql,$db,_('Could not get the supplier of the selected GRN')); $SuppRow = DB_fetch_array($SuppResult); } } // get data to print if ($NoOfGRNs >0){ include ('includes/PDFGrnHeader.inc'); //head up the page - + $YPos=$FormDesign->Data->y; for ($i=1;$i<=$NoOfGRNs;$i++) { if ($GRNNo!='Preview'){ @@ -88,13 +88,13 @@ $DecimalPlaces=2; } if (is_numeric($myrow['conversionfactor']) AND $myrow['conversionfactor'] !=0){ - $SuppliersQuantity=locale_number_format($myrow['qtyrecd']/$myrow['conversionfactor'],$DecimalPlaces); + $SuppliersQuantity=locale_number_format(filter_number_format($myrow['qtyrecd']/$myrow['conversionfactor']),$DecimalPlaces); } else { $SuppliersQuantity=locale_number_format($myrow['qtyrecd'],$DecimalPlaces); } $OurUnitsQuantity=locale_number_format($myrow['qtyrecd'],$DecimalPlaces); $DeliveryDate = ConvertSQLDate($myrow['deliverydate']); - + $LeftOvers = $pdf->addTextWrap($FormDesign->Data->Column1->x,$Page_Height-$YPos,$FormDesign->Data->Column1->Length,$FormDesign->Data->Column1->FontSize, $myrow['itemcode']); $LeftOvers = $pdf->addTextWrap($FormDesign->Data->Column2->x,$Page_Height-$YPos,$FormDesign->Data->Column2->Length,$FormDesign->Data->Column2->FontSize, $myrow['itemdescription']); $LeftOvers = $pdf->addTextWrap($FormDesign->Data->Column3->x,$Page_Height-$YPos,$FormDesign->Data->Column3->Length,$FormDesign->Data->Column3->FontSize, $DeliveryDate); @@ -114,13 +114,13 @@ $LeftOvers = $pdf->addText($FormDesign->ReceiptDate->x,$Page_Height-$FormDesign->ReceiptDate->y,$FormDesign->ReceiptDate->FontSize, _('Date of Receipt: ') . $DeliveryDate); $LeftOvers = $pdf->addText($FormDesign->SignedFor->x,$Page_Height-$FormDesign->SignedFor->y,$FormDesign->SignedFor->FontSize, _('Signed for ').'______________________'); - $pdf->OutputD($_SESSION['DatabaseName'] . '_GRN_' . date('Y-m-d').'.pdf');//UldisN - $pdf->__destruct(); //UldisN + $pdf->OutputD($_SESSION['DatabaseName'] . '_GRN_' . date('Y-m-d').'.pdf'); + $pdf->__destruct(); } else { //there were not GRNs to print $title = _('GRN Error'); include('includes/header.inc'); prnMsg(_('There were no GRNs to print'),'warn'); - echo '<br /><a href="'.$rootpath.'/index.php?' . SID . '">'. _('Back to the menu').'</a>'; + echo '<br /><a href="'.$rootpath.'/index.php">'. _('Back to the menu').'</a>'; include('includes/footer.inc'); } ?> \ No newline at end of file Modified: trunk/PDFOrdersInvoiced.php =================================================================== --- trunk/PDFOrdersInvoiced.php 2011-09-12 23:37:53 UTC (rev 4688) +++ trunk/PDFOrdersInvoiced.php 2011-09-14 08:06:45 UTC (rev 4689) @@ -211,7 +211,7 @@ stockmaster.description, stockmaster.units, stockmaster.decimalplaces"; - + } elseif ($_POST['CategoryID']!='All' AND $_POST['location']!='All'){ $sql= "SELECT salesorders.orderno, @@ -290,7 +290,7 @@ if($OrderNo != $myrow['orderno']){ if ($AccumOrderTotal !=0){ $LeftOvers = $pdf->addTextWrap($Left_Margin+250,$YPos,120,$FontSize,_('Total Invoiced for order') . ' ' . $OrderNo , 'left'); - $LeftOvers = $pdf->addTextWrap($Left_Margin+360,$YPos,80,$FontSize,locale_number_format($AccumOrderTotal,2), 'right'); + $LeftOvers = $pdf->addTextWrap($Left_Margin+360,$YPos,80,$FontSize,locale_money_format(filter_number_format($AccumOrderTotal),$_SESSION['CompanyRecord']['decimalplaces']), 'right'); $YPos -= ($line_height); $AccumOrderTotal =0; } @@ -395,12 +395,12 @@ while ($InvRow=DB_fetch_array($InvoicesResult)){ - $ValueInvoiced = $InvRow['price']*$InvRow['quantity']; + $ValueInvoiced = filter_number_format($InvRow['price']*$InvRow['quantity']); $LeftOvers = $pdf->addTextWrap($Left_Margin+150,$YPos,90,$FontSize,$InvRow['typename'] . ' ' . $InvRow['transno'], 'left'); $LeftOvers = $pdf->addTextWrap($Left_Margin+240,$YPos,60,$FontSize,locale_number_format($InvRow['quantity'],$myrow['decimalplaces']), 'right'); - $LeftOvers = $pdf->addTextWrap($Left_Margin+300,$YPos,60,$FontSize,locale_number_format($InvRow['price'],2), 'right'); - $LeftOvers = $pdf->addTextWrap($Left_Margin+360,$YPos,80,$FontSize,locale_number_format($ValueInvoiced,2), 'right'); + $LeftOvers = $pdf->addTextWrap($Left_Margin+300,$YPos,60,$FontSize,locale_money_format($InvRow['price'],$_SESSION['CompanyRecord']['decimalplaces']), 'right'); + $LeftOvers = $pdf->addTextWrap($Left_Margin+360,$YPos,80,$FontSize,locale_money_format($ValueInvoiced,$_SESSION['CompanyRecord']['decimalplaces']), 'right'); $YPos -= ($line_height); @@ -414,7 +414,6 @@ } - $YPos -= ($line_height); if ($YPos - (2 *$line_height) < $Bottom_Margin){ /*Then set up a new page */ @@ -425,7 +424,7 @@ $YPos -= ($line_height); $LeftOvers = $pdf->addTextWrap($Left_Margin+260,$YPos,100,$FontSize,_('GRAND TOTAL INVOICED'), 'right'); -$LeftOvers = $pdf->addTextWrap($Left_Margin+360,$YPos,80,$FontSize,locale_number_format($AccumTotalInv,2), 'right'); +$LeftOvers = $pdf->addTextWrap($Left_Margin+360,$YPos,80,$FontSize,locale_money_format(filter_number_format($AccumTotalInv),$_SESSION['CompanyRecord']['decimalplaces']), 'right'); $YPos -= ($line_height); $pdf->OutputD($_SESSION['DatabaseName'] . '_OrdersInvoiced_' . date('Y-m-d') . '.pdf'); Modified: trunk/PDFPeriodStockTransListing.php =================================================================== --- trunk/PDFPeriodStockTransListing.php 2011-09-12 23:37:53 UTC (rev 4688) +++ trunk/PDFPeriodStockTransListing.php 2011-09-14 08:06:45 UTC (rev 4689) @@ -1,207 +1,207 @@ -<?php -/* $Id: PDFPeriodStockTransListing.php 4307 2010-12-22 16:06:03Z tim_schofield $*/ - -include('includes/SQL_CommonFunctions.inc'); -include ('includes/session.inc'); - -$InputError=0; -if (isset($_POST['FromDate']) AND !Is_Date($_POST['FromDate'])){ - $msg = _('The date must be specified in the format') . ' ' . $_SESSION['DefaultDateFormat']; - $InputError=1; - unset($_POST['FromDate']); -} - -if (!isset($_POST['FromDate'])){ - - $title = _('Stock Transaction Listing'); - include ('includes/header.inc'); - - echo '<div class="centre"> - <p class="page_title_text"><img src="'.$rootpath.'/css/'.$theme.'/images/transactions.png" title="' . $title . '" alt="">' . ' '. _('Stock Transaction Listing').'</img></p> - </div>'; - - if ($InputError==1){ - prnMsg($msg,'error'); - } - - echo '<form method="post" action="' . $_SERVER['PHP_SELF'] . '">'; - echo '<input type="hidden" name="FormID" value="' . $_SESSION['FormID'] . '" />'; - echo '<table class="selection">'; - echo '<tr> - <td>' . _('Enter the date from which the transactions are to be listed') . ':</td> - <td><input type="text" name="FromDate" maxlength="10" size="10" class="date" alt="' . $_SESSION['DefaultDateFormat'] . '" value="' . Date($_SESSION['DefaultDateFormat']) . '"></td> - </tr>'; - echo '<tr> - <td>' . _('Enter the date to which the transactions are to be listed') . ':</td> - <td><input type="text" name="ToDate" maxlength="10" size="10" class="date" alt="' . $_SESSION['DefaultDateFormat'] . '" value="' . Date($_SESSION['DefaultDateFormat']) . '"></td> - </tr>'; - - echo '<tr><td>' . _('Transaction type') . '</td><td>'; - - echo '<select name="TransType">'; - - echo '<option value=10>' . _('Sales Invoice').'</option> - <option value=11>' . _('Sales Credit Note').'</option> - <option value=16>' . _('Location Transfer').'</option> - <option value=17>' . _('Stock Adjustment').'</option> - <option value=25>' . _('Purchase Order Delivery').'</option> - <option value=26>' . _('Work Order Receipt').'</option> - <option value=28>' . _('Work Order Issue').'</option>'; - - echo '</select></td></tr>'; - - $sql = "SELECT loccode, locationname FROM locations"; - $resultStkLocs = DB_query($sql, $db); - - echo '<tr><td>' . _('For Stock Location') . ':</td> - <td><select name="StockLocation">'; - echo '<option value="All">' . _('All') . '</option>'; - while ($myrow=DB_fetch_array($resultStkLocs)){ - if (isset($_POST['StockLocation']) AND $_POST['StockLocation']!='All'){ - if ($myrow['loccode'] == $_POST['StockLocation']){ - echo '<option selected value="' . $myrow['loccode'] . '">' . $myrow['locationname'] . '</option>'; - } else { - echo '<option value="' . $myrow['loccode'] . '">' . $myrow['locationname'] . '</option>'; - } - } elseif ($myrow['loccode']==$_SESSION['UserStockLocation']){ - echo '<option selected value="' . $myrow['loccode'] . '">' . $myrow['locationname'] . '</option>'; - $_POST['StockLocation']=$myrow['loccode']; - } else { - echo '<option value="' . $myrow['loccode'] . '">' . $myrow['locationname'] . '</option>'; - } - } - echo '</select></td></tr>'; - - echo '</table> - <br /> - <div class="centre"> - <input type=submit name="Go" value="' . _('Create PDF') . '" /> - </div>'; - - include('includes/footer.inc'); - exit; -} else { - - include('includes/ConnectDB.inc'); -} - - -if ($_POST['StockLocation']=='All') { - $sql= "SELECT stockmoves.type, - stockmoves.stockid, - stockmaster.description, - stockmaster.decimalplaces, - stockmoves.transno, - stockmoves.trandate, - stockmoves.qty, - stockmoves.reference, - stockmoves.narrative, - locations.locationname - FROM stockmoves - LEFT JOIN stockmaster - ON stockmoves.stockid=stockmaster.stockid - LEFT JOIN locations - ON stockmoves.loccode=locations.loccode - WHERE type='" . $_POST['TransType'] . "' - AND date_format(trandate, '%Y-%m-%d')>='".FormatDateForSQL($_POST['FromDate'])."' - AND date_format(trandate, '%Y-%m-%d')<='".FormatDateForSQL($_POST['ToDate'])."'"; -} else { - $sql= "SELECT stockmoves.type, - stockmoves.stockid, - stockmaster.description, - stockmaster.decimalplaces, - stockmoves.transno, - stockmoves.trandate, - stockmoves.qty, - stockmoves.reference, - stockmoves.narrative, - locations.locationname - FROM stockmoves - LEFT JOIN stockmaster - ON stockmoves.stockid=stockmaster.stockid - LEFT JOIN locations - ON stockmoves.loccode=locations.loccode - WHERE type='" . $_POST['TransType'] . "' - AND date_format(trandate, '%Y-%m-%d')>='".FormatDateForSQL($_POST['FromDate'])."' - AND date_format(trandate, '%Y-%m-%d')<='".FormatDateForSQL($_POST['ToDate'])."' - AND stockmoves.loccode='" . $_POST['StockLocation'] . "'"; -} -$result=DB_query($sql,$db,'','',false,false); - -if (DB_error_no($db)!=0){ - $title = _('Transaction Listing'); - include('includes/header.inc'); - prnMsg(_('An error occurred getting the transactions'),'error'); - include('includes/footer.inc'); - exit; -} elseif (DB_num_rows($result) == 0){ - $title = _('Transaction Listing'); - include('includes/header.inc'); - echo '<br />'; - prnMsg (_('There were no transactions found in the database between the dates') . ' ' . $_POST['FromDate'] . ' ' . _('and') . ' '. $_POST['ToDate'] .'<br />' ._('Please try again selecting a different date'), 'info'); - include('includes/footer.inc'); - exit; -} - -include('includes/PDFStarter.php'); - -/*PDFStarter.php has all the variables for page size and width set up depending on the users default preferences for paper size */ - -$pdf->addInfo('Title',_('Stock Transaction Listing')); -$pdf->addInfo('Subject',_('Stock transaction listing from') . ' ' . $_POST['FromDate'] . ' ' . $_POST['ToDate']); -$line_height=12; -$PageNumber = 1; - - -switch ($_POST['TransType']) { - case 10: - $TransType=_('Customer Invoices'); - break; - case 11: - $TransType=_('Customer Credit Notes'); - break; - case 16: - $TransType=_('Location Transfers'); - break; - case 17: - $TransType=_('Stock Adjustments'); - break; - case 25: - $TransType=_('Purchase Order Deliveries'); - break; - case 26: - $TransType=_('Work Order Receipts'); - break; - case 28: - $TransType=_('Work Order Issues'); - break; -} - -include ('includes/PDFPeriodStockTransListingPageHeader.inc'); - -while ($myrow=DB_fetch_array($result)){ - - $LeftOvers = $pdf->addTextWrap($Left_Margin,$YPos,160,$FontSize,$myrow['description'], 'left'); - $LeftOvers = $pdf->addTextWrap($Left_Margin+162,$YPos,80,$FontSize,$myrow['transno'], 'left'); - $LeftOvers = $pdf->addTextWrap($Left_Margin+242,$YPos,70,$FontSize,ConvertSQLDate($myrow['trandate']), 'left'); - $LeftOvers = $pdf->addTextWrap($Left_Margin+312,$YPos,70,$FontSize,locale_number_format($myrow['qty'],$myrow['decimalplaces']), 'right'); - $LeftOvers = $pdf->addTextWrap($Left_Margin+382,$YPos,70,$FontSize,$myrow['locationname'], 'right'); - $LeftOvers = $pdf->addTextWrap($Left_Margin+452,$YPos,70,$FontSize,$myrow['reference'], 'right'); - - $YPos -= ($line_height); - - if ($YPos - (2 *$line_height) < $Bottom_Margin){ - /*Then set up a new page */ - $PageNumber++; - include ('includes/PDFPeriodStockTransListingPageHeader.inc'); - } /*end of new page header */ -} /* end of while there are customer receipts in the batch to print */ - - -$YPos-=$line_height; - -$ReportFileName = $_SESSION['DatabaseName'] . '_StockTransListing_' . date('Y-m-d').'.pdf'; -$pdf->OutputD($ReportFileName); -$pdf->__destruct(); - +<?php +/* $Id: PDFPeriodStockTransListing.php 4307 2010-12-22 16:06:03Z tim_schofield $*/ + +include('includes/SQL_CommonFunctions.inc'); +include ('includes/session.inc'); + +$InputError=0; +if (isset($_POST['FromDate']) AND !Is_Date($_POST['FromDate'])){ + $msg = _('The date must be specified in the format') . ' ' . $_SESSION['DefaultDateFormat']; + $InputError=1; + unset($_POST['FromDate']); +} + +if (!isset($_POST['FromDate'])){ + + $title = _('Stock Transaction Listing'); + include ('includes/header.inc'); + + echo '<div class="centre"> + <p class="page_title_text"><img src="'.$rootpath.'/css/'.$theme.'/images/transactions.png" title="' . $title . '" alt="">' . ' '. _('Stock Transaction Listing').'</img></p> + </div>'; + + if ($InputError==1){ + prnMsg($msg,'error'); + } + + echo '<form method="post" action="' . $_SERVER['PHP_SELF'] . '">'; + echo '<input type="hidden" name="FormID" value="' . $_SESSION['FormID'] . '" />'; + echo '<table class="selection">'; + echo '<tr> + <td>' . _('Enter the date from which the transactions are to be listed') . ':</td> + <td><input type="text" name="FromDate" maxlength="10" size="10" class="date" alt="' . $_SESSION['DefaultDateFormat'] . '" value="' . Date($_SESSION['DefaultDateFormat']) . '"></td> + </tr>'; + echo '<tr> + <td>' . _('Enter the date to which the transactions are to be listed') . ':</td> + <td><input type="text" name="ToDate" maxlength="10" size="10" class="date" alt="' . $_SESSION['DefaultDateFormat'] . '" value="' . Date($_SESSION['DefaultDateFormat']) . '"></td> + </tr>'; + + echo '<tr><td>' . _('Transaction type') . '</td><td>'; + + echo '<select name="TransType">'; + + echo '<option value=10>' . _('Sales Invoice').'</option> + <option value=11>' . _('Sales Credit Note').'</option> + <option value=16>' . _('Location Transfer').'</option> + <option value=17>' . _('Stock Adjustment').'</option> + <option value=25>' . _('Purchase Order Delivery').'</option> + <option value=26>' . _('Work Order Receipt').'</option> + <option value=28>' . _('Work Order Issue').'</option>'; + + echo '</select></td></tr>'; + + $sql = "SELECT loccode, locationname FROM locations"; + $resultStkLocs = DB_query($sql, $db); + + echo '<tr><td>' . _('For Stock Location') . ':</td> + <td><select name="StockLocation">'; + echo '<option value="All">' . _('All') . '</option>'; + while ($myrow=DB_fetch_array($resultStkLocs)){ + if (isset($_POST['StockLocation']) AND $_POST['StockLocation']!='All'){ + if ($myrow['loccode'] == $_POST['StockLocation']){ + echo '<option selected value="' . $myrow['loccode'] . '">' . $myrow['locationname'] . '</option>'; + } else { + echo '<option value="' . $myrow['loccode'] . '">' . $myrow['locationname'] . '</option>'; + } + } elseif ($myrow['loccode']==$_SESSION['UserStockLocation']){ + echo '<option selected value="' . $myrow['loccode'] . '">' . $myrow['locationname'] . '</option>'; + $_POST['StockLocation']=$myrow['loccode']; + } else { + echo '<option value="' . $myrow['loccode'] . '">' . $myrow['locationname'] . '</option>'; + } + } + echo '</select></td></tr>'; + + echo '</table> + <br /> + <div class="centre"> + <input type="submit" name="Go" value="' . _('Create PDF') . '" /> + </div>'; + + include('includes/footer.inc'); + exit; +} else { + + include('includes/ConnectDB.inc'); +} + + +if ($_POST['StockLocation']=='All') { + $sql= "SELECT stockmoves.type, + stockmoves.stockid, + stockmaster.description, + stockmaster.decimalplaces, + stockmoves.transno, + stockmoves.trandate, + stockmoves.qty, + stockmoves.reference, + stockmoves.narrative, + locations.locationname + FROM stockmoves + LEFT JOIN stockmaster + ON stockmoves.stockid=stockmaster.stockid + LEFT JOIN locations + ON stockmoves.loccode=locations.loccode + WHERE type='" . $_POST['TransType'] . "' + AND date_format(trandate, '%Y-%m-%d')>='".FormatDateForSQL($_POST['FromDate'])."' + AND date_format(trandate, '%Y-%m-%d')<='".FormatDateForSQL($_POST['ToDate'])."'"; +} else { + $sql= "SELECT stockmoves.type, + stockmoves.stockid, + stockmaster.description, + stockmaster.decimalplaces, + stockmo... [truncated message content] |
From: <dai...@us...> - 2011-09-14 08:06:59
|
Revision: 4689 http://web-erp.svn.sourceforge.net/web-erp/?rev=4689&view=rev Author: daintree Date: 2011-09-14 08:06:45 +0000 (Wed, 14 Sep 2011) Log Message: ----------- number_formatting Modified Paths: -------------- trunk/BankReconciliation.php trunk/PDFGrn.php trunk/PDFOrdersInvoiced.php trunk/PDFPeriodStockTransListing.php trunk/PDFPickingList.php trunk/PDFPriceList.php trunk/PDFPrintLabel.php trunk/PDFQuotation.php trunk/PDFQuotationPortrait.php trunk/PDFReceipt.php trunk/PDFRemittanceAdvice.php trunk/PDFStockCheckComparison.php trunk/PDFStockLocTransfer.php trunk/SelectOrderItems.php trunk/StockTransfers.php trunk/includes/GLPostings.inc trunk/includes/LanguageSetup.php trunk/includes/SQL_CommonFunctions.inc trunk/includes/SelectOrderItems_IntoCart.inc Modified: trunk/BankReconciliation.php =================================================================== --- trunk/BankReconciliation.php 2011-09-12 23:37:53 UTC (rev 4688) +++ trunk/BankReconciliation.php 2011-09-14 08:06:45 UTC (rev 4689) @@ -19,27 +19,26 @@ if (isset($_POST['PostExchangeDifference']) and is_numeric($_POST['DoExchangeDifference'])){ - if (!is_numeric($_POST['BankStatementBalance'])){ + if (!is_numeric(filter_number_format($_POST['BankStatementBalance']))){ prnMsg(_('The entry in the bank statement balance is not numeric. The balance on the bank statement should be entered. The exchange difference has not been calculated and no general ledger journal has been created'),'warn'); echo '<p>' . $_POST['BankStatementBalance']; } else { + $_POST['BankStatementBalance'] = filter_number_format($_POST['BankStatementBalance']); /* Now need to get the currency of the account and the current table ex rate */ $SQL = "SELECT rate, bankaccountname, - decimalplaces + decimalplaces AS currdecimalplaces FROM bankaccounts INNER JOIN currencies ON bankaccounts.currcode=currencies.currabrev WHERE bankaccounts.accountcode = '" . $_POST['BankAccount']."'"; $ErrMsg = _('Could not retrieve the exchange rate for the selected bank account'); $CurrencyResult = DB_query($SQL,$db); - $CurrencyRow = DB_fetch_row($CurrencyResult); - $ExRate = $CurrencyRow[0]; - $BankAccountName = $CurrencyRow[1]; - $CurrDecimalPlaces = $CurrencyRow[2]; - $CalculatedBalance = $_POST['DoExchangeDifference']; + $CurrencyRow = DB_fetch_array($CurrencyResult); + + $CalculatedBalance = filter_number_format($_POST['DoExchangeDifference']); - $ExchangeDifference = ($CalculatedBalance - $_POST['BankStatementBalance'])/$ExRate; + $ExchangeDifference = filter_number_format(($CalculatedBalance - $_POST['BankStatementBalance'])/$CurrencyRow['rate']); include ('includes/SQL_CommonFunctions.inc'); $ExDiffTransNo = GetNextTransNo(36,$db); @@ -62,7 +61,7 @@ '" . FormatDateForSQL($PostingDate) . "', '" . $PeriodNo . "', '" . $_SESSION['CompanyRecord']['exchangediffact'] . "', - '" . $BankAccountName . ' ' . _('reconciliation on') . " " . + '" . $CurrencyRow['bankaccountname'] . ' ' . _('reconciliation on') . " " . Date($_SESSION['DefaultDateFormat']) . "','" . $ExchangeDifference . "')"; $ErrMsg = _('Cannot insert a GL entry for the exchange difference because'); @@ -80,13 +79,13 @@ '" . FormatDateForSQL($PostingDate) . "', '" . $PeriodNo . "', '" . $_POST['BankAccount'] . "', - '" . $BankAccountName . ' ' . _('reconciliation on') . ' ' . Date($_SESSION['DefaultDateFormat']) . "', + '" . $CurrencyRow['bankaccountname'] . ' ' . _('reconciliation on') . ' ' . Date($_SESSION['DefaultDateFormat']) . "', '" . (-$ExchangeDifference) . "')"; $result = DB_query($SQL,$db,$ErrMsg,$DbgMsg,true); $result = DB_Txn_Commit($db); - prnMsg(_('Exchange difference of') . ' ' . locale_number_format($ExchangeDifference,2) . ' ' . _('has been posted'),'success'); + prnMsg(_('Exchange difference of') . ' ' . locale_money_format($ExchangeDifference,$_SESSION['CompanyRecord']['decimalplaces']) . ' ' . _('has been posted'),'success'); } //end if the bank statement balance was numeric } @@ -153,25 +152,24 @@ /* Now need to get the currency of the account and the current table ex rate */ $SQL = "SELECT rate, bankaccounts.currcode, - bankaccounts.bankaccountname + bankaccounts.bankaccountname, + currencies.decimalplaces AS currdecimalplaces FROM bankaccounts INNER JOIN currencies ON bankaccounts.currcode=currencies.currabrev WHERE bankaccounts.accountcode = '" . $_POST['BankAccount']."'"; $ErrMsg = _('Could not retrieve the currency and exchange rate for the selected bank account'); $CurrencyResult = DB_query($SQL,$db); - $CurrencyRow = DB_fetch_row($CurrencyResult); - $ExRate = $CurrencyRow[0]; - $BankCurrCode = $CurrencyRow[1]; - $BankAccountName = $CurrencyRow[2]; + $CurrencyRow = DB_fetch_array($CurrencyResult); + echo '<table class="selection"> - <tr class="EvenTableRows"><td colspan=6><b>' . $BankAccountName . ' ' . _('Balance as at') . ' ' . Date($_SESSION['DefaultDateFormat']); + <tr class="EvenTableRows"><td colspan=6><b>' . $CurrencyRow['bankaccountname'] . ' ' . _('Balance as at') . ' ' . Date($_SESSION['DefaultDateFormat']); - if ($_SESSION['CompanyRecord']['currencydefault']!=$BankCurrCode){ - echo ' (' . $BankCurrCode . ' @ ' . $ExRate .')'; + if ($_SESSION['CompanyRecord']['currencydefault']!=$CurrencyRow['currcode']){ + echo ' (' . $CurrencyRow['currcode'] . ' @ ' . $CurrencyRow['rate'] .')'; } echo '</b></td> - <td valign=bottom class="number"><b>' . locale_number_format($Balance*$ExRate,$CurrDecimalPlaces) . '</b></td></tr>'; + <td valign=bottom class="number"><b>' . locale_money_format($Balance*$CurrencyRow['rate'],$CurrencyRow['currdecimalplaces']) . '</b></td></tr>'; $SQL = "SELECT amount/exrate AS amt, amountcleared, @@ -222,15 +220,15 @@ <td>%s</td> <td>%s</td> <td>%s</td> - <td class=number>%s</td> - <td class=number>%s</td> + <td class="number">%s</td> + <td class="number">%s</td> </tr>', ConvertSQLDate($myrow['transdate']), $myrow['typename'], $myrow['transno'], $myrow['ref'], - locale_number_format($myrow['amt'],$CurrDecimalPlaces), - locale_number_format($myrow['outstanding'],$CurrDecimalPlaces)); + locale_money_format($myrow['amt'],$CurrencyRow['currdecimalplaces']), + locale_money_format($myrow['outstanding'],$CurrencyRow['currdecimalplaces'])); $TotalUnpresentedCheques +=$myrow['outstanding']; @@ -241,20 +239,20 @@ } } //end of while loop + $TotalUnpresentedCheques = filter_number_format($TotalUnpresentedCheques); echo '<tr></tr> - <tr class=EvenTableRows><td colspan=6>' . _('Total of all unpresented cheques') . '</td><td class="number">' . locale_number_format($TotalUnpresentedCheques,$CurrDecimalPlaces) . '</td></tr>'; + <tr class=EvenTableRows><td colspan=6>' . _('Total of all unpresented cheques') . '</td><td class="number">' . locale_money_format($TotalUnpresentedCheques,$CurrencyRow['currdecimalplaces']) . '</td></tr>'; $SQL = "SELECT amount/exrate AS amt, amountcleared, - (amount/exrate)-amountcleared as outstanding, + (amount/exrate)-amountcleared AS outstanding, ref, transdate, systypes.typename, transno - FROM banktrans, - systypes - WHERE banktrans.type = systypes.typeid - AND banktrans.bankact='" . $_POST['BankAccount'] . "' + FROM banktrans INNER JOIN systypes + ON banktrans.type = systypes.typeid + WHERE banktrans.bankact='" . $_POST['BankAccount'] . "' AND amount > 0 AND ABS((amount/exrate)-amountcleared)>0.009 ORDER BY transdate"; @@ -264,7 +262,7 @@ $UPChequesResult = DB_query($SQL,$db,$ErrMsg); - echo '<tr><td colspan=6><b>' . _('Less deposits not cleared') . ':</b></td></tr>'; + echo '<tr><td colspan="6"><b>' . _('Less deposits not cleared') . ':</b></td></tr>'; $TableHeader = '<tr> <th>' . _('Date') . '</th> @@ -294,15 +292,15 @@ <td>%s</td> <td>%s</td> <td>%s</td> - <td class=number>%s</td> - <td class=number>%s</td> + <td class="number">%s</td> + <td class="number">%s</td> </tr>', ConvertSQLDate($myrow['transdate']), $myrow['typename'], $myrow['transno'], $myrow['ref'], - locale_number_format($myrow['amt'],$CurrDecimalPlaces), - locale_number_format($myrow['outstanding'],$CurrDecimalPlaces) ); + locale_money_format($myrow['amt'],$CurrencyRow['currdecimalplaces']), + locale_money_format($myrow['outstanding'],$CurrencyRow['currdecimalplaces']) ); $TotalUnclearedDeposits +=$myrow['outstanding']; @@ -316,25 +314,28 @@ echo '<tr></tr> <tr class=EvenTableRows> <td colspan=6>' . _('Total of all uncleared deposits') . '</td> - <td class=number>' . locale_number_format($TotalUnclearedDeposits,$CurrDecimalPlaces) . '</td> + <td class="number">' . locale_money_format($TotalUnclearedDeposits,$CurrencyRow['currdecimalplaces']) . '</td> </tr>'; - $FXStatementBalance = ($Balance*$ExRate) - $TotalUnpresentedCheques -$TotalUnclearedDeposits; + $FXStatementBalance = filter_number_format(($Balance*$CurrencyRow['rate']) - $TotalUnpresentedCheques -$TotalUnclearedDeposits); echo '<tr></tr> <tr class=EvenTableRows> - <td colspan=6><b>' . _('Bank statement balance should be') . ' (' . $BankCurrCode . ')</b></td> - <td class=number>' . locale_number_format($FXStatementBalance,$CurrDecimalPlaces) . '</td></tr>'; + <td colspan=6><b>' . _('Bank statement balance should be') . ' (' . $CurrencyRow['currcode'] . ')</b></td> + <td class="number">' . locale_money_format($FXStatementBalance,$CurrencyRow['currdecimalplaces']) . '</td></tr>'; if (isset($_POST['DoExchangeDifference'])){ - echo '<input type="hidden" name="DoExchangeDifference" value=' . $FXStatementBalance . '>'; - echo '<tr><td colspan=6>' . _('Enter the actual bank statement balance') . ' (' . $BankCurrCode . ')</b></td> - <td class=number><input type="text" name="BankStatementBalance" maxlength=15 size=15 value=' . $_POST['BankStatementBalance'] . '><td></tr>'; + echo '<input type="hidden" name="DoExchangeDifference" value=' . $FXStatementBalance . ' />'; + if (!isset($_POST['BankStatementBalance'])){ + $_POST['BankStatementBalance'] =0; + } + echo '<tr><td colspan=6>' . _('Enter the actual bank statement balance') . ' (' . $CurrencyRow['currcode'] . ')</b></td> + <td class="number"><input type="text" name="BankStatementBalance" maxlength="15" size="15" value=' . locale_number_format($_POST['BankStatementBalance'],$CurrencyRow['currdecimalplaces']) . ' /><td></tr>'; echo '<tr><td colspan=7 align="center"><input type="submit" name="PostExchangeDifference" value="' . _('Calculate and Post Exchange Difference') . '" onclick="return confirm(\'' . _('This will create a general ledger journal to write off the exchange difference in the current balance of the account. It is important that the exchange rate above reflects the current value of the bank account currency') . ' - ' . _('Are You Sure?') . '\');"></td></tr>'; } - if ($_SESSION['CompanyRecord']['currencydefault']!=$BankCurrCode AND !isset($_POST['DoExchangeDifference'])){ + if ($_SESSION['CompanyRecord']['currencydefault']!=$CurrencyRow['currcode'] AND !isset($_POST['DoExchangeDifference'])){ echo '<tr><td colspan=7><hr></td></tr> <tr><td colspan=7>' . _('It is normal for foreign currency accounts to have exchange differences that need to be reflected as the exchange rate varies. This reconciliation is prepared using the exchange rate set up in the currencies table (see the set-up tab). This table must be maintained with the current exchange rate before running the reconciliation. If you wish to create a journal to reflect the exchange difference based on the current exchange rate to correct the reconciliation to the actual bank statement balance click below.') . '</td></tr>'; Modified: trunk/PDFGrn.php =================================================================== --- trunk/PDFGrn.php 2011-09-12 23:37:53 UTC (rev 4688) +++ trunk/PDFGrn.php 2011-09-14 08:06:45 UTC (rev 4689) @@ -54,12 +54,12 @@ ON grns.podetailitem=purchorderdetails.podetailitem LEFT JOIN stockmaster ON grns.itemcode=stockmaster.stockid - WHERE grnbatch='".$GRNNo."'"; - + WHERE grnbatch='".filter_number_format($GRNNo)."'"; + $GRNResult=DB_query($sql, $db); $NoOfGRNs = DB_num_rows($GRNResult); if($NoOfGRNs>0) { //there are GRNs to print - + $sql = "SELECT suppliers.suppname, suppliers.address1, suppliers.address2 , @@ -69,14 +69,14 @@ suppliers.address6 FROM grns INNER JOIN suppliers ON grns.supplierid=suppliers.supplierid - WHERE grnbatch='".$GRNNo."'"; + WHERE grnbatch='".filter_number_format($GRNNo)."'"; $SuppResult = DB_query($sql,$db,_('Could not get the supplier of the selected GRN')); $SuppRow = DB_fetch_array($SuppResult); } } // get data to print if ($NoOfGRNs >0){ include ('includes/PDFGrnHeader.inc'); //head up the page - + $YPos=$FormDesign->Data->y; for ($i=1;$i<=$NoOfGRNs;$i++) { if ($GRNNo!='Preview'){ @@ -88,13 +88,13 @@ $DecimalPlaces=2; } if (is_numeric($myrow['conversionfactor']) AND $myrow['conversionfactor'] !=0){ - $SuppliersQuantity=locale_number_format($myrow['qtyrecd']/$myrow['conversionfactor'],$DecimalPlaces); + $SuppliersQuantity=locale_number_format(filter_number_format($myrow['qtyrecd']/$myrow['conversionfactor']),$DecimalPlaces); } else { $SuppliersQuantity=locale_number_format($myrow['qtyrecd'],$DecimalPlaces); } $OurUnitsQuantity=locale_number_format($myrow['qtyrecd'],$DecimalPlaces); $DeliveryDate = ConvertSQLDate($myrow['deliverydate']); - + $LeftOvers = $pdf->addTextWrap($FormDesign->Data->Column1->x,$Page_Height-$YPos,$FormDesign->Data->Column1->Length,$FormDesign->Data->Column1->FontSize, $myrow['itemcode']); $LeftOvers = $pdf->addTextWrap($FormDesign->Data->Column2->x,$Page_Height-$YPos,$FormDesign->Data->Column2->Length,$FormDesign->Data->Column2->FontSize, $myrow['itemdescription']); $LeftOvers = $pdf->addTextWrap($FormDesign->Data->Column3->x,$Page_Height-$YPos,$FormDesign->Data->Column3->Length,$FormDesign->Data->Column3->FontSize, $DeliveryDate); @@ -114,13 +114,13 @@ $LeftOvers = $pdf->addText($FormDesign->ReceiptDate->x,$Page_Height-$FormDesign->ReceiptDate->y,$FormDesign->ReceiptDate->FontSize, _('Date of Receipt: ') . $DeliveryDate); $LeftOvers = $pdf->addText($FormDesign->SignedFor->x,$Page_Height-$FormDesign->SignedFor->y,$FormDesign->SignedFor->FontSize, _('Signed for ').'______________________'); - $pdf->OutputD($_SESSION['DatabaseName'] . '_GRN_' . date('Y-m-d').'.pdf');//UldisN - $pdf->__destruct(); //UldisN + $pdf->OutputD($_SESSION['DatabaseName'] . '_GRN_' . date('Y-m-d').'.pdf'); + $pdf->__destruct(); } else { //there were not GRNs to print $title = _('GRN Error'); include('includes/header.inc'); prnMsg(_('There were no GRNs to print'),'warn'); - echo '<br /><a href="'.$rootpath.'/index.php?' . SID . '">'. _('Back to the menu').'</a>'; + echo '<br /><a href="'.$rootpath.'/index.php">'. _('Back to the menu').'</a>'; include('includes/footer.inc'); } ?> \ No newline at end of file Modified: trunk/PDFOrdersInvoiced.php =================================================================== --- trunk/PDFOrdersInvoiced.php 2011-09-12 23:37:53 UTC (rev 4688) +++ trunk/PDFOrdersInvoiced.php 2011-09-14 08:06:45 UTC (rev 4689) @@ -211,7 +211,7 @@ stockmaster.description, stockmaster.units, stockmaster.decimalplaces"; - + } elseif ($_POST['CategoryID']!='All' AND $_POST['location']!='All'){ $sql= "SELECT salesorders.orderno, @@ -290,7 +290,7 @@ if($OrderNo != $myrow['orderno']){ if ($AccumOrderTotal !=0){ $LeftOvers = $pdf->addTextWrap($Left_Margin+250,$YPos,120,$FontSize,_('Total Invoiced for order') . ' ' . $OrderNo , 'left'); - $LeftOvers = $pdf->addTextWrap($Left_Margin+360,$YPos,80,$FontSize,locale_number_format($AccumOrderTotal,2), 'right'); + $LeftOvers = $pdf->addTextWrap($Left_Margin+360,$YPos,80,$FontSize,locale_money_format(filter_number_format($AccumOrderTotal),$_SESSION['CompanyRecord']['decimalplaces']), 'right'); $YPos -= ($line_height); $AccumOrderTotal =0; } @@ -395,12 +395,12 @@ while ($InvRow=DB_fetch_array($InvoicesResult)){ - $ValueInvoiced = $InvRow['price']*$InvRow['quantity']; + $ValueInvoiced = filter_number_format($InvRow['price']*$InvRow['quantity']); $LeftOvers = $pdf->addTextWrap($Left_Margin+150,$YPos,90,$FontSize,$InvRow['typename'] . ' ' . $InvRow['transno'], 'left'); $LeftOvers = $pdf->addTextWrap($Left_Margin+240,$YPos,60,$FontSize,locale_number_format($InvRow['quantity'],$myrow['decimalplaces']), 'right'); - $LeftOvers = $pdf->addTextWrap($Left_Margin+300,$YPos,60,$FontSize,locale_number_format($InvRow['price'],2), 'right'); - $LeftOvers = $pdf->addTextWrap($Left_Margin+360,$YPos,80,$FontSize,locale_number_format($ValueInvoiced,2), 'right'); + $LeftOvers = $pdf->addTextWrap($Left_Margin+300,$YPos,60,$FontSize,locale_money_format($InvRow['price'],$_SESSION['CompanyRecord']['decimalplaces']), 'right'); + $LeftOvers = $pdf->addTextWrap($Left_Margin+360,$YPos,80,$FontSize,locale_money_format($ValueInvoiced,$_SESSION['CompanyRecord']['decimalplaces']), 'right'); $YPos -= ($line_height); @@ -414,7 +414,6 @@ } - $YPos -= ($line_height); if ($YPos - (2 *$line_height) < $Bottom_Margin){ /*Then set up a new page */ @@ -425,7 +424,7 @@ $YPos -= ($line_height); $LeftOvers = $pdf->addTextWrap($Left_Margin+260,$YPos,100,$FontSize,_('GRAND TOTAL INVOICED'), 'right'); -$LeftOvers = $pdf->addTextWrap($Left_Margin+360,$YPos,80,$FontSize,locale_number_format($AccumTotalInv,2), 'right'); +$LeftOvers = $pdf->addTextWrap($Left_Margin+360,$YPos,80,$FontSize,locale_money_format(filter_number_format($AccumTotalInv),$_SESSION['CompanyRecord']['decimalplaces']), 'right'); $YPos -= ($line_height); $pdf->OutputD($_SESSION['DatabaseName'] . '_OrdersInvoiced_' . date('Y-m-d') . '.pdf'); Modified: trunk/PDFPeriodStockTransListing.php =================================================================== --- trunk/PDFPeriodStockTransListing.php 2011-09-12 23:37:53 UTC (rev 4688) +++ trunk/PDFPeriodStockTransListing.php 2011-09-14 08:06:45 UTC (rev 4689) @@ -1,207 +1,207 @@ -<?php -/* $Id: PDFPeriodStockTransListing.php 4307 2010-12-22 16:06:03Z tim_schofield $*/ - -include('includes/SQL_CommonFunctions.inc'); -include ('includes/session.inc'); - -$InputError=0; -if (isset($_POST['FromDate']) AND !Is_Date($_POST['FromDate'])){ - $msg = _('The date must be specified in the format') . ' ' . $_SESSION['DefaultDateFormat']; - $InputError=1; - unset($_POST['FromDate']); -} - -if (!isset($_POST['FromDate'])){ - - $title = _('Stock Transaction Listing'); - include ('includes/header.inc'); - - echo '<div class="centre"> - <p class="page_title_text"><img src="'.$rootpath.'/css/'.$theme.'/images/transactions.png" title="' . $title . '" alt="">' . ' '. _('Stock Transaction Listing').'</img></p> - </div>'; - - if ($InputError==1){ - prnMsg($msg,'error'); - } - - echo '<form method="post" action="' . $_SERVER['PHP_SELF'] . '">'; - echo '<input type="hidden" name="FormID" value="' . $_SESSION['FormID'] . '" />'; - echo '<table class="selection">'; - echo '<tr> - <td>' . _('Enter the date from which the transactions are to be listed') . ':</td> - <td><input type="text" name="FromDate" maxlength="10" size="10" class="date" alt="' . $_SESSION['DefaultDateFormat'] . '" value="' . Date($_SESSION['DefaultDateFormat']) . '"></td> - </tr>'; - echo '<tr> - <td>' . _('Enter the date to which the transactions are to be listed') . ':</td> - <td><input type="text" name="ToDate" maxlength="10" size="10" class="date" alt="' . $_SESSION['DefaultDateFormat'] . '" value="' . Date($_SESSION['DefaultDateFormat']) . '"></td> - </tr>'; - - echo '<tr><td>' . _('Transaction type') . '</td><td>'; - - echo '<select name="TransType">'; - - echo '<option value=10>' . _('Sales Invoice').'</option> - <option value=11>' . _('Sales Credit Note').'</option> - <option value=16>' . _('Location Transfer').'</option> - <option value=17>' . _('Stock Adjustment').'</option> - <option value=25>' . _('Purchase Order Delivery').'</option> - <option value=26>' . _('Work Order Receipt').'</option> - <option value=28>' . _('Work Order Issue').'</option>'; - - echo '</select></td></tr>'; - - $sql = "SELECT loccode, locationname FROM locations"; - $resultStkLocs = DB_query($sql, $db); - - echo '<tr><td>' . _('For Stock Location') . ':</td> - <td><select name="StockLocation">'; - echo '<option value="All">' . _('All') . '</option>'; - while ($myrow=DB_fetch_array($resultStkLocs)){ - if (isset($_POST['StockLocation']) AND $_POST['StockLocation']!='All'){ - if ($myrow['loccode'] == $_POST['StockLocation']){ - echo '<option selected value="' . $myrow['loccode'] . '">' . $myrow['locationname'] . '</option>'; - } else { - echo '<option value="' . $myrow['loccode'] . '">' . $myrow['locationname'] . '</option>'; - } - } elseif ($myrow['loccode']==$_SESSION['UserStockLocation']){ - echo '<option selected value="' . $myrow['loccode'] . '">' . $myrow['locationname'] . '</option>'; - $_POST['StockLocation']=$myrow['loccode']; - } else { - echo '<option value="' . $myrow['loccode'] . '">' . $myrow['locationname'] . '</option>'; - } - } - echo '</select></td></tr>'; - - echo '</table> - <br /> - <div class="centre"> - <input type=submit name="Go" value="' . _('Create PDF') . '" /> - </div>'; - - include('includes/footer.inc'); - exit; -} else { - - include('includes/ConnectDB.inc'); -} - - -if ($_POST['StockLocation']=='All') { - $sql= "SELECT stockmoves.type, - stockmoves.stockid, - stockmaster.description, - stockmaster.decimalplaces, - stockmoves.transno, - stockmoves.trandate, - stockmoves.qty, - stockmoves.reference, - stockmoves.narrative, - locations.locationname - FROM stockmoves - LEFT JOIN stockmaster - ON stockmoves.stockid=stockmaster.stockid - LEFT JOIN locations - ON stockmoves.loccode=locations.loccode - WHERE type='" . $_POST['TransType'] . "' - AND date_format(trandate, '%Y-%m-%d')>='".FormatDateForSQL($_POST['FromDate'])."' - AND date_format(trandate, '%Y-%m-%d')<='".FormatDateForSQL($_POST['ToDate'])."'"; -} else { - $sql= "SELECT stockmoves.type, - stockmoves.stockid, - stockmaster.description, - stockmaster.decimalplaces, - stockmoves.transno, - stockmoves.trandate, - stockmoves.qty, - stockmoves.reference, - stockmoves.narrative, - locations.locationname - FROM stockmoves - LEFT JOIN stockmaster - ON stockmoves.stockid=stockmaster.stockid - LEFT JOIN locations - ON stockmoves.loccode=locations.loccode - WHERE type='" . $_POST['TransType'] . "' - AND date_format(trandate, '%Y-%m-%d')>='".FormatDateForSQL($_POST['FromDate'])."' - AND date_format(trandate, '%Y-%m-%d')<='".FormatDateForSQL($_POST['ToDate'])."' - AND stockmoves.loccode='" . $_POST['StockLocation'] . "'"; -} -$result=DB_query($sql,$db,'','',false,false); - -if (DB_error_no($db)!=0){ - $title = _('Transaction Listing'); - include('includes/header.inc'); - prnMsg(_('An error occurred getting the transactions'),'error'); - include('includes/footer.inc'); - exit; -} elseif (DB_num_rows($result) == 0){ - $title = _('Transaction Listing'); - include('includes/header.inc'); - echo '<br />'; - prnMsg (_('There were no transactions found in the database between the dates') . ' ' . $_POST['FromDate'] . ' ' . _('and') . ' '. $_POST['ToDate'] .'<br />' ._('Please try again selecting a different date'), 'info'); - include('includes/footer.inc'); - exit; -} - -include('includes/PDFStarter.php'); - -/*PDFStarter.php has all the variables for page size and width set up depending on the users default preferences for paper size */ - -$pdf->addInfo('Title',_('Stock Transaction Listing')); -$pdf->addInfo('Subject',_('Stock transaction listing from') . ' ' . $_POST['FromDate'] . ' ' . $_POST['ToDate']); -$line_height=12; -$PageNumber = 1; - - -switch ($_POST['TransType']) { - case 10: - $TransType=_('Customer Invoices'); - break; - case 11: - $TransType=_('Customer Credit Notes'); - break; - case 16: - $TransType=_('Location Transfers'); - break; - case 17: - $TransType=_('Stock Adjustments'); - break; - case 25: - $TransType=_('Purchase Order Deliveries'); - break; - case 26: - $TransType=_('Work Order Receipts'); - break; - case 28: - $TransType=_('Work Order Issues'); - break; -} - -include ('includes/PDFPeriodStockTransListingPageHeader.inc'); - -while ($myrow=DB_fetch_array($result)){ - - $LeftOvers = $pdf->addTextWrap($Left_Margin,$YPos,160,$FontSize,$myrow['description'], 'left'); - $LeftOvers = $pdf->addTextWrap($Left_Margin+162,$YPos,80,$FontSize,$myrow['transno'], 'left'); - $LeftOvers = $pdf->addTextWrap($Left_Margin+242,$YPos,70,$FontSize,ConvertSQLDate($myrow['trandate']), 'left'); - $LeftOvers = $pdf->addTextWrap($Left_Margin+312,$YPos,70,$FontSize,locale_number_format($myrow['qty'],$myrow['decimalplaces']), 'right'); - $LeftOvers = $pdf->addTextWrap($Left_Margin+382,$YPos,70,$FontSize,$myrow['locationname'], 'right'); - $LeftOvers = $pdf->addTextWrap($Left_Margin+452,$YPos,70,$FontSize,$myrow['reference'], 'right'); - - $YPos -= ($line_height); - - if ($YPos - (2 *$line_height) < $Bottom_Margin){ - /*Then set up a new page */ - $PageNumber++; - include ('includes/PDFPeriodStockTransListingPageHeader.inc'); - } /*end of new page header */ -} /* end of while there are customer receipts in the batch to print */ - - -$YPos-=$line_height; - -$ReportFileName = $_SESSION['DatabaseName'] . '_StockTransListing_' . date('Y-m-d').'.pdf'; -$pdf->OutputD($ReportFileName); -$pdf->__destruct(); - +<?php +/* $Id: PDFPeriodStockTransListing.php 4307 2010-12-22 16:06:03Z tim_schofield $*/ + +include('includes/SQL_CommonFunctions.inc'); +include ('includes/session.inc'); + +$InputError=0; +if (isset($_POST['FromDate']) AND !Is_Date($_POST['FromDate'])){ + $msg = _('The date must be specified in the format') . ' ' . $_SESSION['DefaultDateFormat']; + $InputError=1; + unset($_POST['FromDate']); +} + +if (!isset($_POST['FromDate'])){ + + $title = _('Stock Transaction Listing'); + include ('includes/header.inc'); + + echo '<div class="centre"> + <p class="page_title_text"><img src="'.$rootpath.'/css/'.$theme.'/images/transactions.png" title="' . $title . '" alt="">' . ' '. _('Stock Transaction Listing').'</img></p> + </div>'; + + if ($InputError==1){ + prnMsg($msg,'error'); + } + + echo '<form method="post" action="' . $_SERVER['PHP_SELF'] . '">'; + echo '<input type="hidden" name="FormID" value="' . $_SESSION['FormID'] . '" />'; + echo '<table class="selection">'; + echo '<tr> + <td>' . _('Enter the date from which the transactions are to be listed') . ':</td> + <td><input type="text" name="FromDate" maxlength="10" size="10" class="date" alt="' . $_SESSION['DefaultDateFormat'] . '" value="' . Date($_SESSION['DefaultDateFormat']) . '"></td> + </tr>'; + echo '<tr> + <td>' . _('Enter the date to which the transactions are to be listed') . ':</td> + <td><input type="text" name="ToDate" maxlength="10" size="10" class="date" alt="' . $_SESSION['DefaultDateFormat'] . '" value="' . Date($_SESSION['DefaultDateFormat']) . '"></td> + </tr>'; + + echo '<tr><td>' . _('Transaction type') . '</td><td>'; + + echo '<select name="TransType">'; + + echo '<option value=10>' . _('Sales Invoice').'</option> + <option value=11>' . _('Sales Credit Note').'</option> + <option value=16>' . _('Location Transfer').'</option> + <option value=17>' . _('Stock Adjustment').'</option> + <option value=25>' . _('Purchase Order Delivery').'</option> + <option value=26>' . _('Work Order Receipt').'</option> + <option value=28>' . _('Work Order Issue').'</option>'; + + echo '</select></td></tr>'; + + $sql = "SELECT loccode, locationname FROM locations"; + $resultStkLocs = DB_query($sql, $db); + + echo '<tr><td>' . _('For Stock Location') . ':</td> + <td><select name="StockLocation">'; + echo '<option value="All">' . _('All') . '</option>'; + while ($myrow=DB_fetch_array($resultStkLocs)){ + if (isset($_POST['StockLocation']) AND $_POST['StockLocation']!='All'){ + if ($myrow['loccode'] == $_POST['StockLocation']){ + echo '<option selected value="' . $myrow['loccode'] . '">' . $myrow['locationname'] . '</option>'; + } else { + echo '<option value="' . $myrow['loccode'] . '">' . $myrow['locationname'] . '</option>'; + } + } elseif ($myrow['loccode']==$_SESSION['UserStockLocation']){ + echo '<option selected value="' . $myrow['loccode'] . '">' . $myrow['locationname'] . '</option>'; + $_POST['StockLocation']=$myrow['loccode']; + } else { + echo '<option value="' . $myrow['loccode'] . '">' . $myrow['locationname'] . '</option>'; + } + } + echo '</select></td></tr>'; + + echo '</table> + <br /> + <div class="centre"> + <input type="submit" name="Go" value="' . _('Create PDF') . '" /> + </div>'; + + include('includes/footer.inc'); + exit; +} else { + + include('includes/ConnectDB.inc'); +} + + +if ($_POST['StockLocation']=='All') { + $sql= "SELECT stockmoves.type, + stockmoves.stockid, + stockmaster.description, + stockmaster.decimalplaces, + stockmoves.transno, + stockmoves.trandate, + stockmoves.qty, + stockmoves.reference, + stockmoves.narrative, + locations.locationname + FROM stockmoves + LEFT JOIN stockmaster + ON stockmoves.stockid=stockmaster.stockid + LEFT JOIN locations + ON stockmoves.loccode=locations.loccode + WHERE type='" . $_POST['TransType'] . "' + AND date_format(trandate, '%Y-%m-%d')>='".FormatDateForSQL($_POST['FromDate'])."' + AND date_format(trandate, '%Y-%m-%d')<='".FormatDateForSQL($_POST['ToDate'])."'"; +} else { + $sql= "SELECT stockmoves.type, + stockmoves.stockid, + stockmaster.description, + stockmaster.decimalplaces, + stockmo... [truncated message content] |
From: <dai...@us...> - 2011-09-16 10:29:32
|
Revision: 4691 http://web-erp.svn.sourceforge.net/web-erp/?rev=4691&view=rev Author: daintree Date: 2011-09-16 10:29:26 +0000 (Fri, 16 Sep 2011) Log Message: ----------- number_formats Modified Paths: -------------- trunk/PDFSuppTransListing.php trunk/PDFTopItems.php trunk/PO_AuthorisationLevels.php Modified: trunk/PDFSuppTransListing.php =================================================================== --- trunk/PDFSuppTransListing.php 2011-09-14 09:57:45 UTC (rev 4690) +++ trunk/PDFSuppTransListing.php 2011-09-16 10:29:26 UTC (rev 4691) @@ -26,7 +26,7 @@ echo '<form method="post" action="' . $_SERVER['PHP_SELF'] . '">'; echo '<input type="hidden" name="FormID" value="' . $_SESSION['FormID'] . '" />'; - echo '<table class=selection> + echo '<table class="selection"> <tr> <td>' . _('Enter the date for which the transactions are to be listed') . ':</td> <td><input type="text" name="Date" maxlength="10" size="10" class="date" alt="' . $_SESSION['DefaultDateFormat'] . '" value="' . Date($_SESSION['DefaultDateFormat']) . '"></td> @@ -59,8 +59,14 @@ trandate, ovamount, ovgst, - transtext - FROM supptrans + transtext, + currcode, + decimalplaces AS currdecimalplaces, + suppname + FROM supptrans INNER JOIN suppliers + ON supptrans.supplierno = suppliers.supplierno + INNER JOIN currencies + ON suppliers.currcode=currencies.currabrev WHERE type='" . $_POST['TransType'] . "' AND date_format(inputdate, '%Y-%m-%d')='".FormatDateForSQL($_POST['Date'])."'"; @@ -97,17 +103,13 @@ include ('includes/PDFSuppTransListingPageHeader.inc'); while ($myrow=DB_fetch_array($result)){ - - $sql="SELECT suppname FROM suppliers WHERE supplierid='" . $myrow['supplierno']."'"; - $supplierresult=DB_query($sql, $db); - $supplierrow=DB_fetch_array($supplierresult); - - $LeftOvers = $pdf->addTextWrap($Left_Margin,$YPos,160,$FontSize,$supplierrow['suppname'], 'left'); + $CurrDecimalPlaces = $myrow['currdecimalplaces']; + $LeftOvers = $pdf->addTextWrap($Left_Margin,$YPos,160,$FontSize,$myrow['suppname'], 'left'); $LeftOvers = $pdf->addTextWrap($Left_Margin+162,$YPos,80,$FontSize,$myrow['suppreference'], 'left'); $LeftOvers = $pdf->addTextWrap($Left_Margin+242,$YPos,70,$FontSize,ConvertSQLDate($myrow['trandate']), 'left'); - $LeftOvers = $pdf->addTextWrap($Left_Margin+312,$YPos,70,$FontSize,locale_number_format($myrow['ovamount'],2), 'right'); - $LeftOvers = $pdf->addTextWrap($Left_Margin+382,$YPos,70,$FontSize,locale_number_format($myrow['ovgst'],2), 'right'); - $LeftOvers = $pdf->addTextWrap($Left_Margin+452,$YPos,70,$FontSize,locale_number_format($myrow['ovamount']+$myrow['ovgst'],2), 'right'); + $LeftOvers = $pdf->addTextWrap($Left_Margin+312,$YPos,70,$FontSize,locale_money_format($myrow['ovamount'],$CurrDecimalPlaces), 'right'); + $LeftOvers = $pdf->addTextWrap($Left_Margin+382,$YPos,70,$FontSize,locale_money_format($myrow['ovgst'],$CurrDecimalPlaces), 'right'); + $LeftOvers = $pdf->addTextWrap($Left_Margin+452,$YPos,70,$FontSize,locale_money_format($myrow['ovamount']+$myrow['ovgst'],$CurrDecimalPlaces), 'right'); $YPos -= ($line_height); $TotalCheques = $TotalCheques - $myrow['ovamount']; @@ -121,10 +123,10 @@ $YPos-=$line_height; -$LeftOvers = $pdf->addTextWrap($Left_Margin+452,$YPos,70,$FontSize,locale_number_format(-$TotalCheques,2), 'right'); +$LeftOvers = $pdf->addTextWrap($Left_Margin+452,$YPos,70,$FontSize,locale_money_format(-$TotalCheques,$CurrDecimalPlaces), 'right'); $LeftOvers = $pdf->addTextWrap($Left_Margin+265,$YPos,300,$FontSize,_('Total') . ' ' . _('Transactions'), 'left'); $ReportFileName = $_SESSION['DatabaseName'] . '_SuppTransListing_' . date('Y-m-d').'.pdf'; $pdf->OutputD($ReportFileName); -$pdf->__destruct(); +$pdf->__destruct(); ?> \ No newline at end of file Modified: trunk/PDFTopItems.php =================================================================== --- trunk/PDFTopItems.php 2011-09-14 09:57:45 UTC (rev 4690) +++ trunk/PDFTopItems.php 2011-09-16 10:29:26 UTC (rev 4691) @@ -40,10 +40,10 @@ AND salesorderdetails.stkcode = stockmaster.stockid AND salesorders.debtorno = debtorsmaster.debtorno AND debtorsmaster.typeid = '" . $_GET['Customers'] . "' - AND salesorderdetails.ActualDispatchDate >= '" . $FromDate . "' + AND salesorderdetails.ActualDispatchDate >= '" . $FromDate . "' GROUP BY salesorderdetails.stkcode ORDER BY " . $_GET['Sequence'] . " DESC - LIMIT " . $_GET['NumberOfTopItems']; + LIMIT " . filter_number_format($_GET['NumberOfTopItems']); } else { //the situation if the customer type selected "All" if ($_GET['Customers'] == 'All') { @@ -58,10 +58,10 @@ AND salesorderdetails.stkcode = stockmaster.stockid AND salesorders.debtorno = debtorsmaster.debtorno AND salesorders.fromstkloc = '" . $_GET['Location'] . "' - AND salesorderdetails.ActualDispatchDate >= '" . $FromDate . "' + AND salesorderdetails.ActualDispatchDate >= '" . $FromDate . "' GROUP BY salesorderdetails.stkcode ORDER BY " . $_GET['Sequence'] . " DESC - LIMIT 0," . $_GET['NumberOfTopItems']; + LIMIT 0," . filter_number_format($_GET['NumberOfTopItems']); } else { //the situation if the location and customer type not selected "All" $SQL = "SELECT salesorderdetails.stkcode, @@ -76,10 +76,10 @@ AND salesorders.debtorno = debtorsmaster.debtorno AND salesorders.fromstkloc = '" . $_GET['Location'] . "' AND debtorsmaster.typeid = '" . $_GET['Customers'] . "' - AND salesorderdetails.actualdispatchdate >= '" . $FromDate . "' + AND salesorderdetails.actualdispatchdate >= '" . $FromDate . "' GROUP BY salesorderdetails.stkcode ORDER BY " . $_GET['Sequence'] . " DESC - LIMIT " . $_GET['NumberOfTopItems']; + LIMIT " . filter_number_format($_GET['NumberOfTopItems']); } } } @@ -97,7 +97,7 @@ $LeftOvers = $pdf->addTextWrap($Left_Margin + 100, $YPos, 100, $FontSize, $myrow['description']); $LeftOvers = $pdf->addTextWrap($Left_Margin + 330, $YPos, 30, $FontSize, locale_number_format($myrow['totalinvoiced'],$myrow['decimalplaces']), 'right'); $LeftOvers = $pdf->addTextWrap($Left_Margin + 370, $YPos, 300 - $Left_Margin, $FontSize, $myrow['units'], 'left'); - $LeftOvers = $pdf->addTextWrap($Left_Margin + 400, $YPos, 70, $FontSize, locale_number_format($myrow['valuesales'], $_SESSION['CompanyRecord']['decimalplaces']), 'right'); + $LeftOvers = $pdf->addTextWrap($Left_Margin + 400, $YPos, 70, $FontSize, locale_money_format($myrow['valuesales'], $_SESSION['CompanyRecord']['decimalplaces']), 'right'); $LeftOvers = $pdf->addTextWrap($Left_Margin + 490, $YPos, 30, $FontSize, locale_number_format($ohRow[0],$myrow['decimalplaces']), 'right'); if (mb_strlen($LeftOvers) > 1) { $LeftOvers = $pdf->addTextWrap($Left_Margin + 1 + 94, $YPos - $line_height, 270, $FontSize, $LeftOvers, 'left'); @@ -112,9 +112,9 @@ /*increment a line down for the next line item */ $YPos-= $line_height; } - + $pdf->OutputD($_SESSION['DatabaseName'] . '_TopItemsListing_' . date('Y-m-d').'.pdf'); - $pdf->__destruct(); + $pdf->__destruct(); } /*end of else not PrintPDF */ -?> +?> \ No newline at end of file Modified: trunk/PO_AuthorisationLevels.php =================================================================== --- trunk/PO_AuthorisationLevels.php 2011-09-14 09:57:45 UTC (rev 4690) +++ trunk/PO_AuthorisationLevels.php 2011-09-16 10:29:26 UTC (rev 4691) @@ -46,7 +46,7 @@ '".$_POST['CurrCode']."', '".$CanCreate."', '".$OffHold."', - '".$_POST['AuthLevel']."')"; + '" . filter_number_format($_POST['AuthLevel'])."')"; $ErrMsg = _('The authentication details cannot be inserted because'); $Result=DB_query($sql,$db,$ErrMsg); } else { @@ -69,10 +69,10 @@ $sql="UPDATE purchorderauth SET cancreate='".$CanCreate."', offhold='".$OffHold."', - authlevel='".$_POST['AuthLevel']."' + authlevel='".filter_number_format($_POST['AuthLevel'])."' WHERE userid='".$_POST['UserID']."' AND currabrev='".$_POST['CurrCode']."'"; - + $ErrMsg = _('The authentication details cannot be updated because'); $Result=DB_query($sql,$db,$ErrMsg); } @@ -111,9 +111,9 @@ purchorderauth.cancreate, purchorderauth.offhold, purchorderauth.authlevel - FROM purchorderauth INNER JOIN www_users + FROM purchorderauth INNER JOIN www_users ON purchorderauth.userid=www_users.userid - INNER JOIN currencies + INNER JOIN currencies ON purchorderauth.currabrev=currencies.currabrev"; $ErrMsg = _('The authentication details cannot be retrieved because'); @@ -187,7 +187,8 @@ $sql="SELECT cancreate, offhold, authlevel, - currency + currency, + decimalplaces FROM purchorderauth INNER JOIN currencies ON purchorderauth.currabrev=currencies.currabrev WHERE userid='".$_GET['UserID']."' @@ -200,7 +201,8 @@ $CanCreate=$myrow['cancreate']; $OffHold=$myrow['offhold']; $AuthLevel=$myrow['authlevel']; - + $CurrDecimalPlaces=$myrow['decimalplaces']; + echo '<tr> <td>'._('Currency').'</td> <td>' . $myrow['currency'] . '</td> @@ -235,7 +237,7 @@ } echo '<tr><td>'._('User can authorise orders up to :').'</td>'; -echo '<td><input type=input name="AuthLevel" size=11 class="number" value="' . $AuthLevel . '"></td</tr>'; +echo '<td><input type=input name="AuthLevel" size=11 class="number" value="' . locale_money_format($AuthLevel,$CurrDecimalPlaces) . '"></td</tr>'; echo '</table>'; if (isset($_GET['Edit'])) { This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <dai...@us...> - 2011-09-16 10:29:32
|
Revision: 4691 http://web-erp.svn.sourceforge.net/web-erp/?rev=4691&view=rev Author: daintree Date: 2011-09-16 10:29:26 +0000 (Fri, 16 Sep 2011) Log Message: ----------- number_formats Modified Paths: -------------- trunk/PDFSuppTransListing.php trunk/PDFTopItems.php trunk/PO_AuthorisationLevels.php Modified: trunk/PDFSuppTransListing.php =================================================================== --- trunk/PDFSuppTransListing.php 2011-09-14 09:57:45 UTC (rev 4690) +++ trunk/PDFSuppTransListing.php 2011-09-16 10:29:26 UTC (rev 4691) @@ -26,7 +26,7 @@ echo '<form method="post" action="' . $_SERVER['PHP_SELF'] . '">'; echo '<input type="hidden" name="FormID" value="' . $_SESSION['FormID'] . '" />'; - echo '<table class=selection> + echo '<table class="selection"> <tr> <td>' . _('Enter the date for which the transactions are to be listed') . ':</td> <td><input type="text" name="Date" maxlength="10" size="10" class="date" alt="' . $_SESSION['DefaultDateFormat'] . '" value="' . Date($_SESSION['DefaultDateFormat']) . '"></td> @@ -59,8 +59,14 @@ trandate, ovamount, ovgst, - transtext - FROM supptrans + transtext, + currcode, + decimalplaces AS currdecimalplaces, + suppname + FROM supptrans INNER JOIN suppliers + ON supptrans.supplierno = suppliers.supplierno + INNER JOIN currencies + ON suppliers.currcode=currencies.currabrev WHERE type='" . $_POST['TransType'] . "' AND date_format(inputdate, '%Y-%m-%d')='".FormatDateForSQL($_POST['Date'])."'"; @@ -97,17 +103,13 @@ include ('includes/PDFSuppTransListingPageHeader.inc'); while ($myrow=DB_fetch_array($result)){ - - $sql="SELECT suppname FROM suppliers WHERE supplierid='" . $myrow['supplierno']."'"; - $supplierresult=DB_query($sql, $db); - $supplierrow=DB_fetch_array($supplierresult); - - $LeftOvers = $pdf->addTextWrap($Left_Margin,$YPos,160,$FontSize,$supplierrow['suppname'], 'left'); + $CurrDecimalPlaces = $myrow['currdecimalplaces']; + $LeftOvers = $pdf->addTextWrap($Left_Margin,$YPos,160,$FontSize,$myrow['suppname'], 'left'); $LeftOvers = $pdf->addTextWrap($Left_Margin+162,$YPos,80,$FontSize,$myrow['suppreference'], 'left'); $LeftOvers = $pdf->addTextWrap($Left_Margin+242,$YPos,70,$FontSize,ConvertSQLDate($myrow['trandate']), 'left'); - $LeftOvers = $pdf->addTextWrap($Left_Margin+312,$YPos,70,$FontSize,locale_number_format($myrow['ovamount'],2), 'right'); - $LeftOvers = $pdf->addTextWrap($Left_Margin+382,$YPos,70,$FontSize,locale_number_format($myrow['ovgst'],2), 'right'); - $LeftOvers = $pdf->addTextWrap($Left_Margin+452,$YPos,70,$FontSize,locale_number_format($myrow['ovamount']+$myrow['ovgst'],2), 'right'); + $LeftOvers = $pdf->addTextWrap($Left_Margin+312,$YPos,70,$FontSize,locale_money_format($myrow['ovamount'],$CurrDecimalPlaces), 'right'); + $LeftOvers = $pdf->addTextWrap($Left_Margin+382,$YPos,70,$FontSize,locale_money_format($myrow['ovgst'],$CurrDecimalPlaces), 'right'); + $LeftOvers = $pdf->addTextWrap($Left_Margin+452,$YPos,70,$FontSize,locale_money_format($myrow['ovamount']+$myrow['ovgst'],$CurrDecimalPlaces), 'right'); $YPos -= ($line_height); $TotalCheques = $TotalCheques - $myrow['ovamount']; @@ -121,10 +123,10 @@ $YPos-=$line_height; -$LeftOvers = $pdf->addTextWrap($Left_Margin+452,$YPos,70,$FontSize,locale_number_format(-$TotalCheques,2), 'right'); +$LeftOvers = $pdf->addTextWrap($Left_Margin+452,$YPos,70,$FontSize,locale_money_format(-$TotalCheques,$CurrDecimalPlaces), 'right'); $LeftOvers = $pdf->addTextWrap($Left_Margin+265,$YPos,300,$FontSize,_('Total') . ' ' . _('Transactions'), 'left'); $ReportFileName = $_SESSION['DatabaseName'] . '_SuppTransListing_' . date('Y-m-d').'.pdf'; $pdf->OutputD($ReportFileName); -$pdf->__destruct(); +$pdf->__destruct(); ?> \ No newline at end of file Modified: trunk/PDFTopItems.php =================================================================== --- trunk/PDFTopItems.php 2011-09-14 09:57:45 UTC (rev 4690) +++ trunk/PDFTopItems.php 2011-09-16 10:29:26 UTC (rev 4691) @@ -40,10 +40,10 @@ AND salesorderdetails.stkcode = stockmaster.stockid AND salesorders.debtorno = debtorsmaster.debtorno AND debtorsmaster.typeid = '" . $_GET['Customers'] . "' - AND salesorderdetails.ActualDispatchDate >= '" . $FromDate . "' + AND salesorderdetails.ActualDispatchDate >= '" . $FromDate . "' GROUP BY salesorderdetails.stkcode ORDER BY " . $_GET['Sequence'] . " DESC - LIMIT " . $_GET['NumberOfTopItems']; + LIMIT " . filter_number_format($_GET['NumberOfTopItems']); } else { //the situation if the customer type selected "All" if ($_GET['Customers'] == 'All') { @@ -58,10 +58,10 @@ AND salesorderdetails.stkcode = stockmaster.stockid AND salesorders.debtorno = debtorsmaster.debtorno AND salesorders.fromstkloc = '" . $_GET['Location'] . "' - AND salesorderdetails.ActualDispatchDate >= '" . $FromDate . "' + AND salesorderdetails.ActualDispatchDate >= '" . $FromDate . "' GROUP BY salesorderdetails.stkcode ORDER BY " . $_GET['Sequence'] . " DESC - LIMIT 0," . $_GET['NumberOfTopItems']; + LIMIT 0," . filter_number_format($_GET['NumberOfTopItems']); } else { //the situation if the location and customer type not selected "All" $SQL = "SELECT salesorderdetails.stkcode, @@ -76,10 +76,10 @@ AND salesorders.debtorno = debtorsmaster.debtorno AND salesorders.fromstkloc = '" . $_GET['Location'] . "' AND debtorsmaster.typeid = '" . $_GET['Customers'] . "' - AND salesorderdetails.actualdispatchdate >= '" . $FromDate . "' + AND salesorderdetails.actualdispatchdate >= '" . $FromDate . "' GROUP BY salesorderdetails.stkcode ORDER BY " . $_GET['Sequence'] . " DESC - LIMIT " . $_GET['NumberOfTopItems']; + LIMIT " . filter_number_format($_GET['NumberOfTopItems']); } } } @@ -97,7 +97,7 @@ $LeftOvers = $pdf->addTextWrap($Left_Margin + 100, $YPos, 100, $FontSize, $myrow['description']); $LeftOvers = $pdf->addTextWrap($Left_Margin + 330, $YPos, 30, $FontSize, locale_number_format($myrow['totalinvoiced'],$myrow['decimalplaces']), 'right'); $LeftOvers = $pdf->addTextWrap($Left_Margin + 370, $YPos, 300 - $Left_Margin, $FontSize, $myrow['units'], 'left'); - $LeftOvers = $pdf->addTextWrap($Left_Margin + 400, $YPos, 70, $FontSize, locale_number_format($myrow['valuesales'], $_SESSION['CompanyRecord']['decimalplaces']), 'right'); + $LeftOvers = $pdf->addTextWrap($Left_Margin + 400, $YPos, 70, $FontSize, locale_money_format($myrow['valuesales'], $_SESSION['CompanyRecord']['decimalplaces']), 'right'); $LeftOvers = $pdf->addTextWrap($Left_Margin + 490, $YPos, 30, $FontSize, locale_number_format($ohRow[0],$myrow['decimalplaces']), 'right'); if (mb_strlen($LeftOvers) > 1) { $LeftOvers = $pdf->addTextWrap($Left_Margin + 1 + 94, $YPos - $line_height, 270, $FontSize, $LeftOvers, 'left'); @@ -112,9 +112,9 @@ /*increment a line down for the next line item */ $YPos-= $line_height; } - + $pdf->OutputD($_SESSION['DatabaseName'] . '_TopItemsListing_' . date('Y-m-d').'.pdf'); - $pdf->__destruct(); + $pdf->__destruct(); } /*end of else not PrintPDF */ -?> +?> \ No newline at end of file Modified: trunk/PO_AuthorisationLevels.php =================================================================== --- trunk/PO_AuthorisationLevels.php 2011-09-14 09:57:45 UTC (rev 4690) +++ trunk/PO_AuthorisationLevels.php 2011-09-16 10:29:26 UTC (rev 4691) @@ -46,7 +46,7 @@ '".$_POST['CurrCode']."', '".$CanCreate."', '".$OffHold."', - '".$_POST['AuthLevel']."')"; + '" . filter_number_format($_POST['AuthLevel'])."')"; $ErrMsg = _('The authentication details cannot be inserted because'); $Result=DB_query($sql,$db,$ErrMsg); } else { @@ -69,10 +69,10 @@ $sql="UPDATE purchorderauth SET cancreate='".$CanCreate."', offhold='".$OffHold."', - authlevel='".$_POST['AuthLevel']."' + authlevel='".filter_number_format($_POST['AuthLevel'])."' WHERE userid='".$_POST['UserID']."' AND currabrev='".$_POST['CurrCode']."'"; - + $ErrMsg = _('The authentication details cannot be updated because'); $Result=DB_query($sql,$db,$ErrMsg); } @@ -111,9 +111,9 @@ purchorderauth.cancreate, purchorderauth.offhold, purchorderauth.authlevel - FROM purchorderauth INNER JOIN www_users + FROM purchorderauth INNER JOIN www_users ON purchorderauth.userid=www_users.userid - INNER JOIN currencies + INNER JOIN currencies ON purchorderauth.currabrev=currencies.currabrev"; $ErrMsg = _('The authentication details cannot be retrieved because'); @@ -187,7 +187,8 @@ $sql="SELECT cancreate, offhold, authlevel, - currency + currency, + decimalplaces FROM purchorderauth INNER JOIN currencies ON purchorderauth.currabrev=currencies.currabrev WHERE userid='".$_GET['UserID']."' @@ -200,7 +201,8 @@ $CanCreate=$myrow['cancreate']; $OffHold=$myrow['offhold']; $AuthLevel=$myrow['authlevel']; - + $CurrDecimalPlaces=$myrow['decimalplaces']; + echo '<tr> <td>'._('Currency').'</td> <td>' . $myrow['currency'] . '</td> @@ -235,7 +237,7 @@ } echo '<tr><td>'._('User can authorise orders up to :').'</td>'; -echo '<td><input type=input name="AuthLevel" size=11 class="number" value="' . $AuthLevel . '"></td</tr>'; +echo '<td><input type=input name="AuthLevel" size=11 class="number" value="' . locale_money_format($AuthLevel,$CurrDecimalPlaces) . '"></td</tr>'; echo '</table>'; if (isset($_GET['Edit'])) { This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <dai...@us...> - 2011-09-16 23:15:15
|
Revision: 4692 http://web-erp.svn.sourceforge.net/web-erp/?rev=4692&view=rev Author: daintree Date: 2011-09-16 23:15:08 +0000 (Fri, 16 Sep 2011) Log Message: ----------- make windows use the correct locale Modified Paths: -------------- trunk/DeliveryDetails.php trunk/PrintCustTrans.php trunk/PrintCustTransPortrait.php trunk/UserSettings.php trunk/WWW_Users.php trunk/doc/Change.log trunk/includes/LanguageSetup.php trunk/includes/LanguagesArray.php Modified: trunk/DeliveryDetails.php =================================================================== --- trunk/DeliveryDetails.php 2011-09-16 10:29:26 UTC (rev 4691) +++ trunk/DeliveryDetails.php 2011-09-16 23:15:08 UTC (rev 4692) @@ -44,7 +44,7 @@ /*store the old freight cost before it is recalculated to ensure that there has been no change - test for change after freight recalculated and get user to re-confirm if changed */ - $OldFreightCost = round(filter_number_format($_POST['FreightCost']),2); + $OldFreightCost = round(filter_number_format($_POST['FreightCost']),$_SESSION['Items'.$identifier]->CurrDecimalPlaces); } @@ -119,7 +119,7 @@ if ($_SESSION['DoFreightCalc']==True){ list ($_POST['FreightCost'], $BestShipper) = CalcFreightCost($_SESSION['Items'.$identifier]->total, $_POST['BrAdd2'], $_POST['BrAdd3'], $_SESSION['Items'.$identifier]->totalVolume, $_SESSION['Items'.$identifier]->totalWeight, $_SESSION['Items'.$identifier]->Location, $db); if ( !empty($BestShipper) ){ - $_POST['FreightCost'] = round(filter_number_format($_POST['FreightCost']),2); + $_POST['FreightCost'] = round(filter_number_format($_POST['FreightCost']),$_SESSION['Items'.$identifier]->CurrDecimalPlaces); $_POST['ShipVia'] = $BestShipper; } else { prnMsg(_($_POST['FreightCost']),'warn'); @@ -183,7 +183,7 @@ $_SESSION['Items'.$identifier]->ConfirmedDate = $_POST['ConfirmedDate']; $_SESSION['Items'.$identifier]->CustRef = $_POST['CustRef']; $_SESSION['Items'.$identifier]->Comments = $_POST['Comments']; - $_SESSION['Items'.$identifier]->FreightCost = round(filter_number_format($_POST['FreightCost']),2); + $_SESSION['Items'.$identifier]->FreightCost = round(filter_number_format($_POST['FreightCost']),$_SESSION['Items'.$identifier]->CurrDecimalPlaces); $_SESSION['Items'.$identifier]->Quotation = $_POST['Quotation']; } else { $_SESSION['Items'.$identifier]->DeliverTo = $_POST['DeliverTo']; @@ -200,13 +200,13 @@ $_SESSION['Items'.$identifier]->ShipVia = $_POST['ShipVia']; $_SESSION['Items'.$identifier]->DeliverBlind = $_POST['DeliverBlind']; $_SESSION['Items'.$identifier]->SpecialInstructions = $_POST['SpecialInstructions']; - $_SESSION['Items'.$identifier]->DeliveryDays = filter_number_format$_POST['DeliveryDays']); + $_SESSION['Items'.$identifier]->DeliveryDays = filter_number_format($_POST['DeliveryDays']); $_SESSION['Items'.$identifier]->DeliveryDate = $_POST['DeliveryDate']; $_SESSION['Items'.$identifier]->QuoteDate = $_POST['QuoteDate']; $_SESSION['Items'.$identifier]->ConfirmedDate = $_POST['ConfirmedDate']; $_SESSION['Items'.$identifier]->CustRef = $_POST['CustRef']; $_SESSION['Items'.$identifier]->Comments = $_POST['Comments']; - $_SESSION['Items'.$identifier]->FreightCost = round(filter_number_format($_POST['FreightCost']),2); + $_SESSION['Items'.$identifier]->FreightCost = round(filter_number_format($_POST['FreightCost']),$_SESSION['Items'.$identifier]->CurrDecimalPlaces); $_SESSION['Items'.$identifier]->Quotation = $_POST['Quotation']; } /*$_SESSION['DoFreightCalc'] is a setting in the config.php file that the user can set to false to turn off freight calculations if necessary */ Modified: trunk/PrintCustTrans.php =================================================================== --- trunk/PrintCustTrans.php 2011-09-16 10:29:26 UTC (rev 4691) +++ trunk/PrintCustTrans.php 2011-09-16 23:15:08 UTC (rev 4692) @@ -231,10 +231,9 @@ stockmoves.narrative, stockmaster.units, stockmaster.decimalplaces - FROM stockmoves, - stockmaster - WHERE stockmoves.stockid = stockmaster.stockid - AND stockmoves.type=10 + FROM stockmoves INNER JOIN stockmaster + ON stockmoves.stockid = stockmaster.stockid + WHERE stockmoves.type=10 AND stockmoves.transno=" . $FromTransNo . " AND stockmoves.show_on_inv_crds=1"; } else { @@ -248,10 +247,9 @@ stockmoves.narrative, stockmaster.units, stockmaster.decimalplaces - FROM stockmoves, - stockmaster - WHERE stockmoves.stockid = stockmaster.stockid - AND stockmoves.type=11 + FROM stockmoves INNER JOIN stockmaster + ON stockmoves.stockid = stockmaster.stockid + WHERE stockmoves.type=11 AND stockmoves.transno=" . $FromTransNo . " AND stockmoves.show_on_inv_crds=1"; } // end else Modified: trunk/PrintCustTransPortrait.php =================================================================== --- trunk/PrintCustTransPortrait.php 2011-09-16 10:29:26 UTC (rev 4691) +++ trunk/PrintCustTransPortrait.php 2011-09-16 23:15:08 UTC (rev 4692) @@ -253,6 +253,7 @@ (stockmoves.price * " . $ExchRate . ") AS fxprice, stockmoves.narrative, stockmaster.controlled, + stockmaster.serialised, stockmaster.units, stockmoves.stkmoveno, stockmaster.decimalplaces @@ -271,6 +272,7 @@ (stockmoves.price * " . $ExchRate . ") AS fxprice, stockmoves.narrative, stockmaster.controlled, + stockmaster.serialised, stockmaster.units, stockmoves.stkmoveno, stockmaster.decimalplaces Modified: trunk/UserSettings.php =================================================================== --- trunk/UserSettings.php 2011-09-16 10:29:26 UTC (rev 4691) +++ trunk/UserSettings.php 2011-09-16 23:15:08 UTC (rev 4692) @@ -5,7 +5,6 @@ include('includes/session.inc'); $title = _('User Settings'); include('includes/header.inc'); -include('includes/LanguagesArray.php'); echo '<p class="page_title_text"><img src="'.$rootpath.'/css/'.$theme.'/images/user.png" title="' . _('User Settings') . '" alt="" />' . ' ' . _('User Settings') . '</p>'; @@ -134,11 +133,11 @@ foreach ($LanguagesArray as $LanguageEntry => $LanguageName){ if (isset($_POST['Language']) AND $_POST['Language'] == $LanguageEntry){ - echo '<option selected value="' . $LanguageEntry . '">' . $LanguageName .'</option>'; + echo '<option selected value="' . $LanguageEntry . '">' . $LanguageName['LanguageName'] .'</option>'; } elseif (!isset($_POST['Language']) AND $LanguageEntry == $DefaultLanguage) { - echo '<option selected value="' . $LanguageEntry . '">' . $LanguageName .'</option>'; + echo '<option selected value="' . $LanguageEntry . '">' . $LanguageName['LanguageName'] .'</option>'; } else { - echo '<option value="' . $LanguageEntry . '">' . $LanguageName .'</option>'; + echo '<option value="' . $LanguageEntry . '">' . $LanguageName['LanguageName'] .'</option>'; } } echo '</select></td></tr>'; Modified: trunk/WWW_Users.php =================================================================== --- trunk/WWW_Users.php 2011-09-16 10:29:26 UTC (rev 4691) +++ trunk/WWW_Users.php 2011-09-16 23:15:08 UTC (rev 4692) @@ -8,7 +8,6 @@ } } include('includes/session.inc'); -include ('includes/LanguagesArray.php'); $ModuleList = array(_('Orders'), _('Receivables'), @@ -84,7 +83,15 @@ $InputError = 1; } */ - + if (!isset($SelectedUser)){ + /* check to ensure the user id is not already entered */ + $result = DB_query("SELECT userid FROM www_users WHERE userid='" . $_POST['UserID'] . "'",$db); + if (DB_num_rows($result)==1){ + $InputError =1; + prnMsg(_('The user ID') . ' ' . $_POST['UserID'] . ' ' . _('already exists and cannot be used again'),'error'); + } + } + if ((mb_strlen($_POST['BranchCode'])>0) AND ($InputError !=1)) { // check that the entered branch is valid for the customer code $sql = "SELECT custbranch.debtorno @@ -113,7 +120,7 @@ $_POST['ModulesAllowed']= $ModulesAllowed; - if ($SelectedUser AND $InputError !=1) { + if (isset($SelectedUser) AND $InputError !=1) { /*SelectedUser could also exist if submit had not been clicked this code would not run in this case cos submit is false of course see the delete code below*/ @@ -388,7 +395,7 @@ } else { //end of if $SelectedUser only do the else when a new record is being entered - echo '<table class=selection> + echo '<table class="selection"> <tr> <td>' . _('User Login') . ':</td> <td><input type="text" name="UserID" size="22" maxlength="20"></td></tr>'; @@ -447,7 +454,7 @@ $result = DB_query($sql,$db); while ($myrow=DB_fetch_array($result)){ - if (isset($_POST['DefaultLocation']) and $myrow['loccode'] == $_POST['DefaultLocation']){ + if (isset($_POST['DefaultLocation']) AND $myrow['loccode'] == $_POST['DefaultLocation']){ echo '<option selected value="' . $myrow['loccode'] . '">' . $myrow['locationname'] .'</option>'; } else { echo '<option Value="' . $myrow['loccode'] . '">' . $myrow['locationname'] .'</option>'; @@ -478,14 +485,14 @@ $sql = "SELECT salesmancode, salesmanname FROM salesman WHERE current = 1"; $result = DB_query($sql,$db); -if ((isset($_POST['Salesman']) and $_POST['Salesman']=='') OR !isset($_POST['Salesman'])){ +if ((isset($_POST['Salesman']) AND $_POST['Salesman']=='') OR !isset($_POST['Salesman'])){ echo '<option selected value="">' . _('Not a salesperson only login') . '</option>'; } else { echo '<option value="">' . _('Not a salesperson only login') . '</option>'; } while ($myrow=DB_fetch_array($result)){ - if (isset($_POST['Salesman']) and $myrow['salesmancode'] == $_POST['Salesman']){ + if (isset($_POST['Salesman']) AND $myrow['salesmancode'] == $_POST['Salesman']){ echo '<option selected value="' . $myrow['salesmancode'] . '">' . $myrow['salesmanname'] . '</option>'; } else { echo '<option value="' . $myrow['salesmancode'] . '">' . $myrow['salesmanname'] . '</option>'; @@ -498,42 +505,42 @@ echo '<tr><td>' . _('Reports Page Size') .':</td> <td><select name="PageSize">'; -if(isset($_POST['PageSize']) and $_POST['PageSize']=='A4'){ +if(isset($_POST['PageSize']) AND $_POST['PageSize']=='A4'){ echo '<option selected value="A4">' . _('A4') .'</option>'; } else { echo '<option value="A4">' . _('A4') . '</option>'; } -if(isset($_POST['PageSize']) and $_POST['PageSize']=='A3'){ +if(isset($_POST['PageSize']) AND $_POST['PageSize']=='A3'){ echo '<option selected value="A3">' . _('A3') .'</option>'; } else { echo '<option value="A3">' . _('A3') .'</option>'; } -if(isset($_POST['PageSize']) and $_POST['PageSize']=='A3_landscape'){ +if(isset($_POST['PageSize']) AND $_POST['PageSize']=='A3_landscape'){ echo '<option selected value="A3_landscape">' . _('A3') . ' ' . _('landscape') .'</option>'; } else { echo '<option value="A3_landscape">' . _('A3') . ' ' . _('landscape') .'</option>'; } -if(isset($_POST['PageSize']) and $_POST['PageSize']=='letter'){ +if(isset($_POST['PageSize']) AND $_POST['PageSize']=='letter'){ echo '<option selected value="letter">' . _('Letter') .'</option>'; } else { echo '<option value="letter">' . _('Letter') .'</option>'; } -if(isset($_POST['PageSize']) and $_POST['PageSize']=='letter_landscape'){ +if(isset($_POST['PageSize']) AND $_POST['PageSize']=='letter_landscape'){ echo '<option selected value="letter_landscape">' . _('Letter') . ' ' . _('landscape') .'</option>'; } else { echo '<option value="letter_landscape">' . _('Letter') . ' ' . _('landscape') .'</option>'; } -if(isset($_POST['PageSize']) and $_POST['PageSize']=='legal'){ +if(isset($_POST['PageSize']) AND $_POST['PageSize']=='legal'){ echo '<option selected value="legal">' . _('Legal') .'</option>'; } else { echo '<option value="legal">' . _('Legal') .'</option>'; } -if(isset($_POST['PageSize']) and $_POST['PageSize']=='legal_landscape'){ +if(isset($_POST['PageSize']) AND $_POST['PageSize']=='legal_landscape'){ echo '<option selected value="legal_landscape">' . _('Legal') . ' ' . _('landscape') .'</option>'; } else { echo '<option value="legal_landscape">' . _('Legal') . ' ' . _('landscape') .'</option>'; @@ -552,9 +559,9 @@ if (is_dir('css/' . $ThemeName) AND $ThemeName != '.' AND $ThemeName != '..' AND $ThemeName != '.svn'){ - if (isset($_POST['Theme']) and $_POST['Theme'] == $ThemeName){ + if (isset($_POST['Theme']) AND $_POST['Theme'] == $ThemeName){ echo '<option selected value="' . $ThemeName . '">' . $ThemeName .'</option>'; - } else if (!isset($_POST['Theme']) and ($_SESSION['DefaultTheme']==$ThemeName)) { + } else if (!isset($_POST['Theme']) AND ($_SESSION['DefaultTheme']==$ThemeName)) { echo '<option selected value="' . $ThemeName . '">' . $ThemeName .'</option>'; } else { echo '<option value="' . $ThemeName . '">' . $ThemeName .'</option>'; @@ -570,12 +577,12 @@ <td><select name="UserLanguage">'; foreach ($LanguagesArray as $LanguageEntry => $LanguageName){ - if (isset($_POST['UserLanguage']) and $_POST['UserLanguage'] == $LanguageEntry){ - echo '<option selected value="' . $LanguageEntry . '">' . $LanguageName .'</option>'; - } elseif (!isset($_POST['UserLanguage']) and $LanguageEntry == $DefaultLanguage) { - echo '<option selected value="' . $LanguageEntry . '">' . $LanguageName .'</option>'; + if (isset($_POST['UserLanguage']) AND $_POST['UserLanguage'] == $LanguageEntry){ + echo '<option selected value="' . $LanguageEntry . '">' . $LanguageName['LanguageName'] .'</option>'; + } elseif (!isset($_POST['UserLanguage']) AND $LanguageEntry == $DefaultLanguage) { + echo '<option selected value="' . $LanguageEntry . '">' . $LanguageName['LanguageName'] .'</option>'; } else { - echo '<option value="' . $LanguageEntry . '">' . $LanguageName .'</option>'; + echo '<option value="' . $LanguageEntry . '">' . $LanguageName['LanguageName'] .'</option>'; } } echo '</select></td></tr>'; Modified: trunk/doc/Change.log =================================================================== --- trunk/doc/Change.log 2011-09-16 10:29:26 UTC (rev 4691) +++ trunk/doc/Change.log 2011-09-16 23:15:08 UTC (rev 4692) @@ -1,6 +1,6 @@ webERP Change Log - +17/9/11 Felix Lim: added serialised field into PrintCustTransPortrait.php to reinstate possiblity for printing serialised items on invoice - not possible in landscape version (PrintCustTrans.php) 12/9/11 Phil/Exson/Tom: Change all scripts to allow display and input of numbers in the format of the selected users locale 5/9/11 Phil: Fixed supplier payment exchange rate ... was being calculated incorrectly from functional exchange rate and the exchange rate between the currency of the bank account and currency of payment. 5/9/11 Phil: GLTransInquiry posted was not retrieved correctly - now fixed Modified: trunk/includes/LanguageSetup.php =================================================================== --- trunk/includes/LanguageSetup.php 2011-09-16 10:29:26 UTC (rev 4691) +++ trunk/includes/LanguageSetup.php 2011-09-16 23:15:08 UTC (rev 4692) @@ -4,7 +4,7 @@ /* Set internal character encoding to UTF-8 */ mb_internal_encoding('UTF-8'); - +include('includes/LanguagesArray.php'); /* This file is included in session.inc or PDFStarter.php or a report script that does not use PDFStarter.php to check for the existance of gettext function and setup the necessary enviroment to allow for automatic translation @@ -13,7 +13,7 @@ normally the lower case two character country code underscore uppercase 2 character country code does the trick except for en !!*/ -// Specify location of translation tables + If (isset($_POST['Language'])) { $_SESSION['Language'] = $_POST['Language']; $Language = $_POST['Language']; @@ -24,8 +24,14 @@ $Language = $_SESSION['Language']; } -$Locale = setlocale (LC_ALL, $_SESSION['Language']); -$Locale = setlocale (LC_NUMERIC, 'fr_FR.utf8'); +if (defined('LC_MESSAGES')){ //it's a unix/linux server + $Locale = setlocale (LC_MESSAGES, $_SESSION['Language']); + $Locale = setlocale (LC_NUMERIC, $_SESSION['Language']); +} else { // it's a windows server + $Locale = setlocale (LC_ALL, $LanguageArray[$_SESSION['Language']]['WindowsLocale']); +} +//$Locale = setlocale (LC_NUMERIC, 'fr_FR.utf8'); + $LocaleInfo = localeconv(); if ($LocaleInfo['mon_decimal_point']==''){ $LocaleInfo['mon_decimal_point']= $LocaleInfo['decimal_point']; @@ -33,11 +39,9 @@ if ($LocaleInfo['mon_thousands_sep']==''){ $LocaleInfo['mon_thousands_sep']= $LocaleInfo['thousands_sep']; } -if (defined('LC_MESSAGES')){ - $Locale = setlocale (LC_MESSAGES, $_SESSION['Language']); -} + //Turkish seems to be a special case if ($_SESSION['Language']=='tr_TR.utf8') { $Locale = setlocale(LC_CTYPE, 'C'); Modified: trunk/includes/LanguagesArray.php =================================================================== --- trunk/includes/LanguagesArray.php 2011-09-16 10:29:26 UTC (rev 4691) +++ trunk/includes/LanguagesArray.php 2011-09-16 23:15:08 UTC (rev 4692) @@ -1,32 +1,60 @@ <?php $LanguagesArray = array(); -$LanguagesArray['en_US.utf8'] = _('English US'); -$LanguagesArray['en_GB.utf8'] = _('English British'); -$LanguagesArray['cz_CZ.utf8'] = _('Czechoslovakian'); -$LanguagesArray['de_DE.utf8'] = _('German'); -$LanguagesArray['el_GR.utf8'] = _('Greek'); -$LanguagesArray['es_ES.utf8'] = _('Spanish'); -$LanguagesArray['et_EE.utf8'] = _('Estonian'); -$LanguagesArray['fa_IR.utf8'] = _('Arabic'); -$LanguagesArray['fr_FR.utf8'] = _('French'); -$LanguagesArray['hi_IN.utf8'] = _('Hindi'); -$LanguagesArray['hr_HR.utf8'] = _('Hungarian'); -$LanguagesArray['id_ID.utf8'] = _('Indonisian'); -$LanguagesArray['it_IT.utf8'] = _('Italian'); -$LanguagesArray['ja_JP.utf8'] = _('Japanese'); -$LanguagesArray['lv_LV.utf8'] = _('Latvian'); -$LanguagesArray['nl_NL.utf8'] = _('Dutch'); -$LanguagesArray['pl_PL.utf8'] = _('Polish'); -$LanguagesArray['pt_BR.utf8'] = _('Brazilian Portuguese'); -$LanguagesArray['pt_PT.utf8'] = _('Portuguese'); -$LanguagesArray['ro_RO.utf8'] = _('Roumanian'); -$LanguagesArray['ru_RU.utf8'] = _('Russian'); -$LanguagesArray['sq_AL.utf8'] = _('Albanian'); -$LanguagesArray['sv_SE.utf8'] = _('Sweedish'); -$LanguagesArray['sw_KE.utf8'] = _('Kiswahili'); -$LanguagesArray['tr_TR.utf8'] = _('Turkish'); -$LanguagesArray['vi_VN.utf8'] = _('Vietnamese'); -$LanguagesArray['zh_CN.utf8'] = _('Chinese - Simplified'); -$LanguagesArray['zh_HK.utf8'] = _('Chinese - Traditional'); +$LanguagesArray['en_US.utf8']['LanguageName'] = _('English US'); +$LanguagesArray['en_US.utf8']['WindowsLocale'] = 'english-us'; +$LanguagesArray['en_GB.utf8']['LanguageName'] = _('English British'); +$LanguagesArray['en_GB.utf8']['WindowsLocale'] = 'english-uk'; +$LanguagesArray['cz_CZ.utf8']['LanguageName'] = _('Czechoslovakian'); +$LanguagesArray['cz_CZ.utf8']['WindowsLocale'] = 'czech'; +$LanguagesArray['de_DE.utf8']['LanguageName'] = _('German'); +$LanguagesArray['de_DE.utf8']['WindowsLocale'] = 'german'; +$LanguagesArray['el_GR.utf8']['LanguageName'] = _('Greek'); +$LanguagesArray['el_GR.utf8']['WindowsLocale'] = 'greek'; +$LanguagesArray['es_ES.utf8']['LanguageName'] = _('Spanish'); +$LanguagesArray['es_ES.utf8']['WindowsLocale'] = 'spanish'; +$LanguagesArray['et_EE.utf8']['LanguageName'] = _('Estonian'); +$LanguagesArray['et_EE.utf8']['WindowsLocale'] = 'estonian'; +$LanguagesArray['fa_IR.utf8']['LanguageName'] = _('Arabic'); +$LanguagesArray['fa_IR.utf8']['WindowsLocale'] = 'arabic'; +$LanguagesArray['fr_FR.utf8']['LanguageName'] = _('French'); +$LanguagesArray['fr_FR.utf8']['WindowsLocale'] = 'french'; +$LanguagesArray['hi_IN.utf8']['LanguageName'] = _('Hindi'); +$LanguagesArray['hi_IN.utf8']['WindowsLocale'] = 'hindi'; +$LanguagesArray['hr_HR.utf8']['LanguageName'] = _('Hungarian'); +$LanguagesArray['hr_HR.utf8']['WindowsLocale'] = 'hungarian'; +$LanguagesArray['id_ID.utf8']['LanguageName'] = _('Indonisian'); +$LanguagesArray['id_ID.utf8']['WindowsLocale'] = 'indonesian'; +$LanguagesArray['it_IT.utf8']['LanguageName'] = _('Italian'); +$LanguagesArray['it_IT.utf8']['WindowsLocale'] = 'italian'; +$LanguagesArray['ja_JP.utf8']['LanguageName'] = _('Japanese'); +$LanguagesArray['ja_JP.utf8']['WindowsLocale'] = 'japanese'; +$LanguagesArray['lv_LV.utf8']['LanguageName'] = _('Latvian'); +$LanguagesArray['lv_LV.utf8']['WindowsLocale'] = 'latvian'; +$LanguagesArray['nl_NL.utf8']['LanguageName'] = _('Dutch'); +$LanguagesArray['nl_NL.utf8']['WindowsLocale'] = 'dutch'; +$LanguagesArray['pl_PL.utf8']['LanguageName'] = _('Polish'); +$LanguagesArray['pl_PL.utf8']['WindowsLocale'] = 'polish'; +$LanguagesArray['pt_BR.utf8']['LanguageName'] = _('Brazilian Portuguese'); +$LanguagesArray['pt_BR.utf8']['WindowsLocale'] = 'portuguese-brazil'; +$LanguagesArray['pt_PT.utf8']['LanguageName'] = _('Portuguese'); +$LanguagesArray['pt_PT.utf8']['WindowsLocale'] = 'portuguese'; +$LanguagesArray['ro_RO.utf8']['LanguageName'] = _('Romanian'); +$LanguagesArray['ro_RO.utf8']['WindowsLocale'] = 'romanian'; +$LanguagesArray['ru_RU.utf8']['LanguageName'] = _('Russian'); +$LanguagesArray['ru_RU.utf8']['WindowsLocale'] = 'russian'; +$LanguagesArray['sq_AL.utf8']['LanguageName'] = _('Albanian'); +$LanguagesArray['sq_AL.utf8']['WindowsLocale'] = 'english-us'; +$LanguagesArray['sv_SE.utf8']['LanguageName'] = _('Sweedish'); +$LanguagesArray['sv_SE.utf8']['WindowsLocale'] = 'swedish'; +$LanguagesArray['sw_KE.utf8']['LanguageName'] = _('Kiswahili'); +$LanguagesArray['sw_KE.utf8']['WindowsLocale'] = 'english-us'; +$LanguagesArray['tr_TR.utf8']['LanguageName'] = _('Turkish'); +$LanguagesArray['tr_TR.utf8']['WindowsLocale'] = 'turkish'; +$LanguagesArray['vi_VN.utf8']['LanguageName'] = _('Vietnamese'); +$LanguagesArray['vi_VN.utf8']['WindowsLocale'] = 'vietnamese'; +$LanguagesArray['zh_CN.utf8']['LanguageName'] = _('Chinese - Simplified'); +$LanguagesArray['zh_CN.utf8']['WindowsLocale'] = 'chinese-simplified'; +$LanguagesArray['zh_HK.utf8']['LanguageName'] = _('Chinese - Traditional'); +$LanguagesArray['zh_HK.utf8']['WindowsLocale'] = 'chinese-traditional'; asort($LanguagesArray); -?> +?> \ No newline at end of file This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <dai...@us...> - 2011-09-16 23:15:15
|
Revision: 4692 http://web-erp.svn.sourceforge.net/web-erp/?rev=4692&view=rev Author: daintree Date: 2011-09-16 23:15:08 +0000 (Fri, 16 Sep 2011) Log Message: ----------- make windows use the correct locale Modified Paths: -------------- trunk/DeliveryDetails.php trunk/PrintCustTrans.php trunk/PrintCustTransPortrait.php trunk/UserSettings.php trunk/WWW_Users.php trunk/doc/Change.log trunk/includes/LanguageSetup.php trunk/includes/LanguagesArray.php Modified: trunk/DeliveryDetails.php =================================================================== --- trunk/DeliveryDetails.php 2011-09-16 10:29:26 UTC (rev 4691) +++ trunk/DeliveryDetails.php 2011-09-16 23:15:08 UTC (rev 4692) @@ -44,7 +44,7 @@ /*store the old freight cost before it is recalculated to ensure that there has been no change - test for change after freight recalculated and get user to re-confirm if changed */ - $OldFreightCost = round(filter_number_format($_POST['FreightCost']),2); + $OldFreightCost = round(filter_number_format($_POST['FreightCost']),$_SESSION['Items'.$identifier]->CurrDecimalPlaces); } @@ -119,7 +119,7 @@ if ($_SESSION['DoFreightCalc']==True){ list ($_POST['FreightCost'], $BestShipper) = CalcFreightCost($_SESSION['Items'.$identifier]->total, $_POST['BrAdd2'], $_POST['BrAdd3'], $_SESSION['Items'.$identifier]->totalVolume, $_SESSION['Items'.$identifier]->totalWeight, $_SESSION['Items'.$identifier]->Location, $db); if ( !empty($BestShipper) ){ - $_POST['FreightCost'] = round(filter_number_format($_POST['FreightCost']),2); + $_POST['FreightCost'] = round(filter_number_format($_POST['FreightCost']),$_SESSION['Items'.$identifier]->CurrDecimalPlaces); $_POST['ShipVia'] = $BestShipper; } else { prnMsg(_($_POST['FreightCost']),'warn'); @@ -183,7 +183,7 @@ $_SESSION['Items'.$identifier]->ConfirmedDate = $_POST['ConfirmedDate']; $_SESSION['Items'.$identifier]->CustRef = $_POST['CustRef']; $_SESSION['Items'.$identifier]->Comments = $_POST['Comments']; - $_SESSION['Items'.$identifier]->FreightCost = round(filter_number_format($_POST['FreightCost']),2); + $_SESSION['Items'.$identifier]->FreightCost = round(filter_number_format($_POST['FreightCost']),$_SESSION['Items'.$identifier]->CurrDecimalPlaces); $_SESSION['Items'.$identifier]->Quotation = $_POST['Quotation']; } else { $_SESSION['Items'.$identifier]->DeliverTo = $_POST['DeliverTo']; @@ -200,13 +200,13 @@ $_SESSION['Items'.$identifier]->ShipVia = $_POST['ShipVia']; $_SESSION['Items'.$identifier]->DeliverBlind = $_POST['DeliverBlind']; $_SESSION['Items'.$identifier]->SpecialInstructions = $_POST['SpecialInstructions']; - $_SESSION['Items'.$identifier]->DeliveryDays = filter_number_format$_POST['DeliveryDays']); + $_SESSION['Items'.$identifier]->DeliveryDays = filter_number_format($_POST['DeliveryDays']); $_SESSION['Items'.$identifier]->DeliveryDate = $_POST['DeliveryDate']; $_SESSION['Items'.$identifier]->QuoteDate = $_POST['QuoteDate']; $_SESSION['Items'.$identifier]->ConfirmedDate = $_POST['ConfirmedDate']; $_SESSION['Items'.$identifier]->CustRef = $_POST['CustRef']; $_SESSION['Items'.$identifier]->Comments = $_POST['Comments']; - $_SESSION['Items'.$identifier]->FreightCost = round(filter_number_format($_POST['FreightCost']),2); + $_SESSION['Items'.$identifier]->FreightCost = round(filter_number_format($_POST['FreightCost']),$_SESSION['Items'.$identifier]->CurrDecimalPlaces); $_SESSION['Items'.$identifier]->Quotation = $_POST['Quotation']; } /*$_SESSION['DoFreightCalc'] is a setting in the config.php file that the user can set to false to turn off freight calculations if necessary */ Modified: trunk/PrintCustTrans.php =================================================================== --- trunk/PrintCustTrans.php 2011-09-16 10:29:26 UTC (rev 4691) +++ trunk/PrintCustTrans.php 2011-09-16 23:15:08 UTC (rev 4692) @@ -231,10 +231,9 @@ stockmoves.narrative, stockmaster.units, stockmaster.decimalplaces - FROM stockmoves, - stockmaster - WHERE stockmoves.stockid = stockmaster.stockid - AND stockmoves.type=10 + FROM stockmoves INNER JOIN stockmaster + ON stockmoves.stockid = stockmaster.stockid + WHERE stockmoves.type=10 AND stockmoves.transno=" . $FromTransNo . " AND stockmoves.show_on_inv_crds=1"; } else { @@ -248,10 +247,9 @@ stockmoves.narrative, stockmaster.units, stockmaster.decimalplaces - FROM stockmoves, - stockmaster - WHERE stockmoves.stockid = stockmaster.stockid - AND stockmoves.type=11 + FROM stockmoves INNER JOIN stockmaster + ON stockmoves.stockid = stockmaster.stockid + WHERE stockmoves.type=11 AND stockmoves.transno=" . $FromTransNo . " AND stockmoves.show_on_inv_crds=1"; } // end else Modified: trunk/PrintCustTransPortrait.php =================================================================== --- trunk/PrintCustTransPortrait.php 2011-09-16 10:29:26 UTC (rev 4691) +++ trunk/PrintCustTransPortrait.php 2011-09-16 23:15:08 UTC (rev 4692) @@ -253,6 +253,7 @@ (stockmoves.price * " . $ExchRate . ") AS fxprice, stockmoves.narrative, stockmaster.controlled, + stockmaster.serialised, stockmaster.units, stockmoves.stkmoveno, stockmaster.decimalplaces @@ -271,6 +272,7 @@ (stockmoves.price * " . $ExchRate . ") AS fxprice, stockmoves.narrative, stockmaster.controlled, + stockmaster.serialised, stockmaster.units, stockmoves.stkmoveno, stockmaster.decimalplaces Modified: trunk/UserSettings.php =================================================================== --- trunk/UserSettings.php 2011-09-16 10:29:26 UTC (rev 4691) +++ trunk/UserSettings.php 2011-09-16 23:15:08 UTC (rev 4692) @@ -5,7 +5,6 @@ include('includes/session.inc'); $title = _('User Settings'); include('includes/header.inc'); -include('includes/LanguagesArray.php'); echo '<p class="page_title_text"><img src="'.$rootpath.'/css/'.$theme.'/images/user.png" title="' . _('User Settings') . '" alt="" />' . ' ' . _('User Settings') . '</p>'; @@ -134,11 +133,11 @@ foreach ($LanguagesArray as $LanguageEntry => $LanguageName){ if (isset($_POST['Language']) AND $_POST['Language'] == $LanguageEntry){ - echo '<option selected value="' . $LanguageEntry . '">' . $LanguageName .'</option>'; + echo '<option selected value="' . $LanguageEntry . '">' . $LanguageName['LanguageName'] .'</option>'; } elseif (!isset($_POST['Language']) AND $LanguageEntry == $DefaultLanguage) { - echo '<option selected value="' . $LanguageEntry . '">' . $LanguageName .'</option>'; + echo '<option selected value="' . $LanguageEntry . '">' . $LanguageName['LanguageName'] .'</option>'; } else { - echo '<option value="' . $LanguageEntry . '">' . $LanguageName .'</option>'; + echo '<option value="' . $LanguageEntry . '">' . $LanguageName['LanguageName'] .'</option>'; } } echo '</select></td></tr>'; Modified: trunk/WWW_Users.php =================================================================== --- trunk/WWW_Users.php 2011-09-16 10:29:26 UTC (rev 4691) +++ trunk/WWW_Users.php 2011-09-16 23:15:08 UTC (rev 4692) @@ -8,7 +8,6 @@ } } include('includes/session.inc'); -include ('includes/LanguagesArray.php'); $ModuleList = array(_('Orders'), _('Receivables'), @@ -84,7 +83,15 @@ $InputError = 1; } */ - + if (!isset($SelectedUser)){ + /* check to ensure the user id is not already entered */ + $result = DB_query("SELECT userid FROM www_users WHERE userid='" . $_POST['UserID'] . "'",$db); + if (DB_num_rows($result)==1){ + $InputError =1; + prnMsg(_('The user ID') . ' ' . $_POST['UserID'] . ' ' . _('already exists and cannot be used again'),'error'); + } + } + if ((mb_strlen($_POST['BranchCode'])>0) AND ($InputError !=1)) { // check that the entered branch is valid for the customer code $sql = "SELECT custbranch.debtorno @@ -113,7 +120,7 @@ $_POST['ModulesAllowed']= $ModulesAllowed; - if ($SelectedUser AND $InputError !=1) { + if (isset($SelectedUser) AND $InputError !=1) { /*SelectedUser could also exist if submit had not been clicked this code would not run in this case cos submit is false of course see the delete code below*/ @@ -388,7 +395,7 @@ } else { //end of if $SelectedUser only do the else when a new record is being entered - echo '<table class=selection> + echo '<table class="selection"> <tr> <td>' . _('User Login') . ':</td> <td><input type="text" name="UserID" size="22" maxlength="20"></td></tr>'; @@ -447,7 +454,7 @@ $result = DB_query($sql,$db); while ($myrow=DB_fetch_array($result)){ - if (isset($_POST['DefaultLocation']) and $myrow['loccode'] == $_POST['DefaultLocation']){ + if (isset($_POST['DefaultLocation']) AND $myrow['loccode'] == $_POST['DefaultLocation']){ echo '<option selected value="' . $myrow['loccode'] . '">' . $myrow['locationname'] .'</option>'; } else { echo '<option Value="' . $myrow['loccode'] . '">' . $myrow['locationname'] .'</option>'; @@ -478,14 +485,14 @@ $sql = "SELECT salesmancode, salesmanname FROM salesman WHERE current = 1"; $result = DB_query($sql,$db); -if ((isset($_POST['Salesman']) and $_POST['Salesman']=='') OR !isset($_POST['Salesman'])){ +if ((isset($_POST['Salesman']) AND $_POST['Salesman']=='') OR !isset($_POST['Salesman'])){ echo '<option selected value="">' . _('Not a salesperson only login') . '</option>'; } else { echo '<option value="">' . _('Not a salesperson only login') . '</option>'; } while ($myrow=DB_fetch_array($result)){ - if (isset($_POST['Salesman']) and $myrow['salesmancode'] == $_POST['Salesman']){ + if (isset($_POST['Salesman']) AND $myrow['salesmancode'] == $_POST['Salesman']){ echo '<option selected value="' . $myrow['salesmancode'] . '">' . $myrow['salesmanname'] . '</option>'; } else { echo '<option value="' . $myrow['salesmancode'] . '">' . $myrow['salesmanname'] . '</option>'; @@ -498,42 +505,42 @@ echo '<tr><td>' . _('Reports Page Size') .':</td> <td><select name="PageSize">'; -if(isset($_POST['PageSize']) and $_POST['PageSize']=='A4'){ +if(isset($_POST['PageSize']) AND $_POST['PageSize']=='A4'){ echo '<option selected value="A4">' . _('A4') .'</option>'; } else { echo '<option value="A4">' . _('A4') . '</option>'; } -if(isset($_POST['PageSize']) and $_POST['PageSize']=='A3'){ +if(isset($_POST['PageSize']) AND $_POST['PageSize']=='A3'){ echo '<option selected value="A3">' . _('A3') .'</option>'; } else { echo '<option value="A3">' . _('A3') .'</option>'; } -if(isset($_POST['PageSize']) and $_POST['PageSize']=='A3_landscape'){ +if(isset($_POST['PageSize']) AND $_POST['PageSize']=='A3_landscape'){ echo '<option selected value="A3_landscape">' . _('A3') . ' ' . _('landscape') .'</option>'; } else { echo '<option value="A3_landscape">' . _('A3') . ' ' . _('landscape') .'</option>'; } -if(isset($_POST['PageSize']) and $_POST['PageSize']=='letter'){ +if(isset($_POST['PageSize']) AND $_POST['PageSize']=='letter'){ echo '<option selected value="letter">' . _('Letter') .'</option>'; } else { echo '<option value="letter">' . _('Letter') .'</option>'; } -if(isset($_POST['PageSize']) and $_POST['PageSize']=='letter_landscape'){ +if(isset($_POST['PageSize']) AND $_POST['PageSize']=='letter_landscape'){ echo '<option selected value="letter_landscape">' . _('Letter') . ' ' . _('landscape') .'</option>'; } else { echo '<option value="letter_landscape">' . _('Letter') . ' ' . _('landscape') .'</option>'; } -if(isset($_POST['PageSize']) and $_POST['PageSize']=='legal'){ +if(isset($_POST['PageSize']) AND $_POST['PageSize']=='legal'){ echo '<option selected value="legal">' . _('Legal') .'</option>'; } else { echo '<option value="legal">' . _('Legal') .'</option>'; } -if(isset($_POST['PageSize']) and $_POST['PageSize']=='legal_landscape'){ +if(isset($_POST['PageSize']) AND $_POST['PageSize']=='legal_landscape'){ echo '<option selected value="legal_landscape">' . _('Legal') . ' ' . _('landscape') .'</option>'; } else { echo '<option value="legal_landscape">' . _('Legal') . ' ' . _('landscape') .'</option>'; @@ -552,9 +559,9 @@ if (is_dir('css/' . $ThemeName) AND $ThemeName != '.' AND $ThemeName != '..' AND $ThemeName != '.svn'){ - if (isset($_POST['Theme']) and $_POST['Theme'] == $ThemeName){ + if (isset($_POST['Theme']) AND $_POST['Theme'] == $ThemeName){ echo '<option selected value="' . $ThemeName . '">' . $ThemeName .'</option>'; - } else if (!isset($_POST['Theme']) and ($_SESSION['DefaultTheme']==$ThemeName)) { + } else if (!isset($_POST['Theme']) AND ($_SESSION['DefaultTheme']==$ThemeName)) { echo '<option selected value="' . $ThemeName . '">' . $ThemeName .'</option>'; } else { echo '<option value="' . $ThemeName . '">' . $ThemeName .'</option>'; @@ -570,12 +577,12 @@ <td><select name="UserLanguage">'; foreach ($LanguagesArray as $LanguageEntry => $LanguageName){ - if (isset($_POST['UserLanguage']) and $_POST['UserLanguage'] == $LanguageEntry){ - echo '<option selected value="' . $LanguageEntry . '">' . $LanguageName .'</option>'; - } elseif (!isset($_POST['UserLanguage']) and $LanguageEntry == $DefaultLanguage) { - echo '<option selected value="' . $LanguageEntry . '">' . $LanguageName .'</option>'; + if (isset($_POST['UserLanguage']) AND $_POST['UserLanguage'] == $LanguageEntry){ + echo '<option selected value="' . $LanguageEntry . '">' . $LanguageName['LanguageName'] .'</option>'; + } elseif (!isset($_POST['UserLanguage']) AND $LanguageEntry == $DefaultLanguage) { + echo '<option selected value="' . $LanguageEntry . '">' . $LanguageName['LanguageName'] .'</option>'; } else { - echo '<option value="' . $LanguageEntry . '">' . $LanguageName .'</option>'; + echo '<option value="' . $LanguageEntry . '">' . $LanguageName['LanguageName'] .'</option>'; } } echo '</select></td></tr>'; Modified: trunk/doc/Change.log =================================================================== --- trunk/doc/Change.log 2011-09-16 10:29:26 UTC (rev 4691) +++ trunk/doc/Change.log 2011-09-16 23:15:08 UTC (rev 4692) @@ -1,6 +1,6 @@ webERP Change Log - +17/9/11 Felix Lim: added serialised field into PrintCustTransPortrait.php to reinstate possiblity for printing serialised items on invoice - not possible in landscape version (PrintCustTrans.php) 12/9/11 Phil/Exson/Tom: Change all scripts to allow display and input of numbers in the format of the selected users locale 5/9/11 Phil: Fixed supplier payment exchange rate ... was being calculated incorrectly from functional exchange rate and the exchange rate between the currency of the bank account and currency of payment. 5/9/11 Phil: GLTransInquiry posted was not retrieved correctly - now fixed Modified: trunk/includes/LanguageSetup.php =================================================================== --- trunk/includes/LanguageSetup.php 2011-09-16 10:29:26 UTC (rev 4691) +++ trunk/includes/LanguageSetup.php 2011-09-16 23:15:08 UTC (rev 4692) @@ -4,7 +4,7 @@ /* Set internal character encoding to UTF-8 */ mb_internal_encoding('UTF-8'); - +include('includes/LanguagesArray.php'); /* This file is included in session.inc or PDFStarter.php or a report script that does not use PDFStarter.php to check for the existance of gettext function and setup the necessary enviroment to allow for automatic translation @@ -13,7 +13,7 @@ normally the lower case two character country code underscore uppercase 2 character country code does the trick except for en !!*/ -// Specify location of translation tables + If (isset($_POST['Language'])) { $_SESSION['Language'] = $_POST['Language']; $Language = $_POST['Language']; @@ -24,8 +24,14 @@ $Language = $_SESSION['Language']; } -$Locale = setlocale (LC_ALL, $_SESSION['Language']); -$Locale = setlocale (LC_NUMERIC, 'fr_FR.utf8'); +if (defined('LC_MESSAGES')){ //it's a unix/linux server + $Locale = setlocale (LC_MESSAGES, $_SESSION['Language']); + $Locale = setlocale (LC_NUMERIC, $_SESSION['Language']); +} else { // it's a windows server + $Locale = setlocale (LC_ALL, $LanguageArray[$_SESSION['Language']]['WindowsLocale']); +} +//$Locale = setlocale (LC_NUMERIC, 'fr_FR.utf8'); + $LocaleInfo = localeconv(); if ($LocaleInfo['mon_decimal_point']==''){ $LocaleInfo['mon_decimal_point']= $LocaleInfo['decimal_point']; @@ -33,11 +39,9 @@ if ($LocaleInfo['mon_thousands_sep']==''){ $LocaleInfo['mon_thousands_sep']= $LocaleInfo['thousands_sep']; } -if (defined('LC_MESSAGES')){ - $Locale = setlocale (LC_MESSAGES, $_SESSION['Language']); -} + //Turkish seems to be a special case if ($_SESSION['Language']=='tr_TR.utf8') { $Locale = setlocale(LC_CTYPE, 'C'); Modified: trunk/includes/LanguagesArray.php =================================================================== --- trunk/includes/LanguagesArray.php 2011-09-16 10:29:26 UTC (rev 4691) +++ trunk/includes/LanguagesArray.php 2011-09-16 23:15:08 UTC (rev 4692) @@ -1,32 +1,60 @@ <?php $LanguagesArray = array(); -$LanguagesArray['en_US.utf8'] = _('English US'); -$LanguagesArray['en_GB.utf8'] = _('English British'); -$LanguagesArray['cz_CZ.utf8'] = _('Czechoslovakian'); -$LanguagesArray['de_DE.utf8'] = _('German'); -$LanguagesArray['el_GR.utf8'] = _('Greek'); -$LanguagesArray['es_ES.utf8'] = _('Spanish'); -$LanguagesArray['et_EE.utf8'] = _('Estonian'); -$LanguagesArray['fa_IR.utf8'] = _('Arabic'); -$LanguagesArray['fr_FR.utf8'] = _('French'); -$LanguagesArray['hi_IN.utf8'] = _('Hindi'); -$LanguagesArray['hr_HR.utf8'] = _('Hungarian'); -$LanguagesArray['id_ID.utf8'] = _('Indonisian'); -$LanguagesArray['it_IT.utf8'] = _('Italian'); -$LanguagesArray['ja_JP.utf8'] = _('Japanese'); -$LanguagesArray['lv_LV.utf8'] = _('Latvian'); -$LanguagesArray['nl_NL.utf8'] = _('Dutch'); -$LanguagesArray['pl_PL.utf8'] = _('Polish'); -$LanguagesArray['pt_BR.utf8'] = _('Brazilian Portuguese'); -$LanguagesArray['pt_PT.utf8'] = _('Portuguese'); -$LanguagesArray['ro_RO.utf8'] = _('Roumanian'); -$LanguagesArray['ru_RU.utf8'] = _('Russian'); -$LanguagesArray['sq_AL.utf8'] = _('Albanian'); -$LanguagesArray['sv_SE.utf8'] = _('Sweedish'); -$LanguagesArray['sw_KE.utf8'] = _('Kiswahili'); -$LanguagesArray['tr_TR.utf8'] = _('Turkish'); -$LanguagesArray['vi_VN.utf8'] = _('Vietnamese'); -$LanguagesArray['zh_CN.utf8'] = _('Chinese - Simplified'); -$LanguagesArray['zh_HK.utf8'] = _('Chinese - Traditional'); +$LanguagesArray['en_US.utf8']['LanguageName'] = _('English US'); +$LanguagesArray['en_US.utf8']['WindowsLocale'] = 'english-us'; +$LanguagesArray['en_GB.utf8']['LanguageName'] = _('English British'); +$LanguagesArray['en_GB.utf8']['WindowsLocale'] = 'english-uk'; +$LanguagesArray['cz_CZ.utf8']['LanguageName'] = _('Czechoslovakian'); +$LanguagesArray['cz_CZ.utf8']['WindowsLocale'] = 'czech'; +$LanguagesArray['de_DE.utf8']['LanguageName'] = _('German'); +$LanguagesArray['de_DE.utf8']['WindowsLocale'] = 'german'; +$LanguagesArray['el_GR.utf8']['LanguageName'] = _('Greek'); +$LanguagesArray['el_GR.utf8']['WindowsLocale'] = 'greek'; +$LanguagesArray['es_ES.utf8']['LanguageName'] = _('Spanish'); +$LanguagesArray['es_ES.utf8']['WindowsLocale'] = 'spanish'; +$LanguagesArray['et_EE.utf8']['LanguageName'] = _('Estonian'); +$LanguagesArray['et_EE.utf8']['WindowsLocale'] = 'estonian'; +$LanguagesArray['fa_IR.utf8']['LanguageName'] = _('Arabic'); +$LanguagesArray['fa_IR.utf8']['WindowsLocale'] = 'arabic'; +$LanguagesArray['fr_FR.utf8']['LanguageName'] = _('French'); +$LanguagesArray['fr_FR.utf8']['WindowsLocale'] = 'french'; +$LanguagesArray['hi_IN.utf8']['LanguageName'] = _('Hindi'); +$LanguagesArray['hi_IN.utf8']['WindowsLocale'] = 'hindi'; +$LanguagesArray['hr_HR.utf8']['LanguageName'] = _('Hungarian'); +$LanguagesArray['hr_HR.utf8']['WindowsLocale'] = 'hungarian'; +$LanguagesArray['id_ID.utf8']['LanguageName'] = _('Indonisian'); +$LanguagesArray['id_ID.utf8']['WindowsLocale'] = 'indonesian'; +$LanguagesArray['it_IT.utf8']['LanguageName'] = _('Italian'); +$LanguagesArray['it_IT.utf8']['WindowsLocale'] = 'italian'; +$LanguagesArray['ja_JP.utf8']['LanguageName'] = _('Japanese'); +$LanguagesArray['ja_JP.utf8']['WindowsLocale'] = 'japanese'; +$LanguagesArray['lv_LV.utf8']['LanguageName'] = _('Latvian'); +$LanguagesArray['lv_LV.utf8']['WindowsLocale'] = 'latvian'; +$LanguagesArray['nl_NL.utf8']['LanguageName'] = _('Dutch'); +$LanguagesArray['nl_NL.utf8']['WindowsLocale'] = 'dutch'; +$LanguagesArray['pl_PL.utf8']['LanguageName'] = _('Polish'); +$LanguagesArray['pl_PL.utf8']['WindowsLocale'] = 'polish'; +$LanguagesArray['pt_BR.utf8']['LanguageName'] = _('Brazilian Portuguese'); +$LanguagesArray['pt_BR.utf8']['WindowsLocale'] = 'portuguese-brazil'; +$LanguagesArray['pt_PT.utf8']['LanguageName'] = _('Portuguese'); +$LanguagesArray['pt_PT.utf8']['WindowsLocale'] = 'portuguese'; +$LanguagesArray['ro_RO.utf8']['LanguageName'] = _('Romanian'); +$LanguagesArray['ro_RO.utf8']['WindowsLocale'] = 'romanian'; +$LanguagesArray['ru_RU.utf8']['LanguageName'] = _('Russian'); +$LanguagesArray['ru_RU.utf8']['WindowsLocale'] = 'russian'; +$LanguagesArray['sq_AL.utf8']['LanguageName'] = _('Albanian'); +$LanguagesArray['sq_AL.utf8']['WindowsLocale'] = 'english-us'; +$LanguagesArray['sv_SE.utf8']['LanguageName'] = _('Sweedish'); +$LanguagesArray['sv_SE.utf8']['WindowsLocale'] = 'swedish'; +$LanguagesArray['sw_KE.utf8']['LanguageName'] = _('Kiswahili'); +$LanguagesArray['sw_KE.utf8']['WindowsLocale'] = 'english-us'; +$LanguagesArray['tr_TR.utf8']['LanguageName'] = _('Turkish'); +$LanguagesArray['tr_TR.utf8']['WindowsLocale'] = 'turkish'; +$LanguagesArray['vi_VN.utf8']['LanguageName'] = _('Vietnamese'); +$LanguagesArray['vi_VN.utf8']['WindowsLocale'] = 'vietnamese'; +$LanguagesArray['zh_CN.utf8']['LanguageName'] = _('Chinese - Simplified'); +$LanguagesArray['zh_CN.utf8']['WindowsLocale'] = 'chinese-simplified'; +$LanguagesArray['zh_HK.utf8']['LanguageName'] = _('Chinese - Traditional'); +$LanguagesArray['zh_HK.utf8']['WindowsLocale'] = 'chinese-traditional'; asort($LanguagesArray); -?> +?> \ No newline at end of file This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <dai...@us...> - 2011-09-17 22:43:38
|
Revision: 4694 http://web-erp.svn.sourceforge.net/web-erp/?rev=4694&view=rev Author: daintree Date: 2011-09-17 22:43:30 +0000 (Sat, 17 Sep 2011) Log Message: ----------- number_formats Modified Paths: -------------- trunk/ConfirmDispatch_Invoice.php trunk/PrintCustTrans.php trunk/PrintCustTransPortrait.php trunk/SelectOrderItems.php trunk/StockAdjustments.php trunk/UpgradeDatabase.php trunk/WWW_Users.php trunk/doc/Change.log trunk/includes/Add_SerialItems.php trunk/includes/ConnectDB.inc trunk/includes/InputSerialItems.php trunk/includes/InputSerialItemsKeyed.php trunk/includes/LanguageSetup.php trunk/sql/mysql/upgrade4.05-4.06.sql Modified: trunk/ConfirmDispatch_Invoice.php =================================================================== --- trunk/ConfirmDispatch_Invoice.php 2011-09-17 07:49:08 UTC (rev 4693) +++ trunk/ConfirmDispatch_Invoice.php 2011-09-17 22:43:30 UTC (rev 4694) @@ -212,7 +212,7 @@ } foreach ($_SESSION['Items']->FreightTaxes as $FreightTaxLine) { if (isset($_POST['FreightTaxRate' . $FreightTaxLine->TaxCalculationOrder])){ - $_SESSION['Items']->FreightTaxes[$FreightTaxLine->TaxCalculationOrder]->TaxRate = filter_number_format($_POST['FreightTaxRate' . $FreightTaxLine->TaxCalculationOrder]/100); + $_SESSION['Items']->FreightTaxes[$FreightTaxLine->TaxCalculationOrder]->TaxRate = filter_number_format(filter_number_format($_POST['FreightTaxRate' . $FreightTaxLine->TaxCalculationOrder])/100); } } @@ -227,7 +227,7 @@ } foreach ($Itm->Taxes as $TaxLine) { if (isset($_POST[$Itm->LineNumber . $TaxLine->TaxCalculationOrder . '_TaxRate'])){ - $_SESSION['Items']->LineItems[$Itm->LineNumber]->Taxes[$TaxLine->TaxCalculationOrder]->TaxRate = filter_number_format($_POST[$Itm->LineNumber . $TaxLine->TaxCalculationOrder . '_TaxRate']/100); + $_SESSION['Items']->LineItems[$Itm->LineNumber]->Taxes[$TaxLine->TaxCalculationOrder]->TaxRate = filter_number_format(filter_number_format($_POST[$Itm->LineNumber . $TaxLine->TaxCalculationOrder . '_TaxRate'])/100); } } } //end foreach lineitem @@ -311,15 +311,15 @@ if ($LnItm->Controlled==1){ if (isset($_POST['ProcessInvoice'])) { - echo '<td class="number">' . $LnItm->QtyDispatched . '</td>'; + echo '<td class="number">' . locale_number_format($LnItm->QtyDispatched,$LnItm->DecimalPlaces) . '</td>'; } else { - echo '<td class="number"><input type=hidden name="' . $LnItm->LineNumber . '_QtyDispatched" value="' . $LnItm->QtyDispatched . '"><a href="' . $rootpath .'/ConfirmDispatchControlled_Invoice.php?LineNo='. $LnItm->LineNumber.'">' .$LnItm->QtyDispatched . '</a></td>'; + echo '<td class="number"><input type=hidden name="' . $LnItm->LineNumber . '_QtyDispatched" value="' . $LnItm->QtyDispatched . '"><a href="' . $rootpath .'/ConfirmDispatchControlled_Invoice.php?LineNo='. $LnItm->LineNumber.'">' .locale_number_format($LnItm->QtyDispatched,$LnItm->DecimalPlaces) . '</a></td>'; } } else { if (isset($_POST['ProcessInvoice'])) { - echo '<td class="number">' . $LnItm->QtyDispatched . '</td>'; + echo '<td class="number">' . locale_number_format($LnItm->QtyDispatched,$LnItm->DecimalPlaces) . '</td>'; } else { - echo '<td class="number"><input tabindex="'.$j.'" type="text" class="number" name="' . $LnItm->LineNumber . '_QtyDispatched" maxlength=12 size=12 value="' . $LnItm->QtyDispatched . '"></td>'; + echo '<td class="number"><input tabindex="'.$j.'" type="text" class="number" name="' . $LnItm->LineNumber . '_QtyDispatched" maxlength="12" size="12" value="' . locale_number_format($LnItm->QtyDispatched,$LnItm->DecimalPlaces) . '"></td>'; } } $DisplayDiscountPercent = locale_number_format($LnItm->DiscountPercent*100,2) . '%'; @@ -458,15 +458,15 @@ $_POST['ChargeFreightCost']=0; } if ($_SESSION['Items']->Any_Already_Delivered()==1 and (!isset($_SESSION['Items']->FreightCost) or $_POST['ChargeFreightCost']==0)) { - echo '<td colspan=2 class=number>'. _('Charge Freight Cost inc Tax').'</td> + echo '<td colspan="2" class="number">'. _('Charge Freight Cost inc Tax').'</td> <td><input tabindex='.$j.' type="text" class="number" size="10" maxlength="12" name="ChargeFreightCost" value="0"></td>'; $_SESSION['Items']->FreightCost=0; } else { - echo '<td colspan=2 class=number>'. _('Charge Freight Cost inc Tax').'</td>'; + echo '<td colspan="2" class="number">'. _('Charge Freight Cost inc Tax').'</td>'; if (isset($_POST['ProcessInvoice'])) { echo '<td class="number">' . $_SESSION['Items']->FreightCost . '</td>'; } else { - echo '<td class="number"><input tabindex='.$j.' type="text" class="number" size="10" maxlength="12" name="ChargeFreightCost" value="' . $_SESSION['Items']->FreightCost . '"></td>'; + echo '<td class="number"><input tabindex='.$j.' type="text" class="number" size="10" maxlength="12" name="ChargeFreightCost" value="' . $_SESSION['Items']->FreightCost . '" /></td>'; } $_POST['ChargeFreightCost'] = $_SESSION['Items']->FreightCost; } @@ -496,7 +496,7 @@ echo $FreightTaxLine->TaxRate * 100 ; } else { echo '<input type="text" class="number" name="FreightTaxRate' . $FreightTaxLine->TaxCalculationOrder . - '" maxlength="4" size="4" value="' . $FreightTaxLine->TaxRate * 100 . '">'; + '" maxlength="4" size="4" value="' . $FreightTaxLine->TaxRate * 100 . '" />'; } if ($FreightTaxLine->TaxOnTax ==1){ @@ -587,7 +587,7 @@ /*Now look for assembly components that would go negative */ $SQL = "SELECT bom.component, stockmaster.description, - locstock.quantity-(" . filter_number_format($OrderLine->QtyDispatched) . "*bom.quantity) AS qtyleft + locstock.quantity-(" . $OrderLine->QtyDispatched . "*bom.quantity) AS qtyleft FROM bom INNER JOIN locstock ON bom.component=locstock.stockid @@ -612,7 +612,7 @@ if ($NegativesFound){ echo '<div class="centre"> - <input type="submit" name="Update" value="' . _('Update'). '"></div>'; + <input type="submit" name="Update" value="' . _('Update'). '" /></div>'; include('includes/footer.inc'); exit; } @@ -679,7 +679,8 @@ while ($myrow = DB_fetch_array($Result)) { - if ($_SESSION['Items']->LineItems[$myrow['orderlineno']]->Quantity != $myrow['quantity'] OR $_SESSION['Items']->LineItems[$myrow['orderlineno']]->QtyInv != $myrow['qtyinvoiced']) { + if ($_SESSION['Items']->LineItems[$myrow['orderlineno']]->Quantity != $myrow['quantity'] + OR $_SESSION['Items']->LineItems[$myrow['orderlineno']]->QtyInv != $myrow['qtyinvoiced']) { echo '<br />'. _('Orig order for'). ' ' . $myrow['orderlineno'] . ' '. _('has a quantity of'). ' ' . $myrow['quantity'] . ' '. _('and an invoiced qty of'). ' ' . $myrow['qtyinvoiced'] . ' '. _('the session shows quantity of'). ' ' . $_SESSION['Items']->LineItems[$myrow['orderlineno']]->Quantity . ' ' . _('and quantity invoice of'). ' ' . $_SESSION['Items']->LineItems[$myrow['orderlineno']]->QtyInv; Modified: trunk/PrintCustTrans.php =================================================================== --- trunk/PrintCustTrans.php 2011-09-17 07:49:08 UTC (rev 4693) +++ trunk/PrintCustTrans.php 2011-09-17 22:43:30 UTC (rev 4694) @@ -281,8 +281,8 @@ $DisplayDiscount = locale_number_format($myrow2['discountpercent']*100,2) . '%'; $DiscountPrice=$myrow2['fxprice']*(1-$myrow2['discountpercent']); } - $DisplayNet=locale_number_format($myrow2['fxnet'],$myrow['decimalplaces']); - $DisplayPrice=locale_number_format($myrow2['fxprice'],$myrow['decimalplaces']); + $DisplayNet=locale_money_format($myrow2['fxnet'],$myrow['decimalplaces']); + $DisplayPrice=locale_money_format($myrow2['fxprice'],$myrow['decimalplaces']); $DisplayQty=locale_number_format($myrow2['quantity'],$myrow2['decimalplaces']); $LeftOvers = $pdf->addTextWrap($Left_Margin+3,$YPos,95,$FontSize,$myrow2['stockid']); @@ -355,17 +355,17 @@ if ($InvOrCredit=='Invoice') { - $DisplaySubTot = locale_number_format($myrow['ovamount'],$myrow['decimalplaces']); - $DisplayFreight = locale_number_format($myrow['ovfreight'],$myrow['decimalplaces']); - $DisplayTax = locale_number_format($myrow['ovgst'],$myrow['decimalplaces']); - $DisplayTotal = locale_number_format($myrow['ovfreight']+$myrow['ovgst']+$myrow['ovamount'],$myrow['decimalplaces']); + $DisplaySubTot = locale_money_format($myrow['ovamount'],$myrow['decimalplaces']); + $DisplayFreight = locale_money_format($myrow['ovfreight'],$myrow['decimalplaces']); + $DisplayTax = locale_money_format($myrow['ovgst'],$myrow['decimalplaces']); + $DisplayTotal = locale_money_format($myrow['ovfreight']+$myrow['ovgst']+$myrow['ovamount'],$myrow['decimalplaces']); } else { - $DisplaySubTot = locale_number_format(-$myrow['ovamount'],$myrow['decimalplaces']); - $DisplayFreight = locale_number_format(-$myrow['ovfreight'],$myrow['decimalplaces']); - $DisplayTax = locale_number_format(-$myrow['ovgst'],$myrow['decimalplaces']); - $DisplayTotal = locale_number_format(-$myrow['ovfreight']-$myrow['ovgst']-$myrow['ovamount'],$myrow['decimalplaces']); + $DisplaySubTot = locale_money_format(-$myrow['ovamount'],$myrow['decimalplaces']); + $DisplayFreight = locale_money_format(-$myrow['ovfreight'],$myrow['decimalplaces']); + $DisplayTax = locale_money_format(-$myrow['ovgst'],$myrow['decimalplaces']); + $DisplayTotal = locale_money_format(-$myrow['ovfreight']-$myrow['ovgst']-$myrow['ovamount'],$myrow['decimalplaces']); } /* Print out the invoice text entered */ $YPos = $Bottom_Margin+(3*$line_height); @@ -865,9 +865,9 @@ echo $RowStarter; - $DisplayPrice = locale_number_format($myrow2['fxprice'],$myrow['decimalplaces']); + $DisplayPrice = locale_money_format($myrow2['fxprice'],$myrow['decimalplaces']); $DisplayQty = locale_number_format($myrow2['quantity'],$myrow2['decimalplaces']); - $DisplayNet = locale_number_format($myrow2['fxnet'],$myrow['decimalplaces']); + $DisplayNet = locale_money_format($myrow2['fxnet'],$myrow['decimalplaces']); if ($myrow2['discountpercent']==0){ $DisplayDiscount =''; @@ -1005,15 +1005,15 @@ if ($InvOrCredit=='Invoice') { - $DisplaySubTot = locale_number_format($myrow['ovamount'],$myrow['decimalplaces']); - $DisplayFreight = locale_number_format($myrow['ovfreight'],$myrow['decimalplaces']); - $DisplayTax = locale_number_format($myrow['ovgst'],$myrow['decimalplaces']); - $DisplayTotal = locale_number_format($myrow['ovfreight']+$myrow['ovgst']+$myrow['ovamount'],$myrow['decimalplaces']); + $DisplaySubTot = locale_money_format($myrow['ovamount'],$myrow['decimalplaces']); + $DisplayFreight = locale_money_format($myrow['ovfreight'],$myrow['decimalplaces']); + $DisplayTax = locale_money_format($myrow['ovgst'],$myrow['decimalplaces']); + $DisplayTotal = locale_money_format($myrow['ovfreight']+$myrow['ovgst']+$myrow['ovamount'],$myrow['decimalplaces']); } else { - $DisplaySubTot = locale_number_format(-$myrow['ovamount'],$myrow['decimalplaces']); - $DisplayFreight = locale_number_format(-$myrow['ovfreight'],$myrow['decimalplaces']); - $DisplayTax = locale_number_format(-$myrow['ovgst'],$myrow['decimalplaces']); - $DisplayTotal = locale_number_format(-$myrow['ovfreight']-$myrow['ovgst']-$myrow['ovamount'],$myrow['decimalplaces']); + $DisplaySubTot = locale_money_format(-$myrow['ovamount'],$myrow['decimalplaces']); + $DisplayFreight = locale_money_format(-$myrow['ovfreight'],$myrow['decimalplaces']); + $DisplayTax = locale_money_format(-$myrow['ovgst'],$myrow['decimalplaces']); + $DisplayTotal = locale_money_format(-$myrow['ovfreight']-$myrow['ovgst']-$myrow['ovamount'],$myrow['decimalplaces']); } /*Print out the invoice text entered */ Modified: trunk/PrintCustTransPortrait.php =================================================================== --- trunk/PrintCustTransPortrait.php 2011-09-17 07:49:08 UTC (rev 4693) +++ trunk/PrintCustTransPortrait.php 2011-09-17 22:43:30 UTC (rev 4694) @@ -311,8 +311,8 @@ $DisplayDiscount = locale_number_format($myrow2['discountpercent'] * 100, 2) . '%'; $DiscountPrice = $myrow2['fxprice'] * (1 - $myrow2['discountpercent']); } - $DisplayNet = locale_number_format($myrow2['fxnet'],$myrow['decimalplaces']); - $DisplayPrice = locale_number_format($myrow2['fxprice'],$myrow['decimalplaces']); + $DisplayNet = locale_money_format($myrow2['fxnet'],$myrow['decimalplaces']); + $DisplayPrice = locale_money_format($myrow2['fxprice'],$myrow['decimalplaces']); $DisplayQty = locale_number_format($myrow2['quantity'],$myrow2['decimalplaces']); $LeftOvers = $pdf->addTextWrap($Left_Margin+5,$YPos,71,$FontSize,$myrow2['stockid']); @@ -424,15 +424,15 @@ if ($InvOrCredit=='Invoice') { - $DisplaySubTot = locale_number_format($myrow['ovamount'],$myrow['decimalplaces']); - $DisplayFreight = locale_number_format($myrow['ovfreight'],$myrow['decimalplaces']); - $DisplayTax = locale_number_format($myrow['ovgst'],$myrow['decimalplaces']); - $DisplayTotal = locale_number_format($myrow['ovfreight']+$myrow['ovgst']+$myrow['ovamount'],$myrow['decimalplaces']); + $DisplaySubTot = locale_money_format($myrow['ovamount'],$myrow['decimalplaces']); + $DisplayFreight = locale_money_format($myrow['ovfreight'],$myrow['decimalplaces']); + $DisplayTax = locale_money_format($myrow['ovgst'],$myrow['decimalplaces']); + $DisplayTotal = locale_money_format($myrow['ovfreight']+$myrow['ovgst']+$myrow['ovamount'],$myrow['decimalplaces']); } else { - $DisplaySubTot = locale_number_format(-$myrow['ovamount'],$myrow['decimalplaces']); - $DisplayFreight = locale_number_format(-$myrow['ovfreight'],$myrow['decimalplaces']); - $DisplayTax = locale_number_format(-$myrow['ovgst'],$myrow['decimalplaces']); - $DisplayTotal = locale_number_format(-$myrow['ovfreight']-$myrow['ovgst']-$myrow['ovamount'],$myrow['decimalplaces']); + $DisplaySubTot = locale_money_format(-$myrow['ovamount'],$myrow['decimalplaces']); + $DisplayFreight = locale_money_format(-$myrow['ovfreight'],$myrow['decimalplaces']); + $DisplayTax = locale_money_format(-$myrow['ovgst'],$myrow['decimalplaces']); + $DisplayTotal = locale_money_format(-$myrow['ovfreight']-$myrow['ovgst']-$myrow['ovamount'],$myrow['decimalplaces']); } /*Print out the invoice text entered */ $YPos = $Bottom_Margin+(3*$line_height); @@ -891,9 +891,9 @@ echo $RowStarter; - $DisplayPrice =locale_number_format($myrow2['fxprice'],$myrow['decimalplaces']); + $DisplayPrice =locale_money_format($myrow2['fxprice'],$myrow['decimalplaces']); $DisplayQty = locale_number_format($myrow2['quantity'],$myrow2['decimalplaces']); - $DisplayNet = locale_number_format($myrow2['fxnet'],$myrow['decimalplaces']); + $DisplayNet = locale_money_format($myrow2['fxnet'],$myrow['decimalplaces']); if ($myrow2['discountpercent']==0){ $DisplayDiscount =''; @@ -1029,15 +1029,15 @@ if ($InvOrCredit=='Invoice') { - $DisplaySubTot = locale_number_format($myrow['ovamount'],$myrow['decimalplaces']); - $DisplayFreight = locale_number_format($myrow['ovfreight'],$myrow['decimalplaces']); - $DisplayTax = locale_number_format($myrow['ovgst'],$myrow['decimalplaces']); - $DisplayTotal = locale_number_format($myrow['ovfreight']+$myrow['ovgst']+$myrow['ovamount'],$myrow['decimalplaces']); + $DisplaySubTot = locale_money_format($myrow['ovamount'],$myrow['decimalplaces']); + $DisplayFreight = locale_money_format($myrow['ovfreight'],$myrow['decimalplaces']); + $DisplayTax = locale_money_format($myrow['ovgst'],$myrow['decimalplaces']); + $DisplayTotal = locale_money_format($myrow['ovfreight']+$myrow['ovgst']+$myrow['ovamount'],$myrow['decimalplaces']); } else { - $DisplaySubTot = locale_number_format(-$myrow['ovamount'],$myrow['decimalplaces']); - $DisplayFreight = locale_number_format(-$myrow['ovfreight'],$myrow['decimalplaces']); - $DisplayTax = locale_number_format(-$myrow['ovgst'],2); - $DisplayTotal = locale_number_format(-$myrow['ovfreight']-$myrow['ovgst']-$myrow['ovamount'],$myrow['decimalplaces']); + $DisplaySubTot = locale_money_format(-$myrow['ovamount'],$myrow['decimalplaces']); + $DisplayFreight = locale_money_format(-$myrow['ovfreight'],$myrow['decimalplaces']); + $DisplayTax = locale_money_format(-$myrow['ovgst'],2); + $DisplayTotal = locale_money_format(-$myrow['ovfreight']-$myrow['ovgst']-$myrow['ovamount'],$myrow['decimalplaces']); } /*Print out the invoice text entered */ echo '<table class="table1"><tr> Modified: trunk/SelectOrderItems.php =================================================================== --- trunk/SelectOrderItems.php 2011-09-17 07:49:08 UTC (rev 4693) +++ trunk/SelectOrderItems.php 2011-09-17 22:43:30 UTC (rev 4694) @@ -730,10 +730,9 @@ $SQL = "SELECT stockmaster.stockid, stockmaster.description, stockmaster.units - FROM stockmaster, - stockcategory - WHERE stockmaster.categoryid=stockcategory.categoryid - AND (stockcategory.stocktype='F' OR stockcategory.stocktype='D') + FROM stockmaster INNER JOIN stockcategory + ON stockmaster.categoryid=stockcategory.categoryid + WHERE (stockcategory.stocktype='F' OR stockcategory.stocktype='D') AND stockmaster.mbflag <>'G' AND stockmaster.description " . LIKE . " '" . $SearchString . "' AND stockmaster.discontinued=0 @@ -742,9 +741,9 @@ $SQL = "SELECT stockmaster.stockid, stockmaster.description, stockmaster.units - FROM stockmaster, stockcategory - WHERE stockmaster.categoryid=stockcategory.categoryid - AND (stockcategory.stocktype='F' OR stockcategory.stocktype='D') + FROM stockmaster INNER JOIN stockcategory + ON stockmaster.categoryid=stockcategory.categoryid + WHERE (stockcategory.stocktype='F' OR stockcategory.stocktype='D') AND stockmaster.mbflag <>'G' AND stockmaster.discontinued=0 AND stockmaster.description " . LIKE . " '" . $SearchString . "' @@ -761,9 +760,9 @@ $SQL = "SELECT stockmaster.stockid, stockmaster.description, stockmaster.units - FROM stockmaster, stockcategory - WHERE stockmaster.categoryid=stockcategory.categoryid - AND (stockcategory.stocktype='F' OR stockcategory.stocktype='D') + FROM stockmaster INNER JOIN stockcategory + ON stockmaster.categoryid=stockcategory.categoryid + WHERE (stockcategory.stocktype='F' OR stockcategory.stocktype='D') AND stockmaster.stockid " . LIKE . " '" . $SearchString . "' AND stockmaster.mbflag <>'G' AND stockmaster.discontinued=0 @@ -772,9 +771,9 @@ $SQL = "SELECT stockmaster.stockid, stockmaster.description, stockmaster.units - FROM stockmaster, stockcategory - WHERE stockmaster.categoryid=stockcategory.categoryid - AND (stockcategory.stocktype='F' OR stockcategory.stocktype='D') + FROM stockmaster INNER JOIN stockcategory + ON stockmaster.categoryid=stockcategory.categoryid + WHERE (stockcategory.stocktype='F' OR stockcategory.stocktype='D') AND stockmaster.stockid " . LIKE . " '" . $SearchString . "' AND stockmaster.mbflag <>'G' AND stockmaster.discontinued=0 @@ -787,9 +786,9 @@ $SQL = "SELECT stockmaster.stockid, stockmaster.description, stockmaster.units - FROM stockmaster, stockcategory - WHERE stockmaster.categoryid=stockcategory.categoryid - AND (stockcategory.stocktype='F' OR stockcategory.stocktype='D') + FROM stockmaster INNER JOIN stockcategory + ON stockmaster.categoryid=stockcategory.categoryid + WHERE (stockcategory.stocktype='F' OR stockcategory.stocktype='D') AND stockmaster.mbflag <>'G' AND stockmaster.discontinued=0 ORDER BY stockmaster.stockid"; @@ -797,9 +796,9 @@ $SQL = "SELECT stockmaster.stockid, stockmaster.description, stockmaster.units - FROM stockmaster, stockcategory - WHERE stockmaster.categoryid=stockcategory.categoryid - AND (stockcategory.stocktype='F' OR stockcategory.stocktype='D') + FROM stockmaster INNER JOIN stockcategory + ON stockmaster.categoryid=stockcategory.categoryid + WHERE (stockcategory.stocktype='F' OR stockcategory.stocktype='D') AND stockmaster.mbflag <>'G' AND stockmaster.discontinued=0 AND stockmaster.categoryid='" . $_POST['StockCat'] . "' @@ -816,7 +815,7 @@ if (!isset($Offset) or $Offset<0) { $Offset=0; } - $SQL = $SQL . " LIMIT " . $_SESSION['DefaultDisplayRecordsMax'] . " OFFSET " . strval(filter_number_format($_SESSION['DefaultDisplayRecordsMax']*$Offset)); + $SQL = $SQL . " LIMIT " . $_SESSION['DefaultDisplayRecordsMax'] . " OFFSET " . strval($_SESSION['DefaultDisplayRecordsMax']*$Offset); $ErrMsg = _('There is a problem selecting the part records to display because'); $DbgMsg = _('The SQL used to get the part selection was'); @@ -1056,7 +1055,7 @@ if (isset($_POST['Quantity_' . $OrderLine->LineNumber])){ - $Quantity = filter_number_format($_POST['Quantity_' . $OrderLine->LineNumber]); + $Quantity = round(filter_number_format($_POST['Quantity_' . $OrderLine->LineNumber]),$OrderLine->DecimalPlaces); if (ABS($OrderLine->Price - filter_number_format($_POST['Price_' . $OrderLine->LineNumber]))>0.01){ $Price = filter_number_format($_POST['Price_' . $OrderLine->LineNumber]); @@ -1164,7 +1163,7 @@ foreach ($_SESSION['Items'.$identifier]->LineItems as $OrderLine_2) { if ($OrderLine_2->DiscCat==$OrderLine->DiscCat){ $_SESSION['Items'.$identifier]->LineItems[$OrderLine_2->LineNumber]->DiscountPercent = $DiscountMatrixRate; - $_SESSION['Items'.$identifier]->LineItems[$OrderLine_2->LineNumber]->GPPercent = (($_SESSION['Items'.$identifier]->LineItems[$OrderLine_2->LineNumber]->Price*(1-$DiscountMatrixRate)) - $_SESSION['Items'.$identifier]->LineItems[$OrderLine_2->LineNumber]->StandardCost*$ExRate)/($_SESSION['Items'.$identifier]->LineItems[$OrderLine_2->LineNumber]->Price *(1-$DiscountMatrixRate)/100); + $_SESSION['Items'.$identifier]->LineItems[$OrderLine_2->LineNumber]->GPPercent = filter_number_format((($_SESSION['Items'.$identifier]->LineItems[$OrderLine_2->LineNumber]->Price*(1-$DiscountMatrixRate)) - $_SESSION['Items'.$identifier]->LineItems[$OrderLine_2->LineNumber]->StandardCost*$ExRate)/($_SESSION['Items'.$identifier]->LineItems[$OrderLine_2->LineNumber]->Price *(1-$DiscountMatrixRate)/100)); } } } @@ -1292,7 +1291,7 @@ FROM discountmatrix WHERE salestype='" . $_SESSION['Items'.$identifier]->DefaultSalesType . "' AND discountcategory ='" . $OrderLine->DiscCat . "' - AND quantitybreak <= '" . $QuantityOfDiscCat . "'",$db); + AND quantitybreak <= '" . filter_number_format($QuantityOfDiscCat) . "'",$db); $myrow = DB_fetch_row($result); if ($myrow[0] == NULL){ $DiscountMatrixRate = 0; @@ -1365,22 +1364,22 @@ echo '<td><a target="_blank" href="' . $rootpath . '/StockStatus.php?identifier='.$identifier . '&StockID=' . $OrderLine->StockID . '&DebtorNo=' . $_SESSION['Items'.$identifier]->DebtorNo . '">' . $OrderLine->StockID . '</a></td> <td>' . $OrderLine->ItemDescription . '</td>'; - echo '<td><input class="number" tabindex=2 type=tect name="Quantity_' . $OrderLine->LineNumber . '" size=6 maxlength=6 value=' . $OrderLine->Quantity . '>'; + echo '<td><input class="number" tabindex=2 type=tect name="Quantity_' . $OrderLine->LineNumber . '" size=6 maxlength=6 value=' . locale_number_format($OrderLine->Quantity,$OrderLine->DecimalPlaces) . '>'; if ($QtyRemain != $QtyOrdered){ - echo '<br />'.$OrderLine->QtyInv.' of '.$OrderLine->Quantity.' invoiced'; + echo '<br />'.locale_number_format($OrderLine->QtyInv,$OrderLine->DecimalPlaces) .' of '.locale_number_format($OrderLine->Quantity,$OrderLine->DecimalPlaces).' invoiced'; } echo '</td> - <td class="number">' . $OrderLine->QOHatLoc . '</td> + <td class="number">' . locale_number_format($OrderLine->QOHatLoc,$OrderLine->DecimalPlaces) . '</td> <td>' . $OrderLine->Units . '</td>'; if (in_array(2,$_SESSION['AllowedPageSecurityTokens'])){ /*OK to display with discount if it is an internal user with appropriate permissions */ - echo '<td><input class="number" type="text" name="Price_' . $OrderLine->LineNumber . '" size=16 maxlength=16 value=' . $OrderLine->Price . '></td> - <td><input class="number" type="text" name="Discount_' . $OrderLine->LineNumber . '" size=5 maxlength=4 value=' . ($OrderLine->DiscountPercent * 100) . '></td> - <td><input class="number" type="text" name="GPPercent_' . $OrderLine->LineNumber . '" size=3 maxlength=40 value=' . $OrderLine->GPPercent . '></td>'; + echo '<td><input class="number" type="text" name="Price_' . $OrderLine->LineNumber . '" size=16 maxlength=16 value=' . locale_money_format($OrderLine->Price,$_SESSION['Items'.$identifier]->CurrDecimalPlaces) . '></td> + <td><input class="number" type="text" name="Discount_' . $OrderLine->LineNumber . '" size=5 maxlength=4 value=' . locale_number_format(($OrderLine->DiscountPercent * 100),2) . '></td> + <td><input class="number" type="text" name="GPPercent_' . $OrderLine->LineNumber . '" size=3 maxlength=40 value=' . locale_number_format($OrderLine->GPPercent,2) . '></td>'; } else { - echo '<td class=number>' . $OrderLine->Price . '</td><td></td>'; - echo '<input type=hidden name="Price_' . $OrderLine->LineNumber . '" value=' . $OrderLine->Price . '>'; + echo '<td class=number>' . locale_money_format($OrderLine->Price,$_SESSION['Items'.$identifier]->CurrDecimalPlaces) . '</td><td></td>'; + echo '<input type=hidden name="Price_' . $OrderLine->LineNumber . '" value=' . locale_money_format($OrderLine->Price,$_SESSION['Items'.$identifier]->CurrDecimalPlaces) . '>'; } if ($_SESSION['Items'.$identifier]->Some_Already_Delivered($OrderLine->LineNumber)){ $RemTxt = _('Clear Remaining'); Modified: trunk/StockAdjustments.php =================================================================== --- trunk/StockAdjustments.php 2011-09-17 07:49:08 UTC (rev 4693) +++ trunk/StockAdjustments.php 2011-09-17 22:43:30 UTC (rev 4694) @@ -36,12 +36,12 @@ $_SESSION['Adjustment']->Serialised = $myrow['serialised']; $_SESSION['Adjustment']->DecimalPlaces = $myrow['decimalplaces']; $_SESSION['Adjustment']->SerialItems = array(); - if (!isset($_SESSION['Adjustment']->Quantity)or !is_numeric($_SESSION['Adjustment']->Quantity)){ + if (!isset($_SESSION['Adjustment']->Quantity) OR !is_numeric($_SESSION['Adjustment']->Quantity)){ $_SESSION['Adjustment']->Quantity=0; } $NewAdjustment = true; } elseif (isset($_POST['StockID'])){ - if(isset($_POST['StockID']) and $_POST['StockID'] != $_SESSION['Adjustment']->StockID){ + if(isset($_POST['StockID']) AND $_POST['StockID'] != $_SESSION['Adjustment']->StockID){ $NewAdjustment = true; $_SESSION['Adjustment']->StockID = trim(mb_strtoupper($_POST['StockID'])); $StockID = trim(mb_strtoupper($_POST['StockID'])); @@ -49,10 +49,10 @@ $_SESSION['Adjustment']->tag = $_POST['tag']; $_SESSION['Adjustment']->Narrative = $_POST['Narrative']; $_SESSION['Adjustment']->StockLocation = $_POST['StockLocation']; - if ($_POST['Quantity']=='' or !is_numeric($_POST['Quantity'])){ + if ($_POST['Quantity']=='' or !is_numeric(filter_number_format($_POST['Quantity']))){ $_POST['Quantity']=0; } - $_SESSION['Adjustment']->Quantity = $_POST['Quantity']; + $_SESSION['Adjustment']->Quantity = filter_number_format($_POST['Quantity']); } echo '<p class="page_title_text"><img src="'.$rootpath.'/css/'.$theme.'/images/supplier.png" title="' . @@ -94,7 +94,7 @@ exit; } -if (isset($_POST['EnterAdjustment']) && $_POST['EnterAdjustment']!= ''){ +if (isset($_POST['EnterAdjustment']) AND $_POST['EnterAdjustment']!= ''){ $InputError = false; /*Start by hoping for the best */ $result = DB_query("SELECT * FROM stockmaster WHERE stockid='" . $_SESSION['Adjustment']->StockID . "'",$db); @@ -149,7 +149,7 @@ $QtyOnHandPrior = 0; } - $SQL = "INSERT INTO stockmoves ( stockid, + $SQL = "INSERT INTO stockmoves (stockid, type, transno, loccode, @@ -175,7 +175,6 @@ $DbgMsg = _('The following SQL to insert the stock movement record was used'); $Result = DB_query($SQL, $db, $ErrMsg, $DbgMsg, true); - /*Get the ID of the StockMove... */ $StkMoveNo = DB_Last_Insert_ID($db,'stockmoves','stkmoveno'); @@ -188,11 +187,10 @@ /*First need to check if the serial items already exists or not */ $SQL = "SELECT COUNT(*) - FROM stockserialitems - WHERE - stockid='" . $_SESSION['Adjustment']->StockID . "' - AND loccode='" . $_SESSION['Adjustment']->StockLocation . "' - AND serialno='" . $Item->BundleRef . "'"; + FROM stockserialitems + WHERE stockid='" . $_SESSION['Adjustment']->StockID . "' + AND loccode='" . $_SESSION['Adjustment']->StockLocation . "' + AND serialno='" . $Item->BundleRef . "'"; $ErrMsg = _('Unable to determine if the serial item exists'); $Result = DB_query($SQL,$db,$ErrMsg); $SerialItemExistsRow = DB_fetch_row($Result); @@ -200,10 +198,9 @@ if ($SerialItemExistsRow[0]==1){ $SQL = "UPDATE stockserialitems SET quantity= quantity + " . $Item->BundleQty . " - WHERE - stockid='" . $_SESSION['Adjustment']->StockID . "' - AND loccode='" . $_SESSION['Adjustment']->StockLocation . "' - AND serialno='" . $Item->BundleRef . "'"; + WHERE stockid='" . $_SESSION['Adjustment']->StockID . "' + AND loccode='" . $_SESSION['Adjustment']->StockLocation . "' + AND serialno='" . $Item->BundleRef . "'"; $ErrMsg = _('CRITICAL ERROR') . '! ' . _('NOT... [truncated message content] |
From: <dai...@us...> - 2011-09-17 22:43:38
|
Revision: 4694 http://web-erp.svn.sourceforge.net/web-erp/?rev=4694&view=rev Author: daintree Date: 2011-09-17 22:43:30 +0000 (Sat, 17 Sep 2011) Log Message: ----------- number_formats Modified Paths: -------------- trunk/ConfirmDispatch_Invoice.php trunk/PrintCustTrans.php trunk/PrintCustTransPortrait.php trunk/SelectOrderItems.php trunk/StockAdjustments.php trunk/UpgradeDatabase.php trunk/WWW_Users.php trunk/doc/Change.log trunk/includes/Add_SerialItems.php trunk/includes/ConnectDB.inc trunk/includes/InputSerialItems.php trunk/includes/InputSerialItemsKeyed.php trunk/includes/LanguageSetup.php trunk/sql/mysql/upgrade4.05-4.06.sql Modified: trunk/ConfirmDispatch_Invoice.php =================================================================== --- trunk/ConfirmDispatch_Invoice.php 2011-09-17 07:49:08 UTC (rev 4693) +++ trunk/ConfirmDispatch_Invoice.php 2011-09-17 22:43:30 UTC (rev 4694) @@ -212,7 +212,7 @@ } foreach ($_SESSION['Items']->FreightTaxes as $FreightTaxLine) { if (isset($_POST['FreightTaxRate' . $FreightTaxLine->TaxCalculationOrder])){ - $_SESSION['Items']->FreightTaxes[$FreightTaxLine->TaxCalculationOrder]->TaxRate = filter_number_format($_POST['FreightTaxRate' . $FreightTaxLine->TaxCalculationOrder]/100); + $_SESSION['Items']->FreightTaxes[$FreightTaxLine->TaxCalculationOrder]->TaxRate = filter_number_format(filter_number_format($_POST['FreightTaxRate' . $FreightTaxLine->TaxCalculationOrder])/100); } } @@ -227,7 +227,7 @@ } foreach ($Itm->Taxes as $TaxLine) { if (isset($_POST[$Itm->LineNumber . $TaxLine->TaxCalculationOrder . '_TaxRate'])){ - $_SESSION['Items']->LineItems[$Itm->LineNumber]->Taxes[$TaxLine->TaxCalculationOrder]->TaxRate = filter_number_format($_POST[$Itm->LineNumber . $TaxLine->TaxCalculationOrder . '_TaxRate']/100); + $_SESSION['Items']->LineItems[$Itm->LineNumber]->Taxes[$TaxLine->TaxCalculationOrder]->TaxRate = filter_number_format(filter_number_format($_POST[$Itm->LineNumber . $TaxLine->TaxCalculationOrder . '_TaxRate'])/100); } } } //end foreach lineitem @@ -311,15 +311,15 @@ if ($LnItm->Controlled==1){ if (isset($_POST['ProcessInvoice'])) { - echo '<td class="number">' . $LnItm->QtyDispatched . '</td>'; + echo '<td class="number">' . locale_number_format($LnItm->QtyDispatched,$LnItm->DecimalPlaces) . '</td>'; } else { - echo '<td class="number"><input type=hidden name="' . $LnItm->LineNumber . '_QtyDispatched" value="' . $LnItm->QtyDispatched . '"><a href="' . $rootpath .'/ConfirmDispatchControlled_Invoice.php?LineNo='. $LnItm->LineNumber.'">' .$LnItm->QtyDispatched . '</a></td>'; + echo '<td class="number"><input type=hidden name="' . $LnItm->LineNumber . '_QtyDispatched" value="' . $LnItm->QtyDispatched . '"><a href="' . $rootpath .'/ConfirmDispatchControlled_Invoice.php?LineNo='. $LnItm->LineNumber.'">' .locale_number_format($LnItm->QtyDispatched,$LnItm->DecimalPlaces) . '</a></td>'; } } else { if (isset($_POST['ProcessInvoice'])) { - echo '<td class="number">' . $LnItm->QtyDispatched . '</td>'; + echo '<td class="number">' . locale_number_format($LnItm->QtyDispatched,$LnItm->DecimalPlaces) . '</td>'; } else { - echo '<td class="number"><input tabindex="'.$j.'" type="text" class="number" name="' . $LnItm->LineNumber . '_QtyDispatched" maxlength=12 size=12 value="' . $LnItm->QtyDispatched . '"></td>'; + echo '<td class="number"><input tabindex="'.$j.'" type="text" class="number" name="' . $LnItm->LineNumber . '_QtyDispatched" maxlength="12" size="12" value="' . locale_number_format($LnItm->QtyDispatched,$LnItm->DecimalPlaces) . '"></td>'; } } $DisplayDiscountPercent = locale_number_format($LnItm->DiscountPercent*100,2) . '%'; @@ -458,15 +458,15 @@ $_POST['ChargeFreightCost']=0; } if ($_SESSION['Items']->Any_Already_Delivered()==1 and (!isset($_SESSION['Items']->FreightCost) or $_POST['ChargeFreightCost']==0)) { - echo '<td colspan=2 class=number>'. _('Charge Freight Cost inc Tax').'</td> + echo '<td colspan="2" class="number">'. _('Charge Freight Cost inc Tax').'</td> <td><input tabindex='.$j.' type="text" class="number" size="10" maxlength="12" name="ChargeFreightCost" value="0"></td>'; $_SESSION['Items']->FreightCost=0; } else { - echo '<td colspan=2 class=number>'. _('Charge Freight Cost inc Tax').'</td>'; + echo '<td colspan="2" class="number">'. _('Charge Freight Cost inc Tax').'</td>'; if (isset($_POST['ProcessInvoice'])) { echo '<td class="number">' . $_SESSION['Items']->FreightCost . '</td>'; } else { - echo '<td class="number"><input tabindex='.$j.' type="text" class="number" size="10" maxlength="12" name="ChargeFreightCost" value="' . $_SESSION['Items']->FreightCost . '"></td>'; + echo '<td class="number"><input tabindex='.$j.' type="text" class="number" size="10" maxlength="12" name="ChargeFreightCost" value="' . $_SESSION['Items']->FreightCost . '" /></td>'; } $_POST['ChargeFreightCost'] = $_SESSION['Items']->FreightCost; } @@ -496,7 +496,7 @@ echo $FreightTaxLine->TaxRate * 100 ; } else { echo '<input type="text" class="number" name="FreightTaxRate' . $FreightTaxLine->TaxCalculationOrder . - '" maxlength="4" size="4" value="' . $FreightTaxLine->TaxRate * 100 . '">'; + '" maxlength="4" size="4" value="' . $FreightTaxLine->TaxRate * 100 . '" />'; } if ($FreightTaxLine->TaxOnTax ==1){ @@ -587,7 +587,7 @@ /*Now look for assembly components that would go negative */ $SQL = "SELECT bom.component, stockmaster.description, - locstock.quantity-(" . filter_number_format($OrderLine->QtyDispatched) . "*bom.quantity) AS qtyleft + locstock.quantity-(" . $OrderLine->QtyDispatched . "*bom.quantity) AS qtyleft FROM bom INNER JOIN locstock ON bom.component=locstock.stockid @@ -612,7 +612,7 @@ if ($NegativesFound){ echo '<div class="centre"> - <input type="submit" name="Update" value="' . _('Update'). '"></div>'; + <input type="submit" name="Update" value="' . _('Update'). '" /></div>'; include('includes/footer.inc'); exit; } @@ -679,7 +679,8 @@ while ($myrow = DB_fetch_array($Result)) { - if ($_SESSION['Items']->LineItems[$myrow['orderlineno']]->Quantity != $myrow['quantity'] OR $_SESSION['Items']->LineItems[$myrow['orderlineno']]->QtyInv != $myrow['qtyinvoiced']) { + if ($_SESSION['Items']->LineItems[$myrow['orderlineno']]->Quantity != $myrow['quantity'] + OR $_SESSION['Items']->LineItems[$myrow['orderlineno']]->QtyInv != $myrow['qtyinvoiced']) { echo '<br />'. _('Orig order for'). ' ' . $myrow['orderlineno'] . ' '. _('has a quantity of'). ' ' . $myrow['quantity'] . ' '. _('and an invoiced qty of'). ' ' . $myrow['qtyinvoiced'] . ' '. _('the session shows quantity of'). ' ' . $_SESSION['Items']->LineItems[$myrow['orderlineno']]->Quantity . ' ' . _('and quantity invoice of'). ' ' . $_SESSION['Items']->LineItems[$myrow['orderlineno']]->QtyInv; Modified: trunk/PrintCustTrans.php =================================================================== --- trunk/PrintCustTrans.php 2011-09-17 07:49:08 UTC (rev 4693) +++ trunk/PrintCustTrans.php 2011-09-17 22:43:30 UTC (rev 4694) @@ -281,8 +281,8 @@ $DisplayDiscount = locale_number_format($myrow2['discountpercent']*100,2) . '%'; $DiscountPrice=$myrow2['fxprice']*(1-$myrow2['discountpercent']); } - $DisplayNet=locale_number_format($myrow2['fxnet'],$myrow['decimalplaces']); - $DisplayPrice=locale_number_format($myrow2['fxprice'],$myrow['decimalplaces']); + $DisplayNet=locale_money_format($myrow2['fxnet'],$myrow['decimalplaces']); + $DisplayPrice=locale_money_format($myrow2['fxprice'],$myrow['decimalplaces']); $DisplayQty=locale_number_format($myrow2['quantity'],$myrow2['decimalplaces']); $LeftOvers = $pdf->addTextWrap($Left_Margin+3,$YPos,95,$FontSize,$myrow2['stockid']); @@ -355,17 +355,17 @@ if ($InvOrCredit=='Invoice') { - $DisplaySubTot = locale_number_format($myrow['ovamount'],$myrow['decimalplaces']); - $DisplayFreight = locale_number_format($myrow['ovfreight'],$myrow['decimalplaces']); - $DisplayTax = locale_number_format($myrow['ovgst'],$myrow['decimalplaces']); - $DisplayTotal = locale_number_format($myrow['ovfreight']+$myrow['ovgst']+$myrow['ovamount'],$myrow['decimalplaces']); + $DisplaySubTot = locale_money_format($myrow['ovamount'],$myrow['decimalplaces']); + $DisplayFreight = locale_money_format($myrow['ovfreight'],$myrow['decimalplaces']); + $DisplayTax = locale_money_format($myrow['ovgst'],$myrow['decimalplaces']); + $DisplayTotal = locale_money_format($myrow['ovfreight']+$myrow['ovgst']+$myrow['ovamount'],$myrow['decimalplaces']); } else { - $DisplaySubTot = locale_number_format(-$myrow['ovamount'],$myrow['decimalplaces']); - $DisplayFreight = locale_number_format(-$myrow['ovfreight'],$myrow['decimalplaces']); - $DisplayTax = locale_number_format(-$myrow['ovgst'],$myrow['decimalplaces']); - $DisplayTotal = locale_number_format(-$myrow['ovfreight']-$myrow['ovgst']-$myrow['ovamount'],$myrow['decimalplaces']); + $DisplaySubTot = locale_money_format(-$myrow['ovamount'],$myrow['decimalplaces']); + $DisplayFreight = locale_money_format(-$myrow['ovfreight'],$myrow['decimalplaces']); + $DisplayTax = locale_money_format(-$myrow['ovgst'],$myrow['decimalplaces']); + $DisplayTotal = locale_money_format(-$myrow['ovfreight']-$myrow['ovgst']-$myrow['ovamount'],$myrow['decimalplaces']); } /* Print out the invoice text entered */ $YPos = $Bottom_Margin+(3*$line_height); @@ -865,9 +865,9 @@ echo $RowStarter; - $DisplayPrice = locale_number_format($myrow2['fxprice'],$myrow['decimalplaces']); + $DisplayPrice = locale_money_format($myrow2['fxprice'],$myrow['decimalplaces']); $DisplayQty = locale_number_format($myrow2['quantity'],$myrow2['decimalplaces']); - $DisplayNet = locale_number_format($myrow2['fxnet'],$myrow['decimalplaces']); + $DisplayNet = locale_money_format($myrow2['fxnet'],$myrow['decimalplaces']); if ($myrow2['discountpercent']==0){ $DisplayDiscount =''; @@ -1005,15 +1005,15 @@ if ($InvOrCredit=='Invoice') { - $DisplaySubTot = locale_number_format($myrow['ovamount'],$myrow['decimalplaces']); - $DisplayFreight = locale_number_format($myrow['ovfreight'],$myrow['decimalplaces']); - $DisplayTax = locale_number_format($myrow['ovgst'],$myrow['decimalplaces']); - $DisplayTotal = locale_number_format($myrow['ovfreight']+$myrow['ovgst']+$myrow['ovamount'],$myrow['decimalplaces']); + $DisplaySubTot = locale_money_format($myrow['ovamount'],$myrow['decimalplaces']); + $DisplayFreight = locale_money_format($myrow['ovfreight'],$myrow['decimalplaces']); + $DisplayTax = locale_money_format($myrow['ovgst'],$myrow['decimalplaces']); + $DisplayTotal = locale_money_format($myrow['ovfreight']+$myrow['ovgst']+$myrow['ovamount'],$myrow['decimalplaces']); } else { - $DisplaySubTot = locale_number_format(-$myrow['ovamount'],$myrow['decimalplaces']); - $DisplayFreight = locale_number_format(-$myrow['ovfreight'],$myrow['decimalplaces']); - $DisplayTax = locale_number_format(-$myrow['ovgst'],$myrow['decimalplaces']); - $DisplayTotal = locale_number_format(-$myrow['ovfreight']-$myrow['ovgst']-$myrow['ovamount'],$myrow['decimalplaces']); + $DisplaySubTot = locale_money_format(-$myrow['ovamount'],$myrow['decimalplaces']); + $DisplayFreight = locale_money_format(-$myrow['ovfreight'],$myrow['decimalplaces']); + $DisplayTax = locale_money_format(-$myrow['ovgst'],$myrow['decimalplaces']); + $DisplayTotal = locale_money_format(-$myrow['ovfreight']-$myrow['ovgst']-$myrow['ovamount'],$myrow['decimalplaces']); } /*Print out the invoice text entered */ Modified: trunk/PrintCustTransPortrait.php =================================================================== --- trunk/PrintCustTransPortrait.php 2011-09-17 07:49:08 UTC (rev 4693) +++ trunk/PrintCustTransPortrait.php 2011-09-17 22:43:30 UTC (rev 4694) @@ -311,8 +311,8 @@ $DisplayDiscount = locale_number_format($myrow2['discountpercent'] * 100, 2) . '%'; $DiscountPrice = $myrow2['fxprice'] * (1 - $myrow2['discountpercent']); } - $DisplayNet = locale_number_format($myrow2['fxnet'],$myrow['decimalplaces']); - $DisplayPrice = locale_number_format($myrow2['fxprice'],$myrow['decimalplaces']); + $DisplayNet = locale_money_format($myrow2['fxnet'],$myrow['decimalplaces']); + $DisplayPrice = locale_money_format($myrow2['fxprice'],$myrow['decimalplaces']); $DisplayQty = locale_number_format($myrow2['quantity'],$myrow2['decimalplaces']); $LeftOvers = $pdf->addTextWrap($Left_Margin+5,$YPos,71,$FontSize,$myrow2['stockid']); @@ -424,15 +424,15 @@ if ($InvOrCredit=='Invoice') { - $DisplaySubTot = locale_number_format($myrow['ovamount'],$myrow['decimalplaces']); - $DisplayFreight = locale_number_format($myrow['ovfreight'],$myrow['decimalplaces']); - $DisplayTax = locale_number_format($myrow['ovgst'],$myrow['decimalplaces']); - $DisplayTotal = locale_number_format($myrow['ovfreight']+$myrow['ovgst']+$myrow['ovamount'],$myrow['decimalplaces']); + $DisplaySubTot = locale_money_format($myrow['ovamount'],$myrow['decimalplaces']); + $DisplayFreight = locale_money_format($myrow['ovfreight'],$myrow['decimalplaces']); + $DisplayTax = locale_money_format($myrow['ovgst'],$myrow['decimalplaces']); + $DisplayTotal = locale_money_format($myrow['ovfreight']+$myrow['ovgst']+$myrow['ovamount'],$myrow['decimalplaces']); } else { - $DisplaySubTot = locale_number_format(-$myrow['ovamount'],$myrow['decimalplaces']); - $DisplayFreight = locale_number_format(-$myrow['ovfreight'],$myrow['decimalplaces']); - $DisplayTax = locale_number_format(-$myrow['ovgst'],$myrow['decimalplaces']); - $DisplayTotal = locale_number_format(-$myrow['ovfreight']-$myrow['ovgst']-$myrow['ovamount'],$myrow['decimalplaces']); + $DisplaySubTot = locale_money_format(-$myrow['ovamount'],$myrow['decimalplaces']); + $DisplayFreight = locale_money_format(-$myrow['ovfreight'],$myrow['decimalplaces']); + $DisplayTax = locale_money_format(-$myrow['ovgst'],$myrow['decimalplaces']); + $DisplayTotal = locale_money_format(-$myrow['ovfreight']-$myrow['ovgst']-$myrow['ovamount'],$myrow['decimalplaces']); } /*Print out the invoice text entered */ $YPos = $Bottom_Margin+(3*$line_height); @@ -891,9 +891,9 @@ echo $RowStarter; - $DisplayPrice =locale_number_format($myrow2['fxprice'],$myrow['decimalplaces']); + $DisplayPrice =locale_money_format($myrow2['fxprice'],$myrow['decimalplaces']); $DisplayQty = locale_number_format($myrow2['quantity'],$myrow2['decimalplaces']); - $DisplayNet = locale_number_format($myrow2['fxnet'],$myrow['decimalplaces']); + $DisplayNet = locale_money_format($myrow2['fxnet'],$myrow['decimalplaces']); if ($myrow2['discountpercent']==0){ $DisplayDiscount =''; @@ -1029,15 +1029,15 @@ if ($InvOrCredit=='Invoice') { - $DisplaySubTot = locale_number_format($myrow['ovamount'],$myrow['decimalplaces']); - $DisplayFreight = locale_number_format($myrow['ovfreight'],$myrow['decimalplaces']); - $DisplayTax = locale_number_format($myrow['ovgst'],$myrow['decimalplaces']); - $DisplayTotal = locale_number_format($myrow['ovfreight']+$myrow['ovgst']+$myrow['ovamount'],$myrow['decimalplaces']); + $DisplaySubTot = locale_money_format($myrow['ovamount'],$myrow['decimalplaces']); + $DisplayFreight = locale_money_format($myrow['ovfreight'],$myrow['decimalplaces']); + $DisplayTax = locale_money_format($myrow['ovgst'],$myrow['decimalplaces']); + $DisplayTotal = locale_money_format($myrow['ovfreight']+$myrow['ovgst']+$myrow['ovamount'],$myrow['decimalplaces']); } else { - $DisplaySubTot = locale_number_format(-$myrow['ovamount'],$myrow['decimalplaces']); - $DisplayFreight = locale_number_format(-$myrow['ovfreight'],$myrow['decimalplaces']); - $DisplayTax = locale_number_format(-$myrow['ovgst'],2); - $DisplayTotal = locale_number_format(-$myrow['ovfreight']-$myrow['ovgst']-$myrow['ovamount'],$myrow['decimalplaces']); + $DisplaySubTot = locale_money_format(-$myrow['ovamount'],$myrow['decimalplaces']); + $DisplayFreight = locale_money_format(-$myrow['ovfreight'],$myrow['decimalplaces']); + $DisplayTax = locale_money_format(-$myrow['ovgst'],2); + $DisplayTotal = locale_money_format(-$myrow['ovfreight']-$myrow['ovgst']-$myrow['ovamount'],$myrow['decimalplaces']); } /*Print out the invoice text entered */ echo '<table class="table1"><tr> Modified: trunk/SelectOrderItems.php =================================================================== --- trunk/SelectOrderItems.php 2011-09-17 07:49:08 UTC (rev 4693) +++ trunk/SelectOrderItems.php 2011-09-17 22:43:30 UTC (rev 4694) @@ -730,10 +730,9 @@ $SQL = "SELECT stockmaster.stockid, stockmaster.description, stockmaster.units - FROM stockmaster, - stockcategory - WHERE stockmaster.categoryid=stockcategory.categoryid - AND (stockcategory.stocktype='F' OR stockcategory.stocktype='D') + FROM stockmaster INNER JOIN stockcategory + ON stockmaster.categoryid=stockcategory.categoryid + WHERE (stockcategory.stocktype='F' OR stockcategory.stocktype='D') AND stockmaster.mbflag <>'G' AND stockmaster.description " . LIKE . " '" . $SearchString . "' AND stockmaster.discontinued=0 @@ -742,9 +741,9 @@ $SQL = "SELECT stockmaster.stockid, stockmaster.description, stockmaster.units - FROM stockmaster, stockcategory - WHERE stockmaster.categoryid=stockcategory.categoryid - AND (stockcategory.stocktype='F' OR stockcategory.stocktype='D') + FROM stockmaster INNER JOIN stockcategory + ON stockmaster.categoryid=stockcategory.categoryid + WHERE (stockcategory.stocktype='F' OR stockcategory.stocktype='D') AND stockmaster.mbflag <>'G' AND stockmaster.discontinued=0 AND stockmaster.description " . LIKE . " '" . $SearchString . "' @@ -761,9 +760,9 @@ $SQL = "SELECT stockmaster.stockid, stockmaster.description, stockmaster.units - FROM stockmaster, stockcategory - WHERE stockmaster.categoryid=stockcategory.categoryid - AND (stockcategory.stocktype='F' OR stockcategory.stocktype='D') + FROM stockmaster INNER JOIN stockcategory + ON stockmaster.categoryid=stockcategory.categoryid + WHERE (stockcategory.stocktype='F' OR stockcategory.stocktype='D') AND stockmaster.stockid " . LIKE . " '" . $SearchString . "' AND stockmaster.mbflag <>'G' AND stockmaster.discontinued=0 @@ -772,9 +771,9 @@ $SQL = "SELECT stockmaster.stockid, stockmaster.description, stockmaster.units - FROM stockmaster, stockcategory - WHERE stockmaster.categoryid=stockcategory.categoryid - AND (stockcategory.stocktype='F' OR stockcategory.stocktype='D') + FROM stockmaster INNER JOIN stockcategory + ON stockmaster.categoryid=stockcategory.categoryid + WHERE (stockcategory.stocktype='F' OR stockcategory.stocktype='D') AND stockmaster.stockid " . LIKE . " '" . $SearchString . "' AND stockmaster.mbflag <>'G' AND stockmaster.discontinued=0 @@ -787,9 +786,9 @@ $SQL = "SELECT stockmaster.stockid, stockmaster.description, stockmaster.units - FROM stockmaster, stockcategory - WHERE stockmaster.categoryid=stockcategory.categoryid - AND (stockcategory.stocktype='F' OR stockcategory.stocktype='D') + FROM stockmaster INNER JOIN stockcategory + ON stockmaster.categoryid=stockcategory.categoryid + WHERE (stockcategory.stocktype='F' OR stockcategory.stocktype='D') AND stockmaster.mbflag <>'G' AND stockmaster.discontinued=0 ORDER BY stockmaster.stockid"; @@ -797,9 +796,9 @@ $SQL = "SELECT stockmaster.stockid, stockmaster.description, stockmaster.units - FROM stockmaster, stockcategory - WHERE stockmaster.categoryid=stockcategory.categoryid - AND (stockcategory.stocktype='F' OR stockcategory.stocktype='D') + FROM stockmaster INNER JOIN stockcategory + ON stockmaster.categoryid=stockcategory.categoryid + WHERE (stockcategory.stocktype='F' OR stockcategory.stocktype='D') AND stockmaster.mbflag <>'G' AND stockmaster.discontinued=0 AND stockmaster.categoryid='" . $_POST['StockCat'] . "' @@ -816,7 +815,7 @@ if (!isset($Offset) or $Offset<0) { $Offset=0; } - $SQL = $SQL . " LIMIT " . $_SESSION['DefaultDisplayRecordsMax'] . " OFFSET " . strval(filter_number_format($_SESSION['DefaultDisplayRecordsMax']*$Offset)); + $SQL = $SQL . " LIMIT " . $_SESSION['DefaultDisplayRecordsMax'] . " OFFSET " . strval($_SESSION['DefaultDisplayRecordsMax']*$Offset); $ErrMsg = _('There is a problem selecting the part records to display because'); $DbgMsg = _('The SQL used to get the part selection was'); @@ -1056,7 +1055,7 @@ if (isset($_POST['Quantity_' . $OrderLine->LineNumber])){ - $Quantity = filter_number_format($_POST['Quantity_' . $OrderLine->LineNumber]); + $Quantity = round(filter_number_format($_POST['Quantity_' . $OrderLine->LineNumber]),$OrderLine->DecimalPlaces); if (ABS($OrderLine->Price - filter_number_format($_POST['Price_' . $OrderLine->LineNumber]))>0.01){ $Price = filter_number_format($_POST['Price_' . $OrderLine->LineNumber]); @@ -1164,7 +1163,7 @@ foreach ($_SESSION['Items'.$identifier]->LineItems as $OrderLine_2) { if ($OrderLine_2->DiscCat==$OrderLine->DiscCat){ $_SESSION['Items'.$identifier]->LineItems[$OrderLine_2->LineNumber]->DiscountPercent = $DiscountMatrixRate; - $_SESSION['Items'.$identifier]->LineItems[$OrderLine_2->LineNumber]->GPPercent = (($_SESSION['Items'.$identifier]->LineItems[$OrderLine_2->LineNumber]->Price*(1-$DiscountMatrixRate)) - $_SESSION['Items'.$identifier]->LineItems[$OrderLine_2->LineNumber]->StandardCost*$ExRate)/($_SESSION['Items'.$identifier]->LineItems[$OrderLine_2->LineNumber]->Price *(1-$DiscountMatrixRate)/100); + $_SESSION['Items'.$identifier]->LineItems[$OrderLine_2->LineNumber]->GPPercent = filter_number_format((($_SESSION['Items'.$identifier]->LineItems[$OrderLine_2->LineNumber]->Price*(1-$DiscountMatrixRate)) - $_SESSION['Items'.$identifier]->LineItems[$OrderLine_2->LineNumber]->StandardCost*$ExRate)/($_SESSION['Items'.$identifier]->LineItems[$OrderLine_2->LineNumber]->Price *(1-$DiscountMatrixRate)/100)); } } } @@ -1292,7 +1291,7 @@ FROM discountmatrix WHERE salestype='" . $_SESSION['Items'.$identifier]->DefaultSalesType . "' AND discountcategory ='" . $OrderLine->DiscCat . "' - AND quantitybreak <= '" . $QuantityOfDiscCat . "'",$db); + AND quantitybreak <= '" . filter_number_format($QuantityOfDiscCat) . "'",$db); $myrow = DB_fetch_row($result); if ($myrow[0] == NULL){ $DiscountMatrixRate = 0; @@ -1365,22 +1364,22 @@ echo '<td><a target="_blank" href="' . $rootpath . '/StockStatus.php?identifier='.$identifier . '&StockID=' . $OrderLine->StockID . '&DebtorNo=' . $_SESSION['Items'.$identifier]->DebtorNo . '">' . $OrderLine->StockID . '</a></td> <td>' . $OrderLine->ItemDescription . '</td>'; - echo '<td><input class="number" tabindex=2 type=tect name="Quantity_' . $OrderLine->LineNumber . '" size=6 maxlength=6 value=' . $OrderLine->Quantity . '>'; + echo '<td><input class="number" tabindex=2 type=tect name="Quantity_' . $OrderLine->LineNumber . '" size=6 maxlength=6 value=' . locale_number_format($OrderLine->Quantity,$OrderLine->DecimalPlaces) . '>'; if ($QtyRemain != $QtyOrdered){ - echo '<br />'.$OrderLine->QtyInv.' of '.$OrderLine->Quantity.' invoiced'; + echo '<br />'.locale_number_format($OrderLine->QtyInv,$OrderLine->DecimalPlaces) .' of '.locale_number_format($OrderLine->Quantity,$OrderLine->DecimalPlaces).' invoiced'; } echo '</td> - <td class="number">' . $OrderLine->QOHatLoc . '</td> + <td class="number">' . locale_number_format($OrderLine->QOHatLoc,$OrderLine->DecimalPlaces) . '</td> <td>' . $OrderLine->Units . '</td>'; if (in_array(2,$_SESSION['AllowedPageSecurityTokens'])){ /*OK to display with discount if it is an internal user with appropriate permissions */ - echo '<td><input class="number" type="text" name="Price_' . $OrderLine->LineNumber . '" size=16 maxlength=16 value=' . $OrderLine->Price . '></td> - <td><input class="number" type="text" name="Discount_' . $OrderLine->LineNumber . '" size=5 maxlength=4 value=' . ($OrderLine->DiscountPercent * 100) . '></td> - <td><input class="number" type="text" name="GPPercent_' . $OrderLine->LineNumber . '" size=3 maxlength=40 value=' . $OrderLine->GPPercent . '></td>'; + echo '<td><input class="number" type="text" name="Price_' . $OrderLine->LineNumber . '" size=16 maxlength=16 value=' . locale_money_format($OrderLine->Price,$_SESSION['Items'.$identifier]->CurrDecimalPlaces) . '></td> + <td><input class="number" type="text" name="Discount_' . $OrderLine->LineNumber . '" size=5 maxlength=4 value=' . locale_number_format(($OrderLine->DiscountPercent * 100),2) . '></td> + <td><input class="number" type="text" name="GPPercent_' . $OrderLine->LineNumber . '" size=3 maxlength=40 value=' . locale_number_format($OrderLine->GPPercent,2) . '></td>'; } else { - echo '<td class=number>' . $OrderLine->Price . '</td><td></td>'; - echo '<input type=hidden name="Price_' . $OrderLine->LineNumber . '" value=' . $OrderLine->Price . '>'; + echo '<td class=number>' . locale_money_format($OrderLine->Price,$_SESSION['Items'.$identifier]->CurrDecimalPlaces) . '</td><td></td>'; + echo '<input type=hidden name="Price_' . $OrderLine->LineNumber . '" value=' . locale_money_format($OrderLine->Price,$_SESSION['Items'.$identifier]->CurrDecimalPlaces) . '>'; } if ($_SESSION['Items'.$identifier]->Some_Already_Delivered($OrderLine->LineNumber)){ $RemTxt = _('Clear Remaining'); Modified: trunk/StockAdjustments.php =================================================================== --- trunk/StockAdjustments.php 2011-09-17 07:49:08 UTC (rev 4693) +++ trunk/StockAdjustments.php 2011-09-17 22:43:30 UTC (rev 4694) @@ -36,12 +36,12 @@ $_SESSION['Adjustment']->Serialised = $myrow['serialised']; $_SESSION['Adjustment']->DecimalPlaces = $myrow['decimalplaces']; $_SESSION['Adjustment']->SerialItems = array(); - if (!isset($_SESSION['Adjustment']->Quantity)or !is_numeric($_SESSION['Adjustment']->Quantity)){ + if (!isset($_SESSION['Adjustment']->Quantity) OR !is_numeric($_SESSION['Adjustment']->Quantity)){ $_SESSION['Adjustment']->Quantity=0; } $NewAdjustment = true; } elseif (isset($_POST['StockID'])){ - if(isset($_POST['StockID']) and $_POST['StockID'] != $_SESSION['Adjustment']->StockID){ + if(isset($_POST['StockID']) AND $_POST['StockID'] != $_SESSION['Adjustment']->StockID){ $NewAdjustment = true; $_SESSION['Adjustment']->StockID = trim(mb_strtoupper($_POST['StockID'])); $StockID = trim(mb_strtoupper($_POST['StockID'])); @@ -49,10 +49,10 @@ $_SESSION['Adjustment']->tag = $_POST['tag']; $_SESSION['Adjustment']->Narrative = $_POST['Narrative']; $_SESSION['Adjustment']->StockLocation = $_POST['StockLocation']; - if ($_POST['Quantity']=='' or !is_numeric($_POST['Quantity'])){ + if ($_POST['Quantity']=='' or !is_numeric(filter_number_format($_POST['Quantity']))){ $_POST['Quantity']=0; } - $_SESSION['Adjustment']->Quantity = $_POST['Quantity']; + $_SESSION['Adjustment']->Quantity = filter_number_format($_POST['Quantity']); } echo '<p class="page_title_text"><img src="'.$rootpath.'/css/'.$theme.'/images/supplier.png" title="' . @@ -94,7 +94,7 @@ exit; } -if (isset($_POST['EnterAdjustment']) && $_POST['EnterAdjustment']!= ''){ +if (isset($_POST['EnterAdjustment']) AND $_POST['EnterAdjustment']!= ''){ $InputError = false; /*Start by hoping for the best */ $result = DB_query("SELECT * FROM stockmaster WHERE stockid='" . $_SESSION['Adjustment']->StockID . "'",$db); @@ -149,7 +149,7 @@ $QtyOnHandPrior = 0; } - $SQL = "INSERT INTO stockmoves ( stockid, + $SQL = "INSERT INTO stockmoves (stockid, type, transno, loccode, @@ -175,7 +175,6 @@ $DbgMsg = _('The following SQL to insert the stock movement record was used'); $Result = DB_query($SQL, $db, $ErrMsg, $DbgMsg, true); - /*Get the ID of the StockMove... */ $StkMoveNo = DB_Last_Insert_ID($db,'stockmoves','stkmoveno'); @@ -188,11 +187,10 @@ /*First need to check if the serial items already exists or not */ $SQL = "SELECT COUNT(*) - FROM stockserialitems - WHERE - stockid='" . $_SESSION['Adjustment']->StockID . "' - AND loccode='" . $_SESSION['Adjustment']->StockLocation . "' - AND serialno='" . $Item->BundleRef . "'"; + FROM stockserialitems + WHERE stockid='" . $_SESSION['Adjustment']->StockID . "' + AND loccode='" . $_SESSION['Adjustment']->StockLocation . "' + AND serialno='" . $Item->BundleRef . "'"; $ErrMsg = _('Unable to determine if the serial item exists'); $Result = DB_query($SQL,$db,$ErrMsg); $SerialItemExistsRow = DB_fetch_row($Result); @@ -200,10 +198,9 @@ if ($SerialItemExistsRow[0]==1){ $SQL = "UPDATE stockserialitems SET quantity= quantity + " . $Item->BundleQty . " - WHERE - stockid='" . $_SESSION['Adjustment']->StockID . "' - AND loccode='" . $_SESSION['Adjustment']->StockLocation . "' - AND serialno='" . $Item->BundleRef . "'"; + WHERE stockid='" . $_SESSION['Adjustment']->StockID . "' + AND loccode='" . $_SESSION['Adjustment']->StockLocation . "' + AND serialno='" . $Item->BundleRef . "'"; $ErrMsg = _('CRITICAL ERROR') . '! ' . _('NOT... [truncated message content] |
From: <dai...@us...> - 2011-09-18 01:22:32
|
Revision: 4695 http://web-erp.svn.sourceforge.net/web-erp/?rev=4695&view=rev Author: daintree Date: 2011-09-18 01:22:23 +0000 (Sun, 18 Sep 2011) Log Message: ----------- number_formats Modified Paths: -------------- trunk/CounterSales.php trunk/Numbers/Words/lang.bg.php trunk/Numbers/Words/lang.fr.php trunk/Numbers/Words/lang.fr_BE.php trunk/PO_Items.php trunk/includes/phplot/phplot.php trunk/includes/tcpdf/tcpdf.php Modified: trunk/CounterSales.php =================================================================== --- trunk/CounterSales.php 2011-09-17 22:43:30 UTC (rev 4694) +++ trunk/CounterSales.php 2011-09-18 01:22:23 UTC (rev 4695) @@ -488,7 +488,7 @@ if (abs($OrderLine->Price - filter_number_format($_POST['Price_' . $OrderLine->LineNumber]))>0.01){ $Price = filter_number_format($_POST['Price_' . $OrderLine->LineNumber]); - $_POST['GPPercent_' . $OrderLine->LineNumber] = (($Price*(1-(filter_number_format($_POST['Discount_' . $OrderLine->LineNumber])/100))) - $OrderLine->StandardCost*$ExRate)/($Price *(1-filter_number_format($_POST['Discount_' . $OrderLine->LineNumber]))/100); + $_POST['GPPercent_' . $OrderLine->LineNumber] = filter_number_format((($Price*(1-(filter_number_format($_POST['Discount_' . $OrderLine->LineNumber])/100))) - $OrderLine->StandardCost*$ExRate)/($Price *(1-filter_number_format($_POST['Discount_' . $OrderLine->LineNumber]))/100)); } else if (abs($OrderLine->GPPercent - filter_number_format($_POST['GPPercent_' . $OrderLine->LineNumber]))>=0.001) { //then do a recalculation of the price at this new GP Percentage $Price = ($OrderLine->StandardCost*$ExRate)/(1 -((filter_number_format($_POST['GPPercent_' . $OrderLine->LineNumber]) + filter_number_format($_POST['Discount_' . $OrderLine->LineNumber]))/100)); @@ -509,16 +509,16 @@ if ($Quantity<0 or $Price <0 or $DiscountPercentage >100 or $DiscountPercentage <0){ prnMsg(_('The item could not be updated because you are attempting to set the quantity ordered to less than 0 or the price less than 0 or the discount more than 100% or less than 0%'),'warn'); } else if ($OrderLine->Quantity !=$Quantity - or $OrderLine->Price != $Price - or abs($OrderLine->DiscountPercent -$DiscountPercentage/100) >0.001 - or $OrderLine->Narrative != $Narrative - or $OrderLine->ItemDue != $_POST['ItemDue_' . $OrderLine->LineNumber] - or $OrderLine->POLine != $_POST['POLine_' . $OrderLine->LineNumber]) { + OR $OrderLine->Price != $Price + OR abs($OrderLine->DiscountPercent -$DiscountPercentage/100) >0.001 + OR $OrderLine->Narrative != $Narrative + OR $OrderLine->ItemDue != $_POST['ItemDue_' . $OrderLine->LineNumber] + OR $OrderLine->POLine != $_POST['POLine_' . $OrderLine->LineNumber]) { $_SESSION['Items'.$identifier]->update_cart_item($OrderLine->LineNumber, $Quantity, $Price, - ($DiscountPercentage/100), + filter_number_format($DiscountPercentage/100), $Narrative, 'Yes', /*Update DB */ $_POST['ItemDue_' . $OrderLine->LineNumber], @@ -1889,7 +1889,7 @@ '" . $BankAccountExRate . "', '" . $DefaultDispatchDate . "', '" . $_POST['PaymentMethod'] . "', - '" . (filter_number_format($_POST['AmountPaid']) * $BankAccountExRate) . "', + '" . filter_number_format(filter_number_format($_POST['AmountPaid']) * $BankAccountExRate) . "', '" . $_SESSION['Items'.$identifier]->DefaultCurrency . "')"; $DbgMsg = _('The SQL that failed to insert the bank account transaction was'); Modified: trunk/Numbers/Words/lang.bg.php =================================================================== --- trunk/Numbers/Words/lang.bg.php 2011-09-17 22:43:30 UTC (rev 4694) +++ trunk/Numbers/Words/lang.bg.php 2011-09-18 01:22:23 UTC (rev 4695) @@ -318,7 +318,7 @@ return $ret; } else - return explode(' ', locale_number_format($num, 0, '', ' ')); // a faster version for integers + return explode(' ', number_format($num, 0, '', ' ')); // a faster version for integers } // }}} Modified: trunk/Numbers/Words/lang.fr.php =================================================================== --- trunk/Numbers/Words/lang.fr.php 2011-09-17 22:43:30 UTC (rev 4694) +++ trunk/Numbers/Words/lang.fr.php 2011-09-18 01:22:23 UTC (rev 4695) @@ -271,7 +271,7 @@ return $ret; } else - return explode(' ', locale_number_format($num, 0, '', ' ')); // a faster version for integers + return explode(' ', number_format($num, 0, '', ' ')); // a faster version for integers } // }}} Modified: trunk/Numbers/Words/lang.fr_BE.php =================================================================== --- trunk/Numbers/Words/lang.fr_BE.php 2011-09-17 22:43:30 UTC (rev 4694) +++ trunk/Numbers/Words/lang.fr_BE.php 2011-09-18 01:22:23 UTC (rev 4695) @@ -275,7 +275,7 @@ return $ret; } else - return explode(' ', locale_number_format($num, 0, '', ' ')); // a faster version for integers + return explode(' ', number_format($num, 0, '', ' ')); // a faster version for integers } // }}} Modified: trunk/PO_Items.php =================================================================== --- trunk/PO_Items.php 2011-09-17 22:43:30 UTC (rev 4694) +++ trunk/PO_Items.php 2011-09-18 01:22:23 UTC (rev 4695) @@ -33,21 +33,21 @@ if (isset($_POST['UpdateLines']) OR isset($_POST['Commit'])) { foreach ($_SESSION['PO'.$identifier]->LineItems as $POLine) { if ($POLine->Deleted == false) { - if (!is_numeric($_POST['ConversionFactor'.$POLine->LineNo])){ + if (!is_numeric(filter_number_format($_POST['ConversionFactor'.$POLine->LineNo]))){ prnMsg(_('The conversion factor is expected to be numeric - the figure which converts from our units to the supplier units. e.g. if the supplier units is a tonne and our unit is a kilogram then the conversion factor that converts our unit to the suppliers unit is 1000'),'error'); $_SESSION['PO'.$identifier]->LineItems[$POLine->LineNo]->ConversionFactor = 1; } else { //a valid number for the conversion factor is entered - $_SESSION['PO'.$identifier]->LineItems[$POLine->LineNo]->ConversionFactor = $_POST['ConversionFactor'.$POLine->LineNo]; + $_SESSION['PO'.$identifier]->LineItems[$POLine->LineNo]->ConversionFactor = filter_number_format($_POST['ConversionFactor'.$POLine->LineNo]); } - if (!is_numeric($_POST['SuppQty'.$POLine->LineNo])){ + if (!is_numeric(filter_number_format($_POST['SuppQty'.$POLine->LineNo]))){ prnMsg(_('The quantity in the supplier units is expected to be numeric. Please re-enter as a number'),'error'); } else { //ok to update the PO object variables - $_SESSION['PO'.$identifier]->LineItems[$POLine->LineNo]->Quantity=round($_POST['SuppQty'.$POLine->LineNo]*$_SESSION['PO'.$identifier]->LineItems[$POLine->LineNo]->ConversionFactor,$_SESSION['PO'.$identifier]->LineItems[$POLine->LineNo]->DecimalPlaces); + $_SESSION['PO'.$identifier]->LineItems[$POLine->LineNo]->Quantity=filter_number_format(round(filter_number_format($_POST['SuppQty'.$POLine->LineNo])*filter_number_format($_SESSION['PO'.$identifier]->LineItems[$POLine->LineNo]->ConversionFactor),$_SESSION['PO'.$identifier]->LineItems[$POLine->LineNo]->DecimalPlaces)); } - if (!is_numeric($_POST['SuppPrice'.$POLine->LineNo])){ + if (!is_numeric(filter_number_format($_POST['SuppPrice'.$POLine->LineNo]))){ prnMsg(_('The supplier price is expected to be numeric. Please re-enter as a number'),'error'); } else { //ok to update the PO object variables - $_SESSION['PO'.$identifier]->LineItems[$POLine->LineNo]->Price=$_POST['SuppPrice'.$POLine->LineNo]/$_SESSION['PO'.$identifier]->LineItems[$POLine->LineNo]->ConversionFactor; + $_SESSION['PO'.$identifier]->LineItems[$POLine->LineNo]->Price=filter_number_format((filter_number_format($_POST['SuppPrice'.$POLine->LineNo])/filter_number_format($_SESSION['PO'.$identifier]->LineItems[$POLine->LineNo]->ConversionFactor)); } $_SESSION['PO'.$identifier]->LineItems[$POLine->LineNo]->ReqDelDate=$_POST['ReqDelDate'.$POLine->LineNo]; } @@ -166,22 +166,22 @@ '" . $_SESSION['PO'.$identifier]->Initiator . "', '" . $_SESSION['PO'.$identifier]->RequisitionNo . "', '" . $_SESSION['PO'.$identifier]->Location . "', - '" . $_SESSION['PO'.$identifier]->DelAdd1 . "', - '" . $_SESSION['PO'.$identifier]->DelAdd2 . "', - '" . $_SESSION['PO'.$identifier]->DelAdd3 . "', - '" . $_SESSION['PO'.$identifier]->DelAdd4 . "', - '" . $_SESSION['PO'.$identifier]->DelAdd5 . "', - '" . $_SESSION['PO'.$identifier]->DelAdd6 . "', - '" . $_SESSION['PO'.$identifier]->Tel . "', - '" . $_SESSION['PO'.$identifier]->SuppDelAdd1 . "', - '" . $_SESSION['PO'.$identifier]->SuppDelAdd2 . "', - '" . $_SESSION['PO'.$identifier]->SuppDelAdd3 . "', - '" . $_SESSION['PO'.$identifier]->SuppDelAdd4 . "', - '" . $_SESSION['PO'.$identifier]->SuppDelAdd5 . "', - '" . $_SESSION['PO'.$identifier]->SuppDelAdd6 . "', - '" . $_SESSION['PO'.$identifier]->SupplierContact . "', - '" . $_SESSION['PO'.$identifier]->SuppTel. "', - '" . $_SESSION['PO'.$identifier]->Contact . "', + '" . DB_escape_string($_SESSION['PO'.$identifier]->DelAdd1) . "', + '" . DB_escape_string($_SESSION['PO'.$identifier]->DelAdd2) . "', + '" . DB_escape_string($_SESSION['PO'.$identifier]->DelAdd3) . "', + '" . DB_escape_string($_SESSION['PO'.$identifier]->DelAdd4) . "', + '" . DB_escape_string($_SESSION['PO'.$identifier]->DelAdd5) . "', + '" . DB_escape_string($_SESSION['PO'.$identifier]->DelAdd6) . "', + '" . DB_escape_string($_SESSION['PO'.$identifier]->Tel) . "', + '" . DB_escape_string($_SESSION['PO'.$identifier]->SuppDelAdd1) . "', + '" . DB_escape_string($_SESSION['PO'.$identifier]->SuppDelAdd2) . "', + '" . DB_escape_string($_SESSION['PO'.$identifier]->SuppDelAdd3) . "', + '" . DB_escape_string($_SESSION['PO'.$identifier]->SuppDelAdd4) . "', + '" . DB_escape_string($_SESSION['PO'.$identifier]->SuppDelAdd5) . "', + '" . DB_escape_string($_SESSION['PO'.$identifier]->SuppDelAdd6) . "', + '" . DB_escape_string($_SESSION['PO'.$identifier]->SupplierContact) . "', + '" . DB_escape_string($_SESSION['PO'.$identifier]->SuppTel). "', + '" . DB_escape_string($_SESSION['PO'.$identifier]->Contact) . "', '" . $_SESSION['PO'.$identifier]->Version . "', '" . Date('Y-m-d') . "', '" . $_SESSION['PO'.$identifier]->DeliveryBy . "', @@ -198,7 +198,7 @@ /*Insert the purchase order detail records */ foreach ($_SESSION['PO'.$identifier]->LineItems as $POLine) { if ($POLine->Deleted==False) { - $sql = "INSERT INTO purchorderdetails ( orderno, + $sql = "INSERT INTO purchorderdetails (orderno, itemcode, deliverydate, itemdescription, @@ -214,7 +214,7 @@ VALUES ('" . $_SESSION['PO'.$identifier]->OrderNo . "', '" . $POLine->StockID . "', '" . FormatDateForSQL($POLine->ReqDelDate) . "', - '" . $POLine->ItemDescription . "', + '" . DB_escape_string($POLine->ItemDescription) . "', '" . $POLine->GLCode . "', '" . $POLine->Price . "', '" . $POLine->Quantity . "', @@ -254,7 +254,7 @@ /*Update the purchase order header with any changes */ $sql = "UPDATE purchorders SET supplierno = '" . $_SESSION['PO'.$identifier]->SupplierID . "' , - comments='" . $_SESSION['PO'.$identifier]->Comments . "', + comments='" . DB_escape_string($_SESSION['PO'.$identifier]->Comments) . "', rate='" . $_SESSION['PO'.$identifier]->ExRate . "', initiator='" . $_SESSION['PO'.$identifier]->Initiator . "', requisitionno= '" . $_SESSION['PO'.$identifier]->RequisitionNo . "', @@ -263,26 +263,26 @@ deliverydate='" . FormatDateForSQL($_SESSION['PO'.$identifier]->DeliveryDate) . "', revised= '" . Date('Y-m-d') . "', intostocklocation='" . $_SESSION['PO'.$identifier]->Location . "', - deladd1='" . $_SESSION['PO'.$identifier]->DelAdd1 . "', - deladd2='" . $_SESSION['PO'.$identifier]->DelAdd2 . "', - deladd3='" . $_SESSION['PO'.$identifier]->DelAdd3 . "', - deladd4='" . $_SESSION['PO'.$identifier]->DelAdd4 . "', - deladd5='" . $_SESSION['PO'.$identifier]->DelAdd5 . "', - deladd6='" . $_SESSION['PO'.$identifier]->DelAdd6 . "', - deladd6='" . $_SESSION['PO'.$identifier]->Tel . "', - suppdeladdress1='" . $_SESSION['PO'.$identifier]->SuppDelAdd1 . "', - suppdeladdress2='" . $_SESSION['PO'.$identifier]->SuppDelAdd2 . "', - suppdeladdress3='" . $_SESSION['PO'.$identifier]->SuppDelAdd3 . "', - suppdeladdress4='" . $_SESSION['PO'.$identifier]->SuppDelAdd4 . "', - suppdeladdress5='" . $_SESSION['PO'.$identifier]->SuppDelAdd5 . "', - suppdeladdress6='" . $_SESSION['PO'.$identifier]->SuppDelAdd6 . "', - suppliercontact='" . $_SESSION['PO'.$identifier]->SupplierContact . "', - supptel='" . $_SESSION['PO'.$identifier]->SuppTel . "', - contact='" . $_SESSION['PO'.$identifier]->Contact . "', + deladd1='" . DB_escape_string($_SESSION['PO'.$identifier]->DelAdd1) . "', + deladd2='" . DB_escape_string($_SESSION['PO'.$identifier]->DelAdd2) . "', + deladd3='" . DB_escape_string($_SESSION['PO'.$identifier]->DelAdd3) . "', + deladd4='" . DB_escape_string($_SESSION['PO'.$identifier]->DelAdd4) . "', + deladd5='" . DB_escape_string($_SESSION['PO'.$identifier]->DelAdd5) . "', + deladd6='" . DB_escape_string($_SESSION['PO'.$identifier]->DelAdd6) . "', + deladd6='" . DB_escape_string($_SESSION['PO'.$identifier]->Tel) . "', + suppdeladdress1='" . DB_escape_string($_SESSION['PO'.$identifier]->SuppDelAdd1) . "', + suppdeladdress2='" . DB_escape_string($_SESSION['PO'.$identifier]->SuppDelAdd2) . "', + suppdeladdress3='" . DB_escape_string($_SESSION['PO'.$identifier]->SuppDelAdd3) . "', + suppdeladdress4='" . DB_escape_string($_SESSION['PO'.$identifier]->SuppDelAdd4) . "', + suppdeladdress5='" . DB_escape_string($_SESSION['PO'.$identifier]->SuppDelAdd5) . "', + suppdeladdress6='" . DB_escape_string($_SESSION['PO'.$identifier]->SuppDelAdd6) . "', + suppliercontact='" . DB_escape_string($_SESSION['PO'.$identifier]->SupplierContact) . "', + supptel='" . DB_escape_string($_SESSION['PO'.$identifier]->SuppTel) . "', + contact='" . DB_escape_string($_SESSION['PO'.$identifier]->Contact) . "', paymentterms='" . $_SESSION['PO'.$identifier]->PaymentTerms . "', allowprint='" . $_SESSION['PO'.$identifier]->AllowPrintPO . "', status = '" . $_SESSION['PO'.$identifier]->Status . "', - stat_comment = '" . $_SESSION['PO'.$identifier]->StatusComments . "' + stat_comment = '" . DB_escape_string($_SESSION['PO'.$identifier]->StatusComments) . "' WHERE orderno = '" . $_SESSION['PO'.$identifier]->OrderNo ."'"; $ErrMsg = _('The purchase order could not be updated because'); @@ -321,7 +321,7 @@ '" . $_SESSION['PO'.$identifier]->OrderNo . "', '" . $POLine->StockID . "', '" . FormatDateForSQL($POLine->ReqDelDate) . "', - '" . $POLine->ItemDescription . "', + '" . DB_escape_string($POLine->ItemDescription) . "', '" . $POLine->GLCode . "', '" . $POLine->Price . "', '" . $POLine->Quantity . "', @@ -336,14 +336,14 @@ if ($POLine->Quantity==$POLine->QtyReceived){ $sql = "UPDATE purchorderdetails SET itemcode='" . $POLine->StockID . "', deliverydate ='" . FormatDateForSQL($POLine->ReqDelDate) . "', - itemdescription='" . $POLine->ItemDescription . "', + itemdescription='" . DB_escape_string($POLine->ItemDescription) . "', glcode='" . $POLine->GLCode . "', unitprice='" . $POLine->Price . "', quantityord='" . $POLine->Quantity . "', shiptref='" . $POLine->ShiptRef . "', jobref='" . $POLine->JobRef . "', suppliersunit='" . $POLine->SuppliersUnit . "', - suppliers_partno='" . $POLine->Suppliers_PartNo . "', + suppliers_partno='" . DB_escape_string($POLine->Suppliers_PartNo) . "', completed=1, assetid='" . $POLine->AssetID . "', conversionfactor = '" . $POLine->ConversionFactor . "' @@ -351,7 +351,7 @@ } else { $sql = "UPDATE purchorderdetails SET itemcode='" . $POLine->StockID . "', deliverydate ='" . FormatDateForSQL($POLine->ReqDelDate) . "', - itemdescription='" . $POLine->ItemDescription . "', + itemdescription='" . DB_escape_string($POLine->ItemDescription) . "', glcode='" . $POLine->GLCode . "', unitprice='" . $POLine->Price . "', quantityord='" . $POLine->Quantity . "', @@ -407,11 +407,11 @@ if (isset($_POST['EnterLine'])){ /*Inputs from the form directly without selecting a stock item from the search */ $AllowUpdate = true; /*always assume the best */ - if (!is_numeric($_POST['Qty'])){ + if (!is_numeric(filter_number_format($_POST['Qty']))){ $AllowUpdate = false; prnMsg( _('Cannot Enter this order line') . '<br />' . _('The quantity of the order item must be numeric'),'error'); } - if ($_POST['Qty']<0){ + if (filter_number_format($_POST['Qty'])<0){ $AllowUpdate = false; prnMsg( _('Cannot Enter this order line') . '<br />' . _('The quantity of the ordered item entered must be a positive amount'),'error'); } @@ -424,8 +424,6 @@ prnMsg( _('Cannot Enter this order line') . '</b><br />' . _('The date entered must be in the format') . ' ' . $_SESSION['DefaultDateFormat'], 'error'); } -// include ('PO_Chk_ShiptRef_JobRef.php'); - /*It's not a stock item */ /*need to check GL Code is valid if GLLink is active */ @@ -491,9 +489,9 @@ '', 0, /*Serialised */ 0, /*Controlled */ - $_POST['Qty'], + filter_number_format($_POST['Qty']), $_POST['ItemDescription'], - $_POST['Price'], + filter_number_format($_POST['Price']), $_POST['SuppliersUnit'], $_POST['GLCode'], $_POST['ReqDelDate'], @@ -526,7 +524,7 @@ foreach ($_POST as $FormVariableName => $Quantity) { /*The form entity name is of the format NewQtyX where X is the index number that identifies the stock item code held in the hidden StockIDX form variable * */ - if (mb_substr($FormVariableName, 0, 6)=='NewQty' AND $Quantity!=0) { //if the form variable represents a Qty to add to the order + if (mb_substr($FormVariableName, 0, 6)=='NewQty' AND filter_number_format($Quantity)!=0) { //if the form variable represents a Qty to add to the order $ItemCode = $_POST['StockID' . mb_substr($FormVariableName, 6)]; $AlreadyOnThisOrder = 0; @@ -544,7 +542,7 @@ } /* end of the foreach loop to look for preexisting items of the same code */ } } - if ($AlreadyOnThisOrder!=1 AND $Quantity > 0){ + if ($AlreadyOnThisOrder!=1 AND filter_number_format($Quantity) > 0){ $sql = "SELECT description, longdescription, stockid, @@ -588,7 +586,7 @@ $PurchDataResult = DB_query($sql,$db,$ErrMsg,$DbgMsg); if (DB_num_rows($PurchDataResult)>0){ //the purchasing data is set up $PurchRow = DB_fetch_array($PurchDataResult); - $PurchPrice = $PurchRow['price']/$PurchRow['conversionfactor']; + $PurchPrice = filter_number_format($PurchRow['price']/$PurchRow['conversionfactor']); $ConversionFactor = $PurchRow['conversionfactor']; $SupplierDescription = $PurchRow['suppliers_partno'] .' - '; if (mb_strlen($PurchRow['supplierdescription'])>2){ @@ -612,7 +610,7 @@ $ItemCode, 0, /*Serialised */ 0, /*Controlled */ - $Quantity*$ConversionFactor, /* Qty */ + filter_number_format((filter_number_format($Quantity)*$ConversionFactor), /* Qty */ $SupplierDescription, $PurchPrice, $ItemRow['units'], @@ -679,14 +677,14 @@ foreach ($_SESSION['PO'.$identifier]->LineItems as $POLine) { if ($POLine->Deleted==False) { - $LineTotal = $POLine->Quantity * $POLine->Price; - $DisplayLineTotal = locale_number_format($LineTotal,$_SESSION['PO'.$identifier]->CurrDecimalPlaces); + $LineTotal = filter_number_format($POLine->Quantity * $POLine->Price); + $DisplayLineTotal = locale_money_format($LineTotal,$_SESSION['PO'.$identifier]->CurrDecimalPlaces); // Note if the price is greater than 1 use 2 decimal place, if the price is a fraction of 1, use 4 decimal places // This should help display where item-price is a fraction if ($POLine->Price > 1) { - $DisplayPrice = locale_number_format($POLine->Price,$_SESSION['PO'.$identifier]->CurrDecimalPlaces); + $DisplayPrice = locale_money_format($POLine->Price,$_SESSION['PO'.$identifier]->CurrDecimalPlaces); } else { - $DisplayPrice = locale_number_format($POLine->Price,4); + $DisplayPrice = locale_money_format($POLine->Price,4); } if ($k==1){ @@ -703,9 +701,9 @@ <td>' . $POLine->Units . '</td> <td class="number">' . $DisplayPrice . '</td> <td><input type="text" class="number" name="ConversionFactor' . $POLine->LineNo .'" size="8" value="' . $POLine->ConversionFactor . '"></td> - <td><input type="text" class="number" name="SuppQty' . $POLine->LineNo .'" size="10" value="' . round($POLine->Quantity/$POLine->ConversionFactor,$POLine->DecimalPlaces) . '"></td> + <td><input type="text" class="number" name="SuppQty' . $POLine->LineNo .'" size="10" value="' . locale_locale_format(round($POLine->Quantity/$POLine->ConversionFactor,$POLine->DecimalPlaces),$POLine->DecimalPlaces) . '"></td> <td>' . $POLine->SuppliersUnit . '</td> - <td><input type="text" class="number" name="SuppPrice' . $POLine->LineNo . '" size="10" value="' . round(($POLine->Price *$POLine->ConversionFactor),$_SESSION['PO'.$identifier]->CurrDecimalPlaces) .'"></td> + <td><input type="text" class="number" name="SuppPrice' . $POLine->LineNo . '" size="10" value="' . locale_money_format(round(($POLine->Price *$POLine->ConversionFactor),$_SESSION['PO'.$identifier]->CurrDecimalPlaces),,$_SESSION['PO'.$identifier]->CurrDecimalPlaces) .'"></td> <td class="number">' . $DisplayLineTotal . '</td> <td><input type="text" class="date" alt="' .$_SESSION['DefaultDateFormat'].'" name="ReqDelDate' . $POLine->LineNo.'" size="10" value="' .$POLine->ReqDelDate .'"></td>'; if ($POLine->QtyReceived !=0 AND $POLine->Completed!=1){ @@ -718,7 +716,7 @@ } } - $DisplayTotal = locale_number_format($_SESSION['PO'.$identifier]->Total,$_SESSION['PO'.$identifier]->CurrDecimalPlaces); + $DisplayTotal = locale_money_format($_SESSION['PO'.$identifier]->Total,$_SESSION['PO'.$identifier]->CurrDecimalPlaces); echo '<tr><td colspan="9" class="number">' . _('TOTAL') . _(' excluding Tax') . '</td> <td class="number"><b>' . $DisplayTotal . '</b></td> </tr></table>'; @@ -764,13 +762,13 @@ echo'</select><a href="FixedAssetItems.php" target=_blank>'. _('New Fixed Asset') . '</a></td> <tr><td>'._('Quantity to purchase').'</td> - <td><input type="text" class="number" name="Qty" size="10" value="1"></td></tr> + <td><input type="text" class="number" name="Qty" size="10" value="1" /></td></tr> <tr><td>'._('Price per item').'</td> - <td><input type="text" class="number" name="Price" size="10"></td></tr> + <td><input type="text" class="number" name="Price" size="10" /></td></tr> <tr><td>'._('Unit').'</td> - <td><input type="text" name="SuppliersUnit" size="10" value="' . _('each') . '"></td></tr> + <td><input type="text" name="SuppliersUnit" size="10" value="' . _('each') . '" /></td></tr> <tr><td>'._('Delivery Date').'</td> - <td><input type="text" class="date" alt="'.$_SESSION['DefaultDateFormat'].'" name="ReqDelDate" size=11 value="'.$_SESSION['PO'.$identifier]->DeliveryDate .'"></td></tr>'; + <td><input type="text" class="date" alt="'.$_SESSION['DefaultDateFormat'].'" name="ReqDelDate" size=11 value="'.$_SESSION['PO'.$identifier]->DeliveryDate .'" /></td></tr>'; echo '</table>'; echo '<div class="centre"> <input type=submit name="EnterLine" value="Enter Item" /> @@ -1053,15 +1051,15 @@ } echo ' /></td> <td><font size="3"><b>' . _('OR') . ' </b></font>' . _('Enter extract of the Stock Code') . ':</td> - <td><input type="text" name="StockCode" size=15 maxlength=18 value="' . $_POST['StockCode'] . '"></td> + <td><input type="text" name="StockCode" size="15" maxlength="18" value="' . $_POST['StockCode'] . '" /></td> </tr> <tr><td></td> <td><font size=3><b>' . _('OR') . ' </b></font><a target="_blank" href="'.$rootpath.'/Stocks.php">' . _('Create a New Stock Item') . '</a></td></tr> </table> <br /> - <div class="centre"><input type="submit" name="Search" value="' . _('Search Now') . '"> - <input type="submit" name="NonStockOrder" value="' . _('Order a non stock item') . '"> + <div class="centre"><input type="submit" name="Search" value="' . _('Search Now') . '" /> + <input type="submit" name="NonStockOrder" value="' . _('Order a non stock item') . '" /> </div><br />'; $PartsDisplayed =0; @@ -1124,7 +1122,7 @@ <td class="number">' . $ConversionFactor .'</td> <td>' . $OrderUnits . '</td> <td>' . $ImageSource . '</td> - <td><input class="number" type="text" size="6" value="0" name="NewQty' . $j . '"></td> + <td><input class="number" type="text" size="6" value="0" name="NewQty' . $j . '" /></td> <input type="hidden" name="StockID' . $j .'" . value="' . $myrow['stockid'] . '" /> </tr>'; $j++; @@ -1141,7 +1139,7 @@ prnMsg( _('Only the first') . ' ' . $Maximum_Number_Of_Parts_To_Show . ' ' . _('can be displayed') . '. ' . _('Please restrict your search to only the parts required'),'info'); } - echo '<a name="end"></a><br /><div class="centre"><input type="submit" name="NewItem" value="Order some"></div>'; + echo '<a name="end"></a><br /><div class="centre"><input type="submit" name="NewItem" value="Order some" /></div>'; }#end if SearchResults to show echo '</form>'; Modified: trunk/includes/phplot/phplot.php =================================================================== --- trunk/includes/phplot/phplot.php 2011-09-17 22:43:30 UTC (rev 4694) +++ trunk/includes/phplot/phplot.php 2011-09-18 01:22:23 UTC (rev 4695) @@ -2377,11 +2377,11 @@ /* * Format a floating-point number. - * This is like PHP's locale_number_format, but uses class variables for separators. + * This is like PHP's number_format, but uses class variables for separators. * The separators will default to locale-specific values, if available. * Note: This method should be 'protected', but is called from test script(s). */ - function locale_number_format($number, $decimals=0) + function number_format($number, $decimals=0) { if (!isset($this->decimal_point) || !isset($this->thousands_sep)) { // Load locale-specific values from environment, unless disabled: @@ -2399,7 +2399,7 @@ $this->thousands_sep = ','; } } - return locale_number_format($number, $decimals, $this->decimal_point, $this->thousands_sep); + return number_format($number, $decimals, $this->decimal_point, $this->thousands_sep); } /* @@ -3596,7 +3596,7 @@ break; case 'data': $which_lab = $format['prefix'] - . $this->locale_number_format($which_lab, $format['precision']) + . $this->number_format($which_lab, $format['precision']) . $this->data_units_text // Obsolete . $format['suffix']; break; @@ -4533,7 +4533,7 @@ else $slicecol = $this->ndx_data_dark_colors[$color_index]; - $label_txt = $this->locale_number_format(($val / $total * 100), $precision) . '%'; + $label_txt = $this->number_format(($val / $total * 100), $precision) . '%'; $val = 360 * ($val / $total); // NOTE that imagefilledarc measures angles CLOCKWISE (go figure why), Modified: trunk/includes/tcpdf/tcpdf.php =================================================================== --- trunk/includes/tcpdf/tcpdf.php 2011-09-17 22:43:30 UTC (rev 4694) +++ trunk/includes/tcpdf/tcpdf.php 2011-09-18 01:22:23 UTC (rev 4695) @@ -11772,7 +11772,7 @@ * @since 4.2.005 (2008-11-06) */ protected function formatPageNumber($num) { - return locale_number_format((float)$num, 0, '', '.'); + return number_format((float)$num, 0, '', '.'); } /** @@ -11784,7 +11784,7 @@ * @see addTOC() */ protected function formatTOCPageNumber($num) { - return locale_number_format((float)$num, 0, '', '.'); + return number_format((float)$num, 0, '', '.'); } /** This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <dai...@us...> - 2011-09-18 01:22:31
|
Revision: 4695 http://web-erp.svn.sourceforge.net/web-erp/?rev=4695&view=rev Author: daintree Date: 2011-09-18 01:22:23 +0000 (Sun, 18 Sep 2011) Log Message: ----------- number_formats Modified Paths: -------------- trunk/CounterSales.php trunk/Numbers/Words/lang.bg.php trunk/Numbers/Words/lang.fr.php trunk/Numbers/Words/lang.fr_BE.php trunk/PO_Items.php trunk/includes/phplot/phplot.php trunk/includes/tcpdf/tcpdf.php Modified: trunk/CounterSales.php =================================================================== --- trunk/CounterSales.php 2011-09-17 22:43:30 UTC (rev 4694) +++ trunk/CounterSales.php 2011-09-18 01:22:23 UTC (rev 4695) @@ -488,7 +488,7 @@ if (abs($OrderLine->Price - filter_number_format($_POST['Price_' . $OrderLine->LineNumber]))>0.01){ $Price = filter_number_format($_POST['Price_' . $OrderLine->LineNumber]); - $_POST['GPPercent_' . $OrderLine->LineNumber] = (($Price*(1-(filter_number_format($_POST['Discount_' . $OrderLine->LineNumber])/100))) - $OrderLine->StandardCost*$ExRate)/($Price *(1-filter_number_format($_POST['Discount_' . $OrderLine->LineNumber]))/100); + $_POST['GPPercent_' . $OrderLine->LineNumber] = filter_number_format((($Price*(1-(filter_number_format($_POST['Discount_' . $OrderLine->LineNumber])/100))) - $OrderLine->StandardCost*$ExRate)/($Price *(1-filter_number_format($_POST['Discount_' . $OrderLine->LineNumber]))/100)); } else if (abs($OrderLine->GPPercent - filter_number_format($_POST['GPPercent_' . $OrderLine->LineNumber]))>=0.001) { //then do a recalculation of the price at this new GP Percentage $Price = ($OrderLine->StandardCost*$ExRate)/(1 -((filter_number_format($_POST['GPPercent_' . $OrderLine->LineNumber]) + filter_number_format($_POST['Discount_' . $OrderLine->LineNumber]))/100)); @@ -509,16 +509,16 @@ if ($Quantity<0 or $Price <0 or $DiscountPercentage >100 or $DiscountPercentage <0){ prnMsg(_('The item could not be updated because you are attempting to set the quantity ordered to less than 0 or the price less than 0 or the discount more than 100% or less than 0%'),'warn'); } else if ($OrderLine->Quantity !=$Quantity - or $OrderLine->Price != $Price - or abs($OrderLine->DiscountPercent -$DiscountPercentage/100) >0.001 - or $OrderLine->Narrative != $Narrative - or $OrderLine->ItemDue != $_POST['ItemDue_' . $OrderLine->LineNumber] - or $OrderLine->POLine != $_POST['POLine_' . $OrderLine->LineNumber]) { + OR $OrderLine->Price != $Price + OR abs($OrderLine->DiscountPercent -$DiscountPercentage/100) >0.001 + OR $OrderLine->Narrative != $Narrative + OR $OrderLine->ItemDue != $_POST['ItemDue_' . $OrderLine->LineNumber] + OR $OrderLine->POLine != $_POST['POLine_' . $OrderLine->LineNumber]) { $_SESSION['Items'.$identifier]->update_cart_item($OrderLine->LineNumber, $Quantity, $Price, - ($DiscountPercentage/100), + filter_number_format($DiscountPercentage/100), $Narrative, 'Yes', /*Update DB */ $_POST['ItemDue_' . $OrderLine->LineNumber], @@ -1889,7 +1889,7 @@ '" . $BankAccountExRate . "', '" . $DefaultDispatchDate . "', '" . $_POST['PaymentMethod'] . "', - '" . (filter_number_format($_POST['AmountPaid']) * $BankAccountExRate) . "', + '" . filter_number_format(filter_number_format($_POST['AmountPaid']) * $BankAccountExRate) . "', '" . $_SESSION['Items'.$identifier]->DefaultCurrency . "')"; $DbgMsg = _('The SQL that failed to insert the bank account transaction was'); Modified: trunk/Numbers/Words/lang.bg.php =================================================================== --- trunk/Numbers/Words/lang.bg.php 2011-09-17 22:43:30 UTC (rev 4694) +++ trunk/Numbers/Words/lang.bg.php 2011-09-18 01:22:23 UTC (rev 4695) @@ -318,7 +318,7 @@ return $ret; } else - return explode(' ', locale_number_format($num, 0, '', ' ')); // a faster version for integers + return explode(' ', number_format($num, 0, '', ' ')); // a faster version for integers } // }}} Modified: trunk/Numbers/Words/lang.fr.php =================================================================== --- trunk/Numbers/Words/lang.fr.php 2011-09-17 22:43:30 UTC (rev 4694) +++ trunk/Numbers/Words/lang.fr.php 2011-09-18 01:22:23 UTC (rev 4695) @@ -271,7 +271,7 @@ return $ret; } else - return explode(' ', locale_number_format($num, 0, '', ' ')); // a faster version for integers + return explode(' ', number_format($num, 0, '', ' ')); // a faster version for integers } // }}} Modified: trunk/Numbers/Words/lang.fr_BE.php =================================================================== --- trunk/Numbers/Words/lang.fr_BE.php 2011-09-17 22:43:30 UTC (rev 4694) +++ trunk/Numbers/Words/lang.fr_BE.php 2011-09-18 01:22:23 UTC (rev 4695) @@ -275,7 +275,7 @@ return $ret; } else - return explode(' ', locale_number_format($num, 0, '', ' ')); // a faster version for integers + return explode(' ', number_format($num, 0, '', ' ')); // a faster version for integers } // }}} Modified: trunk/PO_Items.php =================================================================== --- trunk/PO_Items.php 2011-09-17 22:43:30 UTC (rev 4694) +++ trunk/PO_Items.php 2011-09-18 01:22:23 UTC (rev 4695) @@ -33,21 +33,21 @@ if (isset($_POST['UpdateLines']) OR isset($_POST['Commit'])) { foreach ($_SESSION['PO'.$identifier]->LineItems as $POLine) { if ($POLine->Deleted == false) { - if (!is_numeric($_POST['ConversionFactor'.$POLine->LineNo])){ + if (!is_numeric(filter_number_format($_POST['ConversionFactor'.$POLine->LineNo]))){ prnMsg(_('The conversion factor is expected to be numeric - the figure which converts from our units to the supplier units. e.g. if the supplier units is a tonne and our unit is a kilogram then the conversion factor that converts our unit to the suppliers unit is 1000'),'error'); $_SESSION['PO'.$identifier]->LineItems[$POLine->LineNo]->ConversionFactor = 1; } else { //a valid number for the conversion factor is entered - $_SESSION['PO'.$identifier]->LineItems[$POLine->LineNo]->ConversionFactor = $_POST['ConversionFactor'.$POLine->LineNo]; + $_SESSION['PO'.$identifier]->LineItems[$POLine->LineNo]->ConversionFactor = filter_number_format($_POST['ConversionFactor'.$POLine->LineNo]); } - if (!is_numeric($_POST['SuppQty'.$POLine->LineNo])){ + if (!is_numeric(filter_number_format($_POST['SuppQty'.$POLine->LineNo]))){ prnMsg(_('The quantity in the supplier units is expected to be numeric. Please re-enter as a number'),'error'); } else { //ok to update the PO object variables - $_SESSION['PO'.$identifier]->LineItems[$POLine->LineNo]->Quantity=round($_POST['SuppQty'.$POLine->LineNo]*$_SESSION['PO'.$identifier]->LineItems[$POLine->LineNo]->ConversionFactor,$_SESSION['PO'.$identifier]->LineItems[$POLine->LineNo]->DecimalPlaces); + $_SESSION['PO'.$identifier]->LineItems[$POLine->LineNo]->Quantity=filter_number_format(round(filter_number_format($_POST['SuppQty'.$POLine->LineNo])*filter_number_format($_SESSION['PO'.$identifier]->LineItems[$POLine->LineNo]->ConversionFactor),$_SESSION['PO'.$identifier]->LineItems[$POLine->LineNo]->DecimalPlaces)); } - if (!is_numeric($_POST['SuppPrice'.$POLine->LineNo])){ + if (!is_numeric(filter_number_format($_POST['SuppPrice'.$POLine->LineNo]))){ prnMsg(_('The supplier price is expected to be numeric. Please re-enter as a number'),'error'); } else { //ok to update the PO object variables - $_SESSION['PO'.$identifier]->LineItems[$POLine->LineNo]->Price=$_POST['SuppPrice'.$POLine->LineNo]/$_SESSION['PO'.$identifier]->LineItems[$POLine->LineNo]->ConversionFactor; + $_SESSION['PO'.$identifier]->LineItems[$POLine->LineNo]->Price=filter_number_format((filter_number_format($_POST['SuppPrice'.$POLine->LineNo])/filter_number_format($_SESSION['PO'.$identifier]->LineItems[$POLine->LineNo]->ConversionFactor)); } $_SESSION['PO'.$identifier]->LineItems[$POLine->LineNo]->ReqDelDate=$_POST['ReqDelDate'.$POLine->LineNo]; } @@ -166,22 +166,22 @@ '" . $_SESSION['PO'.$identifier]->Initiator . "', '" . $_SESSION['PO'.$identifier]->RequisitionNo . "', '" . $_SESSION['PO'.$identifier]->Location . "', - '" . $_SESSION['PO'.$identifier]->DelAdd1 . "', - '" . $_SESSION['PO'.$identifier]->DelAdd2 . "', - '" . $_SESSION['PO'.$identifier]->DelAdd3 . "', - '" . $_SESSION['PO'.$identifier]->DelAdd4 . "', - '" . $_SESSION['PO'.$identifier]->DelAdd5 . "', - '" . $_SESSION['PO'.$identifier]->DelAdd6 . "', - '" . $_SESSION['PO'.$identifier]->Tel . "', - '" . $_SESSION['PO'.$identifier]->SuppDelAdd1 . "', - '" . $_SESSION['PO'.$identifier]->SuppDelAdd2 . "', - '" . $_SESSION['PO'.$identifier]->SuppDelAdd3 . "', - '" . $_SESSION['PO'.$identifier]->SuppDelAdd4 . "', - '" . $_SESSION['PO'.$identifier]->SuppDelAdd5 . "', - '" . $_SESSION['PO'.$identifier]->SuppDelAdd6 . "', - '" . $_SESSION['PO'.$identifier]->SupplierContact . "', - '" . $_SESSION['PO'.$identifier]->SuppTel. "', - '" . $_SESSION['PO'.$identifier]->Contact . "', + '" . DB_escape_string($_SESSION['PO'.$identifier]->DelAdd1) . "', + '" . DB_escape_string($_SESSION['PO'.$identifier]->DelAdd2) . "', + '" . DB_escape_string($_SESSION['PO'.$identifier]->DelAdd3) . "', + '" . DB_escape_string($_SESSION['PO'.$identifier]->DelAdd4) . "', + '" . DB_escape_string($_SESSION['PO'.$identifier]->DelAdd5) . "', + '" . DB_escape_string($_SESSION['PO'.$identifier]->DelAdd6) . "', + '" . DB_escape_string($_SESSION['PO'.$identifier]->Tel) . "', + '" . DB_escape_string($_SESSION['PO'.$identifier]->SuppDelAdd1) . "', + '" . DB_escape_string($_SESSION['PO'.$identifier]->SuppDelAdd2) . "', + '" . DB_escape_string($_SESSION['PO'.$identifier]->SuppDelAdd3) . "', + '" . DB_escape_string($_SESSION['PO'.$identifier]->SuppDelAdd4) . "', + '" . DB_escape_string($_SESSION['PO'.$identifier]->SuppDelAdd5) . "', + '" . DB_escape_string($_SESSION['PO'.$identifier]->SuppDelAdd6) . "', + '" . DB_escape_string($_SESSION['PO'.$identifier]->SupplierContact) . "', + '" . DB_escape_string($_SESSION['PO'.$identifier]->SuppTel). "', + '" . DB_escape_string($_SESSION['PO'.$identifier]->Contact) . "', '" . $_SESSION['PO'.$identifier]->Version . "', '" . Date('Y-m-d') . "', '" . $_SESSION['PO'.$identifier]->DeliveryBy . "', @@ -198,7 +198,7 @@ /*Insert the purchase order detail records */ foreach ($_SESSION['PO'.$identifier]->LineItems as $POLine) { if ($POLine->Deleted==False) { - $sql = "INSERT INTO purchorderdetails ( orderno, + $sql = "INSERT INTO purchorderdetails (orderno, itemcode, deliverydate, itemdescription, @@ -214,7 +214,7 @@ VALUES ('" . $_SESSION['PO'.$identifier]->OrderNo . "', '" . $POLine->StockID . "', '" . FormatDateForSQL($POLine->ReqDelDate) . "', - '" . $POLine->ItemDescription . "', + '" . DB_escape_string($POLine->ItemDescription) . "', '" . $POLine->GLCode . "', '" . $POLine->Price . "', '" . $POLine->Quantity . "', @@ -254,7 +254,7 @@ /*Update the purchase order header with any changes */ $sql = "UPDATE purchorders SET supplierno = '" . $_SESSION['PO'.$identifier]->SupplierID . "' , - comments='" . $_SESSION['PO'.$identifier]->Comments . "', + comments='" . DB_escape_string($_SESSION['PO'.$identifier]->Comments) . "', rate='" . $_SESSION['PO'.$identifier]->ExRate . "', initiator='" . $_SESSION['PO'.$identifier]->Initiator . "', requisitionno= '" . $_SESSION['PO'.$identifier]->RequisitionNo . "', @@ -263,26 +263,26 @@ deliverydate='" . FormatDateForSQL($_SESSION['PO'.$identifier]->DeliveryDate) . "', revised= '" . Date('Y-m-d') . "', intostocklocation='" . $_SESSION['PO'.$identifier]->Location . "', - deladd1='" . $_SESSION['PO'.$identifier]->DelAdd1 . "', - deladd2='" . $_SESSION['PO'.$identifier]->DelAdd2 . "', - deladd3='" . $_SESSION['PO'.$identifier]->DelAdd3 . "', - deladd4='" . $_SESSION['PO'.$identifier]->DelAdd4 . "', - deladd5='" . $_SESSION['PO'.$identifier]->DelAdd5 . "', - deladd6='" . $_SESSION['PO'.$identifier]->DelAdd6 . "', - deladd6='" . $_SESSION['PO'.$identifier]->Tel . "', - suppdeladdress1='" . $_SESSION['PO'.$identifier]->SuppDelAdd1 . "', - suppdeladdress2='" . $_SESSION['PO'.$identifier]->SuppDelAdd2 . "', - suppdeladdress3='" . $_SESSION['PO'.$identifier]->SuppDelAdd3 . "', - suppdeladdress4='" . $_SESSION['PO'.$identifier]->SuppDelAdd4 . "', - suppdeladdress5='" . $_SESSION['PO'.$identifier]->SuppDelAdd5 . "', - suppdeladdress6='" . $_SESSION['PO'.$identifier]->SuppDelAdd6 . "', - suppliercontact='" . $_SESSION['PO'.$identifier]->SupplierContact . "', - supptel='" . $_SESSION['PO'.$identifier]->SuppTel . "', - contact='" . $_SESSION['PO'.$identifier]->Contact . "', + deladd1='" . DB_escape_string($_SESSION['PO'.$identifier]->DelAdd1) . "', + deladd2='" . DB_escape_string($_SESSION['PO'.$identifier]->DelAdd2) . "', + deladd3='" . DB_escape_string($_SESSION['PO'.$identifier]->DelAdd3) . "', + deladd4='" . DB_escape_string($_SESSION['PO'.$identifier]->DelAdd4) . "', + deladd5='" . DB_escape_string($_SESSION['PO'.$identifier]->DelAdd5) . "', + deladd6='" . DB_escape_string($_SESSION['PO'.$identifier]->DelAdd6) . "', + deladd6='" . DB_escape_string($_SESSION['PO'.$identifier]->Tel) . "', + suppdeladdress1='" . DB_escape_string($_SESSION['PO'.$identifier]->SuppDelAdd1) . "', + suppdeladdress2='" . DB_escape_string($_SESSION['PO'.$identifier]->SuppDelAdd2) . "', + suppdeladdress3='" . DB_escape_string($_SESSION['PO'.$identifier]->SuppDelAdd3) . "', + suppdeladdress4='" . DB_escape_string($_SESSION['PO'.$identifier]->SuppDelAdd4) . "', + suppdeladdress5='" . DB_escape_string($_SESSION['PO'.$identifier]->SuppDelAdd5) . "', + suppdeladdress6='" . DB_escape_string($_SESSION['PO'.$identifier]->SuppDelAdd6) . "', + suppliercontact='" . DB_escape_string($_SESSION['PO'.$identifier]->SupplierContact) . "', + supptel='" . DB_escape_string($_SESSION['PO'.$identifier]->SuppTel) . "', + contact='" . DB_escape_string($_SESSION['PO'.$identifier]->Contact) . "', paymentterms='" . $_SESSION['PO'.$identifier]->PaymentTerms . "', allowprint='" . $_SESSION['PO'.$identifier]->AllowPrintPO . "', status = '" . $_SESSION['PO'.$identifier]->Status . "', - stat_comment = '" . $_SESSION['PO'.$identifier]->StatusComments . "' + stat_comment = '" . DB_escape_string($_SESSION['PO'.$identifier]->StatusComments) . "' WHERE orderno = '" . $_SESSION['PO'.$identifier]->OrderNo ."'"; $ErrMsg = _('The purchase order could not be updated because'); @@ -321,7 +321,7 @@ '" . $_SESSION['PO'.$identifier]->OrderNo . "', '" . $POLine->StockID . "', '" . FormatDateForSQL($POLine->ReqDelDate) . "', - '" . $POLine->ItemDescription . "', + '" . DB_escape_string($POLine->ItemDescription) . "', '" . $POLine->GLCode . "', '" . $POLine->Price . "', '" . $POLine->Quantity . "', @@ -336,14 +336,14 @@ if ($POLine->Quantity==$POLine->QtyReceived){ $sql = "UPDATE purchorderdetails SET itemcode='" . $POLine->StockID . "', deliverydate ='" . FormatDateForSQL($POLine->ReqDelDate) . "', - itemdescription='" . $POLine->ItemDescription . "', + itemdescription='" . DB_escape_string($POLine->ItemDescription) . "', glcode='" . $POLine->GLCode . "', unitprice='" . $POLine->Price . "', quantityord='" . $POLine->Quantity . "', shiptref='" . $POLine->ShiptRef . "', jobref='" . $POLine->JobRef . "', suppliersunit='" . $POLine->SuppliersUnit . "', - suppliers_partno='" . $POLine->Suppliers_PartNo . "', + suppliers_partno='" . DB_escape_string($POLine->Suppliers_PartNo) . "', completed=1, assetid='" . $POLine->AssetID . "', conversionfactor = '" . $POLine->ConversionFactor . "' @@ -351,7 +351,7 @@ } else { $sql = "UPDATE purchorderdetails SET itemcode='" . $POLine->StockID . "', deliverydate ='" . FormatDateForSQL($POLine->ReqDelDate) . "', - itemdescription='" . $POLine->ItemDescription . "', + itemdescription='" . DB_escape_string($POLine->ItemDescription) . "', glcode='" . $POLine->GLCode . "', unitprice='" . $POLine->Price . "', quantityord='" . $POLine->Quantity . "', @@ -407,11 +407,11 @@ if (isset($_POST['EnterLine'])){ /*Inputs from the form directly without selecting a stock item from the search */ $AllowUpdate = true; /*always assume the best */ - if (!is_numeric($_POST['Qty'])){ + if (!is_numeric(filter_number_format($_POST['Qty']))){ $AllowUpdate = false; prnMsg( _('Cannot Enter this order line') . '<br />' . _('The quantity of the order item must be numeric'),'error'); } - if ($_POST['Qty']<0){ + if (filter_number_format($_POST['Qty'])<0){ $AllowUpdate = false; prnMsg( _('Cannot Enter this order line') . '<br />' . _('The quantity of the ordered item entered must be a positive amount'),'error'); } @@ -424,8 +424,6 @@ prnMsg( _('Cannot Enter this order line') . '</b><br />' . _('The date entered must be in the format') . ' ' . $_SESSION['DefaultDateFormat'], 'error'); } -// include ('PO_Chk_ShiptRef_JobRef.php'); - /*It's not a stock item */ /*need to check GL Code is valid if GLLink is active */ @@ -491,9 +489,9 @@ '', 0, /*Serialised */ 0, /*Controlled */ - $_POST['Qty'], + filter_number_format($_POST['Qty']), $_POST['ItemDescription'], - $_POST['Price'], + filter_number_format($_POST['Price']), $_POST['SuppliersUnit'], $_POST['GLCode'], $_POST['ReqDelDate'], @@ -526,7 +524,7 @@ foreach ($_POST as $FormVariableName => $Quantity) { /*The form entity name is of the format NewQtyX where X is the index number that identifies the stock item code held in the hidden StockIDX form variable * */ - if (mb_substr($FormVariableName, 0, 6)=='NewQty' AND $Quantity!=0) { //if the form variable represents a Qty to add to the order + if (mb_substr($FormVariableName, 0, 6)=='NewQty' AND filter_number_format($Quantity)!=0) { //if the form variable represents a Qty to add to the order $ItemCode = $_POST['StockID' . mb_substr($FormVariableName, 6)]; $AlreadyOnThisOrder = 0; @@ -544,7 +542,7 @@ } /* end of the foreach loop to look for preexisting items of the same code */ } } - if ($AlreadyOnThisOrder!=1 AND $Quantity > 0){ + if ($AlreadyOnThisOrder!=1 AND filter_number_format($Quantity) > 0){ $sql = "SELECT description, longdescription, stockid, @@ -588,7 +586,7 @@ $PurchDataResult = DB_query($sql,$db,$ErrMsg,$DbgMsg); if (DB_num_rows($PurchDataResult)>0){ //the purchasing data is set up $PurchRow = DB_fetch_array($PurchDataResult); - $PurchPrice = $PurchRow['price']/$PurchRow['conversionfactor']; + $PurchPrice = filter_number_format($PurchRow['price']/$PurchRow['conversionfactor']); $ConversionFactor = $PurchRow['conversionfactor']; $SupplierDescription = $PurchRow['suppliers_partno'] .' - '; if (mb_strlen($PurchRow['supplierdescription'])>2){ @@ -612,7 +610,7 @@ $ItemCode, 0, /*Serialised */ 0, /*Controlled */ - $Quantity*$ConversionFactor, /* Qty */ + filter_number_format((filter_number_format($Quantity)*$ConversionFactor), /* Qty */ $SupplierDescription, $PurchPrice, $ItemRow['units'], @@ -679,14 +677,14 @@ foreach ($_SESSION['PO'.$identifier]->LineItems as $POLine) { if ($POLine->Deleted==False) { - $LineTotal = $POLine->Quantity * $POLine->Price; - $DisplayLineTotal = locale_number_format($LineTotal,$_SESSION['PO'.$identifier]->CurrDecimalPlaces); + $LineTotal = filter_number_format($POLine->Quantity * $POLine->Price); + $DisplayLineTotal = locale_money_format($LineTotal,$_SESSION['PO'.$identifier]->CurrDecimalPlaces); // Note if the price is greater than 1 use 2 decimal place, if the price is a fraction of 1, use 4 decimal places // This should help display where item-price is a fraction if ($POLine->Price > 1) { - $DisplayPrice = locale_number_format($POLine->Price,$_SESSION['PO'.$identifier]->CurrDecimalPlaces); + $DisplayPrice = locale_money_format($POLine->Price,$_SESSION['PO'.$identifier]->CurrDecimalPlaces); } else { - $DisplayPrice = locale_number_format($POLine->Price,4); + $DisplayPrice = locale_money_format($POLine->Price,4); } if ($k==1){ @@ -703,9 +701,9 @@ <td>' . $POLine->Units . '</td> <td class="number">' . $DisplayPrice . '</td> <td><input type="text" class="number" name="ConversionFactor' . $POLine->LineNo .'" size="8" value="' . $POLine->ConversionFactor . '"></td> - <td><input type="text" class="number" name="SuppQty' . $POLine->LineNo .'" size="10" value="' . round($POLine->Quantity/$POLine->ConversionFactor,$POLine->DecimalPlaces) . '"></td> + <td><input type="text" class="number" name="SuppQty' . $POLine->LineNo .'" size="10" value="' . locale_locale_format(round($POLine->Quantity/$POLine->ConversionFactor,$POLine->DecimalPlaces),$POLine->DecimalPlaces) . '"></td> <td>' . $POLine->SuppliersUnit . '</td> - <td><input type="text" class="number" name="SuppPrice' . $POLine->LineNo . '" size="10" value="' . round(($POLine->Price *$POLine->ConversionFactor),$_SESSION['PO'.$identifier]->CurrDecimalPlaces) .'"></td> + <td><input type="text" class="number" name="SuppPrice' . $POLine->LineNo . '" size="10" value="' . locale_money_format(round(($POLine->Price *$POLine->ConversionFactor),$_SESSION['PO'.$identifier]->CurrDecimalPlaces),,$_SESSION['PO'.$identifier]->CurrDecimalPlaces) .'"></td> <td class="number">' . $DisplayLineTotal . '</td> <td><input type="text" class="date" alt="' .$_SESSION['DefaultDateFormat'].'" name="ReqDelDate' . $POLine->LineNo.'" size="10" value="' .$POLine->ReqDelDate .'"></td>'; if ($POLine->QtyReceived !=0 AND $POLine->Completed!=1){ @@ -718,7 +716,7 @@ } } - $DisplayTotal = locale_number_format($_SESSION['PO'.$identifier]->Total,$_SESSION['PO'.$identifier]->CurrDecimalPlaces); + $DisplayTotal = locale_money_format($_SESSION['PO'.$identifier]->Total,$_SESSION['PO'.$identifier]->CurrDecimalPlaces); echo '<tr><td colspan="9" class="number">' . _('TOTAL') . _(' excluding Tax') . '</td> <td class="number"><b>' . $DisplayTotal . '</b></td> </tr></table>'; @@ -764,13 +762,13 @@ echo'</select><a href="FixedAssetItems.php" target=_blank>'. _('New Fixed Asset') . '</a></td> <tr><td>'._('Quantity to purchase').'</td> - <td><input type="text" class="number" name="Qty" size="10" value="1"></td></tr> + <td><input type="text" class="number" name="Qty" size="10" value="1" /></td></tr> <tr><td>'._('Price per item').'</td> - <td><input type="text" class="number" name="Price" size="10"></td></tr> + <td><input type="text" class="number" name="Price" size="10" /></td></tr> <tr><td>'._('Unit').'</td> - <td><input type="text" name="SuppliersUnit" size="10" value="' . _('each') . '"></td></tr> + <td><input type="text" name="SuppliersUnit" size="10" value="' . _('each') . '" /></td></tr> <tr><td>'._('Delivery Date').'</td> - <td><input type="text" class="date" alt="'.$_SESSION['DefaultDateFormat'].'" name="ReqDelDate" size=11 value="'.$_SESSION['PO'.$identifier]->DeliveryDate .'"></td></tr>'; + <td><input type="text" class="date" alt="'.$_SESSION['DefaultDateFormat'].'" name="ReqDelDate" size=11 value="'.$_SESSION['PO'.$identifier]->DeliveryDate .'" /></td></tr>'; echo '</table>'; echo '<div class="centre"> <input type=submit name="EnterLine" value="Enter Item" /> @@ -1053,15 +1051,15 @@ } echo ' /></td> <td><font size="3"><b>' . _('OR') . ' </b></font>' . _('Enter extract of the Stock Code') . ':</td> - <td><input type="text" name="StockCode" size=15 maxlength=18 value="' . $_POST['StockCode'] . '"></td> + <td><input type="text" name="StockCode" size="15" maxlength="18" value="' . $_POST['StockCode'] . '" /></td> </tr> <tr><td></td> <td><font size=3><b>' . _('OR') . ' </b></font><a target="_blank" href="'.$rootpath.'/Stocks.php">' . _('Create a New Stock Item') . '</a></td></tr> </table> <br /> - <div class="centre"><input type="submit" name="Search" value="' . _('Search Now') . '"> - <input type="submit" name="NonStockOrder" value="' . _('Order a non stock item') . '"> + <div class="centre"><input type="submit" name="Search" value="' . _('Search Now') . '" /> + <input type="submit" name="NonStockOrder" value="' . _('Order a non stock item') . '" /> </div><br />'; $PartsDisplayed =0; @@ -1124,7 +1122,7 @@ <td class="number">' . $ConversionFactor .'</td> <td>' . $OrderUnits . '</td> <td>' . $ImageSource . '</td> - <td><input class="number" type="text" size="6" value="0" name="NewQty' . $j . '"></td> + <td><input class="number" type="text" size="6" value="0" name="NewQty' . $j . '" /></td> <input type="hidden" name="StockID' . $j .'" . value="' . $myrow['stockid'] . '" /> </tr>'; $j++; @@ -1141,7 +1139,7 @@ prnMsg( _('Only the first') . ' ' . $Maximum_Number_Of_Parts_To_Show . ' ' . _('can be displayed') . '. ' . _('Please restrict your search to only the parts required'),'info'); } - echo '<a name="end"></a><br /><div class="centre"><input type="submit" name="NewItem" value="Order some"></div>'; + echo '<a name="end"></a><br /><div class="centre"><input type="submit" name="NewItem" value="Order some" /></div>'; }#end if SearchResults to show echo '</form>'; Modified: trunk/includes/phplot/phplot.php =================================================================== --- trunk/includes/phplot/phplot.php 2011-09-17 22:43:30 UTC (rev 4694) +++ trunk/includes/phplot/phplot.php 2011-09-18 01:22:23 UTC (rev 4695) @@ -2377,11 +2377,11 @@ /* * Format a floating-point number. - * This is like PHP's locale_number_format, but uses class variables for separators. + * This is like PHP's number_format, but uses class variables for separators. * The separators will default to locale-specific values, if available. * Note: This method should be 'protected', but is called from test script(s). */ - function locale_number_format($number, $decimals=0) + function number_format($number, $decimals=0) { if (!isset($this->decimal_point) || !isset($this->thousands_sep)) { // Load locale-specific values from environment, unless disabled: @@ -2399,7 +2399,7 @@ $this->thousands_sep = ','; } } - return locale_number_format($number, $decimals, $this->decimal_point, $this->thousands_sep); + return number_format($number, $decimals, $this->decimal_point, $this->thousands_sep); } /* @@ -3596,7 +3596,7 @@ break; case 'data': $which_lab = $format['prefix'] - . $this->locale_number_format($which_lab, $format['precision']) + . $this->number_format($which_lab, $format['precision']) . $this->data_units_text // Obsolete . $format['suffix']; break; @@ -4533,7 +4533,7 @@ else $slicecol = $this->ndx_data_dark_colors[$color_index]; - $label_txt = $this->locale_number_format(($val / $total * 100), $precision) . '%'; + $label_txt = $this->number_format(($val / $total * 100), $precision) . '%'; $val = 360 * ($val / $total); // NOTE that imagefilledarc measures angles CLOCKWISE (go figure why), Modified: trunk/includes/tcpdf/tcpdf.php =================================================================== --- trunk/includes/tcpdf/tcpdf.php 2011-09-17 22:43:30 UTC (rev 4694) +++ trunk/includes/tcpdf/tcpdf.php 2011-09-18 01:22:23 UTC (rev 4695) @@ -11772,7 +11772,7 @@ * @since 4.2.005 (2008-11-06) */ protected function formatPageNumber($num) { - return locale_number_format((float)$num, 0, '', '.'); + return number_format((float)$num, 0, '', '.'); } /** @@ -11784,7 +11784,7 @@ * @see addTOC() */ protected function formatTOCPageNumber($num) { - return locale_number_format((float)$num, 0, '', '.'); + return number_format((float)$num, 0, '', '.'); } /** This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |