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/ContractCosting.php 2011-09-04 10:10:14 UTC (rev 4677) +++ trunk/ContractCosting.php 2011-09-05 10:10:57 UTC (rev 4678) @@ -94,8 +94,8 @@ <td>' . $Component->ItemDescription . '</td> <td class="number">' . $Component->Quantity . '</td> <td>' . $Component->UOM . '</td> - <td class="number">' . locale_number_format($Component->ItemCost,$_SESSION['CompanyRecord']['decimalplaces']) . '</td> - <td class="number">' . locale_number_format(($Component->ItemCost * $Component->Quantity),$_SESSION['CompanyRecord']['decimalplaces']) . '</td>'; + <td class="number">' . number_format($Component->ItemCost,$_SESSION['CompanyRecord']['decimalplaces']) . '</td> + <td class="number">' . number_format(($Component->ItemCost * $Component->Quantity),$_SESSION['CompanyRecord']['decimalplaces']) . '</td>'; $ContractBOMBudget += ($Component->ItemCost * $Component->Quantity); @@ -104,8 +104,8 @@ echo '<td colspan="2" align="center">' . _('Actual usage') . '</td> <td class="number">' . -$InventoryIssues[$Component->StockID]->Quantity . '</td> <td>' . $InventoryIssues[$Component->StockID]->Units . '</td> - <td class="number">' . locale_number_format($InventoryIssues[$Component->StockID]->TotalCost/$InventoryIssues[$Component->StockID]->Quantity,$_SESSION['CompanyRecord']['decimalplaces']) . '</td> - <td>' . locale_number_format(-$InventoryIssues[$Component->StockID]->TotalCost,$_SESSION['CompanyRecord']['decimalplaces']) . '</td> + <td class="number">' . number_format($InventoryIssues[$Component->StockID]->TotalCost/$InventoryIssues[$Component->StockID]->Quantity,$_SESSION['CompanyRecord']['decimalplaces']) . '</td> + <td>' . number_format(-$InventoryIssues[$Component->StockID]->TotalCost,$_SESSION['CompanyRecord']['decimalplaces']) . '</td> </tr>'; } else { echo '<td colspan="6"></td> @@ -122,17 +122,17 @@ <td>' . $Component->Description . '</td> <td class="number">' . -$Component->Quantity . '</td> <td>' . $Component->Units . '</td> - <td class="number">' . locale_number_format($Component->TotalCost/$Component->Quantity,$_SESSION['CompanyRecord']['decimalplaces']) . '</td> - <td class="number">' . locale_number_format(-$Component->TotalCost,$_SESSION['CompanyRecord']['decimalplaces']) . '</td> + <td class="number">' . number_format($Component->TotalCost/$Component->Quantity,$_SESSION['CompanyRecord']['decimalplaces']) . '</td> + <td class="number">' . number_format(-$Component->TotalCost,$_SESSION['CompanyRecord']['decimalplaces']) . '</td> </tr>'; } //end if its a component not originally budget for } echo '<tr> <td class="number" colspan="5">' . _('Total Inventory Budgeted Cost') . ':</td> - <td class="number">' . locale_number_format($ContractBOMBudget,$_SESSION['CompanyRecord']['decimalplaces']) . '</td> + <td class="number">' . number_format($ContractBOMBudget,$_SESSION['CompanyRecord']['decimalplaces']) . '</td> <td class="number" colspan="5">' . _('Total Inventory Actual Cost') . ':</td> - <td class="number">' . locale_number_format($ContractBOMActual,$_SESSION['CompanyRecord']['decimalplaces']) . '</td> + <td class="number">' . number_format($ContractBOMActual,$_SESSION['CompanyRecord']['decimalplaces']) . '</td> </tr>'; echo '<tr> @@ -154,11 +154,11 @@ echo '<tr><td>' . $Requirement->Requirement . '</td> <td class="number">' . $Requirement->Quantity . '</td> <td class="number">' . $Requirement->CostPerUnit . '</td> - <td class="number">' . locale_number_format(($Requirement->CostPerUnit * $Requirement->Quantity),$_SESSION['CompanyRecord']['decimalplaces']) . '</td> + <td class="number">' . number_format(($Requirement->CostPerUnit * $Requirement->Quantity),$_SESSION['CompanyRecord']['decimalplaces']) . '</td> </tr>'; $OtherReqtsBudget += ($Requirement->CostPerUnit * $Requirement->Quantity); } -echo '<tr><th colspan="3" align="right"><b>' . _('Budgeted Other Costs') . '</b></th><th class="number"><b>' . locale_number_format($OtherReqtsBudget,2) . '</b></th></tr> +echo '<tr><th colspan="3" align="right"><b>' . _('Budgeted Other Costs') . '</b></th><th class="number"><b>' . number_format($OtherReqtsBudget,2) . '</b></th></tr> </table></td>'; //Now other requirements actual in a sub table @@ -197,17 +197,17 @@ <td>' . $OtherChargesRow['suppreference'] . '</td> <td>' .ConvertSQLDate($OtherChargesRow['trandate']) . '</td> <td>' . $OtherChargesRow['narrative'] . '</td> - <td class="number">' . locale_number_format($OtherChargesRow['amount'],$_SESSION['CompanyRecord']['decimalplaces']) . '</td> + <td class="number">' . number_format($OtherChargesRow['amount'],$_SESSION['CompanyRecord']['decimalplaces']) . '</td> <td>' . $Anticipated . '</td> </tr>'; $OtherReqtsActual +=$OtherChargesRow['amount']; } -echo '<tr><th colspan="4" align="right"><b>' . _('Actual Other Costs') . '</b></th><th class="number"><b>' . locale_number_format($OtherReqtsActual,$_SESSION['CompanyRecord']['decimalplaces']) . '</b></th></tr> +echo '<tr><th colspan="4" align="right"><b>' . _('Actual Other Costs') . '</b></th><th class="number"><b>' . number_format($OtherReqtsActual,$_SESSION['CompanyRecord']['decimalplaces']) . '</b></th></tr> </table></td></tr>'; echo '<tr><td colspan="5"><b>' . _('Total Budget Contract Cost') . '</b></td> - <td class="number"><b>' . locale_number_format($OtherReqtsBudget+$ContractBOMBudget,$_SESSION['CompanyRecord']['decimalplaces']) . '</b></td> + <td class="number"><b>' . number_format($OtherReqtsBudget+$ContractBOMBudget,$_SESSION['CompanyRecord']['decimalplaces']) . '</b></td> <td colspan="5"><b>' . _('Total Actual Contract Cost') . '</b></td> - <td class="number"><b>' . locale_number_format($OtherReqtsActual+$ContractBOMActual,$_SESSION['CompanyRecord']['decimalplaces']) . '</b></td></tr>'; + <td class="number"><b>' . number_format($OtherReqtsActual+$ContractBOMActual,$_SESSION['CompanyRecord']['decimalplaces']) . '</b></td></tr>'; echo '</table>'; @@ -378,7 +378,7 @@ '" . Date('Y-m-d') . "', '" . $PeriodNo . "', '" . $GLCodes['stockact'] . "', - '" . $_SESSION['Contract'.$identifier]->WO . ' ' . $_SESSION['Contract'.$identifier]->ContractRef . ' - x 1 @ ' . locale_number_format(($OtherReqtsBudget+$ContractBOMBudget),2) . "', + '" . $_SESSION['Contract'.$identifier]->WO . ' ' . $_SESSION['Contract'.$identifier]->ContractRef . ' - x 1 @ ' . number_format(($OtherReqtsBudget+$ContractBOMBudget),2) . "', '" . ($OtherReqtsBudget+$ContractBOMBudget) . "')"; $ErrMsg = _('CRITICAL ERROR') . '! ' . _('NOTE DOWN THIS ERROR AND SEEK ASSISTANCE') . ': ' . _('The receipt of contract work order finished stock GL posting could not be inserted because'); @@ -398,7 +398,7 @@ '" . Date('Y-m-d') . "', '" . $PeriodNo . "', '" . $GLCodes['wipact'] . "', - '" . $_SESSION['Contract'.$identifier]->WO . ' ' . $_SESSION['Contract'.$identifier]->ContractRef . ' - x 1 @ ' . locale_number_format(($OtherReqtsBudget+$ContractBOMBudget),2) . "', + '" . $_SESSION['Contract'.$identifier]->WO . ' ' . $_SESSION['Contract'.$identifier]->ContractRef . ' - x 1 @ ' . number_format(($OtherReqtsBudget+$ContractBOMBudget),2) . "', '" . -($OtherReqtsBudget+$ContractBOMBudget) . "')"; $ErrMsg = _('CRITICAL ERROR') . '! ' . _('NOTE DOWN THIS ERROR AND SEEK ASSISTANCE') . ': ' . _('The WIP credit on receipt of finished items from a work order GL posting could not be inserted because'); Modified: trunk/ContractOtherReqts.php =================================================================== --- trunk/ContractOtherReqts.php 2011-09-04 10:10:14 UTC (rev 4677) +++ trunk/ContractOtherReqts.php 2011-09-05 10:10:57 UTC (rev 4678) @@ -100,7 +100,7 @@ foreach ($_SESSION['Contract'.$identifier]->ContractReqts as $ContractReqtID => $ContractComponent) { $LineTotal = $ContractComponent->Quantity * $ContractComponent->CostPerUnit; - $DisplayLineTotal = locale_number_format($LineTotal,$_SESSION['CompanyRecord']['decimalplaces']); + $DisplayLineTotal = number_format($LineTotal,$_SESSION['CompanyRecord']['decimalplaces']); if ($k==1){ echo '<tr class="EvenTableRows">'; @@ -118,7 +118,7 @@ $TotalCost += $LineTotal; } - $DisplayTotal = locale_number_format($TotalCost,2); + $DisplayTotal = number_format($TotalCost,2); echo '<tr><td colspan="4" class="number">' . _('Total Other Requirements Cost') . '</td><td class="number"><b>' . $DisplayTotal . '</b></td></tr></table>'; echo '<br /><div class="centre"><input type="submit" name="UpdateLines" value="' . _('Update Other Requirements Lines') . '" />'; echo ' <input type="submit" name="BackToHeader" value="' . _('Back To Contract Header') . '" /></div>'; Modified: trunk/Contracts.php =================================================================== --- trunk/Contracts.php 2011-09-04 10:10:14 UTC (rev 4677) +++ trunk/Contracts.php 2011-09-05 10:10:57 UTC (rev 4678) @@ -946,14 +946,14 @@ <td>' . $Component->ItemDescription . '</td> <td class="number">' . $Component->Quantity . '</td> <td>' . $Component->UOM . '</td> - <td class="number">' . locale_number_format($Component->ItemCost,2) . '</td> - <td class="number">' . locale_number_format(($Component->ItemCost * $Component->Quantity),2) . '</td> + <td class="number">' . number_format($Component->ItemCost,2) . '</td> + <td class="number">' . number_format(($Component->ItemCost * $Component->Quantity),2) . '</td> </tr>'; $ContractBOMCost += ($Component->ItemCost * $Component->Quantity); } echo '<tr> <th colspan="5"><b>' . _('Total stock cost') . '</b></th> - <th class="number"><b>' . locale_number_format($ContractBOMCost,2) . '</b></th> + <th class="number"><b>' . number_format($ContractBOMCost,2) . '</b></th> </tr>'; } else { //there are no items set up against this contract echo '<tr> @@ -979,11 +979,11 @@ <td>' . $Requirement->Requirement . '</td> <td class="number">' . $Requirement->Quantity . '</td> <td class="number">' . $Requirement->CostPerUnit . '</td> - <td class="number">' . locale_number_format(($Requirement->CostPerUnit * $Requirement->Quantity),2) . '</td> + <td class="number">' . number_format(($Requirement->CostPerUnit * $Requirement->Quantity),2) . '</td> </tr>'; $ContractReqtsCost += ($Requirement->CostPerUnit * $Requirement->Quantity); } - echo '<tr><th colspan="3"><b>' . _('Total other costs') . '</b></th><th class="number"><b>' . locale_number_format($ContractReqtsCost,2) . '</b></th></tr>'; + echo '<tr><th colspan="3"><b>' . _('Total other costs') . '</b></th><th class="number"><b>' . number_format($ContractReqtsCost,2) . '</b></th></tr>'; } else { //there are no items set up against this contract echo '<tr><td colspan="4"><i>' . _('None Entered') . '</i></td></tr>'; } @@ -991,9 +991,9 @@ echo '<br />'; echo'<table class="selection"> <tr><th>' . _('Total Contract Cost') . '</th> - <th class="number">' . locale_number_format(($ContractBOMCost+$ContractReqtsCost),$_SESSION['CompanyRecord']['decimalplaces']) . '</th> + <th class="number">' . number_format(($ContractBOMCost+$ContractReqtsCost),$_SESSION['CompanyRecord']['decimalplaces']) . '</th> <th>' . _('Contract Price') . '</th> - <th class="number">' . locale_number_format(($ContractBOMCost+$ContractReqtsCost)/((100-$_SESSION['Contract'.$identifier]->Margin)/100),$_SESSION['CompanyRecord']['decimalplaces']) . '</th> + <th class="number">' . number_format(($ContractBOMCost+$ContractReqtsCost)/((100-$_SESSION['Contract'.$identifier]->Margin)/100),$_SESSION['CompanyRecord']['decimalplaces']) . '</th> </tr> </table>'; Modified: trunk/CounterSales.php =================================================================== --- trunk/CounterSales.php 2011-09-04 10:10:14 UTC (rev 4677) +++ trunk/CounterSales.php 2011-09-05 10:10:57 UTC (rev 4678) @@ -333,7 +333,7 @@ if (!isset($Offset) or $Offset<0) { $Offset=0; } - $SQL = $SQL . ' LIMIT ' . $_SESSION['DefaultDisplayRecordsMax'].' OFFSET '.locale_number_format($_SESSION['DefaultDisplayRecordsMax']*$Offset); + $SQL = $SQL . ' LIMIT ' . $_SESSION['DefaultDisplayRecordsMax'].' OFFSET '.number_format($_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'); @@ -740,7 +740,7 @@ foreach ($_SESSION['Items'.$identifier]->LineItems as $OrderLine) { $SubTotal = $OrderLine->Quantity * $OrderLine->Price * (1 - $OrderLine->DiscountPercent); - $DisplayDiscount = locale_number_format(($OrderLine->DiscountPercent * 100),2); + $DisplayDiscount = number_format(($OrderLine->DiscountPercent * 100),2); $QtyOrdered = $OrderLine->Quantity; $QtyRemain = $QtyOrdered - $OrderLine->QtyInv; @@ -771,7 +771,7 @@ 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 class="number">' . locale_number_format($SubTotal,$_SESSION['Items'.$identifier]->CurrDecimalPlaces) . '</td>'; + echo '<td class="number">' . number_format($SubTotal,$_SESSION['Items'.$identifier]->CurrDecimalPlaces) . '</td>'; $LineDueDate = $OrderLine->ItemDue; if (!Is_Date($OrderLine->ItemDue)){ $LineDueDate = DateAdd (Date($_SESSION['DefaultDateFormat']),'d', $_SESSION['Items'.$identifier]->DeliveryDays); @@ -797,8 +797,8 @@ $TaxTotal += $TaxLineTotal; $_SESSION['Items'.$identifier]->TaxTotals=$TaxTotals; $_SESSION['Items'.$identifier]->TaxGLCodes=$TaxGLCodes; - echo '<td class="number">' . locale_number_format($TaxLineTotal ,$_SESSION['Items'.$identifier]->CurrDecimalPlaces) . '</td>'; - echo '<td class="number">' . locale_number_format($SubTotal + $TaxLineTotal ,$_SESSION['Items'.$identifier]->CurrDecimalPlaces) . '</td>'; + echo '<td class="number">' . number_format($TaxLineTotal ,$_SESSION['Items'.$identifier]->CurrDecimalPlaces) . '</td>'; + echo '<td class="number">' . number_format($SubTotal + $TaxLineTotal ,$_SESSION['Items'.$identifier]->CurrDecimalPlaces) . '</td>'; echo '<td><a href="' . $_SERVER['PHP_SELF'] . '?identifier='.$identifier . '&Delete=' . $OrderLine->LineNumber . '" onclick="return confirm(\'' . _('Are You Sure?') . '\');">' . _('Delete') . '</a></td></tr>'; if ($_SESSION['AllowOrderLineItemNarrative'] == 1){ @@ -815,9 +815,9 @@ } /* end of loop around items */ echo '<tr class="EvenTableRows"><td colspan="8" class="number"><b>' . _('Total') . '</b></td> - <td class="number">' . locale_number_format(($_SESSION['Items'.$identifier]->total),$_SESSION['Items'.$identifier]->CurrDecimalPlaces) . '</td> - <td class="number">' . locale_number_format($TaxTotal,$_SESSION['Items'.$identifier]->CurrDecimalPlaces) . '</td> - <td class="number">' . locale_number_format(($_SESSION['Items'.$identifier]->total+$TaxTotal),$_SESSION['Items'.$identifier]->CurrDecimalPlaces) . '</td> + <td class="number">' . number_format(($_SESSION['Items'.$identifier]->total),$_SESSION['Items'.$identifier]->CurrDecimalPlaces) . '</td> + <td class="number">' . number_format($TaxTotal,$_SESSION['Items'.$identifier]->CurrDecimalPlaces) . '</td> + <td class="number">' . number_format(($_SESSION['Items'.$identifier]->total+$TaxTotal),$_SESSION['Items'.$identifier]->CurrDecimalPlaces) . '</td> </tr> </table>'; echo '<input type="hidden" name="TaxTotal" value="'.$TaxTotal.'" />'; @@ -2095,7 +2095,7 @@ <td style="text-align:center">%s</td> <td style="text-align:center">%s</td> <td style="text-align:center">%s</td> - <td><font size=1><input class="number" tabindex="'.locale_number_format($j+7).'" type="textbox" size="6" name="itm%s" value="0" /> + <td><font size=1><input class="number" tabindex="'.number_format($j+7).'" type="textbox" size="6" name="itm%s" value="0" /> </td> </tr>', $myrow['stockid'], @@ -2113,7 +2113,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="OrderItems" value="1" /><input tabindex='.locale_number_format($j+8).' type="submit" value="'._('Add to Sale').'" /></td>'; + echo '<td style="text-align:center" colspan="8"><input type="hidden" name="OrderItems" value="1" /><input tabindex='.number_format($j+8).' type="submit" value="'._('Add to Sale').'" /></td>'; echo '</table>'; } //end of if Frequently Ordered Items > 0 if (isset($msg)){ @@ -2176,9 +2176,9 @@ echo '<form action="' . $_SERVER['PHP_SELF'] . '?' . SID .'identifier='.$identifier . '" method="post" name="orderform">'; echo '<input type="hidden" name="FormID" value="' . $_SESSION['FormID'] . '" />'; echo '<table class="table1">'; - echo '<tr><td><input type="hidden" name="previous" value="'.locale_number_format($Offset-1).'" /><input tabindex="'.locale_number_format($j+7).'" type="submit" name="Prev" value="'._('Prev').'" /></td>'; - echo '<td style="text-align:center" colspan="6"><input type="hidden" name="OrderItems" value="1" /><input tabindex="'.locale_number_format($j+8).'" type="submit" value="'._('Add to Sale').'" /></td>'; - echo '<td><input type="hidden" name="NextList" value="'.locale_number_format($Offset+1).'" /><input tabindex="'.locale_number_format($j+9).'" type="submit" name="Next" value="'._('Next').'" /></td></tr>'; + 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="OrderItems" value="1" /><input tabindex="'.number_format($j+8).'" type="submit" value="'._('Add to Sale').'" /></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>'; $TableHeader = '<tr><th>' . _('Code') . '</th> <th>' . _('Description') . '</th> <th>' . _('Units') . '</th> @@ -2272,15 +2272,15 @@ <td class="number">%s</td> <td class="number">%s</td> <td class="number">%s</td> - <td><font size="1"><input class="number" tabindex="'.locale_number_format($j+7).'" type="textbox" size="6" name="itm%s" value="0" /></font></td> + <td><font size="1"><input class="number" tabindex="'.number_format($j+7).'" type="textbox" size="6" name="itm%s" value="0" /></font></td> </tr>', $myrow['stockid'], $myrow['description'], $myrow['units'], - locale_number_format($QOH, $QOHRow['decimalplaces']), - locale_number_format($DemandQty, $QOHRow['decimalplaces']), - locale_number_format($OnOrder, $QOHRow['decimalplaces']), - locale_number_format($Available, $QOHRow['decimalplaces']), + number_format($QOH, $QOHRow['decimalplaces']), + number_format($DemandQty, $QOHRow['decimalplaces']), + number_format($OnOrder, $QOHRow['decimalplaces']), + number_format($Available, $QOHRow['decimalplaces']), $myrow['stockid']); if ($j==1) { $jsCall = '<script type="text/javascript">if (document.SelectParts) {defaultControl(document.SelectParts.itm'.$myrow['stockid'].');}</script>'; @@ -2295,9 +2295,9 @@ echo '<input type="hidden" name="PhoneNo" value="'.$_SESSION['Items'.$identifier]->PhoneNo.'" />'; echo '<input type="hidden" name="Email" value="'.$_SESSION['Items'.$identifier]->Email.'" />'; - echo '<tr><td><input type="hidden" name="previous" value="'.locale_number_format($Offset-1).'" /><input tabindex="'.locale_number_format($j+7).'" type="submit" name="Prev" value="'._('Prev').'" /></td>'; - echo '<td style="text-align:center" colspan="6"><input type="hidden" name="OrderItems" value="1" /><input tabindex="'.locale_number_format($j+8).'" type="submit" value="'._('Add to Sale').'" /></td>'; - echo '<td><input type="hidden" name="NextList" value="'.locale_number_format($Offset+1).'" /><input tabindex="'.locale_number_format($j+9).'" type="submit" name="Next" value="'._('Next').'" /></td></tr>'; + 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="OrderItems" value="1" /><input tabindex="'.number_format($j+8).'" type="submit" value="'._('Add to Sale').'" /></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 '</table></form>'; echo $jsCall; Modified: trunk/Credit_Invoice.php =================================================================== --- trunk/Credit_Invoice.php 2011-09-04 10:10:14 UTC (rev 4677) +++ trunk/Credit_Invoice.php 2011-09-05 10:10:57 UTC (rev 4678) @@ -310,7 +310,7 @@ echo '<tr '.$RowStarter.'><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>'; if ($LnItm->Controlled==1){ @@ -323,7 +323,7 @@ } - $DisplayLineTotal = locale_number_format($LineTotal,$_SESSION['CreditItems']->CurrDecimalPlaces); + $DisplayLineTotal = number_format($LineTotal,$_SESSION['CreditItems']->CurrDecimalPlaces); $j++; echo '<td><input tabindex=' . $j . ' type="text" class=number name="Price_' . $LnItm->LineNumber . '" maxlength=12 size=6 value=' . $LnItm->Price . '></td> @@ -370,8 +370,8 @@ } $TaxTotal += $TaxLineTotal; - $DisplayTaxAmount = locale_number_format($TaxLineTotal ,$_SESSION['CreditItems']->CurrDecimalPlaces); - $DisplayGrossLineTotal = locale_number_format($LineTotal+ $TaxLineTotal,$_SESSION['CreditItems']->CurrDecimalPlaces); + $DisplayTaxAmount = number_format($TaxLineTotal ,$_SESSION['CreditItems']->CurrDecimalPlaces); + $DisplayGrossLineTotal = number_format($LineTotal+ $TaxLineTotal,$_SESSION['CreditItems']->CurrDecimalPlaces); if (!isset($_POST['ProcessCredit'])) { echo '</td>'; @@ -392,7 +392,7 @@ if (!isset($_POST['ProcessCredit'])) { echo '<tr> <td colspan=3 class=number>' . _('Freight cost charged on invoice') . '</td> - <td class=number>' . locale_number_format($_SESSION['Old_FreightCost'],$_SESSION['CreditItems']->CurrDecimalPlaces) . '</td> + <td class=number>' . number_format($_SESSION['Old_FreightCost'],$_SESSION['CreditItems']->CurrDecimalPlaces) . '</td> <td></td> <td colspan=2 class=number>' . _('Credit Freight Cost') . '</td> <td><input tabindex='.$j.' type="text" class="number" size=6 maxlength=6 name="ChargeFreightCost" value="' . $_SESSION['CreditItems']->FreightCost . '"></td>'; @@ -433,21 +433,21 @@ if (!isset($_POST['ProcessCredit'])) { echo '</td>'; - echo '<td class="number">' . locale_number_format($FreightTaxTotal,$_SESSION['CreditItems']->CurrDecimalPlaces) . '</td> - <td class="number">' . locale_number_format($FreightTaxTotal+ $_SESSION['CreditItems']->FreightCost,$_SESSION['CreditItems']->CurrDecimalPlaces) . '</td> + echo '<td class="number">' . number_format($FreightTaxTotal,$_SESSION['CreditItems']->CurrDecimalPlaces) . '</td> + <td class="number">' . number_format($FreightTaxTotal+ $_SESSION['CreditItems']->FreightCost,$_SESSION['CreditItems']->CurrDecimalPlaces) . '</td> </tr>'; } $TaxTotal += $FreightTaxTotal; -$DisplayTotal = locale_number_format($_SESSION['CreditItems']->total + $_SESSION['CreditItems']->FreightCost,$_SESSION['CreditItems']->CurrDecimalPlaces); +$DisplayTotal = number_format($_SESSION['CreditItems']->total + $_SESSION['CreditItems']->FreightCost,$_SESSION['CreditItems']->CurrDecimalPlaces); if (!isset($_POST['ProcessCredit'])) { echo '<tr> <td colspan=7 class=number>' . _('Credit Totals') . '</td> <td class=number><hr><b>' . $DisplayTotal . '</b><hr></td> <td colspan=2></td> - <td class=number><hr><b>' . locale_number_format($TaxTotal,$_SESSION['CreditItems']->CurrDecimalPlaces) . '<hr></td> - <td class=number><hr><b>' . locale_number_format($TaxTotal+($_SESSION['CreditItems']->total + $_SESSION['CreditItems']->FreightCost),$_SESSION['CreditItems']->CurrDecimalPlaces) . '</b><hr></td> + <td class=number><hr><b>' . number_format($TaxTotal,$_SESSION['CreditItems']->CurrDecimalPlaces) . '<hr></td> + <td class=number><hr><b>' . number_format($TaxTotal+($_SESSION['CreditItems']->total + $_SESSION['CreditItems']->FreightCost),$_SESSION['CreditItems']->CurrDecimalPlaces) . '</b><hr></td> </tr></table>'; } $DefaultDispatchDate = Date($_SESSION['DefaultDateFormat']); Modified: trunk/Currencies.php =================================================================== --- trunk/Currencies.php 2011-09-04 10:10:14 UTC (rev 4677) +++ trunk/Currencies.php 2011-09-05 10:10:57 UTC (rev 4678) @@ -262,8 +262,8 @@ $myrow['country'], $myrow['hundredsname'], $myrow['decimalplaces'], - locale_number_format($myrow['rate'],5), - locale_number_format(GetCurrencyRate($myrow['currabrev'],$CurrencyRatesArray),5), + number_format($myrow['rate'],5), + number_format(GetCurrencyRate($myrow['currabrev'],$CurrencyRatesArray),5), $_SERVER['PHP_SELF'] . '?', $myrow['currabrev'], _('Edit'), Modified: trunk/CustWhereAlloc.php =================================================================== --- trunk/CustWhereAlloc.php 2011-09-04 10:10:14 UTC (rev 4677) +++ trunk/CustWhereAlloc.php 2011-09-05 10:10:57 UTC (rev 4678) @@ -85,7 +85,7 @@ <table cellpadding=2 class="selection">'; echo '<tr> - <th colspan=6><div class="centre"><font size=3 color=blue><b>'._('Allocations made against invoice number') . ' ' . $_POST['TransNo'] . '<br />'._('Transaction Total').': '. locale_number_format($myrow['totamt'],2) . '</font></b></div></th> + <th colspan=6><div class="centre"><font size=3 color=blue><b>'._('Allocations made against invoice number') . ' ' . $_POST['TransNo'] . '<br />'._('Transaction Total').': '. number_format($myrow['totamt'],2) . '</font></b></div></th> </tr>'; $tableheader = '<tr> @@ -121,8 +121,8 @@ <td>' . $myrow['transno'] . '</td> <td>' . $myrow['reference'] . '</td> <td>' . $myrow['rate'] . '</td> - <td class=number>' . locale_number_format($myrow['totalamt'],$_SESSION['CompanyRecord']['decimalplaces']) . '</td> - <td class=number>' . locale_number_format($myrow['amt'],$_SESSION['CompanyRecord']['decimalplaces']) . '</td> + <td class=number>' . number_format($myrow['totalamt'],$_SESSION['CompanyRecord']['decimalplaces']) . '</td> + <td class=number>' . number_format($myrow['amt'],$_SESSION['CompanyRecord']['decimalplaces']) . '</td> </tr>'; $RowCounter++; @@ -135,7 +135,7 @@ } //end of while loop echo '<tr><td colspan = 5 class=number>'._('Total allocated').'</td> - <td class=number>' . locale_number_format($AllocsTotal,2) . '</td></tr>'; + <td class=number>' . number_format($AllocsTotal,2) . '</td></tr>'; echo '</table>'; } } Modified: trunk/CustomerAllocations.php =================================================================== --- trunk/CustomerAllocations.php 2011-09-04 10:10:14 UTC (rev 4677) +++ trunk/CustomerAllocations.php 2011-09-05 10:10:57 UTC (rev 4678) @@ -347,7 +347,7 @@ if ($_SESSION['Alloc']->TransExRate != 1) { echo '<br />' . _('Amount in customer currency') . ' <b>' . - locale_number_format(-$_SESSION['Alloc']->TransAmt,2) . + number_format(-$_SESSION['Alloc']->TransAmt,2) . '</b><i> ('._('converted into local currency at an exchange rate of'). ' ' . $_SESSION['Alloc']->TransExRate . ')</i>'; } @@ -382,13 +382,13 @@ echo '<td>' . $AllocnItem->TransType . '</td> <td>' . $AllocnItem->TypeNo . '</td> <td class=number>' . $AllocnItem->TransDate . '</td> - <td class=number>' . locale_number_format($AllocnItem->TransAmount,2) . '</td> - <td class=number>' . locale_number_format($YetToAlloc,2) . '</td>'; + <td class=number>' . number_format($AllocnItem->TransAmount,2) . '</td> + <td class=number>' . number_format($YetToAlloc,2) . '</td>'; $j++; if ($AllocnItem->TransAmount < 0) { $balance+=$YetToAlloc; - echo '<td>' . $curTrans .'</td><td class="number">' . locale_number_format($balance,2) . '</td></tr>'; + echo '<td>' . $curTrans .'</td><td class="number">' . number_format($balance,2) . '</td></tr>'; } else { echo '<input type=hidden name="YetToAlloc' . $Counter . '" value="' . round($YetToAlloc,2) . '"></td>'; echo '<td class="number"><input tabindex="' . $j .'" type="checkbox" name="All' . $Counter . '"'; @@ -402,7 +402,7 @@ $j++; echo '<input tabindex="'.$j.'" type="text" class="number" name="Amt' . $Counter .'" maxlength=12 size=13 value="' . round($AllocnItem->AllocAmt,2) . '" /> <input type=hidden name="AllocID' . $Counter . '" value="' . $AllocnItem->ID . '"></td> - <td class="number">' . locale_number_format($balance,2) . '</td></tr>'; + <td class="number">' . number_format($balance,2) . '</td></tr>'; } $TotalAllocated = $TotalAllocated + round($AllocnItem->AllocAmt,2); $Counter++; @@ -410,14 +410,14 @@ echo '<tr> <td colspan=5 class="number"><b>'._('Total Allocated').':</b></td> - <td class=number><b><u>' . locale_number_format($TotalAllocated,2) . '</u></b></td>'; + <td class=number><b><u>' . number_format($TotalAllocated,2) . '</u></b></td>'; $j... [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/ContractCosting.php 2011-09-04 10:10:14 UTC (rev 4677) +++ trunk/ContractCosting.php 2011-09-05 10:10:57 UTC (rev 4678) @@ -94,8 +94,8 @@ <td>' . $Component->ItemDescription . '</td> <td class="number">' . $Component->Quantity . '</td> <td>' . $Component->UOM . '</td> - <td class="number">' . locale_number_format($Component->ItemCost,$_SESSION['CompanyRecord']['decimalplaces']) . '</td> - <td class="number">' . locale_number_format(($Component->ItemCost * $Component->Quantity),$_SESSION['CompanyRecord']['decimalplaces']) . '</td>'; + <td class="number">' . number_format($Component->ItemCost,$_SESSION['CompanyRecord']['decimalplaces']) . '</td> + <td class="number">' . number_format(($Component->ItemCost * $Component->Quantity),$_SESSION['CompanyRecord']['decimalplaces']) . '</td>'; $ContractBOMBudget += ($Component->ItemCost * $Component->Quantity); @@ -104,8 +104,8 @@ echo '<td colspan="2" align="center">' . _('Actual usage') . '</td> <td class="number">' . -$InventoryIssues[$Component->StockID]->Quantity . '</td> <td>' . $InventoryIssues[$Component->StockID]->Units . '</td> - <td class="number">' . locale_number_format($InventoryIssues[$Component->StockID]->TotalCost/$InventoryIssues[$Component->StockID]->Quantity,$_SESSION['CompanyRecord']['decimalplaces']) . '</td> - <td>' . locale_number_format(-$InventoryIssues[$Component->StockID]->TotalCost,$_SESSION['CompanyRecord']['decimalplaces']) . '</td> + <td class="number">' . number_format($InventoryIssues[$Component->StockID]->TotalCost/$InventoryIssues[$Component->StockID]->Quantity,$_SESSION['CompanyRecord']['decimalplaces']) . '</td> + <td>' . number_format(-$InventoryIssues[$Component->StockID]->TotalCost,$_SESSION['CompanyRecord']['decimalplaces']) . '</td> </tr>'; } else { echo '<td colspan="6"></td> @@ -122,17 +122,17 @@ <td>' . $Component->Description . '</td> <td class="number">' . -$Component->Quantity . '</td> <td>' . $Component->Units . '</td> - <td class="number">' . locale_number_format($Component->TotalCost/$Component->Quantity,$_SESSION['CompanyRecord']['decimalplaces']) . '</td> - <td class="number">' . locale_number_format(-$Component->TotalCost,$_SESSION['CompanyRecord']['decimalplaces']) . '</td> + <td class="number">' . number_format($Component->TotalCost/$Component->Quantity,$_SESSION['CompanyRecord']['decimalplaces']) . '</td> + <td class="number">' . number_format(-$Component->TotalCost,$_SESSION['CompanyRecord']['decimalplaces']) . '</td> </tr>'; } //end if its a component not originally budget for } echo '<tr> <td class="number" colspan="5">' . _('Total Inventory Budgeted Cost') . ':</td> - <td class="number">' . locale_number_format($ContractBOMBudget,$_SESSION['CompanyRecord']['decimalplaces']) . '</td> + <td class="number">' . number_format($ContractBOMBudget,$_SESSION['CompanyRecord']['decimalplaces']) . '</td> <td class="number" colspan="5">' . _('Total Inventory Actual Cost') . ':</td> - <td class="number">' . locale_number_format($ContractBOMActual,$_SESSION['CompanyRecord']['decimalplaces']) . '</td> + <td class="number">' . number_format($ContractBOMActual,$_SESSION['CompanyRecord']['decimalplaces']) . '</td> </tr>'; echo '<tr> @@ -154,11 +154,11 @@ echo '<tr><td>' . $Requirement->Requirement . '</td> <td class="number">' . $Requirement->Quantity . '</td> <td class="number">' . $Requirement->CostPerUnit . '</td> - <td class="number">' . locale_number_format(($Requirement->CostPerUnit * $Requirement->Quantity),$_SESSION['CompanyRecord']['decimalplaces']) . '</td> + <td class="number">' . number_format(($Requirement->CostPerUnit * $Requirement->Quantity),$_SESSION['CompanyRecord']['decimalplaces']) . '</td> </tr>'; $OtherReqtsBudget += ($Requirement->CostPerUnit * $Requirement->Quantity); } -echo '<tr><th colspan="3" align="right"><b>' . _('Budgeted Other Costs') . '</b></th><th class="number"><b>' . locale_number_format($OtherReqtsBudget,2) . '</b></th></tr> +echo '<tr><th colspan="3" align="right"><b>' . _('Budgeted Other Costs') . '</b></th><th class="number"><b>' . number_format($OtherReqtsBudget,2) . '</b></th></tr> </table></td>'; //Now other requirements actual in a sub table @@ -197,17 +197,17 @@ <td>' . $OtherChargesRow['suppreference'] . '</td> <td>' .ConvertSQLDate($OtherChargesRow['trandate']) . '</td> <td>' . $OtherChargesRow['narrative'] . '</td> - <td class="number">' . locale_number_format($OtherChargesRow['amount'],$_SESSION['CompanyRecord']['decimalplaces']) . '</td> + <td class="number">' . number_format($OtherChargesRow['amount'],$_SESSION['CompanyRecord']['decimalplaces']) . '</td> <td>' . $Anticipated . '</td> </tr>'; $OtherReqtsActual +=$OtherChargesRow['amount']; } -echo '<tr><th colspan="4" align="right"><b>' . _('Actual Other Costs') . '</b></th><th class="number"><b>' . locale_number_format($OtherReqtsActual,$_SESSION['CompanyRecord']['decimalplaces']) . '</b></th></tr> +echo '<tr><th colspan="4" align="right"><b>' . _('Actual Other Costs') . '</b></th><th class="number"><b>' . number_format($OtherReqtsActual,$_SESSION['CompanyRecord']['decimalplaces']) . '</b></th></tr> </table></td></tr>'; echo '<tr><td colspan="5"><b>' . _('Total Budget Contract Cost') . '</b></td> - <td class="number"><b>' . locale_number_format($OtherReqtsBudget+$ContractBOMBudget,$_SESSION['CompanyRecord']['decimalplaces']) . '</b></td> + <td class="number"><b>' . number_format($OtherReqtsBudget+$ContractBOMBudget,$_SESSION['CompanyRecord']['decimalplaces']) . '</b></td> <td colspan="5"><b>' . _('Total Actual Contract Cost') . '</b></td> - <td class="number"><b>' . locale_number_format($OtherReqtsActual+$ContractBOMActual,$_SESSION['CompanyRecord']['decimalplaces']) . '</b></td></tr>'; + <td class="number"><b>' . number_format($OtherReqtsActual+$ContractBOMActual,$_SESSION['CompanyRecord']['decimalplaces']) . '</b></td></tr>'; echo '</table>'; @@ -378,7 +378,7 @@ '" . Date('Y-m-d') . "', '" . $PeriodNo . "', '" . $GLCodes['stockact'] . "', - '" . $_SESSION['Contract'.$identifier]->WO . ' ' . $_SESSION['Contract'.$identifier]->ContractRef . ' - x 1 @ ' . locale_number_format(($OtherReqtsBudget+$ContractBOMBudget),2) . "', + '" . $_SESSION['Contract'.$identifier]->WO . ' ' . $_SESSION['Contract'.$identifier]->ContractRef . ' - x 1 @ ' . number_format(($OtherReqtsBudget+$ContractBOMBudget),2) . "', '" . ($OtherReqtsBudget+$ContractBOMBudget) . "')"; $ErrMsg = _('CRITICAL ERROR') . '! ' . _('NOTE DOWN THIS ERROR AND SEEK ASSISTANCE') . ': ' . _('The receipt of contract work order finished stock GL posting could not be inserted because'); @@ -398,7 +398,7 @@ '" . Date('Y-m-d') . "', '" . $PeriodNo . "', '" . $GLCodes['wipact'] . "', - '" . $_SESSION['Contract'.$identifier]->WO . ' ' . $_SESSION['Contract'.$identifier]->ContractRef . ' - x 1 @ ' . locale_number_format(($OtherReqtsBudget+$ContractBOMBudget),2) . "', + '" . $_SESSION['Contract'.$identifier]->WO . ' ' . $_SESSION['Contract'.$identifier]->ContractRef . ' - x 1 @ ' . number_format(($OtherReqtsBudget+$ContractBOMBudget),2) . "', '" . -($OtherReqtsBudget+$ContractBOMBudget) . "')"; $ErrMsg = _('CRITICAL ERROR') . '! ' . _('NOTE DOWN THIS ERROR AND SEEK ASSISTANCE') . ': ' . _('The WIP credit on receipt of finished items from a work order GL posting could not be inserted because'); Modified: trunk/ContractOtherReqts.php =================================================================== --- trunk/ContractOtherReqts.php 2011-09-04 10:10:14 UTC (rev 4677) +++ trunk/ContractOtherReqts.php 2011-09-05 10:10:57 UTC (rev 4678) @@ -100,7 +100,7 @@ foreach ($_SESSION['Contract'.$identifier]->ContractReqts as $ContractReqtID => $ContractComponent) { $LineTotal = $ContractComponent->Quantity * $ContractComponent->CostPerUnit; - $DisplayLineTotal = locale_number_format($LineTotal,$_SESSION['CompanyRecord']['decimalplaces']); + $DisplayLineTotal = number_format($LineTotal,$_SESSION['CompanyRecord']['decimalplaces']); if ($k==1){ echo '<tr class="EvenTableRows">'; @@ -118,7 +118,7 @@ $TotalCost += $LineTotal; } - $DisplayTotal = locale_number_format($TotalCost,2); + $DisplayTotal = number_format($TotalCost,2); echo '<tr><td colspan="4" class="number">' . _('Total Other Requirements Cost') . '</td><td class="number"><b>' . $DisplayTotal . '</b></td></tr></table>'; echo '<br /><div class="centre"><input type="submit" name="UpdateLines" value="' . _('Update Other Requirements Lines') . '" />'; echo ' <input type="submit" name="BackToHeader" value="' . _('Back To Contract Header') . '" /></div>'; Modified: trunk/Contracts.php =================================================================== --- trunk/Contracts.php 2011-09-04 10:10:14 UTC (rev 4677) +++ trunk/Contracts.php 2011-09-05 10:10:57 UTC (rev 4678) @@ -946,14 +946,14 @@ <td>' . $Component->ItemDescription . '</td> <td class="number">' . $Component->Quantity . '</td> <td>' . $Component->UOM . '</td> - <td class="number">' . locale_number_format($Component->ItemCost,2) . '</td> - <td class="number">' . locale_number_format(($Component->ItemCost * $Component->Quantity),2) . '</td> + <td class="number">' . number_format($Component->ItemCost,2) . '</td> + <td class="number">' . number_format(($Component->ItemCost * $Component->Quantity),2) . '</td> </tr>'; $ContractBOMCost += ($Component->ItemCost * $Component->Quantity); } echo '<tr> <th colspan="5"><b>' . _('Total stock cost') . '</b></th> - <th class="number"><b>' . locale_number_format($ContractBOMCost,2) . '</b></th> + <th class="number"><b>' . number_format($ContractBOMCost,2) . '</b></th> </tr>'; } else { //there are no items set up against this contract echo '<tr> @@ -979,11 +979,11 @@ <td>' . $Requirement->Requirement . '</td> <td class="number">' . $Requirement->Quantity . '</td> <td class="number">' . $Requirement->CostPerUnit . '</td> - <td class="number">' . locale_number_format(($Requirement->CostPerUnit * $Requirement->Quantity),2) . '</td> + <td class="number">' . number_format(($Requirement->CostPerUnit * $Requirement->Quantity),2) . '</td> </tr>'; $ContractReqtsCost += ($Requirement->CostPerUnit * $Requirement->Quantity); } - echo '<tr><th colspan="3"><b>' . _('Total other costs') . '</b></th><th class="number"><b>' . locale_number_format($ContractReqtsCost,2) . '</b></th></tr>'; + echo '<tr><th colspan="3"><b>' . _('Total other costs') . '</b></th><th class="number"><b>' . number_format($ContractReqtsCost,2) . '</b></th></tr>'; } else { //there are no items set up against this contract echo '<tr><td colspan="4"><i>' . _('None Entered') . '</i></td></tr>'; } @@ -991,9 +991,9 @@ echo '<br />'; echo'<table class="selection"> <tr><th>' . _('Total Contract Cost') . '</th> - <th class="number">' . locale_number_format(($ContractBOMCost+$ContractReqtsCost),$_SESSION['CompanyRecord']['decimalplaces']) . '</th> + <th class="number">' . number_format(($ContractBOMCost+$ContractReqtsCost),$_SESSION['CompanyRecord']['decimalplaces']) . '</th> <th>' . _('Contract Price') . '</th> - <th class="number">' . locale_number_format(($ContractBOMCost+$ContractReqtsCost)/((100-$_SESSION['Contract'.$identifier]->Margin)/100),$_SESSION['CompanyRecord']['decimalplaces']) . '</th> + <th class="number">' . number_format(($ContractBOMCost+$ContractReqtsCost)/((100-$_SESSION['Contract'.$identifier]->Margin)/100),$_SESSION['CompanyRecord']['decimalplaces']) . '</th> </tr> </table>'; Modified: trunk/CounterSales.php =================================================================== --- trunk/CounterSales.php 2011-09-04 10:10:14 UTC (rev 4677) +++ trunk/CounterSales.php 2011-09-05 10:10:57 UTC (rev 4678) @@ -333,7 +333,7 @@ if (!isset($Offset) or $Offset<0) { $Offset=0; } - $SQL = $SQL . ' LIMIT ' . $_SESSION['DefaultDisplayRecordsMax'].' OFFSET '.locale_number_format($_SESSION['DefaultDisplayRecordsMax']*$Offset); + $SQL = $SQL . ' LIMIT ' . $_SESSION['DefaultDisplayRecordsMax'].' OFFSET '.number_format($_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'); @@ -740,7 +740,7 @@ foreach ($_SESSION['Items'.$identifier]->LineItems as $OrderLine) { $SubTotal = $OrderLine->Quantity * $OrderLine->Price * (1 - $OrderLine->DiscountPercent); - $DisplayDiscount = locale_number_format(($OrderLine->DiscountPercent * 100),2); + $DisplayDiscount = number_format(($OrderLine->DiscountPercent * 100),2); $QtyOrdered = $OrderLine->Quantity; $QtyRemain = $QtyOrdered - $OrderLine->QtyInv; @@ -771,7 +771,7 @@ 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 class="number">' . locale_number_format($SubTotal,$_SESSION['Items'.$identifier]->CurrDecimalPlaces) . '</td>'; + echo '<td class="number">' . number_format($SubTotal,$_SESSION['Items'.$identifier]->CurrDecimalPlaces) . '</td>'; $LineDueDate = $OrderLine->ItemDue; if (!Is_Date($OrderLine->ItemDue)){ $LineDueDate = DateAdd (Date($_SESSION['DefaultDateFormat']),'d', $_SESSION['Items'.$identifier]->DeliveryDays); @@ -797,8 +797,8 @@ $TaxTotal += $TaxLineTotal; $_SESSION['Items'.$identifier]->TaxTotals=$TaxTotals; $_SESSION['Items'.$identifier]->TaxGLCodes=$TaxGLCodes; - echo '<td class="number">' . locale_number_format($TaxLineTotal ,$_SESSION['Items'.$identifier]->CurrDecimalPlaces) . '</td>'; - echo '<td class="number">' . locale_number_format($SubTotal + $TaxLineTotal ,$_SESSION['Items'.$identifier]->CurrDecimalPlaces) . '</td>'; + echo '<td class="number">' . number_format($TaxLineTotal ,$_SESSION['Items'.$identifier]->CurrDecimalPlaces) . '</td>'; + echo '<td class="number">' . number_format($SubTotal + $TaxLineTotal ,$_SESSION['Items'.$identifier]->CurrDecimalPlaces) . '</td>'; echo '<td><a href="' . $_SERVER['PHP_SELF'] . '?identifier='.$identifier . '&Delete=' . $OrderLine->LineNumber . '" onclick="return confirm(\'' . _('Are You Sure?') . '\');">' . _('Delete') . '</a></td></tr>'; if ($_SESSION['AllowOrderLineItemNarrative'] == 1){ @@ -815,9 +815,9 @@ } /* end of loop around items */ echo '<tr class="EvenTableRows"><td colspan="8" class="number"><b>' . _('Total') . '</b></td> - <td class="number">' . locale_number_format(($_SESSION['Items'.$identifier]->total),$_SESSION['Items'.$identifier]->CurrDecimalPlaces) . '</td> - <td class="number">' . locale_number_format($TaxTotal,$_SESSION['Items'.$identifier]->CurrDecimalPlaces) . '</td> - <td class="number">' . locale_number_format(($_SESSION['Items'.$identifier]->total+$TaxTotal),$_SESSION['Items'.$identifier]->CurrDecimalPlaces) . '</td> + <td class="number">' . number_format(($_SESSION['Items'.$identifier]->total),$_SESSION['Items'.$identifier]->CurrDecimalPlaces) . '</td> + <td class="number">' . number_format($TaxTotal,$_SESSION['Items'.$identifier]->CurrDecimalPlaces) . '</td> + <td class="number">' . number_format(($_SESSION['Items'.$identifier]->total+$TaxTotal),$_SESSION['Items'.$identifier]->CurrDecimalPlaces) . '</td> </tr> </table>'; echo '<input type="hidden" name="TaxTotal" value="'.$TaxTotal.'" />'; @@ -2095,7 +2095,7 @@ <td style="text-align:center">%s</td> <td style="text-align:center">%s</td> <td style="text-align:center">%s</td> - <td><font size=1><input class="number" tabindex="'.locale_number_format($j+7).'" type="textbox" size="6" name="itm%s" value="0" /> + <td><font size=1><input class="number" tabindex="'.number_format($j+7).'" type="textbox" size="6" name="itm%s" value="0" /> </td> </tr>', $myrow['stockid'], @@ -2113,7 +2113,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="OrderItems" value="1" /><input tabindex='.locale_number_format($j+8).' type="submit" value="'._('Add to Sale').'" /></td>'; + echo '<td style="text-align:center" colspan="8"><input type="hidden" name="OrderItems" value="1" /><input tabindex='.number_format($j+8).' type="submit" value="'._('Add to Sale').'" /></td>'; echo '</table>'; } //end of if Frequently Ordered Items > 0 if (isset($msg)){ @@ -2176,9 +2176,9 @@ echo '<form action="' . $_SERVER['PHP_SELF'] . '?' . SID .'identifier='.$identifier . '" method="post" name="orderform">'; echo '<input type="hidden" name="FormID" value="' . $_SESSION['FormID'] . '" />'; echo '<table class="table1">'; - echo '<tr><td><input type="hidden" name="previous" value="'.locale_number_format($Offset-1).'" /><input tabindex="'.locale_number_format($j+7).'" type="submit" name="Prev" value="'._('Prev').'" /></td>'; - echo '<td style="text-align:center" colspan="6"><input type="hidden" name="OrderItems" value="1" /><input tabindex="'.locale_number_format($j+8).'" type="submit" value="'._('Add to Sale').'" /></td>'; - echo '<td><input type="hidden" name="NextList" value="'.locale_number_format($Offset+1).'" /><input tabindex="'.locale_number_format($j+9).'" type="submit" name="Next" value="'._('Next').'" /></td></tr>'; + 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="OrderItems" value="1" /><input tabindex="'.number_format($j+8).'" type="submit" value="'._('Add to Sale').'" /></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>'; $TableHeader = '<tr><th>' . _('Code') . '</th> <th>' . _('Description') . '</th> <th>' . _('Units') . '</th> @@ -2272,15 +2272,15 @@ <td class="number">%s</td> <td class="number">%s</td> <td class="number">%s</td> - <td><font size="1"><input class="number" tabindex="'.locale_number_format($j+7).'" type="textbox" size="6" name="itm%s" value="0" /></font></td> + <td><font size="1"><input class="number" tabindex="'.number_format($j+7).'" type="textbox" size="6" name="itm%s" value="0" /></font></td> </tr>', $myrow['stockid'], $myrow['description'], $myrow['units'], - locale_number_format($QOH, $QOHRow['decimalplaces']), - locale_number_format($DemandQty, $QOHRow['decimalplaces']), - locale_number_format($OnOrder, $QOHRow['decimalplaces']), - locale_number_format($Available, $QOHRow['decimalplaces']), + number_format($QOH, $QOHRow['decimalplaces']), + number_format($DemandQty, $QOHRow['decimalplaces']), + number_format($OnOrder, $QOHRow['decimalplaces']), + number_format($Available, $QOHRow['decimalplaces']), $myrow['stockid']); if ($j==1) { $jsCall = '<script type="text/javascript">if (document.SelectParts) {defaultControl(document.SelectParts.itm'.$myrow['stockid'].');}</script>'; @@ -2295,9 +2295,9 @@ echo '<input type="hidden" name="PhoneNo" value="'.$_SESSION['Items'.$identifier]->PhoneNo.'" />'; echo '<input type="hidden" name="Email" value="'.$_SESSION['Items'.$identifier]->Email.'" />'; - echo '<tr><td><input type="hidden" name="previous" value="'.locale_number_format($Offset-1).'" /><input tabindex="'.locale_number_format($j+7).'" type="submit" name="Prev" value="'._('Prev').'" /></td>'; - echo '<td style="text-align:center" colspan="6"><input type="hidden" name="OrderItems" value="1" /><input tabindex="'.locale_number_format($j+8).'" type="submit" value="'._('Add to Sale').'" /></td>'; - echo '<td><input type="hidden" name="NextList" value="'.locale_number_format($Offset+1).'" /><input tabindex="'.locale_number_format($j+9).'" type="submit" name="Next" value="'._('Next').'" /></td></tr>'; + 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="OrderItems" value="1" /><input tabindex="'.number_format($j+8).'" type="submit" value="'._('Add to Sale').'" /></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 '</table></form>'; echo $jsCall; Modified: trunk/Credit_Invoice.php =================================================================== --- trunk/Credit_Invoice.php 2011-09-04 10:10:14 UTC (rev 4677) +++ trunk/Credit_Invoice.php 2011-09-05 10:10:57 UTC (rev 4678) @@ -310,7 +310,7 @@ echo '<tr '.$RowStarter.'><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>'; if ($LnItm->Controlled==1){ @@ -323,7 +323,7 @@ } - $DisplayLineTotal = locale_number_format($LineTotal,$_SESSION['CreditItems']->CurrDecimalPlaces); + $DisplayLineTotal = number_format($LineTotal,$_SESSION['CreditItems']->CurrDecimalPlaces); $j++; echo '<td><input tabindex=' . $j . ' type="text" class=number name="Price_' . $LnItm->LineNumber . '" maxlength=12 size=6 value=' . $LnItm->Price . '></td> @@ -370,8 +370,8 @@ } $TaxTotal += $TaxLineTotal; - $DisplayTaxAmount = locale_number_format($TaxLineTotal ,$_SESSION['CreditItems']->CurrDecimalPlaces); - $DisplayGrossLineTotal = locale_number_format($LineTotal+ $TaxLineTotal,$_SESSION['CreditItems']->CurrDecimalPlaces); + $DisplayTaxAmount = number_format($TaxLineTotal ,$_SESSION['CreditItems']->CurrDecimalPlaces); + $DisplayGrossLineTotal = number_format($LineTotal+ $TaxLineTotal,$_SESSION['CreditItems']->CurrDecimalPlaces); if (!isset($_POST['ProcessCredit'])) { echo '</td>'; @@ -392,7 +392,7 @@ if (!isset($_POST['ProcessCredit'])) { echo '<tr> <td colspan=3 class=number>' . _('Freight cost charged on invoice') . '</td> - <td class=number>' . locale_number_format($_SESSION['Old_FreightCost'],$_SESSION['CreditItems']->CurrDecimalPlaces) . '</td> + <td class=number>' . number_format($_SESSION['Old_FreightCost'],$_SESSION['CreditItems']->CurrDecimalPlaces) . '</td> <td></td> <td colspan=2 class=number>' . _('Credit Freight Cost') . '</td> <td><input tabindex='.$j.' type="text" class="number" size=6 maxlength=6 name="ChargeFreightCost" value="' . $_SESSION['CreditItems']->FreightCost . '"></td>'; @@ -433,21 +433,21 @@ if (!isset($_POST['ProcessCredit'])) { echo '</td>'; - echo '<td class="number">' . locale_number_format($FreightTaxTotal,$_SESSION['CreditItems']->CurrDecimalPlaces) . '</td> - <td class="number">' . locale_number_format($FreightTaxTotal+ $_SESSION['CreditItems']->FreightCost,$_SESSION['CreditItems']->CurrDecimalPlaces) . '</td> + echo '<td class="number">' . number_format($FreightTaxTotal,$_SESSION['CreditItems']->CurrDecimalPlaces) . '</td> + <td class="number">' . number_format($FreightTaxTotal+ $_SESSION['CreditItems']->FreightCost,$_SESSION['CreditItems']->CurrDecimalPlaces) . '</td> </tr>'; } $TaxTotal += $FreightTaxTotal; -$DisplayTotal = locale_number_format($_SESSION['CreditItems']->total + $_SESSION['CreditItems']->FreightCost,$_SESSION['CreditItems']->CurrDecimalPlaces); +$DisplayTotal = number_format($_SESSION['CreditItems']->total + $_SESSION['CreditItems']->FreightCost,$_SESSION['CreditItems']->CurrDecimalPlaces); if (!isset($_POST['ProcessCredit'])) { echo '<tr> <td colspan=7 class=number>' . _('Credit Totals') . '</td> <td class=number><hr><b>' . $DisplayTotal . '</b><hr></td> <td colspan=2></td> - <td class=number><hr><b>' . locale_number_format($TaxTotal,$_SESSION['CreditItems']->CurrDecimalPlaces) . '<hr></td> - <td class=number><hr><b>' . locale_number_format($TaxTotal+($_SESSION['CreditItems']->total + $_SESSION['CreditItems']->FreightCost),$_SESSION['CreditItems']->CurrDecimalPlaces) . '</b><hr></td> + <td class=number><hr><b>' . number_format($TaxTotal,$_SESSION['CreditItems']->CurrDecimalPlaces) . '<hr></td> + <td class=number><hr><b>' . number_format($TaxTotal+($_SESSION['CreditItems']->total + $_SESSION['CreditItems']->FreightCost),$_SESSION['CreditItems']->CurrDecimalPlaces) . '</b><hr></td> </tr></table>'; } $DefaultDispatchDate = Date($_SESSION['DefaultDateFormat']); Modified: trunk/Currencies.php =================================================================== --- trunk/Currencies.php 2011-09-04 10:10:14 UTC (rev 4677) +++ trunk/Currencies.php 2011-09-05 10:10:57 UTC (rev 4678) @@ -262,8 +262,8 @@ $myrow['country'], $myrow['hundredsname'], $myrow['decimalplaces'], - locale_number_format($myrow['rate'],5), - locale_number_format(GetCurrencyRate($myrow['currabrev'],$CurrencyRatesArray),5), + number_format($myrow['rate'],5), + number_format(GetCurrencyRate($myrow['currabrev'],$CurrencyRatesArray),5), $_SERVER['PHP_SELF'] . '?', $myrow['currabrev'], _('Edit'), Modified: trunk/CustWhereAlloc.php =================================================================== --- trunk/CustWhereAlloc.php 2011-09-04 10:10:14 UTC (rev 4677) +++ trunk/CustWhereAlloc.php 2011-09-05 10:10:57 UTC (rev 4678) @@ -85,7 +85,7 @@ <table cellpadding=2 class="selection">'; echo '<tr> - <th colspan=6><div class="centre"><font size=3 color=blue><b>'._('Allocations made against invoice number') . ' ' . $_POST['TransNo'] . '<br />'._('Transaction Total').': '. locale_number_format($myrow['totamt'],2) . '</font></b></div></th> + <th colspan=6><div class="centre"><font size=3 color=blue><b>'._('Allocations made against invoice number') . ' ' . $_POST['TransNo'] . '<br />'._('Transaction Total').': '. number_format($myrow['totamt'],2) . '</font></b></div></th> </tr>'; $tableheader = '<tr> @@ -121,8 +121,8 @@ <td>' . $myrow['transno'] . '</td> <td>' . $myrow['reference'] . '</td> <td>' . $myrow['rate'] . '</td> - <td class=number>' . locale_number_format($myrow['totalamt'],$_SESSION['CompanyRecord']['decimalplaces']) . '</td> - <td class=number>' . locale_number_format($myrow['amt'],$_SESSION['CompanyRecord']['decimalplaces']) . '</td> + <td class=number>' . number_format($myrow['totalamt'],$_SESSION['CompanyRecord']['decimalplaces']) . '</td> + <td class=number>' . number_format($myrow['amt'],$_SESSION['CompanyRecord']['decimalplaces']) . '</td> </tr>'; $RowCounter++; @@ -135,7 +135,7 @@ } //end of while loop echo '<tr><td colspan = 5 class=number>'._('Total allocated').'</td> - <td class=number>' . locale_number_format($AllocsTotal,2) . '</td></tr>'; + <td class=number>' . number_format($AllocsTotal,2) . '</td></tr>'; echo '</table>'; } } Modified: trunk/CustomerAllocations.php =================================================================== --- trunk/CustomerAllocations.php 2011-09-04 10:10:14 UTC (rev 4677) +++ trunk/CustomerAllocations.php 2011-09-05 10:10:57 UTC (rev 4678) @@ -347,7 +347,7 @@ if ($_SESSION['Alloc']->TransExRate != 1) { echo '<br />' . _('Amount in customer currency') . ' <b>' . - locale_number_format(-$_SESSION['Alloc']->TransAmt,2) . + number_format(-$_SESSION['Alloc']->TransAmt,2) . '</b><i> ('._('converted into local currency at an exchange rate of'). ' ' . $_SESSION['Alloc']->TransExRate . ')</i>'; } @@ -382,13 +382,13 @@ echo '<td>' . $AllocnItem->TransType . '</td> <td>' . $AllocnItem->TypeNo . '</td> <td class=number>' . $AllocnItem->TransDate . '</td> - <td class=number>' . locale_number_format($AllocnItem->TransAmount,2) . '</td> - <td class=number>' . locale_number_format($YetToAlloc,2) . '</td>'; + <td class=number>' . number_format($AllocnItem->TransAmount,2) . '</td> + <td class=number>' . number_format($YetToAlloc,2) . '</td>'; $j++; if ($AllocnItem->TransAmount < 0) { $balance+=$YetToAlloc; - echo '<td>' . $curTrans .'</td><td class="number">' . locale_number_format($balance,2) . '</td></tr>'; + echo '<td>' . $curTrans .'</td><td class="number">' . number_format($balance,2) . '</td></tr>'; } else { echo '<input type=hidden name="YetToAlloc' . $Counter . '" value="' . round($YetToAlloc,2) . '"></td>'; echo '<td class="number"><input tabindex="' . $j .'" type="checkbox" name="All' . $Counter . '"'; @@ -402,7 +402,7 @@ $j++; echo '<input tabindex="'.$j.'" type="text" class="number" name="Amt' . $Counter .'" maxlength=12 size=13 value="' . round($AllocnItem->AllocAmt,2) . '" /> <input type=hidden name="AllocID' . $Counter . '" value="' . $AllocnItem->ID . '"></td> - <td class="number">' . locale_number_format($balance,2) . '</td></tr>'; + <td class="number">' . number_format($balance,2) . '</td></tr>'; } $TotalAllocated = $TotalAllocated + round($AllocnItem->AllocAmt,2); $Counter++; @@ -410,14 +410,14 @@ echo '<tr> <td colspan=5 class="number"><b>'._('Total Allocated').':</b></td> - <td class=number><b><u>' . locale_number_format($TotalAllocated,2) . '</u></b></td>'; + <td class=number><b><u>' . number_format($TotalAllocated,2) . '</u></b></td>'; $j... [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->ItemDescription . '</td> <td class="number">' . $Component->Quantity . '</td> <td>' . $Component->UOM . '</td> - <td class="number">' . number_format($Component->ItemCost,$_SESSION['CompanyRecord']['decimalplaces']) . '</td> - <td class="number">' . number_format(($Component->ItemCost * $Component->Quantity),$_SESSION['CompanyRecord']['decimalplaces']) . '</td>'; + <td class="number">' . locale_number_format($Component->ItemCost,$_SESSION['CompanyRecord']['decimalplaces']) . '</td> + <td class="number">' . locale_number_format(($Component->ItemCost * $Component->Quantity),$_SESSION['CompanyRecord']['decimalplaces']) . '</td>'; $ContractBOMBudget += ($Component->ItemCost * $Component->Quantity); @@ -104,8 +104,8 @@ echo '<td colspan="2" align="center">' . _('Actual usage') . '</td> <td class="number">' . -$InventoryIssues[$Component->StockID]->Quantity . '</td> <td>' . $InventoryIssues[$Component->StockID]->Units . '</td> - <td class="number">' . number_format($InventoryIssues[$Component->StockID]->TotalCost/$InventoryIssues[$Component->StockID]->Quantity,$_SESSION['CompanyRecord']['decimalplaces']) . '</td> - <td>' . number_format(-$InventoryIssues[$Component->StockID]->TotalCost,$_SESSION['CompanyRecord']['decimalplaces']) . '</td> + <td class="number">' . locale_number_format($InventoryIssues[$Component->StockID]->TotalCost/$InventoryIssues[$Component->StockID]->Quantity,$_SESSION['CompanyRecord']['decimalplaces']) . '</td> + <td>' . locale_number_format(-$InventoryIssues[$Component->StockID]->TotalCost,$_SESSION['CompanyRecord']['decimalplaces']) . '</td> </tr>'; } else { echo '<td colspan="6"></td> @@ -122,17 +122,17 @@ <td>' . $Component->Description . '</td> <td class="number">' . -$Component->Quantity . '</td> <td>' . $Component->Units . '</td> - <td class="number">' . number_format($Component->TotalCost/$Component->Quantity,$_SESSION['CompanyRecord']['decimalplaces']) . '</td> - <td class="number">' . number_format(-$Component->TotalCost,$_SESSION['CompanyRecord']['decimalplaces']) . '</td> + <td class="number">' . locale_number_format($Component->TotalCost/$Component->Quantity,$_SESSION['CompanyRecord']['decimalplaces']) . '</td> + <td class="number">' . locale_number_format(-$Component->TotalCost,$_SESSION['CompanyRecord']['decimalplaces']) . '</td> </tr>'; } //end if its a component not originally budget for } echo '<tr> <td class="number" colspan="5">' . _('Total Inventory Budgeted Cost') . ':</td> - <td class="number">' . number_format($ContractBOMBudget,$_SESSION['CompanyRecord']['decimalplaces']) . '</td> + <td class="number">' . locale_number_format($ContractBOMBudget,$_SESSION['CompanyRecord']['decimalplaces']) . '</td> <td class="number" colspan="5">' . _('Total Inventory Actual Cost') . ':</td> - <td class="number">' . number_format($ContractBOMActual,$_SESSION['CompanyRecord']['decimalplaces']) . '</td> + <td class="number">' . locale_number_format($ContractBOMActual,$_SESSION['CompanyRecord']['decimalplaces']) . '</td> </tr>'; echo '<tr> @@ -154,11 +154,11 @@ echo '<tr><td>' . $Requirement->Requirement . '</td> <td class="number">' . $Requirement->Quantity . '</td> <td class="number">' . $Requirement->CostPerUnit . '</td> - <td class="number">' . number_format(($Requirement->CostPerUnit * $Requirement->Quantity),$_SESSION['CompanyRecord']['decimalplaces']) . '</td> + <td class="number">' . locale_number_format(($Requirement->CostPerUnit * $Requirement->Quantity),$_SESSION['CompanyRecord']['decimalplaces']) . '</td> </tr>'; $OtherReqtsBudget += ($Requirement->CostPerUnit * $Requirement->Quantity); } -echo '<tr><th colspan="3" align="right"><b>' . _('Budgeted Other Costs') . '</b></th><th class="number"><b>' . number_format($OtherReqtsBudget,2) . '</b></th></tr> +echo '<tr><th colspan="3" align="right"><b>' . _('Budgeted Other Costs') . '</b></th><th class="number"><b>' . locale_number_format($OtherReqtsBudget,2) . '</b></th></tr> </table></td>'; //Now other requirements actual in a sub table @@ -197,17 +197,17 @@ <td>' . $OtherChargesRow['suppreference'] . '</td> <td>' .ConvertSQLDate($OtherChargesRow['trandate']) . '</td> <td>' . $OtherChargesRow['narrative'] . '</td> - <td class="number">' . number_format($OtherChargesRow['amount'],$_SESSION['CompanyRecord']['decimalplaces']) . '</td> + <td class="number">' . locale_number_format($OtherChargesRow['amount'],$_SESSION['CompanyRecord']['decimalplaces']) . '</td> <td>' . $Anticipated . '</td> </tr>'; $OtherReqtsActual +=$OtherChargesRow['amount']; } -echo '<tr><th colspan="4" align="right"><b>' . _('Actual Other Costs') . '</b></th><th class="number"><b>' . number_format($OtherReqtsActual,$_SESSION['CompanyRecord']['decimalplaces']) . '</b></th></tr> +echo '<tr><th colspan="4" align="right"><b>' . _('Actual Other Costs') . '</b></th><th class="number"><b>' . locale_number_format($OtherReqtsActual,$_SESSION['CompanyRecord']['decimalplaces']) . '</b></th></tr> </table></td></tr>'; echo '<tr><td colspan="5"><b>' . _('Total Budget Contract Cost') . '</b></td> - <td class="number"><b>' . number_format($OtherReqtsBudget+$ContractBOMBudget,$_SESSION['CompanyRecord']['decimalplaces']) . '</b></td> + <td class="number"><b>' . locale_number_format($OtherReqtsBudget+$ContractBOMBudget,$_SESSION['CompanyRecord']['decimalplaces']) . '</b></td> <td colspan="5"><b>' . _('Total Actual Contract Cost') . '</b></td> - <td class="number"><b>' . number_format($OtherReqtsActual+$ContractBOMActual,$_SESSION['CompanyRecord']['decimalplaces']) . '</b></td></tr>'; + <td class="number"><b>' . locale_number_format($OtherReqtsActual+$ContractBOMActual,$_SESSION['CompanyRecord']['decimalplaces']) . '</b></td></tr>'; echo '</table>'; @@ -378,7 +378,7 @@ '" . Date('Y-m-d') . "', '" . $PeriodNo . "', '" . $GLCodes['stockact'] . "', - '" . $_SESSION['Contract'.$identifier]->WO . ' ' . $_SESSION['Contract'.$identifier]->ContractRef . ' - x 1 @ ' . number_format(($OtherReqtsBudget+$ContractBOMBudget),2) . "', + '" . $_SESSION['Contract'.$identifier]->WO . ' ' . $_SESSION['Contract'.$identifier]->ContractRef . ' - x 1 @ ' . locale_number_format(($OtherReqtsBudget+$ContractBOMBudget),2) . "', '" . ($OtherReqtsBudget+$ContractBOMBudget) . "')"; $ErrMsg = _('CRITICAL ERROR') . '! ' . _('NOTE DOWN THIS ERROR AND SEEK ASSISTANCE') . ': ' . _('The receipt of contract work order finished stock GL posting could not be inserted because'); @@ -398,7 +398,7 @@ '" . Date('Y-m-d') . "', '" . $PeriodNo . "', '" . $GLCodes['wipact'] . "', - '" . $_SESSION['Contract'.$identifier]->WO . ' ' . $_SESSION['Contract'.$identifier]->ContractRef . ' - x 1 @ ' . number_format(($OtherReqtsBudget+$ContractBOMBudget),2) . "', + '" . $_SESSION['Contract'.$identifier]->WO . ' ' . $_SESSION['Contract'.$identifier]->ContractRef . ' - x 1 @ ' . locale_number_format(($OtherReqtsBudget+$ContractBOMBudget),2) . "', '" . -($OtherReqtsBudget+$ContractBOMBudget) . "')"; $ErrMsg = _('CRITICAL ERROR') . '! ' . _('NOTE DOWN THIS ERROR AND SEEK ASSISTANCE') . ': ' . _('The WIP credit on receipt of finished items from a work order GL posting could not be inserted because'); Modified: trunk/ContractOtherReqts.php =================================================================== --- trunk/ContractOtherReqts.php 2011-09-07 09:40:43 UTC (rev 4681) +++ trunk/ContractOtherReqts.php 2011-09-09 03:39:04 UTC (rev 4682) @@ -100,7 +100,7 @@ foreach ($_SESSION['Contract'.$identifier]->ContractReqts as $ContractReqtID => $ContractComponent) { $LineTotal = $ContractComponent->Quantity * $ContractComponent->CostPerUnit; - $DisplayLineTotal = number_format($LineTotal,$_SESSION['CompanyRecord']['decimalplaces']); + $DisplayLineTotal = locale_number_format($LineTotal,$_SESSION['CompanyRecord']['decimalplaces']); if ($k==1){ echo '<tr class="EvenTableRows">'; @@ -118,7 +118,7 @@ $TotalCost += $LineTotal; } - $DisplayTotal = number_format($TotalCost,2); + $DisplayTotal = locale_number_format($TotalCost,2); echo '<tr><td colspan="4" class="number">' . _('Total Other Requirements Cost') . '</td><td class="number"><b>' . $DisplayTotal . '</b></td></tr></table>'; echo '<br /><div class="centre"><input type="submit" name="UpdateLines" value="' . _('Update Other Requirements Lines') . '" />'; echo ' <input type="submit" name="BackToHeader" value="' . _('Back To Contract Header') . '" /></div>'; Modified: trunk/Contracts.php =================================================================== --- trunk/Contracts.php 2011-09-07 09:40:43 UTC (rev 4681) +++ trunk/Contracts.php 2011-09-09 03:39:04 UTC (rev 4682) @@ -946,14 +946,14 @@ <td>' . $Component->ItemDescription . '</td> <td class="number">' . $Component->Quantity . '</td> <td>' . $Component->UOM . '</td> - <td class="number">' . number_format($Component->ItemCost,2) . '</td> - <td class="number">' . number_format(($Component->ItemCost * $Component->Quantity),2) . '</td> + <td class="number">' . locale_number_format($Component->ItemCost,2) . '</td> + <td class="number">' . locale_number_format(($Component->ItemCost * $Component->Quantity),2) . '</td> </tr>'; $ContractBOMCost += ($Component->ItemCost * $Component->Quantity); } echo '<tr> <th colspan="5"><b>' . _('Total stock cost') . '</b></th> - <th class="number"><b>' . number_format($ContractBOMCost,2) . '</b></th> + <th class="number"><b>' . locale_number_format($ContractBOMCost,2) . '</b></th> </tr>'; } else { //there are no items set up against this contract echo '<tr> @@ -979,11 +979,11 @@ <td>' . $Requirement->Requirement . '</td> <td class="number">' . $Requirement->Quantity . '</td> <td class="number">' . $Requirement->CostPerUnit . '</td> - <td class="number">' . number_format(($Requirement->CostPerUnit * $Requirement->Quantity),2) . '</td> + <td class="number">' . locale_number_format(($Requirement->CostPerUnit * $Requirement->Quantity),2) . '</td> </tr>'; $ContractReqtsCost += ($Requirement->CostPerUnit * $Requirement->Quantity); } - echo '<tr><th colspan="3"><b>' . _('Total other costs') . '</b></th><th class="number"><b>' . number_format($ContractReqtsCost,2) . '</b></th></tr>'; + echo '<tr><th colspan="3"><b>' . _('Total other costs') . '</b></th><th class="number"><b>' . locale_number_format($ContractReqtsCost,2) . '</b></th></tr>'; } else { //there are no items set up against this contract echo '<tr><td colspan="4"><i>' . _('None Entered') . '</i></td></tr>'; } @@ -991,9 +991,9 @@ echo '<br />'; echo'<table class="selection"> <tr><th>' . _('Total Contract Cost') . '</th> - <th class="number">' . number_format(($ContractBOMCost+$ContractReqtsCost),$_SESSION['CompanyRecord']['decimalplaces']) . '</th> + <th class="number">' . locale_number_format(($ContractBOMCost+$ContractReqtsCost),$_SESSION['CompanyRecord']['decimalplaces']) . '</th> <th>' . _('Contract Price') . '</th> - <th class="number">' . number_format(($ContractBOMCost+$ContractReqtsCost)/((100-$_SESSION['Contract'.$identifier]->Margin)/100),$_SESSION['CompanyRecord']['decimalplaces']) . '</th> + <th class="number">' . locale_number_format(($ContractBOMCost+$ContractReqtsCost)/((100-$_SESSION['Contract'.$identifier]->Margin)/100),$_SESSION['CompanyRecord']['decimalplaces']) . '</th> </tr> </table>'; Modified: trunk/CounterSales.php =================================================================== --- trunk/CounterSales.php 2011-09-07 09:40:43 UTC (rev 4681) +++ trunk/CounterSales.php 2011-09-09 03:39:04 UTC (rev 4682) @@ -1,2339 +1,2343 @@ -<?php -/* $Id: CounterSales.php 4469 2011-01-15 02:28:37Z daintree $*/ - -include('includes/DefineCartClass.php'); - -/* Session started in session.inc for password checking and authorisation level check -config.php is in turn included in session.inc $PageSecurity now comes from session.inc (and gets read in by GetConfig.php*/ - -include('includes/session.inc'); - -$title = _('Counter Sales'); - -include('includes/header.inc'); -include('includes/GetPrice.inc'); -include('includes/SQL_CommonFunctions.inc'); -include('includes/GetSalesTransGLCodes.inc'); - -if (empty($_GET['identifier'])) { - $identifier=date('U'); -} else { - $identifier=$_GET['identifier']; -} -if (isset($_SESSION['Items'.$identifier]) AND isset($_POST['CustRef'])){ - //update the Items object variable with the data posted from the form - $_SESSION['Items'.$identifier]->CustRef = $_POST['CustRef']; - $_SESSION['Items'.$identifier]->Comments = $_POST['Comments']; - $_SESSION['Items'.$identifier]->DeliverTo = $_POST['DeliverTo']; - $_SESSION['Items'.$identifier]->PhoneNo = $_POST['PhoneNo']; - $_SESSION['Items'.$identifier]->Email = $_POST['Email']; -} - -if (isset($_POST['QuickEntry'])){ - 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($_GET['NewItem'])){ - $NewItem = trim($_GET['NewItem']); -} - -if (isset($_GET['NewOrder'])){ - /*New order entry - clear any existing order details from the Items object and initiate a newy*/ - if (isset($_SESSION['Items'.$identifier])){ - unset ($_SESSION['Items'.$identifier]->LineItems); - $_SESSION['Items'.$identifier]->ItemsOrdered=0; - unset ($_SESSION['Items'.$identifier]); - } -} - - -if (!isset($_SESSION['Items'.$identifier])){ - /* It must be a new order being created $_SESSION['Items'.$identifier] would be set up from the order - modification code above if a modification to an existing order. Also $ExistingOrder would be - set to 1. The delivery check screen is where the details of the order are either updated or - inserted depending on the value of ExistingOrder */ - - $_SESSION['ExistingOrder'] = 0; - $_SESSION['Items'.$identifier] = new cart; - $_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'] ."'"; - $result = DB_query($sql,$db); - if (DB_num_rows($result)==0) { - prnMsg(_('Your user account does not have a valid default inventory location set up. Please see the system administrator to modify your user account.'),'error'); - include('includes/footer.inc'); - exit; - } else { - $myrow = DB_fetch_array($result); //get the only row returned - - if ($myrow['cashsalecustomer']=='' OR $myrow['cashsalebranch']==''){ - prnMsg(_('To use this script it is first necessary to define a cash sales customer for the location that is your default location. The default cash sale customer is defined under set up ->Inventory Locations Maintenance. The customer should be entered using the customer code and a valid branch code of the customer entered.'),'error'); - include('includes/footer.inc'); - exit; - } - if (isset($_GET['DebtorNo'])) { - $_SESSION['Items'.$identifier]->DebtorNo = $_GET['DebtorNo']; - $_SESSION['Items'.$identifier]->Branch = $_GET['BranchNo']; - } else { - $_SESSION['Items'.$identifier]->Branch = $myrow['cashsalebranch']; - $_SESSION['Items'.$identifier]->DebtorNo = $myrow['cashsalecustomer']; - } - - $_SESSION['Items'.$identifier]->LocationName = $myrow['locationname']; - $_SESSION['Items'.$identifier]->Location = $_SESSION['UserStockLocation']; - $_SESSION['Items'.$identifier]->DispatchTaxProvince = $myrow['taxprovinceid']; - - // Now check to ensure this account exists and set defaults */ - $sql = "SELECT debtorsmaster.name, - holdreasons.dissallowinvoices, - debtorsmaster.salestype, - salestypes.sales_type, - debtorsmaster.currcode, - debtorsmaster.customerpoline, - paymentterms.terms, - currencies.decimalplaces - FROM debtorsmaster INNER JOIN holdreasons - ON debtorsmaster.holdreason=holdreasons.reasoncode - INNER JOIN salestypes - ON debtorsmaster.salestype=salestypes.typeabbrev - INNER JOIN paymentterms - ON debtorsmaster.paymentterms=paymentterms.termsindicator - INNER JOIN currencies - ON debtorsmaster.currcode=currencies.currabrev - WHERE debtorsmaster.debtorno = '" . $_SESSION['Items'.$identifier]->DebtorNo . "'"; - - $ErrMsg = _('The details of the customer selected') . ': ' . $_SESSION['Items'.$identifier]->DebtorNo . ' ' . _('cannot be retrieved because'); - $DbgMsg = _('The SQL used to retrieve the customer details and failed was') . ':'; - // echo $sql; - $result =DB_query($sql,$db,$ErrMsg,$DbgMsg); - - $myrow = DB_fetch_array($result); - if ($myrow['dissallowinvoices'] != 1){ - if ($myrow['dissallowinvoices']==2){ - prnMsg($myrow['name'] . ' ' . _('Although this account is defined as the cash sale account for the location. The account is currently flagged as an account that needs to be watched. Please contact the credit control personnel to discuss'),'warn'); - } - - $_SESSION['RequireCustomerSelection']=0; - $_SESSION['Items'.$identifier]->CustomerName = $myrow['name']; - // the sales type is the price list to be used for this sale - $_SESSION['Items'.$identifier]->DefaultSalesType = $myrow['salestype']; - $_SESSION['Items'.$identifier]->SalesTypeName = $myrow['sales_type']; - $_SESSION['Items'.$identifier]->DefaultCurrency = $myrow['currcode']; - $_SESSION['Items'.$identifier]->DefaultPOLine = $myrow['customerpoline']; - $_SESSION['Items'.$identifier]->PaymentTerms = $myrow['terms']; - $_SESSION['Items'.$identifier]->CurrDecimalPlaces = $myrow['decimalplaces']; - /* now get the branch defaults from the customer branches table CustBranch. */ - - $sql = "SELECT custbranch.brname, - custbranch.braddress1, - custbranch.defaultshipvia, - custbranch.deliverblind, - custbranch.specialinstructions, - custbranch.estdeliverydays, - custbranch.salesman, - custbranch.taxgroupid, - custbranch.defaultshipvia - FROM custbranch - WHERE custbranch.branchcode='" . $_SESSION['Items'.$identifier]->Branch . "' - AND custbranch.debtorno = '" . $_SESSION['Items'.$identifier]->DebtorNo . "'"; - $ErrMsg = _('The customer branch record of the customer selected') . ': ' . $_SESSION['Items'.$identifier]->Branch . ' ' . _('cannot be retrieved because'); - $DbgMsg = _('SQL used to retrieve the branch details was') . ':'; - $result =DB_query($sql,$db,$ErrMsg,$DbgMsg); - - if (DB_num_rows($result)==0){ - - prnMsg(_('The branch details for branch code') . ': ' . $_SESSION['Items'.$identifier]->Branch . ' ' . _('against customer code') . ': ' . $_POST['Select'] . ' ' . _('could not be retrieved') . '. ' . _('Check the set up of the customer and branch'),'error'); - - if ($debug==1){ - echo '<br />' . _('The SQL that failed to get the branch details was') . ':<br />' . $sql; - } - include('includes/footer.inc'); - exit; - } - // add echo - echo '<br />'; - $myrow = DB_fetch_array($result); - - $_SESSION['Items'.$identifier]->DeliverTo = ''; - $_SESSION['Items'.$identifier]->DelAdd1 = $myrow['braddress1']; - $_SESSION['Items'.$identifier]->ShipVia = $myrow['defaultshipvia']; - $_SESSION['Items'.$identifier]->DeliverBlind = $myrow['deliverblind']; - $_SESSION['Items'.$identifier]->SpecialInstructions = $myrow['specialinstructions']; - $_SESSION['Items'.$identifier]->DeliveryDays = $myrow['estdeliverydays']; - $_SESSION['Items'.$identifier]->TaxGroup = $myrow['taxgroupid']; - - if ($_SESSION['Items'.$identifier]->SpecialInstructions) { - prnMsg($_SESSION['Items'.$identifier]->SpecialInstructions,'warn'); - } - - if ($_SESSION['CheckCreditLimits'] > 0) { /*Check credit limits is 1 for warn and 2 for prohibit sales */ - $_SESSION['Items'.$identifier]->CreditAvailable = GetCreditAvailable($_SESSION['Items'.$identifier]->DebtorNo,$db); - - if ($_SESSION['CheckCreditLimits']==1 AND $_SESSION['Items'.$identifier]->CreditAvailable <=0){ - prnMsg(_('The') . ' ' . $myrow['brname'] . ' ' . _('account is currently at or over their credit limit'),'warn'); - } elseif ($_SESSION['CheckCreditLimits']==2 AND $_SESSION['Items'.$identifier]->CreditAvailable <=0){ - prnMsg(_('No more orders can be placed by') . ' ' . $myrow[0] . ' ' . _(' their account is currently at or over their credit limit'),'warn'); - include('includes/footer.inc'); - exit; - } - } - - } else { - prnMsg($myrow['brname'] . ' ' . _('Although the account is defined as the cash sale account for the location the account is currently on hold. Please contact the credit control personnel to discuss'),'warn'); - } - - } -} // end if its a new sale to be set up ... - -if (isset($_POST['CancelOrder'])) { - - - unset($_SESSION['Items'.$identifier]->LineItems); - $_SESSION['Items'.$identifier]->ItemsOrdered = 0; - unset($_SESSION['Items'.$identifier]); - $_SESSION['Items'.$identifier] = new cart; - - echo '<br /><br />'; - prnMsg(_('This sale has been cancelled as requested'),'success'); - echo '<br /><br /><a href="' .$_SERVER['PHP_SELF'] . '">' . _('Start a new Counter Sale') . '</a>'; - include('includes/footer.inc'); - exit; - -} else { /*Not cancelling the order */ - - echo '<p class="page_title_text"><img src="'.$rootpath.'/css/'.$theme.'/images/inventory.png" title="' . _('Counter Sales') . '" alt="" />' . ' '; - echo $_SESSION['Items'.$identifier]->CustomerName . ' ' . _('Counter Sale') . ' ' ._('from') . ' ' . $_SESSION['Items'.$identifier]->LocationName . ' ' . _('inventory') . ' (' . _('all amounts in') . ' ' . $_SESSION['Items'.$identifier]->DefaultCurrency . ')'; - echo '</p>'; -} - -if (isset($_POST['Search']) or isset($_POST['Next']) or isset($_POST['Prev'])){ - - 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']=='') { - $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>'; - } - if (isset($_POST['Keywords']) AND mb_strlen($_POST['Keywords'])>0) { - //insert wildcard characters in spaces - $_POST['Keywords'] = mb_strtoupper($_POST['Keywords']); - $SearchString = '%' . str_replace(' ', '%', $_POST['Keywords']) . '%'; - - if ($_POST['StockCat']=='All'){ - $SQL = "SELECT stockmaster.stockid, - stockmaster.description, - stockmaster.units - FROM stockmaster, - stockcategory - WHERE stockmaster.categoryid=stockcategory.categoryid - AND (stockcategory.stocktype='F' OR stockcategory.stocktype='D') - AND stockmaster.mbflag <>'G' - AND stockmaster.controlled <> 1 - AND stockmaster.description " . LIKE . " '" . $SearchString . "' - AND stockmaster.discontinued=0 - ORDER BY stockmaster.stockid"; - } else { - $SQL = "SELECT stockmaster.stockid, - stockmaster.description, - stockmaster.units - FROM stockmaster, stockcategory - WHERE stockmaster.categoryid=stockcategory.categoryid - AND (stockcategory.stocktype='F' OR stockcategory.stocktype='D') - AND stockmaster.mbflag <>'G' - AND stockmaster.controlled <> 1 - AND stockmaster.discontinued=0 - AND stockmaster.description " . LIKE . " '" . $SearchString . "' - AND stockmaster.categoryid='" . $_POST['StockCat'] . "' - ORDER BY stockmaster.stockid"; - } - - } else if (mb_strlen($_POST['StockCode'])>0){ - - $_POST['StockCode'] = mb_strtoupper($_POST['StockCode']); - $SearchString = '%' . $_POST['StockCode'] . '%'; - - if ($_POST['StockCat']=='All'){ - $SQL = "SELECT stockmaster.stockid, - stockmaster.description, - stockmaster.units - FROM stockmaster, stockcategory - WHERE stockmaster.categoryid=stockcategory.categoryid - AND (stockcategory.stocktype='F' OR stockcategory.stocktype='D') - AND stockmaster.stockid " . LIKE . " '" . $SearchString . "' - AND stockmaster.mbflag <>'G' - AND stockmaster.controlled <> 1 - AND stockmaster.discontinued=0 - ORDER BY stockmaster.stockid"; - } else { - $SQL = "SELECT stockmaster.stockid, - stockmaster.description, - stockmaster.units - FROM stockmaster, stockcategory - WHERE stockmaster.categoryid=stockcategory.categoryid - AND (stockcategory.stocktype='F' OR stockcategory.stocktype='D') - AND stockmaster.stockid " . LIKE . " '" . $SearchString . "' - AND stockmaster.mbflag <>'G' - AND stockmaster.controlled <> 1 - AND stockmaster.discontinued=0 - AND stockmaster.categoryid='" . $_POST['StockCat'] . "' - ORDER BY stockmaster.stockid"; - } - - } else { - if ($_POST['StockCat']=='All'){ - $SQL = "SELECT stockmaster.stockid, - stockmaster.description, - stockmaster.units - FROM stockmaster, stockcategory - WHERE stockmaster.categoryid=stockcategory.categoryid - AND (stockcategory.stocktype='F' OR stockcategory.stocktype='D') - AND stockmaster.mbflag <>'G' - AND stockmaster.controlled <> 1 - AND stockmaster.discontinued=0 - ORDER BY stockmaster.stockid"; - } else { - $SQL = "SELECT stockmaster.stockid, - stockmaster.description, - stockmaster.units - FROM stockmaster, stockcategory - WHERE stockmaster.categoryid=stockcategory.categoryid - AND (stockcategory.stocktype='F' OR stockcategory.stocktype='D') - AND stockmaster.mbflag <>'G' - AND stockmaster.controlled <> 1 - AND stockmaster.discontinued=0 - AND stockmaster.categoryid='" . $_POST['StockCat'] . "' - ORDER BY stockmaster.stockid"; - } - } - - if (isset($_POST['Next'])) { - $Offset = $_POST['NextList']; - } - if (isset($_POST['Prev'])) { - $Offset = $_POST['previous']; - } - if (!isset($Offset) or $Offset<0) { - $Offset=0; - } - $SQL = $SQL . ' LIMIT ' . $_SESSION['DefaultDisplayRecordsMax'].' OFFSET '.number_format($_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'); - $SearchResult = DB_query($SQL,$db,$ErrMsg, $DbgMsg); - - if (DB_num_rows($SearchResult)==0 ){ - prnMsg (_('There are no products available meeting the criteria specified'),'info'); - } - if (DB_num_rows($SearchResult)==1){ - $myrow=DB_fetch_array($SearchResult); - $NewItem = $myrow['stockid']; - DB_data_seek($SearchResult,0); - } - if (DB_num_rows($SearchResult)< $_SESSION['DisplayRecordsMax']){ - $Offset=0; - } - -} //end of if search - - -/* Always do the stuff below */ - -echo '<form action="' . $_SERVER['PHP_SELF'] . '?identifier='.$identifier . '" name="SelectParts" method="post">'; -echo '<input type="hidden" name="FormID" value="' . $_SESSION['FormID'] . '" />'; - -//Get The exchange rate used for GPPercent calculations on adding or amending items -if ($_SESSION['Items'.$identifier]->DefaultCurrency != $_SESSION['CompanyRecord']['currencydefault']){ - $ExRateResult = DB_query("SELECT rate FROM currencies WHERE currabrev='" . $_SESSION['Items'.$identifier]->DefaultCurrency . "'",$db); - if (DB_num_rows($ExRateResult)>0){ - $ExRateRow = DB_fetch_row($ExRateResult); - $ExRate = $ExRateRow[0]; - } else { - $ExRate =1; - } -} else { - $ExRate = 1; -} - -/*Process Quick Entry */ -/* If enter is pressed on the quick entry screen, the default button may be Recalculate */ - if (isset($_POST['OrderItems']) - OR isset($_POST['QuickEntry']) - OR isset($_POST['Recalculate'])){ - - /* get the item details from the database and hold them in the cart object */ - - /*Discount can only be set later on -- after quick entry -- so default discount to 0 in the first place */ - $Discount = 0; - - $i=1; - while ($i<=$_SESSION['QuickEntries'] - AND isset($_POST['part_' . $i]) - AND $_POST['part_' . $i]!='') { - - $QuickEntryCode = 'part_' . $i; - $QuickEntryQty = 'qty_' . $i; - $QuickEntryPOLine = 'poline_' . $i; - $QuickEntryItemDue = 'ItemDue_' . $i; - - $i++; - - if (isset($_POST[$QuickEntryCode])) { - $NewItem = mb_strtoupper($_POST[$QuickEntryCode]); - } - if (isset($_POST[$QuickEntryQty])) { - $NewItemQty = $_POST[$QuickEntryQty]; - } - if (isset($_POST[$QuickEntryItemDue])) { - $NewItemDue = $_POST[$QuickEntryItemDue]; - } else { - $NewItemDue = DateAdd (Date($_SESSION['DefaultDateFormat']),'d', $_SESSION['Items'.$identifier]->DeliveryDays); - } - if (isset($_POST[$QuickEntryPOLine])) { - $NewPOLine = $_POST[$QuickEntryPOLine]; - } else { - $NewPOLine = 0; - } - - if (!isset($NewItem)){ - unset($NewItem); - break; /* break out of the loop if nothing in the quick entry fields*/ - } - - 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'); - //Attempt to default the due date to something sensible? - $NewItemDue = DateAdd (Date($_SESSION['DefaultDateFormat']),'d', $_SESSION['Items'.$identifier]->DeliveryDays); - } - /*Now figure out if the item is a kit set - the field MBFlag='K'*/ - $sql = "SELECT stockmaster.mbflag, - stockmaster.controlled - FROM stockmaster - WHERE stockmaster.stockid='". $NewItem ."'"; - - $ErrMsg = _('Could not determine if the part being ordered was a kitset or not because'); - $DbgMsg = _('The sql that was used to determine if the part being ordered was a kitset or not was '); - $KitResult = DB_query($sql, $db,$ErrMsg,$DbgMsg); - - - if (DB_num_rows($KitResult)==0){ - prnMsg( _('The item code') . ' ' . $NewItem . ' ' . _('could not be retrieved from the databas... [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->ItemDescription . '</td> <td class="number">' . $Component->Quantity . '</td> <td>' . $Component->UOM . '</td> - <td class="number">' . number_format($Component->ItemCost,$_SESSION['CompanyRecord']['decimalplaces']) . '</td> - <td class="number">' . number_format(($Component->ItemCost * $Component->Quantity),$_SESSION['CompanyRecord']['decimalplaces']) . '</td>'; + <td class="number">' . locale_number_format($Component->ItemCost,$_SESSION['CompanyRecord']['decimalplaces']) . '</td> + <td class="number">' . locale_number_format(($Component->ItemCost * $Component->Quantity),$_SESSION['CompanyRecord']['decimalplaces']) . '</td>'; $ContractBOMBudget += ($Component->ItemCost * $Component->Quantity); @@ -104,8 +104,8 @@ echo '<td colspan="2" align="center">' . _('Actual usage') . '</td> <td class="number">' . -$InventoryIssues[$Component->StockID]->Quantity . '</td> <td>' . $InventoryIssues[$Component->StockID]->Units . '</td> - <td class="number">' . number_format($InventoryIssues[$Component->StockID]->TotalCost/$InventoryIssues[$Component->StockID]->Quantity,$_SESSION['CompanyRecord']['decimalplaces']) . '</td> - <td>' . number_format(-$InventoryIssues[$Component->StockID]->TotalCost,$_SESSION['CompanyRecord']['decimalplaces']) . '</td> + <td class="number">' . locale_number_format($InventoryIssues[$Component->StockID]->TotalCost/$InventoryIssues[$Component->StockID]->Quantity,$_SESSION['CompanyRecord']['decimalplaces']) . '</td> + <td>' . locale_number_format(-$InventoryIssues[$Component->StockID]->TotalCost,$_SESSION['CompanyRecord']['decimalplaces']) . '</td> </tr>'; } else { echo '<td colspan="6"></td> @@ -122,17 +122,17 @@ <td>' . $Component->Description . '</td> <td class="number">' . -$Component->Quantity . '</td> <td>' . $Component->Units . '</td> - <td class="number">' . number_format($Component->TotalCost/$Component->Quantity,$_SESSION['CompanyRecord']['decimalplaces']) . '</td> - <td class="number">' . number_format(-$Component->TotalCost,$_SESSION['CompanyRecord']['decimalplaces']) . '</td> + <td class="number">' . locale_number_format($Component->TotalCost/$Component->Quantity,$_SESSION['CompanyRecord']['decimalplaces']) . '</td> + <td class="number">' . locale_number_format(-$Component->TotalCost,$_SESSION['CompanyRecord']['decimalplaces']) . '</td> </tr>'; } //end if its a component not originally budget for } echo '<tr> <td class="number" colspan="5">' . _('Total Inventory Budgeted Cost') . ':</td> - <td class="number">' . number_format($ContractBOMBudget,$_SESSION['CompanyRecord']['decimalplaces']) . '</td> + <td class="number">' . locale_number_format($ContractBOMBudget,$_SESSION['CompanyRecord']['decimalplaces']) . '</td> <td class="number" colspan="5">' . _('Total Inventory Actual Cost') . ':</td> - <td class="number">' . number_format($ContractBOMActual,$_SESSION['CompanyRecord']['decimalplaces']) . '</td> + <td class="number">' . locale_number_format($ContractBOMActual,$_SESSION['CompanyRecord']['decimalplaces']) . '</td> </tr>'; echo '<tr> @@ -154,11 +154,11 @@ echo '<tr><td>' . $Requirement->Requirement . '</td> <td class="number">' . $Requirement->Quantity . '</td> <td class="number">' . $Requirement->CostPerUnit . '</td> - <td class="number">' . number_format(($Requirement->CostPerUnit * $Requirement->Quantity),$_SESSION['CompanyRecord']['decimalplaces']) . '</td> + <td class="number">' . locale_number_format(($Requirement->CostPerUnit * $Requirement->Quantity),$_SESSION['CompanyRecord']['decimalplaces']) . '</td> </tr>'; $OtherReqtsBudget += ($Requirement->CostPerUnit * $Requirement->Quantity); } -echo '<tr><th colspan="3" align="right"><b>' . _('Budgeted Other Costs') . '</b></th><th class="number"><b>' . number_format($OtherReqtsBudget,2) . '</b></th></tr> +echo '<tr><th colspan="3" align="right"><b>' . _('Budgeted Other Costs') . '</b></th><th class="number"><b>' . locale_number_format($OtherReqtsBudget,2) . '</b></th></tr> </table></td>'; //Now other requirements actual in a sub table @@ -197,17 +197,17 @@ <td>' . $OtherChargesRow['suppreference'] . '</td> <td>' .ConvertSQLDate($OtherChargesRow['trandate']) . '</td> <td>' . $OtherChargesRow['narrative'] . '</td> - <td class="number">' . number_format($OtherChargesRow['amount'],$_SESSION['CompanyRecord']['decimalplaces']) . '</td> + <td class="number">' . locale_number_format($OtherChargesRow['amount'],$_SESSION['CompanyRecord']['decimalplaces']) . '</td> <td>' . $Anticipated . '</td> </tr>'; $OtherReqtsActual +=$OtherChargesRow['amount']; } -echo '<tr><th colspan="4" align="right"><b>' . _('Actual Other Costs') . '</b></th><th class="number"><b>' . number_format($OtherReqtsActual,$_SESSION['CompanyRecord']['decimalplaces']) . '</b></th></tr> +echo '<tr><th colspan="4" align="right"><b>' . _('Actual Other Costs') . '</b></th><th class="number"><b>' . locale_number_format($OtherReqtsActual,$_SESSION['CompanyRecord']['decimalplaces']) . '</b></th></tr> </table></td></tr>'; echo '<tr><td colspan="5"><b>' . _('Total Budget Contract Cost') . '</b></td> - <td class="number"><b>' . number_format($OtherReqtsBudget+$ContractBOMBudget,$_SESSION['CompanyRecord']['decimalplaces']) . '</b></td> + <td class="number"><b>' . locale_number_format($OtherReqtsBudget+$ContractBOMBudget,$_SESSION['CompanyRecord']['decimalplaces']) . '</b></td> <td colspan="5"><b>' . _('Total Actual Contract Cost') . '</b></td> - <td class="number"><b>' . number_format($OtherReqtsActual+$ContractBOMActual,$_SESSION['CompanyRecord']['decimalplaces']) . '</b></td></tr>'; + <td class="number"><b>' . locale_number_format($OtherReqtsActual+$ContractBOMActual,$_SESSION['CompanyRecord']['decimalplaces']) . '</b></td></tr>'; echo '</table>'; @@ -378,7 +378,7 @@ '" . Date('Y-m-d') . "', '" . $PeriodNo . "', '" . $GLCodes['stockact'] . "', - '" . $_SESSION['Contract'.$identifier]->WO . ' ' . $_SESSION['Contract'.$identifier]->ContractRef . ' - x 1 @ ' . number_format(($OtherReqtsBudget+$ContractBOMBudget),2) . "', + '" . $_SESSION['Contract'.$identifier]->WO . ' ' . $_SESSION['Contract'.$identifier]->ContractRef . ' - x 1 @ ' . locale_number_format(($OtherReqtsBudget+$ContractBOMBudget),2) . "', '" . ($OtherReqtsBudget+$ContractBOMBudget) . "')"; $ErrMsg = _('CRITICAL ERROR') . '! ' . _('NOTE DOWN THIS ERROR AND SEEK ASSISTANCE') . ': ' . _('The receipt of contract work order finished stock GL posting could not be inserted because'); @@ -398,7 +398,7 @@ '" . Date('Y-m-d') . "', '" . $PeriodNo . "', '" . $GLCodes['wipact'] . "', - '" . $_SESSION['Contract'.$identifier]->WO . ' ' . $_SESSION['Contract'.$identifier]->ContractRef . ' - x 1 @ ' . number_format(($OtherReqtsBudget+$ContractBOMBudget),2) . "', + '" . $_SESSION['Contract'.$identifier]->WO . ' ' . $_SESSION['Contract'.$identifier]->ContractRef . ' - x 1 @ ' . locale_number_format(($OtherReqtsBudget+$ContractBOMBudget),2) . "', '" . -($OtherReqtsBudget+$ContractBOMBudget) . "')"; $ErrMsg = _('CRITICAL ERROR') . '! ' . _('NOTE DOWN THIS ERROR AND SEEK ASSISTANCE') . ': ' . _('The WIP credit on receipt of finished items from a work order GL posting could not be inserted because'); Modified: trunk/ContractOtherReqts.php =================================================================== --- trunk/ContractOtherReqts.php 2011-09-07 09:40:43 UTC (rev 4681) +++ trunk/ContractOtherReqts.php 2011-09-09 03:39:04 UTC (rev 4682) @@ -100,7 +100,7 @@ foreach ($_SESSION['Contract'.$identifier]->ContractReqts as $ContractReqtID => $ContractComponent) { $LineTotal = $ContractComponent->Quantity * $ContractComponent->CostPerUnit; - $DisplayLineTotal = number_format($LineTotal,$_SESSION['CompanyRecord']['decimalplaces']); + $DisplayLineTotal = locale_number_format($LineTotal,$_SESSION['CompanyRecord']['decimalplaces']); if ($k==1){ echo '<tr class="EvenTableRows">'; @@ -118,7 +118,7 @@ $TotalCost += $LineTotal; } - $DisplayTotal = number_format($TotalCost,2); + $DisplayTotal = locale_number_format($TotalCost,2); echo '<tr><td colspan="4" class="number">' . _('Total Other Requirements Cost') . '</td><td class="number"><b>' . $DisplayTotal . '</b></td></tr></table>'; echo '<br /><div class="centre"><input type="submit" name="UpdateLines" value="' . _('Update Other Requirements Lines') . '" />'; echo ' <input type="submit" name="BackToHeader" value="' . _('Back To Contract Header') . '" /></div>'; Modified: trunk/Contracts.php =================================================================== --- trunk/Contracts.php 2011-09-07 09:40:43 UTC (rev 4681) +++ trunk/Contracts.php 2011-09-09 03:39:04 UTC (rev 4682) @@ -946,14 +946,14 @@ <td>' . $Component->ItemDescription . '</td> <td class="number">' . $Component->Quantity . '</td> <td>' . $Component->UOM . '</td> - <td class="number">' . number_format($Component->ItemCost,2) . '</td> - <td class="number">' . number_format(($Component->ItemCost * $Component->Quantity),2) . '</td> + <td class="number">' . locale_number_format($Component->ItemCost,2) . '</td> + <td class="number">' . locale_number_format(($Component->ItemCost * $Component->Quantity),2) . '</td> </tr>'; $ContractBOMCost += ($Component->ItemCost * $Component->Quantity); } echo '<tr> <th colspan="5"><b>' . _('Total stock cost') . '</b></th> - <th class="number"><b>' . number_format($ContractBOMCost,2) . '</b></th> + <th class="number"><b>' . locale_number_format($ContractBOMCost,2) . '</b></th> </tr>'; } else { //there are no items set up against this contract echo '<tr> @@ -979,11 +979,11 @@ <td>' . $Requirement->Requirement . '</td> <td class="number">' . $Requirement->Quantity . '</td> <td class="number">' . $Requirement->CostPerUnit . '</td> - <td class="number">' . number_format(($Requirement->CostPerUnit * $Requirement->Quantity),2) . '</td> + <td class="number">' . locale_number_format(($Requirement->CostPerUnit * $Requirement->Quantity),2) . '</td> </tr>'; $ContractReqtsCost += ($Requirement->CostPerUnit * $Requirement->Quantity); } - echo '<tr><th colspan="3"><b>' . _('Total other costs') . '</b></th><th class="number"><b>' . number_format($ContractReqtsCost,2) . '</b></th></tr>'; + echo '<tr><th colspan="3"><b>' . _('Total other costs') . '</b></th><th class="number"><b>' . locale_number_format($ContractReqtsCost,2) . '</b></th></tr>'; } else { //there are no items set up against this contract echo '<tr><td colspan="4"><i>' . _('None Entered') . '</i></td></tr>'; } @@ -991,9 +991,9 @@ echo '<br />'; echo'<table class="selection"> <tr><th>' . _('Total Contract Cost') . '</th> - <th class="number">' . number_format(($ContractBOMCost+$ContractReqtsCost),$_SESSION['CompanyRecord']['decimalplaces']) . '</th> + <th class="number">' . locale_number_format(($ContractBOMCost+$ContractReqtsCost),$_SESSION['CompanyRecord']['decimalplaces']) . '</th> <th>' . _('Contract Price') . '</th> - <th class="number">' . number_format(($ContractBOMCost+$ContractReqtsCost)/((100-$_SESSION['Contract'.$identifier]->Margin)/100),$_SESSION['CompanyRecord']['decimalplaces']) . '</th> + <th class="number">' . locale_number_format(($ContractBOMCost+$ContractReqtsCost)/((100-$_SESSION['Contract'.$identifier]->Margin)/100),$_SESSION['CompanyRecord']['decimalplaces']) . '</th> </tr> </table>'; Modified: trunk/CounterSales.php =================================================================== --- trunk/CounterSales.php 2011-09-07 09:40:43 UTC (rev 4681) +++ trunk/CounterSales.php 2011-09-09 03:39:04 UTC (rev 4682) @@ -1,2339 +1,2343 @@ -<?php -/* $Id: CounterSales.php 4469 2011-01-15 02:28:37Z daintree $*/ - -include('includes/DefineCartClass.php'); - -/* Session started in session.inc for password checking and authorisation level check -config.php is in turn included in session.inc $PageSecurity now comes from session.inc (and gets read in by GetConfig.php*/ - -include('includes/session.inc'); - -$title = _('Counter Sales'); - -include('includes/header.inc'); -include('includes/GetPrice.inc'); -include('includes/SQL_CommonFunctions.inc'); -include('includes/GetSalesTransGLCodes.inc'); - -if (empty($_GET['identifier'])) { - $identifier=date('U'); -} else { - $identifier=$_GET['identifier']; -} -if (isset($_SESSION['Items'.$identifier]) AND isset($_POST['CustRef'])){ - //update the Items object variable with the data posted from the form - $_SESSION['Items'.$identifier]->CustRef = $_POST['CustRef']; - $_SESSION['Items'.$identifier]->Comments = $_POST['Comments']; - $_SESSION['Items'.$identifier]->DeliverTo = $_POST['DeliverTo']; - $_SESSION['Items'.$identifier]->PhoneNo = $_POST['PhoneNo']; - $_SESSION['Items'.$identifier]->Email = $_POST['Email']; -} - -if (isset($_POST['QuickEntry'])){ - 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($_GET['NewItem'])){ - $NewItem = trim($_GET['NewItem']); -} - -if (isset($_GET['NewOrder'])){ - /*New order entry - clear any existing order details from the Items object and initiate a newy*/ - if (isset($_SESSION['Items'.$identifier])){ - unset ($_SESSION['Items'.$identifier]->LineItems); - $_SESSION['Items'.$identifier]->ItemsOrdered=0; - unset ($_SESSION['Items'.$identifier]); - } -} - - -if (!isset($_SESSION['Items'.$identifier])){ - /* It must be a new order being created $_SESSION['Items'.$identifier] would be set up from the order - modification code above if a modification to an existing order. Also $ExistingOrder would be - set to 1. The delivery check screen is where the details of the order are either updated or - inserted depending on the value of ExistingOrder */ - - $_SESSION['ExistingOrder'] = 0; - $_SESSION['Items'.$identifier] = new cart; - $_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'] ."'"; - $result = DB_query($sql,$db); - if (DB_num_rows($result)==0) { - prnMsg(_('Your user account does not have a valid default inventory location set up. Please see the system administrator to modify your user account.'),'error'); - include('includes/footer.inc'); - exit; - } else { - $myrow = DB_fetch_array($result); //get the only row returned - - if ($myrow['cashsalecustomer']=='' OR $myrow['cashsalebranch']==''){ - prnMsg(_('To use this script it is first necessary to define a cash sales customer for the location that is your default location. The default cash sale customer is defined under set up ->Inventory Locations Maintenance. The customer should be entered using the customer code and a valid branch code of the customer entered.'),'error'); - include('includes/footer.inc'); - exit; - } - if (isset($_GET['DebtorNo'])) { - $_SESSION['Items'.$identifier]->DebtorNo = $_GET['DebtorNo']; - $_SESSION['Items'.$identifier]->Branch = $_GET['BranchNo']; - } else { - $_SESSION['Items'.$identifier]->Branch = $myrow['cashsalebranch']; - $_SESSION['Items'.$identifier]->DebtorNo = $myrow['cashsalecustomer']; - } - - $_SESSION['Items'.$identifier]->LocationName = $myrow['locationname']; - $_SESSION['Items'.$identifier]->Location = $_SESSION['UserStockLocation']; - $_SESSION['Items'.$identifier]->DispatchTaxProvince = $myrow['taxprovinceid']; - - // Now check to ensure this account exists and set defaults */ - $sql = "SELECT debtorsmaster.name, - holdreasons.dissallowinvoices, - debtorsmaster.salestype, - salestypes.sales_type, - debtorsmaster.currcode, - debtorsmaster.customerpoline, - paymentterms.terms, - currencies.decimalplaces - FROM debtorsmaster INNER JOIN holdreasons - ON debtorsmaster.holdreason=holdreasons.reasoncode - INNER JOIN salestypes - ON debtorsmaster.salestype=salestypes.typeabbrev - INNER JOIN paymentterms - ON debtorsmaster.paymentterms=paymentterms.termsindicator - INNER JOIN currencies - ON debtorsmaster.currcode=currencies.currabrev - WHERE debtorsmaster.debtorno = '" . $_SESSION['Items'.$identifier]->DebtorNo . "'"; - - $ErrMsg = _('The details of the customer selected') . ': ' . $_SESSION['Items'.$identifier]->DebtorNo . ' ' . _('cannot be retrieved because'); - $DbgMsg = _('The SQL used to retrieve the customer details and failed was') . ':'; - // echo $sql; - $result =DB_query($sql,$db,$ErrMsg,$DbgMsg); - - $myrow = DB_fetch_array($result); - if ($myrow['dissallowinvoices'] != 1){ - if ($myrow['dissallowinvoices']==2){ - prnMsg($myrow['name'] . ' ' . _('Although this account is defined as the cash sale account for the location. The account is currently flagged as an account that needs to be watched. Please contact the credit control personnel to discuss'),'warn'); - } - - $_SESSION['RequireCustomerSelection']=0; - $_SESSION['Items'.$identifier]->CustomerName = $myrow['name']; - // the sales type is the price list to be used for this sale - $_SESSION['Items'.$identifier]->DefaultSalesType = $myrow['salestype']; - $_SESSION['Items'.$identifier]->SalesTypeName = $myrow['sales_type']; - $_SESSION['Items'.$identifier]->DefaultCurrency = $myrow['currcode']; - $_SESSION['Items'.$identifier]->DefaultPOLine = $myrow['customerpoline']; - $_SESSION['Items'.$identifier]->PaymentTerms = $myrow['terms']; - $_SESSION['Items'.$identifier]->CurrDecimalPlaces = $myrow['decimalplaces']; - /* now get the branch defaults from the customer branches table CustBranch. */ - - $sql = "SELECT custbranch.brname, - custbranch.braddress1, - custbranch.defaultshipvia, - custbranch.deliverblind, - custbranch.specialinstructions, - custbranch.estdeliverydays, - custbranch.salesman, - custbranch.taxgroupid, - custbranch.defaultshipvia - FROM custbranch - WHERE custbranch.branchcode='" . $_SESSION['Items'.$identifier]->Branch . "' - AND custbranch.debtorno = '" . $_SESSION['Items'.$identifier]->DebtorNo . "'"; - $ErrMsg = _('The customer branch record of the customer selected') . ': ' . $_SESSION['Items'.$identifier]->Branch . ' ' . _('cannot be retrieved because'); - $DbgMsg = _('SQL used to retrieve the branch details was') . ':'; - $result =DB_query($sql,$db,$ErrMsg,$DbgMsg); - - if (DB_num_rows($result)==0){ - - prnMsg(_('The branch details for branch code') . ': ' . $_SESSION['Items'.$identifier]->Branch . ' ' . _('against customer code') . ': ' . $_POST['Select'] . ' ' . _('could not be retrieved') . '. ' . _('Check the set up of the customer and branch'),'error'); - - if ($debug==1){ - echo '<br />' . _('The SQL that failed to get the branch details was') . ':<br />' . $sql; - } - include('includes/footer.inc'); - exit; - } - // add echo - echo '<br />'; - $myrow = DB_fetch_array($result); - - $_SESSION['Items'.$identifier]->DeliverTo = ''; - $_SESSION['Items'.$identifier]->DelAdd1 = $myrow['braddress1']; - $_SESSION['Items'.$identifier]->ShipVia = $myrow['defaultshipvia']; - $_SESSION['Items'.$identifier]->DeliverBlind = $myrow['deliverblind']; - $_SESSION['Items'.$identifier]->SpecialInstructions = $myrow['specialinstructions']; - $_SESSION['Items'.$identifier]->DeliveryDays = $myrow['estdeliverydays']; - $_SESSION['Items'.$identifier]->TaxGroup = $myrow['taxgroupid']; - - if ($_SESSION['Items'.$identifier]->SpecialInstructions) { - prnMsg($_SESSION['Items'.$identifier]->SpecialInstructions,'warn'); - } - - if ($_SESSION['CheckCreditLimits'] > 0) { /*Check credit limits is 1 for warn and 2 for prohibit sales */ - $_SESSION['Items'.$identifier]->CreditAvailable = GetCreditAvailable($_SESSION['Items'.$identifier]->DebtorNo,$db); - - if ($_SESSION['CheckCreditLimits']==1 AND $_SESSION['Items'.$identifier]->CreditAvailable <=0){ - prnMsg(_('The') . ' ' . $myrow['brname'] . ' ' . _('account is currently at or over their credit limit'),'warn'); - } elseif ($_SESSION['CheckCreditLimits']==2 AND $_SESSION['Items'.$identifier]->CreditAvailable <=0){ - prnMsg(_('No more orders can be placed by') . ' ' . $myrow[0] . ' ' . _(' their account is currently at or over their credit limit'),'warn'); - include('includes/footer.inc'); - exit; - } - } - - } else { - prnMsg($myrow['brname'] . ' ' . _('Although the account is defined as the cash sale account for the location the account is currently on hold. Please contact the credit control personnel to discuss'),'warn'); - } - - } -} // end if its a new sale to be set up ... - -if (isset($_POST['CancelOrder'])) { - - - unset($_SESSION['Items'.$identifier]->LineItems); - $_SESSION['Items'.$identifier]->ItemsOrdered = 0; - unset($_SESSION['Items'.$identifier]); - $_SESSION['Items'.$identifier] = new cart; - - echo '<br /><br />'; - prnMsg(_('This sale has been cancelled as requested'),'success'); - echo '<br /><br /><a href="' .$_SERVER['PHP_SELF'] . '">' . _('Start a new Counter Sale') . '</a>'; - include('includes/footer.inc'); - exit; - -} else { /*Not cancelling the order */ - - echo '<p class="page_title_text"><img src="'.$rootpath.'/css/'.$theme.'/images/inventory.png" title="' . _('Counter Sales') . '" alt="" />' . ' '; - echo $_SESSION['Items'.$identifier]->CustomerName . ' ' . _('Counter Sale') . ' ' ._('from') . ' ' . $_SESSION['Items'.$identifier]->LocationName . ' ' . _('inventory') . ' (' . _('all amounts in') . ' ' . $_SESSION['Items'.$identifier]->DefaultCurrency . ')'; - echo '</p>'; -} - -if (isset($_POST['Search']) or isset($_POST['Next']) or isset($_POST['Prev'])){ - - 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']=='') { - $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>'; - } - if (isset($_POST['Keywords']) AND mb_strlen($_POST['Keywords'])>0) { - //insert wildcard characters in spaces - $_POST['Keywords'] = mb_strtoupper($_POST['Keywords']); - $SearchString = '%' . str_replace(' ', '%', $_POST['Keywords']) . '%'; - - if ($_POST['StockCat']=='All'){ - $SQL = "SELECT stockmaster.stockid, - stockmaster.description, - stockmaster.units - FROM stockmaster, - stockcategory - WHERE stockmaster.categoryid=stockcategory.categoryid - AND (stockcategory.stocktype='F' OR stockcategory.stocktype='D') - AND stockmaster.mbflag <>'G' - AND stockmaster.controlled <> 1 - AND stockmaster.description " . LIKE . " '" . $SearchString . "' - AND stockmaster.discontinued=0 - ORDER BY stockmaster.stockid"; - } else { - $SQL = "SELECT stockmaster.stockid, - stockmaster.description, - stockmaster.units - FROM stockmaster, stockcategory - WHERE stockmaster.categoryid=stockcategory.categoryid - AND (stockcategory.stocktype='F' OR stockcategory.stocktype='D') - AND stockmaster.mbflag <>'G' - AND stockmaster.controlled <> 1 - AND stockmaster.discontinued=0 - AND stockmaster.description " . LIKE . " '" . $SearchString . "' - AND stockmaster.categoryid='" . $_POST['StockCat'] . "' - ORDER BY stockmaster.stockid"; - } - - } else if (mb_strlen($_POST['StockCode'])>0){ - - $_POST['StockCode'] = mb_strtoupper($_POST['StockCode']); - $SearchString = '%' . $_POST['StockCode'] . '%'; - - if ($_POST['StockCat']=='All'){ - $SQL = "SELECT stockmaster.stockid, - stockmaster.description, - stockmaster.units - FROM stockmaster, stockcategory - WHERE stockmaster.categoryid=stockcategory.categoryid - AND (stockcategory.stocktype='F' OR stockcategory.stocktype='D') - AND stockmaster.stockid " . LIKE . " '" . $SearchString . "' - AND stockmaster.mbflag <>'G' - AND stockmaster.controlled <> 1 - AND stockmaster.discontinued=0 - ORDER BY stockmaster.stockid"; - } else { - $SQL = "SELECT stockmaster.stockid, - stockmaster.description, - stockmaster.units - FROM stockmaster, stockcategory - WHERE stockmaster.categoryid=stockcategory.categoryid - AND (stockcategory.stocktype='F' OR stockcategory.stocktype='D') - AND stockmaster.stockid " . LIKE . " '" . $SearchString . "' - AND stockmaster.mbflag <>'G' - AND stockmaster.controlled <> 1 - AND stockmaster.discontinued=0 - AND stockmaster.categoryid='" . $_POST['StockCat'] . "' - ORDER BY stockmaster.stockid"; - } - - } else { - if ($_POST['StockCat']=='All'){ - $SQL = "SELECT stockmaster.stockid, - stockmaster.description, - stockmaster.units - FROM stockmaster, stockcategory - WHERE stockmaster.categoryid=stockcategory.categoryid - AND (stockcategory.stocktype='F' OR stockcategory.stocktype='D') - AND stockmaster.mbflag <>'G' - AND stockmaster.controlled <> 1 - AND stockmaster.discontinued=0 - ORDER BY stockmaster.stockid"; - } else { - $SQL = "SELECT stockmaster.stockid, - stockmaster.description, - stockmaster.units - FROM stockmaster, stockcategory - WHERE stockmaster.categoryid=stockcategory.categoryid - AND (stockcategory.stocktype='F' OR stockcategory.stocktype='D') - AND stockmaster.mbflag <>'G' - AND stockmaster.controlled <> 1 - AND stockmaster.discontinued=0 - AND stockmaster.categoryid='" . $_POST['StockCat'] . "' - ORDER BY stockmaster.stockid"; - } - } - - if (isset($_POST['Next'])) { - $Offset = $_POST['NextList']; - } - if (isset($_POST['Prev'])) { - $Offset = $_POST['previous']; - } - if (!isset($Offset) or $Offset<0) { - $Offset=0; - } - $SQL = $SQL . ' LIMIT ' . $_SESSION['DefaultDisplayRecordsMax'].' OFFSET '.number_format($_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'); - $SearchResult = DB_query($SQL,$db,$ErrMsg, $DbgMsg); - - if (DB_num_rows($SearchResult)==0 ){ - prnMsg (_('There are no products available meeting the criteria specified'),'info'); - } - if (DB_num_rows($SearchResult)==1){ - $myrow=DB_fetch_array($SearchResult); - $NewItem = $myrow['stockid']; - DB_data_seek($SearchResult,0); - } - if (DB_num_rows($SearchResult)< $_SESSION['DisplayRecordsMax']){ - $Offset=0; - } - -} //end of if search - - -/* Always do the stuff below */ - -echo '<form action="' . $_SERVER['PHP_SELF'] . '?identifier='.$identifier . '" name="SelectParts" method="post">'; -echo '<input type="hidden" name="FormID" value="' . $_SESSION['FormID'] . '" />'; - -//Get The exchange rate used for GPPercent calculations on adding or amending items -if ($_SESSION['Items'.$identifier]->DefaultCurrency != $_SESSION['CompanyRecord']['currencydefault']){ - $ExRateResult = DB_query("SELECT rate FROM currencies WHERE currabrev='" . $_SESSION['Items'.$identifier]->DefaultCurrency . "'",$db); - if (DB_num_rows($ExRateResult)>0){ - $ExRateRow = DB_fetch_row($ExRateResult); - $ExRate = $ExRateRow[0]; - } else { - $ExRate =1; - } -} else { - $ExRate = 1; -} - -/*Process Quick Entry */ -/* If enter is pressed on the quick entry screen, the default button may be Recalculate */ - if (isset($_POST['OrderItems']) - OR isset($_POST['QuickEntry']) - OR isset($_POST['Recalculate'])){ - - /* get the item details from the database and hold them in the cart object */ - - /*Discount can only be set later on -- after quick entry -- so default discount to 0 in the first place */ - $Discount = 0; - - $i=1; - while ($i<=$_SESSION['QuickEntries'] - AND isset($_POST['part_' . $i]) - AND $_POST['part_' . $i]!='') { - - $QuickEntryCode = 'part_' . $i; - $QuickEntryQty = 'qty_' . $i; - $QuickEntryPOLine = 'poline_' . $i; - $QuickEntryItemDue = 'ItemDue_' . $i; - - $i++; - - if (isset($_POST[$QuickEntryCode])) { - $NewItem = mb_strtoupper($_POST[$QuickEntryCode]); - } - if (isset($_POST[$QuickEntryQty])) { - $NewItemQty = $_POST[$QuickEntryQty]; - } - if (isset($_POST[$QuickEntryItemDue])) { - $NewItemDue = $_POST[$QuickEntryItemDue]; - } else { - $NewItemDue = DateAdd (Date($_SESSION['DefaultDateFormat']),'d', $_SESSION['Items'.$identifier]->DeliveryDays); - } - if (isset($_POST[$QuickEntryPOLine])) { - $NewPOLine = $_POST[$QuickEntryPOLine]; - } else { - $NewPOLine = 0; - } - - if (!isset($NewItem)){ - unset($NewItem); - break; /* break out of the loop if nothing in the quick entry fields*/ - } - - 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'); - //Attempt to default the due date to something sensible? - $NewItemDue = DateAdd (Date($_SESSION['DefaultDateFormat']),'d', $_SESSION['Items'.$identifier]->DeliveryDays); - } - /*Now figure out if the item is a kit set - the field MBFlag='K'*/ - $sql = "SELECT stockmaster.mbflag, - stockmaster.controlled - FROM stockmaster - WHERE stockmaster.stockid='". $NewItem ."'"; - - $ErrMsg = _('Could not determine if the part being ordered was a kitset or not because'); - $DbgMsg = _('The sql that was used to determine if the part being ordered was a kitset or not was '); - $KitResult = DB_query($sql, $db,$ErrMsg,$DbgMsg); - - - if (DB_num_rows($KitResult)==0){ - prnMsg( _('The item code') . ' ' . $NewItem . ' ' . _('could not be retrieved from the databas... [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['UserStockLocation'] ."'"; $result = DB_query($sql,$db); if (DB_num_rows($result)==0) { prnMsg(_('Your user account does not have a valid default inventory location set up. Please see the system administrator to modify your user account.'),'error'); @@ -149,13 +149,13 @@ FROM custbranch WHERE custbranch.branchcode='" . $_SESSION['Items'.$identifier]->Branch . "' AND custbranch.debtorno = '" . $_SESSION['Items'.$identifier]->DebtorNo . "'"; - $ErrMsg = _('The customer branch record of the customer selected') . ': ' . $_SESSION['Items'.$identifier]->Branch . ' ' . _('cannot be retrieved because'); + $ErrMsg = _('The customer branch record of the customer selected') . ': ' . $_SESSION['Items'.$identifier]->Branch . ' ' . _('cannot be retrieved because'); $DbgMsg = _('SQL used to retrieve the branch details was') . ':'; $result =DB_query($sql,$db,$ErrMsg,$DbgMsg); if (DB_num_rows($result)==0){ - prnMsg(_('The branch details for branch code') . ': ' . $_SESSION['Items'.$identifier]->Branch . ' ' . _('against customer code') . ': ' . $_POST['Select'] . ' ' . _('could not be retrieved') . '. ' . _('Check the set up of the customer and branch'),'error'); + prnMsg(_('The branch details for branch code') . ': ' . $_SESSION['Items'.$identifier]->Branch . ' ' . _('against customer code') . ': ' . $_SESSION['Items'.$identifier]->DebtorNo . ' ' . _('could not be retrieved') . '. ' . _('Check the set up of the customer and branch'),'error'); if ($debug==1){ echo '<br />' . _('The SQL that failed to get the branch details was') . ':<br />' . $sql; @@ -179,13 +179,15 @@ prnMsg($_SESSION['Items'.$identifier]->SpecialInstructions,'warn'); } - if ($_SESSION['CheckCreditLimits'] > 0) { /*Check credit limits is 1 for warn and 2 for prohibit sales */ + if ($_SESSION['CheckCreditLimits'] > 0 AND $AlreadyWarnedAboutCredit==false) { /*Check credit limits is 1 for warn and 2 for prohibit sales */ $_SESSION['Items'.$identifier]->CreditAvailable = GetCreditAvailable($_SESSION['Items'.$identifier]->DebtorNo,$db); if ($_SESSION['CheckCreditLimits']==1 AND $_SESSION['Items'.$identifier]->CreditAvailable <=0){ prnMsg(_('The') . ' ' . $myrow['brname'] . ' ' . _('account is currently at or over their credit limit'),'warn'); + $AlreadyWarnedAboutCredit = true; } elseif ($_SESSION['CheckCreditLimits']==2 AND $_SESSION['Items'.$identifier]->CreditAvailable <=0){ prnMsg(_('No more orders can be placed by') . ' ' . $myrow[0] . ' ' . _(' their account is currently at or over their credit limit'),'warn'); + $AlreadyWarnedAboutCredit = true; include('includes/footer.inc'); exit; } @@ -375,7 +377,7 @@ /*Process Quick Entry */ /* If enter is pressed on the quick entry screen, the default button may be Recalculate */ - if (isset($_POST['OrderItems']) + if (isset($_POST['SelectingOrderItems']) OR isset($_POST['QuickEntry']) OR isset($_POST['Recalculate'])){ @@ -383,7 +385,7 @@ /*Discount can only be set later on -- after quick entry -- so default discount to 0 in the first place */ $Discount = 0; - + $AlreadyWarnedAboutCredit = false; $i=1; while ($i<=$_SESSION['QuickEntries'] AND isset($_POST['part_' . $i]) @@ -400,7 +402,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]; @@ -477,23 +479,23 @@ if (isset($_GET['Delete'])){ $_SESSION['Items'.$identifier]->remove_from_cart($_GET['Delete']); /*Don't do any DB updates*/ } - + $AlreadyWarnedAboutCredit = false; foreach ($_SESSION['Items'.$identifier]->LineItems as $OrderLine) { 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); - } else if (abs($OrderLine->GPPercent - $_POST['GPPercent_' . $OrderLine->LineNumber])>=0.001) { + 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); + } 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 -(($_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 { @@ -514,14 +516,14 @@ or $OrderLine->POLine != $_POST['POLine_' . $OrderLine->LineNumber]) { $_SESSION['Items'.$identifier]->update_cart_item($OrderLine->LineNumber, - $Quantity, - $Price, - ($DiscountPercentage/100), - $Narrative, - 'Yes', /*Update DB */ - $_POST['ItemDue_' . $OrderLine->LineNumber], - $_POST['POLine_' . $OrderLine->LineNumber], - $_POST['GPPercent_' . $OrderLine->LineNumber]); + $Quantity, + $Price, + ($DiscountPercentage/100), + $Narrative, + 'Yes', /*Update DB */ + $_POST['ItemDue_' . $OrderLine->LineNumber], + $_POST['POLine_' . $OrderLine->LineNumber], + filter_number_format($_POST['GPPercent_' . $OrderLine->LineNumber])); } } //page not called from itself - POST variables not set } @@ -574,6 +576,8 @@ Now figure out if the item is a kit set - the field MBFlag='K' * controlled items and ghost/phantom items cannot be selected because the SQL to show items to select doesn't show 'em * */ + $AlreadyWarnedAboutCredit = false; + $sql = "SELECT stockmaster.mbflag, stockmaster.taxcatid FROM stockmaster @@ -620,9 +624,11 @@ } /*end of if its a new item */ -if (isset($NewItemArray) and isset($_POST['OrderItems'])){ +if (isset($NewItemArray) 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; + foreach($NewItemArray as $NewItem => $NewItemQty) { if($NewItemQty > 0) { $sql = "SELECT stockmaster.mbflag @@ -772,7 +778,7 @@ 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 class="number">' . locale_number_format($SubTotal,$_SESSION['Items'.$identifier]->CurrDecimalPlaces) . '</td>'; + echo '<td class="number">' . locale_money_format($SubTotal,$_SESSION['Items'.$identifier]->CurrDecimalPlaces) . '</td>'; $LineDueDate = $OrderLine->ItemDue; if (!Is_Date($OrderLine->ItemDue)){ $LineDueDate = DateAdd (Date($_SESSION['DefaultDateFormat']),'d', $_SESSION['Items'.$identifier]->DeliveryDays); @@ -798,8 +804,8 @@ $TaxTotal += $TaxLineTotal; $_SESSION['Items'.$identifier]->TaxTotals=$TaxTotals; $_SESSION['Items'.$identifier]->TaxGLCodes=$TaxGLCodes; - echo '<td class="number">' . locale_number_format($TaxLineTotal ,$_SESSION['Items'.$identifier]->CurrDecimalPlaces) . '</td>'; - echo '<td class="number">' . locale_number_format($SubTotal + $TaxLineTotal ,$_SESSION['Items'.$identifier]->CurrDecimalPlaces) . '</td>'; + echo '<td class="number">' . locale_money_format($TaxLineTotal ,$_SESSION['Items'.$identifier]->CurrDecimalPlaces) . '</td>'; + echo '<td class="number">' . locale_money_format($SubTotal + $TaxLineTotal ,$_SESSION['Items'.$identifier]->CurrDecimalPlaces) . '</td>'; echo '<td><a href="' . $_SERVER['PHP_SELF'] . '?identifier='.$identifier . '&Delete=' . $OrderLine->LineNumber . '" onclick="return confirm(\'' . _('Are You Sure?') . '\');">' . _('Delete') . '</a></td></tr>'; if ($_SESSION['AllowOrderLineItemNarrative'] == 1){ @@ -816,9 +822,9 @@ } /* end of loop around items */ echo '<tr class="EvenTableRows"><td colspan="8" class="number"><b>' . _('Total') . '</b></td> - <td class="number">' . locale_number_format(($_SESSION['Items'.$identifier]->total),$_SESSION['Items'.$identifier]->CurrDecimalPlaces) . '</td> - <td class="number">' . locale_number_format($TaxTotal,$_SESSION['Items'.$identifier]->CurrDecimalPlaces) . '</td> - <td class="number">' . locale_number_format(($_SESSION['Items'.$identifier]->total+$TaxTotal),$_SESSION['Items'.$identifier]->CurrDecimalPlaces) . '</td> + <td class="number">' . locale_money_format(($_SESSION['Items'.$identifier]->total),$_SESSION['Items'.$identifier]->CurrDecimalPlaces) . '</td> + <td class="number">' . locale_money_format($TaxTotal,$_SESSION['Items'.$identifier]->CurrDecimalPlaces) . '</td> + <td class="number">' . locale_money_format(($_SESSION['Items'.$identifier]->total+$TaxTotal),$_SESSION['Items'.$identifier]->CurrDecimalPlaces) . '</td> </tr> </table>'; echo '<input type="hidden" name="TaxTotal" value="'.$TaxTotal.'" />'; @@ -851,7 +857,7 @@ echo '<tr><td>' . _('Payment Type') . ':</td><td><select name="PaymentMethod">'; while ($PaymentMethodRow = DB_fetch_array($PaymentMethodsResult)){ - if (isset($_POST['PaymentMethod']) and $_POST['PaymentMethod'] == $PaymentMethodRow['paymentid']){ + if (isset($_POST['PaymentMethod']) AND $_POST['PaymentMethod'] == $PaymentMethodRow['paymentid']){ echo '<option selected="True" value="' . $PaymentMethodRow['paymentid'] . '">' . $PaymentMethodRow['paymentname'] . '</option>'; } else { echo '<option value="' . $PaymentMethodRow['paymentid'] . '">' . $PaymentMethodRow['paymentname'] . '</option>'; @@ -863,7 +869,7 @@ echo '<tr><td>' . _('Banked to') . ':</td><td><select name="BankAccount">'; while ($BankAccountsRow = DB_fetch_array($BankAccountsResult)){ - if (isset($_POST['BankAccount']) and $_POST['BankAccount'] == $BankAccountsRow['accountcode']){ + if (isset($_POST['BankAccount']) AND $_POST['BankAccount'] == $BankAccountsRow['accountcode']){ echo '<option selected="True" value="' . $BankAccountsRow['accountcode'] . '">' . $BankAccountsRow['bankaccountname'] . '</option>'; } else { echo '<option value="' . $BankAccountsRow['accountcode'] . '">' . $BankAccountsRow['bankaccountname'] . '</option>'; @@ -874,7 +880,7 @@ if (!isset($_POST['AmountPaid'])){ $_POST['AmountPaid'] =0; } - echo '<tr><td>' . _('Amount Paid') . ':</td><td><input type="text" class="number" name="AmountPaid" maxlength="12" size="12" value="' . $_POST['AmountPaid'] . '" /></td></tr>'; + echo '<tr><td>' . _('Amount Paid') . ':</td><td><input type="text" class="number" name="AmountPaid" maxlength="12" size="12" value="' . filter_number_format($_POST['AmountPaid']) . '" /></td></tr>'; echo '</table>'; //end the sub table in the second column of master table echo '</th></tr></table>'; //end of column/row/master table @@ -887,7 +893,7 @@ * Invoice Processing Here * ********************************** * */ -if (isset($_POST['ProcessSale']) and $_POST['ProcessSale'] != ''){ +if (isset($_POST['ProcessSale']) AND $_POST['ProcessSale'] != ''){ $InputError = false; //always assume the best //but check for the worst @@ -895,7 +901,7 @@ prnMsg(_('There are no lines on this sale. Please enter lines to invoice first'),'error'); $InputError = true; } - if (abs($_POST['AmountPaid'] -($_SESSION['Items'.$identifier]->total+$_POST['TaxTotal']))>=0.01) { + if (abs(filter_number_format($_POST['AmountPaid']) -($_SESSION['Items'.$identifier]->total+filter_number_format($_POST['TaxTotal'])))>=0.01) { prnMsg(_('The amount entered as payment does not equal the amount of the invoice. Please ensure the customer has paid the correct amount and re-enter'),'error'); $InputError = true; } @@ -1234,23 +1240,22 @@ /*Now insert the DebtorTrans */ - $SQL = "INSERT INTO debtortrans ( - transno, - type, - debtorno, - branchcode, - trandate, - inputdate, - prd, - reference, - tpe, - order_, - ovamount, - ovgst, - rate, - invtext, - shipvia, - alloc ) + $SQL = "INSERT INTO debtortrans (transno, + type, + debtorno, + branchcode, + trandate, + inputdate, + prd, + reference, + tpe, + order_, + ovamount, + ovgst, + rate, + invtext, + shipvia, + alloc ) VALUES ( '". $InvoiceNo . "', 10, @@ -1259,15 +1264,15 @@ '" . $DefaultDispatchDate . "', '" . date('Y-m-d H-i-s') . "', '" . $PeriodNo . "', - '" . $_SESSION['Items'.$identifier]->CustRef . "', + '" . DB_escape_string($_SESSION['Items'.$identifier]->CustRef) . "', '" . $_SESSION['Items'.$identifier]->DefaultSalesType . "', '" . $OrderNo . "', '" . $_SESSION['Items'.$identifier]->total . "', - '" . $_POST['TaxTotal'] . "', + '" . filter_number_format($_POST['TaxTotal']) . "', '" . $ExRate . "', - '" . $_SESSION['Items'.$identifier]->Comments . "', + '" . DB_escape_string($_SESSION['Items'.$identifier]->Comments) . "', '" . $_SESSION['Items'.$identifier]->ShipVia . "', - '" . ($_SESSION['Items'.$identifier]->total + $_POST['TaxTotal']) . "')"; + '" . ($_SESSION['Items'.$identifier]->total + filter_number_format($_POST['TaxTotal'])) . "')"; $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'); @@ -1752,7 +1757,7 @@ if ($_SESSION['CompanyRecord']['gllink_debtors']==1){ /*Post debtors transaction to GL debit debtors, credit freight re-charged and credit sales */ - if (($_SESSION['Items'.$identifier]->total + $_POST['TaxTotal']) !=0) { + if (($_SESSION['Items'.$identifier]->total + filter_number_format($_POST['TaxTotal'])) !=0) { $SQL = "INSERT INTO gltrans ( type, typeno, trandate, @@ -1766,7 +1771,7 @@ '" . $PeriodNo . "', '" . $_SESSION['CompanyRecord']['debtorsact'] . "', '" . $_SESSION['Items'.$identifier]->DebtorNo . "', - '" . (($_SESSION['Items'.$identifier]->total + $_POST['TaxTotal'])/$ExRate) . "')"; + '" . (($_SESSION['Items'.$identifier]->total + filter_number_format($_POST['TaxTotal']))/$ExRate) . "')"; $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'); @@ -1802,19 +1807,19 @@ if ($_POST['AmountPaid']!=0){ $ReceiptNumber = GetNextTransNo(12,$db); $SQL="INSERT INTO gltrans (type, - typeno, - trandate, - periodno, - account, - narrative, - amount) - VALUES (12, - '" . $ReceiptNumber . "', - '" . $DefaultDispatchDate . "', - '" . $PeriodNo . "', - '" . $_POST['BankAccount'] . "', - '" . $_SESSION['Items'.$identifier]->LocationName . ' ' . _('Counter Sale') . ' ' . $InvoiceNo . "', - '" . ($_POST['AmountPaid']/$ExRate) . "')"; + typeno, + trandate, + periodno, + account, + narrative, + amount) + VALUES (12, + '" . $ReceiptNumber . "', + '" . $DefaultDispatchDate . "', + '" . $PeriodNo . "', + '" . $_POST['BankAccount'] . "', + '" . $_SESSION['Items'.$identifier]->LocationName . ' ' . _('Counter Sale') . ' ' . $InvoiceNo . "', + '" . (filter_number_format($_POST['AmountPaid'])/$ExRate) . "')"; $DbgMsg = _('The SQL that failed to insert the GL transaction for the bank account debit was'); $ErrMsg = _('Cannot insert a GL transaction for the bank account debit'); $result = DB_query($SQL,$db,$ErrMsg,$DbgMsg,true); @@ -1833,7 +1838,7 @@ '" . $PeriodNo . "', '" . $_SESSION['CompanyRecord']['debtorsact'] . "', '" . $_SESSION['Items'.$identifier]->LocationName . ' ' . _('Counter Sale') . ' ' . $InvoiceNo . "', - '" . -($_POST['AmountPaid']/$ExRate) . "')"; + '" . -(filter_number_format($_POST['AmountPaid'])/$ExRate) . "')"; $DbgMsg = _('The SQL that failed to insert the GL transaction for the debtors account credit was'); $ErrMsg = _('Cannot insert a GL transaction for the debtors account credit'); $result = DB_query($SQL,$db,$ErrMsg,$DbgMsg,true); @@ -1846,8 +1851,9 @@ //Now need to add the receipt banktrans record //First get the account currency that it has been banked into $result = DB_query("SELECT rate FROM currencies - INNER JOIN bankaccounts ON currencies.currabrev=bankaccounts.currcode - WHERE bankaccounts.accountcode='" . $_POST['BankAccount'] . "'",$db); + INNER JOIN bankaccounts + ON currencies.currabrev=bankaccounts.currcode + WHERE bankaccounts.accountcode='" . $_POST['BankAccount'] . "'",$db); $myrow = DB_fetch_row($result); $BankAccountExRate = $myrow[0]; @@ -1883,7 +1889,7 @@ '" . $BankAccountExRate . "', '" . $DefaultDispatchDate . "', '" . $_POST['PaymentMethod'] . "', - '" . ($_POST['AmountPaid'] * $BankAccountExRate) . "', + '" . (filter_number_format($_POST['AmountPaid']) * $BankAccountExRate) . "', '" . $_SESSION['Items'.$identifier]->DefaultCurrency . "')"; $DbgMsg = _('The SQL that failed to insert the bank account transaction was'); @@ -1911,8 +1917,8 @@ '" . $PeriodNo . "', '" . $InvoiceNo . "', '" . $ExRate . "', - '" . -$_POST['AmountPaid'] . "', - '" . -$_POST['AmountPaid'] . "', + '" . -filter_number_format($_POST['AmountPaid']) . "', + '" . -filter_number_format($_POST['AmountPaid']) . "', '" . $_SESSION['Items'.$identifier]->LocationName . ' ' . _('Counter Sale') ."')"; $DbgMsg = _('The SQL that failed to insert the customer receipt transaction was'); @@ -1922,7 +1928,7 @@ $ReceiptDebtorTransID = DB_Last_Insert_ID($db,'debtortrans','id'); $SQL = "UPDATE debtorsmaster SET lastpaiddate = '" . $DefaultDispatchDate . "', - lastpaid='" . $_POST['AmountPaid'] . "' + lastpaid='" . filter_number_format($_POST['AmountPaid']) . "' WHERE debtorsmaster.debtorno='" . $_SESSION['Items'.$identifier]->DebtorNo . "'"; $DbgMsg = _('The SQL that failed to update the date of the last payment received was'); @@ -1935,7 +1941,7 @@ datealloc, transid_allocfrom, transid_allocto ) - VALUES ('" . $_POST['AmountPaid'] . "', + VALUES ('" . filter_number_format($_POST['AmountPaid']) . "', '" . $DefaultDispatchDate . "', '" . $ReceiptDebtorTransID . "', '" . $DebtorTransID . "')"; @@ -1974,7 +1980,6 @@ * ***************************** */ - /* Now show the stock item selection search stuff below */ if (!isset($_POST['ProcessSale'])){ if (isset($_POST['PartSearch']) and $_POST['PartSearch']!=''){ @@ -2012,6 +2017,7 @@ <th>' . _('Available') . '</th> <th>' . _('Quantity') . '</th></tr>'; echo $TableHeader; + $i = 0; $j = 1; $k=0; //row colour counter @@ -2096,7 +2102,7 @@ <td style="text-align:center">%s</td> <td style="text-align:center">%s</td> <td style="text-align:center">%s</td> - <td><font size=1><input class="number" tabindex="'.strval($j+7).'" type="textbox" size="6" name="itm%s" value="0" /> + <td><font size=1><input class="number" tabindex="'.strval($j+7).'" type="textbox" size="6" name="OrderQty%s" value="0" /><input type="hidden" name="StockID%s" value="%s" /> </td> </tr>', $myrow['stockid'], @@ -2106,15 +2112,18 @@ $DemandQty, $OnOrder, $Available, + $i, + $i, $myrow['stockid']); if ($j==1) { - $jsCall = '<script type="text/javascript">if (document.SelectParts) {defaultControl(document.SelectParts.itm'.$myrow['stockid'].');}</script>'; + $jsCall = '<script type="text/javascript">if (document.SelectParts) {defaultControl(document.SelectParts.OrderQty'.$i.');}</script>'; } - $j++; + $j++;//counter for paging + $i++;//index for controls #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="OrderItems" value="1" /><input tabindex='.strval($j+8).' type="submit" value="'._('Add to Sale').'" /></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 Sale').'" /></td>'; echo '</table>'; } //end of if Frequently Ordered Items > 0 if (isset($msg)){ @@ -2178,7 +2187,7 @@ echo '<input type="hidden" name="FormID" value="' . $_SESSION['FormID'] . '" />'; echo '<table class="table1">'; 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="OrderItems" value="1" /><input tabindex="'.strval($j+8).'" type="submit" value="'._('Add to Sale').'" /></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 Sale').'" /></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>'; $TableHeader = '<tr><th>' . _('Code') . '</th> <th>' . _('Description') . '</th> @@ -2189,7 +2198,7 @@ <th>' . _('Available') . '</th> <th>' . _('Quantity') . '</th></tr>'; echo $TableHeader; - + $i=0; $k=0; //row colour counter while ($myrow=DB_fetch_array($SearchResult)) { @@ -2272,7 +2281,7 @@ <td class="number">%s</td> <td class="number">%s</td> <td class="number">%s</td> - <td><font size="1"><input class="number" tabindex="'.strval($j+7).'" type="textbox" size="6" name="itm%s" value="0" /></font></td> + <td><font size="1"><input class="number" tabindex="'.strval($j+7).'" type="textbox" size="6" name="OrderQty%s" value="0" /></font><input type="hidden" name="StockID%s" value="%s" /></td> </tr>', $myrow['stockid'], $myrow['description'], @@ -2281,6 +2290,8 @@ locale_number_format($DemandQty, $myrow['decimalplaces']), locale_number_format($OnOrder, $myrow['decimalplaces']), locale_number_format($Available, $myrow['decimalplaces']), + $i, + $i, $myrow['stockid']); if ($j==1) { $jsCall = '<script type="text/javascript">if (document.SelectParts) {defaultControl(document.SelectParts.itm'.$myrow['stockid'].');}</script>'; @@ -2296,7 +2307,7 @@ echo '<input type="hidden" name="Email" value="'.$_SESSION['Items'.$identifier]->Email.'" />'; 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="OrderItems" value="1" /><input tabindex="'.strval($j+8).'" type="submit" value="'._('Add to Sale').'" /></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 Sale').'" /></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; Modified: trunk/Credit_Invoice.php =================================================================== --- trunk/Credit_Invoice.php 2011-09-10 04:52:21 UTC (rev 4684) +++ trunk/Credit_Invoice.php 2011-09-11 04:06:48 UTC (rev 4685) @@ -208,12 +208,12 @@ } } if (isset($_POST['ChargeFreightCost'])){ - $_SESSION['CreditItems']->FreightCost = $_POST['ChargeFreightCost']; + $_SESSION['CreditItems']->FreightCost = filter_number_format($_POST['ChargeFreightCost']); } foreach ($_SESSION['CreditItems']->FreightTaxes as $FreightTaxLine) { if (isset($_POST['FreightTaxRate' . $FreightTaxLine->TaxCalculationOrder])){ - $_SESSION['CreditItems']->FreightTaxes[$FreightTaxLine->TaxCalculationOrder]->TaxRate = $_POST['FreightTaxRate' . $FreightTaxLine->TaxCalculationOrder]/100; + $_SESSION['CreditItems']->FreightTaxes[$FreightTaxLine->TaxCalculationOrder]->TaxRate = filter_number_format($_POST['FreightTaxRate' . $FreightTaxLine->TaxCalculationOrder])/100; } } @@ -228,9 +228,9 @@ if (isset($_POST['Quantity_' . $LineItem->LineNumber])){ $Narrative = $_POST['Narrative_' . $LineItem->LineNumber]; - $Quantity = $_POST['Quantity_' . $LineItem->LineNumber]; - $Price = $_POST['Price_' . $LineItem->LineNumber]; - $DiscountPercentage = $_POST['Discount_' . $LineItem->LineNumber]; + $Quantity = filter_number_format($_POST['Quantity_' . $LineItem->LineNumber]); + $Price = filter_number_format($_POST['Price_' . $LineItem->LineNumber]); + $DiscountPercentage = filter_number_format($_POST['Discount_' . $LineItem->LineNumber]); 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 credited to less than 0 or the price less than 0 or the discount more than 100% or less than 0%'),'error'); @@ -242,7 +242,7 @@ } foreach ($LineItem->Taxes as $TaxLine) { if (isset($_POST[$LineItem->LineNumber . $TaxLine->TaxCalculationOrder . '_TaxRate'])){ - $_SESSION['CreditItems']->LineItems[$LineItem->LineNumber]->Taxes[$TaxLine->TaxCalculationOrder]->TaxRate = $_POST[$LineItem->LineNumber . $TaxLine->TaxCalculationOrder . '_TaxRate']/100; + $_SESSION['CreditItems']->LineItems[$LineItem->LineNumber]->Taxes[$TaxLine->TaxCalculationOrder]->TaxRate = filter_number_format($_POST[$LineItem->LineNumber . $TaxLine->TaxCalculationOrder . '_TaxRate'])/100; } } } @@ -293,11 +293,11 @@ $j=0; //row counter foreach ($_SESSION['CreditItems']->LineItems as $LnItm) { - $LineTotal =($LnItm->QtyDispatched * $LnItm->Price * (1 - $LnItm->DiscountPercent)); + $LineTotal =(filter_number_format($LnItm->QtyDispatched) * filter_number_format($LnItm->Price) * (1 - filter_number_format($LnItm->DiscountPercent))); if (!isset($_POST['ProcessCredit'])) { - $_SESSION['CreditItems']->total = $_SESSION['CreditItems']->total + $LineTotal; - $_SESSION['CreditItems']->totalVolume = $_SESSION['CreditItems']->totalVolume + $LnItm->QtyDispatched * $LnItm->Volume; - $_SESSION['CreditItems']->totalWeight = $_SESSION['CreditItems']->totalWeight + $LnItm->QtyDispatched * $LnItm->Weight; + $_SESSION['CreditItems']->total += $LineTotal; + $_SESSION['CreditItems']->totalVolume += (filter_number_format($LnItm->QtyDispatched) * filter_number_format($LnItm->Volume)); + $_SESSION['CreditItems']->totalWeight += (filter_number_format($LnItm->QtyDispatched) * filter_number_format($LnItm->Weight)); if ($k==1){ $RowStarter = 'class="EvenTableRows"'; @@ -310,7 +310,7 @@ echo '<tr '.$RowStarter.'><td>' . $LnItm->StockID . '</td> <td>' . $LnItm->ItemDescription . '</td> - <td class=number>' . locale_number_format($LnItm->Quantity,$LnItm->DecimalPlaces) . '</td> + <td class="number">' . locale_number_format($LnItm->Quantity,$LnItm->DecimalPlaces) . '</td> <td>' . $LnItm->Units . '</td>'; if ($LnItm->Controlled==1){ @@ -323,12 +323,12 @@ } - $DisplayLineTotal = locale_number_format($LineTotal,$_SESSION['CreditItems']->CurrDecimalPlaces); + $DisplayLineTotal = locale_money_format($LineTotal,$_SESSION['CreditItems']->CurrDecimalPlaces); $j++; - echo '<td><input tabindex=' . $j . ' type="text" class=number name="Price_' . $LnItm->LineNumber . '" maxlength=12 size=6 value=' . $LnItm->Price . '></td> + echo '<td><input tabindex=' . $j . ' type="text" class="number" name="Price_' . $LnItm->LineNumber . '" maxlength=12 size=... [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['UserStockLocation'] ."'"; $result = DB_query($sql,$db); if (DB_num_rows($result)==0) { prnMsg(_('Your user account does not have a valid default inventory location set up. Please see the system administrator to modify your user account.'),'error'); @@ -149,13 +149,13 @@ FROM custbranch WHERE custbranch.branchcode='" . $_SESSION['Items'.$identifier]->Branch . "' AND custbranch.debtorno = '" . $_SESSION['Items'.$identifier]->DebtorNo . "'"; - $ErrMsg = _('The customer branch record of the customer selected') . ': ' . $_SESSION['Items'.$identifier]->Branch . ' ' . _('cannot be retrieved because'); + $ErrMsg = _('The customer branch record of the customer selected') . ': ' . $_SESSION['Items'.$identifier]->Branch . ' ' . _('cannot be retrieved because'); $DbgMsg = _('SQL used to retrieve the branch details was') . ':'; $result =DB_query($sql,$db,$ErrMsg,$DbgMsg); if (DB_num_rows($result)==0){ - prnMsg(_('The branch details for branch code') . ': ' . $_SESSION['Items'.$identifier]->Branch . ' ' . _('against customer code') . ': ' . $_POST['Select'] . ' ' . _('could not be retrieved') . '. ' . _('Check the set up of the customer and branch'),'error'); + prnMsg(_('The branch details for branch code') . ': ' . $_SESSION['Items'.$identifier]->Branch . ' ' . _('against customer code') . ': ' . $_SESSION['Items'.$identifier]->DebtorNo . ' ' . _('could not be retrieved') . '. ' . _('Check the set up of the customer and branch'),'error'); if ($debug==1){ echo '<br />' . _('The SQL that failed to get the branch details was') . ':<br />' . $sql; @@ -179,13 +179,15 @@ prnMsg($_SESSION['Items'.$identifier]->SpecialInstructions,'warn'); } - if ($_SESSION['CheckCreditLimits'] > 0) { /*Check credit limits is 1 for warn and 2 for prohibit sales */ + if ($_SESSION['CheckCreditLimits'] > 0 AND $AlreadyWarnedAboutCredit==false) { /*Check credit limits is 1 for warn and 2 for prohibit sales */ $_SESSION['Items'.$identifier]->CreditAvailable = GetCreditAvailable($_SESSION['Items'.$identifier]->DebtorNo,$db); if ($_SESSION['CheckCreditLimits']==1 AND $_SESSION['Items'.$identifier]->CreditAvailable <=0){ prnMsg(_('The') . ' ' . $myrow['brname'] . ' ' . _('account is currently at or over their credit limit'),'warn'); + $AlreadyWarnedAboutCredit = true; } elseif ($_SESSION['CheckCreditLimits']==2 AND $_SESSION['Items'.$identifier]->CreditAvailable <=0){ prnMsg(_('No more orders can be placed by') . ' ' . $myrow[0] . ' ' . _(' their account is currently at or over their credit limit'),'warn'); + $AlreadyWarnedAboutCredit = true; include('includes/footer.inc'); exit; } @@ -375,7 +377,7 @@ /*Process Quick Entry */ /* If enter is pressed on the quick entry screen, the default button may be Recalculate */ - if (isset($_POST['OrderItems']) + if (isset($_POST['SelectingOrderItems']) OR isset($_POST['QuickEntry']) OR isset($_POST['Recalculate'])){ @@ -383,7 +385,7 @@ /*Discount can only be set later on -- after quick entry -- so default discount to 0 in the first place */ $Discount = 0; - + $AlreadyWarnedAboutCredit = false; $i=1; while ($i<=$_SESSION['QuickEntries'] AND isset($_POST['part_' . $i]) @@ -400,7 +402,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]; @@ -477,23 +479,23 @@ if (isset($_GET['Delete'])){ $_SESSION['Items'.$identifier]->remove_from_cart($_GET['Delete']); /*Don't do any DB updates*/ } - + $AlreadyWarnedAboutCredit = false; foreach ($_SESSION['Items'.$identifier]->LineItems as $OrderLine) { 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); - } else if (abs($OrderLine->GPPercent - $_POST['GPPercent_' . $OrderLine->LineNumber])>=0.001) { + 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); + } 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 -(($_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 { @@ -514,14 +516,14 @@ or $OrderLine->POLine != $_POST['POLine_' . $OrderLine->LineNumber]) { $_SESSION['Items'.$identifier]->update_cart_item($OrderLine->LineNumber, - $Quantity, - $Price, - ($DiscountPercentage/100), - $Narrative, - 'Yes', /*Update DB */ - $_POST['ItemDue_' . $OrderLine->LineNumber], - $_POST['POLine_' . $OrderLine->LineNumber], - $_POST['GPPercent_' . $OrderLine->LineNumber]); + $Quantity, + $Price, + ($DiscountPercentage/100), + $Narrative, + 'Yes', /*Update DB */ + $_POST['ItemDue_' . $OrderLine->LineNumber], + $_POST['POLine_' . $OrderLine->LineNumber], + filter_number_format($_POST['GPPercent_' . $OrderLine->LineNumber])); } } //page not called from itself - POST variables not set } @@ -574,6 +576,8 @@ Now figure out if the item is a kit set - the field MBFlag='K' * controlled items and ghost/phantom items cannot be selected because the SQL to show items to select doesn't show 'em * */ + $AlreadyWarnedAboutCredit = false; + $sql = "SELECT stockmaster.mbflag, stockmaster.taxcatid FROM stockmaster @@ -620,9 +624,11 @@ } /*end of if its a new item */ -if (isset($NewItemArray) and isset($_POST['OrderItems'])){ +if (isset($NewItemArray) 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; + foreach($NewItemArray as $NewItem => $NewItemQty) { if($NewItemQty > 0) { $sql = "SELECT stockmaster.mbflag @@ -772,7 +778,7 @@ 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 class="number">' . locale_number_format($SubTotal,$_SESSION['Items'.$identifier]->CurrDecimalPlaces) . '</td>'; + echo '<td class="number">' . locale_money_format($SubTotal,$_SESSION['Items'.$identifier]->CurrDecimalPlaces) . '</td>'; $LineDueDate = $OrderLine->ItemDue; if (!Is_Date($OrderLine->ItemDue)){ $LineDueDate = DateAdd (Date($_SESSION['DefaultDateFormat']),'d', $_SESSION['Items'.$identifier]->DeliveryDays); @@ -798,8 +804,8 @@ $TaxTotal += $TaxLineTotal; $_SESSION['Items'.$identifier]->TaxTotals=$TaxTotals; $_SESSION['Items'.$identifier]->TaxGLCodes=$TaxGLCodes; - echo '<td class="number">' . locale_number_format($TaxLineTotal ,$_SESSION['Items'.$identifier]->CurrDecimalPlaces) . '</td>'; - echo '<td class="number">' . locale_number_format($SubTotal + $TaxLineTotal ,$_SESSION['Items'.$identifier]->CurrDecimalPlaces) . '</td>'; + echo '<td class="number">' . locale_money_format($TaxLineTotal ,$_SESSION['Items'.$identifier]->CurrDecimalPlaces) . '</td>'; + echo '<td class="number">' . locale_money_format($SubTotal + $TaxLineTotal ,$_SESSION['Items'.$identifier]->CurrDecimalPlaces) . '</td>'; echo '<td><a href="' . $_SERVER['PHP_SELF'] . '?identifier='.$identifier . '&Delete=' . $OrderLine->LineNumber . '" onclick="return confirm(\'' . _('Are You Sure?') . '\');">' . _('Delete') . '</a></td></tr>'; if ($_SESSION['AllowOrderLineItemNarrative'] == 1){ @@ -816,9 +822,9 @@ } /* end of loop around items */ echo '<tr class="EvenTableRows"><td colspan="8" class="number"><b>' . _('Total') . '</b></td> - <td class="number">' . locale_number_format(($_SESSION['Items'.$identifier]->total),$_SESSION['Items'.$identifier]->CurrDecimalPlaces) . '</td> - <td class="number">' . locale_number_format($TaxTotal,$_SESSION['Items'.$identifier]->CurrDecimalPlaces) . '</td> - <td class="number">' . locale_number_format(($_SESSION['Items'.$identifier]->total+$TaxTotal),$_SESSION['Items'.$identifier]->CurrDecimalPlaces) . '</td> + <td class="number">' . locale_money_format(($_SESSION['Items'.$identifier]->total),$_SESSION['Items'.$identifier]->CurrDecimalPlaces) . '</td> + <td class="number">' . locale_money_format($TaxTotal,$_SESSION['Items'.$identifier]->CurrDecimalPlaces) . '</td> + <td class="number">' . locale_money_format(($_SESSION['Items'.$identifier]->total+$TaxTotal),$_SESSION['Items'.$identifier]->CurrDecimalPlaces) . '</td> </tr> </table>'; echo '<input type="hidden" name="TaxTotal" value="'.$TaxTotal.'" />'; @@ -851,7 +857,7 @@ echo '<tr><td>' . _('Payment Type') . ':</td><td><select name="PaymentMethod">'; while ($PaymentMethodRow = DB_fetch_array($PaymentMethodsResult)){ - if (isset($_POST['PaymentMethod']) and $_POST['PaymentMethod'] == $PaymentMethodRow['paymentid']){ + if (isset($_POST['PaymentMethod']) AND $_POST['PaymentMethod'] == $PaymentMethodRow['paymentid']){ echo '<option selected="True" value="' . $PaymentMethodRow['paymentid'] . '">' . $PaymentMethodRow['paymentname'] . '</option>'; } else { echo '<option value="' . $PaymentMethodRow['paymentid'] . '">' . $PaymentMethodRow['paymentname'] . '</option>'; @@ -863,7 +869,7 @@ echo '<tr><td>' . _('Banked to') . ':</td><td><select name="BankAccount">'; while ($BankAccountsRow = DB_fetch_array($BankAccountsResult)){ - if (isset($_POST['BankAccount']) and $_POST['BankAccount'] == $BankAccountsRow['accountcode']){ + if (isset($_POST['BankAccount']) AND $_POST['BankAccount'] == $BankAccountsRow['accountcode']){ echo '<option selected="True" value="' . $BankAccountsRow['accountcode'] . '">' . $BankAccountsRow['bankaccountname'] . '</option>'; } else { echo '<option value="' . $BankAccountsRow['accountcode'] . '">' . $BankAccountsRow['bankaccountname'] . '</option>'; @@ -874,7 +880,7 @@ if (!isset($_POST['AmountPaid'])){ $_POST['AmountPaid'] =0; } - echo '<tr><td>' . _('Amount Paid') . ':</td><td><input type="text" class="number" name="AmountPaid" maxlength="12" size="12" value="' . $_POST['AmountPaid'] . '" /></td></tr>'; + echo '<tr><td>' . _('Amount Paid') . ':</td><td><input type="text" class="number" name="AmountPaid" maxlength="12" size="12" value="' . filter_number_format($_POST['AmountPaid']) . '" /></td></tr>'; echo '</table>'; //end the sub table in the second column of master table echo '</th></tr></table>'; //end of column/row/master table @@ -887,7 +893,7 @@ * Invoice Processing Here * ********************************** * */ -if (isset($_POST['ProcessSale']) and $_POST['ProcessSale'] != ''){ +if (isset($_POST['ProcessSale']) AND $_POST['ProcessSale'] != ''){ $InputError = false; //always assume the best //but check for the worst @@ -895,7 +901,7 @@ prnMsg(_('There are no lines on this sale. Please enter lines to invoice first'),'error'); $InputError = true; } - if (abs($_POST['AmountPaid'] -($_SESSION['Items'.$identifier]->total+$_POST['TaxTotal']))>=0.01) { + if (abs(filter_number_format($_POST['AmountPaid']) -($_SESSION['Items'.$identifier]->total+filter_number_format($_POST['TaxTotal'])))>=0.01) { prnMsg(_('The amount entered as payment does not equal the amount of the invoice. Please ensure the customer has paid the correct amount and re-enter'),'error'); $InputError = true; } @@ -1234,23 +1240,22 @@ /*Now insert the DebtorTrans */ - $SQL = "INSERT INTO debtortrans ( - transno, - type, - debtorno, - branchcode, - trandate, - inputdate, - prd, - reference, - tpe, - order_, - ovamount, - ovgst, - rate, - invtext, - shipvia, - alloc ) + $SQL = "INSERT INTO debtortrans (transno, + type, + debtorno, + branchcode, + trandate, + inputdate, + prd, + reference, + tpe, + order_, + ovamount, + ovgst, + rate, + invtext, + shipvia, + alloc ) VALUES ( '". $InvoiceNo . "', 10, @@ -1259,15 +1264,15 @@ '" . $DefaultDispatchDate . "', '" . date('Y-m-d H-i-s') . "', '" . $PeriodNo . "', - '" . $_SESSION['Items'.$identifier]->CustRef . "', + '" . DB_escape_string($_SESSION['Items'.$identifier]->CustRef) . "', '" . $_SESSION['Items'.$identifier]->DefaultSalesType . "', '" . $OrderNo . "', '" . $_SESSION['Items'.$identifier]->total . "', - '" . $_POST['TaxTotal'] . "', + '" . filter_number_format($_POST['TaxTotal']) . "', '" . $ExRate . "', - '" . $_SESSION['Items'.$identifier]->Comments . "', + '" . DB_escape_string($_SESSION['Items'.$identifier]->Comments) . "', '" . $_SESSION['Items'.$identifier]->ShipVia . "', - '" . ($_SESSION['Items'.$identifier]->total + $_POST['TaxTotal']) . "')"; + '" . ($_SESSION['Items'.$identifier]->total + filter_number_format($_POST['TaxTotal'])) . "')"; $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'); @@ -1752,7 +1757,7 @@ if ($_SESSION['CompanyRecord']['gllink_debtors']==1){ /*Post debtors transaction to GL debit debtors, credit freight re-charged and credit sales */ - if (($_SESSION['Items'.$identifier]->total + $_POST['TaxTotal']) !=0) { + if (($_SESSION['Items'.$identifier]->total + filter_number_format($_POST['TaxTotal'])) !=0) { $SQL = "INSERT INTO gltrans ( type, typeno, trandate, @@ -1766,7 +1771,7 @@ '" . $PeriodNo . "', '" . $_SESSION['CompanyRecord']['debtorsact'] . "', '" . $_SESSION['Items'.$identifier]->DebtorNo . "', - '" . (($_SESSION['Items'.$identifier]->total + $_POST['TaxTotal'])/$ExRate) . "')"; + '" . (($_SESSION['Items'.$identifier]->total + filter_number_format($_POST['TaxTotal']))/$ExRate) . "')"; $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'); @@ -1802,19 +1807,19 @@ if ($_POST['AmountPaid']!=0){ $ReceiptNumber = GetNextTransNo(12,$db); $SQL="INSERT INTO gltrans (type, - typeno, - trandate, - periodno, - account, - narrative, - amount) - VALUES (12, - '" . $ReceiptNumber . "', - '" . $DefaultDispatchDate . "', - '" . $PeriodNo . "', - '" . $_POST['BankAccount'] . "', - '" . $_SESSION['Items'.$identifier]->LocationName . ' ' . _('Counter Sale') . ' ' . $InvoiceNo . "', - '" . ($_POST['AmountPaid']/$ExRate) . "')"; + typeno, + trandate, + periodno, + account, + narrative, + amount) + VALUES (12, + '" . $ReceiptNumber . "', + '" . $DefaultDispatchDate . "', + '" . $PeriodNo . "', + '" . $_POST['BankAccount'] . "', + '" . $_SESSION['Items'.$identifier]->LocationName . ' ' . _('Counter Sale') . ' ' . $InvoiceNo . "', + '" . (filter_number_format($_POST['AmountPaid'])/$ExRate) . "')"; $DbgMsg = _('The SQL that failed to insert the GL transaction for the bank account debit was'); $ErrMsg = _('Cannot insert a GL transaction for the bank account debit'); $result = DB_query($SQL,$db,$ErrMsg,$DbgMsg,true); @@ -1833,7 +1838,7 @@ '" . $PeriodNo . "', '" . $_SESSION['CompanyRecord']['debtorsact'] . "', '" . $_SESSION['Items'.$identifier]->LocationName . ' ' . _('Counter Sale') . ' ' . $InvoiceNo . "', - '" . -($_POST['AmountPaid']/$ExRate) . "')"; + '" . -(filter_number_format($_POST['AmountPaid'])/$ExRate) . "')"; $DbgMsg = _('The SQL that failed to insert the GL transaction for the debtors account credit was'); $ErrMsg = _('Cannot insert a GL transaction for the debtors account credit'); $result = DB_query($SQL,$db,$ErrMsg,$DbgMsg,true); @@ -1846,8 +1851,9 @@ //Now need to add the receipt banktrans record //First get the account currency that it has been banked into $result = DB_query("SELECT rate FROM currencies - INNER JOIN bankaccounts ON currencies.currabrev=bankaccounts.currcode - WHERE bankaccounts.accountcode='" . $_POST['BankAccount'] . "'",$db); + INNER JOIN bankaccounts + ON currencies.currabrev=bankaccounts.currcode + WHERE bankaccounts.accountcode='" . $_POST['BankAccount'] . "'",$db); $myrow = DB_fetch_row($result); $BankAccountExRate = $myrow[0]; @@ -1883,7 +1889,7 @@ '" . $BankAccountExRate . "', '" . $DefaultDispatchDate . "', '" . $_POST['PaymentMethod'] . "', - '" . ($_POST['AmountPaid'] * $BankAccountExRate) . "', + '" . (filter_number_format($_POST['AmountPaid']) * $BankAccountExRate) . "', '" . $_SESSION['Items'.$identifier]->DefaultCurrency . "')"; $DbgMsg = _('The SQL that failed to insert the bank account transaction was'); @@ -1911,8 +1917,8 @@ '" . $PeriodNo . "', '" . $InvoiceNo . "', '" . $ExRate . "', - '" . -$_POST['AmountPaid'] . "', - '" . -$_POST['AmountPaid'] . "', + '" . -filter_number_format($_POST['AmountPaid']) . "', + '" . -filter_number_format($_POST['AmountPaid']) . "', '" . $_SESSION['Items'.$identifier]->LocationName . ' ' . _('Counter Sale') ."')"; $DbgMsg = _('The SQL that failed to insert the customer receipt transaction was'); @@ -1922,7 +1928,7 @@ $ReceiptDebtorTransID = DB_Last_Insert_ID($db,'debtortrans','id'); $SQL = "UPDATE debtorsmaster SET lastpaiddate = '" . $DefaultDispatchDate . "', - lastpaid='" . $_POST['AmountPaid'] . "' + lastpaid='" . filter_number_format($_POST['AmountPaid']) . "' WHERE debtorsmaster.debtorno='" . $_SESSION['Items'.$identifier]->DebtorNo . "'"; $DbgMsg = _('The SQL that failed to update the date of the last payment received was'); @@ -1935,7 +1941,7 @@ datealloc, transid_allocfrom, transid_allocto ) - VALUES ('" . $_POST['AmountPaid'] . "', + VALUES ('" . filter_number_format($_POST['AmountPaid']) . "', '" . $DefaultDispatchDate . "', '" . $ReceiptDebtorTransID . "', '" . $DebtorTransID . "')"; @@ -1974,7 +1980,6 @@ * ***************************** */ - /* Now show the stock item selection search stuff below */ if (!isset($_POST['ProcessSale'])){ if (isset($_POST['PartSearch']) and $_POST['PartSearch']!=''){ @@ -2012,6 +2017,7 @@ <th>' . _('Available') . '</th> <th>' . _('Quantity') . '</th></tr>'; echo $TableHeader; + $i = 0; $j = 1; $k=0; //row colour counter @@ -2096,7 +2102,7 @@ <td style="text-align:center">%s</td> <td style="text-align:center">%s</td> <td style="text-align:center">%s</td> - <td><font size=1><input class="number" tabindex="'.strval($j+7).'" type="textbox" size="6" name="itm%s" value="0" /> + <td><font size=1><input class="number" tabindex="'.strval($j+7).'" type="textbox" size="6" name="OrderQty%s" value="0" /><input type="hidden" name="StockID%s" value="%s" /> </td> </tr>', $myrow['stockid'], @@ -2106,15 +2112,18 @@ $DemandQty, $OnOrder, $Available, + $i, + $i, $myrow['stockid']); if ($j==1) { - $jsCall = '<script type="text/javascript">if (document.SelectParts) {defaultControl(document.SelectParts.itm'.$myrow['stockid'].');}</script>'; + $jsCall = '<script type="text/javascript">if (document.SelectParts) {defaultControl(document.SelectParts.OrderQty'.$i.');}</script>'; } - $j++; + $j++;//counter for paging + $i++;//index for controls #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="OrderItems" value="1" /><input tabindex='.strval($j+8).' type="submit" value="'._('Add to Sale').'" /></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 Sale').'" /></td>'; echo '</table>'; } //end of if Frequently Ordered Items > 0 if (isset($msg)){ @@ -2178,7 +2187,7 @@ echo '<input type="hidden" name="FormID" value="' . $_SESSION['FormID'] . '" />'; echo '<table class="table1">'; 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="OrderItems" value="1" /><input tabindex="'.strval($j+8).'" type="submit" value="'._('Add to Sale').'" /></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 Sale').'" /></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>'; $TableHeader = '<tr><th>' . _('Code') . '</th> <th>' . _('Description') . '</th> @@ -2189,7 +2198,7 @@ <th>' . _('Available') . '</th> <th>' . _('Quantity') . '</th></tr>'; echo $TableHeader; - + $i=0; $k=0; //row colour counter while ($myrow=DB_fetch_array($SearchResult)) { @@ -2272,7 +2281,7 @@ <td class="number">%s</td> <td class="number">%s</td> <td class="number">%s</td> - <td><font size="1"><input class="number" tabindex="'.strval($j+7).'" type="textbox" size="6" name="itm%s" value="0" /></font></td> + <td><font size="1"><input class="number" tabindex="'.strval($j+7).'" type="textbox" size="6" name="OrderQty%s" value="0" /></font><input type="hidden" name="StockID%s" value="%s" /></td> </tr>', $myrow['stockid'], $myrow['description'], @@ -2281,6 +2290,8 @@ locale_number_format($DemandQty, $myrow['decimalplaces']), locale_number_format($OnOrder, $myrow['decimalplaces']), locale_number_format($Available, $myrow['decimalplaces']), + $i, + $i, $myrow['stockid']); if ($j==1) { $jsCall = '<script type="text/javascript">if (document.SelectParts) {defaultControl(document.SelectParts.itm'.$myrow['stockid'].');}</script>'; @@ -2296,7 +2307,7 @@ echo '<input type="hidden" name="Email" value="'.$_SESSION['Items'.$identifier]->Email.'" />'; 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="OrderItems" value="1" /><input tabindex="'.strval($j+8).'" type="submit" value="'._('Add to Sale').'" /></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 Sale').'" /></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; Modified: trunk/Credit_Invoice.php =================================================================== --- trunk/Credit_Invoice.php 2011-09-10 04:52:21 UTC (rev 4684) +++ trunk/Credit_Invoice.php 2011-09-11 04:06:48 UTC (rev 4685) @@ -208,12 +208,12 @@ } } if (isset($_POST['ChargeFreightCost'])){ - $_SESSION['CreditItems']->FreightCost = $_POST['ChargeFreightCost']; + $_SESSION['CreditItems']->FreightCost = filter_number_format($_POST['ChargeFreightCost']); } foreach ($_SESSION['CreditItems']->FreightTaxes as $FreightTaxLine) { if (isset($_POST['FreightTaxRate' . $FreightTaxLine->TaxCalculationOrder])){ - $_SESSION['CreditItems']->FreightTaxes[$FreightTaxLine->TaxCalculationOrder]->TaxRate = $_POST['FreightTaxRate' . $FreightTaxLine->TaxCalculationOrder]/100; + $_SESSION['CreditItems']->FreightTaxes[$FreightTaxLine->TaxCalculationOrder]->TaxRate = filter_number_format($_POST['FreightTaxRate' . $FreightTaxLine->TaxCalculationOrder])/100; } } @@ -228,9 +228,9 @@ if (isset($_POST['Quantity_' . $LineItem->LineNumber])){ $Narrative = $_POST['Narrative_' . $LineItem->LineNumber]; - $Quantity = $_POST['Quantity_' . $LineItem->LineNumber]; - $Price = $_POST['Price_' . $LineItem->LineNumber]; - $DiscountPercentage = $_POST['Discount_' . $LineItem->LineNumber]; + $Quantity = filter_number_format($_POST['Quantity_' . $LineItem->LineNumber]); + $Price = filter_number_format($_POST['Price_' . $LineItem->LineNumber]); + $DiscountPercentage = filter_number_format($_POST['Discount_' . $LineItem->LineNumber]); 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 credited to less than 0 or the price less than 0 or the discount more than 100% or less than 0%'),'error'); @@ -242,7 +242,7 @@ } foreach ($LineItem->Taxes as $TaxLine) { if (isset($_POST[$LineItem->LineNumber . $TaxLine->TaxCalculationOrder . '_TaxRate'])){ - $_SESSION['CreditItems']->LineItems[$LineItem->LineNumber]->Taxes[$TaxLine->TaxCalculationOrder]->TaxRate = $_POST[$LineItem->LineNumber . $TaxLine->TaxCalculationOrder . '_TaxRate']/100; + $_SESSION['CreditItems']->LineItems[$LineItem->LineNumber]->Taxes[$TaxLine->TaxCalculationOrder]->TaxRate = filter_number_format($_POST[$LineItem->LineNumber . $TaxLine->TaxCalculationOrder . '_TaxRate'])/100; } } } @@ -293,11 +293,11 @@ $j=0; //row counter foreach ($_SESSION['CreditItems']->LineItems as $LnItm) { - $LineTotal =($LnItm->QtyDispatched * $LnItm->Price * (1 - $LnItm->DiscountPercent)); + $LineTotal =(filter_number_format($LnItm->QtyDispatched) * filter_number_format($LnItm->Price) * (1 - filter_number_format($LnItm->DiscountPercent))); if (!isset($_POST['ProcessCredit'])) { - $_SESSION['CreditItems']->total = $_SESSION['CreditItems']->total + $LineTotal; - $_SESSION['CreditItems']->totalVolume = $_SESSION['CreditItems']->totalVolume + $LnItm->QtyDispatched * $LnItm->Volume; - $_SESSION['CreditItems']->totalWeight = $_SESSION['CreditItems']->totalWeight + $LnItm->QtyDispatched * $LnItm->Weight; + $_SESSION['CreditItems']->total += $LineTotal; + $_SESSION['CreditItems']->totalVolume += (filter_number_format($LnItm->QtyDispatched) * filter_number_format($LnItm->Volume)); + $_SESSION['CreditItems']->totalWeight += (filter_number_format($LnItm->QtyDispatched) * filter_number_format($LnItm->Weight)); if ($k==1){ $RowStarter = 'class="EvenTableRows"'; @@ -310,7 +310,7 @@ echo '<tr '.$RowStarter.'><td>' . $LnItm->StockID . '</td> <td>' . $LnItm->ItemDescription . '</td> - <td class=number>' . locale_number_format($LnItm->Quantity,$LnItm->DecimalPlaces) . '</td> + <td class="number">' . locale_number_format($LnItm->Quantity,$LnItm->DecimalPlaces) . '</td> <td>' . $LnItm->Units . '</td>'; if ($LnItm->Controlled==1){ @@ -323,12 +323,12 @@ } - $DisplayLineTotal = locale_number_format($LineTotal,$_SESSION['CreditItems']->CurrDecimalPlaces); + $DisplayLineTotal = locale_money_format($LineTotal,$_SESSION['CreditItems']->CurrDecimalPlaces); $j++; - echo '<td><input tabindex=' . $j . ' type="text" class=number name="Price_' . $LnItm->LineNumber . '" maxlength=12 size=6 value=' . $LnItm->Price . '></td> + echo '<td><input tabindex=' . $j . ' type="text" class="number" name="Price_' . $LnItm->LineNumber . '" maxlength=12 size=... [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"><input type="submit" name="Process" value="' . _('Accept') . '"> + <input type="submit" name="Cancel" value="' . _('Cancel') . '"></div>'; echo '</form>'; @@ -149,10 +149,10 @@ echo '<p><div class="centre"><a href="' . $_SERVER['PHP_SELF'] . '">' . _('Expense Codes for Type of Tab ') . ' ' .$SelectedTab. '</a></div><p>'; echo '<form method="post" action="' . $_SERVER['PHP_SELF'] . '">'; echo '<input type="hidden" name="FormID" value="' . $_SESSION['FormID'] . '" />'; - + echo '<input type="hidden" name="SelectedTab" value="' . $SelectedTab . '">'; - $sql = "SELECT pctabexpenses.codeexpense, + $sql = "SELECT pctabexpenses.codeexpense, pcexpenses.description FROM pctabexpenses INNER JOIN pcexpenses ON pctabexpenses.codeexpense=pcexpenses.codeexpense @@ -186,9 +186,9 @@ </tr>', $myrow['codeexpense'], $myrow['description'], - $_SERVER['PHP_SELF'], + $_SERVER['PHP_SELF'], $myrow['codeexpense'], - $_SERVER['PHP_SELF'], + $_SERVER['PHP_SELF'], $myrow['codeexpense']); } //END WHILE LIST LOOP @@ -196,16 +196,16 @@ if (! isset($_GET['delete'])) { - + echo '<br /><table class="selection">'; //Main table - + echo '<tr><td>' . _('Select Expense Code') . ':</td><td><select name="SelectedExpense">'; - + DB_free_result($result); $SQL = "SELECT codeexpense, description FROM pcexpenses"; - + $result = DB_query($SQL,$db); if (!isset($_POST['SelectedExpense'])){ echo '<option selected value="">' . _('Not Yet Selected') . '</option>'; @@ -217,18 +217,18 @@ echo '<option value="'; } echo $myrow['codeexpense'] . '">' . $myrow['codeexpense'] . ' - ' . $myrow['description'] . '</option>'; - + } //end while loop - + echo '</select></td></tr>'; - + 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>'; - + } // end if user wish to delete } Modified: trunk/PcReportTab.php =================================================================== --- trunk/PcReportTab.php 2011-09-11 04:06:48 UTC (rev 4685) +++ trunk/PcReportTab.php 2011-09-12 08:03:20 UTC (rev 4686) @@ -32,7 +32,7 @@ } /*Show a form to allow input of criteria for Tabs to show */ - echo '<table class=selection>'; + echo '<table class="selection">'; echo '<tr><td>' . _('Code Of Petty Cash Tab') . ':</td><td><select name="SelectedTabs">'; if ($_SESSION['AccessLevel'] >= 15){ // superuser can supervise the supervisors @@ -67,7 +67,7 @@ echo '<tr><td>' . _('To Date:') .'</td><td>'; echo '<input tabindex="3" class="date" alt="'.$_SESSION['DefaultDateFormat'].'" type="text" name="ToDate" maxlength="10" size="11" value="' . $_POST['ToDate'] . '">'; echo '</td></tr></table><br />'; - echo '<div class="centre"><input type=submit Name="ShowTB" Value="' . _('Show HTML') .'">'; + echo '<div class="centre"><input type="submit" Name="ShowTB" Value="' . _('Show HTML') .'">'; echo '<input type="submit" name="PrintPDF" value="' . _('PrintPDF') . '"></div>'; } else if (isset($_POST['PrintPDF'])) { @@ -133,7 +133,7 @@ $LeftOvers = $pdf->addTextWrap($Left_Margin,$YPos,60,$FontSize,_('Tab Code :')); $LeftOvers = $pdf->addTextWrap($Left_Margin+100,$YPos,20,$FontSize,_(': ')); $LeftOvers = $pdf->addTextWrap($Left_Margin+110,$YPos,70,$FontSize,$SelectedTabs); - $LeftOvers = $pdf->addTextWrap($Left_Margin+290,$YPos,70,$FontSize,_('From ')); + $LeftOvers = $pdf->addTextWrap($Left_Margin+290,$YPos,70,$FontSize,_('From'). ' '); $LeftOvers = $pdf->addTextWrap($Left_Margin+320,$YPos,20,$FontSize,_(': ')); $LeftOvers = $pdf->addTextWrap($Left_Margin+340,$YPos,70,$FontSize,$_POST['FromDate']); @@ -159,7 +159,7 @@ $LeftOvers = $pdf->addTextWrap($Left_Margin,$YPos,40,$FontSize,_('Balance before ')); $LeftOvers = $pdf->addTextWrap($Left_Margin+55,$YPos,70,$FontSize,$_POST['FromDate']); $LeftOvers = $pdf->addTextWrap($Left_Margin+100,$YPos,20,$FontSize,_(': ')); - $LeftOvers = $pdf->addTextWrap($Left_Margin+110,$YPos,70,$FontSize,locale_number_format($Balance['0'],2)); + $LeftOvers = $pdf->addTextWrap($Left_Margin+110,$YPos,70,$FontSize,locale_money_format($Balance['0'],$_SESSION['CompanyRecord']['decimalplaces'])); $LeftOvers = $pdf->addTextWrap($Left_Margin+150,$YPos,70,$FontSize,$Tabs['currency']); $YPos -= (2 * $line_height); @@ -191,7 +191,7 @@ // Print total for each account $LeftOvers = $pdf->addTextWrap($Left_Margin,$YPos,70,$FontSize,ConvertSQLDate($myrow['date'])); $LeftOvers = $pdf->addTextWrap($Left_Margin+70,$YPos,130,$FontSize,$Description[0]); - $LeftOvers = $pdf->addTextWrap($Left_Margin+180,$YPos,50,$FontSize,locale_number_format($myrow['amount'],2),'right'); + $LeftOvers = $pdf->addTextWrap($Left_Margin+180,$YPos,50,$FontSize,locale_money_format($myrow['amount'],$_SESSION['CompanyRecord']['decimalplaces']),'right'); $LeftOvers = $pdf->addTextWrap($Left_Margin+250,$YPos,100,$FontSize,$myrow['notes']); $LeftOvers = $pdf->addTextWrap($Left_Margin+350,$YPos,70,$FontSize,$myrow['receipt']); $LeftOvers = $pdf->addTextWrap($Left_Margin+430,$YPos,70,$FontSize,ConvertSQLDate($myrow['authorized'])); @@ -216,7 +216,7 @@ $LeftOvers = $pdf->addTextWrap($Left_Margin+70,$YPos,100,$FontSize,_('Balance at')); $LeftOvers = $pdf->addTextWrap($Left_Margin+110,$YPos,70,$FontSize,$_POST['ToDate']); $LeftOvers = $pdf->addTextWrap($Left_Margin+160,$YPos,20,$FontSize,_(': ')); - $LeftOvers = $pdf->addTextWrap($Left_Margin+160,$YPos,70,$FontSize,locale_number_format($Amount[0],2),'right'); + $LeftOvers = $pdf->addTextWrap($Left_Margin+160,$YPos,70,$FontSize,locale_money_format($Amount[0],$_SESSION['CompanyRecord']['decimalplaces']),'right'); $LeftOvers = $pdf->addTextWrap($Left_Margin+240,$YPos,70,$FontSize,$Tabs['currency']); $pdf->line($Page_Width-$Right_Margin, $YPos+$line_height,$Left_Margin, $YPos+$line_height); @@ -282,7 +282,7 @@ echo '<tr><td>' . _('Balance before ') . ''.$_POST['FromDate'].'</td> <td>:</td> - <td>' . ''.$Balance['0'].' '.$Tabs['currency'].'</td> + <td>' . locale_money_format($Balance['0'],$_SESSION['CompanyRecord']['decimalplaces']).' '.$Tabs['currency'].'</td> </tr>'; $SqlBalanceNotAut = "SELECT SUM(amount) @@ -299,7 +299,7 @@ $BalanceNotAut['0']=0; } - echo '<tr><td>' . _('Total not authorised before ') . ''.$_POST['FromDate'].'</td><td>:</td><td>' . ''.$BalanceNotAut['0'].' '.$Tabs['currency'].'</td></tr>'; + echo '<tr><td>' . _('Total not authorised before ') . ''.$_POST['FromDate'].'</td><td>:</td><td>' . ''.locale_money_format($BalanceNotAut['0'],$_SESSION['CompanyRecord']['decimalplaces']) . ' ' . $Tabs['currency'].'</td></tr>'; echo '</table>'; @@ -362,7 +362,7 @@ </tr>", ConvertSQLDate($myrow['2']), $Description['0'], - locale_number_format($myrow['4'],2), + locale_money_format($myrow['4'],$_SESSION['CompanyRecord']['decimalplaces']), $myrow['7'], $myrow['8'], ConvertSQLDate($myrow['5'])); @@ -376,7 +376,7 @@ </tr>", ConvertSQLDate($myrow['2']), $Description['0'], - locale_number_format($myrow['4'],2), + locale_money_format($myrow['4'],$_SESSION['CompanyRecord']['decimalplaces']), $myrow['7'], $myrow['8'], ' '); @@ -397,7 +397,7 @@ } echo '<tr><td colspan=2 style=text-align:right >' . _('Balance At') . ' '.$_POST['ToDate'].':</td> - <td>'.locale_number_format($Amount[0],2).' </td><td>'.$Tabs['currency'].'</td></tr>'; + <td>'.locale_money_format($Amount[0],$_SESSION['CompanyRecord']['decimalplaces']).' </td><td>'.$Tabs['currency'].'</td></tr>'; echo '</table>'; echo '<br /><div class="centre"><input type="submit" name="SelectDifferentDate" value="' . _('Select A Different Date') . '"></div>'; Modified: trunk/PcTabs.php =================================================================== --- trunk/PcTabs.php 2011-09-11 04:06:48 UTC (rev 4685) +++ trunk/PcTabs.php 2011-09-12 08:03:20 UTC (rev 4686) @@ -92,7 +92,7 @@ $sql = "UPDATE pctabs SET usercode = '" . $_POST['SelectUser'] . "', typetabcode = '" . $_POST['SelectTabs'] . "', currency = '" . $_POST['SelectCurrency'] . "', - tablimit = '" . $_POST['TabLimit'] . "', + tablimit = '" . filter_number_format($_POST['TabLimit']) . "', assigner = '" . $_POST['SelectAssigner'] . "', authorizer = '" . $_POST['SelectAuthoriser'] . "', glaccountassignment = '" . $_POST['GLAccountCash'] . "', @@ -131,12 +131,12 @@ '" . $_POST['SelectUser'] . "', '" . $_POST['SelectTabs'] . "', '" . $_POST['SelectCurrency'] . "', - '" . $_POST['TabLimit'] . "', + '" . filter_number_format($_POST['TabLimit']) . "', '" . $_POST['SelectAssigner'] . "', '" . $_POST['SelectAuthoriser'] . "', '" . $_POST['GLAccountCash'] . "', '" . $_POST['GLAccountPcashTab'] . "')"; - + $msg = _('The Petty Cash Tab') . ' ' . $_POST['tabcode'] . ' ' . _('has been created'); } @@ -187,9 +187,9 @@ currencies.decimalplaces, chartmaster1.accountname AS glactassigntname, chartmaster2.accountname AS glactpcashname - FROM pctabs INNER JOIN currencies - ON pctabs.currency=currencies.currabrev - INNER JOIN pctypetabs + FROM pctabs INNER JOIN currencies + ON pctabs.currency=currencies.currabrev + INNER JOIN pctypetabs ON pctabs.typetabcode=pctypetabs.typetabcode INNER JOIN chartmaster AS chartmaster1 ON pctabs.glaccountassignment = chartmaster1.accountcode @@ -210,9 +210,9 @@ <th>' . _('GL Account For Cash Assignment') . '</th> <th>' . _('GL Account Petty Cash Tab') . '</th> </tr>'; - + $k=0; //row colour counter - + while ($myrow = DB_fetch_array($result)) { if ($k==1){ echo '<tr class="EvenTableRows">'; @@ -221,7 +221,7 @@ echo '<tr class="OddTableRows">'; $k=1; } - + printf('<td>%s</td> <td>%s</td> <td>%s</td> @@ -329,7 +329,7 @@ DB_free_result($result); $SQL = "SELECT typetabcode, typetabdescription - FROM pctypetabs + FROM pctypetabs ORDER BY typetabcode"; $result = DB_query($SQL,$db); @@ -420,7 +420,7 @@ <td><select name="GLAccountCash">'; DB_free_result($result); - $SQL = "SELECT chartmaster.accountcode, + $SQL = "SELECT chartmaster.accountcode, chartmaster.accountname FROM chartmaster INNER JOIN bankaccounts ON chartmaster.accountcode = bankaccounts.accountcode @@ -463,7 +463,7 @@ echo '</select></td></tr>'; 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/StockLocTransferReceive.php =================================================================== --- trunk/StockLocTransferReceive.php 2011-09-11 04:06:48 UTC (rev 4685) +++ trunk/StockLocTransferReceive.php 2011-09-12 08:03:20 UTC (rev 4686) @@ -4,8 +4,6 @@ include('includes/DefineSerialItems.php'); include('includes/DefineStockTransfers.php'); -//$PageSecurity = 11; - include('includes/session.inc'); $title = _('Inventory Transfer') . ' - ' . _('Receiving'); include('includes/header.inc'); @@ -29,14 +27,14 @@ $i=0; $TotalQuantity = 0; foreach ($_SESSION['Transfer']->TransferItem AS $TrfLine) { - if (is_numeric($_POST['Qty' . $i])){ + if (is_numeric(filter_number_format($_POST['Qty' . $i]))){ /*Update the quantity received from the inputs */ - $_SESSION['Transfer']->TransferItem[$i]->Quantity= $_POST['Qty' . $i]; + $_SESSION['Transfer']->TransferItem[$i]->Quantity= filter_number_format($_POST['Qty' . $i]); } else { prnMsg(_('The quantity entered for'). ' ' . $TrfLine->StockID . ' '. _('is not numeric') . '. ' . _('All quantities must be numeric'),'error'); $InputError = True; } - if ($_POST['Qty' . $i]<0){ + if (filter_number_format($_POST['Qty' . $i])<0){ prnMsg(_('The quantity entered for'). ' ' . $TrfLine->StockID . ' '. _('is negative') . '. ' . _('All quantities must be for positive numbers greater than zero'),'error'); $InputError = True; } @@ -44,12 +42,12 @@ prnMsg( _('The Quantity entered plus the Quantity Previously Received can not be greater than the Total Quantity shipped for').' '. $TrfLine->StockID , 'error'); $InputError = True; } - if (isset($_POST['CancelBalance' . $i]) and $_POST['CancelBalance' . $i]==1){ - $_SESSION['Transfer']->TransferItem[$i]->CancelBalance=1; - } else { - $_SESSION['Transfer']->TransferItem[$i]->CancelBalance=0; - } - $TotalQuantity += $TrfLine->Quantity; + if (isset($_POST['CancelBalance' . $i]) and $_POST['CancelBalance' . $i]==1){ + $_SESSION['Transfer']->TransferItem[$i]->CancelBalance=1; + } else { + $_SESSION['Transfer']->TransferItem[$i]->CancelBalance=0; + } + $TotalQuantity += filter_number_format($TrfLine->Quantity); $i++; } /*end loop to validate and update the SESSION['Transfer'] data */ if ($TotalQuantity < 0){ @@ -80,16 +78,15 @@ } /* Insert the stock movement for the stock going out of the from location */ - $SQL = "INSERT INTO stockmoves ( - stockid, - type, - transno, - loccode, - trandate, - prd, - reference, - qty, - newqoh) + $SQL = "INSERT INTO stockmoves (stockid, + type, + transno, + loccode, + trandate, + prd, + reference, + qty, + newqoh) VALUES ( '" . $TrfLine->StockID . "', 16, @@ -98,8 +95,8 @@ '" . $SQLTransferDate . "', '" . $PeriodNo . "', '" . _('To') . ' ' . $_SESSION['Transfer']->StockLocationToName . "', - '" . round(-$TrfLine->Quantity, $TrfLine->DecimalPlaces) . "', - '" . round($QtyOnHandPrior - $TrfLine->Quantity, $TrfLine->DecimalPlaces) . "' + '" . filter_number_format(round(-$TrfLine->Quantity, $TrfLine->DecimalPlaces)) . "', + '" . filter_number_format(round($QtyOnHandPrior - $TrfLine->Quantity, $TrfLine->DecimalPlaces)) . "' )"; $ErrMsg = _('CRITICAL ERROR') . '! ' . _('NOTE DOWN THIS ERROR AND SEEK ASSISTANCE') . ': ' . _('The stock movement record cannot be inserted because'); @@ -122,7 +119,7 @@ WHERE stockid='" . $TrfLine->StockID . "' AND loccode='" . $_SESSION['Transfer']->StockLocationFrom . "' - AND serialno='" . $Item->BundleRef . "'"; + AND serialno='" . DB_escape_string($Item->BundleRef) . "'"; $Result = DB_query($SQL,$db,'<br />' . _('Could not determine if the serial item exists') ); $SerialItemExistsRow = DB_fetch_row($Result); @@ -130,11 +127,11 @@ if ($SerialItemExistsRow[0]==1){ $SQL = "UPDATE stockserialitems SET - quantity= quantity - " . $Item->BundleQty . " + quantity= quantity - " . filter_number_format($Item->BundleQty) . " WHERE stockid='" . $TrfLine->StockID . "' AND loccode='" . $_SESSION['Transfer']->StockLocationFrom . "' - 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'); @@ -147,8 +144,8 @@ quantity) VALUES ('" . $TrfLine->StockID . "', '" . $_SESSION['Transfer']->StockLocationFrom . "', - '" . $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 item for the stock being transferred out of the existing location could not be inserted because'); $DbgMsg = _('The following SQL to update the serial stock item record was used'); @@ -166,8 +163,8 @@ ) VALUES ( '" . $StkMoveNo . "', '" . $TrfLine->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'); @@ -179,9 +176,9 @@ /* Need to get the current location quantity will need it later for the stock movement */ $SQL="SELECT locstock.quantity - FROM locstock - WHERE locstock.stockid='" . $TrfLine->StockID . "' - AND loccode= '" . $_SESSION['Transfer']->StockLocationTo . "'"; + FROM locstock + WHERE locstock.stockid='" . $TrfLine->StockID . "' + AND loccode= '" . $_SESSION['Transfer']->StockLocationTo . "'"; $Result = DB_query($SQL, $db, _('Could not retrieve the quantity on hand at the location being transferred to') ); if (DB_num_rows($Result)==1){ @@ -193,16 +190,15 @@ } // Insert the stock movement for the stock coming into the to location - $SQL = "INSERT INTO stockmoves ( - stockid, - type, - transno, - loccode, - trandate, - prd, - reference, - qty, - newqoh) + $SQL = "INSERT INTO stockmoves (stockid, + type, + transno, + loccode, + trandate, + prd, + reference, + qty, + newqoh) VALUES ( '" . $TrfLine->StockID . "', 16, @@ -211,8 +207,8 @@ '" . $SQLTransferDate . "', '" . $PeriodNo . "', '" . _('From') . ' ' . $_SESSION['Transfer']->StockLocationFromName ."', - '" . round($TrfLine->Quantity, $TrfLine->DecimalPlaces) . "', - '" . round($QtyOnHandPrior + $TrfLine->Quantity, $TrfLine->DecimalPlaces) . "' + '" . filter_number_format(round($TrfLine->Quantity, $TrfLine->DecimalPlaces)) . "', + '" . filter_number_format(round($QtyOnHandPrior + $TrfLine->Quantity, $TrfLine->DecimalPlaces)) . "' )"; $ErrMsg = _('CRITICAL ERROR') . '! ' . _('NOTE DOWN THIS ERROR AND SEEK ASSISTANCE') . ': ' . _('The stock movement record for the incoming stock cannot be added because'); @@ -236,7 +232,7 @@ WHERE stockid='" . $TrfLine->StockID . "' AND loccode='" . $_SESSION['Transfer']->StockLocationTo . "' - AND serialno='" . $Item->BundleRef . "'"; + AND serialno='" . DB_escape_string($Item->BundleRef) . "'"; $Result = DB_query($SQL,$db,'<br />'. _('Could not determine if the serial item exists') ); $SerialItemExistsRow = DB_fetch_row($Result); @@ -245,11 +241,11 @@ if ($SerialItemExistsRow[0]==1){ $SQL = "UPDATE stockserialitems SET - quantity= quantity + '" . $Item->BundleQty . "' + quantity= quantity + '" . filter_number_format($Item->BundleQty) . "' WHERE stockid='" . $TrfLine->StockID . "' AND loccode='" . $_SESSION['Transfer']->StockLocationTo . "' - 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 for the quantity coming in because'); $DbgMsg = _('The following SQL to update the serial stock item record was used'); @@ -262,8 +258,8 @@ quantity) VALUES ('" . $TrfLine->StockID . "', '" . $_SESSION['Transfer']->StockLocationTo . "', - '" . $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 item record for the stock coming in could not be added because'); $DbgMsg = _('The following SQL to update the serial stock item record was used'); @@ -280,8 +276,8 @@ moveqty) VALUES (" . $StkMoveNo . ", '" . $TrfLine->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'); $Result = DB_query($SQL, $db, $ErrMsg, $DbgMsg, true); @@ -290,7 +286,7 @@ } /*end if the transfer item is a controlled item */ $SQL = "UPDATE locstock - SET quantity = quantity - '" . round($TrfLine->Quantity, $TrfLine->DecimalPlaces) . "' + SET quantity = quantity - '" . filter_number_format(round($TrfLine->Quantity, $TrfLine->DecimalPlaces)) . "' WHERE stockid='" . $TrfLine->StockID . "' AND loccode='" . $_SESSION['Transfer']->StockLocationFrom . "'"; @@ -299,7 +295,7 @@ $Result = DB_query($SQL, $db, $ErrMsg, $DbgMsg, true); $SQL = "UPDATE locstock - SET quantity = quantity + '" . round($TrfLine->Quantity, $TrfLine->DecimalPlaces) . "' + SET quantity = quantity + '" . filter_number_format(round($TrfLine->Quantity, $TrfLine->DecimalPlaces)) . "' WHERE stockid='" . $TrfLine->StockID . "' AND loccode='" . $_SESSION['Transfer']->StockLocationTo . "'"; @@ -310,13 +306,13 @@ prnMsg(_('A stock transfer for item code'). ' - ' . $TrfLine->StockID . ' ' . $TrfLine->ItemDescription . ' '. _('has been created from').' ' . $_SESSION['Transfer']->StockLocationFromName . ' '. _('to'). ' ' . $_SESSION['Transfer']->StockLocationToName . ' ' . _('for a quantity of'). ' '. $TrfLine->Quantity,'success'); if ($TrfLine->CancelBalance==1){ - $sql = "UPDATE loctransfers SET recqty = recqty + '". round($TrfLine->Quantity, $TrfLine->DecimalPlaces) . "', - shipqty = recqty + '". round($TrfLine->Quantity, $TrfLine->DecimalPlaces) . "', + $sql = "UPDATE loctransfers SET recqty = recqty + '". filter_number_format(round($TrfLine->Quantity, $TrfLine->DecimalPlaces)) . "', + shipqty = recqty + '". filter_number_format(round($TrfLine->Quantity, $TrfLine->DecimalPlaces)) . "', recdate = '".date('Y-m-d H:i:s'). "' WHERE reference = '". $_SESSION['Transfer']->TrfID . "' AND stockid = '". $TrfLine->StockID."'"; } else { - $sql = "UPDATE loctransfers SET recqty = recqty + '". round($TrfLine->Quantity, $TrfLine->DecimalPlaces) . "', + $sql = "UPDATE loctransfers SET recqty = recqty + '". filter_number_format(round($TrfLine->Quantity, $TrfLine->DecimalPlaces)) . "', recdate = '".date('Y-m-d H:i:s'). "' WHERE reference = '". $_SESSION['Transfer']->TrfID . "' AND stockid = '". $TrfLine->StockID."'"; @@ -350,25 +346,25 @@ unset($_SESSION['Transfer']); $sql = "SELECT loctransfers.stockid, - stockmaster.description, - stockmaster.units, - stockmaster.controlled, - stockmaster.serialised, - stockmaster.perishable, - stockmaster.decimalplaces, - loctransfers.shipqty, - loctransfers.recqty, - locations.locationname as shiplocationname, - reclocations.locationname as reclocationname, - loctransfers.shiploc, - loctransfers.recloc - FROM loctransfers INNER JOIN locations - ON loctransfers.shiploc=locations.loccode - INNER JOIN locations as reclocations - ON loctransfers.recloc = reclocations.loccode - INNER JOIN stockmaster - ON loctransfers.stockid=stockmaster.stockid - WHERE reference ='" . $_GET['Trf_ID'] . "' ORDER BY loctransfers.stockid"; + stockmaster.description, + stockmaster.units, + stockmaster.controlled, + stockmaster.serialised, + stockmaster.perishable, + stockmaster.decimalplaces, + loctransfers.shipqty, + loctransfers.recqty, + locations.locationname as shiplocationname, + reclocations.locationname as reclocationname, + loctransfers.shiploc, + loctransfers.recloc + FROM loctransfers INNER JOIN locations + ON loctransfers.shiploc=locations.loccode + INNER JOIN locations as reclocations + ON loctransfers.recloc = reclocations.loccode + INNER JOIN stockmaster + ON loctransfers.stockid=stockmaster.stockid + WHERE reference ='" . $_GET['Trf_ID'] . "' ORDER BY loctransfers.stockid"; $ErrMsg = _('The details of transfer number') . ' ' . $_GET['Trf_ID'] . ' ' . _('could not be retrieved because') .' '; @@ -384,24 +380,22 @@ $myrow=DB_fetch_array($result); $_SESSION['Transfer']= new StockTransfer($_GET['Trf_ID'], - $myrow['shiploc'], - $myrow['shiplocationname'], - $myrow['recloc'], - $myrow['reclocationname'], - Date($_SESSION['DefaultDateFormat']) - ); + $myrow['shiploc'], + $myrow['shiplocationname'], + $myrow['recloc'], + $myrow['reclocationname'], + Date($_SESSION['DefaultDateFormat']) ); /*Populate the StockTransfer TransferItem s array with the lines to be transferred */ $i = 0; do { $_SESSION['Transfer']->TransferItem[$i]= new LineItem ($myrow['stockid'], - $myrow['description'], - $myrow['shipqty'], - $myrow['units'], - $myrow['controlled'], - $myrow['serialised'], - $myrow['perishable'], - $myrow['decimalplaces'] - ); + $myrow['description'], + $myrow['shipqty'], + $myrow['units'], + $myrow['controlled'], + $myrow['serialised'], + $myrow['perishable'], + $myrow['decimalplaces'] ); $_SESSION['Transfer']->TransferItem[$i]->PrevRecvQty = $myrow['recqty']; $_SESSION['Transfer']->TransferItem[$i]->Quantity = $myrow['shipqty']-$myrow['recqty']; @@ -423,10 +417,9 @@ $i = 0; //Line Item Array pointer - echo "<br /><table class=selection>"; - echo '<tr><th colspan=7><font size=3 color=blue>' . _('Location Transfer Reference'). ' #' . $_SESSION['Transfer']->TrfID . - ' '. _('from').' ' . $_SESSION['Transfer']->StockLocationFromName . ' '. _('to'). ' ' . - $_SESSION['Transfer']->StockLocationToName . '</font></th></tr>'; + echo '<br /> + <table class="selection">'; + echo '<tr><th colspan="7"><font size=3 color=blue>' . _('Location Transfer Reference'). ' #' . $_SESSION['Transfer']->TrfID . ' '. _('from').' ' . $_SESSION['Transfer']->StockLocationFromName . ' '. _('to'). ' ' . $_SESSION['Transfer']->StockLocationToName . '</font></th></tr>'; $tableheader = '<tr> <th>'. _('Item Code') . '</th> @@ -453,24 +446,24 @@ <td>' . $TrfLine->ItemDescription . '</td>'; echo '<td class=number>' . locale_number_format($TrfLine->ShipQty, $TrfLine->DecimalPlaces) . '</td>'; - if (isset($_POST['Qty' . $i]) and is_numeric($_POST['Qty' . $i])){ - $_SESSION['Transfer']->TransferItem[$i]->Quantity= $_POST['Qty' . $i]; - $Qty = $_POST['Qty' . $i]; + if (isset($_POST['Qty' . $i]) AND is_numeric(filter_number_format($_POST['Qty' . $i]))){ + $_SESSION['Transfer']->TransferItem[$i]->Quantity= filter_number_format($_POST['Qty' . $i]); + $Qty = filter_number_format($_POST['Qty' . $i]); } else if ($TrfLine->Controlled==1) { if (sizeOf($TrfLine->SerialItems)==0) { $Qty = 0; } else { - $Qty = $TrfLine->Quantity; + $Qty = filter_number_format($TrfLine->Quantity); } } else { - $Qty = $TrfLine->Quantity; + $Qty = filter_number_format($TrfLine->Quantity); } echo '<td class=number>' . locale_number_format($TrfLine->PrevRecvQty, $TrfLine->DecimalPlaces) . '</td>'; if ($TrfLine->Controlled==1){ - echo '<td class=number><input type=hidden name="Qty' . $i . '" VALUE="' . $Qty . '"><a href="' . $rootpath .'/StockTransferControlled.php?' . SID . '&TransferItem=' . $i . '">' . $Qty . '</a></td>'; + echo '<td class=number><input type=hidden name="Qty' . $i . '" value="' . $Qty . '"><a href="' . $rootpath .'/StockTransferControlled.php?TransferItem=' . $i . '">' . $Qty . '</a></td>'; } else { - echo '<td><input type="text" class="number" name="Qty' . $i . '" maxlength=10 class="number" size=auto VALUE="' . $Qty . '"></td>'; + echo '<td><input type="text" class="number" name="Qty' . $i . '" maxlength=10 class="number" size=auto value="' . $Qty . '"></td>'; } echo '<td>' . $TrfLine->PartUnit . '</td>'; @@ -480,9 +473,9 @@ if ($TrfLine->Controlled==1){ if ($TrfLine->Serialised==1){ - echo '<td><a href="' . $rootpath .'/StockTransferControlled.php?' . SID . '&TransferItem=' . $i . '">' . _('Enter Serial Numbers') . '</a></td>'; + echo '<td><a href="' . $rootpath .'/StockTransferControlled.php?TransferItem=' . $i . '">' . _('Enter Serial Numbers') . '</a></td>'; } else { - echo '<td><a href="' . $rootpath .'/StockTransferControlled.php?' . SID . '&TransferItem=' . $i . '">' . _('Enter Batch Refs') . '</a></td>'; + echo '<td><a href="' . $rootpath .'/StockTransferControlled.php?TransferItem=' . $i . '">' . _('Enter Batch Refs') . '</a></td>'; } } @@ -492,34 +485,33 @@ } /*end of foreach TransferItem */ echo '</table><br /> - <div class="centre"><input type=submit name="ProcessTransfer" VALUE="'. _('Process Inventory Transfer'). '"><bR /> + <div class="centre"><input type="submit" name="ProcessTransfer" value="'. _('Process Inventory Transfer'). '"><br /> </form></div>'; - echo '<a href="'.$_SERVER['PHP_SELF']. '?' . SID . '&NewTransfer=true">'. _('Select A Different Trans... [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"><input type="submit" name="Process" value="' . _('Accept') . '"> + <input type="submit" name="Cancel" value="' . _('Cancel') . '"></div>'; echo '</form>'; @@ -149,10 +149,10 @@ echo '<p><div class="centre"><a href="' . $_SERVER['PHP_SELF'] . '">' . _('Expense Codes for Type of Tab ') . ' ' .$SelectedTab. '</a></div><p>'; echo '<form method="post" action="' . $_SERVER['PHP_SELF'] . '">'; echo '<input type="hidden" name="FormID" value="' . $_SESSION['FormID'] . '" />'; - + echo '<input type="hidden" name="SelectedTab" value="' . $SelectedTab . '">'; - $sql = "SELECT pctabexpenses.codeexpense, + $sql = "SELECT pctabexpenses.codeexpense, pcexpenses.description FROM pctabexpenses INNER JOIN pcexpenses ON pctabexpenses.codeexpense=pcexpenses.codeexpense @@ -186,9 +186,9 @@ </tr>', $myrow['codeexpense'], $myrow['description'], - $_SERVER['PHP_SELF'], + $_SERVER['PHP_SELF'], $myrow['codeexpense'], - $_SERVER['PHP_SELF'], + $_SERVER['PHP_SELF'], $myrow['codeexpense']); } //END WHILE LIST LOOP @@ -196,16 +196,16 @@ if (! isset($_GET['delete'])) { - + echo '<br /><table class="selection">'; //Main table - + echo '<tr><td>' . _('Select Expense Code') . ':</td><td><select name="SelectedExpense">'; - + DB_free_result($result); $SQL = "SELECT codeexpense, description FROM pcexpenses"; - + $result = DB_query($SQL,$db); if (!isset($_POST['SelectedExpense'])){ echo '<option selected value="">' . _('Not Yet Selected') . '</option>'; @@ -217,18 +217,18 @@ echo '<option value="'; } echo $myrow['codeexpense'] . '">' . $myrow['codeexpense'] . ' - ' . $myrow['description'] . '</option>'; - + } //end while loop - + echo '</select></td></tr>'; - + 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>'; - + } // end if user wish to delete } Modified: trunk/PcReportTab.php =================================================================== --- trunk/PcReportTab.php 2011-09-11 04:06:48 UTC (rev 4685) +++ trunk/PcReportTab.php 2011-09-12 08:03:20 UTC (rev 4686) @@ -32,7 +32,7 @@ } /*Show a form to allow input of criteria for Tabs to show */ - echo '<table class=selection>'; + echo '<table class="selection">'; echo '<tr><td>' . _('Code Of Petty Cash Tab') . ':</td><td><select name="SelectedTabs">'; if ($_SESSION['AccessLevel'] >= 15){ // superuser can supervise the supervisors @@ -67,7 +67,7 @@ echo '<tr><td>' . _('To Date:') .'</td><td>'; echo '<input tabindex="3" class="date" alt="'.$_SESSION['DefaultDateFormat'].'" type="text" name="ToDate" maxlength="10" size="11" value="' . $_POST['ToDate'] . '">'; echo '</td></tr></table><br />'; - echo '<div class="centre"><input type=submit Name="ShowTB" Value="' . _('Show HTML') .'">'; + echo '<div class="centre"><input type="submit" Name="ShowTB" Value="' . _('Show HTML') .'">'; echo '<input type="submit" name="PrintPDF" value="' . _('PrintPDF') . '"></div>'; } else if (isset($_POST['PrintPDF'])) { @@ -133,7 +133,7 @@ $LeftOvers = $pdf->addTextWrap($Left_Margin,$YPos,60,$FontSize,_('Tab Code :')); $LeftOvers = $pdf->addTextWrap($Left_Margin+100,$YPos,20,$FontSize,_(': ')); $LeftOvers = $pdf->addTextWrap($Left_Margin+110,$YPos,70,$FontSize,$SelectedTabs); - $LeftOvers = $pdf->addTextWrap($Left_Margin+290,$YPos,70,$FontSize,_('From ')); + $LeftOvers = $pdf->addTextWrap($Left_Margin+290,$YPos,70,$FontSize,_('From'). ' '); $LeftOvers = $pdf->addTextWrap($Left_Margin+320,$YPos,20,$FontSize,_(': ')); $LeftOvers = $pdf->addTextWrap($Left_Margin+340,$YPos,70,$FontSize,$_POST['FromDate']); @@ -159,7 +159,7 @@ $LeftOvers = $pdf->addTextWrap($Left_Margin,$YPos,40,$FontSize,_('Balance before ')); $LeftOvers = $pdf->addTextWrap($Left_Margin+55,$YPos,70,$FontSize,$_POST['FromDate']); $LeftOvers = $pdf->addTextWrap($Left_Margin+100,$YPos,20,$FontSize,_(': ')); - $LeftOvers = $pdf->addTextWrap($Left_Margin+110,$YPos,70,$FontSize,locale_number_format($Balance['0'],2)); + $LeftOvers = $pdf->addTextWrap($Left_Margin+110,$YPos,70,$FontSize,locale_money_format($Balance['0'],$_SESSION['CompanyRecord']['decimalplaces'])); $LeftOvers = $pdf->addTextWrap($Left_Margin+150,$YPos,70,$FontSize,$Tabs['currency']); $YPos -= (2 * $line_height); @@ -191,7 +191,7 @@ // Print total for each account $LeftOvers = $pdf->addTextWrap($Left_Margin,$YPos,70,$FontSize,ConvertSQLDate($myrow['date'])); $LeftOvers = $pdf->addTextWrap($Left_Margin+70,$YPos,130,$FontSize,$Description[0]); - $LeftOvers = $pdf->addTextWrap($Left_Margin+180,$YPos,50,$FontSize,locale_number_format($myrow['amount'],2),'right'); + $LeftOvers = $pdf->addTextWrap($Left_Margin+180,$YPos,50,$FontSize,locale_money_format($myrow['amount'],$_SESSION['CompanyRecord']['decimalplaces']),'right'); $LeftOvers = $pdf->addTextWrap($Left_Margin+250,$YPos,100,$FontSize,$myrow['notes']); $LeftOvers = $pdf->addTextWrap($Left_Margin+350,$YPos,70,$FontSize,$myrow['receipt']); $LeftOvers = $pdf->addTextWrap($Left_Margin+430,$YPos,70,$FontSize,ConvertSQLDate($myrow['authorized'])); @@ -216,7 +216,7 @@ $LeftOvers = $pdf->addTextWrap($Left_Margin+70,$YPos,100,$FontSize,_('Balance at')); $LeftOvers = $pdf->addTextWrap($Left_Margin+110,$YPos,70,$FontSize,$_POST['ToDate']); $LeftOvers = $pdf->addTextWrap($Left_Margin+160,$YPos,20,$FontSize,_(': ')); - $LeftOvers = $pdf->addTextWrap($Left_Margin+160,$YPos,70,$FontSize,locale_number_format($Amount[0],2),'right'); + $LeftOvers = $pdf->addTextWrap($Left_Margin+160,$YPos,70,$FontSize,locale_money_format($Amount[0],$_SESSION['CompanyRecord']['decimalplaces']),'right'); $LeftOvers = $pdf->addTextWrap($Left_Margin+240,$YPos,70,$FontSize,$Tabs['currency']); $pdf->line($Page_Width-$Right_Margin, $YPos+$line_height,$Left_Margin, $YPos+$line_height); @@ -282,7 +282,7 @@ echo '<tr><td>' . _('Balance before ') . ''.$_POST['FromDate'].'</td> <td>:</td> - <td>' . ''.$Balance['0'].' '.$Tabs['currency'].'</td> + <td>' . locale_money_format($Balance['0'],$_SESSION['CompanyRecord']['decimalplaces']).' '.$Tabs['currency'].'</td> </tr>'; $SqlBalanceNotAut = "SELECT SUM(amount) @@ -299,7 +299,7 @@ $BalanceNotAut['0']=0; } - echo '<tr><td>' . _('Total not authorised before ') . ''.$_POST['FromDate'].'</td><td>:</td><td>' . ''.$BalanceNotAut['0'].' '.$Tabs['currency'].'</td></tr>'; + echo '<tr><td>' . _('Total not authorised before ') . ''.$_POST['FromDate'].'</td><td>:</td><td>' . ''.locale_money_format($BalanceNotAut['0'],$_SESSION['CompanyRecord']['decimalplaces']) . ' ' . $Tabs['currency'].'</td></tr>'; echo '</table>'; @@ -362,7 +362,7 @@ </tr>", ConvertSQLDate($myrow['2']), $Description['0'], - locale_number_format($myrow['4'],2), + locale_money_format($myrow['4'],$_SESSION['CompanyRecord']['decimalplaces']), $myrow['7'], $myrow['8'], ConvertSQLDate($myrow['5'])); @@ -376,7 +376,7 @@ </tr>", ConvertSQLDate($myrow['2']), $Description['0'], - locale_number_format($myrow['4'],2), + locale_money_format($myrow['4'],$_SESSION['CompanyRecord']['decimalplaces']), $myrow['7'], $myrow['8'], ' '); @@ -397,7 +397,7 @@ } echo '<tr><td colspan=2 style=text-align:right >' . _('Balance At') . ' '.$_POST['ToDate'].':</td> - <td>'.locale_number_format($Amount[0],2).' </td><td>'.$Tabs['currency'].'</td></tr>'; + <td>'.locale_money_format($Amount[0],$_SESSION['CompanyRecord']['decimalplaces']).' </td><td>'.$Tabs['currency'].'</td></tr>'; echo '</table>'; echo '<br /><div class="centre"><input type="submit" name="SelectDifferentDate" value="' . _('Select A Different Date') . '"></div>'; Modified: trunk/PcTabs.php =================================================================== --- trunk/PcTabs.php 2011-09-11 04:06:48 UTC (rev 4685) +++ trunk/PcTabs.php 2011-09-12 08:03:20 UTC (rev 4686) @@ -92,7 +92,7 @@ $sql = "UPDATE pctabs SET usercode = '" . $_POST['SelectUser'] . "', typetabcode = '" . $_POST['SelectTabs'] . "', currency = '" . $_POST['SelectCurrency'] . "', - tablimit = '" . $_POST['TabLimit'] . "', + tablimit = '" . filter_number_format($_POST['TabLimit']) . "', assigner = '" . $_POST['SelectAssigner'] . "', authorizer = '" . $_POST['SelectAuthoriser'] . "', glaccountassignment = '" . $_POST['GLAccountCash'] . "', @@ -131,12 +131,12 @@ '" . $_POST['SelectUser'] . "', '" . $_POST['SelectTabs'] . "', '" . $_POST['SelectCurrency'] . "', - '" . $_POST['TabLimit'] . "', + '" . filter_number_format($_POST['TabLimit']) . "', '" . $_POST['SelectAssigner'] . "', '" . $_POST['SelectAuthoriser'] . "', '" . $_POST['GLAccountCash'] . "', '" . $_POST['GLAccountPcashTab'] . "')"; - + $msg = _('The Petty Cash Tab') . ' ' . $_POST['tabcode'] . ' ' . _('has been created'); } @@ -187,9 +187,9 @@ currencies.decimalplaces, chartmaster1.accountname AS glactassigntname, chartmaster2.accountname AS glactpcashname - FROM pctabs INNER JOIN currencies - ON pctabs.currency=currencies.currabrev - INNER JOIN pctypetabs + FROM pctabs INNER JOIN currencies + ON pctabs.currency=currencies.currabrev + INNER JOIN pctypetabs ON pctabs.typetabcode=pctypetabs.typetabcode INNER JOIN chartmaster AS chartmaster1 ON pctabs.glaccountassignment = chartmaster1.accountcode @@ -210,9 +210,9 @@ <th>' . _('GL Account For Cash Assignment') . '</th> <th>' . _('GL Account Petty Cash Tab') . '</th> </tr>'; - + $k=0; //row colour counter - + while ($myrow = DB_fetch_array($result)) { if ($k==1){ echo '<tr class="EvenTableRows">'; @@ -221,7 +221,7 @@ echo '<tr class="OddTableRows">'; $k=1; } - + printf('<td>%s</td> <td>%s</td> <td>%s</td> @@ -329,7 +329,7 @@ DB_free_result($result); $SQL = "SELECT typetabcode, typetabdescription - FROM pctypetabs + FROM pctypetabs ORDER BY typetabcode"; $result = DB_query($SQL,$db); @@ -420,7 +420,7 @@ <td><select name="GLAccountCash">'; DB_free_result($result); - $SQL = "SELECT chartmaster.accountcode, + $SQL = "SELECT chartmaster.accountcode, chartmaster.accountname FROM chartmaster INNER JOIN bankaccounts ON chartmaster.accountcode = bankaccounts.accountcode @@ -463,7 +463,7 @@ echo '</select></td></tr>'; 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/StockLocTransferReceive.php =================================================================== --- trunk/StockLocTransferReceive.php 2011-09-11 04:06:48 UTC (rev 4685) +++ trunk/StockLocTransferReceive.php 2011-09-12 08:03:20 UTC (rev 4686) @@ -4,8 +4,6 @@ include('includes/DefineSerialItems.php'); include('includes/DefineStockTransfers.php'); -//$PageSecurity = 11; - include('includes/session.inc'); $title = _('Inventory Transfer') . ' - ' . _('Receiving'); include('includes/header.inc'); @@ -29,14 +27,14 @@ $i=0; $TotalQuantity = 0; foreach ($_SESSION['Transfer']->TransferItem AS $TrfLine) { - if (is_numeric($_POST['Qty' . $i])){ + if (is_numeric(filter_number_format($_POST['Qty' . $i]))){ /*Update the quantity received from the inputs */ - $_SESSION['Transfer']->TransferItem[$i]->Quantity= $_POST['Qty' . $i]; + $_SESSION['Transfer']->TransferItem[$i]->Quantity= filter_number_format($_POST['Qty' . $i]); } else { prnMsg(_('The quantity entered for'). ' ' . $TrfLine->StockID . ' '. _('is not numeric') . '. ' . _('All quantities must be numeric'),'error'); $InputError = True; } - if ($_POST['Qty' . $i]<0){ + if (filter_number_format($_POST['Qty' . $i])<0){ prnMsg(_('The quantity entered for'). ' ' . $TrfLine->StockID . ' '. _('is negative') . '. ' . _('All quantities must be for positive numbers greater than zero'),'error'); $InputError = True; } @@ -44,12 +42,12 @@ prnMsg( _('The Quantity entered plus the Quantity Previously Received can not be greater than the Total Quantity shipped for').' '. $TrfLine->StockID , 'error'); $InputError = True; } - if (isset($_POST['CancelBalance' . $i]) and $_POST['CancelBalance' . $i]==1){ - $_SESSION['Transfer']->TransferItem[$i]->CancelBalance=1; - } else { - $_SESSION['Transfer']->TransferItem[$i]->CancelBalance=0; - } - $TotalQuantity += $TrfLine->Quantity; + if (isset($_POST['CancelBalance' . $i]) and $_POST['CancelBalance' . $i]==1){ + $_SESSION['Transfer']->TransferItem[$i]->CancelBalance=1; + } else { + $_SESSION['Transfer']->TransferItem[$i]->CancelBalance=0; + } + $TotalQuantity += filter_number_format($TrfLine->Quantity); $i++; } /*end loop to validate and update the SESSION['Transfer'] data */ if ($TotalQuantity < 0){ @@ -80,16 +78,15 @@ } /* Insert the stock movement for the stock going out of the from location */ - $SQL = "INSERT INTO stockmoves ( - stockid, - type, - transno, - loccode, - trandate, - prd, - reference, - qty, - newqoh) + $SQL = "INSERT INTO stockmoves (stockid, + type, + transno, + loccode, + trandate, + prd, + reference, + qty, + newqoh) VALUES ( '" . $TrfLine->StockID . "', 16, @@ -98,8 +95,8 @@ '" . $SQLTransferDate . "', '" . $PeriodNo . "', '" . _('To') . ' ' . $_SESSION['Transfer']->StockLocationToName . "', - '" . round(-$TrfLine->Quantity, $TrfLine->DecimalPlaces) . "', - '" . round($QtyOnHandPrior - $TrfLine->Quantity, $TrfLine->DecimalPlaces) . "' + '" . filter_number_format(round(-$TrfLine->Quantity, $TrfLine->DecimalPlaces)) . "', + '" . filter_number_format(round($QtyOnHandPrior - $TrfLine->Quantity, $TrfLine->DecimalPlaces)) . "' )"; $ErrMsg = _('CRITICAL ERROR') . '! ' . _('NOTE DOWN THIS ERROR AND SEEK ASSISTANCE') . ': ' . _('The stock movement record cannot be inserted because'); @@ -122,7 +119,7 @@ WHERE stockid='" . $TrfLine->StockID . "' AND loccode='" . $_SESSION['Transfer']->StockLocationFrom . "' - AND serialno='" . $Item->BundleRef . "'"; + AND serialno='" . DB_escape_string($Item->BundleRef) . "'"; $Result = DB_query($SQL,$db,'<br />' . _('Could not determine if the serial item exists') ); $SerialItemExistsRow = DB_fetch_row($Result); @@ -130,11 +127,11 @@ if ($SerialItemExistsRow[0]==1){ $SQL = "UPDATE stockserialitems SET - quantity= quantity - " . $Item->BundleQty . " + quantity= quantity - " . filter_number_format($Item->BundleQty) . " WHERE stockid='" . $TrfLine->StockID . "' AND loccode='" . $_SESSION['Transfer']->StockLocationFrom . "' - 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'); @@ -147,8 +144,8 @@ quantity) VALUES ('" . $TrfLine->StockID . "', '" . $_SESSION['Transfer']->StockLocationFrom . "', - '" . $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 item for the stock being transferred out of the existing location could not be inserted because'); $DbgMsg = _('The following SQL to update the serial stock item record was used'); @@ -166,8 +163,8 @@ ) VALUES ( '" . $StkMoveNo . "', '" . $TrfLine->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'); @@ -179,9 +176,9 @@ /* Need to get the current location quantity will need it later for the stock movement */ $SQL="SELECT locstock.quantity - FROM locstock - WHERE locstock.stockid='" . $TrfLine->StockID . "' - AND loccode= '" . $_SESSION['Transfer']->StockLocationTo . "'"; + FROM locstock + WHERE locstock.stockid='" . $TrfLine->StockID . "' + AND loccode= '" . $_SESSION['Transfer']->StockLocationTo . "'"; $Result = DB_query($SQL, $db, _('Could not retrieve the quantity on hand at the location being transferred to') ); if (DB_num_rows($Result)==1){ @@ -193,16 +190,15 @@ } // Insert the stock movement for the stock coming into the to location - $SQL = "INSERT INTO stockmoves ( - stockid, - type, - transno, - loccode, - trandate, - prd, - reference, - qty, - newqoh) + $SQL = "INSERT INTO stockmoves (stockid, + type, + transno, + loccode, + trandate, + prd, + reference, + qty, + newqoh) VALUES ( '" . $TrfLine->StockID . "', 16, @@ -211,8 +207,8 @@ '" . $SQLTransferDate . "', '" . $PeriodNo . "', '" . _('From') . ' ' . $_SESSION['Transfer']->StockLocationFromName ."', - '" . round($TrfLine->Quantity, $TrfLine->DecimalPlaces) . "', - '" . round($QtyOnHandPrior + $TrfLine->Quantity, $TrfLine->DecimalPlaces) . "' + '" . filter_number_format(round($TrfLine->Quantity, $TrfLine->DecimalPlaces)) . "', + '" . filter_number_format(round($QtyOnHandPrior + $TrfLine->Quantity, $TrfLine->DecimalPlaces)) . "' )"; $ErrMsg = _('CRITICAL ERROR') . '! ' . _('NOTE DOWN THIS ERROR AND SEEK ASSISTANCE') . ': ' . _('The stock movement record for the incoming stock cannot be added because'); @@ -236,7 +232,7 @@ WHERE stockid='" . $TrfLine->StockID . "' AND loccode='" . $_SESSION['Transfer']->StockLocationTo . "' - AND serialno='" . $Item->BundleRef . "'"; + AND serialno='" . DB_escape_string($Item->BundleRef) . "'"; $Result = DB_query($SQL,$db,'<br />'. _('Could not determine if the serial item exists') ); $SerialItemExistsRow = DB_fetch_row($Result); @@ -245,11 +241,11 @@ if ($SerialItemExistsRow[0]==1){ $SQL = "UPDATE stockserialitems SET - quantity= quantity + '" . $Item->BundleQty . "' + quantity= quantity + '" . filter_number_format($Item->BundleQty) . "' WHERE stockid='" . $TrfLine->StockID . "' AND loccode='" . $_SESSION['Transfer']->StockLocationTo . "' - 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 for the quantity coming in because'); $DbgMsg = _('The following SQL to update the serial stock item record was used'); @@ -262,8 +258,8 @@ quantity) VALUES ('" . $TrfLine->StockID . "', '" . $_SESSION['Transfer']->StockLocationTo . "', - '" . $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 item record for the stock coming in could not be added because'); $DbgMsg = _('The following SQL to update the serial stock item record was used'); @@ -280,8 +276,8 @@ moveqty) VALUES (" . $StkMoveNo . ", '" . $TrfLine->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'); $Result = DB_query($SQL, $db, $ErrMsg, $DbgMsg, true); @@ -290,7 +286,7 @@ } /*end if the transfer item is a controlled item */ $SQL = "UPDATE locstock - SET quantity = quantity - '" . round($TrfLine->Quantity, $TrfLine->DecimalPlaces) . "' + SET quantity = quantity - '" . filter_number_format(round($TrfLine->Quantity, $TrfLine->DecimalPlaces)) . "' WHERE stockid='" . $TrfLine->StockID . "' AND loccode='" . $_SESSION['Transfer']->StockLocationFrom . "'"; @@ -299,7 +295,7 @@ $Result = DB_query($SQL, $db, $ErrMsg, $DbgMsg, true); $SQL = "UPDATE locstock - SET quantity = quantity + '" . round($TrfLine->Quantity, $TrfLine->DecimalPlaces) . "' + SET quantity = quantity + '" . filter_number_format(round($TrfLine->Quantity, $TrfLine->DecimalPlaces)) . "' WHERE stockid='" . $TrfLine->StockID . "' AND loccode='" . $_SESSION['Transfer']->StockLocationTo . "'"; @@ -310,13 +306,13 @@ prnMsg(_('A stock transfer for item code'). ' - ' . $TrfLine->StockID . ' ' . $TrfLine->ItemDescription . ' '. _('has been created from').' ' . $_SESSION['Transfer']->StockLocationFromName . ' '. _('to'). ' ' . $_SESSION['Transfer']->StockLocationToName . ' ' . _('for a quantity of'). ' '. $TrfLine->Quantity,'success'); if ($TrfLine->CancelBalance==1){ - $sql = "UPDATE loctransfers SET recqty = recqty + '". round($TrfLine->Quantity, $TrfLine->DecimalPlaces) . "', - shipqty = recqty + '". round($TrfLine->Quantity, $TrfLine->DecimalPlaces) . "', + $sql = "UPDATE loctransfers SET recqty = recqty + '". filter_number_format(round($TrfLine->Quantity, $TrfLine->DecimalPlaces)) . "', + shipqty = recqty + '". filter_number_format(round($TrfLine->Quantity, $TrfLine->DecimalPlaces)) . "', recdate = '".date('Y-m-d H:i:s'). "' WHERE reference = '". $_SESSION['Transfer']->TrfID . "' AND stockid = '". $TrfLine->StockID."'"; } else { - $sql = "UPDATE loctransfers SET recqty = recqty + '". round($TrfLine->Quantity, $TrfLine->DecimalPlaces) . "', + $sql = "UPDATE loctransfers SET recqty = recqty + '". filter_number_format(round($TrfLine->Quantity, $TrfLine->DecimalPlaces)) . "', recdate = '".date('Y-m-d H:i:s'). "' WHERE reference = '". $_SESSION['Transfer']->TrfID . "' AND stockid = '". $TrfLine->StockID."'"; @@ -350,25 +346,25 @@ unset($_SESSION['Transfer']); $sql = "SELECT loctransfers.stockid, - stockmaster.description, - stockmaster.units, - stockmaster.controlled, - stockmaster.serialised, - stockmaster.perishable, - stockmaster.decimalplaces, - loctransfers.shipqty, - loctransfers.recqty, - locations.locationname as shiplocationname, - reclocations.locationname as reclocationname, - loctransfers.shiploc, - loctransfers.recloc - FROM loctransfers INNER JOIN locations - ON loctransfers.shiploc=locations.loccode - INNER JOIN locations as reclocations - ON loctransfers.recloc = reclocations.loccode - INNER JOIN stockmaster - ON loctransfers.stockid=stockmaster.stockid - WHERE reference ='" . $_GET['Trf_ID'] . "' ORDER BY loctransfers.stockid"; + stockmaster.description, + stockmaster.units, + stockmaster.controlled, + stockmaster.serialised, + stockmaster.perishable, + stockmaster.decimalplaces, + loctransfers.shipqty, + loctransfers.recqty, + locations.locationname as shiplocationname, + reclocations.locationname as reclocationname, + loctransfers.shiploc, + loctransfers.recloc + FROM loctransfers INNER JOIN locations + ON loctransfers.shiploc=locations.loccode + INNER JOIN locations as reclocations + ON loctransfers.recloc = reclocations.loccode + INNER JOIN stockmaster + ON loctransfers.stockid=stockmaster.stockid + WHERE reference ='" . $_GET['Trf_ID'] . "' ORDER BY loctransfers.stockid"; $ErrMsg = _('The details of transfer number') . ' ' . $_GET['Trf_ID'] . ' ' . _('could not be retrieved because') .' '; @@ -384,24 +380,22 @@ $myrow=DB_fetch_array($result); $_SESSION['Transfer']= new StockTransfer($_GET['Trf_ID'], - $myrow['shiploc'], - $myrow['shiplocationname'], - $myrow['recloc'], - $myrow['reclocationname'], - Date($_SESSION['DefaultDateFormat']) - ); + $myrow['shiploc'], + $myrow['shiplocationname'], + $myrow['recloc'], + $myrow['reclocationname'], + Date($_SESSION['DefaultDateFormat']) ); /*Populate the StockTransfer TransferItem s array with the lines to be transferred */ $i = 0; do { $_SESSION['Transfer']->TransferItem[$i]= new LineItem ($myrow['stockid'], - $myrow['description'], - $myrow['shipqty'], - $myrow['units'], - $myrow['controlled'], - $myrow['serialised'], - $myrow['perishable'], - $myrow['decimalplaces'] - ); + $myrow['description'], + $myrow['shipqty'], + $myrow['units'], + $myrow['controlled'], + $myrow['serialised'], + $myrow['perishable'], + $myrow['decimalplaces'] ); $_SESSION['Transfer']->TransferItem[$i]->PrevRecvQty = $myrow['recqty']; $_SESSION['Transfer']->TransferItem[$i]->Quantity = $myrow['shipqty']-$myrow['recqty']; @@ -423,10 +417,9 @@ $i = 0; //Line Item Array pointer - echo "<br /><table class=selection>"; - echo '<tr><th colspan=7><font size=3 color=blue>' . _('Location Transfer Reference'). ' #' . $_SESSION['Transfer']->TrfID . - ' '. _('from').' ' . $_SESSION['Transfer']->StockLocationFromName . ' '. _('to'). ' ' . - $_SESSION['Transfer']->StockLocationToName . '</font></th></tr>'; + echo '<br /> + <table class="selection">'; + echo '<tr><th colspan="7"><font size=3 color=blue>' . _('Location Transfer Reference'). ' #' . $_SESSION['Transfer']->TrfID . ' '. _('from').' ' . $_SESSION['Transfer']->StockLocationFromName . ' '. _('to'). ' ' . $_SESSION['Transfer']->StockLocationToName . '</font></th></tr>'; $tableheader = '<tr> <th>'. _('Item Code') . '</th> @@ -453,24 +446,24 @@ <td>' . $TrfLine->ItemDescription . '</td>'; echo '<td class=number>' . locale_number_format($TrfLine->ShipQty, $TrfLine->DecimalPlaces) . '</td>'; - if (isset($_POST['Qty' . $i]) and is_numeric($_POST['Qty' . $i])){ - $_SESSION['Transfer']->TransferItem[$i]->Quantity= $_POST['Qty' . $i]; - $Qty = $_POST['Qty' . $i]; + if (isset($_POST['Qty' . $i]) AND is_numeric(filter_number_format($_POST['Qty' . $i]))){ + $_SESSION['Transfer']->TransferItem[$i]->Quantity= filter_number_format($_POST['Qty' . $i]); + $Qty = filter_number_format($_POST['Qty' . $i]); } else if ($TrfLine->Controlled==1) { if (sizeOf($TrfLine->SerialItems)==0) { $Qty = 0; } else { - $Qty = $TrfLine->Quantity; + $Qty = filter_number_format($TrfLine->Quantity); } } else { - $Qty = $TrfLine->Quantity; + $Qty = filter_number_format($TrfLine->Quantity); } echo '<td class=number>' . locale_number_format($TrfLine->PrevRecvQty, $TrfLine->DecimalPlaces) . '</td>'; if ($TrfLine->Controlled==1){ - echo '<td class=number><input type=hidden name="Qty' . $i . '" VALUE="' . $Qty . '"><a href="' . $rootpath .'/StockTransferControlled.php?' . SID . '&TransferItem=' . $i . '">' . $Qty . '</a></td>'; + echo '<td class=number><input type=hidden name="Qty' . $i . '" value="' . $Qty . '"><a href="' . $rootpath .'/StockTransferControlled.php?TransferItem=' . $i . '">' . $Qty . '</a></td>'; } else { - echo '<td><input type="text" class="number" name="Qty' . $i . '" maxlength=10 class="number" size=auto VALUE="' . $Qty . '"></td>'; + echo '<td><input type="text" class="number" name="Qty' . $i . '" maxlength=10 class="number" size=auto value="' . $Qty . '"></td>'; } echo '<td>' . $TrfLine->PartUnit . '</td>'; @@ -480,9 +473,9 @@ if ($TrfLine->Controlled==1){ if ($TrfLine->Serialised==1){ - echo '<td><a href="' . $rootpath .'/StockTransferControlled.php?' . SID . '&TransferItem=' . $i . '">' . _('Enter Serial Numbers') . '</a></td>'; + echo '<td><a href="' . $rootpath .'/StockTransferControlled.php?TransferItem=' . $i . '">' . _('Enter Serial Numbers') . '</a></td>'; } else { - echo '<td><a href="' . $rootpath .'/StockTransferControlled.php?' . SID . '&TransferItem=' . $i . '">' . _('Enter Batch Refs') . '</a></td>'; + echo '<td><a href="' . $rootpath .'/StockTransferControlled.php?TransferItem=' . $i . '">' . _('Enter Batch Refs') . '</a></td>'; } } @@ -492,34 +485,33 @@ } /*end of foreach TransferItem */ echo '</table><br /> - <div class="centre"><input type=submit name="ProcessTransfer" VALUE="'. _('Process Inventory Transfer'). '"><bR /> + <div class="centre"><input type="submit" name="ProcessTransfer" value="'. _('Process Inventory Transfer'). '"><br /> </form></div>'; - echo '<a href="'.$_SERVER['PHP_SELF']. '?' . SID . '&NewTransfer=true">'. _('Select A Different Trans... [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, + 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(); + ?> \ No newline at end of file Modified: trunk/PDFPickingList.php =================================================================== --- trunk/PDFPickingList.php 2011-09-12 23:37:53 UTC (rev 4688) +++ trunk/PDFPickingList.php 2011-09-14 08:06:45 UTC (rev 4689) @@ -21,9 +21,9 @@ if ((!isset($_GET['TransNo']) or $_GET['TransNo']=="") and !isset($_POST['TransDate'])){ $title = _('Select Picking Lists'); include('includes/header.inc'); - $sql='SELECT loccode, + $sql="SELECT loccode, locationname - FROM locations'; + FROM locations"; $result=DB_query($sql, $db); echo '<p class="page_title_text"><img src="'.$rootpath.'/css/'.$theme.'/images/sales.png" title="' . _('Search') . '" alt="" />' . ' ' . $title.'</p><br />'; echo '<form action="' . $_SERVER['PHP_SELF'] . '" method="post" name="form">'; @@ -49,78 +49,78 @@ if (!isset($_POST['TransDate']) and $_GET['TransNo'] != 'Preview') { /* If there is no transaction date set, then it must be for a single order */ $sql = "SELECT salesorders.debtorno, - salesorders.orderno, - salesorders.customerref, - salesorders.comments, - salesorders.orddate, - salesorders.deliverto, - salesorders.deladd1, - salesorders.deladd2, - salesorders.deladd3, - salesorders.deladd4, - salesorders.deladd5, - salesorders.deladd6, - salesorders.deliverblind, - salesorders.deliverydate, - debtorsmaster.name, - debtorsmaster.address1, - debtorsmaster.address2, - debtorsmaster.address3, - debtorsmaster.address4, - debtorsmaster.address5, - debtorsmaster.address6, - shippers.shippername, - salesorders.printedpackingslip, - salesorders.datepackingslipprinted, - locations.locationname - FROM salesorders, - debtorsmaster, - shippers, - locations - WHERE salesorders.debtorno=debtorsmaster.debtorno - AND salesorders.shipvia=shippers.shipper_id - AND salesorders.fromstkloc=locations.loccode - AND salesorders.orderno='" . $_GET['TransNo']."'"; -} else if (isset($_POST['TransDate']) + salesorders.orderno, + salesorders.customerref, + salesorders.comments, + salesorders.orddate, + salesorders.deliverto, + salesorders.deladd1, + salesorders.deladd2, + salesorders.deladd3, + salesorders.deladd4, + salesorders.deladd5, + salesorders.deladd6, + salesorders.deliverblind, + salesorders.deliverydate, + debtorsmaster.name, + debtorsmaster.address1, + debtorsmaster.address2, + debtorsmaster.address3, + debtorsmaster.address4, + debtorsmaster.address5, + debtorsmaster.address6, + shippers.shippername, + salesorders.printedpackingslip, + salesorders.datepackingslipprinted, + locations.locationname + FROM salesorders, + debtorsmaster, + shippers, + locations + WHERE salesorders.debtorno=debtorsmaster.debtorno + AND salesorders.shipvia=shippers.shipper_id + AND salesorders.fromstkloc=locations.loccode + AND salesorders.orderno='" . filter_number_format($_GET['TransNo'])."'"; +} else if (isset($_POST['TransDate']) OR (isset($_GET['TransNo']) AND $_GET['TransNo'] != 'Preview')) { /* We are printing picking lists for all orders on a day */ $sql = "SELECT salesorders.debtorno, - salesorders.orderno, - salesorders.customerref, - salesorders.comments, - salesorders.orddate, - salesorders.deliverto, - salesorders.deladd1, - salesorders.deladd2, - salesorders.deladd3, - salesorders.deladd4, - salesorders.deladd5, - salesorders.deladd6, - salesorders.deliverblind, - salesorders.deliverydate, - debtorsmaster.name, - debtorsmaster.address1, - debtorsmaster.address2, - debtorsmaster.address3, - debtorsmaster.address4, - debtorsmaster.address5, - debtorsmaster.address6, - shippers.shippername, - salesorders.printedpackingslip, - salesorders.datepackingslipprinted, - locations.locationname - FROM salesorders, - debtorsmaster, - shippers, - locations - WHERE salesorders.debtorno=debtorsmaster.debtorno - AND salesorders.shipvia=shippers.shipper_id - AND salesorders.fromstkloc=locations.loccode - AND salesorders.fromstkloc='".$_POST['loccode']."' - AND salesorders.deliverydate='" . FormatDateForSQL($_POST['TransDate'])."'"; + salesorders.orderno, + salesorders.customerref, + salesorders.comments, + salesorders.orddate, + salesorders.deliverto, + salesorders.deladd1, + salesorders.deladd2, + salesorders.deladd3, + salesorders.deladd4, + salesorders.deladd5, + salesorders.deladd6, + salesorders.deliverblind, + salesorders.deliverydate, + debtorsmaster.name, + debtorsmaster.address1, + debtorsmaster.address2, + debtorsmaster.address3, + debtorsmaster.address4, + debtorsmaster.address5, + debtorsmaster.address6, + shippers.shippername, + salesorders.printedpackingslip, + salesorders.datepackingslipprinted, + locations.locationname + FROM salesorders, + debtorsmaster, + shippers, + locations + WHERE salesorders.debtorno=debtorsmaster.debtorno + AND salesorders.shipvia=shippers.shipper_id + AND salesorders.fromstkloc=locations.loccode + AND salesorders.fromstkloc='".$_POST['loccode']."' + AND salesorders.deliverydate='" . FormatDateForSQL($_POST['TransDate'])."'"; } -if (isset($_POST['TransDate']) +if (isset($_POST['TransDate']) OR (isset($_GET['TransNo']) AND $_GET['TransNo'] != 'Preview')) { $result=DB_query($sql,$db, $ErrMsg); @@ -185,7 +185,7 @@ $pdf->addInfo('Title', _('Picking List') ); $pdf->addInfo('Subject', _('Laser Picking List') ); $FontSize=12; -$ListCount = 0; +$ListCount = 0; $Copy=''; $line_height=$FormDesign->LineHeight; @@ -207,44 +207,46 @@ /* Are there any picking lists for this order already */ $sql="SELECT COUNT(orderno) FROM pickinglists - WHERE orderno='" . $OrdersToPick[$i]['orderno'] . "'"; + WHERE orderno='" . filter_number_format($OrdersToPick[$i]['orderno']) . "'"; $countresult=DB_query($sql, $db); $count=DB_fetch_row($countresult); if ($count[0]==0) { /* There are no previous picking lists for this order */ $sql = "SELECT salesorderdetails.stkcode, - stockmaster.description, - salesorderdetails.orderlineno, - salesorderdetails.quantity, - salesorderdetails.qtyinvoiced, - salesorderdetails.unitprice, - salesorderdetails.narrative - FROM salesorderdetails - INNER JOIN stockmaster - ON salesorderdetails.stkcode=stockmaster.stockid - WHERE salesorderdetails.orderno='" . $OrdersToPick[$i]['orderno'] ."'"; + stockmaster.description, + salesorderdetails.orderlineno, + salesorderdetails.quantity, + salesorderdetails.qtyinvoiced, + salesorderdetails.unitprice, + salesorderdetails.narrative, + stockmaster.decimalplaces + FROM salesorderdetails + INNER JOIN stockmaster + ON salesorderdetails.stkcode=stockmaster.stockid + WHERE salesorderdetails.orderno='" . filer_number_format($OrdersToPick[$i]['orderno']) ."'"; } else { /* There are previous picking lists for this order so * need to take those quantities into account */ $sql = "SELECT salesorderdetails.stkcode, - stockmaster.description, - salesorderdetails.orderlineno, - salesorderdetails.quantity, - salesorderdetails.qtyinvoiced, - SUM(pickinglistdetails.qtyexpected) as qtyexpected, - SUM(pickinglistdetails.qtypicked) as qtypicked, - salesorderdetails.unitprice, - salesorderdetails.narrative - FROM salesorderdetails - INNER JOIN stockmaster - ON salesorderdetails.stkcode=stockmaster.stockid - LEFT JOIN pickinglists - ON salesorderdetails.orderno=pickinglists.orderno - LEFT JOIN pickinglistdetails - ON pickinglists.pickinglistno=pickinglistdetails.pickinglistno - WHERE salesorderdetails.orderno='" . $OrdersToPick[$i]['orderno'] ."' - AND salesorderdetails.orderlineno=pickinglistdetails.orderlineno"; + stockmaster.description, + salesorderdetails.orderlineno, + salesorderdetails.quantity, + salesorderdetails.qtyinvoiced, + SUM(pickinglistdetails.qtyexpected) as qtyexpected, + SUM(pickinglistdetails.qtypicked) as qtypicked, + salesorderdetails.unitprice, + salesorderdetails.narrative, + stockmaster.decimalplaces + FROM salesorderdetails + INNER JOIN stockmaster + ON salesorderdetails.stkcode=stockmaster.stockid + LEFT JOIN pickinglists + ON salesorderdetails.orderno=pickinglists.orderno + LEFT JOIN pickinglistdetails + ON pickinglists.pickinglistno=pickinglistdetails.pickinglistno + WHERE salesorderdetails.orderno='" . filter_number_format($OrdersToPick[$i]['orderno']) ."' + AND salesorderdetails.orderlineno=pickinglistdetails.orderlineno"; } $lineresult=DB_query($sql,$db, $ErrMsg); } @@ -258,7 +260,7 @@ $sql="INSERT INTO pickinglists VALUES ( '" . $PickingListNo ."', - '" . $OrdersToPick[$i]['orderno']."', + '" . filter_number_format($OrdersToPick[$i]['orderno'])."', '" . FormatDateForSQL($_POST['TransDate'])."', '" . date('Y-m-d')."', '0000-00-00')"; @@ -284,16 +286,16 @@ $myrow2['qtyexpected']=0; $myrow2['qtypicked']=0; } - $DisplayQty = locale_number_format($myrow2['quantity'],2); - $DisplayPrevDel = locale_number_format($myrow2['qtyinvoiced'],2); - $DisplayQtySupplied = locale_number_format($myrow2['quantity'] - $myrow2['qtyinvoiced']-$myrow2['qtyexpected']-$myrow2['qtypicked'],2); + $DisplayQty = locale_number_format($myrow2['quantity'],$myrow2['decimalplaces']); + $DisplayPrevDel = locale_number_format($myrow2['qtyinvoiced'],$myrow2['decimalplaces']); + $DisplayQtySupplied = locale_number_format(filer_number_format($myrow2['quantity'] - $myrow2['qtyinvoiced']-$myrow2['qtyexpected']-$myrow2['qtypicked']),$myrow2['decimalplaces']); $itemdesc = $myrow2['description'] . ' - ' . $myrow2['narrative']; $sql="INSERT INTO pickinglistdetails VALUES( '" . $PickingListNo ."', '" . $Lines."', '" . $myrow2['orderlineno']."', - '" . $DisplayQtySupplied."', + '" . filter_number_format($DisplayQtySupplied) ."', 0)"; $lineresult=DB_query($sql, $db); } @@ -327,6 +329,6 @@ exit; } else { $pdf->OutputD($_SESSION['DatabaseName'] . '_PickingLists_' . date('Y-m-d') . '.pdf'); - $pdf->__destruct(); + $pdf->__destruct(); } ?> \ No newline at end of file Modified: trunk/PDFPriceList.php =================================================================== --- trunk/PDFPriceList.php 2011-09-12 23:37:53 UTC (rev 4688) +++ trunk/PDFPriceList.php 2011-09-14 08:06:45 UTC (rev 4689) @@ -1,7 +1,6 @@ <?php -/* $Revision: 1.14 $ */ +/* $Id$*/ -//$PageSecurity = 2; include('includes/session.inc'); If (isset($_POST['PrintPDF']) @@ -27,7 +26,7 @@ include('includes/header.inc'); echo '<br />'; prnMsg( _('The customer must first be selected from the select customer link') . '. ' . _('Re-run the price list once the customer has been selected') ); - echo '<br /><br /><a href="' . $_SERVER['PHP_SELF'] . '?' . SID . '">' . _('Back') . '</a>'; + echo '<br /><br /><a href="' . $_SERVER['PHP_SELF'] . '">' . _('Back') . '</a>'; include('includes/footer.inc'); exit; } @@ -35,7 +34,7 @@ $title = _('Special price List - No Customer Selected'); include('includes/header.inc'); prnMsg(_('The effective date must be entered in the format') . ' ' . $_SESSION['DefaultDateFormat'],'error'); - echo '<br /><br /><a href="' . $_SERVER['PHP_SELF'] . '?' . SID . '">' . _('Back') . '</a>'; + echo '<br /><br /><a href="' . $_SERVER['PHP_SELF'] . '">' . _('Back') . '</a>'; include('includes/footer.inc'); exit; } @@ -50,32 +49,35 @@ $SalesType = $CustNameRow[1]; $SQL = "SELECT prices.typeabbrev, - prices.stockid, - stockmaster.description, - stockmaster.longdescription, - prices.currabrev, - prices.startdate, - prices.enddate, - prices.price, - stockmaster.materialcost+stockmaster.labourcost+stockmaster.overheadcost AS standardcost, - stockmaster.categoryid, - stockcategory.categorydescription, - prices.debtorno, - prices.branchcode, - custbranch.brname - FROM stockmaster, - stockcategory, - prices LEFT JOIN custbranch + prices.stockid, + stockmaster.description, + stockmaster.longdescription, + prices.currabrev, + prices.startdate, + prices.enddate, + prices.price, + stockmaster.materialcost+stockmaster.labourcost+stockmaster.overheadcost AS standardcost, + stockmaster.categoryid, + stockcategory.categorydescription, + prices.debtorno, + prices.branchcode, + custbranch.brname, + currencies.decimalplaces + FROM stockmaster INNER JOIN stockcategory + ON stockmaster.categoryid=stockcategory.categoryid + INNER JOIN prices + ON stockmaster.stockid=prices.stockid + INNER JOIN currencies + ON prices.currabrev=currencies.currabrev + LEFT JOIN custbranch ON prices.debtorno=custbranch.debtorno AND prices.branchcode=custbranch.branchcode - WHERE stockmaster.stockid=prices.stockid - AND stockmaster.categoryid=stockcategory.categoryid - AND prices.typeabbrev = '" . $SalesType . "' + WHERE prices.typeabbrev = '" . $SalesType . "' AND stockmaster.categoryid >= '" . $_POST['FromCriteria'] . "' AND stockmaster.categoryid <= '" . $_POST['ToCriteria'] . "' AND prices.debtorno='" . $_SESSION['CustomerID'] . "' AND prices.startdate<='" . FormatDateForSQL($_POST['EffectiveDate']) . "' - AND (prices.enddate='0000-00-00' OR prices.enddate>'" . FormatDateForSQL($_POST['EffectiveDate']) . "') + AND (prices.enddate='0000-00-00' OR prices.enddate >'" . FormatDateForSQL($_POST['EffectiveDate']) . "') ORDER BY prices.currabrev, stockmaster.categoryid, stockmaster.stockid, @@ -89,31 +91,33 @@ $SalesTypeName = $SalesTypeRow[0]; $SQL = "SELECT prices.typeabbrev, - prices.stockid, - prices.startdate, - prices.enddate, - stockmaster.description, - stockmaster.longdescription, - prices.currabrev, - prices.price, - stockmaster.materialcost+stockmaster.labourcost+stockmaster.overheadcost as standardcost, - stockmaster.categoryid, - stockcategory.categorydescription - FROM prices, - stockmaster, - stockcategory - WHERE stockmaster.stockid=prices.stockid - AND stockmaster.categoryid=stockcategory.categoryid - AND stockmaster.categoryid >= '" . $_POST['FromCriteria'] . "' - AND stockmaster.categoryid <= '" . $_POST['ToCriteria'] . "' - AND prices.typeabbrev='" . $_POST['SalesType'] . "' - AND prices.startdate<='" . FormatDateForSQL($_POST['EffectiveDate']) . "' - AND (prices.enddate='0000-00-00' OR prices.enddate>'" . FormatDateForSQL($_POST['EffectiveDate']) . "') - AND prices.debtorno='' - ORDER BY prices.currabrev, - stockmaster.categoryid, - stockmaster.stockid, - prices.startdate"; + prices.stockid, + prices.startdate, + prices.enddate, + stockmaster.description, + stockmaster.longdescription, + prices.currabrev, + prices.price, + stockmaster.materialcost+stockmaster.labourcost+stockmaster.overheadcost as standardcost, + stockmaster.categoryid, + stockcategory.categorydescription, + currencies.decimalplaces + FROM stockmaster INNER JOIN stockcategory + ON stockmaster.categoryid=stockcategory.categoryid + INNER JOIN prices + ON stockmaster.stockid=prices.stockid + INNER JOIN currencies + ON prices.currabrev=currencies.currabrev + WHERE stockmaster.categoryid >= '" . $_POST['FromCriteria'] . "' + AND stockmaster.categoryid <= '" . $_POST['ToCriteria'] . "' + AND prices.typeabbrev='" . $_POST['SalesType'] . "' + AND prices.startdate<='" . FormatDateForSQL($_POST['EffectiveDate']) . "' + AND (prices.enddate='0000-00-00' OR prices.enddate>'" . FormatDateForSQL($_POST['EffectiveDate']) . "') + AND prices.debtorno='' + ORDER BY prices.currabrev, + stockmaster.categoryid, + stockmaster.stockid, + prices.startdate"; } $PricesResult = DB_query($SQL,$db,'','',false,false); @@ -121,7 +125,7 @@ $title = _('Price List') . ' - ' . _('Problem Report....'); include('includes/header.inc'); prnMsg( _('The Price List could not be retrieved by the SQL because'). ' - ' . DB_error_msg($db), '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>'; if ($debug==1){ prnMsg(_('For debugging purposes the SQL used was:') . $SQL,'error'); } @@ -132,7 +136,7 @@ $title = _('Print Price List Error'); include('includes/header.inc'); prnMsg(_('There were no price details to print out for the customer or category specified'),'warn'); - echo '<br /><a href="'.$_SERVER['PHP_SELF'] .'?' . SID . '">'. _('Back').'</a>'; + echo '<br /><a href="'.$_SERVER['PHP_SELF'] . '">'. _('Back').'</a>'; include('includes/footer.inc'); exit; } @@ -173,11 +177,11 @@ } $LeftOvers = $pdf->addTextWrap($Left_Margin+80+47,$YPos,47,$FontSize,$DisplayEndDate); $LeftOvers = $pdf->addTextWrap($Left_Margin+80+47+47,$YPos,130,$FontSize,$PriceList['description']); - $DisplayUnitPrice = locale_number_format($PriceList['price'],2); + $DisplayUnitPrice = locale_money_format($PriceList['price'],$PriceList['decimalplaces']); $LeftOvers = $pdf->addTextWrap($Left_Margin+80+47+47+130,$YPos,150,$FontSize,$DisplayUnitPrice, 'right'); if ($PriceList['price']!=0){ - $DisplayGPPercent = (int)(($PriceList['price']-$PriceList['standardcost'])*100/$PriceList['price']) . '%'; + $DisplayGPPercent = (int)filter_number_format((($PriceList['price']-$PriceList['standardcost'])*100/$PriceList['price'])) . '%'; } else { $DisplayGPPercent = 0; } @@ -272,28 +276,30 @@ DB_data_seek($CatResult,0); While ($myrow = DB_fetch_array($CatResult)){ - echo '<option VALUE="' . $myrow['categoryid'] . '">' . $myrow['categoryid'] . ' - ' . $myrow['categorydescription']; + echo '<option value="' . $myrow['categoryid'] . '">' . $myrow['categoryid'] . ' - ' . $myrow['categorydescription'] . '</option>'; } echo '</select></td></tr>'; - echo '<tr><td>' . _('For Sales Type/Price List').':</td><td><select name="SalesType">'; - $sql = 'SELECT sales_type, typeabbrev FROM salestypes'; + echo '<tr><td>' . _('For Sales Type/Price List').':</td> + <td><select name="SalesType">'; + $sql = "SELECT sales_type, typeabbrev FROM salestypes"; $SalesTypesResult=DB_query($sql,$db); while ($myrow=DB_fetch_array($SalesTypesResult)){ - echo '<option Value="' . $myrow['typeabbrev'] . '">' . $myrow['sales_type']; + echo '<option Value="' . $myrow['typeabbrev'] . '">' . $myrow['sales_type'] . '</option>'; } echo '</select></td></tr>'; - echo '<tr><td>' . _('Show Gross Profit %') . ':</td><td><select name="ShowGPPercentages">'; - echo '<option selected Value="No">'. _('Prices Only'); - echo '<option Value="Yes">'. _('Show GP % too'); + echo '<tr><td>' . _('Show Gross Profit %') . ':</td> + <td><select name="ShowGPPercentages">'; + echo '<option selected Value="No">'. _('Prices Only') . '</option>'; + echo '<option Value="Yes">'. _('Show GP % too') . '</option>'; echo '</select></td></tr>'; echo '<tr><td>' . _('Price Listing Type'). ':</td><td><select name="CustomerSpecials">'; - echo '<option selected Value="Sales Type Prices">'. _('Default Sales Type Prices'); - echo '<option Value="Customer Special Prices Only">'. _('Customer Special Prices Only'); - echo '<option Value="Full Description">'. _('Full Description'); + echo '<option selected value="Sales Type Prices">'. _('Default Sales Type Prices'); + echo '<option Value="Customer Special Prices Only">'. _('Customer Special Prices Only') . '</option>'; + echo '<option Value="Full Description">'. _('Full Description') . '</option>'; echo '</select></td></tr>'; echo '<tr><td>' . _('Effective As At') . ':</td><td><input type="text" size=11 class="date" alt="' . $_SESSION['DefaultDateFormat'] . '" name="EffectiveDate" value="' . Date($_SESSION['DefaultDateFormat']) . '">'; Modified: trunk/PDFPrintLabel.php =================================================================== --- trunk/PDFPrintLabel.php 2011-09-12 23:37:53 UTC (rev 4688) +++ trunk/PDFPrintLabel.php 2011-09-14 08:06:45 UTC (rev 4689) @@ -243,9 +243,10 @@ return noneButton( _('This category has no items to show') ); } - $txt=array( - _('Code'), _('Description'), _('Price').'<br />('.$_POST['Currency'].')', - _('All') + $txt=array(_('Code'), + _('Description'), + _('Price'). '<br />('.$_POST['Currency'].')', + _('All') ); $ix=0; // The table's header @@ -265,7 +266,7 @@ $ok=true; $odd=true; while ($myrow=DB_fetch_array($result)) { - $price = locale_number_format($myrow['price'],$DecimalPlaces); + $price = locale_money_format($myrow['price'],$DecimalPlaces); $oddEven=$odd?"Odd":"Even"; $odd = !$odd; $html .= <<<ZZZ @@ -307,23 +308,23 @@ } else { $WhereClause = "stockmaster.categoryid='$CategoryID' ORDER BY stockmaster.stockid"; } - + $WhereClause = " stockmaster.discontinued!=1 AND " . $WhereClause; - $sql="SELECT stockmaster.stockid, - stockmaster.description, - stockmaster.longdescription, - stockmaster.barcode, - prices.price - FROM stockmaster LEFT JOIN prices - ON stockmaster.stockid=prices.stockid - AND prices.currabrev = '" . $CurrCode . "' + $sql="SELECT stockmaster.stockid, + stockmaster.description, + stockmaster.longdescription, + stockmaster.barcode, + prices.price + FROM stockmaster LEFT JOIN prices + ON stockmaster.stockid=prices.stockid + AND prices.currabrev = '" . $CurrCode . "' AND prices.typeabbrev= '" . $SalesType . "' AND prices.startdate <= '" . $EffectiveDate . "' - AND (prices.enddate >= '" . $EffectiveDate . "' OR prices.enddate='0000-00-00') + AND (prices.enddate >= '" . $EffectiveDate . "' OR prices.enddate='0000-00-00') AND prices.debtorno='' WHERE " . $WhereClause; - + return DB_query($sql, $db); } @@ -491,7 +492,7 @@ unset($ldescrip); break; case 'price': - $txt = locale_number_format($itemData['price'], $DecimalPlaces). ' '. $Currency; + $txt = locale_money_format($itemData['price'], $DecimalPlaces). ' '. $Currency; // $adj='left'; break; case 'bcode': break; Modified: trunk/PDFQuotation.php =================================================================== --- trunk/PDFQuotation.php 2011-09-12 23:37:53 UTC (rev 4688) +++ trunk/PDFQuotation.php 2011-09-14 08:06:45 UTC (rev 4689) @@ -19,7 +19,7 @@ } /*retrieve the order details from the database to print */ -$ErrMsg = _('There was a problem retrieving the quotation header details for Order Number') . ' ' . $_GET['QuotationNo'] . ' ' . _('from the database'); +$ErrMsg = _('There was a problem retrieving the quotation header details for Order Number') . ' ' . filter_number_format($_GET['QuotationNo']) . ' ' . _('from the database'); $sql = "SELECT salesorders.customerref, salesorders.comments, @@ -44,15 +44,18 @@ salesorders.datepackingslipprinted, salesorders.branchcode, locations.taxprovinceid, - locations.locationname + locations.locationname, + currencies.decimalplaces AS currdecimalplaces FROM salesorders INNER JOIN debtorsmaster ON salesorders.debtorno=debtorsmaster.debtorno - INNER JOIN shippers + INNER JOIN shippers ON salesorders.shipvia=shippers.shipper_id - INNER JOIN locations + INNER JOIN locations ON salesorders.fromstkloc=locations.loccode + INNER JOIN currencies + ON debtorsmaster.currcode=currencies.currabrev WHERE salesorders.quotation=1 - AND salesorders.orderno='" . $_GET['QuotationNo'] ."'"; + AND salesorders.orderno='" . filter_number_format($_GET['QuotationNo']) ."'"; $result=DB_query($sql,$db, $ErrMsg); @@ -61,7 +64,7 @@ $title = _('Print Quotation Error'); include('includes/header.inc'); echo '<div class="centre"><br /><br /><br />'; - prnMsg( _('Unable to Locate Quotation Number') . ' : ' . $_GET['QuotationNo'] . ' ', 'error'); + prnMsg( _('Unable to Locate Quotation Number') . ' : ' . filter_number_format($_GET['QuotationNo']) . ' ', 'error'); echo '<br /> <br /> <br /> @@ -109,14 +112,15 @@ salesorderdetails.unitprice, salesorderdetails.discountpercent, stockmaster.taxcatid, - salesorderdetails.narrative + salesorderdetails.narrative, + stockmaster.decimalplaces FROM salesorderdetails INNER JOIN stockmaster ON salesorderdetails.stkcode=stockmaster.stockid - WHERE salesorderdetails.orderno='" . $_GET['QuotationNo'] . "'"; + WHERE salesorderdetails.orderno='" . filter_number_format($_GET['QuotationNo']) . "'"; $result=DB_query($sql,$db, $ErrMsg); -$ListCount = 0; +$ListCount = 0; if (DB_num_rows($result)>0){ /*Yes there are line items to start the ball rolling with a page header */ @@ -139,26 +143,26 @@ } //end if need a new page headed up - $DisplayQty = locale_number_format($myrow2['quantity'],2); - $DisplayPrevDel = locale_number_format($myrow2['qtyinvoiced'],2); - $DisplayPrice = locale_number_format($myrow2['unitprice'],2); + $DisplayQty = locale_number_format($myrow2['quantity'],$myrow2['decimalplaces']); + $DisplayPrevDel = locale_number_format($myrow2['qtyinvoiced'],$myrow2['decimalplaces']); + $DisplayPrice = locale_money_format($myrow2['unitprice'],$myrow['currdecimalplaces']); $DisplayDiscount = locale_number_format($myrow2['discountpercent']*100,2) . '%'; - $SubTot = $myrow2['unitprice']*$myrow2['quantity']*(1-$myrow2['discountpercent']); + $SubTot = filter_number_format($myrow2['unitprice']*$myrow2['quantity']*(1-$myrow2['... [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, + 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(); + ?> \ No newline at end of file Modified: trunk/PDFPickingList.php =================================================================== --- trunk/PDFPickingList.php 2011-09-12 23:37:53 UTC (rev 4688) +++ trunk/PDFPickingList.php 2011-09-14 08:06:45 UTC (rev 4689) @@ -21,9 +21,9 @@ if ((!isset($_GET['TransNo']) or $_GET['TransNo']=="") and !isset($_POST['TransDate'])){ $title = _('Select Picking Lists'); include('includes/header.inc'); - $sql='SELECT loccode, + $sql="SELECT loccode, locationname - FROM locations'; + FROM locations"; $result=DB_query($sql, $db); echo '<p class="page_title_text"><img src="'.$rootpath.'/css/'.$theme.'/images/sales.png" title="' . _('Search') . '" alt="" />' . ' ' . $title.'</p><br />'; echo '<form action="' . $_SERVER['PHP_SELF'] . '" method="post" name="form">'; @@ -49,78 +49,78 @@ if (!isset($_POST['TransDate']) and $_GET['TransNo'] != 'Preview') { /* If there is no transaction date set, then it must be for a single order */ $sql = "SELECT salesorders.debtorno, - salesorders.orderno, - salesorders.customerref, - salesorders.comments, - salesorders.orddate, - salesorders.deliverto, - salesorders.deladd1, - salesorders.deladd2, - salesorders.deladd3, - salesorders.deladd4, - salesorders.deladd5, - salesorders.deladd6, - salesorders.deliverblind, - salesorders.deliverydate, - debtorsmaster.name, - debtorsmaster.address1, - debtorsmaster.address2, - debtorsmaster.address3, - debtorsmaster.address4, - debtorsmaster.address5, - debtorsmaster.address6, - shippers.shippername, - salesorders.printedpackingslip, - salesorders.datepackingslipprinted, - locations.locationname - FROM salesorders, - debtorsmaster, - shippers, - locations - WHERE salesorders.debtorno=debtorsmaster.debtorno - AND salesorders.shipvia=shippers.shipper_id - AND salesorders.fromstkloc=locations.loccode - AND salesorders.orderno='" . $_GET['TransNo']."'"; -} else if (isset($_POST['TransDate']) + salesorders.orderno, + salesorders.customerref, + salesorders.comments, + salesorders.orddate, + salesorders.deliverto, + salesorders.deladd1, + salesorders.deladd2, + salesorders.deladd3, + salesorders.deladd4, + salesorders.deladd5, + salesorders.deladd6, + salesorders.deliverblind, + salesorders.deliverydate, + debtorsmaster.name, + debtorsmaster.address1, + debtorsmaster.address2, + debtorsmaster.address3, + debtorsmaster.address4, + debtorsmaster.address5, + debtorsmaster.address6, + shippers.shippername, + salesorders.printedpackingslip, + salesorders.datepackingslipprinted, + locations.locationname + FROM salesorders, + debtorsmaster, + shippers, + locations + WHERE salesorders.debtorno=debtorsmaster.debtorno + AND salesorders.shipvia=shippers.shipper_id + AND salesorders.fromstkloc=locations.loccode + AND salesorders.orderno='" . filter_number_format($_GET['TransNo'])."'"; +} else if (isset($_POST['TransDate']) OR (isset($_GET['TransNo']) AND $_GET['TransNo'] != 'Preview')) { /* We are printing picking lists for all orders on a day */ $sql = "SELECT salesorders.debtorno, - salesorders.orderno, - salesorders.customerref, - salesorders.comments, - salesorders.orddate, - salesorders.deliverto, - salesorders.deladd1, - salesorders.deladd2, - salesorders.deladd3, - salesorders.deladd4, - salesorders.deladd5, - salesorders.deladd6, - salesorders.deliverblind, - salesorders.deliverydate, - debtorsmaster.name, - debtorsmaster.address1, - debtorsmaster.address2, - debtorsmaster.address3, - debtorsmaster.address4, - debtorsmaster.address5, - debtorsmaster.address6, - shippers.shippername, - salesorders.printedpackingslip, - salesorders.datepackingslipprinted, - locations.locationname - FROM salesorders, - debtorsmaster, - shippers, - locations - WHERE salesorders.debtorno=debtorsmaster.debtorno - AND salesorders.shipvia=shippers.shipper_id - AND salesorders.fromstkloc=locations.loccode - AND salesorders.fromstkloc='".$_POST['loccode']."' - AND salesorders.deliverydate='" . FormatDateForSQL($_POST['TransDate'])."'"; + salesorders.orderno, + salesorders.customerref, + salesorders.comments, + salesorders.orddate, + salesorders.deliverto, + salesorders.deladd1, + salesorders.deladd2, + salesorders.deladd3, + salesorders.deladd4, + salesorders.deladd5, + salesorders.deladd6, + salesorders.deliverblind, + salesorders.deliverydate, + debtorsmaster.name, + debtorsmaster.address1, + debtorsmaster.address2, + debtorsmaster.address3, + debtorsmaster.address4, + debtorsmaster.address5, + debtorsmaster.address6, + shippers.shippername, + salesorders.printedpackingslip, + salesorders.datepackingslipprinted, + locations.locationname + FROM salesorders, + debtorsmaster, + shippers, + locations + WHERE salesorders.debtorno=debtorsmaster.debtorno + AND salesorders.shipvia=shippers.shipper_id + AND salesorders.fromstkloc=locations.loccode + AND salesorders.fromstkloc='".$_POST['loccode']."' + AND salesorders.deliverydate='" . FormatDateForSQL($_POST['TransDate'])."'"; } -if (isset($_POST['TransDate']) +if (isset($_POST['TransDate']) OR (isset($_GET['TransNo']) AND $_GET['TransNo'] != 'Preview')) { $result=DB_query($sql,$db, $ErrMsg); @@ -185,7 +185,7 @@ $pdf->addInfo('Title', _('Picking List') ); $pdf->addInfo('Subject', _('Laser Picking List') ); $FontSize=12; -$ListCount = 0; +$ListCount = 0; $Copy=''; $line_height=$FormDesign->LineHeight; @@ -207,44 +207,46 @@ /* Are there any picking lists for this order already */ $sql="SELECT COUNT(orderno) FROM pickinglists - WHERE orderno='" . $OrdersToPick[$i]['orderno'] . "'"; + WHERE orderno='" . filter_number_format($OrdersToPick[$i]['orderno']) . "'"; $countresult=DB_query($sql, $db); $count=DB_fetch_row($countresult); if ($count[0]==0) { /* There are no previous picking lists for this order */ $sql = "SELECT salesorderdetails.stkcode, - stockmaster.description, - salesorderdetails.orderlineno, - salesorderdetails.quantity, - salesorderdetails.qtyinvoiced, - salesorderdetails.unitprice, - salesorderdetails.narrative - FROM salesorderdetails - INNER JOIN stockmaster - ON salesorderdetails.stkcode=stockmaster.stockid - WHERE salesorderdetails.orderno='" . $OrdersToPick[$i]['orderno'] ."'"; + stockmaster.description, + salesorderdetails.orderlineno, + salesorderdetails.quantity, + salesorderdetails.qtyinvoiced, + salesorderdetails.unitprice, + salesorderdetails.narrative, + stockmaster.decimalplaces + FROM salesorderdetails + INNER JOIN stockmaster + ON salesorderdetails.stkcode=stockmaster.stockid + WHERE salesorderdetails.orderno='" . filer_number_format($OrdersToPick[$i]['orderno']) ."'"; } else { /* There are previous picking lists for this order so * need to take those quantities into account */ $sql = "SELECT salesorderdetails.stkcode, - stockmaster.description, - salesorderdetails.orderlineno, - salesorderdetails.quantity, - salesorderdetails.qtyinvoiced, - SUM(pickinglistdetails.qtyexpected) as qtyexpected, - SUM(pickinglistdetails.qtypicked) as qtypicked, - salesorderdetails.unitprice, - salesorderdetails.narrative - FROM salesorderdetails - INNER JOIN stockmaster - ON salesorderdetails.stkcode=stockmaster.stockid - LEFT JOIN pickinglists - ON salesorderdetails.orderno=pickinglists.orderno - LEFT JOIN pickinglistdetails - ON pickinglists.pickinglistno=pickinglistdetails.pickinglistno - WHERE salesorderdetails.orderno='" . $OrdersToPick[$i]['orderno'] ."' - AND salesorderdetails.orderlineno=pickinglistdetails.orderlineno"; + stockmaster.description, + salesorderdetails.orderlineno, + salesorderdetails.quantity, + salesorderdetails.qtyinvoiced, + SUM(pickinglistdetails.qtyexpected) as qtyexpected, + SUM(pickinglistdetails.qtypicked) as qtypicked, + salesorderdetails.unitprice, + salesorderdetails.narrative, + stockmaster.decimalplaces + FROM salesorderdetails + INNER JOIN stockmaster + ON salesorderdetails.stkcode=stockmaster.stockid + LEFT JOIN pickinglists + ON salesorderdetails.orderno=pickinglists.orderno + LEFT JOIN pickinglistdetails + ON pickinglists.pickinglistno=pickinglistdetails.pickinglistno + WHERE salesorderdetails.orderno='" . filter_number_format($OrdersToPick[$i]['orderno']) ."' + AND salesorderdetails.orderlineno=pickinglistdetails.orderlineno"; } $lineresult=DB_query($sql,$db, $ErrMsg); } @@ -258,7 +260,7 @@ $sql="INSERT INTO pickinglists VALUES ( '" . $PickingListNo ."', - '" . $OrdersToPick[$i]['orderno']."', + '" . filter_number_format($OrdersToPick[$i]['orderno'])."', '" . FormatDateForSQL($_POST['TransDate'])."', '" . date('Y-m-d')."', '0000-00-00')"; @@ -284,16 +286,16 @@ $myrow2['qtyexpected']=0; $myrow2['qtypicked']=0; } - $DisplayQty = locale_number_format($myrow2['quantity'],2); - $DisplayPrevDel = locale_number_format($myrow2['qtyinvoiced'],2); - $DisplayQtySupplied = locale_number_format($myrow2['quantity'] - $myrow2['qtyinvoiced']-$myrow2['qtyexpected']-$myrow2['qtypicked'],2); + $DisplayQty = locale_number_format($myrow2['quantity'],$myrow2['decimalplaces']); + $DisplayPrevDel = locale_number_format($myrow2['qtyinvoiced'],$myrow2['decimalplaces']); + $DisplayQtySupplied = locale_number_format(filer_number_format($myrow2['quantity'] - $myrow2['qtyinvoiced']-$myrow2['qtyexpected']-$myrow2['qtypicked']),$myrow2['decimalplaces']); $itemdesc = $myrow2['description'] . ' - ' . $myrow2['narrative']; $sql="INSERT INTO pickinglistdetails VALUES( '" . $PickingListNo ."', '" . $Lines."', '" . $myrow2['orderlineno']."', - '" . $DisplayQtySupplied."', + '" . filter_number_format($DisplayQtySupplied) ."', 0)"; $lineresult=DB_query($sql, $db); } @@ -327,6 +329,6 @@ exit; } else { $pdf->OutputD($_SESSION['DatabaseName'] . '_PickingLists_' . date('Y-m-d') . '.pdf'); - $pdf->__destruct(); + $pdf->__destruct(); } ?> \ No newline at end of file Modified: trunk/PDFPriceList.php =================================================================== --- trunk/PDFPriceList.php 2011-09-12 23:37:53 UTC (rev 4688) +++ trunk/PDFPriceList.php 2011-09-14 08:06:45 UTC (rev 4689) @@ -1,7 +1,6 @@ <?php -/* $Revision: 1.14 $ */ +/* $Id$*/ -//$PageSecurity = 2; include('includes/session.inc'); If (isset($_POST['PrintPDF']) @@ -27,7 +26,7 @@ include('includes/header.inc'); echo '<br />'; prnMsg( _('The customer must first be selected from the select customer link') . '. ' . _('Re-run the price list once the customer has been selected') ); - echo '<br /><br /><a href="' . $_SERVER['PHP_SELF'] . '?' . SID . '">' . _('Back') . '</a>'; + echo '<br /><br /><a href="' . $_SERVER['PHP_SELF'] . '">' . _('Back') . '</a>'; include('includes/footer.inc'); exit; } @@ -35,7 +34,7 @@ $title = _('Special price List - No Customer Selected'); include('includes/header.inc'); prnMsg(_('The effective date must be entered in the format') . ' ' . $_SESSION['DefaultDateFormat'],'error'); - echo '<br /><br /><a href="' . $_SERVER['PHP_SELF'] . '?' . SID . '">' . _('Back') . '</a>'; + echo '<br /><br /><a href="' . $_SERVER['PHP_SELF'] . '">' . _('Back') . '</a>'; include('includes/footer.inc'); exit; } @@ -50,32 +49,35 @@ $SalesType = $CustNameRow[1]; $SQL = "SELECT prices.typeabbrev, - prices.stockid, - stockmaster.description, - stockmaster.longdescription, - prices.currabrev, - prices.startdate, - prices.enddate, - prices.price, - stockmaster.materialcost+stockmaster.labourcost+stockmaster.overheadcost AS standardcost, - stockmaster.categoryid, - stockcategory.categorydescription, - prices.debtorno, - prices.branchcode, - custbranch.brname - FROM stockmaster, - stockcategory, - prices LEFT JOIN custbranch + prices.stockid, + stockmaster.description, + stockmaster.longdescription, + prices.currabrev, + prices.startdate, + prices.enddate, + prices.price, + stockmaster.materialcost+stockmaster.labourcost+stockmaster.overheadcost AS standardcost, + stockmaster.categoryid, + stockcategory.categorydescription, + prices.debtorno, + prices.branchcode, + custbranch.brname, + currencies.decimalplaces + FROM stockmaster INNER JOIN stockcategory + ON stockmaster.categoryid=stockcategory.categoryid + INNER JOIN prices + ON stockmaster.stockid=prices.stockid + INNER JOIN currencies + ON prices.currabrev=currencies.currabrev + LEFT JOIN custbranch ON prices.debtorno=custbranch.debtorno AND prices.branchcode=custbranch.branchcode - WHERE stockmaster.stockid=prices.stockid - AND stockmaster.categoryid=stockcategory.categoryid - AND prices.typeabbrev = '" . $SalesType . "' + WHERE prices.typeabbrev = '" . $SalesType . "' AND stockmaster.categoryid >= '" . $_POST['FromCriteria'] . "' AND stockmaster.categoryid <= '" . $_POST['ToCriteria'] . "' AND prices.debtorno='" . $_SESSION['CustomerID'] . "' AND prices.startdate<='" . FormatDateForSQL($_POST['EffectiveDate']) . "' - AND (prices.enddate='0000-00-00' OR prices.enddate>'" . FormatDateForSQL($_POST['EffectiveDate']) . "') + AND (prices.enddate='0000-00-00' OR prices.enddate >'" . FormatDateForSQL($_POST['EffectiveDate']) . "') ORDER BY prices.currabrev, stockmaster.categoryid, stockmaster.stockid, @@ -89,31 +91,33 @@ $SalesTypeName = $SalesTypeRow[0]; $SQL = "SELECT prices.typeabbrev, - prices.stockid, - prices.startdate, - prices.enddate, - stockmaster.description, - stockmaster.longdescription, - prices.currabrev, - prices.price, - stockmaster.materialcost+stockmaster.labourcost+stockmaster.overheadcost as standardcost, - stockmaster.categoryid, - stockcategory.categorydescription - FROM prices, - stockmaster, - stockcategory - WHERE stockmaster.stockid=prices.stockid - AND stockmaster.categoryid=stockcategory.categoryid - AND stockmaster.categoryid >= '" . $_POST['FromCriteria'] . "' - AND stockmaster.categoryid <= '" . $_POST['ToCriteria'] . "' - AND prices.typeabbrev='" . $_POST['SalesType'] . "' - AND prices.startdate<='" . FormatDateForSQL($_POST['EffectiveDate']) . "' - AND (prices.enddate='0000-00-00' OR prices.enddate>'" . FormatDateForSQL($_POST['EffectiveDate']) . "') - AND prices.debtorno='' - ORDER BY prices.currabrev, - stockmaster.categoryid, - stockmaster.stockid, - prices.startdate"; + prices.stockid, + prices.startdate, + prices.enddate, + stockmaster.description, + stockmaster.longdescription, + prices.currabrev, + prices.price, + stockmaster.materialcost+stockmaster.labourcost+stockmaster.overheadcost as standardcost, + stockmaster.categoryid, + stockcategory.categorydescription, + currencies.decimalplaces + FROM stockmaster INNER JOIN stockcategory + ON stockmaster.categoryid=stockcategory.categoryid + INNER JOIN prices + ON stockmaster.stockid=prices.stockid + INNER JOIN currencies + ON prices.currabrev=currencies.currabrev + WHERE stockmaster.categoryid >= '" . $_POST['FromCriteria'] . "' + AND stockmaster.categoryid <= '" . $_POST['ToCriteria'] . "' + AND prices.typeabbrev='" . $_POST['SalesType'] . "' + AND prices.startdate<='" . FormatDateForSQL($_POST['EffectiveDate']) . "' + AND (prices.enddate='0000-00-00' OR prices.enddate>'" . FormatDateForSQL($_POST['EffectiveDate']) . "') + AND prices.debtorno='' + ORDER BY prices.currabrev, + stockmaster.categoryid, + stockmaster.stockid, + prices.startdate"; } $PricesResult = DB_query($SQL,$db,'','',false,false); @@ -121,7 +125,7 @@ $title = _('Price List') . ' - ' . _('Problem Report....'); include('includes/header.inc'); prnMsg( _('The Price List could not be retrieved by the SQL because'). ' - ' . DB_error_msg($db), '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>'; if ($debug==1){ prnMsg(_('For debugging purposes the SQL used was:') . $SQL,'error'); } @@ -132,7 +136,7 @@ $title = _('Print Price List Error'); include('includes/header.inc'); prnMsg(_('There were no price details to print out for the customer or category specified'),'warn'); - echo '<br /><a href="'.$_SERVER['PHP_SELF'] .'?' . SID . '">'. _('Back').'</a>'; + echo '<br /><a href="'.$_SERVER['PHP_SELF'] . '">'. _('Back').'</a>'; include('includes/footer.inc'); exit; } @@ -173,11 +177,11 @@ } $LeftOvers = $pdf->addTextWrap($Left_Margin+80+47,$YPos,47,$FontSize,$DisplayEndDate); $LeftOvers = $pdf->addTextWrap($Left_Margin+80+47+47,$YPos,130,$FontSize,$PriceList['description']); - $DisplayUnitPrice = locale_number_format($PriceList['price'],2); + $DisplayUnitPrice = locale_money_format($PriceList['price'],$PriceList['decimalplaces']); $LeftOvers = $pdf->addTextWrap($Left_Margin+80+47+47+130,$YPos,150,$FontSize,$DisplayUnitPrice, 'right'); if ($PriceList['price']!=0){ - $DisplayGPPercent = (int)(($PriceList['price']-$PriceList['standardcost'])*100/$PriceList['price']) . '%'; + $DisplayGPPercent = (int)filter_number_format((($PriceList['price']-$PriceList['standardcost'])*100/$PriceList['price'])) . '%'; } else { $DisplayGPPercent = 0; } @@ -272,28 +276,30 @@ DB_data_seek($CatResult,0); While ($myrow = DB_fetch_array($CatResult)){ - echo '<option VALUE="' . $myrow['categoryid'] . '">' . $myrow['categoryid'] . ' - ' . $myrow['categorydescription']; + echo '<option value="' . $myrow['categoryid'] . '">' . $myrow['categoryid'] . ' - ' . $myrow['categorydescription'] . '</option>'; } echo '</select></td></tr>'; - echo '<tr><td>' . _('For Sales Type/Price List').':</td><td><select name="SalesType">'; - $sql = 'SELECT sales_type, typeabbrev FROM salestypes'; + echo '<tr><td>' . _('For Sales Type/Price List').':</td> + <td><select name="SalesType">'; + $sql = "SELECT sales_type, typeabbrev FROM salestypes"; $SalesTypesResult=DB_query($sql,$db); while ($myrow=DB_fetch_array($SalesTypesResult)){ - echo '<option Value="' . $myrow['typeabbrev'] . '">' . $myrow['sales_type']; + echo '<option Value="' . $myrow['typeabbrev'] . '">' . $myrow['sales_type'] . '</option>'; } echo '</select></td></tr>'; - echo '<tr><td>' . _('Show Gross Profit %') . ':</td><td><select name="ShowGPPercentages">'; - echo '<option selected Value="No">'. _('Prices Only'); - echo '<option Value="Yes">'. _('Show GP % too'); + echo '<tr><td>' . _('Show Gross Profit %') . ':</td> + <td><select name="ShowGPPercentages">'; + echo '<option selected Value="No">'. _('Prices Only') . '</option>'; + echo '<option Value="Yes">'. _('Show GP % too') . '</option>'; echo '</select></td></tr>'; echo '<tr><td>' . _('Price Listing Type'). ':</td><td><select name="CustomerSpecials">'; - echo '<option selected Value="Sales Type Prices">'. _('Default Sales Type Prices'); - echo '<option Value="Customer Special Prices Only">'. _('Customer Special Prices Only'); - echo '<option Value="Full Description">'. _('Full Description'); + echo '<option selected value="Sales Type Prices">'. _('Default Sales Type Prices'); + echo '<option Value="Customer Special Prices Only">'. _('Customer Special Prices Only') . '</option>'; + echo '<option Value="Full Description">'. _('Full Description') . '</option>'; echo '</select></td></tr>'; echo '<tr><td>' . _('Effective As At') . ':</td><td><input type="text" size=11 class="date" alt="' . $_SESSION['DefaultDateFormat'] . '" name="EffectiveDate" value="' . Date($_SESSION['DefaultDateFormat']) . '">'; Modified: trunk/PDFPrintLabel.php =================================================================== --- trunk/PDFPrintLabel.php 2011-09-12 23:37:53 UTC (rev 4688) +++ trunk/PDFPrintLabel.php 2011-09-14 08:06:45 UTC (rev 4689) @@ -243,9 +243,10 @@ return noneButton( _('This category has no items to show') ); } - $txt=array( - _('Code'), _('Description'), _('Price').'<br />('.$_POST['Currency'].')', - _('All') + $txt=array(_('Code'), + _('Description'), + _('Price'). '<br />('.$_POST['Currency'].')', + _('All') ); $ix=0; // The table's header @@ -265,7 +266,7 @@ $ok=true; $odd=true; while ($myrow=DB_fetch_array($result)) { - $price = locale_number_format($myrow['price'],$DecimalPlaces); + $price = locale_money_format($myrow['price'],$DecimalPlaces); $oddEven=$odd?"Odd":"Even"; $odd = !$odd; $html .= <<<ZZZ @@ -307,23 +308,23 @@ } else { $WhereClause = "stockmaster.categoryid='$CategoryID' ORDER BY stockmaster.stockid"; } - + $WhereClause = " stockmaster.discontinued!=1 AND " . $WhereClause; - $sql="SELECT stockmaster.stockid, - stockmaster.description, - stockmaster.longdescription, - stockmaster.barcode, - prices.price - FROM stockmaster LEFT JOIN prices - ON stockmaster.stockid=prices.stockid - AND prices.currabrev = '" . $CurrCode . "' + $sql="SELECT stockmaster.stockid, + stockmaster.description, + stockmaster.longdescription, + stockmaster.barcode, + prices.price + FROM stockmaster LEFT JOIN prices + ON stockmaster.stockid=prices.stockid + AND prices.currabrev = '" . $CurrCode . "' AND prices.typeabbrev= '" . $SalesType . "' AND prices.startdate <= '" . $EffectiveDate . "' - AND (prices.enddate >= '" . $EffectiveDate . "' OR prices.enddate='0000-00-00') + AND (prices.enddate >= '" . $EffectiveDate . "' OR prices.enddate='0000-00-00') AND prices.debtorno='' WHERE " . $WhereClause; - + return DB_query($sql, $db); } @@ -491,7 +492,7 @@ unset($ldescrip); break; case 'price': - $txt = locale_number_format($itemData['price'], $DecimalPlaces). ' '. $Currency; + $txt = locale_money_format($itemData['price'], $DecimalPlaces). ' '. $Currency; // $adj='left'; break; case 'bcode': break; Modified: trunk/PDFQuotation.php =================================================================== --- trunk/PDFQuotation.php 2011-09-12 23:37:53 UTC (rev 4688) +++ trunk/PDFQuotation.php 2011-09-14 08:06:45 UTC (rev 4689) @@ -19,7 +19,7 @@ } /*retrieve the order details from the database to print */ -$ErrMsg = _('There was a problem retrieving the quotation header details for Order Number') . ' ' . $_GET['QuotationNo'] . ' ' . _('from the database'); +$ErrMsg = _('There was a problem retrieving the quotation header details for Order Number') . ' ' . filter_number_format($_GET['QuotationNo']) . ' ' . _('from the database'); $sql = "SELECT salesorders.customerref, salesorders.comments, @@ -44,15 +44,18 @@ salesorders.datepackingslipprinted, salesorders.branchcode, locations.taxprovinceid, - locations.locationname + locations.locationname, + currencies.decimalplaces AS currdecimalplaces FROM salesorders INNER JOIN debtorsmaster ON salesorders.debtorno=debtorsmaster.debtorno - INNER JOIN shippers + INNER JOIN shippers ON salesorders.shipvia=shippers.shipper_id - INNER JOIN locations + INNER JOIN locations ON salesorders.fromstkloc=locations.loccode + INNER JOIN currencies + ON debtorsmaster.currcode=currencies.currabrev WHERE salesorders.quotation=1 - AND salesorders.orderno='" . $_GET['QuotationNo'] ."'"; + AND salesorders.orderno='" . filter_number_format($_GET['QuotationNo']) ."'"; $result=DB_query($sql,$db, $ErrMsg); @@ -61,7 +64,7 @@ $title = _('Print Quotation Error'); include('includes/header.inc'); echo '<div class="centre"><br /><br /><br />'; - prnMsg( _('Unable to Locate Quotation Number') . ' : ' . $_GET['QuotationNo'] . ' ', 'error'); + prnMsg( _('Unable to Locate Quotation Number') . ' : ' . filter_number_format($_GET['QuotationNo']) . ' ', 'error'); echo '<br /> <br /> <br /> @@ -109,14 +112,15 @@ salesorderdetails.unitprice, salesorderdetails.discountpercent, stockmaster.taxcatid, - salesorderdetails.narrative + salesorderdetails.narrative, + stockmaster.decimalplaces FROM salesorderdetails INNER JOIN stockmaster ON salesorderdetails.stkcode=stockmaster.stockid - WHERE salesorderdetails.orderno='" . $_GET['QuotationNo'] . "'"; + WHERE salesorderdetails.orderno='" . filter_number_format($_GET['QuotationNo']) . "'"; $result=DB_query($sql,$db, $ErrMsg); -$ListCount = 0; +$ListCount = 0; if (DB_num_rows($result)>0){ /*Yes there are line items to start the ball rolling with a page header */ @@ -139,26 +143,26 @@ } //end if need a new page headed up - $DisplayQty = locale_number_format($myrow2['quantity'],2); - $DisplayPrevDel = locale_number_format($myrow2['qtyinvoiced'],2); - $DisplayPrice = locale_number_format($myrow2['unitprice'],2); + $DisplayQty = locale_number_format($myrow2['quantity'],$myrow2['decimalplaces']); + $DisplayPrevDel = locale_number_format($myrow2['qtyinvoiced'],$myrow2['decimalplaces']); + $DisplayPrice = locale_money_format($myrow2['unitprice'],$myrow['currdecimalplaces']); $DisplayDiscount = locale_number_format($myrow2['discountpercent']*100,2) . '%'; - $SubTot = $myrow2['unitprice']*$myrow2['quantity']*(1-$myrow2['discountpercent']); + $SubTot = filter_number_format($myrow2['unitprice']*$myrow2['quantity']*(1-$myrow2['... [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') . '! ' . _('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'); @@ -308,7 +305,7 @@ $Result = DB_Txn_Commit($db); - $ConfirmationText = _('A stock adjustment for'). ' ' . $_SESSION['Adjustment']->StockID . ' - ' . $_SESSION['Adjustment']->ItemDescription . ' '._('has been created from location').' ' . $_SESSION['Adjustment']->StockLocation .' '. _('for a quantity of') . ' ' . $_SESSION['Adjustment']->Quantity ; + $ConfirmationText = _('A stock adjustment for'). ' ' . $_SESSION['Adjustment']->StockID . ' - ' . $_SESSION['Adjustment']->ItemDescription . ' '._('has been created from location').' ' . $_SESSION['Adjustment']->StockLocation .' '. _('for a quantity of') . ' ' . locale_number_format($_SESSION['Adjustment']->Quantity,$_SESSION['Adjustment']->DecimalPlaces) ; prnMsg( $ConfirmationText,'success'); if ($_SESSION['InventoryManagerEmail']!=''){ @@ -323,22 +320,24 @@ }/* end if the user hit enter the adjustment */ -echo '<form action="'. $_SERVER['PHP_SELF'] . '?' . SID . '" method=post>'; +echo '<form action="'. $_SERVER['PHP_SELF'] . '" method=post>'; echo '<input type="hidden" name="FormID" value="' . $_SESSION['FormID'] . '" />'; if (!isset($_SESSION['Adjustment'])) { $StockID=''; $Controlled= 0; $Quantity = 0; + $DecimalPlaces =2; } else { $StockID = $_SESSION['Adjustment']->StockID; $Controlled = $_SESSION['Adjustment']->Controlled; $Quantity = $_SESSION['Adjustment']->Quantity; - $sql="SELECT materialcost, labourcost, overheadcost, units FROM stockmaster WHERE stockid='".$StockID."'"; + $sql="SELECT materialcost, labourcost, overheadcost, units, decimalplaces FROM stockmaster WHERE stockid='".$StockID."'"; $result=DB_query($sql, $db); $myrow=DB_fetch_array($result); $_SESSION['Adjustment']->PartUnit=$myrow['units']; $_SESSION['Adjustment']->StandardCost=$myrow['materialcost']+$myrow['labourcost']+$myrow['overheadcost']; + $DecimalPlaces = $myrow['decimalplaces']; } echo '<br /><table class=selection>'; echo '<tr><th colspan=4><font color=blue size=3>'._('Adjustment Details').'</font></th></tr>'; @@ -359,10 +358,10 @@ echo '<input type="text" name="StockCode" size=21 value="" maxlength=20>'; } echo '</td><td><input type=submit name="CheckCode" VALUE="'._('Check Part').'"></td></tr>'; -if (isset($_SESSION['Adjustment']) and mb_strlen($_SESSION['Adjustment']->ItemDescription)>1){ +if (isset($_SESSION['Adjustment']) AND mb_strlen($_SESSION['Adjustment']->ItemDescription)>1){ echo '<tr><td colspan=3><font color=BLUE size=3>' . $_SESSION['Adjustment']->ItemDescription . ' ('._('In Units of').' ' . $_SESSION['Adjustment']->PartUnit . ' ) - ' . _('Unit Cost').' = ' . - locale_number_format($_SESSION['Adjustment']->StandardCost,4) . '</font></td></tr>'; + locale_money_format($_SESSION['Adjustment']->StandardCost,4) . '</font></td></tr>'; } echo '<tr><td>'. _('Adjustment to Stock At Location').':</td> @@ -373,25 +372,28 @@ while ($myrow=DB_fetch_array($resultStkLocs)){ if (isset($_SESSION['Adjustment']->StockLocation)){ if ($myrow['loccode'] == $_SESSION['Adjustment']->StockLocation){ - echo '<option selected Value="' . $myrow['loccode'] . '">' . $myrow['locationname']; + echo '<option selected value="' . $myrow['loccode'] . '">' . $myrow['locationname']; } else { - echo '<option Value="' . $myrow['loccode'] . '">' . $myrow['locationname']; + echo '<option value="' . $myrow['loccode'] . '">' . $myrow['locationname']; } } elseif ($myrow['loccode']==$_SESSION['UserStockLocation']){ - echo '<option selected Value="' . $myrow['loccode'] . '">' . $myrow['locationname']; + echo '<option selected value="' . $myrow['loccode'] . '">' . $myrow['locationname']; $_POST['StockLocation']=$myrow['loccode']; } else { - echo '<option Value="' . $myrow['loccode'] . '">' . $myrow['locationname']; + echo '<option value="' . $myrow['loccode'] . '">' . $myrow['locationname']; } } echo '</select></td></tr>'; -if (isset($_SESSION['Adjustment']) and !isset($_SESSION['Adjustment']->Narrative)) { +if (isset($_SESSION['Adjustment']) AND !isset($_SESSION['Adjustment']->Narrative)) { $_SESSION['Adjustment']->Narrative = ''; + $Narrative =''; +} else { + $Narrative =''; } echo '<tr><td>'. _('Comments On Why').':</td> - <td><input type="text" name="Narrative" size=32 maxlength=30 value="' . $_SESSION['Adjustment']->Narrative . '"></td></tr>'; + <td><input type="text" name="Narrative" size=32 maxlength=30 value="' . $Narrative . '"></td></tr>'; echo '<tr><td>'._('Adjustment Quantity').':</td>'; @@ -400,26 +402,26 @@ if ($_SESSION['Adjustment']->StockLocation == ''){ $_SESSION['Adjustment']->StockLocation = $_SESSION['UserStockLocation']; } - echo '<input type="HIDDEN" name="Quantity" Value="' . $_SESSION['Adjustment']->Quantity . '"> - '.$_SESSION['Adjustment']->Quantity.' - [<a href="'.$rootpath.'/StockAdjustmentsControlled.php?AdjType=REMOVE&' . SID . '">'._('Remove').'</a>] - [<a href="'.$rootpath.'/StockAdjustmentsControlled.php?AdjType=ADD&' . SID . '">'._('Add').'</a>]'; + echo '<input type="hidden" name="Quantity" value="' . $_SESSION['Adjustment']->Quantity . '"> + '.locale_number_format($_SESSION['Adjustment']->Quantity,$DecimalPlaces) .' + [<a href="'.$rootpath.'/StockAdjustmentsControlled.php?AdjType=REMOVE">'._('Remove').'</a>] + [<a href="'.$rootpath.'/StockAdjustmentsControlled.php?AdjType=ADD">'._('Add').'</a>]'; } else { - echo '<input type="text" class="number" name="Quantity" size=12 maxlength=12 Value="' . $Quantity . '">'; + echo '<input type="text" class="number" name="Quantity" size="12" maxlength="12" value="' . locale_number_format($Quantity,$DecimalPlaces) . '">'; } echo '</td></tr>'; //Select the tag echo '<tr><td>'._('Select Tag').'</td><td><select name="tag">'; -$SQL = 'SELECT tagref, +$SQL = "SELECT tagref, tagdescription FROM tags - ORDER BY tagref'; + ORDER BY tagref"; $result=DB_query($SQL,$db); -echo '<option value=0>0 - None'; +echo '<option value=0>0 - ' . _('None') . '</option>'; while ($myrow=DB_fetch_array($result)){ - if (isset($_SESSION['Adjustment']->tag) and $_SESSION['Adjustment']->tag==$myrow['tagref']){ + if (isset($_SESSION['Adjustment']->tag) AND $_SESSION['Adjustment']->tag==$myrow['tagref']){ echo '<option selected value=' . $myrow['tagref'] . '>' . $myrow['tagref'].' - ' .$myrow['tagdescription'] . '</option>'; } else { echo '<option value=' . $myrow['tagref'] . '>' . $myrow['tagref'].' - ' .$myrow['tagdescription']. '</option>'; @@ -428,7 +430,7 @@ echo '</select></td>'; // End select tag -echo '</table><div class="centre"><br /><input type=submit name="EnterAdjustment" value="'. _('Enter Stock Adjustment'). '"><br />'; +echo '</table><div class="centre"><br /><input type="submit" name="EnterAdjustment" value="'. _('Enter Stock Adjustment'). '"><br />'; if (!isset($_POST['StockLocation'])) { $_POST['StockLocation']=''; Modified: trunk/UpgradeDatabase.php =================================================================== --- trunk/UpgradeDatabase.php 2011-09-17 07:49:08 UTC (rev 4693) +++ trunk/UpgradeDatabase.php 2011-09-17 22:43:30 UTC (rev 4694) @@ -112,6 +112,7 @@ $SQLScripts[] = './sql/mysql/upgrade4.04.5-4.05.sql'; case '4.05': case '4.05.1': + case '4.05.2': $SQLScripts[] = './sql/mysql/upgrade4.05-4.06.sql'; case '4.06': break; Modified: trunk/WWW_Users.php =================================================================== --- trunk/WWW_Users.php 2011-09-17 07:49:08 UTC (rev 4693) +++ trunk/WWW_Users.php 2011-09-17 22:43:30 UTC (rev 4694) @@ -133,13 +133,13 @@ $UpdatePassword = "password='" . CryptPass($_POST['Password']) . "',"; } - $sql = "UPDATE www_users SET realname='" . $_POST['RealName'] . "', - customerid='" . $_POST['Cust'] ."', - phone='" . $_POST['Phone'] ."', - email='" . $_POST['Email'] ."', + $sql = "UPDATE www_users SET realname='" . DB_escape_string($_POST['RealName']) . "', + customerid='" . DB_escape_string($_POST['Cust']) ."', + phone='" . DB_escape_string($_POST['Phone']) ."', + email='" . DB_escape_string($_POST['Email'] ."', " . $UpdatePassword . " - branchcode='" . $_POST['BranchCode'] . "', - supplierid='" . $_POST['SupplierID'] . "', + branchcode='" . DB_escape_string($_POST['BranchCode']) . "', + supplierid='" . DB_escape_string($_POST['SupplierID']) . "', salesman='" . $_POST['Salesman'] . "', pagesize='" . $_POST['PageSize'] . "', fullaccess='" . $_POST['Access'] . "', @@ -171,15 +171,15 @@ theme, language, pdflanguage) - VALUES ('" . $_POST['UserID'] . "', - '" . $_POST['RealName'] ."', - '" . $_POST['Cust'] ."', - '" . $_POST['BranchCode'] ."', - '" . $_POST['SupplierID'] ."', + VALUES ('" . DB_escape_string($_POST['UserID']) . "', + '" . DB_escape_string($_POST['RealName']) ."', + '" . DB_escape_string($_POST['Cust']) ."', + '" . DB_escape_string($_POST['BranchCode']) ."', + '" . DB_escape_string($_POST['SupplierID']) ."', '" . $_POST['Salesman'] . "', '" . CryptPass($_POST['Password']) ."', - '" . $_POST['Phone'] . "', - '" . $_POST['Email'] ."', + '" . DB_escape_string($_POST['Phone']) . "', + '" . DB_escape_string($_POST['Email']) ."', '" . $_POST['PageSize'] ."', '" . $_POST['Access'] . "', '" . $_POST['DefaultLocation'] ."', Modified: trunk/doc/Change.log =================================================================== --- trunk/doc/Change.log 2011-09-17 07:49:08 UTC (rev 4693) +++ trunk/doc/Change.log 2011-09-17 22:43:30 UTC (rev 4694) @@ -1,5 +1,6 @@ webERP Change Log +17/9/11 Phil: Added WindowsLocale element to LanguagesArray.php and modified UserSettings.php and WWW_Users.php to use the new array definition. Also modified includes/LanguageSetup.php to use the windows locale string in the LanguagesArray as required for proper setting of the locale under windows. 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. Modified: trunk/includes/Add_SerialItems.php =================================================================== --- trunk/includes/Add_SerialItems.php 2011-09-17 07:49:08 UTC (rev 4693) +++ trunk/includes/Add_SerialItems.php 2011-09-17 22:43:30 UTC (rev 4694) @@ -56,17 +56,21 @@ if ($LineItem->Serialised){ $ExistingQty = ValidBundleRef($StockID, $LocationOut, $NewSerialNo); - if ($NewQty == 1 && $ExistingQty != 0){ + if ($NewQty == 1 AND $ExistingQty != 0){ prnMsg( '<a href="'.$rootpath.'/StockSerialItemResearch.php?serialno='. $NewSerialNo . '" target=_blank>'.$NewSerialNo. '</a> : '. _('The Serial Number being added exists with a Quantity that is not Zero (0)!'), 'error' ); $SerialError = true; - } elseif ($NewQty == -1 && $ExistingQty != 1){ + } elseif ($NewQty == -1 AND $ExistingQty != 1){ prnMsg( '<a href="'.$rootpath.'/StockSerialItemResearch.php?serialno='. $NewSerialNo . '" target=_blank>'.$NewSerialNo. '</a> : '. _('The Serial Number being removed exists with a Quantity that is not One (1)!'), 'error'); $SerialError = true; } } - + if (isset($_POST['ExpiryDate' . $i])){ + $ExpiryDate = $_POST['ExpiryDate' . $i]; + } else { + $ExpiryDate ='0000-00-00'; + } if (!$SerialError){ - $LineItem->SerialItems[$NewSerialNo] = new SerialItem ($_POST['SerialNo' . $i], $NewQty, $_POST['ExpiryDate' . $i]); + $LineItem->SerialItems[$NewSerialNo] = new SerialItem ($_POST['SerialNo' . $i], $NewQty, $ExpiryDate); } } } /* end if posted Serialno . i is not blank */ @@ -92,7 +96,7 @@ /******************************************** Add a Sequence of Items and save entries ********************************************/ -if ( isset($_POST['AddSequence']) && $_POST['AddSequence']!='') { +if ( isset($_POST['AddSequence']) AND $_POST['AddSequence']!='') { // do some quick validation $BeginNo = $_POST['BeginNo']; $EndNo = $_POST['EndNo']; @@ -151,7 +155,7 @@ } } else { //for controlled only items, we must receive: BatchID, Qty in a comma delimited file - if($pieces[0] != "" && $pieces[1] != "" && is_numeric($pieces[1]) && $pieces[1] > 0 ){ + if($pieces[0] != "" AND $pieces[1] != "" AND is_numeric($pieces[1]) AND $pieces[1] > 0 ){ /*If the user enters a duplicate batch number the later one over-writes the first entered one - no warning given though ? */ //$LineItem->SerialItems[$pieces[0]] = new SerialItem ($pieces[0], $pieces[1] ); @@ -198,10 +202,10 @@ $SerialError = false; if ($LineItem->Serialised){ $ExistingQty = ValidBundleRef($StockID, $LocationOut, $NewSerialNo); - if ($NewQty == 1 && $ExistingQty != 0){ + if ($NewQty == 1 AND $ExistingQty != 0){ prnMsg( '<a href="'.$rootpath.'/StockSerialItemResearch.php?serialno='. $NewSerialNo . '" target=_blank>'.$NewSerialNo. '</a>: '. _("The Serial Number being added exists with a Quantity that is not Zero (0)!"), 'error' ); $SerialError = true; - } elseif ($NewQty == -1 && $ExistingQty != 1){ + } elseif ($NewQty == -1 AND $ExistingQty != 1){ prnMsg( '<a href="'.$rootpath.'/StockSerialItemResearch.php?serialno='. $NewSerialNo . '" target=_blank>'.$NewSerialNo. '</a> : '. _("The Serial Number being removed exists with a Quantity that is not One (1)!"), 'error'); $SerialError = true; } @@ -248,7 +252,7 @@ } } else { //for controlled only items, we must receive: BatchID, Qty in a comma delimited file - if($Item->BundleRef != "" && $Item->BundleQty != "" && is_numeric($Item->BundleQty) && $Item->BundleQty > 0 ){ + if($Item->BundleRef != "" AND $Item->BundleQty != "" AND is_numeric($Item->BundleQty) AND $Item->BundleQty > 0 ){ /*If the user enters a duplicate batch number the later one over-writes the first entered one - no warning given though ? */ //$LineItem->SerialItems[$pieces[0]] = new SerialItem ($pieces[0], $pieces[1] ); @@ -295,10 +299,10 @@ $SerialError = false; if ($LineItem->Serialised){ $ExistingQty = ValidBundleRef($StockID, $LocationOut, $NewSerialNo); - if ($NewQty == 1 && $ExistingQty != 0){ + if ($NewQty == 1 AND $ExistingQty != 0){ prnMsg( '<a href="'.$rootpath.'/StockSerialItemResearch.php?serialno='. $NewSerialNo . '" target=_blank>'.$NewSerialNo. '</a>: '. _("The Serial Number being added exists with a Quantity that is not Zero (0)!"), 'error' ); $SerialError = true; - } elseif ($NewQty == -1 && $ExistingQty != 1){ + } elseif ($NewQty == -1 AND $ExistingQty != 1){ prnMsg( '<a href="'.$rootpath.'/StockSerialItemResearch.php?serialno='. $NewSerialNo . '" target=_blank>'.$NewSerialNo. '</a> : '. _("The Serial Number being removed exists with a Quantity that is not One (1)!"), 'error'); $SerialError = true; } Modified: trunk/includes/ConnectDB.inc =================================================================== --- trunk/includes/ConnectDB.inc 2011-09-17 07:49:08 UTC (rev 4693) +++ trunk/includes/ConnectDB.inc 2011-09-17 22:43:30 UTC (rev 4694) @@ -4,7 +4,7 @@ * this value is saved in the $_SESSION['Versionumber'] when includes/GetConfig.php is run * if VersionNumber is < $Version then the DB update script is run */ -$Version='4.05.1'; //must update manually every time there is a DB change +$Version='4.05.2'; //must update manually every time there is a DB change require_once ($PathPrefix .'includes/MiscFunctions.php'); Modified: trunk/includes/InputSerialItems.php =================================================================== --- trunk/includes/InputSerialItems.php 2011-09-17 07:49:08 UTC (rev 4693) +++ trunk/includes/InputSerialItems.php 2011-09-17 22:43:30 UTC (rev 4694) @@ -48,7 +48,7 @@ $invalid_imports = 0; $valid = true; -echo '<form method="post" action="' . $_SERVER['PHP_SELF'] . '?identifier=' . $identifier .'" enctype="multipart/form-data" >'; +echo '<form method="post" action="' . $_SERVER['PHP_SELF'] .'" enctype="multipart/form-data" >'; echo '<input type="hidden" name="FormID" value="' . $_SESSION['FormID'] . '" />'; echo '<input type=hidden name="LineNo" value="' . $LineNo . '">'; echo '<input type=hidden name="StockID" value="'. $StockID. '">'; @@ -84,9 +84,9 @@ global $tableheader; /* Link to clear the list and start from scratch */ -$EditLink = '<br /><div class="centre"><a href="' . $_SERVER['PHP_SELF'] . '?identifier=' . $identifier . '&EditControlled=true&StockID=' . $LineItem->StockID . +$EditLink = '<br /><div class="centre"><a href="' . $_SERVER['PHP_SELF'] . '?EditControlled=true&StockID=' . $LineItem->StockID . '&LineNo=' . $LineNo .'">'. _('Edit'). '</a> | '; -$RemoveLink = '<a href="' . $_SERVER['PHP_SELF'] . '?identifier=' . $identifier . '&DELETEALL=YES&StockID=' . $LineItem->StockID . +$RemoveLink = '<a href="' . $_SERVER['PHP_SELF'] . '?DELETEALL=YES&StockID=' . $LineItem->StockID . '&LineNo=' . $LineNo .'">'. _('Remove All'). '</a><br /></div>'; $sql="SELECT perishable FROM stockmaster Modified: trunk/includes/InputSerialItemsKeyed.php =================================================================== --- trunk/includes/InputSerialItemsKeyed.php 2011-09-17 07:49:08 UTC (rev 4693) +++ trunk/includes/InputSerialItemsKeyed.php 2011-09-17 22:43:30 UTC (rev 4694) @@ -50,13 +50,13 @@ echo '<td>' . $Bundle->BundleRef . '</td>'; if ($LineItem->Serialised==0 and $Perishable==0){ - echo '<td class=number>' . locale_number_format($Bundle->BundleQty, $LineItem->DecimalPlaces) . '</td>'; + echo '<td class="number">' . locale_number_format($Bundle->BundleQty, $LineItem->DecimalPlaces) . '</td>'; } else if ($LineItem->Serialised==0 and $Perishable==1){ - echo '<td class=number>' . locale_number_format($Bundle->BundleQty, $LineItem->DecimalPlaces) . '</td>'; - echo '<td class=number>' . $Bundle->ExpiryDate . '</td>'; + echo '<td class="number">' . locale_number_format($Bundle->BundleQty, $LineItem->DecimalPlaces) . '</td>'; + echo '<td class="number">' . $Bundle->ExpiryDate . '</td>'; } - echo '<td><a href="' . $_SERVER['PHP_SELF'] . '?identifier=' . $identifier . '&Delete=' . $Bundle->BundleRef . '&StockID=' . $LineItem->StockID . '&LineNo=' . $LineNo .'">'. _('Delete'). '</a></td></tr>'; + echo '<td><a href="' . $_SERVER['PHP_SELF'] . '?Delete=' . $Bundle->BundleRef . '&StockID=' . $LineItem->StockID . '&LineNo=' . $LineNo .'">'. _('Delete'). '</a></td></tr>'; $TotalQuantity += $Bundle->BundleQty; } @@ -64,27 +64,26 @@ /*Display the totals and rule off before allowing new entries */ if ($LineItem->Serialised==1){ - echo '<tr><td class=number><B>'. _('Total Quantity'). ': ' . locale_number_format($TotalQuantity,$LineItem->DecimalPlaces) . '</b></td></tr>'; + echo '<tr><td class="number"><B>'. _('Total Quantity'). ': ' . locale_number_format($TotalQuantity,$LineItem->DecimalPlaces) . '</b></td></tr>'; } else { - echo '<tr><td class=number><B>'. _('Total Quantity'). ':</b></td><td class=number><b>' . locale_number_format($TotalQuantity,$LineItem->DecimalPlaces) . '</b></td></tr>'; + echo '<tr><td class="number"><B>'. _('Total Quantity'). ':</b></td><td class="number"><b>' . locale_number_format($TotalQuantity,$LineItem->DecimalPlaces) . '</b></td></tr>'; } /*Close off old table */ -echo '</table></td><td valign=top>'; +echo '</table></td><td valign="top">'; /*Start a new table for the Serial/Batch ref input in one column (as a sub table then the multi select box for selection of existing bundle/serial nos for dispatch if applicable*/ //echo '<TABLE><TR><TD valign=TOP>'; /*in the first column add a table for the input of newies */ -echo '<table class=selection>'; +echo '<table class="selection">'; echo $tableheader; echo '<form action="' . $_SERVER['PHP_SELF'] . '" name="Ga6uF5Wa" method="post"> <input type=hidden name="LineNo" value="' . $LineNo . '"> <input type=hidden name="StockID" value="' . $StockID . '"> - <input type=hidden name="identifier" value="' . $identifier . '"> <input type=hidden name="EntryType" value="KEYED">'; echo '<input type="hidden" name="FormID" value="' . $_SESSION['FormID'] . '" />'; if ( isset($_GET['EditControlled']) ) { Modified: trunk/includes/LanguageSetup.php =================================================================== --- trunk/includes/LanguageSetup.php 2011-09-17 07:49:08 UTC (rev 4693) +++ trunk/includes/LanguageSetup.php 2011-09-17 22:43:30 UTC (rev 4694) @@ -30,7 +30,7 @@ } else { // it's a windows server $Locale = setlocale (LC_ALL, $LanguageArray[$_SESSION['Language']]['WindowsLocale']); } -//$Locale = setlocale (LC_NUMERIC, 'fr_FR.utf8'); +$Locale = setlocale (LC_NUMERIC, 'fr_FR.utf8'); $LocaleInfo = localeconv(); if ($LocaleInfo['mon_decimal_point']==''){ Modified: trunk/sql/mysql/upgrade4.05-4.06.sql =================================================================== --- trunk/sql/mysql/upgrade4.05-4.06.sql 2011-09-17 07:49:08 UTC (rev 4693) +++ trunk/sql/mysql/upgrade4.05-4.06.sql 2011-09-17 22:43:30 UTC (rev 4694) @@ -1,5 +1,5 @@ ALTER TABLE stockmaster DROP lastcurcostdate; ALTER TABLE stockmaster ADD lastcostupdate DATE NOT NULL; INSERT INTO `config` (`confname` ,`confvalue`) -VALUES ('InventoryManagerEmail', 'in...@yo...'); -UPDATE config SET confvalue='4.05.1' WHERE confname='VersionNumber'; \ No newline at end of file +VALUES ('InventoryManagerEmail', ''); +UPDATE config SET confvalue='4.05.2' WHERE confname='VersionNumber'; \ 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') . '! ' . _('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'); @@ -308,7 +305,7 @@ $Result = DB_Txn_Commit($db); - $ConfirmationText = _('A stock adjustment for'). ' ' . $_SESSION['Adjustment']->StockID . ' - ' . $_SESSION['Adjustment']->ItemDescription . ' '._('has been created from location').' ' . $_SESSION['Adjustment']->StockLocation .' '. _('for a quantity of') . ' ' . $_SESSION['Adjustment']->Quantity ; + $ConfirmationText = _('A stock adjustment for'). ' ' . $_SESSION['Adjustment']->StockID . ' - ' . $_SESSION['Adjustment']->ItemDescription . ' '._('has been created from location').' ' . $_SESSION['Adjustment']->StockLocation .' '. _('for a quantity of') . ' ' . locale_number_format($_SESSION['Adjustment']->Quantity,$_SESSION['Adjustment']->DecimalPlaces) ; prnMsg( $ConfirmationText,'success'); if ($_SESSION['InventoryManagerEmail']!=''){ @@ -323,22 +320,24 @@ }/* end if the user hit enter the adjustment */ -echo '<form action="'. $_SERVER['PHP_SELF'] . '?' . SID . '" method=post>'; +echo '<form action="'. $_SERVER['PHP_SELF'] . '" method=post>'; echo '<input type="hidden" name="FormID" value="' . $_SESSION['FormID'] . '" />'; if (!isset($_SESSION['Adjustment'])) { $StockID=''; $Controlled= 0; $Quantity = 0; + $DecimalPlaces =2; } else { $StockID = $_SESSION['Adjustment']->StockID; $Controlled = $_SESSION['Adjustment']->Controlled; $Quantity = $_SESSION['Adjustment']->Quantity; - $sql="SELECT materialcost, labourcost, overheadcost, units FROM stockmaster WHERE stockid='".$StockID."'"; + $sql="SELECT materialcost, labourcost, overheadcost, units, decimalplaces FROM stockmaster WHERE stockid='".$StockID."'"; $result=DB_query($sql, $db); $myrow=DB_fetch_array($result); $_SESSION['Adjustment']->PartUnit=$myrow['units']; $_SESSION['Adjustment']->StandardCost=$myrow['materialcost']+$myrow['labourcost']+$myrow['overheadcost']; + $DecimalPlaces = $myrow['decimalplaces']; } echo '<br /><table class=selection>'; echo '<tr><th colspan=4><font color=blue size=3>'._('Adjustment Details').'</font></th></tr>'; @@ -359,10 +358,10 @@ echo '<input type="text" name="StockCode" size=21 value="" maxlength=20>'; } echo '</td><td><input type=submit name="CheckCode" VALUE="'._('Check Part').'"></td></tr>'; -if (isset($_SESSION['Adjustment']) and mb_strlen($_SESSION['Adjustment']->ItemDescription)>1){ +if (isset($_SESSION['Adjustment']) AND mb_strlen($_SESSION['Adjustment']->ItemDescription)>1){ echo '<tr><td colspan=3><font color=BLUE size=3>' . $_SESSION['Adjustment']->ItemDescription . ' ('._('In Units of').' ' . $_SESSION['Adjustment']->PartUnit . ' ) - ' . _('Unit Cost').' = ' . - locale_number_format($_SESSION['Adjustment']->StandardCost,4) . '</font></td></tr>'; + locale_money_format($_SESSION['Adjustment']->StandardCost,4) . '</font></td></tr>'; } echo '<tr><td>'. _('Adjustment to Stock At Location').':</td> @@ -373,25 +372,28 @@ while ($myrow=DB_fetch_array($resultStkLocs)){ if (isset($_SESSION['Adjustment']->StockLocation)){ if ($myrow['loccode'] == $_SESSION['Adjustment']->StockLocation){ - echo '<option selected Value="' . $myrow['loccode'] . '">' . $myrow['locationname']; + echo '<option selected value="' . $myrow['loccode'] . '">' . $myrow['locationname']; } else { - echo '<option Value="' . $myrow['loccode'] . '">' . $myrow['locationname']; + echo '<option value="' . $myrow['loccode'] . '">' . $myrow['locationname']; } } elseif ($myrow['loccode']==$_SESSION['UserStockLocation']){ - echo '<option selected Value="' . $myrow['loccode'] . '">' . $myrow['locationname']; + echo '<option selected value="' . $myrow['loccode'] . '">' . $myrow['locationname']; $_POST['StockLocation']=$myrow['loccode']; } else { - echo '<option Value="' . $myrow['loccode'] . '">' . $myrow['locationname']; + echo '<option value="' . $myrow['loccode'] . '">' . $myrow['locationname']; } } echo '</select></td></tr>'; -if (isset($_SESSION['Adjustment']) and !isset($_SESSION['Adjustment']->Narrative)) { +if (isset($_SESSION['Adjustment']) AND !isset($_SESSION['Adjustment']->Narrative)) { $_SESSION['Adjustment']->Narrative = ''; + $Narrative =''; +} else { + $Narrative =''; } echo '<tr><td>'. _('Comments On Why').':</td> - <td><input type="text" name="Narrative" size=32 maxlength=30 value="' . $_SESSION['Adjustment']->Narrative . '"></td></tr>'; + <td><input type="text" name="Narrative" size=32 maxlength=30 value="' . $Narrative . '"></td></tr>'; echo '<tr><td>'._('Adjustment Quantity').':</td>'; @@ -400,26 +402,26 @@ if ($_SESSION['Adjustment']->StockLocation == ''){ $_SESSION['Adjustment']->StockLocation = $_SESSION['UserStockLocation']; } - echo '<input type="HIDDEN" name="Quantity" Value="' . $_SESSION['Adjustment']->Quantity . '"> - '.$_SESSION['Adjustment']->Quantity.' - [<a href="'.$rootpath.'/StockAdjustmentsControlled.php?AdjType=REMOVE&' . SID . '">'._('Remove').'</a>] - [<a href="'.$rootpath.'/StockAdjustmentsControlled.php?AdjType=ADD&' . SID . '">'._('Add').'</a>]'; + echo '<input type="hidden" name="Quantity" value="' . $_SESSION['Adjustment']->Quantity . '"> + '.locale_number_format($_SESSION['Adjustment']->Quantity,$DecimalPlaces) .' + [<a href="'.$rootpath.'/StockAdjustmentsControlled.php?AdjType=REMOVE">'._('Remove').'</a>] + [<a href="'.$rootpath.'/StockAdjustmentsControlled.php?AdjType=ADD">'._('Add').'</a>]'; } else { - echo '<input type="text" class="number" name="Quantity" size=12 maxlength=12 Value="' . $Quantity . '">'; + echo '<input type="text" class="number" name="Quantity" size="12" maxlength="12" value="' . locale_number_format($Quantity,$DecimalPlaces) . '">'; } echo '</td></tr>'; //Select the tag echo '<tr><td>'._('Select Tag').'</td><td><select name="tag">'; -$SQL = 'SELECT tagref, +$SQL = "SELECT tagref, tagdescription FROM tags - ORDER BY tagref'; + ORDER BY tagref"; $result=DB_query($SQL,$db); -echo '<option value=0>0 - None'; +echo '<option value=0>0 - ' . _('None') . '</option>'; while ($myrow=DB_fetch_array($result)){ - if (isset($_SESSION['Adjustment']->tag) and $_SESSION['Adjustment']->tag==$myrow['tagref']){ + if (isset($_SESSION['Adjustment']->tag) AND $_SESSION['Adjustment']->tag==$myrow['tagref']){ echo '<option selected value=' . $myrow['tagref'] . '>' . $myrow['tagref'].' - ' .$myrow['tagdescription'] . '</option>'; } else { echo '<option value=' . $myrow['tagref'] . '>' . $myrow['tagref'].' - ' .$myrow['tagdescription']. '</option>'; @@ -428,7 +430,7 @@ echo '</select></td>'; // End select tag -echo '</table><div class="centre"><br /><input type=submit name="EnterAdjustment" value="'. _('Enter Stock Adjustment'). '"><br />'; +echo '</table><div class="centre"><br /><input type="submit" name="EnterAdjustment" value="'. _('Enter Stock Adjustment'). '"><br />'; if (!isset($_POST['StockLocation'])) { $_POST['StockLocation']=''; Modified: trunk/UpgradeDatabase.php =================================================================== --- trunk/UpgradeDatabase.php 2011-09-17 07:49:08 UTC (rev 4693) +++ trunk/UpgradeDatabase.php 2011-09-17 22:43:30 UTC (rev 4694) @@ -112,6 +112,7 @@ $SQLScripts[] = './sql/mysql/upgrade4.04.5-4.05.sql'; case '4.05': case '4.05.1': + case '4.05.2': $SQLScripts[] = './sql/mysql/upgrade4.05-4.06.sql'; case '4.06': break; Modified: trunk/WWW_Users.php =================================================================== --- trunk/WWW_Users.php 2011-09-17 07:49:08 UTC (rev 4693) +++ trunk/WWW_Users.php 2011-09-17 22:43:30 UTC (rev 4694) @@ -133,13 +133,13 @@ $UpdatePassword = "password='" . CryptPass($_POST['Password']) . "',"; } - $sql = "UPDATE www_users SET realname='" . $_POST['RealName'] . "', - customerid='" . $_POST['Cust'] ."', - phone='" . $_POST['Phone'] ."', - email='" . $_POST['Email'] ."', + $sql = "UPDATE www_users SET realname='" . DB_escape_string($_POST['RealName']) . "', + customerid='" . DB_escape_string($_POST['Cust']) ."', + phone='" . DB_escape_string($_POST['Phone']) ."', + email='" . DB_escape_string($_POST['Email'] ."', " . $UpdatePassword . " - branchcode='" . $_POST['BranchCode'] . "', - supplierid='" . $_POST['SupplierID'] . "', + branchcode='" . DB_escape_string($_POST['BranchCode']) . "', + supplierid='" . DB_escape_string($_POST['SupplierID']) . "', salesman='" . $_POST['Salesman'] . "', pagesize='" . $_POST['PageSize'] . "', fullaccess='" . $_POST['Access'] . "', @@ -171,15 +171,15 @@ theme, language, pdflanguage) - VALUES ('" . $_POST['UserID'] . "', - '" . $_POST['RealName'] ."', - '" . $_POST['Cust'] ."', - '" . $_POST['BranchCode'] ."', - '" . $_POST['SupplierID'] ."', + VALUES ('" . DB_escape_string($_POST['UserID']) . "', + '" . DB_escape_string($_POST['RealName']) ."', + '" . DB_escape_string($_POST['Cust']) ."', + '" . DB_escape_string($_POST['BranchCode']) ."', + '" . DB_escape_string($_POST['SupplierID']) ."', '" . $_POST['Salesman'] . "', '" . CryptPass($_POST['Password']) ."', - '" . $_POST['Phone'] . "', - '" . $_POST['Email'] ."', + '" . DB_escape_string($_POST['Phone']) . "', + '" . DB_escape_string($_POST['Email']) ."', '" . $_POST['PageSize'] ."', '" . $_POST['Access'] . "', '" . $_POST['DefaultLocation'] ."', Modified: trunk/doc/Change.log =================================================================== --- trunk/doc/Change.log 2011-09-17 07:49:08 UTC (rev 4693) +++ trunk/doc/Change.log 2011-09-17 22:43:30 UTC (rev 4694) @@ -1,5 +1,6 @@ webERP Change Log +17/9/11 Phil: Added WindowsLocale element to LanguagesArray.php and modified UserSettings.php and WWW_Users.php to use the new array definition. Also modified includes/LanguageSetup.php to use the windows locale string in the LanguagesArray as required for proper setting of the locale under windows. 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. Modified: trunk/includes/Add_SerialItems.php =================================================================== --- trunk/includes/Add_SerialItems.php 2011-09-17 07:49:08 UTC (rev 4693) +++ trunk/includes/Add_SerialItems.php 2011-09-17 22:43:30 UTC (rev 4694) @@ -56,17 +56,21 @@ if ($LineItem->Serialised){ $ExistingQty = ValidBundleRef($StockID, $LocationOut, $NewSerialNo); - if ($NewQty == 1 && $ExistingQty != 0){ + if ($NewQty == 1 AND $ExistingQty != 0){ prnMsg( '<a href="'.$rootpath.'/StockSerialItemResearch.php?serialno='. $NewSerialNo . '" target=_blank>'.$NewSerialNo. '</a> : '. _('The Serial Number being added exists with a Quantity that is not Zero (0)!'), 'error' ); $SerialError = true; - } elseif ($NewQty == -1 && $ExistingQty != 1){ + } elseif ($NewQty == -1 AND $ExistingQty != 1){ prnMsg( '<a href="'.$rootpath.'/StockSerialItemResearch.php?serialno='. $NewSerialNo . '" target=_blank>'.$NewSerialNo. '</a> : '. _('The Serial Number being removed exists with a Quantity that is not One (1)!'), 'error'); $SerialError = true; } } - + if (isset($_POST['ExpiryDate' . $i])){ + $ExpiryDate = $_POST['ExpiryDate' . $i]; + } else { + $ExpiryDate ='0000-00-00'; + } if (!$SerialError){ - $LineItem->SerialItems[$NewSerialNo] = new SerialItem ($_POST['SerialNo' . $i], $NewQty, $_POST['ExpiryDate' . $i]); + $LineItem->SerialItems[$NewSerialNo] = new SerialItem ($_POST['SerialNo' . $i], $NewQty, $ExpiryDate); } } } /* end if posted Serialno . i is not blank */ @@ -92,7 +96,7 @@ /******************************************** Add a Sequence of Items and save entries ********************************************/ -if ( isset($_POST['AddSequence']) && $_POST['AddSequence']!='') { +if ( isset($_POST['AddSequence']) AND $_POST['AddSequence']!='') { // do some quick validation $BeginNo = $_POST['BeginNo']; $EndNo = $_POST['EndNo']; @@ -151,7 +155,7 @@ } } else { //for controlled only items, we must receive: BatchID, Qty in a comma delimited file - if($pieces[0] != "" && $pieces[1] != "" && is_numeric($pieces[1]) && $pieces[1] > 0 ){ + if($pieces[0] != "" AND $pieces[1] != "" AND is_numeric($pieces[1]) AND $pieces[1] > 0 ){ /*If the user enters a duplicate batch number the later one over-writes the first entered one - no warning given though ? */ //$LineItem->SerialItems[$pieces[0]] = new SerialItem ($pieces[0], $pieces[1] ); @@ -198,10 +202,10 @@ $SerialError = false; if ($LineItem->Serialised){ $ExistingQty = ValidBundleRef($StockID, $LocationOut, $NewSerialNo); - if ($NewQty == 1 && $ExistingQty != 0){ + if ($NewQty == 1 AND $ExistingQty != 0){ prnMsg( '<a href="'.$rootpath.'/StockSerialItemResearch.php?serialno='. $NewSerialNo . '" target=_blank>'.$NewSerialNo. '</a>: '. _("The Serial Number being added exists with a Quantity that is not Zero (0)!"), 'error' ); $SerialError = true; - } elseif ($NewQty == -1 && $ExistingQty != 1){ + } elseif ($NewQty == -1 AND $ExistingQty != 1){ prnMsg( '<a href="'.$rootpath.'/StockSerialItemResearch.php?serialno='. $NewSerialNo . '" target=_blank>'.$NewSerialNo. '</a> : '. _("The Serial Number being removed exists with a Quantity that is not One (1)!"), 'error'); $SerialError = true; } @@ -248,7 +252,7 @@ } } else { //for controlled only items, we must receive: BatchID, Qty in a comma delimited file - if($Item->BundleRef != "" && $Item->BundleQty != "" && is_numeric($Item->BundleQty) && $Item->BundleQty > 0 ){ + if($Item->BundleRef != "" AND $Item->BundleQty != "" AND is_numeric($Item->BundleQty) AND $Item->BundleQty > 0 ){ /*If the user enters a duplicate batch number the later one over-writes the first entered one - no warning given though ? */ //$LineItem->SerialItems[$pieces[0]] = new SerialItem ($pieces[0], $pieces[1] ); @@ -295,10 +299,10 @@ $SerialError = false; if ($LineItem->Serialised){ $ExistingQty = ValidBundleRef($StockID, $LocationOut, $NewSerialNo); - if ($NewQty == 1 && $ExistingQty != 0){ + if ($NewQty == 1 AND $ExistingQty != 0){ prnMsg( '<a href="'.$rootpath.'/StockSerialItemResearch.php?serialno='. $NewSerialNo . '" target=_blank>'.$NewSerialNo. '</a>: '. _("The Serial Number being added exists with a Quantity that is not Zero (0)!"), 'error' ); $SerialError = true; - } elseif ($NewQty == -1 && $ExistingQty != 1){ + } elseif ($NewQty == -1 AND $ExistingQty != 1){ prnMsg( '<a href="'.$rootpath.'/StockSerialItemResearch.php?serialno='. $NewSerialNo . '" target=_blank>'.$NewSerialNo. '</a> : '. _("The Serial Number being removed exists with a Quantity that is not One (1)!"), 'error'); $SerialError = true; } Modified: trunk/includes/ConnectDB.inc =================================================================== --- trunk/includes/ConnectDB.inc 2011-09-17 07:49:08 UTC (rev 4693) +++ trunk/includes/ConnectDB.inc 2011-09-17 22:43:30 UTC (rev 4694) @@ -4,7 +4,7 @@ * this value is saved in the $_SESSION['Versionumber'] when includes/GetConfig.php is run * if VersionNumber is < $Version then the DB update script is run */ -$Version='4.05.1'; //must update manually every time there is a DB change +$Version='4.05.2'; //must update manually every time there is a DB change require_once ($PathPrefix .'includes/MiscFunctions.php'); Modified: trunk/includes/InputSerialItems.php =================================================================== --- trunk/includes/InputSerialItems.php 2011-09-17 07:49:08 UTC (rev 4693) +++ trunk/includes/InputSerialItems.php 2011-09-17 22:43:30 UTC (rev 4694) @@ -48,7 +48,7 @@ $invalid_imports = 0; $valid = true; -echo '<form method="post" action="' . $_SERVER['PHP_SELF'] . '?identifier=' . $identifier .'" enctype="multipart/form-data" >'; +echo '<form method="post" action="' . $_SERVER['PHP_SELF'] .'" enctype="multipart/form-data" >'; echo '<input type="hidden" name="FormID" value="' . $_SESSION['FormID'] . '" />'; echo '<input type=hidden name="LineNo" value="' . $LineNo . '">'; echo '<input type=hidden name="StockID" value="'. $StockID. '">'; @@ -84,9 +84,9 @@ global $tableheader; /* Link to clear the list and start from scratch */ -$EditLink = '<br /><div class="centre"><a href="' . $_SERVER['PHP_SELF'] . '?identifier=' . $identifier . '&EditControlled=true&StockID=' . $LineItem->StockID . +$EditLink = '<br /><div class="centre"><a href="' . $_SERVER['PHP_SELF'] . '?EditControlled=true&StockID=' . $LineItem->StockID . '&LineNo=' . $LineNo .'">'. _('Edit'). '</a> | '; -$RemoveLink = '<a href="' . $_SERVER['PHP_SELF'] . '?identifier=' . $identifier . '&DELETEALL=YES&StockID=' . $LineItem->StockID . +$RemoveLink = '<a href="' . $_SERVER['PHP_SELF'] . '?DELETEALL=YES&StockID=' . $LineItem->StockID . '&LineNo=' . $LineNo .'">'. _('Remove All'). '</a><br /></div>'; $sql="SELECT perishable FROM stockmaster Modified: trunk/includes/InputSerialItemsKeyed.php =================================================================== --- trunk/includes/InputSerialItemsKeyed.php 2011-09-17 07:49:08 UTC (rev 4693) +++ trunk/includes/InputSerialItemsKeyed.php 2011-09-17 22:43:30 UTC (rev 4694) @@ -50,13 +50,13 @@ echo '<td>' . $Bundle->BundleRef . '</td>'; if ($LineItem->Serialised==0 and $Perishable==0){ - echo '<td class=number>' . locale_number_format($Bundle->BundleQty, $LineItem->DecimalPlaces) . '</td>'; + echo '<td class="number">' . locale_number_format($Bundle->BundleQty, $LineItem->DecimalPlaces) . '</td>'; } else if ($LineItem->Serialised==0 and $Perishable==1){ - echo '<td class=number>' . locale_number_format($Bundle->BundleQty, $LineItem->DecimalPlaces) . '</td>'; - echo '<td class=number>' . $Bundle->ExpiryDate . '</td>'; + echo '<td class="number">' . locale_number_format($Bundle->BundleQty, $LineItem->DecimalPlaces) . '</td>'; + echo '<td class="number">' . $Bundle->ExpiryDate . '</td>'; } - echo '<td><a href="' . $_SERVER['PHP_SELF'] . '?identifier=' . $identifier . '&Delete=' . $Bundle->BundleRef . '&StockID=' . $LineItem->StockID . '&LineNo=' . $LineNo .'">'. _('Delete'). '</a></td></tr>'; + echo '<td><a href="' . $_SERVER['PHP_SELF'] . '?Delete=' . $Bundle->BundleRef . '&StockID=' . $LineItem->StockID . '&LineNo=' . $LineNo .'">'. _('Delete'). '</a></td></tr>'; $TotalQuantity += $Bundle->BundleQty; } @@ -64,27 +64,26 @@ /*Display the totals and rule off before allowing new entries */ if ($LineItem->Serialised==1){ - echo '<tr><td class=number><B>'. _('Total Quantity'). ': ' . locale_number_format($TotalQuantity,$LineItem->DecimalPlaces) . '</b></td></tr>'; + echo '<tr><td class="number"><B>'. _('Total Quantity'). ': ' . locale_number_format($TotalQuantity,$LineItem->DecimalPlaces) . '</b></td></tr>'; } else { - echo '<tr><td class=number><B>'. _('Total Quantity'). ':</b></td><td class=number><b>' . locale_number_format($TotalQuantity,$LineItem->DecimalPlaces) . '</b></td></tr>'; + echo '<tr><td class="number"><B>'. _('Total Quantity'). ':</b></td><td class="number"><b>' . locale_number_format($TotalQuantity,$LineItem->DecimalPlaces) . '</b></td></tr>'; } /*Close off old table */ -echo '</table></td><td valign=top>'; +echo '</table></td><td valign="top">'; /*Start a new table for the Serial/Batch ref input in one column (as a sub table then the multi select box for selection of existing bundle/serial nos for dispatch if applicable*/ //echo '<TABLE><TR><TD valign=TOP>'; /*in the first column add a table for the input of newies */ -echo '<table class=selection>'; +echo '<table class="selection">'; echo $tableheader; echo '<form action="' . $_SERVER['PHP_SELF'] . '" name="Ga6uF5Wa" method="post"> <input type=hidden name="LineNo" value="' . $LineNo . '"> <input type=hidden name="StockID" value="' . $StockID . '"> - <input type=hidden name="identifier" value="' . $identifier . '"> <input type=hidden name="EntryType" value="KEYED">'; echo '<input type="hidden" name="FormID" value="' . $_SESSION['FormID'] . '" />'; if ( isset($_GET['EditControlled']) ) { Modified: trunk/includes/LanguageSetup.php =================================================================== --- trunk/includes/LanguageSetup.php 2011-09-17 07:49:08 UTC (rev 4693) +++ trunk/includes/LanguageSetup.php 2011-09-17 22:43:30 UTC (rev 4694) @@ -30,7 +30,7 @@ } else { // it's a windows server $Locale = setlocale (LC_ALL, $LanguageArray[$_SESSION['Language']]['WindowsLocale']); } -//$Locale = setlocale (LC_NUMERIC, 'fr_FR.utf8'); +$Locale = setlocale (LC_NUMERIC, 'fr_FR.utf8'); $LocaleInfo = localeconv(); if ($LocaleInfo['mon_decimal_point']==''){ Modified: trunk/sql/mysql/upgrade4.05-4.06.sql =================================================================== --- trunk/sql/mysql/upgrade4.05-4.06.sql 2011-09-17 07:49:08 UTC (rev 4693) +++ trunk/sql/mysql/upgrade4.05-4.06.sql 2011-09-17 22:43:30 UTC (rev 4694) @@ -1,5 +1,5 @@ ALTER TABLE stockmaster DROP lastcurcostdate; ALTER TABLE stockmaster ADD lastcostupdate DATE NOT NULL; INSERT INTO `config` (`confname` ,`confvalue`) -VALUES ('InventoryManagerEmail', 'in...@yo...'); -UPDATE config SET confvalue='4.05.1' WHERE confname='VersionNumber'; \ No newline at end of file +VALUES ('InventoryManagerEmail', ''); +UPDATE config SET confvalue='4.05.2' WHERE confname='VersionNumber'; \ 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-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. |