|
From: <dai...@us...> - 2013-02-07 07:54:43
|
Revision: 5816
http://sourceforge.net/p/web-erp/reponame/5816
Author: daintree
Date: 2013-02-07 07:54:41 +0000 (Thu, 07 Feb 2013)
Log Message:
-----------
add standard bin location
Modified Paths:
--------------
trunk/PrintCustOrder_generic.php
trunk/StockStatus.php
trunk/includes/PDFOrderPageHeader_generic.inc
trunk/sql/mysql/upgrade4.09-4.10.sql
Modified: trunk/PrintCustOrder_generic.php
===================================================================
--- trunk/PrintCustOrder_generic.php 2013-02-07 07:04:35 UTC (rev 5815)
+++ trunk/PrintCustOrder_generic.php 2013-02-07 07:54:41 UTC (rev 5816)
@@ -59,15 +59,15 @@
shippers.shippername,
salesorders.printedpackingslip,
salesorders.datepackingslipprinted,
- locations.locationname
- FROM salesorders,
- debtorsmaster,
- shippers,
- locations
- WHERE salesorders.debtorno=debtorsmaster.debtorno
- AND salesorders.shipvia=shippers.shipper_id
- AND salesorders.fromstkloc=locations.loccode
- AND salesorders.orderno='" . $_GET['TransNo'] . "'";
+ locations.locationname,
+ salesorders.fromstkloc
+ FROM salesorders INNER JOIN debtorsmaster
+ ON salesorders.debtorno=debtorsmaster.debtorno
+ INNER JOIN shippers
+ ON salesorders.shipvia=shippers.shipper_id
+ INNER JOIN locations
+ ON salesorders.fromstkloc=locations.loccode
+ WHERE salesorders.orderno='" . $_GET['TransNo'] . "'";
$result=DB_query($sql,$db, $ErrMsg);
@@ -155,8 +155,7 @@
$pdf->newPage();
}
/* Now ... Has the order got any line items still outstanding to be invoiced */
- $ErrMsg = _('There was a problem retrieving the order details for Order Number') . ' ' .
- $_GET['TransNo'] . ' ' . _('from the database');
+ $ErrMsg = _('There was a problem retrieving the order details for Order Number') . ' ' . $_GET['TransNo'] . ' ' . _('from the database');
$sql = "SELECT salesorderdetails.stkcode,
stockmaster.description,
@@ -165,10 +164,14 @@
salesorderdetails.unitprice,
salesorderdetails.narrative,
stockmaster.mbflag,
- stockmaster.decimalplaces
+ stockmaster.decimalplaces,
+ locstock.bin
FROM salesorderdetails INNER JOIN stockmaster
- ON salesorderdetails.stkcode=stockmaster.stockid
- WHERE salesorderdetails.orderno='" . $_GET['TransNo'] . "'";
+ ON salesorderdetails.stkcode=stockmaster.stockid
+ INNER JOIN locstock
+ ON stockmaster.stockid = locstock.stockid
+ WHERE locstock.loccode = '" . $myrow['fromstkloc'] . "'
+ AND salesorderdetails.orderno='" . $_GET['TransNo'] . "'";
$result=DB_query($sql,$db, $ErrMsg);
if (DB_num_rows($result)>0){
@@ -186,8 +189,9 @@
$LeftOvers = $pdf->addTextWrap($XPos,$YPos,127,$FontSize,$myrow2['stkcode']);
$LeftOvers = $pdf->addTextWrap(147,$YPos,255,$FontSize,$myrow2['description']);
$LeftOvers = $pdf->addTextWrap(400,$YPos,85,$FontSize,$DisplayQty,'right');
- $LeftOvers = $pdf->addTextWrap(503,$YPos,85,$FontSize,$DisplayQtySupplied,'right');
- $LeftOvers = $pdf->addTextWrap(602,$YPos,85,$FontSize,$DisplayPrevDel,'right');
+ $LeftOvers = $pdf->addTextWrap(487,$YPos,70,$FontSize,$myrow2['bin'],'left');
+ $LeftOvers = $pdf->addTextWrap(573,$YPos,85,$FontSize,$DisplayQtySupplied,'right');
+ $LeftOvers = $pdf->addTextWrap(672,$YPos,85,$FontSize,$DisplayPrevDel,'right');
if ($YPos-$line_height <= 50){
/* We reached the end of the page so finsih off the page and start a newy */
Modified: trunk/StockStatus.php
===================================================================
--- trunk/StockStatus.php 2013-02-07 07:04:35 UTC (rev 5815)
+++ trunk/StockStatus.php 2013-02-07 07:54:41 UTC (rev 5816)
@@ -16,9 +16,14 @@
$StockID = '';
}
-// This is already linked from this page
-//echo "<a href='" . $RootPath . '/SelectProduct.php?' . SID . "'>" . _('Back to Items') . '</a><br />';
-
+if (isset($_POST['UpdateBinLocations'])){
+ foreach ($_POST as $PostVariableName => $Bin) {
+ if (mb_substr($PostVariableName,0,11) == 'BinLocation') {
+ $sql = "UPDATE locstock SET bin='" . $Bin . "' WHERE loccode='" . mb_substr($PostVariableName,11) . "' AND stockid='" . $StockID . "'";
+ $result = DB_query($sql, $db);
+ }
+ }
+}
$result = DB_query("SELECT description,
units,
mbflag,
@@ -62,6 +67,7 @@
locations.locationname,
locstock.quantity,
locstock.reorderlevel,
+ locstock.bin,
locations.managed
FROM locstock INNER JOIN locations
ON locstock.loccode=locations.loccode
@@ -76,13 +82,14 @@
<table class="selection">';
if ($Its_A_KitSet_Assembly_Or_Dummy == True){
- $tableheader = '<tr>
+ $TableHeader = '<tr>
<th>' . _('Location') . '</th>
<th>' . _('Demand') . '</th>
</tr>';
} else {
- $tableheader = '<tr>
+ $TableHeader = '<tr>
<th>' . _('Location') . '</th>
+ <th>' . _('Bin Location') . '</th>
<th>' . _('Quantity On Hand') . '</th>
<th>' . _('Re-Order Level') . '</th>
<th>' . _('Demand') . '</th>
@@ -91,7 +98,7 @@
<th>' . _('On Order') . '</th>
</tr>';
}
-echo $tableheader;
+echo $TableHeader;
$j = 1;
$k=0; //row colour counter
@@ -234,7 +241,8 @@
$Available = $myrow['quantity'] - $DemandQty;
}
- echo '<td>' . $myrow['locationname'] . '</td>';
+ echo '<td>' . $myrow['locationname'] . '</td>
+ <td><input type="text" name="BinLocation' . $myrow['loccode'] . '" value="' . $myrow['bin'] . '" maxlength="10" size="11" onchange="ReloadForm(UpdateBinLocations)"/></td>';
printf('<td class="number">%s</td>
<td class="number">%s</td>
@@ -269,7 +277,11 @@
//end of page full new headings if
}
//end of while loop
-echo '</table>';
+echo '<tr>
+ <td></td>
+ <td><input type="submit" name="UpdateBinLocations" value="' . _('Update Bins') . '" /></td>
+ </tr>
+ </table>';
if (isset($_GET['DebtorNo'])){
$DebtorNo = trim(mb_strtoupper($_GET['DebtorNo']));
@@ -334,11 +346,11 @@
}
if (isset($PriceHistory)) {
echo '<br />
- <table class="selection">';
- echo '<tr>
+ <table class="selection">
+ <tr>
<th colspan="4"><font color="navy" size="2">' . _('Pricing history for sales of') . ' ' . $StockID . ' ' . _('to') . ' ' . $DebtorNo . '</font></th>
</tr>';
- $tableheader = '<tr>
+ $TableHeader = '<tr>
<th>' . _('Date Range') . '</th>
<th>' . _('Quantity') . '</th>
<th>' . _('Price') . '</th>
@@ -352,7 +364,7 @@
$j--;
if ($j < 0 ){
$j = 11;
- echo $tableheader;
+ echo $TableHeader;
}
if ($k==1){
@@ -381,10 +393,10 @@
}
}//end of displaying price history for a debtor
-echo '<br /><a href="' . $RootPath . '/StockMovements.php?StockID=' . $StockID . '">' . _('Show Movements') . '</a>';
-echo '<br /><a href="' . $RootPath . '/StockUsage.php?StockID=' . $StockID . '">' . _('Show Usage') . '</a>';
-echo '<br /><a href="' . $RootPath . '/SelectSalesOrder.php?SelectedStockItem=' . $StockID . '">' . _('Search Outstanding Sales Orders') . '</a>';
-echo '<br /><a href="' . $RootPath . '/SelectCompletedOrder.php?SelectedStockItem=' . $StockID . '">' . _('Search Completed Sales Orders') . '</a>';
+echo '<br /><a href="' . $RootPath . '/StockMovements.php?StockID=' . $StockID . '">' . _('Show Movements') . '</a>
+ <br /><a href="' . $RootPath . '/StockUsage.php?StockID=' . $StockID . '">' . _('Show Usage') . '</a>
+ <br /><a href="' . $RootPath . '/SelectSalesOrder.php?SelectedStockItem=' . $StockID . '">' . _('Search Outstanding Sales Orders') . '</a>
+ <br /><a href="' . $RootPath . '/SelectCompletedOrder.php?SelectedStockItem=' . $StockID . '">' . _('Search Completed Sales Orders') . '</a>';
if ($Its_A_KitSet_Assembly_Or_Dummy ==False){
echo '<br /><a href="' . $RootPath . '/PO_SelectOSPurchOrder.php?SelectedStockItem=' . $StockID . '">' . _('Search Outstanding Purchase Orders') . '</a>';
}
Modified: trunk/includes/PDFOrderPageHeader_generic.inc
===================================================================
--- trunk/includes/PDFOrderPageHeader_generic.inc 2013-02-07 07:04:35 UTC (rev 5815)
+++ trunk/includes/PDFOrderPageHeader_generic.inc 2013-02-07 07:54:41 UTC (rev 5816)
@@ -91,8 +91,9 @@
$LeftOvers = $pdf->addTextWrap($XPos,$YPos,127,$FontSize, _('Item Code'),'left');
$LeftOvers = $pdf->addTextWrap(147,$YPos,255,$FontSize, _('Item Description'),'left');
$LeftOvers = $pdf->addTextWrap(400,$YPos,85,$FontSize, _('Quantity'),'right');
-$LeftOvers = $pdf->addTextWrap(503,$YPos,85,$FontSize,_('This Del'),'right');
-$LeftOvers = $pdf->addTextWrap(602,$YPos,85,$FontSize, _('Prev Dels'),'right');
+$LeftOvers = $pdf->addTextWrap(487,$YPos,70,$FontSize, _('Bin Locn'),'center');
+$LeftOvers = $pdf->addTextWrap(573,$YPos,85,$FontSize,_('This Del'),'center');
+$LeftOvers = $pdf->addTextWrap(672,$YPos,85,$FontSize, _('Prev Dels'),'center');
$YPos -= $line_height;
Modified: trunk/sql/mysql/upgrade4.09-4.10.sql
===================================================================
--- trunk/sql/mysql/upgrade4.09-4.10.sql 2013-02-07 07:04:35 UTC (rev 5815)
+++ trunk/sql/mysql/upgrade4.09-4.10.sql 2013-02-07 07:54:41 UTC (rev 5816)
@@ -55,5 +55,6 @@
INSERT INTO scripts VALUES ('MaterialsNotUsed.php', '4', 'Lists the items from Raw Material Categories not used in any BOM (thus, not used at all)');
INSERT INTO scripts VALUES ('SellThroughSupport.php', '9', 'Defines the items, period and quantum of support for which supplier has agreed to provide.');
INSERT INTO scripts VALUES ('PDFSellThroughSupportClaim.php', '9', 'Reports the sell through support claims to be made against all suppliers for a given date range.');
+ALTER TABLE `locstock` ADD `bin` VARCHAR( 10 ) NOT NULL , ADD INDEX ( `bin` );
UPDATE config SET confvalue='4.10.0' WHERE confname='VersionNumber';
|