From: <tim...@us...> - 2010-07-11 20:59:56
|
Revision: 3607 http://web-erp.svn.sourceforge.net/web-erp/?rev=3607&view=rev Author: tim_schofield Date: 2010-07-11 20:59:50 +0000 (Sun, 11 Jul 2010) Log Message: ----------- Bug fixes, layout changes, sql quoting fixed Modified Paths: -------------- trunk/InventoryQuantities.php trunk/doc/Change.log.html Modified: trunk/InventoryQuantities.php =================================================================== --- trunk/InventoryQuantities.php 2010-07-11 20:59:31 UTC (rev 3606) +++ trunk/InventoryQuantities.php 2010-07-11 20:59:50 UTC (rev 3607) @@ -27,9 +27,9 @@ $myrow = DB_fetch_row($result); $catdescription = $myrow[1]; } - + if ($_POST['Selection'] == 'All') { - $sql = 'SELECT locstock.stockid, + $sql = "SELECT locstock.stockid, stockmaster.description, locstock.loccode, locations.locationname, @@ -38,19 +38,19 @@ stockmaster.decimalplaces, stockmaster.serialised, stockmaster.controlled - FROM locstock, - stockmaster, + FROM locstock, + stockmaster, locations - WHERE locstock.stockid=stockmaster.stockid ' . - "AND locstock.loccode=locations.loccode + WHERE locstock.stockid=stockmaster.stockid + AND locstock.loccode=locations.loccode AND locstock.quantity <> 0 AND (stockmaster.mbflag='B' OR stockmaster.mbflag='M') " . - $wherecategory . ' ORDER BY locstock.stockid,locstock.loccode'; + $wherecategory . " ORDER BY locstock.stockid,locstock.loccode"; } else { // sql to only select parts in more than one location // The SELECT statement at the beginning of the WHERE clause limits the selection to // parts with quantity in more than one location - $sql = 'SELECT locstock.stockid, + $sql = "SELECT locstock.stockid, stockmaster.description, locstock.loccode, locations.locationname, @@ -59,22 +59,22 @@ stockmaster.decimalplaces, stockmaster.serialised, stockmaster.controlled - FROM locstock, - stockmaster, + FROM locstock, + stockmaster, locations - WHERE (SELECT count(*) + WHERE (SELECT count(*) FROM locstock WHERE stockmaster.stockid = locstock.stockid AND locstock.quantity <> 0 - GROUP BY locstock.stockid) > 1 - AND locstock.stockid=stockmaster.stockid ' . - "AND locstock.loccode=locations.loccode + GROUP BY locstock.stockid) > 1 + AND locstock.stockid=stockmaster.stockid + AND locstock.loccode=locations.loccode AND locstock.quantity <> 0 AND (stockmaster.mbflag='B' OR stockmaster.mbflag='M') " . - $wherecategory . ' ORDER BY locstock.stockid,locstock.loccode'; + $wherecategory . " ORDER BY locstock.stockid,locstock.loccode"; } - - + + $result = DB_query($sql,$db,'','',false,true); if (DB_error_no($db) !=0) { @@ -110,20 +110,19 @@ } else { $YPos -=($line_height); } - + // Parameters for addTextWrap are defined in /includes/class.pdf.php // 1) X position 2) Y position 3) Width // 4) Height 5) Text 6) Alignment 7) Border 8) Fill - True to use SetFillColor // and False to set to transparent - $pdf->addTextWrap(50,$YPos,100,$FontSize,$myrow['stockid'],'',0,$fill); - $pdf->addTextWrap(150,$YPos,150,$FontSize,$myrow['description'],'',0,$fill); - $pdf->addTextWrap(310,$YPos,60,$FontSize,$myrow['loccode'],'left',0,$fill); + $pdf->addTextWrap(50,$YPos,100,$FontSize,$myrow['stockid'],'',0); + $pdf->addTextWrap(150,$YPos,150,$FontSize,$myrow['description'],'',0); + $pdf->addTextWrap(310,$YPos,60,$FontSize,$myrow['loccode'],'left',0); $pdf->addTextWrap(370,$YPos,50,$FontSize,number_format($myrow['quantity'], - $myrow['decimalplaces']),'right',0,$fill); - $pdf->addTextWrap(420,$YPos,50,$FontSize,number_format($myrow['ReorderLevel'], - $myrow['decimalplaces']),'right',0,$fill); - $pdf->addTextWrap(480,$YPos,60,$FontSize,$myrow['loccount'],'left',0,$fill); + $myrow['decimalplaces']),'right',0); + $pdf->addTextWrap(420,$YPos,50,$FontSize,number_format($myrow['reorderlevel'], + $myrow['decimalplaces']),'right',0); if ($YPos < $Bottom_Margin + $line_height){ PrintHeader($pdf,$YPos,$PageNumber,$Page_Height,$Top_Margin,$Left_Margin,$Page_Width, @@ -136,7 +135,7 @@ $Right_Margin,$catdescription); } /*Print out the grand totals */ - + $pdf->OutputD($_SESSION['DatabaseName'] . '_Inventory_Quantities_' . Date('Y-m-d') . '.pdf'); $pdf->__destruct(); } else { /*The option to print PDF was not hit so display form */ @@ -148,13 +147,13 @@ echo '</br></br><form action=' . $_SERVER['PHP_SELF'] . " method='post'><table>"; - echo '<table><tr><td>'; + echo '<table class=selection><tr><td>'; echo '<tr><td>' . _('Selection') . ":</td><td><select name='Selection'>"; echo "<option selected value='All'>" . _('All'); echo "<option value='Multiple'>" . _('Only Parts With Multiple Locations'); echo '</select></td></tr>'; - - $SQL='SELECT categoryid, categorydescription FROM stockcategory ORDER BY categorydescription'; + + $SQL="SELECT categoryid, categorydescription FROM stockcategory ORDER BY categorydescription"; $result1 = DB_query($SQL,$db); if (DB_num_rows($result1)==0){ echo '</table></td></tr> @@ -165,7 +164,7 @@ include ('includes/footer.inc'); exit; } - + echo '<tr><td>' . _('In Stock Category') . ':</td><td><select name="StockCat">'; if (!isset($_POST['StockCat'])){ $_POST['StockCat']='All'; @@ -183,7 +182,7 @@ } } echo '</select></td></tr>'; - echo "</table></br><div class='centre'><input type=submit name='PrintPDF' value='" . _('Print PDF') . "'></div>"; + echo "</table><p><div class='centre'><input type=submit name='PrintPDF' value='" . _('Print PDF') . "'></div>"; include('includes/footer.inc'); @@ -199,23 +198,23 @@ $line_height=12; $FontSize=9; $YPos= $Page_Height-$Top_Margin; - + $pdf->addTextWrap($Left_Margin,$YPos,300,$FontSize,$_SESSION['CompanyRecord']['coyname']); - + $YPos -=$line_height; - - $pdf->addTextWrap($Left_Margin,$YPos,150,$FontSize,_('Inventory Quantities Report')); - $pdf->addTextWrap($Page_Width-$Right_Margin-150,$YPos,160,$FontSize,_('Printed') . ': ' . + + $pdf->addTextWrap($Left_Margin,$YPos,150,$FontSize,_('Inventory Quantities Report')); + $pdf->addTextWrap($Page_Width-$Right_Margin-150,$YPos,160,$FontSize,_('Printed') . ': ' . Date($_SESSION['DefaultDateFormat']) . ' ' . _('Page') . ' ' . $PageNumber,'left'); $YPos -= $line_height; $pdf->addTextWrap($Left_Margin,$YPos,50,$FontSize,_('Category')); $pdf->addTextWrap(95,$YPos,50,$FontSize,$_POST['StockCat']); $pdf->addTextWrap(160,$YPos,150,$FontSize,$catdescription,'left'); $YPos -=(2*$line_height); - + /*set up the headings */ $Xpos = $Left_Margin+1; - + $pdf->addTextWrap(50,$YPos,100,$FontSize,_('Part Number'), 'left'); $pdf->addTextWrap(150,$YPos,150,$FontSize,_('Description'), 'left'); $pdf->addTextWrap(310,$YPos,60,$FontSize,_('Location'), 'left'); @@ -229,4 +228,4 @@ // $YPos =$YPos - (2*$line_height); $PageNumber++; } // End of PrintHeader() function -?> +?> \ No newline at end of file Modified: trunk/doc/Change.log.html =================================================================== --- trunk/doc/Change.log.html 2010-07-11 20:59:31 UTC (rev 3606) +++ trunk/doc/Change.log.html 2010-07-11 20:59:50 UTC (rev 3607) @@ -1,5 +1,6 @@ <p><font SIZE=4 COLOR=BLUE><b>webERP Change Log</b></font></p> <p></p> +<p>11/07/10 Tim: InventoryPlanningPrefSupplier.php - Bug fixes, layout changes, sql quoting fixed</p> <p>11/07/10 Tim: InventoryPlanningPrefSupplier.php - Layout changes, sql quoting fixed</p> <p>11/07/10 Tim: InventoryPlanning.php - Layout changes, sql quoting fixed</p> <p>11/07/10 Tim: Goods Receiving - Fix conversion factor bug, layout changes, sql quoting fixed</p> This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |