| 
     
      
      
      From: <dai...@us...> - 2011-12-13 08:55:50
      
     
   | 
Revision: 4772
          http://web-erp.svn.sourceforge.net/web-erp/?rev=4772&view=rev
Author:   daintree
Date:     2011-12-13 08:55:38 +0000 (Tue, 13 Dec 2011)
Log Message:
-----------
Additional changes to ExistingOrder
Modified Paths:
--------------
    trunk/CounterSales.php
    trunk/Credit_Invoice.php
    trunk/DeliveryDetails.php
    trunk/RecurringSalesOrders.php
    trunk/SalesByTypePeriodInquiry.php
    trunk/SalesCategoryPeriodInquiry.php
    trunk/SalesTopItemsInquiry.php
    trunk/SelectOrderItems.php
    trunk/doc/Change.log
    trunk/includes/DefineCartClass.php
    trunk/includes/SelectOrderItems_IntoCart.inc
Modified: trunk/CounterSales.php
===================================================================
--- trunk/CounterSales.php	2011-12-13 07:50:19 UTC (rev 4771)
+++ trunk/CounterSales.php	2011-12-13 08:55:38 UTC (rev 4772)
@@ -63,7 +63,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 ain't even started !!*/
 	/*Get the default customer-branch combo from the user's default location record */
Modified: trunk/Credit_Invoice.php
===================================================================
--- trunk/Credit_Invoice.php	2011-12-13 07:50:19 UTC (rev 4771)
+++ trunk/Credit_Invoice.php	2011-12-13 08:55:38 UTC (rev 4772)
@@ -156,8 +156,8 @@
 														'',
 														'',
 														'',
-														$myrow['standardcost']
-														);
+														$myrow['standardcost']);
+														
 				$_SESSION['CreditItems']->GetExistingTaxes($LineNumber, $myrow['stkmoveno']);
 
 				if ($myrow['controlled']==1){/* Populate the SerialItems array too*/
Modified: trunk/DeliveryDetails.php
===================================================================
--- trunk/DeliveryDetails.php	2011-12-13 07:50:19 UTC (rev 4771)
+++ trunk/DeliveryDetails.php	2011-12-13 08:55:38 UTC (rev 4772)
@@ -855,11 +855,11 @@
 
 		echo '<td>'.$StockItem->StockID.'</td>
 			<td>'.$StockItem->ItemDescription.'</td>
-			<td class=number>'.$DisplayQuantity.'</td>
+			<td class="number">'.$DisplayQuantity.'</td>
 			<td>'.$StockItem->Units.'</td>
-			<td class=number>'.$DisplayPrice.'</td>
-			<td class=number>'.$DisplayDiscount.'</td>
-			<td class=number>'.$DisplayLineTotal.'</td>
+			<td class="number">'.$DisplayPrice.'</td>
+			<td class="number">'.$DisplayDiscount.'</td>
+			<td class="number">'.$DisplayLineTotal.'</td>
 		</tr>';
 
 		$_SESSION['Items'.$identifier]->total = $_SESSION['Items'.$identifier]->total + $LineTotal;
@@ -869,25 +869,30 @@
 
 	$DisplayTotal = number_format($_SESSION['Items'.$identifier]->total,2);
 	echo '<tr class="EvenTableRows">
-		<td colspan=6 class=number><b>'. _('TOTAL Excl Tax/Freight') .'</b></td>
-		<td class=number>'.$DisplayTotal.'</td>
-	</tr></table>';
+			<td colspan="6" class="number"><b>'. _('TOTAL Excl Tax/Freight') .'</b></td>
+			<td class="number">'.$DisplayTotal.'</td>
+		</tr>
+		</table>';
 
 	$DisplayVolume = number_format($_SESSION['Items'.$identifier]->totalVolume,2);
 	$DisplayWeight = number_format($_SESSION['Items'.$identifier]->totalWeight,2);
-	echo '<br /><table><tr class="EvenTableRows">
-		<td>'. _('Total Weight') .':</td>
-		<td class="number">'.$DisplayWeight.'</td>
-		<td>'. _('Total Volume') .':</td>
-		<td class="number">'.$DisplayVolume.'</td>
-	</tr></table>';
+	echo '<br />
+		<table>
+		<tr class="EvenTableRows">
+			<td>'. _('Total Weight') .':</td>
+			<td class="number">'.$DisplayWeight.'</td>
+			<td>'. _('Total Volume') .':</td>
+			<td class="number">'.$DisplayVolume.'</td>
+		</tr>
+		</table>';
 
 } else {
 
 /*Display the order without discount */
 
 	echo '<div class="centre"><b>' . _('Order Summary') . '</b></div>
-	<table cellpadding=2 colspan=7 border=1><tr>
+	<table class="selection">
+	<tr>
 		<th>'. _('Item Description') .'</th>
 		<th>'. _('Quantity') .'</th>
 		<th>'. _('Unit') .'</th>
@@ -914,10 +919,10 @@
 			$k=1;
 		}
 		echo '<td>'.$StockItem->ItemDescription.'</td>
-			<td class=number>'. $DisplayQuantity.'</td>
+			<td class="number">'. $DisplayQuantity.'</td>
 			<td>'.$StockItem->Units.'</td>
-			<td class=number>'. $DisplayPrice.'</td>
-			<td class=number>'. $DisplayLineTotal .'</font></td>
+			<td class="number">'. $DisplayPrice.'</td>
+			<td class="number">'. $DisplayLineTotal .'</font></td>
 		</tr>';
 
 		$_SESSION['Items'.$identifier]->total = $_SESSION['Items'.$identifier]->total + $LineTotal;
@@ -927,12 +932,14 @@
 	}
 
 	$DisplayTotal = number_format($_SESSION['Items'.$identifier]->total,$_SESSION['Items'.$identifier]->CurrDecimalPlaces);
-	echo '<table class=selection><tr>
-		<td>'. _('Total Weight') .':</td>
-		<td>'.$DisplayWeight .'</td>
-		<td>'. _('Total Volume') .':</td>
-		<td>'.$DisplayVolume .'</td>
-	</tr></table>';
+	echo '<table class="selection">
+		<tr>
+			<td>'. _('Total Weight') .':</td>
+			<td>'.$DisplayWeight .'</td>
+			<td>'. _('Total Volume') .':</td>
+			<td>'.$DisplayVolume .'</td>
+		</tr>
+		</table>';
 
 	$DisplayVolume = number_format($_SESSION['Items'.$identifier]->totalVolume,2);
 	$DisplayWeight = number_format($_SESSION['Items'.$identifier]->totalWeight,2);
@@ -945,10 +952,12 @@
 
 }
 
-echo '<br /><table  class=selection><tr>
-	<td>'. _('Deliver To') .':</td>
-	<td><input type="text" size=42 maxlength=40 name="DeliverTo" value="' . $_SESSION['Items'.$identifier]->DeliverTo . '"></td>
-</tr>';
+echo '<br />
+	<table class="selection">
+	<tr>
+		<td>'. _('Deliver To') .':</td>
+		<td><input type="text" size="42" maxlength="40" name="DeliverTo" value="' . $_SESSION['Items'.$identifier]->DeliverTo . '" /></td>
+	</tr>';
 
 echo '<tr>
 	<td>'. _('Deliver from the warehouse at') .':</td>
@@ -986,66 +995,59 @@
 
 // The estimated Dispatch date or Delivery date for this order
 echo '<tr>
-	<td>'. _('Estimated Delivery Date') .':</td>
-	<td><input class="date" alt="'.$_SESSION['DefaultDateFormat'].'" type="text" size=15 maxlength=14 name="DeliveryDate" value="' . $_SESSION['Items'.$identifier]->DeliveryDate . '"></td>
+		<td>'. _('Estimated Delivery Date') .':</td>
+		<td><input class="date" alt="'.$_SESSION['DefaultDateFormat'].'" type="text" size=15 maxlength=14 name="DeliveryDate" value="' . $_SESSION['Items'.$identifier]->DeliveryDate . '"></td>
 	</tr>';
 // The date when a quote was issued to the customer
 echo '<tr>
-	<td>'. _('Quote Date') .':</td>
-	<td><input class="date" alt="'.$_SESSION['DefaultDateFormat'].'" type="text" size=15 maxlength=14 name="QuoteDate" value="' . $_SESSION['Items'.$identifier]->QuoteDate . '"></td>
+		<td>'. _('Quote Date') .':</td>
+		<td><input class="date" alt="'.$_SESSION['DefaultDateFormat'].'" type="text" size="15" maxlength="14" name="QuoteDate" value="' . $_SESSION['Items'.$identifier]->QuoteDate . '" /></td>
 	</tr>';
 // The date when the customer confirmed their order
 echo '<tr>
-	<td>'. _('Confirmed Order Date') .':</td>
-	<td><input class="date" alt="'.$_SESSION['DefaultDateFormat'].'" type="text" size=15 maxlength=14 name="ConfirmedDate" value="' . $_SESSION['Items'.$identifier]->ConfirmedDate . '"></td>
+		<td>'. _('Confirmed Order Date') .':</td>
+		<td><input class="date" alt="'.$_SESSION['DefaultDateFormat'].'" type="text" size="15" maxlength="14" name="ConfirmedDate" value="' . $_SESSION['Items'.$identifier]->ConfirmedDate . '" /></td>
+	</tr>
+	<tr>
+		<td>'. _('Delivery Address 1') . ':</td>
+		<td><input type="text" size="42" maxlength="40" name="BrAdd1" value="' . $_SESSION['Items'.$identifier]->DelAdd1 . '" /></td>
+	</tr>
+	<tr>
+		<td>'. _('Delivery Address 2') . ':</td>
+		<td><input type="text" size="42" maxlength="40" name="BrAdd2" value="' . $_SESSION['Items'.$identifier]->DelAdd2 . '" /></td>
+	</tr>
+	<tr>
+		<td>'. _('Delivery Address 3') . ':</td>
+		<td><input type="text" size="42" maxlength="40" name="BrAdd3" value="' . $_SESSION['Items'.$identifier]->DelAdd3 . '" /></td>
+	</tr>
+	<tr>
+		<td>'. _('Delivery Address 4') . ':</td>
+		<td><input type="text" size="42" maxlength="40" name="BrAdd4" value="' . $_SESSION['Items'.$identifier]->DelAdd4 . '" /></td>
+	</tr>
+	<tr>
+		<td>'. _('Delivery Address 5') . ':</td>
+		<td><input type="text" size="42" maxlength="40" name="BrAdd5" value="' . $_SESSION['Items'.$identifier]->DelAdd5 . '" /></td>
+	</tr>
+	<tr>
+		<td>'. _('Delivery Address 6') . ':</td>
+		<td><input type="text" size="42" maxlength="40" name="BrAdd6" value="' . $_SESSION['Items'.$identifier]->DelAdd6 . '" /></td>
+	</tr>
+	<tr>
+		<td>'. _('Contact Phone Number') .':</td>
+		<td><input type="text" size=25 maxlength=25 name="PhoneNo" value="' . $_SESSION['Items'.$identifier]->PhoneNo . '"></td>
+	</tr>
+	<tr>
+		<td>' . _('Contact Email') . ':</td><td><input type="text" size=40 maxlength=38 name="Email" value="' . $_SESSION['Items'.$identifier]->Email . '"></td>
+	</tr>
+	<tr>
+		<td>'. _('Customer Reference') .':</td>
+		<td><input type="text" size=25 maxlength=25 name="CustRef" value="' . $_SESSION['Items'.$identifier]->CustRef . '"></td>
+	</tr>
+	<tr>
+		<td>'. _('Comments') .':</td>
+		<td><textarea name="Comments" cols="31" rows="5">' . $_SESSION['Items'.$identifier]->Comments .'</textarea></td>
 	</tr>';
 
-echo '<tr>
-	<td>'. _('Delivery Address 1') . ':</td>
-	<td><input type="text" size=42 maxlength=40 name="BrAdd1" value="' . $_SESSION['Items'.$identifier]->DelAdd1 . '"></td>
-</tr>';
-
-echo '<tr>
-	<td>'. _('Delivery Address 2') . ':</td>
-	<td><input type="text" size=42 maxlength=40 name="BrAdd2" value="' . $_SESSION['Items'.$identifier]->DelAdd2 . '"></td>
-</tr>';
-
-echo '<tr>
-	<td>'. _('Delivery Address 3') . ':</td>
-	<td><input type="text" size="42" maxlength="40" name="BrAdd3" value="' . $_SESSION['Items'.$identifier]->DelAdd3 . '"></td>
-</tr>';
-
-echo '<tr>
-	<td>'. _('Delivery Address 4') . ':</td>
-	<td><input type="text" size=42 maxlength=40 name="BrAdd4" value="' . $_SESSION['Items'.$identifier]->DelAdd4 . '"></td>
-</tr>';
-
-echo '<tr>
-	<td>'. _('Delivery Address 5') . ':</td>
-	<td><input type="text" size=42 maxlength=40 name="BrAdd5" value="' . $_SESSION['Items'.$identifier]->DelAdd5 . '"></td>
-</tr>';
-
-echo '<tr>
-	<td>'. _('Delivery Address 6') . ':</td>
-	<td><input type="text" size=42 maxlength=40 name="BrAdd6" value="' . $_SESSION['Items'.$identifier]->DelAdd6 . '"></td>
-</tr>';
-
-echo '<tr>
-	<td>'. _('Contact Phone Number') .':</td>
-	<td><input type="text" size=25 maxlength=25 name="PhoneNo" value="' . $_SESSION['Items'.$identifier]->PhoneNo . '"></td>
-</tr>';
-
-echo '<tr><td>' . _('Contact Email') . ':</td><td><input type="text" size=40 maxlength=38 name="Email" value="' . $_SESSION['Items'.$identifier]->Email . '"></td></tr>';
-
-echo '<tr><td>'. _('Customer Reference') .':</td>
-	<td><input type="text" size=25 maxlength=25 name="CustRef" value="' . $_SESSION['Items'.$identifier]->CustRef . '"></td>
-</tr>';
-
-echo '<tr>
-	<td>'. _('Comments') .':</td>
-	<td><textarea name="Comments" cols=31 rows=5>' . $_SESSION['Items'.$identifier]->Comments .'</textarea></td>
-</tr>';
-
 	/* This field will control whether or not to display the company logo and
 	address on the packlist */
 
@@ -1061,7 +1063,7 @@
 	}
 	echo '</select></td></tr>';
 
-if (isset($_SESSION['PrintedPackingSlip']) and $_SESSION['PrintedPackingSlip']==1){
+if (isset($_SESSION['PrintedPackingSlip']) AND $_SESSION['PrintedPackingSlip']==1){
 
 	echo '<tr>
 		<td>'. _('Reprint packing slip') .':</td>
@@ -1073,19 +1075,22 @@
 	echo '<input type=hidden name="ReprintPackingSlip" value=0>';
 }
 
-echo '<tr><td>'. _('Charge Freight Cost inc tax') .':</td>';
-echo '<td><input type="text" class="number" size=10 maxlength=12 name="FreightCost" value="' . $_SESSION['Items'.$identifier]->FreightCost . '"></td>';
+echo '<tr>
+		<td>'. _('Charge Freight Cost inc tax') .':</td>
+		<td><input type="text" class="number" size="10" maxlength="12" name="FreightCost" value="' . $_SESSION['Items'.$identifier]->FreightCost . '" /></td>';
 
 if ($_SESSION['DoFreightCalc']==true){
-	echo '<td><input type=submit name="Update" value="' . _('Recalc Freight Cost') . '"></td></tr>';
+	echo '<td><input type=submit name="Update" value="' . _('Recalc Freight Cost') . '" /></td>
+		</tr>';
 }
 
 if ((!isset($_POST['ShipVia']) OR $_POST['ShipVia']=='') AND isset($_SESSION['Items'.$identifier]->ShipVia)){
 	$_POST['ShipVia'] = $_SESSION['Items'.$identifier]->ShipVia;
 }
 
-echo '<tr><td>'. _('Freight/Shipper Method') .':</td>
-			<td><select name="ShipVia">';
+echo '<tr>
+		<td>'. _('Freight/Shipper Method') .':</td>
+		<td><select name="ShipVia">';
 
 $ErrMsg = _('The shipper details could not be retrieved');
 $DbgMsg = _('SQL used to retrieve the shipper details was') . ':';
@@ -1123,7 +1128,7 @@
 	echo '<br /><br /><input type=submit name="ProcessOrder" value="' . _('Place Order') . '">';
 	echo '<br /><br /><input type=submit name="MakeRecurringOrder" value="' . _('Create Recurring Order') . '">';
 } else {
-	echo '<br /><input type=submit name="ProcessOrder" value="' . _('Commit Order Changes') . '">';
+	echo '<br /><input type="submit" name="ProcessOrder" value="' . _('Commit Order Changes') . '">';
 }
 
 echo '</div></form>';
Modified: trunk/RecurringSalesOrders.php
===================================================================
--- trunk/RecurringSalesOrders.php	2011-12-13 07:50:19 UTC (rev 4771)
+++ trunk/RecurringSalesOrders.php	2011-12-13 08:55:38 UTC (rev 4772)
@@ -128,22 +128,22 @@
 
 				while ($myrow=db_fetch_array($LineItemsResult)) {
 					$_SESSION['Items'.$identifier]->add_to_cart($myrow['stkcode'],
-								$myrow['quantity'],
-								$myrow['description'],
-								$myrow['unitprice'],
-								$myrow['discountpercent'],
-								$myrow['units'],
-								$myrow['volume'],
-								$myrow['kgs'],
-								$myrow['qohatloc'],
-								$myrow['mbflag'],
-								'',
-								0,
-								$myrow['discountcategory'],
-								0,	/*Controlled*/
-								0,	/*Serialised */
-								$myrow['decimalplaces'],
-								$myrow['narrative']);
+																$myrow['quantity'],
+																$myrow['description'],
+																$myrow['unitprice'],
+																$myrow['discountpercent'],
+																$myrow['units'],
+																$myrow['volume'],
+																$myrow['kgs'],
+																$myrow['qohatloc'],
+																$myrow['mbflag'],
+																'',
+																0,
+																$myrow['discountcategory'],
+																0,	/*Controlled*/
+																0,	/*Serialised */
+																$myrow['decimalplaces'],
+																$myrow['narrative']);
 					/*Just populating with existing order - no DBUpdates */
 
 				} /* line items from sales order details */
Modified: trunk/SalesByTypePeriodInquiry.php
===================================================================
--- trunk/SalesByTypePeriodInquiry.php	2011-12-13 07:50:19 UTC (rev 4771)
+++ trunk/SalesByTypePeriodInquiry.php	2011-12-13 08:55:38 UTC (rev 4772)
@@ -5,8 +5,8 @@
 include('includes/session.inc');
 $title = _('Sales Report');
 include('includes/header.inc');
-include('includes/DefineCartClass.php');
 
+
 echo '<p class="page_title_text"><img src="'.$rootpath.'/css/'.$theme.'/images/transactions.png" title="' . _('Sales Report') . '" alt="" />' . ' ' . _('Sales Report') . '</p>';
 echo '<div class="page_help_text">' . _('Select the parameters for the report') . '</div><br />';
 
Modified: trunk/SalesCategoryPeriodInquiry.php
===================================================================
--- trunk/SalesCategoryPeriodInquiry.php	2011-12-13 07:50:19 UTC (rev 4771)
+++ trunk/SalesCategoryPeriodInquiry.php	2011-12-13 08:55:38 UTC (rev 4772)
@@ -5,7 +5,6 @@
 include('includes/session.inc');
 $title = _('Sales Category Report');
 include('includes/header.inc');
-include('includes/DefineCartClass.php');
 
 echo '<p class="page_title_text"><img src="'.$rootpath.'/css/'.$theme.'/images/transactions.png" title="' . _('Sales Report') . '" alt="" />' . ' ' . _('Sales Category Report') . '</p>';
 echo '<div class="page_help_text">' . _('Select the parameters for the report') . '</div><br />';
