From: <dai...@us...> - 2011-12-28 22:26:33
|
Revision: 4789 http://web-erp.svn.sourceforge.net/web-erp/?rev=4789&view=rev Author: daintree Date: 2011-12-28 22:26:27 +0000 (Wed, 28 Dec 2011) Log Message: ----------- Modified Paths: -------------- trunk/CounterSales.php trunk/includes/DefineCartClass.php trunk/includes/SelectOrderItems_IntoCart.inc Modified: trunk/CounterSales.php =================================================================== --- trunk/CounterSales.php 2011-12-27 21:47:35 UTC (rev 4788) +++ trunk/CounterSales.php 2011-12-28 22:26:27 UTC (rev 4789) @@ -1008,7 +1008,7 @@ // ************************************************************************* // S T A R T O F I N V O I C E S Q L P R O C E S S I N G // ************************************************************************* - + $result = DB_Txn_Begin($db); /*First add the order to the database - it only exists in the session currently! */ $OrderNo = GetNextTransNo(30, $db); @@ -1086,7 +1086,7 @@ * and it is a real order (not just a quotation)*/ if ($StockItem->MBflag=='M' - and $_SESSION['AutoCreateWOs']==1){ //oh yeah its all on! + AND $_SESSION['AutoCreateWOs']==1){ //oh yeah its all on! //now get the data required to test to see if we need to make a new WO $QOHResult = DB_query("SELECT SUM(quantity) FROM locstock WHERE stockid='" . $StockItem->StockID . "'",$db); @@ -1229,8 +1229,6 @@ }//end if auto create WOs in on } /* end inserted line items into sales order details */ - $result = DB_Txn_Commit($db); - prnMsg(_('Order Number') . ' ' . $OrderNo . ' ' . _('has been entered'),'success'); /* End of insertion of new sales order */ @@ -1241,10 +1239,6 @@ $InvoiceNo = GetNextTransNo(10, $db); $PeriodNo = GetPeriod(Date($_SESSION['DefaultDateFormat']), $db); - /*Start an SQL transaction */ - - DB_Txn_Begin($db); - $DefaultDispatchDate = Date('Y-m-d'); /*Update order header for invoice charged on */ Modified: trunk/includes/DefineCartClass.php =================================================================== --- trunk/includes/DefineCartClass.php 2011-12-27 21:47:35 UTC (rev 4788) +++ trunk/includes/DefineCartClass.php 2011-12-28 22:26:27 UTC (rev 4789) @@ -60,6 +60,7 @@ var $TaxTotals; var $TaxGLCodes; var $BuyerName; + var $SpecialInstructions; function Cart(){ /*Constructor function initialises a new shopping cart */ @@ -157,7 +158,7 @@ discountpercent, itemdue, poline) - VALUES(" . $this->LineCounter . ", + VALUES(" . $LineNumber . ", " . $_SESSION['ExistingOrder' . $identifier] . ", '" . trim(mb_strtoupper($StockID)) ."', " . $Qty . ", Modified: trunk/includes/SelectOrderItems_IntoCart.inc =================================================================== --- trunk/includes/SelectOrderItems_IntoCart.inc 2011-12-27 21:47:35 UTC (rev 4788) +++ trunk/includes/SelectOrderItems_IntoCart.inc 2011-12-28 22:26:27 UTC (rev 4789) @@ -78,9 +78,9 @@ if ($_SESSION['ExistingOrder' . $identifier]!=0){ $UpdateDB = 'Yes'; - $result = DB_query("SELECT MAX(orderlineno) AS newlineno FROM salesorderdetails WHERE orderno='" . $_SESSION['ExistingOrder' . $identifier] . "'",$db); + $result = DB_query("SELECT MAX(orderlineno) AS newlineno FROM salesorderdetails WHERE orderno='" . $_SESSION['ExistingOrder' . $identifier] . "'",$db); $MaxNumRow = DB_fetch_row($result); - if ($MaxNumRow[0] != '' AND $MaxNumRow[0] > 0) { + if ($MaxNumRow[0] != '' AND $MaxNumRow[0] >= 0) { $NewLineNo = $MaxNumRow[0]+1; } else { $NewLineNo = 0; @@ -89,7 +89,7 @@ $UpdateDB = 'No'; $NewLineNo = -1; /* this is ok b/c CartClass will change to the correct line no */ } - + if (isset($StockItem) and $myItemRow['discountcategory'] != '' ){ $DiscCatsDone[$Counter]=$StockItem->DiscCat; $QuantityOfDiscCat =0; @@ -115,8 +115,8 @@ if ($_SESSION['Items'.$identifier]->SpecialInstructions) { prnMsg($_SESSION['Items'.$identifier]->SpecialInstructions,'warn'); } - if ($_SESSION['CheckCreditLimits'] > 0 AND $AlreadyWarnedAboutCredit==false){ /*Check credit limits is 1 for warn - and 2 for prohibit sales */ + if ($_SESSION['CheckCreditLimits'] > 0 AND $AlreadyWarnedAboutCredit==false){ + /*Check credit limits is 1 for warn and 2 for prohibit sales */ $_SESSION['Items'.$identifier]->CreditAvailable -= round(($NewItemQty * $Price * (1- $Discount)),$_SESSION['Items'.$identifier]->CurrDecimalPlaces); if ($_SESSION['CheckCreditLimits']==1 AND $_SESSION['Items'.$identifier]->CreditAvailable <=0){ @@ -156,7 +156,8 @@ $myItemRow['standardcost'], $myItemRow['eoq'], $myItemRow['nextserialno'], - $ExRate); + $ExRate, + $identifier); } } else { This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |