[Weberp-svn] SF.net SVN: weberp:[5158] trunk
Brought to you by:
sotandeka,
tim_schofield
From: <tim...@us...> - 2011-04-09 19:41:40
|
Revision: 5158 http://weberp.svn.sourceforge.net/weberp/?rev=5158&view=rev Author: tim_schofield Date: 2011-04-09 19:41:34 +0000 (Sat, 09 Apr 2011) Log Message: ----------- Correctly deal with batches and serial numbers on stock transfers Modified Paths: -------------- trunk/StockTransfers.php trunk/includes/OutputSerialItems.php Modified: trunk/StockTransfers.php =================================================================== --- trunk/StockTransfers.php 2011-04-09 17:56:41 UTC (rev 5157) +++ trunk/StockTransfers.php 2011-04-09 19:41:34 UTC (rev 5158) @@ -225,7 +225,8 @@ if ($SerialItemExistsRow[0]==1){ $SQL = "UPDATE stockserialitems - SET quantity= quantity - '" . $Item->BundleQty . "' + SET quantity= quantity - '" . $Item->BundleQty . "', + expirationdate='" . FormatDateForSQL($Item->ExpiryDate) . "' WHERE stockid='" . $_SESSION['Transfer']->TransferItem[0]->StockID . "' AND loccode='" . $_SESSION['Transfer']->StockLocationFrom . "' AND serialno='" . $Item->BundleRef . "'"; @@ -238,10 +239,12 @@ $SQL = "INSERT INTO stockserialitems (stockid, loccode, serialno, + expirationdate, quantity) VALUES ('" . $_SESSION['Transfer']->TransferItem[0]->StockID . "', '" . $_SESSION['Transfer']->StockLocationFrom . "', '" . $Item->BundleRef . "', + '" . FormatDateForSQL($Item->ExpiryDate) . "', '" . -$Item->BundleQty . "')"; $ErrMsg = _('CRITICAL ERROR') . '! ' . _('NOTE DOWN THIS ERROR AND SEEK ASSISTANCE') . ': ' . _('The serial stock item record could not be added because'); @@ -337,7 +340,8 @@ if ($SerialItemExistsRow[0]==1){ $SQL = "UPDATE stockserialitems - SET quantity= quantity + '" . $Item->BundleQty . "' + SET quantity= quantity + '" . $Item->BundleQty . "', + expirationdate='" . FormatDateForSQL($Item->ExpiryDate) . "' WHERE stockid='" . $_SESSION['Transfer']->TransferItem[0]->StockID . "' AND loccode='" . $_SESSION['Transfer']->StockLocationTo . "' AND serialno='" . $Item->BundleRef . "'"; @@ -350,10 +354,12 @@ $SQL = "INSERT INTO stockserialitems (stockid, loccode, serialno, + expirationdate, quantity) VALUES ('" . $_SESSION['Transfer']->TransferItem[0]->StockID . "', '" . $_SESSION['Transfer']->StockLocationTo . "', '" . $Item->BundleRef . "', + '" . FormatDateForSQL($Item->ExpiryDate) . "', '" . $Item->BundleQty . "')"; $ErrMsg = _('CRITICAL ERROR') . '! ' . _('NOTE DOWN THIS ERROR AND SEEK ASSISTANCE') . ': ' . _('The serial stock item record could not be added because'); Modified: trunk/includes/OutputSerialItems.php =================================================================== --- trunk/includes/OutputSerialItems.php 2011-04-09 17:56:41 UTC (rev 5157) +++ trunk/includes/OutputSerialItems.php 2011-04-09 19:41:34 UTC (rev 5158) @@ -94,9 +94,8 @@ echo '<td class=number>' . number_format($Bundle->BundleQty, $LineItem->DecimalPlaces) . '</td>'; echo '<td class=number>' . $Bundle->ExpiryDate . '</td>'; } - echo '<td><a href="' . $_SERVER['PHP_SELF'] . '?' . SID . 'Delete=' . $Bundle->BundleRef . '&StockID=' . $LineItem->StockID . '&LineNo=' . $LineNo .'">'. _('Delete'). '</a></td></tr>'; - + $LineItem->SerialItems[]=$Bundle; $TotalQuantity += $Bundle->BundleQty; } This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |