From: <dai...@us...> - 2011-02-13 04:15:48
|
Revision: 4490 http://web-erp.svn.sourceforge.net/web-erp/?rev=4490&view=rev Author: daintree Date: 2011-02-13 04:15:38 +0000 (Sun, 13 Feb 2011) Log Message: ----------- pre 4.03RC1 Modified Paths: -------------- trunk/Contracts.php trunk/GoodsReceived.php trunk/GoodsReceivedControlled.php trunk/PricesByCost.php trunk/SelectOrderItems.php trunk/StockSerialItems.php trunk/SuppInvGRNs.php trunk/SystemParameters.php trunk/UpgradeDatabase.php trunk/doc/Change.log.html trunk/doc/INSTALL.txt trunk/includes/ConnectDB.inc trunk/includes/InputSerialItems.php trunk/includes/InputSerialItemsExisting.php trunk/includes/InputSerialItemsFile.php trunk/includes/InputSerialItemsKeyed.php trunk/locale/cs_CZ.utf8/LC_MESSAGES/messages.mo trunk/locale/cs_CZ.utf8/LC_MESSAGES/messages.po trunk/locale/de_DE.utf8/LC_MESSAGES/messages.mo trunk/locale/de_DE.utf8/LC_MESSAGES/messages.po trunk/locale/el_GR.utf8/LC_MESSAGES/messages.mo trunk/locale/el_GR.utf8/LC_MESSAGES/messages.po trunk/locale/en_GB.utf8/LC_MESSAGES/messages.pot trunk/locale/en_US.utf8/LC_MESSAGES/messages.mo trunk/locale/en_US.utf8/LC_MESSAGES/messages.po trunk/locale/es_ES.utf8/LC_MESSAGES/messages.mo trunk/locale/es_ES.utf8/LC_MESSAGES/messages.po trunk/locale/et_EE.utf8/LC_MESSAGES/messages.mo trunk/locale/et_EE.utf8/LC_MESSAGES/messages.po trunk/locale/fa_IR.utf8/LC_MESSAGES/messages.mo trunk/locale/fa_IR.utf8/LC_MESSAGES/messages.po trunk/locale/fr_FR.utf8/LC_MESSAGES/messages.mo trunk/locale/fr_FR.utf8/LC_MESSAGES/messages.po trunk/locale/hi_IN.utf8/LC_MESSAGES/messages.mo trunk/locale/hi_IN.utf8/LC_MESSAGES/messages.po trunk/locale/hr_HR.utf8/LC_MESSAGES/messages.mo trunk/locale/hr_HR.utf8/LC_MESSAGES/messages.po trunk/locale/hu_HU.utf8/LC_MESSAGES/messages.mo trunk/locale/hu_HU.utf8/LC_MESSAGES/messages.po trunk/locale/id_ID.utf8/LC_MESSAGES/messages.mo trunk/locale/id_ID.utf8/LC_MESSAGES/messages.po trunk/locale/it_IT.utf8/LC_MESSAGES/messages.mo trunk/locale/it_IT.utf8/LC_MESSAGES/messages.po trunk/locale/ja_JP.utf8/LC_MESSAGES/messages.mo trunk/locale/ja_JP.utf8/LC_MESSAGES/messages.po trunk/locale/lv_LV.utf8/LC_MESSAGES/messages.mo trunk/locale/lv_LV.utf8/LC_MESSAGES/messages.po trunk/locale/nl_NL.utf8/LC_MESSAGES/messages.mo trunk/locale/nl_NL.utf8/LC_MESSAGES/messages.po trunk/locale/pl_PL.utf8/LC_MESSAGES/messages.mo trunk/locale/pl_PL.utf8/LC_MESSAGES/messages.po trunk/locale/pt_BR.utf8/LC_MESSAGES/messages.mo trunk/locale/pt_BR.utf8/LC_MESSAGES/messages.po trunk/locale/pt_PT.utf8/LC_MESSAGES/messages.mo trunk/locale/pt_PT.utf8/LC_MESSAGES/messages.po trunk/locale/ro_RO.utf8/LC_MESSAGES/messages.mo trunk/locale/ro_RO.utf8/LC_MESSAGES/messages.po trunk/locale/ru_RU.utf8/LC_MESSAGES/messages.mo trunk/locale/ru_RU.utf8/LC_MESSAGES/messages.po trunk/locale/sq_AL.utf8/LC_MESSAGES/messages.mo trunk/locale/sq_AL.utf8/LC_MESSAGES/messages.po trunk/locale/sv_SE.utf8/LC_MESSAGES/messages.mo trunk/locale/sv_SE.utf8/LC_MESSAGES/messages.po trunk/locale/sw_KE.utf8/LC_MESSAGES/messages.mo trunk/locale/sw_KE.utf8/LC_MESSAGES/messages.po trunk/locale/tr_TR.utf8/LC_MESSAGES/messages.mo trunk/locale/tr_TR.utf8/LC_MESSAGES/messages.po trunk/locale/zh_CN.utf8/LC_MESSAGES/messages.mo trunk/locale/zh_CN.utf8/LC_MESSAGES/messages.po trunk/locale/zh_HK.utf8/LC_MESSAGES/messages.mo trunk/locale/zh_HK.utf8/LC_MESSAGES/messages.po trunk/sql/mysql/upgrade3.11.1-4.00.sql trunk/sql/mysql/weberp-demo.sql trunk/sql/mysql/weberp-new.sql Modified: trunk/Contracts.php =================================================================== --- trunk/Contracts.php 2011-02-11 16:43:22 UTC (rev 4489) +++ trunk/Contracts.php 2011-02-13 04:15:38 UTC (rev 4490) @@ -667,23 +667,37 @@ if (DB_num_rows($result_CustSelect)==1){ $myrow=DB_fetch_array($result_CustSelect); - $_POST['SelectedCustomer'] = $myrow['debtorno'] . '-' . $myrow['branchcode']; + $SelectedCustomer = $myrow['debtorno'] . '-' . $myrow['branchcode']; } elseif (DB_num_rows($result_CustSelect)==0){ prnMsg(_('No Customer Branch records contain the search criteria') . ' - ' . _('please try again') . ' - ' . _('Note a Customer Branch Name may be different to the Customer Name'),'info'); } } /*one of keywords or custcode was more than a zero length string */ } /*end of if search for customer codes/names */ +if (isset($_POST['JustSelectedACustomer'])){ + /*Need to figure out the number of the form variable that the user clicked on */ + for ($i=1;$i<count($_POST);$i++){ //loop through the returned customers + if(isset($_POST['SubmitCustomerSelection'.$i])){ + break; + } + } + if ($i==count($_POST)){ + prnMsg(_('Unable to identify the selected customer'),'error'); + } else { + $SelectedCustomer = $_POST['SelectedCustomer'.$i]; + } +} -if (isset($_POST['SelectedCustomer'])) { +if (isset($SelectedCustomer)) { -/* will only be true if page called from customer selection form - * or set because only one customer record returned from a search - * so parse the $Select string into debtorno and branch code */ - $CustomerBranchArray = explode('-',$_POST['SelectedCustomer']); +/* will only be true if page called from customer selection + * or set because only one customer record returned from a search - isset($SelectedCustomer) + * so parse the returned SelectedCustomer string into debtorno and branch code */ + + $CustomerBranchArray = explode('-',$SelectedCustomer); $_SESSION['Contract'.$identifier]->DebtorNo = trim($CustomerBranchArray[0]); $_SESSION['Contract'.$identifier]->BranchCode = trim($CustomerBranchArray[1]); - + $sql = "SELECT debtorsmaster.name, custbranch.brname, debtorsmaster.currcode, @@ -699,8 +713,7 @@ WHERE debtorsmaster.debtorno='" . $_SESSION['Contract'.$identifier]->DebtorNo . "' AND custbranch.branchcode='" . $_SESSION['Contract'.$identifier]->BranchCode . "'" ; - $ErrMsg = _('The customer record selected') . ': ' . $_POST['SelectedCustomer'] . ' ' . - _('cannot be retrieved because'); + $ErrMsg = _('The customer record selected') . ': ' .$_SESSION['Contract'.$identifier]->DebtorNo. ' ' . _('cannot be retrieved because'); $DbgMsg = _('The SQL used to retrieve the customer details and failed was'); $result = DB_query($sql,$db,$ErrMsg,$DbgMsg); $myrow = DB_fetch_array($result); @@ -783,8 +796,8 @@ } else { echo '<td></td>'; } - echo '<td><input tabindex="'.number_format($j+5).'" type="submit" name="Submit" value="'.htmlentities($myrow['brname']).'" /></td> - <input type="hidden" name="SelectedCustomer" value="'.$myrow['debtorno'].' - '.$myrow['branchcode'].'" /> + echo '<td><input tabindex="'.($j+5).'" type="submit" name="SubmitCustomerSelection' . $j .'" value="'.htmlentities($myrow['brname']).'" /></td> + <input type="hidden" name="SelectedCustomer' . $j .'" value="'.$myrow['debtorno'].' - '.$myrow['branchcode'].'" /> <td>'.htmlentities($myrow['contactname']).'</td> <td>'.$myrow['phoneno'].'</td> <td>'.$myrow['faxno'].'</td> @@ -794,7 +807,8 @@ //end of page full new headings if } //end of while loop - + echo '<input type="hidden" name="JustSelectedACustomer" value="Yes">'; + echo '</table></form>'; }//end if results to show Modified: trunk/GoodsReceived.php =================================================================== --- trunk/GoodsReceived.php 2011-02-11 16:43:22 UTC (rev 4489) +++ trunk/GoodsReceived.php 2011-02-13 04:15:38 UTC (rev 4490) @@ -26,13 +26,13 @@ $title = _('Receive Purchase Orders'); include('includes/header.inc'); -echo '<a href="'. $rootpath . '/PO_SelectOSPurchOrder.php?' . SID . '">' . _('Back to Purchase Orders'). '</a><br>'; +echo '<a href="'. $rootpath . '/PO_SelectOSPurchOrder.php">' . _('Back to Purchase Orders'). '</a><br />'; if (isset($_GET['PONumber']) and $_GET['PONumber']<=0 and !isset($_SESSION['PO'.$identifier])) { /* This page can only be called with a purchase order number for invoicing*/ echo '<div class="centre"><a href= "' . $rootpath . '/PO_SelectOSPurchOrder.php?' . SID . '">'. _('Select a purchase order to receive').'</a></div>'; - echo '<br>'. _('This page can only be opened if a purchase order has been selected. Please select a purchase order first'); + echo '<br />'. _('This page can only be opened if a purchase order has been selected. Please select a purchase order first'); include ('includes/footer.inc'); exit; } elseif (isset($_GET['PONumber']) AND !isset($_POST['Update'])) { @@ -55,7 +55,7 @@ } if ($_SESSION['PO'.$identifier]->Status != 'Printed') { - prnMsg( _('Purchase orders must have a status of Printed before they can be received').'.<br>'. + prnMsg( _('Purchase orders must have a status of Printed before they can be received').'.<br />'. _('Order number') . ' ' . $_GET['PONumber'] . ' ' . _('has a status of') . ' ' . _($_SESSION['PO'.$identifier]->Status), 'warn'); include('includes/footer.inc'); exit; @@ -78,7 +78,7 @@ echo '<table class=selection><tr><td>'. _('Date Goods/Service Received'). ':</td><td><input type=text class=date alt="'. $_SESSION['DefaultDateFormat'] .'" maxlength=10 size=10 onChange="return isDate(this, this.value, '."'". $_SESSION['DefaultDateFormat']."'".')" name=DefaultReceivedDate value="' . $_POST['DefaultReceivedDate'] . - '"></td></tr></table><br>'; + '"></td></tr></table><br />'; echo '<table cellpadding=2 class=selection> <tr><th colspan="2"></th> @@ -88,17 +88,17 @@ </tr> <tr><th>' . _('Item Code') . '</th> <th>' . _('Description') . '</th> - <th>' . _('Quantity') . '<br>' . _('Ordered') . '</th> + <th>' . _('Quantity') . '<br />' . _('Ordered') . '</th> <th>' . _('Units') . '</th> <th>' . _('Already') . '<br />' . _('Received') . '</th> <th>' . _('Conversion') . '<br />' . _('Factor') . '</th> - <th>' . _('Quantity') . '<br>' . _('Ordered') . '</th> + <th>' . _('Quantity') . '<br />' . _('Ordered') . '</th> <th>' . _('Units') . '</th> <th>' . _('Already') . '<br />' . _('Received') . '</th> <th>' . _('This Delivery') . '<br />' . _('Quantity') . '</th>'; if ($_SESSION['ShowValueOnGRN']==1) { - echo '<th>' . _('Price') . '</th><th>' . _('Total Value') . '<br>' . _('Received') . '</th>'; + echo '<th>' . _('Price') . '</th><th>' . _('Total Value') . '<br />' . _('Received') . '</th>'; } echo '<td> </td> @@ -156,7 +156,7 @@ if ($LnItm->Controlled == 1) { - echo '<input type=hidden name="RecvQty_' . $LnItm->LineNo . '" value="' . $LnItm->ReceiveQty . '"><a href="GoodsReceivedControlled.php?' . SID . '&LineNo=' . $LnItm->LineNo . '">' . number_format($LnItm->ReceiveQty,$LnItm->DecimalPlaces) . '</a></td>'; + echo '<input type=hidden name="RecvQty_' . $LnItm->LineNo . '" value="' . $LnItm->ReceiveQty . '"><a href="GoodsReceivedControlled.php?identifier=' . $identifier . '&LineNo=' . $LnItm->LineNo . '">' . number_format($LnItm->ReceiveQty,$LnItm->DecimalPlaces) . '</a></td>'; } else { echo '<input type=text class=number name="RecvQty_' . $LnItm->LineNo . '" maxlength=10 size=10 value="' . $LnItm->ReceiveQty . '"></td>'; @@ -170,10 +170,10 @@ if ($LnItm->Controlled == 1) { if ($LnItm->Serialised==1){ - echo '<td><a href="GoodsReceivedControlled.php?' . SID . '&LineNo=' . $LnItm->LineNo . '">'. + echo '<td><a href="GoodsReceivedControlled.php?identifier=' . $identifier . '&LineNo=' . $LnItm->LineNo . '">'. _('Enter Serial Nos'). '</a></td>'; } else { - echo '<td><a href="GoodsReceivedControlled.php?' . SID . '&LineNo=' . $LnItm->LineNo . '">'. + echo '<td><a href="GoodsReceivedControlled.php?identifier=' . $identifier . '&LineNo=' . $LnItm->LineNo . '">'. _('Enter Batches'). '</a></td>'; } } @@ -237,7 +237,7 @@ }elseif ($DeliveryQuantityTooLarge==1 AND isset($_POST['ProcessGoodsReceived'])){ prnMsg(_('Entered quantities cannot be greater than the quantity entered on the purchase invoice including the allowed over-receive percentage'). ' ' . '(' . $_SESSION['OverReceiveProportion'] .'%)','error'); - echo '<br>'; + echo '<br />'; prnMsg(_('Modify the ordered items on the purchase invoice if you wish to increase the quantities'),'info'); echo '<div class="centre"><input type=submit name=Update Value=' . _('Update') . '>'; @@ -314,9 +314,9 @@ <td>' . $myrow['quantityrecd'] . '</td></tr>'; echo '</table>'; } - echo "<div class='centre'><a href='$rootpath/PO_SelectOSPurchOrder.php?" . SID . "'>". + echo '<div class="centre"><a href="' . $rootpath . '/PO_SelectOSPurchOrder.php">'. _('Select a different purchase order for receiving goods against').'</a></div>'; - echo "<div class='centre'><a href='$rootpath/GoodsReceived.php?" . SID . '&PONumber=' . + echo '<div class="centre"><a href="' . $rootpath . '/GoodsReceived.php?PONumber=' . $_SESSION['PO'.$identifier]->OrderNumber . '">'. _('Re-read the updated purchase order for receiving goods against'). '</a></div>'; unset($_SESSION['PO'.$identifier]->LineItems); unset($_SESSION['PO'.$identifier]); @@ -681,8 +681,8 @@ unset($_SESSION['PO'.$identifier]); unset($_POST['ProcessGoodsReceived']); - echo '<br><div class=centre>'. _('GRN number'). ' '. $GRN .' '. _('has been processed').'<br>'; - echo '<br><a href=PDFGrn.php?GRNNo='.$GRN .'&PONo='.$PONo.'>'. _('Print this Goods Received Note (GRN)').'</a><br><br>'; + echo '<br /><div class=centre>'. _('GRN number'). ' '. $GRN .' '. _('has been processed').'<br />'; + echo '<br /><a href=PDFGrn.php?GRNNo='.$GRN .'&PONo='.$PONo.'>'. _('Print this Goods Received Note (GRN)').'</a><br /><br />'; echo '<a href="' . $rootpath . '/PO_SelectOSPurchOrder.php?' . SID . '">' . _('Select a different purchase order for receiving goods against'). '</a></div>'; /*end of process goods received entry */ @@ -691,9 +691,9 @@ } else { /*Process Goods received not set so show a link to allow mod of line items on order and allow input of date goods received*/ - echo '<br><div class="centre"><a href="' . $rootpath . '/PO_Items.php?=' . SID . '">' . _('Modify Order Items'). '</a></div>'; + echo '<br /><div class="centre"><a href="' . $rootpath . '/PO_Items.php">' . _('Modify Order Items'). '</a></div>'; - echo '<br><div class="centre"><input type=submit name=Update Value=' . _('Update') . '><p>'; + echo '<br /><div class="centre"><input type=submit name=Update Value=' . _('Update') . '><p>'; echo '<input type=submit name="ProcessGoodsReceived" Value="' . _('Process Goods Received') . '"></div>'; } Modified: trunk/GoodsReceivedControlled.php =================================================================== --- trunk/GoodsReceivedControlled.php 2011-02-11 16:43:22 UTC (rev 4489) +++ trunk/GoodsReceivedControlled.php 2011-02-13 04:15:38 UTC (rev 4490) @@ -12,21 +12,32 @@ /* Session started in header.inc for password checking and authorisation level check */ include('includes/header.inc'); -if (!isset($_SESSION['PO'])) { +if (empty($_GET['identifier'])) { + if (empty($_POST['identifier'])){ + $identifier=date('U'); + } else { + $identifier=$_POST['identifier']; + } +} else { + $identifier=$_GET['identifier']; +} + + +if (!isset($_SESSION['PO'.$identifier])) { /* This page can only be called with a purchase order number for receiving*/ - echo '<div class="centre"><a href="' . $rootpath . '/PO_SelectOSPurchOrder.php?' . SID . '">'. + echo '<div class="centre"><a href="' . $rootpath . '/PO_SelectOSPurchOrder.php">'. _('Select a purchase order to receive'). '</a></div><br>'; prnMsg( _('This page can only be opened if a purchase order and line item has been selected') . '. ' . _('Please do that first'),'error'); include('includes/footer.inc'); exit; } -if ($_GET['LineNo']>0){ +if (isset($_GET['LineNo'])){ $LineNo = $_GET['LineNo']; -} else if ($_POST['LineNo']>0){ +} elseif (isset($_POST['LineNo'])){ $LineNo = $_POST['LineNo']; } else { - echo '<div class="centre"><a href="' . $rootpath . '/GoodsReceived.php?' . SID . '">'. + echo '<div class="centre"><a href="' . $rootpath . '/GoodsReceived.php">'. _('Select a line Item to Receive').'</a></div>'; prnMsg( _('This page can only be opened if a Line Item on a PO has been selected') . '. ' . _('Please do that first'), 'error'); include( 'includes/footer.inc'); @@ -34,11 +45,11 @@ } global $LineItem; -$LineItem = &$_SESSION['PO']->LineItems[$LineNo]; +$LineItem = &$_SESSION['PO'.$identifier]->LineItems[$LineNo]; if ($LineItem->Controlled !=1 ){ /*This page only relavent for controlled items */ - echo '<div class="centre"><a href="' . $rootpath . '/GoodsReceived.php?' . SID . '">'. + echo '<div class="centre"><a href="' . $rootpath . '/GoodsReceived.php">'. _('Back to the Purchase Order'). '</a></div>'; prnMsg( _('The line being received must be controlled as defined in the item definition'), 'error'); include('includes/footer.inc'); @@ -50,13 +61,13 @@ ********************************************/ echo '<div class="centre">'; -echo '<br><a href="'.$rootpath.'/GoodsReceived.php?' . SID . '">'. _('Back To Purchase Order'). ' # '. $_SESSION['PO']->OrderNo . '</a>'; +echo '<br><a href="'.$rootpath.'/GoodsReceived.php?identifier=' .$identifier . '">'. _('Back To Purchase Order'). ' # '. $_SESSION['PO'.$identifier]->OrderNo . '</a>'; echo '<br><font size=2><b>'. _('Receive controlled item'). ' '. $LineItem->StockID . ' - ' . $LineItem->ItemDescription . - ' ' . _('on order') . ' ' . $_SESSION['PO']->OrderNo . ' ' . _('from') . ' ' . $_SESSION['PO']->SupplierName . '</b></font></div>'; + ' ' . _('on order') . ' ' . $_SESSION['PO'.$identifier]->OrderNo . ' ' . _('from') . ' ' . $_SESSION['PO'.$identifier]->SupplierName . '</b></font></div>'; /** vars needed by InputSerialItem : **/ -$LocationOut = $_SESSION['PO']->Location; +$LocationOut = $_SESSION['PO'.$identifier]->Location; $ItemMustExist = false; $StockID = $LineItem->StockID; $InOutModifier=1; @@ -67,7 +78,7 @@ /*TotalQuantity set inside this include file from the sum of the bundles of the item selected for dispatch */ -$_SESSION['PO']->LineItems[$LineItem->LineNo]->ReceiveQty = $TotalQuantity; +$_SESSION['PO'.$identifier]->LineItems[$LineItem->LineNo]->ReceiveQty = $TotalQuantity; include( 'includes/footer.inc'); ?> \ No newline at end of file Modified: trunk/PricesByCost.php =================================================================== --- trunk/PricesByCost.php 2011-02-11 16:43:22 UTC (rev 4489) +++ trunk/PricesByCost.php 2011-02-13 04:15:38 UTC (rev 4490) @@ -95,7 +95,7 @@ $SalesTypeRow = DB_fetch_array($ResultType); if (isset($CategoryRow['categorgdescription'])) { - $CategoryText = _('the') . ' ' . $CategoryRow['categorgdescription'] . ' ' . _('category'); + $CategoryText = $CategoryRow['categorgdescription'] . ' ' . _('category'); } else { $CategoryText = _('all Categories'); } /*end of else Category */ Modified: trunk/SelectOrderItems.php =================================================================== --- trunk/SelectOrderItems.php 2011-02-11 16:43:22 UTC (rev 4489) +++ trunk/SelectOrderItems.php 2011-02-13 04:15:38 UTC (rev 4490) @@ -238,7 +238,6 @@ $myrow['narrative'], 'No', /* Update DB */ $myrow['orderlineno'], - // ConvertSQLDate($myrow['itemdue']), 0, '', ConvertSQLDate($myrow['itemdue']), @@ -288,8 +287,7 @@ } } -$msg=''; - +//Customer logins are not allowed to select other customers henc in_array(2,$_SESSION['AllowedPageSecurityTokens']) if (isset($_POST['SearchCust']) AND $_SESSION['RequireCustomerSelection']==1 AND in_array(2,$_SESSION['AllowedPageSecurityTokens'])){ if (($_POST['CustKeywords']!='') AND (($_POST['CustCode']!='') OR ($_POST['CustPhone']!=''))) { @@ -371,22 +369,34 @@ if (DB_num_rows($result_CustSelect)==1){ $myrow=DB_fetch_array($result_CustSelect); - $_POST['Select'] = $myrow['debtorno'] . ' - ' . $myrow['branchcode']; + $SelectedCustomer= $myrow['debtorno'] . ' - ' . $myrow['branchcode']; } elseif (DB_num_rows($result_CustSelect)==0){ prnMsg(_('No Customer Branch records contain the search criteria') . ' - ' . _('please try again') . ' - ' . _('Note a Customer Branch Name may be different to the Customer Name'),'info'); } } /*one of keywords or custcode was more than a zero length string */ } /*end of if search for customer codes/names */ +if (isset($_POST['JustSelectedACustomer'])){ + /*Need to figure out the number of the form variable that the user clicked on */ + for ($i=1;$i<count($_POST);$i++){ //loop through the returned customers + if(isset($_POST['SubmitCustomerSelection'.$i])){ + break; + } + } + if ($i==count($_POST)){ + prnMsg(_('Unable to identify the selected customer'),'error'); + } else { + $SelectedCustomer = $_POST['SelectedCustomer'.$i]; + } +} +/* will only be true if page called from customer selection form or set because only one customer + record returned from a search so parse the $SelectCustomer string into customer code and branch code */ +if (isset($SelectedCustomer)) { + + $CustomerBranchArray = explode('-',$SelectedCustomer); + $_SESSION['Items'.$identifier]->DebtorNo = trim($CustomerBranchArray[0]); + $_SESSION['Items'.$identifier]->Branch = trim($CustomerBranchArray[1]); -// will only be true if page called from customer selection form or set because only one customer -// record returned from a search so parse the $Select string into customer code and branch code */ -if (isset($_POST['Select']) AND $_POST['Select']!='') { - - $_SESSION['Items'.$identifier]->Branch = substr($_POST['Select'],strpos($_POST['Select'],' - ')+3); - - $_POST['Select'] = substr($_POST['Select'],0,strpos($_POST['Select'],' - ')); - // Now check to ensure this account is not on hold */ $sql = "SELECT debtorsmaster.name, holdreasons.dissallowinvoices, @@ -402,30 +412,29 @@ WHERE debtorsmaster.salestype=salestypes.typeabbrev AND debtorsmaster.holdreason=holdreasons.reasoncode AND debtorsmaster.paymentterms=paymentterms.termsindicator - AND debtorsmaster.debtorno = '" . $_POST['Select'] . "'"; + AND debtorsmaster.debtorno = '" . $_SESSION['Items'.$identifier]->DebtorNo. "'"; - $ErrMsg = _('The details of the customer selected') . ': ' . $_POST['Select'] . ' ' . _('cannot be retrieved because'); + $ErrMsg = _('The details of the customer selected') . ': ' . $_SESSION['Items'.$identifier]->DebtorNo . ' ' . _('cannot be retrieved because'); $DbgMsg = _('The SQL used to retrieve the customer details and failed was') . ':'; $result =DB_query($sql,$db,$ErrMsg,$DbgMsg); - $myrow = DB_fetch_row($result); + $myrow = DB_fetch_array($result); if ($myrow[1] != 1){ if ($myrow[1]==2){ prnMsg(_('The') . ' ' . $myrow[0] . ' ' . _('account is currently flagged as an account that needs to be watched. Please contact the credit control personnel to discuss'),'warn'); } - $_SESSION['Items'.$identifier]->DebtorNo=$_POST['Select']; $_SESSION['RequireCustomerSelection']=0; - $_SESSION['Items'.$identifier]->CustomerName = $myrow[0]; + $_SESSION['Items'.$identifier]->CustomerName = $myrow['name']; # the sales type determines the price list to be used by default the customer of the user is # defaulted from the entry of the userid and password. - $_SESSION['Items'.$identifier]->DefaultSalesType = $myrow[2]; - $_SESSION['Items'.$identifier]->SalesTypeName = $myrow[3]; - $_SESSION['Items'.$identifier]->DefaultCurrency = $myrow[4]; - $_SESSION['Items'.$identifier]->DefaultPOLine = $myrow[5]; - $_SESSION['Items'.$identifier]->PaymentTerms = $myrow[6]; + $_SESSION['Items'.$identifier]->DefaultSalesType = $myrow['salestype']; + $_SESSION['Items'.$identifier]->SalesTypeName = $myrow['sales_type']; + $_SESSION['Items'.$identifier]->DefaultCurrency = $myrow['currcode']; + $_SESSION['Items'.$identifier]->DefaultPOLine = $myrow['customerpoline']; + $_SESSION['Items'.$identifier]->PaymentTerms = $myrow['terms']; # the branch was also selected from the customer selection so default the delivery details from the customer branches table CustBranch. The order process will ask for branch details later anyway @@ -449,24 +458,24 @@ INNER JOIN locations ON custbranch.defaultlocation=locations.loccode WHERE custbranch.branchcode='" . $_SESSION['Items'.$identifier]->Branch . "' - AND custbranch.debtorno = '" . $_POST['Select'] . "'"; + AND custbranch.debtorno = '" . $_SESSION['Items'.$identifier]->DebtorNo . "'"; - $ErrMsg = _('The customer branch record of the customer selected') . ': ' . $_POST['Select'] . ' ' . _('cannot be retrieved because'); + $ErrMsg = _('The customer branch record of the customer selected') . ': ' . $_SESSION['Items'.$identifier]->DebtorNo . ' ' . _('cannot be retrieved because'); $DbgMsg = _('SQL used to retrieve the branch details was') . ':'; $result =DB_query($sql,$db,$ErrMsg,$DbgMsg); if (DB_num_rows($result)==0){ - prnMsg(_('The branch details for branch code') . ': ' . $_SESSION['Items'.$identifier]->Branch . ' ' . _('against customer code') . ': ' . $_POST['Select'] . ' ' . _('could not be retrieved') . '. ' . _('Check the set up of the customer and branch'),'error'); + prnMsg(_('The branch details for branch code') . ': ' . $_SESSION['Items'.$identifier]->Branch . ' ' . _('against customer code') . ': ' . $_SESSION['Items'.$identifier]->DebtorNo . ' ' . _('could not be retrieved') . '. ' . _('Check the set up of the customer and branch'),'error'); if ($debug==1){ - echo '<br>' . _('The SQL that failed to get the branch details was') . ':<br>' . $sql; + prnMsg( _('The SQL that failed to get the branch details was') . ':<br />' . $sql . 'warning'); } include('includes/footer.inc'); exit; } // add echo - echo '<br>'; + echo '<br />'; $myrow = DB_fetch_row($result); if ($_SESSION['SalesmanLogin']!='' AND $_SESSION['SalesmanLogin']!=$myrow[15]){ prnMsg(_('Your login is only set up for a particular salesperson. This customer has a different salesperson.'),'error'); @@ -494,7 +503,7 @@ prnMsg($_SESSION['Items'.$identifier]->SpecialInstructions,'warn'); if ($_SESSION['CheckCreditLimits'] > 0){ /*Check credit limits is 1 for warn and 2 for prohibit sales */ - $_SESSION['Items'.$identifier]->CreditAvailable = GetCreditAvailable($_POST['Select'],$db); + $_SESSION['Items'.$identifier]->CreditAvailable = GetCreditAvailable($_SESSION['Items'.$identifier]->DebtorNo,$db); if ($_SESSION['CheckCreditLimits']==1 AND $_SESSION['Items'.$identifier]->CreditAvailable <=0){ prnMsg(_('The') . ' ' . $myrow[0] . ' ' . _('account is currently at or over their credit limit'),'warn'); @@ -524,12 +533,8 @@ WHERE debtorsmaster.holdreason=holdreasons.reasoncode AND debtorsmaster.debtorno = '" . $_SESSION['Items'.$identifier]->DebtorNo . "'"; - if (isset($_POST['Select'])) { - $ErrMsg = _('The details for the customer selected') . ': ' . $_POST['Select'] . ' ' . _('cannot be retrieved because'); - } else { - $ErrMsg = ''; - } - $DbgMsg = _('SQL used to retrieve the customer details was') . ':<br>' . $sql; + $ErrMsg = _('The details for the customer selected') . ': ' .$_SESSION['Items'.$identifier]->DebtorNo . ' ' . _('cannot be retrieved because'); + $DbgMsg = _('SQL used to retrieve the customer details was') . ':<br />' . $sql; $result =DB_query($sql,$db,$ErrMsg,$DbgMsg); $myrow = DB_fetch_row($result); @@ -568,11 +573,7 @@ WHERE custbranch.branchcode='" . $_SESSION['Items'.$identifier]->Branch . "' AND custbranch.debtorno = '" . $_SESSION['Items'.$identifier]->DebtorNo . "'"; - if (isset($_POST['Select'])) { - $ErrMsg = _('The customer branch record of the customer selected') . ': ' . $_POST['Select'] . ' ' . _('cannot be retrieved because'); - } else { - $ErrMsg = ''; - } + $ErrMsg = _('The customer branch record of the customer selected') . ': ' . $_SESSION['Items'.$identifier]->DebtorNo . ' ' . _('cannot be retrieved because'); $DbgMsg = _('SQL used to retrieve the branch details was'); $result =DB_query($sql,$db,$ErrMsg, $DbgMsg); @@ -610,7 +611,6 @@ <?php echo '<input type="hidden" name="FormID" value="' . $_SESSION['FormID'] . '" />'; ?> - <b><?php echo '<p>' . $msg; ?></p> <table cellpadding=3 colspan=4 class=selection> <tr> <td><h5><?php echo _('Part of the Customer Branch Name'); ?>:</h5></td> @@ -623,7 +623,7 @@ <td><input tabindex=3 type="Text" name="CustPhone" size=15 maxlength=18></td> </tr> </table> - <br><div class="centre"><input tabindex=4 type=submit name="SearchCust" value="<?php echo _('Search Now'); ?>"> + <br /><div class="centre"><input tabindex=4 type=submit name="SearchCust" value="<?php echo _('Search Now'); ?>"> <input tabindex=5 type=submit action=reset value="<?php echo _('Reset'); ?>"></div> <?php @@ -631,7 +631,7 @@ echo '<table cellpadding=2 colspan=7>'; - $TableHeader = '<br><tr> + $TableHeader = '<br /><tr> <th>' . _('Customer') . '</th> <th>' . _('Branch') . '</th> <th>' . _('Contact') . '</th> @@ -659,20 +659,20 @@ } else { echo '<td></td>'; } - echo '<td><input tabindex='.number_format($j+5).' type=submit name="Submit" value="'.$myrow['brname'].'"</td> - <input type=hidden name="Select" value="'.$myrow['debtorno'].' - '.$myrow['branchcode'].'"> + echo '<td><input tabindex='.($j+5).' type=submit name="SubmitCustomerSelection' . $j .'" value="' . htmlentities($myrow['brname']) . '"></td> + <input type="hidden" name="SelectedCustomer' . $j .'" value="'.$myrow['debtorno'] .' - '.$myrow['branchcode'].'"> <td>'.$myrow['contactname'].'</td> <td>'.$myrow['phoneno'].'</td> <td>'.$myrow['faxno'].'</td> - </tr></form>'; + </tr>'; $LastCustomer=$myrow['name']; $j++; //end of page full new headings if } //end of while loop + echo '<input type="hidden" name="JustSelectedACustomer" value="Yes">'; + echo '</table></form>'; - echo '</table>'; - }//end if results to show //end if RequireCustomerSelection @@ -723,7 +723,7 @@ } else { $_SESSION['RequireCustomerSelection'] = 0; } - echo '<br><br>'; + echo '<br /><br />'; prnMsg(_('This sales order has been cancelled as requested'),'success'); include('includes/footer.inc'); exit; @@ -739,13 +739,13 @@ } echo ':<b> ' . $_SESSION['Items'.$identifier]->DebtorNo . ' ' . _('Customer Name') . ': ' . $_SESSION['Items'.$identifier]->CustomerName; - echo '</b></p><div class="page_help_text">' . '<b>' . _('Default Options (can be modified during order):') . '</b><br>' . _('Deliver To') . ':<b> ' . $_SESSION['Items'.$identifier]->DeliverTo; + echo '</b></p><div class="page_help_text">' . '<b>' . _('Default Options (can be modified during order):') . '</b><br />' . _('Deliver To') . ':<b> ' . $_SESSION['Items'.$identifier]->DeliverTo; echo '</b> ' . _('From Location') . ':<b> ' . $_SESSION['Items'.$identifier]->LocationName; - echo '</b><br>' . _('Sales Type') . '/' . _('Price List') . ':<b> ' . $_SESSION['Items'.$identifier]->SalesTypeName; - echo '</b><br>' . _('Terms') . ':<b> ' . $_SESSION['Items'.$identifier]->PaymentTerms; + echo '</b><br />' . _('Sales Type') . '/' . _('Price List') . ':<b> ' . $_SESSION['Items'.$identifier]->SalesTypeName; + echo '</b><br />' . _('Terms') . ':<b> ' . $_SESSION['Items'.$identifier]->PaymentTerms; echo '</b></div>'; } - + $msg =''; if (isset($_POST['Search']) or isset($_POST['Next']) or isset($_POST['Prev'])){ if ($_POST['Keywords']!=='' AND $_POST['StockCode']=='') { @@ -769,7 +769,7 @@ WHERE stockmaster.categoryid=stockcategory.categoryid AND (stockcategory.stocktype='F' OR stockcategory.stocktype='D') AND stockmaster.mbflag <>'G' - AND stockmaster.description " . LIKE . " '$SearchString' + AND stockmaster.description " . LIKE . " '" . $SearchString . "' AND stockmaster.discontinued=0 ORDER BY stockmaster.stockid"; } else { @@ -1280,13 +1280,13 @@ /* This is where the order as selected should be displayed reflecting any deletions or insertions*/ - echo '<br> + echo '<br /> <table width="90%" cellpadding="2" colspan="7"> <tr bgcolor=#800000>'; if($_SESSION['Items'.$identifier]->DefaultPOLine == 1){ echo '<th>' . _('PO Line') . '</th>'; } - echo '<div class="page_help_text">' . _('Quantity (required) - Enter the number of units ordered. Price (required) - Enter the unit price. Discount (optional) - Enter a percentage discount. GP% (optional) - Enter a percentage Gross Profit (GP) to add to the unit cost. Due Date (optional) - Enter a date for delivery.') . '</div><br>'; + echo '<div class="page_help_text">' . _('Quantity (required) - Enter the number of units ordered. Price (required) - Enter the unit price. Discount (optional) - Enter a percentage discount. GP% (optional) - Enter a percentage Gross Profit (GP) to add to the unit cost. Due Date (optional) - Enter a date for delivery.') . '</div><br />'; echo '<th>' . _('Item Code') . '</th> <th>' . _('Item Description') . '</th> <th>' . _('Quantity') . '</th> @@ -1336,7 +1336,7 @@ echo '<td><input class="number" tabindex=2 type=tect name="Quantity_' . $OrderLine->LineNumber . '" size=6 maxlength=6 value=' . $OrderLine->Quantity . '>'; if ($QtyRemain != $QtyOrdered){ - echo '<br>'.$OrderLine->QtyInv.' of '.$OrderLine->Quantity.' invoiced'; + echo '<br />'.$OrderLine->QtyInv.' of '.$OrderLine->Quantity.' invoiced'; } echo '</td> <td class="number">' . $OrderLine->QOHatLoc . '</td> @@ -1369,7 +1369,7 @@ if ($_SESSION['AllowOrderLineItemNarrative'] == 1){ echo $RowStarter; - echo '<td colspan=10>' . _('Narrative') . ':<textarea name="Narrative_' . $OrderLine->LineNumber . '" cols="100%" rows="1">' . stripslashes(AddCarriageReturns($OrderLine->Narrative)) . '</textarea><br></td></tr>'; + echo '<td colspan=10>' . _('Narrative') . ':<textarea name="Narrative_' . $OrderLine->LineNumber . '" cols="100%" rows="1">' . stripslashes(AddCarriageReturns($OrderLine->Narrative)) . '</textarea><br /></td></tr>'; } else { echo '<input type=hidden name="Narrative" value="">'; } @@ -1398,7 +1398,7 @@ </tr></table>'; - echo '<br><div class="centre"><input type=submit name="Recalculate" Value="' . _('Re-Calculate') . '"> + echo '<br /><div class="centre"><input type=submit name="Recalculate" Value="' . _('Re-Calculate') . '"> <input type=submit name="DeliveryDetails" value="' . _('Enter Delivery Details and Confirm Order') . '"></div><hr>'; } # end of if lines @@ -1428,8 +1428,8 @@ $result2 = DB_query($SQL,$db); echo '<p class="page_title_text"><img src="'.$rootpath.'/css/'.$theme.'/images/magnifier.png" title="' . _('Search') . '" alt="" />' . ' '; - echo _('Frequently Ordered Items') . '</p><br>'; - echo '<div class="page_help_text">' . _('Frequently Ordered Items') . _(', shows the most frequently ordered items in the last 6 months. You can choose from this list, or search further for other items') . '.</div><br>'; + echo _('Frequently Ordered Items') . '</p><br />'; + echo '<div class="page_help_text">' . _('Frequently Ordered Items') . _(', shows the most frequently ordered items in the last 6 months. You can choose from this list, or search further for other items') . '.</div><br />'; echo '<table class="table1">'; $TableHeader = '<tr><th>' . _('Code') . '</th> <th>' . _('Description') . '</th> @@ -1553,7 +1553,7 @@ echo '<p><div class="centre"><b><p>' . $msg . '</b></p>'; echo '<p class="page_title_text"><img src="'.$rootpath.'/css/'.$theme.'/images/magnifier.png" title="' . _('Search') . '" alt="" />' . ' '; echo _('Search for Order Items') . '</p>'; - echo '<div class="page_help_text">' . _('Search for Order Items') . _(', Searches the database for items, you can narrow the results by selecting a stock category, or just enter a partial item description or partial item code') . '.</div><br>'; + echo '<div class="page_help_text">' . _('Search for Order Items') . _(', Searches the database for items, you can narrow the results by selecting a stock category, or just enter a partial item description or partial item code') . '.</div><br />'; echo '<table class="selection"><tr><td><b>' . _('Select a Stock Category') . ': </b><select tabindex=1 name="StockCat">'; if (!isset($_POST['StockCat'])){ @@ -1601,13 +1601,13 @@ if (in_array(2,$_SESSION['AllowedPageSecurityTokens'])){ //not a customer entry of own order echo '<td style="text-align:center" colspan=1><input tabindex=6 type="submit" name="ChangeCustomer" value="' . _('Change Customer') . '"></td> <td style="text-align:center" colspan=1><input tabindex=7 type="submit" name="SelectAsset" value="' . _('Fixed Asset Disposal') . '"></td> - </tr></table><br>'; + </tr></table><br />'; } if (isset($SearchResult)) { - echo '<br>'; + echo '<br />'; echo '<div class="page_help_text">' . _('Select an item by entering the quantity required. Click Order when ready.') . '</div>'; - echo '<br>'; + echo '<br />'; $j = 1; echo '<form action="' . $_SERVER['PHP_SELF'] . '?' . SID .'identifier='.$identifier . ' method=post name="orderform">'; echo '<input type="hidden" name="FormID" value="' . $_SESSION['FormID'] . '" />'; @@ -1631,7 +1631,7 @@ while ($myrow=DB_fetch_array($SearchResult)) { // Find the quantity in stock at location - $QOHSQL = "SELECT sum(quantity) AS qoh, + $QOHSQL = "SELECT quantity AS qoh, stockmaster.decimalplaces FROM locstock INNER JOIN stockmaster ON locstock.stockid = stockmaster.stockid @@ -1662,11 +1662,12 @@ } // Find the quantity on purchase orders - $sql = "SELECT SUM(purchorderdetails.quantityord-purchorderdetails.quantityrecd) AS dem + $sql = "SELECT SUM(purchorderdetails.quantityord-purchorderdetails.quantityrecd) AS qoo FROM purchorderdetails INNER JOIN purchorders WHERE purchorderdetails.completed=0 AND purchorders.status<>'Cancelled' AND purchorders.status<>'Rejected' + AND purchorders.status<>'Pending' AND purchorderdetails.itemcode='" . $myrow['stockid'] . "'"; $ErrMsg = _('The order details for this product cannot be retrieved because'); @@ -1741,7 +1742,7 @@ } /*end of PartSearch options to be displayed */ elseif( isset($_POST['QuickEntry'])) { /* show the quick entry form variable */ /*FORM VARIABLES TO POST TO THE ORDER WITH PART CODE AND QUANTITY */ - echo '<div class="page_help_text"><b>' . _('Use this screen for the '). _('Quick Entry')._(' of products to be ordered') . '</b></div><br> + echo '<div class="page_help_text"><b>' . _('Use this screen for the '). _('Quick Entry')._(' of products to be ordered') . '</b></div><br /> <table border=1> <tr>'; /*do not display colum unless customer requires po line number by sales order line*/ @@ -1767,12 +1768,12 @@ } echo '<script type="text/javascript">if (document.SelectParts) {defaultControl(document.SelectParts.part_1);}</script>'; - echo '</table><br><div class="centre"><input type="submit" name="QuickEntry" value="' . _('Quick Entry') . '"> + echo '</table><br /><div class="centre"><input type="submit" name="QuickEntry" value="' . _('Quick Entry') . '"> <input type="submit" name="PartSearch" value="' . _('Search Parts') . '"></div>'; } elseif (isset($_POST['SelectAsset'])){ - echo '<div class="page_help_text"><b>' . _('Use this screen to select an asset to dispose of to this customer') . '</b></div><br> + echo '<div class="page_help_text"><b>' . _('Use this screen to select an asset to dispose of to this customer') . '</b></div><br /> <table border=1>'; /*do not display colum unless customer requires po line number by sales order line*/ if($_SESSION['Items'.$identifier]->DefaultPOLine ==1){ @@ -1787,13 +1788,13 @@ echo '<option value="' . $AssetRow['assetid'] . '">' . $AssetRow['assetid'] . ' - ' . $AssetRow['description'] . '</option>'; } echo '</select></td></tr></table> - <br><div class="centre"><input type="submit" name="AssetDisposalEntered" value="' . _('Add Asset To Order') . '"> + <br /><div class="centre"><input type="submit" name="AssetDisposalEntered" value="' . _('Add Asset To Order') . '"> <input type="submit" name="PartSearch" value="' . _('Search Parts') . '"></div>'; } //end of if it is a Quick Entry screen/part search or asset selection form to display if ($_SESSION['Items'.$identifier]->ItemsOrdered >=1){ - echo '<br><div class="centre"><input type=submit name="CancelOrder" value="' . _('Cancel Whole Order') . '" onclick="return confirm(\'' . _('Are you sure you wish to cancel this entire order?') . '\');"></div>'; + echo '<br /><div class="centre"><input type=submit name="CancelOrder" value="' . _('Cancel Whole Order') . '" onclick="return confirm(\'' . _('Are you sure you wish to cancel this entire order?') . '\');"></div>'; } }#end of else not selecting a customer @@ -1803,4 +1804,4 @@ echo '<script type="text/javascript">if (document.SelectParts) {defaultControl(document.SelectCustomer.CustKeywords);}</script>'; } include('includes/footer.inc'); -?> +?> \ No newline at end of file Modified: trunk/StockSerialItems.php =================================================================== --- trunk/StockSerialItems.php 2011-02-11 16:43:22 UTC (rev 4489) +++ trunk/StockSerialItems.php 2011-02-13 04:15:38 UTC (rev 4490) @@ -11,6 +11,11 @@ '" alt="" /><b>' . $title. '</b></p>'; if (isset($_GET['StockID'])){ + if (ContainsIllegalCharacters ($_GET['StockID'])){ + prnMsg(_('The stock code sent to this page appears to be invalid'),'error'); + include('includes/footer.inc'); + exit; + } $StockID = trim(strtoupper($_GET['StockID'])); } else { prnMsg( _('This page must be called with parameters specifying the item to show the serial references and quantities') . '. ' . _('It cannot be displayed without the proper parameters being passed'),'error'); Modified: trunk/SuppInvGRNs.php =================================================================== --- trunk/SuppInvGRNs.php 2011-02-11 16:43:22 UTC (rev 4489) +++ trunk/SuppInvGRNs.php 2011-02-13 04:15:38 UTC (rev 4490) @@ -241,7 +241,7 @@ <td>' . $GRNTmp->ItemCode . ' ' . $GRNTmp->ItemDescription . '</td> <td class=number>' . number_format($GRNTmp->QtyRecd - $GRNTmp->Prev_QuantityInv,2) . '</td> <td><input type="text" class="number" Name="This_QuantityInv" Value="' . $GRNTmp->This_QuantityInv . '" size=11 maxlength=10></td> - <td class=number>"' . $GRNTmp->OrderPrice . '"</td> + <td class=number>' . $GRNTmp->OrderPrice . '</td> <td><input type="text" class="number" Name="ChgPrice" Value=' . $GRNTmp->ChgPrice . ' size="11" maxlength="10"></td> </tr>'; echo '</table>'; Modified: trunk/SystemParameters.php =================================================================== --- trunk/SystemParameters.php 2011-02-11 16:43:22 UTC (rev 4489) +++ trunk/SystemParameters.php 2011-02-13 04:15:38 UTC (rev 4490) @@ -623,14 +623,14 @@ <td><select Name="X_PO_AllowSameItemMultipleTimes"> <option '.($_SESSION['PO_AllowSameItemMultipleTimes']?'selected ':'').'value="1">'._('Yes') . '</option> <option '.(!$_SESSION['PO_AllowSameItemMultipleTimes']?'selected ':'').'value="0">'._('No') . '</option> - </select></td> <td></td></tr>'; + </select></td><td>' . _('If a purchase order can have the same item on the order several times this parameter should be set to yes') . '</td></tr>'; // AutoAuthorisePO echo '<tr style="outline: 1px solid"><td>' . _('Automatically authorise purchase orders if user has authority') . ':</td> <td><select Name="X_AutoAuthorisePO"> <option '.($_SESSION['AutoAuthorisePO'] ?'selected ':'').'value="1">'._('Yes').' <option '.(!$_SESSION['AutoAuthorisePO'] ?'selected ':'').'value="0">'._('No').' - </select></td>' . _('If the user changing an existing purchase order or adding a new puchase order is set up to authorise purchase orders and the order is within their limit, then the purchase order status is automatically set to authorised') . '<td></td></tr>'; + </select></td><td>' . _('If the user changing an existing purchase order or adding a new puchase order is set up to authorise purchase orders and the order is within their limit, then the purchase order status is automatically set to authorised') . '</td></tr>'; echo '<tr><th colspan=3>' . _('General Settings') . '</th></tr>'; Modified: trunk/UpgradeDatabase.php =================================================================== --- trunk/UpgradeDatabase.php 2011-02-11 16:43:22 UTC (rev 4489) +++ trunk/UpgradeDatabase.php 2011-02-13 04:15:38 UTC (rev 4490) @@ -29,7 +29,7 @@ echo '<option value="3.08">' . _('Version 3.08') . '</option>'; echo '<option value="3.09">' . _('Version 3.09') . '</option>'; echo '<option value="3.10">' . _('Version 3.10') . '</option>'; - echo '<option value="3.11">' . _('Version 3.11') . '</option>'; + echo '<option value="3.11">' . _('Version 3.11 or 4.01 - 4.02') . '</option>'; echo '</select></td></tr></table>'; } else { if ($_SESSION['VersionNumber']=='4.00-RC1'){ @@ -48,7 +48,7 @@ if ($dbType=='mysql' OR $dbType =='mysqli'){ /* First do a backup */ - $BackupFile = '.' . $PathPrefix . '/companies/' . $_SESSION['DatabaseName'] .'/' . _('Backup') . '_' . Date('Y-m-d-H-i-s') . '.gz'; + $BackupFile = $PathPrefix . './companies/' . $_SESSION['DatabaseName'] .'/' . _('Backup') . '_' . Date('Y-m-d-H-i-s') . '.sql.gz'; $Command = 'mysqldump --opt -h' . $host . ' -u' . $dbuser . ' -p' . $dbpassword . ' ' . $_SESSION['DatabaseName'] . '| gzip > ' . $BackupFile; system($Command); Modified: trunk/doc/Change.log.html =================================================================== --- trunk/doc/Change.log.html 2011-02-11 16:43:22 UTC (rev 4489) +++ trunk/doc/Change.log.html 2011-02-13 04:15:38 UTC (rev 4490) @@ -1,5 +1,9 @@ <p><font SIZE=4 COLOR=BLUE><b>webERP Change Log</b></font></p -<p></p> +<p /> +<p>13/2/11 Release 4.03RC1</p> +<p /> +<p>13/2/11:Phil GoodsReceivedControlled InputSerialItems and friends - now uses session identifier to ensure uniqueness is several people entering stock receipts</p> +<p>13/2/11:Phil Contracts.php SelectOrderItems.php customer selection mechanism reworked - was causing issues in Contracts as noted by DK Shukla</p> <p>8/2/11: Tim Rework CounterSales.php so that it is now possible to sell items that have sales/purchasing tax</p> <p>8/2/11: Phil Fix InventoryPlanning and InventoryPlanningPrefSupplier to only show sales order demand - excluding quotations. Also fixed for conversionfactor as now all purchase order quantities are in our normal stock units</p> <p>8/2/11: Phil Fix incorrect layout of narrative on multiple lines of PDFQuotation.php as reported by Ricard Andreu</p> Modified: trunk/doc/INSTALL.txt =================================================================== --- trunk/doc/INSTALL.txt 2011-02-11 16:43:22 UTC (rev 4489) +++ trunk/doc/INSTALL.txt 2011-02-13 04:15:38 UTC (rev 4490) @@ -4,8 +4,12 @@ Upgrading -A php upgrade script is provided for versions from 3.05 that applies the database changes required to move from the previous version to the newer version - this script also updates any data as required to work with the new version scripts. Simply point your browser to Z_Upgrade3.06-3.07.php (for an upgrade between 3.06 and 3.07 - similar naming convention applies to subsequent releases) and follow the prompts. If you are upgrading through several versions eg. from 3.05 to 3.08 then you must run each successive Z_UpgradeX.XX-X.XY.php script in sequence. +As from version 4.01 an automated database upgrade mechanism has been built in. Just copy the extract the scripts and copy: +1. config.php file from your old installation and +2. webERP/companies directory into the new webERP directory structure +Open up the webERP/index.php and the system will identify any database changes required. If the system is unable to indentify the database changes required - if the old system was a version prior to 4.01 then it will prompt you to select the old version you were using. The necessary database changes will then be applied automatically. + If the database must be updated manually (as it must for versions prior to 3.05): The SQL scripts are included under webERP/sql/mysql/ to update an existing mysql webERP database to the current version. The upgrade script no longer assumes the weberp database is called webERP. If using the mysql command line client then each upgrade SQL script must be edited to enter the name of the database to upgrade by adding a line @@ -41,7 +45,6 @@ The install script checks for the appropriate permissions and will not even attempt to install unless the web-server has the necessary write access to the files. - Manual Installation Read on below if you cannot use the installer to set up your installation for some reason or you simply wish to understand what is going on when the installer runs. @@ -50,7 +53,7 @@ Pre-requisites: -- A working PHP web server - v 5.0 or later is required (it no longer works with versions prior) PHP must have support for mysql databases (either mysql or mysqli), gd, gettext and ftp +- A working PHP web server - v 5.0 or later is required (it no longer works with versions prior) PHP must have support for mysql databases (either mysql or mysqli), gd, gettext, libxml and ftp - A working MySQL server (MySql version 4.1 or above - innodb tables MUST be enabled - check your my.cnf file to ensure innodb tables are enabled (normally under /etc/my.cnf or the mysql data directory - see the MySQL manual). Installing these components are well covered elsewhere - but if you need to install these components the recommended solution under windows would be to download and install apache2triad - http://apache2triad.net/ or under windows or *nix download and install XAMPP - http://www.apachefriends.org/en/xampp.html Modified: trunk/includes/ConnectDB.inc =================================================================== --- trunk/includes/ConnectDB.inc 2011-02-11 16:43:22 UTC (rev 4489) +++ trunk/includes/ConnectDB.inc 2011-02-13 04:15:38 UTC (rev 4490) @@ -4,7 +4,7 @@ * this value is saved in the $_SESSION['Versionumber'] when includes/GetConfig.php is run * if VersionNumber is < $Version then the DB update script is run */ -$Version='3.12.32'; //must update manually every time there is a DB change +$Version='4.03'; //must update manually every time there is a DB change require_once ($PathPrefix .'includes/MiscFunctions.php'); Modified: trunk/includes/InputSerialItems.php =================================================================== --- trunk/includes/InputSerialItems.php 2011-02-11 16:43:22 UTC (rev 4489) +++ trunk/includes/InputSerialItems.php 2011-02-13 04:15:38 UTC (rev 4490) @@ -48,7 +48,7 @@ $invalid_imports = 0; $valid = true; -echo '<form method="post" action="' . $_SERVER['PHP_SELF'] . '?' . SID . '" enctype="multipart/form-data" >'; +echo '<form method="post" action="' . $_SERVER['PHP_SELF'] . '?identifier=' . $identifier .'" enctype="multipart/form-data" >'; echo '<input type="hidden" name="FormID" value="' . $_SESSION['FormID'] . '" />'; echo '<input type=hidden name="LineNo" value="' . $LineNo . '">'; echo '<input type=hidden name="StockID" value="'. $StockID. '">'; @@ -71,7 +71,7 @@ } echo '<td valign=bottom>'; -echo '<input type=radio id="FileEntry" name=EntryType onClick="submit();" '; +echo '<input type="radio" id="FileEntry" name="EntryType" onClick="submit();" '; if ($_POST['EntryType']=='FILE') { echo ' checked '; } @@ -84,9 +84,9 @@ global $tableheader; /* Link to clear the list and start from scratch */ -$EditLink = '<br><div class="centre"><a href="' . $_SERVER['PHP_SELF'] . '?' . SID . '&EditControlled=true&StockID=' . $LineItem->StockID . +$EditLink = '<br><div class="centre"><a href="' . $_SERVER['PHP_SELF'] . '?identifier=' . $identifier . '&EditControlled=true&StockID=' . $LineItem->StockID . '&LineNo=' . $LineNo .'">'. _('Edit'). '</a> | '; -$RemoveLink = '<a href="' . $_SERVER['PHP_SELF'] . '?' . SID . '&DELETEALL=YES&StockID=' . $LineItem->StockID . +$RemoveLink = '<a href="' . $_SERVER['PHP_SELF'] . '?identifier=' . $identifier . '&DELETEALL=YES&StockID=' . $LineItem->StockID . '&LineNo=' . $LineNo .'">'. _('Remove All'). '</a><br></div>'; if ($LineItem->Serialised==1){ $tableheader .= '<tr> Modified: trunk/includes/InputSerialItemsExisting.php =================================================================== --- trunk/includes/InputSerialItemsExisting.php 2011-02-11 16:43:22 UTC (rev 4489) +++ trunk/includes/InputSerialItemsExisting.php 2011-02-13 04:15:38 UTC (rev 4490) @@ -29,10 +29,11 @@ echo '<form action="' . $_SERVER['PHP_SELF'] . '?=' . SID . '" method="POST">'; echo '<input type="hidden" name="FormID" value="' . $_SESSION['FormID'] . '" />'; - echo '<input type=hidden name=LineNo value="' . $LineNo . '"> - <input type=hidden name=StockID value="' . $StockID . '"> - <input type=hidden name=EntryType value="KEYED"> - <input type=hidden name=EditControlled value="true"> + echo '<input type=hidden name="LineNo" value="' . $LineNo . '"> + <input type="hidden" name="StockID" value="' . $StockID . '"> + <input type="hidden" name="EntryType" value="KEYED"> + <input type=hidden name="identifier" value="' . $identifier . '"> + <input type="hidden" name="EditControlled" value="true"> <select Name=Bundles[] multiple>'; $id=0; Modified: trunk/includes/InputSerialItemsFile.php =================================================================== --- trunk/includes/InputSerialItemsFile.php 2011-02-11 16:43:22 UTC (rev 4489) +++ trunk/includes/InputSerialItemsFile.php 2011-02-13 04:15:38 UTC (rev 4490) @@ -34,17 +34,17 @@ //only show 1st 10 lines if ($RowCounter < 10){ if ($k==1){ - echo '<tr bgcolor="#CCCCCC">'; + echo '<tr class="EvenTableRows">'; $k=0; } else { - echo '<tr bgcolor="#EEEEEE">'; + echo '<tr class="OddTableRows">'; $k=1; } - echo '<TD>' . $Bundle->BundleRef . '</TD>'; + echo '<td>' . $Bundle->BundleRef . '</td>'; if ($LineItem->Serialised==0){ - echo '<TD ALIGN=RIGHT>' . number_format($Bundle->BundleQty, $LineItem->DecimalPlaces) . '</TD>'; + echo '<td align=right>' . number_format($Bundle->BundleQty, $LineItem->DecimalPlaces) . '</td>'; } } @@ -54,16 +54,16 @@ /*Display the totals and rule off before allowing new entries */ if ($LineItem->Serialised==1){ - echo '<TR><TD ALIGN=RIGHT><B>'. _('Total Quantity'). ': ' . number_format($TotalQuantity,$LineItem->DecimalPlaces) . '</B></TD></TR>'; - echo '<TR><TD><HR></TD></TR>'; + echo '<tr><td align=right><b>'. _('Total Quantity'). ': ' . number_format($TotalQuantity,$LineItem->DecimalPlaces) . '</b></td></tr>'; + echo '<tr><td><hr></td></tr>'; } else { - echo '<TR><TD ALIGN=RIGHT><B>'. _('Total Quantity'). ':</B></TD><TD ALIGN=RIGHT><B>' . number_format($TotalQuantity,$LineItem->DecimalPlaces) . '</B></TD></TR>'; - echo '<TR><TD COLSPAN=2><HR></TD></TR>'; + echo '<tr><td align=right><b>'. _('Total Quantity'). ':</B></TD><TD ALIGN=RIGHT><B>' . number_format($TotalQuantity,$LineItem->DecimalPlaces) . '</b></td></tr>'; + echo '<tr><td colspan=2><hr></td></tr>'; } -echo '</TABLE><HR>'; -//echo "<TABLE><TR><TD>"; +echo '</table><hr>'; + //DISPLAY FILE INFO // do some inits & error checks... $ShowFileInfo = false; @@ -75,18 +75,18 @@ $msg = _('Please Choose a file and then click Set Entry Type to upload a file for import'); prnMsg($msg); $LineItem->SerialItemsValid=false; - echo '</TD></TR></TABLE>'; + echo '</td></tr></table>'; include('includes/footer.inc'); exit(); } if ($_FILES['ImportFile']['error'] != '' && !isset($_SESSION['CurImportFile'])){ - echo _('There was a problem with the uploaded file') . '. ' . _('We received').':<BR>'. - _('Name').':'.$_FILES['ImportFile']['name'].'<br>'. - _('Size').':'.number_format($_FILES['ImportFile']['size']/1024,2).'kb<br>'. - _('Type').':'.$_FILES['ImportFile']['type'].'<br>'; - echo '<br>'._('Error was').' '.$_FILES['ImportFile']['error'].'<br>'; + echo _('There was a problem with the uploaded file') . '. ' . _('We received').':<br />'. + _('Name').':'.$_FILES['ImportFile']['name'].'<br />'. + _('Size').':'.number_format($_FILES['ImportFile']['size']/1024,2).'kb<br />'. + _('Type').':'.$_FILES['ImportFile']['type'].'<br />'; + echo '<br />'._('Error was').' '.$_FILES['ImportFile']['error'].'<br />'; $LineItem->SerialItemsValid=false; - echo '</TD></TR></TABLE>'; + echo '</td></tr></table>'; include('includes/footer.inc'); exit(); } elseif ($_FILES['ImportFile']['name']!=''){ @@ -100,18 +100,18 @@ if (!move_uploaded_file($_FILES['ImportFile']['tmp_name'],$_SESSION['CurImportFile']['tmp_name'])){ prnMsg(_('Error moving temporary file') . '. ' . _('Please check your configuration'),'error' ); $LineItem->SerialItemsValid=false; - echo '</TD></TR></TABLE>'; + echo '</td></tr></table>'; include('includes/footer.inc'); exit; } if ($_FILES['ImportFile']['name']!=''){ - echo _('Successfully received').':<br>'; + echo _('Successfully received').':<br />'; $ShowFileInfo = true; } } elseif (isset($_SESSION['CurImportFile']) && $_SESSION['CurImportFile']['Processed'] ) { //file exists, some action performed... - echo _('Working with'). ':<br>'; + echo _('Working with'). ':<br />'; $ShowFileInfo = true; } elseif ($LineItem->SerialItemsValid && $_SESSION['CurImportFile']['Processed']){ $ShowInfo = true; @@ -120,20 +120,20 @@ /******************************************** Display file info for visual verification ********************************************/ - echo '<TABLE>'; + echo '<table>'; echo '<tr><td>'._('Name').':</td><td>'.$_SESSION['CurImportFile']['name'].'</td></tr> <tr><td>'. _('Size') .':</td><td>' . number_format($_SESSION['CurImportFile']['size']/1024,4) . 'kb</td></tr> <tr><td>'. _('Type') .':</td><td>' . $_SESSION['CurImportFile']['type'] . '</td></tr> <tr><td>'. _('TempName') .':</td><td>' . $_SESSION['CurImportFile']['tmp_name'] . '</td></tr> <tr><td>'. _('Status') .':</td><td>' . ($LineItem->SerialItemsValid?getMsg(_('Valid'),'success'):getMsg(_('Invalid'),'error')) . '</td></tr> - </TABLE>'. - $invalid_imports.' '. _('out of') .' '.$TotalLines.' '. _('records are invalid').'<br>'; + </table>'. + $invalid_imports.' '. _('out of') .' '.$TotalLines.' '. _('records are invalid').'<br />'; $filename = $_SESSION['CurImportFile']['tmp_name']; } if (!$LineItem->SerialItemsValid && !$_SESSION['CurImportFile']['Processed']){ - // IF all items are not valid, show the raw first 10 lines of the file. maybe it will help. + // If all items are not valid, show the raw first 10 lines of the file. maybe it will help. $filename = $_SESSION['CurImportFile']['tmp_name']; $handle = fopen($filename, 'r'); $i=0; @@ -143,12 +143,13 @@ } fclose($handle); - echo '<br><form method=POST>'; + echo '<br /><form method=POST>'; echo '<input type="hidden" name="FormID" value="' . $_SESSION['FormID'] . '" />'; - echo '<input type=submit name=ValidateFile value=' . _('Validate File') . '> - <input type=hidden name=LineNo value="' . $LineNo . '"> - <input type=hidden name=StockID value="' . $StockID . '"> - <input type=hidden name=EntryType value="FILE"> + echo '<input type=submit name="ValidateFile" value=' . _('Validate File') . '> + <input type=hidden name="LineNo" value="' . $LineNo . '"> + <input type=hidden name="identifier" value="' . $identifier . '"> + <input type=hidden name="StockID" value="' . $StockID . '"> + <input type=hidden name="EntryType" value="FILE"> </form> <... [truncated message content] |