From: <dai...@us...> - 2011-07-31 01:31:47
|
Revision: 4645 http://web-erp.svn.sourceforge.net/web-erp/?rev=4645&view=rev Author: daintree Date: 2011-07-31 01:31:41 +0000 (Sun, 31 Jul 2011) Log Message: ----------- Modified Paths: -------------- trunk/UpgradeDatabase.php trunk/doc/Change.log Added Paths: ----------- trunk/BackupDatabase.php Added: trunk/BackupDatabase.php =================================================================== --- trunk/BackupDatabase.php (rev 0) +++ trunk/BackupDatabase.php 2011-07-31 01:31:41 UTC (rev 4645) @@ -0,0 +1,48 @@ +<?php +/* $Id BackupDatabase.php 4183 2010-12-14 09:30:20Z daintree $ */ + +$PageSecurity = 15; //hard coded in case database is old and PageSecurity stuff cannot be retrieved + +include('includes/session.inc'); +$title = _('Backup webERP Database'); +include('includes/header.inc'); + +if (isset($_GET['BackupFile'])){ + unlink($_SERVER['DOCUMENT_ROOT'] . $_GET['BackupFile']); + prnMsg(_('The backup file has been deleted'),'success'); +} else { + + $BackupFile = $rootpath . '/companies/' . $_SESSION['DatabaseName'] .'/' . _('Backup') . '_' . Date('Y-m-d-H-i-s') . '.sql.gz'; + $Command = 'mysqldump --opt -h' . $host . ' -u' . $dbuser . ' -p' . $dbpassword . ' ' . $_SESSION['DatabaseName'] . '| gzip > ' . + $_SERVER['DOCUMENT_ROOT'] . $BackupFile; + + + $CommandOutput = array(); + exec($Command,$CommandOutput, $ReturnValue); + + if ($ReturnValue ==0) { + prnMsg(_('The backup file has now been created. You must now download this to your computer because in case the web-server has a disk failure the backup would then not on the same machine. Use the link below') . '<br /><br /><a href="' . $BackupFile . '">' . _('Download the backup file to your locale machine') . '</a>','success'); + prnMsg(_('Once you have downloaded the database backup file to your local machine you should use the link below to delete it - backup files can consume a lot of space on your hosting account and will accumulate if not deleted - they also contain sensitive information which would otherwise be available for others to download!'),'info'); + echo '<br /> + <br /> + <a href="'. $_SERVER['PHP_SELF'] . '?BackupFile=' .$BackupFile .'">' . _('Delete the backup file off the server') . '</a>'; + } else { + prnMsg(_('There was some problem producing a backup using mysqldump. Normally this relates to a permissions issue - the web-server user must have permission to write to the companies directory'),'error'); + } +} +/* +//this could be a weighty file attachment!! +include('includes/htmlMimeMail.php'); +$mail = new htmlMimeMail(); +$attachment = $mail->getFile( $BackupFile); +$mail->setText(_('webERP backup file attached')); +$mail->addAttachment($attachment, $BackupFile, 'application/gz'); +$mail->setSubject(_('Database Backup')); +$mail->setFrom($_SESSION['CompanyRecord']['coyname'] . '<' . $_SESSION['CompanyRecord']['email'] . '>'); +$result = $mail->send(array('"' . $_SESSION['UsersRealName'] . '" <' . $_SESSION['UserEmail'] . '>')); + +prnMsg(_('A backup of the database has been taken and emailed to you'), 'info'); +unlink($BackupFile); // would be a security issue to leave it there for all to download/see +*/ +include('includes/footer.inc'); +?> \ No newline at end of file Modified: trunk/UpgradeDatabase.php =================================================================== --- trunk/UpgradeDatabase.php 2011-07-30 06:58:14 UTC (rev 4644) +++ trunk/UpgradeDatabase.php 2011-07-31 01:31:41 UTC (rev 4645) @@ -9,7 +9,6 @@ if (!isset($_POST['DoUpgrade'])){ - prnMsg(_('This script will perform any modifications to the database required to allow the additional functionality in later scripts.') . '<br />' . _('You should do a backup now before proceeding!'),'info'); echo '<p><form method="post" action="' . $_SERVER['PHP_SELF'] . '">'; echo '<input type="hidden" name="FormID" value="' . $_SESSION['FormID'] . '" />'; @@ -35,11 +34,16 @@ if ($_SESSION['VersionNumber']=='4.00RC1'){ $_SESSION['VersionNumber']='3.12'; } - prnMsg(_('The webERP code is version') . ' ' . $Version . ' ' . _('and the database version is') . ' ' . $_SESSION['VersionNumber'],'info'); - echo '<input type="hidden" name="OldVersion" value="' . $_SESSION['VersionNumber'] . '" />'; + if ( $_SESSION['VersionNumber'] == $Version){ + prnMsg(_('The database is up to date, there are no upgrades to perform'),'info'); + } else { + prnMsg(_('This script will perform any modifications to the database required to allow the additional functionality in later scripts.') . '<br />' . _('The webERP code is version') . ' ' . $Version . ' ' . _('and the database version is') . ' ' . $_SESSION['VersionNumber'] . '<br /><a target="_blank" href="' . $rootpath . '/BackupDatabase.php">' ._('Click to do a database backup now before proceeding!') . '</a>','info'); + + echo '<input type="hidden" name="OldVersion" value="' . $_SESSION['VersionNumber'] . '" />'; + echo '<div class="centre"><input type="submit" name="DoUpgrade" value="' . _('Perform Database Upgrade') . '" /></div>'; + } } - - echo '<div class="centre"><input type="submit" name="DoUpgrade" value="' . _('Perform Database Upgrade') . '" /></div>'; + echo '</form>'; } @@ -47,26 +51,6 @@ if ($dbType=='mysql' OR $dbType =='mysqli'){ - /* First do a backup - $BackupFile = $PathPrefix . './companies/' . $_SESSION['DatabaseName'] .'/' . _('Backup') . '_' . Date('Y-m-d-H-i-s') . '.sql.gz'; - $Command = 'mysqldump --opt -h' . $host . ' -u' . $dbuser . ' -p' . $dbpassword . ' ' . $_SESSION['DatabaseName'] . '| gzip > ' . $BackupFile; - system($Command); - - //this could be a weighty file attachment!! - include('includes/htmlMimeMail.php'); - $mail = new htmlMimeMail(); - $attachment = $mail->getFile( $BackupFile); - $mail->setText(_('webERP backup file attached')); - $mail->addAttachment($attachment, $BackupFile, 'application/gz'); - $mail->setSubject(_('Database Backup')); - $mail->setFrom($_SESSION['CompanyRecord']['coyname'] . '<' . $_SESSION['CompanyRecord']['email'] . '>'); - $result = $mail->send(array('"' . $_SESSION['UsersRealName'] . '" <' . $_SESSION['UserEmail'] . '>')); - - prnMsg(_('A backup of the database has been taken and emailed to you'), 'info'); - unlink($BackupFile); // would be a security issue to leave it there for all to download/see - - */ - $SQLScripts = array(); if ($_POST['OldVersion']=='Manual') { Modified: trunk/doc/Change.log =================================================================== --- trunk/doc/Change.log 2011-07-30 06:58:14 UTC (rev 4644) +++ trunk/doc/Change.log 2011-07-31 01:31:41 UTC (rev 4645) @@ -1,5 +1,6 @@ webERP Change Log +31/7/11 Phil: BackupDatabase.php script 30/7/11 Phil: SelectCreditItems.php made it so if several sessions creating a credit note they no longer over-write each other. 30/7/11 Ricard: POItems.php now checks for return of more than 1 purchasing data from the supplier and takes the newest record This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <dai...@us...> - 2011-07-31 04:42:16
|
Revision: 4646 http://web-erp.svn.sourceforge.net/web-erp/?rev=4646&view=rev Author: daintree Date: 2011-07-31 04:42:09 +0000 (Sun, 31 Jul 2011) Log Message: ----------- was not updating form variables on update Modified Paths: -------------- trunk/PO_Header.php trunk/doc/Change.log Modified: trunk/PO_Header.php =================================================================== --- trunk/PO_Header.php 2011-07-31 01:31:41 UTC (rev 4645) +++ trunk/PO_Header.php 2011-07-31 04:42:09 UTC (rev 4646) @@ -184,7 +184,7 @@ } -if (isset($_POST['EnterLines'])){ +if (isset($_POST['EnterLines']) OR isset($_POST['AllowRePrint'])){ /*User hit the button to enter line items - * ensure session variables updated then meta refresh to PO_Items.php*/ @@ -216,7 +216,7 @@ $_SESSION['PO'.$identifier]->Tel = $_POST['Tel']; $_SESSION['PO'.$identifier]->Port = $_POST['Port']; - if (isset($_POST['RePrint']) and $_POST['RePrint']==1){ + if (isset($_POST['RePrint']) AND $_POST['RePrint']==1){ $_SESSION['PO'.$identifier]->AllowPrintPO=1; @@ -229,14 +229,15 @@ } else { $_POST['RePrint'] = 0; } - - echo '<meta http-equiv="Refresh" content="0; url=' . $rootpath . '/PO_Items.php?identifier='.$identifier. '">'; - echo '<p>'; - prnMsg(_('You should automatically be forwarded to the entry of the purchase order line items page') . '. ' . - _('If this does not happen') . ' (' . _('if the browser does not support META Refresh') . ') ' . - '<a href="' . $rootpath . '/PO_Items.php?identifier='.$identifier . '">' . _('click here') . '</a> ' . _('to continue'),'info'); + if (!isset($_POST['AllowRePrint'])){ // user only hit update not "Enter Lines" + echo '<meta http-equiv="Refresh" content="0; url=' . $rootpath . '/PO_Items.php?identifier='.$identifier. '">'; + echo '<p>'; + prnMsg(_('You should automatically be forwarded to the entry of the purchase order line items page') . '. ' . + _('If this does not happen') . ' (' . _('if the browser does not support META Refresh') . ') ' . + '<a href="' . $rootpath . '/PO_Items.php?identifier='.$identifier . '">' . _('click here') . '</a> ' . _('to continue'),'info'); include('includes/footer.inc'); exit; + } } /* end of if isset _POST'EnterLines' */ echo '<span style="float:left"><a href="'. $rootpath . '/PO_SelectOSPurchOrder.php?identifier='.$identifier.'">'. _('Back to Purchase Orders'). '</a></span>'; Modified: trunk/doc/Change.log =================================================================== --- trunk/doc/Change.log 2011-07-31 01:31:41 UTC (rev 4645) +++ trunk/doc/Change.log 2011-07-31 04:42:09 UTC (rev 4646) @@ -1,5 +1,6 @@ webERP Change Log +31/7/11 Phil: PO_Header.php - was not updating when update hit as reported by Klaus(opto) 31/7/11 Phil: BackupDatabase.php script 30/7/11 Phil: SelectCreditItems.php made it so if several sessions creating a credit note they no longer over-write each other. 30/7/11 Ricard: POItems.php now checks for return of more than 1 purchasing data from the supplier and takes the newest record This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <dai...@us...> - 2011-07-31 04:42:16
|
Revision: 4646 http://web-erp.svn.sourceforge.net/web-erp/?rev=4646&view=rev Author: daintree Date: 2011-07-31 04:42:09 +0000 (Sun, 31 Jul 2011) Log Message: ----------- was not updating form variables on update Modified Paths: -------------- trunk/PO_Header.php trunk/doc/Change.log Modified: trunk/PO_Header.php =================================================================== --- trunk/PO_Header.php 2011-07-31 01:31:41 UTC (rev 4645) +++ trunk/PO_Header.php 2011-07-31 04:42:09 UTC (rev 4646) @@ -184,7 +184,7 @@ } -if (isset($_POST['EnterLines'])){ +if (isset($_POST['EnterLines']) OR isset($_POST['AllowRePrint'])){ /*User hit the button to enter line items - * ensure session variables updated then meta refresh to PO_Items.php*/ @@ -216,7 +216,7 @@ $_SESSION['PO'.$identifier]->Tel = $_POST['Tel']; $_SESSION['PO'.$identifier]->Port = $_POST['Port']; - if (isset($_POST['RePrint']) and $_POST['RePrint']==1){ + if (isset($_POST['RePrint']) AND $_POST['RePrint']==1){ $_SESSION['PO'.$identifier]->AllowPrintPO=1; @@ -229,14 +229,15 @@ } else { $_POST['RePrint'] = 0; } - - echo '<meta http-equiv="Refresh" content="0; url=' . $rootpath . '/PO_Items.php?identifier='.$identifier. '">'; - echo '<p>'; - prnMsg(_('You should automatically be forwarded to the entry of the purchase order line items page') . '. ' . - _('If this does not happen') . ' (' . _('if the browser does not support META Refresh') . ') ' . - '<a href="' . $rootpath . '/PO_Items.php?identifier='.$identifier . '">' . _('click here') . '</a> ' . _('to continue'),'info'); + if (!isset($_POST['AllowRePrint'])){ // user only hit update not "Enter Lines" + echo '<meta http-equiv="Refresh" content="0; url=' . $rootpath . '/PO_Items.php?identifier='.$identifier. '">'; + echo '<p>'; + prnMsg(_('You should automatically be forwarded to the entry of the purchase order line items page') . '. ' . + _('If this does not happen') . ' (' . _('if the browser does not support META Refresh') . ') ' . + '<a href="' . $rootpath . '/PO_Items.php?identifier='.$identifier . '">' . _('click here') . '</a> ' . _('to continue'),'info'); include('includes/footer.inc'); exit; + } } /* end of if isset _POST'EnterLines' */ echo '<span style="float:left"><a href="'. $rootpath . '/PO_SelectOSPurchOrder.php?identifier='.$identifier.'">'. _('Back to Purchase Orders'). '</a></span>'; Modified: trunk/doc/Change.log =================================================================== --- trunk/doc/Change.log 2011-07-31 01:31:41 UTC (rev 4645) +++ trunk/doc/Change.log 2011-07-31 04:42:09 UTC (rev 4646) @@ -1,5 +1,6 @@ webERP Change Log +31/7/11 Phil: PO_Header.php - was not updating when update hit as reported by Klaus(opto) 31/7/11 Phil: BackupDatabase.php script 30/7/11 Phil: SelectCreditItems.php made it so if several sessions creating a credit note they no longer over-write each other. 30/7/11 Ricard: POItems.php now checks for return of more than 1 purchasing data from the supplier and takes the newest record This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <dai...@us...> - 2011-08-04 08:24:38
|
Revision: 4647 http://web-erp.svn.sourceforge.net/web-erp/?rev=4647&view=rev Author: daintree Date: 2011-08-04 08:24:32 +0000 (Thu, 04 Aug 2011) Log Message: ----------- ricards fix for SalesInquiry.php Modified Paths: -------------- trunk/SalesInquiry.php trunk/doc/Change.log Modified: trunk/SalesInquiry.php =================================================================== --- trunk/SalesInquiry.php 2011-07-31 04:42:09 UTC (rev 4646) +++ trunk/SalesInquiry.php 2011-08-04 08:24:32 UTC (rev 4647) @@ -176,7 +176,7 @@ salesorders.branchcode, salesorderdetails.quantity, salesorderdetails.qtyinvoiced, - (salesorderdetails.quantity * salesorderdetails.unitprice) as extprice, + (salesorderdetails.quantity * salesorderdetails.unitprice * (1 - salesorderdetails.discountpercent)) as extprice, (salesorderdetails.quantity * stockmaster.actualcost) as extcost, IF(salesorderdetails.quantity = salesorderdetails.qtyinvoiced || salesorderdetails.completed = 1,'Completed','Open') as linestatus, @@ -213,7 +213,7 @@ salesorders.branchcode, salesorderdetails.quantity, salesorderdetails.qtyinvoiced, - (tempstockmoves.qty * salesorderdetails.unitprice) * -1 as extprice, + (tempstockmoves.qty * salesorderdetails.unitprice * (1 - salesorderdetails.discountpercent)) * -1 as extprice, (tempstockmoves.qty * tempstockmoves.standardcost) * -1 as extcost, IF(salesorderdetails.quantity = salesorderdetails.qtyinvoiced || salesorderdetails.completed = 1,'Completed','Open') as linestatus, @@ -264,7 +264,7 @@ $sql = "SELECT salesorderdetails.stkcode, SUM(salesorderdetails.quantity) as quantity, SUM(salesorderdetails.qtyinvoiced) as qtyinvoiced, - SUM(salesorderdetails.quantity * salesorderdetails.unitprice) as extprice, + SUM(salesorderdetails.quantity * salesorderdetails.unitprice * (1 - salesorderdetails.discountpercent)) as extprice, SUM(salesorderdetails.quantity * stockmaster.actualcost) as extcost, stockmaster.description, stockmaster.decimalplaces @@ -298,7 +298,7 @@ debtorsmaster.name, SUM(salesorderdetails.quantity) as quantity, SUM(salesorderdetails.qtyinvoiced) as qtyinvoiced, - SUM(salesorderdetails.quantity * salesorderdetails.unitprice) as extprice, + SUM(salesorderdetails.quantity * salesorderdetails.unitprice * (1 - salesorderdetails.discountpercent)) as extprice, SUM(salesorderdetails.quantity * stockmaster.actualcost) as extcost FROM salesorderdetails LEFT JOIN salesorders ON salesorders.orderno=salesorderdetails.orderno @@ -331,7 +331,7 @@ debtorsmaster.name, SUM(salesorderdetails.quantity) as quantity, SUM(salesorderdetails.qtyinvoiced) as qtyinvoiced, - SUM(salesorderdetails.quantity * salesorderdetails.unitprice) as extprice, + SUM(salesorderdetails.quantity * salesorderdetails.unitprice * (1 - salesorderdetails.discountpercent)) as extprice, SUM(salesorderdetails.quantity * stockmaster.actualcost) as extcost FROM salesorderdetails LEFT JOIN salesorders ON salesorders.orderno=salesorderdetails.orderno @@ -361,7 +361,7 @@ CONCAT(MONTHNAME(salesorders.orddate),' ',YEAR(salesorders.orddate)) as monthname, SUM(salesorderdetails.quantity) as quantity, SUM(salesorderdetails.qtyinvoiced) as qtyinvoiced, - SUM(salesorderdetails.quantity * salesorderdetails.unitprice) as extprice, + SUM(salesorderdetails.quantity * salesorderdetails.unitprice * (1 - salesorderdetails.discountpercent)) as extprice, SUM(salesorderdetails.quantity * stockmaster.actualcost) as extcost FROM salesorderdetails LEFT JOIN salesorders ON salesorders.orderno=salesorderdetails.orderno @@ -390,7 +390,7 @@ stockcategory.categorydescription, SUM(salesorderdetails.quantity) as quantity, SUM(salesorderdetails.qtyinvoiced) as qtyinvoiced, - SUM(salesorderdetails.quantity * salesorderdetails.unitprice) as extprice, + SUM(salesorderdetails.quantity * salesorderdetails.unitprice * (1 - salesorderdetails.discountpercent)) as extprice, SUM(salesorderdetails.quantity * stockmaster.actualcost) as extcost FROM salesorderdetails LEFT JOIN salesorders ON salesorders.orderno=salesorderdetails.orderno @@ -419,7 +419,7 @@ salesman.salesmanname, SUM(salesorderdetails.quantity) as quantity, SUM(salesorderdetails.qtyinvoiced) as qtyinvoiced, - SUM(salesorderdetails.quantity * salesorderdetails.unitprice) as extprice, + SUM(salesorderdetails.quantity * salesorderdetails.unitprice * (1 - salesorderdetails.discountpercent)) as extprice, SUM(salesorderdetails.quantity * stockmaster.actualcost) as extcost FROM salesorderdetails LEFT JOIN salesorders ON salesorders.orderno=salesorderdetails.orderno @@ -448,7 +448,7 @@ areas.areadescription, SUM(salesorderdetails.quantity) as quantity, SUM(salesorderdetails.qtyinvoiced) as qtyinvoiced, - SUM(salesorderdetails.quantity * salesorderdetails.unitprice) as extprice, + SUM(salesorderdetails.quantity * salesorderdetails.unitprice * (1 - salesorderdetails.discountpercent)) as extprice, SUM(salesorderdetails.quantity * stockmaster.actualcost) as extcost FROM salesorderdetails LEFT JOIN salesorders ON salesorders.orderno=salesorderdetails.orderno Modified: trunk/doc/Change.log =================================================================== --- trunk/doc/Change.log 2011-07-31 04:42:09 UTC (rev 4646) +++ trunk/doc/Change.log 2011-08-04 08:24:32 UTC (rev 4647) @@ -1,5 +1,6 @@ webERP Change Log +4/8/11 Ricard: SalesInquiry.php now shows net sales after discounts 31/7/11 Phil: PO_Header.php - was not updating when update hit as reported by Klaus(opto) 31/7/11 Phil: BackupDatabase.php script 30/7/11 Phil: SelectCreditItems.php made it so if several sessions creating a credit note they no longer over-write each other. This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <dai...@us...> - 2011-08-04 08:24:38
|
Revision: 4647 http://web-erp.svn.sourceforge.net/web-erp/?rev=4647&view=rev Author: daintree Date: 2011-08-04 08:24:32 +0000 (Thu, 04 Aug 2011) Log Message: ----------- ricards fix for SalesInquiry.php Modified Paths: -------------- trunk/SalesInquiry.php trunk/doc/Change.log Modified: trunk/SalesInquiry.php =================================================================== --- trunk/SalesInquiry.php 2011-07-31 04:42:09 UTC (rev 4646) +++ trunk/SalesInquiry.php 2011-08-04 08:24:32 UTC (rev 4647) @@ -176,7 +176,7 @@ salesorders.branchcode, salesorderdetails.quantity, salesorderdetails.qtyinvoiced, - (salesorderdetails.quantity * salesorderdetails.unitprice) as extprice, + (salesorderdetails.quantity * salesorderdetails.unitprice * (1 - salesorderdetails.discountpercent)) as extprice, (salesorderdetails.quantity * stockmaster.actualcost) as extcost, IF(salesorderdetails.quantity = salesorderdetails.qtyinvoiced || salesorderdetails.completed = 1,'Completed','Open') as linestatus, @@ -213,7 +213,7 @@ salesorders.branchcode, salesorderdetails.quantity, salesorderdetails.qtyinvoiced, - (tempstockmoves.qty * salesorderdetails.unitprice) * -1 as extprice, + (tempstockmoves.qty * salesorderdetails.unitprice * (1 - salesorderdetails.discountpercent)) * -1 as extprice, (tempstockmoves.qty * tempstockmoves.standardcost) * -1 as extcost, IF(salesorderdetails.quantity = salesorderdetails.qtyinvoiced || salesorderdetails.completed = 1,'Completed','Open') as linestatus, @@ -264,7 +264,7 @@ $sql = "SELECT salesorderdetails.stkcode, SUM(salesorderdetails.quantity) as quantity, SUM(salesorderdetails.qtyinvoiced) as qtyinvoiced, - SUM(salesorderdetails.quantity * salesorderdetails.unitprice) as extprice, + SUM(salesorderdetails.quantity * salesorderdetails.unitprice * (1 - salesorderdetails.discountpercent)) as extprice, SUM(salesorderdetails.quantity * stockmaster.actualcost) as extcost, stockmaster.description, stockmaster.decimalplaces @@ -298,7 +298,7 @@ debtorsmaster.name, SUM(salesorderdetails.quantity) as quantity, SUM(salesorderdetails.qtyinvoiced) as qtyinvoiced, - SUM(salesorderdetails.quantity * salesorderdetails.unitprice) as extprice, + SUM(salesorderdetails.quantity * salesorderdetails.unitprice * (1 - salesorderdetails.discountpercent)) as extprice, SUM(salesorderdetails.quantity * stockmaster.actualcost) as extcost FROM salesorderdetails LEFT JOIN salesorders ON salesorders.orderno=salesorderdetails.orderno @@ -331,7 +331,7 @@ debtorsmaster.name, SUM(salesorderdetails.quantity) as quantity, SUM(salesorderdetails.qtyinvoiced) as qtyinvoiced, - SUM(salesorderdetails.quantity * salesorderdetails.unitprice) as extprice, + SUM(salesorderdetails.quantity * salesorderdetails.unitprice * (1 - salesorderdetails.discountpercent)) as extprice, SUM(salesorderdetails.quantity * stockmaster.actualcost) as extcost FROM salesorderdetails LEFT JOIN salesorders ON salesorders.orderno=salesorderdetails.orderno @@ -361,7 +361,7 @@ CONCAT(MONTHNAME(salesorders.orddate),' ',YEAR(salesorders.orddate)) as monthname, SUM(salesorderdetails.quantity) as quantity, SUM(salesorderdetails.qtyinvoiced) as qtyinvoiced, - SUM(salesorderdetails.quantity * salesorderdetails.unitprice) as extprice, + SUM(salesorderdetails.quantity * salesorderdetails.unitprice * (1 - salesorderdetails.discountpercent)) as extprice, SUM(salesorderdetails.quantity * stockmaster.actualcost) as extcost FROM salesorderdetails LEFT JOIN salesorders ON salesorders.orderno=salesorderdetails.orderno @@ -390,7 +390,7 @@ stockcategory.categorydescription, SUM(salesorderdetails.quantity) as quantity, SUM(salesorderdetails.qtyinvoiced) as qtyinvoiced, - SUM(salesorderdetails.quantity * salesorderdetails.unitprice) as extprice, + SUM(salesorderdetails.quantity * salesorderdetails.unitprice * (1 - salesorderdetails.discountpercent)) as extprice, SUM(salesorderdetails.quantity * stockmaster.actualcost) as extcost FROM salesorderdetails LEFT JOIN salesorders ON salesorders.orderno=salesorderdetails.orderno @@ -419,7 +419,7 @@ salesman.salesmanname, SUM(salesorderdetails.quantity) as quantity, SUM(salesorderdetails.qtyinvoiced) as qtyinvoiced, - SUM(salesorderdetails.quantity * salesorderdetails.unitprice) as extprice, + SUM(salesorderdetails.quantity * salesorderdetails.unitprice * (1 - salesorderdetails.discountpercent)) as extprice, SUM(salesorderdetails.quantity * stockmaster.actualcost) as extcost FROM salesorderdetails LEFT JOIN salesorders ON salesorders.orderno=salesorderdetails.orderno @@ -448,7 +448,7 @@ areas.areadescription, SUM(salesorderdetails.quantity) as quantity, SUM(salesorderdetails.qtyinvoiced) as qtyinvoiced, - SUM(salesorderdetails.quantity * salesorderdetails.unitprice) as extprice, + SUM(salesorderdetails.quantity * salesorderdetails.unitprice * (1 - salesorderdetails.discountpercent)) as extprice, SUM(salesorderdetails.quantity * stockmaster.actualcost) as extcost FROM salesorderdetails LEFT JOIN salesorders ON salesorders.orderno=salesorderdetails.orderno Modified: trunk/doc/Change.log =================================================================== --- trunk/doc/Change.log 2011-07-31 04:42:09 UTC (rev 4646) +++ trunk/doc/Change.log 2011-08-04 08:24:32 UTC (rev 4647) @@ -1,5 +1,6 @@ webERP Change Log +4/8/11 Ricard: SalesInquiry.php now shows net sales after discounts 31/7/11 Phil: PO_Header.php - was not updating when update hit as reported by Klaus(opto) 31/7/11 Phil: BackupDatabase.php script 30/7/11 Phil: SelectCreditItems.php made it so if several sessions creating a credit note they no longer over-write each other. This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <dai...@us...> - 2011-08-04 09:12:51
|
Revision: 4648 http://web-erp.svn.sourceforge.net/web-erp/?rev=4648&view=rev Author: daintree Date: 2011-08-04 09:12:45 +0000 (Thu, 04 Aug 2011) Log Message: ----------- fix for GPPercent reported on discount matrix updates Modified Paths: -------------- trunk/PO_SelectOSPurchOrder.php trunk/SelectOrderItems.php trunk/doc/Change.log trunk/includes/DefineCartClass.php trunk/includes/SelectOrderItems_IntoCart.inc Modified: trunk/PO_SelectOSPurchOrder.php =================================================================== --- trunk/PO_SelectOSPurchOrder.php 2011-08-04 08:24:32 UTC (rev 4647) +++ trunk/PO_SelectOSPurchOrder.php 2011-08-04 09:12:45 UTC (rev 4648) @@ -129,7 +129,7 @@ */ if (!isset($OrderNumber) or $OrderNumber=='' ){ - echo '<a href="' . $rootpath . '/PO_Header.php?' .SID . '&NewOrder=Yes">' . _('Add Purchase Order') . '</a>'; + echo '<a href="' . $rootpath . '/PO_Header.php?NewOrder=Yes">' . _('Add Purchase Order') . '</a>'; echo '<p class="page_title_text"><img src="'.$rootpath.'/css/'.$theme.'/images/magnifier.png" title="' . _('Search') . '" alt="">' . ' ' . $title.'</p>'; echo '<table class=selection><tr><td>'._('Order Number') . ': <input type="text" name="OrderNumber" maxlength="8" size="9" /> ' . _('Into Stock Location') . ':<select name="StockLocation">'; @@ -183,7 +183,9 @@ echo '<br /><font size=1><div class="page_help_text">' ._('To search for purchase orders for a specific part use the part selection facilities below') .'</div> </font>'; -echo '<br /><table class="selection"><tr>'; +echo '<br /> + <table class="selection"> + <tr>'; echo '<td><font size="1">' . _('Select a stock category') . ':</font><select name="StockCat">'; @@ -196,11 +198,20 @@ } echo '</select>'; echo '<td><font size=1>' . _('Enter text extracts in the') . '<b>' . _('description') . '</b>:</font></td>'; -echo '<td><input type="Text" name="Keywords" size=20 maxlength=25></td></tr><tr><td></td>'; +echo '<td><input type="text" name="Keywords" size="20" maxlength="25"></td> + </tr> + <tr><td></td>'; echo '<td><font size<b>' . _('OR') . '</b></font><font size=1>' . _('Enter extract of the') . '<b>' . _('Stock Code') . '</b>:</font></td>'; -echo '<td><input type="Text" name="StockCode" size=15 maxlength=18></td></tr></table><br />'; -echo '<table><tr><td><input type=submit name="SearchParts" value="' . _('Search Parts Now') . '">'; -echo '<input type=submit name="ResetPart" value="' . _('Show All') . '"></td></tr></table>'; +echo '<td><input type="text" name="StockCode" size="15" maxlength="18"></td> + </tr> + </table> + <br />'; +echo '<table> + <tr> + <td><input type="submit" name="SearchParts" value="' . _('Search Parts Now') . '"> + <input type=submit name="ResetPart" value="' . _('Show All') . '"></td> + </tr> + </table>'; echo '<br />'; @@ -229,8 +240,8 @@ printf('<td><input type="submit" name="SelectedStockItem" value="%s"</td> <td>%s</td> - <td class=number>%s</td> - <td class=number>%s</td> + <td class="number">%s</td> + <td class="number">%s</td> <td>%s</td></tr>', $myrow['stockid'], $myrow['description'], @@ -267,7 +278,7 @@ $StatusCriteria = " AND purchorders.status='Cancelled' "; } - if (isset($OrderNumber) && $OrderNumber !='') { + if (isset($OrderNumber) AND $OrderNumber !='') { $SQL = "SELECT purchorders.orderno, suppliers.suppname, purchorders.orddate, @@ -303,119 +314,119 @@ if (isset($SelectedStockItem)) { $SQL = "SELECT purchorders.realorderno, - purchorders.orderno, - suppliers.suppname, - purchorders.orddate, - purchorders.status, - purchorders.initiator, - purchorders.requisitionno, - purchorders.allowprint, - suppliers.currcode, - SUM(purchorderdetails.unitprice*purchorderdetails.quantityord) AS ordervalue - FROM purchorders INNER JOIN purchorderdetails - ON purchorders.orderno = purchorderdetails.orderno - INNER JOIN suppliers - ON purchorders.supplierno = suppliers.supplierid - WHERE purchorderdetails.completed=0 - AND purchorderdetails.itemcode='". $SelectedStockItem ."' - AND purchorders.supplierno='" . $SelectedSupplier ."' - AND purchorders.intostocklocation = '". $_POST['StockLocation'] . "' - " . $StatusCriteria . " - GROUP BY purchorders.orderno ASC, - purchorders.realorderno, - suppliers.suppname, - purchorders.orddate, - purchorders.status, - purchorders.initiator, - purchorders.requisitionno, - purchorders.allowprint, - suppliers.currcode"; + purchorders.orderno, + suppliers.suppname, + purchorders.orddate, + purchorders.status, + purchorders.initiator, + purchorders.requisitionno, + purchorders.allowprint, + suppliers.currcode, + SUM(purchorderdetails.unitprice*purchorderdetails.quantityord) AS ordervalue + FROM purchorders INNER JOIN purchorderdetails + ON purchorders.orderno = purchorderdetails.orderno + INNER JOIN suppliers + ON purchorders.supplierno = suppliers.supplierid + WHERE purchorderdetails.completed=0 + AND purchorderdetails.itemcode='". $SelectedStockItem ."' + AND purchorders.supplierno='" . $SelectedSupplier ."' + AND purchorders.intostocklocation = '". $_POST['StockLocation'] . "' + " . $StatusCriteria . " + GROUP BY purchorders.orderno ASC, + purchorders.realorderno, + suppliers.suppname, + purchorders.orddate, + purchorders.status, + purchorders.initiator, + purchorders.requisitionno, + purchorders.allowprint, + suppliers.currcode"; } else { $SQL = "SELECT purchorders.realorderno, - purchorders.orderno, - suppliers.suppname, - purchorders.orddate, - purchorders.status, - purchorders.initiator, - purchorders.requisitionno, - purchorders.allowprint, - suppliers.currcode, - SUM(purchorderdetails.unitprice*purchorderdetails.quantityord) AS ordervalue - FROM purchorders INNER JOIN purchorderdetails - ON purchorders.orderno = purchorderdetails.orderno - INNER JOIN suppliers - ON purchorders.supplierno = suppliers.supplierid - WHERE purchorderdetails.completed=0 - AND purchorders.supplierno='" . $SelectedSupplier ."' - AND purchorders.intostocklocation = '". $_POST['StockLocation'] . "' - " . $StatusCriteria . " - GROUP BY purchorders.orderno ASC, - purchorders.realorderno, - suppliers.suppname, - purchorders.orddate, - purchorders.status, - purchorders.initiator, - purchorders.requisitionno, - purchorders.allowprint, - suppliers.currcode"; + purchorders.orderno, + suppliers.suppname, + purchorders.orddate, + purchorders.status, + purchorders.initiator, + purchorders.requisitionno, + purchorders.allowprint, + suppliers.currcode, + SUM(purchorderdetails.unitprice*purchorderdetails.quantityord) AS ordervalue + FROM purchorders INNER JOIN purchorderdetails + ON purchorders.orderno = purchorderdetails.orderno + INNER JOIN suppliers + ON purchorders.supplierno = suppliers.supplierid + WHERE purchorderdetails.completed=0 + AND purchorders.supplierno='" . $SelectedSupplier ."' + AND purchorders.intostocklocation = '". $_POST['StockLocation'] . "' + " . $StatusCriteria . " + GROUP BY purchorders.orderno ASC, + purchorders.realorderno, + suppliers.suppname, + purchorders.orddate, + purchorders.status, + purchorders.initiator, + purchorders.requisitionno, + purchorders.allowprint, + suppliers.currcode"; } } else { //no supplier selected if (!isset($_POST['StockLocation'])) {$_POST['StockLocation']='';} if (isset($SelectedStockItem) and isset($_POST['StockLocation'])) { $SQL = "SELECT purchorders.realorderno, - purchorders.orderno, - suppliers.suppname, - purchorders.orddate, - purchorders.status, - purchorders.initiator, - purchorders.requisitionno, - purchorders.allowprint, - suppliers.currcode, - SUM(purchorderdetails.unitprice*purchorderdetails.quantityord) AS ordervalue - FROM purchorders INNER JOIN purchorderdetails - ON purchorders.orderno = purchorderdetails.orderno - INNER JOIN suppliers - ON purchorders.supplierno = suppliers.supplierid - WHERE purchorderdetails.completed=0 - AND purchorderdetails.itemcode='". $SelectedStockItem ."' - AND purchorders.intostocklocation = '". $_POST['StockLocation'] . "' - " . $StatusCriteria . " - GROUP BY purchorders.orderno ASC, - purchorders.realorderno, - suppliers.suppname, - purchorders.orddate, - purchorders.status, - purchorders.initiator, - purchorders.requisitionno, - purchorders.allowprint, - suppliers.currcode"; + purchorders.orderno, + suppliers.suppname, + purchorders.orddate, + purchorders.status, + purchorders.initiator, + purchorders.requisitionno, + purchorders.allowprint, + suppliers.currcode, + SUM(purchorderdetails.unitprice*purchorderdetails.quantityord) AS ordervalue + FROM purchorders INNER JOIN purchorderdetails + ON purchorders.orderno = purchorderdetails.orderno + INNER JOIN suppliers + ON purchorders.supplierno = suppliers.supplierid + WHERE purchorderdetails.completed=0 + AND purchorderdetails.itemcode='". $SelectedStockItem ."' + AND purchorders.intostocklocation = '". $_POST['StockLocation'] . "' + " . $StatusCriteria . " + GROUP BY purchorders.orderno ASC, + purchorders.realorderno, + suppliers.suppname, + purchorders.orddate, + purchorders.status, + purchorders.initiator, + purchorders.requisitionno, + purchorders.allowprint, + suppliers.currcode"; } else { $SQL = "SELECT purchorders.realorderno, - purchorders.orderno, - suppliers.suppname, - purchorders.orddate, - purchorders.status, - purchorders.initiator, - purchorders.requisitionno, - purchorders.allowprint, - suppliers.currcode, - SUM(purchorderdetails.unitprice*purchorderdetails.quantityord) AS ordervalue - FROM purchorders INNER JOIN purchorderdetails - ON purchorders.orderno = purchorderdetails.orderno - INNER JOIN suppliers - ON purchorders.supplierno = suppliers.supplierid - WHERE purchorderdetails.completed=0 - AND purchorders.intostocklocation = '". $_POST['StockLocation'] . "' - " . $StatusCriteria . " - GROUP BY purchorders.orderno ASC, - purchorders.realorderno, - suppliers.suppname, - purchorders.orddate, - purchorders.status, - purchorders.initiator, - purchorders.requisitionno, - purchorders.allowprint, - suppliers.currcode"; + purchorders.orderno, + suppliers.suppname, + purchorders.orddate, + purchorders.status, + purchorders.initiator, + purchorders.requisitionno, + purchorders.allowprint, + suppliers.currcode, + SUM(purchorderdetails.unitprice*purchorderdetails.quantityord) AS ordervalue + FROM purchorders INNER JOIN purchorderdetails + ON purchorders.orderno = purchorderdetails.orderno + INNER JOIN suppliers + ON purchorders.supplierno = suppliers.supplierid + WHERE purchorderdetails.completed=0 + AND purchorders.intostocklocation = '". $_POST['StockLocation'] . "' + " . $StatusCriteria . " + GROUP BY purchorders.orderno ASC, + purchorders.realorderno, + suppliers.suppname, + purchorders.orddate, + purchorders.status, + purchorders.initiator, + purchorders.requisitionno, + purchorders.allowprint, + suppliers.currcode"; } } //end selected supplier @@ -430,20 +441,20 @@ // '</td><td class="tableheader">' . _('Receive') . - echo '<tr><th>' . _('Order #') . - '</th><th>' . _('Order Date') . - '</th><th>' . _('Initiated by') . - '</th><th>' . _('Supplier') . - '</th><th>' . _('Currency') . - '</th>'; + echo '<tr> + <th>' . _('Order #') . '</th> + <th>' . _('Order Date') . '</th> + <th>' . _('Initiated by') . '</th> + <th>' . _('Supplier') . '</th> + <th>' . _('Currency') . '</th>'; + if (in_array($PricesSecurity, $_SESSION['AllowedPageSecurityTokens']) OR !isset($PricesSecurity)) { echo '<th>' . _('Order Total') .'</th>'; } echo '<th>' . _('Status') . '</th> - <th>' . _('Modify') . '</th> - <th>' . _('Print') . '</th> - <th>' . _('Receive') . '</th> - </tr>'; + <th>' . _('Print') . '</th> + <th>' . _('Receive') . '</th> + </tr>'; $j = 1; $k=0; //row colour counter while ($myrow=DB_fetch_array($PurchOrdersResult)) { @@ -456,20 +467,20 @@ $k++; } - $ModifyPage = $rootpath . '/PO_Header.php?' . SID . '&ModifyOrderNumber=' . $myrow['orderno']; + $ModifyPage = $rootpath . '/PO_Header.php?ModifyOrderNumber=' . $myrow['orderno']; if ($myrow['status'] == 'Printed') { - $ReceiveOrder = '<a href="'.$rootpath . '/GoodsReceived.php?' . SID . '&PONumber=' . $myrow['orderno'].'">'. + $ReceiveOrder = '<a href="'.$rootpath . '/GoodsReceived.php?PONumber=' . $myrow['orderno'].'">'. _('Receive').'</a>'; } else { - $ReceiveOrder = _('Receive'); + $ReceiveOrder = ''; } if ($myrow['status'] == 'Authorised' AND $myrow['allowprint'] == 1){ - $PrintPurchOrder = '<a target="_blank" href="' . $rootpath . '/PO_PDFPurchOrder.php?' . SID . '&OrderNo=' . $myrow['orderno'] . '">' . _('Print Now') . '</a>'; + $PrintPurchOrder = '<a target="_blank" href="' . $rootpath . '/PO_PDFPurchOrder.php?OrderNo=' . $myrow['orderno'] . '">' . _('Print') . '</a>'; } elseif ($myrow['status'] == 'Authorisied' AND $myrow['allowprint'] == 0) { $PrintPurchOrder = _('Printed'); } elseif ($myrow['status'] == 'Printed'){ - $PrintPurchOrder = '<a target="_blank" href="' . $rootpath . '/PO_PDFPurchOrder.php?' . SID . '&OrderNo=' . $myrow['orderno'] . '&realorderno=' . $myrow['realorderno'] . '&ViewingOnly=2"> - ' . _('Print') . '</a>'; + $PrintPurchOrder = '<a target="_blank" href="' . $rootpath . '/PO_PDFPurchOrder.php?OrderNo=' . $myrow['orderno'] . '&realorderno=' . $myrow['realorderno'] . '&ViewingOnly=2"> + ' . _('Print Copy') . '</a>'; } else { $PrintPurchOrder = _('N/A'); } @@ -478,7 +489,7 @@ $FormatedOrderDate = ConvertSQLDate($myrow['orddate']); $FormatedOrderValue = number_format($myrow['ordervalue'],2); - echo '<td>' . $myrow['orderno'] . '</td> + echo '<td><a href="'.$ModifyPage.'">' . $myrow['orderno'] . '</a></td> <td>' . $FormatedOrderDate . '</td> <td>' . $myrow['initiator'] . '</td> <td>' . $myrow['suppname'] . '</td> @@ -487,10 +498,9 @@ echo '<td class=number>'.$FormatedOrderValue . '</td>'; } echo '<td>' . _($myrow['status']) . '</td> - <td><a href="'.$ModifyPage.'">' . _('Modify') . '</a></td> - <td>' . $PrintPurchOrder . '</td> - <td>' . $ReceiveOrder . '</td> - </tr>'; + <td>' . $PrintPurchOrder . '</td> + <td>' . $ReceiveOrder . '</td> + </tr>'; //end of page full new headings if } //end of while loop Modified: trunk/SelectOrderItems.php =================================================================== --- trunk/SelectOrderItems.php 2011-08-04 08:24:32 UTC (rev 4647) +++ trunk/SelectOrderItems.php 2011-08-04 09:12:45 UTC (rev 4648) @@ -1207,6 +1207,7 @@ foreach ($_SESSION['Items'.$identifier]->LineItems as $OrderLine_2) { if ($OrderLine_2->DiscCat==$OrderLine->DiscCat){ $_SESSION['Items'.$identifier]->LineItems[$OrderLine_2->LineNumber]->DiscountPercent = $DiscountMatrixRate; + $_SESSION['Items'.$identifier]->LineItems[$OrderLine_2->LineNumber]->GPPercent = (($_SESSION['Items'.$identifier]->LineItems[$OrderLine_2->LineNumber]->Price*(1-($DiscountMatrixRate/100))) - $_SESSION['Items'.$identifier]->LineItems[$OrderLine_2->LineNumber]->StandardCost*$ExRate)/($_SESSION['Items'.$identifier]->LineItems[$OrderLine_2->LineNumber]->Price *(1-$DiscountMatrixRate)/100); } } } @@ -1214,9 +1215,9 @@ } /* end of discount matrix lookup code */ } // the order session is started or there is a new item being added if (isset($_POST['DeliveryDetails'])){ - echo '<meta http-equiv="Refresh" content="0; url=' . $rootpath . '/DeliveryDetails.php?' . SID .'identifier='.$identifier . '">'; + echo '<meta http-equiv="refresh" content="0; url=' . $rootpath . '/DeliveryDetails.php?identifier='.$identifier . '">'; prnMsg(_('You should automatically be forwarded to the entry of the delivery details page') . '. ' . _('if this does not happen') . ' (' . _('if the browser does not support META Refresh') . ') ' . - '<a href="' . $rootpath . '/DeliveryDetails.php?' . SID .'identifier='.$identifier . '">' . _('click here') . '</a> ' . _('to continue'), 'info'); + '<a href="' . $rootpath . '/DeliveryDetails.php?identifier='.$identifier . '">' . _('click here') . '</a> ' . _('to continue'), 'info'); exit; } Modified: trunk/doc/Change.log =================================================================== --- trunk/doc/Change.log 2011-08-04 08:24:32 UTC (rev 4647) +++ trunk/doc/Change.log 2011-08-04 09:12:45 UTC (rev 4648) @@ -1,5 +1,6 @@ webERP Change Log +4/8/11 Phil: Fix GP Percent reported when discounts updated by discount matrix 4/8/11 Ricard: SalesInquiry.php now shows net sales after discounts 31/7/11 Phil: PO_Header.php - was not updating when update hit as reported by Klaus(opto) 31/7/11 Phil: BackupDatabase.php script Modified: trunk/includes/DefineCartClass.php =================================================================== --- trunk/includes/DefineCartClass.php 2011-08-04 08:24:32 UTC (rev 4647) +++ trunk/includes/DefineCartClass.php 2011-08-04 09:12:45 UTC (rev 4648) @@ -246,7 +246,7 @@ /* Makes a comma seperated list of the stock items ordered for use in SQL expressions */ - $StockID_List=""; + $StockID_List=''; foreach ($this->LineItems as $StockItem) { $StockID_List .= ",'" . $StockItem->StockID . "'"; } Modified: trunk/includes/SelectOrderItems_IntoCart.inc =================================================================== --- trunk/includes/SelectOrderItems_IntoCart.inc 2011-08-04 08:24:32 UTC (rev 4647) +++ trunk/includes/SelectOrderItems_IntoCart.inc 2011-08-04 09:12:45 UTC (rev 4648) @@ -98,7 +98,7 @@ AND discountcategory ='" . $myrow['discountcategory'] . "' AND quantitybreak <" . $NewItemQty,$db); $DiscCatRow = DB_fetch_row($result); - if ($DiscCatRow[0] != "" && $DiscCatRow[0] > 0) { + if ($DiscCatRow[0] != '' AND $DiscCatRow[0] > 0) { $Discount = $DiscCatRow[0]; } else { $Discount = 0; This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <dai...@us...> - 2011-08-04 09:12:54
|
Revision: 4648 http://web-erp.svn.sourceforge.net/web-erp/?rev=4648&view=rev Author: daintree Date: 2011-08-04 09:12:45 +0000 (Thu, 04 Aug 2011) Log Message: ----------- fix for GPPercent reported on discount matrix updates Modified Paths: -------------- trunk/PO_SelectOSPurchOrder.php trunk/SelectOrderItems.php trunk/doc/Change.log trunk/includes/DefineCartClass.php trunk/includes/SelectOrderItems_IntoCart.inc Modified: trunk/PO_SelectOSPurchOrder.php =================================================================== --- trunk/PO_SelectOSPurchOrder.php 2011-08-04 08:24:32 UTC (rev 4647) +++ trunk/PO_SelectOSPurchOrder.php 2011-08-04 09:12:45 UTC (rev 4648) @@ -129,7 +129,7 @@ */ if (!isset($OrderNumber) or $OrderNumber=='' ){ - echo '<a href="' . $rootpath . '/PO_Header.php?' .SID . '&NewOrder=Yes">' . _('Add Purchase Order') . '</a>'; + echo '<a href="' . $rootpath . '/PO_Header.php?NewOrder=Yes">' . _('Add Purchase Order') . '</a>'; echo '<p class="page_title_text"><img src="'.$rootpath.'/css/'.$theme.'/images/magnifier.png" title="' . _('Search') . '" alt="">' . ' ' . $title.'</p>'; echo '<table class=selection><tr><td>'._('Order Number') . ': <input type="text" name="OrderNumber" maxlength="8" size="9" /> ' . _('Into Stock Location') . ':<select name="StockLocation">'; @@ -183,7 +183,9 @@ echo '<br /><font size=1><div class="page_help_text">' ._('To search for purchase orders for a specific part use the part selection facilities below') .'</div> </font>'; -echo '<br /><table class="selection"><tr>'; +echo '<br /> + <table class="selection"> + <tr>'; echo '<td><font size="1">' . _('Select a stock category') . ':</font><select name="StockCat">'; @@ -196,11 +198,20 @@ } echo '</select>'; echo '<td><font size=1>' . _('Enter text extracts in the') . '<b>' . _('description') . '</b>:</font></td>'; -echo '<td><input type="Text" name="Keywords" size=20 maxlength=25></td></tr><tr><td></td>'; +echo '<td><input type="text" name="Keywords" size="20" maxlength="25"></td> + </tr> + <tr><td></td>'; echo '<td><font size<b>' . _('OR') . '</b></font><font size=1>' . _('Enter extract of the') . '<b>' . _('Stock Code') . '</b>:</font></td>'; -echo '<td><input type="Text" name="StockCode" size=15 maxlength=18></td></tr></table><br />'; -echo '<table><tr><td><input type=submit name="SearchParts" value="' . _('Search Parts Now') . '">'; -echo '<input type=submit name="ResetPart" value="' . _('Show All') . '"></td></tr></table>'; +echo '<td><input type="text" name="StockCode" size="15" maxlength="18"></td> + </tr> + </table> + <br />'; +echo '<table> + <tr> + <td><input type="submit" name="SearchParts" value="' . _('Search Parts Now') . '"> + <input type=submit name="ResetPart" value="' . _('Show All') . '"></td> + </tr> + </table>'; echo '<br />'; @@ -229,8 +240,8 @@ printf('<td><input type="submit" name="SelectedStockItem" value="%s"</td> <td>%s</td> - <td class=number>%s</td> - <td class=number>%s</td> + <td class="number">%s</td> + <td class="number">%s</td> <td>%s</td></tr>', $myrow['stockid'], $myrow['description'], @@ -267,7 +278,7 @@ $StatusCriteria = " AND purchorders.status='Cancelled' "; } - if (isset($OrderNumber) && $OrderNumber !='') { + if (isset($OrderNumber) AND $OrderNumber !='') { $SQL = "SELECT purchorders.orderno, suppliers.suppname, purchorders.orddate, @@ -303,119 +314,119 @@ if (isset($SelectedStockItem)) { $SQL = "SELECT purchorders.realorderno, - purchorders.orderno, - suppliers.suppname, - purchorders.orddate, - purchorders.status, - purchorders.initiator, - purchorders.requisitionno, - purchorders.allowprint, - suppliers.currcode, - SUM(purchorderdetails.unitprice*purchorderdetails.quantityord) AS ordervalue - FROM purchorders INNER JOIN purchorderdetails - ON purchorders.orderno = purchorderdetails.orderno - INNER JOIN suppliers - ON purchorders.supplierno = suppliers.supplierid - WHERE purchorderdetails.completed=0 - AND purchorderdetails.itemcode='". $SelectedStockItem ."' - AND purchorders.supplierno='" . $SelectedSupplier ."' - AND purchorders.intostocklocation = '". $_POST['StockLocation'] . "' - " . $StatusCriteria . " - GROUP BY purchorders.orderno ASC, - purchorders.realorderno, - suppliers.suppname, - purchorders.orddate, - purchorders.status, - purchorders.initiator, - purchorders.requisitionno, - purchorders.allowprint, - suppliers.currcode"; + purchorders.orderno, + suppliers.suppname, + purchorders.orddate, + purchorders.status, + purchorders.initiator, + purchorders.requisitionno, + purchorders.allowprint, + suppliers.currcode, + SUM(purchorderdetails.unitprice*purchorderdetails.quantityord) AS ordervalue + FROM purchorders INNER JOIN purchorderdetails + ON purchorders.orderno = purchorderdetails.orderno + INNER JOIN suppliers + ON purchorders.supplierno = suppliers.supplierid + WHERE purchorderdetails.completed=0 + AND purchorderdetails.itemcode='". $SelectedStockItem ."' + AND purchorders.supplierno='" . $SelectedSupplier ."' + AND purchorders.intostocklocation = '". $_POST['StockLocation'] . "' + " . $StatusCriteria . " + GROUP BY purchorders.orderno ASC, + purchorders.realorderno, + suppliers.suppname, + purchorders.orddate, + purchorders.status, + purchorders.initiator, + purchorders.requisitionno, + purchorders.allowprint, + suppliers.currcode"; } else { $SQL = "SELECT purchorders.realorderno, - purchorders.orderno, - suppliers.suppname, - purchorders.orddate, - purchorders.status, - purchorders.initiator, - purchorders.requisitionno, - purchorders.allowprint, - suppliers.currcode, - SUM(purchorderdetails.unitprice*purchorderdetails.quantityord) AS ordervalue - FROM purchorders INNER JOIN purchorderdetails - ON purchorders.orderno = purchorderdetails.orderno - INNER JOIN suppliers - ON purchorders.supplierno = suppliers.supplierid - WHERE purchorderdetails.completed=0 - AND purchorders.supplierno='" . $SelectedSupplier ."' - AND purchorders.intostocklocation = '". $_POST['StockLocation'] . "' - " . $StatusCriteria . " - GROUP BY purchorders.orderno ASC, - purchorders.realorderno, - suppliers.suppname, - purchorders.orddate, - purchorders.status, - purchorders.initiator, - purchorders.requisitionno, - purchorders.allowprint, - suppliers.currcode"; + purchorders.orderno, + suppliers.suppname, + purchorders.orddate, + purchorders.status, + purchorders.initiator, + purchorders.requisitionno, + purchorders.allowprint, + suppliers.currcode, + SUM(purchorderdetails.unitprice*purchorderdetails.quantityord) AS ordervalue + FROM purchorders INNER JOIN purchorderdetails + ON purchorders.orderno = purchorderdetails.orderno + INNER JOIN suppliers + ON purchorders.supplierno = suppliers.supplierid + WHERE purchorderdetails.completed=0 + AND purchorders.supplierno='" . $SelectedSupplier ."' + AND purchorders.intostocklocation = '". $_POST['StockLocation'] . "' + " . $StatusCriteria . " + GROUP BY purchorders.orderno ASC, + purchorders.realorderno, + suppliers.suppname, + purchorders.orddate, + purchorders.status, + purchorders.initiator, + purchorders.requisitionno, + purchorders.allowprint, + suppliers.currcode"; } } else { //no supplier selected if (!isset($_POST['StockLocation'])) {$_POST['StockLocation']='';} if (isset($SelectedStockItem) and isset($_POST['StockLocation'])) { $SQL = "SELECT purchorders.realorderno, - purchorders.orderno, - suppliers.suppname, - purchorders.orddate, - purchorders.status, - purchorders.initiator, - purchorders.requisitionno, - purchorders.allowprint, - suppliers.currcode, - SUM(purchorderdetails.unitprice*purchorderdetails.quantityord) AS ordervalue - FROM purchorders INNER JOIN purchorderdetails - ON purchorders.orderno = purchorderdetails.orderno - INNER JOIN suppliers - ON purchorders.supplierno = suppliers.supplierid - WHERE purchorderdetails.completed=0 - AND purchorderdetails.itemcode='". $SelectedStockItem ."' - AND purchorders.intostocklocation = '". $_POST['StockLocation'] . "' - " . $StatusCriteria . " - GROUP BY purchorders.orderno ASC, - purchorders.realorderno, - suppliers.suppname, - purchorders.orddate, - purchorders.status, - purchorders.initiator, - purchorders.requisitionno, - purchorders.allowprint, - suppliers.currcode"; + purchorders.orderno, + suppliers.suppname, + purchorders.orddate, + purchorders.status, + purchorders.initiator, + purchorders.requisitionno, + purchorders.allowprint, + suppliers.currcode, + SUM(purchorderdetails.unitprice*purchorderdetails.quantityord) AS ordervalue + FROM purchorders INNER JOIN purchorderdetails + ON purchorders.orderno = purchorderdetails.orderno + INNER JOIN suppliers + ON purchorders.supplierno = suppliers.supplierid + WHERE purchorderdetails.completed=0 + AND purchorderdetails.itemcode='". $SelectedStockItem ."' + AND purchorders.intostocklocation = '". $_POST['StockLocation'] . "' + " . $StatusCriteria . " + GROUP BY purchorders.orderno ASC, + purchorders.realorderno, + suppliers.suppname, + purchorders.orddate, + purchorders.status, + purchorders.initiator, + purchorders.requisitionno, + purchorders.allowprint, + suppliers.currcode"; } else { $SQL = "SELECT purchorders.realorderno, - purchorders.orderno, - suppliers.suppname, - purchorders.orddate, - purchorders.status, - purchorders.initiator, - purchorders.requisitionno, - purchorders.allowprint, - suppliers.currcode, - SUM(purchorderdetails.unitprice*purchorderdetails.quantityord) AS ordervalue - FROM purchorders INNER JOIN purchorderdetails - ON purchorders.orderno = purchorderdetails.orderno - INNER JOIN suppliers - ON purchorders.supplierno = suppliers.supplierid - WHERE purchorderdetails.completed=0 - AND purchorders.intostocklocation = '". $_POST['StockLocation'] . "' - " . $StatusCriteria . " - GROUP BY purchorders.orderno ASC, - purchorders.realorderno, - suppliers.suppname, - purchorders.orddate, - purchorders.status, - purchorders.initiator, - purchorders.requisitionno, - purchorders.allowprint, - suppliers.currcode"; + purchorders.orderno, + suppliers.suppname, + purchorders.orddate, + purchorders.status, + purchorders.initiator, + purchorders.requisitionno, + purchorders.allowprint, + suppliers.currcode, + SUM(purchorderdetails.unitprice*purchorderdetails.quantityord) AS ordervalue + FROM purchorders INNER JOIN purchorderdetails + ON purchorders.orderno = purchorderdetails.orderno + INNER JOIN suppliers + ON purchorders.supplierno = suppliers.supplierid + WHERE purchorderdetails.completed=0 + AND purchorders.intostocklocation = '". $_POST['StockLocation'] . "' + " . $StatusCriteria . " + GROUP BY purchorders.orderno ASC, + purchorders.realorderno, + suppliers.suppname, + purchorders.orddate, + purchorders.status, + purchorders.initiator, + purchorders.requisitionno, + purchorders.allowprint, + suppliers.currcode"; } } //end selected supplier @@ -430,20 +441,20 @@ // '</td><td class="tableheader">' . _('Receive') . - echo '<tr><th>' . _('Order #') . - '</th><th>' . _('Order Date') . - '</th><th>' . _('Initiated by') . - '</th><th>' . _('Supplier') . - '</th><th>' . _('Currency') . - '</th>'; + echo '<tr> + <th>' . _('Order #') . '</th> + <th>' . _('Order Date') . '</th> + <th>' . _('Initiated by') . '</th> + <th>' . _('Supplier') . '</th> + <th>' . _('Currency') . '</th>'; + if (in_array($PricesSecurity, $_SESSION['AllowedPageSecurityTokens']) OR !isset($PricesSecurity)) { echo '<th>' . _('Order Total') .'</th>'; } echo '<th>' . _('Status') . '</th> - <th>' . _('Modify') . '</th> - <th>' . _('Print') . '</th> - <th>' . _('Receive') . '</th> - </tr>'; + <th>' . _('Print') . '</th> + <th>' . _('Receive') . '</th> + </tr>'; $j = 1; $k=0; //row colour counter while ($myrow=DB_fetch_array($PurchOrdersResult)) { @@ -456,20 +467,20 @@ $k++; } - $ModifyPage = $rootpath . '/PO_Header.php?' . SID . '&ModifyOrderNumber=' . $myrow['orderno']; + $ModifyPage = $rootpath . '/PO_Header.php?ModifyOrderNumber=' . $myrow['orderno']; if ($myrow['status'] == 'Printed') { - $ReceiveOrder = '<a href="'.$rootpath . '/GoodsReceived.php?' . SID . '&PONumber=' . $myrow['orderno'].'">'. + $ReceiveOrder = '<a href="'.$rootpath . '/GoodsReceived.php?PONumber=' . $myrow['orderno'].'">'. _('Receive').'</a>'; } else { - $ReceiveOrder = _('Receive'); + $ReceiveOrder = ''; } if ($myrow['status'] == 'Authorised' AND $myrow['allowprint'] == 1){ - $PrintPurchOrder = '<a target="_blank" href="' . $rootpath . '/PO_PDFPurchOrder.php?' . SID . '&OrderNo=' . $myrow['orderno'] . '">' . _('Print Now') . '</a>'; + $PrintPurchOrder = '<a target="_blank" href="' . $rootpath . '/PO_PDFPurchOrder.php?OrderNo=' . $myrow['orderno'] . '">' . _('Print') . '</a>'; } elseif ($myrow['status'] == 'Authorisied' AND $myrow['allowprint'] == 0) { $PrintPurchOrder = _('Printed'); } elseif ($myrow['status'] == 'Printed'){ - $PrintPurchOrder = '<a target="_blank" href="' . $rootpath . '/PO_PDFPurchOrder.php?' . SID . '&OrderNo=' . $myrow['orderno'] . '&realorderno=' . $myrow['realorderno'] . '&ViewingOnly=2"> - ' . _('Print') . '</a>'; + $PrintPurchOrder = '<a target="_blank" href="' . $rootpath . '/PO_PDFPurchOrder.php?OrderNo=' . $myrow['orderno'] . '&realorderno=' . $myrow['realorderno'] . '&ViewingOnly=2"> + ' . _('Print Copy') . '</a>'; } else { $PrintPurchOrder = _('N/A'); } @@ -478,7 +489,7 @@ $FormatedOrderDate = ConvertSQLDate($myrow['orddate']); $FormatedOrderValue = number_format($myrow['ordervalue'],2); - echo '<td>' . $myrow['orderno'] . '</td> + echo '<td><a href="'.$ModifyPage.'">' . $myrow['orderno'] . '</a></td> <td>' . $FormatedOrderDate . '</td> <td>' . $myrow['initiator'] . '</td> <td>' . $myrow['suppname'] . '</td> @@ -487,10 +498,9 @@ echo '<td class=number>'.$FormatedOrderValue . '</td>'; } echo '<td>' . _($myrow['status']) . '</td> - <td><a href="'.$ModifyPage.'">' . _('Modify') . '</a></td> - <td>' . $PrintPurchOrder . '</td> - <td>' . $ReceiveOrder . '</td> - </tr>'; + <td>' . $PrintPurchOrder . '</td> + <td>' . $ReceiveOrder . '</td> + </tr>'; //end of page full new headings if } //end of while loop Modified: trunk/SelectOrderItems.php =================================================================== --- trunk/SelectOrderItems.php 2011-08-04 08:24:32 UTC (rev 4647) +++ trunk/SelectOrderItems.php 2011-08-04 09:12:45 UTC (rev 4648) @@ -1207,6 +1207,7 @@ foreach ($_SESSION['Items'.$identifier]->LineItems as $OrderLine_2) { if ($OrderLine_2->DiscCat==$OrderLine->DiscCat){ $_SESSION['Items'.$identifier]->LineItems[$OrderLine_2->LineNumber]->DiscountPercent = $DiscountMatrixRate; + $_SESSION['Items'.$identifier]->LineItems[$OrderLine_2->LineNumber]->GPPercent = (($_SESSION['Items'.$identifier]->LineItems[$OrderLine_2->LineNumber]->Price*(1-($DiscountMatrixRate/100))) - $_SESSION['Items'.$identifier]->LineItems[$OrderLine_2->LineNumber]->StandardCost*$ExRate)/($_SESSION['Items'.$identifier]->LineItems[$OrderLine_2->LineNumber]->Price *(1-$DiscountMatrixRate)/100); } } } @@ -1214,9 +1215,9 @@ } /* end of discount matrix lookup code */ } // the order session is started or there is a new item being added if (isset($_POST['DeliveryDetails'])){ - echo '<meta http-equiv="Refresh" content="0; url=' . $rootpath . '/DeliveryDetails.php?' . SID .'identifier='.$identifier . '">'; + echo '<meta http-equiv="refresh" content="0; url=' . $rootpath . '/DeliveryDetails.php?identifier='.$identifier . '">'; prnMsg(_('You should automatically be forwarded to the entry of the delivery details page') . '. ' . _('if this does not happen') . ' (' . _('if the browser does not support META Refresh') . ') ' . - '<a href="' . $rootpath . '/DeliveryDetails.php?' . SID .'identifier='.$identifier . '">' . _('click here') . '</a> ' . _('to continue'), 'info'); + '<a href="' . $rootpath . '/DeliveryDetails.php?identifier='.$identifier . '">' . _('click here') . '</a> ' . _('to continue'), 'info'); exit; } Modified: trunk/doc/Change.log =================================================================== --- trunk/doc/Change.log 2011-08-04 08:24:32 UTC (rev 4647) +++ trunk/doc/Change.log 2011-08-04 09:12:45 UTC (rev 4648) @@ -1,5 +1,6 @@ webERP Change Log +4/8/11 Phil: Fix GP Percent reported when discounts updated by discount matrix 4/8/11 Ricard: SalesInquiry.php now shows net sales after discounts 31/7/11 Phil: PO_Header.php - was not updating when update hit as reported by Klaus(opto) 31/7/11 Phil: BackupDatabase.php script Modified: trunk/includes/DefineCartClass.php =================================================================== --- trunk/includes/DefineCartClass.php 2011-08-04 08:24:32 UTC (rev 4647) +++ trunk/includes/DefineCartClass.php 2011-08-04 09:12:45 UTC (rev 4648) @@ -246,7 +246,7 @@ /* Makes a comma seperated list of the stock items ordered for use in SQL expressions */ - $StockID_List=""; + $StockID_List=''; foreach ($this->LineItems as $StockItem) { $StockID_List .= ",'" . $StockItem->StockID . "'"; } Modified: trunk/includes/SelectOrderItems_IntoCart.inc =================================================================== --- trunk/includes/SelectOrderItems_IntoCart.inc 2011-08-04 08:24:32 UTC (rev 4647) +++ trunk/includes/SelectOrderItems_IntoCart.inc 2011-08-04 09:12:45 UTC (rev 4648) @@ -98,7 +98,7 @@ AND discountcategory ='" . $myrow['discountcategory'] . "' AND quantitybreak <" . $NewItemQty,$db); $DiscCatRow = DB_fetch_row($result); - if ($DiscCatRow[0] != "" && $DiscCatRow[0] > 0) { + if ($DiscCatRow[0] != '' AND $DiscCatRow[0] > 0) { $Discount = $DiscCatRow[0]; } else { $Discount = 0; This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <dai...@us...> - 2011-08-04 10:18:20
|
Revision: 4649 http://web-erp.svn.sourceforge.net/web-erp/?rev=4649&view=rev Author: daintree Date: 2011-08-04 10:18:14 +0000 (Thu, 04 Aug 2011) Log Message: ----------- fix for GPPercent reported on discount matrix updates Modified Paths: -------------- trunk/DebtorsAtPeriodEnd.php trunk/PDFOrderStatus.php trunk/SelectOrderItems.php trunk/SelectSalesOrder.php trunk/doc/Change.log Modified: trunk/DebtorsAtPeriodEnd.php =================================================================== --- trunk/DebtorsAtPeriodEnd.php 2011-08-04 09:12:45 UTC (rev 4648) +++ trunk/DebtorsAtPeriodEnd.php 2011-08-04 10:18:14 UTC (rev 4649) @@ -91,7 +91,7 @@ $TotBal += $Balance; $LeftOvers = $pdf->addTextWrap($Left_Margin+3,$YPos,220-$Left_Margin,$FontSize,$DebtorBalances['debtorno'] . - ' - ' . html_entity_decode($DebtorBalances['name']),'left'); + ' - ' . html_entity_decode($DebtorBalances['name'],ENT_QUOTES,'UTF-8'),'left'); $LeftOvers = $pdf->addTextWrap(220,$YPos,60,$FontSize,$DisplayBalance,'right'); $LeftOvers = $pdf->addTextWrap(280,$YPos,60,$FontSize,$DisplayFXBalance,'right'); $LeftOvers = $pdf->addTextWrap(350,$YPos,100,$FontSize,$DebtorBalances['currency'],'left'); Modified: trunk/PDFOrderStatus.php =================================================================== --- trunk/PDFOrderStatus.php 2011-08-04 09:12:45 UTC (rev 4648) +++ trunk/PDFOrderStatus.php 2011-08-04 10:18:14 UTC (rev 4649) @@ -295,7 +295,7 @@ $YPos -= $line_height; $LeftOvers = $pdf->addTextWrap($Left_Margin+2,$YPos,40,$FontSize,$myrow['orderno'], 'left'); - $LeftOvers = $pdf->addTextWrap($Left_Margin+40,$YPos,150,$FontSize,html_entity_decode($myrow['name']), 'left'); + $LeftOvers = $pdf->addTextWrap($Left_Margin+40,$YPos,150,$FontSize,html_entity_decode($myrow['name'],ENT_QUOTES,'UTF-8'), 'left'); $LeftOvers = $pdf->addTextWrap($Left_Margin+190,$YPos,110,$FontSize,$myrow['brname'], 'left'); $LeftOvers = $pdf->addTextWrap($Left_Margin+300,$YPos,60,$FontSize,ConvertSQLDate($myrow['orddate']), 'left'); Modified: trunk/SelectOrderItems.php =================================================================== --- trunk/SelectOrderItems.php 2011-08-04 09:12:45 UTC (rev 4648) +++ trunk/SelectOrderItems.php 2011-08-04 10:18:14 UTC (rev 4649) @@ -1207,7 +1207,7 @@ foreach ($_SESSION['Items'.$identifier]->LineItems as $OrderLine_2) { if ($OrderLine_2->DiscCat==$OrderLine->DiscCat){ $_SESSION['Items'.$identifier]->LineItems[$OrderLine_2->LineNumber]->DiscountPercent = $DiscountMatrixRate; - $_SESSION['Items'.$identifier]->LineItems[$OrderLine_2->LineNumber]->GPPercent = (($_SESSION['Items'.$identifier]->LineItems[$OrderLine_2->LineNumber]->Price*(1-($DiscountMatrixRate/100))) - $_SESSION['Items'.$identifier]->LineItems[$OrderLine_2->LineNumber]->StandardCost*$ExRate)/($_SESSION['Items'.$identifier]->LineItems[$OrderLine_2->LineNumber]->Price *(1-$DiscountMatrixRate)/100); + $_SESSION['Items'.$identifier]->LineItems[$OrderLine_2->LineNumber]->GPPercent = (($_SESSION['Items'.$identifier]->LineItems[$OrderLine_2->LineNumber]->Price*(1-$DiscountMatrixRate)) - $_SESSION['Items'.$identifier]->LineItems[$OrderLine_2->LineNumber]->StandardCost*$ExRate)/($_SESSION['Items'.$identifier]->LineItems[$OrderLine_2->LineNumber]->Price *(1-$DiscountMatrixRate)/100); } } } Modified: trunk/SelectSalesOrder.php =================================================================== --- trunk/SelectSalesOrder.php 2011-08-04 09:12:45 UTC (rev 4648) +++ trunk/SelectSalesOrder.php 2011-08-04 10:18:14 UTC (rev 4649) @@ -816,8 +816,8 @@ <td>%s</td> <td>%s</td> <td>%s</td> - <td class=number>%s</td> - <td><input type=checkbox name="PlacePO_%s" value><input type="hidden" name="OrderNo_PO_%s" value="%s"></td> + <td class="number">%s</td> + <td><input type="checkbox" name="PlacePO_%s" value /><input type="hidden" name="OrderNo_PO_%s" value="%s" /></td> </tr>', $ModifyPage, $myrow['orderno'], @@ -828,7 +828,7 @@ $myrow['customerref'], $FormatedOrderDate, $FormatedDelDate, - html_entity_decode($myrow['deliverto'],ENT_QUOTES,UTF-8), + html_entity_decode($myrow['deliverto'],ENT_QUOTES,'UTF-8'), $FormatedOrderValue, $i, $i, @@ -843,7 +843,7 @@ <td>%s</td> <td>%s</td> <td>%s</td> - <td class=number>%s</td> + <td class="number">%s</td> </tr>', $ModifyPage, $myrow['orderno'], @@ -854,7 +854,7 @@ $myrow['customerref'], $FormatedOrderDate, $FormatedDelDate, - html_entity_decode($myrow['deliverto'],ENT_QUOTES,UTF-8), + html_entity_decode($myrow['deliverto'],ENT_QUOTES,'UTF-8'), $FormatedOrderValue); } @@ -867,7 +867,7 @@ <td>%s</td> <td>%s</td> <td>%s</td> - <td class=number>%s</td> + <td class="number">%s</td> </tr>', $ModifyPage, $myrow['orderno'], @@ -877,7 +877,7 @@ $myrow['customerref'], $FormatedOrderDate, $FormatedDelDate, - html_entity_decode($myrow['deliverto'],ENT_QUOTES,UTF-8), + html_entity_decode($myrow['deliverto'],ENT_QUOTES,'UTF-8'), $FormatedOrderValue); } $i++; @@ -898,15 +898,14 @@ } else { echo '<b>' . _('Total Quotation(s) Value in'); } - echo ' ' . $_SESSION['CompanyRecord']['currencydefault'] . ' :</b></td><td class="number"><b>' . number_format($OrdersTotal,2) . '</b></td></tr> + echo ' ' . $_SESSION['CompanyRecord']['currencydefault'] . ' :</b></td><td class="number"><b>' . number_format($OrdersTotal,$_SESSION['CompanyRecord']['decimalplaces']) . '</b></td></tr> </table>'; } //end if there are some orders to show } -?> -</form> +echo '</form>'; -<?php } //end StockID already selected +} //end StockID already selected include('includes/footer.inc'); ?> \ No newline at end of file Modified: trunk/doc/Change.log =================================================================== --- trunk/doc/Change.log 2011-08-04 09:12:45 UTC (rev 4648) +++ trunk/doc/Change.log 2011-08-04 10:18:14 UTC (rev 4649) @@ -1,6 +1,7 @@ webERP Change Log 4/8/11 Phil: Fix GP Percent reported when discounts updated by discount matrix +4/8/11 Phil: Make PO_SelectOSPurchOrder.php behave similarly to SelectPurchOrder.php (for inquiries) where the order number is the link that takes you to the order 4/8/11 Ricard: SalesInquiry.php now shows net sales after discounts 31/7/11 Phil: PO_Header.php - was not updating when update hit as reported by Klaus(opto) 31/7/11 Phil: BackupDatabase.php script This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <dai...@us...> - 2011-08-04 10:18:20
|
Revision: 4649 http://web-erp.svn.sourceforge.net/web-erp/?rev=4649&view=rev Author: daintree Date: 2011-08-04 10:18:14 +0000 (Thu, 04 Aug 2011) Log Message: ----------- fix for GPPercent reported on discount matrix updates Modified Paths: -------------- trunk/DebtorsAtPeriodEnd.php trunk/PDFOrderStatus.php trunk/SelectOrderItems.php trunk/SelectSalesOrder.php trunk/doc/Change.log Modified: trunk/DebtorsAtPeriodEnd.php =================================================================== --- trunk/DebtorsAtPeriodEnd.php 2011-08-04 09:12:45 UTC (rev 4648) +++ trunk/DebtorsAtPeriodEnd.php 2011-08-04 10:18:14 UTC (rev 4649) @@ -91,7 +91,7 @@ $TotBal += $Balance; $LeftOvers = $pdf->addTextWrap($Left_Margin+3,$YPos,220-$Left_Margin,$FontSize,$DebtorBalances['debtorno'] . - ' - ' . html_entity_decode($DebtorBalances['name']),'left'); + ' - ' . html_entity_decode($DebtorBalances['name'],ENT_QUOTES,'UTF-8'),'left'); $LeftOvers = $pdf->addTextWrap(220,$YPos,60,$FontSize,$DisplayBalance,'right'); $LeftOvers = $pdf->addTextWrap(280,$YPos,60,$FontSize,$DisplayFXBalance,'right'); $LeftOvers = $pdf->addTextWrap(350,$YPos,100,$FontSize,$DebtorBalances['currency'],'left'); Modified: trunk/PDFOrderStatus.php =================================================================== --- trunk/PDFOrderStatus.php 2011-08-04 09:12:45 UTC (rev 4648) +++ trunk/PDFOrderStatus.php 2011-08-04 10:18:14 UTC (rev 4649) @@ -295,7 +295,7 @@ $YPos -= $line_height; $LeftOvers = $pdf->addTextWrap($Left_Margin+2,$YPos,40,$FontSize,$myrow['orderno'], 'left'); - $LeftOvers = $pdf->addTextWrap($Left_Margin+40,$YPos,150,$FontSize,html_entity_decode($myrow['name']), 'left'); + $LeftOvers = $pdf->addTextWrap($Left_Margin+40,$YPos,150,$FontSize,html_entity_decode($myrow['name'],ENT_QUOTES,'UTF-8'), 'left'); $LeftOvers = $pdf->addTextWrap($Left_Margin+190,$YPos,110,$FontSize,$myrow['brname'], 'left'); $LeftOvers = $pdf->addTextWrap($Left_Margin+300,$YPos,60,$FontSize,ConvertSQLDate($myrow['orddate']), 'left'); Modified: trunk/SelectOrderItems.php =================================================================== --- trunk/SelectOrderItems.php 2011-08-04 09:12:45 UTC (rev 4648) +++ trunk/SelectOrderItems.php 2011-08-04 10:18:14 UTC (rev 4649) @@ -1207,7 +1207,7 @@ foreach ($_SESSION['Items'.$identifier]->LineItems as $OrderLine_2) { if ($OrderLine_2->DiscCat==$OrderLine->DiscCat){ $_SESSION['Items'.$identifier]->LineItems[$OrderLine_2->LineNumber]->DiscountPercent = $DiscountMatrixRate; - $_SESSION['Items'.$identifier]->LineItems[$OrderLine_2->LineNumber]->GPPercent = (($_SESSION['Items'.$identifier]->LineItems[$OrderLine_2->LineNumber]->Price*(1-($DiscountMatrixRate/100))) - $_SESSION['Items'.$identifier]->LineItems[$OrderLine_2->LineNumber]->StandardCost*$ExRate)/($_SESSION['Items'.$identifier]->LineItems[$OrderLine_2->LineNumber]->Price *(1-$DiscountMatrixRate)/100); + $_SESSION['Items'.$identifier]->LineItems[$OrderLine_2->LineNumber]->GPPercent = (($_SESSION['Items'.$identifier]->LineItems[$OrderLine_2->LineNumber]->Price*(1-$DiscountMatrixRate)) - $_SESSION['Items'.$identifier]->LineItems[$OrderLine_2->LineNumber]->StandardCost*$ExRate)/($_SESSION['Items'.$identifier]->LineItems[$OrderLine_2->LineNumber]->Price *(1-$DiscountMatrixRate)/100); } } } Modified: trunk/SelectSalesOrder.php =================================================================== --- trunk/SelectSalesOrder.php 2011-08-04 09:12:45 UTC (rev 4648) +++ trunk/SelectSalesOrder.php 2011-08-04 10:18:14 UTC (rev 4649) @@ -816,8 +816,8 @@ <td>%s</td> <td>%s</td> <td>%s</td> - <td class=number>%s</td> - <td><input type=checkbox name="PlacePO_%s" value><input type="hidden" name="OrderNo_PO_%s" value="%s"></td> + <td class="number">%s</td> + <td><input type="checkbox" name="PlacePO_%s" value /><input type="hidden" name="OrderNo_PO_%s" value="%s" /></td> </tr>', $ModifyPage, $myrow['orderno'], @@ -828,7 +828,7 @@ $myrow['customerref'], $FormatedOrderDate, $FormatedDelDate, - html_entity_decode($myrow['deliverto'],ENT_QUOTES,UTF-8), + html_entity_decode($myrow['deliverto'],ENT_QUOTES,'UTF-8'), $FormatedOrderValue, $i, $i, @@ -843,7 +843,7 @@ <td>%s</td> <td>%s</td> <td>%s</td> - <td class=number>%s</td> + <td class="number">%s</td> </tr>', $ModifyPage, $myrow['orderno'], @@ -854,7 +854,7 @@ $myrow['customerref'], $FormatedOrderDate, $FormatedDelDate, - html_entity_decode($myrow['deliverto'],ENT_QUOTES,UTF-8), + html_entity_decode($myrow['deliverto'],ENT_QUOTES,'UTF-8'), $FormatedOrderValue); } @@ -867,7 +867,7 @@ <td>%s</td> <td>%s</td> <td>%s</td> - <td class=number>%s</td> + <td class="number">%s</td> </tr>', $ModifyPage, $myrow['orderno'], @@ -877,7 +877,7 @@ $myrow['customerref'], $FormatedOrderDate, $FormatedDelDate, - html_entity_decode($myrow['deliverto'],ENT_QUOTES,UTF-8), + html_entity_decode($myrow['deliverto'],ENT_QUOTES,'UTF-8'), $FormatedOrderValue); } $i++; @@ -898,15 +898,14 @@ } else { echo '<b>' . _('Total Quotation(s) Value in'); } - echo ' ' . $_SESSION['CompanyRecord']['currencydefault'] . ' :</b></td><td class="number"><b>' . number_format($OrdersTotal,2) . '</b></td></tr> + echo ' ' . $_SESSION['CompanyRecord']['currencydefault'] . ' :</b></td><td class="number"><b>' . number_format($OrdersTotal,$_SESSION['CompanyRecord']['decimalplaces']) . '</b></td></tr> </table>'; } //end if there are some orders to show } -?> -</form> +echo '</form>'; -<?php } //end StockID already selected +} //end StockID already selected include('includes/footer.inc'); ?> \ No newline at end of file Modified: trunk/doc/Change.log =================================================================== --- trunk/doc/Change.log 2011-08-04 09:12:45 UTC (rev 4648) +++ trunk/doc/Change.log 2011-08-04 10:18:14 UTC (rev 4649) @@ -1,6 +1,7 @@ webERP Change Log 4/8/11 Phil: Fix GP Percent reported when discounts updated by discount matrix +4/8/11 Phil: Make PO_SelectOSPurchOrder.php behave similarly to SelectPurchOrder.php (for inquiries) where the order number is the link that takes you to the order 4/8/11 Ricard: SalesInquiry.php now shows net sales after discounts 31/7/11 Phil: PO_Header.php - was not updating when update hit as reported by Klaus(opto) 31/7/11 Phil: BackupDatabase.php script This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <dai...@us...> - 2011-08-06 01:48:19
|
Revision: 4650 http://web-erp.svn.sourceforge.net/web-erp/?rev=4650&view=rev Author: daintree Date: 2011-08-06 01:48:12 +0000 (Sat, 06 Aug 2011) Log Message: ----------- various Modified Paths: -------------- trunk/PO_Header.php trunk/PO_Items.php trunk/PO_PDFPurchOrder.php trunk/PaymentTerms.php trunk/SelectProduct.php trunk/doc/Change.log Modified: trunk/PO_Header.php =================================================================== --- trunk/PO_Header.php 2011-08-04 10:18:14 UTC (rev 4649) +++ trunk/PO_Header.php 2011-08-06 01:48:12 UTC (rev 4650) @@ -157,7 +157,9 @@ } /*New order initiated by user clicking on supplier purchasing data from items page */ -if (isset($_GET['NewOrder']) AND isset($_GET['StockID']) AND isset($_GET['SelectedSupplier'])) { +if (isset($_GET['NewOrder']) + AND isset($_GET['StockID']) + AND isset($_GET['SelectedSupplier'])) { /* * initialise a new order */ @@ -173,10 +175,10 @@ /* set the SupplierID we got */ $_SESSION['PO'.$identifier]->SupplierID = $_GET['SelectedSupplier']; $_SESSION['PO'.$identifier]->DeliveryDate = DateAdd(date($_SESSION['DefaultDateFormat']), 'd', $_GET['LeadTime']); + $_SESSION['RequireSupplierSelection'] = 0; $_POST['Select'] = $_GET['SelectedSupplier']; - /* * the item (it's item code) that should be purchased */ @@ -210,7 +212,9 @@ $_SESSION['PO'.$identifier]->ExRate = $_POST['ExRate']; $_SESSION['PO'.$identifier]->Comments = $_POST['Comments']; $_SESSION['PO'.$identifier]->DeliveryBy = $_POST['DeliveryBy']; - $_SESSION['PO'.$identifier]->StatusMessage = $_POST['StatusComments']; + if (isset($_POST['StatusComments'])){ + $_SESSION['PO'.$identifier]->StatusComments = $_POST['StatusComments']; + } $_SESSION['PO'.$identifier]->PaymentTerms = $_POST['PaymentTerms']; $_SESSION['PO'.$identifier]->Contact = $_POST['Contact']; $_SESSION['PO'.$identifier]->Tel = $_POST['Tel']; @@ -519,25 +523,29 @@ _('Purchase Order') . '" alt="">' . ' ' . _('Purchase Order: Select Supplier') . ''; echo '<form action="' . $_SERVER['PHP_SELF'] . '?identifier=' . $identifier . '" method="post" name="choosesupplier">'; echo '<input type="hidden" name="FormID" value="' . $_SESSION['FormID'] . '" />'; - echo '<input type="hidden" name="SuppliersReturned" value="' . $SuppliersReturned .'" />'; + if (isset($SuppliersReturned)){ + echo '<input type="hidden" name="SuppliersReturned" value="' . $SuppliersReturned .'" />'; + } - echo '<table cellpadding=3 colspan=4 class=selection> + echo '<table cellpadding="3" colspan="4" class="selection"> <tr> <td><font size=1>' . _('Enter text in the supplier name') . ':</font></td> - <td><input type="Text" name="Keywords" size="20" maxlength="25"></td> + <td><input type="text" name="Keywords" size="20" maxlength="25" /></td> <td><font size=3><b>' . _('OR') . '</b></font></td> <td><font size=1>' . _('Enter text extract in the supplier code') . ':</font></td> - <td><input type="text" name="SuppCode" size="15" maxlength="18"></td> + <td><input type="text" name="SuppCode" size="15" maxlength="18" /></td> </tr> - </table><br /><div class="centre"> - <input type="submit" name="SearchSuppliers" value="' . _('Search Now') . '"> - <input type="submit" action="reset" value="' . _('Reset') . '"></div>'; + </table> + <br /> + <div class="centre"> + <input type="submit" name="SearchSuppliers" value="' . _('Search Now') . '" /> + <input type="submit" action="reset" value="' . _('Reset') . '" /></div>'; echo '<script type="text/javascript">defaultControl(document.forms[0].Keywords);</script>'; if (isset($result_SuppSelect)) { - echo '<br /><table cellpadding=3 colspan=7 class=selection>'; + echo '<br /><table cellpadding="3" colspan="7" class="selection">'; $tableheader = '<tr> <th>' . _('Code') . '</th> @@ -606,7 +614,11 @@ /* the link */ echo '<li><a href="'.$rootpath.'/PO_Items.php?NewItem=' . $Purch_Item . '&identifier=' . $identifier . '">' . _('Enter Line Item to this purchase order') . '</a></li>'; - echo '</td></tr></table></div><br />'; + echo '</td> + </tr> + </table> + </div> + <br />'; if (isset($_GET['Quantity'])) { $Qty=$_GET['Quantity']; Modified: trunk/PO_Items.php =================================================================== --- trunk/PO_Items.php 2011-08-04 10:18:14 UTC (rev 4649) +++ trunk/PO_Items.php 2011-08-06 01:48:12 UTC (rev 4650) @@ -93,7 +93,7 @@ $AuthRow=DB_fetch_array($AuthResult); if (DB_num_rows($AuthResult) > 0 AND $AuthRow['authlevel'] > $_SESSION['PO'.$identifier]->Order_Value()) { //user has authority to authrorise as well as create the order - $StatusComment=date($_SESSION['DefaultDateFormat']).' - ' . _('Order Created and Authorised by') . $UserDetails . ' - '.$_SESSION['PO'.$identifier]->StatusMessage.'<br />'; + $StatusComment=date($_SESSION['DefaultDateFormat']).' - ' . _('Order Created and Authorised by') . $UserDetails . '<br />'.$_SESSION['PO'.$identifier]->StatusComments.'<br />'; $_SESSION['PO'.$identifier]->AllowPrintPO=1; $_SESSION['PO'.$identifier]->Status = 'Authorised'; } else { // no authority to authorise this order @@ -110,18 +110,16 @@ _('The order will be created with a status of pending and will require authorisation'), 'warn'); $_SESSION['PO'.$identifier]->AllowPrintPO=0; - $StatusComment=date($_SESSION['DefaultDateFormat']).' - ' . _('Order Created by') . $UserDetails . ' - '.$_SESSION['PO'.$identifier]->StatusMessage.'<br />'; + $StatusComment=date($_SESSION['DefaultDateFormat']).' - ' . _('Order Created by') . $UserDetails . '<br />'.$_SESSION['PO'.$identifier]->StatusComments.'<br />'; $_SESSION['PO'.$identifier]->Status = 'Pending'; } } else { //auto authorise is set to off $_SESSION['PO'.$identifier]->AllowPrintPO=0; - $StatusComment=date($_SESSION['DefaultDateFormat']).' - ' . _('Order Created by') . $UserDetails . ' - '.$_SESSION['PO'.$identifier]->StatusMessage.'<br />'; + $StatusComment=date($_SESSION['DefaultDateFormat']).' - ' . _('Order Created by') . $UserDetails . ' - '.$_SESSION['PO'.$identifier]->StatusComments.'<br />'; $_SESSION['PO'.$identifier]->Status = 'Pending'; } if ($_SESSION['ExistingOrder']==0){ /*its a new order to be inserted */ - -//Do we need to check authorisation to create - no because already trapped when new PO session started /*Get the order number */ $_SESSION['PO'.$identifier]->OrderNo = GetNextTransNo(18, $db); @@ -284,7 +282,10 @@ $result = DB_query($sql,$db,$ErrMsg,$DbgMsg,true); } } else if ($POLine->PODetailRec=='') { - + /*When the purchase order line is an existing record the auto-increment + * field PODetailRec is given to the session for that POLine + * So it will only be a new POLine if PODetailRec is empty + */ $sql = "INSERT INTO purchorderdetails ( orderno, itemcode, deliverydate, @@ -328,7 +329,7 @@ completed=1, assetid='" . $POLine->AssetID . "', conversionfactor = '" . $POLine->ConversionFactor . "' - WHERE podetailitem='" . $POLine->PODetailRec . "'"; + WHERE podetailitem='" . $POLine->PODetailRec . "'"; } else { $sql = "UPDATE purchorderdetails SET itemcode='" . $POLine->StockID . "', deliverydate ='" . FormatDateForSQL($POLine->ReqDelDate) . "', @@ -354,7 +355,7 @@ prnMsg(_('Purchase Order') . ' ' . $_SESSION['PO'.$identifier]->OrderNo . ' ' . _('has been updated'),'success'); if ($_SESSION['PO'.$identifier]->AllowPrintPO==1 AND ($_SESSION['PO'.$identifier]->Status=='Authorised' - OR $_SESSION['PO'.$identifier]->Status=='Printed')){ + OR $_SESSION['PO'.$identifier]->Status=='Printed')){ echo '<br /><a target="_blank" href="'.$rootpath.'/PO_PDFPurchOrder.php?OrderNo=' . $_SESSION['PO'.$identifier]->OrderNo . '">' . _('Print Purchase Order') . '</a>'; } } /*end of if its a new order or an existing one */ @@ -409,8 +410,8 @@ if ($_SESSION['PO'.$identifier]->GLLink==1){ $sql = "SELECT accountname - FROM chartmaster - WHERE accountcode ='" . (int) $_POST['GLCode'] . "'"; + FROM chartmaster + WHERE accountcode ='" . $_POST['GLCode'] . "'"; $ErrMsg = _('The account details for') . ' ' . $_POST['GLCode'] . ' ' . _('could not be retrieved because'); $DbgMsg = _('The SQL used to retrieve the details of the account, but failed was'); $GLValidResult = DB_query($sql,$db,$ErrMsg,$DbgMsg,false,false); @@ -438,10 +439,10 @@ $ValidAssetResult = DB_query("SELECT assetid, description, costact - FROM fixedassets - INNER JOIN fixedassetcategories - ON fixedassets.assetcategoryid=fixedassetcategories.categoryid - WHERE assetid='" . $_POST['AssetID'] . "'",$db); + FROM fixedassets + INNER JOIN fixedassetcategories + ON fixedassets.assetcategoryid=fixedassetcategories.categoryid + WHERE assetid='" . $_POST['AssetID'] . "'",$db); if (DB_num_rows($ValidAssetResult)==0){ // then the asset id entered doesn't exist $AllowUpdate = false; prnMsg(_('An asset code was entered but it does not yet exist. Only pre-existing asset ids can be entered when ordering a fixed asset'),'error'); @@ -494,9 +495,10 @@ if (isset($_POST['NewItem'])){ /* NewItem is set from the part selection list as the part code selected * take the form entries and enter the data from the form into the PurchOrder class variable - * A series of form variables of the format "Qty" with the ItemCode concatenated are created on the search for adding new - * items for each of these form variables need to parse out the items and look up the details to add them to the purchase - * order $_POST is of course the global array of all posted form variables */ + * A series of form variables of the format "NewQty" with the ItemCode concatenated are created on the search for adding new + * items for each of these form variables need to parse out the item code and look up the details to add them to the purchase + * order $_POST is of course the global array of all posted form variables + */ foreach ($_POST as $FormVariableName => $Quantity) { @@ -632,7 +634,7 @@ echo ' ' . _('Purchase Order') .' '. $_SESSION['PO'.$identifier]->OrderNo ; } echo '<br /><b>'._(' Order Summary') . '</b>'; - echo '<table cellpadding=2 colspan=7 class=selection>'; + echo '<table cellpadding="2" colspan="7" class="selection">'; echo '<tr> <th>' . _('Item Code') . '</th> <th>' . _('Description') . '</th> @@ -688,12 +690,15 @@ } $DisplayTotal = number_format($_SESSION['PO'.$identifier]->Total,$_SESSION['PO'.$identifier]->CurrDecimalPlaces); - echo '<tr><td colspan="10" class=number>' . _('TOTAL') . _(' excluding Tax') . '</td> - <td class=number><b>' . $DisplayTotal . '</b></td> + echo '<tr><td colspan="10" class="number">' . _('TOTAL') . _(' excluding Tax') . '</td> + <td class="number"><b>' . $DisplayTotal . '</b></td> </tr></table>'; - echo '<br /><div class="centre"><input type="submit" name="UpdateLines" value="Update Order Lines">'; + echo '<br /> + <div class="centre"> + <input type="submit" name="UpdateLines" value="Update Order Lines" />'; - echo ' <input type="submit" name="Commit" value="Process Order"></div>'; + echo ' <input type="submit" name="Commit" value="Process Order" /> + </div>'; } /*Only display the order line items if there are any !! */ @@ -716,7 +721,7 @@ } echo '</select></td></tr>'; echo '<tr><td>'._('OR Asset ID'). '</td> - <td><select name="AssetID">'; + <td><select name="AssetID">'; $AssetsResult = DB_query("SELECT assetid, description, datepurchased FROM fixedassets ORDER BY assetid DESC",$db); echo '<option selected value="Not an Asset">' . _('Not an Asset') . '</option>'; while ($AssetRow = DB_fetch_array($AssetsResult)){ @@ -738,7 +743,9 @@ <tr><td>'._('Delivery Date').'</td> <td><input type="text" class="date" alt="'.$_SESSION['DefaultDateFormat'].'" name="ReqDelDate" size=11 value="'.$_SESSION['PO'.$identifier]->DeliveryDate .'"></td></tr>'; echo '</table>'; - echo '<div class=centre><input type=submit name="EnterLine" value="Enter Item"></div>'; + echo '<div class="centre"> + <input type=submit name="EnterLine" value="Enter Item" /> + </div>'; } /* Now show the stock item selection search stuff below */ @@ -752,8 +759,25 @@ $SearchString = '%' . str_replace(' ', '%', $_POST['Keywords']) . '%'; if ($_POST['StockCat']=='All'){ - - $sql = "SELECT stockmaster.stockid, + if ($_POST['SupplierItemsOnly']=='on'){ + $sql = "SELECT stockmaster.stockid, + stockmaster.description, + stockmaster.units + FROM stockmaster INNER JOIN stockcategory + ON stockmaster.categoryid=stockcategory.categoryid + INNER JOIN purchdata + ON stockmaster.stockid=purchdata.stockid + WHERE stockmaster.mbflag<>'D' + AND stockmaster.mbflag<>'K' + AND stockmaster.mbflag<>'G' + AND stockmaster.discontinued<>1 + AND purchdata.supplierno='" . $_SESSION['PO'.$identifier]->SupplierID . "' + AND stockmaster.description " . LIKE . " '" . $SearchString ."' + ORDER BY stockmaster.stockid + LIMIT " .$_SESSION['DefaultDisplayRecordsMax']; + } else { // not just supplier purchdata items + + $sql = "SELECT stockmaster.stockid, stockmaster.description, stockmaster.units FROM stockmaster INNER JOIN stockcategory @@ -765,28 +789,65 @@ AND stockmaster.description " . LIKE . " '" . $SearchString ."' ORDER BY stockmaster.stockid LIMIT " .$_SESSION['DefaultDisplayRecordsMax']; - } else { - $sql = "SELECT stockmaster.stockid, - stockmaster.description, - stockmaster.units - FROM stockmaster INNER JOIN stockcategory - ON stockmaster.categoryid=stockcategory.categoryid - WHERE stockmaster.mbflag<>'D' - AND stockmaster.mbflag<>'K' - AND stockmaster.mbflag<>'G' - AND stockmaster.discontinued<>1 - AND stockmaster.description " . LIKE . " '". $SearchString ."' - AND stockmaster.categoryid='" . $_POST['StockCat'] . "' - ORDER BY stockmaster.stockid - LIMIT ".$_SESSION['DefaultDisplayRecordsMax']; + } + } else { //for a specific stock category + if ($_POST['SupplierItemsOnly']=='on'){ + $sql = "SELECT stockmaster.stockid, + stockmaster.description, + stockmaster.units + FROM stockmaster INNER JOIN stockcategory + ON stockmaster.categoryid=stockcategory.categoryid + INNER JOIN purchdata + ON stockmaster.stockid=purchdata.stockid + WHERE stockmaster.mbflag<>'D' + AND stockmaster.mbflag<>'K' + AND stockmaster.mbflag<>'G' + AND purchdata.supplierno='" . $_SESSION['PO'.$identifier]->SupplierID . "' + AND stockmaster.discontinued<>1 + AND stockmaster.description " . LIKE . " '". $SearchString ."' + AND stockmaster.categoryid='" . $_POST['StockCat'] . "' + ORDER BY stockmaster.stockid + LIMIT ".$_SESSION['DefaultDisplayRecordsMax']; + } else { + $sql = "SELECT stockmaster.stockid, + stockmaster.description, + stockmaster.units + FROM stockmaster INNER JOIN stockcategory + ON stockmaster.categoryid=stockcategory.categoryid + WHERE stockmaster.mbflag<>'D' + AND stockmaster.mbflag<>'K' + AND stockmaster.mbflag<>'G' + AND stockmaster.discontinued<>1 + AND stockmaster.description " . LIKE . " '". $SearchString ."' + AND stockmaster.categoryid='" . $_POST['StockCat'] . "' + ORDER BY stockmaster.stockid + LIMIT ".$_SESSION['DefaultDisplayRecordsMax']; + } } } elseif ($_POST['StockCode']){ $_POST['StockCode'] = '%' . $_POST['StockCode'] . '%'; - + if ($_POST['StockCat']=='All'){ - $sql = "SELECT stockmaster.stockid, + if ($_POST['SupplierItemsOnly']=='on'){ + $sql = "SELECT stockmaster.stockid, + stockmaster.description, + stockmaster.units + FROM stockmaster INNER JOIN stockcategory + ON stockmaster.categoryid=stockcategory.categoryid + INNER JOIN purchdata + ON stockmaster.stockid=purchdata.stockid + WHERE stockmaster.mbflag<>'D' + AND stockmaster.mbflag<>'K' + AND stockmaster.mbflag<>'G' + AND purchdata.supplierno='" . $_SESSION['PO'.$identifier]->SupplierID . "' + AND stockmaster.discontinued<>1 + AND stockmaster.stockid " . LIKE . " '" . $_POST['StockCode'] . "' + ORDER BY stockmaster.stockid + LIMIT ".$_SESSION['DefaultDisplayRecordsMax']; + } else { + $sql = "SELECT stockmaster.stockid, stockmaster.description, stockmaster.units FROM stockmaster INNER JOIN stockcategory @@ -798,8 +859,27 @@ AND stockmaster.stockid " . LIKE . " '" . $_POST['StockCode'] . "' ORDER BY stockmaster.stockid LIMIT ".$_SESSION['DefaultDisplayRecordsMax']; - } else { - $sql = "SELECT stockmaster.stockid, + } + } else { //for a specific stock category and LIKE stock code + if ($_POST['SupplierItemsOnly']=='on'){ + $sql = "SELECT stockmaster.stockid, + stockmaster.description, + stockmaster.units + FROM stockmaster INNER JOIN stockcategory + ON stockmaster.categoryid=stockcategory.categoryid + INNER JOIN purchdata + ON stockmaster.stockid=purchdata.stockid + WHERE stockmaster.mbflag<>'D' + AND stockmaster.mbflag<>'K' + AND stockmaster.mbflag<>'G' + AND purchdata.supplierno='" . $_SESSION['PO'.$identifier]->SupplierID . "' + and stockmaster.discontinued<>1 + AND stockmaster.stockid " . LIKE . " '" . $_POST['StockCode'] . "' + AND stockmaster.categoryid='" . $_POST['StockCat'] . "' + ORDER BY stockmaster.stockid + LIMIT ".$_SESSION['DefaultDisplayRecordsMax']; + } else { + $sql = "SELECT stockmaster.stockid, stockmaster.description, stockmaster.units FROM stockmaster INNER JOIN stockcategory @@ -812,11 +892,28 @@ AND stockmaster.categoryid='" . $_POST['StockCat'] . "' ORDER BY stockmaster.stockid LIMIT ".$_SESSION['DefaultDisplayRecordsMax']; + } } } else { if ($_POST['StockCat']=='All'){ - $sql = "SELECT stockmaster.stockid, + if ($_POST['SupplierItemsOnly']=='on'){ + $sql = "SELECT stockmaster.stockid, + stockmaster.description, + stockmaster.units + FROM stockmaster INNER JOIN stockcategory + ON stockmaster.categoryid=stockcategory.categoryid + INNER JOIN purchdata + ON stockmaster.stockid=purchdata.stockid + WHERE stockmaster.mbflag<>'D' + AND stockmaster.mbflag<>'K' + AND stockmaster.mbflag<>'G' + AND purchdata.supplierno='" . $_SESSION['PO'.$identifier]->SupplierID . "' + AND stockmaster.discontinued<>1 + ORDER BY stockmaster.stockid + LIMIT " . $_SESSION['DefaultDisplayRecordsMax']; + } else { + $sql = "SELECT stockmaster.stockid, stockmaster.description, stockmaster.units FROM stockmaster INNER JOIN stockcategory @@ -827,8 +924,26 @@ AND stockmaster.discontinued<>1 ORDER BY stockmaster.stockid LIMIT " . $_SESSION['DefaultDisplayRecordsMax']; - } else { - $sql = "SELECT stockmaster.stockid, + } + } else { // for a specific stock category + if ($_POST['SupplierItemsOnly']=='on'){ + $sql = "SELECT stockmaster.stockid, + stockmaster.description, + stockmaster.units + FROM stockmaster INNER JOIN stockcategory + ON stockmaster.categoryid=stockcategory.categoryid + INNER JOIN purchdata + ON stockmaster.stockid=purchdata.stockid + WHERE stockmaster.mbflag<>'D' + AND stockmaster.mbflag<>'K' + AND stockmaster.mbflag<>'G' + AND purchdata.supplierno='" . $_SESSION['PO'.$identifier]->SupplierID . "' + AND stockmaster.discontinued<>1 + AND stockmaster.categoryid='" . $_POST['StockCat'] . "' + ORDER BY stockmaster.stockid + LIMIT " . $_SESSION['DefaultDisplayRecordsMax']; + } else { + $sql = "SELECT stockmaster.stockid, stockmaster.description, stockmaster.units FROM stockmaster INNER JOIN stockcategory @@ -840,6 +955,7 @@ AND stockmaster.categoryid='" . $_POST['StockCat'] . "' ORDER BY stockmaster.stockid LIMIT " . $_SESSION['DefaultDisplayRecordsMax']; + } } } @@ -870,13 +986,13 @@ $DbgMsg = _('The SQL used to retrieve the category details but failed was'); $result1 = DB_query($sql,$db,$ErrMsg,$DbgMsg); - echo '<table class=selection> + echo '<table class="selection"> <tr> <th colspan=3><font size=3 color=blue>'. _('Search For Stock Items') . '</th>'; echo ':</font> </tr> - <tr><td><select name="StockCat">'; + <tr><td>' . _('Item Category') . ': <select name="StockCat">'; echo '<option selected value="All">' . _('All') . '</option>'; @@ -902,7 +1018,11 @@ echo '</select></td> <td>' . _('Enter text extracts in the description') . ':</td> <td><input type="text" name="Keywords" size=20 maxlength=25 value="' . $_POST['Keywords'] . '"></td></tr> - <tr><td></td> + <tr><td>' . _('Only items defined as from this Supplier') . ' <input type="checkbox" name="SupplierItemsOnly" '; + if (isset($_POST['SupplierItemsOnly']) AND $_POST['SupplierItemsOnly']=='on'){ + echo 'checked'; + } + echo ' /></td> <td><font size=3><b>' . _('OR') . ' </b></font>' . _('Enter extract of the Stock Code') . ':</td> <td><input type="text" name="StockCode" size=15 maxlength=18 value="' . $_POST['StockCode'] . '"></td> </tr> Modified: trunk/PO_PDFPurchOrder.php =================================================================== --- trunk/PO_PDFPurchOrder.php 2011-08-04 10:18:14 UTC (rev 4649) +++ trunk/PO_PDFPurchOrder.php 2011-08-06 01:48:12 UTC (rev 4650) @@ -225,7 +225,9 @@ $POLine['itemdescription']=str_pad('',50,'x'); $POLine['unitprice']=9999.99; $POLine['units']=str_pad('',4,'x'); - $POLine['quantityord']=999.99; + $POLine['suppliersunit']=str_pad('',4,'x'); + $POLine['quantityord']=9999.99; + $POLine['conversionfactor']=1; $POLine['decimalplaces']=2; } $DisplayQty = number_format($POLine['quantityord']/$POLine['conversionfactor'],$POLine['decimalplaces']); @@ -275,8 +277,7 @@ /* If we are previewing we want to stop showing order * lines after the first one */ if ($OrderNo=='Preview') { -// unlink(sys_get_temp_dir().'/PurchaseOrder.xml'); - unset($OrderNo); + $OrderNo='Preview_PurchaseOrder'; } } //end while there are line items to print out if ($YPos-$line_height <= $Bottom_Margin){ // need to ensure space for totals @@ -308,7 +309,7 @@ $mail->setText( _('Please find herewith our purchase order number').' ' . $OrderNo); $mail->setSubject( _('Purchase Order Number').' ' . $OrderNo); $mail->addAttachment($attachment, $PdfFileName, 'application/pdf'); - $mail->setFrom($_SESSION['CompanyRecord']['coyname'] . "<" . $_SESSION['CompanyRecord']['email'] .">"); + $mail->setFrom($_SESSION['CompanyRecord']['coyname'] . '<' . $_SESSION['CompanyRecord']['email'] .'>'); $Success = $mail->send(array($_POST['EmailTo'])); if ($Success==1){ $title = _('Email a Purchase Order'); @@ -350,14 +351,14 @@ $_POST['PrintOrEmail'] = 'Print'; } if ($ViewingOnly!=0){ - echo '<option selected value="Print">'. _('Print'); + echo '<option selected value="Print">'. _('Print') . '</option>'; } else { if ($_POST['PrintOrEmail']=='Print'){ - echo '<option selected value="Print">'. _('Print'); - echo '<option value="Email">' . _('Email'); + echo '<option selected value="Print">'. _('Print') . '</option>'; + echo '<option value="Email">' . _('Email') . '</option>'; } else { - echo '<option value="Print">'. _('Print'); - echo '<option selected value="Email">'. _('Email'); + echo '<option value="Print">'. _('Print') . '</option>'; + echo '<option selected value="Email">'. _('Email') . '</option>'; } } echo '</select></td></tr>'; @@ -367,11 +368,11 @@ $_POST['ShowAmounts'] = 'Yes'; } if ($_POST['ShowAmounts']=='Yes'){ - echo '<option selected value="Yes">'. _('Yes'); - echo '<option value="No">' . _('No'); + echo '<option selected value="Yes">'. _('Yes') . '</option>'; + echo '<option value="No">' . _('No') . '</option>'; } else { - echo '<option value="Yes">'. _('Yes'); - echo '<option selected value="No">'. _('No'); + echo '<option value="Yes">'. _('Yes') . '</option>'; + echo '<option selected value="No">'. _('No') . '</option>'; } echo '</select></td></tr>'; if ($_POST['PrintOrEmail']=='Email'){ Modified: trunk/PaymentTerms.php =================================================================== --- trunk/PaymentTerms.php 2011-08-04 10:18:14 UTC (rev 4649) +++ trunk/PaymentTerms.php 2011-08-06 01:48:12 UTC (rev 4650) @@ -75,7 +75,7 @@ /*SelectedTerms could also exist if submit had not been clicked this code would not run in this case cos submit is false of course see the delete code below*/ - if (isset($_POST['DaysOrFoll']) and $_POST['DaysOrFoll']=='on') { + if (isset($_POST['DaysOrFoll']) AND $_POST['DaysOrFoll']=='on') { $sql = "UPDATE paymentterms SET terms='" . $_POST['Terms'] . "', dayinfollowingmonth=0, @@ -271,7 +271,7 @@ <tr> <td>'._('Due After A Given No. Of Days').':</td> <td><input type="checkbox" name="DaysOrFoll" '; - if ( isset($DayInFollowingMonth) && !$DayInFollowingMonth) { + if (isset($DayInFollowingMonth) AND !$DayInFollowingMonth) { echo 'checked'; } echo ' ></td> Modified: trunk/SelectProduct.php =================================================================== --- trunk/SelectProduct.php 2011-08-04 10:18:14 UTC (rev 4649) +++ trunk/SelectProduct.php 2011-08-06 01:48:12 UTC (rev 4650) @@ -376,7 +376,7 @@ echo '<td class="select">' . _('No') . '</td>'; } echo '<td class="select"><a href="' . $rootpath . '/PO_Header.php?NewOrder=Yes&SelectedSupplier=' . - $SuppRow['supplierid'] . '&StockID=' . $StockID . '&Quantity='.$SuppRow['minorderqty'].'">' . _('Order') . ' </a></td>'; + $SuppRow['supplierid'] . '&StockID=' . $StockID . '&Quantity='.$SuppRow['minorderqty'].'&LeadTime='.$SuppRow['leadtime'] . '">' . _('Order') . ' </a></td>'; echo '</tr>'; } echo '</table></td>'; Modified: trunk/doc/Change.log =================================================================== --- trunk/doc/Change.log 2011-08-04 10:18:14 UTC (rev 4649) +++ trunk/doc/Change.log 2011-08-06 01:48:12 UTC (rev 4650) @@ -1,5 +1,7 @@ webERP Change Log +6/8/11 Phil: PO_Items.php now has checkbox to select items that have purchasing data entered for the supplier ordering from - as per Klaus's (opto) suggestion +6/8/11 Exson: Added leadtime to the link from SelectProduct.php so that delivery dates used when creating purchase orders make sense 4/8/11 Phil: Fix GP Percent reported when discounts updated by discount matrix 4/8/11 Phil: Make PO_SelectOSPurchOrder.php behave similarly to SelectPurchOrder.php (for inquiries) where the order number is the link that takes you to the order 4/8/11 Ricard: SalesInquiry.php now shows net sales after discounts This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <dai...@us...> - 2011-08-06 01:48:19
|
Revision: 4650 http://web-erp.svn.sourceforge.net/web-erp/?rev=4650&view=rev Author: daintree Date: 2011-08-06 01:48:12 +0000 (Sat, 06 Aug 2011) Log Message: ----------- various Modified Paths: -------------- trunk/PO_Header.php trunk/PO_Items.php trunk/PO_PDFPurchOrder.php trunk/PaymentTerms.php trunk/SelectProduct.php trunk/doc/Change.log Modified: trunk/PO_Header.php =================================================================== --- trunk/PO_Header.php 2011-08-04 10:18:14 UTC (rev 4649) +++ trunk/PO_Header.php 2011-08-06 01:48:12 UTC (rev 4650) @@ -157,7 +157,9 @@ } /*New order initiated by user clicking on supplier purchasing data from items page */ -if (isset($_GET['NewOrder']) AND isset($_GET['StockID']) AND isset($_GET['SelectedSupplier'])) { +if (isset($_GET['NewOrder']) + AND isset($_GET['StockID']) + AND isset($_GET['SelectedSupplier'])) { /* * initialise a new order */ @@ -173,10 +175,10 @@ /* set the SupplierID we got */ $_SESSION['PO'.$identifier]->SupplierID = $_GET['SelectedSupplier']; $_SESSION['PO'.$identifier]->DeliveryDate = DateAdd(date($_SESSION['DefaultDateFormat']), 'd', $_GET['LeadTime']); + $_SESSION['RequireSupplierSelection'] = 0; $_POST['Select'] = $_GET['SelectedSupplier']; - /* * the item (it's item code) that should be purchased */ @@ -210,7 +212,9 @@ $_SESSION['PO'.$identifier]->ExRate = $_POST['ExRate']; $_SESSION['PO'.$identifier]->Comments = $_POST['Comments']; $_SESSION['PO'.$identifier]->DeliveryBy = $_POST['DeliveryBy']; - $_SESSION['PO'.$identifier]->StatusMessage = $_POST['StatusComments']; + if (isset($_POST['StatusComments'])){ + $_SESSION['PO'.$identifier]->StatusComments = $_POST['StatusComments']; + } $_SESSION['PO'.$identifier]->PaymentTerms = $_POST['PaymentTerms']; $_SESSION['PO'.$identifier]->Contact = $_POST['Contact']; $_SESSION['PO'.$identifier]->Tel = $_POST['Tel']; @@ -519,25 +523,29 @@ _('Purchase Order') . '" alt="">' . ' ' . _('Purchase Order: Select Supplier') . ''; echo '<form action="' . $_SERVER['PHP_SELF'] . '?identifier=' . $identifier . '" method="post" name="choosesupplier">'; echo '<input type="hidden" name="FormID" value="' . $_SESSION['FormID'] . '" />'; - echo '<input type="hidden" name="SuppliersReturned" value="' . $SuppliersReturned .'" />'; + if (isset($SuppliersReturned)){ + echo '<input type="hidden" name="SuppliersReturned" value="' . $SuppliersReturned .'" />'; + } - echo '<table cellpadding=3 colspan=4 class=selection> + echo '<table cellpadding="3" colspan="4" class="selection"> <tr> <td><font size=1>' . _('Enter text in the supplier name') . ':</font></td> - <td><input type="Text" name="Keywords" size="20" maxlength="25"></td> + <td><input type="text" name="Keywords" size="20" maxlength="25" /></td> <td><font size=3><b>' . _('OR') . '</b></font></td> <td><font size=1>' . _('Enter text extract in the supplier code') . ':</font></td> - <td><input type="text" name="SuppCode" size="15" maxlength="18"></td> + <td><input type="text" name="SuppCode" size="15" maxlength="18" /></td> </tr> - </table><br /><div class="centre"> - <input type="submit" name="SearchSuppliers" value="' . _('Search Now') . '"> - <input type="submit" action="reset" value="' . _('Reset') . '"></div>'; + </table> + <br /> + <div class="centre"> + <input type="submit" name="SearchSuppliers" value="' . _('Search Now') . '" /> + <input type="submit" action="reset" value="' . _('Reset') . '" /></div>'; echo '<script type="text/javascript">defaultControl(document.forms[0].Keywords);</script>'; if (isset($result_SuppSelect)) { - echo '<br /><table cellpadding=3 colspan=7 class=selection>'; + echo '<br /><table cellpadding="3" colspan="7" class="selection">'; $tableheader = '<tr> <th>' . _('Code') . '</th> @@ -606,7 +614,11 @@ /* the link */ echo '<li><a href="'.$rootpath.'/PO_Items.php?NewItem=' . $Purch_Item . '&identifier=' . $identifier . '">' . _('Enter Line Item to this purchase order') . '</a></li>'; - echo '</td></tr></table></div><br />'; + echo '</td> + </tr> + </table> + </div> + <br />'; if (isset($_GET['Quantity'])) { $Qty=$_GET['Quantity']; Modified: trunk/PO_Items.php =================================================================== --- trunk/PO_Items.php 2011-08-04 10:18:14 UTC (rev 4649) +++ trunk/PO_Items.php 2011-08-06 01:48:12 UTC (rev 4650) @@ -93,7 +93,7 @@ $AuthRow=DB_fetch_array($AuthResult); if (DB_num_rows($AuthResult) > 0 AND $AuthRow['authlevel'] > $_SESSION['PO'.$identifier]->Order_Value()) { //user has authority to authrorise as well as create the order - $StatusComment=date($_SESSION['DefaultDateFormat']).' - ' . _('Order Created and Authorised by') . $UserDetails . ' - '.$_SESSION['PO'.$identifier]->StatusMessage.'<br />'; + $StatusComment=date($_SESSION['DefaultDateFormat']).' - ' . _('Order Created and Authorised by') . $UserDetails . '<br />'.$_SESSION['PO'.$identifier]->StatusComments.'<br />'; $_SESSION['PO'.$identifier]->AllowPrintPO=1; $_SESSION['PO'.$identifier]->Status = 'Authorised'; } else { // no authority to authorise this order @@ -110,18 +110,16 @@ _('The order will be created with a status of pending and will require authorisation'), 'warn'); $_SESSION['PO'.$identifier]->AllowPrintPO=0; - $StatusComment=date($_SESSION['DefaultDateFormat']).' - ' . _('Order Created by') . $UserDetails . ' - '.$_SESSION['PO'.$identifier]->StatusMessage.'<br />'; + $StatusComment=date($_SESSION['DefaultDateFormat']).' - ' . _('Order Created by') . $UserDetails . '<br />'.$_SESSION['PO'.$identifier]->StatusComments.'<br />'; $_SESSION['PO'.$identifier]->Status = 'Pending'; } } else { //auto authorise is set to off $_SESSION['PO'.$identifier]->AllowPrintPO=0; - $StatusComment=date($_SESSION['DefaultDateFormat']).' - ' . _('Order Created by') . $UserDetails . ' - '.$_SESSION['PO'.$identifier]->StatusMessage.'<br />'; + $StatusComment=date($_SESSION['DefaultDateFormat']).' - ' . _('Order Created by') . $UserDetails . ' - '.$_SESSION['PO'.$identifier]->StatusComments.'<br />'; $_SESSION['PO'.$identifier]->Status = 'Pending'; } if ($_SESSION['ExistingOrder']==0){ /*its a new order to be inserted */ - -//Do we need to check authorisation to create - no because already trapped when new PO session started /*Get the order number */ $_SESSION['PO'.$identifier]->OrderNo = GetNextTransNo(18, $db); @@ -284,7 +282,10 @@ $result = DB_query($sql,$db,$ErrMsg,$DbgMsg,true); } } else if ($POLine->PODetailRec=='') { - + /*When the purchase order line is an existing record the auto-increment + * field PODetailRec is given to the session for that POLine + * So it will only be a new POLine if PODetailRec is empty + */ $sql = "INSERT INTO purchorderdetails ( orderno, itemcode, deliverydate, @@ -328,7 +329,7 @@ completed=1, assetid='" . $POLine->AssetID . "', conversionfactor = '" . $POLine->ConversionFactor . "' - WHERE podetailitem='" . $POLine->PODetailRec . "'"; + WHERE podetailitem='" . $POLine->PODetailRec . "'"; } else { $sql = "UPDATE purchorderdetails SET itemcode='" . $POLine->StockID . "', deliverydate ='" . FormatDateForSQL($POLine->ReqDelDate) . "', @@ -354,7 +355,7 @@ prnMsg(_('Purchase Order') . ' ' . $_SESSION['PO'.$identifier]->OrderNo . ' ' . _('has been updated'),'success'); if ($_SESSION['PO'.$identifier]->AllowPrintPO==1 AND ($_SESSION['PO'.$identifier]->Status=='Authorised' - OR $_SESSION['PO'.$identifier]->Status=='Printed')){ + OR $_SESSION['PO'.$identifier]->Status=='Printed')){ echo '<br /><a target="_blank" href="'.$rootpath.'/PO_PDFPurchOrder.php?OrderNo=' . $_SESSION['PO'.$identifier]->OrderNo . '">' . _('Print Purchase Order') . '</a>'; } } /*end of if its a new order or an existing one */ @@ -409,8 +410,8 @@ if ($_SESSION['PO'.$identifier]->GLLink==1){ $sql = "SELECT accountname - FROM chartmaster - WHERE accountcode ='" . (int) $_POST['GLCode'] . "'"; + FROM chartmaster + WHERE accountcode ='" . $_POST['GLCode'] . "'"; $ErrMsg = _('The account details for') . ' ' . $_POST['GLCode'] . ' ' . _('could not be retrieved because'); $DbgMsg = _('The SQL used to retrieve the details of the account, but failed was'); $GLValidResult = DB_query($sql,$db,$ErrMsg,$DbgMsg,false,false); @@ -438,10 +439,10 @@ $ValidAssetResult = DB_query("SELECT assetid, description, costact - FROM fixedassets - INNER JOIN fixedassetcategories - ON fixedassets.assetcategoryid=fixedassetcategories.categoryid - WHERE assetid='" . $_POST['AssetID'] . "'",$db); + FROM fixedassets + INNER JOIN fixedassetcategories + ON fixedassets.assetcategoryid=fixedassetcategories.categoryid + WHERE assetid='" . $_POST['AssetID'] . "'",$db); if (DB_num_rows($ValidAssetResult)==0){ // then the asset id entered doesn't exist $AllowUpdate = false; prnMsg(_('An asset code was entered but it does not yet exist. Only pre-existing asset ids can be entered when ordering a fixed asset'),'error'); @@ -494,9 +495,10 @@ if (isset($_POST['NewItem'])){ /* NewItem is set from the part selection list as the part code selected * take the form entries and enter the data from the form into the PurchOrder class variable - * A series of form variables of the format "Qty" with the ItemCode concatenated are created on the search for adding new - * items for each of these form variables need to parse out the items and look up the details to add them to the purchase - * order $_POST is of course the global array of all posted form variables */ + * A series of form variables of the format "NewQty" with the ItemCode concatenated are created on the search for adding new + * items for each of these form variables need to parse out the item code and look up the details to add them to the purchase + * order $_POST is of course the global array of all posted form variables + */ foreach ($_POST as $FormVariableName => $Quantity) { @@ -632,7 +634,7 @@ echo ' ' . _('Purchase Order') .' '. $_SESSION['PO'.$identifier]->OrderNo ; } echo '<br /><b>'._(' Order Summary') . '</b>'; - echo '<table cellpadding=2 colspan=7 class=selection>'; + echo '<table cellpadding="2" colspan="7" class="selection">'; echo '<tr> <th>' . _('Item Code') . '</th> <th>' . _('Description') . '</th> @@ -688,12 +690,15 @@ } $DisplayTotal = number_format($_SESSION['PO'.$identifier]->Total,$_SESSION['PO'.$identifier]->CurrDecimalPlaces); - echo '<tr><td colspan="10" class=number>' . _('TOTAL') . _(' excluding Tax') . '</td> - <td class=number><b>' . $DisplayTotal . '</b></td> + echo '<tr><td colspan="10" class="number">' . _('TOTAL') . _(' excluding Tax') . '</td> + <td class="number"><b>' . $DisplayTotal . '</b></td> </tr></table>'; - echo '<br /><div class="centre"><input type="submit" name="UpdateLines" value="Update Order Lines">'; + echo '<br /> + <div class="centre"> + <input type="submit" name="UpdateLines" value="Update Order Lines" />'; - echo ' <input type="submit" name="Commit" value="Process Order"></div>'; + echo ' <input type="submit" name="Commit" value="Process Order" /> + </div>'; } /*Only display the order line items if there are any !! */ @@ -716,7 +721,7 @@ } echo '</select></td></tr>'; echo '<tr><td>'._('OR Asset ID'). '</td> - <td><select name="AssetID">'; + <td><select name="AssetID">'; $AssetsResult = DB_query("SELECT assetid, description, datepurchased FROM fixedassets ORDER BY assetid DESC",$db); echo '<option selected value="Not an Asset">' . _('Not an Asset') . '</option>'; while ($AssetRow = DB_fetch_array($AssetsResult)){ @@ -738,7 +743,9 @@ <tr><td>'._('Delivery Date').'</td> <td><input type="text" class="date" alt="'.$_SESSION['DefaultDateFormat'].'" name="ReqDelDate" size=11 value="'.$_SESSION['PO'.$identifier]->DeliveryDate .'"></td></tr>'; echo '</table>'; - echo '<div class=centre><input type=submit name="EnterLine" value="Enter Item"></div>'; + echo '<div class="centre"> + <input type=submit name="EnterLine" value="Enter Item" /> + </div>'; } /* Now show the stock item selection search stuff below */ @@ -752,8 +759,25 @@ $SearchString = '%' . str_replace(' ', '%', $_POST['Keywords']) . '%'; if ($_POST['StockCat']=='All'){ - - $sql = "SELECT stockmaster.stockid, + if ($_POST['SupplierItemsOnly']=='on'){ + $sql = "SELECT stockmaster.stockid, + stockmaster.description, + stockmaster.units + FROM stockmaster INNER JOIN stockcategory + ON stockmaster.categoryid=stockcategory.categoryid + INNER JOIN purchdata + ON stockmaster.stockid=purchdata.stockid + WHERE stockmaster.mbflag<>'D' + AND stockmaster.mbflag<>'K' + AND stockmaster.mbflag<>'G' + AND stockmaster.discontinued<>1 + AND purchdata.supplierno='" . $_SESSION['PO'.$identifier]->SupplierID . "' + AND stockmaster.description " . LIKE . " '" . $SearchString ."' + ORDER BY stockmaster.stockid + LIMIT " .$_SESSION['DefaultDisplayRecordsMax']; + } else { // not just supplier purchdata items + + $sql = "SELECT stockmaster.stockid, stockmaster.description, stockmaster.units FROM stockmaster INNER JOIN stockcategory @@ -765,28 +789,65 @@ AND stockmaster.description " . LIKE . " '" . $SearchString ."' ORDER BY stockmaster.stockid LIMIT " .$_SESSION['DefaultDisplayRecordsMax']; - } else { - $sql = "SELECT stockmaster.stockid, - stockmaster.description, - stockmaster.units - FROM stockmaster INNER JOIN stockcategory - ON stockmaster.categoryid=stockcategory.categoryid - WHERE stockmaster.mbflag<>'D' - AND stockmaster.mbflag<>'K' - AND stockmaster.mbflag<>'G' - AND stockmaster.discontinued<>1 - AND stockmaster.description " . LIKE . " '". $SearchString ."' - AND stockmaster.categoryid='" . $_POST['StockCat'] . "' - ORDER BY stockmaster.stockid - LIMIT ".$_SESSION['DefaultDisplayRecordsMax']; + } + } else { //for a specific stock category + if ($_POST['SupplierItemsOnly']=='on'){ + $sql = "SELECT stockmaster.stockid, + stockmaster.description, + stockmaster.units + FROM stockmaster INNER JOIN stockcategory + ON stockmaster.categoryid=stockcategory.categoryid + INNER JOIN purchdata + ON stockmaster.stockid=purchdata.stockid + WHERE stockmaster.mbflag<>'D' + AND stockmaster.mbflag<>'K' + AND stockmaster.mbflag<>'G' + AND purchdata.supplierno='" . $_SESSION['PO'.$identifier]->SupplierID . "' + AND stockmaster.discontinued<>1 + AND stockmaster.description " . LIKE . " '". $SearchString ."' + AND stockmaster.categoryid='" . $_POST['StockCat'] . "' + ORDER BY stockmaster.stockid + LIMIT ".$_SESSION['DefaultDisplayRecordsMax']; + } else { + $sql = "SELECT stockmaster.stockid, + stockmaster.description, + stockmaster.units + FROM stockmaster INNER JOIN stockcategory + ON stockmaster.categoryid=stockcategory.categoryid + WHERE stockmaster.mbflag<>'D' + AND stockmaster.mbflag<>'K' + AND stockmaster.mbflag<>'G' + AND stockmaster.discontinued<>1 + AND stockmaster.description " . LIKE . " '". $SearchString ."' + AND stockmaster.categoryid='" . $_POST['StockCat'] . "' + ORDER BY stockmaster.stockid + LIMIT ".$_SESSION['DefaultDisplayRecordsMax']; + } } } elseif ($_POST['StockCode']){ $_POST['StockCode'] = '%' . $_POST['StockCode'] . '%'; - + if ($_POST['StockCat']=='All'){ - $sql = "SELECT stockmaster.stockid, + if ($_POST['SupplierItemsOnly']=='on'){ + $sql = "SELECT stockmaster.stockid, + stockmaster.description, + stockmaster.units + FROM stockmaster INNER JOIN stockcategory + ON stockmaster.categoryid=stockcategory.categoryid + INNER JOIN purchdata + ON stockmaster.stockid=purchdata.stockid + WHERE stockmaster.mbflag<>'D' + AND stockmaster.mbflag<>'K' + AND stockmaster.mbflag<>'G' + AND purchdata.supplierno='" . $_SESSION['PO'.$identifier]->SupplierID . "' + AND stockmaster.discontinued<>1 + AND stockmaster.stockid " . LIKE . " '" . $_POST['StockCode'] . "' + ORDER BY stockmaster.stockid + LIMIT ".$_SESSION['DefaultDisplayRecordsMax']; + } else { + $sql = "SELECT stockmaster.stockid, stockmaster.description, stockmaster.units FROM stockmaster INNER JOIN stockcategory @@ -798,8 +859,27 @@ AND stockmaster.stockid " . LIKE . " '" . $_POST['StockCode'] . "' ORDER BY stockmaster.stockid LIMIT ".$_SESSION['DefaultDisplayRecordsMax']; - } else { - $sql = "SELECT stockmaster.stockid, + } + } else { //for a specific stock category and LIKE stock code + if ($_POST['SupplierItemsOnly']=='on'){ + $sql = "SELECT stockmaster.stockid, + stockmaster.description, + stockmaster.units + FROM stockmaster INNER JOIN stockcategory + ON stockmaster.categoryid=stockcategory.categoryid + INNER JOIN purchdata + ON stockmaster.stockid=purchdata.stockid + WHERE stockmaster.mbflag<>'D' + AND stockmaster.mbflag<>'K' + AND stockmaster.mbflag<>'G' + AND purchdata.supplierno='" . $_SESSION['PO'.$identifier]->SupplierID . "' + and stockmaster.discontinued<>1 + AND stockmaster.stockid " . LIKE . " '" . $_POST['StockCode'] . "' + AND stockmaster.categoryid='" . $_POST['StockCat'] . "' + ORDER BY stockmaster.stockid + LIMIT ".$_SESSION['DefaultDisplayRecordsMax']; + } else { + $sql = "SELECT stockmaster.stockid, stockmaster.description, stockmaster.units FROM stockmaster INNER JOIN stockcategory @@ -812,11 +892,28 @@ AND stockmaster.categoryid='" . $_POST['StockCat'] . "' ORDER BY stockmaster.stockid LIMIT ".$_SESSION['DefaultDisplayRecordsMax']; + } } } else { if ($_POST['StockCat']=='All'){ - $sql = "SELECT stockmaster.stockid, + if ($_POST['SupplierItemsOnly']=='on'){ + $sql = "SELECT stockmaster.stockid, + stockmaster.description, + stockmaster.units + FROM stockmaster INNER JOIN stockcategory + ON stockmaster.categoryid=stockcategory.categoryid + INNER JOIN purchdata + ON stockmaster.stockid=purchdata.stockid + WHERE stockmaster.mbflag<>'D' + AND stockmaster.mbflag<>'K' + AND stockmaster.mbflag<>'G' + AND purchdata.supplierno='" . $_SESSION['PO'.$identifier]->SupplierID . "' + AND stockmaster.discontinued<>1 + ORDER BY stockmaster.stockid + LIMIT " . $_SESSION['DefaultDisplayRecordsMax']; + } else { + $sql = "SELECT stockmaster.stockid, stockmaster.description, stockmaster.units FROM stockmaster INNER JOIN stockcategory @@ -827,8 +924,26 @@ AND stockmaster.discontinued<>1 ORDER BY stockmaster.stockid LIMIT " . $_SESSION['DefaultDisplayRecordsMax']; - } else { - $sql = "SELECT stockmaster.stockid, + } + } else { // for a specific stock category + if ($_POST['SupplierItemsOnly']=='on'){ + $sql = "SELECT stockmaster.stockid, + stockmaster.description, + stockmaster.units + FROM stockmaster INNER JOIN stockcategory + ON stockmaster.categoryid=stockcategory.categoryid + INNER JOIN purchdata + ON stockmaster.stockid=purchdata.stockid + WHERE stockmaster.mbflag<>'D' + AND stockmaster.mbflag<>'K' + AND stockmaster.mbflag<>'G' + AND purchdata.supplierno='" . $_SESSION['PO'.$identifier]->SupplierID . "' + AND stockmaster.discontinued<>1 + AND stockmaster.categoryid='" . $_POST['StockCat'] . "' + ORDER BY stockmaster.stockid + LIMIT " . $_SESSION['DefaultDisplayRecordsMax']; + } else { + $sql = "SELECT stockmaster.stockid, stockmaster.description, stockmaster.units FROM stockmaster INNER JOIN stockcategory @@ -840,6 +955,7 @@ AND stockmaster.categoryid='" . $_POST['StockCat'] . "' ORDER BY stockmaster.stockid LIMIT " . $_SESSION['DefaultDisplayRecordsMax']; + } } } @@ -870,13 +986,13 @@ $DbgMsg = _('The SQL used to retrieve the category details but failed was'); $result1 = DB_query($sql,$db,$ErrMsg,$DbgMsg); - echo '<table class=selection> + echo '<table class="selection"> <tr> <th colspan=3><font size=3 color=blue>'. _('Search For Stock Items') . '</th>'; echo ':</font> </tr> - <tr><td><select name="StockCat">'; + <tr><td>' . _('Item Category') . ': <select name="StockCat">'; echo '<option selected value="All">' . _('All') . '</option>'; @@ -902,7 +1018,11 @@ echo '</select></td> <td>' . _('Enter text extracts in the description') . ':</td> <td><input type="text" name="Keywords" size=20 maxlength=25 value="' . $_POST['Keywords'] . '"></td></tr> - <tr><td></td> + <tr><td>' . _('Only items defined as from this Supplier') . ' <input type="checkbox" name="SupplierItemsOnly" '; + if (isset($_POST['SupplierItemsOnly']) AND $_POST['SupplierItemsOnly']=='on'){ + echo 'checked'; + } + echo ' /></td> <td><font size=3><b>' . _('OR') . ' </b></font>' . _('Enter extract of the Stock Code') . ':</td> <td><input type="text" name="StockCode" size=15 maxlength=18 value="' . $_POST['StockCode'] . '"></td> </tr> Modified: trunk/PO_PDFPurchOrder.php =================================================================== --- trunk/PO_PDFPurchOrder.php 2011-08-04 10:18:14 UTC (rev 4649) +++ trunk/PO_PDFPurchOrder.php 2011-08-06 01:48:12 UTC (rev 4650) @@ -225,7 +225,9 @@ $POLine['itemdescription']=str_pad('',50,'x'); $POLine['unitprice']=9999.99; $POLine['units']=str_pad('',4,'x'); - $POLine['quantityord']=999.99; + $POLine['suppliersunit']=str_pad('',4,'x'); + $POLine['quantityord']=9999.99; + $POLine['conversionfactor']=1; $POLine['decimalplaces']=2; } $DisplayQty = number_format($POLine['quantityord']/$POLine['conversionfactor'],$POLine['decimalplaces']); @@ -275,8 +277,7 @@ /* If we are previewing we want to stop showing order * lines after the first one */ if ($OrderNo=='Preview') { -// unlink(sys_get_temp_dir().'/PurchaseOrder.xml'); - unset($OrderNo); + $OrderNo='Preview_PurchaseOrder'; } } //end while there are line items to print out if ($YPos-$line_height <= $Bottom_Margin){ // need to ensure space for totals @@ -308,7 +309,7 @@ $mail->setText( _('Please find herewith our purchase order number').' ' . $OrderNo); $mail->setSubject( _('Purchase Order Number').' ' . $OrderNo); $mail->addAttachment($attachment, $PdfFileName, 'application/pdf'); - $mail->setFrom($_SESSION['CompanyRecord']['coyname'] . "<" . $_SESSION['CompanyRecord']['email'] .">"); + $mail->setFrom($_SESSION['CompanyRecord']['coyname'] . '<' . $_SESSION['CompanyRecord']['email'] .'>'); $Success = $mail->send(array($_POST['EmailTo'])); if ($Success==1){ $title = _('Email a Purchase Order'); @@ -350,14 +351,14 @@ $_POST['PrintOrEmail'] = 'Print'; } if ($ViewingOnly!=0){ - echo '<option selected value="Print">'. _('Print'); + echo '<option selected value="Print">'. _('Print') . '</option>'; } else { if ($_POST['PrintOrEmail']=='Print'){ - echo '<option selected value="Print">'. _('Print'); - echo '<option value="Email">' . _('Email'); + echo '<option selected value="Print">'. _('Print') . '</option>'; + echo '<option value="Email">' . _('Email') . '</option>'; } else { - echo '<option value="Print">'. _('Print'); - echo '<option selected value="Email">'. _('Email'); + echo '<option value="Print">'. _('Print') . '</option>'; + echo '<option selected value="Email">'. _('Email') . '</option>'; } } echo '</select></td></tr>'; @@ -367,11 +368,11 @@ $_POST['ShowAmounts'] = 'Yes'; } if ($_POST['ShowAmounts']=='Yes'){ - echo '<option selected value="Yes">'. _('Yes'); - echo '<option value="No">' . _('No'); + echo '<option selected value="Yes">'. _('Yes') . '</option>'; + echo '<option value="No">' . _('No') . '</option>'; } else { - echo '<option value="Yes">'. _('Yes'); - echo '<option selected value="No">'. _('No'); + echo '<option value="Yes">'. _('Yes') . '</option>'; + echo '<option selected value="No">'. _('No') . '</option>'; } echo '</select></td></tr>'; if ($_POST['PrintOrEmail']=='Email'){ Modified: trunk/PaymentTerms.php =================================================================== --- trunk/PaymentTerms.php 2011-08-04 10:18:14 UTC (rev 4649) +++ trunk/PaymentTerms.php 2011-08-06 01:48:12 UTC (rev 4650) @@ -75,7 +75,7 @@ /*SelectedTerms could also exist if submit had not been clicked this code would not run in this case cos submit is false of course see the delete code below*/ - if (isset($_POST['DaysOrFoll']) and $_POST['DaysOrFoll']=='on') { + if (isset($_POST['DaysOrFoll']) AND $_POST['DaysOrFoll']=='on') { $sql = "UPDATE paymentterms SET terms='" . $_POST['Terms'] . "', dayinfollowingmonth=0, @@ -271,7 +271,7 @@ <tr> <td>'._('Due After A Given No. Of Days').':</td> <td><input type="checkbox" name="DaysOrFoll" '; - if ( isset($DayInFollowingMonth) && !$DayInFollowingMonth) { + if (isset($DayInFollowingMonth) AND !$DayInFollowingMonth) { echo 'checked'; } echo ' ></td> Modified: trunk/SelectProduct.php =================================================================== --- trunk/SelectProduct.php 2011-08-04 10:18:14 UTC (rev 4649) +++ trunk/SelectProduct.php 2011-08-06 01:48:12 UTC (rev 4650) @@ -376,7 +376,7 @@ echo '<td class="select">' . _('No') . '</td>'; } echo '<td class="select"><a href="' . $rootpath . '/PO_Header.php?NewOrder=Yes&SelectedSupplier=' . - $SuppRow['supplierid'] . '&StockID=' . $StockID . '&Quantity='.$SuppRow['minorderqty'].'">' . _('Order') . ' </a></td>'; + $SuppRow['supplierid'] . '&StockID=' . $StockID . '&Quantity='.$SuppRow['minorderqty'].'&LeadTime='.$SuppRow['leadtime'] . '">' . _('Order') . ' </a></td>'; echo '</tr>'; } echo '</table></td>'; Modified: trunk/doc/Change.log =================================================================== --- trunk/doc/Change.log 2011-08-04 10:18:14 UTC (rev 4649) +++ trunk/doc/Change.log 2011-08-06 01:48:12 UTC (rev 4650) @@ -1,5 +1,7 @@ webERP Change Log +6/8/11 Phil: PO_Items.php now has checkbox to select items that have purchasing data entered for the supplier ordering from - as per Klaus's (opto) suggestion +6/8/11 Exson: Added leadtime to the link from SelectProduct.php so that delivery dates used when creating purchase orders make sense 4/8/11 Phil: Fix GP Percent reported when discounts updated by discount matrix 4/8/11 Phil: Make PO_SelectOSPurchOrder.php behave similarly to SelectPurchOrder.php (for inquiries) where the order number is the link that takes you to the order 4/8/11 Ricard: SalesInquiry.php now shows net sales after discounts This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <dai...@us...> - 2011-08-07 04:37:38
|
Revision: 4652 http://web-erp.svn.sourceforge.net/web-erp/?rev=4652&view=rev Author: daintree Date: 2011-08-07 04:37:32 +0000 (Sun, 07 Aug 2011) Log Message: ----------- M trunk/doc/Change.log M trunk/includes/MiscFunctions.php M trunk/SystemParameters.php M trunk/InventoryQuantities.php M trunk/SalesInquiry.php Modified Paths: -------------- trunk/InventoryQuantities.php trunk/SalesInquiry.php trunk/SystemParameters.php trunk/doc/Change.log trunk/includes/MiscFunctions.php Modified: trunk/InventoryQuantities.php =================================================================== --- trunk/InventoryQuantities.php 2011-08-06 01:53:38 UTC (rev 4651) +++ trunk/InventoryQuantities.php 2011-08-07 04:37:32 UTC (rev 4652) @@ -40,7 +40,7 @@ stockmaster.serialised, stockmaster.controlled FROM locstock INNER JOIN stockmaster - locstock.stockid=stockmaster.stockid + ON locstock.stockid=stockmaster.stockid INNER JOIN locations ON locstock.loccode=locations.loccode WHERE locstock.quantity <> 0 @@ -62,7 +62,7 @@ stockmaster.serialised, stockmaster.controlled FROM locstock INNER JOIN stockmaster - locstock.stockid=stockmaster.stockid + ON locstock.stockid=stockmaster.stockid INNER JOIN locations ON locstock.loccode=locations.loccode WHERE (SELECT count(*) Modified: trunk/SalesInquiry.php =================================================================== --- trunk/SalesInquiry.php 2011-08-06 01:53:38 UTC (rev 4651) +++ trunk/SalesInquiry.php 2011-08-07 04:37:32 UTC (rev 4652) @@ -159,9 +159,9 @@ } // Only used for Invoice Date type where tempstockmoves is the main table - $wheretype = " AND (tempstockmoves.type='10' OR tempstockmoves.type='11')"; + $WhereType = " AND (tempstockmoves.type='10' OR tempstockmoves.type='11')"; if ($_POST['InvoiceType'] != 'All') { - $wheretype = " AND tempstockmoves.type = '" . $_POST['InvoiceType'] . "'"; + $WhereType = " AND tempstockmoves.type = '" . $_POST['InvoiceType'] . "'"; } if ($inputError !=1) { $FromDate = FormatDateForSQL($_POST['FromDate']); @@ -239,7 +239,7 @@ AND tempstockmoves.hidemovt=0 AND salesorders.quotation = '" . $_POST['OrderType'] . "' $WherePart - $wheretype + $WhereType $WhereOrderNo $WhereDebtorNo $WhereDebtorName @@ -498,7 +498,7 @@ AND tempstockmoves.hidemovt=0 AND salesorders.quotation = '" . $_POST['OrderType'] . "' $WherePart - $wheretype + $WhereType $WhereOrderNo $WhereDebtorNo $WhereDebtorName @@ -533,7 +533,7 @@ AND tempstockmoves.hidemovt=0 AND salesorders.quotation = '" . $_POST['OrderType'] . "' $WherePart - $wheretype + $WhereType $WhereOrderNo $WhereDebtorNo $WhereDebtorName @@ -571,7 +571,7 @@ AND tempstockmoves.hidemovt=0 AND salesorders.quotation = '" . $_POST['OrderType'] . "' $WherePart - $wheretype + $WhereType $WhereOrderNo $WhereDebtorNo $WhereDebtorName @@ -605,7 +605,7 @@ AND tempstockmoves.hidemovt=0 AND salesorders.quotation = '" . $_POST['OrderType'] . "' $WherePart - $wheretype + $WhereType $WhereOrderNo $WhereDebtorNo $WhereDebtorName @@ -639,7 +639,7 @@ AND tempstockmoves.hidemovt=0 AND salesorders.quotation = '" . $_POST['OrderType'] . "' $WherePart - $wheretype + $WhereType $WhereOrderNo $WhereDebtorNo $WhereDebtorName @@ -673,7 +673,7 @@ AND tempstockmoves.hidemovt=0 AND salesorders.quotation = '" . $_POST['OrderType'] . "' $WherePart - $wheretype + $WhereType $WhereOrderNo $WhereDebtorNo $WhereDebtorName @@ -707,7 +707,7 @@ AND tempstockmoves.hidemovt=0 AND salesorders.quotation = '" . $_POST['OrderType'] . "' $WherePart - $wheretype + $WhereType $WhereOrderNo $WhereDebtorNo $WhereDebtorName @@ -726,45 +726,45 @@ $result = DB_query($sql,$db,$ErrMsg); $ctr = 0; echo '<pre>'; - $totalqty = 0; - $totalextcost = 0; - $totalextprice = 0; - $totalinvqty = 0; + $TotalQty = 0; + $TotalExtCost = 0; + $TotalExtPrice = 0; + $TotalInvQty = 0; // Create array for summary type to display in header. Access it with $savesummarytype - $summary_array['orderno'] = _('Order Number'); - $summary_array['stkcode'] = _('Part Number'); - $summary_array['extprice'] = _('Extended Price'); - $summary_array['debtorno'] = _('Customer Number'); - $summary_array['name'] = _('Customer Name'); - $summary_array['month'] = _('Month'); - $summary_array['categoryid'] = _('Stock Category'); - $summary_array['salesman'] = _('Salesman'); - $summary_array['area'] = _('Sales Area'); - $summary_array['transno'] = _('Transaction Number'); + $Summary_Array['orderno'] = _('Order Number'); + $Summary_Array['stkcode'] = _('Stock Code'); + $Summary_Array['extprice'] = _('Extended Price'); + $Summary_Array['debtorno'] = _('Customer Number'); + $Summary_Array['name'] = _('Customer Name'); + $Summary_Array['month'] = _('Month'); + $Summary_Array['categoryid'] = _('Stock Category'); + $Summary_Array['salesman'] = _('Salesman'); + $Summary_Array['area'] = _('Sales Area'); + $Summary_Array['transno'] = _('Transaction Number'); // Create array for sort for detail report to display in header - $detail_array['salesorderdetails.orderno'] = _('Order Number'); - $detail_array['salesorderdetails.stkcode'] = _('Part Number'); - $detail_array['debtorsmaster.debtorno,salesorderdetails.orderno'] = _('Customer Number'); - $detail_array['debtorsmaster.name,debtorsmaster.debtorno,salesorderdetails.orderno'] = _('Customer Name'); - $detail_array['tempstockmoves.transno,salesorderdetails.stkcode'] = _('Transaction Number'); + $Detail_Array['salesorderdetails.orderno'] = _('Order Number'); + $Detail_Array['salesorderdetails.stkcode'] = _('Stock Code'); + $Detail_Array['debtorsmaster.debtorno,salesorderdetails.orderno'] = _('Customer Number'); + $Detail_Array['debtorsmaster.name,debtorsmaster.debtorno,salesorderdetails.orderno'] = _('Customer Name'); + $Detail_Array['tempstockmoves.transno,salesorderdetails.stkcode'] = _('Transaction Number'); // Display Header info if ($_POST['ReportType'] == 'Summary') { - $sortby_display = $summary_array[$savesummarytype]; + $SortBy_Display = $Summary_Array[$savesummarytype]; } else { - $sortby_display = $detail_array[$_POST['SortBy']]; + $SortBy_Display = $Detail_Array[$_POST['SortBy']]; } - echo ' ' . _('Sales Inquiry') . ' - ' . $_POST['ReportType'] . " By $sortby_display <br/>"; + echo ' ' . _('Sales Inquiry') . ' - ' . $_POST['ReportType'] . ' ' . _('By') . ' ' . $SortBy_Display . '<br/>'; if ($_POST['OrderType'] == '0') { echo ' ' . _('Order Type - Sales Orders') . '<br/>'; } else { echo ' ' . _('Order Type - Quotations') . '<br/>'; } echo ' ' . _('Date Type') . ' - ' . $_POST['DateType'] . '<br/>'; - echo ' ' . _('Date Range') . ' - ' . $_POST['FromDate'] . _(' To ') . $_POST['ToDate'] . '<br/>'; + echo ' ' . _('Date Range') . ' - ' . $_POST['FromDate'] . ' ' . _('To') . ' ' . $_POST['ToDate'] . '<br/>'; if (mb_strlen(trim($PartNumber)) > 0) { - echo ' ' . _('Part Number') . ' - ' . $_POST['PartNumberOp'] . ' ' . $_POST['PartNumber'] . '<br/>'; + echo ' ' . _('Stock Code') . ' - ' . $_POST['PartNumberOp'] . ' ' . $_POST['PartNumber'] . '<br/>'; } if (mb_strlen(trim($_POST['DebtorNo'])) > 0) { echo ' ' . _('Customer Number') . ' - ' . $_POST['DebtorNoOp'] . ' ' . $_POST['DebtorNo'] . '<br/>'; @@ -790,7 +790,7 @@ if ($_POST['DateType'] == 'Order') { printf('%10s | %-20s | %10s | %-10s | %-30s | %-30s | %12s | %14s | %14s | %14s | %12s | %-10s | %-10s | %-10s | %-40s ', _('Order No'), - _('Part Number'), + _('Stock Code'), _('Order Date'), _('Debtor No'), _('Debtor Name'), @@ -803,13 +803,13 @@ _('Item Due'), _('Salesman'), _('Area'), - _('Part Description')); + _('Item Description')); } else { // Headings for Invoiced Date printf('%10s | %14s | %-20s | %10s | %-10s | %-30s | %-30s | %12s | %14s | %14s | %12s | %-10s | %-10s | %-10s | %-40s ', _('Order No'), _('Trans. No'), - _('Part Number'), + _('Stock Code'), _('Order Date'), _('Debtor No'), _('Debtor Name'), @@ -821,7 +821,7 @@ _('Invoiced'), _('Salesman'), _('Area'), - _('Part Description')); + _('Item Description')); } print '<br/><br/>'; $linectr = 0; @@ -845,7 +845,7 @@ $myrow['area'], $myrow['description']); print '<br/>'; - $totalqty += $myrow['quantity']; + $TotalQty += $myrow['quantity']; } else { // Detail for Invoiced Date printf('%10s | %14s | %-20s | %10s | %-10s | %-30s | %-30s | %12s | %14s | %14s | %12s | %-10s | %-10s | %-10s | %-40s ', @@ -865,12 +865,12 @@ $myrow['area'], $myrow['description']); print '<br/>'; - $totalqty += $myrow['qty']; + $TotalQty += $myrow['qty']; } $lastdecimalplaces = $myrow['decimalplaces']; - $totalextcost += $myrow['extcost']; - $totalextprice += $myrow['extprice']; - $totalinvqty += $myrow['qtyinvoiced']; + $TotalExtCost += $myrow['extcost']; + $TotalExtPrice += $myrow['extprice']; + $TotalInvQty += $myrow['qtyinvoiced']; } //END WHILE LIST LOOP // Print totals if ($_POST['DateType'] == 'Order') { @@ -881,10 +881,10 @@ ' ', ' ', ' ', - number_format($totalqty,2), - number_format($totalextcost,2), - number_format($totalextprice,2), - number_format($totalinvqty,2), + number_format($TotalQty,2), + number_format($TotalExtCost,2), + number_format($TotalExtPrice,2), + number_format($TotalInvQty,2), ' ', ' ', ' '); @@ -898,9 +898,9 @@ ' ', ' ', ' ', - number_format($totalqty,2), - number_format($totalextcost,2), - number_format($totalextprice,2), + number_format($TotalQty,2), + number_format($TotalExtCost,2), + number_format($TotalExtPrice,2), ' ', ' ', ' '); @@ -908,60 +908,60 @@ echo '</pre>'; } else { // Print summary stuff - $summarytype = $_POST['SummaryType']; + $SummaryType = $_POST['SummaryType']; $columnheader7 = ' '; // Set up description based on the Summary Type - if ($summarytype == 'name') { - $summarytype = 'name'; - $description = 'debtorno'; - $summaryheader = _('Customer Name'); - $descriptionheader = _('Customer Number'); + if ($SummaryType == 'name') { + $SummaryType = 'name'; + $Description = 'debtorno'; + $SummaryHeader = _('Customer Name'); + $Descriptionheader = _('Customer Number'); } - if ($summarytype == 'stkcode' || $summarytype == 'extprice') { - $description = 'description'; - $summaryheader = _('Part Number'); - $descriptionheader = _('Part Description'); + if ($SummaryType == 'stkcode' OR $SummaryType == 'extprice') { + $Description = 'description'; + $SummaryHeader = _('Stock Code'); + $Descriptionheader = _('Item Description'); } - if ($summarytype == 'transno') { - $description = 'name'; - $summaryheader = _('Transaction Number'); - $descriptionheader = _('Customer Name'); + if ($SummaryType == 'transno') { + $Description = 'name'; + $SummaryHeader = _('Transaction Number'); + $Descriptionheader = _('Customer Name'); $columnheader7 = _('Order Number'); } - if ($summarytype == 'debtorno') { - $description = 'name'; - $summaryheader = _('Customer Number'); - $descriptionheader = _('Customer Name'); + if ($SummaryType == 'debtorno') { + $Description = 'name'; + $SummaryHeader = _('Customer Number'); + $Descriptionheader = _('Customer Name'); } - if ($summarytype == 'orderno') { - $description = 'debtorno'; - $summaryheader = _('Order Number'); - $descriptionheader = _('Customer Number'); + if ($SummaryType == 'orderno') { + $Description = 'debtorno'; + $SummaryHeader = _('Order Number'); + $Descriptionheader = _('Customer Number'); $columnheader7 = _('Customer Name'); } - if ($summarytype == 'categoryid') { - $description = 'categorydescription'; - $summaryheader = _('Stock Category'); - $descriptionheader = _('Category Description'); + if ($SummaryType == 'categoryid') { + $Description = 'categorydescription'; + $SummaryHeader = _('Stock Category'); + $Descriptionheader = _('Category Description'); } - if ($summarytype == 'salesman') { - $description = 'salesmanname'; - $summaryheader = _('Salesman Code'); - $descriptionheader = _('Salesman Name'); + if ($SummaryType == 'salesman') { + $Description = 'salesmanname'; + $SummaryHeader = _('Salesman Code'); + $Descriptionheader = _('Salesman Name'); } - if ($summarytype == 'area') { - $description = 'areadescription'; - $summaryheader = _('Sales Area'); - $descriptionheader = _('Area Description'); + if ($SummaryType == 'area') { + $Description = 'areadescription'; + $SummaryHeader = _('Sales Area'); + $Descriptionheader = _('Area Description'); } - if ($summarytype == 'month') { - $description = 'monthname'; - $summaryheader = _('Month'); - $descriptionheader = _('Month'); + if ($SummaryType == 'month') { + $Description = 'monthname'; + $SummaryHeader = _('Month'); + $Descriptionheader = _('Month'); } printf(' %-30s | %-40s | %12s | %14s | %14s | %14s | %-15s', - _($summaryheader), - _($descriptionheader), + _($SummaryHeader), + _($Descriptionheader), _('Quantity'), _('Extended Cost'), _('Extended Price'), @@ -973,42 +973,42 @@ $linectr = 0; while ($myrow = DB_fetch_array($result)) { $linectr++; - if ($summarytype == 'orderno') { + if ($SummaryType == 'orderno') { $column7 = $myrow['name']; } - if ($summarytype == 'transno') { + if ($SummaryType == 'transno') { $column7 = $myrow['orderno']; } if ($_POST['DateType'] == 'Order') { // quantity is from salesorderdetails - $displayqty = $myrow['quantity']; + $DisplayQty = $myrow['quantity']; } else { // qty is from stockmoves - $displayqty = $myrow['qty']; + $DisplayQty = $myrow['qty']; } printf(' %-30s | %-40s | %12s | %14s | %14s | %14s | %-40s', - $myrow[$summarytype], - $myrow[$description], - number_format($displayqty,2), + $myrow[$SummaryType], + $myrow[$Description], + number_format($DisplayQty,2), number_format($myrow['extcost'],2), number_format($myrow['extprice'],2), number_format($myrow['qtyinvoiced'],2), $column7); print '<br/>'; - $totalqty += $displayqty; - $totalextcost += $myrow['extcost']; - $totalextprice += $myrow['extprice']; - $totalinvqty += $myrow['qtyinvoiced']; + $TotalQty += $DisplayQty; + $TotalExtCost += $myrow['extcost']; + $TotalExtPrice += $myrow['extprice']; + $TotalInvQty += $myrow['qtyinvoiced']; } //END WHILE LIST LOOP // Print totals printf(' %-30s | %-40s | %12s | %14s | %14s | %14s', _('Totals'), _('Lines - ') . $linectr, - number_format($totalqty,2), - number_format($totalextcost,2), - number_format($totalextprice,2), - number_format($totalinvqty,2), + number_format($TotalQty,2), + number_format($TotalExtCost,2), + number_format($TotalExtPrice,2), + number_format($TotalInvQty,2), ' '); echo '</pre>'; } // End of if ($_POST['ReportType'] @@ -1062,7 +1062,7 @@ <td><input type="text" class="date" alt="' . $_SESSION['DefaultDateFormat'] . '" name="ToDate" size=10 maxlength=10 value="' . $_POST['ToDate'] . '"></td> </tr>'; - echo '<tr><td>' . _('Part Number') . ':</td>'; + echo '<tr><td>' . _('Stock Code') . ':</td>'; echo '<td><select name="PartNumberOp">'; echo '<option selected value="Equals">' . _('Equals') . '</option>'; echo '<option value="LIKE">' . _('Begins With') . '</option>'; @@ -1125,7 +1125,7 @@ echo '<tr><td>' . _('Sort By') . ':</td>'; echo '<td><select name="SortBy">'; echo '<option selected value="salesorderdetails.orderno">' . _('Order Number') . '</option>'; - echo '<option value="salesorderdetails.stkcode">' . _('Part Number') . '</option>'; + echo '<option value="salesorderdetails.stkcode">' . _('Stock Code') . '</option>'; echo '<option value="debtorsmaster.debtorno,salesorderdetails.orderno">' . _('Customer Number') . '</option>'; echo '<option value="debtorsmaster.name,debtorsmaster.debtorno,salesorderdetails.orderno">' . _('Customer Name') . '</option>'; echo '<option value="tempstockmoves.transno,salesorderdetails.stkcode">' . _('Transaction Number') . '</option>'; @@ -1140,7 +1140,7 @@ echo '<td><select name="SummaryType">'; echo '<option selected value="orderno">' . _('Order Number') . '</option>'; echo '<option value="transno">' . _('Transaction Number') . '</option>'; - echo '<option value="stkcode">' . _('Part Number') . '</option>'; + echo '<option value="stkcode">' . _('Stock Code') . '</option>'; echo '<option value="extprice">' . _('Extended Price') . '</option>'; echo '<option value="debtorno">' . _('Customer Number') . '</option>'; echo '<option value="name">' . _('Customer Name') . '</option>'; Modified: trunk/SystemParameters.php =================================================================== --- trunk/SystemParameters.php 2011-08-06 01:53:38 UTC (rev 4651) +++ trunk/SystemParameters.php 2011-08-07 04:37:32 UTC (rev 4652) @@ -807,8 +807,9 @@ </tr>'; $WikiApplications = array( _('Disabled'), - _('WackoWiki'), - _('MediaWiki') ); + _('WackoWiki'), + _('MediaWiki'), + _('DokuWiki') ); echo '<tr style="outline: 1px solid"><td>' . _('Wiki application') . ':</td> <td><select name="X_WikiApp">'; Modified: trunk/doc/Change.log =================================================================== --- trunk/doc/Change.log 2011-08-06 01:53:38 UTC (rev 4651) +++ trunk/doc/Change.log 2011-08-07 04:37:32 UTC (rev 4652) @@ -1,5 +1,8 @@ webERP Change Log +7/8/11 Ricard: Corrected INNER JOIN ON clause in sql used in InventoryQuantities.php script +7/8/11 Klaus: Added docuwiki links to WikiLinks function in MiscFunctions.php and allow Docuwiki option in SystemParameters.php +6/8/11 Ricard: SalesInquiry.php fix wording of labels to be more consistent with the rest of webERP 6/8/11 Phil: PO_Items.php now has checkbox to select items that have purchasing data entered for the supplier ordering from - as per Klaus's (opto) suggestion 6/8/11 Exson: Added leadtime to the link from SelectProduct.php so that delivery dates used when creating purchase orders make sense 4/8/11 Phil: Fix GP Percent reported when discounts updated by discount matrix Modified: trunk/includes/MiscFunctions.php =================================================================== --- trunk/includes/MiscFunctions.php 2011-08-06 01:53:38 UTC (rev 4651) +++ trunk/includes/MiscFunctions.php 2011-08-07 04:37:32 UTC (rev 4652) @@ -228,14 +228,17 @@ function wikiLink($type, $id) { if ($_SESSION['WikiApp']==_('WackoWiki')){ - echo '<a target="_blank" href="../' . $_SESSION['WikiPath'] . '/' . $type . $id . '">' . _('Wiki ' . $type . ' Knowlege Base') . '</A><BR>'; + echo '<a target="_blank" href="../' . $_SESSION['WikiPath'] . '/' . $type . $id . '">' . _('Wiki ' . $type . ' Knowlege Base') . '</a><br />'; } elseif ($_SESSION['WikiApp']==_('MediaWiki')){ - echo '<a target="_blank" href="../' . $_SESSION['WikiPath'] . '/index.php/' . $type . '/' . $id . '">' . _('Wiki ' . $type . ' Knowlege Base') . '</A><BR>'; + echo '<a target="_blank" href="../' . $_SESSION['WikiPath'] . '/index.php/' . $type . '/' . $id . '">' . _('Wiki ' . $type . ' Knowlege Base') . '</a><br />'; + } elseif ($_SESSION['WikiApp']==_('DokuWiki')){ + echo ' ../' . $_SESSION['WikiPath'] . '/doku.php?id=' . $type . ':' . $id . ' ' . _('Wiki ' . $type . ' Knowlege Base') . ' <br />'; } }//wikiLink + // Lindsay debug stuff function LogBackTrace( $dest = 0 ) { error_log( "***BEGIN STACK BACKTRACE***", $dest ); This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <dai...@us...> - 2011-08-07 04:37:39
|
Revision: 4652 http://web-erp.svn.sourceforge.net/web-erp/?rev=4652&view=rev Author: daintree Date: 2011-08-07 04:37:32 +0000 (Sun, 07 Aug 2011) Log Message: ----------- M trunk/doc/Change.log M trunk/includes/MiscFunctions.php M trunk/SystemParameters.php M trunk/InventoryQuantities.php M trunk/SalesInquiry.php Modified Paths: -------------- trunk/InventoryQuantities.php trunk/SalesInquiry.php trunk/SystemParameters.php trunk/doc/Change.log trunk/includes/MiscFunctions.php Modified: trunk/InventoryQuantities.php =================================================================== --- trunk/InventoryQuantities.php 2011-08-06 01:53:38 UTC (rev 4651) +++ trunk/InventoryQuantities.php 2011-08-07 04:37:32 UTC (rev 4652) @@ -40,7 +40,7 @@ stockmaster.serialised, stockmaster.controlled FROM locstock INNER JOIN stockmaster - locstock.stockid=stockmaster.stockid + ON locstock.stockid=stockmaster.stockid INNER JOIN locations ON locstock.loccode=locations.loccode WHERE locstock.quantity <> 0 @@ -62,7 +62,7 @@ stockmaster.serialised, stockmaster.controlled FROM locstock INNER JOIN stockmaster - locstock.stockid=stockmaster.stockid + ON locstock.stockid=stockmaster.stockid INNER JOIN locations ON locstock.loccode=locations.loccode WHERE (SELECT count(*) Modified: trunk/SalesInquiry.php =================================================================== --- trunk/SalesInquiry.php 2011-08-06 01:53:38 UTC (rev 4651) +++ trunk/SalesInquiry.php 2011-08-07 04:37:32 UTC (rev 4652) @@ -159,9 +159,9 @@ } // Only used for Invoice Date type where tempstockmoves is the main table - $wheretype = " AND (tempstockmoves.type='10' OR tempstockmoves.type='11')"; + $WhereType = " AND (tempstockmoves.type='10' OR tempstockmoves.type='11')"; if ($_POST['InvoiceType'] != 'All') { - $wheretype = " AND tempstockmoves.type = '" . $_POST['InvoiceType'] . "'"; + $WhereType = " AND tempstockmoves.type = '" . $_POST['InvoiceType'] . "'"; } if ($inputError !=1) { $FromDate = FormatDateForSQL($_POST['FromDate']); @@ -239,7 +239,7 @@ AND tempstockmoves.hidemovt=0 AND salesorders.quotation = '" . $_POST['OrderType'] . "' $WherePart - $wheretype + $WhereType $WhereOrderNo $WhereDebtorNo $WhereDebtorName @@ -498,7 +498,7 @@ AND tempstockmoves.hidemovt=0 AND salesorders.quotation = '" . $_POST['OrderType'] . "' $WherePart - $wheretype + $WhereType $WhereOrderNo $WhereDebtorNo $WhereDebtorName @@ -533,7 +533,7 @@ AND tempstockmoves.hidemovt=0 AND salesorders.quotation = '" . $_POST['OrderType'] . "' $WherePart - $wheretype + $WhereType $WhereOrderNo $WhereDebtorNo $WhereDebtorName @@ -571,7 +571,7 @@ AND tempstockmoves.hidemovt=0 AND salesorders.quotation = '" . $_POST['OrderType'] . "' $WherePart - $wheretype + $WhereType $WhereOrderNo $WhereDebtorNo $WhereDebtorName @@ -605,7 +605,7 @@ AND tempstockmoves.hidemovt=0 AND salesorders.quotation = '" . $_POST['OrderType'] . "' $WherePart - $wheretype + $WhereType $WhereOrderNo $WhereDebtorNo $WhereDebtorName @@ -639,7 +639,7 @@ AND tempstockmoves.hidemovt=0 AND salesorders.quotation = '" . $_POST['OrderType'] . "' $WherePart - $wheretype + $WhereType $WhereOrderNo $WhereDebtorNo $WhereDebtorName @@ -673,7 +673,7 @@ AND tempstockmoves.hidemovt=0 AND salesorders.quotation = '" . $_POST['OrderType'] . "' $WherePart - $wheretype + $WhereType $WhereOrderNo $WhereDebtorNo $WhereDebtorName @@ -707,7 +707,7 @@ AND tempstockmoves.hidemovt=0 AND salesorders.quotation = '" . $_POST['OrderType'] . "' $WherePart - $wheretype + $WhereType $WhereOrderNo $WhereDebtorNo $WhereDebtorName @@ -726,45 +726,45 @@ $result = DB_query($sql,$db,$ErrMsg); $ctr = 0; echo '<pre>'; - $totalqty = 0; - $totalextcost = 0; - $totalextprice = 0; - $totalinvqty = 0; + $TotalQty = 0; + $TotalExtCost = 0; + $TotalExtPrice = 0; + $TotalInvQty = 0; // Create array for summary type to display in header. Access it with $savesummarytype - $summary_array['orderno'] = _('Order Number'); - $summary_array['stkcode'] = _('Part Number'); - $summary_array['extprice'] = _('Extended Price'); - $summary_array['debtorno'] = _('Customer Number'); - $summary_array['name'] = _('Customer Name'); - $summary_array['month'] = _('Month'); - $summary_array['categoryid'] = _('Stock Category'); - $summary_array['salesman'] = _('Salesman'); - $summary_array['area'] = _('Sales Area'); - $summary_array['transno'] = _('Transaction Number'); + $Summary_Array['orderno'] = _('Order Number'); + $Summary_Array['stkcode'] = _('Stock Code'); + $Summary_Array['extprice'] = _('Extended Price'); + $Summary_Array['debtorno'] = _('Customer Number'); + $Summary_Array['name'] = _('Customer Name'); + $Summary_Array['month'] = _('Month'); + $Summary_Array['categoryid'] = _('Stock Category'); + $Summary_Array['salesman'] = _('Salesman'); + $Summary_Array['area'] = _('Sales Area'); + $Summary_Array['transno'] = _('Transaction Number'); // Create array for sort for detail report to display in header - $detail_array['salesorderdetails.orderno'] = _('Order Number'); - $detail_array['salesorderdetails.stkcode'] = _('Part Number'); - $detail_array['debtorsmaster.debtorno,salesorderdetails.orderno'] = _('Customer Number'); - $detail_array['debtorsmaster.name,debtorsmaster.debtorno,salesorderdetails.orderno'] = _('Customer Name'); - $detail_array['tempstockmoves.transno,salesorderdetails.stkcode'] = _('Transaction Number'); + $Detail_Array['salesorderdetails.orderno'] = _('Order Number'); + $Detail_Array['salesorderdetails.stkcode'] = _('Stock Code'); + $Detail_Array['debtorsmaster.debtorno,salesorderdetails.orderno'] = _('Customer Number'); + $Detail_Array['debtorsmaster.name,debtorsmaster.debtorno,salesorderdetails.orderno'] = _('Customer Name'); + $Detail_Array['tempstockmoves.transno,salesorderdetails.stkcode'] = _('Transaction Number'); // Display Header info if ($_POST['ReportType'] == 'Summary') { - $sortby_display = $summary_array[$savesummarytype]; + $SortBy_Display = $Summary_Array[$savesummarytype]; } else { - $sortby_display = $detail_array[$_POST['SortBy']]; + $SortBy_Display = $Detail_Array[$_POST['SortBy']]; } - echo ' ' . _('Sales Inquiry') . ' - ' . $_POST['ReportType'] . " By $sortby_display <br/>"; + echo ' ' . _('Sales Inquiry') . ' - ' . $_POST['ReportType'] . ' ' . _('By') . ' ' . $SortBy_Display . '<br/>'; if ($_POST['OrderType'] == '0') { echo ' ' . _('Order Type - Sales Orders') . '<br/>'; } else { echo ' ' . _('Order Type - Quotations') . '<br/>'; } echo ' ' . _('Date Type') . ' - ' . $_POST['DateType'] . '<br/>'; - echo ' ' . _('Date Range') . ' - ' . $_POST['FromDate'] . _(' To ') . $_POST['ToDate'] . '<br/>'; + echo ' ' . _('Date Range') . ' - ' . $_POST['FromDate'] . ' ' . _('To') . ' ' . $_POST['ToDate'] . '<br/>'; if (mb_strlen(trim($PartNumber)) > 0) { - echo ' ' . _('Part Number') . ' - ' . $_POST['PartNumberOp'] . ' ' . $_POST['PartNumber'] . '<br/>'; + echo ' ' . _('Stock Code') . ' - ' . $_POST['PartNumberOp'] . ' ' . $_POST['PartNumber'] . '<br/>'; } if (mb_strlen(trim($_POST['DebtorNo'])) > 0) { echo ' ' . _('Customer Number') . ' - ' . $_POST['DebtorNoOp'] . ' ' . $_POST['DebtorNo'] . '<br/>'; @@ -790,7 +790,7 @@ if ($_POST['DateType'] == 'Order') { printf('%10s | %-20s | %10s | %-10s | %-30s | %-30s | %12s | %14s | %14s | %14s | %12s | %-10s | %-10s | %-10s | %-40s ', _('Order No'), - _('Part Number'), + _('Stock Code'), _('Order Date'), _('Debtor No'), _('Debtor Name'), @@ -803,13 +803,13 @@ _('Item Due'), _('Salesman'), _('Area'), - _('Part Description')); + _('Item Description')); } else { // Headings for Invoiced Date printf('%10s | %14s | %-20s | %10s | %-10s | %-30s | %-30s | %12s | %14s | %14s | %12s | %-10s | %-10s | %-10s | %-40s ', _('Order No'), _('Trans. No'), - _('Part Number'), + _('Stock Code'), _('Order Date'), _('Debtor No'), _('Debtor Name'), @@ -821,7 +821,7 @@ _('Invoiced'), _('Salesman'), _('Area'), - _('Part Description')); + _('Item Description')); } print '<br/><br/>'; $linectr = 0; @@ -845,7 +845,7 @@ $myrow['area'], $myrow['description']); print '<br/>'; - $totalqty += $myrow['quantity']; + $TotalQty += $myrow['quantity']; } else { // Detail for Invoiced Date printf('%10s | %14s | %-20s | %10s | %-10s | %-30s | %-30s | %12s | %14s | %14s | %12s | %-10s | %-10s | %-10s | %-40s ', @@ -865,12 +865,12 @@ $myrow['area'], $myrow['description']); print '<br/>'; - $totalqty += $myrow['qty']; + $TotalQty += $myrow['qty']; } $lastdecimalplaces = $myrow['decimalplaces']; - $totalextcost += $myrow['extcost']; - $totalextprice += $myrow['extprice']; - $totalinvqty += $myrow['qtyinvoiced']; + $TotalExtCost += $myrow['extcost']; + $TotalExtPrice += $myrow['extprice']; + $TotalInvQty += $myrow['qtyinvoiced']; } //END WHILE LIST LOOP // Print totals if ($_POST['DateType'] == 'Order') { @@ -881,10 +881,10 @@ ' ', ' ', ' ', - number_format($totalqty,2), - number_format($totalextcost,2), - number_format($totalextprice,2), - number_format($totalinvqty,2), + number_format($TotalQty,2), + number_format($TotalExtCost,2), + number_format($TotalExtPrice,2), + number_format($TotalInvQty,2), ' ', ' ', ' '); @@ -898,9 +898,9 @@ ' ', ' ', ' ', - number_format($totalqty,2), - number_format($totalextcost,2), - number_format($totalextprice,2), + number_format($TotalQty,2), + number_format($TotalExtCost,2), + number_format($TotalExtPrice,2), ' ', ' ', ' '); @@ -908,60 +908,60 @@ echo '</pre>'; } else { // Print summary stuff - $summarytype = $_POST['SummaryType']; + $SummaryType = $_POST['SummaryType']; $columnheader7 = ' '; // Set up description based on the Summary Type - if ($summarytype == 'name') { - $summarytype = 'name'; - $description = 'debtorno'; - $summaryheader = _('Customer Name'); - $descriptionheader = _('Customer Number'); + if ($SummaryType == 'name') { + $SummaryType = 'name'; + $Description = 'debtorno'; + $SummaryHeader = _('Customer Name'); + $Descriptionheader = _('Customer Number'); } - if ($summarytype == 'stkcode' || $summarytype == 'extprice') { - $description = 'description'; - $summaryheader = _('Part Number'); - $descriptionheader = _('Part Description'); + if ($SummaryType == 'stkcode' OR $SummaryType == 'extprice') { + $Description = 'description'; + $SummaryHeader = _('Stock Code'); + $Descriptionheader = _('Item Description'); } - if ($summarytype == 'transno') { - $description = 'name'; - $summaryheader = _('Transaction Number'); - $descriptionheader = _('Customer Name'); + if ($SummaryType == 'transno') { + $Description = 'name'; + $SummaryHeader = _('Transaction Number'); + $Descriptionheader = _('Customer Name'); $columnheader7 = _('Order Number'); } - if ($summarytype == 'debtorno') { - $description = 'name'; - $summaryheader = _('Customer Number'); - $descriptionheader = _('Customer Name'); + if ($SummaryType == 'debtorno') { + $Description = 'name'; + $SummaryHeader = _('Customer Number'); + $Descriptionheader = _('Customer Name'); } - if ($summarytype == 'orderno') { - $description = 'debtorno'; - $summaryheader = _('Order Number'); - $descriptionheader = _('Customer Number'); + if ($SummaryType == 'orderno') { + $Description = 'debtorno'; + $SummaryHeader = _('Order Number'); + $Descriptionheader = _('Customer Number'); $columnheader7 = _('Customer Name'); } - if ($summarytype == 'categoryid') { - $description = 'categorydescription'; - $summaryheader = _('Stock Category'); - $descriptionheader = _('Category Description'); + if ($SummaryType == 'categoryid') { + $Description = 'categorydescription'; + $SummaryHeader = _('Stock Category'); + $Descriptionheader = _('Category Description'); } - if ($summarytype == 'salesman') { - $description = 'salesmanname'; - $summaryheader = _('Salesman Code'); - $descriptionheader = _('Salesman Name'); + if ($SummaryType == 'salesman') { + $Description = 'salesmanname'; + $SummaryHeader = _('Salesman Code'); + $Descriptionheader = _('Salesman Name'); } - if ($summarytype == 'area') { - $description = 'areadescription'; - $summaryheader = _('Sales Area'); - $descriptionheader = _('Area Description'); + if ($SummaryType == 'area') { + $Description = 'areadescription'; + $SummaryHeader = _('Sales Area'); + $Descriptionheader = _('Area Description'); } - if ($summarytype == 'month') { - $description = 'monthname'; - $summaryheader = _('Month'); - $descriptionheader = _('Month'); + if ($SummaryType == 'month') { + $Description = 'monthname'; + $SummaryHeader = _('Month'); + $Descriptionheader = _('Month'); } printf(' %-30s | %-40s | %12s | %14s | %14s | %14s | %-15s', - _($summaryheader), - _($descriptionheader), + _($SummaryHeader), + _($Descriptionheader), _('Quantity'), _('Extended Cost'), _('Extended Price'), @@ -973,42 +973,42 @@ $linectr = 0; while ($myrow = DB_fetch_array($result)) { $linectr++; - if ($summarytype == 'orderno') { + if ($SummaryType == 'orderno') { $column7 = $myrow['name']; } - if ($summarytype == 'transno') { + if ($SummaryType == 'transno') { $column7 = $myrow['orderno']; } if ($_POST['DateType'] == 'Order') { // quantity is from salesorderdetails - $displayqty = $myrow['quantity']; + $DisplayQty = $myrow['quantity']; } else { // qty is from stockmoves - $displayqty = $myrow['qty']; + $DisplayQty = $myrow['qty']; } printf(' %-30s | %-40s | %12s | %14s | %14s | %14s | %-40s', - $myrow[$summarytype], - $myrow[$description], - number_format($displayqty,2), + $myrow[$SummaryType], + $myrow[$Description], + number_format($DisplayQty,2), number_format($myrow['extcost'],2), number_format($myrow['extprice'],2), number_format($myrow['qtyinvoiced'],2), $column7); print '<br/>'; - $totalqty += $displayqty; - $totalextcost += $myrow['extcost']; - $totalextprice += $myrow['extprice']; - $totalinvqty += $myrow['qtyinvoiced']; + $TotalQty += $DisplayQty; + $TotalExtCost += $myrow['extcost']; + $TotalExtPrice += $myrow['extprice']; + $TotalInvQty += $myrow['qtyinvoiced']; } //END WHILE LIST LOOP // Print totals printf(' %-30s | %-40s | %12s | %14s | %14s | %14s', _('Totals'), _('Lines - ') . $linectr, - number_format($totalqty,2), - number_format($totalextcost,2), - number_format($totalextprice,2), - number_format($totalinvqty,2), + number_format($TotalQty,2), + number_format($TotalExtCost,2), + number_format($TotalExtPrice,2), + number_format($TotalInvQty,2), ' '); echo '</pre>'; } // End of if ($_POST['ReportType'] @@ -1062,7 +1062,7 @@ <td><input type="text" class="date" alt="' . $_SESSION['DefaultDateFormat'] . '" name="ToDate" size=10 maxlength=10 value="' . $_POST['ToDate'] . '"></td> </tr>'; - echo '<tr><td>' . _('Part Number') . ':</td>'; + echo '<tr><td>' . _('Stock Code') . ':</td>'; echo '<td><select name="PartNumberOp">'; echo '<option selected value="Equals">' . _('Equals') . '</option>'; echo '<option value="LIKE">' . _('Begins With') . '</option>'; @@ -1125,7 +1125,7 @@ echo '<tr><td>' . _('Sort By') . ':</td>'; echo '<td><select name="SortBy">'; echo '<option selected value="salesorderdetails.orderno">' . _('Order Number') . '</option>'; - echo '<option value="salesorderdetails.stkcode">' . _('Part Number') . '</option>'; + echo '<option value="salesorderdetails.stkcode">' . _('Stock Code') . '</option>'; echo '<option value="debtorsmaster.debtorno,salesorderdetails.orderno">' . _('Customer Number') . '</option>'; echo '<option value="debtorsmaster.name,debtorsmaster.debtorno,salesorderdetails.orderno">' . _('Customer Name') . '</option>'; echo '<option value="tempstockmoves.transno,salesorderdetails.stkcode">' . _('Transaction Number') . '</option>'; @@ -1140,7 +1140,7 @@ echo '<td><select name="SummaryType">'; echo '<option selected value="orderno">' . _('Order Number') . '</option>'; echo '<option value="transno">' . _('Transaction Number') . '</option>'; - echo '<option value="stkcode">' . _('Part Number') . '</option>'; + echo '<option value="stkcode">' . _('Stock Code') . '</option>'; echo '<option value="extprice">' . _('Extended Price') . '</option>'; echo '<option value="debtorno">' . _('Customer Number') . '</option>'; echo '<option value="name">' . _('Customer Name') . '</option>'; Modified: trunk/SystemParameters.php =================================================================== --- trunk/SystemParameters.php 2011-08-06 01:53:38 UTC (rev 4651) +++ trunk/SystemParameters.php 2011-08-07 04:37:32 UTC (rev 4652) @@ -807,8 +807,9 @@ </tr>'; $WikiApplications = array( _('Disabled'), - _('WackoWiki'), - _('MediaWiki') ); + _('WackoWiki'), + _('MediaWiki'), + _('DokuWiki') ); echo '<tr style="outline: 1px solid"><td>' . _('Wiki application') . ':</td> <td><select name="X_WikiApp">'; Modified: trunk/doc/Change.log =================================================================== --- trunk/doc/Change.log 2011-08-06 01:53:38 UTC (rev 4651) +++ trunk/doc/Change.log 2011-08-07 04:37:32 UTC (rev 4652) @@ -1,5 +1,8 @@ webERP Change Log +7/8/11 Ricard: Corrected INNER JOIN ON clause in sql used in InventoryQuantities.php script +7/8/11 Klaus: Added docuwiki links to WikiLinks function in MiscFunctions.php and allow Docuwiki option in SystemParameters.php +6/8/11 Ricard: SalesInquiry.php fix wording of labels to be more consistent with the rest of webERP 6/8/11 Phil: PO_Items.php now has checkbox to select items that have purchasing data entered for the supplier ordering from - as per Klaus's (opto) suggestion 6/8/11 Exson: Added leadtime to the link from SelectProduct.php so that delivery dates used when creating purchase orders make sense 4/8/11 Phil: Fix GP Percent reported when discounts updated by discount matrix Modified: trunk/includes/MiscFunctions.php =================================================================== --- trunk/includes/MiscFunctions.php 2011-08-06 01:53:38 UTC (rev 4651) +++ trunk/includes/MiscFunctions.php 2011-08-07 04:37:32 UTC (rev 4652) @@ -228,14 +228,17 @@ function wikiLink($type, $id) { if ($_SESSION['WikiApp']==_('WackoWiki')){ - echo '<a target="_blank" href="../' . $_SESSION['WikiPath'] . '/' . $type . $id . '">' . _('Wiki ' . $type . ' Knowlege Base') . '</A><BR>'; + echo '<a target="_blank" href="../' . $_SESSION['WikiPath'] . '/' . $type . $id . '">' . _('Wiki ' . $type . ' Knowlege Base') . '</a><br />'; } elseif ($_SESSION['WikiApp']==_('MediaWiki')){ - echo '<a target="_blank" href="../' . $_SESSION['WikiPath'] . '/index.php/' . $type . '/' . $id . '">' . _('Wiki ' . $type . ' Knowlege Base') . '</A><BR>'; + echo '<a target="_blank" href="../' . $_SESSION['WikiPath'] . '/index.php/' . $type . '/' . $id . '">' . _('Wiki ' . $type . ' Knowlege Base') . '</a><br />'; + } elseif ($_SESSION['WikiApp']==_('DokuWiki')){ + echo ' ../' . $_SESSION['WikiPath'] . '/doku.php?id=' . $type . ':' . $id . ' ' . _('Wiki ' . $type . ' Knowlege Base') . ' <br />'; } }//wikiLink + // Lindsay debug stuff function LogBackTrace( $dest = 0 ) { error_log( "***BEGIN STACK BACKTRACE***", $dest ); This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <dai...@us...> - 2011-08-07 10:17:58
|
Revision: 4653 http://web-erp.svn.sourceforge.net/web-erp/?rev=4653&view=rev Author: daintree Date: 2011-08-07 10:17:52 +0000 (Sun, 07 Aug 2011) Log Message: ----------- now disables transactions on items flagged as obsolete (discontinued) Modified Paths: -------------- trunk/SelectProduct.php trunk/doc/Change.log Modified: trunk/SelectProduct.php =================================================================== --- trunk/SelectProduct.php 2011-08-07 04:37:32 UTC (rev 4652) +++ trunk/SelectProduct.php 2011-08-07 10:17:52 UTC (rev 4653) @@ -70,7 +70,12 @@ $Its_A_Dummy = false; $Its_A_Kitset = false; $Its_A_Labour_Item = false; - echo '<table width="90%"><tr><th colspan="3"><img src="' . $rootpath . '/css/' . $theme . '/images/inventory.png" title="' . _('Inventory') . '" alt="" /><b>' . ' ' . $StockID . ' - ' . $myrow['description'] . '</b></th></tr>'; + if ($myrow['discontinued']==1){ + $ItemStatus = '<font class="bad">' ._('Obsolete') . '</font>'; + } else { + $ItemStatus = ''; + } + echo '<table width="90%"><tr><th colspan="3"><img src="' . $rootpath . '/css/' . $theme . '/images/inventory.png" title="' . _('Inventory') . '" alt="" /><b>' . ' ' . $StockID . ' - ' . $myrow['description'] . ' ' . $ItemStatus . '</b></th></tr>'; echo '<tr><td width="40%" valign="top"> <table align="left">'; //nested table @@ -412,14 +417,16 @@ wikiLink('Product', $StockID); echo '</td><td valign="top" class="select">'; /* Stock Transactions */ -if ($Its_A_Kitset_Assembly_Or_Dummy == False) { +if ($Its_A_Kitset_Assembly_Or_Dummy == false AND $myrow['discontinued']==0) { echo '<a href="' . $rootpath . '/StockAdjustments.php?StockID=' . $StockID . '">' . _('Quantity Adjustments') . '</a><br />'; echo '<a href="' . $rootpath . '/StockTransfers.php?StockID=' . $StockID . '">' . _('Location Transfers') . '</a><br />'; //show the item image if it has been uploaded if( isset($StockID) and file_exists($_SESSION['part_pics_dir'] . '/' .$StockID.'.jpg') ) { echo '<div class="centre"><img src="GetStockImage.php?automake=1&textcolor=FFFFFF&bgcolor=CCCCCC&StockID=' . $StockID . '&text=&width=120&height=120">'; } - if (($myrow['mbflag'] == 'B') AND (in_array($SuppliersSecurity, $_SESSION['AllowedPageSecurityTokens']))){ + if (($myrow['mbflag'] == 'B') + AND (in_array($SuppliersSecurity, $_SESSION['AllowedPageSecurityTokens'])) + AND $myrow['discontinued']==0){ echo '<br />'; $SuppResult = DB_query("SELECT suppliers.suppname, suppliers.supplierid, @@ -542,6 +549,7 @@ SUM(locstock.quantity) AS qoh, stockmaster.units, stockmaster.mbflag, + stockmaster.discontinued, stockmaster.decimalplaces FROM stockmaster LEFT JOIN stockcategory @@ -553,6 +561,7 @@ stockmaster.description, stockmaster.units, stockmaster.mbflag, + stockmaster.discontinued, stockmaster.decimalplaces ORDER BY stockmaster.stockid"; } else { @@ -561,6 +570,7 @@ SUM(locstock.quantity) AS qoh, stockmaster.units, stockmaster.mbflag, + stockmaster.discontinued, stockmaster.decimalplaces FROM stockmaster, locstock @@ -571,6 +581,7 @@ stockmaster.description, stockmaster.units, stockmaster.mbflag, + stockmaster.discontinued, stockmaster.decimalplaces ORDER BY stockmaster.stockid"; } @@ -580,6 +591,7 @@ $SQL = "SELECT stockmaster.stockid, stockmaster.description, stockmaster.mbflag, + stockmaster.discontinued, SUM(locstock.quantity) AS qoh, stockmaster.units, stockmaster.decimalplaces @@ -593,12 +605,14 @@ stockmaster.description, stockmaster.units, stockmaster.mbflag, + stockmaster.discontinued, stockmaster.decimalplaces ORDER BY stockmaster.stockid"; } else { $SQL = "SELECT stockmaster.stockid, stockmaster.description, stockmaster.mbflag, + stockmaster.discontinued, sum(locstock.quantity) as qoh, stockmaster.units, stockmaster.decimalplaces @@ -611,6 +625,7 @@ stockmaster.description, stockmaster.units, stockmaster.mbflag, + stockmaster.discontinued, stockmaster.decimalplaces ORDER BY stockmaster.stockid"; } @@ -619,6 +634,7 @@ $SQL = "SELECT stockmaster.stockid, stockmaster.description, stockmaster.mbflag, + stockmaster.discontinued, SUM(locstock.quantity) AS qoh, stockmaster.units, stockmaster.decimalplaces @@ -631,12 +647,14 @@ stockmaster.description, stockmaster.units, stockmaster.mbflag, + stockmaster.discontinued, stockmaster.decimalplaces ORDER BY stockmaster.stockid"; } else { $SQL = "SELECT stockmaster.stockid, stockmaster.description, stockmaster.mbflag, + stockmaster.discontinued, SUM(locstock.quantity) AS qoh, stockmaster.units, stockmaster.decimalplaces @@ -648,6 +666,7 @@ stockmaster.description, stockmaster.units, stockmaster.mbflag, + stockmaster.discontinued, stockmaster.decimalplaces ORDER BY stockmaster.stockid"; } @@ -732,11 +751,18 @@ } else { $qoh = number_format($myrow['qoh'], $myrow['decimalplaces']); } + if ($myrow['discontinued']==1){ + $ItemStatus = '<font class="bad">' . _('Obsolete') . '</font>'; + } else { + $ItemStatus =''; + } + echo '<td><input type="submit" name="Select" value="' . $myrow['stockid'] . '" /></td> <td>'.$myrow['description'].'</td> <td class="number">' . $qoh . '</td> <td>' . $myrow['units'] . '</td> <td><a target="_blank" href="' . $rootpath . '/StockStatus.php?StockID=' . $myrow['stockid'].'">' . _('View') . '</a></td> + <td>' . $ItemStatus . '</td> </tr>'; $j++; if ($j == 20 AND ($RowIndex + 1 != $_SESSION['DisplayRecordsMax'])) { Modified: trunk/doc/Change.log =================================================================== --- trunk/doc/Change.log 2011-08-07 04:37:32 UTC (rev 4652) +++ trunk/doc/Change.log 2011-08-07 10:17:52 UTC (rev 4653) @@ -1,5 +1,6 @@ webERP Change Log +7/8/11 Phil: SelectProduct.php now disables transactions on items flagged as obsolete (discontinued). Also obsolete items are shown as such in the selection list - suggested by Klaus (opto) 7/8/11 Ricard: Corrected INNER JOIN ON clause in sql used in InventoryQuantities.php script 7/8/11 Klaus: Added docuwiki links to WikiLinks function in MiscFunctions.php and allow Docuwiki option in SystemParameters.php 6/8/11 Ricard: SalesInquiry.php fix wording of labels to be more consistent with the rest of webERP This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <dai...@us...> - 2011-08-07 10:17:58
|
Revision: 4653 http://web-erp.svn.sourceforge.net/web-erp/?rev=4653&view=rev Author: daintree Date: 2011-08-07 10:17:52 +0000 (Sun, 07 Aug 2011) Log Message: ----------- now disables transactions on items flagged as obsolete (discontinued) Modified Paths: -------------- trunk/SelectProduct.php trunk/doc/Change.log Modified: trunk/SelectProduct.php =================================================================== --- trunk/SelectProduct.php 2011-08-07 04:37:32 UTC (rev 4652) +++ trunk/SelectProduct.php 2011-08-07 10:17:52 UTC (rev 4653) @@ -70,7 +70,12 @@ $Its_A_Dummy = false; $Its_A_Kitset = false; $Its_A_Labour_Item = false; - echo '<table width="90%"><tr><th colspan="3"><img src="' . $rootpath . '/css/' . $theme . '/images/inventory.png" title="' . _('Inventory') . '" alt="" /><b>' . ' ' . $StockID . ' - ' . $myrow['description'] . '</b></th></tr>'; + if ($myrow['discontinued']==1){ + $ItemStatus = '<font class="bad">' ._('Obsolete') . '</font>'; + } else { + $ItemStatus = ''; + } + echo '<table width="90%"><tr><th colspan="3"><img src="' . $rootpath . '/css/' . $theme . '/images/inventory.png" title="' . _('Inventory') . '" alt="" /><b>' . ' ' . $StockID . ' - ' . $myrow['description'] . ' ' . $ItemStatus . '</b></th></tr>'; echo '<tr><td width="40%" valign="top"> <table align="left">'; //nested table @@ -412,14 +417,16 @@ wikiLink('Product', $StockID); echo '</td><td valign="top" class="select">'; /* Stock Transactions */ -if ($Its_A_Kitset_Assembly_Or_Dummy == False) { +if ($Its_A_Kitset_Assembly_Or_Dummy == false AND $myrow['discontinued']==0) { echo '<a href="' . $rootpath . '/StockAdjustments.php?StockID=' . $StockID . '">' . _('Quantity Adjustments') . '</a><br />'; echo '<a href="' . $rootpath . '/StockTransfers.php?StockID=' . $StockID . '">' . _('Location Transfers') . '</a><br />'; //show the item image if it has been uploaded if( isset($StockID) and file_exists($_SESSION['part_pics_dir'] . '/' .$StockID.'.jpg') ) { echo '<div class="centre"><img src="GetStockImage.php?automake=1&textcolor=FFFFFF&bgcolor=CCCCCC&StockID=' . $StockID . '&text=&width=120&height=120">'; } - if (($myrow['mbflag'] == 'B') AND (in_array($SuppliersSecurity, $_SESSION['AllowedPageSecurityTokens']))){ + if (($myrow['mbflag'] == 'B') + AND (in_array($SuppliersSecurity, $_SESSION['AllowedPageSecurityTokens'])) + AND $myrow['discontinued']==0){ echo '<br />'; $SuppResult = DB_query("SELECT suppliers.suppname, suppliers.supplierid, @@ -542,6 +549,7 @@ SUM(locstock.quantity) AS qoh, stockmaster.units, stockmaster.mbflag, + stockmaster.discontinued, stockmaster.decimalplaces FROM stockmaster LEFT JOIN stockcategory @@ -553,6 +561,7 @@ stockmaster.description, stockmaster.units, stockmaster.mbflag, + stockmaster.discontinued, stockmaster.decimalplaces ORDER BY stockmaster.stockid"; } else { @@ -561,6 +570,7 @@ SUM(locstock.quantity) AS qoh, stockmaster.units, stockmaster.mbflag, + stockmaster.discontinued, stockmaster.decimalplaces FROM stockmaster, locstock @@ -571,6 +581,7 @@ stockmaster.description, stockmaster.units, stockmaster.mbflag, + stockmaster.discontinued, stockmaster.decimalplaces ORDER BY stockmaster.stockid"; } @@ -580,6 +591,7 @@ $SQL = "SELECT stockmaster.stockid, stockmaster.description, stockmaster.mbflag, + stockmaster.discontinued, SUM(locstock.quantity) AS qoh, stockmaster.units, stockmaster.decimalplaces @@ -593,12 +605,14 @@ stockmaster.description, stockmaster.units, stockmaster.mbflag, + stockmaster.discontinued, stockmaster.decimalplaces ORDER BY stockmaster.stockid"; } else { $SQL = "SELECT stockmaster.stockid, stockmaster.description, stockmaster.mbflag, + stockmaster.discontinued, sum(locstock.quantity) as qoh, stockmaster.units, stockmaster.decimalplaces @@ -611,6 +625,7 @@ stockmaster.description, stockmaster.units, stockmaster.mbflag, + stockmaster.discontinued, stockmaster.decimalplaces ORDER BY stockmaster.stockid"; } @@ -619,6 +634,7 @@ $SQL = "SELECT stockmaster.stockid, stockmaster.description, stockmaster.mbflag, + stockmaster.discontinued, SUM(locstock.quantity) AS qoh, stockmaster.units, stockmaster.decimalplaces @@ -631,12 +647,14 @@ stockmaster.description, stockmaster.units, stockmaster.mbflag, + stockmaster.discontinued, stockmaster.decimalplaces ORDER BY stockmaster.stockid"; } else { $SQL = "SELECT stockmaster.stockid, stockmaster.description, stockmaster.mbflag, + stockmaster.discontinued, SUM(locstock.quantity) AS qoh, stockmaster.units, stockmaster.decimalplaces @@ -648,6 +666,7 @@ stockmaster.description, stockmaster.units, stockmaster.mbflag, + stockmaster.discontinued, stockmaster.decimalplaces ORDER BY stockmaster.stockid"; } @@ -732,11 +751,18 @@ } else { $qoh = number_format($myrow['qoh'], $myrow['decimalplaces']); } + if ($myrow['discontinued']==1){ + $ItemStatus = '<font class="bad">' . _('Obsolete') . '</font>'; + } else { + $ItemStatus =''; + } + echo '<td><input type="submit" name="Select" value="' . $myrow['stockid'] . '" /></td> <td>'.$myrow['description'].'</td> <td class="number">' . $qoh . '</td> <td>' . $myrow['units'] . '</td> <td><a target="_blank" href="' . $rootpath . '/StockStatus.php?StockID=' . $myrow['stockid'].'">' . _('View') . '</a></td> + <td>' . $ItemStatus . '</td> </tr>'; $j++; if ($j == 20 AND ($RowIndex + 1 != $_SESSION['DisplayRecordsMax'])) { Modified: trunk/doc/Change.log =================================================================== --- trunk/doc/Change.log 2011-08-07 04:37:32 UTC (rev 4652) +++ trunk/doc/Change.log 2011-08-07 10:17:52 UTC (rev 4653) @@ -1,5 +1,6 @@ webERP Change Log +7/8/11 Phil: SelectProduct.php now disables transactions on items flagged as obsolete (discontinued). Also obsolete items are shown as such in the selection list - suggested by Klaus (opto) 7/8/11 Ricard: Corrected INNER JOIN ON clause in sql used in InventoryQuantities.php script 7/8/11 Klaus: Added docuwiki links to WikiLinks function in MiscFunctions.php and allow Docuwiki option in SystemParameters.php 6/8/11 Ricard: SalesInquiry.php fix wording of labels to be more consistent with the rest of webERP This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <dai...@us...> - 2011-08-10 10:21:32
|
Revision: 4655 http://web-erp.svn.sourceforge.net/web-erp/?rev=4655&view=rev Author: daintree Date: 2011-08-10 10:21:25 +0000 (Wed, 10 Aug 2011) Log Message: ----------- POReport.php added link to detail purchase order inquiry 10/8/11 Phil: PO_SelectPurchOrder.php and outstanding purchase order searches now show the delivery date (from the purchase order header) line items may have different delivery dates. 10/8/11 Phil: Stocks.php changing the stock category to one with a different stock account now creates a journal (if stock is linked to GL) to move the cost of the stock from the old GL account to the new GL account Modified Paths: -------------- trunk/POReport.php trunk/PO_SelectOSPurchOrder.php trunk/PO_SelectPurchOrder.php trunk/Stocks.php trunk/doc/Change.log trunk/includes/DateFunctions.inc Modified: trunk/POReport.php =================================================================== --- trunk/POReport.php 2011-08-08 10:32:39 UTC (rev 4654) +++ trunk/POReport.php 2011-08-10 10:21:25 UTC (rev 4655) @@ -72,9 +72,9 @@ //####_SUBMIT_SUBMIT_SUBMIT_SUBMIT_SUBMIT_SUBMIT_SUBMIT_SUBMIT_SUBMIT_SUBMIT_SUBMIT_SUBMIT#### -function submit(&$db,$PartNumber,$PartNumberOp,$SupplierId,$SupplierIdOp,$SupplierName,$SupplierNameOp,$SaveSummaryType) -{ +function submit(&$db,$PartNumber,$PartNumberOp,$SupplierId,$SupplierIdOp,$SupplierName,$SupplierNameOp,$SaveSummaryType) { + global $rootpath; //initialize no input errors $InputError = 0; @@ -502,7 +502,7 @@ $Detail_Array['suppliers.suppname,suppliers.supplierid,purchorderdetails.orderno'] = _('Supplier Name'); // Display Header info - echo '<table class=selection>'; + echo '<table class="selection">'; if ($_POST['ReportType'] == 'Summary') { $SortBy_Display = $Summary_Array[$SaveSummaryType]; } else { @@ -533,7 +533,7 @@ <td>' . $_POST['Category'] . '</td></tr></table>'; if ($_POST['ReportType'] == 'Detail') { - echo '<br /><table class=selection width=98%>'; + echo '<br /><table class="selection" width=98%>'; if ($_POST['DateType'] == 'Order') { echo '<tr><th>' . _('Order No') . '</th> <th>' . _('Part Number') . '</th> @@ -561,7 +561,7 @@ } $linectr++; // Detail for both DateType of Order - printf('<td>%s</td> + printf('<td><a href="'. $rootpath . '/PO_OrderDetails.php?OrderNo=%s">%s</a></td> <td>%s</td> <td>%s</td> <td>%s</td> @@ -575,6 +575,7 @@ <td>%s</td> </tr>', $myrow['orderno'], + $myrow['orderno'], $myrow['itemcode'], ConvertSQLDate($myrow['orddate']), $myrow['supplierno'], Modified: trunk/PO_SelectOSPurchOrder.php =================================================================== --- trunk/PO_SelectOSPurchOrder.php 2011-08-08 10:32:39 UTC (rev 4654) +++ trunk/PO_SelectOSPurchOrder.php 2011-08-10 10:21:25 UTC (rev 4655) @@ -282,6 +282,7 @@ $SQL = "SELECT purchorders.orderno, suppliers.suppname, purchorders.orddate, + purchorders.deliverydate, purchorders.initiator, purchorders.status, purchorders.requisitionno, @@ -317,6 +318,7 @@ purchorders.orderno, suppliers.suppname, purchorders.orddate, + purchorders.deliverydate, purchorders.status, purchorders.initiator, purchorders.requisitionno, @@ -346,6 +348,7 @@ purchorders.orderno, suppliers.suppname, purchorders.orddate, + purchorders.deliverydate, purchorders.status, purchorders.initiator, purchorders.requisitionno, @@ -377,6 +380,7 @@ purchorders.orderno, suppliers.suppname, purchorders.orddate, + purchorders.deliverydate, purchorders.status, purchorders.initiator, purchorders.requisitionno, @@ -405,6 +409,7 @@ purchorders.orderno, suppliers.suppname, purchorders.orddate, + purchorders.deliverydate, purchorders.status, purchorders.initiator, purchorders.requisitionno, @@ -437,13 +442,13 @@ /*show a table of the orders returned by the SQL */ - echo '<table cellpadding=2 colspan=7 width=97% class=selection>'; + echo '<table cellpadding="2" colspan="7 width="97%" class="selection">'; -// '</td><td class="tableheader">' . _('Receive') . echo '<tr> <th>' . _('Order #') . '</th> <th>' . _('Order Date') . '</th> + <th>' . _('Delivery Date') . '</th> <th>' . _('Initiated by') . '</th> <th>' . _('Supplier') . '</th> <th>' . _('Currency') . '</th>'; @@ -469,8 +474,7 @@ $ModifyPage = $rootpath . '/PO_Header.php?ModifyOrderNumber=' . $myrow['orderno']; if ($myrow['status'] == 'Printed') { - $ReceiveOrder = '<a href="'.$rootpath . '/GoodsReceived.php?PONumber=' . $myrow['orderno'].'">'. - _('Receive').'</a>'; + $ReceiveOrder = '<a href="'.$rootpath . '/GoodsReceived.php?PONumber=' . $myrow['orderno'].'">'. _('Receive') . '</a>'; } else { $ReceiveOrder = ''; } @@ -487,15 +491,17 @@ $FormatedOrderDate = ConvertSQLDate($myrow['orddate']); + $FormatedDeliveryDate = ConvertSQLDate($myrow['deliverydate']); $FormatedOrderValue = number_format($myrow['ordervalue'],2); echo '<td><a href="'.$ModifyPage.'">' . $myrow['orderno'] . '</a></td> <td>' . $FormatedOrderDate . '</td> + <td>' . $FormatedDeliveryDate . '</td> <td>' . $myrow['initiator'] . '</td> <td>' . $myrow['suppname'] . '</td> <td>' . $myrow['currcode'] . '</td>'; if (in_array($PricesSecurity, $_SESSION['AllowedPageSecurityTokens']) OR !isset($PricesSecurity)) { - echo '<td class=number>'.$FormatedOrderValue . '</td>'; + echo '<td class="number">'.$FormatedOrderValue . '</td>'; } echo '<td>' . _($myrow['status']) . '</td> <td>' . $PrintPurchOrder . '</td> Modified: trunk/PO_SelectPurchOrder.php =================================================================== --- trunk/PO_SelectPurchOrder.php 2011-08-08 10:32:39 UTC (rev 4654) +++ trunk/PO_SelectPurchOrder.php 2011-08-10 10:21:25 UTC (rev 4655) @@ -193,8 +193,8 @@ } echo '<td><input type="submit" name="SelectedStockItem" value="' . $myrow['stockid'] . '"</td> <td>' . $myrow['description'] . '</td> - <td class=number>' . $myrow['qoh'] . '</td> - <td class=number>' . $myrow['qord'] . '</td> + <td class="number">' . $myrow['qoh'] . '</td> + <td class="number">' . $myrow['qord'] . '</td> <td>' . $myrow['units'] . '</td> </tr>'; $j++; @@ -229,6 +229,7 @@ $SQL = "SELECT purchorders.orderno, suppliers.suppname, purchorders.orddate, + purchorders.deliverydate, purchorders.initiator, purchorders.requisitionno, purchorders.allowprint, @@ -263,6 +264,7 @@ $SQL = "SELECT purchorders.orderno, suppliers.suppname, purchorders.orddate, + purchorders.deliverydate, purchorders.initiator, purchorders.requisitionno, purchorders.allowprint, @@ -293,6 +295,7 @@ $SQL = "SELECT purchorders.orderno, suppliers.suppname, purchorders.orddate, + purchorders.deliverydate, purchorders.initiator, purchorders.requisitionno, purchorders.allowprint, @@ -324,6 +327,7 @@ $SQL = "SELECT purchorders.orderno, suppliers.suppname, purchorders.orddate, + purchorders.deliverydate, purchorders.initiator, purchorders.requisitionno, purchorders.allowprint, @@ -353,6 +357,7 @@ $SQL = "SELECT purchorders.orderno, suppliers.suppname, purchorders.orddate, + purchorders.deliverydate, purchorders.initiator, purchorders.requisitionno, purchorders.allowprint, @@ -386,13 +391,14 @@ if (DB_num_rows($PurchOrdersResult) > 0) { /*show a table of the orders returned by the SQL */ - echo '<table cellpadding=2 colspan=7 width=90% class=selection>'; + echo '<table cellpadding="2" colspan="7" width="90%" class="selection">'; $TableHeader = '<tr> <th>' . _('View') . '</th> <th>' . _('Supplier') . '</th> <th>' . _('Currency') . '</th> <th>' . _('Requisition') . '</th> <th>' . _('Order Date') . '</th> + <th>' . _('Delivery Date') . '</th> <th>' . _('Initiator') . '</th> <th>' . _('Order Total') . '</th> <th>' . _('Status') . '</th> @@ -410,6 +416,7 @@ } $ViewPurchOrder = $rootpath . '/PO_OrderDetails.php?OrderNo=' . $myrow['orderno']; $FormatedOrderDate = ConvertSQLDate($myrow['orddate']); + $FormatedDeliveryDate = ConvertSQLDate($myrow['deliverydate']); $FormatedOrderValue = number_format($myrow['ordervalue'], $myrow['decimalplaces']); /* View Supplier Currency Requisition Order Date Initiator Order Total ModifyPage, $myrow["orderno"], $myrow["suppname"], $myrow["currcode"], $myrow["requisitionno"] $FormatedOrderDate, $myrow["initiator"] $FormatedOrderValue Order Status*/ @@ -418,8 +425,9 @@ <td>' . $myrow['currcode'] . '</td> <td>' . $myrow['requisitionno'] . '</td> <td>' . $FormatedOrderDate . '</td> + <td>' . $FormatedDeliveryDate . '</td> <td>' . $myrow['initiator'] . '</td> - <td class=number>' . $FormatedOrderValue . '</td> + <td class="number">' . $FormatedOrderValue . '</td> <td>' . _($myrow['status']) . '</td> </tr>'; //$myrow['status'] is a string which has gettext translations from PO_Header.php script Modified: trunk/Stocks.php =================================================================== --- trunk/Stocks.php 2011-08-08 10:32:39 UTC (rev 4654) +++ trunk/Stocks.php 2011-08-10 10:21:25 UTC (rev 4655) @@ -211,27 +211,43 @@ */ $sql = "SELECT mbflag, controlled, - serialised - FROM stockmaster WHERE stockid = '".$StockID."'"; + serialised, + materialcost+labourcost+overheadcost AS itemcost, + stockcategory.stockact + FROM stockmaster + INNER JOIN stockcategory + ON stockmaster.categoryid=stockcategory.categoryid + WHERE stockid = '".$StockID."'"; $MBFlagResult = DB_query($sql,$db); $myrow = DB_fetch_row($MBFlagResult); $OldMBFlag = $myrow[0]; $OldControlled = $myrow[1]; $OldSerialised = $myrow[2]; + $UnitCost = $myrow[3]; + $OldStockAccount = $myrow[4]; $sql = "SELECT SUM(locstock.quantity) FROM locstock WHERE stockid='".$StockID."' GROUP BY stockid"; $result = DB_query($sql,$db); - $stkqtychk = DB_fetch_row($result); + $StockQtyRow = DB_fetch_row($result); + /*Now check the GL account of the new category to see if it is different to the old stock gl account */ + + $result = DB_query("SELECT stockact + FROM stockcategory + WHERE categoryid='" . $_POST['CategoryID'] . "'", + $db); + $NewStockActRow = DB_fetch_array($result); + $NewStockAct = $NewStockActRow['stockact']; + if ($OldMBFlag != $_POST['MBFlag']){ if (($OldMBFlag == 'M' OR $OldMBFlag=='B') AND ($_POST['MBFlag']=='A' OR $_POST['MBFlag']=='K' OR $_POST['MBFlag']=='D' OR $_POST['MBFlag']=='G')){ /*then need to check that there is no stock holding first */ /* stock holding OK for phantom (ghost) items */ - if ($stkqtychk[0]!=0 AND $OldMBFlag!='G'){ + if ($StockQtyRow[0]!=0 AND $OldMBFlag!='G'){ $InputError=1; - prnMsg( _('The make or buy flag cannot be changed from') . ' ' . $OldMBFlag . ' ' . _('to') . ' ' . $_POST['MBFlag'] . ' ' . _('where there is a quantity of stock on hand at any location') . '. ' . _('Currently there are') . ' ' . $stkqtychk[0] . ' ' . _('on hand') , 'errror'); + prnMsg( _('The make or buy flag cannot be changed from') . ' ' . $OldMBFlag . ' ' . _('to') . ' ' . $_POST['MBFlag'] . ' ' . _('where there is a quantity of stock on hand at any location') . '. ' . _('Currently there are') . ' ' . $StockQtyRow[0] . ' ' . _('on hand') , 'errror'); } /* don't allow controlled/serialized */ if ($_POST['Controlled']==1){ @@ -296,18 +312,21 @@ } /* Do some checks for changes in the Serial & Controlled setups */ - if ($OldControlled != $_POST['Controlled'] AND $stkqtychk[0]!=0){ + if ($OldControlled != $_POST['Controlled'] AND $StockQtyRow[0]!=0){ $InputError=1; prnMsg( _('You can not change a Non-Controlled Item to Controlled (or back from Controlled to non-controlled when there is currently stock on hand for the item') , 'error'); } - if ($OldSerialised != $_POST['Serialised'] AND $stkqtychk[0]!=0){ + if ($OldSerialised != $_POST['Serialised'] AND $StockQtyRow[0]!=0){ $InputError=1; prnMsg( _('You can not change a Serialised Item to Non-Serialised (or vice-versa) when there is a quantity on hand for the item') , 'error'); } if ($InputError == 0){ + + DB_Txn_Begin($db); + $sql = "UPDATE stockmaster SET longdescription='" . $_POST['LongDescription'] . "', description='" . $_POST['Description'] . "', @@ -333,12 +352,12 @@ $ErrMsg = _('The stock item could not be updated because'); $DbgMsg = _('The SQL that was used to update the stock item and failed was'); - $result = DB_query($sql,$db,$ErrMsg,$DbgMsg); + $result = DB_query($sql,$db,$ErrMsg,$DbgMsg,true); //delete any properties for the item no longer relevant with the change of category $result = DB_query("DELETE FROM stockitemproperties WHERE stockid ='" . $StockID . "'", - $db); + $db,$ErrMsg,$DbgMsg,true); //now insert any item properties for ($i=0;$i<$_POST['PropertyCounter'];$i++){ @@ -356,8 +375,47 @@ VALUES ('" . $StockID . "', '" . $_POST['PropID' . $i] . "', '" . $_POST['PropValue' . $i] . "')", - $db); + $db,$ErrMsg,$DbgMsg,true); } //end of loop around properties defined for the category + + if ($OldStockAccount != $NewStockAct AND $_SESSION['CompanyRecord']['gllinkstock']==1) { + /*Then we need to make a journal to transfer the cost to the new stock account */ + $JournalNo = GetNextTransNo(0,$db); //enter as a journal + $SQL = "INSERT INTO gltrans (type, + typeno, + trandate, + periodno, + account, + narrative, + amount) + VALUES ( 0, + '" . $JournalNo . "', + '" . Date('Y-m-d') . "', + '" . GetPeriodNo(Date('Y-m-d'),true) . "', + '" . $NewStockAccount . "', + '" . $StockID . ' ' . _('Change stock category') . "', + '" . ($UnitCost* $StockQtyRow[0]) . "'"; + $ErrMsg = _('The stock cost journal could not be inserted because'); + $DbgMsg = _('The SQL that was used to create the stock cost journal and failed was'); + $result = DB_query($sql,$db, $ErrMsg, $DbgMsg,true); + $SQL = "INSERT INTO gltrans (type, + typeno, + trandate, + periodno, + account, + narrative, + amount) + VALUES ( 0, + '" . $JournalNo . "', + '" . Date('Y-m-d') . "', + '" . GetPeriodNo(Date('Y-m-d'),true) . "', + '" . $OldStockAccount . "', + '" . $StockID . ' ' . _('Change stock category') . "', + '" . (-$UnitCost* $StockQtyRow[0]) . "'"; + $result = DB_query($sql,$db, $ErrMsg, $DbgMsg,true); + + } /* end if the stock category changed and forced a change in stock cost account */ + DB_Txn_Commit($db); prnMsg( _('Stock Item') . ' ' . $StockID . ' ' . _('has been updated'), 'success'); echo '<br />'; } Modified: trunk/doc/Change.log =================================================================== --- trunk/doc/Change.log 2011-08-08 10:32:39 UTC (rev 4654) +++ trunk/doc/Change.log 2011-08-10 10:21:25 UTC (rev 4655) @@ -1,5 +1,8 @@ webERP Change Log +10/8/11 Phil: POReport.php added link to detail purchase order inquiry +10/8/11 Phil: PO_SelectPurchOrder.php and outstanding purchase order searches now show the delivery date (from the purchase order header) line items may have different delivery dates. +10/8/11 Phil: Stocks.php changing the stock category to one with a different stock account now creates a journal (if stock is linked to GL) to move the cost of the stock from the old GL account to the new GL account 7/8/11 Phil: SelectProduct.php now disables transactions on items flagged as obsolete (discontinued). Also obsolete items are shown as such in the selection list - suggested by Klaus (opto) 7/8/11 Ricard: Corrected INNER JOIN ON clause in sql used in InventoryQuantities.php script 7/8/11 Klaus: Added docuwiki links to WikiLinks function in MiscFunctions.php and allow Docuwiki option in SystemParameters.php Modified: trunk/includes/DateFunctions.inc =================================================================== --- trunk/includes/DateFunctions.inc 2011-08-08 10:32:39 UTC (rev 4654) +++ trunk/includes/DateFunctions.inc 2011-08-10 10:21:25 UTC (rev 4655) @@ -875,7 +875,7 @@ } } /* Find the unix timestamp of the last period end date in periods table */ - $sql = 'SELECT MAX(lastdate_in_period), MAX(periodno) from periods'; + $sql = "SELECT MAX(lastdate_in_period), MAX(periodno) from periods"; $result = DB_query($sql, $db); $myrow=DB_fetch_row($result); if (is_null($myrow[0])){ @@ -889,7 +889,7 @@ $LastPeriod = $myrow[1]; } /* Find the unix timestamp of the first period end date in periods table */ - $sql = 'SELECT MIN(lastdate_in_period), MIN(periodno) from periods'; + $sql = "SELECT MIN(lastdate_in_period), MIN(periodno) from periods"; $result = DB_query($sql, $db); $myrow=DB_fetch_row($result); $Date_Array = explode('-', $myrow[0]); @@ -929,7 +929,7 @@ } } else if (!PeriodExists(mktime(0,0,0,Date('m',$TransDate)+1,Date('d',$TransDate),Date('Y',$TransDate)), $db)) { /* Make sure the following months period exists */ - $sql = 'SELECT MAX(lastdate_in_period), MAX(periodno) from periods'; + $sql = "SELECT MAX(lastdate_in_period), MAX(periodno) from periods"; $result = DB_query($sql, $db); $myrow=DB_fetch_row($result); $Date_Array = explode('-', $myrow[0]); @@ -941,8 +941,10 @@ /* Now return the period number of the transaction */ $MonthAfterTransDate = Mktime(0,0,0,Date('m',$TransDate)+1,Date('d',$TransDate),Date('Y',$TransDate)); - $GetPrdSQL = "SELECT periodno FROM periods WHERE lastdate_in_period < '" . - Date('Y-m-d', $MonthAfterTransDate) . "' AND lastdate_in_period >= '" . Date('Y-m-d', $TransDate) . "'"; + $GetPrdSQL = "SELECT periodno + FROM periods + WHERE lastdate_in_period < '" . Date('Y-m-d', $MonthAfterTransDate) . "' + AND lastdate_in_period >= '" . Date('Y-m-d', $TransDate) . "'"; $ErrMsg = _('An error occurred in retrieving the period number'); $GetPrdResult = DB_query($GetPrdSQL,$db,$ErrMsg); This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <dai...@us...> - 2011-08-10 10:21:32
|
Revision: 4655 http://web-erp.svn.sourceforge.net/web-erp/?rev=4655&view=rev Author: daintree Date: 2011-08-10 10:21:25 +0000 (Wed, 10 Aug 2011) Log Message: ----------- POReport.php added link to detail purchase order inquiry 10/8/11 Phil: PO_SelectPurchOrder.php and outstanding purchase order searches now show the delivery date (from the purchase order header) line items may have different delivery dates. 10/8/11 Phil: Stocks.php changing the stock category to one with a different stock account now creates a journal (if stock is linked to GL) to move the cost of the stock from the old GL account to the new GL account Modified Paths: -------------- trunk/POReport.php trunk/PO_SelectOSPurchOrder.php trunk/PO_SelectPurchOrder.php trunk/Stocks.php trunk/doc/Change.log trunk/includes/DateFunctions.inc Modified: trunk/POReport.php =================================================================== --- trunk/POReport.php 2011-08-08 10:32:39 UTC (rev 4654) +++ trunk/POReport.php 2011-08-10 10:21:25 UTC (rev 4655) @@ -72,9 +72,9 @@ //####_SUBMIT_SUBMIT_SUBMIT_SUBMIT_SUBMIT_SUBMIT_SUBMIT_SUBMIT_SUBMIT_SUBMIT_SUBMIT_SUBMIT#### -function submit(&$db,$PartNumber,$PartNumberOp,$SupplierId,$SupplierIdOp,$SupplierName,$SupplierNameOp,$SaveSummaryType) -{ +function submit(&$db,$PartNumber,$PartNumberOp,$SupplierId,$SupplierIdOp,$SupplierName,$SupplierNameOp,$SaveSummaryType) { + global $rootpath; //initialize no input errors $InputError = 0; @@ -502,7 +502,7 @@ $Detail_Array['suppliers.suppname,suppliers.supplierid,purchorderdetails.orderno'] = _('Supplier Name'); // Display Header info - echo '<table class=selection>'; + echo '<table class="selection">'; if ($_POST['ReportType'] == 'Summary') { $SortBy_Display = $Summary_Array[$SaveSummaryType]; } else { @@ -533,7 +533,7 @@ <td>' . $_POST['Category'] . '</td></tr></table>'; if ($_POST['ReportType'] == 'Detail') { - echo '<br /><table class=selection width=98%>'; + echo '<br /><table class="selection" width=98%>'; if ($_POST['DateType'] == 'Order') { echo '<tr><th>' . _('Order No') . '</th> <th>' . _('Part Number') . '</th> @@ -561,7 +561,7 @@ } $linectr++; // Detail for both DateType of Order - printf('<td>%s</td> + printf('<td><a href="'. $rootpath . '/PO_OrderDetails.php?OrderNo=%s">%s</a></td> <td>%s</td> <td>%s</td> <td>%s</td> @@ -575,6 +575,7 @@ <td>%s</td> </tr>', $myrow['orderno'], + $myrow['orderno'], $myrow['itemcode'], ConvertSQLDate($myrow['orddate']), $myrow['supplierno'], Modified: trunk/PO_SelectOSPurchOrder.php =================================================================== --- trunk/PO_SelectOSPurchOrder.php 2011-08-08 10:32:39 UTC (rev 4654) +++ trunk/PO_SelectOSPurchOrder.php 2011-08-10 10:21:25 UTC (rev 4655) @@ -282,6 +282,7 @@ $SQL = "SELECT purchorders.orderno, suppliers.suppname, purchorders.orddate, + purchorders.deliverydate, purchorders.initiator, purchorders.status, purchorders.requisitionno, @@ -317,6 +318,7 @@ purchorders.orderno, suppliers.suppname, purchorders.orddate, + purchorders.deliverydate, purchorders.status, purchorders.initiator, purchorders.requisitionno, @@ -346,6 +348,7 @@ purchorders.orderno, suppliers.suppname, purchorders.orddate, + purchorders.deliverydate, purchorders.status, purchorders.initiator, purchorders.requisitionno, @@ -377,6 +380,7 @@ purchorders.orderno, suppliers.suppname, purchorders.orddate, + purchorders.deliverydate, purchorders.status, purchorders.initiator, purchorders.requisitionno, @@ -405,6 +409,7 @@ purchorders.orderno, suppliers.suppname, purchorders.orddate, + purchorders.deliverydate, purchorders.status, purchorders.initiator, purchorders.requisitionno, @@ -437,13 +442,13 @@ /*show a table of the orders returned by the SQL */ - echo '<table cellpadding=2 colspan=7 width=97% class=selection>'; + echo '<table cellpadding="2" colspan="7 width="97%" class="selection">'; -// '</td><td class="tableheader">' . _('Receive') . echo '<tr> <th>' . _('Order #') . '</th> <th>' . _('Order Date') . '</th> + <th>' . _('Delivery Date') . '</th> <th>' . _('Initiated by') . '</th> <th>' . _('Supplier') . '</th> <th>' . _('Currency') . '</th>'; @@ -469,8 +474,7 @@ $ModifyPage = $rootpath . '/PO_Header.php?ModifyOrderNumber=' . $myrow['orderno']; if ($myrow['status'] == 'Printed') { - $ReceiveOrder = '<a href="'.$rootpath . '/GoodsReceived.php?PONumber=' . $myrow['orderno'].'">'. - _('Receive').'</a>'; + $ReceiveOrder = '<a href="'.$rootpath . '/GoodsReceived.php?PONumber=' . $myrow['orderno'].'">'. _('Receive') . '</a>'; } else { $ReceiveOrder = ''; } @@ -487,15 +491,17 @@ $FormatedOrderDate = ConvertSQLDate($myrow['orddate']); + $FormatedDeliveryDate = ConvertSQLDate($myrow['deliverydate']); $FormatedOrderValue = number_format($myrow['ordervalue'],2); echo '<td><a href="'.$ModifyPage.'">' . $myrow['orderno'] . '</a></td> <td>' . $FormatedOrderDate . '</td> + <td>' . $FormatedDeliveryDate . '</td> <td>' . $myrow['initiator'] . '</td> <td>' . $myrow['suppname'] . '</td> <td>' . $myrow['currcode'] . '</td>'; if (in_array($PricesSecurity, $_SESSION['AllowedPageSecurityTokens']) OR !isset($PricesSecurity)) { - echo '<td class=number>'.$FormatedOrderValue . '</td>'; + echo '<td class="number">'.$FormatedOrderValue . '</td>'; } echo '<td>' . _($myrow['status']) . '</td> <td>' . $PrintPurchOrder . '</td> Modified: trunk/PO_SelectPurchOrder.php =================================================================== --- trunk/PO_SelectPurchOrder.php 2011-08-08 10:32:39 UTC (rev 4654) +++ trunk/PO_SelectPurchOrder.php 2011-08-10 10:21:25 UTC (rev 4655) @@ -193,8 +193,8 @@ } echo '<td><input type="submit" name="SelectedStockItem" value="' . $myrow['stockid'] . '"</td> <td>' . $myrow['description'] . '</td> - <td class=number>' . $myrow['qoh'] . '</td> - <td class=number>' . $myrow['qord'] . '</td> + <td class="number">' . $myrow['qoh'] . '</td> + <td class="number">' . $myrow['qord'] . '</td> <td>' . $myrow['units'] . '</td> </tr>'; $j++; @@ -229,6 +229,7 @@ $SQL = "SELECT purchorders.orderno, suppliers.suppname, purchorders.orddate, + purchorders.deliverydate, purchorders.initiator, purchorders.requisitionno, purchorders.allowprint, @@ -263,6 +264,7 @@ $SQL = "SELECT purchorders.orderno, suppliers.suppname, purchorders.orddate, + purchorders.deliverydate, purchorders.initiator, purchorders.requisitionno, purchorders.allowprint, @@ -293,6 +295,7 @@ $SQL = "SELECT purchorders.orderno, suppliers.suppname, purchorders.orddate, + purchorders.deliverydate, purchorders.initiator, purchorders.requisitionno, purchorders.allowprint, @@ -324,6 +327,7 @@ $SQL = "SELECT purchorders.orderno, suppliers.suppname, purchorders.orddate, + purchorders.deliverydate, purchorders.initiator, purchorders.requisitionno, purchorders.allowprint, @@ -353,6 +357,7 @@ $SQL = "SELECT purchorders.orderno, suppliers.suppname, purchorders.orddate, + purchorders.deliverydate, purchorders.initiator, purchorders.requisitionno, purchorders.allowprint, @@ -386,13 +391,14 @@ if (DB_num_rows($PurchOrdersResult) > 0) { /*show a table of the orders returned by the SQL */ - echo '<table cellpadding=2 colspan=7 width=90% class=selection>'; + echo '<table cellpadding="2" colspan="7" width="90%" class="selection">'; $TableHeader = '<tr> <th>' . _('View') . '</th> <th>' . _('Supplier') . '</th> <th>' . _('Currency') . '</th> <th>' . _('Requisition') . '</th> <th>' . _('Order Date') . '</th> + <th>' . _('Delivery Date') . '</th> <th>' . _('Initiator') . '</th> <th>' . _('Order Total') . '</th> <th>' . _('Status') . '</th> @@ -410,6 +416,7 @@ } $ViewPurchOrder = $rootpath . '/PO_OrderDetails.php?OrderNo=' . $myrow['orderno']; $FormatedOrderDate = ConvertSQLDate($myrow['orddate']); + $FormatedDeliveryDate = ConvertSQLDate($myrow['deliverydate']); $FormatedOrderValue = number_format($myrow['ordervalue'], $myrow['decimalplaces']); /* View Supplier Currency Requisition Order Date Initiator Order Total ModifyPage, $myrow["orderno"], $myrow["suppname"], $myrow["currcode"], $myrow["requisitionno"] $FormatedOrderDate, $myrow["initiator"] $FormatedOrderValue Order Status*/ @@ -418,8 +425,9 @@ <td>' . $myrow['currcode'] . '</td> <td>' . $myrow['requisitionno'] . '</td> <td>' . $FormatedOrderDate . '</td> + <td>' . $FormatedDeliveryDate . '</td> <td>' . $myrow['initiator'] . '</td> - <td class=number>' . $FormatedOrderValue . '</td> + <td class="number">' . $FormatedOrderValue . '</td> <td>' . _($myrow['status']) . '</td> </tr>'; //$myrow['status'] is a string which has gettext translations from PO_Header.php script Modified: trunk/Stocks.php =================================================================== --- trunk/Stocks.php 2011-08-08 10:32:39 UTC (rev 4654) +++ trunk/Stocks.php 2011-08-10 10:21:25 UTC (rev 4655) @@ -211,27 +211,43 @@ */ $sql = "SELECT mbflag, controlled, - serialised - FROM stockmaster WHERE stockid = '".$StockID."'"; + serialised, + materialcost+labourcost+overheadcost AS itemcost, + stockcategory.stockact + FROM stockmaster + INNER JOIN stockcategory + ON stockmaster.categoryid=stockcategory.categoryid + WHERE stockid = '".$StockID."'"; $MBFlagResult = DB_query($sql,$db); $myrow = DB_fetch_row($MBFlagResult); $OldMBFlag = $myrow[0]; $OldControlled = $myrow[1]; $OldSerialised = $myrow[2]; + $UnitCost = $myrow[3]; + $OldStockAccount = $myrow[4]; $sql = "SELECT SUM(locstock.quantity) FROM locstock WHERE stockid='".$StockID."' GROUP BY stockid"; $result = DB_query($sql,$db); - $stkqtychk = DB_fetch_row($result); + $StockQtyRow = DB_fetch_row($result); + /*Now check the GL account of the new category to see if it is different to the old stock gl account */ + + $result = DB_query("SELECT stockact + FROM stockcategory + WHERE categoryid='" . $_POST['CategoryID'] . "'", + $db); + $NewStockActRow = DB_fetch_array($result); + $NewStockAct = $NewStockActRow['stockact']; + if ($OldMBFlag != $_POST['MBFlag']){ if (($OldMBFlag == 'M' OR $OldMBFlag=='B') AND ($_POST['MBFlag']=='A' OR $_POST['MBFlag']=='K' OR $_POST['MBFlag']=='D' OR $_POST['MBFlag']=='G')){ /*then need to check that there is no stock holding first */ /* stock holding OK for phantom (ghost) items */ - if ($stkqtychk[0]!=0 AND $OldMBFlag!='G'){ + if ($StockQtyRow[0]!=0 AND $OldMBFlag!='G'){ $InputError=1; - prnMsg( _('The make or buy flag cannot be changed from') . ' ' . $OldMBFlag . ' ' . _('to') . ' ' . $_POST['MBFlag'] . ' ' . _('where there is a quantity of stock on hand at any location') . '. ' . _('Currently there are') . ' ' . $stkqtychk[0] . ' ' . _('on hand') , 'errror'); + prnMsg( _('The make or buy flag cannot be changed from') . ' ' . $OldMBFlag . ' ' . _('to') . ' ' . $_POST['MBFlag'] . ' ' . _('where there is a quantity of stock on hand at any location') . '. ' . _('Currently there are') . ' ' . $StockQtyRow[0] . ' ' . _('on hand') , 'errror'); } /* don't allow controlled/serialized */ if ($_POST['Controlled']==1){ @@ -296,18 +312,21 @@ } /* Do some checks for changes in the Serial & Controlled setups */ - if ($OldControlled != $_POST['Controlled'] AND $stkqtychk[0]!=0){ + if ($OldControlled != $_POST['Controlled'] AND $StockQtyRow[0]!=0){ $InputError=1; prnMsg( _('You can not change a Non-Controlled Item to Controlled (or back from Controlled to non-controlled when there is currently stock on hand for the item') , 'error'); } - if ($OldSerialised != $_POST['Serialised'] AND $stkqtychk[0]!=0){ + if ($OldSerialised != $_POST['Serialised'] AND $StockQtyRow[0]!=0){ $InputError=1; prnMsg( _('You can not change a Serialised Item to Non-Serialised (or vice-versa) when there is a quantity on hand for the item') , 'error'); } if ($InputError == 0){ + + DB_Txn_Begin($db); + $sql = "UPDATE stockmaster SET longdescription='" . $_POST['LongDescription'] . "', description='" . $_POST['Description'] . "', @@ -333,12 +352,12 @@ $ErrMsg = _('The stock item could not be updated because'); $DbgMsg = _('The SQL that was used to update the stock item and failed was'); - $result = DB_query($sql,$db,$ErrMsg,$DbgMsg); + $result = DB_query($sql,$db,$ErrMsg,$DbgMsg,true); //delete any properties for the item no longer relevant with the change of category $result = DB_query("DELETE FROM stockitemproperties WHERE stockid ='" . $StockID . "'", - $db); + $db,$ErrMsg,$DbgMsg,true); //now insert any item properties for ($i=0;$i<$_POST['PropertyCounter'];$i++){ @@ -356,8 +375,47 @@ VALUES ('" . $StockID . "', '" . $_POST['PropID' . $i] . "', '" . $_POST['PropValue' . $i] . "')", - $db); + $db,$ErrMsg,$DbgMsg,true); } //end of loop around properties defined for the category + + if ($OldStockAccount != $NewStockAct AND $_SESSION['CompanyRecord']['gllinkstock']==1) { + /*Then we need to make a journal to transfer the cost to the new stock account */ + $JournalNo = GetNextTransNo(0,$db); //enter as a journal + $SQL = "INSERT INTO gltrans (type, + typeno, + trandate, + periodno, + account, + narrative, + amount) + VALUES ( 0, + '" . $JournalNo . "', + '" . Date('Y-m-d') . "', + '" . GetPeriodNo(Date('Y-m-d'),true) . "', + '" . $NewStockAccount . "', + '" . $StockID . ' ' . _('Change stock category') . "', + '" . ($UnitCost* $StockQtyRow[0]) . "'"; + $ErrMsg = _('The stock cost journal could not be inserted because'); + $DbgMsg = _('The SQL that was used to create the stock cost journal and failed was'); + $result = DB_query($sql,$db, $ErrMsg, $DbgMsg,true); + $SQL = "INSERT INTO gltrans (type, + typeno, + trandate, + periodno, + account, + narrative, + amount) + VALUES ( 0, + '" . $JournalNo . "', + '" . Date('Y-m-d') . "', + '" . GetPeriodNo(Date('Y-m-d'),true) . "', + '" . $OldStockAccount . "', + '" . $StockID . ' ' . _('Change stock category') . "', + '" . (-$UnitCost* $StockQtyRow[0]) . "'"; + $result = DB_query($sql,$db, $ErrMsg, $DbgMsg,true); + + } /* end if the stock category changed and forced a change in stock cost account */ + DB_Txn_Commit($db); prnMsg( _('Stock Item') . ' ' . $StockID . ' ' . _('has been updated'), 'success'); echo '<br />'; } Modified: trunk/doc/Change.log =================================================================== --- trunk/doc/Change.log 2011-08-08 10:32:39 UTC (rev 4654) +++ trunk/doc/Change.log 2011-08-10 10:21:25 UTC (rev 4655) @@ -1,5 +1,8 @@ webERP Change Log +10/8/11 Phil: POReport.php added link to detail purchase order inquiry +10/8/11 Phil: PO_SelectPurchOrder.php and outstanding purchase order searches now show the delivery date (from the purchase order header) line items may have different delivery dates. +10/8/11 Phil: Stocks.php changing the stock category to one with a different stock account now creates a journal (if stock is linked to GL) to move the cost of the stock from the old GL account to the new GL account 7/8/11 Phil: SelectProduct.php now disables transactions on items flagged as obsolete (discontinued). Also obsolete items are shown as such in the selection list - suggested by Klaus (opto) 7/8/11 Ricard: Corrected INNER JOIN ON clause in sql used in InventoryQuantities.php script 7/8/11 Klaus: Added docuwiki links to WikiLinks function in MiscFunctions.php and allow Docuwiki option in SystemParameters.php Modified: trunk/includes/DateFunctions.inc =================================================================== --- trunk/includes/DateFunctions.inc 2011-08-08 10:32:39 UTC (rev 4654) +++ trunk/includes/DateFunctions.inc 2011-08-10 10:21:25 UTC (rev 4655) @@ -875,7 +875,7 @@ } } /* Find the unix timestamp of the last period end date in periods table */ - $sql = 'SELECT MAX(lastdate_in_period), MAX(periodno) from periods'; + $sql = "SELECT MAX(lastdate_in_period), MAX(periodno) from periods"; $result = DB_query($sql, $db); $myrow=DB_fetch_row($result); if (is_null($myrow[0])){ @@ -889,7 +889,7 @@ $LastPeriod = $myrow[1]; } /* Find the unix timestamp of the first period end date in periods table */ - $sql = 'SELECT MIN(lastdate_in_period), MIN(periodno) from periods'; + $sql = "SELECT MIN(lastdate_in_period), MIN(periodno) from periods"; $result = DB_query($sql, $db); $myrow=DB_fetch_row($result); $Date_Array = explode('-', $myrow[0]); @@ -929,7 +929,7 @@ } } else if (!PeriodExists(mktime(0,0,0,Date('m',$TransDate)+1,Date('d',$TransDate),Date('Y',$TransDate)), $db)) { /* Make sure the following months period exists */ - $sql = 'SELECT MAX(lastdate_in_period), MAX(periodno) from periods'; + $sql = "SELECT MAX(lastdate_in_period), MAX(periodno) from periods"; $result = DB_query($sql, $db); $myrow=DB_fetch_row($result); $Date_Array = explode('-', $myrow[0]); @@ -941,8 +941,10 @@ /* Now return the period number of the transaction */ $MonthAfterTransDate = Mktime(0,0,0,Date('m',$TransDate)+1,Date('d',$TransDate),Date('Y',$TransDate)); - $GetPrdSQL = "SELECT periodno FROM periods WHERE lastdate_in_period < '" . - Date('Y-m-d', $MonthAfterTransDate) . "' AND lastdate_in_period >= '" . Date('Y-m-d', $TransDate) . "'"; + $GetPrdSQL = "SELECT periodno + FROM periods + WHERE lastdate_in_period < '" . Date('Y-m-d', $MonthAfterTransDate) . "' + AND lastdate_in_period >= '" . Date('Y-m-d', $TransDate) . "'"; $ErrMsg = _('An error occurred in retrieving the period number'); $GetPrdResult = DB_query($GetPrdSQL,$db,$ErrMsg); This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <dai...@us...> - 2011-08-11 10:08:12
|
Revision: 4656 http://web-erp.svn.sourceforge.net/web-erp/?rev=4656&view=rev Author: daintree Date: 2011-08-11 10:08:05 +0000 (Thu, 11 Aug 2011) Log Message: ----------- 11/8/11 Phil: GoodsReceived.php now has checkbox to flag the order line as complete - even though the quantity delivered might be short of the order quantity. 11/8/11 Phil: PO_Items.php link to complete uncompleted lines - status of order is changed to complete is all lines are completed Modified Paths: -------------- trunk/GoodsReceived.php trunk/PO_Items.php trunk/doc/Change.log trunk/includes/DefinePOClass.php Modified: trunk/GoodsReceived.php =================================================================== --- trunk/GoodsReceived.php 2011-08-10 10:21:25 UTC (rev 4655) +++ trunk/GoodsReceived.php 2011-08-11 10:08:05 UTC (rev 4656) @@ -47,6 +47,11 @@ $RecvQty = 0; } $_SESSION['PO'.$identifier]->LineItems[$Line->LineNo]->ReceiveQty = $RecvQty; + if (isset($_POST['Complete_' . $Line->LineNo])){ + $_SESSION['PO'.$identifier]->LineItems[$Line->LineNo]->Completed = 1; + } else { + $_SESSION['PO'.$identifier]->LineItems[$Line->LineNo]->Completed = 0; + } } } @@ -75,7 +80,7 @@ echo '<table class="selection"> <tr> <td>'. _('Date Goods/Service Received'). ':</td> - <td><input type="text" class=date alt="'. $_SESSION['DefaultDateFormat'] .'" maxlength=10 size=10 onChange="return isDate(this, this.value, '."'". + <td><input type="text" class="date" alt="'. $_SESSION['DefaultDateFormat'] .'" maxlength=10 size=10 onChange="return isDate(this, this.value, '."'". $_SESSION['DefaultDateFormat']."'".')" name="DefaultReceivedDate" value="' . $_POST['DefaultReceivedDate'] . '"></td> </tr> </table> @@ -96,7 +101,8 @@ <th>' . _('Quantity') . '<br />' . _('Ordered') . '</th> <th>' . _('Units') . '</th> <th>' . _('Already') . '<br />' . _('Received') . '</th> - <th>' . _('This Delivery') . '<br />' . _('Quantity') . '</th>'; + <th>' . _('This Delivery') . '<br />' . _('Quantity') . '</th> + <th>' . _('Completed') . '</th>'; if ($_SESSION['ShowValueOnGRN']==1) { echo '<th>' . _('Price') . '</th> @@ -147,23 +153,28 @@ //Now Display LineItem echo '<td>' . $LnItm->StockID . '</td> <td>' . $LnItm->ItemDescription . '</td> - <td class=number>' . $DisplaySupplierQtyOrd . '</td> + <td class="number">' . $DisplaySupplierQtyOrd . '</td> <td>' . $LnItm->SuppliersUnit . '</td> - <td class=number>' . $DisplaySupplierQtyRec . '</td> - <td class=number>' . $LnItm->ConversionFactor . '</td> - <td class=number>' . $DisplayQtyOrd . '</td> + <td class="number">' . $DisplaySupplierQtyRec . '</td> + <td class="number">' . $LnItm->ConversionFactor . '</td> + <td class="number">' . $DisplayQtyOrd . '</td> <td>' . $LnItm->Units . '</td> - <td class=number>' . $DisplayQtyRec . '</td> - <td class=number>'; + <td class="number">' . $DisplayQtyRec . '</td> + <td class="number">'; if ($LnItm->Controlled == 1) { echo '<input type=hidden name="RecvQty_' . $LnItm->LineNo . '" value="' . $LnItm->ReceiveQty . '"><a href="GoodsReceivedControlled.php?identifier=' . $identifier . '&LineNo=' . $LnItm->LineNo . '">' . number_format($LnItm->ReceiveQty,$LnItm->DecimalPlaces) . '</a></td>'; } else { - echo '<input type="text" class=number name="RecvQty_' . $LnItm->LineNo . '" maxlength=10 size=10 value="' . $LnItm->ReceiveQty . '"></td>'; + echo '<input type="text" class="number" name="RecvQty_' . $LnItm->LineNo . '" maxlength=10 size=10 value="' . $LnItm->ReceiveQty . '"></td>'; } - + echo '<td><input type="checkbox" name="Complete_'. $LnItm->LineNo . '"'; + if ($LnItm->Completed ==1){ + echo ' checked'; + } + echo ' /></td>'; + if ($_SESSION['ShowValueOnGRN']==1) { echo '<td class="number">' . $DisplayPrice . '</td>'; echo '<td class="number">' . $DisplayLineTotal . '</td>'; @@ -341,9 +352,11 @@ $PeriodNo = GetPeriod($_POST['DefaultReceivedDate'], $db); $_POST['DefaultReceivedDate'] = FormatDateForSQL($_POST['DefaultReceivedDate']); - + $OrderCompleted = true; //assume all received and completed - now test in case not foreach ($_SESSION['PO'.$identifier]->LineItems as $OrderLine) { - + if ($OrderLine->Completed ==0){ + $OrderCompleted = false; + } if ($OrderLine->ReceiveQty !=0 AND $OrderLine->ReceiveQty!='' AND isset($OrderLine->ReceiveQty)) { $LocalCurrencyPrice = ($OrderLine->Price / $_SESSION['PO'.$identifier]->ExRate); @@ -390,7 +403,7 @@ $SQL = "UPDATE purchorderdetails SET quantityrecd = quantityrecd + '" . $OrderLine->ReceiveQty . "', stdcostunit='" . $_SESSION['PO'.$identifier]->LineItems[$OrderLine->LineNo]->StandardCost . "', - completed=0 + completed='" . $_SESSION['PO'.$identifier]->LineItems[$OrderLine->LineNo]->Completed . "' WHERE podetailitem = '" . $OrderLine->PODetailRec . "'"; } @@ -670,10 +683,8 @@ } /*Quantity received is != 0 */ } /*end of OrderLine loop */ - - - if ($_SESSION['PO'.$identifier]->AllLinesReceived()==1) { //all lines on the purchase order are now completed - $StatusComment=date($_SESSION['DefaultDateFormat']) .' - ' . _('Order Completed') .'<br />' . $_SESSION['PO'.$identifier]->StatusComments; + if ($_SESSION['PO'.$identifier]->AllLinesReceived()==1 OR $OrderCompleted) { //all lines on the purchase order are now completed + $StatusComment=date($_SESSION['DefaultDateFormat']) .' - ' . _('Order Completed on entry of GRN') .'<br />' . $_SESSION['PO'.$identifier]->StatusComments; $sql="UPDATE purchorders SET status='Completed', stat_comment='" . $StatusComment . "' Modified: trunk/PO_Items.php =================================================================== --- trunk/PO_Items.php 2011-08-10 10:21:25 UTC (rev 4655) +++ trunk/PO_Items.php 2011-08-11 10:08:05 UTC (rev 4656) @@ -83,7 +83,8 @@ } else { $UserDetails = ' ' . $_SESSION['UsersRealName'] . ' '; } - if ($_SESSION['AutoAuthorisePO']==1) { //if the user has authority to authorise the PO then it will automatically be authorised + if ($_SESSION['AutoAuthorisePO']==1) { + //if the user has authority to authorise the PO then it will automatically be authorised $AuthSQL ="SELECT authlevel FROM purchorderauth WHERE userid='".$_SESSION['UserID']."' @@ -233,7 +234,23 @@ prnMsg(_('Purchase Order') . ' ' . $_SESSION['PO'.$identifier]->OrderNo . ' ' . _('on') . ' ' . $_SESSION['PO'.$identifier]->SupplierName . ' ' . _('has been created'),'success'); } else { /*its an existing order need to update the old order info */ - + /*Check to see if there are any incomplete lines on the order */ + $Completed = true; //assume it is completed i.e. all lines are flagged as completed + foreach ($_SESSION['PO'.$identifier]->LineItems as $POLine) { + if ($POLine->Completed==0){ + $Completed = false; + break; + } + } + if ($Completed){ + $_SESSION['PO'.$identifier]->Status = 'Completed'; + if (IsEmailAddress($_SESSION['UserEmail'])){ + $UserChangedStatus = ' <a href="mailto:' . $_SESSION['UserEmail'] . '">' . $_SESSION['UsersRealName']. '</a>'; + } else { + $UserChangedStatus = ' ' . $_SESSION['UsersRealName'] . ' '; + } + $_SESSION['PO'.$identifier]->StatusComments = date($_SESSION['DefaultDateFormat']).' - ' . _('Order completed by') . $UserChangedStatus . '<br />' .$_SESSION['PO'.$identifier]->StatusComments; + } /*Update the purchase order header with any changes */ $sql = "UPDATE purchorders SET supplierno = '" . $_SESSION['PO'.$identifier]->SupplierID . "' , @@ -264,13 +281,14 @@ contact='" . $_SESSION['PO'.$identifier]->Contact . "', paymentterms='" . $_SESSION['PO'.$identifier]->PaymentTerms . "', allowprint='" . $_SESSION['PO'.$identifier]->AllowPrintPO . "', - status = '" . $_SESSION['PO'.$identifier]->Status . "' + status = '" . $_SESSION['PO'.$identifier]->Status . "', + stat_comment = '" . $_SESSION['PO'.$identifier]->StatusComments . "' WHERE orderno = '" . $_SESSION['PO'.$identifier]->OrderNo ."'"; $ErrMsg = _('The purchase order could not be updated because'); $DbgMsg = _('The SQL statement used to update the purchase order header record, that failed was'); $result = DB_query($sql,$db,$ErrMsg,$DbgMsg,true); - + /*Now Update the purchase order detail records */ foreach ($_SESSION['PO'.$identifier]->LineItems as $POLine) { $result=DB_query($sql,$db,'','',true); @@ -382,6 +400,9 @@ } } +if(isset($_GET['Complete'])){ + $_SESSION['PO'.$identifier]->LineItems[$_GET['Complete']]->Completed=1; +} if (isset($_POST['EnterLine'])){ /*Inputs from the form directly without selecting a stock item from the search */ $AllowUpdate = true; /*always assume the best */ @@ -683,8 +704,13 @@ <td>' . $POLine->SuppliersUnit . '</td> <td><input type="text" class="number" name="SuppPrice' . $POLine->LineNo . '" size="10" value="' . round(($POLine->Price *$POLine->ConversionFactor),$_SESSION['PO'.$identifier]->CurrDecimalPlaces) .'"></td> <td class="number">' . $DisplayLineTotal . '</td> - <td><input type="text" class="date" alt="' .$_SESSION['DefaultDateFormat'].'" name="ReqDelDate' . $POLine->LineNo.'" size="10" value="' .$POLine->ReqDelDate .'"></td> - <td><a href="' . $_SERVER['PHP_SELF'] . '?identifier='.$identifier. '&Delete=' . $POLine->LineNo . '">' . _('Delete') . '</a></td></tr>'; + <td><input type="text" class="date" alt="' .$_SESSION['DefaultDateFormat'].'" name="ReqDelDate' . $POLine->LineNo.'" size="10" value="' .$POLine->ReqDelDate .'"></td>'; + if ($POLine->QtyReceived !=0 AND $POLine->Completed!=1){ + echo '<td><a href="' . $_SERVER['PHP_SELF'] . '?identifier='.$identifier .'&Complete=' . $POLine->LineNo . '">' . _('Complete') . '</a></td>'; + } elseif ($POLine->QtyReceived ==0) { + echo '<td><a href="' . $_SERVER['PHP_SELF'] . '?identifier='.$identifier .'&Delete=' . $POLine->LineNo . '">' . _('Delete'). '</a></td>'; + } + echo '</tr>'; $_SESSION['PO'.$identifier]->Total += $LineTotal; } } Modified: trunk/doc/Change.log =================================================================== --- trunk/doc/Change.log 2011-08-10 10:21:25 UTC (rev 4655) +++ trunk/doc/Change.log 2011-08-11 10:08:05 UTC (rev 4656) @@ -1,5 +1,7 @@ webERP Change Log +11/8/11 Phil: GoodsReceived.php now has checkbox to flag the order line as complete - even though the quantity delivered might be short of the order quantity. +11/8/11 Phil: PO_Items.php link to complete uncompleted lines - status of order is changed to complete is all lines are completed 10/8/11 Phil: POReport.php added link to detail purchase order inquiry 10/8/11 Phil: PO_SelectPurchOrder.php and outstanding purchase order searches now show the delivery date (from the purchase order header) line items may have different delivery dates. 10/8/11 Phil: Stocks.php changing the stock category to one with a different stock account now creates a journal (if stock is linked to GL) to move the cost of the stock from the old GL account to the new GL account Modified: trunk/includes/DefinePOClass.php =================================================================== --- trunk/includes/DefinePOClass.php 2011-08-10 10:21:25 UTC (rev 4655) +++ trunk/includes/DefinePOClass.php 2011-08-11 10:08:05 UTC (rev 4656) @@ -93,7 +93,7 @@ $GLCode, $ReqDelDate, $ShiptRef, - 0, + $Completed, $JobRef, $QtyInv, $QtyRecd, @@ -276,7 +276,8 @@ $this->Deleted = false; $this->SerialItems = array(); /*if Controlled then need to populate this later */ $this->SerialItemsValid=false; - $this->AssetID= $AssetID; + $this->AssetID = $AssetID; + } } ?> \ No newline at end of file This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <dai...@us...> - 2011-08-11 10:08:12
|
Revision: 4656 http://web-erp.svn.sourceforge.net/web-erp/?rev=4656&view=rev Author: daintree Date: 2011-08-11 10:08:05 +0000 (Thu, 11 Aug 2011) Log Message: ----------- 11/8/11 Phil: GoodsReceived.php now has checkbox to flag the order line as complete - even though the quantity delivered might be short of the order quantity. 11/8/11 Phil: PO_Items.php link to complete uncompleted lines - status of order is changed to complete is all lines are completed Modified Paths: -------------- trunk/GoodsReceived.php trunk/PO_Items.php trunk/doc/Change.log trunk/includes/DefinePOClass.php Modified: trunk/GoodsReceived.php =================================================================== --- trunk/GoodsReceived.php 2011-08-10 10:21:25 UTC (rev 4655) +++ trunk/GoodsReceived.php 2011-08-11 10:08:05 UTC (rev 4656) @@ -47,6 +47,11 @@ $RecvQty = 0; } $_SESSION['PO'.$identifier]->LineItems[$Line->LineNo]->ReceiveQty = $RecvQty; + if (isset($_POST['Complete_' . $Line->LineNo])){ + $_SESSION['PO'.$identifier]->LineItems[$Line->LineNo]->Completed = 1; + } else { + $_SESSION['PO'.$identifier]->LineItems[$Line->LineNo]->Completed = 0; + } } } @@ -75,7 +80,7 @@ echo '<table class="selection"> <tr> <td>'. _('Date Goods/Service Received'). ':</td> - <td><input type="text" class=date alt="'. $_SESSION['DefaultDateFormat'] .'" maxlength=10 size=10 onChange="return isDate(this, this.value, '."'". + <td><input type="text" class="date" alt="'. $_SESSION['DefaultDateFormat'] .'" maxlength=10 size=10 onChange="return isDate(this, this.value, '."'". $_SESSION['DefaultDateFormat']."'".')" name="DefaultReceivedDate" value="' . $_POST['DefaultReceivedDate'] . '"></td> </tr> </table> @@ -96,7 +101,8 @@ <th>' . _('Quantity') . '<br />' . _('Ordered') . '</th> <th>' . _('Units') . '</th> <th>' . _('Already') . '<br />' . _('Received') . '</th> - <th>' . _('This Delivery') . '<br />' . _('Quantity') . '</th>'; + <th>' . _('This Delivery') . '<br />' . _('Quantity') . '</th> + <th>' . _('Completed') . '</th>'; if ($_SESSION['ShowValueOnGRN']==1) { echo '<th>' . _('Price') . '</th> @@ -147,23 +153,28 @@ //Now Display LineItem echo '<td>' . $LnItm->StockID . '</td> <td>' . $LnItm->ItemDescription . '</td> - <td class=number>' . $DisplaySupplierQtyOrd . '</td> + <td class="number">' . $DisplaySupplierQtyOrd . '</td> <td>' . $LnItm->SuppliersUnit . '</td> - <td class=number>' . $DisplaySupplierQtyRec . '</td> - <td class=number>' . $LnItm->ConversionFactor . '</td> - <td class=number>' . $DisplayQtyOrd . '</td> + <td class="number">' . $DisplaySupplierQtyRec . '</td> + <td class="number">' . $LnItm->ConversionFactor . '</td> + <td class="number">' . $DisplayQtyOrd . '</td> <td>' . $LnItm->Units . '</td> - <td class=number>' . $DisplayQtyRec . '</td> - <td class=number>'; + <td class="number">' . $DisplayQtyRec . '</td> + <td class="number">'; if ($LnItm->Controlled == 1) { echo '<input type=hidden name="RecvQty_' . $LnItm->LineNo . '" value="' . $LnItm->ReceiveQty . '"><a href="GoodsReceivedControlled.php?identifier=' . $identifier . '&LineNo=' . $LnItm->LineNo . '">' . number_format($LnItm->ReceiveQty,$LnItm->DecimalPlaces) . '</a></td>'; } else { - echo '<input type="text" class=number name="RecvQty_' . $LnItm->LineNo . '" maxlength=10 size=10 value="' . $LnItm->ReceiveQty . '"></td>'; + echo '<input type="text" class="number" name="RecvQty_' . $LnItm->LineNo . '" maxlength=10 size=10 value="' . $LnItm->ReceiveQty . '"></td>'; } - + echo '<td><input type="checkbox" name="Complete_'. $LnItm->LineNo . '"'; + if ($LnItm->Completed ==1){ + echo ' checked'; + } + echo ' /></td>'; + if ($_SESSION['ShowValueOnGRN']==1) { echo '<td class="number">' . $DisplayPrice . '</td>'; echo '<td class="number">' . $DisplayLineTotal . '</td>'; @@ -341,9 +352,11 @@ $PeriodNo = GetPeriod($_POST['DefaultReceivedDate'], $db); $_POST['DefaultReceivedDate'] = FormatDateForSQL($_POST['DefaultReceivedDate']); - + $OrderCompleted = true; //assume all received and completed - now test in case not foreach ($_SESSION['PO'.$identifier]->LineItems as $OrderLine) { - + if ($OrderLine->Completed ==0){ + $OrderCompleted = false; + } if ($OrderLine->ReceiveQty !=0 AND $OrderLine->ReceiveQty!='' AND isset($OrderLine->ReceiveQty)) { $LocalCurrencyPrice = ($OrderLine->Price / $_SESSION['PO'.$identifier]->ExRate); @@ -390,7 +403,7 @@ $SQL = "UPDATE purchorderdetails SET quantityrecd = quantityrecd + '" . $OrderLine->ReceiveQty . "', stdcostunit='" . $_SESSION['PO'.$identifier]->LineItems[$OrderLine->LineNo]->StandardCost . "', - completed=0 + completed='" . $_SESSION['PO'.$identifier]->LineItems[$OrderLine->LineNo]->Completed . "' WHERE podetailitem = '" . $OrderLine->PODetailRec . "'"; } @@ -670,10 +683,8 @@ } /*Quantity received is != 0 */ } /*end of OrderLine loop */ - - - if ($_SESSION['PO'.$identifier]->AllLinesReceived()==1) { //all lines on the purchase order are now completed - $StatusComment=date($_SESSION['DefaultDateFormat']) .' - ' . _('Order Completed') .'<br />' . $_SESSION['PO'.$identifier]->StatusComments; + if ($_SESSION['PO'.$identifier]->AllLinesReceived()==1 OR $OrderCompleted) { //all lines on the purchase order are now completed + $StatusComment=date($_SESSION['DefaultDateFormat']) .' - ' . _('Order Completed on entry of GRN') .'<br />' . $_SESSION['PO'.$identifier]->StatusComments; $sql="UPDATE purchorders SET status='Completed', stat_comment='" . $StatusComment . "' Modified: trunk/PO_Items.php =================================================================== --- trunk/PO_Items.php 2011-08-10 10:21:25 UTC (rev 4655) +++ trunk/PO_Items.php 2011-08-11 10:08:05 UTC (rev 4656) @@ -83,7 +83,8 @@ } else { $UserDetails = ' ' . $_SESSION['UsersRealName'] . ' '; } - if ($_SESSION['AutoAuthorisePO']==1) { //if the user has authority to authorise the PO then it will automatically be authorised + if ($_SESSION['AutoAuthorisePO']==1) { + //if the user has authority to authorise the PO then it will automatically be authorised $AuthSQL ="SELECT authlevel FROM purchorderauth WHERE userid='".$_SESSION['UserID']."' @@ -233,7 +234,23 @@ prnMsg(_('Purchase Order') . ' ' . $_SESSION['PO'.$identifier]->OrderNo . ' ' . _('on') . ' ' . $_SESSION['PO'.$identifier]->SupplierName . ' ' . _('has been created'),'success'); } else { /*its an existing order need to update the old order info */ - + /*Check to see if there are any incomplete lines on the order */ + $Completed = true; //assume it is completed i.e. all lines are flagged as completed + foreach ($_SESSION['PO'.$identifier]->LineItems as $POLine) { + if ($POLine->Completed==0){ + $Completed = false; + break; + } + } + if ($Completed){ + $_SESSION['PO'.$identifier]->Status = 'Completed'; + if (IsEmailAddress($_SESSION['UserEmail'])){ + $UserChangedStatus = ' <a href="mailto:' . $_SESSION['UserEmail'] . '">' . $_SESSION['UsersRealName']. '</a>'; + } else { + $UserChangedStatus = ' ' . $_SESSION['UsersRealName'] . ' '; + } + $_SESSION['PO'.$identifier]->StatusComments = date($_SESSION['DefaultDateFormat']).' - ' . _('Order completed by') . $UserChangedStatus . '<br />' .$_SESSION['PO'.$identifier]->StatusComments; + } /*Update the purchase order header with any changes */ $sql = "UPDATE purchorders SET supplierno = '" . $_SESSION['PO'.$identifier]->SupplierID . "' , @@ -264,13 +281,14 @@ contact='" . $_SESSION['PO'.$identifier]->Contact . "', paymentterms='" . $_SESSION['PO'.$identifier]->PaymentTerms . "', allowprint='" . $_SESSION['PO'.$identifier]->AllowPrintPO . "', - status = '" . $_SESSION['PO'.$identifier]->Status . "' + status = '" . $_SESSION['PO'.$identifier]->Status . "', + stat_comment = '" . $_SESSION['PO'.$identifier]->StatusComments . "' WHERE orderno = '" . $_SESSION['PO'.$identifier]->OrderNo ."'"; $ErrMsg = _('The purchase order could not be updated because'); $DbgMsg = _('The SQL statement used to update the purchase order header record, that failed was'); $result = DB_query($sql,$db,$ErrMsg,$DbgMsg,true); - + /*Now Update the purchase order detail records */ foreach ($_SESSION['PO'.$identifier]->LineItems as $POLine) { $result=DB_query($sql,$db,'','',true); @@ -382,6 +400,9 @@ } } +if(isset($_GET['Complete'])){ + $_SESSION['PO'.$identifier]->LineItems[$_GET['Complete']]->Completed=1; +} if (isset($_POST['EnterLine'])){ /*Inputs from the form directly without selecting a stock item from the search */ $AllowUpdate = true; /*always assume the best */ @@ -683,8 +704,13 @@ <td>' . $POLine->SuppliersUnit . '</td> <td><input type="text" class="number" name="SuppPrice' . $POLine->LineNo . '" size="10" value="' . round(($POLine->Price *$POLine->ConversionFactor),$_SESSION['PO'.$identifier]->CurrDecimalPlaces) .'"></td> <td class="number">' . $DisplayLineTotal . '</td> - <td><input type="text" class="date" alt="' .$_SESSION['DefaultDateFormat'].'" name="ReqDelDate' . $POLine->LineNo.'" size="10" value="' .$POLine->ReqDelDate .'"></td> - <td><a href="' . $_SERVER['PHP_SELF'] . '?identifier='.$identifier. '&Delete=' . $POLine->LineNo . '">' . _('Delete') . '</a></td></tr>'; + <td><input type="text" class="date" alt="' .$_SESSION['DefaultDateFormat'].'" name="ReqDelDate' . $POLine->LineNo.'" size="10" value="' .$POLine->ReqDelDate .'"></td>'; + if ($POLine->QtyReceived !=0 AND $POLine->Completed!=1){ + echo '<td><a href="' . $_SERVER['PHP_SELF'] . '?identifier='.$identifier .'&Complete=' . $POLine->LineNo . '">' . _('Complete') . '</a></td>'; + } elseif ($POLine->QtyReceived ==0) { + echo '<td><a href="' . $_SERVER['PHP_SELF'] . '?identifier='.$identifier .'&Delete=' . $POLine->LineNo . '">' . _('Delete'). '</a></td>'; + } + echo '</tr>'; $_SESSION['PO'.$identifier]->Total += $LineTotal; } } Modified: trunk/doc/Change.log =================================================================== --- trunk/doc/Change.log 2011-08-10 10:21:25 UTC (rev 4655) +++ trunk/doc/Change.log 2011-08-11 10:08:05 UTC (rev 4656) @@ -1,5 +1,7 @@ webERP Change Log +11/8/11 Phil: GoodsReceived.php now has checkbox to flag the order line as complete - even though the quantity delivered might be short of the order quantity. +11/8/11 Phil: PO_Items.php link to complete uncompleted lines - status of order is changed to complete is all lines are completed 10/8/11 Phil: POReport.php added link to detail purchase order inquiry 10/8/11 Phil: PO_SelectPurchOrder.php and outstanding purchase order searches now show the delivery date (from the purchase order header) line items may have different delivery dates. 10/8/11 Phil: Stocks.php changing the stock category to one with a different stock account now creates a journal (if stock is linked to GL) to move the cost of the stock from the old GL account to the new GL account Modified: trunk/includes/DefinePOClass.php =================================================================== --- trunk/includes/DefinePOClass.php 2011-08-10 10:21:25 UTC (rev 4655) +++ trunk/includes/DefinePOClass.php 2011-08-11 10:08:05 UTC (rev 4656) @@ -93,7 +93,7 @@ $GLCode, $ReqDelDate, $ShiptRef, - 0, + $Completed, $JobRef, $QtyInv, $QtyRecd, @@ -276,7 +276,8 @@ $this->Deleted = false; $this->SerialItems = array(); /*if Controlled then need to populate this later */ $this->SerialItemsValid=false; - $this->AssetID= $AssetID; + $this->AssetID = $AssetID; + } } ?> \ No newline at end of file This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <dai...@us...> - 2011-08-12 11:01:42
|
Revision: 4657 http://web-erp.svn.sourceforge.net/web-erp/?rev=4657&view=rev Author: daintree Date: 2011-08-12 11:01:35 +0000 (Fri, 12 Aug 2011) Log Message: ----------- 12/8/11 Phil: Backed out changes on 7/8 that prevented SelectProduct.php transaction links - now only purchase order links blocked if an item is obsolete 12/8/11 Phil: CounterSales.php apply discountmatrix fixes Modified Paths: -------------- trunk/CounterSales.php trunk/SelectProduct.php trunk/doc/Change.log Modified: trunk/CounterSales.php =================================================================== --- trunk/CounterSales.php 2011-08-11 10:08:05 UTC (rev 4656) +++ trunk/CounterSales.php 2011-08-12 11:01:35 UTC (rev 4657) @@ -665,38 +665,43 @@ } -/* Run through each line of the order and work out the appropriate discount from the discount matrix */ +/* Now Run through each line of the order again to work out the appropriate discount from the discount matrix */ $DiscCatsDone = array(); -$counter =0; foreach ($_SESSION['Items'.$identifier]->LineItems as $OrderLine) { if ($OrderLine->DiscCat !='' AND ! in_array($OrderLine->DiscCat,$DiscCatsDone)){ - $DiscCatsDone[$counter]=$OrderLine->DiscCat; - $QuantityOfDiscCat =0; + $DiscCatsDone[]=$OrderLine->DiscCat; + $QuantityOfDiscCat = 0; - foreach ($_SESSION['Items'.$identifier]->LineItems as $StkItems_2) { + foreach ($_SESSION['Items'.$identifier]->LineItems as $OrderLine_2) { /* add up total quantity of all lines of this DiscCat */ - if ($StkItems_2->DiscCat==$OrderLine->DiscCat){ - $QuantityOfDiscCat += $StkItems_2->Quantity; + if ($OrderLine_2->DiscCat==$OrderLine->DiscCat){ + $QuantityOfDiscCat += $OrderLine_2->Quantity; } } $result = DB_query("SELECT MAX(discountrate) AS discount FROM discountmatrix WHERE salestype='" . $_SESSION['Items'.$identifier]->DefaultSalesType . "' AND discountcategory ='" . $OrderLine->DiscCat . "' - AND quantitybreak <'" . $QuantityOfDiscCat . "'",$db); + AND quantitybreak <= '" . $QuantityOfDiscCat ."'",$db); $myrow = DB_fetch_row($result); + if ($myrow[0]==NULL){ + $DiscountMatrixRate = 0; + } else { + $DiscountMatrixRate = $myrow[0]; + } if ($myrow[0]!=0){ /* need to update the lines affected */ - foreach ($_SESSION['Items'.$identifier]->LineItems as $StkItems_2) { - /* add up total quantity of all lines of this DiscCat */ - if ($StkItems_2->DiscCat==$OrderLine->DiscCat AND $StkItems_2->DiscountPercent == 0){ - $_SESSION['Items'.$identifier]->LineItems[$StkItems_2->LineNumber]->DiscountPercent = $myrow[0]; + foreach ($_SESSION['Items'.$identifier]->LineItems as $OrderLine_2) { + if ($OrderLine_2->DiscCat==$OrderLine->DiscCat){ + $_SESSION['Items'.$identifier]->LineItems[$OrderLine_2->LineNumber]->DiscountPercent = $DiscountMatrixRate; + $_SESSION['Items'.$identifier]->LineItems[$OrderLine_2->LineNumber]->GPPercent = (($_SESSION['Items'.$identifier]->LineItems[$OrderLine_2->LineNumber]->Price*(1-$DiscountMatrixRate)) - $_SESSION['Items'.$identifier]->LineItems[$OrderLine_2->LineNumber]->StandardCost*$ExRate)/($_SESSION['Items'.$identifier]->LineItems[$OrderLine_2->LineNumber]->Price *(1-$DiscountMatrixRate)/100); } } } } } /* end of discount matrix lookup code */ + if (count($_SESSION['Items'.$identifier]->LineItems)>0 AND !isset($_POST['ProcessSale'])){ /*only show order lines if there are any */ /* @@ -877,7 +882,7 @@ * Invoice Processing Here * ********************************** * */ -if (isset($_POST['ProcessSale']) and $_POST['ProcessSale'] != ""){ +if (isset($_POST['ProcessSale']) and $_POST['ProcessSale'] != ''){ $InputError = false; //always assume the best //but check for the worst @@ -952,7 +957,7 @@ /* Now Get the area where the sale is to from the branches table */ $SQL = "SELECT area, - defaultshipvia + defaultshipvia FROM custbranch WHERE custbranch.debtorno ='". $_SESSION['Items'.$identifier]->DebtorNo . "' AND custbranch.branchcode = '" . $_SESSION['Items'.$identifier]->Branch . "'"; @@ -1358,35 +1363,33 @@ if (empty($AssParts['standard'])) { $AssParts['standard']=0; } - $SQL = "INSERT INTO stockmoves ( - stockid, - type, - transno, - loccode, - trandate, - debtorno, - branchcode, - prd, - reference, - qty, - standardcost, - show_on_inv_crds, - newqoh - ) VALUES ( - '" . $AssParts['component'] . "', - 10, - '" . $InvoiceNo . "', - '" . $_SESSION['Items'.$identifier]->Location . "', - '" . $DefaultDispatchDate . "', - '" . $_SESSION['Items'.$identifier]->DebtorNo . "', - '" . $_SESSION['Items'.$identifier]->Branch . "', - '" . $PeriodNo . "', - '" . _('Assembly') . ': ' . $OrderLine->StockID . ' ' . _('Order') . ': ' . $OrderNo . "', - '" . -$AssParts['quantity'] * $OrderLine->Quantity . "', - '" . $AssParts['standard'] . "', - 0, - newqoh-" . ($AssParts['quantity'] * $OrderLine->Quantity) . " - )"; + $SQL = "INSERT INTO stockmoves (stockid, + type, + transno, + loccode, + trandate, + debtorno, + branchcode, + prd, + reference, + qty, + standardcost, + show_on_inv_crds, + newqoh + ) VALUES ( + '" . $AssParts['component'] . "', + 10, + '" . $InvoiceNo . "', + '" . $_SESSION['Items'.$identifier]->Location . "', + '" . $DefaultDispatchDate . "', + '" . $_SESSION['Items'.$identifier]->DebtorNo . "', + '" . $_SESSION['Items'.$identifier]->Branch . "', + '" . $PeriodNo . "', + '" . _('Assembly') . ': ' . $OrderLine->StockID . ' ' . _('Order') . ': ' . $OrderNo . "', + '" . -$AssParts['quantity'] * $OrderLine->Quantity . "', + '" . $AssParts['standard'] . "', + 0, + newqoh-" . ($AssParts['quantity'] * $OrderLine->Quantity) . " )"; $ErrMsg = _('CRITICAL ERROR') . '! ' . _('NOTE DOWN THIS ERROR AND SEEK ASSISTANCE') . ': ' . _('Stock movement records for the assembly components of'). ' '. $OrderLine->StockID . ' ' . _('could not be inserted because'); $DbgMsg = _('The following SQL to insert the assembly components stock movement records was used'); @@ -1451,35 +1454,34 @@ if (empty($OrderLine->StandardCost)) { $OrderLine->StandardCost = 0; } - $SQL = "INSERT INTO stockmoves ( - stockid, - type, - transno, - loccode, - trandate, - debtorno, - branchcode, - price, - prd, - reference, - qty, - discountpercent, - standardcost, - narrative ) - VALUES ('" . $OrderLine->StockID . "', - 10, - '" . $InvoiceNo . "', - '" . $_SESSION['Items'.$identifier]->Location . "', - '" . $DefaultDispatchDate . "', - '" . $_SESSION['Items'.$identifier]->DebtorNo . "', - '" . $_SESSION['Items'.$identifier]->Branch . "', - '" . $LocalCurrencyPrice . "', - '" . $PeriodNo . "', - '" . $OrderNo . "', - '" . -$OrderLine->Quantity . "', - '" . $OrderLine->DiscountPercent . "', - '" . $OrderLine->StandardCost . "', - '" . DB_escape_string($OrderLine->Narrative) . "')"; + $SQL = "INSERT INTO stockmoves (stockid, + type, + transno, + loccode, + trandate, + debtorno, + branchcode, + price, + prd, + reference, + qty, + discountpercent, + standardcost, + narrative ) + VALUES ('" . $OrderLine->StockID . "', + 10, + '" . $InvoiceNo . "', + '" . $_SESSION['Items'.$identifier]->Location . "', + '" . $DefaultDispatchDate . "', + '" . $_SESSION['Items'.$identifier]->DebtorNo . "', + '" . $_SESSION['Items'.$identifier]->Branch . "', + '" . $LocalCurrencyPrice . "', + '" . $PeriodNo . "', + '" . $OrderNo . "', + '" . -$OrderLine->Quantity . "', + '" . $OrderLine->DiscountPercent . "', + '" . $OrderLine->StandardCost . "', + '" . DB_escape_string($OrderLine->Narrative) . "')"; } $ErrMsg = _('CRITICAL ERROR') . '! ' . _('NOTE DOWN THIS ERROR AND SEEK ASSISTANCE') . ': ' . _('Stock movement records could not be inserted because'); Modified: trunk/SelectProduct.php =================================================================== --- trunk/SelectProduct.php 2011-08-11 10:08:05 UTC (rev 4656) +++ trunk/SelectProduct.php 2011-08-12 11:01:35 UTC (rev 4657) @@ -303,17 +303,17 @@ $DemRow = DB_fetch_row($DemResult); $Demand = $DemRow[0]; $DemAsComponentResult = DB_query("SELECT SUM((salesorderdetails.quantity-salesorderdetails.qtyinvoiced)*bom.quantity) AS dem - FROM salesorderdetails, - salesorders, - bom, - stockmaster - WHERE salesorderdetails.stkcode=bom.parent - AND salesorders.orderno = salesorderdetails.orderno - AND salesorderdetails.quantity-salesorderdetails.qtyinvoiced > 0 - AND bom.component='" . $StockID . "' - AND stockmaster.stockid=bom.parent - AND stockmaster.mbflag='A' - AND salesorders.quotation=0", $db); + FROM salesorderdetails, + salesorders, + bom, + stockmaster + WHERE salesorderdetails.stkcode=bom.parent + AND salesorders.orderno = salesorderdetails.orderno + AND salesorderdetails.quantity-salesorderdetails.qtyinvoiced > 0 + AND bom.component='" . $StockID . "' + AND stockmaster.stockid=bom.parent + AND stockmaster.mbflag='A' + AND salesorders.quotation=0", $db); $DemAsComponentRow = DB_fetch_row($DemAsComponentResult); $Demand+= $DemAsComponentRow[0]; //Also the demand for the item as a component of works orders @@ -417,7 +417,7 @@ wikiLink('Product', $StockID); echo '</td><td valign="top" class="select">'; /* Stock Transactions */ -if ($Its_A_Kitset_Assembly_Or_Dummy == false AND $myrow['discontinued']==0) { +if ($Its_A_Kitset_Assembly_Or_Dummy == false) { echo '<a href="' . $rootpath . '/StockAdjustments.php?StockID=' . $StockID . '">' . _('Quantity Adjustments') . '</a><br />'; echo '<a href="' . $rootpath . '/StockTransfers.php?StockID=' . $StockID . '">' . _('Location Transfers') . '</a><br />'; //show the item image if it has been uploaded Modified: trunk/doc/Change.log =================================================================== --- trunk/doc/Change.log 2011-08-11 10:08:05 UTC (rev 4656) +++ trunk/doc/Change.log 2011-08-12 11:01:35 UTC (rev 4657) @@ -1,5 +1,7 @@ webERP Change Log +12/8/11 Phil: Backed out changes on 7/8 that prevented SelectProduct.php transaction links - now only purchase order links blocked if an item is obsolete +12/8/11 Phil: CounterSales.php apply discountmatrix fixes 11/8/11 Phil: GoodsReceived.php now has checkbox to flag the order line as complete - even though the quantity delivered might be short of the order quantity. 11/8/11 Phil: PO_Items.php link to complete uncompleted lines - status of order is changed to complete is all lines are completed 10/8/11 Phil: POReport.php added link to detail purchase order inquiry This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <dai...@us...> - 2011-08-12 11:01:42
|
Revision: 4657 http://web-erp.svn.sourceforge.net/web-erp/?rev=4657&view=rev Author: daintree Date: 2011-08-12 11:01:35 +0000 (Fri, 12 Aug 2011) Log Message: ----------- 12/8/11 Phil: Backed out changes on 7/8 that prevented SelectProduct.php transaction links - now only purchase order links blocked if an item is obsolete 12/8/11 Phil: CounterSales.php apply discountmatrix fixes Modified Paths: -------------- trunk/CounterSales.php trunk/SelectProduct.php trunk/doc/Change.log Modified: trunk/CounterSales.php =================================================================== --- trunk/CounterSales.php 2011-08-11 10:08:05 UTC (rev 4656) +++ trunk/CounterSales.php 2011-08-12 11:01:35 UTC (rev 4657) @@ -665,38 +665,43 @@ } -/* Run through each line of the order and work out the appropriate discount from the discount matrix */ +/* Now Run through each line of the order again to work out the appropriate discount from the discount matrix */ $DiscCatsDone = array(); -$counter =0; foreach ($_SESSION['Items'.$identifier]->LineItems as $OrderLine) { if ($OrderLine->DiscCat !='' AND ! in_array($OrderLine->DiscCat,$DiscCatsDone)){ - $DiscCatsDone[$counter]=$OrderLine->DiscCat; - $QuantityOfDiscCat =0; + $DiscCatsDone[]=$OrderLine->DiscCat; + $QuantityOfDiscCat = 0; - foreach ($_SESSION['Items'.$identifier]->LineItems as $StkItems_2) { + foreach ($_SESSION['Items'.$identifier]->LineItems as $OrderLine_2) { /* add up total quantity of all lines of this DiscCat */ - if ($StkItems_2->DiscCat==$OrderLine->DiscCat){ - $QuantityOfDiscCat += $StkItems_2->Quantity; + if ($OrderLine_2->DiscCat==$OrderLine->DiscCat){ + $QuantityOfDiscCat += $OrderLine_2->Quantity; } } $result = DB_query("SELECT MAX(discountrate) AS discount FROM discountmatrix WHERE salestype='" . $_SESSION['Items'.$identifier]->DefaultSalesType . "' AND discountcategory ='" . $OrderLine->DiscCat . "' - AND quantitybreak <'" . $QuantityOfDiscCat . "'",$db); + AND quantitybreak <= '" . $QuantityOfDiscCat ."'",$db); $myrow = DB_fetch_row($result); + if ($myrow[0]==NULL){ + $DiscountMatrixRate = 0; + } else { + $DiscountMatrixRate = $myrow[0]; + } if ($myrow[0]!=0){ /* need to update the lines affected */ - foreach ($_SESSION['Items'.$identifier]->LineItems as $StkItems_2) { - /* add up total quantity of all lines of this DiscCat */ - if ($StkItems_2->DiscCat==$OrderLine->DiscCat AND $StkItems_2->DiscountPercent == 0){ - $_SESSION['Items'.$identifier]->LineItems[$StkItems_2->LineNumber]->DiscountPercent = $myrow[0]; + foreach ($_SESSION['Items'.$identifier]->LineItems as $OrderLine_2) { + if ($OrderLine_2->DiscCat==$OrderLine->DiscCat){ + $_SESSION['Items'.$identifier]->LineItems[$OrderLine_2->LineNumber]->DiscountPercent = $DiscountMatrixRate; + $_SESSION['Items'.$identifier]->LineItems[$OrderLine_2->LineNumber]->GPPercent = (($_SESSION['Items'.$identifier]->LineItems[$OrderLine_2->LineNumber]->Price*(1-$DiscountMatrixRate)) - $_SESSION['Items'.$identifier]->LineItems[$OrderLine_2->LineNumber]->StandardCost*$ExRate)/($_SESSION['Items'.$identifier]->LineItems[$OrderLine_2->LineNumber]->Price *(1-$DiscountMatrixRate)/100); } } } } } /* end of discount matrix lookup code */ + if (count($_SESSION['Items'.$identifier]->LineItems)>0 AND !isset($_POST['ProcessSale'])){ /*only show order lines if there are any */ /* @@ -877,7 +882,7 @@ * Invoice Processing Here * ********************************** * */ -if (isset($_POST['ProcessSale']) and $_POST['ProcessSale'] != ""){ +if (isset($_POST['ProcessSale']) and $_POST['ProcessSale'] != ''){ $InputError = false; //always assume the best //but check for the worst @@ -952,7 +957,7 @@ /* Now Get the area where the sale is to from the branches table */ $SQL = "SELECT area, - defaultshipvia + defaultshipvia FROM custbranch WHERE custbranch.debtorno ='". $_SESSION['Items'.$identifier]->DebtorNo . "' AND custbranch.branchcode = '" . $_SESSION['Items'.$identifier]->Branch . "'"; @@ -1358,35 +1363,33 @@ if (empty($AssParts['standard'])) { $AssParts['standard']=0; } - $SQL = "INSERT INTO stockmoves ( - stockid, - type, - transno, - loccode, - trandate, - debtorno, - branchcode, - prd, - reference, - qty, - standardcost, - show_on_inv_crds, - newqoh - ) VALUES ( - '" . $AssParts['component'] . "', - 10, - '" . $InvoiceNo . "', - '" . $_SESSION['Items'.$identifier]->Location . "', - '" . $DefaultDispatchDate . "', - '" . $_SESSION['Items'.$identifier]->DebtorNo . "', - '" . $_SESSION['Items'.$identifier]->Branch . "', - '" . $PeriodNo . "', - '" . _('Assembly') . ': ' . $OrderLine->StockID . ' ' . _('Order') . ': ' . $OrderNo . "', - '" . -$AssParts['quantity'] * $OrderLine->Quantity . "', - '" . $AssParts['standard'] . "', - 0, - newqoh-" . ($AssParts['quantity'] * $OrderLine->Quantity) . " - )"; + $SQL = "INSERT INTO stockmoves (stockid, + type, + transno, + loccode, + trandate, + debtorno, + branchcode, + prd, + reference, + qty, + standardcost, + show_on_inv_crds, + newqoh + ) VALUES ( + '" . $AssParts['component'] . "', + 10, + '" . $InvoiceNo . "', + '" . $_SESSION['Items'.$identifier]->Location . "', + '" . $DefaultDispatchDate . "', + '" . $_SESSION['Items'.$identifier]->DebtorNo . "', + '" . $_SESSION['Items'.$identifier]->Branch . "', + '" . $PeriodNo . "', + '" . _('Assembly') . ': ' . $OrderLine->StockID . ' ' . _('Order') . ': ' . $OrderNo . "', + '" . -$AssParts['quantity'] * $OrderLine->Quantity . "', + '" . $AssParts['standard'] . "', + 0, + newqoh-" . ($AssParts['quantity'] * $OrderLine->Quantity) . " )"; $ErrMsg = _('CRITICAL ERROR') . '! ' . _('NOTE DOWN THIS ERROR AND SEEK ASSISTANCE') . ': ' . _('Stock movement records for the assembly components of'). ' '. $OrderLine->StockID . ' ' . _('could not be inserted because'); $DbgMsg = _('The following SQL to insert the assembly components stock movement records was used'); @@ -1451,35 +1454,34 @@ if (empty($OrderLine->StandardCost)) { $OrderLine->StandardCost = 0; } - $SQL = "INSERT INTO stockmoves ( - stockid, - type, - transno, - loccode, - trandate, - debtorno, - branchcode, - price, - prd, - reference, - qty, - discountpercent, - standardcost, - narrative ) - VALUES ('" . $OrderLine->StockID . "', - 10, - '" . $InvoiceNo . "', - '" . $_SESSION['Items'.$identifier]->Location . "', - '" . $DefaultDispatchDate . "', - '" . $_SESSION['Items'.$identifier]->DebtorNo . "', - '" . $_SESSION['Items'.$identifier]->Branch . "', - '" . $LocalCurrencyPrice . "', - '" . $PeriodNo . "', - '" . $OrderNo . "', - '" . -$OrderLine->Quantity . "', - '" . $OrderLine->DiscountPercent . "', - '" . $OrderLine->StandardCost . "', - '" . DB_escape_string($OrderLine->Narrative) . "')"; + $SQL = "INSERT INTO stockmoves (stockid, + type, + transno, + loccode, + trandate, + debtorno, + branchcode, + price, + prd, + reference, + qty, + discountpercent, + standardcost, + narrative ) + VALUES ('" . $OrderLine->StockID . "', + 10, + '" . $InvoiceNo . "', + '" . $_SESSION['Items'.$identifier]->Location . "', + '" . $DefaultDispatchDate . "', + '" . $_SESSION['Items'.$identifier]->DebtorNo . "', + '" . $_SESSION['Items'.$identifier]->Branch . "', + '" . $LocalCurrencyPrice . "', + '" . $PeriodNo . "', + '" . $OrderNo . "', + '" . -$OrderLine->Quantity . "', + '" . $OrderLine->DiscountPercent . "', + '" . $OrderLine->StandardCost . "', + '" . DB_escape_string($OrderLine->Narrative) . "')"; } $ErrMsg = _('CRITICAL ERROR') . '! ' . _('NOTE DOWN THIS ERROR AND SEEK ASSISTANCE') . ': ' . _('Stock movement records could not be inserted because'); Modified: trunk/SelectProduct.php =================================================================== --- trunk/SelectProduct.php 2011-08-11 10:08:05 UTC (rev 4656) +++ trunk/SelectProduct.php 2011-08-12 11:01:35 UTC (rev 4657) @@ -303,17 +303,17 @@ $DemRow = DB_fetch_row($DemResult); $Demand = $DemRow[0]; $DemAsComponentResult = DB_query("SELECT SUM((salesorderdetails.quantity-salesorderdetails.qtyinvoiced)*bom.quantity) AS dem - FROM salesorderdetails, - salesorders, - bom, - stockmaster - WHERE salesorderdetails.stkcode=bom.parent - AND salesorders.orderno = salesorderdetails.orderno - AND salesorderdetails.quantity-salesorderdetails.qtyinvoiced > 0 - AND bom.component='" . $StockID . "' - AND stockmaster.stockid=bom.parent - AND stockmaster.mbflag='A' - AND salesorders.quotation=0", $db); + FROM salesorderdetails, + salesorders, + bom, + stockmaster + WHERE salesorderdetails.stkcode=bom.parent + AND salesorders.orderno = salesorderdetails.orderno + AND salesorderdetails.quantity-salesorderdetails.qtyinvoiced > 0 + AND bom.component='" . $StockID . "' + AND stockmaster.stockid=bom.parent + AND stockmaster.mbflag='A' + AND salesorders.quotation=0", $db); $DemAsComponentRow = DB_fetch_row($DemAsComponentResult); $Demand+= $DemAsComponentRow[0]; //Also the demand for the item as a component of works orders @@ -417,7 +417,7 @@ wikiLink('Product', $StockID); echo '</td><td valign="top" class="select">'; /* Stock Transactions */ -if ($Its_A_Kitset_Assembly_Or_Dummy == false AND $myrow['discontinued']==0) { +if ($Its_A_Kitset_Assembly_Or_Dummy == false) { echo '<a href="' . $rootpath . '/StockAdjustments.php?StockID=' . $StockID . '">' . _('Quantity Adjustments') . '</a><br />'; echo '<a href="' . $rootpath . '/StockTransfers.php?StockID=' . $StockID . '">' . _('Location Transfers') . '</a><br />'; //show the item image if it has been uploaded Modified: trunk/doc/Change.log =================================================================== --- trunk/doc/Change.log 2011-08-11 10:08:05 UTC (rev 4656) +++ trunk/doc/Change.log 2011-08-12 11:01:35 UTC (rev 4657) @@ -1,5 +1,7 @@ webERP Change Log +12/8/11 Phil: Backed out changes on 7/8 that prevented SelectProduct.php transaction links - now only purchase order links blocked if an item is obsolete +12/8/11 Phil: CounterSales.php apply discountmatrix fixes 11/8/11 Phil: GoodsReceived.php now has checkbox to flag the order line as complete - even though the quantity delivered might be short of the order quantity. 11/8/11 Phil: PO_Items.php link to complete uncompleted lines - status of order is changed to complete is all lines are completed 10/8/11 Phil: POReport.php added link to detail purchase order inquiry This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <dai...@us...> - 2011-08-14 04:28:49
|
Revision: 4658 http://web-erp.svn.sourceforge.net/web-erp/?rev=4658&view=rev Author: daintree Date: 2011-08-14 04:28:42 +0000 (Sun, 14 Aug 2011) Log Message: ----------- 14/8/11 Phil: Stocks.php now does a journal for any work in progress on a change of category where the new category has a different GL account for WIP - and bug fixes as per Ricard Modified Paths: -------------- trunk/Stocks.php trunk/WorkOrderCosting.php trunk/doc/Change.log trunk/includes/session.inc trunk/install/save.php Modified: trunk/Stocks.php =================================================================== --- trunk/Stocks.php 2011-08-12 11:01:35 UTC (rev 4657) +++ trunk/Stocks.php 2011-08-14 04:28:42 UTC (rev 4658) @@ -5,6 +5,7 @@ include('includes/session.inc'); $title = _('Item Maintenance'); include('includes/header.inc'); +include('includes/SQL_CommonFunctions.inc'); /*If this form is called with the StockID then it is assumed that the stock item is to be modified */ @@ -213,7 +214,8 @@ controlled, serialised, materialcost+labourcost+overheadcost AS itemcost, - stockcategory.stockact + stockcategory.stockact, + stockcategory.wipact FROM stockmaster INNER JOIN stockcategory ON stockmaster.categoryid=stockcategory.categoryid @@ -225,6 +227,8 @@ $OldSerialised = $myrow[2]; $UnitCost = $myrow[3]; $OldStockAccount = $myrow[4]; + $OldWIPAccount = $myrow[5]; + $sql = "SELECT SUM(locstock.quantity) FROM locstock @@ -235,12 +239,14 @@ /*Now check the GL account of the new category to see if it is different to the old stock gl account */ - $result = DB_query("SELECT stockact + $result = DB_query("SELECT stockact, + wipact FROM stockcategory WHERE categoryid='" . $_POST['CategoryID'] . "'", $db); $NewStockActRow = DB_fetch_array($result); $NewStockAct = $NewStockActRow['stockact']; + $NewWIPAct = $NewStockActRow['wipact']; if ($OldMBFlag != $_POST['MBFlag']){ if (($OldMBFlag == 'M' OR $OldMBFlag=='B') AND ($_POST['MBFlag']=='A' OR $_POST['MBFlag']=='K' OR $_POST['MBFlag']=='D' OR $_POST['MBFlag']=='G')){ /*then need to check that there is no stock holding first */ @@ -378,7 +384,7 @@ $db,$ErrMsg,$DbgMsg,true); } //end of loop around properties defined for the category - if ($OldStockAccount != $NewStockAct AND $_SESSION['CompanyRecord']['gllinkstock']==1) { + if ($OldStockAccount != $NewStockAct AND $_SESSION['CompanyRecord']['gllink_stock']==1) { /*Then we need to make a journal to transfer the cost to the new stock account */ $JournalNo = GetNextTransNo(0,$db); //enter as a journal $SQL = "INSERT INTO gltrans (type, @@ -391,13 +397,13 @@ VALUES ( 0, '" . $JournalNo . "', '" . Date('Y-m-d') . "', - '" . GetPeriodNo(Date('Y-m-d'),true) . "', + '" . GetPeriod(Date('Y-m-d'),$db,true) . "', '" . $NewStockAccount . "', '" . $StockID . ' ' . _('Change stock category') . "', '" . ($UnitCost* $StockQtyRow[0]) . "'"; $ErrMsg = _('The stock cost journal could not be inserted because'); $DbgMsg = _('The SQL that was used to create the stock cost journal and failed was'); - $result = DB_query($sql,$db, $ErrMsg, $DbgMsg,true); + $result = DB_query($SQL,$db, $ErrMsg, $DbgMsg,true); $SQL = "INSERT INTO gltrans (type, typeno, trandate, @@ -408,13 +414,68 @@ VALUES ( 0, '" . $JournalNo . "', '" . Date('Y-m-d') . "', - '" . GetPeriodNo(Date('Y-m-d'),true) . "', + '" . GetPeriod(Date('Y-m-d'),$db,true) . "', '" . $OldStockAccount . "', '" . $StockID . ' ' . _('Change stock category') . "', '" . (-$UnitCost* $StockQtyRow[0]) . "'"; - $result = DB_query($sql,$db, $ErrMsg, $DbgMsg,true); + $result = DB_query($SQL,$db, $ErrMsg, $DbgMsg,true); } /* end if the stock category changed and forced a change in stock cost account */ + if ($OldWIPAccount != $NewWIPAct AND $_SESSION['CompanyRecord']['gllink_stock']==1) { + /*Then we need to make a journal to transfer the cost of WIP to the new WIP account */ + /*First get the total cost of WIP for this category */ + + $WOCostsResult = DB_query("SELECT workorders.costissued, + SUM(woitems.qtyreqd * woitems.stdcost) AS costrecd + FROM woitems INNER JOIN workorders + ON woitems.wo = workorders.wo + INNER JOIN stockmaster + ON woitems.stockid=stockmaster.stockid + WHERE stockmaster.stockid='". $StockID . "' + AND workorders.closed=0 + GROUP BY workorders.costissued", + $db, + _('Error retrieving value of finished goods received and cost issued against work orders for this item')); + $WIPValue = 0; + while ($WIPRow=DB_fetch_array($WOCostsResult)){ + $WIPValue += ($WIPRow['costissued']-$WIPRow['costrecd']); + } + if ($WIPValue !=0){ + $JournalNo = GetNextTransNo(0,$db); //enter as a journal + $SQL = "INSERT INTO gltrans (type, + typeno, + trandate, + periodno, + account, + narrative, + amount) + VALUES ( 0, + '" . $JournalNo . "', + '" . Date('Y-m-d') . "', + '" . GetPeriod(Date('Y-m-d'),$db,true) . "', + '" . $NewWIPAct . "', + '" . $StockID . ' ' . _('Change stock category') . "', + '" . $WIPValue . "'"; + $ErrMsg = _('The WIP cost journal could not be inserted because'); + $DbgMsg = _('The SQL that was used to create the WIP cost journal and failed was'); + $result = DB_query($SQL,$db, $ErrMsg, $DbgMsg,true); + $SQL = "INSERT INTO gltrans (type, + typeno, + trandate, + periodno, + account, + narrative, + amount) + VALUES ( 0, + '" . $JournalNo . "', + '" . Date('Y-m-d') . "', + '" . GetPeriod(Date('Y-m-d'),true) . "', + '" . $OldWIPAccount . "', + '" . $StockID . ' ' . _('Change stock category') . "', + '" . (-$WIPValue) . "'"; + $result = DB_query($SQL,$db, $ErrMsg, $DbgMsg,true); + } + } /* end if the stock category changed and forced a change in WIP account */ DB_Txn_Commit($db); prnMsg( _('Stock Item') . ' ' . $StockID . ' ' . _('has been updated'), 'success'); echo '<br />'; @@ -512,11 +573,12 @@ unset($_POST['ShrinkFactor']); unset($_POST['Pansize']); unset($StockID); + $New=1; }//ALL WORKED SO RESET THE FORM VARIABLES }//THE INSERT OF THE NEW CODE WORKED SO BANG IN THE STOCK LOCATION RECORDS TOO }//END CHECK FOR ALREADY EXISTING ITEM OF THE SAME CODE } - $New=1; + } else { echo '<br />'. "\n"; Modified: trunk/WorkOrderCosting.php =================================================================== --- trunk/WorkOrderCosting.php 2011-08-12 11:01:35 UTC (rev 4657) +++ trunk/WorkOrderCosting.php 2011-08-14 04:28:42 UTC (rev 4658) @@ -77,7 +77,7 @@ $db, $ErrMsg); -echo '<table class=selection><tr><th>' . _('Item') . '</th> +echo '<table class="selection"><tr><th>' . _('Item') . '</th> <th>' . _('Description') . '</th> <th>' . _('Quantity Required') . '</th> <th>' . _('Units') . '</th> @@ -91,12 +91,12 @@ echo '<tr><td>' . $WORow['stockid'] . '</td> <td>' . $WORow['description'] . '</td> - <td class=number>' . number_format($WORow['qtyreqd'],$WORow['decimalplaces']) . '</td> + <td class="number">' . number_format($WORow['qtyreqd'],$WORow['decimalplaces']) . '</td> <td>' . $WORow['units'] . '</td> - <td class=number>' . number_format($WORow['qtyrecd'],$WORow['decimalplaces']) . '</td> - <td class=number><a href="'. $rootpath . '/WorkOrderStatus.php?WO=' . $_POST['WO'] . '&StockID=' . $WORow['stockid'] . '">' . _('Status') . '</a></td> - <td class=number><a href="'. $rootpath . '/WorkOrderReceive.php?WO=' . $_POST['WO'] . '&StockID=' . $WORow['stockid'] . '">' . _('Receive') . '</a></td> - <td class=number><a href="'. $rootpath . '/WorkOrderIssue.php?WO=' . $_POST['WO'] . '&StockID=' . $WORow['stockid'] . '">' . _('Issue') . '</a></td> + <td class="number">' . number_format($WORow['qtyrecd'],$WORow['decimalplaces']) . '</td> + <td class="number"><a href="'. $rootpath . '/WorkOrderStatus.php?WO=' . $_POST['WO'] . '&StockID=' . $WORow['stockid'] . '">' . _('Status') . '</a></td> + <td class="number"><a href="'. $rootpath . '/WorkOrderReceive.php?WO=' . $_POST['WO'] . '&StockID=' . $WORow['stockid'] . '">' . _('Receive') . '</a></td> + <td class="number"><a href="'. $rootpath . '/WorkOrderIssue.php?WO=' . $_POST['WO'] . '&StockID=' . $WORow['stockid'] . '">' . _('Issue') . '</a></td> </tr>'; $TotalStdValueRecd +=($WORow['stdcost']*$WORow['qtyrecd']); @@ -174,8 +174,8 @@ echo '<tr class="OddTableRows">'; } echo '<td colspan=4></td><td>' . ConvertSQLDate($IssuesRow['trandate']) . '</td> - <td class=number>' . number_format(-$IssuesRow['qty'],$RequirementsRow['decimalplaces']) . '</td> - <td class=number>' . number_format(-($IssuesRow['qty']*$IssuesRow['standardcost']),$IssuesRow['decimalplaces']) . '</td></tr>'; + <td class="number">' . number_format(-$IssuesRow['qty'],$RequirementsRow['decimalplaces']) . '</td> + <td class="number">' . number_format(-($IssuesRow['qty']*$IssuesRow['standardcost']),$IssuesRow['decimalplaces']) . '</td></tr>'; $IssueQty -= $IssuesRow['qty'];// because qty for the stock movement will be negative $IssueCost -= ($IssuesRow['qty']*$IssuesRow['standardcost']); @@ -201,13 +201,13 @@ /*Required quantity is the quantity required of the component based on the quantity of the finished item received */ $UsageVar =($RequirementsRow['requiredqty']-$IssueQty)*($RequirementsRow['stdcost']); - echo '<td colspan="2"></td><td class=number>' . number_format($RequirementsRow['requiredqty'],$RequirementsRow['decimalplaces']) . '</td> - <td class=number>' . number_format($RequirementsRow['expectedcost'],$_SESSION['CompanyRecord']['decimalplaces']) . '</td> + echo '<td colspan="2"></td><td class="number">' . number_format($RequirementsRow['requiredqty'],$RequirementsRow['decimalplaces']) . '</td> + <td class="number">' . number_format($RequirementsRow['expectedcost'],$_SESSION['CompanyRecord']['decimalplaces']) . '</td> <td></td> - <td class=number>' . number_format($IssueQty,$RequirementsRow['decimalplaces']) . '</td> - <td class=number>' . number_format($IssueCost,$_SESSION['CompanyRecord']['decimalplaces']) . '</td> - <td class=number>' . number_format($UsageVar,$_SESSION['CompanyRecord']['decimalplaces']) . '</td> - <td class=number>' . number_format($CostVar,$_SESSION['CompanyRecord']['decimalplaces']) . '</td></tr>'; + <td class="number">' . number_format($IssueQty,$RequirementsRow['decimalplaces']) . '</td> + <td class="number">' . number_format($IssueCost,$_SESSION['CompanyRecord']['decimalplaces']) . '</td> + <td class="number">' . number_format($UsageVar,$_SESSION['CompanyRecord']['decimalplaces']) . '</td> + <td class="number">' . number_format($CostVar,$_SESSION['CompanyRecord']['decimalplaces']) . '</td></tr>'; $TotalReqdCost += $RequirementsRow['expectedcost']; $TotalIssuedCost += $IssueCost; $TotalCostVar += $CostVar; @@ -252,13 +252,13 @@ echo '<td>' . $WOIssuesRow['stockid'] . '</td> <td>' . $WOIssuesRow['description'] . '</td> - <td class=number>0</td> - <td class=number>0</td> + <td class="number">0</td> + <td class="number">0</td> <td>' . ConvertSQLDate($WOIssuesRow['trandate']) . '</td> - <td class=number>' . number_format(-$WOIssuesRow['qty'],$WOIssuesRow['decimalplaces']) .'</td> - <td class=number>' . number_format(-$WOIssuesRow['qty']*$WOIssuesRow['standardcost'],$_SESSION['CompanyRecord']['decimalplaces']) .'</td> - <td class=number>' . number_format($WOIssuesRow['qty']*$WOIssuesRow['standardcost'],$_SESSION['CompanyRecord']['decimalplaces']) .'</td> - <td class=number>0</td></tr>'; + <td class="number">' . number_format(-$WOIssuesRow['qty'],$WOIssuesRow['decimalplaces']) .'</td> + <td class="number">' . number_format(-$WOIssuesRow['qty']*$WOIssuesRow['standardcost'],$_SESSION['CompanyRecord']['decimalplaces']) .'</td> + <td class="number">' . number_format($WOIssuesRow['qty']*$WOIssuesRow['standardcost'],$_SESSION['CompanyRecord']['decimalplaces']) .'</td> + <td class="number">0</td></tr>'; $TotalUsageVar += ($WOIssuesRow['qty']*$WOIssuesRow['standardcost']); } @@ -269,13 +269,13 @@ <td colspan="2"></td> <td colspan="3"><hr></td> </tr>'; -echo '<tr><td colspan="2" class=number>' . _('Totals') . '</td> +echo '<tr><td colspan="2" class="number">' . _('Totals') . '</td> <td></td> - <td class=number>' . number_format($TotalReqdCost,$_SESSION['CompanyRecord']['decimalplaces']) .'</td> + <td class="number">' . number_format($TotalReqdCost,$_SESSION['CompanyRecord']['decimalplaces']) .'</td> <td></td><td></td> - <td class=number>' . number_format($TotalIssuedCost,$_SESSION['CompanyRecord']['decimalplaces']) .'</td> - <td class=number>' . number_format($TotalUsageVar,$_SESSION['CompanyRecord']['decimalplaces']) . '</td> - <td class=number>' . number_format($TotalCostVar,$_SESSION['CompanyRecord']['decimalplaces']) . '</td></tr>'; + <td class="number">' . number_format($TotalIssuedCost,$_SESSION['CompanyRecord']['decimalplaces']) .'</td> + <td class="number">' . number_format($TotalUsageVar,$_SESSION['CompanyRecord']['decimalplaces']) . '</td> + <td class="number">' . number_format($TotalCostVar,$_SESSION['CompanyRecord']['decimalplaces']) . '</td></tr>'; echo '<tr><td colspan="3"></td> <td><hr/></td> Modified: trunk/doc/Change.log =================================================================== --- trunk/doc/Change.log 2011-08-12 11:01:35 UTC (rev 4657) +++ trunk/doc/Change.log 2011-08-14 04:28:42 UTC (rev 4658) @@ -1,5 +1,6 @@ webERP Change Log +14/8/11 Phil: Stocks.php now does a journal for any work in progress on a change of category where the new category has a different GL account for WIP - and bug fixes as per Ricard 12/8/11 Phil: Backed out changes on 7/8 that prevented SelectProduct.php transaction links - now only purchase order links blocked if an item is obsolete 12/8/11 Phil: CounterSales.php apply discountmatrix fixes 11/8/11 Phil: GoodsReceived.php now has checkbox to flag the order line as complete - even though the quantity delivered might be short of the order quantity. Modified: trunk/includes/session.inc =================================================================== --- trunk/includes/session.inc 2011-08-12 11:01:35 UTC (rev 4657) +++ trunk/includes/session.inc 2011-08-14 04:28:42 UTC (rev 4658) @@ -19,8 +19,12 @@ } ini_set('session.gc_Maxlifetime',$SessionLifeTime); -ini_set('max_execution_time',$MaximumExecutionTime); +if( !ini_get('safe_mode') ){ + set_time_limit($MaximumExecutionTime); + ini_set('max_execution_time',$MaximumExecutionTime); +} + session_start(); include($PathPrefix . 'includes/ConnectDB.inc'); Modified: trunk/install/save.php =================================================================== --- trunk/install/save.php 2011-08-12 11:01:35 UTC (rev 4657) +++ trunk/install/save.php 2011-08-14 04:28:42 UTC (rev 4658) @@ -3,6 +3,8 @@ error_reporting(E_ALL && ~E_NOTICE); ini_set('display_errors', 'On'); ini_set('max_execution_time', '180'); +/*Klaus Opto advised that timeout issues made it difficult to install even though max_execution_time has been set - Tim though set_time_limit should also be set - it might be a windows thing - Klaus was using WAMP */ +set_time_limit(180); require_once('../includes/MiscFunctions.php'); // Start a session This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <dai...@us...> - 2011-08-14 04:28:49
|
Revision: 4658 http://web-erp.svn.sourceforge.net/web-erp/?rev=4658&view=rev Author: daintree Date: 2011-08-14 04:28:42 +0000 (Sun, 14 Aug 2011) Log Message: ----------- 14/8/11 Phil: Stocks.php now does a journal for any work in progress on a change of category where the new category has a different GL account for WIP - and bug fixes as per Ricard Modified Paths: -------------- trunk/Stocks.php trunk/WorkOrderCosting.php trunk/doc/Change.log trunk/includes/session.inc trunk/install/save.php Modified: trunk/Stocks.php =================================================================== --- trunk/Stocks.php 2011-08-12 11:01:35 UTC (rev 4657) +++ trunk/Stocks.php 2011-08-14 04:28:42 UTC (rev 4658) @@ -5,6 +5,7 @@ include('includes/session.inc'); $title = _('Item Maintenance'); include('includes/header.inc'); +include('includes/SQL_CommonFunctions.inc'); /*If this form is called with the StockID then it is assumed that the stock item is to be modified */ @@ -213,7 +214,8 @@ controlled, serialised, materialcost+labourcost+overheadcost AS itemcost, - stockcategory.stockact + stockcategory.stockact, + stockcategory.wipact FROM stockmaster INNER JOIN stockcategory ON stockmaster.categoryid=stockcategory.categoryid @@ -225,6 +227,8 @@ $OldSerialised = $myrow[2]; $UnitCost = $myrow[3]; $OldStockAccount = $myrow[4]; + $OldWIPAccount = $myrow[5]; + $sql = "SELECT SUM(locstock.quantity) FROM locstock @@ -235,12 +239,14 @@ /*Now check the GL account of the new category to see if it is different to the old stock gl account */ - $result = DB_query("SELECT stockact + $result = DB_query("SELECT stockact, + wipact FROM stockcategory WHERE categoryid='" . $_POST['CategoryID'] . "'", $db); $NewStockActRow = DB_fetch_array($result); $NewStockAct = $NewStockActRow['stockact']; + $NewWIPAct = $NewStockActRow['wipact']; if ($OldMBFlag != $_POST['MBFlag']){ if (($OldMBFlag == 'M' OR $OldMBFlag=='B') AND ($_POST['MBFlag']=='A' OR $_POST['MBFlag']=='K' OR $_POST['MBFlag']=='D' OR $_POST['MBFlag']=='G')){ /*then need to check that there is no stock holding first */ @@ -378,7 +384,7 @@ $db,$ErrMsg,$DbgMsg,true); } //end of loop around properties defined for the category - if ($OldStockAccount != $NewStockAct AND $_SESSION['CompanyRecord']['gllinkstock']==1) { + if ($OldStockAccount != $NewStockAct AND $_SESSION['CompanyRecord']['gllink_stock']==1) { /*Then we need to make a journal to transfer the cost to the new stock account */ $JournalNo = GetNextTransNo(0,$db); //enter as a journal $SQL = "INSERT INTO gltrans (type, @@ -391,13 +397,13 @@ VALUES ( 0, '" . $JournalNo . "', '" . Date('Y-m-d') . "', - '" . GetPeriodNo(Date('Y-m-d'),true) . "', + '" . GetPeriod(Date('Y-m-d'),$db,true) . "', '" . $NewStockAccount . "', '" . $StockID . ' ' . _('Change stock category') . "', '" . ($UnitCost* $StockQtyRow[0]) . "'"; $ErrMsg = _('The stock cost journal could not be inserted because'); $DbgMsg = _('The SQL that was used to create the stock cost journal and failed was'); - $result = DB_query($sql,$db, $ErrMsg, $DbgMsg,true); + $result = DB_query($SQL,$db, $ErrMsg, $DbgMsg,true); $SQL = "INSERT INTO gltrans (type, typeno, trandate, @@ -408,13 +414,68 @@ VALUES ( 0, '" . $JournalNo . "', '" . Date('Y-m-d') . "', - '" . GetPeriodNo(Date('Y-m-d'),true) . "', + '" . GetPeriod(Date('Y-m-d'),$db,true) . "', '" . $OldStockAccount . "', '" . $StockID . ' ' . _('Change stock category') . "', '" . (-$UnitCost* $StockQtyRow[0]) . "'"; - $result = DB_query($sql,$db, $ErrMsg, $DbgMsg,true); + $result = DB_query($SQL,$db, $ErrMsg, $DbgMsg,true); } /* end if the stock category changed and forced a change in stock cost account */ + if ($OldWIPAccount != $NewWIPAct AND $_SESSION['CompanyRecord']['gllink_stock']==1) { + /*Then we need to make a journal to transfer the cost of WIP to the new WIP account */ + /*First get the total cost of WIP for this category */ + + $WOCostsResult = DB_query("SELECT workorders.costissued, + SUM(woitems.qtyreqd * woitems.stdcost) AS costrecd + FROM woitems INNER JOIN workorders + ON woitems.wo = workorders.wo + INNER JOIN stockmaster + ON woitems.stockid=stockmaster.stockid + WHERE stockmaster.stockid='". $StockID . "' + AND workorders.closed=0 + GROUP BY workorders.costissued", + $db, + _('Error retrieving value of finished goods received and cost issued against work orders for this item')); + $WIPValue = 0; + while ($WIPRow=DB_fetch_array($WOCostsResult)){ + $WIPValue += ($WIPRow['costissued']-$WIPRow['costrecd']); + } + if ($WIPValue !=0){ + $JournalNo = GetNextTransNo(0,$db); //enter as a journal + $SQL = "INSERT INTO gltrans (type, + typeno, + trandate, + periodno, + account, + narrative, + amount) + VALUES ( 0, + '" . $JournalNo . "', + '" . Date('Y-m-d') . "', + '" . GetPeriod(Date('Y-m-d'),$db,true) . "', + '" . $NewWIPAct . "', + '" . $StockID . ' ' . _('Change stock category') . "', + '" . $WIPValue . "'"; + $ErrMsg = _('The WIP cost journal could not be inserted because'); + $DbgMsg = _('The SQL that was used to create the WIP cost journal and failed was'); + $result = DB_query($SQL,$db, $ErrMsg, $DbgMsg,true); + $SQL = "INSERT INTO gltrans (type, + typeno, + trandate, + periodno, + account, + narrative, + amount) + VALUES ( 0, + '" . $JournalNo . "', + '" . Date('Y-m-d') . "', + '" . GetPeriod(Date('Y-m-d'),true) . "', + '" . $OldWIPAccount . "', + '" . $StockID . ' ' . _('Change stock category') . "', + '" . (-$WIPValue) . "'"; + $result = DB_query($SQL,$db, $ErrMsg, $DbgMsg,true); + } + } /* end if the stock category changed and forced a change in WIP account */ DB_Txn_Commit($db); prnMsg( _('Stock Item') . ' ' . $StockID . ' ' . _('has been updated'), 'success'); echo '<br />'; @@ -512,11 +573,12 @@ unset($_POST['ShrinkFactor']); unset($_POST['Pansize']); unset($StockID); + $New=1; }//ALL WORKED SO RESET THE FORM VARIABLES }//THE INSERT OF THE NEW CODE WORKED SO BANG IN THE STOCK LOCATION RECORDS TOO }//END CHECK FOR ALREADY EXISTING ITEM OF THE SAME CODE } - $New=1; + } else { echo '<br />'. "\n"; Modified: trunk/WorkOrderCosting.php =================================================================== --- trunk/WorkOrderCosting.php 2011-08-12 11:01:35 UTC (rev 4657) +++ trunk/WorkOrderCosting.php 2011-08-14 04:28:42 UTC (rev 4658) @@ -77,7 +77,7 @@ $db, $ErrMsg); -echo '<table class=selection><tr><th>' . _('Item') . '</th> +echo '<table class="selection"><tr><th>' . _('Item') . '</th> <th>' . _('Description') . '</th> <th>' . _('Quantity Required') . '</th> <th>' . _('Units') . '</th> @@ -91,12 +91,12 @@ echo '<tr><td>' . $WORow['stockid'] . '</td> <td>' . $WORow['description'] . '</td> - <td class=number>' . number_format($WORow['qtyreqd'],$WORow['decimalplaces']) . '</td> + <td class="number">' . number_format($WORow['qtyreqd'],$WORow['decimalplaces']) . '</td> <td>' . $WORow['units'] . '</td> - <td class=number>' . number_format($WORow['qtyrecd'],$WORow['decimalplaces']) . '</td> - <td class=number><a href="'. $rootpath . '/WorkOrderStatus.php?WO=' . $_POST['WO'] . '&StockID=' . $WORow['stockid'] . '">' . _('Status') . '</a></td> - <td class=number><a href="'. $rootpath . '/WorkOrderReceive.php?WO=' . $_POST['WO'] . '&StockID=' . $WORow['stockid'] . '">' . _('Receive') . '</a></td> - <td class=number><a href="'. $rootpath . '/WorkOrderIssue.php?WO=' . $_POST['WO'] . '&StockID=' . $WORow['stockid'] . '">' . _('Issue') . '</a></td> + <td class="number">' . number_format($WORow['qtyrecd'],$WORow['decimalplaces']) . '</td> + <td class="number"><a href="'. $rootpath . '/WorkOrderStatus.php?WO=' . $_POST['WO'] . '&StockID=' . $WORow['stockid'] . '">' . _('Status') . '</a></td> + <td class="number"><a href="'. $rootpath . '/WorkOrderReceive.php?WO=' . $_POST['WO'] . '&StockID=' . $WORow['stockid'] . '">' . _('Receive') . '</a></td> + <td class="number"><a href="'. $rootpath . '/WorkOrderIssue.php?WO=' . $_POST['WO'] . '&StockID=' . $WORow['stockid'] . '">' . _('Issue') . '</a></td> </tr>'; $TotalStdValueRecd +=($WORow['stdcost']*$WORow['qtyrecd']); @@ -174,8 +174,8 @@ echo '<tr class="OddTableRows">'; } echo '<td colspan=4></td><td>' . ConvertSQLDate($IssuesRow['trandate']) . '</td> - <td class=number>' . number_format(-$IssuesRow['qty'],$RequirementsRow['decimalplaces']) . '</td> - <td class=number>' . number_format(-($IssuesRow['qty']*$IssuesRow['standardcost']),$IssuesRow['decimalplaces']) . '</td></tr>'; + <td class="number">' . number_format(-$IssuesRow['qty'],$RequirementsRow['decimalplaces']) . '</td> + <td class="number">' . number_format(-($IssuesRow['qty']*$IssuesRow['standardcost']),$IssuesRow['decimalplaces']) . '</td></tr>'; $IssueQty -= $IssuesRow['qty'];// because qty for the stock movement will be negative $IssueCost -= ($IssuesRow['qty']*$IssuesRow['standardcost']); @@ -201,13 +201,13 @@ /*Required quantity is the quantity required of the component based on the quantity of the finished item received */ $UsageVar =($RequirementsRow['requiredqty']-$IssueQty)*($RequirementsRow['stdcost']); - echo '<td colspan="2"></td><td class=number>' . number_format($RequirementsRow['requiredqty'],$RequirementsRow['decimalplaces']) . '</td> - <td class=number>' . number_format($RequirementsRow['expectedcost'],$_SESSION['CompanyRecord']['decimalplaces']) . '</td> + echo '<td colspan="2"></td><td class="number">' . number_format($RequirementsRow['requiredqty'],$RequirementsRow['decimalplaces']) . '</td> + <td class="number">' . number_format($RequirementsRow['expectedcost'],$_SESSION['CompanyRecord']['decimalplaces']) . '</td> <td></td> - <td class=number>' . number_format($IssueQty,$RequirementsRow['decimalplaces']) . '</td> - <td class=number>' . number_format($IssueCost,$_SESSION['CompanyRecord']['decimalplaces']) . '</td> - <td class=number>' . number_format($UsageVar,$_SESSION['CompanyRecord']['decimalplaces']) . '</td> - <td class=number>' . number_format($CostVar,$_SESSION['CompanyRecord']['decimalplaces']) . '</td></tr>'; + <td class="number">' . number_format($IssueQty,$RequirementsRow['decimalplaces']) . '</td> + <td class="number">' . number_format($IssueCost,$_SESSION['CompanyRecord']['decimalplaces']) . '</td> + <td class="number">' . number_format($UsageVar,$_SESSION['CompanyRecord']['decimalplaces']) . '</td> + <td class="number">' . number_format($CostVar,$_SESSION['CompanyRecord']['decimalplaces']) . '</td></tr>'; $TotalReqdCost += $RequirementsRow['expectedcost']; $TotalIssuedCost += $IssueCost; $TotalCostVar += $CostVar; @@ -252,13 +252,13 @@ echo '<td>' . $WOIssuesRow['stockid'] . '</td> <td>' . $WOIssuesRow['description'] . '</td> - <td class=number>0</td> - <td class=number>0</td> + <td class="number">0</td> + <td class="number">0</td> <td>' . ConvertSQLDate($WOIssuesRow['trandate']) . '</td> - <td class=number>' . number_format(-$WOIssuesRow['qty'],$WOIssuesRow['decimalplaces']) .'</td> - <td class=number>' . number_format(-$WOIssuesRow['qty']*$WOIssuesRow['standardcost'],$_SESSION['CompanyRecord']['decimalplaces']) .'</td> - <td class=number>' . number_format($WOIssuesRow['qty']*$WOIssuesRow['standardcost'],$_SESSION['CompanyRecord']['decimalplaces']) .'</td> - <td class=number>0</td></tr>'; + <td class="number">' . number_format(-$WOIssuesRow['qty'],$WOIssuesRow['decimalplaces']) .'</td> + <td class="number">' . number_format(-$WOIssuesRow['qty']*$WOIssuesRow['standardcost'],$_SESSION['CompanyRecord']['decimalplaces']) .'</td> + <td class="number">' . number_format($WOIssuesRow['qty']*$WOIssuesRow['standardcost'],$_SESSION['CompanyRecord']['decimalplaces']) .'</td> + <td class="number">0</td></tr>'; $TotalUsageVar += ($WOIssuesRow['qty']*$WOIssuesRow['standardcost']); } @@ -269,13 +269,13 @@ <td colspan="2"></td> <td colspan="3"><hr></td> </tr>'; -echo '<tr><td colspan="2" class=number>' . _('Totals') . '</td> +echo '<tr><td colspan="2" class="number">' . _('Totals') . '</td> <td></td> - <td class=number>' . number_format($TotalReqdCost,$_SESSION['CompanyRecord']['decimalplaces']) .'</td> + <td class="number">' . number_format($TotalReqdCost,$_SESSION['CompanyRecord']['decimalplaces']) .'</td> <td></td><td></td> - <td class=number>' . number_format($TotalIssuedCost,$_SESSION['CompanyRecord']['decimalplaces']) .'</td> - <td class=number>' . number_format($TotalUsageVar,$_SESSION['CompanyRecord']['decimalplaces']) . '</td> - <td class=number>' . number_format($TotalCostVar,$_SESSION['CompanyRecord']['decimalplaces']) . '</td></tr>'; + <td class="number">' . number_format($TotalIssuedCost,$_SESSION['CompanyRecord']['decimalplaces']) .'</td> + <td class="number">' . number_format($TotalUsageVar,$_SESSION['CompanyRecord']['decimalplaces']) . '</td> + <td class="number">' . number_format($TotalCostVar,$_SESSION['CompanyRecord']['decimalplaces']) . '</td></tr>'; echo '<tr><td colspan="3"></td> <td><hr/></td> Modified: trunk/doc/Change.log =================================================================== --- trunk/doc/Change.log 2011-08-12 11:01:35 UTC (rev 4657) +++ trunk/doc/Change.log 2011-08-14 04:28:42 UTC (rev 4658) @@ -1,5 +1,6 @@ webERP Change Log +14/8/11 Phil: Stocks.php now does a journal for any work in progress on a change of category where the new category has a different GL account for WIP - and bug fixes as per Ricard 12/8/11 Phil: Backed out changes on 7/8 that prevented SelectProduct.php transaction links - now only purchase order links blocked if an item is obsolete 12/8/11 Phil: CounterSales.php apply discountmatrix fixes 11/8/11 Phil: GoodsReceived.php now has checkbox to flag the order line as complete - even though the quantity delivered might be short of the order quantity. Modified: trunk/includes/session.inc =================================================================== --- trunk/includes/session.inc 2011-08-12 11:01:35 UTC (rev 4657) +++ trunk/includes/session.inc 2011-08-14 04:28:42 UTC (rev 4658) @@ -19,8 +19,12 @@ } ini_set('session.gc_Maxlifetime',$SessionLifeTime); -ini_set('max_execution_time',$MaximumExecutionTime); +if( !ini_get('safe_mode') ){ + set_time_limit($MaximumExecutionTime); + ini_set('max_execution_time',$MaximumExecutionTime); +} + session_start(); include($PathPrefix . 'includes/ConnectDB.inc'); Modified: trunk/install/save.php =================================================================== --- trunk/install/save.php 2011-08-12 11:01:35 UTC (rev 4657) +++ trunk/install/save.php 2011-08-14 04:28:42 UTC (rev 4658) @@ -3,6 +3,8 @@ error_reporting(E_ALL && ~E_NOTICE); ini_set('display_errors', 'On'); ini_set('max_execution_time', '180'); +/*Klaus Opto advised that timeout issues made it difficult to install even though max_execution_time has been set - Tim though set_time_limit should also be set - it might be a windows thing - Klaus was using WAMP */ +set_time_limit(180); require_once('../includes/MiscFunctions.php'); // Start a session This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <dai...@us...> - 2011-08-14 09:22:26
|
Revision: 4659 http://web-erp.svn.sourceforge.net/web-erp/?rev=4659&view=rev Author: daintree Date: 2011-08-14 09:22:19 +0000 (Sun, 14 Aug 2011) Log Message: ----------- 14/8/11 Phil: SystemParameters.php default ProhibitPostingsBefore to 1900-01-01 when no default is currently set - can cause errors at the moment as defaults to the latest period if not previously set. Modified Paths: -------------- trunk/SystemParameters.php trunk/doc/Change.log Modified: trunk/SystemParameters.php =================================================================== --- trunk/SystemParameters.php 2011-08-14 04:28:42 UTC (rev 4658) +++ trunk/SystemParameters.php 2011-08-14 09:22:19 UTC (rev 4659) @@ -326,7 +326,7 @@ // DefaultDateFormat echo '<tr style="outline: 1px solid"><td>' . _('Default Date Format') . ':</td> - <td><select Name="X_DefaultDateFormat"> + <td><select name="X_DefaultDateFormat"> <option '.(($_SESSION['DefaultDateFormat']=='d/m/Y')?'selected ':'').'Value="d/m/Y">d/m/Y</option> <option '.(($_SESSION['DefaultDateFormat']=='d.m.Y')?'selected ':'').'Value="d.m.Y">d.m.Y</option> <option '.(($_SESSION['DefaultDateFormat']=='m/d/Y')?'selected ':'').'Value="m/d/Y">m/d/Y</option> @@ -336,7 +336,7 @@ // DefaultTheme echo '<tr style="outline: 1px solid"><td>' . _('New Users Default Theme') . ':</td> - <td><select Name="X_DefaultTheme">'; + <td><select name="X_DefaultTheme">'; $ThemeDirectory = dir('css/'); while (false != ($ThemeName = $ThemeDirectory->read())){ if (is_dir("css/$ThemeName") AND $ThemeName != '.' AND $ThemeName != '..' AND $ThemeName != '.svn'){ @@ -354,23 +354,23 @@ // PastDueDays1 echo '<tr style="outline: 1px solid"><td>' . _('First Overdue Deadline in (days)') . ':</td> - <td><input type="Text" class="number" Name="X_PastDueDays1" value="' . $_SESSION['PastDueDays1'] . '" size=3 maxlength=3></td> + <td><input type="text" class="number" name="X_PastDueDays1" value="' . $_SESSION['PastDueDays1'] . '" size=3 maxlength=3></td> <td>' . _('Customer and supplier balances are displayed as overdue by this many days. This parameter is used on customer and supplier enquiry screens and aged listings') . '</td></tr>'; // PastDueDays2 echo '<tr style="outline: 1px solid"><td>' . _('Second Overdue Deadline in (days)') . ':</td> - <td><input type="Text" class="number" Name="X_PastDueDays2" value="' . $_SESSION['PastDueDays2'] . '" size=3 maxlength=3></td> + <td><input type="text" class="number" name="X_PastDueDays2" value="' . $_SESSION['PastDueDays2'] . '" size=3 maxlength=3></td> <td>' . _('As above but the next level of overdue') . '</td></tr>'; // DefaultCreditLimit echo '<tr style="outline: 1px solid"><td>' . _('Default Credit Limit') . ':</td> - <td><input type="Text" class="number" Name="X_DefaultCreditLimit" value="' . $_SESSION['DefaultCreditLimit'] . '" size=12 maxlength=12></td> + <td><input type="text" class="number" name="X_DefaultCreditLimit" value="' . $_SESSION['DefaultCreditLimit'] . '" size=12 maxlength=12></td> <td>' . _('The default used in new customer set up') . '</td></tr>'; // Check Credit Limits echo '<tr style="outline: 1px solid"><td>' . _('Check Credit Limits') . ':</td> - <td><select Name="X_CheckCreditLimits"> + <td><select name="X_CheckCreditLimits"> <option '.($_SESSION['CheckCreditLimits']==0?'selected ':'').'value="0">'._('Do not check').'</option> <option '.($_SESSION['CheckCreditLimits']==1?'selected ':'').'value="1">'._('Warn on breach').'</option> <option '.($_SESSION['CheckCreditLimits']==2?'selected ':'').'value="2">'._('Prohibit Sales').'</option> @@ -379,7 +379,7 @@ // Show_Settled_LastMonth echo '<tr style="outline: 1px solid"><td>' . _('Show Settled Last Month') . ':</td> - <td><select Name="X_Show_Settled_LastMonth"> + <td><select name="X_Show_Settled_LastMonth"> <option '.($_SESSION['Show_Settled_LastMonth']?'selected ':'').'value="1">'._('Yes').'</option> <option '.(!$_SESSION['Show_Settled_LastMonth']?'selected ':'').'value="0">'._('No').'</option> </select></td> @@ -387,29 +387,29 @@ //RomalpaClause echo '<tr style="outline: 1px solid"><td>' . _('Romalpa Clause') . ':</td> - <td><textarea Name="X_RomalpaClause" rows=3 cols=40>' . $_SESSION['RomalpaClause'] . '</textarea></td> + <td><textarea name="X_RomalpaClause" rows=3 cols=40>' . $_SESSION['RomalpaClause'] . '</textarea></td> <td>' . _('This text appears on invoices and credit notes in small print. Normally a reservation of title clause that gives the company rights to collect goods which have not been paid for - to give some protection for bad debts.') . '</td></tr>'; // QuickEntries echo '<tr style="outline: 1px solid"><td>' . _('Quick Entries') . ':</td> - <td><input type="Text" class="number" Name="X_QuickEntries" value="' . $_SESSION['QuickEntries'] . '" size=3 maxlength=2></td> + <td><input type="text" class="number" name="X_QuickEntries" value="' . $_SESSION['QuickEntries'] . '" size=3 maxlength=2></td> <td>' . _('This parameter defines the layout of the sales order entry screen. The number of fields available for quick entries. Any number from 1 to 99 can be entered.') . '</td></tr>'; // Frequently Ordered Items echo '<tr style="outline: 1px solid"><td>' . _('Frequently Ordered Items') . ':</td> - <td><input type="Text" class="number" Name="X_FrequentlyOrderedItems" value="' . $_SESSION['FrequentlyOrderedItems'] . '" size=3 maxlength=2></td> + <td><input type="text" class="number" name="X_FrequentlyOrderedItems" value="' . $_SESSION['FrequentlyOrderedItems'] . '" size=3 maxlength=2></td> <td>' . _('To show the most frequently ordered items enter the number of frequently ordered items you wish to display from 1 to 99. If you do not wish to display the frequently ordered item list enter 0.') . '</td></tr>'; // SO_AllowSameItemMultipleTimes echo '<tr style="outline: 1px solid"><td>' . _('Sales Order Allows Same Item Multiple Times') . ':</td> - <td><select Name="X_SO_AllowSameItemMultipleTimes"> + <td><select name="X_SO_AllowSameItemMultipleTimes"> <option '.($_SESSION['SO_AllowSameItemMultipleTimes']?'selected ':'').'value="1">'._('Yes').'</option> <option '.(!$_SESSION['SO_AllowSameItemMultipleTimes']?'selected ':'').'value="0">'._('No').'</option> </select></td><td> </td></tr>'; //'AllowOrderLineItemNarrative' echo '<tr style="outline: 1px solid"><td>' . _('Order Entry allows Line Item Narrative') . ':</td> - <td><select Name="X_AllowOrderLineItemNarrative"> + <td><select name="X_AllowOrderLineItemNarrative"> <option '.($_SESSION['AllowOrderLineItemNarrative']=='1'?'selected ':'').'value="1">'._('Allow Narrative Entry').'</option> <option '.($_SESSION['AllowOrderLineItemNarrative']=='0'?'selected ':'').'value="0">'._('No Narrative Line').'</option> </select></td> @@ -418,7 +418,7 @@ //'RequirePickingNote' echo '<tr style="outline: 1px solid"><td>' . _('A picking note must be produced before an order can be delivered') . ':</td> - <td><select Name="X_RequirePickingNote"> + <td><select name="X_RequirePickingNote"> <option '.($_SESSION['RequirePickingNote']=='1'?'selected ':'').'value="1">'._('Yes').'</option> <option '.($_SESSION['RequirePickingNote']=='0'?'selected ':'').'value="0">'._('No').'</option> </select></td> @@ -427,7 +427,7 @@ //UpdateCurrencyRatesDaily echo '<tr style="outline: 1px solid"><td>' . _('Auto Update Exchange Rates Daily') . ':</td> - <td><select Name="X_UpdateCurrencyRatesDaily"> + <td><select name="X_UpdateCurrencyRatesDaily"> <option '.($_SESSION['UpdateCurrencyRatesDaily']!='1'?'selected ':'').'value="1">'._('Automatic').'</option> <option '.($_SESSION['UpdateCurrencyRatesDaily']=='0'?'selected ':'').'value="0">'._('Manual').'</option> </select></td> @@ -436,7 +436,7 @@ //Default Packing Note Format echo '<tr style="outline: 1px solid"><td>' . _('Format of Packing Slips') . ':</td> - <td><select Name="X_PackNoteFormat"> + <td><select name="X_PackNoteFormat"> <option '.($_SESSION['PackNoteFormat']=='1'?'selected ':'').'value="1">'._('Laser Printed').'</option> <option '.($_SESSION['PackNoteFormat']=='2'?'selected ':'').'value="2">'._('Special Stationery').'</option> </select></td> @@ -445,7 +445,7 @@ //Default Invoice Format echo '<tr style="outline: 1px solid"><td>' . _('Invoice Orientation') . ':</td> - <td><select Name="X_InvoicePortraitFormat"> + <td><select name="X_InvoicePortraitFormat"> <option '.($_SESSION['InvoicePortraitFormat']=='0'?'selected ':'').'value="0">'._('Landscape').'</option> <option '.($_SESSION['InvoicePortraitFormat']=='1'?'selected ':'').'value="1">'._('Portrait').'</option> </select></td> @@ -454,7 +454,7 @@ //Blind packing note echo '<tr style="outline: 1px solid"><td>' . _('Show company details on packing slips') . ':</td> - <td><select Name="X_DefaultBlindPackNote"> + <td><select name="X_DefaultBlindPackNote"> <option '.($_SESSION['DefaultBlindPackNote']=='1'?'selected ':'').'value="1">'._('Show Company Details').'</option> <option '.($_SESSION['DefaultBlindPackNote']=='2'?'selected ':'').'value="2">'._('Hide Company Details').'</option> </select></td> @@ -463,7 +463,7 @@ // Working days on a week echo '<tr style="outline: 1px solid"><td>' . _('Working Days on a Week') . ':</td> - <td><select Name="X_WorkingDaysWeek"> + <td><select name="X_WorkingDaysWeek"> <option '.($_SESSION['WorkingDaysWeek']=='7'?'selected ':'').'value="7">7 '._('working days').'</option> <option '.($_SESSION['WorkingDaysWeek']=='6'?'selected ':'').'value="6">6 '._('working days').'</option> <option '.($_SESSION['WorkingDaysWeek']=='5'?'selected ':'').'value="5">5 '._('working days').'</option> @@ -473,7 +473,7 @@ // DispatchCutOffTime echo '<tr style="outline: 1px solid"><td>' . _('Dispatch Cut-Off Time') . ':</td> - <td><select Name="X_DispatchCutOffTime">'; + <td><select name="X_DispatchCutOffTime">'; for ($i=0; $i < 24; $i++ ) echo '<option '.($_SESSION['DispatchCutOffTime'] == $i?'selected ':'').'value="'.$i.'">'.$i; echo '</select></td> @@ -481,7 +481,7 @@ // AllowSalesOfZeroCostItems echo '<tr style="outline: 1px solid"><td>' . _('Allow Sales Of Zero Cost Items') . ':</td> - <td><select Name="X_AllowSalesOfZeroCostItems"> + <td><select name="X_AllowSalesOfZeroCostItems"> <option '.($_SESSION['AllowSalesOfZeroCostItems']?'selected ':'').'value="1">'._('Yes').'</option> <option '.(!$_SESSION['AllowSalesOfZeroCostItems']?'selected ':'').'value="0">'._('No').'</option> </select></td> @@ -489,7 +489,7 @@ // CreditingControlledItems_MustExist echo '<tr style="outline: 1px solid"><td>' . _('Controlled Items Must Exist For Crediting') . ':</td> - <td><select Name="X_CreditingControlledItems_MustExist"> + <td><select name="X_CreditingControlledItems_MustExist"> <option '.($_SESSION['CreditingControlledItems_MustExist']?'selected ':'').'value="1">'._('Yes').'</option> <option '.(!$_SESSION['CreditingControlledItems_MustExist']?'selected ':'').'value="0">'._('No').'</option> </select></td> @@ -500,7 +500,7 @@ $ErrMsg = _('Could not load price lists'); $result = DB_query($sql,$db,$ErrMsg); echo '<tr style="outline: 1px solid"><td>' . _('Default Price List') . ':</td>'; -echo '<td><select Name="X_DefaultPriceList">'; +echo '<td><select name="X_DefaultPriceList">'; if( DB_num_rows($result) == 0 ) { echo '<option selected value="">'._('Unavailable'); } else { @@ -516,7 +516,7 @@ $ErrMsg = _('Could not load shippers'); $result = DB_query($sql,$db,$ErrMsg); echo '<tr style="outline: 1px solid"><td>' . _('Default Shipper') . ':</td>'; -echo '<td><select Name="X_Default_Shipper">'; +echo '<td><select name="X_Default_Shipper">'; if( DB_num_rows($result) == 0 ) { echo '<option selected value="">'._('Unavailable') . '</option>'; } else { @@ -529,7 +529,7 @@ // DoFreightCalc echo '<tr style="outline: 1px solid"><td>' . _('Do Freight Calculation') . ':</td> - <td><select Name="X_DoFreightCalc"> + <td><select name="X_DoFreightCalc"> <option '.($_SESSION['DoFreightCalc']?'selected ':'').'value="1">'._('Yes').'</option> <option '.(!$_SESSION['DoFreightCalc']?'selected ':'').'value="0">'._('No').'</option> </select></td> @@ -537,13 +537,13 @@ //FreightChargeAppliesIfLessThan echo '<tr style="outline: 1px solid"><td>' . _('Apply freight charges if an order is less than') . ':</td> - <td><input type="Text" class="number" Name="X_FreightChargeAppliesIfLessThan" size=12 maxlength=12 value="' . $_SESSION['FreightChargeAppliesIfLessThan'] . '"></td> + <td><input type="text" class="number" name="X_FreightChargeAppliesIfLessThan" size=12 maxlength=12 value="' . $_SESSION['FreightChargeAppliesIfLessThan'] . '"></td> <td>' . _('This parameter is only effective if Do Freight Calculation is set to Yes. If it is set to 0 then freight is always charged. The total order value is compared to this value in deciding whether or not to charge freight') .'</td></tr>'; // AutoDebtorNo echo '<tr style="outline: 1px solid"><td>' . _('Create Debtor Codes Automatically') . ':</td> - <td><select Name="X_AutoDebtorNo">'; + <td><select name="X_AutoDebtorNo">'; if ($_SESSION['AutoDebtorNo']==0) { echo '<option selected value=0>' . _('Manual Entry') . '</option>'; @@ -560,7 +560,7 @@ $ErrMsg = _('Could not load tax categories table'); $result = DB_query($sql,$db,$ErrMsg); echo '<tr style="outline: 1px solid"><td>' . _('Default Tax Category') . ':</td>'; -echo '<td><select Name="X_DefaultTaxCategory">'; +echo '<td><select name="X_DefaultTaxCategory">'; if( DB_num_rows($result) == 0 ) { echo '<option selected value="">'._('Unavailable') . '</option>'; } else { @@ -573,8 +573,8 @@ //TaxAuthorityReferenceName -echo '<tr style="outline: 1px solid"><td>' . _('TaxAuthorityReferenceName') . ':</td> - <td><input type="Text" Name="X_TaxAuthotaxcatid, taxcatname FROM taxcategoriesrityReferenceName" size=16 maxlength=25 value="' . $_SESSION['TaxAuthorityReferenceName'] . '"></td> +echo '<tr style="outline: 1px solid"><td>' . _('Tax Authority Reference Name') . ':</td> + <td><input type="text" name="X_TaxAuthorityReferenceName" size="16" maxlength="25" value="' . $_SESSION['TaxAuthorityReferenceName'] . '"></td> <td>' . _('This parameter is what is displayed on tax invoices and credits for the tax authority of the company eg. in Australian this would by A.B.N.: - in NZ it would be GST No: in the UK it would be VAT Regn. No') .'</td></tr>'; // CountryOfOperation @@ -595,14 +595,14 @@ // NumberOfPeriodsOfStockUsage echo '<tr style="outline: 1px solid"><td>' . _('Number Of Periods Of StockUsage') . ':</td> - <td><select Name="X_NumberOfPeriodsOfStockUsage">'; + <td><select name="X_NumberOfPeriodsOfStockUsage">'; for ($i=1; $i <= 12; $i++ ) echo '<option '.($_SESSION['NumberOfPeriodsOfStockUsage'] == $i?'selected ':'').'value="'.$i.'">'.$i; echo '</select></td><td>' . _('In stock usage inquiries this determines how many periods of stock usage to show. An average is calculated over this many periods') .'</td></tr>'; //Show values on GRN echo '<tr style="outline: 1px solid"><td>' . _('Show order values on GRN') . ':</td> - <td><select Name="X_ShowValueOnGRN"> + <td><select name="X_ShowValueOnGRN"> <option '.($_SESSION['ShowValueOnGRN']?'selected ':'').'value="1">'._('Yes').'</option> <option '.(!$_SESSION['ShowValueOnGRN']?'selected ':'').'value="0">'._('No').'</option> </select></td> @@ -611,7 +611,7 @@ // Check_Qty_Charged_vs_Del_Qty echo '<tr style="outline: 1px solid"><td>' . _('Check Quantity Charged vs Deliver Qty') . ':</td> - <td><select Name="X_Check_Qty_Charged_vs_Del_Qty"> + <td><select name="X_Check_Qty_Charged_vs_Del_Qty"> <option '.($_SESSION['Check_Qty_Charged_vs_Del_Qty']?'selected ':'').'value="1">'._('Yes').'</option> <option '.(!$_SESSION['Check_Qty_Charged_vs_Del_Qty']?'selected ':'').'value="0">'._('No').'</option> </select></td> @@ -619,7 +619,7 @@ // Check_Price_Charged_vs_Order_Price echo '<tr style="outline: 1px solid"><td>' . _('Check Price Charged vs Order Price') . ':</td> - <td><select Name="X_Check_Price_Charged_vs_Order_Price"> + <td><select name="X_Check_Price_Charged_vs_Order_Price"> <option '.($_SESSION['Check_Price_Charged_vs_Order_Price']?'selected ':'').'value="1">'._('Yes').'</option> <option '.(!$_SESSION['Check_Price_Charged_vs_Order_Price']?'selected ':'').'value="0">'._('No').'</option> </select></td> @@ -627,24 +627,24 @@ // OverChargeProportion echo '<tr style="outline: 1px solid"><td>' . _('Allowed Over Charge Proportion') . ':</td> - <td><input type="Text" class="number" Name="X_OverChargeProportion" size=4 maxlength=3 value="' . $_SESSION['OverChargeProportion'] . '"></td> + <td><input type="text" class="number" name="X_OverChargeProportion" size=4 maxlength=3 value="' . $_SESSION['OverChargeProportion'] . '"></td> <td>' . _('If check price charges vs Order price is set to yes then this proportion determines the percentage by which invoices can be overcharged with respect to price') .'</td></tr>'; // OverReceiveProportion echo '<tr style="outline: 1px solid"><td>' . _('Allowed Over Receive Proportion') . ':</td> - <td><input type="Text" class="number" Name="X_OverReceiveProportion" size=4 maxlength=3 value="' . $_SESSION['OverReceiveProportion'] . '"></td> + <td><input type="text" class="number" name="X_OverReceiveProportion" size=4 maxlength=3 value="' . $_SESSION['OverReceiveProportion'] . '"></td> <td>' . _('If check quantity charged vs delivery quantity is set to yes then this proportion determines the percentage by which invoices can be overcharged with respect to delivery') .'</td></tr>'; // PO_AllowSameItemMultipleTimes echo '<tr style="outline: 1px solid"><td>' . _('Purchase Order Allows Same Item Multiple Times') . ':</td> - <td><select Name="X_PO_AllowSameItemMultipleTimes"> + <td><select name="X_PO_AllowSameItemMultipleTimes"> <option '.($_SESSION['PO_AllowSameItemMultipleTimes']?'selected ':'').'value="1">'._('Yes') . '</option> <option '.(!$_SESSION['PO_AllowSameItemMultipleTimes']?'selected ':'').'value="0">'._('No') . '</option> </select></td><td>' . _('If a purchase order can have the same item on the order several times this parameter should be set to yes') . '</td></tr>'; // AutoAuthorisePO echo '<tr style="outline: 1px solid"><td>' . _('Automatically authorise purchase orders if user has authority') . ':</td> - <td><select Name="X_AutoAuthorisePO"> + <td><select name="X_AutoAuthorisePO"> <option '.($_SESSION['AutoAuthorisePO'] ?'selected ':'').'value="1">'._('Yes').'</option> <option '.(!$_SESSION['AutoAuthorisePO'] ?'selected ':'').'value="0">'._('No').'</option> </select></td><td>' . _('If the user changing an existing purchase order or adding a new puchase order is set up to authorise purchase orders and the order is within their limit, then the purchase order status is automatically set to authorised') . '</td></tr>'; @@ -667,7 +667,7 @@ 11=>_('November'), 12=>_('December') ); echo '<tr style="outline: 1px solid"><td>' . _('Financial Year Ends On') . ':</td> - <td><select Name="X_YearEnd">'; + <td><select name="X_YearEnd">'; for ($i=1; $i <= sizeof($MonthNames); $i++ ) echo '<option '.($_SESSION['YearEnd'] == $i ? 'selected ' : '').'value="'.$i.'">'.$MonthNames[$i] . '</option>'; echo '</select></td> @@ -872,11 +872,14 @@ echo '<tr style="outline: 1px solid"><td>' . _('Prohibit GL Journals to Periods Prior To') . ':</td> - <td><select Name="X_ProhibitPostingsBefore">'; + <td><select name="X_ProhibitPostingsBefore">'; $sql = "SELECT lastdate_in_period FROM periods ORDER BY periodno DESC"; $ErrMsg = _('Could not load periods table'); $result = DB_query($sql,$db,$ErrMsg); +if ($_SESSION['ProhibitPostingsBefore']=='' OR $_SESSION['ProhibitPostingsBefore']=='1900-01-01' OR !isset($_SESSION['ProhibitPostingsBefore'])){ + echo '<option selected value="1900-01-01">' . ConvertSQLDate('1900-01-01') . '</option>'; +} while ($PeriodRow = DB_fetch_row($result)){ if ($_SESSION['ProhibitPostingsBefore']==$PeriodRow[0]){ echo '<option selected value="' . $PeriodRow[0] . '">' . ConvertSQLDate($PeriodRow[0]) . '</option>'; @@ -971,7 +974,7 @@ //DefineControlledOnWOEntry echo '<tr style="outline: 1px solid"><td>' . _('Controlled Items Defined At Work Order Entry') . ':</td> - <td><select Name="X_DefineControlledOnWOEntry"> + <td><select name="X_DefineControlledOnWOEntry"> <option '.($_SESSION['DefineControlledOnWOEntry']?'selected ':'').'value="1">'._('Yes').'</option> <option '.(!$_SESSION['DefineControlledOnWOEntry']?'selected ':'').'value="0">'._('No').'</option> </select></td> @@ -992,7 +995,7 @@ echo '</select></td><td>' . _('Setting this parameter to Yes will ensure that when a sales order is placed if there is insufficient stock then a new work order is created at the default factory location') . '</td></tr>' ; echo '<tr style="outline: 1px solid"><td>' . _('Default Factory Location') . ':</td> - <td><select Name="X_DefaultFactoryLocation">'; + <td><select name="X_DefaultFactoryLocation">'; $sql = "SELECT loccode,locationname FROM locations"; $ErrMsg = _('Could not load locations table'); @@ -1016,7 +1019,7 @@ echo '</table> - <br /><div class="centre"><input type="Submit" Name="submit" value="' . _('Update') . '"></div> + <br /><div class="centre"><input type="Submit" name="submit" value="' . _('Update') . '"></div> </form>'; include('includes/footer.inc'); Modified: trunk/doc/Change.log =================================================================== --- trunk/doc/Change.log 2011-08-14 04:28:42 UTC (rev 4658) +++ trunk/doc/Change.log 2011-08-14 09:22:19 UTC (rev 4659) @@ -1,5 +1,6 @@ webERP Change Log +14/8/11 Phil: SystemParameters.php default ProhibitPostingsBefore to 1900-01-01 when no default is currently set - can cause errors at the moment as defaults to the latest period if not previously set. 14/8/11 Phil: Stocks.php now does a journal for any work in progress on a change of category where the new category has a different GL account for WIP - and bug fixes as per Ricard 12/8/11 Phil: Backed out changes on 7/8 that prevented SelectProduct.php transaction links - now only purchase order links blocked if an item is obsolete 12/8/11 Phil: CounterSales.php apply discountmatrix fixes This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <dai...@us...> - 2011-08-14 09:22:26
|
Revision: 4659 http://web-erp.svn.sourceforge.net/web-erp/?rev=4659&view=rev Author: daintree Date: 2011-08-14 09:22:19 +0000 (Sun, 14 Aug 2011) Log Message: ----------- 14/8/11 Phil: SystemParameters.php default ProhibitPostingsBefore to 1900-01-01 when no default is currently set - can cause errors at the moment as defaults to the latest period if not previously set. Modified Paths: -------------- trunk/SystemParameters.php trunk/doc/Change.log Modified: trunk/SystemParameters.php =================================================================== --- trunk/SystemParameters.php 2011-08-14 04:28:42 UTC (rev 4658) +++ trunk/SystemParameters.php 2011-08-14 09:22:19 UTC (rev 4659) @@ -326,7 +326,7 @@ // DefaultDateFormat echo '<tr style="outline: 1px solid"><td>' . _('Default Date Format') . ':</td> - <td><select Name="X_DefaultDateFormat"> + <td><select name="X_DefaultDateFormat"> <option '.(($_SESSION['DefaultDateFormat']=='d/m/Y')?'selected ':'').'Value="d/m/Y">d/m/Y</option> <option '.(($_SESSION['DefaultDateFormat']=='d.m.Y')?'selected ':'').'Value="d.m.Y">d.m.Y</option> <option '.(($_SESSION['DefaultDateFormat']=='m/d/Y')?'selected ':'').'Value="m/d/Y">m/d/Y</option> @@ -336,7 +336,7 @@ // DefaultTheme echo '<tr style="outline: 1px solid"><td>' . _('New Users Default Theme') . ':</td> - <td><select Name="X_DefaultTheme">'; + <td><select name="X_DefaultTheme">'; $ThemeDirectory = dir('css/'); while (false != ($ThemeName = $ThemeDirectory->read())){ if (is_dir("css/$ThemeName") AND $ThemeName != '.' AND $ThemeName != '..' AND $ThemeName != '.svn'){ @@ -354,23 +354,23 @@ // PastDueDays1 echo '<tr style="outline: 1px solid"><td>' . _('First Overdue Deadline in (days)') . ':</td> - <td><input type="Text" class="number" Name="X_PastDueDays1" value="' . $_SESSION['PastDueDays1'] . '" size=3 maxlength=3></td> + <td><input type="text" class="number" name="X_PastDueDays1" value="' . $_SESSION['PastDueDays1'] . '" size=3 maxlength=3></td> <td>' . _('Customer and supplier balances are displayed as overdue by this many days. This parameter is used on customer and supplier enquiry screens and aged listings') . '</td></tr>'; // PastDueDays2 echo '<tr style="outline: 1px solid"><td>' . _('Second Overdue Deadline in (days)') . ':</td> - <td><input type="Text" class="number" Name="X_PastDueDays2" value="' . $_SESSION['PastDueDays2'] . '" size=3 maxlength=3></td> + <td><input type="text" class="number" name="X_PastDueDays2" value="' . $_SESSION['PastDueDays2'] . '" size=3 maxlength=3></td> <td>' . _('As above but the next level of overdue') . '</td></tr>'; // DefaultCreditLimit echo '<tr style="outline: 1px solid"><td>' . _('Default Credit Limit') . ':</td> - <td><input type="Text" class="number" Name="X_DefaultCreditLimit" value="' . $_SESSION['DefaultCreditLimit'] . '" size=12 maxlength=12></td> + <td><input type="text" class="number" name="X_DefaultCreditLimit" value="' . $_SESSION['DefaultCreditLimit'] . '" size=12 maxlength=12></td> <td>' . _('The default used in new customer set up') . '</td></tr>'; // Check Credit Limits echo '<tr style="outline: 1px solid"><td>' . _('Check Credit Limits') . ':</td> - <td><select Name="X_CheckCreditLimits"> + <td><select name="X_CheckCreditLimits"> <option '.($_SESSION['CheckCreditLimits']==0?'selected ':'').'value="0">'._('Do not check').'</option> <option '.($_SESSION['CheckCreditLimits']==1?'selected ':'').'value="1">'._('Warn on breach').'</option> <option '.($_SESSION['CheckCreditLimits']==2?'selected ':'').'value="2">'._('Prohibit Sales').'</option> @@ -379,7 +379,7 @@ // Show_Settled_LastMonth echo '<tr style="outline: 1px solid"><td>' . _('Show Settled Last Month') . ':</td> - <td><select Name="X_Show_Settled_LastMonth"> + <td><select name="X_Show_Settled_LastMonth"> <option '.($_SESSION['Show_Settled_LastMonth']?'selected ':'').'value="1">'._('Yes').'</option> <option '.(!$_SESSION['Show_Settled_LastMonth']?'selected ':'').'value="0">'._('No').'</option> </select></td> @@ -387,29 +387,29 @@ //RomalpaClause echo '<tr style="outline: 1px solid"><td>' . _('Romalpa Clause') . ':</td> - <td><textarea Name="X_RomalpaClause" rows=3 cols=40>' . $_SESSION['RomalpaClause'] . '</textarea></td> + <td><textarea name="X_RomalpaClause" rows=3 cols=40>' . $_SESSION['RomalpaClause'] . '</textarea></td> <td>' . _('This text appears on invoices and credit notes in small print. Normally a reservation of title clause that gives the company rights to collect goods which have not been paid for - to give some protection for bad debts.') . '</td></tr>'; // QuickEntries echo '<tr style="outline: 1px solid"><td>' . _('Quick Entries') . ':</td> - <td><input type="Text" class="number" Name="X_QuickEntries" value="' . $_SESSION['QuickEntries'] . '" size=3 maxlength=2></td> + <td><input type="text" class="number" name="X_QuickEntries" value="' . $_SESSION['QuickEntries'] . '" size=3 maxlength=2></td> <td>' . _('This parameter defines the layout of the sales order entry screen. The number of fields available for quick entries. Any number from 1 to 99 can be entered.') . '</td></tr>'; // Frequently Ordered Items echo '<tr style="outline: 1px solid"><td>' . _('Frequently Ordered Items') . ':</td> - <td><input type="Text" class="number" Name="X_FrequentlyOrderedItems" value="' . $_SESSION['FrequentlyOrderedItems'] . '" size=3 maxlength=2></td> + <td><input type="text" class="number" name="X_FrequentlyOrderedItems" value="' . $_SESSION['FrequentlyOrderedItems'] . '" size=3 maxlength=2></td> <td>' . _('To show the most frequently ordered items enter the number of frequently ordered items you wish to display from 1 to 99. If you do not wish to display the frequently ordered item list enter 0.') . '</td></tr>'; // SO_AllowSameItemMultipleTimes echo '<tr style="outline: 1px solid"><td>' . _('Sales Order Allows Same Item Multiple Times') . ':</td> - <td><select Name="X_SO_AllowSameItemMultipleTimes"> + <td><select name="X_SO_AllowSameItemMultipleTimes"> <option '.($_SESSION['SO_AllowSameItemMultipleTimes']?'selected ':'').'value="1">'._('Yes').'</option> <option '.(!$_SESSION['SO_AllowSameItemMultipleTimes']?'selected ':'').'value="0">'._('No').'</option> </select></td><td> </td></tr>'; //'AllowOrderLineItemNarrative' echo '<tr style="outline: 1px solid"><td>' . _('Order Entry allows Line Item Narrative') . ':</td> - <td><select Name="X_AllowOrderLineItemNarrative"> + <td><select name="X_AllowOrderLineItemNarrative"> <option '.($_SESSION['AllowOrderLineItemNarrative']=='1'?'selected ':'').'value="1">'._('Allow Narrative Entry').'</option> <option '.($_SESSION['AllowOrderLineItemNarrative']=='0'?'selected ':'').'value="0">'._('No Narrative Line').'</option> </select></td> @@ -418,7 +418,7 @@ //'RequirePickingNote' echo '<tr style="outline: 1px solid"><td>' . _('A picking note must be produced before an order can be delivered') . ':</td> - <td><select Name="X_RequirePickingNote"> + <td><select name="X_RequirePickingNote"> <option '.($_SESSION['RequirePickingNote']=='1'?'selected ':'').'value="1">'._('Yes').'</option> <option '.($_SESSION['RequirePickingNote']=='0'?'selected ':'').'value="0">'._('No').'</option> </select></td> @@ -427,7 +427,7 @@ //UpdateCurrencyRatesDaily echo '<tr style="outline: 1px solid"><td>' . _('Auto Update Exchange Rates Daily') . ':</td> - <td><select Name="X_UpdateCurrencyRatesDaily"> + <td><select name="X_UpdateCurrencyRatesDaily"> <option '.($_SESSION['UpdateCurrencyRatesDaily']!='1'?'selected ':'').'value="1">'._('Automatic').'</option> <option '.($_SESSION['UpdateCurrencyRatesDaily']=='0'?'selected ':'').'value="0">'._('Manual').'</option> </select></td> @@ -436,7 +436,7 @@ //Default Packing Note Format echo '<tr style="outline: 1px solid"><td>' . _('Format of Packing Slips') . ':</td> - <td><select Name="X_PackNoteFormat"> + <td><select name="X_PackNoteFormat"> <option '.($_SESSION['PackNoteFormat']=='1'?'selected ':'').'value="1">'._('Laser Printed').'</option> <option '.($_SESSION['PackNoteFormat']=='2'?'selected ':'').'value="2">'._('Special Stationery').'</option> </select></td> @@ -445,7 +445,7 @@ //Default Invoice Format echo '<tr style="outline: 1px solid"><td>' . _('Invoice Orientation') . ':</td> - <td><select Name="X_InvoicePortraitFormat"> + <td><select name="X_InvoicePortraitFormat"> <option '.($_SESSION['InvoicePortraitFormat']=='0'?'selected ':'').'value="0">'._('Landscape').'</option> <option '.($_SESSION['InvoicePortraitFormat']=='1'?'selected ':'').'value="1">'._('Portrait').'</option> </select></td> @@ -454,7 +454,7 @@ //Blind packing note echo '<tr style="outline: 1px solid"><td>' . _('Show company details on packing slips') . ':</td> - <td><select Name="X_DefaultBlindPackNote"> + <td><select name="X_DefaultBlindPackNote"> <option '.($_SESSION['DefaultBlindPackNote']=='1'?'selected ':'').'value="1">'._('Show Company Details').'</option> <option '.($_SESSION['DefaultBlindPackNote']=='2'?'selected ':'').'value="2">'._('Hide Company Details').'</option> </select></td> @@ -463,7 +463,7 @@ // Working days on a week echo '<tr style="outline: 1px solid"><td>' . _('Working Days on a Week') . ':</td> - <td><select Name="X_WorkingDaysWeek"> + <td><select name="X_WorkingDaysWeek"> <option '.($_SESSION['WorkingDaysWeek']=='7'?'selected ':'').'value="7">7 '._('working days').'</option> <option '.($_SESSION['WorkingDaysWeek']=='6'?'selected ':'').'value="6">6 '._('working days').'</option> <option '.($_SESSION['WorkingDaysWeek']=='5'?'selected ':'').'value="5">5 '._('working days').'</option> @@ -473,7 +473,7 @@ // DispatchCutOffTime echo '<tr style="outline: 1px solid"><td>' . _('Dispatch Cut-Off Time') . ':</td> - <td><select Name="X_DispatchCutOffTime">'; + <td><select name="X_DispatchCutOffTime">'; for ($i=0; $i < 24; $i++ ) echo '<option '.($_SESSION['DispatchCutOffTime'] == $i?'selected ':'').'value="'.$i.'">'.$i; echo '</select></td> @@ -481,7 +481,7 @@ // AllowSalesOfZeroCostItems echo '<tr style="outline: 1px solid"><td>' . _('Allow Sales Of Zero Cost Items') . ':</td> - <td><select Name="X_AllowSalesOfZeroCostItems"> + <td><select name="X_AllowSalesOfZeroCostItems"> <option '.($_SESSION['AllowSalesOfZeroCostItems']?'selected ':'').'value="1">'._('Yes').'</option> <option '.(!$_SESSION['AllowSalesOfZeroCostItems']?'selected ':'').'value="0">'._('No').'</option> </select></td> @@ -489,7 +489,7 @@ // CreditingControlledItems_MustExist echo '<tr style="outline: 1px solid"><td>' . _('Controlled Items Must Exist For Crediting') . ':</td> - <td><select Name="X_CreditingControlledItems_MustExist"> + <td><select name="X_CreditingControlledItems_MustExist"> <option '.($_SESSION['CreditingControlledItems_MustExist']?'selected ':'').'value="1">'._('Yes').'</option> <option '.(!$_SESSION['CreditingControlledItems_MustExist']?'selected ':'').'value="0">'._('No').'</option> </select></td> @@ -500,7 +500,7 @@ $ErrMsg = _('Could not load price lists'); $result = DB_query($sql,$db,$ErrMsg); echo '<tr style="outline: 1px solid"><td>' . _('Default Price List') . ':</td>'; -echo '<td><select Name="X_DefaultPriceList">'; +echo '<td><select name="X_DefaultPriceList">'; if( DB_num_rows($result) == 0 ) { echo '<option selected value="">'._('Unavailable'); } else { @@ -516,7 +516,7 @@ $ErrMsg = _('Could not load shippers'); $result = DB_query($sql,$db,$ErrMsg); echo '<tr style="outline: 1px solid"><td>' . _('Default Shipper') . ':</td>'; -echo '<td><select Name="X_Default_Shipper">'; +echo '<td><select name="X_Default_Shipper">'; if( DB_num_rows($result) == 0 ) { echo '<option selected value="">'._('Unavailable') . '</option>'; } else { @@ -529,7 +529,7 @@ // DoFreightCalc echo '<tr style="outline: 1px solid"><td>' . _('Do Freight Calculation') . ':</td> - <td><select Name="X_DoFreightCalc"> + <td><select name="X_DoFreightCalc"> <option '.($_SESSION['DoFreightCalc']?'selected ':'').'value="1">'._('Yes').'</option> <option '.(!$_SESSION['DoFreightCalc']?'selected ':'').'value="0">'._('No').'</option> </select></td> @@ -537,13 +537,13 @@ //FreightChargeAppliesIfLessThan echo '<tr style="outline: 1px solid"><td>' . _('Apply freight charges if an order is less than') . ':</td> - <td><input type="Text" class="number" Name="X_FreightChargeAppliesIfLessThan" size=12 maxlength=12 value="' . $_SESSION['FreightChargeAppliesIfLessThan'] . '"></td> + <td><input type="text" class="number" name="X_FreightChargeAppliesIfLessThan" size=12 maxlength=12 value="' . $_SESSION['FreightChargeAppliesIfLessThan'] . '"></td> <td>' . _('This parameter is only effective if Do Freight Calculation is set to Yes. If it is set to 0 then freight is always charged. The total order value is compared to this value in deciding whether or not to charge freight') .'</td></tr>'; // AutoDebtorNo echo '<tr style="outline: 1px solid"><td>' . _('Create Debtor Codes Automatically') . ':</td> - <td><select Name="X_AutoDebtorNo">'; + <td><select name="X_AutoDebtorNo">'; if ($_SESSION['AutoDebtorNo']==0) { echo '<option selected value=0>' . _('Manual Entry') . '</option>'; @@ -560,7 +560,7 @@ $ErrMsg = _('Could not load tax categories table'); $result = DB_query($sql,$db,$ErrMsg); echo '<tr style="outline: 1px solid"><td>' . _('Default Tax Category') . ':</td>'; -echo '<td><select Name="X_DefaultTaxCategory">'; +echo '<td><select name="X_DefaultTaxCategory">'; if( DB_num_rows($result) == 0 ) { echo '<option selected value="">'._('Unavailable') . '</option>'; } else { @@ -573,8 +573,8 @@ //TaxAuthorityReferenceName -echo '<tr style="outline: 1px solid"><td>' . _('TaxAuthorityReferenceName') . ':</td> - <td><input type="Text" Name="X_TaxAuthotaxcatid, taxcatname FROM taxcategoriesrityReferenceName" size=16 maxlength=25 value="' . $_SESSION['TaxAuthorityReferenceName'] . '"></td> +echo '<tr style="outline: 1px solid"><td>' . _('Tax Authority Reference Name') . ':</td> + <td><input type="text" name="X_TaxAuthorityReferenceName" size="16" maxlength="25" value="' . $_SESSION['TaxAuthorityReferenceName'] . '"></td> <td>' . _('This parameter is what is displayed on tax invoices and credits for the tax authority of the company eg. in Australian this would by A.B.N.: - in NZ it would be GST No: in the UK it would be VAT Regn. No') .'</td></tr>'; // CountryOfOperation @@ -595,14 +595,14 @@ // NumberOfPeriodsOfStockUsage echo '<tr style="outline: 1px solid"><td>' . _('Number Of Periods Of StockUsage') . ':</td> - <td><select Name="X_NumberOfPeriodsOfStockUsage">'; + <td><select name="X_NumberOfPeriodsOfStockUsage">'; for ($i=1; $i <= 12; $i++ ) echo '<option '.($_SESSION['NumberOfPeriodsOfStockUsage'] == $i?'selected ':'').'value="'.$i.'">'.$i; echo '</select></td><td>' . _('In stock usage inquiries this determines how many periods of stock usage to show. An average is calculated over this many periods') .'</td></tr>'; //Show values on GRN echo '<tr style="outline: 1px solid"><td>' . _('Show order values on GRN') . ':</td> - <td><select Name="X_ShowValueOnGRN"> + <td><select name="X_ShowValueOnGRN"> <option '.($_SESSION['ShowValueOnGRN']?'selected ':'').'value="1">'._('Yes').'</option> <option '.(!$_SESSION['ShowValueOnGRN']?'selected ':'').'value="0">'._('No').'</option> </select></td> @@ -611,7 +611,7 @@ // Check_Qty_Charged_vs_Del_Qty echo '<tr style="outline: 1px solid"><td>' . _('Check Quantity Charged vs Deliver Qty') . ':</td> - <td><select Name="X_Check_Qty_Charged_vs_Del_Qty"> + <td><select name="X_Check_Qty_Charged_vs_Del_Qty"> <option '.($_SESSION['Check_Qty_Charged_vs_Del_Qty']?'selected ':'').'value="1">'._('Yes').'</option> <option '.(!$_SESSION['Check_Qty_Charged_vs_Del_Qty']?'selected ':'').'value="0">'._('No').'</option> </select></td> @@ -619,7 +619,7 @@ // Check_Price_Charged_vs_Order_Price echo '<tr style="outline: 1px solid"><td>' . _('Check Price Charged vs Order Price') . ':</td> - <td><select Name="X_Check_Price_Charged_vs_Order_Price"> + <td><select name="X_Check_Price_Charged_vs_Order_Price"> <option '.($_SESSION['Check_Price_Charged_vs_Order_Price']?'selected ':'').'value="1">'._('Yes').'</option> <option '.(!$_SESSION['Check_Price_Charged_vs_Order_Price']?'selected ':'').'value="0">'._('No').'</option> </select></td> @@ -627,24 +627,24 @@ // OverChargeProportion echo '<tr style="outline: 1px solid"><td>' . _('Allowed Over Charge Proportion') . ':</td> - <td><input type="Text" class="number" Name="X_OverChargeProportion" size=4 maxlength=3 value="' . $_SESSION['OverChargeProportion'] . '"></td> + <td><input type="text" class="number" name="X_OverChargeProportion" size=4 maxlength=3 value="' . $_SESSION['OverChargeProportion'] . '"></td> <td>' . _('If check price charges vs Order price is set to yes then this proportion determines the percentage by which invoices can be overcharged with respect to price') .'</td></tr>'; // OverReceiveProportion echo '<tr style="outline: 1px solid"><td>' . _('Allowed Over Receive Proportion') . ':</td> - <td><input type="Text" class="number" Name="X_OverReceiveProportion" size=4 maxlength=3 value="' . $_SESSION['OverReceiveProportion'] . '"></td> + <td><input type="text" class="number" name="X_OverReceiveProportion" size=4 maxlength=3 value="' . $_SESSION['OverReceiveProportion'] . '"></td> <td>' . _('If check quantity charged vs delivery quantity is set to yes then this proportion determines the percentage by which invoices can be overcharged with respect to delivery') .'</td></tr>'; // PO_AllowSameItemMultipleTimes echo '<tr style="outline: 1px solid"><td>' . _('Purchase Order Allows Same Item Multiple Times') . ':</td> - <td><select Name="X_PO_AllowSameItemMultipleTimes"> + <td><select name="X_PO_AllowSameItemMultipleTimes"> <option '.($_SESSION['PO_AllowSameItemMultipleTimes']?'selected ':'').'value="1">'._('Yes') . '</option> <option '.(!$_SESSION['PO_AllowSameItemMultipleTimes']?'selected ':'').'value="0">'._('No') . '</option> </select></td><td>' . _('If a purchase order can have the same item on the order several times this parameter should be set to yes') . '</td></tr>'; // AutoAuthorisePO echo '<tr style="outline: 1px solid"><td>' . _('Automatically authorise purchase orders if user has authority') . ':</td> - <td><select Name="X_AutoAuthorisePO"> + <td><select name="X_AutoAuthorisePO"> <option '.($_SESSION['AutoAuthorisePO'] ?'selected ':'').'value="1">'._('Yes').'</option> <option '.(!$_SESSION['AutoAuthorisePO'] ?'selected ':'').'value="0">'._('No').'</option> </select></td><td>' . _('If the user changing an existing purchase order or adding a new puchase order is set up to authorise purchase orders and the order is within their limit, then the purchase order status is automatically set to authorised') . '</td></tr>'; @@ -667,7 +667,7 @@ 11=>_('November'), 12=>_('December') ); echo '<tr style="outline: 1px solid"><td>' . _('Financial Year Ends On') . ':</td> - <td><select Name="X_YearEnd">'; + <td><select name="X_YearEnd">'; for ($i=1; $i <= sizeof($MonthNames); $i++ ) echo '<option '.($_SESSION['YearEnd'] == $i ? 'selected ' : '').'value="'.$i.'">'.$MonthNames[$i] . '</option>'; echo '</select></td> @@ -872,11 +872,14 @@ echo '<tr style="outline: 1px solid"><td>' . _('Prohibit GL Journals to Periods Prior To') . ':</td> - <td><select Name="X_ProhibitPostingsBefore">'; + <td><select name="X_ProhibitPostingsBefore">'; $sql = "SELECT lastdate_in_period FROM periods ORDER BY periodno DESC"; $ErrMsg = _('Could not load periods table'); $result = DB_query($sql,$db,$ErrMsg); +if ($_SESSION['ProhibitPostingsBefore']=='' OR $_SESSION['ProhibitPostingsBefore']=='1900-01-01' OR !isset($_SESSION['ProhibitPostingsBefore'])){ + echo '<option selected value="1900-01-01">' . ConvertSQLDate('1900-01-01') . '</option>'; +} while ($PeriodRow = DB_fetch_row($result)){ if ($_SESSION['ProhibitPostingsBefore']==$PeriodRow[0]){ echo '<option selected value="' . $PeriodRow[0] . '">' . ConvertSQLDate($PeriodRow[0]) . '</option>'; @@ -971,7 +974,7 @@ //DefineControlledOnWOEntry echo '<tr style="outline: 1px solid"><td>' . _('Controlled Items Defined At Work Order Entry') . ':</td> - <td><select Name="X_DefineControlledOnWOEntry"> + <td><select name="X_DefineControlledOnWOEntry"> <option '.($_SESSION['DefineControlledOnWOEntry']?'selected ':'').'value="1">'._('Yes').'</option> <option '.(!$_SESSION['DefineControlledOnWOEntry']?'selected ':'').'value="0">'._('No').'</option> </select></td> @@ -992,7 +995,7 @@ echo '</select></td><td>' . _('Setting this parameter to Yes will ensure that when a sales order is placed if there is insufficient stock then a new work order is created at the default factory location') . '</td></tr>' ; echo '<tr style="outline: 1px solid"><td>' . _('Default Factory Location') . ':</td> - <td><select Name="X_DefaultFactoryLocation">'; + <td><select name="X_DefaultFactoryLocation">'; $sql = "SELECT loccode,locationname FROM locations"; $ErrMsg = _('Could not load locations table'); @@ -1016,7 +1019,7 @@ echo '</table> - <br /><div class="centre"><input type="Submit" Name="submit" value="' . _('Update') . '"></div> + <br /><div class="centre"><input type="Submit" name="submit" value="' . _('Update') . '"></div> </form>'; include('includes/footer.inc'); Modified: trunk/doc/Change.log =================================================================== --- trunk/doc/Change.log 2011-08-14 04:28:42 UTC (rev 4658) +++ trunk/doc/Change.log 2011-08-14 09:22:19 UTC (rev 4659) @@ -1,5 +1,6 @@ webERP Change Log +14/8/11 Phil: SystemParameters.php default ProhibitPostingsBefore to 1900-01-01 when no default is currently set - can cause errors at the moment as defaults to the latest period if not previously set. 14/8/11 Phil: Stocks.php now does a journal for any work in progress on a change of category where the new category has a different GL account for WIP - and bug fixes as per Ricard 12/8/11 Phil: Backed out changes on 7/8 that prevented SelectProduct.php transaction links - now only purchase order links blocked if an item is obsolete 12/8/11 Phil: CounterSales.php apply discountmatrix fixes This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |