From: <tim...@us...> - 2009-11-11 17:09:37
|
Revision: 2967 http://web-erp.svn.sourceforge.net/web-erp/?rev=2967&view=rev Author: tim_schofield Date: 2009-11-11 17:09:30 +0000 (Wed, 11 Nov 2009) Log Message: ----------- Improvements to purchase ordering system Modified Paths: -------------- trunk/PO_Header.php trunk/PO_Items.php trunk/includes/DefinePOClass.php trunk/includes/PO_ReadInOrder.inc trunk/sql/mysql/upgrade3.11-3.12.sql Modified: trunk/PO_Header.php =================================================================== --- trunk/PO_Header.php 2009-11-11 13:00:00 UTC (rev 2966) +++ trunk/PO_Header.php 2009-11-11 17:09:30 UTC (rev 2967) @@ -242,6 +242,12 @@ $_SESSION['PO'.$identifier]->DelAdd4 = $_POST['DelAdd4']; $_SESSION['PO'.$identifier]->DelAdd5 = $_POST['DelAdd5']; $_SESSION['PO'.$identifier]->DelAdd6 = $_POST['DelAdd6']; + $_SESSION['PO'.$identifier]->suppDelAdd1 = $_POST['suppDelAdd1']; + $_SESSION['PO'.$identifier]->suppDelAdd2 = $_POST['suppDelAdd2']; + $_SESSION['PO'.$identifier]->suppDelAdd3 = $_POST['suppDelAdd3']; + $_SESSION['PO'.$identifier]->suppDelAdd4 = $_POST['suppDelAdd4']; + $_SESSION['PO'.$identifier]->suppDelAdd5 = $_POST['suppDelAdd5']; + $_SESSION['PO'.$identifier]->supptel= $_POST['supptel']; $_SESSION['PO'.$identifier]->Initiator = $_POST['Initiator']; $_SESSION['PO'.$identifier]->RequisitionNo = $_POST['Requisition']; $_SESSION['PO'.$identifier]->version = $_POST['version']; @@ -251,6 +257,10 @@ $_SESSION['PO'.$identifier]->Comments = $_POST['Comments']; $_SESSION['PO'.$identifier]->deliveryby = $_POST['deliveryby']; $_SESSION['PO'.$identifier]->StatusMessage = $_POST['StatComments']; + $_SESSION['PO'.$identifier]->paymentterms = $_POST['paymentterms']; + $_SESSION['PO'.$identifier]->contact = $_POST['Contact']; + $_SESSION['PO'.$identifier]->tel = $_POST['tel']; + $_SESSION['PO'.$identifier]->port = $_POST['port']; if (isset($_POST['RePrint']) and $_POST['RePrint']==1){ @@ -269,7 +279,9 @@ echo '<p>'; prnMsg(_('You should automatically be forwarded to the entry of the purchase order line items page') . '. ' . _('If this does not happen') . ' (' . _('if the browser does not support META Refresh') . ') ' . - "<a href='$rootpath/PO_Items.php?" . SID . "'>" . _('click here') . '</a> ' . _('to continue'),'info'); + "<a href='$rootpath/PO_Items.php?" . SID. 'identifier='.$identifier . "'>" . _('click here') . '</a> ' . _('to continue'),'info'); + include('includes/footer.inc'); + exit; } /* end of if isset _POST'EnterLines' */ echo '<a href="'. $rootpath . '/PO_SelectOSPurchOrder.php?' . SID . "identifier=".$identifier.'">'. _('Back to Purchase Orders'). '</a><br>'; @@ -465,6 +477,12 @@ $_POST['DelAdd4']=$_SESSION['PO'.$identifier]->DelAdd4; $_POST['DelAdd5']=$_SESSION['PO'.$identifier]->DelAdd5; $_POST['DelAdd6']=$_SESSION['PO'.$identifier]->DelAdd6; + $_POST['suppDelAdd1']=$_SESSION['PO'.$identifier]->suppDelAdd1; + $_POST['suppDelAdd2']=$_SESSION['PO'.$identifier]->suppDelAdd2; + $_POST['suppDelAdd3']=$_SESSION['PO'.$identifier]->suppDelAdd3; + $_POST['suppDelAdd4']=$_SESSION['PO'.$identifier]->suppDelAdd4; + $_POST['suppDelAdd5']=$_SESSION['PO'.$identifier]->suppDelAdd5; + $_POST['suppDelAdd6']=$_SESSION['PO'.$identifier]->suppDelAdd6; } @@ -509,7 +527,7 @@ $SupplierName = $myrow[0]; // added for suppliers lookup fields - if ($authmyrow=DB_fetch_array($authresult) and $authmyrow[0]==0) { + if (($authmyrow=DB_fetch_array($authresult) and $authmyrow[0]==0 ) ) { $_POST['SupplierName'] = $myrow[0]; $_POST['CurrCode'] = $myrow[1]; $_POST['ExRate'] = $myrow[2]; @@ -574,35 +592,35 @@ // added for suppliers lookup fields + if (!isset($_SESSION['PO'.$identifier])) { + $_POST['SupplierName'] = $myrow[0]; + $_POST['CurrCode'] = $myrow[1]; + $_POST['paymentterms']= $myrow[2]; + $_POST['suppDelAdd1'] = $myrow[3]; + $_POST['suppDelAdd2'] = $myrow[4]; + $_POST['suppDelAdd3'] = $myrow[5]; + $_POST['suppDelAdd4'] = $myrow[6]; + $_POST['suppDelAdd5'] = $myrow[7]; + $_POST['suppDelAdd6'] = $myrow[8]; + $_POST['supptel'] = $myrow[9]; + $_POST['port'] = $myrow[10]; - $_POST['SupplierName'] = $myrow[0]; - $_POST['CurrCode'] = $myrow[1]; -// $_POST['ExRate'] = $myrow[2]; - $_POST['paymentterms']= $myrow[2]; - $_POST['suppDelAdd1'] = $myrow[3]; - $_POST['suppDelAdd2'] = $myrow[4]; - $_POST['suppDelAdd3'] = $myrow[5]; - $_POST['suppDelAdd4'] = $myrow[6]; - $_POST['suppDelAdd5'] = $myrow[7]; - $_POST['suppDelAdd6'] = $myrow[8]; - $_POST['supptel'] = $myrow[9]; - $_POST['port'] = $myrow[10]; - - $_SESSION['PO'.$identifier]->SupplierID = $_POST['Select']; - $_SESSION['RequireSupplierSelection'] = 0; - $_SESSION['PO'.$identifier]->SupplierName = $_POST['SupplierName']; - $_SESSION['PO'.$identifier]->CurrCode = $_POST['CurrCode']; - $_SESSION['PO'.$identifier]->ExRate = $_POST['ExRate']; - $_SESSION['PO'.$identifier]->paymentterms = $_POST['paymentterms']; - $_SESSION['PO'.$identifier]->suppDelAdd1 = $_POST['suppDelAdd1']; - $_SESSION['PO'.$identifier]->suppDelAdd2 = $_POST['suppDelAdd2']; - $_SESSION['PO'.$identifier]->suppDelAdd3 = $_POST['suppDelAdd3']; - $_SESSION['PO'.$identifier]->suppDelAdd4 = $_POST['suppDelAdd4']; - $_SESSION['PO'.$identifier]->suppDelAdd5 = $_POST['suppDelAdd5']; - $_SESSION['PO'.$identifier]->suppDelAdd6 = $_POST['suppDelAdd6']; - $_SESSION['PO'.$identifier]->supptel = $_POST['supptel']; - $_SESSION['PO'.$identifier]->port = $_POST['port']; + $_SESSION['PO'.$identifier]->SupplierID = $_POST['Select']; + $_SESSION['RequireSupplierSelection'] = 0; + $_SESSION['PO'.$identifier]->SupplierName = $_POST['SupplierName']; + $_SESSION['PO'.$identifier]->CurrCode = $_POST['CurrCode']; + $_SESSION['PO'.$identifier]->ExRate = $_POST['ExRate']; + $_SESSION['PO'.$identifier]->paymentterms = $_POST['paymentterms']; + $_SESSION['PO'.$identifier]->suppDelAdd1 = $_POST['suppDelAdd1']; + $_SESSION['PO'.$identifier]->suppDelAdd2 = $_POST['suppDelAdd2']; + $_SESSION['PO'.$identifier]->suppDelAdd3 = $_POST['suppDelAdd3']; + $_SESSION['PO'.$identifier]->suppDelAdd4 = $_POST['suppDelAdd4']; + $_SESSION['PO'.$identifier]->suppDelAdd5 = $_POST['suppDelAdd5']; + $_SESSION['PO'.$identifier]->suppDelAdd6 = $_POST['suppDelAdd6']; + $_SESSION['PO'.$identifier]->supptel = $_POST['supptel']; + $_SESSION['PO'.$identifier]->port = $_POST['port']; // end of added for suppliers lookup fields + } } // MADE THE SUPPILERS BECOME SELECT MENU NOT BY SEARCHING By Hudson @2008/6/30 @@ -739,6 +757,7 @@ $_POST['ExRate']=$_SESSION['PO'.$identifier]->ExRate; $_POST['Comments']=$_SESSION['PO'.$identifier]->Comments; $_POST['deliveryby']=$_SESSION['PO'.$identifier]->deliveryby; + $_POST['paymentterms']=$_SESSION['PO'.$identifier]->paymentterms; } // move apart by Hudson @@ -937,7 +956,7 @@ $_POST['Contact'] = $LocnRow[7]; $_SESSION['PO'.$identifier]->Location= $_POST['StkLocation']; - $_SESSION['PO'.$identifier]->SupplierContact= $_POST['SupplierContact']; +// $_SESSION['PO'.$identifier]->SupplierContact= $_POST['SupplierContact']; $_SESSION['PO'.$identifier]->DelAdd1 = $_POST['DelAdd1']; $_SESSION['PO'.$identifier]->DelAdd2 = $_POST['DelAdd2']; $_SESSION['PO'.$identifier]->DelAdd3 = $_POST['DelAdd3']; @@ -1062,7 +1081,7 @@ while ( $SuppCoRow=DB_fetch_array($SuppCoResult)){ if ($_POST['SupplierContact'] == $SuppCoRow['contact'] OR ($_POST['SupplierContact']=='' - AND $SuppCoRow['contact']==$_SESSION['SupplierContact'])){ + AND $SuppCoRow['contact']==$_SESSION['PO'.$identifier]->SupplierContact)){ //if (1) { echo "<option selected value='" . $SuppCoRow['contact'] . "'>" . $SuppCoRow['contact']; } else { @@ -1089,12 +1108,12 @@ </td><td><input type='text' name=suppDelAdd4 size=41 maxlength=40 value='" . $_POST['suppDelAdd4'] . "'></td> </tr>"; echo '<tr><td>' . _('Phone') . ": - </td><td><input type='text' name=supptel size=31 maxlength=30 value='" . $_POST['supptel'] . "'></td> + </td><td><input type='text' name=supptel size=31 maxlength=30 value='" . $_SESSION['PO'.$identifier]->supptel . "'></td> </tr>"; $result=DB_query('SELECT terms, termsindicator FROM paymentterms', $db); - echo '<tr><td>' . _('Payment Terms') . ":</td><td><select name='PaymentTerms'>"; + echo '<tr><td>' . _('Payment Terms') . ":</td><td><select name='paymentterms'>"; while ($myrow = DB_fetch_array($result)) { if ($myrow['termsindicator']==$_SESSION['PO'.$identifier]->paymentterms) { @@ -1106,7 +1125,7 @@ DB_data_seek($result, 0); echo '</select></td></tr>'; - $result=DB_query("SELECT loccode, locationname FROM locations WHERE loccode='" . $_POST['port'] ."'", $db); + $result=DB_query("SELECT loccode, locationname FROM locations WHERE loccode='" . $_SESSION['PO'.$identifier]->port."'", $db); $myrow = DB_fetch_array($result); $_POST['port'] = $myrow['locationname']; Modified: trunk/PO_Items.php =================================================================== --- trunk/PO_Items.php 2009-11-11 13:00:00 UTC (rev 2966) +++ trunk/PO_Items.php 2009-11-11 17:09:30 UTC (rev 2967) @@ -125,13 +125,24 @@ deladd4, deladd5, deladd6, + tel, + suppdeladdress1, + suppdeladdress2, + suppdeladdress3, + suppdeladdress4, + suppdeladdress5, + suppdeladdress6, + suppliercontact, + supptel, + contact, version, realorderno, revised, deliveryby, status, stat_comment, - deliverydate) + deliverydate, + paymentterms) VALUES(" . $_SESSION['PO'.$identifier]->OrderNo . ", '" . $_SESSION['PO'.$identifier]->SupplierID . "', '" . $_SESSION['PO'.$identifier]->Comments . "', @@ -146,13 +157,23 @@ '" . $_SESSION['PO'.$identifier]->DelAdd4 . "', '" . $_SESSION['PO'.$identifier]->DelAdd5 . "', '" . $_SESSION['PO'.$identifier]->DelAdd6 . "', + '" . $_SESSION['PO'.$identifier]->tel . "', + '" . $_SESSION['PO'.$identifier]->suppDelAdd1 . "', + '" . $_SESSION['PO'.$identifier]->suppDelAdd2 . "', + '" . $_SESSION['PO'.$identifier]->suppDelAdd3 . "', + '" . $_SESSION['PO'.$identifier]->suppDelAdd4 . "', + '" . $_SESSION['PO'.$identifier]->suppDelAdd5 . "', + '" . $_SESSION['PO'.$identifier]->suppDelAdd6 . "', + '" . $_SESSION['PO'.$identifier]->SupplierContact . "', + '" . $_SESSION['PO'.$identifier]->supptel. "', + '" . $_SESSION['PO'.$identifier]->contact . "', '" . $_SESSION['PO'.$identifier]->version . "', - '" . $_SESSION['PO'.$identifier]->OrderNo2 . "', '" . FormatDateForSQL($date) . "', '" . $_SESSION['PO'.$identifier]->deliveryby . "', '" . 'Pending' . "', '" . $StatusComment . "', - '" . FormatDateForSQL($_SESSION['PO'.$identifier]->deliverydate) . "' + '" . FormatDateForSQL($_SESSION['PO'.$identifier]->deliverydate) . "', + '" . $_SESSION['PO'.$identifier]->paymentterms. "' )"; $ErrMsg = _('The purchase order header record could not be inserted into the database because'); @@ -237,6 +258,17 @@ deladd4='" . $_SESSION['PO'.$identifier]->DelAdd4 . "', deladd5='" . $_SESSION['PO'.$identifier]->DelAdd5 . "', deladd6='" . $_SESSION['PO'.$identifier]->DelAdd6 . "', + deladd6='" . $_SESSION['PO'.$identifier]->tel . "', + suppdeladdress1='" . $_SESSION['PO'.$identifier]->suppDelAdd1 . "', + suppdeladdress2='" . $_SESSION['PO'.$identifier]->suppDelAdd2 . "', + suppdeladdress3='" . $_SESSION['PO'.$identifier]->suppDelAdd3 . "', + suppdeladdress4='" . $_SESSION['PO'.$identifier]->suppDelAdd4 . "', + suppdeladdress5='" . $_SESSION['PO'.$identifier]->suppDelAdd5 . "', + suppdeladdress6='" . $_SESSION['PO'.$identifier]->suppDelAdd6 . "', + suppliercontact='" . $_SESSION['PO'.$identifier]->SupplierContact . "', + supptel='" . $_SESSION['PO'.$identifier]->supptel . "', + contact='" . $_SESSION['PO'.$identifier]->contact . "', + paymentterms='" . $_SESSION['PO'.$identifier]->paymentterms . "', allowprint=" . $_SESSION['PO'.$identifier]->AllowPrintPO . " WHERE orderno = '" . $_SESSION['PO'.$identifier]->OrderNo ."'"; @@ -494,7 +526,7 @@ /* Always do the stuff below if not looking for a supplierid */ if(isset($_GET['Delete'])){ - if($_SESSION['PO'.$identifier]->Some_Already_Received($_POST['LineNo'])==0){ + if($_SESSION['PO'.$identifier]->Some_Already_Received($_GET['Delete'])==0){ $_SESSION['PO'.$identifier]->LineItems[$_GET['Delete']]->Deleted=True; include ('includes/PO_UnsetFormVbls.php'); } else { @@ -764,7 +796,7 @@ $result1 = DB_query($sql,$db,$ErrMsg,$DbgMsg); if ($myrow = DB_fetch_array($result1)){ - if (is_numeric($myrow['price'])){ + if (isset($myrow['price']) and is_numeric($myrow['price'])){ $_SESSION['PO'.$identifier]->add_to_order ($_SESSION['PO'.$identifier]->LinesOnOrder+1, $ItemCode, @@ -993,6 +1025,9 @@ } } + unset($_POST['Keywords']); + unset($_POST['StockCode']); + if (!isset($_POST['Keywords'])) { $_POST['Keywords']=''; } @@ -1001,8 +1036,6 @@ $_POST['StockCode']=''; } - unset($_POST['Keywords']); - unset($_POST['StockCode']); echo '</select></td> <td><font size=2>' . _('Enter text extracts in the description') . ":</font></td> <td><input type='text' name='Keywords' size=20 maxlength=25 value='" . $_POST['Keywords'] . "'></td></tr> Modified: trunk/includes/DefinePOClass.php =================================================================== --- trunk/includes/DefinePOClass.php 2009-11-11 13:00:00 UTC (rev 2966) +++ trunk/includes/DefinePOClass.php 2009-11-11 17:09:30 UTC (rev 2967) @@ -1,4 +1,5 @@ <?php +/* $Id$ */ /* $Revision: 1.15 $ */ /* Definition of the PurchOrder class to hold all the information for a purchase order and delivery */ @@ -17,6 +18,15 @@ var $DelAdd4; var $DelAdd5; var $DelAdd6; + var $tel; + var $suppDelAdd1; + var $suppDelAdd2; + var $suppDelAdd3; + var $suppDelAdd4; + var $suppDelAdd5; + var $suppDelAdd6; + var $SupplierContact; + var $supptel; var $Comments; var $Location; Var $Managed; @@ -35,6 +45,9 @@ var $AllowPrintPO; var $revised; var $deliveryby; + var $paymentterms; + var $contact; + var $port; function PurchOrder(){ /*Constructor function initialises a new purchase order object */ @@ -171,8 +184,8 @@ function Some_Already_Received($LineNo){ /* Checks if there have been deliveries or amounts invoiced against a specific line item */ - if (count($this->LineItems)>0){ - if ($this->LineItems[$LineNo]->QtyReceived !=0 || $this->LineItems[$LineNo]->QtyInvoiced !=0){ + if (count($this->LineItems)>0 and isset($this->LineItems[$LineNo])){ + if ($this->LineItems[$LineNo]->QtyReceived !=0 or $this->LineItems[$LineNo]->QtyInv !=0){ return 1; } } @@ -297,4 +310,4 @@ } } -?> +?> \ No newline at end of file Modified: trunk/includes/PO_ReadInOrder.inc =================================================================== --- trunk/includes/PO_ReadInOrder.inc 2009-11-11 13:00:00 UTC (rev 2966) +++ trunk/includes/PO_ReadInOrder.inc 2009-11-11 17:09:30 UTC (rev 2967) @@ -1,4 +1,5 @@ <?php +/* $Id$ */ /* $Revision: 1.16 $ */ /*PO_ReadInOrder.inc is used by the modify existing order code in PO_Header.php and also by GoodsReceived.php */ @@ -27,6 +28,16 @@ purchorders.deladd4, purchorders.deladd5, purchorders.deladd6, + purchorders.tel, + purchorders.suppdeladdress1, + purchorders.suppdeladdress2, + purchorders.suppdeladdress3, + purchorders.suppdeladdress4, + purchorders.suppdeladdress5, + purchorders.suppdeladdress6, + purchorders.suppliercontact, + purchorders.supptel, + purchorders.contact, purchorders.allowprint, purchorders.requisitionno, purchorders.intostocklocation, @@ -35,8 +46,10 @@ purchorders.status, purchorders.stat_comment, purchorders.deliverydate, + purchorders.port, suppliers.currcode, - locations.managed + locations.managed , + purchorders.paymentterms FROM purchorders LEFT JOIN locations ON purchorders.intostocklocation=locations.loccode, suppliers @@ -47,34 +60,70 @@ $DbgMsg = _('The SQL statement that was used and failed was'); $GetOrdHdrResult = DB_query($OrderHeaderSQL,$db,$ErrMsg,$DbgMsg); - if (DB_num_rows($GetOrdHdrResult)==1) { + if (DB_num_rows($GetOrdHdrResult)==1 and !isset($_SESSION['PO'.$identifier]->OrderNo )) { - $myrow = DB_fetch_array($GetOrdHdrResult); - $_SESSION['PO'.$identifier]->OrderNo = $_GET['ModifyOrderNumber']; - $_SESSION['PO'.$identifier]->SupplierID = $myrow['supplierno']; - $_SESSION['PO'.$identifier]->SupplierName = $myrow['suppname']; - $_SESSION['PO'.$identifier]->CurrCode = $myrow['currcode']; - $_SESSION['PO'.$identifier]->Orig_OrderDate = $myrow['orddate']; - $_SESSION['PO'.$identifier]->AllowPrintPO = $myrow['allowprint']; - $_SESSION['PO'.$identifier]->DatePurchaseOrderPrinted = $myrow['dateprinted']; - $_SESSION['PO'.$identifier]->Comments = $myrow['comments']; - $_SESSION['PO'.$identifier]->ExRate = $myrow['rate']; - $_SESSION['PO'.$identifier]->Location = $myrow['intostocklocation']; - $_SESSION['PO'.$identifier]->Initiator = $myrow['initiator']; - $_SESSION['PO'.$identifier]->RequisitionNo = $myrow['requisitionno']; - $_SESSION['PO'.$identifier]->DelAdd1 = $myrow['deladd1']; - $_SESSION['PO'.$identifier]->DelAdd2 = $myrow['deladd2']; - $_SESSION['PO'.$identifier]->DelAdd3 = $myrow['deladd3']; - $_SESSION['PO'.$identifier]->DelAdd4 = $myrow['deladd4']; - $_SESSION['PO'.$identifier]->DelAdd5 = $myrow['deladd5']; - $_SESSION['PO'.$identifier]->DelAdd6 = $myrow['deladd6']; - $_SESSION['PO'.$identifier]->Managed = $myrow['managed']; + $myrow = DB_fetch_array($GetOrdHdrResult); + $_SESSION['PO'.$identifier]->OrderNo = $_GET['ModifyOrderNumber']; + $_SESSION['PO'.$identifier]->SupplierID = $myrow['supplierno']; + $_SESSION['PO'.$identifier]->SupplierName = $myrow['suppname']; + $_SESSION['PO'.$identifier]->CurrCode = $myrow['currcode']; + $_SESSION['PO'.$identifier]->Orig_OrderDate = $myrow['orddate']; + $_SESSION['PO'.$identifier]->AllowPrintPO = $myrow['allowprint']; + $_SESSION['PO'.$identifier]->DatePurchaseOrderPrinted = $myrow['dateprinted']; + $_SESSION['PO'.$identifier]->Comments = $myrow['comments']; + $_SESSION['PO'.$identifier]->ExRate = $myrow['rate']; + $_SESSION['PO'.$identifier]->Location = $myrow['intostocklocation']; + $_SESSION['PO'.$identifier]->Initiator = $myrow['initiator']; + $_SESSION['PO'.$identifier]->RequisitionNo = $myrow['requisitionno']; + $_SESSION['PO'.$identifier]->DelAdd1 = $myrow['deladd1']; + $_SESSION['PO'.$identifier]->DelAdd2 = $myrow['deladd2']; + $_SESSION['PO'.$identifier]->DelAdd3 = $myrow['deladd3']; + $_SESSION['PO'.$identifier]->DelAdd4 = $myrow['deladd4']; + $_SESSION['PO'.$identifier]->DelAdd5 = $myrow['deladd5']; + $_SESSION['PO'.$identifier]->DelAdd6 = $myrow['deladd6']; + $_SESSION['PO'.$identifier]->tel = $myrow['tel']; + $_SESSION['PO'.$identifier]->suppDelAdd1 = $myrow['suppdeladdress1']; + $_SESSION['PO'.$identifier]->suppDelAdd2 = $myrow['suppdeladdress2']; + $_SESSION['PO'.$identifier]->suppDelAdd3 = $myrow['suppdeladdress3']; + $_SESSION['PO'.$identifier]->suppDelAdd4 = $myrow['suppdeladdress4']; + $_SESSION['PO'.$identifier]->suppDelAdd5 = $myrow['suppdeladdress5']; + $_SESSION['PO'.$identifier]->suppDelAdd6 = $myrow['suppdeladdress6']; + $_SESSION['PO'.$identifier]->SupplierContact = $myrow['suppliercontact']; + $_SESSION['PO'.$identifier]->supptel= $myrow['supptel']; + $_SESSION['PO'.$identifier]->contact = $myrow['contact']; + $_SESSION['PO'.$identifier]->Managed = $myrow['managed']; $_SESSION['PO'.$identifier]->version = $myrow['version']; + $_SESSION['PO'.$identifier]->port = $myrow['port']; $_SESSION['PO'.$identifier]->Stat = $myrow['status']; $_SESSION['PO'.$identifier]->StatComments = $myrow['stat_comment']; $_SESSION['PO'.$identifier]->deliverydate = ConvertSQLDate($myrow['deliverydate']); $_SESSION['ExistingOrder'] = $_SESSION['PO'.$identifier]->OrderNo; - + $_SESSION['PO'.$identifier]->paymentterms= $myrow['paymentterms']; + + $supplierSQL = "SELECT suppliers.supplierid, + suppliers.suppname, + suppliers.address1, + suppliers.address2, + suppliers.address3, + suppliers.address4, + suppliers.address5, + suppliers.address6, + suppliers.currcode + FROM suppliers + WHERE suppliers.supplierid='" . $_SESSION['PO'.$identifier]->SupplierID."' + ORDER BY suppliers.supplierid"; + + $ErrMsg = _('The searched supplier records requested cannot be retrieved because'); + $result_SuppSelect = DB_query($supplierSQL,$db,$ErrMsg); + + if (DB_num_rows($result_SuppSelect)==1){ + $myrow=DB_fetch_array($result_SuppSelect); +// $_POST['Select'] = $myrow['supplierid']; + } elseif (DB_num_rows($result_SuppSelect)==0){ + prnMsg( _('No supplier records contain the selected text') . ' - ' . + _('please alter your search criteria and try again'),'info'); + } + /*now populate the line PO array with the purchase order details records */ $LineItemsSQL = 'SELECT podetailitem, Modified: trunk/sql/mysql/upgrade3.11-3.12.sql =================================================================== --- trunk/sql/mysql/upgrade3.11-3.12.sql 2009-11-11 13:00:00 UTC (rev 2966) +++ trunk/sql/mysql/upgrade3.11-3.12.sql 2009-11-11 17:09:30 UTC (rev 2967) @@ -27,3 +27,15 @@ ALTER TABLE `holdreasons` DROP INDEX `ReasonCode`; ALTER TABLE `chartmaster` DROP INDEX `AccountCode`; + +ALTER TABLE `purchorders` ADD COLUMN `paymentterms` char(2) NOT NULL DEFAULT ''; +ALTER TABLE `purchorders` ADD COLUMN `suppdeladdress1` varchar(40) NOT NULL DEFAULT '' AFTER deladd6; +ALTER TABLE `purchorders` ADD COLUMN `suppdeladdress2` varchar(40) NOT NULL DEFAULT '' AFTER suppdeladdress1; +ALTER TABLE `purchorders` ADD COLUMN `suppdeladdress3` varchar(40) NOT NULL DEFAULT '' AFTER suppdeladdress2; +ALTER TABLE `purchorders` ADD COLUMN `suppdeladdress4` varchar(40) NOT NULL DEFAULT '' AFTER suppdeladdress3; +ALTER TABLE `purchorders` ADD COLUMN `suppdeladdress5` varchar(20) NOT NULL DEFAULT '' AFTER suppdeladdress4; +ALTER TABLE `purchorders` ADD COLUMN `suppdeladdress6` varchar(15) NOT NULL DEFAULT '' AFTER suppdeladdress5; +ALTER TABLE `purchorders` ADD COLUMN `suppliercontact` varchar(30) NOT NULL DEFAULT '' AFTER suppdeladdress6; +ALTER TABLE `purchorders` ADD COLUMN `supptel` varchar(30) NOT NULL DEFAULT '' AFTER suppliercontact; +ALTER TABLE `purchorders` ADD COLUMN `tel` varchar(15) NOT NULL DEFAULT '' AFTER deladd6; +ALTER TABLE `purchorders` ADD COLUMN `port` varchar(40) NOT NULL DEFAULT '' ; This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |