From: <tu...@us...> - 2018-02-09 19:48:24
|
Revision: 7945 http://sourceforge.net/p/web-erp/reponame/7945 Author: turbopt Date: 2018-02-09 19:48:22 +0000 (Fri, 09 Feb 2018) Log Message: ----------- 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. Modified Paths: -------------- trunk/MRPPlannedPurchaseOrders.php trunk/MRPPlannedWorkOrders.php trunk/doc/Change.log Modified: trunk/MRPPlannedPurchaseOrders.php =================================================================== --- trunk/MRPPlannedPurchaseOrders.php 2018-02-09 18:22:45 UTC (rev 7944) +++ trunk/MRPPlannedPurchaseOrders.php 2018-02-09 19:48:22 UTC (rev 7945) @@ -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 />'; @@ -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; @@ -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++; @@ -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 @@ -477,7 +473,7 @@ return $PartInfo; } else { - return array('','','',''); + return array('','','',1); } } Modified: trunk/MRPPlannedWorkOrders.php =================================================================== --- trunk/MRPPlannedWorkOrders.php 2018-02-09 18:22:45 UTC (rev 7944) +++ trunk/MRPPlannedWorkOrders.php 2018-02-09 19:48:22 UTC (rev 7945) @@ -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 />'; @@ -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; @@ -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++; @@ -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 Modified: trunk/doc/Change.log =================================================================== --- trunk/doc/Change.log 2018-02-09 18:22:45 UTC (rev 7944) +++ trunk/doc/Change.log 2018-02-09 19:48:22 UTC (rev 7945) @@ -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) |