Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
Paul Becker (PaulT commit): AgedControlledInventory.php: Add UOM to o…
…utput. (Reported in forums: http://www.weberp.org/forum/showthread.php?tid=8091&pid=14286#pid14286)

Signed-off-by: Paul Thursby <pthursby2@gmail.com>
  • Loading branch information
Paul Becker authored and timschofield committed Feb 27, 2018
1 parent e840b53 commit 905e650
Show file tree
Hide file tree
Showing 2 changed files with 20 additions and 16 deletions.
35 changes: 19 additions & 16 deletions AgedControlledInventory.php
Expand Up @@ -11,15 +11,15 @@
include('includes/header.php');

echo '<p class="page_title_text">
<img src="'.$RootPath.'/css/'.$Theme.'/images/inventory.png" title="' . _('Inventory') .
'" alt="" /><b>' . $Title. '</b>
<img src="', $RootPath, '/css/', $Theme, '/images/inventory.png" title="', _('Inventory'), '" alt="" /><b>', $Title, '</b>
</p>';

$sql = "SELECT stockserialitems.stockid,
stockmaster.description,
stockserialitems.serialno,
stockserialitems.quantity,
stockmoves.trandate,
stockmaster.units,
stockmaster.materialcost+stockmaster.labourcost+stockmaster.overheadcost AS cost,
createdate,
decimalplaces
Expand All @@ -46,31 +46,33 @@

echo '<table>
<tr>
<th class="ascending">' . _('Stock') . '</th>
<th class="ascending">' . _('Description') . '</th>
<th class="ascending">' . _('Batch') . '</th>
<th class="ascending">' . _('Quantity Remaining') . '</th>
<th class="ascending">' . _('Inventory Value') . '</th>
<th class="ascending">' . _('Date') . '</th>
<th class="ascending">' . _('Days Old') . '</th>
<th class="ascending">', _('Stock'), '</th>
<th class="ascending">', _('Description'), '</th>
<th class="ascending">', _('Batch'), '</th>
<th class="ascending">', _('Quantity Remaining'), '</th>
<th class="ascending">', _('Units'), '</th>
<th class="ascending">', _('Inventory Value'), '</th>
<th class="ascending">', _('Date'), '</th>
<th class="ascending">', _('Days Old'), '</th>
</tr>';

while ($LocQtyRow=DB_fetch_array($LocStockResult)) {

$DaysOld=floor(($Today - strtotime($LocQtyRow['createdate']))/(60*60*24));
$TotalQty +=$LocQtyRow['quantity'];
$DaysOld = floor(($Today - strtotime($LocQtyRow['createdate']))/(60*60*24));
$TotalQty += $LocQtyRow['quantity'];
$DispVal = '-----------';

if (in_array($PricesSecurity, $_SESSION['AllowedPageSecurityTokens']) OR !isset($PricesSecurity)) {
$DispVal =locale_number_format(($LocQtyRow['quantity']*$LocQtyRow['cost']),$LocQtyRow['decimalplaces']);
$TotalVal +=($LocQtyRow['quantity'] *$LocQtyRow['cost']);
$DispVal = locale_number_format(($LocQtyRow['quantity']*$LocQtyRow['cost']),$LocQtyRow['decimalplaces']);
$TotalVal += ($LocQtyRow['quantity'] * $LocQtyRow['cost']);
}

printf('<tr class="striped_row">
<td>%s</td>
<td>%s</td>
<td>%s</td>
<td class="number">%s</td>
<td>%s</td>
<td class="number">%s</td>
<td>%s</td>
<td class="number">%s</td>
Expand All @@ -79,6 +81,7 @@
$LocQtyRow['description'],
$LocQtyRow['serialno'],
locale_number_format($LocQtyRow['quantity'],$LocQtyRow['decimalplaces']),
$LocQtyRow['units'],
$DispVal,
ConvertSQLDate($LocQtyRow['createdate']),
$DaysOld
Expand All @@ -87,9 +90,9 @@

echo '<tfoot>
<tr class="striped_row">
<td colspan="3"><b>' . _('Total') . '</b></td>
<td class="number"><b>' . locale_number_format($TotalQty,2) . '</b></td>
<td class="number"><b>' . locale_number_format($TotalVal,2) . '</b></td>
<td colspan="3"><b>', _('Total'), '</b></td>
<td class="number"><b>', locale_number_format($TotalQty,2), '</b></td>
<td class="number"><b>', locale_number_format($TotalVal,2), '</b></td>
<td colspan="2"></td>
</tr>
</tfoot>
Expand Down
1 change: 1 addition & 0 deletions doc/Change.log
@@ -1,5 +1,6 @@
webERP Change Log

16/2/18 Paul Becker (PaulT commit): AgedControlledInventory.php: Add UOM to output. (Reported in forums: http://www.weberp.org/forum/showthread.php?tid=8091&pid=14286#pid14286)
16/2/18 Paul Becker (PaulT commit): Z_ChangeSalesmanCode.php: New script to change a salesman code. (Forum contribution: http://www.weberp.org/forum/showthread.php?tid=8094)
13/2/18 Paul Becker (PaulT commit): InternalStockRequestFulfill.php: Minor change to remove number from input field committed with 7946, and add attributes on two input fields. (Reported in forums: http://www.weberp.org/forum/showthread.php?tid=8089&pid=14266#pid14266)
12/2/18 PaulT: Remove $db parameter from PeriodExists(), CreatePeriod(), CalcFreightCost(), CheckForRecursiveBOM(), DisplayBOMItems() and a few other functions.
Expand Down

0 comments on commit 905e650

Please sign in to comment.