From: <tim...@us...> - 2010-09-23 10:42:44
|
Revision: 3756 http://web-erp.svn.sourceforge.net/web-erp/?rev=3756&view=rev Author: tim_schofield Date: 2010-09-23 10:42:37 +0000 (Thu, 23 Sep 2010) Log Message: ----------- SQL quoting corrections Modified Paths: -------------- trunk/RecurringSalesOrdersProcess.php trunk/doc/Change.log.html Modified: trunk/RecurringSalesOrdersProcess.php =================================================================== --- trunk/RecurringSalesOrdersProcess.php 2010-09-23 09:38:43 UTC (rev 3755) +++ trunk/RecurringSalesOrdersProcess.php 2010-09-23 10:42:37 UTC (rev 3756) @@ -112,14 +112,14 @@ fromstkloc, deliverydate ) VALUES ( - " . $OrderNo . ", + '" . $OrderNo . "', '" . $RecurrOrderRow['debtorno'] . "', '" . $RecurrOrderRow['branchcode'] . "', '". $RecurrOrderRow['customerref'] ."', '". $RecurrOrderRow['comments'] ."', '" . $DelDate . "', '" . $RecurrOrderRow['ordertype'] . "', - " . $RecurrOrderRow['shipvia'] .", + '" . $RecurrOrderRow['shipvia'] ."', '" . $RecurrOrderRow['deliverto'] . "', '" . $RecurrOrderRow['deladd1'] . "', '" . $RecurrOrderRow['deladd2'] . "', @@ -129,7 +129,7 @@ '" . $RecurrOrderRow['deladd6'] . "', '" . $RecurrOrderRow['contactphone'] . "', '" . $RecurrOrderRow['contactemail'] . "', - " . $RecurrOrderRow['freightcost'] .", + '" . $RecurrOrderRow['freightcost'] ."', '" . $RecurrOrderRow['fromstkloc'] ."', '" . $DelDate . "')"; @@ -166,15 +166,15 @@ quantity, discountpercent, narrative) - VALUES (" . $OrderNo . ', '; + VALUES ('" . $OrderNo . "', "; while ($RecurrOrderLineRow=DB_fetch_array($LineItemsResult)) { $LineItemsSQL = $StartOf_LineItemsSQL . - ' ' . $LineCounter . ", + " '" . $LineCounter . "', '" . $RecurrOrderLineRow['stkcode'] . "', - ". $RecurrOrderLineRow['unitprice'] . ', - ' . $RecurrOrderLineRow['quantity'] . ', - ' . floatval($RecurrOrderLineRow['discountpercent']) . ", + '". $RecurrOrderLineRow['unitprice'] . "', + '" . $RecurrOrderLineRow['quantity'] . "', + '" . floatval($RecurrOrderLineRow['discountpercent']) . "', '" . $RecurrOrderLineRow['narrative'] . "')"; $Ins_LineItemResult = DB_query($LineItemsSQL,$db,_('Could not insert the order lines from the recurring order template'),true); /*Populating a new order line items*/ @@ -183,7 +183,7 @@ } //end if there are line items on the recurring order $sql = "UPDATE recurringsalesorders SET lastrecurrence = '" . $DelDate . "' - WHERE recurrorderno=" . $RecurrOrderRow['recurrorderno']; + WHERE recurrorderno='" . $RecurrOrderRow['recurrorderno'] ."'"; $ErrMsg = _('Could not update the last recurrence of the recurring order template. The database reported the error:'); $Result = DB_query($sql,$db,$ErrMsg,true); @@ -257,9 +257,9 @@ taxauthrates.taxauthority=taxgrouptaxes.taxauthid INNER JOIN taxauthorities ON taxauthrates.taxauthority=taxauthorities.taxid - WHERE taxgrouptaxes.taxgroupid=" . $RecurrOrderRow['taxgroupid'] . " - AND taxauthrates.dispatchtaxprovince=" . $DispTaxProvinceID . " - AND taxauthrates.taxcatid = " . $RecurrOrderLineRow['taxcatid'] . " + WHERE taxgrouptaxes.taxgroupid='" . $RecurrOrderRow['taxgroupid'] . "' + AND taxauthrates.dispatchtaxprovince='" . $DispTaxProvinceID . "' + AND taxauthrates.taxcatid = '" . $RecurrOrderLineRow['taxcatid'] . "' ORDER BY taxgrouptaxes.calculationorder"; $ErrMsg = _('The taxes and rates for this item could not be retrieved because'); @@ -307,7 +307,7 @@ SET qtyinvoiced = qtyinvoiced + " . $RecurrOrderLineRow['quantity'] . ", actualdispatchdate = '" . $DelDate . "', completed=1 - WHERE orderno = " . $OrderNo . " + WHERE orderno = '" . $OrderNo . "' AND stkcode = '" . $RecurrOrderLineRow['stkcode'] . "'"; $ErrMsg = _('CRITICAL ERROR') . '! ' . _('NOTE DOWN THIS ERROR AND SEEK ASSISTANCE') . ': ' . _('The sales order detail record could not be updated because'); @@ -337,16 +337,16 @@ VALUES ( '" . $RecurrOrderLineRow['stkcode'] . "', 10, - " . $InvoiceNo . ", + '" . $InvoiceNo . "', '" . $RecurrOrderRow['fromstkloc'] . "', '" . $DelDate . "', '" . $RecurrOrderRow['debtorno'] . "', '" . $RecurrOrderRow['branchcode'] . "', - " . $LocalCurrencyPrice . ", - " . $PeriodNo . ", + '" . $LocalCurrencyPrice . "', + '" . $PeriodNo . "', '" . $OrderNo . "', - " . -$RecurrOrderLineRow['quantity'] . ", - " . $RecurrOrderLineRow['discountpercent'] . ", + '" . -$RecurrOrderLineRow['quantity'] . "', + '" . $RecurrOrderLineRow['discountpercent'] . "', 0, '" . $RecurrOrderLineRow['narrative'] . "')"; @@ -360,16 +360,16 @@ /*Insert the taxes that applied to this line */ foreach ($LineTaxes[$LineCounter] as $Tax) { - $SQL = 'INSERT INTO stockmovestaxes (stkmoveno, + $SQL = "INSERT INTO stockmovestaxes (stkmoveno, taxauthid, taxrate, taxcalculationorder, taxontax) - VALUES (' . $StkMoveNo . ', - ' . $Tax['TaxAuthID'] . ', - ' . $Tax['TaxRate'] . ', - ' . $Tax['TaxCalculationOrder'] . ', - ' . $Tax['TaxOnTax'] . ')'; + VALUES ('" . $StkMoveNo . "', + '" . $Tax['TaxAuthID'] . "', + '" . $Tax['TaxRate'] . "', + '" . $Tax['TaxCalculationOrder'] . "', + '" . $Tax['TaxOnTax'] . "')"; $ErrMsg = _('CRITICAL ERROR') . '! ' . _('NOTE DOWN THIS ERROR AND SEEK ASSISTANCE') . ': ' . _('Taxes and rates applicable to this invoice line item could not be inserted because'); $DbgMsg = _('The following SQL to insert the stock movement tax detail records was used'); @@ -396,10 +396,10 @@ AND salesanalysis.area=custbranch.area AND salesanalysis.salesperson=custbranch.salesman AND salesanalysis.typeabbrev ='" . $RecurrOrderRow['ordertype'] . "' - AND salesanalysis.periodno=" . $PeriodNo . " - AND salesanalysis.cust " . LIKE . " '" . $RecurrOrderRow['debtorno'] . "' - AND salesanalysis.custbranch " . LIKE . " '" . $RecurrOrderRow['branchcode'] . "' - AND salesanalysis.stockid " . LIKE . " '" . $RecurrOrderLineRow['stkcode'] . "' + AND salesanalysis.periodno='" . $PeriodNo . "' + AND salesanalysis.cust LIKE '" . $RecurrOrderRow['debtorno'] . "' + AND salesanalysis.custbranch LIKE '" . $RecurrOrderRow['branchcode'] . "' + AND salesanalysis.stockid LIKE . '" . $RecurrOrderLineRow['stkcode'] . "' AND salesanalysis.budgetoractual=1 GROUP BY salesanalysis.stockid, salesanalysis.stkcategory, @@ -425,10 +425,10 @@ WHERE salesanalysis.area='" . $myrow[2] . "' AND salesanalysis.salesperson='" . $myrow[3] . "' AND typeabbrev ='" . $RecurrOrderRow['ordertype'] . "' - AND periodno = " . $PeriodNo . " - AND cust " . LIKE . " '" . $RecurrOrderRow['debtorno'] . "' - AND custbranch " . LIKE . " '" . $RecurrOrderRow['branchcode'] . "' - AND stockid " . LIKE . " '" . $RecurrOrderLineRow['stkcode'] . "' + AND periodno = '" . $PeriodNo . "' + AND cust LIKE '" . $RecurrOrderRow['debtorno'] . "' + AND custbranch LIKE '" . $RecurrOrderRow['branchcode'] . "' + AND stockid LIKE '" . $RecurrOrderLineRow['stkcode'] . "' AND salesanalysis.stkcategory ='" . $myrow[1] . "' AND budgetoractual=1"; @@ -450,13 +450,13 @@ stkcategory ) SELECT '" . $RecurrOrderRow['ordertype']. "', - " . $PeriodNo . ", - " . ($RecurrOrderLineRow['unitprice'] * $RecurrOrderLineRow['quantity'] / $CurrencyRate) . ", + '" . $PeriodNo . "', + '" . ($RecurrOrderLineRow['unitprice'] * $RecurrOrderLineRow['quantity'] / $CurrencyRate) . "', 0, '" . $RecurrOrderRow['debtorno'] . "', '" . $RecurrOrderRow['branchcode'] . "', - " . $RecurrOrderLineRow['quantity'] . ", - " . ($RecurrOrderLineRow['discountpercent'] * $RecurrOrderLineRow['unitprice'] * $RecurrOrderLineRow['quantity'] / $CurrencyRate) . ", + '" . $RecurrOrderLineRow['quantity'] . "', + '" . ($RecurrOrderLineRow['discountpercent'] * $RecurrOrderLineRow['unitprice'] * $RecurrOrderLineRow['quantity'] / $CurrencyRate) . "', '" . $RecurrOrderLineRow['stkcode'] . "', custbranch.area, 1, @@ -489,12 +489,12 @@ ) VALUES ( 10, - " . $InvoiceNo . ", + '" . $InvoiceNo . "', '" . $DelDate . "', - " . $PeriodNo . ", - " . $SalesGLAccounts['salesglcode'] . ", + '" . $PeriodNo . "', + '" . $SalesGLAccounts['salesglcode'] . "', '" . $RecurrOrderRow['debtorno'] . " - " . $RecurrOrderLineRow['stkcode'] . " x " . $RecurrOrderLineRow['quantity'] . " @ " . $RecurrOrderLineRow['unitprice'] . "', - " . (-$RecurrOrderLineRow['unitprice'] * $RecurrOrderLineRow['quantity']/$CurrencyRate) . " + '" . (-$RecurrOrderLineRow['unitprice'] * $RecurrOrderLineRow['quantity']/$CurrencyRate) . "' )"; $ErrMsg = _('CRITICAL ERROR') . '! ' . _('NOTE DOWN THIS ERROR AND SEEK ASSISTANCE') . ': ' . _('The sales GL posting could not be inserted because'); @@ -516,12 +516,12 @@ ) VALUES ( 10, - " . $InvoiceNo . ", + '" . $InvoiceNo . "', '" . $DelDate . "', - " . $PeriodNo . ", - " . $SalesGLAccounts['discountglcode'] . ", + '" . $PeriodNo . "', + '" . $SalesGLAccounts['discountglcode'] . "', '" . $RecurrOrderRow['debtorno'] . " - " . $RecurrOrderLineRow['stkcode'] . " @ " . ($RecurrOrderLineRow['discountpercent'] * 100) . "%', - " . ($RecurrOrderLineRow['unitprice'] * $RecurrOrderLineRow['quantity'] * $RecurrOrderLineRow['discountpercent']/$CurrencyRate) . " + '" . ($RecurrOrderLineRow['unitprice'] * $RecurrOrderLineRow['quantity'] * $RecurrOrderLineRow['discountpercent']/$CurrencyRate) . "' )"; $ErrMsg = _('CRITICAL ERROR') . '! ' . _('NOTE DOWN THIS ERROR AND SEEK ASSISTANCE') . ': ' . _('The sales discount GL posting could not be inserted because'); @@ -556,12 +556,12 @@ ) VALUES ( 10, - " . $InvoiceNo . ", + '" . $InvoiceNo . "', '" . $DelDate. "', - " . $PeriodNo . ", - " . $Tax['GLCode'] . ", + '" . $PeriodNo . "', + '" . $Tax['GLCode'] . "', '" . $RecurrOrderRow['debtorno'] . "-" . $Tax['TaxAuthDescription'] . "', - " . (-$Tax['FXAmount']/$CurrencyRate) . " + '" . (-$Tax['FXAmount']/$CurrencyRate) . "' )"; $ErrMsg = _('CRITICAL ERROR') . '! ' . _('NOTE DOWN THIS ERROR AND SEEK ASSISTANCE') . ': ' . _('The tax GL posting could not be inserted because'); @@ -583,12 +583,12 @@ ) VALUES ( 10, - " . $InvoiceNo . ", + '" . $InvoiceNo . "', '" . $DelDate . "', - " . $PeriodNo . ", - " . $_SESSION['CompanyRecord']['debtorsact'] . ", + '" . $PeriodNo . "', + '" . $_SESSION['CompanyRecord']['debtorsact'] . "', '" . $RecurrOrderRow['debtorno'] . "', - " . $TotalInvLocalCurr . " + '" . $TotalInvLocalCurr . "' )"; $ErrMsg = _('CRITICAL ERROR') . '! ' . _('NOTE DOWN THIS ERROR AND SEEK ASSISTANCE') . ': ' . _('The total debtor GL posting could not be inserted because'); @@ -610,12 +610,12 @@ ) VALUES ( 10, - " . $InvoiceNo . ", + '" . $InvoiceNo . "', '" . $DelDate . "', - " . $PeriodNo . ", - " . $_SESSION['CompanyRecord']['freightact'] . ", + '" . $PeriodNo . "', + '" . $_SESSION['CompanyRecord']['freightact'] . "', '" . $RecurrOrderRow['debtorno'] . "', - " . (-($RecurrOrderRow['freightcost'])/$CurrencyRate) . " + '" . (-($RecurrOrderRow['freightcost'])/$CurrencyRate) . "' )"; $ErrMsg = _('CRITICAL ERROR') . '! ' . _('NOTE DOWN THIS ERROR AND SEEK ASSISTANCE') . ': ' . _('The freight GL posting could not be inserted because'); @@ -625,7 +625,7 @@ } /*end of if Sales and GL integrated */ /*Update order header for invoice charged on */ - $SQL = "UPDATE salesorders SET comments = CONCAT(comments,' Inv ','" . $InvoiceNo . "') WHERE orderno= " . $OrderNo; + $SQL = "UPDATE salesorders SET comments = CONCAT(comments,' Inv ','" . $InvoiceNo . "') WHERE orderno= '" . $OrderNo . "'"; $ErrMsg = _('CRITICAL ERROR') . ' ' . _('NOTE DOWN THIS ERROR AND SEEK ASSISTANCE') . ': ' . _('The sales order header could not be updated with the invoice number'); $DbgMsg = _('The following SQL to update the sales order was used'); @@ -652,22 +652,22 @@ shipvia ) VALUES ( - ". $InvoiceNo . ", + '". $InvoiceNo . "', 10, '" . $RecurrOrderRow['debtorno'] . "', '" . $RecurrOrderRow['branchcode'] . "', '" . $DelDate . "', '" . date('Y-m-d H-i-s') . "', - " . $PeriodNo . ", + '" . $PeriodNo . "', '" . $RecurrOrderRow['customerref'] . "', '" . $RecurrOrderRow['sales_type'] . "', - " . $OrderNo . ", - " . $TotalFXNetInvoice . ", - " . $TotalFXTax . ", - " . $RecurrOrderRow['freightcost'] . ", - " . $CurrencyRate . ", + '" . $OrderNo . "', + '" . $TotalFXNetInvoice . "', + '" . $TotalFXTax . "', + '" . $RecurrOrderRow['freightcost'] . "', + '" . $CurrencyRate . "', '" . $RecurrOrderRow['comments'] . "', - " . $RecurrOrderRow['shipvia'] . ")"; + '" . $RecurrOrderRow['shipvia'] . "')"; $ErrMsg =_('CRITICAL ERROR') . '! ' . _('NOTE DOWN THIS ERROR AND SEEK ASSISTANCE') . ': ' . _('The debtor transaction record could not be inserted because'); $DbgMsg = _('The following SQL to insert the debtor transaction record was used'); @@ -676,12 +676,12 @@ $DebtorTransID = DB_Last_Insert_ID($db,'debtortrans','id'); - $SQL = 'INSERT INTO debtortranstaxes (debtortransid, + $SQL = "INSERT INTO debtortranstaxes (debtortransid, taxauthid, taxamount) - VALUES (' . $DebtorTransID . ', - ' . $TaxAuthID . ', - ' . $Tax['FXAmount']/$CurrencyRate . ')'; + VALUES ('" . $DebtorTransID . "', + '" . $TaxAuthID . "', + '" . $Tax['FXAmount']/$CurrencyRate . "')"; $ErrMsg =_('CRITICAL ERROR') . '! ' . _('NOTE DOWN THIS ERROR AND SEEK ASSISTANCE') . ': ' . _('The debtor transaction taxes records could not be inserted because'); $DbgMsg = _('The following SQL to insert the debtor transaction taxes record was used'); @@ -708,4 +708,4 @@ }/*end while there are recurring orders due to have a new order created */ include('includes/footer.inc'); -?> +?> \ No newline at end of file Modified: trunk/doc/Change.log.html =================================================================== --- trunk/doc/Change.log.html 2010-09-23 09:38:43 UTC (rev 3755) +++ trunk/doc/Change.log.html 2010-09-23 10:42:37 UTC (rev 3756) @@ -1,5 +1,6 @@ <p><font SIZE=4 COLOR=BLUE><b>webERP Change Log</b></font></p> <p></p> +<p>23/09/10 Tim: RecurringSalesOrdersProcess.php - SQL quoting corrections</p> <p>23/09/10 Tim: RecurringSalesOrders.php - SQL quoting corrections and layout changes and improvements</p> <p>23/09/10 Tim: DateFunctions.inc - mktime() function without paramaeters is now deprecated, replaced with time()</p> <p>20/09/10 Pak Ricard: PricesByCost.php - Restrict price changes to those stock items not discontinued</p> This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <tim...@us...> - 2010-09-23 10:53:38
|
Revision: 3757 http://web-erp.svn.sourceforge.net/web-erp/?rev=3757&view=rev Author: tim_schofield Date: 2010-09-23 10:53:32 +0000 (Thu, 23 Sep 2010) Log Message: ----------- SQL quoting corrections and layout changes and improvements Modified Paths: -------------- trunk/ReorderLevel.php trunk/doc/Change.log.html Modified: trunk/ReorderLevel.php =================================================================== --- trunk/ReorderLevel.php 2010-09-23 10:42:37 UTC (rev 3756) +++ trunk/ReorderLevel.php 2010-09-23 10:53:32 UTC (rev 3757) @@ -31,8 +31,8 @@ if ($_POST['StockLocation'] != 'All') { $wherelocation = " AND locstock.loccode='" . $_POST['StockLocation'] . "' "; } - - $sql = 'SELECT locstock.stockid, + + $sql = "SELECT locstock.stockid, stockmaster.description, locstock.loccode, locations.locationname, @@ -41,16 +41,16 @@ stockmaster.decimalplaces, stockmaster.serialised, stockmaster.controlled - FROM locstock, - stockmaster, + FROM locstock, + stockmaster, locations - WHERE locstock.stockid=stockmaster.stockid ' . - $wherelocation . + WHERE locstock.stockid=stockmaster.stockid " . + $wherelocation . "AND locstock.loccode=locations.loccode AND locstock.reorderlevel > locstock.quantity AND (stockmaster.mbflag='B' OR stockmaster.mbflag='M') " . - $wherecategory . ' ORDER BY locstock.loccode,locstock.stockid'; - + $wherecategory . " ORDER BY locstock.loccode,locstock.stockid"; + $result = DB_query($sql,$db,'','',false,true); if (DB_error_no($db) !=0) { @@ -81,18 +81,18 @@ // 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 + $fill = ''; + $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(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); + $shortage = $myrow['reorderlevel'] - $myrow['quantity']; + $pdf->addTextWrap(470,$YPos,50,$FontSize,number_format($shortage, + $myrow['decimalplaces']),'right',0,$fill); - $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(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); - $shortage = $myrow['reorderlevel'] - $myrow['quantity']; - $pdf->addTextWrap(470,$YPos,50,$FontSize,number_format($shortage, - $myrow['decimalplaces']),'right',0,$fill); - if ($YPos < $Bottom_Margin + $line_height){ PrintHeader($pdf,$YPos,$PageNumber,$Page_Height,$Top_Margin,$Left_Margin,$Page_Width, $Right_Margin,$catdescription); @@ -106,24 +106,24 @@ FROM locstock, stockmaster WHERE locstock.quantity > 0 AND locstock.quantity > reorderlevel - AND locstock.stockid = stockmaster.stockid + AND locstock.stockid = stockmaster.stockid AND locstock.stockid ='" . $myrow['stockid'] . "' AND locstock.loccode !='" . $myrow['loccode'] . "'"; $otherresult = DB_query($sql2,$db,'','',false,true); While ($myrow2 = DB_fetch_array($otherresult,$db)){ $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(310,$YPos,60,$FontSize,$myrow2['loccode'],'left',0,$fill); $pdf->addTextWrap(370,$YPos,50,$FontSize,number_format($myrow2['quantity'], $myrow2['decimalplaces']),'right',0,$fill); $pdf->addTextWrap(420,$YPos,50,$FontSize,number_format($myrow2['reorderlevel'], $myrow2['decimalplaces']),'right',0,$fill); - + if ($YPos < $Bottom_Margin + $line_height){ PrintHeader($pdf,$YPos,$PageNumber,$Page_Height,$Top_Margin,$Left_Margin,$Page_Width, $Right_Margin,$catdescription); @@ -163,20 +163,20 @@ $pdf->OutputI($_SESSION['DatabaseName'] . '_ReOrderLevel_' . date('Y-m-d') . '.pdf');//UldisN $pdf->__destruct(); //UldisN } - + } else { /*The option to print PDF was not hit so display form */ $title=_('Reorder Level Reporting'); include('includes/header.inc'); -echo '<p class="page_title_text"><img src="'.$rootpath.'/css/'.$theme.'/images/inventory.png" title="' . _('Inventory') . '" alt="">' . ' ' . _('Inventory Reorder Level Report') . ''; -echo '<div class="page_help_text">' . _('Use this report to display the reorder levels for Inventory items in different categories.') . '</div><br>'; + echo '<p class="page_title_text"><img src="'.$rootpath.'/css/'.$theme.'/images/inventory.png" title="' . _('Inventory') . '" alt="" />' . ' ' . _('Inventory Reorder Level Report') . '</p>'; + echo '<div class="page_help_text">' . _('Use this report to display the reorder levels for Inventory items in different categories.') . '</div><br>'; echo '</br></br><form action=' . $_SERVER['PHP_SELF'] . " method='post'><table>"; $sql = "SELECT loccode, locationname FROM locations"; - $resultStkLocs = DB_query($sql,$db); - echo '<table><tr><td>' . _('From Stock Location') . ':</td><td><select name="StockLocation"> '; + $resultStkLocs = DB_query($sql,$db); + echo '<table class=selection><tr><td>' . _('From Stock Location') . ':</td><td><select name="StockLocation"> '; if (!isset($_POST['StockLocation'])){ $_POST['StockLocation']='All'; } @@ -191,10 +191,10 @@ } else { echo '<option Value="' . $myrow['loccode'] . '">' . $myrow['locationname']; } - } + } 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> @@ -205,7 +205,7 @@ include ('includes/footer.inc'); exit; } - + echo '<tr><td>' . _('In Stock Category') . ':</td><td><select name="StockCat">'; if (!isset($_POST['StockCat'])){ $_POST['StockCat']='All'; @@ -223,7 +223,7 @@ } } echo '</select></td></tr>'; - echo "</table></br><div class='centre'><input type=submit name='PrintPDF' value='" . _('Print PDF') . "'></div>"; + echo "</table><br /><div class='centre'><input type=submit name='PrintPDF' value='" . _('Print PDF') . "'></div>"; include('includes/footer.inc'); @@ -239,13 +239,13 @@ $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,_('Reorder Level Report')); - $pdf->addTextWrap($Page_Width-$Right_Margin-150,$YPos,160,$FontSize,_('Printed') . ': ' . + + $pdf->addTextWrap($Left_Margin,$YPos,150,$FontSize,_('Reorder Level 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')); @@ -255,10 +255,10 @@ $pdf->addTextWrap($Left_Margin,$YPos,50,$FontSize,_('Location')); $pdf->addTextWrap(95,$YPos,50,$FontSize,$_POST['StockLocation']); $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'); @@ -273,4 +273,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-09-23 10:42:37 UTC (rev 3756) +++ trunk/doc/Change.log.html 2010-09-23 10:53:32 UTC (rev 3757) @@ -1,5 +1,6 @@ <p><font SIZE=4 COLOR=BLUE><b>webERP Change Log</b></font></p> <p></p> +<p>23/09/10 Tim: ReorderLevel.php - SQL quoting corrections and layout changes and improvements</p> <p>23/09/10 Tim: RecurringSalesOrdersProcess.php - SQL quoting corrections</p> <p>23/09/10 Tim: RecurringSalesOrders.php - SQL quoting corrections and layout changes and improvements</p> <p>23/09/10 Tim: DateFunctions.inc - mktime() function without paramaeters is now deprecated, replaced with time()</p> This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <tim...@us...> - 2010-09-23 10:59:03
|
Revision: 3758 http://web-erp.svn.sourceforge.net/web-erp/?rev=3758&view=rev Author: tim_schofield Date: 2010-09-23 10:58:56 +0000 (Thu, 23 Sep 2010) Log Message: ----------- SQL quoting corrections and layout changes and improvements Modified Paths: -------------- trunk/ReorderLevelLocation.php trunk/doc/Change.log.html trunk/index.php Modified: trunk/ReorderLevelLocation.php =================================================================== --- trunk/ReorderLevelLocation.php 2010-09-23 10:53:32 UTC (rev 3757) +++ trunk/ReorderLevelLocation.php 2010-09-23 10:58:56 UTC (rev 3758) @@ -11,7 +11,7 @@ include('includes/header.inc'); echo '<p class="page_title_text"><img src="'.$rootpath.'/css/'.$theme.'/images/inventory.png" title="' . _('Inventory') . '" alt="">' . ' ' . _('Inventory Reorder Level Location Report') . ''; - + if (isset($_POST['submit']) or isset($_POST['update'])) { if ($_POST['NumberOfDays']==""){ @@ -37,19 +37,19 @@ WHERE locstock.stockid = stockmaster.stockid AND stockmaster.categoryid = '" . $_POST['StockCat'] . "' AND locstock.loccode = '" . $_POST['StockLocation'] . "' - ORDER BY " . $order . " ASC"; + ORDER BY '" . $order . "' ASC"; $result = DB_query($sql,$db); - $sqlloc="SELECT locationname - FROM locations + $sqlloc="SELECT locationname + FROM locations WHERE loccode='".$_POST['StockLocation']."'"; - + $ResultLocation = DB_query($sqlloc,$db); $Location=DB_fetch_array($ResultLocation); - echo'<p class="page_title_text" align="center"><strong>' . _('Location : ') . '' . $Location['0'] . ' </strong></p>'; - echo'<p class="page_title_text" align="center"><strong>' . _('Number Of Days Sales : ') . '' . $_POST['NumberOfDays'] . '' . _(' Days ') . ' </strong></p>'; + echo'<p class="page_title_text" align="center"><strong>' . _('Location : ') . '' . $Location['0'] . ' </strong></p>'; + echo'<p class="page_title_text" align="center"><strong>' . _('Number Of Days Sales : ') . '' . $_POST['NumberOfDays'] . '' . _(' Days ') . ' </strong></p>'; echo "<table>"; echo '<tr><th>' . _('Code') . '</th> <th>' . _('Description') . '</th> @@ -65,11 +65,11 @@ while ($myrow=DB_fetch_array($result)) { - //update database if update pressed + //update database if update pressed if ($_POST['submit']=='Update'){ - $SQLUpdate="UPDATE locstock SET reorderlevel = '" . $_POST[$myrow['0']] . "' - WHERE `locstock`.`loccode` = '" . $_POST['StockLocation'] . "' + $SQLUpdate="UPDATE locstock SET reorderlevel = '" . $_POST[$myrow['0']] . "' + WHERE `locstock`.`loccode` = '" . $_POST['StockLocation'] . "' AND `locstock`.`stockid` = '" . $myrow['0'] . "'"; $Resultup = DB_query($SQLUpdate,$db); @@ -77,7 +77,7 @@ } if (isset($_POST[$myrow['0']])){ - $reorder=$_POST[$myrow['0']]; + $reorder=$_POST[$myrow['0']]; }else{ $reorder=$myrow[2]; } @@ -92,7 +92,7 @@ //variable for update data - echo'<input type="hidden" value=' . $_POST['order'] . ' name='. _('order').' /> + echo'<input type="hidden" value=' . $_POST['order'] . ' name='. _('order').' /> <input type="hidden" value=' . $_POST['StockLocation'] . ' name='. _('StockLocation').' /> <input type="hidden" value=' . $_POST['StockCat'] . ' name='. _('StockCat').' /> <input type="hidden" value=' . $_POST['NumberOfDays'] . ' name='. _('NumberOfDays').' /> @@ -124,17 +124,17 @@ //get On Hand all //find the quantity onhand item - $sqloh="SELECT sum(quantity)as qty - FROM `locstock` + $sqloh="SELECT sum(quantity)as qty + FROM `locstock` WHERE stockid='" . $myrow['0'] . "'"; $oh = db_query($sqloh,$db); $ohRow = db_fetch_row($oh); $ohRow[0]; - //get On Hand in Location - $sqlohin="SELECT SUM(quantity) AS qty - FROM `locstock` + //get On Hand in Location + $sqlohin="SELECT SUM(quantity) AS qty + FROM `locstock` WHERE stockid='" . $myrow['0'] . "' AND locstock.loccode = '" . $_POST['StockLocation'] . "'"; $ohin = db_query($sqlohin,$db); @@ -152,7 +152,7 @@ } //end of looping echo'<tr> - <td style="text-align:center" colspan=7><input type=submit name=submit value=' . _("Update") . '></td> + <td style="text-align:center" colspan=7><input type=submit name=submit value=' . _("Update") . '></td> </tr></form>'; @@ -165,8 +165,8 @@ $sql = "SELECT loccode, locationname FROM locations"; - $resultStkLocs = DB_query($sql,$db); - echo '<table> + $resultStkLocs = DB_query($sql,$db); + echo '<table class=selection> <tr> <td>' . _('Location') . ':</td> <td><select name="StockLocation"> '; @@ -175,19 +175,19 @@ echo '<option Value="' . $myrow['loccode'] . '">' . $myrow['locationname']; - } + } echo '</select></td></tr>'; - $SQL='SELECT categoryid, categorydescription - FROM stockcategory - ORDER BY categorydescription'; - - $result1 = DB_query($SQL,$db); + $SQL="SELECT categoryid, categorydescription + FROM stockcategory + ORDER BY categorydescription"; + $result1 = DB_query($SQL,$db); + echo '<tr><td>' . _('Category') . ':</td> <td><select name="StockCat">'; - while ($myrow1 = DB_fetch_array($result1)) { + while ($myrow1 = DB_fetch_array($result1)) { echo '<option value="' . $myrow1['categoryid'] . '">' . $myrow1['categorydescription']; } Modified: trunk/doc/Change.log.html =================================================================== --- trunk/doc/Change.log.html 2010-09-23 10:53:32 UTC (rev 3757) +++ trunk/doc/Change.log.html 2010-09-23 10:58:56 UTC (rev 3758) @@ -1,5 +1,6 @@ <p><font SIZE=4 COLOR=BLUE><b>webERP Change Log</b></font></p> <p></p> +<p>23/09/10 Tim: ReorderLevelLocation.php - SQL quoting corrections and layout changes and improvements</p> <p>23/09/10 Tim: ReorderLevel.php - SQL quoting corrections and layout changes and improvements</p> <p>23/09/10 Tim: RecurringSalesOrdersProcess.php - SQL quoting corrections</p> <p>23/09/10 Tim: RecurringSalesOrders.php - SQL quoting corrections and layout changes and improvements</p> Modified: trunk/index.php =================================================================== --- trunk/index.php 2010-09-23 10:53:32 UTC (rev 3757) +++ trunk/index.php 2010-09-23 10:58:56 UTC (rev 3758) @@ -637,6 +637,11 @@ </tr> <tr> <td class="menu_group_item"> + <?php echo '<p>• <a href="' . $rootpath . '/ReorderLevelLocation.php?' . SID . '">' . _('Reorder Level By Category/Location') . '</a></p>'; ?> + </td> + </tr> + <tr> + <td class="menu_group_item"> <?php echo '<p>• <a href="' . $rootpath . '/StockDispatch.php?' . SID . '">' . _('Stock Dispatch') . '</a></p>'; ?> </td> </tr> @@ -730,11 +735,6 @@ <?php echo '<p>• <a href="' . $rootpath . '/PricesByCost.php?' . SID . '">' . _('View or Update Prices Based On Costs') . '</a></p>'; ?> </td> </tr> - <tr> - <td class="menu_group_item"> - <?php echo '<p>• <a href="' . $rootpath . '/ReorderLevelLocation.php?' . SID . '">' . _('Reorder Level By Category/Location') . '</a></p>'; ?> - </td> - </tr> </table> </td> </tr> This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <tim...@us...> - 2010-09-23 11:58:00
|
Revision: 3759 http://web-erp.svn.sourceforge.net/web-erp/?rev=3759&view=rev Author: tim_schofield Date: 2010-09-23 11:57:54 +0000 (Thu, 23 Sep 2010) Log Message: ----------- SQL quoting corrections and layout changes and improvements Modified Paths: -------------- trunk/ReverseGRN.php trunk/doc/Change.log.html Modified: trunk/ReverseGRN.php =================================================================== --- trunk/ReverseGRN.php 2010-09-23 10:58:56 UTC (rev 3758) +++ trunk/ReverseGRN.php 2010-09-23 11:57:54 UTC (rev 3759) @@ -14,7 +14,7 @@ include('includes/header.inc'); -if ($_SESSION['SupplierID']!="" AND isset($_SESSION['SupplierID']) AND !isset($_POST['SupplierID']) OR $_POST['SupplierID']==""){ +if ((isset($_SESSION['SupplierID']) and $_SESSION['SupplierID']!="") or (!isset($_POST['SupplierID']) OR $_POST['SupplierID'])==""){ $_POST['SupplierID']=$_SESSION['SupplierID']; } if (!isset($_POST['SupplierID']) OR $_POST['SupplierID']==""){ @@ -28,7 +28,8 @@ $_POST['SuppName'] = $SuppRow[0]; } -echo '<div class="centre"><font size=4><b><U>' . _('Reverse Goods Received from') . ' ' . $_POST['SuppName'] . ' </U></b></font></div><br>'; +echo '<p class="page_title_text"><img src="'.$rootpath.'/css/'.$theme.'/images/supplier.png" title="' . _('Sales') . + '" alt="">' . ' ' . _('Reverse Goods Received from') . ' ' . $_POST['SuppName'] . '</p> '; if (isset($_GET['GRNNo']) AND isset($_POST['SupplierID'])){ /* SQL to process the postings for the GRN reversal.. */ @@ -48,7 +49,7 @@ FROM grns, purchorderdetails, purchorders WHERE grns.podetailitem=purchorderdetails.podetailitem AND purchorders.orderno = purchorderdetails.orderno - AND grnno=" . (int) $_GET['GRNNo']; + AND grnno='" . (int) $_GET['GRNNo'] . "'"; $ErrMsg = _('CRITICAL ERROR') . '! ' . _('NOTE DOWN THIS ERROR AND SEEK ASSISTANCE') . ': ' . _('Could not get the details of the GRN selected for reversal because') . ' '; $DbgMsg = _('The following SQL to retrieve the GRN details was used') . ':'; @@ -69,7 +70,7 @@ that came in with this GRN */ - $SQL = "SELECT stockmaster.controlled + $SQL = "SELECT stockmaster.controlled FROM stockmaster WHERE stockid ='" . $GRN['itemcode'] . "'"; $CheckControlledResult = DB_query($SQL,$db,'<br>' . _('Could not determine if the item was controlled or not because') . ' '); $ControlledRow = DB_fetch_row($CheckControlledResult); @@ -77,13 +78,13 @@ $Controlled = true; /*So check to ensure the serial items received on this GRN are still there */ /*First get the StockMovement Reference for the GRN */ - $SQL = "SELECT stockserialmoves.serialno, + $SQL = "SELECT stockserialmoves.serialno, stockserialmoves.moveqty - FROM stockmoves INNER JOIN stockserialmoves + FROM stockmoves INNER JOIN stockserialmoves ON stockmoves.stkmoveno= stockserialmoves.stockmoveno WHERE stockmoves.stockid='" . $GRN['itemcode'] . "' AND stockmoves.type =25 - AND stockmoves.transno=" . $GRN['grnbatch']; + AND stockmoves.transno='" . $GRN['grnbatch'] . "'"; $GetStockMoveResult = DB_query($SQL,$db,_('Could not retrieve the stock movement reference number which is required in order to retrieve details of the serial items that came in with this GRN')); while ($SerialStockMoves = DB_fetch_array($GetStockMoveResult)){ @@ -118,9 +119,9 @@ /*Now the SQL to do the update to the PurchOrderDetails */ $SQL = "UPDATE purchorderdetails - SET quantityrecd = quantityrecd - " . $QtyToReverse . ", + SET quantityrecd = quantityrecd - '" . $QtyToReverse . "', completed=0 - WHERE purchorderdetails.podetailitem = " . $GRN['podetailitem']; + WHERE purchorderdetails.podetailitem = '" . $GRN['podetailitem'] . "'"; $ErrMsg = _('CRITICAL ERROR') . '! ' . _('NOTE DOWN THIS ERROR AND SEEK ASSISTANCE') . ': ' . _('The purchase order detail record could not be updated with the quantity reversed because'); $DbgMsg = _('The following SQL to update the purchase order detail record was used'); @@ -130,7 +131,7 @@ $SQL = "UPDATE grns SET qtyrecd = qtyrecd - $QtyToReverse - WHERE grns.grnno=" . $_GET['GRNNo']; + WHERE grns.grnno='" . $_GET['GRNNo'] . "'"; $ErrMsg = _('CRITICAL ERROR') . '! ' . _('NOTE DOWN THIS ERROR AND SEEK ASSISTANCE') . ': ' . _('The GRN record could not be updated') . '. ' . _('This reversal of goods received has not been processed because'); $DbgMsg = _('The following SQL to insert the GRN record was used'); @@ -152,7 +153,7 @@ FROM locstock WHERE stockid='" . $GRN['itemcode'] . "' AND loccode= '" . $GRN['intostocklocation'] . "'"; - + $Result = DB_query($SQL, $db, _('Could not get the quantity on hand of the item before the reversal was processed'),_('The SQL that failed was'),true); if (DB_num_rows($Result)==1){ $LocQtyRow = DB_fetch_row($Result); @@ -187,15 +188,15 @@ VALUES ( '" . $GRN['itemcode'] . "', 25, - " . $_GET['GRNNo'] . ", + '" . $_GET['GRNNo'] . "', '" . $GRN['intostocklocation'] . "', '" . $GRN['deliverydate'] . "', - " . $PeriodNo . ", + '" . $PeriodNo . "', '" . _('Reversal') . ' - ' . $_POST['SupplierID'] . ' - ' . $GRN['orderno'] . "', - " . -$QtyToReverse . ', - ' . $GRN['stdcostunit'] . ', - ' . ($QtyOnHandPrior - $QtyToReverse) . ' - )'; + '" . -$QtyToReverse . "', + '" . $GRN['stdcostunit'] . "', + '" . ($QtyOnHandPrior - $QtyToReverse) . "' + )"; $ErrMsg = _('CRITICAL ERROR') . '! ' . _('NOTE DOWN THIS ERROR AND SEEK ASSISTANCE') . ': ' . _('Stock movement records could not be inserted because'); $DbgMsg = _('The following SQL to insert the stock movement records was used'); @@ -211,10 +212,10 @@ serialno, moveqty) VALUES ( - " . $StkMoveNo . ", + '" . $StkMoveNo . "', '" . $GRN['itemcode'] . "', '" . $SerialStockMoves['serialno'] . "', - " . -$SerialStockMoves['moveqty'] . ")"; + '" . -$SerialStockMoves['moveqty'] . "')"; $result = DB_query($SQL,$db,_('Could not insert the reversing stock movements for the batch/serial numbers'),_('The SQL used but failed was') . ':',true); $SQL = "UPDATE stockserialitems @@ -243,12 +244,12 @@ amount) VALUES ( 25, - " . $_GET['GRNNo'] . ", + '" . $_GET['GRNNo'] . "', '" . $GRN['deliverydate'] . "', - " . $PeriodNo . ", - " . $GRN['glcode'] . ", + '" . $PeriodNo . "', + '" . $GRN['glcode'] . "', '" . _('GRN Reversal for PO') .": " . $GRN['orderno'] . " " . $_POST['SupplierID'] . " - " . $GRN['itemcode'] . "-" . $GRN['itemdescription'] . " x " . $QtyToReverse . " @ " . number_format($GRN['stdcostunit'],2) . "', - " . -($GRN['stdcostunit'] * $QtyToReverse) . " + '" . -($GRN['stdcostunit'] * $QtyToReverse) . "' )"; $ErrMsg = _('CRITICAL ERROR') . '! ' . _('NOTE DOWN THIS ERROR AND SEEK ASSISTANCE') . ': ' . _('The purchase GL posting could not be inserted for the reversal of the received item because'); @@ -266,12 +267,12 @@ amount) VALUES ( 25, - " . $_GET['GRNNo'] . ", + '" . $_GET['GRNNo'] . "', '" . $GRN['deliverydate'] . "', - " . $PeriodNo . ", - " . $_SESSION['CompanyRecord']['grnact'] . ", '" + '" . $PeriodNo . "', + '" . $_SESSION['CompanyRecord']['grnact'] . "', '" . _('GRN Reversal PO') . ': ' . $GRN['orderno'] . " " . $_POST['SupplierID'] . " - " . $GRN['itemcode'] . "-" . $GRN['itemdescription'] . " x " . $QtyToReverse . " @ " . number_format($GRN['stdcostunit'],2) . "', - " . $GRN['stdcostunit'] * $QtyToReverse . " + '" . $GRN['stdcostunit'] * $QtyToReverse . "' )"; $ErrMsg = _('CRITICAL ERROR') . '! ' . _('NOTE DOWN THIS ERROR AND SEEK ASSISTANCE') . ': ' . _('The GRN suspense side of the GL posting could not be inserted because'); @@ -293,13 +294,14 @@ if (!isset($_POST['RecdAfterDate']) OR !Is_Date($_POST['RecdAfterDate'])) { $_POST['RecdAfterDate'] = Date($_SESSION['DefaultDateFormat'],Mktime(0,0,0,Date("m")-3,Date("d"),Date("Y"))); } - + echo '<table class=selection><tr>'; echo '<input type=hidden name="SupplierID" VALUE="' . $_POST['SupplierID'] . '">'; echo '<input type=hidden name="SuppName" VALUE="' . $_POST['SuppName'] . '">'; - echo _('Show all goods received after') . ': <input type=text class=date alt="'.$_SESSION['DefaultDateFormat'].'" name="RecdAfterDate" Value="' . $_POST['RecdAfterDate'] . '" MAXLENGTH =10 size=10> - <input type=submit name="ShowGRNS" VALUE=' . _('Show Outstanding Goods Received') . '>'; - - + echo '<td>'._('Show all goods received after') . ': </td><td><input type=text class=date alt="'. + $_SESSION['DefaultDateFormat'].'" name="RecdAfterDate" Value="' . $_POST['RecdAfterDate'] . + '" MAXLENGTH =10 size=10></td></tr>';; + echo '</table>'; + echo '<br /><div class=centre><input type=submit name="ShowGRNS" VALUE=' . _('Show Outstanding Goods Received') . '></div>'; if (isset($_POST['ShowGRNS'])){ $sql = "SELECT grnno, @@ -321,7 +323,7 @@ prnMsg(_('There are no outstanding goods received yet to be invoiced for') . ' ' . $_POST['SuppName'] . '.<br>' . _('To reverse a GRN that has been invoiced first it must be credited'),'warn'); } else { //there are GRNs to show - echo '<table cellpadding=2 colspan=7 border=0>'; + echo '<br /><table cellpadding=2 colspan=7 class=selection>'; $TableHeader = '<tr> <th>' . _('GRN') . ' #</th> <th>' . _('Item Code') . '</th> @@ -351,7 +353,7 @@ $DisplayQtyRev = number_format($myrow['qtytoreverse'],2); $DisplayDateDel = ConvertSQLDate($myrow['deliverydate']); $LinkToRevGRN = '<a href="' . $_SERVER['PHP_SELF'] . '?' . SID . '&GRNNo=' . $myrow['grnno'] . '">' . _('Reverse') . '</a>'; - + printf("<td>%s</td> <td>%s</td> <td>%s</td> Modified: trunk/doc/Change.log.html =================================================================== --- trunk/doc/Change.log.html 2010-09-23 10:58:56 UTC (rev 3758) +++ trunk/doc/Change.log.html 2010-09-23 11:57:54 UTC (rev 3759) @@ -1,5 +1,6 @@ <p><font SIZE=4 COLOR=BLUE><b>webERP Change Log</b></font></p> <p></p> +<p>23/09/10 Tim: ReverseGRN.php - SQL quoting corrections and layout changes and improvements</p> <p>23/09/10 Tim: ReorderLevelLocation.php - SQL quoting corrections and layout changes and improvements</p> <p>23/09/10 Tim: ReorderLevel.php - SQL quoting corrections and layout changes and improvements</p> <p>23/09/10 Tim: RecurringSalesOrdersProcess.php - SQL quoting corrections</p> This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <tim...@us...> - 2010-09-23 13:33:26
|
Revision: 3760 http://web-erp.svn.sourceforge.net/web-erp/?rev=3760&view=rev Author: tim_schofield Date: 2010-09-23 13:33:16 +0000 (Thu, 23 Sep 2010) Log Message: ----------- SQL quoting corrections and layout changes and improvements Modified Paths: -------------- trunk/SalesAnalReptCols.php trunk/doc/Change.log.html Modified: trunk/SalesAnalReptCols.php =================================================================== --- trunk/SalesAnalReptCols.php 2010-09-23 11:57:54 UTC (rev 3759) +++ trunk/SalesAnalReptCols.php 2010-09-23 13:33:16 UTC (rev 3760) @@ -48,6 +48,7 @@ } /* end of functions Right ... now to the meat */ +echo '<p class="page_title_text"><img src="'.$rootpath.'/css/'.$theme.'/images/supplier.png" title="' . _('Search') . '" alt="">' . ' ' . $title . '</p>'; if (isset($_GET['SelectedCol'])){ $SelectedCol = $_GET['SelectedCol']; @@ -102,24 +103,24 @@ } - if ($SelectedCol AND $InputError !=1) { + if (isset($SelectedCol) AND $InputError !=1) { $sql = "UPDATE reportcolumns SET heading1='" . $_POST['Heading1'] . "', heading2='" . $_POST['Heading2'] . "', - calculation=" . $_POST['Calculation'] . ", - periodfrom=" . $_POST['PeriodFrom'] . ", - periodto=" . $_POST['PeriodTo'] . ", + calculation='" . $_POST['Calculation'] . "', + periodfrom='" . $_POST['PeriodFrom'] . "', + periodto='" . $_POST['PeriodTo'] . "', datatype='" . $_POST['DataType'] . "', - colnumerator=" . $_POST['ColNumerator'] . ", - coldenominator=" . $_POST['ColDenominator'] . ", + colnumerator='" . $_POST['ColNumerator'] . "', + coldenominator='" . $_POST['ColDenominator'] . "', calcoperator='" . $_POST['CalcOperator'] . "', - budgetoractual=" . $_POST['BudgetOrActual'] . ", + budgetoractual='" . $_POST['BudgetOrActual'] . "', valformat='" . $_POST['ValFormat'] . "', - constant = " . $_POST['Constant'] . " + constant = '" . $_POST['Constant'] . "' WHERE - reportid = $ReportID AND - colno=$SelectedCol"; + reportid = '".$ReportID."' AND + colno='". $SelectedCol ."'"; $ErrMsg = _('The report column could not be updated because'); $DbgMsg = _('The SQL used to update the report column was'); @@ -141,9 +142,9 @@ unset($_POST['BudgetOrActual']); - } elseif ($InputError !=1 AND - (($_POST['Calculation']==1 AND - (($_POST['ColNumerator']>0 AND $_POST['Constant']!=0) OR ($_POST['ColNumerator']>0 AND $_POST['ColDenominator']>0)) + } elseif ($InputError !=1 AND + (($_POST['Calculation']==1 AND + (($_POST['ColNumerator']>0 AND $_POST['Constant']!=0) OR ($_POST['ColNumerator']>0 AND $_POST['ColDenominator']>0)) OR $_POST['Calculation']==0))) { /*SelectedReport is null cos no item selected on first time round so must be adding a new column to the report */ @@ -234,10 +235,10 @@ FROM reportheaders, reportcolumns - WHERE reportheaders.reportid = reportcolumns.reportid - AND reportcolumns.reportid=$ReportID + WHERE reportheaders.reportid = reportcolumns.reportid + AND reportcolumns.reportid='".$ReportID. "' ORDER BY reportcolumns.colno"; - + $ErrMsg = _('The column definitions could not be retrieved from the database because'); $DbgMsg = _('The SQL used to retrieve the columns for the report was'); $result = DB_query($sql,$db,$ErrMsg,$DbgMsg); @@ -245,7 +246,7 @@ if (DB_num_rows($result)!=0){ $myrow = DB_fetch_array($result); - echo '<div class="centre"><b>' . $myrow['reportheading'] . "</b><br></div><table border=1>\n"; + echo '<div class="centre"><b>' . $myrow['reportheading'] . "</b><br></div><table class=selection>\n"; echo '<tr><th>' . _('Col') . ' #</th> <th>' . _('Heading 1') . '</th> <th>' . _('Heading 2') . '</th>'; @@ -320,7 +321,12 @@ if (!isset($_GET['delete'])) { + $sql = "SELECT reportheading FROM reportheaders WHERE reportid='".$ReportID."'"; + $result = DB_query($sql, $db); + $myrow=DB_fetch_array($result); + $ReportHeading=$myrow['reportheading']; echo '<form method="post" action=' . $_SERVER['PHP_SELF'] . '?' . SID . '>'; + echo '<input type="hidden" name="ReportHeading" value='.$ReportHeading.'>'; echo '<input type=hidden name="ReportID" VALUE=' . $ReportID . '>'; if (isset($SelectedCol)) { //editing an existing Column @@ -342,8 +348,8 @@ FROM reportcolumns WHERE - reportcolumns.reportid=$ReportID AND - reportcolumns.colno=$SelectedCol"; + reportcolumns.reportid='".$ReportID."' AND + reportcolumns.colno='". $SelectedCol ."'"; $ErrMsg = _('The column') . ' ' . $SelectedCol . ' ' . _('could not be retrieved because'); @@ -367,18 +373,29 @@ $_POST['ValFormat']=$myrow['valformat']; echo '<input type=hidden name="SelectedCol" VALUE=' . $SelectedCol . '>'; - echo '<table>'; + echo '<table class=selection>'; } else { - echo '<table>'; + echo '<table class=selection>'; + if (!isset($_POST['ColID'])) { + $_POST['ColID']=1; + } echo '<tr><td>' . _('Column Number') . ':</td> - <td><input type="TEXT" class=number name=ColID size=3 maxlength=3 Value=' . $_POST['ColID'] . '><font size=1>(' . _('A number between 1 and 10 is expected') . ')</td>'; + <td><input type="text" class=number name=ColID size=3 maxlength=3 Value=' . $_POST['ColID'] . '> <font size=1>(' . _('A number between 1 and 10 is expected') . ')</td>'; } - + if (!isset($_POST['Heading1'])) { + $_POST['Heading1']=''; + } echo '<tr><td>' . _('Heading line 1') . ':</td> <td><input type="TEXT" size=16 maxlength=15 name="Heading1" value="' . $_POST['Heading1'] . '"></td></tr>'; + if (!isset($_POST['Heading2'])) { + $_POST['Heading2']=''; + } echo '<tr><td>' . _('Heading line 2') . ':</td><td><input type="TEXT" size=16 maxlength=15 name="Heading2" value="' . $_POST['Heading2'] . '"></td></tr>'; echo '<tr><td>' . _('Calculation') . ':</td><td><select name="Calculation">'; + if (!isset($_POST['Calculation'])) { + $_POST['Calculation']=0; + } if ($_POST['Calculation'] ==1){ echo '<option selected Value=1>' . _('Yes'); echo '<option Value=0>' . _('No'); @@ -389,8 +406,35 @@ echo '</select></td></tr>'; if ($_POST['Calculation']==0){ /*Its not a calculated column */ - echo '<tr><td>' . _('From Period') . ':</td><td><input type="TEXT" class=number size=4 maxlength=3 name="PeriodFrom" value=' . $_POST['PeriodFrom'] . '> <a target="_blank" href="' . $rootpath . '/PeriodsInquiry.php?' . SID . '">' . _('View Periods') . '</a></td></tr>'; - echo '<tr><td>' . _('To Period') . ':</td><td><input type="TEXT" class=number size=4 maxlength=3 name="PeriodTo" value=' . $_POST['PeriodTo'] . '></td></tr>'; + + echo '<tr><td>' . _('From Period') . ':</td> + <td><select name="PeriodFrom"'; + $sql = 'SELECT periodno, lastdate_in_period FROM periods ORDER BY periodno DESC'; + $ErrMsg = _('Could not load periods table'); + $result = DB_query($sql,$db,$ErrMsg); + while ($PeriodRow = DB_fetch_row($result)){ + if ($_POST['PeriodFrom']==$PeriodRow[0]){ + echo '<option selected value="' . $PeriodRow[0] . '">' . ConvertSQLDate($PeriodRow[1]) . '</option>'; + } else { + echo '<option value="' . $PeriodRow[0] . '">' . ConvertSQLDate($PeriodRow[1]) . '</option>'; + } + } + echo '</select></td></tr>'; + + echo '<tr><td>' . _('ToPeriod') . ':</td> + <td><select name="PeriodTo"'; + $sql = 'SELECT periodno, lastdate_in_period FROM periods ORDER BY periodno DESC'; + $ErrMsg = _('Could not load periods table'); + $result = DB_query($sql,$db,$ErrMsg); + while ($PeriodRow = DB_fetch_row($result)){ + if ($_POST['PeriodTo']==$PeriodRow[0]){ + echo '<option selected value="' . $PeriodRow[0] . '">' . ConvertSQLDate($PeriodRow[1]) . '</option>'; + } else { + echo '<option value="' . $PeriodRow[0] . '">' . ConvertSQLDate($PeriodRow[1]) . '</option>'; + } + } + echo '</select></td></tr>'; + echo '<tr><td>' . _('Data to show') . ':</td><td><select name="DataType">'; DataOptions($_POST['DataType']); echo '</select></td></tr>'; @@ -462,7 +506,7 @@ echo '</table>'; - echo '<div class="centre"><input type="Submit" name="submit" value="' . _('Enter Information') . '"></div></form>'; + echo '<br /><div class="centre"><input type="Submit" name="submit" value="' . _('Enter Information') . '"></div></form>'; } //end if record deleted no point displaying form to add record Modified: trunk/doc/Change.log.html =================================================================== --- trunk/doc/Change.log.html 2010-09-23 11:57:54 UTC (rev 3759) +++ trunk/doc/Change.log.html 2010-09-23 13:33:16 UTC (rev 3760) @@ -1,5 +1,6 @@ <p><font SIZE=4 COLOR=BLUE><b>webERP Change Log</b></font></p> <p></p> +<p>23/09/10 Tim: SalesAnalReptCols.php - SQL quoting corrections and layout changes and improvements</p> <p>23/09/10 Tim: ReverseGRN.php - SQL quoting corrections and layout changes and improvements</p> <p>23/09/10 Tim: ReorderLevelLocation.php - SQL quoting corrections and layout changes and improvements</p> <p>23/09/10 Tim: ReorderLevel.php - SQL quoting corrections and layout changes and improvements</p> This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <tim...@us...> - 2010-09-23 13:55:32
|
Revision: 3762 http://web-erp.svn.sourceforge.net/web-erp/?rev=3762&view=rev Author: tim_schofield Date: 2010-09-23 13:55:26 +0000 (Thu, 23 Sep 2010) Log Message: ----------- SQL quoting corrections and layout changes and improvements Modified Paths: -------------- trunk/SalesAnalRepts.php trunk/doc/Change.log.html Modified: trunk/SalesAnalRepts.php =================================================================== --- trunk/SalesAnalRepts.php 2010-09-23 13:37:54 UTC (rev 3761) +++ trunk/SalesAnalRepts.php 2010-09-23 13:55:26 UTC (rev 3762) @@ -10,6 +10,8 @@ include('includes/header.inc'); +echo '<p class="page_title_text"><img src="'.$rootpath.'/css/'.$theme.'/images/supplier.png" title="' . _('Search') . '" alt="">' . ' ' . $title . '</p>'; + function GrpByDataOptions($GroupByDataX) { /*Sales analysis headers group by data options */ @@ -137,27 +139,27 @@ would not run in this case cos submit is false of course see the delete code below*/ - $sql = "UPDATE reportheaders SET - reportheading='" . $_POST['ReportHeading'] . "', - groupbydata1='" . $_POST['GroupByData1'] . "', + $sql = "UPDATE reportheaders SET + reportheading='" . $_POST['ReportHeading'] . "', + groupbydata1='" . $_POST['GroupByData1'] . "', groupbydata2='" . $_POST['GroupByData2'] . "', - groupbydata3='" . $_POST['GroupByData3'] . "', - groupbydata4='" . $_POST['GroupByData4'] . "', - newpageafter1=" . $_POST['NewPageAfter1'] . ", - newpageafter2=" . $_POST['NewPageAfter2'] . ", - newpageafter3=" . $_POST['NewPageAfter3'] . ", - lower1='" . $_POST['Lower1'] . "', - upper1='" . $_POST['Upper1'] . "', - lower2='" . $_POST['Lower2'] . "', - upper2='" . $_POST['Upper2'] . "', - lower3='" . $_POST['Lower3'] . "', - upper3='" . $_POST['Upper3'] . "', - lower4='" . $_POST['Lower4'] . "', - upper4='" . $_POST['Upper4'] . "' + groupbydata3='" . $_POST['GroupByData3'] . "', + groupbydata4='" . $_POST['GroupByData4'] . "', + newpageafter1='" . $_POST['NewPageAfter1'] . "', + newpageafter2='" . $_POST['NewPageAfter2'] . "', + newpageafter3='" . $_POST['NewPageAfter3'] . "', + lower1='" . $_POST['Lower1'] . "', + upper1='" . $_POST['Upper1'] . "', + lower2='" . $_POST['Lower2'] . "', + upper2='" . $_POST['Upper2'] . "', + lower3='" . $_POST['Lower3'] . "', + upper3='" . $_POST['Upper3'] . "', + lower4='" . $_POST['Lower4'] . "', + upper4='" . $_POST['Upper4'] . "' WHERE reportid = " . $SelectedReport; $ErrMsg = _('The report could not be updated because'); - $Dbgmsg = _('The SQL used to update the report headers was'); + $DbgMsg = _('The SQL used to update the report headers was'); $result = DB_query($sql,$db,$ErrMsg,$DbgMsg); prnMsg( _('The') .' ' . $_POST['ReportHeading'] . ' ' . _('report has been updated'),'success', 'Report Updated'); @@ -207,9 +209,9 @@ '" . $_POST['GroupByData2'] . "', '" . $_POST['GroupByData3'] . "', '" . $_POST['GroupByData4'] . "', - " . $_POST['NewPageAfter1'] . ", - " . $_POST['NewPageAfter2'] . ", - " . $_POST['NewPageAfter3'] . ", + '" . $_POST['NewPageAfter1'] . "', + '" . $_POST['NewPageAfter2'] . "', + '" . $_POST['NewPageAfter3'] . "', '" . $_POST['Lower1'] . "', '" . $_POST['Upper1'] . "', '" . $_POST['Lower2'] . "', @@ -250,13 +252,13 @@ } elseif (isset($_GET['delete'])) { //the link to delete a selected record was clicked instead of the submit button - $sql="DELETE FROM reportcolumns WHERE reportid=$SelectedReport"; + $sql="DELETE FROM reportcolumns WHERE reportid='".$SelectedReport."'"; $ErrMsg = _("The deletion of the report's columns failed because"); $DbgMsg = _("The SQL used to delete the report's columns was"); $result = DB_query($sql,$db,$ErrMsg,$DbgMsg); - $sql="DELETE FROM reportheaders WHERE reportid=$SelectedReport"; + $sql="DELETE FROM reportheaders WHERE reportid='".$SelectedReport."'"; $ErrMsg = _('The deletion of the report heading failed because'); $DbgMsg = _('The SQL used to delete the report headers was'); $result = DB_query($sql,$db,$ErrMsg,$DbgMsg); @@ -278,7 +280,7 @@ $sql = "SELECT reportid, reportheading FROM reportheaders ORDER BY reportid"; $result = DB_query($sql,$db); - echo '<table border=1>'; + echo '<table class=selection>'; echo '<tr><th>' . _('Report No') . '</th> <th>' . _('Report Title') . '</th>'; @@ -332,7 +334,6 @@ if (!isset($_GET['delete'])) { - echo '<hr />'; echo '<form method="post" action="' . $_SERVER['PHP_SELF'] . '?' . SID . '">'; if (isset($SelectedReport)) { @@ -356,7 +357,7 @@ upper4, lower4 FROM reportheaders - WHERE reportid=$SelectedReport"; + WHERE reportid='".$SelectedReport."'"; $ErrMsg = _('The reports for display could not be retrieved because'); $DbgMsg = _('The SQL used to retrieve the report headers was'); @@ -378,20 +379,20 @@ $_POST['Upper3'] = $myrow['upper3']; $_POST['Lower3'] = $myrow['lower3']; $_POST['GroupByData4'] = $myrow['groupbydata4']; - $_POST['Upper4'] = $myrow['upper4']; - $_POST['Lower4'] = $myrow['lower4']; + $_POST['Upper4'] = $myrow['upper4']; + $_POST['Lower4'] = $myrow['lower4']; echo "<input type=hidden name='SelectedReport' VALUE=$SelectedReport>"; echo "<input type=hidden name='ReportID' VALUE=$ReportID>"; - echo '<font size=3 color=BLUE><b>' . _('Edit The Selected Report') . '</b></font>'; + echo '<table width=98% colspan=4 class=selection><tr><th colspan=8><font size=3 color=BLUE>' . _('Edit The Selected Report') . '</font></th></tr>'; } else { - echo '<font size=3 color=BLUE><b>' . _('Define A New Report') . '</b></font>'; + echo '<table width=98% colspan=4 class=selection><tr><th colspan=8><font size=3 color=BLUE>' . _('Define A New Report') . '</font></th></tr>'; } - + if (!isset($_POST['ReportHeading'])) { $_POST['ReportHeading']=''; } - echo '<table WIDTH=100% colspan=4><tr><td class=number>' . _('Report Heading') . ":</td><td colspan=2><input type='TEXT' size=80 maxlength=80 name=ReportHeading value='" . $_POST['ReportHeading'] . "'></td></tr>"; + echo '<tr><td class=number>' . _('Report Heading') . ":</td><td colspan=2><input type='TEXT' size=80 maxlength=80 name=ReportHeading value='" . $_POST['ReportHeading'] . "'></td></tr>"; echo '<tr><td>' . _('Group By 1') . ': <select name=GroupByData1>'; @@ -408,11 +409,11 @@ } echo '</select></td>'; - + if (!isset($_POST['Lower1'])) { $_POST['Lower1'] = ''; } - + if (!isset($_POST['Upper1'])) { $_POST['Upper1'] = ''; } @@ -432,11 +433,11 @@ echo '<option value=0>' . _('No'); echo '<option selected value=1>' . _('Yes'); } - + if (!isset($_POST['Lower2'])) { $_POST['Lower2'] = ''; } - + if (!isset($_POST['Upper2'])) { $_POST['Upper2'] = ''; } @@ -460,11 +461,11 @@ } echo '</select></td>'; - + if (!isset($_POST['Lower3'])) { $_POST['Lower3'] = ''; } - + if (!isset($_POST['Upper3'])) { $_POST['Upper3'] = ''; } @@ -477,11 +478,11 @@ GrpByDataOptions($_POST['GroupByData4']); echo "</select></td><td></td>"; - + if (!isset($_POST['Lower4'])) { $_POST['Lower4'] = ''; } - + if (!isset($_POST['Upper4'])) { $_POST['Upper4'] = ''; } @@ -491,9 +492,9 @@ echo '</table>'; - echo "<div class='centre'><input type='Submit' name='submit' value='" . _('Enter Information') . "'></div></form>"; + echo "<br /><div class='centre'><input type='Submit' name='submit' value='" . _('Enter Information') . "'></div></form>"; } //end if record deleted no point displaying form to add record include('includes/footer.inc'); -?> +?> \ No newline at end of file Modified: trunk/doc/Change.log.html =================================================================== --- trunk/doc/Change.log.html 2010-09-23 13:37:54 UTC (rev 3761) +++ trunk/doc/Change.log.html 2010-09-23 13:55:26 UTC (rev 3762) @@ -1,5 +1,6 @@ <p><font SIZE=4 COLOR=BLUE><b>webERP Change Log</b></font></p> <p></p> +<p>23/09/10 Tim: SalesAnalRepts.php - SQL quoting corrections and layout changes and improvements</p> <p>23/09/10 Tim: SalesAnalReptCols.php - SQL quoting corrections and layout changes and improvements</p> <p>23/09/10 Tim: ReverseGRN.php - SQL quoting corrections and layout changes and improvements</p> <p>23/09/10 Tim: ReorderLevelLocation.php - SQL quoting corrections and layout changes and improvements</p> This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <tim...@us...> - 2010-09-23 18:08:04
|
Revision: 3763 http://web-erp.svn.sourceforge.net/web-erp/?rev=3763&view=rev Author: tim_schofield Date: 2010-09-23 18:07:57 +0000 (Thu, 23 Sep 2010) Log Message: ----------- SQL quoting corrections and layout changes and improvements Modified Paths: -------------- trunk/SalesCategories.php trunk/doc/Change.log.html Modified: trunk/SalesCategories.php =================================================================== --- trunk/SalesCategories.php 2010-09-23 13:55:26 UTC (rev 3762) +++ trunk/SalesCategories.php 2010-09-23 18:07:57 UTC (rev 3763) @@ -10,6 +10,8 @@ include('includes/header.inc'); +echo '<p class="page_title_text"><img src="'.$rootpath.'/css/'.$theme.'/images/customer.png" title="' . _('Search') . '" alt="">' . ' ' . $title . ''; + if (isset($_GET['SelectedCategory'])){ $SelectedCategory = strtoupper($_GET['SelectedCategory']); } else if (isset($_POST['SelectedCategory'])){ @@ -32,13 +34,13 @@ } if (isset($SelectedCategory) AND isset($_FILES['ItemPicture']) AND $_FILES['ItemPicture']['name'] !='') { - + $result = $_FILES['ItemPicture']['error']; $UploadTheFile = 'Yes'; //Assume all is well to start off with // Stock is always capatalized so there is no confusion since "cat_" is lowercase - $filename = $_SESSION['part_pics_dir'] . '/cat_' . $SelectedCategory . '.jpg'; - - //But check for the worst + $filename = $_SESSION['part_pics_dir'] . '/cat_' . $SelectedCategory . '.jpg'; + + //But check for the worst if (strtoupper(substr(trim($_FILES['ItemPicture']['name']),strlen($_FILES['ItemPicture']['name'])-3))!='JPG'){ prnMsg(_('Only jpg files are supported - a file extension of .jpg is expected'),'warn'); $UploadTheFile ='No'; @@ -56,7 +58,7 @@ $UploadTheFile ='No'; } } - + if ($UploadTheFile=='Yes'){ $result = move_uploaded_file($_FILES['ItemPicture']['tmp_name'], $filename); $message = ($result)?_('File url') ."<a href='". $filename ."'>" . $filename . '</a>' : "Somthing is wrong with uploading a file."; @@ -81,14 +83,14 @@ prnMsg(_('The Sales category description must be twenty characters or less long'),'error'); } - if ($SelectedCategory && $InputError !=1 ) { + if (isset($SelectedCategory) and $InputError !=1 ) { /*SelectedCategory could also exist if submit had not been clicked this code would not run in this case cos submit is false of course see the delete code below*/ $sql = "UPDATE salescat SET salescatname = '" . $_POST['SalesCatName'] . "' - WHERE salescatid = " .$SelectedCategory; + WHERE salescatid = '" .$SelectedCategory . "'"; $msg = _('The Sales category record has been updated'); } elseif ($InputError !=1) { @@ -98,16 +100,16 @@ parentcatid) VALUES ( '" . $_POST['SalesCatName'] . "', - " . (isset($ParentCategory)?($ParentCategory):('NULL')) . ")"; + '" . (isset($ParentCategory)?($ParentCategory):('NULL')) . "')"; $msg = _('A new Sales category record has been added'); } - + if ($InputError!=1){ //run the SQL from either of the above possibilites $result = DB_query($sql,$db); prnMsg($msg,'success'); } - + unset ($SelectedCategory); unset($_POST['SalesCatName']); unset($EditName); @@ -117,7 +119,7 @@ // PREVENT DELETES IF DEPENDENT RECORDS IN 'StockMaster' - $sql= "SELECT COUNT(*) FROM salescatprod WHERE salescatid=".$SelectedCategory; + $sql= "SELECT COUNT(*) FROM salescatprod WHERE salescatid='".$SelectedCategory . "'"; $result = DB_query($sql,$db); $myrow = DB_fetch_row($result); if ($myrow[0]>0) { @@ -125,16 +127,16 @@ '<br> ' . _('There are') . ' ' . $myrow[0] . ' ' . _('items under to this category'),'warn'); } else { - $sql = "SELECT COUNT(*) FROM salescat WHERE parentcatid='$SelectedCategory'"; + $sql = "SELECT COUNT(*) FROM salescat WHERE parentcatid='".$SelectedCategory."'"; $result = DB_query($sql,$db); $myrow = DB_fetch_row($result); if ($myrow[0]>0) { prnMsg(_('Cannot delete this sales category because sub categories have been added to this category') . '<br> ' . _('There are') . ' ' . $myrow[0] . ' ' . _('sub categories'),'warn'); } else { - $sql="DELETE FROM salescat WHERE salescatid=".$SelectedCategory; + $sql="DELETE FROM salescat WHERE salescatid='".$SelectedCategory."'"; $result = DB_query($sql,$db); - prnMsg(_('The sales category') . ' ' . $SelectedCategory . ' ' . _('has been deleted') . + prnMsg(_('The sales category') . ' ' . $SelectedCategory . ' ' . _('has been deleted') . ' !','success'); unset ($SelectedCategory); } @@ -142,32 +144,32 @@ unset($_GET['delete']); unset($EditName); } elseif( isset($_POST['submit']) && isset($_POST['AddStockID']) ) { - $sql = "INSERT INTO salescatprod ( - stockid, - salescatid + $sql = "INSERT INTO salescatprod ( + stockid, + salescatid ) VALUES ( '". $_POST['AddStockID']."', - ".(isset($ParentCategory)?($ParentCategory):('NULL'))." + '".(isset($ParentCategory)?($ParentCategory):('NULL'))."' )"; $result = DB_query($sql,$db); - prnMsg(_('Stock item') . ' ' . $_POST['AddStockID'] . ' ' . _('has been added') . + prnMsg(_('Stock item') . ' ' . $_POST['AddStockID'] . ' ' . _('has been added') . ' !','success'); unset($_POST['AddStockID']); } elseif( isset($_GET['DelStockID']) ) { - $sql = "DELETE FROM salescatprod WHERE + $sql = "DELETE FROM salescatprod WHERE stockid='". $_GET['DelStockID']."' AND salescatid".(isset($ParentCategory)?('='.$ParentCategory):(' IS NULL')); $result = DB_query($sql,$db); - prnMsg(_('Stock item') . ' ' . $_GET['DelStockID'] . ' ' . _('has been removed') . + prnMsg(_('Stock item') . ' ' . $_GET['DelStockID'] . ' ' . _('has been removed') . ' !','success'); unset($_GET['DelStockID']); } // ---------------------------------------------------------------------------------------- -// Calculate Path for navigation +// Calculate Path for navigation -$CategoryPath = '<a href="'.$_SERVER['PHP_SELF'] . '?' . SID . +$CategoryPath = '<a href="'.$_SERVER['PHP_SELF'] . '?' . SID . '&ParentCategory=0">' . _('Main') . '</a>' . " \\ "; $TempPath = ''; if (isset($ParentCategory)) { @@ -175,17 +177,17 @@ } $LastParentName = ''; -for($Buzy = (isset($TmpParentID) && ($TmpParentID <> '')); +for($Buzy = (isset($TmpParentID) && ($TmpParentID <> '')); $Buzy == true; $Buzy = (isset($TmpParentID) && ($TmpParentID <> '')) ) { - $sql = "SELECT parentcatid, salescatname FROM salescat WHERE salescatid=".$TmpParentID; + $sql = "SELECT parentcatid, salescatname FROM salescat WHERE salescatid='".$TmpParentID."'"; $result = DB_query($sql,$db); if( $result ) { if (DB_num_rows($result) > 0) { $row = DB_fetch_array($result); $LastParentName = $row['salescatname']; - $TempPath = '<a href="'.$_SERVER['PHP_SELF'] . '?' . SID . - '&ParentCategory='.$TmpParentID.'">'.$LastParentName . + $TempPath = '<a href="'.$_SERVER['PHP_SELF'] . '?' . SID . + '&ParentCategory='.$TmpParentID.'">'.$LastParentName . '</a>'." \\ ".$TempPath; $TmpParentID = $row['parentcatid']; // Set For Next Round } else { @@ -197,11 +199,11 @@ $CategoryPath = $CategoryPath.$TempPath; -echo '<p><div class="centre"><i>'._("Selected Sales Category Path").'</i> : '. +echo '<p><div class="centre"><i>'._("Selected Sales Category Path").'</i> : '. $CategoryPath . ' * </b></div></p>'; -// END Calculate Path for navigation +// END Calculate Path for navigation // ---------------------------------------------------------------------------------------- @@ -213,10 +215,10 @@ links to delete or edit each. These will call the same page again and allow update/input or deletion of the records*/ -$sql = "SELECT salescatid, - salescatname - FROM salescat - WHERE parentcatid". (isset($ParentCategory)?('='.$ParentCategory):' is NULL') . " +$sql = "SELECT salescatid, + salescatname + FROM salescat + WHERE parentcatid". (isset($ParentCategory)?('='.$ParentCategory):' is NULL') . " ORDER BY salescatname"; $result = DB_query($sql,$db); @@ -225,7 +227,7 @@ if (DB_num_rows($result) == 0) { prnMsg(_('There are no categories defined at this level.')); } else { - echo "<table border=1>\n"; + echo "<table class=selection>\n"; echo '<tr><th>' . _('Sub Category') . '</th></tr>'; $k=0; //row colour counter @@ -238,7 +240,7 @@ echo '<tr class="OddTableRows">'; $k=1; } - + if (function_exists('imagecreatefrompng')){ $CatImgLink = '<img src="GetStockImage.php?SID&automake=1&textcolor=FFFFFF&bgcolor=CCCCCC'. '&stockid='.urlencode('cat_'.$myrow['salescatid'].'.jpg'). @@ -253,9 +255,9 @@ } else { $CatImgLink = 'No Image'; } - + } - + printf("<td>%s</td> <td><a href=\"%sParentCategory=%s\">" . _('Select') . "</td> <td><a href=\"%sSelectedCategory=%s&ParentCategory=%s\">" . _('Edit') . "</td> @@ -292,8 +294,8 @@ if (isset($SelectedCategory)) { //editing an existing stock category - $sql = "SELECT salescatid, parentcatid, salescatname FROM salescat sc - WHERE salescatid=". $SelectedCategory; + $sql = "SELECT salescatid, parentcatid, salescatname FROM salescat sc + WHERE salescatid='". $SelectedCategory."'"; $result = DB_query($sql, $db); $myrow = DB_fetch_array($result); @@ -303,7 +305,7 @@ $_POST['SalesCatName'] = $myrow['salescatname']; echo '<input type=hidden name="SelectedCategory" VALUE="' . $SelectedCategory . '">'; - echo '<input type=hidden name="ParentCategory" VALUE="' . + echo '<input type=hidden name="ParentCategory" VALUE="' . (isset($_POST['ParentCatId'])?($_POST['ParentCategory']):('0')) . '">'; $FormCaps = _('Edit Sub Category'); @@ -312,24 +314,24 @@ if (isset($ParentCategory)) { $_POST['ParentCategory'] = $ParentCategory; } - echo '<input type=hidden name="ParentCategory" VALUE="' . + echo '<input type=hidden name="ParentCategory" VALUE="' . (isset($_POST['ParentCategory'])?($_POST['ParentCategory']):('0')) . '">'; $FormCaps = _('New Sub Category'); } echo '<input type=hidden name="EditName" VALUE="1">'; -echo '<table>'; +echo '<table class=selection>'; echo '<tr><th colspan="2">' . $FormCaps . '</th></tr>'; echo '<tr><td>' . _('Category Name') . ':</td> - <td><input type="Text" name="SalesCatName" size=20 maxlength=20 value="' . + <td><input type="Text" name="SalesCatName" size=20 maxlength=20 value="' . $_POST['SalesCatName'] . '"></td></tr>'; -// Image upload only if we have a selected category +// Image upload only if we have a selected category if (isset($SelectedCategory)) { echo '<tr><td>'. _('Image File (.jpg)') . ':</td> <td><input type="file" id="ItemPicture" name="ItemPicture"></td></tr>'; -} - +} + echo '</table>'; -echo '<div class="centre"><input type="Submit" name="submit" value="' . _('Submit Information') . '"></div>'; +echo '<br /><div class="centre"><input type="Submit" name="submit" value="' . _('Submit Information') . '"></div>'; echo '</form></p>'; @@ -342,26 +344,26 @@ // $sql = "SELECT stockid, description FROM stockmaster ORDER BY stockid"; /* $sql = "SELECT sm.stockid, sm.description FROM stockmaster as sm - WHERE NOT EXISTS + WHERE NOT EXISTS ( SELECT scp.stockid FROM salescatprod as scp - WHERE - scp.salescatid". (isset($ParentCategory)?('='.$ParentCategory):' IS NULL') ." - AND - scp.stockid = sm.stockid + WHERE + scp.salescatid". (isset($ParentCategory)?('='.$ParentCategory):' IS NULL') ." + AND + scp.stockid = sm.stockid ) ORDER BY sm.stockid"; */ // Now add this stockid to the array $stockids = array(); -$sql = "SELECT stockid FROM salescatprod - WHERE salescatid". (isset($ParentCategory)?('='.$ParentCategory):' is NULL') . " +$sql = "SELECT stockid FROM salescatprod + WHERE salescatid". (isset($ParentCategory)?('='.$ParentCategory):' is NULL') . " ORDER BY stockid"; $result = DB_query($sql,$db); if($result && DB_num_rows($result)) { while( $myrow = DB_fetch_array($result) ) { $stockids[] = $myrow['stockid']; // Add Stock } - DB_free_result($result); + DB_free_result($result); } // This query will return the stock that is available @@ -373,11 +375,11 @@ if( isset($SelectedCategory) ) { // If we selected a category we need to keep it selected echo '<input type=hidden name="SelectedCategory" VALUE="' . $SelectedCategory . '">'; } - echo '<input type=hidden name="ParentCategory" VALUE="' . + echo '<input type=hidden name="ParentCategory" VALUE="' . (isset($_POST['ParentCategory'])?($_POST['ParentCategory']):('0')) . '">'; - + echo ''; - echo '<table>'; + echo '<table class=selection>'; echo '<tr><th colspan="2">'._('Add Inventory to this category.').'</th></tr>'; echo '<tr><td>' . _('Select Inv. Item') . ':</td><td>'; echo '<select name="AddStockID">'; @@ -391,7 +393,7 @@ } echo '</select>'; echo '</td></tr></table>'; - echo '<div class="centre"><input type="Submit" name="submit" value="' . _('Add Inventory Item') . '"></div>'; + echo '<br /><div class="centre"><input type="Submit" name="submit" value="' . _('Add Inventory Item') . '"></div>'; echo ''; echo '</form></p>'; } else { @@ -411,13 +413,13 @@ echo '<p>'; $sql = "SELECT scp.stockid, sm.description FROM salescatprod scp LEFT JOIN stockmaster sm ON sm.stockid = scp.stockid - WHERE scp.salescatid". (isset($ParentCategory)?('='.$ParentCategory):' is NULL') . " + WHERE scp.salescatid". (isset($ParentCategory)?('='.$ParentCategory):' is NULL') . " ORDER BY scp.stockid"; $result = DB_query($sql,$db); if($result ) { if( DB_num_rows($result)) { - echo '<table>'; + echo '<table class=selection>'; echo '<tr><th colspan="3">'._('Inventory items in this category.').'</th></tr>'; echo '<tr><th>' . _('Stock Code') . '</th>'; echo '<th>' . _('Description') . '</th></tr>'; @@ -432,11 +434,11 @@ echo '<tr class="OddTableRows">'; $k=1; } - + echo '<td>' . $myrow['stockid'] . '</td>'; echo '<td>' . $myrow['description'] . '</td>'; - echo '<td><a href="'.$_SERVER['PHP_SELF'] . '?' . SID . - '&ParentCategory='.$ParentCategory.'&DelStockID='.$myrow['stockid'].'">'. + echo '<td><a href="'.$_SERVER['PHP_SELF'] . '?' . SID . + '&ParentCategory='.$ParentCategory.'&DelStockID='.$myrow['stockid'].'">'. _('Remove'). '</a></td></tr>'; } @@ -454,4 +456,4 @@ // END Always Show Stock In Category include('includes/footer.inc'); -?> +?> \ No newline at end of file Modified: trunk/doc/Change.log.html =================================================================== --- trunk/doc/Change.log.html 2010-09-23 13:55:26 UTC (rev 3762) +++ trunk/doc/Change.log.html 2010-09-23 18:07:57 UTC (rev 3763) @@ -1,5 +1,6 @@ <p><font SIZE=4 COLOR=BLUE><b>webERP Change Log</b></font></p> <p></p> +<p>23/09/10 Tim: SalesCategories.php - SQL quoting corrections and layout changes and improvements</p> <p>23/09/10 Tim: SalesAnalRepts.php - SQL quoting corrections and layout changes and improvements</p> <p>23/09/10 Tim: SalesAnalReptCols.php - SQL quoting corrections and layout changes and improvements</p> <p>23/09/10 Tim: ReverseGRN.php - SQL quoting corrections and layout changes and improvements</p> This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <tim...@us...> - 2010-09-23 18:22:02
|
Revision: 3764 http://web-erp.svn.sourceforge.net/web-erp/?rev=3764&view=rev Author: tim_schofield Date: 2010-09-23 18:21:55 +0000 (Thu, 23 Sep 2010) Log Message: ----------- SQL quoting corrections and layout changes and improvements Modified Paths: -------------- trunk/SalesGLPostings.php trunk/doc/Change.log.html Modified: trunk/SalesGLPostings.php =================================================================== --- trunk/SalesGLPostings.php 2010-09-23 18:07:57 UTC (rev 3763) +++ trunk/SalesGLPostings.php 2010-09-23 18:21:55 UTC (rev 3764) @@ -15,6 +15,8 @@ $InputError=false; +echo '<p class="page_title_text"><img src="'.$rootpath.'/css/'.$theme.'/images/customer.png" title="' . _('Search') . '" alt="">' . ' ' . $title . ''; + if (isset($_POST['submit'])) { /* actions to take once the user has clicked the submit button @@ -24,36 +26,36 @@ /*SelectedSalesPostingID could also exist if submit had not been clicked this code would not run in this case cos submit is false of course see the delete code below*/ - $sql = 'UPDATE salesglpostings SET - salesglcode = ' . $_POST['SalesGLCode'] . ', - discountglcode = ' . $_POST['DiscountGLCode'] . ", + $sql = "UPDATE salesglpostings SET + salesglcode = '" . $_POST['SalesGLCode'] . "', + discountglcode = '" . $_POST['DiscountGLCode'] . "', area = '" . $_POST['Area'] . "', stkcat = '" . $_POST['StkCat'] . "', salestype = '" . $_POST['SalesType'] . "' - WHERE salesglpostings.id = $SelectedSalesPostingID"; + WHERE salesglpostings.id = '".$SelectedSalesPostingID."'"; $msg = _('The sales GL posting record has been updated'); } else { /*Selected Sales GL Posting is null cos no item selected on first time round so must be adding a record must be submitting new entries in the new SalesGLPosting form */ - + /* Verify if item doesn't exists to insert it, otherwise just refreshes the page. */ - $sql = "SELECT count(*) FROM salesglpostings - WHERE area='" . $_POST['Area'] . "' - AND stkcat='" . $_POST['StkCat'] . "' + $sql = "SELECT count(*) FROM salesglpostings + WHERE area='" . $_POST['Area'] . "' + AND stkcat='" . $_POST['StkCat'] . "' AND salestype='" . $_POST['SalesType'] . "'"; - + $result = DB_query($sql,$db); $myrow = DB_fetch_row($result); if ($myrow[0] == 0) { - $sql = 'INSERT INTO salesglpostings ( + $sql = "INSERT INTO salesglpostings ( salesglcode, discountglcode, area, stkcat, salestype) VALUES ( - ' . $_POST['SalesGLCode'] . ', - ' . $_POST['DiscountGLCode'] . ", + '" . $_POST['SalesGLCode'] . "', + '" . $_POST['DiscountGLCode'] . "', '" . $_POST['Area'] . "', '" . $_POST['StkCat'] . "', '" . $_POST['SalesType'] . "' @@ -67,7 +69,7 @@ //run the SQL from either of the above possibilites $result = DB_query($sql,$db); - + if ($InputError==false){ prnMsg($msg,'success'); } @@ -82,7 +84,7 @@ //the link to delete a selected record was clicked instead of the submit button $sql="DELETE FROM salesglpostings - WHERE id=$SelectedSalesPostingID"; + WHERE id='".$SelectedSalesPostingID."'"; $result = DB_query($sql,$db); @@ -92,22 +94,22 @@ if (!isset($SelectedSalesPostingID)) { $ShowLivePostingRecords = true; - + $SQL = "SELECT salesglpostings.id, salesglpostings.area, salesglpostings.stkcat, salesglpostings.salestype, salesglpostings.salesglcode, salesglpostings.discountglcode - FROM salesglpostings LEFT JOIN chartmaster + FROM salesglpostings LEFT JOIN chartmaster ON salesglpostings.salesglcode = chartmaster.accountcode WHERE chartmaster.accountcode IS NULL"; - + $result = DB_query($SQL,$db); if (DB_num_rows($result)>0){ $ShowLivePostingRecords = false; prnMsg (_('The following posting records that do not have valid general ledger code specified - these records must be amended.'),'error'); - echo '<table border=1>'; + echo '<table class=selection>'; echo "<tr><th>" . _('Area') . "</th> <th>" . _('Stock Category') . "</th> <th>" . _('Sales Type') . "</th> @@ -115,7 +117,7 @@ <thr'>" . _('Discount Account') . "</th> </tr>"; $k=0; //row colour counter - + while ($myrow = DB_fetch_row($result)) { if ($k==1){ echo '<tr class="EvenTableRows">'; @@ -124,7 +126,7 @@ echo '<tr class="OddTableRows">'; $k=1; } - + printf("<td>%s</td> <td>%s</td> <td>%s</td> @@ -160,18 +162,18 @@ if (DB_num_rows($result)==0){ /* The required group does not seem to exist so we create it */ $SQL = "INSERT INTO accountgroups ( - groupname, - sectioninaccounts, - pandl, - sequenceintb + groupname, + sectioninaccounts, + pandl, + sequenceintb ) VALUES ( 'Sales', 1, 1, 10)"; - - $result = DB_query($SQL,$db); - } + + $result = DB_query($SQL,$db); + } $SQL = 'SELECT accountcode FROM chartmaster WHERE accountcode =1'; $result = DB_query($SQL,$db); if (DB_num_rows($result)==0){ @@ -198,12 +200,12 @@ 'ANY', 'AN', 1, - 1)"; + 1)"; $result = DB_query($SQL,$db); } if ($ShowLivePostingRecords){ - + $SQL = "SELECT salesglpostings.id, salesglpostings.area, salesglpostings.stkcat, @@ -215,19 +217,19 @@ chartmaster as chart2 WHERE salesglpostings.salesglcode = chart1.accountcode AND salesglpostings.discountglcode = chart2.accountcode"; - + $result = DB_query($SQL,$db); - - echo '<table border=1>'; + + echo '<table class=selection>'; echo "<tr><th>" . _('Area') . "</th> <th>" . _('Stock Category') . "</th> <th>" . _('Sales Type') . "</th> <th>" . _('Sales Account') . "</th> <th>" . _('Discount Account') . "</th> </tr>"; - + $k=0; //row colour counter - + while ($myrow = DB_fetch_row($result)) { if ($k==1){ echo '<tr class="EvenTableRows">'; @@ -236,7 +238,7 @@ echo '<tr class="OddTableRows">'; $k=1; } - + printf("<td>%s</td> <td>%s</td> <td>%s</td> @@ -279,7 +281,7 @@ salesglpostings.area, salesglpostings.salestype FROM salesglpostings - WHERE salesglpostings.id=$SelectedSalesPostingID"; + WHERE salesglpostings.id='".$SelectedSalesPostingID."'"; $result = DB_query($sql, $db); $myrow = DB_fetch_array($result); @@ -300,7 +302,7 @@ areadescription FROM areas'; $result = DB_query($SQL,$db); - echo '<table> + echo '<br /><table class=selection> <tr> <td>' . _('Area') . ":</td> <td><select name='Area'><option VALUE='AN'>" . _('Any Other'); @@ -374,7 +376,7 @@ accountgroups WHERE chartmaster.group_=accountgroups.groupname AND accountgroups.pandl=1 - ORDER BY accountgroups.sequenceintb, + ORDER BY accountgroups.sequenceintb, chartmaster.accountcode"; $result = DB_query($SQL,$db); @@ -397,9 +399,9 @@ while ($myrow = DB_fetch_array($result)) { if (isset($_POST['DiscountGLCode']) and $myrow['accountcode']==$_POST['DiscountGLCode']) { - echo "<option selected VALUE='"; + echo "<option selected value='"; } else { - echo "<option VALUE='"; + echo "<option value='"; } echo $myrow['accountcode'] . "'>" . $myrow['accountcode'] . ' - ' . $myrow['accountname']; @@ -409,7 +411,7 @@ </tr> </table>'; - echo "<div class='centre'><input type='Submit' name='submit' value='" . _('Enter Information') . "'></div>"; + echo "<br /><div class='centre'><input type='Submit' name='submit' value='" . _('Enter Information') . "'></div>"; echo '</form>'; Modified: trunk/doc/Change.log.html =================================================================== --- trunk/doc/Change.log.html 2010-09-23 18:07:57 UTC (rev 3763) +++ trunk/doc/Change.log.html 2010-09-23 18:21:55 UTC (rev 3764) @@ -1,5 +1,6 @@ <p><font SIZE=4 COLOR=BLUE><b>webERP Change Log</b></font></p> <p></p> +<p>23/09/10 Tim: SalesGLPostings.php - SQL quoting corrections and layout changes and improvements</p> <p>23/09/10 Tim: SalesCategories.php - SQL quoting corrections and layout changes and improvements</p> <p>23/09/10 Tim: SalesAnalRepts.php - SQL quoting corrections and layout changes and improvements</p> <p>23/09/10 Tim: SalesAnalReptCols.php - SQL quoting corrections and layout changes and improvements</p> This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <tim...@us...> - 2010-09-23 18:28:23
|
Revision: 3765 http://web-erp.svn.sourceforge.net/web-erp/?rev=3765&view=rev Author: tim_schofield Date: 2010-09-23 18:28:17 +0000 (Thu, 23 Sep 2010) Log Message: ----------- Fix deprecated use of assigning by reference Modified Paths: -------------- trunk/SalesGraph.php trunk/doc/Change.log.html Modified: trunk/SalesGraph.php =================================================================== --- trunk/SalesGraph.php 2010-09-23 18:21:55 UTC (rev 3764) +++ trunk/SalesGraph.php 2010-09-23 18:28:17 UTC (rev 3765) @@ -181,7 +181,7 @@ include('includes/footer.inc'); } else { - $graph =& new PHPlot(950,450); + $graph = new PHPlot(950,450); $SelectClause =''; $WhereClause =''; $GraphTitle =''; Modified: trunk/doc/Change.log.html =================================================================== --- trunk/doc/Change.log.html 2010-09-23 18:21:55 UTC (rev 3764) +++ trunk/doc/Change.log.html 2010-09-23 18:28:17 UTC (rev 3765) @@ -1,5 +1,6 @@ <p><font SIZE=4 COLOR=BLUE><b>webERP Change Log</b></font></p> <p></p> +<p>23/09/10 Tim: SalesGraph.php - Fix deprecated use of assigning by reference</p> <p>23/09/10 Tim: SalesGLPostings.php - SQL quoting corrections and layout changes and improvements</p> <p>23/09/10 Tim: SalesCategories.php - SQL quoting corrections and layout changes and improvements</p> <p>23/09/10 Tim: SalesAnalRepts.php - SQL quoting corrections and layout changes and improvements</p> This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <tim...@us...> - 2010-09-23 18:54:53
|
Revision: 3766 http://web-erp.svn.sourceforge.net/web-erp/?rev=3766&view=rev Author: tim_schofield Date: 2010-09-23 18:54:47 +0000 (Thu, 23 Sep 2010) Log Message: ----------- SQL quoting corrections and layout changes and improvements Modified Paths: -------------- trunk/SalesPeople.php trunk/doc/Change.log.html Modified: trunk/SalesPeople.php =================================================================== --- trunk/SalesPeople.php 2010-09-23 18:28:17 UTC (rev 3765) +++ trunk/SalesPeople.php 2010-09-23 18:54:47 UTC (rev 3766) @@ -16,9 +16,11 @@ if (isset($Errors)) { unset($Errors); } - -$Errors = array(); +$Errors = array(); + +echo '<p class="page_title_text"><img src="'.$rootpath.'/css/'.$theme.'/images/maintenance.png" title="' . _('Search') . '" alt="">' . ' ' . $title.'</p>'; + if (isset($_POST['submit'])) { //initialise no input errors assumed initially before we test @@ -34,17 +36,17 @@ $InputError = 1; prnMsg(_('The salesperson code must be three characters or less long'),'error'); $Errors[$i] = 'SalesmanCode'; - $i++; + $i++; } elseif (strlen($_POST['SalesmanCode'])==0 OR $_POST['SalesmanCode']=='') { $InputError = 1; prnMsg(_('The salesperson code cannot be empty'),'error'); $Errors[$i] = 'SalesmanCode'; - $i++; + $i++; } elseif (strlen($_POST['SalesmanName']) > 30) { $InputError = 1; prnMsg(_('The salesperson name must be thirty characters or less long'),'error'); $Errors[$i] = 'SalesmanName'; - $i++; + $i++; } elseif (strlen($_POST['SManTel']) > 20) { $InputError = 1; prnMsg(_('The salesperson telephone number must be twenty characters or less long'),'error'); @@ -82,12 +84,12 @@ /*SelectedSaleperson could also exist if submit had not been clicked this code would not run in this case cos submit is false of course see the delete code below*/ $sql = "UPDATE salesman SET salesmanname='" . $_POST['SalesmanName'] . "', - commissionrate1=" . $_POST['CommissionRate1'] . ", + commissionrate1='" . $_POST['CommissionRate1'] . "', smantel='" . $_POST['SManTel'] . "', smanfax='" . $_POST['SManFax'] . "', - breakpoint=" . $_POST['Breakpoint'] . ", - commissionrate2=" . $_POST['CommissionRate2'] . " - WHERE salesmancode = '$SelectedSaleperson'"; + breakpoint='" . $_POST['Breakpoint'] . "', + commissionrate2='" . $_POST['CommissionRate2'] . "' + WHERE salesmancode = '".$SelectedSaleperson."'"; $msg = _('Salesperson record for') . ' ' . $_POST['SalesmanName'] . ' ' . _('has been updated'); } elseif ($InputError !=1) { @@ -103,9 +105,9 @@ smanfax) VALUES ('" . $_POST['SalesmanCode'] . "', '" . $_POST['SalesmanName'] . "', - " . $_POST['CommissionRate1'] . ", - " . $_POST['CommissionRate2'] . ", - " . $_POST['Breakpoint'] . ", + '" . $_POST['CommissionRate1'] . "', + '" . $_POST['CommissionRate2'] . "', + '" . $_POST['Breakpoint'] . "', '" . $_POST['SManTel'] . "', '" . $_POST['SManFax'] . "' )"; @@ -135,21 +137,21 @@ // PREVENT DELETES IF DEPENDENT RECORDS IN 'DebtorsMaster' - $sql= "SELECT COUNT(*) FROM custbranch WHERE custbranch.salesman='$SelectedSaleperson'"; + $sql= "SELECT COUNT(*) FROM custbranch WHERE custbranch.salesman='".$SelectedSaleperson."'"; $result = DB_query($sql,$db); $myrow = DB_fetch_row($result); if ($myrow[0]>0) { prnMsg(_('Cannot delete this salesperson because branches are set up referring to them') . ' - ' . _('first alter the branches concerned') . '<br>' . _('There are') . ' ' . $myrow[0] . ' ' . _('branches that refer to this salesperson'),'error'); } else { - $sql= "SELECT COUNT(*) FROM salesanalysis WHERE salesanalysis.salesperson='$SelectedSaleperson'"; + $sql= "SELECT COUNT(*) FROM salesanalysis WHERE salesanalysis.salesperson='".$SelectedSaleperson."'"; $result = DB_query($sql,$db); $myrow = DB_fetch_row($result); if ($myrow[0]>0) { prnMsg(_('Cannot delete this salesperson because sales analysis records refer to them') , '<br>' . _('There are') . ' ' . $myrow[0] . ' ' . _('sales analysis records that refer to this salesperson'),'error'); } else { - $sql="DELETE FROM salesman WHERE salesmancode='$SelectedSaleperson'"; + $sql="DELETE FROM salesman WHERE salesmancode='".$SelectedSaleperson."'"; $ErrMsg = _('The salesperson could not be deleted because'); $result = DB_query($sql,$db,$ErrMsg); @@ -178,7 +180,7 @@ FROM salesman"; $result = DB_query($sql,$db); - echo '<table BORDER=1>'; + echo '<table class=selection>'; echo "<tr><th>" . _('Code') . "</th> <th>" . _('Name') . "</th> <th>" . _('Telephone') . "</th> @@ -186,11 +188,18 @@ <th>" . _('Comm Rate 1') . "</th> <th>" . _('Break') . "</th> <th>" . _('Comm Rate 2') . "</th></tr>"; - + $k=0; while ($myrow=DB_fetch_row($result)) { + if ($k==1){ + echo '<tr class="EvenTableRows">'; + $k=0; + } else { + echo '<tr class="OddTableRows">'; + $k++; + } - printf("<tr> + printf(" <td>%s</td> <td>%s</td> <td>%s</td> @@ -214,7 +223,7 @@ $myrow[0]); } //END WHILE LIST LOOP - echo '</table>'; + echo '</table><br />'; } //end of ifs and buts! if (isset($SelectedSaleperson)) { @@ -236,7 +245,7 @@ breakpoint, commissionrate2 FROM salesman - WHERE salesmancode='$SelectedSaleperson'"; + WHERE salesmancode='".$SelectedSaleperson."'"; $result = DB_query($sql, $db); $myrow = DB_fetch_array($result); @@ -252,12 +261,12 @@ echo "<input type=hidden name='SelectedSaleperson' VALUE='" . $SelectedSaleperson . "'>"; echo "<input type=hidden name='SalesmanCode' VALUE='" . $_POST['SalesmanCode'] . "'>"; - echo '<table> <tr><td>' . _('Salesperson code') . ':</td><td>'; + echo '<table class=selection> <tr><td>' . _('Salesperson code') . ':</td><td>'; echo $_POST['SalesmanCode'] . '</td></tr>'; } else { //end of if $SelectedSaleperson only do the else when a new record is being entered - echo '<table><tr><td>' . _('Salesperson code') . ":</td> + echo '<table class=selection><tr><td>' . _('Salesperson code') . ":</td> <td><input type='Text' ". (in_array('SalesmanCode',$Errors) ? 'class="inputerror"' : '' ) ." name='SalesmanCode' size=3 maxlength=3></td></tr>"; } if (!isset($_POST['SalesmanName'])){ @@ -289,7 +298,7 @@ echo '</table>'; - echo "<div class='centre'><input type='Submit' name='submit' value='" . _('Enter Information') . "'></div>"; + echo "<br /><div class='centre'><input type='Submit' name='submit' value='" . _('Enter Information') . "'></div>"; echo '</form>'; Modified: trunk/doc/Change.log.html =================================================================== --- trunk/doc/Change.log.html 2010-09-23 18:28:17 UTC (rev 3765) +++ trunk/doc/Change.log.html 2010-09-23 18:54:47 UTC (rev 3766) @@ -1,5 +1,6 @@ <p><font SIZE=4 COLOR=BLUE><b>webERP Change Log</b></font></p> <p></p> +<p>23/09/10 Tim: SalesPeople.php - SQL quoting corrections and layout changes and improvements</p> <p>23/09/10 Tim: SalesGraph.php - Fix deprecated use of assigning by reference</p> <p>23/09/10 Tim: SalesGLPostings.php - SQL quoting corrections and layout changes and improvements</p> <p>23/09/10 Tim: SalesCategories.php - SQL quoting corrections and layout changes and improvements</p> This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <tim...@us...> - 2010-09-23 19:11:57
|
Revision: 3767 http://web-erp.svn.sourceforge.net/web-erp/?rev=3767&view=rev Author: tim_schofield Date: 2010-09-23 19:11:50 +0000 (Thu, 23 Sep 2010) Log Message: ----------- SQL quoting corrections and layout changes and improvements Modified Paths: -------------- trunk/SalesTypes.php trunk/doc/Change.log.html Modified: trunk/SalesTypes.php =================================================================== --- trunk/SalesTypes.php 2010-09-23 18:54:47 UTC (rev 3766) +++ trunk/SalesTypes.php 2010-09-23 19:11:50 UTC (rev 3767) @@ -19,6 +19,8 @@ $Errors = array(); +echo '<p class="page_title_text"><img src="'.$rootpath.'/css/'.$theme.'/images/maintenance.png" title="' . _('Search') . '" alt="">' . ' ' . $title.'</p>'; + if (isset($_POST['submit'])) { //initialise no input errors assumed initially before we test @@ -56,7 +58,7 @@ $sql = "UPDATE salestypes SET sales_type = '" . $_POST['Sales_Type'] . "' - WHERE typeabbrev = '$SelectedType'"; + WHERE typeabbrev = '".$SelectedType."'"; $msg = _('The customer/sales/pricelist type') . ' ' . $SelectedType . ' ' . _('has been updated'); } elseif ( $InputError !=1 ) { @@ -135,7 +137,7 @@ $sql= "SELECT COUNT(*) FROM debtortrans - WHERE debtortrans.tpe='$SelectedType'"; + WHERE debtortrans.tpe='".$SelectedType."'"; $ErrMsg = _('The number of transactions using this customer/sales/pricelist type could not be retrieved'); $result = DB_query($sql,$db,$ErrMsg); @@ -146,7 +148,7 @@ } else { - $sql = "SELECT COUNT(*) FROM debtorsmaster WHERE salestype='$SelectedType'"; + $sql = "SELECT COUNT(*) FROM debtorsmaster WHERE salestype='".$SelectedType."'"; $ErrMsg = _('The number of transactions using this Sales Type record could not be retrieved because'); $result = DB_query($sql,$db,$ErrMsg); @@ -155,7 +157,7 @@ prnMsg (_('Cannot delete this sale type because customers are currently set up to use this sales type') . '<br>' . _('There are') . ' ' . $myrow[0] . ' ' . _('customers with this sales type code')); } else { - $sql="DELETE FROM salestypes WHERE typeabbrev='$SelectedType'"; + $sql="DELETE FROM salestypes WHERE typeabbrev='".$SelectedType."'"; $ErrMsg = _('The Sales Type record could not be deleted because'); $result = DB_query($sql,$db,$ErrMsg); prnMsg(_('Sales type') . ' / ' . _('price list') . ' ' . $SelectedType . ' ' . _('has been deleted') ,'success'); @@ -182,7 +184,7 @@ $sql = 'SELECT * FROM salestypes'; $result = DB_query($sql,$db); - echo '<table BORDER=1>'; + echo '<table class=selection>'; echo "<tr> <th>" . _('Type Code') . "</th> <th>" . _('Type Name') . "</th> @@ -221,9 +223,7 @@ if (! isset($_GET['delete'])) { echo "<form method='post' action=" . $_SERVER['PHP_SELF'] . '?' . SID . '>'; - echo '<div class="centre"><font size=4 color=blue><b><U>' . _('Sales Type/Price List Setup') . '</b></U></font></div>'; - echo '<p><table border=1>'; //Main table - echo '<td><table>'; // First column + echo '<p><table class=selection>'; //Main table // The user wish to EDIT an existing type @@ -243,7 +243,9 @@ echo "<input type=hidden name='SelectedType' VALUE=" . $SelectedType . ">"; echo "<input type=hidden name='TypeAbbrev' VALUE=" . $_POST['TypeAbbrev'] . ">"; - echo "<table> <tr><td>" . _('Type Code') . ":</td><td>"; + echo "<table class=selection>"; + echo '<tr><th colspan=4><font size=2 color=blue><b>' . _('Sales Type/Price List Setup') . '</b></font></th></tr>'; + echo "<tr><td>" . _('Type Code') . ":</td><td>"; // We dont allow the user to change an existing type code @@ -253,7 +255,9 @@ // This is a new type so the user may volunteer a type code - echo "<table><tr><td>" . _('Type Code') . ":</td><td><input type='Text' + echo "<table class=selection>"; + echo '<tr><th colspan=4><font size=2 color=blue><b>' . _('Sales Type/Price List Setup') . '</b></font></th></tr>'; + echo "<tr><td>" . _('Type Code') . ":</td><td><input type='Text' " . (in_array('SalesType',$Errors) ? 'class="inputerror"' : '' ) ." size=3 maxlength=2 name='TypeAbbrev'></td></tr>"; } @@ -263,7 +267,6 @@ } echo "<tr><td>" . _('Sales Type Name') . ":</td><td><input type='Text' name='Sales_Type' value='" . $_POST['Sales_Type'] . "'></td></tr>"; - echo '</table>'; // close table in first column echo '</td></tr></table>'; // close main table echo '<p><div class="centre"><input type=submit name=submit VALUE="' . _('Accept') . '"><input type=submit name=Cancel VALUE="' . _('Cancel') . '"></div>'; Modified: trunk/doc/Change.log.html =================================================================== --- trunk/doc/Change.log.html 2010-09-23 18:54:47 UTC (rev 3766) +++ trunk/doc/Change.log.html 2010-09-23 19:11:50 UTC (rev 3767) @@ -1,5 +1,6 @@ <p><font SIZE=4 COLOR=BLUE><b>webERP Change Log</b></font></p> <p></p> +<p>23/09/10 Tim: SalesTypes.php - SQL quoting corrections and layout changes and improvements</p> <p>23/09/10 Tim: SalesPeople.php - SQL quoting corrections and layout changes and improvements</p> <p>23/09/10 Tim: SalesGraph.php - Fix deprecated use of assigning by reference</p> <p>23/09/10 Tim: SalesGLPostings.php - SQL quoting corrections and layout changes and improvements</p> This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <tim...@us...> - 2010-09-23 19:29:33
|
Revision: 3768 http://web-erp.svn.sourceforge.net/web-erp/?rev=3768&view=rev Author: tim_schofield Date: 2010-09-23 19:29:27 +0000 (Thu, 23 Sep 2010) Log Message: ----------- SQL quoting corrections and layout changes and improvements Modified Paths: -------------- trunk/SelectAssetType.php trunk/doc/Change.log.html Modified: trunk/SelectAssetType.php =================================================================== --- trunk/SelectAssetType.php 2010-09-23 19:11:50 UTC (rev 3767) +++ trunk/SelectAssetType.php 2010-09-23 19:29:27 UTC (rev 3768) @@ -3,7 +3,7 @@ $PageSecurity = 2; $PricesSecurity = 9; include ('includes/session.inc'); -$title = _('Search Asset Types'); +$title = _('Select an Asset Type'); include ('includes/header.inc'); if (isset($_GET['StockID'])) { @@ -74,7 +74,7 @@ // options (links) to pages. This requires stock id also to be passed. } // end displaying item options if there is one and only one record echo '<form action="SelectAssetType.php?' . SID . '" method=post>'; -echo '<p class="page_title_text"><img src="' . $rootpath . '/css/' . $theme . '/images/magnifier.png" title="' . _('Search') . '" alt="">' . ' ' . _('Search for Inventory Items'); +echo '<p class="page_title_text"><img src="' . $rootpath . '/css/' . $theme . '/images/magnifier.png" title="' . _('Search') . '" alt="">' . ' ' . $title.'</p>'; echo '<table class=selection><tr>'; echo '<td>' . _('In Stock Category') . ':'; echo '<select name="StockCat">'; @@ -267,7 +267,7 @@ // echo '<input type=hidden name=Search value="Search">'; echo '<p></div>'; } - echo '<table cellpadding=2 colspan=7>'; + echo '<table cellpadding=2 colspan=7 class=selection>'; $tableheader = '<tr> <th>' . _('Code') . '</th> <th>' . _('Description') . '</th> Modified: trunk/doc/Change.log.html =================================================================== --- trunk/doc/Change.log.html 2010-09-23 19:11:50 UTC (rev 3767) +++ trunk/doc/Change.log.html 2010-09-23 19:29:27 UTC (rev 3768) @@ -1,5 +1,6 @@ <p><font SIZE=4 COLOR=BLUE><b>webERP Change Log</b></font></p> <p></p> +<p>23/09/10 Tim: SelectAssetType.php - SQL quoting corrections and layout changes and improvements</p> <p>23/09/10 Tim: SalesTypes.php - SQL quoting corrections and layout changes and improvements</p> <p>23/09/10 Tim: SalesPeople.php - SQL quoting corrections and layout changes and improvements</p> <p>23/09/10 Tim: SalesGraph.php - Fix deprecated use of assigning by reference</p> This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <tim...@us...> - 2010-09-24 16:09:23
|
Revision: 3769 http://web-erp.svn.sourceforge.net/web-erp/?rev=3769&view=rev Author: tim_schofield Date: 2010-09-24 16:09:17 +0000 (Fri, 24 Sep 2010) Log Message: ----------- SQL quoting corrections and layout changes and improvements and bug fixes Modified Paths: -------------- trunk/SelectCreditItems.php trunk/doc/Change.log.html Modified: trunk/SelectCreditItems.php =================================================================== --- trunk/SelectCreditItems.php 2010-09-23 19:29:27 UTC (rev 3768) +++ trunk/SelectCreditItems.php 2010-09-24 16:09:17 UTC (rev 3769) @@ -198,9 +198,11 @@ OR !isset($_SESSION['CreditItems']->DebtorNo) OR $_SESSION['CreditItems']->DebtorNo=='' ) { - echo '<font size=3><div class="centre"><b> - ' . _('Customer Selection') . '</b></font></div><br>'; echo '<form action="' . $_SERVER['PHP_SELF'] . '?' . SID . '" method=post>'; - echo '<table cellpadding=3 colspan=4>'; + echo '<p class="page_title_text"><img src="' . $rootpath . '/css/' . $theme . '/images/magnifier.png" title="' . + _('Search') . '" alt="">' . ' ' . _('Select Customer For Credit Note').'</p>'; + echo '<table cellpadding=3 colspan=4 class=selection>'; + echo '<tr><th colspan=5><font size=3 color=navy><b> ' . _('Customer Selection') . '</b></font></th></tr>'; echo '<tr>'; echo '<td><font size=1>' . _('Enter text in the customer name') . ':</font></td>'; echo '<td><input type="Text" name="Keywords" size=20 maxlength=25></td>'; @@ -209,11 +211,11 @@ echo '<td><input type="Text" name="CustCode" size=15 maxlength=18></td>'; echo '</tr>'; echo '</table>'; - echo '<div class="centre"><input type=submit name="SearchCust" VALUE="' . _('Search Now') . '"></div>'; + echo '<br /><div class="centre"><input type=submit name="SearchCust" VALUE="' . _('Search Now') . '"></div>'; if (isset($result_CustSelect)) { - echo '<table cellpadding=2 colspan=7 BORDER=1>'; + echo '<br /><table cellpadding=2 colspan=7 class=selection>'; $TableHeader = '<tr> <th>' . _('Code') . '</th> @@ -265,7 +267,8 @@ /* everything below here only do if a customer is selected first add a header to show who we are making a credit note for */ - echo '<font size=4><b><U><div class="centre">' . $_SESSION['CreditItems']->CustomerName . ' - ' . $_SESSION['CreditItems']->DeliverTo . '</div></U></b></font><br>'; + echo '<p class="page_title_text"><img src="' . $rootpath . '/css/' . $theme . '/images/magnifier.png" title="' . + _('Search') . '" alt="">' . ' ' . $_SESSION['CreditItems']->CustomerName . ' - ' . $_SESSION['CreditItems']->DeliverTo.'</p>'; /* do the search for parts that might be being looked up to add to the credit note */ if (isset($_POST['Search'])){ @@ -388,7 +391,7 @@ /*Process Quick Entry */ - If (isset($_POST['QuickEntry'])){ + if (isset($_POST['QuickEntry'])){ /* get the item details from the database and hold them in the cart object make the quantity 1 by default then add it to the cart */ $i=1; do { @@ -523,7 +526,7 @@ $Narrative = $_POST['Narrative_' . $LineItem->LineNumber]; if (isset($_POST['Price_' . $LineItem->LineNumber])){ - if ($_POST['Gross']==True){ + if (isset($_POST['Gross']) and $_POST['Gross']==True){ $TaxTotalPercent =0; foreach ($LineItem->Taxes AS $Tax) { if ($Tax->TaxOnTax ==1){ @@ -545,13 +548,13 @@ } } } + if ($Quantity<0 OR $Price <0 OR $DiscountPercentage >100 OR $DiscountPercentage <0){ + prnMsg(_('The item could not be updated because you are attempting to set the quantity credited to less than 0 or the price less than 0 or the discount more than 100% or less than 0%'),'warn'); + } elseif (isset($_POST['Quantity_' . $LineItem->LineNumber])) { + $_SESSION['CreditItems']->update_cart_item($LineItem->LineNumber, $Quantity, $Price, $DiscountPercentage/100, $Narrative, 'No', $LineItem->ItemDue, $LineItem->POLine, 0); + } } - if ($Quantity<0 OR $Price <0 OR $DiscountPercentage >100 OR $DiscountPercentage <0){ - prnMsg(_('The item could not be updated because you are attempting to set the quantity credited to less than 0 or the price less than 0 or the discount more than 100% or less than 0%'),'warn'); - } elseif (isset($_POST['Quantity_' . $LineItem->LineNumber])) { - $_SESSION['CreditItems']->update_cart_item($LineItem->LineNumber, $Quantity, $Price, $DiscountPercentage/100, $Narrative, 'No', $LineItem->ItemDue, $LineItem->POLine); - } } foreach ($_SESSION['CreditItems']->FreightTaxes as $FreightTaxLine) { @@ -641,7 +644,7 @@ /* This is where the credit note as selected should be displayed reflecting any deletions or insertions*/ echo ' - <table cellpadding=2 colspan=7> + <table cellpadding=2 colspan=7 class=selection> <tr> <th>' . _('Item Code') . '</th> <th>' . _('Item Description') . '</th> @@ -678,7 +681,7 @@ $RowStarter = '<tr class="OddTableRows">'; $k++; } - + echo $RowStarter . '<td>' . $LineItem->StockID . '</td> <td>' . $LineItem->ItemDescription . '</td>'; @@ -713,6 +716,9 @@ $TaxLineTotal =0; //initialise tax total for the line foreach ($LineItem->Taxes AS $Tax) { + $TaxTotals[$Tax->TaxAuthID] =0; + } + foreach ($LineItem->Taxes AS $Tax) { if ($i>0){ echo '<br>'; } @@ -739,11 +745,10 @@ <td><a href="' . $_SERVER['PHP_SELF'] . '?' . SID . '&Delete=' . $LineItem->LineNumber . '" onclick="return confirm(\'' . _('Are you sure you wish to delete this line item from the credit note?') . '\');">' . _('Delete') . '</a></td> - <td>' . $LineItem->LineNumber . '</td> </tr>'; echo $RowStarter; - echo '<td colspan=11><textarea name="Narrative_' . $LineItem->LineNumber . '" cols=100% rows=1>' . $LineItem->Narrative . '</TEXTAREa><br><hr></td></tr>'; + echo '<td colspan=11><textarea name="Narrative_' . $LineItem->LineNumber . '" cols=100% rows=1>' . $LineItem->Narrative . '</textarea><br></td></tr>'; $_SESSION['CreditItems']->total = $_SESSION['CreditItems']->total + $LineTotal; @@ -805,16 +810,16 @@ echo '<tr> <td colspan=7 class=number>' . _('Credit Totals') . "</td> - <td class=number><hr><b>$DisplayTotal</b><hr></td> + <td class=number><b>$DisplayTotal</b></td> <td colspan=2></td> - <td class=number><hr><b>" . number_format($TaxTotal,2) . "<hr></td> - <td class=number><hr><b>" . number_format($TaxTotal+($_SESSION['CreditItems']->total + $_SESSION['CreditItems']->FreightCost),2) . "</b><hr></td> + <td class=number><b>" . number_format($TaxTotal,2) . "</td> + <td class=number><b>" . number_format($TaxTotal+($_SESSION['CreditItems']->total + $_SESSION['CreditItems']->FreightCost),2) . "</b></td> </tr></table>"; /*Now show options for the credit note */ - echo '<br><table><tr><td>' . _('Credit Note Type') . ' :</td><td><select name=CreditType>'; + echo '<br><table class=selection><tr><td>' . _('Credit Note Type') . ' :</td><td><select name=CreditType>'; if (!isset($_POST['CreditType']) OR $_POST['CreditType']=='Return'){ echo '<option selected VALUE="Return">' . _('Goods returned to store'); echo '<option VALUE="WriteOff">' . _('Goods written off'); @@ -876,23 +881,25 @@ } echo '</select></td></tr>'; } + if (!isset($_POST['CreditText'])) { + $_POST['CreditText']=''; + } echo '<tr><td>' . _('Credit Note Text') . ' :</td> <td><textarea name=CreditText COLS=31 ROWS=5>' . $_POST['CreditText'] . '</textarea></td> </tr> - </table>'; + </table><br />'; $OKToProcess = true; /*Check for the worst */ - if ($_POST['CreditType']=='WriteOff' AND !isset($_POST['WriteOffGLCode'])){ + if (isset($_POST['CreditType']) and $_POST['CreditType']=='WriteOff' AND !isset($_POST['WriteOffGLCode'])){ prnMsg (_('The GL code to write off the credit value to must be specified. Please select the appropriate GL code for the selection box'),'info'); $OKToProcess = false; } echo '<div class="centre"><input type=submit name="Update" VALUE="' . _('Update') . '"> <input type=submit name="CancelCredit" VALUE="' . _('Cancel') . '" onclick="return confirm(\'' . _('Are you sure you wish to cancel the whole of this credit note?') . '\');">'; if (!isset($_POST['ProcessCredit']) AND $OKToProcess == true){ - echo '<input type=submit name="ProcessCredit" VALUE="' . _('Process Credit Note') . '"></div>'; + echo '<input type=submit name="ProcessCredit" VALUE="' . _('Process Credit Note') . '"></div><br />'; } - echo '<hr>'; } # end of if lines @@ -910,8 +917,8 @@ $result1 = DB_query($SQL,$db); - echo '<br><table> - <tr><td><font size=2>' . _('Select a stock category') . ':</font><select name="StockCat">'; + echo '<br><table class=selection> + <tr><td>' . _('Select a stock category') . ': <select name="StockCat">'; echo '<option selected VALUE="All">' . _('All'); while ($myrow1 = DB_fetch_array($result1)) { @@ -929,13 +936,13 @@ if (!isset($_POST['StockCode'])) { $_POST['StockCode'] = ''; } - echo '<td><font size=2>' . _('Enter text extracts in the description') . ':</font></td>'; + echo '<td>' . _('Enter text extracts in the description') . ': </td>'; echo '<td><input type="Text" name="Keywords" size=20 maxlength=25 VALUE="' . $_POST['Keywords'] . '"></td></tr>'; echo '<tr><td></td>'; - echo '<td><font SIZE 3><b>' ._('OR') . '</b></font><font size=2>' . _('Enter extract of the Stock Code') . ':</font></td>'; + echo '<td><font SIZE 3><b>' ._('OR') . '</b></font> ' . _('Enter extract of the Stock Code') . ': </td>'; echo '<td><input type="Text" name="StockCode" size=15 maxlength=18 VALUE="' . $_POST['StockCode'] . '"></td>'; echo '</tr>'; - echo '</table><div class="centre">'; + echo '</table><br /><div class="centre">'; echo '<input type=submit name="Search" VALUE="' . _('Search Now') .'">'; echo '<input type=submit Name="ChangeCustomer" VALUE="' . _('Change Customer') . '">'; @@ -944,7 +951,7 @@ if (isset($SearchResult)) { - echo '<table cellpadding=2 colspan=7 BORDER=1>'; + echo '<table cellpadding=2 colspan=7 class=selection>'; $TableHeader = '<tr><th>' . _('Code') . '</th> <th>' . _('Description') . '</th> <th>' . _('Units') .'</th></tr>'; @@ -988,8 +995,9 @@ } /*end if part searching required */ elseif(!isset($_POST['ProcessCredit'])) { /*quick entry form */ /*FORM VARIABLES TO POST TO THE CREDIT NOTE 10 AT A TIME WITH PART CODE AND QUANTITY */ - echo '<div class="centre"><font size=4 color=BLUE><b>' . _('Quick Entry') . '</b></font></div><br><table border=1> - <tr> + echo '<table class=selection>'; + echo '<tr><th colspan=2><font size=3 color=navy><b>' . _('Quick Entry') . '</th></tr>'; + echo '<tr> <th>' . _('Part Code') . '</th> <th>' . _('Quantity') . '</th> </tr>'; @@ -1000,7 +1008,7 @@ <td><input type="text" class="number" name="qty_' . $i . '" size=6 maxlength=6></td></tr>'; } - echo '</table><div class="centre"><input type="submit" name="QuickEntry" value="' . _('Process Entries') . '"> + echo '</table><br /><div class="centre"><input type="submit" name="QuickEntry" value="' . _('Process Entries') . '"> <input type="submit" name="PartSearch" value="' . _('Search Parts') . '"></div>'; } @@ -1067,18 +1075,18 @@ ovfreight, rate, invtext) - VALUES (". $CreditNo . ", + VALUES ('". $CreditNo . "', 11, '" . $_SESSION['CreditItems']->DebtorNo . "', '" . $_SESSION['CreditItems']->Branch . "', '" . $SQLCreditDate . "', '" . date('Y-m-d H-i-s') . "', - " . $PeriodNo . ", + '" . $PeriodNo . "', '" . $_SESSION['CreditItems']->DefaultSalesType . "', - " . -($_SESSION['CreditItems']->total) . ", - " . -$TaxTotal . ", - " . -$_SESSION['CreditItems']->FreightCost . ", - " . $_SESSION['CurrencyRate'] . ", + '" . -($_SESSION['CreditItems']->total) . "', + '" . -$TaxTotal . "', + '" . -$_SESSION['CreditItems']->FreightCost . "', + '" . $_SESSION['CurrencyRate'] . "', '" . $_POST['CreditText'] . "' )"; @@ -1152,18 +1160,18 @@ VALUES ('" . $CreditLine->StockID . "', 11, - " . $CreditNo . ", + '" . $CreditNo . "', '" . $_SESSION['CreditItems']->Location . "', '" . $SQLCreditDate . "', '" . $_SESSION['CreditItems']->DebtorNo . "', '" . $_SESSION['CreditItems']->Branch . "', - " . $LocalCurrencyPrice . ", - " . $PeriodNo . ", + '" . $LocalCurrencyPrice . "', + '" . $PeriodNo . "', '" . $_POST['CreditText'] . "', - " . $CreditLine->Quantity . ", - " . $CreditLine->DiscountPercent . ", - " . $CreditLine->StandardCost . ", - " . $QtyOnHandPrior . ", + '" . $CreditLine->Quantity . "', + '" . $CreditLine->DiscountPercent . "', + '" . $CreditLine->StandardCost . "', + '" . $QtyOnHandPrior . "', 1, '" . $CreditLine->Narrative . "')"; @@ -1198,13 +1206,13 @@ '" . $SQLCreditDate . "', '" . $_SESSION['CreditItems']->DebtorNo . "', '" . $_SESSION['CreditItems']->Branch . "', - " . $LocalCurrencyPrice . ", - " . $PeriodNo . ", - " . $CreditLine->Quantity . ", - " . $CreditLine->DiscountPercent . ", - " . $CreditLine->StandardCost . ", + '" . $LocalCurrencyPrice . "', + '" . $PeriodNo . "', + '" . $CreditLine->Quantity . "', + '" . $CreditLine->DiscountPercent . "', + '" . $CreditLine->StandardCost . "', '" . $_POST['CreditText'] . "', - " . ($QtyOnHandPrior + $CreditLine->Quantity) . ", + '" . ($QtyOnHandPrior + $CreditLine->Quantity) . "', '" . $CreditLine->Narrative . "' )"; @@ -1227,16 +1235,16 @@ VALUES ( '" . $CreditLine->StockID . "', 11, - " . $CreditNo . ", + '" . $CreditNo . "', '" . $_SESSION['CreditItems']->Location . "', '" . $SQLCreditDate . "', '" . $_SESSION['CreditItems']->DebtorNo . "', '" . $_SESSION['CreditItems']->Branch . "', - " . $LocalCurrencyPrice . ", - " . $PeriodNo . ", - " . $CreditLine->Quantity . ", - " . $CreditLine->DiscountPercent . ", - " . $CreditLine->StandardCost . ", + '" . $LocalCurrencyPrice . "', + '" . $PeriodNo . "', + '" . $CreditLine->Quantity . "', + '" . $CreditLine->DiscountPercent . "', + '" . $CreditLine->StandardCost . "', '" . $_POST['CreditText'] . "', '" . $CreditLine->Narrative . "' )"; @@ -1252,16 +1260,16 @@ /*Insert the taxes that applied to this line */ foreach ($CreditLine->Taxes as $Tax) { - $SQL = 'INSERT INTO stockmovestaxes (stkmoveno, + $SQL = "INSERT INTO stockmovestaxes (stkmoveno, taxauthid, taxrate, taxcalculationorder, taxontax) - VALUES (' . $StkMoveNo . ', - ' . $Tax->TaxAuthID . ', - ' . $Tax->TaxRate . ', - ' . $Tax->TaxCalculationOrder . ', - ' . $Tax->TaxOnTax . ')'; + VALUES ('" . $StkMoveNo . "', + '" . $Tax->TaxAuthID . "', + '" . $Tax->TaxRate . "', + '" . $Tax->TaxCalculationOrder . "', + '" . $Tax->TaxOnTax . "')"; $ErrMsg = _('CRITICAL ERROR') . '! ' . _('NOTE DOWN THIS ERROR AND SEEK ASSISTANCE') . ': ' . _('Taxes and rates applicable to this credit note line item could not be inserted because'); $DbgMsg = _('The following SQL to insert the stock movement tax detail records was used'); @@ -1297,7 +1305,7 @@ '" . $CreditLine->StockID . "', '" . $_SESSION['CreditItems']->Location . "', '" . $Item->BundleRef . "', - " . $Item->BundleQty . " + '" . $Item->BundleQty . "' )"; $ErrMsg = _('CRITICAL ERROR') . '! ' . _('NOTE DOWN THIS ERROR AND SEEK ASSISTANCE') . ': ' . _('The new serial stock item record could not be inserted because'); @@ -1322,10 +1330,10 @@ serialno, moveqty) VALUES ( - " . $StkMoveNo . ", + '" . $StkMoveNo . "', '" . $CreditLine->StockID . "', '" . $Item->BundleRef . "', - " . $Item->BundleQty . " + '" . $Item->BundleQty . "' )"; $ErrMsg = _('CRITICAL ERROR') . '! ' . _('NOTE DOWN THIS ERROR AND SEEK ASSISTANCE') . ': ' . _('The serial stock movement record could not be inserted because'); $DbgMsg = _('The following SQL to insert the serial stock movement record was used'); @@ -1410,16 +1418,16 @@ VALUES ( '" . $AssParts['component'] . "', 11, - " . $CreditNo . ", + '" . $CreditNo . "', '" . $_SESSION['CreditItems']->Location . "', '" . $SQLCreditDate . "', '" . $_SESSION['CreditItems']->DebtorNo . "', '" . $_SESSION['CreditItems']->Branch . "', - " . $PeriodNo . ", + '" . $PeriodNo . "', '" . _('Assembly') .': ' . $CreditLine->StockID . "', - " . $AssParts['quantity'] * $CreditLine->Quantity . ", " . $AssParts['standard'] . ", + '" . $AssParts['quantity'] * $CreditLine->Quantity . ", " . $AssParts['standard'] . "', 0, - " . ($QtyOnHandPrior + ($AssParts['quantity'] * $CreditLine->Quantity)) . " + '" . ($QtyOnHandPrior + ($AssParts['quantity'] * $CreditLine->Quantity)) . "' )"; $ErrMsg = _('CRITICAL ERROR') . '! ' . _('NOTE DOWN THIS ERROR AND SEEK ASSISTANCE') . ': ' . _('Stock movement records for the assembly components of') . ' ' . $CreditLine->StockID . ' ' . _('could not be inserted because'); @@ -1469,19 +1477,19 @@ VALUES ( '" . $CreditLine->StockID . "', 11, - " . $CreditNo . ", + '" . $CreditNo . "', '" . $_SESSION['CreditItems']->Location . "', '" . $SQLCreditDate . "', '" . $_SESSION['CreditItems']->DebtorNo . "', '" . $_SESSION['CreditItems']->Branch . "', - " . $LocalCurrencyPrice . ", - " . $PeriodNo . ", - " . -$CreditLine->Quantity . ", - " . $CreditLine->DiscountPercent . ", - " . $CreditLine->StandardCost . ", + '" . $LocalCurrencyPrice . "', + '" . $PeriodNo . "', + '" . -$CreditLine->Quantity . "', + '" . $CreditLine->DiscountPercent . "', + '" . $CreditLine->StandardCost . "', '" . $_POST['CreditText'] . "', 0, - " . $QtyOnHandPrior . ", + '" . $QtyOnHandPrior . "', '" . $CreditLine->Narrative . "' )"; @@ -1505,16 +1513,16 @@ VALUES ( '" . $CreditLine->StockID . "', 11, - " . $CreditNo . ", + '" . $CreditNo . "', '" . $_SESSION['CreditItems']->Location . "', '" . $SQLCreditDate . "', '" . $_SESSION['CreditItems']->DebtorNo . "', '" . $_SESSION['CreditItems']->Branch . "', - " . $LocalCurrencyPrice . ", - " . $PeriodNo . ", - " . -$CreditLine->Quantity . ", - " . $CreditLine->DiscountPercent . ", - " . $CreditLine->StandardCost . ", + '" . $LocalCurrencyPrice . "', + '" . $PeriodNo . "', + '" . -$CreditLine->Quantity . "', + '" . $CreditLine->DiscountPercent . "', + '" . $CreditLine->StandardCost . "', '" . $_POST['CreditText'] . "', 0)"; @@ -1551,10 +1559,10 @@ serialno, moveqty) VALUES ( - " . $StkMoveNo . ", + '" . $StkMoveNo . "', '" . $CreditLine->StockID . "', '" . $Item->BundleRef . "', - " . -$Item->BundleQty . " + '" . -$Item->BundleQty . "' )"; $ErrMsg = _('CRITICAL ERROR') . '! ' . _('NOTE DOWN THIS ERROR AND SEEK ASSISTANCE') . ': ' . _('The serial stock movement record for the write off could not be inserted because'); $DbgMsg = _('The following SQL to insert the serial stock movement write off record was used'); @@ -1586,7 +1594,7 @@ AND salesanalysis.area=custbranch.area AND salesanalysis.salesperson=custbranch.salesman AND salesanalysis.typeabbrev ='" . $_SESSION['CreditItems']->DefaultSalesType . "' - AND salesanalysis.periodno=" . $PeriodNo . " + AND salesanalysis.periodno='" . $PeriodNo . "' AND salesanalysis.cust = '" . $_SESSION['CreditItems']->DebtorNo . "' AND salesanalysis.custbranch = '" . $_SESSION['CreditItems']->Branch . "' AND salesanalysis.stockid = '" . $CreditLine->StockID . "' @@ -1613,7 +1621,7 @@ WHERE salesanalysis.area='" . $myrow[2] . "' AND salesanalysis.salesperson='" . $myrow[3] . "' AND salesanalysis.typeabbrev ='" . $_SESSION['CreditItems']->DefaultSalesType . "' - AND salesanalysis.periodno = " . $PeriodNo . " + AND salesanalysis.periodno = '" . $PeriodNo . "' AND salesanalysis.cust = '" . $_SESSION['CreditItems']->DebtorNo . "' AND salesanalysis.custbranch = '" . $_SESSION['CreditItems']->Branch . "' AND salesanalysis.stockid = '" . $CreditLine->StockID . "' @@ -1630,7 +1638,7 @@ WHERE salesanalysis.area='" . $myrow[2] . "' AND salesanalysis.salesperson='" . $myrow[3] . "' AND salesanalysis.typeabbrev ='" . $_SESSION['CreditItems']->DefaultSalesType . "' - AND salesanalysis.periodno = " . $PeriodNo . " + AND salesanalysis.periodno = '" . $PeriodNo . "' AND salesanalysis.cust = '" . $_SESSION['CreditItems']->DebtorNo . "' AND salesanalysis.custbranch = '" . $_SESSION['CreditItems']->Branch . "' AND salesanalysis.stockid = '" . $CreditLine->StockID . "' @@ -1657,12 +1665,12 @@ stkcategory) SELECT '" . $_SESSION['CreditItems']->DefaultSalesType . "', - " . $PeriodNo . ", - " . -($CreditLine->Price * $CreditLine->Quantity / $_SESSION['CurrencyRate']) . ", + '" . $PeriodNo . "', + '" . -($CreditLine->Price * $CreditLine->Quantity / $_SESSION['CurrencyRate']) . "', '" . $_SESSION['CreditItems']->DebtorNo . "', '" . $_SESSION['CreditItems']->Branch . "', 0, - " . -($CreditLine->DiscountPercent * $CreditLine->Price * $CreditLine->Quantity / $_SESSION['CurrencyRate']) . ", + '" . -($CreditLine->DiscountPercent * $CreditLine->Price * $CreditLine->Quantity / $_SESSION['CurrencyRate']) . "', '" . $CreditLine->StockID . "', custbranch.area, 1, @@ -1690,13 +1698,13 @@ salesperson, stkcategory) SELECT '" . $_SESSION['CreditItems']->DefaultSalesType . "', - " . $PeriodNo . ", - " . -($CreditLine->Price * $CreditLine->Quantity / $_SESSION['CurrencyRate']) . ", - " . -($CreditLine->StandardCost * $CreditLine->Quantity) . ", + '" . $PeriodNo . "', + '" . -($CreditLine->Price * $CreditLine->Quantity / $_SESSION['CurrencyRate']) . "', + '" . -($CreditLine->StandardCost * $CreditLine->Quantity) . "', '" . $_SESSION['CreditItems']->DebtorNo . "', '" . $_SESSION['CreditItems']->Branch . "', - " . -$CreditLine->Quantity . ", - " . -($CreditLine->DiscountPercent * $CreditLine->Price * $CreditLine->Quantity / $_SESSION['CurrencyRate']) . ", + '" . -$CreditLine->Quantity . "', + '" . -($CreditLine->DiscountPercent * $CreditLine->Price * $CreditLine->Quantity / $_SESSION['CurrencyRate']) . "', '" . $CreditLine->StockID . "', custbranch.area, 1, @@ -1738,12 +1746,12 @@ amount) VALUES ( 11, - " . $CreditNo . ", + '" . $CreditNo . "', '" . $SQLCreditDate . "', - " . $PeriodNo . ", - " . $COGSAccount . ", + '" . $PeriodNo . "', + '" . $COGSAccount . "', '" . $_SESSION['CreditItems']->DebtorNo . " - " . $CreditLine->StockID . " x " . $CreditLine->Quantity . " @ " . $CreditLine->StandardCost . "', - " . ($CreditLine->StandardCost * -$CreditLine->Quantity) . ")"; + '" . ($CreditLine->StandardCost * -$CreditLine->Quantity) . "')"; $ErrMsg = _('CRITICAL ERROR') . '! ' . _('NOTE DOWN THIS ERROR AND SEEK ASSISTANCE') . ': ' . _('The cost of the stock credited GL posting could not be inserted because'); $DbgMsg = _('The following SQL to insert the GLTrans record was used'); @@ -1765,12 +1773,12 @@ amount) VALUES ( 11, - " . $CreditNo . ", + '" . $CreditNo . "', '" . $SQLCreditDate . "', - " . $PeriodNo . ", - " . $_POST['WriteOffGLCode'] . ", + '" . $PeriodNo . "', + '" . $_POST['WriteOffGLCode'] . "', '" . $_SESSION['CreditItems']->DebtorNo . " - " . $CreditLine->StockID . " x " . $CreditLine->Quantity . " @ " . $CreditLine->StandardCost . "', - " . ($CreditLine->StandardCost * $CreditLine->Quantity) . " + '" . ($CreditLine->StandardCost * $CreditLine->Quantity) . "' )"; $ErrMsg = _('CRITICAL ERROR') . '! ' . _('NOTE DOWN THIS ERROR AND SEEK ASSISTANCE') . ': ' . _('The cost of the stock credited GL posting could not be inserted because'); @@ -1790,11 +1798,12 @@ amount) VALUES ( 11, - " . $CreditNo . ", + '" . $CreditNo . "', '" . $SQLCreditDate . "', - " . $PeriodNo . ", " . $StockGLCode['stockact'] . ", + '" . $PeriodNo . "', + '" . $StockGLCode['stockact'] . "', '" . $_SESSION['CreditItems']->DebtorNo . " - " . $CreditLine->StockID . " x " . $CreditLine->Quantity . " @ " . $CreditLine->StandardCost . "', - " . ($CreditLine->StandardCost * $CreditLine->Quantity) . " + '" . ($CreditLine->StandardCost * $CreditLine->Quantity) . "' )"; $ErrMsg = _('CRITICAL ERROR') . '! ' . _('NOTE DOWN THIS ERROR AND SEEK ASSISTANCE') . ': ' . _('The stock side (or write off) of the cost of sales GL posting could not be inserted because'); @@ -1822,12 +1831,12 @@ amount) VALUES ( 11, - " . $CreditNo . ", + '" . $CreditNo . "', '" . $SQLCreditDate . "', - " . $PeriodNo . ", - " . $SalesGLAccounts['salesglcode'] . ", + '" . $PeriodNo . "', + '" . $SalesGLAccounts['salesglcode'] . "', '" . $_SESSION['CreditItems']->DebtorNo . " - " . $CreditLine->StockID . " x " . $CreditLine->Quantity . " @ " . $CreditLine->Price . "', - " . ($CreditLine->Price * $CreditLine->Quantity)/$_SESSION['CurrencyRate'] . " + '" . ($CreditLine->Price * $CreditLine->Quantity)/$_SESSION['CurrencyRate'] . "' )"; $ErrMsg = _('CRITICAL ERROR') . '! ' . _('NOTE DOWN THIS ERROR AND SEEK ASSISTANCE') . ': ' . _('The credit note GL posting could not be inserted because'); @@ -1846,12 +1855,12 @@ amount) VALUES ( 11, - " . $CreditNo . ", + '" . $CreditNo . "', '" . $SQLCreditDate . "', - " . $PeriodNo . ", - " . $SalesGLAccounts['discountglcode'] . ", + '" . $PeriodNo . "', + '" . $SalesGLAccounts['discountglcode'] . "', '" . $_SESSION['CreditItems']->DebtorNo . " - " . $CreditLine->StockID . " @ " . ($CreditLine->DiscountPercent * 100) . "%', - " . -($CreditLine->Price * $CreditLine->Quantity * $CreditLine->DiscountPercent)/$_SESSION['CurrencyRate'] . " + '" . -($CreditLine->Price * $CreditLine->Quantity * $CreditLine->DiscountPercent)/$_SESSION['CurrencyRate'] . "' )"; @@ -1878,12 +1887,12 @@ amount) VALUES ( 11, - " . $CreditNo . ", + '" . $CreditNo . "', '" . $SQLCreditDate . "', - " . $PeriodNo . ", - " . $_SESSION['CompanyRecord']['debtorsact'] . ", + '" . $PeriodNo . "', + '" . $_SESSION['CompanyRecord']['debtorsact'] . "', '" . $_SESSION['CreditItems']->DebtorNo . "', - " . -($_SESSION['CreditItems']->total + $_SESSION['CreditItems']->FreightCost + $TaxTotal)/$_SESSION['CurrencyRate'] . ")"; + '" . -($_SESSION['CreditItems']->total + $_SESSION['CreditItems']->FreightCost + $TaxTotal)/$_SESSION['CurrencyRate'] . "')"; $ErrMsg = _('CRITICAL ERROR') . '! ' . _('NOTE DOWN THIS ERROR AND SEEK ASSISTANCE') . ': ' . _('The total debtor GL posting for the credit note could not be inserted because'); $DbgMsg = _('The following SQL to insert the GLTrans record was used'); @@ -1900,12 +1909,12 @@ amount) VALUES ( 11, - " . $CreditNo . ", + '" . $CreditNo . "', '" . $SQLCreditDate . "', - " . $PeriodNo . ", - " . $_SESSION['CompanyRecord']['freightact'] . ", + '" . $PeriodNo . "', + '" . $_SESSION['CompanyRecord']['freightact'] . "', '" . $_SESSION['CreditItems']->DebtorNo . "', - " . $_SESSION['CreditItems']->FreightCost/$_SESSION['CurrencyRate'] . " + '" . $_SESSION['CreditItems']->FreightCost/$_SESSION['CurrencyRate'] . "' )"; $ErrMsg = _('CRITICAL ERROR') . '! ' . _('NOTE DOWN THIS ERROR AND SEEK ASSISTANCE') . ': ' . _('The freight GL posting for this credit note could not be inserted because'); @@ -1925,12 +1934,12 @@ ) VALUES ( 11, - " . $CreditNo . ", + '" . $CreditNo . "', '" . $SQLCreditDate . "', - " . $PeriodNo . ", - " . $TaxGLCodes[$TaxAuthID] . ", + '" . $PeriodNo . "', + '" . $TaxGLCodes[$TaxAuthID] . "', '" . $_SESSION['CreditItems']->DebtorNo . "', - " . ($TaxAmount/$_SESSION['CurrencyRate']) . " + '" . ($TaxAmount/$_SESSION['CurrencyRate']) . "' )"; $ErrMsg = _('CRITICAL ERROR') . '! ' . _('NOTE DOWN THIS ERROR AND SEEK ASSISTANCE') . ': ' . _('The tax GL posting could not be inserted because'); @@ -1959,4 +1968,4 @@ echo '</form>'; include('includes/footer.inc'); -?> +?> \ No newline at end of file Modified: trunk/doc/Change.log.html =================================================================== --- trunk/doc/Change.log.html 2010-09-23 19:29:27 UTC (rev 3768) +++ trunk/doc/Change.log.html 2010-09-24 16:09:17 UTC (rev 3769) @@ -1,5 +1,6 @@ <p><font SIZE=4 COLOR=BLUE><b>webERP Change Log</b></font></p> <p></p> +<p>24/09/10 Tim: SelectCreditItems.php - SQL quoting corrections and layout changes and improvements and bug fixes</p> <p>23/09/10 Tim: SelectAssetType.php - SQL quoting corrections and layout changes and improvements</p> <p>23/09/10 Tim: SalesTypes.php - SQL quoting corrections and layout changes and improvements</p> <p>23/09/10 Tim: SalesPeople.php - SQL quoting corrections and layout changes and improvements</p> This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <tim...@us...> - 2010-09-24 16:15:40
|
Revision: 3770 http://web-erp.svn.sourceforge.net/web-erp/?rev=3770&view=rev Author: tim_schofield Date: 2010-09-24 16:15:34 +0000 (Fri, 24 Sep 2010) Log Message: ----------- Layout changes and improvements and bug fixes Modified Paths: -------------- trunk/SelectCustomer.php trunk/doc/Change.log.html Modified: trunk/SelectCustomer.php =================================================================== --- trunk/SelectCustomer.php 2010-09-24 16:09:17 UTC (rev 3769) +++ trunk/SelectCustomer.php 2010-09-24 16:15:34 UTC (rev 3770) @@ -20,7 +20,7 @@ $_POST['CustAdd']=''; $_POST['CustType']=''; } -echo '<p class="page_title_text"><img src="' . $rootpath . '/css/' . $theme . '/images/customer.png" title="' . _('Customer') . '" alt="">' . ' ' . _('Customers') . ''; +echo '<p class="page_title_text"><img src="' . $rootpath . '/css/' . $theme . '/images/customer.png" title="' . _('Customer') . '" alt="">' . ' ' . _('Customers') . '</p>'; if (!isset($_SESSION['CustomerType'])) { //initialise if not already done $_SESSION['CustomerType'] = ""; } @@ -275,7 +275,7 @@ echo '<p class="page_title_text"><img src="' . $rootpath . '/css/' . $theme . '/images/customer.png" title="' . _('Customer') . '" alt="">' . ' ' . _('Customer') . ' : ' . $_SESSION['CustomerID'] . ' - ' . $CustomerName . ' - ' . $phone . _(' has been selected') . '</p>'; echo '<div class="page_help_text">' . _('Select a menu option to operate using this customer') . '.</div><br>'; $_POST['Select'] = NULL; - echo '<table cellpadding=4 width=90%><tr><th width=33%>' . _('Customer Inquiries') . '</th> + echo '<table cellpadding=4 width=90% class=selection><tr><th width=33%>' . _('Customer Inquiries') . '</th> <th width=33%>' . _('Customer Transactions') . '</th> <th width=33%>' . _('Customer Maintenance') . '</th></tr>'; echo '<tr><td valign=top class="select">'; @@ -450,7 +450,7 @@ <input type=submit name="Next" value="' . _('Next') . '">'; echo '</div>'; } - echo '<br><table cellpadding=2 colspan=7>'; + echo '<br><table cellpadding=2 colspan=7 class=selection>'; $TableHeader = '<tr> <th>' . _('Code') . '</th> <th>' . _('Customer Name') . '</th> Modified: trunk/doc/Change.log.html =================================================================== --- trunk/doc/Change.log.html 2010-09-24 16:09:17 UTC (rev 3769) +++ trunk/doc/Change.log.html 2010-09-24 16:15:34 UTC (rev 3770) @@ -1,5 +1,6 @@ <p><font SIZE=4 COLOR=BLUE><b>webERP Change Log</b></font></p> <p></p> +<p>24/09/10 Tim: SelectCustomer.php - Layout changes and improvements and bug fixes</p> <p>24/09/10 Tim: SelectCreditItems.php - SQL quoting corrections and layout changes and improvements and bug fixes</p> <p>23/09/10 Tim: SelectAssetType.php - SQL quoting corrections and layout changes and improvements</p> <p>23/09/10 Tim: SalesTypes.php - SQL quoting corrections and layout changes and improvements</p> This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <tim...@us...> - 2010-09-24 18:03:53
|
Revision: 3771 http://web-erp.svn.sourceforge.net/web-erp/?rev=3771&view=rev Author: tim_schofield Date: 2010-09-24 18:03:47 +0000 (Fri, 24 Sep 2010) Log Message: ----------- SQL quoting corrections and layout changes and improvements and bug fixes Modified Paths: -------------- trunk/SelectGLAccount.php trunk/doc/Change.log.html Modified: trunk/SelectGLAccount.php =================================================================== --- trunk/SelectGLAccount.php 2010-09-24 16:15:34 UTC (rev 3770) +++ trunk/SelectGLAccount.php 2010-09-24 18:03:47 UTC (rev 3771) @@ -10,12 +10,12 @@ include('includes/header.inc'); $msg=''; +unset($result); -If (isset($_POST['Select'])) { +if (isset($_POST['Select'])) { $result = DB_query("SELECT accountname FROM chartmaster WHERE accountcode=" . $_POST['Select'],$db); $myrow = DB_fetch_row($result); - echo '<p class="page_title_text"><img src="'.$rootpath.'/css/'.$theme.'/images/magnifier.png" title="' . _('Search') . '" alt="">' . ' ' . _('Search for General Ledger Accounts'); echo '<div class="page_help_text">' . _('Account Code') . ' <b>' . $_POST['Select'] . ' - ' . $myrow[0] . ' </b>' . _('has been selected') . '. <br>' . _('Select one of the links below to operate using this Account') . '.</div>'; @@ -28,16 +28,16 @@ } elseif (isset($_POST['Search'])){ - If (strlen($_POST['Keywords']>0) AND strlen($_POST['GLCode'])>0) { + if (strlen($_POST['Keywords']>0) AND strlen($_POST['GLCode'])>0) { $msg=_('Account name keywords have been used in preference to the account code extract entered'); } - If ($_POST['Keywords']=='' AND $_POST['GLCode']=='') { + if ($_POST['Keywords']=='' AND $_POST['GLCode']=='') { $msg=_('At least one Account Name keyword OR an extract of an Account Code must be entered for the search'); } else { If (strlen($_POST['Keywords'])>0) { //insert wildcard characters in spaces $SearchString = '%' . str_replace(' ', '%', $_POST['Keywords']) . '%'; - + $SQL = "SELECT chartmaster.accountcode, chartmaster.accountname, chartmaster.group_, @@ -60,14 +60,14 @@ FROM chartmaster, accountgroups WHERE chartmaster.group_=accountgroups.groupname - AND chartmaster.accountcode >= " . $_POST['GLCode'] . " + AND chartmaster.accountcode >= '" . $_POST['GLCode'] . "' ORDER BY chartmaster.accountcode"; } elseif(!is_numeric($_POST['GLCode'])){ prnMsg(_('The general ledger code specified must be numeric - all account numbers must be numeric'),'warn'); unset($SQL); } - if (isset($SQL)){ + if (isset($SQL) and $SQL!=''){ $result = DB_query($SQL, $db); } } //one of keywords or GLCode was more than a zero length string @@ -76,43 +76,43 @@ if (!isset($AccountID)) { -echo '<p class="page_title_text"><img src="'.$rootpath.'/css/'.$theme.'/images/magnifier.png" title="' . _('Search') . '" alt="">' . ' ' . _('Search for General Ledger Accounts'); -echo "<br><form action='" . $_SERVER['PHP_SELF'] . '?' . SID . "' method=post>"; + echo '<p class="page_title_text"><img src="'.$rootpath.'/css/'.$theme.'/images/magnifier.png" title="' . _('Search') . + '" alt="">' . ' ' . _('Search for General Ledger Accounts') . '</p>'; + echo "<br><form action='" . $_SERVER['PHP_SELF'] . '?' . SID . "' method=post>"; -if(strlen($msg)>1){ - prnMsg($msg,'info'); -} + if(strlen($msg)>1){ + prnMsg($msg,'info'); + } -echo '<table cellpadding=3 colspan=4> - <tr> - <td><font size=1>' . _('Enter extract of text in the Account name') .":</font></td> - <td><input type='Text' name='Keywords' size=20 maxlength=25></td> - <td><font size=3><b>" . _('OR') . "</b></font></td> - <td><font size=1>" . _('Enter Account No. to search from') . ":</font></td> - <td><input type='Text' name='GLCode' size=15 maxlength=18 class=number ></td> - </tr> - </table><br>"; + echo '<table cellpadding=3 colspan=4 class=selection> + <tr> + <td><font size=1>' . _('Enter extract of text in the Account name') .":</font></td> + <td><input type='Text' name='Keywords' size=20 maxlength=25></td> + <td><font size=3><b>" . _('OR') . "</b></font></td> + <td><font size=1>" . _('Enter Account No. to search from') . ":</font></td> + <td><input type='Text' name='GLCode' size=15 maxlength=18 class=number ></td> + </tr> + </table><br>"; -echo '<div class="centre"><input type=submit name="Search" VALUE=' . _('Search Now') . '"> - <input type=submit action=RESET VALUE="' . _('Reset') .'"></div>'; + echo '<div class="centre"><input type=submit name="Search" value=' . _('Search Now') . '"> + <input type=submit action=reset value="' . _('Reset') .'"></div>'; + if (isset($result) and DB_num_rows($result)>0) { -If (isset($result)) { + echo '<br /><table cellpadding=2 colspan=7 class=selection>'; - echo '<table cellpadding=2 colspan=7 BORDER=2>'; - - $TableHeader = '<tr><th>' . _('Code') . '</th> + $TableHeader = '<tr><th>' . _('Code') . '</th> <th>' . _('Account Name') . '</th> <th>' . _('Group') . '</th> <th>' . _('Account Type') . '</th></tr>'; - echo $TableHeader; + echo $TableHeader; - $j = 1; + $j = 1; - while ($myrow=DB_fetch_array($result)) { + while ($myrow=DB_fetch_array($result)) { - printf("<tr><td><font size=1><input type=submit name='Select' VALUE='%s'</font></td> + printf("<tr><td><font size=1><input type=submit name='Select' VALUE='%s'</font></td> <td><font size=1>%s</font></td> <td><font size=1>%s</font></td> <td><font size=1>%s</font></td> @@ -122,26 +122,24 @@ $myrow['group_'], $myrow['pl']); - $j++; - If ($j == 12){ - $j=1; + $j++; + if ($j == 12){ + $j=1; echo $TableHeader; - } + } //end of page full new headings if - } + } //end of while loop - echo '</table>'; + echo '</table>'; -} + } //end if results to show -?> + echo '</form>'; -</form> +} //end AccountID already selected -<?php } //end AccountID already selected - include('includes/footer.inc'); -?> +?> \ No newline at end of file Modified: trunk/doc/Change.log.html =================================================================== --- trunk/doc/Change.log.html 2010-09-24 16:15:34 UTC (rev 3770) +++ trunk/doc/Change.log.html 2010-09-24 18:03:47 UTC (rev 3771) @@ -1,5 +1,6 @@ <p><font SIZE=4 COLOR=BLUE><b>webERP Change Log</b></font></p> <p></p> +<p>24/09/10 Tim: SelectGLAccount.php - SQL quoting corrections and layout changes and improvements and bug fixes</p> <p>24/09/10 Tim: SelectCustomer.php - Layout changes and improvements and bug fixes</p> <p>24/09/10 Tim: SelectCreditItems.php - SQL quoting corrections and layout changes and improvements and bug fixes</p> <p>23/09/10 Tim: SelectAssetType.php - SQL quoting corrections and layout changes and improvements</p> This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <tim...@us...> - 2010-09-24 18:12:27
|
Revision: 3772 http://web-erp.svn.sourceforge.net/web-erp/?rev=3772&view=rev Author: tim_schofield Date: 2010-09-24 18:12:20 +0000 (Fri, 24 Sep 2010) Log Message: ----------- SQL quoting corrections Modified Paths: -------------- trunk/SelectOrderItems.php trunk/doc/Change.log.html Modified: trunk/SelectOrderItems.php =================================================================== --- trunk/SelectOrderItems.php 2010-09-24 18:03:47 UTC (rev 3771) +++ trunk/SelectOrderItems.php 2010-09-24 18:12:20 UTC (rev 3772) @@ -77,7 +77,7 @@ /*read in all the guff from the selected order into the Items cart */ - $OrderHeaderSQL = 'SELECT salesorders.debtorno, + $OrderHeaderSQL = "SELECT salesorders.debtorno, debtorsmaster.name, salesorders.branchcode, salesorders.customerref, @@ -120,7 +120,7 @@ AND salesorders.branchcode = custbranch.branchcode AND debtorsmaster.paymentterms=paymentterms.termsindicator AND locations.loccode=salesorders.fromstkloc - AND salesorders.orderno = ' . $_GET['ModifyOrderNumber']; + AND salesorders.orderno = '" . $_GET['ModifyOrderNumber'] . "'"; $ErrMsg = _('The order cannot be retrieved because'); @@ -210,7 +210,7 @@ ON salesorderdetails.stkcode = stockmaster.stockid INNER JOIN locstock ON locstock.stockid = stockmaster.stockid WHERE locstock.loccode = '" . $myrow['fromstkloc'] . "' - AND salesorderdetails.orderno =" . $_GET['ModifyOrderNumber'] . " + AND salesorderdetails.orderno ='" . $_GET['ModifyOrderNumber'] . "' ORDER BY salesorderdetails.orderlineno"; $ErrMsg = _('The line items of the order cannot be retrieved because'); @@ -680,10 +680,10 @@ if($_SESSION['ExistingOrder']!=0) { //need to check that not already dispatched - $sql = 'SELECT qtyinvoiced + $sql = "SELECT qtyinvoiced FROM salesorderdetails - WHERE orderno=' . $_SESSION['ExistingOrder'] . ' - AND qtyinvoiced>0'; + WHERE orderno='" . $_SESSION['ExistingOrder'] . "' + AND qtyinvoiced>0"; $InvQties = DB_query($sql,$db); @@ -698,7 +698,7 @@ if ($OK_to_delete==1){ if($_SESSION['ExistingOrder']!=0){ - $SQL = 'DELETE FROM salesorderdetails WHERE salesorderdetails.orderno =' . $_SESSION['ExistingOrder']; + $SQL = "DELETE FROM salesorderdetails WHERE salesorderdetails.orderno ='" . $_SESSION['ExistingOrder'] . "'"; $ErrMsg =_('The order detail lines could not be deleted because'); $DelResult=DB_query($SQL,$db,$ErrMsg); @@ -1697,4 +1697,4 @@ echo '<script type="text/javascript">if (document.SelectParts) {defaultControl(document.SelectCustomer.CustKeywords);}</script>'; } include('includes/footer.inc'); -?> +?> \ No newline at end of file Modified: trunk/doc/Change.log.html =================================================================== --- trunk/doc/Change.log.html 2010-09-24 18:03:47 UTC (rev 3771) +++ trunk/doc/Change.log.html 2010-09-24 18:12:20 UTC (rev 3772) @@ -1,5 +1,6 @@ <p><font SIZE=4 COLOR=BLUE><b>webERP Change Log</b></font></p> <p></p> +<p>24/09/10 Tim: SelectOrderItems.php - SQL quoting corrections</p> <p>24/09/10 Tim: SelectGLAccount.php - SQL quoting corrections and layout changes and improvements and bug fixes</p> <p>24/09/10 Tim: SelectCustomer.php - Layout changes and improvements and bug fixes</p> <p>24/09/10 Tim: SelectCreditItems.php - SQL quoting corrections and layout changes and improvements and bug fixes</p> This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <tim...@us...> - 2010-09-24 18:19:06
|
Revision: 3773 http://web-erp.svn.sourceforge.net/web-erp/?rev=3773&view=rev Author: tim_schofield Date: 2010-09-24 18:18:59 +0000 (Fri, 24 Sep 2010) Log Message: ----------- SQL quoting corrections Modified Paths: -------------- trunk/SelectProduct.php trunk/doc/Change.log.html Modified: trunk/SelectProduct.php =================================================================== --- trunk/SelectProduct.php 2010-09-24 18:12:20 UTC (rev 3772) +++ trunk/SelectProduct.php 2010-09-24 18:18:59 UTC (rev 3773) @@ -198,7 +198,7 @@ $PropValResult = DB_query("SELECT value FROM stockitemproperties WHERE stockid='" . $StockID . "' - AND stkcatpropid =" . $PropertyRow['stkcatpropid'], $db); + AND stkcatpropid ='" . $PropertyRow['stkcatpropid']."'", $db); $PropValRow = DB_fetch_row($PropValResult); $PropertyValue = $PropValRow[0]; echo '<tr><th align="right">' . $PropertyRow['label'] . ':</th>'; Modified: trunk/doc/Change.log.html =================================================================== --- trunk/doc/Change.log.html 2010-09-24 18:12:20 UTC (rev 3772) +++ trunk/doc/Change.log.html 2010-09-24 18:18:59 UTC (rev 3773) @@ -1,5 +1,6 @@ <p><font SIZE=4 COLOR=BLUE><b>webERP Change Log</b></font></p> <p></p> +<p>24/09/10 Tim: SelectProduct.php - SQL quoting corrections</p> <p>24/09/10 Tim: SelectOrderItems.php - SQL quoting corrections</p> <p>24/09/10 Tim: SelectGLAccount.php - SQL quoting corrections and layout changes and improvements and bug fixes</p> <p>24/09/10 Tim: SelectCustomer.php - Layout changes and improvements and bug fixes</p> This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <tim...@us...> - 2010-09-24 18:47:54
|
Revision: 3774 http://web-erp.svn.sourceforge.net/web-erp/?rev=3774&view=rev Author: tim_schofield Date: 2010-09-24 18:47:48 +0000 (Fri, 24 Sep 2010) Log Message: ----------- Layout changes and improvements and bug fixes Modified Paths: -------------- trunk/SelectRecurringSalesOrder.php trunk/doc/Change.log.html Modified: trunk/SelectRecurringSalesOrder.php =================================================================== --- trunk/SelectRecurringSalesOrder.php 2010-09-24 18:18:59 UTC (rev 3773) +++ trunk/SelectRecurringSalesOrder.php 2010-09-24 18:47:48 UTC (rev 3774) @@ -7,13 +7,16 @@ include('includes/header.inc'); echo '<form action=' . $_SERVER['PHP_SELF'] .'?' .SID . ' method=post>'; +echo '<p class="page_title_text"><img src="' . $rootpath . '/css/' . $theme . '/images/customer.png" title="' . + _('Inventory Items') . '" alt="">' . ' ' . $title . '</p>'; -echo _('Select recurring order templates for delivery from:') . ' ' . '<select name="StockLocation">'; +echo '<table class=selection><tr><td>'; +echo _('Select recurring order templates for delivery from:') . ' </td><td>' . '<select name="StockLocation">'; $sql = 'SELECT loccode, locationname FROM locations'; - + $resultStkLocs = DB_query($sql,$db); - + while ($myrow=DB_fetch_array($resultStkLocs)){ if (isset($_POST['StockLocation'])){ if ($myrow['loccode'] == $_POST['StockLocation']){ @@ -28,14 +31,12 @@ } } -echo '</select>  '; - -echo "<input type=submit name='SearchRecurringOrders' VALUE='" . _('Search Recurring Orders') . "'>"; +echo '</select></td></tr></table>'; -echo '<hr>'; +echo "<br /><div class=centre><input type=submit name='SearchRecurringOrders' VALUE='" . _('Search Recurring Orders') . "'></div>"; if (isset($_POST['SearchRecurringOrders'])){ - + $SQL = "SELECT recurringsalesorders.recurrorderno, debtorsmaster.name, custbranch.brname, @@ -64,14 +65,14 @@ recurringsalesorders.lastrecurrence, recurringsalesorders.stopdate, recurringsalesorders.frequency"; - + $ErrMsg = _('No recurring orders were returned by the SQL because'); $SalesOrdersResult = DB_query($SQL,$db,$ErrMsg); - + /*show a table of the orders returned by the SQL */ - - echo '<table cellpadding=2 colspan=7 WIDTH=100%>'; - + + echo '<br /><table cellpadding=2 colspan=7 width=90% class=selection>'; + $tableheader = "<tr> <th>" . _('Modify') . "</th> <th>" . _('Customer') . "</th> @@ -82,14 +83,14 @@ <th>" . _('Times p.a.') . "</th> <th>" . _('Order Total') . "</th> </tr>"; - + echo $tableheader; - + $j = 1; $k=0; //row colour counter while ($myrow=DB_fetch_array($SalesOrdersResult)) { - - + + if ($k==1){ echo '<tr class="EvenTableRows">'; $k=0; @@ -97,12 +98,12 @@ echo '<tr class="OddTableRows">';; $k++; } - + $ModifyPage = $rootpath . "/RecurringSalesOrders.php?" . SID . '&ModifyRecurringSalesOrder=' . $myrow['recurrorderno']; $FormatedLastRecurrence = ConvertSQLDate($myrow['lastrecurrence']); $FormatedStopDate = ConvertSQLDate($myrow['stopdate']); $FormatedOrderValue = number_format($myrow['ordervalue'],2); - + printf("<td><a href='%s'>%s</a></td> <td>%s</td> <td>%s</td> @@ -121,7 +122,7 @@ $FormatedStopDate, $myrow['frequency'], $FormatedOrderValue); - + $j++; If ($j == 12){ $j=1; @@ -130,7 +131,7 @@ //end of page full new headings if } //end of while loop - + echo '</table></form>'; } Modified: trunk/doc/Change.log.html =================================================================== --- trunk/doc/Change.log.html 2010-09-24 18:18:59 UTC (rev 3773) +++ trunk/doc/Change.log.html 2010-09-24 18:47:48 UTC (rev 3774) @@ -1,5 +1,6 @@ <p><font SIZE=4 COLOR=BLUE><b>webERP Change Log</b></font></p> <p></p> +<p>24/09/10 Tim: SelectRecurringSalesOrder.php - Layout changes and improvements and bug fixes</p> <p>24/09/10 Tim: SelectProduct.php - SQL quoting corrections</p> <p>24/09/10 Tim: SelectOrderItems.php - SQL quoting corrections</p> <p>24/09/10 Tim: SelectGLAccount.php - SQL quoting corrections and layout changes and improvements and bug fixes</p> This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <tim...@us...> - 2010-09-24 19:33:04
|
Revision: 3775 http://web-erp.svn.sourceforge.net/web-erp/?rev=3775&view=rev Author: tim_schofield Date: 2010-09-24 19:32:58 +0000 (Fri, 24 Sep 2010) Log Message: ----------- Layout changes and improvements and bug fixes Modified Paths: -------------- trunk/SelectSalesOrder.php trunk/doc/Change.log.html Modified: trunk/SelectSalesOrder.php =================================================================== --- trunk/SelectSalesOrder.php 2010-09-24 18:47:48 UTC (rev 3774) +++ trunk/SelectSalesOrder.php 2010-09-24 19:32:58 UTC (rev 3775) @@ -22,10 +22,10 @@ if (isset($_REQUEST['OrderNumber']) AND $_REQUEST['OrderNumber']!='') { $_REQUEST['OrderNumber'] = trim($_REQUEST['OrderNumber']); if (!is_numeric($_REQUEST['OrderNumber'])){ - echo '<br><b>' . _('The Order Number entered MUST be numeric') . '</b><br>'; - unset ($_REQUEST['OrderNumber']); - include('includes/footer.inc'); - exit; + echo '<br><b>' . _('The Order Number entered MUST be numeric') . '</b><br>'; + unset ($_REQUEST['OrderNumber']); + include('includes/footer.inc'); + exit; } else { echo _('Order Number') . ' - ' . $_REQUEST['OrderNumber']; } @@ -113,12 +113,14 @@ if (!isset($_REQUEST['OrderNumber']) or $_REQUEST['OrderNumber']==''){ - echo _('Order number') . ": <input type=text name='OrderNumber' maxlength=8 size=9>  " . _('From Stock Location') . ":<select name='StockLocation'> "; - + echo '<table class=selection>'; + echo '<tr><td>' . _('Order number') . ": </td><td><input type=text name='OrderNumber' maxlength=8 size=9></td><td>" . + _('From Stock Location') . ":</td><td><select name='StockLocation'> "; + $sql = 'SELECT loccode, locationname FROM locations'; - + $resultStkLocs = DB_query($sql,$db); - + while ($myrow=DB_fetch_array($resultStkLocs)){ if (isset($_POST['StockLocation'])){ if ($myrow['loccode'] == $_POST['StockLocation']){ @@ -133,13 +135,13 @@ } } - echo '</select>   '; + echo '</select></td><td>'; echo '<select name="Quotations">'; - + if ($_GET['Quotations']=='Quotes_Only'){ $_POST['Quotations']='Quotes_Only'; } - + if ($_POST['Quotations']=='Quotes_Only'){ echo '<option selected VALUE="Quotes_Only">' . _('Quotations Only'); echo '<option VALUE="Orders_Only">' . _('Orders Only'); @@ -147,10 +149,11 @@ echo '<option selected VALUE="Orders_Only">' . _('Orders Only'); echo '<option VALUE="Quotes_Only">' . _('Quotations Only'); } - - echo '</select>   '; - echo "<input type=submit name='SearchOrders' VALUE='" . _('Search') . "'>"; - echo ' <a href="' . $rootpath . '/SelectOrderItems.php?' . SID . '&NewOrder=Yes">' . _('Add Sales Order') . '</a>'; + + echo '</select> </td><td>'; + echo "<input type=submit name='SearchOrders' VALUE='" . _('Search') . "'></td>"; + echo ' <td><a href="' . $rootpath . '/SelectOrderItems.php?' . SID . '&NewOrder=Yes">' . + _('Add Sales Order') . '</a></td></tr></table>'; } $SQL='SELECT categoryid, @@ -160,10 +163,11 @@ $result1 = DB_query($SQL,$db); - echo '<hr> - <font size=1>' . _('To search for sales orders for a specific part use the part selection facilities below') . "</font> <input type=submit name='SearchParts' VALUE='" . _('Search Parts Now') . "'><input type=submit name='ResetPart' VALUE='" . _('Show All') . "'> - </div><table> - <tr> + echo "</font>"; + echo "<br /><table class=selection>"; + echo '<tr><th colspan=6><font size=3 color=navy>' . _('To search for sales orders for a specific part use the part selection facilities below'); + echo '</th></tr>'; + echo "<tr> <td><font size=1>" . _('Select a stock category') . ":</font> <select name='StockCat'>"; @@ -179,12 +183,13 @@ <td><font size 3><b>" . _('OR') . ' </b></font><font size=1>' . _('Enter extract of the Stock Code') . "</b>:</font></td> <td><input type='Text' name='StockCode' size=15 maxlength=18></td> </tr> - </table> - <hr>"; + </table>"; + echo "<br /><input type=submit name='SearchParts' VALUE='" . _('Search Parts Now') . + "'><input type=submit name='ResetPart' VALUE='" . _('Show All') . "'></div><br />"; -if (isset($StockItemsResult)) { +if (isset($StockItemsResult) and DB_num_rows($StockItemsResult)>0) { - echo '<table cellpadding=2 colspan=7 BORDER=2>'; + echo '<table cellpadding=2 colspan=7 class=selection>'; $TableHeader = "<tr> <th>" . _('Code') . "</th> <th>" . _('Description') . "</th> @@ -260,7 +265,7 @@ AND debtorsmaster.debtorno = custbranch.debtorno AND salesorderdetails.completed=0 AND salesorders.orderno=". $_REQUEST['OrderNumber'] ." - AND salesorders.quotation =" .$Quotations . " + AND salesorders.quotation =" .$Quotations . " GROUP BY salesorders.orderno, debtorsmaster.name, custbranch.brname, @@ -299,8 +304,8 @@ AND salesorders.debtorno='" . $_REQUEST['SelectedCustomer'] ."' AND salesorders.fromstkloc = '". $_POST['StockLocation'] . "' ORDER BY salesorders.orderno"; - + } else { $SQL = "SELECT salesorders.orderno, debtorsmaster.name, @@ -403,11 +408,11 @@ $SalesOrdersResult = DB_query($SQL,$db,$ErrMsg); /*show a table of the orders returned by the SQL */ + if (DB_num_rows($SalesOrdersResult)>0) { + echo '<table cellpadding=2 colspan=7 width=95% class=selection>'; - echo '<table cellpadding=2 colspan=7 WIDTH=100%>'; - - if (isset($_POST['Quotations']) and $_POST['Quotations']=='Orders_Only'){ - $tableheader = "<tr> + if (isset($_POST['Quotations']) and $_POST['Quotations']=='Orders_Only'){ + $tableheader = "<tr> <th>" . _('Modify') . "</th> <th>" . _('Invoice') . "</th> <th>" . _('Dispatch Note') . "</th> @@ -419,8 +424,8 @@ <th>" . _('Req Del Date') . "</th> <th>" . _('Delivery To') . "</th> <th>" . _('Order Total') . "</th></tr>"; - } else { - $tableheader = "<tr> + } else { + $tableheader = "<tr> <th>" . _('Modify') . "</th> <th>" . _('Print Quote') . "</th> <th>" . _('Customer') . "</th> @@ -430,26 +435,26 @@ <th>" . _('Req Del Date') . "</th> <th>" . _('Delivery To') . "</th> <th>" . _('Quote Total') . "</th></tr>"; - } - - echo $tableheader; + } - $j = 1; - $k=0; //row colour counter - while ($myrow=DB_fetch_array($SalesOrdersResult)) { + echo $tableheader; + } + $j = 1; + $k=0; //row colour counter + while ($myrow=DB_fetch_array($SalesOrdersResult)) { - if ($k==1){ - echo '<tr class="EvenTableRows">'; - $k=0; - } else { - echo '<tr class="OddTableRows">'; - $k++; - } + if ($k==1){ + echo '<tr class="EvenTableRows">'; + $k=0; + } else { + echo '<tr class="OddTableRows">'; + $k++; + } $ModifyPage = $rootpath . "/SelectOrderItems.php?" . SID . '&ModifyOrderNumber=' . $myrow['orderno']; $Confirm_Invoice = $rootpath . '/ConfirmDispatch_Invoice.php?' . SID . '&OrderNumber=' .$myrow['orderno']; - + if ($_SESSION['PackNoteFormat']==1){ /*Laser printed A4 default */ $PrintDispatchNote = $rootpath . '/PrintCustOrder_generic.php?' . SID . '&TransNo=' . $myrow['orderno']; } else { /*pre-printed stationery default */ @@ -466,7 +471,7 @@ } else { $PrintText = _('Reprint'); } - + if ($_POST['Quotations']=='Orders_Only'){ printf("<td><a href='%s'>%s</a></td> <td><a href='%s'>" . _('Invoice') . "</a></td> @@ -514,7 +519,7 @@ $myrow['deliverto'], $FormatedOrderValue); } - + $j++; if ($j == 12){ $j=1; Modified: trunk/doc/Change.log.html =================================================================== --- trunk/doc/Change.log.html 2010-09-24 18:47:48 UTC (rev 3774) +++ trunk/doc/Change.log.html 2010-09-24 19:32:58 UTC (rev 3775) @@ -1,5 +1,6 @@ <p><font SIZE=4 COLOR=BLUE><b>webERP Change Log</b></font></p> <p></p> +<p>24/09/10 Tim: SelectSalesOrder.php - Layout changes and improvements and bug fixes</p> <p>24/09/10 Tim: SelectRecurringSalesOrder.php - Layout changes and improvements and bug fixes</p> <p>24/09/10 Tim: SelectProduct.php - SQL quoting corrections</p> <p>24/09/10 Tim: SelectOrderItems.php - SQL quoting corrections</p> This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <tim...@us...> - 2010-09-25 08:11:45
|
Revision: 3776 http://web-erp.svn.sourceforge.net/web-erp/?rev=3776&view=rev Author: tim_schofield Date: 2010-09-25 08:11:38 +0000 (Sat, 25 Sep 2010) Log Message: ----------- SQL quoting corrections and layout changes and improvements and bug fixes Modified Paths: -------------- trunk/SelectWorkOrder.php trunk/doc/Change.log.html Modified: trunk/SelectWorkOrder.php =================================================================== --- trunk/SelectWorkOrder.php 2010-09-24 19:32:58 UTC (rev 3775) +++ trunk/SelectWorkOrder.php 2010-09-25 08:11:38 UTC (rev 3776) @@ -26,10 +26,6 @@ } else { echo _('Work Order Number') . ' - ' . $_REQUEST['WO']; } -} else { - if (isset($_REQUEST['SelectedStockItem'])) { - echo _('for the item') . ': ' . $_REQUEST['SelectedStockItem'] . ' ' . _('and') . " <input type=hidden name='SelectedStockItem' value='" . $_REQUEST['SelectedStockItem'] . "'>"; - } } if (isset($_POST['SearchParts'])){ @@ -108,6 +104,9 @@ if (!isset($_REQUEST['WO']) or ($_REQUEST['WO']=='')){ echo '<table class=selection><tr><td>'; + if (isset($_REQUEST['SelectedStockItem'])) { + echo _('For the item') . ': ' . $_REQUEST['SelectedStockItem'] . ' ' . _('and') . " <input type=hidden name='SelectedStockItem' value='" . $_REQUEST['SelectedStockItem'] . "'>"; + } echo _('Work Order number') . ": <input type=text name='WO' MAXLENGTH =8 size=9>  " . _('Processing at') . ":<select name='StockLocation'> "; $sql = 'SELECT loccode, locationname FROM locations'; @@ -136,16 +135,16 @@ } if ($_POST['ClosedOrOpen']=='Closed_Only'){ - echo '<option selected VALUE="Closed_Only">' . _('Closed Work Orders Only'); - echo '<option VALUE="Open_Only">' . _('Open Work Orders Only'); + echo '<option selected value="Closed_Only">' . _('Closed Work Orders Only'); + echo '<option value="Open_Only">' . _('Open Work Orders Only'); } else { - echo '<option VALUE="Closed_Only">' . _('Closed Work Orders Only'); - echo '<option selected VALUE="Open_Only">' . _('Open Work Orders Only'); + echo '<option value="Closed_Only">' . _('Closed Work Orders Only'); + echo '<option selected value="Open_Only">' . _('Open Work Orders Only'); } echo '</select>   '; - echo "<input type=submit name='SearchOrders' VALUE='" . _('Search') . "'>"; - echo ' <a href="' . $rootpath . '/WorkOrderEntry.php?' . SID . '">' . _('New Work Order') . '</a></td></tr></table>'; + echo "<input type=submit name='SearchOrders' value='" . _('Search') . "'>"; + echo ' <a href="' . $rootpath . '/WorkOrderEntry.php?' . SID . '">' . _('New Work Order') . '</a></td></tr></table><br />'; } $SQL='SELECT categoryid, @@ -155,17 +154,14 @@ $result1 = DB_query($SQL,$db); - echo '<hr> - <table class=selection><tr><td><font size=1>' . _('To search for work orders for a specific item use the item selection facilities below') . "</font> - <input type=submit name='SearchParts' VALUE='" . _('Search Items Now') . "'> - <input type=submit name='ResetPart' VALUE='" . _('Show All') . "'> </td></tr></table><br> - <table class=selection> + echo "<table class=selection> + <tr><th colspan=6><font size=3 color=navy>" . _('To search for work orders for a specific item use the item selection facilities below') . "</font></th></tr> <tr> <td><font size=1>" . _('Select a stock category') . ":</font> <select name='StockCat'>"; while ($myrow1 = DB_fetch_array($result1)) { - echo "<option VALUE='". $myrow1['categoryid'] . "'>" . $myrow1['categorydescription']; + echo "<option value='". $myrow1['categoryid'] . "'>" . $myrow1['categorydescription']; } echo '</select> @@ -173,15 +169,16 @@ <td><input type='Text' name='Keywords' size=20 maxlength=25></td> </tr> <tr><td></td> - <td><font SIZE 3><b>" . _('OR') . ' </b></font><font size=1>' . _('Enter extract of the Stock Code') . "</b>:</font></td> + <td><font size=3><b>" . _('OR') . ' </b></font><font size=1>' . _('Enter extract of the Stock Code') . "</b>:</font></td> <td><input type='Text' name='StockCode' size=15 maxlength=18></td> </tr> - </table> - <hr>"; + </table><br />"; + echo "<div class=centre><input type=submit name='SearchParts' value='" . _('Search Items Now') . "'> + <input type=submit name='ResetPart' value='" . _('Show All') . "'></div>"; if (isset($StockItemsResult)) { - echo '<table cellpadding=2 colspan=7 BORDER=2>'; + echo '<br /><table cellpadding=2 colspan=7 class=selection>'; $TableHeader = "<tr> <th>" . _('Code') . "</th> <th>" . _('Description') . "</th> @@ -203,7 +200,7 @@ $k++; } - printf("<td><input type=submit name='SelectedStockItem' VALUE='%s'</td> + printf("<td><input type=submit name='SelectedStockItem' value='%s'</td> <td>%s</td> <td class=number>%s</td> <td>%s</td> @@ -248,8 +245,8 @@ FROM workorders INNER JOIN woitems ON workorders.wo=woitems.wo INNER JOIN stockmaster ON woitems.stockid=stockmaster.stockid - WHERE workorders.closed=" . $ClosedOrOpen . " - AND workorders.wo=". $_REQUEST['WO'] ." + WHERE workorders.closed='" . $ClosedOrOpen . "' + AND workorders.wo='". $_REQUEST['WO'] ."' ORDER BY workorders.wo, woitems.stockid"; } else { @@ -265,7 +262,7 @@ FROM workorders INNER JOIN woitems ON workorders.wo=woitems.wo INNER JOIN stockmaster ON woitems.stockid=stockmaster.stockid - WHERE workorders.closed=" . $ClosedOrOpen . " + WHERE workorders.closed='" . $ClosedOrOpen . "' AND woitems.stockid='". $_REQUEST['SelectedStockItem'] ."' AND workorders.loccode='" . $_POST['StockLocation'] . "' ORDER BY workorders.wo, @@ -280,7 +277,7 @@ FROM workorders INNER JOIN woitems ON workorders.wo=woitems.wo INNER JOIN stockmaster ON woitems.stockid=stockmaster.stockid - WHERE workorders.closed=" . $ClosedOrOpen . " + WHERE workorders.closed='" . $ClosedOrOpen . "' AND workorders.loccode='" . $_POST['StockLocation'] . "' ORDER BY workorders.wo, woitems.stockid"; @@ -291,11 +288,11 @@ $WorkOrdersResult = DB_query($SQL,$db,$ErrMsg); /*show a table of the orders returned by the SQL */ + if (DB_num_rows($WorkOrdersResult)>0) { + echo '<br /><table cellpadding=2 colspan=7 width=95% class=selection>'; - echo '<table cellpadding=2 colspan=7 WIDTH=100%>'; - - $tableheader = "<tr> + $tableheader = "<tr> <th>" . _('Modify') . "</th> <th>" . _('Status') . "</th> <th>" . _('Receive') . "</th> @@ -308,8 +305,8 @@ <th>" . _('Required Date') . "</th> </tr>"; - echo $tableheader; - + echo $tableheader; + } $j = 1; $k=0; //row colour counter while ($myrow=DB_fetch_array($WorkOrdersResult)) { Modified: trunk/doc/Change.log.html =================================================================== --- trunk/doc/Change.log.html 2010-09-24 19:32:58 UTC (rev 3775) +++ trunk/doc/Change.log.html 2010-09-25 08:11:38 UTC (rev 3776) @@ -1,5 +1,6 @@ <p><font SIZE=4 COLOR=BLUE><b>webERP Change Log</b></font></p> <p></p> +<p>25/09/10 Tim: SelectWorkOrder.php - SQL quoting corrections and layout changes and improvements and bug fixes</p> <p>24/09/10 Tim: SelectSalesOrder.php - Layout changes and improvements and bug fixes</p> <p>24/09/10 Tim: SelectRecurringSalesOrder.php - Layout changes and improvements and bug fixes</p> <p>24/09/10 Tim: SelectProduct.php - SQL quoting corrections</p> This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <tim...@us...> - 2010-09-25 09:37:47
|
Revision: 3777 http://web-erp.svn.sourceforge.net/web-erp/?rev=3777&view=rev Author: tim_schofield Date: 2010-09-25 09:37:39 +0000 (Sat, 25 Sep 2010) Log Message: ----------- SQL quoting corrections and layout changes and improvements and bug fixes Modified Paths: -------------- trunk/ShipmentCosting.php trunk/doc/Change.log.html Modified: trunk/ShipmentCosting.php =================================================================== --- trunk/ShipmentCosting.php 2010-09-25 08:11:38 UTC (rev 3776) +++ trunk/ShipmentCosting.php 2010-09-25 09:37:39 UTC (rev 3777) @@ -10,6 +10,9 @@ include('includes/header.inc'); include('includes/SQL_CommonFunctions.inc'); +echo '<p class="page_title_text"><img src="'.$rootpath.'/css/'.$theme.'/images/magnifier.png" title="' . _('Search') . + '" alt="">' . ' ' . $title . '</p>'; + if (isset($_GET['NewShipment']) and $_GET['NewShipment']=='Yes'){ unset($_SESSION['Shipment']->LineItems); unset($_SESSION['Shipment']); @@ -32,7 +35,7 @@ shipments.closed FROM shipments INNER JOIN suppliers ON shipments.supplierid = suppliers.supplierid - WHERE shipments.shiptref = " . $_GET['SelectedShipment']; + WHERE shipments.shiptref = '" . $_GET['SelectedShipment'] . "'"; $ErrMsg = _('Shipment').' '. $_GET['SelectedShipment'] . ' ' . _('cannot be retrieved because a database error occurred'); $GetShiptHdrResult = DB_query($ShipmentHeaderSQL,$db, $ErrMsg); @@ -45,8 +48,9 @@ $HeaderData = DB_fetch_array($GetShiptHdrResult); echo '<br>'; -echo '<table> - <tr> +echo '<table class=selection>'; +echo '<tr><th colspan=4><font size=3 color=navy>'._('Shipment Details').'</font></th></tr>'; +echo '<tr> <td><b>'. _('Shipment') .': </td> <td><b>' . $_GET['SelectedShipment'] . '</b></td> <td><b>'. _('From').' ' . $HeaderData['suppname'] . '</b></td> @@ -64,7 +68,7 @@ /*Get the total non-stock item shipment charges */ -$sql = "SELECT SUM(value) FROM shipmentcharges WHERE stockid='' AND shiptref =" . $_GET['SelectedShipment']; +$sql = "SELECT SUM(value) FROM shipmentcharges WHERE stockid='' AND shiptref ='" . $_GET['SelectedShipment']. "'"; $ErrMsg = _('Shipment') . ' ' . $_GET['SelectedShipment'] . ' ' . _('general costs cannot be retrieved from the database'); $GetShiptCostsResult = DB_query($sql,$db, $ErrMsg); @@ -81,7 +85,7 @@ /*Now Get the total of stock items invoiced against the shipment */ -$sql = "SELECT SUM(value) FROM shipmentcharges WHERE stockid<>'' AND shiptref =" . $_GET['SelectedShipment']; +$sql = "SELECT SUM(value) FROM shipmentcharges WHERE stockid<>'' AND shiptref ='" . $_GET['SelectedShipment'] . "'"; $ErrMsg = _('Shipment') . ' ' . $_GET['SelectedShipment'] . ' ' . _('Item costs cannot be retrieved from the database'); $GetShiptCostsResult = DB_query($sql,$db); @@ -102,10 +106,10 @@ purchorderdetails.itemdescription, SUM(purchorderdetails.qtyinvoiced) as totqtyinvoiced, SUM(purchorderdetails.quantityrecd) as totqtyrecd - FROM purchorderdetails - WHERE purchorderdetails.shiptref=" . $_GET['SelectedShipment'] . " + FROM purchorderdetails + WHERE purchorderdetails.shiptref='" . $_GET['SelectedShipment'] . "' GROUP BY purchorderdetails.itemcode, - purchorderdetails.itemdescription"; + purchorderdetails.itemdescription"; $ErrMsg = _('The lines on the shipment could not be retrieved from the database'); $LineItemsResult = db_query($LineItemsSQL,$db, $ErrMsg); @@ -114,22 +118,23 @@ if (isset($_POST['Close'])){ while ($myrow=DB_fetch_array($LineItemsResult)){ - if ($myrow['totqtyinvoiced'] < $myrow['totqtyrecd']){ - prnMsg(_('Cannot close a shipment where the quantity received is more than the quantity invoiced. Check the item') . ' ' . $myrow['itemcode'] . ' - ' . $myrow['itemdescription'],'warn'); - unset($_POST['Close']); - } - } - DB_data_seek($LineItemsResult,0); + if ($myrow['totqtyinvoiced'] < $myrow['totqtyrecd']){ + prnMsg(_('Cannot close a shipment where the quantity received is more than the quantity invoiced. Check the item') . ' ' . $myrow['itemcode'] . ' - ' . $myrow['itemdescription'],'warn'); + unset($_POST['Close']); + } + } + DB_data_seek($LineItemsResult,0); } - if (isset($_POST['Close'])){ - /*Set up a transaction to buffer all updates or none */ + if (isset($_POST['Close'])){ + /*Set up a transaction to buffer all updates or none */ $result = DB_Txn_Begin($db); $PeriodNo = GetPeriod(Date($_SESSION['DefaultDateFormat']), $db); - } + } - echo '<table cellpadding=2 colspan=7 BORDER=0>'; + echo '<br /><table cellpadding=2 colspan=7 class=selection>'; + echo '<tr><th colspan=9><font color=navy size=3>' . _('Items on shipment'). '</font></th></tr>'; $TableHeader = '<tr> <th>'. _('Item'). '</th> <th>'. _('Quantity'). '<br>'. _('Invoiced'). '</th> @@ -145,7 +150,7 @@ /*show the line items on the shipment with the value invoiced and shipt cost */ $k=0; //row colour counter - $TotalShiptVariance = 0; + $TotalShiptVariance = 0; $RowCounter =0; while ($myrow=DB_fetch_array($LineItemsResult)) { @@ -158,13 +163,13 @@ $k=1; } - $sql = "SELECT SUM(shipmentcharges.value) AS invoicedcharges - FROM shipmentcharges - WHERE shipmentcharges.stockid ='" . $myrow['itemcode'] . "' - AND shipmentcharges.shiptref=" . $_GET['SelectedShipment']; - $ItemChargesResult = DB_query($sql,$db); - $ItemChargesRow = DB_fetch_row($ItemChargesResult); - $ItemCharges = $ItemChargesRow[0]; + $sql = "SELECT SUM(shipmentcharges.value) AS invoicedcharges + FROM shipmentcharges + WHERE shipmentcharges.stockid ='" . $myrow['itemcode'] . "' + AND shipmentcharges.shiptref='" . $_GET['SelectedShipment'] . "'"; + $ItemChargesResult = DB_query($sql,$db); + $ItemChargesRow = DB_fetch_row($ItemChargesResult); + $ItemCharges = $ItemChargesRow[0]; if ($TotalInvoiceValueOfShipment>0){ $PortionOfCharges = $TotalCostsToApportion *($ItemCharges/$TotalInvoiceValueOfShipment); @@ -177,16 +182,20 @@ } else { $ItemShipmentCost =0; } - $sql = 'SELECT SUM(grns.stdcostunit*grns.qtyrecd) AS costrecd - FROM grns INNER JOIN purchorderdetails - ON grns.podetailitem=purchorderdetails.podetailitem - WHERE purchorderdetails.shiptref=' . $_GET['SelectedShipment'] . " - AND purchorderdetails.itemcode = '" . $myrow['itemcode'] . "'"; + $sql = "SELECT SUM(grns.stdcostunit*grns.qtyrecd) AS costrecd + FROM grns INNER JOIN purchorderdetails + ON grns.podetailitem=purchorderdetails.podetailitem + WHERE purchorderdetails.shiptref='" . $_GET['SelectedShipment'] . "' + AND purchorderdetails.itemcode = '" . $myrow['itemcode'] . "'"; - $StdCostResult = DB_query($sql,$db); - $StdCostRow = DB_fetch_row($StdCostResult); - $CostRecd = $StdCostRow[0]; - $StdCostUnit = $StdCostRow[0]/$myrow['totqtyrecd']; + $StdCostResult = DB_query($sql,$db); + $StdCostRow = DB_fetch_row($StdCostResult); + $CostRecd = $StdCostRow[0]; + if ($myrow['totqtyrecd']==0) { + $StdCostUnit = 0; + } else { + $StdCostUnit = $StdCostRow[0]/$myrow['totqtyrecd']; + } if ($ItemShipmentCost !=0){ $Variance = $StdCostUnit - $ItemShipmentCost; @@ -194,7 +203,7 @@ $Variance =0; } - $TotalShiptVariance += ($Variance *$myrow['totqtyinvoiced']); + $TotalShiptVariance += ($Variance *$myrow['totqtyinvoiced']); if ($StdCostUnit>0 ){ $VariancePercentage = number_format(($Variance*100)/$StdCostUnit); @@ -206,22 +215,22 @@ if ( isset($_POST['Close']) AND $Variance !=0){ - if ($_SESSION['CompanyRecord']['gllink_stock']==1){ - $StockGLCodes = GetStockGLCode($myrow['itemcode'],$db); - } + if ($_SESSION['CompanyRecord']['gllink_stock']==1){ + $StockGLCodes = GetStockGLCode($myrow['itemcode'],$db); + } - /*GL journals depend on the costing method used currently: - Standard cost - the price variance between the exisitng system cost and the shipment cost is taken as a variance - to the price varaince account - Weighted Average Cost - the price variance is taken to the stock account and the cost updated to ensure the GL - stock account ties up to the stock valuation - */ + /*GL journals depend on the costing method used currently: + Standard cost - the price variance between the exisitng system cost and the shipment cost is taken as a variance + to the price varaince account + Weighted Average Cost - the price variance is taken to the stock account and the cost updated to ensure the GL + stock account ties up to the stock valuation + */ - if ($_SESSION['WeightedAverageCosting'] == 1){ /* Do the WAvg journal and cost update */ - /* - First off figure out the new weighted average cost Need the following data: + if ($_SESSION['WeightedAverageCosting'] == 1){ /* Do the WAvg journal and cost update */ + /* + First off figure out the new weighted average cost Need the following data: - How many in stock now + How many in stock now The quantity being costed here - $myrow['qtyinvoiced'] The cost of these items - $ItemShipmentCost */ @@ -236,75 +245,75 @@ /*The cost adjustment is the price variance / the total quantity in stock But that's only provided that the total quantity in stock is > the quantity charged on this invoice - */ + */ - $WriteOffToVariances =0; + $WriteOffToVariances =0; - if ($myrow['totqtyinvoiced'] > $TotalQuantityOnHand){ + if ($myrow['totqtyinvoiced'] > $TotalQuantityOnHand){ - /*So we need to write off some of the variance to variances and - only the balance of the quantity in stock to go to stock value */ + /*So we need to write off some of the variance to variances and + only the balance of the quantity in stock to go to stock value */ - $WriteOffToVariances = ($myrow['totqtyinvoiced'] - $TotalQuantityOnHand) - * ($ItemShipmentCost - $StdCostUnit); - } + $WriteOffToVariances = ($myrow['totqtyinvoiced'] - $TotalQuantityOnHand) + * ($ItemShipmentCost - $StdCostUnit); + } - if ($_SESSION['CompanyRecord']['gllink_stock']==1){ + if ($_SESSION['CompanyRecord']['gllink_stock']==1){ /* If the quantity on hand is less the amount charged on this invoice then some must have been sold - and the price variance on these must be written off to price variances*/ + and the price variance on these must be written off to price variances*/ - if ($myrow['totqtyinvoiced'] > $TotalQuantityOnHand){ + if ($myrow['totqtyinvoiced'] > $TotalQuantityOnHand){ - $sql = "INSERT INTO gltrans (type, + $sql = "INSERT INTO gltrans (type, typeno, trandate, periodno, account, narrative, amount) - VALUES (31, - " . $_GET['SelectedShipment'] . ", - '" . Date('Y-m-d') . "', - " . $PeriodNo . ", - " . $StockGLCodes['purchpricevaract'] . ", - '" . $myrow['itemcode'] . ' ' . _('shipment cost') . ' ' . number_format($ItemShipmentCost,2) . _('shipment quantity > stock held - variance write off') . "', - " . $WriteOffToVariances . ")"; + VALUES (31, + '" . $_GET['SelectedShipment'] . "', + '" . Date('Y-m-d') . "', + '" . $PeriodNo . "', + '" . $StockGLCodes['purchpricevaract'] . "', + '" . $myrow['itemcode'] . ' ' . _('shipment cost') . ' ' . number_format($ItemShipmentCost,2) . _('shipment quantity > stock held - variance write off') . "', + " . $WriteOffToVariances . ")"; - $ErrMsg = _('CRITICAL ERROR') . '! ' . _('NOTE DOWN THIS ERROR AND SEEK ASSISTANCE') . ': ' . _('The GL entry for the shipment variance posting for'). ' ' . $myrow['itemcode'] . ' '. _('could not be inserted into the database because'); - $result = DB_query($sql,$db, $ErrMsg,'',TRUE); + $ErrMsg = _('CRITICAL ERROR') . '! ' . _('NOTE DOWN THIS ERROR AND SEEK ASSISTANCE') . ': ' . _('The GL entry for the shipment variance posting for'). ' ' . $myrow['itemcode'] . ' '. _('could not be inserted into the database because'); + $result = DB_query($sql,$db, $ErrMsg,'',TRUE); - } - /*Now post any remaining price variance to stock rather than price variances */ - $sql = "INSERT INTO gltrans (type, + } + /*Now post any remaining price variance to stock rather than price variances */ + $sql = "INSERT INTO gltrans (type, typeno, trandate, periodno, account, narrative, amount) - VALUES (31, - " . $_GET['SelectedShipment'] . ", - '" . Date('Y-m-d') . "', - " . $PeriodNo . ", - " . $StockGLCodes['stockact'] . ", - '" . $myrow['itemcode'] . ' ' . _('shipment avg cost adjt') . "', - " . ($myrow['totqtyinvoiced'] *($ItemShipmentCost - $StdCostUnit) - - $WriteOffToVariances) . ")"; + VALUES (31, + '" . $_GET['SelectedShipment'] . "', + '" . Date('Y-m-d') . "', + '" . $PeriodNo . "', + '" . $StockGLCodes['stockact'] . "', + '" . $myrow['itemcode'] . ' ' . _('shipment avg cost adjt') . "', + '" . ($myrow['totqtyinvoiced'] *($ItemShipmentCost - $StdCostUnit) + - $WriteOffToVariances) . "')"; - $ErrMsg = _('CRITICAL ERROR') . '! ' . _('NOTE DOWN THIS ERROR AND SEEK ASSISTANCE') . ': ' . _('The GL entry for the shipment average cost adjustment for'). ' ' . $myrow['itemcode'] . ' '. _('could not be inserted into the database because'); - $result = DB_query($sql,$db, $ErrMsg,'',TRUE); + $ErrMsg = _('CRITICAL ERROR') . '! ' . _('NOTE DOWN THIS ERROR AND SEEK ASSISTANCE') . ': ' . _('The GL entry for the shipment average cost adjustment for'). ' ' . $myrow['itemcode'] . ' '. _('could not be inserted into the database because'); + $result = DB_query($sql,$db, $ErrMsg,'',TRUE); - } /* end of average cost GL stuff */ + } /* end of average cost GL stuff */ /*Now to update the stock cost with the new weighted average */ /*Need to consider what to do if the cost has been changed manually between receiving - the stock and entering the invoice - this code assumes there has been no cost updates - made manually and all the price variance is posted to stock. + the stock and entering the invoice - this code assumes there has been no cost updates + made manually and all the price variance is posted to stock. A nicety or important?? */ @@ -313,22 +322,22 @@ if ($TotalQuantityOnHand>0) { - $CostIncrement = ($myrow['totqtyinvoiced'] *($ItemShipmentCost - $StdCostUnit) - $WriteOffToVariances) / $TotalQuantityOnHand; - $sql = 'UPDATE stockmaster SET lastcost=materialcost+overheadcost+labourcost, - materialcost=materialcost+' . $CostIncrement . ' WHERE stockid="' . $myrow['itemcode'] . '"'; + $CostIncrement = ($myrow['totqtyinvoiced'] *($ItemShipmentCost - $StdCostUnit) - $WriteOffToVariances) / $TotalQuantityOnHand; + $sql = 'UPDATE stockmaster SET lastcost=materialcost+overheadcost+labourcost, + materialcost=materialcost+' . $CostIncrement . ' WHERE stockid="' . $myrow['itemcode'] . '"'; $Result = DB_query($sql, $db, $ErrMsg, $DbgMsg,'',TRUE); } else { $sql = 'UPDATE stockmaster SET lastcost=materialcost+overheadcost+labourcost, materialcost=' . $ItemShipmentCost . ' WHERE stockid="' . $myrow['itemcode'] . '"'; $Result = DB_query($sql, $db, $ErrMsg, $DbgMsg,'',TRUE); - } + } /* End of Weighted Average Costing Code */ - } else { /*We must be using standard costing do the journals for standard costing then */ + } else { /*We must be using standard costing do the journals for standard costing then */ - if ($_SESSION['CompanyRecord']['gllink_stock']==1){ - $sql = "INSERT INTO gltrans (type, + if ($_SESSION['CompanyRecord']['gllink_stock']==1){ + $sql = "INSERT INTO gltrans (type, typeno, trandate, periodno, @@ -336,20 +345,20 @@ narrative, amount) VALUES (31, - " . $_GET['SelectedShipment'] . ", + '" . $_GET['SelectedShipment'] . "', '" . Date('Y-m-d') . "', - " . $PeriodNo . ", - " . $StockGLCodes['purchpricevaract'] . ", + '" . $PeriodNo . "', + '" . $StockGLCodes['purchpricevaract'] . "', '" . $myrow['itemcode'] . ' ' . _('shipment cost') . ' ' . number_format($ItemShipmentCost,2) . ' x ' . _('Qty recd') .' ' . $myrow['totqtyrecd'] . "', " . (-$Variance * $myrow['totqtyrecd']) . ")"; - $ErrMsg = _('CRITICAL ERROR') . '! ' . _('NOTE DOWN THIS ERROR AND SEEK ASSISTANCE') . ': ' . _('The Positive GL entry for the shipment variance posting for'). ' ' . $myrow['itemcode'] . ' '. _('could not be inserted into the database because'); - $result = DB_query($sql,$db, $ErrMsg,'',TRUE); - } - } /* end of the costing specific updates */ + $ErrMsg = _('CRITICAL ERROR') . '! ' . _('NOTE DOWN THIS ERROR AND SEEK ASSISTANCE') . ': ' . _('The Positive GL entry for the shipment variance posting for'). ' ' . $myrow['itemcode'] . ' '. _('could not be inserted into the database because'); + $result = DB_query($sql,$db, $ErrMsg,'',TRUE); + } + } /* end of the costing specific updates */ - if ($_SESSION['CompanyRecord']['gllink_stock']==1){ - /*we always need to reverse entries relating to the GRN suspense during delivery and entry of shipment charges */ - $sql = "INSERT INTO gltrans (type, + if ($_SESSION['CompanyRecord']['gllink_stock']==1){ + /*we always need to reverse entries relating to the GRN suspense during delivery and entry of shipment charges */ + $sql = "INSERT INTO gltrans (type, typeno, trandate, periodno, @@ -357,28 +366,28 @@ narrative, amount) VALUES (31, - " . $_GET['SelectedShipment'] . ", + '" . $_GET['SelectedShipment'] . "', '" . Date('Y-m-d') . "', - " . $PeriodNo . ", - " . $_SESSION['CompanyRecord']['grnact'] . ", + '" . $PeriodNo . "', + '" . $_SESSION['CompanyRecord']['grnact'] . "', '" . $myrow['itemcode'] . ' ' ._('shipment cost') . ' ' . number_format($ItemShipmentCost,2) . ' x ' . _('Qty invoiced') . ' ' . $myrow['totqtyinvoiced'] . "', - " . ($Variance * $myrow['totqtyinvoiced']) . ")"; + " . ($Variance * $myrow['totqtyinvoiced']) . ")"; - $ErrMsg = _('CRITICAL ERROR') . '! ' . _('NOTE DOWN THIS ERROR AND SEEK ASSISTANCE') . ': ' . _('The credit GL entry for the shipment variance posting for') . ' ' . $myrow['itemcode'] . ' ' . _('could not be inserted because'); + $ErrMsg = _('CRITICAL ERROR') . '! ' . _('NOTE DOWN THIS ERROR AND SEEK ASSISTANCE') . ': ' . _('The credit GL entry for the shipment variance posting for') . ' ' . $myrow['itemcode'] . ' ' . _('could not be inserted because'); - $result = DB_query($sql,$db, $ErrMsg,'',TRUE); - } + $result = DB_query($sql,$db, $ErrMsg,'',TRUE); + } - if ( $_POST['UpdateCost'] == 'Yes' ){ /*Only ever a standard costing option - Weighted average costing implies cost updates taking place automatically */ + if ( $_POST['UpdateCost'] == 'Yes' ){ /*Only ever a standard costing option + Weighted average costing implies cost updates taking place automatically */ $QOHResult = DB_query("SELECT SUM(quantity) FROM locstock WHERE stockid ='" . $myrow['itemcode'] . "'",$db); $QOHRow = DB_fetch_row($QOHResult); $QOH=$QOHRow[0]; - if ($_SESSION['CompanyRecord']['gllink_stock']==1){ + if ($_SESSION['CompanyRecord']['gllink_stock']==1){ $CostUpdateNo = GetNextTransNo(35, $db); - $PeriodNo = GetPeriod(Date("d/m/Y"), $db); + $PeriodNo = GetPeriod(Date("d/m/Y"), $db); $ValueOfChange = $QOH * ($ItemShipmentCost - $StdCostUnit); @@ -390,10 +399,10 @@ narrative, amount) VALUES (35, - " . $CostUpdateNo . ", + '" . $CostUpdateNo . "', '" . Date('Y-m-d') . "', - " . $PeriodNo . ", - " . $StockGLCodes['adjglact'] . ", + '" . $PeriodNo . "', + '" . $StockGLCodes['adjglact'] . "', '" . _('Shipment of') . ' ' . $myrow['itemcode'] . " " . _('cost was') . ' ' . $StdCostUnit . ' ' . _('changed to') . ' ' . number_format($ItemShipmentCost,2) . ' x ' . _('QOH of') . ' ' . $QOH . "', " . (-$ValueOfChange) . ")"; $ErrMsg = _('CRITICAL ERROR') . '! ' . _('NOTE DOWN THIS ERROR AND SEEK ASSISTANCE') . ': ' . _('The GL credit for the shipment stock cost adjustment posting could not be inserted because'). ' ' . DB_error_msg($db); @@ -408,23 +417,23 @@ narrative, amount) VALUES (35, - " . $CostUpdateNo . ", + '" . $CostUpdateNo . "', '" . Date('Y-m-d') . "', - " . $PeriodNo . ", - " . $StockGLCodes['stockact'] . ", + '" . $PeriodNo . "', + '" . $StockGLCodes['stockact'] . "', '" . _('Shipment of') . ' ' . $myrow['itemcode'] . ' ' . _('cost was') . ' ' . $StdCostUnit . ' ' . _('changed to') . ' ' . number_format($ItemShipmentCost,2) . ' x ' . _('QOH of') . ' ' . $QOH . "', - " . $ValueOfChange . ")"; + " . $ValueOfChange . ")"; $ErrMsg = _('CRITICAL ERROR') . '! ' . _('NOTE DOWN THIS ERROR AND SEEK ASSISTANCE') . ': ' . _('The GL debit for stock cost adjustment posting could not be inserted because') .' '. DB_error_msg($db); $Result = DB_query($SQL,$db, $ErrMsg,'',TRUE); - } /*end of GL entries for a standard cost update */ + } /*end of GL entries for a standard cost update */ - /* Only the material cost is important for imported items */ + /* Only the material cost is important for imported items */ $sql = "UPDATE stockmaster SET materialcost=" . $ItemShipmentCost . ", labourcost=0, overheadcost=0, - lastcost=" . $StdCostUnit . " + lastcost='" . $StdCostUnit . "' WHERE stockid='" . $myrow['itemcode'] . "'"; $ErrMsg = _('CRITICAL ERROR') . '! ' . _('NOTE DOWN THIS ERROR AND SEEK ASSISTANCE') . ': ' . _('The shipment cost details for the stock item could not be updated because'). ': ' . DB_error_msg($db); @@ -439,26 +448,26 @@ echo '<td>' . $myrow['itemcode'] . ' - ' . $myrow['itemdescription'] . '</td> <td class=number>' . number_format($myrow['totqtyinvoiced']) . '</td> - <td class=number>' . number_format($myrow['totqtyrecd']) . '</td> + <td class=number>' . number_format($myrow['totqtyrecd']) . '</td> <td class=number>' . number_format($ItemCharges) . '</td> <td class=number>' . number_format($PortionOfCharges) . '</td> <td class=number>' . number_format($ItemShipmentCost,2) . '</td> <td class=number>' . number_format($StdCostUnit,2) . '</td> <td class=number>' . number_format($Variance,2) . '</td> <td class=number>' . $VariancePercentage . '%</td></tr>'; - } + } } echo '<tr><td colspan=3 class=number><font color=BLUE><b>'. _('Total Shipment Charges'). '</b></font></td> <td class=number>' . number_format($TotalInvoiceValueOfShipment) . '</td> <td class=number>' . number_format($TotalCostsToApportion) .'</td></tr>'; echo '<tr><td colspan=6 class=number>' . _('Total Value of all variances on this shipment') . '</td> - <td class=number>' . number_format($TotalShiptVariance,2) . '</td></tr>'; + <td class=number>' . number_format($TotalShiptVariance,2) . '</td></tr>'; -echo '</table><hr>'; +echo '</table>'; -echo '<table colspan=2 WIDTH=100%><tr><td VALIGN=TOp>'; // put this shipment charges side by side in a table (major table 2 cols) +echo '<br /><table colspan=2 width=95%><tr><td valign=top>'; // put this shipment charges side by side in a table (major table 2 cols) $sql = "SELECT suppliers.suppname, supptrans.suppreference, @@ -477,15 +486,15 @@ ON suppliers.supplierid=supptrans.supplierno INNER JOIN systypes ON systypes.typeid=supptrans.type WHERE shipmentcharges.stockid<>'' - AND shipmentcharges.shiptref=" . $_GET['SelectedShipment'] . " + AND shipmentcharges.shiptref='" . $_GET['SelectedShipment'] . "' ORDER BY supptrans.supplierno, supptrans.transno, shipmentcharges.stockid"; $ChargesResult = DB_query($sql,$db); -echo '<div class="centre"><font color=BLUE size=2>' . _('Shipment Charges Against Products'). '</font></div>'; -echo '<table cellpadding=2 colspan=6 border=0>'; +echo '<table cellpadding=2 colspan=6 class=selection>'; +echo '<tr><th colspan=6><font color=navy size=3>' . _('Shipment Charges Against Products'). '</font></th></tr>'; $TableHeader = '<tr> <th>'. _('Supplier'). '</th> @@ -549,14 +558,14 @@ INNER JOIN systypes ON systypes.typeid=supptrans.type WHERE shipmentcharges.stockid='' - AND shipmentcharges.shiptref=" . $_GET['SelectedShipment'] . " + AND shipmentcharges.shiptref='" . $_GET['SelectedShipment'] . "' ORDER BY supptrans.supplierno, supptrans.transno"; $ChargesResult = DB_query($sql,$db); -echo '<div class="centre"><font color=BLUE size=2>'._('General Shipment Charges').'</font></div>'; -echo '<table cellpadding=2 colspan=5 border=0>'; +echo '<table cellpadding=2 colspan=5 class=selection>'; +echo '<tr><th colspan=6><font color=navy size=3>'._('General Shipment Charges').'</font></th></tr>'; $TableHeader = '<tr> <th>'. _('Supplier'). '</th> @@ -606,12 +615,12 @@ // if the page was called with Close=Yes then show options to confirm OK to c echo '<hr><div class+"centre"><form method="POST" action="' . $_SERVER['PHP_SELF'] .'?' . SID .'&SelectedShipment=' . $_GET['SelectedShipment'] . '">'; - if ($_SESSION['WeightedAverageCosting']==0){ - /* We are standard costing - so show the option to update costs - under W. Avg cost updates are implicit */ - echo _('Update Standard Costs') .':<select name="UpdateCost"> - <option selected VALUE="Yes">'. _('Yes') . ' + if ($_SESSION['WeightedAverageCosting']==0){ + /* We are standard costing - so show the option to update costs - under W. Avg cost updates are implicit */ + echo _('Update Standard Costs') .':<select name="UpdateCost"> + <option selected VALUE="Yes">'. _('Yes') . ' <option VALUE="No">'. _('No').'</select>'; - } + } echo '<br><br><input type=submit name="Close" VALUE="'. _('Confirm OK to Close'). '">'; echo '</form></div>'; } @@ -629,16 +638,16 @@ /*also need to make sure the purchase order lines that were on this shipment are completed so no more can be received in against the order line */ - $result = DB_query('UPDATE purchorderdetails - SET quantityord=quantityrecd, - completed=1 - WHERE shiptref = ' . $_GET['SelectedShipment'], - $db, - _('Could not complete the purchase order lines on this shipment'), - '', - TRUE); + $result = DB_query("UPDATE purchorderdetails + SET quantityord=quantityrecd, + completed=1 + WHERE shiptref = '" . $_GET['SelectedShipment'] ."'", + $db, + _('Could not complete the purchase order lines on this shipment'), + '', + TRUE); - $result = DB_query('UPDATE shipments SET closed=1 WHERE shiptref=' .$_GET['SelectedShipment'],$db,_('Could not update the shipment to closed'),'',TRUE); + $result = DB_query("UPDATE shipments SET closed=1 WHERE shiptref='" .$_GET['SelectedShipment']. "'",$db,_('Could not update the shipment to closed'),'',TRUE); $result = DB_Txn_Commit($db); echo '<br><br>'; @@ -654,4 +663,4 @@ } include('includes/footer.inc'); -?> +?> \ No newline at end of file Modified: trunk/doc/Change.log.html =================================================================== --- trunk/doc/Change.log.html 2010-09-25 08:11:38 UTC (rev 3776) +++ trunk/doc/Change.log.html 2010-09-25 09:37:39 UTC (rev 3777) @@ -1,5 +1,6 @@ <p><font SIZE=4 COLOR=BLUE><b>webERP Change Log</b></font></p> <p></p> +<p>25/09/10 Tim: ShipmentCosting.php - SQL quoting corrections and layout changes and improvements and bug fixes</p> <p>25/09/10 Tim: SelectWorkOrder.php - SQL quoting corrections and layout changes and improvements and bug fixes</p> <p>24/09/10 Tim: SelectSalesOrder.php - Layout changes and improvements and bug fixes</p> <p>24/09/10 Tim: SelectRecurringSalesOrder.php - Layout changes and improvements and bug fixes</p> This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <tim...@us...> - 2010-09-25 10:45:58
|
Revision: 3778 http://web-erp.svn.sourceforge.net/web-erp/?rev=3778&view=rev Author: tim_schofield Date: 2010-09-25 10:45:51 +0000 (Sat, 25 Sep 2010) Log Message: ----------- SQL quoting corrections and layout changes and improvements and bug fixes Modified Paths: -------------- trunk/Shipments.php trunk/doc/Change.log.html trunk/includes/DefineShiptClass.php Modified: trunk/Shipments.php =================================================================== --- trunk/Shipments.php 2010-09-25 09:37:39 UTC (rev 3777) +++ trunk/Shipments.php 2010-09-25 10:45:51 UTC (rev 3778) @@ -10,17 +10,20 @@ include('includes/SQL_CommonFunctions.inc'); -if ($_GET['NewShipment']=='Yes'){ +if (isset($_GET['NewShipment']) and $_GET['NewShipment']=='Yes'){ unset($_SESSION['Shipment']->LineItems); unset($_SESSION['Shipment']); } +echo '<p class="page_title_text"><img src="'.$rootpath.'/css/'.$theme.'/images/magnifier.png" title="' . _('Search') . + '" alt="">' . ' ' . $title . '</p>'; + if (!isset($_SESSION['SupplierID']) AND !isset($_SESSION['Shipment'])){ prnMsg( _('To set up a shipment') . ', ' . _('the supplier must first be selected from the Select Supplier page'), 'error'); - echo '<br><table class="table_index"> + echo '<table class="selection"> <tr><td class="menu_group_item"> <li><a href="'. $rootpath . '/SelectSupplier.php?'.SID .'">' . _('Select the Supplier') . '</a></li> - </td></tr></table></div><br><br><br>'; + </td></tr></table></div>'; include('includes/footer.inc'); exit; } @@ -47,7 +50,7 @@ shipments.closed FROM shipments INNER JOIN suppliers ON shipments.supplierid = suppliers.supplierid - WHERE shipments.shiptref = " . $_GET['SelectedShipment']; + WHERE shipments.shiptref = '" . $_GET['SelectedShipment'] . "'"; $ErrMsg = _('Shipment').' '. $_GET['SelectedShipment'] . ' ' . _('cannot be retrieved because a database error occurred'); $GetShiptHdrResult = DB_query($ShipmentHeaderSQL,$db, $ErrMsg); @@ -63,7 +66,6 @@ $myrow = DB_fetch_array($GetShiptHdrResult); if ($myrow['closed']==1){ - echo '<br>'; prnMsg( _('Shipment No.') .' '. $_GET['SelectedShipment'] .': '. _('The selected shipment is already closed and no further modifications to the shipment are possible'), 'error'); include('includes/footer.inc'); @@ -99,7 +101,7 @@ ON purchorderdetails.itemcode=stockmaster.stockid INNER JOIN purchorders ON purchorderdetails.orderno=purchorders.orderno - WHERE purchorderdetails.shiptref=" . $_GET['SelectedShipment']; + WHERE purchorderdetails.shiptref='" . $_GET['SelectedShipment'] . "'"; $ErrMsg = _('The lines on the shipment cannot be retrieved because'). ' - ' . DB_error_msg($db); $LineItemsResult = db_query($LineItemsSQL,$db, $ErrMsg); @@ -144,10 +146,10 @@ if (!isset($_SESSION['Shipment'])){ $_SESSION['Shipment'] = new Shipment; - - $sql = "SELECT suppname, - currcode - FROM suppliers + + $sql = "SELECT suppname, + currcode + FROM suppliers WHERE supplierid='" . $_SESSION['SupplierID'] . "'"; $ErrMsg = _('The supplier details for the shipment could not be retrieved because'); @@ -162,15 +164,13 @@ - if (isset($_POST['Update']) OR (isset($_GET['Add']) AND $_SESSION['Shipment']->Closed==0)) { //user hit the update button + $InputError = 0; if (isset($_POST['Update'])){ $_SESSION['Shipment']->Vessel = $_POST['Vessel']; $_SESSION['Shipment']->VoyageRef = $_POST['VoyageRef']; - - $InputError = 0; - + if (!Is_Date($_POST['ETA'])){ $InputError=1; prnMsg( _('The date of expected arrival of the shipment must be entered in the format') . ' ' .$_SESSION['DefaultDateFormat'], 'error'); @@ -200,16 +200,16 @@ $sql = "UPDATE shipments SET vessel='" . $_SESSION['Shipment']->Vessel . "', voyageref='". $_SESSION['Shipment']->VoyageRef . "', eta='" . $_SESSION['Shipment']->ETA . "' - WHERE shiptref =" . $_SESSION['Shipment']->ShiptRef; + WHERE shiptref ='" . $_SESSION['Shipment']->ShiptRef . "'"; } else { - + $sql = "INSERT INTO shipments (shiptref, vessel, voyageref, eta, supplierid) - VALUES (" . $_SESSION['Shipment']->ShiptRef . ", + VALUES ('" . $_SESSION['Shipment']->ShiptRef . "', '" . $_SESSION['Shipment']->Vessel . "', '". $_SESSION['Shipment']->VoyageRef . "', '" . $_SESSION['Shipment']->ETA . "', @@ -224,9 +224,9 @@ if (DateDiff(ConvertSQLDate($LnItm->DelDate),ConvertSQLDate($_SESSION['Shipment']->ETA),'d')!=0){ - $sql = "UPDATE purchorderdetails - SET deliverydate ='" . $_SESSION['Shipment']->ETA . "' - WHERE podetailitem=" . $LnItm->PODetailItem; + $sql = "UPDATE purchorderdetails + SET deliverydate ='" . $_SESSION['Shipment']->ETA . "' + WHERE podetailitem='" . $LnItm->PODetailItem . "'"; $result = DB_query($sql,$db); @@ -234,10 +234,10 @@ } } - echo '<br>'; prnMsg( _('Updated the shipment record and delivery dates of order lines as necessary'), 'success'); + echo '<br />'; } //error traps all passed ok - + } //user hit Update if (isset($_GET['Add']) AND $_SESSION['Shipment']->Closed==0 AND $InputError==0){ @@ -255,7 +255,7 @@ purchorderdetails.qtyinvoiced FROM purchorderdetails INNER JOIN stockmaster ON purchorderdetails.itemcode=stockmaster.stockid - WHERE purchorderdetails.podetailitem=" . $_GET['Add']; + WHERE purchorderdetails.podetailitem='" . $_GET['Add'] . "'"; $result = DB_query($sql,$db); $myrow = DB_fetch_array($result); @@ -290,7 +290,7 @@ echo '<form action="' . $_SERVER['PHP_SELF'] . '?' . SID . '" method="POST">'; -echo '<table><tr><td><b>'. _('Shipment').': </td><td><b>' . $_SESSION['Shipment']->ShiptRef . '</b></td> +echo '<table class=selection><tr><td><b>'. _('Shipment').': </td><td><b>' . $_SESSION['Shipment']->ShiptRef . '</b></td> <td><b>'. _('From'). ' ' . $_SESSION['Shipment']->SupplierName . '</b></td></tr>'; echo '<tr><td>'. _('Vessel Name /Transport Agent'). ': </td> @@ -309,7 +309,7 @@ if (isset($_SESSION['Shipment']->ETA)) { echo '<td><input type=Text class="date" alt='.$_SESSION['DefaultDateFormat'].' name="ETA" maxlength=10 size=10 VALUE="' . $ETA . '"></td>'; } else { - echo '<td><input type=Text class="date" alt='.$_SESSION['DefaultDateFormat'].' name="ETA" maxlength=10 size=10 VALUE="' . Date($_SESSION['DefaultDateFormat']) . '"></td>'; + echo '<td><input type=Text class="date" alt='.$_SESSION['DefaultDateFormat'].' name="ETA" maxlength=10 size=10 VALUE="' . Date($_SESSION['DefaultDateFormat']) . '"></td>'; } echo '<td>'. _('Into').' '; @@ -319,7 +319,7 @@ $sql = "SELECT purchorders.intostocklocation FROM purchorders INNER JOIN purchorderdetails - ON purchorders.orderno=purchorderdetails.orderno and podetailitem = " . key($_SESSION['Shipment']->LineItems); + ON purchorders.orderno=purchorderdetails.orderno and podetailitem = '" . key($_SESSION['Shipment']->LineItems) . "'"; $result = DB_query($sql,$db); $myrow = DB_fetch_row($result); @@ -367,6 +367,7 @@ $sql = "SELECT locationname FROM locations WHERE loccode='" . $_SESSION['Shipment']->StockLocation . "'"; $resultStkLocs = DB_query($sql,$db); $myrow=DB_fetch_array($resultStkLocs); + echo '<input type=hidden name=StockLocation value='.$_SESSION['Shipment']->StockLocation.'>'; echo $myrow['locationname']; } @@ -374,10 +375,10 @@ if (count($_SESSION['Shipment']->LineItems)>0){ /* Always display all shipment lines */ - - echo '<b><div class="centre"><font color=BLUE>'. _('Order Lines On This Shipment'). '</font></div></b>'; - echo '<table cellpadding=2 colspan=7 border=0>'; - + + echo '<br /><table cellpadding=2 colspan=7 class=selection>'; + echo '<tr><th colspan=9><font color=navy size=3>'. _('Order Lines On This Shipment'). '</font></th></tr>'; + $TableHeader = '<tr> <th>'. _('Order'). '</th> <th>'. _('Item'). '</th> @@ -387,22 +388,22 @@ <th>'. _('Quantity').'<br>'. _('Invoiced'). '</th> <th>'. $_SESSION['Shipment']->CurrCode .' '. _('Price') . '</th> <th>'. _('Current'). '<br>'. _('Std Cost'). '</th></tr>'; - + echo $TableHeader; - + /*show the line items on the shipment with the quantity being received for modification */ - + $k=0; //row colour counter $RowCounter =0; - + foreach ($_SESSION['Shipment']->LineItems as $LnItm) { - + if ($RowCounter==15){ echo $TableHeader; $RowCounter =0; } $RowCounter++; - + if ($k==1){ echo '<tr class="EvenTableRows">'; $k=0; @@ -410,8 +411,8 @@ echo '<tr class="OddTableRows">'; $k=1; } - - + + echo '<td>'.$LnItm->OrderNo.'</td> <td>'. $LnItm->StockID .' - '. $LnItm->ItemDescription. '</td><td class=number>' . number_format($LnItm->QuantityOrd,2) . '</td> <td>'. $LnItm->UOM .'</td> @@ -427,7 +428,9 @@ echo '<br><div class="centre"><input type=submit name="Update" Value="'. _('Update Shipment Details') . '"></div><p>'; -echo '<hr>'; +if (!isset($_POST['StockLocation'])) { + $_POST['StockLocation'] =$_SESSION['Shipment']->StockLocation; +} $sql = "SELECT purchorderdetails.podetailitem, purchorders.orderno, @@ -451,8 +454,8 @@ if (DB_num_rows($result)>0){ - echo '<b><div class="centre"><font color=BLUE>'. _('Possible Order Lines To Add To This Shipment').'</font></div></b>'; - echo '<table cellpadding=2 colspan=7 BORDER=0>'; + echo '<table cellpadding=2 colspan=7 class=selection>'; + echo '<tr><th colspan=7><font color=navy size=3>'. _('Possible Order Lines To Add To This Shipment').'</font></th></tr>'; $TableHeader = '<tr> <th>'. _('Order').'</th> @@ -502,4 +505,4 @@ echo '</form>'; include('includes/footer.inc'); -?> +?> \ No newline at end of file Modified: trunk/doc/Change.log.html =================================================================== --- trunk/doc/Change.log.html 2010-09-25 09:37:39 UTC (rev 3777) +++ trunk/doc/Change.log.html 2010-09-25 10:45:51 UTC (rev 3778) @@ -1,5 +1,6 @@ <p><font SIZE=4 COLOR=BLUE><b>webERP Change Log</b></font></p> <p></p> +<p>25/09/10 Tim: Shipments.php - SQL quoting corrections and layout changes and improvements and bug fixes</p> <p>25/09/10 Tim: ShipmentCosting.php - SQL quoting corrections and layout changes and improvements and bug fixes</p> <p>25/09/10 Tim: SelectWorkOrder.php - SQL quoting corrections and layout changes and improvements and bug fixes</p> <p>24/09/10 Tim: SelectSalesOrder.php - Layout changes and improvements and bug fixes</p> Modified: trunk/includes/DefineShiptClass.php =================================================================== --- trunk/includes/DefineShiptClass.php 2010-09-25 09:37:39 UTC (rev 3777) +++ trunk/includes/DefineShiptClass.php 2010-09-25 10:45:51 UTC (rev 3778) @@ -38,9 +38,9 @@ $this->LineItems[$PODetailItem]= new LineDetails($PODetailItem,$OrderNo,$StockID,$ItemDescr, $QtyInvoiced, $UnitPrice, $UOM, $DelDate, $QuantityOrd, $QuantityRecd, $StdCostUnit); - $sql = "UPDATE purchorderdetails SET shiptref = " . $this->ShiptRef . " - WHERE podetailitem = " . $PODetailItem; - $ErrMsg = _('There was an error updating the purchase order detail record to make it part of shipment') . ' ' . $ShiptRef . ' ' . _('the error reported was'); + $sql = "UPDATE purchorderdetails SET shiptref = '" . $this->ShiptRef . "' + WHERE podetailitem = '" . $PODetailItem . "'"; + $ErrMsg = _('There was an error updating the purchase order detail record to make it part of shipment') . ' ' . $this->ShiptRef . ' ' . _('the error reported was'); $result = DB_query($sql, $db, $ErrMsg); Return 1; @@ -52,7 +52,7 @@ if ($this->LineItems[$PODetailItem]->QtyInvoiced==0){ unset($this->LineItems[$PODetailItem]); - $sql = "UPDATE purchorderdetails SET shiptref = 0 WHERE podetailitem=" . $PODetailItem; + $sql = "UPDATE purchorderdetails SET shiptref = 0 WHERE podetailitem='" . $PODetailItem . "'"; $Result = DB_query($sql,$db); } else { prnMsg(_('This shipment line has a quantity invoiced and already charged to the shipment - it cannot now be removed'),'warn'); @@ -93,4 +93,4 @@ } } -?> +?> \ No newline at end of file This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <tim...@us...> - 2010-09-25 12:02:36
|
Revision: 3779 http://web-erp.svn.sourceforge.net/web-erp/?rev=3779&view=rev Author: tim_schofield Date: 2010-09-25 12:02:29 +0000 (Sat, 25 Sep 2010) Log Message: ----------- SQL quoting corrections and layout changes and improvements and bug fixes Modified Paths: -------------- trunk/Shippers.php trunk/doc/Change.log.html Modified: trunk/Shippers.php =================================================================== --- trunk/Shippers.php 2010-09-25 10:45:51 UTC (rev 3778) +++ trunk/Shippers.php 2010-09-25 12:02:29 UTC (rev 3779) @@ -16,9 +16,9 @@ if (isset($Errors)) { unset($Errors); } - -$Errors = array(); +$Errors = array(); + if ( isset($_POST['submit']) ) { //initialise no input errors assumed initially before we test @@ -34,12 +34,12 @@ $InputError = 1; prnMsg( _("The shipper's name must be forty characters or less long"), 'error'); $Errors[$i] = 'ShipperName'; - $i++; + $i++; } elseif( trim($_POST['ShipperName']) == '' ) { $InputError = 1; prnMsg( _("The shipper's name may not be empty"), 'error'); $Errors[$i] = 'ShipperName'; - $i++; + $i++; } if (isset($SelectedShipper) AND $InputError !=1) { @@ -48,7 +48,7 @@ would not run in this case cos submit is false of course see the delete code below*/ - $sql = "UPDATE shippers SET shippername='" . $_POST['ShipperName'] . "' WHERE shipper_id = $SelectedShipper"; + $sql = "UPDATE shippers SET shippername='" . $_POST['ShipperName'] . "' WHERE shipper_id = '".$SelectedShipper."'"; $msg = _('The shipper record has been updated'); } elseif ($InputError !=1) { @@ -73,19 +73,19 @@ // PREVENT DELETES IF DEPENDENT RECORDS IN 'SalesOrders' - $sql= "SELECT COUNT(*) FROM salesorders WHERE salesorders.shipvia='$SelectedShipper'"; + $sql= "SELECT COUNT(*) FROM salesorders WHERE salesorders.shipvia='".$SelectedShipper."'"; $result = DB_query($sql,$db); $myrow = DB_fetch_row($result); if ($myrow[0]>0) { $CancelDelete = 1; echo '<br>'; - prnMsg( _('Cannot delete this shipper because sales orders have been created using this shipper') . '. ' . _('There are'). ' '. + prnMsg( _('Cannot delete this shipper because sales orders have been created using this shipper') . '. ' . _('There are'). ' '. $myrow[0] . ' '. _('sales orders using this shipper code'), 'error'); } else { // PREVENT DELETES IF DEPENDENT RECORDS IN 'DebtorTrans' - $sql= "SELECT COUNT(*) FROM debtortrans WHERE debtortrans.shipvia='$SelectedShipper'"; + $sql= "SELECT COUNT(*) FROM debtortrans WHERE debtortrans.shipvia='".$SelectedShipper."'"; $result = DB_query($sql,$db); $myrow = DB_fetch_row($result); if ($myrow[0]>0) { @@ -103,7 +103,7 @@ } else { - $sql="DELETE FROM shippers WHERE shipper_id=$SelectedShipper"; + $sql="DELETE FROM shippers WHERE shipper_id='".$SelectedShipper."'"; $result = DB_query($sql,$db); echo '<br>'; prnMsg( _('The shipper record has been deleted'), 'success');; @@ -120,11 +120,13 @@ then none of the above are true and the list of Shippers will be displayed with links to delete or edit each. These will call the same page again and allow update/input or deletion of the records*/ + echo '<p class="page_title_text"><img src="'.$rootpath.'/css/'.$theme.'/images/supplier.png" title="' . _('Search') . + '" alt="">' . ' ' . $title . '</p>'; $sql = "SELECT * FROM shippers ORDER BY shipper_id"; $result = DB_query($sql,$db); - echo '<table border=1> + echo '<table class=selection> <tr><th>'. _('Shipper ID'). '</th><th>'. _('Shipper Name'). '</th></tr>'; $k=0; //row colour counter @@ -141,11 +143,11 @@ <td>%s</td> <td><a href="%sSelectedShipper=%s">'. _('Edit').' </td> <td><a href="%sSelectedShipper=%s&delete=1">'. _('Delete'). '</td></tr>', - $myrow[0], - $myrow[1], - $_SERVER['PHP_SELF'] . "?" . SID, - $myrow[0], - $_SERVER['PHP_SELF'] . "?" . SID, + $myrow[0], + $myrow[1], + $_SERVER['PHP_SELF'] . "?" . SID, + $myrow[0], + $_SERVER['PHP_SELF'] . "?" . SID, $myrow[0]); } //END WHILE LIST LOOP @@ -153,14 +155,12 @@ } -if (isset($SelectedShipper)) { ?> - <div class='centre'><a href="<?php echo $_SERVER['PHP_SELF'] . '?' . SID;?>"><?=_('REVIEW RECORDS')?></a></div> -<?php } ?> +if (isset($SelectedShipper)) { + echo '<p class="page_title_text"><img src="'.$rootpath.'/css/'.$theme.'/images/supplier.png" title="' . _('Search') . + '" alt="">' . ' ' . $title . '</p>'; + echo '<div class="centre"><a href="'.$_SERVER['PHP_SELF'] . '?' . SID.'">'._('REVIEW RECORDS').'</a></div>'; +} -<p> - -<?php - if (!isset($_GET['delete'])) { echo '<form method="POST" action="' . $_SERVER['PHP_SELF'] . '?' . SID . '">'; @@ -168,7 +168,7 @@ if (isset($SelectedShipper)) { //editing an existing Shipper - $sql = "SELECT shipper_id, shippername FROM shippers WHERE shipper_id=$SelectedShipper"; + $sql = "SELECT shipper_id, shippername FROM shippers WHERE shipper_id='".$SelectedShipper."'"; $result = DB_query($sql, $db); $myrow = DB_fetch_array($result); @@ -178,9 +178,9 @@ echo '<input type=hidden name="SelectedShipper" VALUE='. $SelectedShipper .'>'; echo '<input type=hidden name="Shipper_ID" VALUE=' . $_POST['Shipper_ID'] . '>'; - echo '<table><tr><td>'. _('Shipper Code').':</td><td>' . $_POST['Shipper_ID'] . '</td></tr>'; + echo '<br /><table class=selection><tr><td>'. _('Shipper Code').':</td><td>' . $_POST['Shipper_ID'] . '</td></tr>'; } else { - echo "<table>"; + echo "<br /><table class=selection>"; } if (!isset($_POST['ShipperName'])) { $_POST['ShipperName']=''; @@ -192,11 +192,11 @@ </table> - <div class="centre"><input type="Submit" name="submit" value="'. _('Enter Information').'"></div> + <br /><div class="centre"><input type="Submit" name="submit" value="'. _('Enter Information').'"></div> </form>'; -} //end if record deleted no point displaying form to add record +} //end if record deleted no point displaying form to add record include('includes/footer.inc'); ?> \ No newline at end of file Modified: trunk/doc/Change.log.html =================================================================== --- trunk/doc/Change.log.html 2010-09-25 10:45:51 UTC (rev 3778) +++ trunk/doc/Change.log.html 2010-09-25 12:02:29 UTC (rev 3779) @@ -1,5 +1,6 @@ <p><font SIZE=4 COLOR=BLUE><b>webERP Change Log</b></font></p> <p></p> +<p>25/09/10 Tim: Shippers.php - SQL quoting corrections and layout changes and improvements and bug fixes</p> <p>25/09/10 Tim: Shipments.php - SQL quoting corrections and layout changes and improvements and bug fixes</p> <p>25/09/10 Tim: ShipmentCosting.php - SQL quoting corrections and layout changes and improvements and bug fixes</p> <p>25/09/10 Tim: SelectWorkOrder.php - SQL quoting corrections and layout changes and improvements and bug fixes</p> This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <tim...@us...> - 2010-09-25 13:02:01
|
Revision: 3780 http://web-erp.svn.sourceforge.net/web-erp/?rev=3780&view=rev Author: tim_schofield Date: 2010-09-25 13:01:55 +0000 (Sat, 25 Sep 2010) Log Message: ----------- SQL quoting corrections and layout changes and improvements and bug fixes Modified Paths: -------------- trunk/Shipt_Select.php trunk/doc/Change.log.html Modified: trunk/Shipt_Select.php =================================================================== --- trunk/Shipt_Select.php 2010-09-25 12:02:29 UTC (rev 3779) +++ trunk/Shipt_Select.php 2010-09-25 13:01:55 UTC (rev 3780) @@ -7,6 +7,8 @@ include('includes/session.inc'); $title = _('Search Shipments'); include('includes/header.inc'); +echo '<p class="page_title_text"><img src="'.$rootpath.'/css/'.$theme.'/images/magnifier.png" title="' . _('Search') . + '" alt="">' . ' ' . $title . '</p>'; if (isset($_GET['SelectedStockItem'])){ $SelectedStockItem=$_GET['SelectedStockItem']; @@ -42,7 +44,7 @@ echo _('Shipment Number'). ' - '. $ShiptRef; } } else { - If ($SelectedSupplier) { + if (isset($SelectedSupplier)) { echo '<br>' ._('For supplier'). ': '. $SelectedSupplier . ' ' . _('and'). ' '; echo '<input type=hidden name="SelectedSupplier" value="'. $SelectedSupplier. '">'; } @@ -82,7 +84,7 @@ $SQL .= " WHERE purchorderdetails.shiptref IS NOT NULL AND purchorderdetails.shiptref<>0 AND stockmaster.stockid " . LIKE . " '%" . $_POST['StockCode'] . "%' - AND categoryid='" . $_POST['StockCat']; + AND categoryid='" . $_POST['StockCat'] ."'"; } elseif (!$_POST['StockCode'] AND !$_POST['Keywords']) { $SQL .= " WHERE purchorderdetails.shiptref IS NOT NULL @@ -102,7 +104,7 @@ if (!isset($ShiptRef) or $ShiptRef==""){ - echo '<div class="centre">'; + echo '<table class=selection><tr><td>'; echo _('Shipment Number'). ': <input type=text name="ShiptRef" MAXLENGTH =10 size=10> '. _('Into Stock Location').' :<select name="StockLocation"> '; $sql = "SELECT loccode, locationname FROM locations"; @@ -132,25 +134,22 @@ echo '<option VALUE=1>'. _('Closed Shipments Only'); echo '<option selected VALUE=0>'. _('Open Shipments Only'); } - echo '</select>'; + echo '</select></td></tr></table>'; - echo '<br><input type=submit name="SearchShipments" VALUE="'. _('Search Shipments'). '"></div>'; + echo '<br /><div class=centre><input type=submit name="SearchShipments" VALUE="'. _('Search Shipments'). '"></div></div><br />'; } -$SQL="SELECT categoryid, - categorydescription - FROM stockcategory - WHERE stocktype<>'D' +$SQL="SELECT categoryid, + categorydescription + FROM stockcategory + WHERE stocktype<>'D' ORDER BY categorydescription"; $result1 = DB_query($SQL,$db); -?> -<hr><div class='centre'> -<font size=1><?php echo _('To search for shipments for a specific part use the part selection facilities below');?></font> -<input type=submit name="SearchParts" VALUE="<?php echo _('Search Parts Now');?>"> -<input type=submit name="ResetPart" VALUE="<?php echo _('Show All');?>"></div> -<table> +echo '<table class=selection>'; +echo '<tr><th colspan=5><font size=3 color=navy>'._('To search for shipments for a specific part use the part selection facilities below') . '</font></th></tr>'; +?> <tr> <td><font size=1><?php echo _('Select a stock category');?>:</font> <select name="StockCat"> @@ -170,15 +169,15 @@ <td><font SIZE 3><b><?php echo _('OR');?> </b></font><font size=1><?php echo _('Enter extract of the');?> <b><?php echo _('Stock Code');?></b>:</font></td> <td><input type="Text" name="StockCode" size=15 maxlength=18></td> </tr> -</table> +</table><br /> -<hr> - <?php +echo '<div class=centre><input type=submit name="SearchParts" value="'._('Search Parts Now').'">'; +echo '<input type=submit name="ResetPart" VALUE="'. _('Show All') .'"></div><br />'; -If (isset($StockItemsResult)) { +if (isset($StockItemsResult)) { - echo "<table cellpadding=2 colspan=7 BORDER=2>"; + echo "<table cellpadding=2 colspan=7 class=selection>"; $TableHeader = '<tr> <th>'. _('Code').'</th> <th>'. _('Description').'</th> @@ -228,15 +227,15 @@ //figure out the SQL required from the inputs available if (isset($ShiptRef) && $ShiptRef !="") { - $SQL = "SELECT shipments.shiptref, - vessel, - voyageref, - suppliers.suppname, - shipments.eta, + $SQL = "SELECT shipments.shiptref, + vessel, + voyageref, + suppliers.suppname, + shipments.eta, shipments.closed FROM shipments INNER JOIN suppliers ON shipments.supplierid = suppliers.supplierid - WHERE shipments.shiptref=". $ShiptRef; + WHERE shipments.shiptref='". $ShiptRef . "'"; } else { $SQL = "SELECT DISTINCT shipments.shiptref, vessel, voyageref, suppliers.suppname, shipments.eta, shipments.closed FROM shipments INNER JOIN suppliers @@ -253,20 +252,20 @@ $SQL .= " WHERE purchorderdetails.itemcode='". $SelectedStockItem ."' AND shipments.supplierid='" . $SelectedSupplier ."' AND purchorders.intostocklocation = '". $_POST['StockLocation'] . "' - AND shipments.closed=" . $_POST['OpenOrClosed']; + AND shipments.closed='" . $_POST['OpenOrClosed'] . "'"; } else { $SQL .= "WHERE shipments.supplierid='" . $SelectedSupplier ."' AND purchorders.intostocklocation = '". $_POST['StockLocation'] . "' - AND shipments.closed=" . $_POST['OpenOrClosed']; + AND shipments.closed='" . $_POST['OpenOrClosed'] ."'"; } } else { //no supplier selected if (isset($SelectedStockItem)) { $SQL .= "WHERE purchorderdetails.itemcode='". $SelectedStockItem ."' AND purchorders.intostocklocation = '". $_POST['StockLocation'] . "' - AND shipments.closed=" . $_POST['OpenOrClosed']; + AND shipments.closed='" . $_POST['OpenOrClosed'] . "'"; } else { $SQL .= "WHERE purchorders.intostocklocation = '". $_POST['StockLocation'] . "' - AND shipments.closed=" . $_POST['OpenOrClosed']; + AND shipments.closed='" . $_POST['OpenOrClosed'] . "'"; } } //end selected supplier @@ -279,7 +278,7 @@ if (DB_num_rows($ShipmentsResult)>0){ /*show a table of the shipments returned by the SQL */ - echo '<table cellpadding=2 colspan=7 WIDTH=100%>'; + echo '<table cellpadding=2 colspan=7 width=95% class=selection>'; $TableHeader = '<tr> <th>'. _('Shipment'). '</th> <th>'. _('Supplier'). '</th> @@ -321,13 +320,13 @@ <td><a href="%s">'._('Costing').'</a></td> <td><a href="%s">'._('Modify').'</a></td> <td><a href="%s"><b>'._('Close').'</b></a></td> - </tr>', - $myrow['shiptref'], - $myrow['suppname'], - $myrow['vessel'], + </tr>', + $myrow['shiptref'], + $myrow['suppname'], + $myrow['vessel'], $myrow['voyageref'], - $FormatedETA, - $URL_View_Shipment, + $FormatedETA, + $URL_View_Shipment, $URL_Modify_Shipment, $URL_Close_Shipment); @@ -338,12 +337,12 @@ <td>%s</td> <td>%s</td> <td><a href="%s">'._('Costing').'</a></td> - </tr>', - $myrow['shiptref'], - $myrow['suppname'], - $myrow['vessel'], + </tr>', + $myrow['shiptref'], + $myrow['suppname'], + $myrow['vessel'], $myrow['voyage'], - $FormatedETA, + $FormatedETA, $URL_View_Shipment); } $j++; @@ -361,4 +360,4 @@ echo '</form>'; include('includes/footer.inc'); -?> +?> \ No newline at end of file Modified: trunk/doc/Change.log.html =================================================================== --- trunk/doc/Change.log.html 2010-09-25 12:02:29 UTC (rev 3779) +++ trunk/doc/Change.log.html 2010-09-25 13:01:55 UTC (rev 3780) @@ -1,5 +1,6 @@ <p><font SIZE=4 COLOR=BLUE><b>webERP Change Log</b></font></p> <p></p> +<p>25/09/10 Tim: Shipt_Select.php - SQL quoting corrections and layout changes and improvements and bug fixes</p> <p>25/09/10 Tim: Shippers.php - SQL quoting corrections and layout changes and improvements and bug fixes</p> <p>25/09/10 Tim: Shipments.php - SQL quoting corrections and layout changes and improvements and bug fixes</p> <p>25/09/10 Tim: ShipmentCosting.php - SQL quoting corrections and layout changes and improvements and bug fixes</p> This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <tim...@us...> - 2010-09-25 21:09:49
|
Revision: 3781 http://web-erp.svn.sourceforge.net/web-erp/?rev=3781&view=rev Author: tim_schofield Date: 2010-09-25 21:09:43 +0000 (Sat, 25 Sep 2010) Log Message: ----------- Add script to show list of open shipments for selected supplier Modified Paths: -------------- trunk/SelectSupplier.php trunk/ShiptsList.php trunk/doc/Change.log.html Modified: trunk/SelectSupplier.php =================================================================== --- trunk/SelectSupplier.php 2010-09-25 13:01:55 UTC (rev 3780) +++ trunk/SelectSupplier.php 2010-09-25 21:09:43 UTC (rev 3781) @@ -160,7 +160,7 @@ echo "<br><a href='$rootpath/PO_SelectOSPurchOrder.php?" . SID . '&SelectedSupplier=' . $_SESSION['SupplierID'] . "'>" . _('Add / Receive / View Outstanding Purchase Orders') . '</a>'; echo "<br><a href='$rootpath/PO_SelectPurchOrder.php?" . SID . '&SelectedSupplier=' . $_SESSION['SupplierID'] . "'>" . _('View All Purchase Orders') . '</a><br>'; wikiLink('Supplier', $_SESSION['SupplierID']); - echo '<br>'; + echo "<br><a href='$rootpath/ShiptsList.php?" . SID . '&SupplierID=' . $_SESSION['SupplierID'] . "&SupplierName=".urlencode($SupplierName)."'>" . _('List all open shipments for') .' '.$SupplierName. '</a>'; echo "<br><a href='$rootpath/Shipt_Select.php?" . SID . '&SelectedSupplier=' . $_SESSION['SupplierID'] . "'>" . _('Search / Modify / Close Shipments') . '</a>'; echo "<br><a href='$rootpath/SuppPriceList.php?" . SID . '&SelectedSupplier=' . $_SESSION['SupplierID'] . "'>" . _('Supplier Price List') . '</a>'; echo '</td><td valign=top class="select">'; /* Supplier Transactions */ Modified: trunk/ShiptsList.php =================================================================== --- trunk/ShiptsList.php 2010-09-25 13:01:55 UTC (rev 3780) +++ trunk/ShiptsList.php 2010-09-25 21:09:43 UTC (rev 3781) @@ -7,9 +7,11 @@ $title = _('Shipments Open Inquiry'); include('includes/header.inc'); +echo '<p class="page_title_text"><img src="' . $rootpath . '/css/' . $theme . '/images/supplier.png" title="' . + _('Supplier') . '" alt="">' . ' ' . _('Open Shipments for').' ' . $_GET['SupplierName']. '.</p>'; -if (!isset($_GET['SupplierID']) OR !isset($_GET['SupplierName'])){ - echo '<p>'; +if (!isset($_GET['SupplierID']) or !isset($_GET['SupplierName'])){ + echo '<br />'; prnMsg( _('This page must be given the supplier code to look for shipments for'), 'error'); include('includes/footer.inc'); exit; @@ -30,10 +32,9 @@ } /*show a table of the shipments returned by the SQL */ -echo '<div class="centre"><font size=4 color=BLUE>'. _('Open Shipments for').' ' . $_GET['SupplierName'] . '</font><br> - </div><table cellpadding=2 colspan=2>'; -$TableHeader = '<tr> - <th>'. _('Reference'). '</th> +echo '<table cellpadding=2 colspan=2 class=selection>'; +echo '<tr> + <th>'. _('Reference'). '</a></th> <th>'. _('Vessel'). '</th> <th>'. _('ETA'). '</th></tr>'; @@ -49,19 +50,11 @@ $k=1; } - printf('<td >%s</td> - <td>%s</td> - <td>%s</td> - </tr>', - $myrow['shiptref'], - $myrow['vessel'], - ConvertSQLDate($myrow['eta'])); + echo '<td><a href="'.$rootpath.'/Shipments.php?' . SID . 'SelectedShipment='.$myrow['shiptref'].'">'.$myrow['shiptref'].'</a></td> + <td>'.$myrow['vessel'].'</td> + <td>'.ConvertSQLDate($myrow['eta']).'</td> + </tr>'; - $j++; - If ($j == 12){ - $j=1; - $TableHeader; - } } //end of while loop Modified: trunk/doc/Change.log.html =================================================================== --- trunk/doc/Change.log.html 2010-09-25 13:01:55 UTC (rev 3780) +++ trunk/doc/Change.log.html 2010-09-25 21:09:43 UTC (rev 3781) @@ -1,5 +1,6 @@ <p><font SIZE=4 COLOR=BLUE><b>webERP Change Log</b></font></p> <p></p> +<p>25/09/10 Tim: ShiptsList.php - Add script to show list of open shipments for selected supplier</p> <p>25/09/10 Tim: Shipt_Select.php - SQL quoting corrections and layout changes and improvements and bug fixes</p> <p>25/09/10 Tim: Shippers.php - SQL quoting corrections and layout changes and improvements and bug fixes</p> <p>25/09/10 Tim: Shipments.php - SQL quoting corrections and layout changes and improvements and bug fixes</p> This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |