|
From: <dai...@us...> - 2011-12-13 07:29:02
|
Revision: 4769
http://web-erp.svn.sourceforge.net/web-erp/?rev=4769&view=rev
Author: daintree
Date: 2011-12-13 07:28:55 +0000 (Tue, 13 Dec 2011)
Log Message:
-----------
fix Exsons commit that was working on an older version of SelectOrderItems.php
Modified Paths:
--------------
trunk/DeliveryDetails.php
trunk/SelectOrderItems.php
trunk/StockLocTransfer.php
Property Changed:
----------------
trunk/
Property changes on: trunk
___________________________________________________________________
Modified: svn:mergeinfo
- /branches/utf-8:3087
/branches/utf-8_xfer:3160-3162
+ /branches/utf-8:3087
/branches/utf-8_xfer:3160-3162
Modified: trunk/DeliveryDetails.php
===================================================================
--- trunk/DeliveryDetails.php 2011-12-13 01:34:17 UTC (rev 4768)
+++ trunk/DeliveryDetails.php 2011-12-13 07:28:55 UTC (rev 4769)
@@ -311,7 +311,7 @@
} #end if else freight charge not altered
} #end if process order
-if (isset($OK_to_PROCESS) and $OK_to_PROCESS == 1 && $_SESSION['ExistingOrder'.$identifier]==0){
+if (isset($OK_to_PROCESS) AND $OK_to_PROCESS == 1 && $_SESSION['ExistingOrder'.$identifier]==0){
/* finally write the order header to the database and then the order line details */
Modified: trunk/SelectOrderItems.php
===================================================================
--- trunk/SelectOrderItems.php 2011-12-13 01:34:17 UTC (rev 4768)
+++ trunk/SelectOrderItems.php 2011-12-13 07:28:55 UTC (rev 4769)
@@ -50,7 +50,7 @@
unset ($_SESSION['Items'.$identifier]);
}
- $_SESSION['ExistingOrder'.$identifier]=0;
+ $_SESSION['ExistingOrder' .$identifier]=0;
$_SESSION['Items'.$identifier] = new cart;
if (count($_SESSION['AllowedPageSecurityTokens'])==1){ //its a customer logon
@@ -651,11 +651,11 @@
if (isset($_POST['CancelOrder'])) {
$OK_to_delete=1; //assume this in the first instance
- if($_SESSION['ExistingOrder'.$identifier]!=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'.$identifier] . "'
+ 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'.$identifier]!=0){
+ if($_SESSION['ExistingOrder' . $identifier]!=0){
- $SQL = "DELETE FROM salesorderdetails WHERE salesorderdetails.orderno ='" . $_SESSION['ExistingOrder'.$identifier] . "'";
+ $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'.$identifier] . "'";
+ $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'.$identifier]=0;
+ $_SESSION['ExistingOrder' . $identifier]=0;
}
unset($_SESSION['Items'.$identifier]->LineItems);
Modified: trunk/StockLocTransfer.php
===================================================================
--- trunk/StockLocTransfer.php 2011-12-13 01:34:17 UTC (rev 4768)
+++ trunk/StockLocTransfer.php 2011-12-13 07:28:55 UTC (rev 4769)
@@ -88,7 +88,18 @@
} //end if there is a CSV file to import
else { // process the manually input lines
$ErrorMessage='';
+ if (isset($_POST['ClearAll'])){
+ unset($_POST['EnterMoreItems']);
+ for ($i=$_POST['LinesCounter']-10;$i<$_POST['LinesCounter'];$i++){
+ unset($_POST['StockID' . $i]);
+ unset($_POST['StockQTY' . $i]);
+ }
+ }
for ($i=$_POST['LinesCounter']-10;$i<$_POST['LinesCounter'];$i++){
+ if (isset($_POST['Delete' . $i])){
+ unset($_POST['StockID' . $i]);
+ unset($_POST['StockQTY' . $i]);
+ }
if (isset($_POST['StockID' . $i]) AND $_POST['StockID' . $i]!=''){
$_POST['StockID' . $i]=trim(mb_strtoupper($_POST['StockID' . $i]));
$result = DB_query("SELECT COUNT(stockid) FROM stockmaster WHERE stockid='" . $_POST['StockID' . $i] . "'",$db);
@@ -257,25 +268,36 @@
echo '<table class="selection">';
- $tableheader = '<tr><th>'. _('Item Code'). '</th>
- <th>'. _('Quantity'). '</th></tr>';
- echo $tableheader;
+ $TableHeader = '<tr>
+ <th>'. _('Item Code'). '</th>
+ <th>'. _('Quantity'). '</th>
+ <th>' . _('Clear All') . ':<input type="checkbox" name="ClearAll" /></th>
+ </tr>';
+ echo $TableHeader;
- $k=0; /* row counter */
+ $k=0; /* page heading row counter */
+ $j=0; /* row counter for reindexing */
if(isset($_POST['LinesCounter'])){
- for ($i=0;$i < $_POST['LinesCounter'] AND $_POST['StockID' . $i] !='';$i++){
-
+ for ($i=0;$i < $_POST['LinesCounter'];$i++){
+ if (!isset($_POST['StockID'. $i])){
+ continue;
+ }
+ if ($_POST['StockID' . $i] ==''){
+ break;
+ }
if ($k==18){
- echo $tableheader;
+ echo $TableHeader;
$k=0;
}
$k++;
echo '<tr>
- <td><input type="text" name="StockID' . $i .'" size="21" maxlength="20" value="' . $_POST['StockID' . $i] . '" /></td>
- <td><input type="text" name="StockQTY' . $i .'" size="10" maxlength="10" class="number" value="' . locale_number_format($_POST['StockQTY' . $i],'Variable') . '" /></td>
+ <td><input type="text" name="StockID' . $j .'" size="21" maxlength="20" value="' . $_POST['StockID' . $i] . '" /></td>
+ <td><input type="text" name="StockQTY' . $j .'" size="10" maxlength="10" class="number" value="' . locale_number_format($_POST['StockQTY' . $i],'Variable') . '" /></td>
+ <td>' . _('Delete') . '<input type="checkbox" name="Delete' . $j .'" /></td>
</tr>';
+ $j++;
}
}else {
$i = 0;
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|