Modified: trunk/SalesTopItemsInquiry.php
===================================================================
--- trunk/SalesTopItemsInquiry.php	2011-12-13 07:50:19 UTC (rev 4771)
+++ trunk/SalesTopItemsInquiry.php	2011-12-13 08:55:38 UTC (rev 4772)
@@ -5,7 +5,6 @@
 include('includes/session.inc');
 $title = _('Top Sales Inquiry');
 include('includes/header.inc');
-include('includes/DefineCartClass.php');
 
 echo '<p class="page_title_text"><img src="'.$rootpath.'/css/'.$theme.'/images/transactions.png" title="' . _('Sales Inquiry') . '" alt="" />' . ' ' . _('Top Sales Items Inquiry') . '</p>';
 echo '<div class="page_help_text">' . _('Select the parameters for the report') . '</div><br />';
@@ -214,13 +213,13 @@
 	echo '<table cellpadding=2 class="selection">';
 	
 	echo'<tr>
-		<th>' . _('Rank') . '</th>
-		<th>' . _('Item') . '</th>
-		<th>' . _('Category') . '</th>
-		<th>' . _('Sales Value') . '</th>
-		<th>' . _('Refunds') . '</th>
-		<th>' . _('Net Sales') . '</th>
-		<th>' . _('Sales') .'<br />' . _('Quantity') . '</th>
+			<th>' . _('Rank') . '</th>
+			<th>' . _('Item') . '</th>
+			<th>' . _('Category') . '</th>
+			<th>' . _('Sales Value') . '</th>
+			<th>' . _('Refunds') . '</th>
+			<th>' . _('Net Sales') . '</th>
+			<th>' . _('Sales') .'<br />' . _('Quantity') . '</th>
 		</tr>';
 	
 	$CumulativeTotalSales = 0;
Modified: trunk/SelectOrderItems.php
===================================================================
--- trunk/SelectOrderItems.php	2011-12-13 07:50:19 UTC (rev 4771)
+++ trunk/SelectOrderItems.php	2011-12-13 08:55:38 UTC (rev 4772)
@@ -249,7 +249,8 @@
 																	$myrow['standardcost'],
 																	$myrow['eoq'],
 																	$myrow['nextserialno'],
-																	$ExRate );
+																	$ExRate,
+																	$identifier );
 
 				/*Just populating with existing order - no DBUpdates */
 					}
@@ -1046,7 +1047,7 @@
 			//page called attempting to delete a line - GET['Delete'] = the line number to delete
 			$QuantityAlreadyDelivered = $_SESSION['Items'.$identifier]->Some_Already_Delivered($_GET['Delete']);
 			if($QuantityAlreadyDelivered == 0){
-				$_SESSION['Items'.$identifier]->remove_from_cart($_GET['Delete'], 'Yes');  /*Do update DB */
+				$_SESSION['Items'.$identifier]->remove_from_cart($_GET['Delete'], 'Yes', $identifier);  /*Do update DB */
 			} else {
 				$_SESSION['Items'.$identifier]->LineItems[$_GET['Delete']]->Quantity = $QuantityAlreadyDelivered;
 			}
Modified: trunk/doc/Change.log
===================================================================
--- trunk/doc/Change.log	2011-12-13 07:50:19 UTC (rev 4771)
+++ trunk/doc/Change.log	2011-12-13 08:55:38 UTC (rev 4772)
@@ -2,6 +2,7 @@
 
 13/12/11 Vitaly Shevkunov: Z_ChangeStockCode.php fixed call to DB_error_no had missing ($db) - also turned off FOREIGN KEY CHECKS before updating the BOM.
 13/12/11 Exson: Fix SelectOrderItems.php and DeliveryDetails.php for where an order is modified while another order is being created in a different tab of the browser - $_SESSION['ExistingOrder'] now modified to $_SESSION['ExistingOrder' .$identifier] as suggested by Tim
+13/12/11 Phil: Fixed other scripts affected and send $identifier to add_to_cart function
 11/12/11 Phil: SupplierInvoice.php attempts to post back any cost variances where there is no stock left to apportion the variances to - posting back to stockmoves (so the DailySales.php and other sales inquiry scripts reflect the appropriate GP) and the salesanalysis tables
 11/12/11 Phil: DailySalesInquiry.php removed incorrect call to establish new cart object??
 10/12/11 Brian May: ConfirmDispatch_Invoice.php corrected SQL that was not calculating the difference to go to the orderdeliverydifferences log in parenthesis first before casting/concatenating to string for the SQL.
Modified: trunk/includes/DefineCartClass.php
===================================================================
--- trunk/includes/DefineCartClass.php	2011-12-13 07:50:19 UTC (rev 4771)
+++ trunk/includes/DefineCartClass.php	2011-12-13 08:55:38 UTC (rev 4772)
@@ -67,7 +67,7 @@
 		$this->total=0;
 		$this->ItemsOrdered=0;
 		$this->LineCounter=0;
-		$this->DefaultSalesType="";
+		$this->DefaultSalesType='';
 		$this->FreightCost =0;
 		$this->FreightTaxes = array();
 		$this->CurrDecimalPlaces=2; //default
@@ -99,7 +99,8 @@
 							$StandardCost=0,
 							$EOQ=1,
 							$NextSerialNo=0,
-							$ExRate=1){
+							$ExRate=1,
+							$identifier=0){
 
 		if (isset($StockID) AND $StockID!="" AND $Qty>0 AND isset($Qty)){
 
@@ -157,7 +158,7 @@
 														itemdue,
 														poline)
 													VALUES(" . $this->LineCounter . ",
-														" . $_SESSION['ExistingOrder'] . ",
+														" . $_SESSION['ExistingOrder' . $identifier] . ",
 														'" . trim(mb_strtoupper($StockID)) ."',
 														" . $Qty . ",
 														" . $Price . ",
@@ -209,7 +210,7 @@
 		}
 	}
 
-	function remove_from_cart($LineNumber, $UpdateDB='No'){
+	function remove_from_cart($LineNumber, $UpdateDB='No', $identifier=0){
 
 		if (!isset($LineNumber) OR $LineNumber=='' OR $LineNumber < 0){ /* over check it */
 			prnMsg(_('No Line Number passed to remove_from_cart, so nothing has been removed.'), 'error');
@@ -220,12 +221,12 @@
 			if ($this->Some_Already_Delivered($LineNumber)==0){
 				/* nothing has been delivered, delete it. */
 				$result = DB_query("DELETE FROM salesorderdetails
-									WHERE orderno='" . $_SESSION['ExistingOrder'] . "'
+									WHERE orderno='" . $_SESSION['ExistingOrder' . $identifier] . "'
 									AND orderlineno='" . $LineNumber . "'",
 									$db,
 									_('The order line could not be deleted because')
 									);
-				prnMsg( _('Deleted Line Number'). ' ' . $LineNumber . ' ' . _('from existing Order Number').' ' . $_SESSION['ExistingOrder'], 'success');
+				prnMsg( _('Deleted Line Number'). ' ' . $LineNumber . ' ' . _('from existing Order Number').' ' . $_SESSION['ExistingOrder' . $identifier], 'success');
 			} else {
 				/* something has been delivered. Clear the remaining Qty and Mark Completed */
 				$result = DB_query("UPDATE salesorderdetails SET quantity=qtyinvoiced, 
Modified: trunk/includes/SelectOrderItems_IntoCart.inc
===================================================================
--- trunk/includes/SelectOrderItems_IntoCart.inc	2011-12-13 07:50:19 UTC (rev 4771)
+++ trunk/includes/SelectOrderItems_IntoCart.inc	2011-12-13 08:55:38 UTC (rev 4772)
@@ -76,9 +76,9 @@
 		/*these checks above ensure that the item has a cost if the
 		config.php variable AllowSalesOfZeroCostItems is set to false */
 
-		   	if ($_SESSION['ExistingOrder']!=0){
+		   	if ($_SESSION['ExistingOrder' . $identifier]!=0){
 				$UpdateDB = 'Yes';
-				$result = DB_query("SELECT MAX(orderlineno) AS newlineno FROM  salesorderdetails WHERE orderno='" . $_SESSION['ExistingOrder'] . "'",$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) {
 					$NewLineNo = $MaxNumRow[0]+1;
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
 |