This list is closed, nobody may subscribe to it.
2011 |
Jan
(14) |
Feb
(42) |
Mar
(56) |
Apr
(60) |
May
(54) |
Jun
(48) |
Jul
(74) |
Aug
(52) |
Sep
(68) |
Oct
(64) |
Nov
(42) |
Dec
(62) |
---|---|---|---|---|---|---|---|---|---|---|---|---|
2012 |
Jan
(142) |
Feb
(270) |
Mar
(374) |
Apr
(230) |
May
(214) |
Jun
(116) |
Jul
(234) |
Aug
(66) |
Sep
(120) |
Oct
(16) |
Nov
(17) |
Dec
(41) |
2013 |
Jan
(19) |
Feb
(18) |
Mar
(8) |
Apr
(40) |
May
(121) |
Jun
(42) |
Jul
(127) |
Aug
(145) |
Sep
(27) |
Oct
(38) |
Nov
(83) |
Dec
(61) |
2014 |
Jan
(33) |
Feb
(35) |
Mar
(59) |
Apr
(41) |
May
(38) |
Jun
(45) |
Jul
(17) |
Aug
(58) |
Sep
(46) |
Oct
(51) |
Nov
(55) |
Dec
(36) |
2015 |
Jan
(57) |
Feb
(67) |
Mar
(70) |
Apr
(34) |
May
(32) |
Jun
(11) |
Jul
(3) |
Aug
(17) |
Sep
(16) |
Oct
(13) |
Nov
(30) |
Dec
(30) |
2016 |
Jan
(17) |
Feb
(12) |
Mar
(17) |
Apr
(20) |
May
(47) |
Jun
(15) |
Jul
(13) |
Aug
(30) |
Sep
(32) |
Oct
(20) |
Nov
(32) |
Dec
(24) |
2017 |
Jan
(16) |
Feb
|
Mar
(11) |
Apr
(11) |
May
(5) |
Jun
(42) |
Jul
(9) |
Aug
(10) |
Sep
(14) |
Oct
(15) |
Nov
(2) |
Dec
(29) |
2018 |
Jan
(28) |
Feb
(49) |
Mar
|
Apr
|
May
|
Jun
|
Jul
|
Aug
|
Sep
|
Oct
|
Nov
|
Dec
|
From: <dai...@us...> - 2012-01-20 23:11:06
|
Revision: 4825 http://web-erp.svn.sourceforge.net/web-erp/?rev=4825&view=rev Author: daintree Date: 2012-01-20 23:11:00 +0000 (Fri, 20 Jan 2012) Log Message: ----------- Added Paths: ----------- trunk/sql/mysql/upgrade4.06-4.07.sql Added: trunk/sql/mysql/upgrade4.06-4.07.sql =================================================================== --- trunk/sql/mysql/upgrade4.06-4.07.sql (rev 0) +++ trunk/sql/mysql/upgrade4.06-4.07.sql 2012-01-20 23:11:00 UTC (rev 4825) @@ -0,0 +1,36 @@ +CREATE TABLE `tenders` ( + `tenderid` int(11) NOT NULL DEFAULT '0', + `location` varchar(5) NOT NULL DEFAULT '', + `address1` varchar(40) NOT NULL DEFAULT '', + `address2` varchar(40) NOT NULL DEFAULT '', + `address3` varchar(40) NOT NULL DEFAULT '', + `address4` varchar(40) NOT NULL DEFAULT '', + `address5` varchar(20) NOT NULL DEFAULT '', + `address6` varchar(15) NOT NULL DEFAULT '', + `telephone` varchar(25) NOT NULL DEFAULT '', + `closed` int(2) NOT NULL DEFAULT '0', + `requiredbydate` datetime NOT NULL DEFAULT '0000-00-00 00:00:00', + PRIMARY KEY (`tenderid`) +) ENGINE=InnoDB DEFAULT CHARSET=utf8; + +CREATE TABLE `tenderitems` ( + `tenderid` int(11) NOT NULL DEFAULT '0', + `stockid` varchar(20) NOT NULL DEFAULT '', + `quantity` varchar(40) NOT NULL DEFAULT '', + `units` varchar(20) NOT NULL DEFAULT 'each', + PRIMARY KEY (`tenderid`,`stockid`) +) ENGINE=InnoDB DEFAULT CHARSET=utf8; + +CREATE TABLE `tendersuppliers` ( + `tenderid` int(11) NOT NULL DEFAULT '0', + `supplierid` varchar(10) NOT NULL DEFAULT '', + `email` varchar(40) NOT NULL DEFAULT '', + `responded` int(2) NOT NULL DEFAULT '0', + PRIMARY KEY (`tenderid`,`supplierid`) +) ENGINE=InnoDB DEFAULT CHARSET=utf8; + +INSERT INTO `scripts` (`script` ,`pagesecurity` ,`description`) VALUES ('SupplierTenderCreate.php', '4', 'Create or Edit tenders'); +ALTER TABLE `www_users` ADD `cancreatetender` tinyint(1) NOT NULL DEFAULT 0 AFTER `fullaccess`; +INSERT INTO `systypes` (`typeid`, `typename`, `typeno`) VALUES (37, 'Tenders', 0); + +UPDATE config SET confvalue='4.07.0' WHERE confname='VersionNumber'; \ No newline at end of file This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <dai...@us...> - 2012-01-20 23:11:06
|
Revision: 4825 http://web-erp.svn.sourceforge.net/web-erp/?rev=4825&view=rev Author: daintree Date: 2012-01-20 23:11:00 +0000 (Fri, 20 Jan 2012) Log Message: ----------- Added Paths: ----------- trunk/sql/mysql/upgrade4.06-4.07.sql Added: trunk/sql/mysql/upgrade4.06-4.07.sql =================================================================== --- trunk/sql/mysql/upgrade4.06-4.07.sql (rev 0) +++ trunk/sql/mysql/upgrade4.06-4.07.sql 2012-01-20 23:11:00 UTC (rev 4825) @@ -0,0 +1,36 @@ +CREATE TABLE `tenders` ( + `tenderid` int(11) NOT NULL DEFAULT '0', + `location` varchar(5) NOT NULL DEFAULT '', + `address1` varchar(40) NOT NULL DEFAULT '', + `address2` varchar(40) NOT NULL DEFAULT '', + `address3` varchar(40) NOT NULL DEFAULT '', + `address4` varchar(40) NOT NULL DEFAULT '', + `address5` varchar(20) NOT NULL DEFAULT '', + `address6` varchar(15) NOT NULL DEFAULT '', + `telephone` varchar(25) NOT NULL DEFAULT '', + `closed` int(2) NOT NULL DEFAULT '0', + `requiredbydate` datetime NOT NULL DEFAULT '0000-00-00 00:00:00', + PRIMARY KEY (`tenderid`) +) ENGINE=InnoDB DEFAULT CHARSET=utf8; + +CREATE TABLE `tenderitems` ( + `tenderid` int(11) NOT NULL DEFAULT '0', + `stockid` varchar(20) NOT NULL DEFAULT '', + `quantity` varchar(40) NOT NULL DEFAULT '', + `units` varchar(20) NOT NULL DEFAULT 'each', + PRIMARY KEY (`tenderid`,`stockid`) +) ENGINE=InnoDB DEFAULT CHARSET=utf8; + +CREATE TABLE `tendersuppliers` ( + `tenderid` int(11) NOT NULL DEFAULT '0', + `supplierid` varchar(10) NOT NULL DEFAULT '', + `email` varchar(40) NOT NULL DEFAULT '', + `responded` int(2) NOT NULL DEFAULT '0', + PRIMARY KEY (`tenderid`,`supplierid`) +) ENGINE=InnoDB DEFAULT CHARSET=utf8; + +INSERT INTO `scripts` (`script` ,`pagesecurity` ,`description`) VALUES ('SupplierTenderCreate.php', '4', 'Create or Edit tenders'); +ALTER TABLE `www_users` ADD `cancreatetender` tinyint(1) NOT NULL DEFAULT 0 AFTER `fullaccess`; +INSERT INTO `systypes` (`typeid`, `typename`, `typeno`) VALUES (37, 'Tenders', 0); + +UPDATE config SET confvalue='4.07.0' WHERE confname='VersionNumber'; \ No newline at end of file This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <dai...@us...> - 2012-01-20 23:10:26
|
Revision: 4824 http://web-erp.svn.sourceforge.net/web-erp/?rev=4824&view=rev Author: daintree Date: 2012-01-20 23:10:18 +0000 (Fri, 20 Jan 2012) Log Message: ----------- Modified Paths: -------------- trunk/SupplierTenderCreate.php trunk/SupplierTenders.php trunk/UpgradeDatabase.php trunk/api/api_stock.php trunk/api/api_xml-rpc.php trunk/includes/DefineOfferClass.php trunk/includes/DefineTenderClass.php trunk/sql/mysql/upgrade4.05-4.06.sql Modified: trunk/SupplierTenderCreate.php =================================================================== --- trunk/SupplierTenderCreate.php 2012-01-20 22:55:59 UTC (rev 4823) +++ trunk/SupplierTenderCreate.php 2012-01-20 23:10:18 UTC (rev 4824) @@ -1,5 +1,5 @@ <?php -/* $Id$*/ +/* $Id: SupplierTenderCreate.php 4821 2012-01-20 13:48:53Z tim_schofield $ */ include('includes/DefineTenderClass.php'); include('includes/SQL_CommonFunctions.inc'); @@ -7,11 +7,11 @@ $Maximum_Number_Of_Parts_To_Show=50; -if (isset($_GET['New']) and isset($_SESSION['tender'])) { +if (isset($_GET['New']) AND isset($_SESSION['tender'])) { unset($_SESSION['tender']); } -if (isset($_GET['New']) and $_SESSION['CanCreateTender']==0) { +if (isset($_GET['New']) AND $_SESSION['CanCreateTender']==0) { $title = _('Authorisation Problem'); include('includes/header.inc'); echo '<p class="page_title_text"><img src="'.$rootpath.'/css/'.$theme.'/images/supplier.png" title="' . $title . '" alt="" /> '.$title . '</p>'; @@ -21,7 +21,7 @@ exit; } -if (isset($_GET['Edit']) and $_SESSION['CanCreateTender']==0) { +if (isset($_GET['Edit']) AND $_SESSION['CanCreateTender']==0) { $title = _('Authorisation Problem'); include('includes/header.inc'); echo '<p class="page_title_text"><img src="'.$rootpath.'/css/'.$theme.'/images/supplier.png" title="' . $title . '" alt="" /> '.$title . '</p>'; @@ -188,7 +188,7 @@ $ShowTender = 1; } -if (isset($_POST['NewItem']) and !isset($_POST['Refresh'])) { +if (isset($_POST['NewItem']) AND !isset($_POST['Refresh'])) { foreach ($_POST as $key => $value) { if (mb_substr($key,0,7)=='StockID') { $Index = mb_substr($key,7,mb_strlen($key)-7); @@ -315,7 +315,7 @@ $LocnResult = DB_query($sql,$db); while ($LocnRow=DB_fetch_array($LocnResult)){ - if ((isset($_SESSION['tender']->Location) and $_SESSION['tender']->Location == $LocnRow['loccode'])){ + if ((isset($_SESSION['tender']->Location) AND $_SESSION['tender']->Location == $LocnRow['loccode'])){ echo '<option selected="True" value="' . $LocnRow['loccode'] . '">' . $LocnRow['locationname'] . '</option>'; } else { echo '<option value="' . $LocnRow['loccode'] . '">' . $LocnRow['locationname'] . '</option>'; @@ -402,7 +402,7 @@ echo '<div class="centre"><input type="submit" name="Suppliers" value="' . _('Select Suppliers') . '" />'; echo '<input type="submit" name="Items" value="' . _('Select Item Details') . '" /></div><br />'; - if ($_SESSION['tender']->LinesOnTender > 0 and $_SESSION['tender']->SuppliersOnTender > 0) { + if ($_SESSION['tender']->LinesOnTender > 0 AND $_SESSION['tender']->SuppliersOnTender > 0) { echo '<div class="centre"><input type="submit" name="Save" value="' . _('Save Tender') . '" /></div>'; } echo '</form>'; @@ -527,18 +527,20 @@ echo '<br />'; } echo '<input type="hidden" name="Search" value="' . _('Search Now') . '" />'; - echo '<br /><br />'; - echo '<br /><table cellpadding="2" colspan="7">'; - $tableheader = '<tr> - <th>' . _('Code') . '</th> - <th>' . _('Supplier Name') . '</th> - <th>' . _('Currency') . '</th> - <th>' . _('Address 1') . '</th> - <th>' . _('Address 2') . '</th> - <th>' . _('Address 3') . '</th> - <th>' . _('Address 4') . '</th> - </tr>'; - echo $tableheader; + echo '<br /> + <br /> + <br /> + <table cellpadding="2" colspan="7">'; + $TableHeader = '<tr> + <th>' . _('Code') . '</th> + <th>' . _('Supplier Name') . '</th> + <th>' . _('Currency') . '</th> + <th>' . _('Address 1') . '</th> + <th>' . _('Address 2') . '</th> + <th>' . _('Address 3') . '</th> + <th>' . _('Address 4') . '</th> + </tr>'; + echo $TableHeader; $j = 1; $k = 0; //row counter to determine background colour $RowIndex = 0; @@ -575,9 +577,9 @@ echo '<input type="hidden" name="FormID" value="' . $_SESSION['FormID'] . '" />'; echo '<p class="page_title_text"><img src="' . $rootpath . '/css/' . $theme . '/images/magnifier.png" title="' . _('Search') . '" alt="" />' . ' ' . _('Search for Inventory Items') . '</p>'; $sql = "SELECT categoryid, - categorydescription - FROM stockcategory - ORDER BY categorydescription"; + categorydescription + FROM stockcategory + ORDER BY categorydescription"; $result = DB_query($sql, $db); if (DB_num_rows($result) == 0) { echo '<br /><font size="4" color="red">' . _('Problem Report') . ':</font><br />' . @@ -585,11 +587,11 @@ echo '<br /><a href="' . $rootpath . '/StockCategories.php">' . _('Define Stock Categories') . '</a>'; exit; } - echo '<table class="selection"><tr>'; - echo '<td>' . _('In Stock Category') . ':'; - echo '<select name="StockCat">'; + echo '<table class="selection"> + <tr> + <td>' . _('In Stock Category') . ':<select name="StockCat">'; if (!isset($_POST['StockCat'])) { - $_POST['StockCat'] = ""; + $_POST['StockCat'] = ''; } if ($_POST['StockCat'] == 'All') { echo '<option selected="True" value="All">' . _('All') . '</option>'; @@ -603,25 +605,34 @@ echo '<option value="' . $myrow1['categoryid'] . '">' . $myrow1['categorydescription'] . '</option>'; } } - echo '</select>'; - echo '<td>' . _('Enter partial') . '<b> ' . _('Description') . '</b>:</td><td>'; + echo '</select></td> + <td>' . _('Enter partial') . '<b> ' . _('Description') . '</b>:</td> + <td>'; if (isset($_POST['Keywords'])) { echo '<input type="text" name="Keywords" value="' . $_POST['Keywords'] . '" size="20" maxlength="25" />'; } else { echo '<input type="text" name="Keywords" size="20" maxlength="25" />'; } - echo '</td></tr><tr><td></td>'; - echo '<td><font size="3"><b>' . _('OR') . ' ' . '</b></font>' . _('Enter partial') . ' <b>' . _('Stock Code') . '</b>:</td>'; - echo '<td>'; + echo '</td> + </tr> + <tr> + <td></td> + <td><font size="3"><b>' . _('OR') . ' ' . '</b></font>' . _('Enter partial') . ' <b>' . _('Stock Code') . '</b>:</td> + <td>'; if (isset($_POST['StockCode'])) { echo '<input type="text" name="StockCode" value="' . $_POST['StockCode'] . '" size="15" maxlength="18" />'; } else { echo '<input type="text" name="StockCode" size="15" maxlength="18" />'; } - echo '</td></tr></table><br />'; - echo '<div class="centre"><input type="submit" name="Search" value="' . _('Search Now') . '" /></div><br /></form>'; + echo '</td></tr> + </table> + <br /> + <div class="centre"> + <input type="submit" name="Search" value="' . _('Search Now') . '" /> + </div> + <br /> + </form>'; echo '<script type="text/javascript">defaultControl(document.forms[0].StockCode);</script>'; - echo '</form>'; } if (isset($_POST['Search'])){ /*ie seach for stock items */ @@ -638,29 +649,29 @@ if ($_POST['StockCat']=='All'){ $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!='A' - AND stockmaster.mbflag!='K' - and stockmaster.discontinued!=1 - AND stockmaster.description " . LIKE . " '$SearchString' - ORDER BY stockmaster.stockid"; + stockmaster.description, + stockmaster.units + FROM stockmaster INNER JOIN stockcategory + ON stockmaster.categoryid=stockcategory.categoryid + WHERE stockmaster.mbflag!='D' + AND stockmaster.mbflag!='A' + AND stockmaster.mbflag!='K' + AND stockmaster.discontinued!=1 + AND stockmaster.description " . LIKE . " '$SearchString' + ORDER BY stockmaster.stockid"; } 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!='A' - AND stockmaster.mbflag!='K' - and stockmaster.discontinued!=1 - AND stockmaster.description " . LIKE . " '$SearchString' - AND stockmaster.categoryid='" . $_POST['StockCat'] . "' - ORDER BY stockmaster.stockid"; + stockmaster.description, + stockmaster.units + FROM stockmaster INNER JOIN stockcategory + ON stockmaster.categoryid=stockcategory.categoryid + WHERE stockmaster.mbflag!='D' + AND stockmaster.mbflag!='A' + AND stockmaster.mbflag!='K' + AND stockmaster.discontinued!=1 + AND stockmaster.description " . LIKE . " '$SearchString' + AND stockmaster.categoryid='" . $_POST['StockCat'] . "' + ORDER BY stockmaster.stockid"; } } elseif ($_POST['StockCode']){ @@ -669,55 +680,55 @@ if ($_POST['StockCat']=='All'){ $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!='A' - AND stockmaster.mbflag!='K' - and stockmaster.discontinued!=1 - AND stockmaster.stockid " . LIKE . " '" . $_POST['StockCode'] . "' - ORDER BY stockmaster.stockid"; + stockmaster.description, + stockmaster.units + FROM stockmaster INNER JOIN stockcategory + ON stockmaster.categoryid=stockcategory.categoryid + WHERE stockmaster.mbflag!='D' + AND stockmaster.mbflag!='A' + AND stockmaster.mbflag!='K' + AND stockmaster.discontinued!=1 + AND stockmaster.stockid " . LIKE . " '" . $_POST['StockCode'] . "' + ORDER BY stockmaster.stockid"; } 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!='A' - AND stockmaster.mbflag!='K' - and stockmaster.discontinued!=1 - AND stockmaster.stockid " . LIKE . " '" . $_POST['StockCode'] . "' - AND stockmaster.categoryid='" . $_POST['StockCat'] . "' - ORDER BY stockmaster.stockid"; + stockmaster.description, + stockmaster.units + FROM stockmaster INNER JOIN stockcategory + ON stockmaster.categoryid=stockcategory.categoryid + WHERE stockmaster.mbflag!='D' + AND stockmaster.mbflag!='A' + AND stockmaster.mbflag!='K' + AND stockmaster.discontinued!=1 + AND stockmaster.stockid " . LIKE . " '" . $_POST['StockCode'] . "' + AND stockmaster.categoryid='" . $_POST['StockCat'] . "' + ORDER BY stockmaster.stockid"; } } else { if ($_POST['StockCat']=='All'){ $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!='A' - AND stockmaster.mbflag!='K' - and stockmaster.discontinued!=1 - ORDER BY stockmaster.stockid"; + stockmaster.description, + stockmaster.units + FROM stockmaster INNER JOIN stockcategory + ON stockmaster.categoryid=stockcategory.categoryid + WHERE stockmaster.mbflag!='D' + AND stockmaster.mbflag!='A' + AND stockmaster.mbflag!='K' + AND stockmaster.discontinued!=1 + ORDER BY stockmaster.stockid"; } 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!='A' - AND stockmaster.mbflag!='K' - and stockmaster.discontinued!=1 - AND stockmaster.categoryid='" . $_POST['StockCat'] . "' - ORDER BY stockmaster.stockid"; + stockmaster.description, + stockmaster.units + FROM stockmaster INNER JOIN stockcategory + ON stockmaster.categoryid=stockcategory.categoryid + WHERE stockmaster.mbflag!='D' + AND stockmaster.mbflag!='A' + AND stockmaster.mbflag!='K' + AND stockmaster.discontinued!=1 + AND stockmaster.categoryid='" . $_POST['StockCat'] . "' + ORDER BY stockmaster.stockid"; } } @@ -725,7 +736,7 @@ $DbgMsg = _('The SQL statement that failed was'); $SearchResult = DB_query($sql,$db,$ErrMsg,$DbgMsg); - if (DB_num_rows($SearchResult)==0 and $debug==1){ + if (DB_num_rows($SearchResult)==0 AND $debug==1){ prnMsg( _('There are no products to display matching the criteria provided'),'warn'); } if (DB_num_rows($SearchResult)==1){ @@ -739,14 +750,14 @@ echo '<table cellpadding="1" colspan="7">'; - $tableheader = '<tr> - <th>' . _('Code') . '</th> - <th>' . _('Description') . '</th> - <th>' . _('Units') . '</th> - <th>' . _('Image') . '</th> - <th>' . _('Quantity') . '</th> - </tr>'; - echo $tableheader; + $TableHeader = '<tr> + <th>' . _('Code') . '</th> + <th>' . _('Description') . '</th> + <th>' . _('Units') . '</th> + <th>' . _('Image') . '</th> + <th>' . _('Quantity') . '</th> + </tr>'; + echo $TableHeader; $i = 0; $k = 0; //row colour counter @@ -761,8 +772,8 @@ $k=1; } - $filename = $myrow['stockid'] . '.jpg'; - if (file_exists( $_SESSION['part_pics_dir'] . '/' . $filename) ) { + $FileName = $myrow['stockid'] . '.jpg'; + if (file_exists( $_SESSION['part_pics_dir'] . '/' . $FileName) ) { $ImageSource = '<img src="'.$rootpath . '/' . $_SESSION['part_pics_dir'] . '/' . $myrow['stockid'] . '.jpg" width="50" height="50" />'; @@ -770,14 +781,13 @@ $ImageSource = '<i>'._('No Image').'</i>'; } - $uom=$myrow['units']; echo '<td>'.$myrow['stockid'].'</td> <td>'.$myrow['description'].'</td> - <td>'.$uom.'</td> + <td>'.$myrow['units'].'</td> <td>'.$ImageSource.'</td> <td><input class="number" type="text" size="6" value="0" name="Qty'.$i.'" /></td> - <input type="hidden" value="'.$uom.'" name="UOM'.$i.'" /> + <input type="hidden" value="'.$myrow['units'].'" name="UOM'.$i.'" /> <input type="hidden" value="'.$myrow['stockid'].'" name="StockID'.$i.'" /> </tr>'; @@ -797,7 +807,11 @@ prnMsg( _('Only the first') . ' ' . $Maximum_Number_Of_Parts_To_Show . ' ' . _('can be displayed') . '. ' . _('Please restrict your search to only the parts required'),'info'); } - echo '<a name="end"></a><br /><div class="centre"><input type="submit" name="NewItem" value="Add to Tender" /></div>'; + echo '<a name="end"></a> + <br /> + <div class="centre"> + <input type="submit" name="NewItem" value="' . _('Add to Tender') . '" /> + </div>'; }#end if SearchResults to show echo '</form>'; Modified: trunk/SupplierTenders.php =================================================================== --- trunk/SupplierTenders.php 2012-01-20 22:55:59 UTC (rev 4823) +++ trunk/SupplierTenders.php 2012-01-20 23:10:18 UTC (rev 4824) @@ -64,15 +64,14 @@ $ItemCode=$value; $Quantity=$_POST['Qty'.$Index]; $Price=$_POST['Price'.$Index]; - $_SESSION['offer']->add_to_offer( - $LineNo, - $ItemCode, - $Quantity, - $_POST['ItemDescription'.$Index], - $Price, - $_POST['UOM'.$Index], - $_POST['DecimalPlaces'.$Index], - $_POST['RequiredByDate'.$Index]); + $_SESSION['offer']->add_to_offer($LineNo, + $ItemCode, + $Quantity, + $_POST['ItemDescription'.$Index], + $Price, + $_POST['UOM'.$Index], + $_POST['DecimalPlaces'.$Index], + $_POST['RequiredByDate'.$Index]); $LineNo++; } } @@ -91,16 +90,18 @@ address6, telephone FROM tenders - LEFT JOIN locations + INNER JOIN locations ON tenders.location=locations.loccode WHERE closed=0 AND tenderid='".$_SESSION['offer']->TenderID."'"; $LocationResult=DB_query($LocationSQL, $db); $MyLocationRow=DB_fetch_row($LocationResult); - $CurrencySQL="SELECT decimalplaces from currencies WHERE currabrev='".$_SESSION['offer']->CurrCode."'"; + $CurrencySQL="SELECT decimalplaces FROM currencies WHERE currabrev='".$_SESSION['offer']->CurrCode."'"; $CurrencyResult=DB_query($CurrencySQL, $db); $CurrencyRow=DB_fetch_array($CurrencyResult); - echo '<tr><td valign="top" style="background-color:#cccce5">' . _('Deliver To') . ':</td><td valign="top" style="background-color:#cccce5">'; + echo '<tr> + <td valign="top" style="background-color:#cccce5">' . _('Deliver To') . ':</td> + <td valign="top" style="background-color:#cccce5">'; for ($i=1; $i<8; $i++) { if ($MyLocationRow[$i]!='') { echo $MyLocationRow[$i] . '<br />'; @@ -109,28 +110,38 @@ echo '</td>'; echo '<th colspan="8" style="vertical-align:top"><font size="2" color="#616161">' . _('Tender Number') . ': ' .$_SESSION['offer']->TenderID . '</font></th>'; echo '<input type="hidden" value="' . $_SESSION['offer']->TenderID . '" name="Tender" />'; - echo '<tr><th>' . stripslashes($_SESSION['CompanyRecord']['coyname']) . '<br />' . _('Item Code') . '</th>'; - echo '<th>' . _('Item Description') . '</th>'; - echo '<th>' . _('Quantity') . '<br />' . _('Offered') . '</th>'; - echo '<th>' . $Supplier . '<br />' . _('Units of Measure') . '</th>'; - echo '<th>' . _('Currency') . '</th>'; - echo '<th>' . $Supplier . '<br />' . _('Price') . '</th>'; - echo '<th>' . _('Line Value') . '</th>'; - echo '<th>' . _('Delivery By') . '</th>'; + echo '<tr> + <th>' . stripslashes($_SESSION['CompanyRecord']['coyname']) . '<br />' . _('Item Code') . '</th> + <th>' . _('Item Description') . '</th> + <th>' . _('Quantity') . '<br />' . _('Offered') . '</th> + <th>' . $Supplier . '<br />' . _('Units of Measure') . '</th> + <th>' . _('Currency') . '</th> + <th>' . $Supplier . '<br />' . _('Price') . '</th> + <th>' . _('Line Value') . '</th> + <th>' . _('Delivery By') . '</th> + </tr>'; + foreach ($_SESSION['offer']->LineItems as $LineItem) { - echo '<tr><td>' . $LineItem->StockID . '</td>'; - echo '<td>' . $LineItem->ItemDescription . '</td>'; - echo '<td class="number"> ' .locale_number_format($LineItem->Quantity, $LineItem->DecimalPlaces) . '</td>'; - echo '<td>' . $LineItem->Units . '</td>'; - echo '<td>' . $_SESSION['offer']->CurrCode . '</td>'; - echo '<td class="number">' . locale_number_format($LineItem->Price, $CurrencyRow['decimalplaces']) . '</td>'; - echo '<td class="number">' . locale_number_format($LineItem->Price*$LineItem->Quantity,$CurrencyRow['decimalplaces']) . '</td>'; - echo '<td>' . $LineItem->ExpiryDate . '</td>'; + echo '<tr> + <td>' . $LineItem->StockID . '</td> + <td>' . $LineItem->ItemDescription . '</td> + <td class="number"> ' .locale_number_format($LineItem->Quantity, $LineItem->DecimalPlaces) . '</td> + <td>' . $LineItem->Units . '</td> + <td>' . $_SESSION['offer']->CurrCode . '</td> + <td class="number">' . locale_number_format($LineItem->Price, $CurrencyRow['decimalplaces']) . '</td> + <td class="number">' . locale_number_format($LineItem->Price*$LineItem->Quantity,$CurrencyRow['decimalplaces']) . '</td> + <td>' . $LineItem->ExpiryDate . '</td> + </tr>'; } - echo '</table><br />'; - echo '<div class="centre"><input type="submit" name="Confirm" value="' . _('Confirm and Send Email') . '" /><br />'; - echo '<br /><input type="submit" name="Cancel" value="' . _('Cancel Offer') . '" /></div>'; - echo '</form>'; + echo '</table> + <br /> + <div class="centre"> + <input type="submit" name="Confirm" value="' . _('Confirm and Send Email') . '" /> + <br /> + <br /> + <input type="submit" name="Cancel" value="' . _('Cancel Offer') . '" /> + </div> + </form>'; include('includes/footer.inc'); exit; } @@ -138,7 +149,7 @@ /* If the supplierID is set then it must be a login from the supplier but if nothing else is * set then the supplier must have just logged in so show them the choices. */ -if (isset($_POST['SupplierID']) and empty($_POST['TenderType']) and empty($_POST['Search']) and empty($_POST['NewItem']) and empty($_GET['Delete'])) { +if (isset($_POST['SupplierID']) AND empty($_POST['TenderType']) AND empty($_POST['Search']) AND empty($_POST['NewItem']) AND empty($_GET['Delete'])) { if (isset($_SESSION['offer'])) { unset($_SESSION['offer']); } @@ -146,18 +157,27 @@ echo '<input type="hidden" name="FormID" value="' . $_SESSION['FormID'] . '" />'; echo '<p class="page_title_text"><img src="' . $rootpath . '/css/' . $theme . '/images/supplier.png" title="' . _('Tenders') . '" alt="" />' . ' ' . _('Create or View Offers from') . ' '.$Supplier.'</p>'; echo '<table class="selection">'; - echo'<tr><td>'._('Select option for tendering').'</td>'; - echo '<td><select name="TenderType">'; - echo '<option value="1">'._('View or Amend outstanding offers from').' '.$Supplier .'</option>'; - echo '<option value="2">'._('Create a new offer from').' '.$Supplier .'</option>'; - echo '<option value="3">'._('View any open tenders without an offer from').' '.$Supplier .'</option>'; - echo '</select></td></tr>'; + echo'<tr> + <td>'._('Select option for tendering').'</td> + <td><select name="TenderType"> + <option value="1">'._('View or Amend outstanding offers from').' '.$Supplier .'</option> + <option value="2">'._('Create a new offer from').' '.$Supplier .'</option> + <option value="3">'._('View any open tenders without an offer from').' '.$Supplier .'</option> + </select></td> + </tr>'; echo '<input type="hidden" name="SupplierID" value="'.$_POST['SupplierID'].'" />'; - echo '<tr><td colspan="2"><div class="centre"><input type="submit" name="submit" value="' . _('Select') . '" /></div></td></tr>'; - echo '</table></form>'; + echo '<tr> + <td colspan="2"> + <div class="centre"> + <input type="submit" name="submit" value="' . _('Select') . '" /> + </div> + </td> + </tr> + </table> + </form>'; } -if (isset($_POST['NewItem']) and !isset($_POST['Refresh'])) { +if (isset($_POST['NewItem']) AND !isset($_POST['Refresh'])) { foreach ($_POST as $key => $value) { if (mb_substr($key,0,7)=='StockID') { $Index = mb_substr($key,7,mb_strlen($key)-7); @@ -165,7 +185,7 @@ $Quantity=filter_number_format($_POST['Qty'.$Index]); $Price=filter_number_format($_POST['Price'.$Index]); $UOM=$_POST['uom'.$Index]; - if (isset($UOM) and $Quantity>0) { + if (isset($UOM) AND $Quantity>0) { $sql="SELECT description, decimalplaces FROM stockmaster WHERE stockid='".$StockID."'"; $result=DB_query($sql, $db); $myrow=DB_fetch_array($result); @@ -183,7 +203,7 @@ } } -if (isset($_POST['Refresh']) and !isset($_POST['NewItem'])) { +if (isset($_POST['Refresh']) AND !isset($_POST['NewItem'])) { foreach ($_POST as $key => $value) { if (mb_substr($key,0,7)=='StockID') { $Index = mb_substr($key,7,mb_strlen($key)-7); @@ -193,11 +213,10 @@ $ExpiryDate=$_POST['expirydate'.$Index]; } if (isset($ExpiryDate)) { - $_SESSION['offer']->update_offer_item( - $Index, - $Quantity, - $Price, - $ExpiryDate); + $_SESSION['offer']->update_offer_item($Index, + $Quantity, + $Price, + $ExpiryDate); unset($ExpiryDate); } } @@ -216,11 +235,10 @@ $ExpiryDate=$value; } if (isset($ExpiryDate)) { - $_SESSION['offer']->update_offer_item( - $LineNo, - $Quantity, - $Price, - $ExpiryDate); + $_SESSION['offer']->update_offer_item($LineNo, + $Quantity, + $Price, + $ExpiryDate); unset($ExpiryDate); } } @@ -244,11 +262,10 @@ $ExpiryDate=$value; } if (isset($ExpiryDate)) { - $_SESSION['offer']->update_offer_item( - $LineNo, - $Quantity, - $Price, - $ExpiryDate); + $_SESSION['offer']->update_offer_item($LineNo, + $Quantity, + $Price, + $ExpiryDate); unset($ExpiryDate); } } @@ -261,7 +278,7 @@ /*The supplier has chosen option 1 */ -if (isset($_POST['TenderType']) and $_POST['TenderType']==1 and !isset($_POST['Refresh'])) { +if (isset($_POST['TenderType']) AND $_POST['TenderType']==1 AND !isset($_POST['Refresh'])) { $sql="SELECT offers.offerid, offers.stockid, stockmaster.description, @@ -278,24 +295,23 @@ $_SESSION['offer']=new Offer($_POST['SupplierID']); $_SESSION['offer']->CurrCode=$Currency; while ($myrow=DB_fetch_array($result)) { - $_SESSION['offer']->add_to_offer( - $myrow['offerid'], - $myrow['stockid'], - $myrow['quantity'], - $myrow['description'], - $myrow['price'], - $myrow['uom'], - $myrow['decimalplaces'], - ConvertSQLDate($myrow['expirydate'])); + $_SESSION['offer']->add_to_offer($myrow['offerid'], + $myrow['stockid'], + $myrow['quantity'], + $myrow['description'], + $myrow['price'], + $myrow['uom'], + $myrow['decimalplaces'], + ConvertSQLDate($myrow['expirydate'])); } } -if (isset($_POST['TenderType']) and $_POST['TenderType']!=3 and isset($_SESSION['offer']) and $_SESSION['offer']->LinesOnOffer>0 or isset($_POST['Update'])) { +if (isset($_POST['TenderType']) AND $_POST['TenderType']!=3 AND isset($_SESSION['offer']) AND $_SESSION['offer']->LinesOnOffer>0 or isset($_POST['Update'])) { echo '<form method="post" action="' . htmlspecialchars($_SERVER['PHP_SELF']) . '">'; echo '<input type="hidden" name="FormID" value="' . $_SESSION['FormID'] . '" />'; echo '<p class="page_title_text"><img src="' . $rootpath . '/css/' . $theme . '/images/supplier.png" title="' . _('Search') . '" alt="" />' . ' ' . _('Items to offer from').' '.$Supplier .'</p>'; - echo '<table>'; - echo '<tr> + echo '<table> + <tr> <th>'._('Stock ID').'</th> <th>'._('Description').'</th> <th>'._('Quantity').'</th> @@ -307,43 +323,53 @@ $k=0; foreach ($_SESSION['offer']->LineItems as $LineItems) { if ($LineItems->Deleted==False) { - if ($k==1){ + if ($LineItems->ExpiryDate < date('Y-m-d')) { + echo '<tr bgcolor="#F7A9A9">'; + } elseif ($k==1){ echo '<tr class="EvenTableRows">'; $k=0; } else { echo '<tr class="OddTableRows">'; $k=1; } - if ($LineItems->ExpiryDate < date('Y-m-d')) { - echo '<tr bgcolor="#F7A9A9">'; - } + echo '<input type="hidden" name="StockID'.$LineItems->LineNo.'" value="'.$LineItems->StockID.'" />'; - echo '<td>'.$LineItems->StockID.'</td>'; - echo '<td>'.$LineItems->ItemDescription.'</td>'; - echo '<td><input type="text" class="number" name="Qty'.$LineItems->LineNo.'" value="'.locale_number_format($LineItems->Quantity,$LineItems->DecimalPlaces).'" /></td>'; - echo '<td>'.$LineItems->Units.'</td>'; - echo '<td><input type="text" class="number" name="Price'.$LineItems->LineNo.'" value="'.locale_number_format($LineItems->Price,2,'.','').'" /></td>'; - echo '<td class="number">'.locale_number_format($LineItems->Price*$LineItems->Quantity,2).'</td>'; - echo '<td><input type="text" size="11" class="date" alt="'.$_SESSION['DefaultDateFormat'].'" name="expirydate'.$LineItems->LineNo.'" value="'.$LineItems->ExpiryDate.'" /></td>'; - echo '<td><a href="' . htmlspecialchars($_SERVER['PHP_SELF']) . '?Delete=' . $LineItems->LineNo . '&Type=' . $_POST['TenderType'] . '">' . _('Remove') . '</a></td></tr>'; - echo '</tr>'; + echo '<td>'.$LineItems->StockID.'</td> + <td>'.$LineItems->ItemDescription.'</td> + <td><input type="text" class="number" name="Qty'.$LineItems->LineNo.'" value="'.locale_number_format($LineItems->Quantity,$LineItems->DecimalPlaces).'" /></td> + <td>'.$LineItems->Units.'</td> + <td><input type="text" class="number" name="Price'.$LineItems->LineNo.'" value="'.locale_number_format($LineItems->Price,2,'.','').'" /></td> + <td class="number">'.locale_number_format($LineItems->Price*$LineItems->Quantity,2).'</td> + <td><input type="text" size="11" class="date" alt="'.$_SESSION['DefaultDateFormat'].'" name="expirydate'.$LineItems->LineNo.'" value="'.$LineItems->ExpiryDate.'" /></td> + <td><a href="' . htmlspecialchars($_SERVER['PHP_SELF']) . '?Delete=' . $LineItems->LineNo . '&Type=' . $_POST['TenderType'] . '">' . _('Remove') . '</a></td> + </tr>'; } } echo '</table>'; echo '<input type="hidden" name="TenderType" value="'.$_POST['TenderType'].'" />'; if ($_POST['TenderType']==1) { - echo '<br /><div class="centre"><input type="submit" name="Update" value="Update offer" />'; - echo '<input type="submit" name="Refresh" value="Refresh screen" /></div>'; + echo '<br /> + <div class="centre"> + <input type="submit" name="Update" value="Update offer" /> + <input type="submit" name="Refresh" value="Refresh screen" /> + </div>'; } else if ($_POST['TenderType']==2) { - echo '<br /><div class="centre"><input type="submit" name="Save" value="Save offer">'; - echo '<input type="submit" name="Refresh" value="Refresh screen" /></div>'; + echo '<br /> + <div class="centre"> + <input type="submit" name="Save" value="Save offer"> + <input type="submit" name="Refresh" value="Refresh screen" /> + </div>'; } echo '</form>'; } /*The supplier has chosen option 2 */ -if (isset($_POST['TenderType']) and $_POST['TenderType']==2 and !isset($_POST['Search']) or isset($_GET['Delete'])) { +if (isset($_POST['TenderType']) + AND $_POST['TenderType']==2 + AND !isset($_POST['Search']) + OR isset($_GET['Delete'])) { + if (!isset($_SESSION['offer'])) { $_SESSION['offer']=new Offer($_POST['SupplierID']); } @@ -352,9 +378,9 @@ echo '<p class="page_title_text"><img src="' . $rootpath . '/css/' . $theme . '/images/magnifier.png" title="' . _('Search') . '" alt="" />' . ' ' . _('Search for Inventory Items') . '</p>'; $sql = "SELECT categoryid, - categorydescription - FROM stockcategory - ORDER BY categorydescription"; + categorydescription + FROM stockcategory + ORDER BY categorydescription"; $result = DB_query($sql, $db); if (DB_num_rows($result) == 0) { @@ -390,23 +416,37 @@ } echo '<input type="hidden" name="TenderType" value="'.$_POST['TenderType'].'" />'; echo '<input type="hidden" name="SupplierID" value="'.$_POST['SupplierID'].'" />'; - echo '</td></tr><tr><td></td>'; - echo '<td><font size="3"><b>' . _('OR') . ' ' . '</b></font>' . _('Enter partial') . ' <b>' . _('Stock Code') . '</b>:</td>'; - echo '<td>'; + echo '</td> + </tr> + <tr> + <td></td> + <td><font size="3"><b>' . _('OR') . ' ' . '</b></font>' . _('Enter partial') . ' <b>' . _('Stock Code') . '</b>:</td> + <td>'; if (isset($_POST['StockCode'])) { echo '<input type="text" name="StockCode" value="' . $_POST['StockCode'] . '" size="15" maxlength="18" />'; } else { echo '<input type="text" name="StockCode" size="15" maxlength="18" />'; } - echo '</td></tr></table><br />'; - echo '<div class="centre"><input type="submit" name="Search" value="' . _('Search Now') . '" /></div><br /></form>'; + echo '</td> + </tr> + </table> + <br /> + <div class="centre"> + <input type="submit" name="Search" value="' . _('Search Now') . '" /> + </div> + <br /> + </form>'; echo '<script type="text/javascript">defaultControl(document.forms[0].StockCode);</script>'; echo '</form>'; } /*The supplier has chosen option 3 */ -if (isset($_POST['TenderType']) and $_POST['TenderType']==3 and !isset($_POST['Search']) or isset($_GET['Delete'])) { +if (isset($_POST['TenderType']) + AND $_POST['TenderType']==3 + AND !isset($_POST['Search']) + OR isset($_GET['Delete'])) { + echo '<p class="page_title_text"><img src="' . $rootpath . '/css/' . $theme . '/images/supplier.png" title="' . _('Tenders') . '" alt="" />' . ' ' . _('Tenders Waiting For Offers').'</p>'; $sql="SELECT DISTINCT tendersuppliers.tenderid, suppliers.currcode @@ -421,7 +461,9 @@ ORDER BY tendersuppliers.tenderid"; $result=DB_query($sql, $db); echo '<table class="selection">'; - echo '<tr><th colspan="13"><font size="3" color="#616161">' . _('Outstanding Tenders Waiting For Offer') . '</font></th></tr>'; + echo '<tr> + <th colspan="13"><font size="3" color="#616161">' . _('Outstanding Tenders Waiting For Offer') . '</font></th> + </tr>'; while ($myrow=DB_fetch_row($result)) { echo '<form action="' . $_SERVER['PHP_SELF'] . '" method="post">'; echo '<input type="hidden" name="FormID" value="' . $_SESSION['FormID'] . '" />'; @@ -436,13 +478,15 @@ address6, telephone FROM tenders - LEFT JOIN locations + INNER JOIN locations ON tenders.location=locations.loccode WHERE closed=0 AND tenderid='".$myrow[0]."'"; $LocationResult=DB_query($LocationSQL, $db); $MyLocationRow=DB_fetch_row($LocationResult); - echo '<tr><td valign="top" style="background-color:#cccce5">' . _('Deliver To') . ':</td><td valign="top" style="background-color:#cccce5">'; + echo '<tr> + <td valign="top" style="background-color:#cccce5">' . _('Deliver To') . ':</td> + <td valign="top" style="background-color:#cccce5">'; for ($i=1; $i<8; $i++) { if ($MyLocationRow[$i]!='') { echo $MyLocationRow[$i] . '<br />'; @@ -451,7 +495,8 @@ echo '</td>'; echo '<th colspan="8" style="vertical-align:top"><font size="2" color="#616161">' . _('Tender Number') . ': ' .$myrow[0] . '</font></th>'; echo '<input type="hidden" value="' . $myrow[0] . '" name="Tender" />'; - echo '<th><input type="submit" value="' . _('Process') . "\n" . _('Tender') . '" name="Process" /></th></tr>'; + echo '<th><input type="submit" value="' . _('Process') . "\n" . _('Tender') . '" name="Process" /></th> + </tr>'; $ItemSQL="SELECT tenderitems.tenderid, tenderitems.stockid, stockmaster.description, @@ -471,37 +516,42 @@ ON tenders.tenderid=tenderitems.tenderid WHERE tenderitems.tenderid='" . $myrow[0] . "'"; $ItemResult=DB_query($ItemSQL, $db); - echo '<tr><th>' . stripslashes($_SESSION['CompanyRecord']['coyname']) . '<br />' . _('Item Code') . '</th>'; - echo '<th>' . _('Item Description') . '</th>'; - echo '<th>' . $Supplier . '<br />' . _('Item Code') . '</th>'; - echo '<th>' . _('Quantity') . '<br />' . _('Required') . '</th>'; - echo '<th>' . stripslashes($_SESSION['CompanyRecord']['coyname']) . '<br />' . _('Units of Measure') . '</th>'; - echo '<th>' . _('Required By') . '</th>'; - echo '<th>' . _('Quantity') . '<br />' . _('Offered') . '</th>'; - echo '<th>' . $Supplier . '<br />' . _('Units of Measure') . '</th>'; - echo '<th>' . _('Currency') . '</th>'; - echo '<th>' . $Supplier . '<br />' . _('Price') . '</th>'; - echo '<th>' . _('Delivery By') . '</th>'; + echo '<tr> + <th>' . stripslashes($_SESSION['CompanyRecord']['coyname']) . '<br />' . _('Item Code') . '</th> + <th>' . _('Item Description') . '</th> + <th>' . $Supplier . '<br />' . _('Item Code') . '</th> + <th>' . _('Quantity') . '<br />' . _('Required') . '</th> + <th>' . stripslashes($_SESSION['CompanyRecord']['coyname']) . '<br />' . _('Units of Measure') . '</th> + <th>' . _('Required By') . '</th> + <th>' . _('Quantity') . '<br />' . _('Offered') . '</th> + <th>' . $Supplier . '<br />' . _('Units of Measure') . '</th> + <th>' . _('Currency') . '</th> + <th>' . $Supplier . '<br />' . _('Price') . '</th> + <th>' . _('Delivery By') . '</th> + </tr>'; $i=0; while ($MyItemRow=DB_fetch_array($ItemResult)) { - echo '<tr><td>' . $MyItemRow['stockid'] . '</td>'; - echo '<td>' . $MyItemRow['description'] . '</td>'; - echo '<input type="hidden" name="StockID'. $i . '" value="' . $MyItemRow['stockid'] . '" />'; - echo '<input type="hidden" name="ItemDescription'. $i . '" value="' . $MyItemRow['description'] . '" />'; - echo '<td>' . $MyItemRow['suppliers_partno'] . '</td>'; - echo '<td class="number">' . locale_number_format($MyItemRow['quantity'], $MyItemRow['decimalplaces']) . '</td>'; - echo '<td>' . $MyItemRow['units'] . '</td>'; - echo '<td>' . ConvertSQLDate($MyItemRow['requiredbydate']) . '</td>'; + echo '<tr> + <td>' . $MyItemRow['stockid'] . '</td> + <td>' . $MyItemRow['description'] . '</td> + <input type="hidden" name="StockID'. $i . '" value="' . $MyItemRow['stockid'] . '" /> + <input type="hidden" name="ItemDescription'. $i . '" value="' . $MyItemRow['description'] . '" /> + <td>' . $MyItemRow['suppliers_partno'] . '</td> + <td class="number">' . locale_number_format($MyItemRow['quantity'], $MyItemRow['decimalplaces']) . '</td> + <td>' . $MyItemRow['units'] . '</td> + <td>' . ConvertSQLDate($MyItemRow['requiredbydate']) . '</td>'; + if ($MyItemRow['suppliersuom']=='') { $MyItemRow['suppliersuom']=$MyItemRow['units']; } - echo '<td><input type="text" class="number" size="10" name="Qty'. $i . '" value="' . locale_number_format($MyItemRow['quantity'], $MyItemRow['decimalplaces']) . '" /></td>'; - echo '<input type="hidden" name="UOM'. $i . '" value="' . $MyItemRow['units'] . '" />'; - echo '<input type="hidden" name="DecimalPlaces'. $i . '" value="' . $MyItemRow['decimalplaces'] . '" />'; - echo '<td>' . $MyItemRow['suppliersuom'] . '</td>'; - echo '<td>' . $myrow[1] . '</td>'; - echo '<td><input type="text" class="number" size="10" name="Price'. $i . '" value="0.00" /></td>'; - echo '<td><input type="text" class="date" alt="' .$_SESSION['DefaultDateFormat'] .'" name="RequiredByDate'. $i . '" size="11" value="' . ConvertSQLDate($MyItemRow['requiredbydate']) . '" /></td>'; + echo '<td><input type="text" class="number" size="10" name="Qty'. $i . '" value="' . locale_number_format($MyItemRow['quantity'], $MyItemRow['decimalplaces']) . '" /></td> + <input type="hidden" name="UOM'. $i . '" value="' . $MyItemRow['units'] . '" /> + <input type="hidden" name="DecimalPlaces'. $i . '" value="' . $MyItemRow['decimalplaces'] . '" /> + <td>' . $MyItemRow['suppliersuom'] . '</td> + <td>' . $myrow[1] . '</td> + <td><input type="text" class="number" size="10" name="Price'. $i . '" value="0.00" /></td> + <td><input type="text" class="date" alt="' .$_SESSION['DefaultDateFormat'] .'" name="RequiredByDate'. $i . '" size="11" value="' . ConvertSQLDate($MyItemRow['requiredbydate']) . '" /></td> + </tr>'; } echo '</form>'; } @@ -513,7 +563,7 @@ echo '<input type="hidden" name="FormID" value="' . $_SESSION['FormID'] . '" />'; echo '<p class="page_title_text"><img src="' . $rootpath . '/css/' . $theme . '/images/supplier.png" title="' . _('Tenders') . '" alt="" />' . ' ' . _('Select items to offer from').' '.$Supplier .'</p>'; - if ($_POST['Keywords'] and $_POST['StockCode']) { + if ($_POST['Keywords'] AND $_POST['StockCode']) { prnMsg( _('Stock description keywords have been used in preference to the Stock code extract entered'), 'info' ); } if ($_POST['Keywords']) { @@ -522,29 +572,29 @@ if ($_POST['StockCat']=='All'){ $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!='A' - AND stockmaster.mbflag!='K' - and stockmaster.discontinued!=1 - AND stockmaster.description " . LIKE . " '$SearchString' - ORDER BY stockmaster.stockid"; + stockmaster.description, + stockmaster.units + FROM stockmaster INNER JOIN stockcategory + ON stockmaster.categoryid=stockcategory.categoryid + WHERE stockmaster.mbflag!='D' + AND stockmaster.mbflag!='A' + AND stockmaster.mbflag!='K' + AND stockmaster.discontinued!=1 + AND stockmaster.description " . LIKE . " '$SearchString' + ORDER BY stockmaster.stockid"; } 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!='A' - AND stockmaster.mbflag!='K' - and stockmaster.discontinued!=1 - AND stockmaster.description " . LIKE . " '$SearchString' - AND stockmaster.categoryid='" . $_POST['StockCat'] . "' - ORDER BY stockmaster.stockid"; + stockmaster.description, + stockmaster.units + FROM stockmaster INNER JOIN stockcategory + ON stockmaster.categoryid=stockcategory.categoryid + WHERE stockmaster.mbflag!='D' + AND stockmaster.mbflag!='A' + AND stockmaster.mbflag!='K' + AND stockmaster.discontinued!=1 + AND stockmaster.description " . LIKE . " '$SearchString' + AND stockmaster.categoryid='" . $_POST['StockCat'] . "' + ORDER BY stockmaster.stockid"; } } elseif ($_POST['StockCode']){ @@ -553,55 +603,55 @@ if ($_POST['StockCat']=='All'){ $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!='A' - AND stockmaster.mbflag!='K' - and stockmaster.discontinued!=1 - AND stockmaster.stockid " . LIKE . " '" . $_POST['StockCode'] . "' - ORDER BY stockmaster.stockid"; + stockmaster.description, + stockmaster.units + FROM stockmaster INNER JOIN stockcategory + ON stockmaster.categoryid=stockcategory.categoryid + WHERE stockmaster.mbflag!='D' + AND stockmaster.mbflag!='A' + AND stockmaster.mbflag!='K' + AND stockmaster.discontinued!=1 + AND stockmaster.stockid " . LIKE . " '" . $_POST['StockCode'] . "' + ORDER BY stockmaster.stockid"; } 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!='A' - AND stockmaster.mbflag!='K' - and stockmaster.discontinued!=1 - AND stockmaster.stockid " . LIKE . " '" . $_POST['StockCode'] . "' - AND stockmaster.categoryid='" . $_POST['StockCat'] . "' - ORDER BY stockmaster.stockid"; + stockmaster.description, + stockmaster.units + FROM stockmaster INNER JOIN stockcategory + ON stockmaster.categoryid=stockcategory.categoryid + WHERE stockmaster.mbflag!='D' + AND stockmaster.mbflag!='A' + AND stockmaster.mbflag!='K' + AND stockmaster.discontinued!=1 + AND stockmaster.stockid " . LIKE . " '" . $_POST['StockCode'] . "' + AND stockmaster.categoryid='" . $_POST['StockCat'] . "' + ORDER BY stockmaster.stockid"; } } else { if ($_POST['StockCat']=='All'){ $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!='A' - AND stockmaster.mbflag!='K' - and stockmaster.discontinued!=1 - ORDER BY stockmaster.stockid"; + stockmaster.description, + stockmaster.units + FROM stockmaster INNER JOIN stockcategory + ON stockmaster.categoryid=stockcategory.categoryid + WHERE stockmaster.mbflag!='D' + AND stockmaster.mbflag!='A' + AND stockmaster.mbflag!='K' + AND stockmaster.discontinued!=1 + ORDER BY stockmaster.stockid"; } 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!='A' - AND stockmaster.mbflag!='K' - and stockmaster.discontinued!=1 - AND stockmaster.categoryid='" . $_POST['StockCat'] . "' - ORDER BY stockmaster.stockid"; + stockmaster.description, + stockmaster.units + FROM stockmaster INNER JOIN stockcategory + ON stockmaster.categoryid=stockcategory.categoryid + WHERE stockmaster.mbflag!='D' + AND stockmaster.mbflag!='A' + AND stockmaster.mbflag!='K' + AND stockmaster.discontinued!=1 + AND stockmaster.categoryid='" . $_POST['StockCat'] . "' + ORDER BY stockmaster.stockid"; } } @@ -609,7 +659,7 @@ $DbgMsg = _('The SQL statement that failed was'); $SearchResult = DB_query($sql,$db,$ErrMsg,$DbgMsg); - if (DB_num_rows($SearchResult)==0 and $debug==1){ + if (DB_num_rows($SearchResult)==0 AND $debug==1){ prnMsg( _('There are no products to display matching the criteria provided'),'warn'); } if (DB_num_rows($SearchResult)==1){ @@ -623,7 +673,7 @@ echo '<table cellpadding="1" colspan="7">'; - $tableheader = '<tr> + $TableHeader = '<tr> <th>' . _('Code') . '</th> <th>' . _('Description') . '</th> <th>' . _('Units') . '</th> @@ -631,7 +681,7 @@ <th>' . _('Quantity') . '</th> <th>' . _('Price') .' ('.$Currency.')</th> </tr>'; - echo $tableheader; + echo $TableHeader; $i = 0; $k = 0; //row colour counter @@ -646,8 +696,8 @@ $k=1; } - $filename = $myrow['stockid'] . '.jpg'; - if (file_exists( $_SESSION['part_pics_dir'] . '/' . $filename) ) { + $FileName = $myrow['stockid'] . '.jpg'; + if (file_exists( $_SESSION['part_pics_dir'] . '/' . $FileName) ) { $ImageSource = '<img src="'.$rootpath . '/' . $_SESSION['part_pics_dir'] . '/' . $myrow['stockid'] . '.jpg" width="50" height="50" />'; @@ -655,7 +705,7 @@ $ImageSource = '<i>'._('No Image').'</i>'; } - $uomsql="SELECT conversionfactor, + $UOMsql="SELECT conversionfactor, suppliersuom, unitsofmeasure.unitname FROM purchdata @@ -664,25 +714,25 @@ WHERE supplierno='".$_POST['SupplierID']."' AND stockid='" . $myrow['stockid'] . "'"; - $uomresult=DB_query($uomsql, $db); - if (DB_num_rows($uomresult)>0) { - $uomrow=DB_fetch_array($uomresult); - if (mb_strlen($uomrow['suppliersuom'])>0) { - $uom=$uomrow['unitname']; + $UOMresult=DB_query($UOMsql, $db); + if (DB_num_rows($UOMresult)>0) { + $UOMrow=DB_fetch_array($UOMresult); + if (mb_strlen($UOMrow['suppliersuom'])>0) { + $UOM=$UOMrow['unitname']; } else { - $uom=$myrow['units']; + $UOM=$myrow['units']; } } else { - $uom=$myrow['units']; + $UOM=$myrow['units']; } echo '<td>'.$myrow['stockid'].'</td> <td>'.$myrow['description'].'</td> - <td>'.$uom.'</td> + <td>'.$UOM.'</td> <td>'.$ImageSource.'</td> <td><input class="number" type="text" size="6" value="0" name="Qty'.$i.'" /></td> <td><input class="number" type="text" size="12" value="0" name="Price'.$i.'" /></td> <input type="hidden" size="12" value="'.$myrow['stockid'].'" name="StockID'.$i.'" /> - <input type="hidden" value="'.$uom.'" name="uom'.$i.'" /> + <input type="hidden" value="'.$UOM.'" name="uom'.$i.'" /> </tr>'; $i++; $PartsDisplayed++; @@ -696,11 +746,14 @@ if ($PartsDisplayed == $Maximum_Number_Of_Parts_To_Show){ /*$Maximum_Number_Of_Parts_To_Show defined in config.php */ - prnMsg( _('Only the first') . ' ' . $Maximum_Number_Of_Parts_To_Show . ' ' . _('can be displayed') . '. ' . _('Please restrict your search to only the parts required'),'info'); } - echo '<a name="end"></a><br /><div class="centre"><input type="submit" name="NewItem" value="Add to Offer" /></div>'; + echo '<a name="end"></a> + <br /> + <div class="centre"> + <input type="submit" name="NewItem" value="Add to Offer" /> + </div>'; }#end if SearchResults to show echo '<input type="hidden" name="TenderType" value="'.$_POST['TenderType'].'" />'; echo '<input type="hidden" name="SupplierID" value="'.$_POST['SupplierID'].'" />'; Modified: trunk/UpgradeDatabase.php =================================================================== --- trunk/UpgradeDatabase.php 2012-01-20 22:55:59 UTC (rev 4823) +++ trunk/UpgradeDatabase.php 2012-01-20 23:10:18 UTC (rev 4824) @@ -132,8 +132,8 @@ case '4.06.5': $SQLScripts[] = './sql/mysql/upgrade4.05-4.06.sql'; case '4.06.6': - $SQLScripts[] = './sql/mysql/upgrade4.05-4.06.sql'; - case '4.06.7': + $SQLScripts[] = './sql/mysql/upgrade4.06-4.07.sql'; + case '4.07.0': break; } //end switch } Modified: trunk/api/api_stock.php =================================================================== --- trunk/api/api_stock.php 2012-01-20 22:55:59 UTC (rev 4823) +++ trunk/api/api_stock.php 2012-01-20 23:10:18 UTC (rev 4824) @@ -1,5 +1,5 @@ <?php - + /* Check that the stock code*/ function VerifyStockCode($StockCode, $i, $Errors, $db) { $Searchsql = "SELECT count(stockid) @@ -734,8 +734,8 @@ WHERE stockid='" .$StockID. "' AND typeabbrev='" .$SalesType. "' AND currabrev='".$Currency. "' - AND startdate>='". Date('Y-m-d') . "' - (AND enddate<='" . Date('Y-m-d') . "' OR enddate='0000-00-00')"; + AND startdate<='". Date('Y-m-d') . "' + AND (enddate>'" . Date('Y-m-d') . "' OR enddate='0000-00-00')"; $result = DB_Query($sql, $db); $myrow = DB_fetch_row($result); if ($myrow[0]==0) { @@ -746,8 +746,8 @@ WHERE stockid='" .$StockID. "' AND typeabbrev='" .$SalesType. "' AND currabrev='".$Currency. "' - AND startdate>='". Date('Y-m-d') . "' - (AND enddate<='" . Date('Y-m-d') . "' OR enddate='0000-00-00')"; + AND startdate<='". Date('Y-m-d') . "' + AND (enddate>'" . Date('Y-m-d') . "' OR enddate='0000-00-00')"; } $result = DB_Query($sql, $db); $myrow = DB_fetch_row($result); Modified: trunk/api/api_xml-rpc.php =================================================================== --- trunk/api/api_xml-rpc.php 2012-01-20 22:55:59 UTC (rev 4823) +++ trunk/api/api_xml-rpc.php 2012-01-20 23:10:18 UTC (rev 4824) @@ -1048,7 +1048,7 @@ /*x*/ $xmlrpcmsg->getParam( 2 )->scalarval( ), /*x*/ $xmlrpcmsg->getParam( 3 )->scalarval( ), /*x*/ $xmlrpcmsg->getParam( 4 )->scalarval( ))) ); -/*x*/ } else { +/*x*/ } else { //only 3 parameters if login already in session $rtn = new xmlrpcresp( php_xmlrpc_encode(GetStockPrice($xmlrpcmsg->getParam( 0 )->scalarval( ), $xmlrpcmsg->getParam( 1 )->scalarval( ), /*e*/ $xmlrpcmsg->getParam( 2 )->scalarval( ), '', ''))); Modified: trunk/includes/DefineOfferClass.php =================================================================== --- trunk/includes/DefineOfferClass.php 2012-01-20 22:55:59 UTC (rev 4823) +++ trunk/includes/DefineOfferClass.php 2012-01-20 23:10:18 UTC (rev 4824) @@ -30,32 +30,31 @@ FROM suppliers WHERE supplierid='" . $this->SupplierID . "'"; $result=DB_query($sql, $db); - $myrow=DB_fetch_row($result); - $this->SupplierName = $myrow[0]; - $this->EmailAddress = $myrow[1]; - $this->CurrCode = $myrow[2]; + $myrow=DB_fetch_array($result); + $this->SupplierName = $myrow['suppname']; + $this->EmailAddress = $myrow['email']; + $this->CurrCode = $myrow['currcode']; } - function add_to_offer( - $LineNo, - $StockID, - $Qty, - $ItemDescr, - $Price, - $UOM, - $DecimalPlaces, - $ExpiryDate){ + function add_to_offer( $LineNo, + $StockID, + $Qty, + $ItemDescr, + $Price, + $UOM, + $DecimalPlaces, + $ExpiryDate){ if (isset($Qty) and $Qty!=0){ $this->LineItems[$LineNo] = new LineDetails($LineNo, - $StockID, - $Qty, - $ItemDescr, - $Price, - $UOM, - $DecimalPlaces, - $ExpiryDate); + $StockID, + $Qty, + $ItemDescr, + $Price, + $UOM, + $DecimalPlaces, + $ExpiryDate); $this->LinesOnOffer++; Return 1; } @@ -74,25 +73,22 @@ if ($Update=='') { foreach ($this->LineItems as $LineItems) { if ($LineItems->Deleted==False) { - $sql="INSERT INTO offers ( - supplierid, - tenderid, - stockid, - quantity, - uom, - price, - expirydate, - currcode) - VALUES ( - '".$this->SupplierID."', - '".$this->TenderID."', - '".$LineItems->StockID."', - '".$LineItems->Quantity."', - '".$LineItems->Units."', - '".$LineItems->Price."', - '".FormatDateForSQL($LineItems->ExpiryDate)."', - '".$this->CurrCode."' - )"; + $sql="INSERT INTO offers ( supplierid, + tenderid, + stockid, + quantity, + uom, + price, + expirydate, + currcode) + VALUES ('".$this->SupplierID."', + '".$this->TenderID."', + '".$LineItems->StockID."', + '".$LineItems->Quantity."', + '".$LineItems->Units."', + '".$LineItems->Price."', + '".FormatDateForSQL($LineItems->ExpiryDate)."', + '".$this->CurrCode."')"; $ErrMsg = _('The suppliers offer could not be inserted into the database because'); $DbgMsg = _('The SQL statement used to insert the suppliers offer record and failed was'); $result = DB_query($sql,$db,$ErrMsg,$DbgMsg,true); @@ -109,11 +105,10 @@ } } else { foreach ($_SESSION['offer']->LineItems as $LineItems) { - $sql="UPDATE offers SET - quantity='".$LineItems->Quantity."', - price='".$LineItems->Price."', - expirydate='".FormatDateForSQL($LineItems->ExpiryDate)."' - WHERE offerid='".$LineItems->LineNo . "'"; + $sql="UPDATE offers SET quantity='".$LineItems->Quantity."', + price='".$LineItems->Price."', + expirydate='".FormatDateForSQL($LineItems->ExpiryDate)."' + WHERE offerid='".$LineItems->LineNo . "'"; $ErrMsg = _('The suppliers offer could not be updated on the database because'); $DbgMsg = _('The SQL statement used to update the suppliers offer record and failed was'); $result = DB_query($sql,$db,$ErrMsg,$DbgMsg,true); @@ -140,9 +135,9 @@ } function update_offer_item($LineNo, - $Qty, - $Price, - $ExpiryDate){ + $Qty, + $Price, + $ExpiryDate){ $this->LineItems[$LineNo]->Quantity = $Qty; $this->LineItems[$LineNo]->Price = $Price; @@ -175,23 +170,21 @@ var $Deleted; var $ExpiryDate; - function LineDetails ( - $LineNo, - $StockItem, - $Qty, - $ItemDescr, - $Prc, - $UOM, - $DecimalPlaces, - $ExpiryDate) - { + function LineDetails ($LineNo, + $StockItem, + $Qty, + $ItemDescr, + $Price, + $UOM, + $DecimalPlaces, + $ExpiryDate) { /* Constructor function to add a new LineDetail object with passed params */ $this->LineNo = $LineNo; $this->StockID =$StockItem; $this->ItemDescription = $ItemDescr; $this->Quantity = $Qty; - $this->Price = $Prc; + $this->Price = $Price; $this->Units = $UOM; $this->DecimalPlaces = $DecimalPlaces; $this->ExpiryDate = $ExpiryDate; Modified: trunk/includes/DefineTenderClass.php =================================================================== --- trunk/includes/DefineTenderClass.php 2012-01-20 22:55:59 UTC (rev 4823) +++ trunk/includes/DefineTenderClass.php 2012-01-20 23:10:18 UTC (rev 4824) @@ -1,9 +1,8 @@ <?php -/* $Id$ */ +/* $Id: DefineTenderClass.php 4821 2012-01-20 13:48:53Z tim_schofield $ */ /* Definition of the tender class to hold all the information for a supplier tender */ - Class Tender { var $TenderId; @@ -58,62 +57,55 @@ */ if ($this->TenderId=='') { $this->TenderId = GetNextTransNo(37, $db); - $HeaderSQL="INSERT INTO tenders ( - tenderid, - location, - address1, - address2, - address3, - address4, - address5, - address6, - telephone, - requiredbydate) - VALUES ( - '" . $this->TenderId . "', - '" . $this->Location . "', - '" . $this->DelAdd1 . "', - '" . $this->DelAdd2 . "', - '" . $this->DelAdd3 . "', - '" . $this->DelAdd4 . "', - '" . $this->DelAdd5 . "', - '" . $this->DelAdd6 . "', - '" . $this->Telephone . "', - '" . FormatDateForSQL($this->RequiredByDate) . "')"; + $HeaderSQL="INSERT INTO tenders (tenderid, + location, + address1, + address2, + address3, + address4, + address5, + address6, + telephone, + requiredbydate) + VALUES ('" . $this->TenderId . "', + '" . $this->Location . "', + '" . $this->DelAdd1 . "', + '" . $this->DelAdd2 . "', + '" . $this->DelAdd3 . "', + '" . $this->DelAdd4 . "', + '" . $this->DelAdd5 . "', + '" . $this->DelAdd6 . "', + '" . $this->Telephone . "', + '" . FormatDateForSQL($this->RequiredByDate) . "')"; foreach ($this->Suppliers as $Supplier) { - $SuppliersSQL[]="INSERT INTO tendersuppliers ( - tenderid, - supplierid, - email) - VALUES ( - '" . $this->TenderId . "', - '" . $Supplier->SupplierCode . "', - '" . $Supplier->EmailAddress . "')"; + $SuppliersSQL[]="INSERT INTO tendersuppliers (tenderid, + supplierid, + email) + VALUES ('" . $this->TenderId . "', + '" . $Supplier->SupplierCode . "', + '" . $Supplier->EmailAddress . "')"; } foreach ($this->LineItems as $LineItem) { - $ItemsSQL[]="INSERT INTO tenderitems ( - tenderid, - stockid, - quantity, - units) - VALUES ( - '" . $this->TenderId . "', - '" . $LineItem->StockID . "', - '" . $LineItem->Quantity . "', - '" . $LineItem->Units . "')"; + $ItemsSQL[]="INSERT INTO tenderitems (tenderid, + stockid, + quantity, + units) + VALUES ('" . $this->TenderId . "', + '" . $LineItem->StockID . "', + '" . $LineItem->Quantity . "', + '" . $LineItem->Units . "')"; } } else { - $HeaderSQL="UPDATE tenders - SET location='" . $this->Location . "', - address1='" . $this->DelAdd1 . "', - address2='" . $this->DelAdd2 . "', - address3='" . $this->DelAdd3 . "', - address4='" . $this->DelAdd4 . "', - address5='" . $this->DelAdd5 . "', - address6='" . $this->DelAdd6 . "', - telephone='" . $this->Telephone . "', - requiredbydate='" . FormatDateForSQL($this->RequiredByDate) . "' - WHERE tenderid = '" . $this->TenderId . "'"; + $HeaderSQL="UPDATE tenders SET location='" . $this->Location . "', + address1='" . $this->DelAdd1 . "', + address2='" . $this->DelAdd2 . "', + address3='" . $this->DelAdd3 . "', + address4='" . $this->DelAdd4 . "', + address5='" . $this->DelAdd5 . "', + address6='" . $this->DelAdd6 . "', + telephone='" . $this->Telephone . "', + requiredbydate='" . FormatDateForSQL($this->RequiredByDate) . "' + WHERE tenderid = '" . $this->TenderId . "'"; foreach ($this->Suppliers as $Supplier) { $sql="DELETE FROM tendersuppliers WHERE tenderid='" . $this->TenderId . "'"; @@ -122,25 +114,22 @@ tenderid, supplierid, email) - VALUES ( - '" . $this->TenderId . "', - '" . $Supplier->SupplierCode . "', - '" . $Supplier->EmailAddress . "')"; + VALUES ('" . $this->TenderId . "', + '" . $Supplier->SupplierCode . "', + '" . $Supplier->EmailAddress . "')"; } foreach ($this->LineItems as $LineItem) { $sql="DELETE FROM tenderitems - WHERE tenderid='" . $this->TenderId . "'"; + WHERE tenderid='" . $this->TenderId . "'"; $result=DB_query($sql, $db); - $ItemsSQL[]="INSERT INTO tenderitems ( - tenderid, - stockid, - quantity, - units) - VALUES ( - '" . $this->TenderId . "', - '" . $LineItem->StockID . "', - '" . $LineItem->Quantity . "', - '" . $LineItem->Units . "')"; + $ItemsSQL[]="INSERT INTO tenderitems (tenderid, + stockid, + quantity, + units) + ... [truncated message content] |
From: <dai...@us...> - 2012-01-20 23:10:26
|
Revision: 4824 http://web-erp.svn.sourceforge.net/web-erp/?rev=4824&view=rev Author: daintree Date: 2012-01-20 23:10:18 +0000 (Fri, 20 Jan 2012) Log Message: ----------- Modified Paths: -------------- trunk/SupplierTenderCreate.php trunk/SupplierTenders.php trunk/UpgradeDatabase.php trunk/api/api_stock.php trunk/api/api_xml-rpc.php trunk/includes/DefineOfferClass.php trunk/includes/DefineTenderClass.php trunk/sql/mysql/upgrade4.05-4.06.sql Modified: trunk/SupplierTenderCreate.php =================================================================== --- trunk/SupplierTenderCreate.php 2012-01-20 22:55:59 UTC (rev 4823) +++ trunk/SupplierTenderCreate.php 2012-01-20 23:10:18 UTC (rev 4824) @@ -1,5 +1,5 @@ <?php -/* $Id$*/ +/* $Id: SupplierTenderCreate.php 4821 2012-01-20 13:48:53Z tim_schofield $ */ include('includes/DefineTenderClass.php'); include('includes/SQL_CommonFunctions.inc'); @@ -7,11 +7,11 @@ $Maximum_Number_Of_Parts_To_Show=50; -if (isset($_GET['New']) and isset($_SESSION['tender'])) { +if (isset($_GET['New']) AND isset($_SESSION['tender'])) { unset($_SESSION['tender']); } -if (isset($_GET['New']) and $_SESSION['CanCreateTender']==0) { +if (isset($_GET['New']) AND $_SESSION['CanCreateTender']==0) { $title = _('Authorisation Problem'); include('includes/header.inc'); echo '<p class="page_title_text"><img src="'.$rootpath.'/css/'.$theme.'/images/supplier.png" title="' . $title . '" alt="" /> '.$title . '</p>'; @@ -21,7 +21,7 @@ exit; } -if (isset($_GET['Edit']) and $_SESSION['CanCreateTender']==0) { +if (isset($_GET['Edit']) AND $_SESSION['CanCreateTender']==0) { $title = _('Authorisation Problem'); include('includes/header.inc'); echo '<p class="page_title_text"><img src="'.$rootpath.'/css/'.$theme.'/images/supplier.png" title="' . $title . '" alt="" /> '.$title . '</p>'; @@ -188,7 +188,7 @@ $ShowTender = 1; } -if (isset($_POST['NewItem']) and !isset($_POST['Refresh'])) { +if (isset($_POST['NewItem']) AND !isset($_POST['Refresh'])) { foreach ($_POST as $key => $value) { if (mb_substr($key,0,7)=='StockID') { $Index = mb_substr($key,7,mb_strlen($key)-7); @@ -315,7 +315,7 @@ $LocnResult = DB_query($sql,$db); while ($LocnRow=DB_fetch_array($LocnResult)){ - if ((isset($_SESSION['tender']->Location) and $_SESSION['tender']->Location == $LocnRow['loccode'])){ + if ((isset($_SESSION['tender']->Location) AND $_SESSION['tender']->Location == $LocnRow['loccode'])){ echo '<option selected="True" value="' . $LocnRow['loccode'] . '">' . $LocnRow['locationname'] . '</option>'; } else { echo '<option value="' . $LocnRow['loccode'] . '">' . $LocnRow['locationname'] . '</option>'; @@ -402,7 +402,7 @@ echo '<div class="centre"><input type="submit" name="Suppliers" value="' . _('Select Suppliers') . '" />'; echo '<input type="submit" name="Items" value="' . _('Select Item Details') . '" /></div><br />'; - if ($_SESSION['tender']->LinesOnTender > 0 and $_SESSION['tender']->SuppliersOnTender > 0) { + if ($_SESSION['tender']->LinesOnTender > 0 AND $_SESSION['tender']->SuppliersOnTender > 0) { echo '<div class="centre"><input type="submit" name="Save" value="' . _('Save Tender') . '" /></div>'; } echo '</form>'; @@ -527,18 +527,20 @@ echo '<br />'; } echo '<input type="hidden" name="Search" value="' . _('Search Now') . '" />'; - echo '<br /><br />'; - echo '<br /><table cellpadding="2" colspan="7">'; - $tableheader = '<tr> - <th>' . _('Code') . '</th> - <th>' . _('Supplier Name') . '</th> - <th>' . _('Currency') . '</th> - <th>' . _('Address 1') . '</th> - <th>' . _('Address 2') . '</th> - <th>' . _('Address 3') . '</th> - <th>' . _('Address 4') . '</th> - </tr>'; - echo $tableheader; + echo '<br /> + <br /> + <br /> + <table cellpadding="2" colspan="7">'; + $TableHeader = '<tr> + <th>' . _('Code') . '</th> + <th>' . _('Supplier Name') . '</th> + <th>' . _('Currency') . '</th> + <th>' . _('Address 1') . '</th> + <th>' . _('Address 2') . '</th> + <th>' . _('Address 3') . '</th> + <th>' . _('Address 4') . '</th> + </tr>'; + echo $TableHeader; $j = 1; $k = 0; //row counter to determine background colour $RowIndex = 0; @@ -575,9 +577,9 @@ echo '<input type="hidden" name="FormID" value="' . $_SESSION['FormID'] . '" />'; echo '<p class="page_title_text"><img src="' . $rootpath . '/css/' . $theme . '/images/magnifier.png" title="' . _('Search') . '" alt="" />' . ' ' . _('Search for Inventory Items') . '</p>'; $sql = "SELECT categoryid, - categorydescription - FROM stockcategory - ORDER BY categorydescription"; + categorydescription + FROM stockcategory + ORDER BY categorydescription"; $result = DB_query($sql, $db); if (DB_num_rows($result) == 0) { echo '<br /><font size="4" color="red">' . _('Problem Report') . ':</font><br />' . @@ -585,11 +587,11 @@ echo '<br /><a href="' . $rootpath . '/StockCategories.php">' . _('Define Stock Categories') . '</a>'; exit; } - echo '<table class="selection"><tr>'; - echo '<td>' . _('In Stock Category') . ':'; - echo '<select name="StockCat">'; + echo '<table class="selection"> + <tr> + <td>' . _('In Stock Category') . ':<select name="StockCat">'; if (!isset($_POST['StockCat'])) { - $_POST['StockCat'] = ""; + $_POST['StockCat'] = ''; } if ($_POST['StockCat'] == 'All') { echo '<option selected="True" value="All">' . _('All') . '</option>'; @@ -603,25 +605,34 @@ echo '<option value="' . $myrow1['categoryid'] . '">' . $myrow1['categorydescription'] . '</option>'; } } - echo '</select>'; - echo '<td>' . _('Enter partial') . '<b> ' . _('Description') . '</b>:</td><td>'; + echo '</select></td> + <td>' . _('Enter partial') . '<b> ' . _('Description') . '</b>:</td> + <td>'; if (isset($_POST['Keywords'])) { echo '<input type="text" name="Keywords" value="' . $_POST['Keywords'] . '" size="20" maxlength="25" />'; } else { echo '<input type="text" name="Keywords" size="20" maxlength="25" />'; } - echo '</td></tr><tr><td></td>'; - echo '<td><font size="3"><b>' . _('OR') . ' ' . '</b></font>' . _('Enter partial') . ' <b>' . _('Stock Code') . '</b>:</td>'; - echo '<td>'; + echo '</td> + </tr> + <tr> + <td></td> + <td><font size="3"><b>' . _('OR') . ' ' . '</b></font>' . _('Enter partial') . ' <b>' . _('Stock Code') . '</b>:</td> + <td>'; if (isset($_POST['StockCode'])) { echo '<input type="text" name="StockCode" value="' . $_POST['StockCode'] . '" size="15" maxlength="18" />'; } else { echo '<input type="text" name="StockCode" size="15" maxlength="18" />'; } - echo '</td></tr></table><br />'; - echo '<div class="centre"><input type="submit" name="Search" value="' . _('Search Now') . '" /></div><br /></form>'; + echo '</td></tr> + </table> + <br /> + <div class="centre"> + <input type="submit" name="Search" value="' . _('Search Now') . '" /> + </div> + <br /> + </form>'; echo '<script type="text/javascript">defaultControl(document.forms[0].StockCode);</script>'; - echo '</form>'; } if (isset($_POST['Search'])){ /*ie seach for stock items */ @@ -638,29 +649,29 @@ if ($_POST['StockCat']=='All'){ $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!='A' - AND stockmaster.mbflag!='K' - and stockmaster.discontinued!=1 - AND stockmaster.description " . LIKE . " '$SearchString' - ORDER BY stockmaster.stockid"; + stockmaster.description, + stockmaster.units + FROM stockmaster INNER JOIN stockcategory + ON stockmaster.categoryid=stockcategory.categoryid + WHERE stockmaster.mbflag!='D' + AND stockmaster.mbflag!='A' + AND stockmaster.mbflag!='K' + AND stockmaster.discontinued!=1 + AND stockmaster.description " . LIKE . " '$SearchString' + ORDER BY stockmaster.stockid"; } 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!='A' - AND stockmaster.mbflag!='K' - and stockmaster.discontinued!=1 - AND stockmaster.description " . LIKE . " '$SearchString' - AND stockmaster.categoryid='" . $_POST['StockCat'] . "' - ORDER BY stockmaster.stockid"; + stockmaster.description, + stockmaster.units + FROM stockmaster INNER JOIN stockcategory + ON stockmaster.categoryid=stockcategory.categoryid + WHERE stockmaster.mbflag!='D' + AND stockmaster.mbflag!='A' + AND stockmaster.mbflag!='K' + AND stockmaster.discontinued!=1 + AND stockmaster.description " . LIKE . " '$SearchString' + AND stockmaster.categoryid='" . $_POST['StockCat'] . "' + ORDER BY stockmaster.stockid"; } } elseif ($_POST['StockCode']){ @@ -669,55 +680,55 @@ if ($_POST['StockCat']=='All'){ $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!='A' - AND stockmaster.mbflag!='K' - and stockmaster.discontinued!=1 - AND stockmaster.stockid " . LIKE . " '" . $_POST['StockCode'] . "' - ORDER BY stockmaster.stockid"; + stockmaster.description, + stockmaster.units + FROM stockmaster INNER JOIN stockcategory + ON stockmaster.categoryid=stockcategory.categoryid + WHERE stockmaster.mbflag!='D' + AND stockmaster.mbflag!='A' + AND stockmaster.mbflag!='K' + AND stockmaster.discontinued!=1 + AND stockmaster.stockid " . LIKE . " '" . $_POST['StockCode'] . "' + ORDER BY stockmaster.stockid"; } 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!='A' - AND stockmaster.mbflag!='K' - and stockmaster.discontinued!=1 - AND stockmaster.stockid " . LIKE . " '" . $_POST['StockCode'] . "' - AND stockmaster.categoryid='" . $_POST['StockCat'] . "' - ORDER BY stockmaster.stockid"; + stockmaster.description, + stockmaster.units + FROM stockmaster INNER JOIN stockcategory + ON stockmaster.categoryid=stockcategory.categoryid + WHERE stockmaster.mbflag!='D' + AND stockmaster.mbflag!='A' + AND stockmaster.mbflag!='K' + AND stockmaster.discontinued!=1 + AND stockmaster.stockid " . LIKE . " '" . $_POST['StockCode'] . "' + AND stockmaster.categoryid='" . $_POST['StockCat'] . "' + ORDER BY stockmaster.stockid"; } } else { if ($_POST['StockCat']=='All'){ $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!='A' - AND stockmaster.mbflag!='K' - and stockmaster.discontinued!=1 - ORDER BY stockmaster.stockid"; + stockmaster.description, + stockmaster.units + FROM stockmaster INNER JOIN stockcategory + ON stockmaster.categoryid=stockcategory.categoryid + WHERE stockmaster.mbflag!='D' + AND stockmaster.mbflag!='A' + AND stockmaster.mbflag!='K' + AND stockmaster.discontinued!=1 + ORDER BY stockmaster.stockid"; } 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!='A' - AND stockmaster.mbflag!='K' - and stockmaster.discontinued!=1 - AND stockmaster.categoryid='" . $_POST['StockCat'] . "' - ORDER BY stockmaster.stockid"; + stockmaster.description, + stockmaster.units + FROM stockmaster INNER JOIN stockcategory + ON stockmaster.categoryid=stockcategory.categoryid + WHERE stockmaster.mbflag!='D' + AND stockmaster.mbflag!='A' + AND stockmaster.mbflag!='K' + AND stockmaster.discontinued!=1 + AND stockmaster.categoryid='" . $_POST['StockCat'] . "' + ORDER BY stockmaster.stockid"; } } @@ -725,7 +736,7 @@ $DbgMsg = _('The SQL statement that failed was'); $SearchResult = DB_query($sql,$db,$ErrMsg,$DbgMsg); - if (DB_num_rows($SearchResult)==0 and $debug==1){ + if (DB_num_rows($SearchResult)==0 AND $debug==1){ prnMsg( _('There are no products to display matching the criteria provided'),'warn'); } if (DB_num_rows($SearchResult)==1){ @@ -739,14 +750,14 @@ echo '<table cellpadding="1" colspan="7">'; - $tableheader = '<tr> - <th>' . _('Code') . '</th> - <th>' . _('Description') . '</th> - <th>' . _('Units') . '</th> - <th>' . _('Image') . '</th> - <th>' . _('Quantity') . '</th> - </tr>'; - echo $tableheader; + $TableHeader = '<tr> + <th>' . _('Code') . '</th> + <th>' . _('Description') . '</th> + <th>' . _('Units') . '</th> + <th>' . _('Image') . '</th> + <th>' . _('Quantity') . '</th> + </tr>'; + echo $TableHeader; $i = 0; $k = 0; //row colour counter @@ -761,8 +772,8 @@ $k=1; } - $filename = $myrow['stockid'] . '.jpg'; - if (file_exists( $_SESSION['part_pics_dir'] . '/' . $filename) ) { + $FileName = $myrow['stockid'] . '.jpg'; + if (file_exists( $_SESSION['part_pics_dir'] . '/' . $FileName) ) { $ImageSource = '<img src="'.$rootpath . '/' . $_SESSION['part_pics_dir'] . '/' . $myrow['stockid'] . '.jpg" width="50" height="50" />'; @@ -770,14 +781,13 @@ $ImageSource = '<i>'._('No Image').'</i>'; } - $uom=$myrow['units']; echo '<td>'.$myrow['stockid'].'</td> <td>'.$myrow['description'].'</td> - <td>'.$uom.'</td> + <td>'.$myrow['units'].'</td> <td>'.$ImageSource.'</td> <td><input class="number" type="text" size="6" value="0" name="Qty'.$i.'" /></td> - <input type="hidden" value="'.$uom.'" name="UOM'.$i.'" /> + <input type="hidden" value="'.$myrow['units'].'" name="UOM'.$i.'" /> <input type="hidden" value="'.$myrow['stockid'].'" name="StockID'.$i.'" /> </tr>'; @@ -797,7 +807,11 @@ prnMsg( _('Only the first') . ' ' . $Maximum_Number_Of_Parts_To_Show . ' ' . _('can be displayed') . '. ' . _('Please restrict your search to only the parts required'),'info'); } - echo '<a name="end"></a><br /><div class="centre"><input type="submit" name="NewItem" value="Add to Tender" /></div>'; + echo '<a name="end"></a> + <br /> + <div class="centre"> + <input type="submit" name="NewItem" value="' . _('Add to Tender') . '" /> + </div>'; }#end if SearchResults to show echo '</form>'; Modified: trunk/SupplierTenders.php =================================================================== --- trunk/SupplierTenders.php 2012-01-20 22:55:59 UTC (rev 4823) +++ trunk/SupplierTenders.php 2012-01-20 23:10:18 UTC (rev 4824) @@ -64,15 +64,14 @@ $ItemCode=$value; $Quantity=$_POST['Qty'.$Index]; $Price=$_POST['Price'.$Index]; - $_SESSION['offer']->add_to_offer( - $LineNo, - $ItemCode, - $Quantity, - $_POST['ItemDescription'.$Index], - $Price, - $_POST['UOM'.$Index], - $_POST['DecimalPlaces'.$Index], - $_POST['RequiredByDate'.$Index]); + $_SESSION['offer']->add_to_offer($LineNo, + $ItemCode, + $Quantity, + $_POST['ItemDescription'.$Index], + $Price, + $_POST['UOM'.$Index], + $_POST['DecimalPlaces'.$Index], + $_POST['RequiredByDate'.$Index]); $LineNo++; } } @@ -91,16 +90,18 @@ address6, telephone FROM tenders - LEFT JOIN locations + INNER JOIN locations ON tenders.location=locations.loccode WHERE closed=0 AND tenderid='".$_SESSION['offer']->TenderID."'"; $LocationResult=DB_query($LocationSQL, $db); $MyLocationRow=DB_fetch_row($LocationResult); - $CurrencySQL="SELECT decimalplaces from currencies WHERE currabrev='".$_SESSION['offer']->CurrCode."'"; + $CurrencySQL="SELECT decimalplaces FROM currencies WHERE currabrev='".$_SESSION['offer']->CurrCode."'"; $CurrencyResult=DB_query($CurrencySQL, $db); $CurrencyRow=DB_fetch_array($CurrencyResult); - echo '<tr><td valign="top" style="background-color:#cccce5">' . _('Deliver To') . ':</td><td valign="top" style="background-color:#cccce5">'; + echo '<tr> + <td valign="top" style="background-color:#cccce5">' . _('Deliver To') . ':</td> + <td valign="top" style="background-color:#cccce5">'; for ($i=1; $i<8; $i++) { if ($MyLocationRow[$i]!='') { echo $MyLocationRow[$i] . '<br />'; @@ -109,28 +110,38 @@ echo '</td>'; echo '<th colspan="8" style="vertical-align:top"><font size="2" color="#616161">' . _('Tender Number') . ': ' .$_SESSION['offer']->TenderID . '</font></th>'; echo '<input type="hidden" value="' . $_SESSION['offer']->TenderID . '" name="Tender" />'; - echo '<tr><th>' . stripslashes($_SESSION['CompanyRecord']['coyname']) . '<br />' . _('Item Code') . '</th>'; - echo '<th>' . _('Item Description') . '</th>'; - echo '<th>' . _('Quantity') . '<br />' . _('Offered') . '</th>'; - echo '<th>' . $Supplier . '<br />' . _('Units of Measure') . '</th>'; - echo '<th>' . _('Currency') . '</th>'; - echo '<th>' . $Supplier . '<br />' . _('Price') . '</th>'; - echo '<th>' . _('Line Value') . '</th>'; - echo '<th>' . _('Delivery By') . '</th>'; + echo '<tr> + <th>' . stripslashes($_SESSION['CompanyRecord']['coyname']) . '<br />' . _('Item Code') . '</th> + <th>' . _('Item Description') . '</th> + <th>' . _('Quantity') . '<br />' . _('Offered') . '</th> + <th>' . $Supplier . '<br />' . _('Units of Measure') . '</th> + <th>' . _('Currency') . '</th> + <th>' . $Supplier . '<br />' . _('Price') . '</th> + <th>' . _('Line Value') . '</th> + <th>' . _('Delivery By') . '</th> + </tr>'; + foreach ($_SESSION['offer']->LineItems as $LineItem) { - echo '<tr><td>' . $LineItem->StockID . '</td>'; - echo '<td>' . $LineItem->ItemDescription . '</td>'; - echo '<td class="number"> ' .locale_number_format($LineItem->Quantity, $LineItem->DecimalPlaces) . '</td>'; - echo '<td>' . $LineItem->Units . '</td>'; - echo '<td>' . $_SESSION['offer']->CurrCode . '</td>'; - echo '<td class="number">' . locale_number_format($LineItem->Price, $CurrencyRow['decimalplaces']) . '</td>'; - echo '<td class="number">' . locale_number_format($LineItem->Price*$LineItem->Quantity,$CurrencyRow['decimalplaces']) . '</td>'; - echo '<td>' . $LineItem->ExpiryDate . '</td>'; + echo '<tr> + <td>' . $LineItem->StockID . '</td> + <td>' . $LineItem->ItemDescription . '</td> + <td class="number"> ' .locale_number_format($LineItem->Quantity, $LineItem->DecimalPlaces) . '</td> + <td>' . $LineItem->Units . '</td> + <td>' . $_SESSION['offer']->CurrCode . '</td> + <td class="number">' . locale_number_format($LineItem->Price, $CurrencyRow['decimalplaces']) . '</td> + <td class="number">' . locale_number_format($LineItem->Price*$LineItem->Quantity,$CurrencyRow['decimalplaces']) . '</td> + <td>' . $LineItem->ExpiryDate . '</td> + </tr>'; } - echo '</table><br />'; - echo '<div class="centre"><input type="submit" name="Confirm" value="' . _('Confirm and Send Email') . '" /><br />'; - echo '<br /><input type="submit" name="Cancel" value="' . _('Cancel Offer') . '" /></div>'; - echo '</form>'; + echo '</table> + <br /> + <div class="centre"> + <input type="submit" name="Confirm" value="' . _('Confirm and Send Email') . '" /> + <br /> + <br /> + <input type="submit" name="Cancel" value="' . _('Cancel Offer') . '" /> + </div> + </form>'; include('includes/footer.inc'); exit; } @@ -138,7 +149,7 @@ /* If the supplierID is set then it must be a login from the supplier but if nothing else is * set then the supplier must have just logged in so show them the choices. */ -if (isset($_POST['SupplierID']) and empty($_POST['TenderType']) and empty($_POST['Search']) and empty($_POST['NewItem']) and empty($_GET['Delete'])) { +if (isset($_POST['SupplierID']) AND empty($_POST['TenderType']) AND empty($_POST['Search']) AND empty($_POST['NewItem']) AND empty($_GET['Delete'])) { if (isset($_SESSION['offer'])) { unset($_SESSION['offer']); } @@ -146,18 +157,27 @@ echo '<input type="hidden" name="FormID" value="' . $_SESSION['FormID'] . '" />'; echo '<p class="page_title_text"><img src="' . $rootpath . '/css/' . $theme . '/images/supplier.png" title="' . _('Tenders') . '" alt="" />' . ' ' . _('Create or View Offers from') . ' '.$Supplier.'</p>'; echo '<table class="selection">'; - echo'<tr><td>'._('Select option for tendering').'</td>'; - echo '<td><select name="TenderType">'; - echo '<option value="1">'._('View or Amend outstanding offers from').' '.$Supplier .'</option>'; - echo '<option value="2">'._('Create a new offer from').' '.$Supplier .'</option>'; - echo '<option value="3">'._('View any open tenders without an offer from').' '.$Supplier .'</option>'; - echo '</select></td></tr>'; + echo'<tr> + <td>'._('Select option for tendering').'</td> + <td><select name="TenderType"> + <option value="1">'._('View or Amend outstanding offers from').' '.$Supplier .'</option> + <option value="2">'._('Create a new offer from').' '.$Supplier .'</option> + <option value="3">'._('View any open tenders without an offer from').' '.$Supplier .'</option> + </select></td> + </tr>'; echo '<input type="hidden" name="SupplierID" value="'.$_POST['SupplierID'].'" />'; - echo '<tr><td colspan="2"><div class="centre"><input type="submit" name="submit" value="' . _('Select') . '" /></div></td></tr>'; - echo '</table></form>'; + echo '<tr> + <td colspan="2"> + <div class="centre"> + <input type="submit" name="submit" value="' . _('Select') . '" /> + </div> + </td> + </tr> + </table> + </form>'; } -if (isset($_POST['NewItem']) and !isset($_POST['Refresh'])) { +if (isset($_POST['NewItem']) AND !isset($_POST['Refresh'])) { foreach ($_POST as $key => $value) { if (mb_substr($key,0,7)=='StockID') { $Index = mb_substr($key,7,mb_strlen($key)-7); @@ -165,7 +185,7 @@ $Quantity=filter_number_format($_POST['Qty'.$Index]); $Price=filter_number_format($_POST['Price'.$Index]); $UOM=$_POST['uom'.$Index]; - if (isset($UOM) and $Quantity>0) { + if (isset($UOM) AND $Quantity>0) { $sql="SELECT description, decimalplaces FROM stockmaster WHERE stockid='".$StockID."'"; $result=DB_query($sql, $db); $myrow=DB_fetch_array($result); @@ -183,7 +203,7 @@ } } -if (isset($_POST['Refresh']) and !isset($_POST['NewItem'])) { +if (isset($_POST['Refresh']) AND !isset($_POST['NewItem'])) { foreach ($_POST as $key => $value) { if (mb_substr($key,0,7)=='StockID') { $Index = mb_substr($key,7,mb_strlen($key)-7); @@ -193,11 +213,10 @@ $ExpiryDate=$_POST['expirydate'.$Index]; } if (isset($ExpiryDate)) { - $_SESSION['offer']->update_offer_item( - $Index, - $Quantity, - $Price, - $ExpiryDate); + $_SESSION['offer']->update_offer_item($Index, + $Quantity, + $Price, + $ExpiryDate); unset($ExpiryDate); } } @@ -216,11 +235,10 @@ $ExpiryDate=$value; } if (isset($ExpiryDate)) { - $_SESSION['offer']->update_offer_item( - $LineNo, - $Quantity, - $Price, - $ExpiryDate); + $_SESSION['offer']->update_offer_item($LineNo, + $Quantity, + $Price, + $ExpiryDate); unset($ExpiryDate); } } @@ -244,11 +262,10 @@ $ExpiryDate=$value; } if (isset($ExpiryDate)) { - $_SESSION['offer']->update_offer_item( - $LineNo, - $Quantity, - $Price, - $ExpiryDate); + $_SESSION['offer']->update_offer_item($LineNo, + $Quantity, + $Price, + $ExpiryDate); unset($ExpiryDate); } } @@ -261,7 +278,7 @@ /*The supplier has chosen option 1 */ -if (isset($_POST['TenderType']) and $_POST['TenderType']==1 and !isset($_POST['Refresh'])) { +if (isset($_POST['TenderType']) AND $_POST['TenderType']==1 AND !isset($_POST['Refresh'])) { $sql="SELECT offers.offerid, offers.stockid, stockmaster.description, @@ -278,24 +295,23 @@ $_SESSION['offer']=new Offer($_POST['SupplierID']); $_SESSION['offer']->CurrCode=$Currency; while ($myrow=DB_fetch_array($result)) { - $_SESSION['offer']->add_to_offer( - $myrow['offerid'], - $myrow['stockid'], - $myrow['quantity'], - $myrow['description'], - $myrow['price'], - $myrow['uom'], - $myrow['decimalplaces'], - ConvertSQLDate($myrow['expirydate'])); + $_SESSION['offer']->add_to_offer($myrow['offerid'], + $myrow['stockid'], + $myrow['quantity'], + $myrow['description'], + $myrow['price'], + $myrow['uom'], + $myrow['decimalplaces'], + ConvertSQLDate($myrow['expirydate'])); } } -if (isset($_POST['TenderType']) and $_POST['TenderType']!=3 and isset($_SESSION['offer']) and $_SESSION['offer']->LinesOnOffer>0 or isset($_POST['Update'])) { +if (isset($_POST['TenderType']) AND $_POST['TenderType']!=3 AND isset($_SESSION['offer']) AND $_SESSION['offer']->LinesOnOffer>0 or isset($_POST['Update'])) { echo '<form method="post" action="' . htmlspecialchars($_SERVER['PHP_SELF']) . '">'; echo '<input type="hidden" name="FormID" value="' . $_SESSION['FormID'] . '" />'; echo '<p class="page_title_text"><img src="' . $rootpath . '/css/' . $theme . '/images/supplier.png" title="' . _('Search') . '" alt="" />' . ' ' . _('Items to offer from').' '.$Supplier .'</p>'; - echo '<table>'; - echo '<tr> + echo '<table> + <tr> <th>'._('Stock ID').'</th> <th>'._('Description').'</th> <th>'._('Quantity').'</th> @@ -307,43 +323,53 @@ $k=0; foreach ($_SESSION['offer']->LineItems as $LineItems) { if ($LineItems->Deleted==False) { - if ($k==1){ + if ($LineItems->ExpiryDate < date('Y-m-d')) { + echo '<tr bgcolor="#F7A9A9">'; + } elseif ($k==1){ echo '<tr class="EvenTableRows">'; $k=0; } else { echo '<tr class="OddTableRows">'; $k=1; } - if ($LineItems->ExpiryDate < date('Y-m-d')) { - echo '<tr bgcolor="#F7A9A9">'; - } + echo '<input type="hidden" name="StockID'.$LineItems->LineNo.'" value="'.$LineItems->StockID.'" />'; - echo '<td>'.$LineItems->StockID.'</td>'; - echo '<td>'.$LineItems->ItemDescription.'</td>'; - echo '<td><input type="text" class="number" name="Qty'.$LineItems->LineNo.'" value="'.locale_number_format($LineItems->Quantity,$LineItems->DecimalPlaces).'" /></td>'; - echo '<td>'.$LineItems->Units.'</td>'; - echo '<td><input type="text" class="number" name="Price'.$LineItems->LineNo.'" value="'.locale_number_format($LineItems->Price,2,'.','').'" /></td>'; - echo '<td class="number">'.locale_number_format($LineItems->Price*$LineItems->Quantity,2).'</td>'; - echo '<td><input type="text" size="11" class="date" alt="'.$_SESSION['DefaultDateFormat'].'" name="expirydate'.$LineItems->LineNo.'" value="'.$LineItems->ExpiryDate.'" /></td>'; - echo '<td><a href="' . htmlspecialchars($_SERVER['PHP_SELF']) . '?Delete=' . $LineItems->LineNo . '&Type=' . $_POST['TenderType'] . '">' . _('Remove') . '</a></td></tr>'; - echo '</tr>'; + echo '<td>'.$LineItems->StockID.'</td> + <td>'.$LineItems->ItemDescription.'</td> + <td><input type="text" class="number" name="Qty'.$LineItems->LineNo.'" value="'.locale_number_format($LineItems->Quantity,$LineItems->DecimalPlaces).'" /></td> + <td>'.$LineItems->Units.'</td> + <td><input type="text" class="number" name="Price'.$LineItems->LineNo.'" value="'.locale_number_format($LineItems->Price,2,'.','').'" /></td> + <td class="number">'.locale_number_format($LineItems->Price*$LineItems->Quantity,2).'</td> + <td><input type="text" size="11" class="date" alt="'.$_SESSION['DefaultDateFormat'].'" name="expirydate'.$LineItems->LineNo.'" value="'.$LineItems->ExpiryDate.'" /></td> + <td><a href="' . htmlspecialchars($_SERVER['PHP_SELF']) . '?Delete=' . $LineItems->LineNo . '&Type=' . $_POST['TenderType'] . '">' . _('Remove') . '</a></td> + </tr>'; } } echo '</table>'; echo '<input type="hidden" name="TenderType" value="'.$_POST['TenderType'].'" />'; if ($_POST['TenderType']==1) { - echo '<br /><div class="centre"><input type="submit" name="Update" value="Update offer" />'; - echo '<input type="submit" name="Refresh" value="Refresh screen" /></div>'; + echo '<br /> + <div class="centre"> + <input type="submit" name="Update" value="Update offer" /> + <input type="submit" name="Refresh" value="Refresh screen" /> + </div>'; } else if ($_POST['TenderType']==2) { - echo '<br /><div class="centre"><input type="submit" name="Save" value="Save offer">'; - echo '<input type="submit" name="Refresh" value="Refresh screen" /></div>'; + echo '<br /> + <div class="centre"> + <input type="submit" name="Save" value="Save offer"> + <input type="submit" name="Refresh" value="Refresh screen" /> + </div>'; } echo '</form>'; } /*The supplier has chosen option 2 */ -if (isset($_POST['TenderType']) and $_POST['TenderType']==2 and !isset($_POST['Search']) or isset($_GET['Delete'])) { +if (isset($_POST['TenderType']) + AND $_POST['TenderType']==2 + AND !isset($_POST['Search']) + OR isset($_GET['Delete'])) { + if (!isset($_SESSION['offer'])) { $_SESSION['offer']=new Offer($_POST['SupplierID']); } @@ -352,9 +378,9 @@ echo '<p class="page_title_text"><img src="' . $rootpath . '/css/' . $theme . '/images/magnifier.png" title="' . _('Search') . '" alt="" />' . ' ' . _('Search for Inventory Items') . '</p>'; $sql = "SELECT categoryid, - categorydescription - FROM stockcategory - ORDER BY categorydescription"; + categorydescription + FROM stockcategory + ORDER BY categorydescription"; $result = DB_query($sql, $db); if (DB_num_rows($result) == 0) { @@ -390,23 +416,37 @@ } echo '<input type="hidden" name="TenderType" value="'.$_POST['TenderType'].'" />'; echo '<input type="hidden" name="SupplierID" value="'.$_POST['SupplierID'].'" />'; - echo '</td></tr><tr><td></td>'; - echo '<td><font size="3"><b>' . _('OR') . ' ' . '</b></font>' . _('Enter partial') . ' <b>' . _('Stock Code') . '</b>:</td>'; - echo '<td>'; + echo '</td> + </tr> + <tr> + <td></td> + <td><font size="3"><b>' . _('OR') . ' ' . '</b></font>' . _('Enter partial') . ' <b>' . _('Stock Code') . '</b>:</td> + <td>'; if (isset($_POST['StockCode'])) { echo '<input type="text" name="StockCode" value="' . $_POST['StockCode'] . '" size="15" maxlength="18" />'; } else { echo '<input type="text" name="StockCode" size="15" maxlength="18" />'; } - echo '</td></tr></table><br />'; - echo '<div class="centre"><input type="submit" name="Search" value="' . _('Search Now') . '" /></div><br /></form>'; + echo '</td> + </tr> + </table> + <br /> + <div class="centre"> + <input type="submit" name="Search" value="' . _('Search Now') . '" /> + </div> + <br /> + </form>'; echo '<script type="text/javascript">defaultControl(document.forms[0].StockCode);</script>'; echo '</form>'; } /*The supplier has chosen option 3 */ -if (isset($_POST['TenderType']) and $_POST['TenderType']==3 and !isset($_POST['Search']) or isset($_GET['Delete'])) { +if (isset($_POST['TenderType']) + AND $_POST['TenderType']==3 + AND !isset($_POST['Search']) + OR isset($_GET['Delete'])) { + echo '<p class="page_title_text"><img src="' . $rootpath . '/css/' . $theme . '/images/supplier.png" title="' . _('Tenders') . '" alt="" />' . ' ' . _('Tenders Waiting For Offers').'</p>'; $sql="SELECT DISTINCT tendersuppliers.tenderid, suppliers.currcode @@ -421,7 +461,9 @@ ORDER BY tendersuppliers.tenderid"; $result=DB_query($sql, $db); echo '<table class="selection">'; - echo '<tr><th colspan="13"><font size="3" color="#616161">' . _('Outstanding Tenders Waiting For Offer') . '</font></th></tr>'; + echo '<tr> + <th colspan="13"><font size="3" color="#616161">' . _('Outstanding Tenders Waiting For Offer') . '</font></th> + </tr>'; while ($myrow=DB_fetch_row($result)) { echo '<form action="' . $_SERVER['PHP_SELF'] . '" method="post">'; echo '<input type="hidden" name="FormID" value="' . $_SESSION['FormID'] . '" />'; @@ -436,13 +478,15 @@ address6, telephone FROM tenders - LEFT JOIN locations + INNER JOIN locations ON tenders.location=locations.loccode WHERE closed=0 AND tenderid='".$myrow[0]."'"; $LocationResult=DB_query($LocationSQL, $db); $MyLocationRow=DB_fetch_row($LocationResult); - echo '<tr><td valign="top" style="background-color:#cccce5">' . _('Deliver To') . ':</td><td valign="top" style="background-color:#cccce5">'; + echo '<tr> + <td valign="top" style="background-color:#cccce5">' . _('Deliver To') . ':</td> + <td valign="top" style="background-color:#cccce5">'; for ($i=1; $i<8; $i++) { if ($MyLocationRow[$i]!='') { echo $MyLocationRow[$i] . '<br />'; @@ -451,7 +495,8 @@ echo '</td>'; echo '<th colspan="8" style="vertical-align:top"><font size="2" color="#616161">' . _('Tender Number') . ': ' .$myrow[0] . '</font></th>'; echo '<input type="hidden" value="' . $myrow[0] . '" name="Tender" />'; - echo '<th><input type="submit" value="' . _('Process') . "\n" . _('Tender') . '" name="Process" /></th></tr>'; + echo '<th><input type="submit" value="' . _('Process') . "\n" . _('Tender') . '" name="Process" /></th> + </tr>'; $ItemSQL="SELECT tenderitems.tenderid, tenderitems.stockid, stockmaster.description, @@ -471,37 +516,42 @@ ON tenders.tenderid=tenderitems.tenderid WHERE tenderitems.tenderid='" . $myrow[0] . "'"; $ItemResult=DB_query($ItemSQL, $db); - echo '<tr><th>' . stripslashes($_SESSION['CompanyRecord']['coyname']) . '<br />' . _('Item Code') . '</th>'; - echo '<th>' . _('Item Description') . '</th>'; - echo '<th>' . $Supplier . '<br />' . _('Item Code') . '</th>'; - echo '<th>' . _('Quantity') . '<br />' . _('Required') . '</th>'; - echo '<th>' . stripslashes($_SESSION['CompanyRecord']['coyname']) . '<br />' . _('Units of Measure') . '</th>'; - echo '<th>' . _('Required By') . '</th>'; - echo '<th>' . _('Quantity') . '<br />' . _('Offered') . '</th>'; - echo '<th>' . $Supplier . '<br />' . _('Units of Measure') . '</th>'; - echo '<th>' . _('Currency') . '</th>'; - echo '<th>' . $Supplier . '<br />' . _('Price') . '</th>'; - echo '<th>' . _('Delivery By') . '</th>'; + echo '<tr> + <th>' . stripslashes($_SESSION['CompanyRecord']['coyname']) . '<br />' . _('Item Code') . '</th> + <th>' . _('Item Description') . '</th> + <th>' . $Supplier . '<br />' . _('Item Code') . '</th> + <th>' . _('Quantity') . '<br />' . _('Required') . '</th> + <th>' . stripslashes($_SESSION['CompanyRecord']['coyname']) . '<br />' . _('Units of Measure') . '</th> + <th>' . _('Required By') . '</th> + <th>' . _('Quantity') . '<br />' . _('Offered') . '</th> + <th>' . $Supplier . '<br />' . _('Units of Measure') . '</th> + <th>' . _('Currency') . '</th> + <th>' . $Supplier . '<br />' . _('Price') . '</th> + <th>' . _('Delivery By') . '</th> + </tr>'; $i=0; while ($MyItemRow=DB_fetch_array($ItemResult)) { - echo '<tr><td>' . $MyItemRow['stockid'] . '</td>'; - echo '<td>' . $MyItemRow['description'] . '</td>'; - echo '<input type="hidden" name="StockID'. $i . '" value="' . $MyItemRow['stockid'] . '" />'; - echo '<input type="hidden" name="ItemDescription'. $i . '" value="' . $MyItemRow['description'] . '" />'; - echo '<td>' . $MyItemRow['suppliers_partno'] . '</td>'; - echo '<td class="number">' . locale_number_format($MyItemRow['quantity'], $MyItemRow['decimalplaces']) . '</td>'; - echo '<td>' . $MyItemRow['units'] . '</td>'; - echo '<td>' . ConvertSQLDate($MyItemRow['requiredbydate']) . '</td>'; + echo '<tr> + <td>' . $MyItemRow['stockid'] . '</td> + <td>' . $MyItemRow['description'] . '</td> + <input type="hidden" name="StockID'. $i . '" value="' . $MyItemRow['stockid'] . '" /> + <input type="hidden" name="ItemDescription'. $i . '" value="' . $MyItemRow['description'] . '" /> + <td>' . $MyItemRow['suppliers_partno'] . '</td> + <td class="number">' . locale_number_format($MyItemRow['quantity'], $MyItemRow['decimalplaces']) . '</td> + <td>' . $MyItemRow['units'] . '</td> + <td>' . ConvertSQLDate($MyItemRow['requiredbydate']) . '</td>'; + if ($MyItemRow['suppliersuom']=='') { $MyItemRow['suppliersuom']=$MyItemRow['units']; } - echo '<td><input type="text" class="number" size="10" name="Qty'. $i . '" value="' . locale_number_format($MyItemRow['quantity'], $MyItemRow['decimalplaces']) . '" /></td>'; - echo '<input type="hidden" name="UOM'. $i . '" value="' . $MyItemRow['units'] . '" />'; - echo '<input type="hidden" name="DecimalPlaces'. $i . '" value="' . $MyItemRow['decimalplaces'] . '" />'; - echo '<td>' . $MyItemRow['suppliersuom'] . '</td>'; - echo '<td>' . $myrow[1] . '</td>'; - echo '<td><input type="text" class="number" size="10" name="Price'. $i . '" value="0.00" /></td>'; - echo '<td><input type="text" class="date" alt="' .$_SESSION['DefaultDateFormat'] .'" name="RequiredByDate'. $i . '" size="11" value="' . ConvertSQLDate($MyItemRow['requiredbydate']) . '" /></td>'; + echo '<td><input type="text" class="number" size="10" name="Qty'. $i . '" value="' . locale_number_format($MyItemRow['quantity'], $MyItemRow['decimalplaces']) . '" /></td> + <input type="hidden" name="UOM'. $i . '" value="' . $MyItemRow['units'] . '" /> + <input type="hidden" name="DecimalPlaces'. $i . '" value="' . $MyItemRow['decimalplaces'] . '" /> + <td>' . $MyItemRow['suppliersuom'] . '</td> + <td>' . $myrow[1] . '</td> + <td><input type="text" class="number" size="10" name="Price'. $i . '" value="0.00" /></td> + <td><input type="text" class="date" alt="' .$_SESSION['DefaultDateFormat'] .'" name="RequiredByDate'. $i . '" size="11" value="' . ConvertSQLDate($MyItemRow['requiredbydate']) . '" /></td> + </tr>'; } echo '</form>'; } @@ -513,7 +563,7 @@ echo '<input type="hidden" name="FormID" value="' . $_SESSION['FormID'] . '" />'; echo '<p class="page_title_text"><img src="' . $rootpath . '/css/' . $theme . '/images/supplier.png" title="' . _('Tenders') . '" alt="" />' . ' ' . _('Select items to offer from').' '.$Supplier .'</p>'; - if ($_POST['Keywords'] and $_POST['StockCode']) { + if ($_POST['Keywords'] AND $_POST['StockCode']) { prnMsg( _('Stock description keywords have been used in preference to the Stock code extract entered'), 'info' ); } if ($_POST['Keywords']) { @@ -522,29 +572,29 @@ if ($_POST['StockCat']=='All'){ $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!='A' - AND stockmaster.mbflag!='K' - and stockmaster.discontinued!=1 - AND stockmaster.description " . LIKE . " '$SearchString' - ORDER BY stockmaster.stockid"; + stockmaster.description, + stockmaster.units + FROM stockmaster INNER JOIN stockcategory + ON stockmaster.categoryid=stockcategory.categoryid + WHERE stockmaster.mbflag!='D' + AND stockmaster.mbflag!='A' + AND stockmaster.mbflag!='K' + AND stockmaster.discontinued!=1 + AND stockmaster.description " . LIKE . " '$SearchString' + ORDER BY stockmaster.stockid"; } 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!='A' - AND stockmaster.mbflag!='K' - and stockmaster.discontinued!=1 - AND stockmaster.description " . LIKE . " '$SearchString' - AND stockmaster.categoryid='" . $_POST['StockCat'] . "' - ORDER BY stockmaster.stockid"; + stockmaster.description, + stockmaster.units + FROM stockmaster INNER JOIN stockcategory + ON stockmaster.categoryid=stockcategory.categoryid + WHERE stockmaster.mbflag!='D' + AND stockmaster.mbflag!='A' + AND stockmaster.mbflag!='K' + AND stockmaster.discontinued!=1 + AND stockmaster.description " . LIKE . " '$SearchString' + AND stockmaster.categoryid='" . $_POST['StockCat'] . "' + ORDER BY stockmaster.stockid"; } } elseif ($_POST['StockCode']){ @@ -553,55 +603,55 @@ if ($_POST['StockCat']=='All'){ $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!='A' - AND stockmaster.mbflag!='K' - and stockmaster.discontinued!=1 - AND stockmaster.stockid " . LIKE . " '" . $_POST['StockCode'] . "' - ORDER BY stockmaster.stockid"; + stockmaster.description, + stockmaster.units + FROM stockmaster INNER JOIN stockcategory + ON stockmaster.categoryid=stockcategory.categoryid + WHERE stockmaster.mbflag!='D' + AND stockmaster.mbflag!='A' + AND stockmaster.mbflag!='K' + AND stockmaster.discontinued!=1 + AND stockmaster.stockid " . LIKE . " '" . $_POST['StockCode'] . "' + ORDER BY stockmaster.stockid"; } 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!='A' - AND stockmaster.mbflag!='K' - and stockmaster.discontinued!=1 - AND stockmaster.stockid " . LIKE . " '" . $_POST['StockCode'] . "' - AND stockmaster.categoryid='" . $_POST['StockCat'] . "' - ORDER BY stockmaster.stockid"; + stockmaster.description, + stockmaster.units + FROM stockmaster INNER JOIN stockcategory + ON stockmaster.categoryid=stockcategory.categoryid + WHERE stockmaster.mbflag!='D' + AND stockmaster.mbflag!='A' + AND stockmaster.mbflag!='K' + AND stockmaster.discontinued!=1 + AND stockmaster.stockid " . LIKE . " '" . $_POST['StockCode'] . "' + AND stockmaster.categoryid='" . $_POST['StockCat'] . "' + ORDER BY stockmaster.stockid"; } } else { if ($_POST['StockCat']=='All'){ $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!='A' - AND stockmaster.mbflag!='K' - and stockmaster.discontinued!=1 - ORDER BY stockmaster.stockid"; + stockmaster.description, + stockmaster.units + FROM stockmaster INNER JOIN stockcategory + ON stockmaster.categoryid=stockcategory.categoryid + WHERE stockmaster.mbflag!='D' + AND stockmaster.mbflag!='A' + AND stockmaster.mbflag!='K' + AND stockmaster.discontinued!=1 + ORDER BY stockmaster.stockid"; } 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!='A' - AND stockmaster.mbflag!='K' - and stockmaster.discontinued!=1 - AND stockmaster.categoryid='" . $_POST['StockCat'] . "' - ORDER BY stockmaster.stockid"; + stockmaster.description, + stockmaster.units + FROM stockmaster INNER JOIN stockcategory + ON stockmaster.categoryid=stockcategory.categoryid + WHERE stockmaster.mbflag!='D' + AND stockmaster.mbflag!='A' + AND stockmaster.mbflag!='K' + AND stockmaster.discontinued!=1 + AND stockmaster.categoryid='" . $_POST['StockCat'] . "' + ORDER BY stockmaster.stockid"; } } @@ -609,7 +659,7 @@ $DbgMsg = _('The SQL statement that failed was'); $SearchResult = DB_query($sql,$db,$ErrMsg,$DbgMsg); - if (DB_num_rows($SearchResult)==0 and $debug==1){ + if (DB_num_rows($SearchResult)==0 AND $debug==1){ prnMsg( _('There are no products to display matching the criteria provided'),'warn'); } if (DB_num_rows($SearchResult)==1){ @@ -623,7 +673,7 @@ echo '<table cellpadding="1" colspan="7">'; - $tableheader = '<tr> + $TableHeader = '<tr> <th>' . _('Code') . '</th> <th>' . _('Description') . '</th> <th>' . _('Units') . '</th> @@ -631,7 +681,7 @@ <th>' . _('Quantity') . '</th> <th>' . _('Price') .' ('.$Currency.')</th> </tr>'; - echo $tableheader; + echo $TableHeader; $i = 0; $k = 0; //row colour counter @@ -646,8 +696,8 @@ $k=1; } - $filename = $myrow['stockid'] . '.jpg'; - if (file_exists( $_SESSION['part_pics_dir'] . '/' . $filename) ) { + $FileName = $myrow['stockid'] . '.jpg'; + if (file_exists( $_SESSION['part_pics_dir'] . '/' . $FileName) ) { $ImageSource = '<img src="'.$rootpath . '/' . $_SESSION['part_pics_dir'] . '/' . $myrow['stockid'] . '.jpg" width="50" height="50" />'; @@ -655,7 +705,7 @@ $ImageSource = '<i>'._('No Image').'</i>'; } - $uomsql="SELECT conversionfactor, + $UOMsql="SELECT conversionfactor, suppliersuom, unitsofmeasure.unitname FROM purchdata @@ -664,25 +714,25 @@ WHERE supplierno='".$_POST['SupplierID']."' AND stockid='" . $myrow['stockid'] . "'"; - $uomresult=DB_query($uomsql, $db); - if (DB_num_rows($uomresult)>0) { - $uomrow=DB_fetch_array($uomresult); - if (mb_strlen($uomrow['suppliersuom'])>0) { - $uom=$uomrow['unitname']; + $UOMresult=DB_query($UOMsql, $db); + if (DB_num_rows($UOMresult)>0) { + $UOMrow=DB_fetch_array($UOMresult); + if (mb_strlen($UOMrow['suppliersuom'])>0) { + $UOM=$UOMrow['unitname']; } else { - $uom=$myrow['units']; + $UOM=$myrow['units']; } } else { - $uom=$myrow['units']; + $UOM=$myrow['units']; } echo '<td>'.$myrow['stockid'].'</td> <td>'.$myrow['description'].'</td> - <td>'.$uom.'</td> + <td>'.$UOM.'</td> <td>'.$ImageSource.'</td> <td><input class="number" type="text" size="6" value="0" name="Qty'.$i.'" /></td> <td><input class="number" type="text" size="12" value="0" name="Price'.$i.'" /></td> <input type="hidden" size="12" value="'.$myrow['stockid'].'" name="StockID'.$i.'" /> - <input type="hidden" value="'.$uom.'" name="uom'.$i.'" /> + <input type="hidden" value="'.$UOM.'" name="uom'.$i.'" /> </tr>'; $i++; $PartsDisplayed++; @@ -696,11 +746,14 @@ if ($PartsDisplayed == $Maximum_Number_Of_Parts_To_Show){ /*$Maximum_Number_Of_Parts_To_Show defined in config.php */ - prnMsg( _('Only the first') . ' ' . $Maximum_Number_Of_Parts_To_Show . ' ' . _('can be displayed') . '. ' . _('Please restrict your search to only the parts required'),'info'); } - echo '<a name="end"></a><br /><div class="centre"><input type="submit" name="NewItem" value="Add to Offer" /></div>'; + echo '<a name="end"></a> + <br /> + <div class="centre"> + <input type="submit" name="NewItem" value="Add to Offer" /> + </div>'; }#end if SearchResults to show echo '<input type="hidden" name="TenderType" value="'.$_POST['TenderType'].'" />'; echo '<input type="hidden" name="SupplierID" value="'.$_POST['SupplierID'].'" />'; Modified: trunk/UpgradeDatabase.php =================================================================== --- trunk/UpgradeDatabase.php 2012-01-20 22:55:59 UTC (rev 4823) +++ trunk/UpgradeDatabase.php 2012-01-20 23:10:18 UTC (rev 4824) @@ -132,8 +132,8 @@ case '4.06.5': $SQLScripts[] = './sql/mysql/upgrade4.05-4.06.sql'; case '4.06.6': - $SQLScripts[] = './sql/mysql/upgrade4.05-4.06.sql'; - case '4.06.7': + $SQLScripts[] = './sql/mysql/upgrade4.06-4.07.sql'; + case '4.07.0': break; } //end switch } Modified: trunk/api/api_stock.php =================================================================== --- trunk/api/api_stock.php 2012-01-20 22:55:59 UTC (rev 4823) +++ trunk/api/api_stock.php 2012-01-20 23:10:18 UTC (rev 4824) @@ -1,5 +1,5 @@ <?php - + /* Check that the stock code*/ function VerifyStockCode($StockCode, $i, $Errors, $db) { $Searchsql = "SELECT count(stockid) @@ -734,8 +734,8 @@ WHERE stockid='" .$StockID. "' AND typeabbrev='" .$SalesType. "' AND currabrev='".$Currency. "' - AND startdate>='". Date('Y-m-d') . "' - (AND enddate<='" . Date('Y-m-d') . "' OR enddate='0000-00-00')"; + AND startdate<='". Date('Y-m-d') . "' + AND (enddate>'" . Date('Y-m-d') . "' OR enddate='0000-00-00')"; $result = DB_Query($sql, $db); $myrow = DB_fetch_row($result); if ($myrow[0]==0) { @@ -746,8 +746,8 @@ WHERE stockid='" .$StockID. "' AND typeabbrev='" .$SalesType. "' AND currabrev='".$Currency. "' - AND startdate>='". Date('Y-m-d') . "' - (AND enddate<='" . Date('Y-m-d') . "' OR enddate='0000-00-00')"; + AND startdate<='". Date('Y-m-d') . "' + AND (enddate>'" . Date('Y-m-d') . "' OR enddate='0000-00-00')"; } $result = DB_Query($sql, $db); $myrow = DB_fetch_row($result); Modified: trunk/api/api_xml-rpc.php =================================================================== --- trunk/api/api_xml-rpc.php 2012-01-20 22:55:59 UTC (rev 4823) +++ trunk/api/api_xml-rpc.php 2012-01-20 23:10:18 UTC (rev 4824) @@ -1048,7 +1048,7 @@ /*x*/ $xmlrpcmsg->getParam( 2 )->scalarval( ), /*x*/ $xmlrpcmsg->getParam( 3 )->scalarval( ), /*x*/ $xmlrpcmsg->getParam( 4 )->scalarval( ))) ); -/*x*/ } else { +/*x*/ } else { //only 3 parameters if login already in session $rtn = new xmlrpcresp( php_xmlrpc_encode(GetStockPrice($xmlrpcmsg->getParam( 0 )->scalarval( ), $xmlrpcmsg->getParam( 1 )->scalarval( ), /*e*/ $xmlrpcmsg->getParam( 2 )->scalarval( ), '', ''))); Modified: trunk/includes/DefineOfferClass.php =================================================================== --- trunk/includes/DefineOfferClass.php 2012-01-20 22:55:59 UTC (rev 4823) +++ trunk/includes/DefineOfferClass.php 2012-01-20 23:10:18 UTC (rev 4824) @@ -30,32 +30,31 @@ FROM suppliers WHERE supplierid='" . $this->SupplierID . "'"; $result=DB_query($sql, $db); - $myrow=DB_fetch_row($result); - $this->SupplierName = $myrow[0]; - $this->EmailAddress = $myrow[1]; - $this->CurrCode = $myrow[2]; + $myrow=DB_fetch_array($result); + $this->SupplierName = $myrow['suppname']; + $this->EmailAddress = $myrow['email']; + $this->CurrCode = $myrow['currcode']; } - function add_to_offer( - $LineNo, - $StockID, - $Qty, - $ItemDescr, - $Price, - $UOM, - $DecimalPlaces, - $ExpiryDate){ + function add_to_offer( $LineNo, + $StockID, + $Qty, + $ItemDescr, + $Price, + $UOM, + $DecimalPlaces, + $ExpiryDate){ if (isset($Qty) and $Qty!=0){ $this->LineItems[$LineNo] = new LineDetails($LineNo, - $StockID, - $Qty, - $ItemDescr, - $Price, - $UOM, - $DecimalPlaces, - $ExpiryDate); + $StockID, + $Qty, + $ItemDescr, + $Price, + $UOM, + $DecimalPlaces, + $ExpiryDate); $this->LinesOnOffer++; Return 1; } @@ -74,25 +73,22 @@ if ($Update=='') { foreach ($this->LineItems as $LineItems) { if ($LineItems->Deleted==False) { - $sql="INSERT INTO offers ( - supplierid, - tenderid, - stockid, - quantity, - uom, - price, - expirydate, - currcode) - VALUES ( - '".$this->SupplierID."', - '".$this->TenderID."', - '".$LineItems->StockID."', - '".$LineItems->Quantity."', - '".$LineItems->Units."', - '".$LineItems->Price."', - '".FormatDateForSQL($LineItems->ExpiryDate)."', - '".$this->CurrCode."' - )"; + $sql="INSERT INTO offers ( supplierid, + tenderid, + stockid, + quantity, + uom, + price, + expirydate, + currcode) + VALUES ('".$this->SupplierID."', + '".$this->TenderID."', + '".$LineItems->StockID."', + '".$LineItems->Quantity."', + '".$LineItems->Units."', + '".$LineItems->Price."', + '".FormatDateForSQL($LineItems->ExpiryDate)."', + '".$this->CurrCode."')"; $ErrMsg = _('The suppliers offer could not be inserted into the database because'); $DbgMsg = _('The SQL statement used to insert the suppliers offer record and failed was'); $result = DB_query($sql,$db,$ErrMsg,$DbgMsg,true); @@ -109,11 +105,10 @@ } } else { foreach ($_SESSION['offer']->LineItems as $LineItems) { - $sql="UPDATE offers SET - quantity='".$LineItems->Quantity."', - price='".$LineItems->Price."', - expirydate='".FormatDateForSQL($LineItems->ExpiryDate)."' - WHERE offerid='".$LineItems->LineNo . "'"; + $sql="UPDATE offers SET quantity='".$LineItems->Quantity."', + price='".$LineItems->Price."', + expirydate='".FormatDateForSQL($LineItems->ExpiryDate)."' + WHERE offerid='".$LineItems->LineNo . "'"; $ErrMsg = _('The suppliers offer could not be updated on the database because'); $DbgMsg = _('The SQL statement used to update the suppliers offer record and failed was'); $result = DB_query($sql,$db,$ErrMsg,$DbgMsg,true); @@ -140,9 +135,9 @@ } function update_offer_item($LineNo, - $Qty, - $Price, - $ExpiryDate){ + $Qty, + $Price, + $ExpiryDate){ $this->LineItems[$LineNo]->Quantity = $Qty; $this->LineItems[$LineNo]->Price = $Price; @@ -175,23 +170,21 @@ var $Deleted; var $ExpiryDate; - function LineDetails ( - $LineNo, - $StockItem, - $Qty, - $ItemDescr, - $Prc, - $UOM, - $DecimalPlaces, - $ExpiryDate) - { + function LineDetails ($LineNo, + $StockItem, + $Qty, + $ItemDescr, + $Price, + $UOM, + $DecimalPlaces, + $ExpiryDate) { /* Constructor function to add a new LineDetail object with passed params */ $this->LineNo = $LineNo; $this->StockID =$StockItem; $this->ItemDescription = $ItemDescr; $this->Quantity = $Qty; - $this->Price = $Prc; + $this->Price = $Price; $this->Units = $UOM; $this->DecimalPlaces = $DecimalPlaces; $this->ExpiryDate = $ExpiryDate; Modified: trunk/includes/DefineTenderClass.php =================================================================== --- trunk/includes/DefineTenderClass.php 2012-01-20 22:55:59 UTC (rev 4823) +++ trunk/includes/DefineTenderClass.php 2012-01-20 23:10:18 UTC (rev 4824) @@ -1,9 +1,8 @@ <?php -/* $Id$ */ +/* $Id: DefineTenderClass.php 4821 2012-01-20 13:48:53Z tim_schofield $ */ /* Definition of the tender class to hold all the information for a supplier tender */ - Class Tender { var $TenderId; @@ -58,62 +57,55 @@ */ if ($this->TenderId=='') { $this->TenderId = GetNextTransNo(37, $db); - $HeaderSQL="INSERT INTO tenders ( - tenderid, - location, - address1, - address2, - address3, - address4, - address5, - address6, - telephone, - requiredbydate) - VALUES ( - '" . $this->TenderId . "', - '" . $this->Location . "', - '" . $this->DelAdd1 . "', - '" . $this->DelAdd2 . "', - '" . $this->DelAdd3 . "', - '" . $this->DelAdd4 . "', - '" . $this->DelAdd5 . "', - '" . $this->DelAdd6 . "', - '" . $this->Telephone . "', - '" . FormatDateForSQL($this->RequiredByDate) . "')"; + $HeaderSQL="INSERT INTO tenders (tenderid, + location, + address1, + address2, + address3, + address4, + address5, + address6, + telephone, + requiredbydate) + VALUES ('" . $this->TenderId . "', + '" . $this->Location . "', + '" . $this->DelAdd1 . "', + '" . $this->DelAdd2 . "', + '" . $this->DelAdd3 . "', + '" . $this->DelAdd4 . "', + '" . $this->DelAdd5 . "', + '" . $this->DelAdd6 . "', + '" . $this->Telephone . "', + '" . FormatDateForSQL($this->RequiredByDate) . "')"; foreach ($this->Suppliers as $Supplier) { - $SuppliersSQL[]="INSERT INTO tendersuppliers ( - tenderid, - supplierid, - email) - VALUES ( - '" . $this->TenderId . "', - '" . $Supplier->SupplierCode . "', - '" . $Supplier->EmailAddress . "')"; + $SuppliersSQL[]="INSERT INTO tendersuppliers (tenderid, + supplierid, + email) + VALUES ('" . $this->TenderId . "', + '" . $Supplier->SupplierCode . "', + '" . $Supplier->EmailAddress . "')"; } foreach ($this->LineItems as $LineItem) { - $ItemsSQL[]="INSERT INTO tenderitems ( - tenderid, - stockid, - quantity, - units) - VALUES ( - '" . $this->TenderId . "', - '" . $LineItem->StockID . "', - '" . $LineItem->Quantity . "', - '" . $LineItem->Units . "')"; + $ItemsSQL[]="INSERT INTO tenderitems (tenderid, + stockid, + quantity, + units) + VALUES ('" . $this->TenderId . "', + '" . $LineItem->StockID . "', + '" . $LineItem->Quantity . "', + '" . $LineItem->Units . "')"; } } else { - $HeaderSQL="UPDATE tenders - SET location='" . $this->Location . "', - address1='" . $this->DelAdd1 . "', - address2='" . $this->DelAdd2 . "', - address3='" . $this->DelAdd3 . "', - address4='" . $this->DelAdd4 . "', - address5='" . $this->DelAdd5 . "', - address6='" . $this->DelAdd6 . "', - telephone='" . $this->Telephone . "', - requiredbydate='" . FormatDateForSQL($this->RequiredByDate) . "' - WHERE tenderid = '" . $this->TenderId . "'"; + $HeaderSQL="UPDATE tenders SET location='" . $this->Location . "', + address1='" . $this->DelAdd1 . "', + address2='" . $this->DelAdd2 . "', + address3='" . $this->DelAdd3 . "', + address4='" . $this->DelAdd4 . "', + address5='" . $this->DelAdd5 . "', + address6='" . $this->DelAdd6 . "', + telephone='" . $this->Telephone . "', + requiredbydate='" . FormatDateForSQL($this->RequiredByDate) . "' + WHERE tenderid = '" . $this->TenderId . "'"; foreach ($this->Suppliers as $Supplier) { $sql="DELETE FROM tendersuppliers WHERE tenderid='" . $this->TenderId . "'"; @@ -122,25 +114,22 @@ tenderid, supplierid, email) - VALUES ( - '" . $this->TenderId . "', - '" . $Supplier->SupplierCode . "', - '" . $Supplier->EmailAddress . "')"; + VALUES ('" . $this->TenderId . "', + '" . $Supplier->SupplierCode . "', + '" . $Supplier->EmailAddress . "')"; } foreach ($this->LineItems as $LineItem) { $sql="DELETE FROM tenderitems - WHERE tenderid='" . $this->TenderId . "'"; + WHERE tenderid='" . $this->TenderId . "'"; $result=DB_query($sql, $db); - $ItemsSQL[]="INSERT INTO tenderitems ( - tenderid, - stockid, - quantity, - units) - VALUES ( - '" . $this->TenderId . "', - '" . $LineItem->StockID . "', - '" . $LineItem->Quantity . "', - '" . $LineItem->Units . "')"; + $ItemsSQL[]="INSERT INTO tenderitems (tenderid, + stockid, + quantity, + units) + ... [truncated message content] |
From: <vv...@us...> - 2012-01-20 22:56:05
|
Revision: 4823 http://web-erp.svn.sourceforge.net/web-erp/?rev=4823&view=rev Author: vvs2012 Date: 2012-01-20 22:55:59 +0000 (Fri, 20 Jan 2012) Log Message: ----------- Changed $DB_error_no($db) to DB_error_no($db) in Z_ChangeStockCode.php Modified Paths: -------------- trunk/Z_ChangeStockCode.php trunk/doc/Change.log Modified: trunk/Z_ChangeStockCode.php =================================================================== --- trunk/Z_ChangeStockCode.php 2012-01-20 22:52:45 UTC (rev 4822) +++ trunk/Z_ChangeStockCode.php 2012-01-20 22:55:59 UTC (rev 4823) @@ -134,7 +134,7 @@ //check if MRP tables exist before assuming $result = DB_query("SELECT COUNT(*) FROM mrpplannedorders",$db,'','',false,false); - if ($DB_error_no($db)==0) { + if (DB_error_no($db)==0) { echo '<br />' . _('Changing MRP planned orders information'); $sql = "UPDATE mrpplannedorders SET part='" . $_POST['NewStockID'] . "' WHERE part='" . $_POST['OldStockID'] . "'"; $ErrMsg = _('The SQL to update the mrpplannedorders records failed'); Modified: trunk/doc/Change.log =================================================================== --- trunk/doc/Change.log 2012-01-20 22:52:45 UTC (rev 4822) +++ trunk/doc/Change.log 2012-01-20 22:55:59 UTC (rev 4823) @@ -1,5 +1,6 @@ webERP Change Log +20/1/12 Vitaly: Changed $DB_error_no($db) to DB_error_no($db) in Z_ChangeStockCode.php 20/1/12 Vitaly: xhtml fixes in CustomerBranches.php StockAdjustments.php WorkOrderEntry.php 20/1/12 Tim: Merge tendering system from Tim's branch 20/1/12 Tim: Merge xhtml fixes from Tim's branch: Labels.php TaxGroups.php GLCodesInquiry.php CustomerInquiry.php SalesByTypePeriodInquiry.php ContractBOM.php Shippers.php MRPPlannedWorkOrders.php This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <vv...@us...> - 2012-01-20 22:56:05
|
Revision: 4823 http://web-erp.svn.sourceforge.net/web-erp/?rev=4823&view=rev Author: vvs2012 Date: 2012-01-20 22:55:59 +0000 (Fri, 20 Jan 2012) Log Message: ----------- Changed $DB_error_no($db) to DB_error_no($db) in Z_ChangeStockCode.php Modified Paths: -------------- trunk/Z_ChangeStockCode.php trunk/doc/Change.log Modified: trunk/Z_ChangeStockCode.php =================================================================== --- trunk/Z_ChangeStockCode.php 2012-01-20 22:52:45 UTC (rev 4822) +++ trunk/Z_ChangeStockCode.php 2012-01-20 22:55:59 UTC (rev 4823) @@ -134,7 +134,7 @@ //check if MRP tables exist before assuming $result = DB_query("SELECT COUNT(*) FROM mrpplannedorders",$db,'','',false,false); - if ($DB_error_no($db)==0) { + if (DB_error_no($db)==0) { echo '<br />' . _('Changing MRP planned orders information'); $sql = "UPDATE mrpplannedorders SET part='" . $_POST['NewStockID'] . "' WHERE part='" . $_POST['OldStockID'] . "'"; $ErrMsg = _('The SQL to update the mrpplannedorders records failed'); Modified: trunk/doc/Change.log =================================================================== --- trunk/doc/Change.log 2012-01-20 22:52:45 UTC (rev 4822) +++ trunk/doc/Change.log 2012-01-20 22:55:59 UTC (rev 4823) @@ -1,5 +1,6 @@ webERP Change Log +20/1/12 Vitaly: Changed $DB_error_no($db) to DB_error_no($db) in Z_ChangeStockCode.php 20/1/12 Vitaly: xhtml fixes in CustomerBranches.php StockAdjustments.php WorkOrderEntry.php 20/1/12 Tim: Merge tendering system from Tim's branch 20/1/12 Tim: Merge xhtml fixes from Tim's branch: Labels.php TaxGroups.php GLCodesInquiry.php CustomerInquiry.php SalesByTypePeriodInquiry.php ContractBOM.php Shippers.php MRPPlannedWorkOrders.php This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <vv...@us...> - 2012-01-20 22:52:52
|
Revision: 4822 http://web-erp.svn.sourceforge.net/web-erp/?rev=4822&view=rev Author: vvs2012 Date: 2012-01-20 22:52:45 +0000 (Fri, 20 Jan 2012) Log Message: ----------- xhtml fixes in CustomerBranches.php StockAdjustments.php WorkOrderEntry.php Modified Paths: -------------- trunk/CustomerBranches.php trunk/StockAdjustments.php trunk/WorkOrderEntry.php trunk/doc/Change.log Property Changed: ---------------- trunk/ Property changes on: trunk ___________________________________________________________________ Added: svn:ignore + reportwriter Modified: trunk/CustomerBranches.php =================================================================== --- trunk/CustomerBranches.php 2012-01-20 13:48:53 UTC (rev 4821) +++ trunk/CustomerBranches.php 2012-01-20 22:52:45 UTC (rev 4822) @@ -360,8 +360,8 @@ $TotalEnable = 0; $TotalDisable = 0; if ($myrow) { - echo '<p Class="page_title_text"><img src="'.$rootpath.'/css/'.$theme.'/images/customer.png" title="' . _('Customer') . - '" alt="" />' . ' ' . _('Branches defined for'). ' '. $DebtorNo . ' - ' . $myrow[0] . '</p>'; + echo '<p Class="page_title_text"><img src="'.$rootpath.'/css/'.$theme.'/images/customer.png" title="' . _('Customer') . '" alt="" /> + ' . ' ' . _('Branches defined for'). ' '. $DebtorNo . ' - ' . $myrow[0] . '</p>'; echo '<table class=selection>'; echo '<tr><th>'._('Code').'</th> @@ -526,11 +526,11 @@ $_POST['DeliverBlind'] = $myrow['deliverblind']; } - echo '<input type=hidden name="SelectedBranch" value="' . $SelectedBranch . '" />'; - echo '<input type=hidden name="BranchCode" value="' . $_POST['BranchCode'] . '" />'; + echo '<input type="hidden" name="SelectedBranch" value="' . $SelectedBranch . '" />'; + echo '<input type="hidden" name="BranchCode" value="' . $_POST['BranchCode'] . '" />'; - echo '<p Class="page_title_text"><img src="'.$rootpath.'/css/'.$theme.'/images/customer.png" title="' . _('Customer') . - '" alt="">' . ' ' . _('Change Details for Branch'). ' '. $SelectedBranch . '</p>'; + echo '<p Class="page_title_text"><img src="'.$rootpath.'/css/'.$theme.'/images/customer.png" title="' . _('Customer') . '" alt="" /> + ' . ' ' . _('Change Details for Branch'). ' '. $SelectedBranch . '</p>'; if (isset($SelectedBranch)) { echo '<div class="centre"><a href=' . htmlspecialchars($_SERVER['PHP_SELF']) . '?DebtorNo=' . $DebtorNo. '>' . _('Show all branches defined for'). ' '. $DebtorNo . '</a></div>'; } @@ -576,11 +576,11 @@ if (!isset($_POST['BranchCode'])) { $_POST['BranchCode']=''; } - echo '<p Class="page_title_text"><img src="'.$rootpath.'/css/'.$theme.'/images/customer.png" title="' . _('Customer') . '" alt="">' . ' ' . _('Add a Branch').'</p>'; + echo '<p Class="page_title_text"><img src="'.$rootpath.'/css/'.$theme.'/images/customer.png" title="' . _('Customer') . '" alt="" />' . ' ' . _('Add a Branch').'</p>'; echo '<table class=selection> <tr> <td>'._('Branch Code'). ':</td> - <td><input ' .(in_array('BranchCode',$Errors) ? 'class="inputerror"' : '' ) . ' tabindex=1 type="text" name="BranchCode" size=12 maxlength=10 value="' . $_POST['BranchCode'] . '"></td> + <td><input ' .(in_array('BranchCode',$Errors) ? 'class="inputerror"' : '' ) . ' tabindex="1" type="text" name="BranchCode" size="12" maxlength="10" value="' . $_POST['BranchCode'] . '" /></td> </tr>'; $_POST['DeliverBlind'] = $_SESSION['DefaultBlindPackNote']; } @@ -592,12 +592,12 @@ echo '<tr> <td>'._('Branch Name').':</td>'; if (!isset($_POST['BrName'])) {$_POST['BrName']='';} - echo '<td><input tabindex=2 type="text" name="BrName" size="41" maxlength="40" value="'. $_POST['BrName'].'"></td> + echo '<td><input tabindex="2" type="text" name="BrName" size="41" maxlength="40" value="'. $_POST['BrName'].'" /></td> </tr>'; echo '<tr> <td>'._('Branch Contact').':</td>'; if (!isset($_POST['ContactName'])) {$_POST['ContactName']='';} - echo '<td><input tabindex=3 type="text" name="ContactName" size="41" maxlength="40" value="'. $_POST['ContactName'].'" /></td> + echo '<td><input tabindex="3" type="text" name="ContactName" size="41" maxlength="40" value="'. $_POST['ContactName'].'" /></td> </tr>'; echo '<tr><td>'._('Street Address 1 (Street)').':</td>'; if (!isset($_POST['BrAddress1'])) { @@ -631,7 +631,7 @@ if (!isset($_POST['BrAddress5'])) { $_POST['BrAddress5']=''; } - echo '<td><input tabindex="8" type="text" name="BrAddress5" size="21" maxlength="20" value="'. $_POST['BrAddress5'].'"/></td> + echo '<td><input tabindex="8" type="text" name="BrAddress5" size="21" maxlength="20" value="'. $_POST['BrAddress5'].'" /></td> </tr> <tr> <td>'._('Street Address 6').':</td>'; @@ -652,14 +652,14 @@ if (!isset($_POST['EstDeliveryDays'])) { $_POST['EstDeliveryDays']=0; } - echo '<td><input ' .(in_array('EstDeliveryDays',$Errors) ? 'class="inputerror"' : '' ) .' tabindex="11" type="text" class=number name="EstDeliveryDays" size="4" maxlength="2" value='. $_POST['EstDeliveryDays'].'></td> + echo '<td><input ' .(in_array('EstDeliveryDays',$Errors) ? 'class="inputerror"' : '' ) .' tabindex="11" type="text" class=number name="EstDeliveryDays" size="4" maxlength="2" value='. $_POST['EstDeliveryDays'].' /></td> </tr> <tr> <td>'._('Forward Date After (day in month)').':</td>'; if (!isset($_POST['FwdDate'])) { $_POST['FwdDate']=0; } - echo '<td><input ' .(in_array('FwdDate',$Errors) ? 'class="inputerror"' : '' ) .' tabindex="12" type="text" class=number name="FwdDate" size="4" maxlength="2" value='. $_POST['FwdDate'].'></td> + echo '<td><input ' .(in_array('FwdDate',$Errors) ? 'class="inputerror"' : '' ) .' tabindex="12" type="text" class=number name="FwdDate" size="4" maxlength="2" value='. $_POST['FwdDate'].' /></td> </tr>'; @@ -805,7 +805,7 @@ </tr> <tr> <td>'._('Transactions on this branch') . ':</td> - <td><select tabindex=20 name="DisableTrans">'; + <td><select tabindex="20" name="DisableTrans">'; if ($_POST['DisableTrans']==0){ echo '<option selected value=0>' . _('Enabled') . '</option> <option value=1>' . _('Disabled') . '</option>'; @@ -828,7 +828,7 @@ } echo '<tr> <td>'._('Default freight/shipper method') . ':</td> - <td><select tabindex=21 name="DefaultShipVia">'; + <td><select tabindex="21" name="DefaultShipVia">'; while ($myrow=DB_fetch_array($ShipperResults)){ if (isset($_POST['DefaultShipVia'])and $myrow['shipper_id']==$_POST['DefaultShipVia']){ echo '<option selected value=' . $myrow['shipper_id'] . '>' . $myrow['shippername'] . '</option>'; Modified: trunk/StockAdjustments.php =================================================================== --- trunk/StockAdjustments.php 2012-01-20 13:48:53 UTC (rev 4821) +++ trunk/StockAdjustments.php 2012-01-20 22:52:45 UTC (rev 4822) @@ -58,13 +58,11 @@ $_SESSION['Adjustment']->Quantity = filter_number_format($_POST['Quantity']); } -echo '<p class="page_title_text"><img src="'.$rootpath.'/css/'.$theme.'/images/supplier.png" title="' . - _('Inventory Adjustment') . '" alt="" />' . ' ' . _('Inventory Adjustment') . '</p>'; +echo '<p class="page_title_text"><img src="'.$rootpath.'/css/'.$theme.'/images/supplier.png" title="' . _('Inventory Adjustment') . '" alt="" />' . ' ' . _('Inventory Adjustment') . '</p>'; if (isset($_POST['CheckCode'])) { - echo '<p class="page_title_text"><img src="'.$rootpath.'/css/'.$theme.'/images/magnifier.png" title="' . _('Dispatch') . - '" alt="" />' . ' ' . _('Select Item to Adjust') . '</p>'; + echo '<p class="page_title_text"><img src="'.$rootpath.'/css/'.$theme.'/images/magnifier.png" title="' . _('Dispatch') . '" alt="" />' . ' ' . _('Select Item to Adjust') . '</p>'; if (mb_strlen($_POST['StockText'])>0) { $sql="SELECT stockid, @@ -352,27 +350,27 @@ $DecimalPlaces = $myrow['decimalplaces']; } echo '<br /><table class=selection>'; -echo '<tr><th colspan=4><font color=blue size=3>'._('Adjustment Details').'</font></th></tr>'; +echo '<tr><th colspan="4"><font color=blue size=3>'._('Adjustment Details').'</font></th></tr>'; if (!isset($_GET['Description'])) { $_GET['Description']=''; } echo '<tr><td>'. _('Stock Code'). ':</td><td>'; if (isset($StockID)) { - echo '<input type="text" name="StockID" size=21 value="' . $StockID . '" maxlength=20></td></tr>'; + echo '<input type="text" name="StockID" size="21" value="' . $StockID . '" maxlength="20" /></td></tr>'; } else { - echo '<input type="text" name="StockID" size=21 value="" maxlength=20></td></tr>'; + echo '<input type="text" name="StockID" size="21" value="" maxlength="20" /></td></tr>'; } echo '<tr> <td>'. _('Partial Description'). ':</td> <td><input type="text" name="StockText" size="21" value="' . $_GET['Description'] .'" /> '._('Partial Stock Code'). ':</td> <td>'; if (isset($StockID)) { - echo '<input type="text" name="StockCode" size=21 value="' . $StockID .'" maxlength="20" />'; + echo '<input type="text" name="StockCode" size="21" value="' . $StockID .'" maxlength="20" />'; } else { - echo '<input type="text" name="StockCode" size=21 value="" maxlength="20" />'; + echo '<input type="text" name="StockCode" size="21" value="" maxlength="20" />'; } echo '</td> - <td><input type="submit" name="CheckCode" value="'._('Check Part').'"></td> + <td><input type="submit" name="CheckCode" value="'._('Check Part').'" /></td> </tr>'; if (isset($_SESSION['Adjustment']) AND mb_strlen($_SESSION['Adjustment']->ItemDescription)>1){ echo '<tr> @@ -453,7 +451,7 @@ echo '</table> <div class="centre"> <br /> - <input type="submit" name="EnterAdjustment" value="'. _('Enter Stock Adjustment'). '"> + <input type="submit" name="EnterAdjustment" value="'. _('Enter Stock Adjustment'). '" /> <br />'; if (!isset($_POST['StockLocation'])) { Modified: trunk/WorkOrderEntry.php =================================================================== --- trunk/WorkOrderEntry.php 2012-01-20 13:48:53 UTC (rev 4821) +++ trunk/WorkOrderEntry.php 2012-01-20 22:52:45 UTC (rev 4822) @@ -8,8 +8,7 @@ include('includes/SQL_CommonFunctions.inc'); echo '<p class="page_title_text"> - <img src="'.$rootpath.'/css/'.$theme.'/images/transactions.png" title="' . _('Search') . - '" alt="" />' . ' ' . $title.' + <img src="'.$rootpath.'/css/'.$theme.'/images/transactions.png" title="' . _('Search') . '" alt="" />' . ' ' . $title.' </p>'; if (isset($_GET['ReqDate'])){ @@ -533,7 +532,7 @@ echo '<td class="number"><input type="hidden" name="RecdQty' . $i . '" value="' . $_POST['RecdQty' .$i] . '" />' . $_POST['RecdQty' .$i] .'</td> <td class="number">' . locale_number_format(($_POST['OutputQty' . $i] - $_POST['RecdQty' .$i]),$_POST['DecimalPlaces' . $i]) . '</td>'; if ($_POST['Controlled'.$i]==1){ - echo '<td><input type="text" name="NextLotSNRef' .$i . '" value="' . $_POST['NextLotSNRef'.$i] . '"></td>'; + echo '<td><input type="text" name="NextLotSNRef' .$i . '" value="' . $_POST['NextLotSNRef'.$i] . '" /></td>'; if ($_SESSION['DefineControlledOnWOEntry']==1){ if ($_POST['Serialised' . $i]==1){ $LotOrSN = _('S/Ns'); @@ -557,16 +556,16 @@ echo '<input type="hidden" name="HasWOSerialNos' . $i .'" value="' . $_POST['HasWOSerialNos' . $i] . '" />'; } } - echo '<input type=hidden name="NumberOfOutputs" value="' . ($i -1).'" />'; + echo '<input type="hidden" name="NumberOfOutputs" value="' . ($i -1).'" />'; } echo '</table>'; echo '<div class="centre"> <br /> - <input type=submit name="submit" value="' . _('Update') . '" /> + <input type="submit" name="submit" value="' . _('Update') . '" /> <br /> <br /> - <input type=submit name="delete" value="' . _('Delete This Work Order') . '" onclick="return confirm(\'' . _('Are You Sure?') . '\');" /> + <input type="submit" name="delete" value="' . _('Delete This Work Order') . '" onclick="return confirm(\'' . _('Are You Sure?') . '\');" /> <br /> </div>'; @@ -600,11 +599,11 @@ </select></td> <td><?php echo _('Enter text extracts in the'); ?> <b><?php echo _('description'); ?></b>:</td> -<td><input type="text" name="Keywords" size=20 maxlength=25 value="<?php if (isset($_POST['Keywords'])) echo $_POST['Keywords']; ?>"></td> +<td><input type="text" name="Keywords" size="20" maxlength="25" value="<?php if (isset($_POST['Keywords'])) echo $_POST['Keywords']; ?>" /></td> </tr> <tr><td></td> - <td><font SIZE 3><b><?php echo _('OR'); ?> </b></font><?php echo _('Enter extract of the'); ?> <b><?php echo _('Stock Code'); ?></b>:</td> - <td><input type="text" name="StockCode" size="15" maxlength="18" value="<?php if (isset($_POST['StockCode'])) echo $_POST['StockCode']; ?>"></td> + <td><b><?php echo _('OR'); ?> </b><?php echo _('Enter extract of the'); ?> <b><?php echo _('Stock Code'); ?></b>:</td> + <td><input type="text" name="StockCode" size="15" maxlength="18" value="<?php if (isset($_POST['StockCode'])) echo $_POST['StockCode']; ?>" /></td> </tr> </table> <br /><div class="centre"><input type="submit" name="Search" value="<?php echo _('Search Now'); ?>" /> @@ -635,10 +634,10 @@ if (!in_array($myrow['stockid'],$ItemCodes)){ if (function_exists('imagecreatefrompng') ){ - $ImageSource = '<img src="GetStockImage.php?automake=1&textcolor=FFFFFF&bgcolor=CCCCCC&StockID=' . urlencode($myrow['stockid']). '&text=&width=64&height=64">'; + $ImageSource = '<img src="GetStockImage.php?automake=1&textcolor=FFFFFF&bgcolor=CCCCCC&StockID=' . urlencode($myrow['stockid']). '&text=&width=64&height=64" />'; } else { if(file_exists($_SERVER['DOCUMENT_ROOT'] . $rootpath . '/' . $_SESSION['part_pics_dir'] . '/' . $myrow['stockid'] . '.jpg')) { - $ImageSource = '<img src="' .$_SERVER['DOCUMENT_ROOT'] . $rootpath . '/' . $_SESSION['part_pics_dir'] . '/' . $myrow['stockid'] . '.jpg">'; + $ImageSource = '<img src="' .$_SERVER['DOCUMENT_ROOT'] . $rootpath . '/' . $_SESSION['part_pics_dir'] . '/' . $myrow['stockid'] . '.jpg" />'; } else { $ImageSource = _('No Image'); } @@ -652,9 +651,9 @@ $k=1; } - printf('<td><font size=1>%s</font></td> - <td><font size=1>%s</font></td> - <td><font size=1>%s</font></td> + printf('<td><font size="1">%s</font></td> + <td><font size="1">%s</font></td> + <td><font size="1">%s</font></td> <td>%s</td> <td><font size=1><a href="%s">' . _('Add to Work Order') . '</a></font></td> Modified: trunk/doc/Change.log =================================================================== --- trunk/doc/Change.log 2012-01-20 13:48:53 UTC (rev 4821) +++ trunk/doc/Change.log 2012-01-20 22:52:45 UTC (rev 4822) @@ -1,5 +1,6 @@ webERP Change Log +20/1/12 Vitaly: xhtml fixes in CustomerBranches.php StockAdjustments.php WorkOrderEntry.php 20/1/12 Tim: Merge tendering system from Tim's branch 20/1/12 Tim: Merge xhtml fixes from Tim's branch: Labels.php TaxGroups.php GLCodesInquiry.php CustomerInquiry.php SalesByTypePeriodInquiry.php ContractBOM.php Shippers.php MRPPlannedWorkOrders.php 20/1/12 Tim: Added previously received quantity to stock transfer notes PDFStockLocTransfer.php This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <vv...@us...> - 2012-01-20 22:52:52
|
Revision: 4822 http://web-erp.svn.sourceforge.net/web-erp/?rev=4822&view=rev Author: vvs2012 Date: 2012-01-20 22:52:45 +0000 (Fri, 20 Jan 2012) Log Message: ----------- xhtml fixes in CustomerBranches.php StockAdjustments.php WorkOrderEntry.php Modified Paths: -------------- trunk/CustomerBranches.php trunk/StockAdjustments.php trunk/WorkOrderEntry.php trunk/doc/Change.log Property Changed: ---------------- trunk/ Property changes on: trunk ___________________________________________________________________ Added: svn:ignore + reportwriter Modified: trunk/CustomerBranches.php =================================================================== --- trunk/CustomerBranches.php 2012-01-20 13:48:53 UTC (rev 4821) +++ trunk/CustomerBranches.php 2012-01-20 22:52:45 UTC (rev 4822) @@ -360,8 +360,8 @@ $TotalEnable = 0; $TotalDisable = 0; if ($myrow) { - echo '<p Class="page_title_text"><img src="'.$rootpath.'/css/'.$theme.'/images/customer.png" title="' . _('Customer') . - '" alt="" />' . ' ' . _('Branches defined for'). ' '. $DebtorNo . ' - ' . $myrow[0] . '</p>'; + echo '<p Class="page_title_text"><img src="'.$rootpath.'/css/'.$theme.'/images/customer.png" title="' . _('Customer') . '" alt="" /> + ' . ' ' . _('Branches defined for'). ' '. $DebtorNo . ' - ' . $myrow[0] . '</p>'; echo '<table class=selection>'; echo '<tr><th>'._('Code').'</th> @@ -526,11 +526,11 @@ $_POST['DeliverBlind'] = $myrow['deliverblind']; } - echo '<input type=hidden name="SelectedBranch" value="' . $SelectedBranch . '" />'; - echo '<input type=hidden name="BranchCode" value="' . $_POST['BranchCode'] . '" />'; + echo '<input type="hidden" name="SelectedBranch" value="' . $SelectedBranch . '" />'; + echo '<input type="hidden" name="BranchCode" value="' . $_POST['BranchCode'] . '" />'; - echo '<p Class="page_title_text"><img src="'.$rootpath.'/css/'.$theme.'/images/customer.png" title="' . _('Customer') . - '" alt="">' . ' ' . _('Change Details for Branch'). ' '. $SelectedBranch . '</p>'; + echo '<p Class="page_title_text"><img src="'.$rootpath.'/css/'.$theme.'/images/customer.png" title="' . _('Customer') . '" alt="" /> + ' . ' ' . _('Change Details for Branch'). ' '. $SelectedBranch . '</p>'; if (isset($SelectedBranch)) { echo '<div class="centre"><a href=' . htmlspecialchars($_SERVER['PHP_SELF']) . '?DebtorNo=' . $DebtorNo. '>' . _('Show all branches defined for'). ' '. $DebtorNo . '</a></div>'; } @@ -576,11 +576,11 @@ if (!isset($_POST['BranchCode'])) { $_POST['BranchCode']=''; } - echo '<p Class="page_title_text"><img src="'.$rootpath.'/css/'.$theme.'/images/customer.png" title="' . _('Customer') . '" alt="">' . ' ' . _('Add a Branch').'</p>'; + echo '<p Class="page_title_text"><img src="'.$rootpath.'/css/'.$theme.'/images/customer.png" title="' . _('Customer') . '" alt="" />' . ' ' . _('Add a Branch').'</p>'; echo '<table class=selection> <tr> <td>'._('Branch Code'). ':</td> - <td><input ' .(in_array('BranchCode',$Errors) ? 'class="inputerror"' : '' ) . ' tabindex=1 type="text" name="BranchCode" size=12 maxlength=10 value="' . $_POST['BranchCode'] . '"></td> + <td><input ' .(in_array('BranchCode',$Errors) ? 'class="inputerror"' : '' ) . ' tabindex="1" type="text" name="BranchCode" size="12" maxlength="10" value="' . $_POST['BranchCode'] . '" /></td> </tr>'; $_POST['DeliverBlind'] = $_SESSION['DefaultBlindPackNote']; } @@ -592,12 +592,12 @@ echo '<tr> <td>'._('Branch Name').':</td>'; if (!isset($_POST['BrName'])) {$_POST['BrName']='';} - echo '<td><input tabindex=2 type="text" name="BrName" size="41" maxlength="40" value="'. $_POST['BrName'].'"></td> + echo '<td><input tabindex="2" type="text" name="BrName" size="41" maxlength="40" value="'. $_POST['BrName'].'" /></td> </tr>'; echo '<tr> <td>'._('Branch Contact').':</td>'; if (!isset($_POST['ContactName'])) {$_POST['ContactName']='';} - echo '<td><input tabindex=3 type="text" name="ContactName" size="41" maxlength="40" value="'. $_POST['ContactName'].'" /></td> + echo '<td><input tabindex="3" type="text" name="ContactName" size="41" maxlength="40" value="'. $_POST['ContactName'].'" /></td> </tr>'; echo '<tr><td>'._('Street Address 1 (Street)').':</td>'; if (!isset($_POST['BrAddress1'])) { @@ -631,7 +631,7 @@ if (!isset($_POST['BrAddress5'])) { $_POST['BrAddress5']=''; } - echo '<td><input tabindex="8" type="text" name="BrAddress5" size="21" maxlength="20" value="'. $_POST['BrAddress5'].'"/></td> + echo '<td><input tabindex="8" type="text" name="BrAddress5" size="21" maxlength="20" value="'. $_POST['BrAddress5'].'" /></td> </tr> <tr> <td>'._('Street Address 6').':</td>'; @@ -652,14 +652,14 @@ if (!isset($_POST['EstDeliveryDays'])) { $_POST['EstDeliveryDays']=0; } - echo '<td><input ' .(in_array('EstDeliveryDays',$Errors) ? 'class="inputerror"' : '' ) .' tabindex="11" type="text" class=number name="EstDeliveryDays" size="4" maxlength="2" value='. $_POST['EstDeliveryDays'].'></td> + echo '<td><input ' .(in_array('EstDeliveryDays',$Errors) ? 'class="inputerror"' : '' ) .' tabindex="11" type="text" class=number name="EstDeliveryDays" size="4" maxlength="2" value='. $_POST['EstDeliveryDays'].' /></td> </tr> <tr> <td>'._('Forward Date After (day in month)').':</td>'; if (!isset($_POST['FwdDate'])) { $_POST['FwdDate']=0; } - echo '<td><input ' .(in_array('FwdDate',$Errors) ? 'class="inputerror"' : '' ) .' tabindex="12" type="text" class=number name="FwdDate" size="4" maxlength="2" value='. $_POST['FwdDate'].'></td> + echo '<td><input ' .(in_array('FwdDate',$Errors) ? 'class="inputerror"' : '' ) .' tabindex="12" type="text" class=number name="FwdDate" size="4" maxlength="2" value='. $_POST['FwdDate'].' /></td> </tr>'; @@ -805,7 +805,7 @@ </tr> <tr> <td>'._('Transactions on this branch') . ':</td> - <td><select tabindex=20 name="DisableTrans">'; + <td><select tabindex="20" name="DisableTrans">'; if ($_POST['DisableTrans']==0){ echo '<option selected value=0>' . _('Enabled') . '</option> <option value=1>' . _('Disabled') . '</option>'; @@ -828,7 +828,7 @@ } echo '<tr> <td>'._('Default freight/shipper method') . ':</td> - <td><select tabindex=21 name="DefaultShipVia">'; + <td><select tabindex="21" name="DefaultShipVia">'; while ($myrow=DB_fetch_array($ShipperResults)){ if (isset($_POST['DefaultShipVia'])and $myrow['shipper_id']==$_POST['DefaultShipVia']){ echo '<option selected value=' . $myrow['shipper_id'] . '>' . $myrow['shippername'] . '</option>'; Modified: trunk/StockAdjustments.php =================================================================== --- trunk/StockAdjustments.php 2012-01-20 13:48:53 UTC (rev 4821) +++ trunk/StockAdjustments.php 2012-01-20 22:52:45 UTC (rev 4822) @@ -58,13 +58,11 @@ $_SESSION['Adjustment']->Quantity = filter_number_format($_POST['Quantity']); } -echo '<p class="page_title_text"><img src="'.$rootpath.'/css/'.$theme.'/images/supplier.png" title="' . - _('Inventory Adjustment') . '" alt="" />' . ' ' . _('Inventory Adjustment') . '</p>'; +echo '<p class="page_title_text"><img src="'.$rootpath.'/css/'.$theme.'/images/supplier.png" title="' . _('Inventory Adjustment') . '" alt="" />' . ' ' . _('Inventory Adjustment') . '</p>'; if (isset($_POST['CheckCode'])) { - echo '<p class="page_title_text"><img src="'.$rootpath.'/css/'.$theme.'/images/magnifier.png" title="' . _('Dispatch') . - '" alt="" />' . ' ' . _('Select Item to Adjust') . '</p>'; + echo '<p class="page_title_text"><img src="'.$rootpath.'/css/'.$theme.'/images/magnifier.png" title="' . _('Dispatch') . '" alt="" />' . ' ' . _('Select Item to Adjust') . '</p>'; if (mb_strlen($_POST['StockText'])>0) { $sql="SELECT stockid, @@ -352,27 +350,27 @@ $DecimalPlaces = $myrow['decimalplaces']; } echo '<br /><table class=selection>'; -echo '<tr><th colspan=4><font color=blue size=3>'._('Adjustment Details').'</font></th></tr>'; +echo '<tr><th colspan="4"><font color=blue size=3>'._('Adjustment Details').'</font></th></tr>'; if (!isset($_GET['Description'])) { $_GET['Description']=''; } echo '<tr><td>'. _('Stock Code'). ':</td><td>'; if (isset($StockID)) { - echo '<input type="text" name="StockID" size=21 value="' . $StockID . '" maxlength=20></td></tr>'; + echo '<input type="text" name="StockID" size="21" value="' . $StockID . '" maxlength="20" /></td></tr>'; } else { - echo '<input type="text" name="StockID" size=21 value="" maxlength=20></td></tr>'; + echo '<input type="text" name="StockID" size="21" value="" maxlength="20" /></td></tr>'; } echo '<tr> <td>'. _('Partial Description'). ':</td> <td><input type="text" name="StockText" size="21" value="' . $_GET['Description'] .'" /> '._('Partial Stock Code'). ':</td> <td>'; if (isset($StockID)) { - echo '<input type="text" name="StockCode" size=21 value="' . $StockID .'" maxlength="20" />'; + echo '<input type="text" name="StockCode" size="21" value="' . $StockID .'" maxlength="20" />'; } else { - echo '<input type="text" name="StockCode" size=21 value="" maxlength="20" />'; + echo '<input type="text" name="StockCode" size="21" value="" maxlength="20" />'; } echo '</td> - <td><input type="submit" name="CheckCode" value="'._('Check Part').'"></td> + <td><input type="submit" name="CheckCode" value="'._('Check Part').'" /></td> </tr>'; if (isset($_SESSION['Adjustment']) AND mb_strlen($_SESSION['Adjustment']->ItemDescription)>1){ echo '<tr> @@ -453,7 +451,7 @@ echo '</table> <div class="centre"> <br /> - <input type="submit" name="EnterAdjustment" value="'. _('Enter Stock Adjustment'). '"> + <input type="submit" name="EnterAdjustment" value="'. _('Enter Stock Adjustment'). '" /> <br />'; if (!isset($_POST['StockLocation'])) { Modified: trunk/WorkOrderEntry.php =================================================================== --- trunk/WorkOrderEntry.php 2012-01-20 13:48:53 UTC (rev 4821) +++ trunk/WorkOrderEntry.php 2012-01-20 22:52:45 UTC (rev 4822) @@ -8,8 +8,7 @@ include('includes/SQL_CommonFunctions.inc'); echo '<p class="page_title_text"> - <img src="'.$rootpath.'/css/'.$theme.'/images/transactions.png" title="' . _('Search') . - '" alt="" />' . ' ' . $title.' + <img src="'.$rootpath.'/css/'.$theme.'/images/transactions.png" title="' . _('Search') . '" alt="" />' . ' ' . $title.' </p>'; if (isset($_GET['ReqDate'])){ @@ -533,7 +532,7 @@ echo '<td class="number"><input type="hidden" name="RecdQty' . $i . '" value="' . $_POST['RecdQty' .$i] . '" />' . $_POST['RecdQty' .$i] .'</td> <td class="number">' . locale_number_format(($_POST['OutputQty' . $i] - $_POST['RecdQty' .$i]),$_POST['DecimalPlaces' . $i]) . '</td>'; if ($_POST['Controlled'.$i]==1){ - echo '<td><input type="text" name="NextLotSNRef' .$i . '" value="' . $_POST['NextLotSNRef'.$i] . '"></td>'; + echo '<td><input type="text" name="NextLotSNRef' .$i . '" value="' . $_POST['NextLotSNRef'.$i] . '" /></td>'; if ($_SESSION['DefineControlledOnWOEntry']==1){ if ($_POST['Serialised' . $i]==1){ $LotOrSN = _('S/Ns'); @@ -557,16 +556,16 @@ echo '<input type="hidden" name="HasWOSerialNos' . $i .'" value="' . $_POST['HasWOSerialNos' . $i] . '" />'; } } - echo '<input type=hidden name="NumberOfOutputs" value="' . ($i -1).'" />'; + echo '<input type="hidden" name="NumberOfOutputs" value="' . ($i -1).'" />'; } echo '</table>'; echo '<div class="centre"> <br /> - <input type=submit name="submit" value="' . _('Update') . '" /> + <input type="submit" name="submit" value="' . _('Update') . '" /> <br /> <br /> - <input type=submit name="delete" value="' . _('Delete This Work Order') . '" onclick="return confirm(\'' . _('Are You Sure?') . '\');" /> + <input type="submit" name="delete" value="' . _('Delete This Work Order') . '" onclick="return confirm(\'' . _('Are You Sure?') . '\');" /> <br /> </div>'; @@ -600,11 +599,11 @@ </select></td> <td><?php echo _('Enter text extracts in the'); ?> <b><?php echo _('description'); ?></b>:</td> -<td><input type="text" name="Keywords" size=20 maxlength=25 value="<?php if (isset($_POST['Keywords'])) echo $_POST['Keywords']; ?>"></td> +<td><input type="text" name="Keywords" size="20" maxlength="25" value="<?php if (isset($_POST['Keywords'])) echo $_POST['Keywords']; ?>" /></td> </tr> <tr><td></td> - <td><font SIZE 3><b><?php echo _('OR'); ?> </b></font><?php echo _('Enter extract of the'); ?> <b><?php echo _('Stock Code'); ?></b>:</td> - <td><input type="text" name="StockCode" size="15" maxlength="18" value="<?php if (isset($_POST['StockCode'])) echo $_POST['StockCode']; ?>"></td> + <td><b><?php echo _('OR'); ?> </b><?php echo _('Enter extract of the'); ?> <b><?php echo _('Stock Code'); ?></b>:</td> + <td><input type="text" name="StockCode" size="15" maxlength="18" value="<?php if (isset($_POST['StockCode'])) echo $_POST['StockCode']; ?>" /></td> </tr> </table> <br /><div class="centre"><input type="submit" name="Search" value="<?php echo _('Search Now'); ?>" /> @@ -635,10 +634,10 @@ if (!in_array($myrow['stockid'],$ItemCodes)){ if (function_exists('imagecreatefrompng') ){ - $ImageSource = '<img src="GetStockImage.php?automake=1&textcolor=FFFFFF&bgcolor=CCCCCC&StockID=' . urlencode($myrow['stockid']). '&text=&width=64&height=64">'; + $ImageSource = '<img src="GetStockImage.php?automake=1&textcolor=FFFFFF&bgcolor=CCCCCC&StockID=' . urlencode($myrow['stockid']). '&text=&width=64&height=64" />'; } else { if(file_exists($_SERVER['DOCUMENT_ROOT'] . $rootpath . '/' . $_SESSION['part_pics_dir'] . '/' . $myrow['stockid'] . '.jpg')) { - $ImageSource = '<img src="' .$_SERVER['DOCUMENT_ROOT'] . $rootpath . '/' . $_SESSION['part_pics_dir'] . '/' . $myrow['stockid'] . '.jpg">'; + $ImageSource = '<img src="' .$_SERVER['DOCUMENT_ROOT'] . $rootpath . '/' . $_SESSION['part_pics_dir'] . '/' . $myrow['stockid'] . '.jpg" />'; } else { $ImageSource = _('No Image'); } @@ -652,9 +651,9 @@ $k=1; } - printf('<td><font size=1>%s</font></td> - <td><font size=1>%s</font></td> - <td><font size=1>%s</font></td> + printf('<td><font size="1">%s</font></td> + <td><font size="1">%s</font></td> + <td><font size="1">%s</font></td> <td>%s</td> <td><font size=1><a href="%s">' . _('Add to Work Order') . '</a></font></td> Modified: trunk/doc/Change.log =================================================================== --- trunk/doc/Change.log 2012-01-20 13:48:53 UTC (rev 4821) +++ trunk/doc/Change.log 2012-01-20 22:52:45 UTC (rev 4822) @@ -1,5 +1,6 @@ webERP Change Log +20/1/12 Vitaly: xhtml fixes in CustomerBranches.php StockAdjustments.php WorkOrderEntry.php 20/1/12 Tim: Merge tendering system from Tim's branch 20/1/12 Tim: Merge xhtml fixes from Tim's branch: Labels.php TaxGroups.php GLCodesInquiry.php CustomerInquiry.php SalesByTypePeriodInquiry.php ContractBOM.php Shippers.php MRPPlannedWorkOrders.php 20/1/12 Tim: Added previously received quantity to stock transfer notes PDFStockLocTransfer.php This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <tim...@us...> - 2012-01-20 13:49:05
|
Revision: 4821 http://web-erp.svn.sourceforge.net/web-erp/?rev=4821&view=rev Author: tim_schofield Date: 2012-01-20 13:48:53 +0000 (Fri, 20 Jan 2012) Log Message: ----------- Merge Tims branch into trunk: Add tendering facility Modified Paths: -------------- trunk/SupplierTenders.php trunk/UpgradeDatabase.php trunk/WWW_Users.php trunk/doc/Change.log trunk/includes/ConnectDB.inc trunk/includes/DefineOfferClass.php trunk/includes/UserLogin.php trunk/index.php trunk/sql/mysql/upgrade4.05-4.06.sql Added Paths: ----------- trunk/SupplierTenderCreate.php trunk/includes/DefineTenderClass.php Added: trunk/SupplierTenderCreate.php =================================================================== --- trunk/SupplierTenderCreate.php (rev 0) +++ trunk/SupplierTenderCreate.php 2012-01-20 13:48:53 UTC (rev 4821) @@ -0,0 +1,809 @@ +<?php +/* $Id$*/ + +include('includes/DefineTenderClass.php'); +include('includes/SQL_CommonFunctions.inc'); +include('includes/session.inc'); + +$Maximum_Number_Of_Parts_To_Show=50; + +if (isset($_GET['New']) and isset($_SESSION['tender'])) { + unset($_SESSION['tender']); +} + +if (isset($_GET['New']) and $_SESSION['CanCreateTender']==0) { + $title = _('Authorisation Problem'); + include('includes/header.inc'); + echo '<p class="page_title_text"><img src="'.$rootpath.'/css/'.$theme.'/images/supplier.png" title="' . $title . '" alt="" /> '.$title . '</p>'; + prnMsg( _('You do not have authority to create supplier tenders for this company.') . '<br />' . + _('Please see your system administrator'), 'warn'); + include('includes/footer.inc'); + exit; +} + +if (isset($_GET['Edit']) and $_SESSION['CanCreateTender']==0) { + $title = _('Authorisation Problem'); + include('includes/header.inc'); + echo '<p class="page_title_text"><img src="'.$rootpath.'/css/'.$theme.'/images/supplier.png" title="' . $title . '" alt="" /> '.$title . '</p>'; + prnMsg( _('You do not have authority to amend supplier tenders for this company.') . '<br />' . + _('Please see your system administrator'), 'warn'); + include('includes/footer.inc'); + exit; +} + +$ShowTender = 0; + +if (isset($_GET['ID'])) { + $sql="SELECT tenderid, + location, + address1, + address2, + address3, + address4, + address5, + address6, + telephone + FROM tenders + WHERE tenderid='" . $_GET['ID'] . "'"; + $result=DB_query($sql, $db); + $myrow=DB_fetch_array($result); + if (isset($_SESSION['tender'])) { + unset($_SESSION['tender']); + } + $_SESSION['tender'] = new Tender(); + $_SESSION['tender']->TenderId = $myrow['tenderid']; + $_SESSION['tender']->Location = $myrow['location']; + $_SESSION['tender']->DelAdd1 = $myrow['address1']; + $_SESSION['tender']->DelAdd2 = $myrow['address2']; + $_SESSION['tender']->DelAdd3 = $myrow['address3']; + $_SESSION['tender']->DelAdd4 = $myrow['address4']; + $_SESSION['tender']->DelAdd5 = $myrow['address5']; + $_SESSION['tender']->DelAdd6 = $myrow['address6']; + + $sql="SELECT tenderid, + tendersuppliers.supplierid, + suppliers.suppname, + tendersuppliers.email + FROM tendersuppliers + LEFT JOIN suppliers + ON tendersuppliers.supplierid=suppliers.supplierid + WHERE tenderid='" . $_GET['ID'] . "'"; + $result=DB_query($sql, $db); + while ($myrow=DB_fetch_array($result)) { + $_SESSION['tender']->add_supplier_to_tender( + $myrow['supplierid'], + $myrow['suppname'], + $myrow['email']); + } + + $sql="SELECT tenderid, + tenderitems.stockid, + tenderitems.quantity, + stockmaster.description, + tenderitems.units, + stockmaster.decimalplaces + FROM tenderitems + LEFT JOIN stockmaster + ON tenderitems.stockid=stockmaster.stockid + WHERE tenderid='" . $_GET['ID'] . "'"; + $result=DB_query($sql, $db); + while ($myrow=DB_fetch_array($result)) { + $_SESSION['tender']->add_item_to_tender( + $_SESSION['tender']->LinesOnTender, + $myrow['stockid'], + $myrow['quantity'], + $myrow['description'], + $myrow['units'], + $myrow['decimalplaces'], + DateAdd(date($_SESSION['DefaultDateFormat']),'m',3)); + } + $ShowTender = 1; +} + +if (isset($_GET['Edit'])) { + $title = _('Edit an Existing Supplier Tender Request'); + include('includes/header.inc'); + echo '<p class="page_title_text"><img src="'.$rootpath.'/css/'.$theme.'/images/supplier.png" title="' . _('Purchase Order Tendering') . '" alt="" /> '.$title . '</p>'; + $sql="SELECT tenderid, + location, + address1, + address2, + address3, + address4, + address5, + address6, + telephone + FROM tenders + WHERE closed=0"; + $result=DB_query($sql, $db); + echo '<table class="selection">'; + echo '<tr><th>' . _('Tender ID') . '</th>'; + echo '<th>' . _('Location') . '</th>'; + echo '<th>' . _('Address 1') . '</th>'; + echo '<th>' . _('Address 2') . '</th>'; + echo '<th>' . _('Address 3') . '</th>'; + echo '<th>' . _('Address 4') . '</th>'; + echo '<th>' . _('Address 5') . '</th>'; + echo '<th>' . _('Address 6') . '</th>'; + echo '<th>' . _('Telephone') . '</th></tr>'; + while ($myrow=DB_fetch_array($result)) { + echo '<tr><td>' . $myrow['tenderid'] . '</td>'; + echo '<td>' . $myrow['location'] . '</td>'; + echo '<td>' . $myrow['address1'] . '</td>'; + echo '<td>' . $myrow['address2'] . '</td>'; + echo '<td>' . $myrow['address3'] . '</td>'; + echo '<td>' . $myrow['address4'] . '</td>'; + echo '<td>' . $myrow['address5'] . '</td>'; + echo '<td>' . $myrow['address6'] . '</td>'; + echo '<td>' . $myrow['telephone'] . '</td>'; + echo '<td><a href="'.$_SERVER['PHP_SELF'] . '?ID='.$myrow['tenderid'].'">'. _('Edit') .'</a></td>'; + } + echo '</table>'; + include('includes/footer.inc'); + exit; +} else if (isset($_GET['ID']) or (isset($_SESSION['tender']->TenderId))) { + $title = _('Edit an Existing Supplier Tender Request'); + include('includes/header.inc'); + echo '<p class="page_title_text"><img src="'.$rootpath.'/css/'.$theme.'/images/supplier.png" title="' . _('Purchase Order Tendering') . '" alt="" /> '.$title . '</p>'; +} else { + $title = _('Create a New Supplier Tender Request'); + include('includes/header.inc'); + echo '<p class="page_title_text"><img src="'.$rootpath.'/css/'.$theme.'/images/supplier.png" title="' . _('Purchase Order Tendering') . '" alt="" /> '.$title . '</p>'; +} + +if (isset($_POST['Save'])) { + $_SESSION['tender']->RequiredByDate=$_POST['RequiredByDate']; + $_SESSION['tender']->save($db); + $_SESSION['tender']->EmailSuppliers(); + prnMsg( _('The tender has been successfully saved'), 'success'); + include('includes/footer.inc'); + exit; +} + +if (isset($_GET['DeleteSupplier'])) { + $_SESSION['tender']->remove_supplier_from_tender($_GET['DeleteSupplier']); + $ShowTender = 1; +} + +if (isset($_GET['DeleteItem'])) { + $_SESSION['tender']->remove_item_from_tender($_GET['DeleteItem']); + $ShowTender = 1; +} + +if (isset($_POST['SelectedSupplier'])) { + $sql = "SELECT suppname, + email + FROM suppliers + WHERE supplierid='" . $_POST['SelectedSupplier'] . "'"; + $result = DB_query($sql, $db); + $myrow = DB_fetch_array($result); + if (mb_strlen($myrow['email'])>0) { + $_SESSION['tender']->add_supplier_to_tender( + $_POST['SelectedSupplier'], + $myrow['suppname'], + $myrow['email']); + } else { + prnMsg( _('The supplier must have an email set up or they cannot be part of a tender'), 'warn'); + } + $ShowTender = 1; +} + +if (isset($_POST['NewItem']) and !isset($_POST['Refresh'])) { + foreach ($_POST as $key => $value) { + if (mb_substr($key,0,7)=='StockID') { + $Index = mb_substr($key,7,mb_strlen($key)-7); + $StockID = $value; + $Quantity = filter_number_format($_POST['Qty'.$Index]); + $UOM = $_POST['UOM'.$Index]; + $sql="SELECT description, decimalplaces FROM stockmaster WHERE stockid='".$StockID."'"; + $result=DB_query($sql, $db); + $myrow=DB_fetch_array($result); + $_SESSION['tender']->add_item_to_tender( + $_SESSION['tender']->LinesOnTender, + $StockID, + $Quantity, + $myrow['description'], + $UOM, + $myrow['decimalplaces'], + DateAdd(date($_SESSION['DefaultDateFormat']),'m',3)); + unset($UOM); + } + } + $ShowTender = 1; +} + +if (!isset($_SESSION['tender']) or isset($_POST['LookupDeliveryAddress']) or $ShowTender==1) { + /* Show Tender header screen */ + if (!isset($_SESSION['tender'])) { + $_SESSION['tender']=new Tender(); + } + echo '<form name="form1" action="' . $_SERVER['PHP_SELF'] . '" method="post">'; + echo '<input type="hidden" name="FormID" value="' . $_SESSION['FormID'] . '" />'; + echo '<table class="selection">'; + echo '<tr><th colspan="4"><font size="3" color="#616161">' . _('Tender header details') . '</font></th></tr>'; + echo '<tr><td>' . _('Delivery Must Be Made Before') . '</td>'; + echo '<td><input type="text" class="date" alt="' .$_SESSION['DefaultDateFormat'] . '" name="RequiredByDate" size="11" value="' . date($_SESSION['DefaultDateFormat']) . '" /></td></tr>'; + + if (!isset($_POST['StkLocation']) OR $_POST['StkLocation']==''){ + /* If this is the first time + * the form loaded set up defaults */ + + $_POST['StkLocation'] = $_SESSION['UserStockLocation']; + + $sql = "SELECT deladd1, + deladd2, + deladd3, + deladd4, + deladd5, + deladd6, + tel, + contact + FROM locations + WHERE loccode='" . $_POST['StkLocation'] . "'"; + + $LocnAddrResult = DB_query($sql,$db); + if (DB_num_rows($LocnAddrResult)==1){ + $LocnRow = DB_fetch_array($LocnAddrResult); + $_POST['DelAdd1'] = $LocnRow['deladd1']; + $_POST['DelAdd2'] = $LocnRow['deladd2']; + $_POST['DelAdd3'] = $LocnRow['deladd3']; + $_POST['DelAdd4'] = $LocnRow['deladd4']; + $_POST['DelAdd5'] = $LocnRow['deladd5']; + $_POST['DelAdd6'] = $LocnRow['deladd6']; + $_POST['Tel'] = $LocnRow['tel']; + $_POST['Contact'] = $LocnRow['contact']; + + $_SESSION['tender']->Location= $_POST['StkLocation']; + $_SESSION['tender']->DelAdd1 = $_POST['DelAdd1']; + $_SESSION['tender']->DelAdd2 = $_POST['DelAdd2']; + $_SESSION['tender']->DelAdd3 = $_POST['DelAdd3']; + $_SESSION['tender']->DelAdd4 = $_POST['DelAdd4']; + $_SESSION['tender']->DelAdd5 = $_POST['DelAdd5']; + $_SESSION['tender']->DelAdd6 = $_POST['DelAdd6']; + $_SESSION['tender']->Telephone = $_POST['Tel']; + $_SESSION['tender']->Contact = $_POST['Contact']; + + } else { + /*The default location of the user is crook */ + prnMsg(_('The default stock location set up for this user is not a currently defined stock location') . + '. ' . _('Your system administrator needs to amend your user record'),'error'); + } + + + } elseif (isset($_POST['LookupDeliveryAddress'])){ + + $sql = "SELECT deladd1, + deladd2, + deladd3, + deladd4, + deladd5, + deladd6, + tel, + contact + FROM locations + WHERE loccode='" . $_POST['StkLocation'] . "'"; + + $LocnAddrResult = DB_query($sql,$db); + if (DB_num_rows($LocnAddrResult)==1){ + $LocnRow = DB_fetch_array($LocnAddrResult); + $_POST['DelAdd1'] = $LocnRow['deladd1']; + $_POST['DelAdd2'] = $LocnRow['deladd2']; + $_POST['DelAdd3'] = $LocnRow['deladd3']; + $_POST['DelAdd4'] = $LocnRow['deladd4']; + $_POST['DelAdd5'] = $LocnRow['deladd5']; + $_POST['DelAdd6'] = $LocnRow['deladd6']; + $_POST['Tel'] = $LocnRow['tel']; + $_POST['Contact'] = $LocnRow['contact']; + + $_SESSION['tender']->Location= $_POST['StkLocation']; + $_SESSION['tender']->DelAdd1 = $_POST['DelAdd1']; + $_SESSION['tender']->DelAdd2 = $_POST['DelAdd2']; + $_SESSION['tender']->DelAdd3 = $_POST['DelAdd3']; + $_SESSION['tender']->DelAdd4 = $_POST['DelAdd4']; + $_SESSION['tender']->DelAdd5 = $_POST['DelAdd5']; + $_SESSION['tender']->DelAdd6 = $_POST['DelAdd6']; + $_SESSION['tender']->Telephone = $_POST['Tel']; + $_SESSION['tender']->Contact = $_POST['Contact']; + } + } + echo '<tr><td>' . _('Warehouse') . ':</td> + <td><select name=StkLocation onChange="ReloadForm(form1.LookupDeliveryAddress)">'; + + $sql = "SELECT loccode, + locationname + FROM locations"; + $LocnResult = DB_query($sql,$db); + + while ($LocnRow=DB_fetch_array($LocnResult)){ + if ((isset($_SESSION['tender']->Location) and $_SESSION['tender']->Location == $LocnRow['loccode'])){ + echo '<option selected="True" value="' . $LocnRow['loccode'] . '">' . $LocnRow['locationname'] . '</option>'; + } else { + echo '<option value="' . $LocnRow['loccode'] . '">' . $LocnRow['locationname'] . '</option>'; + } + } + + echo '</select> + <input type="submit" name="LookupDeliveryAddress" value="' ._('Select') . '" /></td> + </tr>'; + + /* Display the details of the delivery location + */ + echo '<tr><td>' . _('Delivery Contact') . ':</td> + <td><input type="text" name="Contact" size="41" value="' . $_SESSION['tender']->Contact . '" /></td> + </tr>'; + echo '<tr><td>' . _('Address') . ' 1 :</td> + <td><input type="text" name="DelAdd1" size="41" maxlength="40" value="' . $_POST['DelAdd1'] . '" /></td> + </tr>'; + echo '<tr><td>' . _('Address') . ' 2 :</td> + <td><input type="text" name="DelAdd2" size="41" maxlength="40" value="' . $_POST['DelAdd2'] . '" /></td> + </tr>'; + echo '<tr><td>' . _('Address') . ' 3 :</td> + <td><input type="text" name="DelAdd3" size="41" maxlength="40" value="' . $_POST['DelAdd3'] . '" /></td> + </tr>'; + echo '<tr><td>' . _('Address') . ' 4 :</td> + <td><input type="text" name="DelAdd4" size="21" maxlength="20" value="' . $_POST['DelAdd4'] . '" /></td> + </tr>'; + echo '<tr><td>' . _('Address') . ' 5 :</td> + <td><input type="text" name="DelAdd5" size="16" maxlength="15" value="' . $_POST['DelAdd5'] . '" /></td> + </tr>'; + echo '<tr><td>' . _('Address') . ' 6 :</td> + <td><input type="text" name="DelAdd6" size="16" maxlength="15" value="' . $_POST['DelAdd6'] . '" /></td> + </tr>'; + echo '<tr><td>' . _('Phone') . ':</td> + <td><input type="text" name="Tel" size="31" maxlength="30" value="' . $_SESSION['tender']->Telephone . '" /></td> + </tr>'; + echo '</table><br />'; + + /* Display the supplier/item details + */ + echo '<table>'; + + /* Supplier Details + */ + echo '<tr><td valign="top"><table class="selection">'; + echo '<tr><th colspan="4"><font size="3" color="#616161">' . _('Suppliers To Send Tender') . '</font></th></tr>'; + echo '<tr><th>'. _('Supplier Code') . '</th><th>' ._('Supplier Name') . '</th><th>' ._('Email Address') . '</th></tr>'; + foreach ($_SESSION['tender']->Suppliers as $Supplier) { + echo '<tr><td>' . $Supplier->SupplierCode . '</td>'; + echo '<td>' . $Supplier->SupplierName . '</td>'; + echo '<td>' . $Supplier->EmailAddress . '</td>'; + echo '<td><a href="' . $_SERVER['PHP_SELF'] . '?DeleteSupplier=' . $Supplier->SupplierCode . '">' . _('Delete') . '</a></td></tr>'; + } + echo '</table></td>'; + /* Item Details + */ + echo '<td valign="top"><table class="selection">'; + echo '<tr><th colspan="6"><font size="3" color="#616161">' . _('Items in Tender') . '</font></th></tr>'; + echo '<tr>'; + echo '<th>'._('Stock ID').'</th>'; + echo '<th>'._('Description').'</th>'; + echo '<th>'._('Quantity').'</th>'; + echo '<th>'._('UOM').'</th>'; + echo '</tr>'; + $k=0; + foreach ($_SESSION['tender']->LineItems as $LineItems) { + if ($LineItems->Deleted==False) { + if ($k==1){ + echo '<tr class="EvenTableRows">'; + $k=0; + } else { + echo '<tr class="OddTableRows">'; + $k=1; + } + echo '<td>'.$LineItems->StockID.'</td>'; + echo '<td>'.$LineItems->ItemDescription.'</td>'; + echo '<td class="number">' . locale_number_format($LineItems->Quantity,$LineItems->DecimalPlaces).'</td>'; + echo '<td>'.$LineItems->Units.'</td>'; + echo '<td><a href="' . $_SERVER['PHP_SELF'] . '?DeleteItem=' . $LineItems->LineNo . '">' . _('Delete') . '</a></td></tr>'; + echo '</tr>'; + } + } + echo '</table></td></tr></table><br />'; + + echo '<div class="centre"><input type="submit" name="Suppliers" value="' . _('Select Suppliers') . '" />'; + echo '<input type="submit" name="Items" value="' . _('Select Item Details') . '" /></div><br />'; + if ($_SESSION['tender']->LinesOnTender > 0 and $_SESSION['tender']->SuppliersOnTender > 0) { + echo '<div class="centre"><input type="submit" name="Save" value="' . _('Save Tender') . '" /></div>'; + } + echo '</form>'; + include('includes/footer.inc'); + exit; +} + +if (isset($_POST['SearchSupplier']) OR isset($_POST['Go']) OR isset($_POST['Next']) OR isset($_POST['Previous'])) { + if (mb_strlen($_POST['Keywords']) > 0 AND mb_strlen($_POST['SupplierCode']) > 0) { + prnMsg( '<br />' . _('Supplier name keywords have been used in preference to the Supplier code extract entered'), 'info' ); + } + if ($_POST['Keywords'] == '' AND $_POST['SupplierCode'] == '') { + $SQL = "SELECT supplierid, + suppname, + currcode, + address1, + address2, + address3, + address4 + FROM suppliers + ORDER BY suppname"; + } else { + if (mb_strlen($_POST['Keywords']) > 0) { + $_POST['Keywords'] = mb_strtoupper($_POST['Keywords']); + //insert wildcard characters in spaces + $SearchString = '%' . str_replace(' ', '%', $_POST['Keywords']) . '%'; + $SQL = "SELECT supplierid, + suppname, + currcode, + address1, + address2, + address3, + address4 + FROM suppliers + WHERE suppname " . LIKE . " '$SearchString' + ORDER BY suppname"; + } elseif (mb_strlen($_POST['SupplierCode']) > 0) { + $_POST['SupplierCode'] = mb_strtoupper($_POST['SupplierCode']); + $SQL = "SELECT supplierid, + suppname, + currcode, + address1, + address2, + address3, + address4 + FROM suppliers + WHERE supplierid " . LIKE . " '%" . $_POST['SupplierCode'] . "%' + ORDER BY supplierid"; + } + } //one of keywords or SupplierCode was more than a zero length string + $result = DB_query($SQL, $db); + if (DB_num_rows($result) == 1) { + $myrow = DB_fetch_row($result); + $SingleSupplierReturned = $myrow[0]; + } +} //end of if search +if (isset($SingleSupplierReturned)) { /*there was only one supplier returned */ + $_SESSION['SupplierID'] = $SingleSupplierReturned; + unset($_POST['Keywords']); + unset($_POST['SupplierCode']); +} + +if (!isset($_POST['PageOffset'])) { + $_POST['PageOffset'] = 1; +} else { + if ($_POST['PageOffset'] == 0) { + $_POST['PageOffset'] = 1; + } +} + +if (isset($_POST['Suppliers'])) { + echo '<form action="' . $_SERVER['PHP_SELF'] . '" method="post">'; + echo '<input type="hidden" name="FormID" value="' . $_SESSION['FormID'] . '" />'; + echo '<p class="page_title_text"><img src="' . $rootpath . '/css/' . $theme . '/images/magnifier.png" title="' . _('Search') . '" alt="" />' . ' ' . _('Search for Suppliers') . '</p> + <table cellpadding="3" colspan="4" class="selection"><tr><td>' . _('Enter a partial Name') . ':</td><td>'; + if (isset($_POST['Keywords'])) { + echo '<input type="text" name="Keywords" value="' . $_POST['Keywords'] . '" size="20" maxlength="25" />'; + } else { + echo '<input type="text" name="Keywords" size="20" maxlength="25" />'; + } + echo '</td><td><b>' . _('OR') . '</b></font></td><td>' . _('Enter a partial Code') . ':</font></td><td>'; + if (isset($_POST['SupplierCode'])) { + echo '<input type="text" name="SupplierCode" value="' . $_POST['SupplierCode'] . '" size="15" maxlength="18" />'; + } else { + echo '<input type="text" name="SupplierCode" size="15" maxlength="18" />'; + } + echo '</td></tr></table><br /><div class="centre"><input type="submit" name="SearchSupplier" value="' . _('Search Now') . '" /></div>'; + echo '</form>'; +} + +if (isset($_POST['SearchSupplier'])) { + echo '<form action="' . $_SERVER['PHP_SELF'] . '" method="post">'; + echo '<input type="hidden" name="FormID" value="' . $_SESSION['FormID'] . '" />'; + $ListCount = DB_num_rows($result); + $ListPageMax = ceil($ListCount / $_SESSION['DisplayRecordsMax']); + if (isset($_POST['Next'])) { + if ($_POST['PageOffset'] < $ListPageMax) { + $_POST['PageOffset'] = $_POST['PageOffset'] + 1; + } + } + if (isset($_POST['Previous'])) { + if ($_POST['PageOffset'] > 1) { + $_POST['PageOffset'] = $_POST['PageOffset'] - 1; + } + } + if ($ListPageMax > 1) { + echo '<br /> ' . $_POST['PageOffset'] . ' ' . _('of') . ' ' . $ListPageMax . ' ' . _('pages') . '. ' . _('Go to Page') . ': '; + echo '<select name="PageOffset">'; + $ListPage = 1; + while ($ListPage <= $ListPageMax) { + if ($ListPage == $_POST['PageOffset']) { + echo '<option value=' . $ListPage . ' selected>' . $ListPage . '</option>'; + } else { + echo '<option value=' . $ListPage . '>' . $ListPage . '</option>'; + } + $ListPage++; + } + echo '</select> + <input type="submit" name="Go" value="' . _('Go') . '" /> + <input type="submit" name="Previous" value="' . _('Previous') . '" /> + <input type="submit" name="Next" value="' . _('Next') . '" />'; + echo '<br />'; + } + echo '<input type="hidden" name="Search" value="' . _('Search Now') . '" />'; + echo '<br /><br />'; + echo '<br /><table cellpadding="2" colspan="7">'; + $tableheader = '<tr> + <th>' . _('Code') . '</th> + <th>' . _('Supplier Name') . '</th> + <th>' . _('Currency') . '</th> + <th>' . _('Address 1') . '</th> + <th>' . _('Address 2') . '</th> + <th>' . _('Address 3') . '</th> + <th>' . _('Address 4') . '</th> + </tr>'; + echo $tableheader; + $j = 1; + $k = 0; //row counter to determine background colour + $RowIndex = 0; + if (DB_num_rows($result) <> 0) { + DB_data_seek($result, ($_POST['PageOffset'] - 1) * $_SESSION['DisplayRecordsMax']); + } + while (($myrow = DB_fetch_array($result)) AND ($RowIndex <> $_SESSION['DisplayRecordsMax'])) { + if ($k == 1) { + echo '<tr class="EvenTableRows">'; + $k = 0; + } else { + echo '<tr class="OddTableRows">'; + $k = 1; + } + echo '<td><input type="submit" name="SelectedSupplier" value="'.$myrow['supplierid'].'" /></td> + <td>'.$myrow['suppname'].'</td> + <td>'.$myrow['currcode'].'</td> + <td>'.$myrow['address1'].'</td> + <td>'.$myrow['address2'].'</td> + <td>'.$myrow['address3'].'</td> + <td>'.$myrow['address4'].'</td> + </tr>'; + $RowIndex = $RowIndex + 1; + //end of page full new headings if + } + //end of while loop + echo '</table>'; +} + +/*The supplier has chosen option 2 + */ +if (isset($_POST['Items'])) { + echo '<form action="' . $_SERVER['PHP_SELF'] . '" method="post">'; + echo '<input type="hidden" name="FormID" value="' . $_SESSION['FormID'] . '" />'; + echo '<p class="page_title_text"><img src="' . $rootpath . '/css/' . $theme . '/images/magnifier.png" title="' . _('Search') . '" alt="" />' . ' ' . _('Search for Inventory Items') . '</p>'; + $sql = "SELECT categoryid, + categorydescription + FROM stockcategory + ORDER BY categorydescription"; + $result = DB_query($sql, $db); + if (DB_num_rows($result) == 0) { + echo '<br /><font size="4" color="red">' . _('Problem Report') . ':</font><br />' . + _('There are no stock categories currently defined please use the link below to set them up'); + echo '<br /><a href="' . $rootpath . '/StockCategories.php">' . _('Define Stock Categories') . '</a>'; + exit; + } + echo '<table class="selection"><tr>'; + echo '<td>' . _('In Stock Category') . ':'; + echo '<select name="StockCat">'; + if (!isset($_POST['StockCat'])) { + $_POST['StockCat'] = ""; + } + if ($_POST['StockCat'] == 'All') { + echo '<option selected="True" value="All">' . _('All') . '</option>'; + } else { + echo '<option value="All">' . _('All') . '</option>'; + } + while ($myrow1 = DB_fetch_array($result)) { + if ($myrow1['categoryid'] == $_POST['StockCat']) { + echo '<option selected="True" value="' . $myrow1['categoryid'] . '">' . $myrow1['categorydescription'] . '</option>'; + } else { + echo '<option value="' . $myrow1['categoryid'] . '">' . $myrow1['categorydescription'] . '</option>'; + } + } + echo '</select>'; + echo '<td>' . _('Enter partial') . '<b> ' . _('Description') . '</b>:</td><td>'; + if (isset($_POST['Keywords'])) { + echo '<input type="text" name="Keywords" value="' . $_POST['Keywords'] . '" size="20" maxlength="25" />'; + } else { + echo '<input type="text" name="Keywords" size="20" maxlength="25" />'; + } + echo '</td></tr><tr><td></td>'; + echo '<td><font size="3"><b>' . _('OR') . ' ' . '</b></font>' . _('Enter partial') . ' <b>' . _('Stock Code') . '</b>:</td>'; + echo '<td>'; + if (isset($_POST['StockCode'])) { + echo '<input type="text" name="StockCode" value="' . $_POST['StockCode'] . '" size="15" maxlength="18" />'; + } else { + echo '<input type="text" name="StockCode" size="15" maxlength="18" />'; + } + echo '</td></tr></table><br />'; + echo '<div class="centre"><input type="submit" name="Search" value="' . _('Search Now') . '" /></div><br /></form>'; + echo '<script type="text/javascript">defaultControl(document.forms[0].StockCode);</script>'; + echo '</form>'; +} + +if (isset($_POST['Search'])){ /*ie seach for stock items */ + echo '<form method="post" action="' . $_SERVER['PHP_SELF'] .'">'; + echo '<input type="hidden" name="FormID" value="' . $_SESSION['FormID'] . '" />'; + echo '<p class="page_title_text"><img src="' . $rootpath . '/css/' . $theme . '/images/supplier.png" title="' . _('Tenders') . '" alt="" />' . ' ' . _('Select items required on this tender').'</p>'; + + if ($_POST['Keywords'] AND $_POST['StockCode']) { + prnMsg( _('Stock description keywords have been used in preference to the Stock code extract entered'), 'info' ); + } + if ($_POST['Keywords']) { + //insert wildcard characters in spaces + $SearchString = '%' . str_replace(' ', '%', $_POST['Keywords']) . '%'; + + if ($_POST['StockCat']=='All'){ + $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!='A' + AND stockmaster.mbflag!='K' + and stockmaster.discontinued!=1 + AND stockmaster.description " . LIKE . " '$SearchString' + ORDER BY stockmaster.stockid"; + } 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!='A' + AND stockmaster.mbflag!='K' + and stockmaster.discontinued!=1 + AND stockmaster.description " . LIKE . " '$SearchString' + AND stockmaster.categoryid='" . $_POST['StockCat'] . "' + ORDER BY stockmaster.stockid"; + } + + } elseif ($_POST['StockCode']){ + + $_POST['StockCode'] = '%' . $_POST['StockCode'] . '%'; + + if ($_POST['StockCat']=='All'){ + $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!='A' + AND stockmaster.mbflag!='K' + and stockmaster.discontinued!=1 + AND stockmaster.stockid " . LIKE . " '" . $_POST['StockCode'] . "' + ORDER BY stockmaster.stockid"; + } 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!='A' + AND stockmaster.mbflag!='K' + and stockmaster.discontinued!=1 + AND stockmaster.stockid " . LIKE . " '" . $_POST['StockCode'] . "' + AND stockmaster.categoryid='" . $_POST['StockCat'] . "' + ORDER BY stockmaster.stockid"; + } + + } else { + if ($_POST['StockCat']=='All'){ + $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!='A' + AND stockmaster.mbflag!='K' + and stockmaster.discontinued!=1 + ORDER BY stockmaster.stockid"; + } 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!='A' + AND stockmaster.mbflag!='K' + and stockmaster.discontinued!=1 + AND stockmaster.categoryid='" . $_POST['StockCat'] . "' + ORDER BY stockmaster.stockid"; + } + } + + $ErrMsg = _('There is a problem selecting the part records to display because'); + $DbgMsg = _('The SQL statement that failed was'); + $SearchResult = DB_query($sql,$db,$ErrMsg,$DbgMsg); + + if (DB_num_rows($SearchResult)==0 and $debug==1){ + prnMsg( _('There are no products to display matching the criteria provided'),'warn'); + } + if (DB_num_rows($SearchResult)==1){ + + $myrow=DB_fetch_array($SearchResult); + $_GET['NewItem'] = $myrow['stockid']; + DB_data_seek($SearchResult,0); + } + + if (isset($SearchResult)) { + + echo '<table cellpadding="1" colspan="7">'; + + $tableheader = '<tr> + <th>' . _('Code') . '</th> + <th>' . _('Description') . '</th> + <th>' . _('Units') . '</th> + <th>' . _('Image') . '</th> + <th>' . _('Quantity') . '</th> + </tr>'; + echo $tableheader; + + $i = 0; + $k = 0; //row colour counter + $PartsDisplayed=0; + while ($myrow=DB_fetch_array($SearchResult)) { + + if ($k==1){ + echo '<tr class="EvenTableRows">'; + $k=0; + } else { + echo '<tr class="OddTableRows">'; + $k=1; + } + + $filename = $myrow['stockid'] . '.jpg'; + if (file_exists( $_SESSION['part_pics_dir'] . '/' . $filename) ) { + + $ImageSource = '<img src="'.$rootpath . '/' . $_SESSION['part_pics_dir'] . '/' . $myrow['stockid'] . '.jpg" width="50" height="50" />'; + + } else { + $ImageSource = '<i>'._('No Image').'</i>'; + } + + $uom=$myrow['units']; + + echo '<td>'.$myrow['stockid'].'</td> + <td>'.$myrow['description'].'</td> + <td>'.$uom.'</td> + <td>'.$ImageSource.'</td> + <td><input class="number" type="text" size="6" value="0" name="Qty'.$i.'" /></td> + <input type="hidden" value="'.$uom.'" name="UOM'.$i.'" /> + <input type="hidden" value="'.$myrow['stockid'].'" name="StockID'.$i.'" /> + </tr>'; + + $PartsDisplayed++; + if ($PartsDisplayed == $Maximum_Number_Of_Parts_To_Show){ + break; + } + $i++; +#end of page full new headings if + } +#end of while loop + echo '</table>'; + if ($PartsDisplayed == $Maximum_Number_Of_Parts_To_Show){ + + /*$Maximum_Number_Of_Parts_To_Show defined in config.php */ + + prnMsg( _('Only the first') . ' ' . $Maximum_Number_Of_Parts_To_Show . ' ' . _('can be displayed') . '. ' . + _('Please restrict your search to only the parts required'),'info'); + } + echo '<a name="end"></a><br /><div class="centre"><input type="submit" name="NewItem" value="Add to Tender" /></div>'; + }#end if SearchResults to show + + echo '</form>'; + +} //end of if search + +include('includes/footer.inc'); + +?> \ No newline at end of file Modified: trunk/SupplierTenders.php =================================================================== --- trunk/SupplierTenders.php 2012-01-20 08:19:32 UTC (rev 4820) +++ trunk/SupplierTenders.php 2012-01-20 13:48:53 UTC (rev 4821) @@ -8,6 +8,10 @@ $Maximum_Number_Of_Parts_To_Show=50; +if (isset($_GET['TenderType'])) { + $_POST['TenderType']=$_GET['TenderType']; +} + if (!isset($_POST['SupplierID'])) { $sql="SELECT supplierid FROM www_users WHERE userid='" . $_SESSION['UserID'] . "'"; $result=DB_query($sql, $db); @@ -27,12 +31,110 @@ $_SESSION['offer']->remove_from_offer($_GET['Delete']); } -$sql="SELECT suppname, currcode FROM suppliers WHERE supplierid='" . $_POST['SupplierID'] . "'"; +$sql="SELECT suppname, + currcode + FROM suppliers + WHERE supplierid='".$_POST['SupplierID']."'"; $result=DB_query($sql, $db); $myrow=DB_fetch_array($result); $Supplier=$myrow['suppname']; $Currency=$myrow['currcode']; +if (isset($_POST['Confirm'])) { + $_SESSION['offer']->Save($db); + $_SESSION['offer']->EmailOffer(); + $sql="UPDATE tendersuppliers + SET responded=1 + WHERE supplierid='" . $_SESSION['offer']->SupplierID . "' + AND tenderid='" . $_SESSION['offer']->TenderID . "'"; + $result=DB_query($sql, $db); +} + +if (isset($_POST['Process'])) { + if (isset($_SESSION['offer'])) { + unset($_SESSION['offer']); + } + $_SESSION['offer']=new Offer($_POST['SupplierID']); + $_SESSION['offer']->TenderID=$_POST['Tender']; + $_SESSION['offer']->CurrCode=$Currency; + $LineNo=0; + foreach ($_POST as $key=>$value) { + if (mb_substr($key,0,7)=='StockID') { + $Index = mb_substr($key,7,mb_strlen($key)-7); + $ItemCode=$value; + $Quantity=$_POST['Qty'.$Index]; + $Price=$_POST['Price'.$Index]; + $_SESSION['offer']->add_to_offer( + $LineNo, + $ItemCode, + $Quantity, + $_POST['ItemDescription'.$Index], + $Price, + $_POST['UOM'.$Index], + $_POST['DecimalPlaces'.$Index], + $_POST['RequiredByDate'.$Index]); + $LineNo++; + } + } + echo '<p class="page_title_text"><img src="' . $rootpath . '/css/' . $theme . '/images/supplier.png" title="' . _('Tenders') . '" alt="" />' . ' ' . _('Confirm the Response For Tender') . ' ' . $_SESSION['offer']->TenderID .'</p>'; + echo '<form action="' . htmlspecialchars($_SERVER['PHP_SELF']) . '" method="post">'; + echo '<input type="hidden" name="FormID" value="' . $_SESSION['FormID'] . '" />'; + echo '<table class="selection">'; + echo '<input type="hidden" name="TenderType" value="3" />'; + $LocationSQL="SELECT tenderid, + locations.locationname, + address1, + address2, + address3, + address4, + address5, + address6, + telephone + FROM tenders + LEFT JOIN locations + ON tenders.location=locations.loccode + WHERE closed=0 + AND tenderid='".$_SESSION['offer']->TenderID."'"; + $LocationResult=DB_query($LocationSQL, $db); + $MyLocationRow=DB_fetch_row($LocationResult); + $CurrencySQL="SELECT decimalplaces from currencies WHERE currabrev='".$_SESSION['offer']->CurrCode."'"; + $CurrencyResult=DB_query($CurrencySQL, $db); + $CurrencyRow=DB_fetch_array($CurrencyResult); + echo '<tr><td valign="top" style="background-color:#cccce5">' . _('Deliver To') . ':</td><td valign="top" style="background-color:#cccce5">'; + for ($i=1; $i<8; $i++) { + if ($MyLocationRow[$i]!='') { + echo $MyLocationRow[$i] . '<br />'; + } + } + echo '</td>'; + echo '<th colspan="8" style="vertical-align:top"><font size="2" color="#616161">' . _('Tender Number') . ': ' .$_SESSION['offer']->TenderID . '</font></th>'; + echo '<input type="hidden" value="' . $_SESSION['offer']->TenderID . '" name="Tender" />'; + echo '<tr><th>' . stripslashes($_SESSION['CompanyRecord']['coyname']) . '<br />' . _('Item Code') . '</th>'; + echo '<th>' . _('Item Description') . '</th>'; + echo '<th>' . _('Quantity') . '<br />' . _('Offered') . '</th>'; + echo '<th>' . $Supplier . '<br />' . _('Units of Measure') . '</th>'; + echo '<th>' . _('Currency') . '</th>'; + echo '<th>' . $Supplier . '<br />' . _('Price') . '</th>'; + echo '<th>' . _('Line Value') . '</th>'; + echo '<th>' . _('Delivery By') . '</th>'; + foreach ($_SESSION['offer']->LineItems as $LineItem) { + echo '<tr><td>' . $LineItem->StockID . '</td>'; + echo '<td>' . $LineItem->ItemDescription . '</td>'; + echo '<td class="number"> ' .locale_number_format($LineItem->Quantity, $LineItem->DecimalPlaces) . '</td>'; + echo '<td>' . $LineItem->Units . '</td>'; + echo '<td>' . $_SESSION['offer']->CurrCode . '</td>'; + echo '<td class="number">' . locale_number_format($LineItem->Price, $CurrencyRow['decimalplaces']) . '</td>'; + echo '<td class="number">' . locale_number_format($LineItem->Price*$LineItem->Quantity,$CurrencyRow['decimalplaces']) . '</td>'; + echo '<td>' . $LineItem->ExpiryDate . '</td>'; + } + echo '</table><br />'; + echo '<div class="centre"><input type="submit" name="Confirm" value="' . _('Confirm and Send Email') . '" /><br />'; + echo '<br /><input type="submit" name="Cancel" value="' . _('Cancel Offer') . '" /></div>'; + echo '</form>'; + include('includes/footer.inc'); + exit; +} + /* If the supplierID is set then it must be a login from the supplier but if nothing else is * set then the supplier must have just logged in so show them the choices. */ @@ -42,66 +144,57 @@ } echo '<form method="post" action="' . htmlspecialchars($_SERVER['PHP_SELF']) . '">'; echo '<input type="hidden" name="FormID" value="' . $_SESSION['FormID'] . '" />'; - echo '<p class="page_title_text"><img src="' . $rootpath . '/css/' . $theme . '/images/supplier.png" title="' . - _('Tenders') . '" alt="" />' . ' ' . _('Create or View Offers from') . ' '.$Supplier.'</p>'; + echo '<p class="page_title_text"><img src="' . $rootpath . '/css/' . $theme . '/images/supplier.png" title="' . _('Tenders') . '" alt="" />' . ' ' . _('Create or View Offers from') . ' '.$Supplier.'</p>'; echo '<table class="selection">'; echo'<tr><td>'._('Select option for tendering').'</td>'; - echo '<td><select name=TenderType>'; - echo '<option value=1>'._('View or Amend outstanding offers from').' '.$Supplier .'</option>'; - echo '<option value=2>'._('Create a new offer from').' '.$Supplier .'</option>'; -// echo '<option value=3>'._('View any open tenders without an offer from').' '.$Supplier .'</option>'; + echo '<td><select name="TenderType">'; + echo '<option value="1">'._('View or Amend outstanding offers from').' '.$Supplier .'</option>'; + echo '<option value="2">'._('Create a new offer from').' '.$Supplier .'</option>'; + echo '<option value="3">'._('View any open tenders without an offer from').' '.$Supplier .'</option>'; echo '</select></td></tr>'; - echo '<input type="hidden" name="SupplierID" value="'.$_POST['SupplierID'].'"'; - echo '<tr><td colspan="2"><div class="centre"><input type="submit" name="submit" value="' . _('Select') . '"></div></td></tr>'; - echo '</table> - </form>'; + echo '<input type="hidden" name="SupplierID" value="'.$_POST['SupplierID'].'" />'; + echo '<tr><td colspan="2"><div class="centre"><input type="submit" name="submit" value="' . _('Select') . '" /></div></td></tr>'; + echo '</table></form>'; } if (isset($_POST['NewItem']) and !isset($_POST['Refresh'])) { foreach ($_POST as $key => $value) { - if (mb_substr($key,0,3)=='qty') { - $StockID=mb_substr($key,3); - $Quantity=$value; + if (mb_substr($key,0,7)=='StockID') { + $Index = mb_substr($key,7,mb_strlen($key)-7); + $StockID=$value; + $Quantity=filter_number_format($_POST['Qty'.$Index]); + $Price=filter_number_format($_POST['Price'.$Index]); + $UOM=$_POST['uom'.$Index]; + if (isset($UOM) and $Quantity>0) { + $sql="SELECT description, decimalplaces FROM stockmaster WHERE stockid='".$StockID."'"; + $result=DB_query($sql, $db); + $myrow=DB_fetch_array($result); + $_SESSION['offer']->add_to_offer($_SESSION['offer']->LinesOnOffer, + $StockID, + $Quantity, + $myrow['description'], + $Price, + $UOM, + $myrow['decimalplaces'], + DateAdd(date($_SESSION['DefaultDateFormat']),'m',3)); + unset($UOM); + } } - if (mb_substr($key,0,5)=='price') { - $Price=$value; - } - if (mb_substr($key,0,3)=='uom') { - $UOM=$value; - } - if (isset($UOM)) { - $sql="SELECT description, decimalplaces FROM stockmaster WHERE stockid='" . $StockID."'"; - $result=DB_query($sql, $db); - $myrow=DB_fetch_array($result); - $_SESSION['offer']->add_to_offer( - $_SESSION['offer']->LinesOnOffer, - $StockID, - $Quantity, - $myrow['description'], - $Price, - $UOM, - $myrow['decimalplaces'], - DateAdd(date($_SESSION['DefaultDateFormat']),'m',3)); - unset($UOM); - } } } if (isset($_POST['Refresh']) and !isset($_POST['NewItem'])) { foreach ($_POST as $key => $value) { - if (mb_substr($key,0,3)=='qty') { - $LineNo=mb_substr($key,3); - $Quantity=$value; + if (mb_substr($key,0,7)=='StockID') { + $Index = mb_substr($key,7,mb_strlen($key)-7); + $StockID=$value; + $Quantity=filter_number_format($_POST['Qty'.$Index]); + $Price=filter_number_format($_POST['Price'.$Index]); + $ExpiryDate=$_POST['expirydate'.$Index]; } - if (mb_substr($key,0,5)=='price') { - $Price=$value; - } - if (mb_substr($key,0,10)=='expirydate') { - $ExpiryDate=$value; - } if (isset($ExpiryDate)) { $_SESSION['offer']->update_offer_item( - $LineNo, + $Index, $Quantity, $Price, $ExpiryDate); @@ -111,7 +204,6 @@ } if (isset($_POST['Update'])) { - $MailText=''; foreach ($_POST as $key => $value) { if (mb_substr($key,0,3)=='qty') { $LineNo=mb_substr($key,3); @@ -132,31 +224,14 @@ unset($ExpiryDate); } } - foreach ($_SESSION['offer']->LineItems as $LineItems) { - $sql="UPDATE offers SET - quantity='".$LineItems->Quantity."', - price='".$LineItems->Price."', - expirydate='".FormatDateForSQL($LineItems->ExpiryDate)."' - WHERE offerid='".$LineItems->LineNo . "'"; - $ErrMsg = _('The suppliers offer could not be updated on the database because'); - $DbgMsg = _('The SQL statement used to update the suppliers offer record and failed was'); - $result = DB_query($sql,$db,$ErrMsg,$DbgMsg,true); - if (DB_error_no($db)==0) { - prnMsg( _('The offer for').' '.$LineItems->StockID.' '._('has been updated in the database'), 'success'); - $MailText .= $LineItems->Quantity.$LineItems->Units.' '._('of').' '.$LineItems->StockID.' '._('at a price of'). - ' '.$Currency.$LineItems->Price."\n"; - } else { - prnMsg( _('The offer for').' '.$LineItems->StockID.' '._('could not be updated in the database'), 'error'); - include('includes/footer.inc'); - exit; - } - } + $_SESSION['offer']->Save($db, 'Yes'); + $_SESSION['offer']->EmailOffer(); + unset($_SESSION['offer']); include('includes/footer.inc'); exit; } if (isset($_POST['Save'])) { - $MailText=''; foreach ($_POST as $key => $value) { if (mb_substr($key,0,3)=='qty') { $LineNo=mb_substr($key,3); @@ -177,46 +252,9 @@ unset($ExpiryDate); } } - foreach ($_SESSION['offer']->LineItems as $LineItems) { - if ($LineItems->Deleted==False) { - $sql="INSERT INTO offers ( - supplierid, - stockid, - quantity, - uom, - price, - expirydate, - currcode) - VALUES ( - '".$_POST['SupplierID']."', - '".$LineItems->StockID."', - '".$LineItems->Quantity."', - '".$LineItems->Units."', - '".$LineItems->Price."', - '".FormatDateForSQL($LineItems->ExpiryDate)."', - '".$Currency."' - )"; - $ErrMsg = _('The suppliers offer could not be inserted into the database because'); - $DbgMsg = _('The SQL statement used to insert the suppliers offer record and failed was'); - $result = DB_query($sql,$db,$ErrMsg,$DbgMsg,true); - if (DB_error_no($db)==0) { - prnMsg( _('The offer for').' '.$LineItems->StockID.' '._('has been inserted into the database'), 'success'); - $MailText .= $LineItems->Quantity.$LineItems->Units.' '._('of').' '.$LineItems->StockID.' '._('at a price of'). - ' '.$Currency.$LineItems->Price."\n"; - } else { - prnMsg( _('The offer for').' '.$LineItems->StockID.' '._('could not be inserted into the database'), 'error'); - include('includes/footer.inc'); - exit; - } - } - } - include ('includes/htmlMimeMail.php'); - $mail = new htmlMimeMail(); - $mail->setSubject(_('Offer received from').' '.$Supplier); - $mail->setText(_('This email is automatically generated by webERP')."\n" . - _('You have received the following offer from').' '.$Supplier."\n\n".$MailText); - $mail->setFrom($_SESSION['CompanyRecord']['coyname'] . ' <' . $_SESSION['CompanyRecord']['email'] . '>'); - $result = $mail->send(array($_SESSION['PurchasingManagerEmail']), 'smtp'); + $_SESSION['offer']->Save($db); + $_SESSION['offer']->EmailOffer(); + unset($_SESSION['offer']); include('includes/footer.inc'); exit; } @@ -234,11 +272,10 @@ stockmaster.decimalplaces FROM offers INNER JOIN stockmaster - ON offers.stockid=stockmaster.stockid - WHERE offers.supplierid='" . $_POST['SupplierID']."'"; + ON offers.stockid=stockmaster.stockid + WHERE offers.supplierid='" . $_POST['SupplierID'] . "'"; $result=DB_query($sql, $db); - $_SESSION['offer']=new Offer(); - $_SESSION['offer']->SupplierID=$_POST['SupplierID']; + $_SESSION['offer']=new Offer($_POST['SupplierID']); $_SESSION['offer']->CurrCode=$Currency; while ($myrow=DB_fetch_array($result)) { $_SESSION['offer']->add_to_offer( @@ -253,11 +290,10 @@ } } -if (isset($_SESSION['offer']) and $_SESSION['offer']->LinesOnOffer>0 or isset($_POST['Update'])) { +if (isset($_POST['TenderType']) and $_POST['TenderType']!=3 and isset($_SESSION['offer']) and $_SESSION['offer']->LinesOnOffer>0 or isset($_POST['Update'])) { echo '<form method="post" action="' . htmlspecialchars($_SERVER['PHP_SELF']) . '">'; echo '<input type="hidden" name="FormID" value="' . $_SESSION['FormID'] . '" />'; - echo '<p class="page_title_text"><img src="' . $rootpath . '/css/' . $theme . '/images/supplier.png" title="' . - _('Search') . '" alt="" />' . ' ' . _('Items to offer from').' '.$Supplier .'</p>'; + echo '<p class="page_title_text"><img src="' . $rootpath . '/css/' . $theme . '/images/supplier.png" title="' . _('Search') . '" alt="" />' . ' ' . _('Items to offer from').' '.$Supplier .'</p>'; echo '<table>'; echo '<tr> <th>'._('Stock ID').'</th> @@ -279,27 +315,28 @@ $k=1; } if ($LineItems->ExpiryDate < date('Y-m-d')) { - echo '<tr bgcolor=#F7A9A9>'; + echo '<tr bgcolor="#F7A9A9">'; } + echo '<input type="hidden" name="StockID'.$LineItems->LineNo.'" value="'.$LineItems->StockID.'" />'; echo '<td>'.$LineItems->StockID.'</td>'; echo '<td>'.$LineItems->ItemDescription.'</td>'; - echo '<td><input type="text" class=number name="qty'.$LineItems->LineNo.'" value='.locale_number_format($LineItems->Quantity,$LineItems->DecimalPlaces).'></td>'; + echo '<td><input type="text" class="number" name="Qty'.$LineItems->LineNo.'" value="'.locale_number_format($LineItems->Quantity,$LineItems->DecimalPlaces).'" /></td>'; echo '<td>'.$LineItems->Units.'</td>'; - echo '<td><input type="text" class=number name="price'.$LineItems->LineNo.'" value='.locale_number_format($LineItems->Price,2,'.','').'></td>'; - echo '<td class=number>'.locale_number_format($LineItems->Price*$LineItems->Quantity,2).'</td>'; - echo '<td><input type="text" size=11 class=date alt='.$_SESSION['DefaultDateFormat'].' name="expirydate'.$LineItems->LineNo.'" value='.$LineItems->ExpiryDate.'></td>'; + echo '<td><input type="text" class="number" name="Price'.$LineItems->LineNo.'" value="'.locale_number_format($LineItems->Price,2,'.','').'" /></td>'; + echo '<td class="number">'.locale_number_format($LineItems->Price*$LineItems->Quantity,2).'</td>'; + echo '<td><input type="text" size="11" class="date" alt="'.$_SESSION['DefaultDateFormat'].'" name="expirydate'.$LineItems->LineNo.'" value="'.$LineItems->ExpiryDate.'" /></td>'; echo '<td><a href="' . htmlspecialchars($_SERVER['PHP_SELF']) . '?Delete=' . $LineItems->LineNo . '&Type=' . $_POST['TenderType'] . '">' . _('Remove') . '</a></td></tr>'; echo '</tr>'; } } echo '</table>'; - echo '<input type=hidden name=TenderType value="'.$_POST['TenderType'].'">'; + echo '<input type="hidden" name="TenderType" value="'.$_POST['TenderType'].'" />'; if ($_POST['TenderType']==1) { - echo '<br /><div class="centre"><input type="submit" name="Update" value="Update offer">'; - echo '<input type="submit" name="Refresh" value="Refresh screen"></div>'; + echo '<br /><div class="centre"><input type="submit" name="Update" value="Update offer" />'; + echo '<input type="submit" name="Refresh" value="Refresh screen" /></div>'; } else if ($_POST['TenderType']==2) { echo '<br /><div class="centre"><input type="submit" name="Save" value="Save offer">'; - echo '<input type="submit" name="Refresh" value="Refresh screen"></div>'; + echo '<input type="submit" name="Refresh" value="Refresh screen" /></div>'; } echo '</form>'; } @@ -308,74 +345,175 @@ */ if (isset($_POST['TenderType']) and $_POST['TenderType']==2 and !isset($_POST['Search']) or isset($_GET['Delete'])) { if (!isset($_SESSION['offer'])) { - $_SESSION['offer']=new Offer(); - $_SESSION['offer']->SupplierID=$_POST['SupplierID']; + $_SESSION['offer']=new Offer($_POST['SupplierID']); } echo '<form action="' . htmlspecialchars($_SERVER['PHP_SELF']) . '" method="post">'; echo '<input type="hidden" name="FormID" value="' . $_SESSION['FormID'] . '" />'; - echo '<p class="page_title_text"><img src="' . $rootpath . '/css/' . $theme . '/images/magnifier.png" title="' . - _('Search') . '" alt="" />' . ' ' . _('Search for Inventory Items') . '</p>'; - - $sql = 'SELECT categoryid, + echo '<p class="page_title_text"><img src="' . $rootpath . '/css/' . $theme . '/images/magnifier.png" title="' . _('Search') . '" alt="" />' . ' ' . _('Search for Inventory Items') . '</p>'; + + $sql = "SELECT categoryid, categorydescription FROM stockcategory - ORDER BY categorydescription'; + ORDER BY categorydescription"; $result = DB_query($sql, $db); - + if (DB_num_rows($result) == 0) { - echo '<p><font size=4 color=red>' . _('Problem Report') . ':</font><br />' . + echo '<p><font size="4" color="red">' . _('Problem Report') . ':</font><br />' . _('There are no stock categories currently defined please use the link below to set them up'); - echo '<br /><a href="' . $rootpath . '/StockCategories.php">' . _('Define Stock Categories') . '</a>'; + echo '<br /><a href="' . $rootpath . '/StockCategories.php">' . _('Define Stock Categories') . '</a></p>'; exit; } - echo '<table class=selection><tr>'; + echo '<table class="selection"><tr>'; echo '<td>' . _('In Stock Category') . ':'; echo '<select name="StockCat">'; if (!isset($_POST['StockCat'])) { $_POST['StockCat'] = ''; } if ($_POST['StockCat'] == 'All') { - echo '<option selected value="All">' . _('All'); + echo '<option selected="True" value="All">' . _('All') . '</option>'; } else { - echo '<option value="All">' . _('All'); + echo '<option value="All">' . _('All') . '</option>'; } while ($myrow1 = DB_fetch_array($result)) { if ($myrow1['categoryid'] == $_POST['StockCat']) { - echo '<option selected VALUE="' . $myrow1['categoryid'] . '">' . $myrow1['categorydescription']; + echo '<option selected="True" value="' . $myrow1['categoryid'] . '">' . $myrow1['categorydescription'] . '</option>'; } else { - echo '<option value="' . $myrow1['categoryid'] . '">' . $myrow1['categorydescription']; + echo '<option value="' . $myrow1['categoryid'] . '">' . $myrow1['categorydescription'] . '</option>'; } } echo '</select>'; echo '<td>' . _('Enter partial') . '<b> ' . _('Description') . '</b>:</td><td>'; if (isset($_POST['Keywords'])) { - echo '<input type="text" name="Keywords" value="' . $_POST['Keywords'] . '" size="20" maxlength="25">'; + echo '<input type="text" name="Keywords" value="' . $_POST['Keywords'] . '" size="20" maxlength="25" />'; } else { - echo '<input type="text" name="Keywords" size="20" maxlength="25">'; + echo '<input type="text" name="Keywords" size="20" maxlength="25" />'; } - echo '<input type="hidden" name="TenderType" value='.$_POST['TenderType'].'>'; - echo '<input type="hidden" name="SupplierID" value='.$_POST['SupplierID'].'>'; + echo '<input type="hidden" name="TenderType" value="'.$_POST['TenderType'].'" />'; + echo '<input type="hidden" name="SupplierID" value="'.$_POST['SupplierID'].'" />'; echo '</td></tr><tr><td></td>'; - echo '<td><font size 3><b>' . _('OR') . ' ' . '</b></font>' . _('Enter partial') . ' <b>' . _('Stock Code') . '</b>:</td>'; + echo '<td><font size="3"><b>' . _('OR') . ' ' . '</b></font>' . _('Enter partial') . ' <b>' . _('Stock Code') . '</b>:</td>'; echo '<td>'; if (isset($_POST['StockCode'])) { - echo '<input type="text" name="StockCode" value="' . $_POST['StockCode'] . '" size="15" maxlength="18">'; + echo '<input type="text" name="StockCode" value="' . $_POST['StockCode'] . '" size="15" maxlength="18" />'; } else { - echo '<input type="text" name="StockCode" size="15" maxlength="18">'; + echo '<input type="text" name="StockCode" size="15" maxlength="18" />'; } echo '</td></tr></table><br />'; - echo '<div class="centre"><input type=submit name="Search" value="' . _('Search Now') . '"></div><br /></form>'; + echo '<div class="centre"><input type="submit" name="Search" value="' . _('Search Now') . '" /></div><br /></form>'; echo '<script type="text/javascript">defaultControl(document.forms[0].StockCode);</script>'; echo '</form>'; } +/*The supplier has chosen option 3 + */ +if (isset($_POST['TenderType']) and $_POST['TenderType']==3 and !isset($_POST['Search']) or isset($_GET['Delete'])) { + echo '<p class="page_title_text"><img src="' . $rootpath . '/css/' . $theme . '/images/supplier.png" title="' . _('Tenders') . '" alt="" />' . ' ' . _('Tenders Waiting For Offers').'</p>'; + $sql="SELECT DISTINCT tendersuppliers.tenderid, + suppliers.currcode + FROM tendersuppliers + LEFT JOIN suppliers + ON suppliers.supplierid=tendersuppliers.supplierid + LEFT JOIN tenders + ON tenders.tenderid=tendersuppliers.tenderid + WHERE tendersuppliers.supplierid='" . $_POST['SupplierID'] . "' + AND tenders.closed=0 + AND tendersuppliers.responded=0 + ORDER BY tendersuppliers.tenderid"; + $result=DB_query($sql, $db); + echo '<table class="selection">'; + echo '<tr><th colspan="13"><font size="3" color="#616161">' . _('Outstanding Tenders Waiting For Offer') . '</font></th></tr>'; + while ($myrow=DB_fetch_row($result)) { + echo '<form action="' . $_SERVER['PHP_SELF'] . '" method="post">'; + echo '<input type="hidden" name="FormID" value="' . $_SESSION['FormID'] . '" />'; + echo '<input type="hidden" name="TenderType" value="3" />'; + $LocationSQL="SELECT tenderid, + locations.locationname, + address1, + address2, + address3, + address4, + address5, + address6, + telephone + FROM tenders + LEFT JOIN locations + ON tenders.location=locations.loccode + WHERE closed=0 + AND tenderid='".$myrow[0]."'"; + $LocationResult=DB_query($LocationSQL, $db); + $MyLocationRow=DB_fetch_row($LocationResult); + echo '<tr><td valign="top" style="background-color:#cccce5">' . _('Deliver To') . ':</td><td valign="top" style="background-color:#cccce5">'; + for ($i=1; $i<8; $i++) { + if ($MyLocationRow[$i]!='') { + echo $MyLocationRow[$i] . '<br />'; + } + } + echo '</td>'; + echo '<th colspan="8" style="vertical-align:top"><font size="2" color="#616161">' . _('Tender Number') . ': ' .$myrow[0] . '</font></th>'; + echo '<input type="hidden" value="' . $myrow[0] . '" name="Tender" />'; + echo '<th><input type="submit" value="' . _('Process') . "\n" . _('Tender') . '" name="Process" /></th></tr>'; + $ItemSQL="SELECT tenderitems.tenderid, + tenderitems.stockid, + stockmaster.description, + stockmaster.decimalplaces, + purchdata.suppliers_partno, + tenderitems.quantity, + tenderitems.units, + tenders.requiredbydate, + purchdata.suppliersuom + FROM tenderitems + LEFT JOIN stockmaster + ON tenderitems.stockid=stockmaster.stockid + LEFT JOIN purchdata + ON tenderitems.stockid=purchdata.stockid + AND purchdata.supplierno='".$_POST['SupplierID']."' + LEFT JOIN tenders + ON tenders.tenderid=tenderitems.tenderid + WHERE tenderitems.tenderid='" . $myrow[0] . "'"; + $ItemResult=DB_query($ItemSQL, $db); + echo '<tr><th>' . stripslashes($_SESSION['CompanyRecord']['coyname']) . '<br />' . _('Item Code') . '</th>'; + echo '<th>' . _('Item Description') . '</th>'; + echo '<th>' . $Supplier . '<br />' . _('Item Code') . '</th>'; + echo '<th>' . _('Quantity') . '<br />' . _('Required') . '</th>'; + echo '<th>' . stripslashes($_SESSION['CompanyRecord']['coyname']) . '<br />' . _('Units of Measure') . '</th>'; + echo '<th>' . _('Required By') . '</th>'; + echo '<th>' . _('Quantity') . '<br />' . _('Offered') . '</th>'; + echo '<th>' . $Supplier . '<br />' . _('Units of Measure') . '</th>'; + echo '<th>' . _('Currency') . '</th>'; + echo '<th>' . $Supplier . '<br />' . _('Price') . '</th>'; + echo '<th>' . _('Delivery By') . '</th>'; + $i=0; + while ($MyItemRow=DB_fetch_array($ItemResult)) { + echo '<tr><td>' . $MyItemRow['stockid'] . '</td>'; + echo '<td>' . $MyItemRow['description'] . '</td>'; + echo '<input type="hidden" name="StockID'. $i . '" value="' . $MyItemRow['stockid'] . '" />'; + echo '<input type="hidden" name="ItemDescription'. $i . '" value="' . $MyItemRow['description'] . '" />'; + echo '<td>' . $MyItemRow['suppliers_partno'] . '</td>'; + echo '<td class="number">' . locale_number_format($MyItemRow['quantity'], $MyItemRow['decimalplaces']) . '</td>'; + echo '<td>' . $MyItemRow['units'] . '</td>'; + echo '<td>' . ConvertSQLDate($MyItemRow['requiredbydate']) . '</td>'; + if ($MyItemRow['suppliersuom']=='') { + $MyItemRow['suppliersuom']=$MyItemRow['units']; + } + echo '<td><input type="text" class="number" size="10" name="Qty'. $i . '" value="' . locale_number_format($MyItemRow['quantity'], $MyItemRow['decimalplaces']) . '" /></td>'; + echo '<input type="hidden" name="UOM'. $i . '" value="' . $MyItemRow['units'] . '" />'; + echo '<input type="hidden" name="DecimalPlaces'. $i . '" value="' . $MyItemRow['decimalplaces'] . '" />'; + echo '<td>' . $MyItemRow['suppliersuom'] . '</td>'; + echo '<td>' . $myrow[1] . '</td>'; + echo '<td><input type="text" class="number" size="10" name="Price'. $i . '" value="0.00" /></td>'; + echo '<td><input type="text" class="date" alt="' .$_SESSION['DefaultDateFormat'] .'" name="RequiredByDate'. $i . '" size="11" value="' . ConvertSQLDate($MyItemRow['requiredbydate']) . '" /></td>'; + } + echo '</form>'; + } + echo '</table>'; +} + if (isset($_POST['Search'])){ /*ie seach for stock items */ echo '<form method="post" action="' . htmlspecialchars($_SERVER['PHP_SELF']) . '">'; echo '<input type="hidden" name="FormID" value="' . $_SESSION['FormID'] . '" />'; - echo '<p class="page_title_text"><img src="' . $rootpath . '/css/' . $theme . '/images/supplier.png" title="' . - _('Tenders') . '" alt="" />' . ' ' . _('Select items to offer from').' '.$Supplier .'</p>'; + echo '<p class="page_title_text"><img src="' . $rootpath . '/css/' . $theme . '/images/supplier.png" title="' . _('Tenders') . '" alt="" />' . ' ' . _('Select items to offer from').' '.$Supplier .'</p>'; - if ($_POST['Keywords'] AND $_POST['StockCode']) { + if ($_POST['Keywords'] and $_POST['StockCode']) { prnMsg( _('Stock description keywords have been used in preference to the Stock code extract entered'), 'info' ); } if ($_POST['Keywords']) { @@ -471,7 +609,7 @@ $DbgMsg = _('The SQL statement that failed was'); $SearchResult = DB_query($sql,$db,$ErrMsg,$DbgMsg); - if (DB_num_rows($SearchResult)==0 && $debug==1){ + if (DB_num_rows($SearchResult)==0 and $debug==1){ prnMsg( _('There are no products to display matching the criteria provided'),'warn'); } if (DB_num_rows($SearchResult)==1){ @@ -483,7 +621,7 @@ if (isset($SearchResult)) { - echo "<table cellpadding=1 colspan=7>"; + echo '<table cellpadding="1" colspan="7">'; $tableheader = '<tr> <th>' . _('Code') . '</th> @@ -495,8 +633,8 @@ </tr>'; echo $tableheader; - $j = 1; - $k=0; //row colour counter + $i = 0; + $k = 0; //row colour counter $PartsDisplayed=0; while ($myrow=DB_fetch_array($SearchResult)) { @@ -511,8 +649,7 @@ $filename = $myrow['stockid'] . '.jpg'; if (file_exists( $_SESSION['part_pics_dir'] . '/' . $filename) ) { - $ImageSource = '<img src="'.$rootpath . '/' . $_SESSION['part_pics_dir'] . '/' . $myrow['stockid'] . - '.jpg" width="50" height="50">'; + $ImageSource = '<img src="'.$rootpath . '/' . $_SESSION['part_pics_dir'] . '/' . $myrow['stockid'] . '.jpg" width="50" height="50" />'; } else { $ImageSource = '<i>'._('No Image').'</i>'; @@ -525,7 +662,7 @@ LEFT JOIN unitsofmeasure ON purchdata.suppliersuom=unitsofmeasure.unitid WHERE supplierno='".$_POST['SupplierID']."' - AND stockid='" . $myrow['stockid']. "'"; + AND stockid='" . $myrow['stockid'] . "'"; $uomresult=DB_query($uomsql, $db); if (DB_num_rows($uomresult)... [truncated message content] |
From: <tim...@us...> - 2012-01-20 13:49:05
|
Revision: 4821 http://web-erp.svn.sourceforge.net/web-erp/?rev=4821&view=rev Author: tim_schofield Date: 2012-01-20 13:48:53 +0000 (Fri, 20 Jan 2012) Log Message: ----------- Merge Tims branch into trunk: Add tendering facility Modified Paths: -------------- trunk/SupplierTenders.php trunk/UpgradeDatabase.php trunk/WWW_Users.php trunk/doc/Change.log trunk/includes/ConnectDB.inc trunk/includes/DefineOfferClass.php trunk/includes/UserLogin.php trunk/index.php trunk/sql/mysql/upgrade4.05-4.06.sql Added Paths: ----------- trunk/SupplierTenderCreate.php trunk/includes/DefineTenderClass.php Added: trunk/SupplierTenderCreate.php =================================================================== --- trunk/SupplierTenderCreate.php (rev 0) +++ trunk/SupplierTenderCreate.php 2012-01-20 13:48:53 UTC (rev 4821) @@ -0,0 +1,809 @@ +<?php +/* $Id$*/ + +include('includes/DefineTenderClass.php'); +include('includes/SQL_CommonFunctions.inc'); +include('includes/session.inc'); + +$Maximum_Number_Of_Parts_To_Show=50; + +if (isset($_GET['New']) and isset($_SESSION['tender'])) { + unset($_SESSION['tender']); +} + +if (isset($_GET['New']) and $_SESSION['CanCreateTender']==0) { + $title = _('Authorisation Problem'); + include('includes/header.inc'); + echo '<p class="page_title_text"><img src="'.$rootpath.'/css/'.$theme.'/images/supplier.png" title="' . $title . '" alt="" /> '.$title . '</p>'; + prnMsg( _('You do not have authority to create supplier tenders for this company.') . '<br />' . + _('Please see your system administrator'), 'warn'); + include('includes/footer.inc'); + exit; +} + +if (isset($_GET['Edit']) and $_SESSION['CanCreateTender']==0) { + $title = _('Authorisation Problem'); + include('includes/header.inc'); + echo '<p class="page_title_text"><img src="'.$rootpath.'/css/'.$theme.'/images/supplier.png" title="' . $title . '" alt="" /> '.$title . '</p>'; + prnMsg( _('You do not have authority to amend supplier tenders for this company.') . '<br />' . + _('Please see your system administrator'), 'warn'); + include('includes/footer.inc'); + exit; +} + +$ShowTender = 0; + +if (isset($_GET['ID'])) { + $sql="SELECT tenderid, + location, + address1, + address2, + address3, + address4, + address5, + address6, + telephone + FROM tenders + WHERE tenderid='" . $_GET['ID'] . "'"; + $result=DB_query($sql, $db); + $myrow=DB_fetch_array($result); + if (isset($_SESSION['tender'])) { + unset($_SESSION['tender']); + } + $_SESSION['tender'] = new Tender(); + $_SESSION['tender']->TenderId = $myrow['tenderid']; + $_SESSION['tender']->Location = $myrow['location']; + $_SESSION['tender']->DelAdd1 = $myrow['address1']; + $_SESSION['tender']->DelAdd2 = $myrow['address2']; + $_SESSION['tender']->DelAdd3 = $myrow['address3']; + $_SESSION['tender']->DelAdd4 = $myrow['address4']; + $_SESSION['tender']->DelAdd5 = $myrow['address5']; + $_SESSION['tender']->DelAdd6 = $myrow['address6']; + + $sql="SELECT tenderid, + tendersuppliers.supplierid, + suppliers.suppname, + tendersuppliers.email + FROM tendersuppliers + LEFT JOIN suppliers + ON tendersuppliers.supplierid=suppliers.supplierid + WHERE tenderid='" . $_GET['ID'] . "'"; + $result=DB_query($sql, $db); + while ($myrow=DB_fetch_array($result)) { + $_SESSION['tender']->add_supplier_to_tender( + $myrow['supplierid'], + $myrow['suppname'], + $myrow['email']); + } + + $sql="SELECT tenderid, + tenderitems.stockid, + tenderitems.quantity, + stockmaster.description, + tenderitems.units, + stockmaster.decimalplaces + FROM tenderitems + LEFT JOIN stockmaster + ON tenderitems.stockid=stockmaster.stockid + WHERE tenderid='" . $_GET['ID'] . "'"; + $result=DB_query($sql, $db); + while ($myrow=DB_fetch_array($result)) { + $_SESSION['tender']->add_item_to_tender( + $_SESSION['tender']->LinesOnTender, + $myrow['stockid'], + $myrow['quantity'], + $myrow['description'], + $myrow['units'], + $myrow['decimalplaces'], + DateAdd(date($_SESSION['DefaultDateFormat']),'m',3)); + } + $ShowTender = 1; +} + +if (isset($_GET['Edit'])) { + $title = _('Edit an Existing Supplier Tender Request'); + include('includes/header.inc'); + echo '<p class="page_title_text"><img src="'.$rootpath.'/css/'.$theme.'/images/supplier.png" title="' . _('Purchase Order Tendering') . '" alt="" /> '.$title . '</p>'; + $sql="SELECT tenderid, + location, + address1, + address2, + address3, + address4, + address5, + address6, + telephone + FROM tenders + WHERE closed=0"; + $result=DB_query($sql, $db); + echo '<table class="selection">'; + echo '<tr><th>' . _('Tender ID') . '</th>'; + echo '<th>' . _('Location') . '</th>'; + echo '<th>' . _('Address 1') . '</th>'; + echo '<th>' . _('Address 2') . '</th>'; + echo '<th>' . _('Address 3') . '</th>'; + echo '<th>' . _('Address 4') . '</th>'; + echo '<th>' . _('Address 5') . '</th>'; + echo '<th>' . _('Address 6') . '</th>'; + echo '<th>' . _('Telephone') . '</th></tr>'; + while ($myrow=DB_fetch_array($result)) { + echo '<tr><td>' . $myrow['tenderid'] . '</td>'; + echo '<td>' . $myrow['location'] . '</td>'; + echo '<td>' . $myrow['address1'] . '</td>'; + echo '<td>' . $myrow['address2'] . '</td>'; + echo '<td>' . $myrow['address3'] . '</td>'; + echo '<td>' . $myrow['address4'] . '</td>'; + echo '<td>' . $myrow['address5'] . '</td>'; + echo '<td>' . $myrow['address6'] . '</td>'; + echo '<td>' . $myrow['telephone'] . '</td>'; + echo '<td><a href="'.$_SERVER['PHP_SELF'] . '?ID='.$myrow['tenderid'].'">'. _('Edit') .'</a></td>'; + } + echo '</table>'; + include('includes/footer.inc'); + exit; +} else if (isset($_GET['ID']) or (isset($_SESSION['tender']->TenderId))) { + $title = _('Edit an Existing Supplier Tender Request'); + include('includes/header.inc'); + echo '<p class="page_title_text"><img src="'.$rootpath.'/css/'.$theme.'/images/supplier.png" title="' . _('Purchase Order Tendering') . '" alt="" /> '.$title . '</p>'; +} else { + $title = _('Create a New Supplier Tender Request'); + include('includes/header.inc'); + echo '<p class="page_title_text"><img src="'.$rootpath.'/css/'.$theme.'/images/supplier.png" title="' . _('Purchase Order Tendering') . '" alt="" /> '.$title . '</p>'; +} + +if (isset($_POST['Save'])) { + $_SESSION['tender']->RequiredByDate=$_POST['RequiredByDate']; + $_SESSION['tender']->save($db); + $_SESSION['tender']->EmailSuppliers(); + prnMsg( _('The tender has been successfully saved'), 'success'); + include('includes/footer.inc'); + exit; +} + +if (isset($_GET['DeleteSupplier'])) { + $_SESSION['tender']->remove_supplier_from_tender($_GET['DeleteSupplier']); + $ShowTender = 1; +} + +if (isset($_GET['DeleteItem'])) { + $_SESSION['tender']->remove_item_from_tender($_GET['DeleteItem']); + $ShowTender = 1; +} + +if (isset($_POST['SelectedSupplier'])) { + $sql = "SELECT suppname, + email + FROM suppliers + WHERE supplierid='" . $_POST['SelectedSupplier'] . "'"; + $result = DB_query($sql, $db); + $myrow = DB_fetch_array($result); + if (mb_strlen($myrow['email'])>0) { + $_SESSION['tender']->add_supplier_to_tender( + $_POST['SelectedSupplier'], + $myrow['suppname'], + $myrow['email']); + } else { + prnMsg( _('The supplier must have an email set up or they cannot be part of a tender'), 'warn'); + } + $ShowTender = 1; +} + +if (isset($_POST['NewItem']) and !isset($_POST['Refresh'])) { + foreach ($_POST as $key => $value) { + if (mb_substr($key,0,7)=='StockID') { + $Index = mb_substr($key,7,mb_strlen($key)-7); + $StockID = $value; + $Quantity = filter_number_format($_POST['Qty'.$Index]); + $UOM = $_POST['UOM'.$Index]; + $sql="SELECT description, decimalplaces FROM stockmaster WHERE stockid='".$StockID."'"; + $result=DB_query($sql, $db); + $myrow=DB_fetch_array($result); + $_SESSION['tender']->add_item_to_tender( + $_SESSION['tender']->LinesOnTender, + $StockID, + $Quantity, + $myrow['description'], + $UOM, + $myrow['decimalplaces'], + DateAdd(date($_SESSION['DefaultDateFormat']),'m',3)); + unset($UOM); + } + } + $ShowTender = 1; +} + +if (!isset($_SESSION['tender']) or isset($_POST['LookupDeliveryAddress']) or $ShowTender==1) { + /* Show Tender header screen */ + if (!isset($_SESSION['tender'])) { + $_SESSION['tender']=new Tender(); + } + echo '<form name="form1" action="' . $_SERVER['PHP_SELF'] . '" method="post">'; + echo '<input type="hidden" name="FormID" value="' . $_SESSION['FormID'] . '" />'; + echo '<table class="selection">'; + echo '<tr><th colspan="4"><font size="3" color="#616161">' . _('Tender header details') . '</font></th></tr>'; + echo '<tr><td>' . _('Delivery Must Be Made Before') . '</td>'; + echo '<td><input type="text" class="date" alt="' .$_SESSION['DefaultDateFormat'] . '" name="RequiredByDate" size="11" value="' . date($_SESSION['DefaultDateFormat']) . '" /></td></tr>'; + + if (!isset($_POST['StkLocation']) OR $_POST['StkLocation']==''){ + /* If this is the first time + * the form loaded set up defaults */ + + $_POST['StkLocation'] = $_SESSION['UserStockLocation']; + + $sql = "SELECT deladd1, + deladd2, + deladd3, + deladd4, + deladd5, + deladd6, + tel, + contact + FROM locations + WHERE loccode='" . $_POST['StkLocation'] . "'"; + + $LocnAddrResult = DB_query($sql,$db); + if (DB_num_rows($LocnAddrResult)==1){ + $LocnRow = DB_fetch_array($LocnAddrResult); + $_POST['DelAdd1'] = $LocnRow['deladd1']; + $_POST['DelAdd2'] = $LocnRow['deladd2']; + $_POST['DelAdd3'] = $LocnRow['deladd3']; + $_POST['DelAdd4'] = $LocnRow['deladd4']; + $_POST['DelAdd5'] = $LocnRow['deladd5']; + $_POST['DelAdd6'] = $LocnRow['deladd6']; + $_POST['Tel'] = $LocnRow['tel']; + $_POST['Contact'] = $LocnRow['contact']; + + $_SESSION['tender']->Location= $_POST['StkLocation']; + $_SESSION['tender']->DelAdd1 = $_POST['DelAdd1']; + $_SESSION['tender']->DelAdd2 = $_POST['DelAdd2']; + $_SESSION['tender']->DelAdd3 = $_POST['DelAdd3']; + $_SESSION['tender']->DelAdd4 = $_POST['DelAdd4']; + $_SESSION['tender']->DelAdd5 = $_POST['DelAdd5']; + $_SESSION['tender']->DelAdd6 = $_POST['DelAdd6']; + $_SESSION['tender']->Telephone = $_POST['Tel']; + $_SESSION['tender']->Contact = $_POST['Contact']; + + } else { + /*The default location of the user is crook */ + prnMsg(_('The default stock location set up for this user is not a currently defined stock location') . + '. ' . _('Your system administrator needs to amend your user record'),'error'); + } + + + } elseif (isset($_POST['LookupDeliveryAddress'])){ + + $sql = "SELECT deladd1, + deladd2, + deladd3, + deladd4, + deladd5, + deladd6, + tel, + contact + FROM locations + WHERE loccode='" . $_POST['StkLocation'] . "'"; + + $LocnAddrResult = DB_query($sql,$db); + if (DB_num_rows($LocnAddrResult)==1){ + $LocnRow = DB_fetch_array($LocnAddrResult); + $_POST['DelAdd1'] = $LocnRow['deladd1']; + $_POST['DelAdd2'] = $LocnRow['deladd2']; + $_POST['DelAdd3'] = $LocnRow['deladd3']; + $_POST['DelAdd4'] = $LocnRow['deladd4']; + $_POST['DelAdd5'] = $LocnRow['deladd5']; + $_POST['DelAdd6'] = $LocnRow['deladd6']; + $_POST['Tel'] = $LocnRow['tel']; + $_POST['Contact'] = $LocnRow['contact']; + + $_SESSION['tender']->Location= $_POST['StkLocation']; + $_SESSION['tender']->DelAdd1 = $_POST['DelAdd1']; + $_SESSION['tender']->DelAdd2 = $_POST['DelAdd2']; + $_SESSION['tender']->DelAdd3 = $_POST['DelAdd3']; + $_SESSION['tender']->DelAdd4 = $_POST['DelAdd4']; + $_SESSION['tender']->DelAdd5 = $_POST['DelAdd5']; + $_SESSION['tender']->DelAdd6 = $_POST['DelAdd6']; + $_SESSION['tender']->Telephone = $_POST['Tel']; + $_SESSION['tender']->Contact = $_POST['Contact']; + } + } + echo '<tr><td>' . _('Warehouse') . ':</td> + <td><select name=StkLocation onChange="ReloadForm(form1.LookupDeliveryAddress)">'; + + $sql = "SELECT loccode, + locationname + FROM locations"; + $LocnResult = DB_query($sql,$db); + + while ($LocnRow=DB_fetch_array($LocnResult)){ + if ((isset($_SESSION['tender']->Location) and $_SESSION['tender']->Location == $LocnRow['loccode'])){ + echo '<option selected="True" value="' . $LocnRow['loccode'] . '">' . $LocnRow['locationname'] . '</option>'; + } else { + echo '<option value="' . $LocnRow['loccode'] . '">' . $LocnRow['locationname'] . '</option>'; + } + } + + echo '</select> + <input type="submit" name="LookupDeliveryAddress" value="' ._('Select') . '" /></td> + </tr>'; + + /* Display the details of the delivery location + */ + echo '<tr><td>' . _('Delivery Contact') . ':</td> + <td><input type="text" name="Contact" size="41" value="' . $_SESSION['tender']->Contact . '" /></td> + </tr>'; + echo '<tr><td>' . _('Address') . ' 1 :</td> + <td><input type="text" name="DelAdd1" size="41" maxlength="40" value="' . $_POST['DelAdd1'] . '" /></td> + </tr>'; + echo '<tr><td>' . _('Address') . ' 2 :</td> + <td><input type="text" name="DelAdd2" size="41" maxlength="40" value="' . $_POST['DelAdd2'] . '" /></td> + </tr>'; + echo '<tr><td>' . _('Address') . ' 3 :</td> + <td><input type="text" name="DelAdd3" size="41" maxlength="40" value="' . $_POST['DelAdd3'] . '" /></td> + </tr>'; + echo '<tr><td>' . _('Address') . ' 4 :</td> + <td><input type="text" name="DelAdd4" size="21" maxlength="20" value="' . $_POST['DelAdd4'] . '" /></td> + </tr>'; + echo '<tr><td>' . _('Address') . ' 5 :</td> + <td><input type="text" name="DelAdd5" size="16" maxlength="15" value="' . $_POST['DelAdd5'] . '" /></td> + </tr>'; + echo '<tr><td>' . _('Address') . ' 6 :</td> + <td><input type="text" name="DelAdd6" size="16" maxlength="15" value="' . $_POST['DelAdd6'] . '" /></td> + </tr>'; + echo '<tr><td>' . _('Phone') . ':</td> + <td><input type="text" name="Tel" size="31" maxlength="30" value="' . $_SESSION['tender']->Telephone . '" /></td> + </tr>'; + echo '</table><br />'; + + /* Display the supplier/item details + */ + echo '<table>'; + + /* Supplier Details + */ + echo '<tr><td valign="top"><table class="selection">'; + echo '<tr><th colspan="4"><font size="3" color="#616161">' . _('Suppliers To Send Tender') . '</font></th></tr>'; + echo '<tr><th>'. _('Supplier Code') . '</th><th>' ._('Supplier Name') . '</th><th>' ._('Email Address') . '</th></tr>'; + foreach ($_SESSION['tender']->Suppliers as $Supplier) { + echo '<tr><td>' . $Supplier->SupplierCode . '</td>'; + echo '<td>' . $Supplier->SupplierName . '</td>'; + echo '<td>' . $Supplier->EmailAddress . '</td>'; + echo '<td><a href="' . $_SERVER['PHP_SELF'] . '?DeleteSupplier=' . $Supplier->SupplierCode . '">' . _('Delete') . '</a></td></tr>'; + } + echo '</table></td>'; + /* Item Details + */ + echo '<td valign="top"><table class="selection">'; + echo '<tr><th colspan="6"><font size="3" color="#616161">' . _('Items in Tender') . '</font></th></tr>'; + echo '<tr>'; + echo '<th>'._('Stock ID').'</th>'; + echo '<th>'._('Description').'</th>'; + echo '<th>'._('Quantity').'</th>'; + echo '<th>'._('UOM').'</th>'; + echo '</tr>'; + $k=0; + foreach ($_SESSION['tender']->LineItems as $LineItems) { + if ($LineItems->Deleted==False) { + if ($k==1){ + echo '<tr class="EvenTableRows">'; + $k=0; + } else { + echo '<tr class="OddTableRows">'; + $k=1; + } + echo '<td>'.$LineItems->StockID.'</td>'; + echo '<td>'.$LineItems->ItemDescription.'</td>'; + echo '<td class="number">' . locale_number_format($LineItems->Quantity,$LineItems->DecimalPlaces).'</td>'; + echo '<td>'.$LineItems->Units.'</td>'; + echo '<td><a href="' . $_SERVER['PHP_SELF'] . '?DeleteItem=' . $LineItems->LineNo . '">' . _('Delete') . '</a></td></tr>'; + echo '</tr>'; + } + } + echo '</table></td></tr></table><br />'; + + echo '<div class="centre"><input type="submit" name="Suppliers" value="' . _('Select Suppliers') . '" />'; + echo '<input type="submit" name="Items" value="' . _('Select Item Details') . '" /></div><br />'; + if ($_SESSION['tender']->LinesOnTender > 0 and $_SESSION['tender']->SuppliersOnTender > 0) { + echo '<div class="centre"><input type="submit" name="Save" value="' . _('Save Tender') . '" /></div>'; + } + echo '</form>'; + include('includes/footer.inc'); + exit; +} + +if (isset($_POST['SearchSupplier']) OR isset($_POST['Go']) OR isset($_POST['Next']) OR isset($_POST['Previous'])) { + if (mb_strlen($_POST['Keywords']) > 0 AND mb_strlen($_POST['SupplierCode']) > 0) { + prnMsg( '<br />' . _('Supplier name keywords have been used in preference to the Supplier code extract entered'), 'info' ); + } + if ($_POST['Keywords'] == '' AND $_POST['SupplierCode'] == '') { + $SQL = "SELECT supplierid, + suppname, + currcode, + address1, + address2, + address3, + address4 + FROM suppliers + ORDER BY suppname"; + } else { + if (mb_strlen($_POST['Keywords']) > 0) { + $_POST['Keywords'] = mb_strtoupper($_POST['Keywords']); + //insert wildcard characters in spaces + $SearchString = '%' . str_replace(' ', '%', $_POST['Keywords']) . '%'; + $SQL = "SELECT supplierid, + suppname, + currcode, + address1, + address2, + address3, + address4 + FROM suppliers + WHERE suppname " . LIKE . " '$SearchString' + ORDER BY suppname"; + } elseif (mb_strlen($_POST['SupplierCode']) > 0) { + $_POST['SupplierCode'] = mb_strtoupper($_POST['SupplierCode']); + $SQL = "SELECT supplierid, + suppname, + currcode, + address1, + address2, + address3, + address4 + FROM suppliers + WHERE supplierid " . LIKE . " '%" . $_POST['SupplierCode'] . "%' + ORDER BY supplierid"; + } + } //one of keywords or SupplierCode was more than a zero length string + $result = DB_query($SQL, $db); + if (DB_num_rows($result) == 1) { + $myrow = DB_fetch_row($result); + $SingleSupplierReturned = $myrow[0]; + } +} //end of if search +if (isset($SingleSupplierReturned)) { /*there was only one supplier returned */ + $_SESSION['SupplierID'] = $SingleSupplierReturned; + unset($_POST['Keywords']); + unset($_POST['SupplierCode']); +} + +if (!isset($_POST['PageOffset'])) { + $_POST['PageOffset'] = 1; +} else { + if ($_POST['PageOffset'] == 0) { + $_POST['PageOffset'] = 1; + } +} + +if (isset($_POST['Suppliers'])) { + echo '<form action="' . $_SERVER['PHP_SELF'] . '" method="post">'; + echo '<input type="hidden" name="FormID" value="' . $_SESSION['FormID'] . '" />'; + echo '<p class="page_title_text"><img src="' . $rootpath . '/css/' . $theme . '/images/magnifier.png" title="' . _('Search') . '" alt="" />' . ' ' . _('Search for Suppliers') . '</p> + <table cellpadding="3" colspan="4" class="selection"><tr><td>' . _('Enter a partial Name') . ':</td><td>'; + if (isset($_POST['Keywords'])) { + echo '<input type="text" name="Keywords" value="' . $_POST['Keywords'] . '" size="20" maxlength="25" />'; + } else { + echo '<input type="text" name="Keywords" size="20" maxlength="25" />'; + } + echo '</td><td><b>' . _('OR') . '</b></font></td><td>' . _('Enter a partial Code') . ':</font></td><td>'; + if (isset($_POST['SupplierCode'])) { + echo '<input type="text" name="SupplierCode" value="' . $_POST['SupplierCode'] . '" size="15" maxlength="18" />'; + } else { + echo '<input type="text" name="SupplierCode" size="15" maxlength="18" />'; + } + echo '</td></tr></table><br /><div class="centre"><input type="submit" name="SearchSupplier" value="' . _('Search Now') . '" /></div>'; + echo '</form>'; +} + +if (isset($_POST['SearchSupplier'])) { + echo '<form action="' . $_SERVER['PHP_SELF'] . '" method="post">'; + echo '<input type="hidden" name="FormID" value="' . $_SESSION['FormID'] . '" />'; + $ListCount = DB_num_rows($result); + $ListPageMax = ceil($ListCount / $_SESSION['DisplayRecordsMax']); + if (isset($_POST['Next'])) { + if ($_POST['PageOffset'] < $ListPageMax) { + $_POST['PageOffset'] = $_POST['PageOffset'] + 1; + } + } + if (isset($_POST['Previous'])) { + if ($_POST['PageOffset'] > 1) { + $_POST['PageOffset'] = $_POST['PageOffset'] - 1; + } + } + if ($ListPageMax > 1) { + echo '<br /> ' . $_POST['PageOffset'] . ' ' . _('of') . ' ' . $ListPageMax . ' ' . _('pages') . '. ' . _('Go to Page') . ': '; + echo '<select name="PageOffset">'; + $ListPage = 1; + while ($ListPage <= $ListPageMax) { + if ($ListPage == $_POST['PageOffset']) { + echo '<option value=' . $ListPage . ' selected>' . $ListPage . '</option>'; + } else { + echo '<option value=' . $ListPage . '>' . $ListPage . '</option>'; + } + $ListPage++; + } + echo '</select> + <input type="submit" name="Go" value="' . _('Go') . '" /> + <input type="submit" name="Previous" value="' . _('Previous') . '" /> + <input type="submit" name="Next" value="' . _('Next') . '" />'; + echo '<br />'; + } + echo '<input type="hidden" name="Search" value="' . _('Search Now') . '" />'; + echo '<br /><br />'; + echo '<br /><table cellpadding="2" colspan="7">'; + $tableheader = '<tr> + <th>' . _('Code') . '</th> + <th>' . _('Supplier Name') . '</th> + <th>' . _('Currency') . '</th> + <th>' . _('Address 1') . '</th> + <th>' . _('Address 2') . '</th> + <th>' . _('Address 3') . '</th> + <th>' . _('Address 4') . '</th> + </tr>'; + echo $tableheader; + $j = 1; + $k = 0; //row counter to determine background colour + $RowIndex = 0; + if (DB_num_rows($result) <> 0) { + DB_data_seek($result, ($_POST['PageOffset'] - 1) * $_SESSION['DisplayRecordsMax']); + } + while (($myrow = DB_fetch_array($result)) AND ($RowIndex <> $_SESSION['DisplayRecordsMax'])) { + if ($k == 1) { + echo '<tr class="EvenTableRows">'; + $k = 0; + } else { + echo '<tr class="OddTableRows">'; + $k = 1; + } + echo '<td><input type="submit" name="SelectedSupplier" value="'.$myrow['supplierid'].'" /></td> + <td>'.$myrow['suppname'].'</td> + <td>'.$myrow['currcode'].'</td> + <td>'.$myrow['address1'].'</td> + <td>'.$myrow['address2'].'</td> + <td>'.$myrow['address3'].'</td> + <td>'.$myrow['address4'].'</td> + </tr>'; + $RowIndex = $RowIndex + 1; + //end of page full new headings if + } + //end of while loop + echo '</table>'; +} + +/*The supplier has chosen option 2 + */ +if (isset($_POST['Items'])) { + echo '<form action="' . $_SERVER['PHP_SELF'] . '" method="post">'; + echo '<input type="hidden" name="FormID" value="' . $_SESSION['FormID'] . '" />'; + echo '<p class="page_title_text"><img src="' . $rootpath . '/css/' . $theme . '/images/magnifier.png" title="' . _('Search') . '" alt="" />' . ' ' . _('Search for Inventory Items') . '</p>'; + $sql = "SELECT categoryid, + categorydescription + FROM stockcategory + ORDER BY categorydescription"; + $result = DB_query($sql, $db); + if (DB_num_rows($result) == 0) { + echo '<br /><font size="4" color="red">' . _('Problem Report') . ':</font><br />' . + _('There are no stock categories currently defined please use the link below to set them up'); + echo '<br /><a href="' . $rootpath . '/StockCategories.php">' . _('Define Stock Categories') . '</a>'; + exit; + } + echo '<table class="selection"><tr>'; + echo '<td>' . _('In Stock Category') . ':'; + echo '<select name="StockCat">'; + if (!isset($_POST['StockCat'])) { + $_POST['StockCat'] = ""; + } + if ($_POST['StockCat'] == 'All') { + echo '<option selected="True" value="All">' . _('All') . '</option>'; + } else { + echo '<option value="All">' . _('All') . '</option>'; + } + while ($myrow1 = DB_fetch_array($result)) { + if ($myrow1['categoryid'] == $_POST['StockCat']) { + echo '<option selected="True" value="' . $myrow1['categoryid'] . '">' . $myrow1['categorydescription'] . '</option>'; + } else { + echo '<option value="' . $myrow1['categoryid'] . '">' . $myrow1['categorydescription'] . '</option>'; + } + } + echo '</select>'; + echo '<td>' . _('Enter partial') . '<b> ' . _('Description') . '</b>:</td><td>'; + if (isset($_POST['Keywords'])) { + echo '<input type="text" name="Keywords" value="' . $_POST['Keywords'] . '" size="20" maxlength="25" />'; + } else { + echo '<input type="text" name="Keywords" size="20" maxlength="25" />'; + } + echo '</td></tr><tr><td></td>'; + echo '<td><font size="3"><b>' . _('OR') . ' ' . '</b></font>' . _('Enter partial') . ' <b>' . _('Stock Code') . '</b>:</td>'; + echo '<td>'; + if (isset($_POST['StockCode'])) { + echo '<input type="text" name="StockCode" value="' . $_POST['StockCode'] . '" size="15" maxlength="18" />'; + } else { + echo '<input type="text" name="StockCode" size="15" maxlength="18" />'; + } + echo '</td></tr></table><br />'; + echo '<div class="centre"><input type="submit" name="Search" value="' . _('Search Now') . '" /></div><br /></form>'; + echo '<script type="text/javascript">defaultControl(document.forms[0].StockCode);</script>'; + echo '</form>'; +} + +if (isset($_POST['Search'])){ /*ie seach for stock items */ + echo '<form method="post" action="' . $_SERVER['PHP_SELF'] .'">'; + echo '<input type="hidden" name="FormID" value="' . $_SESSION['FormID'] . '" />'; + echo '<p class="page_title_text"><img src="' . $rootpath . '/css/' . $theme . '/images/supplier.png" title="' . _('Tenders') . '" alt="" />' . ' ' . _('Select items required on this tender').'</p>'; + + if ($_POST['Keywords'] AND $_POST['StockCode']) { + prnMsg( _('Stock description keywords have been used in preference to the Stock code extract entered'), 'info' ); + } + if ($_POST['Keywords']) { + //insert wildcard characters in spaces + $SearchString = '%' . str_replace(' ', '%', $_POST['Keywords']) . '%'; + + if ($_POST['StockCat']=='All'){ + $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!='A' + AND stockmaster.mbflag!='K' + and stockmaster.discontinued!=1 + AND stockmaster.description " . LIKE . " '$SearchString' + ORDER BY stockmaster.stockid"; + } 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!='A' + AND stockmaster.mbflag!='K' + and stockmaster.discontinued!=1 + AND stockmaster.description " . LIKE . " '$SearchString' + AND stockmaster.categoryid='" . $_POST['StockCat'] . "' + ORDER BY stockmaster.stockid"; + } + + } elseif ($_POST['StockCode']){ + + $_POST['StockCode'] = '%' . $_POST['StockCode'] . '%'; + + if ($_POST['StockCat']=='All'){ + $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!='A' + AND stockmaster.mbflag!='K' + and stockmaster.discontinued!=1 + AND stockmaster.stockid " . LIKE . " '" . $_POST['StockCode'] . "' + ORDER BY stockmaster.stockid"; + } 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!='A' + AND stockmaster.mbflag!='K' + and stockmaster.discontinued!=1 + AND stockmaster.stockid " . LIKE . " '" . $_POST['StockCode'] . "' + AND stockmaster.categoryid='" . $_POST['StockCat'] . "' + ORDER BY stockmaster.stockid"; + } + + } else { + if ($_POST['StockCat']=='All'){ + $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!='A' + AND stockmaster.mbflag!='K' + and stockmaster.discontinued!=1 + ORDER BY stockmaster.stockid"; + } 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!='A' + AND stockmaster.mbflag!='K' + and stockmaster.discontinued!=1 + AND stockmaster.categoryid='" . $_POST['StockCat'] . "' + ORDER BY stockmaster.stockid"; + } + } + + $ErrMsg = _('There is a problem selecting the part records to display because'); + $DbgMsg = _('The SQL statement that failed was'); + $SearchResult = DB_query($sql,$db,$ErrMsg,$DbgMsg); + + if (DB_num_rows($SearchResult)==0 and $debug==1){ + prnMsg( _('There are no products to display matching the criteria provided'),'warn'); + } + if (DB_num_rows($SearchResult)==1){ + + $myrow=DB_fetch_array($SearchResult); + $_GET['NewItem'] = $myrow['stockid']; + DB_data_seek($SearchResult,0); + } + + if (isset($SearchResult)) { + + echo '<table cellpadding="1" colspan="7">'; + + $tableheader = '<tr> + <th>' . _('Code') . '</th> + <th>' . _('Description') . '</th> + <th>' . _('Units') . '</th> + <th>' . _('Image') . '</th> + <th>' . _('Quantity') . '</th> + </tr>'; + echo $tableheader; + + $i = 0; + $k = 0; //row colour counter + $PartsDisplayed=0; + while ($myrow=DB_fetch_array($SearchResult)) { + + if ($k==1){ + echo '<tr class="EvenTableRows">'; + $k=0; + } else { + echo '<tr class="OddTableRows">'; + $k=1; + } + + $filename = $myrow['stockid'] . '.jpg'; + if (file_exists( $_SESSION['part_pics_dir'] . '/' . $filename) ) { + + $ImageSource = '<img src="'.$rootpath . '/' . $_SESSION['part_pics_dir'] . '/' . $myrow['stockid'] . '.jpg" width="50" height="50" />'; + + } else { + $ImageSource = '<i>'._('No Image').'</i>'; + } + + $uom=$myrow['units']; + + echo '<td>'.$myrow['stockid'].'</td> + <td>'.$myrow['description'].'</td> + <td>'.$uom.'</td> + <td>'.$ImageSource.'</td> + <td><input class="number" type="text" size="6" value="0" name="Qty'.$i.'" /></td> + <input type="hidden" value="'.$uom.'" name="UOM'.$i.'" /> + <input type="hidden" value="'.$myrow['stockid'].'" name="StockID'.$i.'" /> + </tr>'; + + $PartsDisplayed++; + if ($PartsDisplayed == $Maximum_Number_Of_Parts_To_Show){ + break; + } + $i++; +#end of page full new headings if + } +#end of while loop + echo '</table>'; + if ($PartsDisplayed == $Maximum_Number_Of_Parts_To_Show){ + + /*$Maximum_Number_Of_Parts_To_Show defined in config.php */ + + prnMsg( _('Only the first') . ' ' . $Maximum_Number_Of_Parts_To_Show . ' ' . _('can be displayed') . '. ' . + _('Please restrict your search to only the parts required'),'info'); + } + echo '<a name="end"></a><br /><div class="centre"><input type="submit" name="NewItem" value="Add to Tender" /></div>'; + }#end if SearchResults to show + + echo '</form>'; + +} //end of if search + +include('includes/footer.inc'); + +?> \ No newline at end of file Modified: trunk/SupplierTenders.php =================================================================== --- trunk/SupplierTenders.php 2012-01-20 08:19:32 UTC (rev 4820) +++ trunk/SupplierTenders.php 2012-01-20 13:48:53 UTC (rev 4821) @@ -8,6 +8,10 @@ $Maximum_Number_Of_Parts_To_Show=50; +if (isset($_GET['TenderType'])) { + $_POST['TenderType']=$_GET['TenderType']; +} + if (!isset($_POST['SupplierID'])) { $sql="SELECT supplierid FROM www_users WHERE userid='" . $_SESSION['UserID'] . "'"; $result=DB_query($sql, $db); @@ -27,12 +31,110 @@ $_SESSION['offer']->remove_from_offer($_GET['Delete']); } -$sql="SELECT suppname, currcode FROM suppliers WHERE supplierid='" . $_POST['SupplierID'] . "'"; +$sql="SELECT suppname, + currcode + FROM suppliers + WHERE supplierid='".$_POST['SupplierID']."'"; $result=DB_query($sql, $db); $myrow=DB_fetch_array($result); $Supplier=$myrow['suppname']; $Currency=$myrow['currcode']; +if (isset($_POST['Confirm'])) { + $_SESSION['offer']->Save($db); + $_SESSION['offer']->EmailOffer(); + $sql="UPDATE tendersuppliers + SET responded=1 + WHERE supplierid='" . $_SESSION['offer']->SupplierID . "' + AND tenderid='" . $_SESSION['offer']->TenderID . "'"; + $result=DB_query($sql, $db); +} + +if (isset($_POST['Process'])) { + if (isset($_SESSION['offer'])) { + unset($_SESSION['offer']); + } + $_SESSION['offer']=new Offer($_POST['SupplierID']); + $_SESSION['offer']->TenderID=$_POST['Tender']; + $_SESSION['offer']->CurrCode=$Currency; + $LineNo=0; + foreach ($_POST as $key=>$value) { + if (mb_substr($key,0,7)=='StockID') { + $Index = mb_substr($key,7,mb_strlen($key)-7); + $ItemCode=$value; + $Quantity=$_POST['Qty'.$Index]; + $Price=$_POST['Price'.$Index]; + $_SESSION['offer']->add_to_offer( + $LineNo, + $ItemCode, + $Quantity, + $_POST['ItemDescription'.$Index], + $Price, + $_POST['UOM'.$Index], + $_POST['DecimalPlaces'.$Index], + $_POST['RequiredByDate'.$Index]); + $LineNo++; + } + } + echo '<p class="page_title_text"><img src="' . $rootpath . '/css/' . $theme . '/images/supplier.png" title="' . _('Tenders') . '" alt="" />' . ' ' . _('Confirm the Response For Tender') . ' ' . $_SESSION['offer']->TenderID .'</p>'; + echo '<form action="' . htmlspecialchars($_SERVER['PHP_SELF']) . '" method="post">'; + echo '<input type="hidden" name="FormID" value="' . $_SESSION['FormID'] . '" />'; + echo '<table class="selection">'; + echo '<input type="hidden" name="TenderType" value="3" />'; + $LocationSQL="SELECT tenderid, + locations.locationname, + address1, + address2, + address3, + address4, + address5, + address6, + telephone + FROM tenders + LEFT JOIN locations + ON tenders.location=locations.loccode + WHERE closed=0 + AND tenderid='".$_SESSION['offer']->TenderID."'"; + $LocationResult=DB_query($LocationSQL, $db); + $MyLocationRow=DB_fetch_row($LocationResult); + $CurrencySQL="SELECT decimalplaces from currencies WHERE currabrev='".$_SESSION['offer']->CurrCode."'"; + $CurrencyResult=DB_query($CurrencySQL, $db); + $CurrencyRow=DB_fetch_array($CurrencyResult); + echo '<tr><td valign="top" style="background-color:#cccce5">' . _('Deliver To') . ':</td><td valign="top" style="background-color:#cccce5">'; + for ($i=1; $i<8; $i++) { + if ($MyLocationRow[$i]!='') { + echo $MyLocationRow[$i] . '<br />'; + } + } + echo '</td>'; + echo '<th colspan="8" style="vertical-align:top"><font size="2" color="#616161">' . _('Tender Number') . ': ' .$_SESSION['offer']->TenderID . '</font></th>'; + echo '<input type="hidden" value="' . $_SESSION['offer']->TenderID . '" name="Tender" />'; + echo '<tr><th>' . stripslashes($_SESSION['CompanyRecord']['coyname']) . '<br />' . _('Item Code') . '</th>'; + echo '<th>' . _('Item Description') . '</th>'; + echo '<th>' . _('Quantity') . '<br />' . _('Offered') . '</th>'; + echo '<th>' . $Supplier . '<br />' . _('Units of Measure') . '</th>'; + echo '<th>' . _('Currency') . '</th>'; + echo '<th>' . $Supplier . '<br />' . _('Price') . '</th>'; + echo '<th>' . _('Line Value') . '</th>'; + echo '<th>' . _('Delivery By') . '</th>'; + foreach ($_SESSION['offer']->LineItems as $LineItem) { + echo '<tr><td>' . $LineItem->StockID . '</td>'; + echo '<td>' . $LineItem->ItemDescription . '</td>'; + echo '<td class="number"> ' .locale_number_format($LineItem->Quantity, $LineItem->DecimalPlaces) . '</td>'; + echo '<td>' . $LineItem->Units . '</td>'; + echo '<td>' . $_SESSION['offer']->CurrCode . '</td>'; + echo '<td class="number">' . locale_number_format($LineItem->Price, $CurrencyRow['decimalplaces']) . '</td>'; + echo '<td class="number">' . locale_number_format($LineItem->Price*$LineItem->Quantity,$CurrencyRow['decimalplaces']) . '</td>'; + echo '<td>' . $LineItem->ExpiryDate . '</td>'; + } + echo '</table><br />'; + echo '<div class="centre"><input type="submit" name="Confirm" value="' . _('Confirm and Send Email') . '" /><br />'; + echo '<br /><input type="submit" name="Cancel" value="' . _('Cancel Offer') . '" /></div>'; + echo '</form>'; + include('includes/footer.inc'); + exit; +} + /* If the supplierID is set then it must be a login from the supplier but if nothing else is * set then the supplier must have just logged in so show them the choices. */ @@ -42,66 +144,57 @@ } echo '<form method="post" action="' . htmlspecialchars($_SERVER['PHP_SELF']) . '">'; echo '<input type="hidden" name="FormID" value="' . $_SESSION['FormID'] . '" />'; - echo '<p class="page_title_text"><img src="' . $rootpath . '/css/' . $theme . '/images/supplier.png" title="' . - _('Tenders') . '" alt="" />' . ' ' . _('Create or View Offers from') . ' '.$Supplier.'</p>'; + echo '<p class="page_title_text"><img src="' . $rootpath . '/css/' . $theme . '/images/supplier.png" title="' . _('Tenders') . '" alt="" />' . ' ' . _('Create or View Offers from') . ' '.$Supplier.'</p>'; echo '<table class="selection">'; echo'<tr><td>'._('Select option for tendering').'</td>'; - echo '<td><select name=TenderType>'; - echo '<option value=1>'._('View or Amend outstanding offers from').' '.$Supplier .'</option>'; - echo '<option value=2>'._('Create a new offer from').' '.$Supplier .'</option>'; -// echo '<option value=3>'._('View any open tenders without an offer from').' '.$Supplier .'</option>'; + echo '<td><select name="TenderType">'; + echo '<option value="1">'._('View or Amend outstanding offers from').' '.$Supplier .'</option>'; + echo '<option value="2">'._('Create a new offer from').' '.$Supplier .'</option>'; + echo '<option value="3">'._('View any open tenders without an offer from').' '.$Supplier .'</option>'; echo '</select></td></tr>'; - echo '<input type="hidden" name="SupplierID" value="'.$_POST['SupplierID'].'"'; - echo '<tr><td colspan="2"><div class="centre"><input type="submit" name="submit" value="' . _('Select') . '"></div></td></tr>'; - echo '</table> - </form>'; + echo '<input type="hidden" name="SupplierID" value="'.$_POST['SupplierID'].'" />'; + echo '<tr><td colspan="2"><div class="centre"><input type="submit" name="submit" value="' . _('Select') . '" /></div></td></tr>'; + echo '</table></form>'; } if (isset($_POST['NewItem']) and !isset($_POST['Refresh'])) { foreach ($_POST as $key => $value) { - if (mb_substr($key,0,3)=='qty') { - $StockID=mb_substr($key,3); - $Quantity=$value; + if (mb_substr($key,0,7)=='StockID') { + $Index = mb_substr($key,7,mb_strlen($key)-7); + $StockID=$value; + $Quantity=filter_number_format($_POST['Qty'.$Index]); + $Price=filter_number_format($_POST['Price'.$Index]); + $UOM=$_POST['uom'.$Index]; + if (isset($UOM) and $Quantity>0) { + $sql="SELECT description, decimalplaces FROM stockmaster WHERE stockid='".$StockID."'"; + $result=DB_query($sql, $db); + $myrow=DB_fetch_array($result); + $_SESSION['offer']->add_to_offer($_SESSION['offer']->LinesOnOffer, + $StockID, + $Quantity, + $myrow['description'], + $Price, + $UOM, + $myrow['decimalplaces'], + DateAdd(date($_SESSION['DefaultDateFormat']),'m',3)); + unset($UOM); + } } - if (mb_substr($key,0,5)=='price') { - $Price=$value; - } - if (mb_substr($key,0,3)=='uom') { - $UOM=$value; - } - if (isset($UOM)) { - $sql="SELECT description, decimalplaces FROM stockmaster WHERE stockid='" . $StockID."'"; - $result=DB_query($sql, $db); - $myrow=DB_fetch_array($result); - $_SESSION['offer']->add_to_offer( - $_SESSION['offer']->LinesOnOffer, - $StockID, - $Quantity, - $myrow['description'], - $Price, - $UOM, - $myrow['decimalplaces'], - DateAdd(date($_SESSION['DefaultDateFormat']),'m',3)); - unset($UOM); - } } } if (isset($_POST['Refresh']) and !isset($_POST['NewItem'])) { foreach ($_POST as $key => $value) { - if (mb_substr($key,0,3)=='qty') { - $LineNo=mb_substr($key,3); - $Quantity=$value; + if (mb_substr($key,0,7)=='StockID') { + $Index = mb_substr($key,7,mb_strlen($key)-7); + $StockID=$value; + $Quantity=filter_number_format($_POST['Qty'.$Index]); + $Price=filter_number_format($_POST['Price'.$Index]); + $ExpiryDate=$_POST['expirydate'.$Index]; } - if (mb_substr($key,0,5)=='price') { - $Price=$value; - } - if (mb_substr($key,0,10)=='expirydate') { - $ExpiryDate=$value; - } if (isset($ExpiryDate)) { $_SESSION['offer']->update_offer_item( - $LineNo, + $Index, $Quantity, $Price, $ExpiryDate); @@ -111,7 +204,6 @@ } if (isset($_POST['Update'])) { - $MailText=''; foreach ($_POST as $key => $value) { if (mb_substr($key,0,3)=='qty') { $LineNo=mb_substr($key,3); @@ -132,31 +224,14 @@ unset($ExpiryDate); } } - foreach ($_SESSION['offer']->LineItems as $LineItems) { - $sql="UPDATE offers SET - quantity='".$LineItems->Quantity."', - price='".$LineItems->Price."', - expirydate='".FormatDateForSQL($LineItems->ExpiryDate)."' - WHERE offerid='".$LineItems->LineNo . "'"; - $ErrMsg = _('The suppliers offer could not be updated on the database because'); - $DbgMsg = _('The SQL statement used to update the suppliers offer record and failed was'); - $result = DB_query($sql,$db,$ErrMsg,$DbgMsg,true); - if (DB_error_no($db)==0) { - prnMsg( _('The offer for').' '.$LineItems->StockID.' '._('has been updated in the database'), 'success'); - $MailText .= $LineItems->Quantity.$LineItems->Units.' '._('of').' '.$LineItems->StockID.' '._('at a price of'). - ' '.$Currency.$LineItems->Price."\n"; - } else { - prnMsg( _('The offer for').' '.$LineItems->StockID.' '._('could not be updated in the database'), 'error'); - include('includes/footer.inc'); - exit; - } - } + $_SESSION['offer']->Save($db, 'Yes'); + $_SESSION['offer']->EmailOffer(); + unset($_SESSION['offer']); include('includes/footer.inc'); exit; } if (isset($_POST['Save'])) { - $MailText=''; foreach ($_POST as $key => $value) { if (mb_substr($key,0,3)=='qty') { $LineNo=mb_substr($key,3); @@ -177,46 +252,9 @@ unset($ExpiryDate); } } - foreach ($_SESSION['offer']->LineItems as $LineItems) { - if ($LineItems->Deleted==False) { - $sql="INSERT INTO offers ( - supplierid, - stockid, - quantity, - uom, - price, - expirydate, - currcode) - VALUES ( - '".$_POST['SupplierID']."', - '".$LineItems->StockID."', - '".$LineItems->Quantity."', - '".$LineItems->Units."', - '".$LineItems->Price."', - '".FormatDateForSQL($LineItems->ExpiryDate)."', - '".$Currency."' - )"; - $ErrMsg = _('The suppliers offer could not be inserted into the database because'); - $DbgMsg = _('The SQL statement used to insert the suppliers offer record and failed was'); - $result = DB_query($sql,$db,$ErrMsg,$DbgMsg,true); - if (DB_error_no($db)==0) { - prnMsg( _('The offer for').' '.$LineItems->StockID.' '._('has been inserted into the database'), 'success'); - $MailText .= $LineItems->Quantity.$LineItems->Units.' '._('of').' '.$LineItems->StockID.' '._('at a price of'). - ' '.$Currency.$LineItems->Price."\n"; - } else { - prnMsg( _('The offer for').' '.$LineItems->StockID.' '._('could not be inserted into the database'), 'error'); - include('includes/footer.inc'); - exit; - } - } - } - include ('includes/htmlMimeMail.php'); - $mail = new htmlMimeMail(); - $mail->setSubject(_('Offer received from').' '.$Supplier); - $mail->setText(_('This email is automatically generated by webERP')."\n" . - _('You have received the following offer from').' '.$Supplier."\n\n".$MailText); - $mail->setFrom($_SESSION['CompanyRecord']['coyname'] . ' <' . $_SESSION['CompanyRecord']['email'] . '>'); - $result = $mail->send(array($_SESSION['PurchasingManagerEmail']), 'smtp'); + $_SESSION['offer']->Save($db); + $_SESSION['offer']->EmailOffer(); + unset($_SESSION['offer']); include('includes/footer.inc'); exit; } @@ -234,11 +272,10 @@ stockmaster.decimalplaces FROM offers INNER JOIN stockmaster - ON offers.stockid=stockmaster.stockid - WHERE offers.supplierid='" . $_POST['SupplierID']."'"; + ON offers.stockid=stockmaster.stockid + WHERE offers.supplierid='" . $_POST['SupplierID'] . "'"; $result=DB_query($sql, $db); - $_SESSION['offer']=new Offer(); - $_SESSION['offer']->SupplierID=$_POST['SupplierID']; + $_SESSION['offer']=new Offer($_POST['SupplierID']); $_SESSION['offer']->CurrCode=$Currency; while ($myrow=DB_fetch_array($result)) { $_SESSION['offer']->add_to_offer( @@ -253,11 +290,10 @@ } } -if (isset($_SESSION['offer']) and $_SESSION['offer']->LinesOnOffer>0 or isset($_POST['Update'])) { +if (isset($_POST['TenderType']) and $_POST['TenderType']!=3 and isset($_SESSION['offer']) and $_SESSION['offer']->LinesOnOffer>0 or isset($_POST['Update'])) { echo '<form method="post" action="' . htmlspecialchars($_SERVER['PHP_SELF']) . '">'; echo '<input type="hidden" name="FormID" value="' . $_SESSION['FormID'] . '" />'; - echo '<p class="page_title_text"><img src="' . $rootpath . '/css/' . $theme . '/images/supplier.png" title="' . - _('Search') . '" alt="" />' . ' ' . _('Items to offer from').' '.$Supplier .'</p>'; + echo '<p class="page_title_text"><img src="' . $rootpath . '/css/' . $theme . '/images/supplier.png" title="' . _('Search') . '" alt="" />' . ' ' . _('Items to offer from').' '.$Supplier .'</p>'; echo '<table>'; echo '<tr> <th>'._('Stock ID').'</th> @@ -279,27 +315,28 @@ $k=1; } if ($LineItems->ExpiryDate < date('Y-m-d')) { - echo '<tr bgcolor=#F7A9A9>'; + echo '<tr bgcolor="#F7A9A9">'; } + echo '<input type="hidden" name="StockID'.$LineItems->LineNo.'" value="'.$LineItems->StockID.'" />'; echo '<td>'.$LineItems->StockID.'</td>'; echo '<td>'.$LineItems->ItemDescription.'</td>'; - echo '<td><input type="text" class=number name="qty'.$LineItems->LineNo.'" value='.locale_number_format($LineItems->Quantity,$LineItems->DecimalPlaces).'></td>'; + echo '<td><input type="text" class="number" name="Qty'.$LineItems->LineNo.'" value="'.locale_number_format($LineItems->Quantity,$LineItems->DecimalPlaces).'" /></td>'; echo '<td>'.$LineItems->Units.'</td>'; - echo '<td><input type="text" class=number name="price'.$LineItems->LineNo.'" value='.locale_number_format($LineItems->Price,2,'.','').'></td>'; - echo '<td class=number>'.locale_number_format($LineItems->Price*$LineItems->Quantity,2).'</td>'; - echo '<td><input type="text" size=11 class=date alt='.$_SESSION['DefaultDateFormat'].' name="expirydate'.$LineItems->LineNo.'" value='.$LineItems->ExpiryDate.'></td>'; + echo '<td><input type="text" class="number" name="Price'.$LineItems->LineNo.'" value="'.locale_number_format($LineItems->Price,2,'.','').'" /></td>'; + echo '<td class="number">'.locale_number_format($LineItems->Price*$LineItems->Quantity,2).'</td>'; + echo '<td><input type="text" size="11" class="date" alt="'.$_SESSION['DefaultDateFormat'].'" name="expirydate'.$LineItems->LineNo.'" value="'.$LineItems->ExpiryDate.'" /></td>'; echo '<td><a href="' . htmlspecialchars($_SERVER['PHP_SELF']) . '?Delete=' . $LineItems->LineNo . '&Type=' . $_POST['TenderType'] . '">' . _('Remove') . '</a></td></tr>'; echo '</tr>'; } } echo '</table>'; - echo '<input type=hidden name=TenderType value="'.$_POST['TenderType'].'">'; + echo '<input type="hidden" name="TenderType" value="'.$_POST['TenderType'].'" />'; if ($_POST['TenderType']==1) { - echo '<br /><div class="centre"><input type="submit" name="Update" value="Update offer">'; - echo '<input type="submit" name="Refresh" value="Refresh screen"></div>'; + echo '<br /><div class="centre"><input type="submit" name="Update" value="Update offer" />'; + echo '<input type="submit" name="Refresh" value="Refresh screen" /></div>'; } else if ($_POST['TenderType']==2) { echo '<br /><div class="centre"><input type="submit" name="Save" value="Save offer">'; - echo '<input type="submit" name="Refresh" value="Refresh screen"></div>'; + echo '<input type="submit" name="Refresh" value="Refresh screen" /></div>'; } echo '</form>'; } @@ -308,74 +345,175 @@ */ if (isset($_POST['TenderType']) and $_POST['TenderType']==2 and !isset($_POST['Search']) or isset($_GET['Delete'])) { if (!isset($_SESSION['offer'])) { - $_SESSION['offer']=new Offer(); - $_SESSION['offer']->SupplierID=$_POST['SupplierID']; + $_SESSION['offer']=new Offer($_POST['SupplierID']); } echo '<form action="' . htmlspecialchars($_SERVER['PHP_SELF']) . '" method="post">'; echo '<input type="hidden" name="FormID" value="' . $_SESSION['FormID'] . '" />'; - echo '<p class="page_title_text"><img src="' . $rootpath . '/css/' . $theme . '/images/magnifier.png" title="' . - _('Search') . '" alt="" />' . ' ' . _('Search for Inventory Items') . '</p>'; - - $sql = 'SELECT categoryid, + echo '<p class="page_title_text"><img src="' . $rootpath . '/css/' . $theme . '/images/magnifier.png" title="' . _('Search') . '" alt="" />' . ' ' . _('Search for Inventory Items') . '</p>'; + + $sql = "SELECT categoryid, categorydescription FROM stockcategory - ORDER BY categorydescription'; + ORDER BY categorydescription"; $result = DB_query($sql, $db); - + if (DB_num_rows($result) == 0) { - echo '<p><font size=4 color=red>' . _('Problem Report') . ':</font><br />' . + echo '<p><font size="4" color="red">' . _('Problem Report') . ':</font><br />' . _('There are no stock categories currently defined please use the link below to set them up'); - echo '<br /><a href="' . $rootpath . '/StockCategories.php">' . _('Define Stock Categories') . '</a>'; + echo '<br /><a href="' . $rootpath . '/StockCategories.php">' . _('Define Stock Categories') . '</a></p>'; exit; } - echo '<table class=selection><tr>'; + echo '<table class="selection"><tr>'; echo '<td>' . _('In Stock Category') . ':'; echo '<select name="StockCat">'; if (!isset($_POST['StockCat'])) { $_POST['StockCat'] = ''; } if ($_POST['StockCat'] == 'All') { - echo '<option selected value="All">' . _('All'); + echo '<option selected="True" value="All">' . _('All') . '</option>'; } else { - echo '<option value="All">' . _('All'); + echo '<option value="All">' . _('All') . '</option>'; } while ($myrow1 = DB_fetch_array($result)) { if ($myrow1['categoryid'] == $_POST['StockCat']) { - echo '<option selected VALUE="' . $myrow1['categoryid'] . '">' . $myrow1['categorydescription']; + echo '<option selected="True" value="' . $myrow1['categoryid'] . '">' . $myrow1['categorydescription'] . '</option>'; } else { - echo '<option value="' . $myrow1['categoryid'] . '">' . $myrow1['categorydescription']; + echo '<option value="' . $myrow1['categoryid'] . '">' . $myrow1['categorydescription'] . '</option>'; } } echo '</select>'; echo '<td>' . _('Enter partial') . '<b> ' . _('Description') . '</b>:</td><td>'; if (isset($_POST['Keywords'])) { - echo '<input type="text" name="Keywords" value="' . $_POST['Keywords'] . '" size="20" maxlength="25">'; + echo '<input type="text" name="Keywords" value="' . $_POST['Keywords'] . '" size="20" maxlength="25" />'; } else { - echo '<input type="text" name="Keywords" size="20" maxlength="25">'; + echo '<input type="text" name="Keywords" size="20" maxlength="25" />'; } - echo '<input type="hidden" name="TenderType" value='.$_POST['TenderType'].'>'; - echo '<input type="hidden" name="SupplierID" value='.$_POST['SupplierID'].'>'; + echo '<input type="hidden" name="TenderType" value="'.$_POST['TenderType'].'" />'; + echo '<input type="hidden" name="SupplierID" value="'.$_POST['SupplierID'].'" />'; echo '</td></tr><tr><td></td>'; - echo '<td><font size 3><b>' . _('OR') . ' ' . '</b></font>' . _('Enter partial') . ' <b>' . _('Stock Code') . '</b>:</td>'; + echo '<td><font size="3"><b>' . _('OR') . ' ' . '</b></font>' . _('Enter partial') . ' <b>' . _('Stock Code') . '</b>:</td>'; echo '<td>'; if (isset($_POST['StockCode'])) { - echo '<input type="text" name="StockCode" value="' . $_POST['StockCode'] . '" size="15" maxlength="18">'; + echo '<input type="text" name="StockCode" value="' . $_POST['StockCode'] . '" size="15" maxlength="18" />'; } else { - echo '<input type="text" name="StockCode" size="15" maxlength="18">'; + echo '<input type="text" name="StockCode" size="15" maxlength="18" />'; } echo '</td></tr></table><br />'; - echo '<div class="centre"><input type=submit name="Search" value="' . _('Search Now') . '"></div><br /></form>'; + echo '<div class="centre"><input type="submit" name="Search" value="' . _('Search Now') . '" /></div><br /></form>'; echo '<script type="text/javascript">defaultControl(document.forms[0].StockCode);</script>'; echo '</form>'; } +/*The supplier has chosen option 3 + */ +if (isset($_POST['TenderType']) and $_POST['TenderType']==3 and !isset($_POST['Search']) or isset($_GET['Delete'])) { + echo '<p class="page_title_text"><img src="' . $rootpath . '/css/' . $theme . '/images/supplier.png" title="' . _('Tenders') . '" alt="" />' . ' ' . _('Tenders Waiting For Offers').'</p>'; + $sql="SELECT DISTINCT tendersuppliers.tenderid, + suppliers.currcode + FROM tendersuppliers + LEFT JOIN suppliers + ON suppliers.supplierid=tendersuppliers.supplierid + LEFT JOIN tenders + ON tenders.tenderid=tendersuppliers.tenderid + WHERE tendersuppliers.supplierid='" . $_POST['SupplierID'] . "' + AND tenders.closed=0 + AND tendersuppliers.responded=0 + ORDER BY tendersuppliers.tenderid"; + $result=DB_query($sql, $db); + echo '<table class="selection">'; + echo '<tr><th colspan="13"><font size="3" color="#616161">' . _('Outstanding Tenders Waiting For Offer') . '</font></th></tr>'; + while ($myrow=DB_fetch_row($result)) { + echo '<form action="' . $_SERVER['PHP_SELF'] . '" method="post">'; + echo '<input type="hidden" name="FormID" value="' . $_SESSION['FormID'] . '" />'; + echo '<input type="hidden" name="TenderType" value="3" />'; + $LocationSQL="SELECT tenderid, + locations.locationname, + address1, + address2, + address3, + address4, + address5, + address6, + telephone + FROM tenders + LEFT JOIN locations + ON tenders.location=locations.loccode + WHERE closed=0 + AND tenderid='".$myrow[0]."'"; + $LocationResult=DB_query($LocationSQL, $db); + $MyLocationRow=DB_fetch_row($LocationResult); + echo '<tr><td valign="top" style="background-color:#cccce5">' . _('Deliver To') . ':</td><td valign="top" style="background-color:#cccce5">'; + for ($i=1; $i<8; $i++) { + if ($MyLocationRow[$i]!='') { + echo $MyLocationRow[$i] . '<br />'; + } + } + echo '</td>'; + echo '<th colspan="8" style="vertical-align:top"><font size="2" color="#616161">' . _('Tender Number') . ': ' .$myrow[0] . '</font></th>'; + echo '<input type="hidden" value="' . $myrow[0] . '" name="Tender" />'; + echo '<th><input type="submit" value="' . _('Process') . "\n" . _('Tender') . '" name="Process" /></th></tr>'; + $ItemSQL="SELECT tenderitems.tenderid, + tenderitems.stockid, + stockmaster.description, + stockmaster.decimalplaces, + purchdata.suppliers_partno, + tenderitems.quantity, + tenderitems.units, + tenders.requiredbydate, + purchdata.suppliersuom + FROM tenderitems + LEFT JOIN stockmaster + ON tenderitems.stockid=stockmaster.stockid + LEFT JOIN purchdata + ON tenderitems.stockid=purchdata.stockid + AND purchdata.supplierno='".$_POST['SupplierID']."' + LEFT JOIN tenders + ON tenders.tenderid=tenderitems.tenderid + WHERE tenderitems.tenderid='" . $myrow[0] . "'"; + $ItemResult=DB_query($ItemSQL, $db); + echo '<tr><th>' . stripslashes($_SESSION['CompanyRecord']['coyname']) . '<br />' . _('Item Code') . '</th>'; + echo '<th>' . _('Item Description') . '</th>'; + echo '<th>' . $Supplier . '<br />' . _('Item Code') . '</th>'; + echo '<th>' . _('Quantity') . '<br />' . _('Required') . '</th>'; + echo '<th>' . stripslashes($_SESSION['CompanyRecord']['coyname']) . '<br />' . _('Units of Measure') . '</th>'; + echo '<th>' . _('Required By') . '</th>'; + echo '<th>' . _('Quantity') . '<br />' . _('Offered') . '</th>'; + echo '<th>' . $Supplier . '<br />' . _('Units of Measure') . '</th>'; + echo '<th>' . _('Currency') . '</th>'; + echo '<th>' . $Supplier . '<br />' . _('Price') . '</th>'; + echo '<th>' . _('Delivery By') . '</th>'; + $i=0; + while ($MyItemRow=DB_fetch_array($ItemResult)) { + echo '<tr><td>' . $MyItemRow['stockid'] . '</td>'; + echo '<td>' . $MyItemRow['description'] . '</td>'; + echo '<input type="hidden" name="StockID'. $i . '" value="' . $MyItemRow['stockid'] . '" />'; + echo '<input type="hidden" name="ItemDescription'. $i . '" value="' . $MyItemRow['description'] . '" />'; + echo '<td>' . $MyItemRow['suppliers_partno'] . '</td>'; + echo '<td class="number">' . locale_number_format($MyItemRow['quantity'], $MyItemRow['decimalplaces']) . '</td>'; + echo '<td>' . $MyItemRow['units'] . '</td>'; + echo '<td>' . ConvertSQLDate($MyItemRow['requiredbydate']) . '</td>'; + if ($MyItemRow['suppliersuom']=='') { + $MyItemRow['suppliersuom']=$MyItemRow['units']; + } + echo '<td><input type="text" class="number" size="10" name="Qty'. $i . '" value="' . locale_number_format($MyItemRow['quantity'], $MyItemRow['decimalplaces']) . '" /></td>'; + echo '<input type="hidden" name="UOM'. $i . '" value="' . $MyItemRow['units'] . '" />'; + echo '<input type="hidden" name="DecimalPlaces'. $i . '" value="' . $MyItemRow['decimalplaces'] . '" />'; + echo '<td>' . $MyItemRow['suppliersuom'] . '</td>'; + echo '<td>' . $myrow[1] . '</td>'; + echo '<td><input type="text" class="number" size="10" name="Price'. $i . '" value="0.00" /></td>'; + echo '<td><input type="text" class="date" alt="' .$_SESSION['DefaultDateFormat'] .'" name="RequiredByDate'. $i . '" size="11" value="' . ConvertSQLDate($MyItemRow['requiredbydate']) . '" /></td>'; + } + echo '</form>'; + } + echo '</table>'; +} + if (isset($_POST['Search'])){ /*ie seach for stock items */ echo '<form method="post" action="' . htmlspecialchars($_SERVER['PHP_SELF']) . '">'; echo '<input type="hidden" name="FormID" value="' . $_SESSION['FormID'] . '" />'; - echo '<p class="page_title_text"><img src="' . $rootpath . '/css/' . $theme . '/images/supplier.png" title="' . - _('Tenders') . '" alt="" />' . ' ' . _('Select items to offer from').' '.$Supplier .'</p>'; + echo '<p class="page_title_text"><img src="' . $rootpath . '/css/' . $theme . '/images/supplier.png" title="' . _('Tenders') . '" alt="" />' . ' ' . _('Select items to offer from').' '.$Supplier .'</p>'; - if ($_POST['Keywords'] AND $_POST['StockCode']) { + if ($_POST['Keywords'] and $_POST['StockCode']) { prnMsg( _('Stock description keywords have been used in preference to the Stock code extract entered'), 'info' ); } if ($_POST['Keywords']) { @@ -471,7 +609,7 @@ $DbgMsg = _('The SQL statement that failed was'); $SearchResult = DB_query($sql,$db,$ErrMsg,$DbgMsg); - if (DB_num_rows($SearchResult)==0 && $debug==1){ + if (DB_num_rows($SearchResult)==0 and $debug==1){ prnMsg( _('There are no products to display matching the criteria provided'),'warn'); } if (DB_num_rows($SearchResult)==1){ @@ -483,7 +621,7 @@ if (isset($SearchResult)) { - echo "<table cellpadding=1 colspan=7>"; + echo '<table cellpadding="1" colspan="7">'; $tableheader = '<tr> <th>' . _('Code') . '</th> @@ -495,8 +633,8 @@ </tr>'; echo $tableheader; - $j = 1; - $k=0; //row colour counter + $i = 0; + $k = 0; //row colour counter $PartsDisplayed=0; while ($myrow=DB_fetch_array($SearchResult)) { @@ -511,8 +649,7 @@ $filename = $myrow['stockid'] . '.jpg'; if (file_exists( $_SESSION['part_pics_dir'] . '/' . $filename) ) { - $ImageSource = '<img src="'.$rootpath . '/' . $_SESSION['part_pics_dir'] . '/' . $myrow['stockid'] . - '.jpg" width="50" height="50">'; + $ImageSource = '<img src="'.$rootpath . '/' . $_SESSION['part_pics_dir'] . '/' . $myrow['stockid'] . '.jpg" width="50" height="50" />'; } else { $ImageSource = '<i>'._('No Image').'</i>'; @@ -525,7 +662,7 @@ LEFT JOIN unitsofmeasure ON purchdata.suppliersuom=unitsofmeasure.unitid WHERE supplierno='".$_POST['SupplierID']."' - AND stockid='" . $myrow['stockid']. "'"; + AND stockid='" . $myrow['stockid'] . "'"; $uomresult=DB_query($uomsql, $db); if (DB_num_rows($uomresult)... [truncated message content] |
From: <dai...@us...> - 2012-01-20 08:19:43
|
Revision: 4820 http://web-erp.svn.sourceforge.net/web-erp/?rev=4820&view=rev Author: daintree Date: 2012-01-20 08:19:32 +0000 (Fri, 20 Jan 2012) Log Message: ----------- missing sql file Added Paths: ----------- trunk/sql/mysql/upgrade3.08-3.09.sql Added: trunk/sql/mysql/upgrade3.08-3.09.sql =================================================================== --- trunk/sql/mysql/upgrade3.08-3.09.sql (rev 0) +++ trunk/sql/mysql/upgrade3.08-3.09.sql 2012-01-20 08:19:32 UTC (rev 4820) @@ -0,0 +1,63 @@ +CREATE TABLE `audittrail` ( + `transactiondate` datetime NOT NULL default '0000-00-00', + `userid` varchar(20) NOT NULL default '', + `querystring` text, + KEY `UserID` (`userid`), + CONSTRAINT `audittrail_ibfk_1` FOREIGN KEY (`userid`) REFERENCES `www_users` (`userid`) +) ENGINE=InnoDB; + +ALTER TABLE `salesorders` CHANGE `contactemail` `contactemail` VARCHAR( 40 ) DEFAULT NULL; +INSERT INTO `config` ( `confname` , `confvalue` ) VALUES ('MonthsAuditTrail', '1'); + +CREATE TABLE `factorcompanies` ( + `id` int(11) NOT NULL auto_increment, + `coyname` varchar(50) NOT NULL default '', + `address1` varchar(40) NOT NULL default '', + `address2` varchar(40) NOT NULL default '', + `address3` varchar(40) NOT NULL default '', + `address4` varchar(40) NOT NULL default '', + `address5` varchar(20) NOT NULL default '', + `address6` varchar(15) NOT NULL default '', + `contact` varchar(25) NOT NULL default '', + `telephone` varchar(25) NOT NULL default '', + `fax` varchar(25) NOT NULL default '', + `email` varchar(55) NOT NULL default '', + PRIMARY KEY (`id`) +) ENGINE=InnoDB; + +INSERT INTO `factorcompanies` ( `id` , `coyname` ) VALUES (null, 'None'); + +ALTER TABLE `suppliers` ADD COLUMN `factorcompanyid` int(11) NOT NULL default 1 AFTER `taxgroupid`; +ALTER TABLE `suppliers` ADD CONSTRAINT `suppliers_ibfk_4` FOREIGN KEY (`factorcompanyid`) REFERENCES `factorcompanies` (`id`); + +ALTER TABLE `stockmaster` ADD COLUMN `perishable` tinyint(1) NOT NULL default 0 AFTER `serialised`; +ALTER TABLE `stockmaster` ADD COLUMN `appendfile` varchar(40) NOT NULL default 'none' AFTER `serialised`; +ALTER TABLE `stockserialitems` ADD COLUMN `expirationdate` datetime NOT NULL default '0000-00-00' AFTER `serialno`; +ALTER TABLE `bankaccounts` ADD COLUMN `currcode` CHAR( 3 ) NOT NULL AFTER `accountcode` ; +ALTER TABLE `bankaccounts` ADD INDEX ( `currcode` ) ; +ALTER TABLE `banktrans` CHANGE `exrate` `exrate` DOUBLE NOT NULL DEFAULT '1' COMMENT 'From bank account currency to payment currency'; +ALTER TABLE `banktrans` ADD `functionalexrate` DOUBLE NOT NULL DEFAULT '1' COMMENT 'Account currency to functional currency'; +ALTER TABLE `worequirements` DROP FOREIGN KEY `worequirements_ibfk_3`; +ALTER TABLE `worequirements` Add CONSTRAINT `worequirements_ibfk_3` FOREIGN KEY (`wo`, `parentstockid`) REFERENCES `woitems` (`wo`, `stockid`); + +INSERT INTO `config` VALUES ('ProhibitNegativeStock','1'); +INSERT INTO `systypes` (`typeid` ,`typename` ,`typeno`) VALUES ('36', 'Exchange Difference', '1'); +INSERT INTO `systypes` (`typeid` ,`typename` ,`typeno`) VALUES ('40', 'Work Order', '1'); +INSERT INTO `config` (`confname`, `confvalue`) VALUES ('UpdateCurrencyRatesDaily', '0'); + +UPDATE systypes SET typeno=(SELECT max(orderno) FROM salesorders) WHERE typeid=30; +UPDATE systypes SET typeno=(SELECT max(orderno) FROM purchorders) WHERE typeid=18; +UPDATE systypes SET typeno=(SELECT max(wo) FROM workorders) WHERE typeid=40; + +CREATE TABLE `assetmanager` ( + `id` int(11) NOT NULL auto_increment, + `serialno` varchar(30) NOT NULL default '', + `assetglcode` int(11) NOT NULL default '0', + `depnglcode` int(11) NOT NULL default '0', + `description` varchar(30) NOT NULL default '', + `lifetime` int(11) NOT NULL default 0, + `location` varchar(15) NOT NULL default '', + `cost` double NOT NULL default 0.0, + `depn` double NOT NULL default 0.0, + PRIMARY KEY (`id`) +) ENGINE=InnoDB; \ 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...> - 2012-01-20 08:19:39
|
Revision: 4820 http://web-erp.svn.sourceforge.net/web-erp/?rev=4820&view=rev Author: daintree Date: 2012-01-20 08:19:32 +0000 (Fri, 20 Jan 2012) Log Message: ----------- missing sql file Added Paths: ----------- trunk/sql/mysql/upgrade3.08-3.09.sql Added: trunk/sql/mysql/upgrade3.08-3.09.sql =================================================================== --- trunk/sql/mysql/upgrade3.08-3.09.sql (rev 0) +++ trunk/sql/mysql/upgrade3.08-3.09.sql 2012-01-20 08:19:32 UTC (rev 4820) @@ -0,0 +1,63 @@ +CREATE TABLE `audittrail` ( + `transactiondate` datetime NOT NULL default '0000-00-00', + `userid` varchar(20) NOT NULL default '', + `querystring` text, + KEY `UserID` (`userid`), + CONSTRAINT `audittrail_ibfk_1` FOREIGN KEY (`userid`) REFERENCES `www_users` (`userid`) +) ENGINE=InnoDB; + +ALTER TABLE `salesorders` CHANGE `contactemail` `contactemail` VARCHAR( 40 ) DEFAULT NULL; +INSERT INTO `config` ( `confname` , `confvalue` ) VALUES ('MonthsAuditTrail', '1'); + +CREATE TABLE `factorcompanies` ( + `id` int(11) NOT NULL auto_increment, + `coyname` varchar(50) NOT NULL default '', + `address1` varchar(40) NOT NULL default '', + `address2` varchar(40) NOT NULL default '', + `address3` varchar(40) NOT NULL default '', + `address4` varchar(40) NOT NULL default '', + `address5` varchar(20) NOT NULL default '', + `address6` varchar(15) NOT NULL default '', + `contact` varchar(25) NOT NULL default '', + `telephone` varchar(25) NOT NULL default '', + `fax` varchar(25) NOT NULL default '', + `email` varchar(55) NOT NULL default '', + PRIMARY KEY (`id`) +) ENGINE=InnoDB; + +INSERT INTO `factorcompanies` ( `id` , `coyname` ) VALUES (null, 'None'); + +ALTER TABLE `suppliers` ADD COLUMN `factorcompanyid` int(11) NOT NULL default 1 AFTER `taxgroupid`; +ALTER TABLE `suppliers` ADD CONSTRAINT `suppliers_ibfk_4` FOREIGN KEY (`factorcompanyid`) REFERENCES `factorcompanies` (`id`); + +ALTER TABLE `stockmaster` ADD COLUMN `perishable` tinyint(1) NOT NULL default 0 AFTER `serialised`; +ALTER TABLE `stockmaster` ADD COLUMN `appendfile` varchar(40) NOT NULL default 'none' AFTER `serialised`; +ALTER TABLE `stockserialitems` ADD COLUMN `expirationdate` datetime NOT NULL default '0000-00-00' AFTER `serialno`; +ALTER TABLE `bankaccounts` ADD COLUMN `currcode` CHAR( 3 ) NOT NULL AFTER `accountcode` ; +ALTER TABLE `bankaccounts` ADD INDEX ( `currcode` ) ; +ALTER TABLE `banktrans` CHANGE `exrate` `exrate` DOUBLE NOT NULL DEFAULT '1' COMMENT 'From bank account currency to payment currency'; +ALTER TABLE `banktrans` ADD `functionalexrate` DOUBLE NOT NULL DEFAULT '1' COMMENT 'Account currency to functional currency'; +ALTER TABLE `worequirements` DROP FOREIGN KEY `worequirements_ibfk_3`; +ALTER TABLE `worequirements` Add CONSTRAINT `worequirements_ibfk_3` FOREIGN KEY (`wo`, `parentstockid`) REFERENCES `woitems` (`wo`, `stockid`); + +INSERT INTO `config` VALUES ('ProhibitNegativeStock','1'); +INSERT INTO `systypes` (`typeid` ,`typename` ,`typeno`) VALUES ('36', 'Exchange Difference', '1'); +INSERT INTO `systypes` (`typeid` ,`typename` ,`typeno`) VALUES ('40', 'Work Order', '1'); +INSERT INTO `config` (`confname`, `confvalue`) VALUES ('UpdateCurrencyRatesDaily', '0'); + +UPDATE systypes SET typeno=(SELECT max(orderno) FROM salesorders) WHERE typeid=30; +UPDATE systypes SET typeno=(SELECT max(orderno) FROM purchorders) WHERE typeid=18; +UPDATE systypes SET typeno=(SELECT max(wo) FROM workorders) WHERE typeid=40; + +CREATE TABLE `assetmanager` ( + `id` int(11) NOT NULL auto_increment, + `serialno` varchar(30) NOT NULL default '', + `assetglcode` int(11) NOT NULL default '0', + `depnglcode` int(11) NOT NULL default '0', + `description` varchar(30) NOT NULL default '', + `lifetime` int(11) NOT NULL default 0, + `location` varchar(15) NOT NULL default '', + `cost` double NOT NULL default 0.0, + `depn` double NOT NULL default 0.0, + PRIMARY KEY (`id`) +) ENGINE=InnoDB; \ 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...> - 2012-01-20 08:19:02
|
Revision: 4819 http://web-erp.svn.sourceforge.net/web-erp/?rev=4819&view=rev Author: daintree Date: 2012-01-20 08:18:50 +0000 (Fri, 20 Jan 2012) Log Message: ----------- various Modified Paths: -------------- trunk/CustomerInquiry.php trunk/Labels.php trunk/Prices.php trunk/doc/Change.log Modified: trunk/CustomerInquiry.php =================================================================== --- trunk/CustomerInquiry.php 2012-01-19 19:18:16 UTC (rev 4818) +++ trunk/CustomerInquiry.php 2012-01-20 08:18:50 UTC (rev 4819) @@ -123,9 +123,11 @@ } echo '<p class="page_title_text"> - <img src="'.$rootpath.'/css/'.$theme.'/images/customer.png" title="' . _('Customer') . '" alt="" />' . ' ' . _('Customer') . ' : ' . $CustomerRecord['name'] . ' - (' . _('All amounts stated in') . - ' ' . $CustomerRecord['currency'] . ')<br /><br />' . _('Terms') . ' : ' . $CustomerRecord['terms'] . '<br />' . _('Credit Limit') . - ': ' . locale_number_format($CustomerRecord['creditlimit'],0) . ' ' . _('Credit Status') . ': ' . $CustomerRecord['reasondescription'] . '</p>'; + <img src="'.$rootpath.'/css/'.$theme.'/images/customer.png" title="' . _('Customer') . '" alt="" /> ' . _('Customer') . ' : ' . $CustomerRecord['name'] . ' - (' . _('All amounts stated in') . ' ' . $CustomerRecord['currency'] . ') + <br /> + <br />' . _('Terms') . ' : ' . $CustomerRecord['terms'] . ' + <br />' . _('Credit Limit') . ': ' . locale_number_format($CustomerRecord['creditlimit'],0) . ' ' . _('Credit Status') . ': ' . $CustomerRecord['reasondescription'] . ' + </p>'; if ($CustomerRecord['dissallowinvoices']!=0){ echo '<br /><font color="red" size="4"><b>' . _('ACCOUNT ON HOLD') . '</font></b><br />'; @@ -253,7 +255,7 @@ <td><a href="%s/EmailCustTrans.php?FromTransNo=%s&InvOrCredit=Credit">' . _('Email') . ' <img src="%s/email.gif" title="' . _('Click to email the credit note') . '" /></a></td>'; /* assumed allowed page security token 3 allows the user to create credits for invoices */ - if (in_array(3,$_SESSION['AllowedPageSecurityTokens']) && $myrow['type']==10){ + if (in_array(3,$_SESSION['AllowedPageSecurityTokens']) AND $myrow['type']==10){ /*Show a link to allow an invoice to be credited */ /* assumed allowed page security token 8 allows the user to see GL transaction information */ Modified: trunk/Labels.php =================================================================== --- trunk/Labels.php 2012-01-19 19:18:16 UTC (rev 4818) +++ trunk/Labels.php 2012-01-20 08:18:50 UTC (rev 4819) @@ -41,11 +41,11 @@ */ if (isset($_POST['Update'])) { // Get the data from the user input & validate it (not new) - $label=getData($_POST, false, $ok); + $Label=getData($_POST, false, $ok); // If all OK try to update the requested label - if (!$ok OR !updateLabel($label)) { + if (!$ok OR !updateLabel($Label)) { // show the data label from the input data as update data (id read only)} - showLabel($label, _('Correct data'), $theme, false); + showLabel($Label, _('Correct data'), $theme, false); $showList=false; } @@ -54,9 +54,9 @@ */ } elseif (isset($_POST['Save'])) { // Get the data from the user input & validate it for new id - $label=getData($_POST, true, $ok); - if (!$ok OR !createLabel($label)) { // - showLabel($label, _('Correct data'), $theme, false); + $Label=getData($_POST, true, $ok); + if (!$ok OR !createLabel($Label)) { // + showLabel($Label, _('Correct data'), $theme, false); $showList=false; } @@ -64,17 +64,17 @@ * Get the data from an old one to create a new template? */ } elseif (isset($_POST['Copy'])) { - $label=$allLabels->getLabel($_POST['labelID']); - $label->id = _('New ID'); // Well, where did I get it? of course from the user, but .. - showLabel($label, _('Edit data new label'), $theme, false); + $Label=$allLabels->getLabel($_POST['labelID']); + $Label->id = _('New ID'); // Well, where did I get it? of course from the user, but .. + showLabel($Label, _('Edit data new label'), $theme, false); $showList=false; /** * Change some data from an old template? */ } elseif (isset($_POST['Edit'])) { - $label=$allLabels->getLabel($_POST['labelID']); - showLabel($label, _('Edit data label'), $theme, true); + $Label=$allLabels->getLabel($_POST['labelID']); + showLabel($Label, _('Edit data label'), $theme, true); $showList=false; /** @@ -247,14 +247,14 @@ * * It shows the data label from the input $data as update data (id read only) * if the third parameter is true or a fresh data label (new label). It is - * possible that the combination $data valid and $readonly false occurs when + * possible that the combination $data valid and $ReadOnly false occurs when * invalid data needs to be recaptured because an error in a new label capture. */ -function showLabel($label, $msg, $theme, $readonly=false) { +function showLabel($Label, $msg, $theme, $ReadOnly=false) { global $rootpath; - if ($label==null) - $label = newLabel(); - if ($readonly) { + if ($Label==null) + $Label = newLabel(); + if ($ReadOnly) { $name = 'Update'; $value = _('Update'); } else { @@ -264,8 +264,8 @@ $vCancel = _('Cancel'); - $tableGD = setTableGD($label, $readonly); - $tableLines = setTableLines($label->data->line); + $TableGD = setTableGD($Label, $ReadOnly); + $TableLines = setTableLines($Label->data->line); echo '<p class="page_title_text"><img src="'.$rootpath.'/css/'.$theme.'/images/maintenance.png" title="' . _('Search') . '" alt="" />' . ' ' . $msg.'</p>'; @@ -277,11 +277,11 @@ <tbody> <tr> <td align="center"><img src="'.$rootpath.'/css/paramsLabel.png" align="top" border="0" /></td> - <td>'.$tableGD.'</td> + <td>'.$TableGD.'</td> </tr> - <tr>/ + <tr> <td align="center"><IMG src="'.$rootpath.'/css/labelsDim.png" align="top" border="0" /></td> - <td>'.$tableLines.'</td> + <td>'.$TableLines.'</td> </tr> </tbody> </table> @@ -290,18 +290,17 @@ </form>'; } -function setTableGD($label, $readonly) { +function setTableGD($Label, $ReadOnly) { global $GlobalTags, $DimensionTags; - $html=' - <table border="0" cellspacing="1" class="selection">'; - $html .= setDataFields($GlobalTags, 0, $label, $specialTag='id', $readonly); - $html .= setDataFields($DimensionTags, 1, $label->dimensions); + $html='<table border="0" cellspacing="1" class="selection">'; + $html .= setDataFields($GlobalTags, 0, $Label, $specialTag='id', $ReadOnly); + $html .= setDataFields($DimensionTags, 1, $Label->dimensions); $html .= ' </table>'; return $html; } -function setDataFields($tags, $withTagId, $data, $specialTag=false, $readonly=false) { +function setDataFields($tags, $withTagId, $data, $specialTag=false, $ReadOnly=false) { $iCol=0; $html = ''; foreach ($tags as $iTag=>$tag) { @@ -317,7 +316,7 @@ </select>'; } else { $ro=''; - if ($readonly AND $specialTag==$iTag) + if ($ReadOnly AND $specialTag==$iTag) $ro='readonly '; $input = '<input type="text" name="'. $iTag .'" value="'. $vDat .'" size="'. $tag['sz'] .'" maxlength="'. $tag['maxsz'] .'"'. $ro .' />'; } @@ -440,15 +439,15 @@ </tr> </thead> <tbody>'; - foreach ($list as $label) { - $dim = (string)$label->dimensions->Rows. ' x '. (string)$label->dimensions->Cols; + foreach ($list as $Label) { + $dim = (string)$Label->dimensions->Rows. ' x '. (string)$Label->dimensions->Cols; echo ' - <tr><td>'. $label->id . '</td> - <td>'. $label->description . '</td> + <tr><td>'. $Label->id . '</td> + <td>'. $Label->description . '</td> <td><div class="centre">'. $dim . '</div></td> - <td><input type="submit" onclick="submitForm('. "'form1','Edit','". $label->id . "');" .'" value="' . $txt[4]. '" /> - <input type="submit" onclick="submitForm('. "'form1','Copy','". $label->id . "');" .'" value="' . $txt[5]. '" /> - <input type="submit" onclick="areYouSure('. "'form1','Delete','". $label->id . "');" .'" value="' . $txt[6]. '" /> + <td><input type="submit" onclick="submitForm('. "'form1','Edit','". $Label->id . "');" .'" value="' . $txt[4]. '" /> + <input type="submit" onclick="submitForm('. "'form1','Copy','". $Label->id . "');" .'" value="' . $txt[5]. '" /> + <input type="submit" onclick="areYouSure('. "'form1','Delete','". $Label->id . "');" .'" value="' . $txt[6]. '" /> </td> </tr>'; } @@ -463,24 +462,24 @@ * After the user gives the label data, this routine tries to insert * the new label in the current list. * -* @param $label The object label that will replace an old one +* @param $Label The object label that will replace an old one * @return True when the update was ok */ -function createLabel($label) { +function createLabel($Label) { global $allLabels; $new = emptyList(); $done=false; if ($allLabels!=null) { foreach ($allLabels as $oldLabel) { - if (!$done AND (string)$oldLabel->id >= (string)$label->id) { - $new->addLabel($label); + if (!$done AND (string)$oldLabel->id >= (string)$Label->id) { + $new->addLabel($Label); $done=true; } $new->addLabel($oldLabel); // inser data in the list, replacing the old one } } if (!$done) - $new->addLabel($label); + $new->addLabel($Label); $allLabels = $new; rewrite($allLabels); // rewrite it to the XML file return true; @@ -493,15 +492,15 @@ * If the label with the id of the new one is found, the object could * be accepted in the list and written to the XML file. * -* @param $label The object label that will replace an old one +* @param $Label The object label that will replace an old one * @return True when the update was ok */ -function updateLabel($label) { +function updateLabel($Label) { global $allLabels; $new = emptyList(); foreach ($allLabels as $oldLabel) { - if ((string)$oldLabel->id == (string)$label->id) - $new->addLabel($label); + if ((string)$oldLabel->id == (string)$Label->id) + $new->addLabel($Label); else $new->addLabel($oldLabel); // inser data in the list, replacing the old one } @@ -518,15 +517,15 @@ * correct data, it would be unsual that some error exist, but it is * included the code for the validation of some this strange case. * - * @param $labelID is the identifier of the label to delete. + * @param $LabelID is the identifier of the label to delete. * @see $allLabels * @return true in case of success */ -function deleteLabel($list, $labelID) { +function deleteLabel($list, $LabelID) { $new = emptyList(); - foreach ($list as $label) { - if ((string)$label->id!=$labelID) - $new->addLabel($label); + foreach ($list as $Label) { + if ((string)$Label->id!=$LabelID) + $new->addLabel($Label); } rewrite($new); return $new; Modified: trunk/Prices.php =================================================================== --- trunk/Prices.php 2012-01-19 19:18:16 UTC (rev 4818) +++ trunk/Prices.php 2012-01-20 08:18:50 UTC (rev 4819) @@ -373,17 +373,17 @@ $SQL = "SELECT price, startdate, enddate - FROM prices - WHERE debtorno='' - AND stockid='" . $Item . "' - AND currabrev='" . $CurrAbbrev . "' - AND typeabbrev='" . $PriceList . "' - AND enddate <>'0000-00-00' - ORDER BY startdate, enddate"; + FROM prices + WHERE debtorno='' + AND stockid='" . $Item . "' + AND currabrev='" . $CurrAbbrev . "' + AND typeabbrev='" . $PriceList . "' + AND enddate <>'0000-00-00' + ORDER BY startdate, enddate"; $result = DB_query($SQL,$db); - $NextStartDate = Date($_SESSION['DefaultDateFormat']); + unset($NextStartDate); unset($EndDate); - unset($NextStartDate); + while ($myrow = DB_fetch_array($result)){ if (isset($NextStartDate)){ if (Date1GreaterThanDate2(ConvertSQLDate($myrow['startdate']),$NextStartDate)){ Modified: trunk/doc/Change.log =================================================================== --- trunk/doc/Change.log 2012-01-19 19:18:16 UTC (rev 4818) +++ trunk/doc/Change.log 2012-01-20 08:18:50 UTC (rev 4819) @@ -1,6 +1,8 @@ webERP Change Log -19/1/12 Vitaly: Added missing ')' at the end of some INSERT statements. +20/1/12 Tim: xhtml fixes Labels.php TaxGroups.php GLCodesInquiry.php CustomerInquiry.php SalesByTypePeriodInquiry.php ContractBOM.php Shippers.php MRPPlannedWorkOrders.php +20/1/12 Tim: Added previously received quantity to stock transfer notes PDFStockLocTransfer.php +19/1/12 Vitaly: Added missing ')' at the end of some INSERT statements Stocks.php. 19/1/12 Phil: Check on deletion of a location to see if any purchase orders exist prior to deletion 19/1/12 Phil:StockCheck.php fixed error in SQL two ANDs in calculating quantity demand reported by Ricard 19/1/12 Paul Harness: SelectOrderItems.php $i++ - in code for frequently ordered items. This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <dai...@us...> - 2012-01-20 08:18:57
|
Revision: 4819 http://web-erp.svn.sourceforge.net/web-erp/?rev=4819&view=rev Author: daintree Date: 2012-01-20 08:18:50 +0000 (Fri, 20 Jan 2012) Log Message: ----------- various Modified Paths: -------------- trunk/CustomerInquiry.php trunk/Labels.php trunk/Prices.php trunk/doc/Change.log Modified: trunk/CustomerInquiry.php =================================================================== --- trunk/CustomerInquiry.php 2012-01-19 19:18:16 UTC (rev 4818) +++ trunk/CustomerInquiry.php 2012-01-20 08:18:50 UTC (rev 4819) @@ -123,9 +123,11 @@ } echo '<p class="page_title_text"> - <img src="'.$rootpath.'/css/'.$theme.'/images/customer.png" title="' . _('Customer') . '" alt="" />' . ' ' . _('Customer') . ' : ' . $CustomerRecord['name'] . ' - (' . _('All amounts stated in') . - ' ' . $CustomerRecord['currency'] . ')<br /><br />' . _('Terms') . ' : ' . $CustomerRecord['terms'] . '<br />' . _('Credit Limit') . - ': ' . locale_number_format($CustomerRecord['creditlimit'],0) . ' ' . _('Credit Status') . ': ' . $CustomerRecord['reasondescription'] . '</p>'; + <img src="'.$rootpath.'/css/'.$theme.'/images/customer.png" title="' . _('Customer') . '" alt="" /> ' . _('Customer') . ' : ' . $CustomerRecord['name'] . ' - (' . _('All amounts stated in') . ' ' . $CustomerRecord['currency'] . ') + <br /> + <br />' . _('Terms') . ' : ' . $CustomerRecord['terms'] . ' + <br />' . _('Credit Limit') . ': ' . locale_number_format($CustomerRecord['creditlimit'],0) . ' ' . _('Credit Status') . ': ' . $CustomerRecord['reasondescription'] . ' + </p>'; if ($CustomerRecord['dissallowinvoices']!=0){ echo '<br /><font color="red" size="4"><b>' . _('ACCOUNT ON HOLD') . '</font></b><br />'; @@ -253,7 +255,7 @@ <td><a href="%s/EmailCustTrans.php?FromTransNo=%s&InvOrCredit=Credit">' . _('Email') . ' <img src="%s/email.gif" title="' . _('Click to email the credit note') . '" /></a></td>'; /* assumed allowed page security token 3 allows the user to create credits for invoices */ - if (in_array(3,$_SESSION['AllowedPageSecurityTokens']) && $myrow['type']==10){ + if (in_array(3,$_SESSION['AllowedPageSecurityTokens']) AND $myrow['type']==10){ /*Show a link to allow an invoice to be credited */ /* assumed allowed page security token 8 allows the user to see GL transaction information */ Modified: trunk/Labels.php =================================================================== --- trunk/Labels.php 2012-01-19 19:18:16 UTC (rev 4818) +++ trunk/Labels.php 2012-01-20 08:18:50 UTC (rev 4819) @@ -41,11 +41,11 @@ */ if (isset($_POST['Update'])) { // Get the data from the user input & validate it (not new) - $label=getData($_POST, false, $ok); + $Label=getData($_POST, false, $ok); // If all OK try to update the requested label - if (!$ok OR !updateLabel($label)) { + if (!$ok OR !updateLabel($Label)) { // show the data label from the input data as update data (id read only)} - showLabel($label, _('Correct data'), $theme, false); + showLabel($Label, _('Correct data'), $theme, false); $showList=false; } @@ -54,9 +54,9 @@ */ } elseif (isset($_POST['Save'])) { // Get the data from the user input & validate it for new id - $label=getData($_POST, true, $ok); - if (!$ok OR !createLabel($label)) { // - showLabel($label, _('Correct data'), $theme, false); + $Label=getData($_POST, true, $ok); + if (!$ok OR !createLabel($Label)) { // + showLabel($Label, _('Correct data'), $theme, false); $showList=false; } @@ -64,17 +64,17 @@ * Get the data from an old one to create a new template? */ } elseif (isset($_POST['Copy'])) { - $label=$allLabels->getLabel($_POST['labelID']); - $label->id = _('New ID'); // Well, where did I get it? of course from the user, but .. - showLabel($label, _('Edit data new label'), $theme, false); + $Label=$allLabels->getLabel($_POST['labelID']); + $Label->id = _('New ID'); // Well, where did I get it? of course from the user, but .. + showLabel($Label, _('Edit data new label'), $theme, false); $showList=false; /** * Change some data from an old template? */ } elseif (isset($_POST['Edit'])) { - $label=$allLabels->getLabel($_POST['labelID']); - showLabel($label, _('Edit data label'), $theme, true); + $Label=$allLabels->getLabel($_POST['labelID']); + showLabel($Label, _('Edit data label'), $theme, true); $showList=false; /** @@ -247,14 +247,14 @@ * * It shows the data label from the input $data as update data (id read only) * if the third parameter is true or a fresh data label (new label). It is - * possible that the combination $data valid and $readonly false occurs when + * possible that the combination $data valid and $ReadOnly false occurs when * invalid data needs to be recaptured because an error in a new label capture. */ -function showLabel($label, $msg, $theme, $readonly=false) { +function showLabel($Label, $msg, $theme, $ReadOnly=false) { global $rootpath; - if ($label==null) - $label = newLabel(); - if ($readonly) { + if ($Label==null) + $Label = newLabel(); + if ($ReadOnly) { $name = 'Update'; $value = _('Update'); } else { @@ -264,8 +264,8 @@ $vCancel = _('Cancel'); - $tableGD = setTableGD($label, $readonly); - $tableLines = setTableLines($label->data->line); + $TableGD = setTableGD($Label, $ReadOnly); + $TableLines = setTableLines($Label->data->line); echo '<p class="page_title_text"><img src="'.$rootpath.'/css/'.$theme.'/images/maintenance.png" title="' . _('Search') . '" alt="" />' . ' ' . $msg.'</p>'; @@ -277,11 +277,11 @@ <tbody> <tr> <td align="center"><img src="'.$rootpath.'/css/paramsLabel.png" align="top" border="0" /></td> - <td>'.$tableGD.'</td> + <td>'.$TableGD.'</td> </tr> - <tr>/ + <tr> <td align="center"><IMG src="'.$rootpath.'/css/labelsDim.png" align="top" border="0" /></td> - <td>'.$tableLines.'</td> + <td>'.$TableLines.'</td> </tr> </tbody> </table> @@ -290,18 +290,17 @@ </form>'; } -function setTableGD($label, $readonly) { +function setTableGD($Label, $ReadOnly) { global $GlobalTags, $DimensionTags; - $html=' - <table border="0" cellspacing="1" class="selection">'; - $html .= setDataFields($GlobalTags, 0, $label, $specialTag='id', $readonly); - $html .= setDataFields($DimensionTags, 1, $label->dimensions); + $html='<table border="0" cellspacing="1" class="selection">'; + $html .= setDataFields($GlobalTags, 0, $Label, $specialTag='id', $ReadOnly); + $html .= setDataFields($DimensionTags, 1, $Label->dimensions); $html .= ' </table>'; return $html; } -function setDataFields($tags, $withTagId, $data, $specialTag=false, $readonly=false) { +function setDataFields($tags, $withTagId, $data, $specialTag=false, $ReadOnly=false) { $iCol=0; $html = ''; foreach ($tags as $iTag=>$tag) { @@ -317,7 +316,7 @@ </select>'; } else { $ro=''; - if ($readonly AND $specialTag==$iTag) + if ($ReadOnly AND $specialTag==$iTag) $ro='readonly '; $input = '<input type="text" name="'. $iTag .'" value="'. $vDat .'" size="'. $tag['sz'] .'" maxlength="'. $tag['maxsz'] .'"'. $ro .' />'; } @@ -440,15 +439,15 @@ </tr> </thead> <tbody>'; - foreach ($list as $label) { - $dim = (string)$label->dimensions->Rows. ' x '. (string)$label->dimensions->Cols; + foreach ($list as $Label) { + $dim = (string)$Label->dimensions->Rows. ' x '. (string)$Label->dimensions->Cols; echo ' - <tr><td>'. $label->id . '</td> - <td>'. $label->description . '</td> + <tr><td>'. $Label->id . '</td> + <td>'. $Label->description . '</td> <td><div class="centre">'. $dim . '</div></td> - <td><input type="submit" onclick="submitForm('. "'form1','Edit','". $label->id . "');" .'" value="' . $txt[4]. '" /> - <input type="submit" onclick="submitForm('. "'form1','Copy','". $label->id . "');" .'" value="' . $txt[5]. '" /> - <input type="submit" onclick="areYouSure('. "'form1','Delete','". $label->id . "');" .'" value="' . $txt[6]. '" /> + <td><input type="submit" onclick="submitForm('. "'form1','Edit','". $Label->id . "');" .'" value="' . $txt[4]. '" /> + <input type="submit" onclick="submitForm('. "'form1','Copy','". $Label->id . "');" .'" value="' . $txt[5]. '" /> + <input type="submit" onclick="areYouSure('. "'form1','Delete','". $Label->id . "');" .'" value="' . $txt[6]. '" /> </td> </tr>'; } @@ -463,24 +462,24 @@ * After the user gives the label data, this routine tries to insert * the new label in the current list. * -* @param $label The object label that will replace an old one +* @param $Label The object label that will replace an old one * @return True when the update was ok */ -function createLabel($label) { +function createLabel($Label) { global $allLabels; $new = emptyList(); $done=false; if ($allLabels!=null) { foreach ($allLabels as $oldLabel) { - if (!$done AND (string)$oldLabel->id >= (string)$label->id) { - $new->addLabel($label); + if (!$done AND (string)$oldLabel->id >= (string)$Label->id) { + $new->addLabel($Label); $done=true; } $new->addLabel($oldLabel); // inser data in the list, replacing the old one } } if (!$done) - $new->addLabel($label); + $new->addLabel($Label); $allLabels = $new; rewrite($allLabels); // rewrite it to the XML file return true; @@ -493,15 +492,15 @@ * If the label with the id of the new one is found, the object could * be accepted in the list and written to the XML file. * -* @param $label The object label that will replace an old one +* @param $Label The object label that will replace an old one * @return True when the update was ok */ -function updateLabel($label) { +function updateLabel($Label) { global $allLabels; $new = emptyList(); foreach ($allLabels as $oldLabel) { - if ((string)$oldLabel->id == (string)$label->id) - $new->addLabel($label); + if ((string)$oldLabel->id == (string)$Label->id) + $new->addLabel($Label); else $new->addLabel($oldLabel); // inser data in the list, replacing the old one } @@ -518,15 +517,15 @@ * correct data, it would be unsual that some error exist, but it is * included the code for the validation of some this strange case. * - * @param $labelID is the identifier of the label to delete. + * @param $LabelID is the identifier of the label to delete. * @see $allLabels * @return true in case of success */ -function deleteLabel($list, $labelID) { +function deleteLabel($list, $LabelID) { $new = emptyList(); - foreach ($list as $label) { - if ((string)$label->id!=$labelID) - $new->addLabel($label); + foreach ($list as $Label) { + if ((string)$Label->id!=$LabelID) + $new->addLabel($Label); } rewrite($new); return $new; Modified: trunk/Prices.php =================================================================== --- trunk/Prices.php 2012-01-19 19:18:16 UTC (rev 4818) +++ trunk/Prices.php 2012-01-20 08:18:50 UTC (rev 4819) @@ -373,17 +373,17 @@ $SQL = "SELECT price, startdate, enddate - FROM prices - WHERE debtorno='' - AND stockid='" . $Item . "' - AND currabrev='" . $CurrAbbrev . "' - AND typeabbrev='" . $PriceList . "' - AND enddate <>'0000-00-00' - ORDER BY startdate, enddate"; + FROM prices + WHERE debtorno='' + AND stockid='" . $Item . "' + AND currabrev='" . $CurrAbbrev . "' + AND typeabbrev='" . $PriceList . "' + AND enddate <>'0000-00-00' + ORDER BY startdate, enddate"; $result = DB_query($SQL,$db); - $NextStartDate = Date($_SESSION['DefaultDateFormat']); + unset($NextStartDate); unset($EndDate); - unset($NextStartDate); + while ($myrow = DB_fetch_array($result)){ if (isset($NextStartDate)){ if (Date1GreaterThanDate2(ConvertSQLDate($myrow['startdate']),$NextStartDate)){ Modified: trunk/doc/Change.log =================================================================== --- trunk/doc/Change.log 2012-01-19 19:18:16 UTC (rev 4818) +++ trunk/doc/Change.log 2012-01-20 08:18:50 UTC (rev 4819) @@ -1,6 +1,8 @@ webERP Change Log -19/1/12 Vitaly: Added missing ')' at the end of some INSERT statements. +20/1/12 Tim: xhtml fixes Labels.php TaxGroups.php GLCodesInquiry.php CustomerInquiry.php SalesByTypePeriodInquiry.php ContractBOM.php Shippers.php MRPPlannedWorkOrders.php +20/1/12 Tim: Added previously received quantity to stock transfer notes PDFStockLocTransfer.php +19/1/12 Vitaly: Added missing ')' at the end of some INSERT statements Stocks.php. 19/1/12 Phil: Check on deletion of a location to see if any purchase orders exist prior to deletion 19/1/12 Phil:StockCheck.php fixed error in SQL two ANDs in calculating quantity demand reported by Ricard 19/1/12 Paul Harness: SelectOrderItems.php $i++ - in code for frequently ordered items. This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <vv...@us...> - 2012-01-19 19:18:23
|
Revision: 4818 http://web-erp.svn.sourceforge.net/web-erp/?rev=4818&view=rev Author: vvs2012 Date: 2012-01-19 19:18:16 +0000 (Thu, 19 Jan 2012) Log Message: ----------- Added missing ')' at the end of some INSERT statements. Modified Paths: -------------- trunk/Stocks.php trunk/doc/Change.log Modified: trunk/Stocks.php =================================================================== --- trunk/Stocks.php 2012-01-19 13:30:22 UTC (rev 4817) +++ trunk/Stocks.php 2012-01-19 19:18:16 UTC (rev 4818) @@ -417,7 +417,7 @@ '" . GetPeriod(Date($_SESSION['DefaultDateFormat']),$db,true) . "', '" . $NewStockAccount . "', '" . $StockID . ' ' . _('Change stock category') . "', - '" . ($UnitCost* $StockQtyRow[0]) . "'"; + '" . ($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); @@ -434,7 +434,7 @@ '" . GetPeriod(Date($_SESSION['DefaultDateFormat']),$db,true) . "', '" . $OldStockAccount . "', '" . $StockID . ' ' . _('Change stock category') . "', - '" . (-$UnitCost* $StockQtyRow[0]) . "'"; + '" . (-$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 */ @@ -472,7 +472,7 @@ '" . GetPeriod(Date($_SESSION['DefaultDateFormat']),$db,true) . "', '" . $NewWIPAct . "', '" . $StockID . ' ' . _('Change stock category') . "', - '" . $WIPValue . "'"; + '" . $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); @@ -489,7 +489,7 @@ '" . GetPeriod(Date($_SESSION['DefaultDateFormat']),$db,true) . "', '" . $OldWIPAccount . "', '" . $StockID . ' ' . _('Change stock category') . "', - '" . (-$WIPValue) . "'"; + '" . (-$WIPValue) . "')"; $result = DB_query($SQL,$db, $ErrMsg, $DbgMsg,true); } } /* end if the stock category changed and forced a change in WIP account */ @@ -1207,4 +1207,4 @@ echo '</div> </form>'; include('includes/footer.inc'); -?> \ No newline at end of file +?> Modified: trunk/doc/Change.log =================================================================== --- trunk/doc/Change.log 2012-01-19 13:30:22 UTC (rev 4817) +++ trunk/doc/Change.log 2012-01-19 19:18:16 UTC (rev 4818) @@ -1,5 +1,6 @@ webERP Change Log +19/1/12 Vitaly: Added missing ')' at the end of some INSERT statements. 19/1/12 Phil: Check on deletion of a location to see if any purchase orders exist prior to deletion 19/1/12 Phil:StockCheck.php fixed error in SQL two ANDs in calculating quantity demand reported by Ricard 19/1/12 Paul Harness: SelectOrderItems.php $i++ - in code for frequently ordered items. This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <vv...@us...> - 2012-01-19 19:18:23
|
Revision: 4818 http://web-erp.svn.sourceforge.net/web-erp/?rev=4818&view=rev Author: vvs2012 Date: 2012-01-19 19:18:16 +0000 (Thu, 19 Jan 2012) Log Message: ----------- Added missing ')' at the end of some INSERT statements. Modified Paths: -------------- trunk/Stocks.php trunk/doc/Change.log Modified: trunk/Stocks.php =================================================================== --- trunk/Stocks.php 2012-01-19 13:30:22 UTC (rev 4817) +++ trunk/Stocks.php 2012-01-19 19:18:16 UTC (rev 4818) @@ -417,7 +417,7 @@ '" . GetPeriod(Date($_SESSION['DefaultDateFormat']),$db,true) . "', '" . $NewStockAccount . "', '" . $StockID . ' ' . _('Change stock category') . "', - '" . ($UnitCost* $StockQtyRow[0]) . "'"; + '" . ($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); @@ -434,7 +434,7 @@ '" . GetPeriod(Date($_SESSION['DefaultDateFormat']),$db,true) . "', '" . $OldStockAccount . "', '" . $StockID . ' ' . _('Change stock category') . "', - '" . (-$UnitCost* $StockQtyRow[0]) . "'"; + '" . (-$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 */ @@ -472,7 +472,7 @@ '" . GetPeriod(Date($_SESSION['DefaultDateFormat']),$db,true) . "', '" . $NewWIPAct . "', '" . $StockID . ' ' . _('Change stock category') . "', - '" . $WIPValue . "'"; + '" . $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); @@ -489,7 +489,7 @@ '" . GetPeriod(Date($_SESSION['DefaultDateFormat']),$db,true) . "', '" . $OldWIPAccount . "', '" . $StockID . ' ' . _('Change stock category') . "', - '" . (-$WIPValue) . "'"; + '" . (-$WIPValue) . "')"; $result = DB_query($SQL,$db, $ErrMsg, $DbgMsg,true); } } /* end if the stock category changed and forced a change in WIP account */ @@ -1207,4 +1207,4 @@ echo '</div> </form>'; include('includes/footer.inc'); -?> \ No newline at end of file +?> Modified: trunk/doc/Change.log =================================================================== --- trunk/doc/Change.log 2012-01-19 13:30:22 UTC (rev 4817) +++ trunk/doc/Change.log 2012-01-19 19:18:16 UTC (rev 4818) @@ -1,5 +1,6 @@ webERP Change Log +19/1/12 Vitaly: Added missing ')' at the end of some INSERT statements. 19/1/12 Phil: Check on deletion of a location to see if any purchase orders exist prior to deletion 19/1/12 Phil:StockCheck.php fixed error in SQL two ANDs in calculating quantity demand reported by Ricard 19/1/12 Paul Harness: SelectOrderItems.php $i++ - in code for frequently ordered items. This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <tim...@us...> - 2012-01-19 13:30:33
|
Revision: 4817 http://web-erp.svn.sourceforge.net/web-erp/?rev=4817&view=rev Author: tim_schofield Date: 2012-01-19 13:30:22 +0000 (Thu, 19 Jan 2012) Log Message: ----------- Merge Tims branch into trunk: Fix xhtml errors Modified Paths: -------------- trunk/CustomerInquiry.php Modified: trunk/CustomerInquiry.php =================================================================== --- trunk/CustomerInquiry.php 2012-01-19 13:16:07 UTC (rev 4816) +++ trunk/CustomerInquiry.php 2012-01-19 13:30:22 UTC (rev 4817) @@ -91,21 +91,21 @@ $NIL_BALANCE = True; - $SQL = "SELECT debtorsmaster.name, + $SQL = "SELECT debtorsmaster.name, currencies.currency, currencies.decimalplaces, paymentterms.terms, - debtorsmaster.creditlimit, - holdreasons.dissallowinvoices, + debtorsmaster.creditlimit, + holdreasons.dissallowinvoices, holdreasons.reasondescription FROM debtorsmaster INNER JOIN paymentterms ON debtorsmaster.paymentterms = paymentterms.termsindicator INNER JOIN holdreasons - ON debtorsmaster.holdreason = holdreasons.reasoncode - INNER JOIN currencies + ON debtorsmaster.holdreason = holdreasons.reasoncode + INNER JOIN currencies ON debtorsmaster.currcode = currencies.currabrev WHERE debtorsmaster.debtorno = '" . $CustomerID . "'"; - + $ErrMsg =_('The customer details could not be retrieved by the SQL because'); $CustomerResult = DB_query($SQL,$db,$ErrMsg); @@ -122,13 +122,13 @@ $CustomerRecord['overdue2']=0; } - echo '<p class="page_title_text"><img src="'.$rootpath.'/css/'.$theme.'/images/customer.png" title="' . - _('Customer') . '" alt="" />' . ' ' . _('Customer') . ' : ' . $CustomerRecord['name'] . ' - (' . _('All amounts stated in') . + echo '<p class="page_title_text"> + <img src="'.$rootpath.'/css/'.$theme.'/images/customer.png" title="' . _('Customer') . '" alt="" />' . ' ' . _('Customer') . ' : ' . $CustomerRecord['name'] . ' - (' . _('All amounts stated in') . ' ' . $CustomerRecord['currency'] . ')<br /><br />' . _('Terms') . ' : ' . $CustomerRecord['terms'] . '<br />' . _('Credit Limit') . ': ' . locale_number_format($CustomerRecord['creditlimit'],0) . ' ' . _('Credit Status') . ': ' . $CustomerRecord['reasondescription'] . '</p>'; if ($CustomerRecord['dissallowinvoices']!=0){ - echo '<br /><font color=RED size=4><b>' . _('ACCOUNT ON HOLD') . '</font></b><br />'; + echo '<br /><font color="red" size="4"><b>' . _('ACCOUNT ON HOLD') . '</font></b><br />'; } echo '<table class="selection" width="70%"> @@ -152,7 +152,7 @@ <div class="centre"> <form action="' . htmlspecialchars($_SERVER['PHP_SELF']) . '" method=post> <input type="hidden" name="FormID" value="' . $_SESSION['FormID'] . '" />' - . _('Show all transactions after') . ': <input tabindex=1 type="text" class="date" alt="' .$_SESSION['DefaultDateFormat']. '" id="datepicker" name="TransAfterDate" value="' . $_POST['TransAfterDate'] . '" maxlength="10" size="12" /> + . _('Show all transactions after') . ': <input tabindex="1" type="text" class="date" alt="' .$_SESSION['DefaultDateFormat']. '" id="datepicker" name="TransAfterDate" value="' . $_POST['TransAfterDate'] . '" maxlength="10" size="12" /> <input tabindex="2" type="submit" name="Refresh Inquiry" value="' . _('Refresh Inquiry') . '" /> </div> </form> @@ -223,13 +223,13 @@ } $FormatedTranDate = ConvertSQLDate($myrow['trandate']); - + if ($_SESSION['InvoicePortraitFormat']==1){ //Invoice/credits in portrait $PrintCustomerTransactionScript = 'PrintCustTransPortrait.php'; } else { //produce pdfs in landscape $PrintCustomerTransactionScript = 'PrintCustTrans.php'; } - + $BaseFormatString = '<td>%s</td> <td>%s</td> <td>%s</td> @@ -240,29 +240,30 @@ <td class="number">%s</td> <td class="number">%s</td> <td class="number">%s</td>'; - - $CreditInvoiceFormatString = '<td><a href="%s/Credit_Invoice.php?InvoiceNumber=%s">' . _('Credit ') .'<img src="%s/credit.gif" title="' . _('Click to credit the invoice') . '"></a></td>'; - - $PreviewInvoiceFormatString = '<td><a href="%s/PrintCustTrans.php?FromTransNo=%s&InvOrCredit=Invoice">' . _('HTML ') . '<img src="%s/preview.gif" title="' . _('Click to preview the invoice') . '"></a></td> - <td><a href="%s/%s?FromTransNo=%s&InvOrCredit=Invoice&PrintPDF=True">' . _('PDF ') . '<img src="%s/css/' . $theme . '/images/pdf.png" title="' . _('Click for PDF') . '"></a></td> - <td><a href="%s/EmailCustTrans.php?FromTransNo=%s&InvOrCredit=Invoice">' . _('Email ') . '<img src="%s/email.gif" title="' . _('Click to email the invoice') . '"></a></td>'; - - $PreviewCreditFormatString = '<td><a href="%s/PrintCustTrans.php?FromTransNo=%s&InvOrCredit=Credit">' . _('HTML ') . ' <IMG SRC="%s/preview.gif" title="' . _('Click to preview the credit note') . '"></a></td> - <td><a href="%s/%s?FromTransNo=%s&InvOrCredit=Credit&PrintPDF=True">' . _('PDF ') . '<img src="%s/css/' . $theme . '/images/pdf.png" title="' . _('Click for PDF') . '"></a></td> - <td><a href="%s/EmailCustTrans.php?FromTransNo=%s&InvOrCredit=Credit">' . _('Email') . ' <img src="%s/email.gif" title="' . _('Click to email the credit note') . '"></a></td>'; + $CreditInvoiceFormatString = '<td><a href="%s/Credit_Invoice.php?InvoiceNumber=%s">' . _('Credit ') .'<img src="%s/credit.gif" title="' . _('Click to credit the invoice') . '" /></a></td>'; + + $PreviewInvoiceFormatString = '<td><a href="%s/PrintCustTrans.php?FromTransNo=%s&InvOrCredit=Invoice">' . _('HTML ') . '<img src="%s/preview.gif" title="' . _('Click to preview the invoice') . '" /></a></td> + <td><a href="%s/%s?FromTransNo=%s&InvOrCredit=Invoice&PrintPDF=True">' . _('PDF ') . '<img src="%s/css/' . $theme . '/images/pdf.png" title="' . _('Click for PDF') . '" /></a></td> + <td><a href="%s/EmailCustTrans.php?FromTransNo=%s&InvOrCredit=Invoice">' . _('Email ') . '<img src="%s/email.gif" title="' . _('Click to email the invoice') . '" /></a></td>'; + + $PreviewCreditFormatString = '<td><a href="%s/PrintCustTrans.php?FromTransNo=%s&InvOrCredit=Credit">' . _('HTML ') . ' <IMG SRC="%s/preview.gif" title="' . _('Click to preview the credit note') . '" /></a></td> + <td><a href="%s/%s?FromTransNo=%s&InvOrCredit=Credit&PrintPDF=True">' . _('PDF ') . '<img src="%s/css/' . $theme . '/images/pdf.png" title="' . _('Click for PDF') . '" /></a></td> + <td><a href="%s/EmailCustTrans.php?FromTransNo=%s&InvOrCredit=Credit">' . _('Email') . ' <img src="%s/email.gif" title="' . _('Click to email the credit note') . '" /></a></td>'; + /* assumed allowed page security token 3 allows the user to create credits for invoices */ - if (in_array(3,$_SESSION['AllowedPageSecurityTokens']) && $myrow['type']==10){ + if (in_array(3,$_SESSION['AllowedPageSecurityTokens']) && $myrow['type']==10){ /*Show a link to allow an invoice to be credited */ /* assumed allowed page security token 8 allows the user to see GL transaction information */ if ($_SESSION['CompanyRecord']['gllink_debtors']== 1 AND in_array(8,$_SESSION['AllowedPageSecurityTokens'])){ - + /* format string with GL inquiry options and for invoice to be credited */ - + printf($BaseFormatString . $CreditInvoiceFormatString . $PreviewInvoiceFormatString . - '<td><a href="%s/GLTransInquiry.php?TypeID=%s&TransNo=%s">' . _('View GL Entries') . ' <img src="' .$rootpath. '/css/'.$theme.'/images/gl.png" title="' . _('View the GL Entries') . '"></a></td> + '<td><a href="%s/GLTransInquiry.php?TypeID=%s&TransNo=%s">' . _('View GL Entries') . ' + <img src="' .$rootpath. '/css/'.$theme.'/images/gl.png" title="' . _('View the GL Entries') . '" /></a></td> </tr>', //$BaseFormatString parameters $myrow['typename'], @@ -295,7 +296,7 @@ $myrow['type'], $myrow['transno']); } else { //user does not have privileges to see GL inquiry stuff - + printf($BaseFormatString . $CreditInvoiceFormatString . $PreviewInvoiceFormatString . '</tr>', //BaseFormatString parameters $myrow['typename'], @@ -357,8 +358,8 @@ if ($_SESSION['CompanyRecord']['gllink_debtors']== 1 AND in_array(8,$_SESSION['AllowedPageSecurityTokens'])){ printf($BaseFormatString . $PreviewCreditFormatString . - '<td><a href="%s/CustomerAllocations.php?AllocTrans=%s">' . _('Allocation') . '<img src="' .$rootpath .'/css/' . $theme .'/images/allocation.png" title="' . _('Click to allocate funds') . '"></a></td> - <td><a href="%s/GLTransInquiry.php?TypeID=%s&TransNo=%s">' . _('View GL Entries') . ' <a><img src="' .$rootpath.'/css/'.$theme.'/images/gl.png" title="' . _('View the GL Entries') . '"></a></td></tr>', + '<td><a href="%s/CustomerAllocations.php?AllocTrans=%s">' . _('Allocation') . '<img src="' .$rootpath .'/css/' . $theme .'/images/allocation.png" title="' . _('Click to allocate funds') . '" /></a></td> + <td><a href="%s/GLTransInquiry.php?TypeID=%s&TransNo=%s">' . _('View GL Entries') . ' <a><img src="' .$rootpath.'/css/'.$theme.'/images/gl.png" title="' . _('View the GL Entries') . '" /></a></td></tr>', //$BaseFormatString parameters $myrow['typename'], $myrow['transno'], @@ -390,7 +391,7 @@ } else { printf($BaseFormatString . $PreviewCreditFormatString . - '<td><a href="%s/CustomerAllocations.php?AllocTrans=%s">' . _('Allocation') . '<img src="%s/allocation.png" title="' . _('Click to allocate funds') . '"></a></td> + '<td><a href="%s/CustomerAllocations.php?AllocTrans=%s">' . _('Allocation') . '<img src="%s/allocation.png" title="' . _('Click to allocate funds') . '" /></a></td> </tr>', $myrow['typename'], $myrow['transno'], @@ -413,18 +414,18 @@ $rootpath, $myrow['transno'], $rootpath.'/css/'.$theme.'/images', - //Parameters for hand coded string to show allocations + //Parameters for hand coded string to show allocations $rootpath, $myrow['id'], $rootpath.'/css/'.$theme.'/images'); } } elseif ($myrow['type']==12 AND $myrow['totalamount']<0) { /*its a receipt which could have an allocation*/ - + //If security token 8 in the allowed page security tokens then assumed ok for GL trans inquiries if ($_SESSION['CompanyRecord']['gllink_debtors']== 1 AND in_array(8,$_SESSION['AllowedPageSecurityTokens'])){ printf($BaseFormatString . - '<td><a href="%s/CustomerAllocations.php?AllocTrans=%s">' . _('Allocation') . '<img src="' .$rootpath . '/css/' . $theme .'/images/allocation.png" title="' . _('Click to allocate funds') . '"></a></td> - <td><a href="%s/GLTransInquiry.php?TypeID=%s&TransNo=%s">' . _('View GL Entries') . ' <img src="' .$rootpath . '/css/' . $theme .'/images/gl.png" title="' . _('View the GL Entries') . '"></a></td> + '<td><a href="%s/CustomerAllocations.php?AllocTrans=%s">' . _('Allocation') . '<img src="' .$rootpath . '/css/' . $theme .'/images/allocation.png" title="' . _('Click to allocate funds') . '" /></a></td> + <td><a href="%s/GLTransInquiry.php?TypeID=%s&TransNo=%s">' . _('View GL Entries') . ' <img src="' .$rootpath . '/css/' . $theme .'/images/gl.png" title="' . _('View the GL Entries') . '" /></a></td> </tr>', $myrow['typename'], $myrow['transno'], @@ -443,7 +444,7 @@ $myrow['transno']); } else { //no permission for GLTrans Inquiries printf($BaseFormatString . - '<td><a href="%s/CustomerAllocations.php?AllocTrans=%s">' . _('Allocation') . '<img src="' .$rootpath . '/css/' . $theme .'/images/allocation.png" title="' . _('Click to allocate funds') . '"></a></td> + '<td><a href="%s/CustomerAllocations.php?AllocTrans=%s">' . _('Allocation') . '<img src="' .$rootpath . '/css/' . $theme .'/images/allocation.png" title="' . _('Click to allocate funds') . '" /></a></td> </tr>', $myrow['typename'], $myrow['transno'], @@ -459,7 +460,7 @@ $myrow['id']); } } elseif ($myrow['type']==12 AND $myrow['totalamount']>0) { /*its a negative receipt */ - + //If security token 8 in the allowed page security tokens then assumed ok for GL trans inquiries if ($_SESSION['CompanyRecord']['gllink_debtors']== 1 AND in_array(8,$_SESSION['AllowedPageSecurityTokens'])){ printf($BaseFormatString . This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <tim...@us...> - 2012-01-19 13:30:31
|
Revision: 4817 http://web-erp.svn.sourceforge.net/web-erp/?rev=4817&view=rev Author: tim_schofield Date: 2012-01-19 13:30:22 +0000 (Thu, 19 Jan 2012) Log Message: ----------- Merge Tims branch into trunk: Fix xhtml errors Modified Paths: -------------- trunk/CustomerInquiry.php Modified: trunk/CustomerInquiry.php =================================================================== --- trunk/CustomerInquiry.php 2012-01-19 13:16:07 UTC (rev 4816) +++ trunk/CustomerInquiry.php 2012-01-19 13:30:22 UTC (rev 4817) @@ -91,21 +91,21 @@ $NIL_BALANCE = True; - $SQL = "SELECT debtorsmaster.name, + $SQL = "SELECT debtorsmaster.name, currencies.currency, currencies.decimalplaces, paymentterms.terms, - debtorsmaster.creditlimit, - holdreasons.dissallowinvoices, + debtorsmaster.creditlimit, + holdreasons.dissallowinvoices, holdreasons.reasondescription FROM debtorsmaster INNER JOIN paymentterms ON debtorsmaster.paymentterms = paymentterms.termsindicator INNER JOIN holdreasons - ON debtorsmaster.holdreason = holdreasons.reasoncode - INNER JOIN currencies + ON debtorsmaster.holdreason = holdreasons.reasoncode + INNER JOIN currencies ON debtorsmaster.currcode = currencies.currabrev WHERE debtorsmaster.debtorno = '" . $CustomerID . "'"; - + $ErrMsg =_('The customer details could not be retrieved by the SQL because'); $CustomerResult = DB_query($SQL,$db,$ErrMsg); @@ -122,13 +122,13 @@ $CustomerRecord['overdue2']=0; } - echo '<p class="page_title_text"><img src="'.$rootpath.'/css/'.$theme.'/images/customer.png" title="' . - _('Customer') . '" alt="" />' . ' ' . _('Customer') . ' : ' . $CustomerRecord['name'] . ' - (' . _('All amounts stated in') . + echo '<p class="page_title_text"> + <img src="'.$rootpath.'/css/'.$theme.'/images/customer.png" title="' . _('Customer') . '" alt="" />' . ' ' . _('Customer') . ' : ' . $CustomerRecord['name'] . ' - (' . _('All amounts stated in') . ' ' . $CustomerRecord['currency'] . ')<br /><br />' . _('Terms') . ' : ' . $CustomerRecord['terms'] . '<br />' . _('Credit Limit') . ': ' . locale_number_format($CustomerRecord['creditlimit'],0) . ' ' . _('Credit Status') . ': ' . $CustomerRecord['reasondescription'] . '</p>'; if ($CustomerRecord['dissallowinvoices']!=0){ - echo '<br /><font color=RED size=4><b>' . _('ACCOUNT ON HOLD') . '</font></b><br />'; + echo '<br /><font color="red" size="4"><b>' . _('ACCOUNT ON HOLD') . '</font></b><br />'; } echo '<table class="selection" width="70%"> @@ -152,7 +152,7 @@ <div class="centre"> <form action="' . htmlspecialchars($_SERVER['PHP_SELF']) . '" method=post> <input type="hidden" name="FormID" value="' . $_SESSION['FormID'] . '" />' - . _('Show all transactions after') . ': <input tabindex=1 type="text" class="date" alt="' .$_SESSION['DefaultDateFormat']. '" id="datepicker" name="TransAfterDate" value="' . $_POST['TransAfterDate'] . '" maxlength="10" size="12" /> + . _('Show all transactions after') . ': <input tabindex="1" type="text" class="date" alt="' .$_SESSION['DefaultDateFormat']. '" id="datepicker" name="TransAfterDate" value="' . $_POST['TransAfterDate'] . '" maxlength="10" size="12" /> <input tabindex="2" type="submit" name="Refresh Inquiry" value="' . _('Refresh Inquiry') . '" /> </div> </form> @@ -223,13 +223,13 @@ } $FormatedTranDate = ConvertSQLDate($myrow['trandate']); - + if ($_SESSION['InvoicePortraitFormat']==1){ //Invoice/credits in portrait $PrintCustomerTransactionScript = 'PrintCustTransPortrait.php'; } else { //produce pdfs in landscape $PrintCustomerTransactionScript = 'PrintCustTrans.php'; } - + $BaseFormatString = '<td>%s</td> <td>%s</td> <td>%s</td> @@ -240,29 +240,30 @@ <td class="number">%s</td> <td class="number">%s</td> <td class="number">%s</td>'; - - $CreditInvoiceFormatString = '<td><a href="%s/Credit_Invoice.php?InvoiceNumber=%s">' . _('Credit ') .'<img src="%s/credit.gif" title="' . _('Click to credit the invoice') . '"></a></td>'; - - $PreviewInvoiceFormatString = '<td><a href="%s/PrintCustTrans.php?FromTransNo=%s&InvOrCredit=Invoice">' . _('HTML ') . '<img src="%s/preview.gif" title="' . _('Click to preview the invoice') . '"></a></td> - <td><a href="%s/%s?FromTransNo=%s&InvOrCredit=Invoice&PrintPDF=True">' . _('PDF ') . '<img src="%s/css/' . $theme . '/images/pdf.png" title="' . _('Click for PDF') . '"></a></td> - <td><a href="%s/EmailCustTrans.php?FromTransNo=%s&InvOrCredit=Invoice">' . _('Email ') . '<img src="%s/email.gif" title="' . _('Click to email the invoice') . '"></a></td>'; - - $PreviewCreditFormatString = '<td><a href="%s/PrintCustTrans.php?FromTransNo=%s&InvOrCredit=Credit">' . _('HTML ') . ' <IMG SRC="%s/preview.gif" title="' . _('Click to preview the credit note') . '"></a></td> - <td><a href="%s/%s?FromTransNo=%s&InvOrCredit=Credit&PrintPDF=True">' . _('PDF ') . '<img src="%s/css/' . $theme . '/images/pdf.png" title="' . _('Click for PDF') . '"></a></td> - <td><a href="%s/EmailCustTrans.php?FromTransNo=%s&InvOrCredit=Credit">' . _('Email') . ' <img src="%s/email.gif" title="' . _('Click to email the credit note') . '"></a></td>'; + $CreditInvoiceFormatString = '<td><a href="%s/Credit_Invoice.php?InvoiceNumber=%s">' . _('Credit ') .'<img src="%s/credit.gif" title="' . _('Click to credit the invoice') . '" /></a></td>'; + + $PreviewInvoiceFormatString = '<td><a href="%s/PrintCustTrans.php?FromTransNo=%s&InvOrCredit=Invoice">' . _('HTML ') . '<img src="%s/preview.gif" title="' . _('Click to preview the invoice') . '" /></a></td> + <td><a href="%s/%s?FromTransNo=%s&InvOrCredit=Invoice&PrintPDF=True">' . _('PDF ') . '<img src="%s/css/' . $theme . '/images/pdf.png" title="' . _('Click for PDF') . '" /></a></td> + <td><a href="%s/EmailCustTrans.php?FromTransNo=%s&InvOrCredit=Invoice">' . _('Email ') . '<img src="%s/email.gif" title="' . _('Click to email the invoice') . '" /></a></td>'; + + $PreviewCreditFormatString = '<td><a href="%s/PrintCustTrans.php?FromTransNo=%s&InvOrCredit=Credit">' . _('HTML ') . ' <IMG SRC="%s/preview.gif" title="' . _('Click to preview the credit note') . '" /></a></td> + <td><a href="%s/%s?FromTransNo=%s&InvOrCredit=Credit&PrintPDF=True">' . _('PDF ') . '<img src="%s/css/' . $theme . '/images/pdf.png" title="' . _('Click for PDF') . '" /></a></td> + <td><a href="%s/EmailCustTrans.php?FromTransNo=%s&InvOrCredit=Credit">' . _('Email') . ' <img src="%s/email.gif" title="' . _('Click to email the credit note') . '" /></a></td>'; + /* assumed allowed page security token 3 allows the user to create credits for invoices */ - if (in_array(3,$_SESSION['AllowedPageSecurityTokens']) && $myrow['type']==10){ + if (in_array(3,$_SESSION['AllowedPageSecurityTokens']) && $myrow['type']==10){ /*Show a link to allow an invoice to be credited */ /* assumed allowed page security token 8 allows the user to see GL transaction information */ if ($_SESSION['CompanyRecord']['gllink_debtors']== 1 AND in_array(8,$_SESSION['AllowedPageSecurityTokens'])){ - + /* format string with GL inquiry options and for invoice to be credited */ - + printf($BaseFormatString . $CreditInvoiceFormatString . $PreviewInvoiceFormatString . - '<td><a href="%s/GLTransInquiry.php?TypeID=%s&TransNo=%s">' . _('View GL Entries') . ' <img src="' .$rootpath. '/css/'.$theme.'/images/gl.png" title="' . _('View the GL Entries') . '"></a></td> + '<td><a href="%s/GLTransInquiry.php?TypeID=%s&TransNo=%s">' . _('View GL Entries') . ' + <img src="' .$rootpath. '/css/'.$theme.'/images/gl.png" title="' . _('View the GL Entries') . '" /></a></td> </tr>', //$BaseFormatString parameters $myrow['typename'], @@ -295,7 +296,7 @@ $myrow['type'], $myrow['transno']); } else { //user does not have privileges to see GL inquiry stuff - + printf($BaseFormatString . $CreditInvoiceFormatString . $PreviewInvoiceFormatString . '</tr>', //BaseFormatString parameters $myrow['typename'], @@ -357,8 +358,8 @@ if ($_SESSION['CompanyRecord']['gllink_debtors']== 1 AND in_array(8,$_SESSION['AllowedPageSecurityTokens'])){ printf($BaseFormatString . $PreviewCreditFormatString . - '<td><a href="%s/CustomerAllocations.php?AllocTrans=%s">' . _('Allocation') . '<img src="' .$rootpath .'/css/' . $theme .'/images/allocation.png" title="' . _('Click to allocate funds') . '"></a></td> - <td><a href="%s/GLTransInquiry.php?TypeID=%s&TransNo=%s">' . _('View GL Entries') . ' <a><img src="' .$rootpath.'/css/'.$theme.'/images/gl.png" title="' . _('View the GL Entries') . '"></a></td></tr>', + '<td><a href="%s/CustomerAllocations.php?AllocTrans=%s">' . _('Allocation') . '<img src="' .$rootpath .'/css/' . $theme .'/images/allocation.png" title="' . _('Click to allocate funds') . '" /></a></td> + <td><a href="%s/GLTransInquiry.php?TypeID=%s&TransNo=%s">' . _('View GL Entries') . ' <a><img src="' .$rootpath.'/css/'.$theme.'/images/gl.png" title="' . _('View the GL Entries') . '" /></a></td></tr>', //$BaseFormatString parameters $myrow['typename'], $myrow['transno'], @@ -390,7 +391,7 @@ } else { printf($BaseFormatString . $PreviewCreditFormatString . - '<td><a href="%s/CustomerAllocations.php?AllocTrans=%s">' . _('Allocation') . '<img src="%s/allocation.png" title="' . _('Click to allocate funds') . '"></a></td> + '<td><a href="%s/CustomerAllocations.php?AllocTrans=%s">' . _('Allocation') . '<img src="%s/allocation.png" title="' . _('Click to allocate funds') . '" /></a></td> </tr>', $myrow['typename'], $myrow['transno'], @@ -413,18 +414,18 @@ $rootpath, $myrow['transno'], $rootpath.'/css/'.$theme.'/images', - //Parameters for hand coded string to show allocations + //Parameters for hand coded string to show allocations $rootpath, $myrow['id'], $rootpath.'/css/'.$theme.'/images'); } } elseif ($myrow['type']==12 AND $myrow['totalamount']<0) { /*its a receipt which could have an allocation*/ - + //If security token 8 in the allowed page security tokens then assumed ok for GL trans inquiries if ($_SESSION['CompanyRecord']['gllink_debtors']== 1 AND in_array(8,$_SESSION['AllowedPageSecurityTokens'])){ printf($BaseFormatString . - '<td><a href="%s/CustomerAllocations.php?AllocTrans=%s">' . _('Allocation') . '<img src="' .$rootpath . '/css/' . $theme .'/images/allocation.png" title="' . _('Click to allocate funds') . '"></a></td> - <td><a href="%s/GLTransInquiry.php?TypeID=%s&TransNo=%s">' . _('View GL Entries') . ' <img src="' .$rootpath . '/css/' . $theme .'/images/gl.png" title="' . _('View the GL Entries') . '"></a></td> + '<td><a href="%s/CustomerAllocations.php?AllocTrans=%s">' . _('Allocation') . '<img src="' .$rootpath . '/css/' . $theme .'/images/allocation.png" title="' . _('Click to allocate funds') . '" /></a></td> + <td><a href="%s/GLTransInquiry.php?TypeID=%s&TransNo=%s">' . _('View GL Entries') . ' <img src="' .$rootpath . '/css/' . $theme .'/images/gl.png" title="' . _('View the GL Entries') . '" /></a></td> </tr>', $myrow['typename'], $myrow['transno'], @@ -443,7 +444,7 @@ $myrow['transno']); } else { //no permission for GLTrans Inquiries printf($BaseFormatString . - '<td><a href="%s/CustomerAllocations.php?AllocTrans=%s">' . _('Allocation') . '<img src="' .$rootpath . '/css/' . $theme .'/images/allocation.png" title="' . _('Click to allocate funds') . '"></a></td> + '<td><a href="%s/CustomerAllocations.php?AllocTrans=%s">' . _('Allocation') . '<img src="' .$rootpath . '/css/' . $theme .'/images/allocation.png" title="' . _('Click to allocate funds') . '" /></a></td> </tr>', $myrow['typename'], $myrow['transno'], @@ -459,7 +460,7 @@ $myrow['id']); } } elseif ($myrow['type']==12 AND $myrow['totalamount']>0) { /*its a negative receipt */ - + //If security token 8 in the allowed page security tokens then assumed ok for GL trans inquiries if ($_SESSION['CompanyRecord']['gllink_debtors']== 1 AND in_array(8,$_SESSION['AllowedPageSecurityTokens'])){ printf($BaseFormatString . This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <tim...@us...> - 2012-01-19 13:16:17
|
Revision: 4816 http://web-erp.svn.sourceforge.net/web-erp/?rev=4816&view=rev Author: tim_schofield Date: 2012-01-19 13:16:07 +0000 (Thu, 19 Jan 2012) Log Message: ----------- Merge Tims branch into trunk: Show quantity received on transfer note Modified Paths: -------------- trunk/PDFStockLocTransfer.php Modified: trunk/PDFStockLocTransfer.php =================================================================== --- trunk/PDFStockLocTransfer.php 2012-01-19 13:10:08 UTC (rev 4815) +++ trunk/PDFStockLocTransfer.php 2012-01-19 13:16:07 UTC (rev 4816) @@ -27,7 +27,7 @@ <input type="submit" name="Print" value="' . _('Print') .'">'; include ('includes/footer.inc'); exit; -} +} $pdf->addInfo('Title', _('Inventory Location Transfer BOL') ); $pdf->addInfo('Subject', _('Inventory Location Transfer BOL') . ' # ' . $_GET['TransferNo']); @@ -41,6 +41,7 @@ loctransfers.stockid, stockmaster.description, loctransfers.shipqty, + loctransfers.recqty, loctransfers.shipdate, loctransfers.shiploc, locations.locationname as shiplocname, @@ -74,6 +75,7 @@ $LeftOvers = $pdf->addTextWrap($Left_Margin,$YPos,100,$FontSize,$TransferRow['stockid'], 'left'); $LeftOvers = $pdf->addTextWrap(150,$YPos,200,$FontSize,$TransferRow['description'], 'left'); $LeftOvers = $pdf->addTextWrap(350,$YPos,60,$FontSize,locale_number_format($TransferRow['shipqty'],$TransferRow['decimalplaces']), 'right'); + $LeftOvers = $pdf->addTextWrap(470,$YPos,60,$FontSize,locale_number_format($TransferRow['recqty'],$TransferRow['decimalplaces']), 'right'); $pdf->line($Left_Margin, $YPos-2,$Page_Width-$Right_Margin, $YPos-2); This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <tim...@us...> - 2012-01-19 13:16:16
|
Revision: 4816 http://web-erp.svn.sourceforge.net/web-erp/?rev=4816&view=rev Author: tim_schofield Date: 2012-01-19 13:16:07 +0000 (Thu, 19 Jan 2012) Log Message: ----------- Merge Tims branch into trunk: Show quantity received on transfer note Modified Paths: -------------- trunk/PDFStockLocTransfer.php Modified: trunk/PDFStockLocTransfer.php =================================================================== --- trunk/PDFStockLocTransfer.php 2012-01-19 13:10:08 UTC (rev 4815) +++ trunk/PDFStockLocTransfer.php 2012-01-19 13:16:07 UTC (rev 4816) @@ -27,7 +27,7 @@ <input type="submit" name="Print" value="' . _('Print') .'">'; include ('includes/footer.inc'); exit; -} +} $pdf->addInfo('Title', _('Inventory Location Transfer BOL') ); $pdf->addInfo('Subject', _('Inventory Location Transfer BOL') . ' # ' . $_GET['TransferNo']); @@ -41,6 +41,7 @@ loctransfers.stockid, stockmaster.description, loctransfers.shipqty, + loctransfers.recqty, loctransfers.shipdate, loctransfers.shiploc, locations.locationname as shiplocname, @@ -74,6 +75,7 @@ $LeftOvers = $pdf->addTextWrap($Left_Margin,$YPos,100,$FontSize,$TransferRow['stockid'], 'left'); $LeftOvers = $pdf->addTextWrap(150,$YPos,200,$FontSize,$TransferRow['description'], 'left'); $LeftOvers = $pdf->addTextWrap(350,$YPos,60,$FontSize,locale_number_format($TransferRow['shipqty'],$TransferRow['decimalplaces']), 'right'); + $LeftOvers = $pdf->addTextWrap(470,$YPos,60,$FontSize,locale_number_format($TransferRow['recqty'],$TransferRow['decimalplaces']), 'right'); $pdf->line($Left_Margin, $YPos-2,$Page_Width-$Right_Margin, $YPos-2); This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <tim...@us...> - 2012-01-19 13:10:19
|
Revision: 4815 http://web-erp.svn.sourceforge.net/web-erp/?rev=4815&view=rev Author: tim_schofield Date: 2012-01-19 13:10:08 +0000 (Thu, 19 Jan 2012) Log Message: ----------- Merge Tims branch into trunk: Fix xhtml errors Modified Paths: -------------- trunk/Shippers.php Modified: trunk/Shippers.php =================================================================== --- trunk/Shippers.php 2012-01-19 12:57:05 UTC (rev 4814) +++ trunk/Shippers.php 2012-01-19 13:10:08 UTC (rev 4815) @@ -46,7 +46,7 @@ would not run in this case cos submit is false of course see the delete code below*/ - $sql = "UPDATE shippers SET shippername='" . $_POST['ShipperName'] . "' + $sql = "UPDATE shippers SET shippername='" . $_POST['ShipperName'] . "' WHERE shipper_id = '".$SelectedShipper."'"; $msg = _('The shipper record has been updated'); } elseif ($InputError !=1) { @@ -119,8 +119,9 @@ then none of the above are true and the list of Shippers will be displayed with links to delete or edit each. These will call the same page again and allow update/input or deletion of the records*/ - echo '<p class="page_title_text"><img src="'.$rootpath.'/css/'.$theme.'/images/supplier.png" title="' . _('Search') . - '" alt="" />' . ' ' . $title . '</p>'; + echo '<p class="page_title_text"> + <img src="'.$rootpath.'/css/'.$theme.'/images/supplier.png" title="' . _('Search') . '" alt="" />' . ' ' . $title . + '</p>'; $sql = "SELECT * FROM shippers ORDER BY shipper_id"; $result = DB_query($sql,$db); @@ -155,8 +156,9 @@ if (isset($SelectedShipper)) { - echo '<p class="page_title_text"><img src="'.$rootpath.'/css/'.$theme.'/images/supplier.png" title="' . _('Search') . - '" alt="" />' . ' ' . $title . '</p>'; + echo '<p class="page_title_text"> + <img src="'.$rootpath.'/css/'.$theme.'/images/supplier.png" title="' . _('Search') . '" alt="" />' . ' ' . $title . + '</p>'; echo '<div class="centre"><a href="'.htmlspecialchars($_SERVER['PHP_SELF']) . '">'._('REVIEW RECORDS').'</a></div>'; } @@ -176,8 +178,8 @@ $_POST['Shipper_ID'] = $myrow['shipper_id']; $_POST['ShipperName'] = $myrow['shippername']; - echo '<input type=hidden name="SelectedShipper" VALUE='. $SelectedShipper .'>'; - echo '<input type=hidden name="Shipper_ID" VALUE=' . $_POST['Shipper_ID'] . '>'; + echo '<input type="hidden" name="SelectedShipper" value="'. $SelectedShipper .'" />'; + echo '<input type="hidden" name="Shipper_ID" value="' . $_POST['Shipper_ID'] . '" />'; echo '<br /><table class="selection"><tr><td>'. _('Shipper Code').':</td><td>' . $_POST['Shipper_ID'] . '</td></tr>'; } else { echo '<br /> @@ -188,8 +190,9 @@ } echo '<tr><td>'. _('Shipper Name') .':</td> - <td><input type="text" name="ShipperName"'. (in_array('ShipperName',$Errors) ? 'class="inputerror"' : '' ) . - ' value="'. $_POST['ShipperName'] .'" size="35" maxlength="40" /></td> + <td> + <input type="text" name="ShipperName"'. (in_array('ShipperName',$Errors) ? 'class="inputerror"' : '' ) . ' value="'. $_POST['ShipperName'] .'" size="35" maxlength="40" /> + </td> </tr> </table> This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <tim...@us...> - 2012-01-19 13:10:15
|
Revision: 4815 http://web-erp.svn.sourceforge.net/web-erp/?rev=4815&view=rev Author: tim_schofield Date: 2012-01-19 13:10:08 +0000 (Thu, 19 Jan 2012) Log Message: ----------- Merge Tims branch into trunk: Fix xhtml errors Modified Paths: -------------- trunk/Shippers.php Modified: trunk/Shippers.php =================================================================== --- trunk/Shippers.php 2012-01-19 12:57:05 UTC (rev 4814) +++ trunk/Shippers.php 2012-01-19 13:10:08 UTC (rev 4815) @@ -46,7 +46,7 @@ would not run in this case cos submit is false of course see the delete code below*/ - $sql = "UPDATE shippers SET shippername='" . $_POST['ShipperName'] . "' + $sql = "UPDATE shippers SET shippername='" . $_POST['ShipperName'] . "' WHERE shipper_id = '".$SelectedShipper."'"; $msg = _('The shipper record has been updated'); } elseif ($InputError !=1) { @@ -119,8 +119,9 @@ then none of the above are true and the list of Shippers will be displayed with links to delete or edit each. These will call the same page again and allow update/input or deletion of the records*/ - echo '<p class="page_title_text"><img src="'.$rootpath.'/css/'.$theme.'/images/supplier.png" title="' . _('Search') . - '" alt="" />' . ' ' . $title . '</p>'; + echo '<p class="page_title_text"> + <img src="'.$rootpath.'/css/'.$theme.'/images/supplier.png" title="' . _('Search') . '" alt="" />' . ' ' . $title . + '</p>'; $sql = "SELECT * FROM shippers ORDER BY shipper_id"; $result = DB_query($sql,$db); @@ -155,8 +156,9 @@ if (isset($SelectedShipper)) { - echo '<p class="page_title_text"><img src="'.$rootpath.'/css/'.$theme.'/images/supplier.png" title="' . _('Search') . - '" alt="" />' . ' ' . $title . '</p>'; + echo '<p class="page_title_text"> + <img src="'.$rootpath.'/css/'.$theme.'/images/supplier.png" title="' . _('Search') . '" alt="" />' . ' ' . $title . + '</p>'; echo '<div class="centre"><a href="'.htmlspecialchars($_SERVER['PHP_SELF']) . '">'._('REVIEW RECORDS').'</a></div>'; } @@ -176,8 +178,8 @@ $_POST['Shipper_ID'] = $myrow['shipper_id']; $_POST['ShipperName'] = $myrow['shippername']; - echo '<input type=hidden name="SelectedShipper" VALUE='. $SelectedShipper .'>'; - echo '<input type=hidden name="Shipper_ID" VALUE=' . $_POST['Shipper_ID'] . '>'; + echo '<input type="hidden" name="SelectedShipper" value="'. $SelectedShipper .'" />'; + echo '<input type="hidden" name="Shipper_ID" value="' . $_POST['Shipper_ID'] . '" />'; echo '<br /><table class="selection"><tr><td>'. _('Shipper Code').':</td><td>' . $_POST['Shipper_ID'] . '</td></tr>'; } else { echo '<br /> @@ -188,8 +190,9 @@ } echo '<tr><td>'. _('Shipper Name') .':</td> - <td><input type="text" name="ShipperName"'. (in_array('ShipperName',$Errors) ? 'class="inputerror"' : '' ) . - ' value="'. $_POST['ShipperName'] .'" size="35" maxlength="40" /></td> + <td> + <input type="text" name="ShipperName"'. (in_array('ShipperName',$Errors) ? 'class="inputerror"' : '' ) . ' value="'. $_POST['ShipperName'] .'" size="35" maxlength="40" /> + </td> </tr> </table> This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <tim...@us...> - 2012-01-19 12:57:15
|
Revision: 4814 http://web-erp.svn.sourceforge.net/web-erp/?rev=4814&view=rev Author: tim_schofield Date: 2012-01-19 12:57:05 +0000 (Thu, 19 Jan 2012) Log Message: ----------- Merge Tims branch into trunk: Fix xhtml errors Modified Paths: -------------- trunk/TaxGroups.php Modified: trunk/TaxGroups.php =================================================================== --- trunk/TaxGroups.php 2012-01-19 12:56:30 UTC (rev 4813) +++ trunk/TaxGroups.php 2012-01-19 12:57:05 UTC (rev 4814) @@ -237,7 +237,7 @@ } echo '<tr><td>' . _('Tax Group') . ':</td> <td><input type="text" name="GroupName" size="40" maxlength="40" value="' . $_POST['GroupName'] . '" /></td>'; -echo '<td><input type="submit" name="submit" value="' . _('Enter Group') . '"></td> +echo '<td><input type="submit" name="submit" value="' . _('Enter Group') . '" /></td> </tr> </form>'; This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <tim...@us...> - 2012-01-19 12:57:11
|
Revision: 4814 http://web-erp.svn.sourceforge.net/web-erp/?rev=4814&view=rev Author: tim_schofield Date: 2012-01-19 12:57:05 +0000 (Thu, 19 Jan 2012) Log Message: ----------- Merge Tims branch into trunk: Fix xhtml errors Modified Paths: -------------- trunk/TaxGroups.php Modified: trunk/TaxGroups.php =================================================================== --- trunk/TaxGroups.php 2012-01-19 12:56:30 UTC (rev 4813) +++ trunk/TaxGroups.php 2012-01-19 12:57:05 UTC (rev 4814) @@ -237,7 +237,7 @@ } echo '<tr><td>' . _('Tax Group') . ':</td> <td><input type="text" name="GroupName" size="40" maxlength="40" value="' . $_POST['GroupName'] . '" /></td>'; -echo '<td><input type="submit" name="submit" value="' . _('Enter Group') . '"></td> +echo '<td><input type="submit" name="submit" value="' . _('Enter Group') . '" /></td> </tr> </form>'; This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <tim...@us...> - 2012-01-19 12:56:41
|
Revision: 4813 http://web-erp.svn.sourceforge.net/web-erp/?rev=4813&view=rev Author: tim_schofield Date: 2012-01-19 12:56:30 +0000 (Thu, 19 Jan 2012) Log Message: ----------- Merge Tims branch into trunk: Fix xhtml errors Modified Paths: -------------- trunk/Labels.php Modified: trunk/Labels.php =================================================================== --- trunk/Labels.php 2012-01-19 12:10:59 UTC (rev 4812) +++ trunk/Labels.php 2012-01-19 12:56:30 UTC (rev 4813) @@ -276,7 +276,7 @@ <table border="2" cellspacing="4" class="selection"> <tbody> <tr> - <td align="center"><img src="'.$rootpath.'/css/paramsLabel.png" align="top" border="0" ></td> + <td align="center"><img src="'.$rootpath.'/css/paramsLabel.png" align="top" border="0" /></td> <td>'.$tableGD.'</td> </tr> <tr>/ This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |