This list is closed, nobody may subscribe to it.
2011 |
Jan
(14) |
Feb
(42) |
Mar
(56) |
Apr
(60) |
May
(54) |
Jun
(48) |
Jul
(74) |
Aug
(52) |
Sep
(68) |
Oct
(64) |
Nov
(42) |
Dec
(62) |
---|---|---|---|---|---|---|---|---|---|---|---|---|
2012 |
Jan
(142) |
Feb
(270) |
Mar
(374) |
Apr
(230) |
May
(214) |
Jun
(116) |
Jul
(234) |
Aug
(66) |
Sep
(120) |
Oct
(16) |
Nov
(17) |
Dec
(41) |
2013 |
Jan
(19) |
Feb
(18) |
Mar
(8) |
Apr
(40) |
May
(121) |
Jun
(42) |
Jul
(127) |
Aug
(145) |
Sep
(27) |
Oct
(38) |
Nov
(83) |
Dec
(61) |
2014 |
Jan
(33) |
Feb
(35) |
Mar
(59) |
Apr
(41) |
May
(38) |
Jun
(45) |
Jul
(17) |
Aug
(58) |
Sep
(46) |
Oct
(51) |
Nov
(55) |
Dec
(36) |
2015 |
Jan
(57) |
Feb
(67) |
Mar
(70) |
Apr
(34) |
May
(32) |
Jun
(11) |
Jul
(3) |
Aug
(17) |
Sep
(16) |
Oct
(13) |
Nov
(30) |
Dec
(30) |
2016 |
Jan
(17) |
Feb
(12) |
Mar
(17) |
Apr
(20) |
May
(47) |
Jun
(15) |
Jul
(13) |
Aug
(30) |
Sep
(32) |
Oct
(20) |
Nov
(32) |
Dec
(24) |
2017 |
Jan
(16) |
Feb
|
Mar
(11) |
Apr
(11) |
May
(5) |
Jun
(42) |
Jul
(9) |
Aug
(10) |
Sep
(14) |
Oct
(15) |
Nov
(2) |
Dec
(29) |
2018 |
Jan
(28) |
Feb
(49) |
Mar
|
Apr
|
May
|
Jun
|
Jul
|
Aug
|
Sep
|
Oct
|
Nov
|
Dec
|
From: <dai...@us...> - 2011-09-12 08:57:18
|
Revision: 4687 http://web-erp.svn.sourceforge.net/web-erp/?rev=4687&view=rev Author: daintree Date: 2011-09-12 08:57:11 +0000 (Mon, 12 Sep 2011) Log Message: ----------- number_formatting Modified Paths: -------------- trunk/StockTransfers.php Modified: trunk/StockTransfers.php =================================================================== --- trunk/StockTransfers.php 2011-09-12 08:03:20 UTC (rev 4686) +++ trunk/StockTransfers.php 2011-09-12 08:57:11 UTC (rev 4687) @@ -18,7 +18,7 @@ if (isset($_GET['From'])) { $_POST['StockLocationFrom']=$_GET['From']; $_POST['StockLocationTo']=$_GET['To']; - $_POST['Quantity']=$_GET['Quantity']; + $_POST['Quantity']=filter_number_format($_GET['Quantity']); } if (isset($_POST['CheckCode'])) { @@ -27,21 +27,27 @@ '" alt="" />' . ' ' . _('Select Item to Transfer') . '</p>'; if (mb_strlen($_POST['StockText'])>0) { - $sql="SELECT stockid, description from stockmaster where description " . LIKE . " '%" . $_POST['StockText'] . "%'"; + $sql="SELECT stockid, + description + FROM stockmaster + WHERE description " . LIKE . " '%" . $_POST['StockText'] . "%'"; } else { - $sql="SELECT stockid, description from stockmaster where stockid " . LIKE . " '%" . $_POST['StockCode']."%'"; + $sql="SELECT stockid, + description + FROM stockmaster + WHERE stockid " . LIKE . " '%" . $_POST['StockCode']."%'"; } $ErrMsg=_('The stock information cannot be retrieved because'); $DbgMsg=_('The SQL to get the stock description was'); $result = DB_query($sql,$db,$ErrMsg,$DbgMsg); - echo '<table class=selection> + echo '<table class="selection"> <tr><th>'._('Stock Code').'</th> <th>'._('Stock Description').'</th> </tr>'; while ($myrow = DB_fetch_array($result)) { echo '<tr><td>'.$myrow['stockid'].'</td> <td>'.$myrow['description'].'</td> - <td><a href="' . $rootpath . '/StockTransfers.php?StockID='.$myrow['stockid'].'&Description='.$myrow['description'].'&NewTransfer=Yes&Quantity='.$_POST['Quantity'].'&From='.$_POST['StockLocationFrom'].'&To='.$_POST['StockLocationTo'].'">' + <td><a href="' . $rootpath . '/StockTransfers.php?StockID='.$myrow['stockid'].'&Description='.$myrow['description'].'&NewTransfer=Yes&Quantity='. filter_number_format($_POST['Quantity']).'&From='.$_POST['StockLocationFrom'].'&To='.$_POST['StockLocationTo'].'">' ._('Transfer').'</a></td> </tr>'; @@ -61,11 +67,8 @@ if (isset($_GET['StockID'])){ /*carry the stockid through to the form for additional inputs */ - $_POST['StockID'] = trim(mb_strtoupper($_GET['StockID'])); - } elseif (isset($_POST['StockID'])){ /* initiate a new transfer only if the StockID is different to the previous entry */ - if (isset($_SESSION['Transfer']) AND $_POST['StockID'] != $_SESSION['Transfer']->TransferItem[0]->StockID){ unset($_SESSION['Transfer']); $NewTransfer = true; @@ -99,7 +102,7 @@ $myrow = DB_fetch_row($result); $_SESSION['Transfer']->TransferItem[0] = new LineItem ( trim(mb_strtoupper($_POST['StockID'])), $myrow['description'], - $_POST['Quantity'], + filter_number_format($_POST['Quantity']), $myrow['units'], $myrow['controlled'], $myrow['serialised'], @@ -107,27 +110,26 @@ $myrow['decimalplaces']); - $_SESSION['Transfer']->TransferItem[0]->StandardCost = $myrow[3]; + $_SESSION['Transfer']->TransferItem[0]->StandardCost = $myrow['standardcost']; if ($myrow[2]=='D' OR $myrow[2]=='A' OR $myrow[2]=='K'){ prnMsg(_('The part entered is either or a dummy part or an assembly or a kit-set part') . '. ' . _('These parts are not physical parts and no stock holding is maintained for them') . '. ' . _('Stock Transfers are therefore not possible'),'warn'); - echo '.<hr>'; + echo '.<hr />'; echo '<a href="' . $rootpath . '/StockTransfers.php?NewTransfer=Yes">' . _('Enter another Transfer') . '</a>'; unset ($_SESSION['Transfer']); include ('includes/footer.inc'); exit; } } - } if (isset($_POST['Quantity']) AND isset($_SESSION['Transfer']->TransferItem[0]->Controlled) AND $_SESSION['Transfer']->TransferItem[0]->Controlled==0){ - $_SESSION['Transfer']->TransferItem[0]->Quantity = $_POST['Quantity']; + $_SESSION['Transfer']->TransferItem[0]->Quantity = filter_number_format($_POST['Quantity']); } if ( isset($_POST['StockLocationFrom']) AND $_POST['StockLocationFrom']!= $_SESSION['Transfer']->StockLocationFrom ){ $_SESSION['Transfer']->StockLocationFrom = $_POST['StockLocationFrom']; $_SESSION['Transfer']->StockLocationTo = $_POST['StockLocationTo']; - $_SESSION['Transfer']->TransferItem[0]->Quantity=$_POST['Quantity']; + $_SESSION['Transfer']->TransferItem[0]->Quantity=filter_number_format($_POST['Quantity']); $_SESSION['Transfer']->TransferItem[0]->SerialItems=array(); } if ( isset($_POST['StockLocationTo']) ){ @@ -136,8 +138,6 @@ if ( isset($_POST['EnterTransfer']) ){ - - $result = DB_query("SELECT * FROM stockmaster WHERE stockid='" . $_SESSION['Transfer']->TransferItem[0]->StockID ."'",$db); $myrow = DB_fetch_row($result); $InputError = false; @@ -193,25 +193,25 @@ } // 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) - VALUES ( - '" . $_SESSION['Transfer']->TransferItem[0]->StockID . "', - 16, - '" . $TransferNumber . "', - '" . $_SESSION['Transfer']->StockLocationFrom . "', - '" . $SQLTransferDate . "', - '" . $PeriodNo . "', - 'To " . $_SESSION['Transfer']->StockLocationTo ."', - '" . round(-$_SESSION['Transfer']->TransferItem[0]->Quantity,$_SESSION['Transfer']->TransferItem[0]->DecimalPlaces) . "', - '" . ($QtyOnHandPrior - round($_SESSION['Transfer']->TransferItem[0]->Quantity,$_SESSION['Transfer']->TransferItem[0]->DecimalPlaces)) ."' - )"; + type, + transno, + loccode, + trandate, + prd, + reference, + qty, + newqoh) + VALUES ( + '" . $_SESSION['Transfer']->TransferItem[0]->StockID . "', + 16, + '" . $TransferNumber . "', + '" . $_SESSION['Transfer']->StockLocationFrom . "', + '" . $SQLTransferDate . "', + '" . $PeriodNo . "', + 'To " . $_SESSION['Transfer']->StockLocationTo ."', + '" . filter_number_format(round(-$_SESSION['Transfer']->TransferItem[0]->Quantity,$_SESSION['Transfer']->TransferItem[0]->DecimalPlaces)) . "', + '" . filter_number_format($QtyOnHandPrior - round($_SESSION['Transfer']->TransferItem[0]->Quantity,$_SESSION['Transfer']->TransferItem[0]->DecimalPlaces)) ."' + )"; $ErrMsg = _('CRITICAL ERROR') . '! ' . _('NOTE DOWN THIS ERROR AND SEEK ASSISTANCE') . ': ' . _('The stock movement record cannot be inserted because'); $DbgMsg = _('The following SQL to insert the stock movement record was used'); @@ -229,11 +229,11 @@ /*First need to check if the serial items already exists or not in the location from */ $SQL = "SELECT COUNT(*) - FROM stockserialitems - WHERE - stockid='" . $_SESSION['Transfer']->TransferItem[0]->StockID . "' - AND loccode='" . $_SESSION['Transfer']->StockLocationFrom . "' - AND serialno='" . $Item->BundleRef . "'"; + FROM stockserialitems + WHERE + stockid='" . $_SESSION['Transfer']->TransferItem[0]->StockID . "' + AND loccode='" . $_SESSION['Transfer']->StockLocationFrom . "' + AND serialno='" . $Item->BundleRef . "'"; $ErrMsg = _('The entered item code does not exist'); $Result = DB_query($SQL,$db,$ErrMsg); @@ -242,7 +242,7 @@ if ($SerialItemExistsRow[0]==1){ $SQL = "UPDATE stockserialitems - SET quantity= quantity - '" . $Item->BundleQty . "', + SET quantity= quantity - '" . filter_number_format($Item->BundleQty) . "', expirationdate='" . FormatDateForSQL($Item->ExpiryDate) . "' WHERE stockid='" . $_SESSION['Transfer']->TransferItem[0]->StockID . "' AND loccode='" . $_SESSION['Transfer']->StockLocationFrom . "' @@ -260,9 +260,9 @@ quantity) VALUES ('" . $_SESSION['Transfer']->TransferItem[0]->StockID . "', '" . $_SESSION['Transfer']->StockLocationFrom . "', - '" . $Item->BundleRef . "', + '" . DB_escape_string($Item->BundleRef) . "', '" . FormatDateForSQL($Item->ExpiryDate) . "', - '" . -$Item->BundleQty . "')"; + '" . filter_number_format(-$Item->BundleQty) . "')"; $ErrMsg = _('CRITICAL ERROR') . '! ' . _('NOTE DOWN THIS ERROR AND SEEK ASSISTANCE') . ': ' . _('The serial stock item record could not be added because'); $DbgMsg = _('The following SQL to insert the serial stock item record was used'); @@ -280,8 +280,8 @@ VALUES ( '" . $StkMoveNo . "', '" . $_SESSION['Transfer']->TransferItem[0]->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'); @@ -325,8 +325,7 @@ '" . $PeriodNo . "', '" . _('From') . " " . $_SESSION['Transfer']->StockLocationFrom . "', '" . $_SESSION['Transfer']->TransferItem[0]->Quantity . "', - '" . ($QtyOnHandPrior + $_SESSION['Transfer']->TransferItem[0]->Quantity) . "' - )"; + '" . filter_number_format(round($QtyOnHandPrior + $_SESSION['Transfer']->TransferItem[0]->Quantity,$_SESSION['Transfer']->TransferItem[0]->DecimalPlaces)) . "')"; $ErrMsg = _('CRITICAL ERROR') . '! ' . _('NOTE DOWN THIS ERROR AND SEEK ASSISTANCE') . ': ' . _('The stock movement record cannot be inserted because'); $DbgMsg = _('The following SQL to insert the stock movement record was used'); @@ -344,11 +343,10 @@ /*First need to check if the serial items already exists or not in the location from */ $SQL = "SELECT COUNT(*) - FROM stockserialitems - WHERE - stockid='" . $_SESSION['Transfer']->TransferItem[0]->StockID . "' - AND loccode='" . $_SESSION['Transfer']->StockLocationTo . "' - AND serialno='" . $Item->BundleRef . "'"; + FROM stockserialitems + WHERE stockid='" . $_SESSION['Transfer']->TransferItem[0]->StockID . "' + AND loccode='" . $_SESSION['Transfer']->StockLocationTo . "' + AND serialno='" . $Item->BundleRef . "'"; $ErrMsg = _('Could not determine if the serial item exists in the transfer to location'); $Result = DB_query($SQL,$db,$ErrMsg); @@ -357,11 +355,11 @@ if ($SerialItemExistsRow[0]==1){ $SQL = "UPDATE stockserialitems - SET quantity= quantity + '" . $Item->BundleQty . "', - expirationdate='" . FormatDateForSQL($Item->ExpiryDate) . "' + SET quantity= quantity + '" . filter_number_format($Item->BundleQty) . "', + expirationdate='" . FormatDateForSQL($Item->ExpiryDate) . "' WHERE stockid='" . $_SESSION['Transfer']->TransferItem[0]->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 because'); $DbgMsg = _('The following SQL to update the serial stock item record was used'); @@ -369,16 +367,16 @@ } else { /*Need to insert a new serial item record */ $SQL = "INSERT INTO stockserialitems (stockid, - loccode, - serialno, - expirationdate, - quantity) + loccode, + serialno, + expirationdate, + quantity) VALUES ('" . $_SESSION['Transfer']->TransferItem[0]->StockID . "', - '" . $_SESSION['Transfer']->StockLocationTo . "', - '" . $Item->BundleRef . "', - '" . FormatDateForSQL($Item->ExpiryDate) . "', - '" . $Item->BundleQty . "')"; - + '" . $_SESSION['Transfer']->StockLocationTo . "', + '" . DB_escape_string($Item->BundleRef) . "', + '" . FormatDateForSQL($Item->ExpiryDate) . "', + '" . filter_number_format($Item->BundleQty) . "')"; + $ErrMsg = _('CRITICAL ERROR') . '! ' . _('NOTE DOWN THIS ERROR AND SEEK ASSISTANCE') . ': ' . _('The serial stock item record could not be added because'); $DbgMsg = _('The following SQL to insert the serial stock item record was used:'); $Result = DB_query($SQL, $db, $ErrMsg, $DbgMsg, true); @@ -393,8 +391,8 @@ moveqty) VALUES ('" . $StkMoveNo . "', '" . $_SESSION['Transfer']->TransferItem[0]->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); @@ -403,7 +401,7 @@ } /*end if the transfer item is a controlled item */ - $SQL = "UPDATE locstock SET quantity = quantity - '" . $_SESSION['Transfer']->TransferItem[0]->Quantity . "' + $SQL = "UPDATE locstock SET quantity = quantity - '" . filter_number_format(round($_SESSION['Transfer']->TransferItem[0]->Quantity,$_SESSION['Transfer']->TransferItem[0]->DecimalPlaces)) . "' WHERE stockid='" . $_SESSION['Transfer']->TransferItem[0]->StockID . "' AND loccode='" . $_SESSION['Transfer']->StockLocationFrom . "'"; @@ -412,11 +410,10 @@ $Result = DB_query($SQL,$db,$ErrMsg,$DbgMsg,true); $SQL = "UPDATE locstock - SET quantity = quantity + '" . $_SESSION['Transfer']->TransferItem[0]->Quantity . "' + SET quantity = quantity + '" . filter_number_format(round($_SESSION['Transfer']->TransferItem[0]->Quantity,$_SESSION['Transfer']->TransferItem[0]->DecimalPlaces)) . "' WHERE stockid='" . $_SESSION['Transfer']->TransferItem[0]->StockID . "' AND loccode='" . $_SESSION['Transfer']->StockLocationTo . "'"; - $ErrMsg = _('CRITICAL ERROR') . '! ' . _('NOTE DOWN THIS ERROR AND SEEK ASSISTANCE') . ': ' . _('The location stock record could not be updated because'); $DbgMsg = _('The following SQL to update the location stock record was used'); $Result = DB_query($SQL,$db,$ErrMsg, $DbgMsg, true); @@ -438,22 +435,23 @@ echo '<form action="'. $_SERVER['PHP_SELF'] . '" method=post>'; echo '<input type="hidden" name="FormID" value="' . $_SESSION['FormID'] . '" />'; - if (!isset($_GET['Description'])) { $_GET['Description']=''; } -echo '<table class=selection><tr><td>'. _('Stock Code'). ':</td><td>'; +echo '<table class="selection"> + <tr><td>'. _('Stock Code'). ':</td><td>'; if (isset($_POST['StockID'])) { - echo '<input type="text" name="StockID" size=21 value="' . $_POST['StockID'] . '" maxlength=20></td></tr>'; + echo '<input type="text" name="StockID" size="21" value="' . $_POST['StockID'] . '" maxlength="20" /></td></tr>'; } else { - echo '<input type="text" name="StockID" size=21 value="" maxlength=20></td></tr>'; + echo '<input type="text" name="StockID" size="21" value="" maxlength="20" /></td></tr>'; } -echo '<tr><td>'. _('Partial Description'). ':</td><td><input type="text" name="StockText" size=21 value="' . - $_GET['Description'] .'"></td><td>'._('Partial Stock Code'). ':</td><td>'; +echo '<tr><td>'. _('Partial Description'). ':</td> + <td><input type="text" name="StockText" size="21" value="' . $_GET['Description'] .'"></td> + <td>'._('Partial Stock Code'). ':</td><td>'; if (isset($_POST['StockID'])) { - echo '<input type="text" name="StockCode" size=21 value="' . $_POST['StockID'] .'" maxlength=20>'; + echo '<input type="text" name="StockCode" size="21" value="' . $_POST['StockID'] .'" maxlength="20" />'; } else { - echo '<input type="text" name="StockCode" size=21 value="" maxlength=20>'; + echo '<input type="text" name="StockCode" size="21" value="" maxlength="20" />'; } echo '</td><td><input type=submit name="CheckCode" value="'._('Check Part').'"></td></tr>'; @@ -461,19 +459,20 @@ echo '<tr><td colspan=3><font color=BLUE size=3>' . $_SESSION['Transfer']->TransferItem[0]->ItemDescription . ' ('._('In Units of').' ' . $_SESSION['Transfer']->TransferItem[0]->PartUnit . ' )</font></td></tr>'; } -echo '<tr><td>' . _('From Stock Location').':</td><td><select name="StockLocationFrom">'; +echo '<tr><td>' . _('From Stock Location').':</td> + <td><select name="StockLocationFrom">'; $sql = "SELECT loccode, locationname FROM locations"; $resultStkLocs = DB_query($sql,$db); while ($myrow=DB_fetch_array($resultStkLocs)){ if (isset($_SESSION['Transfer']->StockLocationFrom)){ if ($myrow['loccode'] == $_SESSION['Transfer']->StockLocationFrom){ - echo '<option selected Value="' . $myrow['loccode'] . '">' . $myrow['locationname'] . '</option>'; + echo '<option selected value="' . $myrow['loccode'] . '">' . $myrow['locationname'] . '</option>'; } else { - echo '<option Value="' . $myrow['loccode'] . '">' . $myrow['locationname'] . '</option>'; + echo '<option value="' . $myrow['loccode'] . '">' . $myrow['locationname'] . '</option>'; } } elseif ($myrow['loccode']==$_SESSION['UserStockLocation']){ - echo '<option selected Value="' . $myrow['loccode'] . '">' . $myrow['locationname'] . '</option>'; + echo '<option selected value="' . $myrow['loccode'] . '">' . $myrow['locationname'] . '</option>'; $_SESSION['Transfer']->StockLocationFrom=$myrow['loccode'] . '</option>'; } else { echo '<option Value="' . $myrow['loccode'] . '">' . $myrow['locationname'] . '</option>'; @@ -482,7 +481,8 @@ echo '</select></td></tr>'; -echo '<tr><td>'. _('To Stock Location').': </td><td><select name="StockLocationTo"> '; +echo '<tr><td>'. _('To Stock Location').': </td> + <td><select name="StockLocationTo"> '; DB_data_seek($resultStkLocs,0); @@ -503,21 +503,19 @@ echo '</select></td></tr>'; - echo '<tr><td>'._('Transfer Quantity').':</td>'; if (isset($_SESSION['Transfer']->TransferItem[0]->Controlled) AND $_SESSION['Transfer']->TransferItem[0]->Controlled==1){ echo '<td class=number><input type=hidden name="Quantity" value=' . $_SESSION['Transfer']->TransferItem[0]->Quantity . '><a href="' . $rootpath .'/StockTransferControlled.php?StockLocationFrom='.$_SESSION['Transfer']->StockLocationFrom.'">' . $_SESSION['Transfer']->TransferItem[0]->Quantity . '</a></td></tr>'; } elseif (isset($_SESSION['Transfer']->TransferItem[0]->Controlled)){ - echo '<td><input type="text" class="number" name="Quantity" size=12 maxlength=12 value=' . $_SESSION['Transfer']->TransferItem[0]->Quantity . '></td></tr>'; + echo '<td><input type="text" class="number" name="Quantity" size="12" maxlength="12" value=' . locale_number_format($_SESSION['Transfer']->TransferItem[0]->Quantity) . '></td></tr>'; } else { - echo '<td><input type="text" class="number" name="Quantity" size=12 maxlength=12 Value="0"></td></tr>'; + echo '<td><input type="text" class="number" name="Quantity" size="12" maxlength="12" value="0"></td></tr>'; } echo '</table><div class="centre"><br /><input type="submit" name="EnterTransfer" value="' . _('Enter Stock Transfer') . '"><br />'; - if (empty($_SESSION['Transfer']->TransferItem[0]->StockID) and isset($_POST['StockID'])) { $StockID=$_POST['StockID']; } else if (isset($_SESSION['Transfer']->TransferItem[0]->StockID)) { This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
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: <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-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-10 04:52:27
|
Revision: 4684 http://web-erp.svn.sourceforge.net/web-erp/?rev=4684&view=rev Author: daintree Date: 2011-09-10 04:52:21 +0000 (Sat, 10 Sep 2011) Log Message: ----------- number formatting Modified Paths: -------------- trunk/PcAssignCashToTab.php Modified: trunk/PcAssignCashToTab.php =================================================================== --- trunk/PcAssignCashToTab.php 2011-09-10 04:39:18 UTC (rev 4683) +++ trunk/PcAssignCashToTab.php 2011-09-10 04:52:21 UTC (rev 4684) @@ -18,9 +18,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'])) { @@ -80,10 +80,10 @@ $sql = "UPDATE pcashdetails SET date = '".FormatDateForSQL($_POST['Date'])."', - amount = '" . $_POST['Amount'] . "', + amount = '" . filter_number_format($_POST['Amount']) . "', authorized = '0000-00-00', - notes = '" . $_POST['Notes'] . "', - receipt = '" . $_POST['Receipt'] . "' + notes = '" . DB_escape_string($_POST['Notes']) . "', + receipt = '" . DB_escape_string($_POST['Receipt']) . "' WHERE counterindex = '" . $SelectedIndex . "'"; $msg = _('Assignment of cash to PC Tab ') . ' ' . $SelectedTabs . ' ' . _('has been updated'); @@ -103,11 +103,11 @@ '" . $_POST['SelectedTabs'] . "', '".FormatDateForSQL($_POST['Date'])."', 'ASSIGNCASH', - '" .$_POST['Amount'] . "', + '" . filter_number_format($_POST['Amount']) . "', authorized = '0000-00-00', '0', - '" . $_POST['Notes'] . "', - '" . $_POST['Receipt'] . "' + '" . DB_escape_string($_POST['Notes']) . "', + '" . DB_escape_string($_POST['Receipt']) . "' )"; $msg = _('Assignment of cash to PC Tab ') . ' ' . $_POST['SelectedTabs'] . ' ' . _('has been created'); } @@ -247,7 +247,7 @@ // only cash assignations NOT authorized can be modified or deleted echo '<td>' . ConvertSQLDate($myrow['date']) . '</td> <td>' . $Description['0'] . '</td> - <td class=number>' . locale_number_format($myrow['amount'],$_SESSION['CompanyRecord']['decimalplaces']) . '</td> + <td class=number>' . locale_money_format($myrow['amount'],$_SESSION['CompanyRecord']['decimalplaces']) . '</td> <td>' . ConvertSQLDate($myrow['authorized']) . '</td> <td>' . $myrow['notes'] . '</td> <td>' . $myrow['receipt'] . '</td> @@ -261,7 +261,7 @@ }else{ echo '<td>' . ConvertSQLDate($myrow['date']) . '</td> <td>' . $Description['0'] . '</td> - <td class=number>' . locale_number_format($myrow['amount'],$_SESSION['CompanyRecord']['decimalplaces']).'</td> + <td class=number>' . locale_money_format($myrow['amount'],$_SESSION['CompanyRecord']['decimalplaces']).'</td> <td>' . ConvertSQLDate($myrow['authorized']) . '</td> <td>' . $myrow['notes'] . '</td> <td>' . $myrow['receipt'] . '</td> @@ -282,7 +282,7 @@ } echo '<tr><td colspan="2" style="text-align:right"><b>' . _('Current balance') . ':</b></td> - <td>' . locale_number_format($Amount['0'],$_SESSION['CompanyRecord']['decimalplaces']) . '</td></tr>'; + <td>' . locale_money_format($Amount['0'],$_SESSION['CompanyRecord']['decimalplaces']) . '</td></tr>'; echo '</table>'; @@ -319,7 +319,7 @@ echo '<input type="hidden" name="SelectedTabs" value="' . $SelectedTabs . '">'; echo '<input type=hidden name="SelectedIndex" value="' . $SelectedIndex. '">'; echo '<input type=hidden name="CurrentAmount" value="' . $Amount[0]. '">'; - echo '<input type=hidden name="Days" value="' .$Days. '">'; + echo '<input type=hidden name="Days" value="' . $Days . '">'; } /* Ricard: needs revision of this date initialization */ @@ -359,8 +359,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>'; 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:52:27
|
Revision: 4684 http://web-erp.svn.sourceforge.net/web-erp/?rev=4684&view=rev Author: daintree Date: 2011-09-10 04:52:21 +0000 (Sat, 10 Sep 2011) Log Message: ----------- number formatting Modified Paths: -------------- trunk/PcAssignCashToTab.php Modified: trunk/PcAssignCashToTab.php =================================================================== --- trunk/PcAssignCashToTab.php 2011-09-10 04:39:18 UTC (rev 4683) +++ trunk/PcAssignCashToTab.php 2011-09-10 04:52:21 UTC (rev 4684) @@ -18,9 +18,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'])) { @@ -80,10 +80,10 @@ $sql = "UPDATE pcashdetails SET date = '".FormatDateForSQL($_POST['Date'])."', - amount = '" . $_POST['Amount'] . "', + amount = '" . filter_number_format($_POST['Amount']) . "', authorized = '0000-00-00', - notes = '" . $_POST['Notes'] . "', - receipt = '" . $_POST['Receipt'] . "' + notes = '" . DB_escape_string($_POST['Notes']) . "', + receipt = '" . DB_escape_string($_POST['Receipt']) . "' WHERE counterindex = '" . $SelectedIndex . "'"; $msg = _('Assignment of cash to PC Tab ') . ' ' . $SelectedTabs . ' ' . _('has been updated'); @@ -103,11 +103,11 @@ '" . $_POST['SelectedTabs'] . "', '".FormatDateForSQL($_POST['Date'])."', 'ASSIGNCASH', - '" .$_POST['Amount'] . "', + '" . filter_number_format($_POST['Amount']) . "', authorized = '0000-00-00', '0', - '" . $_POST['Notes'] . "', - '" . $_POST['Receipt'] . "' + '" . DB_escape_string($_POST['Notes']) . "', + '" . DB_escape_string($_POST['Receipt']) . "' )"; $msg = _('Assignment of cash to PC Tab ') . ' ' . $_POST['SelectedTabs'] . ' ' . _('has been created'); } @@ -247,7 +247,7 @@ // only cash assignations NOT authorized can be modified or deleted echo '<td>' . ConvertSQLDate($myrow['date']) . '</td> <td>' . $Description['0'] . '</td> - <td class=number>' . locale_number_format($myrow['amount'],$_SESSION['CompanyRecord']['decimalplaces']) . '</td> + <td class=number>' . locale_money_format($myrow['amount'],$_SESSION['CompanyRecord']['decimalplaces']) . '</td> <td>' . ConvertSQLDate($myrow['authorized']) . '</td> <td>' . $myrow['notes'] . '</td> <td>' . $myrow['receipt'] . '</td> @@ -261,7 +261,7 @@ }else{ echo '<td>' . ConvertSQLDate($myrow['date']) . '</td> <td>' . $Description['0'] . '</td> - <td class=number>' . locale_number_format($myrow['amount'],$_SESSION['CompanyRecord']['decimalplaces']).'</td> + <td class=number>' . locale_money_format($myrow['amount'],$_SESSION['CompanyRecord']['decimalplaces']).'</td> <td>' . ConvertSQLDate($myrow['authorized']) . '</td> <td>' . $myrow['notes'] . '</td> <td>' . $myrow['receipt'] . '</td> @@ -282,7 +282,7 @@ } echo '<tr><td colspan="2" style="text-align:right"><b>' . _('Current balance') . ':</b></td> - <td>' . locale_number_format($Amount['0'],$_SESSION['CompanyRecord']['decimalplaces']) . '</td></tr>'; + <td>' . locale_money_format($Amount['0'],$_SESSION['CompanyRecord']['decimalplaces']) . '</td></tr>'; echo '</table>'; @@ -319,7 +319,7 @@ echo '<input type="hidden" name="SelectedTabs" value="' . $SelectedTabs . '">'; echo '<input type=hidden name="SelectedIndex" value="' . $SelectedIndex. '">'; echo '<input type=hidden name="CurrentAmount" value="' . $Amount[0]. '">'; - echo '<input type=hidden name="Days" value="' .$Days. '">'; + echo '<input type=hidden name="Days" value="' . $Days . '">'; } /* Ricard: needs revision of this date initialization */ @@ -359,8 +359,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>'; 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-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-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-07 09:40:49
|
Revision: 4681 http://web-erp.svn.sourceforge.net/web-erp/?rev=4681&view=rev Author: daintree Date: 2011-09-07 09:40:43 +0000 (Wed, 07 Sep 2011) Log Message: ----------- fix CounterSales.php notices Modified Paths: -------------- trunk/CounterSales.php Modified: trunk/CounterSales.php =================================================================== --- trunk/CounterSales.php 2011-09-06 10:51:43 UTC (rev 4680) +++ trunk/CounterSales.php 2011-09-07 09:40:43 UTC (rev 4681) @@ -20,23 +20,13 @@ } else { $identifier=$_GET['identifier']; } -if (isset($_SESSION['Items'.$identifier])){ +if (isset($_SESSION['Items'.$identifier]) AND isset($_POST['CustRef'])){ //update the Items object variable with the data posted from the form - if (isset($_POST['CustRef'])){ - $_SESSION['Items'.$identifier]->CustRef = $_POST['CustRef']; - } - if (isset($_POST['Comments'])){ - $_SESSION['Items'.$identifier]->Comments = $_POST['Comments']; - } - if (isset($_POST['DeliverTo'])){ - $_SESSION['Items'.$identifier]->DeliverTo = $_POST['DeliverTo']; - } - if (isset($_POST['PhoneNo'])){ - $_SESSION['Items'.$identifier]->PhoneNo = $_POST['PhoneNo']; - } - if (isset($_POST['Email'])){ - $_SESSION['Items'.$identifier]->Email = $_POST['Email']; - } + $_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'])){ This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <dai...@us...> - 2011-09-07 09:40:49
|
Revision: 4681 http://web-erp.svn.sourceforge.net/web-erp/?rev=4681&view=rev Author: daintree Date: 2011-09-07 09:40:43 +0000 (Wed, 07 Sep 2011) Log Message: ----------- fix CounterSales.php notices Modified Paths: -------------- trunk/CounterSales.php Modified: trunk/CounterSales.php =================================================================== --- trunk/CounterSales.php 2011-09-06 10:51:43 UTC (rev 4680) +++ trunk/CounterSales.php 2011-09-07 09:40:43 UTC (rev 4681) @@ -20,23 +20,13 @@ } else { $identifier=$_GET['identifier']; } -if (isset($_SESSION['Items'.$identifier])){ +if (isset($_SESSION['Items'.$identifier]) AND isset($_POST['CustRef'])){ //update the Items object variable with the data posted from the form - if (isset($_POST['CustRef'])){ - $_SESSION['Items'.$identifier]->CustRef = $_POST['CustRef']; - } - if (isset($_POST['Comments'])){ - $_SESSION['Items'.$identifier]->Comments = $_POST['Comments']; - } - if (isset($_POST['DeliverTo'])){ - $_SESSION['Items'.$identifier]->DeliverTo = $_POST['DeliverTo']; - } - if (isset($_POST['PhoneNo'])){ - $_SESSION['Items'.$identifier]->PhoneNo = $_POST['PhoneNo']; - } - if (isset($_POST['Email'])){ - $_SESSION['Items'.$identifier]->Email = $_POST['Email']; - } + $_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'])){ This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <dai...@us...> - 2011-09-06 10:51:50
|
Revision: 4680 http://web-erp.svn.sourceforge.net/web-erp/?rev=4680&view=rev Author: daintree Date: 2011-09-06 10:51:43 +0000 (Tue, 06 Sep 2011) Log Message: ----------- fix CounterSales.php notices Modified Paths: -------------- trunk/CounterSales.php Modified: trunk/CounterSales.php =================================================================== --- trunk/CounterSales.php 2011-09-05 18:55:20 UTC (rev 4679) +++ trunk/CounterSales.php 2011-09-06 10:51:43 UTC (rev 4680) @@ -22,11 +22,21 @@ } if (isset($_SESSION['Items'.$identifier])){ //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['CustRef'])){ + $_SESSION['Items'.$identifier]->CustRef = $_POST['CustRef']; + } + if (isset($_POST['Comments'])){ + $_SESSION['Items'.$identifier]->Comments = $_POST['Comments']; + } + if (isset($_POST['DeliverTo'])){ + $_SESSION['Items'.$identifier]->DeliverTo = $_POST['DeliverTo']; + } + if (isset($_POST['PhoneNo'])){ + $_SESSION['Items'.$identifier]->PhoneNo = $_POST['PhoneNo']; + } + if (isset($_POST['Email'])){ + $_SESSION['Items'.$identifier]->Email = $_POST['Email']; + } } if (isset($_POST['QuickEntry'])){ @@ -85,11 +95,7 @@ exit; } if (isset($_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]->DebtorNo = $_GET['DebtorNo']; $_SESSION['Items'.$identifier]->Branch = $_GET['BranchNo']; } else { $_SESSION['Items'.$identifier]->Branch = $myrow['cashsalebranch']; @@ -2263,7 +2269,7 @@ } $OnOrder = $PurchQty + $WoQty; - $Available = $qoh - $DemandQty + $OnOrder; + $Available = $QOH - $DemandQty + $OnOrder; printf('<td>%s</td> <td>%s</td> This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <dai...@us...> - 2011-09-06 10:51:50
|
Revision: 4680 http://web-erp.svn.sourceforge.net/web-erp/?rev=4680&view=rev Author: daintree Date: 2011-09-06 10:51:43 +0000 (Tue, 06 Sep 2011) Log Message: ----------- fix CounterSales.php notices Modified Paths: -------------- trunk/CounterSales.php Modified: trunk/CounterSales.php =================================================================== --- trunk/CounterSales.php 2011-09-05 18:55:20 UTC (rev 4679) +++ trunk/CounterSales.php 2011-09-06 10:51:43 UTC (rev 4680) @@ -22,11 +22,21 @@ } if (isset($_SESSION['Items'.$identifier])){ //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['CustRef'])){ + $_SESSION['Items'.$identifier]->CustRef = $_POST['CustRef']; + } + if (isset($_POST['Comments'])){ + $_SESSION['Items'.$identifier]->Comments = $_POST['Comments']; + } + if (isset($_POST['DeliverTo'])){ + $_SESSION['Items'.$identifier]->DeliverTo = $_POST['DeliverTo']; + } + if (isset($_POST['PhoneNo'])){ + $_SESSION['Items'.$identifier]->PhoneNo = $_POST['PhoneNo']; + } + if (isset($_POST['Email'])){ + $_SESSION['Items'.$identifier]->Email = $_POST['Email']; + } } if (isset($_POST['QuickEntry'])){ @@ -85,11 +95,7 @@ exit; } if (isset($_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]->DebtorNo = $_GET['DebtorNo']; $_SESSION['Items'.$identifier]->Branch = $_GET['BranchNo']; } else { $_SESSION['Items'.$identifier]->Branch = $myrow['cashsalebranch']; @@ -2263,7 +2269,7 @@ } $OnOrder = $PurchQty + $WoQty; - $Available = $qoh - $DemandQty + $OnOrder; + $Available = $QOH - $DemandQty + $OnOrder; printf('<td>%s</td> <td>%s</td> This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <tim...@us...> - 2011-09-05 18:55:27
|
Revision: 4679 http://web-erp.svn.sourceforge.net/web-erp/?rev=4679&view=rev Author: tim_schofield Date: 2011-09-05 18:55:20 +0000 (Mon, 05 Sep 2011) Log Message: ----------- Add in perishable flag, thereby enabling the decimal places to be shown correctly Modified Paths: -------------- trunk/StockLocTransferReceive.php Modified: trunk/StockLocTransferReceive.php =================================================================== --- trunk/StockLocTransferReceive.php 2011-09-05 10:10:57 UTC (rev 4678) +++ trunk/StockLocTransferReceive.php 2011-09-05 18:55:20 UTC (rev 4679) @@ -354,6 +354,7 @@ stockmaster.units, stockmaster.controlled, stockmaster.serialised, + stockmaster.perishable, stockmaster.decimalplaces, loctransfers.shipqty, loctransfers.recqty, @@ -398,6 +399,7 @@ $myrow['units'], $myrow['controlled'], $myrow['serialised'], + $myrow['perishable'], $myrow['decimalplaces'] ); $_SESSION['Transfer']->TransferItem[$i]->PrevRecvQty = $myrow['recqty']; This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <tim...@us...> - 2011-09-05 18:55:26
|
Revision: 4679 http://web-erp.svn.sourceforge.net/web-erp/?rev=4679&view=rev Author: tim_schofield Date: 2011-09-05 18:55:20 +0000 (Mon, 05 Sep 2011) Log Message: ----------- Add in perishable flag, thereby enabling the decimal places to be shown correctly Modified Paths: -------------- trunk/StockLocTransferReceive.php Modified: trunk/StockLocTransferReceive.php =================================================================== --- trunk/StockLocTransferReceive.php 2011-09-05 10:10:57 UTC (rev 4678) +++ trunk/StockLocTransferReceive.php 2011-09-05 18:55:20 UTC (rev 4679) @@ -354,6 +354,7 @@ stockmaster.units, stockmaster.controlled, stockmaster.serialised, + stockmaster.perishable, stockmaster.decimalplaces, loctransfers.shipqty, loctransfers.recqty, @@ -398,6 +399,7 @@ $myrow['units'], $myrow['controlled'], $myrow['serialised'], + $myrow['perishable'], $myrow['decimalplaces'] ); $_SESSION['Transfer']->TransferItem[$i]->PrevRecvQty = $myrow['recqty']; 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-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-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 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 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-03 11:08:04
|
Revision: 4675 http://web-erp.svn.sourceforge.net/web-erp/?rev=4675&view=rev Author: daintree Date: 2011-09-03 11:07:57 +0000 (Sat, 03 Sep 2011) Log Message: ----------- 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 Modified Paths: -------------- trunk/AccountGroups.php trunk/GLTransInquiry.php trunk/SelectCustomer.php trunk/SelectProduct.php trunk/Stocks.php trunk/doc/Change.log trunk/includes/LanguageSetup.php trunk/includes/MiscFunctions.php trunk/includes/SQL_CommonFunctions.inc trunk/javascripts/MiscFunctions.js Modified: trunk/AccountGroups.php =================================================================== --- trunk/AccountGroups.php 2011-09-02 10:38:54 UTC (rev 4674) +++ trunk/AccountGroups.php 2011-09-03 11:07:57 UTC (rev 4675) @@ -18,7 +18,9 @@ $DbgMsg = _('The SQL that was used to retrieve the account groups of the parent account group and that failed in the process was'); do { - $sql = "SELECT parentgroupname FROM accountgroups WHERE groupname='" . $GroupName ."'"; + $sql = "SELECT parentgroupname + FROM accountgroups + WHERE groupname='" . $GroupName ."'"; $result = DB_query($sql,$db,$ErrMsg,$DbgMsg); $myrow = DB_fetch_row($result); Modified: trunk/GLTransInquiry.php =================================================================== --- trunk/GLTransInquiry.php 2011-09-02 10:38:54 UTC (rev 4674) +++ trunk/GLTransInquiry.php 2011-09-03 11:07:57 UTC (rev 4675) @@ -55,12 +55,11 @@ gltrans.posted, chartmaster.accountname, periods.lastdate_in_period - FROM gltrans, - chartmaster, - periods - WHERE gltrans.account = chartmaster.accountcode - AND periods.periodno=gltrans.periodno - AND gltrans.type= '" . $_GET['TypeID'] . "' + FROM gltrans INNER JOIN chartmaster + ON gltrans.account = chartmaster.accountcode + INNER JOIN periods + ON periods.periodno=gltrans.periodno + WHERE gltrans.type= '" . $_GET['TypeID'] . "' AND gltrans.typeno = '" . $_GET['TransNo'] . "' ORDER BY gltrans.counterindex"; $TransResult = DB_query($SQL,$db); @@ -142,21 +141,21 @@ if ($DetailResult) { while ( $DetailRow = DB_fetch_row($DetailResult) ) { if ( $TransRow['amount'] > 0){ - if ($TransRow['account'] == $_SESSION['CompanyRecord']['debtorsact']) { - $Debit = locale_number_format(($DetailRow[1] + $DetailRow[2]) / $DetailRow[3],$_SESSION['CompanyRecord']['decimalplaces']); - $Credit = ' '; - } else { - $Debit = locale_number_format((-$DetailRow[1] - $DetailRow[2]) / $DetailRow[3],$_SESSION['CompanyRecord']['decimalplaces']); - $Credit = ' '; - } + if ($TransRow['account'] == $_SESSION['CompanyRecord']['debtorsact']) { + $Debit = locale_number_format(($DetailRow[1] + $DetailRow[2]) / $DetailRow[3],$_SESSION['CompanyRecord']['decimalplaces']); + $Credit = ' '; + } else { + $Debit = locale_number_format((-$DetailRow[1] - $DetailRow[2]) / $DetailRow[3],$_SESSION['CompanyRecord']['decimalplaces']); + $Credit = ' '; + } } else { - if ($TransRow['account'] == $_SESSION['CompanyRecord']['debtorsact']) { - $Credit = locale_number_format(-($DetailRow[1] + $DetailRow[2]) / $DetailRow[3],$_SESSION['CompanyRecord']['decimalplaces']); - $Debit = ' '; - } else { - $Credit = locale_number_format(($DetailRow[1] + $DetailRow[2]) / $DetailRow[3],$_SESSION['CompanyRecord']['decimalplaces']); - $Debit = ' '; - } + if ($TransRow['account'] == $_SESSION['CompanyRecord']['debtorsact']) { + $Credit = locale_number_format(-($DetailRow[1] + $DetailRow[2]) / $DetailRow[3],$_SESSION['CompanyRecord']['decimalplaces']); + $Debit = ' '; + } else { + $Credit = locale_number_format(($DetailRow[1] + $DetailRow[2]) / $DetailRow[3],$_SESSION['CompanyRecord']['decimalplaces']); + $Debit = ' '; + } } if ($j==1) { Modified: trunk/SelectCustomer.php =================================================================== --- trunk/SelectCustomer.php 2011-09-02 10:38:54 UTC (rev 4674) +++ trunk/SelectCustomer.php 2011-09-03 11:07:57 UTC (rev 4675) @@ -86,24 +86,12 @@ } } if (isset($_POST['Search']) OR isset($_POST['CSV']) OR isset($_POST['Go']) OR isset($_POST['Next']) OR isset($_POST['Previous'])) { + unset($_POST['JustSelectedACustomer']); if (isset($_POST['Search'])) { $_POST['PageOffset'] = 1; } - if (mb_strlen($_POST['Keywords'])>0) { - $msg = _('Search Result: Customer Name has been used in search') . '<br />'; - $_POST['Keywords'] = mb_strtoupper($_POST['Keywords']); - } elseif (mb_strlen($_POST['CustCode'])>0) { - $msg = _('Search Result: Customer Code has been used in search') . '<br />'; - } elseif (mb_strlen($_POST['CustPhone'])>0) { - $msg = _('Search Result: Customer Phone has been used in search') . '<br />'; - }elseif (($_POST['CustAdd'])) { - $msg = _('Search Result: Customer Address has been used in search') . '<br />'; - } elseif (isset($_POST['CustType']) AND $_POST['CustType']!='ALL') { - $msg = _('Search Result: Customer Type has been used in search') . '<br />'; - } elseif (isset($_POST['Area']) AND $_POST['Area']!='ALL') { - $msg = _('Search Result: Customer branch area has been used in search') . '<br />'; - } - if (($_POST['Keywords'] == '') AND ($_POST['CustCode'] == '') AND ($_POST['CustPhone'] == '') AND ($_POST['CustType'] == 'ALL') AND ($_POST['Area'] == 'ALL') AND ($_POST['CustAdd'] == '')) { + + if (($_POST['Keywords'] == '') AND ($_POST['CustCode'] == '') AND ($_POST['CustPhone'] == '') AND ( $_POST['CustType'] == 'ALL') AND ($_POST['Area'] == 'ALL') AND ($_POST['CustAdd'] == '')) { //no criteria set then default to all customers $SQL = "SELECT debtorsmaster.debtorno, debtorsmaster.name, @@ -122,12 +110,11 @@ INNER JOIN debtortype ON debtorsmaster.typeid = debtortype.typeid"; } else { - if (mb_strlen($_POST['Keywords']) > 0) { - //using the customer name - $_POST['Keywords'] = mb_strtoupper(trim($_POST['Keywords'])); - //insert wildcard characters in spaces - $SearchString = '%' . str_replace(' ', '%', $_POST['Keywords']) . '%'; - $SQL = "SELECT debtorsmaster.debtorno, + $SearchKeywords = mb_strtoupper(trim(str_replace(' ', '%', $_POST['Keywords']))); + $_POST['CustCode'] = mb_strtoupper(trim($_POST['CustCode'])); + $_POST['CustPhone'] = trim($_POST['CustPhone']); + $_POST['CustAdd'] = trim($_POST['CustAdd']); + $SQL = "SELECT debtorsmaster.debtorno, debtorsmaster.name, debtorsmaster.address1, debtorsmaster.address2, @@ -139,103 +126,23 @@ debtortype.typename, custbranch.phoneno, custbranch.faxno - FROM debtorsmaster LEFT JOIN custbranch - ON debtorsmaster.debtorno = custbranch.debtorno, debtortype - WHERE debtorsmaster.name " . LIKE . " '" . $SearchString . "' - AND debtorsmaster.typeid = debtortype.typeid"; - } elseif (mb_strlen($_POST['CustCode']) > 0) { - $_POST['CustCode'] = mb_strtoupper(trim($_POST['CustCode'])); - $SQL = "SELECT debtorsmaster.debtorno, - debtorsmaster.name, - debtorsmaster.address1, - debtorsmaster.address2, - debtorsmaster.address3, - debtorsmaster.address4, - custbranch.branchcode, - custbranch.brname, - custbranch.contactname, - debtortype.typename, - custbranch.phoneno, - custbranch.faxno - FROM debtorsmaster LEFT JOIN custbranch - ON debtorsmaster.debtorno = custbranch.debtorno, debtortype - WHERE debtorsmaster.debtorno " . LIKE . " '%" . $_POST['CustCode'] . "%' - AND debtorsmaster.typeid = debtortype.typeid"; - } elseif (mb_strlen($_POST['CustPhone']) > 0) { - $SQL = "SELECT debtorsmaster.debtorno, - debtorsmaster.name, - debtorsmaster.address1, - debtorsmaster.address2, - debtorsmaster.address3, - debtorsmaster.address4, - custbranch.branchcode, - custbranch.brname, - custbranch.contactname, - debtortype.typename, - custbranch.phoneno, - custbranch.faxno - FROM debtorsmaster LEFT JOIN custbranch - ON debtorsmaster.debtorno = custbranch.debtorno, debtortype - WHERE custbranch.phoneno " . LIKE . " '%" . $_POST['CustPhone'] . "%' - AND debtorsmaster.typeid = debtortype.typeid"; - // Added an option to search by address. I tried having it search address1, address2, address3, and address4, but my knowledge of MYSQL is limited. This will work okay if you select the CSV Format then you can search though the address1 field. I would like to extend this to all 4 address fields. Gilles Deacur - - } elseif (mb_strlen($_POST['CustAdd']) > 0) { - $SQL = "SELECT debtorsmaster.debtorno, - debtorsmaster.name, - debtorsmaster.address1, - debtorsmaster.address2, - debtorsmaster.address3, - debtorsmaster.address4, - custbranch.branchcode, - custbranch.brname, - custbranch.contactname, - debtortype.typename, - custbranch.phoneno, - custbranch.faxno - FROM debtorsmaster LEFT JOIN custbranch - ON debtorsmaster.debtorno = custbranch.debtorno, debtortype - WHERE debtorsmaster.address1 " . LIKE . " '%" . $_POST['CustAdd'] . "%' + FROM debtorsmaster INNER JOIN debtortype + ON debtorsmaster.typeid = debtortype.typeid + LEFT JOIN custbranch + ON debtorsmaster.debtorno = custbranch.debtorno + WHERE debtorsmaster.name " . LIKE . " '%" . $SearchKeywords . "%' + AND debtorsmaster.debtorno " . LIKE . " '%" . $_POST['CustCode'] . "%' + AND custbranch.phoneno " . LIKE . " '%" . $_POST['CustPhone'] . "%' + AND (debtorsmaster.address1 " . LIKE . " '%" . $_POST['CustAdd'] . "%' OR debtorsmaster.address2 " . LIKE . " '%" . $_POST['CustAdd'] . "%' OR debtorsmaster.address3 " . LIKE . " '%" . $_POST['CustAdd'] . "%' - OR debtorsmaster.address4 " . LIKE . " '%" . $_POST['CustAdd'] . "%' - AND debtorsmaster.typeid = debtortype.typeid"; - // End added search feature. Gilles Deacur - - } elseif (mb_strlen($_POST['CustType']) > 0 AND $_POST['CustType']!='ALL') { - $SQL = "SELECT debtorsmaster.debtorno, - debtorsmaster.name, - debtorsmaster.address1, - debtorsmaster.address2, - debtorsmaster.address3, - debtorsmaster.address4, - custbranch.branchcode, - custbranch.brname, - custbranch.contactname, - debtortype.typename, - custbranch.phoneno, - custbranch.faxno - FROM debtorsmaster LEFT JOIN custbranch - ON debtorsmaster.debtorno = custbranch.debtorno, debtortype - WHERE debtorsmaster.typeid LIKE debtortype.typeid - AND debtortype.typename = '" . $_POST['CustType'] . "'"; - } elseif (mb_strlen($_POST['Area']) > 0 AND $_POST['Area']!='ALL') { - $SQL = "SELECT debtorsmaster.debtorno, - debtorsmaster.name, - debtorsmaster.address1, - debtorsmaster.address2, - debtorsmaster.address3, - debtorsmaster.address4, - custbranch.branchcode, - custbranch.brname, - custbranch.contactname, - debtortype.typename, - custbranch.phoneno, - custbranch.faxno - FROM debtorsmaster LEFT JOIN custbranch - ON debtorsmaster.debtorno = custbranch.debtorno, debtortype - WHERE debtorsmaster.typeid LIKE debtortype.typeid - AND custbranch.area = '" . $_POST['Area'] . "'"; + OR debtorsmaster.address4 " . LIKE . " '%" . $_POST['CustAdd'] . "%')"; + + if (mb_strlen($_POST['CustType']) > 0 AND $_POST['CustType']!='ALL') { + $SQL .= " AND debtortype.typename = '" . $_POST['CustType'] . "'"; + } + if (mb_strlen($_POST['Area']) > 0 AND $_POST['Area']!='ALL') { + $SQL .= " AND custbranch.area = '" . $_POST['Area'] . "'"; } } //one of keywords or custcode or custphone was more than a zero length string if ($_SESSION['SalesmanLogin'] != '') { @@ -251,6 +158,7 @@ $_SESSION['CustomerID'] = $myrow['debtorno']; $_SESSION['BranchCode'] = $myrow['branchcode']; unset($result); + unset($_POST['Search']); } elseif (DB_num_rows($result) == 0) { prnMsg(_('No customer records contain the selected text') . ' - ' . _('please alter your search criteria and try again'), 'info'); echo '<br />'; @@ -515,8 +423,8 @@ $k = 1; } echo '<td><font size="1"><input type="submit" name="SubmitCustomerSelection' . $i .'" value="' . htmlentities($myrow['debtorno'].' '.$myrow['branchcode'],ENT_QUOTES,'UTF-8') . '" /></font></td> - <input type="hidden" name="SelectedCustomer' . $i .'" value="'.$myrow['debtorno'].'"> - <input type="hidden" name="SelectedBranch' . $i .'" value="'. $myrow['branchcode'].'" /> + <input type="hidden" name="SelectedCustomer' . $i . '" value="'.$myrow['debtorno'].'"> + <input type="hidden" name="SelectedBranch' . $i . '" value="'. $myrow['branchcode'].'" /> <td><font size=1>' . $myrow['name'] . '</font></td> <td><font size=1>' . $myrow['brname'] . '</font></td> <td><font size=1>' . $myrow['contactname'] . '</font></td> @@ -578,10 +486,11 @@ // Extended Customer Info only if selected in Configuration if ($_SESSION['Extended_CustomerInfo'] == 1) { if ($_SESSION['CustomerID'] != '') { - $sql = "SELECT debtortype.typeid, debtortype.typename - FROM debtorsmaster, debtortype - WHERE debtorsmaster.typeid = debtortype.typeid - AND debtorsmaster.debtorno = '" . $_SESSION['CustomerID'] . "'"; + $sql = "SELECT debtortype.typeid, + debtortype.typename + FROM debtorsmaster INNER JOIN debtortype + ON debtorsmaster.typeid = debtortype.typeid + WHERE debtorsmaster.debtorno = '" . $_SESSION['CustomerID'] . "'"; $ErrMsg = _('An error occurred in retrieving the information'); $result = DB_query($sql, $db, $ErrMsg); $myrow = DB_fetch_array($result); Modified: trunk/SelectProduct.php =================================================================== --- trunk/SelectProduct.php 2011-09-02 10:38:54 UTC (rev 4674) +++ trunk/SelectProduct.php 2011-09-03 11:07:57 UTC (rev 4675) @@ -129,7 +129,8 @@ WHERE currabrev ='" . $_SESSION['CompanyRecord']['currencydefault'] . "' AND typeabbrev = '" . $_SESSION['DefaultPriceList'] . "' AND debtorno='' - AND branchcode='' + AND branchcode='' + AND startdate <= '". Date('Y-m-d') ."' AND ( enddate >= '" . Date('Y-m-d') . "' OR enddate = '0000-00-00') AND stockid='" . $StockID . "'", $db); if ($myrow['mbflag'] == 'K' OR $myrow['mbflag'] == 'A') { $CostResult = DB_query("SELECT SUM(bom.quantity * (stockmaster.materialcost+stockmaster.labourcost+stockmaster.overheadcost)) AS cost Modified: trunk/Stocks.php =================================================================== --- trunk/Stocks.php 2011-09-02 10:38:54 UTC (rev 4674) +++ trunk/Stocks.php 2011-09-03 11:07:57 UTC (rev 4675) @@ -1171,7 +1171,7 @@ echo '<input type="submit" name="UpdateCategories" style="visibility:hidden;width:1px" value="' . _('Categories') . '" />'; echo '<p>'; prnMsg( _('Only click the Delete button if you are sure you wish to delete the item!') . _('Checks will be made to ensure that there are no stock movements, sales analysis records, sales order items or purchase order items for the item') . '. ' . _('No deletions will be allowed if they exist'), 'warn', _('WARNING')); - echo '<p><input type="Submit" name="delete" value="' . _('Delete This Item') . '" onclick="return confirm(\'' . _('Are You Sure?') . '\');">'; + echo '<p><input type="submit" name="delete" value="' . _('Delete This Item') . '" onclick="return confirm(\'' . _('Are You Sure?') . '\');">'; } echo '</form></div>'; Modified: trunk/doc/Change.log =================================================================== --- trunk/doc/Change.log 2011-09-02 10:38:54 UTC (rev 4674) +++ trunk/doc/Change.log 2011-09-03 11:07:57 UTC (rev 4675) @@ -1,5 +1,7 @@ webERP Change Log +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() 2/9/11 Warren Olds: scaling of image in GetStockImage.php 31/8/11 Ricard: StockAdjustments.php now sends an email to the inventory manager on the creation of manual stock adjustments. The inventory manager email is defined in SystemParameters.php - leaving the email address blank will stop any emails from being created. Modified: trunk/includes/LanguageSetup.php =================================================================== --- trunk/includes/LanguageSetup.php 2011-09-02 10:38:54 UTC (rev 4674) +++ trunk/includes/LanguageSetup.php 2011-09-03 11:07:57 UTC (rev 4675) @@ -37,7 +37,7 @@ if ($_SESSION['Language']=='tr_TR.utf8') { $Locale = setlocale(LC_CTYPE, 'C'); } - + $Locale = setlocale (LC_NUMERIC, 'en_US'); //currently need all decimal points etc to be as expected on webserver // possibly even if locale fails the language will still switch by using Language instead of locale variable @@ -81,7 +81,6 @@ return $text; } } -} - +} ?> \ No newline at end of file Modified: trunk/includes/MiscFunctions.php =================================================================== --- trunk/includes/MiscFunctions.php 2011-09-02 10:38:54 UTC (rev 4674) +++ trunk/includes/MiscFunctions.php 2011-09-03 11:07:57 UTC (rev 4675) @@ -313,7 +313,7 @@ } function locale_number_format($Number, $DecimalPlaces) { - $LocaleInfo = localeconv(); + $LocaleInfo = localeconv(); return number_format($Number, $DecimalPlaces, $LocaleInfo['decimal_point'], $LocaleInfo['thousands_sep']); } Modified: trunk/includes/SQL_CommonFunctions.inc =================================================================== --- trunk/includes/SQL_CommonFunctions.inc 2011-09-02 10:38:54 UTC (rev 4674) +++ trunk/includes/SQL_CommonFunctions.inc 2011-09-03 11:07:57 UTC (rev 4675) @@ -13,7 +13,8 @@ 10 sales invoice 11 sales credit note 12 sales receipt - +etc +* */ DB_query("LOCK TABLES systypes WRITE",$db); Modified: trunk/javascripts/MiscFunctions.js =================================================================== --- trunk/javascripts/MiscFunctions.js 2011-09-02 10:38:54 UTC (rev 4674) +++ trunk/javascripts/MiscFunctions.js 2011-09-03 11:07:57 UTC (rev 4675) @@ -11,7 +11,7 @@ else return true; kC=String.fromCharCode(k); if ((k==null) || (k==0) || (k==8) || (k==9) || (k==13) || (k==27)) return true; - else if ((("0123456789.-").indexOf(kC)>-1)) return true; + else if ((("0123456789.,-").indexOf(kC)>-1)) return true; else return false; } function assignComboToInput(c,i){ @@ -107,8 +107,8 @@ xTR="</tr>"; TD="<td class='dpTD' onMouseOut='this.className=\"dpTD\";' onMouseOver='this.className=\"dpTDHover\";'"; xTD="</td>"; - html="<table class='dpTbl'>"+TR+"<th colspan=3>"+months[tD.getMonth()]+" "+tD.getFullYear()+"</th>"+"<td colspan=2>"+ - getButtonCode(md,tD,-1,"<",dF)+xTD+"<td colspan=2>"+getButtonCode(md,tD,1,">",dF)+xTD+xTR+TR; + html="<table class='dpTbl'>"+TR+"<th colspan=\"3\">"+months[tD.getMonth()]+" "+tD.getFullYear()+"</th>"+"<td colspan=\"2\">"+ + getButtonCode(md,tD,-1,"<",dF)+xTD+"<td colspan=\"2\">"+getButtonCode(md,tD,1,">",dF)+xTD+xTR+TR; for(i=0;i<days.length;i++) html+="<th>"+days[i]+"</th>"; html+=xTR+TR; for (i=0;i<tD.getDay();i++) html+=TD+" "+xTD; This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <dai...@us...> - 2011-09-03 11:08:04
|
Revision: 4675 http://web-erp.svn.sourceforge.net/web-erp/?rev=4675&view=rev Author: daintree Date: 2011-09-03 11:07:57 +0000 (Sat, 03 Sep 2011) Log Message: ----------- 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 Modified Paths: -------------- trunk/AccountGroups.php trunk/GLTransInquiry.php trunk/SelectCustomer.php trunk/SelectProduct.php trunk/Stocks.php trunk/doc/Change.log trunk/includes/LanguageSetup.php trunk/includes/MiscFunctions.php trunk/includes/SQL_CommonFunctions.inc trunk/javascripts/MiscFunctions.js Modified: trunk/AccountGroups.php =================================================================== --- trunk/AccountGroups.php 2011-09-02 10:38:54 UTC (rev 4674) +++ trunk/AccountGroups.php 2011-09-03 11:07:57 UTC (rev 4675) @@ -18,7 +18,9 @@ $DbgMsg = _('The SQL that was used to retrieve the account groups of the parent account group and that failed in the process was'); do { - $sql = "SELECT parentgroupname FROM accountgroups WHERE groupname='" . $GroupName ."'"; + $sql = "SELECT parentgroupname + FROM accountgroups + WHERE groupname='" . $GroupName ."'"; $result = DB_query($sql,$db,$ErrMsg,$DbgMsg); $myrow = DB_fetch_row($result); Modified: trunk/GLTransInquiry.php =================================================================== --- trunk/GLTransInquiry.php 2011-09-02 10:38:54 UTC (rev 4674) +++ trunk/GLTransInquiry.php 2011-09-03 11:07:57 UTC (rev 4675) @@ -55,12 +55,11 @@ gltrans.posted, chartmaster.accountname, periods.lastdate_in_period - FROM gltrans, - chartmaster, - periods - WHERE gltrans.account = chartmaster.accountcode - AND periods.periodno=gltrans.periodno - AND gltrans.type= '" . $_GET['TypeID'] . "' + FROM gltrans INNER JOIN chartmaster + ON gltrans.account = chartmaster.accountcode + INNER JOIN periods + ON periods.periodno=gltrans.periodno + WHERE gltrans.type= '" . $_GET['TypeID'] . "' AND gltrans.typeno = '" . $_GET['TransNo'] . "' ORDER BY gltrans.counterindex"; $TransResult = DB_query($SQL,$db); @@ -142,21 +141,21 @@ if ($DetailResult) { while ( $DetailRow = DB_fetch_row($DetailResult) ) { if ( $TransRow['amount'] > 0){ - if ($TransRow['account'] == $_SESSION['CompanyRecord']['debtorsact']) { - $Debit = locale_number_format(($DetailRow[1] + $DetailRow[2]) / $DetailRow[3],$_SESSION['CompanyRecord']['decimalplaces']); - $Credit = ' '; - } else { - $Debit = locale_number_format((-$DetailRow[1] - $DetailRow[2]) / $DetailRow[3],$_SESSION['CompanyRecord']['decimalplaces']); - $Credit = ' '; - } + if ($TransRow['account'] == $_SESSION['CompanyRecord']['debtorsact']) { + $Debit = locale_number_format(($DetailRow[1] + $DetailRow[2]) / $DetailRow[3],$_SESSION['CompanyRecord']['decimalplaces']); + $Credit = ' '; + } else { + $Debit = locale_number_format((-$DetailRow[1] - $DetailRow[2]) / $DetailRow[3],$_SESSION['CompanyRecord']['decimalplaces']); + $Credit = ' '; + } } else { - if ($TransRow['account'] == $_SESSION['CompanyRecord']['debtorsact']) { - $Credit = locale_number_format(-($DetailRow[1] + $DetailRow[2]) / $DetailRow[3],$_SESSION['CompanyRecord']['decimalplaces']); - $Debit = ' '; - } else { - $Credit = locale_number_format(($DetailRow[1] + $DetailRow[2]) / $DetailRow[3],$_SESSION['CompanyRecord']['decimalplaces']); - $Debit = ' '; - } + if ($TransRow['account'] == $_SESSION['CompanyRecord']['debtorsact']) { + $Credit = locale_number_format(-($DetailRow[1] + $DetailRow[2]) / $DetailRow[3],$_SESSION['CompanyRecord']['decimalplaces']); + $Debit = ' '; + } else { + $Credit = locale_number_format(($DetailRow[1] + $DetailRow[2]) / $DetailRow[3],$_SESSION['CompanyRecord']['decimalplaces']); + $Debit = ' '; + } } if ($j==1) { Modified: trunk/SelectCustomer.php =================================================================== --- trunk/SelectCustomer.php 2011-09-02 10:38:54 UTC (rev 4674) +++ trunk/SelectCustomer.php 2011-09-03 11:07:57 UTC (rev 4675) @@ -86,24 +86,12 @@ } } if (isset($_POST['Search']) OR isset($_POST['CSV']) OR isset($_POST['Go']) OR isset($_POST['Next']) OR isset($_POST['Previous'])) { + unset($_POST['JustSelectedACustomer']); if (isset($_POST['Search'])) { $_POST['PageOffset'] = 1; } - if (mb_strlen($_POST['Keywords'])>0) { - $msg = _('Search Result: Customer Name has been used in search') . '<br />'; - $_POST['Keywords'] = mb_strtoupper($_POST['Keywords']); - } elseif (mb_strlen($_POST['CustCode'])>0) { - $msg = _('Search Result: Customer Code has been used in search') . '<br />'; - } elseif (mb_strlen($_POST['CustPhone'])>0) { - $msg = _('Search Result: Customer Phone has been used in search') . '<br />'; - }elseif (($_POST['CustAdd'])) { - $msg = _('Search Result: Customer Address has been used in search') . '<br />'; - } elseif (isset($_POST['CustType']) AND $_POST['CustType']!='ALL') { - $msg = _('Search Result: Customer Type has been used in search') . '<br />'; - } elseif (isset($_POST['Area']) AND $_POST['Area']!='ALL') { - $msg = _('Search Result: Customer branch area has been used in search') . '<br />'; - } - if (($_POST['Keywords'] == '') AND ($_POST['CustCode'] == '') AND ($_POST['CustPhone'] == '') AND ($_POST['CustType'] == 'ALL') AND ($_POST['Area'] == 'ALL') AND ($_POST['CustAdd'] == '')) { + + if (($_POST['Keywords'] == '') AND ($_POST['CustCode'] == '') AND ($_POST['CustPhone'] == '') AND ( $_POST['CustType'] == 'ALL') AND ($_POST['Area'] == 'ALL') AND ($_POST['CustAdd'] == '')) { //no criteria set then default to all customers $SQL = "SELECT debtorsmaster.debtorno, debtorsmaster.name, @@ -122,12 +110,11 @@ INNER JOIN debtortype ON debtorsmaster.typeid = debtortype.typeid"; } else { - if (mb_strlen($_POST['Keywords']) > 0) { - //using the customer name - $_POST['Keywords'] = mb_strtoupper(trim($_POST['Keywords'])); - //insert wildcard characters in spaces - $SearchString = '%' . str_replace(' ', '%', $_POST['Keywords']) . '%'; - $SQL = "SELECT debtorsmaster.debtorno, + $SearchKeywords = mb_strtoupper(trim(str_replace(' ', '%', $_POST['Keywords']))); + $_POST['CustCode'] = mb_strtoupper(trim($_POST['CustCode'])); + $_POST['CustPhone'] = trim($_POST['CustPhone']); + $_POST['CustAdd'] = trim($_POST['CustAdd']); + $SQL = "SELECT debtorsmaster.debtorno, debtorsmaster.name, debtorsmaster.address1, debtorsmaster.address2, @@ -139,103 +126,23 @@ debtortype.typename, custbranch.phoneno, custbranch.faxno - FROM debtorsmaster LEFT JOIN custbranch - ON debtorsmaster.debtorno = custbranch.debtorno, debtortype - WHERE debtorsmaster.name " . LIKE . " '" . $SearchString . "' - AND debtorsmaster.typeid = debtortype.typeid"; - } elseif (mb_strlen($_POST['CustCode']) > 0) { - $_POST['CustCode'] = mb_strtoupper(trim($_POST['CustCode'])); - $SQL = "SELECT debtorsmaster.debtorno, - debtorsmaster.name, - debtorsmaster.address1, - debtorsmaster.address2, - debtorsmaster.address3, - debtorsmaster.address4, - custbranch.branchcode, - custbranch.brname, - custbranch.contactname, - debtortype.typename, - custbranch.phoneno, - custbranch.faxno - FROM debtorsmaster LEFT JOIN custbranch - ON debtorsmaster.debtorno = custbranch.debtorno, debtortype - WHERE debtorsmaster.debtorno " . LIKE . " '%" . $_POST['CustCode'] . "%' - AND debtorsmaster.typeid = debtortype.typeid"; - } elseif (mb_strlen($_POST['CustPhone']) > 0) { - $SQL = "SELECT debtorsmaster.debtorno, - debtorsmaster.name, - debtorsmaster.address1, - debtorsmaster.address2, - debtorsmaster.address3, - debtorsmaster.address4, - custbranch.branchcode, - custbranch.brname, - custbranch.contactname, - debtortype.typename, - custbranch.phoneno, - custbranch.faxno - FROM debtorsmaster LEFT JOIN custbranch - ON debtorsmaster.debtorno = custbranch.debtorno, debtortype - WHERE custbranch.phoneno " . LIKE . " '%" . $_POST['CustPhone'] . "%' - AND debtorsmaster.typeid = debtortype.typeid"; - // Added an option to search by address. I tried having it search address1, address2, address3, and address4, but my knowledge of MYSQL is limited. This will work okay if you select the CSV Format then you can search though the address1 field. I would like to extend this to all 4 address fields. Gilles Deacur - - } elseif (mb_strlen($_POST['CustAdd']) > 0) { - $SQL = "SELECT debtorsmaster.debtorno, - debtorsmaster.name, - debtorsmaster.address1, - debtorsmaster.address2, - debtorsmaster.address3, - debtorsmaster.address4, - custbranch.branchcode, - custbranch.brname, - custbranch.contactname, - debtortype.typename, - custbranch.phoneno, - custbranch.faxno - FROM debtorsmaster LEFT JOIN custbranch - ON debtorsmaster.debtorno = custbranch.debtorno, debtortype - WHERE debtorsmaster.address1 " . LIKE . " '%" . $_POST['CustAdd'] . "%' + FROM debtorsmaster INNER JOIN debtortype + ON debtorsmaster.typeid = debtortype.typeid + LEFT JOIN custbranch + ON debtorsmaster.debtorno = custbranch.debtorno + WHERE debtorsmaster.name " . LIKE . " '%" . $SearchKeywords . "%' + AND debtorsmaster.debtorno " . LIKE . " '%" . $_POST['CustCode'] . "%' + AND custbranch.phoneno " . LIKE . " '%" . $_POST['CustPhone'] . "%' + AND (debtorsmaster.address1 " . LIKE . " '%" . $_POST['CustAdd'] . "%' OR debtorsmaster.address2 " . LIKE . " '%" . $_POST['CustAdd'] . "%' OR debtorsmaster.address3 " . LIKE . " '%" . $_POST['CustAdd'] . "%' - OR debtorsmaster.address4 " . LIKE . " '%" . $_POST['CustAdd'] . "%' - AND debtorsmaster.typeid = debtortype.typeid"; - // End added search feature. Gilles Deacur - - } elseif (mb_strlen($_POST['CustType']) > 0 AND $_POST['CustType']!='ALL') { - $SQL = "SELECT debtorsmaster.debtorno, - debtorsmaster.name, - debtorsmaster.address1, - debtorsmaster.address2, - debtorsmaster.address3, - debtorsmaster.address4, - custbranch.branchcode, - custbranch.brname, - custbranch.contactname, - debtortype.typename, - custbranch.phoneno, - custbranch.faxno - FROM debtorsmaster LEFT JOIN custbranch - ON debtorsmaster.debtorno = custbranch.debtorno, debtortype - WHERE debtorsmaster.typeid LIKE debtortype.typeid - AND debtortype.typename = '" . $_POST['CustType'] . "'"; - } elseif (mb_strlen($_POST['Area']) > 0 AND $_POST['Area']!='ALL') { - $SQL = "SELECT debtorsmaster.debtorno, - debtorsmaster.name, - debtorsmaster.address1, - debtorsmaster.address2, - debtorsmaster.address3, - debtorsmaster.address4, - custbranch.branchcode, - custbranch.brname, - custbranch.contactname, - debtortype.typename, - custbranch.phoneno, - custbranch.faxno - FROM debtorsmaster LEFT JOIN custbranch - ON debtorsmaster.debtorno = custbranch.debtorno, debtortype - WHERE debtorsmaster.typeid LIKE debtortype.typeid - AND custbranch.area = '" . $_POST['Area'] . "'"; + OR debtorsmaster.address4 " . LIKE . " '%" . $_POST['CustAdd'] . "%')"; + + if (mb_strlen($_POST['CustType']) > 0 AND $_POST['CustType']!='ALL') { + $SQL .= " AND debtortype.typename = '" . $_POST['CustType'] . "'"; + } + if (mb_strlen($_POST['Area']) > 0 AND $_POST['Area']!='ALL') { + $SQL .= " AND custbranch.area = '" . $_POST['Area'] . "'"; } } //one of keywords or custcode or custphone was more than a zero length string if ($_SESSION['SalesmanLogin'] != '') { @@ -251,6 +158,7 @@ $_SESSION['CustomerID'] = $myrow['debtorno']; $_SESSION['BranchCode'] = $myrow['branchcode']; unset($result); + unset($_POST['Search']); } elseif (DB_num_rows($result) == 0) { prnMsg(_('No customer records contain the selected text') . ' - ' . _('please alter your search criteria and try again'), 'info'); echo '<br />'; @@ -515,8 +423,8 @@ $k = 1; } echo '<td><font size="1"><input type="submit" name="SubmitCustomerSelection' . $i .'" value="' . htmlentities($myrow['debtorno'].' '.$myrow['branchcode'],ENT_QUOTES,'UTF-8') . '" /></font></td> - <input type="hidden" name="SelectedCustomer' . $i .'" value="'.$myrow['debtorno'].'"> - <input type="hidden" name="SelectedBranch' . $i .'" value="'. $myrow['branchcode'].'" /> + <input type="hidden" name="SelectedCustomer' . $i . '" value="'.$myrow['debtorno'].'"> + <input type="hidden" name="SelectedBranch' . $i . '" value="'. $myrow['branchcode'].'" /> <td><font size=1>' . $myrow['name'] . '</font></td> <td><font size=1>' . $myrow['brname'] . '</font></td> <td><font size=1>' . $myrow['contactname'] . '</font></td> @@ -578,10 +486,11 @@ // Extended Customer Info only if selected in Configuration if ($_SESSION['Extended_CustomerInfo'] == 1) { if ($_SESSION['CustomerID'] != '') { - $sql = "SELECT debtortype.typeid, debtortype.typename - FROM debtorsmaster, debtortype - WHERE debtorsmaster.typeid = debtortype.typeid - AND debtorsmaster.debtorno = '" . $_SESSION['CustomerID'] . "'"; + $sql = "SELECT debtortype.typeid, + debtortype.typename + FROM debtorsmaster INNER JOIN debtortype + ON debtorsmaster.typeid = debtortype.typeid + WHERE debtorsmaster.debtorno = '" . $_SESSION['CustomerID'] . "'"; $ErrMsg = _('An error occurred in retrieving the information'); $result = DB_query($sql, $db, $ErrMsg); $myrow = DB_fetch_array($result); Modified: trunk/SelectProduct.php =================================================================== --- trunk/SelectProduct.php 2011-09-02 10:38:54 UTC (rev 4674) +++ trunk/SelectProduct.php 2011-09-03 11:07:57 UTC (rev 4675) @@ -129,7 +129,8 @@ WHERE currabrev ='" . $_SESSION['CompanyRecord']['currencydefault'] . "' AND typeabbrev = '" . $_SESSION['DefaultPriceList'] . "' AND debtorno='' - AND branchcode='' + AND branchcode='' + AND startdate <= '". Date('Y-m-d') ."' AND ( enddate >= '" . Date('Y-m-d') . "' OR enddate = '0000-00-00') AND stockid='" . $StockID . "'", $db); if ($myrow['mbflag'] == 'K' OR $myrow['mbflag'] == 'A') { $CostResult = DB_query("SELECT SUM(bom.quantity * (stockmaster.materialcost+stockmaster.labourcost+stockmaster.overheadcost)) AS cost Modified: trunk/Stocks.php =================================================================== --- trunk/Stocks.php 2011-09-02 10:38:54 UTC (rev 4674) +++ trunk/Stocks.php 2011-09-03 11:07:57 UTC (rev 4675) @@ -1171,7 +1171,7 @@ echo '<input type="submit" name="UpdateCategories" style="visibility:hidden;width:1px" value="' . _('Categories') . '" />'; echo '<p>'; prnMsg( _('Only click the Delete button if you are sure you wish to delete the item!') . _('Checks will be made to ensure that there are no stock movements, sales analysis records, sales order items or purchase order items for the item') . '. ' . _('No deletions will be allowed if they exist'), 'warn', _('WARNING')); - echo '<p><input type="Submit" name="delete" value="' . _('Delete This Item') . '" onclick="return confirm(\'' . _('Are You Sure?') . '\');">'; + echo '<p><input type="submit" name="delete" value="' . _('Delete This Item') . '" onclick="return confirm(\'' . _('Are You Sure?') . '\');">'; } echo '</form></div>'; Modified: trunk/doc/Change.log =================================================================== --- trunk/doc/Change.log 2011-09-02 10:38:54 UTC (rev 4674) +++ trunk/doc/Change.log 2011-09-03 11:07:57 UTC (rev 4675) @@ -1,5 +1,7 @@ webERP Change Log +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() 2/9/11 Warren Olds: scaling of image in GetStockImage.php 31/8/11 Ricard: StockAdjustments.php now sends an email to the inventory manager on the creation of manual stock adjustments. The inventory manager email is defined in SystemParameters.php - leaving the email address blank will stop any emails from being created. Modified: trunk/includes/LanguageSetup.php =================================================================== --- trunk/includes/LanguageSetup.php 2011-09-02 10:38:54 UTC (rev 4674) +++ trunk/includes/LanguageSetup.php 2011-09-03 11:07:57 UTC (rev 4675) @@ -37,7 +37,7 @@ if ($_SESSION['Language']=='tr_TR.utf8') { $Locale = setlocale(LC_CTYPE, 'C'); } - + $Locale = setlocale (LC_NUMERIC, 'en_US'); //currently need all decimal points etc to be as expected on webserver // possibly even if locale fails the language will still switch by using Language instead of locale variable @@ -81,7 +81,6 @@ return $text; } } -} - +} ?> \ No newline at end of file Modified: trunk/includes/MiscFunctions.php =================================================================== --- trunk/includes/MiscFunctions.php 2011-09-02 10:38:54 UTC (rev 4674) +++ trunk/includes/MiscFunctions.php 2011-09-03 11:07:57 UTC (rev 4675) @@ -313,7 +313,7 @@ } function locale_number_format($Number, $DecimalPlaces) { - $LocaleInfo = localeconv(); + $LocaleInfo = localeconv(); return number_format($Number, $DecimalPlaces, $LocaleInfo['decimal_point'], $LocaleInfo['thousands_sep']); } Modified: trunk/includes/SQL_CommonFunctions.inc =================================================================== --- trunk/includes/SQL_CommonFunctions.inc 2011-09-02 10:38:54 UTC (rev 4674) +++ trunk/includes/SQL_CommonFunctions.inc 2011-09-03 11:07:57 UTC (rev 4675) @@ -13,7 +13,8 @@ 10 sales invoice 11 sales credit note 12 sales receipt - +etc +* */ DB_query("LOCK TABLES systypes WRITE",$db); Modified: trunk/javascripts/MiscFunctions.js =================================================================== --- trunk/javascripts/MiscFunctions.js 2011-09-02 10:38:54 UTC (rev 4674) +++ trunk/javascripts/MiscFunctions.js 2011-09-03 11:07:57 UTC (rev 4675) @@ -11,7 +11,7 @@ else return true; kC=String.fromCharCode(k); if ((k==null) || (k==0) || (k==8) || (k==9) || (k==13) || (k==27)) return true; - else if ((("0123456789.-").indexOf(kC)>-1)) return true; + else if ((("0123456789.,-").indexOf(kC)>-1)) return true; else return false; } function assignComboToInput(c,i){ @@ -107,8 +107,8 @@ xTR="</tr>"; TD="<td class='dpTD' onMouseOut='this.className=\"dpTD\";' onMouseOver='this.className=\"dpTDHover\";'"; xTD="</td>"; - html="<table class='dpTbl'>"+TR+"<th colspan=3>"+months[tD.getMonth()]+" "+tD.getFullYear()+"</th>"+"<td colspan=2>"+ - getButtonCode(md,tD,-1,"<",dF)+xTD+"<td colspan=2>"+getButtonCode(md,tD,1,">",dF)+xTD+xTR+TR; + html="<table class='dpTbl'>"+TR+"<th colspan=\"3\">"+months[tD.getMonth()]+" "+tD.getFullYear()+"</th>"+"<td colspan=\"2\">"+ + getButtonCode(md,tD,-1,"<",dF)+xTD+"<td colspan=\"2\">"+getButtonCode(md,tD,1,">",dF)+xTD+xTR+TR; for(i=0;i<days.length;i++) html+="<th>"+days[i]+"</th>"; html+=xTR+TR; for (i=0;i<tD.getDay();i++) html+=TD+" "+xTD; This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |