|
From: <vv...@us...> - 2012-04-01 17:56:47
|
Revision: 5193
http://web-erp.svn.sourceforge.net/web-erp/?rev=5193&view=rev
Author: vvs2012
Date: 2012-04-01 17:56:40 +0000 (Sun, 01 Apr 2012)
Log Message:
-----------
xhtml
Modified Paths:
--------------
trunk/CopyBOM.php
trunk/InternalStockRequest.php
trunk/InternalStockRequestAuthorisation.php
trunk/InternalStockRequestFulfill.php
trunk/InventoryPlanning.php
trunk/InventoryPlanningPrefSupplier.php
trunk/InventoryQuantities.php
trunk/InventoryValuation.php
trunk/includes/header.inc
Modified: trunk/CopyBOM.php
===================================================================
--- trunk/CopyBOM.php 2012-04-01 16:54:04 UTC (rev 5192)
+++ trunk/CopyBOM.php 2012-04-01 17:56:40 UTC (rev 5193)
@@ -6,10 +6,10 @@
*/
/* $Id$*/
+include('includes/session.inc');
+
$title = _('Copy a BOM to New Item Code');
-include('includes/session.inc');
-
include('includes/header.inc');
include('includes/SQL_CommonFunctions.inc');
@@ -149,6 +149,7 @@
echo '<p class="page_title_text"><img src="'.$rootpath.'/css/'.$theme.'/images/inventory.png" title="' . _('Contract') . '" alt="" />' . ' ' . $title . '</p>';
echo '<form method="post" action="' . htmlspecialchars($_SERVER['PHP_SELF'], ENT_QUOTES, 'UTF-8') . '">';
+ echo '<div>';
echo '<input type="hidden" name="FormID" value="' . $_SESSION['FormID'] . '" />';
$sql = "SELECT stockid,
@@ -168,8 +169,8 @@
echo '</select></td>
</tr>';
echo '<tr>
- <td><input type="radio" name="type" value="N" checked="" />' . _(' To New Stock ID') . '</td></td><td>';
- echo '<input type="text" maxlength="20" name="tostkid" /></td></tr>';
+ <td><input type="radio" name="type" value="N" />' . _(' To New Stock ID') . '</td>';
+ echo '<td><input type="text" maxlength="20" name="tostkid" /></td></tr>';
$sql = "SELECT stockid,
description
@@ -185,10 +186,12 @@
while($row = DB_fetch_row($result)) {
echo '<option value="'.$row[0].'">'.$row[0].' -- '.$row[1].'</option>';
}
- echo '</select>';
+ echo '</select></td></tr>';
}
echo '</table>';
- echo '<br /><div class="centre"><input type="submit" name="Submit" value="Submit" /></div></form>';
+ echo '<br /><div class="centre"><input type="submit" name="Submit" value="Submit" /></div>
+ </div>
+ </form>';
include('includes/footer.inc');
}
Modified: trunk/InternalStockRequest.php
===================================================================
--- trunk/InternalStockRequest.php 2012-04-01 16:54:04 UTC (rev 5192)
+++ trunk/InternalStockRequest.php 2012-04-01 17:56:40 UTC (rev 5193)
@@ -118,10 +118,11 @@
if (isset($_GET['Edit'])) {
echo '<form action="' . htmlspecialchars($_SERVER['PHP_SELF'], ENT_QUOTES, 'UTF-8') . '" method="post">';
+ echo '<div>';
echo '<input type="hidden" name="FormID" value="' . $_SESSION['FormID'] . '" />';
echo '<table class="selection">';
echo '<tr>
- <th colspan="2"><font size="2" color="navy">' . _('Edit the Request Line') . '</font></th>
+ <th colspan="2"><h4>' . _('Edit the Request Line') . '</h4></th>
</tr>';
echo '<tr>
<td>' . _('Line number') . '</td>
@@ -149,17 +150,19 @@
echo '<div class="centre">
<input type="submit" name="Edit" value="' . _('Update Line') . '" />
</div>
+ </div>
</form>';
include('includes/footer.inc');
exit;
}
echo '<form action="'. htmlspecialchars($_SERVER['PHP_SELF'], ENT_QUOTES, 'UTF-8') . '" method="post">';
+echo '<div>';
echo '<input type="hidden" name="FormID" value="' . $_SESSION['FormID'] . '" />';
echo '<table class="selection">';
echo '<tr>
- <th colspan="2"><font color="navy" size="2">' . _('Internal Stock Request Details') . '</font></th>
+ <th colspan="2"><h4>' . _('Internal Stock Request Details') . '</h4></th>
</tr>
<tr>
<td>' . _('Department') . ':</td>';
@@ -202,11 +205,12 @@
</tr>
<tr>
<td>' . _('Date when required') . ':</td>';
-echo '<td><input type="text" class="date" alt="'.$_SESSION['DefaultDateFormat'].'" name="DispatchDate" maxlength="10" size="11" value="' . $_SESSION['Request']->DispatchDate . '" /></td>';
+echo '<td><input type="text" class="date" alt="'.$_SESSION['DefaultDateFormat'].'" name="DispatchDate" maxlength="10" size="11" value="' . $_SESSION['Request']->DispatchDate . '" /></td>
+ </tr>';
echo '<tr>
<td>' . _('Narrative') . ':</td>
- <td><textarea name="Narrative" cols="30">'.$_SESSION['Request']->Narrative.'</textarea></td>
+ <td><textarea name="Narrative" cols="30" rows="5">'.$_SESSION['Request']->Narrative.'</textarea></td>
</tr>
</table>
<br />';
@@ -214,6 +218,7 @@
echo '<div class="centre">
<input type="submit" name="Update" value="' . _('Update') . '" />
</div>
+ </div>
</form>';
if (!isset($_SESSION['Request']->Location)) {
@@ -224,11 +229,12 @@
//****************MUESTRO LA TABLA CON LOS REGISTROS DE LA TRANSFERENCIA*************************************
$i = 0; //Line Item Array pointer
echo '<form action="' . htmlspecialchars($_SERVER['PHP_SELF'], ENT_QUOTES, 'UTF-8') . '" method="post">';
+echo '<div>';
echo '<input type="hidden" name="FormID" value="' . $_SESSION['FormID'] . '" />';
echo '<br />
<table class="selection">
<tr>
- <th colspan="7"><font size="2" color="navy">' . _('Details of Items Requested') . '</font></th>
+ <th colspan="7"><h4>' . _('Details of Items Requested') . '</h4></th>
</tr>
<tr>
<th>'. _('Line Number') . '</th>
@@ -264,9 +270,12 @@
<div class="centre">
<input type="submit" name="Submit" value="' . _('Submit') . '" />
</div>
- <br />';
+ <br />
+ </div>
+ </form>';
echo '<form action="' . htmlspecialchars($_SERVER['PHP_SELF'], ENT_QUOTES, 'UTF-8') . '" method="post">';
+echo '<div>';
echo '<input type="hidden" name="FormID" value="' . $_SESSION['FormID'] . '" />';
echo '<p class="page_title_text"><img src="' . $rootpath . '/css/' . $theme . '/images/magnifier.png" title="' . _('Search') . '" alt="" />' . ' ' . _('Search for Inventory Items'). '</p>';
@@ -276,7 +285,7 @@
ORDER BY categorydescription";
$result1 = DB_query($SQL, $db);
if (DB_num_rows($result1) == 0) {
- echo '<p><font size="4" color="red">' . _('Problem Report') . ':</font><br />' . _('There are no stock categories currently defined please use the link below to set them up').'</p>';
+ echo '<p class="bad">' . _('Problem Report') . ':<br />' . _('There are no stock categories currently defined please use the link below to set them up').'</p>';
echo '<br />
<a href="' . $rootpath . '/StockCategories.php">' . _('Define Stock Categories') . '</a>';
exit;
@@ -310,7 +319,7 @@
echo '</tr>
<tr>
<td></td>
- <td><font size="3"><b>' . _('OR') . ' ' . '</b></font>' . _('Enter partial') . ' <b>' . _('Stock Code') . '</b>:</td>';
+ <td><h3>' . _('OR') . ' ' . '</h3>' . _('Enter partial') . ' <b>' . _('Stock Code') . '</b>:</td>';
if (isset($_POST['StockCode'])) {
echo '<td><input type="text" name="StockCode" value="' . $_POST['StockCode'] . '" size="15" maxlength="18" /></td>';
@@ -325,6 +334,7 @@
</div>
<br />';
echo '<script type="text/javascript">defaultControl(document.forms[0].StockCode);</script>';
+echo '</div>';
echo '</form>';
if (isset($_POST['Search']) or isset($_POST['Next']) or isset($_POST['Prev'])){
@@ -459,6 +469,7 @@
/* display list if there is more than one record */
if (isset($searchresult) AND !isset($_POST['Select'])) {
echo '<form action="' . htmlspecialchars($_SERVER['PHP_SELF'], ENT_QUOTES, 'UTF-8') . '" method="post">';
+ echo '<div>';
echo '<input type="hidden" name="FormID" value="' . $_SESSION['FormID'] . '" />';
$ListCount = DB_num_rows($searchresult);
if ($ListCount > 0) {
@@ -527,7 +538,7 @@
$qoh = locale_number_format($myrow['qoh'], $myrow['decimalplaces']);
}
if ($myrow['discontinued']==1){
- $ItemStatus = '<font class="bad">' . _('Obsolete') . '</font>';
+ $ItemStatus = '<p class="bad">' . _('Obsolete') . '</p>';
} else {
$ItemStatus ='';
}
@@ -542,7 +553,10 @@
//end of page full new headings if
}
//end of while loop
- echo '</table></form><br />';
+ echo '</table>
+ </div>
+ </form>
+ <br />';
}
}
/* end display list if there is more than one record */
@@ -552,7 +566,8 @@
echo '<div class="page_help_text">' . _('Select an item by entering the quantity required. Click Order when ready.') . '</div>';
echo '<br />';
$j = 1;
- echo '<form action="' . htmlspecialchars($_SERVER['PHP_SELF'], ENT_QUOTES, 'UTF-8') . '" method="post" name="orderform">';
+ echo '<form action="' . htmlspecialchars($_SERVER['PHP_SELF'], ENT_QUOTES, 'UTF-8') . '" method="post" id="orderform">';
+ echo '<div>';
echo '<input type="hidden" name="FormID" value="' . $_SESSION['FormID'] . '" />';
echo '<table class="table1">';
echo '<tr><td>
@@ -659,14 +674,14 @@
}
$OnOrder = $PurchQty + $WoQty;
$Available = $QOH - $DemandQty + $OnOrder;
- echo '<td>'.$myrow['stockid'].'</font></td>
+ echo '<td>'.$myrow['stockid'].'</td>
<td>'.$myrow['description'].'</td>
<td>'.$myrow['stockunits'].'</td>
<td class="number">'.locale_number_format($QOH,$DecimalPlaces).'</td>
<td class="number">'.locale_number_format($DemandQty,$DecimalPlaces).'</td>
<td class="number">'.locale_number_format($OnOrder, $DecimalPlaces).'</td>
<td class="number">'.locale_number_format($Available,$DecimalPlaces).'</td>
- <td><font size="1"><input class="number" tabindex="'.($j+7).'" type="text" size="6" name="Quantity'.$i.'" value="0" />
+ <td><input class="number" tabindex="'.($j+7).'" type="text" size="6" name="Quantity'.$i.'" value="0" />
<input type="hidden" name="StockID'.$i.'" value="'.$myrow['stockid'].'" />
</td>
</tr>';
@@ -686,7 +701,9 @@
<input tabindex="'.($j+8).'" type="submit" value="'._('Add to Requisition').'" /></td>';
echo '<td><input type="hidden" name="NextList" value="'.($Offset+1).'" />
<input tabindex="'.($j+9).'" type="submit" name="Next" value="'._('Next').'" /></td><tr/>';
- echo '</table></form>';
+ echo '</table>
+ </div>
+ </form>';
echo $jsCall;
}#end if SearchResults to show
Modified: trunk/InternalStockRequestAuthorisation.php
===================================================================
--- trunk/InternalStockRequestAuthorisation.php 2012-04-01 16:54:04 UTC (rev 5192)
+++ trunk/InternalStockRequestAuthorisation.php 2012-04-01 17:56:40 UTC (rev 5193)
@@ -1,106 +1,109 @@
-<?php
-
-/* $Id: InternalStockRequestAuthorisation.php 4576 2011-05-27 10:59:20Z daintree $*/
-
-include('includes/session.inc');
-
-$title = _('Authorise Internal Stock Requests');
-
-include('includes/header.inc');
-
-echo '<p class="page_title_text"><img src="'.$rootpath.'/css/'.$theme.'/images/transactions.png" title="' . $title . '" alt="" />' . ' ' . $title . '</p>';
-
-if (isset($_POST['UpdateAll'])) {
- foreach ($_POST as $key => $value) {
- if (mb_substr($key,0,6)=='status') {
- $RequestNo=mb_substr($key,6);
- $sql="UPDATE stockrequest
- SET authorised='1'
- WHERE dispatchid='".$RequestNo."'";
- $result=DB_query($sql, $db);
- }
- }
-}
-
-/* Retrieve the requisition header information
- */
-$sql="SELECT stockrequest.dispatchid,
- locations.locationname,
- stockrequest.despatchdate,
- stockrequest.narrative,
- departments.description,
- www_users.realname,
- www_users.email
- FROM stockrequest INNER JOIN departments
- ON stockrequest.departmentid=departments.departmentid
- INNER JOIN locations
- ON stockrequest.loccode=locations.loccode
- INNER JOIN www_users
- ON www_users.userid=departments.authoriser
- WHERE stockrequest.authorised=0
- AND stockrequest.closed=0
- AND www_users.userid='".$_SESSION['UserID']."'";
-$result=DB_query($sql, $db);
-
-echo '<form method="post" action="' . htmlspecialchars($_SERVER['PHP_SELF'], ENT_QUOTES, 'UTF-8') . '">';
-echo '<input type="hidden" name="FormID" value="' . $_SESSION['FormID'] . '" />';
-echo '<table class="selection">';
-
-/* Create the table for the purchase order header */
-echo '<tr>
- <th>' . _('Request Number') . '</th>
- <th>' . _('Department') . '</th>
- <th>' . _('Location Of Stock') . '</th>
- <th>' . _('Requested Date') . '</th>
- <th>' . _('Narrative') . '</th>
- <th>' . _('Authorise') . '</th>
- </tr>';
-
-while ($myrow=DB_fetch_array($result)) {
-
- echo '<tr>
- <td>' . $myrow['dispatchid'] . '</td>
- <td>' . $myrow['description'] . '</td>
- <td>' . $myrow['locationname'] . '</td>
- <td>' . ConvertSQLDate($myrow['despatchdate']) . '</td>
- <td>' . $myrow['narrative'] . '</td>
- <td><input type="checkbox" name="status'.$myrow['dispatchid'].'" /></td>
- </tr>';
- $linesql="SELECT stockrequestitems.dispatchitemsid,
- stockrequestitems.stockid,
- stockrequestitems.decimalplaces,
- stockrequestitems.uom,
- stockmaster.description,
- stockrequestitems.quantity
- FROM stockrequestitems
- INNER JOIN stockmaster
- ON stockmaster.stockid=stockrequestitems.stockid
- WHERE dispatchid='".$myrow['dispatchid'] . "'";
- $lineresult=DB_query($linesql, $db);
-
- echo '<tr>
- <td></td>
- <td colspan="5" align="left">
- <table class="selection" align="left">
- <tr>
- <th>'._('Product').'</th>
- <th>'._('Quantity Required').'</th>
- <th>'._('Units').'</th>
- </tr>';
-
- while ($linerow=DB_fetch_array($lineresult)) {
- echo '<tr>
- <td>'.$linerow['description'].'</td>
- <td class="number">'.locale_number_format($linerow['quantity'],$linerow['decimalplaces']).'</td>
- <td>'.$linerow['uom'].'</td>
- </tr>';
- } // end while order line detail
- echo '</table>
- </td>
- </tr>';
-} //end while header loop
-echo '</table>';
-echo '<br /><div class="centre"><input type="submit" name="UpdateAll" value="' . _('Update'). '" /></form>';
-
-include('includes/footer.inc');
+<?php
+
+/* $Id: InternalStockRequestAuthorisation.php 4576 2011-05-27 10:59:20Z daintree $*/
+
+include('includes/session.inc');
+
+$title = _('Authorise Internal Stock Requests');
+
+include('includes/header.inc');
+
+echo '<p class="page_title_text"><img src="'.$rootpath.'/css/'.$theme.'/images/transactions.png" title="' . $title . '" alt="" />' . ' ' . $title . '</p>';
+
+if (isset($_POST['UpdateAll'])) {
+ foreach ($_POST as $key => $value) {
+ if (mb_substr($key,0,6)=='status') {
+ $RequestNo=mb_substr($key,6);
+ $sql="UPDATE stockrequest
+ SET authorised='1'
+ WHERE dispatchid='".$RequestNo."'";
+ $result=DB_query($sql, $db);
+ }
+ }
+}
+
+/* Retrieve the requisition header information
+ */
+$sql="SELECT stockrequest.dispatchid,
+ locations.locationname,
+ stockrequest.despatchdate,
+ stockrequest.narrative,
+ departments.description,
+ www_users.realname,
+ www_users.email
+ FROM stockrequest INNER JOIN departments
+ ON stockrequest.departmentid=departments.departmentid
+ INNER JOIN locations
+ ON stockrequest.loccode=locations.loccode
+ INNER JOIN www_users
+ ON www_users.userid=departments.authoriser
+ WHERE stockrequest.authorised=0
+ AND stockrequest.closed=0
+ AND www_users.userid='".$_SESSION['UserID']."'";
+$result=DB_query($sql, $db);
+
+echo '<form method="post" action="' . htmlspecialchars($_SERVER['PHP_SELF'], ENT_QUOTES, 'UTF-8') . '">';
+echo '<div>';
+echo '<input type="hidden" name="FormID" value="' . $_SESSION['FormID'] . '" />';
+echo '<table class="selection">';
+
+/* Create the table for the purchase order header */
+echo '<tr>
+ <th>' . _('Request Number') . '</th>
+ <th>' . _('Department') . '</th>
+ <th>' . _('Location Of Stock') . '</th>
+ <th>' . _('Requested Date') . '</th>
+ <th>' . _('Narrative') . '</th>
+ <th>' . _('Authorise') . '</th>
+ </tr>';
+
+while ($myrow=DB_fetch_array($result)) {
+
+ echo '<tr>
+ <td>' . $myrow['dispatchid'] . '</td>
+ <td>' . $myrow['description'] . '</td>
+ <td>' . $myrow['locationname'] . '</td>
+ <td>' . ConvertSQLDate($myrow['despatchdate']) . '</td>
+ <td>' . $myrow['narrative'] . '</td>
+ <td><input type="checkbox" name="status'.$myrow['dispatchid'].'" /></td>
+ </tr>';
+ $linesql="SELECT stockrequestitems.dispatchitemsid,
+ stockrequestitems.stockid,
+ stockrequestitems.decimalplaces,
+ stockrequestitems.uom,
+ stockmaster.description,
+ stockrequestitems.quantity
+ FROM stockrequestitems
+ INNER JOIN stockmaster
+ ON stockmaster.stockid=stockrequestitems.stockid
+ WHERE dispatchid='".$myrow['dispatchid'] . "'";
+ $lineresult=DB_query($linesql, $db);
+
+ echo '<tr>
+ <td></td>
+ <td colspan="5" align="left">
+ <table class="selection" align="left">
+ <tr>
+ <th>'._('Product').'</th>
+ <th>'._('Quantity Required').'</th>
+ <th>'._('Units').'</th>
+ </tr>';
+
+ while ($linerow=DB_fetch_array($lineresult)) {
+ echo '<tr>
+ <td>'.$linerow['description'].'</td>
+ <td class="number">'.locale_number_format($linerow['quantity'],$linerow['decimalplaces']).'</td>
+ <td>'.$linerow['uom'].'</td>
+ </tr>';
+ } // end while order line detail
+ echo '</table>
+ </td>
+ </tr>';
+} //end while header loop
+echo '</table>';
+echo '<br /><div class="centre"><input type="submit" name="UpdateAll" value="' . _('Update'). '" /></div>
+ </div>
+ </form>';
+
+include('includes/footer.inc');
?>
\ No newline at end of file
Modified: trunk/InternalStockRequestFulfill.php
===================================================================
--- trunk/InternalStockRequestFulfill.php 2012-04-01 16:54:04 UTC (rev 5192)
+++ trunk/InternalStockRequestFulfill.php 2012-04-01 17:56:40 UTC (rev 5193)
@@ -1,343 +1,349 @@
-<?php
-
-$PageSecurity=1;
-
-include('includes/session.inc');
-
-$title = _('Fulfill Stock Requests');
-
-include('includes/header.inc');
-include('includes/SQL_CommonFunctions.inc');
-
-echo '<p class="page_title_text"><img src="'.$rootpath.'/css/'.$theme.'/images/inventory.png" title="' . _('Contract') . '" alt="" />' . _('Fulfill Stock Requests') . '</p>';
-
-if (isset($_POST['UpdateAll'])) {
- foreach ($_POST as $key => $value) {
- if (mb_strpos($key,'Qty')) {
- $RequestID = mb_substr($key,0, mb_strpos($key,'Qty'));
- $LineID = mb_substr($key,mb_strpos($key,'Qty')+3);
- $Quantity = $_POST[$RequestID.'Qty'.$LineID];
- $StockID = $_POST[$RequestID.'StockID'.$LineID];
- $Location = $_POST[$RequestID.'Location'.$LineID];
- $Tag = $_POST[$RequestID.'Tag'.$LineID];
- $RequestedQuantity = $_POST[$RequestID.'RequestedQuantity'.$LineID];
- if (isset($_POST[$RequestID.'Completed'.$LineID])) {
- $Completed=True;
- } else {
- $Completed=False;
- }
-
- $sql="SELECT materialcost, labourcost, overheadcost FROM stockmaster WHERE stockid='".$StockID."'";
- $result=DB_query($sql, $db);
- $myrow=DB_fetch_array($result);
- $StandardCost=$myrow['materialcost']+$myrow['labourcost']+$myrow['overheadcost'];
-
- $Narrative = _('Issue') . ' ' . $Quantity . ' ' . _('of') . ' '. $StockID . ' ' . _('to department');
-
- $AdjustmentNumber = GetNextTransNo(17,$db);
- $PeriodNo = GetPeriod (Date($_SESSION['DefaultDateFormat']), $db);
- $SQLAdjustmentDate = FormatDateForSQL(Date($_SESSION['DefaultDateFormat']));
-
- $Result = DB_Txn_Begin($db);
-
- // Need to get the current location quantity will need it later for the stock movement
- $SQL="SELECT locstock.quantity
- FROM locstock
- WHERE locstock.stockid='" . $StockID . "'
- AND loccode= '" . $Location . "'";
- $Result = DB_query($SQL, $db);
- if (DB_num_rows($Result)==1){
- $LocQtyRow = DB_fetch_row($Result);
- $QtyOnHandPrior = $LocQtyRow[0];
- } else {
- // There must actually be some error this should never happen
- $QtyOnHandPrior = 0;
- }
-
- if ($_SESSION['ProhibitNegativeStock']==0 or ($_SESSION['ProhibitNegativeStock']==1 and $QtyOnHandPrior>=$Quantity)) {
-
- $SQL = "INSERT INTO stockmoves (
- stockid,
- type,
- transno,
- loccode,
- trandate,
- prd,
- reference,
- qty,
- newqoh)
- VALUES (
- '" . $StockID . "',
- 17,
- '" . $AdjustmentNumber . "',
- '" . $Location . "',
- '" . $SQLAdjustmentDate . "',
- '" . $PeriodNo . "',
- '" . $Narrative ."',
- '" . -$Quantity . "',
- '" . ($QtyOnHandPrior - $Quantity) . "'
- )";
-
-
- $ErrMsg = _('CRITICAL ERROR') . '! ' . _('NOTE DOWN THIS ERROR AND SEEK ASSISTANCE') . ': ' . _('The stock movement record cannot be inserted because');
- $DbgMsg = _('The following SQL to insert the stock movement record was used');
- $Result = DB_query($SQL, $db, $ErrMsg, $DbgMsg, true);
-
-
- /*Get the ID of the StockMove... */
- $StkMoveNo = DB_Last_Insert_ID($db,'stockmoves','stkmoveno');
-
- $SQL="UPDATE stockrequestitems
- SET qtydelivered=qtydelivered+".$Quantity."
- WHERE dispatchid='".$RequestID."'
- AND dispatchitemsid='".$LineID."'";
-
- $ErrMsg = _('CRITICAL ERROR') . '! ' . _('NOTE DOWN THIS ERROR AND SEEK ASSISTANCE') . ': ' ._('The location stock record could not be updated because');
- $DbgMsg = _('The following SQL to update the stock record was used');
- $Result = DB_query($SQL,$db, $ErrMsg, $DbgMsg,true);
-
- $SQL = "UPDATE locstock SET quantity = quantity - '" . $Quantity . "'
- WHERE stockid='" . $StockID . "'
- AND loccode='" . $Location . "'";
-
- $ErrMsg = _('CRITICAL ERROR') . '! ' . _('NOTE DOWN THIS ERROR AND SEEK ASSISTANCE') . ': ' ._('The location stock record could not be updated because');
- $DbgMsg = _('The following SQL to update the stock record was used');
-
- $Result = DB_query($SQL, $db, $ErrMsg, $DbgMsg, true);
-
- if ($_SESSION['CompanyRecord']['gllink_stock']==1 AND $StandardCost > 0){
-
- $StockGLCodes = GetStockGLCode($StockID,$db);
-
- $SQL = "INSERT INTO gltrans (type,
- typeno,
- trandate,
- periodno,
- account,
- amount,
- narrative,
- tag)
- VALUES (17,
- '" .$AdjustmentNumber . "',
- '" . $SQLAdjustmentDate . "',
- '" . $PeriodNo . "',
- '" . $StockGLCodes['issueglact'] . "',
- '" . $StandardCost * -($Quantity) . "',
- '" . $Narrative . "',
- '" . $Tag . "'
- )";
-
- $ErrMsg = _('CRITICAL ERROR') . '! ' . _('NOTE DOWN THIS ERROR AND SEEK ASSISTANCE') . ': ' . _('The general ledger transaction entries could not be added because');
- $DbgMsg = _('The following SQL to insert the GL entries was used');
- $Result = DB_query($SQL,$db, $ErrMsg, $DbgMsg, true);
-
- $SQL = "INSERT INTO gltrans (type,
- typeno,
- trandate,
- periodno,
- account,
- amount,
- narrative,
- tag)
- VALUES (17,
- '" . $AdjustmentNumber . "',
- '" . $SQLAdjustmentDate . "',
- '" . $PeriodNo . "',
- '" . $StockGLCodes['stockact'] . "',
- '" . $StandardCost * $Quantity . "',
- '" . $Narrative . "',
- '" . $Tag . "'
- )";
-
- $Errmsg = _('CRITICAL ERROR') . '! ' . _('NOTE DOWN THIS ERROR AND SEEK ASSISTANCE') . ': ' . _('The general ledger transaction entries could not be added because');
- $DbgMsg = _('The following SQL to insert the GL entries was used');
- $Result = DB_query($SQL,$db, $ErrMsg, $DbgMsg,true);
- }
-
- if (($Quantity>=$RequestedQuantity) or $Completed==True) {
- $SQL="UPDATE stockrequestitems
- SET completed=1
- WHERE dispatchid='".$RequestID."'
- AND dispatchitemsid='".$LineID."'";
- $Result = DB_query($SQL,$db, $ErrMsg, $DbgMsg,true);
- }
-
- $Result = DB_Txn_Commit($db);
-
- $ConfirmationText = _('A stock issue for'). ' ' . $StockID . ' ' . _('has been created from location').' ' . $Location .' '. _('for a quantity of') . ' ' . $Quantity ;
- prnMsg( $ConfirmationText,'success');
-
- if ($_SESSION['InventoryManagerEmail']!=''){
- $ConfirmationText = $ConfirmationText . ' ' . _('by user') . ' ' . $_SESSION['UserID'] . ' ' . _('at') . ' ' . Date('Y-m-d H:i:s');
- $EmailSubject = _('Stock adjustment for'). ' ' . $StockID;
- mail($_SESSION['InventoryManagerEmail'],$EmailSubject,$ConfirmationText);
- }
- } else {
- $ConfirmationText = _('A stock issue for'). ' ' . $StockID . ' ' . _('from location').' ' . $Location .' '. _('for a quantity of') . ' ' . $Quantity . ' ' . _('cannot be created as there is insufficient stock and your system is configured to not allow negative stocks');
- prnMsg( $ConfirmationText,'warn');
- }
- }
- }
-}
-
-// Check if request can be closed and close if done.
-if (isset($RequestID)) {
- $SQL="SELECT dispatchid
- FROM stockrequestitems
- WHERE dispatchid='".$RequestID."'
- AND completed=0";
- $Result=DB_query($SQL, $db);
- if (DB_num_rows($Result)==0) {
- $SQL="UPDATE stockrequest
- SET closed=1
- WHERE dispatchid='".$RequestID."'";
- $Result=DB_query($SQL, $db);
- }
-}
-
-if (!isset($_POST['Location'])) {
- echo '<form method="post" action="' . htmlspecialchars($_SERVER['PHP_SELF'], ENT_QUOTES, 'UTF-8') . '">';
- echo '<input type="hidden" name="FormID" value="' . $_SESSION['FormID'] . '" />';
- echo '<table class="selection"><tr>';
- echo '<td>' . _('Choose a location to issue requests from') . '</td>
- <td><select name="Location">';
- $sql = "SELECT loccode, locationname FROM locations";
- $resultStkLocs = DB_query($sql,$db);
- while ($myrow=DB_fetch_array($resultStkLocs)){
- if (isset($_SESSION['Adjustment']->StockLocation)){
- if ($myrow['loccode'] == $_SESSION['Adjustment']->StockLocation){
- echo '<option selected="True" value="' . $myrow['loccode'] . '">' . $myrow['locationname'] . '</option>';
- } else {
- echo '<option value="' . $myrow['loccode'] . '">' . $myrow['locationname'] . '</option>';
- }
- } elseif ($myrow['loccode']==$_SESSION['UserStockLocation']){
- echo '<option selected="True" value="' . $myrow['loccode'] . '">' . $myrow['locationname'] . '</option>';
- $_POST['StockLocation']=$myrow['loccode'];
- } else {
- echo '<option value="' . $myrow['loccode'] . '">' . $myrow['locationname'] . '</option>';
- }
- }
- echo '</select></td></tr>';
- echo '</table><br />';
- echo '<div class="centre"><input type="submit" name="EnterAdjustment" value="'. _('Show Requests'). '" /></div>';
- include('includes/footer.inc');
- exit;
-}
-
-/* Retrieve the requisition header information
- */
-if (isset($_POST['Location'])) {
- $sql="SELECT stockrequest.dispatchid,
- locations.locationname,
- stockrequest.despatchdate,
- stockrequest.narrative,
- departments.description,
- www_users.realname,
- www_users.email
- FROM stockrequest
- LEFT JOIN departments
- ON stockrequest.departmentid=departments.departmentid
- LEFT JOIN locations
- ON stockrequest.loccode=locations.loccode
- LEFT JOIN www_users
- ON www_users.userid=departments.authoriser
- WHERE stockrequest.authorised=1
- AND stockrequest.closed=0
- AND stockrequest.loccode='".$_POST['Location']."'";
- $result=DB_query($sql, $db);
-
- if (DB_num_rows($result)==0) {
- prnMsg( _('There are no outstanding authorised requests for this location'), 'info');
- echo '<br />';
- echo '<div class="centre"><a href="' . htmlspecialchars($_SESSION['PHP_SELF'],ENT_QUOTES,'UTF-8') . '">' . _('Select another location') . '</a></div>';
- include('includes/footer.inc');
- exit;
- }
-
- echo '<form method="post" action="' . htmlspecialchars($_SERVER['PHP_SELF'], ENT_QUOTES, 'UTF-8') . '">';
- echo '<input type="hidden" name="FormID" value="' . $_SESSION['FormID'] . '" />';
- echo '<table class="selection"><tr>';
-
- /* Create the table for the purchase order header */
- echo '<th>'._('Request Number').'</th>';
- echo '<th>'._('Department').'</th>';
- echo '<th>'._('Location Of Stock').'</th>';
- echo '<th>'._('Requested Date').'</th>';
- echo '<th>'._('Narrative').'</th>';
- echo '</tr>';
-
- while ($myrow=DB_fetch_array($result)) {
-
- echo '<tr>';
- echo '<td>'.$myrow['dispatchid'].'</td>';
- echo '<td>'.$myrow['description'].'</td>';
- echo '<td>'.$myrow['locationname'].'</td>';
- echo '<td>'.ConvertSQLDate($myrow['despatchdate']).'</td>';
- echo '<td>'.$myrow['narrative'].'</td>';
- echo '</tr>';
- $linesql="SELECT stockrequestitems.dispatchitemsid,
- stockrequestitems.dispatchid,
- stockrequestitems.stockid,
- stockrequestitems.decimalplaces,
- stockrequestitems.uom,
- stockmaster.description,
- stockrequestitems.quantity,
- stockrequestitems.qtydelivered
- FROM stockrequestitems
- LEFT JOIN stockmaster
- ON stockmaster.stockid=stockrequestitems.stockid
- WHERE dispatchid='".$myrow['dispatchid'] . "'
- AND completed=0";
- $lineresult=DB_query($linesql, $db);
-
- echo '<tr><td></td><td colspan="5" align="left"><table class="selection" align="left">';
- echo '<th>'._('Product').'</th>';
- echo '<th>'._('Quantity') . '<br />' . _('Required').'</th>';
- echo '<th>'._('Quantity') . '<br />' . _('Delivered').'</th>';
- echo '<th>'._('Units').'</th>';
- echo '<th>'._('Completed').'</th>';
- echo '<th>'._('Tag').'</th>';
- echo '</tr>';
-
- while ($linerow=DB_fetch_array($lineresult)) {
- echo '<tr>';
- echo '<td>'.$linerow['description'].'</td>';
- echo '<td class="number">'.locale_number_format($linerow['quantity']-$linerow['qtydelivered'],$linerow['decimalplaces']).'</td>';
- echo '<td class="number">
- <input type="text" class="number" name="'. $linerow['dispatchid'] . 'Qty'. $linerow['dispatchitemsid'] . '" value="'.locale_number_format($linerow['quantity']-$linerow['qtydelivered'],$linerow['decimalplaces']).'" />
- </td>';
- echo '<td>'.$linerow['uom'].'</td>';
- echo '<td><input type="checkbox" name="'. $linerow['dispatchid'] . 'Completed'. $linerow['dispatchitemsid'] . '" /></td>';
- //Select the tag
- echo '<td><select name="'. $linerow['dispatchid'] . 'Tag'. $linerow['dispatchitemsid'] . '">';
-
- $SQL = "SELECT tagref,
- tagdescription
- FROM tags
- ORDER BY tagref";
-
- $TagResult=DB_query($SQL,$db);
- echo '<option value=0>0 - None</option>';
- while ($mytagrow=DB_fetch_array($TagResult)){
- if (isset($_SESSION['Adjustment']->tag) and $_SESSION['Adjustment']->tag==$mytagrow['tagref']){
- echo '<option selected="True" value="' . $mytagrow['tagref'] . '">' . $mytagrow['tagref'].' - ' .$myrow['tagdescription'] . '</option>';
- } else {
- echo '<option value="' . $mytagrow['tagref'] . '">' . $mytagrow['tagref'].' - ' .$mytagrow['tagdescription'] . '</option>';
- }
- }
- echo '</select></td>';
-// End select tag
- echo '</tr>';
- echo '<input type="hidden" class="number" name="'. $linerow['dispatchid'] . 'StockID'. $linerow['dispatchitemsid'] . '" value="'.$linerow['stockid'].'" />';
- echo '<input type="hidden" class="number" name="'. $linerow['dispatchid'] . 'Location'. $linerow['dispatchitemsid'] . '" value="'.$_POST['Location'].'" />';
- echo '<input type="hidden" class="number" name="'. $linerow['dispatchid'] . 'RequestedQuantity'. $linerow['dispatchitemsid'] . '" value="'.locale_number_format($linerow['quantity']-$linerow['qtydelivered'],$linerow['decimalplaces']).'" />';
- } // end while order line detail
- echo '</table></td></tr>';
- } //end while header loop
- echo '</table>';
- echo '<br /><div class="centre"><input type="submit" name="UpdateAll" value="' . _('Update'). '" /></form>';
-}
-
-include('includes/footer.inc');
-
-?>
+<?php
+
+$PageSecurity=1;
+
+include('includes/session.inc');
+
+$title = _('Fulfill Stock Requests');
+
+include('includes/header.inc');
+include('includes/SQL_CommonFunctions.inc');
+
+echo '<p class="page_title_text"><img src="'.$rootpath.'/css/'.$theme.'/images/inventory.png" title="' . _('Contract') . '" alt="" />' . _('Fulfill Stock Requests') . '</p>';
+
+if (isset($_POST['UpdateAll'])) {
+ foreach ($_POST as $key => $value) {
+ if (mb_strpos($key,'Qty')) {
+ $RequestID = mb_substr($key,0, mb_strpos($key,'Qty'));
+ $LineID = mb_substr($key,mb_strpos($key,'Qty')+3);
+ $Quantity = $_POST[$RequestID.'Qty'.$LineID];
+ $StockID = $_POST[$RequestID.'StockID'.$LineID];
+ $Location = $_POST[$RequestID.'Location'.$LineID];
+ $Tag = $_POST[$RequestID.'Tag'.$LineID];
+ $RequestedQuantity = $_POST[$RequestID.'RequestedQuantity'.$LineID];
+ if (isset($_POST[$RequestID.'Completed'.$LineID])) {
+ $Completed=True;
+ } else {
+ $Completed=False;
+ }
+
+ $sql="SELECT materialcost, labourcost, overheadcost FROM stockmaster WHERE stockid='".$StockID."'";
+ $result=DB_query($sql, $db);
+ $myrow=DB_fetch_array($result);
+ $StandardCost=$myrow['materialcost']+$myrow['labourcost']+$myrow['overheadcost'];
+
+ $Narrative = _('Issue') . ' ' . $Quantity . ' ' . _('of') . ' '. $StockID . ' ' . _('to department');
+
+ $AdjustmentNumber = GetNextTransNo(17,$db);
+ $PeriodNo = GetPeriod (Date($_SESSION['DefaultDateFormat']), $db);
+ $SQLAdjustmentDate = FormatDateForSQL(Date($_SESSION['DefaultDateFormat']));
+
+ $Result = DB_Txn_Begin($db);
+
+ // Need to get the current location quantity will need it later for the stock movement
+ $SQL="SELECT locstock.quantity
+ FROM locstock
+ WHERE locstock.stockid='" . $StockID . "'
+ AND loccode= '" . $Location . "'";
+ $Result = DB_query($SQL, $db);
+ if (DB_num_rows($Result)==1){
+ $LocQtyRow = DB_fetch_row($Result);
+ $QtyOnHandPrior = $LocQtyRow[0];
+ } else {
+ // There must actually be some error this should never happen
+ $QtyOnHandPrior = 0;
+ }
+
+ if ($_SESSION['ProhibitNegativeStock']==0 or ($_SESSION['ProhibitNegativeStock']==1 and $QtyOnHandPrior>=$Quantity)) {
+
+ $SQL = "INSERT INTO stockmoves (
+ stockid,
+ type,
+ transno,
+ loccode,
+ trandate,
+ prd,
+ reference,
+ qty,
+ newqoh)
+ VALUES (
+ '" . $StockID . "',
+ 17,
+ '" . $AdjustmentNumber . "',
+ '" . $Location . "',
+ '" . $SQLAdjustmentDate . "',
+ '" . $PeriodNo . "',
+ '" . $Narrative ."',
+ '" . -$Quantity . "',
+ '" . ($QtyOnHandPrior - $Quantity) . "'
+ )";
+
+
+ $ErrMsg = _('CRITICAL ERROR') . '! ' . _('NOTE DOWN THIS ERROR AND SEEK ASSISTANCE') . ': ' . _('The stock movement record cannot be inserted because');
+ $DbgMsg = _('The following SQL to insert the stock movement record was used');
+ $Result = DB_query($SQL, $db, $ErrMsg, $DbgMsg, true);
+
+
+ /*Get the ID of the StockMove... */
+ $StkMoveNo = DB_Last_Insert_ID($db,'stockmoves','stkmoveno');
+
+ $SQL="UPDATE stockrequestitems
+ SET qtydelivered=qtydelivered+".$Quantity."
+ WHERE dispatchid='".$RequestID."'
+ AND dispatchitemsid='".$LineID."'";
+
+ $ErrMsg = _('CRITICAL ERROR') . '! ' . _('NOTE DOWN THIS ERROR AND SEEK ASSISTANCE') . ': ' ._('The location stock record could not be updated because');
+ $DbgMsg = _('The following SQL to update the stock record was used');
+ $Result = DB_query($SQL,$db, $ErrMsg, $DbgMsg,true);
+
+ $SQL = "UPDATE locstock SET quantity = quantity - '" . $Quantity . "'
+ WHERE stockid='" . $StockID . "'
+ AND loccode='" . $Location . "'";
+
+ $ErrMsg = _('CRITICAL ERROR') . '! ' . _('NOTE DOWN THIS ERROR AND SEEK ASSISTANCE') . ': ' ._('The location stock record could not be updated because');
+ $DbgMsg = _('The following SQL to update the stock record was used');
+
+ $Result = DB_query($SQL, $db, $ErrMsg, $DbgMsg, true);
+
+ if ($_SESSION['CompanyRecord']['gllink_stock']==1 AND $StandardCost > 0){
+
+ $StockGLCodes = GetStockGLCode($StockID,$db);
+
+ $SQL = "INSERT INTO gltrans (type,
+ typeno,
+ trandate,
+ periodno,
+ account,
+ amount,
+ narrative,
+ tag)
+ VALUES (17,
+ '" .$AdjustmentNumber . "',
+ '" . $SQLAdjustmentDate . "',
+ '" . $PeriodNo . "',
+ '" . $StockGLCodes['issueglact'] . "',
+ '" . $StandardCost * -($Quantity) . "',
+ '" . $Narrative . "',
+ '" . $Tag . "'
+ )";
+
+ $ErrMsg = _('CRITICAL ERROR') . '! ' . _('NOTE DOWN THIS ERROR AND SEEK ASSISTANCE') . ': ' . _('The general ledger transaction entries could not be added because');
+ $DbgMsg = _('The following SQL to insert the GL entries was used');
+ $Result = DB_query($SQL,$db, $ErrMsg, $DbgMsg, true);
+
+ $SQL = "INSERT INTO gltrans (type,
+ typeno,
+ trandate,
+ periodno,
+ account,
+ amount,
+ narrative,
+ tag)
+ VALUES (17,
+ '" . $AdjustmentNumber . "',
+ '" . $SQLAdjustmentDate . "',
+ '" . $PeriodNo . "',
+ '" . $StockGLCodes['stockact'] . "',
+ '" . $StandardCost * $Quantity . "',
+ '" . $Narrative . "',
+ '" . $Tag . "'
+ )";
+
+ $Errmsg = _('CRITICAL ERROR') . '! ' . _('NOTE DOWN THIS ERROR AND SEEK ASSISTANCE') . ': ' . _('The general ledger transaction entries could not be added because');
+ $DbgMsg = _('The following SQL to insert the GL entries was used');
+ $Result = DB_query($SQL,$db, $ErrMsg, $DbgMsg,true);
+ }
+
+ if (($Quantity>=$RequestedQuantity) or $Completed==True) {
+ $SQL="UPDATE stockrequestitems
+ SET completed=1
+ WHERE dispatchid='".$RequestID."'
+ AND dispatchitemsid='".$LineID."'";
+ $Result = DB_query($SQL,$db, $ErrMsg, $DbgMsg,true);
+ }
+
+ $Result = DB_Txn_Commit($db);
+
+ $ConfirmationText = _('A stock issue for'). ' ' . $StockID . ' ' . _('has been created from location').' ' . $Location .' '. _('for a quantity of') . ' ' . $Quantity ;
+ prnMsg( $ConfirmationText,'success');
+
+ if ($_SESSION['InventoryManagerEmail']!=''){
+ $ConfirmationText = $ConfirmationText . ' ' . _('by user') . ' ' . $_SESSION['UserID'] . ' ' . _('at') . ' ' . Date('Y-m-d H:i:s');
+ $EmailSubject = _('Stock adjustment for'). ' ' . $StockID;
+ mail($_SESSION['InventoryManagerEmail'],$EmailSubject,$ConfirmationText);
+ }
+ } else {
+ $ConfirmationText = _('A stock issue for'). ' ' . $StockID . ' ' . _('from location').' ' . $Location .' '. _('for a quantity of') . ' ' . $Quantity . ' ' . _('cannot be created as there is insufficient stock and your system is configured to not allow negative stocks');
+ prnMsg( $ConfirmationText,'warn');
+ }
+ }
+ }
+}
+
+// Check if request can be closed and close if done.
+if (isset($RequestID)) {
+ $SQL="SELECT dispatchid
+ FROM stockrequestitems
+ WHERE dispatchid='".$RequestID."'
+ AND completed=0";
+ $Result=DB_query($SQL, $db);
+ if (DB_num_rows($Result)==0) {
+ $SQL="UPDATE stockrequest
+ SET closed=1
+ WHERE dispatchid='".$RequestID."'";
+ $Result=DB_query($SQL, $db);
+ }
+}
+
+if (!isset($_POST['Location'])) {
+ echo '<form method="post" action="' . htmlspecialchars($_SERVER['PHP_SELF'], ENT_QUOTES, 'UTF-8') . '">';
+ echo '<div>';
+ echo '<input type="hidden" name="FormID" value="' . $_SESSION['FormID'] . '" />';
+ echo '<table class="selection"><tr>';
+ echo '<td>' . _('Choose a location to issue requests from') . '</td>
+ <td><select name="Location">';
+ $sql = "SELECT loccode, locationname FROM locations";
+ $resultStkLocs = DB_query($sql,$db);
+ while ($myrow=DB_fetch_array($resultStkLocs)){
+ if (isset($_SESSION['Adjustment']->StockLocation)){
+ if ($myrow['loccode'] == $_SESSION['Adjustment']->StockLocation){
+ echo '<option selected="selected" value="' . $myrow['loccode'] . '">' . $myrow['locationname'] . '</option>';
+ } else {
+ echo '<option value="' . $myrow['loccode'] . '">' . $myrow['locationname'] . '</option>';
+ }
+ } elseif ($myrow['loccode']==$_SESSION['UserStockLocation']){
+ echo '<option selected="selected" value="' . $myrow['loccode'] . '">' . $myrow['locationname'] . '</option>';
+ $_POST['StockLocation']=$myrow['loccode'];
+ } else {
+ echo '<option value="' . $myrow['loccode'] . '">' . $myrow['locationname'] . '</option>';
+ }
+ }
+ echo '</select></td></tr>';
+ echo '</table><br />';
+ echo '<div class="centre"><input type="submit" name="EnterAdjustment" value="'. _('Show Requests'). '" /></div>';
+ echo '</div>
+ </form>';
+ include('includes/footer.inc');
+ exit;
+}
+
+/* Retrieve the requisition header information
+ */
+if (isset($_POST['Location'])) {
+ $sql="SELECT stockrequest.dispatchid,
+ locations.locationname,
+ stockrequest.despatchdate,
+ stockrequest.narrative,
+ departments.description,
+ www_users.realname,
+ www_users.email
+ FROM stockrequest
+ LEFT JOIN departments
+ ON stockrequest.departmentid=departments.departmentid
+ LEFT JOIN locations
+ ON stockrequest.loccode=locations.loccode
+ LEFT JOIN www_users
+ ON www_users.userid=departments.authoriser
+ WHERE stockrequest.authorised=1
+ AND stockrequest.closed=0
+ AND stockrequest.loccode='".$_POST['Location']."'";
+ $result=DB_query($sql, $db);
+
+ if (DB_num_rows($result)==0) {
+ prnMsg( _('There are no outstanding authorised requests for this location'), 'info');
+ echo '<br />';
+ echo '<div class="centre"><a href="' . htmlspecialchars($_SERVER['PHP_SELF'],ENT_QUOTES,'UTF-8') . '">' . _('Select another location') . '</a></div>';
+ include('includes/footer.inc');
+ exit;
+ }
+
+ echo '<form method="post" action="' . htmlspecialchars($_SERVER['PHP_SELF'], ENT_QUOTES, 'UTF-8') . '">';
+ echo '<div>';
+ echo '<input type="hidden" name="FormID" value="' . $_SESSION['FormID'] . '" />';
+ echo '<table class="selection"><tr>';
+
+ /* Create the table for the purchase order header */
+ echo '<th>'._('Request Number').'</th>';
+ echo '<th>'._('Department').'</th>';
+ echo '<th>'._('Location Of Stock').'</th>';
+ echo '<th>'._('Requested Date').'</th>';
+ echo '<th>'._('Narrative').'</th>';
+ echo '</tr>';
+
+ while ($myrow=DB_fetch_array($result)) {
+
+ echo '<tr>';
+ echo '<td>'.$myrow['dispatchid'].'</td>';
+ echo '<td>'.$myrow['description'].'</td>';
+ echo '<td>'.$myrow['locationname'].'</td>';
+ echo '<td>'.ConvertSQLDate($myrow['despatchdate']).'</td>';
+ echo '<td>'.$myrow['narrative'].'</td>';
+ echo '</tr>';
+ $linesql="SELECT stockrequestitems.dispatchitemsid,
+ stockrequestitems.dispatchid,
+ stockrequestitems.stockid,
+ stockrequestitems.decimalplaces,
+ stockrequestitems.uom,
+ stockmaster.description,
+ stockrequestitems.quantity,
+ stockrequestitems.qtydelivered
+ FROM stockrequestitems
+ LEFT JOIN stockmaster
+ ON stockmaster.stockid=stockrequestitems.stockid
+ WHERE dispatchid='".$myrow['dispatchid'] . "'
+ AND completed=0";
+ $lineresult=DB_query($linesql, $db);
+
+ echo '<tr><td></td><td colspan="5" align="left"><table class="selection" align="left">';
+ echo '<th>'._('Product').'</th>';
+ echo '<th>'._('Quantity') . '<br />' . _('Required').'</th>';
+ echo '<th>'._('Quantity') . '<br />' . _('Delivered').'</th>';
+ echo '<th>'._('Units').'</th>';
+ echo '<th>'._('Completed').'</th>';
+ echo '<th>'._('Tag').'</th>';
+ echo '</tr>';
+
+ while ($linerow=DB_fetch_array($lineresult)) {
+ echo '<tr>';
+ echo '<td>'.$linerow['description'].'</td>';
+ echo '<td class="number">'.locale_number_format($linerow['quantity']-$linerow['qtydelivered'],$linerow['decimalplaces']).'</td>';
+ echo '<td class="number">
+ <input type="text" class="number" name="'. $linerow['dispatchid'] . 'Qty'. $linerow['dispatchitemsid'] . '" value="'.locale_number_format($linerow['quantity']-$linerow['qtydelivered'],$linerow['decimalplaces']).'" />
+ </td>';
+ echo '<td>'.$linerow['uom'].'</td>';
+ echo '<td><input type="checkbox" name="'. $linerow['dispatchid'] . 'Completed'. $linerow['dispatchitemsid'] . '" /></td>';
+ //Select the tag
+ echo '<td><select name="'. $linerow['dispatchid'] . 'Tag'. $linerow['dispatchitemsid'] . '">';
+
+ $SQL = "SELECT tagref,
+ tagdescription
+ FROM tags
+ ORDER BY tagref";
+
+ $TagResult=DB_query($SQL,$db);
+ echo '<option value=0>0 - None</option>';
+ while ($mytagrow=DB_fetch_array($TagResult)){
+ if (isset($_SESSION['Adjustment']->tag) and $_SESSION['Adjustment']->tag==$mytagrow['tagref']){
+ echo '<option selected="selected" value="' . $mytagrow['tagref'] . '">' . $mytagrow['tagref'].' - ' .$myrow['tagdescription'] . '</option>';
+ } else {
+ echo '<option value="' . $mytagrow['tagref'] . '">' . $mytagrow['tagref'].' - ' .$mytagrow['tagdescription'] . '</option>';
+ }
+ }
+ echo '</select></td>';
+// End select tag
+ echo '</tr>';
+ echo '<input type="hidden" class="number" name="'. $linerow['dispatchid'] . 'StockID'. $linerow['dispatchitemsid'] . '" value="'.$linerow['stockid'].'" />';
+ echo '<input type="hidden" class="number" name="'. $linerow['dispatchid'] . 'Location'. $linerow['dispatchitemsid'] . '" value="'.$_POST['Location'].'" />';
+ echo '<input type="hidden" class="number" name="'. $linerow['dispatchid'] . 'RequestedQuantity'. $linerow['dispatchitemsid'] . '" value="'.locale_number_format($linerow['quantity']-$linerow['qtydelivered'],$linerow['decimalplaces']).'" />';
+ } // end while order line detail
+ echo '</table></td></tr>';
+ } //end while header loop
+ echo '</table>';
+ echo '<br /><div class="centre"><input type="submit" name="UpdateAll" value="' . _('Update'). '" /></div>
+ </div>
+ </form>';
+}
+
+include('includes/footer.inc');
+
+?>
Modified: trunk/InventoryPlanning.php
===================================================================
--- trunk/InventoryPlanning.php 2012-04-01 16:54:04 UTC (rev 5192)
+++ trunk/InventoryPlanning.php 2012-04-01 17:56:40 UTC (rev 5193)
@@ -377,9 +377,10 @@
/*if $FromCriteria is not set then show a form to allow input */
- echo '<form action="' . htmlspecialchars($_SERVER['PHP_SELF'],ENT_QUOTES,'UTF-8') . '" method="post">
- <table class="selection">';
- echo '<input type="hidden" name="FormID" value="' . $_SESSION['FormID'] . '" />';
+ echo '<form action="' . htmlspecialchars($_SERVER['PHP_SELF'],ENT_QUOTES,'UTF-8') . '" method="post">';
+ echo '<div>';
+ echo '<input type="hidden" name="FormID" value="' . $_SESSION['FormID'] . '" />';
+ echo '<table class="selection">';
echo '<tr>
<td>' . _('From Inventory Category Code') . ':</td>
@@ -444,6 +445,7 @@
<div class="centre">
<input type="submit" name="PrintPDF" value="' . _('Print PDF') . '" />
</div>
+ </div>
</form>';
}
include('includes/footer.inc');
Modified: trunk/InventoryPlanningPrefSupplier.php
===================================================================
--- trunk/InventoryPlanningPrefSupplier.php 2012-04-01 16:54:04 UTC (rev 5192)
+++ trunk/InventoryPlanningPrefSupplier.php 2012-04-01 17:56:40 UTC (rev 5193)
@@ -466,9 +466,10 @@
echo '<p class="page_title_text"><img src="'.$rootpath.'/css/'.$theme.'/images/inventory.png" title="' . _('Search') . '" alt="" />' . ' ' . $title.'</p><br />';
- echo '<form action="' . htmlspecialchars($_SERVER['PHP_SELF'],ENT_QUOTES,'UTF-8') . '" method="post">
- <table class="selection">';
- echo '<input type="hidden" name="FormID" value="' . $_SESSION['FormID'] . '" />';
+ echo '<form action="' . htmlspecialchars($_SERVER['PHP_SELF'],ENT_QUOTES,'UTF-8') . '" method="post">';
+ echo '<div>';
+ echo '<input type="hidden" name="FormID" value="' . $_SESSION['FormID'] . '" />';
+ echo '<table class="selection">';
echo '<tr><td>' . _('For Inventory in Location') . ':</td>
<td><select name="Location">';
@@ -515,6 +516,8 @@
<div class="centre">
<input type="submit" name="PrintPDF" value="' . _('Print PDF') . '" />
</div>';
+ echo '</div>
+ </form>';
include('includes/footer.inc');
} /*end of else not PrintPDF */
Modified: trunk/InventoryQuantities.php
===================================================================
--- trunk/InventoryQuantities.php 2012-04-01 16:54:04 UTC (rev 5192)
+++ trunk/InventoryQuantities.php 2012-04-01 17:56:40 UTC (rev 5193)
@@ -159,6 +159,7 @@
echo '<br />
<br />
<form action="' . htmlspecialchars($_SERVER['PHP_SELF'],ENT_QUOTES,'UTF-8') . '" method="post">
+ <div>
<input type="hidden" name="FormID" value="' . $_SESSION['FormID'] . '" />
<table class="selection">
<tr>
@@ -208,7 +209,8 @@
<div class="centre">
<input type="submit" name="PrintPDF" value="' . _('Print PDF') . '" />
</div>';
-
+ echo '</div>
+ </form>';
include('includes/footer.inc');
} /*end of else not PrintPDF */
Modified: trunk/InventoryValuation.php
===================================================================
--- trunk/InventoryValuation.php 2012-04-01 16:54:04 UTC (rev 5192)
+++ trunk/InventoryValuation.php 2012-04-01 17:56:40 UTC (rev 5193)
@@ -206,8 +206,9 @@
</p>';
echo '<form action="' . htmlspecialchars($_SERVER['PHP_SELF'],ENT_QUOTES,'UTF-8') . '" method="post">
+ <div>
+ <input type="hidden" name="FormID" value="' . $_SESSION['FormID'] . '" />
<table class="selection">
- <input type="hidden" name="FormID" value="' . $_SESSION['FormID'] . '" />
<tr>
<td>' . _('From Inventory Category Code') . ':</td>
<td><select name="FromCriteria">';
@@ -267,6 +268,8 @@
<div class="centre">
<input type="submit" name="PrintPDF" value="' . _('Print PDF') . '" />
</div>';
+ echo '</div>
+ </form>';
}
include('includes/footer.inc');
Modified: trunk/includes/header.inc
===================================================================
--- trunk/includes/header.inc 2012-04-01 16:54:04 UTC (rev 5192)
+++ trunk/includes/header.inc 2012-04-01 17:56:40 UTC (rev 5193)
@@ -34,6 +34,7 @@
echo '</head>';
echo '<body>';
+ echo '<div id="canvas">';
echo '<table class="callout_main" cellpadding="0" cellspacing="0">';
echo '<tr>';
echo '<td colspan="2" rowspan="2">';
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|