From: <dai...@us...> - 2011-08-19 10:13:22
|
Revision: 4662 http://web-erp.svn.sourceforge.net/web-erp/?rev=4662&view=rev Author: daintree Date: 2011-08-19 10:13:15 +0000 (Fri, 19 Aug 2011) Log Message: ----------- Ricard formatting changes Modified Paths: -------------- trunk/PDFStockNegatives.php trunk/doc/Change.log Modified: trunk/PDFStockNegatives.php =================================================================== --- trunk/PDFStockNegatives.php 2011-08-19 06:17:03 UTC (rev 4661) +++ trunk/PDFStockNegatives.php 2011-08-19 10:13:15 UTC (rev 4662) @@ -1,17 +1,13 @@ <?php -/* $Revision: 1.7 $ */ /* $Id$*/ -/* $Revision: 1.8 $ */ - -//$PageSecurity =1; include('includes/session.inc'); include('includes/PDFStarter.php'); $pdf->addInfo('Title', _('Inventory Negatives Listing') ); $pdf->addInfo('Subject', _('Inventory Negatives Listing')); -$FontSize=10; +$FontSize=9; $PageNumber=1; $line_height=15; @@ -47,9 +43,9 @@ do { - $LeftOvers = $pdf->addTextWrap($Left_Margin,$YPos,100,$FontSize, $NegativesRow['loccode'] . ' - ' . $NegativesRow['locationname'], 'left'); - $LeftOvers = $pdf->addTextWrap(130,$YPos,250,$FontSize,$NegativesRow['stockid'] . ' - ' .$NegativesRow['description'], 'left'); - $LeftOvers = $pdf->addTextWrap(400,$YPos,70,$FontSize,$NegativesRow['quantity'], 'right'); + $LeftOvers = $pdf->addTextWrap($Left_Margin,$YPos,130,$FontSize, $NegativesRow['loccode'] . ' - ' . $NegativesRow['locationname'], 'left'); + $LeftOvers = $pdf->addTextWrap(170,$YPos,350,$FontSize,$NegativesRow['stockid'] . ' - ' .$NegativesRow['description'], 'left'); + $LeftOvers = $pdf->addTextWrap(520,$YPos,30,$FontSize,$NegativesRow['quantity'], 'right'); $pdf->line($Left_Margin, $YPos-2,$Page_Width-$Right_Margin, $YPos-2); @@ -62,6 +58,13 @@ } while ($NegativesRow = DB_fetch_array($result)); -$pdf->OutputD($_SESSION['DatabaseName'] . '_NegativeStocks_' . date('Y-m-d') . '.pdf');//UldisN -$pdf->__destruct(); //UldisN +if (DB_num_rows($result)>0){ + $pdf->OutputD($_SESSION['DatabaseName'] . '_NegativeStocks_' . date('Y-m-d') . '.pdf'); + $pdf->__destruct(); +} else { + $title = _('Negative Stock Listing Problem'); + include('includes/header.inc'); + prnMsg(_('There are no negative stocks to list'),'info'); + include('includes/footer.inc'); +} ?> Modified: trunk/doc/Change.log =================================================================== --- trunk/doc/Change.log 2011-08-19 06:17:03 UTC (rev 4661) +++ trunk/doc/Change.log 2011-08-19 10:13:15 UTC (rev 4662) @@ -1,5 +1,7 @@ webERP Change Log +19/8/11 Ricard: Fine tuning formatting PDFStockNegatives.php +19/8/11 Carlos Urbieta Cabrera: security.png image was missing now added 14/8/11 Phil: SystemParameters.php default ProhibitPostingsBefore to 1900-01-01 when no default is currently set - can cause errors at the moment as defaults to the latest period if not previously set. 14/8/11 Phil: Stocks.php now does a journal for any work in progress on a change of category where the new category has a different GL account for WIP - and bug fixes as per Ricard 12/8/11 Phil: Backed out changes on 7/8 that prevented SelectProduct.php transaction links - now only purchase order links blocked if an item is obsolete This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <dai...@us...> - 2011-08-19 10:13:22
|
Revision: 4662 http://web-erp.svn.sourceforge.net/web-erp/?rev=4662&view=rev Author: daintree Date: 2011-08-19 10:13:15 +0000 (Fri, 19 Aug 2011) Log Message: ----------- Ricard formatting changes Modified Paths: -------------- trunk/PDFStockNegatives.php trunk/doc/Change.log Modified: trunk/PDFStockNegatives.php =================================================================== --- trunk/PDFStockNegatives.php 2011-08-19 06:17:03 UTC (rev 4661) +++ trunk/PDFStockNegatives.php 2011-08-19 10:13:15 UTC (rev 4662) @@ -1,17 +1,13 @@ <?php -/* $Revision: 1.7 $ */ /* $Id$*/ -/* $Revision: 1.8 $ */ - -//$PageSecurity =1; include('includes/session.inc'); include('includes/PDFStarter.php'); $pdf->addInfo('Title', _('Inventory Negatives Listing') ); $pdf->addInfo('Subject', _('Inventory Negatives Listing')); -$FontSize=10; +$FontSize=9; $PageNumber=1; $line_height=15; @@ -47,9 +43,9 @@ do { - $LeftOvers = $pdf->addTextWrap($Left_Margin,$YPos,100,$FontSize, $NegativesRow['loccode'] . ' - ' . $NegativesRow['locationname'], 'left'); - $LeftOvers = $pdf->addTextWrap(130,$YPos,250,$FontSize,$NegativesRow['stockid'] . ' - ' .$NegativesRow['description'], 'left'); - $LeftOvers = $pdf->addTextWrap(400,$YPos,70,$FontSize,$NegativesRow['quantity'], 'right'); + $LeftOvers = $pdf->addTextWrap($Left_Margin,$YPos,130,$FontSize, $NegativesRow['loccode'] . ' - ' . $NegativesRow['locationname'], 'left'); + $LeftOvers = $pdf->addTextWrap(170,$YPos,350,$FontSize,$NegativesRow['stockid'] . ' - ' .$NegativesRow['description'], 'left'); + $LeftOvers = $pdf->addTextWrap(520,$YPos,30,$FontSize,$NegativesRow['quantity'], 'right'); $pdf->line($Left_Margin, $YPos-2,$Page_Width-$Right_Margin, $YPos-2); @@ -62,6 +58,13 @@ } while ($NegativesRow = DB_fetch_array($result)); -$pdf->OutputD($_SESSION['DatabaseName'] . '_NegativeStocks_' . date('Y-m-d') . '.pdf');//UldisN -$pdf->__destruct(); //UldisN +if (DB_num_rows($result)>0){ + $pdf->OutputD($_SESSION['DatabaseName'] . '_NegativeStocks_' . date('Y-m-d') . '.pdf'); + $pdf->__destruct(); +} else { + $title = _('Negative Stock Listing Problem'); + include('includes/header.inc'); + prnMsg(_('There are no negative stocks to list'),'info'); + include('includes/footer.inc'); +} ?> Modified: trunk/doc/Change.log =================================================================== --- trunk/doc/Change.log 2011-08-19 06:17:03 UTC (rev 4661) +++ trunk/doc/Change.log 2011-08-19 10:13:15 UTC (rev 4662) @@ -1,5 +1,7 @@ webERP Change Log +19/8/11 Ricard: Fine tuning formatting PDFStockNegatives.php +19/8/11 Carlos Urbieta Cabrera: security.png image was missing now added 14/8/11 Phil: SystemParameters.php default ProhibitPostingsBefore to 1900-01-01 when no default is currently set - can cause errors at the moment as defaults to the latest period if not previously set. 14/8/11 Phil: Stocks.php now does a journal for any work in progress on a change of category where the new category has a different GL account for WIP - and bug fixes as per Ricard 12/8/11 Phil: Backed out changes on 7/8 that prevented SelectProduct.php transaction links - now only purchase order links blocked if an item is obsolete This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <dai...@us...> - 2011-08-20 05:52:46
|
Revision: 4663 http://web-erp.svn.sourceforge.net/web-erp/?rev=4663&view=rev Author: daintree Date: 2011-08-20 05:52:38 +0000 (Sat, 20 Aug 2011) Log Message: ----------- 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 Modified Paths: -------------- trunk/Stocks.php trunk/UpgradeDatabase.php trunk/Z_ChangeStockCode.php trunk/Z_CopyBOM.php trunk/doc/Change.log trunk/includes/ConnectDB.inc Modified: trunk/Stocks.php =================================================================== --- trunk/Stocks.php 2011-08-19 10:13:15 UTC (rev 4662) +++ trunk/Stocks.php 2011-08-20 05:52:38 UTC (rev 4663) @@ -64,7 +64,7 @@ if ($UploadTheFile=='Yes'){ $result = move_uploaded_file($_FILES['ItemPicture']['tmp_name'], $filename); - $message = ($result)?_('File url') ."<a href='". $filename ."'>" . $filename . '</a>' : _('Something is wrong with uploading a file'); + $message = ($result)?_('File url') .'<a href="' . $filename .'">' . $filename . '</a>' : _('Something is wrong with uploading a file'); } } @@ -307,7 +307,10 @@ /*now check that if it was Manufac, Phantom or Purchased and is being changed to assembly or kitset, it is not a component on an existing BOM */ if (($OldMBFlag=='M' OR $OldMBFlag =='B' OR $OldMBFlag=='D' OR $OldMBFlag=='G') AND ($_POST['MBFlag']=='A' OR $_POST['MBFlag']=='K')) { - $sql = "SELECT COUNT(*) FROM bom WHERE component = '".$StockID."' GROUP BY component"; + $sql = "SELECT COUNT(*) + FROM bom + WHERE component = '".$StockID."' + GROUP BY component"; $result = DB_query($sql,$db); $ChkBOM = DB_fetch_row($result); if ($ChkBOM[0]!=0){ @@ -397,7 +400,7 @@ VALUES ( 0, '" . $JournalNo . "', '" . Date('Y-m-d') . "', - '" . GetPeriod(Date('Y-m-d'),$db,true) . "', + '" . GetPeriod(Date($_SESSION['DefaultDateFormat']),$db,true) . "', '" . $NewStockAccount . "', '" . $StockID . ' ' . _('Change stock category') . "', '" . ($UnitCost* $StockQtyRow[0]) . "'"; @@ -414,7 +417,7 @@ VALUES ( 0, '" . $JournalNo . "', '" . Date('Y-m-d') . "', - '" . GetPeriod(Date('Y-m-d'),$db,true) . "', + '" . GetPeriod(Date($_SESSION['DefaultDateFormat']),$db,true) . "', '" . $OldStockAccount . "', '" . $StockID . ' ' . _('Change stock category') . "', '" . (-$UnitCost* $StockQtyRow[0]) . "'"; @@ -452,7 +455,7 @@ VALUES ( 0, '" . $JournalNo . "', '" . Date('Y-m-d') . "', - '" . GetPeriod(Date('Y-m-d'),$db,true) . "', + '" . GetPeriod(Date($_SESSION['DefaultDateFormat']),$db,true) . "', '" . $NewWIPAct . "', '" . $StockID . ' ' . _('Change stock category') . "', '" . $WIPValue . "'"; @@ -469,7 +472,7 @@ VALUES ( 0, '" . $JournalNo . "', '" . Date('Y-m-d') . "', - '" . GetPeriod(Date('Y-m-d'),true) . "', + '" . GetPeriod(Date($_SESSION['DefaultDateFormat']),$db,true) . "', '" . $OldWIPAccount . "', '" . $StockID . ' ' . _('Change stock category') . "', '" . (-$WIPValue) . "'"; Modified: trunk/UpgradeDatabase.php =================================================================== --- trunk/UpgradeDatabase.php 2011-08-19 10:13:15 UTC (rev 4662) +++ trunk/UpgradeDatabase.php 2011-08-20 05:52:38 UTC (rev 4663) @@ -34,7 +34,7 @@ if ($_SESSION['VersionNumber']=='4.00RC1'){ $_SESSION['VersionNumber']='3.12'; } - if ( $_SESSION['VersionNumber'] == $Version){ + if (strcmp($Version,$_SESSION['VersionNumber'])==0){ prnMsg(_('The database is up to date, there are no upgrades to perform'),'info'); } else { prnMsg(_('This script will perform any modifications to the database required to allow the additional functionality in later scripts.') . '<br />' . _('The webERP code is version') . ' ' . $Version . ' ' . _('and the database version is') . ' ' . $_SESSION['VersionNumber'] . '<br /><a target="_blank" href="' . $rootpath . '/BackupDatabase.php">' ._('Click to do a database backup now before proceeding!') . '</a>','info'); @@ -111,6 +111,9 @@ case '4.04.5': $SQLScripts[] = './sql/mysql/upgrade4.04.5-4.05.sql'; case '4.05': + case '4.05.1': + $SQLScripts[] = './sql/mysql/upgrade4.05-4.06.sql'; + case '4.06': break; } //end switch } Modified: trunk/Z_ChangeStockCode.php =================================================================== --- trunk/Z_ChangeStockCode.php 2011-08-19 10:13:15 UTC (rev 4662) +++ trunk/Z_ChangeStockCode.php 2011-08-20 05:52:38 UTC (rev 4663) @@ -52,7 +52,6 @@ longdescription, units, mbflag, - lastcurcostdate, actualcost, lastcost, materialcost, @@ -73,7 +72,6 @@ longdescription, units, mbflag, - lastcurcostdate, actualcost, lastcost, materialcost, Modified: trunk/Z_CopyBOM.php =================================================================== --- trunk/Z_CopyBOM.php 2011-08-19 10:13:15 UTC (rev 4662) +++ trunk/Z_CopyBOM.php 2011-08-20 05:52:38 UTC (rev 4663) @@ -6,33 +6,30 @@ */ /* $Id$*/ -//$PageSecurity=9; include('includes/session.inc'); include('includes/SQL_CommonFunctions.inc'); if(isset($_POST['Submit'])) { - $stkid = $_POST['stkid']; + $StkID = $_POST['StkID']; $type = $_POST['type']; - $newstkid = ''; + $newStkID = ''; - if($type == 'N') - $newstkid = $_POST['tostkid']; - else - $newstkid = $_POST['exstkid']; + if($type == 'N') { + $newStkID = $_POST['toStkID']; + } else { + $newStkID = $_POST['exStkID']; + } + $result = DB_query('begin', $db); - $result = DB_query("begin", $db); - - if($type == 'N') - { + if($type == 'N') { /* duplicate rows into stockmaster */ - $sql = "insert into stockmaster - select '".$newstkid."' as stockid, + $sql = "INSERT INTO stockmaster + select '".$newStkID."' as stockid, categoryid, description, longdescription, units, mbflag, - lastcurcostdate, actualcost, lastcost, materialcost, @@ -51,32 +48,31 @@ appendfile, perishable, decimalplaces - from stockmaster - where stockid='".$stkid."';"; + FROM stockmaster + WHERE stockid='".$StkID."';"; $result = DB_query($sql, $db); } else { - $sql = "SELECT lastcurcostdate, actualcost, lastcost, materialcost, labourcost, overheadcost, lowestlevel - FROM stockmaster WHERE stockid='".$stkid."';"; + $sql = "SELECT actualcost, lastcost, materialcost, labourcost, overheadcost, lowestlevel + FROM stockmaster WHERE stockid='".$StkID."';"; $result = DB_query($sql, $db); $row = DB_fetch_row($result); - $sql = "update stockmaster set - lastcurcostdate = '".$row[0]."', - actualcost = ".$row[1].", - lastcost = ".$row[2].", - materialcost = ".$row[3].", - labourcost = ".$row[4].", - overheadcost = ".$row[5].", - lowestlevel = ".$row[6]." - where stockid='".$newstkid."';"; + $sql = "UPDATE stockmaster SET + actualcost = ".$row[0].", + lastcost = ".$row[1].", + materialcost = ".$row[2].", + labourcost = ".$row[3].", + overheadcost = ".$row[4].", + lowestlevel = ".$row[5]." + WHERE stockid='".$newStkID."';"; $result = DB_query($sql, $db); } - $sql = "insert into bom - select '".$newstkid."' as parent, + $sql = "INSERT INTO bom + SELECT '".$newStkID."' as parent, component, workcentreadded, loccode, @@ -84,25 +80,25 @@ effectiveto, quantity, autoissue - from bom - where parent='".$stkid."';"; + FROM bom + WHERE parent='".$StkID."';"; $result = DB_query($sql, $db); if($type == 'N') { - $sql = "insert into locstock - select loccode, '".$newstkid."' as stockid,0 as quantity, - reorderlevel - from locstock - where stockid='".$stkid."';"; + $sql = "INSERT INTO locstock + SELECT loccode, '".$newStkID."' as stockid,0 as quantity, + reorderlevel + FROM locstock + WHERE stockid='".$StkID."';"; $result = DB_query($sql, $db); } - $result = DB_query('commit', $db); + DB_Txn_Commit($db); - UpdateCost($db, $newstkid); + UpdateCost($db, $newStkID); - header('Location: BOMs.php?Select='.$newstkid); + header('Location: BOMs.php?Select='.$newStkID); } else @@ -110,20 +106,19 @@ $title = _('UTILITY PAGE To Copy a BOM'); include('includes/header.inc'); - echo "<form method=\"post\" action=\"Z_CopyBOM.php\">"; + echo '<form method="post" action="Z_CopyBOM.php">'; echo '<input type="hidden" name="FormID" value="' . $_SESSION['FormID'] . '" />'; $sql = "SELECT stockid, description FROM stockmaster WHERE stockid IN (SELECT DISTINCT parent FROM bom) AND mbflag IN ('M', 'A', 'K');"; $result = DB_query($sql, $db); - echo "<p>"._("From Stock ID"); - echo ": <select name=\"stkid\">"; + echo '<p>'._('From Stock ID') . ': <select name="StkID">'; while($row = DB_fetch_row($result)) { echo "<option value=\"$row[0]\">".$row[0]." -- ".$row[1]."</option>"; } echo "</select><br/><input type=\"radio\" name=\"type\" value=\"N\" checked=\"\"/>"._(" To New Stock ID"); - echo ": <input type=\"text\" maxlength=\"20\" name=\"tostkid\"/>"; + echo ": <input type=\"text\" maxlength=\"20\" name=\"toStkID\"/>"; $sql = "SELECT stockid, description FROM stockmaster WHERE stockid NOT IN (SELECT DISTINCT parent FROM bom) AND mbflag IN ('M', 'A', 'K');"; $result = DB_query($sql, $db); @@ -131,7 +126,7 @@ if(DB_num_rows($result) > 0) { echo "<br/><input type=\"radio\" name=\"type\" value=\"E\"/>"._("To Existing Stock ID"); - echo ": <select name=\"exstkid\">"; + echo ": <select name=\"exStkID\">"; while($row = DB_fetch_row($result)) { echo "<option value=\"$row[0]\">".$row[0]." -- ".$row[1]."</option>"; @@ -141,6 +136,6 @@ echo "</p>"; echo "<input type=\"submit\" name=\"Submit\" value=\"Submit\"/></p>"; - include("includes/footer.inc"); + include('includes/footer.inc'); } ?> Modified: trunk/doc/Change.log =================================================================== --- trunk/doc/Change.log 2011-08-19 10:13:15 UTC (rev 4662) +++ trunk/doc/Change.log 2011-08-20 05:52:38 UTC (rev 4663) @@ -1,5 +1,8 @@ webERP Change Log +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. +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 14/8/11 Phil: SystemParameters.php default ProhibitPostingsBefore to 1900-01-01 when no default is currently set - can cause errors at the moment as defaults to the latest period if not previously set. Modified: trunk/includes/ConnectDB.inc =================================================================== --- trunk/includes/ConnectDB.inc 2011-08-19 10:13:15 UTC (rev 4662) +++ trunk/includes/ConnectDB.inc 2011-08-20 05:52:38 UTC (rev 4663) @@ -4,7 +4,7 @@ * this value is saved in the $_SESSION['Versionumber'] when includes/GetConfig.php is run * if VersionNumber is < $Version then the DB update script is run */ -$Version='4.05'; //must update manually every time there is a DB change +$Version='4.05.1'; //must update manually every time there is a DB change require_once ($PathPrefix .'includes/MiscFunctions.php'); This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <dai...@us...> - 2011-08-20 05:52:45
|
Revision: 4663 http://web-erp.svn.sourceforge.net/web-erp/?rev=4663&view=rev Author: daintree Date: 2011-08-20 05:52:38 +0000 (Sat, 20 Aug 2011) Log Message: ----------- 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 Modified Paths: -------------- trunk/Stocks.php trunk/UpgradeDatabase.php trunk/Z_ChangeStockCode.php trunk/Z_CopyBOM.php trunk/doc/Change.log trunk/includes/ConnectDB.inc Modified: trunk/Stocks.php =================================================================== --- trunk/Stocks.php 2011-08-19 10:13:15 UTC (rev 4662) +++ trunk/Stocks.php 2011-08-20 05:52:38 UTC (rev 4663) @@ -64,7 +64,7 @@ if ($UploadTheFile=='Yes'){ $result = move_uploaded_file($_FILES['ItemPicture']['tmp_name'], $filename); - $message = ($result)?_('File url') ."<a href='". $filename ."'>" . $filename . '</a>' : _('Something is wrong with uploading a file'); + $message = ($result)?_('File url') .'<a href="' . $filename .'">' . $filename . '</a>' : _('Something is wrong with uploading a file'); } } @@ -307,7 +307,10 @@ /*now check that if it was Manufac, Phantom or Purchased and is being changed to assembly or kitset, it is not a component on an existing BOM */ if (($OldMBFlag=='M' OR $OldMBFlag =='B' OR $OldMBFlag=='D' OR $OldMBFlag=='G') AND ($_POST['MBFlag']=='A' OR $_POST['MBFlag']=='K')) { - $sql = "SELECT COUNT(*) FROM bom WHERE component = '".$StockID."' GROUP BY component"; + $sql = "SELECT COUNT(*) + FROM bom + WHERE component = '".$StockID."' + GROUP BY component"; $result = DB_query($sql,$db); $ChkBOM = DB_fetch_row($result); if ($ChkBOM[0]!=0){ @@ -397,7 +400,7 @@ VALUES ( 0, '" . $JournalNo . "', '" . Date('Y-m-d') . "', - '" . GetPeriod(Date('Y-m-d'),$db,true) . "', + '" . GetPeriod(Date($_SESSION['DefaultDateFormat']),$db,true) . "', '" . $NewStockAccount . "', '" . $StockID . ' ' . _('Change stock category') . "', '" . ($UnitCost* $StockQtyRow[0]) . "'"; @@ -414,7 +417,7 @@ VALUES ( 0, '" . $JournalNo . "', '" . Date('Y-m-d') . "', - '" . GetPeriod(Date('Y-m-d'),$db,true) . "', + '" . GetPeriod(Date($_SESSION['DefaultDateFormat']),$db,true) . "', '" . $OldStockAccount . "', '" . $StockID . ' ' . _('Change stock category') . "', '" . (-$UnitCost* $StockQtyRow[0]) . "'"; @@ -452,7 +455,7 @@ VALUES ( 0, '" . $JournalNo . "', '" . Date('Y-m-d') . "', - '" . GetPeriod(Date('Y-m-d'),$db,true) . "', + '" . GetPeriod(Date($_SESSION['DefaultDateFormat']),$db,true) . "', '" . $NewWIPAct . "', '" . $StockID . ' ' . _('Change stock category') . "', '" . $WIPValue . "'"; @@ -469,7 +472,7 @@ VALUES ( 0, '" . $JournalNo . "', '" . Date('Y-m-d') . "', - '" . GetPeriod(Date('Y-m-d'),true) . "', + '" . GetPeriod(Date($_SESSION['DefaultDateFormat']),$db,true) . "', '" . $OldWIPAccount . "', '" . $StockID . ' ' . _('Change stock category') . "', '" . (-$WIPValue) . "'"; Modified: trunk/UpgradeDatabase.php =================================================================== --- trunk/UpgradeDatabase.php 2011-08-19 10:13:15 UTC (rev 4662) +++ trunk/UpgradeDatabase.php 2011-08-20 05:52:38 UTC (rev 4663) @@ -34,7 +34,7 @@ if ($_SESSION['VersionNumber']=='4.00RC1'){ $_SESSION['VersionNumber']='3.12'; } - if ( $_SESSION['VersionNumber'] == $Version){ + if (strcmp($Version,$_SESSION['VersionNumber'])==0){ prnMsg(_('The database is up to date, there are no upgrades to perform'),'info'); } else { prnMsg(_('This script will perform any modifications to the database required to allow the additional functionality in later scripts.') . '<br />' . _('The webERP code is version') . ' ' . $Version . ' ' . _('and the database version is') . ' ' . $_SESSION['VersionNumber'] . '<br /><a target="_blank" href="' . $rootpath . '/BackupDatabase.php">' ._('Click to do a database backup now before proceeding!') . '</a>','info'); @@ -111,6 +111,9 @@ case '4.04.5': $SQLScripts[] = './sql/mysql/upgrade4.04.5-4.05.sql'; case '4.05': + case '4.05.1': + $SQLScripts[] = './sql/mysql/upgrade4.05-4.06.sql'; + case '4.06': break; } //end switch } Modified: trunk/Z_ChangeStockCode.php =================================================================== --- trunk/Z_ChangeStockCode.php 2011-08-19 10:13:15 UTC (rev 4662) +++ trunk/Z_ChangeStockCode.php 2011-08-20 05:52:38 UTC (rev 4663) @@ -52,7 +52,6 @@ longdescription, units, mbflag, - lastcurcostdate, actualcost, lastcost, materialcost, @@ -73,7 +72,6 @@ longdescription, units, mbflag, - lastcurcostdate, actualcost, lastcost, materialcost, Modified: trunk/Z_CopyBOM.php =================================================================== --- trunk/Z_CopyBOM.php 2011-08-19 10:13:15 UTC (rev 4662) +++ trunk/Z_CopyBOM.php 2011-08-20 05:52:38 UTC (rev 4663) @@ -6,33 +6,30 @@ */ /* $Id$*/ -//$PageSecurity=9; include('includes/session.inc'); include('includes/SQL_CommonFunctions.inc'); if(isset($_POST['Submit'])) { - $stkid = $_POST['stkid']; + $StkID = $_POST['StkID']; $type = $_POST['type']; - $newstkid = ''; + $newStkID = ''; - if($type == 'N') - $newstkid = $_POST['tostkid']; - else - $newstkid = $_POST['exstkid']; + if($type == 'N') { + $newStkID = $_POST['toStkID']; + } else { + $newStkID = $_POST['exStkID']; + } + $result = DB_query('begin', $db); - $result = DB_query("begin", $db); - - if($type == 'N') - { + if($type == 'N') { /* duplicate rows into stockmaster */ - $sql = "insert into stockmaster - select '".$newstkid."' as stockid, + $sql = "INSERT INTO stockmaster + select '".$newStkID."' as stockid, categoryid, description, longdescription, units, mbflag, - lastcurcostdate, actualcost, lastcost, materialcost, @@ -51,32 +48,31 @@ appendfile, perishable, decimalplaces - from stockmaster - where stockid='".$stkid."';"; + FROM stockmaster + WHERE stockid='".$StkID."';"; $result = DB_query($sql, $db); } else { - $sql = "SELECT lastcurcostdate, actualcost, lastcost, materialcost, labourcost, overheadcost, lowestlevel - FROM stockmaster WHERE stockid='".$stkid."';"; + $sql = "SELECT actualcost, lastcost, materialcost, labourcost, overheadcost, lowestlevel + FROM stockmaster WHERE stockid='".$StkID."';"; $result = DB_query($sql, $db); $row = DB_fetch_row($result); - $sql = "update stockmaster set - lastcurcostdate = '".$row[0]."', - actualcost = ".$row[1].", - lastcost = ".$row[2].", - materialcost = ".$row[3].", - labourcost = ".$row[4].", - overheadcost = ".$row[5].", - lowestlevel = ".$row[6]." - where stockid='".$newstkid."';"; + $sql = "UPDATE stockmaster SET + actualcost = ".$row[0].", + lastcost = ".$row[1].", + materialcost = ".$row[2].", + labourcost = ".$row[3].", + overheadcost = ".$row[4].", + lowestlevel = ".$row[5]." + WHERE stockid='".$newStkID."';"; $result = DB_query($sql, $db); } - $sql = "insert into bom - select '".$newstkid."' as parent, + $sql = "INSERT INTO bom + SELECT '".$newStkID."' as parent, component, workcentreadded, loccode, @@ -84,25 +80,25 @@ effectiveto, quantity, autoissue - from bom - where parent='".$stkid."';"; + FROM bom + WHERE parent='".$StkID."';"; $result = DB_query($sql, $db); if($type == 'N') { - $sql = "insert into locstock - select loccode, '".$newstkid."' as stockid,0 as quantity, - reorderlevel - from locstock - where stockid='".$stkid."';"; + $sql = "INSERT INTO locstock + SELECT loccode, '".$newStkID."' as stockid,0 as quantity, + reorderlevel + FROM locstock + WHERE stockid='".$StkID."';"; $result = DB_query($sql, $db); } - $result = DB_query('commit', $db); + DB_Txn_Commit($db); - UpdateCost($db, $newstkid); + UpdateCost($db, $newStkID); - header('Location: BOMs.php?Select='.$newstkid); + header('Location: BOMs.php?Select='.$newStkID); } else @@ -110,20 +106,19 @@ $title = _('UTILITY PAGE To Copy a BOM'); include('includes/header.inc'); - echo "<form method=\"post\" action=\"Z_CopyBOM.php\">"; + echo '<form method="post" action="Z_CopyBOM.php">'; echo '<input type="hidden" name="FormID" value="' . $_SESSION['FormID'] . '" />'; $sql = "SELECT stockid, description FROM stockmaster WHERE stockid IN (SELECT DISTINCT parent FROM bom) AND mbflag IN ('M', 'A', 'K');"; $result = DB_query($sql, $db); - echo "<p>"._("From Stock ID"); - echo ": <select name=\"stkid\">"; + echo '<p>'._('From Stock ID') . ': <select name="StkID">'; while($row = DB_fetch_row($result)) { echo "<option value=\"$row[0]\">".$row[0]." -- ".$row[1]."</option>"; } echo "</select><br/><input type=\"radio\" name=\"type\" value=\"N\" checked=\"\"/>"._(" To New Stock ID"); - echo ": <input type=\"text\" maxlength=\"20\" name=\"tostkid\"/>"; + echo ": <input type=\"text\" maxlength=\"20\" name=\"toStkID\"/>"; $sql = "SELECT stockid, description FROM stockmaster WHERE stockid NOT IN (SELECT DISTINCT parent FROM bom) AND mbflag IN ('M', 'A', 'K');"; $result = DB_query($sql, $db); @@ -131,7 +126,7 @@ if(DB_num_rows($result) > 0) { echo "<br/><input type=\"radio\" name=\"type\" value=\"E\"/>"._("To Existing Stock ID"); - echo ": <select name=\"exstkid\">"; + echo ": <select name=\"exStkID\">"; while($row = DB_fetch_row($result)) { echo "<option value=\"$row[0]\">".$row[0]." -- ".$row[1]."</option>"; @@ -141,6 +136,6 @@ echo "</p>"; echo "<input type=\"submit\" name=\"Submit\" value=\"Submit\"/></p>"; - include("includes/footer.inc"); + include('includes/footer.inc'); } ?> Modified: trunk/doc/Change.log =================================================================== --- trunk/doc/Change.log 2011-08-19 10:13:15 UTC (rev 4662) +++ trunk/doc/Change.log 2011-08-20 05:52:38 UTC (rev 4663) @@ -1,5 +1,8 @@ webERP Change Log +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. +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 14/8/11 Phil: SystemParameters.php default ProhibitPostingsBefore to 1900-01-01 when no default is currently set - can cause errors at the moment as defaults to the latest period if not previously set. Modified: trunk/includes/ConnectDB.inc =================================================================== --- trunk/includes/ConnectDB.inc 2011-08-19 10:13:15 UTC (rev 4662) +++ trunk/includes/ConnectDB.inc 2011-08-20 05:52:38 UTC (rev 4663) @@ -4,7 +4,7 @@ * this value is saved in the $_SESSION['Versionumber'] when includes/GetConfig.php is run * if VersionNumber is < $Version then the DB update script is run */ -$Version='4.05'; //must update manually every time there is a DB change +$Version='4.05.1'; //must update manually every time there is a DB change require_once ($PathPrefix .'includes/MiscFunctions.php'); This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <dai...@us...> - 2011-08-21 07:13:09
|
Revision: 4665 http://web-erp.svn.sourceforge.net/web-erp/?rev=4665&view=rev Author: daintree Date: 2011-08-21 07:13:02 +0000 (Sun, 21 Aug 2011) Log Message: ----------- 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 Modified Paths: -------------- trunk/BackupDatabase.php trunk/PO_Header.php trunk/PO_Items.php trunk/UserSettings.php trunk/doc/Change.log trunk/includes/PO_ReadInOrder.inc Modified: trunk/BackupDatabase.php =================================================================== --- trunk/BackupDatabase.php 2011-08-21 02:15:14 UTC (rev 4664) +++ trunk/BackupDatabase.php 2011-08-21 07:13:02 UTC (rev 4665) @@ -8,8 +8,27 @@ include('includes/header.inc'); if (isset($_GET['BackupFile'])){ - unlink($_SERVER['DOCUMENT_ROOT'] . $_GET['BackupFile']); - prnMsg(_('The backup file has been deleted'),'success'); + $BackupFiles = scandir('companies/' . $_SESSION['DatabaseName'], 0); + $DeletedFiles = false; + foreach ($BackupFiles as $BackupFile){ + + if (mb_substr($BackupFile,0,6)=='Backup'){ + + $DeleteResult = unlink('companies/' . $_SESSION['DatabaseName'] . '/' . $BackupFile); + + if ($DeleteResult==true){ + prnMsg(_('Deleted') . ' companies/' . $_SESSION['DatabaseName'] . '/' . $BackupFile,'info'); + $DeletedFiles = true; + } else { + prnMsg(_('Unable to delete'). ' companies/' . $_SESSION['DatabaseName'] . '/' . $BackupFile,'warn'); + } + } + } + if ($DeletedFiles){ + prnMsg(_('All backup files on the server have been deleted'),'success'); + } else { + prnMsg(_('No backup files on the server were deleted'),'info'); + } } else { $BackupFile = $rootpath . '/companies/' . $_SESSION['DatabaseName'] .'/' . _('Backup') . '_' . Date('Y-m-d-H-i-s') . '.sql.gz'; Modified: trunk/PO_Header.php =================================================================== --- trunk/PO_Header.php 2011-08-21 02:15:14 UTC (rev 4664) +++ trunk/PO_Header.php 2011-08-21 07:13:02 UTC (rev 4665) @@ -42,7 +42,7 @@ $_SESSION['ExistingOrder']=0; } -if (isset($_POST['Select']) and empty($_POST['SupplierContact'])) { +if (isset($_POST['Select']) AND empty($_POST['SupplierContact'])) { $sql = "SELECT contact FROM suppliercontacts WHERE supplierid='". $_POST['Select'] ."'"; @@ -706,8 +706,8 @@ echo '<br /><table colspan=1 width=80%> <tr> - <th><font color=blue size=4><b>' . _('Order Initiation Details') . '</b></font></th> - <th><font color=blue size=4><b>' . _('Order Status') . '</b></font></th> + <th><font color="blue" size="4"><b>' . _('Order Initiation Details') . '</b></font></th> + <th><font color="blue" size="4"><b>' . _('Order Status') . '</b></font></th> </tr> <tr><td style="width:50%">'; //sub table starts Modified: trunk/PO_Items.php =================================================================== --- trunk/PO_Items.php 2011-08-21 02:15:14 UTC (rev 4664) +++ trunk/PO_Items.php 2011-08-21 07:13:02 UTC (rev 4665) @@ -291,12 +291,12 @@ /*Now Update the purchase order detail records */ foreach ($_SESSION['PO'.$identifier]->LineItems as $POLine) { - $result=DB_query($sql,$db,'','',true); + if ($POLine->Deleted==true) { if ($POLine->PODetailRec!='') { $sql="DELETE FROM purchorderdetails WHERE podetailitem='" . $POLine->PODetailRec . "'"; - $ErrMsg = _('The purchase order could not be deleted because'); - $DbgMsg = _('The SQL statement used to delete the purchase order header record, that failed was'); + $ErrMsg = _('The purchase order detail line could not be deleted because'); + $DbgMsg = _('The SQL statement used to delete the purchase order detail record, that failed was'); $result = DB_query($sql,$db,$ErrMsg,$DbgMsg,true); } } else if ($POLine->PODetailRec=='') { @@ -368,6 +368,7 @@ $ErrMsg = _('One of the purchase order detail records could not be updated because'); $DbgMsg = _('The SQL statement used to update the purchase order detail record that failed was'); $result =DB_query($sql,$db,$ErrMsg,$DbgMsg,true); + } /* end of the loop round the detail line items on the order */ echo '<br /><br />'; prnMsg(_('Purchase Order') . ' ' . $_SESSION['PO'.$identifier]->OrderNo . ' ' . _('has been updated'),'success'); @@ -381,7 +382,6 @@ $Result = DB_Txn_Commit($db); unset($_SESSION['PO'.$identifier]); /*Clear the PO data to allow a newy to be input*/ - echo '<br /><a href="' . $rootpath . '/PO_SelectOSPurchOrder.php">' . _('Return To PO List') . '</a>'; include('includes/footer.inc'); exit; } /*end if there were no input errors trapped */ @@ -403,6 +403,7 @@ if(isset($_GET['Complete'])){ $_SESSION['PO'.$identifier]->LineItems[$_GET['Complete']]->Completed=1; } + if (isset($_POST['EnterLine'])){ /*Inputs from the form directly without selecting a stock item from the search */ $AllowUpdate = true; /*always assume the best */ @@ -486,7 +487,7 @@ if ($AllowUpdate == true){ //adding the non-stock item - $_SESSION['PO'.$identifier]->add_to_order ($_SESSION['PO'.$identifier]->LinesOnOrder+1, + $_SESSION['PO'.$identifier]->add_to_order($_SESSION['PO'.$identifier]->LinesOnOrder+1, '', 0, /*Serialised */ 0, /*Controlled */ @@ -514,6 +515,7 @@ if (isset($_POST['NewItem'])){ + /* NewItem is set from the part selection list as the part code selected * take the form entries and enter the data from the form into the PurchOrder class variable * A series of form variables of the format "NewQty" with the ItemCode concatenated are created on the search for adding new @@ -523,8 +525,8 @@ foreach ($_POST as $FormVariableName => $Quantity) { - if (mb_substr($FormVariableName, 0, 6)=='NewQty') { //if the form variable represents a Qty to add to the order - + 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); $AlreadyOnThisOrder = 0; @@ -600,7 +602,7 @@ $PurchPrice = 0; $ConversionFactor = 1; $SupplierDescription = $ItemRow['description']; - $SuppliersUnitOfMeasure = $ItemRow['unitname']; + $SuppliersUnitOfMeasure = $ItemRow['units']; $SuppliersPartNo = ''; $LeadTime = 1; } @@ -620,7 +622,7 @@ 0, 0, 0, - $Itemrow['accountname'], + $ItemRow['accountname'], $ItemRow['decimalplaces'], $SuppliersUnitOfMeasure, $ConversionFactor, @@ -716,7 +718,7 @@ } $DisplayTotal = number_format($_SESSION['PO'.$identifier]->Total,$_SESSION['PO'.$identifier]->CurrDecimalPlaces); - echo '<tr><td colspan="10" class="number">' . _('TOTAL') . _(' excluding Tax') . '</td> + echo '<tr><td colspan="9" class="number">' . _('TOTAL') . _(' excluding Tax') . '</td> <td class="number"><b>' . $DisplayTotal . '</b></td> </tr></table>'; echo '<br /> @@ -923,7 +925,7 @@ } else { if ($_POST['StockCat']=='All'){ - if ($_POST['SupplierItemsOnly']=='on'){ + if (isset($_POST['SupplierItemsOnly'])){ $sql = "SELECT stockmaster.stockid, stockmaster.description, stockmaster.units @@ -1014,7 +1016,7 @@ echo '<table class="selection"> <tr> - <th colspan=3><font size=3 color=blue>'. _('Search For Stock Items') . '</th>'; + <th colspan="3"><font size="3" color="blue">'. _('Search For Stock Items') . '</th>'; echo ':</font> </tr> @@ -1049,7 +1051,7 @@ echo 'checked'; } echo ' /></td> - <td><font size=3><b>' . _('OR') . ' </b></font>' . _('Enter extract of the Stock Code') . ':</td> + <td><font size="3"><b>' . _('OR') . ' </b></font>' . _('Enter extract of the Stock Code') . ':</td> <td><input type="text" name="StockCode" size=15 maxlength=18 value="' . $_POST['StockCode'] . '"></td> </tr> <tr><td></td> Modified: trunk/UserSettings.php =================================================================== --- trunk/UserSettings.php 2011-08-21 02:15:14 UTC (rev 4664) +++ trunk/UserSettings.php 2011-08-21 07:13:02 UTC (rev 4665) @@ -107,12 +107,16 @@ } -echo '<table class=selection><tr><td>' . _('User ID') . ':</td><td>'; -echo $_SESSION['UserID'] . '</td></tr>'; +echo '<table class="selection"> + <tr> + <td>' . _('User ID') . ':</td> + <td>' . $_SESSION['UserID'] . '</td> + </tr>'; -echo '<tr><td>' . _('User Name') . ':</td><td>'; -echo $_SESSION['UsersRealName'] . '</td> - <input type="hidden" name="RealName" value="'.$_SESSION['UsersRealName'].'"<td></tr>'; +echo '<tr> + <td>' . _('User Name') . ':</td> + <td>' . $_SESSION['UsersRealName'] . '</td> + <input type="hidden" name="RealName" value="'.$_SESSION['UsersRealName'].'" /></tr>'; echo '<tr> <td>' . _('Maximum Number of Records to Display') . ':</td> Modified: trunk/doc/Change.log =================================================================== --- trunk/doc/Change.log 2011-08-21 02:15:14 UTC (rev 4664) +++ trunk/doc/Change.log 2011-08-21 07:13:02 UTC (rev 4665) @@ -1,5 +1,7 @@ webERP Change Log +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. 19/8/11 Phil: Remove redundant field stockmaster.lastcurcostdate Modified: trunk/includes/PO_ReadInOrder.inc =================================================================== --- trunk/includes/PO_ReadInOrder.inc 2011-08-21 02:15:14 UTC (rev 4664) +++ trunk/includes/PO_ReadInOrder.inc 2011-08-21 07:13:02 UTC (rev 4665) @@ -150,21 +150,21 @@ purchorderdetails.suppliersunit, purchorderdetails.suppliers_partno FROM purchorderdetails - LEFT JOIN stockmaster - ON purchorderdetails.itemcode=stockmaster.stockid - INNER JOIN purchorders - ON purchorders.orderno=purchorderdetails.orderno - LEFT JOIN chartmaster - ON purchorderdetails.glcode=chartmaster.accountcode + LEFT JOIN stockmaster + ON purchorderdetails.itemcode=stockmaster.stockid + INNER JOIN purchorders + ON purchorders.orderno=purchorderdetails.orderno + LEFT JOIN chartmaster + ON purchorderdetails.glcode=chartmaster.accountcode WHERE purchorderdetails.completed=0 - AND purchorderdetails.orderno ='" . $_GET['ModifyOrderNumber'] . "' + AND purchorderdetails.orderno ='" . $_GET['ModifyOrderNumber'] . "' ORDER BY podetailitem"; $ErrMsg = _('The lines on the purchase order cannot be retrieved because'); $DbgMsg = _('The SQL statement that was used to retrieve the purchase order lines was'); $LineItemsResult = db_query($LineItemsSQL,$db,$ErrMsg,$DbgMsg); - if (db_num_rows($LineItemsResult) > 0) { + if (DB_num_rows($LineItemsResult) > 0) { while ($myrow=db_fetch_array($LineItemsResult)) { This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <dai...@us...> - 2011-08-21 07:13:09
|
Revision: 4665 http://web-erp.svn.sourceforge.net/web-erp/?rev=4665&view=rev Author: daintree Date: 2011-08-21 07:13:02 +0000 (Sun, 21 Aug 2011) Log Message: ----------- 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 Modified Paths: -------------- trunk/BackupDatabase.php trunk/PO_Header.php trunk/PO_Items.php trunk/UserSettings.php trunk/doc/Change.log trunk/includes/PO_ReadInOrder.inc Modified: trunk/BackupDatabase.php =================================================================== --- trunk/BackupDatabase.php 2011-08-21 02:15:14 UTC (rev 4664) +++ trunk/BackupDatabase.php 2011-08-21 07:13:02 UTC (rev 4665) @@ -8,8 +8,27 @@ include('includes/header.inc'); if (isset($_GET['BackupFile'])){ - unlink($_SERVER['DOCUMENT_ROOT'] . $_GET['BackupFile']); - prnMsg(_('The backup file has been deleted'),'success'); + $BackupFiles = scandir('companies/' . $_SESSION['DatabaseName'], 0); + $DeletedFiles = false; + foreach ($BackupFiles as $BackupFile){ + + if (mb_substr($BackupFile,0,6)=='Backup'){ + + $DeleteResult = unlink('companies/' . $_SESSION['DatabaseName'] . '/' . $BackupFile); + + if ($DeleteResult==true){ + prnMsg(_('Deleted') . ' companies/' . $_SESSION['DatabaseName'] . '/' . $BackupFile,'info'); + $DeletedFiles = true; + } else { + prnMsg(_('Unable to delete'). ' companies/' . $_SESSION['DatabaseName'] . '/' . $BackupFile,'warn'); + } + } + } + if ($DeletedFiles){ + prnMsg(_('All backup files on the server have been deleted'),'success'); + } else { + prnMsg(_('No backup files on the server were deleted'),'info'); + } } else { $BackupFile = $rootpath . '/companies/' . $_SESSION['DatabaseName'] .'/' . _('Backup') . '_' . Date('Y-m-d-H-i-s') . '.sql.gz'; Modified: trunk/PO_Header.php =================================================================== --- trunk/PO_Header.php 2011-08-21 02:15:14 UTC (rev 4664) +++ trunk/PO_Header.php 2011-08-21 07:13:02 UTC (rev 4665) @@ -42,7 +42,7 @@ $_SESSION['ExistingOrder']=0; } -if (isset($_POST['Select']) and empty($_POST['SupplierContact'])) { +if (isset($_POST['Select']) AND empty($_POST['SupplierContact'])) { $sql = "SELECT contact FROM suppliercontacts WHERE supplierid='". $_POST['Select'] ."'"; @@ -706,8 +706,8 @@ echo '<br /><table colspan=1 width=80%> <tr> - <th><font color=blue size=4><b>' . _('Order Initiation Details') . '</b></font></th> - <th><font color=blue size=4><b>' . _('Order Status') . '</b></font></th> + <th><font color="blue" size="4"><b>' . _('Order Initiation Details') . '</b></font></th> + <th><font color="blue" size="4"><b>' . _('Order Status') . '</b></font></th> </tr> <tr><td style="width:50%">'; //sub table starts Modified: trunk/PO_Items.php =================================================================== --- trunk/PO_Items.php 2011-08-21 02:15:14 UTC (rev 4664) +++ trunk/PO_Items.php 2011-08-21 07:13:02 UTC (rev 4665) @@ -291,12 +291,12 @@ /*Now Update the purchase order detail records */ foreach ($_SESSION['PO'.$identifier]->LineItems as $POLine) { - $result=DB_query($sql,$db,'','',true); + if ($POLine->Deleted==true) { if ($POLine->PODetailRec!='') { $sql="DELETE FROM purchorderdetails WHERE podetailitem='" . $POLine->PODetailRec . "'"; - $ErrMsg = _('The purchase order could not be deleted because'); - $DbgMsg = _('The SQL statement used to delete the purchase order header record, that failed was'); + $ErrMsg = _('The purchase order detail line could not be deleted because'); + $DbgMsg = _('The SQL statement used to delete the purchase order detail record, that failed was'); $result = DB_query($sql,$db,$ErrMsg,$DbgMsg,true); } } else if ($POLine->PODetailRec=='') { @@ -368,6 +368,7 @@ $ErrMsg = _('One of the purchase order detail records could not be updated because'); $DbgMsg = _('The SQL statement used to update the purchase order detail record that failed was'); $result =DB_query($sql,$db,$ErrMsg,$DbgMsg,true); + } /* end of the loop round the detail line items on the order */ echo '<br /><br />'; prnMsg(_('Purchase Order') . ' ' . $_SESSION['PO'.$identifier]->OrderNo . ' ' . _('has been updated'),'success'); @@ -381,7 +382,6 @@ $Result = DB_Txn_Commit($db); unset($_SESSION['PO'.$identifier]); /*Clear the PO data to allow a newy to be input*/ - echo '<br /><a href="' . $rootpath . '/PO_SelectOSPurchOrder.php">' . _('Return To PO List') . '</a>'; include('includes/footer.inc'); exit; } /*end if there were no input errors trapped */ @@ -403,6 +403,7 @@ if(isset($_GET['Complete'])){ $_SESSION['PO'.$identifier]->LineItems[$_GET['Complete']]->Completed=1; } + if (isset($_POST['EnterLine'])){ /*Inputs from the form directly without selecting a stock item from the search */ $AllowUpdate = true; /*always assume the best */ @@ -486,7 +487,7 @@ if ($AllowUpdate == true){ //adding the non-stock item - $_SESSION['PO'.$identifier]->add_to_order ($_SESSION['PO'.$identifier]->LinesOnOrder+1, + $_SESSION['PO'.$identifier]->add_to_order($_SESSION['PO'.$identifier]->LinesOnOrder+1, '', 0, /*Serialised */ 0, /*Controlled */ @@ -514,6 +515,7 @@ if (isset($_POST['NewItem'])){ + /* NewItem is set from the part selection list as the part code selected * take the form entries and enter the data from the form into the PurchOrder class variable * A series of form variables of the format "NewQty" with the ItemCode concatenated are created on the search for adding new @@ -523,8 +525,8 @@ foreach ($_POST as $FormVariableName => $Quantity) { - if (mb_substr($FormVariableName, 0, 6)=='NewQty') { //if the form variable represents a Qty to add to the order - + 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); $AlreadyOnThisOrder = 0; @@ -600,7 +602,7 @@ $PurchPrice = 0; $ConversionFactor = 1; $SupplierDescription = $ItemRow['description']; - $SuppliersUnitOfMeasure = $ItemRow['unitname']; + $SuppliersUnitOfMeasure = $ItemRow['units']; $SuppliersPartNo = ''; $LeadTime = 1; } @@ -620,7 +622,7 @@ 0, 0, 0, - $Itemrow['accountname'], + $ItemRow['accountname'], $ItemRow['decimalplaces'], $SuppliersUnitOfMeasure, $ConversionFactor, @@ -716,7 +718,7 @@ } $DisplayTotal = number_format($_SESSION['PO'.$identifier]->Total,$_SESSION['PO'.$identifier]->CurrDecimalPlaces); - echo '<tr><td colspan="10" class="number">' . _('TOTAL') . _(' excluding Tax') . '</td> + echo '<tr><td colspan="9" class="number">' . _('TOTAL') . _(' excluding Tax') . '</td> <td class="number"><b>' . $DisplayTotal . '</b></td> </tr></table>'; echo '<br /> @@ -923,7 +925,7 @@ } else { if ($_POST['StockCat']=='All'){ - if ($_POST['SupplierItemsOnly']=='on'){ + if (isset($_POST['SupplierItemsOnly'])){ $sql = "SELECT stockmaster.stockid, stockmaster.description, stockmaster.units @@ -1014,7 +1016,7 @@ echo '<table class="selection"> <tr> - <th colspan=3><font size=3 color=blue>'. _('Search For Stock Items') . '</th>'; + <th colspan="3"><font size="3" color="blue">'. _('Search For Stock Items') . '</th>'; echo ':</font> </tr> @@ -1049,7 +1051,7 @@ echo 'checked'; } echo ' /></td> - <td><font size=3><b>' . _('OR') . ' </b></font>' . _('Enter extract of the Stock Code') . ':</td> + <td><font size="3"><b>' . _('OR') . ' </b></font>' . _('Enter extract of the Stock Code') . ':</td> <td><input type="text" name="StockCode" size=15 maxlength=18 value="' . $_POST['StockCode'] . '"></td> </tr> <tr><td></td> Modified: trunk/UserSettings.php =================================================================== --- trunk/UserSettings.php 2011-08-21 02:15:14 UTC (rev 4664) +++ trunk/UserSettings.php 2011-08-21 07:13:02 UTC (rev 4665) @@ -107,12 +107,16 @@ } -echo '<table class=selection><tr><td>' . _('User ID') . ':</td><td>'; -echo $_SESSION['UserID'] . '</td></tr>'; +echo '<table class="selection"> + <tr> + <td>' . _('User ID') . ':</td> + <td>' . $_SESSION['UserID'] . '</td> + </tr>'; -echo '<tr><td>' . _('User Name') . ':</td><td>'; -echo $_SESSION['UsersRealName'] . '</td> - <input type="hidden" name="RealName" value="'.$_SESSION['UsersRealName'].'"<td></tr>'; +echo '<tr> + <td>' . _('User Name') . ':</td> + <td>' . $_SESSION['UsersRealName'] . '</td> + <input type="hidden" name="RealName" value="'.$_SESSION['UsersRealName'].'" /></tr>'; echo '<tr> <td>' . _('Maximum Number of Records to Display') . ':</td> Modified: trunk/doc/Change.log =================================================================== --- trunk/doc/Change.log 2011-08-21 02:15:14 UTC (rev 4664) +++ trunk/doc/Change.log 2011-08-21 07:13:02 UTC (rev 4665) @@ -1,5 +1,7 @@ webERP Change Log +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. 19/8/11 Phil: Remove redundant field stockmaster.lastcurcostdate Modified: trunk/includes/PO_ReadInOrder.inc =================================================================== --- trunk/includes/PO_ReadInOrder.inc 2011-08-21 02:15:14 UTC (rev 4664) +++ trunk/includes/PO_ReadInOrder.inc 2011-08-21 07:13:02 UTC (rev 4665) @@ -150,21 +150,21 @@ purchorderdetails.suppliersunit, purchorderdetails.suppliers_partno FROM purchorderdetails - LEFT JOIN stockmaster - ON purchorderdetails.itemcode=stockmaster.stockid - INNER JOIN purchorders - ON purchorders.orderno=purchorderdetails.orderno - LEFT JOIN chartmaster - ON purchorderdetails.glcode=chartmaster.accountcode + LEFT JOIN stockmaster + ON purchorderdetails.itemcode=stockmaster.stockid + INNER JOIN purchorders + ON purchorders.orderno=purchorderdetails.orderno + LEFT JOIN chartmaster + ON purchorderdetails.glcode=chartmaster.accountcode WHERE purchorderdetails.completed=0 - AND purchorderdetails.orderno ='" . $_GET['ModifyOrderNumber'] . "' + AND purchorderdetails.orderno ='" . $_GET['ModifyOrderNumber'] . "' ORDER BY podetailitem"; $ErrMsg = _('The lines on the purchase order cannot be retrieved because'); $DbgMsg = _('The SQL statement that was used to retrieve the purchase order lines was'); $LineItemsResult = db_query($LineItemsSQL,$db,$ErrMsg,$DbgMsg); - if (db_num_rows($LineItemsResult) > 0) { + if (DB_num_rows($LineItemsResult) > 0) { while ($myrow=db_fetch_array($LineItemsResult)) { This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <dai...@us...> - 2011-08-23 06:27:51
|
Revision: 4666 http://web-erp.svn.sourceforge.net/web-erp/?rev=4666&view=rev Author: daintree Date: 2011-08-23 06:27:45 +0000 (Tue, 23 Aug 2011) Log Message: ----------- 23/8/11 Ricard: PDFPrintLabel Does Not display discontinued items and now allows printing of future price labels Modified Paths: -------------- trunk/PDFPrintLabel.php trunk/doc/Change.log Modified: trunk/PDFPrintLabel.php =================================================================== --- trunk/PDFPrintLabel.php 2011-08-21 07:13:02 UTC (rev 4665) +++ trunk/PDFPrintLabel.php 2011-08-23 06:27:45 UTC (rev 4666) @@ -57,7 +57,9 @@ intval($_POST['QtyByItem']), $_POST['Currency'], $_POST['SalesType'], - $_POST['StockID']); + $_POST['StockID'], + FormatDateForSQL($_POST['EffectiveDate']) + ); if ($ok) exit(); // the print was success @@ -90,8 +92,11 @@ _('Label Sticker Printing'), _('Select label type'), _('Number of labels per item'), - _('Price list'), _('Currency'), - _('Category'), _('Update values') + _('Price list'), + _('Currency'), + _('Category'), + _('Effective Date'), + _('Update values') ); if (!isset($_POST['LabelID'])) $_POST['LabelID']=(string)$AllLabels->label[0]->id; @@ -114,6 +119,9 @@ $TableItems = tableItems($_POST['Category'], $okItems); + if (!isset($_POST['EffectiveDate'])){ + $_POST['EffectiveDate']=Date($_SESSION['DefaultDateFormat']); + } $SendButton = '<br /><div class=centre><input type="submit" name="PrintPDF" value="'. _('Print labels') .'"> <input type="submit" name="PDFTest" value="'. _('Print labels with borders') .'"></div>'; $iTxt=0; @@ -161,6 +169,8 @@ '.$OptionsCategory.' </select> </td> </tr>'; + echo '<tr><td class="number">'.$txt[$iTxt++].':</td> + <td><input type="text" class=date alt="'.$_SESSION['DefaultDateFormat'].'" name="EffectiveDate" size="11" maxlength="10" value=' . $_POST['EffectiveDate'] . '></td></tr>'; echo '<tr> <th colspan="2"> <input type="submit" name="refresh" value="Refresh options"> @@ -170,7 +180,6 @@ '.$TableItems.' </td> </tr>'; - echo '</tbody> </table> '.$SendButton.' @@ -228,7 +237,7 @@ $ok=false; return noneButton( _('Select a Category') ); } - $result = getStockItems($CategoryID, $_POST['Currency'], $_POST['SalesType']); + $result = getStockItems($CategoryID, $_POST['Currency'], $_POST['SalesType'], FormatDateForSQL($_POST['EffectiveDate'])); if (!DB_num_rows($result)) { $ok=false; return noneButton( _('This category has no items to show') ); @@ -290,13 +299,16 @@ * The routine works in two contexts: when only the category is given * it looks for all the items */ -function getStockItems($CategoryID, $CurrCode, $SalesType, $StockID=false) { +function getStockItems($CategoryID, $CurrCode, $SalesType, $EffectiveDate, $StockID=false) { global $db, $Today; + if ($StockID!==false) { $WhereClause = "stockmaster.stockid='$StockID' LIMIT 1"; } else { $WhereClause = "stockmaster.categoryid='$CategoryID' ORDER BY stockmaster.stockid"; } + + $WhereClause = " stockmaster.discontinued!=1 AND " . $WhereClause; $sql="SELECT stockmaster.stockid, stockmaster.description, @@ -307,20 +319,16 @@ ON stockmaster.stockid=prices.stockid AND prices.currabrev = '" . $CurrCode . "' AND prices.typeabbrev= '" . $SalesType . "' - AND prices.startdate <= '" . Date('Y-m-d') . "' - AND (prices.enddate >= '" . Date('Y-m-d') . "' OR prices.enddate='0000-00-00') + AND prices.startdate <= '" . $EffectiveDate . "' + AND (prices.enddate >= '" . $EffectiveDate . "' OR prices.enddate='0000-00-00') AND prices.debtorno='' WHERE " . $WhereClause; - -// if current prices are those with enddate = 0000-00-00 the following line was wrong -// "AND ('$Today' BETWEEN pr.startdate AND prices.enddate) " . - - + return DB_query($sql, $db); } -function getStockData($StockID, $Currency, $salesType) { - $result = getStockItems(null, $Currency, $salesType, $StockID); +function getStockData($StockID, $Currency, $salesType, $EffectiveDate) { + $result = getStockItems(null, $Currency, $salesType, $EffectiveDate, $StockID); return DB_fetch_array($result); } @@ -389,14 +397,14 @@ ); } -function printLabels($dimensions, $lines, $qtyByItem, $Currency, $salesType, $StockIDList) { +function printLabels($dimensions, $lines, $qtyByItem, $Currency, $salesType, $StockIDList, $EffectiveDate) { global $pdf, $DecimalPlaces, $Version; $row = $col = 0; $DecimalPlaces=getDecimalPlaces($Currency); foreach ($StockIDList as $StockID=>$on) { // At least there is one item - $itemData = getStockData($StockID, $Currency, $salesType); + $itemData = getStockData($StockID, $Currency, $salesType, $EffectiveDate); $num=$qtyByItem; while ($num-- > 0) { // Print $num labels per item printStockid($itemData, $dimensions, $lines, $Currency, $row, $col); Modified: trunk/doc/Change.log =================================================================== --- trunk/doc/Change.log 2011-08-21 07:13:02 UTC (rev 4665) +++ trunk/doc/Change.log 2011-08-23 06:27:45 UTC (rev 4666) @@ -1,5 +1,6 @@ webERP Change Log +23/8/11 Ricard: PDFPrintLabel Does Not display discontinued items and now allows printing of future price labels 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,7 +17,7 @@ 10/8/11 Phil: POReport.php added link to detail purchase order inquiry 10/8/11 Phil: PO_SelectPurchOrder.php and outstanding purchase order searches now show the delivery date (from the purchase order header) line items may have different delivery dates. 10/8/11 Phil: Stocks.php changing the stock category to one with a different stock account now creates a journal (if stock is linked to GL) to move the cost of the stock from the old GL account to the new GL account -7/8/11 Phil: SelectProduct.php now disables transactions on items flagged as obsolete (discontinued). Also obsolete items are shown as such in the selection list - suggested by Klaus (opto) +7/8/11 Phil: SelectProduct.php now disables transactions on items flagged as obsolete (discontinued). /Also obsolete items are shown as such in the selection list - suggested by Klaus (opto) 7/8/11 Ricard: Corrected INNER JOIN ON clause in sql used in InventoryQuantities.php script 7/8/11 Klaus: Added docuwiki links to WikiLinks function in MiscFunctions.php and allow Docuwiki option in SystemParameters.php 6/8/11 Ricard: SalesInquiry.php fix wording of labels to be more consistent with the rest of webERP This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <dai...@us...> - 2011-08-23 06:27:52
|
Revision: 4666 http://web-erp.svn.sourceforge.net/web-erp/?rev=4666&view=rev Author: daintree Date: 2011-08-23 06:27:45 +0000 (Tue, 23 Aug 2011) Log Message: ----------- 23/8/11 Ricard: PDFPrintLabel Does Not display discontinued items and now allows printing of future price labels Modified Paths: -------------- trunk/PDFPrintLabel.php trunk/doc/Change.log Modified: trunk/PDFPrintLabel.php =================================================================== --- trunk/PDFPrintLabel.php 2011-08-21 07:13:02 UTC (rev 4665) +++ trunk/PDFPrintLabel.php 2011-08-23 06:27:45 UTC (rev 4666) @@ -57,7 +57,9 @@ intval($_POST['QtyByItem']), $_POST['Currency'], $_POST['SalesType'], - $_POST['StockID']); + $_POST['StockID'], + FormatDateForSQL($_POST['EffectiveDate']) + ); if ($ok) exit(); // the print was success @@ -90,8 +92,11 @@ _('Label Sticker Printing'), _('Select label type'), _('Number of labels per item'), - _('Price list'), _('Currency'), - _('Category'), _('Update values') + _('Price list'), + _('Currency'), + _('Category'), + _('Effective Date'), + _('Update values') ); if (!isset($_POST['LabelID'])) $_POST['LabelID']=(string)$AllLabels->label[0]->id; @@ -114,6 +119,9 @@ $TableItems = tableItems($_POST['Category'], $okItems); + if (!isset($_POST['EffectiveDate'])){ + $_POST['EffectiveDate']=Date($_SESSION['DefaultDateFormat']); + } $SendButton = '<br /><div class=centre><input type="submit" name="PrintPDF" value="'. _('Print labels') .'"> <input type="submit" name="PDFTest" value="'. _('Print labels with borders') .'"></div>'; $iTxt=0; @@ -161,6 +169,8 @@ '.$OptionsCategory.' </select> </td> </tr>'; + echo '<tr><td class="number">'.$txt[$iTxt++].':</td> + <td><input type="text" class=date alt="'.$_SESSION['DefaultDateFormat'].'" name="EffectiveDate" size="11" maxlength="10" value=' . $_POST['EffectiveDate'] . '></td></tr>'; echo '<tr> <th colspan="2"> <input type="submit" name="refresh" value="Refresh options"> @@ -170,7 +180,6 @@ '.$TableItems.' </td> </tr>'; - echo '</tbody> </table> '.$SendButton.' @@ -228,7 +237,7 @@ $ok=false; return noneButton( _('Select a Category') ); } - $result = getStockItems($CategoryID, $_POST['Currency'], $_POST['SalesType']); + $result = getStockItems($CategoryID, $_POST['Currency'], $_POST['SalesType'], FormatDateForSQL($_POST['EffectiveDate'])); if (!DB_num_rows($result)) { $ok=false; return noneButton( _('This category has no items to show') ); @@ -290,13 +299,16 @@ * The routine works in two contexts: when only the category is given * it looks for all the items */ -function getStockItems($CategoryID, $CurrCode, $SalesType, $StockID=false) { +function getStockItems($CategoryID, $CurrCode, $SalesType, $EffectiveDate, $StockID=false) { global $db, $Today; + if ($StockID!==false) { $WhereClause = "stockmaster.stockid='$StockID' LIMIT 1"; } else { $WhereClause = "stockmaster.categoryid='$CategoryID' ORDER BY stockmaster.stockid"; } + + $WhereClause = " stockmaster.discontinued!=1 AND " . $WhereClause; $sql="SELECT stockmaster.stockid, stockmaster.description, @@ -307,20 +319,16 @@ ON stockmaster.stockid=prices.stockid AND prices.currabrev = '" . $CurrCode . "' AND prices.typeabbrev= '" . $SalesType . "' - AND prices.startdate <= '" . Date('Y-m-d') . "' - AND (prices.enddate >= '" . Date('Y-m-d') . "' OR prices.enddate='0000-00-00') + AND prices.startdate <= '" . $EffectiveDate . "' + AND (prices.enddate >= '" . $EffectiveDate . "' OR prices.enddate='0000-00-00') AND prices.debtorno='' WHERE " . $WhereClause; - -// if current prices are those with enddate = 0000-00-00 the following line was wrong -// "AND ('$Today' BETWEEN pr.startdate AND prices.enddate) " . - - + return DB_query($sql, $db); } -function getStockData($StockID, $Currency, $salesType) { - $result = getStockItems(null, $Currency, $salesType, $StockID); +function getStockData($StockID, $Currency, $salesType, $EffectiveDate) { + $result = getStockItems(null, $Currency, $salesType, $EffectiveDate, $StockID); return DB_fetch_array($result); } @@ -389,14 +397,14 @@ ); } -function printLabels($dimensions, $lines, $qtyByItem, $Currency, $salesType, $StockIDList) { +function printLabels($dimensions, $lines, $qtyByItem, $Currency, $salesType, $StockIDList, $EffectiveDate) { global $pdf, $DecimalPlaces, $Version; $row = $col = 0; $DecimalPlaces=getDecimalPlaces($Currency); foreach ($StockIDList as $StockID=>$on) { // At least there is one item - $itemData = getStockData($StockID, $Currency, $salesType); + $itemData = getStockData($StockID, $Currency, $salesType, $EffectiveDate); $num=$qtyByItem; while ($num-- > 0) { // Print $num labels per item printStockid($itemData, $dimensions, $lines, $Currency, $row, $col); Modified: trunk/doc/Change.log =================================================================== --- trunk/doc/Change.log 2011-08-21 07:13:02 UTC (rev 4665) +++ trunk/doc/Change.log 2011-08-23 06:27:45 UTC (rev 4666) @@ -1,5 +1,6 @@ webERP Change Log +23/8/11 Ricard: PDFPrintLabel Does Not display discontinued items and now allows printing of future price labels 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,7 +17,7 @@ 10/8/11 Phil: POReport.php added link to detail purchase order inquiry 10/8/11 Phil: PO_SelectPurchOrder.php and outstanding purchase order searches now show the delivery date (from the purchase order header) line items may have different delivery dates. 10/8/11 Phil: Stocks.php changing the stock category to one with a different stock account now creates a journal (if stock is linked to GL) to move the cost of the stock from the old GL account to the new GL account -7/8/11 Phil: SelectProduct.php now disables transactions on items flagged as obsolete (discontinued). Also obsolete items are shown as such in the selection list - suggested by Klaus (opto) +7/8/11 Phil: SelectProduct.php now disables transactions on items flagged as obsolete (discontinued). /Also obsolete items are shown as such in the selection list - suggested by Klaus (opto) 7/8/11 Ricard: Corrected INNER JOIN ON clause in sql used in InventoryQuantities.php script 7/8/11 Klaus: Added docuwiki links to WikiLinks function in MiscFunctions.php and allow Docuwiki option in SystemParameters.php 6/8/11 Ricard: SalesInquiry.php fix wording of labels to be more consistent with the rest of webERP This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <dai...@us...> - 2011-08-24 10:29:58
|
Revision: 4667 http://web-erp.svn.sourceforge.net/web-erp/?rev=4667&view=rev Author: daintree Date: 2011-08-24 10:29:52 +0000 (Wed, 24 Aug 2011) Log Message: ----------- Added buyername to be captured at order entry Modified Paths: -------------- trunk/DeliveryDetails.php trunk/doc/Change.log trunk/includes/DefineCartClass.php Modified: trunk/DeliveryDetails.php =================================================================== --- trunk/DeliveryDetails.php 2011-08-23 06:27:45 UTC (rev 4666) +++ trunk/DeliveryDetails.php 2011-08-24 10:29:52 UTC (rev 4667) @@ -187,6 +187,7 @@ $_SESSION['Items'.$identifier]->Quotation = $_POST['Quotation']; } else { $_SESSION['Items'.$identifier]->DeliverTo = $_POST['DeliverTo']; + $_SESSION['Items'.$identifier]->BuyerName = $_POST['BuyerName']; $_SESSION['Items'.$identifier]->DelAdd1 = $_POST['BrAdd1']; $_SESSION['Items'.$identifier]->DelAdd2 = $_POST['BrAdd2']; $_SESSION['Items'.$identifier]->DelAdd3 = $_POST['BrAdd3']; @@ -333,6 +334,7 @@ ordertype, shipvia, deliverto, + buyername, deladd1, deladd2, deladd3, @@ -354,10 +356,11 @@ '" . $_SESSION['Items'.$identifier]->Branch . "', '". DB_escape_string($_SESSION['Items'.$identifier]->CustRef) ."', '". DB_escape_string($_SESSION['Items'.$identifier]->Comments) ."', - '" . Date("Y-m-d H:i") . "', + '" . Date('Y-m-d H:i') . "', '" . $_SESSION['Items'.$identifier]->DefaultSalesType . "', '" . $_POST['ShipVia'] ."', '". DB_escape_string($_SESSION['Items'.$identifier]->DeliverTo) . "', + '" . DB_escape_string($_SESSION['Items'.$identifier]->BuyerName) . "', '" . DB_escape_string($_SESSION['Items'.$identifier]->DelAdd1) . "', '" . DB_escape_string($_SESSION['Items'.$identifier]->DelAdd2) . "', '" . DB_escape_string($_SESSION['Items'.$identifier]->DelAdd3) . "', @@ -717,6 +720,7 @@ quotedate = '" . FormatDateForSQL(DB_escape_string($_SESSION['Items'.$identifier]->QuoteDate)) . "', confirmeddate = '" . FormatDateForSQL(DB_escape_string($_SESSION['Items'.$identifier]->ConfirmedDate)) . "', deliverto = '" . DB_escape_string($_SESSION['Items'.$identifier]->DeliverTo) . "', + buyername = '" . DB_escape_string($_SESSION['Items'.$identifier]->BuyerName) . "', deladd1 = '" . DB_escape_string($_SESSION['Items'.$identifier]->DelAdd1) . "', deladd2 = '" . DB_escape_string($_SESSION['Items'.$identifier]->DelAdd2) . "', deladd3 = '" . DB_escape_string($_SESSION['Items'.$identifier]->DelAdd3) . "', @@ -881,13 +885,14 @@ /*Display the order without discount */ echo '<div class="centre"><b>' . _('Order Summary') . '</b></div> - <table cellpadding=2 colspan=7 border=1><tr> - <th>'. _('Item Description') .'</th> - <th>'. _('Quantity') .'</th> - <th>'. _('Unit') .'</th> - <th>'. _('Price') .'</th> - <th>'. _('Total') .'</th> - </tr>'; + <table cellpadding="2" colspan="7" border="1"> + <tr> + <th>'. _('Item Description') .'</th> + <th>'. _('Quantity') .'</th> + <th>'. _('Unit') .'</th> + <th>'. _('Price') .'</th> + <th>'. _('Total') .'</th> + </tr>'; $_SESSION['Items'.$identifier]->total = 0; $_SESSION['Items'.$identifier]->totalVolume = 0; @@ -921,28 +926,33 @@ } $DisplayTotal = number_format($_SESSION['Items'.$identifier]->total,$_SESSION['Items'.$identifier]->CurrDecimalPlaces); - echo '<table class=selection><tr> - <td>'. _('Total Weight') .':</td> - <td>'.$DisplayWeight .'</td> - <td>'. _('Total Volume') .':</td> - <td>'.$DisplayVolume .'</td> - </tr></table>'; + echo '<table class="selection"> + <tr> + <td>'. _('Total Weight') .':</td> + <td>'.$DisplayWeight .'</td> + <td>'. _('Total Volume') .':</td> + <td>'.$DisplayVolume .'</td> + </tr> + </table>'; $DisplayVolume = number_format($_SESSION['Items'.$identifier]->totalVolume,2); $DisplayWeight = number_format($_SESSION['Items'.$identifier]->totalWeight,2); - echo '<table class=selection><tr> - <td>'. _('Total Weight') .':</td> - <td>'. $DisplayWeight .'</td> - <td>'. _('Total Volume') .':</td> - <td>'. $DisplayVolume .'</td> - </tr></table>'; + echo '<table class="selection"> + <tr> + <td>'. _('Total Weight') .':</td> + <td>'. $DisplayWeight .'</td> + <td>'. _('Total Volume') .':</td> + <td>'. $DisplayVolume .'</td> + </tr> + </table>'; } -echo '<br /><table class=selection><tr> - <td>'. _('Deliver To') .':</td> - <td><input type="text" size=42 maxlength=40 name="DeliverTo" value="' . $_SESSION['Items'.$identifier]->DeliverTo . '"></td> -</tr>'; +echo '<br /><table class="selection"> + <tr> + <td>'. _('Deliver To') .':</td> + <td><input type="text" size=42 maxlength=40 name="DeliverTo" value="' . $_SESSION['Items'.$identifier]->DeliverTo . '"></td> + </tr>'; echo '<tr> <td>'. _('Deliver from the warehouse at') .':</td> @@ -995,6 +1005,11 @@ </tr>'; echo '<tr> + <td>'. _('Buyer Name') . ':</td> + <td><input type="text" size=30 maxlength=30 name="BuyerName" value="' . $_SESSION['Items'.$identifier]->BuyerName . '"></td> +</tr>'; + +echo '<tr> <td>'. _('Delivery Address 1') . ':</td> <td><input type="text" size=42 maxlength=40 name="BrAdd1" value="' . $_SESSION['Items'.$identifier]->DelAdd1 . '"></td> </tr>'; Modified: trunk/doc/Change.log =================================================================== --- trunk/doc/Change.log 2011-08-23 06:27:45 UTC (rev 4666) +++ trunk/doc/Change.log 2011-08-24 10:29:52 UTC (rev 4667) @@ -1,5 +1,6 @@ webERP Change Log +23/8/11 Phil: Added BuyerName to Delivery Details and the cart class 23/8/11 Ricard: PDFPrintLabel Does Not display discontinued items and now allows printing of future price labels 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 Modified: trunk/includes/DefineCartClass.php =================================================================== --- trunk/includes/DefineCartClass.php 2011-08-23 06:27:45 UTC (rev 4666) +++ trunk/includes/DefineCartClass.php 2011-08-24 10:29:52 UTC (rev 4667) @@ -59,6 +59,7 @@ Var $DeliveryDays; var $TaxTotals; var $TaxGLCodes; + var $BuyerName; function Cart(){ /*Constructor function initialises a new shopping cart */ This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <dai...@us...> - 2011-08-24 10:29:58
|
Revision: 4667 http://web-erp.svn.sourceforge.net/web-erp/?rev=4667&view=rev Author: daintree Date: 2011-08-24 10:29:52 +0000 (Wed, 24 Aug 2011) Log Message: ----------- Added buyername to be captured at order entry Modified Paths: -------------- trunk/DeliveryDetails.php trunk/doc/Change.log trunk/includes/DefineCartClass.php Modified: trunk/DeliveryDetails.php =================================================================== --- trunk/DeliveryDetails.php 2011-08-23 06:27:45 UTC (rev 4666) +++ trunk/DeliveryDetails.php 2011-08-24 10:29:52 UTC (rev 4667) @@ -187,6 +187,7 @@ $_SESSION['Items'.$identifier]->Quotation = $_POST['Quotation']; } else { $_SESSION['Items'.$identifier]->DeliverTo = $_POST['DeliverTo']; + $_SESSION['Items'.$identifier]->BuyerName = $_POST['BuyerName']; $_SESSION['Items'.$identifier]->DelAdd1 = $_POST['BrAdd1']; $_SESSION['Items'.$identifier]->DelAdd2 = $_POST['BrAdd2']; $_SESSION['Items'.$identifier]->DelAdd3 = $_POST['BrAdd3']; @@ -333,6 +334,7 @@ ordertype, shipvia, deliverto, + buyername, deladd1, deladd2, deladd3, @@ -354,10 +356,11 @@ '" . $_SESSION['Items'.$identifier]->Branch . "', '". DB_escape_string($_SESSION['Items'.$identifier]->CustRef) ."', '". DB_escape_string($_SESSION['Items'.$identifier]->Comments) ."', - '" . Date("Y-m-d H:i") . "', + '" . Date('Y-m-d H:i') . "', '" . $_SESSION['Items'.$identifier]->DefaultSalesType . "', '" . $_POST['ShipVia'] ."', '". DB_escape_string($_SESSION['Items'.$identifier]->DeliverTo) . "', + '" . DB_escape_string($_SESSION['Items'.$identifier]->BuyerName) . "', '" . DB_escape_string($_SESSION['Items'.$identifier]->DelAdd1) . "', '" . DB_escape_string($_SESSION['Items'.$identifier]->DelAdd2) . "', '" . DB_escape_string($_SESSION['Items'.$identifier]->DelAdd3) . "', @@ -717,6 +720,7 @@ quotedate = '" . FormatDateForSQL(DB_escape_string($_SESSION['Items'.$identifier]->QuoteDate)) . "', confirmeddate = '" . FormatDateForSQL(DB_escape_string($_SESSION['Items'.$identifier]->ConfirmedDate)) . "', deliverto = '" . DB_escape_string($_SESSION['Items'.$identifier]->DeliverTo) . "', + buyername = '" . DB_escape_string($_SESSION['Items'.$identifier]->BuyerName) . "', deladd1 = '" . DB_escape_string($_SESSION['Items'.$identifier]->DelAdd1) . "', deladd2 = '" . DB_escape_string($_SESSION['Items'.$identifier]->DelAdd2) . "', deladd3 = '" . DB_escape_string($_SESSION['Items'.$identifier]->DelAdd3) . "', @@ -881,13 +885,14 @@ /*Display the order without discount */ echo '<div class="centre"><b>' . _('Order Summary') . '</b></div> - <table cellpadding=2 colspan=7 border=1><tr> - <th>'. _('Item Description') .'</th> - <th>'. _('Quantity') .'</th> - <th>'. _('Unit') .'</th> - <th>'. _('Price') .'</th> - <th>'. _('Total') .'</th> - </tr>'; + <table cellpadding="2" colspan="7" border="1"> + <tr> + <th>'. _('Item Description') .'</th> + <th>'. _('Quantity') .'</th> + <th>'. _('Unit') .'</th> + <th>'. _('Price') .'</th> + <th>'. _('Total') .'</th> + </tr>'; $_SESSION['Items'.$identifier]->total = 0; $_SESSION['Items'.$identifier]->totalVolume = 0; @@ -921,28 +926,33 @@ } $DisplayTotal = number_format($_SESSION['Items'.$identifier]->total,$_SESSION['Items'.$identifier]->CurrDecimalPlaces); - echo '<table class=selection><tr> - <td>'. _('Total Weight') .':</td> - <td>'.$DisplayWeight .'</td> - <td>'. _('Total Volume') .':</td> - <td>'.$DisplayVolume .'</td> - </tr></table>'; + echo '<table class="selection"> + <tr> + <td>'. _('Total Weight') .':</td> + <td>'.$DisplayWeight .'</td> + <td>'. _('Total Volume') .':</td> + <td>'.$DisplayVolume .'</td> + </tr> + </table>'; $DisplayVolume = number_format($_SESSION['Items'.$identifier]->totalVolume,2); $DisplayWeight = number_format($_SESSION['Items'.$identifier]->totalWeight,2); - echo '<table class=selection><tr> - <td>'. _('Total Weight') .':</td> - <td>'. $DisplayWeight .'</td> - <td>'. _('Total Volume') .':</td> - <td>'. $DisplayVolume .'</td> - </tr></table>'; + echo '<table class="selection"> + <tr> + <td>'. _('Total Weight') .':</td> + <td>'. $DisplayWeight .'</td> + <td>'. _('Total Volume') .':</td> + <td>'. $DisplayVolume .'</td> + </tr> + </table>'; } -echo '<br /><table class=selection><tr> - <td>'. _('Deliver To') .':</td> - <td><input type="text" size=42 maxlength=40 name="DeliverTo" value="' . $_SESSION['Items'.$identifier]->DeliverTo . '"></td> -</tr>'; +echo '<br /><table class="selection"> + <tr> + <td>'. _('Deliver To') .':</td> + <td><input type="text" size=42 maxlength=40 name="DeliverTo" value="' . $_SESSION['Items'.$identifier]->DeliverTo . '"></td> + </tr>'; echo '<tr> <td>'. _('Deliver from the warehouse at') .':</td> @@ -995,6 +1005,11 @@ </tr>'; echo '<tr> + <td>'. _('Buyer Name') . ':</td> + <td><input type="text" size=30 maxlength=30 name="BuyerName" value="' . $_SESSION['Items'.$identifier]->BuyerName . '"></td> +</tr>'; + +echo '<tr> <td>'. _('Delivery Address 1') . ':</td> <td><input type="text" size=42 maxlength=40 name="BrAdd1" value="' . $_SESSION['Items'.$identifier]->DelAdd1 . '"></td> </tr>'; Modified: trunk/doc/Change.log =================================================================== --- trunk/doc/Change.log 2011-08-23 06:27:45 UTC (rev 4666) +++ trunk/doc/Change.log 2011-08-24 10:29:52 UTC (rev 4667) @@ -1,5 +1,6 @@ webERP Change Log +23/8/11 Phil: Added BuyerName to Delivery Details and the cart class 23/8/11 Ricard: PDFPrintLabel Does Not display discontinued items and now allows printing of future price labels 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 Modified: trunk/includes/DefineCartClass.php =================================================================== --- trunk/includes/DefineCartClass.php 2011-08-23 06:27:45 UTC (rev 4666) +++ trunk/includes/DefineCartClass.php 2011-08-24 10:29:52 UTC (rev 4667) @@ -59,6 +59,7 @@ Var $DeliveryDays; var $TaxTotals; var $TaxGLCodes; + var $BuyerName; function Cart(){ /*Constructor function initialises a new shopping cart */ This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <dai...@us...> - 2011-08-26 21:06:33
|
Revision: 4668 http://web-erp.svn.sourceforge.net/web-erp/?rev=4668&view=rev Author: daintree Date: 2011-08-26 21:06:27 +0000 (Fri, 26 Aug 2011) Log Message: ----------- 27/8/11 Phil: WorkOrderIssue.php now allows issue of 0 cost items to the work order - in the event that customer supplied product needs to be included in a work order and the quantities maintained for accountability to the customer 26/8/11 Pablo Martin: Fixed bugs in ConnectDB_mysql.inc in DB_Txn_Commit and DB_Txn_Begin was using msql functions not mysql functions!! Modified Paths: -------------- trunk/SelectCustomer.php trunk/Stocks.php trunk/WorkOrderIssue.php trunk/doc/Change.log trunk/includes/ConnectDB_mysql.inc trunk/includes/session.inc Modified: trunk/SelectCustomer.php =================================================================== --- trunk/SelectCustomer.php 2011-08-24 10:29:52 UTC (rev 4667) +++ trunk/SelectCustomer.php 2011-08-26 21:06:27 UTC (rev 4668) @@ -259,7 +259,7 @@ if (isset($_POST['JustSelectedACustomer'])){ /*Need to figure out the number of the form variable that the user clicked on */ - for ($i=0; $i< count($_POST); $i++){ //loop through the returned customers + for ($i=0; $i==count($_POST); $i++){ //loop through the returned customers if(isset($_POST['SubmitCustomerSelection'.$i])){ break; } @@ -514,7 +514,7 @@ echo '<tr class="OddTableRows">'; $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> + 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'].'" /> <td><font size=1>' . $myrow['name'] . '</font></td> Modified: trunk/Stocks.php =================================================================== --- trunk/Stocks.php 2011-08-24 10:29:52 UTC (rev 4667) +++ trunk/Stocks.php 2011-08-26 21:06:27 UTC (rev 4668) @@ -105,7 +105,7 @@ } if (ContainsIllegalCharacters($StockID) OR mb_strpos($StockID,' ')) { $InputError = 1; - prnMsg(_('The stock item code cannot contain any of the following characters') . " - ' & + \" \\ " . _('or a space'),'error'); + prnMsg(_('The stock item code cannot contain any of the following characters') . " - ' & + \" \\ ." . _('or a space'),'error'); $Errors[$i] = 'StockID'; $i++; $StockID=''; Modified: trunk/WorkOrderIssue.php =================================================================== --- trunk/WorkOrderIssue.php 2011-08-24 10:29:52 UTC (rev 4667) +++ trunk/WorkOrderIssue.php 2011-08-26 21:06:27 UTC (rev 4668) @@ -103,8 +103,7 @@ $IssueItemRow = DB_fetch_array($Result); if ($IssueItemRow['cost']==0){ - prnMsg(_('The item being issued has a zero cost. Zero cost items cannot be issued to work orders'),'error'); - $InputError=1; + prnMsg(_('The item being issued has a zero cost. The issue will still be processed '),'warn'); } if ($_SESSION['ProhibitNegativeStock']==1 Modified: trunk/doc/Change.log =================================================================== --- trunk/doc/Change.log 2011-08-24 10:29:52 UTC (rev 4667) +++ trunk/doc/Change.log 2011-08-26 21:06:27 UTC (rev 4668) @@ -1,5 +1,7 @@ webERP Change Log +27/8/11 Phil: WorkOrderIssue.php now allows issue of 0 cost items to the work order - in the event that customer supplied product needs to be included in a work order and the quantities maintained for accountability to the customer +26/8/11 Pablo Martin: Fixed bugs in ConnectDB_mysql.inc in DB_Txn_Commit and DB_Txn_Begin was using msql functions not mysql functions!! 23/8/11 Phil: Added BuyerName to Delivery Details and the cart class 23/8/11 Ricard: PDFPrintLabel Does Not display discontinued items and now allows printing of future price labels 21/8/11 Phil: Fixed bug that duplicated purchase order items when more than one item was added to an existing purchase order Modified: trunk/includes/ConnectDB_mysql.inc =================================================================== --- trunk/includes/ConnectDB_mysql.inc 2011-08-24 10:29:52 UTC (rev 4667) +++ trunk/includes/ConnectDB_mysql.inc 2011-08-26 21:06:27 UTC (rev 4668) @@ -214,10 +214,10 @@ } function DB_IgnoreForeignKeys($Conn){ - msql_query("SET FOREIGN_KEY_CHECKS=0",$Conn); + mysql_query("SET FOREIGN_KEY_CHECKS=0",$Conn); } function DB_ReinstateForeignKeys($Conn){ - msql_query("SET FOREIGN_KEY_CHECKS=1",$Conn); + mysql_query("SET FOREIGN_KEY_CHECKS=1",$Conn); } ?> Modified: trunk/includes/session.inc =================================================================== --- trunk/includes/session.inc 2011-08-24 10:29:52 UTC (rev 4667) +++ trunk/includes/session.inc 2011-08-26 21:06:27 UTC (rev 4668) @@ -5,6 +5,7 @@ $PathPrefix=''; } + if (!file_exists($PathPrefix . 'config.php')){ $rootpath = dirname($_SERVER['PHP_SELF']); if ($rootpath == '/' OR $rootpath == "\\") { This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <dai...@us...> - 2011-08-26 21:06:34
|
Revision: 4668 http://web-erp.svn.sourceforge.net/web-erp/?rev=4668&view=rev Author: daintree Date: 2011-08-26 21:06:27 +0000 (Fri, 26 Aug 2011) Log Message: ----------- 27/8/11 Phil: WorkOrderIssue.php now allows issue of 0 cost items to the work order - in the event that customer supplied product needs to be included in a work order and the quantities maintained for accountability to the customer 26/8/11 Pablo Martin: Fixed bugs in ConnectDB_mysql.inc in DB_Txn_Commit and DB_Txn_Begin was using msql functions not mysql functions!! Modified Paths: -------------- trunk/SelectCustomer.php trunk/Stocks.php trunk/WorkOrderIssue.php trunk/doc/Change.log trunk/includes/ConnectDB_mysql.inc trunk/includes/session.inc Modified: trunk/SelectCustomer.php =================================================================== --- trunk/SelectCustomer.php 2011-08-24 10:29:52 UTC (rev 4667) +++ trunk/SelectCustomer.php 2011-08-26 21:06:27 UTC (rev 4668) @@ -259,7 +259,7 @@ if (isset($_POST['JustSelectedACustomer'])){ /*Need to figure out the number of the form variable that the user clicked on */ - for ($i=0; $i< count($_POST); $i++){ //loop through the returned customers + for ($i=0; $i==count($_POST); $i++){ //loop through the returned customers if(isset($_POST['SubmitCustomerSelection'.$i])){ break; } @@ -514,7 +514,7 @@ echo '<tr class="OddTableRows">'; $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> + 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'].'" /> <td><font size=1>' . $myrow['name'] . '</font></td> Modified: trunk/Stocks.php =================================================================== --- trunk/Stocks.php 2011-08-24 10:29:52 UTC (rev 4667) +++ trunk/Stocks.php 2011-08-26 21:06:27 UTC (rev 4668) @@ -105,7 +105,7 @@ } if (ContainsIllegalCharacters($StockID) OR mb_strpos($StockID,' ')) { $InputError = 1; - prnMsg(_('The stock item code cannot contain any of the following characters') . " - ' & + \" \\ " . _('or a space'),'error'); + prnMsg(_('The stock item code cannot contain any of the following characters') . " - ' & + \" \\ ." . _('or a space'),'error'); $Errors[$i] = 'StockID'; $i++; $StockID=''; Modified: trunk/WorkOrderIssue.php =================================================================== --- trunk/WorkOrderIssue.php 2011-08-24 10:29:52 UTC (rev 4667) +++ trunk/WorkOrderIssue.php 2011-08-26 21:06:27 UTC (rev 4668) @@ -103,8 +103,7 @@ $IssueItemRow = DB_fetch_array($Result); if ($IssueItemRow['cost']==0){ - prnMsg(_('The item being issued has a zero cost. Zero cost items cannot be issued to work orders'),'error'); - $InputError=1; + prnMsg(_('The item being issued has a zero cost. The issue will still be processed '),'warn'); } if ($_SESSION['ProhibitNegativeStock']==1 Modified: trunk/doc/Change.log =================================================================== --- trunk/doc/Change.log 2011-08-24 10:29:52 UTC (rev 4667) +++ trunk/doc/Change.log 2011-08-26 21:06:27 UTC (rev 4668) @@ -1,5 +1,7 @@ webERP Change Log +27/8/11 Phil: WorkOrderIssue.php now allows issue of 0 cost items to the work order - in the event that customer supplied product needs to be included in a work order and the quantities maintained for accountability to the customer +26/8/11 Pablo Martin: Fixed bugs in ConnectDB_mysql.inc in DB_Txn_Commit and DB_Txn_Begin was using msql functions not mysql functions!! 23/8/11 Phil: Added BuyerName to Delivery Details and the cart class 23/8/11 Ricard: PDFPrintLabel Does Not display discontinued items and now allows printing of future price labels 21/8/11 Phil: Fixed bug that duplicated purchase order items when more than one item was added to an existing purchase order Modified: trunk/includes/ConnectDB_mysql.inc =================================================================== --- trunk/includes/ConnectDB_mysql.inc 2011-08-24 10:29:52 UTC (rev 4667) +++ trunk/includes/ConnectDB_mysql.inc 2011-08-26 21:06:27 UTC (rev 4668) @@ -214,10 +214,10 @@ } function DB_IgnoreForeignKeys($Conn){ - msql_query("SET FOREIGN_KEY_CHECKS=0",$Conn); + mysql_query("SET FOREIGN_KEY_CHECKS=0",$Conn); } function DB_ReinstateForeignKeys($Conn){ - msql_query("SET FOREIGN_KEY_CHECKS=1",$Conn); + mysql_query("SET FOREIGN_KEY_CHECKS=1",$Conn); } ?> Modified: trunk/includes/session.inc =================================================================== --- trunk/includes/session.inc 2011-08-24 10:29:52 UTC (rev 4667) +++ trunk/includes/session.inc 2011-08-26 21:06:27 UTC (rev 4668) @@ -5,6 +5,7 @@ $PathPrefix=''; } + if (!file_exists($PathPrefix . 'config.php')){ $rootpath = dirname($_SERVER['PHP_SELF']); if ($rootpath == '/' OR $rootpath == "\\") { This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <dai...@us...> - 2011-08-28 01:09:06
|
Revision: 4669 http://web-erp.svn.sourceforge.net/web-erp/?rev=4669&view=rev Author: daintree Date: 2011-08-28 01:08:59 +0000 (Sun, 28 Aug 2011) Log Message: ----------- Modified Paths: -------------- trunk/BOMListing.php trunk/WorkOrderEntry.php trunk/includes/ConnectDB_mysqli.inc Modified: trunk/BOMListing.php =================================================================== --- trunk/BOMListing.php 2011-08-26 21:06:27 UTC (rev 4668) +++ trunk/BOMListing.php 2011-08-28 01:08:59 UTC (rev 4669) @@ -19,24 +19,21 @@ /*Now figure out the bills to report for the part range under review */ $SQL = "SELECT bom.parent, - bom.component, - stockmaster.description as compdescription, - stockmaster.decimalplaces, - bom.quantity, - bom.loccode, - bom.workcentreadded, - bom.effectiveto AS eff_to, - bom.effectiveafter AS eff_frm - FROM - stockmaster, - bom - WHERE stockmaster.stockid=bom.component - AND bom.parent >= '" . $_POST['FromCriteria'] . "' - AND bom.parent <= '" . $_POST['ToCriteria'] . "' - AND bom.effectiveto >= NOW() AND bom.effectiveafter <= NOW() - ORDER BY - bom.parent, - bom.component"; + bom.component, + stockmaster.description as compdescription, + stockmaster.decimalplaces, + bom.quantity, + bom.loccode, + bom.workcentreadded, + bom.effectiveto AS eff_to, + bom.effectiveafter AS eff_frm + FROM stockmaster INNER JOIN bom + ON stockmaster.stockid=bom.component + WHERE bom.parent >= '" . $_POST['FromCriteria'] . "' + AND bom.parent <= '" . $_POST['ToCriteria'] . "' + AND bom.effectiveto >= NOW() AND bom.effectiveafter <= NOW() + ORDER BY bom.parent, + bom.component"; $BOMResult = DB_query($SQL,$db,'','',false,false); //dont do error trapping inside DB_query Modified: trunk/WorkOrderEntry.php =================================================================== --- trunk/WorkOrderEntry.php 2011-08-26 21:06:27 UTC (rev 4668) +++ trunk/WorkOrderEntry.php 2011-08-28 01:08:59 UTC (rev 4669) @@ -393,7 +393,7 @@ } } -echo '<form method="post" action="' . $_SERVER['PHP_SELF'] . '" name="form">'; +echo '<form method="post" action="' . $_SERVER['PHP_SELF'] . '" name="form1">'; echo '<input type="hidden" name="FormID" value="' . $_SESSION['FormID'] . '" />'; echo '<br /><table class="selection">'; @@ -456,7 +456,7 @@ echo '<input type=hidden name="WO" value=' .$_POST['WO'] . '>'; echo '<tr><td class="label">' . _('Work Order Reference') . ':</td><td>' . $_POST['WO'] . '</td></tr>'; echo '<tr><td class="label">' . _('Factory Location') .':</td> - <td><select name="StockLocation">'; + <td><select name="StockLocation" onChange="ReloadForm(form1.submit)">'; $LocResult = DB_query("SELECT loccode,locationname FROM locations",$db); while ($LocRow = DB_fetch_array($LocResult)){ if ($_POST['StockLocation']==$LocRow['loccode']){ @@ -471,7 +471,7 @@ } echo '<tr><td class="label">' . _('Start Date') . ':</td><td><input type="text" name="StartDate" size=12 maxlength=12 value="' . $_POST['StartDate'] . - '" class="date" alt="'.$_SESSION['DefaultDateFormat'].'"></td></tr>'; + '" class="date" alt="'.$_SESSION['DefaultDateFormat'].'" /></td></tr>'; if (!isset($_POST['RequiredBy'])){ $_POST['RequiredBy'] = Date($_SESSION['DefaultDateFormat']); Modified: trunk/includes/ConnectDB_mysqli.inc =================================================================== --- trunk/includes/ConnectDB_mysqli.inc 2011-08-26 21:06:27 UTC (rev 4668) +++ trunk/includes/ConnectDB_mysqli.inc 2011-08-28 01:08:59 UTC (rev 4669) @@ -87,7 +87,7 @@ } prnMsg($ErrorMessage.'<br />' . DB_error_msg($Conn),'error', _('Database Error')); if ($debug==1){ - prnMsg($DebugMessage. "<br />$SQL<br />",'error',_('Database SQL Failure')); + prnMsg($DebugMessage. '<br />' . $SQL . '<br />','error',_('Database SQL Failure')); } if ($Transaction){ $SQL = 'rollback'; This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <dai...@us...> - 2011-08-28 01:09:06
|
Revision: 4669 http://web-erp.svn.sourceforge.net/web-erp/?rev=4669&view=rev Author: daintree Date: 2011-08-28 01:08:59 +0000 (Sun, 28 Aug 2011) Log Message: ----------- Modified Paths: -------------- trunk/BOMListing.php trunk/WorkOrderEntry.php trunk/includes/ConnectDB_mysqli.inc Modified: trunk/BOMListing.php =================================================================== --- trunk/BOMListing.php 2011-08-26 21:06:27 UTC (rev 4668) +++ trunk/BOMListing.php 2011-08-28 01:08:59 UTC (rev 4669) @@ -19,24 +19,21 @@ /*Now figure out the bills to report for the part range under review */ $SQL = "SELECT bom.parent, - bom.component, - stockmaster.description as compdescription, - stockmaster.decimalplaces, - bom.quantity, - bom.loccode, - bom.workcentreadded, - bom.effectiveto AS eff_to, - bom.effectiveafter AS eff_frm - FROM - stockmaster, - bom - WHERE stockmaster.stockid=bom.component - AND bom.parent >= '" . $_POST['FromCriteria'] . "' - AND bom.parent <= '" . $_POST['ToCriteria'] . "' - AND bom.effectiveto >= NOW() AND bom.effectiveafter <= NOW() - ORDER BY - bom.parent, - bom.component"; + bom.component, + stockmaster.description as compdescription, + stockmaster.decimalplaces, + bom.quantity, + bom.loccode, + bom.workcentreadded, + bom.effectiveto AS eff_to, + bom.effectiveafter AS eff_frm + FROM stockmaster INNER JOIN bom + ON stockmaster.stockid=bom.component + WHERE bom.parent >= '" . $_POST['FromCriteria'] . "' + AND bom.parent <= '" . $_POST['ToCriteria'] . "' + AND bom.effectiveto >= NOW() AND bom.effectiveafter <= NOW() + ORDER BY bom.parent, + bom.component"; $BOMResult = DB_query($SQL,$db,'','',false,false); //dont do error trapping inside DB_query Modified: trunk/WorkOrderEntry.php =================================================================== --- trunk/WorkOrderEntry.php 2011-08-26 21:06:27 UTC (rev 4668) +++ trunk/WorkOrderEntry.php 2011-08-28 01:08:59 UTC (rev 4669) @@ -393,7 +393,7 @@ } } -echo '<form method="post" action="' . $_SERVER['PHP_SELF'] . '" name="form">'; +echo '<form method="post" action="' . $_SERVER['PHP_SELF'] . '" name="form1">'; echo '<input type="hidden" name="FormID" value="' . $_SESSION['FormID'] . '" />'; echo '<br /><table class="selection">'; @@ -456,7 +456,7 @@ echo '<input type=hidden name="WO" value=' .$_POST['WO'] . '>'; echo '<tr><td class="label">' . _('Work Order Reference') . ':</td><td>' . $_POST['WO'] . '</td></tr>'; echo '<tr><td class="label">' . _('Factory Location') .':</td> - <td><select name="StockLocation">'; + <td><select name="StockLocation" onChange="ReloadForm(form1.submit)">'; $LocResult = DB_query("SELECT loccode,locationname FROM locations",$db); while ($LocRow = DB_fetch_array($LocResult)){ if ($_POST['StockLocation']==$LocRow['loccode']){ @@ -471,7 +471,7 @@ } echo '<tr><td class="label">' . _('Start Date') . ':</td><td><input type="text" name="StartDate" size=12 maxlength=12 value="' . $_POST['StartDate'] . - '" class="date" alt="'.$_SESSION['DefaultDateFormat'].'"></td></tr>'; + '" class="date" alt="'.$_SESSION['DefaultDateFormat'].'" /></td></tr>'; if (!isset($_POST['RequiredBy'])){ $_POST['RequiredBy'] = Date($_SESSION['DefaultDateFormat']); Modified: trunk/includes/ConnectDB_mysqli.inc =================================================================== --- trunk/includes/ConnectDB_mysqli.inc 2011-08-26 21:06:27 UTC (rev 4668) +++ trunk/includes/ConnectDB_mysqli.inc 2011-08-28 01:08:59 UTC (rev 4669) @@ -87,7 +87,7 @@ } prnMsg($ErrorMessage.'<br />' . DB_error_msg($Conn),'error', _('Database Error')); if ($debug==1){ - prnMsg($DebugMessage. "<br />$SQL<br />",'error',_('Database SQL Failure')); + prnMsg($DebugMessage. '<br />' . $SQL . '<br />','error',_('Database SQL Failure')); } if ($Transaction){ $SQL = 'rollback'; This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <dai...@us...> - 2011-08-30 08:48:55
|
Revision: 4671 http://web-erp.svn.sourceforge.net/web-erp/?rev=4671&view=rev Author: daintree Date: 2011-08-30 08:48:48 +0000 (Tue, 30 Aug 2011) Log Message: ----------- Modified Paths: -------------- trunk/StockCostUpdate.php trunk/WorkOrderEntry.php trunk/WorkOrderReceive.php trunk/doc/Change.log trunk/includes/SQL_CommonFunctions.inc trunk/sql/mysql/upgrade4.05-4.06.sql Modified: trunk/StockCostUpdate.php =================================================================== --- trunk/StockCostUpdate.php 2011-08-28 09:25:31 UTC (rev 4670) +++ trunk/StockCostUpdate.php 2011-08-30 08:48:48 UTC (rev 4671) @@ -69,7 +69,8 @@ $SQL = "UPDATE stockmaster SET materialcost='" . $_POST['MaterialCost'] . "', labourcost='" . $_POST['LabourCost'] . "', overheadcost='" . $_POST['OverheadCost'] . "', - lastcost='" . $OldCost . "' + lastcost='" . $OldCost . "', + lastcostupdate ='" . Date('Y-m-d')."' WHERE stockid='" . $StockID . "'"; $ErrMsg = _('The cost details for the stock item could not be updated because'); @@ -94,6 +95,7 @@ overheadcost, mbflag, stocktype, + lastcostupdate, sum(quantity) as totalqoh FROM stockmaster INNER JOIN locstock ON stockmaster.stockid=locstock.stockid @@ -119,9 +121,10 @@ echo '<table cellpadding=2 class=selection>'; echo '<tr><th colspan=2>' . _('Item Code') . ':<input type="text" name="StockID" value="' . $StockID . '" 1 maxlength=20>'; -echo '<input type="submit" name="Show" VALUE="' . _('Show Cost Details') . '"></th></tr>'; +echo '<input type="submit" name="Show" value="' . _('Show Cost Details') . '"></th></tr>'; echo '<tr><th colspan=2><font color=navy size=2>' . $StockID . ' - ' . $myrow['description'] . '</font></th></tr>'; echo '<tr><th colspan=2><font color=navy size=2>'. _('Total Quantity On Hand') . ': ' . $myrow['totalqoh'] . ' ' . $myrow['units'] .'</font></th></tr>'; +echo '<tr><th colspan=2><font color=navy size=2>'. _('Last Cost update on') . ': ' . ConvertSQLDate($myrow['lastcostupdate']) .'</font></th></tr>'; if (($myrow['mbflag']=='D' AND $myrow['stocktype'] != 'L') OR $myrow['mbflag']=='A' @@ -139,28 +142,43 @@ exit; } -echo '<input type=hidden name=OldMaterialCost VALUE=' . $myrow['materialcost'] .'>'; -echo '<input type=hidden name=OldLabourCost VALUE=' . $myrow['labourcost'] .'>'; -echo '<input type=hidden name=OldOverheadCost VALUE=' . $myrow['overheadcost'] .">"; -echo '<input type=hidden name="QOH" VALUE=' . $myrow['totalqoh'] .'>'; +echo '<input type=hidden name="OldMaterialCost" value="' . $myrow['materialcost'] .'">'; +echo '<input type=hidden name="OldLabourCost" value="' . $myrow['labourcost'] .'">'; +echo '<input type=hidden name="OldOverheadCost" value="' . $myrow['overheadcost'] .'">'; +echo '<input type=hidden name="QOH" value="' . $myrow['totalqoh'] .'">'; -echo '<tr><td>' . _('Last Cost') .':</td><td class=number>' . number_format($myrow['lastcost'],2) . '</td></tr>'; +echo '<tr><td>' . _('Last Cost') .':</td> + <td class="number">' . number_format($myrow['lastcost'],$_SESSION['CompanyRecord']['decimalplaces']) . '</td></tr>'; if (! in_array($UpdateSecurity,$_SESSION['AllowedPageSecurityTokens'])){ - echo '<tr><td>' . _('Cost') . ':</td><td class=number>' . number_format($myrow['materialcost']+$myrow['labourcost']+$myrow['overheadcost'],2) . '</td></tr></table>'; + echo '<tr><td>' . _('Cost') . ':</td> + <td class="number">' . number_format($myrow['materialcost']+$myrow['labourcost']+$myrow['overheadcost'],$_SESSION['CompanyRecord']['decimalplaces']) . '</td> + </tr> + </table>'; } else { if ($myrow['mbflag']=='M'){ - echo '<input type=hidden name="MaterialCost" VALUE=' . $myrow['materialcost'] . '>'; - echo '<tr><td>' . _('Standard Material Cost Per Unit') .':</td><td class=number>' . number_format($myrow['materialcost'],4) . '</td></tr>'; - echo '<tr><td>' . _('Standard Labour Cost Per Unit') . ':</td><td class=number><input type="text" class="number" name="LabourCost" value=' . $myrow['labourcost'] . '></td></tr>'; - echo '<tr><td>' . _('Standard Overhead Cost Per Unit') . ':</td><td class=number><input type="text" class="number" name="OverheadCost" value=' . $myrow['overheadcost'] . '></td></tr>'; + echo '<input type=hidden name="MaterialCost" value=' . $myrow['materialcost'] . '>'; + echo '<tr><td>' . _('Standard Material Cost Per Unit') .':</td> + <td class="number">' . number_format($myrow['materialcost'],4) . '</td> + </tr>'; + echo '<tr> + <td>' . _('Standard Labour Cost Per Unit') . ':</td> + <td class="number"><input type="text" class="number" name="LabourCost" value=' . $myrow['labourcost'] . '></td> + </tr>'; + echo '<tr> + <td>' . _('Standard Overhead Cost Per Unit') . ':</td> + <td class="number"><input type="text" class="number" name="OverheadCost" value=' . $myrow['overheadcost'] . '></td> + </tr>'; } elseif ($myrow['mbflag']=='B' OR $myrow['mbflag']=='D') { - echo '<tr><td>' . _('Standard Cost') .':</td><td class=number><input type="text" class="number" name="MaterialCost" value=' . $myrow['materialcost'] . '></td></tr>'; + echo '<tr> + <td>' . _('Standard Cost') .':</td> + <td class="number"><input type="text" class="number" name="MaterialCost" value=' . $myrow['materialcost'] . '></td> + </tr>'; } else { - echo '<input type="hidden" name="LabourCost" VALUE=0>'; - echo '<input type="hidden" name="OverheadCost" VALUE=0>'; + echo '<input type="hidden" name="LabourCost" value=0>'; + echo '<input type="hidden" name="OverheadCost" value=0>'; } - echo '</table><br /><div class="centre"><input type="submit" name="UpdateData" VALUE="' . _('Update') . '"><br /><br />'; + echo '</table><br /><div class="centre"><input type="submit" name="UpdateData" value="' . _('Update') . '"><br /><br />'; } if ($myrow['mbflag']!='D'){ echo '<div class="centre"><a href="' . $rootpath . '/StockStatus.php?StockID=' . $StockID . '>' . _('Show Stock Status') . '</a>'; Modified: trunk/WorkOrderEntry.php =================================================================== --- trunk/WorkOrderEntry.php 2011-08-28 09:25:31 UTC (rev 4670) +++ trunk/WorkOrderEntry.php 2011-08-30 08:48:48 UTC (rev 4671) @@ -173,76 +173,76 @@ $CheckItemResult = DB_query("SELECT mbflag, eoq, controlled - FROM stockmaster - WHERE stockid='" . $NewItem . "'", + FROM stockmaster + WHERE stockid='" . $NewItem . "'", $db); - if (DB_num_rows($CheckItemResult)==1){ - $CheckItemRow = DB_fetch_array($CheckItemResult); - if ($CheckItemRow['controlled']==1 AND $_SESSION['DefineControlledOnWOEntry']==1){ //need to add serial nos or batches to determine quantity - $EOQ = 0; - } else { - if (!isset($ReqQty)) { - $ReqQty=$CheckItemRow['eoq']; - } - $EOQ = $ReqQty; + if (DB_num_rows($CheckItemResult)==1){ + $CheckItemRow = DB_fetch_array($CheckItemResult); + if ($CheckItemRow['controlled']==1 AND $_SESSION['DefineControlledOnWOEntry']==1){ //need to add serial nos or batches to determine quantity + $EOQ = 0; + } else { + if (!isset($ReqQty)) { + $ReqQty=$CheckItemRow['eoq']; } - if ($CheckItemRow['mbflag']!='M'){ - prnMsg(_('The item selected cannot be added to a work order because it is not a manufactured item'),'warn'); - $InputError=true; - } - } else { - prnMsg(_('The item selected cannot be found in the database'),'error'); - $InputError = true; - } - $CheckItemResult = DB_query("SELECT stockid + $EOQ = $ReqQty; + } + if ($CheckItemRow['mbflag']!='M'){ + prnMsg(_('The item selected cannot be added to a work order because it is not a manufactured item'),'warn'); + $InputError=true; + } + } else { + prnMsg(_('The item selected cannot be found in the database'),'error'); + $InputError = true; + } + $CheckItemResult = DB_query("SELECT stockid FROM woitems WHERE stockid='" . $NewItem . "' AND wo='" .$_POST['WO'] . "'", $db); - if (DB_num_rows($CheckItemResult)==1){ - prnMsg(_('This item is already on the work order and cannot be added again'),'warn'); - $InputError=true; - } + if (DB_num_rows($CheckItemResult)==1){ + prnMsg(_('This item is already on the work order and cannot be added again'),'warn'); + $InputError=true; + } - if ($InputError==false){ + if ($InputError==false){ $CostResult = DB_query("SELECT SUM((materialcost+labourcost+overheadcost)*bom.quantity) AS cost FROM stockmaster INNER JOIN bom ON stockmaster.stockid=bom.component WHERE bom.parent='" . $NewItem . "' AND bom.loccode='" . $_POST['StockLocation'] . "'", $db); - $CostRow = DB_fetch_row($CostResult); + $CostRow = DB_fetch_row($CostResult); if (is_null($CostRow[0]) OR $CostRow[0]==0){ - $Cost =0; - prnMsg(_('The cost of this item as accumulated from the sum of the component costs is nil. This could be because there is no bill of material set up ... you may wish to double check this'),'warn'); + $Cost =0; + prnMsg(_('The cost of this item as accumulated from the sum of the component costs is nil. This could be because there is no bill of material set up ... you may wish to double check this'),'warn'); } else { - $Cost = $CostRow[0]; + $Cost = $CostRow[0]; } if (!isset($EOQ)){ $EOQ=1; } - + $Result = DB_Txn_Begin($db); - + // insert parent item info $sql = "INSERT INTO woitems (wo, - stockid, - qtyreqd, - stdcost) - VALUES ( '" . $_POST['WO'] . "', - '" . $NewItem . "', - '" . $EOQ . "', - '" . $Cost . "' - )"; + stockid, + qtyreqd, + stdcost) + VALUES ( '" . $_POST['WO'] . "', + '" . $NewItem . "', + '" . $EOQ . "', + '" . $Cost . "' + )"; $ErrMsg = _('The work order item could not be added'); $result = DB_query($sql,$db,$ErrMsg); - + //Recursively insert real component requirements - see includes/SQL_CommonFunctions.in for function WoRealRequirements WoRealRequirements($db, $_POST['WO'], $_POST['StockLocation'], $NewItem); - + $result = DB_Txn_Commit($db); - + unset($NewItem); } //end if there were no input errors } //adding a new item to the work order @@ -331,17 +331,16 @@ foreach ($sql as $sql_stmt){ // echo '<br />' . $sql_stmt; $result = DB_query($sql_stmt,$db,$ErrMsg); - } prnMsg(_('The work order has been updated'),'success'); for ($i=1;$i<=$_POST['NumberOfOutputs'];$i++){ - unset($_POST['OutputItem'.$i]); - unset($_POST['OutputQty'.$i]); - unset($_POST['QtyRecd'.$i]); - unset($_POST['NetLotSNRef'.$i]); - unset($_POST['HasWOSerialNos'.$i]); + unset($_POST['OutputItem'.$i]); + unset($_POST['OutputQty'.$i]); + unset($_POST['QtyRecd'.$i]); + unset($_POST['NetLotSNRef'.$i]); + unset($_POST['HasWOSerialNos'.$i]); } } } elseif (isset($_POST['delete'])) { @@ -382,12 +381,12 @@ echo '<p><a href="' . $rootpath . '/SelectWorkOrder.php">' . _('Select an existing outstanding work order') . '</a>'; unset($_POST['WO']); for ($i=1;$i<=$_POST['NumberOfOutputs'];$i++){ - unset($_POST['OutputItem'.$i]); - unset($_POST['OutputQty'.$i]); - unset($_POST['QtyRecd'.$i]); - unset($_POST['NetLotSNRef'.$i]); - unset($_POST['HasWOSerialNos'.$i]); - } + unset($_POST['OutputItem'.$i]); + unset($_POST['OutputQty'.$i]); + unset($_POST['QtyRecd'.$i]); + unset($_POST['NetLotSNRef'.$i]); + unset($_POST['HasWOSerialNos'.$i]); + } include('includes/footer.inc'); exit; } @@ -399,13 +398,13 @@ echo '<br /><table class="selection">'; $sql="SELECT workorders.loccode, - requiredby, - startdate, - costissued, - closed - FROM workorders INNER JOIN locations - ON workorders.loccode=locations.loccode - WHERE workorders.wo='" . $_POST['WO'] . "'"; + requiredby, + startdate, + costissued, + closed + FROM workorders INNER JOIN locations + ON workorders.loccode=locations.loccode + WHERE workorders.wo='" . $_POST['WO'] . "'"; $WOResult = DB_query($sql,$db); if (DB_num_rows($WOResult)==1){ @@ -483,10 +482,10 @@ if (isset($WOResult)){ echo '<tr><td class="label">' . _('Accumulated Costs') . ':</td> - <td class=number>' . number_format($myrow['costissued'],2) . '</td></tr>'; + <td class="number">' . number_format($myrow['costissued'],2) . '</td></tr>'; } echo '</table> - <p><table class=selection>'; + <p><table class="selection">'; echo '<tr><th>' . _('Output Item') . '</th> <th>' . _('Qty Required') . '</th> <th>' . _('Qty Received') . '</th> @@ -507,13 +506,13 @@ echo '<td><input type="hidden" name="OutputItem' . $i . '" value="' . $_POST['OutputItem' .$i] . '">' . $_POST['OutputItem' . $i] . ' - ' . $_POST['OutputItemDesc' .$i] . '</td>'; if ($_POST['Controlled'.$i]==1 AND $_SESSION['DefineControlledOnWOEntry']==1){ - echo '<td style="text-align: right">' . $_POST['OutputQty' . $i] . '</td>'; - echo '<input type="hidden" name="OutputQty' . $i .'" value=' . $_POST['OutputQty' . $i] . '>'; + echo '<td class="number">' . $_POST['OutputQty' . $i] . '</td>'; + echo '<input type="hidden" name="OutputQty' . $i .'" value=' . $_POST['OutputQty' . $i] . ' />'; } else { - echo'<td><input type="text" class="number" name="OutputQty' . $i . '" value=' . $_POST['OutputQty' . $i] . ' size=10 maxlength=10></td>'; + echo'<td><input type="text" class="number" name="OutputQty' . $i . '" value=' . $_POST['OutputQty' . $i] . ' size="10" maxlength="10" /></td>'; } - echo '<td class=number><input type="hidden" name="RecdQty' . $i . '" value=' . $_POST['RecdQty' .$i] . '>' . $_POST['RecdQty' .$i] .'</td> - <td class=number>' . ($_POST['OutputQty' . $i] - $_POST['RecdQty' .$i]) . '</td>'; + echo '<td class="number"><input type="hidden" name="RecdQty' . $i . '" value=' . $_POST['RecdQty' .$i] . '>' . $_POST['RecdQty' .$i] .'</td> + <td class="number">' . ($_POST['OutputQty' . $i] - $_POST['RecdQty' .$i]) . '</td>'; if ($_POST['Controlled'.$i]==1){ echo '<td><input type="text" name="NextLotSNRef' .$i . '" value="' . $_POST['NextLotSNRef'.$i] . '"></td>'; if ($_SESSION['DefineControlledOnWOEntry']==1){ @@ -545,7 +544,7 @@ echo '<div class="centre"><br /><input type=submit name="submit" value="' . _('Update') . '">'; -echo '<br /><p><input type=submit name="delete" VALUE="' . _('Delete This Work Order') . '" onclick="return confirm(\'' . _('Are You Sure?') . '\');">'; +echo '<br /><p><input type=submit name="delete" value="' . _('Delete This Work Order') . '" onclick="return confirm(\'' . _('Are You Sure?') . '\');">'; echo '<br /></div>'; @@ -556,13 +555,14 @@ ORDER BY categorydescription"; $result1 = DB_query($SQL,$db); -echo '<table class=selection><tr><td>' . _('Select a stock category') . ':<select name="StockCat">'; +echo '<table class="selection"> + <tr><td>' . _('Select a stock category') . ':<select name="StockCat">'; if (!isset($_POST['StockCat'])){ - echo '<option selected VALUE="All">' . _('All') . '</option>'; + echo '<option selected value="All">' . _('All') . '</option>'; $_POST['StockCat'] ='All'; } else { - echo '<option VALUE="All">' . _('All') . '</option>'; + echo '<option value="All">' . _('All') . '</option>'; } while ($myrow1 = DB_fetch_array($result1)) { @@ -575,15 +575,16 @@ } ?> -</select> +</select></td> <td><?php echo _('Enter text extracts in the'); ?> <b><?php echo _('description'); ?></b>:</td> -<td><input type="Text" name="Keywords" size=20 maxlength=25 value="<?php if (isset($_POST['Keywords'])) echo $_POST['Keywords']; ?>"></td></tr> +<td><input type="Text" name="Keywords" size=20 maxlength=25 value="<?php if (isset($_POST['Keywords'])) echo $_POST['Keywords']; ?>"></td> +</tr> <tr><td></td> - <td><font SIZE 3><b><?php echo _('OR'); ?> </b></font><?php echo _('Enter extract of the'); ?> <b><?php echo _('Stock Code'); ?></b>:</td> - <td><input type="Text" name="StockCode" size=15 maxlength=18 value="<?php if (isset($_POST['StockCode'])) echo $_POST['StockCode']; ?>"></td> - </tr> - </table> - <br /><div class="centre"><input type=submit name="Search" value="<?php echo _('Search Now'); ?>"> + <td><font SIZE 3><b><?php echo _('OR'); ?> </b></font><?php echo _('Enter extract of the'); ?> <b><?php echo _('Stock Code'); ?></b>:</td> + <td><input type="text" name="StockCode" size="15" maxlength="18" value="<?php if (isset($_POST['StockCode'])) echo $_POST['StockCode']; ?>"></td> +</tr> +</table> +<br /><div class="centre"><input type="submit" name="Search" value="<?php echo _('Search Now'); ?>" /> <?php @@ -593,7 +594,7 @@ if (DB_num_rows($SearchResult)>1){ - echo '<table cellpadding=2 colspan=7 class=selection>'; + echo '<table cellpadding="2" colspan="7" class="selection">'; $TableHeader = '<tr><th>' . _('Code') . '</th> <th>' . _('Description') . '</th> <th>' . _('Units') . '</th></tr>'; @@ -609,7 +610,7 @@ if (!in_array($myrow['stockid'],$ItemCodes)){ if (function_exists('imagecreatefrompng') ){ - $ImageSource = '<img src="GetStockImage.php?SID&automake=1&textcolor=FFFFFF&bgcolor=CCCCCC&StockID=' . urlencode($myrow['stockid']). '&text=&width=64&height=64">'; + $ImageSource = '<img src="GetStockImage.php?automake=1&textcolor=FFFFFF&bgcolor=CCCCCC&StockID=' . urlencode($myrow['stockid']). '&text=&width=64&height=64">'; } else { if(file_exists($_SERVER['DOCUMENT_ROOT'] . $rootpath . '/' . $_SESSION['part_pics_dir'] . '/' . $myrow['stockid'] . '.jpg')) { $ImageSource = '<img src="' .$_SERVER['DOCUMENT_ROOT'] . $rootpath . '/' . $_SESSION['part_pics_dir'] . '/' . $myrow['stockid'] . '.jpg">'; Modified: trunk/WorkOrderReceive.php =================================================================== --- trunk/WorkOrderReceive.php 2011-08-28 09:25:31 UTC (rev 4670) +++ trunk/WorkOrderReceive.php 2011-08-30 08:48:48 UTC (rev 4671) @@ -133,19 +133,19 @@ if ($_SESSION['ProhibitNegativeStock']==1){ /*Now look for autoissue components that would go negative */ - $SQL = "SELECT worequirements.stockid, - stockmaster.description, - locstock.quantity-(" . $QuantityReceived . "*worequirements.qtypu) AS qtyleft - FROM worequirements - INNER JOIN stockmaster - ON worequirements.stockid=stockmaster.stockid - INNER JOIN locstock - ON worequirements.stockid=locstock.stockid - WHERE worequirements.wo='" . $_POST['WO'] . "' - AND worequirements.parentstockid='" .$_POST['StockID'] . "' - AND locstock.loccode='" . $WORow['loccode'] . "' - AND stockmaster.mbflag <>'D' - AND worequirements.autoissue=1"; + $SQL = "SELECT worequirements.stockid, + stockmaster.description, + locstock.quantity-(" . $QuantityReceived . "*worequirements.qtypu) AS qtyleft + FROM worequirements + INNER JOIN stockmaster + ON worequirements.stockid=stockmaster.stockid + INNER JOIN locstock + ON worequirements.stockid=locstock.stockid + WHERE worequirements.wo='" . $_POST['WO'] . "' + AND worequirements.parentstockid='" .$_POST['StockID'] . "' + AND locstock.loccode='" . $WORow['loccode'] . "' + AND stockmaster.mbflag <>'D' + AND worequirements.autoissue=1"; $ErrMsg = _('Could not retrieve the component quantity left at the location once the component items are issued to the work order (for the purposes of checking that stock will not go negative) because'); $Result = DB_query($SQL,$db,$ErrMsg); @@ -260,6 +260,7 @@ } $SQL = "UPDATE stockmaster SET + lastcostupdate='" . Date('Y-m-d') . "', materialcost='" . $Cost . "', labourcost='" . $ItemCostRow['labourcost'] . "', overheadcost='" . $ItemCostRow['overheadcost'] . "', Modified: trunk/doc/Change.log =================================================================== --- trunk/doc/Change.log 2011-08-28 09:25:31 UTC (rev 4670) +++ trunk/doc/Change.log 2011-08-30 08:48:48 UTC (rev 4671) @@ -1,5 +1,7 @@ webERP Change Log +29/8/11 Ricard: Updated lastcostupdate in StockCostUpdate.php +29/8/11 Phil: Reinstated stockmaster.lastcostupdate field - added update to lastcostupdate in WorkOrderReceive.php 27/8/11 Phil: WorkOrderIssue.php now allows issue of 0 cost items to the work order - in the event that customer supplied product needs to be included in a work order and the quantities maintained for accountability to the customer 26/8/11 Pablo Martin: Fixed bugs in ConnectDB_mysql.inc in DB_Txn_Commit and DB_Txn_Begin was using msql functions not mysql functions!! 23/8/11 Phil: Added BuyerName to Delivery Details and the cart class Modified: trunk/includes/SQL_CommonFunctions.inc =================================================================== --- trunk/includes/SQL_CommonFunctions.inc 2011-08-28 09:25:31 UTC (rev 4670) +++ trunk/includes/SQL_CommonFunctions.inc 2011-08-30 08:48:48 UTC (rev 4671) @@ -252,7 +252,7 @@ // remember, 'G' is for ghost (phantom part type) // all components should be referenced to the initial parent - if ($ParentID == "") { + if ($ParentID == '') { $ParentID = $StockID; } Modified: trunk/sql/mysql/upgrade4.05-4.06.sql =================================================================== --- trunk/sql/mysql/upgrade4.05-4.06.sql 2011-08-28 09:25:31 UTC (rev 4670) +++ trunk/sql/mysql/upgrade4.05-4.06.sql 2011-08-30 08:48:48 UTC (rev 4671) @@ -1,2 +1,3 @@ ALTER TABLE stockmaster DROP lastcurcostdate; +ALTER TABLE stockmaster ADD lastcostupdate DATE NOT NULL; UPDATE config SET confvalue='4.05.1' WHERE confname='VersionNumber'; \ No newline at end of file This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <dai...@us...> - 2011-08-30 08:48:55
|
Revision: 4671 http://web-erp.svn.sourceforge.net/web-erp/?rev=4671&view=rev Author: daintree Date: 2011-08-30 08:48:48 +0000 (Tue, 30 Aug 2011) Log Message: ----------- Modified Paths: -------------- trunk/StockCostUpdate.php trunk/WorkOrderEntry.php trunk/WorkOrderReceive.php trunk/doc/Change.log trunk/includes/SQL_CommonFunctions.inc trunk/sql/mysql/upgrade4.05-4.06.sql Modified: trunk/StockCostUpdate.php =================================================================== --- trunk/StockCostUpdate.php 2011-08-28 09:25:31 UTC (rev 4670) +++ trunk/StockCostUpdate.php 2011-08-30 08:48:48 UTC (rev 4671) @@ -69,7 +69,8 @@ $SQL = "UPDATE stockmaster SET materialcost='" . $_POST['MaterialCost'] . "', labourcost='" . $_POST['LabourCost'] . "', overheadcost='" . $_POST['OverheadCost'] . "', - lastcost='" . $OldCost . "' + lastcost='" . $OldCost . "', + lastcostupdate ='" . Date('Y-m-d')."' WHERE stockid='" . $StockID . "'"; $ErrMsg = _('The cost details for the stock item could not be updated because'); @@ -94,6 +95,7 @@ overheadcost, mbflag, stocktype, + lastcostupdate, sum(quantity) as totalqoh FROM stockmaster INNER JOIN locstock ON stockmaster.stockid=locstock.stockid @@ -119,9 +121,10 @@ echo '<table cellpadding=2 class=selection>'; echo '<tr><th colspan=2>' . _('Item Code') . ':<input type="text" name="StockID" value="' . $StockID . '" 1 maxlength=20>'; -echo '<input type="submit" name="Show" VALUE="' . _('Show Cost Details') . '"></th></tr>'; +echo '<input type="submit" name="Show" value="' . _('Show Cost Details') . '"></th></tr>'; echo '<tr><th colspan=2><font color=navy size=2>' . $StockID . ' - ' . $myrow['description'] . '</font></th></tr>'; echo '<tr><th colspan=2><font color=navy size=2>'. _('Total Quantity On Hand') . ': ' . $myrow['totalqoh'] . ' ' . $myrow['units'] .'</font></th></tr>'; +echo '<tr><th colspan=2><font color=navy size=2>'. _('Last Cost update on') . ': ' . ConvertSQLDate($myrow['lastcostupdate']) .'</font></th></tr>'; if (($myrow['mbflag']=='D' AND $myrow['stocktype'] != 'L') OR $myrow['mbflag']=='A' @@ -139,28 +142,43 @@ exit; } -echo '<input type=hidden name=OldMaterialCost VALUE=' . $myrow['materialcost'] .'>'; -echo '<input type=hidden name=OldLabourCost VALUE=' . $myrow['labourcost'] .'>'; -echo '<input type=hidden name=OldOverheadCost VALUE=' . $myrow['overheadcost'] .">"; -echo '<input type=hidden name="QOH" VALUE=' . $myrow['totalqoh'] .'>'; +echo '<input type=hidden name="OldMaterialCost" value="' . $myrow['materialcost'] .'">'; +echo '<input type=hidden name="OldLabourCost" value="' . $myrow['labourcost'] .'">'; +echo '<input type=hidden name="OldOverheadCost" value="' . $myrow['overheadcost'] .'">'; +echo '<input type=hidden name="QOH" value="' . $myrow['totalqoh'] .'">'; -echo '<tr><td>' . _('Last Cost') .':</td><td class=number>' . number_format($myrow['lastcost'],2) . '</td></tr>'; +echo '<tr><td>' . _('Last Cost') .':</td> + <td class="number">' . number_format($myrow['lastcost'],$_SESSION['CompanyRecord']['decimalplaces']) . '</td></tr>'; if (! in_array($UpdateSecurity,$_SESSION['AllowedPageSecurityTokens'])){ - echo '<tr><td>' . _('Cost') . ':</td><td class=number>' . number_format($myrow['materialcost']+$myrow['labourcost']+$myrow['overheadcost'],2) . '</td></tr></table>'; + echo '<tr><td>' . _('Cost') . ':</td> + <td class="number">' . number_format($myrow['materialcost']+$myrow['labourcost']+$myrow['overheadcost'],$_SESSION['CompanyRecord']['decimalplaces']) . '</td> + </tr> + </table>'; } else { if ($myrow['mbflag']=='M'){ - echo '<input type=hidden name="MaterialCost" VALUE=' . $myrow['materialcost'] . '>'; - echo '<tr><td>' . _('Standard Material Cost Per Unit') .':</td><td class=number>' . number_format($myrow['materialcost'],4) . '</td></tr>'; - echo '<tr><td>' . _('Standard Labour Cost Per Unit') . ':</td><td class=number><input type="text" class="number" name="LabourCost" value=' . $myrow['labourcost'] . '></td></tr>'; - echo '<tr><td>' . _('Standard Overhead Cost Per Unit') . ':</td><td class=number><input type="text" class="number" name="OverheadCost" value=' . $myrow['overheadcost'] . '></td></tr>'; + echo '<input type=hidden name="MaterialCost" value=' . $myrow['materialcost'] . '>'; + echo '<tr><td>' . _('Standard Material Cost Per Unit') .':</td> + <td class="number">' . number_format($myrow['materialcost'],4) . '</td> + </tr>'; + echo '<tr> + <td>' . _('Standard Labour Cost Per Unit') . ':</td> + <td class="number"><input type="text" class="number" name="LabourCost" value=' . $myrow['labourcost'] . '></td> + </tr>'; + echo '<tr> + <td>' . _('Standard Overhead Cost Per Unit') . ':</td> + <td class="number"><input type="text" class="number" name="OverheadCost" value=' . $myrow['overheadcost'] . '></td> + </tr>'; } elseif ($myrow['mbflag']=='B' OR $myrow['mbflag']=='D') { - echo '<tr><td>' . _('Standard Cost') .':</td><td class=number><input type="text" class="number" name="MaterialCost" value=' . $myrow['materialcost'] . '></td></tr>'; + echo '<tr> + <td>' . _('Standard Cost') .':</td> + <td class="number"><input type="text" class="number" name="MaterialCost" value=' . $myrow['materialcost'] . '></td> + </tr>'; } else { - echo '<input type="hidden" name="LabourCost" VALUE=0>'; - echo '<input type="hidden" name="OverheadCost" VALUE=0>'; + echo '<input type="hidden" name="LabourCost" value=0>'; + echo '<input type="hidden" name="OverheadCost" value=0>'; } - echo '</table><br /><div class="centre"><input type="submit" name="UpdateData" VALUE="' . _('Update') . '"><br /><br />'; + echo '</table><br /><div class="centre"><input type="submit" name="UpdateData" value="' . _('Update') . '"><br /><br />'; } if ($myrow['mbflag']!='D'){ echo '<div class="centre"><a href="' . $rootpath . '/StockStatus.php?StockID=' . $StockID . '>' . _('Show Stock Status') . '</a>'; Modified: trunk/WorkOrderEntry.php =================================================================== --- trunk/WorkOrderEntry.php 2011-08-28 09:25:31 UTC (rev 4670) +++ trunk/WorkOrderEntry.php 2011-08-30 08:48:48 UTC (rev 4671) @@ -173,76 +173,76 @@ $CheckItemResult = DB_query("SELECT mbflag, eoq, controlled - FROM stockmaster - WHERE stockid='" . $NewItem . "'", + FROM stockmaster + WHERE stockid='" . $NewItem . "'", $db); - if (DB_num_rows($CheckItemResult)==1){ - $CheckItemRow = DB_fetch_array($CheckItemResult); - if ($CheckItemRow['controlled']==1 AND $_SESSION['DefineControlledOnWOEntry']==1){ //need to add serial nos or batches to determine quantity - $EOQ = 0; - } else { - if (!isset($ReqQty)) { - $ReqQty=$CheckItemRow['eoq']; - } - $EOQ = $ReqQty; + if (DB_num_rows($CheckItemResult)==1){ + $CheckItemRow = DB_fetch_array($CheckItemResult); + if ($CheckItemRow['controlled']==1 AND $_SESSION['DefineControlledOnWOEntry']==1){ //need to add serial nos or batches to determine quantity + $EOQ = 0; + } else { + if (!isset($ReqQty)) { + $ReqQty=$CheckItemRow['eoq']; } - if ($CheckItemRow['mbflag']!='M'){ - prnMsg(_('The item selected cannot be added to a work order because it is not a manufactured item'),'warn'); - $InputError=true; - } - } else { - prnMsg(_('The item selected cannot be found in the database'),'error'); - $InputError = true; - } - $CheckItemResult = DB_query("SELECT stockid + $EOQ = $ReqQty; + } + if ($CheckItemRow['mbflag']!='M'){ + prnMsg(_('The item selected cannot be added to a work order because it is not a manufactured item'),'warn'); + $InputError=true; + } + } else { + prnMsg(_('The item selected cannot be found in the database'),'error'); + $InputError = true; + } + $CheckItemResult = DB_query("SELECT stockid FROM woitems WHERE stockid='" . $NewItem . "' AND wo='" .$_POST['WO'] . "'", $db); - if (DB_num_rows($CheckItemResult)==1){ - prnMsg(_('This item is already on the work order and cannot be added again'),'warn'); - $InputError=true; - } + if (DB_num_rows($CheckItemResult)==1){ + prnMsg(_('This item is already on the work order and cannot be added again'),'warn'); + $InputError=true; + } - if ($InputError==false){ + if ($InputError==false){ $CostResult = DB_query("SELECT SUM((materialcost+labourcost+overheadcost)*bom.quantity) AS cost FROM stockmaster INNER JOIN bom ON stockmaster.stockid=bom.component WHERE bom.parent='" . $NewItem . "' AND bom.loccode='" . $_POST['StockLocation'] . "'", $db); - $CostRow = DB_fetch_row($CostResult); + $CostRow = DB_fetch_row($CostResult); if (is_null($CostRow[0]) OR $CostRow[0]==0){ - $Cost =0; - prnMsg(_('The cost of this item as accumulated from the sum of the component costs is nil. This could be because there is no bill of material set up ... you may wish to double check this'),'warn'); + $Cost =0; + prnMsg(_('The cost of this item as accumulated from the sum of the component costs is nil. This could be because there is no bill of material set up ... you may wish to double check this'),'warn'); } else { - $Cost = $CostRow[0]; + $Cost = $CostRow[0]; } if (!isset($EOQ)){ $EOQ=1; } - + $Result = DB_Txn_Begin($db); - + // insert parent item info $sql = "INSERT INTO woitems (wo, - stockid, - qtyreqd, - stdcost) - VALUES ( '" . $_POST['WO'] . "', - '" . $NewItem . "', - '" . $EOQ . "', - '" . $Cost . "' - )"; + stockid, + qtyreqd, + stdcost) + VALUES ( '" . $_POST['WO'] . "', + '" . $NewItem . "', + '" . $EOQ . "', + '" . $Cost . "' + )"; $ErrMsg = _('The work order item could not be added'); $result = DB_query($sql,$db,$ErrMsg); - + //Recursively insert real component requirements - see includes/SQL_CommonFunctions.in for function WoRealRequirements WoRealRequirements($db, $_POST['WO'], $_POST['StockLocation'], $NewItem); - + $result = DB_Txn_Commit($db); - + unset($NewItem); } //end if there were no input errors } //adding a new item to the work order @@ -331,17 +331,16 @@ foreach ($sql as $sql_stmt){ // echo '<br />' . $sql_stmt; $result = DB_query($sql_stmt,$db,$ErrMsg); - } prnMsg(_('The work order has been updated'),'success'); for ($i=1;$i<=$_POST['NumberOfOutputs'];$i++){ - unset($_POST['OutputItem'.$i]); - unset($_POST['OutputQty'.$i]); - unset($_POST['QtyRecd'.$i]); - unset($_POST['NetLotSNRef'.$i]); - unset($_POST['HasWOSerialNos'.$i]); + unset($_POST['OutputItem'.$i]); + unset($_POST['OutputQty'.$i]); + unset($_POST['QtyRecd'.$i]); + unset($_POST['NetLotSNRef'.$i]); + unset($_POST['HasWOSerialNos'.$i]); } } } elseif (isset($_POST['delete'])) { @@ -382,12 +381,12 @@ echo '<p><a href="' . $rootpath . '/SelectWorkOrder.php">' . _('Select an existing outstanding work order') . '</a>'; unset($_POST['WO']); for ($i=1;$i<=$_POST['NumberOfOutputs'];$i++){ - unset($_POST['OutputItem'.$i]); - unset($_POST['OutputQty'.$i]); - unset($_POST['QtyRecd'.$i]); - unset($_POST['NetLotSNRef'.$i]); - unset($_POST['HasWOSerialNos'.$i]); - } + unset($_POST['OutputItem'.$i]); + unset($_POST['OutputQty'.$i]); + unset($_POST['QtyRecd'.$i]); + unset($_POST['NetLotSNRef'.$i]); + unset($_POST['HasWOSerialNos'.$i]); + } include('includes/footer.inc'); exit; } @@ -399,13 +398,13 @@ echo '<br /><table class="selection">'; $sql="SELECT workorders.loccode, - requiredby, - startdate, - costissued, - closed - FROM workorders INNER JOIN locations - ON workorders.loccode=locations.loccode - WHERE workorders.wo='" . $_POST['WO'] . "'"; + requiredby, + startdate, + costissued, + closed + FROM workorders INNER JOIN locations + ON workorders.loccode=locations.loccode + WHERE workorders.wo='" . $_POST['WO'] . "'"; $WOResult = DB_query($sql,$db); if (DB_num_rows($WOResult)==1){ @@ -483,10 +482,10 @@ if (isset($WOResult)){ echo '<tr><td class="label">' . _('Accumulated Costs') . ':</td> - <td class=number>' . number_format($myrow['costissued'],2) . '</td></tr>'; + <td class="number">' . number_format($myrow['costissued'],2) . '</td></tr>'; } echo '</table> - <p><table class=selection>'; + <p><table class="selection">'; echo '<tr><th>' . _('Output Item') . '</th> <th>' . _('Qty Required') . '</th> <th>' . _('Qty Received') . '</th> @@ -507,13 +506,13 @@ echo '<td><input type="hidden" name="OutputItem' . $i . '" value="' . $_POST['OutputItem' .$i] . '">' . $_POST['OutputItem' . $i] . ' - ' . $_POST['OutputItemDesc' .$i] . '</td>'; if ($_POST['Controlled'.$i]==1 AND $_SESSION['DefineControlledOnWOEntry']==1){ - echo '<td style="text-align: right">' . $_POST['OutputQty' . $i] . '</td>'; - echo '<input type="hidden" name="OutputQty' . $i .'" value=' . $_POST['OutputQty' . $i] . '>'; + echo '<td class="number">' . $_POST['OutputQty' . $i] . '</td>'; + echo '<input type="hidden" name="OutputQty' . $i .'" value=' . $_POST['OutputQty' . $i] . ' />'; } else { - echo'<td><input type="text" class="number" name="OutputQty' . $i . '" value=' . $_POST['OutputQty' . $i] . ' size=10 maxlength=10></td>'; + echo'<td><input type="text" class="number" name="OutputQty' . $i . '" value=' . $_POST['OutputQty' . $i] . ' size="10" maxlength="10" /></td>'; } - echo '<td class=number><input type="hidden" name="RecdQty' . $i . '" value=' . $_POST['RecdQty' .$i] . '>' . $_POST['RecdQty' .$i] .'</td> - <td class=number>' . ($_POST['OutputQty' . $i] - $_POST['RecdQty' .$i]) . '</td>'; + echo '<td class="number"><input type="hidden" name="RecdQty' . $i . '" value=' . $_POST['RecdQty' .$i] . '>' . $_POST['RecdQty' .$i] .'</td> + <td class="number">' . ($_POST['OutputQty' . $i] - $_POST['RecdQty' .$i]) . '</td>'; if ($_POST['Controlled'.$i]==1){ echo '<td><input type="text" name="NextLotSNRef' .$i . '" value="' . $_POST['NextLotSNRef'.$i] . '"></td>'; if ($_SESSION['DefineControlledOnWOEntry']==1){ @@ -545,7 +544,7 @@ echo '<div class="centre"><br /><input type=submit name="submit" value="' . _('Update') . '">'; -echo '<br /><p><input type=submit name="delete" VALUE="' . _('Delete This Work Order') . '" onclick="return confirm(\'' . _('Are You Sure?') . '\');">'; +echo '<br /><p><input type=submit name="delete" value="' . _('Delete This Work Order') . '" onclick="return confirm(\'' . _('Are You Sure?') . '\');">'; echo '<br /></div>'; @@ -556,13 +555,14 @@ ORDER BY categorydescription"; $result1 = DB_query($SQL,$db); -echo '<table class=selection><tr><td>' . _('Select a stock category') . ':<select name="StockCat">'; +echo '<table class="selection"> + <tr><td>' . _('Select a stock category') . ':<select name="StockCat">'; if (!isset($_POST['StockCat'])){ - echo '<option selected VALUE="All">' . _('All') . '</option>'; + echo '<option selected value="All">' . _('All') . '</option>'; $_POST['StockCat'] ='All'; } else { - echo '<option VALUE="All">' . _('All') . '</option>'; + echo '<option value="All">' . _('All') . '</option>'; } while ($myrow1 = DB_fetch_array($result1)) { @@ -575,15 +575,16 @@ } ?> -</select> +</select></td> <td><?php echo _('Enter text extracts in the'); ?> <b><?php echo _('description'); ?></b>:</td> -<td><input type="Text" name="Keywords" size=20 maxlength=25 value="<?php if (isset($_POST['Keywords'])) echo $_POST['Keywords']; ?>"></td></tr> +<td><input type="Text" name="Keywords" size=20 maxlength=25 value="<?php if (isset($_POST['Keywords'])) echo $_POST['Keywords']; ?>"></td> +</tr> <tr><td></td> - <td><font SIZE 3><b><?php echo _('OR'); ?> </b></font><?php echo _('Enter extract of the'); ?> <b><?php echo _('Stock Code'); ?></b>:</td> - <td><input type="Text" name="StockCode" size=15 maxlength=18 value="<?php if (isset($_POST['StockCode'])) echo $_POST['StockCode']; ?>"></td> - </tr> - </table> - <br /><div class="centre"><input type=submit name="Search" value="<?php echo _('Search Now'); ?>"> + <td><font SIZE 3><b><?php echo _('OR'); ?> </b></font><?php echo _('Enter extract of the'); ?> <b><?php echo _('Stock Code'); ?></b>:</td> + <td><input type="text" name="StockCode" size="15" maxlength="18" value="<?php if (isset($_POST['StockCode'])) echo $_POST['StockCode']; ?>"></td> +</tr> +</table> +<br /><div class="centre"><input type="submit" name="Search" value="<?php echo _('Search Now'); ?>" /> <?php @@ -593,7 +594,7 @@ if (DB_num_rows($SearchResult)>1){ - echo '<table cellpadding=2 colspan=7 class=selection>'; + echo '<table cellpadding="2" colspan="7" class="selection">'; $TableHeader = '<tr><th>' . _('Code') . '</th> <th>' . _('Description') . '</th> <th>' . _('Units') . '</th></tr>'; @@ -609,7 +610,7 @@ if (!in_array($myrow['stockid'],$ItemCodes)){ if (function_exists('imagecreatefrompng') ){ - $ImageSource = '<img src="GetStockImage.php?SID&automake=1&textcolor=FFFFFF&bgcolor=CCCCCC&StockID=' . urlencode($myrow['stockid']). '&text=&width=64&height=64">'; + $ImageSource = '<img src="GetStockImage.php?automake=1&textcolor=FFFFFF&bgcolor=CCCCCC&StockID=' . urlencode($myrow['stockid']). '&text=&width=64&height=64">'; } else { if(file_exists($_SERVER['DOCUMENT_ROOT'] . $rootpath . '/' . $_SESSION['part_pics_dir'] . '/' . $myrow['stockid'] . '.jpg')) { $ImageSource = '<img src="' .$_SERVER['DOCUMENT_ROOT'] . $rootpath . '/' . $_SESSION['part_pics_dir'] . '/' . $myrow['stockid'] . '.jpg">'; Modified: trunk/WorkOrderReceive.php =================================================================== --- trunk/WorkOrderReceive.php 2011-08-28 09:25:31 UTC (rev 4670) +++ trunk/WorkOrderReceive.php 2011-08-30 08:48:48 UTC (rev 4671) @@ -133,19 +133,19 @@ if ($_SESSION['ProhibitNegativeStock']==1){ /*Now look for autoissue components that would go negative */ - $SQL = "SELECT worequirements.stockid, - stockmaster.description, - locstock.quantity-(" . $QuantityReceived . "*worequirements.qtypu) AS qtyleft - FROM worequirements - INNER JOIN stockmaster - ON worequirements.stockid=stockmaster.stockid - INNER JOIN locstock - ON worequirements.stockid=locstock.stockid - WHERE worequirements.wo='" . $_POST['WO'] . "' - AND worequirements.parentstockid='" .$_POST['StockID'] . "' - AND locstock.loccode='" . $WORow['loccode'] . "' - AND stockmaster.mbflag <>'D' - AND worequirements.autoissue=1"; + $SQL = "SELECT worequirements.stockid, + stockmaster.description, + locstock.quantity-(" . $QuantityReceived . "*worequirements.qtypu) AS qtyleft + FROM worequirements + INNER JOIN stockmaster + ON worequirements.stockid=stockmaster.stockid + INNER JOIN locstock + ON worequirements.stockid=locstock.stockid + WHERE worequirements.wo='" . $_POST['WO'] . "' + AND worequirements.parentstockid='" .$_POST['StockID'] . "' + AND locstock.loccode='" . $WORow['loccode'] . "' + AND stockmaster.mbflag <>'D' + AND worequirements.autoissue=1"; $ErrMsg = _('Could not retrieve the component quantity left at the location once the component items are issued to the work order (for the purposes of checking that stock will not go negative) because'); $Result = DB_query($SQL,$db,$ErrMsg); @@ -260,6 +260,7 @@ } $SQL = "UPDATE stockmaster SET + lastcostupdate='" . Date('Y-m-d') . "', materialcost='" . $Cost . "', labourcost='" . $ItemCostRow['labourcost'] . "', overheadcost='" . $ItemCostRow['overheadcost'] . "', Modified: trunk/doc/Change.log =================================================================== --- trunk/doc/Change.log 2011-08-28 09:25:31 UTC (rev 4670) +++ trunk/doc/Change.log 2011-08-30 08:48:48 UTC (rev 4671) @@ -1,5 +1,7 @@ webERP Change Log +29/8/11 Ricard: Updated lastcostupdate in StockCostUpdate.php +29/8/11 Phil: Reinstated stockmaster.lastcostupdate field - added update to lastcostupdate in WorkOrderReceive.php 27/8/11 Phil: WorkOrderIssue.php now allows issue of 0 cost items to the work order - in the event that customer supplied product needs to be included in a work order and the quantities maintained for accountability to the customer 26/8/11 Pablo Martin: Fixed bugs in ConnectDB_mysql.inc in DB_Txn_Commit and DB_Txn_Begin was using msql functions not mysql functions!! 23/8/11 Phil: Added BuyerName to Delivery Details and the cart class Modified: trunk/includes/SQL_CommonFunctions.inc =================================================================== --- trunk/includes/SQL_CommonFunctions.inc 2011-08-28 09:25:31 UTC (rev 4670) +++ trunk/includes/SQL_CommonFunctions.inc 2011-08-30 08:48:48 UTC (rev 4671) @@ -252,7 +252,7 @@ // remember, 'G' is for ghost (phantom part type) // all components should be referenced to the initial parent - if ($ParentID == "") { + if ($ParentID == '') { $ParentID = $StockID; } Modified: trunk/sql/mysql/upgrade4.05-4.06.sql =================================================================== --- trunk/sql/mysql/upgrade4.05-4.06.sql 2011-08-28 09:25:31 UTC (rev 4670) +++ trunk/sql/mysql/upgrade4.05-4.06.sql 2011-08-30 08:48:48 UTC (rev 4671) @@ -1,2 +1,3 @@ ALTER TABLE stockmaster DROP lastcurcostdate; +ALTER TABLE stockmaster ADD lastcostupdate DATE NOT NULL; UPDATE config SET confvalue='4.05.1' WHERE confname='VersionNumber'; \ No newline at end of file This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <dai...@us...> - 2011-08-31 10:15:11
|
Revision: 4672 http://web-erp.svn.sourceforge.net/web-erp/?rev=4672&view=rev Author: daintree Date: 2011-08-31 10:15:04 +0000 (Wed, 31 Aug 2011) Log Message: ----------- 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 Paths: -------------- trunk/StockAdjustments.php trunk/SystemParameters.php trunk/doc/Change.log trunk/sql/mysql/upgrade4.05-4.06.sql Modified: trunk/StockAdjustments.php =================================================================== --- trunk/StockAdjustments.php 2011-08-30 08:48:48 UTC (rev 4671) +++ trunk/StockAdjustments.php 2011-08-31 10:15:04 UTC (rev 4672) @@ -64,9 +64,15 @@ '" alt="" />' . ' ' . _('Select Item to Adjust') . '</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'); @@ -302,8 +308,15 @@ $Result = DB_Txn_Commit($db); - prnMsg( _('A stock adjustment for'). ' ' . $_SESSION['Adjustment']->StockID . ' - ' . $_SESSION['Adjustment']->ItemDescription . ' '._('has been created from location').' ' . $_SESSION['Adjustment']->StockLocation .' '. _('for a quantity of') . ' ' . $_SESSION['Adjustment']->Quantity,'success'); + $ConfirmationText = _('A stock adjustment for'). ' ' . $_SESSION['Adjustment']->StockID . ' - ' . $_SESSION['Adjustment']->ItemDescription . ' '._('has been created from location').' ' . $_SESSION['Adjustment']->StockLocation .' '. _('for a quantity of') . ' ' . $_SESSION['Adjustment']->Quantity ; + prnMsg( $ConfirmationText,'success'); + if ($_SESSION['InventoryManagerEmail']!=''){ + $ConfirmationText = $ConfirmationText . ' ' . _('by user') . ' ' . $_SESSION['UserID'] . ' ' . _('at') . ' ' . Date('Y-m-d H:i:s'); + $EmailSubject = _('Stock adjustment for'). ' ' . $_SESSION['Adjustment']->StockID; + mail($_SESSION['InventoryManagerEmail'],$EmailSubject,$ConfirmationText); + } + unset ($_SESSION['Adjustment']); } /* end if there was no input error */ @@ -352,9 +365,10 @@ number_format($_SESSION['Adjustment']->StandardCost,4) . '</font></td></tr>'; } -echo '<tr><td>'. _('Adjustment to Stock At Location').':</td><td><select name="StockLocation"> '; +echo '<tr><td>'. _('Adjustment to Stock At Location').':</td> + <td><select name="StockLocation"> '; -$sql = 'SELECT loccode, locationname FROM locations'; +$sql = "SELECT loccode, locationname FROM locations"; $resultStkLocs = DB_query($sql,$db); while ($myrow=DB_fetch_array($resultStkLocs)){ if (isset($_SESSION['Adjustment']->StockLocation)){ Modified: trunk/SystemParameters.php =================================================================== --- trunk/SystemParameters.php 2011-08-30 08:48:48 UTC (rev 4671) +++ trunk/SystemParameters.php 2011-08-31 10:15:04 UTC (rev 4672) @@ -84,6 +84,9 @@ }elseif (!IsEmailAddress($_POST['X_PurchasingManagerEmail'])){ $InputError = 1; prnMsg(_('The Purchasing Manager Email address does not appear to be valid'),'error'); + }elseif (!IsEmailAddress($_POST['X_InventoryManagerEmail']) AND $_POST['X_InventoryManagerEmail']!=''){ + $InputError = 1; + prnMsg(_('The Inventory Manager Email address does not appear to be valid'),'error'); }elseif (mb_strlen($_POST['X_FrequentlyOrderedItems']) > 2 || !is_numeric($_POST['X_FrequentlyOrderedItems'])) { $InputError = 1; prnMsg(_('The number of frequently ordered items to display must be numeric'),'error'); @@ -275,6 +278,9 @@ if ($_SESSION['PurchasingManagerEmail'] != $_POST['X_PurchasingManagerEmail']){ $sql[] = "UPDATE config SET confvalue='" . $_POST['X_PurchasingManagerEmail'] . "' WHERE confname='PurchasingManagerEmail'"; } + if ($_SESSION['InventoryManagerEmail'] != $_POST['X_InventoryManagerEmail']){ + $sql[] = "UPDATE config SET confvalue='" . $_POST['X_InventoryManagerEmail'] . "' WHERE confname='InventoryManagerEmail'"; + } if ($_SESSION['AutoCreateWOs'] != $_POST['X_AutoCreateWOs']){ $sql[] = "UPDATE config SET confvalue='" . $_POST['X_AutoCreateWOs'] . "' WHERE confname='AutoCreateWOs'"; } @@ -1017,7 +1023,11 @@ <td><input type="text" name="X_PurchasingManagerEmail" size=50 maxlength=50 value="' . $_SESSION['PurchasingManagerEmail'] . '"></td> <td>' . _('The email address for the purchasing manager, used to receive notifications by the tendering system') .'</td></tr>'; +echo '<tr style="outline: 1px solid"><td>' . _('Inventory Manager Email Address') . ':</td> + <td><input type="text" name="X_InventoryManagerEmail" size=50 maxlength=50 value="' . $_SESSION['InventoryManagerEmail'] . '"></td> + <td>' . _('The email address for the inventory manager, where notifications of all manual stock adjustments created are sent by the system. Leave blank if no emails should be sent to the factory manager for manual stock adjustments') .'</td></tr>'; + echo '</table> <br /><div class="centre"><input type="Submit" name="submit" value="' . _('Update') . '"></div> </form>'; Modified: trunk/doc/Change.log =================================================================== --- trunk/doc/Change.log 2011-08-30 08:48:48 UTC (rev 4671) +++ trunk/doc/Change.log 2011-08-31 10:15:04 UTC (rev 4672) @@ -1,5 +1,6 @@ webERP Change Log +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. 29/8/11 Ricard: Updated lastcostupdate in StockCostUpdate.php 29/8/11 Phil: Reinstated stockmaster.lastcostupdate field - added update to lastcostupdate in WorkOrderReceive.php 27/8/11 Phil: WorkOrderIssue.php now allows issue of 0 cost items to the work order - in the event that customer supplied product needs to be included in a work order and the quantities maintained for accountability to the customer Modified: trunk/sql/mysql/upgrade4.05-4.06.sql =================================================================== --- trunk/sql/mysql/upgrade4.05-4.06.sql 2011-08-30 08:48:48 UTC (rev 4671) +++ trunk/sql/mysql/upgrade4.05-4.06.sql 2011-08-31 10:15:04 UTC (rev 4672) @@ -1,3 +1,5 @@ ALTER TABLE stockmaster DROP lastcurcostdate; ALTER TABLE stockmaster ADD lastcostupdate DATE NOT NULL; +INSERT INTO `config` (`confname` ,`confvalue`) +VALUES ('InventoryManagerEmail', 'in...@yo...'); UPDATE config SET confvalue='4.05.1' WHERE confname='VersionNumber'; \ No newline at end of file This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <dai...@us...> - 2011-08-31 10:15:11
|
Revision: 4672 http://web-erp.svn.sourceforge.net/web-erp/?rev=4672&view=rev Author: daintree Date: 2011-08-31 10:15:04 +0000 (Wed, 31 Aug 2011) Log Message: ----------- 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 Paths: -------------- trunk/StockAdjustments.php trunk/SystemParameters.php trunk/doc/Change.log trunk/sql/mysql/upgrade4.05-4.06.sql Modified: trunk/StockAdjustments.php =================================================================== --- trunk/StockAdjustments.php 2011-08-30 08:48:48 UTC (rev 4671) +++ trunk/StockAdjustments.php 2011-08-31 10:15:04 UTC (rev 4672) @@ -64,9 +64,15 @@ '" alt="" />' . ' ' . _('Select Item to Adjust') . '</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'); @@ -302,8 +308,15 @@ $Result = DB_Txn_Commit($db); - prnMsg( _('A stock adjustment for'). ' ' . $_SESSION['Adjustment']->StockID . ' - ' . $_SESSION['Adjustment']->ItemDescription . ' '._('has been created from location').' ' . $_SESSION['Adjustment']->StockLocation .' '. _('for a quantity of') . ' ' . $_SESSION['Adjustment']->Quantity,'success'); + $ConfirmationText = _('A stock adjustment for'). ' ' . $_SESSION['Adjustment']->StockID . ' - ' . $_SESSION['Adjustment']->ItemDescription . ' '._('has been created from location').' ' . $_SESSION['Adjustment']->StockLocation .' '. _('for a quantity of') . ' ' . $_SESSION['Adjustment']->Quantity ; + prnMsg( $ConfirmationText,'success'); + if ($_SESSION['InventoryManagerEmail']!=''){ + $ConfirmationText = $ConfirmationText . ' ' . _('by user') . ' ' . $_SESSION['UserID'] . ' ' . _('at') . ' ' . Date('Y-m-d H:i:s'); + $EmailSubject = _('Stock adjustment for'). ' ' . $_SESSION['Adjustment']->StockID; + mail($_SESSION['InventoryManagerEmail'],$EmailSubject,$ConfirmationText); + } + unset ($_SESSION['Adjustment']); } /* end if there was no input error */ @@ -352,9 +365,10 @@ number_format($_SESSION['Adjustment']->StandardCost,4) . '</font></td></tr>'; } -echo '<tr><td>'. _('Adjustment to Stock At Location').':</td><td><select name="StockLocation"> '; +echo '<tr><td>'. _('Adjustment to Stock At Location').':</td> + <td><select name="StockLocation"> '; -$sql = 'SELECT loccode, locationname FROM locations'; +$sql = "SELECT loccode, locationname FROM locations"; $resultStkLocs = DB_query($sql,$db); while ($myrow=DB_fetch_array($resultStkLocs)){ if (isset($_SESSION['Adjustment']->StockLocation)){ Modified: trunk/SystemParameters.php =================================================================== --- trunk/SystemParameters.php 2011-08-30 08:48:48 UTC (rev 4671) +++ trunk/SystemParameters.php 2011-08-31 10:15:04 UTC (rev 4672) @@ -84,6 +84,9 @@ }elseif (!IsEmailAddress($_POST['X_PurchasingManagerEmail'])){ $InputError = 1; prnMsg(_('The Purchasing Manager Email address does not appear to be valid'),'error'); + }elseif (!IsEmailAddress($_POST['X_InventoryManagerEmail']) AND $_POST['X_InventoryManagerEmail']!=''){ + $InputError = 1; + prnMsg(_('The Inventory Manager Email address does not appear to be valid'),'error'); }elseif (mb_strlen($_POST['X_FrequentlyOrderedItems']) > 2 || !is_numeric($_POST['X_FrequentlyOrderedItems'])) { $InputError = 1; prnMsg(_('The number of frequently ordered items to display must be numeric'),'error'); @@ -275,6 +278,9 @@ if ($_SESSION['PurchasingManagerEmail'] != $_POST['X_PurchasingManagerEmail']){ $sql[] = "UPDATE config SET confvalue='" . $_POST['X_PurchasingManagerEmail'] . "' WHERE confname='PurchasingManagerEmail'"; } + if ($_SESSION['InventoryManagerEmail'] != $_POST['X_InventoryManagerEmail']){ + $sql[] = "UPDATE config SET confvalue='" . $_POST['X_InventoryManagerEmail'] . "' WHERE confname='InventoryManagerEmail'"; + } if ($_SESSION['AutoCreateWOs'] != $_POST['X_AutoCreateWOs']){ $sql[] = "UPDATE config SET confvalue='" . $_POST['X_AutoCreateWOs'] . "' WHERE confname='AutoCreateWOs'"; } @@ -1017,7 +1023,11 @@ <td><input type="text" name="X_PurchasingManagerEmail" size=50 maxlength=50 value="' . $_SESSION['PurchasingManagerEmail'] . '"></td> <td>' . _('The email address for the purchasing manager, used to receive notifications by the tendering system') .'</td></tr>'; +echo '<tr style="outline: 1px solid"><td>' . _('Inventory Manager Email Address') . ':</td> + <td><input type="text" name="X_InventoryManagerEmail" size=50 maxlength=50 value="' . $_SESSION['InventoryManagerEmail'] . '"></td> + <td>' . _('The email address for the inventory manager, where notifications of all manual stock adjustments created are sent by the system. Leave blank if no emails should be sent to the factory manager for manual stock adjustments') .'</td></tr>'; + echo '</table> <br /><div class="centre"><input type="Submit" name="submit" value="' . _('Update') . '"></div> </form>'; Modified: trunk/doc/Change.log =================================================================== --- trunk/doc/Change.log 2011-08-30 08:48:48 UTC (rev 4671) +++ trunk/doc/Change.log 2011-08-31 10:15:04 UTC (rev 4672) @@ -1,5 +1,6 @@ webERP Change Log +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. 29/8/11 Ricard: Updated lastcostupdate in StockCostUpdate.php 29/8/11 Phil: Reinstated stockmaster.lastcostupdate field - added update to lastcostupdate in WorkOrderReceive.php 27/8/11 Phil: WorkOrderIssue.php now allows issue of 0 cost items to the work order - in the event that customer supplied product needs to be included in a work order and the quantities maintained for accountability to the customer Modified: trunk/sql/mysql/upgrade4.05-4.06.sql =================================================================== --- trunk/sql/mysql/upgrade4.05-4.06.sql 2011-08-30 08:48:48 UTC (rev 4671) +++ trunk/sql/mysql/upgrade4.05-4.06.sql 2011-08-31 10:15:04 UTC (rev 4672) @@ -1,3 +1,5 @@ ALTER TABLE stockmaster DROP lastcurcostdate; ALTER TABLE stockmaster ADD lastcostupdate DATE NOT NULL; +INSERT INTO `config` (`confname` ,`confvalue`) +VALUES ('InventoryManagerEmail', 'in...@yo...'); UPDATE config SET confvalue='4.05.1' WHERE confname='VersionNumber'; \ No newline at end of file This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <dai...@us...> - 2011-09-02 09:36:09
|
Revision: 4673 http://web-erp.svn.sourceforge.net/web-erp/?rev=4673&view=rev Author: daintree Date: 2011-09-02 09:35:59 +0000 (Fri, 02 Sep 2011) Log Message: ----------- 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 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/GetStockImage.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/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-08-31 10:15:04 UTC (rev 4672) +++ trunk/AgedDebtors.php 2011-09-02 09:35:59 UTC (rev 4673) @@ -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-08-31 10:15:04 UTC (rev 4672) +++ trunk/AgedSuppliers.php 2011-09-02 09:35:59 UTC (rev 4673) @@ -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-08-31 10:15:04 UTC (rev 4672) +++ trunk/BOMExtendedQty.php 2011-09-02 09:35:59 UTC (rev 4673) @@ -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-08-31 10:15:04 UTC (rev 4672) +++ trunk/BOMIndented.php 2011-09-02 09:35:59 UTC (rev 4673) @@ -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-08-31 10:15:04 UTC (rev 4672) +++ trunk/BOMIndentedReverse.php 2011-09-02 09:35:59 UTC (rev 4673) @@ -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-08-31 10:15:04 UTC (rev 4672) +++ trunk/BOMInquiry.php 2011-09-02 09:35:59 UTC (rev 4673) @@ -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-08-31 10:15:04 UTC (rev 4672) +++ trunk/BOMListing.php 2011-09-02 09:35:59 UTC (rev 4673) @@ -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-08-31 10:15:04 UTC (rev 4672) +++ trunk/BOMs.php 2011-09-02 09:35:59 UTC (rev 4673) @@ -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-08-31 10:15:04 UTC (rev 4672) +++ trunk/BankMatching.php 2011-09-02 09:35:59 UTC (rev 4673) @@ -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-08-31 10:15:04 UTC (rev 4672) +++ trunk/BankReconciliation.php 2011-09-02 09:35:59 UTC (rev 4673) @@ -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-08-31 10:15:04 UTC (rev 4672) +++ trunk/ConfirmDispatchControlled_Invoice.php 2011-09-02 09:35:59 UTC (rev 4673) @@ -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-08-31 10:15:04 UTC (rev 4672) +++ trunk/ConfirmDispatch_Invoice.php 2011-09-02 09:35:59 UTC (rev 4673) @@ -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-08-31 10:15:04 UTC (rev 4672) +++ trunk/ContractBOM.php 2011-09-02 09:35:59 UTC (rev 4673) @@ -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-08-31 10:15:04 UTC (rev 4672) +++ trunk/ContractCosting.php 2011-09-02 09:35:59 UTC (rev 4673) @@ -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-08-31 10:15:04 UTC (rev 4672) +++ trunk/ContractOtherReqts.php 2011-09-02 09:35:59 UTC (rev 4673) @@ -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-08-31 10:15:04 UTC (rev 4672) +++ trunk/Contracts.php 2011-09-02 09:35:59 UTC (rev 4673) @@ -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-08-31 10:15:04 UTC (rev 4672) +++ trunk/CounterSales.php 2011-09-02 09:35:59 UTC (rev 4673) @@ -329,7 +329,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 '.locale_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'); @@ -736,7 +736,7 @@ foreach ($_SESSION['Items'.$identifier]->LineItems as $OrderLine) { $SubTotal = $OrderLine->Quantity * $OrderLine->Price * (1 - $OrderLine->DiscountPercent); - $DisplayDiscount = number_format(($OrderLine->DiscountPercent * 100),2); + $DisplayDiscount = locale_number_format(($OrderLine->DiscountPercent * 100),2); $QtyOrdered = $OrderLine->Quantity; $QtyRemain = $QtyOrdered - $OrderLine->QtyInv; @@ -767,7 +767,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">' . number_format($SubTotal,$_SESSION['Items'.$identifier]->CurrDecimalPlaces) . '</td>'; + echo '<td class="number">' . locale_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); @@ -793,8 +793,8 @@ $TaxTotal += $TaxLineTotal; $_SESSION['Items'.$identifier]->TaxTotals=$TaxTotals; $_SESSION['Items'.$identifier]->TaxGLCodes=$TaxGLCodes; - 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 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><a href="' . $_SERVER['PHP_SELF'] . '?identifier='.$identifier . '&Delete=' . $OrderLine->LineNumber . '" onclick="return confirm(\'' . _('Are You Sure?') . '\');">' . _('Delete') . '</a></td></tr>'; if ($_SESSION['AllowOrderLineItemNarrative'] == 1){ @@ -811,9 +811,9 @@ } /* end of loop around items */ echo '<tr class="EvenTableRows"><td colspan="8" class="number"><b>' . _('Total') . '</b></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> + <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> </tr> </table>'; echo '<input type="hidden" name="TaxTotal" value="'.$TaxTotal.'" />'; @@ -2091,7 +2091,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="'.number_format($j+7).'" type="textbox" size="6" name="itm%s" value="0" /> + <td><font size=1><input class="number" tabindex="'.locale_number_format($j+7).'" type="textbox" size="6" name="itm%s" value="0" /> </td> </tr>', $myrow['stockid'], @@ -2109,7 +2109,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='.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='.locale_number_format($j+8).' type="submit" value="'._('Add to Sale').'" /></td>'; echo '</table>'; } //end of if Frequently Ordered Items > 0 if (isset($msg)){ @@ -2172,9 +2172,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="'.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 '<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>'; $TableHeader = '<tr><th>' . _('Code') . '</th> <th>' . _('Description') . '</th> <th>' . _('Units') . '</th> @@ -2268,15 +2268,15 @@ <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%s" value="0" /></font></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> </tr>', $myrow['stockid'], $myrow['description'], $myrow['units'], - number_format($QOH, $QOHRow['decimalplaces']), - number_format($DemandQty, $QOHRow['decimalplaces']), - number_format($OnOrder, $QOHRow['decimalplaces']), - number_format($Available, $QOHRow['decimalplaces']), + locale_number_format($QOH, $QOHRow['decimalplaces']), + locale_number_format($DemandQty, $QOHRow['decimalplaces']), + locale_number_format($OnOrder, $QOHRow['decimalplaces']), + locale_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>'; @@ -2291,9 +2291,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="'.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 '<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 '</table></form>'; echo $jsCall; Modified: trunk/Credit_Invoice.php =================================================================== --- trunk/Credit_Invoice.php 2011-08-31 10:15:04 UTC (rev 4672) +++ trunk/Credit_Invoice.php 2011-09-02 09:35:59 UTC (rev 4673) @@ -310,7 +310,7 @@ echo '<tr '.$RowStarter.'><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>'; if ($LnItm->Controlled==1){ @@ -323,7 +323,7 @@ } - $DisplayLineTotal = number_format($LineTotal,$_SESSION['CreditItems']->CurrDecimalPlaces); + $DisplayLineTotal = locale_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 = number_format($TaxLineTotal ,$_SESSION['CreditItems']->CurrDecimalPlaces); - $DisplayGrossLineTotal = number_format($LineTotal+ $TaxLineTotal,$_SESSION['CreditItems']->CurrDecimalPlaces); + $DisplayTaxAmount = locale_number_format($TaxLineTotal ,$_SESSION['CreditItems']->CurrDecimalPlaces); + $DisplayGrossLineTotal = locale_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>' . number_format($_SESSION['Old_FreightCost'],$_SESSION['CreditItems']->CurrDecimalPlaces) . '</td> + <td class=number>' . locale_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">' . number_format($FreightTaxTotal,$_SESSION['CreditItems']->CurrDecimalPlaces) . '</td> - <td class="number">' . number_format($FreightTaxTotal+ $_SESSION['CreditItems']->FreightCost,$_SESSION['CreditItems']->CurrDecimalPlaces) . '</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> </tr>'; } $TaxTotal += $FreightTaxTotal; -$DisplayTotal = number_format($_SESSION['CreditItems']->total + $_SESSION['CreditItems']->FreightCost,$_SESSION['CreditItems']->CurrDecimalPlaces); +$DisplayTotal = locale_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>' . 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> + <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> </tr></table>'; } $DefaultDispatchDate = Date($_SESSION['DefaultDateFormat']); Modified: trunk/Currencies.php =================================================================== --- trunk/Currencies.php 2011-08-31 10:15:04 UTC (rev 4672) +++ trunk/Currencies.php 2011-09-02 09:35:59 UTC (rev 4673) @@ -262,8 +262,8 @@ $myrow['country'], $myrow['hundredsname'], $myrow['decimalplaces'], - number_format($myrow['rate'],5), - number_format(GetCurrencyRate($myrow['currabrev'],$CurrencyRatesArray),5), + locale_number_format($myrow['rate'],5), + locale_number_format(GetCurrencyRate($myrow['currabrev'],$CurrencyRatesArray),5), $_SERVER['PHP_SELF'] . '?', $myrow['currabrev'], _('Edit'), Modified: trunk/CustWhereAlloc.php =================================================================== --- trunk/CustWhereAlloc.php 2011-08-31 10:15:04 UTC (rev 4672) +++ trunk/CustWhereAlloc.php 2011-09-02 09:35:59 UTC (rev 4673) @@ -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').': '. 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').': '. locale_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>' . number_format($myrow['totalamt'],$_SESSION['CompanyRecord']['decimalplaces']) . '</td> - <td class=number>' . number_format($myrow['amt'],$_SESSION['CompanyRecord']['decimalplaces']) . '</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> </tr>'; $RowCounter++; @@ -135,7 +135,7 @@ } //end of while loop echo '<tr><td colspan = 5 class=number>'._('Total allocated').'</td> - <td class=number>' . number_format($AllocsTotal,2) . '</td></tr>'; + <td class=number>' . locale_number_format($AllocsTotal,2) . '</td></tr>'; echo '</table>'; } } Modified: trunk/CustomerAllocations.php =================================================================== --- trunk/CustomerAllocations.php 2011-08-31 10:15:04 UTC (rev 4672) +++ trunk/CustomerAllocations.php 2011-09-02 09:35:59 UTC (rev 4673) @@ -347,7 +347,7 @@ if ($_SESSION['Alloc']->TransExRate != 1) { echo '<br />' . _('Amount in customer currency') . ' <b>' . - number_format(-$_SESSION['Alloc']->TransAmt,2) . + locale_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>' . number_format($AllocnItem->TransAmount,2) . '</td> - <td class=number>' . number_format($YetToAlloc,2) . '</td>'; + <td class=number>' . locale_number_format($AllocnItem->TransAmount,2) . '</td> + <td class=number>' . locale_number_format($YetToAlloc,2) . '</td>'; $j++; if ($AllocnItem->TransAmount < 0) { $balance+=$YetToAlloc; - echo '<td>' . $curTrans .'</td><td class="number">' . number_format($balance,2) . '</td></tr>'; + echo '<td>' . $curTrans .'</td><td class="number">' . locale_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">' . number_format($balance,2) . '</td></tr>'; + <td class="number">' . locale_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>' . number_format($TotalAllocated,2) . '</u></b></td>'; + <td class=number><b><u>' . locale_number_format($TotalAllocated,2) . '</u></b></td>'; $j++; ec... [truncated message content] |
From: <dai...@us...> - 2011-09-02 09:36:10
|
Revision: 4673 http://web-erp.svn.sourceforge.net/web-erp/?rev=4673&view=rev Author: daintree Date: 2011-09-02 09:35:59 +0000 (Fri, 02 Sep 2011) Log Message: ----------- 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 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/GetStockImage.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/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-08-31 10:15:04 UTC (rev 4672) +++ trunk/AgedDebtors.php 2011-09-02 09:35:59 UTC (rev 4673) @@ -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-08-31 10:15:04 UTC (rev 4672) +++ trunk/AgedSuppliers.php 2011-09-02 09:35:59 UTC (rev 4673) @@ -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-08-31 10:15:04 UTC (rev 4672) +++ trunk/BOMExtendedQty.php 2011-09-02 09:35:59 UTC (rev 4673) @@ -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-08-31 10:15:04 UTC (rev 4672) +++ trunk/BOMIndented.php 2011-09-02 09:35:59 UTC (rev 4673) @@ -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-08-31 10:15:04 UTC (rev 4672) +++ trunk/BOMIndentedReverse.php 2011-09-02 09:35:59 UTC (rev 4673) @@ -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-08-31 10:15:04 UTC (rev 4672) +++ trunk/BOMInquiry.php 2011-09-02 09:35:59 UTC (rev 4673) @@ -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-08-31 10:15:04 UTC (rev 4672) +++ trunk/BOMListing.php 2011-09-02 09:35:59 UTC (rev 4673) @@ -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-08-31 10:15:04 UTC (rev 4672) +++ trunk/BOMs.php 2011-09-02 09:35:59 UTC (rev 4673) @@ -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-08-31 10:15:04 UTC (rev 4672) +++ trunk/BankMatching.php 2011-09-02 09:35:59 UTC (rev 4673) @@ -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-08-31 10:15:04 UTC (rev 4672) +++ trunk/BankReconciliation.php 2011-09-02 09:35:59 UTC (rev 4673) @@ -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-08-31 10:15:04 UTC (rev 4672) +++ trunk/ConfirmDispatchControlled_Invoice.php 2011-09-02 09:35:59 UTC (rev 4673) @@ -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-08-31 10:15:04 UTC (rev 4672) +++ trunk/ConfirmDispatch_Invoice.php 2011-09-02 09:35:59 UTC (rev 4673) @@ -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-08-31 10:15:04 UTC (rev 4672) +++ trunk/ContractBOM.php 2011-09-02 09:35:59 UTC (rev 4673) @@ -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-08-31 10:15:04 UTC (rev 4672) +++ trunk/ContractCosting.php 2011-09-02 09:35:59 UTC (rev 4673) @@ -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-08-31 10:15:04 UTC (rev 4672) +++ trunk/ContractOtherReqts.php 2011-09-02 09:35:59 UTC (rev 4673) @@ -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-08-31 10:15:04 UTC (rev 4672) +++ trunk/Contracts.php 2011-09-02 09:35:59 UTC (rev 4673) @@ -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-08-31 10:15:04 UTC (rev 4672) +++ trunk/CounterSales.php 2011-09-02 09:35:59 UTC (rev 4673) @@ -329,7 +329,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 '.locale_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'); @@ -736,7 +736,7 @@ foreach ($_SESSION['Items'.$identifier]->LineItems as $OrderLine) { $SubTotal = $OrderLine->Quantity * $OrderLine->Price * (1 - $OrderLine->DiscountPercent); - $DisplayDiscount = number_format(($OrderLine->DiscountPercent * 100),2); + $DisplayDiscount = locale_number_format(($OrderLine->DiscountPercent * 100),2); $QtyOrdered = $OrderLine->Quantity; $QtyRemain = $QtyOrdered - $OrderLine->QtyInv; @@ -767,7 +767,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">' . number_format($SubTotal,$_SESSION['Items'.$identifier]->CurrDecimalPlaces) . '</td>'; + echo '<td class="number">' . locale_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); @@ -793,8 +793,8 @@ $TaxTotal += $TaxLineTotal; $_SESSION['Items'.$identifier]->TaxTotals=$TaxTotals; $_SESSION['Items'.$identifier]->TaxGLCodes=$TaxGLCodes; - 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 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><a href="' . $_SERVER['PHP_SELF'] . '?identifier='.$identifier . '&Delete=' . $OrderLine->LineNumber . '" onclick="return confirm(\'' . _('Are You Sure?') . '\');">' . _('Delete') . '</a></td></tr>'; if ($_SESSION['AllowOrderLineItemNarrative'] == 1){ @@ -811,9 +811,9 @@ } /* end of loop around items */ echo '<tr class="EvenTableRows"><td colspan="8" class="number"><b>' . _('Total') . '</b></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> + <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> </tr> </table>'; echo '<input type="hidden" name="TaxTotal" value="'.$TaxTotal.'" />'; @@ -2091,7 +2091,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="'.number_format($j+7).'" type="textbox" size="6" name="itm%s" value="0" /> + <td><font size=1><input class="number" tabindex="'.locale_number_format($j+7).'" type="textbox" size="6" name="itm%s" value="0" /> </td> </tr>', $myrow['stockid'], @@ -2109,7 +2109,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='.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='.locale_number_format($j+8).' type="submit" value="'._('Add to Sale').'" /></td>'; echo '</table>'; } //end of if Frequently Ordered Items > 0 if (isset($msg)){ @@ -2172,9 +2172,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="'.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 '<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>'; $TableHeader = '<tr><th>' . _('Code') . '</th> <th>' . _('Description') . '</th> <th>' . _('Units') . '</th> @@ -2268,15 +2268,15 @@ <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%s" value="0" /></font></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> </tr>', $myrow['stockid'], $myrow['description'], $myrow['units'], - number_format($QOH, $QOHRow['decimalplaces']), - number_format($DemandQty, $QOHRow['decimalplaces']), - number_format($OnOrder, $QOHRow['decimalplaces']), - number_format($Available, $QOHRow['decimalplaces']), + locale_number_format($QOH, $QOHRow['decimalplaces']), + locale_number_format($DemandQty, $QOHRow['decimalplaces']), + locale_number_format($OnOrder, $QOHRow['decimalplaces']), + locale_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>'; @@ -2291,9 +2291,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="'.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 '<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 '</table></form>'; echo $jsCall; Modified: trunk/Credit_Invoice.php =================================================================== --- trunk/Credit_Invoice.php 2011-08-31 10:15:04 UTC (rev 4672) +++ trunk/Credit_Invoice.php 2011-09-02 09:35:59 UTC (rev 4673) @@ -310,7 +310,7 @@ echo '<tr '.$RowStarter.'><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>'; if ($LnItm->Controlled==1){ @@ -323,7 +323,7 @@ } - $DisplayLineTotal = number_format($LineTotal,$_SESSION['CreditItems']->CurrDecimalPlaces); + $DisplayLineTotal = locale_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 = number_format($TaxLineTotal ,$_SESSION['CreditItems']->CurrDecimalPlaces); - $DisplayGrossLineTotal = number_format($LineTotal+ $TaxLineTotal,$_SESSION['CreditItems']->CurrDecimalPlaces); + $DisplayTaxAmount = locale_number_format($TaxLineTotal ,$_SESSION['CreditItems']->CurrDecimalPlaces); + $DisplayGrossLineTotal = locale_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>' . number_format($_SESSION['Old_FreightCost'],$_SESSION['CreditItems']->CurrDecimalPlaces) . '</td> + <td class=number>' . locale_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">' . number_format($FreightTaxTotal,$_SESSION['CreditItems']->CurrDecimalPlaces) . '</td> - <td class="number">' . number_format($FreightTaxTotal+ $_SESSION['CreditItems']->FreightCost,$_SESSION['CreditItems']->CurrDecimalPlaces) . '</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> </tr>'; } $TaxTotal += $FreightTaxTotal; -$DisplayTotal = number_format($_SESSION['CreditItems']->total + $_SESSION['CreditItems']->FreightCost,$_SESSION['CreditItems']->CurrDecimalPlaces); +$DisplayTotal = locale_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>' . 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> + <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> </tr></table>'; } $DefaultDispatchDate = Date($_SESSION['DefaultDateFormat']); Modified: trunk/Currencies.php =================================================================== --- trunk/Currencies.php 2011-08-31 10:15:04 UTC (rev 4672) +++ trunk/Currencies.php 2011-09-02 09:35:59 UTC (rev 4673) @@ -262,8 +262,8 @@ $myrow['country'], $myrow['hundredsname'], $myrow['decimalplaces'], - number_format($myrow['rate'],5), - number_format(GetCurrencyRate($myrow['currabrev'],$CurrencyRatesArray),5), + locale_number_format($myrow['rate'],5), + locale_number_format(GetCurrencyRate($myrow['currabrev'],$CurrencyRatesArray),5), $_SERVER['PHP_SELF'] . '?', $myrow['currabrev'], _('Edit'), Modified: trunk/CustWhereAlloc.php =================================================================== --- trunk/CustWhereAlloc.php 2011-08-31 10:15:04 UTC (rev 4672) +++ trunk/CustWhereAlloc.php 2011-09-02 09:35:59 UTC (rev 4673) @@ -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').': '. 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').': '. locale_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>' . number_format($myrow['totalamt'],$_SESSION['CompanyRecord']['decimalplaces']) . '</td> - <td class=number>' . number_format($myrow['amt'],$_SESSION['CompanyRecord']['decimalplaces']) . '</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> </tr>'; $RowCounter++; @@ -135,7 +135,7 @@ } //end of while loop echo '<tr><td colspan = 5 class=number>'._('Total allocated').'</td> - <td class=number>' . number_format($AllocsTotal,2) . '</td></tr>'; + <td class=number>' . locale_number_format($AllocsTotal,2) . '</td></tr>'; echo '</table>'; } } Modified: trunk/CustomerAllocations.php =================================================================== --- trunk/CustomerAllocations.php 2011-08-31 10:15:04 UTC (rev 4672) +++ trunk/CustomerAllocations.php 2011-09-02 09:35:59 UTC (rev 4673) @@ -347,7 +347,7 @@ if ($_SESSION['Alloc']->TransExRate != 1) { echo '<br />' . _('Amount in customer currency') . ' <b>' . - number_format(-$_SESSION['Alloc']->TransAmt,2) . + locale_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>' . number_format($AllocnItem->TransAmount,2) . '</td> - <td class=number>' . number_format($YetToAlloc,2) . '</td>'; + <td class=number>' . locale_number_format($AllocnItem->TransAmount,2) . '</td> + <td class=number>' . locale_number_format($YetToAlloc,2) . '</td>'; $j++; if ($AllocnItem->TransAmount < 0) { $balance+=$YetToAlloc; - echo '<td>' . $curTrans .'</td><td class="number">' . number_format($balance,2) . '</td></tr>'; + echo '<td>' . $curTrans .'</td><td class="number">' . locale_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">' . number_format($balance,2) . '</td></tr>'; + <td class="number">' . locale_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>' . number_format($TotalAllocated,2) . '</u></b></td>'; + <td class=number><b><u>' . locale_number_format($TotalAllocated,2) . '</u></b></td>'; $j++; ec... [truncated message content] |
From: <dai...@us...> - 2011-09-02 10:39:00
|
Revision: 4674 http://web-erp.svn.sourceforge.net/web-erp/?rev=4674&view=rev Author: daintree Date: 2011-09-02 10:38:54 +0000 (Fri, 02 Sep 2011) Log Message: ----------- Modified Paths: -------------- trunk/Logout.php trunk/SelectOrderItems.php trunk/includes/LanguageSetup.php trunk/includes/MiscFunctions.php trunk/includes/session.inc Modified: trunk/Logout.php =================================================================== --- trunk/Logout.php 2011-09-02 09:35:59 UTC (rev 4673) +++ trunk/Logout.php 2011-09-02 10:38:54 UTC (rev 4674) @@ -1,7 +1,7 @@ <?php -/* $Revision: 1.17 $ */ + /* $Id$*/ -//$PageSecurity =1; + $AllowAnyone=True; /* Allow all users to log off */ include('includes/session.inc'); Modified: trunk/SelectOrderItems.php =================================================================== --- trunk/SelectOrderItems.php 2011-09-02 09:35:59 UTC (rev 4673) +++ trunk/SelectOrderItems.php 2011-09-02 10:38:54 UTC (rev 4674) @@ -859,7 +859,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'); @@ -1147,7 +1147,7 @@ if ($_SESSION['CheckCreditLimits'] > 0 AND $AlreadyWarnedAboutCredit==false){ /*Check credit limits is 1 for warn breach their credit limit and 2 for prohibit sales */ - $DifferenceInOrderValue = ($Quantity*$Price*(1-$DiscountPercentage/100)) - ($OrderLine->Quantity*$OrderLine->Price*(1-$OrderLine->DiscountPercentage)); + $DifferenceInOrderValue = ($Quantity*$Price*(1-$DiscountPercentage/100)) - ($OrderLine->Quantity*$OrderLine->Price*(1-$OrderLine->DiscountPercent)); $_SESSION['Items'.$identifier]->CreditAvailable -= $DifferenceInOrderValue; @@ -1610,7 +1610,7 @@ <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'.$myrow['stockid'].'" value=0> + <td><font size=1><input class="number" tabindex='. number_format($j+7).' type="textbox" size=6 name="itm'.$myrow['stockid'].'" value=0> </td> </tr>', $myrow['stockid'], @@ -1627,7 +1627,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='.locale_number_format($j+8).' type="submit" value="'._('Add to Sales Order').'"></td>'; + 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 '</table>'; } //end of if Frequently Ordered Items > 0 echo '<p><div class="centre"><b><p>' . $msg . '</b></p>'; @@ -1692,9 +1692,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='.locale_number_format($Offset-1).'><input tabindex='.locale_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='.locale_number_format($j+9).' type="submit" value="'._('Add to Sales Order').'"></td>'; - echo '<td colspan=><input type="hidden" name="nextlist" value='.locale_number_format($Offset+1).'><input tabindex='.locale_number_format($j+10).' type="submit" name="Next" value="'._('Next').'"></td></tr>'; + 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>'; $TableHeader = '<tr> <th>' . _('Code') . '</th> <th>' . _('Description') . '</th> @@ -1793,7 +1793,7 @@ <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'.$myrow['stockid'].'" value=0> + <td><font size=1><input class="number" tabindex='.number_format($j+7).' type="textbox" size=6 name="itm'.$myrow['stockid'].'" value=0> </td> </tr>', $myrow['stockid'], @@ -1810,9 +1810,9 @@ #end of page full new headings if } #end of while loop - 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="order_items" value=1><input tabindex='.locale_number_format($j+8).' type="submit" value="'._('Add to Sales Order').'"></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="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 '</table></form>'; echo $jsCall; Modified: trunk/includes/LanguageSetup.php =================================================================== --- trunk/includes/LanguageSetup.php 2011-09-02 09:35:59 UTC (rev 4673) +++ trunk/includes/LanguageSetup.php 2011-09-02 10:38:54 UTC (rev 4674) @@ -46,7 +46,6 @@ bindtextdomain ('messages', $PathPrefix . 'locale'); textdomain ('messages'); bind_textdomain_codeset('messages', 'UTF-8'); - $locale_info = localeconv(); } else { /* @@ -84,10 +83,5 @@ } } -if (!function_exists('locale_number_format')){ - function locale_number_format($Number, $DecimalPlaces) { - $LocaleInfo = localeconv(); - return locale_number_format($Number, $DecimalPlaces, $LocaleInfo['decimal_point'], $LocaleInfo['thousands_sep']); - } -} + ?> \ No newline at end of file Modified: trunk/includes/MiscFunctions.php =================================================================== --- trunk/includes/MiscFunctions.php 2011-09-02 09:35:59 UTC (rev 4673) +++ trunk/includes/MiscFunctions.php 2011-09-02 10:38:54 UTC (rev 4674) @@ -304,7 +304,7 @@ } function http_file_exists($url) { - $f=@fopen($url,"r"); + $f=@fopen($url,'r'); if($f) { fclose($f); return true; @@ -312,4 +312,9 @@ return false; } +function locale_number_format($Number, $DecimalPlaces) { + $LocaleInfo = localeconv(); + return number_format($Number, $DecimalPlaces, $LocaleInfo['decimal_point'], $LocaleInfo['thousands_sep']); +} + ?> Modified: trunk/includes/session.inc =================================================================== --- trunk/includes/session.inc 2011-09-02 09:35:59 UTC (rev 4673) +++ trunk/includes/session.inc 2011-09-02 10:38:54 UTC (rev 4674) @@ -89,7 +89,6 @@ $theme = (isset($_SESSION['Theme'])) ? $_SESSION['Theme'] : 'silverwolf'; switch ($rc) { case UL_OK; - include($PathPrefix . 'includes/LanguageSetup.php'); break; case UL_SHOWLOGIN: This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <dai...@us...> - 2011-09-02 10:39:00
|
Revision: 4674 http://web-erp.svn.sourceforge.net/web-erp/?rev=4674&view=rev Author: daintree Date: 2011-09-02 10:38:54 +0000 (Fri, 02 Sep 2011) Log Message: ----------- Modified Paths: -------------- trunk/Logout.php trunk/SelectOrderItems.php trunk/includes/LanguageSetup.php trunk/includes/MiscFunctions.php trunk/includes/session.inc Modified: trunk/Logout.php =================================================================== --- trunk/Logout.php 2011-09-02 09:35:59 UTC (rev 4673) +++ trunk/Logout.php 2011-09-02 10:38:54 UTC (rev 4674) @@ -1,7 +1,7 @@ <?php -/* $Revision: 1.17 $ */ + /* $Id$*/ -//$PageSecurity =1; + $AllowAnyone=True; /* Allow all users to log off */ include('includes/session.inc'); Modified: trunk/SelectOrderItems.php =================================================================== --- trunk/SelectOrderItems.php 2011-09-02 09:35:59 UTC (rev 4673) +++ trunk/SelectOrderItems.php 2011-09-02 10:38:54 UTC (rev 4674) @@ -859,7 +859,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'); @@ -1147,7 +1147,7 @@ if ($_SESSION['CheckCreditLimits'] > 0 AND $AlreadyWarnedAboutCredit==false){ /*Check credit limits is 1 for warn breach their credit limit and 2 for prohibit sales */ - $DifferenceInOrderValue = ($Quantity*$Price*(1-$DiscountPercentage/100)) - ($OrderLine->Quantity*$OrderLine->Price*(1-$OrderLine->DiscountPercentage)); + $DifferenceInOrderValue = ($Quantity*$Price*(1-$DiscountPercentage/100)) - ($OrderLine->Quantity*$OrderLine->Price*(1-$OrderLine->DiscountPercent)); $_SESSION['Items'.$identifier]->CreditAvailable -= $DifferenceInOrderValue; @@ -1610,7 +1610,7 @@ <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'.$myrow['stockid'].'" value=0> + <td><font size=1><input class="number" tabindex='. number_format($j+7).' type="textbox" size=6 name="itm'.$myrow['stockid'].'" value=0> </td> </tr>', $myrow['stockid'], @@ -1627,7 +1627,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='.locale_number_format($j+8).' type="submit" value="'._('Add to Sales Order').'"></td>'; + 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 '</table>'; } //end of if Frequently Ordered Items > 0 echo '<p><div class="centre"><b><p>' . $msg . '</b></p>'; @@ -1692,9 +1692,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='.locale_number_format($Offset-1).'><input tabindex='.locale_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='.locale_number_format($j+9).' type="submit" value="'._('Add to Sales Order').'"></td>'; - echo '<td colspan=><input type="hidden" name="nextlist" value='.locale_number_format($Offset+1).'><input tabindex='.locale_number_format($j+10).' type="submit" name="Next" value="'._('Next').'"></td></tr>'; + 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>'; $TableHeader = '<tr> <th>' . _('Code') . '</th> <th>' . _('Description') . '</th> @@ -1793,7 +1793,7 @@ <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'.$myrow['stockid'].'" value=0> + <td><font size=1><input class="number" tabindex='.number_format($j+7).' type="textbox" size=6 name="itm'.$myrow['stockid'].'" value=0> </td> </tr>', $myrow['stockid'], @@ -1810,9 +1810,9 @@ #end of page full new headings if } #end of while loop - 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="order_items" value=1><input tabindex='.locale_number_format($j+8).' type="submit" value="'._('Add to Sales Order').'"></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="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 '</table></form>'; echo $jsCall; Modified: trunk/includes/LanguageSetup.php =================================================================== --- trunk/includes/LanguageSetup.php 2011-09-02 09:35:59 UTC (rev 4673) +++ trunk/includes/LanguageSetup.php 2011-09-02 10:38:54 UTC (rev 4674) @@ -46,7 +46,6 @@ bindtextdomain ('messages', $PathPrefix . 'locale'); textdomain ('messages'); bind_textdomain_codeset('messages', 'UTF-8'); - $locale_info = localeconv(); } else { /* @@ -84,10 +83,5 @@ } } -if (!function_exists('locale_number_format')){ - function locale_number_format($Number, $DecimalPlaces) { - $LocaleInfo = localeconv(); - return locale_number_format($Number, $DecimalPlaces, $LocaleInfo['decimal_point'], $LocaleInfo['thousands_sep']); - } -} + ?> \ No newline at end of file Modified: trunk/includes/MiscFunctions.php =================================================================== --- trunk/includes/MiscFunctions.php 2011-09-02 09:35:59 UTC (rev 4673) +++ trunk/includes/MiscFunctions.php 2011-09-02 10:38:54 UTC (rev 4674) @@ -304,7 +304,7 @@ } function http_file_exists($url) { - $f=@fopen($url,"r"); + $f=@fopen($url,'r'); if($f) { fclose($f); return true; @@ -312,4 +312,9 @@ return false; } +function locale_number_format($Number, $DecimalPlaces) { + $LocaleInfo = localeconv(); + return number_format($Number, $DecimalPlaces, $LocaleInfo['decimal_point'], $LocaleInfo['thousands_sep']); +} + ?> Modified: trunk/includes/session.inc =================================================================== --- trunk/includes/session.inc 2011-09-02 09:35:59 UTC (rev 4673) +++ trunk/includes/session.inc 2011-09-02 10:38:54 UTC (rev 4674) @@ -89,7 +89,6 @@ $theme = (isset($_SESSION['Theme'])) ? $_SESSION['Theme'] : 'silverwolf'; switch ($rc) { case UL_OK; - include($PathPrefix . 'includes/LanguageSetup.php'); break; case UL_SHOWLOGIN: 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. |
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. |