From: <tu...@us...> - 2017-12-15 22:54:47
|
Revision: 7886 http://sourceforge.net/p/web-erp/reponame/7886 Author: turbopt Date: 2017-12-15 22:54:45 +0000 (Fri, 15 Dec 2017) Log Message: ----------- MRPPlannedPurchaseOrders.php, MRPPlannedWorkOrders.php: Fix PDF highlighting, PDF position value adjustments, and other minor tweaks. (Reported in forums by Paul Becker) Modified Paths: -------------- trunk/MRPPlannedPurchaseOrders.php trunk/MRPPlannedWorkOrders.php trunk/doc/Change.log Modified: trunk/MRPPlannedPurchaseOrders.php =================================================================== --- trunk/MRPPlannedPurchaseOrders.php 2017-12-15 01:06:48 UTC (rev 7885) +++ trunk/MRPPlannedPurchaseOrders.php 2017-12-15 22:54:45 UTC (rev 7886) @@ -149,26 +149,24 @@ while ($myrow = DB_fetch_array($result,$db)){ $YPos -=$line_height; - // Use to alternate between lines with transparent and painted background - if ($_POST['Fill'] == 'yes'){ - $fill=!$fill; - } - // Print information on part break - if ($Partctr > 0 & $holdpart != $myrow['part']) { + if ($Partctr > 0 AND $holdpart != $myrow['part']) { $pdf->addTextWrap(50,$YPos,130,$FontSize,$holddescription,'',0,$fill); $pdf->addTextWrap(180,$YPos,50,$FontSize,_('Unit Cost: '),'center',0,$fill); - $pdf->addTextWrap(230,$YPos,40,$FontSize,locale_number_format($holdcost,$_SESSION['CompanyRecord']['decimalplaces']),'right',0,$fill); - $pdf->addTextWrap(270,$YPos,50,$FontSize,locale_number_format($totalpartqty, $holddecimalplaces),'right',0,$fill); - $pdf->addTextWrap(320,$YPos,60,$FontSize,locale_number_format($totalpartcost,$_SESSION['CompanyRecord']['decimalplaces']),'right',0,$fill); - $pdf->addTextWrap(380,$YPos,30,$FontSize,_('M/B: '),'right',0,$fill); - $pdf->addTextWrap(410,$YPos,15,$FontSize,$holdmbflag,'right',0,$fill); + $pdf->addTextWrap(220,$YPos,40,$FontSize,locale_number_format($holdcost,$_SESSION['CompanyRecord']['decimalplaces']),'right',0,$fill); + $pdf->addTextWrap(260,$YPos,50,$FontSize,locale_number_format($totalpartqty, $holddecimalplaces),'right',0,$fill); + $pdf->addTextWrap(310,$YPos,60,$FontSize,locale_number_format($totalpartcost,$_SESSION['CompanyRecord']['decimalplaces']),'right',0,$fill); + $pdf->addTextWrap(370,$YPos,30,$FontSize,_('M/B: '),'right',0,$fill); + $pdf->addTextWrap(400,$YPos,15,$FontSize,$holdmbflag,'right',0,$fill); + // Get and print supplier info for part list($lastdate,$lastsupplier,$preferredsupplier) = GetPartInfo($db,$holdpart); $displaydate = $lastdate; + if (!Is_Date($lastdate)) { $displaydate = ' '; } + $YPos -= $line_height; $pdf->addTextWrap(50,$YPos,80,$FontSize,_('Last Purchase Date: '),'left',0,$fill); $pdf->addTextWrap(130,$YPos,60,$FontSize,$displaydate,'left',0,$fill); @@ -179,6 +177,11 @@ $totalpartcost = 0; $totalpartqty = 0; $YPos -= (2*$line_height); + + // Use to alternate between lines with transparent and painted background + if ($_POST['Fill'] == 'yes'){ + $fill=!$fill; + } } // Parameters for addTextWrap are defined in /includes/class.pdf.php @@ -193,12 +196,14 @@ $pdf->addTextWrap(200,$YPos,60,$FontSize,$FormatedSupMRPDate,'right',0,$fill); $pdf->addTextWrap(260,$YPos,50,$FontSize,locale_number_format($myrow['supplyquantity'],$myrow['decimalplaces']),'right',0,$fill); $pdf->addTextWrap(310,$YPos,60,$FontSize,locale_number_format($extcost,$_SESSION['CompanyRecord']['decimalplaces']),'right',0,$fill); + if ($_POST['Consolidation'] == 'None'){ $pdf->addTextWrap(370,$YPos,80,$FontSize,$myrow['ordertype'],'right',0,$fill); $pdf->addTextWrap(450,$YPos,80,$FontSize,$myrow['orderno'],'right',0,$fill); } else { $pdf->addTextWrap(370,$YPos,100,$FontSize,$myrow['consolidatedcount'],'right',0,$fill); - }; + } + $holddescription = $myrow['description']; $holdpart = $myrow['part']; $holdmbflag = $myrow['mbflag']; @@ -214,23 +219,26 @@ PrintHeader($pdf,$YPos,$PageNumber,$Page_Height,$Top_Margin,$Left_Margin,$Page_Width, $Right_Margin,$_POST['Consolidation'],$ReportDate); } + } /*end while loop */ - } /*end while loop */ // Print summary information for last part $YPos -=$line_height; - $pdf->addTextWrap(40,$YPos,130,$FontSize,$holddescription,'',0,$fill); - $pdf->addTextWrap(170,$YPos,50,$FontSize,_('Unit Cost: '),'center',0,$fill); + $pdf->addTextWrap(50,$YPos,130,$FontSize,$holddescription,'',0,$fill); + $pdf->addTextWrap(180,$YPos,50,$FontSize,_('Unit Cost: '),'center',0,$fill); $pdf->addTextWrap(220,$YPos,40,$FontSize,locale_number_format($holdcost,$_SESSION['CompanyRecord']['decimalplaces']),'right',0,$fill); $pdf->addTextWrap(260,$YPos,50,$FontSize,locale_number_format($totalpartqty,$holddecimalplaces),'right',0,$fill); $pdf->addTextWrap(310,$YPos,60,$FontSize,locale_number_format($totalpartcost,$_SESSION['CompanyRecord']['decimalplaces']),'right',0,$fill); $pdf->addTextWrap(370,$YPos,30,$FontSize,_('M/B: '),'right',0,$fill); $pdf->addTextWrap(400,$YPos,15,$FontSize,$holdmbflag,'right',0,$fill); + // Get and print supplier info for part list($lastdate,$lastsupplier,$preferredsupplier) = GetPartInfo($db,$holdpart); $displaydate = $lastdate; + if (!Is_Date($lastdate)) { $displaydate = ' '; } + $YPos -= $line_height; $pdf->addTextWrap(50,$YPos,80,$FontSize,_('Last Purchase Date: '),'left',0,$fill); $pdf->addTextWrap(130,$YPos,60,$FontSize,$displaydate,'left',0,$fill); @@ -246,7 +254,8 @@ $Right_Margin,$_POST['Consolidation'],$ReportDate); // include('includes/MRPPlannedPurchaseOrdersPageHeader.inc'); } -/*Print out the grand totals */ + + /*Print out the grand totals */ $pdf->addTextWrap($Left_Margin,$YPos,120,$FontSize,_('Number of Purchase Orders: '), 'left'); $pdf->addTextWrap(150,$YPos,30,$FontSize,$Partctr, 'left'); $pdf->addTextWrap(200,$YPos,100,$FontSize,_('Total Extended Cost:'), 'right'); @@ -255,7 +264,6 @@ $pdf->OutputD($_SESSION['DatabaseName'] . '_MRP_Planned_Purchase_Orders_' . Date('Y-m-d') . '.pdf'); $pdf->__destruct(); - } else { /*The option to print PDF was not hit so display form */ $Title=_('MRP Planned Purchase Orders Reporting'); Modified: trunk/MRPPlannedWorkOrders.php =================================================================== --- trunk/MRPPlannedWorkOrders.php 2017-12-15 01:06:48 UTC (rev 7885) +++ trunk/MRPPlannedWorkOrders.php 2017-12-15 22:54:45 UTC (rev 7886) @@ -68,7 +68,7 @@ stockmaster.overheadcost, computedcost ORDER BY mrpplannedorders.part,weekindex"; - } else { + } else { // This else consolidates by month $sql = "SELECT mrpplannedorders.part, SUM(mrpplannedorders.supplyquantity) as supplyquantity, EXTRACT(YEAR_MONTH from duedate) AS yearmonth, @@ -111,7 +111,7 @@ include('includes/footer.php'); exit; } - if (DB_num_rows($result)==0){ //then there's nothing to print + if (DB_num_rows($result)==0){ //then there is nothing to print $Title = _('MRP Planned Work Orders'); include('includes/header.php'); prnMsg(_('There were no items with demand greater than supply'),'info'); @@ -135,7 +135,7 @@ PrintHeader($pdf,$YPos,$PageNumber,$Page_Height,$Top_Margin,$Left_Margin, $Page_Width,$Right_Margin,$_POST['Consolidation'],$ReportDate); - $PartCounter = 0; + $Partctr = 0; $fill = false; $pdf->SetFillColor(224,235,255); // Defines color to make alternating lines highlighted $FontSize=8; @@ -151,18 +151,12 @@ while ($myrow = DB_fetch_array($result,$db)){ $YPos -=$line_height; - // Use to alternate between lines with transparent and painted background - if ($_POST['Fill'] == 'yes'){ - $fill=!$fill; - } - // Print information on part break - if ($PartCounter > 0 AND $HoldPart != $myrow['part']) { + if ($Partctr > 0 AND $HoldPart != $myrow['part']) { $pdf->addTextWrap(50,$YPos,130,$FontSize,$HoldDescription,'',0,$fill); - $pdf->addTextWrap(180,$YPos,40,$FontSize,_('Unit Cost: '),'center',0,$fill); + $pdf->addTextWrap(180,$YPos,50,$FontSize,_('Unit Cost: '),'center',0,$fill); $pdf->addTextWrap(220,$YPos,40,$FontSize,locale_number_format($HoldCost,$_SESSION['CompanyRecord']['decimalplaces']),'right',0,$fill); - $pdf->addTextWrap(260,$YPos,50,$FontSize,locale_number_format($TotalPartQty, - $HoldDecimalPlaces),'right',0,$fill); + $pdf->addTextWrap(260,$YPos,50,$FontSize,locale_number_format($TotalPartQty, $HoldDecimalPlaces),'right',0,$fill); $pdf->addTextWrap(310,$YPos,60,$FontSize,locale_number_format($TotalPartCost,$_SESSION['CompanyRecord']['decimalplaces']),'right',0,$fill); $pdf->addTextWrap(370,$YPos,30,$FontSize,_('M/B: '),'right',0,$fill); $pdf->addTextWrap(400,$YPos,15,$FontSize,$HoldMBFlag,'right',0,$fill); @@ -169,6 +163,11 @@ $TotalPartCost = 0; $TotalPartQty = 0; $YPos -= (2*$line_height); + + // Use to alternate between lines with transparent and painted background + if ($_POST['Fill'] == 'yes'){ + $fill=!$fill; + } } // Parameters for addTextWrap are defined in /includes/class.pdf.php @@ -181,15 +180,16 @@ $pdf->addTextWrap($Left_Margin,$YPos,110,$FontSize,$myrow['part'],'',0,$fill); $pdf->addTextWrap(150,$YPos,50,$FontSize,$FormatedSupDueDate,'right',0,$fill); $pdf->addTextWrap(200,$YPos,60,$FontSize,$FormatedSupMRPDate,'right',0,$fill); - $pdf->addTextWrap(260,$YPos,50,$FontSize,locale_number_format($myrow['supplyquantity'], - $myrow['decimalplaces']),'right',0,$fill); + $pdf->addTextWrap(260,$YPos,50,$FontSize,locale_number_format($myrow['supplyquantity'], $myrow['decimalplaces']),'right',0,$fill); $pdf->addTextWrap(310,$YPos,60,$FontSize,locale_number_format($ExtCost,$_SESSION['CompanyRecord']['decimalplaces']),'right',0,$fill); + if ($_POST['Consolidation'] == 'None'){ $pdf->addTextWrap(370,$YPos,80,$FontSize,$myrow['ordertype'],'right',0,$fill); $pdf->addTextWrap(450,$YPos,80,$FontSize,$myrow['orderno'],'right',0,$fill); } else { $pdf->addTextWrap(370,$YPos,100,$FontSize,$myrow['consolidatedcount'],'right',0,$fill); - }; + } + $HoldDescription = $myrow['description']; $HoldPart = $myrow['part']; $HoldMBFlag = $myrow['mbflag']; @@ -199,7 +199,7 @@ $TotalPartQty += $myrow['supplyquantity']; $Total_ExtCost += $ExtCost; - $PartCounter++; + $Partctr++; if ($YPos < $Bottom_Margin + $line_height){ PrintHeader($pdf,$YPos,$PageNumber,$Page_Height,$Top_Margin,$Left_Margin,$Page_Width, @@ -206,12 +206,12 @@ $Right_Margin,$_POST['Consolidation'],$ReportDate); // include('includes/MRPPlannedWorkOrdersPageHeader.inc'); } + } /*end while loop */ - } /*end while loop */ // Print summary information for last part $YPos -=$line_height; - $pdf->addTextWrap(40,$YPos,130,$FontSize,$HoldDescription,'',0,$fill); - $pdf->addTextWrap(170,$YPos,50,$FontSize,_('Unit Cost: '),'center',0,$fill); + $pdf->addTextWrap(50,$YPos,130,$FontSize,$HoldDescription,'',0,$fill); + $pdf->addTextWrap(180,$YPos,50,$FontSize,_('Unit Cost: '),'center',0,$fill); $pdf->addTextWrap(220,$YPos,40,$FontSize,locale_number_format($HoldCost,$_SESSION['CompanyRecord']['decimalplaces']),'right',0,$fill); $pdf->addTextWrap(260,$YPos,50,$FontSize,locale_number_format($TotalPartQty,$HoldDecimalPlaces),'right',0,$fill); $pdf->addTextWrap(310,$YPos,60,$FontSize,locale_number_format($TotalPartCost,$_SESSION['CompanyRecord']['decimalplaces']),'right',0,$fill); @@ -225,18 +225,16 @@ $Right_Margin,$_POST['Consolidation'],$ReportDate); // include('includes/MRPPlannedWorkOrdersPageHeader.inc'); } + /*Print out the grand totals */ $pdf->addTextWrap($Left_Margin,$YPos,120,$FontSize,_('Number of Work Orders: '), 'left'); - $pdf->addTextWrap(150,$YPos,30,$FontSize,$PartCounter, 'left'); + $pdf->addTextWrap(150,$YPos,30,$FontSize,$Partctr, 'left'); $pdf->addTextWrap(200,$YPos,100,$FontSize,_('Total Extended Cost:'), 'right'); - $DisplayTotalVal = locale_number_format($Total_ExtCost,2); + $DisplayTotalVal = locale_number_format($Total_ExtCost,$_SESSION['CompanyRecord']['decimalplaces']); $pdf->addTextWrap(310,$YPos,60,$FontSize,$DisplayTotalVal, 'right'); $pdf->OutputD($_SESSION['DatabaseName'] . '_MRP_Planned_Work_Orders_' . Date('Y-m-d') . '.pdf'); $pdf->__destruct(); - - - } else { // Review planned work orders $Title = _('Review/Convert MRP Planned Work Orders'); @@ -324,7 +322,7 @@ echo '<table class="selection">'; echo '<tr> <td>' . _('Consolidation') . ':</td> - <td><select name="Consolidation"> + <td><select required="required" name="Consolidation"> <option selected="selected" value="None">' . _('None') . '</option> <option value="Weekly">' . _('Weekly') . '</option> <option value="Monthly">' . _('Monthly') . '</option> @@ -331,8 +329,8 @@ </select></td> </tr> <tr> - <td>' . _('Print Option') . ':</td><td> - <select name="Fill"> + <td>' . _('Print Option') . ':</td> + <td><select name="Fill"> <option selected="selected" value="yes">' . _('Print With Alternating Highlighted Lines') . '</option> <option value="no">' . _('Plain Print') . '</option> </select></td> @@ -402,5 +400,5 @@ $FontSize=8; $YPos =$YPos - (2*$line_height); $PageNumber++; -} // End of PrintHeader() function +} // End of PrintHeader function ?> \ No newline at end of file Modified: trunk/doc/Change.log =================================================================== --- trunk/doc/Change.log 2017-12-15 01:06:48 UTC (rev 7885) +++ trunk/doc/Change.log 2017-12-15 22:54:45 UTC (rev 7886) @@ -1,6 +1,7 @@ webERP Change Log -11/13/17 PaulT: CustomerReceipt.php: Wrap delete link parameter values with urlencode(). (Suggested by Tim in forums) +11/14/17 PaulT: MRPPlannedPurchaseOrders.php, MRPPlannedWorkOrders.php: Fix PDF highlighting, PDF position value adjustments, and other minor tweaks. (Reported in forums by Paul Becker) +11/14/17 PaulT: CustomerReceipt.php: Wrap delete link parameter values with urlencode(). (Suggested by Tim in forums) 11/13/17 PaulT: PDFCOA.php: Add column prodspeckey to queries which is used as a description alternative. (Reported in forums by Paul Becker) 11/13/17 PaulT: PDFCOA.php, PDFProdSpec: Minor value adjust to correct inconsistent footer wrap. (Reported in forums by Paul Becker) 11/13/17 PaulT: HistoricalTestResults.php, SelectQASamples.php, TestPlanResults.php: Fix date inputs to work with the date picker. (Reported in forums by briantmg) |