Skip to content

Commit

Permalink
Tim/PaulT: MRPPlannedPurchaseOrders.php, MRPPlannedWorkOrders.php: Fi…
Browse files Browse the repository at this point in the history
…x conversion factor matter noted by Tim, use DB_table_exists() from commit 7943 to replace table check query, and minor rework to 'missing cell' handling from commit 7939.
  • Loading branch information
TurboPT authored and timschofield committed Feb 27, 2018
1 parent a35e497 commit 21b6010
Show file tree
Hide file tree
Showing 3 changed files with 19 additions and 26 deletions.
22 changes: 9 additions & 13 deletions MRPPlannedPurchaseOrders.php
Original file line number Diff line number Diff line change
Expand Up @@ -5,10 +5,7 @@

include('includes/session.php');

$sql = "SELECT TABLE_NAME FROM information_schema.tables WHERE TABLE_SCHEMA = '" . $_SESSION['DatabaseName'] . "' AND TABLE_NAME = 'mrprequirements'";
$result=DB_query($sql);

if (DB_num_rows($result)==0) {
if ( !DB_table_exists('mrprequirements') ) {
$Title=_('MRP error');
include('includes/header.php');
echo '<br />';
Expand Down Expand Up @@ -291,9 +288,11 @@
<th>' . _('Due Date') . '</th>
<th>' . _('Quantity') . '</th>
<th>' . _('Unit Cost') . '</th>
<th>' . _('Ext. Cost') . '</th>
<th>' . _('Consolidations') . '</th>
</tr>';
<th>' . _('Ext. Cost') . '</th>';
if ($_POST['Consolidation']!='None') {
echo '<th>' . _('Consolidations') . '</th>';
}
echo '</tr>';

$TotalPartQty = 0;
$TotalPartCost = 0;
Expand All @@ -317,9 +316,6 @@
if ($_POST['Consolidation']!='None') {
echo '<td class="number">' . $myrow['consolidatedcount'] . '</td>';
}
else {
echo '<td></td>'; // Empty cell when Consolidation is None.
}
echo '</tr>';

$j++;
Expand All @@ -330,13 +326,13 @@
// Print out the grand totals
echo '<tr>
<td colspan="3" class="number">' . _('Number of Purchase Orders') .': ' . ($j-1) . '</td>
<td colspan="4" class="number">' . _('Total Extended Cost') . ': ' . locale_number_format($Total_ExtCost,$_SESSION['CompanyRecord']['decimalplaces']) . '</td>
<td colspan="5" class="number">' . _('Total Extended Cost') . ': ' . locale_number_format($Total_ExtCost,$_SESSION['CompanyRecord']['decimalplaces']) . '</td>
</tr>
</table>
</div>
</form>';

echo '<br /><a href="' . $RootPath . '/index.php">' . _('Back to the menu') . '</a>';
echo '<br /><a class="noprint" href="', htmlspecialchars($_SERVER['PHP_SELF'], ENT_QUOTES, 'UTF-8'), '">', _('Select different criteria.'), '</a>';
include('includes/footer.php');

} // end Review planned purchase orders
Expand Down Expand Up @@ -477,7 +473,7 @@ function GetPartInfo($part) {

return $PartInfo;
} else {
return array('','','','');
return array('','','',1);
}
}

Expand Down
22 changes: 9 additions & 13 deletions MRPPlannedWorkOrders.php
Original file line number Diff line number Diff line change
Expand Up @@ -5,10 +5,7 @@

include('includes/session.php');

$sql = "SELECT TABLE_NAME FROM information_schema.tables WHERE TABLE_SCHEMA = '" . $_SESSION['DatabaseName'] . "' AND TABLE_NAME = 'mrprequirements'";
$result=DB_query($sql);

if (DB_num_rows($result)==0) {
if ( !DB_table_exists('mrprequirements') ) {
$Title=_('MRP error');
include('includes/header.php');
echo '<br />';
Expand Down Expand Up @@ -259,9 +256,11 @@
<th>' . _('Due Date') . '</th>
<th>' . _('Quantity') . '</th>
<th>' . _('Unit Cost') . '</th>
<th>' . _('Ext. Cost') . '</th>
<th>' . _('Consolidations') . '</th>
</tr>';
<th>' . _('Ext. Cost') . '</th>';
if ($_POST['Consolidation'] != 'None') {
echo '<th>' . _('Consolidations') . '</th>';
}
echo '</tr>';

$TotalPartQty = 0;
$TotalPartCost = 0;
Expand All @@ -280,12 +279,9 @@
<td class="number">' . locale_number_format($myrow['computedcost'],$_SESSION['CompanyRecord']['decimalplaces']) . '</td>
<td class="number">' . locale_number_format($myrow['supplyquantity'] * $myrow['computedcost'],$_SESSION['CompanyRecord']['decimalplaces']) . '</td>';

if ($_POST['Consolidation']!='None') {
if ($_POST['Consolidation'] != 'None') {
echo '<td class="number">' . $myrow['consolidatedcount'] . '</td>';
}
else {
echo '<td></td>'; // Empty cell when Consolidation is None.
}
echo '</tr>';

$j++;
Expand All @@ -296,13 +292,13 @@
// Print out the grand totals
echo '<tr>
<td colspan="3" class="number">' . _('Number of Work Orders') .': ' . ($j-1) . '</td>
<td colspan="4" class="number">' . _('Total Extended Cost') . ': ' . locale_number_format($Total_ExtCost,$_SESSION['CompanyRecord']['decimalplaces']) . '</td>
<td colspan="5" class="number">' . _('Total Extended Cost') . ': ' . locale_number_format($Total_ExtCost,$_SESSION['CompanyRecord']['decimalplaces']) . '</td>
</tr>
</table>
</div>
</form>';

echo '<br /><a href="' . $RootPath . '/index.php">' . _('Back to the menu') . '</a>';
echo '<br /><a class="noprint" href="', htmlspecialchars($_SERVER['PHP_SELF'], ENT_QUOTES, 'UTF-8'), '">', _('Select different criteria.'), '</a>';
include('includes/footer.php');

} // end Review planned work orders
Expand Down
1 change: 1 addition & 0 deletions doc/Change.log
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
webERP Change Log

9/2/18 Tim/PaulT: MRPPlannedPurchaseOrders.php, MRPPlannedWorkOrders.php: Fix conversion factor matter noted by Tim, use DB_table_exists() from commit 7943 to replace table check query, and minor rework to 'missing cell' handling from commit 7939.
9/2/18 PaulT: Replace old method of table row alternating color handing with improved CSS. Also, this change removes some empty/unused properties from a few css file and removes old URL 'SID' references in files already modified for this commit. Due to SVN issues with TestPlanResults.php, this one file will be committed later.
9/2/18 Tim (PaulT commit): ConnectDB_xxxx.inc files: Add function DB_table_exists() function to all DB support files, by Tim suggestion. Note that this function will be used in other files in a future commit.
7/2/18 Paul Becker (PaulT commit): Z_SalesIntegrityCheck.php: Fix that the does not take into account discountpercent so it shows an issue where non exists. (Reported in forums: http://www.weberp.org/forum/showthread.php?tid=8084)
Expand Down

0 comments on commit 21b6010

Please sign in to comment.