From: <dai...@us...> - 2010-04-18 02:03:07
|
Revision: 3422 http://web-erp.svn.sourceforge.net/web-erp/?rev=3422&view=rev Author: daintree Date: 2010-04-18 02:02:57 +0000 (Sun, 18 Apr 2010) Log Message: ----------- start on making prices effective from and to Modified Paths: -------------- trunk/Prices.php trunk/sql/mysql/upgrade3.11.1-3.12.sql Modified: trunk/Prices.php =================================================================== --- trunk/Prices.php 2010-04-15 20:20:15 UTC (rev 3421) +++ trunk/Prices.php 2010-04-18 02:02:57 UTC (rev 3422) @@ -29,6 +29,10 @@ $_POST['CurrAbrev'] = $_SESSION['CompanyRecord']['currencydefault']; } +if (!isset($_POST['StartDate'])){ + $_POST['StartDate'] = Date($_SESSION['DefaultDateFormat']); +} + echo "<a href='" . $rootpath . '/SelectProduct.php?' . SID . "'>" . _('Back to Items') . '</a><br>'; @@ -70,14 +74,23 @@ $InputError = 1; $msg = _('The price entered must be numeric'); } - + if (! Is_Date($_POST['StartDate'])){ + $InpuitError =1; + $msg = _('The date this price is to take effect from must be entered in the format') . ' ' . $_SESSION['DefaultDateFormat']; + } + if (! Is_Date($_POST['EndDate'])){ + $InpuitError =1; + $msg = _('The date this price is be in effect to must be entered in the format') . ' ' . $_SESSION['DefaultDateFormat']; + } if (isset($_POST['OldTypeAbbrev']) AND isset($_POST['OldCurrAbrev']) AND strlen($Item)>1 AND $InputError !=1) { //editing an existing price $sql = "UPDATE prices SET typeabbrev='" . $_POST['TypeAbbrev'] . "', currabrev='" . $_POST['CurrAbrev'] . "', - price=" . $_POST['Price'] . " + price=" . $_POST['Price'] . ", + startdate='" . FormatDateForSQL($_POST['StartDate']) . "', + enddate='" . FormatDateForSQL($_POST['EndDate']) . "' WHERE prices.stockid='$Item' AND prices.typeabbrev='" . $_POST['OldTypeAbbrev'] . "' AND prices.currabrev='" . $_POST['OldCurrAbrev'] . "' @@ -89,15 +102,19 @@ /*Selected price is null cos no item selected on first time round so must be adding a record must be submitting new entries in the new price form */ $sql = "INSERT INTO prices (stockid, - typeabbrev, - currabrev, - debtorno, - price) - VALUES ('$Item', - '" . $_POST['TypeAbbrev'] . "', - '" . $_POST['CurrAbrev'] . "', - '', - " . $_POST['Price'] . ")"; + typeabbrev, + currabrev, + debtorno, + startdate, + enddate, + price) + VALUES ('$Item', + '" . $_POST['TypeAbbrev'] . "', + '" . $_POST['CurrAbrev'] . "', + '', + '" . FormatDateForSQL($_POST['StartDate']) . "', + '" . FormatDateForSQL($_POST['EndDate']). "', + " . $_POST['Price'] . ")"; $msg = _('The new price has been added') . '.'; } @@ -140,7 +157,9 @@ prices.price, prices.stockid, prices.typeabbrev, - prices.currabrev + prices.currabrev, + prices.startdate, + prices.enddate FROM prices, salestypes, currencies @@ -157,7 +176,8 @@ echo '<tr><th>' . _('Currency') . '</th><th>' . _('Sales Type') . '</th><th>' . _('Price') . - '</th></tr>'; + '</th><th>' . _('Start Date') . ' </th> + <th>' . _('End Date') . '</th></tr>'; $k=0; //row colour counter @@ -174,31 +194,40 @@ if (in_array(5,$_SESSION['AllowedPageSecurityTokens'])) { printf("<td>%s</td> + <td>%s</td> + <td class=number>%0.2f</td> + <td>%s</td> + <td>%s</td> + <td><a href='%s?%s&Item=%s&TypeAbbrev=%s&CurrAbrev=%s&Price=%s&Edit=1'>" . _('Edit') . "</td> + <td><a href='%s?%s&Item=%s&TypeAbbrev=%s&CurrAbrev=%s&delete=yes' onclick=\"return confirm('" . _('Are you sure you wish to delete this price?') . "');\">" . _('Delete') . '</td></tr>', + $myrow['currency'], + $myrow['sales_type'], + $myrow['price'], + ConvertSQLDate($myrow['startdate']), + ConvertSQLDate($myrow['enddate']), + $_SERVER['PHP_SELF'], + SID, + $myrow['stockid'], + $myrow['typeabbrev'], + $myrow['currabrev'], + $myrow['price'], + $_SERVER['PHP_SELF'], + SID, + $myrow['stockid'], + $myrow['typeabbrev'], + $myrow['currabrev']); + } else { + printf("<td>%s</td> <td>%s</td> <td class=number>%0.2f</td> - <td><a href='%s?%s&Item=%s&TypeAbbrev=%s&CurrAbrev=%s&Price=%s&Edit=1'>" . _('Edit') . "</td> - <td><a href='%s?%s&Item=%s&TypeAbbrev=%s&CurrAbrev=%s&delete=yes' onclick=\"return confirm('" . _('Are you sure you wish to delete this price?') . "');\">" . _('Delete') . '</td></tr>', + <td>%s</td> + <td>%s</td> + </tr>", $myrow['currency'], $myrow['sales_type'], $myrow['price'], - $_SERVER['PHP_SELF'], - SID, - $myrow['stockid'], - $myrow['typeabbrev'], - $myrow['currabrev'], - $myrow['price'], - $_SERVER['PHP_SELF'], - SID, - $myrow['stockid'], - $myrow['typeabbrev'], - $myrow['currabrev']); - } else { - printf("<td>%s</td> - <td>%s</td> - <td class=number>%0.2f</td></tr>", - $myrow['currency'], - $myrow['sales_type'], - $myrow['price']); + ConvertSQLDate($myrow['startdate']), + ConvertSQLDate($myrow['enddate'])); } } @@ -248,6 +277,12 @@ } //end while loop DB_free_result($result); + + echo '<tr><td>' . _('Price Effective From Date') . ':</td> + <td><input type=text name="StartDate" value="' . Date($_SESSION['DefaultDateFormat']) . '"></td></tr>'; + echo '<tr><td>' . _('Price Effective To Date') . ':</td> + <td><input type=text name="EndDate" value="' . Date($_SESSION['DefaultDateFormat'],Mktime(0,0,0,12,31,(Date('y')+20))) . '">'; + ?> </select> Modified: trunk/sql/mysql/upgrade3.11.1-3.12.sql =================================================================== --- trunk/sql/mysql/upgrade3.11.1-3.12.sql 2010-04-15 20:20:15 UTC (rev 3421) +++ trunk/sql/mysql/upgrade3.11.1-3.12.sql 2010-04-18 02:02:57 UTC (rev 3422) @@ -131,3 +131,7 @@ ALTER TABLE `reportfields` CHANGE COLUMN `fieldname` `fieldname` VARCHAR(60) NOT NULL DEFAULT ''; INSERT INTO `config` (`confname`, `confvalue`) VALUES ('RequirePickingNote',0); + +ALTER TABLE `prices` ADD `startdate` DATE NOT NULL , ADD `enddate` DATE NOT NULL DEFAULT '9999-12-31' +ALTER TABLE prices DROP PRIMARY KEY , +ADD PRIMARY KEY ( `stockid` , `typeabbrev` , `currabrev` , `debtorno` , `startdate` , `enddate` ) ; This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <tim...@us...> - 2010-04-18 16:39:05
|
Revision: 3423 http://web-erp.svn.sourceforge.net/web-erp/?rev=3423&view=rev Author: tim_schofield Date: 2010-04-18 16:38:59 +0000 (Sun, 18 Apr 2010) Log Message: ----------- Ricard: InventoryPlanning.php - Remove discontinued items from inventory planning reports. Modified Paths: -------------- trunk/InventoryPlanning.php trunk/doc/Change.log.html Modified: trunk/InventoryPlanning.php =================================================================== --- trunk/InventoryPlanning.php 2010-04-18 02:02:57 UTC (rev 3422) +++ trunk/InventoryPlanning.php 2010-04-18 16:38:59 UTC (rev 3423) @@ -61,6 +61,7 @@ stockmaster, stockcategory WHERE locstock.stockid=stockmaster.stockid + AND stockmaster.discontinued = 0 AND stockmaster.categoryid=stockcategory.categoryid AND (stockmaster.mbflag='B' OR stockmaster.mbflag='M') AND stockmaster.categoryid >= '" . $_POST['FromCriteria'] . "' @@ -82,6 +83,7 @@ stockmaster, stockcategory WHERE locstock.stockid=stockmaster.stockid + AND stockmaster.discontinued = 0 AND stockmaster.categoryid >= '" . $_POST['FromCriteria'] . "' AND stockmaster.categoryid=stockcategory.categoryid AND stockmaster.categoryid <= '" . $_POST['ToCriteria'] . "' @@ -176,7 +178,7 @@ if ($debug==1){ echo "<br>$SQL"; } - + include('includes/footer.inc'); exit; } @@ -302,18 +304,18 @@ $LeftOvers = $pdf->addTextWrap(374, $YPos, 40,$FontSize,number_format($SalesRow['prd2'],0),'right'); $LeftOvers = $pdf->addTextWrap(415, $YPos, 40,$FontSize,number_format($SalesRow['prd1'],0),'right'); $LeftOvers = $pdf->addTextWrap(456, $YPos, 40,$FontSize,number_format($SalesRow['prd0'],0),'right'); - + if ($_POST['NumberMonthsHolding']>10){ $NumberMonths=$_POST['NumberMonthsHolding']-10; $MaxMthSales = ($SalesRow['prd1']+$SalesRow['prd2']+$SalesRow['prd3']+$SalesRow['prd4']+$SalesRow['prd5'])/5; } - else{ - $NumberMonths=$_POST['NumberMonthsHolding']; + else{ + $NumberMonths=$_POST['NumberMonthsHolding']; $MaxMthSales = max($SalesRow['prd1'], $SalesRow['prd2'], $SalesRow['prd3'], $SalesRow['prd4'], $SalesRow['prd5']); } - - - + + + $IdealStockHolding = ceil($MaxMthSales * $NumberMonths); $LeftOvers = $pdf->addTextWrap(497, $YPos, 40,$FontSize,number_format($IdealStockHolding,0),'right'); $LeftOvers = $pdf->addTextWrap(597, $YPos, 40,$FontSize,number_format($InventoryPlan['qoh'],0),'right'); @@ -326,7 +328,7 @@ $LeftOvers = $pdf->addTextWrap(720, $YPos, 40,$FontSize,_(' '),'right'); } else { - + $LeftOvers = $pdf->addTextWrap(720, $YPos, 40,$FontSize,number_format($SuggestedTopUpOrder,0),'right'); } @@ -359,8 +361,8 @@ $title=_('Inventory Planning Reporting'); include('includes/header.inc'); - + if (strlen($_POST['FromCriteria'])<1 || strlen($_POST['ToCriteria'])<1) { /*if $FromCriteria is not set then show a form to allow input */ Modified: trunk/doc/Change.log.html =================================================================== --- trunk/doc/Change.log.html 2010-04-18 02:02:57 UTC (rev 3422) +++ trunk/doc/Change.log.html 2010-04-18 16:38:59 UTC (rev 3423) @@ -1,5 +1,6 @@ <p><font SIZE=4 COLOR=BLUE><b>webERP Change Log</b></font></p> <p></p> +<p>18/04/10 Ricard: InventoryPlanning.php - Remove discontinued items from inventory planning reports.</p> <p>15/04/10 Kalmer Piiskop: MiscFunctions.js - Update IsDAte() function for all date formats.</p> <p>15/04/10 Ricard: WWW_Users.php - Correctly show the last visited date.</p> <p>15/04/10 Tim: GLJournal.php - Fix to show the footer on completion of the journal.</p> This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <dai...@us...> - 2010-04-21 08:19:50
|
Revision: 3425 http://web-erp.svn.sourceforge.net/web-erp/?rev=3425&view=rev Author: daintree Date: 2010-04-21 08:19:44 +0000 (Wed, 21 Apr 2010) Log Message: ----------- mods to upgrade script as noted by Ma...@li... Modified Paths: -------------- trunk/doc/Change.log.html trunk/sql/mysql/upgrade3.11.1-3.12.sql Modified: trunk/doc/Change.log.html =================================================================== --- trunk/doc/Change.log.html 2010-04-19 22:36:52 UTC (rev 3424) +++ trunk/doc/Change.log.html 2010-04-21 08:19:44 UTC (rev 3425) @@ -423,7 +423,6 @@ <p>16/09/09 Tim: FixedAssetJournal.php - New script to produce a depreciation journal <p>16/09/09 Tim: FixedAssetItems.php - New script to define individual Fixed Asset items <p>16/09/09 Tim: FixedAssetCategories.php - New script to define categories of Fixed Assets ->>>>>>> .merge-right.r3162 <p>15/09/09 Tim: PrintCustTransPortrait.php - Correct sql to show invoices <p>15/09/09 Tim: StockReOrderLevel.php - Show the correct number of decimal places for stock levels <p>15/09/09 Tim: SelectSalesOrder.php - Bug fixes and layout changes Modified: trunk/sql/mysql/upgrade3.11.1-3.12.sql =================================================================== --- trunk/sql/mysql/upgrade3.11.1-3.12.sql 2010-04-19 22:36:52 UTC (rev 3424) +++ trunk/sql/mysql/upgrade3.11.1-3.12.sql 2010-04-21 08:19:44 UTC (rev 3425) @@ -51,7 +51,7 @@ ALTER TABLE `purchorderauth` ADD COLUMN `offhold` tinyint(1) NOT NULL DEFAULT 0; -UPDATE `www_users` SET `modulesallowed` = '1,1,1,1,1,1,1,1,1,1' +UPDATE `www_users` SET `modulesallowed` = '1,1,1,1,1,1,1,1,1,1'; UPDATE securitytokens SET tokenname = 'Petty Cash' WHERE tokenid = 6; @@ -74,15 +74,15 @@ `description` varchar(50) NOT NULL COMMENT 'text description, e.g. meals, train tickets, fuel, etc', `glaccount` int(11) NOT NULL COMMENT 'GL related account', PRIMARY KEY (`codeexpense`), - KEY `pcexpenses_ibfk_1` (`glaccount`) + KEY (`glaccount`) ) ENGINE=InnoDB DEFAULT CHARSET=utf8; CREATE TABLE IF NOT EXISTS `pctabexpenses` ( `typetabcode` varchar(20) NOT NULL, `codeexpense` varchar(20) NOT NULL, - KEY `pctabexpenses_ibfk_1` (`typetabcode`), - KEY `pctabexpenses_ibfk_2` (`codeexpense`) + KEY (`typetabcode`), + KEY (`codeexpense`) ) ENGINE=InnoDB DEFAULT CHARSET=utf8; CREATE TABLE IF NOT EXISTS `pctabs` ( @@ -95,11 +95,11 @@ `glaccountassignment` int(11) NOT NULL COMMENT 'gl account where the money comes from', `glaccountpcash` int(11) NOT NULL, PRIMARY KEY (`tabcode`), - KEY `pctabs_ibfk_1` (`usercode`), - KEY `pctabs_ibfk_2` (`typetabcode`), - KEY `pctabs_ibfk_3` (`currency`), - KEY `pctabs_ibfk_4` (`authorizer`), - KEY `pctabs_ibfk_5` (`glaccountassignment`) + KEY (`usercode`), + KEY (`typetabcode`), + KEY (`currency`), + KEY (`authorizer`), + KEY (`glaccountassignment`) ) ENGINE=InnoDB DEFAULT CHARSET=utf8; CREATE TABLE IF NOT EXISTS `pctypetabs` ( This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <tim...@us...> - 2010-04-21 19:50:22
|
Revision: 3426 http://web-erp.svn.sourceforge.net/web-erp/?rev=3426&view=rev Author: tim_schofield Date: 2010-04-21 19:50:15 +0000 (Wed, 21 Apr 2010) Log Message: ----------- Fix bug in checking of perishable field. Modified Paths: -------------- trunk/Z_ImportStocks.php trunk/doc/Change.log.html Modified: trunk/Z_ImportStocks.php =================================================================== --- trunk/Z_ImportStocks.php 2010-04-21 08:19:44 UTC (rev 3425) +++ trunk/Z_ImportStocks.php 2010-04-21 19:50:15 UTC (rev 3426) @@ -129,7 +129,7 @@ $InputError = 1; prnMsg(_('The barcode must be 20 characters or less long'),'error'); } - if (!is_numeric($myrow[10]) OR $myrow[10]!=0 OR $myrow[10]!=1) { + if ($myrow[10]!='0' AND $myrow[10]!='1') { $InputError = 1; prnMsg (_('Values in the Perishable field must be either 0 (No) or 1 (Yes)') ,'error'); } Modified: trunk/doc/Change.log.html =================================================================== --- trunk/doc/Change.log.html 2010-04-21 08:19:44 UTC (rev 3425) +++ trunk/doc/Change.log.html 2010-04-21 19:50:15 UTC (rev 3426) @@ -1,5 +1,6 @@ <p><font SIZE=4 COLOR=BLUE><b>webERP Change Log</b></font></p> <p></p> +<p>21/04/10 Matt Taylor: Z_ImportStocks.php : Fix bug in checking of perishable field.</p> <p>18/04/10 Ricard: InventoryPlanning.php - Remove discontinued items from inventory planning reports.</p> <p>15/04/10 Kalmer Piiskop: MiscFunctions.js - Update IsDAte() function for all date formats.</p> <p>15/04/10 Ricard: WWW_Users.php - Correctly show the last visited date.</p> This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <lin...@us...> - 2010-04-22 06:47:14
|
Revision: 3427 http://web-erp.svn.sourceforge.net/web-erp/?rev=3427&view=rev Author: lindsayh Date: 2010-04-22 06:47:07 +0000 (Thu, 22 Apr 2010) Log Message: ----------- Add a missing semi colon from the second last line of the upgrade3.11.1-3.12.sql script. which, surprisingly, fixes a syntax error. Modified Paths: -------------- trunk/doc/Change.log.html trunk/sql/mysql/upgrade3.11.1-3.12.sql Modified: trunk/doc/Change.log.html =================================================================== --- trunk/doc/Change.log.html 2010-04-21 19:50:15 UTC (rev 3426) +++ trunk/doc/Change.log.html 2010-04-22 06:47:07 UTC (rev 3427) @@ -1,5 +1,6 @@ <p><font SIZE=4 COLOR=BLUE><b>webERP Change Log</b></font></p> <p></p> +<p>22/04/10 Lindsay: add missing ; to second last line of upgrade3.11.1-3.12.sql</p> <p>21/04/10 Matt Taylor: Z_ImportStocks.php : Fix bug in checking of perishable field.</p> <p>18/04/10 Ricard: InventoryPlanning.php - Remove discontinued items from inventory planning reports.</p> <p>15/04/10 Kalmer Piiskop: MiscFunctions.js - Update IsDAte() function for all date formats.</p> Modified: trunk/sql/mysql/upgrade3.11.1-3.12.sql =================================================================== --- trunk/sql/mysql/upgrade3.11.1-3.12.sql 2010-04-21 19:50:15 UTC (rev 3426) +++ trunk/sql/mysql/upgrade3.11.1-3.12.sql 2010-04-22 06:47:07 UTC (rev 3427) @@ -132,6 +132,6 @@ INSERT INTO `config` (`confname`, `confvalue`) VALUES ('RequirePickingNote',0); -ALTER TABLE `prices` ADD `startdate` DATE NOT NULL , ADD `enddate` DATE NOT NULL DEFAULT '9999-12-31' +ALTER TABLE `prices` ADD `startdate` DATE NOT NULL , ADD `enddate` DATE NOT NULL DEFAULT '9999-12-31'; ALTER TABLE prices DROP PRIMARY KEY , ADD PRIMARY KEY ( `stockid` , `typeabbrev` , `currabrev` , `debtorno` , `startdate` , `enddate` ) ; This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <tim...@us...> - 2010-04-22 11:18:20
|
Revision: 3428 http://web-erp.svn.sourceforge.net/web-erp/?rev=3428&view=rev Author: tim_schofield Date: 2010-04-22 11:18:12 +0000 (Thu, 22 Apr 2010) Log Message: ----------- Zhiguo - Updates to solve Turkish language problem Modified Paths: -------------- trunk/PDFDIFOT.php trunk/PDFDeliveryDifferences.php trunk/PDFOrdersInvoiced.php trunk/PrintCustStatements.php trunk/doc/Change.log.html trunk/includes/ConnectDB_mysql.inc trunk/includes/ConnectDB_mysqli.inc trunk/includes/class.pdf.php trunk/index.php Modified: trunk/PDFDIFOT.php =================================================================== --- trunk/PDFDIFOT.php 2010-04-22 06:47:07 UTC (rev 3427) +++ trunk/PDFDIFOT.php 2010-04-22 11:18:12 UTC (rev 3428) @@ -24,7 +24,7 @@ $title = _('Delivery In Full On Time (DIFOT) Report'); include ('includes/header.inc'); - echo "<form method='post' action='" . $_SERVER['PHP_SELF'] . '?' . SID . "'>"; + echo "<form method='post' action='" . $_SERVER['PHP_SELF'] . '?' . sid . "'>"; echo '<table><tr><td>' . _('Enter the date from which variances between orders and deliveries are to be listed') . ":</td><td><input type=text class='date' alt='".$_SESSION['DefaultDateFormat']."' name='FromDate' maxlength=10 size=10 VALUE='" . Date($_SESSION['DefaultDateFormat'], Mktime(0,0,0,Date('m')-1,0,Date('y'))) . "'></td></tr>"; echo '<tr><td>' . _('Enter the date to which variances between orders and deliveries are to be listed') . ":</td><td><input type=text class='date' alt='".$_SESSION['DefaultDateFormat']."' name='ToDate' maxlength=10 size=10 VALUE='" . Date($_SESSION['DefaultDateFormat']) . "'></td></tr>"; @@ -177,8 +177,8 @@ /*PDFStarter.php has all the variables for page size and width set up depending on the users default preferences for paper size */ -$pdf->addInfo('Title',_('Dispatches After') . $_POST['DaysAcceptable'] . ' ' . _('Day(s) from Requested Delivery Date')); -$pdf->addInfo('Subject',_('Delivery Dates from') . ' ' . $_POST['FromDate'] . ' ' . _('to') . ' ' . $_POST['ToDate']); +$pdf->addinfo('Title',_('Dispatches After') . $_POST['DaysAcceptable'] . ' ' . _('Day(s) from Requested Delivery Date')); +$pdf->addinfo('Subject',_('Delivery Dates from') . ' ' . $_POST['FromDate'] . ' ' . _('to') . ' ' . $_POST['ToDate']); $line_height=12; $PageNumber = 1; $TotalDiffs = 0; Modified: trunk/PDFDeliveryDifferences.php =================================================================== --- trunk/PDFDeliveryDifferences.php 2010-04-22 06:47:07 UTC (rev 3427) +++ trunk/PDFDeliveryDifferences.php 2010-04-22 11:18:12 UTC (rev 3428) @@ -24,7 +24,7 @@ $title = _('Delivery Differences Report'); include ('includes/header.inc'); - echo "<form method='post' action='" . $_SERVER['PHP_SELF'] . '?' . SID . "'>"; + echo "<form method='post' action='" . $_SERVER['PHP_SELF'] . '?' . sid . "'>"; echo '<table><tr><td>' . _('Enter the date from which variances between orders and deliveries are to be listed') . ":</td><td><input type=text class=date alt='".$_SESSION['DefaultDateFormat']. "' name='FromDate' maxlength=10 size=10 VALUE='" . @@ -171,8 +171,8 @@ /*PDFStarter.php has all the variables for page size and width set up depending on the users default preferences for paper size */ -$pdf->addInfo('Title',_('Variances Between Deliveries and Orders')); -$pdf->addInfo('Subject',_('Variances Between Deliveries and Orders from') . ' ' . $_POST['FromDate'] . ' ' . _('to') . ' ' . $_POST['ToDate']); +$pdf->addinfo('Title',_('Variances Between Deliveries and Orders')); +$pdf->addinfo('Subject',_('Variances Between Deliveries and Orders from') . ' ' . $_POST['FromDate'] . ' ' . _('to') . ' ' . $_POST['ToDate']); $line_height=12; $PageNumber = 1; $TotalDiffs = 0; Modified: trunk/PDFOrdersInvoiced.php =================================================================== --- trunk/PDFOrdersInvoiced.php 2010-04-22 06:47:07 UTC (rev 3427) +++ trunk/PDFOrdersInvoiced.php 2010-04-22 11:18:12 UTC (rev 3428) @@ -10,12 +10,12 @@ $InputError=0; -if (isset($_POST['FromDate']) AND !Is_Date($_POST['FromDate'])){ +if (isset($_POST['FromDate']) AND !is_date($_POST['FromDate'])){ $msg = _('The date from must be specified in the format') . ' ' . $DefaultDateFormat; $InputError=1; unset($_POST['FromDate']); } -if (isset($_POST['ToDate']) AND !Is_Date($_POST['ToDate'])){ +if (isset($_POST['ToDate']) AND !is_date($_POST['ToDate'])){ $msg = _('The date to must be specified in the format') . ' ' . $DefaultDateFormat; $InputError=1; unset($_POST['ToDate']); @@ -33,7 +33,7 @@ prnMsg($msg,'error'); } - echo "<form method='post' action='" . $_SERVER['PHP_SELF'] . '?' . SID . "'>"; + echo "<form method='post' action='" . $_SERVER['PHP_SELF'] . '?' . sid . "'>"; echo '<table><tr><td>' . _('Enter the date from which orders are to be listed') . ":</td><td><input type=text class='date' alt='".$_SESSION['DefaultDateFormat']."' name='FromDate' maxlength=10 size=10 VALUE='" . Date($_SESSION['DefaultDateFormat'], Mktime(0,0,0,Date('m'),Date('d')-1,Date('y'))) . "'></td></tr>"; echo '<tr><td>' . _('Enter the date to which orders are to be listed') . ":</td> <td><input type=text class='date' alt='".$_SESSION['DefaultDateFormat']."' name='ToDate' maxlength=10 size=10 VALUE='" . Date($_SESSION['DefaultDateFormat']) . "'></td></tr>"; @@ -66,8 +66,8 @@ exit; } else { include('includes/PDFStarter.php'); - $pdf->addInfo('Title',_('Orders Invoiced Report')); - $pdf->addInfo('Subject',_('Orders from') . ' ' . $_POST['FromDate'] . ' ' . _('to') . ' ' . $_POST['ToDate']); + $pdf->addinfo('Title',_('Orders Invoiced Report')); + $pdf->addinfo('Subject',_('Orders from') . ' ' . $_POST['FromDate'] . ' ' . _('to') . ' ' . $_POST['ToDate']); $line_height=12; $PageNumber = 1; $TotalDiffs = 0; Modified: trunk/PrintCustStatements.php =================================================================== --- trunk/PrintCustStatements.php 2010-04-22 06:47:07 UTC (rev 3427) +++ trunk/PrintCustStatements.php 2010-04-22 11:18:12 UTC (rev 3428) @@ -46,8 +46,8 @@ $_POST['ToCust'] = strtoupper($_POST['ToCust']); } include('includes/PDFStarter.php'); - $pdf->addInfo('Title', _('Customer Statements') ); - $pdf->addInfo('Subject', _('Statements from') . ' ' . $_POST['FromCust'] . ' ' . _('to') . ' ' . $_POST['ToCust']); + $pdf->addinfo('Title', _('Customer Statements') ); + $pdf->addinfo('Subject', _('Statements from') . ' ' . $_POST['FromCust'] . ' ' . _('to') . ' ' . $_POST['ToCust']); $PageNumber = 1; $line_height=16; @@ -287,7 +287,7 @@ debtortrans.ovdiscount - debtortrans.alloc ELSE 0 END ELSE - CASE WHEN TO_DAYS(Now()) - TO_DAYS(DATE_ADD(DATE_ADD(debtortrans.trandate, " . INTERVAL('1', 'MONTH') . "), " . INTERVAL('(paymentterms.dayinfollowingmonth - DAYOFMONTH(debtortrans.trandate))','DAY') . ")) >= 0 + CASE WHEN TO_DAYS(Now()) - TO_DAYS(DATE_ADD(DATE_ADD(debtortrans.trandate, " . interval('1', 'MONTH') . "), " . interval('(paymentterms.dayinfollowingmonth - DAYOFMONTH(debtortrans.trandate))','DAY') . ")) >= 0 THEN debtortrans.ovamount + debtortrans.ovgst + debtortrans.ovfreight + debtortrans.ovdiscount - debtortrans.alloc ELSE 0 END @@ -300,7 +300,7 @@ debtortrans.ovdiscount - debtortrans.alloc ELSE 0 END ELSE - CASE WHEN (TO_DAYS(Now()) - TO_DAYS(DATE_ADD(DATE_ADD(debtortrans.trandate, " . INTERVAL('1','MONTH') . "), " . INTERVAL('(paymentterms.dayinfollowingmonth - DAYOFMONTH(debtortrans.trandate))','DAY') .")) >= " . $_SESSION['PastDueDays1'] . ") + CASE WHEN (TO_DAYS(Now()) - TO_DAYS(DATE_ADD(DATE_ADD(debtortrans.trandate, " . interval('1','MONTH') . "), " . interval('(paymentterms.dayinfollowingmonth - DAYOFMONTH(debtortrans.trandate))','DAY') .")) >= " . $_SESSION['PastDueDays1'] . ") THEN debtortrans.ovamount + debtortrans.ovgst + debtortrans.ovfreight + debtortrans.ovdiscount - debtortrans.alloc ELSE 0 END @@ -313,8 +313,8 @@ debtortrans.ovdiscount - debtortrans.alloc ELSE 0 END ELSE - CASE WHEN (TO_DAYS(Now()) - TO_DAYS(DATE_ADD(DATE_ADD(debtortrans.trandate, " . INTERVAL('1','MONTH') . "), " . - INTERVAL('(paymentterms.dayinfollowingmonth - DAYOFMONTH(debtortrans.trandate))','DAY') . ")) + CASE WHEN (TO_DAYS(Now()) - TO_DAYS(DATE_ADD(DATE_ADD(debtortrans.trandate, " . interval('1','MONTH') . "), " . + interval('(paymentterms.dayinfollowingmonth - DAYOFMONTH(debtortrans.trandate))','DAY') . ")) >= " . $_SESSION['PastDueDays2'] . ") THEN debtortrans.ovamount + debtortrans.ovgst + debtortrans.ovfreight + debtortrans.ovdiscount - debtortrans.alloc Modified: trunk/doc/Change.log.html =================================================================== --- trunk/doc/Change.log.html 2010-04-22 06:47:07 UTC (rev 3427) +++ trunk/doc/Change.log.html 2010-04-22 11:18:12 UTC (rev 3428) @@ -1,6 +1,15 @@ <p><font SIZE=4 COLOR=BLUE><b>webERP Change Log</b></font></p> <p></p> <p>22/04/10 Lindsay: add missing ; to second last line of upgrade3.11.1-3.12.sql</p> +<p>22/04/10 Zhiguo: index.php - Change SID to sid, so as to solve the locale issue of Turkish I(ı) & İ(i)</p> +<p>22/04/10 Zhiguo: PrintCustStatements.php - Change addInfo() to addinfo() and also change INTERVAL() to interval(), so as to solve the locale issue of Turkish I(ı) & İ(i)</p> +<p>22/04/10 Zhiguo: PDFOrdersInvoiced.php - Change addInfo() to addinfo() and Is_Date() to is_date() also change SID to sid, so as to solve the locale issue of Turkish I(ı) & İ(i)</p> +<p>22/04/10 Zhiguo: PDFDIFOT.php - Change addInfo() to addinfo() and also change SID to sid, so as to solve the locale issue of Turkish I(ı) & İ(i)</p> +<p>22/04/10 Zhiguo: PDFDeliveryDifferences.php - Change addInfo() to addinfo() and also change SID to sid, so as to solve the locale issue of Turkish I(ı) & İ(i)</p> +<p>22/04/10 Zhiguo: ConnectDB_mysql.inc - Change INTERVAL() to interval(), so as to solve the locale issue of Turkish I(ı) & İ(i)</p> +<p>22/04/10 Zhiguo: ConnectDB_mysqli.inc - Change INTERVAL() to interval(), so as to solve the locale issue of Turkish I(ı) & İ(i)</p> +<p>22/04/10 Zhiguo: DateFunctions.inc - Change Is_Date() to is_date(), so as to solve the locale issue of Turkish I(ı) & İ(i)</p> +<p>22/04/10 Zhiguo: class.pdf.php - Change addInfo() to addinfo(), so as to solve the locale issue of Turkish I(ı) & İ(i)</p> <p>21/04/10 Matt Taylor: Z_ImportStocks.php : Fix bug in checking of perishable field.</p> <p>18/04/10 Ricard: InventoryPlanning.php - Remove discontinued items from inventory planning reports.</p> <p>15/04/10 Kalmer Piiskop: MiscFunctions.js - Update IsDAte() function for all date formats.</p> Modified: trunk/includes/ConnectDB_mysql.inc =================================================================== --- trunk/includes/ConnectDB_mysql.inc 2010-04-22 06:47:07 UTC (rev 3427) +++ trunk/includes/ConnectDB_mysql.inc 2010-04-22 11:18:12 UTC (rev 3428) @@ -150,9 +150,9 @@ Return $Result; } -function INTERVAL( $val, $Inter ){ +function interval( $val, $Inter ){ global $dbtype; - return "\n".'INTERVAL ' . $val . ' '. $Inter."\n"; + return "\n".'interval ' . $val . ' '. $Inter."\n"; } function DB_Maintenance($Conn){ Modified: trunk/includes/ConnectDB_mysqli.inc =================================================================== --- trunk/includes/ConnectDB_mysqli.inc 2010-04-22 06:47:07 UTC (rev 3427) +++ trunk/includes/ConnectDB_mysqli.inc 2010-04-22 11:18:12 UTC (rev 3428) @@ -173,9 +173,9 @@ Return $Result; } -function INTERVAL( $val, $Inter ){ +function interval( $val, $Inter ){ global $dbtype; - return "\n".'INTERVAL ' . $val . ' '. $Inter."\n"; + return "\n".'interval ' . $val . ' '. $Inter."\n"; } function DB_Maintenance($Conn){ Modified: trunk/includes/class.pdf.php =================================================================== --- trunk/includes/class.pdf.php 2010-04-22 06:47:07 UTC (rev 3427) +++ trunk/includes/class.pdf.php 2010-04-22 11:18:12 UTC (rev 3428) @@ -76,7 +76,7 @@ $this->Text($xb, $this->h-$yb, $text); } - function addInfo($label, $value) { + function addinfo($label, $value) { if ($label == 'Creator') { /* Javier: Some scripts set the creator to be WebERP like this Modified: trunk/index.php =================================================================== --- trunk/index.php 2010-04-22 06:47:07 UTC (rev 3427) +++ trunk/index.php 2010-04-22 11:18:12 UTC (rev 3428) @@ -31,17 +31,17 @@ <table class="table_index"> <tr> <td class="menu_group_item"> - <?php echo '<p>• <a href="' . $rootpath . '/CustomerInquiry.php?' . SID . '&CustomerID=' . $_SESSION['CustomerID'] . '">' . _('Account Status') . '</a></p>'; ?> + <?php echo '<p>• <a href="' . $rootpath . '/CustomerInquiry.php?' . sid . '&CustomerID=' . $_SESSION['CustomerID'] . '">' . _('Account Status') . '</a></p>'; ?> </td> </tr> <tr> <td class="menu_group_item"> - <?php echo '<p>• <a href="' . $rootpath . '/SelectOrderItems.php?' . SID . '&NewOrder=Yes">' . _('Place An Order') . '</a></p>'; ?> + <?php echo '<p>• <a href="' . $rootpath . '/SelectOrderItems.php?' . sid . '&NewOrder=Yes">' . _('Place An Order') . '</a></p>'; ?> </td> </tr> <tr> <td class="menu_group_item"> - <?php echo '<p>• <a href="' . $rootpath . '/SelectCompletedOrder.php?' . SID . '&SelectedCustomer=' . $_SESSION['CustomerID'] . '">' . _('Order Status') . '</a></p>'; ?> + <?php echo '<p>• <a href="' . $rootpath . '/SelectCompletedOrder.php?' . sid . '&SelectedCustomer=' . $_SESSION['CustomerID'] . '">' . _('Order Status') . '</a></p>'; ?> </td> </tr> </table> @@ -71,9 +71,9 @@ $_SESSION['Module']=$ModuleLink[$i]; } if ($ModuleLink[$i] == $_SESSION['Module']){ - echo '<tr><td class="main_menu_selected"><a href="' . $_SERVER['PHP_SELF'] . '?' . SID . '&Application='. $ModuleLink[$i] . '">' . $ModuleList[$i] . '</a></td></tr>'; + echo '<tr><td class="main_menu_selected"><a href="' . $_SERVER['PHP_SELF'] . '?' . sid . '&Application='. $ModuleLink[$i] . '">' . $ModuleList[$i] . '</a></td></tr>'; } else { - echo '<tr><td class="main_menu_unselected"><a href="' . $_SERVER['PHP_SELF'] . '?' . SID . '&Application='. $ModuleLink[$i] . '">' . $ModuleList[$i] . '</a></td></tr>'; + echo '<tr><td class="main_menu_unselected"><a href="' . $_SERVER['PHP_SELF'] . '?' . sid . '&Application='. $ModuleLink[$i] . '">' . $ModuleList[$i] . '</a></td></tr>'; } } $i++; @@ -104,76 +104,81 @@ <table width="100%" class="table_index"> <tr> <td class="menu_group_item"> - <?php echo '<p>• <a href="' . $rootpath . '/SelectOrderItems.php?' .SID . '&NewOrder=Yes">' . _('Enter An Order or Quotation') . '</a></p>'; ?> + <?php echo '<p>• <a href="' . $rootpath . '/SelectOrderItems.php?' .sid . '&NewOrder=Yes">' . _('Enter An Order or Quotation') . '</a></p>'; ?> </td> </tr> <tr> <td class="menu_group_item"> - <?php echo '<p>• <a href="' . $rootpath . '/SelectSalesOrder.php?' . SID . '">' . _('Outstanding Sales Orders/Quotations') . '</a></p>'; ?> + <?php echo '<p>• <a href="' . $rootpath . '/PDFPickingList.php?' .sid . '&NewOrder=Yes">' . _('Print Picking Lists') . '</a></p>'; ?> </td> </tr> <tr> <td class="menu_group_item"> - <?php echo '<p>• <a href="' . $rootpath . '/SpecialOrder.php?' .SID . '&NewSpecial=Yes">' . _('Special Order') . '</a></p>'; ?> + <?php echo '<p>• <a href="' . $rootpath . '/SelectSalesOrder.php?' . sid . '">' . _('Outstanding Sales Orders/Quotations') . '</a></p>'; ?> </td> </tr> <tr> <td class="menu_group_item"> - <?php echo '<p>• <a href="' . $rootpath . '/SelectRecurringSalesOrder.php?' .SID . '">' . _('Recurring Order Template') . '</a></p>'; ?> + <?php echo '<p>• <a href="' . $rootpath . '/SpecialOrder.php?' .sid . '&NewSpecial=Yes">' . _('Special Order') . '</a></p>'; ?> </td> </tr> <tr> <td class="menu_group_item"> - <?php echo '<p>• <a href="' . $rootpath . '/RecurringSalesOrdersProcess.php?' .SID . '">' . _('Process Recurring Orders') . '</a></p>'; ?> + <?php echo '<p>• <a href="' . $rootpath . '/SelectRecurringSalesOrder.php?' .sid . '">' . _('Recurring Order Template') . '</a></p>'; ?> </td> </tr> + <tr> + <td class="menu_group_item"> + <?php echo '<p>• <a href="' . $rootpath . '/RecurringSalesOrdersProcess.php?' .sid . '">' . _('Process Recurring Orders') . '</a></p>'; ?> + </td> + </tr> </table> </td> <td class="menu_group_items"> <!-- Orders Inquiry options --> <table width="100%" class="table_index"> <tr> <td class="menu_group_item"> - <?php echo '<p>• <a href="' . $rootpath . '/SelectCompletedOrder.php?' . SID . '">' . _('Order Inquiry') . '</a></p>'; ?> + <?php echo '<p>• <a href="' . $rootpath . '/SelectCompletedOrder.php?' . sid . '">' . _('Order Inquiry') . '</a></p>'; ?> </td> </tr> <tr> <td class="menu_group_item"> - <?php echo '<p>• <a href="' . $rootpath . '/PDFPriceList.php?' . SID . '">' . _('Print Price Lists') . '</a></p>'; ?> + <?php echo '<p>• <a href="' . $rootpath . '/PDFPriceList.php?' . sid . '">' . _('Print Price Lists') . '</a></p>'; ?> </td> </tr> <tr> <td class="menu_group_item"> - <?php echo '<p>• <a href="' . $rootpath . '/PDFOrderStatus.php?' . SID . '">' . _('Order Status Report') . '</a></p>'; ?> + <?php echo '<p>• <a href="' . $rootpath . '/PDFOrderStatus.php?' . sid . '">' . _('Order Status Report') . '</a></p>'; ?> </td> </tr> <tr> <td class="menu_group_item"> - <?php echo '<p>• <a href="' . $rootpath . '/PDFOrdersInvoiced.php?' . SID . '">' . _('Orders Invoiced Reports') . '</a></p>'; ?> + <?php echo '<p>• <a href="' . $rootpath . '/PDFOrdersInvoiced.php?' . sid . '">' . _('Orders Invoiced Reports') . '</a></p>'; ?> </td> </tr> <tr> <td class="menu_group_item"> - <?php echo '<p>• <a href="' . $rootpath . '/DailySalesInquiry.php?' . SID . '">' . _('Daily Sales Inquiry') . '</a></p>'; ?> + <?php echo '<p>• <a href="' . $rootpath . '/DailySalesInquiry.php?' . sid . '">' . _('Daily Sales Inquiry') . '</a></p>'; ?> </td> </tr> <tr> <td class="menu_group_item"> - <?php echo '<p>• <a href="' . $rootpath . '/PDFDeliveryDifferences.php?' . SID . '">' . _('Order Delivery Differences Report') . '</a></p>'; ?> + <?php echo '<p>• <a href="' . $rootpath . '/PDFDeliveryDifferences.php?' . sid . '">' . _('Order Delivery Differences Report') . '</a></p>'; ?> </td> </tr> <tr> <td class="menu_group_item"> - <?php echo '<p>• <a href="' . $rootpath . '/PDFDIFOT.php?' . SID . '">' . _('Delivery In Full On Time (DIFOT) Report') . '</a></p>'; ?> + <?php echo '<p>• <a href="' . $rootpath . '/PDFDIFOT.php?' . sid . '">' . _('Delivery In Full On Time (DIFOT) Report') . '</a></p>'; ?> </td> </tr> <tr> <td class="menu_group_item"> - <?php echo '<p>• <a href="' . $rootpath . '/SalesInquiry.php?' . SID . '">' . _('Sales Order Detail Or Summary Inquiries') . '</a></p>'; ?> + <?php echo '<p>• <a href="' . $rootpath . '/SalesInquiry.php?' . sid . '">' . _('Sales Order Detail Or Summary Inquiries') . '</a></p>'; ?> </td> </tr> <tr> <td class="menu_group_item"> - <?php echo '<p>• <a href="' . $rootpath . '/TopItems.php?' . SID . '">' . _('Top Sales Items Report') . '</a></p>'; ?> + <?php echo '<p>• <a href="' . $rootpath . '/TopItems.php?' . sid . '">' . _('Top Sales Items Report') . '</a></p>'; ?> </td> </tr> <tr> @@ -221,23 +226,23 @@ <table width="100%"class="table_index"> <tr> <td class="menu_group_item"> - <?php echo '<p>• <a href="' . $rootpath . '/SelectSalesOrder.php?' . SID . '">' . _('Select Order to Invoice') . '</a></p>'; ?> + <?php echo '<p>• <a href="' . $rootpath . '/SelectSalesOrder.php?' . sid . '">' . _('Select Order to Invoice') . '</a></p>'; ?> </td> </tr> <tr> <td class="menu_group_item"> - <?php echo '<p>• <a href="' . $rootpath . '/SelectCreditItems.php?' .SID . '&NewCredit=Yes">' . _('Create A Credit Note') . '</a></p>'; ?> + <?php echo '<p>• <a href="' . $rootpath . '/SelectCreditItems.php?' .sid . '&NewCredit=Yes">' . _('Create A Credit Note') . '</a></p>'; ?> </td> </tr> <tr> <td class="menu_group_item"> - <?php echo '<p>• <a href="' . $rootpath . '/CustomerReceipt.php?' . SID . '&NewReceipt=Yes">' . _('Enter Receipts') . '</a></p>'; ?> + <?php echo '<p>• <a href="' . $rootpath . '/CustomerReceipt.php?' . sid . '&NewReceipt=Yes">' . _('Enter Receipts') . '</a></p>'; ?> </td> </tr> <tr> <td class="menu_group_item"> - <?php echo '<p>• <a href="' . $rootpath . '/CustomerAllocations.php?' . SID . '">' . _('Allocate Receipts or Credit Notes') . '</a></p>'; ?> + <?php echo '<p>• <a href="' . $rootpath . '/CustomerAllocations.php?' . sid . '">' . _('Allocate Receipts or Credit Notes') . '</a></p>'; ?> </td> </tr> </table> @@ -246,68 +251,68 @@ <table width="100%" class="table_index"> <tr> <td class="menu_group_item"> - <?php echo '<p>• <a href="' . $rootpath . '/SelectCustomer.php?' . SID . '">' . _('Customer Transaction Inquiries') . '</a></p>'; ?> + <?php echo '<p>• <a href="' . $rootpath . '/SelectCustomer.php?' . sid . '">' . _('Customer Transaction Inquiries') . '</a></p>'; ?> </td> </tr> <tr> <td class="menu_group_item"> - <?php echo '<p>• <a href="' . $rootpath . '/CustWhereAlloc.php?' . SID . '">' . _('Where Allocated Inquiry') . '</a></p>'; ?> + <?php echo '<p>• <a href="' . $rootpath . '/CustWhereAlloc.php?' . sid . '">' . _('Where Allocated Inquiry') . '</a></p>'; ?> </td> </tr> <tr> <td class="menu_group_item"> <?php if ($_SESSION['InvoicePortraitFormat']==0){ - echo '<p>• <a href="' . $rootpath . '/PrintCustTrans.php?' . SID . '">' . _('Print Invoices or Credit Notes') . '</a></p>'; + echo '<p>• <a href="' . $rootpath . '/PrintCustTrans.php?' . sid . '">' . _('Print Invoices or Credit Notes') . '</a></p>'; } else { - echo '<p>• <a href="' . $rootpath . '/PrintCustTransPortrait.php?' . SID . '">' . _('Print Invoices or Credit Notes') . '</a></p>'; + echo '<p>• <a href="' . $rootpath . '/PrintCustTransPortrait.php?' . sid . '">' . _('Print Invoices or Credit Notes') . '</a></p>'; } ?> </td> </tr> <tr> <td class="menu_group_item"> - <?php echo '<p>• <a href="' . $rootpath . '/PrintCustStatements.php?' . SID . '">' . _('Print Statements') . '</a></p>'; ?> + <?php echo '<p>• <a href="' . $rootpath . '/PrintCustStatements.php?' . sid . '">' . _('Print Statements') . '</a></p>'; ?> </td> </tr> <tr> <td class="menu_group_item"> - <?php echo '<p>• <a href="' . $rootpath . '/SalesAnalRepts.php?' . SID . '">' . _('Sales Analysis Reports') . '</a></p>'; ?> + <?php echo '<p>• <a href="' . $rootpath . '/SalesAnalRepts.php?' . sid . '">' . _('Sales Analysis Reports') . '</a></p>'; ?> </td> </tr> <tr> <td class="menu_group_item"> - <?php echo '<p>• <a href="' . $rootpath . '/AgedDebtors.php?' . SID . '">' . _('Aged Customer Balances/Overdues Report') . '</a></p>'; ?> + <?php echo '<p>• <a href="' . $rootpath . '/AgedDebtors.php?' . sid . '">' . _('Aged Customer Balances/Overdues Report') . '</a></p>'; ?> </td> </tr> <tr> <td class="menu_group_item"> - <?php echo '<p>• <a href="' . $rootpath . '/CustomerTransInquiry.php?' . SID . '">' . _('Transaction Inquiries') . '</a></p>'; ?> + <?php echo '<p>• <a href="' . $rootpath . '/CustomerTransInquiry.php?' . sid . '">' . _('Transaction Inquiries') . '</a></p>'; ?> </td> </tr> <tr> <td class="menu_group_item"> - <?php echo '<p>• <a href="' . $rootpath . '/PDFBankingSummary.php?' . SID . '">' . _('Re-Print A Deposit Listing') . '</a></p>'; ?> + <?php echo '<p>• <a href="' . $rootpath . '/PDFBankingSummary.php?' . sid . '">' . _('Re-Print A Deposit Listing') . '</a></p>'; ?> </td> </tr> <tr> <td class="menu_group_item"> - <?php echo '<p>• <a href="' . $rootpath . '/DebtorsAtPeriodEnd.php?' . SID . '">' . _('Debtor Balances At A Prior Month End') . '</a></p>'; ?> + <?php echo '<p>• <a href="' . $rootpath . '/DebtorsAtPeriodEnd.php?' . sid . '">' . _('Debtor Balances At A Prior Month End') . '</a></p>'; ?> </td> </tr> <tr> <td class="menu_group_item"> - <?php echo '<p>• <a href="' . $rootpath . '/PDFCustomerList.php?' . SID . '">' . _('Customer Listing By Area/Salesperson') . '</a></p>'; ?> + <?php echo '<p>• <a href="' . $rootpath . '/PDFCustomerList.php?' . sid . '">' . _('Customer Listing By Area/Salesperson') . '</a></p>'; ?> </td> </tr> <tr> <td class="menu_group_item"> - <?php echo '<p>• <a href="' . $rootpath . '/SalesGraph.php?' . SID . '">' . _('Sales Graphs') . '</a></p>'; ?> + <?php echo '<p>• <a href="' . $rootpath . '/SalesGraph.php?' . sid . '">' . _('Sales Graphs') . '</a></p>'; ?> </td> </tr> <tr> <td class="menu_group_item"> - <?php echo '<p>• <a href="' . $rootpath . '/PDFCustTransListing.php?' . SID . '">' . _('List Daily Transactions') . '</a></p>'; ?> + <?php echo '<p>• <a href="' . $rootpath . '/PDFCustTransListing.php?' . sid . '">' . _('List Daily Transactions') . '</a></p>'; ?> </td> </tr> <tr> @@ -321,12 +326,12 @@ <table width="100%" class="table_index"> <tr> <td class="menu_group_item"> - <?php echo '<p>• <a href="' . $rootpath . '/Customers.php?' . SID . '">' . _('Add Customer') . '</a></p>'; ?> + <?php echo '<p>• <a href="' . $rootpath . '/Customers.php?' . sid . '">' . _('Add Customer') . '</a></p>'; ?> </td> </tr> <tr> <td class="menu_group_item"> - <?php echo '<p>• <a href="' . $rootpath . '/SelectCustomer.php?' . SID . '">' . _('Customers') . '</a></p>'; ?> + <?php echo '<p>• <a href="' . $rootpath . '/SelectCustomer.php?' . sid . '">' . _('Customers') . '</a></p>'; ?> </td> </tr> </table> @@ -356,12 +361,12 @@ <table width="100%" class="table_index"> <tr> <td class="menu_group_item"> - <?php echo '<p>• <a href="' . $rootpath . '/SelectSupplier.php?' . SID . '">' . _('Select Supplier') . '</a></p>'; ?> + <?php echo '<p>• <a href="' . $rootpath . '/SelectSupplier.php?' . sid . '">' . _('Select Supplier') . '</a></p>'; ?> </td> </tr> <tr> <td class="menu_group_item"> - <?php echo '<p>• <a href="' . $rootpath . "/SupplierAllocations.php?" . SID . '">' . _('Supplier Allocations') . '</a></p>'; ?> + <?php echo '<p>• <a href="' . $rootpath . "/SupplierAllocations.php?" . sid . '">' . _('Supplier Allocations') . '</a></p>'; ?> </td> </tr> </table> @@ -370,32 +375,32 @@ <table width="100%" class="table_index"> <tr> <td class="menu_group_item"> - <?php echo '<p>• <a href="' . $rootpath . '/AgedSuppliers.php?' . SID . '">' . _('Aged Supplier Report') . '</a></p>'; ?> + <?php echo '<p>• <a href="' . $rootpath . '/AgedSuppliers.php?' . sid . '">' . _('Aged Supplier Report') . '</a></p>'; ?> </td> </tr> <tr> <td class="menu_group_item"> - <?php echo '<p>• <a href="' . $rootpath . '/SuppPaymentRun.php?' . SID . '">' . _('Payment Run Report') . '</a></p>'; ?> + <?php echo '<p>• <a href="' . $rootpath . '/SuppPaymentRun.php?' . sid . '">' . _('Payment Run Report') . '</a></p>'; ?> </td> </tr> <tr> <td class="menu_group_item"> - <?php echo '<p>• <a href="' . $rootpath . '/PDFRemittanceAdvice.php?' . SID . '">' . _('Remittance Advices') . '</a></p>'; ?> + <?php echo '<p>• <a href="' . $rootpath . '/PDFRemittanceAdvice.php?' . sid . '">' . _('Remittance Advices') . '</a></p>'; ?> </td> </tr> <tr> <td class="menu_group_item"> - <?php echo '<p>• <a href="' . $rootpath . '/OutstandingGRNs.php?' . SID . '">' . _('Outstanding GRNs Report') . '</a></p>'; ?> + <?php echo '<p>• <a href="' . $rootpath . '/OutstandingGRNs.php?' . sid . '">' . _('Outstanding GRNs Report') . '</a></p>'; ?> </td> </tr> <tr> <td class="menu_group_item"> - <?php echo '<p>• <a href="' . $rootpath . '/SupplierBalsAtPeriodEnd.php?' . SID . '">' . _('Supplier Balances At A Prior Month End') . '</a></p>'; ?> + <?php echo '<p>• <a href="' . $rootpath . '/SupplierBalsAtPeriodEnd.php?' . sid . '">' . _('Supplier Balances At A Prior Month End') . '</a></p>'; ?> </td> </tr> <tr> <td class="menu_group_item"> - <?php echo '<p>• <a href="' . $rootpath . '/PDFSuppTransListing.php?' . SID . '">' . _('List Daily Transactions') . '</a></p>'; ?> + <?php echo '<p>• <a href="' . $rootpath . '/PDFSuppTransListing.php?' . sid . '">' . _('List Daily Transactions') . '</a></p>'; ?> </td> </tr> <tr> @@ -409,12 +414,12 @@ <table width="100%" class="table_index"> <tr> <td class="menu_group_item"> - <?php echo '<p>• <a href="' . $rootpath . '/Suppliers.php?' . SID . '">' . _('Add Supplier') . '</a></p>'; ?> + <?php echo '<p>• <a href="' . $rootpath . '/Suppliers.php?' . sid . '">' . _('Add Supplier') . '</a></p>'; ?> </td> </tr> <tr> <td class="menu_group_item"> - <?php echo '<p>• <a href="' . $rootpath . '/Factors.php?' . SID . '">' . _('Maintain Factor Companies') . '</a></p>'; ?> + <?php echo '<p>• <a href="' . $rootpath . '/Factors.php?' . sid . '">' . _('Maintain Factor Companies') . '</a></p>'; ?> </td> </tr> </table> @@ -442,27 +447,27 @@ <table width="100%" class="table_index"> <tr> <td class="menu_group_item"> - <?php echo '<p>• <a href="' . $rootpath . '/PO_SelectOSPurchOrder.php?' . SID . '">' . _('Purchase Orders') . '</a></p>'; ?> + <?php echo '<p>• <a href="' . $rootpath . '/PO_SelectOSPurchOrder.php?' . sid . '">' . _('Purchase Orders') . '</a></p>'; ?> </td> </tr> <tr> <td class="menu_group_item"> - <?php echo '<p>• <a href="' . $rootpath . '/PO_Header.php?&NewOrder=Yes' . SID . '">' . _('Add Purchase Order') . '</a></p>'; ?> + <?php echo '<p>• <a href="' . $rootpath . '/PO_Header.php?&NewOrder=Yes' . sid . '">' . _('Add Purchase Order') . '</a></p>'; ?> </td> </tr> <tr> <td class="menu_group_item"> - <?php echo '<p>• <a href="' . $rootpath . '/PO_AuthoriseMyOrders.php?' . SID . '">' . _('Orders to Authorise') . '</a></p>'; ?> + <?php echo '<p>• <a href="' . $rootpath . '/PO_AuthoriseMyOrders.php?' . sid . '">' . _('Orders to Authorise') . '</a></p>'; ?> </td> </tr> <tr> <td class="menu_group_item"> - <?php echo '<p>• <a href="' . $rootpath . '/SelectSupplier.php?' . SID . '">' . _('Shipment Entry') . '</a></p>'; ?> + <?php echo '<p>• <a href="' . $rootpath . '/SelectSupplier.php?' . sid . '">' . _('Shipment Entry') . '</a></p>'; ?> </td> </tr> <tr> <td class="menu_group_item"> - <?php echo '<p>• <a href="' . $rootpath . '/Shipt_Select.php?' . SID . '">' . _('Select A Shipment') . '</a></p>'; ?> + <?php echo '<p>• <a href="' . $rootpath . '/Shipt_Select.php?' . sid . '">' . _('Select A Shipment') . '</a></p>'; ?> </td> </tr> </table> @@ -471,12 +476,12 @@ <table width="100%" class="table_index"> <tr> <td class="menu_group_item"> - <?php echo '<p>• <a href="' . $rootpath . '/PO_SelectPurchOrder.php?' . SID . '">' . _('Purchase Order Inquiry') . '</a></p>'; ?> + <?php echo '<p>• <a href="' . $rootpath . '/PO_SelectPurchOrder.php?' . sid . '">' . _('Purchase Order Inquiry') . '</a></p>'; ?> </td> </tr> <tr> <td class="menu_group_item"> - <?php echo '<p>• <a href="' . $rootpath . '/POReport.php?' . SID . '">' . _('Purchase Order Detail Or Summary Inquiries') . '</a></p>'; ?> + <?php echo '<p>• <a href="' . $rootpath . '/POReport.php?' . sid . '">' . _('Purchase Order Detail Or Summary Inquiries') . '</a></p>'; ?> </td> </tr> <tr> @@ -516,37 +521,37 @@ <table width="100%" class="table_index"> <tr> <td class="menu_group_item"> - <?php echo '<p>• <a href="' . $rootpath . '/PO_SelectOSPurchOrder.php?' . SID . '">' . _('Receive Purchase Orders') . '</a></p>'; ?> + <?php echo '<p>• <a href="' . $rootpath . '/PO_SelectOSPurchOrder.php?' . sid . '">' . _('Receive Purchase Orders') . '</a></p>'; ?> </td> </tr> <tr> <td class="menu_group_item"> - <?php echo '<p>• <a href="' . $rootpath . '/StockLocTransfer.php' . SID . '">' . _('Bulk Inventory Transfer') . ' - ' . _('Dispatch') . '</a></p>'; ?> + <?php echo '<p>• <a href="' . $rootpath . '/StockLocTransfer.php' . sid . '">' . _('Bulk Inventory Transfer') . ' - ' . _('Dispatch') . '</a></p>'; ?> </td> </tr> <tr> <td class="menu_group_item"> - <?php echo '<p>• <a href="' . $rootpath . '/StockLocTransferReceive.php?' . SID . '">' . _('Bulk Inventory Transfer') . ' - ' . _('Receive') . '</a></p>'; ?> + <?php echo '<p>• <a href="' . $rootpath . '/StockLocTransferReceive.php?' . sid . '">' . _('Bulk Inventory Transfer') . ' - ' . _('Receive') . '</a></p>'; ?> </td> </tr> <tr> <td class="menu_group_item"> - <?php echo '<p>• <a href="' . $rootpath . '/StockTransfers.php?' . SID . '">' . _('Inventory Location Transfers') . '</a></p>'; ?> + <?php echo '<p>• <a href="' . $rootpath . '/StockTransfers.php?' . sid . '">' . _('Inventory Location Transfers') . '</a></p>'; ?> </td> </tr> <tr> <td class="menu_group_item"> - <?php echo '<p>• <a href="' . $rootpath . '/StockAdjustments.php?' . SID . '">' . _('Inventory Adjustments') . '</a></p>'; ?> + <?php echo '<p>• <a href="' . $rootpath . '/StockAdjustments.php?' . sid . '">' . _('Inventory Adjustments') . '</a></p>'; ?> </td> </tr> <tr> <td class="menu_group_item"> - <?php echo '<p>• <a href="' . $rootpath . '/ReverseGRN.php?' . SID . '">' . _('Reverse Goods Received') . '</a></p>'; ?> + <?php echo '<p>• <a href="' . $rootpath . '/ReverseGRN.php?' . sid . '">' . _('Reverse Goods Received') . '</a></p>'; ?> </td> </tr> <tr> <td class="menu_group_item"> - <?php echo '<p>• <a href="' . $rootpath . '/StockCounts.php?' . SID . '">' . _('Enter Stock Counts') . '</a></p>'; ?> + <?php echo '<p>• <a href="' . $rootpath . '/StockCounts.php?' . sid . '">' . _('Enter Stock Counts') . '</a></p>'; ?> </td> </tr> </table> @@ -555,87 +560,87 @@ <table width="100%" class="table_index"> <tr> <td class="menu_group_item"> - <?php echo '<p>• <a href="' . $rootpath . "/StockSerialItemResearch.php?" . SID . '">' . _('Serial Item Research Tool') . '</a></p>'; ?> + <?php echo '<p>• <a href="' . $rootpath . "/StockSerialItemResearch.php?" . sid . '">' . _('Serial Item Research Tool') . '</a></p>'; ?> </td> </tr> <tr> <td class="menu_group_item"> - <?php echo '<p>• <a href="' . $rootpath . "/StockMovements.php?" . SID . '">' . _('Inventory Item Movements') . '</a></p>'; ?> + <?php echo '<p>• <a href="' . $rootpath . "/StockMovements.php?" . sid . '">' . _('Inventory Item Movements') . '</a></p>'; ?> </td> </tr> <tr> <td class="menu_group_item"> - <?php echo '<p>• <a href="' . $rootpath . '/StockStatus.php?' . SID . '">' . _('Inventory Item Status') . '</a></p>'; ?> + <?php echo '<p>• <a href="' . $rootpath . '/StockStatus.php?' . sid . '">' . _('Inventory Item Status') . '</a></p>'; ?> </td> </tr> <tr> <td class="menu_group_item"> - <?php echo '<p>• <a href="' . $rootpath . '/StockUsage.php?' . SID . '">' . _('Inventory Item Usage') . '</a></p>'; ?> + <?php echo '<p>• <a href="' . $rootpath . '/StockUsage.php?' . sid . '">' . _('Inventory Item Usage') . '</a></p>'; ?> </td> </tr> <tr> <td class="menu_group_item"> - <?php echo '<p>• <a href="' . $rootpath . '/InventoryQuantities.php?' . SID . '">' . _('Inventory Quantities') . '</a></p>'; ?> + <?php echo '<p>• <a href="' . $rootpath . '/InventoryQuantities.php?' . sid . '">' . _('Inventory Quantities') . '</a></p>'; ?> </td> </tr> <tr> <td class="menu_group_item"> - <?php echo '<p>• <a href="' . $rootpath . '/ReorderLevel.php?' . SID . '">' . _('Reorder Level') . '</a></p>'; ?> + <?php echo '<p>• <a href="' . $rootpath . '/ReorderLevel.php?' . sid . '">' . _('Reorder Level') . '</a></p>'; ?> </td> </tr> <tr> <td class="menu_group_item"> - <?php echo '<p>• <a href="' . $rootpath . '/StockDispatch.php?' . SID . '">' . _('Stock Dispatch') . '</a></p>'; ?> + <?php echo '<p>• <a href="' . $rootpath . '/StockDispatch.php?' . sid . '">' . _('Stock Dispatch') . '</a></p>'; ?> </td> </tr> <tr> <td class="menu_group_item"> - <?php echo '<p>• <a href="' . $rootpath . '/InventoryValuation.php?' . SID . '">' . _('Inventory Valuation Report') . '</a></p>'; ?> + <?php echo '<p>• <a href="' . $rootpath . '/InventoryValuation.php?' . sid . '">' . _('Inventory Valuation Report') . '</a></p>'; ?> </td> </tr> <tr> <td class="menu_group_item"> - <?php echo '<p>• <a href="' . $rootpath . '/InventoryPlanning.php?' . SID . '">' . _('Inventory Planning Report') . '</a></p>'; ?> + <?php echo '<p>• <a href="' . $rootpath . '/InventoryPlanning.php?' . sid . '">' . _('Inventory Planning Report') . '</a></p>'; ?> </td> </tr> <tr> <td class="menu_group_item"> - <?php echo '<p>• <a href="' . $rootpath . '/InventoryPlanningPrefSupplier.php?' . SID . '">' . _('Inventory Planning Based On Preferred Supplier Data') . '</a></p>'; ?> + <?php echo '<p>• <a href="' . $rootpath . '/InventoryPlanningPrefSupplier.php?' . sid . '">' . _('Inventory Planning Based On Preferred Supplier Data') . '</a></p>'; ?> </td> </tr> <tr> <td class="menu_group_item"> - <?php echo '<p>• <a href="' . $rootpath . '/StockCheck.php?' . SID . '">' . _('Inventory Stock Check Sheets') . '</a></p>'; ?> + <?php echo '<p>• <a href="' . $rootpath . '/StockCheck.php?' . sid . '">' . _('Inventory Stock Check Sheets') . '</a></p>'; ?> </td> </tr> <tr> <td class="menu_group_item"> - <?php echo '<p>• <a href="' . $rootpath . '/StockQties_csv.php?' . SID . '">' . _('Make Inventory Quantities CSV') . '</a></p>'; ?> + <?php echo '<p>• <a href="' . $rootpath . '/StockQties_csv.php?' . sid . '">' . _('Make Inventory Quantities CSV') . '</a></p>'; ?> </td> </tr> <tr> <td class="menu_group_item"> - <?php echo '<p>• <a href="' . $rootpath . '/PDFStockCheckComparison.php?' . SID . '">' . _('Compare Counts Vs Stock Check Data') . '</a></p>'; ?> + <?php echo '<p>• <a href="' . $rootpath . '/PDFStockCheckComparison.php?' . sid . '">' . _('Compare Counts Vs Stock Check Data') . '</a></p>'; ?> </td> </tr> <tr> <td class="menu_group_item"> - <?php echo '<p>• <a href="' . $rootpath . '/StockLocMovements.php?' . SID . '">' . _('All Inventory Movements By Location/Date') . '</a></p>'; ?> + <?php echo '<p>• <a href="' . $rootpath . '/StockLocMovements.php?' . sid . '">' . _('All Inventory Movements By Location/Date') . '</a></p>'; ?> </td> </tr> <tr> <td class="menu_group_item"> - <?php echo '<p>• <a href="' . $rootpath . '/StockLocStatus.php?' . SID . '">' . _('List Inventory Status By Location/Category') . '</a></p>'; ?> + <?php echo '<p>• <a href="' . $rootpath . '/StockLocStatus.php?' . sid . '">' . _('List Inventory Status By Location/Category') . '</a></p>'; ?> </td> </tr> <tr> <td class="menu_group_item"> - <?php echo '<p>• <a href="' . $rootpath . '/StockQuantityByDate.php?' . SID . '">' . _('Historical Stock Quantity By Location/Category') . '</a></p>'; ?> + <?php echo '<p>• <a href="' . $rootpath . '/StockQuantityByDate.php?' . sid . '">' . _('Historical Stock Quantity By Location/Category') . '</a></p>'; ?> </td> </tr> <tr> <td class="menu_group_item"> - <?php echo '<p>• <a href="' . $rootpath . '/PDFStockNegatives.php?' . SID . '">' . _('List Negative Stocks') . '</a></p>'; ?> + <?php echo '<p>• <a href="' . $rootpath . '/PDFStockNegatives.php?' . sid . '">' . _('List Negative Stocks') . '</a></p>'; ?> </td> </tr> <tr> @@ -649,32 +654,32 @@ <table width="100%" class="table_index"> <tr> <td class="menu_group_item"> - <?php echo '<p>• <a href="' . $rootpath . '/Stocks.php?' . SID . '">' . _('Add A New Item') . '</a></p>'; ?> + <?php echo '<p>• <a href="' . $rootpath . '/Stocks.php?' . sid . '">' . _('Add A New Item') . '</a></p>'; ?> </td> </tr> <tr> <td class="menu_group_item"> - <?php echo '<p>• <a href="' . $rootpath . '/SelectProduct.php?' . SID . '">' . _('Select An Item') . '</a></p>'; ?> + <?php echo '<p>• <a href="' . $rootpath . '/SelectProduct.php?' . sid . '">' . _('Select An Item') . '</a></p>'; ?> </td> </tr> <tr> <td class="menu_group_item"> - <?php echo '<p>• <a href="' . $rootpath . '/SalesCategories.php?' . SID . '">' . _('Sales Category Maintenance') . '</a></p>'; ?> + <?php echo '<p>• <a href="' . $rootpath . '/SalesCategories.php?' . sid . '">' . _('Sales Category Maintenance') . '</a></p>'; ?> </td> </tr> <tr> <td class="menu_group_item"> - <?php echo '<p>• <a href="' . $rootpath . '/PricesBasedOnMarkUp.php?' . SID . '">' . _('Add or Update Prices Based On Costs') . '</a></p>'; ?> + <?php echo '<p>• <a href="' . $rootpath . '/PricesBasedOnMarkUp.php?' . sid . '">' . _('Add or Update Prices Based On Costs') . '</a></p>'; ?> </td> </tr> <tr> <td class="menu_group_item"> - <?php echo '<p>• <a href="' . $rootpath . '/PricesByCost.php?' . SID . '">' . _('View or Update Prices Based On Costs') . '</a></p>'; ?> + <?php echo '<p>• <a href="' . $rootpath . '/PricesByCost.php?' . sid . '">' . _('View or Update Prices Based On Costs') . '</a></p>'; ?> </td> </tr> <tr> <td class="menu_group_item"> - <?php echo '<p>• <a href="' . $rootpath . '/ReorderLevelLocation.php?' . SID . '">' . _('Reorder Level By Category/Location') . '</a></p>'; ?> + <?php echo '<p>• <a href="' . $rootpath . '/ReorderLevelLocation.php?' . sid . '">' . _('Reorder Level By Category/Location') . '</a></p>'; ?> </td> </tr> </table> @@ -704,12 +709,12 @@ <table width="100%" class="table_index"> <tr> <td class="menu_group_item"> - <?php echo '<p>• <a href="' . $rootpath . '/WorkOrderEntry.php?' . SID . '">' . _('Work Order Entry') . '</a></p>'; ?> + <?php echo '<p>• <a href="' . $rootpath . '/WorkOrderEntry.php?' . sid . '">' . _('Work Order Entry') . '</a></p>'; ?> </td> </tr> <tr> <td class="menu_group_item"> - <?php echo '<p>• <a href="' . $rootpath . '/SelectWorkOrder.php?' . SID . '">' . _('Select A Work Order') . '</a></p>'; ?> + <?php echo '<p>• <a href="' . $rootpath . '/SelectWorkOrder.php?' . sid . '">' . _('Select A Work Order') . '</a></p>'; ?> </td> </tr> </table> @@ -718,57 +723,57 @@ <table width="100%" class="table_index"> <tr> <td class="menu_group_item"> - <?php echo '<p>• <a href="' . $rootpath . '/SelectWorkOrder.php?' . SID . '">' . _('Select A Work Order') . '</a></p>'; ?> + <?php echo '<p>• <a href="' . $rootpath . '/SelectWorkOrder.php?' . sid . '">' . _('Select A Work Order') . '</a></p>'; ?> </td> </tr> <tr> <td class="menu_group_item"> - <?php echo '<p>• <a href="' . $rootpath . '/BOMInquiry.php?' . SID . '">' . _('Costed Bill Of Material Inquiry') . '</a></p>'; ?> + <?php echo '<p>• <a href="' . $rootpath . '/BOMInquiry.php?' . sid . '">' . _('Costed Bill Of Material Inquiry') . '</a></p>'; ?> </td> </tr> <tr> <td class="menu_group_item"> - <?php echo '<p>• <a href="' . $rootpath . '/WhereUsedInquiry.php?' . SID . '">' . _('Where Used Inquiry') . '</a></p>'; ?> + <?php echo '<p>• <a href="' . $rootpath . '/WhereUsedInquiry.php?' . sid . '">' . _('Where Used Inquiry') . '</a></p>'; ?> </td> </tr> <tr> <td class="menu_group_item"> - <?php echo '<p>• <a href="' . $rootpath . '/BOMIndented.php?' . SID . '">' . _('Indented Bill Of Material Listing') . '</a></p>'; ?> + <?php echo '<p>• <a href="' . $rootpath . '/BOMIndented.php?' . sid . '">' . _('Indented Bill Of Material Listing') . '</a></p>'; ?> </td> </tr> <tr> <td class="menu_group_item"> - <?php echo '<p>• <a href="' . $rootpath . '/BOMExtendedQty.php?' . SID . '">' . _('List Components Required') . '</a></p>'; ?> + <?php echo '<p>• <a href="' . $rootpath . '/BOMExtendedQty.php?' . sid . '">' . _('List Components Required') . '</a></p>'; ?> </td> </tr> <tr> <td class="menu_group_item"> - <?php echo '<p>• <a href="' . $rootpath . '/BOMIndentedReverse.php?' . SID . '">' . _('Indented Where Used Listing') . '</a></p>'; ?> + <?php echo '<p>• <a href="' . $rootpath . '/BOMIndentedReverse.php?' . sid . '">' . _('Indented Where Used Listing') . '</a></p>'; ?> </td> </tr> <tr> <td class="menu_group_item"> - <?php echo '<p>• <a href="' . $rootpath . '/MRPReport.php?' . SID . '">' . _('MRP') . '</a></p>'; ?> + <?php echo '<p>• <a href="' . $rootpath . '/MRPReport.php?' . sid . '">' . _('MRP') . '</a></p>'; ?> </td> </tr> <tr> <td class="menu_group_item"> - <?php echo '<p>• <a href="' . $rootpath . '/MRPShortages.php?' . SID . '">' . _('MRP Shortages') . '</a></p>'; ?> + <?php echo '<p>• <a href="' . $rootpath . '/MRPShortages.php?' . sid . '">' . _('MRP Shortages') . '</a></p>'; ?> </td> </tr> <tr> <td class="menu_group_item"> - <?php echo '<p>• <a href="' . $rootpath . '/MRPPlannedPurchaseOrders.php?' . SID . '">' . _('MRP Suggested Purchase Orders') . '</a></p>'; ?> + <?php echo '<p>• <a href="' . $rootpath . '/MRPPlannedPurchaseOrders.php?' . sid . '">' . _('MRP Suggested Purchase Orders') . '</a></p>'; ?> </td> </tr> <tr> <td class="menu_group_item"> - <?php echo '<p>• <a href="' . $rootpath . '/MRPPlannedWorkOrders.php?' . SID . '">' . _('MRP Suggested Work Orders') . '</a></p>'; ?> + <?php echo '<p>• <a href="' . $rootpath . '/MRPPlannedWorkOrders.php?' . sid . '">' . _('MRP Suggested Work Orders') . '</a></p>'; ?> </td> </tr> <tr> <td class="menu_group_item"> - <?php echo '<p>• <a href="' . $rootpath . '/MRPReschedules.php?' . SID . '">' . _('MRP Reschedules Required') . '</a></p>'; ?> + <?php echo '<p>• <a href="' . $rootpath . '/MRPReschedules.php?' . sid . '">' . _('MRP Reschedules Required') . '</a></p>'; ?> </td> </tr> <tr> @@ -782,28 +787,28 @@ <table width="100%" class="table_index"> <tr> <td class="menu_group_item"> - <?php echo '<p>• <a href="' . $rootpath . '/WorkCentres.php?' . SID . '">' . _('Work Centre') . '</a></p>'; ?> + <?php echo '<p>• <a href="' . $rootpath . '/WorkCentres.php?' . sid . '">' . _('Work Centre') . '</a></p>'; ?> </td> </tr> <tr> <td class="menu_group_item"> - <?php echo '<p>• <a href="' . $rootpath . '/BOMs.php?' . SID . '">' . _('Bills Of Material') . '</a></p>'; ?> + <?php echo '<p>• <a href="' . $rootpath . '/BOMs.php?' . sid . '">' . _('Bills Of Material') . '</a></p>'; ?> </td> </tr> <tr> <td class="menu_group_item"> - <?php echo '<p>• <a href="' . $rootpath . '/MRPDemands.php?' . SID . '">' . _('Master Schedule') . '</a></p>'; ?> + <?php echo '<p>• <a href="' . $rootpath . '/MRPDemands.php?' . sid . '">' . _('Master Schedule') . '</a></p>'; ?> </td> </tr> <tr> <td class="menu_group_item"> - <?php echo '<p>• <a href="' . $rootpath . '/MRPCreateDemands.php?' . SID . '">' . _('Auto Create Master Schedule') . '</a></p>'; ?> + <?php echo '<p>• <a href="' . $rootpath . '/MRPCreateDemands.php?' . sid . '">' . _('Auto Create Master Schedule') . '</a></p>'; ?> </td> </tr> <tr> <td class="menu_group_item"> - <?php echo '<p>• <a href="' . $rootpath . '/MRP.php?' . SID . '">' . _('MRP Calculation') . '</a></p>'; ?> + <?php echo '<p>• <a href="' . $rootpath . '/MRP.php?' . sid . '">' . _('MRP Calculation') . '</a></p>'; ?> </td> </tr> @@ -873,57 +878,57 @@ <table width="100%" class="table_index"> <tr> <td class="menu_group_item"> - <?php echo '<p>• <a href="' . $rootpath . '/CompanyPreferences.php?' . SID . '">' . _('Company Preferences') . '</a></p>'; ?> + <?php echo '<p>• <a href="' . $rootpath . '/CompanyPreferences.php?' . sid . '">' . _('Company Preferences') . '</a></p>'; ?> </td> </tr> <tr> <td class="menu_group_item"> - <?php echo '<p>• <a href="' . $rootpath . '/SystemParameters.php?' . SID . '">' . _('Configuration Settings') . '</a></p>'; ?> + <?php echo '<p>• <a href="' . $rootpath . '/SystemParameters.php?' . sid . '">' . _('Configuration Settings') . '</a></p>'; ?> </td> </tr> <tr> <td class="menu_group_item"> - <?php echo '<p>• <a href="' . $rootpath . '/WWW_Users.php?' . SID . '">' . _('User Maintenance') . '</a></p>'; ?> + <?php echo '<p>• <a href="' . $rootpath . '/WWW_Users.php?' . sid . '">' . _('User Maintenance') . '</a></p>'; ?> </td> </tr> <tr> <td class="menu_group_item"> - <?php echo '<p>• <a href="' . $rootpath . '/WWW_Access.php?' . SID . '">' . _('Role Permissions') . '</a></p>'; ?> + <?php echo '<p>• <a href="' . $rootpath . '/WWW_Access.php?' . sid . '">' . _('Role Permissions') . '</a></p>'; ?> </td> </tr> <tr> <td class="menu_group_item"> - <?php echo '<p>• <a href="' . $rootpath . '/BankAccounts.php?' . SID . '">' . _('Bank Accounts') . '</a></p>'; ?> + <?php echo '<p>• <a href="' . $rootpath . '/BankAccounts.php?' . sid . '">' . _('Bank Accounts') . '</a></p>'; ?> </td> </tr> <tr> <td class="menu_group_item"> - <?php echo '<p>• <a href="' . $rootpath . '/Currencies.php?' . SID . '">' . _('Currency Maintenance') . '</a></p>'; ?> + <?php echo '<p>• <a href="' . $rootpath . '/Currencies.php?' . sid . '">' . _('Currency Maintenance') . '</a></p>'; ?> </td> </tr> <tr> <td class="menu_group_item"> - <?php echo '<p>• <a href="' . $rootpath . '/TaxAuthorities.php?' . SID . '">' . _('Tax Authorities and Rates Maintenance') . '</a></p>'; ?> + <?php echo '<p>• <a href="' . $rootpath . '/TaxAuthorities.php?' . sid . '">' . _('Tax Authorities and Rates Maintenance') . '</a></p>'; ?> </td> </tr> <tr> <td class="menu_group_item"> - <?php echo '<p>• <a href="' . $rootpath . '/TaxGroups.php?' . SID . '">' . _('Tax Group Maintenance') . '</a></p>'; ?> + <?php echo '<p>• <a href="' . $rootpath . '/TaxGroups.php?' . sid . '">' . _('Tax Group Maintenance') . '</a></p>'; ?> </td> </tr> <tr> <td class="menu_group_item"> - <?php echo '<p>• <a href="' . $rootpath . '/TaxProvinces.php?' . SID . '">' . _('Dispatch Tax Province Maintenance') . '</a></p>'; ?> + <?php echo '<p>• <a href="' . $rootpath . '/TaxProvinces.php?' . sid . '">' . _('Dispatch Tax Province Maintenance') . '</a></p>'; ?> </td> </tr> <tr> <td class="menu_group_item"> - <?php echo '<p>• <a href="' . $rootpath . '/TaxCategories.php?' . SID . '">' . _('Tax Category Maintenance') . '</a></p>'; ?> + <?php echo '<p>• <a href="' . $rootpath . '/TaxCategories.php?' . sid . '">' . _('Tax Category Maintenance') . '</a></p>'; ?> </td> </tr> <tr> <td class="menu_group_item"> - <?php echo '<p>• <a href="' . $rootpath . '/PeriodsInquiry.php?' . SID . '">' . _('List Periods Defined') . ' <span style="font-size: 9px;">(' . _('Periods are automatically maintained') . ')</span></a></p>'; ?> + <?php echo '<p>• <a href="' . $rootpath . '/PeriodsInquiry.php?' . sid . '">' . _('List Periods Defined') . ' <span style="font-size: 9px;">(' . _('Periods are automatically maintained') . ')</span></a></p>'; ?> </td> </tr> <tr> @@ -958,67 +963,67 @@ <table width="100%" class="table_index"> <tr> <td class="menu_group_item"> - <?php echo '<p>• <a href="' . $rootpath . '/SalesTypes.php?' . SID . '">' . _('Sales Types') . '</a></p>'; ?> + <?php echo '<p>• <a href="' . $rootpath . '/SalesTypes.php?' . sid . '">' . _('Sales Types') . '</a></p>'; ?> </td> </tr> <tr> <td class="menu_group_item"> - <?php echo '<p>• <a href="' . $rootpath . '/CustomerTypes.php?' . SID . '">' . _('Customer Types') . '</a></p>'; ?> + <?php echo '<p>• <a href="' . $rootpath . '/CustomerTypes.php?' . sid . '">' . _('Customer Types') . '</a></p>'; ?> </td> </tr> <tr> <td class="menu_group_item"> - <?php echo '<p>• <a href="' . $rootpath . '/CreditStatus.php?' . SID . '">' . _('Credit Status') . '</a></p>'; ?> + <?php echo '<p>• <a href="' . $rootpath . '/CreditStatus.php?' . sid . '">' . _('Credit Status') . '</a></p>'; ?> </td> </tr> <tr> <td class="menu_group_item"> - <?php echo '<p>• <a href="' . $rootpath . '/PaymentTerms.php?' . SID . '">' . _('Payment Terms') . '</a></p>'; ?> + <?php echo '<p>• <a href="' . $rootpath . '/PaymentTerms.php?' . sid . '">' . _('Payment Terms') . '</a></p>'; ?> </td> </tr> <tr> <td class="menu_group_item"> - <?php echo '<p>• <a href="' . $rootpath . '/PO_AuthorisationLevels.php?' . SID . '">' . _('Set Purchase Order Authorisation levels') . '</a></p>'; ?> + <?php echo '<p>• <a href="' . $rootpath . '/PO_AuthorisationLevels.php?' . sid . '">' . _('Set Purchase Order Authorisation levels') . '</a></p>'; ?> </td> </tr> <tr> <td class="menu_group_item"> - <?php echo '<p>• <a href="' . $rootpath . '/PaymentMethods.php?' . SID . '">' . _('Payment Methods') . '</a></p>'; ?> + <?php echo '<p>• <a href="' . $rootpath . '/PaymentMethods.php?' . sid . '">' . _('Payment Methods') . '</a></p>'; ?> </td> </tr> <tr> <td class="menu_group_item"> - <?php echo '<p>• <a href="' . $rootpath . '/SalesPeople.php?' . SID . '">' . _('Sales People') . '</a></p>'; ?> + <?php echo '<p>• <a href="' . $rootpath . '/SalesPeople.php?' . sid . '">' . _('Sales People') . '</a></p>'; ?> </td> </tr> <tr> <td class="menu_group_item"> - <?php echo '<p>• <a href="' . $rootpath . '/Areas.php?' . SID . '">' . _('Sales Areas') . '</a></p>'; ?> + <?php echo '<p>• <a href="' . $rootpath . '/Areas.php?' . sid . '">' . _('Sales Areas') . '</a></p>'; ?> </td> </tr> <tr> <td class="menu_group_item"> - <?php echo '<p>• <a href="' . $rootpath . '/Shippers.php?' . SID . '">' . _('Shippers') . '</a></p>'; ?> + <?php echo '<p>• <a href="' . $rootpath . '/Shippers.php?' . sid . '">' . _('Shippers') . '</a></p>'; ?> </td> </tr> <tr> <td class="menu_group_item"> - <?php echo '<p>• <a href="' . $rootpath . '/SalesGLPostings.php?' . SID . '">' . _('Sales GL Interface Postings') . '</a></p>'; ?> + <?php echo '<p>• <a href="' . $rootpath . '/SalesGLPostings.php?' . sid . '">' . _('Sales GL Interface Postings') . '</a></p>'; ?> </td> </tr> <tr> <td class="menu_group_item"> - <?php echo '<p>• <a href="' . $rootpath . '/COGSGLPostings.php?' . SID . '">' . _('COGS GL Interface Postings') . '</a></p>'; ?> + <?php echo '<p>• <a href="' . $rootpath . '/COGSGLPostings.php?' . sid . '">' . _('COGS GL Interface Postings') . '</a></p>'; ?> </td> </tr> <tr> <td class="menu_group_item"> - <?php echo '<p>• <a href="' . $rootpath . '/FreightCosts.php?' . SID . '">' . _('Freight Costs Maintenance') . '</a></p>'; ?> + <?php echo '<p>• <a href="' . $rootpath . '/FreightCosts.php?' . sid . '">' . _('Freight Costs Maintenance') . '</a></p>'; ?> </td> </tr> <tr> <td class="menu_group_item"> - <?php echo '<p>• <a href="' . $rootpath . '/DiscountMatrix.php?' . SID . '">' . _('Discount Matrix') . '</a></p>'; ?> + <?php echo '<p>• <a href="' . $rootpath . '/DiscountMatrix.php?' . sid . '">' . _('Discount Matrix') . '</a></p>'; ?> </td> </tr> </table> @@ -1028,34 +103... [truncated message content] |
From: <tim...@us...> - 2010-04-23 07:45:34
|
Revision: 3429 http://web-erp.svn.sourceforge.net/web-erp/?rev=3429&view=rev Author: tim_schofield Date: 2010-04-23 07:45:28 +0000 (Fri, 23 Apr 2010) Log Message: ----------- Zhiguo: SelectProduct.php - Add a link to StockStatus.php direct from the selection page. Modified Paths: -------------- trunk/SelectProduct.php trunk/doc/Change.log.html Modified: trunk/SelectProduct.php =================================================================== --- trunk/SelectProduct.php 2010-04-22 11:18:12 UTC (rev 3428) +++ trunk/SelectProduct.php 2010-04-23 07:45:28 UTC (rev 3429) @@ -668,6 +668,7 @@ <th>' . _('Description') . '</th> <th>' . _('Total Qty On Hand') . '</th> <th>' . _('Units') . '</th> + <th>' . _('Stock Status') . '</th> </tr>'; echo $tableheader; $j = 1; @@ -693,6 +694,7 @@ <td>".$myrow['description']."</td> <td class='number'>".$qoh."</td> <td>".$myrow['units']."</td> + <td><a target='_blank' href='" . $rootpath . "/StockStatus.php?" . SID . "&StockID=".$myrow['stockid']."'>" . _('View') . "</a></td> </tr>"; $j++; if ($j == 20 AND ($RowIndex + 1 != $_SESSION['DisplayRecordsMax'])) { Modified: trunk/doc/Change.log.html =================================================================== --- trunk/doc/Change.log.html 2010-04-22 11:18:12 UTC (rev 3428) +++ trunk/doc/Change.log.html 2010-04-23 07:45:28 UTC (rev 3429) @@ -1,5 +1,6 @@ <p><font SIZE=4 COLOR=BLUE><b>webERP Change Log</b></font></p> <p></p> +<p>22/04/10 Zhiguo: SelectProduct.php - Add a link to StockStatus.php direct from the selection page.</p> <p>22/04/10 Lindsay: add missing ; to second last line of upgrade3.11.1-3.12.sql</p> <p>22/04/10 Zhiguo: index.php - Change SID to sid, so as to solve the locale issue of Turkish I(ı) & İ(i)</p> <p>22/04/10 Zhiguo: PrintCustStatements.php - Change addInfo() to addinfo() and also change INTERVAL() to interval(), so as to solve the locale issue of Turkish I(ı) & İ(i)</p> This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <tim...@us...> - 2010-04-25 09:47:52
|
Revision: 3430 http://web-erp.svn.sourceforge.net/web-erp/?rev=3430&view=rev Author: tim_schofield Date: 2010-04-25 09:47:46 +0000 (Sun, 25 Apr 2010) Log Message: ----------- Matt Taylor: Z_BottomUpCost.php : Add script for batch updating BOM costs, and improvements to DateFunctions.php Modified Paths: -------------- trunk/Z_index.php trunk/doc/Change.log.html trunk/includes/DateFunctions.inc trunk/includes/SQL_CommonFunctions.inc trunk/javascripts/MiscFunctions.js Added Paths: ----------- trunk/Z_BottomUpCosts.php Added: trunk/Z_BottomUpCosts.php =================================================================== --- trunk/Z_BottomUpCosts.php (rev 0) +++ trunk/Z_BottomUpCosts.php 2010-04-25 09:47:46 UTC (rev 3430) @@ -0,0 +1,56 @@ +<?php +/* $Id$*/ +/* Script to update costs for all BOM items, from the bottom up */ + +$PageSecurity = 15; +include('includes/session.inc'); +$title = _('Recalculate BOM costs'); +include('includes/header.inc'); +include('includes/SQL_CommonFunctions.inc'); + +if (isset($_GET['Run'])){ + $Run = $_GET['Run']; +} elseif (isset($_POST['Run'])){ + $Run = $_POST['Run']; +} + +if (isset($Run)) { //start bom processing + + // Get all bottom level components + $sql = "SELECT DISTINCT b1.component + FROM bom as b1 + left join bom as b2 on b2.parent=b1.component + WHERE b2.parent is null;" ; + + $ErrMsg = _('An error occurred selecting all bottom level components'); + $DbgMsg = _('The SQL that was used to select bottom level components and failed in the process was'); + + $result = DB_query($sql,$db,$ErrMsg,$DbgMsg); + + while ($item = DB_fetch_array($result)) { + $inputerror=UpdateCost($db, $item['component']); + if ($inputerror==0) { + prnMsg( _('Component') .' ' . $item['component'] . ' '. _('has been processed'),'success'); + } else { + break; + } + } + + if ($inputerror == 1) { //exited loop with errors so rollback + prnMsg(_('Failed on item '. $item['component']. '. Cost update has been rolled back.'),'error'); + DB_Txn_Rollback($db); + } else { //all good so commit data transaction + DB_Txn_Commit($db); + prnMsg( _('All cost updates committed to the database.'),'success'); + } + +} else { //show file upload form + + echo "<form action=" . $_SERVER['PHP_SELF'] . '?' . sid . " method=post name='form'>"; + echo '<p class="page_title_text"><img src="'.$rootpath.'/css/'.$theme.'/images/sales.png" title="' . _('Search') . '" alt="">' . ' ' . _('Update costs for all items listed in a bill of materials').'<br></p>'; + echo "<div class=centre><input type='submit' name='Run' value='" . _('Run') . "'></div></form>"; + +} + +include('includes/footer.inc'); +?> \ No newline at end of file Property changes on: trunk/Z_BottomUpCosts.php ___________________________________________________________________ Added: svn:keywords + Id Modified: trunk/Z_index.php =================================================================== --- trunk/Z_index.php 2010-04-23 07:45:28 UTC (rev 3429) +++ trunk/Z_index.php 2010-04-25 09:47:46 UTC (rev 3430) @@ -14,6 +14,7 @@ echo "<p><a href='$rootpath/Z_ChangeBranchCode.php?" . SID . "'>" . _('Change A Customer Branch Code') . '</a>'; echo "<p><a href='$rootpath/Z_ChangeStockCode.php?" . SID . "'>" . _('Change An Inventory Item Code') . '</a>'; echo "<p><a href='$rootpath/Z_PriceChanges.php?" . SID . "'>" . _('Bulk Change Customer Pricing') . '</a>'; + echo "<p><a href='$rootpath/Z_BottomUpCosts.php?" . SID . "'>" . _('Update costs for all BOM items, from the bottom up') . '</a>'; echo "<p><a href='$rootpath/Z_CurrencyDebtorsBalances.php?" . SID . "'>" . _('Show Local Currency Total Debtor Balances') . '</a>'; echo "<p><a href='$rootpath/Z_CurrencySuppliersBalances.php?" . SID . "'>" . _('Show Local Currency Total Suppliers Balances') . '</a>'; Modified: trunk/doc/Change.log.html =================================================================== --- trunk/doc/Change.log.html 2010-04-23 07:45:28 UTC (rev 3429) +++ trunk/doc/Change.log.html 2010-04-25 09:47:46 UTC (rev 3430) @@ -1,5 +1,8 @@ <p><font SIZE=4 COLOR=BLUE><b>webERP Change Log</b></font></p> <p></p> +<p>23/04/10 Matt Taylor: MiscFunctions.js : Fix IsDate() function for Y/m/d format.</p> +<p>23/04/10 Matt Taylor: DateFunctions.inc : Fix Date1GreaterThanDate2() function for Y/m/d format.</p> +<p>23/04/10 Matt Taylor: Z_BottomUpCost.php : Add script for batch updating BOM costs.</p> <p>22/04/10 Zhiguo: SelectProduct.php - Add a link to StockStatus.php direct from the selection page.</p> <p>22/04/10 Lindsay: add missing ; to second last line of upgrade3.11.1-3.12.sql</p> <p>22/04/10 Zhiguo: index.php - Change SID to sid, so as to solve the locale issue of Turkish I(ı) & İ(i)</p> Modified: trunk/includes/DateFunctions.inc =================================================================== --- trunk/includes/DateFunctions.inc 2010-04-23 07:45:28 UTC (rev 3429) +++ trunk/includes/DateFunctions.inc 2010-04-25 09:47:46 UTC (rev 3430) @@ -16,7 +16,7 @@ */ -function Is_Date($DateEntry) { +function is_date($DateEntry) { $DateEntry =Trim($DateEntry); @@ -397,7 +397,7 @@ } if ($_SESSION['DefaultDateFormat']=='Y/m/d') { - return $Date_Array[0].'/'.$Date_Array[1].'/'.$Date_Array[2]; + return $Date_Array[0].'-'.$Date_Array[1].'-'.$Date_Array[2]; } //to modify assumption in 2030 @@ -412,13 +412,13 @@ } if (($_SESSION['DefaultDateFormat']=='d/m/Y')){ /* echo '<BR>The date returned is ' . $Date_Array[2].'/'.$Date_Array[1].'/'.$Date_Array[0]; */ - return $Date_Array[2].'/'.$Date_Array[1].'/'.$Date_Array[0]; + return $Date_Array[2].'-'.$Date_Array[1].'-'.$Date_Array[0]; } elseif ($_SESSION['DefaultDateFormat']=='d.m.Y') { - return $Date_Array[2].'.'.$Date_Array[1].'.'.$Date_Array[0]; + return $Date_Array[2].'-'.$Date_Array[1].'-'.$Date_Array[0]; } elseif ($_SESSION['DefaultDateFormat']=='m/d/Y') { - return $Date_Array[2].'/'.$Date_Array[0].'/'.$Date_Array[1]; + return $Date_Array[2].'-'.$Date_Array[0].'-'.$Date_Array[1]; } elseif ($_SESSION['DefaultDateFormat']=='Y/m/d') { - return $Date_Array[0].'/'.$Date_Array[1].'/'.$Date_Array[2]; + return $Date_Array[0].'-'.$Date_Array[1].'-'.$Date_Array[2]; } }// end of function @@ -433,59 +433,66 @@ function Date1GreaterThanDate2 ($Date1, $Date2) { -/* returns 1 true if Date1 is greater than Date 2 */ +/* returns true (1) if Date1 is greater than Date2 */ $Date1 = trim($Date1); $Date2 = trim($Date2); - $Date1_array = explode('/', $Date1); - $Date2_array = explode('/', $Date2); + /* Get date elements */ + if ($_SESSION['DefaultDateFormat']=='d.m.Y' or $_SESSION['DefaultDateFormat'] =='d/m/Y'){ + list($Day1,$Month1,$Year1) = explode('.', $Date1); + list($Day2,$Month2,$Year2) = explode('.', $Date2); + } elseif ($_SESSION['DefaultDateFormat'] =='m/d/Y'){ + list($Month1,$Day1,$Year1) = explode('/', $Date1); + list($Month2,$Day2,$Year2) = explode('/', $Date2); + } elseif ($_SESSION['DefaultDateFormat'] =='Y/m/d'){ + list($Year1,$Month1,$Day1) = explode('/', $Date1); + list($Year2,$Month2,$Day2) = explode('/', $Date2); + } + /*Try to make the year of each date comparable - if one date is specified as just - 2 characters and the other >2 then take the last 2 characters of the other date only */ - if (strlen($Date1_array[2])>2 AND strlen($Date2_array[2])==2){ - $Date1_array[2] = substr($Date1_array[2], strlen($Date1_array[2])-2); + * 2 characters and the other >2 then then make them both 4 characters long. Assume + * a date >50 to be 1900's and less than to be 2000's + */ + if (strlen($Year1)>2 AND strlen($Year2)==2){ + if ($Year2>50) { + $Year2=1900+$Year2; + } else { + $Year2=2000+$Year2; + } } - if (strlen($Date2_array[2])>2 AND strlen($Date1_array[2])==2){ - $Date2_array[2] = substr($Date2_array[2], strlen($Date2_array[2])-2); + if (strlen($Year2)>2 AND strlen($Year1)==2){ + if ($Year1>50) { + $Year1=1900+$Year1; + } else { + $Year1=2000+$Year1; + } } - /*The 2 element of the array will be the year in either d/m/Y or m/d/Y formats */ + /* Compare years */ + if ($Year1>$Year2){ + return 1; + } elseif ($Year2>$Year1){ + return 0; + } - if (($Date1_array[2] - $Date2_array[2]) >0){ + /* Compare months. Years are equal*/ + if ($Month1>$Month2){ return 1; - } elseif (($Date1_array[2] - $Date2_array[2]) ==0){ + } elseif ($Month2>$Month1){ + return 0; + } - /*The 0 and 1 elements of the array are switched depending on the format used */ + /* Compare days. Years and months are equal */ + if ($Day1>$Day2){ + return 1; + } elseif ($Day2>$Day1){ + return 0; + } - if (($_SESSION['DefaultDateFormat']=='d/m/Y') OR ($_SESSION['DefaultDateFormat']=='d.m.Y')){ - if ( ($Date1_array[1] - $Date2_array[1]) >0){ - return 1; - } elseif (($Date1_array[1] - $Date2_array[1])==0){ - if (($Date1_array[0] - $Date2_array[0])>0){ - return 1; - } - } + /* The dates are equal, so return an error state */ + return 1; - } elseif ($_SESSION['DefaultDateFormat'] =='m/d/Y'){ - If (($Date1_array[0] - $Date2_array[0])>0){ - Return 1; - } elseif (($Date1_array[0] - $Date2_array[0])==0){ - If (($Date1_array[1] - $Date2_array[1])>0){ - Return 1; - } - } - } elseif ($_SESSION['DefaultDateFormat'] =='Y/m/d'){ - if (($Date1_array[2] - $Date2_array[2])>0){ - return 1; - } elseif (($Date1_array[2] - $Date2_array[2])==0){ - if (($Date1_array[1] - $Date2_array[1])>0){ - return 1; - } - } - } - } - - return 0; } function CalcDueDate($TranDate, $DayInFollowingMonth, $DaysBeforeDue){ Modified: trunk/includes/SQL_CommonFunctions.inc =================================================================== --- trunk/includes/SQL_CommonFunctions.inc 2010-04-23 07:45:28 UTC (rev 3429) +++ trunk/includes/SQL_CommonFunctions.inc 2010-04-25 09:47:46 UTC (rev 3430) @@ -239,8 +239,12 @@ $MaterialCost = BomMaterialCost($NewParent, $db); $SQL = 'UPDATE stockmaster SET materialcost=' . $MaterialCost . " WHERE stockid='" . $NewParent . "'"; $result1 = DB_query($SQL,$db); + if (DB_error_no($db)!=0) { + return 1; + } UpdateCost($db, $NewParent); } + return 0; } /* Accepts work order information and iterates through the bom, inserting real components (dissolving phantom assemblies) */ @@ -303,8 +307,8 @@ WHERE wo = " . $WO . " AND parentstockid = '". $ParentID . "' ) - ) AS g ON g.wo=worequirements.wo - AND g.parentstockid=worequirements.parentstockid + ) AS g ON g.wo=worequirements.wo + AND g.parentstockid=worequirements.parentstockid AND g.stockid=worequirements.stockid SET worequirements.qtypu=worequirements.qtypu+g.qtypu"; $result = DB_query($sql, $db); Modified: trunk/javascripts/MiscFunctions.js =================================================================== --- trunk/javascripts/MiscFunctions.js 2010-04-23 07:45:28 UTC (rev 3429) +++ trunk/javascripts/MiscFunctions.js 2010-04-25 09:47:46 UTC (rev 3430) @@ -23,7 +23,12 @@ return false; } function isDate(dS,dF){ -var mA=dS.match(/^(\d{1,2})(\/|-|.)(\d{1,2})(\/|-|.)(\d{4})$/); +var mA; +if (dF == "Y/m/d"){ +mA=dS.match(/^(\d{4})(\/|-|.)(\d{1,2})(\/|-|.)(\d{1,2})$/); +}else{ +mA=dS.match(/^(\d{1,2})(\/|-|.)(\d{1,2})(\/|-|.)(\d{4})$/); +} if (mA==null){ alert("Please enter the date in the format "+dF); return false; This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <tim...@us...> - 2010-04-28 08:17:33
|
Revision: 3431 http://web-erp.svn.sourceforge.net/web-erp/?rev=3431&view=rev Author: tim_schofield Date: 2010-04-28 08:17:27 +0000 (Wed, 28 Apr 2010) Log Message: ----------- Tim Schofield: MiscFunctions.php : Fix currency download for when there is no internat connection. Modified Paths: -------------- trunk/doc/Change.log.html trunk/includes/MiscFunctions.php Modified: trunk/doc/Change.log.html =================================================================== --- trunk/doc/Change.log.html 2010-04-25 09:47:46 UTC (rev 3430) +++ trunk/doc/Change.log.html 2010-04-28 08:17:27 UTC (rev 3431) @@ -1,5 +1,6 @@ <p><font SIZE=4 COLOR=BLUE><b>webERP Change Log</b></font></p> <p></p> +<p>28/04/10 Tim Schofield: MiscFunctions.php : Fix currency download for when there is no internat connection.</p> <p>23/04/10 Matt Taylor: MiscFunctions.js : Fix IsDate() function for Y/m/d format.</p> <p>23/04/10 Matt Taylor: DateFunctions.inc : Fix Date1GreaterThanDate2() function for Y/m/d format.</p> <p>23/04/10 Matt Taylor: Z_BottomUpCost.php : Add script for batch updating BOM costs.</p> Modified: trunk/includes/MiscFunctions.php =================================================================== --- trunk/includes/MiscFunctions.php 2010-04-25 09:47:46 UTC (rev 3430) +++ trunk/includes/MiscFunctions.php 2010-04-28 08:17:27 UTC (rev 3431) @@ -104,44 +104,45 @@ function GetECBCurrencyRates () { /* See http://www.ecb.int/stats/exchange/eurofxref/html/index.en.html for detail of the European Central Bank rates - published daily */ - $xml = file_get_contents('http://www.ecb.int/stats/eurofxref/eurofxref-daily.xml'); - $parser = xml_parser_create(); - xml_parser_set_option($parser, XML_OPTION_CASE_FOLDING, 0); - xml_parser_set_option($parser, XML_OPTION_SKIP_WHITE, 1); - xml_parse_into_struct($parser, $xml, $tags); - xml_parser_free($parser); + if ($xml = file_get_contents('http://www.ecb.int/stats/eurofxref/eurofxref-daily.xml')) { + $parser = xml_parser_create(); + xml_parser_set_option($parser, XML_OPTION_CASE_FOLDING, 0); + xml_parser_set_option($parser, XML_OPTION_SKIP_WHITE, 1); + xml_parse_into_struct($parser, $xml, $tags); + xml_parser_free($parser); - $elements = array(); // the currently filling [child] XmlElement array - $stack = array(); - foreach ($tags as $tag) { - $index = count($elements); - if ($tag['type'] == "complete" || $tag['type'] == "open") { - $elements[$index] = new XmlElement; - $elements[$index]->name = $tag['tag']; - $elements[$index]->attributes = $tag['attributes']; - $elements[$index]->content = $tag['value']; - if ($tag['type'] == "open") { // push - $elements[$index]->children = array(); - $stack[count($stack)] = &$elements; - $elements = &$elements[$index]->children; - } + $elements = array(); // the currently filling [child] XmlElement array + $stack = array(); + foreach ($tags as $tag) { + $index = count($elements); + if ($tag['type'] == "complete" || $tag['type'] == "open") { + $elements[$index] = new XmlElement; + $elements[$index]->name = $tag['tag']; + $elements[$index]->attributes = $tag['attributes']; + $elements[$index]->content = $tag['value']; + if ($tag['type'] == "open") { // push + $elements[$index]->children = array(); + $stack[count($stack)] = &$elements; + $elements = &$elements[$index]->children; + } + } + if ($tag['type'] == "close") { // pop + $elements = &$stack[count($stack) - 1]; + unset($stack[count($stack) - 1]); + } } - if ($tag['type'] == "close") { // pop - $elements = &$stack[count($stack) - 1]; - unset($stack[count($stack) - 1]); + + + $Currencies = array(); + foreach ($elements[0]->children[2]->children[0]->children as $CurrencyDetails){ + $Currencies[$CurrencyDetails->attributes['currency']]= $CurrencyDetails->attributes['rate'] ; } - } - - - $Currencies = array(); - foreach ($elements[0]->children[2]->children[0]->children as $CurrencyDetails){ - $Currencies[$CurrencyDetails->attributes['currency']]= $CurrencyDetails->attributes['rate'] ; - } - $Currencies['EUR']=1; //ECB delivers no rate for Euro - //return an array of the currencies and rates - return $Currencies; -} - + $Currencies['EUR']=1; //ECB delivers no rate for Euro + //return an array of the currencies and rates + return $Currencies; + } +} + function GetCurrencyRate($CurrCode,$CurrenciesArray) { if ((!isset($CurrenciesArray[$CurrCode]) or !isset($CurrenciesArray[$_SESSION['CompanyRecord']['currencydefault']]))){ return quote_oanda_currency($CurrCode); @@ -174,12 +175,12 @@ function AddCarriageReturns($str) { - return str_replace('\r\n',chr(10),$str); + return str_replace('\r\n',chr(10),$str); } function wikiLink($type, $id) { - + if ($_SESSION['WikiApp']==_('WackoWiki')){ echo '<a target="_blank" href="../' . $_SESSION['WikiPath'] . '/' . $type . $id . '">' . _('Wiki ' . $type . ' Knowlege Base') . '</A><BR>'; } elseif ($_SESSION['WikiApp']==_('MediaWiki')){ This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <tim...@us...> - 2010-04-28 17:36:09
|
Revision: 3432 http://web-erp.svn.sourceforge.net/web-erp/?rev=3432&view=rev Author: tim_schofield Date: 2010-04-28 17:36:03 +0000 (Wed, 28 Apr 2010) Log Message: ----------- Matt Taylor: Z_ImportStocks.php : Prevent importing empty string for pdfappend. Modified Paths: -------------- trunk/Z_ImportStocks.php trunk/doc/Change.log.html Modified: trunk/Z_ImportStocks.php =================================================================== --- trunk/Z_ImportStocks.php 2010-04-28 08:17:27 UTC (rev 3431) +++ trunk/Z_ImportStocks.php 2010-04-28 17:36:03 UTC (rev 3432) @@ -92,7 +92,11 @@ exit; } + // cleanup the data (csv files often import with empty strings and such) $StockID = strtoupper($myrow[0]); + foreach ($myrow as &$value) { + $value = trim($value); + } //first off check if the item already exists $sql = "SELECT COUNT(stockid) FROM stockmaster WHERE stockid='".$StockID."'"; @@ -129,7 +133,7 @@ $InputError = 1; prnMsg(_('The barcode must be 20 characters or less long'),'error'); } - if ($myrow[10]!='0' AND $myrow[10]!='1') { + if ($myrow[10]!=0 AND $myrow[10]!=1) { $InputError = 1; prnMsg (_('Values in the Perishable field must be either 0 (No) or 1 (Yes)') ,'error'); } @@ -171,10 +175,14 @@ $InputError = 1; prnMsg(_('Assembly/Kitset/Phantom/Service items cannot also be controlled items') . '. ' . _('Assemblies, Dummies and Kitsets are not physical items and batch/serial control is therefore not appropriate'),'error'); } - if (trim($myrow[3])==''){ + if ($myrow[3]==''){ $InputError = 1; prnMsg(_('There are no inventory categories defined. All inventory items must belong to a valid inventory category,'),'error'); } + if ($myrow[17]==''){ + $InputError = 1; + prnMsg(_('ItemPDF must contain either a filename, or the keyword `none`'),'error'); + } if ($InputError !=1){ if ($myrow[9]==1){ /*Not appropriate to have several dp on serial items */ @@ -241,7 +249,7 @@ $InsResult = DB_query($sql,$db,$ErrMsg,$DbgMsg); if (DB_error_no($db) ==0) { - prnMsg( _('New Item') .' ' . $StockID . ' '. _('has been added to the transaction'),'success'); + prnMsg( _('New Item') .' ' . $StockID . ' '. _('has been added to the transaction'),'info'); } else { //location insert failed so set some useful error info $InputError = 1; prnMsg(_($InsResult),'error'); Modified: trunk/doc/Change.log.html =================================================================== --- trunk/doc/Change.log.html 2010-04-28 08:17:27 UTC (rev 3431) +++ trunk/doc/Change.log.html 2010-04-28 17:36:03 UTC (rev 3432) @@ -1,6 +1,7 @@ <p><font SIZE=4 COLOR=BLUE><b>webERP Change Log</b></font></p> <p></p> <p>28/04/10 Tim Schofield: MiscFunctions.php : Fix currency download for when there is no internat connection.</p> +<p>28/04/10 Matt Taylor: Z_ImportStocks.php : Prevent importing empty string for pdfappend.</p> <p>23/04/10 Matt Taylor: MiscFunctions.js : Fix IsDate() function for Y/m/d format.</p> <p>23/04/10 Matt Taylor: DateFunctions.inc : Fix Date1GreaterThanDate2() function for Y/m/d format.</p> <p>23/04/10 Matt Taylor: Z_BottomUpCost.php : Add script for batch updating BOM costs.</p> This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <tim...@us...> - 2010-04-29 05:55:27
|
Revision: 3433 http://web-erp.svn.sourceforge.net/web-erp/?rev=3433&view=rev Author: tim_schofield Date: 2010-04-29 05:55:20 +0000 (Thu, 29 Apr 2010) Log Message: ----------- Tim Schofield: SelectOrderItems.php : LastCustomer was not being initialised. Modified Paths: -------------- trunk/SelectOrderItems.php trunk/doc/Change.log.html Modified: trunk/SelectOrderItems.php =================================================================== --- trunk/SelectOrderItems.php 2010-04-28 17:36:03 UTC (rev 3432) +++ trunk/SelectOrderItems.php 2010-04-29 05:55:20 UTC (rev 3433) @@ -644,7 +644,7 @@ $j = 1; $k = 0; //row counter to determine background colour - + $LastCustomer=''; while ($myrow=DB_fetch_array($result_CustSelect)) { if ($k==1){ @@ -664,7 +664,7 @@ <input type=hidden name="Select" value="'.$myrow['debtorno'].' - '.$myrow['branchcode'].'"> <td>'.$myrow['contactname'].'</td> <td>'.$myrow['phoneno'].'</td> - <td>.'.$myrow['faxno'].'</td> + <td>'.$myrow['faxno'].'</td> </tr></form>'; $LastCustomer=$myrow['name']; $j++; Modified: trunk/doc/Change.log.html =================================================================== --- trunk/doc/Change.log.html 2010-04-28 17:36:03 UTC (rev 3432) +++ trunk/doc/Change.log.html 2010-04-29 05:55:20 UTC (rev 3433) @@ -1,5 +1,6 @@ <p><font SIZE=4 COLOR=BLUE><b>webERP Change Log</b></font></p> <p></p> +<p>29/04/10 Tim Schofield: SelectOrderItems.php : LastCustomer was not being initialised.</p> <p>28/04/10 Tim Schofield: MiscFunctions.php : Fix currency download for when there is no internat connection.</p> <p>28/04/10 Matt Taylor: Z_ImportStocks.php : Prevent importing empty string for pdfappend.</p> <p>23/04/10 Matt Taylor: MiscFunctions.js : Fix IsDate() function for Y/m/d format.</p> This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <tim...@us...> - 2010-04-29 16:08:47
|
Revision: 3434 http://web-erp.svn.sourceforge.net/web-erp/?rev=3434&view=rev Author: tim_schofield Date: 2010-04-29 16:08:41 +0000 (Thu, 29 Apr 2010) Log Message: ----------- Tim Schofield: SelectOrderItems.php : Ensure PO line number is carried through from quck entry screen. Modified Paths: -------------- trunk/SelectOrderItems.php trunk/doc/Change.log.html Modified: trunk/SelectOrderItems.php =================================================================== --- trunk/SelectOrderItems.php 2010-04-29 05:55:20 UTC (rev 3433) +++ trunk/SelectOrderItems.php 2010-04-29 16:08:41 UTC (rev 3434) @@ -977,7 +977,6 @@ prnMsg(_('Phantom assemblies cannot be sold, these items exist only as bills of materials used in other manufactured items. The following item has not been added to the order:') . ' ' . $NewItem, 'warn'); } else { /*Its not a kit set item*/ $NewItemDue = date($_SESSION['DefaultDateFormat']); - $NewPOLine = 0; include('includes/SelectOrderItems_IntoCart.inc'); } } Modified: trunk/doc/Change.log.html =================================================================== --- trunk/doc/Change.log.html 2010-04-29 05:55:20 UTC (rev 3433) +++ trunk/doc/Change.log.html 2010-04-29 16:08:41 UTC (rev 3434) @@ -1,5 +1,6 @@ <p><font SIZE=4 COLOR=BLUE><b>webERP Change Log</b></font></p> <p></p> +<p>29/04/10 Tim Schofield: SelectOrderItems.php : Ensure PO line number is carried through from quck entry screen.</p> <p>29/04/10 Tim Schofield: SelectOrderItems.php : LastCustomer was not being initialised.</p> <p>28/04/10 Tim Schofield: MiscFunctions.php : Fix currency download for when there is no internat connection.</p> <p>28/04/10 Matt Taylor: Z_ImportStocks.php : Prevent importing empty string for pdfappend.</p> This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <lin...@us...> - 2010-04-30 10:57:41
|
Revision: 3435 http://web-erp.svn.sourceforge.net/web-erp/?rev=3435&view=rev Author: lindsayh Date: 2010-04-30 10:57:35 +0000 (Fri, 30 Apr 2010) Log Message: ----------- Made the installation function work. This included: Correcting email syntax check regular expressions Ensure that the SQL script interpreter does not execute CREATE DATABASE and USE commands from install scripts (it puts things in the wrong DB) Add PCtabs to install and demo SQL scripts - not sure what else may be missing Make weberpdemo the default database name Correct SQL to set the admin account password Modified Paths: -------------- trunk/PcReportTab.php trunk/Z_MakeNewCompany.php trunk/doc/Change.log.html trunk/install/index.php trunk/install/save.php trunk/sql/mysql/weberp-demo.sql trunk/sql/mysql/weberp-new.sql Modified: trunk/PcReportTab.php =================================================================== --- trunk/PcReportTab.php 2010-04-29 16:08:41 UTC (rev 3434) +++ trunk/PcReportTab.php 2010-04-30 10:57:35 UTC (rev 3435) @@ -32,8 +32,6 @@ echo '<table>'; echo '<tr><td>' . _('Code Of Petty Cash Tab') . ":</td><td><select name='SelectedTabs'>"; - DB_free_result($result); - if ($_SESSION['AccessLevel'] >= 15){ // superuser can supervise the supervisors $SQL = "SELECT tabcode FROM pctabs @@ -56,7 +54,9 @@ } //end while loop get type of tab + DB_free_result($result); + echo '</select></td></tr>'; echo'<tr><td>' . _('From Date :') . '</td><td>'; echo '<input tabindex="2" class="date" alt="'.$_SESSION['DefaultDateFormat'].'" type="TEXT" name="FromDate" maxlength="10" size="11" VALUE="' . $_POST['FromDate'] . '">'; Modified: trunk/Z_MakeNewCompany.php =================================================================== --- trunk/Z_MakeNewCompany.php 2010-04-29 16:08:41 UTC (rev 3434) +++ trunk/Z_MakeNewCompany.php 2010-04-30 10:57:35 UTC (rev 3435) @@ -93,7 +93,7 @@ mysqli_select_db($db,$_POST['NewCompany']); $SQLScriptFile = file('./sql/mysql/weberp-new.sql'); } - + $ScriptFileEntries = sizeof($SQLScriptFile); $ErrMsg = _('The script to create the new company database failed because'); $SQL =''; Modified: trunk/doc/Change.log.html =================================================================== --- trunk/doc/Change.log.html 2010-04-29 16:08:41 UTC (rev 3434) +++ trunk/doc/Change.log.html 2010-04-30 10:57:35 UTC (rev 3435) @@ -1,5 +1,6 @@ <p><font SIZE=4 COLOR=BLUE><b>webERP Change Log</b></font></p> <p></p> +<p>30/04/10 Lindsay: Make installation operation functional again <p>29/04/10 Tim Schofield: SelectOrderItems.php : Ensure PO line number is carried through from quck entry screen.</p> <p>29/04/10 Tim Schofield: SelectOrderItems.php : LastCustomer was not being initialised.</p> <p>28/04/10 Tim Schofield: MiscFunctions.php : Fix currency download for when there is no internat connection.</p> Modified: trunk/install/index.php =================================================================== --- trunk/install/index.php 2010-04-29 16:08:41 UTC (rev 3434) +++ trunk/install/index.php 2010-04-30 10:57:35 UTC (rev 3435) @@ -141,10 +141,8 @@ </td> <td style="color: #666666;"><?php echo 'Company data dirs ('. $comp_path. '/*)'; ?> </td> - <td><?php if(is_writable($comp_path) && is_writable($comp_path.'/weberpdemo') && is_writable($comp_path.'/weberpdemo/part_pics')) { + <td><?php if(is_writable($comp_path)) { echo '<font class="good">Writeable</font>'; - } elseif(!file_exists($comp_path)) { - echo '<font class="bad">Directory Not Found</font>'; } else { echo '<font class="bad">Unwriteable</font>'; } @@ -257,7 +255,7 @@ <tr> <td style="color: #666666;" colspan="1">Company Name:</td> <td colspan="4"> - <input type="text" tabindex="13" name="company_name" style="width: 99%;" value="<?php if(isset($_SESSION['company_name'])) { echo $_SESSION['company_name']; } else { echo 'weberp'; } ?>" /> + <input type="text" tabindex="13" name="company_name" style="width: 99%;" value="<?php if(isset($_SESSION['company_name'])) { echo $_SESSION['company_name']; } else { echo 'weberpdemo'; } ?>" /> </td> </tr> <tr> Modified: trunk/install/save.php =================================================================== --- trunk/install/save.php 2010-04-29 16:08:41 UTC (rev 3434) +++ trunk/install/save.php 2010-04-30 10:57:35 UTC (rev 3435) @@ -104,7 +104,7 @@ } function is_valid_email($email) { - return preg_match("/[a-zA-Z0-9_-.+]+@[a-zA-Z0-9_-.]+.[a-zA-Z]+/", $email) > 0; + return preg_match("/[a-zA-Z0-9_.+-]+@[a-zA-Z0-9_.-]+.[a-zA-Z]+/", $email) > 0; } if (isset($_POST['path_to_root'])) { @@ -312,14 +312,13 @@ //need to drop any pre-existing weberpdemo database mysqli_query($db, "DROP DATABASE 'weberpdemo'"); } else { //creating a new database with no demo data - mysqli_query($db, 'CREATE DATABASE IF NOT EXISTS `' . mysqli_real_escape_string($db, $_POST['company_name']) . '`'); - mysqli_select_db($db, $_POST['company_name']); $SQLScriptFile = file($path_to_root . '/sql/mysql/weberp-new.sql'); } + mysqli_query($db, 'CREATE DATABASE IF NOT EXISTS `' . mysqli_real_escape_string($db, $_POST['company_name']) . '`'); + mysqli_select_db($db, $_POST['company_name']); $ScriptFileEntries = sizeof($SQLScriptFile); $SQL =''; $InAFunction = false; - for ($i=0; $i<$ScriptFileEntries; $i++) { $SQLScriptFile[$i] = trim($SQLScriptFile[$i]); @@ -339,9 +338,13 @@ $InAFunction = false; } if (strpos($SQLScriptFile[$i],';')>0 AND ! $InAFunction){ - $SQL = substr($SQL,0,strlen($SQL)-1); - $result = mysqli_query($db,$SQL); - $SQL=''; + // Database created above with correct name. + if (strncasecmp($SQL, ' CREATE DATABASE ', 17) + AND strncasecmp($SQL, ' USE ', 5)){ + $SQL = substr($SQL,0,strlen($SQL)-1); + $result = mysqli_query($db,$SQL); + } + $SQL = ''; } } //end if its a valid sql line not a comment @@ -350,12 +353,12 @@ $sql = "UPDATE www_users SET password = '" . sha1($_POST['admin_password']) . "', email = '".mysqli_real_escape_string($db, $_POST['admin_email']) ."' - WHERE user_id = 'admin'"; -mysqli_query($db,$sql); + WHERE userid = 'admin'"; +$result = mysqli_query($db,$sql); $sql = "UPDATE companies SET coyname = '". mysqli_real_escape_string($db, $_POST['company_name']) . "' WHERE coycode = 1"; -mysqli_query($db,$sql); +$result = mysqli_query($db,$sql); session_unset(); session_destroy(); Modified: trunk/sql/mysql/weberp-demo.sql =================================================================== --- trunk/sql/mysql/weberp-demo.sql 2010-04-29 16:08:41 UTC (rev 3434) +++ trunk/sql/mysql/weberp-demo.sql 2010-04-30 10:57:35 UTC (rev 3435) @@ -1,6 +1,7 @@ CREATE DATABASE IF NOT EXISTS weberpdemo DEFAULT CHARACTER SET utf8 DEFAULT COLLATE utf8_general_ci; USE weberpdemo; +SET FOREIGN_KEY_CHECKS=0; /*!40103 SET @OLD_TIME_ZONE=@@TIME_ZONE */; /*!40103 SET TIME_ZONE='+00:00' */; /*!40014 SET @OLD_UNIQUE_CHECKS=@@UNIQUE_CHECKS, UNIQUE_CHECKS=0 */; @@ -969,6 +970,73 @@ /*!40101 SET character_set_client = @saved_cs_client */; +CREATE TABLE IF NOT EXISTS `pcashdetails` ( + `counterindex` int(20) NOT NULL AUTO_INCREMENT, + `tabcode` varchar(20) NOT NULL, + `date` date NOT NULL, + `codeexpense` varchar(20) NOT NULL, + `amount` double NOT NULL, + `authorized` date NOT NULL COMMENT 'date cash assigment was revised and authorized by authorizer from tabs table', + `posted` tinyint(4) NOT NULL COMMENT 'has (or has not) been posted into gltrans', + `notes` text NOT NULL, + `receipt` text COMMENT 'filename or path to scanned receipt or code of receipt to find physical receipt if tax guys or auditors show up', + PRIMARY KEY (`counterindex`) +) ENGINE=InnoDB DEFAULT CHARSET=utf8 AUTO_INCREMENT=1 ; + + +CREATE TABLE IF NOT EXISTS `pcexpenses` ( + `codeexpense` varchar(20) NOT NULL COMMENT 'code for the group', + `description` varchar(50) NOT NULL COMMENT 'text description, e.g. meals, train tickets, fuel, etc', + `glaccount` int(11) NOT NULL COMMENT 'GL related account', + PRIMARY KEY (`codeexpense`), + KEY (`glaccount`) +) ENGINE=InnoDB DEFAULT CHARSET=utf8; + + +CREATE TABLE IF NOT EXISTS `pctabexpenses` ( + `typetabcode` varchar(20) NOT NULL, + `codeexpense` varchar(20) NOT NULL, + KEY (`typetabcode`), + KEY (`codeexpense`) +) ENGINE=InnoDB DEFAULT CHARSET=utf8; + +CREATE TABLE IF NOT EXISTS `pctabs` ( + `tabcode` varchar(20) NOT NULL, + `usercode` varchar(20) NOT NULL COMMENT 'code of user employee from www_users', + `typetabcode` varchar(20) NOT NULL, + `currency` char(3) NOT NULL, + `tablimit` double NOT NULL, + `authorizer` varchar(20) NOT NULL COMMENT 'code of user from www_users', + `glaccountassignment` int(11) NOT NULL COMMENT 'gl account where the money comes from', + `glaccountpcash` int(11) NOT NULL, + PRIMARY KEY (`tabcode`), + KEY (`usercode`), + KEY (`typetabcode`), + KEY (`currency`), + KEY (`authorizer`), + KEY (`glaccountassignment`) +) ENGINE=InnoDB DEFAULT CHARSET=utf8; + +CREATE TABLE IF NOT EXISTS `pctypetabs` ( + `typetabcode` varchar(20) NOT NULL COMMENT 'code for the type of petty cash tab', + `typetabdescription` varchar(50) NOT NULL COMMENT 'text description, e.g. tab for CEO', + PRIMARY KEY (`typetabcode`) +) ENGINE=InnoDB DEFAULT CHARSET=utf8; + +ALTER TABLE `pcexpenses` + ADD CONSTRAINT `pcexpenses_ibfk_1` FOREIGN KEY (`glaccount`) REFERENCES `chartmaster` (`accountcode`); + +ALTER TABLE `pctabexpenses` + ADD CONSTRAINT `pctabexpenses_ibfk_1` FOREIGN KEY (`typetabcode`) REFERENCES `pctypetabs` (`typetabcode`), + ADD CONSTRAINT `pctabexpenses_ibfk_2` FOREIGN KEY (`codeexpense`) REFERENCES `pcexpenses` (`codeexpense`); + +ALTER TABLE `pctabs` + ADD CONSTRAINT `pctabs_ibfk_1` FOREIGN KEY (`usercode`) REFERENCES `www_users` (`userid`), + ADD CONSTRAINT `pctabs_ibfk_2` FOREIGN KEY (`typetabcode`) REFERENCES `pctypetabs` (`typetabcode`), + ADD CONSTRAINT `pctabs_ibfk_3` FOREIGN KEY (`currency`) REFERENCES `currencies` (`currabrev`), + ADD CONSTRAINT `pctabs_ibfk_4` FOREIGN KEY (`authorizer`) REFERENCES `www_users` (`userid`), + ADD CONSTRAINT `pctabs_ibfk_5` FOREIGN KEY (`glaccountassignment`) REFERENCES `chartmaster` (`accountcode`); + /*!40101 SET @saved_cs_client = @@character_set_client */; /*!40101 SET character_set_client = utf8 */; CREATE TABLE `periods` ( @@ -7075,3 +7143,4 @@ /*!40014 SET FOREIGN_KEY_CHECKS=@OLD_FOREIGN_KEY_CHECKS */; /*!40014 SET UNIQUE_CHECKS=@OLD_UNIQUE_CHECKS */; /*!40111 SET SQL_NOTES=@OLD_SQL_NOTES */; +SET FOREIGN_KEY_CHECKS=1; Modified: trunk/sql/mysql/weberp-new.sql =================================================================== --- trunk/sql/mysql/weberp-new.sql 2010-04-29 16:08:41 UTC (rev 3434) +++ trunk/sql/mysql/weberp-new.sql 2010-04-30 10:57:35 UTC (rev 3435) @@ -971,6 +971,73 @@ /*!40101 SET character_set_client = @saved_cs_client */; +CREATE TABLE IF NOT EXISTS `pcashdetails` ( + `counterindex` int(20) NOT NULL AUTO_INCREMENT, + `tabcode` varchar(20) NOT NULL, + `date` date NOT NULL, + `codeexpense` varchar(20) NOT NULL, + `amount` double NOT NULL, + `authorized` date NOT NULL COMMENT 'date cash assigment was revised and authorized by authorizer from tabs table', + `posted` tinyint(4) NOT NULL COMMENT 'has (or has not) been posted into gltrans', + `notes` text NOT NULL, + `receipt` text COMMENT 'filename or path to scanned receipt or code of receipt to find physical receipt if tax guys or auditors show up', + PRIMARY KEY (`counterindex`) +) ENGINE=InnoDB DEFAULT CHARSET=utf8 AUTO_INCREMENT=1 ; + + +CREATE TABLE IF NOT EXISTS `pcexpenses` ( + `codeexpense` varchar(20) NOT NULL COMMENT 'code for the group', + `description` varchar(50) NOT NULL COMMENT 'text description, e.g. meals, train tickets, fuel, etc', + `glaccount` int(11) NOT NULL COMMENT 'GL related account', + PRIMARY KEY (`codeexpense`), + KEY (`glaccount`) +) ENGINE=InnoDB DEFAULT CHARSET=utf8; + + +CREATE TABLE IF NOT EXISTS `pctabexpenses` ( + `typetabcode` varchar(20) NOT NULL, + `codeexpense` varchar(20) NOT NULL, + KEY (`typetabcode`), + KEY (`codeexpense`) +) ENGINE=InnoDB DEFAULT CHARSET=utf8; + +CREATE TABLE IF NOT EXISTS `pctabs` ( + `tabcode` varchar(20) NOT NULL, + `usercode` varchar(20) NOT NULL COMMENT 'code of user employee from www_users', + `typetabcode` varchar(20) NOT NULL, + `currency` char(3) NOT NULL, + `tablimit` double NOT NULL, + `authorizer` varchar(20) NOT NULL COMMENT 'code of user from www_users', + `glaccountassignment` int(11) NOT NULL COMMENT 'gl account where the money comes from', + `glaccountpcash` int(11) NOT NULL, + PRIMARY KEY (`tabcode`), + KEY (`usercode`), + KEY (`typetabcode`), + KEY (`currency`), + KEY (`authorizer`), + KEY (`glaccountassignment`) +) ENGINE=InnoDB DEFAULT CHARSET=utf8; + +CREATE TABLE IF NOT EXISTS `pctypetabs` ( + `typetabcode` varchar(20) NOT NULL COMMENT 'code for the type of petty cash tab', + `typetabdescription` varchar(50) NOT NULL COMMENT 'text description, e.g. tab for CEO', + PRIMARY KEY (`typetabcode`) +) ENGINE=InnoDB DEFAULT CHARSET=utf8; + +ALTER TABLE `pcexpenses` + ADD CONSTRAINT `pcexpenses_ibfk_1` FOREIGN KEY (`glaccount`) REFERENCES `chartmaster` (`accountcode`); + +ALTER TABLE `pctabexpenses` + ADD CONSTRAINT `pctabexpenses_ibfk_1` FOREIGN KEY (`typetabcode`) REFERENCES `pctypetabs` (`typetabcode`), + ADD CONSTRAINT `pctabexpenses_ibfk_2` FOREIGN KEY (`codeexpense`) REFERENCES `pcexpenses` (`codeexpense`); + +ALTER TABLE `pctabs` + ADD CONSTRAINT `pctabs_ibfk_1` FOREIGN KEY (`usercode`) REFERENCES `www_users` (`userid`), + ADD CONSTRAINT `pctabs_ibfk_2` FOREIGN KEY (`typetabcode`) REFERENCES `pctypetabs` (`typetabcode`), + ADD CONSTRAINT `pctabs_ibfk_3` FOREIGN KEY (`currency`) REFERENCES `currencies` (`currabrev`), + ADD CONSTRAINT `pctabs_ibfk_4` FOREIGN KEY (`authorizer`) REFERENCES `www_users` (`userid`), + ADD CONSTRAINT `pctabs_ibfk_5` FOREIGN KEY (`glaccountassignment`) REFERENCES `chartmaster` (`accountcode`); + /*!40101 SET @saved_cs_client = @@character_set_client */; /*!40101 SET character_set_client = utf8 */; CREATE TABLE `periods` ( This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <lin...@us...> - 2010-05-01 07:23:53
|
Revision: 3436 http://web-erp.svn.sourceforge.net/web-erp/?rev=3436&view=rev Author: lindsayh Date: 2010-05-01 07:23:47 +0000 (Sat, 01 May 2010) Log Message: ----------- Can now upload a logo image file during install. Changed email address validation to more sophisticated/accurate one. Modified Paths: -------------- trunk/doc/Change.log.html trunk/install/index.php trunk/install/save.php Modified: trunk/doc/Change.log.html =================================================================== --- trunk/doc/Change.log.html 2010-04-30 10:57:35 UTC (rev 3435) +++ trunk/doc/Change.log.html 2010-05-01 07:23:47 UTC (rev 3436) @@ -1,5 +1,6 @@ <p><font SIZE=4 COLOR=BLUE><b>webERP Change Log</b></font></p> <p></p> +<p>01/05/10 Lindsay: Install now includes an option to install a logo.jpg file <p>30/04/10 Lindsay: Make installation operation functional again <p>29/04/10 Tim Schofield: SelectOrderItems.php : Ensure PO line number is carried through from quck entry screen.</p> <p>29/04/10 Tim Schofield: SelectOrderItems.php : LastCustomer was not being initialised.</p> Modified: trunk/install/index.php =================================================================== --- trunk/install/index.php 2010-04-30 10:57:35 UTC (rev 3435) +++ trunk/install/index.php 2010-05-01 07:23:47 UTC (rev 3436) @@ -72,7 +72,7 @@ </tr> </table> -<form name="weberp_installation_wizard" action="save.php" method="post"> +<form name="weberp_installation_wizard" action="save.php" method="post" enctype="multipart/form-data"> <input type="hidden" name="url" value="" /> <input type="hidden" name="password_fieldname" value="admin_password" /> <input type="hidden" name="remember" id="remember" value="true" /> @@ -164,7 +164,7 @@ $guessed_url = 'http://'.$_SERVER["SERVER_NAME"].$_SERVER["SCRIPT_NAME"]; $guessed_url = rtrim(dirname($guessed_url), 'install'); ?> - <input type="text" tabindex="1" name="ba_url" style="width: 99%;" value="<?php if(isset($_SESSION['ba_url'])) { echo $_SESSION['ba_url']; } else { echo $guessed_url; } ?>" /> + <input type="text" tabindex="30" name="ba_url" style="width: 99%;" value="<?php if(isset($_SESSION['ba_url'])) { echo $_SESSION['ba_url']; } else { echo $guessed_url; } ?>" /> </td> </tr> </table> @@ -177,10 +177,10 @@ Server Operating System: </td> <td width="180"> - <input type="radio" tabindex="4" name="operating_system" id="operating_system_linux" onclick="document.getElementById('file_perms_box').style.display = 'block';" value="linux"<?php if(!isset($_SESSION['operating_system']) OR $_SESSION['operating_system'] == 'linux') { echo ' checked'; } ?> /> + <input type="radio" tabindex="40" name="operating_system" id="operating_system_linux" onclick="document.getElementById('file_perms_box').style.display = 'block';" value="linux"<?php if(!isset($_SESSION['operating_system']) OR $_SESSION['operating_system'] == 'linux') { echo ' checked'; } ?> /> <font style="cursor: pointer;" onclick="javascript: change_os('linux');">Linux/Unix based</font> <br /> - <input type="radio" tabindex="5" name="operating_system" id="operating_system_windows" onclick="document.getElementById('file_perms_box').style.display = 'none';" value="windows"<?php if(isset($_SESSION['operating_system']) AND $_SESSION['operating_system'] == 'windows') { echo ' checked'; } ?> /> + <input type="radio" tabindex="41" name="operating_system" id="operating_system_windows" onclick="document.getElementById('file_perms_box').style.display = 'none';" value="windows"<?php if(isset($_SESSION['operating_system']) AND $_SESSION['operating_system'] == 'windows') { echo ' checked'; } ?> /> <font style="cursor: pointer;" onclick="javascript: change_os('windows');">Windows</font> </td> <td> @@ -191,7 +191,7 @@ } ?> ;"> - <input type="checkbox" tabindex="6" name="world_writeable" id="world_writeable" value="true"<?php if(isset($_SESSION['world_writeable']) AND $_SESSION['world_writeable'] == true) { echo 'checked'; } ?> /> + <input type="checkbox" tabindex="42" name="world_writeable" id="world_writeable" value="true"<?php if(isset($_SESSION['world_writeable']) AND $_SESSION['world_writeable'] == true) { echo 'checked'; } ?> /> <label for="world_writeable"> World-writeable file permissions (777) </label> @@ -208,7 +208,7 @@ <tr> <td width="120" style="color: #666666;">Host Name:</td> <td width="230"> - <input type="text" tabindex="7" name="database_host" style="width: 98%;" value="<?php if(isset($_SESSION['database_host'])) { + <input type="text" tabindex="43" name="database_host" style="width: 98%;" value="<?php if(isset($_SESSION['database_host'])) { echo $_SESSION['database_host']; } else { echo 'localhost'; @@ -217,7 +217,7 @@ <td width="7"> </td> <td width="70" style="color: #666666;">Username:</td> <td> - <input type="text" tabindex="9" name="database_username" style="width: 98%;" value="<?php if(isset($_SESSION['database_username'])) { + <input type="text" tabindex="44" name="database_username" style="width: 98%;" value="<?php if(isset($_SESSION['database_username'])) { echo $_SESSION['database_username']; } else { echo 'root'; @@ -231,7 +231,7 @@ <td> </td> <td style="color: #666666;">Password:</td> <td> - <input type="password" tabindex="10" name="database_password" style="width: 98%;"<?php if(isset($_SESSION['database_password'])) { + <input type="password" tabindex="45" name="database_password" style="width: 98%;"<?php if(isset($_SESSION['database_password'])) { echo ' value = "'.$_SESSION['database_password'].'"'; } ?> /> </td> @@ -239,7 +239,7 @@ <tr> <td colspan="2"> - <input type="checkbox" tabindex="12" name="install_tables" id="install_tables" value="true"<?php if(!isset($_SESSION['install_tables'])) { + <input type="checkbox" tabindex="46" name="install_tables" id="install_tables" value="true"<?php if(!isset($_SESSION['install_tables'])) { echo ' checked'; } elseif($_SESSION['install_tables'] == 'true') { echo ' checked'; @@ -255,7 +255,7 @@ <tr> <td style="color: #666666;" colspan="1">Company Name:</td> <td colspan="4"> - <input type="text" tabindex="13" name="company_name" style="width: 99%;" value="<?php if(isset($_SESSION['company_name'])) { echo $_SESSION['company_name']; } else { echo 'weberpdemo'; } ?>" /> + <input type="text" tabindex="50" name="company_name" style="width: 99%;" value="<?php if(isset($_SESSION['company_name'])) { echo $_SESSION['company_name']; } else { echo 'weberpdemo'; } ?>" /> </td> </tr> <tr> @@ -264,7 +264,7 @@ </td> <td width="180"> - <input type="checkbox" tabindex="14" name="DemoData" id="db_file_demo" value="demo"<?php if(!isset($_SESSION['db_file']) OR $_SESSION['db_file'] == 'demo') { echo ' checked'; } ?> /> + <input type="checkbox" tabindex="51" name="DemoData" id="db_file_demo" value="demo"<?php if(!isset($_SESSION['db_file']) OR $_SESSION['db_file'] == 'demo') { echo ' checked'; } ?> /> <font style="cursor: pointer;" onclick="javascript: change_data('demo');">weberpdemo company</font> </td> </tr> @@ -274,7 +274,7 @@ </td> <td width="180"> - <SELECT name='timezone'> + <SELECT name='timezone' tabindex="52"> <?php include('timezone.php'); ?> @@ -283,29 +283,38 @@ </td> </tr> <tr> + <td width="170"> + Logo Image File (.jpg) + </td> + + <td width="180"> + <input type="FILE" size="50" ID="LogoFile" name="LogoFile" tabindex="53"> + </td> + </tr> + <tr> <td colspan="5"><h1>Step 6</h1>Please enter your Administrator account details below...</td> </tr> <tr> <td style="color: #666666;">Username:</td> <td> admin - <!--<input type="text" tabindex="14" name="admin_username" style="width: 98%;" value="<?php if(isset($_SESSION['admin_username'])) { echo $_SESSION['admin_username']; } else { echo 'admin'; } ?>" />--> + <!--<input type="text" tabindex="60" name="admin_username" style="width: 98%;" value="<?php if(isset($_SESSION['admin_username'])) { echo $_SESSION['admin_username']; } else { echo 'admin'; } ?>" />--> </td> <td> </td> <td style="color: #666666;">Password:</td> <td> - <input type="password" tabindex="16" name="admin_password" style="width: 98%;"<?php if(isset($_SESSION['admin_password'])) { echo ' value = "'.$_SESSION['admin_password'].'"'; } ?> /> + <input type="password" tabindex="62" name="admin_password" style="width: 98%;"<?php if(isset($_SESSION['admin_password'])) { echo ' value = "'.$_SESSION['admin_password'].'"'; } ?> /> </td> </tr> <tr> <td style="color: #666666;">Email:</td> <td> - <input type="text" tabindex="15" name="admin_email" style="width: 98%;"<?php if(isset($_SESSION['admin_email'])) { echo ' value = "'.$_SESSION['admin_email'].'"'; } ?> /> + <input type="text" tabindex="61" name="admin_email" style="width: 98%;"<?php if(isset($_SESSION['admin_email'])) { echo ' value = "'.$_SESSION['admin_email'].'"'; } ?> /> </td> <td> </td> <td style="color: #666666;">Re-Password:</td> <td> - <input type="password" tabindex="17" name="admin_repassword" style="width: 98%;"<?php if(isset($_SESSION['admin_password'])) { echo ' value = "'.$_SESSION['admin_password'].'"'; } ?> /> + <input type="password" tabindex="63" name="admin_repassword" style="width: 98%;"<?php if(isset($_SESSION['admin_password'])) { echo ' value = "'.$_SESSION['admin_password'].'"'; } ?> /> </td> </tr> @@ -319,7 +328,7 @@ <td>Please note: </td> <td> WebERP is released under the - <a href="http://www.gnu.org/licenses/gpl.html" target="_blank" tabindex="19">GNU General Public License</a> + <a href="http://www.gnu.org/licenses/gpl.html" target="_blank" tabindex="64">GNU General Public License</a> <br /> By clicking install, you are accepting the license. </td> Modified: trunk/install/save.php =================================================================== --- trunk/install/save.php 2010-04-30 10:57:35 UTC (rev 3435) +++ trunk/install/save.php 2010-05-01 07:23:47 UTC (rev 3436) @@ -104,7 +104,61 @@ } function is_valid_email($email) { - return preg_match("/[a-zA-Z0-9_.+-]+@[a-zA-Z0-9_.-]+.[a-zA-Z]+/", $email) > 0; + $atIndex = strrpos ($email, "@"); + if ($atIndex === false) + { + return false; // No @ sign is not acceptable. + } + + if (preg_match('/\\.\\./', $email)) + return false; // > 1 consecutive dot is not allowed. + + // Check component length limits + $domain = substr ($email, $atIndex+1); + $local = substr ($email, 0, $atIndex); + $localLen = strlen ($local); + $domainLen = strlen ($domain); + if ($localLen < 1 || $localLen > 64) + { + // local part length exceeded + return false; + } + if ($domainLen < 1 || $domainLen > 255) + { + // domain part length exceeded + return false; + } + + if ($local[0] == '.' || $local[$localLen-1] == '.') + { + // local part starts or ends with '.' + return false; + } + if (!preg_match ('/^[A-Za-z0-9\\-\\.]+$/', $domain )) + { + // character not valid in domain part + return false; + } + if (!preg_match ('/^(\\\\.|[A-Za-z0-9!#%&`_=\\/$\'*+?^{}|~.-])+$/', + str_replace ("\\\\", "" ,$local ) )) + { + // character not valid in local part unless local part is quoted + if (!preg_match ('/^"(\\\\"|[^"])+"$/', + str_replace("\\\\", "", $local) )) + { + return false; + } + } + + // Check for a DNS 'MX' or 'A' record. + // Windows supported from PHP 5.3.0 on - so check. + $ret = true; + if (version_compare(PHP_VERSION, '5.3.0') >= 0 + || strtoupper(substr(PHP_OS, 0, 3) !== 'WIN')) { + $ret = checkdnsrr( $domain, "MX" ) || checkdnsrr( $domain, "A" ); + } + + return $ret; } if (isset($_POST['path_to_root'])) { @@ -188,6 +242,8 @@ set_error('Please enter timezone'); } +// Use webERP logo if none supplied. + // Check if the user has entered a correct path if (!file_exists($path_to_root.'/sql/mysql/weberp-demo.sql')){ set_error('It appears the Absolute path that you entered is incorrect'); @@ -216,15 +272,26 @@ $config_filename = $path_to_root . '/config.php'; // only make a new company directory structure if we are kicking off a new company // no need to bother if just setting up the demo data +$CompanyDir = $path_to_root . '/companies/' . $_POST['company_name']; if ($_POST['DemoData']==false){ - $Result = mkdir($path_to_root . '/companies/' . $_POST['company_name']); - $Result = mkdir($path_to_root . '/companies/' . $_POST['company_name'] . '/part_pics'); - $Result = mkdir($path_to_root . '/companies/' . $_POST['company_name'] . '/EDI_Incoming_Orders'); - $Result = mkdir($path_to_root . '/companies/' . $_POST['company_name'] . '/reports'); - $Result = mkdir($path_to_root . '/companies/' . $_POST['company_name'] . '/EDI_Sent'); - $Result = mkdir($path_to_root . '/companies/' . $_POST['company_name'] . '/EDI_Pending'); - $Result = mkdir($path_to_root . '/companies/' . $_POST['company_name'] . '/reportwriter'); - $Result = mkdir($path_to_root . '/companies/' . $_POST['company_name'] . '/pdf_append'); + $Result = mkdir($CompanyDir ); + $Result = mkdir($CompanyDir . '/part_pics'); + $Result = mkdir($CompanyDir . '/EDI_Incoming_Orders'); + $Result = mkdir($CompanyDir . '/reports'); + $Result = mkdir($CompanyDir . '/EDI_Sent'); + $Result = mkdir($CompanyDir . '/EDI_Pending'); + $Result = mkdir($CompanyDir . '/reportwriter'); + $Result = mkdir($CompanyDir . '/pdf_append'); + + // Now have a destination to place the logo image. + if (isset($_FILES['LogoFile']) && + $_FILES['LogoFile']['error'] == UPLOAD_ERR_OK) { + $result = move_uploaded_file($_FILES['LogoFile']['tmp_name'], + $CompanyDir . '/logo.jpg'); + } else { + // No logo file, so use the default. + copy( $path_to_root . '/logo_server.jpg', $CompanyDir . '/logo.jpg'); + } } //Need to get the new version number This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <tim...@us...> - 2010-05-02 10:12:17
|
Revision: 3437 http://web-erp.svn.sourceforge.net/web-erp/?rev=3437&view=rev Author: tim_schofield Date: 2010-05-02 10:12:10 +0000 (Sun, 02 May 2010) Log Message: ----------- Tim: SelectProduct.php - Correctly show the next page of products in a search. Modified Paths: -------------- trunk/SelectProduct.php trunk/doc/Change.log.html Modified: trunk/SelectProduct.php =================================================================== --- trunk/SelectProduct.php 2010-05-01 07:23:47 UTC (rev 3436) +++ trunk/SelectProduct.php 2010-05-02 10:12:10 UTC (rev 3437) @@ -660,6 +660,10 @@ <input type=submit name="Go" value="' . _('Go') . '"> <input type=submit name="Previous" value="' . _('Previous') . '"> <input type=submit name="Next" value="' . _('Next') . '">'; + echo '<input type=hidden name=Keywords value="'.$_POST['Keywords'].'">'; + echo '<input type=hidden name=StockCat value="'.$_POST['StockCat'].'">'; + echo '<input type=hidden name=StockCode value="'.$_POST['StockCode'].'">'; + echo '<input type=hidden name=Search value="Search">'; echo '<p></div>'; } echo '<table cellpadding=2 colspan=7>'; Modified: trunk/doc/Change.log.html =================================================================== --- trunk/doc/Change.log.html 2010-05-01 07:23:47 UTC (rev 3436) +++ trunk/doc/Change.log.html 2010-05-02 10:12:10 UTC (rev 3437) @@ -1,7 +1,8 @@ <p><font SIZE=4 COLOR=BLUE><b>webERP Change Log</b></font></p> <p></p> -<p>01/05/10 Lindsay: Install now includes an option to install a logo.jpg file -<p>30/04/10 Lindsay: Make installation operation functional again +<p>02/05/10 Tim: SelectProduct.php - Correctly show the next page of products in a search.</p> +<p>01/05/10 Lindsay: Install now includes an option to install a logo.jpg file</p> +<p>30/04/10 Lindsay: Make installation operation functional again</p> <p>29/04/10 Tim Schofield: SelectOrderItems.php : Ensure PO line number is carried through from quck entry screen.</p> <p>29/04/10 Tim Schofield: SelectOrderItems.php : LastCustomer was not being initialised.</p> <p>28/04/10 Tim Schofield: MiscFunctions.php : Fix currency download for when there is no internat connection.</p> This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <tim...@us...> - 2010-05-02 10:25:55
|
Revision: 3438 http://web-erp.svn.sourceforge.net/web-erp/?rev=3438&view=rev Author: tim_schofield Date: 2010-05-02 10:25:49 +0000 (Sun, 02 May 2010) Log Message: ----------- Tim: Updates for case where no internet connection is present Modified Paths: -------------- trunk/doc/Change.log.html trunk/includes/MiscFunctions.php trunk/includes/footer.inc trunk/includes/session.inc Modified: trunk/doc/Change.log.html =================================================================== --- trunk/doc/Change.log.html 2010-05-02 10:12:10 UTC (rev 3437) +++ trunk/doc/Change.log.html 2010-05-02 10:25:49 UTC (rev 3438) @@ -1,5 +1,6 @@ <p><font SIZE=4 COLOR=BLUE><b>webERP Change Log</b></font></p> <p></p> +<p>02/05/10 Tim: Updates for case where no internet connection is present</p> <p>02/05/10 Tim: SelectProduct.php - Correctly show the next page of products in a search.</p> <p>01/05/10 Lindsay: Install now includes an option to install a logo.jpg file</p> <p>30/04/10 Lindsay: Make installation operation functional again</p> Modified: trunk/includes/MiscFunctions.php =================================================================== --- trunk/includes/MiscFunctions.php 2010-05-02 10:12:10 UTC (rev 3437) +++ trunk/includes/MiscFunctions.php 2010-05-02 10:25:49 UTC (rev 3438) @@ -104,7 +104,8 @@ function GetECBCurrencyRates () { /* See http://www.ecb.int/stats/exchange/eurofxref/html/index.en.html for detail of the European Central Bank rates - published daily */ - if ($xml = file_get_contents('http://www.ecb.int/stats/eurofxref/eurofxref-daily.xml')) { + if (file_exists('http://www.ecb.int/stats/eurofxref/eurofxref-daily.xml')) { + $xml = file_get_contents('http://www.ecb.int/stats/eurofxref/eurofxref-daily.xml'); $parser = xml_parser_create(); xml_parser_set_option($parser, XML_OPTION_CASE_FOLDING, 0); xml_parser_set_option($parser, XML_OPTION_SKIP_WHITE, 1); @@ -140,6 +141,8 @@ $Currencies['EUR']=1; //ECB delivers no rate for Euro //return an array of the currencies and rates return $Currencies; + } else { + return false; } } @@ -162,14 +165,16 @@ } function quote_oanda_currency($CurrCode) { - $page = file('http://www.oanda.com/convert/fxdaily?value=1&redirected=1&exch=' . $CurrCode . '&format=CSV&dest=Get+Table&sel_list=' . $_SESSION['CompanyRecord']['currencydefault']); - $match = array(); - preg_match('/(.+),(\w{3}),([0-9.]+),([0-9.]+)/i', implode('', $page), $match); + if (file_exists('http://www.oanda.com/convert/fxdaily?value=1&redirected=1&exch=' . $CurrCode . '&format=CSV&dest=Get+Table&sel_list=' . $_SESSION['CompanyRecord']['currencydefault'])) { + $page = file('http://www.oanda.com/convert/fxdaily?value=1&redirected=1&exch=' . $CurrCode . '&format=CSV&dest=Get+Table&sel_list=' . $_SESSION['CompanyRecord']['currencydefault']); + $match = array(); + preg_match('/(.+),(\w{3}),([0-9.]+),([0-9.]+)/i', implode('', $page), $match); - if ( sizeof($match) > 0 ){ - return $match[3]; - } else { - return false; + if ( sizeof($match) > 0 ){ + return $match[3]; + } else { + return false; + } } } Modified: trunk/includes/footer.inc =================================================================== --- trunk/includes/footer.inc 2010-05-02 10:12:10 UTC (rev 3437) +++ trunk/includes/footer.inc 2010-05-02 10:25:49 UTC (rev 3438) @@ -25,10 +25,8 @@ echo '<tr><td class="footer">webERP ' . _('Copyright') . ' © weberp.org - '.date('Y').'</td></tr>'; - if(isset($_SERVER['HTTPS']) and $_SERVER['HTTPS'] == 'on'){ + if(file_exists('http://sflogo.sourceforge.net/sflogo.php')) { echo '<tr><td class="footer"><a href="https://sourceforge.net/projects/web-erp"><img src="http://sflogo.sourceforge.net/sflogo.php?group_id=70949&type=12" width="120" height="30" border="0" alt="Get webERP web-based ERP Accounting at SourceForge.net. Fast, secure and Free Open Source software downloads" /></a></td></tr>'; - } else { - echo '<tr><td class="footer"><a href="http://sourceforge.net/projects/web-erp"><img src="http://sflogo.sourceforge.net/sflogo.php?group_id=70949&type=12" width="120" height="30" border="0" alt="Get webERP web-based ERP Accounting at SourceForge.net. Fast, secure and Free Open Source software downloads" /></a></td></tr>'; } echo '</table>'; Modified: trunk/includes/session.inc =================================================================== --- trunk/includes/session.inc 2010-05-02 10:12:10 UTC (rev 3437) +++ trunk/includes/session.inc 2010-05-02 10:25:49 UTC (rev 3438) @@ -134,16 +134,18 @@ $CurrencyRates = GetECBCurrencyRates(); // gets rates from ECB see includes/MiscFunctions.php /*Loop around the defined currencies and get the rate from ECB */ - $CurrenciesResult = DB_query('SELECT currabrev FROM currencies',$db); - while ($CurrencyRow = DB_fetch_row($CurrenciesResult)){ - if ($CurrencyRow[0]!=$_SESSION['CompanyRecord']['currencydefault']){ - $UpdateCurrRateResult = DB_query('UPDATE currencies SET + if ($CurrencyRates!=false) { + $CurrenciesResult = DB_query('SELECT currabrev FROM currencies',$db); + while ($CurrencyRow = DB_fetch_row($CurrenciesResult)){ + if ($CurrencyRow[0]!=$_SESSION['CompanyRecord']['currencydefault']){ + $UpdateCurrRateResult = DB_query('UPDATE currencies SET rate=' . GetCurrencyRate ($CurrencyRow[0],$CurrencyRates) . " WHERE currabrev='" . $CurrencyRow[0] . "'",$db); + } } + $_SESSION['UpdateCurrencyRatesDaily'] = Date('Y-m-d'); + $UpdateConfigResult = DB_query("UPDATE config SET confvalue = '" . Date('Y-m-d') . "' WHERE confname='UpdateCurrencyRatesDaily'",$db); } - $_SESSION['UpdateCurrencyRatesDaily'] = Date('Y-m-d'); - $UpdateConfigResult = DB_query("UPDATE config SET confvalue = '" . Date('Y-m-d') . "' WHERE confname='UpdateCurrencyRatesDaily'",$db); } } } This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <tim...@us...> - 2010-05-02 11:55:31
|
Revision: 3439 http://web-erp.svn.sourceforge.net/web-erp/?rev=3439&view=rev Author: tim_schofield Date: 2010-05-02 11:55:23 +0000 (Sun, 02 May 2010) Log Message: ----------- Tim: Add picking list printing Modified Paths: -------------- trunk/FormDesigner.php trunk/css/silverwolf/default.css trunk/doc/Change.log.html trunk/index.php trunk/sql/mysql/upgrade3.11.1-3.12.sql Added Paths: ----------- trunk/PDFPickingList.php trunk/companies/weberpdemo/FormDesigns/PickingList.xml trunk/includes/PDFPickingListHeader.inc Modified: trunk/FormDesigner.php =================================================================== --- trunk/FormDesigner.php 2010-05-02 10:25:49 UTC (rev 3438) +++ trunk/FormDesigner.php 2010-05-02 11:55:23 UTC (rev 3439) @@ -111,6 +111,9 @@ case 'SalesInvoice.xml': echo '<meta http-equiv="Refresh" content="0; url=' . $rootpath . '/PrintCustTrans.php?' . SID .'FromTransNo=Preview&InvOrCredit=Invoice&PrintPDF=True">'; break; + case 'PickingList.xml': + echo '<meta http-equiv="Refresh" content="0; url=' . $rootpath . '/PDFPickingList.php?' . SID .'TransNo=Preview">'; + break; } } else { /* otherwise check that the web server has write premissions on the companies @@ -208,6 +211,11 @@ echo '<td>'.$subkey['name'].'</td>'; SimpleTextLine($subkey); echo '</tr>'; + } else if ($subkey['type']=='MultiLineText') { + echo '<tr>'; + echo '<td>'.$subkey['name'].'</td>'; + MultiTextLine($subkey); + echo '</tr>'; } else { echo '<tr>'; if ($subkey['type']=='DataText') { Added: trunk/PDFPickingList.php =================================================================== --- trunk/PDFPickingList.php (rev 0) +++ trunk/PDFPickingList.php 2010-05-02 11:55:23 UTC (rev 3439) @@ -0,0 +1,329 @@ +<?php + +/* $Id$*/ + +$PageSecurity = 2; + +include('includes/session.inc'); +include('includes/SQL_CommonFunctions.inc'); + +/* Check that the config variable is set for + * picking notes and get out if not. + */ +if ($_SESSION['RequirePickingNote']==0) { + $title = _('Picking Lists Not Enabled'); + include('includes/header.inc'); + echo '<br>'; + prnMsg( _('The system is not configured for picking lists. Please consult your system administrator.'), 'info'); + include('includes/footer.inc'); + exit; +} + +/* Show selection screen if we have no orders to work with */ +if ((!isset($_GET['TransNo']) or $_GET['TransNo']=="") and !isset($_POST['TransDate'])){ + $title = _('Select Picking Lists'); + include('includes/header.inc'); + $sql='SELECT loccode, + locationname + FROM locations'; + $result=DB_query($sql, $db); + echo '<p class="page_title_text"><img src="'.$rootpath.'/css/'.$theme.'/images/sales.png" title="' . _('Search') . '" alt="">' . ' ' . $title.'<br></p>'; + echo '<form action=' . $_SERVER['PHP_SELF'] . '?' . SID . ' method=post name="form">'; + echo '<table class="selection"><tr>'; + echo '<td>'._('Create picking lists for all deliveries to be made on').' : '.'</td>'; + echo '<td><input type=text class="date" alt="'.$_SESSION['DefaultDateFormat'].'" name="TransDate" maxlength=10 size=11 value='.date($_SESSION['DefaultDateFormat'], mktime(date('m'),date('Y'),date('d')+1)).'></td></tr>'; + echo '<tr><td>'._('From Warehouse').' : '.'</td><td><select name="loccode">'; + while ($myrow=DB_fetch_array($result)) { + echo '<option value='.$myrow['loccode'].'>'.$myrow['locationname'].'</option>'; + } + echo '</select></td></tr>'; + echo '</table>'; + echo "<br><div class='centre'><input type=submit name=Process value='" . _('Print Picking Lists') . "'></div></form>"; + include('includes/footer.inc'); + exit(); +} + +/*retrieve the order details from the database to print */ +$ErrMsg = _('There was a problem retrieving the order header details from the database'); + +if (!isset($_POST['TransDate']) and $_GET['TransNo'] != 'Preview') { +/* If there is no transaction date set, then it must be for a single order */ + $sql = "SELECT salesorders.debtorno, + salesorders.orderno, + salesorders.customerref, + salesorders.comments, + salesorders.orddate, + salesorders.deliverto, + salesorders.deladd1, + salesorders.deladd2, + salesorders.deladd3, + salesorders.deladd4, + salesorders.deladd5, + salesorders.deladd6, + salesorders.deliverblind, + salesorders.deliverydate, + debtorsmaster.name, + debtorsmaster.address1, + debtorsmaster.address2, + debtorsmaster.address3, + debtorsmaster.address4, + debtorsmaster.address5, + debtorsmaster.address6, + shippers.shippername, + salesorders.printedpackingslip, + salesorders.datepackingslipprinted, + locations.locationname + FROM salesorders, + debtorsmaster, + shippers, + locations + WHERE salesorders.debtorno=debtorsmaster.debtorno + AND salesorders.shipvia=shippers.shipper_id + AND salesorders.fromstkloc=locations.loccode + AND salesorders.orderno=" . $_GET['TransNo']; +} else if (isset($_POST['TransDate']) or (isset($_GET['TransNo']) and $_GET['TransNo'] != 'Preview')) { +/* We are printing picking lists for all orders on a day */ + $sql = "SELECT salesorders.debtorno, + salesorders.orderno, + salesorders.customerref, + salesorders.comments, + salesorders.orddate, + salesorders.deliverto, + salesorders.deladd1, + salesorders.deladd2, + salesorders.deladd3, + salesorders.deladd4, + salesorders.deladd5, + salesorders.deladd6, + salesorders.deliverblind, + salesorders.deliverydate, + debtorsmaster.name, + debtorsmaster.address1, + debtorsmaster.address2, + debtorsmaster.address3, + debtorsmaster.address4, + debtorsmaster.address5, + debtorsmaster.address6, + shippers.shippername, + salesorders.printedpackingslip, + salesorders.datepackingslipprinted, + locations.locationname + FROM salesorders, + debtorsmaster, + shippers, + locations + WHERE salesorders.debtorno=debtorsmaster.debtorno + AND salesorders.shipvia=shippers.shipper_id + AND salesorders.fromstkloc=locations.loccode + AND salesorders.fromstkloc='".$_POST['loccode']."' + AND salesorders.deliverydate='" . FormatDateForSQL($_POST['TransDate'])."'"; +} + +if (isset($_POST['TransDate']) or (isset($_GET['TransNo']) and $_GET['TransNo'] != 'Preview')) { + $result=DB_query($sql,$db, $ErrMsg); + + /*if there are no rows, there's a problem. */ + if (DB_num_rows($result)==0){ + $title = _('Print Picking List Error'); + include('includes/header.inc'); + echo '<br>'; + prnMsg( _('Unable to Locate any orders for this criteria '), 'info'); + echo '<br><table class="selection"><tr><td> + <a href="'. $rootpath . '/PDFPickingList.php?'. SID .'">' . _('Enter Another Date') . '</a> + </td></tr></table><br>'; + include('includes/footer.inc'); + exit(); + } + + /*retrieve the order details from the database and place them in an array */ + $i=0; + while ($myrow=DB_fetch_array($result)) { + $OrdersToPick[$i]=$myrow; + $i++; + } +} else { + $OrdersToPick[0]['debtorno']=str_pad('',10,'x'); + $OrdersToPick[0]['orderno']='Preview'; + $OrdersToPick[0]['customerref']=str_pad('',20,'x'); + $OrdersToPick[0]['comments']=str_pad('',100,'x'); + $OrdersToPick[0]['orddate']='1900-00-01'; + $OrdersToPick[0]['deliverto']=str_pad('',20,'x'); + $OrdersToPick[0]['deladd1']=str_pad('',20,'x'); + $OrdersToPick[0]['deladd2']=str_pad('',20,'x'); + $OrdersToPick[0]['deladd3']=str_pad('',20,'x'); + $OrdersToPick[0]['deladd4']=str_pad('',20,'x'); + $OrdersToPick[0]['deladd5']=str_pad('',20,'x'); + $OrdersToPick[0]['deladd6']=str_pad('',20,'x'); + $OrdersToPick[0]['deliverblind']=str_pad('',20,'x'); + $OrdersToPick[0]['deliverydate']='1900-00-01'; + $OrdersToPick[0]['name']=str_pad('',20,'x'); + $OrdersToPick[0]['address1']=str_pad('',20,'x'); + $OrdersToPick[0]['address2']=str_pad('',20,'x'); + $OrdersToPick[0]['address3']=str_pad('',20,'x'); + $OrdersToPick[0]['address4']=str_pad('',20,'x'); + $OrdersToPick[0]['address5']=str_pad('',20,'x'); + $OrdersToPick[0]['address6']=str_pad('',20,'x'); + $OrdersToPick[0]['shippername']=str_pad('',20,'x'); + $OrdersToPick[0]['printedpackingslip']=str_pad('',20,'x'); + $OrdersToPick[0]['datepackingslipprinted']='1900-00-01'; + $OrdersToPick[0]['locationname']=str_pad('',15,'x'); +} +/* Then there's an order to print and its not been printed already (or its been flagged for reprinting/ge_Width=807; +) +LETS GO */ + +if ($OrdersToPick[0]['orderno']=='Preview') { + $FormDesign = simplexml_load_file(sys_get_temp_dir().'/PickingList.xml'); +} else { + $FormDesign = simplexml_load_file($PathPrefix.'companies/'.$_SESSION['DatabaseName'].'/FormDesigns/PickingList.xml'); +} + +$PaperSize = $FormDesign->PaperSize; +include('includes/PDFStarter.php'); +$pdf->addInfo('Title', _('Picking List') ); +$pdf->addInfo('Subject', _('Laser Picking List') ); +$FontSize=12; +$ListCount = 0; // UldisN +$Copy=''; + +$line_height=$FormDesign->LineHeight; + +for ($i=0;$i<sizeof($OrdersToPick);$i++){ +/*Cycle through each of the orders to pick */ + if ($i>0) { + $pdf->newPage(); + } + + /* Now ... Has the order got any line items still outstanding to be picked */ + + $PageNumber = 1; + + if (isset($_POST['TransDate']) or (isset($_GET['TransNo']) and $_GET['TransNo'] != 'Preview')) { + $ErrMsg = _('There was a problem retrieving the order line details for Order Number') . ' ' . + $OrdersToPick[$i]['orderno'] . ' ' . _('from the database'); + + /* Are there any picking lists for this order already */ + $sql='SELECT COUNT(orderno) + FROM pickinglists + WHERE orderno='.$OrdersToPick[$i]['orderno']; + $countresult=DB_query($sql, $db); + $count=DB_fetch_row($countresult); + if ($count[0]==0) { + /* There are no previous picking lists for this order */ + $sql = "SELECT salesorderdetails.stkcode, + stockmaster.description, + salesorderdetails.orderlineno, + salesorderdetails.quantity, + salesorderdetails.qtyinvoiced, + salesorderdetails.unitprice, + salesorderdetails.narrative + FROM salesorderdetails + INNER JOIN stockmaster + ON salesorderdetails.stkcode=stockmaster.stockid + WHERE salesorderdetails.orderno=" . $OrdersToPick[$i]['orderno'] ;; + } else { + /* There are previous picking lists for this order so + * need to take those quantities into account + */ + $sql = "SELECT salesorderdetails.stkcode, + stockmaster.description, + salesorderdetails.orderlineno, + salesorderdetails.quantity, + salesorderdetails.qtyinvoiced, + SUM(pickinglistdetails.qtyexpected) as qtyexpected, + SUM(pickinglistdetails.qtypicked) as qtypicked, + salesorderdetails.unitprice, + salesorderdetails.narrative + FROM salesorderdetails + INNER JOIN stockmaster + ON salesorderdetails.stkcode=stockmaster.stockid + LEFT JOIN pickinglists + ON salesorderdetails.orderno=pickinglists.orderno + LEFT JOIN pickinglistdetails + ON pickinglists.pickinglistno=pickinglistdetails.pickinglistno + WHERE salesorderdetails.orderno=" . $OrdersToPick[$i]['orderno'] ." + AND salesorderdetails.orderlineno=pickinglistdetails.orderlineno"; + } + $lineresult=DB_query($sql,$db, $ErrMsg); + } + + if ((isset($_GET['TransNo']) and $_GET['TransNo'] == 'Preview') or (isset($lineresult) and DB_num_rows($lineresult)>0)){ + /*Yes there are line items to start the ball rolling with a page header */ + include('includes/PDFPickingListHeader.inc'); + if (isset($_POST['TransDate']) or (isset($_GET['TransNo']) and $_GET['TransNo'] != 'Preview')) { + $LinesToShow=DB_num_rows($lineresult); + $PickingListNo = GetNextTransNo(19, $db); + $sql='INSERT INTO pickinglists + VALUES ('. + $PickingListNo .','. + $OrdersToPick[$i]['orderno'].',"'. + FormatDateForSQL($_POST['TransDate']).'","'. + date('Y-m-d').'", + "0000-00-00")'; + $headerresult=DB_query($sql, $db); + } else { + $LinesToShow=1; + } + $YPos=$FormDesign->Data->y; + $Lines=0; + + while ($Lines<$LinesToShow){ + if (isset($_GET['TransNo']) and $_GET['TransNo'] == 'Preview') { + $myrow2['stkcode']=str_pad('',10,'x'); + $DisplayQty='XXXX.XX'; + $DisplayPrevDel='XXXX.XX'; + $DisplayQtySupplied='XXXX.XX'; + $myrow2['description']=str_pad('',18,'x'); + $myrow2['narrative']=str_pad('',18,'x'); + $itemdesc = $myrow2['description'] . ' - ' . $myrow2['narrative']; + } else { + $myrow2=DB_fetch_array($lineresult); + if ($count[0]==0) { + $myrow2['qtyexpected']=0; + $myrow2['qtypicked']=0; + } + $DisplayQty = number_format($myrow2['quantity'],2); + $DisplayPrevDel = number_format($myrow2['qtyinvoiced'],2); + $DisplayQtySupplied = number_format($myrow2['quantity'] - $myrow2['qtyinvoiced']-$myrow2['qtyexpected']-$myrow2['qtypicked'],2); + $itemdesc = $myrow2['description'] . ' - ' . $myrow2['narrative']; + $sql='INSERT INTO pickinglistdetails + VALUES('. + $PickingListNo .','. + $Lines.','. + $myrow2['orderlineno'].','. + $DisplayQtySupplied.',0)'; + $lineresult=DB_query($sql, $db); + } + $ListCount ++; + + $LeftOvers = $pdf->addTextWrap($FormDesign->Headings->Column1->x,$Page_Height - $YPos,$FormDesign->Headings->Column1->Length,$FormDesign->Headings->Column1->FontSize,$myrow2['stkcode'],'left'); + $LeftOvers = $pdf->addTextWrap($FormDesign->Headings->Column2->x,$Page_Height - $YPos,$FormDesign->Headings->Column2->Length,$FormDesign->Headings->Column2->FontSize,$itemdesc); + $LeftOvers = $pdf->addTextWrap($FormDesign->Headings->Column3->x,$Page_Height - $YPos,$FormDesign->Headings->Column3->Length,$FormDesign->Headings->Column3->FontSize,$DisplayQty,'right'); + $LeftOvers = $pdf->addTextWrap($FormDesign->Headings->Column4->x,$Page_Height - $YPos,$FormDesign->Headings->Column4->Length,$FormDesign->Headings->Column4->FontSize,$DisplayQtySupplied,'right'); + $LeftOvers = $pdf->addTextWrap($FormDesign->Headings->Column5->x,$Page_Height - $YPos,$FormDesign->Headings->Column5->Length,$FormDesign->Headings->Column5->FontSize,$DisplayPrevDel,'right'); + + if ($Page_Height-$YPos-$line_height <= 50){ + /* We reached the end of the page so finsih off the page and start a newy */ + $PageNumber++; + include ('includes/PDFPickingListHeader.inc'); + } //end if need a new page headed up + else{ + /*increment a line down for the next line item */ + $YPos += ($line_height); + } + $Lines++; + } //end while there are line items to print out + + } /*end if there are order details to show on the order*/ +} /*end for loop to print the whole lot twice */ + +if ($ListCount == 0){ + $title = _('Print Picking List Error'); + include('includes/header.inc'); + include('includes/footer.inc'); + exit; +} else { + $pdf->OutputD($_SESSION['DatabaseName'] . '_PickingLists_' . date('Y-m-d') . '.pdf');//UldisN + $pdf->__destruct(); //UldisN +} +?> \ No newline at end of file Property changes on: trunk/PDFPickingList.php ___________________________________________________________________ Added: svn:keywords + Id Added: trunk/companies/weberpdemo/FormDesigns/PickingList.xml =================================================================== --- trunk/companies/weberpdemo/FormDesigns/PickingList.xml (rev 0) +++ trunk/companies/weberpdemo/FormDesigns/PickingList.xml 2010-05-02 11:55:23 UTC (rev 3439) @@ -0,0 +1,321 @@ +<?xml version="1.0" encoding="UTF-8"?> +<form name="Picking List"> + <PaperSize name="Paper size">A4_Landscape</PaperSize> + <LineHeight name="Line height">12</LineHeight> + <logo type="image" name="Logo" id="Logo"> + <x>281</x> + <y>65</y> + <width>0</width> + <height>60</height> + </logo> + <Heading type="SimpleText" name="Heading" id="Heading"> + <FontSize>18</FontSize> + <x>341</x> + <y>80</y> + </Heading> + <HeadingLine2 type="SimpleText" name="Heading Line 2" id="HeadingLine2"> + <FontSize>18</FontSize> + <x>251</x> + <y>100</y> + </HeadingLine2> + <CompanyName type="SimpleText" name="Company name" id="CompanyName"> + <FontSize>10</FontSize> + <x>340</x> + <y>120</y> + </CompanyName> + <CompanyAddress type="ElementArray" name="Company address"> + <Line1 type="SimpleText" name="Line 1" id="CompanyAddress1"> + <FontSize>10</FontSize> + <x>340</x> + <y>130</y> + </Line1> + <Line2 type="SimpleText" name="Line 2" id="CompanyAddress2"> + <FontSize>10</FontSize> + <x>340</x> + <y>140</y> + </Line2> + <Line3 type="SimpleText" name="Line 3" id="CompanyAddress3"> + <FontSize>10</FontSize> + <x>340</x> + <y>150</y> + </Line3> + <Line4 type="SimpleText" name="Line 4" id="CompanyAddress4"> + <FontSize>10</FontSize> + <x>340</x> + <y>160</y> + </Line4> + <Line5 type="SimpleText" name="Line 5" id="CompanyAddress5"> + <FontSize>10</FontSize> + <x>340</x> + <y>170</y> + </Line5> + </CompanyAddress> + <CompanyPhone type="SimpleText" name="Company phone number" id="CompanyPhone"> + <FontSize>10</FontSize> + <x>340</x> + <y>180</y> + </CompanyPhone> + <CompanyFax type="SimpleText" name="Company fax number" id="CompanyFax"> + <FontSize>10</FontSize> + <x>340</x> + <y>190</y> + </CompanyFax> + <CompanyEmail type="SimpleText" name="Company email address" id="CompanyEmail"> + <FontSize>10</FontSize> + <x>340</x> + <y>200</y> + </CompanyEmail> + <DeliveryAddress type="ElementArray" name="Delivery address"> + <Caption type="SimpleText" name="Caption" id="DeliveryAddressCaption"> + <FontSize>14</FontSize> + <x>46</x> + <y>26</y> + </Caption> + <Line1 type="SimpleText" name="Line 1" id="DeliveryAddress1"> + <FontSize>12</FontSize> + <x>46</x> + <y>42</y> + </Line1> + <Line2 type="SimpleText" name="Line 2" id="DeliveryAddress2"> + <FontSize>12</FontSize> + <x>46</x> + <y>56</y> + </Line2> + <Line3 type="SimpleText" name="Line 3" id="DeliveryAddress3"> + <FontSize>12</FontSize> + <x>46</x> + <y>70</y> + </Line3> + <Line4 type="SimpleText" name="Line 4" id="DeliveryAddress4"> + <FontSize>12</FontSize> + <x>46</x> + <y>84</y> + </Line4> + <Line5 type="SimpleText" name="Line 5" id="DeliveryAddress5"> + <FontSize>12</FontSize> + <x>46</x> + <y>98</y> + </Line5> + </DeliveryAddress> + <CustomerAddress type="ElementArray" name="Delivery address"> + <Caption type="SimpleText" name="Caption" id="CustomerAddressCaption"> + <FontSize>14</FontSize> + <x>46</x> + <y>119</y> + </Caption> + <Name type="SimpleText" name="Name" id="Name"> + <FontSize>12</FontSize> + <x>46</x> + <y>133</y> + </Name> + <Line1 type="SimpleText" name="Line 1" id="CustomerAddress1"> + <FontSize>12</FontSize> + <x>46</x> + <y>147</y> + </Line1> + <Line2 type="SimpleText" name="Line 2" id="CustomerAddress2"> + <FontSize>12</FontSize> + <x>46</x> + <y>161</y> + </Line2> + <Line3 type="SimpleText" name="Line 3" id="CustomerAddress3"> + <FontSize>12</FontSize> + <x>46</x> + <y>175</y> + </Line3> + <Line4 type="SimpleText" name="Line 4" id="CustomerAddress4"> + <FontSize>12</FontSize> + <x>46</x> + <y>189</y> + </Line4> + <Line5 type="SimpleText" name="Line 5" id="CustomerAddress5"> + <FontSize>12</FontSize> + <x>46</x> + <y>203</y> + </Line5> + </CustomerAddress> + <OrderNumberCaption type="SimpleText" name="Order Number Caption" id="OrderNumberCaption"> + <FontSize>12</FontSize> + <x>620</x> + <y>35</y> + </OrderNumberCaption> + <OrderNumber type="SimpleText" name="Order Number" id="OrderNumber"> + <FontSize>12</FontSize> + <x>700</x> + <y>35</y> + </OrderNumber> + <DeliveryDateCaption type="SimpleText" name="Delivery Date Caption" id="DeliveryDateCaption"> + <FontSize>12</FontSize> + <x>620</x> + <y>49</y> + </DeliveryDateCaption> + <DeliveryDate type="SimpleText" name="Delivery Date" id="DeliveryDate"> + <FontSize>12</FontSize> + <x>700</x> + <y>49</y> + </DeliveryDate> + <DatePrintedCaption type="SimpleText" name="Date Printed Caption" id="DatePrintedCaption"> + <FontSize>12</FontSize> + <x>620</x> + <y>63</y> + </DatePrintedCaption> + <DatePrinted type="SimpleText" name="Date Printed" id="DatePrinted"> + <FontSize>12</FontSize> + <x>700</x> + <y>63</y> + </DatePrinted> + <CustomerCode type="SimpleText" name="Customer Code" id="CustomerCode"> + <FontSize>12</FontSize> + <x>620</x> + <y>83</y> + </CustomerCode> + <ShipperCode type="SimpleText" name="Shipper Code" id="ShipperCode"> + <FontSize>12</FontSize> + <x>620</x> + <y>97</y> + </ShipperCode> + <Comments type="MultiLineText" name="Comments" id="Comments"> + <FontSize>12</FontSize> + <x>620</x> + <y>117</y> + <Length>125</Length> + </Comments> + <PageNumberCaption type="SimpleText" name="Page Number Caption" id="PageNumberCaption"> + <FontSize>12</FontSize> + <x>620</x> + <y>173</y> + </PageNumberCaption> + <PageNumber type="SimpleText" name="Page Number" id="PageNumber"> + <FontSize>12</FontSize> + <x>700</x> + <y>173</y> + </PageNumber> + <Headings type="ElementArray" name="Column headings"> + <Column1 type="MultiLineText" name="Heading 1" id="Heading1"> + <FontSize>12</FontSize> + <x>25</x> + <y>228</y> + <Length>127</Length> + </Column1> + <Column2 type="MultiLineText" name="Heading 2" id="Heading2"> + <FontSize>12</FontSize> + <x>147</x> + <y>228</y> + <Length>255</Length> + </Column2> + <Column3 type="MultiLineText" name="Heading 3" id="Heading3"> + <FontSize>12</FontSize> + <x>400</x> + <y>228</y> + <Length>85</Length> + </Column3> + <Column4 type="MultiLineText" name="Heading 4" id="Heading4"> + <FontSize>12</FontSize> + <x>503</x> + <y>228</y> + <Length>85</Length> + </Column4> + <Column5 type="MultiLineText" name="Heading 5" id="Heading5"> + <FontSize>12</FontSize> + <x>602</x> + <y>228</y> + <Length>85</Length> + </Column5> + <Column6 type="MultiLineText" name="Heading 6" id="Heading6"> + <FontSize>12</FontSize> + <x>700</x> + <y>228</y> + <Length>85</Length> + </Column6> + </Headings> + <Data type="ElementArray" name="Column Data"> + <y type="StartLine" name="Y co-ordinate of first data line" id="DataStartLine">260</y> + <Column1 type="DataText" name="Heading 1" id="Heading1"> + <FontSize>12</FontSize> + <x>25</x> + <Length>127</Length> + </Column1> + <Column2 type="DataText" name="Heading 2" id="Heading2"> + <FontSize>12</FontSize> + <x>147</x> + <Length>255</Length> + </Column2> + <Column3 type="DataText" name="Heading 3" id="Heading3"> + <FontSize>12</FontSize> + <x>400</x> + <Length>85</Length> + </Column3> + <Column4 type="DataText" name="Heading 4" id="Heading4"> + <FontSize>12</FontSize> + <x>503</x> + <Length>85</Length> + </Column4> + <Column5 type="DataText" name="Heading 5" id="Heading5"> + <FontSize>12</FontSize> + <x>602</x> + <Length>85</Length> + </Column5> + <Column6 type="DataText" name="Heading 6" id="Heading6"> + <FontSize>12</FontSize> + <x>700</x> + <Length>85</Length> + </Column6> + </Data> + <DeliveryAddressBox type="CurvedRectangle" name="Delivery Address Box" id="DeliveryAddressBox"> + <x>40</x> + <y>22</y> + <width>180</width> + <height>70</height> + <radius>10</radius> + </DeliveryAddressBox> + <CustomerAddressBox type="CurvedRectangle" name="Customer Address Box" id="CustomerAddressBox"> + <x>40</x> + <y>116</y> + <width>200</width> + <height>80</height> + <radius>10</radius> + </CustomerAddressBox> + <DataBox type="CurvedRectangle" name="Data Box" id="DataBox"> + <x>20</x> + <y>226</y> + <width>792</width> + <height>350</height> + <radius>10</radius> + </DataBox> + <LineBelowColumns type="Line" name="Line Below Columns" id="LineBelowColumns"> + <startx>20</startx> + <starty>236</starty> + <endx>822</endx> + <endy>236</endy> + </LineBelowColumns> + <ColumnLine1 type="Line" name="Column Line 1" id="ColumnLine1"> + <startx>140</startx> + <starty>216</starty> + <endx>140</endx> + <endy>586</endy> + </ColumnLine1> + <ColumnLine2 type="Line" name="Column Line 2" id="ColumnLine2"> + <startx>395</startx> + <starty>216</starty> + <endx>395</endx> + <endy>586</endy> + </ColumnLine2> + <ColumnLine3 type="Line" name="Column Line 3" id="ColumnLine3"> + <startx>500</startx> + <starty>216</starty> + <endx>500</endx> + <endy>586</endy> + </ColumnLine3> + <ColumnLine4 type="Line" name="Column Line 4" id="ColumnLine4"> + <startx>600</startx> + <starty>216</starty> + <endx>600</endx> + <endy>586</endy> + </ColumnLine4> + <ColumnLine5 type="Line" name="Column Line 5" id="ColumnLine5"> + <startx>690</startx> + <starty>216</starty> + <endx>690</endx> + <endy>586</endy> + </ColumnLine5> +</form> \ No newline at end of file Property changes on: trunk/companies/weberpdemo/FormDesigns/PickingList.xml ___________________________________________________________________ Added: svn:keywords + Id Modified: trunk/css/silverwolf/default.css =================================================================== --- trunk/css/silverwolf/default.css 2010-05-02 10:25:49 UTC (rev 3438) +++ trunk/css/silverwolf/default.css 2010-05-02 11:55:23 UTC (rev 3439) @@ -87,6 +87,7 @@ table.selection { background-color:#eee; outline-style:solid; + outline-color: #8e8a8a; outline-width:1px; } Modified: trunk/doc/Change.log.html =================================================================== --- trunk/doc/Change.log.html 2010-05-02 10:25:49 UTC (rev 3438) +++ trunk/doc/Change.log.html 2010-05-02 11:55:23 UTC (rev 3439) @@ -1,5 +1,6 @@ <p><font SIZE=4 COLOR=BLUE><b>webERP Change Log</b></font></p> <p></p> +<p>02/05/10 Tim: Add picking list printing</p> <p>02/05/10 Tim: Updates for case where no internet connection is present</p> <p>02/05/10 Tim: SelectProduct.php - Correctly show the next page of products in a search.</p> <p>01/05/10 Lindsay: Install now includes an option to install a logo.jpg file</p> Added: trunk/includes/PDFPickingListHeader.inc =================================================================== --- trunk/includes/PDFPickingListHeader.inc (rev 0) +++ trunk/includes/PDFPickingListHeader.inc 2010-05-02 11:55:23 UTC (rev 3439) @@ -0,0 +1,90 @@ +<?php +/* $Id$*/ +/* pdf-php by R&OS code to set up a new sales order page */ +if ($PageNumber>1){ + $pdf->newPage(); +} + +/* if the deliver blind flag is set on the order, we do not want to output +the company logo */ +$pdf->addJpegFromFile($_SESSION['LogoFile'],$FormDesign->logo->x,$Page_Height-$FormDesign->logo->y,$FormDesign->logo->width,$FormDesign->logo->height); + +$pdf->addText($FormDesign->Heading->x, $Page_Height-$FormDesign->Heading->y,$FormDesign->Heading->FontSize, _('Picking List') ); +$pdf->addText($FormDesign->HeadingLine2->x, $Page_Height-$FormDesign->HeadingLine2->y,$FormDesign->HeadingLine2->FontSize, _('From').' '.$OrdersToPick[$i]['locationname'].' '. _('Warehouse')); + +/* if the deliver blind flag is set on the order, we do not want to output +the company contact info */ +$pdf->addText($FormDesign->CompanyName->x,$Page_Height - $FormDesign->CompanyName->y, $FormDesign->CompanyName->FontSize, $_SESSION['CompanyRecord']['coyname']); +$pdf->addText($FormDesign->CompanyAddress->Line1->x,$Page_Height - $FormDesign->CompanyAddress->Line1->y, $FormDesign->CompanyAddress->Line1->FontSize, $_SESSION['CompanyRecord']['regoffice1']); +$pdf->addText($FormDesign->CompanyAddress->Line2->x,$Page_Height - $FormDesign->CompanyAddress->Line2->y, $FormDesign->CompanyAddress->Line2->FontSize, $_SESSION['CompanyRecord']['regoffice2']); +$pdf->addText($FormDesign->CompanyAddress->Line3->x,$Page_Height - $FormDesign->CompanyAddress->Line3->y, $FormDesign->CompanyAddress->Line3->FontSize, $_SESSION['CompanyRecord']['regoffice3']); +$pdf->addText($FormDesign->CompanyAddress->Line4->x,$Page_Height - $FormDesign->CompanyAddress->Line4->y, $FormDesign->CompanyAddress->Line4->FontSize, $_SESSION['CompanyRecord']['regoffice4']); +$pdf->addText($FormDesign->CompanyAddress->Line5->x,$Page_Height - $FormDesign->CompanyAddress->Line5->y, $FormDesign->CompanyAddress->Line5->FontSize, $_SESSION['CompanyRecord']['regoffice5']); +$pdf->addText($FormDesign->CompanyPhone->x,$Page_Height - $FormDesign->CompanyPhone->y, $FormDesign->CompanyPhone->FontSize, _('Tel'). ': ' . $_SESSION['CompanyRecord']['telephone']); +$pdf->addText($FormDesign->CompanyFax->x,$Page_Height - $FormDesign->CompanyFax->y, $FormDesign->CompanyFax->FontSize, _('Fax').': ' . $_SESSION['CompanyRecord']['fax']); +$pdf->addText($FormDesign->CompanyEmail->x,$Page_Height - $FormDesign->CompanyEmail->y, $FormDesign->CompanyEmail->FontSize, _('Email'). ': ' .$_SESSION['CompanyRecord']['email']); + +/*Now the delivery details */ +$pdf->addText($FormDesign->DeliveryAddress->Caption->x,$Page_Height - $FormDesign->DeliveryAddress->Caption->y, $FormDesign->DeliveryAddress->Caption->FontSize, _('Deliver To') . ':' ); +$pdf->addText($FormDesign->DeliveryAddress->Line1->x,$Page_Height - $FormDesign->DeliveryAddress->Line1->y, $FormDesign->DeliveryAddress->Line1->FontSize, $OrdersToPick[$i]['deladd1']); +$pdf->addText($FormDesign->DeliveryAddress->Line2->x,$Page_Height - $FormDesign->DeliveryAddress->Line2->y, $FormDesign->DeliveryAddress->Line2->FontSize, $OrdersToPick[$i]['deladd2']); +$pdf->addText($FormDesign->DeliveryAddress->Line3->x,$Page_Height - $FormDesign->DeliveryAddress->Line3->y, $FormDesign->DeliveryAddress->Line3->FontSize, $OrdersToPick[$i]['deladd3']); +$pdf->addText($FormDesign->DeliveryAddress->Line4->x,$Page_Height - $FormDesign->DeliveryAddress->Line4->y, $FormDesign->DeliveryAddress->Line4->FontSize, $OrdersToPick[$i]['deladd4']); +$pdf->addText($FormDesign->DeliveryAddress->Line5->x,$Page_Height - $FormDesign->DeliveryAddress->Line5->y, $FormDesign->DeliveryAddress->Line5->FontSize, $OrdersToPick[$i]['deladd5']); + +/*Now the customer details */ +$pdf->addText($FormDesign->CustomerAddress->Caption->x,$Page_Height - $FormDesign->CustomerAddress->Caption->y, $FormDesign->CustomerAddress->Caption->FontSize, _('Customer') . ':' ); +$pdf->addText($FormDesign->CustomerAddress->Name->x,$Page_Height - $FormDesign->CustomerAddress->Name->y, $FormDesign->CustomerAddress->Name->FontSize, $OrdersToPick[$i]['name']); +$pdf->addText($FormDesign->CustomerAddress->Line1->x,$Page_Height - $FormDesign->CustomerAddress->Line1->y, $FormDesign->CustomerAddress->Line1->FontSize, $OrdersToPick[$i]['address1']); +$pdf->addText($FormDesign->CustomerAddress->Line2->x,$Page_Height - $FormDesign->CustomerAddress->Line2->y, $FormDesign->CustomerAddress->Line2->FontSize, $OrdersToPick[$i]['address2']); +$pdf->addText($FormDesign->CustomerAddress->Line3->x,$Page_Height - $FormDesign->CustomerAddress->Line3->y, $FormDesign->CustomerAddress->Line3->FontSize, $OrdersToPick[$i]['address3']); +$pdf->addText($FormDesign->CustomerAddress->Line4->x,$Page_Height - $FormDesign->CustomerAddress->Line4->y, $FormDesign->CustomerAddress->Line4->FontSize, $OrdersToPick[$i]['address4']); +$pdf->addText($FormDesign->CustomerAddress->Line5->x,$Page_Height - $FormDesign->CustomerAddress->Line5->y, $FormDesign->CustomerAddress->Line5->FontSize, $OrdersToPick[$i]['address5']); + +$pdf->addText($FormDesign->OrderNumberCaption->x,$Page_Height - $FormDesign->OrderNumberCaption->y, $FormDesign->OrderNumberCaption->FontSize, _('Order No'). ':'); +$pdf->addText($FormDesign->OrderNumber->x,$Page_Height - $FormDesign->OrderNumber->y, $FormDesign->OrderNumber->FontSize, $OrdersToPick[$i]['orderno']); +$pdf->addText($FormDesign->DeliveryDateCaption->x,$Page_Height - $FormDesign->DeliveryDateCaption->y, $FormDesign->DeliveryDateCaption->FontSize, _('Delivery Date'). ':'); +$pdf->addText($FormDesign->DeliveryDate->x,$Page_Height - $FormDesign->DeliveryDate->y, $FormDesign->DeliveryDate->FontSize, ConvertSQLDate($OrdersToPick[$i]['deliverydate'])); +$pdf->addText($FormDesign->DatePrintedCaption->x,$Page_Height - $FormDesign->DatePrintedCaption->y, $FormDesign->DatePrintedCaption->FontSize, _('Printed') . ': '); +$pdf->addText($FormDesign->DatePrinted->x,$Page_Height - $FormDesign->DatePrinted->y, $FormDesign->DatePrinted->FontSize, Date($_SESSION['DefaultDateFormat'])); + +$pdf->addText($FormDesign->CustomerCode->x,$Page_Height - $FormDesign->CustomerCode->y, $FormDesign->CustomerCode->FontSize, _('Customer No.'). ' : ' . $OrdersToPick[$i]['debtorno']); +$pdf->addText($FormDesign->ShipperCode->x,$Page_Height - $FormDesign->ShipperCode->y, $FormDesign->ShipperCode->FontSize, _('Shipped by'). ' : ' . $OrdersToPick[$i]['shippername']); + +$LeftOvers = $pdf->addTextWrap($FormDesign->Comments->x,$Page_Height - $FormDesign->Comments->y, $FormDesign->Comments->Length, $FormDesign->Comments->FontSize,stripcslashes($OrdersToPick[$i]['comments'])); + +if (strlen($LeftOvers)>1){ + $LeftOvers = $pdf->addTextWrap($FormDesign->Comments->x,$Page_Height - $FormDesign->Comments->y-14, $FormDesign->Comments->Length, $FormDesign->Comments->FontSize,$LeftOvers); + if (strlen($LeftOvers)>1){ + $LeftOvers = $pdf->addTextWrap($FormDesign->Comments->x,$Page_Height - $FormDesign->Comments->y-28, $FormDesign->Comments->Length, $FormDesign->Comments->FontSize,$LeftOvers); + if (strlen($LeftOvers)>1){ + $LeftOvers = $pdf->addTextWrap($FormDesign->Comments->x,$Page_Height - $FormDesign->Comments->y-42, $FormDesign->Comments->Length, $FormDesign->Comments->FontSize,$LeftOvers); + if (strlen($LeftOvers)>1){ + $LeftOvers = $pdf->addTextWrap($FormDesign->Comments->x,$Page_Height - $FormDesign->Comments->y-56, $FormDesign->Comments->Length, $FormDesign->Comments->FontSize,$LeftOvers); + } + } + } +} + +$pdf->addText($FormDesign->PageNumberCaption->x,$Page_Height - $FormDesign->PageNumberCaption->y, $FormDesign->PageNumberCaption->FontSize, _('Page'). ':'); +$pdf->addText($FormDesign->PageNumber->x,$Page_Height - $FormDesign->PageNumber->y, $FormDesign->PageNumber->FontSize, $PageNumber); + +$LeftOvers = $pdf->addTextWrap($FormDesign->Headings->Column1->x,$Page_Height - $FormDesign->Headings->Column1->y,$FormDesign->Headings->Column1->Length , $FormDesign->Headings->Column1->FontSize, _('Item Code'),'left'); +$LeftOvers = $pdf->addTextWrap($FormDesign->Headings->Column2->x,$Page_Height - $FormDesign->Headings->Column2->y,$FormDesign->Headings->Column2->Length , $FormDesign->Headings->Column2->FontSize, _('Item Description'),'left'); +$LeftOvers = $pdf->addTextWrap($FormDesign->Headings->Column3->x,$Page_Height - $FormDesign->Headings->Column3->y,$FormDesign->Headings->Column3->Length , $FormDesign->Headings->Column3->FontSize, _('Quantity'),'right'); +$LeftOvers = $pdf->addTextWrap($FormDesign->Headings->Column4->x,$Page_Height - $FormDesign->Headings->Column4->y,$FormDesign->Headings->Column4->Length , $FormDesign->Headings->Column4->FontSize,_('This Del'),'right'); +$LeftOvers = $pdf->addTextWrap($FormDesign->Headings->Column5->x,$Page_Height - $FormDesign->Headings->Column5->y,$FormDesign->Headings->Column5->Length , $FormDesign->Headings->Column5->FontSize, _('Prev Dels'),'right'); +$LeftOvers = $pdf->addTextWrap($FormDesign->Headings->Column6->x,$Page_Height - $FormDesign->Headings->Column6->y,$FormDesign->Headings->Column6->Length , $FormDesign->Headings->Column6->FontSize, _('Actual Picked'),'right'); + +$pdf->RoundRectangle($FormDesign->DeliveryAddressBox->x, $Page_Height - $FormDesign->DeliveryAddressBox->y,$FormDesign->DeliveryAddressBox->width, $FormDesign->DeliveryAddressBox->height, $FormDesign->DeliveryAddressBox->radius); +$pdf->RoundRectangle($FormDesign->CustomerAddressBox->x, $Page_Height - $FormDesign->CustomerAddressBox->y,$FormDesign->CustomerAddressBox->width, $FormDesign->CustomerAddressBox->height, $FormDesign->CustomerAddressBox->radius); +$pdf->RoundRectangle($FormDesign->DataBox->x, $Page_Height - $FormDesign->DataBox->y,$FormDesign->DataBox->width, $FormDesign->DataBox->height, $FormDesign->DataBox->radius); + +$pdf->line($FormDesign->LineBelowColumns->startx, $Page_Height -$FormDesign->LineBelowColumns->starty,$FormDesign->LineBelowColumns->endx, $Page_Height -$FormDesign->LineBelowColumns->endy); +$pdf->line($FormDesign->ColumnLine1->startx, $Page_Height -$FormDesign->ColumnLine1->starty,$FormDesign->ColumnLine1->endx, $Page_Height -$FormDesign->ColumnLine1->endy); +$pdf->line($FormDesign->ColumnLine2->startx, $Page_Height -$FormDesign->ColumnLine2->starty,$FormDesign->ColumnLine2->endx, $Page_Height -$FormDesign->ColumnLine2->endy); +$pdf->line($FormDesign->ColumnLine3->startx, $Page_Height -$FormDesign->ColumnLine3->starty,$FormDesign->ColumnLine3->endx, $Page_Height -$FormDesign->ColumnLine3->endy); +$pdf->line($FormDesign->ColumnLine4->startx, $Page_Height -$FormDesign->ColumnLine4->starty,$FormDesign->ColumnLine4->endx, $Page_Height -$FormDesign->ColumnLine4->endy); +$pdf->line($FormDesign->ColumnLine5->startx, $Page_Height -$FormDesign->ColumnLine5->starty,$FormDesign->ColumnLine5->endx, $Page_Height -$FormDesign->ColumnLine5->endy); + +?> \ No newline at end of file Property changes on: trunk/includes/PDFPickingListHeader.inc ___________________________________________________________________ Added: svn:keywords + Id Modified: trunk/index.php =================================================================== --- trunk/index.php 2010-05-02 10:25:49 UTC (rev 3438) +++ trunk/index.php 2010-05-02 11:55:23 UTC (rev 3439) @@ -109,7 +109,7 @@ </tr> <tr> <td class="menu_group_item"> - <?php echo '<p>• <a href="' . $rootpath . '/PDFPickingList.php?' .sid . '&NewOrder=Yes">' . _('Print Picking Lists') . '</a></p>'; ?> + <?php echo '<p>• <a href="' . $rootpath . '/PDFPickingList.php?' .sid . '">' . _('Print Picking Lists') . '</a></p>'; ?> </td> </tr> <tr> Modified: trunk/sql/mysql/upgrade3.11.1-3.12.sql =================================================================== --- trunk/sql/mysql/upgrade3.11.1-3.12.sql 2010-05-02 10:25:49 UTC (rev 3438) +++ trunk/sql/mysql/upgrade3.11.1-3.12.sql 2010-05-02 11:55:23 UTC (rev 3439) @@ -132,6 +132,27 @@ INSERT INTO `config` (`confname`, `confvalue`) VALUES ('RequirePickingNote',0); +CREATE TABLE IF NOT EXISTS `pickinglists` ( + `pickinglistno` int(11) NOT NULL DEFAULT 0, + `orderno` int(11) NOT NULL DEFAULT 0, + `pickinglistdate` date NOT NULL default '0000-00-00', + `dateprinted` date NOT NULL default '0000-00-00', + `deliverynotedate` date NOT NULL default '0000-00-00', + CONSTRAINT `pickinglists_ibfk_1` FOREIGN KEY (`orderno`) REFERENCES `salesorders` (`orderno`), + PRIMARY KEY (`pickinglistno`) +) ENGINE=InnoDB DEFAULT CHARSET=utf8; + +CREATE TABLE IF NOT EXISTS `pickinglistdetails` ( + `pickinglistno` int(11) NOT NULL DEFAULT 0, + `pickinglistlineno` int(11) NOT NULL DEFAULT 0, + `orderlineno` int(11) NOT NULL DEFAULT 0, + `qtyexpected` double NOT NULL default 0.00, + `qtypicked` double NOT NULL default 0.00, + CONSTRAINT `pickinglistdetails_ibfk_1` FOREIGN KEY (`pickinglistno`) REFERENCES `pickinglists` (`pickinglistno`), + PRIMARY KEY (`pickinglistno`, `pickinglistlineno`) +) ENGINE=InnoDB DEFAULT CHARSET=utf8; + +INSERT INTO `systypes` VALUES(19, 'Picking List', 0); ALTER TABLE `prices` ADD `startdate` DATE NOT NULL , ADD `enddate` DATE NOT NULL DEFAULT '9999-12-31'; ALTER TABLE prices DROP PRIMARY KEY , ADD PRIMARY KEY ( `stockid` , `typeabbrev` , `currabrev` , `debtorno` , `startdate` , `enddate` ) ; This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <lin...@us...> - 2010-05-03 13:03:06
|
Revision: 3442 http://web-erp.svn.sourceforge.net/web-erp/?rev=3442&view=rev Author: lindsayh Date: 2010-05-03 13:03:00 +0000 (Mon, 03 May 2010) Log Message: ----------- Updates to installer to recover better from errors by restoring all the user selected values on the initial page when errors are discovered while processing the user's data. Modified Paths: -------------- trunk/doc/Change.log.html trunk/install/index.php trunk/install/save.php trunk/install/timezone.php Modified: trunk/doc/Change.log.html =================================================================== --- trunk/doc/Change.log.html 2010-05-03 10:04:20 UTC (rev 3441) +++ trunk/doc/Change.log.html 2010-05-03 13:03:00 UTC (rev 3442) @@ -1,5 +1,6 @@ <p><font SIZE=4 COLOR=BLUE><b>webERP Change Log</b></font></p> <p></p> +<p>03/05/10 Lindsay: More installer tweaks: better error handling</p> <p>03/05/10 Tim: PurchData.php - Do not show thousands seperator in price field</p> <p>02/05/10 Tim: Add picking list printing</p> <p>02/05/10 Tim: Updates for case where no internet connection is present</p> Modified: trunk/install/index.php =================================================================== --- trunk/install/index.php 2010-05-03 10:04:20 UTC (rev 3441) +++ trunk/install/index.php 2010-05-03 13:03:00 UTC (rev 3442) @@ -9,6 +9,8 @@ define('SESSION_STARTED', true); } +$_SESSION['MaxLogoSize'] = 10 * 1024; // Limit logo file size. + // Check if the page has been reloaded if(!isset($_GET['sessions_checked']) || $_GET['sessions_checked'] != 'true') { // Set session variable @@ -288,6 +290,7 @@ </td> <td width="180"> + <input type="hidden" name="MAX_FILE_SIZE" <?php echo "value=\"" . $_SESSION['MaxLogoSize'] . "\"" ?> /> <input type="FILE" size="50" ID="LogoFile" name="LogoFile" tabindex="53"> </td> </tr> Modified: trunk/install/save.php =================================================================== --- trunk/install/save.php 2010-05-03 10:04:20 UTC (rev 3441) +++ trunk/install/save.php 2010-05-03 13:03:00 UTC (rev 3442) @@ -10,6 +10,9 @@ session_start(); define('SESSION_STARTED', true); } +if(!isset($_SESSION['MaxLogoSize'])) { + $_SESSION['MaxLogoSize'] = 10 * 1024; // Limit logo file size. +} //deal with check boxes if(!isset($_POST['install_tables'])) { $_POST['install_tables'] = false; @@ -45,7 +48,7 @@ } else { $_SESSION['operating_system'] = $_POST['operating_system']; } - if(!isset($_POST['world_writeable'])) { + if(!isset($_POST['world_writeable'])) { $_SESSION['world_writeable'] = false; } else { $_SESSION['world_writeable'] = true; @@ -53,7 +56,9 @@ $_SESSION['database_host'] = $_POST['database_host']; $_SESSION['database_username'] = Replace_Dodgy_Characters($_POST['database_username']); $_SESSION['database_password'] = $_POST['database_password']; + $_SESSION['install_tables'] = $_POST['install_tables']; $_SESSION['database_name'] = Replace_Dodgy_Characters($_POST['company_name']); + $_SESSION['db_file'] = $_POST['DemoData'] ? 'demo' : 'not'; $_SESSION['timezone'] = $_POST['timezone']; $_SESSION['company_name'] = Replace_Dodgy_Characters($_POST['company_name']); $_SESSION['admin_email'] = $_POST['admin_email']; @@ -265,6 +270,9 @@ set_error('Please make sure you re-enter the password for the Administrator account'); } if ($_POST['admin_password'] != $_POST['admin_repassword']){ + // Zero BOTH passwords before returning form to user. + $_POST['admin_password'] = ''; + $_POST['admin_repassword'] = ''; set_error('The two Administrator account passwords you entered do not match'); } // End admin user details code @@ -274,7 +282,7 @@ // no need to bother if just setting up the demo data $CompanyDir = $path_to_root . '/companies/' . $_POST['company_name']; if ($_POST['DemoData']==false){ - $Result = mkdir($CompanyDir ); + $Result = mkdir($CompanyDir); $Result = mkdir($CompanyDir . '/part_pics'); $Result = mkdir($CompanyDir . '/EDI_Incoming_Orders'); $Result = mkdir($CompanyDir . '/reports'); @@ -284,10 +292,19 @@ $Result = mkdir($CompanyDir . '/pdf_append'); // Now have a destination to place the logo image. - if (isset($_FILES['LogoFile']) && - $_FILES['LogoFile']['error'] == UPLOAD_ERR_OK) { + if (isset($_FILES['LogoFile'])) { + if ($_FILES['LogoFile']['error'] == UPLOAD_ERR_OK) { $result = move_uploaded_file($_FILES['LogoFile']['tmp_name'], $CompanyDir . '/logo.jpg'); + } elseif ($_FILES['LogoFile']['error'] == UPLOAD_ERR_INI_SIZE || + $_FILES['LogoFile']['error'] == UPLOAD_ERR_FORM_SIZE) { + set_error( "Logo file is too big - Limit: " . $_SESSION['MaxLogoSize'] ); + } elseif ($_FILES['LogoFile']['error'] == UPLOAD_ERR_NO_FILE ) { + // No logo file, so use the default. + copy( $path_to_root . '/logo_server.jpg', $CompanyDir . '/logo.jpg'); + } else { + set_error( "Error uploading logo file" ); + } } else { // No logo file, so use the default. copy( $path_to_root . '/logo_server.jpg', $CompanyDir . '/logo.jpg'); Modified: trunk/install/timezone.php =================================================================== --- trunk/install/timezone.php 2010-05-03 10:04:20 UTC (rev 3441) +++ trunk/install/timezone.php 2010-05-03 13:03:00 UTC (rev 3442) @@ -1,44 +1,25 @@ <?php /* $Id$*/ -function stripcomma($str) { //because we're using comma as a delimiter - $str = trim($str); - $str = str_replace('"', '""', $str); - $str = str_replace("\r", "", $str); - $str = str_replace("\n", '\n', $str); - if($str == "" ) - return $str; - else - return '"'.$str.'"'; +if (isset($_SESSION['timezone']) && strlen($_SESSION['timezone']) > 0 ) { + $ltz = $_SESSION['timezone']; +} else { + $ltz = date_default_timezone_get(); } -function NULLToZero( &$Field ) { - if( is_null($Field) ) - return '0'; - else - return $Field; -} - -function NULLToPrice( &$Field ) { - if( is_null($Field) ) - return '-1'; - else - return $Field; -} - $row = 1; $handle = fopen('timezone.csv', "r"); while (($data = fgetcsv($handle, 1000, ",")) !== FALSE) { $num = count($data); $row++; - for ($c=0; $c < $num; $c++) { - $timezone=$data[$c]; - $c++; - if ($timezone==date_default_timezone_get()) { - echo "<OPTION selected value='".$timezone."'>".$timezone; - } else { - echo "<OPTION value='".$timezone."'>".$timezone; - } + for ($c=0; $c < $num; $c++) { + $timezone=$data[$c]; + $c++; + if ($timezone==$ltz) { + echo "<OPTION selected value='".$timezone."'>".$timezone; + } else { + echo "<OPTION value='".$timezone."'>".$timezone; } + } } ?> \ 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: <tim...@us...> - 2010-05-04 13:39:44
|
Revision: 3443 http://web-erp.svn.sourceforge.net/web-erp/?rev=3443&view=rev Author: tim_schofield Date: 2010-05-04 13:39:34 +0000 (Tue, 04 May 2010) Log Message: ----------- Tim: SelectProduct.php - Correctly display the product when selected from more than one page. Modified Paths: -------------- trunk/SelectProduct.php trunk/doc/Change.log.html Modified: trunk/SelectProduct.php =================================================================== --- trunk/SelectProduct.php 2010-05-03 13:03:00 UTC (rev 3442) +++ trunk/SelectProduct.php 2010-05-04 13:39:34 UTC (rev 3443) @@ -12,7 +12,7 @@ $_POST['Select'] = trim(strtoupper($_GET['StockID'])); } echo '<p class="page_title_text"><img src="' . $rootpath . '/css/' . $theme . '/images/customer.png" title="' . _('Inventory Items') . '" alt="">' . ' ' . _('Inventory Items') . ''; -if (isset($_GET['NewSearch'])) { +if (isset($_GET['NewSearch']) or isset($_POST['Next']) or isset($_POST['Previous']) or isset($_POST['Go'])) { unset($StockID); unset($_SESSION['SelectedStockItem']); unset($_POST['Select']); @@ -493,6 +493,9 @@ echo '<script type="text/javascript">defaultControl(document.forms[0].StockCode);</script>'; echo '</form>'; // query for list of record(s) +if(isset($_POST['Go']) OR isset($_POST['Next']) OR isset($_POST['Previous'])) { + $_POST['Search']='Search'; +} if (isset($_POST['Search']) OR isset($_POST['Go']) OR isset($_POST['Next']) OR isset($_POST['Previous'])) { if (!isset($_POST['Go']) AND !isset($_POST['Next']) AND !isset($_POST['Previous'])) { // if Search then set to first page @@ -663,7 +666,7 @@ echo '<input type=hidden name=Keywords value="'.$_POST['Keywords'].'">'; echo '<input type=hidden name=StockCat value="'.$_POST['StockCat'].'">'; echo '<input type=hidden name=StockCode value="'.$_POST['StockCode'].'">'; - echo '<input type=hidden name=Search value="Search">'; +// echo '<input type=hidden name=Search value="Search">'; echo '<p></div>'; } echo '<table cellpadding=2 colspan=7>'; @@ -694,7 +697,7 @@ } else { $qoh = number_format($myrow["qoh"], $myrow['decimalplaces']); } - echo "<td><input type=submit name='Select' value='".$myrow['stockid']."'</td> + echo "<td><input type=submit name='Select' value='".$myrow['stockid']."'></td> <td>".$myrow['description']."</td> <td class='number'>".$qoh."</td> <td>".$myrow['units']."</td> Modified: trunk/doc/Change.log.html =================================================================== --- trunk/doc/Change.log.html 2010-05-03 13:03:00 UTC (rev 3442) +++ trunk/doc/Change.log.html 2010-05-04 13:39:34 UTC (rev 3443) @@ -1,5 +1,6 @@ <p><font SIZE=4 COLOR=BLUE><b>webERP Change Log</b></font></p> <p></p> +<p>04/05/10 Tim: SelectProduct.php - Correctly display the product when selected from more than one page.</p> <p>03/05/10 Lindsay: More installer tweaks: better error handling</p> <p>03/05/10 Tim: PurchData.php - Do not show thousands seperator in price field</p> <p>02/05/10 Tim: Add picking list printing</p> This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <tim...@us...> - 2010-05-05 07:46:59
|
Revision: 3444 http://web-erp.svn.sourceforge.net/web-erp/?rev=3444&view=rev Author: tim_schofield Date: 2010-05-05 07:46:53 +0000 (Wed, 05 May 2010) Log Message: ----------- Zhiguo: PO_ReadInOrder.inc - Correct sql so that only one line per order line appears in the goods received screen Modified Paths: -------------- trunk/doc/Change.log.html trunk/includes/PO_ReadInOrder.inc Modified: trunk/doc/Change.log.html =================================================================== --- trunk/doc/Change.log.html 2010-05-04 13:39:34 UTC (rev 3443) +++ trunk/doc/Change.log.html 2010-05-05 07:46:53 UTC (rev 3444) @@ -1,5 +1,6 @@ <p><font SIZE=4 COLOR=BLUE><b>webERP Change Log</b></font></p> <p></p> +<p>05/05/10 Zhiguo: PO_ReadInOrder.inc - Correct sql so that only one line per order line appears in the goods received screen</p> <p>04/05/10 Tim: SelectProduct.php - Correctly display the product when selected from more than one page.</p> <p>03/05/10 Lindsay: More installer tweaks: better error handling</p> <p>03/05/10 Tim: PurchData.php - Do not show thousands seperator in price field</p> Modified: trunk/includes/PO_ReadInOrder.inc =================================================================== --- trunk/includes/PO_ReadInOrder.inc 2010-05-04 13:39:34 UTC (rev 3443) +++ trunk/includes/PO_ReadInOrder.inc 2010-05-05 07:46:53 UTC (rev 3444) @@ -15,82 +15,82 @@ /*read in all the guff from the selected order into the PO PurchOrder Class variable */ - $OrderHeaderSQL = 'SELECT purchorders.supplierno, - suppliers.suppname, - purchorders.comments, - purchorders.orddate, - purchorders.rate, - purchorders.dateprinted, - purchorders.deladd1, - purchorders.deladd2, - purchorders.deladd3, - purchorders.deladd4, - purchorders.deladd5, - purchorders.deladd6, - purchorders.tel, - purchorders.suppdeladdress1, - purchorders.suppdeladdress2, - purchorders.suppdeladdress3, - purchorders.suppdeladdress4, - purchorders.suppdeladdress5, - purchorders.suppdeladdress6, + $OrderHeaderSQL = 'SELECT purchorders.supplierno, + suppliers.suppname, + purchorders.comments, + purchorders.orddate, + purchorders.rate, + purchorders.dateprinted, + purchorders.deladd1, + purchorders.deladd2, + purchorders.deladd3, + purchorders.deladd4, + purchorders.deladd5, + purchorders.deladd6, + purchorders.tel, + purchorders.suppdeladdress1, + purchorders.suppdeladdress2, + purchorders.suppdeladdress3, + purchorders.suppdeladdress4, + purchorders.suppdeladdress5, + purchorders.suppdeladdress6, purchorders.suppliercontact, purchorders.supptel, purchorders.contact, - purchorders.allowprint, - purchorders.requisitionno, - purchorders.intostocklocation, - purchorders.initiator, - purchorders.version, - purchorders.status, - purchorders.stat_comment, + purchorders.allowprint, + purchorders.requisitionno, + purchorders.intostocklocation, + purchorders.initiator, + purchorders.version, + purchorders.status, + purchorders.stat_comment, purchorders.deliverydate, purchorders.port, suppliers.currcode, locations.managed , purchorders.paymentterms - FROM purchorders + FROM purchorders LEFT JOIN locations ON purchorders.intostocklocation=locations.loccode, - suppliers - WHERE purchorders.supplierno = suppliers.supplierid + suppliers + WHERE purchorders.supplierno = suppliers.supplierid AND purchorders.orderno = ' . $_GET['ModifyOrderNumber']; - $ErrMsg = _('The order cannot be retrieved because'); - $DbgMsg = _('The SQL statement that was used and failed was'); - $GetOrdHdrResult = DB_query($OrderHeaderSQL,$db,$ErrMsg,$DbgMsg); + $ErrMsg = _('The order cannot be retrieved because'); + $DbgMsg = _('The SQL statement that was used and failed was'); + $GetOrdHdrResult = DB_query($OrderHeaderSQL,$db,$ErrMsg,$DbgMsg); if (DB_num_rows($GetOrdHdrResult)==1 and !isset($_SESSION['PO'.$identifier]->OrderNo )) { - $myrow = DB_fetch_array($GetOrdHdrResult); - $_SESSION['PO'.$identifier]->OrderNo = $_GET['ModifyOrderNumber']; - $_SESSION['PO'.$identifier]->SupplierID = $myrow['supplierno']; - $_SESSION['PO'.$identifier]->SupplierName = $myrow['suppname']; - $_SESSION['PO'.$identifier]->CurrCode = $myrow['currcode']; - $_SESSION['PO'.$identifier]->Orig_OrderDate = $myrow['orddate']; - $_SESSION['PO'.$identifier]->AllowPrintPO = $myrow['allowprint']; - $_SESSION['PO'.$identifier]->DatePurchaseOrderPrinted = $myrow['dateprinted']; - $_SESSION['PO'.$identifier]->Comments = $myrow['comments']; - $_SESSION['PO'.$identifier]->ExRate = $myrow['rate']; - $_SESSION['PO'.$identifier]->Location = $myrow['intostocklocation']; - $_SESSION['PO'.$identifier]->Initiator = $myrow['initiator']; - $_SESSION['PO'.$identifier]->RequisitionNo = $myrow['requisitionno']; - $_SESSION['PO'.$identifier]->DelAdd1 = $myrow['deladd1']; - $_SESSION['PO'.$identifier]->DelAdd2 = $myrow['deladd2']; - $_SESSION['PO'.$identifier]->DelAdd3 = $myrow['deladd3']; - $_SESSION['PO'.$identifier]->DelAdd4 = $myrow['deladd4']; - $_SESSION['PO'.$identifier]->DelAdd5 = $myrow['deladd5']; - $_SESSION['PO'.$identifier]->DelAdd6 = $myrow['deladd6']; + $myrow = DB_fetch_array($GetOrdHdrResult); + $_SESSION['PO'.$identifier]->OrderNo = $_GET['ModifyOrderNumber']; + $_SESSION['PO'.$identifier]->SupplierID = $myrow['supplierno']; + $_SESSION['PO'.$identifier]->SupplierName = $myrow['suppname']; + $_SESSION['PO'.$identifier]->CurrCode = $myrow['currcode']; + $_SESSION['PO'.$identifier]->Orig_OrderDate = $myrow['orddate']; + $_SESSION['PO'.$identifier]->AllowPrintPO = $myrow['allowprint']; + $_SESSION['PO'.$identifier]->DatePurchaseOrderPrinted = $myrow['dateprinted']; + $_SESSION['PO'.$identifier]->Comments = $myrow['comments']; + $_SESSION['PO'.$identifier]->ExRate = $myrow['rate']; + $_SESSION['PO'.$identifier]->Location = $myrow['intostocklocation']; + $_SESSION['PO'.$identifier]->Initiator = $myrow['initiator']; + $_SESSION['PO'.$identifier]->RequisitionNo = $myrow['requisitionno']; + $_SESSION['PO'.$identifier]->DelAdd1 = $myrow['deladd1']; + $_SESSION['PO'.$identifier]->DelAdd2 = $myrow['deladd2']; + $_SESSION['PO'.$identifier]->DelAdd3 = $myrow['deladd3']; + $_SESSION['PO'.$identifier]->DelAdd4 = $myrow['deladd4']; + $_SESSION['PO'.$identifier]->DelAdd5 = $myrow['deladd5']; + $_SESSION['PO'.$identifier]->DelAdd6 = $myrow['deladd6']; $_SESSION['PO'.$identifier]->tel = $myrow['tel']; - $_SESSION['PO'.$identifier]->suppDelAdd1 = $myrow['suppdeladdress1']; - $_SESSION['PO'.$identifier]->suppDelAdd2 = $myrow['suppdeladdress2']; - $_SESSION['PO'.$identifier]->suppDelAdd3 = $myrow['suppdeladdress3']; - $_SESSION['PO'.$identifier]->suppDelAdd4 = $myrow['suppdeladdress4']; - $_SESSION['PO'.$identifier]->suppDelAdd5 = $myrow['suppdeladdress5']; - $_SESSION['PO'.$identifier]->suppDelAdd6 = $myrow['suppdeladdress6']; - $_SESSION['PO'.$identifier]->SupplierContact = $myrow['suppliercontact']; - $_SESSION['PO'.$identifier]->supptel= $myrow['supptel']; - $_SESSION['PO'.$identifier]->contact = $myrow['contact']; - $_SESSION['PO'.$identifier]->Managed = $myrow['managed']; + $_SESSION['PO'.$identifier]->suppDelAdd1 = $myrow['suppdeladdress1']; + $_SESSION['PO'.$identifier]->suppDelAdd2 = $myrow['suppdeladdress2']; + $_SESSION['PO'.$identifier]->suppDelAdd3 = $myrow['suppdeladdress3']; + $_SESSION['PO'.$identifier]->suppDelAdd4 = $myrow['suppdeladdress4']; + $_SESSION['PO'.$identifier]->suppDelAdd5 = $myrow['suppdeladdress5']; + $_SESSION['PO'.$identifier]->suppDelAdd6 = $myrow['suppdeladdress6']; + $_SESSION['PO'.$identifier]->SupplierContact = $myrow['suppliercontact']; + $_SESSION['PO'.$identifier]->supptel= $myrow['supptel']; + $_SESSION['PO'.$identifier]->contact = $myrow['contact']; + $_SESSION['PO'.$identifier]->Managed = $myrow['managed']; $_SESSION['PO'.$identifier]->version = $myrow['version']; $_SESSION['PO'.$identifier]->port = $myrow['port']; $_SESSION['PO'.$identifier]->Stat = $myrow['status']; @@ -99,19 +99,19 @@ $_SESSION['ExistingOrder'] = $_SESSION['PO'.$identifier]->OrderNo; $_SESSION['PO'.$identifier]->paymentterms= $myrow['paymentterms']; - $supplierSQL = "SELECT suppliers.supplierid, + $supplierSQL = "SELECT suppliers.supplierid, suppliers.suppname, - suppliers.address1, - suppliers.address2, - suppliers.address3, + suppliers.address1, + suppliers.address2, + suppliers.address3, suppliers.address4, - suppliers.address5, - suppliers.address6, - suppliers.currcode - FROM suppliers + suppliers.address5, + suppliers.address6, + suppliers.currcode + FROM suppliers WHERE suppliers.supplierid='" . $_SESSION['PO'.$identifier]->SupplierID."' ORDER BY suppliers.supplierid"; - + $ErrMsg = _('The searched supplier records requested cannot be retrieved because'); $result_SuppSelect = DB_query($supplierSQL,$db,$ErrMsg); @@ -119,13 +119,13 @@ $myrow=DB_fetch_array($result_SuppSelect); // $_POST['Select'] = $myrow['supplierid']; } elseif (DB_num_rows($result_SuppSelect)==0){ - prnMsg( _('No supplier records contain the selected text') . ' - ' . + prnMsg( _('No supplier records contain the selected text') . ' - ' . _('please alter your search criteria and try again'),'info'); } /*now populate the line PO array with the purchase order details records */ - $LineItemsSQL = 'SELECT podetailitem, + $LineItemsSQL = 'SELECT podetailitem, itemcode, stockmaster.description, purchorderdetails.deliverydate, @@ -155,26 +155,37 @@ cuft, total_quantity, total_amount - FROM purchorderdetails + FROM purchorderdetails LEFT JOIN stockmaster ON purchorderdetails.itemcode=stockmaster.stockid LEFT JOIN purchorders ON purchorders.orderno=purchorderdetails.orderno LEFT JOIN chartmaster ON purchorderdetails.glcode=chartmaster.accountcode - LEFT JOIN purchdata - ON purchdata.stockid=purchorderdetails.itemcode AND purchdata.supplierno=purchorders.supplierno + LEFT JOIN (SELECT purchdata.supplierno, + purchdata.stockid, + purchdata.price, + purchdata.suppliersuom, + purchdata.conversionfactor, + purchdata.supplierdescription, + purchdata.leadtime, + purchdata.preferred, + MAX(purchdata.effectivefrom), + purchdata.suppliers_partno + FROM weberpdemo.purchdata purchdata + GROUP BY purchdata.supplierno, purchdata.stockid) purchdata + ON purchdata.stockid=purchorderdetails.itemcode AND purchdata.supplierno=purchorders.supplierno WHERE purchorderdetails.completed=0 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); + $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)) { + while ($myrow=db_fetch_array($LineItemsResult)) { if (is_null($myrow['glcode'])){ $GLCode = ''; @@ -221,9 +232,9 @@ $myrow['total_quantity'], $myrow['total_amount']); - $_SESSION['PO'.$identifier]->LineItems[$_SESSION['PO'.$identifier]->LinesOnOrder]->PODetailRec = $myrow['podetailitem']; - $_SESSION['PO'.$identifier]->LineItems[$_SESSION['PO'.$identifier]->LinesOnOrder]->StandardCost = $myrow['stdcostunit']; /*Needed for receiving goods and GL interface */ - } /* line PO from purchase order details */ - } //end is there were lines on the order + $_SESSION['PO'.$identifier]->LineItems[$_SESSION['PO'.$identifier]->LinesOnOrder]->PODetailRec = $myrow['podetailitem']; + $_SESSION['PO'.$identifier]->LineItems[$_SESSION['PO'.$identifier]->LinesOnOrder]->StandardCost = $myrow['stdcostunit']; /*Needed for receiving goods and GL interface */ + } /* line PO from purchase order details */ + } //end is there were lines on the order } // end if there was a header for the order ?> \ 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: <tim...@us...> - 2010-05-05 08:01:11
|
Revision: 3445 http://web-erp.svn.sourceforge.net/web-erp/?rev=3445&view=rev Author: tim_schofield Date: 2010-05-05 08:01:05 +0000 (Wed, 05 May 2010) Log Message: ----------- SiteMe: DateFunctions.inc - Fixed DateAdd function to correctly calculate Y/m/d dates. Modified Paths: -------------- trunk/doc/Change.log.html trunk/includes/DateFunctions.inc Modified: trunk/doc/Change.log.html =================================================================== --- trunk/doc/Change.log.html 2010-05-05 07:46:53 UTC (rev 3444) +++ trunk/doc/Change.log.html 2010-05-05 08:01:05 UTC (rev 3445) @@ -1,6 +1,7 @@ <p><font SIZE=4 COLOR=BLUE><b>webERP Change Log</b></font></p> <p></p> <p>05/05/10 Zhiguo: PO_ReadInOrder.inc - Correct sql so that only one line per order line appears in the goods received screen</p> +<p>04/05/10 SiteMe: DateFunctions.inc - Fixed DateAdd function to correctly calculate Y/m/d dates.</p> <p>04/05/10 Tim: SelectProduct.php - Correctly display the product when selected from more than one page.</p> <p>03/05/10 Lindsay: More installer tweaks: better error handling</p> <p>03/05/10 Tim: PurchData.php - Do not show thousands seperator in price field</p> Modified: trunk/includes/DateFunctions.inc =================================================================== --- trunk/includes/DateFunctions.inc 2010-05-05 07:46:53 UTC (rev 3444) +++ trunk/includes/DateFunctions.inc 2010-05-05 08:01:05 UTC (rev 3445) @@ -614,16 +614,17 @@ switch ($PeriodString) { case 'd': - return Date($_SESSION['DefaultDateFormat'],mktime(0,0,0, (int)$Date_Array[2],(int)$Date_Array[1]+$NumberPeriods,(int)$Date_Array[0])); +/* Fix up the Y/m/d calculation */ + return Date($_SESSION['DefaultDateFormat'],mktime(0,0,0, (int)$Date_Array[1],(int)$Date_Array[2]+$NumberPeriods,(int)$Date_Array[0])); break; case 'w': - return Date($_SESSION['DefaultDateFormat'],mktime(0,0,0, (int)$Date_Array[2],(int)$Date_Array[1]+($NumberPeriods*7),(int)$Date_Array[0])); + return Date($_SESSION['DefaultDateFormat'],mktime(0,0,0, (int)$Date_Array[1],(int)$Date_Array[2]+($NumberPeriods*7),(int)$Date_Array[0])); break; case 'm': - return Date($_SESSION['DefaultDateFormat'],mktime(0,0,0, (int)$Date_Array[2]+$NumberPeriods,(int)$Date_Array[1],(int)$Date_Array[0])); + return Date($_SESSION['DefaultDateFormat'],mktime(0,0,0, (int)$Date_Array[1]+$NumberPeriods,(int)$Date_Array[2],(int)$Date_Array[0])); break; case 'y': - return Date($_SESSION['DefaultDateFormat'],mktime(0,0,0, (int)$Date_Array[2],(int)$Date_Array[1],(int)$Date_Array[0]+$NumberPeriods)); + return Date($_SESSION['DefaultDateFormat'],mktime(0,0,0, (int)$Date_Array[1],(int)$Date_Array[2],(int)$Date_Array[0]+$NumberPeriods)); break; default: return 0; @@ -860,4 +861,4 @@ return $myrow[0]; } -?> \ 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: <tim...@us...> - 2010-05-05 10:12:00
|
Revision: 3446 http://web-erp.svn.sourceforge.net/web-erp/?rev=3446&view=rev Author: tim_schofield Date: 2010-05-05 10:11:54 +0000 (Wed, 05 May 2010) Log Message: ----------- Tim: Fix javascript errors in order entry process Modified Paths: -------------- trunk/SelectOrderItems.php trunk/css/silverwolf/default.css trunk/doc/Change.log.html trunk/javascripts/MiscFunctions.js Modified: trunk/SelectOrderItems.php =================================================================== --- trunk/SelectOrderItems.php 2010-05-05 08:01:05 UTC (rev 3445) +++ trunk/SelectOrderItems.php 2010-05-05 10:11:54 UTC (rev 3446) @@ -1452,7 +1452,7 @@ SID, $myrow['stockid']); if ($j==1) { - $jsCall = '<script type="text/javascript">defaultControl(document.SelectParts.itm'.$myrow['stockid'].');</script>'; + $jsCall = '<script type="text/javascript">if (document.SelectParts) {defaultControl(document.SelectParts.itm'.$myrow['stockid'].');}</script>'; } $j++; #end of page full new headings if @@ -1502,7 +1502,7 @@ <?php if (!isset($_POST['PartSearch'])) { - echo '<script type="text/javascript">defaultControl(document.SelectParts.Keywords);</script>'; + echo '<script type="text/javascript">if (document.SelectParts) {defaultControl(document.SelectParts.Keywords);}</script>'; } if (in_array(2,$_SESSION['AllowedPageSecurityTokens'])){ echo '<td style="text-align:center" colspan=1><input tabindex=6 type=submit name="ChangeCustomer" value="' . _('Change Customer') . '"></td>'; @@ -1646,7 +1646,7 @@ SID, $myrow['stockid']); if ($j==1) { - $jsCall = '<script type="text/javascript">defaultControl(document.SelectParts.itm'.$myrow['stockid'].');</script>'; + $jsCall = '<script type="text/javascript">if (document.SelectParts) {defaultControl(document.SelectParts.itm'.$myrow['stockid'].');}</script>'; } $j++; #end of page full new headings if @@ -1687,6 +1687,7 @@ <td><input type="text" class="date" name="itemdue_' . $i . '" size=25 maxlength=25 alt="'.$_SESSION['DefaultDateFormat'].'" value="' . $DefaultDeliveryDate . '"></td></tr>'; } + echo '<script type="text/javascript">if (document.SelectParts) {defaultControl(document.SelectParts.part_1);}</script>'; echo '</table><br><div class="centre"><input type="submit" name="QuickEntry" value="' . _('Quick Entry') . '"> <input type="submit" name="PartSearch" value="' . _('Search Parts') . '"></div>'; @@ -1698,10 +1699,9 @@ }#end of else not selecting a customer echo '</form>'; -echo '<script type="text/javascript">defaultControl(document.SelectParts.part_1);</script>'; if (isset($_GET['NewOrder']) and $_GET['NewOrder']!='') { - echo '<script type="text/javascript">defaultControl(document.SelectCustomer.CustKeywords);</script>'; + echo '<script type="text/javascript">if (document.SelectParts) {defaultControl(document.SelectCustomer.CustKeywords);}</script>'; } include('includes/footer.inc'); ?> Modified: trunk/css/silverwolf/default.css =================================================================== --- trunk/css/silverwolf/default.css 2010-05-05 08:01:05 UTC (rev 3445) +++ trunk/css/silverwolf/default.css 2010-05-05 10:11:54 UTC (rev 3446) @@ -64,7 +64,7 @@ font-size: 10px; color: #300; text-align: center; - vertical-align: center; + vertical-align: middle; } .tableheader { Modified: trunk/doc/Change.log.html =================================================================== --- trunk/doc/Change.log.html 2010-05-05 08:01:05 UTC (rev 3445) +++ trunk/doc/Change.log.html 2010-05-05 10:11:54 UTC (rev 3446) @@ -1,5 +1,6 @@ <p><font SIZE=4 COLOR=BLUE><b>webERP Change Log</b></font></p> <p></p> +<p>05/05/10 Tim: Fix javascript errors in order entry process</p> <p>05/05/10 Zhiguo: PO_ReadInOrder.inc - Correct sql so that only one line per order line appears in the goods received screen</p> <p>04/05/10 SiteMe: DateFunctions.inc - Fixed DateAdd function to correctly calculate Y/m/d dates.</p> <p>04/05/10 Tim: SelectProduct.php - Correctly display the product when selected from more than one page.</p> Modified: trunk/javascripts/MiscFunctions.js =================================================================== --- trunk/javascripts/MiscFunctions.js 2010-05-05 08:01:05 UTC (rev 3445) +++ trunk/javascripts/MiscFunctions.js 2010-05-05 10:11:54 UTC (rev 3446) @@ -6,10 +6,10 @@ fB.click(); } function rTN(event){ -if (window.event) k=window.event.keyCode; -else if (event) k=event.which; +if (event) k=event.keyCode; +else if (event) var k=event.which; else return true; -kC=String.fromCharCode(k); +var 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 return false; @@ -75,9 +75,9 @@ /*Renier & Louis (in...@ti...) 25.02.2007 Copyright 2004-2007 Tillcor International */ -days=new Array('Su','Mo','Tu','We','Th','Fr','Sa'); -months=new Array('Jan','Feb','Mar','Apr','May','Jun','Jul','Aug','Sep','Oct','Nov','Dec'); -dateDivID="calendar"; +var days=new Array('Su','Mo','Tu','We','Th','Fr','Sa'); +var months=new Array('Jan','Feb','Mar','Apr','May','Jun','Jul','Aug','Sep','Oct','Nov','Dec'); +var dateDivID="calendar"; function Calendar(md,dF){ iF=document.getElementsByName(md).item(0); pB=iF; @@ -159,7 +159,7 @@ } function convertDate(dS,dF){ var d,m,y; -if (dF="d.m.Y") +if (dF=="d.m.Y") dA=dS.split(".") else dA=dS.split("/"); @@ -199,7 +199,7 @@ function initial(){ if (document.getElementsByTagName){ var as=document.getElementsByTagName("a"); -for (i=0;i<as.length;i++){ +for (var i=0;i<as.length;i++){ var a=as[i]; if (a.getAttribute("href") && a.getAttribute("rel")=="external") This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <dai...@us...> - 2010-05-07 23:22:25
|
Revision: 3455 http://web-erp.svn.sourceforge.net/web-erp/?rev=3455&view=rev Author: daintree Date: 2010-05-07 23:22:18 +0000 (Fri, 07 May 2010) Log Message: ----------- changes to prices Modified Paths: -------------- trunk/Prices.php trunk/PricesBasedOnMarkUp.php trunk/PricesByCost.php trunk/Prices_Customer.php Modified: trunk/Prices.php =================================================================== --- trunk/Prices.php 2010-05-06 10:13:27 UTC (rev 3454) +++ trunk/Prices.php 2010-05-07 23:22:18 UTC (rev 3455) @@ -75,13 +75,19 @@ $msg = _('The price entered must be numeric'); } if (! Is_Date($_POST['StartDate'])){ - $InpuitError =1; + $InputError =1; $msg = _('The date this price is to take effect from must be entered in the format') . ' ' . $_SESSION['DefaultDateFormat']; } if (! Is_Date($_POST['EndDate'])){ - $InpuitError =1; + $InputError =1; $msg = _('The date this price is be in effect to must be entered in the format') . ' ' . $_SESSION['DefaultDateFormat']; } + if (Date1GreaterThanDate2($_POST['StartDate'],$_POST['EndDate'])){ + $InputError =1; + $msg = _('The end date is expected to be after the start date, enter an end date after the start date for this price'); + } + + if (isset($_POST['OldTypeAbbrev']) AND isset($_POST['OldCurrAbrev']) AND strlen($Item)>1 AND $InputError !=1) { //editing an existing price @@ -96,6 +102,20 @@ AND prices.currabrev='" . $_POST['OldCurrAbrev'] . "' AND prices.debtorno=''"; + /* Need to see if there is also a price entered that has an end date after the start date of this price and if so we will need to update it so there is no ambiguity as to which price will be used*/ + $SQLEndDate = + + $UpdateEndDateOfExistingPricesSQL = "UPDATE prices SET enddate = '" . + WHERE enddate >= '" . FormatDateForSQL($_POST['StartDate']) . "' + AND typeabbrev='" . $_POST['TypeAbbrev'] . "', + AND currabrev='" . $_POST['CurrAbrev'] . "', + + FROM prices + WHERE + + + + $msg = _('This price has been updated') . '.'; } elseif ($InputError !=1) { Modified: trunk/PricesBasedOnMarkUp.php =================================================================== --- trunk/PricesBasedOnMarkUp.php 2010-05-06 10:13:27 UTC (rev 3454) +++ trunk/PricesBasedOnMarkUp.php 2010-05-07 23:22:18 UTC (rev 3455) @@ -8,7 +8,7 @@ $title=_('Update Pricing From Costs'); include('includes/header.inc'); -echo '<br><div class="page_help_text">' . _('This page adds new prices or updates already existing prices for a specified sales type (price list) and currency for the stock category selected - based on a percentage mark up from cost prices or from preferred supplier cost data') . '</div><br><div class="centre">'; +echo '<br><div class="page_help_text">' . _('This page adds new prices or updates already existing prices for a specified sales type (price list) and currency for the stock category selected - based on a percentage mark up from cost prices or from preferred supplier cost data. This script does not care about the dates when prices are effective from and to - it will update all prices for the selections made irrespective of effectivity dates.') . '</div><br><div class="centre">'; echo "<form method='POST' action='" . $_SERVER['PHP_SELF'] . '?' . SID . "'>"; Modified: trunk/PricesByCost.php =================================================================== --- trunk/PricesByCost.php 2010-05-06 10:13:27 UTC (rev 3454) +++ trunk/PricesByCost.php 2010-05-07 23:22:18 UTC (rev 3455) @@ -15,18 +15,18 @@ } else { $Comparator = ">="; } /*end of else Comparator */ - if ($_POST['StockCat'] == "all") { - $Category = "stockmaster.stockid = prices.stockid"; + if ($_POST['StockCat'] == 'all') { + $Category = 'stockmaster.stockid = prices.stockid'; } else { $Category = "stockmaster.stockid = prices.stockid AND stockmaster.categoryid = '" . $_POST['StockCat'] . "'"; } /*end of else StockCat */ - $sql = "SELECT stockmaster.stockid, + $sql = 'SELECT stockmaster.stockid, stockmaster.description, (stockmaster.materialcost + stockmaster.labourcost + stockmaster.overheadcost) as cost, prices.price as price, prices.debtorno as customer, prices.branchcode as branch FROM stockmaster, prices - WHERE " . $Category . " - AND prices.price" . $Comparator . "(stockmaster.materialcost + stockmaster.labourcost + stockmaster.overheadcost) * " . $_POST['Margin'] . " + WHERE ' . $Category . ' + AND prices.price' . $Comparator . '(stockmaster.materialcost + stockmaster.labourcost + stockmaster.overheadcost) * ' . $_POST['Margin'] . " AND prices.typeabbrev ='" . $_POST['SalesType'] . "' AND prices.currabrev ='" . $_POST['CurrCode'] . "'"; $result = DB_query($sql, $db); @@ -44,11 +44,11 @@ if (isset($Category[0])) { $Cat = $Category[0]; } else { - $Cat = "All Category"; + $Cat = 'All Category'; } /*end of else Category */ echo '<div class="page_help_text">' . _('Items in category ') . '' . $Cat . '' . _(' With Price ') . '' . $Comparator . '' . $_POST['Margin'] . '' . _(' times ') . '' . _('Cost in Price List ') . '' . $Type['0'] . '</div><br><br>'; if ($numrow != 0) { - echo "<table>"; + echo '<table>'; echo '<tr><th>' . _('Code') . '</th> <th>' . _('Description') . '</th> <th>' . _('Customer') . '</th> Modified: trunk/Prices_Customer.php =================================================================== --- trunk/Prices_Customer.php 2010-05-06 10:13:27 UTC (rev 3454) +++ trunk/Prices_Customer.php 2010-05-07 23:22:18 UTC (rev 3455) @@ -26,19 +26,23 @@ $result = DB_query("SELECT debtorsmaster.name, debtorsmaster.currcode, - debtorsmaster.salestype - FROM - debtorsmaster - WHERE - debtorsmaster.debtorno='" . $_SESSION['CustomerID'] . "'",$db); + debtorsmaster.salestype + FROM + debtorsmaster + WHERE + debtorsmaster.debtorno='" . $_SESSION['CustomerID'] . "'",$db); $myrow = DB_fetch_row($result); echo '<font color=BLUE><b>' . $myrow[0] . ' ' . _('in') . ' ' . $myrow[1] . '<br>' . ' ' . _('for') . ' '; $CurrCode = $myrow[1]; $SalesType = $myrow[2]; -$result = DB_query("SELECT stockmaster.description FROM stockmaster WHERE stockmaster.stockid='$Item'",$db); +$result = DB_query("SELECT stockmaster.description + FROM stockmaster + WHERE stockmaster.stockid='" . $Item . "'",$db); + $myrow = DB_fetch_row($result); + echo $Item . ' - ' . $myrow[0] . '</b></font><hr>'; if (isset($_POST['submit'])) { @@ -58,10 +62,9 @@ if ($_POST['Branch'] !=''){ $sql = "SELECT custbranch.branchcode - FROM - custbranch - WHERE custbranch.debtorno='" . $_SESSION['CustomerID'] . "' - AND custbranch.branchcode='" . $_POST['Branch'] . "'"; + FROM custbranch + WHERE custbranch.debtorno='" . $_SESSION['CustomerID'] . "' + AND custbranch.branchcode='" . $_POST['Branch'] . "'"; $result = DB_query($sql,$db); if (DB_num_rows($result) ==0){ @@ -69,36 +72,58 @@ $msg = _('The branch code entered is not currently defined'); } } + + if (! Is_Date($_POST['StartDate'])){ + $InputError =1; + $msg = _('The date this price is to take effect from must be entered in the format') . ' ' . $_SESSION['DefaultDateFormat']; + } + if (! Is_Date($_POST['EndDate'])){ + $InputError =1; + $msg = _('The date this price is be in effect to must be entered in the format') . ' ' . $_SESSION['DefaultDateFormat']; + } + if (Date1GreaterThanDate2($_POST['StartDate'],$_POST['EndDate'])){ + $InputError =1; + $msg = _('The end date is expected to be after the start date, enter an end date after the start date for this price'); + } if ((isset($_POST['Editing']) and $_POST['Editing']=='Yes') AND strlen($Item)>1 AND $InputError !=1) { //editing an existing price - $sql = "UPDATE prices SET typeabbrev='$SalesType', - currabrev='$CurrCode', - price=" . $_POST['Price'] . ", - branchcode ='" . $_POST['Branch'] . "' - WHERE prices.stockid='$Item' - AND prices.typeabbrev='$SalesType' - AND prices.currabrev='$CurrCode' + $sql = "UPDATE prices SET typeabbrev='" . $SalesType . "', + currabrev='" . $CurrCode . "', + price=" . $_POST['Price'] . ", + branchcode='" . $_POST['Branch'] . "', + startdate='" . FormatDateForSQL($_POST['StartDate']) . "', + enddate='" . FormatDateForSQL($_POST['EndDate']) . "' + WHERE prices.stockid='" . $Item . "' + AND prices.typeabbrev='" . $SalesType . "' + AND prices.currabrev='" . $CurrCode . "' + AND prices.startdate='" . FormatDateForSQL($_POST['StartDate']) . "' + AND prices.enddate='" . FormatDateForSQL($_POST['EndDate']) . "' AND prices.debtorno='" . $_SESSION['CustomerID'] . "'"; + $msg = _('Price Updated'); } elseif ($InputError !=1) { /*Selected price is null cos no item selected on first time round so must be adding a record must be submitting new entries in the new price form */ $sql = "INSERT INTO prices (stockid, typeabbrev, - currabrev, - debtorno, - price, - branchcode) - VALUES ('$Item', - '$SalesType', - '$CurrCode', - '" . $_SESSION['CustomerID'] . "', - " . $_POST['Price'] . ", - '" . $_POST['Branch'] . "' - )"; + currabrev, + debtorno, + price, + branchcode, + startdate, + enddate) + VALUES ('$Item', + '$SalesType', + '$CurrCode', + '" . $_SESSION['CustomerID'] . "', + " . $_POST['Price'] . ", + '" . $_POST['Branch'] . "', + '" . FormatDateForSQL($_POST['StartDate']) . "', + '" . FormatDateForSQL($_POST['EndDate']) . "' + )"; $msg = _('Price added') . '.'; } //run the SQL from either of the above possibilites @@ -121,11 +146,14 @@ //the link to delete a selected record was clicked instead of the submit button $sql="DELETE FROM prices - WHERE prices.stockid = '". $Item ."' - AND prices.typeabbrev='". $SalesType ."' - AND prices.currabrev ='". $CurrCode ."' - AND prices.debtorno='" . $_SESSION['CustomerID'] . "' - AND prices.branchcode='" . $_GET['Branch'] . "'"; + WHERE prices.stockid = '". $Item ."' + AND prices.typeabbrev='". $SalesType ."' + AND prices.currabrev ='". $CurrCode ."' + AND prices.debtorno='" . $_SESSION['CustomerID'] . "' + AND prices.branchcode='" . $_GET['Branch'] . "' + AND prices.startdate='" . $_GET['StartDate'] . "' + AND prices.enddate='" . $_GET['EndDate'] . "'"; + $result = DB_query($sql,$db); prnMsg( _('This price has been deleted') . '!','success'); } @@ -136,13 +164,13 @@ $sql = "SELECT prices.price, prices.typeabbrev - FROM prices - WHERE prices.typeabbrev = '$SalesType' - AND prices.stockid='$Item' - AND prices.debtorno='' - AND prices.currabrev='$CurrCode' - ORDER BY typeabbrev"; - + FROM prices + WHERE prices.typeabbrev = '" . $SalesType . "' + AND prices.stockid='" . $Item . "' + AND prices.debtorno='' + AND prices.currabrev='" . $CurrCode . "' + ORDER BY typeabbrev"; + $ErrMsg = _('Could not retrieve the normal prices set up because'); $DbgMsg = _('The SQL used to retrieve these records was'); $result = DB_query($sql,$db,$ErrMsg,$DbgMsg); @@ -165,14 +193,16 @@ $sql = "SELECT prices.price, prices.branchcode, - custbranch.brname - FROM prices LEFT JOIN custbranch ON prices.branchcode= custbranch.branchcode - WHERE prices.typeabbrev = '$SalesType' - AND prices.stockid='$Item' - AND prices.debtorno='" . $_SESSION['CustomerID'] . "' - AND prices.currabrev='$CurrCode' - AND (custbranch.debtorno='" . $_SESSION['CustomerID'] . "' OR - custbranch.debtorno IS NULL)"; + custbranch.brname, + prices.startdate, + prices.enddate + FROM prices LEFT JOIN custbranch ON prices.branchcode= custbranch.branchcode + WHERE prices.typeabbrev = '$SalesType' + AND prices.stockid='$Item' + AND prices.debtorno='" . $_SESSION['CustomerID'] . "' + AND prices.currabrev='$CurrCode' + AND (custbranch.debtorno='" . $_SESSION['CustomerID'] . "' OR + custbranch.debtorno IS NULL)"; $ErrMsg = _('Could not retrieve the special prices set up because'); $DbgMsg = _('The SQL used to retrieve these records was'); @@ -198,17 +228,25 @@ printf("<tr bgcolor='#CCCCCC'> <td class=number>%0.2f</td> <td>%s</td> - <td><a href='%s?Item=%s&Price=%s&Branch=%s&Edit=1'>" . _('Edit') . "</td> - <td><a href='%s?Item=%s&Branch=%s&delete=yes'>" . _('Delete') . "</td></tr>", - $myrow["price"], + <td>%s</td> + <td>%s</td> + <td><a href='%s?Item=%s&Price=%s&Branch=%s&StartDate=%s&EndDate=%s&Edit=1'>" . _('Edit') . "</td> + <td><a href='%s?Item=%s&Branch=%s&StartDate=%s&EndDate=%s&delete=yes'>" . _('Delete') . "</td></tr>", + $myrow['price'], $Branch, + ConvertSQLDate($myrow['startdate']), + ConvertSQLDate($myrow['enddate']), $_SERVER['PHP_SELF'], $Item, $myrow['price'], $myrow['branchcode'], + $myrow['startdate'], + $myrow['enddate'], $_SERVER['PHP_SELF'], $Item, - $myrow['branchcode']); + $myrow['branchcode'], + $myrow['startdate'], + $myrow['enddate']); } //END WHILE LIST LOOP } @@ -227,6 +265,8 @@ echo '<input type=hidden name="Editing" VALUE="Yes">'; $_POST['Price']=$_GET['Price']; $_POST['Branch']=$_GET['Branch']; + $_POST['StartDate'] = ConvertSQLDate($_GET['StartDate']); + $_POST['EndDate'] = ConvertSQLDate($_GET['EndDate']); } if (!isset($_POST['Branch'])) { @@ -235,12 +275,28 @@ if (!isset($_POST['Price'])) { $_POST['Price']=0; } + + if (!isset($_POST['StartDate'])){ + $_POST['StartDate'] = Date($_SESSION['DefaultDateFormat']); + } + + if (!isset($_POST['EndDate'])){ + $_POST['EndDate'] = Date($_SESSION['DefaultDateFormat'],Mktime(0,0,0,12,31,(Date('y')+20))); + } + + echo '<table><tr><td>' . _('Branch') . ':</td> - <td><input type="Text" name="Branch" size=11 maxlength=10 value=' . $_POST['Branch'] . '></td> - </tr>'; + <td><input type="Text" name="Branch" size=11 maxlength=10 value=' . $_POST['Branch'] . '></td></tr>'; + echo '<table><tr><td>' . _('Start Date') . ':</td> + <td><input type="Text" name="StartDate" size=11 maxlength=10 value=' . $_POST['StartDate'] . '></td></tr>'; + echo '<table><tr><td>' . _('End Date') . ':</td> + <td><input type="Text" name="EndDate" size=11 maxlength=10 value=' . $_POST['EndDate'] . '></td></tr>'; + echo '<tr><td>' . _('Price') . ':</td> <td><input type="Text" class=number name="Price" size=11 maxlength=10 value=' . $_POST['Price'] . '></td> </tr></table>'; + + echo '<div class="centre"><input type="Submit" name="submit" VALUE="' . _('Enter Information') . '"></div>'; echo '</form>'; This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <dai...@us...> - 2010-05-08 08:39:33
|
Revision: 3456 http://web-erp.svn.sourceforge.net/web-erp/?rev=3456&view=rev Author: daintree Date: 2010-05-08 08:39:26 +0000 (Sat, 08 May 2010) Log Message: ----------- Price effectivity dates changes - found a bug in DateFunctions that prevented Date1GreaterThanDate2 function working for DefaultDateFormat=d/m/Y Changes in Prices.php and Prices_Customer.php to allow entry of start date and end date and update/deletions of prices. Also update to includes/GetPrice.inc to use the new startdate and enddate prices based on todays date Modified Paths: -------------- trunk/Prices.php trunk/Prices_Customer.php trunk/doc/Change.log.html trunk/includes/DateFunctions.inc trunk/includes/GetPrice.inc trunk/includes/session.inc trunk/sql/mysql/upgrade3.11.1-3.12.sql Modified: trunk/Prices.php =================================================================== --- trunk/Prices.php 2010-05-07 23:22:18 UTC (rev 3455) +++ trunk/Prices.php 2010-05-08 08:39:26 UTC (rev 3456) @@ -29,9 +29,6 @@ $_POST['CurrAbrev'] = $_SESSION['CompanyRecord']['currencydefault']; } -if (!isset($_POST['StartDate'])){ - $_POST['StartDate'] = Date($_SESSION['DefaultDateFormat']); -} echo "<a href='" . $rootpath . '/SelectProduct.php?' . SID . "'>" . _('Back to Items') . '</a><br>'; @@ -72,51 +69,50 @@ if (!is_double((double) trim($_POST['Price'])) OR $_POST['Price']=="") { $InputError = 1; - $msg = _('The price entered must be numeric'); + prnMsg( _('The price entered must be numeric'),'error'); } if (! Is_Date($_POST['StartDate'])){ $InputError =1; - $msg = _('The date this price is to take effect from must be entered in the format') . ' ' . $_SESSION['DefaultDateFormat']; + prnMsg (_('The date this price is to take effect from must be entered in the format') . ' ' . $_SESSION['DefaultDateFormat'],'error'); } if (! Is_Date($_POST['EndDate'])){ $InputError =1; - $msg = _('The date this price is be in effect to must be entered in the format') . ' ' . $_SESSION['DefaultDateFormat']; + prnMsg (_('The date this price is be in effect to must be entered in the format') . ' ' . $_SESSION['DefaultDateFormat'],'error'); } if (Date1GreaterThanDate2($_POST['StartDate'],$_POST['EndDate'])){ $InputError =1; - $msg = _('The end date is expected to be after the start date, enter an end date after the start date for this price'); + prnMsg (_('The end date is expected to be after the start date, enter an end date after the start date for this price'),'error'); } - + if (Date1GreaterThanDate2(Date($_SESSION['DefaultDateFormat']),$_POST['EndDate'])){ + $InputError =1; + prnMsg(_('The end date is expected to be after today. There is no point entering a new price where the effective date is before today!'),'error'); + } if (isset($_POST['OldTypeAbbrev']) AND isset($_POST['OldCurrAbrev']) AND strlen($Item)>1 AND $InputError !=1) { + /* Need to see if there is also a price entered that has an end date after the start date of this price and if so we will need to update it so there is no ambiguity as to which price will be used*/ + //editing an existing price $sql = "UPDATE prices SET - typeabbrev='" . $_POST['TypeAbbrev'] . "', - currabrev='" . $_POST['CurrAbrev'] . "', - price=" . $_POST['Price'] . ", - startdate='" . FormatDateForSQL($_POST['StartDate']) . "', - enddate='" . FormatDateForSQL($_POST['EndDate']) . "' - WHERE prices.stockid='$Item' - AND prices.typeabbrev='" . $_POST['OldTypeAbbrev'] . "' - AND prices.currabrev='" . $_POST['OldCurrAbrev'] . "' - AND prices.debtorno=''"; + typeabbrev='" . $_POST['TypeAbbrev'] . "', + currabrev='" . $_POST['CurrAbrev'] . "', + price=" . $_POST['Price'] . ", + startdate='" . FormatDateForSQL($_POST['StartDate']) . "', + enddate='" . FormatDateForSQL($_POST['EndDate']) . "' + WHERE prices.stockid='$Item' + AND startdate='" .$_POST['OldStartDate'] . "' + AND enddate ='" . $_POST['OldEndDate'] . "' + AND prices.typeabbrev='" . $_POST['OldTypeAbbrev'] . "' + AND prices.currabrev='" . $_POST['OldCurrAbrev'] . "' + AND prices.debtorno=''"; - /* Need to see if there is also a price entered that has an end date after the start date of this price and if so we will need to update it so there is no ambiguity as to which price will be used*/ - $SQLEndDate = + $ErrMsg = _('Could not be update the existing prices'); + $result = DB_query($sql,$db,$ErrMsg); - $UpdateEndDateOfExistingPricesSQL = "UPDATE prices SET enddate = '" . - WHERE enddate >= '" . FormatDateForSQL($_POST['StartDate']) . "' - AND typeabbrev='" . $_POST['TypeAbbrev'] . "', - AND currabrev='" . $_POST['CurrAbrev'] . "', - - FROM prices - WHERE - + ReSequenceEffectiveDates ($Item, $_POST['TypeAbbrev'], $_POST['CurrAbrev'], $db) ; + prnMsg(_('The price has been updated'),'success'); - - $msg = _('This price has been updated') . '.'; } elseif ($InputError !=1) { /*Selected price is null cos no item selected on first time round so must be adding a record must be submitting new entries in the new price form */ @@ -124,50 +120,39 @@ $sql = "INSERT INTO prices (stockid, typeabbrev, currabrev, - debtorno, startdate, enddate, price) VALUES ('$Item', '" . $_POST['TypeAbbrev'] . "', '" . $_POST['CurrAbrev'] . "', - '', '" . FormatDateForSQL($_POST['StartDate']) . "', '" . FormatDateForSQL($_POST['EndDate']). "', " . $_POST['Price'] . ")"; - - $msg = _('The new price has been added') . '.'; + $ErrMsg = _('The new price could not be added'); + $result = DB_query($sql,$db,$ErrMsg); + + ReSequenceEffectiveDates ($Item, $_POST['TypeAbbrev'], $_POST['CurrAbrev'], $db) ; + prnMsg(_('The new price has been inserted'),'success'); } - //run the SQL from either of the above possibilites only if there were no input errors - if ($InputError !=1){ - $result = DB_query($sql,$db,'','',false,false); - if (DB_error_no($db)!=0){ - If ($msg== _('This price has been updated')){ - $msg = _('The price could not be updated because') . ' - ' . DB_error_msg($db); - } else { - $msg = _('The price could not be added because') . ' - ' . DB_error_msg($db); - } - if ($debug==1){ - prnMsg(_('The SQL that caused the problem was') . ':<br>' . $sql,'error'); - } - } else { - unset($_POST['Price']); - } - } - prnMsg($msg); + unset($_POST['Price']); + unset($_POST['StartDate']); + unset($_POST['EndDate']); } elseif (isset($_GET['delete'])) { //the link to delete a selected record was clicked instead of the submit button $sql="DELETE FROM prices - WHERE prices.stockid = '". $Item ."' - AND prices.typeabbrev='". $_GET['TypeAbbrev'] ."' - AND prices.currabrev ='". $_GET['CurrAbrev'] ."' - AND prices.debtorno=''"; + WHERE prices.stockid = '". $Item ."' + AND prices.typeabbrev='". $_GET['TypeAbbrev'] ."' + AND prices.currabrev ='". $_GET['CurrAbrev'] ."' + AND prices.startdate = '" .$_GET['StartDate'] . "' + AND prices.enddate = '" . $_GET['EndDate'] . "' + AND prices.debtorno=''"; + $ErrMsg = _('Could not delete this price'); + $result = DB_query($sql,$db,$ErrMsg); + prnMsg( _('The selected price has been deleted'),'success'); - $result = DB_query($sql,$db); - prnMsg( _('The selected price has been deleted') . '!','success'); - } //Always do this stuff @@ -188,7 +173,8 @@ AND prices.stockid='$Item' AND prices.debtorno='' ORDER BY prices.currabrev, - prices.typeabbrev"; + prices.typeabbrev, + prices.startdate"; $result = DB_query($sql,$db); @@ -218,8 +204,8 @@ <td class=number>%0.2f</td> <td>%s</td> <td>%s</td> - <td><a href='%s?%s&Item=%s&TypeAbbrev=%s&CurrAbrev=%s&Price=%s&Edit=1'>" . _('Edit') . "</td> - <td><a href='%s?%s&Item=%s&TypeAbbrev=%s&CurrAbrev=%s&delete=yes' onclick=\"return confirm('" . _('Are you sure you wish to delete this price?') . "');\">" . _('Delete') . '</td></tr>', + <td><a href='%s?%s&Item=%s&TypeAbbrev=%s&CurrAbrev=%s&Price=%s&StartDate=%s&EndDate=%s&Edit=1'>" . _('Edit') . "</td> + <td><a href='%s?%s&Item=%s&TypeAbbrev=%s&CurrAbrev=%s&StartDate=%s&EndDate=%s&delete=yes' onclick=\"return confirm('" . _('Are you sure you wish to delete this price?') . "');\">" . _('Delete') . '</td></tr>', $myrow['currency'], $myrow['sales_type'], $myrow['price'], @@ -231,11 +217,15 @@ $myrow['typeabbrev'], $myrow['currabrev'], $myrow['price'], + $myrow['startdate'], + $myrow['enddate'], $_SERVER['PHP_SELF'], SID, $myrow['stockid'], $myrow['typeabbrev'], - $myrow['currabrev']); + $myrow['currabrev'], + $myrow['startdate'], + $myrow['enddate']); } else { printf("<td>%s</td> <td>%s</td> @@ -261,9 +251,13 @@ if (isset($_GET['Edit'])){ echo '<input type=hidden name="OldTypeAbbrev" VALUE="' . $_GET['TypeAbbrev'] .'">'; echo '<input type=hidden name="OldCurrAbrev" VALUE="' . $_GET['CurrAbrev'] . '">'; + echo '<input type=hidden name="OldStartDate" VALUE="' . $_GET['StartDate'] . '">'; + echo '<input type=hidden name="OldEndDate" VALUE="' . $_GET['EndDate'] . '">'; $_POST['CurrAbrev'] = $_GET['CurrAbrev']; $_POST['TypeAbbrev'] = $_GET['TypeAbbrev']; $_POST['Price'] = $_GET['Price']; + $_POST['StartDate'] = ConvertSQLDate($_GET['StartDate']); + $_POST['EndDate'] = ConvertSQLDate($_GET['EndDate']); } $SQL = "SELECT currabrev, currency FROM currencies"; @@ -283,7 +277,7 @@ echo '</select> </td></tr><tr><td>' . _('Sales Type Price List') . ':</td><td><select name="TypeAbbrev">'; - $SQL = "SELECT typeabbrev, sales_type FROM salestypes"; + $SQL = 'SELECT typeabbrev, sales_type FROM salestypes'; $result = DB_query($SQL,$db); while ($myrow = DB_fetch_array($result)) { @@ -298,10 +292,17 @@ DB_free_result($result); + if (!isset($_POST['StartDate'])){ + $_POST['StartDate'] = Date($_SESSION['DefaultDateFormat']); + } + + if (!isset($_POST['EndDate'])){ + $_POST['EndDate'] = Date($_SESSION['DefaultDateFormat'],Mktime(0,0,0,12,31,(Date('y')+20))); + } echo '<tr><td>' . _('Price Effective From Date') . ':</td> - <td><input type=text name="StartDate" value="' . Date($_SESSION['DefaultDateFormat']) . '"></td></tr>'; + <td><input type=text name="StartDate" value="' . $_POST['StartDate'] . '"></td></tr>'; echo '<tr><td>' . _('Price Effective To Date') . ':</td> - <td><input type=text name="EndDate" value="' . Date($_SESSION['DefaultDateFormat'],Mktime(0,0,0,12,31,(Date('y')+20))) . '">'; + <td><input type=text name="EndDate" value="' . $_POST['EndDate'] . '">'; ?> @@ -325,4 +326,48 @@ echo '</form>'; include('includes/footer.inc'); + + +function ReSequenceEffectiveDates ($Item, $PriceList, $CurrAbbrev, $db) { + + $SQL = "SELECT price, + startdate, + enddate + FROM prices + WHERE debtorno='' + AND stockid='" . $Item . "' + AND currabrev='" . $CurrAbbrev . "' + AND typeabbrev='" . $PriceList . "' + ORDER BY startdate, enddate"; + $result = DB_query($SQL,$db); + $NextStartDate = Date($_SESSION['DefaultDateFormat']); + unset($EndDate); + unset($NextStartDate); + while ($myrow = DB_fetch_array($result)){ + + if (isset($NextStartDate)){ + if (Date1GreaterThanDate2(ConvertSQLDate($myrow['startdate']),$NextStartDate)){ + $NextStartDate = ConvertSQLDate($myrow['startdate']); + if (isset($EndDate)) { + /*Need to make the end date the new start date less 1 day */ + $SQL = "UPDATE prices SET enddate = '" . FormatDateForSQL(DateAdd($NextStartDate,'d',-1)) . "' + WHERE stockid ='" .$Item . "' + AND currabrev='" . $CurrAbbrev . "' + AND typeabbrev='" . $PriceList . "' + AND startdate ='" . $StartDate . "' + AND enddate = '" . $EndDate . "' + AND debtorno =''"; + $UpdateResult = DB_query($SQL,$db); + } + } //end of if startdate after NextStartDate - we have a new NextStartDate + } //end of if set NextStartDate + else { + $NextStartDate = ConvertSQLDate($myrow['startdate']); + } + $StartDate = $myrow['startdate']; + $EndDate = $myrow['enddate']; + $Price = $myrow['price']; + } +} + ?> \ No newline at end of file Modified: trunk/Prices_Customer.php =================================================================== --- trunk/Prices_Customer.php 2010-05-07 23:22:18 UTC (rev 3455) +++ trunk/Prices_Customer.php 2010-05-08 08:39:26 UTC (rev 3456) @@ -25,12 +25,12 @@ } $result = DB_query("SELECT debtorsmaster.name, - debtorsmaster.currcode, - debtorsmaster.salestype - FROM - debtorsmaster - WHERE - debtorsmaster.debtorno='" . $_SESSION['CustomerID'] . "'",$db); + debtorsmaster.currcode, + debtorsmaster.salestype + FROM + debtorsmaster + WHERE + debtorsmaster.debtorno='" . $_SESSION['CustomerID'] . "'",$db); $myrow = DB_fetch_row($result); echo '<font color=BLUE><b>' . $myrow[0] . ' ' . _('in') . ' ' . $myrow[1] . '<br>' . ' ' . _('for') . ' '; @@ -38,8 +38,8 @@ $SalesType = $myrow[2]; $result = DB_query("SELECT stockmaster.description - FROM stockmaster - WHERE stockmaster.stockid='" . $Item . "'",$db); + FROM stockmaster + WHERE stockmaster.stockid='" . $Item . "'",$db); $myrow = DB_fetch_row($result); @@ -62,9 +62,9 @@ if ($_POST['Branch'] !=''){ $sql = "SELECT custbranch.branchcode - FROM custbranch - WHERE custbranch.debtorno='" . $_SESSION['CustomerID'] . "' - AND custbranch.branchcode='" . $_POST['Branch'] . "'"; + FROM custbranch + WHERE custbranch.debtorno='" . $_SESSION['CustomerID'] . "' + AND custbranch.branchcode='" . $_POST['Branch'] . "'"; $result = DB_query($sql,$db); if (DB_num_rows($result) ==0){ @@ -85,7 +85,11 @@ $InputError =1; $msg = _('The end date is expected to be after the start date, enter an end date after the start date for this price'); } - + if (Date1GreaterThanDate2(Date($_SESSION['DefaultDateFormat']),$_POST['EndDate'])){ + $InputError =1; + $msg = _('The end date is expected to be after today. There is no point entering a new price where the effective date is before today!'); + } + if ((isset($_POST['Editing']) and $_POST['Editing']=='Yes') AND strlen($Item)>1 AND $InputError !=1) { //editing an existing price @@ -99,8 +103,8 @@ WHERE prices.stockid='" . $Item . "' AND prices.typeabbrev='" . $SalesType . "' AND prices.currabrev='" . $CurrCode . "' - AND prices.startdate='" . FormatDateForSQL($_POST['StartDate']) . "' - AND prices.enddate='" . FormatDateForSQL($_POST['EndDate']) . "' + AND prices.startdate='" . $_POST['OldStartDate'] . "' + AND prices.enddate='" . $_POST['OldEndDate'] . "' AND prices.debtorno='" . $_SESSION['CustomerID'] . "'"; $msg = _('Price Updated'); @@ -136,6 +140,9 @@ $msg = _('The price could not be added because') . ' - ' . DB_error_msg($db); } }else { + ReSequenceEffectiveDates ($Item, $SalesType, $CurrCode, $_SESSION['CustomerID'], $db); + unset($_POST['EndDate']); + unset($_POST['StartDate']); unset($_POST['Price']); } } @@ -163,13 +170,18 @@ //Show the normal prices in the currency of this customer $sql = "SELECT prices.price, - prices.typeabbrev + prices.currabrev, + prices.typeabbrev, + prices.startdate, + prices.enddate FROM prices - WHERE prices.typeabbrev = '" . $SalesType . "' - AND prices.stockid='" . $Item . "' + WHERE prices.stockid='" . $Item . "' + AND prices.typeabbrev='". $SalesType ."' + AND prices.currabrev ='". $CurrCode ."' AND prices.debtorno='' - AND prices.currabrev='" . $CurrCode . "' - ORDER BY typeabbrev"; + ORDER BY currabrev, + typeabbrev, + startdate"; $ErrMsg = _('Could not retrieve the normal prices set up because'); $DbgMsg = _('The SQL used to retrieve these records was'); @@ -183,7 +195,13 @@ } else { echo '<tr><th>' . _('Normal Price') . '</th></tr>'; while ($myrow = DB_fetch_array($result)) { - printf('<tr class="EvenTableRows"><td class=number>%0.2f</td></tr>', $myrow['price']); + printf('<tr class="EvenTableRows"> + <td class=number>%0.2f</td> + <td class=date>%s</td> + <td class=date>%s</td></tr>', + $myrow['price'], + ConvertSQLDate($myrow['startdate']), + ConvertSQLDate($myrow['enddate'])); } } @@ -202,7 +220,9 @@ AND prices.debtorno='" . $_SESSION['CustomerID'] . "' AND prices.currabrev='$CurrCode' AND (custbranch.debtorno='" . $_SESSION['CustomerID'] . "' OR - custbranch.debtorno IS NULL)"; + custbranch.debtorno IS NULL) + ORDER BY prices.branchcode, + prices.startdate"; $ErrMsg = _('Could not retrieve the special prices set up because'); $DbgMsg = _('The SQL used to retrieve these records was'); @@ -263,6 +283,8 @@ if (isset($_GET['Edit']) and $_GET['Edit']==1){ echo '<input type=hidden name="Editing" VALUE="Yes">'; + echo '<input type=hidden name="OldStartDate" VALUE="' . $_GET['StartDate'] .'">'; + echo '<input type=hidden name="OldEndDate" VALUE="' . $_GET['EndDate'] . '">'; $_POST['Price']=$_GET['Price']; $_POST['Branch']=$_GET['Branch']; $_POST['StartDate'] = ConvertSQLDate($_GET['StartDate']); @@ -301,4 +323,52 @@ echo '</form>'; include('includes/footer.inc'); + + function ReSequenceEffectiveDates ($Item, $PriceList, $CurrAbbrev, $CustomerID, $db) { + + $SQL = "SELECT branchcode, + startdate, + enddate + FROM prices + WHERE debtorno='" . $CustomerID . "' + AND stockid='" . $Item . "' + AND currabrev='" . $CurrAbbrev . "' + AND typeabbrev='" . $PriceList . "' + ORDER BY branchcode, + startdate, + enddate"; + $result = DB_query($SQL,$db); + + unset($BranchCode); + + while ($myrow = DB_fetch_array($result)){ + if ($BranchCode != $myrow['branchcode']){ + unset($NextStartDate); + unset($EndDate); + unset($StartDate); + $BranchCode = $myrow['branchcode']; + } + if (isset($NextStartDate)){ + if (Date1GreaterThanDate2(ConvertSQLDate($myrow['startdate']),$NextStartDate)){ + $NextStartDate = ConvertSQLDate($myrow['startdate']); + if (isset($EndDate)) { + /*Need to make the end date the new start date less 1 day */ + $SQL = "UPDATE prices SET enddate = '" . FormatDateForSQL(DateAdd($NextStartDate,'d',-1)) . "' + WHERE stockid ='" .$Item . "' + AND currabrev='" . $CurrAbbrev . "' + AND typeabbrev='" . $PriceList . "' + AND startdate ='" . $StartDate . "' + AND enddate = '" . $EndDate . "' + AND debtorno ='" . $CustomerID . "'"; + $UpdateResult = DB_query($SQL,$db); + } + } //end of if startdate after NextStartDate - we have a new NextStartDate + } //end of if set NextStartDate + else { + $NextStartDate = ConvertSQLDate($myrow['startdate']); + } + $StartDate = $myrow['startdate']; + $EndDate = $myrow['enddate']; + } +} ?> \ No newline at end of file Modified: trunk/doc/Change.log.html =================================================================== --- trunk/doc/Change.log.html 2010-05-07 23:22:18 UTC (rev 3455) +++ trunk/doc/Change.log.html 2010-05-08 08:39:26 UTC (rev 3456) @@ -1,6 +1,8 @@ <p><font SIZE=4 COLOR=BLUE><b>webERP Change Log</b></font></p> <p></p> -<p>06/05/10 Lindsay: Tracker 2929564: dates mangled via QuicK Entry format +<p>08/05/10 Phil: GetPrices.inc now uses the new price startdate and enddate to return the price which falls within the date range base on the current date. Changes to Prices.php and Prices_Customer.php to allow entry of effective from and effective to dates and updating/deleting of prices with appropriate error trapping and rescheduling of enddates where start and end dates would otherwise overlap.</p> +<p>08/05/10 Phil: Found a bug in Date1GreaterThanDate2 function (in includes/DateFunction.inc) with SESSION['DefaultDateFormat'] = 'd/m/Y' this function had been broken </p> +<p>06/05/10 Lindsay: Tracker 2929564: dates mangled via QuicK Entry format</p> <p>05/05/10 Tim: Fix javascript errors in date picker</p> <p>05/05/10 SiteMe: Update to allow RecurringSalesOrdersProcess.php to run via cron</p> <p>05/05/10 SiteMe: Correct statements layout problems caused by the newer version of tcpdf</p> Modified: trunk/includes/DateFunctions.inc =================================================================== --- trunk/includes/DateFunctions.inc 2010-05-07 23:22:18 UTC (rev 3455) +++ trunk/includes/DateFunctions.inc 2010-05-08 08:39:26 UTC (rev 3456) @@ -439,9 +439,12 @@ $Date2 = trim($Date2); /* Get date elements */ - if ($_SESSION['DefaultDateFormat']=='d.m.Y' or $_SESSION['DefaultDateFormat'] =='d/m/Y'){ + if ($_SESSION['DefaultDateFormat']=='d.m.Y' ) { list($Day1,$Month1,$Year1) = explode('.', $Date1); list($Day2,$Month2,$Year2) = explode('.', $Date2); + } elseif ($_SESSION['DefaultDateFormat'] =='d/m/Y'){ + list($Day1,$Month1,$Year1) = explode('/', $Date1); + list($Day2,$Month2,$Year2) = explode('/', $Date2); } elseif ($_SESSION['DefaultDateFormat'] =='m/d/Y'){ list($Month1,$Day1,$Year1) = explode('/', $Date1); list($Month2,$Day2,$Year2) = explode('/', $Date2); @@ -454,6 +457,7 @@ * 2 characters and the other >2 then then make them both 4 characters long. Assume * a date >50 to be 1900's and less than to be 2000's */ + if (strlen($Year1)>2 AND strlen($Year2)==2){ if ($Year2>50) { $Year2=1900+$Year2; Modified: trunk/includes/GetPrice.inc =================================================================== --- trunk/includes/GetPrice.inc 2010-05-07 23:22:18 UTC (rev 3455) +++ trunk/includes/GetPrice.inc 2010-05-08 08:39:26 UTC (rev 3456) @@ -14,7 +14,9 @@ AND prices.stockid = '" . $StockID . "' AND prices.currabrev = debtorsmaster.currcode AND prices.debtorno=debtorsmaster.debtorno - AND prices.branchcode='" . $BranchCode . "'"; + AND prices.branchcode='" . $BranchCode . "' + AND prices.startdate <='" . Date('Y-m-d') . "' + AND prices.enddate >='" . Date('Y-m-d') . "'"; $ErrMsg = _('There is a problem in retrieving the pricing information for part') . ' ' . $StockID . ' ' . _('and for Customer') . ' ' . $DebtorNo . ' ' . _('the error message returned by the SQL server was'); $result = DB_query($sql, $db,$ErrMsg); @@ -22,7 +24,7 @@ if (DB_num_rows($result)==0){ - /* No result from go for customer and branch search try for just a customer match */ + /* No result returned for customer and branch search try for just a customer match */ $sql = "SELECT prices.price, prices.debtorno, prices.branchcode @@ -33,7 +35,9 @@ AND prices.stockid = '" . $StockID . "' AND prices.currabrev = debtorsmaster.currcode AND prices.debtorno=debtorsmaster.debtorno - AND prices.branchcode=''"; + AND prices.branchcode='' + AND prices.startdate <='" . Date('Y-m-d') . "' + AND prices.enddate >='" . Date('Y-m-d') . "'";; $result = DB_query($sql,$db,$ErrMsg); @@ -50,7 +54,10 @@ AND debtorsmaster.debtorno='" . $DebtorNo . "' AND prices.stockid = '" . $StockID . "' AND prices.debtorno='' - AND prices.currabrev = debtorsmaster.currcode"; + AND prices.currabrev = debtorsmaster.currcode + AND prices.startdate <='" . Date('Y-m-d') . "' + AND prices.enddate >='" . Date('Y-m-d') . "'"; + $result = DB_query($sql,$db,$ErrMsg); if (DB_num_rows($result)==0){ @@ -63,7 +70,9 @@ AND prices.currabrev = debtorsmaster.currcode AND debtorsmaster.debtorno='" . $DebtorNo . "' AND prices.typeabbrev='" . $_SESSION['DefaultPriceList'] . "' - AND prices.debtorno=''"; + AND prices.debtorno='' + AND prices.startdate <='" . Date('Y-m-d') . "' + AND prices.enddate >='" . Date('Y-m-d') . "'";; $result = DB_query($sql, $db,$ErrMsg); Modified: trunk/includes/session.inc =================================================================== --- trunk/includes/session.inc 2010-05-07 23:22:18 UTC (rev 3455) +++ trunk/includes/session.inc 2010-05-08 08:39:26 UTC (rev 3456) @@ -138,12 +138,14 @@ $CurrenciesResult = DB_query('SELECT currabrev FROM currencies',$db); while ($CurrencyRow = DB_fetch_row($CurrenciesResult)){ if ($CurrencyRow[0]!=$_SESSION['CompanyRecord']['currencydefault']){ - $UpdateCurrRateResult = DB_query('UPDATE currencies SET - rate=' . GetCurrencyRate ($CurrencyRow[0],$CurrencyRates) . " - WHERE currabrev='" . $CurrencyRow[0] . "'",$db); + + $UpdateCurrRateResult = DB_query('UPDATE currencies SET rate=' . GetCurrencyRate ($CurrencyRow[0],$CurrencyRates) . " WHERE currabrev='" . $CurrencyRow[0] . "'",$db); } } $_SESSION['UpdateCurrencyRatesDaily'] = Date('Y-m-d'); + + + $UpdateConfigResult = DB_query("UPDATE config SET confvalue = '" . Date('Y-m-d') . "' WHERE confname='UpdateCurrencyRatesDaily'",$db); } } Modified: trunk/sql/mysql/upgrade3.11.1-3.12.sql =================================================================== --- trunk/sql/mysql/upgrade3.11.1-3.12.sql 2010-05-07 23:22:18 UTC (rev 3455) +++ trunk/sql/mysql/upgrade3.11.1-3.12.sql 2010-05-08 08:39:26 UTC (rev 3456) @@ -156,3 +156,4 @@ ALTER TABLE `prices` ADD `startdate` DATE NOT NULL , ADD `enddate` DATE NOT NULL DEFAULT '9999-12-31'; ALTER TABLE prices DROP PRIMARY KEY , ADD PRIMARY KEY ( `stockid` , `typeabbrev` , `currabrev` , `debtorno` , `startdate` , `enddate` ) ; +UPDATE prices SET startdate='1999-01-01', enddate='9999-12-31'; This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <lin...@us...> - 2010-05-08 11:29:31
|
Revision: 3457 http://web-erp.svn.sourceforge.net/web-erp/?rev=3457&view=rev Author: lindsayh Date: 2010-05-08 11:29:25 +0000 (Sat, 08 May 2010) Log Message: ----------- Restore API using Login() method to working order. The change to ConnectDB_mysql*.inc used the global variable $DatabaseName as the name of the database to allow running recuring sales orders from cron et al. Our database code organisation needs to be cleaned up somewhat. Modified Paths: -------------- trunk/api/api_php.php trunk/doc/Change.log.html Modified: trunk/api/api_php.php =================================================================== --- trunk/api/api_php.php 2010-05-08 08:39:26 UTC (rev 3456) +++ trunk/api/api_php.php 2010-05-08 11:29:25 UTC (rev 3457) @@ -3,7 +3,7 @@ /* Include session.inc, to allow database connection, and access to miscfunctions, and datefunctions.*/ // FOLLOWING ONLY REQUIRED TO SUPPORT PER FUNCTION AUTHENTICATION - $DatabaseName='weberpdemo'; + $api_DatabaseName='weberpdemo'; // END OF OLD STYLE AUTHENTICATION $AllowAnyone = true; @@ -21,8 +21,8 @@ $_SESSION['AccessLevel'] == '') { // Login to default database = old clients. if ($user != '' && $password != '') { - global $DatabaseName; - $rc = LoginAPI ($DatabaseName, $user, $password); + global $api_DatabaseName; + $rc = LoginAPI ($api_DatabaseName, $user, $password); if ($rc[0] == UL_OK ) { return $_SESSION['db']; } Modified: trunk/doc/Change.log.html =================================================================== --- trunk/doc/Change.log.html 2010-05-08 08:39:26 UTC (rev 3456) +++ trunk/doc/Change.log.html 2010-05-08 11:29:25 UTC (rev 3457) @@ -1,5 +1,6 @@ <p><font SIZE=4 COLOR=BLUE><b>webERP Change Log</b></font></p> <p></p> +<p>08/05/10 Lindsay: API was broken after adding a test for global variable $DatabaseName in ConnectDB_mysql* for this variable being set and using it as DB name if so. The variable of that name in the api_php.php has been changed to $api_DatabaseName.</p> <p>08/05/10 Phil: GetPrices.inc now uses the new price startdate and enddate to return the price which falls within the date range base on the current date. Changes to Prices.php and Prices_Customer.php to allow entry of effective from and effective to dates and updating/deleting of prices with appropriate error trapping and rescheduling of enddates where start and end dates would otherwise overlap.</p> <p>08/05/10 Phil: Found a bug in Date1GreaterThanDate2 function (in includes/DateFunction.inc) with SESSION['DefaultDateFormat'] = 'd/m/Y' this function had been broken </p> <p>06/05/10 Lindsay: Tracker 2929564: dates mangled via QuicK Entry format</p> This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |