Skip to content

Commit

Permalink
Update WorkOrderCosting.php
Browse files Browse the repository at this point in the history
Updating missing commits to SVN commit 7944. (SVN trouble at SF)
  • Loading branch information
TurboPT committed Mar 1, 2018
1 parent a370b11 commit 1918333
Showing 1 changed file with 16 additions and 40 deletions.
56 changes: 16 additions & 40 deletions WorkOrderCosting.php
@@ -1,5 +1,5 @@
<?php
/* $Id$*/
/* $Id: WorkOrderCosting.php 7944 2018-02-09 18:22:45Z turbopt $*/

include('includes/session.php');
$Title = _('Work Order Costing');
Expand Down Expand Up @@ -153,7 +153,6 @@
stockmaster.decimalplaces,
worequirements.stdcost");

$k=0;
$TotalUsageVar =0;
$TotalCostVar =0;
$TotalIssuedCost=0;
Expand All @@ -162,13 +161,9 @@

while ($RequirementsRow = DB_fetch_array($RequirementsResult)){
$RequiredItems[] = $RequirementsRow['stockid'];
if ($k==1){
echo '<tr class="EvenTableRows">';
} else {
echo '<tr class="OddTableRows">';
}

echo '<td>' . $RequirementsRow['stockid'] . '</td>
echo '<tr class="striped_row">
<td>' . $RequirementsRow['stockid'] . '</td>
<td>' . $RequirementsRow['description'] . '</td>
</tr>';

Expand All @@ -187,31 +182,21 @@

if (DB_num_rows($IssuesResult)>0){
while ($IssuesRow = DB_fetch_array($IssuesResult)){
if ($k==1){
echo '<tr class="EvenTableRows">';
} else {
echo '<tr class="OddTableRows">';
}
echo '<td colspan="4"></td><td>' . ConvertSQLDate($IssuesRow['trandate']) . '</td>
echo '<tr class="striped_row">
<td colspan="4"></td>
<td>' . ConvertSQLDate($IssuesRow['trandate']) . '</td>
<td class="number">' . locale_number_format(-$IssuesRow['qty'],$RequirementsRow['decimalplaces']) . '</td>
<td class="number">' . locale_number_format(-($IssuesRow['qty']*$IssuesRow['standardcost']),$IssuesRow['decimalplaces']) . '</td></tr>';
<td class="number">' . locale_number_format(-($IssuesRow['qty']*$IssuesRow['standardcost']),$IssuesRow['decimalplaces']) . '</td>
</tr>';
$IssueQty -= $IssuesRow['qty'];// because qty for the stock movement will be negative
$IssueCost -= ($IssuesRow['qty']*$IssuesRow['standardcost']);

}
if ($k==1){
echo '<tr class="EvenTableRows">';
} else {
echo '<tr class="OddTableRows">';
}
echo '<td colspan="9"><hr /></td>

echo '<tr class="striped_row">
<td colspan="9"><hr /></td>
</tr>';
}
if ($k==1){
echo '<tr class="EvenTableRows">';
} else {
echo '<tr class="OddTableRows">';
}

if ($IssueQty != 0){
$CostVar = $IssueQty *(($RequirementsRow['stdcost']) -($IssueCost/$IssueQty));
Expand All @@ -221,7 +206,8 @@
/*Required quantity is the quantity required of the component based on the quantity of the finished item received */
$UsageVar =($RequirementsRow['requiredqty']-$IssueQty)*($RequirementsRow['stdcost']);

echo '<td colspan="2"></td>
echo '<tr class="striped_row">
<td colspan="2"></td>
<td class="number">' . locale_number_format($RequirementsRow['requiredqty'],$RequirementsRow['decimalplaces']) . '</td>
<td class="number">' . locale_number_format($RequirementsRow['expectedcost'],$_SESSION['CompanyRecord']['decimalplaces']) . '</td>
<td></td>
Expand All @@ -234,11 +220,7 @@
$TotalIssuedCost += $IssueCost;
$TotalCostVar += $CostVar;
$TotalUsageVar += $UsageVar;
if ($k==1){
$k=0;
} else {
$k++;
}

echo '<tr>
<td colspan="9"><hr /></td>
</tr>';
Expand Down Expand Up @@ -266,15 +248,9 @@

if (DB_num_rows($WOIssuesResult)>0){
while ($WOIssuesRow = DB_fetch_array($WOIssuesResult)){
if ($k==1){
echo '<tr class="EvenTableRows">';
$k=0;
} else {
echo '<tr class="OddTableRows">';
$k++;
}

echo '<td>' . $WOIssuesRow['stockid'] . '</td>
echo '<tr class="striped_row">
<td>' . $WOIssuesRow['stockid'] . '</td>
<td>' . $WOIssuesRow['description'] . '</td>
<td class="number">0</td>
<td class="number">0</td>
Expand Down

0 comments on commit 1918333

Please sign in to comment.