From 21b6010d5ffe406ce51b4241f66edcc200f0a20f Mon Sep 17 00:00:00 2001 From: Paul Thursby Date: Tue, 27 Feb 2018 09:39:49 +0000 Subject: [PATCH] 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. --- MRPPlannedPurchaseOrders.php | 22 +++++++++------------- MRPPlannedWorkOrders.php | 22 +++++++++------------- doc/Change.log | 1 + 3 files changed, 19 insertions(+), 26 deletions(-) diff --git a/MRPPlannedPurchaseOrders.php b/MRPPlannedPurchaseOrders.php index d6d885636..f9bde5e1d 100644 --- a/MRPPlannedPurchaseOrders.php +++ b/MRPPlannedPurchaseOrders.php @@ -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 '
'; @@ -291,9 +288,11 @@ ' . _('Due Date') . ' ' . _('Quantity') . ' ' . _('Unit Cost') . ' - ' . _('Ext. Cost') . ' - ' . _('Consolidations') . ' - '; + ' . _('Ext. Cost') . ''; + if ($_POST['Consolidation']!='None') { + echo '' . _('Consolidations') . ''; + } + echo ''; $TotalPartQty = 0; $TotalPartCost = 0; @@ -317,9 +316,6 @@ if ($_POST['Consolidation']!='None') { echo '' . $myrow['consolidatedcount'] . ''; } - else { - echo ''; // Empty cell when Consolidation is None. - } echo ''; $j++; @@ -330,13 +326,13 @@ // Print out the grand totals echo ' ' . _('Number of Purchase Orders') .': ' . ($j-1) . ' - ' . _('Total Extended Cost') . ': ' . locale_number_format($Total_ExtCost,$_SESSION['CompanyRecord']['decimalplaces']) . ' + ' . _('Total Extended Cost') . ': ' . locale_number_format($Total_ExtCost,$_SESSION['CompanyRecord']['decimalplaces']) . ' '; - echo '
' . _('Back to the menu') . ''; + echo '
', _('Select different criteria.'), ''; include('includes/footer.php'); } // end Review planned purchase orders @@ -477,7 +473,7 @@ function GetPartInfo($part) { return $PartInfo; } else { - return array('','','',''); + return array('','','',1); } } diff --git a/MRPPlannedWorkOrders.php b/MRPPlannedWorkOrders.php index 571c924ea..b7d0dddd5 100755 --- a/MRPPlannedWorkOrders.php +++ b/MRPPlannedWorkOrders.php @@ -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 '
'; @@ -259,9 +256,11 @@ ' . _('Due Date') . ' ' . _('Quantity') . ' ' . _('Unit Cost') . ' - ' . _('Ext. Cost') . ' - ' . _('Consolidations') . ' - '; + ' . _('Ext. Cost') . ''; + if ($_POST['Consolidation'] != 'None') { + echo '' . _('Consolidations') . ''; + } + echo ''; $TotalPartQty = 0; $TotalPartCost = 0; @@ -280,12 +279,9 @@ ' . locale_number_format($myrow['computedcost'],$_SESSION['CompanyRecord']['decimalplaces']) . ' ' . locale_number_format($myrow['supplyquantity'] * $myrow['computedcost'],$_SESSION['CompanyRecord']['decimalplaces']) . ''; - if ($_POST['Consolidation']!='None') { + if ($_POST['Consolidation'] != 'None') { echo '' . $myrow['consolidatedcount'] . ''; } - else { - echo ''; // Empty cell when Consolidation is None. - } echo ''; $j++; @@ -296,13 +292,13 @@ // Print out the grand totals echo ' ' . _('Number of Work Orders') .': ' . ($j-1) . ' - ' . _('Total Extended Cost') . ': ' . locale_number_format($Total_ExtCost,$_SESSION['CompanyRecord']['decimalplaces']) . ' + ' . _('Total Extended Cost') . ': ' . locale_number_format($Total_ExtCost,$_SESSION['CompanyRecord']['decimalplaces']) . ' '; - echo '
' . _('Back to the menu') . ''; + echo '
', _('Select different criteria.'), ''; include('includes/footer.php'); } // end Review planned work orders diff --git a/doc/Change.log b/doc/Change.log index 8e9d7294d..8ac71f6df 100644 --- a/doc/Change.log +++ b/doc/Change.log @@ -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)