From: <dai...@us...> - 2011-01-24 05:45:04
|
Revision: 4476 http://web-erp.svn.sourceforge.net/web-erp/?rev=4476&view=rev Author: daintree Date: 2011-01-24 05:44:58 +0000 (Mon, 24 Jan 2011) Log Message: ----------- Image variable notices removed - looks like the image display removed too - may need to revisit Modified Paths: -------------- trunk/SelectOrderItems.php Modified: trunk/SelectOrderItems.php =================================================================== --- trunk/SelectOrderItems.php 2011-01-24 05:25:42 UTC (rev 4475) +++ trunk/SelectOrderItems.php 2011-01-24 05:44:58 UTC (rev 4476) @@ -1624,7 +1624,8 @@ <th>' . _('Available') . '</th> <th>' . _('Quantity') . '</th></tr>'; echo $TableHeader; - + $ImageSource = _('No Image'); + $k=0; //row colour counter while ($myrow=DB_fetch_array($SearchResult)) { This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <dai...@us...> - 2011-01-24 05:45:04
|
Revision: 4476 http://web-erp.svn.sourceforge.net/web-erp/?rev=4476&view=rev Author: daintree Date: 2011-01-24 05:44:58 +0000 (Mon, 24 Jan 2011) Log Message: ----------- Image variable notices removed - looks like the image display removed too - may need to revisit Modified Paths: -------------- trunk/SelectOrderItems.php Modified: trunk/SelectOrderItems.php =================================================================== --- trunk/SelectOrderItems.php 2011-01-24 05:25:42 UTC (rev 4475) +++ trunk/SelectOrderItems.php 2011-01-24 05:44:58 UTC (rev 4476) @@ -1624,7 +1624,8 @@ <th>' . _('Available') . '</th> <th>' . _('Quantity') . '</th></tr>'; echo $TableHeader; - + $ImageSource = _('No Image'); + $k=0; //row colour counter while ($myrow=DB_fetch_array($SearchResult)) { This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <ex...@us...> - 2011-12-13 01:34:23
|
Revision: 4768 http://web-erp.svn.sourceforge.net/web-erp/?rev=4768&view=rev Author: exsonqu Date: 2011-12-13 01:34:17 +0000 (Tue, 13 Dec 2011) Log Message: ----------- Bug fix for $_SESSION['ExistingOrder'] to $_SESSION['ExistingOrder'.$identifier] Solution from Tim Modified Paths: -------------- trunk/SelectOrderItems.php Modified: trunk/SelectOrderItems.php =================================================================== --- trunk/SelectOrderItems.php 2011-12-13 01:32:32 UTC (rev 4767) +++ trunk/SelectOrderItems.php 2011-12-13 01:34:17 UTC (rev 4768) @@ -50,7 +50,7 @@ unset ($_SESSION['Items'.$identifier]); } - $_SESSION['ExistingOrder']=0; + $_SESSION['ExistingOrder'.$identifier]=0; $_SESSION['Items'.$identifier] = new cart; if (count($_SESSION['AllowedPageSecurityTokens'])==1){ //its a customer logon @@ -72,7 +72,7 @@ unset ($_SESSION['Items'.$identifier]->LineItems); unset ($_SESSION['Items'.$identifier]); } - $_SESSION['ExistingOrder']=$_GET['ModifyOrderNumber']; + $_SESSION['ExistingOrder'.$identifier]=$_GET['ModifyOrderNumber']; $_SESSION['RequireCustomerSelection'] = 0; $_SESSION['Items'.$identifier] = new cart; @@ -267,7 +267,7 @@ set to 1. The delivery check screen is where the details of the order are either updated or inserted depending on the value of ExistingOrder */ - $_SESSION['ExistingOrder']=0; + $_SESSION['ExistingOrder'.$identifier]=0; $_SESSION['Items'.$identifier] = new cart; $_SESSION['PrintedPackingSlip'] =0; /*Of course cos the order aint even started !!*/ @@ -651,11 +651,11 @@ if (isset($_POST['CancelOrder'])) { $OK_to_delete=1; //assume this in the first instance - if($_SESSION['ExistingOrder']!=0) { //need to check that not already dispatched + if($_SESSION['ExistingOrder'.$identifier]!=0) { //need to check that not already dispatched $sql = "SELECT qtyinvoiced FROM salesorderdetails - WHERE orderno='" . $_SESSION['ExistingOrder'] . "' + WHERE orderno='" . $_SESSION['ExistingOrder'.$identifier] . "' AND qtyinvoiced>0"; $InvQties = DB_query($sql,$db); @@ -669,17 +669,17 @@ } if ($OK_to_delete==1){ - if($_SESSION['ExistingOrder']!=0){ + if($_SESSION['ExistingOrder'.$identifier]!=0){ - $SQL = "DELETE FROM salesorderdetails WHERE salesorderdetails.orderno ='" . $_SESSION['ExistingOrder'] . "'"; + $SQL = "DELETE FROM salesorderdetails WHERE salesorderdetails.orderno ='" . $_SESSION['ExistingOrder'.$identifier] . "'"; $ErrMsg =_('The order detail lines could not be deleted because'); $DelResult=DB_query($SQL,$db,$ErrMsg); - $SQL = "DELETE FROM salesorders WHERE salesorders.orderno='" . $_SESSION['ExistingOrder'] . "'"; + $SQL = "DELETE FROM salesorders WHERE salesorders.orderno='" . $_SESSION['ExistingOrder'.$identifier] . "'"; $ErrMsg = _('The order header could not be deleted because'); $DelResult=DB_query($SQL,$db,$ErrMsg); - $_SESSION['ExistingOrder']=0; + $_SESSION['ExistingOrder'.$identifier]=0; } unset($_SESSION['Items'.$identifier]->LineItems); This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <ex...@us...> - 2011-12-13 01:34:23
|
Revision: 4768 http://web-erp.svn.sourceforge.net/web-erp/?rev=4768&view=rev Author: exsonqu Date: 2011-12-13 01:34:17 +0000 (Tue, 13 Dec 2011) Log Message: ----------- Bug fix for $_SESSION['ExistingOrder'] to $_SESSION['ExistingOrder'.$identifier] Solution from Tim Modified Paths: -------------- trunk/SelectOrderItems.php Modified: trunk/SelectOrderItems.php =================================================================== --- trunk/SelectOrderItems.php 2011-12-13 01:32:32 UTC (rev 4767) +++ trunk/SelectOrderItems.php 2011-12-13 01:34:17 UTC (rev 4768) @@ -50,7 +50,7 @@ unset ($_SESSION['Items'.$identifier]); } - $_SESSION['ExistingOrder']=0; + $_SESSION['ExistingOrder'.$identifier]=0; $_SESSION['Items'.$identifier] = new cart; if (count($_SESSION['AllowedPageSecurityTokens'])==1){ //its a customer logon @@ -72,7 +72,7 @@ unset ($_SESSION['Items'.$identifier]->LineItems); unset ($_SESSION['Items'.$identifier]); } - $_SESSION['ExistingOrder']=$_GET['ModifyOrderNumber']; + $_SESSION['ExistingOrder'.$identifier]=$_GET['ModifyOrderNumber']; $_SESSION['RequireCustomerSelection'] = 0; $_SESSION['Items'.$identifier] = new cart; @@ -267,7 +267,7 @@ set to 1. The delivery check screen is where the details of the order are either updated or inserted depending on the value of ExistingOrder */ - $_SESSION['ExistingOrder']=0; + $_SESSION['ExistingOrder'.$identifier]=0; $_SESSION['Items'.$identifier] = new cart; $_SESSION['PrintedPackingSlip'] =0; /*Of course cos the order aint even started !!*/ @@ -651,11 +651,11 @@ if (isset($_POST['CancelOrder'])) { $OK_to_delete=1; //assume this in the first instance - if($_SESSION['ExistingOrder']!=0) { //need to check that not already dispatched + if($_SESSION['ExistingOrder'.$identifier]!=0) { //need to check that not already dispatched $sql = "SELECT qtyinvoiced FROM salesorderdetails - WHERE orderno='" . $_SESSION['ExistingOrder'] . "' + WHERE orderno='" . $_SESSION['ExistingOrder'.$identifier] . "' AND qtyinvoiced>0"; $InvQties = DB_query($sql,$db); @@ -669,17 +669,17 @@ } if ($OK_to_delete==1){ - if($_SESSION['ExistingOrder']!=0){ + if($_SESSION['ExistingOrder'.$identifier]!=0){ - $SQL = "DELETE FROM salesorderdetails WHERE salesorderdetails.orderno ='" . $_SESSION['ExistingOrder'] . "'"; + $SQL = "DELETE FROM salesorderdetails WHERE salesorderdetails.orderno ='" . $_SESSION['ExistingOrder'.$identifier] . "'"; $ErrMsg =_('The order detail lines could not be deleted because'); $DelResult=DB_query($SQL,$db,$ErrMsg); - $SQL = "DELETE FROM salesorders WHERE salesorders.orderno='" . $_SESSION['ExistingOrder'] . "'"; + $SQL = "DELETE FROM salesorders WHERE salesorders.orderno='" . $_SESSION['ExistingOrder'.$identifier] . "'"; $ErrMsg = _('The order header could not be deleted because'); $DelResult=DB_query($SQL,$db,$ErrMsg); - $_SESSION['ExistingOrder']=0; + $_SESSION['ExistingOrder'.$identifier]=0; } unset($_SESSION['Items'.$identifier]->LineItems); This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <tim...@us...> - 2011-12-15 11:56:32
|
Revision: 4780 http://web-erp.svn.sourceforge.net/web-erp/?rev=4780&view=rev Author: tim_schofield Date: 2011-12-15 11:56:25 +0000 (Thu, 15 Dec 2011) Log Message: ----------- Fix bug in customer branch search sql Modified Paths: -------------- trunk/SelectOrderItems.php Modified: trunk/SelectOrderItems.php =================================================================== --- trunk/SelectOrderItems.php 2011-12-15 09:25:53 UTC (rev 4779) +++ trunk/SelectOrderItems.php 2011-12-15 11:56:25 UTC (rev 4780) @@ -110,20 +110,20 @@ locations.locationname, custbranch.estdeliverydays, custbranch.salesman - FROM salesorders - INNER JOIN debtorsmaster + FROM salesorders + INNER JOIN debtorsmaster ON salesorders.debtorno = debtorsmaster.debtorno - INNER JOIN salestypes + INNER JOIN salestypes ON salesorders.ordertype=salestypes.typeabbrev - INNER JOIN custbranch - ON salesorders.debtorno = custbranch.debtorno + INNER JOIN custbranch + ON salesorders.debtorno = custbranch.debtorno AND salesorders.branchcode = custbranch.branchcode INNER JOIN paymentterms - ON debtorsmaster.paymentterms=paymentterms.termsindicator - INNER JOIN locations - ON locations.loccode=salesorders.fromstkloc + ON debtorsmaster.paymentterms=paymentterms.termsindicator + INNER JOIN locations + ON locations.loccode=salesorders.fromstkloc INNER JOIN currencies - ON debtorsmaster.currcode=currencies.currabrev + ON debtorsmaster.currcode=currencies.currabrev WHERE salesorders.orderno = '" . $_GET['ModifyOrderNumber'] . "'"; $ErrMsg = _('The order cannot be retrieved because'); @@ -272,8 +272,8 @@ $_SESSION['Items'.$identifier] = new cart; $_SESSION['PrintedPackingSlip'] =0; /*Of course cos the order aint even started !!*/ - if (in_array(2,$_SESSION['AllowedPageSecurityTokens']) - AND ($_SESSION['Items'.$identifier]->DebtorNo=='' + if (in_array(2,$_SESSION['AllowedPageSecurityTokens']) + AND ($_SESSION['Items'.$identifier]->DebtorNo=='' OR !isset($_SESSION['Items'.$identifier]->DebtorNo))){ /* need to select a customer for the first time out if authorisation allows it and if a customer @@ -295,8 +295,8 @@ } //Customer logins are not allowed to select other customers henc in_array(2,$_SESSION['AllowedPageSecurityTokens']) -if (isset($_POST['SearchCust']) - AND $_SESSION['RequireCustomerSelection']==1 +if (isset($_POST['SearchCust']) + AND $_SESSION['RequireCustomerSelection']==1 AND in_array(2,$_SESSION['AllowedPageSecurityTokens'])){ if (($_POST['CustKeywords']=='') AND ($_POST['CustCode']=='') AND ($_POST['CustPhone']=='')) { @@ -305,7 +305,7 @@ //insert wildcard characters in spaces $_POST['CustKeywords'] = mb_strtoupper(trim($_POST['CustKeywords'])); $SearchString = str_replace(' ', '%', $_POST['CustKeywords']) ; - + $SQL = "SELECT custbranch.brname, custbranch.contactname, custbranch.phoneno, @@ -316,9 +316,8 @@ FROM custbranch LEFT JOIN debtorsmaster ON custbranch.debtorno=debtorsmaster.debtorno - WHERE custbranch.brname " . LIKE . " '%" . $SearchString . "%' - AND custbranch.debtorno " . LIKE . " '%" . mb_strtoupper(trim($_POST['CustCode'])) . "%' - AND custbranch.branchcode " . LIKE . " '%" . mb_strtoupper(trim($_POST['CustCode'])) . "%' + WHERE custbranch.brname " . LIKE . " '%" . $SearchString . "%' + AND custbranch.branchcode " . LIKE . " '%" . mb_strtoupper(trim($_POST['CustCode'])) . "%' AND custbranch.phoneno " . LIKE . " '%" . trim($_POST['CustPhone']) . "%'"; if ($_SESSION['SalesmanLogin']!=''){ @@ -372,11 +371,11 @@ currencies.decimalplaces FROM debtorsmaster INNER JOIN holdreasons ON debtorsmaster.holdreason=holdreasons.reasoncode - INNER JOIN salestypes + INNER JOIN salestypes ON debtorsmaster.salestype=salestypes.typeabbrev - INNER JOIN paymentterms + INNER JOIN paymentterms ON debtorsmaster.paymentterms=paymentterms.termsindicator - INNER JOIN currencies + INNER JOIN currencies ON debtorsmaster.currcode=currencies.currabrev WHERE debtorsmaster.debtorno = '" . $_SESSION['Items'.$identifier]->DebtorNo. "'"; @@ -426,7 +425,7 @@ ON custbranch.defaultlocation=locations.loccode WHERE custbranch.branchcode='" . $_SESSION['Items'.$identifier]->Branch . "' AND custbranch.debtorno = '" . $_SESSION['Items'.$identifier]->DebtorNo . "'"; - + $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); @@ -470,7 +469,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($_SESSION['Items'.$identifier]->DebtorNo,$db); if ($_SESSION['CheckCreditLimits']==1 AND $_SESSION['Items'.$identifier]->CreditAvailable <=0){ @@ -486,7 +485,7 @@ prnMsg(_('The') . ' ' . $myrow[0] . ' ' . _('account is currently on hold please contact the credit control personnel to discuss'),'warn'); } -} elseif (!$_SESSION['Items'.$identifier]->DefaultSalesType +} elseif (!$_SESSION['Items'.$identifier]->DefaultSalesType OR $_SESSION['Items'.$identifier]->DefaultSalesType=='') { #Possible that the check to ensure this account is not on hold has not been done @@ -499,10 +498,10 @@ debtorsmaster.currcode, currencies.decimalplaces, debtorsmaster.customerpoline - FROM debtorsmaster + FROM debtorsmaster INNER JOIN holdreasons ON debtorsmaster.holdreason=holdreasons.reasoncode - INNER JOIN currencies + INNER JOIN currencies ON debtorsmaster.currcode=currencies.currabrev AND debtorsmaster.debtorno = '" . $_SESSION['Items'.$identifier]->DebtorNo . "'"; @@ -857,7 +856,7 @@ $ExRate = 1; } - + /*Process Quick Entry */ /* If enter is pressed on the quick entry screen, the default button may be Recalculate */ if (isset($_POST['SelectingOrderItems']) @@ -951,8 +950,8 @@ if ($_POST['AssetToDisposeOf'] == 'NoAssetSelected'){ //don't do anything unless an asset is disposed of prnMsg(_('No asset was selected to dispose of. No assets have been added to this customer order'),'warn'); } else { //need to add the asset to the order - /*First need to create a stock ID to hold the asset and record the sale - as only stock items can be sold - * and before that we need to add a disposal stock category - if not already created + /*First need to create a stock ID to hold the asset and record the sale - as only stock items can be sold + * and before that we need to add a disposal stock category - if not already created * first off get the details about the asset being disposed of */ $AssetDetailsResult = DB_query("SELECT fixedassets.description, fixedassets.longdescription, @@ -963,13 +962,13 @@ ON fixedassetcategories.categoryid=fixedassets.assetcategoryid WHERE fixedassets.assetid='" . $_POST['AssetToDisposeOf'] . "'",$db); $AssetRow = DB_fetch_array($AssetDetailsResult); - + /* Check that the stock category for disposal "ASSETS" is defined already */ $AssetCategoryResult = DB_query("SELECT categoryid FROM stockcategory WHERE categoryid='ASSETS'",$db); if (DB_num_rows($AssetCategoryResult)==0){ - /*Although asset GL posting will come from the asset category - we should set the GL codes to something sensible + /*Although asset GL posting will come from the asset category - we should set the GL codes to something sensible * based on the category of the asset under review at the moment - this may well change for any other assets sold subsequentely */ - + /*OK now we can insert the stock category for this asset */ $InsertAssetStockCatResult = DB_query("INSERT INTO stockcategory ( categoryid, categorydescription, @@ -977,19 +976,19 @@ VALUES ('ASSETS', '" . _('Asset Disposals') . "', '" . $AssetRow['costact'] . "')",$db); - } - + } + /*First check to see that it doesn't exist already assets are of the format "ASSET-" . $AssetID */ - $TestAssetExistsAlreadyResult = DB_query("SELECT stockid - FROM stockmaster + $TestAssetExistsAlreadyResult = DB_query("SELECT stockid + FROM stockmaster WHERE stockid ='ASSET-" . $_POST['AssetToDisposeOf'] . "'", $db); $j=0; while (DB_num_rows($TestAssetExistsAlreadyResult)==1) { //then it exists already ... bum $j++; - $TestAssetExistsAlreadyResult = DB_query("SELECT stockid - FROM stockmaster + $TestAssetExistsAlreadyResult = DB_query("SELECT stockid + FROM stockmaster WHERE stockid ='ASSET-" . $_POST['AssetToDisposeOf'] . '-' . $j . "'", $db); } @@ -1025,7 +1024,7 @@ /*not forgetting the location records too */ $InsertStkLocRecsResult = DB_query("INSERT INTO locstock (loccode, stockid) - SELECT loccode, '" . $AssetStockID . "' + SELECT loccode, '" . $AssetStockID . "' FROM locations",$db); /*Now the asset has been added to the stock master we can add it to the sales order */ $NewItemDue = date($_SESSION['DefaultDateFormat']); @@ -1052,9 +1051,9 @@ $_SESSION['Items'.$identifier]->LineItems[$_GET['Delete']]->Quantity = $QuantityAlreadyDelivered; } } - + $AlreadyWarnedAboutCredit = false; - + foreach ($_SESSION['Items'.$identifier]->LineItems as $OrderLine) { if (isset($_POST['Quantity_' . $OrderLine->LineNumber])){ @@ -1063,17 +1062,17 @@ if (ABS($OrderLine->Price - filter_number_format($_POST['Price_' . $OrderLine->LineNumber]))>0.01){ /*There is a new price being input for the line item */ - + $Price = filter_number_format($_POST['Price_' . $OrderLine->LineNumber]); $_POST['GPPercent_' . $OrderLine->LineNumber] = (($Price*(1-(filter_number_format($_POST['Discount_' . $OrderLine->LineNumber])/100))) - $OrderLine->StandardCost*$ExRate)/($Price *(1-filter_number_format($_POST['Discount_' . $OrderLine->LineNumber]))/100); - + } elseif (ABS($OrderLine->GPPercent - filter_number_format($_POST['GPPercent_' . $OrderLine->LineNumber]))>=0.01) { /* A GP % has been input so need to do a recalculation of the price at this new GP Percentage */ - - + + prnMsg(_('Recalculated the price from the GP % entered - the GP % was') . ' ' . $OrderLine->GPPercent . ' the new GP % is ' . filter_number_format($_POST['GPPercent_' . $OrderLine->LineNumber]),'info'); - - + + $Price = ($OrderLine->StandardCost*$ExRate)/(1 -((filter_number_format($_POST['GPPercent_' . $OrderLine->LineNumber]) + filter_number_format($_POST['Discount_' . $OrderLine->LineNumber]))/100)); } else { $Price = filter_number_format($_POST['Price_' . $OrderLine->LineNumber]); @@ -1110,13 +1109,13 @@ OR $OrderLine->Narrative != $Narrative OR $OrderLine->ItemDue != $_POST['ItemDue_' . $OrderLine->LineNumber] OR $OrderLine->POLine != $_POST['POLine_' . $OrderLine->LineNumber]) { - + $WithinCreditLimit = true; - - if ($_SESSION['CheckCreditLimits'] > 0 AND $AlreadyWarnedAboutCredit==false){ + + if ($_SESSION['CheckCreditLimits'] > 0 AND $AlreadyWarnedAboutCredit==false){ /*Check credit limits is 1 for warn breach their credit limit and 2 for prohibit sales */ $DifferenceInOrderValue = ($Quantity*$Price*(1-$DiscountPercentage/100)) - ($OrderLine->Quantity*$OrderLine->Price*(1-$OrderLine->DiscountPercent)); - + $_SESSION['Items'.$identifier]->CreditAvailable -= $DifferenceInOrderValue; if ($_SESSION['CheckCreditLimits']==1 AND $_SESSION['Items'.$identifier]->CreditAvailable <=0){ @@ -1129,7 +1128,7 @@ $AlreadyWarnedAboutCredit = true; } } - + if ($WithinCreditLimit){ $_SESSION['Items'.$identifier]->update_cart_item($OrderLine->LineNumber, $Quantity, @@ -1144,16 +1143,16 @@ } //there are changes to the order line to process } //page not called from itself - POST variables not set } // Loop around all items on the order - - + + /* Now Run through each line of the order again to work out the appropriate discount from the discount matrix */ $DiscCatsDone = array(); foreach ($_SESSION['Items'.$identifier]->LineItems as $OrderLine) { - + if ($OrderLine->DiscCat !='' AND ! in_array($OrderLine->DiscCat,$DiscCatsDone)){ $DiscCatsDone[]=$OrderLine->DiscCat; $QuantityOfDiscCat = 0; - + foreach ($_SESSION['Items'.$identifier]->LineItems as $OrderLine_2) { /* add up total quantity of all lines of this DiscCat */ if ($OrderLine_2->DiscCat==$OrderLine->DiscCat){ @@ -1454,7 +1453,7 @@ /* Now show the stock item selection search stuff below */ - if ((!isset($_POST['QuickEntry']) + if ((!isset($_POST['QuickEntry']) AND !isset($_POST['SelectAsset']))){ echo '<input type="hidden" name="PartSearch" value="' . _('Yes Please') . '" />'; @@ -1464,18 +1463,18 @@ // Select the most recently ordered items for quick select $SixMonthsAgo = DateAdd (Date($_SESSION['DefaultDateFormat']),'m',-6); - $SQL="SELECT stockmaster.units, - stockmaster.description, - stockmaster.stockid, + $SQL="SELECT stockmaster.units, + stockmaster.description, + stockmaster.stockid, salesorderdetails.stkcode, - SUM(qtyinvoiced) salesqty + SUM(qtyinvoiced) salesqty FROM `salesorderdetails`INNER JOIN `stockmaster` ON salesorderdetails.stkcode = stockmaster.stockid WHERE ActualDispatchDate >= '" . FormatDateForSQL($SixMonthsAgo) . "' GROUP BY stkcode ORDER BY salesqty DESC LIMIT " . $_SESSION['FrequentlyOrderedItems']; - + $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 />'; @@ -1514,10 +1513,10 @@ $sql = "SELECT SUM(salesorderdetails.quantity-salesorderdetails.qtyinvoiced) AS dem FROM salesorderdetails, salesorders - WHERE salesorders.orderno = salesorderdetails.orderno - AND salesorders.fromstkloc='" . $_SESSION['Items'.$identifier]->Location . "' - AND salesorderdetails.completed=0 - AND salesorders.quotation=0 + WHERE salesorders.orderno = salesorderdetails.orderno + AND salesorders.fromstkloc='" . $_SESSION['Items'.$identifier]->Location . "' + AND salesorderdetails.completed=0 + AND salesorders.quotation=0 AND salesorderdetails.stkcode='" . $myrow['stockid'] . "'"; $ErrMsg = _('The demand for this product from') . ' ' . $_SESSION['Items'.$identifier]->Location . ' ' . @@ -1617,7 +1616,7 @@ FROM stockcategory WHERE stocktype='F' OR stocktype='D' ORDER BY categorydescription"; - + $result1 = DB_query($SQL,$db); while ($myrow1 = DB_fetch_array($result1)) { if ($_POST['StockCat']==$myrow1['categoryid']){ @@ -1640,11 +1639,11 @@ echo $_POST['StockCode']; } echo '"></td></tr>'; - + echo '<tr> <td style="text-align:center" colspan=1><input tabindex=4 type=submit name="Search" value="' . _('Search Now') . '"></td> <td style="text-align:center" colspan=1><input tabindex=5 type=submit name="QuickEntry" value="' . _('Use Quick Entry') . '"></td>'; - + if (!isset($_POST['PartSearch'])) { echo '<script type="text/javascript">if (document.SelectParts) {defaultControl(document.SelectParts.Keywords);}</script>'; } @@ -1695,11 +1694,11 @@ // Find the quantity on outstanding sales orders $sql = "SELECT SUM(salesorderdetails.quantity-salesorderdetails.qtyinvoiced) AS dem - FROM salesorderdetails INNER JOIN salesorders - ON salesorders.orderno = salesorderdetails.orderno - WHERE salesorders.fromstkloc='" . $_SESSION['Items'.$identifier]->Location . "' - AND salesorderdetails.completed=0 - AND salesorders.quotation=0 + FROM salesorderdetails INNER JOIN salesorders + ON salesorders.orderno = salesorderdetails.orderno + WHERE salesorders.fromstkloc='" . $_SESSION['Items'.$identifier]->Location . "' + AND salesorderdetails.completed=0 + AND salesorders.quotation=0 AND salesorderdetails.stkcode='" . $myrow['stockid'] . "'"; $ErrMsg = _('The demand for this product from') . ' ' . $_SESSION['Items'.$identifier]->Location . ' ' . _('cannot be retrieved because'); @@ -1714,9 +1713,9 @@ // Find the quantity on purchase orders $sql = "SELECT SUM(purchorderdetails.quantityord-purchorderdetails.quantityrecd) AS qoo - FROM purchorderdetails INNER JOIN purchorders + FROM purchorderdetails INNER JOIN purchorders ON purchorderdetails.orderno=purchorders.orderno - WHERE purchorderdetails.completed=0 + WHERE purchorderdetails.completed=0 AND purchorders.status<>'Cancelled' AND purchorders.status<>'Rejected' AND purchorders.status<>'Pending' @@ -1822,12 +1821,12 @@ <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 /> <table border=1>'; /*do not display colum unless customer requires po line number by sales order line*/ if($_SESSION['Items'.$identifier]->DefaultPOLine ==1){ - echo '<tr><td>' . _('PO Line') . '</td> + echo '<tr><td>' . _('PO Line') . '</td> <td><input type="text" name="poline" size=21 maxlength=20></td></tr>'; } echo '<tr><td>' . _('Asset to Dispose Of') . ':</td> @@ -1840,9 +1839,9 @@ echo '</select></td></tr></table> <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>'; } This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <tim...@us...> - 2011-12-15 11:56:35
|
Revision: 4780 http://web-erp.svn.sourceforge.net/web-erp/?rev=4780&view=rev Author: tim_schofield Date: 2011-12-15 11:56:25 +0000 (Thu, 15 Dec 2011) Log Message: ----------- Fix bug in customer branch search sql Modified Paths: -------------- trunk/SelectOrderItems.php Modified: trunk/SelectOrderItems.php =================================================================== --- trunk/SelectOrderItems.php 2011-12-15 09:25:53 UTC (rev 4779) +++ trunk/SelectOrderItems.php 2011-12-15 11:56:25 UTC (rev 4780) @@ -110,20 +110,20 @@ locations.locationname, custbranch.estdeliverydays, custbranch.salesman - FROM salesorders - INNER JOIN debtorsmaster + FROM salesorders + INNER JOIN debtorsmaster ON salesorders.debtorno = debtorsmaster.debtorno - INNER JOIN salestypes + INNER JOIN salestypes ON salesorders.ordertype=salestypes.typeabbrev - INNER JOIN custbranch - ON salesorders.debtorno = custbranch.debtorno + INNER JOIN custbranch + ON salesorders.debtorno = custbranch.debtorno AND salesorders.branchcode = custbranch.branchcode INNER JOIN paymentterms - ON debtorsmaster.paymentterms=paymentterms.termsindicator - INNER JOIN locations - ON locations.loccode=salesorders.fromstkloc + ON debtorsmaster.paymentterms=paymentterms.termsindicator + INNER JOIN locations + ON locations.loccode=salesorders.fromstkloc INNER JOIN currencies - ON debtorsmaster.currcode=currencies.currabrev + ON debtorsmaster.currcode=currencies.currabrev WHERE salesorders.orderno = '" . $_GET['ModifyOrderNumber'] . "'"; $ErrMsg = _('The order cannot be retrieved because'); @@ -272,8 +272,8 @@ $_SESSION['Items'.$identifier] = new cart; $_SESSION['PrintedPackingSlip'] =0; /*Of course cos the order aint even started !!*/ - if (in_array(2,$_SESSION['AllowedPageSecurityTokens']) - AND ($_SESSION['Items'.$identifier]->DebtorNo=='' + if (in_array(2,$_SESSION['AllowedPageSecurityTokens']) + AND ($_SESSION['Items'.$identifier]->DebtorNo=='' OR !isset($_SESSION['Items'.$identifier]->DebtorNo))){ /* need to select a customer for the first time out if authorisation allows it and if a customer @@ -295,8 +295,8 @@ } //Customer logins are not allowed to select other customers henc in_array(2,$_SESSION['AllowedPageSecurityTokens']) -if (isset($_POST['SearchCust']) - AND $_SESSION['RequireCustomerSelection']==1 +if (isset($_POST['SearchCust']) + AND $_SESSION['RequireCustomerSelection']==1 AND in_array(2,$_SESSION['AllowedPageSecurityTokens'])){ if (($_POST['CustKeywords']=='') AND ($_POST['CustCode']=='') AND ($_POST['CustPhone']=='')) { @@ -305,7 +305,7 @@ //insert wildcard characters in spaces $_POST['CustKeywords'] = mb_strtoupper(trim($_POST['CustKeywords'])); $SearchString = str_replace(' ', '%', $_POST['CustKeywords']) ; - + $SQL = "SELECT custbranch.brname, custbranch.contactname, custbranch.phoneno, @@ -316,9 +316,8 @@ FROM custbranch LEFT JOIN debtorsmaster ON custbranch.debtorno=debtorsmaster.debtorno - WHERE custbranch.brname " . LIKE . " '%" . $SearchString . "%' - AND custbranch.debtorno " . LIKE . " '%" . mb_strtoupper(trim($_POST['CustCode'])) . "%' - AND custbranch.branchcode " . LIKE . " '%" . mb_strtoupper(trim($_POST['CustCode'])) . "%' + WHERE custbranch.brname " . LIKE . " '%" . $SearchString . "%' + AND custbranch.branchcode " . LIKE . " '%" . mb_strtoupper(trim($_POST['CustCode'])) . "%' AND custbranch.phoneno " . LIKE . " '%" . trim($_POST['CustPhone']) . "%'"; if ($_SESSION['SalesmanLogin']!=''){ @@ -372,11 +371,11 @@ currencies.decimalplaces FROM debtorsmaster INNER JOIN holdreasons ON debtorsmaster.holdreason=holdreasons.reasoncode - INNER JOIN salestypes + INNER JOIN salestypes ON debtorsmaster.salestype=salestypes.typeabbrev - INNER JOIN paymentterms + INNER JOIN paymentterms ON debtorsmaster.paymentterms=paymentterms.termsindicator - INNER JOIN currencies + INNER JOIN currencies ON debtorsmaster.currcode=currencies.currabrev WHERE debtorsmaster.debtorno = '" . $_SESSION['Items'.$identifier]->DebtorNo. "'"; @@ -426,7 +425,7 @@ ON custbranch.defaultlocation=locations.loccode WHERE custbranch.branchcode='" . $_SESSION['Items'.$identifier]->Branch . "' AND custbranch.debtorno = '" . $_SESSION['Items'.$identifier]->DebtorNo . "'"; - + $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); @@ -470,7 +469,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($_SESSION['Items'.$identifier]->DebtorNo,$db); if ($_SESSION['CheckCreditLimits']==1 AND $_SESSION['Items'.$identifier]->CreditAvailable <=0){ @@ -486,7 +485,7 @@ prnMsg(_('The') . ' ' . $myrow[0] . ' ' . _('account is currently on hold please contact the credit control personnel to discuss'),'warn'); } -} elseif (!$_SESSION['Items'.$identifier]->DefaultSalesType +} elseif (!$_SESSION['Items'.$identifier]->DefaultSalesType OR $_SESSION['Items'.$identifier]->DefaultSalesType=='') { #Possible that the check to ensure this account is not on hold has not been done @@ -499,10 +498,10 @@ debtorsmaster.currcode, currencies.decimalplaces, debtorsmaster.customerpoline - FROM debtorsmaster + FROM debtorsmaster INNER JOIN holdreasons ON debtorsmaster.holdreason=holdreasons.reasoncode - INNER JOIN currencies + INNER JOIN currencies ON debtorsmaster.currcode=currencies.currabrev AND debtorsmaster.debtorno = '" . $_SESSION['Items'.$identifier]->DebtorNo . "'"; @@ -857,7 +856,7 @@ $ExRate = 1; } - + /*Process Quick Entry */ /* If enter is pressed on the quick entry screen, the default button may be Recalculate */ if (isset($_POST['SelectingOrderItems']) @@ -951,8 +950,8 @@ if ($_POST['AssetToDisposeOf'] == 'NoAssetSelected'){ //don't do anything unless an asset is disposed of prnMsg(_('No asset was selected to dispose of. No assets have been added to this customer order'),'warn'); } else { //need to add the asset to the order - /*First need to create a stock ID to hold the asset and record the sale - as only stock items can be sold - * and before that we need to add a disposal stock category - if not already created + /*First need to create a stock ID to hold the asset and record the sale - as only stock items can be sold + * and before that we need to add a disposal stock category - if not already created * first off get the details about the asset being disposed of */ $AssetDetailsResult = DB_query("SELECT fixedassets.description, fixedassets.longdescription, @@ -963,13 +962,13 @@ ON fixedassetcategories.categoryid=fixedassets.assetcategoryid WHERE fixedassets.assetid='" . $_POST['AssetToDisposeOf'] . "'",$db); $AssetRow = DB_fetch_array($AssetDetailsResult); - + /* Check that the stock category for disposal "ASSETS" is defined already */ $AssetCategoryResult = DB_query("SELECT categoryid FROM stockcategory WHERE categoryid='ASSETS'",$db); if (DB_num_rows($AssetCategoryResult)==0){ - /*Although asset GL posting will come from the asset category - we should set the GL codes to something sensible + /*Although asset GL posting will come from the asset category - we should set the GL codes to something sensible * based on the category of the asset under review at the moment - this may well change for any other assets sold subsequentely */ - + /*OK now we can insert the stock category for this asset */ $InsertAssetStockCatResult = DB_query("INSERT INTO stockcategory ( categoryid, categorydescription, @@ -977,19 +976,19 @@ VALUES ('ASSETS', '" . _('Asset Disposals') . "', '" . $AssetRow['costact'] . "')",$db); - } - + } + /*First check to see that it doesn't exist already assets are of the format "ASSET-" . $AssetID */ - $TestAssetExistsAlreadyResult = DB_query("SELECT stockid - FROM stockmaster + $TestAssetExistsAlreadyResult = DB_query("SELECT stockid + FROM stockmaster WHERE stockid ='ASSET-" . $_POST['AssetToDisposeOf'] . "'", $db); $j=0; while (DB_num_rows($TestAssetExistsAlreadyResult)==1) { //then it exists already ... bum $j++; - $TestAssetExistsAlreadyResult = DB_query("SELECT stockid - FROM stockmaster + $TestAssetExistsAlreadyResult = DB_query("SELECT stockid + FROM stockmaster WHERE stockid ='ASSET-" . $_POST['AssetToDisposeOf'] . '-' . $j . "'", $db); } @@ -1025,7 +1024,7 @@ /*not forgetting the location records too */ $InsertStkLocRecsResult = DB_query("INSERT INTO locstock (loccode, stockid) - SELECT loccode, '" . $AssetStockID . "' + SELECT loccode, '" . $AssetStockID . "' FROM locations",$db); /*Now the asset has been added to the stock master we can add it to the sales order */ $NewItemDue = date($_SESSION['DefaultDateFormat']); @@ -1052,9 +1051,9 @@ $_SESSION['Items'.$identifier]->LineItems[$_GET['Delete']]->Quantity = $QuantityAlreadyDelivered; } } - + $AlreadyWarnedAboutCredit = false; - + foreach ($_SESSION['Items'.$identifier]->LineItems as $OrderLine) { if (isset($_POST['Quantity_' . $OrderLine->LineNumber])){ @@ -1063,17 +1062,17 @@ if (ABS($OrderLine->Price - filter_number_format($_POST['Price_' . $OrderLine->LineNumber]))>0.01){ /*There is a new price being input for the line item */ - + $Price = filter_number_format($_POST['Price_' . $OrderLine->LineNumber]); $_POST['GPPercent_' . $OrderLine->LineNumber] = (($Price*(1-(filter_number_format($_POST['Discount_' . $OrderLine->LineNumber])/100))) - $OrderLine->StandardCost*$ExRate)/($Price *(1-filter_number_format($_POST['Discount_' . $OrderLine->LineNumber]))/100); - + } elseif (ABS($OrderLine->GPPercent - filter_number_format($_POST['GPPercent_' . $OrderLine->LineNumber]))>=0.01) { /* A GP % has been input so need to do a recalculation of the price at this new GP Percentage */ - - + + prnMsg(_('Recalculated the price from the GP % entered - the GP % was') . ' ' . $OrderLine->GPPercent . ' the new GP % is ' . filter_number_format($_POST['GPPercent_' . $OrderLine->LineNumber]),'info'); - - + + $Price = ($OrderLine->StandardCost*$ExRate)/(1 -((filter_number_format($_POST['GPPercent_' . $OrderLine->LineNumber]) + filter_number_format($_POST['Discount_' . $OrderLine->LineNumber]))/100)); } else { $Price = filter_number_format($_POST['Price_' . $OrderLine->LineNumber]); @@ -1110,13 +1109,13 @@ OR $OrderLine->Narrative != $Narrative OR $OrderLine->ItemDue != $_POST['ItemDue_' . $OrderLine->LineNumber] OR $OrderLine->POLine != $_POST['POLine_' . $OrderLine->LineNumber]) { - + $WithinCreditLimit = true; - - if ($_SESSION['CheckCreditLimits'] > 0 AND $AlreadyWarnedAboutCredit==false){ + + if ($_SESSION['CheckCreditLimits'] > 0 AND $AlreadyWarnedAboutCredit==false){ /*Check credit limits is 1 for warn breach their credit limit and 2 for prohibit sales */ $DifferenceInOrderValue = ($Quantity*$Price*(1-$DiscountPercentage/100)) - ($OrderLine->Quantity*$OrderLine->Price*(1-$OrderLine->DiscountPercent)); - + $_SESSION['Items'.$identifier]->CreditAvailable -= $DifferenceInOrderValue; if ($_SESSION['CheckCreditLimits']==1 AND $_SESSION['Items'.$identifier]->CreditAvailable <=0){ @@ -1129,7 +1128,7 @@ $AlreadyWarnedAboutCredit = true; } } - + if ($WithinCreditLimit){ $_SESSION['Items'.$identifier]->update_cart_item($OrderLine->LineNumber, $Quantity, @@ -1144,16 +1143,16 @@ } //there are changes to the order line to process } //page not called from itself - POST variables not set } // Loop around all items on the order - - + + /* Now Run through each line of the order again to work out the appropriate discount from the discount matrix */ $DiscCatsDone = array(); foreach ($_SESSION['Items'.$identifier]->LineItems as $OrderLine) { - + if ($OrderLine->DiscCat !='' AND ! in_array($OrderLine->DiscCat,$DiscCatsDone)){ $DiscCatsDone[]=$OrderLine->DiscCat; $QuantityOfDiscCat = 0; - + foreach ($_SESSION['Items'.$identifier]->LineItems as $OrderLine_2) { /* add up total quantity of all lines of this DiscCat */ if ($OrderLine_2->DiscCat==$OrderLine->DiscCat){ @@ -1454,7 +1453,7 @@ /* Now show the stock item selection search stuff below */ - if ((!isset($_POST['QuickEntry']) + if ((!isset($_POST['QuickEntry']) AND !isset($_POST['SelectAsset']))){ echo '<input type="hidden" name="PartSearch" value="' . _('Yes Please') . '" />'; @@ -1464,18 +1463,18 @@ // Select the most recently ordered items for quick select $SixMonthsAgo = DateAdd (Date($_SESSION['DefaultDateFormat']),'m',-6); - $SQL="SELECT stockmaster.units, - stockmaster.description, - stockmaster.stockid, + $SQL="SELECT stockmaster.units, + stockmaster.description, + stockmaster.stockid, salesorderdetails.stkcode, - SUM(qtyinvoiced) salesqty + SUM(qtyinvoiced) salesqty FROM `salesorderdetails`INNER JOIN `stockmaster` ON salesorderdetails.stkcode = stockmaster.stockid WHERE ActualDispatchDate >= '" . FormatDateForSQL($SixMonthsAgo) . "' GROUP BY stkcode ORDER BY salesqty DESC LIMIT " . $_SESSION['FrequentlyOrderedItems']; - + $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 />'; @@ -1514,10 +1513,10 @@ $sql = "SELECT SUM(salesorderdetails.quantity-salesorderdetails.qtyinvoiced) AS dem FROM salesorderdetails, salesorders - WHERE salesorders.orderno = salesorderdetails.orderno - AND salesorders.fromstkloc='" . $_SESSION['Items'.$identifier]->Location . "' - AND salesorderdetails.completed=0 - AND salesorders.quotation=0 + WHERE salesorders.orderno = salesorderdetails.orderno + AND salesorders.fromstkloc='" . $_SESSION['Items'.$identifier]->Location . "' + AND salesorderdetails.completed=0 + AND salesorders.quotation=0 AND salesorderdetails.stkcode='" . $myrow['stockid'] . "'"; $ErrMsg = _('The demand for this product from') . ' ' . $_SESSION['Items'.$identifier]->Location . ' ' . @@ -1617,7 +1616,7 @@ FROM stockcategory WHERE stocktype='F' OR stocktype='D' ORDER BY categorydescription"; - + $result1 = DB_query($SQL,$db); while ($myrow1 = DB_fetch_array($result1)) { if ($_POST['StockCat']==$myrow1['categoryid']){ @@ -1640,11 +1639,11 @@ echo $_POST['StockCode']; } echo '"></td></tr>'; - + echo '<tr> <td style="text-align:center" colspan=1><input tabindex=4 type=submit name="Search" value="' . _('Search Now') . '"></td> <td style="text-align:center" colspan=1><input tabindex=5 type=submit name="QuickEntry" value="' . _('Use Quick Entry') . '"></td>'; - + if (!isset($_POST['PartSearch'])) { echo '<script type="text/javascript">if (document.SelectParts) {defaultControl(document.SelectParts.Keywords);}</script>'; } @@ -1695,11 +1694,11 @@ // Find the quantity on outstanding sales orders $sql = "SELECT SUM(salesorderdetails.quantity-salesorderdetails.qtyinvoiced) AS dem - FROM salesorderdetails INNER JOIN salesorders - ON salesorders.orderno = salesorderdetails.orderno - WHERE salesorders.fromstkloc='" . $_SESSION['Items'.$identifier]->Location . "' - AND salesorderdetails.completed=0 - AND salesorders.quotation=0 + FROM salesorderdetails INNER JOIN salesorders + ON salesorders.orderno = salesorderdetails.orderno + WHERE salesorders.fromstkloc='" . $_SESSION['Items'.$identifier]->Location . "' + AND salesorderdetails.completed=0 + AND salesorders.quotation=0 AND salesorderdetails.stkcode='" . $myrow['stockid'] . "'"; $ErrMsg = _('The demand for this product from') . ' ' . $_SESSION['Items'.$identifier]->Location . ' ' . _('cannot be retrieved because'); @@ -1714,9 +1713,9 @@ // Find the quantity on purchase orders $sql = "SELECT SUM(purchorderdetails.quantityord-purchorderdetails.quantityrecd) AS qoo - FROM purchorderdetails INNER JOIN purchorders + FROM purchorderdetails INNER JOIN purchorders ON purchorderdetails.orderno=purchorders.orderno - WHERE purchorderdetails.completed=0 + WHERE purchorderdetails.completed=0 AND purchorders.status<>'Cancelled' AND purchorders.status<>'Rejected' AND purchorders.status<>'Pending' @@ -1822,12 +1821,12 @@ <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 /> <table border=1>'; /*do not display colum unless customer requires po line number by sales order line*/ if($_SESSION['Items'.$identifier]->DefaultPOLine ==1){ - echo '<tr><td>' . _('PO Line') . '</td> + echo '<tr><td>' . _('PO Line') . '</td> <td><input type="text" name="poline" size=21 maxlength=20></td></tr>'; } echo '<tr><td>' . _('Asset to Dispose Of') . ':</td> @@ -1840,9 +1839,9 @@ echo '</select></td></tr></table> <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>'; } This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <Ex...@us...> - 2012-02-21 11:05:08
|
Revision: 4945 http://web-erp.svn.sourceforge.net/web-erp/?rev=4945&view=rev Author: ExsonQu Date: 2012-02-21 11:04:57 +0000 (Tue, 21 Feb 2012) Log Message: ----------- Fixed bugs that when customer log in, the submit Sales orders will not be the price defined. Wrong data will be stored in salesorderdetails. Reported by CQZ from webERP Chinese QQ group Modified Paths: -------------- trunk/SelectOrderItems.php Modified: trunk/SelectOrderItems.php =================================================================== --- trunk/SelectOrderItems.php 2012-02-21 10:49:24 UTC (rev 4944) +++ trunk/SelectOrderItems.php 2012-02-21 11:04:57 UTC (rev 4945) @@ -1391,6 +1391,7 @@ <td><input class="number" type="text" name="GPPercent_' . $OrderLine->LineNumber . '" size="4" maxlength="40" value="' . locale_number_format($OrderLine->GPPercent,2) . '" /></td>'; } else { echo '<td class="number">' . locale_number_format($OrderLine->Price,$_SESSION['Items'.$identifier]->CurrDecimalPlaces) . '</td><td></td>'; + echo '<td><input class="number" type="hidden" name="GPPercent_' . $OrderLine->LineNumber . '" size="4" maxlength="40" value="' . locale_number_format($OrderLine->GPPercent,2) . '" /></td>'; echo '<input type="hidden" name="Price_' . $OrderLine->LineNumber . '" value="' . locale_number_format($OrderLine->Price,$_SESSION['Items'.$identifier]->CurrDecimalPlaces) . '" />'; } if ($_SESSION['Items'.$identifier]->Some_Already_Delivered($OrderLine->LineNumber)){ This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <Ex...@us...> - 2012-02-21 11:05:08
|
Revision: 4945 http://web-erp.svn.sourceforge.net/web-erp/?rev=4945&view=rev Author: ExsonQu Date: 2012-02-21 11:04:57 +0000 (Tue, 21 Feb 2012) Log Message: ----------- Fixed bugs that when customer log in, the submit Sales orders will not be the price defined. Wrong data will be stored in salesorderdetails. Reported by CQZ from webERP Chinese QQ group Modified Paths: -------------- trunk/SelectOrderItems.php Modified: trunk/SelectOrderItems.php =================================================================== --- trunk/SelectOrderItems.php 2012-02-21 10:49:24 UTC (rev 4944) +++ trunk/SelectOrderItems.php 2012-02-21 11:04:57 UTC (rev 4945) @@ -1391,6 +1391,7 @@ <td><input class="number" type="text" name="GPPercent_' . $OrderLine->LineNumber . '" size="4" maxlength="40" value="' . locale_number_format($OrderLine->GPPercent,2) . '" /></td>'; } else { echo '<td class="number">' . locale_number_format($OrderLine->Price,$_SESSION['Items'.$identifier]->CurrDecimalPlaces) . '</td><td></td>'; + echo '<td><input class="number" type="hidden" name="GPPercent_' . $OrderLine->LineNumber . '" size="4" maxlength="40" value="' . locale_number_format($OrderLine->GPPercent,2) . '" /></td>'; echo '<input type="hidden" name="Price_' . $OrderLine->LineNumber . '" value="' . locale_number_format($OrderLine->Price,$_SESSION['Items'.$identifier]->CurrDecimalPlaces) . '" />'; } if ($_SESSION['Items'.$identifier]->Some_Already_Delivered($OrderLine->LineNumber)){ This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <Ex...@us...> - 2012-02-23 10:30:33
|
Revision: 4957 http://web-erp.svn.sourceforge.net/web-erp/?rev=4957&view=rev Author: ExsonQu Date: 2012-02-23 10:30:22 +0000 (Thu, 23 Feb 2012) Log Message: ----------- Bug fixed for Customer Login screen which the Total and Due Date column not aligned with data. Remove extra <td></td> Modified Paths: -------------- trunk/SelectOrderItems.php Modified: trunk/SelectOrderItems.php =================================================================== --- trunk/SelectOrderItems.php 2012-02-23 06:23:54 UTC (rev 4956) +++ trunk/SelectOrderItems.php 2012-02-23 10:30:22 UTC (rev 4957) @@ -1390,8 +1390,8 @@ <td><input class="number" type="text" name="Discount_' . $OrderLine->LineNumber . '" size="5" maxlength="4" value="' . locale_number_format(($OrderLine->DiscountPercent * 100),2) . '" /></td> <td><input class="number" type="text" name="GPPercent_' . $OrderLine->LineNumber . '" size="4" maxlength="40" value="' . locale_number_format($OrderLine->GPPercent,2) . '" /></td>'; } else { - echo '<td class="number">' . locale_number_format($OrderLine->Price,$_SESSION['Items'.$identifier]->CurrDecimalPlaces) . '</td><td></td>'; - echo '<td><input class="number" type="hidden" name="GPPercent_' . $OrderLine->LineNumber . '" size="4" maxlength="40" value="' . locale_number_format($OrderLine->GPPercent,2) . '" /></td>'; + echo '<td class="number">' . locale_number_format($OrderLine->Price,$_SESSION['Items'.$identifier]->CurrDecimalPlaces) . '</td>'; + echo '<input class="number" type="hidden" name="GPPercent_' . $OrderLine->LineNumber . '" size="4" maxlength="40" value="' . locale_number_format($OrderLine->GPPercent,2) . '" />'; echo '<input type="hidden" name="Price_' . $OrderLine->LineNumber . '" value="' . locale_number_format($OrderLine->Price,$_SESSION['Items'.$identifier]->CurrDecimalPlaces) . '" />'; } if ($_SESSION['Items'.$identifier]->Some_Already_Delivered($OrderLine->LineNumber)){ @@ -1399,7 +1399,7 @@ } else { $RemTxt = _('Delete'); } - echo '</td><td class="number">' . $DisplayLineTotal . '</td>'; + echo '<td class="number">' . $DisplayLineTotal . '</td>'; $LineDueDate = $OrderLine->ItemDue; if (!Is_Date($OrderLine->ItemDue)){ $LineDueDate = DateAdd (Date($_SESSION['DefaultDateFormat']),'d', $_SESSION['Items'.$identifier]->DeliveryDays); This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <Ex...@us...> - 2012-02-23 10:30:33
|
Revision: 4957 http://web-erp.svn.sourceforge.net/web-erp/?rev=4957&view=rev Author: ExsonQu Date: 2012-02-23 10:30:22 +0000 (Thu, 23 Feb 2012) Log Message: ----------- Bug fixed for Customer Login screen which the Total and Due Date column not aligned with data. Remove extra <td></td> Modified Paths: -------------- trunk/SelectOrderItems.php Modified: trunk/SelectOrderItems.php =================================================================== --- trunk/SelectOrderItems.php 2012-02-23 06:23:54 UTC (rev 4956) +++ trunk/SelectOrderItems.php 2012-02-23 10:30:22 UTC (rev 4957) @@ -1390,8 +1390,8 @@ <td><input class="number" type="text" name="Discount_' . $OrderLine->LineNumber . '" size="5" maxlength="4" value="' . locale_number_format(($OrderLine->DiscountPercent * 100),2) . '" /></td> <td><input class="number" type="text" name="GPPercent_' . $OrderLine->LineNumber . '" size="4" maxlength="40" value="' . locale_number_format($OrderLine->GPPercent,2) . '" /></td>'; } else { - echo '<td class="number">' . locale_number_format($OrderLine->Price,$_SESSION['Items'.$identifier]->CurrDecimalPlaces) . '</td><td></td>'; - echo '<td><input class="number" type="hidden" name="GPPercent_' . $OrderLine->LineNumber . '" size="4" maxlength="40" value="' . locale_number_format($OrderLine->GPPercent,2) . '" /></td>'; + echo '<td class="number">' . locale_number_format($OrderLine->Price,$_SESSION['Items'.$identifier]->CurrDecimalPlaces) . '</td>'; + echo '<input class="number" type="hidden" name="GPPercent_' . $OrderLine->LineNumber . '" size="4" maxlength="40" value="' . locale_number_format($OrderLine->GPPercent,2) . '" />'; echo '<input type="hidden" name="Price_' . $OrderLine->LineNumber . '" value="' . locale_number_format($OrderLine->Price,$_SESSION['Items'.$identifier]->CurrDecimalPlaces) . '" />'; } if ($_SESSION['Items'.$identifier]->Some_Already_Delivered($OrderLine->LineNumber)){ @@ -1399,7 +1399,7 @@ } else { $RemTxt = _('Delete'); } - echo '</td><td class="number">' . $DisplayLineTotal . '</td>'; + echo '<td class="number">' . $DisplayLineTotal . '</td>'; $LineDueDate = $OrderLine->ItemDue; if (!Is_Date($OrderLine->ItemDue)){ $LineDueDate = DateAdd (Date($_SESSION['DefaultDateFormat']),'d', $_SESSION['Items'.$identifier]->DeliveryDays); This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <Ex...@us...> - 2012-02-26 16:07:33
|
Revision: 4978 http://web-erp.svn.sourceforge.net/web-erp/?rev=4978&view=rev Author: ExsonQu Date: 2012-02-26 16:07:26 +0000 (Sun, 26 Feb 2012) Log Message: ----------- 26/02/2012 Fixed bug that when set frequently sold items, there are sql errors which claimed that no group set for sum() function. Fixed by Exson Modified Paths: -------------- trunk/SelectOrderItems.php Modified: trunk/SelectOrderItems.php =================================================================== --- trunk/SelectOrderItems.php 2012-02-26 15:59:37 UTC (rev 4977) +++ trunk/SelectOrderItems.php 2012-02-26 16:07:26 UTC (rev 4978) @@ -1501,8 +1501,7 @@ // This code needs sorting out, but until then : $ImageSource = _('No Image'); // Find the quantity in stock at location - $QOHSQL = "SELECT sum(locstock.quantity) AS qoh, - stockmaster.decimalplaces + $QOHSQL = "SELECT sum(locstock.quantity) AS qoh FROM locstock INNER JOIN stockmaster ON locstock.stockid=stockmaster.stockid WHERE locstock.stockid='" .$myrow['stockid'] . "' AND This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <Ex...@us...> - 2012-02-26 16:07:33
|
Revision: 4978 http://web-erp.svn.sourceforge.net/web-erp/?rev=4978&view=rev Author: ExsonQu Date: 2012-02-26 16:07:26 +0000 (Sun, 26 Feb 2012) Log Message: ----------- 26/02/2012 Fixed bug that when set frequently sold items, there are sql errors which claimed that no group set for sum() function. Fixed by Exson Modified Paths: -------------- trunk/SelectOrderItems.php Modified: trunk/SelectOrderItems.php =================================================================== --- trunk/SelectOrderItems.php 2012-02-26 15:59:37 UTC (rev 4977) +++ trunk/SelectOrderItems.php 2012-02-26 16:07:26 UTC (rev 4978) @@ -1501,8 +1501,7 @@ // This code needs sorting out, but until then : $ImageSource = _('No Image'); // Find the quantity in stock at location - $QOHSQL = "SELECT sum(locstock.quantity) AS qoh, - stockmaster.decimalplaces + $QOHSQL = "SELECT sum(locstock.quantity) AS qoh FROM locstock INNER JOIN stockmaster ON locstock.stockid=stockmaster.stockid WHERE locstock.stockid='" .$myrow['stockid'] . "' AND This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <Ex...@us...> - 2012-05-08 06:12:41
|
Revision: 5325 http://web-erp.svn.sourceforge.net/web-erp/?rev=5325&view=rev Author: ExsonQu Date: 2012-05-08 06:12:35 +0000 (Tue, 08 May 2012) Log Message: ----------- 8/05/2012 Exson Fix typo and add 'L' type for selection in SelectOrderItems.php. Modified Paths: -------------- trunk/SelectOrderItems.php Modified: trunk/SelectOrderItems.php =================================================================== --- trunk/SelectOrderItems.php 2012-05-08 06:07:46 UTC (rev 5324) +++ trunk/SelectOrderItems.php 2012-05-08 06:12:35 UTC (rev 5325) @@ -750,7 +750,7 @@ stockmaster.units FROM stockmaster INNER JOIN stockcategory ON stockmaster.categoryid=stockcategory.categoryid - WHERE (stockcategory.stocktype='F' OR stockcategory.stocktype='D' stockcategory.stocktype='L') + WHERE (stockcategory.stocktype='F' OR stockcategory.stocktype='D' OR stockcategory.stocktype='L') AND stockmaster.mbflag <>'G' AND stockmaster.description " . LIKE . " '" . $SearchString . "' AND stockmaster.discontinued=0 @@ -1631,7 +1631,7 @@ $SQL="SELECT categoryid, categorydescription FROM stockcategory - WHERE stocktype='F' OR stocktype='D' + WHERE stocktype='F' OR stocktype='D' OR stocktype='L' ORDER BY categorydescription"; $result1 = DB_query($SQL,$db); This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <Ex...@us...> - 2012-05-08 06:12:41
|
Revision: 5325 http://web-erp.svn.sourceforge.net/web-erp/?rev=5325&view=rev Author: ExsonQu Date: 2012-05-08 06:12:35 +0000 (Tue, 08 May 2012) Log Message: ----------- 8/05/2012 Exson Fix typo and add 'L' type for selection in SelectOrderItems.php. Modified Paths: -------------- trunk/SelectOrderItems.php Modified: trunk/SelectOrderItems.php =================================================================== --- trunk/SelectOrderItems.php 2012-05-08 06:07:46 UTC (rev 5324) +++ trunk/SelectOrderItems.php 2012-05-08 06:12:35 UTC (rev 5325) @@ -750,7 +750,7 @@ stockmaster.units FROM stockmaster INNER JOIN stockcategory ON stockmaster.categoryid=stockcategory.categoryid - WHERE (stockcategory.stocktype='F' OR stockcategory.stocktype='D' stockcategory.stocktype='L') + WHERE (stockcategory.stocktype='F' OR stockcategory.stocktype='D' OR stockcategory.stocktype='L') AND stockmaster.mbflag <>'G' AND stockmaster.description " . LIKE . " '" . $SearchString . "' AND stockmaster.discontinued=0 @@ -1631,7 +1631,7 @@ $SQL="SELECT categoryid, categorydescription FROM stockcategory - WHERE stocktype='F' OR stocktype='D' + WHERE stocktype='F' OR stocktype='D' OR stocktype='L' ORDER BY categorydescription"; $result1 = DB_query($SQL,$db); This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <Ex...@us...> - 2012-06-02 12:20:09
|
Revision: 5410 http://web-erp.svn.sourceforge.net/web-erp/?rev=5410&view=rev Author: ExsonQu Date: 2012-06-02 12:20:02 +0000 (Sat, 02 Jun 2012) Log Message: ----------- 02/06/2012 Exson: Fixed the order cancel function failure in SelectOrderItems.php. Reported by Pak Richard. Modified Paths: -------------- trunk/SelectOrderItems.php Modified: trunk/SelectOrderItems.php =================================================================== --- trunk/SelectOrderItems.php 2012-06-02 06:09:41 UTC (rev 5409) +++ trunk/SelectOrderItems.php 2012-06-02 12:20:02 UTC (rev 5410) @@ -1671,13 +1671,12 @@ if (!isset($_POST['PartSearch'])) { echo '<script type="text/javascript">if (document.SelectParts) {defaultControl(document.SelectParts.Keywords);}</script>'; } - if (isset($SearchResult)) { echo '<br />'; echo '<div class="page_help_text">' . _('Select an item by entering the quantity required. Click Order when ready.') . '</div>'; echo '<br />'; $j = 1; - echo '<form action="' . htmlspecialchars($_SERVER['PHP_SELF'],ENT_QUOTES,'UTF-8') . '?identifier='.$identifier . '" method="post" id="orderform">'; + echo '<form action="' . htmlspecialchars($_SERVER['PHP_SELF'],ENT_QUOTES,'UTF-8') . '?identifier='.$identifier . '" method="post" name="orderform">'; echo '<div>'; echo '<input type="hidden" name="FormID" value="' . $_SESSION['FormID'] . '" />'; echo '<table class="table1">'; @@ -1864,14 +1863,19 @@ <br /><div class="centre"><input type="submit" name="AssetDisposalEntered" value="' . _('Add Asset To Order') . '" /> <input type="submit" name="PartSearch" value="' . _('Search Parts') . '" /></div>'; - echo '</div> - </form>'; + echo '</div></form>'; + } //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 '<form action="' . htmlspecialchars($_SERVER['PHP_SELF'],ENT_QUOTES,'UTF-8') . '?identifier='.$identifier . + '" method="post" name="deleteform">'; + echo '<div>'; + echo '<input type="hidden" name="FormID" value="' . $_SESSION['FormID'] . '" />'; + 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></form>'; } }#end of else not selecting a customer + if (isset($_GET['NewOrder']) and $_GET['NewOrder']!='') { This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <Ex...@us...> - 2012-06-02 12:20:09
|
Revision: 5410 http://web-erp.svn.sourceforge.net/web-erp/?rev=5410&view=rev Author: ExsonQu Date: 2012-06-02 12:20:02 +0000 (Sat, 02 Jun 2012) Log Message: ----------- 02/06/2012 Exson: Fixed the order cancel function failure in SelectOrderItems.php. Reported by Pak Richard. Modified Paths: -------------- trunk/SelectOrderItems.php Modified: trunk/SelectOrderItems.php =================================================================== --- trunk/SelectOrderItems.php 2012-06-02 06:09:41 UTC (rev 5409) +++ trunk/SelectOrderItems.php 2012-06-02 12:20:02 UTC (rev 5410) @@ -1671,13 +1671,12 @@ if (!isset($_POST['PartSearch'])) { echo '<script type="text/javascript">if (document.SelectParts) {defaultControl(document.SelectParts.Keywords);}</script>'; } - if (isset($SearchResult)) { echo '<br />'; echo '<div class="page_help_text">' . _('Select an item by entering the quantity required. Click Order when ready.') . '</div>'; echo '<br />'; $j = 1; - echo '<form action="' . htmlspecialchars($_SERVER['PHP_SELF'],ENT_QUOTES,'UTF-8') . '?identifier='.$identifier . '" method="post" id="orderform">'; + echo '<form action="' . htmlspecialchars($_SERVER['PHP_SELF'],ENT_QUOTES,'UTF-8') . '?identifier='.$identifier . '" method="post" name="orderform">'; echo '<div>'; echo '<input type="hidden" name="FormID" value="' . $_SESSION['FormID'] . '" />'; echo '<table class="table1">'; @@ -1864,14 +1863,19 @@ <br /><div class="centre"><input type="submit" name="AssetDisposalEntered" value="' . _('Add Asset To Order') . '" /> <input type="submit" name="PartSearch" value="' . _('Search Parts') . '" /></div>'; - echo '</div> - </form>'; + echo '</div></form>'; + } //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 '<form action="' . htmlspecialchars($_SERVER['PHP_SELF'],ENT_QUOTES,'UTF-8') . '?identifier='.$identifier . + '" method="post" name="deleteform">'; + echo '<div>'; + echo '<input type="hidden" name="FormID" value="' . $_SESSION['FormID'] . '" />'; + 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></form>'; } }#end of else not selecting a customer + if (isset($_GET['NewOrder']) and $_GET['NewOrder']!='') { This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <dai...@us...> - 2013-07-08 09:32:13
|
Revision: 6064 http://sourceforge.net/p/web-erp/reponame/6064 Author: daintree Date: 2013-07-08 09:32:09 +0000 (Mon, 08 Jul 2013) Log Message: ----------- html5 tripped on step Modified Paths: -------------- trunk/SelectOrderItems.php Modified: trunk/SelectOrderItems.php =================================================================== --- trunk/SelectOrderItems.php 2013-07-08 09:02:28 UTC (rev 6063) +++ trunk/SelectOrderItems.php 2013-07-08 09:32:09 UTC (rev 6064) @@ -1432,8 +1432,8 @@ /*OK to display with discount if it is an internal user with appropriate permissions */ if (in_array($_SESSION['PageSecurityArray']['OrderEntryDiscountPricing'], $_SESSION['AllowedPageSecurityTokens'])){ echo '<td><input class="number" type="number" step="' . pow(10,-$_SESSION['Items'.$identifier]->CurrDecimalPlaces) . '" min="0" required name="Price_' . $OrderLine->LineNumber . '" size="16" maxlength="16" value="' . locale_number_format($OrderLine->Price,$_SESSION['Items'.$identifier]->CurrDecimalPlaces) . '" /></td> - <td><input class="number" type="number" min="0" required max="100" name="Discount_' . $OrderLine->LineNumber . '" size="5" maxlength="4" value="' . locale_number_format(($OrderLine->DiscountPercent * 100),2) . '" /></td> - <td><input class="number" type="number" min="0" required max="99.9" name="GPPercent_' . $OrderLine->LineNumber . '" size="4" maxlength="40" value="' . locale_number_format($OrderLine->GPPercent,2) . '" /></td>'; + <td><input class="number" type="number" step="0.01" min="0" required max="100" name="Discount_' . $OrderLine->LineNumber . '" size="5" maxlength="4" value="' . locale_number_format(($OrderLine->DiscountPercent * 100),2) . '" /></td> + <td><input class="number" type="number" min="0" step="0.01" required max="99.9" name="GPPercent_' . $OrderLine->LineNumber . '" size="4" maxlength="40" value="' . locale_number_format($OrderLine->GPPercent,2) . '" /></td>'; } else { echo '<td class="number">' . locale_number_format($OrderLine->Price,$_SESSION['Items'.$identifier]->CurrDecimalPlaces); echo '<input class="number" type="hidden" name="GPPercent_' . $OrderLine->LineNumber . '" size="4" maxlength="40" value="' . locale_number_format($OrderLine->GPPercent,2) . '" />'; @@ -1633,8 +1633,8 @@ <td class="number">%s</td> <td class="number">%s</td> <td class="number">%s</td> - <td><input class="number" tabindex="'. strval($j+7).'" type="text" size="6" name="OrderQty' . $i . '" value="0" /> - <input type="hidden" name="StockID' . $i . '" value="' . $myrow['stockid'] . '" /> + <td><input class="number" tabindex="%s" type="number" step="%s" size="6" name="OrderQty%s" value="0" /> + <input type="hidden" name="StockID%s" value="%s" /> </td> </tr>', $myrow['stockid'], @@ -1644,7 +1644,13 @@ locale_number_format($QOH, $QOHRow['decimalplaces']), locale_number_format($DemandQty, $QOHRow['decimalplaces']), locale_number_format($OnOrder, $QOHRow['decimalplaces']), - locale_number_format($Available, $QOHRow['decimalplaces']) ); + locale_number_format($Available, $QOHRow['decimalplaces']), + strval($j+7), + pow(10,-$QOHRow['decimalplaces']), + $i, + $i, + $myrow['stockid']); + if ($j==1) { $jsCall = '<script type="text/javascript"> if (document.getElementById("SelectParts")!=null { @@ -1886,7 +1892,7 @@ echo '<td><input type="text" name="poline_' . $i . '" size="21" maxlength="20" /></td>'; } echo '<td><input type="text" name="part_' . $i . '" size="21" maxlength="20" /></td> - <td><input type="number" name="qty_' . $i . '" size="6" maxlength="6" /></td> + <td><input type="number" step="0.00001" name="qty_' . $i . '" size="6" maxlength="6" /></td> <td><input type="text" class="date" name="itemdue_' . $i . '" size="25" maxlength="25" alt="'.$_SESSION['DefaultDateFormat'].'" value="' . $DefaultDeliveryDate . '" /></td></tr>'; } |
From: <ice...@us...> - 2013-08-05 14:26:43
|
Revision: 6180 http://sourceforge.net/p/web-erp/reponame/6180 Author: icedlava Date: 2013-08-05 14:26:40 +0000 (Mon, 05 Aug 2013) Log Message: ----------- Allow larger maxlength on quantity validation - this includes decimal places Modified Paths: -------------- trunk/SelectOrderItems.php Modified: trunk/SelectOrderItems.php =================================================================== --- trunk/SelectOrderItems.php 2013-08-05 11:14:11 UTC (rev 6179) +++ trunk/SelectOrderItems.php 2013-08-05 14:26:40 UTC (rev 6180) @@ -1421,7 +1421,7 @@ echo '<a target="_blank" href="' . $RootPath . '/StockStatus.php?identifier='.$identifier . '&StockID=' . $OrderLine->StockID . '&DebtorNo=' . $_SESSION['Items'.$identifier]->DebtorNo . '">' . $OrderLine->StockID . '</a></td> <td title="' . $OrderLine->LongDescription . '">' . $OrderLine->ItemDescription . '</td>'; - echo '<td><input class="number" tabindex="2" type="text" required="required" name="Quantity_' . $OrderLine->LineNumber . '" size="6" maxlength="6" value="' . locale_number_format($OrderLine->Quantity,$OrderLine->DecimalPlaces) . '" title="' . _('Enter the quantity of this item ordered by the customer') . '" />'; + echo '<td><input class="number" tabindex="2" type="text" required="required" name="Quantity_' . $OrderLine->LineNumber . '" size="6" maxlength="8" value="' . locale_number_format($OrderLine->Quantity,$OrderLine->DecimalPlaces) . '" title="' . _('Enter the quantity of this item ordered by the customer') . '" />'; if ($QtyRemain != $QtyOrdered){ echo '<br />'.locale_number_format($OrderLine->QtyInv,$OrderLine->DecimalPlaces) .' ' . _('of') . ' ' . locale_number_format($OrderLine->Quantity,$OrderLine->DecimalPlaces).' ' . _('invoiced'); } @@ -1650,7 +1650,7 @@ $i, $i, $myrow['stockid']); - + if ($j==1) { $jsCall = '<script type="text/javascript"> if (document.getElementById("SelectParts")!=null { |
From: <ice...@us...> - 2013-09-01 16:39:08
|
Revision: 6317 http://sourceforge.net/p/web-erp/reponame/6317 Author: icedlava Date: 2013-09-01 16:39:05 +0000 (Sun, 01 Sep 2013) Log Message: ----------- SelectOrderItems.php Fix Frequently ordered items add item so it works. Modified Paths: -------------- trunk/SelectOrderItems.php Modified: trunk/SelectOrderItems.php =================================================================== --- trunk/SelectOrderItems.php 2013-09-01 15:13:06 UTC (rev 6316) +++ trunk/SelectOrderItems.php 2013-09-01 16:39:05 UTC (rev 6317) @@ -1640,7 +1640,6 @@ locale_number_format($OnOrder, $QOHRow['decimalplaces']), locale_number_format($Available, $QOHRow['decimalplaces']), strval($j+7), - pow(10,-$QOHRow['decimalplaces']), $i, $i, $myrow['stockid']); |
From: <ex...@us...> - 2013-11-07 11:16:26
|
Revision: 6397 http://sourceforge.net/p/web-erp/reponame/6397 Author: exsonqu Date: 2013-11-07 11:16:22 +0000 (Thu, 07 Nov 2013) Log Message: ----------- 7/11/2013 Exson: Add check box to allow user to decide weather raw material is sellable or not. Modified Paths: -------------- trunk/SelectOrderItems.php Modified: trunk/SelectOrderItems.php =================================================================== --- trunk/SelectOrderItems.php 2013-11-07 08:15:32 UTC (rev 6396) +++ trunk/SelectOrderItems.php 2013-11-07 11:16:22 UTC (rev 6397) @@ -623,8 +623,9 @@ <td>' . _('Part of the Branch Phone Number') . ':</td> <td><input tabindex="3" type="text" name="CustPhone" size="15" maxlength="18" title="' . _('Enter a part of a customer\'s phone number that you wish to search for then click the Search Now button to find matching customers') . '"/></td> </tr> + </table> - <br /> + <div class="centre"> <input tabindex="4" type="submit" name="SearchCust" value="' . _('Search Now') . '" /> <input tabindex="5" type="submit" name="reset" value="' . _('Reset') . '" /> @@ -749,6 +750,11 @@ } $msg =''; if (isset($_POST['Search']) OR isset($_POST['Next']) OR isset($_POST['Previous'])){ + if(!empty($_POST['RawMaterialFlag'])){ + $RawMaterialSellable = " OR stockcategory.stocktype='M'"; + }else{ + $RawMaterialSellable = ''; + } if ($_POST['Keywords']!='' AND $_POST['StockCode']=='') { $msg='<div class="page_help_text">' . _('Order Item description has been used in search') . '.</div>'; @@ -769,7 +775,7 @@ stockmaster.units FROM stockmaster INNER JOIN stockcategory ON stockmaster.categoryid=stockcategory.categoryid - WHERE (stockcategory.stocktype='F' OR stockcategory.stocktype='D' OR stockcategory.stocktype='L') + WHERE (stockcategory.stocktype='F' OR stockcategory.stocktype='D' OR stockcategory.stocktype='L'".$RawMaterialSellable.") AND stockmaster.mbflag <>'G' AND stockmaster.description " . LIKE . " '" . $SearchString . "' AND stockmaster.discontinued=0 @@ -781,7 +787,7 @@ stockmaster.units FROM stockmaster INNER JOIN stockcategory ON stockmaster.categoryid=stockcategory.categoryid - WHERE (stockcategory.stocktype='F' OR stockcategory.stocktype='D' OR stockcategory.stocktype='L') + WHERE (stockcategory.stocktype='F' OR stockcategory.stocktype='D' OR stockcategory.stocktype='L'".$RawMaterialSellable.") AND stockmaster.mbflag <>'G' AND stockmaster.discontinued=0 AND stockmaster.description " . LIKE . " '" . $SearchString . "' @@ -801,7 +807,7 @@ stockmaster.units FROM stockmaster INNER JOIN stockcategory ON stockmaster.categoryid=stockcategory.categoryid - WHERE (stockcategory.stocktype='F' OR stockcategory.stocktype='D' OR stockcategory.stocktype='L') + WHERE (stockcategory.stocktype='F' OR stockcategory.stocktype='D' OR stockcategory.stocktype='L'".$RawMaterialSellable.") AND stockmaster.stockid " . LIKE . " '" . $SearchString . "' AND stockmaster.mbflag <>'G' AND stockmaster.discontinued=0 @@ -813,7 +819,7 @@ stockmaster.units FROM stockmaster INNER JOIN stockcategory ON stockmaster.categoryid=stockcategory.categoryid - WHERE (stockcategory.stocktype='F' OR stockcategory.stocktype='D' OR stockcategory.stocktype='L') + WHERE (stockcategory.stocktype='F' OR stockcategory.stocktype='D' OR stockcategory.stocktype='L'".$RawMaterialSellable.") AND stockmaster.stockid " . LIKE . " '" . $SearchString . "' AND stockmaster.mbflag <>'G' AND stockmaster.discontinued=0 @@ -829,7 +835,7 @@ stockmaster.units FROM stockmaster INNER JOIN stockcategory ON stockmaster.categoryid=stockcategory.categoryid - WHERE (stockcategory.stocktype='F' OR stockcategory.stocktype='D' OR stockcategory.stocktype='L') + WHERE (stockcategory.stocktype='F' OR stockcategory.stocktype='D' OR stockcategory.stocktype='L'".$RawMaterialSellable.") AND stockmaster.mbflag <>'G' AND stockmaster.discontinued=0 ORDER BY stockmaster.stockid"; @@ -840,7 +846,7 @@ stockmaster.units FROM stockmaster INNER JOIN stockcategory ON stockmaster.categoryid=stockcategory.categoryid - WHERE (stockcategory.stocktype='F' OR stockcategory.stocktype='D' OR stockcategory.stocktype='L') + WHERE (stockcategory.stocktype='F' OR stockcategory.stocktype='D' OR stockcategory.stocktype='L'".$RawMaterialSellable.") AND stockmaster.mbflag <>'G' AND stockmaster.discontinued=0 AND stockmaster.categoryid='" . $_POST['StockCat'] . "' @@ -1691,7 +1697,9 @@ if (isset($_POST['StockCode'])) { echo $_POST['StockCode']; } - echo '" /></td> + echo '" /></td> + + <td><input type="checkbox" name="RawMaterialFlag" value="M" />'._('Raw material flag').' <br/><span class="dpTbl">'._('If checked, Raw material will be show on search result').'</span> </td> </tr>'; echo '<tr> |
From: <ex...@us...> - 2013-11-28 09:21:40
|
Revision: 6445 http://sourceforge.net/p/web-erp/reponame/6445 Author: exsonqu Date: 2013-11-28 09:21:37 +0000 (Thu, 28 Nov 2013) Log Message: ----------- 2013/11/28 Thumb: Add salesman login constraint to only their own customers available in SelectOrderItems.php and fixed SQL error of customers login. Modified Paths: -------------- trunk/SelectOrderItems.php Modified: trunk/SelectOrderItems.php =================================================================== --- trunk/SelectOrderItems.php 2013-11-28 01:00:08 UTC (rev 6444) +++ trunk/SelectOrderItems.php 2013-11-28 09:21:37 UTC (rev 6445) @@ -311,43 +311,35 @@ AND $_SESSION['RequireCustomerSelection']==1 AND in_array($_SESSION['PageSecurityArray']['ConfirmDispatch_Invoice.php'], $_SESSION['AllowedPageSecurityTokens'])){ + $SQL = "SELECT custbranch.brname, + custbranch.contactname, + custbranch.phoneno, + custbranch.faxno, + custbranch.branchcode, + custbranch.debtorno, + debtorsmaster.name + FROM custbranch + LEFT JOIN debtorsmaster + ON custbranch.debtorno=debtorsmaster.debtorno + WHERE custbranch.disabletrans=0 "; + if (($_POST['CustKeywords']=='') AND ($_POST['CustCode']=='') AND ($_POST['CustPhone']=='')) { - $SQL = "SELECT custbranch.brname, - custbranch.contactname, - custbranch.phoneno, - custbranch.faxno, - custbranch.branchcode, - custbranch.debtorno, - debtorsmaster.name - FROM custbranch - LEFT JOIN debtorsmaster - ON custbranch.debtorno=debtorsmaster.debtorno"; + $SQL .= ""; } else { //insert wildcard characters in spaces $_POST['CustKeywords'] = mb_strtoupper(trim($_POST['CustKeywords'])); $SearchString = str_replace(' ', '%', $_POST['CustKeywords']) ; - $SQL = "SELECT custbranch.brname, - custbranch.contactname, - custbranch.phoneno, - custbranch.faxno, - custbranch.branchcode, - custbranch.debtorno, - debtorsmaster.name - FROM custbranch - LEFT JOIN debtorsmaster - ON custbranch.debtorno=debtorsmaster.debtorno - WHERE custbranch.brname " . LIKE . " '%" . $SearchString . "%' - AND custbranch.branchcode " . LIKE . " '%" . mb_strtoupper(trim($_POST['CustCode'])) . "%' - AND custbranch.phoneno " . LIKE . " '%" . trim($_POST['CustPhone']) . "%'"; - - if ($_SESSION['SalesmanLogin']!=''){ - $SQL .= " AND custbranch.salesman='" . $_SESSION['SalesmanLogin'] . "'"; - } - $SQL .= " AND custbranch.disabletrans=0 - ORDER BY custbranch.debtorno, - custbranch.branchcode"; + $SQL .= "AND custbranch.brname " . LIKE . " '%" . $SearchString . "%' + AND custbranch.branchcode " . LIKE . " '%" . mb_strtoupper(trim($_POST['CustCode'])) . "%' + AND custbranch.phoneno " . LIKE . " '%" . trim($_POST['CustPhone']) . "%'"; + } /*one of keywords or custcode was more than a zero length string */ + if ($_SESSION['SalesmanLogin']!=''){ + $SQL .= " AND custbranch.salesman='" . $_SESSION['SalesmanLogin'] . "'"; + } + $SQL .= " ORDER BY custbranch.debtorno, + custbranch.branchcode"; $ErrMsg = _('The searched customer records requested cannot be retrieved because'); $result_CustSelect = DB_query($SQL,$db,$ErrMsg); @@ -529,7 +521,7 @@ ON debtorsmaster.holdreason=holdreasons.reasoncode INNER JOIN currencies ON debtorsmaster.currcode=currencies.currabrev - AND debtorsmaster.debtorno = '" . $_SESSION['Items'.$identifier]->DebtorNo . "'"; + WHERE debtorsmaster.debtorno = '" . $_SESSION['Items'.$identifier]->DebtorNo . "'"; $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; |
From: <ex...@us...> - 2014-05-19 09:06:20
|
Revision: 6720 http://sourceforge.net/p/web-erp/reponame/6720 Author: exsonqu Date: 2014-05-19 09:06:18 +0000 (Mon, 19 May 2014) Log Message: ----------- 19/5/14 Exson: Tidy up code of SelectOrderItems.php. Modified Paths: -------------- trunk/SelectOrderItems.php Modified: trunk/SelectOrderItems.php =================================================================== --- trunk/SelectOrderItems.php 2014-05-18 17:36:42 UTC (rev 6719) +++ trunk/SelectOrderItems.php 2014-05-19 09:06:18 UTC (rev 6720) @@ -424,33 +424,8 @@ $_SESSION['Items'.$identifier]->CurrDecimalPlaces = $myrow['decimalplaces']; # 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 + $result = GetCustBranchDetails($identifier); - $sql = "SELECT custbranch.brname, - custbranch.braddress1, - custbranch.braddress2, - custbranch.braddress3, - custbranch.braddress4, - custbranch.braddress5, - custbranch.braddress6, - custbranch.phoneno, - custbranch.email, - custbranch.defaultlocation, - custbranch.defaultshipvia, - custbranch.deliverblind, - custbranch.specialinstructions, - custbranch.estdeliverydays, - locations.locationname, - custbranch.salesman - FROM custbranch - INNER JOIN locations - ON custbranch.defaultlocation=locations.loccode - WHERE custbranch.branchcode='" . $_SESSION['Items'.$identifier]->Branch . "' - AND custbranch.debtorno = '" . $_SESSION['Items'.$identifier]->DebtorNo . "'"; - - $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') . ': ' . $_SESSION['Items'.$identifier]->DebtorNo . ' ' . _('could not be retrieved') . '. ' . _('Check the set up of the customer and branch'),'error'); @@ -549,30 +524,7 @@ // the branch would be set in the user data so default delivery details as necessary. However, // the order process will ask for branch details later anyway - $sql = "SELECT custbranch.brname, - custbranch.branchcode, - custbranch.braddress1, - custbranch.braddress2, - custbranch.braddress3, - custbranch.braddress4, - custbranch.braddress5, - custbranch.braddress6, - custbranch.phoneno, - custbranch.email, - custbranch.defaultlocation, - custbranch.deliverblind, - custbranch.estdeliverydays, - locations.locationname, - custbranch.salesman - FROM custbranch INNER JOIN locations - ON custbranch.defaultlocation=locations.loccode - WHERE custbranch.branchcode='" . $_SESSION['Items'.$identifier]->Branch . "' - AND custbranch.debtorno = '" . $_SESSION['Items'.$identifier]->DebtorNo . "'"; - - $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); - + $result = GetCustBranchDetails($identifier); $myrow = DB_fetch_array($result); $_SESSION['Items'.$identifier]->DeliverTo = $myrow['brname']; $_SESSION['Items'.$identifier]->DelAdd1 = $myrow['braddress1']; @@ -767,40 +719,27 @@ } elseif ($_POST['Keywords']=='' AND $_POST['StockCode']=='') { $msg='<div class="page_help_text">' . _('Stock Category has been used in search') . '.</div>'; } + $SQL = "SELECT stockmaster.stockid, + stockmaster.description, + stockmaster.longdescription, + stockmaster.units + FROM stockmaster INNER JOIN stockcategory + ON stockmaster.categoryid=stockcategory.categoryid + WHERE (stockcategory.stocktype='F' OR stockcategory.stocktype='D' OR stockcategory.stocktype='L') + AND stockmaster.mbflag <>'G' + AND stockmaster.discontinued=0 "; if (isset($_POST['Keywords']) AND mb_strlen($_POST['Keywords'])>0) { //insert wildcard characters in spaces $_POST['Keywords'] = mb_strtoupper($_POST['Keywords']); $SearchString = '%' . str_replace(' ', '%', $_POST['Keywords']) . '%'; if ($_POST['StockCat']=='All'){ - $SQL = "SELECT stockmaster.stockid, - stockmaster.description, - stockmaster.longdescription, - stockmaster.units, - custitem.cust_part, - custitem.cust_description - FROM stockmaster INNER JOIN stockcategory - ON stockmaster.categoryid=stockcategory.categoryid" . $IncludeCustItem . " - WHERE (stockcategory.stocktype='F' OR stockcategory.stocktype='D' OR stockcategory.stocktype='L'".$RawMaterialSellable.") - AND stockmaster.mbflag <>'G' - AND stockmaster.description " . LIKE . " '" . $SearchString . "' - AND stockmaster.discontinued=0 - ORDER BY stockmaster.stockid"; + $SQL .= "AND stockmaster.description " . LIKE . " '" . $SearchString . "' + ORDER BY stockmaster.stockid"; } else { - $SQL = "SELECT stockmaster.stockid, - stockmaster.description, - stockmaster.longdescription, - stockmaster.units, - custitem.cust_part, - custitem.cust_description - FROM stockmaster INNER JOIN stockcategory - ON stockmaster.categoryid=stockcategory.categoryid" . $IncludeCustItem . " - WHERE (stockcategory.stocktype='F' OR stockcategory.stocktype='D' OR stockcategory.stocktype='L'".$RawMaterialSellable.") - AND stockmaster.mbflag <>'G' - AND stockmaster.discontinued=0 - AND stockmaster.description " . LIKE . " '" . $SearchString . "' - AND stockmaster.categoryid='" . $_POST['StockCat'] . "' - ORDER BY stockmaster.stockid"; + $SQL .= "AND stockmaster.description " . LIKE . " '" . $SearchString . "' + AND stockmaster.categoryid='" . $_POST['StockCat'] . "' + ORDER BY stockmaster.stockid"; } } elseif (mb_strlen($_POST['StockCode'])>0){ @@ -809,64 +748,20 @@ $SearchString = '%' . $_POST['StockCode'] . '%'; if ($_POST['StockCat']=='All'){ - $SQL = "SELECT stockmaster.stockid, - stockmaster.description, - stockmaster.longdescription, - stockmaster.units, - custitem.cust_part, - custitem.cust_description - FROM stockmaster INNER JOIN stockcategory - ON stockmaster.categoryid=stockcategory.categoryid" . $IncludeCustItem . " - WHERE (stockcategory.stocktype='F' OR stockcategory.stocktype='D' OR stockcategory.stocktype='L'".$RawMaterialSellable.") - AND stockmaster.stockid " . LIKE . " '" . $SearchString . "' - AND stockmaster.mbflag <>'G' - AND stockmaster.discontinued=0 - ORDER BY stockmaster.stockid"; + $SQL .= "AND stockmaster.stockid " . LIKE . " '" . $SearchString . "' + ORDER BY stockmaster.stockid"; } else { - $SQL = "SELECT stockmaster.stockid, - stockmaster.description, - stockmaster.longdescription, - stockmaster.units, - custitem.cust_part, - custitem.cust_description - FROM stockmaster INNER JOIN stockcategory - ON stockmaster.categoryid=stockcategory.categoryid" . $IncludeCustItem . " - WHERE (stockcategory.stocktype='F' OR stockcategory.stocktype='D' OR stockcategory.stocktype='L'".$RawMaterialSellable.") - AND stockmaster.stockid " . LIKE . " '" . $SearchString . "' - AND stockmaster.mbflag <>'G' - AND stockmaster.discontinued=0 - AND stockmaster.categoryid='" . $_POST['StockCat'] . "' - ORDER BY stockmaster.stockid"; + $SQL .= "AND stockmaster.stockid " . LIKE . " '" . $SearchString . "' + AND stockmaster.categoryid='" . $_POST['StockCat'] . "' + ORDER BY stockmaster.stockid"; } } else { if ($_POST['StockCat']=='All'){ - $SQL = "SELECT stockmaster.stockid, - stockmaster.description, - stockmaster.longdescription, - stockmaster.units, - custitem.cust_part, - custitem.cust_description - FROM stockmaster INNER JOIN stockcategory - ON stockmaster.categoryid=stockcategory.categoryid" . $IncludeCustItem . " - WHERE (stockcategory.stocktype='F' OR stockcategory.stocktype='D' OR stockcategory.stocktype='L'".$RawMaterialSellable.") - AND stockmaster.mbflag <>'G' - AND stockmaster.discontinued=0 - ORDER BY stockmaster.stockid"; + $SQL .= "ORDER BY stockmaster.stockid"; } else { - $SQL = "SELECT stockmaster.stockid, - stockmaster.description, - stockmaster.longdescription, - stockmaster.units, - custitem.cust_part, - custitem.cust_description - FROM stockmaster INNER JOIN stockcategory - ON stockmaster.categoryid=stockcategory.categoryid" . $IncludeCustItem . " - WHERE (stockcategory.stocktype='F' OR stockcategory.stocktype='D' OR stockcategory.stocktype='L'".$RawMaterialSellable.") - AND stockmaster.mbflag <>'G' - AND stockmaster.discontinued=0 - AND stockmaster.categoryid='" . $_POST['StockCat'] . "' - ORDER BY stockmaster.stockid"; + $SQL .= "AND stockmaster.categoryid='" . $_POST['StockCat'] . "' + ORDER BY stockmaster.stockid"; } } @@ -1957,4 +1852,35 @@ }#end of else not selecting a customer include('includes/footer.inc'); + +function GetCustBranchDetails($identifier) { + global $db; + $sql = "SELECT custbranch.brname, + custbranch.branchcode, + custbranch.braddress1, + custbranch.braddress2, + custbranch.braddress3, + custbranch.braddress4, + custbranch.braddress5, + custbranch.braddress6, + custbranch.phoneno, + custbranch.email, + custbranch.defaultlocation, + custbranch.defaultshipvia, + custbranch.deliverblind, + custbranch.specialinstructions, + custbranch.estdeliverydays, + locations.locationname, + custbranch.salesman + FROM custbranch + INNER JOIN locations + ON custbranch.defaultlocation=locations.loccode + WHERE custbranch.branchcode='" . $_SESSION['Items'.$identifier]->Branch . "' + AND custbranch.debtorno = '" . $_SESSION['Items'.$identifier]->DebtorNo . "'"; + + $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); + return $result; +} ?> \ No newline at end of file |
From: <ex...@us...> - 2014-05-26 10:33:06
|
Revision: 6732 http://sourceforge.net/p/web-erp/reponame/6732 Author: exsonqu Date: 2014-05-26 10:33:02 +0000 (Mon, 26 May 2014) Log Message: ----------- 26/05/14 Thumb: Fixed discount modifier missing bug in SelectOrderItems.php. Modified Paths: -------------- trunk/SelectOrderItems.php Modified: trunk/SelectOrderItems.php =================================================================== --- trunk/SelectOrderItems.php 2014-05-26 07:16:23 UTC (rev 6731) +++ trunk/SelectOrderItems.php 2014-05-26 10:33:02 UTC (rev 6732) @@ -1022,7 +1022,7 @@ /*There is a new price being input for the line item */ $Price = filter_number_format($_POST['Price_' . $OrderLine->LineNumber]); - $_POST['GPPercent_' . $OrderLine->LineNumber] = (($Price*(1-(filter_number_format($_POST['Discount_' . $OrderLine->LineNumber])/100))) - $OrderLine->StandardCost*$ExRate)/($Price *(1-filter_number_format($_POST['Discount_' . $OrderLine->LineNumber]))/100); + $_POST['GPPercent_' . $OrderLine->LineNumber] = (($Price*(1-(filter_number_format($_POST['Discount_' . $OrderLine->LineNumber])/100))) - $OrderLine->StandardCost*$ExRate)/($Price *(1-filter_number_format($_POST['Discount_' . $OrderLine->LineNumber])/100)/100); } elseif (ABS($OrderLine->GPPercent - filter_number_format($_POST['GPPercent_' . $OrderLine->LineNumber]))>=0.01) { /* A GP % has been input so need to do a recalculation of the price at this new GP Percentage */ @@ -1883,4 +1883,4 @@ $result = DB_query($sql,$db,$ErrMsg,$DbgMsg); return $result; } -?> \ No newline at end of file +?> |
From: <ex...@us...> - 2014-06-23 02:12:17
|
Revision: 6773 http://sourceforge.net/p/web-erp/reponame/6773 Author: exsonqu Date: 2014-06-23 02:12:12 +0000 (Mon, 23 Jun 2014) Log Message: ----------- 23/06/14 Exson: Fixed the bug that the sales order line's quantity will be update to zero but it show no change in appearance in SelectOrderItems.php. Modified Paths: -------------- trunk/SelectOrderItems.php Modified: trunk/SelectOrderItems.php =================================================================== --- trunk/SelectOrderItems.php 2014-06-22 21:30:22 UTC (rev 6772) +++ trunk/SelectOrderItems.php 2014-06-23 02:12:12 UTC (rev 6773) @@ -1085,8 +1085,8 @@ $AlreadyWarnedAboutCredit = true; } } - - if ($WithinCreditLimit){ + /* The database data will be updated at this step, it will make big mistake if users do not know this and change the quantity to zero, unfortuately, the appearance shows that this change not allowed but the sales order details' quantity has been changed to zero in database. Must to filter this out! A zero quantity order line means nothing */ + if ($WithinCreditLimit AND $Quantity >0){ $_SESSION['Items'.$identifier]->update_cart_item($OrderLine->LineNumber, $Quantity, $Price, |
From: <dai...@us...> - 2014-10-13 09:11:23
|
Revision: 6915 http://sourceforge.net/p/web-erp/reponame/6915 Author: daintree Date: 2014-10-13 09:11:10 +0000 (Mon, 13 Oct 2014) Log Message: ----------- Pre 4.11.5 Modified Paths: -------------- trunk/SelectOrderItems.php Modified: trunk/SelectOrderItems.php =================================================================== --- trunk/SelectOrderItems.php 2014-10-13 08:56:08 UTC (rev 6914) +++ trunk/SelectOrderItems.php 2014-10-13 09:11:10 UTC (rev 6915) @@ -55,7 +55,7 @@ $_SESSION['ExistingOrder' .$identifier]=0; $_SESSION['Items'.$identifier] = new cart; - if (isset($CustomerLogin)){ //its a customer logon + if ($CustomerLogin==1){ //its a customer logon $_SESSION['Items'.$identifier]->DebtorNo=$_SESSION['CustomerID']; $_SESSION['Items'.$identifier]->BranchCode=$_SESSION['UserBranch']; $SelectedCustomer = $_SESSION['CustomerID']; |