This list is closed, nobody may subscribe to it.
2011 |
Jan
(14) |
Feb
(42) |
Mar
(56) |
Apr
(60) |
May
(54) |
Jun
(48) |
Jul
(74) |
Aug
(52) |
Sep
(68) |
Oct
(64) |
Nov
(42) |
Dec
(62) |
---|---|---|---|---|---|---|---|---|---|---|---|---|
2012 |
Jan
(142) |
Feb
(270) |
Mar
(374) |
Apr
(230) |
May
(214) |
Jun
(116) |
Jul
(234) |
Aug
(66) |
Sep
(120) |
Oct
(16) |
Nov
(17) |
Dec
(41) |
2013 |
Jan
(19) |
Feb
(18) |
Mar
(8) |
Apr
(40) |
May
(121) |
Jun
(42) |
Jul
(127) |
Aug
(145) |
Sep
(27) |
Oct
(38) |
Nov
(83) |
Dec
(61) |
2014 |
Jan
(33) |
Feb
(35) |
Mar
(59) |
Apr
(41) |
May
(38) |
Jun
(45) |
Jul
(17) |
Aug
(58) |
Sep
(46) |
Oct
(51) |
Nov
(55) |
Dec
(36) |
2015 |
Jan
(57) |
Feb
(67) |
Mar
(70) |
Apr
(34) |
May
(32) |
Jun
(11) |
Jul
(3) |
Aug
(17) |
Sep
(16) |
Oct
(13) |
Nov
(30) |
Dec
(30) |
2016 |
Jan
(17) |
Feb
(12) |
Mar
(17) |
Apr
(20) |
May
(47) |
Jun
(15) |
Jul
(13) |
Aug
(30) |
Sep
(32) |
Oct
(20) |
Nov
(32) |
Dec
(24) |
2017 |
Jan
(16) |
Feb
|
Mar
(11) |
Apr
(11) |
May
(5) |
Jun
(42) |
Jul
(9) |
Aug
(10) |
Sep
(14) |
Oct
(15) |
Nov
(2) |
Dec
(29) |
2018 |
Jan
(28) |
Feb
(49) |
Mar
|
Apr
|
May
|
Jun
|
Jul
|
Aug
|
Sep
|
Oct
|
Nov
|
Dec
|
From: <dai...@us...> - 2011-04-14 09:18:25
|
Revision: 4549 http://web-erp.svn.sourceforge.net/web-erp/?rev=4549&view=rev Author: daintree Date: 2011-04-14 09:18:16 +0000 (Thu, 14 Apr 2011) Log Message: ----------- zh_HK.utf8 fixed again? Modified Paths: -------------- trunk/locale/zh_HK.utf8/LC_MESSAGES/messages.mo trunk/locale/zh_HK.utf8/LC_MESSAGES/messages.po Modified: trunk/locale/zh_HK.utf8/LC_MESSAGES/messages.mo =================================================================== --- trunk/locale/zh_HK.utf8/LC_MESSAGES/messages.mo 2011-04-12 10:33:45 UTC (rev 4548) +++ trunk/locale/zh_HK.utf8/LC_MESSAGES/messages.mo 2011-04-14 09:18:16 UTC (rev 4549) @@ -1,2541 +1,2676 @@ -\xDE\x95 |
From: <dai...@us...> - 2011-04-14 09:18:24
|
Revision: 4549 http://web-erp.svn.sourceforge.net/web-erp/?rev=4549&view=rev Author: daintree Date: 2011-04-14 09:18:16 +0000 (Thu, 14 Apr 2011) Log Message: ----------- zh_HK.utf8 fixed again? Modified Paths: -------------- trunk/locale/zh_HK.utf8/LC_MESSAGES/messages.mo trunk/locale/zh_HK.utf8/LC_MESSAGES/messages.po Modified: trunk/locale/zh_HK.utf8/LC_MESSAGES/messages.mo =================================================================== --- trunk/locale/zh_HK.utf8/LC_MESSAGES/messages.mo 2011-04-12 10:33:45 UTC (rev 4548) +++ trunk/locale/zh_HK.utf8/LC_MESSAGES/messages.mo 2011-04-14 09:18:16 UTC (rev 4549) @@ -1,2541 +1,2676 @@ -\xDE\x95 |
From: <dai...@us...> - 2011-04-12 10:33:53
|
Revision: 4548 http://web-erp.svn.sourceforge.net/web-erp/?rev=4548&view=rev Author: daintree Date: 2011-04-12 10:33:45 +0000 (Tue, 12 Apr 2011) Log Message: ----------- tim launchpad fork Modified Paths: -------------- trunk/DeliveryDetails.php trunk/POReport.php trunk/Stocks.php trunk/TaxProvinces.php trunk/UnitsOfMeasure.php trunk/UpgradeDatabase.php trunk/WOSerialNos.php trunk/WorkOrderIssue.php trunk/Z_Upgrade3.10.php trunk/Z_Upgrade_3.09-3.10.php Modified: trunk/DeliveryDetails.php =================================================================== --- trunk/DeliveryDetails.php 2011-04-11 10:49:45 UTC (rev 4547) +++ trunk/DeliveryDetails.php 2011-04-12 10:33:45 UTC (rev 4548) @@ -1,7 +1,6 @@ <?php /* $Id$ */ -/* $Revision: 1.76 $ */ /* This is where the delivery details are confirmed/entered/modified and the order committed to the database once the place order/modify order button is hit. @@ -81,13 +80,13 @@ /* If (strlen($_POST['BrAdd3'])==0 OR !isset($_POST['BrAdd3'])){ $InputErrors =1; - echo "<br>A region or city must be entered.<br>"; + echo "<br />A region or city must be entered.<br />"; } Maybe appropriate in some installations but not here If (strlen($_POST['BrAdd2'])<=1){ $InputErrors =1; - echo "<br>You should enter the suburb in the box provided. Orders cannot be accepted without a valid suburb being entered.<br>"; + echo "<br />You should enter the suburb in the box provided. Orders cannot be accepted without a valid suburb being entered.<br />"; } */ @@ -111,7 +110,7 @@ elseif (Date1GreaterThanDate2(Date($_SESSION['DefaultDateFormat'],$EarliestDispatch), $_POST['DeliveryDate'])){ $InputErrors =1; - echo '<br><b>' . _('The delivery details cannot be updated because you are attempting to set the date the order is to be dispatched earlier than is possible. No dispatches are made on Saturday and Sunday. Also, the dispatch cut off time is') . $_SESSION['DispatchCutOffTime'] . _(':00 hrs. Orders placed after this time will be dispatched the following working day.'); + echo '<br /><b>' . _('The delivery details cannot be updated because you are attempting to set the date the order is to be dispatched earlier than is possible. No dispatches are made on Saturday and Sunday. Also, the dispatch cut off time is') . $_SESSION['DispatchCutOffTime'] . _(':00 hrs. Orders placed after this time will be dispatched the following working day.'); } */ @@ -153,7 +152,7 @@ prnMsg(_('The branch details for branch code') . ': ' . $_SESSION['Items'.$identifier]->Branch . ' ' . _('against customer code') . ': ' . $_POST['Select'] . ' ' . _('could not be retrieved') . '. ' . _('Check the set up of the customer and branch'),'error'); if ($debug==1){ - echo '<br>' . _('The SQL that failed to get the branch details was') . ':<br>' . $sql; + echo '<br />' . _('The SQL that failed to get the branch details was') . ':<br />' . $sql; } include('includes/footer.inc'); exit; @@ -280,7 +279,7 @@ } If ($_POST['FreightCost'] != $OldFreightCost && $_SESSION['DoFreightCalc']==True){ $OK_to_PROCESS = 0; - prnMsg(_('The freight charge has been updated') . '. ' . _('Please reconfirm that the order and the freight charges are acceptable and then confirm the order again if OK') .' <br> '. _('The new freight cost is') .' ' . $_POST['FreightCost'] . ' ' . _('and the previously calculated freight cost was') .' '. $OldFreightCost,'warn'); + prnMsg(_('The freight charge has been updated') . '. ' . _('Please reconfirm that the order and the freight charges are acceptable and then confirm the order again if OK') .' <br /> '. _('The new freight cost is') .' ' . $_POST['FreightCost'] . ' ' . _('and the previously calculated freight cost was') .' '. $OldFreightCost,'warn'); } else { /*check the customer's payment terms */ @@ -417,7 +416,7 @@ AND $_SESSION['AutoCreateWOs']==1 AND $_SESSION['Items'.$identifier]->Quotation!=1){ //oh yeah its all on! - echo '<br>'; + echo '<br />'; //now get the data required to test to see if we need to make a new WO $QOHResult = DB_query("SELECT SUM(quantity) FROM locstock WHERE stockid='" . $StockItem->StockID . "'",$db); @@ -559,7 +558,7 @@ } /* end inserted line items into sales order details */ $result = DB_Txn_Commit($db); - echo '<br>'; + echo '<br />'; if ($_SESSION['Items'.$identifier]->Quotation==1){ prnMsg(_('Quotation Number') . ' ' . $OrderNo . ' ' . _('has been entered'),'success'); } else { @@ -571,19 +570,44 @@ if ($_POST['Quotation']==0) { /*then its not a quotation its a real order */ - echo '<br><table class=selection><tr><td><img src="'.$rootpath.'/css/'.$theme.'/images/printer.png" title="' . _('Print') . '" alt=""></td><td>' . ' ' . '<a target="_blank" href="' . $rootpath . '/PrintCustOrder.php?identifier='.$identifier . '&TransNo=' . $OrderNo . '">'. _('Print packing slip') . ' (' . _('Preprinted stationery') . ')' .'</a></td></tr>'; - echo '<tr><td><img src="'.$rootpath.'/css/'.$theme.'/images/printer.png" title="' . _('Print') . '" alt=""></td><td>' . ' ' . '<a target="_blank" href="' . $rootpath . '/PrintCustOrder_generic.php?identifier='.$identifier . '&TransNo=' . $OrderNo . '">'. _('Print packing slip') . ' (' . _('Laser') . ')' .'</a></td></tr>'; + echo '<br /><table class=selection> + <tr> + <td><img src="'.$rootpath.'/css/'.$theme.'/images/printer.png" title="' . _('Print') . '" alt=""></td> + <td>' . ' ' . '<a target="_blank" href="' . $rootpath . '/PrintCustOrder.php?identifier='.$identifier . '&TransNo=' . $OrderNo . '">'. _('Print packing slip') . ' (' . _('Preprinted stationery') . ')' .'</a></td> + </tr>'; + echo '<tr> + <td><img src="'.$rootpath.'/css/'.$theme.'/images/printer.png" title="' . _('Print') . '" alt=""></td> + <td>' . ' ' . '<a target="_blank" href="' . $rootpath . '/PrintCustOrder_generic.php?identifier='.$identifier . '&TransNo=' . $OrderNo . '">'. _('Print packing slip') . ' (' . _('Laser') . ')' .'</a></td> + </tr>'; - echo '<tr><td><img src="'.$rootpath.'/css/'.$theme.'/images/reports.png" title="' . _('Invoice') . '" alt=""></td><td>' . ' ' . '<a href="' . $rootpath . '/ConfirmDispatch_Invoice.php?identifier='.$identifier . '&OrderNumber=' . $OrderNo .'">'. _('Confirm Dispatch and Produce Invoice') .'</a></td></tr>'; - //Add option to Print Sales Orders or Proforma invoice - echo '<tr><td><img src="'.$rootpath.'/css/'.$theme.'/images/pdf.png" title="' . _('Sales Order') . '" alt=""></td><td>' . ' ' . '<a href="' . $rootpath . '/PrintSalesOrder_generic.php?identifier='.$identifier . '&TransNo=' . $OrderNo .'">'. _('Print Sales Order / Pro-forma Invoice') .'</a></td></tr></table>'; + echo '<tr> + <td><img src="'.$rootpath.'/css/'.$theme.'/images/reports.png" title="' . _('Invoice') . '" alt=""></td> + <td>' . ' ' . '<a href="' . $rootpath . '/ConfirmDispatch_Invoice.php?identifier='.$identifier . '&OrderNumber=' . $OrderNo .'">'. _('Confirm Dispatch and Produce Invoice') .'</a></td> + </tr>'; + + echo '</table>'; } else { /*link to print the quotation */ - echo '<br><table class=selection><tr><td><img src="'.$rootpath.'/css/'.$theme.'/images/reports.png" title="' . _('Order') . '" alt=""></td><td>' . ' ' . '<a href="' . $rootpath . '/PDFQuotation.php?' . SID .'identifier='.$identifier . '&QuotationNo=' . $OrderNo . '">'. _('Print Quotation (Landscape)') .'</a></td></tr></table>'; - echo '<br><table class=selection><tr><td><img src="'.$rootpath.'/css/'.$theme.'/images/reports.png" title="' . _('Order') . '" alt=""></td><td>' . ' ' . '<a href="' . $rootpath . '/PDFQuotationPortrait.php?' . SID .'identifier='.$identifier . '&QuotationNo=' . $OrderNo . '">'. _('Print Quotation (Portrait)') .'</a></td></tr></table>'; + echo '<br /><table class=selection> + <tr> + <td><img src="'.$rootpath.'/css/'.$theme.'/images/reports.png" title="' . _('Order') . '" alt=""></td> + <td>' . ' ' . '<a href="' . $rootpath . '/PDFQuotation.php?' . SID .'identifier='.$identifier . '&QuotationNo=' . $OrderNo . '">'. _('Print Quotation (Landscape)') .'</a></td> + </tr> + </table>'; + echo '<br /><table class=selection> + <tr> + <td><img src="'.$rootpath.'/css/'.$theme.'/images/reports.png" title="' . _('Order') . '" alt=""></td> + <td>' . ' ' . '<a href="' . $rootpath . '/PDFQuotationPortrait.php?' . SID .'identifier='.$identifier . '&QuotationNo=' . $OrderNo . '">'. _('Print Quotation (Portrait)') .'</a></td> + </tr> + </table>'; } - echo '<br><table class=selection><tr><td><img src="'.$rootpath.'/css/'.$theme.'/images/sales.png" title="' . _('Order') . '" alt=""></td><td>' . ' ' . '<a href="'. $rootpath .'/SelectOrderItems.php?identifier='.$identifier . '&NewOrder=Yes">'. _('Add Another Sales Order') .'</a></td></tr></table>'; + echo '<br /><table class=selection> + <tr> + <td><img src="'.$rootpath.'/css/'.$theme.'/images/sales.png" title="' . _('Order') . '" alt=""></td> + <td>' . ' ' . '<a href="'. $rootpath .'/SelectOrderItems.php?identifier='.$identifier . '&NewOrder=Yes">'. _('Add Another Sales Order') .'</a></td> + </tr> + </table>'; } else { /*its a customer logon so thank them */ prnMsg(_('Thank you for your business'),'success'); @@ -747,7 +771,7 @@ prnMsg(_('Order Number') .' ' . $_SESSION['ExistingOrder'] . ' ' . _('has been updated'),'success'); - echo '<br><table class=selection><tr><td><img src="'.$rootpath.'/css/'.$theme.'/images/printer.png" title="' . _('Print') . '" alt=""></td><td><a href="' . $rootpath . '/PrintCustOrder.php?identifier='.$identifier . '&TransNo=' . $_SESSION['ExistingOrder'] . '">'. _('Print packing slip - pre-printed stationery') .'</a></td></tr>'; + echo '<br /><table class=selection><tr><td><img src="'.$rootpath.'/css/'.$theme.'/images/printer.png" title="' . _('Print') . '" alt=""></td><td><a href="' . $rootpath . '/PrintCustOrder.php?identifier='.$identifier . '&TransNo=' . $_SESSION['ExistingOrder'] . '">'. _('Print packing slip - pre-printed stationery') .'</a></td></tr>'; echo '<tr><td><img src="'.$rootpath.'/css/'.$theme.'/images/printer.png" title="' . _('Print') . '" alt=""></td><td><a target="_blank" href="' . $rootpath . '/PrintCustOrder_generic.php?identifier='.$identifier . '&TransNo=' . $_SESSION['ExistingOrder'] . '">'. _('Print packing slip') . ' (' . _('Laser') . ')' .'</a></td></tr>'; echo '<tr><td><img src="'.$rootpath.'/css/'.$theme.'/images/reports.png" title="' . _('Invoice') . '" alt=""></td><td><a href="' . $rootpath .'/ConfirmDispatch_Invoice.php?identifier='.$identifier . '&OrderNumber=' . $_SESSION['ExistingOrder'] . '">'. _('Confirm Order Delivery Quantities and Produce Invoice') .'</a></td></tr>'; echo '<tr><td><img src="'.$rootpath.'/css/'.$theme.'/images/sales.png" title="' . _('Order') . '" alt=""></td><td><a href="' . $rootpath .'/SelectSalesOrder.php?identifier='.$identifier . '">'. _('Select A Different Order') .'</a></td></tr></table>'; @@ -833,7 +857,7 @@ $DisplayVolume = number_format($_SESSION['Items'.$identifier]->totalVolume,2); $DisplayWeight = number_format($_SESSION['Items'.$identifier]->totalWeight,2); - echo '<br><table><tr class="EvenTableRows"> + echo '<br /><table><tr class="EvenTableRows"> <td>'. _('Total Weight') .':</td> <td>'.$DisplayWeight.'</td> <td>'. _('Total Volume') .':</td> @@ -903,7 +927,7 @@ } -echo '<br><table class=selection><tr> +echo '<br /><table class=selection><tr> <td>'. _('Deliver To') .':</td> <td><input type=text size=42 maxlength=40 name="DeliverTo" value="' . $_SESSION['Items'.$identifier]->DeliverTo . '"></td> </tr>'; @@ -1082,13 +1106,13 @@ echo '</table>'; -echo '<br><div class="centre"><input type=submit name="BackToLineDetails" value="' . _('Modify Order Lines') . '"><br>'; +echo '<br /><div class="centre"><input type=submit name="BackToLineDetails" value="' . _('Modify Order Lines') . '"><br />'; if ($_SESSION['ExistingOrder']==0){ - echo '<br><br><input type=submit name="ProcessOrder" value="' . _('Place Order') . '">'; - echo '<br><br><input type=submit name="MakeRecurringOrder" VALUE="' . _('Create Recurring Order') . '">'; + echo '<br /><br /><input type=submit name="ProcessOrder" value="' . _('Place Order') . '">'; + echo '<br /><br /><input type=submit name="MakeRecurringOrder" VALUE="' . _('Create Recurring Order') . '">'; } else { - echo '<br><input type=submit name="ProcessOrder" VALUE="' . _('Commit Order Changes') . '">'; + echo '<br /><input type=submit name="ProcessOrder" VALUE="' . _('Commit Order Changes') . '">'; } echo '</div></form>'; Modified: trunk/POReport.php =================================================================== --- trunk/POReport.php 2011-04-11 10:49:45 UTC (rev 4547) +++ trunk/POReport.php 2011-04-12 10:33:45 UTC (rev 4548) @@ -40,9 +40,9 @@ $SupplierNameOp = $_POST['SupplierNameOp']; - // Save $_POST['SummaryType'] in $savesummarytype because change $_POST['SummaryType'] when + // Save $_POST['SummaryType'] in $SaveSummaryType because change $_POST['SummaryType'] when // create $sql - $savesummarytype = $_POST['SummaryType']; + $SaveSummaryType = $_POST['SummaryType']; } if (isset($_POST['SupplierName'])){ @@ -60,11 +60,11 @@ if (isset($_POST['submit'])) { echo '<p class="page_title_text"><img src="'.$rootpath.'/css/'.$theme.'/images/maintenance.png" title="' . _('Search') . '" alt="" />' . ' ' . $title.'</p>'; - submit($db,$PartNumber,$PartNumberOp,$SupplierId,$SupplierIdOp,$SupplierName,$SupplierNameOp,$savesummarytype); + submit($db,$PartNumber,$PartNumberOp,$SupplierId,$SupplierIdOp,$SupplierName,$SupplierNameOp,$SaveSummaryType); } else if (isset($_POST['submitcsv'])) { echo '<p class="page_title_text"><img src="'.$rootpath.'/css/'.$theme.'/images/maintenance.png" title="' . _('Search') . '" alt="" />' . ' ' . $title.'</p>'; - submitcsv($db,$PartNumber,$PartNumberOp,$SupplierId,$SupplierIdOp,$SupplierName,$SupplierNameOp,$savesummarytype); + submitcsv($db,$PartNumber,$PartNumberOp,$SupplierId,$SupplierIdOp,$SupplierName,$SupplierNameOp,$SaveSummaryType); } else { echo '<p class="page_title_text"><img src="'.$rootpath.'/css/'.$theme.'/images/maintenance.png" title="' . _('Search') . '" alt="" />' . '</img>' . $title.'</p>'; @@ -73,7 +73,7 @@ //####_SUBMIT_SUBMIT_SUBMIT_SUBMIT_SUBMIT_SUBMIT_SUBMIT_SUBMIT_SUBMIT_SUBMIT_SUBMIT_SUBMIT#### -function submit(&$db,$PartNumber,$PartNumberOp,$SupplierId,$SupplierIdOp,$SupplierName,$SupplierNameOp,$savesummarytype) +function submit(&$db,$PartNumber,$PartNumberOp,$SupplierId,$SupplierIdOp,$SupplierName,$SupplierNameOp,$SaveSummaryType) { //initialize no input errors @@ -94,71 +94,71 @@ } # Add more to WHERE statement, if user entered something for the part number,supplierid, name - $wherepart = ' '; + $WherePart = ' '; if (strlen($PartNumber) > 0 && $PartNumberOp == 'LIKE') { $PartNumber = $PartNumber . '%'; } else { $PartNumberOp = '='; } if (strlen($PartNumber) > 0) { - $wherepart = " AND purchorderdetails.itemcode " . $PartNumberOp . " '" . $PartNumber . "' "; + $WherePart = " AND purchorderdetails.itemcode " . $PartNumberOp . " '" . $PartNumber . "' "; } else { - $wherepart=' '; + $WherePart=' '; } - $wheresupplierid = ' '; + $WhereSupplierID = ' '; if ($SupplierIdOp == 'LIKE') { $SupplierId = $SupplierId . '%'; } else { $SupplierIdOp = '='; } if (strlen($SupplierId) > 0) { - $wheresupplierid = " AND purchorders.supplierno " . $SupplierIdOp . " '" . $SupplierId . "' "; + $WhereSupplierID = " AND purchorders.supplierno " . $SupplierIdOp . " '" . $SupplierId . "' "; } else { - $wheresupplierid=' '; + $WhereSupplierID=' '; } - $wheresuppliername = ' '; + $WhereSupplierName = ' '; if (strlen($SupplierName) > 0 && $SupplierNameOp == 'LIKE') { $SupplierName = $SupplierName . '%'; } else { $SupplierNameOp = '='; } if (strlen($SupplierName) > 0) { - $wheresuppliername = " AND suppliers.suppname " . $SupplierNameOp . " '" . $SupplierName . "' "; + $WhereSupplierName = " AND suppliers.suppname " . $SupplierNameOp . " '" . $SupplierName . "' "; } else { - $wheresuppliername=' '; + $WhereSupplierName=' '; } if (strlen($_POST['OrderNo']) > 0) { - $whereorderno = ' AND purchorderdetails.orderno = ' . " '" . $_POST['OrderNo'] . "' "; + $WhereOrderNo = ' AND purchorderdetails.orderno = ' . " '" . $_POST['OrderNo'] . "' "; } else { - $whereorderno=' '; + $WhereOrderNo=' '; } - $wherelinestatus = ' '; + $WhereLineStatus = ' '; # Had to use IF statement instead of comparing 'linestatus' to $_POST['LineStatus'] #in WHERE clause because the WHERE clause didn't recognize # that had used the IF statement to create a field called linestatus if ($_POST['LineStatus'] != 'All') { if ($_POST['DateType'] == 'Order') { - $wherelinestatus = " AND IF(purchorderdetails.quantityord = purchorderdetails.qtyinvoiced || + $WhereLineStatus = " AND IF(purchorderdetails.quantityord = purchorderdetails.qtyinvoiced || purchorderdetails.completed = 1,'Completed','Open') = '" . $_POST['LineStatus'] . "'"; } else { - $wherelinestatus = " AND IF(grns.qtyrecd - grns.quantityinv <> 0,'Open','Completed') = '" + $WhereLineStatus = " AND IF(grns.qtyrecd - grns.quantityinv <> 0,'Open','Completed') = '" . $_POST['LineStatus'] . "'"; } } - $wherecategory = ' '; + $WhereCategory = ' '; if ($_POST['Category'] != 'All') { - $wherecategory = " AND stockmaster.categoryid = '" . $_POST['Category'] . "'"; + $WhereCategory = " AND stockmaster.categoryid = '" . $_POST['Category'] . "'"; } if ($InputError !=1) { - $fromdate = FormatDateForSQL($_POST['FromDate']); - $todate = FormatDateForSQL($_POST['ToDate']); + $FromDate = FormatDateForSQL($_POST['FromDate']); + $ToDate = FormatDateForSQL($_POST['ToDate']); if ($_POST['ReportType'] == 'Detail') { if ($_POST['DateType'] == 'Order') { $sql = "SELECT purchorderdetails.orderno, @@ -179,14 +179,14 @@ LEFT JOIN purchorders ON purchorders.orderno=purchorderdetails.orderno LEFT JOIN suppliers ON purchorders.supplierno = suppliers.supplierid LEFT JOIN stockmaster ON purchorderdetails.itemcode = stockmaster.stockid - WHERE purchorders.orddate >='$fromdate' - AND purchorders.orddate <='$todate' - $wherepart - $wheresupplierid - $wheresuppliername - $whereorderno - $wherelinestatus - $wherecategory + WHERE purchorders.orddate >='$FromDate' + AND purchorders.orddate <='$ToDate' + $WherePart + $WhereSupplierID + $WhereSupplierName + $WhereOrderNo + $WhereLineStatus + $WhereCategory ORDER BY " . $_POST['SortBy']; } else { // Selects by delivery date from grns @@ -208,14 +208,14 @@ LEFT JOIN purchorders ON purchorders.orderno=purchorderdetails.orderno LEFT JOIN suppliers ON purchorders.supplierno = suppliers.supplierid LEFT JOIN stockmaster ON purchorderdetails.itemcode = stockmaster.stockid - WHERE grns.deliverydate >='$fromdate' - AND grns.deliverydate <='$todate' - $wherepart - $wheresupplierid - $wheresuppliername - $whereorderno - $wherelinestatus - $wherecategory + WHERE grns.deliverydate >='$FromDate' + AND grns.deliverydate <='$ToDate' + $WherePart + $WhereSupplierID + $WhereSupplierName + $WhereOrderNo + $WhereLineStatus + $WhereCategory ORDER BY " . $_POST['SortBy']; } } else { @@ -242,14 +242,14 @@ LEFT JOIN suppliers ON purchorders.supplierno = suppliers.supplierid LEFT JOIN stockmaster ON purchorderdetails.itemcode = stockmaster.stockid LEFT JOIN stockcategory ON stockcategory.categoryid = stockmaster.categoryid - WHERE purchorders.orddate >='$fromdate' - AND purchorders.orddate <='$todate' - $wherepart - $wheresupplierid - $wheresuppliername - $whereorderno - $wherelinestatus - $wherecategory + WHERE purchorders.orddate >='$FromDate' + AND purchorders.orddate <='$ToDate' + $WherePart + $WhereSupplierID + $WhereSupplierName + $WhereOrderNo + $WhereLineStatus + $WhereCategory GROUP BY " . $_POST['SummaryType'] . ',stockmaster.decimalplaces, stockmaster.description @@ -267,14 +267,14 @@ LEFT JOIN suppliers ON purchorders.supplierno = suppliers.supplierid LEFT JOIN stockmaster ON purchorderdetails.itemcode = stockmaster.stockid LEFT JOIN stockcategory ON stockcategory.categoryid = stockmaster.categoryid - WHERE purchorders.orddate >='$fromdate' - AND purchorders.orddate <='$todate' - $wherepart - $wheresupplierid - $wheresuppliername - $whereorderno - $wherelinestatus - $wherecategory + WHERE purchorders.orddate >='$FromDate' + AND purchorders.orddate <='$ToDate' + $WherePart + $WhereSupplierID + $WhereSupplierName + $WhereOrderNo + $WhereLineStatus + $WhereCategory GROUP BY " . $_POST['SummaryType'] . ',purchorders.supplierno, suppliers.suppname @@ -291,14 +291,14 @@ LEFT JOIN suppliers ON purchorders.supplierno = suppliers.supplierid LEFT JOIN stockmaster ON purchorderdetails.itemcode = stockmaster.stockid LEFT JOIN stockcategory ON stockcategory.categoryid = stockmaster.categoryid - WHERE purchorders.orddate >='$fromdate' - AND purchorders.orddate <='$todate' - $wherepart - $wheresupplierid - $wheresuppliername - $whereorderno - $wherelinestatus - $wherecategory + WHERE purchorders.orddate >='$FromDate' + AND purchorders.orddate <='$ToDate' + $WherePart + $WhereSupplierID + $WhereSupplierName + $WhereOrderNo + $WhereLineStatus + $WhereCategory GROUP BY " . $_POST['SummaryType'] . ',purchorders.supplierno, suppliers.suppname @@ -315,14 +315,14 @@ LEFT JOIN suppliers ON purchorders.supplierno = suppliers.supplierid LEFT JOIN stockmaster ON purchorderdetails.itemcode = stockmaster.stockid LEFT JOIN stockcategory ON stockcategory.categoryid = stockmaster.categoryid - WHERE purchorders.orddate >='$fromdate' - AND purchorders.orddate <='$todate' - $wherepart - $wheresupplierid - $wheresuppliername - $whereorderno - $wherelinestatus - $wherecategory + WHERE purchorders.orddate >='$FromDate' + AND purchorders.orddate <='$ToDate' + $WherePart + $WhereSupplierID + $WhereSupplierName + $WhereOrderNo + $WhereLineStatus + $WhereCategory GROUP BY " . $_POST['SummaryType'] . ', monthname ORDER BY ' . $orderby; @@ -338,14 +338,14 @@ LEFT JOIN suppliers ON purchorders.supplierno = suppliers.supplierid LEFT JOIN stockmaster ON purchorderdetails.itemcode = stockmaster.stockid LEFT JOIN stockcategory ON stockcategory.categoryid = stockmaster.categoryid - WHERE purchorders.orddate >='$fromdate' - AND purchorders.orddate <='$todate' - $wherepart - $wheresupplierid - $wheresuppliername - $whereorderno - $wherelinestatus - $wherecategory + WHERE purchorders.orddate >='$FromDate' + AND purchorders.orddate <='$ToDate' + $WherePart + $WhereSupplierID + $WhereSupplierName + $WhereOrderNo + $WhereLineStatus + $WhereCategory GROUP BY " . $_POST['SummaryType'] . ', categorydescription ORDER BY ' . $orderby; @@ -365,14 +365,14 @@ LEFT JOIN suppliers ON purchorders.supplierno = suppliers.supplierid LEFT JOIN stockmaster ON purchorderdetails.itemcode = stockmaster.stockid LEFT JOIN stockcategory ON stockcategory.categoryid = stockmaster.categoryid - WHERE grns.deliverydate >='$fromdate' - AND grns.deliverydate <='$todate' - $wherepart - $wheresupplierid - $wheresuppliername - $whereorderno - $wherelinestatus - $wherecategory + WHERE grns.deliverydate >='$FromDate' + AND grns.deliverydate <='$ToDate' + $WherePart + $WhereSupplierID + $WhereSupplierName + $WhereOrderNo + $WhereLineStatus + $WhereCategory GROUP BY " . $_POST['SummaryType'] . ', stockmaster.description ORDER BY ' . $orderby; @@ -390,14 +390,14 @@ LEFT JOIN suppliers ON purchorders.supplierno = suppliers.supplierid LEFT JOIN stockmaster ON purchorderdetails.itemcode = stockmaster.stockid LEFT JOIN stockcategory ON stockcategory.categoryid = stockmaster.categoryid - WHERE grns.deliverydate >='$fromdate' - AND grns.deliverydate <='$todate' - $wherepart - $wheresupplierid - $wheresuppliername - $whereorderno - $wherelinestatus - $wherecategory + WHERE grns.deliverydate >='$FromDate' + AND grns.deliverydate <='$ToDate' + $WherePart + $WhereSupplierID + $WhereSupplierName + $WhereOrderNo + $WhereLineStatus + $WhereCategory GROUP BY " . $_POST['SummaryType'] . ', purchorders.supplierno, suppliers.suppname @@ -415,14 +415,14 @@ LEFT JOIN suppliers ON purchorders.supplierno = suppliers.supplierid LEFT JOIN stockmaster ON purchorderdetails.itemcode = stockmaster.stockid LEFT JOIN stockcategory ON stockcategory.categoryid = stockmaster.categoryid - WHERE grns.deliverydate >='$fromdate' - AND grns.deliverydate <='$todate' - $wherepart - $wheresupplierid - $wheresuppliername - $whereorderno - $wherelinestatus - $wherecategory + WHERE grns.deliverydate >='$FromDate' + AND grns.deliverydate <='$ToDate' + $WherePart + $WhereSupplierID + $WhereSupplierName + $WhereOrderNo + $WhereLineStatus + $WhereCategory GROUP BY " . $_POST['SummaryType'] . ', purchorders.supplierno, suppliers.suppname @@ -440,14 +440,14 @@ LEFT JOIN suppliers ON purchorders.supplierno = suppliers.supplierid LEFT JOIN stockmaster ON purchorderdetails.itemcode = stockmaster.stockid LEFT JOIN stockcategory ON stockcategory.categoryid = stockmaster.categoryid - WHERE grns.deliverydate >='$fromdate' - AND grns.deliverydate <='$todate' - $wherepart - $wheresupplierid - $wheresuppliername - $whereorderno - $wherelinestatus - $wherecategory + WHERE grns.deliverydate >='$FromDate' + AND grns.deliverydate <='$ToDate' + $WherePart + $WhereSupplierID + $WhereSupplierName + $WhereOrderNo + $WhereLineStatus + $WhereCategory GROUP BY " . $_POST['SummaryType'] . ',monthname ORDER BY ' . $orderby; @@ -464,14 +464,14 @@ LEFT JOIN suppliers ON purchorders.supplierno = suppliers.supplierid LEFT JOIN stockmaster ON purchorderdetails.itemcode = stockmaster.stockid LEFT JOIN stockcategory ON stockcategory.categoryid = stockmaster.categoryid - WHERE grns.deliverydate >='$fromdate' - AND grns.deliverydate <='$todate' - $wherepart - $wheresupplierid - $wheresuppliername - $whereorderno - $wherelinestatus - $wherecategory + WHERE grns.deliverydate >='$FromDate' + AND grns.deliverydate <='$ToDate' + $WherePart + $WhereSupplierID + $WhereSupplierName + $WhereOrderNo + $WhereLineStatus + $WhereCategory GROUP BY " . $_POST['SummaryType'] . ',categorydescription ORDER BY ' . $orderby; @@ -482,35 +482,35 @@ $ErrMsg = _('The SQL to find the parts selected failed with the message'); $result = DB_query($sql,$db,$ErrMsg); $ctr = 0; - $totalqty = 0; - $totalextcost = 0; - $totalextprice = 0; - $totalinvqty = 0; + $TotalQty = 0; + $TotalExtCost = 0; + $TotalExtPrice = 0; + $TotalInvQty = 0; - // Create array for summary type to display in header. Access it with $savesummarytype - $summary_array["orderno"] = _('Order Number'); - $summary_array["itemcode"] = _('Part Number'); - $summary_array["extprice"] = _('Extended Price'); - $summary_array["supplierno"] = _('Customer Number'); - $summary_array["suppname"] = _('Customer Name'); - $summary_array["month"] = _('Month'); - $summary_array["categoryid"] = _('Stock Category'); + // Create array for summary type to display in header. Access it with $SaveSummaryType + $Summary_Array["orderno"] = _('Order Number'); + $Summary_Array["itemcode"] = _('Part Number'); + $Summary_Array["extprice"] = _('Extended Price'); + $Summary_Array["supplierno"] = _('Customer Number'); + $Summary_Array["suppname"] = _('Customer Name'); + $Summary_Array["month"] = _('Month'); + $Summary_Array["categoryid"] = _('Stock Category'); // Create array for sort for detail report to display in header - $detail_array['purchorderdetails.orderno'] = _('Order Number'); - $detail_array['purchorderdetails.itemcode'] = _('Part Number'); - $detail_array['suppliers.supplierid,purchorderdetails.orderno'] = _('Supplier Number'); - $detail_array['suppliers.suppname,suppliers.supplierid,purchorderdetails.orderno'] = _('Supplier Name'); + $Detail_Array['purchorderdetails.orderno'] = _('Order Number'); + $Detail_Array['purchorderdetails.itemcode'] = _('Part Number'); + $Detail_Array['suppliers.supplierid,purchorderdetails.orderno'] = _('Supplier Number'); + $Detail_Array['suppliers.suppname,suppliers.supplierid,purchorderdetails.orderno'] = _('Supplier Name'); // Display Header info echo '<table class=selection>'; if ($_POST['ReportType'] == 'Summary') { - $sortby_display = $summary_array[$savesummarytype]; + $SortBy_Display = $Summary_Array[$SaveSummaryType]; } else { - $sortby_display = $detail_array[$_POST['SortBy']]; + $SortBy_Display = $Detail_Array[$_POST['SortBy']]; } echo '<tr><th colspan=2><font size=3 color=navy>'._('Header Details').'</font></th></tr>'; - echo '<tr><td>' . _('Purchase Order Report') . '</td><td>' . $_POST['ReportType'] . ' By '.$sortby_display .'</td></tr>'; + echo '<tr><td>' . _('Purchase Order Report') . '</td><td>' . $_POST['ReportType'] . ' By '.$SortBy_Display .'</td></tr>'; echo '<tr><td>' . _('Date Type') . '</td><td>' . $_POST['DateType'] . '</tr>'; echo '<tr><td>' . _('Date Range') . '</td><td>' . $_POST['FromDate'] . _(' To ') . $_POST['ToDate'] . '</td></tr>'; if (strlen(trim($PartNumber)) > 0) { @@ -567,11 +567,11 @@ $myrow['linestatus'], ConvertSQLDate($myrow['deliverydate']), $myrow['description']); - $lastdecimalplaces = $myrow['decimalplaces']; - $totalqty += $myrow['quantityord']; - $totalextcost += $myrow['extcost']; - $totalextprice += $myrow['extprice']; - $totalinvqty += $myrow['qtyinvoiced']; + $LastDecimalPlaces = $myrow['decimalplaces']; + $TotalQty += $myrow['quantityord']; + $TotalExtCost += $myrow['extcost']; + $TotalExtPrice += $myrow['extprice']; + $TotalInvQty += $myrow['qtyinvoiced']; } //END WHILE LIST LOOP // Print totals printf("<tr><td>%s</td><td>%s</td><td>%s</td><td>%s</td><td>%s</td><td class=number>%s</td><td class=number>%s</td> @@ -581,10 +581,10 @@ ' ', ' ', ' ', - number_format($totalqty,2), - number_format($totalextcost,2), - number_format($totalextprice,2), - number_format($totalinvqty,2), + number_format($TotalQty,2), + number_format($TotalExtCost,2), + number_format($TotalExtPrice,2), + number_format($TotalInvQty,2), ' ', ' '); } else { @@ -629,11 +629,11 @@ $myrow['linestatus'], ConvertSQLDate($myrow['deliverydate']), $myrow['description']); - $lastdecimalplaces = $myrow['decimalplaces']; - $totalqty += $myrow['quantityord']; - $totalextcost += $myrow['extcost']; - $totalextprice += $myrow['extprice']; - $totalinvqty += $myrow['qtyinvoiced']; + $LastDecimalPlaces = $myrow['decimalplaces']; + $TotalQty += $myrow['quantityord']; + $TotalExtCost += $myrow['extcost']; + $TotalExtPrice += $myrow['extprice']; + $TotalInvQty += $myrow['qtyinvoiced']; } //END WHILE LIST LOOP // Print totals printf("<tr><td>%s</td><td>%s</td><td>%s</td><td>%s</td><td>%s</td><td class=number>%s</td><td class=number> @@ -643,10 +643,10 @@ ' ', ' ', ' ', - number_format($totalqty,$lastdecimalplaces), - number_format($totalextcost,2), - number_format($totalextprice,2), - number_format($totalinvqty,$lastdecimalplaces), + number_format($TotalQty,$LastDecimalPlaces), + number_format($TotalExtCost,2), + number_format($TotalExtPrice,2), + number_format($TotalInvQty,$LastDecimalPlaces), ' ', ' '); } @@ -724,23 +724,23 @@ number_format($myrow['extprice'],2), $myrow['qtyinvoiced'], $suppname); - $totalqty += $myrow['quantityord']; - $totalextcost += $myrow['extcost']; - $totalextprice += $myrow['extprice']; - $totalinvqty += $myrow['qtyinvoiced']; + $TotalQty += $myrow['quantityord']; + $TotalExtCost += $myrow['extcost']; + $TotalExtPrice += $myrow['extprice']; + $TotalInvQty += $myrow['qtyinvoiced']; } //END WHILE LIST LOOP // Print totals printf("<tr><td>%s</td><td>%s</td><td class=number>%s</td><td class=number>%s</td><td class=number>%s</td><td class=number>%s</td></tr>", 'Totals', _('Lines - ') . $linectr, - $totalqty, - number_format($totalextcost,2), - number_format($totalextprice,2), - $totalinvqty, + $TotalQty, + number_format($TotalExtCost,2), + number_format($TotalExtPrice,2), + $TotalInvQty, ' '); } // End of if ($_POST['ReportType'] echo '</table>'; - echo "<form action=" . $_SERVER['PHP_SELF'] . "?" . SID ." method=post>"; + echo '<form action="' . $_SERVER['PHP_SELF'] . '" method="post">'; echo '<input type="hidden" name="FormID" value="' . $_SESSION['FormID'] . '" />'; echo "<input type=hidden name='ReportType' value=".$_POST['ReportType'].">"; echo "<input type=hidden name='DateType' value=".$_POST['DateType'].">"; @@ -758,13 +758,19 @@ echo "<input type=hidden name='SortBy' value=".$_POST['SortBy'].">"; echo "<input type=hidden name='SummaryType' value=".$_POST['SummaryType'].">"; echo "<br><div class=centre><input type='submit' name='submitcsv' value='" . _('Export as csv file') . "'></div></td>"; - echo "</form>"; + echo '</form>'; } // End of if inputerror != 1 } // End of function submit() //####_SUBMIT_SUBMIT_SUBMIT_SUBMIT_SUBMIT_SUBMIT_SUBMIT_SUBMIT_SUBMIT_SUBMIT_SUBMIT_SUBMIT#### -function submitcsv(&$db,$PartNumber,$PartNumberOp,$SupplierId,$SupplierIdOp,$SupplierName,$SupplierNameOp,$savesummarytype) -{ +function submitcsv(&$db, + $PartNumber, + $PartNumberOp, + $SupplierId, + $SupplierIdOp, + $SupplierName, + $SupplierNameOp, + $SaveSummaryType) { //initialize no input errors $InputError = 0; @@ -784,71 +790,71 @@ } # Add more to WHERE statement, if user entered something for the part number,supplierid, name - $wherepart = ' '; + $WherePart = ' '; if (strlen($PartNumber) > 0 && $PartNumberOp == 'LIKE') { $PartNumber = $PartNumber . '%'; } else { $PartNumberOp = '='; } if (strlen($PartNumber) > 0) { - $wherepart = " AND purchorderdetails.itemcode " . $PartNumberOp . " '" . $PartNumber . "' "; + $WherePart = " AND purchorderdetails.itemcode " . $PartNumberOp . " '" . $PartNumber . "' "; } else { - $wherepart=' '; + $WherePart=' '; } - $wheresupplierid = ' '; + $WhereSupplierID = ' '; if ($SupplierIdOp == 'LIKE') { $SupplierId = $SupplierId . '%'; } else { $SupplierIdOp = '='; } if (strlen($SupplierId) > 0) { - $wheresupplierid = " AND purchorders.supplierno " . $SupplierIdOp . " '" . $SupplierId . "' "; + $WhereSupplierID = " AND purchorders.supplierno " . $SupplierIdOp . " '" . $SupplierId . "' "; } else { - $wheresupplierid=' '; + $WhereSupplierID=' '; } - $wheresuppliername = ' '; + $WhereSupplierName = ' '; if (strlen($SupplierName) > 0 && $SupplierNameOp == 'LIKE') { $SupplierName = $SupplierName . '%'; } else { $SupplierNameOp = '='; } if (strlen($SupplierName) > 0) { - $wheresuppliername = " AND suppliers.suppname " . $SupplierNameOp . " '" . $SupplierName . "' "; + $WhereSupplierName = " AND suppliers.suppname " . $SupplierNameOp . " '" . $SupplierName . "' "; } else { - $wheresuppliername=' '; + $WhereSupplierName=' '; } if (strlen($_POST['OrderNo']) > 0) { - $whereorderno = ' AND purchorderdetails.orderno = ' . " '" . $_POST['OrderNo'] . "' "; + $WhereOrderNo = ' AND purchorderdetails.orderno = ' . " '" . $_POST['OrderNo'] . "' "; } else { - $whereorderno=' '; + $WhereOrderNo=' '; } - $wherelinestatus = ' '; + $WhereLineStatus = ' '; # Had to use IF statement instead of comparing 'linestatus' to $_POST['LineStatus'] #in WHERE clause because the WHERE clause didn't recognize # that had used the IF statement to create a field called linestatus if ($_POST['LineStatus'] != 'All') { if ($_POST['DateType'] == 'Order') { - $wherelinestatus = " AND IF(purchorderdetails.quantityord = purchorderdetails.qtyinvoiced || + $WhereLineStatus = " AND IF(purchorderdetails.quantityord = purchorderdetails.qtyinvoiced || purchorderdetails.completed = 1,'Completed','Open') = '" . $_POST['LineStatus'] . "'"; } else { - $wherelinestatus = " AND IF(grns.qtyrecd - grns.quantityinv <> 0,'Open','Completed') = '" + $WhereLineStatus = " AND IF(grns.qtyrecd - grns.quantityinv <> 0,'Open','Completed') = '" . $_POST['LineStatus'] . "'"; } } - $wherecategory = ' '; + $WhereCategory = ' '; if ($_POST['Category'] != 'All') { - $wherecategory = " AND stockmaster.categoryid = '" . $_POST['Category'] . "'"; + $WhereCategory = " AND stockmaster.categoryid = '" . $_POST['Category'] . "'"; } if ($InputError !=1) { - $fromdate = FormatDateForSQL($_POST['FromDate']); - $todate = FormatDateForSQL($_POST['ToDate']); + $FromDate = FormatDateForSQL($_POST['FromDate']); + $ToDate = FormatDateForSQL($_POST['ToDate']); if ($_POST['ReportType'] == 'Detail') { if ($_POST['DateType'] == 'Order') { $sql = "SELECT purchorderdetails.orderno, @@ -869,14 +875,14 @@ LEFT JOIN purchorders ON purchorders.orderno=purchorderdetails.orderno LEFT JOIN suppliers ON purchorders.supplierno = suppliers.supplierid LEFT JOIN stockmaster ON purchorderdetails.itemcode = stockmaster.stockid - WHERE purchorders.orddate >='$fromdate' - AND purchorders.orddate <='$todate' - $wherepart - $wheresupplierid - $wheresuppliername - $whereorderno - $wherelinestatus - $wherecategory + WHERE purchorders.orddate >='$FromDate' + AND purchorders.orddate <='$ToDate' + $WherePart + $WhereSupplierID + $WhereSupplierName + $WhereOrderNo + $WhereLineStatus + $WhereCategory ORDER BY " . $_POST['SortBy']; } else { // Selects by delivery date from grns @@ -898,14 +904,14 @@ LEFT JOIN purchorders ON purchorders.orderno=purchorderdetails.orderno LEFT JOIN suppliers ON purchorders.supplierno = suppliers.supplierid LEFT JOIN stockmaster ON purchorderdetails.itemcode = stockmaster.stockid - WHERE grns.deliverydate >='$fromdate' - AND grns.deliverydate <='$todate' - $wherepart - $wheresupplierid - $wheresuppliername - $whereorderno - $wherelinestatus - $wherecategory + WHERE grns.deliverydate >='$FromDate' + AND grns.deliverydate <='$ToDate' + $WherePart + $WhereSupplierID + $WhereSupplierName + $WhereOrderNo + $WhereLineStatus + $WhereCategory ORDER BY " . $_POST['SortBy']; } } else { @@ -932,14 +938,14 @@ LEFT JOIN suppliers ON purchorders.supplierno = suppliers.supplierid LEFT JOIN stockmaster ON purchorderdetails.itemcode = stockmaster.stockid LEFT JOIN stockcategory ON stockcategory.categoryid = stockmaster.categoryid - WHERE purchorders.orddate >='$fromdate' - AND purchorders.orddate <='$todate' - $wherepart - $wheresupplierid - $wheresuppliername - $whereorderno - $wherelinestatus - $wherecategory + WHERE purchorders.orddate >='$FromDate' + AND purchorders.orddate <='$ToDate' + $WherePart + $WhereSupplierID + $WhereSupplierName + $WhereOrderNo + $WhereLineStatus + $WhereCategory GROUP BY " . $_POST['SummaryType'] . ',stockmaster.decimalplaces, stockmaster.description @@ -957,14 +963,14 @@ LEFT JOIN suppliers ON purchorders.supplierno = suppliers.supplierid LEFT JOIN stockmaster ON purchorderdetails.itemcode = stockmaster.stockid LEFT JOIN stockcategory ON stockcategory.categoryid = stockmaster.categoryid - WHERE purchorders.orddate >='$fromdate' - AND purchorders.orddate <='$todate' - $wherepart - $wheresupplierid - $wheresuppliername - $whereorderno - $wherelinestatus - $wherecategory + WHERE purchorders.orddate >='$FromDate' + AND purchorders.orddate <='$ToDate' + $WherePart + $WhereSupplierID + $WhereSupplierName + $WhereOrderNo + $WhereLineStatus + $WhereCategory GROUP BY " . $_POST['SummaryType'] . ',purchorders.supplierno, suppliers.suppname @@ -981,14 +987,14 @@ LEFT JOIN suppliers ON purchorders.supplierno = suppliers.supplierid LEFT JOIN stockmaster ON purchorderdetails.itemcode = stockmaster.stockid LEFT JOIN stockcategory ON stockcategory.categoryid = stockmaster.categoryid - WHERE purchorders.orddate >='$fromdate' - AND purchorders.orddate <='$todate' - $wherepart - $wheresupplierid - $wheresuppliername - $whereorderno - $wherelinestatus - $wherecategory + WHERE purchorders.orddate >='$FromDate' + AND purchorders.orddate <='$ToDate' + $WherePart + $WhereSupplierID + $WhereSupplierName + $WhereOrderNo + $WhereLineStatus + $WhereCategory GROUP BY " . $_POST['SummaryType'] . ',purchorders.supplierno, suppliers.suppname @@ -1005,14 +1011,14 @@ LEFT JOIN suppliers ON purchorders.supplierno = suppliers.supplierid LEFT JOIN stockmaster ON purchorderdetails.itemcode = stockmaster.stockid LEFT JOIN stockcategory ON stockcategory.categoryid = stockmaster.categoryid - WHERE purchorders.orddate >='$fromdate' - AND purchorders.orddate <='$todate' - $wherepart - $wheresupplierid - $wheresuppliername - $whereorderno - $wherelinestatus - $wherecategory + WHERE purchorders.orddate >='$FromDate' + AND purchorders.orddate <='$ToDate' + $WherePart + $WhereSupplierID + $WhereSupplierName + $WhereOrderNo + $WhereLineStatus + $WhereCategory GROUP BY " . $_POST['SummaryType'] . ', monthname ORDER BY ' . $orderby; @@ -1028,14 +1034,14 @@ LEFT JOIN suppliers ON purchorders.supplierno = suppliers.supplierid LEFT JOIN stockmaster ON purchorderdetails.itemcode = stockmaster.stockid LEFT JOIN stockcategory ON stockcategory.categoryid = stockmaster.categoryid - WHERE purchorders.orddate >='$fromdate' - AND purchorders.orddate <='$todate' - $wherepart - $wheresupplierid - $wheresuppliername - $whereorderno - $wherelinestatus - $wherecategory + WHERE purchorders.orddate >='$FromDate' + AND purchorders.orddate <='$ToDate' + $WherePart + $WhereSupplierID + $WhereSupplierName + $WhereOrderNo + $WhereLineStatus + $WhereCategory GROUP BY " . $_POST['SummaryType'] . ', categorydescription ORDER BY ' . $orderby; @@ -1055,14 +1061,14 @@ LEFT JOIN suppliers ON purchorders.supplierno = suppliers.supplierid LEFT JOIN stockmaster ON purchorderdetails.itemcode = stockmaster.stockid LEFT JOIN stockcategory ON stockcategory.categoryid = stockmaster.categoryid - WHERE grns.deliverydate >='$fromdate' - AND grns.deliverydate <='$todate' - $wherepart - $wheresupplierid - $wheresuppliername - $whereorderno - $wherelinestatus - $wherecategory + WHERE grns.deliverydate >='$FromDate' + AND grns.deliverydate <='$ToDate' + $WherePart + $WhereSupplierID + $WhereSupplierName + $WhereOrderNo + $WhereLineStatus + $WhereCategory GROUP BY " . $_POST['SummaryType'] . ', stockmaster.description ORDER BY ' . $orderby; @@ -1080,14 +1086,14 @@ LEFT JOIN suppliers ON purchorders.supplierno = suppliers.supplierid LEFT JOIN stockmaster ON purchorderdetails.itemcode = stockmaster.stockid LEFT JOIN stockcategory ON stockcategory.categoryid = stockmaster.categoryid - WHERE grns.deliverydate >='$fromdate' - AND grns.deliverydate <='$todate' - $wherepart - $wheresupplierid - $wheresuppliername - $whereorderno - $wherelinestatus - $wherecategory + WHERE grns.deliverydate >='$FromDate' + AND grns.deliverydate <='$ToDate' + $WherePart + $WhereSupplierID + $WhereSupplierName + $WhereOrderNo + $WhereLineStatus + $WhereCategory GROUP BY " . $_POST['SummaryType'] . ', purchorders.supplierno, suppliers.suppname @@ -1105,14 +1111,14 @@ LEFT JOIN suppliers ON purchorders.supplierno = suppliers.supplierid LEFT JOIN stockmaster ON purchorderdetails.itemcode = stockmaster.stockid LEFT JOIN stockcategory ON stockcategory.categoryid = stockmaster.categoryid - WHERE grns.deliverydate >='$fromdate' - AND grns.deliverydate <='$todate' - $wherepart - $wheresupplierid - $wheresuppliername - $whereorderno - $wherelinestatus - $wherecategory + WHERE grns.deliverydate >='$FromDate' + AND grns.deliverydate <='$ToDate' + $WherePart + $WhereSupplierID + $WhereSupplierName + $WhereOrderNo + $WhereLineStatus + $WhereCategory GROUP BY " . $_POST['SummaryType'] . ', purchorders.supplierno, suppliers.suppname @@ -1130,14 +1136,14 @@ LEFT JOIN suppliers ON purchorders.supplierno = suppliers.supplierid LEFT JOIN stockmaster ON purchorderdetails.itemcode = stockmaster.stockid LEFT JOIN stockcategory ON stockcategory.categoryid = stockmaster.categoryid - WHERE grns.deliverydate >='$fromdate' - AND grns.deliverydate <='$todate' - $wherepart - $wheresupplierid - $wheresuppliername - $whereorderno - $wherelinestatus - $wherecategory + WHERE grns.deliverydate >='$FromDate' + AND grns.deliverydate <='$ToDate' + $WherePart + $WhereSupplierID + $WhereSupplierName + $WhereOrderNo + $WhereLineStatus + $WhereCategory GROUP BY " . $_POST['SummaryType'] . ',monthname ORDER BY ' . $orderby; @@ -1154,14 +1160,14 @@ LEFT JOIN suppliers ON purchorders.supplierno = suppliers.supplierid LEFT JOIN stockmaster ON purchorderdetails.itemcode = stockmaster.stockid LEFT JOIN stockcategory ON stockcategory.categoryid = stockmaster.categoryid - WHERE grns.deliverydate >='$fromdate' - AND grns.deliverydate <='$todate' - $wherepart - $wheresupplierid - $wheresuppliername - $whereorderno - $wherelinestatus - $wherecategory + WHERE grns.deliverydate >='$FromDate' + AND grns.deliverydate <='$ToDate' + $WherePart + $WhereSupplierID + $WhereSupplierName + $WhereOrderNo + $WhereLineStatus + $WhereCategory GROUP BY " . $_POST['SummaryType'] . ',categorydescription ORDER BY ' . $orderby; @@ -1172,34 +1178,34 @@ $ErrMsg = _('The SQL to find the parts selected failed with the message'); $result = DB_query($sql,$db,$ErrMsg); $ctr = 0; - $totalqty = 0; - $totalextcost = 0; - $totalextprice = 0; - $totalinvqty = 0; + $TotalQty = 0; + $TotalExtCost = 0; + $TotalExtPrice = 0; + $TotalInvQty = 0; $FileName = $_SESSION['reports_dir'] .'/POReport.csv'; $FileHandle = fopen($FileName, 'w'); - // Create array for summary type to display in header. Access it with $savesummarytype - $summary_array["orderno"] = _('Order Number'); - $summary_array["itemcode"] = _('Part Number'); - $summary_array["extprice"] = _('Extended Price'); - $summary_array["supplierno"] = _('Customer Number'); - $summary_array["suppname"] = _('Customer Name'); - $summary_array["month"] = _('Month'); - $summary_array["categoryid"] = _('Stock Category'); + // Create array for summary type to display in header. Access it with $SaveSummaryType + $Summary_Array['orderno'] = _('Order Number'); + $Summary_Array['itemcode'] = _('Part Number'); + $Summary_Array['extprice'] = _('Extended Price'); + $Summary_Array['supplierno'] = _('Customer Number'); + $Summary_Array['suppname'] = _('Customer Name'); + $Summary_Array['month'] = _('Month'); + $Summary_Array['categoryid'] = _('Stock Category'); // Create array for sort for detail report to display in header - $detail_array['purchorderdetails.orderno'] = _('Order Number'); - $detail_array['purchorderdetails.itemcode'] = _('Part Number'); - $detail_array['suppliers.supplierid,purchorderdetails.orderno'] = _('Supplier Number'); - $detail_array['suppliers.suppname,suppliers.supplierid,purchorderdetails.orderno'] = _('Supplier Name'); + $Detail_Array['purchorderdetails.orderno'] = _('Order Number'); + $Detail_Array['purchorderdetails.itemcode'] = _('Part Number'); + $Detail_Array['suppliers.supplierid,purchorderdetails.orderno'] = _('Supplier Number'); + $Detail_Array['suppliers.suppname,suppliers.supplierid,purchorderdetails.orderno'] = _('Supplier Name'); // Display Header info if ($_POST['ReportType'] == 'Summary') { - $sortby_display = $summary_array[$savesummarytype]; + $SortBy_Display = $Summary_Array[$SaveSummaryType]; } else { - $sortby_display = $detail_array[$_POST['SortBy']]; + $SortBy_Display = $Detail_Array[$_POST['SortBy']]; } - fprintf($FileHandle, '"'. _('Purchase Order Report') . '","' . $_POST['ReportType'] . ' '._('By').' '.$sortby_display ."\n"); + fprintf($FileHandle, '"'. _('Purchase Order Report') . '","' . $_POST['ReportType'] . ' '._('By').' '.$SortBy_Display ."\n"); fprintf($FileHandle, '"'. _('Date Type') . '","' . $_POST['DateType'] . '"'. "\n"); fprintf($FileHandle, '"'. _('Date Range') . '","' . $_POST['FromDate'] . _(' To ') . $_POST['ToDate'] . '"'."\n"); if (strlen(trim($PartNumber)) > 0) { @@ -1246,11 +1252,11 @@ $myrow['linestatus'], ConvertSQLDate($myrow['deliverydate']), $myrow['description']); - $lastdecimalplaces = $myrow['decimalplaces']; - $totalqty += $myrow['quantityord']; - $totalextcost += $myrow['extcost']; - $totalextprice += $myrow['extprice']; - $totalinvqty += $myrow['qtyinvoiced']; + $LastDecimalPlaces = $myrow['decimalplaces']; + $TotalQty += $myrow['quantityord']; + $TotalExtCost += $myrow['extcost']; + $TotalExtPrice += $myrow['extprice']; + $TotalInvQty += $myrow['qtyinvoiced']; } //END WHILE LIST LOOP // Print totals fprintf($FileHandle, '"%s","%s","%s","%s","%s",%s,%s,%s,%s,"%s","%s"'."\n", @@ -1259,10 +1265,10 @@ ' ', ' ', ' ', - number_format($totalqty,2), - number_format($totalextcost,2), - number_format($totalextprice,2), - number_format($totalinvqty,2), + number_format($TotalQty,2), + number_format($TotalExtCost,2), + number_format($TotalExtPrice,2), + number_format($TotalInvQty,2), ' ', ' '); } else { @@ -1298,11 +1304,11 @@ $myrow['linestatus'], ConvertSQLDate($myrow['deliverydate']), $myrow['description']); - $lastdecimalplaces = $myrow['decimalplaces']; - $totalqty += $myrow['quantityord']; - $totalextcost += $myrow['extcost']; - $totalextprice += $myrow['extprice']; - $totalinvqty += $myrow['qtyinvoiced']; + $LastDecimalPlaces = $myrow['decimalplaces']; + $TotalQty += $myrow['quantityord']; + $TotalExtCost += $myrow['extcost']; + $TotalExtPrice += $myrow['extprice']; + $TotalInvQty += $myrow['qtyinvoiced']; } //END WHILE LIST LOOP // Print totals fprintf($FileHandle, '"%s","%s","%s","%s","%s",%s,%s,%s,%s,"%s","%s"'."\n", @@ -1311,10 +1317,10 @@ ' ', ' ', ' ', - number_format($totalqty,$lastdecimalplaces), - number_format($totalextcost,2), - number_format($totalextprice,2), - number_format($totalinvqty,$lastdecimalplaces), + number_format($TotalQty,$LastDecimalPlaces), + number_format($TotalExtCost,2), + number_format($TotalExtPrice,2), + number_format($TotalInvQty,$LastDecimalPlaces), " ", " "); } @@ -1383,20 +1389,20 @@ number_format($myrow['qtyinvoiced'],$myrow['decimalplaces']), $suppname); print '<br/>'; - $lastdecimalplaces = $myrow['decimalplaces']; - $totalqty += $myrow['quantityord']; - $totalextcost += $myrow['extcost']; - $totalextprice += $myrow['extprice']; - $totalinvqty += $myrow['qtyinvoiced']; + $LastDecimalPlaces = $myrow['decimalplaces']; + $TotalQty += $myrow['quantityord']; + $TotalExtCost += $myrow['extcost']; + $TotalExtPrice += $myrow['extprice']; + $TotalInvQty += $myrow['qtyinvoiced']; } //END WHILE LIST LOOP // Print totals fprintf($FileHandle, '"%s","%s",%s,%s,%s,%s,"%s"'."\n", 'Totals', _('Lines - ') . $linectr, - number_format($totalqty,$lastdecimalplaces), - number_format($totalextcost,2), - number_format($totalextprice,2), - number_format($totalinvqty,$lastdecimalplaces), + number_format($TotalQty,$LastDecimalPlaces), + number_format($TotalExtCost,2), + number_format($TotalExtPrice,2), + number_format($TotalInvQty,$LastDecimalPlaces), ' '); } // End of if ($_POST['ReportType'] fclose($FileHandle); @@ -1412,7 +1418,7 @@ // Display form fields. This function is called the first time // the page is called. - echo "<form action=" . $_SERVER['PHP_SELF'] . "?" . SID ." method=post>"; + echo '<form action="' . $_SERVER['PHP_SELF'] . '" method=post>'; echo '<input type="hidden" name="FormID" value="' . $_SESSION['FormID'] . '" />'; echo '<table class=selection>'; @@ -1461,15 +1467,15 @@ } echo '<tr><td>' . _('Supplier Name') . ':</td>'; - echo "<td><select name='SupplierNameOp'>"; - echo "<option selected value='LIKE'>" . _('Begins With'); - echo "<option value='Equals'>" . _('Equals'); + echo '<td><select name="SupplierNameOp">'; + echo '<option selected value="LIKE">' . _('Begins With') . '</option>'; + echo '<option value="Equals">' . _('Equals') . '</option>'; echo '</select>'; - echo "  <input type='Text' name='SupplierName' size=30 maxlength=30 value="; + echo '  <input type="text" name="SupplierName" size=30 maxlength=30 value="'; if (isset($_POST['SupplierName'])) { - echo $_POST['SupplierName'] . "></td></tr>"; + echo $_POST['SupplierName'] . '" /></td></tr>'; } else { - echo "></td></tr>"; + echo '" /></td></tr>'; } echo '<tr><td>' . _('Order Number') . ':</td>'; @@ -1482,56 +1488,55 @@ } echo '<tr><td>' . _('Line Item Status') . ':</td>'; - echo "<td><select name='LineStatus'>"; - echo "<option selected value='All'>" . _('All'); - echo "<option value='Completed'>" . _('Completed'); - echo "<option value='Open'>" . _('Not Completed'); + echo '<td><select name="LineStatus">'; + echo '<option selected value="All">' . _('All') . '</option>'; + echo '<option value="Completed">' . _('Completed') . '</option>'; + echo '<option value="Open">' . _('Not Completed') . '</option>'; echo '</select></td><td> </td></tr>'; - echo '<tr><td>' . _('Stock Categories') . ":</td><td><select name='Category'>"; - $sql='SELECT categoryid, categorydescription FROM stockcategory'; + echo '<tr><td>' . _('Stock Categories') . ':</td><td><select name="Category">'; + $sql="SELECT categoryid, categorydescription FROM stockcategory"; $CategoryResult= DB_query($sql,$db); - echo '<option selected value="All">' . _('All Categories'); + echo '<option selected value="All">' . _('All Categories') . '</option>'; While ($myrow = DB_fetch_array($CategoryResult)){ - echo '<option value="' . $myrow['categoryid'] . '">' . $myrow['categorydescription']; + echo '<option value="' . $myrow['categoryid'] . '">' . $myrow['categorydescription'] . '</option>'; } echo '</select></td></tr>'; echo '<tr><td> </td></tr>'; echo '<tr><td>' . _('Sort By') . ':</td>'; - echo "<td><select name='SortBy'>"; - echo "<option selected value='purchorderdetails.orderno'>" . _('Order Number'); - echo "<option value='purchorderdetails.itemcode'>" . _('Part Number'); - echo "<option value='suppliers.supplierid,purchorderdetails.orderno'>" . _('Supplier Number'); - echo "<option value='suppliers.suppname,suppliers.supplierid,purchorderdetails.orderno'>" . _('Supplier Name'); + echo '<td><select name="SortBy">'; + echo '<option selected value="purchorderdetails.orderno">' . _('Order Number') . '</option>'; + echo '<option value="purchorderdetails.itemcode">' . _('Part Number') . '</option>'; + echo '<option value="suppliers.supplierid,purchorderdetails.orderno">' . _('Supplier Number') . '</option>'; + echo '<option value="suppliers.suppname,suppliers.supplierid,purchorderdetails.orderno">' . _('Supplier Name') . '</option>'; echo '</select></td><td> </td></tr>'; echo '<tr><td> </td></tr>'; echo '<tr><td>' . _('Summary Type') . ':</td>'; - echo "<td><select name='SummaryType'>"; - echo "<option selected value='orderno'>" . _('Order Number'); - echo "<option value='itemcode'>" . _('Part Number'); - echo "<option value='extprice'>" . _('Extended Price'); - echo "<option value='supplierno'>" . _('Supplier Number'); - echo "<option value='suppname'>" . _('Supplier Name'); - echo "<option value='month'>" . _('Month'); - echo "<option value='categoryid'>" . _('Stock Category'); + echo '<td><select name="SummaryType">'; + echo '<option selected value="orderno">' . _('Order Number') . '</option>'; + echo '<option value="itemcode">' . _('Part Number') . '</option>'; + echo '<option value="extprice">' . _('Extended Price') . '</option>'; + echo '<option value="supplierno">' . _('Supplier Number') . '</option>'; + echo '<option value="suppname">' . _('Supplier Name') . '</option>'; + echo '<option value="month">' . _('Month') . '</option>'; + echo '<option value="categoryid">' . _('Stock Category') . '</option>'; echo '</select></td><td> </td></tr>'; - echo " - <tr><td> </td></tr> - <tr> - <td colspan=4><div class=centre><input type='submit' name='submit' value='" . _('Run Inquiry') . "'></div></td> + echo '<tr><td> </td></tr> + <tr> + <td colspan=4><div class=centre><input type="submit" name="submit" value="' . _('Run Inquiry') . '"></div></td> </tr> <tr> - <td colspan=4><div class=centre><input type='submit' name='submitcsv' value='" . _('Export as csv file') . "'></div></td> + <td colspan=4><div class=centre><input type="submit" name="submitcsv" value="' . _('Export as csv file') . '"></div></td> </tr> </table> - <br/>"; + <br/>'; echo '</form>'; } // End of function display() include('includes/footer.inc'); -?> +?> \ No newline at end of file Modified: trunk/Stocks.php =================================================================== --- trunk/Stocks.php 2011-04-11 10:49:45 UTC (rev 4547) +++ trunk/Stocks.php 2011-04-12 10:33:45 UTC (rev 4548) @... [truncated message content] |
From: <dai...@us...> - 2011-04-12 10:33:53
|
Revision: 4548 http://web-erp.svn.sourceforge.net/web-erp/?rev=4548&view=rev Author: daintree Date: 2011-04-12 10:33:45 +0000 (Tue, 12 Apr 2011) Log Message: ----------- tim launchpad fork Modified Paths: -------------- trunk/DeliveryDetails.php trunk/POReport.php trunk/Stocks.php trunk/TaxProvinces.php trunk/UnitsOfMeasure.php trunk/UpgradeDatabase.php trunk/WOSerialNos.php trunk/WorkOrderIssue.php trunk/Z_Upgrade3.10.php trunk/Z_Upgrade_3.09-3.10.php Modified: trunk/DeliveryDetails.php =================================================================== --- trunk/DeliveryDetails.php 2011-04-11 10:49:45 UTC (rev 4547) +++ trunk/DeliveryDetails.php 2011-04-12 10:33:45 UTC (rev 4548) @@ -1,7 +1,6 @@ <?php /* $Id$ */ -/* $Revision: 1.76 $ */ /* This is where the delivery details are confirmed/entered/modified and the order committed to the database once the place order/modify order button is hit. @@ -81,13 +80,13 @@ /* If (strlen($_POST['BrAdd3'])==0 OR !isset($_POST['BrAdd3'])){ $InputErrors =1; - echo "<br>A region or city must be entered.<br>"; + echo "<br />A region or city must be entered.<br />"; } Maybe appropriate in some installations but not here If (strlen($_POST['BrAdd2'])<=1){ $InputErrors =1; - echo "<br>You should enter the suburb in the box provided. Orders cannot be accepted without a valid suburb being entered.<br>"; + echo "<br />You should enter the suburb in the box provided. Orders cannot be accepted without a valid suburb being entered.<br />"; } */ @@ -111,7 +110,7 @@ elseif (Date1GreaterThanDate2(Date($_SESSION['DefaultDateFormat'],$EarliestDispatch), $_POST['DeliveryDate'])){ $InputErrors =1; - echo '<br><b>' . _('The delivery details cannot be updated because you are attempting to set the date the order is to be dispatched earlier than is possible. No dispatches are made on Saturday and Sunday. Also, the dispatch cut off time is') . $_SESSION['DispatchCutOffTime'] . _(':00 hrs. Orders placed after this time will be dispatched the following working day.'); + echo '<br /><b>' . _('The delivery details cannot be updated because you are attempting to set the date the order is to be dispatched earlier than is possible. No dispatches are made on Saturday and Sunday. Also, the dispatch cut off time is') . $_SESSION['DispatchCutOffTime'] . _(':00 hrs. Orders placed after this time will be dispatched the following working day.'); } */ @@ -153,7 +152,7 @@ prnMsg(_('The branch details for branch code') . ': ' . $_SESSION['Items'.$identifier]->Branch . ' ' . _('against customer code') . ': ' . $_POST['Select'] . ' ' . _('could not be retrieved') . '. ' . _('Check the set up of the customer and branch'),'error'); if ($debug==1){ - echo '<br>' . _('The SQL that failed to get the branch details was') . ':<br>' . $sql; + echo '<br />' . _('The SQL that failed to get the branch details was') . ':<br />' . $sql; } include('includes/footer.inc'); exit; @@ -280,7 +279,7 @@ } If ($_POST['FreightCost'] != $OldFreightCost && $_SESSION['DoFreightCalc']==True){ $OK_to_PROCESS = 0; - prnMsg(_('The freight charge has been updated') . '. ' . _('Please reconfirm that the order and the freight charges are acceptable and then confirm the order again if OK') .' <br> '. _('The new freight cost is') .' ' . $_POST['FreightCost'] . ' ' . _('and the previously calculated freight cost was') .' '. $OldFreightCost,'warn'); + prnMsg(_('The freight charge has been updated') . '. ' . _('Please reconfirm that the order and the freight charges are acceptable and then confirm the order again if OK') .' <br /> '. _('The new freight cost is') .' ' . $_POST['FreightCost'] . ' ' . _('and the previously calculated freight cost was') .' '. $OldFreightCost,'warn'); } else { /*check the customer's payment terms */ @@ -417,7 +416,7 @@ AND $_SESSION['AutoCreateWOs']==1 AND $_SESSION['Items'.$identifier]->Quotation!=1){ //oh yeah its all on! - echo '<br>'; + echo '<br />'; //now get the data required to test to see if we need to make a new WO $QOHResult = DB_query("SELECT SUM(quantity) FROM locstock WHERE stockid='" . $StockItem->StockID . "'",$db); @@ -559,7 +558,7 @@ } /* end inserted line items into sales order details */ $result = DB_Txn_Commit($db); - echo '<br>'; + echo '<br />'; if ($_SESSION['Items'.$identifier]->Quotation==1){ prnMsg(_('Quotation Number') . ' ' . $OrderNo . ' ' . _('has been entered'),'success'); } else { @@ -571,19 +570,44 @@ if ($_POST['Quotation']==0) { /*then its not a quotation its a real order */ - echo '<br><table class=selection><tr><td><img src="'.$rootpath.'/css/'.$theme.'/images/printer.png" title="' . _('Print') . '" alt=""></td><td>' . ' ' . '<a target="_blank" href="' . $rootpath . '/PrintCustOrder.php?identifier='.$identifier . '&TransNo=' . $OrderNo . '">'. _('Print packing slip') . ' (' . _('Preprinted stationery') . ')' .'</a></td></tr>'; - echo '<tr><td><img src="'.$rootpath.'/css/'.$theme.'/images/printer.png" title="' . _('Print') . '" alt=""></td><td>' . ' ' . '<a target="_blank" href="' . $rootpath . '/PrintCustOrder_generic.php?identifier='.$identifier . '&TransNo=' . $OrderNo . '">'. _('Print packing slip') . ' (' . _('Laser') . ')' .'</a></td></tr>'; + echo '<br /><table class=selection> + <tr> + <td><img src="'.$rootpath.'/css/'.$theme.'/images/printer.png" title="' . _('Print') . '" alt=""></td> + <td>' . ' ' . '<a target="_blank" href="' . $rootpath . '/PrintCustOrder.php?identifier='.$identifier . '&TransNo=' . $OrderNo . '">'. _('Print packing slip') . ' (' . _('Preprinted stationery') . ')' .'</a></td> + </tr>'; + echo '<tr> + <td><img src="'.$rootpath.'/css/'.$theme.'/images/printer.png" title="' . _('Print') . '" alt=""></td> + <td>' . ' ' . '<a target="_blank" href="' . $rootpath . '/PrintCustOrder_generic.php?identifier='.$identifier . '&TransNo=' . $OrderNo . '">'. _('Print packing slip') . ' (' . _('Laser') . ')' .'</a></td> + </tr>'; - echo '<tr><td><img src="'.$rootpath.'/css/'.$theme.'/images/reports.png" title="' . _('Invoice') . '" alt=""></td><td>' . ' ' . '<a href="' . $rootpath . '/ConfirmDispatch_Invoice.php?identifier='.$identifier . '&OrderNumber=' . $OrderNo .'">'. _('Confirm Dispatch and Produce Invoice') .'</a></td></tr>'; - //Add option to Print Sales Orders or Proforma invoice - echo '<tr><td><img src="'.$rootpath.'/css/'.$theme.'/images/pdf.png" title="' . _('Sales Order') . '" alt=""></td><td>' . ' ' . '<a href="' . $rootpath . '/PrintSalesOrder_generic.php?identifier='.$identifier . '&TransNo=' . $OrderNo .'">'. _('Print Sales Order / Pro-forma Invoice') .'</a></td></tr></table>'; + echo '<tr> + <td><img src="'.$rootpath.'/css/'.$theme.'/images/reports.png" title="' . _('Invoice') . '" alt=""></td> + <td>' . ' ' . '<a href="' . $rootpath . '/ConfirmDispatch_Invoice.php?identifier='.$identifier . '&OrderNumber=' . $OrderNo .'">'. _('Confirm Dispatch and Produce Invoice') .'</a></td> + </tr>'; + + echo '</table>'; } else { /*link to print the quotation */ - echo '<br><table class=selection><tr><td><img src="'.$rootpath.'/css/'.$theme.'/images/reports.png" title="' . _('Order') . '" alt=""></td><td>' . ' ' . '<a href="' . $rootpath . '/PDFQuotation.php?' . SID .'identifier='.$identifier . '&QuotationNo=' . $OrderNo . '">'. _('Print Quotation (Landscape)') .'</a></td></tr></table>'; - echo '<br><table class=selection><tr><td><img src="'.$rootpath.'/css/'.$theme.'/images/reports.png" title="' . _('Order') . '" alt=""></td><td>' . ' ' . '<a href="' . $rootpath . '/PDFQuotationPortrait.php?' . SID .'identifier='.$identifier . '&QuotationNo=' . $OrderNo . '">'. _('Print Quotation (Portrait)') .'</a></td></tr></table>'; + echo '<br /><table class=selection> + <tr> + <td><img src="'.$rootpath.'/css/'.$theme.'/images/reports.png" title="' . _('Order') . '" alt=""></td> + <td>' . ' ' . '<a href="' . $rootpath . '/PDFQuotation.php?' . SID .'identifier='.$identifier . '&QuotationNo=' . $OrderNo . '">'. _('Print Quotation (Landscape)') .'</a></td> + </tr> + </table>'; + echo '<br /><table class=selection> + <tr> + <td><img src="'.$rootpath.'/css/'.$theme.'/images/reports.png" title="' . _('Order') . '" alt=""></td> + <td>' . ' ' . '<a href="' . $rootpath . '/PDFQuotationPortrait.php?' . SID .'identifier='.$identifier . '&QuotationNo=' . $OrderNo . '">'. _('Print Quotation (Portrait)') .'</a></td> + </tr> + </table>'; } - echo '<br><table class=selection><tr><td><img src="'.$rootpath.'/css/'.$theme.'/images/sales.png" title="' . _('Order') . '" alt=""></td><td>' . ' ' . '<a href="'. $rootpath .'/SelectOrderItems.php?identifier='.$identifier . '&NewOrder=Yes">'. _('Add Another Sales Order') .'</a></td></tr></table>'; + echo '<br /><table class=selection> + <tr> + <td><img src="'.$rootpath.'/css/'.$theme.'/images/sales.png" title="' . _('Order') . '" alt=""></td> + <td>' . ' ' . '<a href="'. $rootpath .'/SelectOrderItems.php?identifier='.$identifier . '&NewOrder=Yes">'. _('Add Another Sales Order') .'</a></td> + </tr> + </table>'; } else { /*its a customer logon so thank them */ prnMsg(_('Thank you for your business'),'success'); @@ -747,7 +771,7 @@ prnMsg(_('Order Number') .' ' . $_SESSION['ExistingOrder'] . ' ' . _('has been updated'),'success'); - echo '<br><table class=selection><tr><td><img src="'.$rootpath.'/css/'.$theme.'/images/printer.png" title="' . _('Print') . '" alt=""></td><td><a href="' . $rootpath . '/PrintCustOrder.php?identifier='.$identifier . '&TransNo=' . $_SESSION['ExistingOrder'] . '">'. _('Print packing slip - pre-printed stationery') .'</a></td></tr>'; + echo '<br /><table class=selection><tr><td><img src="'.$rootpath.'/css/'.$theme.'/images/printer.png" title="' . _('Print') . '" alt=""></td><td><a href="' . $rootpath . '/PrintCustOrder.php?identifier='.$identifier . '&TransNo=' . $_SESSION['ExistingOrder'] . '">'. _('Print packing slip - pre-printed stationery') .'</a></td></tr>'; echo '<tr><td><img src="'.$rootpath.'/css/'.$theme.'/images/printer.png" title="' . _('Print') . '" alt=""></td><td><a target="_blank" href="' . $rootpath . '/PrintCustOrder_generic.php?identifier='.$identifier . '&TransNo=' . $_SESSION['ExistingOrder'] . '">'. _('Print packing slip') . ' (' . _('Laser') . ')' .'</a></td></tr>'; echo '<tr><td><img src="'.$rootpath.'/css/'.$theme.'/images/reports.png" title="' . _('Invoice') . '" alt=""></td><td><a href="' . $rootpath .'/ConfirmDispatch_Invoice.php?identifier='.$identifier . '&OrderNumber=' . $_SESSION['ExistingOrder'] . '">'. _('Confirm Order Delivery Quantities and Produce Invoice') .'</a></td></tr>'; echo '<tr><td><img src="'.$rootpath.'/css/'.$theme.'/images/sales.png" title="' . _('Order') . '" alt=""></td><td><a href="' . $rootpath .'/SelectSalesOrder.php?identifier='.$identifier . '">'. _('Select A Different Order') .'</a></td></tr></table>'; @@ -833,7 +857,7 @@ $DisplayVolume = number_format($_SESSION['Items'.$identifier]->totalVolume,2); $DisplayWeight = number_format($_SESSION['Items'.$identifier]->totalWeight,2); - echo '<br><table><tr class="EvenTableRows"> + echo '<br /><table><tr class="EvenTableRows"> <td>'. _('Total Weight') .':</td> <td>'.$DisplayWeight.'</td> <td>'. _('Total Volume') .':</td> @@ -903,7 +927,7 @@ } -echo '<br><table class=selection><tr> +echo '<br /><table class=selection><tr> <td>'. _('Deliver To') .':</td> <td><input type=text size=42 maxlength=40 name="DeliverTo" value="' . $_SESSION['Items'.$identifier]->DeliverTo . '"></td> </tr>'; @@ -1082,13 +1106,13 @@ echo '</table>'; -echo '<br><div class="centre"><input type=submit name="BackToLineDetails" value="' . _('Modify Order Lines') . '"><br>'; +echo '<br /><div class="centre"><input type=submit name="BackToLineDetails" value="' . _('Modify Order Lines') . '"><br />'; if ($_SESSION['ExistingOrder']==0){ - echo '<br><br><input type=submit name="ProcessOrder" value="' . _('Place Order') . '">'; - echo '<br><br><input type=submit name="MakeRecurringOrder" VALUE="' . _('Create Recurring Order') . '">'; + echo '<br /><br /><input type=submit name="ProcessOrder" value="' . _('Place Order') . '">'; + echo '<br /><br /><input type=submit name="MakeRecurringOrder" VALUE="' . _('Create Recurring Order') . '">'; } else { - echo '<br><input type=submit name="ProcessOrder" VALUE="' . _('Commit Order Changes') . '">'; + echo '<br /><input type=submit name="ProcessOrder" VALUE="' . _('Commit Order Changes') . '">'; } echo '</div></form>'; Modified: trunk/POReport.php =================================================================== --- trunk/POReport.php 2011-04-11 10:49:45 UTC (rev 4547) +++ trunk/POReport.php 2011-04-12 10:33:45 UTC (rev 4548) @@ -40,9 +40,9 @@ $SupplierNameOp = $_POST['SupplierNameOp']; - // Save $_POST['SummaryType'] in $savesummarytype because change $_POST['SummaryType'] when + // Save $_POST['SummaryType'] in $SaveSummaryType because change $_POST['SummaryType'] when // create $sql - $savesummarytype = $_POST['SummaryType']; + $SaveSummaryType = $_POST['SummaryType']; } if (isset($_POST['SupplierName'])){ @@ -60,11 +60,11 @@ if (isset($_POST['submit'])) { echo '<p class="page_title_text"><img src="'.$rootpath.'/css/'.$theme.'/images/maintenance.png" title="' . _('Search') . '" alt="" />' . ' ' . $title.'</p>'; - submit($db,$PartNumber,$PartNumberOp,$SupplierId,$SupplierIdOp,$SupplierName,$SupplierNameOp,$savesummarytype); + submit($db,$PartNumber,$PartNumberOp,$SupplierId,$SupplierIdOp,$SupplierName,$SupplierNameOp,$SaveSummaryType); } else if (isset($_POST['submitcsv'])) { echo '<p class="page_title_text"><img src="'.$rootpath.'/css/'.$theme.'/images/maintenance.png" title="' . _('Search') . '" alt="" />' . ' ' . $title.'</p>'; - submitcsv($db,$PartNumber,$PartNumberOp,$SupplierId,$SupplierIdOp,$SupplierName,$SupplierNameOp,$savesummarytype); + submitcsv($db,$PartNumber,$PartNumberOp,$SupplierId,$SupplierIdOp,$SupplierName,$SupplierNameOp,$SaveSummaryType); } else { echo '<p class="page_title_text"><img src="'.$rootpath.'/css/'.$theme.'/images/maintenance.png" title="' . _('Search') . '" alt="" />' . '</img>' . $title.'</p>'; @@ -73,7 +73,7 @@ //####_SUBMIT_SUBMIT_SUBMIT_SUBMIT_SUBMIT_SUBMIT_SUBMIT_SUBMIT_SUBMIT_SUBMIT_SUBMIT_SUBMIT#### -function submit(&$db,$PartNumber,$PartNumberOp,$SupplierId,$SupplierIdOp,$SupplierName,$SupplierNameOp,$savesummarytype) +function submit(&$db,$PartNumber,$PartNumberOp,$SupplierId,$SupplierIdOp,$SupplierName,$SupplierNameOp,$SaveSummaryType) { //initialize no input errors @@ -94,71 +94,71 @@ } # Add more to WHERE statement, if user entered something for the part number,supplierid, name - $wherepart = ' '; + $WherePart = ' '; if (strlen($PartNumber) > 0 && $PartNumberOp == 'LIKE') { $PartNumber = $PartNumber . '%'; } else { $PartNumberOp = '='; } if (strlen($PartNumber) > 0) { - $wherepart = " AND purchorderdetails.itemcode " . $PartNumberOp . " '" . $PartNumber . "' "; + $WherePart = " AND purchorderdetails.itemcode " . $PartNumberOp . " '" . $PartNumber . "' "; } else { - $wherepart=' '; + $WherePart=' '; } - $wheresupplierid = ' '; + $WhereSupplierID = ' '; if ($SupplierIdOp == 'LIKE') { $SupplierId = $SupplierId . '%'; } else { $SupplierIdOp = '='; } if (strlen($SupplierId) > 0) { - $wheresupplierid = " AND purchorders.supplierno " . $SupplierIdOp . " '" . $SupplierId . "' "; + $WhereSupplierID = " AND purchorders.supplierno " . $SupplierIdOp . " '" . $SupplierId . "' "; } else { - $wheresupplierid=' '; + $WhereSupplierID=' '; } - $wheresuppliername = ' '; + $WhereSupplierName = ' '; if (strlen($SupplierName) > 0 && $SupplierNameOp == 'LIKE') { $SupplierName = $SupplierName . '%'; } else { $SupplierNameOp = '='; } if (strlen($SupplierName) > 0) { - $wheresuppliername = " AND suppliers.suppname " . $SupplierNameOp . " '" . $SupplierName . "' "; + $WhereSupplierName = " AND suppliers.suppname " . $SupplierNameOp . " '" . $SupplierName . "' "; } else { - $wheresuppliername=' '; + $WhereSupplierName=' '; } if (strlen($_POST['OrderNo']) > 0) { - $whereorderno = ' AND purchorderdetails.orderno = ' . " '" . $_POST['OrderNo'] . "' "; + $WhereOrderNo = ' AND purchorderdetails.orderno = ' . " '" . $_POST['OrderNo'] . "' "; } else { - $whereorderno=' '; + $WhereOrderNo=' '; } - $wherelinestatus = ' '; + $WhereLineStatus = ' '; # Had to use IF statement instead of comparing 'linestatus' to $_POST['LineStatus'] #in WHERE clause because the WHERE clause didn't recognize # that had used the IF statement to create a field called linestatus if ($_POST['LineStatus'] != 'All') { if ($_POST['DateType'] == 'Order') { - $wherelinestatus = " AND IF(purchorderdetails.quantityord = purchorderdetails.qtyinvoiced || + $WhereLineStatus = " AND IF(purchorderdetails.quantityord = purchorderdetails.qtyinvoiced || purchorderdetails.completed = 1,'Completed','Open') = '" . $_POST['LineStatus'] . "'"; } else { - $wherelinestatus = " AND IF(grns.qtyrecd - grns.quantityinv <> 0,'Open','Completed') = '" + $WhereLineStatus = " AND IF(grns.qtyrecd - grns.quantityinv <> 0,'Open','Completed') = '" . $_POST['LineStatus'] . "'"; } } - $wherecategory = ' '; + $WhereCategory = ' '; if ($_POST['Category'] != 'All') { - $wherecategory = " AND stockmaster.categoryid = '" . $_POST['Category'] . "'"; + $WhereCategory = " AND stockmaster.categoryid = '" . $_POST['Category'] . "'"; } if ($InputError !=1) { - $fromdate = FormatDateForSQL($_POST['FromDate']); - $todate = FormatDateForSQL($_POST['ToDate']); + $FromDate = FormatDateForSQL($_POST['FromDate']); + $ToDate = FormatDateForSQL($_POST['ToDate']); if ($_POST['ReportType'] == 'Detail') { if ($_POST['DateType'] == 'Order') { $sql = "SELECT purchorderdetails.orderno, @@ -179,14 +179,14 @@ LEFT JOIN purchorders ON purchorders.orderno=purchorderdetails.orderno LEFT JOIN suppliers ON purchorders.supplierno = suppliers.supplierid LEFT JOIN stockmaster ON purchorderdetails.itemcode = stockmaster.stockid - WHERE purchorders.orddate >='$fromdate' - AND purchorders.orddate <='$todate' - $wherepart - $wheresupplierid - $wheresuppliername - $whereorderno - $wherelinestatus - $wherecategory + WHERE purchorders.orddate >='$FromDate' + AND purchorders.orddate <='$ToDate' + $WherePart + $WhereSupplierID + $WhereSupplierName + $WhereOrderNo + $WhereLineStatus + $WhereCategory ORDER BY " . $_POST['SortBy']; } else { // Selects by delivery date from grns @@ -208,14 +208,14 @@ LEFT JOIN purchorders ON purchorders.orderno=purchorderdetails.orderno LEFT JOIN suppliers ON purchorders.supplierno = suppliers.supplierid LEFT JOIN stockmaster ON purchorderdetails.itemcode = stockmaster.stockid - WHERE grns.deliverydate >='$fromdate' - AND grns.deliverydate <='$todate' - $wherepart - $wheresupplierid - $wheresuppliername - $whereorderno - $wherelinestatus - $wherecategory + WHERE grns.deliverydate >='$FromDate' + AND grns.deliverydate <='$ToDate' + $WherePart + $WhereSupplierID + $WhereSupplierName + $WhereOrderNo + $WhereLineStatus + $WhereCategory ORDER BY " . $_POST['SortBy']; } } else { @@ -242,14 +242,14 @@ LEFT JOIN suppliers ON purchorders.supplierno = suppliers.supplierid LEFT JOIN stockmaster ON purchorderdetails.itemcode = stockmaster.stockid LEFT JOIN stockcategory ON stockcategory.categoryid = stockmaster.categoryid - WHERE purchorders.orddate >='$fromdate' - AND purchorders.orddate <='$todate' - $wherepart - $wheresupplierid - $wheresuppliername - $whereorderno - $wherelinestatus - $wherecategory + WHERE purchorders.orddate >='$FromDate' + AND purchorders.orddate <='$ToDate' + $WherePart + $WhereSupplierID + $WhereSupplierName + $WhereOrderNo + $WhereLineStatus + $WhereCategory GROUP BY " . $_POST['SummaryType'] . ',stockmaster.decimalplaces, stockmaster.description @@ -267,14 +267,14 @@ LEFT JOIN suppliers ON purchorders.supplierno = suppliers.supplierid LEFT JOIN stockmaster ON purchorderdetails.itemcode = stockmaster.stockid LEFT JOIN stockcategory ON stockcategory.categoryid = stockmaster.categoryid - WHERE purchorders.orddate >='$fromdate' - AND purchorders.orddate <='$todate' - $wherepart - $wheresupplierid - $wheresuppliername - $whereorderno - $wherelinestatus - $wherecategory + WHERE purchorders.orddate >='$FromDate' + AND purchorders.orddate <='$ToDate' + $WherePart + $WhereSupplierID + $WhereSupplierName + $WhereOrderNo + $WhereLineStatus + $WhereCategory GROUP BY " . $_POST['SummaryType'] . ',purchorders.supplierno, suppliers.suppname @@ -291,14 +291,14 @@ LEFT JOIN suppliers ON purchorders.supplierno = suppliers.supplierid LEFT JOIN stockmaster ON purchorderdetails.itemcode = stockmaster.stockid LEFT JOIN stockcategory ON stockcategory.categoryid = stockmaster.categoryid - WHERE purchorders.orddate >='$fromdate' - AND purchorders.orddate <='$todate' - $wherepart - $wheresupplierid - $wheresuppliername - $whereorderno - $wherelinestatus - $wherecategory + WHERE purchorders.orddate >='$FromDate' + AND purchorders.orddate <='$ToDate' + $WherePart + $WhereSupplierID + $WhereSupplierName + $WhereOrderNo + $WhereLineStatus + $WhereCategory GROUP BY " . $_POST['SummaryType'] . ',purchorders.supplierno, suppliers.suppname @@ -315,14 +315,14 @@ LEFT JOIN suppliers ON purchorders.supplierno = suppliers.supplierid LEFT JOIN stockmaster ON purchorderdetails.itemcode = stockmaster.stockid LEFT JOIN stockcategory ON stockcategory.categoryid = stockmaster.categoryid - WHERE purchorders.orddate >='$fromdate' - AND purchorders.orddate <='$todate' - $wherepart - $wheresupplierid - $wheresuppliername - $whereorderno - $wherelinestatus - $wherecategory + WHERE purchorders.orddate >='$FromDate' + AND purchorders.orddate <='$ToDate' + $WherePart + $WhereSupplierID + $WhereSupplierName + $WhereOrderNo + $WhereLineStatus + $WhereCategory GROUP BY " . $_POST['SummaryType'] . ', monthname ORDER BY ' . $orderby; @@ -338,14 +338,14 @@ LEFT JOIN suppliers ON purchorders.supplierno = suppliers.supplierid LEFT JOIN stockmaster ON purchorderdetails.itemcode = stockmaster.stockid LEFT JOIN stockcategory ON stockcategory.categoryid = stockmaster.categoryid - WHERE purchorders.orddate >='$fromdate' - AND purchorders.orddate <='$todate' - $wherepart - $wheresupplierid - $wheresuppliername - $whereorderno - $wherelinestatus - $wherecategory + WHERE purchorders.orddate >='$FromDate' + AND purchorders.orddate <='$ToDate' + $WherePart + $WhereSupplierID + $WhereSupplierName + $WhereOrderNo + $WhereLineStatus + $WhereCategory GROUP BY " . $_POST['SummaryType'] . ', categorydescription ORDER BY ' . $orderby; @@ -365,14 +365,14 @@ LEFT JOIN suppliers ON purchorders.supplierno = suppliers.supplierid LEFT JOIN stockmaster ON purchorderdetails.itemcode = stockmaster.stockid LEFT JOIN stockcategory ON stockcategory.categoryid = stockmaster.categoryid - WHERE grns.deliverydate >='$fromdate' - AND grns.deliverydate <='$todate' - $wherepart - $wheresupplierid - $wheresuppliername - $whereorderno - $wherelinestatus - $wherecategory + WHERE grns.deliverydate >='$FromDate' + AND grns.deliverydate <='$ToDate' + $WherePart + $WhereSupplierID + $WhereSupplierName + $WhereOrderNo + $WhereLineStatus + $WhereCategory GROUP BY " . $_POST['SummaryType'] . ', stockmaster.description ORDER BY ' . $orderby; @@ -390,14 +390,14 @@ LEFT JOIN suppliers ON purchorders.supplierno = suppliers.supplierid LEFT JOIN stockmaster ON purchorderdetails.itemcode = stockmaster.stockid LEFT JOIN stockcategory ON stockcategory.categoryid = stockmaster.categoryid - WHERE grns.deliverydate >='$fromdate' - AND grns.deliverydate <='$todate' - $wherepart - $wheresupplierid - $wheresuppliername - $whereorderno - $wherelinestatus - $wherecategory + WHERE grns.deliverydate >='$FromDate' + AND grns.deliverydate <='$ToDate' + $WherePart + $WhereSupplierID + $WhereSupplierName + $WhereOrderNo + $WhereLineStatus + $WhereCategory GROUP BY " . $_POST['SummaryType'] . ', purchorders.supplierno, suppliers.suppname @@ -415,14 +415,14 @@ LEFT JOIN suppliers ON purchorders.supplierno = suppliers.supplierid LEFT JOIN stockmaster ON purchorderdetails.itemcode = stockmaster.stockid LEFT JOIN stockcategory ON stockcategory.categoryid = stockmaster.categoryid - WHERE grns.deliverydate >='$fromdate' - AND grns.deliverydate <='$todate' - $wherepart - $wheresupplierid - $wheresuppliername - $whereorderno - $wherelinestatus - $wherecategory + WHERE grns.deliverydate >='$FromDate' + AND grns.deliverydate <='$ToDate' + $WherePart + $WhereSupplierID + $WhereSupplierName + $WhereOrderNo + $WhereLineStatus + $WhereCategory GROUP BY " . $_POST['SummaryType'] . ', purchorders.supplierno, suppliers.suppname @@ -440,14 +440,14 @@ LEFT JOIN suppliers ON purchorders.supplierno = suppliers.supplierid LEFT JOIN stockmaster ON purchorderdetails.itemcode = stockmaster.stockid LEFT JOIN stockcategory ON stockcategory.categoryid = stockmaster.categoryid - WHERE grns.deliverydate >='$fromdate' - AND grns.deliverydate <='$todate' - $wherepart - $wheresupplierid - $wheresuppliername - $whereorderno - $wherelinestatus - $wherecategory + WHERE grns.deliverydate >='$FromDate' + AND grns.deliverydate <='$ToDate' + $WherePart + $WhereSupplierID + $WhereSupplierName + $WhereOrderNo + $WhereLineStatus + $WhereCategory GROUP BY " . $_POST['SummaryType'] . ',monthname ORDER BY ' . $orderby; @@ -464,14 +464,14 @@ LEFT JOIN suppliers ON purchorders.supplierno = suppliers.supplierid LEFT JOIN stockmaster ON purchorderdetails.itemcode = stockmaster.stockid LEFT JOIN stockcategory ON stockcategory.categoryid = stockmaster.categoryid - WHERE grns.deliverydate >='$fromdate' - AND grns.deliverydate <='$todate' - $wherepart - $wheresupplierid - $wheresuppliername - $whereorderno - $wherelinestatus - $wherecategory + WHERE grns.deliverydate >='$FromDate' + AND grns.deliverydate <='$ToDate' + $WherePart + $WhereSupplierID + $WhereSupplierName + $WhereOrderNo + $WhereLineStatus + $WhereCategory GROUP BY " . $_POST['SummaryType'] . ',categorydescription ORDER BY ' . $orderby; @@ -482,35 +482,35 @@ $ErrMsg = _('The SQL to find the parts selected failed with the message'); $result = DB_query($sql,$db,$ErrMsg); $ctr = 0; - $totalqty = 0; - $totalextcost = 0; - $totalextprice = 0; - $totalinvqty = 0; + $TotalQty = 0; + $TotalExtCost = 0; + $TotalExtPrice = 0; + $TotalInvQty = 0; - // Create array for summary type to display in header. Access it with $savesummarytype - $summary_array["orderno"] = _('Order Number'); - $summary_array["itemcode"] = _('Part Number'); - $summary_array["extprice"] = _('Extended Price'); - $summary_array["supplierno"] = _('Customer Number'); - $summary_array["suppname"] = _('Customer Name'); - $summary_array["month"] = _('Month'); - $summary_array["categoryid"] = _('Stock Category'); + // Create array for summary type to display in header. Access it with $SaveSummaryType + $Summary_Array["orderno"] = _('Order Number'); + $Summary_Array["itemcode"] = _('Part Number'); + $Summary_Array["extprice"] = _('Extended Price'); + $Summary_Array["supplierno"] = _('Customer Number'); + $Summary_Array["suppname"] = _('Customer Name'); + $Summary_Array["month"] = _('Month'); + $Summary_Array["categoryid"] = _('Stock Category'); // Create array for sort for detail report to display in header - $detail_array['purchorderdetails.orderno'] = _('Order Number'); - $detail_array['purchorderdetails.itemcode'] = _('Part Number'); - $detail_array['suppliers.supplierid,purchorderdetails.orderno'] = _('Supplier Number'); - $detail_array['suppliers.suppname,suppliers.supplierid,purchorderdetails.orderno'] = _('Supplier Name'); + $Detail_Array['purchorderdetails.orderno'] = _('Order Number'); + $Detail_Array['purchorderdetails.itemcode'] = _('Part Number'); + $Detail_Array['suppliers.supplierid,purchorderdetails.orderno'] = _('Supplier Number'); + $Detail_Array['suppliers.suppname,suppliers.supplierid,purchorderdetails.orderno'] = _('Supplier Name'); // Display Header info echo '<table class=selection>'; if ($_POST['ReportType'] == 'Summary') { - $sortby_display = $summary_array[$savesummarytype]; + $SortBy_Display = $Summary_Array[$SaveSummaryType]; } else { - $sortby_display = $detail_array[$_POST['SortBy']]; + $SortBy_Display = $Detail_Array[$_POST['SortBy']]; } echo '<tr><th colspan=2><font size=3 color=navy>'._('Header Details').'</font></th></tr>'; - echo '<tr><td>' . _('Purchase Order Report') . '</td><td>' . $_POST['ReportType'] . ' By '.$sortby_display .'</td></tr>'; + echo '<tr><td>' . _('Purchase Order Report') . '</td><td>' . $_POST['ReportType'] . ' By '.$SortBy_Display .'</td></tr>'; echo '<tr><td>' . _('Date Type') . '</td><td>' . $_POST['DateType'] . '</tr>'; echo '<tr><td>' . _('Date Range') . '</td><td>' . $_POST['FromDate'] . _(' To ') . $_POST['ToDate'] . '</td></tr>'; if (strlen(trim($PartNumber)) > 0) { @@ -567,11 +567,11 @@ $myrow['linestatus'], ConvertSQLDate($myrow['deliverydate']), $myrow['description']); - $lastdecimalplaces = $myrow['decimalplaces']; - $totalqty += $myrow['quantityord']; - $totalextcost += $myrow['extcost']; - $totalextprice += $myrow['extprice']; - $totalinvqty += $myrow['qtyinvoiced']; + $LastDecimalPlaces = $myrow['decimalplaces']; + $TotalQty += $myrow['quantityord']; + $TotalExtCost += $myrow['extcost']; + $TotalExtPrice += $myrow['extprice']; + $TotalInvQty += $myrow['qtyinvoiced']; } //END WHILE LIST LOOP // Print totals printf("<tr><td>%s</td><td>%s</td><td>%s</td><td>%s</td><td>%s</td><td class=number>%s</td><td class=number>%s</td> @@ -581,10 +581,10 @@ ' ', ' ', ' ', - number_format($totalqty,2), - number_format($totalextcost,2), - number_format($totalextprice,2), - number_format($totalinvqty,2), + number_format($TotalQty,2), + number_format($TotalExtCost,2), + number_format($TotalExtPrice,2), + number_format($TotalInvQty,2), ' ', ' '); } else { @@ -629,11 +629,11 @@ $myrow['linestatus'], ConvertSQLDate($myrow['deliverydate']), $myrow['description']); - $lastdecimalplaces = $myrow['decimalplaces']; - $totalqty += $myrow['quantityord']; - $totalextcost += $myrow['extcost']; - $totalextprice += $myrow['extprice']; - $totalinvqty += $myrow['qtyinvoiced']; + $LastDecimalPlaces = $myrow['decimalplaces']; + $TotalQty += $myrow['quantityord']; + $TotalExtCost += $myrow['extcost']; + $TotalExtPrice += $myrow['extprice']; + $TotalInvQty += $myrow['qtyinvoiced']; } //END WHILE LIST LOOP // Print totals printf("<tr><td>%s</td><td>%s</td><td>%s</td><td>%s</td><td>%s</td><td class=number>%s</td><td class=number> @@ -643,10 +643,10 @@ ' ', ' ', ' ', - number_format($totalqty,$lastdecimalplaces), - number_format($totalextcost,2), - number_format($totalextprice,2), - number_format($totalinvqty,$lastdecimalplaces), + number_format($TotalQty,$LastDecimalPlaces), + number_format($TotalExtCost,2), + number_format($TotalExtPrice,2), + number_format($TotalInvQty,$LastDecimalPlaces), ' ', ' '); } @@ -724,23 +724,23 @@ number_format($myrow['extprice'],2), $myrow['qtyinvoiced'], $suppname); - $totalqty += $myrow['quantityord']; - $totalextcost += $myrow['extcost']; - $totalextprice += $myrow['extprice']; - $totalinvqty += $myrow['qtyinvoiced']; + $TotalQty += $myrow['quantityord']; + $TotalExtCost += $myrow['extcost']; + $TotalExtPrice += $myrow['extprice']; + $TotalInvQty += $myrow['qtyinvoiced']; } //END WHILE LIST LOOP // Print totals printf("<tr><td>%s</td><td>%s</td><td class=number>%s</td><td class=number>%s</td><td class=number>%s</td><td class=number>%s</td></tr>", 'Totals', _('Lines - ') . $linectr, - $totalqty, - number_format($totalextcost,2), - number_format($totalextprice,2), - $totalinvqty, + $TotalQty, + number_format($TotalExtCost,2), + number_format($TotalExtPrice,2), + $TotalInvQty, ' '); } // End of if ($_POST['ReportType'] echo '</table>'; - echo "<form action=" . $_SERVER['PHP_SELF'] . "?" . SID ." method=post>"; + echo '<form action="' . $_SERVER['PHP_SELF'] . '" method="post">'; echo '<input type="hidden" name="FormID" value="' . $_SESSION['FormID'] . '" />'; echo "<input type=hidden name='ReportType' value=".$_POST['ReportType'].">"; echo "<input type=hidden name='DateType' value=".$_POST['DateType'].">"; @@ -758,13 +758,19 @@ echo "<input type=hidden name='SortBy' value=".$_POST['SortBy'].">"; echo "<input type=hidden name='SummaryType' value=".$_POST['SummaryType'].">"; echo "<br><div class=centre><input type='submit' name='submitcsv' value='" . _('Export as csv file') . "'></div></td>"; - echo "</form>"; + echo '</form>'; } // End of if inputerror != 1 } // End of function submit() //####_SUBMIT_SUBMIT_SUBMIT_SUBMIT_SUBMIT_SUBMIT_SUBMIT_SUBMIT_SUBMIT_SUBMIT_SUBMIT_SUBMIT#### -function submitcsv(&$db,$PartNumber,$PartNumberOp,$SupplierId,$SupplierIdOp,$SupplierName,$SupplierNameOp,$savesummarytype) -{ +function submitcsv(&$db, + $PartNumber, + $PartNumberOp, + $SupplierId, + $SupplierIdOp, + $SupplierName, + $SupplierNameOp, + $SaveSummaryType) { //initialize no input errors $InputError = 0; @@ -784,71 +790,71 @@ } # Add more to WHERE statement, if user entered something for the part number,supplierid, name - $wherepart = ' '; + $WherePart = ' '; if (strlen($PartNumber) > 0 && $PartNumberOp == 'LIKE') { $PartNumber = $PartNumber . '%'; } else { $PartNumberOp = '='; } if (strlen($PartNumber) > 0) { - $wherepart = " AND purchorderdetails.itemcode " . $PartNumberOp . " '" . $PartNumber . "' "; + $WherePart = " AND purchorderdetails.itemcode " . $PartNumberOp . " '" . $PartNumber . "' "; } else { - $wherepart=' '; + $WherePart=' '; } - $wheresupplierid = ' '; + $WhereSupplierID = ' '; if ($SupplierIdOp == 'LIKE') { $SupplierId = $SupplierId . '%'; } else { $SupplierIdOp = '='; } if (strlen($SupplierId) > 0) { - $wheresupplierid = " AND purchorders.supplierno " . $SupplierIdOp . " '" . $SupplierId . "' "; + $WhereSupplierID = " AND purchorders.supplierno " . $SupplierIdOp . " '" . $SupplierId . "' "; } else { - $wheresupplierid=' '; + $WhereSupplierID=' '; } - $wheresuppliername = ' '; + $WhereSupplierName = ' '; if (strlen($SupplierName) > 0 && $SupplierNameOp == 'LIKE') { $SupplierName = $SupplierName . '%'; } else { $SupplierNameOp = '='; } if (strlen($SupplierName) > 0) { - $wheresuppliername = " AND suppliers.suppname " . $SupplierNameOp . " '" . $SupplierName . "' "; + $WhereSupplierName = " AND suppliers.suppname " . $SupplierNameOp . " '" . $SupplierName . "' "; } else { - $wheresuppliername=' '; + $WhereSupplierName=' '; } if (strlen($_POST['OrderNo']) > 0) { - $whereorderno = ' AND purchorderdetails.orderno = ' . " '" . $_POST['OrderNo'] . "' "; + $WhereOrderNo = ' AND purchorderdetails.orderno = ' . " '" . $_POST['OrderNo'] . "' "; } else { - $whereorderno=' '; + $WhereOrderNo=' '; } - $wherelinestatus = ' '; + $WhereLineStatus = ' '; # Had to use IF statement instead of comparing 'linestatus' to $_POST['LineStatus'] #in WHERE clause because the WHERE clause didn't recognize # that had used the IF statement to create a field called linestatus if ($_POST['LineStatus'] != 'All') { if ($_POST['DateType'] == 'Order') { - $wherelinestatus = " AND IF(purchorderdetails.quantityord = purchorderdetails.qtyinvoiced || + $WhereLineStatus = " AND IF(purchorderdetails.quantityord = purchorderdetails.qtyinvoiced || purchorderdetails.completed = 1,'Completed','Open') = '" . $_POST['LineStatus'] . "'"; } else { - $wherelinestatus = " AND IF(grns.qtyrecd - grns.quantityinv <> 0,'Open','Completed') = '" + $WhereLineStatus = " AND IF(grns.qtyrecd - grns.quantityinv <> 0,'Open','Completed') = '" . $_POST['LineStatus'] . "'"; } } - $wherecategory = ' '; + $WhereCategory = ' '; if ($_POST['Category'] != 'All') { - $wherecategory = " AND stockmaster.categoryid = '" . $_POST['Category'] . "'"; + $WhereCategory = " AND stockmaster.categoryid = '" . $_POST['Category'] . "'"; } if ($InputError !=1) { - $fromdate = FormatDateForSQL($_POST['FromDate']); - $todate = FormatDateForSQL($_POST['ToDate']); + $FromDate = FormatDateForSQL($_POST['FromDate']); + $ToDate = FormatDateForSQL($_POST['ToDate']); if ($_POST['ReportType'] == 'Detail') { if ($_POST['DateType'] == 'Order') { $sql = "SELECT purchorderdetails.orderno, @@ -869,14 +875,14 @@ LEFT JOIN purchorders ON purchorders.orderno=purchorderdetails.orderno LEFT JOIN suppliers ON purchorders.supplierno = suppliers.supplierid LEFT JOIN stockmaster ON purchorderdetails.itemcode = stockmaster.stockid - WHERE purchorders.orddate >='$fromdate' - AND purchorders.orddate <='$todate' - $wherepart - $wheresupplierid - $wheresuppliername - $whereorderno - $wherelinestatus - $wherecategory + WHERE purchorders.orddate >='$FromDate' + AND purchorders.orddate <='$ToDate' + $WherePart + $WhereSupplierID + $WhereSupplierName + $WhereOrderNo + $WhereLineStatus + $WhereCategory ORDER BY " . $_POST['SortBy']; } else { // Selects by delivery date from grns @@ -898,14 +904,14 @@ LEFT JOIN purchorders ON purchorders.orderno=purchorderdetails.orderno LEFT JOIN suppliers ON purchorders.supplierno = suppliers.supplierid LEFT JOIN stockmaster ON purchorderdetails.itemcode = stockmaster.stockid - WHERE grns.deliverydate >='$fromdate' - AND grns.deliverydate <='$todate' - $wherepart - $wheresupplierid - $wheresuppliername - $whereorderno - $wherelinestatus - $wherecategory + WHERE grns.deliverydate >='$FromDate' + AND grns.deliverydate <='$ToDate' + $WherePart + $WhereSupplierID + $WhereSupplierName + $WhereOrderNo + $WhereLineStatus + $WhereCategory ORDER BY " . $_POST['SortBy']; } } else { @@ -932,14 +938,14 @@ LEFT JOIN suppliers ON purchorders.supplierno = suppliers.supplierid LEFT JOIN stockmaster ON purchorderdetails.itemcode = stockmaster.stockid LEFT JOIN stockcategory ON stockcategory.categoryid = stockmaster.categoryid - WHERE purchorders.orddate >='$fromdate' - AND purchorders.orddate <='$todate' - $wherepart - $wheresupplierid - $wheresuppliername - $whereorderno - $wherelinestatus - $wherecategory + WHERE purchorders.orddate >='$FromDate' + AND purchorders.orddate <='$ToDate' + $WherePart + $WhereSupplierID + $WhereSupplierName + $WhereOrderNo + $WhereLineStatus + $WhereCategory GROUP BY " . $_POST['SummaryType'] . ',stockmaster.decimalplaces, stockmaster.description @@ -957,14 +963,14 @@ LEFT JOIN suppliers ON purchorders.supplierno = suppliers.supplierid LEFT JOIN stockmaster ON purchorderdetails.itemcode = stockmaster.stockid LEFT JOIN stockcategory ON stockcategory.categoryid = stockmaster.categoryid - WHERE purchorders.orddate >='$fromdate' - AND purchorders.orddate <='$todate' - $wherepart - $wheresupplierid - $wheresuppliername - $whereorderno - $wherelinestatus - $wherecategory + WHERE purchorders.orddate >='$FromDate' + AND purchorders.orddate <='$ToDate' + $WherePart + $WhereSupplierID + $WhereSupplierName + $WhereOrderNo + $WhereLineStatus + $WhereCategory GROUP BY " . $_POST['SummaryType'] . ',purchorders.supplierno, suppliers.suppname @@ -981,14 +987,14 @@ LEFT JOIN suppliers ON purchorders.supplierno = suppliers.supplierid LEFT JOIN stockmaster ON purchorderdetails.itemcode = stockmaster.stockid LEFT JOIN stockcategory ON stockcategory.categoryid = stockmaster.categoryid - WHERE purchorders.orddate >='$fromdate' - AND purchorders.orddate <='$todate' - $wherepart - $wheresupplierid - $wheresuppliername - $whereorderno - $wherelinestatus - $wherecategory + WHERE purchorders.orddate >='$FromDate' + AND purchorders.orddate <='$ToDate' + $WherePart + $WhereSupplierID + $WhereSupplierName + $WhereOrderNo + $WhereLineStatus + $WhereCategory GROUP BY " . $_POST['SummaryType'] . ',purchorders.supplierno, suppliers.suppname @@ -1005,14 +1011,14 @@ LEFT JOIN suppliers ON purchorders.supplierno = suppliers.supplierid LEFT JOIN stockmaster ON purchorderdetails.itemcode = stockmaster.stockid LEFT JOIN stockcategory ON stockcategory.categoryid = stockmaster.categoryid - WHERE purchorders.orddate >='$fromdate' - AND purchorders.orddate <='$todate' - $wherepart - $wheresupplierid - $wheresuppliername - $whereorderno - $wherelinestatus - $wherecategory + WHERE purchorders.orddate >='$FromDate' + AND purchorders.orddate <='$ToDate' + $WherePart + $WhereSupplierID + $WhereSupplierName + $WhereOrderNo + $WhereLineStatus + $WhereCategory GROUP BY " . $_POST['SummaryType'] . ', monthname ORDER BY ' . $orderby; @@ -1028,14 +1034,14 @@ LEFT JOIN suppliers ON purchorders.supplierno = suppliers.supplierid LEFT JOIN stockmaster ON purchorderdetails.itemcode = stockmaster.stockid LEFT JOIN stockcategory ON stockcategory.categoryid = stockmaster.categoryid - WHERE purchorders.orddate >='$fromdate' - AND purchorders.orddate <='$todate' - $wherepart - $wheresupplierid - $wheresuppliername - $whereorderno - $wherelinestatus - $wherecategory + WHERE purchorders.orddate >='$FromDate' + AND purchorders.orddate <='$ToDate' + $WherePart + $WhereSupplierID + $WhereSupplierName + $WhereOrderNo + $WhereLineStatus + $WhereCategory GROUP BY " . $_POST['SummaryType'] . ', categorydescription ORDER BY ' . $orderby; @@ -1055,14 +1061,14 @@ LEFT JOIN suppliers ON purchorders.supplierno = suppliers.supplierid LEFT JOIN stockmaster ON purchorderdetails.itemcode = stockmaster.stockid LEFT JOIN stockcategory ON stockcategory.categoryid = stockmaster.categoryid - WHERE grns.deliverydate >='$fromdate' - AND grns.deliverydate <='$todate' - $wherepart - $wheresupplierid - $wheresuppliername - $whereorderno - $wherelinestatus - $wherecategory + WHERE grns.deliverydate >='$FromDate' + AND grns.deliverydate <='$ToDate' + $WherePart + $WhereSupplierID + $WhereSupplierName + $WhereOrderNo + $WhereLineStatus + $WhereCategory GROUP BY " . $_POST['SummaryType'] . ', stockmaster.description ORDER BY ' . $orderby; @@ -1080,14 +1086,14 @@ LEFT JOIN suppliers ON purchorders.supplierno = suppliers.supplierid LEFT JOIN stockmaster ON purchorderdetails.itemcode = stockmaster.stockid LEFT JOIN stockcategory ON stockcategory.categoryid = stockmaster.categoryid - WHERE grns.deliverydate >='$fromdate' - AND grns.deliverydate <='$todate' - $wherepart - $wheresupplierid - $wheresuppliername - $whereorderno - $wherelinestatus - $wherecategory + WHERE grns.deliverydate >='$FromDate' + AND grns.deliverydate <='$ToDate' + $WherePart + $WhereSupplierID + $WhereSupplierName + $WhereOrderNo + $WhereLineStatus + $WhereCategory GROUP BY " . $_POST['SummaryType'] . ', purchorders.supplierno, suppliers.suppname @@ -1105,14 +1111,14 @@ LEFT JOIN suppliers ON purchorders.supplierno = suppliers.supplierid LEFT JOIN stockmaster ON purchorderdetails.itemcode = stockmaster.stockid LEFT JOIN stockcategory ON stockcategory.categoryid = stockmaster.categoryid - WHERE grns.deliverydate >='$fromdate' - AND grns.deliverydate <='$todate' - $wherepart - $wheresupplierid - $wheresuppliername - $whereorderno - $wherelinestatus - $wherecategory + WHERE grns.deliverydate >='$FromDate' + AND grns.deliverydate <='$ToDate' + $WherePart + $WhereSupplierID + $WhereSupplierName + $WhereOrderNo + $WhereLineStatus + $WhereCategory GROUP BY " . $_POST['SummaryType'] . ', purchorders.supplierno, suppliers.suppname @@ -1130,14 +1136,14 @@ LEFT JOIN suppliers ON purchorders.supplierno = suppliers.supplierid LEFT JOIN stockmaster ON purchorderdetails.itemcode = stockmaster.stockid LEFT JOIN stockcategory ON stockcategory.categoryid = stockmaster.categoryid - WHERE grns.deliverydate >='$fromdate' - AND grns.deliverydate <='$todate' - $wherepart - $wheresupplierid - $wheresuppliername - $whereorderno - $wherelinestatus - $wherecategory + WHERE grns.deliverydate >='$FromDate' + AND grns.deliverydate <='$ToDate' + $WherePart + $WhereSupplierID + $WhereSupplierName + $WhereOrderNo + $WhereLineStatus + $WhereCategory GROUP BY " . $_POST['SummaryType'] . ',monthname ORDER BY ' . $orderby; @@ -1154,14 +1160,14 @@ LEFT JOIN suppliers ON purchorders.supplierno = suppliers.supplierid LEFT JOIN stockmaster ON purchorderdetails.itemcode = stockmaster.stockid LEFT JOIN stockcategory ON stockcategory.categoryid = stockmaster.categoryid - WHERE grns.deliverydate >='$fromdate' - AND grns.deliverydate <='$todate' - $wherepart - $wheresupplierid - $wheresuppliername - $whereorderno - $wherelinestatus - $wherecategory + WHERE grns.deliverydate >='$FromDate' + AND grns.deliverydate <='$ToDate' + $WherePart + $WhereSupplierID + $WhereSupplierName + $WhereOrderNo + $WhereLineStatus + $WhereCategory GROUP BY " . $_POST['SummaryType'] . ',categorydescription ORDER BY ' . $orderby; @@ -1172,34 +1178,34 @@ $ErrMsg = _('The SQL to find the parts selected failed with the message'); $result = DB_query($sql,$db,$ErrMsg); $ctr = 0; - $totalqty = 0; - $totalextcost = 0; - $totalextprice = 0; - $totalinvqty = 0; + $TotalQty = 0; + $TotalExtCost = 0; + $TotalExtPrice = 0; + $TotalInvQty = 0; $FileName = $_SESSION['reports_dir'] .'/POReport.csv'; $FileHandle = fopen($FileName, 'w'); - // Create array for summary type to display in header. Access it with $savesummarytype - $summary_array["orderno"] = _('Order Number'); - $summary_array["itemcode"] = _('Part Number'); - $summary_array["extprice"] = _('Extended Price'); - $summary_array["supplierno"] = _('Customer Number'); - $summary_array["suppname"] = _('Customer Name'); - $summary_array["month"] = _('Month'); - $summary_array["categoryid"] = _('Stock Category'); + // Create array for summary type to display in header. Access it with $SaveSummaryType + $Summary_Array['orderno'] = _('Order Number'); + $Summary_Array['itemcode'] = _('Part Number'); + $Summary_Array['extprice'] = _('Extended Price'); + $Summary_Array['supplierno'] = _('Customer Number'); + $Summary_Array['suppname'] = _('Customer Name'); + $Summary_Array['month'] = _('Month'); + $Summary_Array['categoryid'] = _('Stock Category'); // Create array for sort for detail report to display in header - $detail_array['purchorderdetails.orderno'] = _('Order Number'); - $detail_array['purchorderdetails.itemcode'] = _('Part Number'); - $detail_array['suppliers.supplierid,purchorderdetails.orderno'] = _('Supplier Number'); - $detail_array['suppliers.suppname,suppliers.supplierid,purchorderdetails.orderno'] = _('Supplier Name'); + $Detail_Array['purchorderdetails.orderno'] = _('Order Number'); + $Detail_Array['purchorderdetails.itemcode'] = _('Part Number'); + $Detail_Array['suppliers.supplierid,purchorderdetails.orderno'] = _('Supplier Number'); + $Detail_Array['suppliers.suppname,suppliers.supplierid,purchorderdetails.orderno'] = _('Supplier Name'); // Display Header info if ($_POST['ReportType'] == 'Summary') { - $sortby_display = $summary_array[$savesummarytype]; + $SortBy_Display = $Summary_Array[$SaveSummaryType]; } else { - $sortby_display = $detail_array[$_POST['SortBy']]; + $SortBy_Display = $Detail_Array[$_POST['SortBy']]; } - fprintf($FileHandle, '"'. _('Purchase Order Report') . '","' . $_POST['ReportType'] . ' '._('By').' '.$sortby_display ."\n"); + fprintf($FileHandle, '"'. _('Purchase Order Report') . '","' . $_POST['ReportType'] . ' '._('By').' '.$SortBy_Display ."\n"); fprintf($FileHandle, '"'. _('Date Type') . '","' . $_POST['DateType'] . '"'. "\n"); fprintf($FileHandle, '"'. _('Date Range') . '","' . $_POST['FromDate'] . _(' To ') . $_POST['ToDate'] . '"'."\n"); if (strlen(trim($PartNumber)) > 0) { @@ -1246,11 +1252,11 @@ $myrow['linestatus'], ConvertSQLDate($myrow['deliverydate']), $myrow['description']); - $lastdecimalplaces = $myrow['decimalplaces']; - $totalqty += $myrow['quantityord']; - $totalextcost += $myrow['extcost']; - $totalextprice += $myrow['extprice']; - $totalinvqty += $myrow['qtyinvoiced']; + $LastDecimalPlaces = $myrow['decimalplaces']; + $TotalQty += $myrow['quantityord']; + $TotalExtCost += $myrow['extcost']; + $TotalExtPrice += $myrow['extprice']; + $TotalInvQty += $myrow['qtyinvoiced']; } //END WHILE LIST LOOP // Print totals fprintf($FileHandle, '"%s","%s","%s","%s","%s",%s,%s,%s,%s,"%s","%s"'."\n", @@ -1259,10 +1265,10 @@ ' ', ' ', ' ', - number_format($totalqty,2), - number_format($totalextcost,2), - number_format($totalextprice,2), - number_format($totalinvqty,2), + number_format($TotalQty,2), + number_format($TotalExtCost,2), + number_format($TotalExtPrice,2), + number_format($TotalInvQty,2), ' ', ' '); } else { @@ -1298,11 +1304,11 @@ $myrow['linestatus'], ConvertSQLDate($myrow['deliverydate']), $myrow['description']); - $lastdecimalplaces = $myrow['decimalplaces']; - $totalqty += $myrow['quantityord']; - $totalextcost += $myrow['extcost']; - $totalextprice += $myrow['extprice']; - $totalinvqty += $myrow['qtyinvoiced']; + $LastDecimalPlaces = $myrow['decimalplaces']; + $TotalQty += $myrow['quantityord']; + $TotalExtCost += $myrow['extcost']; + $TotalExtPrice += $myrow['extprice']; + $TotalInvQty += $myrow['qtyinvoiced']; } //END WHILE LIST LOOP // Print totals fprintf($FileHandle, '"%s","%s","%s","%s","%s",%s,%s,%s,%s,"%s","%s"'."\n", @@ -1311,10 +1317,10 @@ ' ', ' ', ' ', - number_format($totalqty,$lastdecimalplaces), - number_format($totalextcost,2), - number_format($totalextprice,2), - number_format($totalinvqty,$lastdecimalplaces), + number_format($TotalQty,$LastDecimalPlaces), + number_format($TotalExtCost,2), + number_format($TotalExtPrice,2), + number_format($TotalInvQty,$LastDecimalPlaces), " ", " "); } @@ -1383,20 +1389,20 @@ number_format($myrow['qtyinvoiced'],$myrow['decimalplaces']), $suppname); print '<br/>'; - $lastdecimalplaces = $myrow['decimalplaces']; - $totalqty += $myrow['quantityord']; - $totalextcost += $myrow['extcost']; - $totalextprice += $myrow['extprice']; - $totalinvqty += $myrow['qtyinvoiced']; + $LastDecimalPlaces = $myrow['decimalplaces']; + $TotalQty += $myrow['quantityord']; + $TotalExtCost += $myrow['extcost']; + $TotalExtPrice += $myrow['extprice']; + $TotalInvQty += $myrow['qtyinvoiced']; } //END WHILE LIST LOOP // Print totals fprintf($FileHandle, '"%s","%s",%s,%s,%s,%s,"%s"'."\n", 'Totals', _('Lines - ') . $linectr, - number_format($totalqty,$lastdecimalplaces), - number_format($totalextcost,2), - number_format($totalextprice,2), - number_format($totalinvqty,$lastdecimalplaces), + number_format($TotalQty,$LastDecimalPlaces), + number_format($TotalExtCost,2), + number_format($TotalExtPrice,2), + number_format($TotalInvQty,$LastDecimalPlaces), ' '); } // End of if ($_POST['ReportType'] fclose($FileHandle); @@ -1412,7 +1418,7 @@ // Display form fields. This function is called the first time // the page is called. - echo "<form action=" . $_SERVER['PHP_SELF'] . "?" . SID ." method=post>"; + echo '<form action="' . $_SERVER['PHP_SELF'] . '" method=post>'; echo '<input type="hidden" name="FormID" value="' . $_SESSION['FormID'] . '" />'; echo '<table class=selection>'; @@ -1461,15 +1467,15 @@ } echo '<tr><td>' . _('Supplier Name') . ':</td>'; - echo "<td><select name='SupplierNameOp'>"; - echo "<option selected value='LIKE'>" . _('Begins With'); - echo "<option value='Equals'>" . _('Equals'); + echo '<td><select name="SupplierNameOp">'; + echo '<option selected value="LIKE">' . _('Begins With') . '</option>'; + echo '<option value="Equals">' . _('Equals') . '</option>'; echo '</select>'; - echo "  <input type='Text' name='SupplierName' size=30 maxlength=30 value="; + echo '  <input type="text" name="SupplierName" size=30 maxlength=30 value="'; if (isset($_POST['SupplierName'])) { - echo $_POST['SupplierName'] . "></td></tr>"; + echo $_POST['SupplierName'] . '" /></td></tr>'; } else { - echo "></td></tr>"; + echo '" /></td></tr>'; } echo '<tr><td>' . _('Order Number') . ':</td>'; @@ -1482,56 +1488,55 @@ } echo '<tr><td>' . _('Line Item Status') . ':</td>'; - echo "<td><select name='LineStatus'>"; - echo "<option selected value='All'>" . _('All'); - echo "<option value='Completed'>" . _('Completed'); - echo "<option value='Open'>" . _('Not Completed'); + echo '<td><select name="LineStatus">'; + echo '<option selected value="All">' . _('All') . '</option>'; + echo '<option value="Completed">' . _('Completed') . '</option>'; + echo '<option value="Open">' . _('Not Completed') . '</option>'; echo '</select></td><td> </td></tr>'; - echo '<tr><td>' . _('Stock Categories') . ":</td><td><select name='Category'>"; - $sql='SELECT categoryid, categorydescription FROM stockcategory'; + echo '<tr><td>' . _('Stock Categories') . ':</td><td><select name="Category">'; + $sql="SELECT categoryid, categorydescription FROM stockcategory"; $CategoryResult= DB_query($sql,$db); - echo '<option selected value="All">' . _('All Categories'); + echo '<option selected value="All">' . _('All Categories') . '</option>'; While ($myrow = DB_fetch_array($CategoryResult)){ - echo '<option value="' . $myrow['categoryid'] . '">' . $myrow['categorydescription']; + echo '<option value="' . $myrow['categoryid'] . '">' . $myrow['categorydescription'] . '</option>'; } echo '</select></td></tr>'; echo '<tr><td> </td></tr>'; echo '<tr><td>' . _('Sort By') . ':</td>'; - echo "<td><select name='SortBy'>"; - echo "<option selected value='purchorderdetails.orderno'>" . _('Order Number'); - echo "<option value='purchorderdetails.itemcode'>" . _('Part Number'); - echo "<option value='suppliers.supplierid,purchorderdetails.orderno'>" . _('Supplier Number'); - echo "<option value='suppliers.suppname,suppliers.supplierid,purchorderdetails.orderno'>" . _('Supplier Name'); + echo '<td><select name="SortBy">'; + echo '<option selected value="purchorderdetails.orderno">' . _('Order Number') . '</option>'; + echo '<option value="purchorderdetails.itemcode">' . _('Part Number') . '</option>'; + echo '<option value="suppliers.supplierid,purchorderdetails.orderno">' . _('Supplier Number') . '</option>'; + echo '<option value="suppliers.suppname,suppliers.supplierid,purchorderdetails.orderno">' . _('Supplier Name') . '</option>'; echo '</select></td><td> </td></tr>'; echo '<tr><td> </td></tr>'; echo '<tr><td>' . _('Summary Type') . ':</td>'; - echo "<td><select name='SummaryType'>"; - echo "<option selected value='orderno'>" . _('Order Number'); - echo "<option value='itemcode'>" . _('Part Number'); - echo "<option value='extprice'>" . _('Extended Price'); - echo "<option value='supplierno'>" . _('Supplier Number'); - echo "<option value='suppname'>" . _('Supplier Name'); - echo "<option value='month'>" . _('Month'); - echo "<option value='categoryid'>" . _('Stock Category'); + echo '<td><select name="SummaryType">'; + echo '<option selected value="orderno">' . _('Order Number') . '</option>'; + echo '<option value="itemcode">' . _('Part Number') . '</option>'; + echo '<option value="extprice">' . _('Extended Price') . '</option>'; + echo '<option value="supplierno">' . _('Supplier Number') . '</option>'; + echo '<option value="suppname">' . _('Supplier Name') . '</option>'; + echo '<option value="month">' . _('Month') . '</option>'; + echo '<option value="categoryid">' . _('Stock Category') . '</option>'; echo '</select></td><td> </td></tr>'; - echo " - <tr><td> </td></tr> - <tr> - <td colspan=4><div class=centre><input type='submit' name='submit' value='" . _('Run Inquiry') . "'></div></td> + echo '<tr><td> </td></tr> + <tr> + <td colspan=4><div class=centre><input type="submit" name="submit" value="' . _('Run Inquiry') . '"></div></td> </tr> <tr> - <td colspan=4><div class=centre><input type='submit' name='submitcsv' value='" . _('Export as csv file') . "'></div></td> + <td colspan=4><div class=centre><input type="submit" name="submitcsv" value="' . _('Export as csv file') . '"></div></td> </tr> </table> - <br/>"; + <br/>'; echo '</form>'; } // End of function display() include('includes/footer.inc'); -?> +?> \ No newline at end of file Modified: trunk/Stocks.php =================================================================== --- trunk/Stocks.php 2011-04-11 10:49:45 UTC (rev 4547) +++ trunk/Stocks.php 2011-04-12 10:33:45 UTC (rev 4548) @... [truncated message content] |
From: <dai...@us...> - 2011-04-11 10:49:53
|
Revision: 4547 http://web-erp.svn.sourceforge.net/web-erp/?rev=4547&view=rev Author: daintree Date: 2011-04-11 10:49:45 +0000 (Mon, 11 Apr 2011) Log Message: ----------- Exson fix to xhtml Modified Paths: -------------- trunk/WorkOrderStatus.php Modified: trunk/WorkOrderStatus.php =================================================================== --- trunk/WorkOrderStatus.php 2011-04-11 10:33:34 UTC (rev 4546) +++ trunk/WorkOrderStatus.php 2011-04-11 10:49:45 UTC (rev 4547) @@ -1,8 +1,6 @@ <?php /* $Id$*/ -//$PageSecurity = 11; - include('includes/session.inc'); $title = _('Work Order Status Inquiry'); include('includes/header.inc'); @@ -36,13 +34,13 @@ } $WORow = DB_fetch_array($WOResult); - echo '<a href="'. $rootpath . '/SelectWorkOrder.php?' . SID . '">' . _('Back to Work Orders'). '</a><br>'; - echo '<a href="'. $rootpath . '/WorkOrderCosting.php?' . SID . '&WO=' . $_REQUEST['WO'] . '">' . _('Back to Costing'). '</a><br>'; + echo '<a href="'. $rootpath . '/SelectWorkOrder.php">' . _('Back to Work Orders'). '</a><br>'; + echo '<a href="'. $rootpath . '/WorkOrderCosting.php?WO=' . $_REQUEST['WO'] . '">' . _('Back to Costing'). '</a><br>'; echo '<p class="page_title_text"><img src="'.$rootpath.'/css/'.$theme.'/images/group_add.png" title="' . - _('Search') . '" alt="" />' . ' ' . $title.'</p'; + _('Search') . '" alt="" />' . ' ' . $title.'</p>'; - echo '<table cellpadding=2 class=selection> + echo '<table cellpadding="2" class="selection"> <tr><td class="label">' . _('Issue to work order') . ':</td><td>' . $_REQUEST['WO'] .'</td><td class="label">' . _('Item') . ':</td><td>' . $_REQUEST['StockID'] . ' - ' . $WORow['description'] . '</td></tr> <tr><td class="label">' . _('Manufactured at') . ':</td><td>' . $WORow['locationname'] . '</td><td class="label">' . _('Required By') . ':</td><td>' . ConvertSQLDate($WORow['requiredby']) . '</td></tr> <tr><td class="label">' . _('Quantity Ordered') . ':</td><td class=number>' . number_format($WORow['qtyreqd'],$WORow['decimalplaces']) . '</td><td colspan=2>' . $WORow['units'] . '</td></tr> This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <dai...@us...> - 2011-04-11 10:49:51
|
Revision: 4547 http://web-erp.svn.sourceforge.net/web-erp/?rev=4547&view=rev Author: daintree Date: 2011-04-11 10:49:45 +0000 (Mon, 11 Apr 2011) Log Message: ----------- Exson fix to xhtml Modified Paths: -------------- trunk/WorkOrderStatus.php Modified: trunk/WorkOrderStatus.php =================================================================== --- trunk/WorkOrderStatus.php 2011-04-11 10:33:34 UTC (rev 4546) +++ trunk/WorkOrderStatus.php 2011-04-11 10:49:45 UTC (rev 4547) @@ -1,8 +1,6 @@ <?php /* $Id$*/ -//$PageSecurity = 11; - include('includes/session.inc'); $title = _('Work Order Status Inquiry'); include('includes/header.inc'); @@ -36,13 +34,13 @@ } $WORow = DB_fetch_array($WOResult); - echo '<a href="'. $rootpath . '/SelectWorkOrder.php?' . SID . '">' . _('Back to Work Orders'). '</a><br>'; - echo '<a href="'. $rootpath . '/WorkOrderCosting.php?' . SID . '&WO=' . $_REQUEST['WO'] . '">' . _('Back to Costing'). '</a><br>'; + echo '<a href="'. $rootpath . '/SelectWorkOrder.php">' . _('Back to Work Orders'). '</a><br>'; + echo '<a href="'. $rootpath . '/WorkOrderCosting.php?WO=' . $_REQUEST['WO'] . '">' . _('Back to Costing'). '</a><br>'; echo '<p class="page_title_text"><img src="'.$rootpath.'/css/'.$theme.'/images/group_add.png" title="' . - _('Search') . '" alt="" />' . ' ' . $title.'</p'; + _('Search') . '" alt="" />' . ' ' . $title.'</p>'; - echo '<table cellpadding=2 class=selection> + echo '<table cellpadding="2" class="selection"> <tr><td class="label">' . _('Issue to work order') . ':</td><td>' . $_REQUEST['WO'] .'</td><td class="label">' . _('Item') . ':</td><td>' . $_REQUEST['StockID'] . ' - ' . $WORow['description'] . '</td></tr> <tr><td class="label">' . _('Manufactured at') . ':</td><td>' . $WORow['locationname'] . '</td><td class="label">' . _('Required By') . ':</td><td>' . ConvertSQLDate($WORow['requiredby']) . '</td></tr> <tr><td class="label">' . _('Quantity Ordered') . ':</td><td class=number>' . number_format($WORow['qtyreqd'],$WORow['decimalplaces']) . '</td><td colspan=2>' . $WORow['units'] . '</td></tr> This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <dai...@us...> - 2011-04-11 10:33:41
|
Revision: 4546 http://web-erp.svn.sourceforge.net/web-erp/?rev=4546&view=rev Author: daintree Date: 2011-04-11 10:33:34 +0000 (Mon, 11 Apr 2011) Log Message: ----------- to launchpad 4587-86 Modified Paths: -------------- trunk/AddCustomerContacts.php trunk/AuditTrail.php trunk/GLBudgets.php trunk/PcAuthorizeExpenses.php trunk/PcExpensesTypeTab.php trunk/PcTypeTabs.php trunk/SelectSalesOrder.php trunk/StockLocTransfer.php trunk/TopItems.php trunk/UserSettings.php trunk/WWW_Users.php trunk/api/api_workorders.php trunk/doc/Change.log.html Modified: trunk/AddCustomerContacts.php =================================================================== --- trunk/AddCustomerContacts.php 2011-04-10 10:41:20 UTC (rev 4545) +++ trunk/AddCustomerContacts.php 2011-04-11 10:33:34 UTC (rev 4546) @@ -1,5 +1,5 @@ <?php -/* $Revision: 1.6 $ */ + /* $Id$*/ include('includes/session.inc'); @@ -17,8 +17,8 @@ } elseif (isset($_GET['DebtorNo'])){ $DebtorNo = $_GET['DebtorNo']; } -echo "<a href='" . $rootpath . '/Customers.php?' . SID .'&DebtorNo='.$DebtorNo."'>" . _('Back to Customers') . '</a><br>'; -$SQLname="SELECT * from debtorsmaster where debtorno='" .$DebtorNo."'"; +echo "<a href='" . $rootpath . '/Customers.php?' . SID .'&DebtorNo='.$DebtorNo."'>" . _('Back to Customers') . '</a><br />'; +$SQLname="SELECT name FROM debtorsmaster where debtorno='" .$DebtorNo."'"; $Result = DB_query($SQLname,$db); $row = DB_fetch_array($Result); if (!isset($_GET['Id'])) { @@ -38,13 +38,13 @@ //first off validate inputs sensible if (isset($_POST['Con_ID']) and !is_long((integer)$_POST['Con_ID'])) { $InputError = 1; - prnMsg( _('The Contact must be an integer.'), 'error'); + prnMsg( _('The Contact ID must be an integer.'), 'error'); } elseif (strlen($_POST['conName']) >40) { $InputError = 1; - prnMsg( _("The contact's name must be forty characters or less long"), 'error'); + prnMsg( _('The contact name must be forty characters or less long'), 'error'); } elseif( trim($_POST['conName']) == '' ) { $InputError = 1; - prnMsg( _("The contact's name may not be empty"), 'error'); + prnMsg( _('The contact name may not be empty'), 'error'); } if (isset($Id) and ($Id and $InputError !=1)) { @@ -72,11 +72,11 @@ if ($InputError !=1) { $result = DB_query($sql,$db); - //echo '<br>'.$sql; + //echo '<br />'.$sql; - echo '<br>'; + echo '<br />'; prnMsg($msg, 'success'); - echo '<br>'; + echo '<br />'; unset($Id); unset($_POST['conName']); unset($_POST['conRole']); @@ -92,9 +92,9 @@ $sql="DELETE FROM custcontacts WHERE contid=".$Id." and debtorno='".$DebtorNo."'"; $result = DB_query($sql,$db); - //echo '<br>'.$sql; + //echo '<br />'.$sql; - echo '<br>'; + echo '<br />'; prnMsg( _('The contact record has been deleted'), 'success'); unset($Id); unset($_GET['delete']); @@ -105,7 +105,7 @@ $sql = "SELECT * FROM custcontacts where debtorno='".$DebtorNo."' ORDER BY contid"; $result = DB_query($sql,$db); - //echo '<br>'.$sql; + //echo '<br />'.$sql; echo '<table class=selection>'; echo '<tr> @@ -153,7 +153,7 @@ <?php if (!isset($_GET['delete'])) { - echo '<form method="post" action="' . $_SERVER['PHP_SELF'] . '?' . SID . '&DebtorNo='.$DebtorNo.'">'; + echo '<form method="post" action="' . $_SERVER['PHP_SELF'] . '?DebtorNo='.$DebtorNo.'">'; echo '<input type="hidden" name="FormID" value="' . $_SESSION['FormID'] . '" />'; if (isset($Id)) { @@ -163,7 +163,7 @@ and debtorno='".$DebtorNo."'"; $result = DB_query($sql, $db); - //echo '<br>'.$sql; + //echo '<br />'.$sql; $myrow = DB_fetch_array($result); Modified: trunk/AuditTrail.php =================================================================== --- trunk/AuditTrail.php 2011-04-10 10:41:20 UTC (rev 4545) +++ trunk/AuditTrail.php 2011-04-11 10:33:34 UTC (rev 4546) @@ -2,8 +2,6 @@ /* $Id$ */ -//$PageSecurity=15; - include('includes/session.inc'); $title = _('Audit Trail'); @@ -25,12 +23,12 @@ } // Get list of tables -$tableresult = DB_show_tables($db); +$TableResult = DB_show_tables($db); // Get list of users -$userresult = DB_query('SELECT userid FROM www_users',$db); +$UserResult = DB_query("SELECT userid FROM www_users",$db); -echo '<form action=' . $_SERVER['PHP_SELF'] . '?' . SID . ' method=post>'; +echo '<form action="' . $_SERVER['PHP_SELF'] . '" method="post">'; echo '<input type="hidden" name="FormID" value="' . $_SESSION['FormID'] . '" />'; echo '<table class=selection>'; @@ -43,29 +41,29 @@ echo '<tr><td>'. _('User ID'). '</td> <td><select tabindex="3" name="SelectedUser">'; echo '<option value=ALL>ALL'; -while ($users = DB_fetch_row($userresult)) { +while ($users = DB_fetch_row($UserResult)) { if (isset($_POST['SelectedUser']) and $users[0]==$_POST['SelectedUser']) { - echo '<option selected value=' . $users[0] . '>' . $users[0]; + echo '<option selected value=' . $users[0] . '>' . $users[0] . '</option>'; } else { - echo '<option value=' . $users[0] . '>' . $users[0]; + echo '<option value=' . $users[0] . '>' . $users[0] . '</option>'; } } echo '</select></td></tr>'; // Show table selections echo '<tr><td>'. _('Table '). '</td><td><select tabindex="4" name="SelectedTable">'; -echo '<option value=ALL>ALL'; -while ($tables = DB_fetch_row($tableresult)) { +echo '<option value="ALL">' . _('ALL') . '</option>'; +while ($tables = DB_fetch_row($TableResult)) { if (isset($_POST['SelectedTable']) and $tables[0]==$_POST['SelectedTable']) { - echo '<option selected value=' . $tables[0] . '>' . $tables[0]; + echo '<option selected value=' . $tables[0] . '>' . $tables[0] . '</option>'; } else { - echo '<option value=' . $tables[0] . '>' . $tables[0]; + echo '<option value=' . $tables[0] . '>' . $tables[0] . '</option>'; } } echo '</select></td></tr>'; echo '</table><br />'; -echo "<div class=centre><input tabindex='5' type=submit name=View value='" . _('View') . "'></div>"; +echo '<div class="centre"><input tabindex="5" type="submit" name="View" value="' . _('View') . '"></div>'; echo '</form>'; // View the audit trail @@ -112,12 +110,12 @@ } function DeleteQueryInfo($SQLString) { - $SQLArray = explode('WHERE', $SQLString); + $SQLArray = explode("WHERE", $SQLString); $_SESSION['SQLString']['table'] = $SQLArray[0]; $SQLString = trim(str_replace($SQLArray[0], '', $SQLString)); - $SQLString = trim(str_replace('DELETE', '', $SQLString)); - $SQLString = trim(str_replace('FROM', '', $SQLString)); - $SQLString = trim(str_replace('WHERE', '', $SQLString)); + $SQLString = trim(str_replace("DELETE", '', $SQLString)); + $SQLString = trim(str_replace("FROM", '', $SQLString)); + $SQLString = trim(str_replace("WHERE", '', $SQLString)); $Assigment = explode('=', $SQLString); $_SESSION['SQLString']['fields'][0] = $Assigment[0]; $_SESSION['SQLString']['values'][0] = $Assigment[1]; @@ -148,16 +146,16 @@ <th>' . _('Field Name') . '</th> <th>' . _('Value') . '</th></tr>'; while ($myrow = DB_fetch_row($result)) { - if (Query_Type($myrow[2]) == 'INSERT') { + if (Query_Type($myrow[2]) == "INSERT") { InsertQueryInfo(str_replace("INSERT INTO",'',$myrow[2])); $RowColour = '#a8ff90'; } - if (Query_Type($myrow[2]) == 'UPDATE') { - UpdateQueryInfo(str_replace('UPDATE','',$myrow[2])); + if (Query_Type($myrow[2]) == "UPDATE") { + UpdateQueryInfo(str_replace("UPDATE",'',$myrow[2])); $RowColour = '#feff90'; } - if (Query_Type($myrow[2]) == 'DELETE') { - DeleteQueryInfo(str_replace('DELETE FROM','',$myrow[2])); + if (Query_Type($myrow[2]) == "DELETE") { + DeleteQueryInfo(str_replace("DELETE FROM",'',$myrow[2])); $RowColour = '#fe90bf'; } Modified: trunk/GLBudgets.php =================================================================== --- trunk/GLBudgets.php 2011-04-10 10:41:20 UTC (rev 4545) +++ trunk/GLBudgets.php 2011-04-11 10:33:34 UTC (rev 4546) @@ -33,10 +33,10 @@ echo '</br><tr><td>'. _('Select GL Account'). ":</td><td><select name='SelectedAccount' onChange='ReloadForm(selectaccount.Select)'>"; -$SQL = 'SELECT accountcode, +$SQL = "SELECT accountcode, accountname FROM chartmaster - ORDER BY accountcode'; + ORDER BY accountcode"; $result=DB_query($SQL,$db); if (DB_num_rows($result)==0){ @@ -215,12 +215,12 @@ echo '<script>defaultControl(document.form.1next);</script>'; echo '</br><div class="centre"><input type="submit" name=update value="' . _('Update') . '"></div></form>'; - $SQL='SELECT MIN(periodno) FROM periods'; + $SQL="SELECT MIN(periodno) FROM periods"; $result=DB_query($SQL,$db); $MyRow=DB_fetch_array($result); $FirstPeriod=$MyRow[0]; - $SQL='SELECT MAX(periodno) FROM periods'; + $SQL="SELECT MAX(periodno) FROM periods"; $result=DB_query($SQL,$db); $MyRow=DB_fetch_array($result); $LastPeriod=$MyRow[0]; Modified: trunk/PcAuthorizeExpenses.php =================================================================== --- trunk/PcAuthorizeExpenses.php 2011-04-10 10:41:20 UTC (rev 4545) +++ trunk/PcAuthorizeExpenses.php 2011-04-11 10:33:34 UTC (rev 4546) @@ -1,7 +1,6 @@ <?php -/* $Revision: 1.0 $ */ -//$PageSecurity = 6; +/* $Id$ */ include('includes/session.inc'); $title = _('Authorization of Petty Cash Expenses'); @@ -41,16 +40,16 @@ } if (isset($_POST['submit']) or isset($_POST['update']) OR isset($SelectedTabs) OR isset ($_POST['GO'])) { - echo "<form method='post' action=" . $_SERVER['PHP_SELF'] . '?' . SID . '>'; + echo '<form method="post" action="' . $_SERVER['PHP_SELF'] . '">'; echo '<input type="hidden" name="FormID" value="' . $_SESSION['FormID'] . '" />'; if(!isset ($Days)){ $Days=30; } - echo "<input type=hidden name='SelectedTabs' VALUE=" . $SelectedTabs . ">"; + echo '<input type="hidden" name="SelectedTabs" value="' . $SelectedTabs . '">'; echo '<br><table class=selection>'; - echo "<tr><th colspan=7>" . _('Detail Of Movement For Last ') .': '; - echo "<input type=text class=number name='Days' VALUE=" . $Days . " MAXLENGTH =3 size=4> Days "; + echo '<tr><th colspan="7">' . _('Detail Of Movement For Last ') .': '; + echo '<input type="text" class="number" name="Days" value="' . $Days . '" maxlength ="3" size="4"> ' ._('Days'); echo '<input type=submit name="Go" value="' . _('Go') . '"></tr></th>'; echo '</form>'; @@ -77,15 +76,15 @@ $result = DB_query($sql,$db); - echo "<tr> - <th>" . _('Date') . "</th> - <th>" . _('Expense Code') . "</th> - <th>" . _('Amount') . "</th> - <th>" . _('Posted') . "</th> - <th>" . _('Notes') . "</th> - <th>" . _('Receipt') . "</th> - <th>" . _('Authorized') . "</th> - </tr>"; + echo '<tr> + <th>' . _('Date') . '</th> + <th>' . _('Expense Code') . '</th> + <th>' . _('Amount') . '</th> + <th>' . _('Posted') . '</th> + <th>' . _('Notes') . '</th> + <th>' . _('Receipt') . '</th> + <th>' . _('Authorized') . '</th> + </tr>'; $k=0; //row colour counter echo'<form action="PcAuthorizeExpenses.php" method="POST" name="'._('update').'">'; @@ -94,7 +93,7 @@ while ($myrow=DB_fetch_array($result)) { //update database if update pressed - if ((isset($_POST['submit']) and $_POST['submit']==_('Update')) AND isset($_POST[$myrow['counterindex']])){ + if ((isset($_POST['submit']) AND $_POST['submit']==_('Update')) AND isset($_POST[$myrow['counterindex']])){ $PeriodNo = GetPeriod(ConvertSQLDate($myrow['date']), $db); @@ -124,7 +123,7 @@ $typeno = GetNextTransNo($type,$db); //build narrative - $narrative= "PettyCash - ".$myrow['tabcode']." - ".$myrow['codeexpense']." - ".$myrow['notes']." - ".$myrow['receipt'].""; + $narrative= _('PettyCash') . ' - ' . $myrow['tabcode'] . ' - ' . $myrow['codeexpense'] . ' - ' . DB_escape_string($myrow['notes']) . ' - '.$myrow['receipt']; //insert to gltrans DB_Txn_Begin($db); Modified: trunk/PcExpensesTypeTab.php =================================================================== --- trunk/PcExpensesTypeTab.php 2011-04-10 10:41:20 UTC (rev 4545) +++ trunk/PcExpensesTypeTab.php 2011-04-11 10:33:34 UTC (rev 4546) @@ -1,7 +1,6 @@ <?php -/* $Revision: 1.0 $ */ -//$PageSecurity = 15; +/* $Id$ */ include('includes/session.inc'); $title = _('Maintenance Of Petty Cash Expenses For a Type Tab'); @@ -14,6 +13,8 @@ $SelectedType = strtoupper($_POST['SelectedType']); } elseif (isset($_GET['SelectedType'])){ $SelectedType = strtoupper($_GET['SelectedType']); +} else { + $SelectedType=''; } if (ContainsIllegalCharacters($SelectedType) OR strpos($SelectedType,' ')>0){ $InputError = 1; @@ -58,7 +59,7 @@ VALUES ('" . $_POST['SelectedTabs'] . "', '" . $_POST['SelectedExpense'] . "')"; - $msg = _('Expense code:') . ' ' . $_POST["SelectedExpense"].' '._('for Type of Tab:') .' '. $_POST["SelectedTabs"] . ' ' . _('has been created'); + $msg = _('Expense code:') . ' ' . $_POST['SelectedExpense'].' '._('for Type of Tab:') .' '. $_POST['SelectedTabs'] . ' ' . _('has been created'); $checkSql = "SELECT count(typetabcode) FROM pctypetabs"; $result = DB_query($checkSql, $db); @@ -96,25 +97,26 @@ then none of the above are true and the list of sales types 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 "<form method='post' action=" . $_SERVER['PHP_SELF'] . '?' . SID . '>'; -echo '<input type="hidden" name="FormID" value="' . $_SESSION['FormID'] . '" />'; -echo '<table class=selection>'; //Main table + echo '<form method="post" action="' . $_SERVER['PHP_SELF'] . '">'; + echo '<input type="hidden" name="FormID" value="' . $_SESSION['FormID'] . '" />'; + echo '<table class=selection>'; //Main table + + echo '<tr><td>' . _('Select Type of Tab') . ':</td><td><select name="SelectedTabs">'; -echo '<tr><td>' . _('Select Type of Tab') . ":</td><td><select name='SelectedTabs'>"; - DB_free_result($result); - $SQL = "SELECT typetabcode,typetabdescription - FROM pctypetabs"; + $SQL = "SELECT typetabcode, + typetabdescription + FROM pctypetabs"; $result = DB_query($SQL,$db); while ($myrow = DB_fetch_array($result)) { if (isset($_POST['SelectedTabs']) and $myrow['typetabcode']==$_POST['SelectedTabs']) { - echo "<option selected VALUE='"; + echo '<option selected value="'; } else { - echo "<option VALUE='"; + echo '<option VALUE="'; } - echo $myrow['typetabcode'] . "'>" . $myrow['typetabcode'] . ' - ' . $myrow['typetabdescription']; + echo $myrow['typetabcode'] . '">' . $myrow['typetabcode'] . ' - ' . $myrow['typetabdescription'] . '</option>'; } //end while loop @@ -142,11 +144,11 @@ $result = DB_query($sql,$db); - echo '<table class=selection>'; - echo "<tr> - <th>" . _('Expense Code') . "</th> - <th>" . _('Description') . "</th> - </tr>"; + echo '<table class="selection">'; + echo '<tr> + <th>' . _('Expense Code') . '</th> + <th>' . _('Description') . '</th> + </tr>'; $k=0; //row colour counter @@ -176,47 +178,44 @@ if (! isset($_GET['delete'])) { - echo "<form method='post' action=" . $_SERVER['PHP_SELF'] . '>'; - echo '<input type="hidden" name="FormID" value="' . $_SESSION['FormID'] . '" />'; - echo '<br /><table class=selection>'; //Main table - - - - echo '<tr><td>' . _('Select Expense Code') . ":</td><td><select name='SelectedExpense'>"; - - DB_free_result($result); - $SQL = "SELECT codeexpense,description - FROM pcexpenses"; - - $result = DB_query($SQL,$db); - - while ($myrow = DB_fetch_array($result)) { - if (isset($_POST['SelectedExpense']) and $myrow['codeexpense']==$_POST['SelectedExpense']) { - echo "<option selected VALUE='"; - } else { - echo "<option VALUE='"; - } - echo $myrow['codeexpense'] . "'>" . $myrow['codeexpense'] . ' - ' . $myrow['description']; - - } //end while loop - - echo '</select></td></tr>'; - - - echo "<input type=hidden name='SelectedTabs' VALUE=" . $SelectedTabs . ">"; - - 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>'; - - echo '</form>'; - -} // end if user wish to delete - - + echo '<form method="post" action="' . $_SERVER['PHP_SELF'] . '">'; + echo '<input type="hidden" name="FormID" value="' . $_SESSION['FormID'] . '" />'; + echo '<br /><table class="selection">'; //Main table + + + + echo '<tr><td>' . _('Select Expense Code') . ':</td><td><select name="SelectedExpense">'; + + DB_free_result($result); + $SQL = "SELECT codeexpense, + description + FROM pcexpenses"; + + $result = DB_query($SQL,$db); + + while ($myrow = DB_fetch_array($result)) { + if (isset($_POST['SelectedExpense']) and $myrow['codeexpense']==$_POST['SelectedExpense']) { + echo '<option selected value="'; + } else { + echo '<option value="'; + } + echo $myrow['codeexpense'] . '">' . $myrow['codeexpense'] . ' - ' . $myrow['description'] . '</option>'; + + } //end while loop + + echo '</select></td></tr>'; + + + echo '<input type="hidden" name="SelectedTabs" value="' . $SelectedTabs . '">'; + + 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>'; + + echo '</form>'; + + } // end if user wish to delete } - - include('includes/footer.inc'); ?> \ No newline at end of file Modified: trunk/PcTypeTabs.php =================================================================== --- trunk/PcTypeTabs.php 2011-04-10 10:41:20 UTC (rev 4545) +++ trunk/PcTypeTabs.php 2011-04-11 10:33:34 UTC (rev 4546) @@ -1,8 +1,6 @@ <?php /* $Id$ */ -//$PageSecurity = 15; - include('includes/session.inc'); $title = _('Maintenance Of Petty Cash Type of Tabs'); include('includes/header.inc'); @@ -125,7 +123,7 @@ echo '<br>'; echo '<form method="post" action="' . $_SERVER['PHP_SELF'] . '">'; echo '<input type="hidden" name="FormID" value="' . $_SESSION['FormID'] . '" />'; - echo '<p><div class="centre"><input type=submit name=return VALUE="' . _('Return to list of tab types') . '"></div>'; + echo '<p><div class="centre"><input type=submit name=return value="' . _('Return to list of tab types') . '"></div>'; echo '</form>'; include('includes/footer.inc'); exit; @@ -190,7 +188,7 @@ } if (! isset($_GET['delete'])) { - echo "<form method='post' action=" . $_SERVER['PHP_SELF'] . '>'; + echo '<form method="post" action="' . $_SERVER['PHP_SELF'] . '">'; echo '<input type="hidden" name="FormID" value="' . $_SESSION['FormID'] . '" />'; echo '<p><table class=selection>'; //Main table @@ -220,19 +218,19 @@ // This is a new type so the user may volunteer a type code - echo "<table class=selection><tr><td>" . _('Code Of Type Of Tab') . ":</td><td><input type='Text' - " . (in_array('TypeTabCode',$Errors) ? 'class="inputerror"' : '' ) ." name='TypeTabCode'></td></tr>"; + echo '<table class="selection"><tr><td>' . _('Code Of Type Of Tab') . ':</td><td><input type="text" + ' . (in_array('TypeTabCode',$Errors) ? 'class="inputerror"' : '' ) .' name="TypeTabCode"></td></tr>'; } if (!isset($_POST['TypeTabDescription'])) { $_POST['TypeTabDescription']=''; } - echo "<tr><td>" . _('Description Of Type of Tab') . ":</td><td><input type='Text' name='TypeTabDescription' size=50 maxlength=49 value='" . $_POST['TypeTabDescription'] . "'></td></tr>"; + echo '<tr><td>' . _('Description Of Type of Tab') . ':</td><td><input type="text" name="TypeTabDescription" size="50" maxlength="49" value="' . $_POST['TypeTabDescription'] . '"></td></tr>'; 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>'; + echo '<p><div class="centre"><input type=submit name=submit value="' . _('Accept') . '"><input type=submit name="Cancel" VALUE="' . _('Cancel') . '"></div>'; echo '</form>'; Modified: trunk/SelectSalesOrder.php =================================================================== --- trunk/SelectSalesOrder.php 2011-04-10 10:41:20 UTC (rev 4545) +++ trunk/SelectSalesOrder.php 2011-04-11 10:33:34 UTC (rev 4546) @@ -417,10 +417,11 @@ if (!isset($_REQUEST['OrderNumber']) or $_REQUEST['OrderNumber']==''){ 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'> "; + 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'; + $sql = "SELECT loccode, locationname FROM locations"; $resultStkLocs = DB_query($sql,$db); @@ -459,10 +460,10 @@ _('Add Sales Order') . '</a></td></tr></table>'; } - $SQL='SELECT categoryid, + $SQL="SELECT categoryid, categorydescription FROM stockcategory - ORDER BY categorydescription'; + ORDER BY categorydescription"; $result1 = DB_query($SQL,$db); Modified: trunk/StockLocTransfer.php =================================================================== --- trunk/StockLocTransfer.php 2011-04-10 10:41:20 UTC (rev 4545) +++ trunk/StockLocTransfer.php 2011-04-11 10:33:34 UTC (rev 4546) @@ -1,8 +1,6 @@ <?php /* $Id$*/ -/* contributed by Chris Bice */ -//$PageSecurity = 11; include('includes/session.inc'); $title = _('Inventory Location Transfer Shipment'); include('includes/header.inc'); @@ -17,7 +15,7 @@ $result = DB_query("SELECT * FROM loctransfers WHERE reference='" . $_POST['Trf_ID'] . "'",$db); if (DB_num_rows($result)!=0){ $InputError = true; - $ErrorMessage = _('This transaction has already been entered') . '. ' . _('Please start over now').'<br>'; + $ErrorMessage = _('This transaction has already been entered') . '. ' . _('Please start over now').'<br />'; unset($_POST['submit']); unset($_POST['EnterMoreItems']); for ($i=$_POST['LinesCounter']-10;$i<$_POST['LinesCounter'];$i++){ @@ -33,19 +31,19 @@ $myrow = DB_fetch_row($result); if ($myrow[0]==0){ $InputError = True; - $ErrorMessage .= _('The part code entered of'). ' ' . $_POST['StockID' . $i] . ' '. _('is not set up in the database') . '. ' . _('Only valid parts can be entered for transfers'). '<br>'; + $ErrorMessage .= _('The part code entered of'). ' ' . $_POST['StockID' . $i] . ' '. _('is not set up in the database') . '. ' . _('Only valid parts can be entered for transfers'). '<br />'; $_POST['LinesCounter'] -= 10; } DB_free_result( $result ); if (!is_numeric($_POST['StockQTY' . $i])){ $InputError = True; - $ErrorMessage .= _('The quantity entered of'). ' ' . $_POST['StockQTY' . $i] . ' '. _('for part code'). ' ' . $_POST['StockID' . $i] . ' '. _('is not numeric') . '. ' . _('The quantity entered for transfers is expected to be numeric').'<br>'; + $ErrorMessage .= _('The quantity entered of'). ' ' . $_POST['StockQTY' . $i] . ' '. _('for part code'). ' ' . $_POST['StockID' . $i] . ' '. _('is not numeric') . '. ' . _('The quantity entered for transfers is expected to be numeric').'<br />'; $_POST['LinesCounter'] -= 10; } if ($_POST['StockQTY' . $i] <= 0){ $InputError = True; - $ErrorMessage .= _('The quantity entered for').' '. $_POST['StockID' . $i] . ' ' . _('is less than or equal to 0') . '. ' . _('Please correct this or remove the item').'<br>'; - + $ErrorMessage .= _('The quantity entered for').' '. $_POST['StockID' . $i] . ' ' . _('is less than or equal to 0') . '. ' . _('Please correct this or remove the item').'<br />'; + $_POST['LinesCounter'] -= 10; } // Only if stock exists at this location $result = DB_query("SELECT quantity FROM locstock WHERE stockid='" . $_POST['StockID' . $i] . "' and loccode='".$_POST['FromStockLocation']."'",$db); @@ -61,7 +59,7 @@ }//for all LinesCounter if ($TotalItems == 0){ $InputError = True; - $ErrorMessage .= _('You must enter at least 1 Stock Item to transfer').'<br>'; + $ErrorMessage .= _('You must enter at least 1 Stock Item to transfer').'<br />'; } /*Ship location and Receive location are different */ @@ -122,10 +120,10 @@ } if (isset($InputError) and $InputError==true){ - echo '<br>'; + echo '<br />'; prnMsg($ErrorMessage, 'error'); - echo '<br>'; + echo '<br />'; } @@ -215,8 +213,8 @@ $i++; } - echo '</table><br><div class="centre"> - <input type=hidden name="LinesCounter" value='. $i .'><input type=submit name="EnterMoreItems" value="'. _('Add More Items'). '"><input type=submit name="Submit" value="'. _('Create Transfer Shipment'). '"><br>'; + echo '</table><br /><div class="centre"> + <input type=hidden name="LinesCounter" value='. $i .'><input type=submit name="EnterMoreItems" value="'. _('Add More Items'). '"><input type=submit name="Submit" value="'. _('Create Transfer Shipment'). '"><br />'; echo '<script type="text/javascript">defaultControl(document.forms[0].StockID0);</script>'; echo '</form></div>'; include('includes/footer.inc'); Modified: trunk/TopItems.php =================================================================== --- trunk/TopItems.php 2011-04-10 10:41:20 UTC (rev 4545) +++ trunk/TopItems.php 2011-04-11 10:33:34 UTC (rev 4546) @@ -11,9 +11,9 @@ if (!(isset($_POST['Search']))) { echo '<p class="page_title_text"><img src="' . $rootpath . '/css/' . $theme . '/images/magnifier.png" title="' . _('Top Sales Order Search') . '" alt="" />' . ' ' . _('Top Sales Order Search') . '</p>'; - echo "<form action=" . $_SERVER['PHP_SELF'] . '?' . SID . ' name="SelectCustomer" method=POST>'; + echo '<form action="' . $_SERVER['PHP_SELF'] . '?name="SelectCustomer" method="POST">'; echo '<input type="hidden" name="FormID" value="' . $_SESSION['FormID'] . '" />'; - echo '<table cellpadding=3 colspan=4 class=selection>'; + echo '<table cellpadding="3" colspan="4" class="selection">'; //to view store location echo '<tr><td width="150">' . _('Select Location') . ' </td><td>:</td><td><select name=Location>'; $sql = "SELECT loccode, @@ -83,7 +83,7 @@ AND salesorderdetails.stkcode = stockmaster.stockid AND salesorders.debtorno = debtorsmaster.debtorno AND debtorsmaster.currcode = currencies.currabrev - AND salesorderdetails.ActualDispatchDate >= '" . $FromDate . "' + AND salesorderdetails.actualdispatchdate >= '" . $FromDate . "' GROUP BY salesorderdetails.stkcode ORDER BY '" . $_POST['Sequence'] . "' DESC LIMIT " . $_POST['NumberOfTopItems'] . ""; @@ -104,7 +104,7 @@ AND salesorders.debtorno = debtorsmaster.debtorno AND debtorsmaster.currcode = currencies.currabrev AND debtorsmaster.typeid = '" . $_POST['Customers'] . "' - AND salesorderdetails.ActualDispatchDate >= '" . $FromDate . "' + AND salesorderdetails.actualdispatchdate >= '" . $FromDate . "' GROUP BY salesorderdetails.stkcode ORDER BY '" . $_POST['Sequence'] . "' DESC LIMIT " . $_POST[NumberOfTopItems] . ""; @@ -112,44 +112,44 @@ //the situation if the customer type selected "All" if ($_POST['Customers'] == 'All') { $SQL = "SELECT salesorderdetails.stkcode, - SUM(salesorderdetails.qtyinvoiced) TotalInvoiced, - SUM(salesorderdetails.qtyinvoiced * salesorderdetails.unitprice ) AS ValueSales, - stockmaster.description, - stockmaster.units, - currencies.rate, - debtorsmaster.currcode, - stockmaster.decimalplaces - FROM salesorderdetails, salesorders, debtorsmaster,stockmaster, currencies - WHERE salesorderdetails.orderno = salesorders.orderno - AND salesorderdetails.stkcode = stockmaster.stockid - AND salesorders.debtorno = debtorsmaster.debtorno - AND debtorsmaster.currcode = currencies.currabrev - AND salesorders.fromstkloc = '" . $_POST['Location'] . "' - AND salesorderdetails.ActualDispatchDate >= '" . $FromDate . "' - GROUP BY salesorderdetails.stkcode - ORDER BY " . $_POST['Sequence'] . " DESC - LIMIT " . $_POST['NumberOfTopItems'] . ""; + SUM(salesorderdetails.qtyinvoiced) TotalInvoiced, + SUM(salesorderdetails.qtyinvoiced * salesorderdetails.unitprice ) AS ValueSales, + stockmaster.description, + stockmaster.units, + currencies.rate, + debtorsmaster.currcode, + stockmaster.decimalplaces + FROM salesorderdetails, salesorders, debtorsmaster,stockmaster, currencies + WHERE salesorderdetails.orderno = salesorders.orderno + AND salesorderdetails.stkcode = stockmaster.stockid + AND salesorders.debtorno = debtorsmaster.debtorno + AND debtorsmaster.currcode = currencies.currabrev + AND salesorders.fromstkloc = '" . $_POST['Location'] . "' + AND salesorderdetails.actualdispatchdate >= '" . $FromDate . "' + GROUP BY salesorderdetails.stkcode + ORDER BY " . $_POST['Sequence'] . " DESC + LIMIT " . $_POST['NumberOfTopItems'] . ""; } else { //the situation if the location and customer type not selected "All" $SQL = "SELECT salesorderdetails.stkcode, - SUM(salesorderdetails.qtyinvoiced) TotalInvoiced, - SUM(salesorderdetails.qtyinvoiced * salesorderdetails.unitprice ) AS ValueSales, - stockmaster.description, - stockmaster.units, - currencies.rate, - debtorsmaster.currcode, - stockmaster.decimalplaces - FROM salesorderdetails, salesorders, debtorsmaster,stockmaster, currencies - WHERE salesorderdetails.orderno = salesorders.orderno - AND salesorderdetails.stkcode = stockmaster.stockid - AND salesorders.debtorno = debtorsmaster.debtorno - AND debtorsmaster.currcode = currencies.currabrev - AND salesorders.fromstkloc = '" . $_POST['Location'] . "' - AND debtorsmaster.typeid = '" . $_POST['Customers'] . "' - AND salesorderdetails.ActualDispatchDate >= '" . $FromDate . "' - GROUP BY salesorderdetails.stkcode - ORDER BY '" . $_POST['Sequence'] . "' DESC - LIMIT " . $_POST['NumberOfTopItems'] . ""; + SUM(salesorderdetails.qtyinvoiced) TotalInvoiced, + SUM(salesorderdetails.qtyinvoiced * salesorderdetails.unitprice ) AS ValueSales, + stockmaster.description, + stockmaster.units, + currencies.rate, + debtorsmaster.currcode, + stockmaster.decimalplaces + FROM salesorderdetails, salesorders, debtorsmaster,stockmaster, currencies + WHERE salesorderdetails.orderno = salesorders.orderno + AND salesorderdetails.stkcode = stockmaster.stockid + AND salesorders.debtorno = debtorsmaster.debtorno + AND debtorsmaster.currcode = currencies.currabrev + AND salesorders.fromstkloc = '" . $_POST['Location'] . "' + AND debtorsmaster.typeid = '" . $_POST['Customers'] . "' + AND salesorderdetails.actualdispatchdate >= '" . $FromDate . "' + GROUP BY salesorderdetails.stkcode + ORDER BY '" . $_POST['Sequence'] . "' DESC + LIMIT " . $_POST['NumberOfTopItems'] . ""; } } } Modified: trunk/UserSettings.php =================================================================== --- trunk/UserSettings.php 2011-04-10 10:41:20 UTC (rev 4545) +++ trunk/UserSettings.php 2011-04-11 10:33:34 UTC (rev 4546) @@ -97,7 +97,7 @@ } } -echo "<form method='post' action=" . $_SERVER['PHP_SELF'] . '?' . SID . '>'; +echo '<form method="post" action="' . $_SERVER['PHP_SELF'] . '">'; echo '<input type="hidden" name="FormID" value="' . $_SESSION['FormID'] . '" />'; If (!isset($_POST['DisplayRecordsMax']) OR $_POST['DisplayRecordsMax']=='') { @@ -114,20 +114,19 @@ <input type="hidden" name="RealName" VALUE="'.$_SESSION['UsersRealName'].'"<td></tr>'; echo '<tr> - <td>' . _('Maximum Number of Records to Display') . ":</td> - <td><input type='Text' class='number' name='DisplayRecordsMax' size=3 maxlength=3 VALUE=" . $_POST['DisplayRecordsMax'] . " ></td> - </tr>"; + <td>' . _('Maximum Number of Records to Display') . ':</td> + <td><input type="text" class="number" name="DisplayRecordsMax" size="3" maxlength="3" value="' . $_POST['DisplayRecordsMax'] . '" ></td> + </tr>'; echo '<tr> - <td>' . _('Language') . ":</td> - <td><select name='Language'>"; + <td>' . _('Language') . ':</td> + <td><select name="Language">'; - $LangDirHandle = dir('locale/'); + $Languages = scandir('locale/', 0); - - while (false != ($LanguageEntry = $LangDirHandle->read())){ - + foreach ($Languages as $LanguageEntry){ + if (is_dir('locale/' . $LanguageEntry) AND $LanguageEntry != '..' AND $LanguageEntry != '.svn' Modified: trunk/WWW_Users.php =================================================================== --- trunk/WWW_Users.php 2011-04-10 10:41:20 UTC (rev 4545) +++ trunk/WWW_Users.php 2011-04-11 10:33:34 UTC (rev 4546) @@ -574,13 +574,15 @@ <td>' . _('Language') . ':</td> <td><select name="UserLanguage">'; - $LangDirHandle = dir('locale/'); +$Languages = scandir('locale/', 0); +foreach ($Languages as $LanguageEntry){ + + if (is_dir('locale/' . $LanguageEntry) + AND $LanguageEntry != '..' + AND $LanguageEntry != '.svn' + AND $LanguageEntry!='.'){ -while (false != ($LanguageEntry = $LangDirHandle->read())){ - - if (is_dir('locale/' . $LanguageEntry) AND $LanguageEntry != '..' AND $LanguageEntry != 'CVS' AND $LanguageEntry!='.'){ - if (isset($_POST['UserLanguage']) and $_POST['UserLanguage'] == $LanguageEntry){ echo '<option selected value="' . $LanguageEntry . '">' . $LanguageEntry .'</option>'; } elseif (!isset($_POST['UserLanguage']) and $LanguageEntry == $DefaultLanguage) { @@ -591,6 +593,8 @@ } } + + echo '</select></td></tr>'; Modified: trunk/api/api_workorders.php =================================================================== --- trunk/api/api_workorders.php 2011-04-10 10:41:20 UTC (rev 4545) +++ trunk/api/api_workorders.php 2011-04-11 10:33:34 UTC (rev 4546) @@ -44,7 +44,7 @@ } function VerifyRequiredByDate($RequiredByDate, $i, $Errors, $db) { - $sql="select confvalue from config where confname='DefaultDateFormat'"; + $sql="SELECT confvalue FROM config WHERE confname='DefaultDateFormat'"; $result=DB_query($sql, $db); $myrow=DB_fetch_array($result); $DateFormat=$myrow[0]; @@ -77,7 +77,7 @@ } function VerifyStartDate($StartDate, $i, $Errors, $db) { - $sql="select confvalue from config where confname='DefaultDateFormat'"; + $sql="SELECT confvalue FROM config WHERE confname='DefaultDateFormat'"; $result=DB_query($sql, $db); $myrow=DB_fetch_array($result); $DateFormat=$myrow[0]; @@ -310,37 +310,37 @@ '".$newqoh."', '".$cost."', '".$cost."')"; - $locstocksql='UPDATE locstock SET quantity = quantity + '.$Quantity." - WHERE loccode='". $Location."' - AND stockid='".$StockID."'"; + $locstocksql="UPDATE locstock SET quantity = quantity + " . $Quantity ." + WHERE loccode='". $Location."' + AND stockid='".$StockID."'"; $glupdatesql1="INSERT INTO gltrans (type, - typeno, - trandate, - periodno, - account, - amount, - narrative) - VALUES (28, - '".$TransactionNo. "', - '".$TranDate."', - '".GetPeriodFromTransactionDate($TranDate, sizeof($Errors), $Errors, $db)."', - '".$wipglact."', - '".$cost*-$Quantity."', - '".$StockID.' x '.$Quantity.' @ '.$cost."')"; + typeno, + trandate, + periodno, + account, + amount, + narrative) + VALUES (28, + '".$TransactionNo. "', + '".$TranDate."', + '".GetPeriodFromTransactionDate($TranDate, sizeof($Errors), $Errors, $db)."', + '".$wipglact."', + '".$cost*-$Quantity."', + '".$StockID.' x '.$Quantity.' @ '.$cost."')"; $glupdatesql2="INSERT INTO gltrans (type, - typeno, - trandate, - periodno, - account, - amount, - narrative) - VALUES (28, - '".$TransactionNo."', - '".$TranDate."', - '".GetPeriodFromTransactionDate($TranDate, sizeof($Errors), $Errors, $db)."', - '".$stockact."', - '".$cost*$Quantity."', - '".$StockID.' x '.$Quantity.' @ '.$cost."')"; + typeno, + trandate, + periodno, + account, + amount, + narrative) + VALUES (28, + '".$TransactionNo."', + '".$TranDate."', + '".GetPeriodFromTransactionDate($TranDate, sizeof($Errors), $Errors, $db)."', + '".$stockact."', + '".$cost*$Quantity."', + '".$StockID.' x '.$Quantity.' @ '.$cost."')"; $systypessql = "UPDATE systypes set typeno='".$TransactionNo."' where typeid=28"; $batchsql="UPDATE stockserialitems SET quantity=quantity-" . $Quantity. " WHERE stockid='".$StockID."' @@ -474,7 +474,7 @@ } $sql="SELECT wo FROM woitems - WHERE ".$Field." LIKE '%".$Criteria."%'"; + WHERE " . $Field ." " . LIKE . " '%".$Criteria."%'"; $result = DB_Query($sql, $db); $i=0; $WOList = array(); Modified: trunk/doc/Change.log.html =================================================================== --- trunk/doc/Change.log.html 2011-04-10 10:41:20 UTC (rev 4545) +++ trunk/doc/Change.log.html 2011-04-11 10:33:34 UTC (rev 4546) @@ -1,6 +1,9 @@ <p><font SIZE=4 COLOR=BLUE><b>webERP Change Log</b></font></p> <p /> -<p>10/4/11 Tim: +<p>11/4/11 Tim: pcAuthorizeExpenses.php DB_escape_string(notes)</p> +<p>11/4/11 Tim: StockLocTransfer.php added $_POST['LinesCounter'] -= 10;</p> +<p>11/4/11 Tim/Phil: Use PHP 5 specific scandir to sort languages into alphabetic order for UserSettings and WWW_Users language selection</p> +<p>10/4/11 Tim: AddCustomerContacts.php use single field rather than * in SQL></p> <p>10/4/11 Tim: GLAccountInquiry.php show None if no tag selected</p> <p>10/4/11 Tim : PDFPrintLabel.php javascript fix</p> <p>10/4/11 Tim: Add perishable to StockTransfer.php and PDFStockTransfer</p> This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <dai...@us...> - 2011-04-11 10:33:41
|
Revision: 4546 http://web-erp.svn.sourceforge.net/web-erp/?rev=4546&view=rev Author: daintree Date: 2011-04-11 10:33:34 +0000 (Mon, 11 Apr 2011) Log Message: ----------- to launchpad 4587-86 Modified Paths: -------------- trunk/AddCustomerContacts.php trunk/AuditTrail.php trunk/GLBudgets.php trunk/PcAuthorizeExpenses.php trunk/PcExpensesTypeTab.php trunk/PcTypeTabs.php trunk/SelectSalesOrder.php trunk/StockLocTransfer.php trunk/TopItems.php trunk/UserSettings.php trunk/WWW_Users.php trunk/api/api_workorders.php trunk/doc/Change.log.html Modified: trunk/AddCustomerContacts.php =================================================================== --- trunk/AddCustomerContacts.php 2011-04-10 10:41:20 UTC (rev 4545) +++ trunk/AddCustomerContacts.php 2011-04-11 10:33:34 UTC (rev 4546) @@ -1,5 +1,5 @@ <?php -/* $Revision: 1.6 $ */ + /* $Id$*/ include('includes/session.inc'); @@ -17,8 +17,8 @@ } elseif (isset($_GET['DebtorNo'])){ $DebtorNo = $_GET['DebtorNo']; } -echo "<a href='" . $rootpath . '/Customers.php?' . SID .'&DebtorNo='.$DebtorNo."'>" . _('Back to Customers') . '</a><br>'; -$SQLname="SELECT * from debtorsmaster where debtorno='" .$DebtorNo."'"; +echo "<a href='" . $rootpath . '/Customers.php?' . SID .'&DebtorNo='.$DebtorNo."'>" . _('Back to Customers') . '</a><br />'; +$SQLname="SELECT name FROM debtorsmaster where debtorno='" .$DebtorNo."'"; $Result = DB_query($SQLname,$db); $row = DB_fetch_array($Result); if (!isset($_GET['Id'])) { @@ -38,13 +38,13 @@ //first off validate inputs sensible if (isset($_POST['Con_ID']) and !is_long((integer)$_POST['Con_ID'])) { $InputError = 1; - prnMsg( _('The Contact must be an integer.'), 'error'); + prnMsg( _('The Contact ID must be an integer.'), 'error'); } elseif (strlen($_POST['conName']) >40) { $InputError = 1; - prnMsg( _("The contact's name must be forty characters or less long"), 'error'); + prnMsg( _('The contact name must be forty characters or less long'), 'error'); } elseif( trim($_POST['conName']) == '' ) { $InputError = 1; - prnMsg( _("The contact's name may not be empty"), 'error'); + prnMsg( _('The contact name may not be empty'), 'error'); } if (isset($Id) and ($Id and $InputError !=1)) { @@ -72,11 +72,11 @@ if ($InputError !=1) { $result = DB_query($sql,$db); - //echo '<br>'.$sql; + //echo '<br />'.$sql; - echo '<br>'; + echo '<br />'; prnMsg($msg, 'success'); - echo '<br>'; + echo '<br />'; unset($Id); unset($_POST['conName']); unset($_POST['conRole']); @@ -92,9 +92,9 @@ $sql="DELETE FROM custcontacts WHERE contid=".$Id." and debtorno='".$DebtorNo."'"; $result = DB_query($sql,$db); - //echo '<br>'.$sql; + //echo '<br />'.$sql; - echo '<br>'; + echo '<br />'; prnMsg( _('The contact record has been deleted'), 'success'); unset($Id); unset($_GET['delete']); @@ -105,7 +105,7 @@ $sql = "SELECT * FROM custcontacts where debtorno='".$DebtorNo."' ORDER BY contid"; $result = DB_query($sql,$db); - //echo '<br>'.$sql; + //echo '<br />'.$sql; echo '<table class=selection>'; echo '<tr> @@ -153,7 +153,7 @@ <?php if (!isset($_GET['delete'])) { - echo '<form method="post" action="' . $_SERVER['PHP_SELF'] . '?' . SID . '&DebtorNo='.$DebtorNo.'">'; + echo '<form method="post" action="' . $_SERVER['PHP_SELF'] . '?DebtorNo='.$DebtorNo.'">'; echo '<input type="hidden" name="FormID" value="' . $_SESSION['FormID'] . '" />'; if (isset($Id)) { @@ -163,7 +163,7 @@ and debtorno='".$DebtorNo."'"; $result = DB_query($sql, $db); - //echo '<br>'.$sql; + //echo '<br />'.$sql; $myrow = DB_fetch_array($result); Modified: trunk/AuditTrail.php =================================================================== --- trunk/AuditTrail.php 2011-04-10 10:41:20 UTC (rev 4545) +++ trunk/AuditTrail.php 2011-04-11 10:33:34 UTC (rev 4546) @@ -2,8 +2,6 @@ /* $Id$ */ -//$PageSecurity=15; - include('includes/session.inc'); $title = _('Audit Trail'); @@ -25,12 +23,12 @@ } // Get list of tables -$tableresult = DB_show_tables($db); +$TableResult = DB_show_tables($db); // Get list of users -$userresult = DB_query('SELECT userid FROM www_users',$db); +$UserResult = DB_query("SELECT userid FROM www_users",$db); -echo '<form action=' . $_SERVER['PHP_SELF'] . '?' . SID . ' method=post>'; +echo '<form action="' . $_SERVER['PHP_SELF'] . '" method="post">'; echo '<input type="hidden" name="FormID" value="' . $_SESSION['FormID'] . '" />'; echo '<table class=selection>'; @@ -43,29 +41,29 @@ echo '<tr><td>'. _('User ID'). '</td> <td><select tabindex="3" name="SelectedUser">'; echo '<option value=ALL>ALL'; -while ($users = DB_fetch_row($userresult)) { +while ($users = DB_fetch_row($UserResult)) { if (isset($_POST['SelectedUser']) and $users[0]==$_POST['SelectedUser']) { - echo '<option selected value=' . $users[0] . '>' . $users[0]; + echo '<option selected value=' . $users[0] . '>' . $users[0] . '</option>'; } else { - echo '<option value=' . $users[0] . '>' . $users[0]; + echo '<option value=' . $users[0] . '>' . $users[0] . '</option>'; } } echo '</select></td></tr>'; // Show table selections echo '<tr><td>'. _('Table '). '</td><td><select tabindex="4" name="SelectedTable">'; -echo '<option value=ALL>ALL'; -while ($tables = DB_fetch_row($tableresult)) { +echo '<option value="ALL">' . _('ALL') . '</option>'; +while ($tables = DB_fetch_row($TableResult)) { if (isset($_POST['SelectedTable']) and $tables[0]==$_POST['SelectedTable']) { - echo '<option selected value=' . $tables[0] . '>' . $tables[0]; + echo '<option selected value=' . $tables[0] . '>' . $tables[0] . '</option>'; } else { - echo '<option value=' . $tables[0] . '>' . $tables[0]; + echo '<option value=' . $tables[0] . '>' . $tables[0] . '</option>'; } } echo '</select></td></tr>'; echo '</table><br />'; -echo "<div class=centre><input tabindex='5' type=submit name=View value='" . _('View') . "'></div>"; +echo '<div class="centre"><input tabindex="5" type="submit" name="View" value="' . _('View') . '"></div>'; echo '</form>'; // View the audit trail @@ -112,12 +110,12 @@ } function DeleteQueryInfo($SQLString) { - $SQLArray = explode('WHERE', $SQLString); + $SQLArray = explode("WHERE", $SQLString); $_SESSION['SQLString']['table'] = $SQLArray[0]; $SQLString = trim(str_replace($SQLArray[0], '', $SQLString)); - $SQLString = trim(str_replace('DELETE', '', $SQLString)); - $SQLString = trim(str_replace('FROM', '', $SQLString)); - $SQLString = trim(str_replace('WHERE', '', $SQLString)); + $SQLString = trim(str_replace("DELETE", '', $SQLString)); + $SQLString = trim(str_replace("FROM", '', $SQLString)); + $SQLString = trim(str_replace("WHERE", '', $SQLString)); $Assigment = explode('=', $SQLString); $_SESSION['SQLString']['fields'][0] = $Assigment[0]; $_SESSION['SQLString']['values'][0] = $Assigment[1]; @@ -148,16 +146,16 @@ <th>' . _('Field Name') . '</th> <th>' . _('Value') . '</th></tr>'; while ($myrow = DB_fetch_row($result)) { - if (Query_Type($myrow[2]) == 'INSERT') { + if (Query_Type($myrow[2]) == "INSERT") { InsertQueryInfo(str_replace("INSERT INTO",'',$myrow[2])); $RowColour = '#a8ff90'; } - if (Query_Type($myrow[2]) == 'UPDATE') { - UpdateQueryInfo(str_replace('UPDATE','',$myrow[2])); + if (Query_Type($myrow[2]) == "UPDATE") { + UpdateQueryInfo(str_replace("UPDATE",'',$myrow[2])); $RowColour = '#feff90'; } - if (Query_Type($myrow[2]) == 'DELETE') { - DeleteQueryInfo(str_replace('DELETE FROM','',$myrow[2])); + if (Query_Type($myrow[2]) == "DELETE") { + DeleteQueryInfo(str_replace("DELETE FROM",'',$myrow[2])); $RowColour = '#fe90bf'; } Modified: trunk/GLBudgets.php =================================================================== --- trunk/GLBudgets.php 2011-04-10 10:41:20 UTC (rev 4545) +++ trunk/GLBudgets.php 2011-04-11 10:33:34 UTC (rev 4546) @@ -33,10 +33,10 @@ echo '</br><tr><td>'. _('Select GL Account'). ":</td><td><select name='SelectedAccount' onChange='ReloadForm(selectaccount.Select)'>"; -$SQL = 'SELECT accountcode, +$SQL = "SELECT accountcode, accountname FROM chartmaster - ORDER BY accountcode'; + ORDER BY accountcode"; $result=DB_query($SQL,$db); if (DB_num_rows($result)==0){ @@ -215,12 +215,12 @@ echo '<script>defaultControl(document.form.1next);</script>'; echo '</br><div class="centre"><input type="submit" name=update value="' . _('Update') . '"></div></form>'; - $SQL='SELECT MIN(periodno) FROM periods'; + $SQL="SELECT MIN(periodno) FROM periods"; $result=DB_query($SQL,$db); $MyRow=DB_fetch_array($result); $FirstPeriod=$MyRow[0]; - $SQL='SELECT MAX(periodno) FROM periods'; + $SQL="SELECT MAX(periodno) FROM periods"; $result=DB_query($SQL,$db); $MyRow=DB_fetch_array($result); $LastPeriod=$MyRow[0]; Modified: trunk/PcAuthorizeExpenses.php =================================================================== --- trunk/PcAuthorizeExpenses.php 2011-04-10 10:41:20 UTC (rev 4545) +++ trunk/PcAuthorizeExpenses.php 2011-04-11 10:33:34 UTC (rev 4546) @@ -1,7 +1,6 @@ <?php -/* $Revision: 1.0 $ */ -//$PageSecurity = 6; +/* $Id$ */ include('includes/session.inc'); $title = _('Authorization of Petty Cash Expenses'); @@ -41,16 +40,16 @@ } if (isset($_POST['submit']) or isset($_POST['update']) OR isset($SelectedTabs) OR isset ($_POST['GO'])) { - echo "<form method='post' action=" . $_SERVER['PHP_SELF'] . '?' . SID . '>'; + echo '<form method="post" action="' . $_SERVER['PHP_SELF'] . '">'; echo '<input type="hidden" name="FormID" value="' . $_SESSION['FormID'] . '" />'; if(!isset ($Days)){ $Days=30; } - echo "<input type=hidden name='SelectedTabs' VALUE=" . $SelectedTabs . ">"; + echo '<input type="hidden" name="SelectedTabs" value="' . $SelectedTabs . '">'; echo '<br><table class=selection>'; - echo "<tr><th colspan=7>" . _('Detail Of Movement For Last ') .': '; - echo "<input type=text class=number name='Days' VALUE=" . $Days . " MAXLENGTH =3 size=4> Days "; + echo '<tr><th colspan="7">' . _('Detail Of Movement For Last ') .': '; + echo '<input type="text" class="number" name="Days" value="' . $Days . '" maxlength ="3" size="4"> ' ._('Days'); echo '<input type=submit name="Go" value="' . _('Go') . '"></tr></th>'; echo '</form>'; @@ -77,15 +76,15 @@ $result = DB_query($sql,$db); - echo "<tr> - <th>" . _('Date') . "</th> - <th>" . _('Expense Code') . "</th> - <th>" . _('Amount') . "</th> - <th>" . _('Posted') . "</th> - <th>" . _('Notes') . "</th> - <th>" . _('Receipt') . "</th> - <th>" . _('Authorized') . "</th> - </tr>"; + echo '<tr> + <th>' . _('Date') . '</th> + <th>' . _('Expense Code') . '</th> + <th>' . _('Amount') . '</th> + <th>' . _('Posted') . '</th> + <th>' . _('Notes') . '</th> + <th>' . _('Receipt') . '</th> + <th>' . _('Authorized') . '</th> + </tr>'; $k=0; //row colour counter echo'<form action="PcAuthorizeExpenses.php" method="POST" name="'._('update').'">'; @@ -94,7 +93,7 @@ while ($myrow=DB_fetch_array($result)) { //update database if update pressed - if ((isset($_POST['submit']) and $_POST['submit']==_('Update')) AND isset($_POST[$myrow['counterindex']])){ + if ((isset($_POST['submit']) AND $_POST['submit']==_('Update')) AND isset($_POST[$myrow['counterindex']])){ $PeriodNo = GetPeriod(ConvertSQLDate($myrow['date']), $db); @@ -124,7 +123,7 @@ $typeno = GetNextTransNo($type,$db); //build narrative - $narrative= "PettyCash - ".$myrow['tabcode']." - ".$myrow['codeexpense']." - ".$myrow['notes']." - ".$myrow['receipt'].""; + $narrative= _('PettyCash') . ' - ' . $myrow['tabcode'] . ' - ' . $myrow['codeexpense'] . ' - ' . DB_escape_string($myrow['notes']) . ' - '.$myrow['receipt']; //insert to gltrans DB_Txn_Begin($db); Modified: trunk/PcExpensesTypeTab.php =================================================================== --- trunk/PcExpensesTypeTab.php 2011-04-10 10:41:20 UTC (rev 4545) +++ trunk/PcExpensesTypeTab.php 2011-04-11 10:33:34 UTC (rev 4546) @@ -1,7 +1,6 @@ <?php -/* $Revision: 1.0 $ */ -//$PageSecurity = 15; +/* $Id$ */ include('includes/session.inc'); $title = _('Maintenance Of Petty Cash Expenses For a Type Tab'); @@ -14,6 +13,8 @@ $SelectedType = strtoupper($_POST['SelectedType']); } elseif (isset($_GET['SelectedType'])){ $SelectedType = strtoupper($_GET['SelectedType']); +} else { + $SelectedType=''; } if (ContainsIllegalCharacters($SelectedType) OR strpos($SelectedType,' ')>0){ $InputError = 1; @@ -58,7 +59,7 @@ VALUES ('" . $_POST['SelectedTabs'] . "', '" . $_POST['SelectedExpense'] . "')"; - $msg = _('Expense code:') . ' ' . $_POST["SelectedExpense"].' '._('for Type of Tab:') .' '. $_POST["SelectedTabs"] . ' ' . _('has been created'); + $msg = _('Expense code:') . ' ' . $_POST['SelectedExpense'].' '._('for Type of Tab:') .' '. $_POST['SelectedTabs'] . ' ' . _('has been created'); $checkSql = "SELECT count(typetabcode) FROM pctypetabs"; $result = DB_query($checkSql, $db); @@ -96,25 +97,26 @@ then none of the above are true and the list of sales types 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 "<form method='post' action=" . $_SERVER['PHP_SELF'] . '?' . SID . '>'; -echo '<input type="hidden" name="FormID" value="' . $_SESSION['FormID'] . '" />'; -echo '<table class=selection>'; //Main table + echo '<form method="post" action="' . $_SERVER['PHP_SELF'] . '">'; + echo '<input type="hidden" name="FormID" value="' . $_SESSION['FormID'] . '" />'; + echo '<table class=selection>'; //Main table + + echo '<tr><td>' . _('Select Type of Tab') . ':</td><td><select name="SelectedTabs">'; -echo '<tr><td>' . _('Select Type of Tab') . ":</td><td><select name='SelectedTabs'>"; - DB_free_result($result); - $SQL = "SELECT typetabcode,typetabdescription - FROM pctypetabs"; + $SQL = "SELECT typetabcode, + typetabdescription + FROM pctypetabs"; $result = DB_query($SQL,$db); while ($myrow = DB_fetch_array($result)) { if (isset($_POST['SelectedTabs']) and $myrow['typetabcode']==$_POST['SelectedTabs']) { - echo "<option selected VALUE='"; + echo '<option selected value="'; } else { - echo "<option VALUE='"; + echo '<option VALUE="'; } - echo $myrow['typetabcode'] . "'>" . $myrow['typetabcode'] . ' - ' . $myrow['typetabdescription']; + echo $myrow['typetabcode'] . '">' . $myrow['typetabcode'] . ' - ' . $myrow['typetabdescription'] . '</option>'; } //end while loop @@ -142,11 +144,11 @@ $result = DB_query($sql,$db); - echo '<table class=selection>'; - echo "<tr> - <th>" . _('Expense Code') . "</th> - <th>" . _('Description') . "</th> - </tr>"; + echo '<table class="selection">'; + echo '<tr> + <th>' . _('Expense Code') . '</th> + <th>' . _('Description') . '</th> + </tr>'; $k=0; //row colour counter @@ -176,47 +178,44 @@ if (! isset($_GET['delete'])) { - echo "<form method='post' action=" . $_SERVER['PHP_SELF'] . '>'; - echo '<input type="hidden" name="FormID" value="' . $_SESSION['FormID'] . '" />'; - echo '<br /><table class=selection>'; //Main table - - - - echo '<tr><td>' . _('Select Expense Code') . ":</td><td><select name='SelectedExpense'>"; - - DB_free_result($result); - $SQL = "SELECT codeexpense,description - FROM pcexpenses"; - - $result = DB_query($SQL,$db); - - while ($myrow = DB_fetch_array($result)) { - if (isset($_POST['SelectedExpense']) and $myrow['codeexpense']==$_POST['SelectedExpense']) { - echo "<option selected VALUE='"; - } else { - echo "<option VALUE='"; - } - echo $myrow['codeexpense'] . "'>" . $myrow['codeexpense'] . ' - ' . $myrow['description']; - - } //end while loop - - echo '</select></td></tr>'; - - - echo "<input type=hidden name='SelectedTabs' VALUE=" . $SelectedTabs . ">"; - - 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>'; - - echo '</form>'; - -} // end if user wish to delete - - + echo '<form method="post" action="' . $_SERVER['PHP_SELF'] . '">'; + echo '<input type="hidden" name="FormID" value="' . $_SESSION['FormID'] . '" />'; + echo '<br /><table class="selection">'; //Main table + + + + echo '<tr><td>' . _('Select Expense Code') . ':</td><td><select name="SelectedExpense">'; + + DB_free_result($result); + $SQL = "SELECT codeexpense, + description + FROM pcexpenses"; + + $result = DB_query($SQL,$db); + + while ($myrow = DB_fetch_array($result)) { + if (isset($_POST['SelectedExpense']) and $myrow['codeexpense']==$_POST['SelectedExpense']) { + echo '<option selected value="'; + } else { + echo '<option value="'; + } + echo $myrow['codeexpense'] . '">' . $myrow['codeexpense'] . ' - ' . $myrow['description'] . '</option>'; + + } //end while loop + + echo '</select></td></tr>'; + + + echo '<input type="hidden" name="SelectedTabs" value="' . $SelectedTabs . '">'; + + 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>'; + + echo '</form>'; + + } // end if user wish to delete } - - include('includes/footer.inc'); ?> \ No newline at end of file Modified: trunk/PcTypeTabs.php =================================================================== --- trunk/PcTypeTabs.php 2011-04-10 10:41:20 UTC (rev 4545) +++ trunk/PcTypeTabs.php 2011-04-11 10:33:34 UTC (rev 4546) @@ -1,8 +1,6 @@ <?php /* $Id$ */ -//$PageSecurity = 15; - include('includes/session.inc'); $title = _('Maintenance Of Petty Cash Type of Tabs'); include('includes/header.inc'); @@ -125,7 +123,7 @@ echo '<br>'; echo '<form method="post" action="' . $_SERVER['PHP_SELF'] . '">'; echo '<input type="hidden" name="FormID" value="' . $_SESSION['FormID'] . '" />'; - echo '<p><div class="centre"><input type=submit name=return VALUE="' . _('Return to list of tab types') . '"></div>'; + echo '<p><div class="centre"><input type=submit name=return value="' . _('Return to list of tab types') . '"></div>'; echo '</form>'; include('includes/footer.inc'); exit; @@ -190,7 +188,7 @@ } if (! isset($_GET['delete'])) { - echo "<form method='post' action=" . $_SERVER['PHP_SELF'] . '>'; + echo '<form method="post" action="' . $_SERVER['PHP_SELF'] . '">'; echo '<input type="hidden" name="FormID" value="' . $_SESSION['FormID'] . '" />'; echo '<p><table class=selection>'; //Main table @@ -220,19 +218,19 @@ // This is a new type so the user may volunteer a type code - echo "<table class=selection><tr><td>" . _('Code Of Type Of Tab') . ":</td><td><input type='Text' - " . (in_array('TypeTabCode',$Errors) ? 'class="inputerror"' : '' ) ." name='TypeTabCode'></td></tr>"; + echo '<table class="selection"><tr><td>' . _('Code Of Type Of Tab') . ':</td><td><input type="text" + ' . (in_array('TypeTabCode',$Errors) ? 'class="inputerror"' : '' ) .' name="TypeTabCode"></td></tr>'; } if (!isset($_POST['TypeTabDescription'])) { $_POST['TypeTabDescription']=''; } - echo "<tr><td>" . _('Description Of Type of Tab') . ":</td><td><input type='Text' name='TypeTabDescription' size=50 maxlength=49 value='" . $_POST['TypeTabDescription'] . "'></td></tr>"; + echo '<tr><td>' . _('Description Of Type of Tab') . ':</td><td><input type="text" name="TypeTabDescription" size="50" maxlength="49" value="' . $_POST['TypeTabDescription'] . '"></td></tr>'; 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>'; + echo '<p><div class="centre"><input type=submit name=submit value="' . _('Accept') . '"><input type=submit name="Cancel" VALUE="' . _('Cancel') . '"></div>'; echo '</form>'; Modified: trunk/SelectSalesOrder.php =================================================================== --- trunk/SelectSalesOrder.php 2011-04-10 10:41:20 UTC (rev 4545) +++ trunk/SelectSalesOrder.php 2011-04-11 10:33:34 UTC (rev 4546) @@ -417,10 +417,11 @@ if (!isset($_REQUEST['OrderNumber']) or $_REQUEST['OrderNumber']==''){ 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'> "; + 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'; + $sql = "SELECT loccode, locationname FROM locations"; $resultStkLocs = DB_query($sql,$db); @@ -459,10 +460,10 @@ _('Add Sales Order') . '</a></td></tr></table>'; } - $SQL='SELECT categoryid, + $SQL="SELECT categoryid, categorydescription FROM stockcategory - ORDER BY categorydescription'; + ORDER BY categorydescription"; $result1 = DB_query($SQL,$db); Modified: trunk/StockLocTransfer.php =================================================================== --- trunk/StockLocTransfer.php 2011-04-10 10:41:20 UTC (rev 4545) +++ trunk/StockLocTransfer.php 2011-04-11 10:33:34 UTC (rev 4546) @@ -1,8 +1,6 @@ <?php /* $Id$*/ -/* contributed by Chris Bice */ -//$PageSecurity = 11; include('includes/session.inc'); $title = _('Inventory Location Transfer Shipment'); include('includes/header.inc'); @@ -17,7 +15,7 @@ $result = DB_query("SELECT * FROM loctransfers WHERE reference='" . $_POST['Trf_ID'] . "'",$db); if (DB_num_rows($result)!=0){ $InputError = true; - $ErrorMessage = _('This transaction has already been entered') . '. ' . _('Please start over now').'<br>'; + $ErrorMessage = _('This transaction has already been entered') . '. ' . _('Please start over now').'<br />'; unset($_POST['submit']); unset($_POST['EnterMoreItems']); for ($i=$_POST['LinesCounter']-10;$i<$_POST['LinesCounter'];$i++){ @@ -33,19 +31,19 @@ $myrow = DB_fetch_row($result); if ($myrow[0]==0){ $InputError = True; - $ErrorMessage .= _('The part code entered of'). ' ' . $_POST['StockID' . $i] . ' '. _('is not set up in the database') . '. ' . _('Only valid parts can be entered for transfers'). '<br>'; + $ErrorMessage .= _('The part code entered of'). ' ' . $_POST['StockID' . $i] . ' '. _('is not set up in the database') . '. ' . _('Only valid parts can be entered for transfers'). '<br />'; $_POST['LinesCounter'] -= 10; } DB_free_result( $result ); if (!is_numeric($_POST['StockQTY' . $i])){ $InputError = True; - $ErrorMessage .= _('The quantity entered of'). ' ' . $_POST['StockQTY' . $i] . ' '. _('for part code'). ' ' . $_POST['StockID' . $i] . ' '. _('is not numeric') . '. ' . _('The quantity entered for transfers is expected to be numeric').'<br>'; + $ErrorMessage .= _('The quantity entered of'). ' ' . $_POST['StockQTY' . $i] . ' '. _('for part code'). ' ' . $_POST['StockID' . $i] . ' '. _('is not numeric') . '. ' . _('The quantity entered for transfers is expected to be numeric').'<br />'; $_POST['LinesCounter'] -= 10; } if ($_POST['StockQTY' . $i] <= 0){ $InputError = True; - $ErrorMessage .= _('The quantity entered for').' '. $_POST['StockID' . $i] . ' ' . _('is less than or equal to 0') . '. ' . _('Please correct this or remove the item').'<br>'; - + $ErrorMessage .= _('The quantity entered for').' '. $_POST['StockID' . $i] . ' ' . _('is less than or equal to 0') . '. ' . _('Please correct this or remove the item').'<br />'; + $_POST['LinesCounter'] -= 10; } // Only if stock exists at this location $result = DB_query("SELECT quantity FROM locstock WHERE stockid='" . $_POST['StockID' . $i] . "' and loccode='".$_POST['FromStockLocation']."'",$db); @@ -61,7 +59,7 @@ }//for all LinesCounter if ($TotalItems == 0){ $InputError = True; - $ErrorMessage .= _('You must enter at least 1 Stock Item to transfer').'<br>'; + $ErrorMessage .= _('You must enter at least 1 Stock Item to transfer').'<br />'; } /*Ship location and Receive location are different */ @@ -122,10 +120,10 @@ } if (isset($InputError) and $InputError==true){ - echo '<br>'; + echo '<br />'; prnMsg($ErrorMessage, 'error'); - echo '<br>'; + echo '<br />'; } @@ -215,8 +213,8 @@ $i++; } - echo '</table><br><div class="centre"> - <input type=hidden name="LinesCounter" value='. $i .'><input type=submit name="EnterMoreItems" value="'. _('Add More Items'). '"><input type=submit name="Submit" value="'. _('Create Transfer Shipment'). '"><br>'; + echo '</table><br /><div class="centre"> + <input type=hidden name="LinesCounter" value='. $i .'><input type=submit name="EnterMoreItems" value="'. _('Add More Items'). '"><input type=submit name="Submit" value="'. _('Create Transfer Shipment'). '"><br />'; echo '<script type="text/javascript">defaultControl(document.forms[0].StockID0);</script>'; echo '</form></div>'; include('includes/footer.inc'); Modified: trunk/TopItems.php =================================================================== --- trunk/TopItems.php 2011-04-10 10:41:20 UTC (rev 4545) +++ trunk/TopItems.php 2011-04-11 10:33:34 UTC (rev 4546) @@ -11,9 +11,9 @@ if (!(isset($_POST['Search']))) { echo '<p class="page_title_text"><img src="' . $rootpath . '/css/' . $theme . '/images/magnifier.png" title="' . _('Top Sales Order Search') . '" alt="" />' . ' ' . _('Top Sales Order Search') . '</p>'; - echo "<form action=" . $_SERVER['PHP_SELF'] . '?' . SID . ' name="SelectCustomer" method=POST>'; + echo '<form action="' . $_SERVER['PHP_SELF'] . '?name="SelectCustomer" method="POST">'; echo '<input type="hidden" name="FormID" value="' . $_SESSION['FormID'] . '" />'; - echo '<table cellpadding=3 colspan=4 class=selection>'; + echo '<table cellpadding="3" colspan="4" class="selection">'; //to view store location echo '<tr><td width="150">' . _('Select Location') . ' </td><td>:</td><td><select name=Location>'; $sql = "SELECT loccode, @@ -83,7 +83,7 @@ AND salesorderdetails.stkcode = stockmaster.stockid AND salesorders.debtorno = debtorsmaster.debtorno AND debtorsmaster.currcode = currencies.currabrev - AND salesorderdetails.ActualDispatchDate >= '" . $FromDate . "' + AND salesorderdetails.actualdispatchdate >= '" . $FromDate . "' GROUP BY salesorderdetails.stkcode ORDER BY '" . $_POST['Sequence'] . "' DESC LIMIT " . $_POST['NumberOfTopItems'] . ""; @@ -104,7 +104,7 @@ AND salesorders.debtorno = debtorsmaster.debtorno AND debtorsmaster.currcode = currencies.currabrev AND debtorsmaster.typeid = '" . $_POST['Customers'] . "' - AND salesorderdetails.ActualDispatchDate >= '" . $FromDate . "' + AND salesorderdetails.actualdispatchdate >= '" . $FromDate . "' GROUP BY salesorderdetails.stkcode ORDER BY '" . $_POST['Sequence'] . "' DESC LIMIT " . $_POST[NumberOfTopItems] . ""; @@ -112,44 +112,44 @@ //the situation if the customer type selected "All" if ($_POST['Customers'] == 'All') { $SQL = "SELECT salesorderdetails.stkcode, - SUM(salesorderdetails.qtyinvoiced) TotalInvoiced, - SUM(salesorderdetails.qtyinvoiced * salesorderdetails.unitprice ) AS ValueSales, - stockmaster.description, - stockmaster.units, - currencies.rate, - debtorsmaster.currcode, - stockmaster.decimalplaces - FROM salesorderdetails, salesorders, debtorsmaster,stockmaster, currencies - WHERE salesorderdetails.orderno = salesorders.orderno - AND salesorderdetails.stkcode = stockmaster.stockid - AND salesorders.debtorno = debtorsmaster.debtorno - AND debtorsmaster.currcode = currencies.currabrev - AND salesorders.fromstkloc = '" . $_POST['Location'] . "' - AND salesorderdetails.ActualDispatchDate >= '" . $FromDate . "' - GROUP BY salesorderdetails.stkcode - ORDER BY " . $_POST['Sequence'] . " DESC - LIMIT " . $_POST['NumberOfTopItems'] . ""; + SUM(salesorderdetails.qtyinvoiced) TotalInvoiced, + SUM(salesorderdetails.qtyinvoiced * salesorderdetails.unitprice ) AS ValueSales, + stockmaster.description, + stockmaster.units, + currencies.rate, + debtorsmaster.currcode, + stockmaster.decimalplaces + FROM salesorderdetails, salesorders, debtorsmaster,stockmaster, currencies + WHERE salesorderdetails.orderno = salesorders.orderno + AND salesorderdetails.stkcode = stockmaster.stockid + AND salesorders.debtorno = debtorsmaster.debtorno + AND debtorsmaster.currcode = currencies.currabrev + AND salesorders.fromstkloc = '" . $_POST['Location'] . "' + AND salesorderdetails.actualdispatchdate >= '" . $FromDate . "' + GROUP BY salesorderdetails.stkcode + ORDER BY " . $_POST['Sequence'] . " DESC + LIMIT " . $_POST['NumberOfTopItems'] . ""; } else { //the situation if the location and customer type not selected "All" $SQL = "SELECT salesorderdetails.stkcode, - SUM(salesorderdetails.qtyinvoiced) TotalInvoiced, - SUM(salesorderdetails.qtyinvoiced * salesorderdetails.unitprice ) AS ValueSales, - stockmaster.description, - stockmaster.units, - currencies.rate, - debtorsmaster.currcode, - stockmaster.decimalplaces - FROM salesorderdetails, salesorders, debtorsmaster,stockmaster, currencies - WHERE salesorderdetails.orderno = salesorders.orderno - AND salesorderdetails.stkcode = stockmaster.stockid - AND salesorders.debtorno = debtorsmaster.debtorno - AND debtorsmaster.currcode = currencies.currabrev - AND salesorders.fromstkloc = '" . $_POST['Location'] . "' - AND debtorsmaster.typeid = '" . $_POST['Customers'] . "' - AND salesorderdetails.ActualDispatchDate >= '" . $FromDate . "' - GROUP BY salesorderdetails.stkcode - ORDER BY '" . $_POST['Sequence'] . "' DESC - LIMIT " . $_POST['NumberOfTopItems'] . ""; + SUM(salesorderdetails.qtyinvoiced) TotalInvoiced, + SUM(salesorderdetails.qtyinvoiced * salesorderdetails.unitprice ) AS ValueSales, + stockmaster.description, + stockmaster.units, + currencies.rate, + debtorsmaster.currcode, + stockmaster.decimalplaces + FROM salesorderdetails, salesorders, debtorsmaster,stockmaster, currencies + WHERE salesorderdetails.orderno = salesorders.orderno + AND salesorderdetails.stkcode = stockmaster.stockid + AND salesorders.debtorno = debtorsmaster.debtorno + AND debtorsmaster.currcode = currencies.currabrev + AND salesorders.fromstkloc = '" . $_POST['Location'] . "' + AND debtorsmaster.typeid = '" . $_POST['Customers'] . "' + AND salesorderdetails.actualdispatchdate >= '" . $FromDate . "' + GROUP BY salesorderdetails.stkcode + ORDER BY '" . $_POST['Sequence'] . "' DESC + LIMIT " . $_POST['NumberOfTopItems'] . ""; } } } Modified: trunk/UserSettings.php =================================================================== --- trunk/UserSettings.php 2011-04-10 10:41:20 UTC (rev 4545) +++ trunk/UserSettings.php 2011-04-11 10:33:34 UTC (rev 4546) @@ -97,7 +97,7 @@ } } -echo "<form method='post' action=" . $_SERVER['PHP_SELF'] . '?' . SID . '>'; +echo '<form method="post" action="' . $_SERVER['PHP_SELF'] . '">'; echo '<input type="hidden" name="FormID" value="' . $_SESSION['FormID'] . '" />'; If (!isset($_POST['DisplayRecordsMax']) OR $_POST['DisplayRecordsMax']=='') { @@ -114,20 +114,19 @@ <input type="hidden" name="RealName" VALUE="'.$_SESSION['UsersRealName'].'"<td></tr>'; echo '<tr> - <td>' . _('Maximum Number of Records to Display') . ":</td> - <td><input type='Text' class='number' name='DisplayRecordsMax' size=3 maxlength=3 VALUE=" . $_POST['DisplayRecordsMax'] . " ></td> - </tr>"; + <td>' . _('Maximum Number of Records to Display') . ':</td> + <td><input type="text" class="number" name="DisplayRecordsMax" size="3" maxlength="3" value="' . $_POST['DisplayRecordsMax'] . '" ></td> + </tr>'; echo '<tr> - <td>' . _('Language') . ":</td> - <td><select name='Language'>"; + <td>' . _('Language') . ':</td> + <td><select name="Language">'; - $LangDirHandle = dir('locale/'); + $Languages = scandir('locale/', 0); - - while (false != ($LanguageEntry = $LangDirHandle->read())){ - + foreach ($Languages as $LanguageEntry){ + if (is_dir('locale/' . $LanguageEntry) AND $LanguageEntry != '..' AND $LanguageEntry != '.svn' Modified: trunk/WWW_Users.php =================================================================== --- trunk/WWW_Users.php 2011-04-10 10:41:20 UTC (rev 4545) +++ trunk/WWW_Users.php 2011-04-11 10:33:34 UTC (rev 4546) @@ -574,13 +574,15 @@ <td>' . _('Language') . ':</td> <td><select name="UserLanguage">'; - $LangDirHandle = dir('locale/'); +$Languages = scandir('locale/', 0); +foreach ($Languages as $LanguageEntry){ + + if (is_dir('locale/' . $LanguageEntry) + AND $LanguageEntry != '..' + AND $LanguageEntry != '.svn' + AND $LanguageEntry!='.'){ -while (false != ($LanguageEntry = $LangDirHandle->read())){ - - if (is_dir('locale/' . $LanguageEntry) AND $LanguageEntry != '..' AND $LanguageEntry != 'CVS' AND $LanguageEntry!='.'){ - if (isset($_POST['UserLanguage']) and $_POST['UserLanguage'] == $LanguageEntry){ echo '<option selected value="' . $LanguageEntry . '">' . $LanguageEntry .'</option>'; } elseif (!isset($_POST['UserLanguage']) and $LanguageEntry == $DefaultLanguage) { @@ -591,6 +593,8 @@ } } + + echo '</select></td></tr>'; Modified: trunk/api/api_workorders.php =================================================================== --- trunk/api/api_workorders.php 2011-04-10 10:41:20 UTC (rev 4545) +++ trunk/api/api_workorders.php 2011-04-11 10:33:34 UTC (rev 4546) @@ -44,7 +44,7 @@ } function VerifyRequiredByDate($RequiredByDate, $i, $Errors, $db) { - $sql="select confvalue from config where confname='DefaultDateFormat'"; + $sql="SELECT confvalue FROM config WHERE confname='DefaultDateFormat'"; $result=DB_query($sql, $db); $myrow=DB_fetch_array($result); $DateFormat=$myrow[0]; @@ -77,7 +77,7 @@ } function VerifyStartDate($StartDate, $i, $Errors, $db) { - $sql="select confvalue from config where confname='DefaultDateFormat'"; + $sql="SELECT confvalue FROM config WHERE confname='DefaultDateFormat'"; $result=DB_query($sql, $db); $myrow=DB_fetch_array($result); $DateFormat=$myrow[0]; @@ -310,37 +310,37 @@ '".$newqoh."', '".$cost."', '".$cost."')"; - $locstocksql='UPDATE locstock SET quantity = quantity + '.$Quantity." - WHERE loccode='". $Location."' - AND stockid='".$StockID."'"; + $locstocksql="UPDATE locstock SET quantity = quantity + " . $Quantity ." + WHERE loccode='". $Location."' + AND stockid='".$StockID."'"; $glupdatesql1="INSERT INTO gltrans (type, - typeno, - trandate, - periodno, - account, - amount, - narrative) - VALUES (28, - '".$TransactionNo. "', - '".$TranDate."', - '".GetPeriodFromTransactionDate($TranDate, sizeof($Errors), $Errors, $db)."', - '".$wipglact."', - '".$cost*-$Quantity."', - '".$StockID.' x '.$Quantity.' @ '.$cost."')"; + typeno, + trandate, + periodno, + account, + amount, + narrative) + VALUES (28, + '".$TransactionNo. "', + '".$TranDate."', + '".GetPeriodFromTransactionDate($TranDate, sizeof($Errors), $Errors, $db)."', + '".$wipglact."', + '".$cost*-$Quantity."', + '".$StockID.' x '.$Quantity.' @ '.$cost."')"; $glupdatesql2="INSERT INTO gltrans (type, - typeno, - trandate, - periodno, - account, - amount, - narrative) - VALUES (28, - '".$TransactionNo."', - '".$TranDate."', - '".GetPeriodFromTransactionDate($TranDate, sizeof($Errors), $Errors, $db)."', - '".$stockact."', - '".$cost*$Quantity."', - '".$StockID.' x '.$Quantity.' @ '.$cost."')"; + typeno, + trandate, + periodno, + account, + amount, + narrative) + VALUES (28, + '".$TransactionNo."', + '".$TranDate."', + '".GetPeriodFromTransactionDate($TranDate, sizeof($Errors), $Errors, $db)."', + '".$stockact."', + '".$cost*$Quantity."', + '".$StockID.' x '.$Quantity.' @ '.$cost."')"; $systypessql = "UPDATE systypes set typeno='".$TransactionNo."' where typeid=28"; $batchsql="UPDATE stockserialitems SET quantity=quantity-" . $Quantity. " WHERE stockid='".$StockID."' @@ -474,7 +474,7 @@ } $sql="SELECT wo FROM woitems - WHERE ".$Field." LIKE '%".$Criteria."%'"; + WHERE " . $Field ." " . LIKE . " '%".$Criteria."%'"; $result = DB_Query($sql, $db); $i=0; $WOList = array(); Modified: trunk/doc/Change.log.html =================================================================== --- trunk/doc/Change.log.html 2011-04-10 10:41:20 UTC (rev 4545) +++ trunk/doc/Change.log.html 2011-04-11 10:33:34 UTC (rev 4546) @@ -1,6 +1,9 @@ <p><font SIZE=4 COLOR=BLUE><b>webERP Change Log</b></font></p> <p /> -<p>10/4/11 Tim: +<p>11/4/11 Tim: pcAuthorizeExpenses.php DB_escape_string(notes)</p> +<p>11/4/11 Tim: StockLocTransfer.php added $_POST['LinesCounter'] -= 10;</p> +<p>11/4/11 Tim/Phil: Use PHP 5 specific scandir to sort languages into alphabetic order for UserSettings and WWW_Users language selection</p> +<p>10/4/11 Tim: AddCustomerContacts.php use single field rather than * in SQL></p> <p>10/4/11 Tim: GLAccountInquiry.php show None if no tag selected</p> <p>10/4/11 Tim : PDFPrintLabel.php javascript fix</p> <p>10/4/11 Tim: Add perishable to StockTransfer.php and PDFStockTransfer</p> This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <dai...@us...> - 2011-04-10 10:41:28
|
Revision: 4545 http://web-erp.svn.sourceforge.net/web-erp/?rev=4545&view=rev Author: daintree Date: 2011-04-10 10:41:20 +0000 (Sun, 10 Apr 2011) Log Message: ----------- Tim launchpad stuff Modified Paths: -------------- trunk/GLAccountInquiry.php trunk/GLAccounts.php trunk/MRP.php trunk/MRPCalendar.php trunk/MRPShortages.php trunk/PDFPrintLabel.php trunk/PDFStockTransfer.php trunk/SelectProduct.php trunk/StockTransferControlled.php trunk/StockTransfers.php trunk/SupplierInvoice.php trunk/doc/Change.log.html trunk/includes/DefineLabelClass.php trunk/includes/DefineStockTransfers.php trunk/includes/OutputSerialItems.php trunk/index.php trunk/sql/mysql/upgrade3.11.1-4.00.sql Added Paths: ----------- trunk/ReprintGRN.php Modified: trunk/GLAccountInquiry.php =================================================================== --- trunk/GLAccountInquiry.php 2011-04-10 02:04:57 UTC (rev 4544) +++ trunk/GLAccountInquiry.php 2011-04-10 10:41:20 UTC (rev 4545) @@ -268,7 +268,9 @@ $tagsql="SELECT tagdescription FROM tags WHERE tagref='".$myrow['tag'] . "'"; $tagresult=DB_query($tagsql,$db); $tagrow = DB_fetch_array($tagresult); - + if ($tagrow['tagdescription']=='') { + $tagrow['tagdescription']=_('None'); + } printf("<td>%s</td> <td class=number><a href='%s'>%s</a></td> <td>%s</td> Modified: trunk/GLAccounts.php =================================================================== --- trunk/GLAccounts.php 2011-04-10 02:04:57 UTC (rev 4544) +++ trunk/GLAccounts.php 2011-04-10 10:41:20 UTC (rev 4545) @@ -1,8 +1,6 @@ <?php -/* $Revision: 1.21 $ */ /* $Id$*/ -//$PageSecurity = 10; include('includes/session.inc'); $title = _('Chart of Accounts Maintenance'); @@ -58,19 +56,6 @@ )"; $result = DB_query($sql,$db,$ErrMsg); - /*Add the new chart details records for existing periods first */ -/*Maybe not required since these will be created from GLPostings.inc with correct B/fwd balances - $ErrMsg = _('Could not add the chart details for the new account'); - - $sql = 'INSERT INTO chartdetails (accountcode, period) - SELECT chartmaster.accountcode, periods.periodno - FROM chartmaster - CROSS JOIN periods - WHERE ( chartmaster.accountcode, periods.periodno ) NOT - IN ( SELECT chartdetails.accountcode, chartdetails.period FROM chartdetails )'; - - $result = DB_query($sql,$db,$ErrMsg); -*/ prnMsg(_('The new general ledger account has been added'),'success'); } @@ -218,7 +203,7 @@ if (!isset($_GET['delete'])) { - echo "<form method='post' name='GLAccounts' action='" . $_SERVER['PHP_SELF'] . '?' . SID . "'>"; + echo '<form method="post" name="GLAccounts" action="' . $_SERVER['PHP_SELF'] . '">'; echo '<input type="hidden" name="FormID" value="' . $_SESSION['FormID'] . '" />'; if (isset($SelectedAccount)) { @@ -233,12 +218,16 @@ $_POST['AccountName'] = $myrow['accountname']; $_POST['Group'] = $myrow['group_']; - echo "<input type=hidden name='SelectedAccount' VALUE=$SelectedAccount>"; - echo "<input type=hidden name='AccountCode' VALUE=" . $_POST['AccountCode'] .">"; - echo "<table class=selection><tr><td>" . _('Account Code') . ":</td><td>" . $_POST['AccountCode'] . "</td></tr>"; + echo '<input type="hidden" name="SelectedAccount" value="' . $SelectedAccount . '">'; + echo '<input type="hidden" name="AccountCode" VALUE="' . $_POST['AccountCode'] .'">'; + echo '<table class=selection> + <tr><td>' . _('Account Code') . ':</td> + <td>' . $_POST['AccountCode'] . '</td></tr>'; } else { echo "<table class=selection>"; - echo "<tr><td>" . _('Account Code') . ":</td><td><input type=TEXT name='AccountCode' size=11 class=number maxlength=10></td></tr>"; + echo '<tr><td>' . _('Account Code') . ':</td> + <td><input type="text" name="AccountCode" size="11" class="number" maxlength="10" /></td> + </tr>'; } if (!isset($_POST['AccountName'])) {$_POST['AccountName']='';} @@ -251,17 +240,17 @@ while ($myrow = DB_fetch_array($result)){ if (isset($_POST['Group']) and $myrow[0]==$_POST['Group']){ - echo "<option selected VALUE='"; + echo '<option selected value="'; } else { - echo "<option VALUE='"; + echo '<option VALUE="'; } - echo $myrow[0] . "'>" . $myrow[0]; + echo $myrow[0] . '">' . $myrow[0] . '</option>'; } if (!isset($_GET['SelectedAccount']) or $_GET['SelectedAccount']=='') { - echo "<script>defaultControl(document.GLAccounts.AccountCode);</script>"; + echo '<script>defaultControl(document.GLAccounts.AccountCode);</script>'; } else { - echo "<script>defaultControl(document.GLAccounts.AccountName);</script>"; + echo '<script>defaultControl(document.GLAccounts.AccountName);</script>'; } echo '</select></td></tr></table>'; @@ -293,12 +282,12 @@ $result = DB_query($sql,$db,$ErrMsg); echo '<br><table class=selection>'; - echo "<tr> - <th>" . _('Account Code') . "</th> - <th>" . _('Account Name') . "</th> - <th>" . _('Account Group') . "</th> - <th>" . _('P/L or B/S') . "</th> - </tr>"; + echo '<tr> + <th>' . _('Account Code') . '</th> + <th>' . _('Account Name') . '</th> + <th>' . _('Account Group') . '</th> + <th>' . _('P/L or B/S') . '</th> + </tr>'; $k=0; //row colour counter @@ -323,9 +312,9 @@ $myrow[1], $myrow[2], $myrow[3], - $_SERVER['PHP_SELF'] . '?' . SID, + $_SERVER['PHP_SELF'] . '?', $myrow[0], - $_SERVER['PHP_SELF'] . '?' . SID, + $_SERVER['PHP_SELF'] . '?', $myrow[0]); } @@ -338,10 +327,10 @@ echo '<p>'; if (isset($SelectedAccount)) { - echo "<div class='centre'><a href='" . $_SERVER['PHP_SELF'] . '?' . SID ."'>" . _('Show All Accounts') . '</a></div>'; + echo '<div class="centre"><a href="' . $_SERVER['PHP_SELF'] . '">' . _('Show All Accounts') . '</a></div>'; } -echo '<p>'; +echo '<p />'; include('includes/footer.inc'); ?> \ No newline at end of file Modified: trunk/MRP.php =================================================================== --- trunk/MRP.php 2011-04-10 02:04:57 UTC (rev 4544) +++ trunk/MRP.php 2011-04-10 10:41:20 UTC (rev 4545) @@ -1,9 +1,7 @@ <?php -/* $Revision: 1.7 $ */ + /* $Id$*/ -//$PageSecurity=9; - include('includes/session.inc'); $title = _('Run MRP Calculation'); include('includes/header.inc'); @@ -18,21 +16,21 @@ echo '</br>' ._('Start time') . ': ' . date('h:i:s') . '</br>'; echo '</br>' . _('Initialising tables .....') . '</br>'; flush(); - $result = DB_query('DROP TABLE IF EXISTS tempbom',$db); - $result = DB_query('DROP TABLE IF EXISTS passbom',$db); - $result = DB_query('DROP TABLE IF EXISTS passbom2',$db); - $result = DB_query('DROP TABLE IF EXISTS bomlevels',$db); - $result = DB_query('DROP TABLE IF EXISTS levels',$db); + $result = DB_query("DROP TABLE IF EXISTS tempbom",$db); + $result = DB_query("DROP TABLE IF EXISTS passbom",$db); + $result = DB_query("DROP TABLE IF EXISTS passbom2",$db); + $result = DB_query("DROP TABLE IF EXISTS bomlevels",$db); + $result = DB_query("DROP TABLE IF EXISTS levels",$db); - $sql = 'CREATE TEMPORARY TABLE passbom (part char(20), - sortpart text) DEFAULT CHARSET=utf8'; + $sql = "CREATE TEMPORARY TABLE passbom (part char(20), + sortpart text) DEFAULT CHARSET=utf8"; $ErrMsg = _('The SQL to to create passbom failed with the message'); $result = DB_query($sql,$db,$ErrMsg); - $sql = 'CREATE TEMPORARY TABLE tempbom (parent char(20), + $sql = "CREATE TEMPORARY TABLE tempbom (parent char(20), component char(20), sortpart text, - level int) DEFAULT CHARSET=utf8'; + level int) DEFAULT CHARSET=utf8"; $result = DB_query($sql,$db,_('Create of tempbom failed because')); // To create levels, first, find parts in bom that are top level assemblies. // Do this by doing a LEFT JOIN from bom to bom (as bom2), linking @@ -45,10 +43,10 @@ flush(); // This finds the top level $sql = "INSERT INTO passbom (part, sortpart) - SELECT bom.component AS part, - CONCAT(bom.parent,'%',bom.component) AS sortpart - FROM bom LEFT JOIN bom as bom2 ON bom.parent = bom2.component - WHERE bom2.component IS NULL"; + SELECT bom.component AS part, + CONCAT(bom.parent,'%',bom.component) AS sortpart + FROM bom LEFT JOIN bom as bom2 ON bom.parent = bom2.component + WHERE bom2.component IS NULL"; $result = DB_query($sql,$db); $lctr = 2; @@ -76,12 +74,12 @@ FROM bom,passbom WHERE bom.parent = passbom.part"; $result = DB_query($sql,$db); - $result = DB_query('DROP TABLE IF EXISTS passbom2',$db); - $result = DB_query('ALTER TABLE passbom RENAME AS passbom2',$db); - $result = DB_query('DROP TABLE IF EXISTS passbom',$db); + $result = DB_query("DROP TABLE IF EXISTS passbom2",$db); + $result = DB_query("ALTER TABLE passbom RENAME AS passbom2",$db); + $result = DB_query("DROP TABLE IF EXISTS passbom",$db); - $sql = 'CREATE TEMPORARY TABLE passbom (part char(20), - sortpart text) DEFAULT CHARSET=utf8'; + $sql = "CREATE TEMPORARY TABLE passbom (part char(20), + sortpart text) DEFAULT CHARSET=utf8"; $result = DB_query($sql,$db); $sql = "INSERT INTO passbom (part, sortpart) @@ -92,9 +90,9 @@ $result = DB_query($sql,$db); - $sql = 'SELECT COUNT(*) FROM bom + $sql = "SELECT COUNT(*) FROM bom INNER JOIN passbom ON bom.parent = passbom.part - GROUP BY bom.parent'; + GROUP BY bom.parent"; $result = DB_query($sql,$db); $myrow = DB_fetch_row($result); @@ -104,9 +102,9 @@ prnMsg(_('Creating bomlevels table'),'info'); flush(); - $sql = 'CREATE TEMPORARY TABLE bomlevels ( + $sql = "CREATE TEMPORARY TABLE bomlevels ( part char(20), - level int) DEFAULT CHARSET=utf8'; + level int) DEFAULT CHARSET=utf8"; $result = DB_query($sql,$db); // Read tempbom and split sortpart into separate parts. For each separate part, calculate level as @@ -114,7 +112,7 @@ // part in the array for a level 4 sortpart would be created as a level 3 in levels, the fourth // and last part in sortpart would have a level code of zero, meaning it has no components - $sql = 'SELECT * FROM tempbom'; + $sql = "SELECT * FROM tempbom"; $result = DB_query($sql,$db); while ($myrow=DB_fetch_array($result)) { $parts = explode('%',$myrow['sortpart']); @@ -140,7 +138,7 @@ shrinkfactor double NOT NULL default '0', eoq double NOT NULL default '0') DEFAULT CHARSET=utf8"; $result = DB_query($sql,$db); - $sql = 'INSERT INTO levels (part, + $sql = "INSERT INTO levels (part, level, leadtime, pansize, @@ -157,15 +155,15 @@ GROUP BY bomlevels.part, pansize, shrinkfactor, - stockmaster.eoq'; + stockmaster.eoq"; $result = DB_query($sql,$db); - $sql = 'ALTER TABLE levels ADD INDEX part(part)'; + $sql = "ALTER TABLE levels ADD INDEX part(part)"; $result = DB_query($sql,$db); // Create levels records with level of zero for all parts in stockmaster that // are not in bom - $sql = 'INSERT INTO levels (part, + $sql = "INSERT INTO levels (part, level, leadtime, pansize, @@ -179,53 +177,53 @@ stockmaster.eoq FROM stockmaster LEFT JOIN levels ON stockmaster.stockid = levels.part - WHERE levels.part IS NULL'; + WHERE levels.part IS NULL"; $result = DB_query($sql,$db); // Update leadtime in levels from purchdata. Do it twice so can make sure leadtime from preferred // vendor is used - $sql = 'UPDATE levels,purchdata + $sql = "UPDATE levels,purchdata SET levels.leadtime = purchdata.leadtime WHERE levels.part = purchdata.stockid - AND purchdata.leadtime > 0'; + AND purchdata.leadtime > 0"; $result = DB_query($sql,$db); - $sql = 'UPDATE levels,purchdata + $sql = "UPDATE levels,purchdata SET levels.leadtime = purchdata.leadtime WHERE levels.part = purchdata.stockid AND purchdata.preferred = 1 - AND purchdata.leadtime > 0'; + AND purchdata.leadtime > 0"; $result = DB_query($sql,$db); prnMsg(_('Levels table has been created'),'info'); flush(); // Get rid if temporary tables - $sql = 'DROP TABLE IF EXISTS tempbom'; + $sql = "DROP TABLE IF EXISTS tempbom"; //$result = DB_query($sql,$db); - $sql = 'DROP TABLE IF EXISTS passbom'; + $sql = "DROP TABLE IF EXISTS passbom"; //$result = DB_query($sql,$db); - $sql = 'DROP TABLE IF EXISTS passbom2'; + $sql = "DROP TABLE IF EXISTS passbom2"; //$result = DB_query($sql,$db); - $sql = 'DROP TABLE IF EXISTS bomlevels'; + $sql = "DROP TABLE IF EXISTS bomlevels"; //$result = DB_query($sql,$db); // In the following section, create mrprequirements from open sales orders and // mrpdemands prnMsg(_('Creating requirements table'),'info'); flush(); - $result = DB_query('DROP TABLE IF EXISTS mrprequirements',$db); + $result = DB_query("DROP TABLE IF EXISTS mrprequirements",$db); // directdemand is 1 if demand is directly for this part, is 0 if created because have netted // out supply and demands for a top level part and determined there is still a net // requirement left and have to pass that down to the BOM parts using the // CreateLowerLevelRequirement() function. Mostly do this so can distinguish the type // of requirements for the MRPShortageReport so don't show double requirements. - $sql = 'CREATE TABLE mrprequirements ( part char(20), + $sql = "CREATE TABLE mrprequirements ( part char(20), daterequired date, quantity double, mrpdemandtype varchar(6), orderno int(11), directdemand smallint, - whererequired char(20)) DEFAULT CHARSET=utf8'; + whererequired char(20)) DEFAULT CHARSET=utf8"; $result = DB_query($sql,$db,_('Create of mrprequirements failed because')); prnMsg(_('Loading requirements from sales orders'),'info'); Modified: trunk/MRPCalendar.php =================================================================== --- trunk/MRPCalendar.php 2011-04-10 02:04:57 UTC (rev 4544) +++ trunk/MRPCalendar.php 2011-04-10 10:41:20 UTC (rev 4545) @@ -1,12 +1,10 @@ <?php /* $Id$ */ -/* $Revision: 1.6 $ */ + // MRPCalendar.php // Maintains the calendar of valid manufacturing dates for MRP -//$PageSecurity=9; - include('includes/session.inc'); $title = _('MRP Calendar'); include('includes/header.inc'); @@ -75,15 +73,15 @@ return; } - $sql = 'DROP TABLE IF EXISTS mrpcalendar'; + $sql = "DROP TABLE IF EXISTS mrpcalendar"; $result = DB_query($sql,$db); - $sql = 'CREATE TABLE mrpcalendar ( + $sql = "CREATE TABLE mrpcalendar ( calendardate date NOT NULL, daynumber int(6) NOT NULL, - manufacturingflag smallint(6) NOT NULL default "1", + manufacturingflag smallint(6) NOT NULL default '1', INDEX (daynumber), - PRIMARY KEY (calendardate))'; + PRIMARY KEY (calendardate)) DEFAULT CHARSET=utf8"; $ErrMsg = _('The SQL to to create passbom failed with the message'); $result = DB_query($sql,$db,$ErrMsg); @@ -95,9 +93,9 @@ $ExcludeDays = array($_POST['Sunday'],$_POST['Monday'],$_POST['Tuesday'],$_POST['Wednesday'], $_POST['Thursday'],$_POST['Friday'],$_POST['Saturday']); - $caldate = $convertfromdate; + $CalDate = $convertfromdate; for ($i = 0; $i <= $datediff; $i++) { - $dateadd = FormatDateForSQL(DateAdd($caldate,"d",$i)); + $dateadd = FormatDateForSQL(DateAdd($CalDate,"d",$i)); // If the check box for the calendar date's day of week was clicked, set the manufacturing flag to 0 $dayofweek = DayOfWeekFromSQLDate($dateadd); @@ -121,16 +119,16 @@ // Update daynumber. Set it so non-manufacturing days will have the same daynumber as a valid // manufacturing day that precedes it. That way can read the table by the non-manufacturing day, // subtract the leadtime from the daynumber, and find the valid manufacturing day with that daynumber. - $daynumber = 1; - $sql = 'SELECT * FROM mrpcalendar ORDER BY calendardate'; + $DayNumber = 1; + $sql = "SELECT * FROM mrpcalendar ORDER BY calendardate"; $result = DB_query($sql,$db,$ErrMsg); while ($myrow = DB_fetch_array($result)) { if ($myrow['manufacturingflag'] == "1") { - $daynumber++; + $DayNumber++; } - $caldate = $myrow['calendardate']; - $sql = "UPDATE mrpcalendar SET daynumber = '$daynumber' - WHERE calendardate = '$caldate'"; + $CalDate = $myrow['calendardate']; + $sql = "UPDATE mrpcalendar SET daynumber = '" . $DayNumber . "' + WHERE calendardate = '$CalDate'"; $resultupdate = DB_query($sql,$db,$ErrMsg); } prnMsg(_("The MRP Calendar has been created"),'succes'); @@ -145,9 +143,9 @@ // After change the flag, re-calculate the daynumber for all dates. $InputError = 0; - $caldate = FormatDateForSQL($ChangeDate); + $CalDate = FormatDateForSQL($ChangeDate); $sql="SELECT COUNT(*) FROM mrpcalendar - WHERE calendardate='$caldate' + WHERE calendardate='$CalDate' GROUP BY calendardate"; $result = DB_query($sql,$db); $myrow = DB_fetch_row($result); @@ -161,7 +159,7 @@ return; } - $sql="SELECT mrpcalendar.* FROM mrpcalendar WHERE calendardate='$caldate'"; + $sql="SELECT mrpcalendar.* FROM mrpcalendar WHERE calendardate='$CalDate'"; $result = DB_query($sql,$db); $myrow = DB_fetch_row($result); $newmanufacturingflag = 0; @@ -169,7 +167,7 @@ $newmanufacturingflag = 1; } $sql = "UPDATE mrpcalendar SET manufacturingflag = '".$newmanufacturingflag."' - WHERE calendardate = '".$caldate."'"; + WHERE calendardate = '".$CalDate."'"; $ErrMsg = _('Cannot update the MRP Calendar'); $resultupdate = DB_query($sql,$db,$ErrMsg); prnMsg(_("The MRP calendar record for $ChangeDate has been updated"),'success'); @@ -180,16 +178,16 @@ // Update daynumber. Set it so non-manufacturing days will have the same daynumber as a valid // manufacturing day that precedes it. That way can read the table by the non-manufacturing day, // subtract the leadtime from the daynumber, and find the valid manufacturing day with that daynumber. - $daynumber = 1; - $sql = 'SELECT * FROM mrpcalendar ORDER BY calendardate'; + $DayNumber = 1; + $sql = "SELECT * FROM mrpcalendar ORDER BY calendardate"; $result = DB_query($sql,$db,$ErrMsg); while ($myrow = DB_fetch_array($result)) { - if ($myrow['manufacturingflag'] == "1") { - $daynumber++; + if ($myrow['manufacturingflag'] == '1') { + $DayNumber++; } - $caldate = $myrow['calendardate']; - $sql = "UPDATE mrpcalendar SET daynumber = '$daynumber' - WHERE calendardate = '$caldate'"; + $CalDate = $myrow['calendardate']; + $sql = "UPDATE mrpcalendar SET daynumber = '" . $DayNumber . "' + WHERE calendardate = '" . $CalDate . "'"; $resultupdate = DB_query($sql,$db,$ErrMsg); } // End of while @@ -199,24 +197,24 @@ function listall(&$db) //####LISTALL_LISTALL_LISTALL_LISTALL_LISTALL_LISTALL_LISTALL_#### { // List all records in date range - $fromdate = FormatDateForSQL($_POST['FromDate']); - $todate = FormatDateForSQL($_POST['ToDate']); + $FromDate = FormatDateForSQL($_POST['FromDate']); + $ToDate = FormatDateForSQL($_POST['ToDate']); $sql = "SELECT calendardate, daynumber, manufacturingflag, DAYNAME(calendardate) as dayname FROM mrpcalendar - WHERE calendardate >='$fromdate' - AND calendardate <='$todate'"; + WHERE calendardate >='" . $FromDate . "' + AND calendardate <='" . $ToDate . "'"; $ErrMsg = _('The SQL to find the parts selected failed with the message'); $result = DB_query($sql,$db,$ErrMsg); - echo "</br><table class=selection> - <tr BGCOLOR =#800000> - <th>" . _('Date') . "</th> - <th>" . _('Manufacturing Date') . "</th> - </tr></font>"; + echo '</br><table class="selection"> + <tr bgcolor ="#800000"> + <th>' . _('Date') . '</th> + <th>' . _('Manufacturing Date') . '</th> + </tr>'; $ctr = 0; while ($myrow = DB_fetch_array($result)) { $flag = _('Yes'); @@ -251,51 +249,51 @@ $_POST['FromDate']=date($_SESSION['DefaultDateFormat']); $_POST['ToDate']=date($_SESSION['DefaultDateFormat']); } - echo "<form action=" . $_SERVER['PHP_SELF'] . "?" . SID ." method=post></br></br>"; + echo '<form action="' . $_SERVER['PHP_SELF'] . '" method="post"><br /><br />'; echo '<input type="hidden" name="FormID" value="' . $_SESSION['FormID'] . '" />'; - echo '<br><table class=selection>'; + echo '<br><table class="selection">'; echo '<tr> - <td>' . _('From Date') . ":</td> - <td><input type='Text' class=date alt='".$_SESSION['DefaultDateFormat'] ."' name='FromDate' size=10 maxlength=10 value=" . $_POST['FromDate'] . '></td></tr> - <tr></tr><td>' . _('To Date') . ":</td> - <td><input type='Text' class=date alt='".$_SESSION['DefaultDateFormat'] ."' name='ToDate' size=10 maxlength=10 value=" . $_POST['ToDate'] . '></td> + <td>' . _('From Date') . ':</td> + <td><input type="text" class="date" alt="' . $_SESSION['DefaultDateFormat'] .'" name="FromDate" size="10" maxlength="10" value="' . $_POST['FromDate'] . '"></td></tr> + <tr></tr><td>' . _('To Date') . ':</td> + <td><input type="text" class="date" alt="' . $_SESSION['DefaultDateFormat'] .'" name="ToDate" size="10" maxlength="10" value="' . $_POST['ToDate'] . '"></td> </tr> <tr><td></td></tr> <tr><td></td></tr> <tr><td>'._('Exclude The Following Days').'</td></tr> <tr> - <td>' . _('Saturday') . ":</td> - <td><input type='checkbox' name='Saturday' value='Saturday'></td> + <td>' . _('Saturday') . ':</td> + <td><input type="checkbox" name="Saturday" value="Saturday"></td> </tr> <tr> - <td>" . _('Sunday') . ":</td> - <td><input type='checkbox' name='Sunday' value='Sunday'></td> + <td>' . _('Sunday') . ':</td> + <td><input type="checkbox" name="Sunday" value="Sunday"></td> </tr> <tr> - <td>" . _('Monday') . ":</td> - <td><input type='checkbox' name='Monday' value='Monday'></td> + <td>' . _('Monday') . ':</td> + <td><input type="checkbox" name="Monday" value="Monday"></td> </tr> <tr> - <td>" . _('Tuesday') . ":</td> - <td><input type='checkbox' name='Tuesday' value='Tuesday'></td> + <td>' . _('Tuesday') . ':</td> + <td><input type="checkbox" name="Tuesday" value="Tuesday"></td> </tr> <tr> - <td>" . _('Wednesday') . ":</td> - <td><input type='checkbox' name='Wednesday' value='Wednesday'></td> + <td>' . _('Wednesday') . ':</td> + <td><input type="checkbox" name="Wednesday" value="Wednesday"></td> </tr> <tr> - <td>" . _('Thursday') . ":</td> - <td><input type='checkbox' name='Thursday' value='Thursday'></td> + <td>' . _('Thursday') . ':</td> + <td><input type="checkbox" name="Thursday" value="Thursday"></td> </tr> <tr> - <td>" . _('Friday') . ":</td> - <td><input type='checkbox' name='Friday' value='Friday'></td> + <td>' . _('Friday') . ':</td> + <td><input type="checkbox" name="Friday" value="Friday"></td> </tr> </table><br> - <div class=centre><input type='submit' name='submit' value='" . _('Create Calendar') . "'> - <input type='submit' name='listall' value='" . _('List Date Range') . "'></div>"; + <div class=centre><input type="submit" name="submit" value="' . _('Create Calendar') . '"> + <input type="submit" name="listall" value="' . _('List Date Range') . '"></div>'; if (!isset($_POST['ChangeDate'])) { $_POST['ChangeDate']=date($_SESSION['DefaultDateFormat']); @@ -303,15 +301,14 @@ echo '<br><table class=selection>'; echo '<tr> - <td>' . _('Change Date Status') . ":</td> - <td><input type='Text' name='ChangeDate' class=date alt='".$_SESSION['DefaultDateFormat'] . - "' size=12 maxlength=12 value=" . $_POST['ChangeDate'] . '></td> + <td>' . _('Change Date Status') . ':</td> + <td><input type="text" name="ChangeDate" class="date" alt="' . $_SESSION['DefaultDateFormat'] . + '" size="12" maxlength="12" value="' . $_POST['ChangeDate'] . '"></td> <td><input type="submit" name="update" value="' . _('Update') . '"></td></tr></table>'; -echo "</br></br><div class='centre'></div>"; +echo '<br /><br /><div class="centre"></div>'; echo '</form>'; } // End of function display() - include('includes/footer.inc'); ?> \ No newline at end of file Modified: trunk/MRPShortages.php =================================================================== --- trunk/MRPShortages.php 2011-04-10 02:04:57 UTC (rev 4544) +++ trunk/MRPShortages.php 2011-04-10 10:41:20 UTC (rev 4545) @@ -6,7 +6,7 @@ include('includes/session.inc'); //ANSI SQL??? -$sql='SHOW TABLES WHERE Tables_in_'.$_SESSION['DatabaseName']."='mrprequirements'"; +$sql="SHOW TABLES WHERE Tables_in_" . $_SESSION['DatabaseName'] . "='mrprequirements'"; $result=DB_query($sql,$db); if (DB_num_rows($result)==0) { @@ -32,48 +32,47 @@ // total for either supply or demand. Did this to simplify main sql where used // several subqueries. - $sql = 'CREATE TEMPORARY TABLE demandtotal ( + $sql = "CREATE TEMPORARY TABLE demandtotal ( part char(20), demand double, - KEY `PART` (`part`)) DEFAULT CHARSET=utf8'; + KEY `PART` (`part`)) DEFAULT CHARSET=utf8"; $result = DB_query($sql,$db,_('Create of demandtotal failed because')); - $sql = 'INSERT INTO demandtotal + $sql = "INSERT INTO demandtotal (part, demand) SELECT part, SUM(quantity) as demand FROM mrprequirements - GROUP BY part'; + GROUP BY part"; $result = DB_query($sql,$db); - $sql = 'CREATE TEMPORARY TABLE supplytotal ( + $sql = "CREATE TEMPORARY TABLE supplytotal ( part char(20), supply double, - KEY `PART` (`part`)) DEFAULT CHARSET=utf8'; + KEY `PART` (`part`)) DEFAULT CHARSET=utf8"; $result = DB_query($sql,$db,_('Create of supplytotal failed because')); /* 21/03/2010: Ricard modification to allow items with total supply = 0 be included in the report */ - $sql = 'INSERT INTO supplytotal + $sql = "INSERT INTO supplytotal (part, supply) SELECT stockid, 0 - FROM stockmaster'; + FROM stockmaster"; $result = DB_query($sql,$db); - $sql = 'UPDATE supplytotal + $sql = "UPDATE supplytotal SET supply = (SELECT SUM(mrpsupplies.supplyquantity) FROM mrpsupplies WHERE supplytotal.part = mrpsupplies.part - AND mrpsupplies.supplyquantity > 0)'; + AND mrpsupplies.supplyquantity > 0)"; $result = DB_query($sql,$db); - $sql = 'UPDATE supplytotal SET supply = 0 WHERE supply IS NULL '; + $sql = "UPDATE supplytotal SET supply = 0 WHERE supply IS NULL"; $result = DB_query($sql,$db); -/* End Ricard modification */ // Only include directdemand mrprequirements so don't have demand for top level parts and also // show demand for the lower level parts that the upper level part generates. See MRP.php for Modified: trunk/PDFPrintLabel.php =================================================================== --- trunk/PDFPrintLabel.php 2011-04-10 02:04:57 UTC (rev 4544) +++ trunk/PDFPrintLabel.php 2011-04-10 10:41:20 UTC (rev 4545) @@ -118,15 +118,15 @@ <input type="submit" name="PDFTest" value="'. _('Print labels with borders') .'"></div>'; $iTxt=0; - echo '<script type="text/javascript"> - function setAll(all) { - var x=document.getElementById("form1"); - for (var i=0;i<x.length;i++) { - if (x.elements[i].id==\'item\'); - x.elements[i].checked=all.checked; - } - } - </script>'; + echo "<script type=\"text/javascript\"> + function setAll(all) { + var x=document.getElementById('form1'); + for (var i=0;i<x.length;i++) { + if (x.elements[i].id=='item'); + x.elements[i].checked=all.checked; + } + } + </script>"; echo '<p class="page_title_text"><img src="'.$rootpath.'/css/'.$theme.'/images/maintenance.png" title="' . _('Search') . '" alt="" />' . ' ' .$txt[$iTxt++].'</p>'; echo '<form name ="form1" action="'.$_SERVER['PHP_SELF'].'" method="POST" id="form1">'; Modified: trunk/PDFStockTransfer.php =================================================================== --- trunk/PDFStockTransfer.php 2011-04-10 02:04:57 UTC (rev 4544) +++ trunk/PDFStockTransfer.php 2011-04-10 10:41:20 UTC (rev 4545) @@ -74,7 +74,7 @@ //get the next row which will be the quantity received in the receiving location $myNextRow=DB_fetch_array($result); $ToCode=$myNextRow['loccode']; -$To = $myrow['locationname']; +$To = $myNextRow['locationname']; $Quantity=$myNextRow['qty']; $Description=$myNextRow['description']; Added: trunk/ReprintGRN.php =================================================================== --- trunk/ReprintGRN.php (rev 0) +++ trunk/ReprintGRN.php 2011-04-10 10:41:20 UTC (rev 4545) @@ -0,0 +1,100 @@ +<?php +/* $Id: ReprintGrn.php 4486 2011-02-08 09:20:50Z daintree $*/ + +include('includes/session.inc'); +$title=_('Reprint a GRN'); +include('includes/header.inc'); + +echo '<p class="page_title_text"><img src="'.$rootpath.'/css/'.$theme.'/images/supplier.png" title="' . + $title . '" alt="" />' . ' ' . $title . '</p>'; + +if (!isset($_POST['PONumber'])) { + $_POST['PONumber']=''; +} + +echo '<form action="' . $_SERVER['PHP_SELF'] . '?' . SID . '" method=post>'; +echo '<input type="hidden" name="FormID" value="' . $_SESSION['FormID'] . '" />'; +echo '<table class="selection">'; +echo '<tr><th colspan="2"><font size="2" color="navy">' . _('Select a purchase order') . '</th></tr>'; +echo '<tr><td>' . _('Enter a Purchase Order Number') . '</td>'; +echo '<td>' . '<input type="text" name="PONumber" class="number" size="7" value="'.$_POST['PONumber'].'" /></td></tr>'; +echo '<tr><td colspan=2 style="text-align: center">' . '<input type="submit" name="Show" value="Show GRNs" /></td></tr>'; + +echo '</table>'; +echo '</form>'; + +if (isset($_POST['Show'])) { + if ($_POST['PONumber']=='') { + echo '<br />'; + prnMsg( _('You must enter a purchase order number in the box above'), 'warn'); + include('includes/footer.inc'); + exit; + } + $sql="SELECT count(orderno) + FROM purchorders + WHERE orderno='" . $_POST['PONumber'] ."'"; + $result=DB_query($sql, $db); + $myrow=DB_fetch_row($result); + if ($myrow[0]==0) { + echo '<br />'; + prnMsg( _('This purchase order does not exist on the system. Please try again.'), 'warn'); + include('includes/footer.inc'); + exit; + } + $sql="SELECT grnbatch, + grnno, + grns.podetailitem, + grns.itemcode, + grns.itemdescription, + grns.deliverydate, + grns.qtyrecd, + suppliers.suppname, + stockmaster.decimalplaces + FROM grns INNER JOIN suppliers + ON grns.supplierid=suppliers.supplierid + INNER JOIN purchorderdetails + ON grns.podetailitem=purchorderdetails.podetailitem + LEFT JOIN stockmaster + ON grns.itemcode=stockmaster.stockid + WHERE orderno='" . $_POST['PONumber'] ."'"; + $result=DB_query($sql, $db); + if (DB_num_rows($result)==0) { + echo '<br />'; + prnMsg( _('There are no GRNs for this purchase order that can be reprinted.'), 'warn'); + include('includes/footer.inc'); + exit; + } + $k=0; + echo '<br /><table class="selection">'; + echo '<tr><th colspan="8"><font size="2" color="navy">' . _('GRNs for Purchase Order No') .' ' . $_POST['PONumber'] . '</th></tr>'; + echo '<tr><th>' . _('Supplier') . '</th>'; + echo '<th>' . _('PO Order line') . '</th>'; + echo '<th>' . _('GRN Number') . '</th>'; + echo '<th>' . _('Item Code') . '</th>'; + echo '<th>' . _('Item Description') . '</th>'; + echo '<th>' . _('Delivery Date') . '</th>'; + echo '<th>' . _('Quantity Received') . '</th></tr>'; + while ($myrow=DB_fetch_array($result)) { + if ($k==1){ + echo '<tr class="EvenTableRows">'; + $k=0; + } else { + echo '<tr class="OddTableRows">'; + $k=1; + } + echo '<td>' . $myrow['suppname'] . '</td>'; + echo '<td class="number">' . $myrow['podetailitem'] . '</td>'; + echo '<td class="number">' . $myrow['grnbatch'] . '</td>'; + echo '<td>' . $myrow['itemcode'] . '</td>'; + echo '<td>' . $myrow['itemdescription'] . '</td>'; + echo '<td>' . $myrow['deliverydate'] . '</td>'; + echo '<td class="number">' . number_format($myrow['qtyrecd'], $myrow['decimalplaces']) . '</td>'; + echo '<td><a href="PDFGrn.php?GRNNo=' . $myrow['grnbatch'] .'&PONo=' . $_POST['PONumber'] . '">' . _('Reprint') . '</a></td>'; + echo '</tr>'; + } + echo '</table>'; +} + +include('includes/footer.inc'); + +?> \ No newline at end of file Modified: trunk/SelectProduct.php =================================================================== --- trunk/SelectProduct.php 2011-04-10 02:04:57 UTC (rev 4544) +++ trunk/SelectProduct.php 2011-04-10 10:41:20 UTC (rev 4545) @@ -28,10 +28,10 @@ $_POST['StockCode'] = trim(strtoupper($_POST['StockCode'])); } // Always show the search facilities -$SQL = 'SELECT categoryid, +$SQL = "SELECT categoryid, categorydescription FROM stockcategory - ORDER BY categorydescription'; + ORDER BY categorydescription"; $result1 = DB_query($SQL, $db); if (DB_num_rows($result1) == 0) { echo '<p><font size=4 color=red>' . _('Problem Report') . ':</font><br />' . _('There are no stock categories currently defined please use the link below to set them up').'</p>'; @@ -671,7 +671,7 @@ $_POST['PageOffset'] = $ListPageMax; } if ($ListPageMax > 1) { - echo "<div class='centre'><p> " . $_POST['PageOffset'] . ' ' . _('of') . ' ' . $ListPageMax . ' ' . _('pages') . '. ' . _('Go to Page') . ': '; + echo '<div class="centre"><p> ' . $_POST['PageOffset'] . ' ' . _('of') . ' ' . $ListPageMax . ' ' . _('pages') . '. ' . _('Go to Page') . ': '; echo '<select name="PageOffset">'; $ListPage = 1; while ($ListPage <= $ListPageMax) { Modified: trunk/StockTransferControlled.php =================================================================== --- trunk/StockTransferControlled.php 2011-04-10 02:04:57 UTC (rev 4544) +++ trunk/StockTransferControlled.php 2011-04-10 10:41:20 UTC (rev 4545) @@ -72,14 +72,19 @@ $StockID = $LineItem->StockID; $InOutModifier=1; //seems odd, but it's correct $ShowExisting = true; -include ('includes/InputSerialItems.php'); +if (isset($TransferItem)){ + $LineNo=$TransferItem; +} else { + $LineNo=0; +} +include ('includes/OutputSerialItems.php'); /*TotalQuantity set inside this include file from the sum of the bundles of the item selected for adjusting */ -$LineItem->Quantity = $TotalQuantity; +$LineItem->Quantity = $TransferQuantity; /*Also a multi select box for adding bundles to the Transfer without keying */ include('includes/footer.inc'); exit; -?> +?> \ No newline at end of file Modified: trunk/StockTransfers.php =================================================================== --- trunk/StockTransfers.php 2011-04-10 02:04:57 UTC (rev 4544) +++ trunk/StockTransfers.php 2011-04-10 10:41:20 UTC (rev 4545) @@ -11,15 +11,19 @@ include('includes/header.inc'); include('includes/SQL_CommonFunctions.inc'); +if (isset($_GET['New'])) { + unset($_SESSION['Transfer']); +} + if (isset($_POST['CheckCode'])) { -echo '<p class="page_title_text"><img src="'.$rootpath.'/css/'.$theme.'/images/magnifier.png" title="' . _('Dispatch') . + echo '<p class="page_title_text"><img src="'.$rootpath.'/css/'.$theme.'/images/magnifier.png" title="' . _('Dispatch') . '" alt="" />' . ' ' . _('Select Item to Transfer') . '</p>'; if (strlen($_POST['StockText'])>0) { - $sql="SELECT stockid, description from stockmaster where description like '%" . $_POST['StockText'] . "%'"; + $sql="SELECT stockid, description from stockmaster where description " . LIKE . " '%" . $_POST['StockText'] . "%'"; } else { - $sql="SELECT stockid, description from stockmaster where stockid like '%" . $_POST['StockCode']."%'"; + $sql="SELECT stockid, description from stockmaster where stockid " . LIKE . " '%" . $_POST['StockCode']."%'"; } $ErrMsg=_('The stock information cannot be retrieved because'); $DbgMsg=_('The SQL to get the stock description was'); @@ -30,7 +34,7 @@ while ($myrow = DB_fetch_row($result)) { echo '<tr><td>'.$myrow[0].'</td> <td>'.$myrow[1].'</td> - <td><a href="StockTransfers.php?StockID='.$myrow[0].'&Description='.$myrow[1].'">Transfer</a></td> + <td><a href="StockTransfers.php?StockID='.$myrow[0].'&Description='.$myrow[1].'">' . _('Transfer') . '</a></td> </tr>'; } echo '</table>'; @@ -43,6 +47,7 @@ if (isset($_GET['NewTransfer'])){ unset($_SESSION['Transfer']); unset($_SESSION['TransferItem']); /*this is defined in bulk transfers but needs to be unset for individual trsnsfers */ + $NewTransfer=$_GET['NewTransfer']; } @@ -73,22 +78,24 @@ materialcost+labourcost+overheadcost as standardcost, controlled, serialised, + perishable, decimalplaces FROM stockmaster WHERE stockid='" . trim(strtoupper($_POST['StockID'])) . "'", $db); - $myrow = DB_fetch_row($result); + if (DB_num_rows($result) == 0){ prnMsg( _('Unable to locate Stock Code').' '.strtoupper($_POST['StockID']), 'error' ); } elseif (DB_num_rows($result)>0){ - - $_SESSION['Transfer']->TransferItem[0] = new LineItem ( trim(strtoupper($_POST['StockID'])), - $myrow[0], - $_POST['Quantity'], - $myrow[1], - $myrow[4], - $myrow[5], - $myrow[6]); + $myrow = DB_fetch_row($result); + $_SESSION['Transfer']->TransferItem[0] = new LineItem ( trim(strtoupper($_POST['StockID'])), + $myrow['description'], + $_POST['Quantity'], + $myrow['units'], + $myrow['controlled'], + $myrow['serialised'], + $myrow['perishable'], + $myrow['decimalplaces']); $_SESSION['Transfer']->TransferItem[0]->StandardCost = $myrow[3]; @@ -222,7 +229,8 @@ if ($SerialItemExistsRow[0]==1){ $SQL = "UPDATE stockserialitems - SET quantity= quantity - '" . $Item->BundleQty . "' + SET quantity= quantity - '" . $Item->BundleQty . "', + expirationdate='" . FormatDateForSQL($Item->ExpiryDate) . "' WHERE stockid='" . $_SESSION['Transfer']->TransferItem[0]->StockID . "' AND loccode='" . $_SESSION['Transfer']->StockLocationFrom . "' AND serialno='" . $Item->BundleRef . "'"; @@ -235,10 +243,12 @@ $SQL = "INSERT INTO stockserialitems (stockid, loccode, serialno, + expirationdate, quantity) VALUES ('" . $_SESSION['Transfer']->TransferItem[0]->StockID . "', '" . $_SESSION['Transfer']->StockLocationFrom . "', '" . $Item->BundleRef . "', + '" . FormatDateForSQL($Item->ExpiryDate) . "', '" . -$Item->BundleQty . "')"; $ErrMsg = _('CRITICAL ERROR') . '! ' . _('NOTE DOWN THIS ERROR AND SEEK ASSISTANCE') . ': ' . _('The serial stock item record could not be added because'); @@ -334,7 +344,8 @@ if ($SerialItemExistsRow[0]==1){ $SQL = "UPDATE stockserialitems - SET quantity= quantity + '" . $Item->BundleQty . "' + SET quantity= quantity + '" . $Item->BundleQty . "', + expirationdate='" . FormatDateForSQL($Item->ExpiryDate) . "' WHERE stockid='" . $_SESSION['Transfer']->TransferItem[0]->StockID . "' AND loccode='" . $_SESSION['Transfer']->StockLocationTo . "' AND serialno='" . $Item->BundleRef . "'"; @@ -347,10 +358,12 @@ $SQL = "INSERT INTO stockserialitems (stockid, loccode, serialno, + expirationdate, quantity) VALUES ('" . $_SESSION['Transfer']->TransferItem[0]->StockID . "', '" . $_SESSION['Transfer']->StockLocationTo . "', '" . $Item->BundleRef . "', + '" . FormatDateForSQL($Item->ExpiryDate) . "', '" . $Item->BundleQty . "')"; $ErrMsg = _('CRITICAL ERROR') . '! ' . _('NOTE DOWN THIS ERROR AND SEEK ASSISTANCE') . ': ' . _('The serial stock item record could not be added because'); @@ -398,7 +411,7 @@ $Result = DB_Txn_Commit($db); prnMsg(_('An inventory transfer of').' ' . $_SESSION['Transfer']->TransferItem[0]->StockID . ' - ' . $_SESSION['Transfer']->TransferItem[0]->ItemDescription . ' '. _('has been created from').' ' . $_SESSION['Transfer']->StockLocationFrom . ' '. _('to') . ' ' . $_SESSION['Transfer']->StockLocationTo . ' '._('for a quantity of').' ' . $_SESSION['Transfer']->TransferItem[0]->Quantity,'success'); - echo '</br><a href="PDFStockTransfer.php?TransferNo='.$TransferNumber.'">Print Transfer Note</a>'; + echo '</br><a href="PDFStockTransfer.php?TransferNo='.$TransferNumber.'">' . _('Print Transfer Note') . '</a>'; unset ($_SESSION['Transfer']); include ('includes/footer.inc'); exit; @@ -406,28 +419,13 @@ } -if (!isset($_SESSION['Transfer']->TransferItem[0]->StockID)) { - $_SESSION['Transfer']->TransferItem[0]->StockID = ' '; -} -if (!isset($_SESSION['Transfer']->TransferItem[0]->ItemDescription)) { - $_SESSION['Transfer']->TransferItem[0]->ItemDescription = ''; -} -if (!isset($_SESSION['Transfer']->TransferItem[0]->Controlled)) { - $_SESSION['Transfer']->TransferItem[0]->Controlled = ''; -} - echo '<p class="page_title_text"><img src="'.$rootpath.'/css/'.$theme.'/images/supplier.png" title="' . _('Dispatch') . '" alt="" />' . ' ' . $title . '</p>'; echo '<form action="'. $_SERVER['PHP_SELF'] . '" method=post>'; echo '<input type="hidden" name="FormID" value="' . $_SESSION['FormID'] . '" />'; -//echo '<table> -// <tr> -// <td>'. _('Stock Code').':</td> -// <td><input type=text name="StockID" size=21 value="' . $_SESSION['Transfer']->TransferItem[0]->StockID . '" maxlength=20></td> -// <td><input type=submit name="CheckCode" VALUE="'._('Check Part').'"></td> -// </tr>'; + if (!isset($_GET['Description'])) { $_GET['Description']=''; } @@ -446,13 +444,13 @@ } echo '</td><td><input type=submit name="CheckCode" VALUE="'._('Check Part').'"></td></tr>'; -if (strlen($_SESSION['Transfer']->TransferItem[0]->ItemDescription)>1){ +if (isset($_SESSION['Transfer']->TransferItem[0]->ItemDescription) and strlen($_SESSION['Transfer']->TransferItem[0]->ItemDescription)>1){ echo '<tr><td colspan=3><font color=BLUE size=3>' . $_SESSION['Transfer']->TransferItem[0]->ItemDescription . ' ('._('In Units of').' ' . $_SESSION['Transfer']->TransferItem[0]->PartUnit . ' )</font></td></tr>'; } echo '<tr><td>' . _('From Stock Location').':</td><td><select name="StockLocationFrom">'; -$sql = 'SELECT loccode, locationname FROM locations'; +$sql = "SELECT loccode, locationname FROM locations"; $resultStkLocs = DB_query($sql,$db); while ($myrow=DB_fetch_array($resultStkLocs)){ if (isset($_SESSION['Transfer']->StockLocationFrom)){ @@ -476,13 +474,13 @@ DB_data_seek($resultStkLocs,0); while ($myrow=DB_fetch_array($resultStkLocs)){ - if (isset($_SESSION['Transfer']->StockLocationTo)){ + if (isset($_SESSION['Transfer']) AND isset($_SESSION['Transfer']->StockLocationTo)){ if ($myrow['loccode'] == $_SESSION['Transfer']->StockLocationTo){ echo '<option selected Value="' . $myrow['loccode'] . '">' . $myrow['locationname'] . '</option>'; } else { echo '<option Value="' . $myrow['loccode'] . '">' . $myrow['locationname'] . '</option>'; } - } elseif ($myrow['loccode']==$_SESSION['UserStockLocation']){ + } elseif ($myrow['loccode']==$_SESSION['UserStockLocation'] AND isset($_SESSION['Transfer'])){ echo '<option selected Value="' . $myrow['loccode'] . '">' . $myrow['locationname'] . '</option>'; $_SESSION['Transfer']->StockLocationTo=$myrow['loccode'] . '</option>'; } else { @@ -495,18 +493,18 @@ echo '<tr><td>'._('Transfer Quantity').':</td>'; -if (!isset($_SESSION['Transfer']->TransferItem[0]->Quantity)) { - $_SESSION['Transfer']->TransferItem[0]->Quantity=0; -} - -if ($_SESSION['Transfer']->TransferItem[0]->Controlled==1){ - echo '<td class=number><input type=hidden name="Quantity" value=' . $_SESSION['Transfer']->TransferItem[0]->Quantity . '><a href="' . $rootpath .'/StockTransferControlled.php">' . $_SESSION['Transfer']->TransferItem[0]->Quantity . '</a></td></tr>'; -} else { +if (isset($_SESSION['Transfer']->TransferItem[0]->Controlled) and $_SESSION['Transfer']->TransferItem[0]->Controlled==1){ + echo '<td class=number><input type=hidden name="Quantity" value=' . $_SESSION['Transfer']->TransferItem[0]->Quantity . + '><a href="' . $rootpath .'/StockTransferControlled.php?StockLocationFrom='.$_SESSION['Transfer']->StockLocationFrom.'">' . $_SESSION['Transfer']->TransferItem[0]->Quantity . '</a></td></tr>'; +} else if (isset($_SESSION['Transfer']->TransferItem[0]->Controlled)){ echo '<td><input type=text class="number" name="Quantity" size=12 maxlength=12 value=' . $_SESSION['Transfer']->TransferItem[0]->Quantity . '></td></tr>'; +} else { + echo '<td><input type=text class="number" name="Quantity" size=12 maxlength=12 Value="0"></td></tr>'; } echo '</table><div class="centre"><br /><input type="submit" name="EnterTransfer" value="' . _('Enter Stock Transfer') . '"><br />'; + if (empty($_SESSION['Transfer']->TransferItem[0]->StockID) and isset($_POST['StockID'])) { $StockID=$_POST['StockID']; } else if (isset($_SESSION['Transfer']->TransferItem[0]->StockID)) { @@ -514,13 +512,13 @@ } else { $StockID=''; } - -echo '<br /><a href="'.$rootpath.'/StockStatus.php?StockID=' . $StockID . '">'._('Show Stock Status').'</a>'; -echo '<br /><a href="'.$rootpath.'/StockMovements.php?StockID=' . $StockID . '">'._('Show Movements').'</a>'; -echo '<br /><a href="'.$rootpath.'/StockUsage.php?StockID=' . $StockID . '&StockLocation=' . $_SESSION['Transfer']->StockLocationFrom . '">' . _('Show Stock Usage') . '</a>'; -echo '<br /><a href="'.$rootpath.'/SelectSalesOrder.php?SelectedStockItem=' . $StockID . '&StockLocation=' . $_SESSION['Transfer']->StockLocationFrom . '">' . _('Search Outstanding Sales Orders') . '</a>'; -echo '<br /><a href="'.$rootpath.'/SelectCompletedOrder.php?SelectedStockItem=' . $StockID . '">'._('Search Completed Sales Orders').'</a>'; - +if (isset($_SESSION['Transfer'])) { + echo '<br /><a href="'.$rootpath.'/StockStatus.php?StockID=' . $StockID . '">'._('Show Stock Status').'</a>'; + echo '<br /><a href="'.$rootpath.'/StockMovements.php?StockID=' . $StockID . '">'._('Show Movements').'</a>'; + echo '<br /><a href="'.$rootpath.'/StockUsage.php?StockID=' . $StockID . '&StockLocation=' . $_SESSION['Transfer']->StockLocationFrom . '">' . _('Show Stock Usage') . '</a>'; + echo '<br /><a href="'.$rootpath.'/SelectSalesOrder.php?SelectedStockItem=' . $StockID . '&StockLocation=' . $_SESSION['Transfer']->StockLocationFrom . '">' . _('Search Outstanding Sales Orders') . '</a>'; + echo '<br /><a href="'.$rootpath.'/SelectCompletedOrder.php?SelectedStockItem=' . $StockID . '">'._('Search Completed Sales Orders').'</a>'; +} echo '</div></form>'; include('includes/footer.inc'); ?> \ No newline at end of file Modified: trunk/SupplierInvoice.php =================================================================== --- trunk/SupplierInvoice.php 2011-04-10 02:04:57 UTC (rev 4544) +++ trunk/SupplierInvoice.php 2011-04-10 10:41:20 UTC (rev 4545) @@ -510,7 +510,7 @@ echo '<br /><table class=selection> <tr> <td>' . _('Comments') . '</td> - <td><TEXTAREA name=Comments COLS=40 ROWS=2>' . $_SESSION['SuppTrans']->Comments . '</textarea></td> + <td><textarea name="Comments" cols="40" rows="2">' . $_SESSION['SuppTrans']->Comments . '</textarea></td> </tr> </table>'; @@ -550,8 +550,8 @@ $InputError = True; prnMsg(_('The invoice as entered cannot be processed because the total amount of the invoice is less than 0') . '. ' . _('Invoices are expected to have a positive charge'),'error'); - echo '<p> The tax total is : ' . $TaxTotal; - echo '<p> The ovamount is : ' . $_SESSION['SuppTrans']->OvAmount; + echo '<p>' . _('The tax total is') . ' : ' . $TaxTotal; + echo '<p>' . _('The ovamount is') . ' : ' . $_SESSION['SuppTrans']->OvAmount; } elseif ( $TaxTotal + $_SESSION['SuppTrans']->OvAmount == 0){ Modified: trunk/doc/Change.log.html =================================================================== --- trunk/doc/Change.log.html 2011-04-10 02:04:57 UTC (rev 4544) +++ trunk/doc/Change.log.html 2011-04-10 10:41:20 UTC (rev 4545) @@ -1,6 +1,9 @@ <p><font SIZE=4 COLOR=BLUE><b>webERP Change Log</b></font></p> <p /> -<p> +<p>10/4/11 Tim: +<p>10/4/11 Tim: GLAccountInquiry.php show None if no tag selected</p> +<p>10/4/11 Tim : PDFPrintLabel.php javascript fix</p> +<p>10/4/11 Tim: Add perishable to StockTransfer.php and PDFStockTransfer</p> <p>10/4/11 Tim: PDFPeriodStockTransListing - new report to print off stock transactions of a specified type for a selected period>/p> <p>10/4/11 Tim: PDFStockTransListing.php option to print off transactions by inventory location</p> <p>10/4/11 Tim: Stocks.php - more logical use of $New and $_POST['New']</p> Modified: trunk/includes/DefineLabelClass.php =================================================================== --- trunk/includes/DefineLabelClass.php 2011-04-10 02:04:57 UTC (rev 4544) +++ trunk/includes/DefineLabelClass.php 2011-04-10 10:41:20 UTC (rev 4545) @@ -1,25 +1,25 @@ <?php define('MAX_LINES_PER_LABEL', 5); -define('LABELS_FILE', $_SESSION['reports_dir'] . "/labels.xml"); +define('LABELS_FILE', $_SESSION['reports_dir'] . '/labels.xml'); /** * These tags contains the more general data of the labels */ $GlobalTags = array('id'=>array('desc'=> _('Label id'), - 'type'=>'t', - 'sz'=>8, - 'maxsz'=>12), // text - 'description'=>array('desc'=>_('Description'), - 'type'=>'t', - 'sz'=>15, - 'maxsz'=>30) // text -); + 'type'=>'t', + 'sz'=>8, + 'maxsz'=>12), // text + 'description'=>array('desc'=>_('Description'), + 'type'=>'t', + 'sz'=>15, + 'maxsz'=>30) // text + ); /** * These tags specifies the dimension of individual label */ $DimensionTags = array( 'Unit'=>array('desc'=>_('Units'),'type'=>'s', - 'values'=>array('pt'=>'pt', 'in'=>'in', 'mm'=>'mm', 'cm'=>'cm' ) ), // select + 'values'=>array('pt'=>'pt', 'in'=>'in', 'mm'=>'mm', 'cm'=>'cm' ) ), // select 'Rows'=>array('desc'=>_('Rows per sheet'),'type'=>'i','sz'=>2,'maxsz'=>3), // integer numeric 'Cols'=>array('desc'=>_('Cols per sheet'),'type'=>'i','sz'=>2,'maxsz'=>3), 'Sh'=>array('desc'=>_('Sheet height'),'type'=>'n','sz'=>5,'maxsz'=>8), // float numeric @@ -164,8 +164,10 @@ * @return nothing */ function abortMsg($msg) { - global $rootpath, $DefaultClock, $Version; + global $rootpath, $DefaultClock, $Version, $theme; + $title=_('No label templates exist'); include ('includes/header.inc'); + echo '<br />'; prnMsg( $msg, 'error'); include ('includes/footer.inc'); exit; Modified: trunk/includes/DefineStockTransfers.php =================================================================== --- trunk/includes/DefineStockTransfers.php 2011-04-10 02:04:57 UTC (rev 4544) +++ trunk/includes/DefineStockTransfers.php 2011-04-10 10:41:20 UTC (rev 4545) @@ -33,13 +33,14 @@ class LineItem { var $StockID; var $ItemDescription; - Var $ShipQty; - Var $PrevRecvQty; - Var $Quantity; - Var $PartUnit; + var $ShipQty; + var $PrevRecvQty; + var $Quantity; + var $PartUnit; var $Controlled; var $Serialised; - Var $DecimalPlaces; + var $DecimalPlaces; + var $Perishable; var $SerialItems; /*array to hold controlled items*/ //Constructor function LineItem($StockID, @@ -48,6 +49,7 @@ $PartUnit, $Controlled, $Serialised, + $Perishable, $DecimalPlaces){ $this->StockID = $StockID; @@ -56,6 +58,7 @@ $this->Controlled = $Controlled; $this->Serialised = $Serialised; $this->DecimalPlaces = $DecimalPlaces; + $this->Perishable = $Perishable; $this->ShipQty = $Quantity; if ($this->Controlled==1){ $this->Quantity = 0; Modified: trunk/includes/OutputSerialItems.php =================================================================== --- trunk/includes/OutputSerialItems.php 2011-04-10 02:04:57 UTC (rev 4544) +++ trunk/includes/OutputSerialItems.php 2011-04-10 10:41:20 UTC (rev 4545) @@ -17,9 +17,9 @@ global $tableheader; /* Link to clear the list and start from scratch */ -$EditLink = '<br><div class="centre"><a href="' . $_SERVER['PHP_SELF'] . '?' . SID . '&EditControlled=true&StockID=' . $LineItem->StockID . +$EditLink = '<br><div class="centre"><a href="' . $_SERVER['PHP_SELF'] . '?EditControlled=true&StockID=' . $LineItem->StockID . '&LineNo=' . $LineNo .'">'. _('Edit'). '</a> | '; -$RemoveLink = '<a href="' . $_SERVER['PHP_SELF'] . '?' . SID . '&DELETEALL=YES&StockID=' . $LineItem->StockID . +$RemoveLink = '<a href="' . $_SERVER['PHP_SELF'] . '?DELETEALL=YES&StockID=' . $LineItem->StockID . '&LineNo=' . $LineNo .'">'. _('Remove All'). '</a><br></div>'; $sql="SELECT perishable FROM stockmaster @@ -95,8 +95,9 @@ echo '<td class=number>' . $Bundle->ExpiryDate . '</td>'; } - echo '<td><a href="' . $_SERVER['PHP_SELF'] . '?' . SID . 'Delete=' . $Bundle->BundleRef . '&StockID=' . $LineItem->StockID . '&LineNo=' . $LineNo .'">'. _('Delete'). '</a></td></tr>'; - + echo '<td><a href="' . $_SERVER['PHP_SELF'] . '?Delete=' . $Bundle->BundleRef . '&StockID=' . $LineItem->StockID . '&LineNo=' . $LineNo .'">'. _('Delete'). '</a></td></tr>'; + + $LineItem->SerialItems[]=$Bundle; $TotalQuantity += $Bundle->BundleQty; } @@ -114,13 +115,13 @@ /*Start a new table for the Serial/Batch ref input in one column (as a sub table then the multi select box for selection of existing bundle/serial nos for dispatch if applicable*/ //echo '<TABLE><TR><TD valign=TOP>'; - +$TransferQuantity=$TotalQuantity; /*in the first column add a table for the input of newies */ echo '<table class=selection>'; echo $tableheader; -echo '<form action="' . $_SERVER['PHP_SELF'] . '?=' . SID . '" name="Ga6uF5Wa" method="post"> +echo '<form action="' . $_SERVER['PHP_SELF'] . '" name="Ga6uF5Wa" method="post"> <input type=hidden name=LineNo value="' . $LineNo . '"> <input type=hidden name=StockID value="' . $StockID . '"> <input type=hidden name=EntryType value="KEYED">'; @@ -161,12 +162,18 @@ } } +if (isset($_SESSION['Transfer']->StockLocationFrom)) { + $Location=$_SESSION['Transfer']->StockLocationFrom; +} else if (isset($_SESSION['Items']->Location)) { + $Location=$_SESSION['Items']->Location; +} + $sql="SELECT serialno, quantity, expirationdate FROM stockserialitems WHERE stockid='".$StockID."' - AND loccode='".$_SESSION['Items']->Location."'"; + AND loccode='" . $Location . "'"; $result=DB_query($sql, $db); $RowNumber=0; Modified: trunk/index.php =================================================================== --- trunk/index.php 2011-04-10 02:04:57 UTC (rev 4544) +++ trunk/index.php 2011-04-10 10:41:20 UTC (rev 4545) @@ -2,8 +2,6 @@ /* $Id$*/ -//$PageSecurity = 1; now comes from DB scripts table - include('includes/session.inc'); $title=_('Main Menu'); @@ -581,12 +579,12 @@ </tr> <tr> <td class="menu_group_item"> - <?php echo '<p>• <a href="' . $rootpath . '/StockTransfers.php">' . _('Inventory Location Transfers') . '</a></p>'; ?> + <?php echo '<p>• <a href="' . $rootpath . '/StockTransfers.php?New=Yes">' . _('Inventory Location Transfers') . '</a></p>'; ?> </td> </tr> <tr> <td class="menu_group_item"> - <?php echo '<p>• <a href="' . $rootpath . '/StockAdjustments.php?NewAdjustment=Yes' . SID . '">' . _('Inventory Adjustments') . '</a></p>'; ?> + <?php echo '<p>• <a href="' . $rootpath . '/StockAdjustments.php?NewAdjustment=Yes">' . _('Inventory Adjustments') . '</a></p>'; ?> </td> </tr> <tr> Modified: trunk/sql/mysql/upgrade3.11.1-4.00.sql =================================================================== --- trunk/sql/mysql/upgrade3.11.1-4.00.sql 2011-04-10 02:04:57 UTC (rev 4544) +++ trunk/sql/mysql/upgrade3.11.1-4.00.sql 2011-04-10 10:41:20 UTC (rev 4545) @@ -841,4 +841,4 @@ ALTER TABLE `paymentmethods` ADD `usepreprintedstationery` TINYINT NOT NULL DEFAULT '0'; DELETE FROM scripts WHERE script='PDFStockTransListing.php'; INSERT INTO scripts (`script` ,`pagesecurity` ,`description`) VALUES('PDFPeriodStockTransListing.php','3','Allows stock transactions of a specific transaction type to be listed over a single day or period range'); -IUPDATE config SET confvalue='4.03.7' WHERE confname='VersionNumber'; +UPDATE config SET confvalue='4.03.7' WHERE confname='VersionNumber'; This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <dai...@us...> - 2011-04-10 10:41:28
|
Revision: 4545 http://web-erp.svn.sourceforge.net/web-erp/?rev=4545&view=rev Author: daintree Date: 2011-04-10 10:41:20 +0000 (Sun, 10 Apr 2011) Log Message: ----------- Tim launchpad stuff Modified Paths: -------------- trunk/GLAccountInquiry.php trunk/GLAccounts.php trunk/MRP.php trunk/MRPCalendar.php trunk/MRPShortages.php trunk/PDFPrintLabel.php trunk/PDFStockTransfer.php trunk/SelectProduct.php trunk/StockTransferControlled.php trunk/StockTransfers.php trunk/SupplierInvoice.php trunk/doc/Change.log.html trunk/includes/DefineLabelClass.php trunk/includes/DefineStockTransfers.php trunk/includes/OutputSerialItems.php trunk/index.php trunk/sql/mysql/upgrade3.11.1-4.00.sql Added Paths: ----------- trunk/ReprintGRN.php Modified: trunk/GLAccountInquiry.php =================================================================== --- trunk/GLAccountInquiry.php 2011-04-10 02:04:57 UTC (rev 4544) +++ trunk/GLAccountInquiry.php 2011-04-10 10:41:20 UTC (rev 4545) @@ -268,7 +268,9 @@ $tagsql="SELECT tagdescription FROM tags WHERE tagref='".$myrow['tag'] . "'"; $tagresult=DB_query($tagsql,$db); $tagrow = DB_fetch_array($tagresult); - + if ($tagrow['tagdescription']=='') { + $tagrow['tagdescription']=_('None'); + } printf("<td>%s</td> <td class=number><a href='%s'>%s</a></td> <td>%s</td> Modified: trunk/GLAccounts.php =================================================================== --- trunk/GLAccounts.php 2011-04-10 02:04:57 UTC (rev 4544) +++ trunk/GLAccounts.php 2011-04-10 10:41:20 UTC (rev 4545) @@ -1,8 +1,6 @@ <?php -/* $Revision: 1.21 $ */ /* $Id$*/ -//$PageSecurity = 10; include('includes/session.inc'); $title = _('Chart of Accounts Maintenance'); @@ -58,19 +56,6 @@ )"; $result = DB_query($sql,$db,$ErrMsg); - /*Add the new chart details records for existing periods first */ -/*Maybe not required since these will be created from GLPostings.inc with correct B/fwd balances - $ErrMsg = _('Could not add the chart details for the new account'); - - $sql = 'INSERT INTO chartdetails (accountcode, period) - SELECT chartmaster.accountcode, periods.periodno - FROM chartmaster - CROSS JOIN periods - WHERE ( chartmaster.accountcode, periods.periodno ) NOT - IN ( SELECT chartdetails.accountcode, chartdetails.period FROM chartdetails )'; - - $result = DB_query($sql,$db,$ErrMsg); -*/ prnMsg(_('The new general ledger account has been added'),'success'); } @@ -218,7 +203,7 @@ if (!isset($_GET['delete'])) { - echo "<form method='post' name='GLAccounts' action='" . $_SERVER['PHP_SELF'] . '?' . SID . "'>"; + echo '<form method="post" name="GLAccounts" action="' . $_SERVER['PHP_SELF'] . '">'; echo '<input type="hidden" name="FormID" value="' . $_SESSION['FormID'] . '" />'; if (isset($SelectedAccount)) { @@ -233,12 +218,16 @@ $_POST['AccountName'] = $myrow['accountname']; $_POST['Group'] = $myrow['group_']; - echo "<input type=hidden name='SelectedAccount' VALUE=$SelectedAccount>"; - echo "<input type=hidden name='AccountCode' VALUE=" . $_POST['AccountCode'] .">"; - echo "<table class=selection><tr><td>" . _('Account Code') . ":</td><td>" . $_POST['AccountCode'] . "</td></tr>"; + echo '<input type="hidden" name="SelectedAccount" value="' . $SelectedAccount . '">'; + echo '<input type="hidden" name="AccountCode" VALUE="' . $_POST['AccountCode'] .'">'; + echo '<table class=selection> + <tr><td>' . _('Account Code') . ':</td> + <td>' . $_POST['AccountCode'] . '</td></tr>'; } else { echo "<table class=selection>"; - echo "<tr><td>" . _('Account Code') . ":</td><td><input type=TEXT name='AccountCode' size=11 class=number maxlength=10></td></tr>"; + echo '<tr><td>' . _('Account Code') . ':</td> + <td><input type="text" name="AccountCode" size="11" class="number" maxlength="10" /></td> + </tr>'; } if (!isset($_POST['AccountName'])) {$_POST['AccountName']='';} @@ -251,17 +240,17 @@ while ($myrow = DB_fetch_array($result)){ if (isset($_POST['Group']) and $myrow[0]==$_POST['Group']){ - echo "<option selected VALUE='"; + echo '<option selected value="'; } else { - echo "<option VALUE='"; + echo '<option VALUE="'; } - echo $myrow[0] . "'>" . $myrow[0]; + echo $myrow[0] . '">' . $myrow[0] . '</option>'; } if (!isset($_GET['SelectedAccount']) or $_GET['SelectedAccount']=='') { - echo "<script>defaultControl(document.GLAccounts.AccountCode);</script>"; + echo '<script>defaultControl(document.GLAccounts.AccountCode);</script>'; } else { - echo "<script>defaultControl(document.GLAccounts.AccountName);</script>"; + echo '<script>defaultControl(document.GLAccounts.AccountName);</script>'; } echo '</select></td></tr></table>'; @@ -293,12 +282,12 @@ $result = DB_query($sql,$db,$ErrMsg); echo '<br><table class=selection>'; - echo "<tr> - <th>" . _('Account Code') . "</th> - <th>" . _('Account Name') . "</th> - <th>" . _('Account Group') . "</th> - <th>" . _('P/L or B/S') . "</th> - </tr>"; + echo '<tr> + <th>' . _('Account Code') . '</th> + <th>' . _('Account Name') . '</th> + <th>' . _('Account Group') . '</th> + <th>' . _('P/L or B/S') . '</th> + </tr>'; $k=0; //row colour counter @@ -323,9 +312,9 @@ $myrow[1], $myrow[2], $myrow[3], - $_SERVER['PHP_SELF'] . '?' . SID, + $_SERVER['PHP_SELF'] . '?', $myrow[0], - $_SERVER['PHP_SELF'] . '?' . SID, + $_SERVER['PHP_SELF'] . '?', $myrow[0]); } @@ -338,10 +327,10 @@ echo '<p>'; if (isset($SelectedAccount)) { - echo "<div class='centre'><a href='" . $_SERVER['PHP_SELF'] . '?' . SID ."'>" . _('Show All Accounts') . '</a></div>'; + echo '<div class="centre"><a href="' . $_SERVER['PHP_SELF'] . '">' . _('Show All Accounts') . '</a></div>'; } -echo '<p>'; +echo '<p />'; include('includes/footer.inc'); ?> \ No newline at end of file Modified: trunk/MRP.php =================================================================== --- trunk/MRP.php 2011-04-10 02:04:57 UTC (rev 4544) +++ trunk/MRP.php 2011-04-10 10:41:20 UTC (rev 4545) @@ -1,9 +1,7 @@ <?php -/* $Revision: 1.7 $ */ + /* $Id$*/ -//$PageSecurity=9; - include('includes/session.inc'); $title = _('Run MRP Calculation'); include('includes/header.inc'); @@ -18,21 +16,21 @@ echo '</br>' ._('Start time') . ': ' . date('h:i:s') . '</br>'; echo '</br>' . _('Initialising tables .....') . '</br>'; flush(); - $result = DB_query('DROP TABLE IF EXISTS tempbom',$db); - $result = DB_query('DROP TABLE IF EXISTS passbom',$db); - $result = DB_query('DROP TABLE IF EXISTS passbom2',$db); - $result = DB_query('DROP TABLE IF EXISTS bomlevels',$db); - $result = DB_query('DROP TABLE IF EXISTS levels',$db); + $result = DB_query("DROP TABLE IF EXISTS tempbom",$db); + $result = DB_query("DROP TABLE IF EXISTS passbom",$db); + $result = DB_query("DROP TABLE IF EXISTS passbom2",$db); + $result = DB_query("DROP TABLE IF EXISTS bomlevels",$db); + $result = DB_query("DROP TABLE IF EXISTS levels",$db); - $sql = 'CREATE TEMPORARY TABLE passbom (part char(20), - sortpart text) DEFAULT CHARSET=utf8'; + $sql = "CREATE TEMPORARY TABLE passbom (part char(20), + sortpart text) DEFAULT CHARSET=utf8"; $ErrMsg = _('The SQL to to create passbom failed with the message'); $result = DB_query($sql,$db,$ErrMsg); - $sql = 'CREATE TEMPORARY TABLE tempbom (parent char(20), + $sql = "CREATE TEMPORARY TABLE tempbom (parent char(20), component char(20), sortpart text, - level int) DEFAULT CHARSET=utf8'; + level int) DEFAULT CHARSET=utf8"; $result = DB_query($sql,$db,_('Create of tempbom failed because')); // To create levels, first, find parts in bom that are top level assemblies. // Do this by doing a LEFT JOIN from bom to bom (as bom2), linking @@ -45,10 +43,10 @@ flush(); // This finds the top level $sql = "INSERT INTO passbom (part, sortpart) - SELECT bom.component AS part, - CONCAT(bom.parent,'%',bom.component) AS sortpart - FROM bom LEFT JOIN bom as bom2 ON bom.parent = bom2.component - WHERE bom2.component IS NULL"; + SELECT bom.component AS part, + CONCAT(bom.parent,'%',bom.component) AS sortpart + FROM bom LEFT JOIN bom as bom2 ON bom.parent = bom2.component + WHERE bom2.component IS NULL"; $result = DB_query($sql,$db); $lctr = 2; @@ -76,12 +74,12 @@ FROM bom,passbom WHERE bom.parent = passbom.part"; $result = DB_query($sql,$db); - $result = DB_query('DROP TABLE IF EXISTS passbom2',$db); - $result = DB_query('ALTER TABLE passbom RENAME AS passbom2',$db); - $result = DB_query('DROP TABLE IF EXISTS passbom',$db); + $result = DB_query("DROP TABLE IF EXISTS passbom2",$db); + $result = DB_query("ALTER TABLE passbom RENAME AS passbom2",$db); + $result = DB_query("DROP TABLE IF EXISTS passbom",$db); - $sql = 'CREATE TEMPORARY TABLE passbom (part char(20), - sortpart text) DEFAULT CHARSET=utf8'; + $sql = "CREATE TEMPORARY TABLE passbom (part char(20), + sortpart text) DEFAULT CHARSET=utf8"; $result = DB_query($sql,$db); $sql = "INSERT INTO passbom (part, sortpart) @@ -92,9 +90,9 @@ $result = DB_query($sql,$db); - $sql = 'SELECT COUNT(*) FROM bom + $sql = "SELECT COUNT(*) FROM bom INNER JOIN passbom ON bom.parent = passbom.part - GROUP BY bom.parent'; + GROUP BY bom.parent"; $result = DB_query($sql,$db); $myrow = DB_fetch_row($result); @@ -104,9 +102,9 @@ prnMsg(_('Creating bomlevels table'),'info'); flush(); - $sql = 'CREATE TEMPORARY TABLE bomlevels ( + $sql = "CREATE TEMPORARY TABLE bomlevels ( part char(20), - level int) DEFAULT CHARSET=utf8'; + level int) DEFAULT CHARSET=utf8"; $result = DB_query($sql,$db); // Read tempbom and split sortpart into separate parts. For each separate part, calculate level as @@ -114,7 +112,7 @@ // part in the array for a level 4 sortpart would be created as a level 3 in levels, the fourth // and last part in sortpart would have a level code of zero, meaning it has no components - $sql = 'SELECT * FROM tempbom'; + $sql = "SELECT * FROM tempbom"; $result = DB_query($sql,$db); while ($myrow=DB_fetch_array($result)) { $parts = explode('%',$myrow['sortpart']); @@ -140,7 +138,7 @@ shrinkfactor double NOT NULL default '0', eoq double NOT NULL default '0') DEFAULT CHARSET=utf8"; $result = DB_query($sql,$db); - $sql = 'INSERT INTO levels (part, + $sql = "INSERT INTO levels (part, level, leadtime, pansize, @@ -157,15 +155,15 @@ GROUP BY bomlevels.part, pansize, shrinkfactor, - stockmaster.eoq'; + stockmaster.eoq"; $result = DB_query($sql,$db); - $sql = 'ALTER TABLE levels ADD INDEX part(part)'; + $sql = "ALTER TABLE levels ADD INDEX part(part)"; $result = DB_query($sql,$db); // Create levels records with level of zero for all parts in stockmaster that // are not in bom - $sql = 'INSERT INTO levels (part, + $sql = "INSERT INTO levels (part, level, leadtime, pansize, @@ -179,53 +177,53 @@ stockmaster.eoq FROM stockmaster LEFT JOIN levels ON stockmaster.stockid = levels.part - WHERE levels.part IS NULL'; + WHERE levels.part IS NULL"; $result = DB_query($sql,$db); // Update leadtime in levels from purchdata. Do it twice so can make sure leadtime from preferred // vendor is used - $sql = 'UPDATE levels,purchdata + $sql = "UPDATE levels,purchdata SET levels.leadtime = purchdata.leadtime WHERE levels.part = purchdata.stockid - AND purchdata.leadtime > 0'; + AND purchdata.leadtime > 0"; $result = DB_query($sql,$db); - $sql = 'UPDATE levels,purchdata + $sql = "UPDATE levels,purchdata SET levels.leadtime = purchdata.leadtime WHERE levels.part = purchdata.stockid AND purchdata.preferred = 1 - AND purchdata.leadtime > 0'; + AND purchdata.leadtime > 0"; $result = DB_query($sql,$db); prnMsg(_('Levels table has been created'),'info'); flush(); // Get rid if temporary tables - $sql = 'DROP TABLE IF EXISTS tempbom'; + $sql = "DROP TABLE IF EXISTS tempbom"; //$result = DB_query($sql,$db); - $sql = 'DROP TABLE IF EXISTS passbom'; + $sql = "DROP TABLE IF EXISTS passbom"; //$result = DB_query($sql,$db); - $sql = 'DROP TABLE IF EXISTS passbom2'; + $sql = "DROP TABLE IF EXISTS passbom2"; //$result = DB_query($sql,$db); - $sql = 'DROP TABLE IF EXISTS bomlevels'; + $sql = "DROP TABLE IF EXISTS bomlevels"; //$result = DB_query($sql,$db); // In the following section, create mrprequirements from open sales orders and // mrpdemands prnMsg(_('Creating requirements table'),'info'); flush(); - $result = DB_query('DROP TABLE IF EXISTS mrprequirements',$db); + $result = DB_query("DROP TABLE IF EXISTS mrprequirements",$db); // directdemand is 1 if demand is directly for this part, is 0 if created because have netted // out supply and demands for a top level part and determined there is still a net // requirement left and have to pass that down to the BOM parts using the // CreateLowerLevelRequirement() function. Mostly do this so can distinguish the type // of requirements for the MRPShortageReport so don't show double requirements. - $sql = 'CREATE TABLE mrprequirements ( part char(20), + $sql = "CREATE TABLE mrprequirements ( part char(20), daterequired date, quantity double, mrpdemandtype varchar(6), orderno int(11), directdemand smallint, - whererequired char(20)) DEFAULT CHARSET=utf8'; + whererequired char(20)) DEFAULT CHARSET=utf8"; $result = DB_query($sql,$db,_('Create of mrprequirements failed because')); prnMsg(_('Loading requirements from sales orders'),'info'); Modified: trunk/MRPCalendar.php =================================================================== --- trunk/MRPCalendar.php 2011-04-10 02:04:57 UTC (rev 4544) +++ trunk/MRPCalendar.php 2011-04-10 10:41:20 UTC (rev 4545) @@ -1,12 +1,10 @@ <?php /* $Id$ */ -/* $Revision: 1.6 $ */ + // MRPCalendar.php // Maintains the calendar of valid manufacturing dates for MRP -//$PageSecurity=9; - include('includes/session.inc'); $title = _('MRP Calendar'); include('includes/header.inc'); @@ -75,15 +73,15 @@ return; } - $sql = 'DROP TABLE IF EXISTS mrpcalendar'; + $sql = "DROP TABLE IF EXISTS mrpcalendar"; $result = DB_query($sql,$db); - $sql = 'CREATE TABLE mrpcalendar ( + $sql = "CREATE TABLE mrpcalendar ( calendardate date NOT NULL, daynumber int(6) NOT NULL, - manufacturingflag smallint(6) NOT NULL default "1", + manufacturingflag smallint(6) NOT NULL default '1', INDEX (daynumber), - PRIMARY KEY (calendardate))'; + PRIMARY KEY (calendardate)) DEFAULT CHARSET=utf8"; $ErrMsg = _('The SQL to to create passbom failed with the message'); $result = DB_query($sql,$db,$ErrMsg); @@ -95,9 +93,9 @@ $ExcludeDays = array($_POST['Sunday'],$_POST['Monday'],$_POST['Tuesday'],$_POST['Wednesday'], $_POST['Thursday'],$_POST['Friday'],$_POST['Saturday']); - $caldate = $convertfromdate; + $CalDate = $convertfromdate; for ($i = 0; $i <= $datediff; $i++) { - $dateadd = FormatDateForSQL(DateAdd($caldate,"d",$i)); + $dateadd = FormatDateForSQL(DateAdd($CalDate,"d",$i)); // If the check box for the calendar date's day of week was clicked, set the manufacturing flag to 0 $dayofweek = DayOfWeekFromSQLDate($dateadd); @@ -121,16 +119,16 @@ // Update daynumber. Set it so non-manufacturing days will have the same daynumber as a valid // manufacturing day that precedes it. That way can read the table by the non-manufacturing day, // subtract the leadtime from the daynumber, and find the valid manufacturing day with that daynumber. - $daynumber = 1; - $sql = 'SELECT * FROM mrpcalendar ORDER BY calendardate'; + $DayNumber = 1; + $sql = "SELECT * FROM mrpcalendar ORDER BY calendardate"; $result = DB_query($sql,$db,$ErrMsg); while ($myrow = DB_fetch_array($result)) { if ($myrow['manufacturingflag'] == "1") { - $daynumber++; + $DayNumber++; } - $caldate = $myrow['calendardate']; - $sql = "UPDATE mrpcalendar SET daynumber = '$daynumber' - WHERE calendardate = '$caldate'"; + $CalDate = $myrow['calendardate']; + $sql = "UPDATE mrpcalendar SET daynumber = '" . $DayNumber . "' + WHERE calendardate = '$CalDate'"; $resultupdate = DB_query($sql,$db,$ErrMsg); } prnMsg(_("The MRP Calendar has been created"),'succes'); @@ -145,9 +143,9 @@ // After change the flag, re-calculate the daynumber for all dates. $InputError = 0; - $caldate = FormatDateForSQL($ChangeDate); + $CalDate = FormatDateForSQL($ChangeDate); $sql="SELECT COUNT(*) FROM mrpcalendar - WHERE calendardate='$caldate' + WHERE calendardate='$CalDate' GROUP BY calendardate"; $result = DB_query($sql,$db); $myrow = DB_fetch_row($result); @@ -161,7 +159,7 @@ return; } - $sql="SELECT mrpcalendar.* FROM mrpcalendar WHERE calendardate='$caldate'"; + $sql="SELECT mrpcalendar.* FROM mrpcalendar WHERE calendardate='$CalDate'"; $result = DB_query($sql,$db); $myrow = DB_fetch_row($result); $newmanufacturingflag = 0; @@ -169,7 +167,7 @@ $newmanufacturingflag = 1; } $sql = "UPDATE mrpcalendar SET manufacturingflag = '".$newmanufacturingflag."' - WHERE calendardate = '".$caldate."'"; + WHERE calendardate = '".$CalDate."'"; $ErrMsg = _('Cannot update the MRP Calendar'); $resultupdate = DB_query($sql,$db,$ErrMsg); prnMsg(_("The MRP calendar record for $ChangeDate has been updated"),'success'); @@ -180,16 +178,16 @@ // Update daynumber. Set it so non-manufacturing days will have the same daynumber as a valid // manufacturing day that precedes it. That way can read the table by the non-manufacturing day, // subtract the leadtime from the daynumber, and find the valid manufacturing day with that daynumber. - $daynumber = 1; - $sql = 'SELECT * FROM mrpcalendar ORDER BY calendardate'; + $DayNumber = 1; + $sql = "SELECT * FROM mrpcalendar ORDER BY calendardate"; $result = DB_query($sql,$db,$ErrMsg); while ($myrow = DB_fetch_array($result)) { - if ($myrow['manufacturingflag'] == "1") { - $daynumber++; + if ($myrow['manufacturingflag'] == '1') { + $DayNumber++; } - $caldate = $myrow['calendardate']; - $sql = "UPDATE mrpcalendar SET daynumber = '$daynumber' - WHERE calendardate = '$caldate'"; + $CalDate = $myrow['calendardate']; + $sql = "UPDATE mrpcalendar SET daynumber = '" . $DayNumber . "' + WHERE calendardate = '" . $CalDate . "'"; $resultupdate = DB_query($sql,$db,$ErrMsg); } // End of while @@ -199,24 +197,24 @@ function listall(&$db) //####LISTALL_LISTALL_LISTALL_LISTALL_LISTALL_LISTALL_LISTALL_#### { // List all records in date range - $fromdate = FormatDateForSQL($_POST['FromDate']); - $todate = FormatDateForSQL($_POST['ToDate']); + $FromDate = FormatDateForSQL($_POST['FromDate']); + $ToDate = FormatDateForSQL($_POST['ToDate']); $sql = "SELECT calendardate, daynumber, manufacturingflag, DAYNAME(calendardate) as dayname FROM mrpcalendar - WHERE calendardate >='$fromdate' - AND calendardate <='$todate'"; + WHERE calendardate >='" . $FromDate . "' + AND calendardate <='" . $ToDate . "'"; $ErrMsg = _('The SQL to find the parts selected failed with the message'); $result = DB_query($sql,$db,$ErrMsg); - echo "</br><table class=selection> - <tr BGCOLOR =#800000> - <th>" . _('Date') . "</th> - <th>" . _('Manufacturing Date') . "</th> - </tr></font>"; + echo '</br><table class="selection"> + <tr bgcolor ="#800000"> + <th>' . _('Date') . '</th> + <th>' . _('Manufacturing Date') . '</th> + </tr>'; $ctr = 0; while ($myrow = DB_fetch_array($result)) { $flag = _('Yes'); @@ -251,51 +249,51 @@ $_POST['FromDate']=date($_SESSION['DefaultDateFormat']); $_POST['ToDate']=date($_SESSION['DefaultDateFormat']); } - echo "<form action=" . $_SERVER['PHP_SELF'] . "?" . SID ." method=post></br></br>"; + echo '<form action="' . $_SERVER['PHP_SELF'] . '" method="post"><br /><br />'; echo '<input type="hidden" name="FormID" value="' . $_SESSION['FormID'] . '" />'; - echo '<br><table class=selection>'; + echo '<br><table class="selection">'; echo '<tr> - <td>' . _('From Date') . ":</td> - <td><input type='Text' class=date alt='".$_SESSION['DefaultDateFormat'] ."' name='FromDate' size=10 maxlength=10 value=" . $_POST['FromDate'] . '></td></tr> - <tr></tr><td>' . _('To Date') . ":</td> - <td><input type='Text' class=date alt='".$_SESSION['DefaultDateFormat'] ."' name='ToDate' size=10 maxlength=10 value=" . $_POST['ToDate'] . '></td> + <td>' . _('From Date') . ':</td> + <td><input type="text" class="date" alt="' . $_SESSION['DefaultDateFormat'] .'" name="FromDate" size="10" maxlength="10" value="' . $_POST['FromDate'] . '"></td></tr> + <tr></tr><td>' . _('To Date') . ':</td> + <td><input type="text" class="date" alt="' . $_SESSION['DefaultDateFormat'] .'" name="ToDate" size="10" maxlength="10" value="' . $_POST['ToDate'] . '"></td> </tr> <tr><td></td></tr> <tr><td></td></tr> <tr><td>'._('Exclude The Following Days').'</td></tr> <tr> - <td>' . _('Saturday') . ":</td> - <td><input type='checkbox' name='Saturday' value='Saturday'></td> + <td>' . _('Saturday') . ':</td> + <td><input type="checkbox" name="Saturday" value="Saturday"></td> </tr> <tr> - <td>" . _('Sunday') . ":</td> - <td><input type='checkbox' name='Sunday' value='Sunday'></td> + <td>' . _('Sunday') . ':</td> + <td><input type="checkbox" name="Sunday" value="Sunday"></td> </tr> <tr> - <td>" . _('Monday') . ":</td> - <td><input type='checkbox' name='Monday' value='Monday'></td> + <td>' . _('Monday') . ':</td> + <td><input type="checkbox" name="Monday" value="Monday"></td> </tr> <tr> - <td>" . _('Tuesday') . ":</td> - <td><input type='checkbox' name='Tuesday' value='Tuesday'></td> + <td>' . _('Tuesday') . ':</td> + <td><input type="checkbox" name="Tuesday" value="Tuesday"></td> </tr> <tr> - <td>" . _('Wednesday') . ":</td> - <td><input type='checkbox' name='Wednesday' value='Wednesday'></td> + <td>' . _('Wednesday') . ':</td> + <td><input type="checkbox" name="Wednesday" value="Wednesday"></td> </tr> <tr> - <td>" . _('Thursday') . ":</td> - <td><input type='checkbox' name='Thursday' value='Thursday'></td> + <td>' . _('Thursday') . ':</td> + <td><input type="checkbox" name="Thursday" value="Thursday"></td> </tr> <tr> - <td>" . _('Friday') . ":</td> - <td><input type='checkbox' name='Friday' value='Friday'></td> + <td>' . _('Friday') . ':</td> + <td><input type="checkbox" name="Friday" value="Friday"></td> </tr> </table><br> - <div class=centre><input type='submit' name='submit' value='" . _('Create Calendar') . "'> - <input type='submit' name='listall' value='" . _('List Date Range') . "'></div>"; + <div class=centre><input type="submit" name="submit" value="' . _('Create Calendar') . '"> + <input type="submit" name="listall" value="' . _('List Date Range') . '"></div>'; if (!isset($_POST['ChangeDate'])) { $_POST['ChangeDate']=date($_SESSION['DefaultDateFormat']); @@ -303,15 +301,14 @@ echo '<br><table class=selection>'; echo '<tr> - <td>' . _('Change Date Status') . ":</td> - <td><input type='Text' name='ChangeDate' class=date alt='".$_SESSION['DefaultDateFormat'] . - "' size=12 maxlength=12 value=" . $_POST['ChangeDate'] . '></td> + <td>' . _('Change Date Status') . ':</td> + <td><input type="text" name="ChangeDate" class="date" alt="' . $_SESSION['DefaultDateFormat'] . + '" size="12" maxlength="12" value="' . $_POST['ChangeDate'] . '"></td> <td><input type="submit" name="update" value="' . _('Update') . '"></td></tr></table>'; -echo "</br></br><div class='centre'></div>"; +echo '<br /><br /><div class="centre"></div>'; echo '</form>'; } // End of function display() - include('includes/footer.inc'); ?> \ No newline at end of file Modified: trunk/MRPShortages.php =================================================================== --- trunk/MRPShortages.php 2011-04-10 02:04:57 UTC (rev 4544) +++ trunk/MRPShortages.php 2011-04-10 10:41:20 UTC (rev 4545) @@ -6,7 +6,7 @@ include('includes/session.inc'); //ANSI SQL??? -$sql='SHOW TABLES WHERE Tables_in_'.$_SESSION['DatabaseName']."='mrprequirements'"; +$sql="SHOW TABLES WHERE Tables_in_" . $_SESSION['DatabaseName'] . "='mrprequirements'"; $result=DB_query($sql,$db); if (DB_num_rows($result)==0) { @@ -32,48 +32,47 @@ // total for either supply or demand. Did this to simplify main sql where used // several subqueries. - $sql = 'CREATE TEMPORARY TABLE demandtotal ( + $sql = "CREATE TEMPORARY TABLE demandtotal ( part char(20), demand double, - KEY `PART` (`part`)) DEFAULT CHARSET=utf8'; + KEY `PART` (`part`)) DEFAULT CHARSET=utf8"; $result = DB_query($sql,$db,_('Create of demandtotal failed because')); - $sql = 'INSERT INTO demandtotal + $sql = "INSERT INTO demandtotal (part, demand) SELECT part, SUM(quantity) as demand FROM mrprequirements - GROUP BY part'; + GROUP BY part"; $result = DB_query($sql,$db); - $sql = 'CREATE TEMPORARY TABLE supplytotal ( + $sql = "CREATE TEMPORARY TABLE supplytotal ( part char(20), supply double, - KEY `PART` (`part`)) DEFAULT CHARSET=utf8'; + KEY `PART` (`part`)) DEFAULT CHARSET=utf8"; $result = DB_query($sql,$db,_('Create of supplytotal failed because')); /* 21/03/2010: Ricard modification to allow items with total supply = 0 be included in the report */ - $sql = 'INSERT INTO supplytotal + $sql = "INSERT INTO supplytotal (part, supply) SELECT stockid, 0 - FROM stockmaster'; + FROM stockmaster"; $result = DB_query($sql,$db); - $sql = 'UPDATE supplytotal + $sql = "UPDATE supplytotal SET supply = (SELECT SUM(mrpsupplies.supplyquantity) FROM mrpsupplies WHERE supplytotal.part = mrpsupplies.part - AND mrpsupplies.supplyquantity > 0)'; + AND mrpsupplies.supplyquantity > 0)"; $result = DB_query($sql,$db); - $sql = 'UPDATE supplytotal SET supply = 0 WHERE supply IS NULL '; + $sql = "UPDATE supplytotal SET supply = 0 WHERE supply IS NULL"; $result = DB_query($sql,$db); -/* End Ricard modification */ // Only include directdemand mrprequirements so don't have demand for top level parts and also // show demand for the lower level parts that the upper level part generates. See MRP.php for Modified: trunk/PDFPrintLabel.php =================================================================== --- trunk/PDFPrintLabel.php 2011-04-10 02:04:57 UTC (rev 4544) +++ trunk/PDFPrintLabel.php 2011-04-10 10:41:20 UTC (rev 4545) @@ -118,15 +118,15 @@ <input type="submit" name="PDFTest" value="'. _('Print labels with borders') .'"></div>'; $iTxt=0; - echo '<script type="text/javascript"> - function setAll(all) { - var x=document.getElementById("form1"); - for (var i=0;i<x.length;i++) { - if (x.elements[i].id==\'item\'); - x.elements[i].checked=all.checked; - } - } - </script>'; + echo "<script type=\"text/javascript\"> + function setAll(all) { + var x=document.getElementById('form1'); + for (var i=0;i<x.length;i++) { + if (x.elements[i].id=='item'); + x.elements[i].checked=all.checked; + } + } + </script>"; echo '<p class="page_title_text"><img src="'.$rootpath.'/css/'.$theme.'/images/maintenance.png" title="' . _('Search') . '" alt="" />' . ' ' .$txt[$iTxt++].'</p>'; echo '<form name ="form1" action="'.$_SERVER['PHP_SELF'].'" method="POST" id="form1">'; Modified: trunk/PDFStockTransfer.php =================================================================== --- trunk/PDFStockTransfer.php 2011-04-10 02:04:57 UTC (rev 4544) +++ trunk/PDFStockTransfer.php 2011-04-10 10:41:20 UTC (rev 4545) @@ -74,7 +74,7 @@ //get the next row which will be the quantity received in the receiving location $myNextRow=DB_fetch_array($result); $ToCode=$myNextRow['loccode']; -$To = $myrow['locationname']; +$To = $myNextRow['locationname']; $Quantity=$myNextRow['qty']; $Description=$myNextRow['description']; Added: trunk/ReprintGRN.php =================================================================== --- trunk/ReprintGRN.php (rev 0) +++ trunk/ReprintGRN.php 2011-04-10 10:41:20 UTC (rev 4545) @@ -0,0 +1,100 @@ +<?php +/* $Id: ReprintGrn.php 4486 2011-02-08 09:20:50Z daintree $*/ + +include('includes/session.inc'); +$title=_('Reprint a GRN'); +include('includes/header.inc'); + +echo '<p class="page_title_text"><img src="'.$rootpath.'/css/'.$theme.'/images/supplier.png" title="' . + $title . '" alt="" />' . ' ' . $title . '</p>'; + +if (!isset($_POST['PONumber'])) { + $_POST['PONumber']=''; +} + +echo '<form action="' . $_SERVER['PHP_SELF'] . '?' . SID . '" method=post>'; +echo '<input type="hidden" name="FormID" value="' . $_SESSION['FormID'] . '" />'; +echo '<table class="selection">'; +echo '<tr><th colspan="2"><font size="2" color="navy">' . _('Select a purchase order') . '</th></tr>'; +echo '<tr><td>' . _('Enter a Purchase Order Number') . '</td>'; +echo '<td>' . '<input type="text" name="PONumber" class="number" size="7" value="'.$_POST['PONumber'].'" /></td></tr>'; +echo '<tr><td colspan=2 style="text-align: center">' . '<input type="submit" name="Show" value="Show GRNs" /></td></tr>'; + +echo '</table>'; +echo '</form>'; + +if (isset($_POST['Show'])) { + if ($_POST['PONumber']=='') { + echo '<br />'; + prnMsg( _('You must enter a purchase order number in the box above'), 'warn'); + include('includes/footer.inc'); + exit; + } + $sql="SELECT count(orderno) + FROM purchorders + WHERE orderno='" . $_POST['PONumber'] ."'"; + $result=DB_query($sql, $db); + $myrow=DB_fetch_row($result); + if ($myrow[0]==0) { + echo '<br />'; + prnMsg( _('This purchase order does not exist on the system. Please try again.'), 'warn'); + include('includes/footer.inc'); + exit; + } + $sql="SELECT grnbatch, + grnno, + grns.podetailitem, + grns.itemcode, + grns.itemdescription, + grns.deliverydate, + grns.qtyrecd, + suppliers.suppname, + stockmaster.decimalplaces + FROM grns INNER JOIN suppliers + ON grns.supplierid=suppliers.supplierid + INNER JOIN purchorderdetails + ON grns.podetailitem=purchorderdetails.podetailitem + LEFT JOIN stockmaster + ON grns.itemcode=stockmaster.stockid + WHERE orderno='" . $_POST['PONumber'] ."'"; + $result=DB_query($sql, $db); + if (DB_num_rows($result)==0) { + echo '<br />'; + prnMsg( _('There are no GRNs for this purchase order that can be reprinted.'), 'warn'); + include('includes/footer.inc'); + exit; + } + $k=0; + echo '<br /><table class="selection">'; + echo '<tr><th colspan="8"><font size="2" color="navy">' . _('GRNs for Purchase Order No') .' ' . $_POST['PONumber'] . '</th></tr>'; + echo '<tr><th>' . _('Supplier') . '</th>'; + echo '<th>' . _('PO Order line') . '</th>'; + echo '<th>' . _('GRN Number') . '</th>'; + echo '<th>' . _('Item Code') . '</th>'; + echo '<th>' . _('Item Description') . '</th>'; + echo '<th>' . _('Delivery Date') . '</th>'; + echo '<th>' . _('Quantity Received') . '</th></tr>'; + while ($myrow=DB_fetch_array($result)) { + if ($k==1){ + echo '<tr class="EvenTableRows">'; + $k=0; + } else { + echo '<tr class="OddTableRows">'; + $k=1; + } + echo '<td>' . $myrow['suppname'] . '</td>'; + echo '<td class="number">' . $myrow['podetailitem'] . '</td>'; + echo '<td class="number">' . $myrow['grnbatch'] . '</td>'; + echo '<td>' . $myrow['itemcode'] . '</td>'; + echo '<td>' . $myrow['itemdescription'] . '</td>'; + echo '<td>' . $myrow['deliverydate'] . '</td>'; + echo '<td class="number">' . number_format($myrow['qtyrecd'], $myrow['decimalplaces']) . '</td>'; + echo '<td><a href="PDFGrn.php?GRNNo=' . $myrow['grnbatch'] .'&PONo=' . $_POST['PONumber'] . '">' . _('Reprint') . '</a></td>'; + echo '</tr>'; + } + echo '</table>'; +} + +include('includes/footer.inc'); + +?> \ No newline at end of file Modified: trunk/SelectProduct.php =================================================================== --- trunk/SelectProduct.php 2011-04-10 02:04:57 UTC (rev 4544) +++ trunk/SelectProduct.php 2011-04-10 10:41:20 UTC (rev 4545) @@ -28,10 +28,10 @@ $_POST['StockCode'] = trim(strtoupper($_POST['StockCode'])); } // Always show the search facilities -$SQL = 'SELECT categoryid, +$SQL = "SELECT categoryid, categorydescription FROM stockcategory - ORDER BY categorydescription'; + ORDER BY categorydescription"; $result1 = DB_query($SQL, $db); if (DB_num_rows($result1) == 0) { echo '<p><font size=4 color=red>' . _('Problem Report') . ':</font><br />' . _('There are no stock categories currently defined please use the link below to set them up').'</p>'; @@ -671,7 +671,7 @@ $_POST['PageOffset'] = $ListPageMax; } if ($ListPageMax > 1) { - echo "<div class='centre'><p> " . $_POST['PageOffset'] . ' ' . _('of') . ' ' . $ListPageMax . ' ' . _('pages') . '. ' . _('Go to Page') . ': '; + echo '<div class="centre"><p> ' . $_POST['PageOffset'] . ' ' . _('of') . ' ' . $ListPageMax . ' ' . _('pages') . '. ' . _('Go to Page') . ': '; echo '<select name="PageOffset">'; $ListPage = 1; while ($ListPage <= $ListPageMax) { Modified: trunk/StockTransferControlled.php =================================================================== --- trunk/StockTransferControlled.php 2011-04-10 02:04:57 UTC (rev 4544) +++ trunk/StockTransferControlled.php 2011-04-10 10:41:20 UTC (rev 4545) @@ -72,14 +72,19 @@ $StockID = $LineItem->StockID; $InOutModifier=1; //seems odd, but it's correct $ShowExisting = true; -include ('includes/InputSerialItems.php'); +if (isset($TransferItem)){ + $LineNo=$TransferItem; +} else { + $LineNo=0; +} +include ('includes/OutputSerialItems.php'); /*TotalQuantity set inside this include file from the sum of the bundles of the item selected for adjusting */ -$LineItem->Quantity = $TotalQuantity; +$LineItem->Quantity = $TransferQuantity; /*Also a multi select box for adding bundles to the Transfer without keying */ include('includes/footer.inc'); exit; -?> +?> \ No newline at end of file Modified: trunk/StockTransfers.php =================================================================== --- trunk/StockTransfers.php 2011-04-10 02:04:57 UTC (rev 4544) +++ trunk/StockTransfers.php 2011-04-10 10:41:20 UTC (rev 4545) @@ -11,15 +11,19 @@ include('includes/header.inc'); include('includes/SQL_CommonFunctions.inc'); +if (isset($_GET['New'])) { + unset($_SESSION['Transfer']); +} + if (isset($_POST['CheckCode'])) { -echo '<p class="page_title_text"><img src="'.$rootpath.'/css/'.$theme.'/images/magnifier.png" title="' . _('Dispatch') . + echo '<p class="page_title_text"><img src="'.$rootpath.'/css/'.$theme.'/images/magnifier.png" title="' . _('Dispatch') . '" alt="" />' . ' ' . _('Select Item to Transfer') . '</p>'; if (strlen($_POST['StockText'])>0) { - $sql="SELECT stockid, description from stockmaster where description like '%" . $_POST['StockText'] . "%'"; + $sql="SELECT stockid, description from stockmaster where description " . LIKE . " '%" . $_POST['StockText'] . "%'"; } else { - $sql="SELECT stockid, description from stockmaster where stockid like '%" . $_POST['StockCode']."%'"; + $sql="SELECT stockid, description from stockmaster where stockid " . LIKE . " '%" . $_POST['StockCode']."%'"; } $ErrMsg=_('The stock information cannot be retrieved because'); $DbgMsg=_('The SQL to get the stock description was'); @@ -30,7 +34,7 @@ while ($myrow = DB_fetch_row($result)) { echo '<tr><td>'.$myrow[0].'</td> <td>'.$myrow[1].'</td> - <td><a href="StockTransfers.php?StockID='.$myrow[0].'&Description='.$myrow[1].'">Transfer</a></td> + <td><a href="StockTransfers.php?StockID='.$myrow[0].'&Description='.$myrow[1].'">' . _('Transfer') . '</a></td> </tr>'; } echo '</table>'; @@ -43,6 +47,7 @@ if (isset($_GET['NewTransfer'])){ unset($_SESSION['Transfer']); unset($_SESSION['TransferItem']); /*this is defined in bulk transfers but needs to be unset for individual trsnsfers */ + $NewTransfer=$_GET['NewTransfer']; } @@ -73,22 +78,24 @@ materialcost+labourcost+overheadcost as standardcost, controlled, serialised, + perishable, decimalplaces FROM stockmaster WHERE stockid='" . trim(strtoupper($_POST['StockID'])) . "'", $db); - $myrow = DB_fetch_row($result); + if (DB_num_rows($result) == 0){ prnMsg( _('Unable to locate Stock Code').' '.strtoupper($_POST['StockID']), 'error' ); } elseif (DB_num_rows($result)>0){ - - $_SESSION['Transfer']->TransferItem[0] = new LineItem ( trim(strtoupper($_POST['StockID'])), - $myrow[0], - $_POST['Quantity'], - $myrow[1], - $myrow[4], - $myrow[5], - $myrow[6]); + $myrow = DB_fetch_row($result); + $_SESSION['Transfer']->TransferItem[0] = new LineItem ( trim(strtoupper($_POST['StockID'])), + $myrow['description'], + $_POST['Quantity'], + $myrow['units'], + $myrow['controlled'], + $myrow['serialised'], + $myrow['perishable'], + $myrow['decimalplaces']); $_SESSION['Transfer']->TransferItem[0]->StandardCost = $myrow[3]; @@ -222,7 +229,8 @@ if ($SerialItemExistsRow[0]==1){ $SQL = "UPDATE stockserialitems - SET quantity= quantity - '" . $Item->BundleQty . "' + SET quantity= quantity - '" . $Item->BundleQty . "', + expirationdate='" . FormatDateForSQL($Item->ExpiryDate) . "' WHERE stockid='" . $_SESSION['Transfer']->TransferItem[0]->StockID . "' AND loccode='" . $_SESSION['Transfer']->StockLocationFrom . "' AND serialno='" . $Item->BundleRef . "'"; @@ -235,10 +243,12 @@ $SQL = "INSERT INTO stockserialitems (stockid, loccode, serialno, + expirationdate, quantity) VALUES ('" . $_SESSION['Transfer']->TransferItem[0]->StockID . "', '" . $_SESSION['Transfer']->StockLocationFrom . "', '" . $Item->BundleRef . "', + '" . FormatDateForSQL($Item->ExpiryDate) . "', '" . -$Item->BundleQty . "')"; $ErrMsg = _('CRITICAL ERROR') . '! ' . _('NOTE DOWN THIS ERROR AND SEEK ASSISTANCE') . ': ' . _('The serial stock item record could not be added because'); @@ -334,7 +344,8 @@ if ($SerialItemExistsRow[0]==1){ $SQL = "UPDATE stockserialitems - SET quantity= quantity + '" . $Item->BundleQty . "' + SET quantity= quantity + '" . $Item->BundleQty . "', + expirationdate='" . FormatDateForSQL($Item->ExpiryDate) . "' WHERE stockid='" . $_SESSION['Transfer']->TransferItem[0]->StockID . "' AND loccode='" . $_SESSION['Transfer']->StockLocationTo . "' AND serialno='" . $Item->BundleRef . "'"; @@ -347,10 +358,12 @@ $SQL = "INSERT INTO stockserialitems (stockid, loccode, serialno, + expirationdate, quantity) VALUES ('" . $_SESSION['Transfer']->TransferItem[0]->StockID . "', '" . $_SESSION['Transfer']->StockLocationTo . "', '" . $Item->BundleRef . "', + '" . FormatDateForSQL($Item->ExpiryDate) . "', '" . $Item->BundleQty . "')"; $ErrMsg = _('CRITICAL ERROR') . '! ' . _('NOTE DOWN THIS ERROR AND SEEK ASSISTANCE') . ': ' . _('The serial stock item record could not be added because'); @@ -398,7 +411,7 @@ $Result = DB_Txn_Commit($db); prnMsg(_('An inventory transfer of').' ' . $_SESSION['Transfer']->TransferItem[0]->StockID . ' - ' . $_SESSION['Transfer']->TransferItem[0]->ItemDescription . ' '. _('has been created from').' ' . $_SESSION['Transfer']->StockLocationFrom . ' '. _('to') . ' ' . $_SESSION['Transfer']->StockLocationTo . ' '._('for a quantity of').' ' . $_SESSION['Transfer']->TransferItem[0]->Quantity,'success'); - echo '</br><a href="PDFStockTransfer.php?TransferNo='.$TransferNumber.'">Print Transfer Note</a>'; + echo '</br><a href="PDFStockTransfer.php?TransferNo='.$TransferNumber.'">' . _('Print Transfer Note') . '</a>'; unset ($_SESSION['Transfer']); include ('includes/footer.inc'); exit; @@ -406,28 +419,13 @@ } -if (!isset($_SESSION['Transfer']->TransferItem[0]->StockID)) { - $_SESSION['Transfer']->TransferItem[0]->StockID = ' '; -} -if (!isset($_SESSION['Transfer']->TransferItem[0]->ItemDescription)) { - $_SESSION['Transfer']->TransferItem[0]->ItemDescription = ''; -} -if (!isset($_SESSION['Transfer']->TransferItem[0]->Controlled)) { - $_SESSION['Transfer']->TransferItem[0]->Controlled = ''; -} - echo '<p class="page_title_text"><img src="'.$rootpath.'/css/'.$theme.'/images/supplier.png" title="' . _('Dispatch') . '" alt="" />' . ' ' . $title . '</p>'; echo '<form action="'. $_SERVER['PHP_SELF'] . '" method=post>'; echo '<input type="hidden" name="FormID" value="' . $_SESSION['FormID'] . '" />'; -//echo '<table> -// <tr> -// <td>'. _('Stock Code').':</td> -// <td><input type=text name="StockID" size=21 value="' . $_SESSION['Transfer']->TransferItem[0]->StockID . '" maxlength=20></td> -// <td><input type=submit name="CheckCode" VALUE="'._('Check Part').'"></td> -// </tr>'; + if (!isset($_GET['Description'])) { $_GET['Description']=''; } @@ -446,13 +444,13 @@ } echo '</td><td><input type=submit name="CheckCode" VALUE="'._('Check Part').'"></td></tr>'; -if (strlen($_SESSION['Transfer']->TransferItem[0]->ItemDescription)>1){ +if (isset($_SESSION['Transfer']->TransferItem[0]->ItemDescription) and strlen($_SESSION['Transfer']->TransferItem[0]->ItemDescription)>1){ echo '<tr><td colspan=3><font color=BLUE size=3>' . $_SESSION['Transfer']->TransferItem[0]->ItemDescription . ' ('._('In Units of').' ' . $_SESSION['Transfer']->TransferItem[0]->PartUnit . ' )</font></td></tr>'; } echo '<tr><td>' . _('From Stock Location').':</td><td><select name="StockLocationFrom">'; -$sql = 'SELECT loccode, locationname FROM locations'; +$sql = "SELECT loccode, locationname FROM locations"; $resultStkLocs = DB_query($sql,$db); while ($myrow=DB_fetch_array($resultStkLocs)){ if (isset($_SESSION['Transfer']->StockLocationFrom)){ @@ -476,13 +474,13 @@ DB_data_seek($resultStkLocs,0); while ($myrow=DB_fetch_array($resultStkLocs)){ - if (isset($_SESSION['Transfer']->StockLocationTo)){ + if (isset($_SESSION['Transfer']) AND isset($_SESSION['Transfer']->StockLocationTo)){ if ($myrow['loccode'] == $_SESSION['Transfer']->StockLocationTo){ echo '<option selected Value="' . $myrow['loccode'] . '">' . $myrow['locationname'] . '</option>'; } else { echo '<option Value="' . $myrow['loccode'] . '">' . $myrow['locationname'] . '</option>'; } - } elseif ($myrow['loccode']==$_SESSION['UserStockLocation']){ + } elseif ($myrow['loccode']==$_SESSION['UserStockLocation'] AND isset($_SESSION['Transfer'])){ echo '<option selected Value="' . $myrow['loccode'] . '">' . $myrow['locationname'] . '</option>'; $_SESSION['Transfer']->StockLocationTo=$myrow['loccode'] . '</option>'; } else { @@ -495,18 +493,18 @@ echo '<tr><td>'._('Transfer Quantity').':</td>'; -if (!isset($_SESSION['Transfer']->TransferItem[0]->Quantity)) { - $_SESSION['Transfer']->TransferItem[0]->Quantity=0; -} - -if ($_SESSION['Transfer']->TransferItem[0]->Controlled==1){ - echo '<td class=number><input type=hidden name="Quantity" value=' . $_SESSION['Transfer']->TransferItem[0]->Quantity . '><a href="' . $rootpath .'/StockTransferControlled.php">' . $_SESSION['Transfer']->TransferItem[0]->Quantity . '</a></td></tr>'; -} else { +if (isset($_SESSION['Transfer']->TransferItem[0]->Controlled) and $_SESSION['Transfer']->TransferItem[0]->Controlled==1){ + echo '<td class=number><input type=hidden name="Quantity" value=' . $_SESSION['Transfer']->TransferItem[0]->Quantity . + '><a href="' . $rootpath .'/StockTransferControlled.php?StockLocationFrom='.$_SESSION['Transfer']->StockLocationFrom.'">' . $_SESSION['Transfer']->TransferItem[0]->Quantity . '</a></td></tr>'; +} else if (isset($_SESSION['Transfer']->TransferItem[0]->Controlled)){ echo '<td><input type=text class="number" name="Quantity" size=12 maxlength=12 value=' . $_SESSION['Transfer']->TransferItem[0]->Quantity . '></td></tr>'; +} else { + echo '<td><input type=text class="number" name="Quantity" size=12 maxlength=12 Value="0"></td></tr>'; } echo '</table><div class="centre"><br /><input type="submit" name="EnterTransfer" value="' . _('Enter Stock Transfer') . '"><br />'; + if (empty($_SESSION['Transfer']->TransferItem[0]->StockID) and isset($_POST['StockID'])) { $StockID=$_POST['StockID']; } else if (isset($_SESSION['Transfer']->TransferItem[0]->StockID)) { @@ -514,13 +512,13 @@ } else { $StockID=''; } - -echo '<br /><a href="'.$rootpath.'/StockStatus.php?StockID=' . $StockID . '">'._('Show Stock Status').'</a>'; -echo '<br /><a href="'.$rootpath.'/StockMovements.php?StockID=' . $StockID . '">'._('Show Movements').'</a>'; -echo '<br /><a href="'.$rootpath.'/StockUsage.php?StockID=' . $StockID . '&StockLocation=' . $_SESSION['Transfer']->StockLocationFrom . '">' . _('Show Stock Usage') . '</a>'; -echo '<br /><a href="'.$rootpath.'/SelectSalesOrder.php?SelectedStockItem=' . $StockID . '&StockLocation=' . $_SESSION['Transfer']->StockLocationFrom . '">' . _('Search Outstanding Sales Orders') . '</a>'; -echo '<br /><a href="'.$rootpath.'/SelectCompletedOrder.php?SelectedStockItem=' . $StockID . '">'._('Search Completed Sales Orders').'</a>'; - +if (isset($_SESSION['Transfer'])) { + echo '<br /><a href="'.$rootpath.'/StockStatus.php?StockID=' . $StockID . '">'._('Show Stock Status').'</a>'; + echo '<br /><a href="'.$rootpath.'/StockMovements.php?StockID=' . $StockID . '">'._('Show Movements').'</a>'; + echo '<br /><a href="'.$rootpath.'/StockUsage.php?StockID=' . $StockID . '&StockLocation=' . $_SESSION['Transfer']->StockLocationFrom . '">' . _('Show Stock Usage') . '</a>'; + echo '<br /><a href="'.$rootpath.'/SelectSalesOrder.php?SelectedStockItem=' . $StockID . '&StockLocation=' . $_SESSION['Transfer']->StockLocationFrom . '">' . _('Search Outstanding Sales Orders') . '</a>'; + echo '<br /><a href="'.$rootpath.'/SelectCompletedOrder.php?SelectedStockItem=' . $StockID . '">'._('Search Completed Sales Orders').'</a>'; +} echo '</div></form>'; include('includes/footer.inc'); ?> \ No newline at end of file Modified: trunk/SupplierInvoice.php =================================================================== --- trunk/SupplierInvoice.php 2011-04-10 02:04:57 UTC (rev 4544) +++ trunk/SupplierInvoice.php 2011-04-10 10:41:20 UTC (rev 4545) @@ -510,7 +510,7 @@ echo '<br /><table class=selection> <tr> <td>' . _('Comments') . '</td> - <td><TEXTAREA name=Comments COLS=40 ROWS=2>' . $_SESSION['SuppTrans']->Comments . '</textarea></td> + <td><textarea name="Comments" cols="40" rows="2">' . $_SESSION['SuppTrans']->Comments . '</textarea></td> </tr> </table>'; @@ -550,8 +550,8 @@ $InputError = True; prnMsg(_('The invoice as entered cannot be processed because the total amount of the invoice is less than 0') . '. ' . _('Invoices are expected to have a positive charge'),'error'); - echo '<p> The tax total is : ' . $TaxTotal; - echo '<p> The ovamount is : ' . $_SESSION['SuppTrans']->OvAmount; + echo '<p>' . _('The tax total is') . ' : ' . $TaxTotal; + echo '<p>' . _('The ovamount is') . ' : ' . $_SESSION['SuppTrans']->OvAmount; } elseif ( $TaxTotal + $_SESSION['SuppTrans']->OvAmount == 0){ Modified: trunk/doc/Change.log.html =================================================================== --- trunk/doc/Change.log.html 2011-04-10 02:04:57 UTC (rev 4544) +++ trunk/doc/Change.log.html 2011-04-10 10:41:20 UTC (rev 4545) @@ -1,6 +1,9 @@ <p><font SIZE=4 COLOR=BLUE><b>webERP Change Log</b></font></p> <p /> -<p> +<p>10/4/11 Tim: +<p>10/4/11 Tim: GLAccountInquiry.php show None if no tag selected</p> +<p>10/4/11 Tim : PDFPrintLabel.php javascript fix</p> +<p>10/4/11 Tim: Add perishable to StockTransfer.php and PDFStockTransfer</p> <p>10/4/11 Tim: PDFPeriodStockTransListing - new report to print off stock transactions of a specified type for a selected period>/p> <p>10/4/11 Tim: PDFStockTransListing.php option to print off transactions by inventory location</p> <p>10/4/11 Tim: Stocks.php - more logical use of $New and $_POST['New']</p> Modified: trunk/includes/DefineLabelClass.php =================================================================== --- trunk/includes/DefineLabelClass.php 2011-04-10 02:04:57 UTC (rev 4544) +++ trunk/includes/DefineLabelClass.php 2011-04-10 10:41:20 UTC (rev 4545) @@ -1,25 +1,25 @@ <?php define('MAX_LINES_PER_LABEL', 5); -define('LABELS_FILE', $_SESSION['reports_dir'] . "/labels.xml"); +define('LABELS_FILE', $_SESSION['reports_dir'] . '/labels.xml'); /** * These tags contains the more general data of the labels */ $GlobalTags = array('id'=>array('desc'=> _('Label id'), - 'type'=>'t', - 'sz'=>8, - 'maxsz'=>12), // text - 'description'=>array('desc'=>_('Description'), - 'type'=>'t', - 'sz'=>15, - 'maxsz'=>30) // text -); + 'type'=>'t', + 'sz'=>8, + 'maxsz'=>12), // text + 'description'=>array('desc'=>_('Description'), + 'type'=>'t', + 'sz'=>15, + 'maxsz'=>30) // text + ); /** * These tags specifies the dimension of individual label */ $DimensionTags = array( 'Unit'=>array('desc'=>_('Units'),'type'=>'s', - 'values'=>array('pt'=>'pt', 'in'=>'in', 'mm'=>'mm', 'cm'=>'cm' ) ), // select + 'values'=>array('pt'=>'pt', 'in'=>'in', 'mm'=>'mm', 'cm'=>'cm' ) ), // select 'Rows'=>array('desc'=>_('Rows per sheet'),'type'=>'i','sz'=>2,'maxsz'=>3), // integer numeric 'Cols'=>array('desc'=>_('Cols per sheet'),'type'=>'i','sz'=>2,'maxsz'=>3), 'Sh'=>array('desc'=>_('Sheet height'),'type'=>'n','sz'=>5,'maxsz'=>8), // float numeric @@ -164,8 +164,10 @@ * @return nothing */ function abortMsg($msg) { - global $rootpath, $DefaultClock, $Version; + global $rootpath, $DefaultClock, $Version, $theme; + $title=_('No label templates exist'); include ('includes/header.inc'); + echo '<br />'; prnMsg( $msg, 'error'); include ('includes/footer.inc'); exit; Modified: trunk/includes/DefineStockTransfers.php =================================================================== --- trunk/includes/DefineStockTransfers.php 2011-04-10 02:04:57 UTC (rev 4544) +++ trunk/includes/DefineStockTransfers.php 2011-04-10 10:41:20 UTC (rev 4545) @@ -33,13 +33,14 @@ class LineItem { var $StockID; var $ItemDescription; - Var $ShipQty; - Var $PrevRecvQty; - Var $Quantity; - Var $PartUnit; + var $ShipQty; + var $PrevRecvQty; + var $Quantity; + var $PartUnit; var $Controlled; var $Serialised; - Var $DecimalPlaces; + var $DecimalPlaces; + var $Perishable; var $SerialItems; /*array to hold controlled items*/ //Constructor function LineItem($StockID, @@ -48,6 +49,7 @@ $PartUnit, $Controlled, $Serialised, + $Perishable, $DecimalPlaces){ $this->StockID = $StockID; @@ -56,6 +58,7 @@ $this->Controlled = $Controlled; $this->Serialised = $Serialised; $this->DecimalPlaces = $DecimalPlaces; + $this->Perishable = $Perishable; $this->ShipQty = $Quantity; if ($this->Controlled==1){ $this->Quantity = 0; Modified: trunk/includes/OutputSerialItems.php =================================================================== --- trunk/includes/OutputSerialItems.php 2011-04-10 02:04:57 UTC (rev 4544) +++ trunk/includes/OutputSerialItems.php 2011-04-10 10:41:20 UTC (rev 4545) @@ -17,9 +17,9 @@ global $tableheader; /* Link to clear the list and start from scratch */ -$EditLink = '<br><div class="centre"><a href="' . $_SERVER['PHP_SELF'] . '?' . SID . '&EditControlled=true&StockID=' . $LineItem->StockID . +$EditLink = '<br><div class="centre"><a href="' . $_SERVER['PHP_SELF'] . '?EditControlled=true&StockID=' . $LineItem->StockID . '&LineNo=' . $LineNo .'">'. _('Edit'). '</a> | '; -$RemoveLink = '<a href="' . $_SERVER['PHP_SELF'] . '?' . SID . '&DELETEALL=YES&StockID=' . $LineItem->StockID . +$RemoveLink = '<a href="' . $_SERVER['PHP_SELF'] . '?DELETEALL=YES&StockID=' . $LineItem->StockID . '&LineNo=' . $LineNo .'">'. _('Remove All'). '</a><br></div>'; $sql="SELECT perishable FROM stockmaster @@ -95,8 +95,9 @@ echo '<td class=number>' . $Bundle->ExpiryDate . '</td>'; } - echo '<td><a href="' . $_SERVER['PHP_SELF'] . '?' . SID . 'Delete=' . $Bundle->BundleRef . '&StockID=' . $LineItem->StockID . '&LineNo=' . $LineNo .'">'. _('Delete'). '</a></td></tr>'; - + echo '<td><a href="' . $_SERVER['PHP_SELF'] . '?Delete=' . $Bundle->BundleRef . '&StockID=' . $LineItem->StockID . '&LineNo=' . $LineNo .'">'. _('Delete'). '</a></td></tr>'; + + $LineItem->SerialItems[]=$Bundle; $TotalQuantity += $Bundle->BundleQty; } @@ -114,13 +115,13 @@ /*Start a new table for the Serial/Batch ref input in one column (as a sub table then the multi select box for selection of existing bundle/serial nos for dispatch if applicable*/ //echo '<TABLE><TR><TD valign=TOP>'; - +$TransferQuantity=$TotalQuantity; /*in the first column add a table for the input of newies */ echo '<table class=selection>'; echo $tableheader; -echo '<form action="' . $_SERVER['PHP_SELF'] . '?=' . SID . '" name="Ga6uF5Wa" method="post"> +echo '<form action="' . $_SERVER['PHP_SELF'] . '" name="Ga6uF5Wa" method="post"> <input type=hidden name=LineNo value="' . $LineNo . '"> <input type=hidden name=StockID value="' . $StockID . '"> <input type=hidden name=EntryType value="KEYED">'; @@ -161,12 +162,18 @@ } } +if (isset($_SESSION['Transfer']->StockLocationFrom)) { + $Location=$_SESSION['Transfer']->StockLocationFrom; +} else if (isset($_SESSION['Items']->Location)) { + $Location=$_SESSION['Items']->Location; +} + $sql="SELECT serialno, quantity, expirationdate FROM stockserialitems WHERE stockid='".$StockID."' - AND loccode='".$_SESSION['Items']->Location."'"; + AND loccode='" . $Location . "'"; $result=DB_query($sql, $db); $RowNumber=0; Modified: trunk/index.php =================================================================== --- trunk/index.php 2011-04-10 02:04:57 UTC (rev 4544) +++ trunk/index.php 2011-04-10 10:41:20 UTC (rev 4545) @@ -2,8 +2,6 @@ /* $Id$*/ -//$PageSecurity = 1; now comes from DB scripts table - include('includes/session.inc'); $title=_('Main Menu'); @@ -581,12 +579,12 @@ </tr> <tr> <td class="menu_group_item"> - <?php echo '<p>• <a href="' . $rootpath . '/StockTransfers.php">' . _('Inventory Location Transfers') . '</a></p>'; ?> + <?php echo '<p>• <a href="' . $rootpath . '/StockTransfers.php?New=Yes">' . _('Inventory Location Transfers') . '</a></p>'; ?> </td> </tr> <tr> <td class="menu_group_item"> - <?php echo '<p>• <a href="' . $rootpath . '/StockAdjustments.php?NewAdjustment=Yes' . SID . '">' . _('Inventory Adjustments') . '</a></p>'; ?> + <?php echo '<p>• <a href="' . $rootpath . '/StockAdjustments.php?NewAdjustment=Yes">' . _('Inventory Adjustments') . '</a></p>'; ?> </td> </tr> <tr> Modified: trunk/sql/mysql/upgrade3.11.1-4.00.sql =================================================================== --- trunk/sql/mysql/upgrade3.11.1-4.00.sql 2011-04-10 02:04:57 UTC (rev 4544) +++ trunk/sql/mysql/upgrade3.11.1-4.00.sql 2011-04-10 10:41:20 UTC (rev 4545) @@ -841,4 +841,4 @@ ALTER TABLE `paymentmethods` ADD `usepreprintedstationery` TINYINT NOT NULL DEFAULT '0'; DELETE FROM scripts WHERE script='PDFStockTransListing.php'; INSERT INTO scripts (`script` ,`pagesecurity` ,`description`) VALUES('PDFPeriodStockTransListing.php','3','Allows stock transactions of a specific transaction type to be listed over a single day or period range'); -IUPDATE config SET confvalue='4.03.7' WHERE confname='VersionNumber'; +UPDATE config SET confvalue='4.03.7' WHERE confname='VersionNumber'; This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <dai...@us...> - 2011-04-10 02:05:05
|
Revision: 4544 http://web-erp.svn.sourceforge.net/web-erp/?rev=4544&view=rev Author: daintree Date: 2011-04-10 02:04:57 +0000 (Sun, 10 Apr 2011) Log Message: ----------- Tim changes Modified Paths: -------------- trunk/PaymentMethods.php trunk/Payments.php trunk/Stocks.php trunk/doc/Change.log.html trunk/includes/ConnectDB.inc trunk/index.php trunk/sql/mysql/upgrade3.11.1-4.00.sql Added Paths: ----------- trunk/PDFPeriodStockTransListing.php trunk/includes/PDFPeriodStockTransListingPageHeader.inc Removed Paths: ------------- trunk/PDFStockTransListing.php trunk/includes/PDFStockTransListingPageHeader.inc Added: trunk/PDFPeriodStockTransListing.php =================================================================== --- trunk/PDFPeriodStockTransListing.php (rev 0) +++ trunk/PDFPeriodStockTransListing.php 2011-04-10 02:04:57 UTC (rev 4544) @@ -0,0 +1,203 @@ +<?php +/* $Id: PDFPeriodStockTransListing.php 4307 2010-12-22 16:06:03Z tim_schofield $*/ + + +include('includes/SQL_CommonFunctions.inc'); +include ('includes/session.inc'); + +$InputError=0; +if (isset($_POST['FromDate']) AND !Is_Date($_POST['FromDate'])){ + $msg = _('The date must be specified in the format') . ' ' . $_SESSION['DefaultDateFormat']; + $InputError=1; + unset($_POST['FromDate']); +} + +if (!isset($_POST['FromDate'])){ + + $title = _('Stock Transaction Listing'); + include ('includes/header.inc'); + + echo '<div class="centre"><p class="page_title_text"><img src="'.$rootpath.'/css/'.$theme.'/images/transactions.png" title="' . $title . '" alt="">' . ' ' + . _('Stock Transaction Listing').'</img></p></div>'; + + if ($InputError==1){ + prnMsg($msg,'error'); + } + + echo '<form method="post" action="' . $_SERVER['PHP_SELF'] . '">'; + echo '<input type="hidden" name="FormID" value="' . $_SESSION['FormID'] . '" />'; + echo '<table class=selection>'; + echo '<tr> + <td>' . _('Enter the date from which the transactions are to be listed') . ':</td> + <td><input type="text" name="FromDate" maxlength="10" size="10" class="date" alt="' . $_SESSION['DefaultDateFormat'] . '" value="' . Date($_SESSION['DefaultDateFormat']) . '"></td> + </tr>'; + echo '<tr> + <td>' . _('Enter the date to which the transactions are to be listed') . ':</td> + <td><input type=text name="ToDate" maxlength="10" size="10" class="date" alt="' . $_SESSION['DefaultDateFormat'] . '" value="' . Date($_SESSION['DefaultDateFormat']) . '"></td> + </tr>'; + + echo '<tr><td>' . _('Transaction type') . '</td><td>'; + + echo '<select name="TransType">'; + + echo '<option value=10>' . _('Sales Invoice').'</option> + <option value=11>' . _('Sales Credit Note').'</option> + <option value=16>' . _('Location Transfer').'</option> + <option value=17>' . _('Stock Adjustment').'</option> + <option value=25>' . _('Purchase Order Delivery').'</option> + <option value=26>' . _('Work Order Receipt').'</option> + <option value=28>' . _('Work Order Issue').'</option>'; + + echo '</select></td></tr>'; + + $sql = "SELECT loccode, locationname FROM locations"; + $resultStkLocs = DB_query($sql, $db); + + echo '<tr><td>' . _('For Stock Location') . ':</td> + <td><select name="StockLocation">'; + echo '<option VALUE="All">' . _('All') . '</option>'; + while ($myrow=DB_fetch_array($resultStkLocs)){ + if (isset($_POST['StockLocation']) AND $_POST['StockLocation']!='All'){ + if ($myrow['loccode'] == $_POST['StockLocation']){ + echo '<option selected VALUE="' . $myrow['loccode'] . '">' . $myrow['locationname'] . '</option>'; + } else { + echo '<option VALUE="' . $myrow['loccode'] . '">' . $myrow['locationname'] . '</option>'; + } + } elseif ($myrow['loccode']==$_SESSION['UserStockLocation']){ + echo '<option selected VALUE="' . $myrow['loccode'] . '">' . $myrow['locationname'] . '</option>'; + $_POST['StockLocation']=$myrow['loccode']; + } else { + echo '<option VALUE="' . $myrow['loccode'] . '">' . $myrow['locationname'] . '</option>'; + } + } + echo '</select></td></tr>'; + + echo '</table><br><div class="centre"><input type=submit name="Go" value="' . _('Create PDF') . '"></div>'; + + include('includes/footer.inc'); + exit; +} else { + + include('includes/ConnectDB.inc'); +} + + +if ($_POST['StockLocation']=='All') { + $sql= "SELECT stockmoves.type, + stockmoves.stockid, + stockmaster.description, + stockmaster.decimalplaces, + stockmoves.transno, + stockmoves.trandate, + stockmoves.qty, + stockmoves.reference, + stockmoves.narrative, + locations.locationname + FROM stockmoves + LEFT JOIN stockmaster + ON stockmoves.stockid=stockmaster.stockid + LEFT JOIN locations + ON stockmoves.loccode=locations.loccode + WHERE type='" . $_POST['TransType'] . "' + AND date_format(trandate, '%Y-%m-%d')>='".FormatDateForSQL($_POST['FromDate'])."' + AND date_format(trandate, '%Y-%m-%d')<='".FormatDateForSQL($_POST['ToDate'])."'"; +} else { + $sql= "SELECT stockmoves.type, + stockmoves.stockid, + stockmaster.description, + stockmaster.decimalplaces, + stockmoves.transno, + stockmoves.trandate, + stockmoves.qty, + stockmoves.reference, + stockmoves.narrative, + locations.locationname + FROM stockmoves + LEFT JOIN stockmaster + ON stockmoves.stockid=stockmaster.stockid + LEFT JOIN locations + ON stockmoves.loccode=locations.loccode + WHERE type='" . $_POST['TransType'] . "' + AND date_format(trandate, '%Y-%m-%d')>='".FormatDateForSQL($_POST['FromDate'])."' + AND date_format(trandate, '%Y-%m-%d')<='".FormatDateForSQL($_POST['ToDate'])."' + AND stockmoves.loccode='" . $_POST['StockLocation'] . "'"; +} +$result=DB_query($sql,$db,'','',false,false); + +if (DB_error_no($db)!=0){ + $title = _('Transaction Listing'); + include('includes/header.inc'); + prnMsg(_('An error occurred getting the transactions'),'error'); + include('includes/footer.inc'); + exit; +} elseif (DB_num_rows($result) == 0){ + $title = _('Transaction Listing'); + include('includes/header.inc'); + echo '<br>'; + prnMsg (_('There were no transactions found in the database between the dates') . ' ' . $_POST['FromDate'] . ' ' . _('and') . ' '. $_POST['ToDate'] .'<br />' ._('Please try again selecting a different date'), 'info'); + include('includes/footer.inc'); + exit; +} + +include('includes/PDFStarter.php'); + +/*PDFStarter.php has all the variables for page size and width set up depending on the users default preferences for paper size */ + +$pdf->addInfo('Title',_('Stock Transaction Listing')); +$pdf->addInfo('Subject',_('Stock transaction listing from') . ' ' . $_POST['FromDate'] . ' ' . $_POST['ToDate']); +$line_height=12; +$PageNumber = 1; + + +switch ($_POST['TransType']) { + case 10: + $TransType=_('Customer Invoices'); + break; + case 11: + $TransType=_('Customer Credit Notes'); + break; + case 16: + $TransType=_('Location Transfers'); + break; + case 17: + $TransType=_('Stock Adjustments'); + break; + case 25: + $TransType=_('Purchase Order Deliveries'); + break; + case 26: + $TransType=_('Work Order Receipts'); + break; + case 28: + $TransType=_('Work Order Issues'); + break; +} + +include ('includes/PDFPeriodStockTransListingPageHeader.inc'); + +while ($myrow=DB_fetch_array($result)){ + + $LeftOvers = $pdf->addTextWrap($Left_Margin,$YPos,160,$FontSize,$myrow['description'], 'left'); + $LeftOvers = $pdf->addTextWrap($Left_Margin+162,$YPos,80,$FontSize,$myrow['transno'], 'left'); + $LeftOvers = $pdf->addTextWrap($Left_Margin+242,$YPos,70,$FontSize,ConvertSQLDate($myrow['trandate']), 'left'); + $LeftOvers = $pdf->addTextWrap($Left_Margin+312,$YPos,70,$FontSize,number_format($myrow['qty'],$myrow['decimalplaces']), 'right'); + $LeftOvers = $pdf->addTextWrap($Left_Margin+382,$YPos,70,$FontSize,$myrow['locationname'], 'right'); + $LeftOvers = $pdf->addTextWrap($Left_Margin+452,$YPos,70,$FontSize,$myrow['reference'], 'right'); + + $YPos -= ($line_height); + + if ($YPos - (2 *$line_height) < $Bottom_Margin){ + /*Then set up a new page */ + $PageNumber++; + include ('includes/PDFPeriodStockTransListingPageHeader.inc'); + } /*end of new page header */ +} /* end of while there are customer receipts in the batch to print */ + + +$YPos-=$line_height; + +$ReportFileName = $_SESSION['DatabaseName'] . '_StockTransListing_' . date('Y-m-d').'.pdf'; +$pdf->OutputD($ReportFileName); +$pdf->__destruct(); + +?> \ No newline at end of file Deleted: trunk/PDFStockTransListing.php =================================================================== --- trunk/PDFStockTransListing.php 2011-04-09 06:12:05 UTC (rev 4543) +++ trunk/PDFStockTransListing.php 2011-04-10 02:04:57 UTC (rev 4544) @@ -1,145 +0,0 @@ -<?php - -/* $Id$*/ - -/* $Revision: 1.13 $ */ - -//$PageSecurity = 3; -include('includes/SQL_CommonFunctions.inc'); -include ('includes/session.inc'); - -$InputError=0; -if (isset($_POST['Date']) AND !Is_Date($_POST['Date'])){ - $msg = _('The date must be specified in the format') . ' ' . $_SESSION['DefaultDateFormat']; - $InputError=1; - unset($_POST['Date']); -} - -if (!isset($_POST['Date'])){ - - $title = _('Stock Transaction Listing'); - include ('includes/header.inc'); - - echo '<div class="centre"><p class="page_title_text"><img src="'.$rootpath.'/css/'.$theme.'/images/transactions.png" title="' . $title . '" alt="" />' . ' ' - . _('Stock Transaction Listing').'</p></div>'; - - if ($InputError==1){ - prnMsg($msg,'error'); - } - - echo "<form method='post' action=" . $_SERVER['PHP_SELF'] . '>'; - echo '<input type="hidden" name="FormID" value="' . $_SESSION['FormID'] . '" />'; - echo '<table class=selection> - <tr> - <td>' . _('Enter the date for which the transactions are to be listed') . ":</td> - <td><input type=text name='Date' maxlength=10 size=10 class=date alt='" . $_SESSION['DefaultDateFormat'] . "' value='" . Date($_SESSION['DefaultDateFormat']) . "'></td> - </tr>"; - - echo '<tr><td>' . _('Transaction type') . '</td><td>'; - - echo "<select name='TransType'>"; - - echo '<option value=10>' . _('Sales Invoice').'</option>'; - echo '<option value=11>' . _('Sales Credit Note').'</option>'; - echo '<option value=16>' . _('Location Transfer').'</option>'; - echo '<option value=17>' . _('Stock Adjustment').'</option>'; - echo '<option value=25>' . _('Purchase Order Delivery').'</option>'; - echo '<option value=26>' . _('Work Order Receipt').'</option>'; - echo '<option value=28>' . _('Work Order Issue').'</option>'; - - echo '</select></td></tr>'; - - echo "</select></td></tr></table><br><div class='centre'><input type=submit name='Go' value='" . _('Create PDF') . "'></div>"; - - - include('includes/footer.inc'); - exit; -} else { - - include('includes/ConnectDB.inc'); -} - -$sql= "SELECT stockmoves.type, - stockmoves.stockid, - stockmaster.description, - stockmaster.decimalplaces, - stockmoves.transno, - stockmoves.trandate, - stockmoves.qty, - stockmoves.reference, - stockmoves.narrative, - locations.locationname - FROM stockmoves - LEFT JOIN stockmaster - ON stockmoves.stockid=stockmaster.stockid - LEFT JOIN locations - ON stockmoves.loccode=locations.loccode - WHERE type='" . $_POST['TransType'] . "' - AND date_format(trandate, '%Y-%m-%d')='".FormatDateForSQL($_POST['Date'])."'"; - -$result=DB_query($sql,$db,'','',false,false); - -if (DB_error_no($db)!=0){ - $title = _('Transaction Listing'); - include('includes/header.inc'); - prnMsg(_('An error occurred getting the transactions'),'error'); - include('includes/footer.inc'); - exit; -} elseif (DB_num_rows($result) == 0){ - $title = _('Transaction Listing'); - include('includes/header.inc'); - echo '<br>'; - prnMsg (_('There were no transactions found in the database for the date') . ' ' . $_POST['Date'] .'. '._('Please try again selecting a different date'), 'info'); - include('includes/footer.inc'); - exit; -} - -include('includes/PDFStarter.php'); - -/*PDFStarter.php has all the variables for page size and width set up depending on the users default preferences for paper size */ - -$pdf->addInfo('Title',_('Stock Transaction Listing')); -$pdf->addInfo('Subject',_('Stock transaction listing from') . ' ' . $_POST['Date'] ); -$line_height=12; -$PageNumber = 1; - -include ('includes/PDFStockTransListingPageHeader.inc'); - -while ($myrow=DB_fetch_array($result)){ - - $LeftOvers = $pdf->addTextWrap($Left_Margin,$YPos,160,$FontSize,$myrow['description'], 'left'); - $LeftOvers = $pdf->addTextWrap($Left_Margin+162,$YPos,80,$FontSize,$myrow['transno'], 'left'); - $LeftOvers = $pdf->addTextWrap($Left_Margin+242,$YPos,70,$FontSize,ConvertSQLDate($myrow['trandate']), 'left'); - $LeftOvers = $pdf->addTextWrap($Left_Margin+312,$YPos,70,$FontSize,number_format($myrow['qty'],$myrow['decimalplaces']), 'right'); - $LeftOvers = $pdf->addTextWrap($Left_Margin+382,$YPos,70,$FontSize,$myrow['locationname'], 'right'); - $LeftOvers = $pdf->addTextWrap($Left_Margin+452,$YPos,70,$FontSize,$myrow['reference'], 'right'); - - $YPos -= ($line_height); - - if ($YPos - (2 *$line_height) < $Bottom_Margin){ - /*Then set up a new page */ - $PageNumber++; - include ('includes/PDFStockTransListingPageHeader.inc'); - } /*end of new page header */ -} /* end of while there are customer receipts in the batch to print */ - - -$YPos-=$line_height; - -/* UldisN -$pdfcode = $pdf->output(); -$len = strlen($pdfcode); -header('Content-type: application/pdf'); -header('Content-Length: ' . $len); -header('Content-Disposition: inline; filename=ChequeListing.pdf'); -header('Expires: 0'); -header('Cache-Control: must-revalidate, post-check=0, pre-check=0'); -header('Pragma: public'); - -$pdf->stream(); -*/ -$ReportFileName = $_SESSION['DatabaseName'] . '_StockTransListing_' . date('Y-m-d').'.pdf'; -$pdf->OutputD($ReportFileName);//UldisN -$pdf->__destruct(); //UldisN - -?> \ No newline at end of file Modified: trunk/PaymentMethods.php =================================================================== --- trunk/PaymentMethods.php 2011-04-09 06:12:05 UTC (rev 4543) +++ trunk/PaymentMethods.php 2011-04-10 02:04:57 UTC (rev 4544) @@ -1,9 +1,7 @@ <?php -/* $Revision: 1.9 $ */ + /* $Id$*/ -//$PageSecurity = 15; - include('includes/session.inc'); $title = _('Payment Methods'); @@ -72,8 +70,9 @@ $sql = "UPDATE paymentmethods SET paymentname='" . $_POST['MethodName'] . "', paymenttype = '" . $_POST['ForPayment'] . "', - receipttype = '" . $_POST['ForReceipt'] . "' - WHERE paymentname LIKE '".$OldName."'"; + receipttype = '" . $_POST['ForReceipt'] . "', + usepreprintedstationery = '" . $_POST['UsePrePrintedStationery']. "' + WHERE paymentname " . LIKE . " '".$OldName."'"; /* lets leave well alone existing entries if ($_POST['MethodName'] != $OldMeasureName ) { @@ -103,11 +102,13 @@ $sql = "INSERT INTO paymentmethods ( paymentname, paymenttype, - receipttype) + receipttype, + usepreprintedstationery) VALUES ( '" . $_POST['MethodName'] ."', '" . $_POST['ForPayment'] ."', '" . $_POST['ForReceipt'] ."' + '" . $_POST['UsePrePrintedStationery'] ."' )"; } $msg = _('Record inserted'); @@ -124,6 +125,7 @@ unset ($_POST['MethodName']); unset ($_POST['ForPayment']); unset ($_POST['ForReceipt']); + unset ($_POST['UsePrePrintedStationery']); } elseif (isset($_GET['delete'])) { //the link to delete a selected record was clicked instead of the submit button @@ -143,12 +145,12 @@ $myrow = DB_fetch_row($result); if ($myrow[0]>0) { prnMsg( _('Cannot delete this payment method because bank transactions have been created using this payment method'),'warn'); - echo '<br>' . _('There are') . ' ' . $myrow[0] . ' ' . _('bank transactions that refer to this payment method') . '</font>'; + echo '<br />' . _('There are') . ' ' . $myrow[0] . ' ' . _('bank transactions that refer to this payment method') . '</font>'; } else { - $sql="DELETE FROM paymentmethods WHERE paymentname LIKE '" . $OldMeasureName . "'"; + $sql="DELETE FROM paymentmethods WHERE paymentname " . LIKE . " '" . $OldMeasureName . "'"; $result = DB_query($sql,$db); prnMsg( $OldMeasureName . ' ' . _('payment method has been deleted') . '!','success'); - echo '<br>'; + echo '<br />'; } //end if not used } //end if payment method exist unset ($SelectedPaymentID); @@ -174,19 +176,21 @@ $sql = "SELECT paymentid, paymentname, paymenttype, - receipttype + receipttype, + usepreprintedstationery FROM paymentmethods ORDER BY paymentid"; $ErrMsg = _('Could not get payment methods because'); $result = DB_query($sql,$db,$ErrMsg); - echo "<table class=selection> + echo '<table class=selection> <tr> - <th>" . _('Payment Method') . "</th> - <th>" . _('For Payments') . "</th> - <th>" . _('For Receipts') . "</th> - </tr>"; + <th>' . _('Payment Method') . '</th> + <th>' . _('For Payments') . '</th> + <th>' . _('For Receipts') . '</th> + <th>' . _('Use Pre-printed') .'<br />' . _('Stationery') . '</th> + </tr>'; $k=0; //row colour counter while ($myrow = DB_fetch_array($result)) { @@ -202,8 +206,9 @@ echo '<td>' . $myrow['paymentname'] . '</td>'; echo '<td>' . ($myrow['paymenttype'] ? _('Yes') : _('No')) . '</td>'; echo '<td>' . ($myrow['receipttype'] ? _('Yes') : _('No')) . '</td>'; - echo '<td><a href="' . $_SERVER['PHP_SELF'] . '?' . SID . '&SelectedPaymentID=' . $myrow['paymentid'] . '">' . _('Edit') . '</a></td>'; - echo '<td><a href="' . $_SERVER['PHP_SELF'] . '?' . SID . '&SelectedPaymentID=' . $myrow['paymentid'] . '&delete=1">' . _('Delete') .'</a></td>'; + echo '<td>' . ($myrow['usepreprintedstationery'] ? _('Yes') : _('No')) . '</td>'; + echo '<td><a href="' . $_SERVER['PHP_SELF'] . '?SelectedPaymentID=' . $myrow['paymentid'] . '">' . _('Edit') . '</a></td>'; + echo '<td><a href="' . $_SERVER['PHP_SELF'] . '?SelectedPaymentID=' . $myrow['paymentid'] . '&delete=1">' . _('Delete') .'</a></td>'; echo '</tr>'; } //END WHILE LIST LOOP @@ -219,7 +224,7 @@ if (! isset($_GET['delete'])) { - echo "<form method='post' action=" . $_SERVER['PHP_SELF'] . '?' . SID . '>'; + echo '<form method="post" action="' . $_SERVER['PHP_SELF'] . '">'; echo '<input type="hidden" name="FormID" value="' . $_SESSION['FormID'] . '" />'; if (isset($SelectedPaymentID)) { @@ -228,7 +233,8 @@ $sql = "SELECT paymentid, paymentname, paymenttype, - receipttype + receipttype, + usepreprintedstationery FROM paymentmethods WHERE paymentid='" . $SelectedPaymentID . "'"; @@ -243,37 +249,45 @@ $_POST['MethodName'] = $myrow['paymentname']; $_POST['ForPayment'] = $myrow['paymenttype']; $_POST['ForReceipt'] = $myrow['receipttype']; + $_POST['UsePrePrintedStationery'] = $myrow['usepreprintedstationery']; - echo "<input type=hidden name='SelectedPaymentID' VALUE='" . $_POST['MethodID'] . "'>"; - echo "<table class=selection>"; + echo '<input type="hidden" name="SelectedPaymentID" value="' . $_POST['MethodID'] . '">'; + echo '<table class="selection">'; } } else { $_POST['MethodName']=''; $_POST['ForPayment'] = 1; // Default is use for payment $_POST['ForReceipt'] = 1; // Default is use for receipts - echo "<table class=selection>"; + $_POST['UsePrePrintedStationery'] = 0; // Default is use for receipts + echo '<table class=selection>'; } - echo "<tr> - <td>" . _('Payment Method') . ':' . "</td> - <td><input type='Text' ". (in_array('MethodName',$Errors) ? 'class="inputerror"' : '' ) ." name='MethodName' size=30 maxlength=30 value='" . $_POST['MethodName'] . "'></td> - </tr>"; - echo "<tr> - <td>" . _('Use For Payments') . ':' . "</td> - <td><select name='ForPayment'>"; - echo "<option".($_POST['ForPayment'] ? ' selected' : '') ." VALUE='1'>" . _('Yes'); - echo "<option".($_POST['ForPayment'] ? '' : ' selected') ." VALUE='0'>" . _('No'); - echo "</select></td></tr>"; - echo "<tr> - <td>" . _('Use For Receipts') . ':' . "</td> - <td><select name='ForReceipt'>"; - echo "<option".($_POST['ForReceipt'] ? ' selected' : '') ." VALUE='1'>" . _('Yes'); - echo "<option".($_POST['ForReceipt'] ? '' : ' selected') ." VALUE='0'>" . _('No'); - echo "</select></td></tr>"; + echo '<tr> + <td>' . _('Payment Method') . ':' . '</td> + <td><input type="Text" '. (in_array('MethodName',$Errors) ? 'class="inputerror"' : '' ) .' name="MethodName" size="30" maxlength="30" value="' . $_POST['MethodName'] . '"></td> + </tr>'; + echo '<tr> + <td>' . _('Use For Payments') . ':' . '</td> + <td><select name="ForPayment"> + <option' . ($_POST['ForPayment'] ? ' selected' : '') .' value="1">' . _('Yes') . '</option> + <option' . ($_POST['ForPayment'] ? '' : ' selected') .' value="0">' . _('No') . '</select></td> + </tr>'; + echo '<tr> + <td>' . _('Use For Receipts') . ':' . '</td> + <td><select name="ForReceipt"> + <option' . ($_POST['ForReceipt'] ? ' selected' : '') .' value="1">' . _('Yes') . '</option> + <option' . ($_POST['ForReceipt'] ? '' : ' selected') .' value="0">' . _('No') . '</option> + </select></td></tr>'; + echo '<tr> + <td>' . _('Use Pre-printed Stationery') . ':' . '</td> + <td><select name="UsePrePrintedStationery"> + <option' . ($_POST['UsePrePrintedStationery'] ? ' selected': '' ) .' value="1">' . _('Yes') . '</option> + <option' . ($_POST['UsePrePrintedStationery']==1 ? '' : ' selected' ) .' value="0">' . _('No') . '</option> + </select></td></tr>'; echo '</table>'; - echo '<br><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/Payments.php =================================================================== --- trunk/Payments.php 2011-04-09 06:12:05 UTC (rev 4543) +++ trunk/Payments.php 2011-04-10 02:04:57 UTC (rev 4544) @@ -246,11 +246,16 @@ $PeriodNo = GetPeriod($_SESSION['PaymentDetail']->DatePaid,$db); + $sql="SELECT usepreprintedstationery + FROM paymentmethods + WHERE paymentname='" . $_SESSION['PaymentDetail']->Paymenttype ."'"; + $result=DB_query($sql, $db); + $myrow=DB_fetch_row($result); // first time through commit if supplier cheque then print it first if ((!isset($_POST['ChequePrinted'])) AND (!isset($_POST['PaymentCancelled'])) - AND ($_SESSION['PaymentDetail']->Paymenttype == 'Cheque')) { + AND ($myrow[0] == 1)) { // it is a supplier payment by cheque and haven't printed yet so print cheque echo '<br /><a href="' . $rootpath . '/PrintCheque.php?' . SID . '&ChequeNum=' . $_POST['ChequeNum'] . '">' . _('Print Cheque using pre-printed stationery') . '</a><br /><br />'; @@ -607,14 +612,14 @@ $_SESSION['PaymentDetail']->Remove_GLItem($_GET['Delete']); } elseif (isset($_POST['Process']) and !$BankAccountEmpty){ //user hit submit a new GL Analysis line into the payment - $ChequeNoSQL='select account from gltrans where chequeno="'.$_POST['cheque'].'"'; + $ChequeNoSQL="SELECT account FROM gltrans WHERE chequeno='" . $_POST['cheque'] ."'"; $ChequeNoResult=DB_query($ChequeNoSQL, $db); if (is_numeric($_POST['GLManualCode'])){ - $SQL = "select accountname - FROM chartmaster - WHERE accountcode='" . $_POST['GLManualCode'] . "'"; + $SQL = "SELECT accountname + FROM chartmaster + WHERE accountcode='" . $_POST['GLManualCode'] . "'"; $Result=DB_query($SQL,$db); Modified: trunk/Stocks.php =================================================================== --- trunk/Stocks.php 2011-04-09 06:12:05 UTC (rev 4543) +++ trunk/Stocks.php 2011-04-10 02:04:57 UTC (rev 4544) @@ -22,12 +22,15 @@ $myrow = DB_fetch_row($result); if ($myrow[0]==0) { $New=1; + } else { + $New=0; } } -?> +if (isset($_POST['New'])) { + $New=$_POST['New']; +} -<?php echo '<a href="' . $rootpath . '/SelectProduct.php?' . SID . '">' . _('Back to Items') . '</a><br>' . "\n"; echo '<p class="page_title_text"><img src="'.$rootpath.'/css/'.$theme.'/images/inventory.png" title="' @@ -62,7 +65,6 @@ $result = move_uploaded_file($_FILES['ItemPicture']['tmp_name'], $filename); $message = ($result)?_('File url') ."<a href='". $filename ."'>" . $filename . '</a>' : _('Something is wrong with uploading a file'); } - /* EOR Add Image upload for New Item - by Ori */ } if (isset($Errors)) { @@ -202,7 +204,7 @@ if ($_POST['Serialised']==1){ /*Not appropriate to have several dp on serial items */ $_POST['DecimalPlaces']=0; } - if (!isset($_POST['New']) and !isset($New)) { /*so its an existing one */ + if ($New==0) { /*so its an existing one */ /*first check on the changes being made we must disallow: - changes from manufactured or purchased to Service, Assembly or Kitset if there is stock - changes from manufactured, kitset or assembly where a BOM exists @@ -447,6 +449,7 @@ }//THE INSERT OF THE NEW CODE WORKED SO BANG IN THE STOCK LOCATION RECORDS TOO }//END CHECK FOR ALREADY EXISTING ITEM OF THE SAME CODE } + $New=1; } else { echo '<br>'. "\n"; @@ -563,7 +566,7 @@ unset($StockID); //echo "<meta http-equiv='Refresh' content='0; url=" . $rootpath . '/SelectProduct.php?' . SID ."'>"; - + $New=1; } //end if Delete Part } @@ -572,17 +575,20 @@ <tr><td>'. "\n"; // Nested table echo '<input type="hidden" name="FormID" value="' . $_SESSION['FormID'] . '" />'; +echo '<input type="hidden" name="New" value="'.$New.'">'. "\n"; + if (!isset($StockID) or $StockID=='' or isset($_POST['UpdateCategories'])) { /*If the page was called without $StockID passed to page then assume a new stock item is to be entered show a form with a part Code field other wise the form showing the fields with the existing entries against the part will show for editing with only a hidden StockID field. New is set to flag that the page may have called itself and still be entering a new part, in which case the page needs to know not to go looking up details for an existing part*/ - - $New = true; - echo '<input type="hidden" name="New" value="1">'. "\n"; if (!isset($StockID)) { - echo '<tr><td>'. _('Item Code'). ':</td><td><input ' . (in_array('StockID',$Errors) ? 'class="inputerror"' : '' ) .' type="text" name="StockID" size=21 maxlength=20 /></td></tr>'. "\n"; + $StockID=''; + } + if ($New==1) { + echo '<tr><td>'. _('Item Code'). ':</td><td><input ' . (in_array('StockID',$Errors) ? 'class="inputerror"' : '' ) .' type="text" + value="'.$StockID.'" name="StockID" size=21 maxlength=20 /></td></tr>'. "\n"; } else { - echo '<tr><td>'. _('Item Code'). ':</td><td><input ' . (in_array('StockID',$Errors) ? 'class="inputerror"' : '' ) .' type="text" name="StockID" size=21 maxlength=20 - value="'.$StockID.'" /></td></tr>'. "\n"; + echo '<tr><td>'. _('Item Code'). ':</td><td>'.$StockID.'</td></tr>'. "\n"; + echo '<input type="hidden" name ="StockID" value="'.$StockID.'" />'; } } elseif (!isset($_POST['UpdateCategories']) and $InputError!=1) { // Must be modifying an existing item and no changes made yet @@ -1016,7 +1022,7 @@ echo '</table><br>'; echo '<input type="hidden" name="PropertyCounter" value=' . $PropertyCounter . '>'; -if (isset($New)) { +if ($New==1) { echo '<input type="Submit" name="submit" value="' . _('Insert New Item') . '">'; echo '<input type="submit" name="UpdateCategories" style="visibility:hidden;width:1px" value="' . _('Categories') . '">'; Modified: trunk/doc/Change.log.html =================================================================== --- trunk/doc/Change.log.html 2011-04-09 06:12:05 UTC (rev 4543) +++ trunk/doc/Change.log.html 2011-04-10 02:04:57 UTC (rev 4544) @@ -1,5 +1,10 @@ <p><font SIZE=4 COLOR=BLUE><b>webERP Change Log</b></font></p> <p /> +<p> +<p>10/4/11 Tim: PDFPeriodStockTransListing - new report to print off stock transactions of a specified type for a selected period>/p> +<p>10/4/11 Tim: PDFStockTransListing.php option to print off transactions by inventory location</p> +<p>10/4/11 Tim: Stocks.php - more logical use of $New and $_POST['New']</p> +<p>10/4/11 Tim: Payments.php PaymentMethods.php Add new field userpreprintedstationery to payment methods to determine whether to print cheques</p> <p>5/4/11 Tim: includes/LanguageSetup.php - discovered solution to Turkish character set problem!!</p> <p>5/4/11 Phil: couple of is_date functions left over from experiment to see if changing fixed Turkish - now removed from SupplierInvoice.php and PDFOrdersInvoiced.php</p> <p>5/4/11 Phil: SuppCreditGRNs was not showing old GRNs and no way to input an older date</p> Modified: trunk/includes/ConnectDB.inc =================================================================== --- trunk/includes/ConnectDB.inc 2011-04-09 06:12:05 UTC (rev 4543) +++ trunk/includes/ConnectDB.inc 2011-04-10 02:04:57 UTC (rev 4544) @@ -4,7 +4,7 @@ * this value is saved in the $_SESSION['Versionumber'] when includes/GetConfig.php is run * if VersionNumber is < $Version then the DB update script is run */ -$Version='4.03.6'; //must update manually every time there is a DB change +$Version='4.03.7'; //must update manually every time there is a DB change require_once ($PathPrefix .'includes/MiscFunctions.php'); Added: trunk/includes/PDFPeriodStockTransListingPageHeader.inc =================================================================== --- trunk/includes/PDFPeriodStockTransListingPageHeader.inc (rev 0) +++ trunk/includes/PDFPeriodStockTransListingPageHeader.inc 2011-04-10 02:04:57 UTC (rev 4544) @@ -0,0 +1,59 @@ +<?php +/* $Id: PDFPeriodStockTransListingPageHeader.inc 4307 2010-12-22 16:06:03Z tim_schofield $*/ + +if ($PageNumber>1){ + $pdf->newPage(); +} + +$YPos = $Page_Height - $Top_Margin - 50; + +$pdf->addJpegFromFile($_SESSION['LogoFile'],$Left_Margin,$YPos,0,50); + +$FontSize=15; + + +$XPos = $Page_Width/2; +$YPos += 30; +$pdf->addText($XPos, $YPos,$FontSize, $_SESSION['CompanyRecord']['coyname']); +$FontSize=12; +$YPos -=30; +$pdf->addText($XPos, $YPos,$FontSize, $TransType . ' ' ._('dated from') . ' ' . $_POST['FromDate'] . ' ' . _('to') . ' ' . $_POST['ToDate']); + + +$XPos = $Page_Width-$Right_Margin-50; +$YPos -=30; +$pdf->addText($XPos, $YPos+10,$FontSize, _('Page') . ': ' . $PageNumber); + +/*Now print out the company name and address */ +$XPos = $Left_Margin; +$YPos -= $line_height; + +/*draw a square grid for entering line items */ +$pdf->line($XPos, $YPos,$Page_Width-$Right_Margin, $YPos); +$pdf->line($Page_Width-$Right_Margin, $YPos,$Page_Width-$Right_Margin, $Bottom_Margin); +$pdf->line($Page_Width-$Right_Margin, $Bottom_Margin,$XPos, $Bottom_Margin); +$pdf->line($XPos, $Bottom_Margin,$XPos, $YPos); + +$pdf->line($Left_Margin+160, $YPos,$Left_Margin+160, $Bottom_Margin); +$pdf->line($Left_Margin+240, $YPos,$Left_Margin+240, $Bottom_Margin); +$pdf->line($Left_Margin+310, $YPos,$Left_Margin+310, $Bottom_Margin); +$pdf->line($Left_Margin+384, $YPos,$Left_Margin+384, $Bottom_Margin); +$pdf->line($Left_Margin+454, $YPos,$Left_Margin+454, $Bottom_Margin); + +$YPos -= $line_height; +/*Set up headings */ +$FontSize=8; + +$LeftOvers = $pdf->addTextWrap($Left_Margin,$YPos,160,$FontSize,_('Stock Item'), 'left'); +$LeftOvers = $pdf->addTextWrap($Left_Margin+162,$YPos,80,$FontSize,_('Reference'), 'left'); +$LeftOvers = $pdf->addTextWrap($Left_Margin+242,$YPos,70,$FontSize,_('Trans Date'), 'left'); +$LeftOvers = $pdf->addTextWrap($Left_Margin+312,$YPos,70,$FontSize,_('Quantity'), 'right'); +$LeftOvers = $pdf->addTextWrap($Left_Margin+382,$YPos,70,$FontSize,_('Location'), 'right'); +$LeftOvers = $pdf->addTextWrap($Left_Margin+452,$YPos,70,$FontSize,_('Reference'), 'right'); +$YPos-=$line_height; + +/*draw a line */ +$pdf->line($XPos, $YPos,$Page_Width-$Right_Margin, $YPos); + +$YPos -= ($line_height); +?> \ No newline at end of file Deleted: trunk/includes/PDFStockTransListingPageHeader.inc =================================================================== --- trunk/includes/PDFStockTransListingPageHeader.inc 2011-04-09 06:12:05 UTC (rev 4543) +++ trunk/includes/PDFStockTransListingPageHeader.inc 2011-04-10 02:04:57 UTC (rev 4544) @@ -1,79 +0,0 @@ -<?php -/* $Id$*/ -if ($PageNumber>1){ - $pdf->newPage(); -} - -$YPos = $Page_Height - $Top_Margin - 50; - -$pdf->addJpegFromFile($_SESSION['LogoFile'],$Left_Margin,$YPos,0,50); - -$FontSize=15; - -Switch ($_POST['TransType']) { - case 10: - $TransType=_('Customer Invoices'); - break; - case 11: - $TransType=_('Customer Credit Notes'); - break; - case 16: - $TransType=_('Location Transfers'); - break; - case 17: - $TransType=_('Stock Adjustments'); - break; - case 25: - $TransType=_('Purchase Order Deliveries'); - break; - case 26: - $TransType=_('Work Order Receipts'); - break; - case 28: - $TransType=_('Work Order Issues'); - break; -} - -$XPos = $Page_Width/2; -$YPos += 30; -$pdf->addText($XPos, $YPos,$FontSize, $_SESSION['CompanyRecord']['coyname']); -$FontSize=12; -$pdf->addText($XPos, $YPos-20,$FontSize, $TransType . ' ' ._('dated') . ' ' . $_POST['Date']); - -$XPos = $Page_Width-$Right_Margin-50; -$YPos -=30; -$pdf->addText($XPos, $YPos+10,$FontSize, _('Page') . ': ' . $PageNumber); - -/*Now print out the company name and address */ -$XPos = $Left_Margin; -$YPos -= $line_height; - -/*draw a square grid for entering line items */ -$pdf->line($XPos, $YPos,$Page_Width-$Right_Margin, $YPos); -$pdf->line($Page_Width-$Right_Margin, $YPos,$Page_Width-$Right_Margin, $Bottom_Margin); -$pdf->line($Page_Width-$Right_Margin, $Bottom_Margin,$XPos, $Bottom_Margin); -$pdf->line($XPos, $Bottom_Margin,$XPos, $YPos); - -$pdf->line($Left_Margin+160, $YPos,$Left_Margin+160, $Bottom_Margin); -$pdf->line($Left_Margin+240, $YPos,$Left_Margin+240, $Bottom_Margin); -$pdf->line($Left_Margin+310, $YPos,$Left_Margin+310, $Bottom_Margin); -$pdf->line($Left_Margin+384, $YPos,$Left_Margin+384, $Bottom_Margin); -$pdf->line($Left_Margin+454, $YPos,$Left_Margin+454, $Bottom_Margin); - -$YPos -= $line_height; -/*Set up headings */ -$FontSize=8; - -$LeftOvers = $pdf->addTextWrap($Left_Margin,$YPos,160,$FontSize,_('Stock Item'), 'left'); -$LeftOvers = $pdf->addTextWrap($Left_Margin+162,$YPos,80,$FontSize,_('Reference'), 'left'); -$LeftOvers = $pdf->addTextWrap($Left_Margin+242,$YPos,70,$FontSize,_('Trans Date'), 'left'); -$LeftOvers = $pdf->addTextWrap($Left_Margin+312,$YPos,70,$FontSize,_('Quantity'), 'right'); -$LeftOvers = $pdf->addTextWrap($Left_Margin+382,$YPos,70,$FontSize,_('Location'), 'right'); -$LeftOvers = $pdf->addTextWrap($Left_Margin+452,$YPos,70,$FontSize,_('Reference'), 'right'); -$YPos-=$line_height; - -/*draw a line */ -$pdf->line($XPos, $YPos,$Page_Width-$Right_Margin, $YPos); - -$YPos -= ($line_height); -?> \ No newline at end of file Modified: trunk/index.php =================================================================== --- trunk/index.php 2011-04-09 06:12:05 UTC (rev 4543) +++ trunk/index.php 2011-04-10 02:04:57 UTC (rev 4544) @@ -695,7 +695,7 @@ </tr> <tr> <td class="menu_group_item"> - <?php echo '<p>• <a href="' . $rootpath . '/PDFStockTransListing.php">' . _('Daily Stock Transaction Listing') . '</a></p>'; ?> + <?php echo '<p>• <a href="' . $rootpath . '/PDFPeriodStockTransListing.php?">' . _('Period Stock Transaction Listing') . '</a></p>'; ?> </td> </tr> <tr> Modified: trunk/sql/mysql/upgrade3.11.1-4.00.sql =================================================================== --- trunk/sql/mysql/upgrade3.11.1-4.00.sql 2011-04-09 06:12:05 UTC (rev 4543) +++ trunk/sql/mysql/upgrade3.11.1-4.00.sql 2011-04-10 02:04:57 UTC (rev 4544) @@ -838,3 +838,7 @@ UPDATE config SET confvalue='4.03.5' WHERE confname='VersionNumber'; INSERT INTO `scripts` (`script` ,`pagesecurity` ,`description`) VALUES ( 'ReprintGRN.php', '11', 'Allows selection of a goods received batch for reprinting the goods received note given a purchase order number'); UPDATE config SET confvalue='4.03.6' WHERE confname='VersionNumber'; +ALTER TABLE `paymentmethods` ADD `usepreprintedstationery` TINYINT NOT NULL DEFAULT '0'; +DELETE FROM scripts WHERE script='PDFStockTransListing.php'; +INSERT INTO scripts (`script` ,`pagesecurity` ,`description`) VALUES('PDFPeriodStockTransListing.php','3','Allows stock transactions of a specific transaction type to be listed over a single day or period range'); +IUPDATE config SET confvalue='4.03.7' WHERE confname='VersionNumber'; This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <dai...@us...> - 2011-04-10 02:05:04
|
Revision: 4544 http://web-erp.svn.sourceforge.net/web-erp/?rev=4544&view=rev Author: daintree Date: 2011-04-10 02:04:57 +0000 (Sun, 10 Apr 2011) Log Message: ----------- Tim changes Modified Paths: -------------- trunk/PaymentMethods.php trunk/Payments.php trunk/Stocks.php trunk/doc/Change.log.html trunk/includes/ConnectDB.inc trunk/index.php trunk/sql/mysql/upgrade3.11.1-4.00.sql Added Paths: ----------- trunk/PDFPeriodStockTransListing.php trunk/includes/PDFPeriodStockTransListingPageHeader.inc Removed Paths: ------------- trunk/PDFStockTransListing.php trunk/includes/PDFStockTransListingPageHeader.inc Added: trunk/PDFPeriodStockTransListing.php =================================================================== --- trunk/PDFPeriodStockTransListing.php (rev 0) +++ trunk/PDFPeriodStockTransListing.php 2011-04-10 02:04:57 UTC (rev 4544) @@ -0,0 +1,203 @@ +<?php +/* $Id: PDFPeriodStockTransListing.php 4307 2010-12-22 16:06:03Z tim_schofield $*/ + + +include('includes/SQL_CommonFunctions.inc'); +include ('includes/session.inc'); + +$InputError=0; +if (isset($_POST['FromDate']) AND !Is_Date($_POST['FromDate'])){ + $msg = _('The date must be specified in the format') . ' ' . $_SESSION['DefaultDateFormat']; + $InputError=1; + unset($_POST['FromDate']); +} + +if (!isset($_POST['FromDate'])){ + + $title = _('Stock Transaction Listing'); + include ('includes/header.inc'); + + echo '<div class="centre"><p class="page_title_text"><img src="'.$rootpath.'/css/'.$theme.'/images/transactions.png" title="' . $title . '" alt="">' . ' ' + . _('Stock Transaction Listing').'</img></p></div>'; + + if ($InputError==1){ + prnMsg($msg,'error'); + } + + echo '<form method="post" action="' . $_SERVER['PHP_SELF'] . '">'; + echo '<input type="hidden" name="FormID" value="' . $_SESSION['FormID'] . '" />'; + echo '<table class=selection>'; + echo '<tr> + <td>' . _('Enter the date from which the transactions are to be listed') . ':</td> + <td><input type="text" name="FromDate" maxlength="10" size="10" class="date" alt="' . $_SESSION['DefaultDateFormat'] . '" value="' . Date($_SESSION['DefaultDateFormat']) . '"></td> + </tr>'; + echo '<tr> + <td>' . _('Enter the date to which the transactions are to be listed') . ':</td> + <td><input type=text name="ToDate" maxlength="10" size="10" class="date" alt="' . $_SESSION['DefaultDateFormat'] . '" value="' . Date($_SESSION['DefaultDateFormat']) . '"></td> + </tr>'; + + echo '<tr><td>' . _('Transaction type') . '</td><td>'; + + echo '<select name="TransType">'; + + echo '<option value=10>' . _('Sales Invoice').'</option> + <option value=11>' . _('Sales Credit Note').'</option> + <option value=16>' . _('Location Transfer').'</option> + <option value=17>' . _('Stock Adjustment').'</option> + <option value=25>' . _('Purchase Order Delivery').'</option> + <option value=26>' . _('Work Order Receipt').'</option> + <option value=28>' . _('Work Order Issue').'</option>'; + + echo '</select></td></tr>'; + + $sql = "SELECT loccode, locationname FROM locations"; + $resultStkLocs = DB_query($sql, $db); + + echo '<tr><td>' . _('For Stock Location') . ':</td> + <td><select name="StockLocation">'; + echo '<option VALUE="All">' . _('All') . '</option>'; + while ($myrow=DB_fetch_array($resultStkLocs)){ + if (isset($_POST['StockLocation']) AND $_POST['StockLocation']!='All'){ + if ($myrow['loccode'] == $_POST['StockLocation']){ + echo '<option selected VALUE="' . $myrow['loccode'] . '">' . $myrow['locationname'] . '</option>'; + } else { + echo '<option VALUE="' . $myrow['loccode'] . '">' . $myrow['locationname'] . '</option>'; + } + } elseif ($myrow['loccode']==$_SESSION['UserStockLocation']){ + echo '<option selected VALUE="' . $myrow['loccode'] . '">' . $myrow['locationname'] . '</option>'; + $_POST['StockLocation']=$myrow['loccode']; + } else { + echo '<option VALUE="' . $myrow['loccode'] . '">' . $myrow['locationname'] . '</option>'; + } + } + echo '</select></td></tr>'; + + echo '</table><br><div class="centre"><input type=submit name="Go" value="' . _('Create PDF') . '"></div>'; + + include('includes/footer.inc'); + exit; +} else { + + include('includes/ConnectDB.inc'); +} + + +if ($_POST['StockLocation']=='All') { + $sql= "SELECT stockmoves.type, + stockmoves.stockid, + stockmaster.description, + stockmaster.decimalplaces, + stockmoves.transno, + stockmoves.trandate, + stockmoves.qty, + stockmoves.reference, + stockmoves.narrative, + locations.locationname + FROM stockmoves + LEFT JOIN stockmaster + ON stockmoves.stockid=stockmaster.stockid + LEFT JOIN locations + ON stockmoves.loccode=locations.loccode + WHERE type='" . $_POST['TransType'] . "' + AND date_format(trandate, '%Y-%m-%d')>='".FormatDateForSQL($_POST['FromDate'])."' + AND date_format(trandate, '%Y-%m-%d')<='".FormatDateForSQL($_POST['ToDate'])."'"; +} else { + $sql= "SELECT stockmoves.type, + stockmoves.stockid, + stockmaster.description, + stockmaster.decimalplaces, + stockmoves.transno, + stockmoves.trandate, + stockmoves.qty, + stockmoves.reference, + stockmoves.narrative, + locations.locationname + FROM stockmoves + LEFT JOIN stockmaster + ON stockmoves.stockid=stockmaster.stockid + LEFT JOIN locations + ON stockmoves.loccode=locations.loccode + WHERE type='" . $_POST['TransType'] . "' + AND date_format(trandate, '%Y-%m-%d')>='".FormatDateForSQL($_POST['FromDate'])."' + AND date_format(trandate, '%Y-%m-%d')<='".FormatDateForSQL($_POST['ToDate'])."' + AND stockmoves.loccode='" . $_POST['StockLocation'] . "'"; +} +$result=DB_query($sql,$db,'','',false,false); + +if (DB_error_no($db)!=0){ + $title = _('Transaction Listing'); + include('includes/header.inc'); + prnMsg(_('An error occurred getting the transactions'),'error'); + include('includes/footer.inc'); + exit; +} elseif (DB_num_rows($result) == 0){ + $title = _('Transaction Listing'); + include('includes/header.inc'); + echo '<br>'; + prnMsg (_('There were no transactions found in the database between the dates') . ' ' . $_POST['FromDate'] . ' ' . _('and') . ' '. $_POST['ToDate'] .'<br />' ._('Please try again selecting a different date'), 'info'); + include('includes/footer.inc'); + exit; +} + +include('includes/PDFStarter.php'); + +/*PDFStarter.php has all the variables for page size and width set up depending on the users default preferences for paper size */ + +$pdf->addInfo('Title',_('Stock Transaction Listing')); +$pdf->addInfo('Subject',_('Stock transaction listing from') . ' ' . $_POST['FromDate'] . ' ' . $_POST['ToDate']); +$line_height=12; +$PageNumber = 1; + + +switch ($_POST['TransType']) { + case 10: + $TransType=_('Customer Invoices'); + break; + case 11: + $TransType=_('Customer Credit Notes'); + break; + case 16: + $TransType=_('Location Transfers'); + break; + case 17: + $TransType=_('Stock Adjustments'); + break; + case 25: + $TransType=_('Purchase Order Deliveries'); + break; + case 26: + $TransType=_('Work Order Receipts'); + break; + case 28: + $TransType=_('Work Order Issues'); + break; +} + +include ('includes/PDFPeriodStockTransListingPageHeader.inc'); + +while ($myrow=DB_fetch_array($result)){ + + $LeftOvers = $pdf->addTextWrap($Left_Margin,$YPos,160,$FontSize,$myrow['description'], 'left'); + $LeftOvers = $pdf->addTextWrap($Left_Margin+162,$YPos,80,$FontSize,$myrow['transno'], 'left'); + $LeftOvers = $pdf->addTextWrap($Left_Margin+242,$YPos,70,$FontSize,ConvertSQLDate($myrow['trandate']), 'left'); + $LeftOvers = $pdf->addTextWrap($Left_Margin+312,$YPos,70,$FontSize,number_format($myrow['qty'],$myrow['decimalplaces']), 'right'); + $LeftOvers = $pdf->addTextWrap($Left_Margin+382,$YPos,70,$FontSize,$myrow['locationname'], 'right'); + $LeftOvers = $pdf->addTextWrap($Left_Margin+452,$YPos,70,$FontSize,$myrow['reference'], 'right'); + + $YPos -= ($line_height); + + if ($YPos - (2 *$line_height) < $Bottom_Margin){ + /*Then set up a new page */ + $PageNumber++; + include ('includes/PDFPeriodStockTransListingPageHeader.inc'); + } /*end of new page header */ +} /* end of while there are customer receipts in the batch to print */ + + +$YPos-=$line_height; + +$ReportFileName = $_SESSION['DatabaseName'] . '_StockTransListing_' . date('Y-m-d').'.pdf'; +$pdf->OutputD($ReportFileName); +$pdf->__destruct(); + +?> \ No newline at end of file Deleted: trunk/PDFStockTransListing.php =================================================================== --- trunk/PDFStockTransListing.php 2011-04-09 06:12:05 UTC (rev 4543) +++ trunk/PDFStockTransListing.php 2011-04-10 02:04:57 UTC (rev 4544) @@ -1,145 +0,0 @@ -<?php - -/* $Id$*/ - -/* $Revision: 1.13 $ */ - -//$PageSecurity = 3; -include('includes/SQL_CommonFunctions.inc'); -include ('includes/session.inc'); - -$InputError=0; -if (isset($_POST['Date']) AND !Is_Date($_POST['Date'])){ - $msg = _('The date must be specified in the format') . ' ' . $_SESSION['DefaultDateFormat']; - $InputError=1; - unset($_POST['Date']); -} - -if (!isset($_POST['Date'])){ - - $title = _('Stock Transaction Listing'); - include ('includes/header.inc'); - - echo '<div class="centre"><p class="page_title_text"><img src="'.$rootpath.'/css/'.$theme.'/images/transactions.png" title="' . $title . '" alt="" />' . ' ' - . _('Stock Transaction Listing').'</p></div>'; - - if ($InputError==1){ - prnMsg($msg,'error'); - } - - echo "<form method='post' action=" . $_SERVER['PHP_SELF'] . '>'; - echo '<input type="hidden" name="FormID" value="' . $_SESSION['FormID'] . '" />'; - echo '<table class=selection> - <tr> - <td>' . _('Enter the date for which the transactions are to be listed') . ":</td> - <td><input type=text name='Date' maxlength=10 size=10 class=date alt='" . $_SESSION['DefaultDateFormat'] . "' value='" . Date($_SESSION['DefaultDateFormat']) . "'></td> - </tr>"; - - echo '<tr><td>' . _('Transaction type') . '</td><td>'; - - echo "<select name='TransType'>"; - - echo '<option value=10>' . _('Sales Invoice').'</option>'; - echo '<option value=11>' . _('Sales Credit Note').'</option>'; - echo '<option value=16>' . _('Location Transfer').'</option>'; - echo '<option value=17>' . _('Stock Adjustment').'</option>'; - echo '<option value=25>' . _('Purchase Order Delivery').'</option>'; - echo '<option value=26>' . _('Work Order Receipt').'</option>'; - echo '<option value=28>' . _('Work Order Issue').'</option>'; - - echo '</select></td></tr>'; - - echo "</select></td></tr></table><br><div class='centre'><input type=submit name='Go' value='" . _('Create PDF') . "'></div>"; - - - include('includes/footer.inc'); - exit; -} else { - - include('includes/ConnectDB.inc'); -} - -$sql= "SELECT stockmoves.type, - stockmoves.stockid, - stockmaster.description, - stockmaster.decimalplaces, - stockmoves.transno, - stockmoves.trandate, - stockmoves.qty, - stockmoves.reference, - stockmoves.narrative, - locations.locationname - FROM stockmoves - LEFT JOIN stockmaster - ON stockmoves.stockid=stockmaster.stockid - LEFT JOIN locations - ON stockmoves.loccode=locations.loccode - WHERE type='" . $_POST['TransType'] . "' - AND date_format(trandate, '%Y-%m-%d')='".FormatDateForSQL($_POST['Date'])."'"; - -$result=DB_query($sql,$db,'','',false,false); - -if (DB_error_no($db)!=0){ - $title = _('Transaction Listing'); - include('includes/header.inc'); - prnMsg(_('An error occurred getting the transactions'),'error'); - include('includes/footer.inc'); - exit; -} elseif (DB_num_rows($result) == 0){ - $title = _('Transaction Listing'); - include('includes/header.inc'); - echo '<br>'; - prnMsg (_('There were no transactions found in the database for the date') . ' ' . $_POST['Date'] .'. '._('Please try again selecting a different date'), 'info'); - include('includes/footer.inc'); - exit; -} - -include('includes/PDFStarter.php'); - -/*PDFStarter.php has all the variables for page size and width set up depending on the users default preferences for paper size */ - -$pdf->addInfo('Title',_('Stock Transaction Listing')); -$pdf->addInfo('Subject',_('Stock transaction listing from') . ' ' . $_POST['Date'] ); -$line_height=12; -$PageNumber = 1; - -include ('includes/PDFStockTransListingPageHeader.inc'); - -while ($myrow=DB_fetch_array($result)){ - - $LeftOvers = $pdf->addTextWrap($Left_Margin,$YPos,160,$FontSize,$myrow['description'], 'left'); - $LeftOvers = $pdf->addTextWrap($Left_Margin+162,$YPos,80,$FontSize,$myrow['transno'], 'left'); - $LeftOvers = $pdf->addTextWrap($Left_Margin+242,$YPos,70,$FontSize,ConvertSQLDate($myrow['trandate']), 'left'); - $LeftOvers = $pdf->addTextWrap($Left_Margin+312,$YPos,70,$FontSize,number_format($myrow['qty'],$myrow['decimalplaces']), 'right'); - $LeftOvers = $pdf->addTextWrap($Left_Margin+382,$YPos,70,$FontSize,$myrow['locationname'], 'right'); - $LeftOvers = $pdf->addTextWrap($Left_Margin+452,$YPos,70,$FontSize,$myrow['reference'], 'right'); - - $YPos -= ($line_height); - - if ($YPos - (2 *$line_height) < $Bottom_Margin){ - /*Then set up a new page */ - $PageNumber++; - include ('includes/PDFStockTransListingPageHeader.inc'); - } /*end of new page header */ -} /* end of while there are customer receipts in the batch to print */ - - -$YPos-=$line_height; - -/* UldisN -$pdfcode = $pdf->output(); -$len = strlen($pdfcode); -header('Content-type: application/pdf'); -header('Content-Length: ' . $len); -header('Content-Disposition: inline; filename=ChequeListing.pdf'); -header('Expires: 0'); -header('Cache-Control: must-revalidate, post-check=0, pre-check=0'); -header('Pragma: public'); - -$pdf->stream(); -*/ -$ReportFileName = $_SESSION['DatabaseName'] . '_StockTransListing_' . date('Y-m-d').'.pdf'; -$pdf->OutputD($ReportFileName);//UldisN -$pdf->__destruct(); //UldisN - -?> \ No newline at end of file Modified: trunk/PaymentMethods.php =================================================================== --- trunk/PaymentMethods.php 2011-04-09 06:12:05 UTC (rev 4543) +++ trunk/PaymentMethods.php 2011-04-10 02:04:57 UTC (rev 4544) @@ -1,9 +1,7 @@ <?php -/* $Revision: 1.9 $ */ + /* $Id$*/ -//$PageSecurity = 15; - include('includes/session.inc'); $title = _('Payment Methods'); @@ -72,8 +70,9 @@ $sql = "UPDATE paymentmethods SET paymentname='" . $_POST['MethodName'] . "', paymenttype = '" . $_POST['ForPayment'] . "', - receipttype = '" . $_POST['ForReceipt'] . "' - WHERE paymentname LIKE '".$OldName."'"; + receipttype = '" . $_POST['ForReceipt'] . "', + usepreprintedstationery = '" . $_POST['UsePrePrintedStationery']. "' + WHERE paymentname " . LIKE . " '".$OldName."'"; /* lets leave well alone existing entries if ($_POST['MethodName'] != $OldMeasureName ) { @@ -103,11 +102,13 @@ $sql = "INSERT INTO paymentmethods ( paymentname, paymenttype, - receipttype) + receipttype, + usepreprintedstationery) VALUES ( '" . $_POST['MethodName'] ."', '" . $_POST['ForPayment'] ."', '" . $_POST['ForReceipt'] ."' + '" . $_POST['UsePrePrintedStationery'] ."' )"; } $msg = _('Record inserted'); @@ -124,6 +125,7 @@ unset ($_POST['MethodName']); unset ($_POST['ForPayment']); unset ($_POST['ForReceipt']); + unset ($_POST['UsePrePrintedStationery']); } elseif (isset($_GET['delete'])) { //the link to delete a selected record was clicked instead of the submit button @@ -143,12 +145,12 @@ $myrow = DB_fetch_row($result); if ($myrow[0]>0) { prnMsg( _('Cannot delete this payment method because bank transactions have been created using this payment method'),'warn'); - echo '<br>' . _('There are') . ' ' . $myrow[0] . ' ' . _('bank transactions that refer to this payment method') . '</font>'; + echo '<br />' . _('There are') . ' ' . $myrow[0] . ' ' . _('bank transactions that refer to this payment method') . '</font>'; } else { - $sql="DELETE FROM paymentmethods WHERE paymentname LIKE '" . $OldMeasureName . "'"; + $sql="DELETE FROM paymentmethods WHERE paymentname " . LIKE . " '" . $OldMeasureName . "'"; $result = DB_query($sql,$db); prnMsg( $OldMeasureName . ' ' . _('payment method has been deleted') . '!','success'); - echo '<br>'; + echo '<br />'; } //end if not used } //end if payment method exist unset ($SelectedPaymentID); @@ -174,19 +176,21 @@ $sql = "SELECT paymentid, paymentname, paymenttype, - receipttype + receipttype, + usepreprintedstationery FROM paymentmethods ORDER BY paymentid"; $ErrMsg = _('Could not get payment methods because'); $result = DB_query($sql,$db,$ErrMsg); - echo "<table class=selection> + echo '<table class=selection> <tr> - <th>" . _('Payment Method') . "</th> - <th>" . _('For Payments') . "</th> - <th>" . _('For Receipts') . "</th> - </tr>"; + <th>' . _('Payment Method') . '</th> + <th>' . _('For Payments') . '</th> + <th>' . _('For Receipts') . '</th> + <th>' . _('Use Pre-printed') .'<br />' . _('Stationery') . '</th> + </tr>'; $k=0; //row colour counter while ($myrow = DB_fetch_array($result)) { @@ -202,8 +206,9 @@ echo '<td>' . $myrow['paymentname'] . '</td>'; echo '<td>' . ($myrow['paymenttype'] ? _('Yes') : _('No')) . '</td>'; echo '<td>' . ($myrow['receipttype'] ? _('Yes') : _('No')) . '</td>'; - echo '<td><a href="' . $_SERVER['PHP_SELF'] . '?' . SID . '&SelectedPaymentID=' . $myrow['paymentid'] . '">' . _('Edit') . '</a></td>'; - echo '<td><a href="' . $_SERVER['PHP_SELF'] . '?' . SID . '&SelectedPaymentID=' . $myrow['paymentid'] . '&delete=1">' . _('Delete') .'</a></td>'; + echo '<td>' . ($myrow['usepreprintedstationery'] ? _('Yes') : _('No')) . '</td>'; + echo '<td><a href="' . $_SERVER['PHP_SELF'] . '?SelectedPaymentID=' . $myrow['paymentid'] . '">' . _('Edit') . '</a></td>'; + echo '<td><a href="' . $_SERVER['PHP_SELF'] . '?SelectedPaymentID=' . $myrow['paymentid'] . '&delete=1">' . _('Delete') .'</a></td>'; echo '</tr>'; } //END WHILE LIST LOOP @@ -219,7 +224,7 @@ if (! isset($_GET['delete'])) { - echo "<form method='post' action=" . $_SERVER['PHP_SELF'] . '?' . SID . '>'; + echo '<form method="post" action="' . $_SERVER['PHP_SELF'] . '">'; echo '<input type="hidden" name="FormID" value="' . $_SESSION['FormID'] . '" />'; if (isset($SelectedPaymentID)) { @@ -228,7 +233,8 @@ $sql = "SELECT paymentid, paymentname, paymenttype, - receipttype + receipttype, + usepreprintedstationery FROM paymentmethods WHERE paymentid='" . $SelectedPaymentID . "'"; @@ -243,37 +249,45 @@ $_POST['MethodName'] = $myrow['paymentname']; $_POST['ForPayment'] = $myrow['paymenttype']; $_POST['ForReceipt'] = $myrow['receipttype']; + $_POST['UsePrePrintedStationery'] = $myrow['usepreprintedstationery']; - echo "<input type=hidden name='SelectedPaymentID' VALUE='" . $_POST['MethodID'] . "'>"; - echo "<table class=selection>"; + echo '<input type="hidden" name="SelectedPaymentID" value="' . $_POST['MethodID'] . '">'; + echo '<table class="selection">'; } } else { $_POST['MethodName']=''; $_POST['ForPayment'] = 1; // Default is use for payment $_POST['ForReceipt'] = 1; // Default is use for receipts - echo "<table class=selection>"; + $_POST['UsePrePrintedStationery'] = 0; // Default is use for receipts + echo '<table class=selection>'; } - echo "<tr> - <td>" . _('Payment Method') . ':' . "</td> - <td><input type='Text' ". (in_array('MethodName',$Errors) ? 'class="inputerror"' : '' ) ." name='MethodName' size=30 maxlength=30 value='" . $_POST['MethodName'] . "'></td> - </tr>"; - echo "<tr> - <td>" . _('Use For Payments') . ':' . "</td> - <td><select name='ForPayment'>"; - echo "<option".($_POST['ForPayment'] ? ' selected' : '') ." VALUE='1'>" . _('Yes'); - echo "<option".($_POST['ForPayment'] ? '' : ' selected') ." VALUE='0'>" . _('No'); - echo "</select></td></tr>"; - echo "<tr> - <td>" . _('Use For Receipts') . ':' . "</td> - <td><select name='ForReceipt'>"; - echo "<option".($_POST['ForReceipt'] ? ' selected' : '') ." VALUE='1'>" . _('Yes'); - echo "<option".($_POST['ForReceipt'] ? '' : ' selected') ." VALUE='0'>" . _('No'); - echo "</select></td></tr>"; + echo '<tr> + <td>' . _('Payment Method') . ':' . '</td> + <td><input type="Text" '. (in_array('MethodName',$Errors) ? 'class="inputerror"' : '' ) .' name="MethodName" size="30" maxlength="30" value="' . $_POST['MethodName'] . '"></td> + </tr>'; + echo '<tr> + <td>' . _('Use For Payments') . ':' . '</td> + <td><select name="ForPayment"> + <option' . ($_POST['ForPayment'] ? ' selected' : '') .' value="1">' . _('Yes') . '</option> + <option' . ($_POST['ForPayment'] ? '' : ' selected') .' value="0">' . _('No') . '</select></td> + </tr>'; + echo '<tr> + <td>' . _('Use For Receipts') . ':' . '</td> + <td><select name="ForReceipt"> + <option' . ($_POST['ForReceipt'] ? ' selected' : '') .' value="1">' . _('Yes') . '</option> + <option' . ($_POST['ForReceipt'] ? '' : ' selected') .' value="0">' . _('No') . '</option> + </select></td></tr>'; + echo '<tr> + <td>' . _('Use Pre-printed Stationery') . ':' . '</td> + <td><select name="UsePrePrintedStationery"> + <option' . ($_POST['UsePrePrintedStationery'] ? ' selected': '' ) .' value="1">' . _('Yes') . '</option> + <option' . ($_POST['UsePrePrintedStationery']==1 ? '' : ' selected' ) .' value="0">' . _('No') . '</option> + </select></td></tr>'; echo '</table>'; - echo '<br><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/Payments.php =================================================================== --- trunk/Payments.php 2011-04-09 06:12:05 UTC (rev 4543) +++ trunk/Payments.php 2011-04-10 02:04:57 UTC (rev 4544) @@ -246,11 +246,16 @@ $PeriodNo = GetPeriod($_SESSION['PaymentDetail']->DatePaid,$db); + $sql="SELECT usepreprintedstationery + FROM paymentmethods + WHERE paymentname='" . $_SESSION['PaymentDetail']->Paymenttype ."'"; + $result=DB_query($sql, $db); + $myrow=DB_fetch_row($result); // first time through commit if supplier cheque then print it first if ((!isset($_POST['ChequePrinted'])) AND (!isset($_POST['PaymentCancelled'])) - AND ($_SESSION['PaymentDetail']->Paymenttype == 'Cheque')) { + AND ($myrow[0] == 1)) { // it is a supplier payment by cheque and haven't printed yet so print cheque echo '<br /><a href="' . $rootpath . '/PrintCheque.php?' . SID . '&ChequeNum=' . $_POST['ChequeNum'] . '">' . _('Print Cheque using pre-printed stationery') . '</a><br /><br />'; @@ -607,14 +612,14 @@ $_SESSION['PaymentDetail']->Remove_GLItem($_GET['Delete']); } elseif (isset($_POST['Process']) and !$BankAccountEmpty){ //user hit submit a new GL Analysis line into the payment - $ChequeNoSQL='select account from gltrans where chequeno="'.$_POST['cheque'].'"'; + $ChequeNoSQL="SELECT account FROM gltrans WHERE chequeno='" . $_POST['cheque'] ."'"; $ChequeNoResult=DB_query($ChequeNoSQL, $db); if (is_numeric($_POST['GLManualCode'])){ - $SQL = "select accountname - FROM chartmaster - WHERE accountcode='" . $_POST['GLManualCode'] . "'"; + $SQL = "SELECT accountname + FROM chartmaster + WHERE accountcode='" . $_POST['GLManualCode'] . "'"; $Result=DB_query($SQL,$db); Modified: trunk/Stocks.php =================================================================== --- trunk/Stocks.php 2011-04-09 06:12:05 UTC (rev 4543) +++ trunk/Stocks.php 2011-04-10 02:04:57 UTC (rev 4544) @@ -22,12 +22,15 @@ $myrow = DB_fetch_row($result); if ($myrow[0]==0) { $New=1; + } else { + $New=0; } } -?> +if (isset($_POST['New'])) { + $New=$_POST['New']; +} -<?php echo '<a href="' . $rootpath . '/SelectProduct.php?' . SID . '">' . _('Back to Items') . '</a><br>' . "\n"; echo '<p class="page_title_text"><img src="'.$rootpath.'/css/'.$theme.'/images/inventory.png" title="' @@ -62,7 +65,6 @@ $result = move_uploaded_file($_FILES['ItemPicture']['tmp_name'], $filename); $message = ($result)?_('File url') ."<a href='". $filename ."'>" . $filename . '</a>' : _('Something is wrong with uploading a file'); } - /* EOR Add Image upload for New Item - by Ori */ } if (isset($Errors)) { @@ -202,7 +204,7 @@ if ($_POST['Serialised']==1){ /*Not appropriate to have several dp on serial items */ $_POST['DecimalPlaces']=0; } - if (!isset($_POST['New']) and !isset($New)) { /*so its an existing one */ + if ($New==0) { /*so its an existing one */ /*first check on the changes being made we must disallow: - changes from manufactured or purchased to Service, Assembly or Kitset if there is stock - changes from manufactured, kitset or assembly where a BOM exists @@ -447,6 +449,7 @@ }//THE INSERT OF THE NEW CODE WORKED SO BANG IN THE STOCK LOCATION RECORDS TOO }//END CHECK FOR ALREADY EXISTING ITEM OF THE SAME CODE } + $New=1; } else { echo '<br>'. "\n"; @@ -563,7 +566,7 @@ unset($StockID); //echo "<meta http-equiv='Refresh' content='0; url=" . $rootpath . '/SelectProduct.php?' . SID ."'>"; - + $New=1; } //end if Delete Part } @@ -572,17 +575,20 @@ <tr><td>'. "\n"; // Nested table echo '<input type="hidden" name="FormID" value="' . $_SESSION['FormID'] . '" />'; +echo '<input type="hidden" name="New" value="'.$New.'">'. "\n"; + if (!isset($StockID) or $StockID=='' or isset($_POST['UpdateCategories'])) { /*If the page was called without $StockID passed to page then assume a new stock item is to be entered show a form with a part Code field other wise the form showing the fields with the existing entries against the part will show for editing with only a hidden StockID field. New is set to flag that the page may have called itself and still be entering a new part, in which case the page needs to know not to go looking up details for an existing part*/ - - $New = true; - echo '<input type="hidden" name="New" value="1">'. "\n"; if (!isset($StockID)) { - echo '<tr><td>'. _('Item Code'). ':</td><td><input ' . (in_array('StockID',$Errors) ? 'class="inputerror"' : '' ) .' type="text" name="StockID" size=21 maxlength=20 /></td></tr>'. "\n"; + $StockID=''; + } + if ($New==1) { + echo '<tr><td>'. _('Item Code'). ':</td><td><input ' . (in_array('StockID',$Errors) ? 'class="inputerror"' : '' ) .' type="text" + value="'.$StockID.'" name="StockID" size=21 maxlength=20 /></td></tr>'. "\n"; } else { - echo '<tr><td>'. _('Item Code'). ':</td><td><input ' . (in_array('StockID',$Errors) ? 'class="inputerror"' : '' ) .' type="text" name="StockID" size=21 maxlength=20 - value="'.$StockID.'" /></td></tr>'. "\n"; + echo '<tr><td>'. _('Item Code'). ':</td><td>'.$StockID.'</td></tr>'. "\n"; + echo '<input type="hidden" name ="StockID" value="'.$StockID.'" />'; } } elseif (!isset($_POST['UpdateCategories']) and $InputError!=1) { // Must be modifying an existing item and no changes made yet @@ -1016,7 +1022,7 @@ echo '</table><br>'; echo '<input type="hidden" name="PropertyCounter" value=' . $PropertyCounter . '>'; -if (isset($New)) { +if ($New==1) { echo '<input type="Submit" name="submit" value="' . _('Insert New Item') . '">'; echo '<input type="submit" name="UpdateCategories" style="visibility:hidden;width:1px" value="' . _('Categories') . '">'; Modified: trunk/doc/Change.log.html =================================================================== --- trunk/doc/Change.log.html 2011-04-09 06:12:05 UTC (rev 4543) +++ trunk/doc/Change.log.html 2011-04-10 02:04:57 UTC (rev 4544) @@ -1,5 +1,10 @@ <p><font SIZE=4 COLOR=BLUE><b>webERP Change Log</b></font></p> <p /> +<p> +<p>10/4/11 Tim: PDFPeriodStockTransListing - new report to print off stock transactions of a specified type for a selected period>/p> +<p>10/4/11 Tim: PDFStockTransListing.php option to print off transactions by inventory location</p> +<p>10/4/11 Tim: Stocks.php - more logical use of $New and $_POST['New']</p> +<p>10/4/11 Tim: Payments.php PaymentMethods.php Add new field userpreprintedstationery to payment methods to determine whether to print cheques</p> <p>5/4/11 Tim: includes/LanguageSetup.php - discovered solution to Turkish character set problem!!</p> <p>5/4/11 Phil: couple of is_date functions left over from experiment to see if changing fixed Turkish - now removed from SupplierInvoice.php and PDFOrdersInvoiced.php</p> <p>5/4/11 Phil: SuppCreditGRNs was not showing old GRNs and no way to input an older date</p> Modified: trunk/includes/ConnectDB.inc =================================================================== --- trunk/includes/ConnectDB.inc 2011-04-09 06:12:05 UTC (rev 4543) +++ trunk/includes/ConnectDB.inc 2011-04-10 02:04:57 UTC (rev 4544) @@ -4,7 +4,7 @@ * this value is saved in the $_SESSION['Versionumber'] when includes/GetConfig.php is run * if VersionNumber is < $Version then the DB update script is run */ -$Version='4.03.6'; //must update manually every time there is a DB change +$Version='4.03.7'; //must update manually every time there is a DB change require_once ($PathPrefix .'includes/MiscFunctions.php'); Added: trunk/includes/PDFPeriodStockTransListingPageHeader.inc =================================================================== --- trunk/includes/PDFPeriodStockTransListingPageHeader.inc (rev 0) +++ trunk/includes/PDFPeriodStockTransListingPageHeader.inc 2011-04-10 02:04:57 UTC (rev 4544) @@ -0,0 +1,59 @@ +<?php +/* $Id: PDFPeriodStockTransListingPageHeader.inc 4307 2010-12-22 16:06:03Z tim_schofield $*/ + +if ($PageNumber>1){ + $pdf->newPage(); +} + +$YPos = $Page_Height - $Top_Margin - 50; + +$pdf->addJpegFromFile($_SESSION['LogoFile'],$Left_Margin,$YPos,0,50); + +$FontSize=15; + + +$XPos = $Page_Width/2; +$YPos += 30; +$pdf->addText($XPos, $YPos,$FontSize, $_SESSION['CompanyRecord']['coyname']); +$FontSize=12; +$YPos -=30; +$pdf->addText($XPos, $YPos,$FontSize, $TransType . ' ' ._('dated from') . ' ' . $_POST['FromDate'] . ' ' . _('to') . ' ' . $_POST['ToDate']); + + +$XPos = $Page_Width-$Right_Margin-50; +$YPos -=30; +$pdf->addText($XPos, $YPos+10,$FontSize, _('Page') . ': ' . $PageNumber); + +/*Now print out the company name and address */ +$XPos = $Left_Margin; +$YPos -= $line_height; + +/*draw a square grid for entering line items */ +$pdf->line($XPos, $YPos,$Page_Width-$Right_Margin, $YPos); +$pdf->line($Page_Width-$Right_Margin, $YPos,$Page_Width-$Right_Margin, $Bottom_Margin); +$pdf->line($Page_Width-$Right_Margin, $Bottom_Margin,$XPos, $Bottom_Margin); +$pdf->line($XPos, $Bottom_Margin,$XPos, $YPos); + +$pdf->line($Left_Margin+160, $YPos,$Left_Margin+160, $Bottom_Margin); +$pdf->line($Left_Margin+240, $YPos,$Left_Margin+240, $Bottom_Margin); +$pdf->line($Left_Margin+310, $YPos,$Left_Margin+310, $Bottom_Margin); +$pdf->line($Left_Margin+384, $YPos,$Left_Margin+384, $Bottom_Margin); +$pdf->line($Left_Margin+454, $YPos,$Left_Margin+454, $Bottom_Margin); + +$YPos -= $line_height; +/*Set up headings */ +$FontSize=8; + +$LeftOvers = $pdf->addTextWrap($Left_Margin,$YPos,160,$FontSize,_('Stock Item'), 'left'); +$LeftOvers = $pdf->addTextWrap($Left_Margin+162,$YPos,80,$FontSize,_('Reference'), 'left'); +$LeftOvers = $pdf->addTextWrap($Left_Margin+242,$YPos,70,$FontSize,_('Trans Date'), 'left'); +$LeftOvers = $pdf->addTextWrap($Left_Margin+312,$YPos,70,$FontSize,_('Quantity'), 'right'); +$LeftOvers = $pdf->addTextWrap($Left_Margin+382,$YPos,70,$FontSize,_('Location'), 'right'); +$LeftOvers = $pdf->addTextWrap($Left_Margin+452,$YPos,70,$FontSize,_('Reference'), 'right'); +$YPos-=$line_height; + +/*draw a line */ +$pdf->line($XPos, $YPos,$Page_Width-$Right_Margin, $YPos); + +$YPos -= ($line_height); +?> \ No newline at end of file Deleted: trunk/includes/PDFStockTransListingPageHeader.inc =================================================================== --- trunk/includes/PDFStockTransListingPageHeader.inc 2011-04-09 06:12:05 UTC (rev 4543) +++ trunk/includes/PDFStockTransListingPageHeader.inc 2011-04-10 02:04:57 UTC (rev 4544) @@ -1,79 +0,0 @@ -<?php -/* $Id$*/ -if ($PageNumber>1){ - $pdf->newPage(); -} - -$YPos = $Page_Height - $Top_Margin - 50; - -$pdf->addJpegFromFile($_SESSION['LogoFile'],$Left_Margin,$YPos,0,50); - -$FontSize=15; - -Switch ($_POST['TransType']) { - case 10: - $TransType=_('Customer Invoices'); - break; - case 11: - $TransType=_('Customer Credit Notes'); - break; - case 16: - $TransType=_('Location Transfers'); - break; - case 17: - $TransType=_('Stock Adjustments'); - break; - case 25: - $TransType=_('Purchase Order Deliveries'); - break; - case 26: - $TransType=_('Work Order Receipts'); - break; - case 28: - $TransType=_('Work Order Issues'); - break; -} - -$XPos = $Page_Width/2; -$YPos += 30; -$pdf->addText($XPos, $YPos,$FontSize, $_SESSION['CompanyRecord']['coyname']); -$FontSize=12; -$pdf->addText($XPos, $YPos-20,$FontSize, $TransType . ' ' ._('dated') . ' ' . $_POST['Date']); - -$XPos = $Page_Width-$Right_Margin-50; -$YPos -=30; -$pdf->addText($XPos, $YPos+10,$FontSize, _('Page') . ': ' . $PageNumber); - -/*Now print out the company name and address */ -$XPos = $Left_Margin; -$YPos -= $line_height; - -/*draw a square grid for entering line items */ -$pdf->line($XPos, $YPos,$Page_Width-$Right_Margin, $YPos); -$pdf->line($Page_Width-$Right_Margin, $YPos,$Page_Width-$Right_Margin, $Bottom_Margin); -$pdf->line($Page_Width-$Right_Margin, $Bottom_Margin,$XPos, $Bottom_Margin); -$pdf->line($XPos, $Bottom_Margin,$XPos, $YPos); - -$pdf->line($Left_Margin+160, $YPos,$Left_Margin+160, $Bottom_Margin); -$pdf->line($Left_Margin+240, $YPos,$Left_Margin+240, $Bottom_Margin); -$pdf->line($Left_Margin+310, $YPos,$Left_Margin+310, $Bottom_Margin); -$pdf->line($Left_Margin+384, $YPos,$Left_Margin+384, $Bottom_Margin); -$pdf->line($Left_Margin+454, $YPos,$Left_Margin+454, $Bottom_Margin); - -$YPos -= $line_height; -/*Set up headings */ -$FontSize=8; - -$LeftOvers = $pdf->addTextWrap($Left_Margin,$YPos,160,$FontSize,_('Stock Item'), 'left'); -$LeftOvers = $pdf->addTextWrap($Left_Margin+162,$YPos,80,$FontSize,_('Reference'), 'left'); -$LeftOvers = $pdf->addTextWrap($Left_Margin+242,$YPos,70,$FontSize,_('Trans Date'), 'left'); -$LeftOvers = $pdf->addTextWrap($Left_Margin+312,$YPos,70,$FontSize,_('Quantity'), 'right'); -$LeftOvers = $pdf->addTextWrap($Left_Margin+382,$YPos,70,$FontSize,_('Location'), 'right'); -$LeftOvers = $pdf->addTextWrap($Left_Margin+452,$YPos,70,$FontSize,_('Reference'), 'right'); -$YPos-=$line_height; - -/*draw a line */ -$pdf->line($XPos, $YPos,$Page_Width-$Right_Margin, $YPos); - -$YPos -= ($line_height); -?> \ No newline at end of file Modified: trunk/index.php =================================================================== --- trunk/index.php 2011-04-09 06:12:05 UTC (rev 4543) +++ trunk/index.php 2011-04-10 02:04:57 UTC (rev 4544) @@ -695,7 +695,7 @@ </tr> <tr> <td class="menu_group_item"> - <?php echo '<p>• <a href="' . $rootpath . '/PDFStockTransListing.php">' . _('Daily Stock Transaction Listing') . '</a></p>'; ?> + <?php echo '<p>• <a href="' . $rootpath . '/PDFPeriodStockTransListing.php?">' . _('Period Stock Transaction Listing') . '</a></p>'; ?> </td> </tr> <tr> Modified: trunk/sql/mysql/upgrade3.11.1-4.00.sql =================================================================== --- trunk/sql/mysql/upgrade3.11.1-4.00.sql 2011-04-09 06:12:05 UTC (rev 4543) +++ trunk/sql/mysql/upgrade3.11.1-4.00.sql 2011-04-10 02:04:57 UTC (rev 4544) @@ -838,3 +838,7 @@ UPDATE config SET confvalue='4.03.5' WHERE confname='VersionNumber'; INSERT INTO `scripts` (`script` ,`pagesecurity` ,`description`) VALUES ( 'ReprintGRN.php', '11', 'Allows selection of a goods received batch for reprinting the goods received note given a purchase order number'); UPDATE config SET confvalue='4.03.6' WHERE confname='VersionNumber'; +ALTER TABLE `paymentmethods` ADD `usepreprintedstationery` TINYINT NOT NULL DEFAULT '0'; +DELETE FROM scripts WHERE script='PDFStockTransListing.php'; +INSERT INTO scripts (`script` ,`pagesecurity` ,`description`) VALUES('PDFPeriodStockTransListing.php','3','Allows stock transactions of a specific transaction type to be listed over a single day or period range'); +IUPDATE config SET confvalue='4.03.7' WHERE confname='VersionNumber'; This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <dai...@us...> - 2011-04-09 06:12:14
|
Revision: 4543 http://web-erp.svn.sourceforge.net/web-erp/?rev=4543&view=rev Author: daintree Date: 2011-04-09 06:12:05 +0000 (Sat, 09 Apr 2011) Log Message: ----------- SQL and xhtml quoting Modified Paths: -------------- trunk/ShipmentCosting.php trunk/Z_CreateCompanyTemplateFile.php trunk/Z_CurrencyDebtorsBalances.php trunk/Z_CurrencySuppliersBalances.php trunk/Z_DataExport.php trunk/Z_DeleteCreditNote.php trunk/Z_DeleteInvoice.php trunk/Z_ImportFixedAssets.php trunk/Z_ImportGLAccountGroups.php trunk/Z_ImportGLAccountSections.php trunk/Z_ImportPartCodes.php trunk/Z_MakeStockLocns.php trunk/Z_PriceChanges.php trunk/Z_ReApplyCostToSA.php trunk/Z_RePostGLFromPeriod.php trunk/Z_ReverseSuppPaymentRun.php trunk/Z_SalesIntegrityCheck.php trunk/Z_UpdateChartDetailsBFwd.php trunk/api/api_debtortransactions.php trunk/api/api_glgroups.php trunk/api/api_glsections.php trunk/api/api_locations.php trunk/api/api_login.php trunk/api/api_purchdata.php trunk/api/api_salestypes.php trunk/api/api_stockcategories.php trunk/includes/SQL_CommonFunctions.inc Modified: trunk/ShipmentCosting.php =================================================================== --- trunk/ShipmentCosting.php 2011-04-08 23:37:01 UTC (rev 4542) +++ trunk/ShipmentCosting.php 2011-04-09 06:12:05 UTC (rev 4543) @@ -321,8 +321,9 @@ 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'] . "'"; + $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, @@ -385,7 +386,7 @@ 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); Modified: trunk/Z_CreateCompanyTemplateFile.php =================================================================== --- trunk/Z_CreateCompanyTemplateFile.php 2011-04-08 23:37:01 UTC (rev 4542) +++ trunk/Z_CreateCompanyTemplateFile.php 2011-04-09 06:12:05 UTC (rev 4543) @@ -1,8 +1,6 @@ <?php /* $Id$*/ -//$PageSecurity =15; - include ('includes/session.inc'); $title = _('Create Database Template File'); include ('includes/header.inc'); @@ -15,20 +13,20 @@ } if ($InputError==false){ - $CurrResult = DB_query( 'SELECT currabrev, - currency, - country, - debtorsact, - creditorsact, - payrollact, - grnact, - exchangediffact, - purchasesexchangediffact, - retainedearnings, - freightact - FROM currencies INNER JOIN companies - ON companies.currencydefault=currencies.currabrev - WHERE coycode=1',$db); + $CurrResult = DB_query( "SELECT currabrev, + currency, + country, + debtorsact, + creditorsact, + payrollact, + grnact, + exchangediffact, + purchasesexchangediffact, + retainedearnings, + freightact + FROM currencies INNER JOIN companies + ON companies.currencydefault=currencies.currabrev + WHERE coycode='1'",$db); $CurrRow = DB_fetch_array($CurrResult); @@ -46,7 +44,7 @@ purchasesexchangediffact=" . $CurrRow['purchasesexchangediffact'] . ", retainedearnings=" . $CurrRow['retainedearnings'] . ", freightact=" . $CurrRow['freightact'] . " - WHERE coycode=1;\n"; + WHERE coycode='1';\n"; /*empty out any existing records in chartmaster, @@ -67,12 +65,12 @@ $SQLScript .= "TRUNCATE TABLE taxcategories;\n"; $SQLScript .= "TRUNCATE TABLE taxprovinces;\n"; - $GroupsResult = DB_query('SELECT groupname, - sectioninaccounts, - pandl, - sequenceintb, - parentgroupname - FROM accountgroups',$db); + $GroupsResult = DB_query("SELECT groupname, + sectioninaccounts, + pandl, + sequenceintb, + parentgroupname + FROM accountgroups",$db); while ($GroupRow = DB_fetch_array($GroupsResult)){ $SQLScript .= "INSERT INTO accountgroups (groupname,sectioninaccounts,pandl, sequenceintb, parentgroupname) @@ -83,13 +81,15 @@ '" . $GroupRow['parentgroupname'] . "');\n"; } - $ChartResult = DB_query('SELECT accountcode, accountname, group_ FROM chartmaster',$db); + $ChartResult = DB_query("SELECT accountcode, accountname, group_ FROM chartmaster",$db); $i=0; while ($ChartRow = DB_fetch_array($ChartResult)){ if ($_POST['IncludeAccount_' .$i]=='on'){ $SQLScript .= "INSERT INTO chartmaster (accountcode,accountname,group_) - VALUES (" . $ChartRow['accountcode'] . ", '" . $ChartRow['accountname'] . "', '" . $ChartRow['group_'] . "');\n"; + VALUES ('" . $ChartRow['accountcode'] . "', + '" . $ChartRow['accountname'] . "', + '" . $ChartRow['group_'] . "');\n"; } $i++; } @@ -98,14 +98,14 @@ /*Tax Authorities table */ $TaxAuthoritiesResult = DB_query("SELECT taxid, - description, - taxglcode, - purchtaxglaccount, - bank, - bankacctype, - bankacc, - bankswift - FROM taxauthorities",$db); + description, + taxglcode, + purchtaxglaccount, + bank, + bankacctype, + bankacc, + bankswift + FROM taxauthorities",$db); while ($TaxAuthoritiesRow = DB_fetch_array($TaxAuthoritiesResult)){ $SQLScript .= "INSERT INTO taxauthorities (taxid, @@ -127,11 +127,11 @@ } /*taxauthrates table */ - $TaxAuthRatesResult = DB_query('SELECT taxauthority, - dispatchtaxprovince, - taxcatid, - taxrate - FROM taxauthrates',$db); + $TaxAuthRatesResult = DB_query("SELECT taxauthority, + dispatchtaxprovince, + taxcatid, + taxrate + FROM taxauthrates",$db); while ($TaxAuthRatesRow = DB_fetch_array($TaxAuthRatesResult)){ $SQLScript .= "INSERT INTO taxauthrates (taxauthority, @@ -145,20 +145,20 @@ } /*taxgroups table */ - $TaxGroupsResult = DB_query('SELECT taxgroupid, - taxgroupdescription - FROM taxgroups',$db); + $TaxGroupsResult = DB_query("SELECT taxgroupid, + taxgroupdescription + FROM taxgroups",$db); while ($TaxGroupsRow = DB_fetch_array($TaxGroupsResult)){ $SQLScript .= "INSERT INTO taxgroups (taxgroupid, taxgroupdescription) - VALUES (" . $TaxGroupsRow['taxgroupid'] . ", + VALUES ('" . $TaxGroupsRow['taxgroupid'] . "', '" . $TaxGroupsRow['taxgroupdescription'] . "');\n"; } /*tax categories table */ - $TaxCategoriesResult = DB_query('SELECT taxcatid, - taxcatname - FROM taxcategories',$db); + $TaxCategoriesResult = DB_query("SELECT taxcatid, + taxcatname + FROM taxcategories",$db); while ($TaxCategoriesRow = DB_fetch_array($TaxCategoriesResult)){ $SQLScript .= "INSERT INTO taxcategories (taxcatid, @@ -167,9 +167,9 @@ '" . $TaxCategoriesRow['taxcatname'] . "');\n"; } /*tax provinces table */ - $TaxProvincesResult = DB_query('SELECT taxprovinceid, - taxprovincename - FROM taxprovinces',$db); + $TaxProvincesResult = DB_query("SELECT taxprovinceid, + taxprovincename + FROM taxprovinces",$db); while ($TaxProvincesRow = DB_fetch_array($TaxProvincesResult)){ $SQLScript .= "INSERT INTO taxprovinces (taxprovinceid, @@ -178,11 +178,11 @@ '" . $TaxProvincesRow['taxprovincename'] . "');\n"; } /*taxgroup taxes table */ - $TaxGroupTaxesResult = DB_query('SELECT taxgroupid, - taxauthid, - calculationorder, - taxontax - FROM taxgrouptaxes',$db); + $TaxGroupTaxesResult = DB_query("SELECT taxgroupid, + taxauthid, + calculationorder, + taxontax + FROM taxgrouptaxes",$db); while ($TaxGroupTaxesRow = DB_fetch_array($TaxGroupTaxesResult)){ $SQLScript .= "INSERT INTO taxgrouptaxes (taxgroupid, @@ -194,7 +194,7 @@ " . $TaxGroupTaxesRow['calculationorder'] . ", " . $TaxGroupTaxesRow['taxontax'] . ");\n"; } - $SQLScript .= 'SET FOREIGN_KEY_CHECKS=1;'; + $SQLScript .= "SET FOREIGN_KEY_CHECKS=1;"; /*Now write $SQLScript to a file */ $FileHandle = fopen("./companies/" . $_SESSION['DatabaseName'] . "/reports/" . $_POST['TemplateName'] .".sql","w"); fwrite ($FileHandle, $SQLScript); @@ -225,10 +225,10 @@ echo '<table>'; /*Show the chart of accounts to be exported for deslection of company specific ones */ -$ChartResult = DB_query('SELECT accountcode, accountname, group_ FROM chartmaster',$db); +$ChartResult = DB_query("SELECT accountcode, accountname, group_ FROM chartmaster",$db); $TableHeadings = '<tr><th>' . _('Account Code') . '</th> - <th>' . _('Account Name') . '</th></tr>'; + <th>' . _('Account Name') . '</th></tr>'; $i = 0; while ($ChartRow = DB_fetch_array($ChartResult)){ echo '<tr><td>' . $ChartRow['accountcode'] . '</td> Modified: trunk/Z_CurrencyDebtorsBalances.php =================================================================== --- trunk/Z_CurrencyDebtorsBalances.php 2011-04-08 23:37:01 UTC (rev 4542) +++ trunk/Z_CurrencyDebtorsBalances.php 2011-04-09 06:12:05 UTC (rev 4543) @@ -1,6 +1,5 @@ <?php /* $Id$*/ -//$PageSecurity=15; include('includes/session.inc'); $title=_('Currency Debtor Balances'); @@ -8,12 +7,12 @@ echo '<font size=4><b>' . _('Debtors Balances By Currency Totals') . '</b></font>'; -$sql = 'SELECT SUM(ovamount+ovgst+ovdiscount+ovfreight-alloc) AS currencybalance, +$sql = "SELECT SUM(ovamount+ovgst+ovdiscount+ovfreight-alloc) AS currencybalance, currcode, SUM((ovamount+ovgst+ovdiscount+ovfreight-alloc)/rate) AS localbalance FROM debtortrans INNER JOIN debtorsmaster ON debtortrans.debtorno=debtorsmaster.debtorno - WHERE (ovamount+ovgst+ovdiscount+ovfreight-alloc)<>0 GROUP BY currcode'; + WHERE (ovamount+ovgst+ovdiscount+ovfreight-alloc)<>0 GROUP BY currcode"; $result = DB_query($sql,$db); Modified: trunk/Z_CurrencySuppliersBalances.php =================================================================== --- trunk/Z_CurrencySuppliersBalances.php 2011-04-08 23:37:01 UTC (rev 4542) +++ trunk/Z_CurrencySuppliersBalances.php 2011-04-09 06:12:05 UTC (rev 4543) @@ -1,6 +1,5 @@ <?php /* $Id$*/ -//$PageSecurity=15; include('includes/session.inc'); $title=_('Currency Debtor Balances'); @@ -8,11 +7,11 @@ echo '<font size=4><b>' . _('Suppliers Balances By Currency Totals') . '</b></font>'; -$sql = 'SELECT SUM(ovamount+ovgst-alloc) AS currencybalance, +$sql = "SELECT SUM(ovamount+ovgst-alloc) AS currencybalance, currcode, SUM((ovamount+ovgst-alloc)/rate) AS localbalance FROM supptrans INNER JOIN suppliers ON supptrans.supplierno=suppliers.supplierid - WHERE (ovamount+ovgst-alloc)<>0 GROUP BY currcode'; + WHERE (ovamount+ovgst-alloc)<>0 GROUP BY currcode"; $result = DB_query($sql,$db); Modified: trunk/Z_DataExport.php =================================================================== --- trunk/Z_DataExport.php 2011-04-08 23:37:01 UTC (rev 4542) +++ trunk/Z_DataExport.php 2011-04-09 06:12:05 UTC (rev 4543) @@ -2,7 +2,6 @@ /* $Id$*/ -//$PageSecurity=15; include('includes/session.inc'); @@ -70,9 +69,9 @@ $title = _('Price List Export Problem ....'); include('includes/header.inc'); prnMsg( _('The Price List could not be retrieved by the SQL because'). ' - ' . DB_error_msg($db), 'error'); - echo '<br><a href="' .$rootpath .'/index.php?' . SID . '">'. _('Back to the menu'). '</a>'; + echo '<br /><a href="' .$rootpath .'/index.php?' . SID . '">'. _('Back to the menu'). '</a>'; if ($debug==1){ - echo '<br>'. $SQL; + echo '<br />'. $SQL; } include('includes/footer.inc'); exit; @@ -166,9 +165,9 @@ $title = _('Customer List Export Problem ....'); include('includes/header.inc'); prnMsg( _('The Customer List could not be retrieved by the SQL because'). ' - ' . DB_error_msg($db), 'error'); - echo '<br><a href="' .$rootpath .'/index.php?' . SID . '">'. _('Back to the menu'). '</a>'; + echo '<br /><a href="' .$rootpath .'/index.php">'. _('Back to the menu'). '</a>'; if ($debug==1){ - echo '<br>'. $SQL; + echo '<br />'. $SQL; } include('includes/footer.inc'); exit; @@ -257,9 +256,9 @@ $title = _('Salesman List Export Problem ....'); include('includes/header.inc'); prnMsg( _('The Salesman List could not be retrieved by the SQL because'). ' - ' . DB_error_msg($db), 'error'); - echo '<br><a href="' .$rootpath .'/index.php?' . SID . '">'. _('Back to the menu'). '</a>'; + echo '<br /><a href="' .$rootpath .'/index.php">'. _('Back to the menu'). '</a>'; if ($debug==1){ - echo '<br>'. $SQL; + echo '<br />'. $SQL; } include('includes/footer.inc'); exit; @@ -306,9 +305,9 @@ $title = _('Security Token List Export Problem ....'); include('includes/header.inc'); prnMsg( _('The Image List could not be retrieved by the SQL because'). ' - ' . DB_error_msg($db), 'error'); - echo '<br><a href="' .$rootpath .'/index.php?' . SID . '">'. _('Back to the menu'). '</a>'; + echo '<br /><a href="' .$rootpath .'/index.php">'. _('Back to the menu'). '</a>'; if ($debug==1){ - echo '<br>'. $SQL; + echo '<br />'. $SQL; } include('includes/footer.inc'); exit; @@ -345,9 +344,9 @@ $title = _('Security Token List Export Problem ....'); include('includes/header.inc'); prnMsg( _('The Security Token List could not be retrieved by the SQL because'). ' - ' . DB_error_msg($db), 'error'); - echo '<br><a href="' .$rootpath .'/index.php?' . SID . '">'. _('Back to the menu'). '</a>'; + echo '<br /><a href="' .$rootpath .'/index.php?' . SID . '">'. _('Back to the menu'). '</a>'; if ($debug==1){ - echo '<br>'. $SQL; + echo '<br />'. $SQL; } include('includes/footer.inc'); exit; @@ -381,9 +380,9 @@ $title = _('Security Role List Export Problem ....'); include('includes/header.inc'); prnMsg( _('The Security Role List could not be retrieved by the SQL because'). ' - ' . DB_error_msg($db), 'error'); - echo '<br><a href="' .$rootpath .'/index.php?' . SID . '">'. _('Back to the menu'). '</a>'; + echo '<br /><a href="' .$rootpath .'/index.php">'. _('Back to the menu'). '</a>'; if ($debug==1){ - echo '<br>'. $SQL; + echo '<br />'. $SQL; } include('includes/footer.inc'); exit; @@ -417,9 +416,9 @@ $title = _('Security Group List Export Problem ....'); include('includes/header.inc'); prnMsg( _('The Security Group List could not be retrieved by the SQL because'). ' - ' . DB_error_msg($db), 'error'); - echo '<br><a href="' .$rootpath .'/index.php?' . SID . '">'. _('Back to the menu'). '</a>'; + echo '<br /><a href="' .$rootpath .'/index.php?' . SID . '">'. _('Back to the menu'). '</a>'; if ($debug==1){ - echo '<br>'. $SQL; + echo '<br />'. $SQL; } include('includes/footer.inc'); exit; @@ -469,9 +468,9 @@ $title = _('Security User List Export Problem ....'); include('includes/header.inc'); prnMsg( _('The Security User List could not be retrieved by the SQL because'). ' - ' . DB_error_msg($db), 'error'); - echo '<br><a href="' .$rootpath .'/index.php?' . SID . '">'. _('Back to the menu'). '</a>'; + echo '<br /><a href="' .$rootpath .'/index.php">'. _('Back to the menu'). '</a>'; if ($debug==1){ - echo '<br>'. $SQL; + echo '<br />'. $SQL; } include('includes/footer.inc'); exit; @@ -532,8 +531,8 @@ // SELECT EXPORT FOR PRICE LIST - echo "<br>"; - echo "<form method='post' action=" . $_SERVER['PHP_SELF'] . "?" . SID . ">"; + echo '<br />'; + echo '<form method="post" action="' . $_SERVER['PHP_SELF'] . '">'; echo '<input type="hidden" name="FormID" value="' . $_SESSION['FormID'] . '" />'; echo '<table>'; echo '<tr><th colspan=2>' . _('Price List Export') . '</th></tr>'; @@ -554,16 +553,16 @@ echo '<option Value="' . $myrow['loccode'] . '">' . $myrow['locationname']; } echo '</select></td></tr>'; - echo "</table>"; + echo '</table>'; echo "<div class='centre'><input type='Submit' name='pricelist' value='" . _('Export') . "'></div>"; - echo "</form><br>"; + echo '</form><br />'; // SELECT EXPORT FOR CUSTOMER LIST - echo "<br>"; + echo "<br />"; // Export Stock For Location - echo "<form method='post' action=" . $_SERVER['PHP_SELF'] . "?" . SID . ">"; + echo '<form method="post" action="' . $_SERVER['PHP_SELF'] . '">'; echo '<input type="hidden" name="FormID" value="' . $_SESSION['FormID'] . '" />'; echo '<table>'; echo '<tr><th colspan=2>' . _('Customer List Export') . '</th></tr>'; @@ -576,66 +575,66 @@ echo '<option Value="' . $myrow['loccode'] . '">' . $myrow['locationname']; } echo '</select></td></tr>'; - echo "</table>"; + echo '</table>'; echo "<div class='centre'><input type='Submit' name='custlist' value='" . _('Export') . "'></div>"; - echo "</form><br>"; + echo '</form><br />'; // SELECT EXPORT FOR SALES MAN - echo "<br>"; + echo "<br />"; // Export Stock For Location - echo "<form method='post' action=" . $_SERVER['PHP_SELF'] . "?" . SID . ">"; + echo '<form method="post" action="' . $_SERVER['PHP_SELF'] . '">'; echo '<input type="hidden" name="FormID" value="' . $_SESSION['FormID'] . '" />'; echo '<table>'; echo '<tr><th colspan=2>' . _('Salesman List Export') . '</th></tr>'; - echo "</table>"; + echo '</table>'; echo "<div class='centre'><div class='centre'><input type='Submit' name='salesmanlist' value='" . _('Export') . "'></div>"; - echo "</form><br>"; + echo '</form><br />'; // SELECT EXPORT FOR IMAGES - echo "<form method='post' action=" . $_SERVER['PHP_SELF'] . "?" . SID . ">"; + echo '<form method="post" action="' . $_SERVER['PHP_SELF'] . '">'; echo '<input type="hidden" name="FormID" value="' . $_SESSION['FormID'] . '" />'; echo '<table>'; echo '<tr><th colspan=2>' . _('Image List Export') . '</th></tr>'; - echo "</table>"; + echo '</table>'; echo "<div class='centre'><input type='Submit' name='imagelist' value='" . _('Export') . "'></div>"; - echo "</form><br>"; + echo '</form><br />'; // SELECT EXPORT SECURITY TOKENS - echo "<form method='post' action=" . $_SERVER['PHP_SELF'] . "?" . SID . ">"; + echo '<form method="post" action="' . $_SERVER['PHP_SELF'] . '">'; echo '<input type="hidden" name="FormID" value="' . $_SESSION['FormID'] . '" />'; echo '<table>'; echo '<tr><th colspan=2>' . _('Security Token List Export') . '</th></tr>'; - echo "</table>"; + echo '</table>'; echo "<div class='centre'><input type='Submit' name='sectokenlist' value='" . _('Export') . "'></div>"; - echo "</form><br>"; + echo '</form><br />'; // SELECT EXPORT SECURITY ROLES - echo "<form method='post' action=" . $_SERVER['PHP_SELF'] . "?" . SID . ">"; + echo '<form method="post" action="' . $_SERVER['PHP_SELF'] . '">'; echo '<input type="hidden" name="FormID" value="' . $_SESSION['FormID'] . '" />'; echo '<table>'; echo '<tr><th colspan=2>' . _('Security Role List Export') . '</th></tr>'; - echo "</table>"; + echo '</table>'; echo "<div class='centre'><input type='Submit' name='secrolelist' value='" . _('Export') . "'></div>"; - echo "</form><br>"; + echo '</form><br />'; // SELECT EXPORT SECURITY GROUPS - echo "<form method='post' action=" . $_SERVER['PHP_SELF'] . "?" . SID . ">"; + echo '<form method="post" action="' . $_SERVER['PHP_SELF'] . '">'; echo '<input type="hidden" name="FormID" value="' . $_SESSION['FormID'] . '" />'; echo '<table>'; echo '<tr><th colspan=2>' . _('Security Group List Export') . '</th></tr>'; - echo "</table>"; + echo '</table>'; echo "<div class='centre'><input type='Submit' name='secgrouplist' value='" . _('Export') . "'></div>"; - echo "</form><br>"; + echo '</form><br />'; // SELECT EXPORT SECURITY USERS - echo "<form method='post' action=" . $_SERVER['PHP_SELF'] . "?" . SID . ">"; + echo '<form method="post" action="' . $_SERVER['PHP_SELF'] . '">'; echo '<input type="hidden" name="FormID" value="' . $_SESSION['FormID'] . '" />'; echo '<table>'; echo '<tr><th colspan=2>' . _('Security User List Export') . '</th></tr>'; - echo "</table>"; - echo "<div class='centre'><input type='Submit' name='secuserlist' value='" . _('Export') . "'></div>"; - echo "</form><br>"; + echo '</table>'; + echo '<div class="centre"><input type="Submit" name="secuserlist" value="' . _('Export') . '"></div>'; + echo '</form><br />'; include('includes/footer.inc'); Modified: trunk/Z_DeleteCreditNote.php =================================================================== --- trunk/Z_DeleteCreditNote.php 2011-04-08 23:37:01 UTC (rev 4542) +++ trunk/Z_DeleteCreditNote.php 2011-04-09 06:12:05 UTC (rev 4543) @@ -5,11 +5,12 @@ /* Script to delete a credit note - it expects and credit note number to delete not included on any menu for obvious reasons +STRONGLY RECOMMEND NOT USING THIS - RE INVOICE INSTEAD + must be called directly with path/DeleteCreditnote.php?CreditNoteNo=??????? !! */ -//$PageSecurity=15; include ('includes/session.inc'); $title = _('Delete Credit Note'); @@ -21,7 +22,7 @@ } /*get the order number that was credited */ -$SQL = 'SELECT order_ FROM debtortrans WHERE transno=' . $_GET['CreditNoteNo'] . ' AND type=11'; +$SQL = "SELECT order_ FROM debtortrans WHERE transno='" . $_GET['CreditNoteNo'] . "' AND type='11'"; $Result = DB_query($SQL, $db); $myrow = DB_fetch_row($Result); @@ -29,14 +30,14 @@ /*Now get the stock movements that were credited into an array */ -$SQL = 'SELECT stockid, - loccode, - debtorno, - branchcode, - prd, - qty - FROM stockmoves - WHERE transno =' .$_GET['CreditNoteNo'] . ' AND type=11'; +$SQL = "SELECT stockid, + loccode, + debtorno, + branchcode, + prd, + qty + FROM stockmoves + WHERE transno ='" .$_GET['CreditNoteNo'] . "' AND type='11'"; $Result = DB_query($SQL,$db); $i=0; @@ -72,8 +73,8 @@ /*reverse the update to LocStock */ $SQL = "UPDATE locstock SET locstock.quantity = locstock.quantity + " . $CreditLine['qty'] . " - WHERE locstock.stockid = '" . $CreditLine['stockid'] . "' - AND loccode = '" . $CreditLine['loccode'] . "'"; + WHERE locstock.stockid = '" . $CreditLine['stockid'] . "' + AND loccode = '" . $CreditLine['loccode'] . "'"; $ErrMsg = _('SQL to reverse update to the location stock records failed with the error'); @@ -100,7 +101,7 @@ $ErrMsg = _('SQL to delete the stock movement record failed with the message'); $Result = DB_query($SQL, $db,$ErrMsg,$DbgMsg,true); prnMsg(_('Deleted the credit note stock movements').'info'); -echo '<br><br>'; +echo '<br /><br />'; $result = DB_Txn_Commit($db); prnMsg(_('Credit note number') . ' ' . $_GET['CreditNoteNo'] . ' ' . _('has been completely deleted') . '. ' . _('To ensure the integrity of the general ledger transactions must be reposted from the period the credit note was created'),'info'); Modified: trunk/Z_DeleteInvoice.php =================================================================== --- trunk/Z_DeleteInvoice.php 2011-04-08 23:37:01 UTC (rev 4542) +++ trunk/Z_DeleteInvoice.php 2011-04-09 06:12:05 UTC (rev 4543) @@ -4,9 +4,12 @@ /* Script to delete an invoice expects and invoice number to delete not included on any menu for obvious reasons +* +* STRONGLY RECOMMEND NOT USING THIS -CREDIT THE INVOICE AND RE INVOICE +* * +* This page must be called directly using path/Z_DeleteInvoice.php?InvoiceNo=????? !! */ -//$PageSecurity=15; include ('includes/session.inc'); $title = _('Delete Invoice'); @@ -19,9 +22,10 @@ } /*Get the order number that was invoiced */ -$SQL = 'SELECT order_ - FROM debtortrans - WHERE debtortrans.type = 10 and transno = ' . $_GET['InvoiceNo']; +$SQL = "SELECT order_ + FROM debtortrans + WHERE debtortrans.type = 10 + AND transno = '" . $_GET['InvoiceNo'] . "'"; $Result = DB_query($SQL,$db); $myrow = DB_fetch_row($Result); @@ -40,7 +44,7 @@ // mbflag // We now use fully qualified column names -$SQL = 'SELECT stockmoves.stockid, +$SQL = "SELECT stockmoves.stockid, stockmoves.loccode, stockmoves.debtorno, stockmoves.branchcode, @@ -49,7 +53,7 @@ stockmaster.mbflag FROM stockmoves INNER JOIN stockmaster ON stockmoves.stockid = stockmaster.stockid - WHERE transno =' .$_GET['InvoiceNo'] . ' AND type=10'; + WHERE transno ='" .$_GET['InvoiceNo'] . "' AND type=10"; $Result = DB_query($SQL,$db); @@ -77,9 +81,9 @@ /*Now delete the DebtorTrans */ -$SQL = 'DELETE FROM debtortrans - WHERE transno =' . $_GET['InvoiceNo'] . ' - AND debtortrans.type=10'; +$SQL = "DELETE FROM debtortrans + WHERE transno ='" . $_GET['InvoiceNo'] . "' + AND debtortrans.type=10"; $DbgMsg = _('The SQL that failed was'); $ErrMsg = _('The debtorTrans record could not be deleted') . ' - ' . _('the sql server returned the following error'); $Result = DB_query($SQL,$db,$ErrMsg,$DbgMsg,true); Modified: trunk/Z_ImportFixedAssets.php =================================================================== --- trunk/Z_ImportFixedAssets.php 2011-04-08 23:37:01 UTC (rev 4542) +++ trunk/Z_ImportFixedAssets.php 2011-04-09 06:12:05 UTC (rev 4543) @@ -2,7 +2,6 @@ /* $Id: $*/ /* Script to import fixed assets into a specified period*/ -//$PageSecurity = 15; include('includes/session.inc'); $title = _('Import Fixed Assets'); include('includes/header.inc'); @@ -122,57 +121,57 @@ if (strlen($Description)==0 OR strlen($Description)>50){ prnMsg('The description of the asset is expected to be more than 3 characters long and less than 50 characters long','error'); - echo '<br>' . _('Row:') . $Row . ' - ' . _('Invalid Description:') . ' ' . $Description; + echo '<br />' . _('Row:') . $Row . ' - ' . _('Invalid Description:') . ' ' . $Description; $InputError=true; } if (!is_numeric($DepnRate)){ prnMsg(_('The depreciation rate is expected to be numeric'),'error'); - echo '<br>' . _('Row:') . $Row . ' - ' . _('Invalid Depreciation Rate:') . ' ' . $DepnRate; + echo '<br />' . _('Row:') . $Row . ' - ' . _('Invalid Depreciation Rate:') . ' ' . $DepnRate; $InputError=true; }elseif ($DepnRate<0 OR $DepnRate>100){ prnMsg(_('The depreciation rate is expected to be a number between 0 and 100'),'error'); - echo '<br>' . _('Row:') . $Row . ' - ' ._('Invalid Depreciation Rate:') . ' ' . $DepnRate; + echo '<br />' . _('Row:') . $Row . ' - ' ._('Invalid Depreciation Rate:') . ' ' . $DepnRate; $InputError=true; } if (!is_numeric($AccumDepn)){ prnMsg(_('The accumulated depreciation is expected to be numeric'),'error'); - echo '<br>' . _('Row:') . $Row . ' - ' . _('Invalid Accumulated Depreciation:') . ' ' . $AccumDepn; + echo '<br />' . _('Row:') . $Row . ' - ' . _('Invalid Accumulated Depreciation:') . ' ' . $AccumDepn; $InputError=true; } elseif ($AccumDepn<0){ prnMsg(_('The accumulated depreciation is expected to be either zero or a positive number'),'error'); - echo '<br>' . _('Row:') . $Row . ' - ' . _('Invalid Accumulated Depreciation:') . ' ' . $AccumDepn; + echo '<br />' . _('Row:') . $Row . ' - ' . _('Invalid Accumulated Depreciation:') . ' ' . $AccumDepn; $InputError=true; } if (!is_numeric($Cost)){ prnMsg(_('The cost is expected to be numeric'),'error'); - echo '<br>' . _('Row:') . $Row . ' - ' . _('Invalid Cost:') . ' ' . $Cost; + echo '<br />' . _('Row:') . $Row . ' - ' . _('Invalid Cost:') . ' ' . $Cost; $InputError=true; } elseif ($Cost<=0){ prnMsg(_('The cost is expected to be a positive number'),'error'); - echo '<br>' . _('Row:') . $Row . ' - ' . _('Invalid Cost:') . ' ' . $AccumDepn; + echo '<br />' . _('Row:') . $Row . ' - ' . _('Invalid Cost:') . ' ' . $AccumDepn; $InputError=true; } if ($DepnType !='SL' AND $DepnType!='DV'){ prnMsg(_('The depreciation type must be either "SL" - Straight Line or "DV" - Diminishing Value'),'error'); - echo '<br>' . _('Row:') . $Row . ' - ' . _('Invalid depreciation type:') . ' ' . $DepnType; + echo '<br />' . _('Row:') . $Row . ' - ' . _('Invalid depreciation type:') . ' ' . $DepnType; $InputError = true; } - $result = DB_query('SELECT categoryid FROM fixedassetcategories WHERE categoryid="' . $AssetCategoryID . '"', $db); + $result = DB_query("SELECT categoryid FROM fixedassetcategories WHERE categoryid='" . $AssetCategoryID . "'", $db); if (DB_num_rows($result)==0){ $InputError = true; prnMsg(_('The asset category code entered must be exist in the assetcategories table'),'error'); - echo '<br>' . _('Row:') . $Row . ' - ' . _('Invalid asset category:') . ' ' . $AssetCategoryID; + echo '<br />' . _('Row:') . $Row . ' - ' . _('Invalid asset category:') . ' ' . $AssetCategoryID; } - $result = DB_query('SELECT locationid FROM fixedassetlocations WHERE locationid="' . $AssetLocationCode . '"', $db); + $result = DB_query("SELECT locationid FROM fixedassetlocations WHERE locationid='" . $AssetLocationCode . "'", $db); if (DB_num_rows($result)==0){ $InputError = true; prnMsg(_('The asset location code entered must be exist in the asset locations table'),'error'); - echo '<br>' . _('Row:') . $Row . ' - ' . _('Invalid asset location code:') . ' ' . $AssetLocationCode; + echo '<br />' . _('Row:') . $Row . ' - ' . _('Invalid asset location code:') . ' ' . $AssetLocationCode; } if (!Is_Date($DatePurchased)){ $InputError = true; prnMsg(_('The date purchased must be entered in the format:') . ' ' . $_SESSION['DefaultDateFormat'],'error'); - echo '<br>' . _('Row:') . $Row . ' - ' . _('Invalid date format:') . ' ' . $DatePurchased; + echo '<br />' . _('Row:') . $Row . ' - ' . _('Invalid date format:') . ' ' . $DatePurchased; } if ($DepnType=='DV'){ $DepnType=1; @@ -187,27 +186,27 @@ //attempt to insert the stock item $sql = "INSERT INTO fixedassets (description, - longdescription, - assetcategoryid, - serialno, - barcode, - assetlocation, - cost, - accumdepn, - depntype, - depnrate, - datepurchased) - VALUES ('" . $Description . "', - '" . $LongDescription . "', - '" . $AssetCategoryID . "', - '" . $SerialNo . "', - '" . $BarCode . "', - '" . $AssetLocationCode . "', - '" . $Cost . "', - '" . $AccumDepn . "', - '" . $DepnType . "', - '" . $DepnRate . "', - '" . FormatDateForSQL($DatePurchased) . "')"; + longdescription, + assetcategoryid, + serialno, + barcode, + assetlocation, + cost, + accumdepn, + depntype, + depnrate, + datepurchased) + VALUES ('" . $Description . "', + '" . $LongDescription . "', + '" . $AssetCategoryID . "', + '" . $SerialNo . "', + '" . $BarCode . "', + '" . $AssetLocationCode . "', + '" . $Cost . "', + '" . $AccumDepn . "', + '" . $DepnType . "', + '" . $DepnRate . "', + '" . FormatDateForSQL($DatePurchased) . "')"; $ErrMsg = _('The asset could not be added because'); $DbgMsg = _('The SQL that was used to add the asset and failed was'); @@ -218,43 +217,43 @@ $AssetID = DB_Last_Insert_ID($db, 'fixedassets','assetid'); $sql = "INSERT INTO fixedassettrans ( assetid, - transtype, - transno, - transdate, - periodno, - inputdate, - fixedassettranstype, - amount) - VALUES ( '" . $AssetID . "', - '49', - '" . $TransNo . "', - '" . $_POST['DateToEnter'] . "', - '" . $PeriodNo . "', - '" . Date('Y-m-d') . "', - 'cost', - '" . $Cost . "')"; + transtype, + transno, + transdate, + periodno, + inputdate, + fixedassettranstype, + amount) + VALUES ( '" . $AssetID . "', + '49', + '" . $TransNo . "', + '" . $_POST['DateToEnter'] . "', + '" . $PeriodNo . "', + '" . Date('Y-m-d') . "', + 'cost', + '" . $Cost . "')"; $ErrMsg = _('The transaction for the cost of the asset could not be added because'); $DbgMsg = _('The SQL that was used to add the fixedasset trans record that failed was'); $InsResult = DB_query($sql,$db,$ErrMsg,$DbgMsg); $sql = "INSERT INTO fixedassettrans ( assetid, - transtype, - transno, - transdate, - periodno, - inputdate, - fixedassettranstype, - amount) - VALUES ( '" . $AssetID . "', - '49', - '" . $TransNo . "', - '" . $_POST['DateToEnter'] . "', - '" . $PeriodNo . "', - '" . Date('Y-m-d') . "', - 'depn', - '" . $AccumDepn . "')"; - + transtype, + transno, + transdate, + periodno, + inputdate, + fixedassettranstype, + amount) + VALUES ( '" . $AssetID . "', + '49', + '" . $TransNo . "', + '" . $_POST['DateToEnter'] . "', + '" . $PeriodNo . "', + '" . Date('Y-m-d') . "', + 'depn', + '" . $AccumDepn . "')"; + $ErrMsg = _('The transaction for the cost of the asset could not be added because'); $DbgMsg = _('The SQL that was used to add the fixedasset trans record that failed was'); $InsResult = DB_query($sql,$db,$ErrMsg,$DbgMsg); @@ -285,7 +284,7 @@ echo ' <br /> - <a href="Z_ImportFixedAssets.php?gettemplate=1">Get Import Template</a> + <a href="Z_ImportFixedAssets.php?gettemplate=1">' . _('Get Import Template') . '</a> <br /> <br /> '; @@ -296,17 +295,16 @@ echo '<table class="selection"> <tr><td>' . _('Select Date to Upload B/Fwd Assets To:') . '</td> <td><select name="DateToEnter">'; - $PeriodsResult = DB_query('SELECT lastdate_in_period FROM periods ORDER BY periodno',$db); + $PeriodsResult = DB_query("SELECT lastdate_in_period FROM periods ORDER BY periodno",$db); while ($PeriodRow = DB_fetch_row($PeriodsResult)){ echo '<option value="' . $PeriodRow[0] . '">' . ConvertSQLDate($PeriodRow[0]) . '</option>'; } echo '</select></td></tr>'; echo '<tr><td>' . _('Fixed Assets Upload file:') . '</td><td><input name="SelectedAssetFile" type="file"></tr></table> - <input type="submit" VALUE="' . _('Send File') . '"> + <input type="submit" value="' . _('Send File') . '"> </form>'; } - include('includes/footer.inc'); ?> \ No newline at end of file Modified: trunk/Z_ImportGLAccountGroups.php =================================================================== --- trunk/Z_ImportGLAccountGroups.php 2011-04-08 23:37:01 UTC (rev 4542) +++ trunk/Z_ImportGLAccountGroups.php 2011-04-09 06:12:05 UTC (rev 4543) @@ -1,8 +1,6 @@ <?php /* $Id$*/ -//$PageSecurity = 11; - include('includes/session.inc'); $title = _('Import Chart of Accounts'); include('includes/header.inc'); @@ -10,7 +8,7 @@ include('api/api_errorcodes.php'); $weberpuser = $_SESSION['UserID']; -$sql='SELECT password FROM www_users WHERE userid="'.$weberpuser.'"'; +$sql="SELECT password FROM www_users WHERE userid='" . $weberpuser . "'"; $result=DB_query($sql, $db); $myrow=DB_fetch_array($result); $weberppassword = $myrow[0]; Modified: trunk/Z_ImportGLAccountSections.php =================================================================== --- trunk/Z_ImportGLAccountSections.php 2011-04-08 23:37:01 UTC (rev 4542) +++ trunk/Z_ImportGLAccountSections.php 2011-04-09 06:12:05 UTC (rev 4543) @@ -1,21 +1,19 @@ <?php /* $Id$*/ -//$PageSecurity = 11; - include('includes/session.inc'); $title = _('Import Chart of Accounts'); include('includes/header.inc'); include('xmlrpc/lib/xmlrpc.inc'); include('api/api_errorcodes.php'); -$weberpuser = $_SESSION['UserID']; -$sql='SELECT password FROM www_users WHERE userid="'.$weberpuser.'"'; +$webERPUser = $_SESSION['UserID']; +$sql="SELECT password FROM www_users WHERE userid='" . $webERPUser ."'"; $result=DB_query($sql, $db); $myrow=DB_fetch_array($result); $weberppassword = $myrow[0]; -$ServerURL = "http://". $_SERVER['HTTP_HOST'].$rootpath."/api/api_xml-rpc.php"; +$ServerURL = 'http://'. $_SERVER['HTTP_HOST'] . $rootpath . '/api/api_xml-rpc.php'; $DebugLevel = 0; //Set to 0,1, or 2 with 2 being the highest level of debug info @@ -25,7 +23,11 @@ $FieldNames = explode(',', $buffer); $SuccessStyle='style="color:green; font-weight:bold"'; $FailureStyle='style="color:red; font-weight:bold"'; - echo '<table><tr><th>'. _('Account Section') .'</th><th>'. _('Result') . '</th><th>'. _('Comments') .'</th></tr>'; + echo '<table> + <tr><th>'. _('Account Section') .'</th> + <th>'. _('Result') . '</th> + <th>'. _('Comments') .'</th> + </tr>'; $successes=0; $failures=0; while (!feof ($fp)) { @@ -36,7 +38,7 @@ $AccountSectionDetails[$FieldNames[$i]]=$FieldValues[$i]; } $accountsection = php_xmlrpc_encode($AccountSectionDetails); - $user = new xmlrpcval($weberpuser); + $user = new xmlrpcval($webERPUser); $password = new xmlrpcval($weberppassword); $msg = new xmlrpcmsg("weberp.xmlrpc_InsertGLAccountSection", array($accountsection, $user, $password)); @@ -75,7 +77,5 @@ echo '<div class= "centre"><input type="submit" name="update" value="Process"></div>'; echo '</form>'; } - include('includes/footer.inc'); - ?> \ No newline at end of file Modified: trunk/Z_ImportPartCodes.php =================================================================== --- trunk/Z_ImportPartCodes.php 2011-04-08 23:37:01 UTC (rev 4542) +++ trunk/Z_ImportPartCodes.php 2011-04-09 06:12:05 UTC (rev 4543) @@ -1,7 +1,6 @@ <?php /* $Id$*/ -//$PageSecurity = 11; include('includes/session.inc'); $title = _('Import Stock Items'); @@ -9,13 +8,13 @@ include('xmlrpc/lib/xmlrpc.inc'); include('api/api_errorcodes.php'); -$weberpuser = $_SESSION['UserID']; -$sql='SELECT password FROM www_users WHERE userid="'.$weberpuser.'"'; +$webERPUser = $_SESSION['UserID']; +$sql="SELECT password FROM www_users WHERE userid='" . $webERPUser."'"; $result=DB_query($sql, $db); $myrow=DB_fetch_array($result); $weberppassword = $myrow[0]; -$ServerURL = "http://". $_SERVER['HTTP_HOST'].$rootpath."/api/api_xml-rpc.php"; +$ServerURL = 'http://'. $_SERVER['HTTP_HOST'] . $rootpath . '/api/api_xml-rpc.php'; $DebugLevel = 0; //Set to 0,1, or 2 with 2 being the highest level of debug info @@ -25,7 +24,12 @@ $FieldNames = explode(',', $buffer); $SuccessStyle='style="color:green; font-weight:bold"'; $FailureStyle='style="color:red; font-weight:bold"'; - echo '<table><tr><th>'. _('Part Code') .'</th><th>'. _('Result') . '</th><th>'. _('Comments') .'</th></tr>'; + echo '<table> + <tr> + <th>'. _('Part Code') .'</th> + <th>'. _('Result') . '</th> + <th>'. _('Comments') .'</th> + </tr>'; $successes=0; $failures=0; while (!feof ($fp)) { @@ -36,7 +40,7 @@ $ItemDetails[$FieldNames[$i]]=$FieldValues[$i]; } $stockitem = php_xmlrpc_encode($ItemDetails); - $user = new xmlrpcval($weberpuser); + $user = new xmlrpcval($webERPUser); $password = new xmlrpcval($weberppassword); $msg = new xmlrpcmsg("weberp.xmlrpc_InsertStockItem", array($stockitem, $user, $password)); @@ -65,7 +69,7 @@ echo '</table>'; fclose ($fp); } else { - $sql = 'select * from locations'; + $sql = "select * from locations"; $result = DB_query($sql,$db); if (DB_num_rows($result)==0) { prnMsg( _('No locations have been set up. At least one location should be set up first'), "error"); Modified: trunk/Z_MakeStockLocns.php =================================================================== --- trunk/Z_MakeStockLocns.php 2011-04-08 23:37:01 UTC (rev 4542) +++ trunk/Z_MakeStockLocns.php 2011-04-09 06:12:05 UTC (rev 4543) @@ -2,30 +2,25 @@ /* $Id$*/ /* Script to make stock locations for all parts that do not have stock location records set up*/ - -//$PageSecurity=15; include ('includes/session.inc'); $title = _('Make LocStock Records'); include('includes/header.inc'); +echo '<br /><br />' . _('This script makes stock location records for parts where they do not already exist'); -echo '<br><br>' . _('This script makes stock location records for parts where they do not already exist'); - -$sql = 'INSERT INTO locstock (stockid, loccode) +$sql = "INSERT INTO locstock (stockid, loccode) SELECT stockmaster.stockid, locations.loccode FROM stockmaster CROSS JOIN locations LEFT JOIN locstock ON stockmaster.stockid = locstock.stockid AND locations.loccode = locstock.loccode - WHERE locstock.stockid IS NULL'; + WHERE locstock.stockid IS NULL"; $ErrMsg = _('The items/locations that need stock location records created cannot be retrieved because'); $Result = DB_query($sql,$db,$ErrMsg); - - -echo '<p>'; +echo '<p />'; prnMsg(_('Any stock items that may not have had stock location records have now been given new location stock records'),'info'); include('includes/footer.inc'); Modified: trunk/Z_PriceChanges.php =================================================================== --- trunk/Z_PriceChanges.php 2011-04-08 23:37:01 UTC (rev 4542) +++ trunk/Z_PriceChanges.php 2011-04-09 06:12:05 UTC (rev 4543) @@ -1,43 +1,41 @@ <?php /* $Id$*/ -//$PageSecurity=15; - include('includes/session.inc'); $title=_('Update Pricing'); include('includes/header.inc'); -echo '<br>' . _('This page updates already existing prices for a specified sales type (price list)') . '. ' . _('Choose between updating only customer special prices where the customer is set up under the price list selected, or all prices under the sales type or just specific prices for a customer for the stock category selected'); +echo '<br />' . _('This page updates already existing prices for a specified sales type (price list)') . '. ' . _('Choose between updating only customer special prices where the customer is set up under the price list selected, or all prices under the sales type or just specific prices for a customer for the stock category selected'); prnMsg (_('This script takes no account of start and end dates of prices and updates all historical prices as well as current prices - better to use new scripts under Inventory -> Maintenance'),'warn'); -echo "<form method='POST' action='" . $_SERVER['PHP_SELF'] . '?' . SID . "'>"; +echo '<form method="POST" action="' . $_SERVER['PHP_SELF'] . '">'; echo '<input type="hidden" name="FormID" value="' . $_SESSION['FormID'] . '" />'; -$SQL = 'SELECT sales_type, typeabbrev FROM salestypes'; +$SQL = "SELECT sales_type, typeabbrev FROM salestypes"; $result = DB_query($SQL,$db); echo '<p><table> <tr> - <td>' . _('Select the Price List to update the costs for') .":</td> - <td><select name='PriceList'>"; + <td>' . _('Select the Price List to update the costs for') .':</td> + <td><select name="PriceList">'; if (!isset($_POST['PriceList'])){ - echo '<option selected VALUE=0>' . _('No Price List Selected'); + echo '<option selected value=0>' . _('No Price List Selected') . '</option>'; } while ($PriceLists=DB_fetch_array($result)){ - echo "<option VALUE='" . $PriceLists['typeabbrev'] . "'>" . $PriceLists['sales_type']; + echo '<option value="' . $PriceLists['typeabbrev'] . '">' . $PriceLists['sales_type'] . '</option>'; } echo '</select></td></tr>'; -echo '<tr><td>' . _('Category') . ":</td> - <td><select name='StkCat'>"; +echo '<tr><td>' . _('Category') . ':</td> + <td><select name="StkCat">'; -$sql = 'SELECT categoryid, categorydescription FROM stockcategory'; +$sql = "SELECT categoryid, categorydescription FROM stockcategory"; $ErrMsg = _('The stock categories could not be retrieved because'); $DbgMsg = _('The SQL used to retrieve stock categories and failed was'); @@ -45,19 +43,19 @@ while ($myrow=DB_fetch_array($result)){ if ($myrow['categoryid']==$_POST['StkCat']){ - echo "<option selected VALUE='". $myrow['categoryid'] . "'>" . $myrow['categorydescription']; + echo '<option selected value="'. $myrow['categoryid'] . '">' . $myrow['categorydescription'] . '</option>'; } else { - echo "<option VALUE='". $myrow['categoryid'] . "'>" . $myrow['categorydescription']; + echo '<option value="'. $myrow['categoryid'] . '">' . $myrow['categorydescription'] . '</option>'; } } echo '</select></td></tr>'; echo '<tr><td>' . _('Which Prices to update') . ":</td> <td><select name='WhichPrices'>"; - echo "<option VALUE='Only Non-customer special prices'>" . _('Only Non-customer special prices'); - echo "<option VALUE='Only customer special prices'>" . _('Only customer special prices'); - echo "<option VALUE='Both customer special prices and non-customer special prices'>" . _('Both customer special prices and non-customer special prices'); - echo "<option VALUE='Selected customer special prices only'>" . $_SESSION['CustomerID'] . ' ' . _('customer special prices only'); + echo "<option value='Only Non-customer special prices'>" . _('Only Non-customer special prices') . '</option>'; + echo "<option value='Only customer special prices'>" . _('Only customer special prices') . '</option>'; + echo "<option value='Both customer special prices and non-customer special prices'>" . _('Both customer special prices and non-customer special prices') . '</option>'; + echo "<option value='Selected customer special prices only'>" . $_SESSION['CustomerID'] . ' ' . _('customer special prices only') . '</option>'; echo '</select></td></tr>'; if (!isset($_POST['IncreasePercent'])){ @@ -65,28 +63,28 @@ } echo '<tr><td>' . _('Percentage Increase (positive) or decrease (negative)') . "</td> - <td><input name='IncreasePercent' size=4 maxlength=4 VALUE=" . $_POST['IncreasePercent'] . "></td></tr></table>"; + <td><input name='IncreasePercent' size=4 maxlength=4 value=" . $_POST['IncreasePercent'] . "></td></tr></table>"; -echo "<div class='centre'><p><input type=submit name='UpdatePrices' VALUE='" . _('Update Prices') . '\' onclick="return confirm(\'' . _('Are you sure you wish to update all the prices according to the criteria selected?') . '\');"></div>'; +echo "<div class='centre'><p><input type=submit name='UpdatePrices' value='" . _('Update Prices') . '\' onclick="return confirm(\'' . _('Are you sure you wish to update all the prices according to the criteria selected?') . '\');"></div>'; echo '</form>'; if (isset($_POST['UpdatePrices']) AND isset($_POST['StkCat'])){ - echo '<br>' . _('So we are using a price list/sales type of') .' : ' . $_POST['PriceList']; - echo '<br>' . _('and a stock category code of') . ' : ' . $_POST['StkCat']; - echo '<br>' . _('and a increase percent of') . ' : ' . $_POST['IncreasePercent']; + echo '<br />' . _('So we are using a price list/sales type of') .' : ' . $_POST['PriceList']; + echo '<br />' . _('and a stock category code of') . ' : ' . $_POST['StkCat']; + echo '<br />' . _('and a increase percent of') . ' : ' . $_POST['IncreasePercent']; if ($_POST['PriceList']=='0'){ - echo '<br>' . _('The price list/sales type to be updated must be selected first'); + echo '<br />' . _('The price list/sales type to be updated must be selected first'); include ('includes/footer.inc'); exit; } if (ABS($_POST['IncreasePercent']) < 0.5 OR ABS($_POST['IncreasePercent'])>40 OR !is_numeric($_POST['IncreasePercent'])){ - echo '<br>' . _('The increase or decrease to be applied is expected to be an integer between 1 and 40 it is not necessary to enter the').' '. '%'.' '. _('sign') . ' - ' . _('the amount is assumed to be a percentage'); + echo '<br />' . _('The increase or decrease to be applied is expected to be an integer between 1 and 40 it is not necessary to enter the').' '. '%'.' '. _('sign') . ' - ' . _('the amount is assumed to be a percentage'); include ('includes/footer.inc'); exit; } @@ -102,7 +100,7 @@ if ($_POST['WhichPrices'] == 'Only Non-customer special prices'){ - $sql = 'UPDATE prices SET price=price*(1+' . $IncrementPercentage . ") + $sql = "UPDATE prices SET price=price*(1+" . $IncrementPercentage . ") WHERE typeabbrev='" . $_POST['PriceList'] . "' AND stockid='" . $myrow['stockid'] . "' AND typeabbrev='" . $_POST['PriceList'] . "' @@ -125,7 +123,7 @@ } else if ($_POST['WhichPrices'] == 'Selected customer special prices only'){ - $sql = 'UPDATE prices SET price=price*(1+' . $IncrementPercentage . ") + $sql = "UPDATE prices SET price=price*(1+" . $IncrementPercentage . ") WHERE typeabbrev='" . $_POST['PriceList'] . "' AND stockid='" . $myrow['stockid'] . "' AND typeabbrev='" . $_POST['PriceList'] . "' Modified: trunk/Z_ReApplyCostToSA.php =================================================================== --- trunk/Z_ReApplyCostToSA.php 2011-04-08 23:37:01 UTC (rev 4542) +++ trunk/Z_ReApplyCostToSA.php 2011-04-09 06:12:05 UTC (rev 4543) @@ -2,8 +2,6 @@ /* $Id$*/ -//$PageSecurity=15; - include('includes/session.inc'); $title=_('Apply Current Cost to Sales Analysis'); include('includes/header.inc'); @@ -13,33 +11,33 @@ echo "<form method='POST' action='" . $_SERVER['PHP_SELF'] . '?' . SID . "'>"; echo '<input type="hidden" name="FormID" value="' . $_SESSION['FormID'] . '" />'; -$SQL = 'SELECT MonthName(lastdate_in_period) AS mnth, +$SQL = "SELECT MonthName(lastdate_in_period) AS mnth, YEAR(lastdate_in_period) AS yr, periodno - FROM periods'; -echo '<p><div class="centre">' . _('Select the Period to update the costs for') . ":<select name='PeriodNo'>"; + FROM periods"; +echo '<p><div class="centre">' . _('Select the Period to update the costs for') . ':<select name="PeriodNo">'; $result = DB_query($SQL,$db); -echo '<option selected VALUE=0>' . _('No Period Selected'); +echo '<option selected value=0>' . _('No Period Selected') . '</option>'; while ($PeriodInfo=DB_fetch_array($result)){ - echo '<option VALUE=' . $PeriodInfo['periodno'] . '>' . $PeriodInfo['mnth'] . ' ' . $PeriodInfo['Yr']; + echo '<option value=' . $PeriodInfo['periodno'] . '>' . $PeriodInfo['mnth'] . ' ' . $PeriodInfo['Yr'] . '</option>'; } echo '</select>'; -echo "<p><input type=submit name='UpdateSalesAnalysis' VALUE='" . _('Update Sales Analysis Costs') ."'></div>"; +echo '<p><input type=submit name="UpdateSalesAnalysis" value="' . _('Update Sales Analysis Costs') .'"></div>'; echo '</form>'; if (isset($_POST['UpdateSalesAnalysis']) AND $_POST['PeriodNo']!=0){ - $sql = 'SELECT stockmaster.stockid, + $sql = "SELECT stockmaster.stockid, materialcost+overheadcost+labourcost AS standardcost, stockmaster.mbflag FROM salesanalysis INNER JOIN stockmaster ON salesanalysis.stockid=stockmaster.stockid - WHERE periodno=' . $_POST['PeriodNo'] . " + WHERE periodno='" . $_POST['PeriodNo'] . "' AND stockmaster.mbflag<>'D' GROUP BY stockmaster.stockid, stockmaster.materialcost, Modified: trunk/Z_RePostGLFromPeriod.php =================================================================== --- trunk/Z_RePostGLFromPeriod.php 2011-04-08 23:37:01 UTC (rev 4542) +++ trunk/Z_RePostGLFromPeriod.php 2011-04-09 06:12:05 UTC (rev 4543) @@ -2,13 +2,11 @@ /* $Id$*/ -//$PageSecurity=15; - include ('includes/session.inc'); $title = _('Recalculation of GL Balances in Chart Details Table'); include('includes/header.inc'); -echo '<form method="POST" action="' . $_SERVER['PHP_SELF'] . '?' . SID . '">'; +echo '<form method="POST" action="' . $_SERVER['PHP_SELF'] . '">'; echo '<input type="hidden" name="FormID" value="' . $_SESSION['FormID'] . '" />'; if (!isset($_POST['FromPeriod'])){ @@ -16,39 +14,37 @@ /*Show a form to allow input of criteria for TB to show */ echo '<table> <tr> - <td>' . _('Select Period From') . ":</td> - <td><select Name='FromPeriod'>"; + <td>' . _('Select Period From') . ':</td> + <td><select Name="FromPeriod">'; - $sql = 'SELECT periodno, + $sql = "SELECT periodno, lastdate_in_period - FROM periods ORDER BY periodno'; + FROM periods ORDER BY periodno"; $Periods = DB_query($sql,$db); while ($myrow=DB_fetch_array($Periods,$db)){ - echo '<option VALUE=' . $myrow['periodno'] . '>' . MonthAndYearFromSQLDate($myrow['lastdate_in_period']); + echo '<option VALUE=' . $myrow['periodno'] . '>' . MonthAndYearFromSQLDate($myrow['lastdate_in_period']) . '</option>'; } echo '</select></td> </tr> </table>'; - echo "<div class='centre'><input type=submit Name='recalc' Value='" . _('Do the Recalculation') . "' - onclick=\"return confirm('" . _('Are you sure you wish to re-post all general ledger transactions since the selected period - .... this can take some time?') . '\');"></div></form>'; + echo "<div class='centre'><input type=submit Name='recalc' value='" . _('Do the Recalculation') . "' onclick=\"return confirm('" . _('Are you sure you wish to re-post all general ledger transactions since the selected period this can take some time?') . '\');"></div></form>'; } else { /*OK do the updates */ /* Make the posted flag on all GL entries including and after the period selected = 0 */ - $sql = 'UPDATE gltrans SET posted=0 WHERE periodno >='. $_POST['FromPeriod']; + $sql = "UPDATE gltrans SET posted=0 WHERE periodno >='" . $_POST['FromPeriod'] . "'"; $UpdGLTransPostedFlag = DB_query($sql,$db); /* Now make all the actuals 0 for all periods including and after the period from */ - $sql = 'UPDATE chartdetails SET actual =0 WHERE period >= ' . $_POST['FromPeriod']; + $sql = "UPDATE chartdetails SET actual =0 WHERE period >= '" . $_POST['FromPeriod'] . "'"; $UpdActualChartDetails = DB_query($sql,$db); - $ChartDetailBFwdResult = DB_query('SELECT accountcode, bfwd FROM chartdetails WHERE period=' . $_POST['FromPeriod'],$db); + $ChartDetailBFwdResult = DB_query("SELECT accountcode, bfwd FROM chartdetails WHERE period='" . $_POST['FromPeriod'] . "'",$db); while ($ChartRow=DB_fetch_array($ChartDetailBFwdResult)){ - $sql = 'UPDATE chartdetails SET bfwd =' . $ChartRow['bfwd'] . ' WHERE period > ' . $_POST['FromPeriod'] . ' AND accountcode=' . $ChartRow['accountcode']; + $sql = "UPDATE chartdetails SET bfwd ='" . $ChartRow['bfwd'] . "' WHERE period > '" . $_POST['FromPeriod'] . "' AND accountcode='" . $ChartRow['accountcode'] . "'"; $UpdActualChartDetails = DB_query($sql,$db); } Modified: trunk/Z_ReverseSuppPaymentRun.php =================================================================== --- trunk/Z_ReverseSuppPaymentRun.php 2011-04-08 23:37:01 UTC (rev 4542) +++ trunk/Z_ReverseSuppPaymentRun.php 2011-04-09 06:12:05 UTC (rev 4543) @@ -4,7 +4,7 @@ /* Script to delete all supplier payments entered or created from a payment run on a specified day */ -//$PageSecurity=15; + include ('includes/session.inc'); $title = _('Reverse and Delete Supplier Payments'); include('includes/header.inc'); @@ -83,10 +83,10 @@ } -echo "<form method=post action='" . $_SERVER['PHP_SELF'] . '?' . SID . "'>"; - echo '<input type="hidden" name="FormID" value="' . $_SESSION['FormID'] . '" />'; +echo '<form method="post" action="' . $_SERVER['PHP_SELF'] . '">'; +echo '<input type="hidden" name="FormID" value="' . $_SESSION['FormID'] . '" />'; echo '<br>' . _('Enter the date of the payment run') . ": <input type=text name='PaytDate' maxlength=11 size=11 value='" . $_POST['PaytDate'] . "'>"; -echo "<input type=submit name='RevPayts' value='" . _('Reverse Supplier Payments on the Date Entered') . "'>"; +echo '<input type="submit" name="RevPayts" value="' . _('Reverse Supplier Payments on the Date Entered') . '">'; echo '</form>'; include('includes/footer.inc'); Modified: trunk/Z_SalesIntegrityCheck... [truncated message content] |
From: <dai...@us...> - 2011-04-09 06:12:13
|
Revision: 4543 http://web-erp.svn.sourceforge.net/web-erp/?rev=4543&view=rev Author: daintree Date: 2011-04-09 06:12:05 +0000 (Sat, 09 Apr 2011) Log Message: ----------- SQL and xhtml quoting Modified Paths: -------------- trunk/ShipmentCosting.php trunk/Z_CreateCompanyTemplateFile.php trunk/Z_CurrencyDebtorsBalances.php trunk/Z_CurrencySuppliersBalances.php trunk/Z_DataExport.php trunk/Z_DeleteCreditNote.php trunk/Z_DeleteInvoice.php trunk/Z_ImportFixedAssets.php trunk/Z_ImportGLAccountGroups.php trunk/Z_ImportGLAccountSections.php trunk/Z_ImportPartCodes.php trunk/Z_MakeStockLocns.php trunk/Z_PriceChanges.php trunk/Z_ReApplyCostToSA.php trunk/Z_RePostGLFromPeriod.php trunk/Z_ReverseSuppPaymentRun.php trunk/Z_SalesIntegrityCheck.php trunk/Z_UpdateChartDetailsBFwd.php trunk/api/api_debtortransactions.php trunk/api/api_glgroups.php trunk/api/api_glsections.php trunk/api/api_locations.php trunk/api/api_login.php trunk/api/api_purchdata.php trunk/api/api_salestypes.php trunk/api/api_stockcategories.php trunk/includes/SQL_CommonFunctions.inc Modified: trunk/ShipmentCosting.php =================================================================== --- trunk/ShipmentCosting.php 2011-04-08 23:37:01 UTC (rev 4542) +++ trunk/ShipmentCosting.php 2011-04-09 06:12:05 UTC (rev 4543) @@ -321,8 +321,9 @@ 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'] . "'"; + $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, @@ -385,7 +386,7 @@ 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); Modified: trunk/Z_CreateCompanyTemplateFile.php =================================================================== --- trunk/Z_CreateCompanyTemplateFile.php 2011-04-08 23:37:01 UTC (rev 4542) +++ trunk/Z_CreateCompanyTemplateFile.php 2011-04-09 06:12:05 UTC (rev 4543) @@ -1,8 +1,6 @@ <?php /* $Id$*/ -//$PageSecurity =15; - include ('includes/session.inc'); $title = _('Create Database Template File'); include ('includes/header.inc'); @@ -15,20 +13,20 @@ } if ($InputError==false){ - $CurrResult = DB_query( 'SELECT currabrev, - currency, - country, - debtorsact, - creditorsact, - payrollact, - grnact, - exchangediffact, - purchasesexchangediffact, - retainedearnings, - freightact - FROM currencies INNER JOIN companies - ON companies.currencydefault=currencies.currabrev - WHERE coycode=1',$db); + $CurrResult = DB_query( "SELECT currabrev, + currency, + country, + debtorsact, + creditorsact, + payrollact, + grnact, + exchangediffact, + purchasesexchangediffact, + retainedearnings, + freightact + FROM currencies INNER JOIN companies + ON companies.currencydefault=currencies.currabrev + WHERE coycode='1'",$db); $CurrRow = DB_fetch_array($CurrResult); @@ -46,7 +44,7 @@ purchasesexchangediffact=" . $CurrRow['purchasesexchangediffact'] . ", retainedearnings=" . $CurrRow['retainedearnings'] . ", freightact=" . $CurrRow['freightact'] . " - WHERE coycode=1;\n"; + WHERE coycode='1';\n"; /*empty out any existing records in chartmaster, @@ -67,12 +65,12 @@ $SQLScript .= "TRUNCATE TABLE taxcategories;\n"; $SQLScript .= "TRUNCATE TABLE taxprovinces;\n"; - $GroupsResult = DB_query('SELECT groupname, - sectioninaccounts, - pandl, - sequenceintb, - parentgroupname - FROM accountgroups',$db); + $GroupsResult = DB_query("SELECT groupname, + sectioninaccounts, + pandl, + sequenceintb, + parentgroupname + FROM accountgroups",$db); while ($GroupRow = DB_fetch_array($GroupsResult)){ $SQLScript .= "INSERT INTO accountgroups (groupname,sectioninaccounts,pandl, sequenceintb, parentgroupname) @@ -83,13 +81,15 @@ '" . $GroupRow['parentgroupname'] . "');\n"; } - $ChartResult = DB_query('SELECT accountcode, accountname, group_ FROM chartmaster',$db); + $ChartResult = DB_query("SELECT accountcode, accountname, group_ FROM chartmaster",$db); $i=0; while ($ChartRow = DB_fetch_array($ChartResult)){ if ($_POST['IncludeAccount_' .$i]=='on'){ $SQLScript .= "INSERT INTO chartmaster (accountcode,accountname,group_) - VALUES (" . $ChartRow['accountcode'] . ", '" . $ChartRow['accountname'] . "', '" . $ChartRow['group_'] . "');\n"; + VALUES ('" . $ChartRow['accountcode'] . "', + '" . $ChartRow['accountname'] . "', + '" . $ChartRow['group_'] . "');\n"; } $i++; } @@ -98,14 +98,14 @@ /*Tax Authorities table */ $TaxAuthoritiesResult = DB_query("SELECT taxid, - description, - taxglcode, - purchtaxglaccount, - bank, - bankacctype, - bankacc, - bankswift - FROM taxauthorities",$db); + description, + taxglcode, + purchtaxglaccount, + bank, + bankacctype, + bankacc, + bankswift + FROM taxauthorities",$db); while ($TaxAuthoritiesRow = DB_fetch_array($TaxAuthoritiesResult)){ $SQLScript .= "INSERT INTO taxauthorities (taxid, @@ -127,11 +127,11 @@ } /*taxauthrates table */ - $TaxAuthRatesResult = DB_query('SELECT taxauthority, - dispatchtaxprovince, - taxcatid, - taxrate - FROM taxauthrates',$db); + $TaxAuthRatesResult = DB_query("SELECT taxauthority, + dispatchtaxprovince, + taxcatid, + taxrate + FROM taxauthrates",$db); while ($TaxAuthRatesRow = DB_fetch_array($TaxAuthRatesResult)){ $SQLScript .= "INSERT INTO taxauthrates (taxauthority, @@ -145,20 +145,20 @@ } /*taxgroups table */ - $TaxGroupsResult = DB_query('SELECT taxgroupid, - taxgroupdescription - FROM taxgroups',$db); + $TaxGroupsResult = DB_query("SELECT taxgroupid, + taxgroupdescription + FROM taxgroups",$db); while ($TaxGroupsRow = DB_fetch_array($TaxGroupsResult)){ $SQLScript .= "INSERT INTO taxgroups (taxgroupid, taxgroupdescription) - VALUES (" . $TaxGroupsRow['taxgroupid'] . ", + VALUES ('" . $TaxGroupsRow['taxgroupid'] . "', '" . $TaxGroupsRow['taxgroupdescription'] . "');\n"; } /*tax categories table */ - $TaxCategoriesResult = DB_query('SELECT taxcatid, - taxcatname - FROM taxcategories',$db); + $TaxCategoriesResult = DB_query("SELECT taxcatid, + taxcatname + FROM taxcategories",$db); while ($TaxCategoriesRow = DB_fetch_array($TaxCategoriesResult)){ $SQLScript .= "INSERT INTO taxcategories (taxcatid, @@ -167,9 +167,9 @@ '" . $TaxCategoriesRow['taxcatname'] . "');\n"; } /*tax provinces table */ - $TaxProvincesResult = DB_query('SELECT taxprovinceid, - taxprovincename - FROM taxprovinces',$db); + $TaxProvincesResult = DB_query("SELECT taxprovinceid, + taxprovincename + FROM taxprovinces",$db); while ($TaxProvincesRow = DB_fetch_array($TaxProvincesResult)){ $SQLScript .= "INSERT INTO taxprovinces (taxprovinceid, @@ -178,11 +178,11 @@ '" . $TaxProvincesRow['taxprovincename'] . "');\n"; } /*taxgroup taxes table */ - $TaxGroupTaxesResult = DB_query('SELECT taxgroupid, - taxauthid, - calculationorder, - taxontax - FROM taxgrouptaxes',$db); + $TaxGroupTaxesResult = DB_query("SELECT taxgroupid, + taxauthid, + calculationorder, + taxontax + FROM taxgrouptaxes",$db); while ($TaxGroupTaxesRow = DB_fetch_array($TaxGroupTaxesResult)){ $SQLScript .= "INSERT INTO taxgrouptaxes (taxgroupid, @@ -194,7 +194,7 @@ " . $TaxGroupTaxesRow['calculationorder'] . ", " . $TaxGroupTaxesRow['taxontax'] . ");\n"; } - $SQLScript .= 'SET FOREIGN_KEY_CHECKS=1;'; + $SQLScript .= "SET FOREIGN_KEY_CHECKS=1;"; /*Now write $SQLScript to a file */ $FileHandle = fopen("./companies/" . $_SESSION['DatabaseName'] . "/reports/" . $_POST['TemplateName'] .".sql","w"); fwrite ($FileHandle, $SQLScript); @@ -225,10 +225,10 @@ echo '<table>'; /*Show the chart of accounts to be exported for deslection of company specific ones */ -$ChartResult = DB_query('SELECT accountcode, accountname, group_ FROM chartmaster',$db); +$ChartResult = DB_query("SELECT accountcode, accountname, group_ FROM chartmaster",$db); $TableHeadings = '<tr><th>' . _('Account Code') . '</th> - <th>' . _('Account Name') . '</th></tr>'; + <th>' . _('Account Name') . '</th></tr>'; $i = 0; while ($ChartRow = DB_fetch_array($ChartResult)){ echo '<tr><td>' . $ChartRow['accountcode'] . '</td> Modified: trunk/Z_CurrencyDebtorsBalances.php =================================================================== --- trunk/Z_CurrencyDebtorsBalances.php 2011-04-08 23:37:01 UTC (rev 4542) +++ trunk/Z_CurrencyDebtorsBalances.php 2011-04-09 06:12:05 UTC (rev 4543) @@ -1,6 +1,5 @@ <?php /* $Id$*/ -//$PageSecurity=15; include('includes/session.inc'); $title=_('Currency Debtor Balances'); @@ -8,12 +7,12 @@ echo '<font size=4><b>' . _('Debtors Balances By Currency Totals') . '</b></font>'; -$sql = 'SELECT SUM(ovamount+ovgst+ovdiscount+ovfreight-alloc) AS currencybalance, +$sql = "SELECT SUM(ovamount+ovgst+ovdiscount+ovfreight-alloc) AS currencybalance, currcode, SUM((ovamount+ovgst+ovdiscount+ovfreight-alloc)/rate) AS localbalance FROM debtortrans INNER JOIN debtorsmaster ON debtortrans.debtorno=debtorsmaster.debtorno - WHERE (ovamount+ovgst+ovdiscount+ovfreight-alloc)<>0 GROUP BY currcode'; + WHERE (ovamount+ovgst+ovdiscount+ovfreight-alloc)<>0 GROUP BY currcode"; $result = DB_query($sql,$db); Modified: trunk/Z_CurrencySuppliersBalances.php =================================================================== --- trunk/Z_CurrencySuppliersBalances.php 2011-04-08 23:37:01 UTC (rev 4542) +++ trunk/Z_CurrencySuppliersBalances.php 2011-04-09 06:12:05 UTC (rev 4543) @@ -1,6 +1,5 @@ <?php /* $Id$*/ -//$PageSecurity=15; include('includes/session.inc'); $title=_('Currency Debtor Balances'); @@ -8,11 +7,11 @@ echo '<font size=4><b>' . _('Suppliers Balances By Currency Totals') . '</b></font>'; -$sql = 'SELECT SUM(ovamount+ovgst-alloc) AS currencybalance, +$sql = "SELECT SUM(ovamount+ovgst-alloc) AS currencybalance, currcode, SUM((ovamount+ovgst-alloc)/rate) AS localbalance FROM supptrans INNER JOIN suppliers ON supptrans.supplierno=suppliers.supplierid - WHERE (ovamount+ovgst-alloc)<>0 GROUP BY currcode'; + WHERE (ovamount+ovgst-alloc)<>0 GROUP BY currcode"; $result = DB_query($sql,$db); Modified: trunk/Z_DataExport.php =================================================================== --- trunk/Z_DataExport.php 2011-04-08 23:37:01 UTC (rev 4542) +++ trunk/Z_DataExport.php 2011-04-09 06:12:05 UTC (rev 4543) @@ -2,7 +2,6 @@ /* $Id$*/ -//$PageSecurity=15; include('includes/session.inc'); @@ -70,9 +69,9 @@ $title = _('Price List Export Problem ....'); include('includes/header.inc'); prnMsg( _('The Price List could not be retrieved by the SQL because'). ' - ' . DB_error_msg($db), 'error'); - echo '<br><a href="' .$rootpath .'/index.php?' . SID . '">'. _('Back to the menu'). '</a>'; + echo '<br /><a href="' .$rootpath .'/index.php?' . SID . '">'. _('Back to the menu'). '</a>'; if ($debug==1){ - echo '<br>'. $SQL; + echo '<br />'. $SQL; } include('includes/footer.inc'); exit; @@ -166,9 +165,9 @@ $title = _('Customer List Export Problem ....'); include('includes/header.inc'); prnMsg( _('The Customer List could not be retrieved by the SQL because'). ' - ' . DB_error_msg($db), 'error'); - echo '<br><a href="' .$rootpath .'/index.php?' . SID . '">'. _('Back to the menu'). '</a>'; + echo '<br /><a href="' .$rootpath .'/index.php">'. _('Back to the menu'). '</a>'; if ($debug==1){ - echo '<br>'. $SQL; + echo '<br />'. $SQL; } include('includes/footer.inc'); exit; @@ -257,9 +256,9 @@ $title = _('Salesman List Export Problem ....'); include('includes/header.inc'); prnMsg( _('The Salesman List could not be retrieved by the SQL because'). ' - ' . DB_error_msg($db), 'error'); - echo '<br><a href="' .$rootpath .'/index.php?' . SID . '">'. _('Back to the menu'). '</a>'; + echo '<br /><a href="' .$rootpath .'/index.php">'. _('Back to the menu'). '</a>'; if ($debug==1){ - echo '<br>'. $SQL; + echo '<br />'. $SQL; } include('includes/footer.inc'); exit; @@ -306,9 +305,9 @@ $title = _('Security Token List Export Problem ....'); include('includes/header.inc'); prnMsg( _('The Image List could not be retrieved by the SQL because'). ' - ' . DB_error_msg($db), 'error'); - echo '<br><a href="' .$rootpath .'/index.php?' . SID . '">'. _('Back to the menu'). '</a>'; + echo '<br /><a href="' .$rootpath .'/index.php">'. _('Back to the menu'). '</a>'; if ($debug==1){ - echo '<br>'. $SQL; + echo '<br />'. $SQL; } include('includes/footer.inc'); exit; @@ -345,9 +344,9 @@ $title = _('Security Token List Export Problem ....'); include('includes/header.inc'); prnMsg( _('The Security Token List could not be retrieved by the SQL because'). ' - ' . DB_error_msg($db), 'error'); - echo '<br><a href="' .$rootpath .'/index.php?' . SID . '">'. _('Back to the menu'). '</a>'; + echo '<br /><a href="' .$rootpath .'/index.php?' . SID . '">'. _('Back to the menu'). '</a>'; if ($debug==1){ - echo '<br>'. $SQL; + echo '<br />'. $SQL; } include('includes/footer.inc'); exit; @@ -381,9 +380,9 @@ $title = _('Security Role List Export Problem ....'); include('includes/header.inc'); prnMsg( _('The Security Role List could not be retrieved by the SQL because'). ' - ' . DB_error_msg($db), 'error'); - echo '<br><a href="' .$rootpath .'/index.php?' . SID . '">'. _('Back to the menu'). '</a>'; + echo '<br /><a href="' .$rootpath .'/index.php">'. _('Back to the menu'). '</a>'; if ($debug==1){ - echo '<br>'. $SQL; + echo '<br />'. $SQL; } include('includes/footer.inc'); exit; @@ -417,9 +416,9 @@ $title = _('Security Group List Export Problem ....'); include('includes/header.inc'); prnMsg( _('The Security Group List could not be retrieved by the SQL because'). ' - ' . DB_error_msg($db), 'error'); - echo '<br><a href="' .$rootpath .'/index.php?' . SID . '">'. _('Back to the menu'). '</a>'; + echo '<br /><a href="' .$rootpath .'/index.php?' . SID . '">'. _('Back to the menu'). '</a>'; if ($debug==1){ - echo '<br>'. $SQL; + echo '<br />'. $SQL; } include('includes/footer.inc'); exit; @@ -469,9 +468,9 @@ $title = _('Security User List Export Problem ....'); include('includes/header.inc'); prnMsg( _('The Security User List could not be retrieved by the SQL because'). ' - ' . DB_error_msg($db), 'error'); - echo '<br><a href="' .$rootpath .'/index.php?' . SID . '">'. _('Back to the menu'). '</a>'; + echo '<br /><a href="' .$rootpath .'/index.php">'. _('Back to the menu'). '</a>'; if ($debug==1){ - echo '<br>'. $SQL; + echo '<br />'. $SQL; } include('includes/footer.inc'); exit; @@ -532,8 +531,8 @@ // SELECT EXPORT FOR PRICE LIST - echo "<br>"; - echo "<form method='post' action=" . $_SERVER['PHP_SELF'] . "?" . SID . ">"; + echo '<br />'; + echo '<form method="post" action="' . $_SERVER['PHP_SELF'] . '">'; echo '<input type="hidden" name="FormID" value="' . $_SESSION['FormID'] . '" />'; echo '<table>'; echo '<tr><th colspan=2>' . _('Price List Export') . '</th></tr>'; @@ -554,16 +553,16 @@ echo '<option Value="' . $myrow['loccode'] . '">' . $myrow['locationname']; } echo '</select></td></tr>'; - echo "</table>"; + echo '</table>'; echo "<div class='centre'><input type='Submit' name='pricelist' value='" . _('Export') . "'></div>"; - echo "</form><br>"; + echo '</form><br />'; // SELECT EXPORT FOR CUSTOMER LIST - echo "<br>"; + echo "<br />"; // Export Stock For Location - echo "<form method='post' action=" . $_SERVER['PHP_SELF'] . "?" . SID . ">"; + echo '<form method="post" action="' . $_SERVER['PHP_SELF'] . '">'; echo '<input type="hidden" name="FormID" value="' . $_SESSION['FormID'] . '" />'; echo '<table>'; echo '<tr><th colspan=2>' . _('Customer List Export') . '</th></tr>'; @@ -576,66 +575,66 @@ echo '<option Value="' . $myrow['loccode'] . '">' . $myrow['locationname']; } echo '</select></td></tr>'; - echo "</table>"; + echo '</table>'; echo "<div class='centre'><input type='Submit' name='custlist' value='" . _('Export') . "'></div>"; - echo "</form><br>"; + echo '</form><br />'; // SELECT EXPORT FOR SALES MAN - echo "<br>"; + echo "<br />"; // Export Stock For Location - echo "<form method='post' action=" . $_SERVER['PHP_SELF'] . "?" . SID . ">"; + echo '<form method="post" action="' . $_SERVER['PHP_SELF'] . '">'; echo '<input type="hidden" name="FormID" value="' . $_SESSION['FormID'] . '" />'; echo '<table>'; echo '<tr><th colspan=2>' . _('Salesman List Export') . '</th></tr>'; - echo "</table>"; + echo '</table>'; echo "<div class='centre'><div class='centre'><input type='Submit' name='salesmanlist' value='" . _('Export') . "'></div>"; - echo "</form><br>"; + echo '</form><br />'; // SELECT EXPORT FOR IMAGES - echo "<form method='post' action=" . $_SERVER['PHP_SELF'] . "?" . SID . ">"; + echo '<form method="post" action="' . $_SERVER['PHP_SELF'] . '">'; echo '<input type="hidden" name="FormID" value="' . $_SESSION['FormID'] . '" />'; echo '<table>'; echo '<tr><th colspan=2>' . _('Image List Export') . '</th></tr>'; - echo "</table>"; + echo '</table>'; echo "<div class='centre'><input type='Submit' name='imagelist' value='" . _('Export') . "'></div>"; - echo "</form><br>"; + echo '</form><br />'; // SELECT EXPORT SECURITY TOKENS - echo "<form method='post' action=" . $_SERVER['PHP_SELF'] . "?" . SID . ">"; + echo '<form method="post" action="' . $_SERVER['PHP_SELF'] . '">'; echo '<input type="hidden" name="FormID" value="' . $_SESSION['FormID'] . '" />'; echo '<table>'; echo '<tr><th colspan=2>' . _('Security Token List Export') . '</th></tr>'; - echo "</table>"; + echo '</table>'; echo "<div class='centre'><input type='Submit' name='sectokenlist' value='" . _('Export') . "'></div>"; - echo "</form><br>"; + echo '</form><br />'; // SELECT EXPORT SECURITY ROLES - echo "<form method='post' action=" . $_SERVER['PHP_SELF'] . "?" . SID . ">"; + echo '<form method="post" action="' . $_SERVER['PHP_SELF'] . '">'; echo '<input type="hidden" name="FormID" value="' . $_SESSION['FormID'] . '" />'; echo '<table>'; echo '<tr><th colspan=2>' . _('Security Role List Export') . '</th></tr>'; - echo "</table>"; + echo '</table>'; echo "<div class='centre'><input type='Submit' name='secrolelist' value='" . _('Export') . "'></div>"; - echo "</form><br>"; + echo '</form><br />'; // SELECT EXPORT SECURITY GROUPS - echo "<form method='post' action=" . $_SERVER['PHP_SELF'] . "?" . SID . ">"; + echo '<form method="post" action="' . $_SERVER['PHP_SELF'] . '">'; echo '<input type="hidden" name="FormID" value="' . $_SESSION['FormID'] . '" />'; echo '<table>'; echo '<tr><th colspan=2>' . _('Security Group List Export') . '</th></tr>'; - echo "</table>"; + echo '</table>'; echo "<div class='centre'><input type='Submit' name='secgrouplist' value='" . _('Export') . "'></div>"; - echo "</form><br>"; + echo '</form><br />'; // SELECT EXPORT SECURITY USERS - echo "<form method='post' action=" . $_SERVER['PHP_SELF'] . "?" . SID . ">"; + echo '<form method="post" action="' . $_SERVER['PHP_SELF'] . '">'; echo '<input type="hidden" name="FormID" value="' . $_SESSION['FormID'] . '" />'; echo '<table>'; echo '<tr><th colspan=2>' . _('Security User List Export') . '</th></tr>'; - echo "</table>"; - echo "<div class='centre'><input type='Submit' name='secuserlist' value='" . _('Export') . "'></div>"; - echo "</form><br>"; + echo '</table>'; + echo '<div class="centre"><input type="Submit" name="secuserlist" value="' . _('Export') . '"></div>'; + echo '</form><br />'; include('includes/footer.inc'); Modified: trunk/Z_DeleteCreditNote.php =================================================================== --- trunk/Z_DeleteCreditNote.php 2011-04-08 23:37:01 UTC (rev 4542) +++ trunk/Z_DeleteCreditNote.php 2011-04-09 06:12:05 UTC (rev 4543) @@ -5,11 +5,12 @@ /* Script to delete a credit note - it expects and credit note number to delete not included on any menu for obvious reasons +STRONGLY RECOMMEND NOT USING THIS - RE INVOICE INSTEAD + must be called directly with path/DeleteCreditnote.php?CreditNoteNo=??????? !! */ -//$PageSecurity=15; include ('includes/session.inc'); $title = _('Delete Credit Note'); @@ -21,7 +22,7 @@ } /*get the order number that was credited */ -$SQL = 'SELECT order_ FROM debtortrans WHERE transno=' . $_GET['CreditNoteNo'] . ' AND type=11'; +$SQL = "SELECT order_ FROM debtortrans WHERE transno='" . $_GET['CreditNoteNo'] . "' AND type='11'"; $Result = DB_query($SQL, $db); $myrow = DB_fetch_row($Result); @@ -29,14 +30,14 @@ /*Now get the stock movements that were credited into an array */ -$SQL = 'SELECT stockid, - loccode, - debtorno, - branchcode, - prd, - qty - FROM stockmoves - WHERE transno =' .$_GET['CreditNoteNo'] . ' AND type=11'; +$SQL = "SELECT stockid, + loccode, + debtorno, + branchcode, + prd, + qty + FROM stockmoves + WHERE transno ='" .$_GET['CreditNoteNo'] . "' AND type='11'"; $Result = DB_query($SQL,$db); $i=0; @@ -72,8 +73,8 @@ /*reverse the update to LocStock */ $SQL = "UPDATE locstock SET locstock.quantity = locstock.quantity + " . $CreditLine['qty'] . " - WHERE locstock.stockid = '" . $CreditLine['stockid'] . "' - AND loccode = '" . $CreditLine['loccode'] . "'"; + WHERE locstock.stockid = '" . $CreditLine['stockid'] . "' + AND loccode = '" . $CreditLine['loccode'] . "'"; $ErrMsg = _('SQL to reverse update to the location stock records failed with the error'); @@ -100,7 +101,7 @@ $ErrMsg = _('SQL to delete the stock movement record failed with the message'); $Result = DB_query($SQL, $db,$ErrMsg,$DbgMsg,true); prnMsg(_('Deleted the credit note stock movements').'info'); -echo '<br><br>'; +echo '<br /><br />'; $result = DB_Txn_Commit($db); prnMsg(_('Credit note number') . ' ' . $_GET['CreditNoteNo'] . ' ' . _('has been completely deleted') . '. ' . _('To ensure the integrity of the general ledger transactions must be reposted from the period the credit note was created'),'info'); Modified: trunk/Z_DeleteInvoice.php =================================================================== --- trunk/Z_DeleteInvoice.php 2011-04-08 23:37:01 UTC (rev 4542) +++ trunk/Z_DeleteInvoice.php 2011-04-09 06:12:05 UTC (rev 4543) @@ -4,9 +4,12 @@ /* Script to delete an invoice expects and invoice number to delete not included on any menu for obvious reasons +* +* STRONGLY RECOMMEND NOT USING THIS -CREDIT THE INVOICE AND RE INVOICE +* * +* This page must be called directly using path/Z_DeleteInvoice.php?InvoiceNo=????? !! */ -//$PageSecurity=15; include ('includes/session.inc'); $title = _('Delete Invoice'); @@ -19,9 +22,10 @@ } /*Get the order number that was invoiced */ -$SQL = 'SELECT order_ - FROM debtortrans - WHERE debtortrans.type = 10 and transno = ' . $_GET['InvoiceNo']; +$SQL = "SELECT order_ + FROM debtortrans + WHERE debtortrans.type = 10 + AND transno = '" . $_GET['InvoiceNo'] . "'"; $Result = DB_query($SQL,$db); $myrow = DB_fetch_row($Result); @@ -40,7 +44,7 @@ // mbflag // We now use fully qualified column names -$SQL = 'SELECT stockmoves.stockid, +$SQL = "SELECT stockmoves.stockid, stockmoves.loccode, stockmoves.debtorno, stockmoves.branchcode, @@ -49,7 +53,7 @@ stockmaster.mbflag FROM stockmoves INNER JOIN stockmaster ON stockmoves.stockid = stockmaster.stockid - WHERE transno =' .$_GET['InvoiceNo'] . ' AND type=10'; + WHERE transno ='" .$_GET['InvoiceNo'] . "' AND type=10"; $Result = DB_query($SQL,$db); @@ -77,9 +81,9 @@ /*Now delete the DebtorTrans */ -$SQL = 'DELETE FROM debtortrans - WHERE transno =' . $_GET['InvoiceNo'] . ' - AND debtortrans.type=10'; +$SQL = "DELETE FROM debtortrans + WHERE transno ='" . $_GET['InvoiceNo'] . "' + AND debtortrans.type=10"; $DbgMsg = _('The SQL that failed was'); $ErrMsg = _('The debtorTrans record could not be deleted') . ' - ' . _('the sql server returned the following error'); $Result = DB_query($SQL,$db,$ErrMsg,$DbgMsg,true); Modified: trunk/Z_ImportFixedAssets.php =================================================================== --- trunk/Z_ImportFixedAssets.php 2011-04-08 23:37:01 UTC (rev 4542) +++ trunk/Z_ImportFixedAssets.php 2011-04-09 06:12:05 UTC (rev 4543) @@ -2,7 +2,6 @@ /* $Id: $*/ /* Script to import fixed assets into a specified period*/ -//$PageSecurity = 15; include('includes/session.inc'); $title = _('Import Fixed Assets'); include('includes/header.inc'); @@ -122,57 +121,57 @@ if (strlen($Description)==0 OR strlen($Description)>50){ prnMsg('The description of the asset is expected to be more than 3 characters long and less than 50 characters long','error'); - echo '<br>' . _('Row:') . $Row . ' - ' . _('Invalid Description:') . ' ' . $Description; + echo '<br />' . _('Row:') . $Row . ' - ' . _('Invalid Description:') . ' ' . $Description; $InputError=true; } if (!is_numeric($DepnRate)){ prnMsg(_('The depreciation rate is expected to be numeric'),'error'); - echo '<br>' . _('Row:') . $Row . ' - ' . _('Invalid Depreciation Rate:') . ' ' . $DepnRate; + echo '<br />' . _('Row:') . $Row . ' - ' . _('Invalid Depreciation Rate:') . ' ' . $DepnRate; $InputError=true; }elseif ($DepnRate<0 OR $DepnRate>100){ prnMsg(_('The depreciation rate is expected to be a number between 0 and 100'),'error'); - echo '<br>' . _('Row:') . $Row . ' - ' ._('Invalid Depreciation Rate:') . ' ' . $DepnRate; + echo '<br />' . _('Row:') . $Row . ' - ' ._('Invalid Depreciation Rate:') . ' ' . $DepnRate; $InputError=true; } if (!is_numeric($AccumDepn)){ prnMsg(_('The accumulated depreciation is expected to be numeric'),'error'); - echo '<br>' . _('Row:') . $Row . ' - ' . _('Invalid Accumulated Depreciation:') . ' ' . $AccumDepn; + echo '<br />' . _('Row:') . $Row . ' - ' . _('Invalid Accumulated Depreciation:') . ' ' . $AccumDepn; $InputError=true; } elseif ($AccumDepn<0){ prnMsg(_('The accumulated depreciation is expected to be either zero or a positive number'),'error'); - echo '<br>' . _('Row:') . $Row . ' - ' . _('Invalid Accumulated Depreciation:') . ' ' . $AccumDepn; + echo '<br />' . _('Row:') . $Row . ' - ' . _('Invalid Accumulated Depreciation:') . ' ' . $AccumDepn; $InputError=true; } if (!is_numeric($Cost)){ prnMsg(_('The cost is expected to be numeric'),'error'); - echo '<br>' . _('Row:') . $Row . ' - ' . _('Invalid Cost:') . ' ' . $Cost; + echo '<br />' . _('Row:') . $Row . ' - ' . _('Invalid Cost:') . ' ' . $Cost; $InputError=true; } elseif ($Cost<=0){ prnMsg(_('The cost is expected to be a positive number'),'error'); - echo '<br>' . _('Row:') . $Row . ' - ' . _('Invalid Cost:') . ' ' . $AccumDepn; + echo '<br />' . _('Row:') . $Row . ' - ' . _('Invalid Cost:') . ' ' . $AccumDepn; $InputError=true; } if ($DepnType !='SL' AND $DepnType!='DV'){ prnMsg(_('The depreciation type must be either "SL" - Straight Line or "DV" - Diminishing Value'),'error'); - echo '<br>' . _('Row:') . $Row . ' - ' . _('Invalid depreciation type:') . ' ' . $DepnType; + echo '<br />' . _('Row:') . $Row . ' - ' . _('Invalid depreciation type:') . ' ' . $DepnType; $InputError = true; } - $result = DB_query('SELECT categoryid FROM fixedassetcategories WHERE categoryid="' . $AssetCategoryID . '"', $db); + $result = DB_query("SELECT categoryid FROM fixedassetcategories WHERE categoryid='" . $AssetCategoryID . "'", $db); if (DB_num_rows($result)==0){ $InputError = true; prnMsg(_('The asset category code entered must be exist in the assetcategories table'),'error'); - echo '<br>' . _('Row:') . $Row . ' - ' . _('Invalid asset category:') . ' ' . $AssetCategoryID; + echo '<br />' . _('Row:') . $Row . ' - ' . _('Invalid asset category:') . ' ' . $AssetCategoryID; } - $result = DB_query('SELECT locationid FROM fixedassetlocations WHERE locationid="' . $AssetLocationCode . '"', $db); + $result = DB_query("SELECT locationid FROM fixedassetlocations WHERE locationid='" . $AssetLocationCode . "'", $db); if (DB_num_rows($result)==0){ $InputError = true; prnMsg(_('The asset location code entered must be exist in the asset locations table'),'error'); - echo '<br>' . _('Row:') . $Row . ' - ' . _('Invalid asset location code:') . ' ' . $AssetLocationCode; + echo '<br />' . _('Row:') . $Row . ' - ' . _('Invalid asset location code:') . ' ' . $AssetLocationCode; } if (!Is_Date($DatePurchased)){ $InputError = true; prnMsg(_('The date purchased must be entered in the format:') . ' ' . $_SESSION['DefaultDateFormat'],'error'); - echo '<br>' . _('Row:') . $Row . ' - ' . _('Invalid date format:') . ' ' . $DatePurchased; + echo '<br />' . _('Row:') . $Row . ' - ' . _('Invalid date format:') . ' ' . $DatePurchased; } if ($DepnType=='DV'){ $DepnType=1; @@ -187,27 +186,27 @@ //attempt to insert the stock item $sql = "INSERT INTO fixedassets (description, - longdescription, - assetcategoryid, - serialno, - barcode, - assetlocation, - cost, - accumdepn, - depntype, - depnrate, - datepurchased) - VALUES ('" . $Description . "', - '" . $LongDescription . "', - '" . $AssetCategoryID . "', - '" . $SerialNo . "', - '" . $BarCode . "', - '" . $AssetLocationCode . "', - '" . $Cost . "', - '" . $AccumDepn . "', - '" . $DepnType . "', - '" . $DepnRate . "', - '" . FormatDateForSQL($DatePurchased) . "')"; + longdescription, + assetcategoryid, + serialno, + barcode, + assetlocation, + cost, + accumdepn, + depntype, + depnrate, + datepurchased) + VALUES ('" . $Description . "', + '" . $LongDescription . "', + '" . $AssetCategoryID . "', + '" . $SerialNo . "', + '" . $BarCode . "', + '" . $AssetLocationCode . "', + '" . $Cost . "', + '" . $AccumDepn . "', + '" . $DepnType . "', + '" . $DepnRate . "', + '" . FormatDateForSQL($DatePurchased) . "')"; $ErrMsg = _('The asset could not be added because'); $DbgMsg = _('The SQL that was used to add the asset and failed was'); @@ -218,43 +217,43 @@ $AssetID = DB_Last_Insert_ID($db, 'fixedassets','assetid'); $sql = "INSERT INTO fixedassettrans ( assetid, - transtype, - transno, - transdate, - periodno, - inputdate, - fixedassettranstype, - amount) - VALUES ( '" . $AssetID . "', - '49', - '" . $TransNo . "', - '" . $_POST['DateToEnter'] . "', - '" . $PeriodNo . "', - '" . Date('Y-m-d') . "', - 'cost', - '" . $Cost . "')"; + transtype, + transno, + transdate, + periodno, + inputdate, + fixedassettranstype, + amount) + VALUES ( '" . $AssetID . "', + '49', + '" . $TransNo . "', + '" . $_POST['DateToEnter'] . "', + '" . $PeriodNo . "', + '" . Date('Y-m-d') . "', + 'cost', + '" . $Cost . "')"; $ErrMsg = _('The transaction for the cost of the asset could not be added because'); $DbgMsg = _('The SQL that was used to add the fixedasset trans record that failed was'); $InsResult = DB_query($sql,$db,$ErrMsg,$DbgMsg); $sql = "INSERT INTO fixedassettrans ( assetid, - transtype, - transno, - transdate, - periodno, - inputdate, - fixedassettranstype, - amount) - VALUES ( '" . $AssetID . "', - '49', - '" . $TransNo . "', - '" . $_POST['DateToEnter'] . "', - '" . $PeriodNo . "', - '" . Date('Y-m-d') . "', - 'depn', - '" . $AccumDepn . "')"; - + transtype, + transno, + transdate, + periodno, + inputdate, + fixedassettranstype, + amount) + VALUES ( '" . $AssetID . "', + '49', + '" . $TransNo . "', + '" . $_POST['DateToEnter'] . "', + '" . $PeriodNo . "', + '" . Date('Y-m-d') . "', + 'depn', + '" . $AccumDepn . "')"; + $ErrMsg = _('The transaction for the cost of the asset could not be added because'); $DbgMsg = _('The SQL that was used to add the fixedasset trans record that failed was'); $InsResult = DB_query($sql,$db,$ErrMsg,$DbgMsg); @@ -285,7 +284,7 @@ echo ' <br /> - <a href="Z_ImportFixedAssets.php?gettemplate=1">Get Import Template</a> + <a href="Z_ImportFixedAssets.php?gettemplate=1">' . _('Get Import Template') . '</a> <br /> <br /> '; @@ -296,17 +295,16 @@ echo '<table class="selection"> <tr><td>' . _('Select Date to Upload B/Fwd Assets To:') . '</td> <td><select name="DateToEnter">'; - $PeriodsResult = DB_query('SELECT lastdate_in_period FROM periods ORDER BY periodno',$db); + $PeriodsResult = DB_query("SELECT lastdate_in_period FROM periods ORDER BY periodno",$db); while ($PeriodRow = DB_fetch_row($PeriodsResult)){ echo '<option value="' . $PeriodRow[0] . '">' . ConvertSQLDate($PeriodRow[0]) . '</option>'; } echo '</select></td></tr>'; echo '<tr><td>' . _('Fixed Assets Upload file:') . '</td><td><input name="SelectedAssetFile" type="file"></tr></table> - <input type="submit" VALUE="' . _('Send File') . '"> + <input type="submit" value="' . _('Send File') . '"> </form>'; } - include('includes/footer.inc'); ?> \ No newline at end of file Modified: trunk/Z_ImportGLAccountGroups.php =================================================================== --- trunk/Z_ImportGLAccountGroups.php 2011-04-08 23:37:01 UTC (rev 4542) +++ trunk/Z_ImportGLAccountGroups.php 2011-04-09 06:12:05 UTC (rev 4543) @@ -1,8 +1,6 @@ <?php /* $Id$*/ -//$PageSecurity = 11; - include('includes/session.inc'); $title = _('Import Chart of Accounts'); include('includes/header.inc'); @@ -10,7 +8,7 @@ include('api/api_errorcodes.php'); $weberpuser = $_SESSION['UserID']; -$sql='SELECT password FROM www_users WHERE userid="'.$weberpuser.'"'; +$sql="SELECT password FROM www_users WHERE userid='" . $weberpuser . "'"; $result=DB_query($sql, $db); $myrow=DB_fetch_array($result); $weberppassword = $myrow[0]; Modified: trunk/Z_ImportGLAccountSections.php =================================================================== --- trunk/Z_ImportGLAccountSections.php 2011-04-08 23:37:01 UTC (rev 4542) +++ trunk/Z_ImportGLAccountSections.php 2011-04-09 06:12:05 UTC (rev 4543) @@ -1,21 +1,19 @@ <?php /* $Id$*/ -//$PageSecurity = 11; - include('includes/session.inc'); $title = _('Import Chart of Accounts'); include('includes/header.inc'); include('xmlrpc/lib/xmlrpc.inc'); include('api/api_errorcodes.php'); -$weberpuser = $_SESSION['UserID']; -$sql='SELECT password FROM www_users WHERE userid="'.$weberpuser.'"'; +$webERPUser = $_SESSION['UserID']; +$sql="SELECT password FROM www_users WHERE userid='" . $webERPUser ."'"; $result=DB_query($sql, $db); $myrow=DB_fetch_array($result); $weberppassword = $myrow[0]; -$ServerURL = "http://". $_SERVER['HTTP_HOST'].$rootpath."/api/api_xml-rpc.php"; +$ServerURL = 'http://'. $_SERVER['HTTP_HOST'] . $rootpath . '/api/api_xml-rpc.php'; $DebugLevel = 0; //Set to 0,1, or 2 with 2 being the highest level of debug info @@ -25,7 +23,11 @@ $FieldNames = explode(',', $buffer); $SuccessStyle='style="color:green; font-weight:bold"'; $FailureStyle='style="color:red; font-weight:bold"'; - echo '<table><tr><th>'. _('Account Section') .'</th><th>'. _('Result') . '</th><th>'. _('Comments') .'</th></tr>'; + echo '<table> + <tr><th>'. _('Account Section') .'</th> + <th>'. _('Result') . '</th> + <th>'. _('Comments') .'</th> + </tr>'; $successes=0; $failures=0; while (!feof ($fp)) { @@ -36,7 +38,7 @@ $AccountSectionDetails[$FieldNames[$i]]=$FieldValues[$i]; } $accountsection = php_xmlrpc_encode($AccountSectionDetails); - $user = new xmlrpcval($weberpuser); + $user = new xmlrpcval($webERPUser); $password = new xmlrpcval($weberppassword); $msg = new xmlrpcmsg("weberp.xmlrpc_InsertGLAccountSection", array($accountsection, $user, $password)); @@ -75,7 +77,5 @@ echo '<div class= "centre"><input type="submit" name="update" value="Process"></div>'; echo '</form>'; } - include('includes/footer.inc'); - ?> \ No newline at end of file Modified: trunk/Z_ImportPartCodes.php =================================================================== --- trunk/Z_ImportPartCodes.php 2011-04-08 23:37:01 UTC (rev 4542) +++ trunk/Z_ImportPartCodes.php 2011-04-09 06:12:05 UTC (rev 4543) @@ -1,7 +1,6 @@ <?php /* $Id$*/ -//$PageSecurity = 11; include('includes/session.inc'); $title = _('Import Stock Items'); @@ -9,13 +8,13 @@ include('xmlrpc/lib/xmlrpc.inc'); include('api/api_errorcodes.php'); -$weberpuser = $_SESSION['UserID']; -$sql='SELECT password FROM www_users WHERE userid="'.$weberpuser.'"'; +$webERPUser = $_SESSION['UserID']; +$sql="SELECT password FROM www_users WHERE userid='" . $webERPUser."'"; $result=DB_query($sql, $db); $myrow=DB_fetch_array($result); $weberppassword = $myrow[0]; -$ServerURL = "http://". $_SERVER['HTTP_HOST'].$rootpath."/api/api_xml-rpc.php"; +$ServerURL = 'http://'. $_SERVER['HTTP_HOST'] . $rootpath . '/api/api_xml-rpc.php'; $DebugLevel = 0; //Set to 0,1, or 2 with 2 being the highest level of debug info @@ -25,7 +24,12 @@ $FieldNames = explode(',', $buffer); $SuccessStyle='style="color:green; font-weight:bold"'; $FailureStyle='style="color:red; font-weight:bold"'; - echo '<table><tr><th>'. _('Part Code') .'</th><th>'. _('Result') . '</th><th>'. _('Comments') .'</th></tr>'; + echo '<table> + <tr> + <th>'. _('Part Code') .'</th> + <th>'. _('Result') . '</th> + <th>'. _('Comments') .'</th> + </tr>'; $successes=0; $failures=0; while (!feof ($fp)) { @@ -36,7 +40,7 @@ $ItemDetails[$FieldNames[$i]]=$FieldValues[$i]; } $stockitem = php_xmlrpc_encode($ItemDetails); - $user = new xmlrpcval($weberpuser); + $user = new xmlrpcval($webERPUser); $password = new xmlrpcval($weberppassword); $msg = new xmlrpcmsg("weberp.xmlrpc_InsertStockItem", array($stockitem, $user, $password)); @@ -65,7 +69,7 @@ echo '</table>'; fclose ($fp); } else { - $sql = 'select * from locations'; + $sql = "select * from locations"; $result = DB_query($sql,$db); if (DB_num_rows($result)==0) { prnMsg( _('No locations have been set up. At least one location should be set up first'), "error"); Modified: trunk/Z_MakeStockLocns.php =================================================================== --- trunk/Z_MakeStockLocns.php 2011-04-08 23:37:01 UTC (rev 4542) +++ trunk/Z_MakeStockLocns.php 2011-04-09 06:12:05 UTC (rev 4543) @@ -2,30 +2,25 @@ /* $Id$*/ /* Script to make stock locations for all parts that do not have stock location records set up*/ - -//$PageSecurity=15; include ('includes/session.inc'); $title = _('Make LocStock Records'); include('includes/header.inc'); +echo '<br /><br />' . _('This script makes stock location records for parts where they do not already exist'); -echo '<br><br>' . _('This script makes stock location records for parts where they do not already exist'); - -$sql = 'INSERT INTO locstock (stockid, loccode) +$sql = "INSERT INTO locstock (stockid, loccode) SELECT stockmaster.stockid, locations.loccode FROM stockmaster CROSS JOIN locations LEFT JOIN locstock ON stockmaster.stockid = locstock.stockid AND locations.loccode = locstock.loccode - WHERE locstock.stockid IS NULL'; + WHERE locstock.stockid IS NULL"; $ErrMsg = _('The items/locations that need stock location records created cannot be retrieved because'); $Result = DB_query($sql,$db,$ErrMsg); - - -echo '<p>'; +echo '<p />'; prnMsg(_('Any stock items that may not have had stock location records have now been given new location stock records'),'info'); include('includes/footer.inc'); Modified: trunk/Z_PriceChanges.php =================================================================== --- trunk/Z_PriceChanges.php 2011-04-08 23:37:01 UTC (rev 4542) +++ trunk/Z_PriceChanges.php 2011-04-09 06:12:05 UTC (rev 4543) @@ -1,43 +1,41 @@ <?php /* $Id$*/ -//$PageSecurity=15; - include('includes/session.inc'); $title=_('Update Pricing'); include('includes/header.inc'); -echo '<br>' . _('This page updates already existing prices for a specified sales type (price list)') . '. ' . _('Choose between updating only customer special prices where the customer is set up under the price list selected, or all prices under the sales type or just specific prices for a customer for the stock category selected'); +echo '<br />' . _('This page updates already existing prices for a specified sales type (price list)') . '. ' . _('Choose between updating only customer special prices where the customer is set up under the price list selected, or all prices under the sales type or just specific prices for a customer for the stock category selected'); prnMsg (_('This script takes no account of start and end dates of prices and updates all historical prices as well as current prices - better to use new scripts under Inventory -> Maintenance'),'warn'); -echo "<form method='POST' action='" . $_SERVER['PHP_SELF'] . '?' . SID . "'>"; +echo '<form method="POST" action="' . $_SERVER['PHP_SELF'] . '">'; echo '<input type="hidden" name="FormID" value="' . $_SESSION['FormID'] . '" />'; -$SQL = 'SELECT sales_type, typeabbrev FROM salestypes'; +$SQL = "SELECT sales_type, typeabbrev FROM salestypes"; $result = DB_query($SQL,$db); echo '<p><table> <tr> - <td>' . _('Select the Price List to update the costs for') .":</td> - <td><select name='PriceList'>"; + <td>' . _('Select the Price List to update the costs for') .':</td> + <td><select name="PriceList">'; if (!isset($_POST['PriceList'])){ - echo '<option selected VALUE=0>' . _('No Price List Selected'); + echo '<option selected value=0>' . _('No Price List Selected') . '</option>'; } while ($PriceLists=DB_fetch_array($result)){ - echo "<option VALUE='" . $PriceLists['typeabbrev'] . "'>" . $PriceLists['sales_type']; + echo '<option value="' . $PriceLists['typeabbrev'] . '">' . $PriceLists['sales_type'] . '</option>'; } echo '</select></td></tr>'; -echo '<tr><td>' . _('Category') . ":</td> - <td><select name='StkCat'>"; +echo '<tr><td>' . _('Category') . ':</td> + <td><select name="StkCat">'; -$sql = 'SELECT categoryid, categorydescription FROM stockcategory'; +$sql = "SELECT categoryid, categorydescription FROM stockcategory"; $ErrMsg = _('The stock categories could not be retrieved because'); $DbgMsg = _('The SQL used to retrieve stock categories and failed was'); @@ -45,19 +43,19 @@ while ($myrow=DB_fetch_array($result)){ if ($myrow['categoryid']==$_POST['StkCat']){ - echo "<option selected VALUE='". $myrow['categoryid'] . "'>" . $myrow['categorydescription']; + echo '<option selected value="'. $myrow['categoryid'] . '">' . $myrow['categorydescription'] . '</option>'; } else { - echo "<option VALUE='". $myrow['categoryid'] . "'>" . $myrow['categorydescription']; + echo '<option value="'. $myrow['categoryid'] . '">' . $myrow['categorydescription'] . '</option>'; } } echo '</select></td></tr>'; echo '<tr><td>' . _('Which Prices to update') . ":</td> <td><select name='WhichPrices'>"; - echo "<option VALUE='Only Non-customer special prices'>" . _('Only Non-customer special prices'); - echo "<option VALUE='Only customer special prices'>" . _('Only customer special prices'); - echo "<option VALUE='Both customer special prices and non-customer special prices'>" . _('Both customer special prices and non-customer special prices'); - echo "<option VALUE='Selected customer special prices only'>" . $_SESSION['CustomerID'] . ' ' . _('customer special prices only'); + echo "<option value='Only Non-customer special prices'>" . _('Only Non-customer special prices') . '</option>'; + echo "<option value='Only customer special prices'>" . _('Only customer special prices') . '</option>'; + echo "<option value='Both customer special prices and non-customer special prices'>" . _('Both customer special prices and non-customer special prices') . '</option>'; + echo "<option value='Selected customer special prices only'>" . $_SESSION['CustomerID'] . ' ' . _('customer special prices only') . '</option>'; echo '</select></td></tr>'; if (!isset($_POST['IncreasePercent'])){ @@ -65,28 +63,28 @@ } echo '<tr><td>' . _('Percentage Increase (positive) or decrease (negative)') . "</td> - <td><input name='IncreasePercent' size=4 maxlength=4 VALUE=" . $_POST['IncreasePercent'] . "></td></tr></table>"; + <td><input name='IncreasePercent' size=4 maxlength=4 value=" . $_POST['IncreasePercent'] . "></td></tr></table>"; -echo "<div class='centre'><p><input type=submit name='UpdatePrices' VALUE='" . _('Update Prices') . '\' onclick="return confirm(\'' . _('Are you sure you wish to update all the prices according to the criteria selected?') . '\');"></div>'; +echo "<div class='centre'><p><input type=submit name='UpdatePrices' value='" . _('Update Prices') . '\' onclick="return confirm(\'' . _('Are you sure you wish to update all the prices according to the criteria selected?') . '\');"></div>'; echo '</form>'; if (isset($_POST['UpdatePrices']) AND isset($_POST['StkCat'])){ - echo '<br>' . _('So we are using a price list/sales type of') .' : ' . $_POST['PriceList']; - echo '<br>' . _('and a stock category code of') . ' : ' . $_POST['StkCat']; - echo '<br>' . _('and a increase percent of') . ' : ' . $_POST['IncreasePercent']; + echo '<br />' . _('So we are using a price list/sales type of') .' : ' . $_POST['PriceList']; + echo '<br />' . _('and a stock category code of') . ' : ' . $_POST['StkCat']; + echo '<br />' . _('and a increase percent of') . ' : ' . $_POST['IncreasePercent']; if ($_POST['PriceList']=='0'){ - echo '<br>' . _('The price list/sales type to be updated must be selected first'); + echo '<br />' . _('The price list/sales type to be updated must be selected first'); include ('includes/footer.inc'); exit; } if (ABS($_POST['IncreasePercent']) < 0.5 OR ABS($_POST['IncreasePercent'])>40 OR !is_numeric($_POST['IncreasePercent'])){ - echo '<br>' . _('The increase or decrease to be applied is expected to be an integer between 1 and 40 it is not necessary to enter the').' '. '%'.' '. _('sign') . ' - ' . _('the amount is assumed to be a percentage'); + echo '<br />' . _('The increase or decrease to be applied is expected to be an integer between 1 and 40 it is not necessary to enter the').' '. '%'.' '. _('sign') . ' - ' . _('the amount is assumed to be a percentage'); include ('includes/footer.inc'); exit; } @@ -102,7 +100,7 @@ if ($_POST['WhichPrices'] == 'Only Non-customer special prices'){ - $sql = 'UPDATE prices SET price=price*(1+' . $IncrementPercentage . ") + $sql = "UPDATE prices SET price=price*(1+" . $IncrementPercentage . ") WHERE typeabbrev='" . $_POST['PriceList'] . "' AND stockid='" . $myrow['stockid'] . "' AND typeabbrev='" . $_POST['PriceList'] . "' @@ -125,7 +123,7 @@ } else if ($_POST['WhichPrices'] == 'Selected customer special prices only'){ - $sql = 'UPDATE prices SET price=price*(1+' . $IncrementPercentage . ") + $sql = "UPDATE prices SET price=price*(1+" . $IncrementPercentage . ") WHERE typeabbrev='" . $_POST['PriceList'] . "' AND stockid='" . $myrow['stockid'] . "' AND typeabbrev='" . $_POST['PriceList'] . "' Modified: trunk/Z_ReApplyCostToSA.php =================================================================== --- trunk/Z_ReApplyCostToSA.php 2011-04-08 23:37:01 UTC (rev 4542) +++ trunk/Z_ReApplyCostToSA.php 2011-04-09 06:12:05 UTC (rev 4543) @@ -2,8 +2,6 @@ /* $Id$*/ -//$PageSecurity=15; - include('includes/session.inc'); $title=_('Apply Current Cost to Sales Analysis'); include('includes/header.inc'); @@ -13,33 +11,33 @@ echo "<form method='POST' action='" . $_SERVER['PHP_SELF'] . '?' . SID . "'>"; echo '<input type="hidden" name="FormID" value="' . $_SESSION['FormID'] . '" />'; -$SQL = 'SELECT MonthName(lastdate_in_period) AS mnth, +$SQL = "SELECT MonthName(lastdate_in_period) AS mnth, YEAR(lastdate_in_period) AS yr, periodno - FROM periods'; -echo '<p><div class="centre">' . _('Select the Period to update the costs for') . ":<select name='PeriodNo'>"; + FROM periods"; +echo '<p><div class="centre">' . _('Select the Period to update the costs for') . ':<select name="PeriodNo">'; $result = DB_query($SQL,$db); -echo '<option selected VALUE=0>' . _('No Period Selected'); +echo '<option selected value=0>' . _('No Period Selected') . '</option>'; while ($PeriodInfo=DB_fetch_array($result)){ - echo '<option VALUE=' . $PeriodInfo['periodno'] . '>' . $PeriodInfo['mnth'] . ' ' . $PeriodInfo['Yr']; + echo '<option value=' . $PeriodInfo['periodno'] . '>' . $PeriodInfo['mnth'] . ' ' . $PeriodInfo['Yr'] . '</option>'; } echo '</select>'; -echo "<p><input type=submit name='UpdateSalesAnalysis' VALUE='" . _('Update Sales Analysis Costs') ."'></div>"; +echo '<p><input type=submit name="UpdateSalesAnalysis" value="' . _('Update Sales Analysis Costs') .'"></div>'; echo '</form>'; if (isset($_POST['UpdateSalesAnalysis']) AND $_POST['PeriodNo']!=0){ - $sql = 'SELECT stockmaster.stockid, + $sql = "SELECT stockmaster.stockid, materialcost+overheadcost+labourcost AS standardcost, stockmaster.mbflag FROM salesanalysis INNER JOIN stockmaster ON salesanalysis.stockid=stockmaster.stockid - WHERE periodno=' . $_POST['PeriodNo'] . " + WHERE periodno='" . $_POST['PeriodNo'] . "' AND stockmaster.mbflag<>'D' GROUP BY stockmaster.stockid, stockmaster.materialcost, Modified: trunk/Z_RePostGLFromPeriod.php =================================================================== --- trunk/Z_RePostGLFromPeriod.php 2011-04-08 23:37:01 UTC (rev 4542) +++ trunk/Z_RePostGLFromPeriod.php 2011-04-09 06:12:05 UTC (rev 4543) @@ -2,13 +2,11 @@ /* $Id$*/ -//$PageSecurity=15; - include ('includes/session.inc'); $title = _('Recalculation of GL Balances in Chart Details Table'); include('includes/header.inc'); -echo '<form method="POST" action="' . $_SERVER['PHP_SELF'] . '?' . SID . '">'; +echo '<form method="POST" action="' . $_SERVER['PHP_SELF'] . '">'; echo '<input type="hidden" name="FormID" value="' . $_SESSION['FormID'] . '" />'; if (!isset($_POST['FromPeriod'])){ @@ -16,39 +14,37 @@ /*Show a form to allow input of criteria for TB to show */ echo '<table> <tr> - <td>' . _('Select Period From') . ":</td> - <td><select Name='FromPeriod'>"; + <td>' . _('Select Period From') . ':</td> + <td><select Name="FromPeriod">'; - $sql = 'SELECT periodno, + $sql = "SELECT periodno, lastdate_in_period - FROM periods ORDER BY periodno'; + FROM periods ORDER BY periodno"; $Periods = DB_query($sql,$db); while ($myrow=DB_fetch_array($Periods,$db)){ - echo '<option VALUE=' . $myrow['periodno'] . '>' . MonthAndYearFromSQLDate($myrow['lastdate_in_period']); + echo '<option VALUE=' . $myrow['periodno'] . '>' . MonthAndYearFromSQLDate($myrow['lastdate_in_period']) . '</option>'; } echo '</select></td> </tr> </table>'; - echo "<div class='centre'><input type=submit Name='recalc' Value='" . _('Do the Recalculation') . "' - onclick=\"return confirm('" . _('Are you sure you wish to re-post all general ledger transactions since the selected period - .... this can take some time?') . '\');"></div></form>'; + echo "<div class='centre'><input type=submit Name='recalc' value='" . _('Do the Recalculation') . "' onclick=\"return confirm('" . _('Are you sure you wish to re-post all general ledger transactions since the selected period this can take some time?') . '\');"></div></form>'; } else { /*OK do the updates */ /* Make the posted flag on all GL entries including and after the period selected = 0 */ - $sql = 'UPDATE gltrans SET posted=0 WHERE periodno >='. $_POST['FromPeriod']; + $sql = "UPDATE gltrans SET posted=0 WHERE periodno >='" . $_POST['FromPeriod'] . "'"; $UpdGLTransPostedFlag = DB_query($sql,$db); /* Now make all the actuals 0 for all periods including and after the period from */ - $sql = 'UPDATE chartdetails SET actual =0 WHERE period >= ' . $_POST['FromPeriod']; + $sql = "UPDATE chartdetails SET actual =0 WHERE period >= '" . $_POST['FromPeriod'] . "'"; $UpdActualChartDetails = DB_query($sql,$db); - $ChartDetailBFwdResult = DB_query('SELECT accountcode, bfwd FROM chartdetails WHERE period=' . $_POST['FromPeriod'],$db); + $ChartDetailBFwdResult = DB_query("SELECT accountcode, bfwd FROM chartdetails WHERE period='" . $_POST['FromPeriod'] . "'",$db); while ($ChartRow=DB_fetch_array($ChartDetailBFwdResult)){ - $sql = 'UPDATE chartdetails SET bfwd =' . $ChartRow['bfwd'] . ' WHERE period > ' . $_POST['FromPeriod'] . ' AND accountcode=' . $ChartRow['accountcode']; + $sql = "UPDATE chartdetails SET bfwd ='" . $ChartRow['bfwd'] . "' WHERE period > '" . $_POST['FromPeriod'] . "' AND accountcode='" . $ChartRow['accountcode'] . "'"; $UpdActualChartDetails = DB_query($sql,$db); } Modified: trunk/Z_ReverseSuppPaymentRun.php =================================================================== --- trunk/Z_ReverseSuppPaymentRun.php 2011-04-08 23:37:01 UTC (rev 4542) +++ trunk/Z_ReverseSuppPaymentRun.php 2011-04-09 06:12:05 UTC (rev 4543) @@ -4,7 +4,7 @@ /* Script to delete all supplier payments entered or created from a payment run on a specified day */ -//$PageSecurity=15; + include ('includes/session.inc'); $title = _('Reverse and Delete Supplier Payments'); include('includes/header.inc'); @@ -83,10 +83,10 @@ } -echo "<form method=post action='" . $_SERVER['PHP_SELF'] . '?' . SID . "'>"; - echo '<input type="hidden" name="FormID" value="' . $_SESSION['FormID'] . '" />'; +echo '<form method="post" action="' . $_SERVER['PHP_SELF'] . '">'; +echo '<input type="hidden" name="FormID" value="' . $_SESSION['FormID'] . '" />'; echo '<br>' . _('Enter the date of the payment run') . ": <input type=text name='PaytDate' maxlength=11 size=11 value='" . $_POST['PaytDate'] . "'>"; -echo "<input type=submit name='RevPayts' value='" . _('Reverse Supplier Payments on the Date Entered') . "'>"; +echo '<input type="submit" name="RevPayts" value="' . _('Reverse Supplier Payments on the Date Entered') . '">'; echo '</form>'; include('includes/footer.inc'); Modified: trunk/Z_SalesIntegrityCheck... [truncated message content] |
From: <dai...@us...> - 2011-04-08 23:37:09
|
Revision: 4542 http://web-erp.svn.sourceforge.net/web-erp/?rev=4542&view=rev Author: daintree Date: 2011-04-08 23:37:01 +0000 (Fri, 08 Apr 2011) Log Message: ----------- SQL xhtml quoting Modified Paths: -------------- trunk/ReverseGRN.php trunk/WWW_Access.php trunk/WWW_Users.php trunk/WorkCentres.php trunk/WorkOrderEntry.php trunk/WorkOrderIssue.php trunk/WorkOrderReceive.php trunk/Z_CheckAllocationsFrom.php trunk/Z_CheckAllocs.php trunk/Z_CheckDebtorsControl.php trunk/Z_CheckGLTransBalance.php trunk/Z_CreateChartDetails.php Modified: trunk/ReverseGRN.php =================================================================== --- trunk/ReverseGRN.php 2011-04-07 10:23:55 UTC (rev 4541) +++ trunk/ReverseGRN.php 2011-04-08 23:37:01 UTC (rev 4542) @@ -18,7 +18,7 @@ $_POST['SupplierID']=$_SESSION['SupplierID']; } if (!isset($_POST['SupplierID']) OR $_POST['SupplierID']==""){ - echo '<br>' . _('This page is expected to be called after a supplier has been selected'); + echo '<br />' . _('This page is expected to be called after a supplier has been selected'); echo "<meta http-equiv='Refresh' content='0; url=" . $rootpath . '/SelectSupplier.php?' . SID . "'>"; exit; } elseif (!isset($_POST['SuppName']) or $_POST['SuppName']=="") { @@ -61,7 +61,7 @@ $QtyToReverse = $GRN['qtyrecd'] - $GRN['quantityinv']; if ($QtyToReverse ==0){ - echo '<br><br>' . _('The GRN') . ' ' . $_GET['GRNNo'] . ' ' . _('has already been reversed or fully invoiced by the supplier - it cannot be reversed - stock quantities must be corrected by stock adjustments - the stock is paid for'); + echo '<br /><br />' . _('The GRN') . ' ' . $_GET['GRNNo'] . ' ' . _('has already been reversed or fully invoiced by the supplier - it cannot be reversed - stock quantities must be corrected by stock adjustments - the stock is paid for'); include ('includes/footer.inc'); exit; } @@ -73,7 +73,7 @@ $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') . ' '); + $CheckControlledResult = DB_query($SQL,$db,'<br />' . _('Could not determine if the item was controlled or not because') . ' '); $ControlledRow = DB_fetch_row($CheckControlledResult); if ($ControlledRow[0]==1) { /*Then its a controlled item */ $Controlled = true; @@ -132,7 +132,7 @@ /*Now the purchorder header status in case it was completed - now incomplete - just printed */ $SQL = "UPDATE purchorders SET status = 'Printed', - stat_comment = CONCAT('" . Date($_SESSION['DefaultDateFormat']) . ' ' . _('GRN Reversed for') . ' ' . $GRN['itemdescription'] . ' ' . _('by') . ' ' . $_SESSION['UsersRealName'] . "<br>', stat_comment ) + stat_comment = CONCAT('" . Date($_SESSION['DefaultDateFormat']) . ' ' . _('GRN Reversed for') . ' ' . $GRN['itemdescription'] . ' ' . _('by') . ' ' . $_SESSION['UsersRealName'] . "<br />', stat_comment ) WHERE orderno = '" . $GRN['orderno'] . "'"; $ErrMsg = _('CRITICAL ERROR') . '! ' . _('NOTE DOWN THIS ERROR AND SEEK ASSISTANCE') . ': ' . _('The purchase order statusand status comment could not be changed because'); @@ -146,7 +146,7 @@ $ErrMsg = _('CRITICAL ERROR') . '! ' . _('NOTE DOWN THIS ERROR AND SEEK ASSISTANCE') . ': ' . _('The GRN record could not be deleted because'); $DbgMsg = _('The following SQL to delete the GRN record was used'); - $result = DB_query('DELETE FROM grns WHERE grnno="' . $_GET['GRNNo'] . '"',$db,$ErrMsg,$DbgMsg,true); + $result = DB_query("DELETE FROM grns WHERE grnno='" . $_GET['GRNNo'] . "'",$db,$ErrMsg,$DbgMsg,true); } else { $SQL = "UPDATE grns SET qtyrecd = qtyrecd - $QtyToReverse @@ -159,26 +159,26 @@ /*If the GRN being reversed is an asset - reverse the fixedassettrans record */ if ($GRN['assetid']!='0'){ $SQL = "INSERT INTO fixedassettrans (assetid, - transtype, - transno, - transdate, - periodno, - inputdate, - cost) - VALUES ('" . $GRN['assetid'] . "', - 25, - '" . $_GET['GRNNo'] . "', - '" . $GRN['deliverydate'] . "', - '" . $PeriodNo . "', - '" . Date('Y-m-d') . "', - '" . -$GRN['stdcostunit'] * $QtyToReverse . "')"; + transtype, + transno, + transdate, + periodno, + inputdate, + cost) + VALUES ('" . $GRN['assetid'] . "', + 25, + '" . $_GET['GRNNo'] . "', + '" . $GRN['deliverydate'] . "', + '" . $PeriodNo . "', + '" . Date('Y-m-d') . "', + '" . -$GRN['stdcostunit'] * $QtyToReverse . "')"; $ErrMsg = _('CRITICAL ERROR! NOTE DOWN THIS ERROR AND SEEK ASSISTANCE The fixed asset transaction could not be inserted because'); $DbgMsg = _('The following SQL to insert the fixed asset transaction record was used'); $Result = DB_query($SQL,$db,$ErrMsg, $DbgMsg, true); /*now reverse the cost put to fixedassets */ $SQL = "UPDATE fixedassets SET cost = cost - " . ($GRN['stdcostunit'] * $QtyToReverse) . " - WHERE assetid = '" . $GRN['assetid'] . "'"; + WHERE assetid = '" . $GRN['assetid'] . "'"; $ErrMsg = _('CRITICAL ERROR! NOTE DOWN THIS ERROR AND SEEK ASSISTANCE. The fixed asset cost addition could not be reversed:'); $DbgMsg = _('The following SQL was used to attempt the reduce the cost of the asset was:'); $Result = DB_query($SQL,$db,$ErrMsg, $DbgMsg, true); @@ -186,9 +186,9 @@ } //end of if it is an asset $SQL = "SELECT stockmaster.controlled - FROM stockmaster - WHERE stockmaster.stockid = '" . $GRN['itemcode'] . "'"; - $Result = DB_query($SQL, $db, _('Could not determine if the item exists because'),'<br>' . _('The SQL that failed was') . ' ',true); + FROM stockmaster + WHERE stockmaster.stockid = '" . $GRN['itemcode'] . "'"; + $Result = DB_query($SQL, $db, _('Could not determine if the item exists because'),'<br />' . _('The SQL that failed was') . ' ',true); if (DB_num_rows($Result)==1){ /* if the GRN is in fact a stock item being reversed */ @@ -222,28 +222,28 @@ /* If its a stock item .... Insert stock movements - with unit cost */ - $SQL = "INSERT INTO stockmoves ( stockid, - type, - transno, - loccode, - trandate, - prd, - reference, - qty, - standardcost, - newqoh) - VALUES ( - '" . $GRN['itemcode'] . "', - 25, - '" . $_GET['GRNNo'] . "', - '" . $GRN['intostocklocation'] . "', - '" . $GRN['deliverydate'] . "', - '" . $PeriodNo . "', - '" . _('Reversal') . ' - ' . $_POST['SupplierID'] . ' - ' . $GRN['orderno'] . "', - '" . -$QtyToReverse . "', - '" . $GRN['stdcostunit'] . "', - '" . ($QtyOnHandPrior - $QtyToReverse) . "' - )"; + $SQL = "INSERT INTO stockmoves ( stockid, + type, + transno, + loccode, + trandate, + prd, + reference, + qty, + standardcost, + newqoh) + VALUES ( + '" . $GRN['itemcode'] . "', + 25, + '" . $_GET['GRNNo'] . "', + '" . $GRN['intostocklocation'] . "', + '" . $GRN['deliverydate'] . "', + '" . $PeriodNo . "', + '" . _('Reversal') . ' - ' . $_POST['SupplierID'] . ' - ' . $GRN['orderno'] . "', + '" . -$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'); @@ -305,21 +305,21 @@ /*now the GRN suspense entry*/ $SQL = "INSERT INTO gltrans ( type, - typeno, - trandate, - periodno, - account, - narrative, - amount) - VALUES ( - 25, - '" . $_GET['GRNNo'] . "', - '" . $GRN['deliverydate'] . "', - '" . $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 . "' - )"; + typeno, + trandate, + periodno, + account, + narrative, + amount) + VALUES ( + 25, + '" . $_GET['GRNNo'] . "', + '" . $GRN['deliverydate'] . "', + '" . $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 . "' + )"; $ErrMsg = _('CRITICAL ERROR') . '! ' . _('NOTE DOWN THIS ERROR AND SEEK ASSISTANCE') . ': ' . _('The GRN suspense side of the GL posting could not be inserted because'); $DbgMsg = _('The following SQL to insert the GRN Suspense GLTrans record was used'); @@ -329,7 +329,7 @@ $Result = DB_Txn_Commit($db); - echo '<br>' . _('GRN number') . ' ' . $_GET['GRNNo'] . ' ' . _('for') . ' ' . $QtyToReverse . ' x ' . $GRN['itemcode'] . ' - ' . $GRN['itemdescription'] . ' ' . _('has been reversed') . '<br>'; + echo '<br />' . _('GRN number') . ' ' . $_GET['GRNNo'] . ' ' . _('for') . ' ' . $QtyToReverse . ' x ' . $GRN['itemcode'] . ' - ' . $GRN['itemdescription'] . ' ' . _('has been reversed') . '<br />'; unset($_GET['GRNNo']); // to ensure it cant be done again!! echo '<a href="' . $_SERVER['PHP_SELF'] . '?' . SID . '">' . _('Select another GRN to Reverse') . '</a>'; /*end of Process Goods Received Reversal entry */ @@ -367,7 +367,7 @@ $result = DB_query($sql,$db,$ErrMsg,$DbgMsg); if (DB_num_rows($result) ==0){ - 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'); + 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 '<br /><table cellpadding=2 colspan=7 class=selection>'; @@ -375,10 +375,10 @@ <th>' . _('GRN') . ' #</th> <th>' . _('Item Code') . '</th> <th>' . _('Description') . '</th> - <th>' . _('Date') . '<br>' . _('Received') . '</th> - <th>' . _('Quantity') . '<br>' . _('Received') . '</th> - <th>' . _('Quantity') . '<br>' . _('Invoiced') . '</th> - <th>' . _('Quantity To') . '<br>' . _('Reverse') . '</th> + <th>' . _('Date') . '<br />' . _('Received') . '</th> + <th>' . _('Quantity') . '<br />' . _('Received') . '</th> + <th>' . _('Quantity') . '<br />' . _('Invoiced') . '</th> + <th>' . _('Quantity To') . '<br />' . _('Reverse') . '</th> </tr>'; echo $TableHeader; Modified: trunk/WWW_Access.php =================================================================== --- trunk/WWW_Access.php 2011-04-07 10:23:55 UTC (rev 4541) +++ trunk/WWW_Access.php 2011-04-08 23:37:01 UTC (rev 4542) @@ -2,8 +2,6 @@ /* $Id$*/ -//$PageSecurity=15; - include('includes/session.inc'); $title = _('Access Permission Maintenance'); @@ -41,7 +39,7 @@ $ErrMsg = _('The update of the security role description failed because'); $ResMsg = _('The Security role description was updated.'); } else { // Add Security Heading - $sql = "INSERT INTO securityroles (secrolename) VALUES ('".$_POST['SecRoleName']."')"; + $sql = "INSERT INTO securityroles (secrolename) valueS ('".$_POST['SecRoleName']."')"; $ErrMsg = _('The update of the security role failed because'); $ResMsg = _('The Security role was created.'); } @@ -52,7 +50,7 @@ if( isset($_GET['add']) ) { // updating Security Groups add a page token $sql = "INSERT INTO securitygroups ( secroleid, tokenid - ) VALUES ( + ) valueS ( '".$SelectedRole."', '".$PageTokenId."' )"; @@ -70,7 +68,7 @@ unset($_GET['PageToken']); } // Need to exec the query - if (isset($sql) && $InputError != 1 ) { + if (isset($sql) AND $InputError != 1 ) { $result = DB_query($sql,$db,$ErrMsg); if( $result ) { prnMsg( $ResMsg,'success'); @@ -84,7 +82,7 @@ $myrow = DB_fetch_row($result); if ($myrow[0]>0) { prnMsg( _('Cannot delete this role because user accounts are setup using it'),'warn'); - echo '<br>' . _('There are') . ' ' . $myrow[0] . ' ' . _('user accounts that have this security role setting') . '</font>'; + echo '<br />' . _('There are') . ' ' . $myrow[0] . ' ' . _('user accounts that have this security role setting') . '</font>'; } else { $sql="DELETE FROM securitygroups WHERE secroleid='" . $_GET['SelectedRole'] . "'"; $result = DB_query($sql,$db); @@ -108,7 +106,7 @@ $result = DB_query($sql,$db); echo '<table class=selection>'; - echo "<tr><th>" . _('Role') . "</th></tr>"; + echo '<tr><th>' . _('Role') . '</th></tr>'; $k=0; //row colour counter @@ -128,9 +126,9 @@ <td><a href=\"%s&SelectedRole=%s&delete=1&SecRoleName=%s\">" . _('Delete') . "</a></td> </tr>", $myrow['secrolename'], - $_SERVER['PHP_SELF'] . "?" . SID, + $_SERVER['PHP_SELF'] . '?', $myrow['secroleid'], - $_SERVER['PHP_SELF'] . "?" . SID, + $_SERVER['PHP_SELF'] . '?', $myrow['secroleid'], urlencode($myrow['secrolename'])); @@ -140,7 +138,7 @@ if (isset($SelectedRole)) { - echo "<br /><div class='centre'><a href='" . $_SERVER['PHP_SELF'] ."?" . SID . "'>" . _('Review Existing Roles') . '</a></div>'; + echo '<br /><div class="centre"><a href="' . $_SERVER['PHP_SELF'] . '">' . _('Review Existing Roles') . '</a></div>'; } if (isset($SelectedRole)) { @@ -159,24 +157,24 @@ $_POST['SecRoleName'] = $myrow['secrolename']; } } -echo '<br>'; -echo "<form method='post' action=" . $_SERVER['PHP_SELF'] . "?" . SID . ">"; +echo '<br />'; +echo '<form method="post" action="' . $_SERVER['PHP_SELF'] . '">'; echo '<input type="hidden" name="FormID" value="' . $_SESSION['FormID'] . '" />'; if( isset($_POST['SelectedRole'])) { - echo "<input type=hidden name='SelectedRole' VALUE='" . $_POST['SelectedRole'] . "'>"; + echo '<input type="hidden" name="SelectedRole" value="' . $_POST['SelectedRole'] . '">'; } -echo '<table class=selection>'; +echo '<table class="selection">'; if (!isset($_POST['SecRoleName'])) { $_POST['SecRoleName']=''; } echo '<tr><td>' . _('Role') . ":</td> - <td><input type='text' name='SecRoleName' size=40 maxlength=40 VALUE='" . $_POST['SecRoleName'] . "'></tr>"; + <td><input type='text' name='SecRoleName' size=40 maxlength=40 value='" . $_POST['SecRoleName'] . "'></tr>"; echo "</table><br /> <div class='centre'><input type='Submit' name='submit' value='" . _('Enter Role') . "'></div></form>"; if (isset($SelectedRole)) { - $sql = 'SELECT tokenid, tokenname - FROM securitytokens'; + $sql = "SELECT tokenid, tokenname + FROM securitytokens"; $sqlUsed = "SELECT tokenid FROM securitygroups WHERE secroleid='". $SelectedRole . "'"; @@ -194,8 +192,8 @@ echo '<br /><table class=selection><tr>'; if (DB_num_rows($Result)>0 ) { - echo "<th colspan=3><div class='centre'>"._('Assigned Security Tokens')."</div></th>"; - echo "<th colspan=3><div class='centre'>"._('Available Security Tokens')."</div></th>"; + echo '<th colspan="3"><div class="centre">'._('Assigned Security Tokens').'</div></th>'; + echo '<th colspan=3><div class="centre">'._('Available Security Tokens').'</div></th>'; } echo '</tr>'; @@ -215,7 +213,7 @@ <td><a href=\"%s&SelectedRole=%s&remove=1&PageToken=%s\">" . _('Remove') . "</a></td><td> </td><td> </td><td> </td>", $AvailRow['tokenid'], $AvailRow['tokenname'], - $_SERVER['PHP_SELF'] . "?" . SID, + $_SERVER['PHP_SELF'] . '?', $SelectedRole, $AvailRow['tokenid'] ); @@ -228,7 +226,7 @@ <td><a href=\"%s&SelectedRole=%s&add=1&PageToken=%s\">" . _('Add') . "</a></td>", $AvailRow['tokenid'], $AvailRow['tokenname'], - $_SERVER['PHP_SELF'] . "?" . SID, + $_SERVER['PHP_SELF'] . '?', $SelectedRole, $AvailRow['tokenid'] ); Modified: trunk/WWW_Users.php =================================================================== --- trunk/WWW_Users.php 2011-04-07 10:23:55 UTC (rev 4541) +++ trunk/WWW_Users.php 2011-04-08 23:37:01 UTC (rev 4542) @@ -2,8 +2,6 @@ /* $Id$*/ -//$PageSecurity=15; - if (isset($_POST['UserID']) AND isset($_POST['ID'])){ if ($_POST['UserID'] == $_POST['ID']) { $_POST['Language'] = $_POST['UserLanguage']; @@ -33,9 +31,9 @@ echo '<p class="page_title_text"><img src="'.$rootpath.'/css/'.$theme.'/images/group_add.png" title="' . _('Search') . '" alt="" />' . ' ' . $title.'</p><br />'; // Make an array of the security roles -$sql = 'SELECT secroleid, +$sql = "SELECT secroleid, secrolename - FROM securityroles ORDER BY secroleid'; + FROM securityroles ORDER BY secroleid"; $Sec_Result = DB_query($sql, $db); $SecurityRoles = array(); // Now load it into an a ray using Key/Value pairs @@ -106,7 +104,7 @@ $i=0; $ModulesAllowed = ''; while ($i < count($ModuleList)){ - $FormVbl = "Module_" . $i; + $FormVbl = 'Module_' . $i; $ModulesAllowed .= $_POST[($FormVbl)] . ','; $i++; } @@ -219,7 +217,7 @@ prnMsg(_('The demonstration user called demo cannot be deleted'),'error'); } else { */ - $sql='SELECT userid FROM audittrail where userid="'. $SelectedUser .'"'; + $sql="SELECT userid FROM audittrail where userid='" . $SelectedUser ."'"; $result=DB_query($sql, $db); if (DB_num_rows($result)!=0) { prnMsg(_('Cannot delete user as entries already exist in the audit trail'), 'warn'); @@ -239,7 +237,7 @@ /* If its the first time the page has been displayed with no parameters then none of the above are true and the list of Users 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*/ - $sql = 'SELECT + $sql = "SELECT userid, realname, phone, @@ -253,24 +251,24 @@ pagesize, theme, language - FROM www_users'; + FROM www_users"; $result = DB_query($sql,$db); echo '<table class=selection>'; - echo "<tr><th>" . _('User Login') . "</th> - <th>" . _('Full Name') . "</th> - <th>" . _('Telephone') . "</th> - <th>" . _('Email') . "</th> - <th>" . _('Customer Code') . "</th> - <th>" . _('Branch Code') . "</th> - <th>" . _('Supplier Code') . "</th> - <th>" . _('Salesperson') . "</th> - <th>" . _('Last Visit') . "</th> - <th>" . _('Security Role') ."</th> - <th>" . _('Report Size') ."</th> - <th>" . _('Theme') ."</th> - <th>" . _('Language') ."</th> - </tr>"; + echo '<tr><th>' . _('User Login') . '</th> + <th>' . _('Full Name') . '</th> + <th>' . _('Telephone') . '</th> + <th>' . _('Email') . '</th> + <th>' . _('Customer Code') . '</th> + <th>' . _('Branch Code') . '</th> + <th>' . _('Supplier Code') . '</th> + <th>' . _('Salesperson') . '</th> + <th>' . _('Last Visit') . '</th> + <th>' . _('Security Role') .'</th> + <th>' . _('Report Size') .'</th> + <th>' . _('Theme') .'</th> + <th>' . _('Language') .'</th> + </tr>'; $k=0; //row colour counter @@ -320,21 +318,21 @@ $myrow[10], $myrow[11], $myrow[12], - $_SERVER['PHP_SELF'] . "?" . SID, + $_SERVER['PHP_SELF'] . '?', $myrow[0], - $_SERVER['PHP_SELF'] . "?" . SID, + $_SERVER['PHP_SELF'] . '?', $myrow[0]); } //END WHILE LIST LOOP - echo '</table><br>'; + echo '</table><br />'; } //end of ifs and buts! if (isset($SelectedUser)) { - echo "<div class='centre'><a href='" . $_SERVER['PHP_SELF'] ."?" . SID . "'>" . _('Review Existing Users') . '</a></div><br>'; + echo '<div class="centre"><a href="' . $_SERVER['PHP_SELF'] . '">' . _('Review Existing Users') . '</a></div><br />'; } -echo "<form method='post' action=" . $_SERVER['PHP_SELF'] . "?" . SID . ">"; +echo '<form method="post" action="' . $_SERVER['PHP_SELF'] . '">'; echo '<input type="hidden" name="FormID" value="' . $_SESSION['FormID'] . '" />'; if (isset($SelectedUser)) { @@ -380,16 +378,19 @@ $_POST['Blocked'] = $myrow['blocked']; $_POST['PDFLanguage'] = $myrow['pdflanguage']; - echo "<input type='hidden' name='SelectedUser' value='" . $SelectedUser . "'>"; - echo "<input type='hidden' name='UserID' value='" . $_POST['UserID'] . "'>"; - echo "<input type='hidden' name='ModulesAllowed' value='" . $_POST['ModulesAllowed'] . "'>"; + echo '<input type="hidden" name="SelectedUser" value="' . $SelectedUser . '">'; + echo '<input type="hidden" name="UserID" value="' . $_POST['UserID'] . '">'; + echo '<input type="hidden" name="ModulesAllowed" value="' . $_POST['ModulesAllowed'] . '">'; echo '<table class=selection> <tr><td>' . _('User code') . ':</td><td>'; echo $_POST['UserID'] . '</td></tr>'; } else { //end of if $SelectedUser only do the else when a new record is being entered - echo '<table class=selection><tr><td>' . _('User Login') . ":</td><td><input type='text' name='UserID' size=22 maxlength=20 ></td></tr>"; + echo '<table class=selection> + <tr> + <td>' . _('User Login') . ':</td> + <td><input type="text" name="UserID" size="22" maxlength="20"></td></tr>'; /*set the default modules to show to all this had trapped a few people previously*/ @@ -418,21 +419,21 @@ if (!isset($_POST['Email'])) { $_POST['Email']=''; } -echo '<tr><td>' . _('Password') . ":</td> - <td><input type='password' name='Password' size=22 maxlength=20 value='" . $_POST['Password'] . "'></tr>"; -echo '<tr><td>' . _('Full Name') . ":</td> - <td><input type='text' name='RealName' value='" . $_POST['RealName'] . "' size=36 maxlength=35></td></tr>"; -echo '<tr><td>' . _('Telephone No') . ":</td> - <td><input type='text' name='Phone' value='" . $_POST['Phone'] . "' size=32 maxlength=30></td></tr>"; -echo '<tr><td>' . _('Email Address') .":</td> - <td><input type='text' name='Email' value='" . $_POST['Email'] ."' size=32 maxlength=55></td></tr>"; -echo '<tr><td>' . _('Security Role') . ":</td><td><select name='Access'>"; +echo '<tr><td>' . _('Password') . ':</td> + <td><input type="password" name="Password" size="22" maxlength="20" value="' . $_POST['Password'] . '"></tr>'; +echo '<tr><td>' . _('Full Name') . ':</td> + <td><input type="text" name="RealName" value="' . $_POST['RealName'] . '" size="36" maxlength="35"></td></tr>'; +echo '<tr><td>' . _('Telephone No') . ':</td> + <td><input type="text" name="Phone" value="' . $_POST['Phone'] . '" size="32" maxlength="30"></td></tr>'; +echo '<tr><td>' . _('Email Address') .':</td> + <td><input type="text" name="Email" value="' . $_POST['Email'] .'" size="32" maxlength="55"></td></tr>'; +echo '<tr><td>' . _('Security Role') . ':</td><td><select name="Access">'; foreach ($SecurityRoles as $SecKey => $SecVal) { if (isset($_POST['Access']) and $SecKey == $_POST['Access']){ - echo "<option selected value=" . $SecKey . ">" . $SecVal; + echo '<option selected value="' . $SecKey . '">' . $SecVal .'</option>'; } else { - echo "<option value=" . $SecKey . ">" . $SecVal; + echo '<option value="' . $SecKey . '">' . $SecVal .'</option>'; } } echo '</select></td></tr>'; @@ -441,17 +442,17 @@ echo '<tr><td>' . _('Default Location') . ':</td> <td><select name="DefaultLocation">'; -$sql = 'SELECT loccode, locationname FROM locations'; +$sql = "SELECT loccode, locationname FROM locations"; $result = DB_query($sql,$db); while ($myrow=DB_fetch_array($result)){ if (isset($_POST['DefaultLocation']) and $myrow['loccode'] == $_POST['DefaultLocation']){ - echo "<option selected value='" . $myrow['loccode'] . "'>" . $myrow['locationname']; + echo '<option selected value="' . $myrow['loccode'] . '">' . $myrow['locationname'] .'</option>'; } else { - echo "<option Value='" . $myrow['loccode'] . "'>" . $myrow['locationname']; + echo '<option Value="' . $myrow['loccode'] . '">' . $myrow['locationname'] .'</option>'; } @@ -479,7 +480,7 @@ echo '<tr><td>' . _('Restrict to Sales Person') . ':</td> <td><select name="Salesman">'; -$sql = 'SELECT salesmancode, salesmanname FROM salesman'; +$sql = "SELECT salesmancode, salesmanname FROM salesman"; $result = DB_query($sql,$db); if ((isset($_POST['Salesman']) and $_POST['Salesman']=='') OR !isset($_POST['Salesman'])){ echo '<option selected value="">' . _('Not a salesperson only login') . '</option>'; @@ -499,69 +500,69 @@ echo '</select></td></tr>'; -echo '<tr><td>' . _('Reports Page Size') .":</td> - <td><select name='PageSize'>"; +echo '<tr><td>' . _('Reports Page Size') .':</td> + <td><select name="PageSize">'; if(isset($_POST['PageSize']) and $_POST['PageSize']=='A4'){ - echo "<option selected value='A4'>" . _('A4'); + echo '<option selected value="A4">' . _('A4') .'</option>'; } else { - echo "<option value='A4'>A4"; + echo '<option value="A4">' . _('A4') . '</option>'; } if(isset($_POST['PageSize']) and $_POST['PageSize']=='A3'){ - echo "<option selected Value='A3'>" . _('A3'); + echo '<option selected value="A3">' . _('A3') .'</option>'; } else { - echo "<option value='A3'>A3"; + echo '<option value="A3">' . _('A3') .'</option>'; } if(isset($_POST['PageSize']) and $_POST['PageSize']=='A3_landscape'){ - echo "<option selected Value='A3_landscape'>" . _('A3') . ' ' . _('landscape'); + echo '<option selected value="A3_landscape">' . _('A3') . ' ' . _('landscape') .'</option>'; } else { - echo "<option value='A3_landscape'>" . _('A3') . ' ' . _('landscape'); + echo '<option value="A3_landscape">' . _('A3') . ' ' . _('landscape') .'</option>'; } if(isset($_POST['PageSize']) and $_POST['PageSize']=='letter'){ - echo "<option selected Value='letter'>" . _('Letter'); + echo '<option selected value="letter">' . _('Letter') .'</option>'; } else { - echo "<option value='letter'>" . _('Letter'); + echo '<option value="letter">' . _('Letter') .'</option>'; } if(isset($_POST['PageSize']) and $_POST['PageSize']=='letter_landscape'){ - echo "<option selected Value='letter_landscape'>" . _('Letter') . ' ' . _('landscape'); + echo '<option selected value="letter_landscape">' . _('Letter') . ' ' . _('landscape') .'</option>'; } else { - echo "<option value='letter_landscape'>" . _('Letter') . ' ' . _('landscape'); + echo '<option value="letter_landscape">' . _('Letter') . ' ' . _('landscape') .'</option>'; } if(isset($_POST['PageSize']) and $_POST['PageSize']=='legal'){ - echo "<option selected value='legal'>" . _('Legal'); + echo '<option selected value="legal">' . _('Legal') .'</option>'; } else { - echo "<option Value='legal'>" . _('Legal'); + echo '<option value="legal">' . _('Legal') .'</option>'; } if(isset($_POST['PageSize']) and $_POST['PageSize']=='legal_landscape'){ - echo "<option selected value='legal_landscape'>" . _('Legal') . ' ' . _('landscape'); + echo '<option selected value="legal_landscape">' . _('Legal') . ' ' . _('landscape') .'</option>'; } else { - echo "<option value='legal_landscape'>" . _('Legal') . ' ' . _('landscape'); + echo '<option value="legal_landscape">' . _('Legal') . ' ' . _('landscape') .'</option>'; } echo '</select></td></tr>'; echo '<tr> - <td>' . _('Theme') . ":</td> - <td><select name='Theme'>"; + <td>' . _('Theme') . ':</td> + <td><select name="Theme">'; $ThemeDirectory = dir('css/'); while (false != ($ThemeName = $ThemeDirectory->read())){ - if (is_dir("css/$ThemeName") AND $ThemeName != '.' AND $ThemeName != '..' AND $ThemeName != '.svn'){ + if (is_dir('css/' . $ThemeName) AND $ThemeName != '.' AND $ThemeName != '..' AND $ThemeName != '.svn'){ if (isset($_POST['Theme']) and $_POST['Theme'] == $ThemeName){ - echo "<option selected value='$ThemeName'>$ThemeName"; + echo '<option selected value="' . $ThemeName . '">' . $ThemeName .'</option>'; } else if (!isset($_POST['Theme']) and ($_SESSION['DefaultTheme']==$ThemeName)) { - echo "<option selected value='$ThemeName'>$ThemeName"; + echo '<option selected value="' . $ThemeName . '">' . $ThemeName .'</option>'; } else { - echo "<option value='$ThemeName'>$ThemeName"; + echo '<option value="' . $ThemeName . '">' . $ThemeName .'</option>'; } } } @@ -570,8 +571,8 @@ echo '<tr> - <td>' . _('Language') . ":</td> - <td><select name='UserLanguage'>"; + <td>' . _('Language') . ':</td> + <td><select name="UserLanguage">'; $LangDirHandle = dir('locale/'); @@ -581,11 +582,11 @@ if (is_dir('locale/' . $LanguageEntry) AND $LanguageEntry != '..' AND $LanguageEntry != 'CVS' AND $LanguageEntry!='.'){ if (isset($_POST['UserLanguage']) and $_POST['UserLanguage'] == $LanguageEntry){ - echo "<option selected value='$LanguageEntry'>$LanguageEntry"; + echo '<option selected value="' . $LanguageEntry . '">' . $LanguageEntry .'</option>'; } elseif (!isset($_POST['UserLanguage']) and $LanguageEntry == $DefaultLanguage) { - echo "<option selected value='$LanguageEntry'>$LanguageEntry"; + echo '<option selected value="' . $LanguageEntry . '">' . $LanguageEntry .'</option>'; } else { - echo "<option value='$LanguageEntry'>$LanguageEntry"; + echo '<option value="' . $LanguageEntry . '">' . $LanguageEntry .'</option>'; } } } @@ -599,7 +600,7 @@ $i=0; foreach($ModuleList as $ModuleName){ - echo '<tr><td>' . _('Display') . ' ' . $ModuleName . ' ' . _('options') . ": </td><td><select name='Module_" . $i . "'>"; + echo '<tr><td>' . _('Display') . ' ' . $ModuleName . ' ' . _('options') . ': </td><td><select name="Module_' . $i . '">'; if ($ModulesAllowed[$i]==0){ echo '<option selected value=0>' . _('No') . '</option>'; echo '<option value=1>' . _('Yes') . '</option>'; @@ -624,7 +625,7 @@ } echo '</select></td></tr>'; -echo '<tr><td>' . _('Account Status') . ":</td><td><select name='Blocked'>"; +echo '<tr><td>' . _('Account Status') . ':</td><td><select name="Blocked">'; if ($_POST['Blocked']==0){ echo '<option selected value=0>' . _('Open'); echo '<option value=1>' . _('Blocked'); @@ -634,7 +635,7 @@ } echo '</select></td></tr>'; -echo '</table><br> +echo '</table><br /> <div class="centre"><input type="submit" name="submit" value="' . _('Enter Information') . '"></div> </form>'; Modified: trunk/WorkCentres.php =================================================================== --- trunk/WorkCentres.php 2011-04-07 10:23:55 UTC (rev 4541) +++ trunk/WorkCentres.php 2011-04-08 23:37:01 UTC (rev 4542) @@ -1,7 +1,6 @@ <?php /* $Id$*/ -//$PageSecurity=9; include('includes/session.inc'); $title = _('Work Centres'); @@ -31,7 +30,7 @@ $InputError = 1; prnMsg(_('The Work Centre description must be at least 3 characters long'),'error'); } - if (strstr($_POST['Code'],' ') OR strstr($_POST['Code'],"'") OR strstr($_POST['Code'],'+') OR strstr($_POST['Code'],"\\") OR strstr($_POST['Code'],"\"") OR strstr($_POST['Code'],'&') OR strstr($_POST['Code'],'.') OR strstr($_POST['Code'],'"')) { + if (strstr($_POST['Code'],' ') OR ContainsIllegalCharacters($_POST['Code']) ) { $InputError = 1; prnMsg(_('The work centre code cannot contain any of the following characters') . " - ' & + \" \\ " . _('or a space'),'error'); } @@ -110,23 +109,23 @@ or deletion of the records*/ echo '<p class="page_title_text"><img src="'.$rootpath.'/css/'.$theme.'/images/maintenance.png" title="' . _('Search') . '" alt="" />' . ' ' . $title . '</p>'; - $sql = 'SELECT workcentres.code, - workcentres.description, - locations.locationname, - workcentres.overheadrecoveryact, - workcentres.overheadperhour - FROM workcentres, - locations - WHERE workcentres.location = locations.loccode'; + $sql = "SELECT workcentres.code, + workcentres.description, + locations.locationname, + workcentres.overheadrecoveryact, + workcentres.overheadperhour + FROM workcentres, + locations + WHERE workcentres.location = locations.loccode"; $result = DB_query($sql,$db); - echo "<table class=selection> - <tr bgcolor =#800000><th>" . _('WC Code') . "</th> - <th>" . _('Description') . "</th> - <th>" . _('Location') . "</th> - <th>" . _('Overhead GL Account') . "</th> - <th>" . _('Overhead Per Hour') . "</th> - </tr></font>"; + echo '<table class="selection"> + <tr bgcolor ="#800000"><th>' . _('WC Code') . '</th> + <th>' . _('Description') . '</th> + <th>' . _('Location') . '</th> + <th>' . _('Overhead GL Account') . '</th> + <th>' . _('Overhead Per Hour') . '</th> + </tr>'; while ($myrow = DB_fetch_row($result)) { @@ -143,8 +142,8 @@ $myrow[2], $myrow[3], $myrow[4], - $_SERVER['PHP_SELF'] . '?' . SID, - $myrow[0], $_SERVER['PHP_SELF'] . '?' . SID, + $_SERVER['PHP_SELF'] . '?', + $myrow[0], $_SERVER['PHP_SELF'] . '?', $myrow[0]); } @@ -156,10 +155,10 @@ if (isset($SelectedWC)) { echo '<p class="page_title_text"><img src="'.$rootpath.'/css/'.$theme.'/images/maintenance.png" title="' . _('Search') . '" alt="" />' . ' ' . $title . '</p>'; - echo "<div class='centre'><a href='" . $_SERVER['PHP_SELF'] . '?' . SID . "'>" . _('Show all Work Centres') . '</a></div>'; + echo '<div class="centre"><a href="' . $_SERVER['PHP_SELF'] . '">' . _('Show all Work Centres') . '</a></div>'; } -echo "<p><form method='post' action='" . $_SERVER['PHP_SELF'] . '?' . SID . "'>"; +echo '<p><form method="post" action="' . $_SERVER['PHP_SELF'] . '">'; echo '<input type="hidden" name="FormID" value="' . $_SESSION['FormID'] . '" />'; if (isset($SelectedWC)) { @@ -182,41 +181,42 @@ $_POST['OverheadRecoveryAct'] = $myrow['overheadrecoveryact']; $_POST['OverheadPerHour'] = $myrow['overheadperhour']; - echo '<input type=hidden name="SelectedWC" value=' . $SelectedWC . '>'; - echo '<input type=hidden name="Code" value="' . $_POST['Code'] . '">'; - echo '<table class=selection><tr><td>' ._('Work Centre Code') . ':</td><td>' . $_POST['Code'] . '</td></tr>'; + echo '<input type="hidden" name="SelectedWC" value=' . $SelectedWC . '>'; + echo '<input type="hidden" name="Code" value="' . $_POST['Code'] . '">'; + echo '<table class="selection"><tr><td>' ._('Work Centre Code') . ':</td> + <td>' . $_POST['Code'] . '</td></tr>'; } else { //end of if $SelectedWC only do the else when a new record is being entered if (!isset($_POST['Code'])) { $_POST['Code'] = ''; } - echo '<table class=selection><tr> - <td>' . _('Work Centre Code') . ":</td> - <td><input type='Text' name='Code' size=6 maxlength=5 value='" . $_POST['Code'] . "'></td> - </tr>"; + echo '<table class="selection"><tr> + <td>' . _('Work Centre Code') . ':</td> + <td><input type="Text" name="Code" size="6" maxlength="5" value="' . $_POST['Code'] . '"></td> + </tr>'; } -$SQL = 'SELECT locationname, +$SQL = "SELECT locationname, loccode - FROM locations'; + FROM locations"; $result = DB_query($SQL,$db); if (!isset($_POST['Description'])) { $_POST['Description'] = ''; } -echo '<tr><td>' . _('Work Centre Description') . ":</td> - <td><input type='Text' name='Description' size=21 maxlength=20 value='" . $_POST['Description'] . "'></td> +echo '<tr><td>' . _('Work Centre Description') . ':</td> + <td><input type="Text" name="Description" size="21" maxlength="20" value="' . $_POST['Description'] . '"></td> </tr> - <tr><td>" . _('Location') . ":</td> - <td><select name='Location'>"; + <tr><td>' . _('Location') . ':</td> + <td><select name="Location">'; while ($myrow = DB_fetch_array($result)) { if (isset($_POST['Location']) and $myrow['loccode']==$_POST['Location']) { - echo "<option selected VALUE='"; + echo '<option selected value="'; } else { - echo "<option VALUE='"; + echo '<option VALUE="'; } - echo $myrow['loccode'] . "'>" . $myrow['locationname']; + echo $myrow['loccode'] . '">' . $myrow['locationname'] . '</option>'; } //end while loop @@ -224,26 +224,26 @@ echo '</select></td></tr> - <tr><td>' . _('Overhead Recovery GL Account') . ":</td> - <td><select name='OverheadRecoveryAct'>"; + <tr><td>' . _('Overhead Recovery GL Account') . ':</td> + <td><select name="OverheadRecoveryAct">'; //SQL to poulate account selection boxes -$SQL = 'SELECT accountcode, - accountname - FROM chartmaster INNER JOIN accountgroups - ON chartmaster.group_=accountgroups.groupname - WHERE accountgroups.pandl!=0 - ORDER BY accountcode'; +$SQL = "SELECT accountcode, + accountname + FROM chartmaster INNER JOIN accountgroups + ON chartmaster.group_=accountgroups.groupname + WHERE accountgroups.pandl!=0 + ORDER BY accountcode"; $result = DB_query($SQL,$db); while ($myrow = DB_fetch_array($result)) { if (isset($_POST['OverheadRecoveryAct']) and $myrow['accountcode']==$_POST['OverheadRecoveryAct']) { - echo '<option selected VALUE='; + echo '<option selected value='; } else { - echo '<option VALUE='; + echo '<option value='; } - echo $myrow['accountcode'] . '>' . $myrow['accountname']; + echo $myrow['accountcode'] . '>' . $myrow['accountname'] . '</option>'; } //end while loop DB_free_result($result); Modified: trunk/WorkOrderEntry.php =================================================================== --- trunk/WorkOrderEntry.php 2011-04-07 10:23:55 UTC (rev 4541) +++ trunk/WorkOrderEntry.php 2011-04-08 23:37:01 UTC (rev 4542) @@ -207,10 +207,10 @@ if ($InputError==false){ $CostResult = DB_query("SELECT SUM((materialcost+labourcost+overheadcost)*bom.quantity) AS cost - FROM stockmaster INNER JOIN bom - ON stockmaster.stockid=bom.component - WHERE bom.parent='" . $NewItem . "' - AND bom.loccode='" . $_POST['StockLocation'] . "'", + FROM stockmaster INNER JOIN bom + ON stockmaster.stockid=bom.component + WHERE bom.parent='" . $NewItem . "' + AND bom.loccode='" . $_POST['StockLocation'] . "'", $db); $CostRow = DB_fetch_row($CostResult); if (is_null($CostRow[0]) OR $CostRow[0]==0){ @@ -299,10 +299,10 @@ if ($_POST['RecdQty'.$i]==0 AND (!isset($_POST['HasWOSerialNos'.$i]) or $_POST['HasWOSerialNos'.$i]==false)){ /* can only change location cost if QtyRecd=0 */ $CostResult = DB_query("SELECT SUM((materialcost+labourcost+overheadcost)*bom.quantity) AS cost - FROM stockmaster INNER JOIN bom - ON stockmaster.stockid=bom.component - WHERE bom.parent='" . $_POST['OutputItem'.$i] . "' - AND bom.loccode='" . $_POST['StockLocation'] . "'", + FROM stockmaster INNER JOIN bom + ON stockmaster.stockid=bom.component + WHERE bom.parent='" . $_POST['OutputItem'.$i] . "' + AND bom.loccode='" . $_POST['StockLocation'] . "'", $db); $CostRow = DB_fetch_row($CostResult); if (is_null($CostRow[0])){ @@ -350,7 +350,7 @@ // can't delete it there are open work issues $HasTransResult = DB_query("SELECT * FROM stockmoves WHERE (stockmoves.type= 26 OR stockmoves.type=28) - AND reference LIKE '%" . $_POST['WO'] . "%'",$db); + AND reference " . LIKE . " '%" . $_POST['WO'] . "%'",$db); if (DB_num_rows($HasTransResult)>0){ prnMsg(_('This work order cannot be deleted because it has issues or receipts related to it'),'error'); $CancelDelete=true; @@ -377,7 +377,7 @@ prnMsg(_('The work order has been deleted'),'success'); - echo "<p><a href='" . $rootpath . "/SelectWorkOrder.php?" . SID . "'>" . _('Select an existing outstanding work order') . "</a>"; + echo '<p><a href="' . $rootpath . '/SelectWorkOrder.php">' . _('Select an existing outstanding work order') . '</a>'; unset($_POST['WO']); for ($i=1;$i<=$_POST['NumberOfOutputs'];$i++){ unset($_POST['OutputItem'.$i]); @@ -394,7 +394,7 @@ echo '<form method="post" action="' . $_SERVER['PHP_SELF'] . '" name="form">'; echo '<input type="hidden" name="FormID" value="' . $_SESSION['FormID'] . '" />'; -echo '<br><table class=selection>'; +echo '<br /><table class="selection">'; $sql="SELECT workorders.loccode, requiredby, @@ -441,7 +441,7 @@ } $_POST['Controlled'.$i] =$WOItem['controlled']; $_POST['Serialised'.$i] =$WOItem['serialised']; - $HasWOSerialNosResult = DB_query('SELECT * FROM woserialnos WHERE wo=' . $_POST['WO'],$db); + $HasWOSerialNosResult = DB_query("SELECT * FROM woserialnos WHERE wo='" . $_POST['WO'] . "'",$db); if (DB_num_rows($HasWOSerialNosResult)>0){ $_POST['HasWOSerialNos']=true; } else { @@ -455,7 +455,7 @@ echo '<tr><td class="label">' . _('Work Order Reference') . ':</td><td>' . $_POST['WO'] . '</td></tr>'; echo '<tr><td class="label">' . _('Factory Location') .':</td> <td><select name="StockLocation">'; -$LocResult = DB_query('SELECT loccode,locationname FROM locations',$db); +$LocResult = DB_query("SELECT loccode,locationname FROM locations",$db); while ($LocRow = DB_fetch_array($LocResult)){ if ($_POST['StockLocation']==$LocRow['loccode']){ echo '<option selected value="' . $LocRow['loccode'] .'">' . $LocRow['locationname'] . '</option>'; @@ -521,7 +521,7 @@ } else { $LotOrSN = _('Batches'); } - echo '<td><a href="' . $rootpath . '/WOSerialNos.php?' . SID . '&WO=' . $_POST['WO'] . '&StockID=' . $_POST['OutputItem' .$i] . '&Description=' . $_POST['OutputItemDesc' .$i] . '&Serialised=' . $_POST['Serialised' .$i] . '&NextSerialNo=' . $_POST['NextLotSNRef' .$i] . '">' . $LotOrSN . '</a></td>'; + echo '<td><a href="' . $rootpath . '/WOSerialNos.php?WO=' . $_POST['WO'] . '&StockID=' . $_POST['OutputItem' .$i] . '&Description=' . $_POST['OutputItemDesc' .$i] . '&Serialised=' . $_POST['Serialised' .$i] . '&NextSerialNo=' . $_POST['NextLotSNRef' .$i] . '">' . $LotOrSN . '</a></td>'; } } echo '<td>'; @@ -558,31 +558,31 @@ echo '<table class=selection><tr><td>' . _('Select a stock category') . ':<select name="StockCat">'; if (!isset($_POST['StockCat'])){ - echo '<option selected VALUE="All">' . _('All'); + echo '<option selected VALUE="All">' . _('All') . '</option>'; $_POST['StockCat'] ='All'; } else { - echo '<option VALUE="All">' . _('All'); + echo '<option VALUE="All">' . _('All') . '</option>'; } while ($myrow1 = DB_fetch_array($result1)) { if ($_POST['StockCat']==$myrow1['categoryid']){ - echo '<option selected VALUE=' . $myrow1['categoryid'] . '>' . $myrow1['categorydescription']; + echo '<option selected value=' . $myrow1['categoryid'] . '>' . $myrow1['categorydescription'] . '</option>'; } else { - echo '<option VALUE='. $myrow1['categoryid'] . '>' . $myrow1['categorydescription']; + echo '<option value='. $myrow1['categoryid'] . '>' . $myrow1['categorydescription'] . '</option>'; } } ?> </select> <td><?php echo _('Enter text extracts in the'); ?> <b><?php echo _('description'); ?></b>:</td> -<td><input type="Text" name="Keywords" size=20 maxlength=25 VALUE="<?php if (isset($_POST['Keywords'])) echo $_POST['Keywords']; ?>"></td></tr> +<td><input type="Text" name="Keywords" size=20 maxlength=25 value="<?php if (isset($_POST['Keywords'])) echo $_POST['Keywords']; ?>"></td></tr> <tr><td></td> <td><font SIZE 3><b><?php echo _('OR'); ?> </b></font><?php echo _('Enter extract of the'); ?> <b><?php echo _('Stock Code'); ?></b>:</td> - <td><input type="Text" name="StockCode" size=15 maxlength=18 VALUE="<?php if (isset($_POST['StockCode'])) echo $_POST['StockCode']; ?>"></td> + <td><input type="Text" name="StockCode" size=15 maxlength=18 value="<?php if (isset($_POST['StockCode'])) echo $_POST['StockCode']; ?>"></td> </tr> </table> - <br /><div class="centre"><input type=submit name="Search" VALUE="<?php echo _('Search Now'); ?>"> + <br /><div class="centre"><input type=submit name="Search" value="<?php echo _('Search Now'); ?>"> <?php @@ -636,7 +636,7 @@ $myrow['description'], $myrow['units'], $ImageSource, - $_SERVER['PHP_SELF'] . '?' . SID . 'WO=' . $_POST['WO'] . '&NewItem=' . $myrow['stockid'].'&Line='.$i); + $_SERVER['PHP_SELF'] . '?WO=' . $_POST['WO'] . '&NewItem=' . $myrow['stockid'].'&Line='.$i); $j++; If ($j == 25){ Modified: trunk/WorkOrderIssue.php =================================================================== --- trunk/WorkOrderIssue.php 2011-04-07 10:23:55 UTC (rev 4541) +++ trunk/WorkOrderIssue.php 2011-04-08 23:37:01 UTC (rev 4542) @@ -1,8 +1,6 @@ <?php /* $Id$*/ -//$PageSecurity = 11; - include('includes/session.inc'); $title = _('Issue Materials To Work Order'); include('includes/header.inc'); @@ -15,19 +13,19 @@ $_POST['StockID']=$_GET['StockID']; } -echo '<a href="'. $rootpath . '/SelectWorkOrder.php?' . SID . '">' . _('Back to Work Orders'). '</a><br>'; -echo '<a href="'. $rootpath . '/WorkOrderCosting.php?' . SID . '&WO=' . $_POST['WO'] . '">' . _('Back to Costing'). '</a><br>'; +echo '<a href="'. $rootpath . '/SelectWorkOrder.php">' . _('Back to Work Orders'). '</a><br />'; +echo '<a href="'. $rootpath . '/WorkOrderCosting.php?WO=' . $_POST['WO'] . '">' . _('Back to Costing'). '</a><br />'; echo '<p class="page_title_text"><img src="'.$rootpath.'/css/'.$theme.'/images/group_add.png" title="' . _('Search') . '" alt="" />' . ' ' . $title.'</p'; -echo '<form action="' . $_SERVER['PHP_SELF'] . '?' . SID . '" method=post>'; +echo '<form action="' . $_SERVER['PHP_SELF'] . '" method=post>'; echo '<input type="hidden" name="FormID" value="' . $_SESSION['FormID'] . '" />'; if (!isset($_POST['WO']) OR !isset($_POST['StockID'])) { /* This page can only be called with a work order number for issuing stock to*/ - echo '<div class="centre"><a href="' . $rootpath . '/SelectWorkOrder.php?' . SID . '">'. + echo '<div class="centre"><a href="' . $rootpath . '/SelectWorkOrder.php">'. _('Select a work order to issue materials to').'</a></div>'; prnMsg(_('This page can only be opened if a work order has been selected. Please select a work order to issue materials to first'),'info'); include ('includes/footer.inc'); @@ -344,16 +342,16 @@ $ErrMsg = _('CRITICAL ERROR') . '! ' . _('NOTE DOWN THIS ERROR AND SEEK ASSISTANCE') . ': ' ._('Could not update the work order cost issued to the work order because'); $DbgMsg = _('The following SQL was used to update the work order'); $UpdateWOResult =DB_query("UPDATE workorders - SET costissued=costissued+" . ($QuantityIssued*$IssueItemRow['cost']) . " - WHERE wo='" . $_POST['WO'] . "'", - $db,$ErrMsg,$DbgMsg,true); + SET costissued=costissued+" . ($QuantityIssued*$IssueItemRow['cost']) . " + WHERE wo='" . $_POST['WO'] . "'", + $db,$ErrMsg,$DbgMsg,true); $Result = DB_Txn_Commit($db); prnMsg(_('The issue of') . ' ' . $QuantityIssued . ' ' . _('of') . ' ' . $_POST['IssueItem'] . ' ' . _('against work order') . ' '. $_POST['WO'] . ' ' . _('has been processed'),'info'); - echo '<p><ul><li><a href="' . $rootpath . '/WorkOrderIssue.php?' . SID . '&WO=' . $_POST['WO'] . '&StockID=' . $_POST['StockID'] . '">' . _('Issue more components to this work order') . '</a></li>'; - echo '<li><a href="' . $rootpath . '/SelectWorkOrder.php?' . SID . '">' . _('Select a different work order for issuing materials and components against'). '</a></li></ul>'; + echo '<p><ul><li><a href="' . $rootpath . '/WorkOrderIssue.php?WO=' . $_POST['WO'] . '&StockID=' . $_POST['StockID'] . '">' . _('Issue more components to this work order') . '</a></li>'; + echo '<li><a href="' . $rootpath . '/SelectWorkOrder.php">' . _('Select a different work order for issuing materials and components against'). '</a></li></ul>'; unset($_POST['WO']); unset($_POST['StockID']); unset($_POST['IssueItem']); @@ -474,7 +472,7 @@ prnMsg (_('There are no products available meeting the criteria specified'),'info'); if ($debug==1){ - prnMsg(_('The SQL statement used was') . ':<br>' . $SQL,'info'); + prnMsg(_('The SQL statement used was') . ':<br />' . $SQL,'info'); } } if (DB_num_rows($SearchResult)==1){ @@ -490,25 +488,25 @@ $ErrMsg = _('Could not retrieve the details of the selected work order item'); $WOResult = DB_query("SELECT workorders.loccode, - locations.locationname, - workorders.requiredby, - workorders.startdate, - workorders.closed, - stockmaster.description, - stockmaster.decimalplaces, - stockmaster.units, - woitems.qtyreqd, - woitems.qtyrecd - FROM workorders INNER JOIN locations - ON workorders.loccode=locations.loccode - INNER JOIN woitems - ON workorders.wo=woitems.wo - INNER JOIN stockmaster - ON woitems.stockid=stockmaster.stockid - WHERE woitems.stockid='" . $_POST['StockID'] . "' - AND woitems.wo ='" . $_POST['WO'] . "'", - $db, - $ErrMsg); + locations.locationname, + workorders.requiredby, + workorders.startdate, + workorders.closed, + stockmaster.description, + stockmaster.decimalplaces, + stockmaster.units, + woitems.qtyreqd, + woitems.qtyrecd + FROM workorders INNER JOIN locations + ON workorders.loccode=locations.loccode + INNER JOIN woitems + ON workorders.wo=woitems.wo + INNER JOIN stockmaster + ON woitems.stockid=stockmaster.stockid + WHERE woitems.stockid='" . $_POST['StockID'] . "' + AND woitems.wo ='" . $_POST['WO'] . "'", + $db, + $ErrMsg); if (DB_num_rows($WOResult)==0){ prnMsg(_('The selected work order item cannot be retrieved from the database'),'info'); @@ -527,30 +525,40 @@ $_POST['IssuedDate'] = Date($_SESSION['DefaultDateFormat']); } echo '<table cellpadding=2 class=selection> - <tr><td class="label">' . _('Issue to work order') . ':</td><td>' . $_POST['WO'] .'</td><td class="label">' . _('Item') . ':</td><td>' . $_POST['StockID'] . ' - ' . $WORow['description'] . '</td></tr> - <tr><td class="label">' . _('Manufactured at') . ':</td><td>' . $WORow['locationname'] . '</td><td class="label">' . _('Required By') . ':</td><td>' . ConvertSQLDate($WORow['requiredby']) . '</td></tr> - <tr><td class="label">' . _('Quantity Ordered') . ':</td><td class=number>' . number_format($WORow['qtyreqd'],$WORow['decimalplaces']) . '</td><td colspan=2>' . $WORow['units'] . '</td></tr> - <tr><td class="label">' . _('Already Received') . ':</td><td class=number>' . number_format($WORow['qtyrecd'],$WORow['decimalplaces']) . '</td><td colspan=2>' . $WORow['units'] . '</td></tr> + <tr><td class="label">' . _('Issue to work order') . ':</td> + <td>' . $_POST['WO'] .'</td><td class="label">' . _('Item') . ':</td> + <td>' . $_POST['StockID'] . ' - ' . $WORow['description'] . '</td> + </tr> + <tr><td class="label">' . _('Manufactured at') . ':</td> + <td>' . $WORow['locationname'] . '</td><td class="label">' . _('Required By') . ':</td> + <td>' . ConvertSQLDate($WORow['requiredby']) . '</td> + </tr> + <tr><td class="label">' . _('Quantity Ordered') . ':</td> + <td class="number">' . number_format($WORow['qtyreqd'],$WORow['decimalplaces']) . '</td> + <td colspan="2">' . $WORow['units'] . '</td> + </tr> + <tr><td class="label">' . _('Already Received') . ':</td> + <td class="number">' . number_format($WORow['qtyrecd'],$WORow['decimalplaces']) . '</td> + <td colspan="2">' . $WORow['units'] . '</td></tr> <tr><td colspan=4></td></tr> - <tr><td class="label">' . _('Date Material Issued') . ':</td><td><input type=text name=issuedate value=' - . Date($_SESSION['DefaultDateFormat']) . ' class=date size=10 alt="'.$_SESSION['DefaultDateFormat'].'" ></td> - <td class="label">' . _('Issued From') . ':</td><td>'; + <tr><td class="label">' . _('Date Material Issued') . ':</td> + <td><input type=text name=issuedate value=' . Date($_SESSION['DefaultDateFormat']) . ' class=date size=10 alt="'.$_SESSION['DefaultDateFormat'].'" ></td> + <td class="label">' . _('Issued From') . ':</td><td>'; if (!isset($_POST['IssueItem'])){ - $LocResult = DB_query('SELECT loccode, locationname FROM locations',$db); + $LocResult = DB_query("SELECT loccode, locationname FROM locations",$db); echo '<select name="FromLocation">'; - if (!isset($_POST['FromLocation'])){ $_POST['FromLocation']=$WORow['loccode']; } while ($LocRow = DB_fetch_array($LocResult)){ if ($_POST['FromLocation'] ==$LocRow['loccode']){ - echo '<option selected value="' . $LocRow['loccode'] .'">' . $LocRow['locationname']; + echo '<option selected value="' . $LocRow['loccode'] .'">' . $LocRow['locationname'] . '</option>'; } else { - echo '<option value="' . $LocRow['loccode'] .'">' . $LocRow['locationname']; + echo '<option value="' . $LocRow['loccode'] .'">' . $LocRow['locationname'] . '</option>'; } } echo '</select>'; @@ -576,27 +584,27 @@ <th>' . _('Qty Issued') . '</th></tr>'; $RequirmentsResult = DB_query("SELECT worequirements.stockid, - stockmaster.description, - stockmaster.decimalplaces, - autoissue, - qtypu - FROM worequirements INNER JOIN stockmaster - ON worequirements.stockid=stockmaster.stockid - WHERE wo='" . $_POST['WO'] . "'", - $db); + stockmaster.description, + stockmaster.decimalplaces, + autoissue, + qtypu + FROM worequirements INNER JOIN stockmaster + ON worequirements.stockid=stockmaster.stockid + WHERE wo='" . $_POST['WO'] . "'", + $db); while ($RequirementsRow = DB_fetch_array($RequirmentsResult)){ if ($RequirementsRow['autoissue']==0){ echo '<tr><td><input type="submit" name="IssueItem" value="' .$RequirementsRow['stockid'] . '"></td> - <td>' . $RequirementsRow['stockid'] . ' - ' . $RequirementsRow['description'] . '</td>'; + <td>' . $RequirementsRow['stockid'] . ' - ' . $RequirementsRow['description'] . '</td>'; } else { echo '<tr><td class="notavailable">' . _('Auto Issue') . '<td class="notavailable">' .$RequirementsRow['stockid'] . ' - ' . $RequirementsRow['description'] .'</td>'; } $IssuedAlreadyResult = DB_query("SELECT SUM(-qty) FROM stockmoves - WHERE stockmoves.type=28 - AND stockid='" . $RequirementsRow['stockid'] . "' - AND reference='" . $_POST['WO'] . "'", - $db); + WHERE stockmoves.type=28 + AND stockid='" . $RequirementsRow['stockid'] . "' + AND reference='" . $_POST['WO'] . "'", + $db); $IssuedAlreadyRow = DB_fetch_row($IssuedAlreadyResult); echo '<td class=number>' . number_format($WORow['qtyreqd']*$RequirementsRow['qtypu'],$RequirementsRow['decimalplaces']) . '</td> @@ -615,31 +623,31 @@ echo '<table class=selection><tr><td>' . _('Select a stock category') . ':<select name="StockCat">'; if (!isset($_POST['StockCat'])){ - echo "<option selected VALUE='All'>" . _('All') . '</option>'; + echo '<option selected value="All">' . _('All') . '</option>'; $_POST['StockCat'] ='All'; } else { - echo "<option VALUE='All'>" . _('All') . '</option>'; + echo '<option value="All">' . _('All') . '</option>'; } while ($myrow1 = DB_fetch_array($result1)) { if ($_POST['StockCat']==$myrow1['categoryid']){ - echo '<option selected VALUE=' . $myrow1['categoryid'] . '>' . $myrow1['categorydescription']; + echo '<option selected value=' . $myrow1['categoryid'] . '>' . $myrow1['categorydescription'] . '</option>'; } else { - echo '<option VALUE='. $myrow1['categoryid'] . '>' . $myrow1['categorydescription']; + echo '<option value='. $myrow1['categoryid'] . '>' . $myrow1['categorydescription'] . '</option>'; } } ?> </select> <td><?php echo _('Enter text extracts in the'); ?> <b><?php echo _('description'); ?></b>:</td> - <td><input type="Text" name="Keywords" size=20 maxlength=25 VALUE="<?php if (isset($_POST['Keywords'])) echo $_POST['Keywords']; ?>"></td></tr> + <td><input type="Text" name="Keywords" size=20 maxlength=25 value="<?php if (isset($_POST['Keywords'])) echo $_POST['Keywords']; ?>"></td></tr> <tr><td></td> <td><font SIZE 3><b><?php echo _('OR'); ?> </b></font><?php echo _('Enter extract of the'); ?> <b><?php echo _('Stock Code'); ?></b>:</td> - <td><input type="Text" name="StockCode" size="15" maxlength="18" VALUE="<?php if (isset($_POST['StockCode'])) echo $_POST['StockCode']; ?>"></td> + <td><input type="Text" name="StockCode" size="15" maxlength="18" value="<?php if (isset($_POST['StockCode'])) echo $_POST['StockCode']; ?>"></td> </tr> </table> - <br /><div class="centre"><input type=submit name="Search" VALUE="<?php echo _('Search Now'); ?>"> + <br /><div class="centre"><input type=submit name="Search" value="<?php echo _('Search Now'); ?>"> <script language='JavaScript' type='text/javascript'> @@ -668,7 +676,7 @@ if (!in_array($myrow['stockid'],$ItemCodes)){ if (function_exists('imagecreatefrompng') ){ - $ImageSource = '<IMG SRC="GetStockImage.php?SID&automake=1&textcolor=FFFFFF&bgcolor=CCCCCC&StockID=' . urlencode($myrow['stockid']). '&text=&width=64&height=64">'; + $ImageSource = '<IMG SRC="GetStockImage.php?automake=1&textcolor=FFFFFF&bgcolor=CCCCCC&StockID=' . urlencode($myrow['stockid']). '&text=&width=64&height=64">'; } else { if(file_exists($_SERVER['DOCUMENT_ROOT'] . $rootpath. '/' . $_SESSION['part_pics_dir'] . '/' . $myrow['stockid'] . '.jpg')) { $ImageSource = '<IMG SRC="' .$_SERVER['DOCUMENT_ROOT'] . $rootpath . '/' . $_SESSION['part_pics_dir'] . '/' . $myrow['stockid'] . '.jpg">'; @@ -685,7 +693,7 @@ $k=1; } - $IssueLink = $_SERVER['PHP_SELF'] . '?' . SID . '&WO=' . $_POST['WO'] . '&StockID=' . $_POST['StockID'] . '&IssueItem=' . $myrow['stockid'] . '&FromLocation=' . $_POST['FromLocation']; + $IssueLink = $_SERVER['PHP_SELF'] . '?WO=' . $_POST['WO'] . '&StockID=' . $_POST['StockID'] . '&IssueItem=' . $myrow['stockid'] . '&FromLocation=' . $_POST['FromLocation']; printf("<td><font size=1>%s</font></td> <td><font size=1>%s</font></td> <td><font size=1>%s</font></td> @@ -739,9 +747,9 @@ $SerialNoResult = DB_query("SELECT serialno - FROM stockserialitems - WHERE stockid='" . $_POST['IssueItem'] . "' - AND loccode='" . $_POST['FromLocation'] . "'", + FROM stockserialitems + WHERE stockid='" . $_POST['IssueItem'] . "' + AND loccode='" . $_POST['FromLocation'] . "'", $db,_('Could not retrieve the serial numbers available at the location specified because')); if (DB_num_rows($SerialNoResult)==0){ echo '<tr><td>' . _('There are no serial numbers at this location to issue') . '</td></tr>'; Modified: trunk/WorkOrderReceive.php =================================================================== --- trunk/WorkOrderReceive.php 2011-04-07 10:23:55 UTC (rev 4541) +++ trunk/WorkOrderReceive.php 2011-04-08 23:37:01 UTC (rev 4542) @@ -1,25 +1,23 @@ <?php /* $Id$*/ -//$PageSecurity = 11; - include('includes/session.inc'); $title = _('Receive Work Order'); include('includes/header.inc'); include('includes/SQL_CommonFunctions.inc'); -echo '<a href="'. $rootpath . '/SelectWorkOrder.php?' . SID . '">' . _('Back to Work Orders'). '</a><br>'; -echo '<a href="'. $rootpath . '/WorkOrderCosting.php?' . SID . '&WO=' . $_REQUEST['WO'] . '">' . _('Back to Costing'). '</a><br>'; +echo '<a href="'. $rootpath . '/SelectWorkOrder.php">' . _('Back to Work Orders'). '</a><br>'; +echo '<a href="'. $rootpath . '/WorkOrderCosting.php?WO=' . $_REQUEST['WO'] . '">' . _('Back to Costing'). '</a><br>'; echo '<p class="page_title_text"><img src="'.$rootpath.'/css/'.$theme.'/images/group_add.png" title="' . _('Search') . '" alt="" />' . ' ' . $title.'</p'; -echo '<form action="' . $_SERVER['PHP_SELF'] . '?' . SID . '" method=post>'; +echo '<form action="' . $_SERVER['PHP_SELF'] . '" method="post">'; echo '<input type="hidden" n... [truncated message content] |
From: <dai...@us...> - 2011-04-08 23:37:09
|
Revision: 4542 http://web-erp.svn.sourceforge.net/web-erp/?rev=4542&view=rev Author: daintree Date: 2011-04-08 23:37:01 +0000 (Fri, 08 Apr 2011) Log Message: ----------- SQL xhtml quoting Modified Paths: -------------- trunk/ReverseGRN.php trunk/WWW_Access.php trunk/WWW_Users.php trunk/WorkCentres.php trunk/WorkOrderEntry.php trunk/WorkOrderIssue.php trunk/WorkOrderReceive.php trunk/Z_CheckAllocationsFrom.php trunk/Z_CheckAllocs.php trunk/Z_CheckDebtorsControl.php trunk/Z_CheckGLTransBalance.php trunk/Z_CreateChartDetails.php Modified: trunk/ReverseGRN.php =================================================================== --- trunk/ReverseGRN.php 2011-04-07 10:23:55 UTC (rev 4541) +++ trunk/ReverseGRN.php 2011-04-08 23:37:01 UTC (rev 4542) @@ -18,7 +18,7 @@ $_POST['SupplierID']=$_SESSION['SupplierID']; } if (!isset($_POST['SupplierID']) OR $_POST['SupplierID']==""){ - echo '<br>' . _('This page is expected to be called after a supplier has been selected'); + echo '<br />' . _('This page is expected to be called after a supplier has been selected'); echo "<meta http-equiv='Refresh' content='0; url=" . $rootpath . '/SelectSupplier.php?' . SID . "'>"; exit; } elseif (!isset($_POST['SuppName']) or $_POST['SuppName']=="") { @@ -61,7 +61,7 @@ $QtyToReverse = $GRN['qtyrecd'] - $GRN['quantityinv']; if ($QtyToReverse ==0){ - echo '<br><br>' . _('The GRN') . ' ' . $_GET['GRNNo'] . ' ' . _('has already been reversed or fully invoiced by the supplier - it cannot be reversed - stock quantities must be corrected by stock adjustments - the stock is paid for'); + echo '<br /><br />' . _('The GRN') . ' ' . $_GET['GRNNo'] . ' ' . _('has already been reversed or fully invoiced by the supplier - it cannot be reversed - stock quantities must be corrected by stock adjustments - the stock is paid for'); include ('includes/footer.inc'); exit; } @@ -73,7 +73,7 @@ $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') . ' '); + $CheckControlledResult = DB_query($SQL,$db,'<br />' . _('Could not determine if the item was controlled or not because') . ' '); $ControlledRow = DB_fetch_row($CheckControlledResult); if ($ControlledRow[0]==1) { /*Then its a controlled item */ $Controlled = true; @@ -132,7 +132,7 @@ /*Now the purchorder header status in case it was completed - now incomplete - just printed */ $SQL = "UPDATE purchorders SET status = 'Printed', - stat_comment = CONCAT('" . Date($_SESSION['DefaultDateFormat']) . ' ' . _('GRN Reversed for') . ' ' . $GRN['itemdescription'] . ' ' . _('by') . ' ' . $_SESSION['UsersRealName'] . "<br>', stat_comment ) + stat_comment = CONCAT('" . Date($_SESSION['DefaultDateFormat']) . ' ' . _('GRN Reversed for') . ' ' . $GRN['itemdescription'] . ' ' . _('by') . ' ' . $_SESSION['UsersRealName'] . "<br />', stat_comment ) WHERE orderno = '" . $GRN['orderno'] . "'"; $ErrMsg = _('CRITICAL ERROR') . '! ' . _('NOTE DOWN THIS ERROR AND SEEK ASSISTANCE') . ': ' . _('The purchase order statusand status comment could not be changed because'); @@ -146,7 +146,7 @@ $ErrMsg = _('CRITICAL ERROR') . '! ' . _('NOTE DOWN THIS ERROR AND SEEK ASSISTANCE') . ': ' . _('The GRN record could not be deleted because'); $DbgMsg = _('The following SQL to delete the GRN record was used'); - $result = DB_query('DELETE FROM grns WHERE grnno="' . $_GET['GRNNo'] . '"',$db,$ErrMsg,$DbgMsg,true); + $result = DB_query("DELETE FROM grns WHERE grnno='" . $_GET['GRNNo'] . "'",$db,$ErrMsg,$DbgMsg,true); } else { $SQL = "UPDATE grns SET qtyrecd = qtyrecd - $QtyToReverse @@ -159,26 +159,26 @@ /*If the GRN being reversed is an asset - reverse the fixedassettrans record */ if ($GRN['assetid']!='0'){ $SQL = "INSERT INTO fixedassettrans (assetid, - transtype, - transno, - transdate, - periodno, - inputdate, - cost) - VALUES ('" . $GRN['assetid'] . "', - 25, - '" . $_GET['GRNNo'] . "', - '" . $GRN['deliverydate'] . "', - '" . $PeriodNo . "', - '" . Date('Y-m-d') . "', - '" . -$GRN['stdcostunit'] * $QtyToReverse . "')"; + transtype, + transno, + transdate, + periodno, + inputdate, + cost) + VALUES ('" . $GRN['assetid'] . "', + 25, + '" . $_GET['GRNNo'] . "', + '" . $GRN['deliverydate'] . "', + '" . $PeriodNo . "', + '" . Date('Y-m-d') . "', + '" . -$GRN['stdcostunit'] * $QtyToReverse . "')"; $ErrMsg = _('CRITICAL ERROR! NOTE DOWN THIS ERROR AND SEEK ASSISTANCE The fixed asset transaction could not be inserted because'); $DbgMsg = _('The following SQL to insert the fixed asset transaction record was used'); $Result = DB_query($SQL,$db,$ErrMsg, $DbgMsg, true); /*now reverse the cost put to fixedassets */ $SQL = "UPDATE fixedassets SET cost = cost - " . ($GRN['stdcostunit'] * $QtyToReverse) . " - WHERE assetid = '" . $GRN['assetid'] . "'"; + WHERE assetid = '" . $GRN['assetid'] . "'"; $ErrMsg = _('CRITICAL ERROR! NOTE DOWN THIS ERROR AND SEEK ASSISTANCE. The fixed asset cost addition could not be reversed:'); $DbgMsg = _('The following SQL was used to attempt the reduce the cost of the asset was:'); $Result = DB_query($SQL,$db,$ErrMsg, $DbgMsg, true); @@ -186,9 +186,9 @@ } //end of if it is an asset $SQL = "SELECT stockmaster.controlled - FROM stockmaster - WHERE stockmaster.stockid = '" . $GRN['itemcode'] . "'"; - $Result = DB_query($SQL, $db, _('Could not determine if the item exists because'),'<br>' . _('The SQL that failed was') . ' ',true); + FROM stockmaster + WHERE stockmaster.stockid = '" . $GRN['itemcode'] . "'"; + $Result = DB_query($SQL, $db, _('Could not determine if the item exists because'),'<br />' . _('The SQL that failed was') . ' ',true); if (DB_num_rows($Result)==1){ /* if the GRN is in fact a stock item being reversed */ @@ -222,28 +222,28 @@ /* If its a stock item .... Insert stock movements - with unit cost */ - $SQL = "INSERT INTO stockmoves ( stockid, - type, - transno, - loccode, - trandate, - prd, - reference, - qty, - standardcost, - newqoh) - VALUES ( - '" . $GRN['itemcode'] . "', - 25, - '" . $_GET['GRNNo'] . "', - '" . $GRN['intostocklocation'] . "', - '" . $GRN['deliverydate'] . "', - '" . $PeriodNo . "', - '" . _('Reversal') . ' - ' . $_POST['SupplierID'] . ' - ' . $GRN['orderno'] . "', - '" . -$QtyToReverse . "', - '" . $GRN['stdcostunit'] . "', - '" . ($QtyOnHandPrior - $QtyToReverse) . "' - )"; + $SQL = "INSERT INTO stockmoves ( stockid, + type, + transno, + loccode, + trandate, + prd, + reference, + qty, + standardcost, + newqoh) + VALUES ( + '" . $GRN['itemcode'] . "', + 25, + '" . $_GET['GRNNo'] . "', + '" . $GRN['intostocklocation'] . "', + '" . $GRN['deliverydate'] . "', + '" . $PeriodNo . "', + '" . _('Reversal') . ' - ' . $_POST['SupplierID'] . ' - ' . $GRN['orderno'] . "', + '" . -$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'); @@ -305,21 +305,21 @@ /*now the GRN suspense entry*/ $SQL = "INSERT INTO gltrans ( type, - typeno, - trandate, - periodno, - account, - narrative, - amount) - VALUES ( - 25, - '" . $_GET['GRNNo'] . "', - '" . $GRN['deliverydate'] . "', - '" . $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 . "' - )"; + typeno, + trandate, + periodno, + account, + narrative, + amount) + VALUES ( + 25, + '" . $_GET['GRNNo'] . "', + '" . $GRN['deliverydate'] . "', + '" . $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 . "' + )"; $ErrMsg = _('CRITICAL ERROR') . '! ' . _('NOTE DOWN THIS ERROR AND SEEK ASSISTANCE') . ': ' . _('The GRN suspense side of the GL posting could not be inserted because'); $DbgMsg = _('The following SQL to insert the GRN Suspense GLTrans record was used'); @@ -329,7 +329,7 @@ $Result = DB_Txn_Commit($db); - echo '<br>' . _('GRN number') . ' ' . $_GET['GRNNo'] . ' ' . _('for') . ' ' . $QtyToReverse . ' x ' . $GRN['itemcode'] . ' - ' . $GRN['itemdescription'] . ' ' . _('has been reversed') . '<br>'; + echo '<br />' . _('GRN number') . ' ' . $_GET['GRNNo'] . ' ' . _('for') . ' ' . $QtyToReverse . ' x ' . $GRN['itemcode'] . ' - ' . $GRN['itemdescription'] . ' ' . _('has been reversed') . '<br />'; unset($_GET['GRNNo']); // to ensure it cant be done again!! echo '<a href="' . $_SERVER['PHP_SELF'] . '?' . SID . '">' . _('Select another GRN to Reverse') . '</a>'; /*end of Process Goods Received Reversal entry */ @@ -367,7 +367,7 @@ $result = DB_query($sql,$db,$ErrMsg,$DbgMsg); if (DB_num_rows($result) ==0){ - 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'); + 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 '<br /><table cellpadding=2 colspan=7 class=selection>'; @@ -375,10 +375,10 @@ <th>' . _('GRN') . ' #</th> <th>' . _('Item Code') . '</th> <th>' . _('Description') . '</th> - <th>' . _('Date') . '<br>' . _('Received') . '</th> - <th>' . _('Quantity') . '<br>' . _('Received') . '</th> - <th>' . _('Quantity') . '<br>' . _('Invoiced') . '</th> - <th>' . _('Quantity To') . '<br>' . _('Reverse') . '</th> + <th>' . _('Date') . '<br />' . _('Received') . '</th> + <th>' . _('Quantity') . '<br />' . _('Received') . '</th> + <th>' . _('Quantity') . '<br />' . _('Invoiced') . '</th> + <th>' . _('Quantity To') . '<br />' . _('Reverse') . '</th> </tr>'; echo $TableHeader; Modified: trunk/WWW_Access.php =================================================================== --- trunk/WWW_Access.php 2011-04-07 10:23:55 UTC (rev 4541) +++ trunk/WWW_Access.php 2011-04-08 23:37:01 UTC (rev 4542) @@ -2,8 +2,6 @@ /* $Id$*/ -//$PageSecurity=15; - include('includes/session.inc'); $title = _('Access Permission Maintenance'); @@ -41,7 +39,7 @@ $ErrMsg = _('The update of the security role description failed because'); $ResMsg = _('The Security role description was updated.'); } else { // Add Security Heading - $sql = "INSERT INTO securityroles (secrolename) VALUES ('".$_POST['SecRoleName']."')"; + $sql = "INSERT INTO securityroles (secrolename) valueS ('".$_POST['SecRoleName']."')"; $ErrMsg = _('The update of the security role failed because'); $ResMsg = _('The Security role was created.'); } @@ -52,7 +50,7 @@ if( isset($_GET['add']) ) { // updating Security Groups add a page token $sql = "INSERT INTO securitygroups ( secroleid, tokenid - ) VALUES ( + ) valueS ( '".$SelectedRole."', '".$PageTokenId."' )"; @@ -70,7 +68,7 @@ unset($_GET['PageToken']); } // Need to exec the query - if (isset($sql) && $InputError != 1 ) { + if (isset($sql) AND $InputError != 1 ) { $result = DB_query($sql,$db,$ErrMsg); if( $result ) { prnMsg( $ResMsg,'success'); @@ -84,7 +82,7 @@ $myrow = DB_fetch_row($result); if ($myrow[0]>0) { prnMsg( _('Cannot delete this role because user accounts are setup using it'),'warn'); - echo '<br>' . _('There are') . ' ' . $myrow[0] . ' ' . _('user accounts that have this security role setting') . '</font>'; + echo '<br />' . _('There are') . ' ' . $myrow[0] . ' ' . _('user accounts that have this security role setting') . '</font>'; } else { $sql="DELETE FROM securitygroups WHERE secroleid='" . $_GET['SelectedRole'] . "'"; $result = DB_query($sql,$db); @@ -108,7 +106,7 @@ $result = DB_query($sql,$db); echo '<table class=selection>'; - echo "<tr><th>" . _('Role') . "</th></tr>"; + echo '<tr><th>' . _('Role') . '</th></tr>'; $k=0; //row colour counter @@ -128,9 +126,9 @@ <td><a href=\"%s&SelectedRole=%s&delete=1&SecRoleName=%s\">" . _('Delete') . "</a></td> </tr>", $myrow['secrolename'], - $_SERVER['PHP_SELF'] . "?" . SID, + $_SERVER['PHP_SELF'] . '?', $myrow['secroleid'], - $_SERVER['PHP_SELF'] . "?" . SID, + $_SERVER['PHP_SELF'] . '?', $myrow['secroleid'], urlencode($myrow['secrolename'])); @@ -140,7 +138,7 @@ if (isset($SelectedRole)) { - echo "<br /><div class='centre'><a href='" . $_SERVER['PHP_SELF'] ."?" . SID . "'>" . _('Review Existing Roles') . '</a></div>'; + echo '<br /><div class="centre"><a href="' . $_SERVER['PHP_SELF'] . '">' . _('Review Existing Roles') . '</a></div>'; } if (isset($SelectedRole)) { @@ -159,24 +157,24 @@ $_POST['SecRoleName'] = $myrow['secrolename']; } } -echo '<br>'; -echo "<form method='post' action=" . $_SERVER['PHP_SELF'] . "?" . SID . ">"; +echo '<br />'; +echo '<form method="post" action="' . $_SERVER['PHP_SELF'] . '">'; echo '<input type="hidden" name="FormID" value="' . $_SESSION['FormID'] . '" />'; if( isset($_POST['SelectedRole'])) { - echo "<input type=hidden name='SelectedRole' VALUE='" . $_POST['SelectedRole'] . "'>"; + echo '<input type="hidden" name="SelectedRole" value="' . $_POST['SelectedRole'] . '">'; } -echo '<table class=selection>'; +echo '<table class="selection">'; if (!isset($_POST['SecRoleName'])) { $_POST['SecRoleName']=''; } echo '<tr><td>' . _('Role') . ":</td> - <td><input type='text' name='SecRoleName' size=40 maxlength=40 VALUE='" . $_POST['SecRoleName'] . "'></tr>"; + <td><input type='text' name='SecRoleName' size=40 maxlength=40 value='" . $_POST['SecRoleName'] . "'></tr>"; echo "</table><br /> <div class='centre'><input type='Submit' name='submit' value='" . _('Enter Role') . "'></div></form>"; if (isset($SelectedRole)) { - $sql = 'SELECT tokenid, tokenname - FROM securitytokens'; + $sql = "SELECT tokenid, tokenname + FROM securitytokens"; $sqlUsed = "SELECT tokenid FROM securitygroups WHERE secroleid='". $SelectedRole . "'"; @@ -194,8 +192,8 @@ echo '<br /><table class=selection><tr>'; if (DB_num_rows($Result)>0 ) { - echo "<th colspan=3><div class='centre'>"._('Assigned Security Tokens')."</div></th>"; - echo "<th colspan=3><div class='centre'>"._('Available Security Tokens')."</div></th>"; + echo '<th colspan="3"><div class="centre">'._('Assigned Security Tokens').'</div></th>'; + echo '<th colspan=3><div class="centre">'._('Available Security Tokens').'</div></th>'; } echo '</tr>'; @@ -215,7 +213,7 @@ <td><a href=\"%s&SelectedRole=%s&remove=1&PageToken=%s\">" . _('Remove') . "</a></td><td> </td><td> </td><td> </td>", $AvailRow['tokenid'], $AvailRow['tokenname'], - $_SERVER['PHP_SELF'] . "?" . SID, + $_SERVER['PHP_SELF'] . '?', $SelectedRole, $AvailRow['tokenid'] ); @@ -228,7 +226,7 @@ <td><a href=\"%s&SelectedRole=%s&add=1&PageToken=%s\">" . _('Add') . "</a></td>", $AvailRow['tokenid'], $AvailRow['tokenname'], - $_SERVER['PHP_SELF'] . "?" . SID, + $_SERVER['PHP_SELF'] . '?', $SelectedRole, $AvailRow['tokenid'] ); Modified: trunk/WWW_Users.php =================================================================== --- trunk/WWW_Users.php 2011-04-07 10:23:55 UTC (rev 4541) +++ trunk/WWW_Users.php 2011-04-08 23:37:01 UTC (rev 4542) @@ -2,8 +2,6 @@ /* $Id$*/ -//$PageSecurity=15; - if (isset($_POST['UserID']) AND isset($_POST['ID'])){ if ($_POST['UserID'] == $_POST['ID']) { $_POST['Language'] = $_POST['UserLanguage']; @@ -33,9 +31,9 @@ echo '<p class="page_title_text"><img src="'.$rootpath.'/css/'.$theme.'/images/group_add.png" title="' . _('Search') . '" alt="" />' . ' ' . $title.'</p><br />'; // Make an array of the security roles -$sql = 'SELECT secroleid, +$sql = "SELECT secroleid, secrolename - FROM securityroles ORDER BY secroleid'; + FROM securityroles ORDER BY secroleid"; $Sec_Result = DB_query($sql, $db); $SecurityRoles = array(); // Now load it into an a ray using Key/Value pairs @@ -106,7 +104,7 @@ $i=0; $ModulesAllowed = ''; while ($i < count($ModuleList)){ - $FormVbl = "Module_" . $i; + $FormVbl = 'Module_' . $i; $ModulesAllowed .= $_POST[($FormVbl)] . ','; $i++; } @@ -219,7 +217,7 @@ prnMsg(_('The demonstration user called demo cannot be deleted'),'error'); } else { */ - $sql='SELECT userid FROM audittrail where userid="'. $SelectedUser .'"'; + $sql="SELECT userid FROM audittrail where userid='" . $SelectedUser ."'"; $result=DB_query($sql, $db); if (DB_num_rows($result)!=0) { prnMsg(_('Cannot delete user as entries already exist in the audit trail'), 'warn'); @@ -239,7 +237,7 @@ /* If its the first time the page has been displayed with no parameters then none of the above are true and the list of Users 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*/ - $sql = 'SELECT + $sql = "SELECT userid, realname, phone, @@ -253,24 +251,24 @@ pagesize, theme, language - FROM www_users'; + FROM www_users"; $result = DB_query($sql,$db); echo '<table class=selection>'; - echo "<tr><th>" . _('User Login') . "</th> - <th>" . _('Full Name') . "</th> - <th>" . _('Telephone') . "</th> - <th>" . _('Email') . "</th> - <th>" . _('Customer Code') . "</th> - <th>" . _('Branch Code') . "</th> - <th>" . _('Supplier Code') . "</th> - <th>" . _('Salesperson') . "</th> - <th>" . _('Last Visit') . "</th> - <th>" . _('Security Role') ."</th> - <th>" . _('Report Size') ."</th> - <th>" . _('Theme') ."</th> - <th>" . _('Language') ."</th> - </tr>"; + echo '<tr><th>' . _('User Login') . '</th> + <th>' . _('Full Name') . '</th> + <th>' . _('Telephone') . '</th> + <th>' . _('Email') . '</th> + <th>' . _('Customer Code') . '</th> + <th>' . _('Branch Code') . '</th> + <th>' . _('Supplier Code') . '</th> + <th>' . _('Salesperson') . '</th> + <th>' . _('Last Visit') . '</th> + <th>' . _('Security Role') .'</th> + <th>' . _('Report Size') .'</th> + <th>' . _('Theme') .'</th> + <th>' . _('Language') .'</th> + </tr>'; $k=0; //row colour counter @@ -320,21 +318,21 @@ $myrow[10], $myrow[11], $myrow[12], - $_SERVER['PHP_SELF'] . "?" . SID, + $_SERVER['PHP_SELF'] . '?', $myrow[0], - $_SERVER['PHP_SELF'] . "?" . SID, + $_SERVER['PHP_SELF'] . '?', $myrow[0]); } //END WHILE LIST LOOP - echo '</table><br>'; + echo '</table><br />'; } //end of ifs and buts! if (isset($SelectedUser)) { - echo "<div class='centre'><a href='" . $_SERVER['PHP_SELF'] ."?" . SID . "'>" . _('Review Existing Users') . '</a></div><br>'; + echo '<div class="centre"><a href="' . $_SERVER['PHP_SELF'] . '">' . _('Review Existing Users') . '</a></div><br />'; } -echo "<form method='post' action=" . $_SERVER['PHP_SELF'] . "?" . SID . ">"; +echo '<form method="post" action="' . $_SERVER['PHP_SELF'] . '">'; echo '<input type="hidden" name="FormID" value="' . $_SESSION['FormID'] . '" />'; if (isset($SelectedUser)) { @@ -380,16 +378,19 @@ $_POST['Blocked'] = $myrow['blocked']; $_POST['PDFLanguage'] = $myrow['pdflanguage']; - echo "<input type='hidden' name='SelectedUser' value='" . $SelectedUser . "'>"; - echo "<input type='hidden' name='UserID' value='" . $_POST['UserID'] . "'>"; - echo "<input type='hidden' name='ModulesAllowed' value='" . $_POST['ModulesAllowed'] . "'>"; + echo '<input type="hidden" name="SelectedUser" value="' . $SelectedUser . '">'; + echo '<input type="hidden" name="UserID" value="' . $_POST['UserID'] . '">'; + echo '<input type="hidden" name="ModulesAllowed" value="' . $_POST['ModulesAllowed'] . '">'; echo '<table class=selection> <tr><td>' . _('User code') . ':</td><td>'; echo $_POST['UserID'] . '</td></tr>'; } else { //end of if $SelectedUser only do the else when a new record is being entered - echo '<table class=selection><tr><td>' . _('User Login') . ":</td><td><input type='text' name='UserID' size=22 maxlength=20 ></td></tr>"; + echo '<table class=selection> + <tr> + <td>' . _('User Login') . ':</td> + <td><input type="text" name="UserID" size="22" maxlength="20"></td></tr>'; /*set the default modules to show to all this had trapped a few people previously*/ @@ -418,21 +419,21 @@ if (!isset($_POST['Email'])) { $_POST['Email']=''; } -echo '<tr><td>' . _('Password') . ":</td> - <td><input type='password' name='Password' size=22 maxlength=20 value='" . $_POST['Password'] . "'></tr>"; -echo '<tr><td>' . _('Full Name') . ":</td> - <td><input type='text' name='RealName' value='" . $_POST['RealName'] . "' size=36 maxlength=35></td></tr>"; -echo '<tr><td>' . _('Telephone No') . ":</td> - <td><input type='text' name='Phone' value='" . $_POST['Phone'] . "' size=32 maxlength=30></td></tr>"; -echo '<tr><td>' . _('Email Address') .":</td> - <td><input type='text' name='Email' value='" . $_POST['Email'] ."' size=32 maxlength=55></td></tr>"; -echo '<tr><td>' . _('Security Role') . ":</td><td><select name='Access'>"; +echo '<tr><td>' . _('Password') . ':</td> + <td><input type="password" name="Password" size="22" maxlength="20" value="' . $_POST['Password'] . '"></tr>'; +echo '<tr><td>' . _('Full Name') . ':</td> + <td><input type="text" name="RealName" value="' . $_POST['RealName'] . '" size="36" maxlength="35"></td></tr>'; +echo '<tr><td>' . _('Telephone No') . ':</td> + <td><input type="text" name="Phone" value="' . $_POST['Phone'] . '" size="32" maxlength="30"></td></tr>'; +echo '<tr><td>' . _('Email Address') .':</td> + <td><input type="text" name="Email" value="' . $_POST['Email'] .'" size="32" maxlength="55"></td></tr>'; +echo '<tr><td>' . _('Security Role') . ':</td><td><select name="Access">'; foreach ($SecurityRoles as $SecKey => $SecVal) { if (isset($_POST['Access']) and $SecKey == $_POST['Access']){ - echo "<option selected value=" . $SecKey . ">" . $SecVal; + echo '<option selected value="' . $SecKey . '">' . $SecVal .'</option>'; } else { - echo "<option value=" . $SecKey . ">" . $SecVal; + echo '<option value="' . $SecKey . '">' . $SecVal .'</option>'; } } echo '</select></td></tr>'; @@ -441,17 +442,17 @@ echo '<tr><td>' . _('Default Location') . ':</td> <td><select name="DefaultLocation">'; -$sql = 'SELECT loccode, locationname FROM locations'; +$sql = "SELECT loccode, locationname FROM locations"; $result = DB_query($sql,$db); while ($myrow=DB_fetch_array($result)){ if (isset($_POST['DefaultLocation']) and $myrow['loccode'] == $_POST['DefaultLocation']){ - echo "<option selected value='" . $myrow['loccode'] . "'>" . $myrow['locationname']; + echo '<option selected value="' . $myrow['loccode'] . '">' . $myrow['locationname'] .'</option>'; } else { - echo "<option Value='" . $myrow['loccode'] . "'>" . $myrow['locationname']; + echo '<option Value="' . $myrow['loccode'] . '">' . $myrow['locationname'] .'</option>'; } @@ -479,7 +480,7 @@ echo '<tr><td>' . _('Restrict to Sales Person') . ':</td> <td><select name="Salesman">'; -$sql = 'SELECT salesmancode, salesmanname FROM salesman'; +$sql = "SELECT salesmancode, salesmanname FROM salesman"; $result = DB_query($sql,$db); if ((isset($_POST['Salesman']) and $_POST['Salesman']=='') OR !isset($_POST['Salesman'])){ echo '<option selected value="">' . _('Not a salesperson only login') . '</option>'; @@ -499,69 +500,69 @@ echo '</select></td></tr>'; -echo '<tr><td>' . _('Reports Page Size') .":</td> - <td><select name='PageSize'>"; +echo '<tr><td>' . _('Reports Page Size') .':</td> + <td><select name="PageSize">'; if(isset($_POST['PageSize']) and $_POST['PageSize']=='A4'){ - echo "<option selected value='A4'>" . _('A4'); + echo '<option selected value="A4">' . _('A4') .'</option>'; } else { - echo "<option value='A4'>A4"; + echo '<option value="A4">' . _('A4') . '</option>'; } if(isset($_POST['PageSize']) and $_POST['PageSize']=='A3'){ - echo "<option selected Value='A3'>" . _('A3'); + echo '<option selected value="A3">' . _('A3') .'</option>'; } else { - echo "<option value='A3'>A3"; + echo '<option value="A3">' . _('A3') .'</option>'; } if(isset($_POST['PageSize']) and $_POST['PageSize']=='A3_landscape'){ - echo "<option selected Value='A3_landscape'>" . _('A3') . ' ' . _('landscape'); + echo '<option selected value="A3_landscape">' . _('A3') . ' ' . _('landscape') .'</option>'; } else { - echo "<option value='A3_landscape'>" . _('A3') . ' ' . _('landscape'); + echo '<option value="A3_landscape">' . _('A3') . ' ' . _('landscape') .'</option>'; } if(isset($_POST['PageSize']) and $_POST['PageSize']=='letter'){ - echo "<option selected Value='letter'>" . _('Letter'); + echo '<option selected value="letter">' . _('Letter') .'</option>'; } else { - echo "<option value='letter'>" . _('Letter'); + echo '<option value="letter">' . _('Letter') .'</option>'; } if(isset($_POST['PageSize']) and $_POST['PageSize']=='letter_landscape'){ - echo "<option selected Value='letter_landscape'>" . _('Letter') . ' ' . _('landscape'); + echo '<option selected value="letter_landscape">' . _('Letter') . ' ' . _('landscape') .'</option>'; } else { - echo "<option value='letter_landscape'>" . _('Letter') . ' ' . _('landscape'); + echo '<option value="letter_landscape">' . _('Letter') . ' ' . _('landscape') .'</option>'; } if(isset($_POST['PageSize']) and $_POST['PageSize']=='legal'){ - echo "<option selected value='legal'>" . _('Legal'); + echo '<option selected value="legal">' . _('Legal') .'</option>'; } else { - echo "<option Value='legal'>" . _('Legal'); + echo '<option value="legal">' . _('Legal') .'</option>'; } if(isset($_POST['PageSize']) and $_POST['PageSize']=='legal_landscape'){ - echo "<option selected value='legal_landscape'>" . _('Legal') . ' ' . _('landscape'); + echo '<option selected value="legal_landscape">' . _('Legal') . ' ' . _('landscape') .'</option>'; } else { - echo "<option value='legal_landscape'>" . _('Legal') . ' ' . _('landscape'); + echo '<option value="legal_landscape">' . _('Legal') . ' ' . _('landscape') .'</option>'; } echo '</select></td></tr>'; echo '<tr> - <td>' . _('Theme') . ":</td> - <td><select name='Theme'>"; + <td>' . _('Theme') . ':</td> + <td><select name="Theme">'; $ThemeDirectory = dir('css/'); while (false != ($ThemeName = $ThemeDirectory->read())){ - if (is_dir("css/$ThemeName") AND $ThemeName != '.' AND $ThemeName != '..' AND $ThemeName != '.svn'){ + if (is_dir('css/' . $ThemeName) AND $ThemeName != '.' AND $ThemeName != '..' AND $ThemeName != '.svn'){ if (isset($_POST['Theme']) and $_POST['Theme'] == $ThemeName){ - echo "<option selected value='$ThemeName'>$ThemeName"; + echo '<option selected value="' . $ThemeName . '">' . $ThemeName .'</option>'; } else if (!isset($_POST['Theme']) and ($_SESSION['DefaultTheme']==$ThemeName)) { - echo "<option selected value='$ThemeName'>$ThemeName"; + echo '<option selected value="' . $ThemeName . '">' . $ThemeName .'</option>'; } else { - echo "<option value='$ThemeName'>$ThemeName"; + echo '<option value="' . $ThemeName . '">' . $ThemeName .'</option>'; } } } @@ -570,8 +571,8 @@ echo '<tr> - <td>' . _('Language') . ":</td> - <td><select name='UserLanguage'>"; + <td>' . _('Language') . ':</td> + <td><select name="UserLanguage">'; $LangDirHandle = dir('locale/'); @@ -581,11 +582,11 @@ if (is_dir('locale/' . $LanguageEntry) AND $LanguageEntry != '..' AND $LanguageEntry != 'CVS' AND $LanguageEntry!='.'){ if (isset($_POST['UserLanguage']) and $_POST['UserLanguage'] == $LanguageEntry){ - echo "<option selected value='$LanguageEntry'>$LanguageEntry"; + echo '<option selected value="' . $LanguageEntry . '">' . $LanguageEntry .'</option>'; } elseif (!isset($_POST['UserLanguage']) and $LanguageEntry == $DefaultLanguage) { - echo "<option selected value='$LanguageEntry'>$LanguageEntry"; + echo '<option selected value="' . $LanguageEntry . '">' . $LanguageEntry .'</option>'; } else { - echo "<option value='$LanguageEntry'>$LanguageEntry"; + echo '<option value="' . $LanguageEntry . '">' . $LanguageEntry .'</option>'; } } } @@ -599,7 +600,7 @@ $i=0; foreach($ModuleList as $ModuleName){ - echo '<tr><td>' . _('Display') . ' ' . $ModuleName . ' ' . _('options') . ": </td><td><select name='Module_" . $i . "'>"; + echo '<tr><td>' . _('Display') . ' ' . $ModuleName . ' ' . _('options') . ': </td><td><select name="Module_' . $i . '">'; if ($ModulesAllowed[$i]==0){ echo '<option selected value=0>' . _('No') . '</option>'; echo '<option value=1>' . _('Yes') . '</option>'; @@ -624,7 +625,7 @@ } echo '</select></td></tr>'; -echo '<tr><td>' . _('Account Status') . ":</td><td><select name='Blocked'>"; +echo '<tr><td>' . _('Account Status') . ':</td><td><select name="Blocked">'; if ($_POST['Blocked']==0){ echo '<option selected value=0>' . _('Open'); echo '<option value=1>' . _('Blocked'); @@ -634,7 +635,7 @@ } echo '</select></td></tr>'; -echo '</table><br> +echo '</table><br /> <div class="centre"><input type="submit" name="submit" value="' . _('Enter Information') . '"></div> </form>'; Modified: trunk/WorkCentres.php =================================================================== --- trunk/WorkCentres.php 2011-04-07 10:23:55 UTC (rev 4541) +++ trunk/WorkCentres.php 2011-04-08 23:37:01 UTC (rev 4542) @@ -1,7 +1,6 @@ <?php /* $Id$*/ -//$PageSecurity=9; include('includes/session.inc'); $title = _('Work Centres'); @@ -31,7 +30,7 @@ $InputError = 1; prnMsg(_('The Work Centre description must be at least 3 characters long'),'error'); } - if (strstr($_POST['Code'],' ') OR strstr($_POST['Code'],"'") OR strstr($_POST['Code'],'+') OR strstr($_POST['Code'],"\\") OR strstr($_POST['Code'],"\"") OR strstr($_POST['Code'],'&') OR strstr($_POST['Code'],'.') OR strstr($_POST['Code'],'"')) { + if (strstr($_POST['Code'],' ') OR ContainsIllegalCharacters($_POST['Code']) ) { $InputError = 1; prnMsg(_('The work centre code cannot contain any of the following characters') . " - ' & + \" \\ " . _('or a space'),'error'); } @@ -110,23 +109,23 @@ or deletion of the records*/ echo '<p class="page_title_text"><img src="'.$rootpath.'/css/'.$theme.'/images/maintenance.png" title="' . _('Search') . '" alt="" />' . ' ' . $title . '</p>'; - $sql = 'SELECT workcentres.code, - workcentres.description, - locations.locationname, - workcentres.overheadrecoveryact, - workcentres.overheadperhour - FROM workcentres, - locations - WHERE workcentres.location = locations.loccode'; + $sql = "SELECT workcentres.code, + workcentres.description, + locations.locationname, + workcentres.overheadrecoveryact, + workcentres.overheadperhour + FROM workcentres, + locations + WHERE workcentres.location = locations.loccode"; $result = DB_query($sql,$db); - echo "<table class=selection> - <tr bgcolor =#800000><th>" . _('WC Code') . "</th> - <th>" . _('Description') . "</th> - <th>" . _('Location') . "</th> - <th>" . _('Overhead GL Account') . "</th> - <th>" . _('Overhead Per Hour') . "</th> - </tr></font>"; + echo '<table class="selection"> + <tr bgcolor ="#800000"><th>' . _('WC Code') . '</th> + <th>' . _('Description') . '</th> + <th>' . _('Location') . '</th> + <th>' . _('Overhead GL Account') . '</th> + <th>' . _('Overhead Per Hour') . '</th> + </tr>'; while ($myrow = DB_fetch_row($result)) { @@ -143,8 +142,8 @@ $myrow[2], $myrow[3], $myrow[4], - $_SERVER['PHP_SELF'] . '?' . SID, - $myrow[0], $_SERVER['PHP_SELF'] . '?' . SID, + $_SERVER['PHP_SELF'] . '?', + $myrow[0], $_SERVER['PHP_SELF'] . '?', $myrow[0]); } @@ -156,10 +155,10 @@ if (isset($SelectedWC)) { echo '<p class="page_title_text"><img src="'.$rootpath.'/css/'.$theme.'/images/maintenance.png" title="' . _('Search') . '" alt="" />' . ' ' . $title . '</p>'; - echo "<div class='centre'><a href='" . $_SERVER['PHP_SELF'] . '?' . SID . "'>" . _('Show all Work Centres') . '</a></div>'; + echo '<div class="centre"><a href="' . $_SERVER['PHP_SELF'] . '">' . _('Show all Work Centres') . '</a></div>'; } -echo "<p><form method='post' action='" . $_SERVER['PHP_SELF'] . '?' . SID . "'>"; +echo '<p><form method="post" action="' . $_SERVER['PHP_SELF'] . '">'; echo '<input type="hidden" name="FormID" value="' . $_SESSION['FormID'] . '" />'; if (isset($SelectedWC)) { @@ -182,41 +181,42 @@ $_POST['OverheadRecoveryAct'] = $myrow['overheadrecoveryact']; $_POST['OverheadPerHour'] = $myrow['overheadperhour']; - echo '<input type=hidden name="SelectedWC" value=' . $SelectedWC . '>'; - echo '<input type=hidden name="Code" value="' . $_POST['Code'] . '">'; - echo '<table class=selection><tr><td>' ._('Work Centre Code') . ':</td><td>' . $_POST['Code'] . '</td></tr>'; + echo '<input type="hidden" name="SelectedWC" value=' . $SelectedWC . '>'; + echo '<input type="hidden" name="Code" value="' . $_POST['Code'] . '">'; + echo '<table class="selection"><tr><td>' ._('Work Centre Code') . ':</td> + <td>' . $_POST['Code'] . '</td></tr>'; } else { //end of if $SelectedWC only do the else when a new record is being entered if (!isset($_POST['Code'])) { $_POST['Code'] = ''; } - echo '<table class=selection><tr> - <td>' . _('Work Centre Code') . ":</td> - <td><input type='Text' name='Code' size=6 maxlength=5 value='" . $_POST['Code'] . "'></td> - </tr>"; + echo '<table class="selection"><tr> + <td>' . _('Work Centre Code') . ':</td> + <td><input type="Text" name="Code" size="6" maxlength="5" value="' . $_POST['Code'] . '"></td> + </tr>'; } -$SQL = 'SELECT locationname, +$SQL = "SELECT locationname, loccode - FROM locations'; + FROM locations"; $result = DB_query($SQL,$db); if (!isset($_POST['Description'])) { $_POST['Description'] = ''; } -echo '<tr><td>' . _('Work Centre Description') . ":</td> - <td><input type='Text' name='Description' size=21 maxlength=20 value='" . $_POST['Description'] . "'></td> +echo '<tr><td>' . _('Work Centre Description') . ':</td> + <td><input type="Text" name="Description" size="21" maxlength="20" value="' . $_POST['Description'] . '"></td> </tr> - <tr><td>" . _('Location') . ":</td> - <td><select name='Location'>"; + <tr><td>' . _('Location') . ':</td> + <td><select name="Location">'; while ($myrow = DB_fetch_array($result)) { if (isset($_POST['Location']) and $myrow['loccode']==$_POST['Location']) { - echo "<option selected VALUE='"; + echo '<option selected value="'; } else { - echo "<option VALUE='"; + echo '<option VALUE="'; } - echo $myrow['loccode'] . "'>" . $myrow['locationname']; + echo $myrow['loccode'] . '">' . $myrow['locationname'] . '</option>'; } //end while loop @@ -224,26 +224,26 @@ echo '</select></td></tr> - <tr><td>' . _('Overhead Recovery GL Account') . ":</td> - <td><select name='OverheadRecoveryAct'>"; + <tr><td>' . _('Overhead Recovery GL Account') . ':</td> + <td><select name="OverheadRecoveryAct">'; //SQL to poulate account selection boxes -$SQL = 'SELECT accountcode, - accountname - FROM chartmaster INNER JOIN accountgroups - ON chartmaster.group_=accountgroups.groupname - WHERE accountgroups.pandl!=0 - ORDER BY accountcode'; +$SQL = "SELECT accountcode, + accountname + FROM chartmaster INNER JOIN accountgroups + ON chartmaster.group_=accountgroups.groupname + WHERE accountgroups.pandl!=0 + ORDER BY accountcode"; $result = DB_query($SQL,$db); while ($myrow = DB_fetch_array($result)) { if (isset($_POST['OverheadRecoveryAct']) and $myrow['accountcode']==$_POST['OverheadRecoveryAct']) { - echo '<option selected VALUE='; + echo '<option selected value='; } else { - echo '<option VALUE='; + echo '<option value='; } - echo $myrow['accountcode'] . '>' . $myrow['accountname']; + echo $myrow['accountcode'] . '>' . $myrow['accountname'] . '</option>'; } //end while loop DB_free_result($result); Modified: trunk/WorkOrderEntry.php =================================================================== --- trunk/WorkOrderEntry.php 2011-04-07 10:23:55 UTC (rev 4541) +++ trunk/WorkOrderEntry.php 2011-04-08 23:37:01 UTC (rev 4542) @@ -207,10 +207,10 @@ if ($InputError==false){ $CostResult = DB_query("SELECT SUM((materialcost+labourcost+overheadcost)*bom.quantity) AS cost - FROM stockmaster INNER JOIN bom - ON stockmaster.stockid=bom.component - WHERE bom.parent='" . $NewItem . "' - AND bom.loccode='" . $_POST['StockLocation'] . "'", + FROM stockmaster INNER JOIN bom + ON stockmaster.stockid=bom.component + WHERE bom.parent='" . $NewItem . "' + AND bom.loccode='" . $_POST['StockLocation'] . "'", $db); $CostRow = DB_fetch_row($CostResult); if (is_null($CostRow[0]) OR $CostRow[0]==0){ @@ -299,10 +299,10 @@ if ($_POST['RecdQty'.$i]==0 AND (!isset($_POST['HasWOSerialNos'.$i]) or $_POST['HasWOSerialNos'.$i]==false)){ /* can only change location cost if QtyRecd=0 */ $CostResult = DB_query("SELECT SUM((materialcost+labourcost+overheadcost)*bom.quantity) AS cost - FROM stockmaster INNER JOIN bom - ON stockmaster.stockid=bom.component - WHERE bom.parent='" . $_POST['OutputItem'.$i] . "' - AND bom.loccode='" . $_POST['StockLocation'] . "'", + FROM stockmaster INNER JOIN bom + ON stockmaster.stockid=bom.component + WHERE bom.parent='" . $_POST['OutputItem'.$i] . "' + AND bom.loccode='" . $_POST['StockLocation'] . "'", $db); $CostRow = DB_fetch_row($CostResult); if (is_null($CostRow[0])){ @@ -350,7 +350,7 @@ // can't delete it there are open work issues $HasTransResult = DB_query("SELECT * FROM stockmoves WHERE (stockmoves.type= 26 OR stockmoves.type=28) - AND reference LIKE '%" . $_POST['WO'] . "%'",$db); + AND reference " . LIKE . " '%" . $_POST['WO'] . "%'",$db); if (DB_num_rows($HasTransResult)>0){ prnMsg(_('This work order cannot be deleted because it has issues or receipts related to it'),'error'); $CancelDelete=true; @@ -377,7 +377,7 @@ prnMsg(_('The work order has been deleted'),'success'); - echo "<p><a href='" . $rootpath . "/SelectWorkOrder.php?" . SID . "'>" . _('Select an existing outstanding work order') . "</a>"; + echo '<p><a href="' . $rootpath . '/SelectWorkOrder.php">' . _('Select an existing outstanding work order') . '</a>'; unset($_POST['WO']); for ($i=1;$i<=$_POST['NumberOfOutputs'];$i++){ unset($_POST['OutputItem'.$i]); @@ -394,7 +394,7 @@ echo '<form method="post" action="' . $_SERVER['PHP_SELF'] . '" name="form">'; echo '<input type="hidden" name="FormID" value="' . $_SESSION['FormID'] . '" />'; -echo '<br><table class=selection>'; +echo '<br /><table class="selection">'; $sql="SELECT workorders.loccode, requiredby, @@ -441,7 +441,7 @@ } $_POST['Controlled'.$i] =$WOItem['controlled']; $_POST['Serialised'.$i] =$WOItem['serialised']; - $HasWOSerialNosResult = DB_query('SELECT * FROM woserialnos WHERE wo=' . $_POST['WO'],$db); + $HasWOSerialNosResult = DB_query("SELECT * FROM woserialnos WHERE wo='" . $_POST['WO'] . "'",$db); if (DB_num_rows($HasWOSerialNosResult)>0){ $_POST['HasWOSerialNos']=true; } else { @@ -455,7 +455,7 @@ echo '<tr><td class="label">' . _('Work Order Reference') . ':</td><td>' . $_POST['WO'] . '</td></tr>'; echo '<tr><td class="label">' . _('Factory Location') .':</td> <td><select name="StockLocation">'; -$LocResult = DB_query('SELECT loccode,locationname FROM locations',$db); +$LocResult = DB_query("SELECT loccode,locationname FROM locations",$db); while ($LocRow = DB_fetch_array($LocResult)){ if ($_POST['StockLocation']==$LocRow['loccode']){ echo '<option selected value="' . $LocRow['loccode'] .'">' . $LocRow['locationname'] . '</option>'; @@ -521,7 +521,7 @@ } else { $LotOrSN = _('Batches'); } - echo '<td><a href="' . $rootpath . '/WOSerialNos.php?' . SID . '&WO=' . $_POST['WO'] . '&StockID=' . $_POST['OutputItem' .$i] . '&Description=' . $_POST['OutputItemDesc' .$i] . '&Serialised=' . $_POST['Serialised' .$i] . '&NextSerialNo=' . $_POST['NextLotSNRef' .$i] . '">' . $LotOrSN . '</a></td>'; + echo '<td><a href="' . $rootpath . '/WOSerialNos.php?WO=' . $_POST['WO'] . '&StockID=' . $_POST['OutputItem' .$i] . '&Description=' . $_POST['OutputItemDesc' .$i] . '&Serialised=' . $_POST['Serialised' .$i] . '&NextSerialNo=' . $_POST['NextLotSNRef' .$i] . '">' . $LotOrSN . '</a></td>'; } } echo '<td>'; @@ -558,31 +558,31 @@ echo '<table class=selection><tr><td>' . _('Select a stock category') . ':<select name="StockCat">'; if (!isset($_POST['StockCat'])){ - echo '<option selected VALUE="All">' . _('All'); + echo '<option selected VALUE="All">' . _('All') . '</option>'; $_POST['StockCat'] ='All'; } else { - echo '<option VALUE="All">' . _('All'); + echo '<option VALUE="All">' . _('All') . '</option>'; } while ($myrow1 = DB_fetch_array($result1)) { if ($_POST['StockCat']==$myrow1['categoryid']){ - echo '<option selected VALUE=' . $myrow1['categoryid'] . '>' . $myrow1['categorydescription']; + echo '<option selected value=' . $myrow1['categoryid'] . '>' . $myrow1['categorydescription'] . '</option>'; } else { - echo '<option VALUE='. $myrow1['categoryid'] . '>' . $myrow1['categorydescription']; + echo '<option value='. $myrow1['categoryid'] . '>' . $myrow1['categorydescription'] . '</option>'; } } ?> </select> <td><?php echo _('Enter text extracts in the'); ?> <b><?php echo _('description'); ?></b>:</td> -<td><input type="Text" name="Keywords" size=20 maxlength=25 VALUE="<?php if (isset($_POST['Keywords'])) echo $_POST['Keywords']; ?>"></td></tr> +<td><input type="Text" name="Keywords" size=20 maxlength=25 value="<?php if (isset($_POST['Keywords'])) echo $_POST['Keywords']; ?>"></td></tr> <tr><td></td> <td><font SIZE 3><b><?php echo _('OR'); ?> </b></font><?php echo _('Enter extract of the'); ?> <b><?php echo _('Stock Code'); ?></b>:</td> - <td><input type="Text" name="StockCode" size=15 maxlength=18 VALUE="<?php if (isset($_POST['StockCode'])) echo $_POST['StockCode']; ?>"></td> + <td><input type="Text" name="StockCode" size=15 maxlength=18 value="<?php if (isset($_POST['StockCode'])) echo $_POST['StockCode']; ?>"></td> </tr> </table> - <br /><div class="centre"><input type=submit name="Search" VALUE="<?php echo _('Search Now'); ?>"> + <br /><div class="centre"><input type=submit name="Search" value="<?php echo _('Search Now'); ?>"> <?php @@ -636,7 +636,7 @@ $myrow['description'], $myrow['units'], $ImageSource, - $_SERVER['PHP_SELF'] . '?' . SID . 'WO=' . $_POST['WO'] . '&NewItem=' . $myrow['stockid'].'&Line='.$i); + $_SERVER['PHP_SELF'] . '?WO=' . $_POST['WO'] . '&NewItem=' . $myrow['stockid'].'&Line='.$i); $j++; If ($j == 25){ Modified: trunk/WorkOrderIssue.php =================================================================== --- trunk/WorkOrderIssue.php 2011-04-07 10:23:55 UTC (rev 4541) +++ trunk/WorkOrderIssue.php 2011-04-08 23:37:01 UTC (rev 4542) @@ -1,8 +1,6 @@ <?php /* $Id$*/ -//$PageSecurity = 11; - include('includes/session.inc'); $title = _('Issue Materials To Work Order'); include('includes/header.inc'); @@ -15,19 +13,19 @@ $_POST['StockID']=$_GET['StockID']; } -echo '<a href="'. $rootpath . '/SelectWorkOrder.php?' . SID . '">' . _('Back to Work Orders'). '</a><br>'; -echo '<a href="'. $rootpath . '/WorkOrderCosting.php?' . SID . '&WO=' . $_POST['WO'] . '">' . _('Back to Costing'). '</a><br>'; +echo '<a href="'. $rootpath . '/SelectWorkOrder.php">' . _('Back to Work Orders'). '</a><br />'; +echo '<a href="'. $rootpath . '/WorkOrderCosting.php?WO=' . $_POST['WO'] . '">' . _('Back to Costing'). '</a><br />'; echo '<p class="page_title_text"><img src="'.$rootpath.'/css/'.$theme.'/images/group_add.png" title="' . _('Search') . '" alt="" />' . ' ' . $title.'</p'; -echo '<form action="' . $_SERVER['PHP_SELF'] . '?' . SID . '" method=post>'; +echo '<form action="' . $_SERVER['PHP_SELF'] . '" method=post>'; echo '<input type="hidden" name="FormID" value="' . $_SESSION['FormID'] . '" />'; if (!isset($_POST['WO']) OR !isset($_POST['StockID'])) { /* This page can only be called with a work order number for issuing stock to*/ - echo '<div class="centre"><a href="' . $rootpath . '/SelectWorkOrder.php?' . SID . '">'. + echo '<div class="centre"><a href="' . $rootpath . '/SelectWorkOrder.php">'. _('Select a work order to issue materials to').'</a></div>'; prnMsg(_('This page can only be opened if a work order has been selected. Please select a work order to issue materials to first'),'info'); include ('includes/footer.inc'); @@ -344,16 +342,16 @@ $ErrMsg = _('CRITICAL ERROR') . '! ' . _('NOTE DOWN THIS ERROR AND SEEK ASSISTANCE') . ': ' ._('Could not update the work order cost issued to the work order because'); $DbgMsg = _('The following SQL was used to update the work order'); $UpdateWOResult =DB_query("UPDATE workorders - SET costissued=costissued+" . ($QuantityIssued*$IssueItemRow['cost']) . " - WHERE wo='" . $_POST['WO'] . "'", - $db,$ErrMsg,$DbgMsg,true); + SET costissued=costissued+" . ($QuantityIssued*$IssueItemRow['cost']) . " + WHERE wo='" . $_POST['WO'] . "'", + $db,$ErrMsg,$DbgMsg,true); $Result = DB_Txn_Commit($db); prnMsg(_('The issue of') . ' ' . $QuantityIssued . ' ' . _('of') . ' ' . $_POST['IssueItem'] . ' ' . _('against work order') . ' '. $_POST['WO'] . ' ' . _('has been processed'),'info'); - echo '<p><ul><li><a href="' . $rootpath . '/WorkOrderIssue.php?' . SID . '&WO=' . $_POST['WO'] . '&StockID=' . $_POST['StockID'] . '">' . _('Issue more components to this work order') . '</a></li>'; - echo '<li><a href="' . $rootpath . '/SelectWorkOrder.php?' . SID . '">' . _('Select a different work order for issuing materials and components against'). '</a></li></ul>'; + echo '<p><ul><li><a href="' . $rootpath . '/WorkOrderIssue.php?WO=' . $_POST['WO'] . '&StockID=' . $_POST['StockID'] . '">' . _('Issue more components to this work order') . '</a></li>'; + echo '<li><a href="' . $rootpath . '/SelectWorkOrder.php">' . _('Select a different work order for issuing materials and components against'). '</a></li></ul>'; unset($_POST['WO']); unset($_POST['StockID']); unset($_POST['IssueItem']); @@ -474,7 +472,7 @@ prnMsg (_('There are no products available meeting the criteria specified'),'info'); if ($debug==1){ - prnMsg(_('The SQL statement used was') . ':<br>' . $SQL,'info'); + prnMsg(_('The SQL statement used was') . ':<br />' . $SQL,'info'); } } if (DB_num_rows($SearchResult)==1){ @@ -490,25 +488,25 @@ $ErrMsg = _('Could not retrieve the details of the selected work order item'); $WOResult = DB_query("SELECT workorders.loccode, - locations.locationname, - workorders.requiredby, - workorders.startdate, - workorders.closed, - stockmaster.description, - stockmaster.decimalplaces, - stockmaster.units, - woitems.qtyreqd, - woitems.qtyrecd - FROM workorders INNER JOIN locations - ON workorders.loccode=locations.loccode - INNER JOIN woitems - ON workorders.wo=woitems.wo - INNER JOIN stockmaster - ON woitems.stockid=stockmaster.stockid - WHERE woitems.stockid='" . $_POST['StockID'] . "' - AND woitems.wo ='" . $_POST['WO'] . "'", - $db, - $ErrMsg); + locations.locationname, + workorders.requiredby, + workorders.startdate, + workorders.closed, + stockmaster.description, + stockmaster.decimalplaces, + stockmaster.units, + woitems.qtyreqd, + woitems.qtyrecd + FROM workorders INNER JOIN locations + ON workorders.loccode=locations.loccode + INNER JOIN woitems + ON workorders.wo=woitems.wo + INNER JOIN stockmaster + ON woitems.stockid=stockmaster.stockid + WHERE woitems.stockid='" . $_POST['StockID'] . "' + AND woitems.wo ='" . $_POST['WO'] . "'", + $db, + $ErrMsg); if (DB_num_rows($WOResult)==0){ prnMsg(_('The selected work order item cannot be retrieved from the database'),'info'); @@ -527,30 +525,40 @@ $_POST['IssuedDate'] = Date($_SESSION['DefaultDateFormat']); } echo '<table cellpadding=2 class=selection> - <tr><td class="label">' . _('Issue to work order') . ':</td><td>' . $_POST['WO'] .'</td><td class="label">' . _('Item') . ':</td><td>' . $_POST['StockID'] . ' - ' . $WORow['description'] . '</td></tr> - <tr><td class="label">' . _('Manufactured at') . ':</td><td>' . $WORow['locationname'] . '</td><td class="label">' . _('Required By') . ':</td><td>' . ConvertSQLDate($WORow['requiredby']) . '</td></tr> - <tr><td class="label">' . _('Quantity Ordered') . ':</td><td class=number>' . number_format($WORow['qtyreqd'],$WORow['decimalplaces']) . '</td><td colspan=2>' . $WORow['units'] . '</td></tr> - <tr><td class="label">' . _('Already Received') . ':</td><td class=number>' . number_format($WORow['qtyrecd'],$WORow['decimalplaces']) . '</td><td colspan=2>' . $WORow['units'] . '</td></tr> + <tr><td class="label">' . _('Issue to work order') . ':</td> + <td>' . $_POST['WO'] .'</td><td class="label">' . _('Item') . ':</td> + <td>' . $_POST['StockID'] . ' - ' . $WORow['description'] . '</td> + </tr> + <tr><td class="label">' . _('Manufactured at') . ':</td> + <td>' . $WORow['locationname'] . '</td><td class="label">' . _('Required By') . ':</td> + <td>' . ConvertSQLDate($WORow['requiredby']) . '</td> + </tr> + <tr><td class="label">' . _('Quantity Ordered') . ':</td> + <td class="number">' . number_format($WORow['qtyreqd'],$WORow['decimalplaces']) . '</td> + <td colspan="2">' . $WORow['units'] . '</td> + </tr> + <tr><td class="label">' . _('Already Received') . ':</td> + <td class="number">' . number_format($WORow['qtyrecd'],$WORow['decimalplaces']) . '</td> + <td colspan="2">' . $WORow['units'] . '</td></tr> <tr><td colspan=4></td></tr> - <tr><td class="label">' . _('Date Material Issued') . ':</td><td><input type=text name=issuedate value=' - . Date($_SESSION['DefaultDateFormat']) . ' class=date size=10 alt="'.$_SESSION['DefaultDateFormat'].'" ></td> - <td class="label">' . _('Issued From') . ':</td><td>'; + <tr><td class="label">' . _('Date Material Issued') . ':</td> + <td><input type=text name=issuedate value=' . Date($_SESSION['DefaultDateFormat']) . ' class=date size=10 alt="'.$_SESSION['DefaultDateFormat'].'" ></td> + <td class="label">' . _('Issued From') . ':</td><td>'; if (!isset($_POST['IssueItem'])){ - $LocResult = DB_query('SELECT loccode, locationname FROM locations',$db); + $LocResult = DB_query("SELECT loccode, locationname FROM locations",$db); echo '<select name="FromLocation">'; - if (!isset($_POST['FromLocation'])){ $_POST['FromLocation']=$WORow['loccode']; } while ($LocRow = DB_fetch_array($LocResult)){ if ($_POST['FromLocation'] ==$LocRow['loccode']){ - echo '<option selected value="' . $LocRow['loccode'] .'">' . $LocRow['locationname']; + echo '<option selected value="' . $LocRow['loccode'] .'">' . $LocRow['locationname'] . '</option>'; } else { - echo '<option value="' . $LocRow['loccode'] .'">' . $LocRow['locationname']; + echo '<option value="' . $LocRow['loccode'] .'">' . $LocRow['locationname'] . '</option>'; } } echo '</select>'; @@ -576,27 +584,27 @@ <th>' . _('Qty Issued') . '</th></tr>'; $RequirmentsResult = DB_query("SELECT worequirements.stockid, - stockmaster.description, - stockmaster.decimalplaces, - autoissue, - qtypu - FROM worequirements INNER JOIN stockmaster - ON worequirements.stockid=stockmaster.stockid - WHERE wo='" . $_POST['WO'] . "'", - $db); + stockmaster.description, + stockmaster.decimalplaces, + autoissue, + qtypu + FROM worequirements INNER JOIN stockmaster + ON worequirements.stockid=stockmaster.stockid + WHERE wo='" . $_POST['WO'] . "'", + $db); while ($RequirementsRow = DB_fetch_array($RequirmentsResult)){ if ($RequirementsRow['autoissue']==0){ echo '<tr><td><input type="submit" name="IssueItem" value="' .$RequirementsRow['stockid'] . '"></td> - <td>' . $RequirementsRow['stockid'] . ' - ' . $RequirementsRow['description'] . '</td>'; + <td>' . $RequirementsRow['stockid'] . ' - ' . $RequirementsRow['description'] . '</td>'; } else { echo '<tr><td class="notavailable">' . _('Auto Issue') . '<td class="notavailable">' .$RequirementsRow['stockid'] . ' - ' . $RequirementsRow['description'] .'</td>'; } $IssuedAlreadyResult = DB_query("SELECT SUM(-qty) FROM stockmoves - WHERE stockmoves.type=28 - AND stockid='" . $RequirementsRow['stockid'] . "' - AND reference='" . $_POST['WO'] . "'", - $db); + WHERE stockmoves.type=28 + AND stockid='" . $RequirementsRow['stockid'] . "' + AND reference='" . $_POST['WO'] . "'", + $db); $IssuedAlreadyRow = DB_fetch_row($IssuedAlreadyResult); echo '<td class=number>' . number_format($WORow['qtyreqd']*$RequirementsRow['qtypu'],$RequirementsRow['decimalplaces']) . '</td> @@ -615,31 +623,31 @@ echo '<table class=selection><tr><td>' . _('Select a stock category') . ':<select name="StockCat">'; if (!isset($_POST['StockCat'])){ - echo "<option selected VALUE='All'>" . _('All') . '</option>'; + echo '<option selected value="All">' . _('All') . '</option>'; $_POST['StockCat'] ='All'; } else { - echo "<option VALUE='All'>" . _('All') . '</option>'; + echo '<option value="All">' . _('All') . '</option>'; } while ($myrow1 = DB_fetch_array($result1)) { if ($_POST['StockCat']==$myrow1['categoryid']){ - echo '<option selected VALUE=' . $myrow1['categoryid'] . '>' . $myrow1['categorydescription']; + echo '<option selected value=' . $myrow1['categoryid'] . '>' . $myrow1['categorydescription'] . '</option>'; } else { - echo '<option VALUE='. $myrow1['categoryid'] . '>' . $myrow1['categorydescription']; + echo '<option value='. $myrow1['categoryid'] . '>' . $myrow1['categorydescription'] . '</option>'; } } ?> </select> <td><?php echo _('Enter text extracts in the'); ?> <b><?php echo _('description'); ?></b>:</td> - <td><input type="Text" name="Keywords" size=20 maxlength=25 VALUE="<?php if (isset($_POST['Keywords'])) echo $_POST['Keywords']; ?>"></td></tr> + <td><input type="Text" name="Keywords" size=20 maxlength=25 value="<?php if (isset($_POST['Keywords'])) echo $_POST['Keywords']; ?>"></td></tr> <tr><td></td> <td><font SIZE 3><b><?php echo _('OR'); ?> </b></font><?php echo _('Enter extract of the'); ?> <b><?php echo _('Stock Code'); ?></b>:</td> - <td><input type="Text" name="StockCode" size="15" maxlength="18" VALUE="<?php if (isset($_POST['StockCode'])) echo $_POST['StockCode']; ?>"></td> + <td><input type="Text" name="StockCode" size="15" maxlength="18" value="<?php if (isset($_POST['StockCode'])) echo $_POST['StockCode']; ?>"></td> </tr> </table> - <br /><div class="centre"><input type=submit name="Search" VALUE="<?php echo _('Search Now'); ?>"> + <br /><div class="centre"><input type=submit name="Search" value="<?php echo _('Search Now'); ?>"> <script language='JavaScript' type='text/javascript'> @@ -668,7 +676,7 @@ if (!in_array($myrow['stockid'],$ItemCodes)){ if (function_exists('imagecreatefrompng') ){ - $ImageSource = '<IMG SRC="GetStockImage.php?SID&automake=1&textcolor=FFFFFF&bgcolor=CCCCCC&StockID=' . urlencode($myrow['stockid']). '&text=&width=64&height=64">'; + $ImageSource = '<IMG SRC="GetStockImage.php?automake=1&textcolor=FFFFFF&bgcolor=CCCCCC&StockID=' . urlencode($myrow['stockid']). '&text=&width=64&height=64">'; } else { if(file_exists($_SERVER['DOCUMENT_ROOT'] . $rootpath. '/' . $_SESSION['part_pics_dir'] . '/' . $myrow['stockid'] . '.jpg')) { $ImageSource = '<IMG SRC="' .$_SERVER['DOCUMENT_ROOT'] . $rootpath . '/' . $_SESSION['part_pics_dir'] . '/' . $myrow['stockid'] . '.jpg">'; @@ -685,7 +693,7 @@ $k=1; } - $IssueLink = $_SERVER['PHP_SELF'] . '?' . SID . '&WO=' . $_POST['WO'] . '&StockID=' . $_POST['StockID'] . '&IssueItem=' . $myrow['stockid'] . '&FromLocation=' . $_POST['FromLocation']; + $IssueLink = $_SERVER['PHP_SELF'] . '?WO=' . $_POST['WO'] . '&StockID=' . $_POST['StockID'] . '&IssueItem=' . $myrow['stockid'] . '&FromLocation=' . $_POST['FromLocation']; printf("<td><font size=1>%s</font></td> <td><font size=1>%s</font></td> <td><font size=1>%s</font></td> @@ -739,9 +747,9 @@ $SerialNoResult = DB_query("SELECT serialno - FROM stockserialitems - WHERE stockid='" . $_POST['IssueItem'] . "' - AND loccode='" . $_POST['FromLocation'] . "'", + FROM stockserialitems + WHERE stockid='" . $_POST['IssueItem'] . "' + AND loccode='" . $_POST['FromLocation'] . "'", $db,_('Could not retrieve the serial numbers available at the location specified because')); if (DB_num_rows($SerialNoResult)==0){ echo '<tr><td>' . _('There are no serial numbers at this location to issue') . '</td></tr>'; Modified: trunk/WorkOrderReceive.php =================================================================== --- trunk/WorkOrderReceive.php 2011-04-07 10:23:55 UTC (rev 4541) +++ trunk/WorkOrderReceive.php 2011-04-08 23:37:01 UTC (rev 4542) @@ -1,25 +1,23 @@ <?php /* $Id$*/ -//$PageSecurity = 11; - include('includes/session.inc'); $title = _('Receive Work Order'); include('includes/header.inc'); include('includes/SQL_CommonFunctions.inc'); -echo '<a href="'. $rootpath . '/SelectWorkOrder.php?' . SID . '">' . _('Back to Work Orders'). '</a><br>'; -echo '<a href="'. $rootpath . '/WorkOrderCosting.php?' . SID . '&WO=' . $_REQUEST['WO'] . '">' . _('Back to Costing'). '</a><br>'; +echo '<a href="'. $rootpath . '/SelectWorkOrder.php">' . _('Back to Work Orders'). '</a><br>'; +echo '<a href="'. $rootpath . '/WorkOrderCosting.php?WO=' . $_REQUEST['WO'] . '">' . _('Back to Costing'). '</a><br>'; echo '<p class="page_title_text"><img src="'.$rootpath.'/css/'.$theme.'/images/group_add.png" title="' . _('Search') . '" alt="" />' . ' ' . $title.'</p'; -echo '<form action="' . $_SERVER['PHP_SELF'] . '?' . SID . '" method=post>'; +echo '<form action="' . $_SERVER['PHP_SELF'] . '" method="post">'; echo '<input type="hidden" n... [truncated message content] |
From: <dai...@us...> - 2011-04-07 10:24:02
|
Revision: 4541 http://web-erp.svn.sourceforge.net/web-erp/?rev=4541&view=rev Author: daintree Date: 2011-04-07 10:23:55 +0000 (Thu, 07 Apr 2011) Log Message: ----------- various Modified Paths: -------------- trunk/Tax.php trunk/TaxAuthorities.php trunk/TaxGroups.php trunk/TopItems.php Modified: trunk/Tax.php =================================================================== --- trunk/Tax.php 2011-04-06 10:01:30 UTC (rev 4540) +++ trunk/Tax.php 2011-04-07 10:23:55 UTC (rev 4541) @@ -2,7 +2,6 @@ /* $Id$*/ -//$PageSecurity = 2; include('includes/session.inc'); if (isset($_POST['TaxAuthority']) AND @@ -12,15 +11,15 @@ include('includes/PDFStarter.php'); - $sql = 'SELECT lastdate_in_period - FROM periods - WHERE periodno=' . $_POST['ToPeriod']; + $sql = "SELECT lastdate_in_period + FROM periods + WHERE periodno='" . $_POST['ToPeriod'] . "'"; $ErrMsg = _('Could not determine the last date of the period selected') . '. ' . _('The sql returned the following error'); $PeriodEndResult = DB_query($sql,$db,$ErrMsg); $PeriodEndRow = DB_fetch_row($PeriodEndResult); $PeriodEnd = ConvertSQLDate($PeriodEndRow[0]); - $result = DB_query('SELECT description FROM taxauthorities WHERE taxid=' . $_POST['TaxAuthority'],$db); + $result = DB_query("SELECT description FROM taxauthorities WHERE taxid='" . $_POST['TaxAuthority'] . "'",$db); $TaxAuthDescription = DB_fetch_row($result); $TaxAuthorityName = $TaxAuthDescription[0]; @@ -61,22 +60,14 @@ $title = _('Taxation Reporting Error'); include('includes/header.inc'); prnMsg(_('The accounts receivable transaction details could not be retrieved because') . ' ' . DB_error_msg($db),'error'); - echo "<br><a href='$rootpath/index.php?" . SID . "'>" . _('Back to the menu') . '</a>'; + echo '<br /><a href="' . $rootpath . '/index.php">' . _('Back to the menu') . '</a>'; if ($debug==1){ - echo "<br>$SQL"; + echo '<br />' . $SQL; } include('includes/footer.inc'); exit; } -// if (DB_num_rows($DebtorTransResult)==0){ -// $title = _('Taxation Reporting Error'); -// include('includes/header.inc'); -// prnMsg (_('There are no tax entries to list'),'info'); -// echo "<br><a href='$rootpath/index.php?" . SID . "'>" . _('Back to the menu') . '</a>'; -// include('includes/footer.inc'); -// exit; -// } -// + if ($_POST['DetailOrSummary']=='Detail'){ include ('includes/PDFTaxPageHeader.inc'); $LeftOvers = $pdf->addTextWrap($Left_Margin,$YPos,120,$FontSize+2, _('Tax On Sales'),'left'); @@ -174,9 +165,9 @@ $title = _('Taxation Reporting Error'); include('includes/header.inc'); echo _('The accounts payable transaction details could not be retrieved because') . ' ' . DB_error_msg($db); - echo "<br><a href='$rootpath/index.php?" . SID . "'>" . _('Back to the menu') . '</a>'; + echo '<br /><a href="' . $rootpath . '/index.php?">' . _('Back to the menu') . '</a>'; if ($debug==1){ - echo "<br>$SQL"; + echo '<br />' . $SQL; } include('includes/footer.inc'); exit; @@ -283,7 +274,7 @@ $title = _('Taxation Reporting Error'); include('includes/header.inc'); prnMsg (_('There are no tax entries to list'),'info'); - echo "<br><a href='$rootpath/index.php?" . SID . "'>" . _('Back to the menu') . '</a>'; + echo '<br /><a href="' . $rootpath . '/index.php">' . _('Back to the menu') . '</a>'; include('includes/footer.inc'); exit; } else { @@ -298,60 +289,61 @@ echo '<p class="page_title_text"><img src="'.$rootpath.'/css/'.$theme.'/images/maintenance.png" title="' . _('Supplier Types') . '" alt="" />' . $title. '</p>'; - echo '<form action=' . $_SERVER['PHP_SELF'] . " method='POST'><table class=selection>"; + echo '<form action="' . $_SERVER['PHP_SELF'] . '" method="POST"> + <table class="selection">'; echo '<input type="hidden" name="FormID" value="' . $_SESSION['FormID'] . '" />'; echo '<tr><td>' . _('Tax Authority To Report On:') . ':</font></td> - <td><select name=TaxAuthority>'; + <td><select name="TaxAuthority">'; - $result = DB_query('SELECT taxid, description FROM taxauthorities',$db); + $result = DB_query("SELECT taxid, description FROM taxauthorities",$db); while ($myrow = DB_fetch_array($result)){ - echo '<option Value=' . $myrow['taxid'] . '>' . $myrow['description']; + echo '<option Value=' . $myrow['taxid'] . '>' . $myrow['description'] . '</option>'; } echo '</select></td></tr>'; echo '<tr><td>' . _('Return Covering') . ':</font></td> - <td><select name=NoOfPeriods> - <option Value=1>' . _('One Month') . - '<option selected Value=2>' ._('Two Months') . - '<option VALUE=3>' . _('Quarter') . - '<option VALUE=6>' . _('Six Months') . + <td><select name="NoOfPeriods"> + <option value=1>' . _('One Month') . '</option>' . + '<option selected value=2>' ._('Two Months') . '</option>' . + '<option value=3>' . _('Quarter') . '</option>' . + '<option value=6>' . _('Six Months') . '</option>' . '</select></td></tr>'; - echo '<tr><td>' . _('Return To') . ":</td> - <td><select Name='ToPeriod'>"; + echo '<tr><td>' . _('Return To') . ':</td> + <td><select name="ToPeriod">'; $DefaultPeriod = GetPeriod(Date($_SESSION['DefaultDateFormat'],Mktime(0,0,0,Date('m'),0,Date('Y'))),$db); - $sql = 'SELECT periodno, + $sql = "SELECT periodno, lastdate_in_period - FROM periods'; + FROM periods"; $ErrMsg = _('Could not retrieve the period data because'); $Periods = DB_query($sql,$db,$ErrMsg); while ($myrow = DB_fetch_array($Periods,$db)){ if ($myrow['periodno']==$DefaultPeriod){ - echo '<option selected VALUE=' . $myrow['periodno'] . '>' . ConvertSQLDate($myrow['lastdate_in_period']); + echo '<option selected VALUE=' . $myrow['periodno'] . '>' . ConvertSQLDate($myrow['lastdate_in_period']) . '</option>'; } else { - echo '<option VALUE=' . $myrow['periodno'] . '>' . ConvertSQLDate($myrow['lastdate_in_period']); + echo '<option VALUE=' . $myrow['periodno'] . '>' . ConvertSQLDate($myrow['lastdate_in_period']) . '</option>'; } } echo '</select></td></tr>'; - echo '<tr><td>' . _('Detail Or Summary Only') . ":</font></td> - <td><select name='DetailOrSummary'> - <option Value='Detail'>" . _('Detail and Summary') . - "<option selected Value='Summary'>" . _('Summary Only') . - "</select></td></tr>"; + echo '<tr><td>' . _('Detail Or Summary Only') . ':</font></td> + <td><select name="DetailOrSummary"> + <option Value="Detail">' . _('Detail and Summary') . '</option> + <option selected value="Summary">' . _('Summary Only') . '</option> + </select></td></tr>'; - echo "</table> - <br /><div class='centre'><input type=Submit Name='PrintPDF' Value='" . _('Print PDF') . "'> + echo '</table> + <br /><div class="centre"><input type="submit" name="PrintPDF" value="' . _('Print PDF') . '"> </div> - </form>"; + </form>'; include('includes/footer.inc'); } /*end of else not PrintPDF */ Modified: trunk/TaxAuthorities.php =================================================================== --- trunk/TaxAuthorities.php 2011-04-06 10:01:30 UTC (rev 4540) +++ trunk/TaxAuthorities.php 2011-04-07 10:23:55 UTC (rev 4541) @@ -2,7 +2,6 @@ /* $Id$*/ -//$PageSecurity=15; include('includes/session.inc'); $title = _('Tax Authorities'); include('includes/header.inc'); @@ -126,7 +125,7 @@ /* It could still be the second time the page has been run and a record has been selected for modification - SelectedTaxAuthID will exist because it was sent with the new call. If its the first time the page has been displayed with no parameters then none of the above are true and the list of tax authorities 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*/ - $sql = 'SELECT taxid, + $sql = "SELECT taxid, description, taxglcode, purchtaxglaccount, @@ -134,23 +133,23 @@ bankacc, bankacctype, bankswift - FROM taxauthorities'; + FROM taxauthorities"; $ErrMsg = _('CRITICAL ERROR') . '! ' . _('NOTE DOWN THIS ERROR AND SEEK ASSISTANCE') . ': ' . _('The defined tax authorities could not be retrieved because'); $DbgMsg = _('The following SQL to retrieve the tax authorities was used'); $result = DB_query($sql,$db,$ErrMsg,$DbgMsg); echo '<table class=selection>'; - echo "<tr> - <th>" . _('ID') . "</th> - <th>" . _('Description') . "</th> - <th>" . _('Input Tax') . '<br>' . _('GL Account') . "</th> - <th>" . _('Output Tax') . '<br>' . _('GL Account') . "</th> - <th>" . _('Bank') . "</th> - <th>" . _('Bank Account') . "</th> - <th>" . _('Bank Act Type') . "</th> - <th>" . _('Bank Swift') . "</th> - </tr></font>"; + echo '<tr> + <th>' . _('ID') . '</th> + <th>' . _('Description') . '</th> + <th>' . _('Input Tax') . '<br>' . _('GL Account') . '</th> + <th>' . _('Output Tax') . '<br>' . _('GL Account') . '</th> + <th>' . _('Bank') . '</th> + <th>' . _('Bank Account') . '</th> + <th>' . _('Bank Act Type') . '</th> + <th>' . _('Bank Swift') . '</th> + </tr></font>'; $k=0; while ($myrow = DB_fetch_row($result)) { @@ -182,11 +181,11 @@ $myrow[5], $myrow[6], $myrow[7], - $_SERVER['PHP_SELF'] . '?' . SID, + $_SERVER['PHP_SELF'] . '?', $myrow[0], - $_SERVER['PHP_SELF'] . '?' . SID, + $_SERVER['PHP_SELF'] . '?', $myrow[0], - $rootpath . '/TaxAuthorityRates.php?' . SID, + $rootpath . '/TaxAuthorityRates.php?', $myrow[0]); } @@ -200,11 +199,11 @@ if (isset($SelectedTaxAuthID)) { - echo "<div class='centre'><a href='" . $_SERVER['PHP_SELF'] . '?' . SID ."'>" . _('Review all defined tax authority records') . '</a></div>'; + echo '<div class="centre"><a href="' . $_SERVER['PHP_SELF'] .'">' . _('Review all defined tax authority records') . '</a></div>'; } -echo "<p><form method='post' action=" . $_SERVER['PHP_SELF'] . '?' . SID .'>'; +echo '<p><form method="post" action="' . $_SERVER['PHP_SELF'] . '">'; echo '<input type="hidden" name="FormID" value="' . $_SESSION['FormID'] . '" />'; if (isset($SelectedTaxAuthID)) { @@ -237,13 +236,13 @@ } //end of if $SelectedTaxAuthID only do the else when a new record is being entered -$SQL = 'SELECT accountcode, +$SQL = "SELECT accountcode, accountname FROM chartmaster, accountgroups WHERE chartmaster.group_=accountgroups.groupname AND accountgroups.pandl=0 - ORDER BY accountcode'; + ORDER BY accountcode"; $result = DB_query($SQL,$db); if (!isset($_POST['Description'])) { @@ -255,7 +254,7 @@ echo '<tr><td>' . _('Input tax GL Account') . ':</td> - <td><select name=PurchTaxGLCode>'; + <td><select name="PurchTaxGLCode">'; while ($myrow = DB_fetch_array($result)) { if (isset($_POST['PurchTaxGLCode']) and $myrow['accountcode']==$_POST['PurchTaxGLCode']) { @@ -263,7 +262,7 @@ } else { echo '<option VALUE='; } - echo $myrow['accountcode'] . '>' . $myrow['accountname'] . ' ('.$myrow['accountcode'].')'; + echo $myrow['accountcode'] . '>' . $myrow['accountname'] . ' ('.$myrow['accountcode'].')' . '</option>'; } //end while loop @@ -272,7 +271,7 @@ DB_data_seek($result,0); echo '<tr><td>' . _('Output tax GL Account') . ':</td> - <td><select name=TaxGLCode>'; + <td><select name="TaxGLCode">'; while ($myrow = DB_fetch_array($result)) { @@ -281,7 +280,7 @@ } else { echo "<option VALUE='"; } - echo $myrow['accountcode'] . "'>" . $myrow['accountname'] . ' ('.$myrow['accountcode'].')'; + echo $myrow['accountcode'] . "'>" . $myrow['accountname'] . ' ('.$myrow['accountcode'].')' . '</option>'; } //end while loop Modified: trunk/TaxGroups.php =================================================================== --- trunk/TaxGroups.php 2011-04-06 10:01:30 UTC (rev 4540) +++ trunk/TaxGroups.php 2011-04-07 10:23:55 UTC (rev 4541) @@ -1,6 +1,5 @@ <?php /* $Id$*/ -//PageSecurity=15; include('includes/session.inc'); @@ -125,14 +124,14 @@ $myrow = DB_fetch_row($result); if ($myrow[0]>0) { prnMsg( _('Cannot delete this tax group because some customer branches are setup using it'),'warn'); - echo '<br>' . _('There are') . ' ' . $myrow[0] . ' ' . _('customer branches referring to this tax group'); + echo '<br />' . _('There are') . ' ' . $myrow[0] . ' ' . _('customer branches referring to this tax group'); } else { $sql= "SELECT COUNT(*) FROM suppliers WHERE taxgroupid='" . $_GET['SelectedGroup'] . "'"; $result = DB_query($sql,$db); $myrow = DB_fetch_row($result); if ($myrow[0]>0) { prnMsg( _('Cannot delete this tax group because some suppliers are setup using it'),'warn'); - echo '<br>' . _('There are') . ' ' . $myrow[0] . ' ' . _('suppliers referring to this tax group'); + echo '<br />' . _('There are') . ' ' . $myrow[0] . ' ' . _('suppliers referring to this tax group'); } else { $sql="DELETE FROM taxgrouptaxes WHERE taxgroupid='" . $_GET['SelectedGroup'] . "'"; @@ -161,8 +160,8 @@ echo '</div>'; } else { echo '<table class=selection>'; - echo "<tr><th>" . _('Group No') . "</th> - <th>" . _('Tax Group') . "</th></tr>"; + echo '<tr><th>' . _('Group No') . '</th> + <th>' . _('Tax Group') . '</th></tr>'; $k=0; //row colour counter while ($myrow = DB_fetch_array($result)) { @@ -181,9 +180,9 @@ </tr>", $myrow['taxgroupid'], $myrow['taxgroupdescription'], - $_SERVER['PHP_SELF'] . "?" . SID, + $_SERVER['PHP_SELF'] . '?', $myrow['taxgroupid'], - $_SERVER['PHP_SELF'] . "?" . SID, + $_SERVER['PHP_SELF'] . '?', $myrow['taxgroupid'], urlencode($myrow['taxgroupdescription'])); @@ -194,7 +193,7 @@ if (isset($SelectedGroup)) { - echo '<div class="centre"><a href="' . $_SERVER['PHP_SELF'] ."?" . SID . '">' . _('Review Existing Groups') . '</a></div>'; + echo '<div class="centre"><a href="' . $_SERVER['PHP_SELF'] . '">' . _('Review Existing Groups') . '</a></div>'; } if (isset($SelectedGroup)) { @@ -213,7 +212,7 @@ $_POST['GroupName'] = $myrow['taxgroupdescription']; } } -echo '<br>'; +echo '<br />'; echo "<form method='post' action=" . $_SERVER['PHP_SELF'] . "?" . SID . ">"; echo '<input type="hidden" name="FormID" value="' . $_SESSION['FormID'] . '" />'; if( isset($_POST['SelectedGroup'])) { @@ -230,7 +229,7 @@ if (isset($SelectedGroup)) { - echo '</table><br>'; + echo '</table><br />'; $sql = 'SELECT taxid, description as taxname @@ -299,31 +298,31 @@ } echo '</table>'; - echo '<br><div class="centre"><input type="submit" name="UpdateOrder" value="' . _('Update Order') . '"></div>'; + echo '<br /><div class="centre"><input type="submit" name="UpdateOrder" value="' . _('Update Order') . '"></div>'; } echo '</form>'; if (DB_num_rows($Result)>0 ) { - echo '<br>'; - echo '<table class=selection><tr>'; - echo "<th colspan=4>"._('Assigned Taxes')."</th>"; - echo '<th></th>'; - echo "<th colspan=2>"._('Available Taxes')."</th>"; - echo '</tr>'; + echo '<br />'; + echo '<table class=selection> + <tr> + <th colspan=4>'._('Assigned Taxes') . '</th> + <th></th> + <th colspan=2>' . _('Available Taxes') . '</th> + </tr>'; + echo '<tr> + <th>' . _('Tax Auth ID') . '</th> + <th>' . _('Tax Authority Name') . '</th> + <th>' . _('Calculation Order') . '</th> + <th>' . _('Tax on Prior Tax(es)') . '</th> + <th></th> + <th>' . _('Tax Auth ID') . '</th> + <th>' . _('Tax Authority Name') . '</th> + </tr>'; - echo '<tr>'; - echo "<th>" . _('Tax Auth ID') . '</th>'; - echo "<th>" . _('Tax Authority Name') . '</th>'; - echo "<th>" . _('Calculation Order') . '</th>'; - echo "<th>" . _('Tax on Prior Tax(es)') . '</th>'; - echo '<th></th>'; - echo "<th>" . _('Tax Auth ID') . '</th>'; - echo "<th>" . _('Tax Authority Name') . '</th>'; - echo '</tr>'; - } else { - echo '<br><div class="centre">' . _('There are no tax authorities defined to allocate to this tax group').'</div>'; + echo '<br /><div class="centre">' . _('There are no tax authorities defined to allocate to this tax group').'</div>'; } $k=0; //row colour counter @@ -357,7 +356,7 @@ $AvailRow['taxname'], $TaxAuthRow[$TaxAuthUsedPointer]['calculationorder'], $TaxOnTax, - $_SERVER['PHP_SELF'] . "?" . SID, + $_SERVER['PHP_SELF'] . '?', $SelectedGroup, $AvailRow['taxid'] ); @@ -373,7 +372,7 @@ <td><a href=\"%s&SelectedGroup=%s&add=1&TaxAuthority=%s\">" . _('Add') . "</a></td>", $AvailRow['taxid'], $AvailRow['taxname'], - $_SERVER['PHP_SELF'] . "?" . SID, + $_SERVER['PHP_SELF'] . '?', $SelectedGroup, $AvailRow['taxid'] ); Modified: trunk/TopItems.php =================================================================== --- trunk/TopItems.php 2011-04-06 10:01:30 UTC (rev 4540) +++ trunk/TopItems.php 2011-04-07 10:23:55 UTC (rev 4541) @@ -1,6 +1,7 @@ <?php -/* $Revision: 1.3 $ */ -//$PageSecurity = 2; Now from db + +/* $Id$*/ + /* Session started in session.inc for password checking and authorisation level check config.php is in turn included in session.inc*/ include ('includes/session.inc'); @@ -15,24 +16,26 @@ echo '<table cellpadding=3 colspan=4 class=selection>'; //to view store location echo '<tr><td width="150">' . _('Select Location') . ' </td><td>:</td><td><select name=Location>'; - $sql = 'SELECT loccode, + $sql = "SELECT loccode, locationname - FROM `locations`'; + FROM `locations`"; $result = DB_query($sql, $db); echo '<option value="All">' . _('All') . '</option>'; while ($myrow = DB_fetch_array($result)) { - echo "<option VALUE='" . $myrow['loccode'] . "'>" . $myrow['loccode'] . " - " . $myrow['locationname'] . '</option>'; + echo '<option value="' . $myrow['loccode'] . '">' . $myrow['loccode'] . ' - ' . $myrow['locationname'] . '</option>'; } echo '</select></td></tr>'; //to view list of customer - echo '<tr><td width="150">' . _('Select Customer Type') . ' </td><td>:</td><td><select name=Customers>'; - $sql = 'SELECT typename, + echo '<tr><td width="150">' . _('Select Customer Type') . '</td> + <td>:</td> + <td><select name="Customers">'; + $sql = "SELECT typename, typeid - FROM debtortype'; + FROM debtortype"; $result = DB_query($sql, $db); - echo "<option value='All'>" . _('All') . '</option>'; + echo '<option value="All">' . _('All') . '</option>'; while ($myrow = DB_fetch_array($result)) { - echo "<option VALUE='" . $myrow['typeid'] . "'>" . $myrow['typename'] . '</option>'; + echo '<option value="' . $myrow['typeid'] . '">' . $myrow['typename'] . '</option>'; } echo '</select></td> </tr>'; @@ -40,18 +43,18 @@ echo '<tr> <td width="150">' . _('Select Order By ') . ' </td> <td>:</td> <td><select name="Sequence">'; - echo ' <option value="TotalInvoiced">' . _('Total Pieces') . ''; - echo ' <option value="ValueSales">' . _('Value of Sales') . ''; + echo ' <option value="TotalInvoiced">' . _('Total Pieces') . '</option>'; + echo ' <option value="ValueSales">' . _('Value of Sales') . '</option>'; echo ' </select></td> </tr>'; //View number of days echo '<tr><td>' . _('Number Of Days') . ' </td><td>:</td> - <td><input class="number" tabindex="3" type="Text" name=NumberOfDays size="8" maxlength="8" value=0></td> + <td><input class="number" tabindex="3" type="Text" name="NumberOfDays" size="8" maxlength="8" value=0></td> </tr>'; //view number of NumberOfTopItems items echo '<tr> <td>' . _('Number Of Top Items') . ' </td><td>:</td> - <td><input class="number" tabindex="4" type="Text" name=NumberOfTopItems size="8" maxlength="8" value=1></td> + <td><input class="number" tabindex="4" type="Text" name="NumberOfTopItems" size="8" maxlength="8" value=1></td> </tr> <tr> <td></td> @@ -82,7 +85,7 @@ AND debtorsmaster.currcode = currencies.currabrev AND salesorderdetails.ActualDispatchDate >= '" . $FromDate . "' GROUP BY salesorderdetails.stkcode - ORDER BY " . $_POST['Sequence'] . " DESC + ORDER BY '" . $_POST['Sequence'] . "' DESC LIMIT " . $_POST['NumberOfTopItems'] . ""; } else { //the situation if only location type selected "All" if ($_POST['Location'] == 'All') { @@ -103,11 +106,11 @@ AND debtorsmaster.typeid = '" . $_POST['Customers'] . "' AND salesorderdetails.ActualDispatchDate >= '" . $FromDate . "' GROUP BY salesorderdetails.stkcode - ORDER BY " . $_POST['Sequence'] . " DESC + ORDER BY '" . $_POST['Sequence'] . "' DESC LIMIT " . $_POST[NumberOfTopItems] . ""; } else { //the situation if the customer type selected "All" - if ($_POST['Customers'] == "All") { + if ($_POST['Customers'] == 'All') { $SQL = "SELECT salesorderdetails.stkcode, SUM(salesorderdetails.qtyinvoiced) TotalInvoiced, SUM(salesorderdetails.qtyinvoiced * salesorderdetails.unitprice ) AS ValueSales, @@ -145,7 +148,7 @@ AND debtorsmaster.typeid = '" . $_POST['Customers'] . "' AND salesorderdetails.ActualDispatchDate >= '" . $FromDate . "' GROUP BY salesorderdetails.stkcode - ORDER BY " . $_POST['Sequence'] . " DESC + ORDER BY '" . $_POST['Sequence'] . "' DESC LIMIT " . $_POST['NumberOfTopItems'] . ""; } } @@ -163,13 +166,11 @@ <th>' . _('Value Sales') . '</th> <th>' . _('On Hand') . '</th>'; echo $TableHeader; - echo ' - <input type="hidden" value=' . $_POST['Location'] . ' name="Location" /> + echo '<input type="hidden" value=' . $_POST['Location'] . ' name="Location" /> <input type="hidden" value=' . $_POST['Sequence'] . ' name="Sequence" /> <input type="hidden" value=' . $_POST['NumberOfDays'] . ' name="NumberOfDays" /> <input type="hidden" value=' . $_POST['Customers'] . ' name="Customers" /> - <input type="hidden" value=' . $_POST['NumberOfTopItems'] . ' name="NumberOfTopItems" /> - '; + <input type="hidden" value=' . $_POST['NumberOfTopItems'] . ' name="NumberOfTopItems" />'; $k = 0; //row colour counter $i = 1; while ($myrow = DB_fetch_array($result)) { This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <dai...@us...> - 2011-04-07 10:24:02
|
Revision: 4541 http://web-erp.svn.sourceforge.net/web-erp/?rev=4541&view=rev Author: daintree Date: 2011-04-07 10:23:55 +0000 (Thu, 07 Apr 2011) Log Message: ----------- various Modified Paths: -------------- trunk/Tax.php trunk/TaxAuthorities.php trunk/TaxGroups.php trunk/TopItems.php Modified: trunk/Tax.php =================================================================== --- trunk/Tax.php 2011-04-06 10:01:30 UTC (rev 4540) +++ trunk/Tax.php 2011-04-07 10:23:55 UTC (rev 4541) @@ -2,7 +2,6 @@ /* $Id$*/ -//$PageSecurity = 2; include('includes/session.inc'); if (isset($_POST['TaxAuthority']) AND @@ -12,15 +11,15 @@ include('includes/PDFStarter.php'); - $sql = 'SELECT lastdate_in_period - FROM periods - WHERE periodno=' . $_POST['ToPeriod']; + $sql = "SELECT lastdate_in_period + FROM periods + WHERE periodno='" . $_POST['ToPeriod'] . "'"; $ErrMsg = _('Could not determine the last date of the period selected') . '. ' . _('The sql returned the following error'); $PeriodEndResult = DB_query($sql,$db,$ErrMsg); $PeriodEndRow = DB_fetch_row($PeriodEndResult); $PeriodEnd = ConvertSQLDate($PeriodEndRow[0]); - $result = DB_query('SELECT description FROM taxauthorities WHERE taxid=' . $_POST['TaxAuthority'],$db); + $result = DB_query("SELECT description FROM taxauthorities WHERE taxid='" . $_POST['TaxAuthority'] . "'",$db); $TaxAuthDescription = DB_fetch_row($result); $TaxAuthorityName = $TaxAuthDescription[0]; @@ -61,22 +60,14 @@ $title = _('Taxation Reporting Error'); include('includes/header.inc'); prnMsg(_('The accounts receivable transaction details could not be retrieved because') . ' ' . DB_error_msg($db),'error'); - echo "<br><a href='$rootpath/index.php?" . SID . "'>" . _('Back to the menu') . '</a>'; + echo '<br /><a href="' . $rootpath . '/index.php">' . _('Back to the menu') . '</a>'; if ($debug==1){ - echo "<br>$SQL"; + echo '<br />' . $SQL; } include('includes/footer.inc'); exit; } -// if (DB_num_rows($DebtorTransResult)==0){ -// $title = _('Taxation Reporting Error'); -// include('includes/header.inc'); -// prnMsg (_('There are no tax entries to list'),'info'); -// echo "<br><a href='$rootpath/index.php?" . SID . "'>" . _('Back to the menu') . '</a>'; -// include('includes/footer.inc'); -// exit; -// } -// + if ($_POST['DetailOrSummary']=='Detail'){ include ('includes/PDFTaxPageHeader.inc'); $LeftOvers = $pdf->addTextWrap($Left_Margin,$YPos,120,$FontSize+2, _('Tax On Sales'),'left'); @@ -174,9 +165,9 @@ $title = _('Taxation Reporting Error'); include('includes/header.inc'); echo _('The accounts payable transaction details could not be retrieved because') . ' ' . DB_error_msg($db); - echo "<br><a href='$rootpath/index.php?" . SID . "'>" . _('Back to the menu') . '</a>'; + echo '<br /><a href="' . $rootpath . '/index.php?">' . _('Back to the menu') . '</a>'; if ($debug==1){ - echo "<br>$SQL"; + echo '<br />' . $SQL; } include('includes/footer.inc'); exit; @@ -283,7 +274,7 @@ $title = _('Taxation Reporting Error'); include('includes/header.inc'); prnMsg (_('There are no tax entries to list'),'info'); - echo "<br><a href='$rootpath/index.php?" . SID . "'>" . _('Back to the menu') . '</a>'; + echo '<br /><a href="' . $rootpath . '/index.php">' . _('Back to the menu') . '</a>'; include('includes/footer.inc'); exit; } else { @@ -298,60 +289,61 @@ echo '<p class="page_title_text"><img src="'.$rootpath.'/css/'.$theme.'/images/maintenance.png" title="' . _('Supplier Types') . '" alt="" />' . $title. '</p>'; - echo '<form action=' . $_SERVER['PHP_SELF'] . " method='POST'><table class=selection>"; + echo '<form action="' . $_SERVER['PHP_SELF'] . '" method="POST"> + <table class="selection">'; echo '<input type="hidden" name="FormID" value="' . $_SESSION['FormID'] . '" />'; echo '<tr><td>' . _('Tax Authority To Report On:') . ':</font></td> - <td><select name=TaxAuthority>'; + <td><select name="TaxAuthority">'; - $result = DB_query('SELECT taxid, description FROM taxauthorities',$db); + $result = DB_query("SELECT taxid, description FROM taxauthorities",$db); while ($myrow = DB_fetch_array($result)){ - echo '<option Value=' . $myrow['taxid'] . '>' . $myrow['description']; + echo '<option Value=' . $myrow['taxid'] . '>' . $myrow['description'] . '</option>'; } echo '</select></td></tr>'; echo '<tr><td>' . _('Return Covering') . ':</font></td> - <td><select name=NoOfPeriods> - <option Value=1>' . _('One Month') . - '<option selected Value=2>' ._('Two Months') . - '<option VALUE=3>' . _('Quarter') . - '<option VALUE=6>' . _('Six Months') . + <td><select name="NoOfPeriods"> + <option value=1>' . _('One Month') . '</option>' . + '<option selected value=2>' ._('Two Months') . '</option>' . + '<option value=3>' . _('Quarter') . '</option>' . + '<option value=6>' . _('Six Months') . '</option>' . '</select></td></tr>'; - echo '<tr><td>' . _('Return To') . ":</td> - <td><select Name='ToPeriod'>"; + echo '<tr><td>' . _('Return To') . ':</td> + <td><select name="ToPeriod">'; $DefaultPeriod = GetPeriod(Date($_SESSION['DefaultDateFormat'],Mktime(0,0,0,Date('m'),0,Date('Y'))),$db); - $sql = 'SELECT periodno, + $sql = "SELECT periodno, lastdate_in_period - FROM periods'; + FROM periods"; $ErrMsg = _('Could not retrieve the period data because'); $Periods = DB_query($sql,$db,$ErrMsg); while ($myrow = DB_fetch_array($Periods,$db)){ if ($myrow['periodno']==$DefaultPeriod){ - echo '<option selected VALUE=' . $myrow['periodno'] . '>' . ConvertSQLDate($myrow['lastdate_in_period']); + echo '<option selected VALUE=' . $myrow['periodno'] . '>' . ConvertSQLDate($myrow['lastdate_in_period']) . '</option>'; } else { - echo '<option VALUE=' . $myrow['periodno'] . '>' . ConvertSQLDate($myrow['lastdate_in_period']); + echo '<option VALUE=' . $myrow['periodno'] . '>' . ConvertSQLDate($myrow['lastdate_in_period']) . '</option>'; } } echo '</select></td></tr>'; - echo '<tr><td>' . _('Detail Or Summary Only') . ":</font></td> - <td><select name='DetailOrSummary'> - <option Value='Detail'>" . _('Detail and Summary') . - "<option selected Value='Summary'>" . _('Summary Only') . - "</select></td></tr>"; + echo '<tr><td>' . _('Detail Or Summary Only') . ':</font></td> + <td><select name="DetailOrSummary"> + <option Value="Detail">' . _('Detail and Summary') . '</option> + <option selected value="Summary">' . _('Summary Only') . '</option> + </select></td></tr>'; - echo "</table> - <br /><div class='centre'><input type=Submit Name='PrintPDF' Value='" . _('Print PDF') . "'> + echo '</table> + <br /><div class="centre"><input type="submit" name="PrintPDF" value="' . _('Print PDF') . '"> </div> - </form>"; + </form>'; include('includes/footer.inc'); } /*end of else not PrintPDF */ Modified: trunk/TaxAuthorities.php =================================================================== --- trunk/TaxAuthorities.php 2011-04-06 10:01:30 UTC (rev 4540) +++ trunk/TaxAuthorities.php 2011-04-07 10:23:55 UTC (rev 4541) @@ -2,7 +2,6 @@ /* $Id$*/ -//$PageSecurity=15; include('includes/session.inc'); $title = _('Tax Authorities'); include('includes/header.inc'); @@ -126,7 +125,7 @@ /* It could still be the second time the page has been run and a record has been selected for modification - SelectedTaxAuthID will exist because it was sent with the new call. If its the first time the page has been displayed with no parameters then none of the above are true and the list of tax authorities 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*/ - $sql = 'SELECT taxid, + $sql = "SELECT taxid, description, taxglcode, purchtaxglaccount, @@ -134,23 +133,23 @@ bankacc, bankacctype, bankswift - FROM taxauthorities'; + FROM taxauthorities"; $ErrMsg = _('CRITICAL ERROR') . '! ' . _('NOTE DOWN THIS ERROR AND SEEK ASSISTANCE') . ': ' . _('The defined tax authorities could not be retrieved because'); $DbgMsg = _('The following SQL to retrieve the tax authorities was used'); $result = DB_query($sql,$db,$ErrMsg,$DbgMsg); echo '<table class=selection>'; - echo "<tr> - <th>" . _('ID') . "</th> - <th>" . _('Description') . "</th> - <th>" . _('Input Tax') . '<br>' . _('GL Account') . "</th> - <th>" . _('Output Tax') . '<br>' . _('GL Account') . "</th> - <th>" . _('Bank') . "</th> - <th>" . _('Bank Account') . "</th> - <th>" . _('Bank Act Type') . "</th> - <th>" . _('Bank Swift') . "</th> - </tr></font>"; + echo '<tr> + <th>' . _('ID') . '</th> + <th>' . _('Description') . '</th> + <th>' . _('Input Tax') . '<br>' . _('GL Account') . '</th> + <th>' . _('Output Tax') . '<br>' . _('GL Account') . '</th> + <th>' . _('Bank') . '</th> + <th>' . _('Bank Account') . '</th> + <th>' . _('Bank Act Type') . '</th> + <th>' . _('Bank Swift') . '</th> + </tr></font>'; $k=0; while ($myrow = DB_fetch_row($result)) { @@ -182,11 +181,11 @@ $myrow[5], $myrow[6], $myrow[7], - $_SERVER['PHP_SELF'] . '?' . SID, + $_SERVER['PHP_SELF'] . '?', $myrow[0], - $_SERVER['PHP_SELF'] . '?' . SID, + $_SERVER['PHP_SELF'] . '?', $myrow[0], - $rootpath . '/TaxAuthorityRates.php?' . SID, + $rootpath . '/TaxAuthorityRates.php?', $myrow[0]); } @@ -200,11 +199,11 @@ if (isset($SelectedTaxAuthID)) { - echo "<div class='centre'><a href='" . $_SERVER['PHP_SELF'] . '?' . SID ."'>" . _('Review all defined tax authority records') . '</a></div>'; + echo '<div class="centre"><a href="' . $_SERVER['PHP_SELF'] .'">' . _('Review all defined tax authority records') . '</a></div>'; } -echo "<p><form method='post' action=" . $_SERVER['PHP_SELF'] . '?' . SID .'>'; +echo '<p><form method="post" action="' . $_SERVER['PHP_SELF'] . '">'; echo '<input type="hidden" name="FormID" value="' . $_SESSION['FormID'] . '" />'; if (isset($SelectedTaxAuthID)) { @@ -237,13 +236,13 @@ } //end of if $SelectedTaxAuthID only do the else when a new record is being entered -$SQL = 'SELECT accountcode, +$SQL = "SELECT accountcode, accountname FROM chartmaster, accountgroups WHERE chartmaster.group_=accountgroups.groupname AND accountgroups.pandl=0 - ORDER BY accountcode'; + ORDER BY accountcode"; $result = DB_query($SQL,$db); if (!isset($_POST['Description'])) { @@ -255,7 +254,7 @@ echo '<tr><td>' . _('Input tax GL Account') . ':</td> - <td><select name=PurchTaxGLCode>'; + <td><select name="PurchTaxGLCode">'; while ($myrow = DB_fetch_array($result)) { if (isset($_POST['PurchTaxGLCode']) and $myrow['accountcode']==$_POST['PurchTaxGLCode']) { @@ -263,7 +262,7 @@ } else { echo '<option VALUE='; } - echo $myrow['accountcode'] . '>' . $myrow['accountname'] . ' ('.$myrow['accountcode'].')'; + echo $myrow['accountcode'] . '>' . $myrow['accountname'] . ' ('.$myrow['accountcode'].')' . '</option>'; } //end while loop @@ -272,7 +271,7 @@ DB_data_seek($result,0); echo '<tr><td>' . _('Output tax GL Account') . ':</td> - <td><select name=TaxGLCode>'; + <td><select name="TaxGLCode">'; while ($myrow = DB_fetch_array($result)) { @@ -281,7 +280,7 @@ } else { echo "<option VALUE='"; } - echo $myrow['accountcode'] . "'>" . $myrow['accountname'] . ' ('.$myrow['accountcode'].')'; + echo $myrow['accountcode'] . "'>" . $myrow['accountname'] . ' ('.$myrow['accountcode'].')' . '</option>'; } //end while loop Modified: trunk/TaxGroups.php =================================================================== --- trunk/TaxGroups.php 2011-04-06 10:01:30 UTC (rev 4540) +++ trunk/TaxGroups.php 2011-04-07 10:23:55 UTC (rev 4541) @@ -1,6 +1,5 @@ <?php /* $Id$*/ -//PageSecurity=15; include('includes/session.inc'); @@ -125,14 +124,14 @@ $myrow = DB_fetch_row($result); if ($myrow[0]>0) { prnMsg( _('Cannot delete this tax group because some customer branches are setup using it'),'warn'); - echo '<br>' . _('There are') . ' ' . $myrow[0] . ' ' . _('customer branches referring to this tax group'); + echo '<br />' . _('There are') . ' ' . $myrow[0] . ' ' . _('customer branches referring to this tax group'); } else { $sql= "SELECT COUNT(*) FROM suppliers WHERE taxgroupid='" . $_GET['SelectedGroup'] . "'"; $result = DB_query($sql,$db); $myrow = DB_fetch_row($result); if ($myrow[0]>0) { prnMsg( _('Cannot delete this tax group because some suppliers are setup using it'),'warn'); - echo '<br>' . _('There are') . ' ' . $myrow[0] . ' ' . _('suppliers referring to this tax group'); + echo '<br />' . _('There are') . ' ' . $myrow[0] . ' ' . _('suppliers referring to this tax group'); } else { $sql="DELETE FROM taxgrouptaxes WHERE taxgroupid='" . $_GET['SelectedGroup'] . "'"; @@ -161,8 +160,8 @@ echo '</div>'; } else { echo '<table class=selection>'; - echo "<tr><th>" . _('Group No') . "</th> - <th>" . _('Tax Group') . "</th></tr>"; + echo '<tr><th>' . _('Group No') . '</th> + <th>' . _('Tax Group') . '</th></tr>'; $k=0; //row colour counter while ($myrow = DB_fetch_array($result)) { @@ -181,9 +180,9 @@ </tr>", $myrow['taxgroupid'], $myrow['taxgroupdescription'], - $_SERVER['PHP_SELF'] . "?" . SID, + $_SERVER['PHP_SELF'] . '?', $myrow['taxgroupid'], - $_SERVER['PHP_SELF'] . "?" . SID, + $_SERVER['PHP_SELF'] . '?', $myrow['taxgroupid'], urlencode($myrow['taxgroupdescription'])); @@ -194,7 +193,7 @@ if (isset($SelectedGroup)) { - echo '<div class="centre"><a href="' . $_SERVER['PHP_SELF'] ."?" . SID . '">' . _('Review Existing Groups') . '</a></div>'; + echo '<div class="centre"><a href="' . $_SERVER['PHP_SELF'] . '">' . _('Review Existing Groups') . '</a></div>'; } if (isset($SelectedGroup)) { @@ -213,7 +212,7 @@ $_POST['GroupName'] = $myrow['taxgroupdescription']; } } -echo '<br>'; +echo '<br />'; echo "<form method='post' action=" . $_SERVER['PHP_SELF'] . "?" . SID . ">"; echo '<input type="hidden" name="FormID" value="' . $_SESSION['FormID'] . '" />'; if( isset($_POST['SelectedGroup'])) { @@ -230,7 +229,7 @@ if (isset($SelectedGroup)) { - echo '</table><br>'; + echo '</table><br />'; $sql = 'SELECT taxid, description as taxname @@ -299,31 +298,31 @@ } echo '</table>'; - echo '<br><div class="centre"><input type="submit" name="UpdateOrder" value="' . _('Update Order') . '"></div>'; + echo '<br /><div class="centre"><input type="submit" name="UpdateOrder" value="' . _('Update Order') . '"></div>'; } echo '</form>'; if (DB_num_rows($Result)>0 ) { - echo '<br>'; - echo '<table class=selection><tr>'; - echo "<th colspan=4>"._('Assigned Taxes')."</th>"; - echo '<th></th>'; - echo "<th colspan=2>"._('Available Taxes')."</th>"; - echo '</tr>'; + echo '<br />'; + echo '<table class=selection> + <tr> + <th colspan=4>'._('Assigned Taxes') . '</th> + <th></th> + <th colspan=2>' . _('Available Taxes') . '</th> + </tr>'; + echo '<tr> + <th>' . _('Tax Auth ID') . '</th> + <th>' . _('Tax Authority Name') . '</th> + <th>' . _('Calculation Order') . '</th> + <th>' . _('Tax on Prior Tax(es)') . '</th> + <th></th> + <th>' . _('Tax Auth ID') . '</th> + <th>' . _('Tax Authority Name') . '</th> + </tr>'; - echo '<tr>'; - echo "<th>" . _('Tax Auth ID') . '</th>'; - echo "<th>" . _('Tax Authority Name') . '</th>'; - echo "<th>" . _('Calculation Order') . '</th>'; - echo "<th>" . _('Tax on Prior Tax(es)') . '</th>'; - echo '<th></th>'; - echo "<th>" . _('Tax Auth ID') . '</th>'; - echo "<th>" . _('Tax Authority Name') . '</th>'; - echo '</tr>'; - } else { - echo '<br><div class="centre">' . _('There are no tax authorities defined to allocate to this tax group').'</div>'; + echo '<br /><div class="centre">' . _('There are no tax authorities defined to allocate to this tax group').'</div>'; } $k=0; //row colour counter @@ -357,7 +356,7 @@ $AvailRow['taxname'], $TaxAuthRow[$TaxAuthUsedPointer]['calculationorder'], $TaxOnTax, - $_SERVER['PHP_SELF'] . "?" . SID, + $_SERVER['PHP_SELF'] . '?', $SelectedGroup, $AvailRow['taxid'] ); @@ -373,7 +372,7 @@ <td><a href=\"%s&SelectedGroup=%s&add=1&TaxAuthority=%s\">" . _('Add') . "</a></td>", $AvailRow['taxid'], $AvailRow['taxname'], - $_SERVER['PHP_SELF'] . "?" . SID, + $_SERVER['PHP_SELF'] . '?', $SelectedGroup, $AvailRow['taxid'] ); Modified: trunk/TopItems.php =================================================================== --- trunk/TopItems.php 2011-04-06 10:01:30 UTC (rev 4540) +++ trunk/TopItems.php 2011-04-07 10:23:55 UTC (rev 4541) @@ -1,6 +1,7 @@ <?php -/* $Revision: 1.3 $ */ -//$PageSecurity = 2; Now from db + +/* $Id$*/ + /* Session started in session.inc for password checking and authorisation level check config.php is in turn included in session.inc*/ include ('includes/session.inc'); @@ -15,24 +16,26 @@ echo '<table cellpadding=3 colspan=4 class=selection>'; //to view store location echo '<tr><td width="150">' . _('Select Location') . ' </td><td>:</td><td><select name=Location>'; - $sql = 'SELECT loccode, + $sql = "SELECT loccode, locationname - FROM `locations`'; + FROM `locations`"; $result = DB_query($sql, $db); echo '<option value="All">' . _('All') . '</option>'; while ($myrow = DB_fetch_array($result)) { - echo "<option VALUE='" . $myrow['loccode'] . "'>" . $myrow['loccode'] . " - " . $myrow['locationname'] . '</option>'; + echo '<option value="' . $myrow['loccode'] . '">' . $myrow['loccode'] . ' - ' . $myrow['locationname'] . '</option>'; } echo '</select></td></tr>'; //to view list of customer - echo '<tr><td width="150">' . _('Select Customer Type') . ' </td><td>:</td><td><select name=Customers>'; - $sql = 'SELECT typename, + echo '<tr><td width="150">' . _('Select Customer Type') . '</td> + <td>:</td> + <td><select name="Customers">'; + $sql = "SELECT typename, typeid - FROM debtortype'; + FROM debtortype"; $result = DB_query($sql, $db); - echo "<option value='All'>" . _('All') . '</option>'; + echo '<option value="All">' . _('All') . '</option>'; while ($myrow = DB_fetch_array($result)) { - echo "<option VALUE='" . $myrow['typeid'] . "'>" . $myrow['typename'] . '</option>'; + echo '<option value="' . $myrow['typeid'] . '">' . $myrow['typename'] . '</option>'; } echo '</select></td> </tr>'; @@ -40,18 +43,18 @@ echo '<tr> <td width="150">' . _('Select Order By ') . ' </td> <td>:</td> <td><select name="Sequence">'; - echo ' <option value="TotalInvoiced">' . _('Total Pieces') . ''; - echo ' <option value="ValueSales">' . _('Value of Sales') . ''; + echo ' <option value="TotalInvoiced">' . _('Total Pieces') . '</option>'; + echo ' <option value="ValueSales">' . _('Value of Sales') . '</option>'; echo ' </select></td> </tr>'; //View number of days echo '<tr><td>' . _('Number Of Days') . ' </td><td>:</td> - <td><input class="number" tabindex="3" type="Text" name=NumberOfDays size="8" maxlength="8" value=0></td> + <td><input class="number" tabindex="3" type="Text" name="NumberOfDays" size="8" maxlength="8" value=0></td> </tr>'; //view number of NumberOfTopItems items echo '<tr> <td>' . _('Number Of Top Items') . ' </td><td>:</td> - <td><input class="number" tabindex="4" type="Text" name=NumberOfTopItems size="8" maxlength="8" value=1></td> + <td><input class="number" tabindex="4" type="Text" name="NumberOfTopItems" size="8" maxlength="8" value=1></td> </tr> <tr> <td></td> @@ -82,7 +85,7 @@ AND debtorsmaster.currcode = currencies.currabrev AND salesorderdetails.ActualDispatchDate >= '" . $FromDate . "' GROUP BY salesorderdetails.stkcode - ORDER BY " . $_POST['Sequence'] . " DESC + ORDER BY '" . $_POST['Sequence'] . "' DESC LIMIT " . $_POST['NumberOfTopItems'] . ""; } else { //the situation if only location type selected "All" if ($_POST['Location'] == 'All') { @@ -103,11 +106,11 @@ AND debtorsmaster.typeid = '" . $_POST['Customers'] . "' AND salesorderdetails.ActualDispatchDate >= '" . $FromDate . "' GROUP BY salesorderdetails.stkcode - ORDER BY " . $_POST['Sequence'] . " DESC + ORDER BY '" . $_POST['Sequence'] . "' DESC LIMIT " . $_POST[NumberOfTopItems] . ""; } else { //the situation if the customer type selected "All" - if ($_POST['Customers'] == "All") { + if ($_POST['Customers'] == 'All') { $SQL = "SELECT salesorderdetails.stkcode, SUM(salesorderdetails.qtyinvoiced) TotalInvoiced, SUM(salesorderdetails.qtyinvoiced * salesorderdetails.unitprice ) AS ValueSales, @@ -145,7 +148,7 @@ AND debtorsmaster.typeid = '" . $_POST['Customers'] . "' AND salesorderdetails.ActualDispatchDate >= '" . $FromDate . "' GROUP BY salesorderdetails.stkcode - ORDER BY " . $_POST['Sequence'] . " DESC + ORDER BY '" . $_POST['Sequence'] . "' DESC LIMIT " . $_POST['NumberOfTopItems'] . ""; } } @@ -163,13 +166,11 @@ <th>' . _('Value Sales') . '</th> <th>' . _('On Hand') . '</th>'; echo $TableHeader; - echo ' - <input type="hidden" value=' . $_POST['Location'] . ' name="Location" /> + echo '<input type="hidden" value=' . $_POST['Location'] . ' name="Location" /> <input type="hidden" value=' . $_POST['Sequence'] . ' name="Sequence" /> <input type="hidden" value=' . $_POST['NumberOfDays'] . ' name="NumberOfDays" /> <input type="hidden" value=' . $_POST['Customers'] . ' name="Customers" /> - <input type="hidden" value=' . $_POST['NumberOfTopItems'] . ' name="NumberOfTopItems" /> - '; + <input type="hidden" value=' . $_POST['NumberOfTopItems'] . ' name="NumberOfTopItems" />'; $k = 0; //row colour counter $i = 1; while ($myrow = DB_fetch_array($result)) { This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <dai...@us...> - 2011-04-06 10:01:38
|
Revision: 4540 http://web-erp.svn.sourceforge.net/web-erp/?rev=4540&view=rev Author: daintree Date: 2011-04-06 10:01:30 +0000 (Wed, 06 Apr 2011) Log Message: ----------- various Modified Paths: -------------- trunk/SuppLoginSetup.php trunk/SuppShiptChgs.php trunk/SuppTransGLAnalysis.php trunk/SystemParameters.php Modified: trunk/SuppLoginSetup.php =================================================================== --- trunk/SuppLoginSetup.php 2011-04-05 10:14:24 UTC (rev 4539) +++ trunk/SuppLoginSetup.php 2011-04-06 10:01:30 UTC (rev 4540) @@ -1,9 +1,7 @@ <?php -/* $Revision: 1.2 $ */ + /* $Id$*/ -//$PageSecurity = 15; - include('includes/session.inc'); $title = _('Supplier Login Configuration'); include('includes/header.inc'); @@ -20,10 +18,9 @@ _('Petty Cash'), _('Setup')); -echo "<a href='" . $rootpath . '/SelectSupplier.php?' . SID . "'>" . _('Back to Suppliers') . '</a><br>'; +echo '<a href="' . $rootpath . '/SelectSupplier.php?">' . _('Back to Suppliers') . '</a><br>'; echo '<p class="page_title_text"><img src="'.$rootpath.'/css/'.$theme.'/images/supplier.png" title="' . _('Supplier') . '" alt="" />' . ' ' . _('Supplier') . ' : ' . $_SESSION['SupplierID'] . _(' has been selected') . '</p><br />'; -//echo '<p class="page_title_text"><img src="'.$rootpath.'/css/'.$theme.'/images/group_add.png" title="' . _('Search') . '" alt="">' . ' ' . $title.'<br>'; //Make an array of the security roles where only one role is active and is ID 1 @@ -32,7 +29,7 @@ //- Only one entry in securitygroups AND the tokenid of this entry == 1 //First get all available security role ID's' -$query_roles = 'SELECT secroleid FROM securityroles'; +$query_roles = "SELECT secroleid FROM securityroles"; $result_roles = DB_query($query_roles, $db); //Check for every security role if they have only one entry in securitygroups, if so check if the tokenid == 1, then store in selection box @@ -101,7 +98,7 @@ $i=0; $ModulesAllowed = ''; while ($i < count($ModuleList)){ - $FormVbl = "Module_" . $i; + $FormVbl = 'Module_' . $i; $ModulesAllowed .= $_POST[($FormVbl)] . ','; $i++; } @@ -200,7 +197,7 @@ prnMsg(_('The demonstration user called demo cannot be deleted'),'error'); } else { */ - $sql='SELECT userid FROM audittrail where userid="'. $SelectedUser .'"'; + $sql="SELECT userid FROM audittrail where userid='" . $SelectedUser ."'"; $result=DB_query($sql, $db); if (DB_num_rows($result)!=0) { prnMsg(_('Cannot delete user as entries already exist in the audit trail'), 'warn'); @@ -234,17 +231,17 @@ $result = DB_query($sql,$db); echo '<table class=selection>'; - echo "<tr><th>" . _('User Login') . "</th> - <th>" . _('Full Name') . "</th> - <th>" . _('Telephone') . "</th> - <th>" . _('Email') . "</th> - <th>" . _('Supplier Code') . "</th> - <th>" . _('Last Visit') . "</th> - <th>" . _('Security Role') ."</th> - <th>" . _('Report Size') ."</th> - <th>" . _('Theme') ."</th> - <th>" . _('Language') ."</th> - </tr>"; + echo '<tr><th>' . _('User Login') . '</th> + <th>' . _('Full Name') . '</th> + <th>' . _('Telephone') . '</th> + <th>' . _('Email') . '</th> + <th>' . _('Supplier Code') . '</th> + <th>' . _('Last Visit') . '</th> + <th>' . _('Security Role') .'</th> + <th>' . _('Report Size') .'</th> + <th>' . _('Theme') .'</th> + <th>' . _('Language') .'</th> + </tr>'; $k=0; //row colour counter @@ -261,19 +258,19 @@ /*The SecurityHeadings array is defined in config.php */ - echo "<td>".$myrow['userid']."</td> - <td>".$myrow['realname']."</td> - <td>".$myrow['phone']."</td> - <td>".$myrow['email']."</td> - <td>".$myrow['supplierid']."</td> - <td>".$LastVisitDate."</td> - <td>".$SecurityRoles[($myrow['fullaccess'])]."</td> - <td>".$myrow['pagesize']."</td> - <td>".$myrow['theme']."</td> - <td>".$myrow['language']."</td> - <td><a href=\"".$_SERVER['PHP_SELF'] . "?" . SID."&SelectedUser=".$myrow[0]."\">" . _('Edit') . "</a></td> - <td><a href=\"".$_SERVER['PHP_SELF'] . "?" . SID."&SelectedUser=".$myrow[0]."&delete=1\">" . _('Delete') . "</a></td> - </tr>"; + echo '<td>'.$myrow['userid'].'</td> + <td>'.$myrow['realname'].'</td> + <td>'.$myrow['phone'].'</td> + <td>'.$myrow['email'].'</td> + <td>'.$myrow['supplierid'].'</td> + <td>'.$LastVisitDate.'</td> + <td>'.$SecurityRoles[($myrow['fullaccess'])].'</td> + <td>'.$myrow['pagesize'].'</td> + <td>'.$myrow['theme'].'</td> + <td>'.$myrow['language'].'</td> + <td><a href="' .$_SERVER['PHP_SELF'] . '?SelectedUser=' . $myrow[0] .'">' . _('Edit') . '</a></td> + <td><a href="' . $_SERVER['PHP_SELF'] . '?SelectedUser=' . $myrow[0] . '&delete=1">' . _('Delete') . '</a></td> + </tr>'; } //END WHILE LIST LOOP echo '</table><br>'; @@ -281,10 +278,10 @@ if (isset($SelectedUser)) { - echo "<div class='centre'><a href='" . $_SERVER['PHP_SELF'] ."?" . SID . "'>" . _('Review Existing Users') . '</a></div><br>'; + echo '<div class="centre"><a href="' . $_SERVER['PHP_SELF'] .'?">' . _('Review Existing Users') . '</a></div><br>'; } -echo "<form method='post' action=" . $_SERVER['PHP_SELF'] . "?" . SID . ">"; +echo '<form method="post" action="' . $_SERVER['PHP_SELF'] . '">'; echo '<input type="hidden" name="FormID" value="' . $_SESSION['FormID'] . '" />'; if (isset($SelectedUser)) { @@ -324,9 +321,9 @@ $_POST['UserLanguage'] = $myrow['language']; $_POST['Blocked'] = $myrow['blocked']; - echo "<input type='hidden' name='SelectedUser' value='" . $SelectedUser . "'>"; - echo "<input type='hidden' name='UserID' value='" . $_POST['UserID'] . "'>"; - echo "<input type='hidden' name='ModulesAllowed' value='" . $_POST['ModulesAllowed'] . "'>"; + echo '<input type="hidden" name="SelectedUser" value="' . $SelectedUser . '">'; + echo '<input type="hidden" name="UserID" value="' . $_POST['UserID'] . '">'; + echo '<input type="hidden" name="ModulesAllowed" value="' . $_POST['ModulesAllowed'] . '">'; echo '<table class=selection> <tr><td>' . _('User code') . ':</td><td>'; echo $_POST['UserID'] . '</td></tr>'; @@ -374,16 +371,16 @@ foreach ($SecurityRoles as $SecKey => $SecVal) { if (isset($_POST['Access']) and $SecKey == $_POST['Access']){ - echo "<option selected value=" . $SecKey . ">" . $SecVal; + echo '<option selected value="' . $SecKey . '">' . $SecVal . '</option>'; } else { - echo "<option value=" . $SecKey . ">" . $SecVal; + echo '<option value="' . $SecKey . '">' . $SecVal . '</option>'; } } echo '</select></td></tr>'; echo '<input type="hidden" name="ID" value="'.$_SESSION['UserID'].'">'; -echo '<tr><td>' . _('Default Location') . ":</td> - <td><select name='DefaultLocation'>"; +echo '<tr><td>' . _('Default Location') . ':</td> + <td><select name="DefaultLocation">'; $sql = "SELECT loccode, locationname FROM locations"; $result = DB_query($sql,$db); @@ -392,10 +389,10 @@ if (isset($_POST['DefaultLocation']) and $myrow['loccode'] == $_POST['DefaultLocation']){ - echo "<option selected value='" . $myrow['loccode'] . "'>" . $myrow['locationname']; + echo '<option selected value="' . $myrow['loccode'] . '">' . $myrow['locationname'] . '</option>'; } else { - echo "<option Value='" . $myrow['loccode'] . "'>" . $myrow['locationname']; + echo '<option Value="' . $myrow['loccode'] . '">' . $myrow['locationname'] . '</option>'; } @@ -407,55 +404,55 @@ echo '<tr><td>'._('Supplier Code').':</td> <td>' . $_POST['Supp'] . '</td></tr>'; -echo '<tr><td>' . _('Reports Page Size') .":</td> - <td><select name='PageSize'>"; +echo '<tr><td>' . _('Reports Page Size') .':</td> + <td><select name="PageSize">'; if(isset($_POST['PageSize']) and $_POST['PageSize']=='A4'){ - echo "<option selected value='A4'>" . _('A4'); + echo '<option selected value="A4">' . _('A4') . '</option>'; } else { - echo "<option value='A4'>A4"; + echo '<option value="A4">' . _('A4') . '</option>'; } if(isset($_POST['PageSize']) and $_POST['PageSize']=='A3'){ - echo "<option selected Value='A3'>" . _('A3'); + echo '<option selected value="A3">' . _('A3') . '</option>'; } else { - echo "<option value='A3'>A3"; + echo '<option value="A3">' . _('A3') . '</option>'; } if(isset($_POST['PageSize']) and $_POST['PageSize']=='A3_landscape'){ - echo "<option selected Value='A3_landscape'>" . _('A3') . ' ' . _('landscape'); + echo '<option selected Value="A3_landscape">' . _('A3') . ' ' . _('landscape') . '</option>'; } else { - echo "<option value='A3_landscape'>" . _('A3') . ' ' . _('landscape'); + echo '<option value="A3_landscape">' . _('A3') . ' ' . _('landscape') . '</option>'; } if(isset($_POST['PageSize']) and $_POST['PageSize']=='letter'){ - echo "<option selected Value='letter'>" . _('Letter'); + echo '<option selected value="letter">' . _('Letter') . '</option>'; } else { - echo "<option value='letter'>" . _('Letter'); + echo '<option value="letter">' . _('Letter') . '</option>'; } if(isset($_POST['PageSize']) and $_POST['PageSize']=='letter_landscape'){ - echo "<option selected Value='letter_landscape'>" . _('Letter') . ' ' . _('landscape'); + echo '<option selected value="letter_landscape">' . _('Letter') . ' ' . _('landscape') . '</option>'; } else { - echo "<option value='letter_landscape'>" . _('Letter') . ' ' . _('landscape'); + echo '<option value="letter_landscape">' . _('Letter') . ' ' . _('landscape') . '</option>'; } if(isset($_POST['PageSize']) and $_POST['PageSize']=='legal'){ - echo "<option selected value='legal'>" . _('Legal'); + echo '<option selected value="legal">' . _('Legal') . '</option>'; } else { - echo "<option Value='legal'>" . _('Legal'); + echo '<option Value="legal">' . _('Legal') . '</option>'; } if(isset($_POST['PageSize']) and $_POST['PageSize']=='legal_landscape'){ - echo "<option selected value='legal_landscape'>" . _('Legal') . ' ' . _('landscape'); + echo '<option selected value="legal_landscape">' . _('Legal') . ' ' . _('landscape') . '</option>'; } else { - echo "<option value='legal_landscape'>" . _('Legal') . ' ' . _('landscape'); + echo '<option value="legal_landscape">' . _('Legal') . ' ' . _('landscape') . '</option>'; } echo '</select></td></tr>'; echo '<tr> - <td>' . _('Theme') . ":</td> - <td><select name='Theme'>"; + <td>' . _('Theme') . ':</td> + <td><select name="Theme">'; $ThemeDirectory = dir('css/'); @@ -465,11 +462,11 @@ if (is_dir("css/$ThemeName") AND $ThemeName != '.' AND $ThemeName != '..' AND $ThemeName != 'CVS'){ if (isset($_POST['Theme']) and $_POST['Theme'] == $ThemeName){ - echo "<option selected value='$ThemeName'>$ThemeName"; + echo '<option selected value="' . $ThemeName . '">' . $ThemeName . '</option>'; } else if (!isset($_POST['Theme']) and ($_SESSION['DefaultTheme']==$ThemeName)) { - echo "<option selected value='$ThemeName'>$ThemeName"; + echo '<option selected value="' . $ThemeName . '">' . $ThemeName . '</option>'; } else { - echo "<option value='$ThemeName'>$ThemeName"; + echo '<option value="' . $ThemeName . '">' . $ThemeName . '</option>'; } } } @@ -478,8 +475,8 @@ echo '<tr> - <td>' . _('Language') . ":</td> - <td><select name='UserLanguage'>"; + <td>' . _('Language') . ':</td> + <td><select name="UserLanguage">'; $LangDirHandle = dir('locale/'); @@ -489,11 +486,11 @@ if (is_dir('locale/' . $LanguageEntry) AND $LanguageEntry != '..' AND $LanguageEntry != 'CVS' AND $LanguageEntry!='.'){ if (isset($_POST['UserLanguage']) and $_POST['UserLanguage'] == $LanguageEntry){ - echo "<option selected value='$LanguageEntry'>$LanguageEntry"; + echo '<option selected value="' . $LanguageEntry . '">' . $LanguageEntry . '</option>'; } elseif (!isset($_POST['UserLanguage']) and $LanguageEntry == $DefaultLanguage) { - echo "<option selected value='$LanguageEntry'>$LanguageEntry"; + echo '<option selected value="' . $LanguageEntry . '">' . $LanguageEntry . '</option>'; } else { - echo "<option value='$LanguageEntry'>$LanguageEntry"; + echo '<option value="' . $LanguageEntry . '">' . $LanguageEntry . '</option>'; } } } @@ -519,11 +516,11 @@ echo '<tr><td>' . _('Account Status') . ":</td><td><select name='Blocked'>"; if ($_POST['Blocked']==0){ - echo '<option selected value=0>' . _('Open'); - echo '<option value=1>' . _('Blocked'); + echo '<option selected value=0>' . _('Open') . '</option>'; + echo '<option value=1>' . _('Blocked') . '</option>'; } else { - echo '<option selected value=1>' . _('Blocked'); - echo '<option value=0>' . _('Open'); + echo '<option selected value=1>' . _('Blocked') . '</option>'; + echo '<option value=0>' . _('Open') . '</option>'; } echo '</select></td></tr>'; Modified: trunk/SuppShiptChgs.php =================================================================== --- trunk/SuppShiptChgs.php 2011-04-05 10:14:24 UTC (rev 4539) +++ trunk/SuppShiptChgs.php 2011-04-06 10:01:30 UTC (rev 4540) @@ -10,8 +10,6 @@ include('includes/DefineSuppTransClass.php'); -//$PageSecurity = 5; - /* Session started here for password checking and authorisation level check */ include('includes/session.inc'); @@ -20,14 +18,14 @@ include('includes/header.inc'); if ($_SESSION['SuppTrans']->InvoiceOrCredit == 'Invoice'){ - echo '<a href="' . $rootpath . '/SupplierInvoice.php?' . SID . '">' . _('Back to Invoice Entry') . '</a>'; + echo '<a href="' . $rootpath . '/SupplierInvoice.php">' . _('Back to Invoice Entry') . '</a>'; } else { - echo '<a href="' . $rootpath . '/SupplierCredit.php?' . SID . '">' . _('Back to Credit Note Entry') . '</a>'; + echo '<a href="' . $rootpath . '/SupplierCredit.php">' . _('Back to Credit Note Entry') . '</a>'; } if (!isset($_SESSION['SuppTrans'])){ prnMsg(_('Shipment charges or credits are entered against supplier invoices or credit notes respectively') . '. ' . _('To enter supplier transactions the supplier must first be selected from the supplier selection screen') . ', ' . _('then the link to enter a supplier invoice or credit note must be clicked on'),'info'); - echo "<br><a href='$rootpath/SelectSupplier.php?" . SID ."'>" . _('Select A Supplier') . '</a>'; + echo '<br /><a href="' . $rootpath . '/SelectSupplier.php">' . _('Select A Supplier') . '</a>'; exit; /*It all stops here if there aint no supplier selected and invoice/credit initiated ie $_SESSION['SuppTrans'] started off*/ } @@ -37,8 +35,13 @@ if (isset($_POST['AddShiptChgToInvoice'])){ $InputError = False; - if ($_POST['ShiptRef'] == ""){ - $_POST['ShiptRef'] = $_POST['ShiptSelection']; + if ($_POST['ShiptRef'] == ''){ + if ($_POST['ShiptSelection']==''){ + prnMsg(_('Shipment charges must reference a shipment. It appears that no shipment has been entered'),'error'); + $InputError = True; + } else { + $_POST['ShiptRef'] = $_POST['ShiptSelection']; + } } else { $result = DB_query("SELECT shiptref FROM shipments WHERE shiptref='". $_POST['ShiptRef'] . "'",$db); if (DB_num_rows($result)==0) { @@ -96,7 +99,7 @@ </table><br />'; /*Set up a form to allow input of new Shipment charges */ -echo '<form action="' . $_SERVER['PHP_SELF'] . '?' . SID . '" method="post">'; +echo '<form action="' . $_SERVER['PHP_SELF'] . '" method="post">'; echo '<input type="hidden" name="FormID" value="' . $_SESSION['FormID'] . '" />'; if (!isset($_POST['ShiptRef'])) { @@ -104,24 +107,24 @@ } echo '<table class=selection>'; echo '<tr><td>' . _('Shipment Reference') . ':</td> - <td><input type="text" name="ShiptRef" size="12" maxlength="11" VALUE="' . $_POST['ShiptRef'] . '"></td></tr>'; -echo '<tr><td>' . _('Shipment Selection') . ':<br> ' . _('If you know the code enter it above') . '<br>' . _('otherwise select the shipment from the list') . '</td><td><select name="ShiptSelection">'; + <td><input type="text" name="ShiptRef" size="12" maxlength="11" value="' . $_POST['ShiptRef'] . '"></td></tr>'; +echo '<tr><td>' . _('Shipment Selection') . ':<br /> ' . _('If you know the code enter it above') . '<br />' . _('otherwise select the shipment from the list') . '</td><td><select name="ShiptSelection">'; -$sql = 'SELECT shiptref, - vessel, - eta, - suppname - FROM shipments INNER JOIN suppliers - ON shipments.supplierid=suppliers.supplierid - WHERE closed=0'; +$sql = "SELECT shiptref, + vessel, + eta, + suppname + FROM shipments INNER JOIN suppliers + ON shipments.supplierid=suppliers.supplierid + WHERE closed='0'"; $result = DB_query($sql, $db); while ($myrow = DB_fetch_array($result)) { if (isset($_POST['ShiptSelection']) and $myrow['shiptref']==$_POST['ShiptSelection']) { - echo '<option selected VALUE='; + echo '<option selected value='; } else { - echo '<option VALUE='; + echo '<option value='; } echo $myrow['shiptref'] . '>' . $myrow['shiptref'] . ' - ' . $myrow['vessel'] . ' ' . _('ETA') . ' ' . ConvertSQLDate($myrow['eta']) . ' ' . _('from') . ' ' . $myrow['suppname'] . '</option>'; } @@ -132,10 +135,10 @@ $_POST['Amount']=0; } echo '<tr><td>' . _('Amount') . ':</td> - <td><input type="text" name="Amount" size="12" maxlength="11" VALUE="' . $_POST['Amount'] . '"></td></tr>'; + <td><input type="text" name="Amount" size="12" maxlength="11" value="' . $_POST['Amount'] . '"></td></tr>'; echo '</table>'; -echo '<br /><div class=centre><input type="submit" name="AddShiptChgToInvoice" VALUE="' . _('Enter Shipment Charge') . '"></div>'; +echo '<br /><div class=centre><input type="submit" name="AddShiptChgToInvoice" value="' . _('Enter Shipment Charge') . '"></div>'; echo '</form>'; include('includes/footer.inc'); Modified: trunk/SuppTransGLAnalysis.php =================================================================== --- trunk/SuppTransGLAnalysis.php 2011-04-05 10:14:24 UTC (rev 4539) +++ trunk/SuppTransGLAnalysis.php 2011-04-06 10:01:30 UTC (rev 4540) @@ -1,13 +1,13 @@ <?php + /* $Id$*/ + /*The supplier transaction uses the SuppTrans class to hold the information about the invoice or credit note the SuppTrans class contains an array of GRNs objects - containing details of GRNs for invoicing/crediting and also an array of GLCodes objects - only used if the AP - GL link is effective */ include('includes/DefineSuppTransClass.php'); -//$PageSecurity = 5; - /* Session started in header.inc for password checking and authorisation level check */ include('includes/session.inc'); @@ -17,7 +17,7 @@ if (!isset($_SESSION['SuppTrans'])){ prnMsg(_('To enter a supplier invoice or credit note the supplier must first be selected from the supplier selection screen') . ', ' . _('then the link to enter a supplier invoice or supplier credit note must be clicked on'),'info'); - echo "<br><a href='$rootpath/SelectSupplier.php?" . SID ."'>" . _('Select A Supplier') . '</a>'; + echo '<br><a href="' . $rootpath . '/SelectSupplier.php">' . _('Select A Supplier') . '</a>'; include('includes/footer.inc'); exit; /*It all stops here if there aint no supplier selected and transaction initiated ie $_SESSION['SuppTrans'] started off*/ @@ -63,10 +63,10 @@ if ($InputError == False){ $_SESSION['SuppTrans']->Add_GLCodes_To_Trans($_POST['GLCode'], - $GLActName, - $_POST['Amount'], - $_POST['JobRef'], - $_POST['Narrative']); + $GLActName, + $_POST['Amount'], + $_POST['JobRef'], + $_POST['Narrative']); unset($_POST['GLCode']); unset($_POST['Amount']); unset($_POST['JobRef']); @@ -92,11 +92,11 @@ echo '</p><table cellpadding=2 class=selection>'; $TableHeader = '<tr> - <th>' . _('Account') . '</th> - <th>' . _('Name') . '</th> - <th>' . _('Amount') . '<br>' . _('in') . ' ' . $_SESSION['SuppTrans']->CurrCode . '</th> - <th>' . _('Narrative') . '</th> - </tr>'; + <th>' . _('Account') . '</th> + <th>' . _('Name') . '</th> + <th>' . _('Amount') . '<br>' . _('in') . ' ' . $_SESSION['SuppTrans']->CurrCode . '</th> + <th>' . _('Narrative') . '</th> + </tr>'; echo $TableHeader; $TotalGLValue=0; $i=0; @@ -107,8 +107,8 @@ <td>' . $EnteredGLCode->GLCode . '</td> <td>' . $EnteredGLCode->GLActName . '</td> <td class=number>' . number_format($EnteredGLCode->Amount,2) . '</td> - <td>' . $EnteredGLCode->Narrative . "</td> - <td><a href='" . $_SERVER['PHP_SELF'] . "?" . SID . "Delete=" . $EnteredGLCode->Counter . "'>" . _('Delete') . '</a></td> + <td>' . $EnteredGLCode->Narrative . '</td> + <td><a href="' . $_SERVER['PHP_SELF'] . '?Delete=' . $EnteredGLCode->Counter . '">' . _('Delete') . '</a></td> </tr>'; $TotalGLValue += $EnteredGLCode->Amount; @@ -128,13 +128,13 @@ if ($_SESSION['SuppTrans']->InvoiceOrCredit == 'Invoice'){ - echo '<br /><a href="' . $rootpath . '/SupplierInvoice.php?' . SID . '">' . _('Back to Invoice Entry') . '</a>'; + echo '<br /><a href="' . $rootpath . '/SupplierInvoice.php">' . _('Back to Invoice Entry') . '</a>'; } else { - echo '<br /><a href="' . $rootpath . '/SupplierCredit.php?' . SID . '">' . _('Back to Credit Note Entry') . '</a>'; + echo '<br /><a href="' . $rootpath . '/SupplierCredit.php">' . _('Back to Credit Note Entry') . '</a>'; } /*Set up a form to allow input of new GL entries */ -echo '<form action="' . $_SERVER['PHP_SELF'] . '?' . SID . '" method="post">'; +echo '<form action="' . $_SERVER['PHP_SELF'] . '" method="post">'; echo '<input type="hidden" name="FormID" value="' . $_SESSION['FormID'] . '" />'; echo '<br /><table class=selection>'; @@ -150,7 +150,7 @@ <td>' . _('Account Selection') . ':<br>(' . _('If you know the code enter it above') . '<br>' . _('otherwise select the account from the list') . ')</td> <td><select name="AcctSelection">'; -$sql = 'SELECT accountcode, accountname FROM chartmaster ORDER BY accountcode'; +$sql = "SELECT accountcode, accountname FROM chartmaster ORDER BY accountcode"; $result = DB_query($sql, $db); echo '<option value=""></option>'; Modified: trunk/SystemParameters.php =================================================================== --- trunk/SystemParameters.php 2011-04-05 10:14:24 UTC (rev 4539) +++ trunk/SystemParameters.php 2011-04-06 10:01:30 UTC (rev 4540) @@ -2,8 +2,6 @@ /* $Id$*/ -//$PageSecurity =15; - include('includes/session.inc'); $title = _('System Configuration'); @@ -311,10 +309,11 @@ echo '<input type="hidden" name="FormID" value="' . $_SESSION['FormID'] . '" />'; echo '<table cellpadding=2 class=selection width=98%>'; -$TableHeader = '<tr><th>' . _('System Variable Name') . '</th> - <th>' . _('Value') . '</th> - <th>' . _('Notes') . '</th>'; - +$TableHeader = '<tr> + <th>' . _('System Variable Name') . '</th> + <th>' . _('Value') . '</th> + <th>' . _('Notes') . '</th>'; + echo '<tr><th colspan=3>' . _('General Settings') . '</th></tr>'; echo $TableHeader; @@ -334,10 +333,11 @@ $ThemeDirectory = dir('css/'); while (false != ($ThemeName = $ThemeDirectory->read())){ if (is_dir("css/$ThemeName") AND $ThemeName != '.' AND $ThemeName != '..' AND $ThemeName != '.svn'){ - if ($_SESSION['DefaultTheme'] == $ThemeName) - echo "<option selected value='$ThemeName'>$ThemeName"; - else - echo "<option value='$ThemeName'>$ThemeName"; + if ($_SESSION['DefaultTheme'] == $ThemeName) { + echo '<option selected value="' . $ThemeName . '">' . $ThemeName . '</option>'; + } else { + echo '<option value="' . $ThemeName . '">' . $ThemeName . '</option>'; + } } } echo '</select></td> @@ -364,17 +364,17 @@ // Check Credit Limits echo '<tr style="outline: 1px solid"><td>' . _('Check Credit Limits') . ':</td> <td><select Name="X_CheckCreditLimits"> - <option '.($_SESSION['CheckCreditLimits']==0?'selected ':'').'value="0">'._('Do not check').' - <option '.($_SESSION['CheckCreditLimits']==1?'selected ':'').'value="1">'._('Warn on breach').' - <option '.($_SESSION['CheckCreditLimits']==2?'selected ':'').'value="2">'._('Prohibit Sales').' + <option '.($_SESSION['CheckCreditLimits']==0?'selected ':'').'value="0">'._('Do not check').'</option> + <option '.($_SESSION['CheckCreditLimits']==1?'selected ':'').'value="1">'._('Warn on breach').'</option> + <option '.($_SESSION['CheckCreditLimits']==2?'selected ':'').'value="2">'._('Prohibit Sales').'</option> </select></td> <td>' . _('Credit limits can be checked at order entry to warn only or to stop the order from being entered where it would take a customer account balance over their limit') . '</td></tr>'; // Show_Settled_LastMonth echo '<tr style="outline: 1px solid"><td>' . _('Show Settled Last Month') . ':</td> <td><select Name="X_Show_Settled_LastMonth"> - <option '.($_SESSION['Show_Settled_LastMonth']?'selected ':'').'value="1">'._('Yes').' - <option '.(!$_SESSION['Show_Settled_LastMonth']?'selected ':'').'value="0">'._('No').' + <option '.($_SESSION['Show_Settled_LastMonth']?'selected ':'').'value="1">'._('Yes').'</option> + <option '.(!$_SESSION['Show_Settled_LastMonth']?'selected ':'').'value="0">'._('No').'</option> </select></td> <td>' . _('This setting refers to the format of customer statements. If the invoices and credit notes that have been paid and settled during the course of the current month should be shown then select Yes. Selecting No will only show currently outstanding invoices, credits and payments that have not been allocated') . '</td></tr>'; @@ -396,15 +396,15 @@ // SO_AllowSameItemMultipleTimes echo '<tr style="outline: 1px solid"><td>' . _('Sales Order Allows Same Item Multiple Times') . ':</td> <td><select Name="X_SO_AllowSameItemMultipleTimes"> - <option '.($_SESSION['SO_AllowSameItemMultipleTimes']?'selected ':'').'value="1">'._('Yes').' - <option '.(!$_SESSION['SO_AllowSameItemMultipleTimes']?'selected ':'').'value="0">'._('No').' + <option '.($_SESSION['SO_AllowSameItemMultipleTimes']?'selected ':'').'value="1">'._('Yes').'</option> + <option '.(!$_SESSION['SO_AllowSameItemMultipleTimes']?'selected ':'').'value="0">'._('No').'</option> </select></td><td> </td></tr>'; //'AllowOrderLineItemNarrative' echo '<tr style="outline: 1px solid"><td>' . _('Order Entry allows Line Item Narrative') . ':</td> <td><select Name="X_AllowOrderLineItemNarrative"> - <option '.($_SESSION['AllowOrderLineItemNarrative']=='1'?'selected ':'').'value="1">'._('Allow Narrative Entry').' - <option '.($_SESSION['AllowOrderLineItemNarrative']=='0'?'selected ':'').'value="0">'._('No Narrative Line').' + <option '.($_SESSION['AllowOrderLineItemNarrative']=='1'?'selected ':'').'value="1">'._('Allow Narrative Entry').'</option> + <option '.($_SESSION['AllowOrderLineItemNarrative']=='0'?'selected ':'').'value="0">'._('No Narrative Line').'</option> </select></td> <td>' . _('Select whether or not to allow entry of narrative on order line items. This narrative will appear on invoices and packing slips. Useful mainly for service businesses.') . '</td> </tr>'; @@ -412,8 +412,8 @@ //'RequirePickingNote' echo '<tr style="outline: 1px solid"><td>' . _('A picking note must be produced before an order can be delivered') . ':</td> <td><select Name="X_RequirePickingNote"> - <option '.($_SESSION['RequirePickingNote']=='1'?'selected ':'').'value="1">'._('Yes').' - <option '.($_SESSION['RequirePickingNote']=='0'?'selected ':'').'value="0">'._('No').' + <option '.($_SESSION['RequirePickingNote']=='1'?'selected ':'').'value="1">'._('Yes').'</option> + <option '.($_SESSION['RequirePickingNote']=='0'?'selected ':'').'value="0">'._('No').'</option> </select></td> <td>' . _('Select whether or not a picking note must be produced before an order can be delivered to a customer.') . '</td> </tr>'; @@ -421,8 +421,8 @@ //UpdateCurrencyRatesDaily echo '<tr style="outline: 1px solid"><td>' . _('Auto Update Exchange Rates Daily') . ':</td> <td><select Name="X_UpdateCurrencyRatesDaily"> - <option '.($_SESSION['UpdateCurrencyRatesDaily']!='0'?'selected ':'').'value="1">'._('Automatic').' - <option '.($_SESSION['UpdateCurrencyRatesDaily']=='0'?'selected ':'').'value="0">'._('Manual').' + <option '.($_SESSION['UpdateCurrencyRatesDaily']!='0'?'selected ':'').'value="1">'._('Automatic').'</option> + <option '.($_SESSION['UpdateCurrencyRatesDaily']=='0'?'selected ':'').'value="0">'._('Manual').'</option> </select></td> <td>' . _('Automatic updates to exchange rates will retrieve the latest daily rates from the European Central Bank once per day - when the first user logs in for the day. Manual will never update the rates automatically - exchange rates will need to be maintained manually') . '</td> </tr>'; @@ -430,8 +430,8 @@ //Default Packing Note Format echo '<tr style="outline: 1px solid"><td>' . _('Format of Packing Slips') . ':</td> <td><select Name="X_PackNoteFormat"> - <option '.($_SESSION['PackNoteFormat']=='1'?'selected ':'').'value="1">'._('Laser Printed').' - <option '.($_SESSION['PackNoteFormat']=='2'?'selected ':'').'value="2">'._('Special Stationery').' + <option '.($_SESSION['PackNoteFormat']=='1'?'selected ':'').'value="1">'._('Laser Printed').'</option> + <option '.($_SESSION['PackNoteFormat']=='2'?'selected ':'').'value="2">'._('Special Stationery').'</option> </select></td> <td>' . _('Choose the format that packing notes should be printed by default') . '</td> </tr>'; @@ -439,8 +439,8 @@ //Default Invoice Format echo '<tr style="outline: 1px solid"><td>' . _('Invoice Orientation') . ':</td> <td><select Name="X_InvoicePortraitFormat"> - <option '.($_SESSION['InvoicePortraitFormat']=='0'?'selected ':'').'value="0">'._('Landscape').' - <option '.($_SESSION['InvoicePortraitFormat']=='1'?'selected ':'').'value="1">'._('Portrait').' + <option '.($_SESSION['InvoicePortraitFormat']=='0'?'selected ':'').'value="0">'._('Landscape').'</option> + <option '.($_SESSION['InvoicePortraitFormat']=='1'?'selected ':'').'value="1">'._('Portrait').'</option> </select></td> <td>' . _('Select the invoice layout') . '</td> </tr>'; @@ -448,8 +448,8 @@ //Blind packing note echo '<tr style="outline: 1px solid"><td>' . _('Show company details on packing slips') . ':</td> <td><select Name="X_DefaultBlindPackNote"> - <option '.($_SESSION['DefaultBlindPackNote']=="1"?'selected ':'').'value="1">'._('Show Company Details').' - <option '.($_SESSION['DefaultBlindPackNote']=="2"?'selected ':'').'value="2">'._('Hide Company Details').' + <option '.($_SESSION['DefaultBlindPackNote']=='1'?'selected ':'').'value="1">'._('Show Company Details').'</option> + <option '.($_SESSION['DefaultBlindPackNote']=='2'?'selected ':'').'value="2">'._('Hide Company Details').'</option> </select></td> <td>' . _('Customer branches can be set by default not to print packing slips with the company logo and address. This is useful for companies that ship to customers customers and to show the source of the shipment would be inappropriate. There is an option on the setup of customer branches to ship blind, this setting is the default applied to all new customer branches') . '</td> </tr>'; @@ -465,21 +465,21 @@ // AllowSalesOfZeroCostItems echo '<tr style="outline: 1px solid"><td>' . _('Allow Sales Of Zero Cost Items') . ':</td> <td><select Name="X_AllowSalesOfZeroCostItems"> - <option '.($_SESSION['AllowSalesOfZeroCostItems']?'selected ':'').'value="1">'._('Yes').' - <option '.(!$_SESSION['AllowSalesOfZeroCostItems']?'selected ':'').'value="0">'._('No').' + <option '.($_SESSION['AllowSalesOfZeroCostItems']?'selected ':'').'value="1">'._('Yes').'</option> + <option '.(!$_SESSION['AllowSalesOfZeroCostItems']?'selected ':'').'value="0">'._('No').'</option> </select></td> <td>' . _('If an item selected at order entry does not have a cost set up then if this parameter is set to No then the order line will not be able to be entered') . '</td></tr>'; // CreditingControlledItems_MustExist echo '<tr style="outline: 1px solid"><td>' . _('Controlled Items Must Exist For Crediting') . ':</td> <td><select Name="X_CreditingControlledItems_MustExist"> - <option '.($_SESSION['CreditingControlledItems_MustExist']?'selected ':'').'value="1">'._('Yes').' - <option '.(!$_SESSION['CreditingControlledItems_MustExist']?'selected ':'').'value="0">'._('No').' + <option '.($_SESSION['CreditingControlledItems_MustExist']?'selected ':'').'value="1">'._('Yes').'</option> + <option '.(!$_SESSION['CreditingControlledItems_MustExist']?'selected ':'').'value="0">'._('No').'</option> </select></td> <td>' . _('This parameter relates to the behaviour of the controlled items code. If a serial numbered item has not previously existed then a credit note for it will not be allowed if this is set to Yes') . '</td></tr>'; // DefaultPriceList -$sql = 'SELECT typeabbrev, sales_type FROM salestypes ORDER BY sales_type'; +$sql = "SELECT typeabbrev, sales_type FROM salestypes ORDER BY sales_type"; $ErrMsg = _('Could not load price lists'); $result = DB_query($sql,$db,$ErrMsg); echo '<tr style="outline: 1px solid"><td>' . _('Default Price List') . ':</td>'; @@ -495,16 +495,16 @@ <td>' . _('This price list is used as a last resort where there is no price set up for an item in the price list that the customer is set up for') . '</td></tr>'; // Default_Shipper -$sql = 'SELECT shipper_id, shippername FROM shippers ORDER BY shippername'; +$sql = "SELECT shipper_id, shippername FROM shippers ORDER BY shippername"; $ErrMsg = _('Could not load shippers'); $result = DB_query($sql,$db,$ErrMsg); echo '<tr style="outline: 1px solid"><td>' . _('Default Shipper') . ':</td>'; echo '<td><select Name="X_Default_Shipper">'; if( DB_num_rows($result) == 0 ) { - echo '<option selected value="">'._('Unavailable'); + echo '<option selected value="">'._('Unavailable') . '</option>'; } else { while( $row = DB_fetch_array($result) ) { - echo '<option '.($_SESSION['Default_Shipper'] == $row['shipper_id']?'selected ':'').'value="'.$row['shipper_id'].'">'.$row['shippername']; + echo '<option '.($_SESSION['Default_Shipper'] == $row['shipper_id']?'selected ':'').'value="'.$row['shipper_id'].'">'.$row['shippername'] . '</option>'; } } echo '</select></td> @@ -513,8 +513,8 @@ // DoFreightCalc echo '<tr style="outline: 1px solid"><td>' . _('Do Freight Calculation') . ':</td> <td><select Name="X_DoFreightCalc"> - <option '.($_SESSION['DoFreightCalc']?'selected ':'').'value="1">'._('Yes').' - <option '.(!$_SESSION['DoFreightCalc']?'selected ':'').'value="0">'._('No').' + <option '.($_SESSION['DoFreightCalc']?'selected ':'').'value="1">'._('Yes').'</option> + <option '.(!$_SESSION['DoFreightCalc']?'selected ':'').'value="0">'._('No').'</option> </select></td> <td>' . _('If this is set to Yes then the system will attempt to calculate the freight cost of a dispatch based on the weight and cubic and the data defined for each shipper and their rates for shipping to various locations. The results of this calculation will only be meaningful if the data is entered for the item weight and volume in the stock item setup for all items and the freight costs for each shipper properly maintained.') . '</td></tr>'; @@ -529,26 +529,26 @@ <td><select Name="X_AutoDebtorNo">'; if ($_SESSION['AutoDebtorNo']==0) { - echo '<option selected value=0>' . _('Manual Entry'); - echo '<option value=1>' . _('Automatic'); + echo '<option selected value=0>' . _('Manual Entry') . '</option>'; + echo '<option value=1>' . _('Automatic') . '</option>'; } else { - echo '<option selected value=1>' . _('Automatic'); - echo '<option value=0>' . _('Manual Entry'); + echo '<option selected value=1>' . _('Automatic') . '</option>'; + echo '<option value=0>' . _('Manual Entry') . '</option>'; } echo '</select></td> <td>' . _('Set to Automatic - customer codes are automatically created - as a sequential number') .'</td></tr>'; //==HJ== drop down list for tax category -$sql = 'SELECT taxcatid, taxcatname FROM taxcategories ORDER BY taxcatname'; +$sql = "SELECT taxcatid, taxcatname FROM taxcategories ORDER BY taxcatname"; $ErrMsg = _('Could not load tax categories table'); $result = DB_query($sql,$db,$ErrMsg); echo '<tr style="outline: 1px solid"><td>' . _('Default Tax Category') . ':</td>'; echo '<td><select Name="X_DefaultTaxCategory">'; if( DB_num_rows($result) == 0 ) { - echo '<option selected value="">'._('Unavailable'); + echo '<option selected value="">'._('Unavailable') . '</option>'; } else { while( $row = DB_fetch_array($result) ) { - echo '<option '.($_SESSION['DefaultTaxCategory'] == $row['taxcatid']?'selected ':'').'value="'.$row['taxcatid'].'">'.$row['taxcatname']; + echo '<option '.($_SESSION['DefaultTaxCategory'] == $row['taxcatid']?'selected ':'').'value="'.$row['taxcatid'].'">'.$row['taxcatname'] . '</option>'; } } echo '</select></td> @@ -557,17 +557,17 @@ //TaxAuthorityReferenceName echo '<tr style="outline: 1px solid"><td>' . _('TaxAuthorityReferenceName') . ':</td> - <td><input type="Text" Name="X_TaxAuthorityReferenceName" size=16 maxlength=25 value="' . $_SESSION['TaxAuthorityReferenceName'] . '"></td> + <td><input type="Text" Name="X_TaxAuthotaxcatid, taxcatname FROM taxcategoriesrityReferenceName" size=16 maxlength=25 value="' . $_SESSION['TaxAuthorityReferenceName'] . '"></td> <td>' . _('This parameter is what is displayed on tax invoices and credits for the tax authority of the company eg. in Australian this would by A.B.N.: - in NZ it would be GST No: in the UK it would be VAT Regn. No') .'</td></tr>'; // CountryOfOperation -$sql = 'SELECT currabrev, country FROM currencies ORDER BY country'; +$sql = "SELECT currabrev, country FROM currencies ORDER BY country"; $ErrMsg = _('Could not load the countries from the currency table'); $result = DB_query($sql,$db,$ErrMsg); echo '<tr style="outline: 1px solid"><td>' . _('Country Of Operation') . ':</td>'; echo '<td><select name="X_CountryOfOperation">'; if( DB_num_rows($result) == 0 ) { - echo '<option selected value="">'._('Unavailable'); + echo '<option selected value="">'._('Unavailable') . '</option>'; } else { while( $row = DB_fetch_array($result) ) { echo '<option '.($_SESSION['CountryOfOperation'] == $row['currabrev']?'selected ':'').'value="'.$row['currabrev'].'">'.$row['country'] . '</option>'; @@ -586,8 +586,8 @@ //Show values on GRN echo '<tr style="outline: 1px solid"><td>' . _('Show order values on GRN') . ':</td> <td><select Name="X_ShowValueOnGRN"> - <option '.($_SESSION['ShowValueOnGRN']?'selected ':'').'value="1">'._('Yes').' - <option '.(!$_SESSION['ShowValueOnGRN']?'selected ':'').'value="0">'._('No').' + <option '.($_SESSION['ShowValueOnGRN']?'selected ':'').'value="1">'._('Yes').'</option> + <option '.(!$_SESSION['ShowValueOnGRN']?'selected ':'').'value="0">'._('No').'</option> </select></td> <td>' . _('Should the value of the purchased stock be shown on the GRN screen') . '</td> </tr>'; @@ -595,16 +595,16 @@ // Check_Qty_Charged_vs_Del_Qty echo '<tr style="outline: 1px solid"><td>' . _('Check Quantity Charged vs Deliver Qty') . ':</td> <td><select Name="X_Check_Qty_Charged_vs_Del_Qty"> - <option '.($_SESSION['Check_Qty_Charged_vs_Del_Qty']?'selected ':'').'value="1">'._('Yes').' - <option '.(!$_SESSION['Check_Qty_Charged_vs_Del_Qty']?'selected ':'').'value="0">'._('No').' + <option '.($_SESSION['Check_Qty_Charged_vs_Del_Qty']?'selected ':'').'value="1">'._('Yes').'</option> + <option '.(!$_SESSION['Check_Qty_Charged_vs_Del_Qty']?'selected ':'').'value="0">'._('No').'</option> </select></td> <td>' . _('In entry of AP invoices this determines whether or not to check the quantities received into stock tie up with the quantities invoiced') .'</td></tr>'; // Check_Price_Charged_vs_Order_Price echo '<tr style="outline: 1px solid"><td>' . _('Check Price Charged vs Order Price') . ':</td> <td><select Name="X_Check_Price_Charged_vs_Order_Price"> - <option '.($_SESSION['Check_Price_Charged_vs_Order_Price']?'selected ':'').'value="1">'._('Yes').' - <option '.(!$_SESSION['Check_Price_Charged_vs_Order_Price']?'selected ':'').'value="0">'._('No').' + <option '.($_SESSION['Check_Price_Charged_vs_Order_Price']?'selected ':'').'value="1">'._('Yes').'</option> + <option '.(!$_SESSION['Check_Price_Charged_vs_Order_Price']?'selected ':'').'value="0">'._('No').'</option> </select></td> <td>' . _('In entry of AP invoices this parameter determines whether or not to check invoice prices tie up to ordered prices') .'</td></tr>'; @@ -628,8 +628,8 @@ // AutoAuthorisePO echo '<tr style="outline: 1px solid"><td>' . _('Automatically authorise purchase orders if user has authority') . ':</td> <td><select Name="X_AutoAuthorisePO"> - <option '.($_SESSION['AutoAuthorisePO'] ?'selected ':'').'value="1">'._('Yes').' - <option '.(!$_SESSION['AutoAuthorisePO'] ?'selected ':'').'value="0">'._('No').' + <option '.($_SESSION['AutoAuthorisePO'] ?'selected ':'').'value="1">'._('Yes').'</option> + <option '.(!$_SESSION['AutoAuthorisePO'] ?'selected ':'').'value="0">'._('No').'</option> </select></td><td>' . _('If the user changing an existing purchase order or adding a new puchase order is set up to authorise purchase orders and the order is within their limit, then the purchase order status is automatically set to authorised') . '</td></tr>'; @@ -652,7 +652,7 @@ echo '<tr style="outline: 1px solid"><td>' . _('Financial Year Ends On') . ':</td> <td><select Name="X_YearEnd">'; for ($i=1; $i <= sizeof($MonthNames); $i++ ) - echo '<option '.($_SESSION['YearEnd'] == $i ? 'selected ' : '').'value="'.$i.'">'.$MonthNames[$i]; + echo '<option '.($_SESSION['YearEnd'] == $i ? 'selected ' : '').'value="'.$i.'">'.$MonthNames[$i] . '</option>'; echo '</select></td> <td>' . _('Defining the month in which the financial year ends enables the system to provide useful defaults for general ledger reports') .'</td></tr>'; @@ -673,9 +673,9 @@ <td>' . _('Picture files of items can be uploaded to the server. The system will check that files uploaded are less than this size (in KB) before they will be allowed to be uploaded. Large pictures will make the system slow and will be difficult to view in the stock maintenance screen.') .'</td> </tr>'; //NumberOfMonthMustBeShown -$sql = 'SELECT confvalue +$sql = "SELECT confvalue FROM `config` - WHERE confname ="numberOfMonthMustBeShown"'; + WHERE confname ='numberOfMonthMustBeShown'"; $ErrMsg = _('Could not load the Number Of Month Must be Shown'); $result = DB_query($sql,$db,$ErrMsg); @@ -700,6 +700,7 @@ if (is_dir($CompanyDirectory . $DirEntry) AND $DirEntry != '..' AND $DirEntry!='.' + AND $DirEntry!='.svn' AND $DirEntry != 'CVS' AND $DirEntry != 'reports' AND $DirEntry != 'locale' @@ -729,6 +730,7 @@ AND $DirEntry != '..' AND $DirEntry != 'includes' AND $DirEntry!='.' + AND $DirEntry!='.svn' AND $DirEntry != 'doc' AND $DirEntry != 'css' AND $DirEntry != 'CVS' @@ -854,7 +856,7 @@ echo '<tr style="outline: 1px solid"><td>' . _('Prohibit GL Journals to Periods Prior To') . ':</td> <td><select Name="X_ProhibitPostingsBefore">'; -$sql = 'SELECT lastdate_in_period FROM periods ORDER BY periodno DESC'; +$sql = "SELECT 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)){ @@ -952,8 +954,8 @@ //DefineControlledOnWOEntry echo '<tr style="outline: 1px solid"><td>' . _('Controlled Items Defined At Work Order Entry') . ':</td> <td><select Name="X_DefineControlledOnWOEntry"> - <option '.($_SESSION['DefineControlledOnWOEntry']?'selected ':'').'value="1">'._('Yes').' - <option '.(!$_SESSION['DefineControlledOnWOEntry']?'selected ':'').'value="0">'._('No').' + <option '.($_SESSION['DefineControlledOnWOEntry']?'selected ':'').'value="1">'._('Yes').'</option> + <option '.(!$_SESSION['DefineControlledOnWOEntry']?'selected ':'').'value="0">'._('No').'</option> </select></td> <td>' . _('When set to yes, controlled items are defined at the time of the work order creation. Otherwise controlled items (serial numbers and batch/roll/lot references) are entered at the time the finished items are received against the work order') . '</td></tr>'; @@ -974,7 +976,7 @@ echo '<tr style="outline: 1px solid"><td>' . _('Default Factory Location') . ':</td> <td><select Name="X_DefaultFactoryLocation">'; -$sql = 'SELECT loccode,locationname FROM locations'; +$sql = "SELECT loccode,locationname FROM locations"; $ErrMsg = _('Could not load locations table'); $result = DB_query($sql,$db,$ErrMsg); while ($LocationRow = DB_fetch_array($result)){ @@ -995,7 +997,9 @@ <td>' . _('The email address for the purchasing manager, used to receive notifications by the tendering system') .'</td></tr>'; -echo '</table><br /><div class="centre"><input type="Submit" Name="submit" value="' . _('Update') . '"></div></form>'; +echo '</table> + <br /><div class="centre"><input type="Submit" Name="submit" value="' . _('Update') . '"></div> + </form>'; include('includes/footer.inc'); ?> \ 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: <dai...@us...> - 2011-04-06 10:01:37
|
Revision: 4540 http://web-erp.svn.sourceforge.net/web-erp/?rev=4540&view=rev Author: daintree Date: 2011-04-06 10:01:30 +0000 (Wed, 06 Apr 2011) Log Message: ----------- various Modified Paths: -------------- trunk/SuppLoginSetup.php trunk/SuppShiptChgs.php trunk/SuppTransGLAnalysis.php trunk/SystemParameters.php Modified: trunk/SuppLoginSetup.php =================================================================== --- trunk/SuppLoginSetup.php 2011-04-05 10:14:24 UTC (rev 4539) +++ trunk/SuppLoginSetup.php 2011-04-06 10:01:30 UTC (rev 4540) @@ -1,9 +1,7 @@ <?php -/* $Revision: 1.2 $ */ + /* $Id$*/ -//$PageSecurity = 15; - include('includes/session.inc'); $title = _('Supplier Login Configuration'); include('includes/header.inc'); @@ -20,10 +18,9 @@ _('Petty Cash'), _('Setup')); -echo "<a href='" . $rootpath . '/SelectSupplier.php?' . SID . "'>" . _('Back to Suppliers') . '</a><br>'; +echo '<a href="' . $rootpath . '/SelectSupplier.php?">' . _('Back to Suppliers') . '</a><br>'; echo '<p class="page_title_text"><img src="'.$rootpath.'/css/'.$theme.'/images/supplier.png" title="' . _('Supplier') . '" alt="" />' . ' ' . _('Supplier') . ' : ' . $_SESSION['SupplierID'] . _(' has been selected') . '</p><br />'; -//echo '<p class="page_title_text"><img src="'.$rootpath.'/css/'.$theme.'/images/group_add.png" title="' . _('Search') . '" alt="">' . ' ' . $title.'<br>'; //Make an array of the security roles where only one role is active and is ID 1 @@ -32,7 +29,7 @@ //- Only one entry in securitygroups AND the tokenid of this entry == 1 //First get all available security role ID's' -$query_roles = 'SELECT secroleid FROM securityroles'; +$query_roles = "SELECT secroleid FROM securityroles"; $result_roles = DB_query($query_roles, $db); //Check for every security role if they have only one entry in securitygroups, if so check if the tokenid == 1, then store in selection box @@ -101,7 +98,7 @@ $i=0; $ModulesAllowed = ''; while ($i < count($ModuleList)){ - $FormVbl = "Module_" . $i; + $FormVbl = 'Module_' . $i; $ModulesAllowed .= $_POST[($FormVbl)] . ','; $i++; } @@ -200,7 +197,7 @@ prnMsg(_('The demonstration user called demo cannot be deleted'),'error'); } else { */ - $sql='SELECT userid FROM audittrail where userid="'. $SelectedUser .'"'; + $sql="SELECT userid FROM audittrail where userid='" . $SelectedUser ."'"; $result=DB_query($sql, $db); if (DB_num_rows($result)!=0) { prnMsg(_('Cannot delete user as entries already exist in the audit trail'), 'warn'); @@ -234,17 +231,17 @@ $result = DB_query($sql,$db); echo '<table class=selection>'; - echo "<tr><th>" . _('User Login') . "</th> - <th>" . _('Full Name') . "</th> - <th>" . _('Telephone') . "</th> - <th>" . _('Email') . "</th> - <th>" . _('Supplier Code') . "</th> - <th>" . _('Last Visit') . "</th> - <th>" . _('Security Role') ."</th> - <th>" . _('Report Size') ."</th> - <th>" . _('Theme') ."</th> - <th>" . _('Language') ."</th> - </tr>"; + echo '<tr><th>' . _('User Login') . '</th> + <th>' . _('Full Name') . '</th> + <th>' . _('Telephone') . '</th> + <th>' . _('Email') . '</th> + <th>' . _('Supplier Code') . '</th> + <th>' . _('Last Visit') . '</th> + <th>' . _('Security Role') .'</th> + <th>' . _('Report Size') .'</th> + <th>' . _('Theme') .'</th> + <th>' . _('Language') .'</th> + </tr>'; $k=0; //row colour counter @@ -261,19 +258,19 @@ /*The SecurityHeadings array is defined in config.php */ - echo "<td>".$myrow['userid']."</td> - <td>".$myrow['realname']."</td> - <td>".$myrow['phone']."</td> - <td>".$myrow['email']."</td> - <td>".$myrow['supplierid']."</td> - <td>".$LastVisitDate."</td> - <td>".$SecurityRoles[($myrow['fullaccess'])]."</td> - <td>".$myrow['pagesize']."</td> - <td>".$myrow['theme']."</td> - <td>".$myrow['language']."</td> - <td><a href=\"".$_SERVER['PHP_SELF'] . "?" . SID."&SelectedUser=".$myrow[0]."\">" . _('Edit') . "</a></td> - <td><a href=\"".$_SERVER['PHP_SELF'] . "?" . SID."&SelectedUser=".$myrow[0]."&delete=1\">" . _('Delete') . "</a></td> - </tr>"; + echo '<td>'.$myrow['userid'].'</td> + <td>'.$myrow['realname'].'</td> + <td>'.$myrow['phone'].'</td> + <td>'.$myrow['email'].'</td> + <td>'.$myrow['supplierid'].'</td> + <td>'.$LastVisitDate.'</td> + <td>'.$SecurityRoles[($myrow['fullaccess'])].'</td> + <td>'.$myrow['pagesize'].'</td> + <td>'.$myrow['theme'].'</td> + <td>'.$myrow['language'].'</td> + <td><a href="' .$_SERVER['PHP_SELF'] . '?SelectedUser=' . $myrow[0] .'">' . _('Edit') . '</a></td> + <td><a href="' . $_SERVER['PHP_SELF'] . '?SelectedUser=' . $myrow[0] . '&delete=1">' . _('Delete') . '</a></td> + </tr>'; } //END WHILE LIST LOOP echo '</table><br>'; @@ -281,10 +278,10 @@ if (isset($SelectedUser)) { - echo "<div class='centre'><a href='" . $_SERVER['PHP_SELF'] ."?" . SID . "'>" . _('Review Existing Users') . '</a></div><br>'; + echo '<div class="centre"><a href="' . $_SERVER['PHP_SELF'] .'?">' . _('Review Existing Users') . '</a></div><br>'; } -echo "<form method='post' action=" . $_SERVER['PHP_SELF'] . "?" . SID . ">"; +echo '<form method="post" action="' . $_SERVER['PHP_SELF'] . '">'; echo '<input type="hidden" name="FormID" value="' . $_SESSION['FormID'] . '" />'; if (isset($SelectedUser)) { @@ -324,9 +321,9 @@ $_POST['UserLanguage'] = $myrow['language']; $_POST['Blocked'] = $myrow['blocked']; - echo "<input type='hidden' name='SelectedUser' value='" . $SelectedUser . "'>"; - echo "<input type='hidden' name='UserID' value='" . $_POST['UserID'] . "'>"; - echo "<input type='hidden' name='ModulesAllowed' value='" . $_POST['ModulesAllowed'] . "'>"; + echo '<input type="hidden" name="SelectedUser" value="' . $SelectedUser . '">'; + echo '<input type="hidden" name="UserID" value="' . $_POST['UserID'] . '">'; + echo '<input type="hidden" name="ModulesAllowed" value="' . $_POST['ModulesAllowed'] . '">'; echo '<table class=selection> <tr><td>' . _('User code') . ':</td><td>'; echo $_POST['UserID'] . '</td></tr>'; @@ -374,16 +371,16 @@ foreach ($SecurityRoles as $SecKey => $SecVal) { if (isset($_POST['Access']) and $SecKey == $_POST['Access']){ - echo "<option selected value=" . $SecKey . ">" . $SecVal; + echo '<option selected value="' . $SecKey . '">' . $SecVal . '</option>'; } else { - echo "<option value=" . $SecKey . ">" . $SecVal; + echo '<option value="' . $SecKey . '">' . $SecVal . '</option>'; } } echo '</select></td></tr>'; echo '<input type="hidden" name="ID" value="'.$_SESSION['UserID'].'">'; -echo '<tr><td>' . _('Default Location') . ":</td> - <td><select name='DefaultLocation'>"; +echo '<tr><td>' . _('Default Location') . ':</td> + <td><select name="DefaultLocation">'; $sql = "SELECT loccode, locationname FROM locations"; $result = DB_query($sql,$db); @@ -392,10 +389,10 @@ if (isset($_POST['DefaultLocation']) and $myrow['loccode'] == $_POST['DefaultLocation']){ - echo "<option selected value='" . $myrow['loccode'] . "'>" . $myrow['locationname']; + echo '<option selected value="' . $myrow['loccode'] . '">' . $myrow['locationname'] . '</option>'; } else { - echo "<option Value='" . $myrow['loccode'] . "'>" . $myrow['locationname']; + echo '<option Value="' . $myrow['loccode'] . '">' . $myrow['locationname'] . '</option>'; } @@ -407,55 +404,55 @@ echo '<tr><td>'._('Supplier Code').':</td> <td>' . $_POST['Supp'] . '</td></tr>'; -echo '<tr><td>' . _('Reports Page Size') .":</td> - <td><select name='PageSize'>"; +echo '<tr><td>' . _('Reports Page Size') .':</td> + <td><select name="PageSize">'; if(isset($_POST['PageSize']) and $_POST['PageSize']=='A4'){ - echo "<option selected value='A4'>" . _('A4'); + echo '<option selected value="A4">' . _('A4') . '</option>'; } else { - echo "<option value='A4'>A4"; + echo '<option value="A4">' . _('A4') . '</option>'; } if(isset($_POST['PageSize']) and $_POST['PageSize']=='A3'){ - echo "<option selected Value='A3'>" . _('A3'); + echo '<option selected value="A3">' . _('A3') . '</option>'; } else { - echo "<option value='A3'>A3"; + echo '<option value="A3">' . _('A3') . '</option>'; } if(isset($_POST['PageSize']) and $_POST['PageSize']=='A3_landscape'){ - echo "<option selected Value='A3_landscape'>" . _('A3') . ' ' . _('landscape'); + echo '<option selected Value="A3_landscape">' . _('A3') . ' ' . _('landscape') . '</option>'; } else { - echo "<option value='A3_landscape'>" . _('A3') . ' ' . _('landscape'); + echo '<option value="A3_landscape">' . _('A3') . ' ' . _('landscape') . '</option>'; } if(isset($_POST['PageSize']) and $_POST['PageSize']=='letter'){ - echo "<option selected Value='letter'>" . _('Letter'); + echo '<option selected value="letter">' . _('Letter') . '</option>'; } else { - echo "<option value='letter'>" . _('Letter'); + echo '<option value="letter">' . _('Letter') . '</option>'; } if(isset($_POST['PageSize']) and $_POST['PageSize']=='letter_landscape'){ - echo "<option selected Value='letter_landscape'>" . _('Letter') . ' ' . _('landscape'); + echo '<option selected value="letter_landscape">' . _('Letter') . ' ' . _('landscape') . '</option>'; } else { - echo "<option value='letter_landscape'>" . _('Letter') . ' ' . _('landscape'); + echo '<option value="letter_landscape">' . _('Letter') . ' ' . _('landscape') . '</option>'; } if(isset($_POST['PageSize']) and $_POST['PageSize']=='legal'){ - echo "<option selected value='legal'>" . _('Legal'); + echo '<option selected value="legal">' . _('Legal') . '</option>'; } else { - echo "<option Value='legal'>" . _('Legal'); + echo '<option Value="legal">' . _('Legal') . '</option>'; } if(isset($_POST['PageSize']) and $_POST['PageSize']=='legal_landscape'){ - echo "<option selected value='legal_landscape'>" . _('Legal') . ' ' . _('landscape'); + echo '<option selected value="legal_landscape">' . _('Legal') . ' ' . _('landscape') . '</option>'; } else { - echo "<option value='legal_landscape'>" . _('Legal') . ' ' . _('landscape'); + echo '<option value="legal_landscape">' . _('Legal') . ' ' . _('landscape') . '</option>'; } echo '</select></td></tr>'; echo '<tr> - <td>' . _('Theme') . ":</td> - <td><select name='Theme'>"; + <td>' . _('Theme') . ':</td> + <td><select name="Theme">'; $ThemeDirectory = dir('css/'); @@ -465,11 +462,11 @@ if (is_dir("css/$ThemeName") AND $ThemeName != '.' AND $ThemeName != '..' AND $ThemeName != 'CVS'){ if (isset($_POST['Theme']) and $_POST['Theme'] == $ThemeName){ - echo "<option selected value='$ThemeName'>$ThemeName"; + echo '<option selected value="' . $ThemeName . '">' . $ThemeName . '</option>'; } else if (!isset($_POST['Theme']) and ($_SESSION['DefaultTheme']==$ThemeName)) { - echo "<option selected value='$ThemeName'>$ThemeName"; + echo '<option selected value="' . $ThemeName . '">' . $ThemeName . '</option>'; } else { - echo "<option value='$ThemeName'>$ThemeName"; + echo '<option value="' . $ThemeName . '">' . $ThemeName . '</option>'; } } } @@ -478,8 +475,8 @@ echo '<tr> - <td>' . _('Language') . ":</td> - <td><select name='UserLanguage'>"; + <td>' . _('Language') . ':</td> + <td><select name="UserLanguage">'; $LangDirHandle = dir('locale/'); @@ -489,11 +486,11 @@ if (is_dir('locale/' . $LanguageEntry) AND $LanguageEntry != '..' AND $LanguageEntry != 'CVS' AND $LanguageEntry!='.'){ if (isset($_POST['UserLanguage']) and $_POST['UserLanguage'] == $LanguageEntry){ - echo "<option selected value='$LanguageEntry'>$LanguageEntry"; + echo '<option selected value="' . $LanguageEntry . '">' . $LanguageEntry . '</option>'; } elseif (!isset($_POST['UserLanguage']) and $LanguageEntry == $DefaultLanguage) { - echo "<option selected value='$LanguageEntry'>$LanguageEntry"; + echo '<option selected value="' . $LanguageEntry . '">' . $LanguageEntry . '</option>'; } else { - echo "<option value='$LanguageEntry'>$LanguageEntry"; + echo '<option value="' . $LanguageEntry . '">' . $LanguageEntry . '</option>'; } } } @@ -519,11 +516,11 @@ echo '<tr><td>' . _('Account Status') . ":</td><td><select name='Blocked'>"; if ($_POST['Blocked']==0){ - echo '<option selected value=0>' . _('Open'); - echo '<option value=1>' . _('Blocked'); + echo '<option selected value=0>' . _('Open') . '</option>'; + echo '<option value=1>' . _('Blocked') . '</option>'; } else { - echo '<option selected value=1>' . _('Blocked'); - echo '<option value=0>' . _('Open'); + echo '<option selected value=1>' . _('Blocked') . '</option>'; + echo '<option value=0>' . _('Open') . '</option>'; } echo '</select></td></tr>'; Modified: trunk/SuppShiptChgs.php =================================================================== --- trunk/SuppShiptChgs.php 2011-04-05 10:14:24 UTC (rev 4539) +++ trunk/SuppShiptChgs.php 2011-04-06 10:01:30 UTC (rev 4540) @@ -10,8 +10,6 @@ include('includes/DefineSuppTransClass.php'); -//$PageSecurity = 5; - /* Session started here for password checking and authorisation level check */ include('includes/session.inc'); @@ -20,14 +18,14 @@ include('includes/header.inc'); if ($_SESSION['SuppTrans']->InvoiceOrCredit == 'Invoice'){ - echo '<a href="' . $rootpath . '/SupplierInvoice.php?' . SID . '">' . _('Back to Invoice Entry') . '</a>'; + echo '<a href="' . $rootpath . '/SupplierInvoice.php">' . _('Back to Invoice Entry') . '</a>'; } else { - echo '<a href="' . $rootpath . '/SupplierCredit.php?' . SID . '">' . _('Back to Credit Note Entry') . '</a>'; + echo '<a href="' . $rootpath . '/SupplierCredit.php">' . _('Back to Credit Note Entry') . '</a>'; } if (!isset($_SESSION['SuppTrans'])){ prnMsg(_('Shipment charges or credits are entered against supplier invoices or credit notes respectively') . '. ' . _('To enter supplier transactions the supplier must first be selected from the supplier selection screen') . ', ' . _('then the link to enter a supplier invoice or credit note must be clicked on'),'info'); - echo "<br><a href='$rootpath/SelectSupplier.php?" . SID ."'>" . _('Select A Supplier') . '</a>'; + echo '<br /><a href="' . $rootpath . '/SelectSupplier.php">' . _('Select A Supplier') . '</a>'; exit; /*It all stops here if there aint no supplier selected and invoice/credit initiated ie $_SESSION['SuppTrans'] started off*/ } @@ -37,8 +35,13 @@ if (isset($_POST['AddShiptChgToInvoice'])){ $InputError = False; - if ($_POST['ShiptRef'] == ""){ - $_POST['ShiptRef'] = $_POST['ShiptSelection']; + if ($_POST['ShiptRef'] == ''){ + if ($_POST['ShiptSelection']==''){ + prnMsg(_('Shipment charges must reference a shipment. It appears that no shipment has been entered'),'error'); + $InputError = True; + } else { + $_POST['ShiptRef'] = $_POST['ShiptSelection']; + } } else { $result = DB_query("SELECT shiptref FROM shipments WHERE shiptref='". $_POST['ShiptRef'] . "'",$db); if (DB_num_rows($result)==0) { @@ -96,7 +99,7 @@ </table><br />'; /*Set up a form to allow input of new Shipment charges */ -echo '<form action="' . $_SERVER['PHP_SELF'] . '?' . SID . '" method="post">'; +echo '<form action="' . $_SERVER['PHP_SELF'] . '" method="post">'; echo '<input type="hidden" name="FormID" value="' . $_SESSION['FormID'] . '" />'; if (!isset($_POST['ShiptRef'])) { @@ -104,24 +107,24 @@ } echo '<table class=selection>'; echo '<tr><td>' . _('Shipment Reference') . ':</td> - <td><input type="text" name="ShiptRef" size="12" maxlength="11" VALUE="' . $_POST['ShiptRef'] . '"></td></tr>'; -echo '<tr><td>' . _('Shipment Selection') . ':<br> ' . _('If you know the code enter it above') . '<br>' . _('otherwise select the shipment from the list') . '</td><td><select name="ShiptSelection">'; + <td><input type="text" name="ShiptRef" size="12" maxlength="11" value="' . $_POST['ShiptRef'] . '"></td></tr>'; +echo '<tr><td>' . _('Shipment Selection') . ':<br /> ' . _('If you know the code enter it above') . '<br />' . _('otherwise select the shipment from the list') . '</td><td><select name="ShiptSelection">'; -$sql = 'SELECT shiptref, - vessel, - eta, - suppname - FROM shipments INNER JOIN suppliers - ON shipments.supplierid=suppliers.supplierid - WHERE closed=0'; +$sql = "SELECT shiptref, + vessel, + eta, + suppname + FROM shipments INNER JOIN suppliers + ON shipments.supplierid=suppliers.supplierid + WHERE closed='0'"; $result = DB_query($sql, $db); while ($myrow = DB_fetch_array($result)) { if (isset($_POST['ShiptSelection']) and $myrow['shiptref']==$_POST['ShiptSelection']) { - echo '<option selected VALUE='; + echo '<option selected value='; } else { - echo '<option VALUE='; + echo '<option value='; } echo $myrow['shiptref'] . '>' . $myrow['shiptref'] . ' - ' . $myrow['vessel'] . ' ' . _('ETA') . ' ' . ConvertSQLDate($myrow['eta']) . ' ' . _('from') . ' ' . $myrow['suppname'] . '</option>'; } @@ -132,10 +135,10 @@ $_POST['Amount']=0; } echo '<tr><td>' . _('Amount') . ':</td> - <td><input type="text" name="Amount" size="12" maxlength="11" VALUE="' . $_POST['Amount'] . '"></td></tr>'; + <td><input type="text" name="Amount" size="12" maxlength="11" value="' . $_POST['Amount'] . '"></td></tr>'; echo '</table>'; -echo '<br /><div class=centre><input type="submit" name="AddShiptChgToInvoice" VALUE="' . _('Enter Shipment Charge') . '"></div>'; +echo '<br /><div class=centre><input type="submit" name="AddShiptChgToInvoice" value="' . _('Enter Shipment Charge') . '"></div>'; echo '</form>'; include('includes/footer.inc'); Modified: trunk/SuppTransGLAnalysis.php =================================================================== --- trunk/SuppTransGLAnalysis.php 2011-04-05 10:14:24 UTC (rev 4539) +++ trunk/SuppTransGLAnalysis.php 2011-04-06 10:01:30 UTC (rev 4540) @@ -1,13 +1,13 @@ <?php + /* $Id$*/ + /*The supplier transaction uses the SuppTrans class to hold the information about the invoice or credit note the SuppTrans class contains an array of GRNs objects - containing details of GRNs for invoicing/crediting and also an array of GLCodes objects - only used if the AP - GL link is effective */ include('includes/DefineSuppTransClass.php'); -//$PageSecurity = 5; - /* Session started in header.inc for password checking and authorisation level check */ include('includes/session.inc'); @@ -17,7 +17,7 @@ if (!isset($_SESSION['SuppTrans'])){ prnMsg(_('To enter a supplier invoice or credit note the supplier must first be selected from the supplier selection screen') . ', ' . _('then the link to enter a supplier invoice or supplier credit note must be clicked on'),'info'); - echo "<br><a href='$rootpath/SelectSupplier.php?" . SID ."'>" . _('Select A Supplier') . '</a>'; + echo '<br><a href="' . $rootpath . '/SelectSupplier.php">' . _('Select A Supplier') . '</a>'; include('includes/footer.inc'); exit; /*It all stops here if there aint no supplier selected and transaction initiated ie $_SESSION['SuppTrans'] started off*/ @@ -63,10 +63,10 @@ if ($InputError == False){ $_SESSION['SuppTrans']->Add_GLCodes_To_Trans($_POST['GLCode'], - $GLActName, - $_POST['Amount'], - $_POST['JobRef'], - $_POST['Narrative']); + $GLActName, + $_POST['Amount'], + $_POST['JobRef'], + $_POST['Narrative']); unset($_POST['GLCode']); unset($_POST['Amount']); unset($_POST['JobRef']); @@ -92,11 +92,11 @@ echo '</p><table cellpadding=2 class=selection>'; $TableHeader = '<tr> - <th>' . _('Account') . '</th> - <th>' . _('Name') . '</th> - <th>' . _('Amount') . '<br>' . _('in') . ' ' . $_SESSION['SuppTrans']->CurrCode . '</th> - <th>' . _('Narrative') . '</th> - </tr>'; + <th>' . _('Account') . '</th> + <th>' . _('Name') . '</th> + <th>' . _('Amount') . '<br>' . _('in') . ' ' . $_SESSION['SuppTrans']->CurrCode . '</th> + <th>' . _('Narrative') . '</th> + </tr>'; echo $TableHeader; $TotalGLValue=0; $i=0; @@ -107,8 +107,8 @@ <td>' . $EnteredGLCode->GLCode . '</td> <td>' . $EnteredGLCode->GLActName . '</td> <td class=number>' . number_format($EnteredGLCode->Amount,2) . '</td> - <td>' . $EnteredGLCode->Narrative . "</td> - <td><a href='" . $_SERVER['PHP_SELF'] . "?" . SID . "Delete=" . $EnteredGLCode->Counter . "'>" . _('Delete') . '</a></td> + <td>' . $EnteredGLCode->Narrative . '</td> + <td><a href="' . $_SERVER['PHP_SELF'] . '?Delete=' . $EnteredGLCode->Counter . '">' . _('Delete') . '</a></td> </tr>'; $TotalGLValue += $EnteredGLCode->Amount; @@ -128,13 +128,13 @@ if ($_SESSION['SuppTrans']->InvoiceOrCredit == 'Invoice'){ - echo '<br /><a href="' . $rootpath . '/SupplierInvoice.php?' . SID . '">' . _('Back to Invoice Entry') . '</a>'; + echo '<br /><a href="' . $rootpath . '/SupplierInvoice.php">' . _('Back to Invoice Entry') . '</a>'; } else { - echo '<br /><a href="' . $rootpath . '/SupplierCredit.php?' . SID . '">' . _('Back to Credit Note Entry') . '</a>'; + echo '<br /><a href="' . $rootpath . '/SupplierCredit.php">' . _('Back to Credit Note Entry') . '</a>'; } /*Set up a form to allow input of new GL entries */ -echo '<form action="' . $_SERVER['PHP_SELF'] . '?' . SID . '" method="post">'; +echo '<form action="' . $_SERVER['PHP_SELF'] . '" method="post">'; echo '<input type="hidden" name="FormID" value="' . $_SESSION['FormID'] . '" />'; echo '<br /><table class=selection>'; @@ -150,7 +150,7 @@ <td>' . _('Account Selection') . ':<br>(' . _('If you know the code enter it above') . '<br>' . _('otherwise select the account from the list') . ')</td> <td><select name="AcctSelection">'; -$sql = 'SELECT accountcode, accountname FROM chartmaster ORDER BY accountcode'; +$sql = "SELECT accountcode, accountname FROM chartmaster ORDER BY accountcode"; $result = DB_query($sql, $db); echo '<option value=""></option>'; Modified: trunk/SystemParameters.php =================================================================== --- trunk/SystemParameters.php 2011-04-05 10:14:24 UTC (rev 4539) +++ trunk/SystemParameters.php 2011-04-06 10:01:30 UTC (rev 4540) @@ -2,8 +2,6 @@ /* $Id$*/ -//$PageSecurity =15; - include('includes/session.inc'); $title = _('System Configuration'); @@ -311,10 +309,11 @@ echo '<input type="hidden" name="FormID" value="' . $_SESSION['FormID'] . '" />'; echo '<table cellpadding=2 class=selection width=98%>'; -$TableHeader = '<tr><th>' . _('System Variable Name') . '</th> - <th>' . _('Value') . '</th> - <th>' . _('Notes') . '</th>'; - +$TableHeader = '<tr> + <th>' . _('System Variable Name') . '</th> + <th>' . _('Value') . '</th> + <th>' . _('Notes') . '</th>'; + echo '<tr><th colspan=3>' . _('General Settings') . '</th></tr>'; echo $TableHeader; @@ -334,10 +333,11 @@ $ThemeDirectory = dir('css/'); while (false != ($ThemeName = $ThemeDirectory->read())){ if (is_dir("css/$ThemeName") AND $ThemeName != '.' AND $ThemeName != '..' AND $ThemeName != '.svn'){ - if ($_SESSION['DefaultTheme'] == $ThemeName) - echo "<option selected value='$ThemeName'>$ThemeName"; - else - echo "<option value='$ThemeName'>$ThemeName"; + if ($_SESSION['DefaultTheme'] == $ThemeName) { + echo '<option selected value="' . $ThemeName . '">' . $ThemeName . '</option>'; + } else { + echo '<option value="' . $ThemeName . '">' . $ThemeName . '</option>'; + } } } echo '</select></td> @@ -364,17 +364,17 @@ // Check Credit Limits echo '<tr style="outline: 1px solid"><td>' . _('Check Credit Limits') . ':</td> <td><select Name="X_CheckCreditLimits"> - <option '.($_SESSION['CheckCreditLimits']==0?'selected ':'').'value="0">'._('Do not check').' - <option '.($_SESSION['CheckCreditLimits']==1?'selected ':'').'value="1">'._('Warn on breach').' - <option '.($_SESSION['CheckCreditLimits']==2?'selected ':'').'value="2">'._('Prohibit Sales').' + <option '.($_SESSION['CheckCreditLimits']==0?'selected ':'').'value="0">'._('Do not check').'</option> + <option '.($_SESSION['CheckCreditLimits']==1?'selected ':'').'value="1">'._('Warn on breach').'</option> + <option '.($_SESSION['CheckCreditLimits']==2?'selected ':'').'value="2">'._('Prohibit Sales').'</option> </select></td> <td>' . _('Credit limits can be checked at order entry to warn only or to stop the order from being entered where it would take a customer account balance over their limit') . '</td></tr>'; // Show_Settled_LastMonth echo '<tr style="outline: 1px solid"><td>' . _('Show Settled Last Month') . ':</td> <td><select Name="X_Show_Settled_LastMonth"> - <option '.($_SESSION['Show_Settled_LastMonth']?'selected ':'').'value="1">'._('Yes').' - <option '.(!$_SESSION['Show_Settled_LastMonth']?'selected ':'').'value="0">'._('No').' + <option '.($_SESSION['Show_Settled_LastMonth']?'selected ':'').'value="1">'._('Yes').'</option> + <option '.(!$_SESSION['Show_Settled_LastMonth']?'selected ':'').'value="0">'._('No').'</option> </select></td> <td>' . _('This setting refers to the format of customer statements. If the invoices and credit notes that have been paid and settled during the course of the current month should be shown then select Yes. Selecting No will only show currently outstanding invoices, credits and payments that have not been allocated') . '</td></tr>'; @@ -396,15 +396,15 @@ // SO_AllowSameItemMultipleTimes echo '<tr style="outline: 1px solid"><td>' . _('Sales Order Allows Same Item Multiple Times') . ':</td> <td><select Name="X_SO_AllowSameItemMultipleTimes"> - <option '.($_SESSION['SO_AllowSameItemMultipleTimes']?'selected ':'').'value="1">'._('Yes').' - <option '.(!$_SESSION['SO_AllowSameItemMultipleTimes']?'selected ':'').'value="0">'._('No').' + <option '.($_SESSION['SO_AllowSameItemMultipleTimes']?'selected ':'').'value="1">'._('Yes').'</option> + <option '.(!$_SESSION['SO_AllowSameItemMultipleTimes']?'selected ':'').'value="0">'._('No').'</option> </select></td><td> </td></tr>'; //'AllowOrderLineItemNarrative' echo '<tr style="outline: 1px solid"><td>' . _('Order Entry allows Line Item Narrative') . ':</td> <td><select Name="X_AllowOrderLineItemNarrative"> - <option '.($_SESSION['AllowOrderLineItemNarrative']=='1'?'selected ':'').'value="1">'._('Allow Narrative Entry').' - <option '.($_SESSION['AllowOrderLineItemNarrative']=='0'?'selected ':'').'value="0">'._('No Narrative Line').' + <option '.($_SESSION['AllowOrderLineItemNarrative']=='1'?'selected ':'').'value="1">'._('Allow Narrative Entry').'</option> + <option '.($_SESSION['AllowOrderLineItemNarrative']=='0'?'selected ':'').'value="0">'._('No Narrative Line').'</option> </select></td> <td>' . _('Select whether or not to allow entry of narrative on order line items. This narrative will appear on invoices and packing slips. Useful mainly for service businesses.') . '</td> </tr>'; @@ -412,8 +412,8 @@ //'RequirePickingNote' echo '<tr style="outline: 1px solid"><td>' . _('A picking note must be produced before an order can be delivered') . ':</td> <td><select Name="X_RequirePickingNote"> - <option '.($_SESSION['RequirePickingNote']=='1'?'selected ':'').'value="1">'._('Yes').' - <option '.($_SESSION['RequirePickingNote']=='0'?'selected ':'').'value="0">'._('No').' + <option '.($_SESSION['RequirePickingNote']=='1'?'selected ':'').'value="1">'._('Yes').'</option> + <option '.($_SESSION['RequirePickingNote']=='0'?'selected ':'').'value="0">'._('No').'</option> </select></td> <td>' . _('Select whether or not a picking note must be produced before an order can be delivered to a customer.') . '</td> </tr>'; @@ -421,8 +421,8 @@ //UpdateCurrencyRatesDaily echo '<tr style="outline: 1px solid"><td>' . _('Auto Update Exchange Rates Daily') . ':</td> <td><select Name="X_UpdateCurrencyRatesDaily"> - <option '.($_SESSION['UpdateCurrencyRatesDaily']!='0'?'selected ':'').'value="1">'._('Automatic').' - <option '.($_SESSION['UpdateCurrencyRatesDaily']=='0'?'selected ':'').'value="0">'._('Manual').' + <option '.($_SESSION['UpdateCurrencyRatesDaily']!='0'?'selected ':'').'value="1">'._('Automatic').'</option> + <option '.($_SESSION['UpdateCurrencyRatesDaily']=='0'?'selected ':'').'value="0">'._('Manual').'</option> </select></td> <td>' . _('Automatic updates to exchange rates will retrieve the latest daily rates from the European Central Bank once per day - when the first user logs in for the day. Manual will never update the rates automatically - exchange rates will need to be maintained manually') . '</td> </tr>'; @@ -430,8 +430,8 @@ //Default Packing Note Format echo '<tr style="outline: 1px solid"><td>' . _('Format of Packing Slips') . ':</td> <td><select Name="X_PackNoteFormat"> - <option '.($_SESSION['PackNoteFormat']=='1'?'selected ':'').'value="1">'._('Laser Printed').' - <option '.($_SESSION['PackNoteFormat']=='2'?'selected ':'').'value="2">'._('Special Stationery').' + <option '.($_SESSION['PackNoteFormat']=='1'?'selected ':'').'value="1">'._('Laser Printed').'</option> + <option '.($_SESSION['PackNoteFormat']=='2'?'selected ':'').'value="2">'._('Special Stationery').'</option> </select></td> <td>' . _('Choose the format that packing notes should be printed by default') . '</td> </tr>'; @@ -439,8 +439,8 @@ //Default Invoice Format echo '<tr style="outline: 1px solid"><td>' . _('Invoice Orientation') . ':</td> <td><select Name="X_InvoicePortraitFormat"> - <option '.($_SESSION['InvoicePortraitFormat']=='0'?'selected ':'').'value="0">'._('Landscape').' - <option '.($_SESSION['InvoicePortraitFormat']=='1'?'selected ':'').'value="1">'._('Portrait').' + <option '.($_SESSION['InvoicePortraitFormat']=='0'?'selected ':'').'value="0">'._('Landscape').'</option> + <option '.($_SESSION['InvoicePortraitFormat']=='1'?'selected ':'').'value="1">'._('Portrait').'</option> </select></td> <td>' . _('Select the invoice layout') . '</td> </tr>'; @@ -448,8 +448,8 @@ //Blind packing note echo '<tr style="outline: 1px solid"><td>' . _('Show company details on packing slips') . ':</td> <td><select Name="X_DefaultBlindPackNote"> - <option '.($_SESSION['DefaultBlindPackNote']=="1"?'selected ':'').'value="1">'._('Show Company Details').' - <option '.($_SESSION['DefaultBlindPackNote']=="2"?'selected ':'').'value="2">'._('Hide Company Details').' + <option '.($_SESSION['DefaultBlindPackNote']=='1'?'selected ':'').'value="1">'._('Show Company Details').'</option> + <option '.($_SESSION['DefaultBlindPackNote']=='2'?'selected ':'').'value="2">'._('Hide Company Details').'</option> </select></td> <td>' . _('Customer branches can be set by default not to print packing slips with the company logo and address. This is useful for companies that ship to customers customers and to show the source of the shipment would be inappropriate. There is an option on the setup of customer branches to ship blind, this setting is the default applied to all new customer branches') . '</td> </tr>'; @@ -465,21 +465,21 @@ // AllowSalesOfZeroCostItems echo '<tr style="outline: 1px solid"><td>' . _('Allow Sales Of Zero Cost Items') . ':</td> <td><select Name="X_AllowSalesOfZeroCostItems"> - <option '.($_SESSION['AllowSalesOfZeroCostItems']?'selected ':'').'value="1">'._('Yes').' - <option '.(!$_SESSION['AllowSalesOfZeroCostItems']?'selected ':'').'value="0">'._('No').' + <option '.($_SESSION['AllowSalesOfZeroCostItems']?'selected ':'').'value="1">'._('Yes').'</option> + <option '.(!$_SESSION['AllowSalesOfZeroCostItems']?'selected ':'').'value="0">'._('No').'</option> </select></td> <td>' . _('If an item selected at order entry does not have a cost set up then if this parameter is set to No then the order line will not be able to be entered') . '</td></tr>'; // CreditingControlledItems_MustExist echo '<tr style="outline: 1px solid"><td>' . _('Controlled Items Must Exist For Crediting') . ':</td> <td><select Name="X_CreditingControlledItems_MustExist"> - <option '.($_SESSION['CreditingControlledItems_MustExist']?'selected ':'').'value="1">'._('Yes').' - <option '.(!$_SESSION['CreditingControlledItems_MustExist']?'selected ':'').'value="0">'._('No').' + <option '.($_SESSION['CreditingControlledItems_MustExist']?'selected ':'').'value="1">'._('Yes').'</option> + <option '.(!$_SESSION['CreditingControlledItems_MustExist']?'selected ':'').'value="0">'._('No').'</option> </select></td> <td>' . _('This parameter relates to the behaviour of the controlled items code. If a serial numbered item has not previously existed then a credit note for it will not be allowed if this is set to Yes') . '</td></tr>'; // DefaultPriceList -$sql = 'SELECT typeabbrev, sales_type FROM salestypes ORDER BY sales_type'; +$sql = "SELECT typeabbrev, sales_type FROM salestypes ORDER BY sales_type"; $ErrMsg = _('Could not load price lists'); $result = DB_query($sql,$db,$ErrMsg); echo '<tr style="outline: 1px solid"><td>' . _('Default Price List') . ':</td>'; @@ -495,16 +495,16 @@ <td>' . _('This price list is used as a last resort where there is no price set up for an item in the price list that the customer is set up for') . '</td></tr>'; // Default_Shipper -$sql = 'SELECT shipper_id, shippername FROM shippers ORDER BY shippername'; +$sql = "SELECT shipper_id, shippername FROM shippers ORDER BY shippername"; $ErrMsg = _('Could not load shippers'); $result = DB_query($sql,$db,$ErrMsg); echo '<tr style="outline: 1px solid"><td>' . _('Default Shipper') . ':</td>'; echo '<td><select Name="X_Default_Shipper">'; if( DB_num_rows($result) == 0 ) { - echo '<option selected value="">'._('Unavailable'); + echo '<option selected value="">'._('Unavailable') . '</option>'; } else { while( $row = DB_fetch_array($result) ) { - echo '<option '.($_SESSION['Default_Shipper'] == $row['shipper_id']?'selected ':'').'value="'.$row['shipper_id'].'">'.$row['shippername']; + echo '<option '.($_SESSION['Default_Shipper'] == $row['shipper_id']?'selected ':'').'value="'.$row['shipper_id'].'">'.$row['shippername'] . '</option>'; } } echo '</select></td> @@ -513,8 +513,8 @@ // DoFreightCalc echo '<tr style="outline: 1px solid"><td>' . _('Do Freight Calculation') . ':</td> <td><select Name="X_DoFreightCalc"> - <option '.($_SESSION['DoFreightCalc']?'selected ':'').'value="1">'._('Yes').' - <option '.(!$_SESSION['DoFreightCalc']?'selected ':'').'value="0">'._('No').' + <option '.($_SESSION['DoFreightCalc']?'selected ':'').'value="1">'._('Yes').'</option> + <option '.(!$_SESSION['DoFreightCalc']?'selected ':'').'value="0">'._('No').'</option> </select></td> <td>' . _('If this is set to Yes then the system will attempt to calculate the freight cost of a dispatch based on the weight and cubic and the data defined for each shipper and their rates for shipping to various locations. The results of this calculation will only be meaningful if the data is entered for the item weight and volume in the stock item setup for all items and the freight costs for each shipper properly maintained.') . '</td></tr>'; @@ -529,26 +529,26 @@ <td><select Name="X_AutoDebtorNo">'; if ($_SESSION['AutoDebtorNo']==0) { - echo '<option selected value=0>' . _('Manual Entry'); - echo '<option value=1>' . _('Automatic'); + echo '<option selected value=0>' . _('Manual Entry') . '</option>'; + echo '<option value=1>' . _('Automatic') . '</option>'; } else { - echo '<option selected value=1>' . _('Automatic'); - echo '<option value=0>' . _('Manual Entry'); + echo '<option selected value=1>' . _('Automatic') . '</option>'; + echo '<option value=0>' . _('Manual Entry') . '</option>'; } echo '</select></td> <td>' . _('Set to Automatic - customer codes are automatically created - as a sequential number') .'</td></tr>'; //==HJ== drop down list for tax category -$sql = 'SELECT taxcatid, taxcatname FROM taxcategories ORDER BY taxcatname'; +$sql = "SELECT taxcatid, taxcatname FROM taxcategories ORDER BY taxcatname"; $ErrMsg = _('Could not load tax categories table'); $result = DB_query($sql,$db,$ErrMsg); echo '<tr style="outline: 1px solid"><td>' . _('Default Tax Category') . ':</td>'; echo '<td><select Name="X_DefaultTaxCategory">'; if( DB_num_rows($result) == 0 ) { - echo '<option selected value="">'._('Unavailable'); + echo '<option selected value="">'._('Unavailable') . '</option>'; } else { while( $row = DB_fetch_array($result) ) { - echo '<option '.($_SESSION['DefaultTaxCategory'] == $row['taxcatid']?'selected ':'').'value="'.$row['taxcatid'].'">'.$row['taxcatname']; + echo '<option '.($_SESSION['DefaultTaxCategory'] == $row['taxcatid']?'selected ':'').'value="'.$row['taxcatid'].'">'.$row['taxcatname'] . '</option>'; } } echo '</select></td> @@ -557,17 +557,17 @@ //TaxAuthorityReferenceName echo '<tr style="outline: 1px solid"><td>' . _('TaxAuthorityReferenceName') . ':</td> - <td><input type="Text" Name="X_TaxAuthorityReferenceName" size=16 maxlength=25 value="' . $_SESSION['TaxAuthorityReferenceName'] . '"></td> + <td><input type="Text" Name="X_TaxAuthotaxcatid, taxcatname FROM taxcategoriesrityReferenceName" size=16 maxlength=25 value="' . $_SESSION['TaxAuthorityReferenceName'] . '"></td> <td>' . _('This parameter is what is displayed on tax invoices and credits for the tax authority of the company eg. in Australian this would by A.B.N.: - in NZ it would be GST No: in the UK it would be VAT Regn. No') .'</td></tr>'; // CountryOfOperation -$sql = 'SELECT currabrev, country FROM currencies ORDER BY country'; +$sql = "SELECT currabrev, country FROM currencies ORDER BY country"; $ErrMsg = _('Could not load the countries from the currency table'); $result = DB_query($sql,$db,$ErrMsg); echo '<tr style="outline: 1px solid"><td>' . _('Country Of Operation') . ':</td>'; echo '<td><select name="X_CountryOfOperation">'; if( DB_num_rows($result) == 0 ) { - echo '<option selected value="">'._('Unavailable'); + echo '<option selected value="">'._('Unavailable') . '</option>'; } else { while( $row = DB_fetch_array($result) ) { echo '<option '.($_SESSION['CountryOfOperation'] == $row['currabrev']?'selected ':'').'value="'.$row['currabrev'].'">'.$row['country'] . '</option>'; @@ -586,8 +586,8 @@ //Show values on GRN echo '<tr style="outline: 1px solid"><td>' . _('Show order values on GRN') . ':</td> <td><select Name="X_ShowValueOnGRN"> - <option '.($_SESSION['ShowValueOnGRN']?'selected ':'').'value="1">'._('Yes').' - <option '.(!$_SESSION['ShowValueOnGRN']?'selected ':'').'value="0">'._('No').' + <option '.($_SESSION['ShowValueOnGRN']?'selected ':'').'value="1">'._('Yes').'</option> + <option '.(!$_SESSION['ShowValueOnGRN']?'selected ':'').'value="0">'._('No').'</option> </select></td> <td>' . _('Should the value of the purchased stock be shown on the GRN screen') . '</td> </tr>'; @@ -595,16 +595,16 @@ // Check_Qty_Charged_vs_Del_Qty echo '<tr style="outline: 1px solid"><td>' . _('Check Quantity Charged vs Deliver Qty') . ':</td> <td><select Name="X_Check_Qty_Charged_vs_Del_Qty"> - <option '.($_SESSION['Check_Qty_Charged_vs_Del_Qty']?'selected ':'').'value="1">'._('Yes').' - <option '.(!$_SESSION['Check_Qty_Charged_vs_Del_Qty']?'selected ':'').'value="0">'._('No').' + <option '.($_SESSION['Check_Qty_Charged_vs_Del_Qty']?'selected ':'').'value="1">'._('Yes').'</option> + <option '.(!$_SESSION['Check_Qty_Charged_vs_Del_Qty']?'selected ':'').'value="0">'._('No').'</option> </select></td> <td>' . _('In entry of AP invoices this determines whether or not to check the quantities received into stock tie up with the quantities invoiced') .'</td></tr>'; // Check_Price_Charged_vs_Order_Price echo '<tr style="outline: 1px solid"><td>' . _('Check Price Charged vs Order Price') . ':</td> <td><select Name="X_Check_Price_Charged_vs_Order_Price"> - <option '.($_SESSION['Check_Price_Charged_vs_Order_Price']?'selected ':'').'value="1">'._('Yes').' - <option '.(!$_SESSION['Check_Price_Charged_vs_Order_Price']?'selected ':'').'value="0">'._('No').' + <option '.($_SESSION['Check_Price_Charged_vs_Order_Price']?'selected ':'').'value="1">'._('Yes').'</option> + <option '.(!$_SESSION['Check_Price_Charged_vs_Order_Price']?'selected ':'').'value="0">'._('No').'</option> </select></td> <td>' . _('In entry of AP invoices this parameter determines whether or not to check invoice prices tie up to ordered prices') .'</td></tr>'; @@ -628,8 +628,8 @@ // AutoAuthorisePO echo '<tr style="outline: 1px solid"><td>' . _('Automatically authorise purchase orders if user has authority') . ':</td> <td><select Name="X_AutoAuthorisePO"> - <option '.($_SESSION['AutoAuthorisePO'] ?'selected ':'').'value="1">'._('Yes').' - <option '.(!$_SESSION['AutoAuthorisePO'] ?'selected ':'').'value="0">'._('No').' + <option '.($_SESSION['AutoAuthorisePO'] ?'selected ':'').'value="1">'._('Yes').'</option> + <option '.(!$_SESSION['AutoAuthorisePO'] ?'selected ':'').'value="0">'._('No').'</option> </select></td><td>' . _('If the user changing an existing purchase order or adding a new puchase order is set up to authorise purchase orders and the order is within their limit, then the purchase order status is automatically set to authorised') . '</td></tr>'; @@ -652,7 +652,7 @@ echo '<tr style="outline: 1px solid"><td>' . _('Financial Year Ends On') . ':</td> <td><select Name="X_YearEnd">'; for ($i=1; $i <= sizeof($MonthNames); $i++ ) - echo '<option '.($_SESSION['YearEnd'] == $i ? 'selected ' : '').'value="'.$i.'">'.$MonthNames[$i]; + echo '<option '.($_SESSION['YearEnd'] == $i ? 'selected ' : '').'value="'.$i.'">'.$MonthNames[$i] . '</option>'; echo '</select></td> <td>' . _('Defining the month in which the financial year ends enables the system to provide useful defaults for general ledger reports') .'</td></tr>'; @@ -673,9 +673,9 @@ <td>' . _('Picture files of items can be uploaded to the server. The system will check that files uploaded are less than this size (in KB) before they will be allowed to be uploaded. Large pictures will make the system slow and will be difficult to view in the stock maintenance screen.') .'</td> </tr>'; //NumberOfMonthMustBeShown -$sql = 'SELECT confvalue +$sql = "SELECT confvalue FROM `config` - WHERE confname ="numberOfMonthMustBeShown"'; + WHERE confname ='numberOfMonthMustBeShown'"; $ErrMsg = _('Could not load the Number Of Month Must be Shown'); $result = DB_query($sql,$db,$ErrMsg); @@ -700,6 +700,7 @@ if (is_dir($CompanyDirectory . $DirEntry) AND $DirEntry != '..' AND $DirEntry!='.' + AND $DirEntry!='.svn' AND $DirEntry != 'CVS' AND $DirEntry != 'reports' AND $DirEntry != 'locale' @@ -729,6 +730,7 @@ AND $DirEntry != '..' AND $DirEntry != 'includes' AND $DirEntry!='.' + AND $DirEntry!='.svn' AND $DirEntry != 'doc' AND $DirEntry != 'css' AND $DirEntry != 'CVS' @@ -854,7 +856,7 @@ echo '<tr style="outline: 1px solid"><td>' . _('Prohibit GL Journals to Periods Prior To') . ':</td> <td><select Name="X_ProhibitPostingsBefore">'; -$sql = 'SELECT lastdate_in_period FROM periods ORDER BY periodno DESC'; +$sql = "SELECT 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)){ @@ -952,8 +954,8 @@ //DefineControlledOnWOEntry echo '<tr style="outline: 1px solid"><td>' . _('Controlled Items Defined At Work Order Entry') . ':</td> <td><select Name="X_DefineControlledOnWOEntry"> - <option '.($_SESSION['DefineControlledOnWOEntry']?'selected ':'').'value="1">'._('Yes').' - <option '.(!$_SESSION['DefineControlledOnWOEntry']?'selected ':'').'value="0">'._('No').' + <option '.($_SESSION['DefineControlledOnWOEntry']?'selected ':'').'value="1">'._('Yes').'</option> + <option '.(!$_SESSION['DefineControlledOnWOEntry']?'selected ':'').'value="0">'._('No').'</option> </select></td> <td>' . _('When set to yes, controlled items are defined at the time of the work order creation. Otherwise controlled items (serial numbers and batch/roll/lot references) are entered at the time the finished items are received against the work order') . '</td></tr>'; @@ -974,7 +976,7 @@ echo '<tr style="outline: 1px solid"><td>' . _('Default Factory Location') . ':</td> <td><select Name="X_DefaultFactoryLocation">'; -$sql = 'SELECT loccode,locationname FROM locations'; +$sql = "SELECT loccode,locationname FROM locations"; $ErrMsg = _('Could not load locations table'); $result = DB_query($sql,$db,$ErrMsg); while ($LocationRow = DB_fetch_array($result)){ @@ -995,7 +997,9 @@ <td>' . _('The email address for the purchasing manager, used to receive notifications by the tendering system') .'</td></tr>'; -echo '</table><br /><div class="centre"><input type="Submit" Name="submit" value="' . _('Update') . '"></div></form>'; +echo '</table> + <br /><div class="centre"><input type="Submit" Name="submit" value="' . _('Update') . '"></div> + </form>'; include('includes/footer.inc'); ?> \ 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: <dai...@us...> - 2011-04-05 10:14:32
|
Revision: 4539 http://web-erp.svn.sourceforge.net/web-erp/?rev=4539&view=rev Author: daintree Date: 2011-04-05 10:14:24 +0000 (Tue, 05 Apr 2011) Log Message: ----------- various Modified Paths: -------------- trunk/PDFOrdersInvoiced.php trunk/SuppCreditGRNs.php trunk/SupplierInvoice.php trunk/doc/Change.log.html trunk/includes/LanguageSetup.php Modified: trunk/PDFOrdersInvoiced.php =================================================================== --- trunk/PDFOrdersInvoiced.php 2011-04-04 10:14:30 UTC (rev 4538) +++ trunk/PDFOrdersInvoiced.php 2011-04-05 10:14:24 UTC (rev 4539) @@ -2,20 +2,17 @@ /* $Id$*/ -/* $Revision: 1.10 $ */ - -//$PageSecurity = 3; include ('includes/session.inc'); $title = _('Orders Invoiced Report'); $InputError=0; -if (isset($_POST['FromDate']) AND !is_date($_POST['FromDate'])){ +if (isset($_POST['FromDate']) AND !Is_date($_POST['FromDate'])){ $msg = _('The date from must be specified in the format') . ' ' . $DefaultDateFormat; $InputError=1; unset($_POST['FromDate']); } -if (isset($_POST['ToDate']) AND !is_date($_POST['ToDate'])){ +if (isset($_POST['ToDate']) AND !Is_date($_POST['ToDate'])){ $msg = _('The date to must be specified in the format') . ' ' . $DefaultDateFormat; $InputError=1; unset($_POST['ToDate']); @@ -36,9 +33,9 @@ echo '<p class="page_title_text"><img src="'.$rootpath.'/css/'.$theme.'/images/transactions.png" title="' . $title . '" alt="" />' . ' ' . _('Orders Invoiced Report') . '</p>'; - echo "<form method='post' action='" . $_SERVER['PHP_SELF'] . '?' . sid . "'>"; + echo '<form method="post" action="' . $_SERVER['PHP_SELF'] . '">'; echo '<input type="hidden" name="FormID" value="' . $_SESSION['FormID'] . '" />'; - echo '<table class=selection><tr><td>' . _('Enter the date from which orders are to be listed') . ":</td><td><input type=text class='date' alt='".$_SESSION['DefaultDateFormat']."' name='FromDate' maxlength=10 size=10 VALUE='" . Date($_SESSION['DefaultDateFormat'], Mktime(0,0,0,Date('m'),Date('d')-1,Date('y'))) . "'></td></tr>"; + echo '<table class=selection><tr><td>' . _('Enter the date from which orders are to be listed') . ':</td><td><input type="text" class="date" alt="' .$_SESSION['DefaultDateFormat'] .'" name="FromDate" maxlength="10" size="10" value="' . Date($_SESSION['DefaultDateFormat'], Mktime(0,0,0,Date('m'),Date('d')-1,Date('y'))) . '"></td></tr>'; echo '<tr><td>' . _('Enter the date to which orders are to be listed') . ":</td> <td><input type=text class='date' alt='".$_SESSION['DefaultDateFormat']."' name='ToDate' maxlength=10 size=10 VALUE='" . Date($_SESSION['DefaultDateFormat']) . "'></td></tr>"; echo '<tr><td>' . _('Inventory Category') . '</td><td>'; @@ -47,24 +44,24 @@ $result = DB_query($sql,$db); - echo "<select name='CategoryID'>"; - echo "<option selected value='All'>" . _('Over All Categories'); + echo '<select name="CategoryID">'; + echo '<option selected value="All">' . _('Over All Categories') . '</option>'; while ($myrow=DB_fetch_array($result)){ - echo '<option VALUE=' . $myrow['categoryid'] . '>' . $myrow['categorydescription']; + echo '<option value=' . $myrow['categoryid'] . '>' . $myrow['categorydescription'] . '</option>'; } echo '</select></td></tr>'; - echo '<tr><td>' . _('Inventory Location') . ":</td><td><select name='Location'>"; - echo "<option selected VALUE='All'>" . _('All Locations'); + echo '<tr><td>' . _('Inventory Location') . ':</td><td><select name="Location">'; + echo '<option selected value="All">' . _('All Locations') . '</option>'; $result= DB_query('SELECT loccode, locationname FROM locations',$db); while ($myrow=DB_fetch_array($result)){ - echo "<option VALUE='" . $myrow['loccode'] . "'>" . $myrow['locationname']; + echo '<option value="' . $myrow['loccode'] . '">' . $myrow['locationname'] . '</option>'; } echo '</select></td></tr>'; - echo "</table><br><div class='centre'><input type=submit name='Go' VALUE='" . _('Create PDF') . "'></div>"; + echo '</table><br /><div class="centre"><input type="submit" name="Go" value="' . _('Create PDF') . '"></div>'; include('includes/footer.inc'); exit; @@ -262,7 +259,7 @@ include('includes/header.inc'); prnMsg(_('An error occurred getting the orders details'),'',_('Database Error')); if ($debug==1){ - prnMsg( _('The SQL used to get the orders that failed was') . '<br>' . $sql, '',_('Database Error')); + prnMsg( _('The SQL used to get the orders that failed was') . '<br />' . $sql, '',_('Database Error')); } include ('includes/footer.inc'); exit; @@ -270,7 +267,7 @@ include('includes/header.inc'); prnMsg(_('There were no orders found in the database within the period from') . ' ' . $_POST['FromDate'] . ' ' . _('to') . ' '. $_POST['ToDate'] . '. ' . _('Please try again selecting a different date range'), 'warn'); if ($debug==1) { - prnMsg(_('The SQL that returned no rows was') . '<br>' . $sql,'',_('Database Error')); + prnMsg(_('The SQL that returned no rows was') . '<br />' . $sql,'',_('Database Error')); } include('includes/footer.inc'); exit; @@ -424,18 +421,7 @@ $LeftOvers = $pdf->addTextWrap($Left_Margin+260,$YPos,100,$FontSize,_('GRAND TOTAL INVOICED'), 'right'); $LeftOvers = $pdf->addTextWrap($Left_Margin+360,$YPos,80,$FontSize,number_format($AccumTotalInv,2), 'right'); $YPos -= ($line_height); -/* UldisN -$pdfcode = $pdf->output(); -$len = strlen($pdfcode); -header('Content-type: application/pdf'); -header('Content-Length: ' . $len); -header('Content-Disposition: inline; filename=OrdersInvoiced.pdf'); -header('Expires: 0'); -header('Cache-Control: must-revalidate, post-check=0, pre-check=0'); -header('Pragma: public'); -$pdf->stream(); -*/ -$pdf->OutputD($_SESSION['DatabaseName'] . '_OrdersInvoiced_' . date('Y-m-d') . '.pdf');//UldisN -$pdf->__destruct(); //UldisN +$pdf->OutputD($_SESSION['DatabaseName'] . '_OrdersInvoiced_' . date('Y-m-d') . '.pdf'); +$pdf->__destruct(); ?> \ No newline at end of file Modified: trunk/SuppCreditGRNs.php =================================================================== --- trunk/SuppCreditGRNs.php 2011-04-04 10:14:30 UTC (rev 4538) +++ trunk/SuppCreditGRNs.php 2011-04-05 10:14:24 UTC (rev 4539) @@ -6,7 +6,6 @@ the SuppTrans class contains an array of GRNs objects - containing details of GRNs for invoicing and also an array of GLCodes objects - only used if the AP - GL link is effective */ -//$PageSecurity = 5; include('includes/DefineSuppTransClass.php'); /* Session started in header.inc for password checking and authorisation level check */ @@ -21,7 +20,7 @@ if (!isset($_SESSION['SuppTrans'])){ prnMsg(_('To enter a supplier transactions the supplier must first be selected from the supplier selection screen') . ', ' . _('then the link to enter a supplier credit note must be clicked on'),'info'); - echo '<br><a href="' . $rootpath . '/SelectSupplier.php?' . SID .'">' . _('Select A Supplier to Enter a Transaction For') . '</a>'; + echo '<br /><a href="' . $rootpath . '/SelectSupplier.php">' . _('Select A Supplier to Enter a Transaction For') . '</a>'; include('includes/footer.inc'); exit; /*It all stops here if there aint no supplier selected and credit note initiated ie $_SESSION['SuppTrans'] started off*/ @@ -42,21 +41,21 @@ if ($InputError==False){ $_SESSION['SuppTrans']->Add_GRN_To_Trans($_POST['GRNNumber'], - $_POST['PODetailItem'], - $_POST['ItemCode'], - $_POST['ItemDescription'], - $_POST['QtyRecd'], - $_POST['Prev_QuantityInv'], - $_POST['This_QuantityCredited'], - $_POST['OrderPrice'], - $_POST['ChgPrice'], - $Complete, - $_POST['StdCostUnit'], - $_POST['ShiptRef'], - $_POST['JobRef'], - $_POST['GLCode'], - $_POST['PONo'], - $_POST['AssetID']); + $_POST['PODetailItem'], + $_POST['ItemCode'], + $_POST['ItemDescription'], + $_POST['QtyRecd'], + $_POST['Prev_QuantityInv'], + $_POST['This_QuantityCredited'], + $_POST['OrderPrice'], + $_POST['ChgPrice'], + $Complete, + $_POST['StdCostUnit'], + $_POST['ShiptRef'], + $_POST['JobRef'], + $_POST['GLCode'], + $_POST['PONo'], + $_POST['AssetID']); } } @@ -71,11 +70,11 @@ echo '<table cellpadding=0 class=selection>'; echo '<tr><th colspan=6><font size=3 color=navy>' . _('Credits Against Goods Received Selected') . '</font></th></tr>'; $TableHeader = '<tr><th>' . _('GRN') . '</th> - <th>' . _('Item Code') . '</th> - <th>' . _('Description') . '</th> - <th>' . _('Quantity Credited') . '</th> - <th>' . _('Price Credited in') . ' ' . $_SESSION['SuppTrans']->CurrCode . '</th> - <th>' . _('Line Value in') . ' ' . $_SESSION['SuppTrans']->CurrCode . '</th></tr>'; + <th>' . _('Item Code') . '</th> + <th>' . _('Description') . '</th> + <th>' . _('Quantity Credited') . '</th> + <th>' . _('Price Credited in') . ' ' . $_SESSION['SuppTrans']->CurrCode . '</th> + <th>' . _('Line Value in') . ' ' . $_SESSION['SuppTrans']->CurrCode . '</th></tr>'; echo $TableHeader; @@ -101,9 +100,13 @@ } } -echo '<tr><td colspan=5 class=number><font size=2 color=navy>' . _('Total Value Credited Against Goods') . ':</font></td> - <td class=number><font size=2 color=navy><U>' . number_format($TotalValueCharged,2) . '</U></font></td></tr>'; -echo '</table><br /><div class=centre><a href="' . $rootpath . '/SupplierCredit.php?' . SID . '">' . _('Back to Credit Note Entry') . '</a></div>'; +echo '<tr> + <td colspan=5 class=number><font size=2 color=navy>' . _('Total Value Credited Against Goods') . ':</font></td> + <td class=number><font size=2 color=navy><U>' . number_format($TotalValueCharged,2) . '</U></font></td> + </tr>'; +echo '</table> + <br /> + <div class=centre><a href="' . $rootpath . '/SupplierCredit.php?">' . _('Back to Credit Note Entry') . '</a></div>'; /* Now get all the GRNs for this supplier from the database after the date entered */ @@ -112,156 +115,155 @@ } $SQL = "SELECT grnno, - purchorderdetails.orderno, - purchorderdetails.unitprice, - grns.itemcode, grns.deliverydate, - grns.itemdescription, - grns.qtyrecd, - grns.quantityinv, - purchorderdetails.stdcostunit, - purchorderdetails.assetid - FROM grns, - purchorderdetails - WHERE grns.podetailitem=purchorderdetails.podetailitem AND - grns.supplierid ='" . $_SESSION['SuppTrans']->SupplierID . "' AND - grns.deliverydate >= '" . FormatDateForSQL($_POST['Show_Since']) . "' - ORDER BY grns.grnno"; + purchorderdetails.orderno, + purchorderdetails.unitprice, + grns.itemcode, grns.deliverydate, + grns.itemdescription, + grns.qtyrecd, + grns.quantityinv, + purchorderdetails.stdcostunit, + purchorderdetails.assetid + FROM grns INNER JOIN purchorderdetails + ON grns.podetailitem=purchorderdetails.podetailitem + WHERE grns.supplierid ='" . $_SESSION['SuppTrans']->SupplierID . "' AND + grns.deliverydate >= '" . FormatDateForSQL($_POST['Show_Since']) . "' + ORDER BY grns.grnno"; $GRNResults = DB_query($SQL,$db); if (DB_num_rows($GRNResults)==0){ - prnMsg(_('There are no goods received records for') . ' ' . $_SESSION['SuppTrans']->SupplierName . '<br> ' . _('To enter a credit against goods received') . ', ' . _('the goods must first be received using the link below to select purchase orders to receive'),'info'); - echo '<p><a href="' . $rootpath . '/PO_SelectOSPurchOrder.php?' . SID . 'SupplierID=' . $_SESSION['SuppTrans']->SupplierID . '">' . _('Select Purchase Orders to Receive') . '</a>'; - include('includes/footer.inc'); - exit; + prnMsg(_('There are no goods received records for') . ' ' . $_SESSION['SuppTrans']->SupplierName . ' ' . _('since') . ' ' . $_POST['Show_Since'] . '<br /> ' . _('To enter a credit against goods received') . ', ' . _('the goods must first be received using the link below to select purchase orders to receive'),'info'); + echo '<p><a href="' . $rootpath . '/PO_SelectOSPurchOrder.php?SupplierID=' . $_SESSION['SuppTrans']->SupplierID . '">' . _('Select Purchase Orders to Receive') . '</a>'; } + /*Set up a table to show the GRNs outstanding for selection */ -echo '<form action="' . $_SERVER['PHP_SELF'] . '?' . SID . '" method=post>'; +echo '<form action="' . $_SERVER['PHP_SELF'] . '" method="post">'; echo '<input type="hidden" name="FormID" value="' . $_SESSION['FormID'] . '" />'; echo '<br /><table cellpadding=2 colspan=7 class=selection>'; -echo '<tr<th colspan=10><font size=3 color=navy>' . _('Show Goods Received Since') . ': </font>'; -echo '<input type=Text name="Show_Since" maxlength=11 size=12 class=date alt='.$_SESSION['DefaultDateFormat'].' value="' . $_POST['Show_Since'] . '"><font size=3 color=navy> '; +echo '<tr><th colspan=10><font size=3 color=navy>' . _('Show Goods Received Since') . ': </font>'; +echo '<input type=Text name="Show_Since" maxlength=11 size=12 class=date alt='.$_SESSION['DefaultDateFormat'].' value="' . $_POST['Show_Since'] . '" /><input type="submit" name="FindGRNs" value="' . _('Display GRNs') . '" /><font size=3 color=navy> '; echo _('From') . ' ' . $_SESSION['SuppTrans']->SupplierName . '</font></th></tr>'; -$TableHeader = '<tr><th>' . _('GRN') . '</th> - <th>' . _('Order') . '</th> - <th>' . _('Item Code') . '</th> - <th>' . _('Description') . '</th> - <th>' . _('Delivered') . '</th> - <th>' . _('Total Qty') . '<br>' . _('Received') . '</th> - <th>' . _('Qty Already') . '<br>' . _('credit noted') . '</th> - <th>' . _('Qty Yet') . '<br>' . _('To credit note') . '</th> - <th>' . _('Order Price') . '<br>' . $_SESSION['SuppTrans']->CurrCode . '</th> - <th>' . _('Line Value') . '<br>' . _('In') . ' ' . $_SESSION['SuppTrans']->CurrCode . '</th> - </tr>'; - -echo $TableHeader; - -$i=0; -while ($myrow=DB_fetch_array($GRNResults)){ - - $GRNAlreadyOnCredit = False; - - foreach ($_SESSION['SuppTrans']->GRNs as $EnteredGRN){ - if ($EnteredGRN->GRNNo == $myrow['grnno']) { - $GRNAlreadyOnCredit = True; +if (DB_num_rows($GRNResults)>0){ + $TableHeader = '<tr><th>' . _('GRN') . '</th> + <th>' . _('Order') . '</th> + <th>' . _('Item Code') . '</th> + <th>' . _('Description') . '</th> + <th>' . _('Delivered') . '</th> + <th>' . _('Total Qty') . '<br />' . _('Received') . '</th> + <th>' . _('Qty Already') . '<br />' . _('credit noted') . '</th> + <th>' . _('Qty Yet') . '<br />' . _('To credit note') . '</th> + <th>' . _('Order Price') . '<br />' . $_SESSION['SuppTrans']->CurrCode . '</th> + <th>' . _('Line Value') . '<br />' . _('In') . ' ' . $_SESSION['SuppTrans']->CurrCode . '</th> + </tr>'; + + echo $TableHeader; + + $i=0; + while ($myrow=DB_fetch_array($GRNResults)){ + + $GRNAlreadyOnCredit = False; + + foreach ($_SESSION['SuppTrans']->GRNs as $EnteredGRN){ + if ($EnteredGRN->GRNNo == $myrow['grnno']) { + $GRNAlreadyOnCredit = True; + } } - } - if ($GRNAlreadyOnCredit == False){ - echo '<tr><td><input type=Submit name="GRNNo" Value="' . $myrow['grnno'] . '"></td> - <td>' . $myrow['orderno'] . '</td> - <td>' . $myrow['itemcode'] . '</td> - <td>' . $myrow['itemdescription'] . '</td> - <td>' . ConvertSQLDate($myrow['deliverydate']) . '</td> - <td class=number>' . number_format($myrow['qtyrecd'],2) . '</td> - <td class=number>' . number_format($myrow['quantityinv'],2) . '</td> - <td class=number>' . number_format($myrow['qtyrecd'] - $myrow['quantityinv'],2) . '</td> - <td class=number>' . number_format($myrow['unitprice'],2) . '</td> - <td class=number>' . number_format($myrow['unitprice']*($myrow['qtyrecd'] - $myrow['quantityinv']),2) . '</td> - </tr>'; - $i++; - if ($i>15){ - $i=0; - echo $TableHeader; + if ($GRNAlreadyOnCredit == False){ + echo '<tr><td><input type=Submit name="GRNNo" Value="' . $myrow['grnno'] . '"></td> + <td>' . $myrow['orderno'] . '</td> + <td>' . $myrow['itemcode'] . '</td> + <td>' . $myrow['itemdescription'] . '</td> + <td>' . ConvertSQLDate($myrow['deliverydate']) . '</td> + <td class=number>' . number_format($myrow['qtyrecd'],2) . '</td> + <td class=number>' . number_format($myrow['quantityinv'],2) . '</td> + <td class=number>' . number_format($myrow['qtyrecd'] - $myrow['quantityinv'],2) . '</td> + <td class=number>' . number_format($myrow['unitprice'],2) . '</td> + <td class=number>' . number_format($myrow['unitprice']*($myrow['qtyrecd'] - $myrow['quantityinv']),2) . '</td> + </tr>'; + $i++; + if ($i>15){ + $i=0; + echo $TableHeader; + } } } -} - -echo '</table>'; - -if (isset($_POST['GRNNo']) AND $_POST['GRNNo']!=''){ - - $SQL = "SELECT grnno, - grns.podetailitem, - purchorderdetails.orderno, - purchorderdetails.unitprice, - purchorderdetails.glcode, - grns.itemcode, - grns.deliverydate, - grns.itemdescription, - grns.quantityinv, - grns.qtyrecd, - grns.qtyrecd - grns.quantityinv - AS qtyostdg, - purchorderdetails.stdcostunit, - purchorderdetails.shiptref, - purchorderdetails.jobref, - shipments.closed, - purchorderdetails.assetid - FROM grns, - purchorderdetails - LEFT JOIN shipments ON purchorderdetails.shiptref=shipments.shiptref - WHERE grns.podetailitem=purchorderdetails.podetailitem AND - grns.grnno='" .$_POST['GRNNo'] . "'"; - $GRNEntryResult = DB_query($SQL,$db); - $myrow = DB_fetch_array($GRNEntryResult); - - echo '<br /><table class=selection>'; - echo '<tr><th colspan=6><font size=3 color=navy>' . _('GRN Selected For Adding To A Suppliers Credit Note') . '</font></th></tr>'; - echo '<tr><th>' . _('GRN') . '</th> - <th>' . _('Item') . '</th> - <th>' . _('Quantity') . '<br>' . _('Outstanding') . '</th> - <th>' . _('Quantity') . '<br>' . _('credited') . '</th> - <th>' . _('Order') . '<br>' . _('Price') . ' ' . $_SESSION['SuppTrans']->CurrCode . '</th> - <th>' . _('Credit') . '<br>' . _('Price') . ' ' . $_SESSION['SuppTrans']->CurrCode . '</th> - </tr>'; - - echo '<tr><td>' . $_POST['GRNNo'] . '</td> - <td>' . $myrow['itemcode'] . ' ' . $myrow['itemdescription'] . '</td> - <td class=number>' . number_format($myrow['qtyostdg'],2) . '</td> - <td><input type=Text Name="This_QuantityCredited" Value=' . $myrow['qtyostdg'] . ' size=11 maxlength=10></td> - <td class=number>' . $myrow['unitprice'] . '</td> - <td><input type=Text Name="ChgPrice" Value=' . $myrow['unitprice'] . ' size=11 maxlength=10></td> - </tr>'; + echo '</table>'; - - if ($myrow['closed']==1){ /*Shipment is closed so pre-empt problems later by warning the user - need to modify the order first */ - echo '<input type=hidden name="ShiptRef" Value="">'; - prnMsg(_('Unfortunately the shipment that this purchase order line item was allocated to has been closed') . ' - ' . _('if you add this item to the transaction then no shipments will not be updated') . '. ' . _('If you wish to allocate the order line item to a different shipment the order must be modified first'),'error'); - } else { - echo '<input type=hidden name="ShiptRef" Value="' . $myrow['shiptref'] . '">'; + + if (isset($_POST['GRNNo']) AND $_POST['GRNNo']!=''){ + + $SQL = "SELECT grnno, + grns.podetailitem, + purchorderdetails.orderno, + purchorderdetails.unitprice, + purchorderdetails.glcode, + grns.itemcode, + grns.deliverydate, + grns.itemdescription, + grns.quantityinv, + grns.qtyrecd, + grns.qtyrecd - grns.quantityinv + AS qtyostdg, + purchorderdetails.stdcostunit, + purchorderdetails.shiptref, + purchorderdetails.jobref, + shipments.closed, + purchorderdetails.assetid + FROM grns, + purchorderdetails + LEFT JOIN shipments ON purchorderdetails.shiptref=shipments.shiptref + WHERE grns.podetailitem=purchorderdetails.podetailitem AND + grns.grnno='" .$_POST['GRNNo'] . "'"; + $GRNEntryResult = DB_query($SQL,$db); + $myrow = DB_fetch_array($GRNEntryResult); + + echo '<br /><table class=selection>'; + echo '<tr><th colspan=6><font size=3 color=navy>' . _('GRN Selected For Adding To A Suppliers Credit Note') . '</font></th></tr>'; + echo '<tr><th>' . _('GRN') . '</th> + <th>' . _('Item') . '</th> + <th>' . _('Quantity') . '<br />' . _('Outstanding') . '</th> + <th>' . _('Quantity') . '<br />' . _('credited') . '</th> + <th>' . _('Order') . '<br />' . _('Price') . ' ' . $_SESSION['SuppTrans']->CurrCode . '</th> + <th>' . _('Credit') . '<br />' . _('Price') . ' ' . $_SESSION['SuppTrans']->CurrCode . '</th> + </tr>'; + + echo '<tr><td>' . $_POST['GRNNo'] . '</td> + <td>' . $myrow['itemcode'] . ' ' . $myrow['itemdescription'] . '</td> + <td class=number>' . number_format($myrow['qtyostdg'],2) . '</td> + <td><input type=Text Name="This_QuantityCredited" Value=' . $myrow['qtyostdg'] . ' size=11 maxlength=10></td> + <td class=number>' . $myrow['unitprice'] . '</td> + <td><input type=Text Name="ChgPrice" Value=' . $myrow['unitprice'] . ' size=11 maxlength=10></td> + </tr>'; + echo '</table>'; + + if ($myrow['closed']==1){ /*Shipment is closed so pre-empt problems later by warning the user - need to modify the order first */ + echo '<input type=hidden name="ShiptRef" Value="">'; + prnMsg(_('Unfortunately the shipment that this purchase order line item was allocated to has been closed') . ' - ' . _('if you add this item to the transaction then no shipments will not be updated') . '. ' . _('If you wish to allocate the order line item to a different shipment the order must be modified first'),'error'); + } else { + echo '<input type=hidden name="ShiptRef" Value="' . $myrow['shiptref'] . '">'; + } + + echo '<br /><div class=centre><input type=Submit Name="AddGRNToTrans" Value="' . _('Add to Credit Note') . '"></div>'; + + + echo '<input type=hidden name="GRNNumber" value=' . $_POST['GRNNo'] . '>'; + echo '<input type=hidden name="ItemCode" value="' . $myrow['itemcode'] . '">'; + echo '<input type=hidden name="ItemDescription" value="' . $myrow['itemdescription'] . '">'; + echo '<input type=hidden name="QtyRecd" value=' . $myrow['qtyrecd'] . '>'; + echo '<input type=hidden name="Prev_QuantityInv" value=' . $myrow['quantityinv'] . '>'; + echo '<input type=hidden name="OrderPrice" value=' . $myrow['unitprice'] . '>'; + echo '<input type=hidden name="StdCostUnit" value=' . $myrow['stdcostunit'] . '>'; + + echo '<input type=hidden name="JobRef" Value="' . $myrow['jobref'] . '">'; + echo '<input type=hidden name="GLCode" Value="' . $myrow['glcode'] . '">'; + echo '<input type=hidden name="PODetailItem" Value="' . $myrow['podetailitem'] . '">'; + echo '<input type=hidden name="PONo" Value="' . $myrow['orderno'] . '">'; + echo '<input type=hidden name="AssetID" Value="' . $myrow['assetid'] . '">'; } - - echo '<br /><div class=centre><input type=Submit Name="AddGRNToTrans" Value="' . _('Add to Credit Note') . '"></div>'; - - - echo '<input type=hidden name="GRNNumber" value=' . $_POST['GRNNo'] . '>'; - echo '<input type=hidden name="ItemCode" value="' . $myrow['itemcode'] . '">'; - echo '<input type=hidden name="ItemDescription" value="' . $myrow['itemdescription'] . '">'; - echo '<input type=hidden name="QtyRecd" value=' . $myrow['qtyrecd'] . '>'; - echo '<input type=hidden name="Prev_QuantityInv" value=' . $myrow['quantityinv'] . '>'; - echo '<input type=hidden name="OrderPrice" value=' . $myrow['unitprice'] . '>'; - echo '<input type=hidden name="StdCostUnit" value=' . $myrow['stdcostunit'] . '>'; - - echo '<input type=hidden name="JobRef" Value="' . $myrow['jobref'] . '">'; - echo '<input type=hidden name="GLCode" Value="' . $myrow['glcode'] . '">'; - echo '<input type=hidden name="PODetailItem" Value="' . $myrow['podetailitem'] . '">'; - echo '<input type=hidden name="PONo" Value="' . $myrow['orderno'] . '">'; - echo '<input type=hidden name="AssetID" Value="' . $myrow['assetid'] . '">'; -} - +} //end if there were GRNs to select echo '</form>'; include('includes/footer.inc'); ?> \ No newline at end of file Modified: trunk/SupplierInvoice.php =================================================================== --- trunk/SupplierInvoice.php 2011-04-04 10:14:30 UTC (rev 4538) +++ trunk/SupplierInvoice.php 2011-04-05 10:14:24 UTC (rev 4539) @@ -562,7 +562,7 @@ $InputError = True; prnMsg(_('The invoice as entered cannot be processed because the there is no suppliers invoice number or reference entered') . '. ' . _('The supplier invoice number must be entered'),'error'); - } elseif (!is_date( $_SESSION['SuppTrans']->TranDate)){ + } elseif (!Is_date( $_SESSION['SuppTrans']->TranDate)){ $InputError = True; prnMsg( _('The invoice as entered cannot be processed because the invoice date entered is not in the format') . ' ' . $_SESSION['DefaultDateFormat'],'error'); Modified: trunk/doc/Change.log.html =================================================================== --- trunk/doc/Change.log.html 2011-04-04 10:14:30 UTC (rev 4538) +++ trunk/doc/Change.log.html 2011-04-05 10:14:24 UTC (rev 4539) @@ -1,5 +1,8 @@ <p><font SIZE=4 COLOR=BLUE><b>webERP Change Log</b></font></p> <p /> +<p>5/4/11 Tim: includes/LanguageSetup.php - discovered solution to Turkish character set problem!!</p> +<p>5/4/11 Phil: couple of is_date functions left over from experiment to see if changing fixed Turkish - now removed from SupplierInvoice.php and PDFOrdersInvoiced.php</p> +<p>5/4/11 Phil: SuppCreditGRNs was not showing old GRNs and no way to input an older date</p> <p>31/3/11 Phil:Fix link to create purchase order from purchasing data link on SelectProduct.php - thanks Brian May for pointing out the bug</p> <p>31/3/11 Phil: Updated all tranlations from the launchpad site</p> <p>31/3/11 Tim: Fix to make languages display immediately on change - session.inc moved includes/LanguageSetup.php down</p> Modified: trunk/includes/LanguageSetup.php =================================================================== --- trunk/includes/LanguageSetup.php 2011-04-04 10:14:30 UTC (rev 4538) +++ trunk/includes/LanguageSetup.php 2011-04-05 10:14:24 UTC (rev 4539) @@ -26,7 +26,11 @@ //This maybe required in some stubborn installations $Locale = setlocale (LC_ALL, $_SESSION['Language']); - + + //Turkish seems to be a special case + if ($_SESSION['Language']=='tr_TR.utf8') { + $Locale = setlocale(LC_CTYPE, 'C'); + } //$Locale = setlocale (LC_CTYPE, $_SESSION['Language']); //$Locale = setlocale (LC_MESSAGES, $_SESSION['Language']); $Locale = setlocale (LC_NUMERIC, 'en_US'); //currently need all decimal points etc to be as expected on webserver @@ -37,7 +41,7 @@ //putenv('LANG=$Language_Country'); bindtextdomain ('messages', $PathPrefix . 'locale'); textdomain ('messages'); - bind_textdomain_codeset('messages', 'UTF-8'); + bind_textdomain_codeset('messages', 'UTF-8'); $locale_info = localeconv(); } else { This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <dai...@us...> - 2011-04-05 10:14:31
|
Revision: 4539 http://web-erp.svn.sourceforge.net/web-erp/?rev=4539&view=rev Author: daintree Date: 2011-04-05 10:14:24 +0000 (Tue, 05 Apr 2011) Log Message: ----------- various Modified Paths: -------------- trunk/PDFOrdersInvoiced.php trunk/SuppCreditGRNs.php trunk/SupplierInvoice.php trunk/doc/Change.log.html trunk/includes/LanguageSetup.php Modified: trunk/PDFOrdersInvoiced.php =================================================================== --- trunk/PDFOrdersInvoiced.php 2011-04-04 10:14:30 UTC (rev 4538) +++ trunk/PDFOrdersInvoiced.php 2011-04-05 10:14:24 UTC (rev 4539) @@ -2,20 +2,17 @@ /* $Id$*/ -/* $Revision: 1.10 $ */ - -//$PageSecurity = 3; include ('includes/session.inc'); $title = _('Orders Invoiced Report'); $InputError=0; -if (isset($_POST['FromDate']) AND !is_date($_POST['FromDate'])){ +if (isset($_POST['FromDate']) AND !Is_date($_POST['FromDate'])){ $msg = _('The date from must be specified in the format') . ' ' . $DefaultDateFormat; $InputError=1; unset($_POST['FromDate']); } -if (isset($_POST['ToDate']) AND !is_date($_POST['ToDate'])){ +if (isset($_POST['ToDate']) AND !Is_date($_POST['ToDate'])){ $msg = _('The date to must be specified in the format') . ' ' . $DefaultDateFormat; $InputError=1; unset($_POST['ToDate']); @@ -36,9 +33,9 @@ echo '<p class="page_title_text"><img src="'.$rootpath.'/css/'.$theme.'/images/transactions.png" title="' . $title . '" alt="" />' . ' ' . _('Orders Invoiced Report') . '</p>'; - echo "<form method='post' action='" . $_SERVER['PHP_SELF'] . '?' . sid . "'>"; + echo '<form method="post" action="' . $_SERVER['PHP_SELF'] . '">'; echo '<input type="hidden" name="FormID" value="' . $_SESSION['FormID'] . '" />'; - echo '<table class=selection><tr><td>' . _('Enter the date from which orders are to be listed') . ":</td><td><input type=text class='date' alt='".$_SESSION['DefaultDateFormat']."' name='FromDate' maxlength=10 size=10 VALUE='" . Date($_SESSION['DefaultDateFormat'], Mktime(0,0,0,Date('m'),Date('d')-1,Date('y'))) . "'></td></tr>"; + echo '<table class=selection><tr><td>' . _('Enter the date from which orders are to be listed') . ':</td><td><input type="text" class="date" alt="' .$_SESSION['DefaultDateFormat'] .'" name="FromDate" maxlength="10" size="10" value="' . Date($_SESSION['DefaultDateFormat'], Mktime(0,0,0,Date('m'),Date('d')-1,Date('y'))) . '"></td></tr>'; echo '<tr><td>' . _('Enter the date to which orders are to be listed') . ":</td> <td><input type=text class='date' alt='".$_SESSION['DefaultDateFormat']."' name='ToDate' maxlength=10 size=10 VALUE='" . Date($_SESSION['DefaultDateFormat']) . "'></td></tr>"; echo '<tr><td>' . _('Inventory Category') . '</td><td>'; @@ -47,24 +44,24 @@ $result = DB_query($sql,$db); - echo "<select name='CategoryID'>"; - echo "<option selected value='All'>" . _('Over All Categories'); + echo '<select name="CategoryID">'; + echo '<option selected value="All">' . _('Over All Categories') . '</option>'; while ($myrow=DB_fetch_array($result)){ - echo '<option VALUE=' . $myrow['categoryid'] . '>' . $myrow['categorydescription']; + echo '<option value=' . $myrow['categoryid'] . '>' . $myrow['categorydescription'] . '</option>'; } echo '</select></td></tr>'; - echo '<tr><td>' . _('Inventory Location') . ":</td><td><select name='Location'>"; - echo "<option selected VALUE='All'>" . _('All Locations'); + echo '<tr><td>' . _('Inventory Location') . ':</td><td><select name="Location">'; + echo '<option selected value="All">' . _('All Locations') . '</option>'; $result= DB_query('SELECT loccode, locationname FROM locations',$db); while ($myrow=DB_fetch_array($result)){ - echo "<option VALUE='" . $myrow['loccode'] . "'>" . $myrow['locationname']; + echo '<option value="' . $myrow['loccode'] . '">' . $myrow['locationname'] . '</option>'; } echo '</select></td></tr>'; - echo "</table><br><div class='centre'><input type=submit name='Go' VALUE='" . _('Create PDF') . "'></div>"; + echo '</table><br /><div class="centre"><input type="submit" name="Go" value="' . _('Create PDF') . '"></div>'; include('includes/footer.inc'); exit; @@ -262,7 +259,7 @@ include('includes/header.inc'); prnMsg(_('An error occurred getting the orders details'),'',_('Database Error')); if ($debug==1){ - prnMsg( _('The SQL used to get the orders that failed was') . '<br>' . $sql, '',_('Database Error')); + prnMsg( _('The SQL used to get the orders that failed was') . '<br />' . $sql, '',_('Database Error')); } include ('includes/footer.inc'); exit; @@ -270,7 +267,7 @@ include('includes/header.inc'); prnMsg(_('There were no orders found in the database within the period from') . ' ' . $_POST['FromDate'] . ' ' . _('to') . ' '. $_POST['ToDate'] . '. ' . _('Please try again selecting a different date range'), 'warn'); if ($debug==1) { - prnMsg(_('The SQL that returned no rows was') . '<br>' . $sql,'',_('Database Error')); + prnMsg(_('The SQL that returned no rows was') . '<br />' . $sql,'',_('Database Error')); } include('includes/footer.inc'); exit; @@ -424,18 +421,7 @@ $LeftOvers = $pdf->addTextWrap($Left_Margin+260,$YPos,100,$FontSize,_('GRAND TOTAL INVOICED'), 'right'); $LeftOvers = $pdf->addTextWrap($Left_Margin+360,$YPos,80,$FontSize,number_format($AccumTotalInv,2), 'right'); $YPos -= ($line_height); -/* UldisN -$pdfcode = $pdf->output(); -$len = strlen($pdfcode); -header('Content-type: application/pdf'); -header('Content-Length: ' . $len); -header('Content-Disposition: inline; filename=OrdersInvoiced.pdf'); -header('Expires: 0'); -header('Cache-Control: must-revalidate, post-check=0, pre-check=0'); -header('Pragma: public'); -$pdf->stream(); -*/ -$pdf->OutputD($_SESSION['DatabaseName'] . '_OrdersInvoiced_' . date('Y-m-d') . '.pdf');//UldisN -$pdf->__destruct(); //UldisN +$pdf->OutputD($_SESSION['DatabaseName'] . '_OrdersInvoiced_' . date('Y-m-d') . '.pdf'); +$pdf->__destruct(); ?> \ No newline at end of file Modified: trunk/SuppCreditGRNs.php =================================================================== --- trunk/SuppCreditGRNs.php 2011-04-04 10:14:30 UTC (rev 4538) +++ trunk/SuppCreditGRNs.php 2011-04-05 10:14:24 UTC (rev 4539) @@ -6,7 +6,6 @@ the SuppTrans class contains an array of GRNs objects - containing details of GRNs for invoicing and also an array of GLCodes objects - only used if the AP - GL link is effective */ -//$PageSecurity = 5; include('includes/DefineSuppTransClass.php'); /* Session started in header.inc for password checking and authorisation level check */ @@ -21,7 +20,7 @@ if (!isset($_SESSION['SuppTrans'])){ prnMsg(_('To enter a supplier transactions the supplier must first be selected from the supplier selection screen') . ', ' . _('then the link to enter a supplier credit note must be clicked on'),'info'); - echo '<br><a href="' . $rootpath . '/SelectSupplier.php?' . SID .'">' . _('Select A Supplier to Enter a Transaction For') . '</a>'; + echo '<br /><a href="' . $rootpath . '/SelectSupplier.php">' . _('Select A Supplier to Enter a Transaction For') . '</a>'; include('includes/footer.inc'); exit; /*It all stops here if there aint no supplier selected and credit note initiated ie $_SESSION['SuppTrans'] started off*/ @@ -42,21 +41,21 @@ if ($InputError==False){ $_SESSION['SuppTrans']->Add_GRN_To_Trans($_POST['GRNNumber'], - $_POST['PODetailItem'], - $_POST['ItemCode'], - $_POST['ItemDescription'], - $_POST['QtyRecd'], - $_POST['Prev_QuantityInv'], - $_POST['This_QuantityCredited'], - $_POST['OrderPrice'], - $_POST['ChgPrice'], - $Complete, - $_POST['StdCostUnit'], - $_POST['ShiptRef'], - $_POST['JobRef'], - $_POST['GLCode'], - $_POST['PONo'], - $_POST['AssetID']); + $_POST['PODetailItem'], + $_POST['ItemCode'], + $_POST['ItemDescription'], + $_POST['QtyRecd'], + $_POST['Prev_QuantityInv'], + $_POST['This_QuantityCredited'], + $_POST['OrderPrice'], + $_POST['ChgPrice'], + $Complete, + $_POST['StdCostUnit'], + $_POST['ShiptRef'], + $_POST['JobRef'], + $_POST['GLCode'], + $_POST['PONo'], + $_POST['AssetID']); } } @@ -71,11 +70,11 @@ echo '<table cellpadding=0 class=selection>'; echo '<tr><th colspan=6><font size=3 color=navy>' . _('Credits Against Goods Received Selected') . '</font></th></tr>'; $TableHeader = '<tr><th>' . _('GRN') . '</th> - <th>' . _('Item Code') . '</th> - <th>' . _('Description') . '</th> - <th>' . _('Quantity Credited') . '</th> - <th>' . _('Price Credited in') . ' ' . $_SESSION['SuppTrans']->CurrCode . '</th> - <th>' . _('Line Value in') . ' ' . $_SESSION['SuppTrans']->CurrCode . '</th></tr>'; + <th>' . _('Item Code') . '</th> + <th>' . _('Description') . '</th> + <th>' . _('Quantity Credited') . '</th> + <th>' . _('Price Credited in') . ' ' . $_SESSION['SuppTrans']->CurrCode . '</th> + <th>' . _('Line Value in') . ' ' . $_SESSION['SuppTrans']->CurrCode . '</th></tr>'; echo $TableHeader; @@ -101,9 +100,13 @@ } } -echo '<tr><td colspan=5 class=number><font size=2 color=navy>' . _('Total Value Credited Against Goods') . ':</font></td> - <td class=number><font size=2 color=navy><U>' . number_format($TotalValueCharged,2) . '</U></font></td></tr>'; -echo '</table><br /><div class=centre><a href="' . $rootpath . '/SupplierCredit.php?' . SID . '">' . _('Back to Credit Note Entry') . '</a></div>'; +echo '<tr> + <td colspan=5 class=number><font size=2 color=navy>' . _('Total Value Credited Against Goods') . ':</font></td> + <td class=number><font size=2 color=navy><U>' . number_format($TotalValueCharged,2) . '</U></font></td> + </tr>'; +echo '</table> + <br /> + <div class=centre><a href="' . $rootpath . '/SupplierCredit.php?">' . _('Back to Credit Note Entry') . '</a></div>'; /* Now get all the GRNs for this supplier from the database after the date entered */ @@ -112,156 +115,155 @@ } $SQL = "SELECT grnno, - purchorderdetails.orderno, - purchorderdetails.unitprice, - grns.itemcode, grns.deliverydate, - grns.itemdescription, - grns.qtyrecd, - grns.quantityinv, - purchorderdetails.stdcostunit, - purchorderdetails.assetid - FROM grns, - purchorderdetails - WHERE grns.podetailitem=purchorderdetails.podetailitem AND - grns.supplierid ='" . $_SESSION['SuppTrans']->SupplierID . "' AND - grns.deliverydate >= '" . FormatDateForSQL($_POST['Show_Since']) . "' - ORDER BY grns.grnno"; + purchorderdetails.orderno, + purchorderdetails.unitprice, + grns.itemcode, grns.deliverydate, + grns.itemdescription, + grns.qtyrecd, + grns.quantityinv, + purchorderdetails.stdcostunit, + purchorderdetails.assetid + FROM grns INNER JOIN purchorderdetails + ON grns.podetailitem=purchorderdetails.podetailitem + WHERE grns.supplierid ='" . $_SESSION['SuppTrans']->SupplierID . "' AND + grns.deliverydate >= '" . FormatDateForSQL($_POST['Show_Since']) . "' + ORDER BY grns.grnno"; $GRNResults = DB_query($SQL,$db); if (DB_num_rows($GRNResults)==0){ - prnMsg(_('There are no goods received records for') . ' ' . $_SESSION['SuppTrans']->SupplierName . '<br> ' . _('To enter a credit against goods received') . ', ' . _('the goods must first be received using the link below to select purchase orders to receive'),'info'); - echo '<p><a href="' . $rootpath . '/PO_SelectOSPurchOrder.php?' . SID . 'SupplierID=' . $_SESSION['SuppTrans']->SupplierID . '">' . _('Select Purchase Orders to Receive') . '</a>'; - include('includes/footer.inc'); - exit; + prnMsg(_('There are no goods received records for') . ' ' . $_SESSION['SuppTrans']->SupplierName . ' ' . _('since') . ' ' . $_POST['Show_Since'] . '<br /> ' . _('To enter a credit against goods received') . ', ' . _('the goods must first be received using the link below to select purchase orders to receive'),'info'); + echo '<p><a href="' . $rootpath . '/PO_SelectOSPurchOrder.php?SupplierID=' . $_SESSION['SuppTrans']->SupplierID . '">' . _('Select Purchase Orders to Receive') . '</a>'; } + /*Set up a table to show the GRNs outstanding for selection */ -echo '<form action="' . $_SERVER['PHP_SELF'] . '?' . SID . '" method=post>'; +echo '<form action="' . $_SERVER['PHP_SELF'] . '" method="post">'; echo '<input type="hidden" name="FormID" value="' . $_SESSION['FormID'] . '" />'; echo '<br /><table cellpadding=2 colspan=7 class=selection>'; -echo '<tr<th colspan=10><font size=3 color=navy>' . _('Show Goods Received Since') . ': </font>'; -echo '<input type=Text name="Show_Since" maxlength=11 size=12 class=date alt='.$_SESSION['DefaultDateFormat'].' value="' . $_POST['Show_Since'] . '"><font size=3 color=navy> '; +echo '<tr><th colspan=10><font size=3 color=navy>' . _('Show Goods Received Since') . ': </font>'; +echo '<input type=Text name="Show_Since" maxlength=11 size=12 class=date alt='.$_SESSION['DefaultDateFormat'].' value="' . $_POST['Show_Since'] . '" /><input type="submit" name="FindGRNs" value="' . _('Display GRNs') . '" /><font size=3 color=navy> '; echo _('From') . ' ' . $_SESSION['SuppTrans']->SupplierName . '</font></th></tr>'; -$TableHeader = '<tr><th>' . _('GRN') . '</th> - <th>' . _('Order') . '</th> - <th>' . _('Item Code') . '</th> - <th>' . _('Description') . '</th> - <th>' . _('Delivered') . '</th> - <th>' . _('Total Qty') . '<br>' . _('Received') . '</th> - <th>' . _('Qty Already') . '<br>' . _('credit noted') . '</th> - <th>' . _('Qty Yet') . '<br>' . _('To credit note') . '</th> - <th>' . _('Order Price') . '<br>' . $_SESSION['SuppTrans']->CurrCode . '</th> - <th>' . _('Line Value') . '<br>' . _('In') . ' ' . $_SESSION['SuppTrans']->CurrCode . '</th> - </tr>'; - -echo $TableHeader; - -$i=0; -while ($myrow=DB_fetch_array($GRNResults)){ - - $GRNAlreadyOnCredit = False; - - foreach ($_SESSION['SuppTrans']->GRNs as $EnteredGRN){ - if ($EnteredGRN->GRNNo == $myrow['grnno']) { - $GRNAlreadyOnCredit = True; +if (DB_num_rows($GRNResults)>0){ + $TableHeader = '<tr><th>' . _('GRN') . '</th> + <th>' . _('Order') . '</th> + <th>' . _('Item Code') . '</th> + <th>' . _('Description') . '</th> + <th>' . _('Delivered') . '</th> + <th>' . _('Total Qty') . '<br />' . _('Received') . '</th> + <th>' . _('Qty Already') . '<br />' . _('credit noted') . '</th> + <th>' . _('Qty Yet') . '<br />' . _('To credit note') . '</th> + <th>' . _('Order Price') . '<br />' . $_SESSION['SuppTrans']->CurrCode . '</th> + <th>' . _('Line Value') . '<br />' . _('In') . ' ' . $_SESSION['SuppTrans']->CurrCode . '</th> + </tr>'; + + echo $TableHeader; + + $i=0; + while ($myrow=DB_fetch_array($GRNResults)){ + + $GRNAlreadyOnCredit = False; + + foreach ($_SESSION['SuppTrans']->GRNs as $EnteredGRN){ + if ($EnteredGRN->GRNNo == $myrow['grnno']) { + $GRNAlreadyOnCredit = True; + } } - } - if ($GRNAlreadyOnCredit == False){ - echo '<tr><td><input type=Submit name="GRNNo" Value="' . $myrow['grnno'] . '"></td> - <td>' . $myrow['orderno'] . '</td> - <td>' . $myrow['itemcode'] . '</td> - <td>' . $myrow['itemdescription'] . '</td> - <td>' . ConvertSQLDate($myrow['deliverydate']) . '</td> - <td class=number>' . number_format($myrow['qtyrecd'],2) . '</td> - <td class=number>' . number_format($myrow['quantityinv'],2) . '</td> - <td class=number>' . number_format($myrow['qtyrecd'] - $myrow['quantityinv'],2) . '</td> - <td class=number>' . number_format($myrow['unitprice'],2) . '</td> - <td class=number>' . number_format($myrow['unitprice']*($myrow['qtyrecd'] - $myrow['quantityinv']),2) . '</td> - </tr>'; - $i++; - if ($i>15){ - $i=0; - echo $TableHeader; + if ($GRNAlreadyOnCredit == False){ + echo '<tr><td><input type=Submit name="GRNNo" Value="' . $myrow['grnno'] . '"></td> + <td>' . $myrow['orderno'] . '</td> + <td>' . $myrow['itemcode'] . '</td> + <td>' . $myrow['itemdescription'] . '</td> + <td>' . ConvertSQLDate($myrow['deliverydate']) . '</td> + <td class=number>' . number_format($myrow['qtyrecd'],2) . '</td> + <td class=number>' . number_format($myrow['quantityinv'],2) . '</td> + <td class=number>' . number_format($myrow['qtyrecd'] - $myrow['quantityinv'],2) . '</td> + <td class=number>' . number_format($myrow['unitprice'],2) . '</td> + <td class=number>' . number_format($myrow['unitprice']*($myrow['qtyrecd'] - $myrow['quantityinv']),2) . '</td> + </tr>'; + $i++; + if ($i>15){ + $i=0; + echo $TableHeader; + } } } -} - -echo '</table>'; - -if (isset($_POST['GRNNo']) AND $_POST['GRNNo']!=''){ - - $SQL = "SELECT grnno, - grns.podetailitem, - purchorderdetails.orderno, - purchorderdetails.unitprice, - purchorderdetails.glcode, - grns.itemcode, - grns.deliverydate, - grns.itemdescription, - grns.quantityinv, - grns.qtyrecd, - grns.qtyrecd - grns.quantityinv - AS qtyostdg, - purchorderdetails.stdcostunit, - purchorderdetails.shiptref, - purchorderdetails.jobref, - shipments.closed, - purchorderdetails.assetid - FROM grns, - purchorderdetails - LEFT JOIN shipments ON purchorderdetails.shiptref=shipments.shiptref - WHERE grns.podetailitem=purchorderdetails.podetailitem AND - grns.grnno='" .$_POST['GRNNo'] . "'"; - $GRNEntryResult = DB_query($SQL,$db); - $myrow = DB_fetch_array($GRNEntryResult); - - echo '<br /><table class=selection>'; - echo '<tr><th colspan=6><font size=3 color=navy>' . _('GRN Selected For Adding To A Suppliers Credit Note') . '</font></th></tr>'; - echo '<tr><th>' . _('GRN') . '</th> - <th>' . _('Item') . '</th> - <th>' . _('Quantity') . '<br>' . _('Outstanding') . '</th> - <th>' . _('Quantity') . '<br>' . _('credited') . '</th> - <th>' . _('Order') . '<br>' . _('Price') . ' ' . $_SESSION['SuppTrans']->CurrCode . '</th> - <th>' . _('Credit') . '<br>' . _('Price') . ' ' . $_SESSION['SuppTrans']->CurrCode . '</th> - </tr>'; - - echo '<tr><td>' . $_POST['GRNNo'] . '</td> - <td>' . $myrow['itemcode'] . ' ' . $myrow['itemdescription'] . '</td> - <td class=number>' . number_format($myrow['qtyostdg'],2) . '</td> - <td><input type=Text Name="This_QuantityCredited" Value=' . $myrow['qtyostdg'] . ' size=11 maxlength=10></td> - <td class=number>' . $myrow['unitprice'] . '</td> - <td><input type=Text Name="ChgPrice" Value=' . $myrow['unitprice'] . ' size=11 maxlength=10></td> - </tr>'; + echo '</table>'; - - if ($myrow['closed']==1){ /*Shipment is closed so pre-empt problems later by warning the user - need to modify the order first */ - echo '<input type=hidden name="ShiptRef" Value="">'; - prnMsg(_('Unfortunately the shipment that this purchase order line item was allocated to has been closed') . ' - ' . _('if you add this item to the transaction then no shipments will not be updated') . '. ' . _('If you wish to allocate the order line item to a different shipment the order must be modified first'),'error'); - } else { - echo '<input type=hidden name="ShiptRef" Value="' . $myrow['shiptref'] . '">'; + + if (isset($_POST['GRNNo']) AND $_POST['GRNNo']!=''){ + + $SQL = "SELECT grnno, + grns.podetailitem, + purchorderdetails.orderno, + purchorderdetails.unitprice, + purchorderdetails.glcode, + grns.itemcode, + grns.deliverydate, + grns.itemdescription, + grns.quantityinv, + grns.qtyrecd, + grns.qtyrecd - grns.quantityinv + AS qtyostdg, + purchorderdetails.stdcostunit, + purchorderdetails.shiptref, + purchorderdetails.jobref, + shipments.closed, + purchorderdetails.assetid + FROM grns, + purchorderdetails + LEFT JOIN shipments ON purchorderdetails.shiptref=shipments.shiptref + WHERE grns.podetailitem=purchorderdetails.podetailitem AND + grns.grnno='" .$_POST['GRNNo'] . "'"; + $GRNEntryResult = DB_query($SQL,$db); + $myrow = DB_fetch_array($GRNEntryResult); + + echo '<br /><table class=selection>'; + echo '<tr><th colspan=6><font size=3 color=navy>' . _('GRN Selected For Adding To A Suppliers Credit Note') . '</font></th></tr>'; + echo '<tr><th>' . _('GRN') . '</th> + <th>' . _('Item') . '</th> + <th>' . _('Quantity') . '<br />' . _('Outstanding') . '</th> + <th>' . _('Quantity') . '<br />' . _('credited') . '</th> + <th>' . _('Order') . '<br />' . _('Price') . ' ' . $_SESSION['SuppTrans']->CurrCode . '</th> + <th>' . _('Credit') . '<br />' . _('Price') . ' ' . $_SESSION['SuppTrans']->CurrCode . '</th> + </tr>'; + + echo '<tr><td>' . $_POST['GRNNo'] . '</td> + <td>' . $myrow['itemcode'] . ' ' . $myrow['itemdescription'] . '</td> + <td class=number>' . number_format($myrow['qtyostdg'],2) . '</td> + <td><input type=Text Name="This_QuantityCredited" Value=' . $myrow['qtyostdg'] . ' size=11 maxlength=10></td> + <td class=number>' . $myrow['unitprice'] . '</td> + <td><input type=Text Name="ChgPrice" Value=' . $myrow['unitprice'] . ' size=11 maxlength=10></td> + </tr>'; + echo '</table>'; + + if ($myrow['closed']==1){ /*Shipment is closed so pre-empt problems later by warning the user - need to modify the order first */ + echo '<input type=hidden name="ShiptRef" Value="">'; + prnMsg(_('Unfortunately the shipment that this purchase order line item was allocated to has been closed') . ' - ' . _('if you add this item to the transaction then no shipments will not be updated') . '. ' . _('If you wish to allocate the order line item to a different shipment the order must be modified first'),'error'); + } else { + echo '<input type=hidden name="ShiptRef" Value="' . $myrow['shiptref'] . '">'; + } + + echo '<br /><div class=centre><input type=Submit Name="AddGRNToTrans" Value="' . _('Add to Credit Note') . '"></div>'; + + + echo '<input type=hidden name="GRNNumber" value=' . $_POST['GRNNo'] . '>'; + echo '<input type=hidden name="ItemCode" value="' . $myrow['itemcode'] . '">'; + echo '<input type=hidden name="ItemDescription" value="' . $myrow['itemdescription'] . '">'; + echo '<input type=hidden name="QtyRecd" value=' . $myrow['qtyrecd'] . '>'; + echo '<input type=hidden name="Prev_QuantityInv" value=' . $myrow['quantityinv'] . '>'; + echo '<input type=hidden name="OrderPrice" value=' . $myrow['unitprice'] . '>'; + echo '<input type=hidden name="StdCostUnit" value=' . $myrow['stdcostunit'] . '>'; + + echo '<input type=hidden name="JobRef" Value="' . $myrow['jobref'] . '">'; + echo '<input type=hidden name="GLCode" Value="' . $myrow['glcode'] . '">'; + echo '<input type=hidden name="PODetailItem" Value="' . $myrow['podetailitem'] . '">'; + echo '<input type=hidden name="PONo" Value="' . $myrow['orderno'] . '">'; + echo '<input type=hidden name="AssetID" Value="' . $myrow['assetid'] . '">'; } - - echo '<br /><div class=centre><input type=Submit Name="AddGRNToTrans" Value="' . _('Add to Credit Note') . '"></div>'; - - - echo '<input type=hidden name="GRNNumber" value=' . $_POST['GRNNo'] . '>'; - echo '<input type=hidden name="ItemCode" value="' . $myrow['itemcode'] . '">'; - echo '<input type=hidden name="ItemDescription" value="' . $myrow['itemdescription'] . '">'; - echo '<input type=hidden name="QtyRecd" value=' . $myrow['qtyrecd'] . '>'; - echo '<input type=hidden name="Prev_QuantityInv" value=' . $myrow['quantityinv'] . '>'; - echo '<input type=hidden name="OrderPrice" value=' . $myrow['unitprice'] . '>'; - echo '<input type=hidden name="StdCostUnit" value=' . $myrow['stdcostunit'] . '>'; - - echo '<input type=hidden name="JobRef" Value="' . $myrow['jobref'] . '">'; - echo '<input type=hidden name="GLCode" Value="' . $myrow['glcode'] . '">'; - echo '<input type=hidden name="PODetailItem" Value="' . $myrow['podetailitem'] . '">'; - echo '<input type=hidden name="PONo" Value="' . $myrow['orderno'] . '">'; - echo '<input type=hidden name="AssetID" Value="' . $myrow['assetid'] . '">'; -} - +} //end if there were GRNs to select echo '</form>'; include('includes/footer.inc'); ?> \ No newline at end of file Modified: trunk/SupplierInvoice.php =================================================================== --- trunk/SupplierInvoice.php 2011-04-04 10:14:30 UTC (rev 4538) +++ trunk/SupplierInvoice.php 2011-04-05 10:14:24 UTC (rev 4539) @@ -562,7 +562,7 @@ $InputError = True; prnMsg(_('The invoice as entered cannot be processed because the there is no suppliers invoice number or reference entered') . '. ' . _('The supplier invoice number must be entered'),'error'); - } elseif (!is_date( $_SESSION['SuppTrans']->TranDate)){ + } elseif (!Is_date( $_SESSION['SuppTrans']->TranDate)){ $InputError = True; prnMsg( _('The invoice as entered cannot be processed because the invoice date entered is not in the format') . ' ' . $_SESSION['DefaultDateFormat'],'error'); Modified: trunk/doc/Change.log.html =================================================================== --- trunk/doc/Change.log.html 2011-04-04 10:14:30 UTC (rev 4538) +++ trunk/doc/Change.log.html 2011-04-05 10:14:24 UTC (rev 4539) @@ -1,5 +1,8 @@ <p><font SIZE=4 COLOR=BLUE><b>webERP Change Log</b></font></p> <p /> +<p>5/4/11 Tim: includes/LanguageSetup.php - discovered solution to Turkish character set problem!!</p> +<p>5/4/11 Phil: couple of is_date functions left over from experiment to see if changing fixed Turkish - now removed from SupplierInvoice.php and PDFOrdersInvoiced.php</p> +<p>5/4/11 Phil: SuppCreditGRNs was not showing old GRNs and no way to input an older date</p> <p>31/3/11 Phil:Fix link to create purchase order from purchasing data link on SelectProduct.php - thanks Brian May for pointing out the bug</p> <p>31/3/11 Phil: Updated all tranlations from the launchpad site</p> <p>31/3/11 Tim: Fix to make languages display immediately on change - session.inc moved includes/LanguageSetup.php down</p> Modified: trunk/includes/LanguageSetup.php =================================================================== --- trunk/includes/LanguageSetup.php 2011-04-04 10:14:30 UTC (rev 4538) +++ trunk/includes/LanguageSetup.php 2011-04-05 10:14:24 UTC (rev 4539) @@ -26,7 +26,11 @@ //This maybe required in some stubborn installations $Locale = setlocale (LC_ALL, $_SESSION['Language']); - + + //Turkish seems to be a special case + if ($_SESSION['Language']=='tr_TR.utf8') { + $Locale = setlocale(LC_CTYPE, 'C'); + } //$Locale = setlocale (LC_CTYPE, $_SESSION['Language']); //$Locale = setlocale (LC_MESSAGES, $_SESSION['Language']); $Locale = setlocale (LC_NUMERIC, 'en_US'); //currently need all decimal points etc to be as expected on webserver @@ -37,7 +41,7 @@ //putenv('LANG=$Language_Country'); bindtextdomain ('messages', $PathPrefix . 'locale'); textdomain ('messages'); - bind_textdomain_codeset('messages', 'UTF-8'); + bind_textdomain_codeset('messages', 'UTF-8'); $locale_info = localeconv(); } else { This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <dai...@us...> - 2011-04-04 10:14:39
|
Revision: 4538 http://web-erp.svn.sourceforge.net/web-erp/?rev=4538&view=rev Author: daintree Date: 2011-04-04 10:14:30 +0000 (Mon, 04 Apr 2011) Log Message: ----------- SQL and xhmtl quotes Modified Paths: -------------- trunk/StockReorderLevel.php trunk/SuppFixedAssetChgs.php trunk/SupplierCredit.php trunk/SupplierInquiry.php trunk/SupplierInvoice.php trunk/SupplierTenders.php Modified: trunk/StockReorderLevel.php =================================================================== --- trunk/StockReorderLevel.php 2011-04-03 03:24:25 UTC (rev 4537) +++ trunk/StockReorderLevel.php 2011-04-04 10:14:30 UTC (rev 4538) @@ -17,7 +17,7 @@ echo '<p class="page_title_text"><img src="'.$rootpath.'/css/'.$theme.'/images/inventory.png" title="' . _('Inventory') . '" alt="" /><b>' . $title. '</b></p>'; -$result = DB_query("SELECT description, units FROM stockmaster WHERE stockid='$StockID'", $db); +$result = DB_query("SELECT description, units FROM stockmaster WHERE stockid='" . $StockID . "'", $db); $myrow = DB_fetch_row($result); echo '<form action="' . $_SERVER['PHP_SELF'] . '" method="post">'; @@ -41,8 +41,8 @@ $LocStockResult = DB_query($sql, $db, $ErrMsg, $DbgMsg); echo '<table cellpadding="2" class="selection">'; -echo '<tr><th colspan=3'._('Stock Code') . ":<input type=TEXT name='StockID' size=21 VALUE='$StockID' maxlength=20>"; -echo " <input type=submit name='Show' VALUE='" . _('Show Re-Order Levels') . "'></th></tr>"; +echo '<tr><th colspan="3">' . _('Stock Code') . ':<input type="text" name="StockID" size="21" value="' . $StockID . '" maxlength="20">'; +echo '<input type="submit" name="Show" value="' . _('Show Re-Order Levels') . '"></th></tr>'; echo '<tr><th colspan=3><font color=BLUE size=3><b>' . $StockID . ' - ' . $myrow[0] . '</b> (' . _('In Units of') . ' ' . $myrow[1] . ')</font></th></tr>'; $TableHeader = '<tr> @@ -79,7 +79,7 @@ <td class=number>%s</td> <td><input type=text class='number' name=%s maxlength=10 size=10 VALUE=%s></td>", $myrow['locationname'], - number_format($myrow['quantity'],StockDecimalPlaces($StockID, $db)), + number_format($myrow['quantity'],$myrow['decimalplaces']), $myrow['loccode'], $myrow['reorderlevel']); $j++; @@ -91,11 +91,11 @@ } //end of while loop -echo "</table><br /><div class='centre'><input type=submit name='UpdateData' VALUE='" . _('Update') . "'><br /><br />"; -echo "<a href='$rootpath/StockMovements.php?StockID=$StockID'>" . _('Show Stock Movements') . '</a>'; -echo "<br /><a href='$rootpath/StockUsage.php?StockID=$StockID'>" . _('Show Stock Usage') . '</a>'; -echo "<br /><a href='$rootpath/SelectSalesOrder.php?SelectedStockItem=$StockID'>" . _('Search Outstanding Sales Orders') . '</a>'; -echo "<br /><a href='$rootpath/SelectCompletedOrder.php?SelectedStockItem=$StockID'>" . _('Search Completed Sales Orders') . '</a>'; +echo '</table><br /><div class="centre"><input type="submit" name="UpdateData" value="' . _('Update') . '"><br /><br />'; +echo '<a href="' . $rootpath . '/StockMovements.php?StockID=' . $StockID . '">' . _('Show Stock Movements') . '</a>'; +echo '<br /><a href="' . $rootpath . '/StockUsage.php?StockID=' . $StockID . '">' . _('Show Stock Usage') . '</a>'; +echo '<br /><a href="' . $rootpath . '/SelectSalesOrder.php?SelectedStockItem=' . $StockID . '">' . _('Search Outstanding Sales Orders') . '</a>'; +echo '<br /><a href="' . $rootpath . '/SelectCompletedOrder.php?SelectedStockItem=' . $StockID . '">' . _('Search Completed Sales Orders') . '</a>'; echo '</div></form>'; include('includes/footer.inc'); Modified: trunk/SuppFixedAssetChgs.php =================================================================== --- trunk/SuppFixedAssetChgs.php 2011-04-03 03:24:25 UTC (rev 4537) +++ trunk/SuppFixedAssetChgs.php 2011-04-04 10:14:30 UTC (rev 4538) @@ -1,8 +1,7 @@ <?php +/* $Id: SuppFixedAssetChgs.php 4473 2011-01-23 04:08:53Z daintree $ */ -/* $Id: SuppFixedAssetChgs.php 4391 2010-12-22 16:21:35Z tim_schofield $*/ - /*The supplier transaction uses the SuppTrans class to hold the information about the invoice the SuppTrans class contains an array of Asset objects called Assets- containing details of all asset additions on a supplier invoice Asset additions are posted to the debit of fixed asset category cost account if the creditors GL link is on */ @@ -28,7 +27,12 @@ $InputError = False; if ($_POST['AssetID'] == ''){ - $_POST['AssetID'] = $_POST['AssetSelection']; + if ($_POST['AssetSelection']==''){ + $InputError = True; + prnMsg(_('A valid asset must be either selected from the list or entered'),'error'); + } else { + $_POST['AssetID'] = $_POST['AssetSelection']; + } } else { $result = DB_query("SELECT assetid FROM fixedassets WHERE assetid='" . $_POST['AssetID'] . "'",$db); if (DB_num_rows($result)==0) { @@ -96,7 +100,7 @@ } /*Set up a form to allow input of new Shipment charges */ -echo '<br /><form action="' . $_SERVER['PHP_SELF'] . '?' . SID . '" method="post">'; +echo '<br /><form action="' . $_SERVER['PHP_SELF'] . '" method="post" />'; echo '<input type="hidden" name="FormID" value="' . $_SESSION['FormID'] . '" />'; if (!isset($_POST['AssetID'])) { @@ -134,10 +138,10 @@ $_POST['Amount']=0; } echo '<tr><td>' . _('Amount') . ':</td> - <td><input type="text" class="number" name="Amount" size="12" maxlength="11" VALUE="' . $_POST['Amount'] . '"></td></tr>'; + <td><input type="text" class="number" name="Amount" size="12" maxlength="11" value="' . $_POST['Amount'] . '"></td></tr>'; echo '</table>'; -echo '<br /><div class=centre><input type="submit" name="AddAssetToInvoice" VALUE="' . _('Enter Fixed Asset') . '"></div>'; +echo '<br /><div class=centre><input type="submit" name="AddAssetToInvoice" value="' . _('Enter Fixed Asset') . '"></div>'; echo '</form>'; include('includes/footer.inc'); Modified: trunk/SupplierCredit.php =================================================================== --- trunk/SupplierCredit.php 2011-04-03 03:24:25 UTC (rev 4537) +++ trunk/SupplierCredit.php 2011-04-04 10:14:30 UTC (rev 4538) @@ -21,8 +21,6 @@ include('includes/DefineSuppTransClass.php'); -//$PageSecurity = 5; - /* Session started in header.inc for password checking and authorisation level check */ include('includes/session.inc'); @@ -33,14 +31,14 @@ include('includes/SQL_CommonFunctions.inc'); //this is available from the menu on this page already -//echo "<a href='" . $rootpath . '/SelectSupplier.php?' . SID . "'>" . _('Back to Suppliers') . '</a><br>'; +//echo "<a href='" . $rootpath . '/SelectSupplier.php?' . SID . "'>" . _('Back to Suppliers') . '</a><br />'; if (isset($_GET['New'])) { unset($_SESSION['SuppTrans']); } if (!isset($_SESSION['SuppTrans']->SupplierName)) { - $sql='SELECT suppname FROM suppliers WHERE supplierid="'.$_GET['SupplierID'].'"'; + $sql="SELECT suppname FROM suppliers WHERE supplierid='" . $_GET['SupplierID']."'"; $result = DB_query($sql,$db); $myrow = DB_fetch_row($result); $SupplierName=$myrow[0]; @@ -73,23 +71,23 @@ /*Now retrieve supplier information - name, currency, default ex rate, terms, tax rate etc */ $sql = "SELECT suppliers.suppname, - suppliers.supplierid, - paymentterms.terms, - paymentterms.daysbeforedue, - paymentterms.dayinfollowingmonth, - suppliers.currcode, - currencies.rate AS exrate, - suppliers.taxgroupid, - taxgroups.taxgroupdescription - FROM suppliers, - taxgroups, - currencies, - paymentterms, - taxauthorities - WHERE suppliers.taxgroupid=taxgroups.taxgroupid - AND suppliers.currcode=currencies.currabrev - AND suppliers.paymentterms=paymentterms.termsindicator - AND suppliers.supplierid = '" . $_GET['SupplierID'] . "'"; + suppliers.supplierid, + paymentterms.terms, + paymentterms.daysbeforedue, + paymentterms.dayinfollowingmonth, + suppliers.currcode, + currencies.rate AS exrate, + suppliers.taxgroupid, + taxgroups.taxgroupdescription + FROM suppliers, + taxgroups, + currencies, + paymentterms, + taxauthorities + WHERE suppliers.taxgroupid=taxgroups.taxgroupid + AND suppliers.currcode=currencies.currabrev + AND suppliers.paymentterms=paymentterms.termsindicator + AND suppliers.supplierid = '" . $_GET['SupplierID'] . "'"; $ErrMsg = _('The supplier record selected') . ': ' . $_GET['SupplierID'] . ' ' ._('cannot be retrieved because'); $DbgMsg = _('The SQL used to retrieve the supplier details and failed was'); @@ -115,8 +113,8 @@ $_SESSION['SuppTrans']->SupplierID = $_GET['SupplierID']; $LocalTaxProvinceResult = DB_query("SELECT taxprovinceid - FROM locations - WHERE loccode = '" . $_SESSION['UserStockLocation'] . "'", $db); + FROM locations + WHERE loccode = '" . $_SESSION['UserStockLocation'] . "'", $db); if(DB_num_rows($LocalTaxProvinceResult)==0){ prnMsg(_('The tax province associated with your user account has not been set up in this database. Tax calculations are based on the tax group of the supplier and the tax province of the user entering the invoice. The system administrator should redefine your account with a valid default stocking location and this location should refer to a valid tax province'),'error'); @@ -139,10 +137,9 @@ } elseif (!isset($_SESSION['SuppTrans'])){ prnMsg(_('To enter a supplier credit note the supplier must first be selected from the supplier selection screen'),'warn'); - echo '<br><a href="' . $rootpath . '/SelectSupplier.php?' . SID .'">' . _('Select A Supplier to Enter an Credit Note For') . '</a>'; + echo '<br /><a href="' . $rootpath . '/SelectSupplier.php">' . _('Select A Supplier to Enter an Credit Note For') . '</a>'; include('includes/footer.inc'); exit; - /*It all stops here if there aint no supplier selected */ } @@ -215,9 +212,9 @@ echo '<meta http-equiv="Refresh" content="0; url=' . $rootpath . '/SuppCreditGRNs.php?' . SID . '">'; echo '<p>' . _('You should automatically be forwarded to the entry of credit notes against goods received page') . '. ' . - _('If this does not happen') . ' (' . _('if the browser does not support META Refresh') . ') ' . - '<a href="' . $rootpath . '/SuppCreditGRNs.php?' . SID . '">' . - _('click here') . '</a> ' . _('to continue') . '.<br>'; + _('If this does not happen') . ' (' . _('if the browser does not support META Refresh') . ') ' . + '<a href="' . $rootpath . '/SuppCreditGRNs.php">' . + _('click here') . '</a> ' . _('to continue') . '.<br />'; include('includes/footer.inc'); exit; } @@ -225,11 +222,11 @@ /*This ensures that any changes in the page are stored in the session before calling the shipments page */ - echo '<meta http-equiv="Refresh" content="0; url=' . $rootpath . '/SuppShiptChgs.php?' . SID . '">'; + echo '<meta http-equiv="Refresh" content="0; url=' . $rootpath . '/SuppShiptChgs.php">'; echo '<p>' . _('You should automatically be forwarded to the entry of credit notes against shipments page') . '. ' . - _('If this does not happen') . ' (' . _('if the browser does not support META Refresh') . ') ' . - '<a href="' . $rootpath . '/SuppShiptChgs.php?' . SID . '">' . - _('click here') . '</a> ' . _('to continue') . '.<br>'; + _('If this does not happen') . ' (' . _('if the browser does not support META Refresh') . ') ' . + '<a href="' . $rootpath . '/SuppShiptChgs.php">' . + _('click here') . '</a> ' . _('to continue') . '.<br />'; include('includes/footer.inc'); exit; } @@ -237,11 +234,11 @@ /*This ensures that any changes in the page are stored in the session before calling the shipments page */ - echo '<meta http-equiv="Refresh" content="0; url=' . $rootpath . '/SuppTransGLAnalysis.php?' . SID . '">'; + echo '<meta http-equiv="Refresh" content="0; url=' . $rootpath . '/SuppTransGLAnalysis.php">'; echo '<p>' . _('You should automatically be forwarded to the entry of credit notes against the general ledger page') . '. ' . - _('If this does not happen') . ' (' . _('if the browser does not support META Refresh') . ') ' . - '<a href="' . $rootpath . '/SuppTransGLAnalysis.php?' . SID . '">' . - _('click here') . '</a> ' . _('to continue') . '.<br>'; + _('If this does not happen') . ' (' . _('if the browser does not support META Refresh') . ') ' . + '<a href="' . $rootpath . '/SuppTransGLAnalysis.php">' . + _('click here') . '</a> ' . _('to continue') . '.<br />'; include('includes/footer.inc'); exit; } @@ -250,7 +247,7 @@ echo '<meta http-equiv="refresh" content="0; url=' . $rootpath . '/SuppContractChgs.php?' . SID . '">'; echo '<DIV class="centre">' . _('You should automatically be forwarded to the entry of supplier credit notes against contracts page') . '. ' . _('If this does not happen') . ' (' . _('if the browser does not support META Refresh'). ') ' . - '<a href="' . $rootpath . '/SuppContractChgs.php?' . SID . '">' . _('click here') . '</a> ' . _('to continue') . '.</DIV><br>'; + '<a href="' . $rootpath . '/SuppContractChgs.php">' . _('click here') . '</a> ' . _('to continue') . '.</DIV><br />'; exit; } if (isset($_POST['FixedAssets']) and $_POST['FixedAssets'] == _('Fixed Assets')){ @@ -258,16 +255,18 @@ echo '<meta http-equiv="refresh" content="0; url=' . $rootpath . '/SuppFixedAssetChgs.php?' . SID . '">'; echo '<DIV class="centre">' . _('You should automatically be forwarded to the entry of invoices against fixed assets page') . '. ' . _('If this does not happen') . ' (' . _('if the browser does not support META Refresh'). ') ' . - '<a href="' . $rootpath . '/SuppFixedAssetChgs.php?' . SID . '">' . _('click here') . '</a> ' . _('to continue') . '.</DIV><br>'; + '<a href="' . $rootpath . '/SuppFixedAssetChgs.php">' . _('click here') . '</a> ' . _('to continue') . '.</DIV><br />'; exit; } /* everything below here only do if a Supplier is selected fisrt add a header to show who we are making an credit note for */ -echo "<table class=selection colspan=4><tr><th>" . _('Supplier') . "</th> - <th>" . _('Currency') . "</th> - <th>" . _('Terms') . "</th> - <th>" . _('Tax Group') . '</th></tr>'; +echo '<table class="selection" colspan="4"> + <tr><th>' . _('Supplier') . '</th> + <th>' . _('Currency') . '</th> + <th>' . _('Terms') . '</th> + <th>' . _('Tax Group') . '</th> + </tr>'; echo '<tr><td><font color=blue><b>' . $_SESSION['SuppTrans']->SupplierID . ' - ' . $_SESSION['SuppTrans']->SupplierName . '</b></font></td> @@ -277,29 +276,29 @@ </tr> </table>'; -echo "<form action='" . $_SERVER['PHP_SELF'] . "?" . SID . "' method=post name=form1>"; +echo '<form action="' . $_SERVER['PHP_SELF'] . '" method="post" name="form1">'; echo '<input type="hidden" name="FormID" value="' . $_SESSION['FormID'] . '" />'; echo '<br /><table class=selection>'; echo '<tr><td><font color=red>' . _('Supplier Credit Note Reference') . ":</font></td> - <td><font size=2><input type=TEXT size=20 maxlength=20 name=SuppReference VALUE='" . $_SESSION['SuppTrans']->SuppReference . "'></td>"; + <td><font size=2><input type=TEXT size=20 maxlength=20 name=SuppReference value='" . $_SESSION['SuppTrans']->SuppReference . "'></td>"; if (!isset($_SESSION['SuppTrans']->TranDate)){ $_SESSION['SuppTrans']->TranDate= Date($_SESSION['DefaultDateFormat'], Mktime(0,0,0,Date('m'),Date('d')-1,Date('y'))); } echo '<td><font color=red>' . _('Credit Note Date') . ' (' . _('in format') . ' ' . $_SESSION['DefaultDateFormat'] . ") :</font></td> - <td><input type=TEXT class='date' alt='".$_SESSION['DefaultDateFormat']. "' size=11 maxlength=10 name='TranDate' VALUE=" . $_SESSION['SuppTrans']->TranDate . '></td>'; + <td><input type=TEXT class='date' alt='".$_SESSION['DefaultDateFormat']. "' size=11 maxlength=10 name='TranDate' value=" . $_SESSION['SuppTrans']->TranDate . '></td>'; echo '<td><font color=red>' . _('Exchange Rate') . ":</font></td> - <td><input type=TEXT class='number' size=11 maxlength=10 name='ExRate' VALUE=" . $_SESSION['SuppTrans']->ExRate . '></td></tr>'; + <td><input type=TEXT class='number' size=11 maxlength=10 name='ExRate' value=" . $_SESSION['SuppTrans']->ExRate . '></td></tr>'; echo '</table>'; -echo '<br><div class="centre"><input type="submit" name="GRNS" VALUE="' . _('Purchase Orders') . '"> '; +echo '<br /><div class="centre"><input type="submit" name="GRNS" value="' . _('Purchase Orders') . '"> '; echo '<input type="submit" name="Shipts" value="' . _('Shipments') . '"> '; -echo '<input type="submit" name="Contracts" VALUE="' . _('Contracts') . '"> '; +echo '<input type="submit" name="Contracts" value="' . _('Contracts') . '"> '; if ( $_SESSION['SuppTrans']->GLLink_Creditors ==1){ echo '<input type="submit" name="GL" value="' . _('General Ledger') . '"> '; } -echo '<input type="submit" name="FixedAssets" VALUE="' . _('Fixed Assets') . '"></div>'; +echo '<input type="submit" name="FixedAssets" value="' . _('Fixed Assets') . '"></div>'; echo '<br />'; if (count($_SESSION['SuppTrans']->GRNs)>0){ /*if there are some GRNs selected for crediting then */ @@ -309,14 +308,15 @@ echo '<table cellpadding=2 class=selection> <tr><th colspan="6">' . _('Purchase Order Credits') . '</th></tr>'; - $TableHeader = "<tr><th>" . _('GRN') . "</th> - <th>" . _('Item Code') . "</th> - <th>" . _('Description') . "</th> - <th>" . _('Quantity') . '<br>' . _('Credited') . "</th> - <th>" . _('Price Credited') . '<br>' . _('in') . ' ' . $_SESSION['SuppTrans']->CurrCode . "</th> - <th>" . _('Line Total') . '<br>' . _('in') . ' ' . $_SESSION['SuppTrans']->CurrCode . '</th></tr>'; + $TableHeader = '<tr><th>' . _('GRN') . '</th> + <th>' . _('Item Code') . '</th> + <th>' . _('Description') . '</th> + <th>' . _('Quantity') . '<br />' . _('Credited') . '</th> + <th>' . _('Price Credited') . '<br />' . _('in') . ' ' . $_SESSION['SuppTrans']->CurrCode . '</th> + <th>' . _('Line Total') . '<br />' . _('in') . ' ' . $_SESSION['SuppTrans']->CurrCode . '</th> + </tr>'; echo $TableHeader; - $TotalGRNValue=0; + $TotalGRNvalue=0; foreach ($_SESSION['SuppTrans']->GRNs as $EnteredGRN){ @@ -341,27 +341,29 @@ echo '<table cellpadding=2 class=selection> <tr><th colspan="2">' . _('Shipment Credits') . '</th></tr>'; - $TableHeader = "<tr><th>" . _('Shipment') . "</th> - <th>" . _('Amount') . '</th></tr>'; + $TableHeader = '<tr><th>' . _('Shipment') . '</th> + <th>' . _('Amount') . '</th></tr>'; echo $TableHeader; - $TotalShiptValue=0; + $TotalShiptvalue=0; $i=0; foreach ($_SESSION['SuppTrans']->Shipts as $EnteredShiptRef){ echo '<tr> - <td>' . $EnteredShiptRef->ShiptRef . '</td> - <td class=number>' . number_format($EnteredShiptRef->Amount,2) . '</td> - </tr>'; + <td>' . $EnteredShiptRef->ShiptRef . '</td> + <td class=number>' . number_format($EnteredShiptRef->Amount,2) . '</td> + </tr>'; $TotalShiptValue += $EnteredShiptRef->Amount; } echo '<tr><td class=number><font color=red>' . _('Total Credited Against Shipments') . ':</font></td> - <td class=number><fontcolor=red><U>' . number_format($TotalShiptValue,2) . '</U></font></td></tr></table><br />'; + <td class=number><fontcolor=red><U>' . number_format($TotalShiptValue,2) . '</U></font></td> + </tr> + </table><br />'; } if (count( $_SESSION['SuppTrans']->Assets) > 0){ /*if there are any fixed assets on the invoice*/ @@ -369,8 +371,8 @@ echo '<br /><table cellpadding=2 class=selection> <tr><th colspan=3>' . _('Fixed Asset Credits') . '</th></tr>'; $TableHeader = '<tr><th>' . _('Asset ID') . '</th> - <th>' . _('Description') . '</th> - <th>' . _('Amount') . ' ' . $_SESSION['SuppTrans']->CurrCode . '</th></tr>'; + <th>' . _('Description') . '</th> + <th>' . _('Amount') . ' ' . $_SESSION['SuppTrans']->CurrCode . '</th></tr>'; echo $TableHeader; $TotalAssetValue = 0; @@ -378,8 +380,8 @@ foreach ($_SESSION['SuppTrans']->Assets as $EnteredAsset){ echo '<tr><td>' . $EnteredAsset->AssetID . '</td> - <td>' . $EnteredAsset->Description . '</td> - <td class=number>' . number_format($EnteredAsset->Amount,2) . '</td></tr>'; + <td>' . $EnteredAsset->Description . '</td> + <td class=number>' . number_format($EnteredAsset->Amount,2) . '</td></tr>'; $TotalAssetValue += $EnteredAsset->Amount; @@ -391,7 +393,9 @@ } echo '<tr><td colspan=2 class=number><font size=4 color=blue>' . _('Total') . ':</font></td> - <td class=number><font size=4 color=BLUE><U>' . number_format($TotalAssetValue,2) . '</U></font></td></tr></table>'; + <td class=number><font size=4 color=BLUE><U>' . number_format($TotalAssetValue,2) . '</U></font></td> + </tr> + </table>'; } //end loop around fixed assets @@ -400,8 +404,9 @@ echo '<table cellpadding="2" class=selection> <tr><th colspan="3">' . _('Contract Charges') . '</th></tr>'; $TableHeader = '<tr><th>' . _('Contract') . '</th> - <th>' . _('Amount') . '</th> - <th>' . _('Narrative') . '</th></tr>'; + <th>' . _('Amount') . '</th> + <th>' . _('Narrative') . '</th> + </tr>'; echo $TableHeader; $TotalContractsValue = 0; @@ -409,9 +414,9 @@ foreach ($_SESSION['SuppTrans']->Contracts as $Contract){ echo '<tr><td>' . $Contract->ContractRef . '</td> - <td class=number>' . number_format($Contract->Amount,2) . '</td> - <td>' . $Contract->Narrative . '</td> - </tr>'; + <td class=number>' . number_format($Contract->Amount,2) . '</td> + <td>' . $Contract->Narrative . '</td> + </tr>'; $TotalContractsValue += $Contract->Amount; @@ -434,12 +439,12 @@ echo '<table cellpadding=2 class=selection> <tr><th colspan="3">' . _('General Ledger Analysis') . '</th></tr>'; $TableHeader = '<tr><th>' . _('Account') . '</th> - <th>' . _('Name') . '</th> - <th>' . _('Amount') . '<br>' . _('in') . ' ' . $_SESSION['SuppTrans']->CurrCode . '</th> - <th>' . _('Narrative') . '</th></tr>'; + <th>' . _('Name') . '</th> + <th>' . _('Amount') . '<br />' . _('in') . ' ' . $_SESSION['SuppTrans']->CurrCode . '</th> + <th>' . _('Narrative') . '</th></tr>'; echo $TableHeader; - $TotalGLValue=0; + $TotalGLvalue=0; foreach ($_SESSION['SuppTrans']->GLCodes as $EnteredGLCode){ @@ -463,13 +468,13 @@ } if (!isset($TotalGRNValue)) { - $TotalGRNValue=0; + $TotalGRNvalue=0; } if (!isset($TotalGLValue)) { - $TotalGLValue=0; + $TotalGLvalue=0; } if (!isset($TotalShiptValue)) { - $TotalShiptValue=0; + $TotalShiptvalue=0; } if (!isset($TotalContractsValue)){ $TotalContractsValue = 0; @@ -484,16 +489,16 @@ } else { echo '<table class=selection><tr><td><font color=red>' . _('Credit Amount in Supplier Currency') . ':</font></td> - <td colspan=2 class=number><input type=TEXT size="12" maxlength="10" name="OvAmount" VALUE=' . number_format($_SESSION['SuppTrans']->OvAmount,2) . '></td></tr>'; + <td colspan=2 class=number><input type=TEXT size="12" maxlength="10" name="OvAmount" value=' . number_format($_SESSION['SuppTrans']->OvAmount,2) . '></td></tr>'; } -echo "<tr><td colspan=2><input type=Submit name='ToggleTaxMethod'VALUE='" . _('Change Tax Calculation Method') . +echo "<tr><td colspan=2><input type=Submit name='ToggleTaxMethod'value='" . _('Change Tax Calculation Method') . "'></td><td><select name='OverRideTax' onChange='ReloadForm(form1.ToggleTaxMethod)'>"; if ($_POST['OverRideTax']=='Man'){ - echo "<option VALUE='Auto'>" . _('Automatic') . "<option selected VALUE='Man'>" . _('Manual Entry'); + echo "<option value='Auto'>" . _('Automatic') . "<option selected value='Man'>" . _('Manual Entry'); } else { - echo "<option selected VALUE='Auto'>" . _('Automatic') . "<option VALUE='Man'>" . _('Manual Entry'); + echo "<option selected value='Auto'>" . _('Automatic') . "<option value='Man'>" . _('Manual Entry'); } echo '</select></td></tr>'; @@ -512,7 +517,7 @@ if (!isset($_POST['OverRideTax']) or $_POST['OverRideTax']=='Auto'){ - echo ' <input type=TEXT class="number" name=TaxRate' . $Tax->TaxCalculationOrder . ' maxlength=4 size=4 VALUE=' . $_SESSION['SuppTrans']->Taxes[$Tax->TaxCalculationOrder]->TaxRate * 100 . '>%'; + echo ' <input type=TEXT class="number" name=TaxRate' . $Tax->TaxCalculationOrder . ' maxlength=4 size=4 value=' . $_SESSION['SuppTrans']->Taxes[$Tax->TaxCalculationOrder]->TaxRate * 100 . ' />%'; /*Now recaluclate the tax depending on the method */ if ($Tax->TaxOnTax ==1){ @@ -526,17 +531,17 @@ } - echo '<input type=hidden name="TaxAmount' . $Tax->TaxCalculationOrder . '" VALUE=' . round($_SESSION['SuppTrans']->Taxes[$Tax->TaxCalculationOrder]->TaxOvAmount,2) . '>'; + echo '<input type=hidden name="TaxAmount' . $Tax->TaxCalculationOrder . '" value=' . round($_SESSION['SuppTrans']->Taxes[$Tax->TaxCalculationOrder]->TaxOvAmount,2) . ' />'; echo '</td><td class=number>' . number_format($_SESSION['SuppTrans']->Taxes[$Tax->TaxCalculationOrder]->TaxOvAmount,2); } else { /*Tax being entered manually accept the taxamount entered as is*/ $_SESSION['SuppTrans']->Taxes[$Tax->TaxCalculationOrder]->TaxOvAmount = $_POST['TaxAmount' . $Tax->TaxCalculationOrder]; - echo ' <input type=hidden name=TaxRate' . $Tax->TaxCalculationOrder . ' VALUE=' . $_SESSION['SuppTrans']->Taxes[$Tax->TaxCalculationOrder]->TaxRate * 100 . '>'; + echo ' <input type=hidden name=TaxRate' . $Tax->TaxCalculationOrder . ' value=' . $_SESSION['SuppTrans']->Taxes[$Tax->TaxCalculationOrder]->TaxRate * 100 . ' />'; - echo '</td><td><input type=TEXT class="number" size=12 maxlength=12 name="TaxAmount' . $Tax->TaxCalculationOrder . '" VALUE=' . round($_SESSION['SuppTrans']->Taxes[$Tax->TaxCalculationOrder]->TaxOvAmount,2) . '>'; + echo '</td><td><input type=TEXT class="number" size=12 maxlength=12 name="TaxAmount' . $Tax->TaxCalculationOrder . '" value=' . round($_SESSION['SuppTrans']->Taxes[$Tax->TaxCalculationOrder]->TaxOvAmount,2) . '>'; } @@ -554,7 +559,7 @@ echo '<table class=selection><tr><td><font color=red>' . _('Comments') . '</font></td><td><textarea name=Comments cols=40 rows=2>' . $_SESSION['SuppTrans']->Comments . '</textarea></td></tr></table>'; -echo "<p><div class='centre'><input type=submit name='PostCreditNote' VALUE='" . _('Enter Credit Note') . "'></div>"; +echo "<p><div class='centre'><input type=submit name='PostCreditNote' value='" . _('Enter Credit Note') . "'></div>"; if (isset($_POST['PostCreditNote'])){ @@ -665,21 +670,21 @@ the debit is to creditors control act done later for the total credit note value + tax*/ $SQL = "INSERT INTO gltrans (type, - typeno, - trandate, - periodno, - account, - narrative, - amount, - jobref) + typeno, + trandate, + periodno, + account, + narrative, + amount, + jobref) VALUES (21, - '" . $CreditNoteNo . "', - '" . $SQLCreditNoteDate . "', - '" . $PeriodNo . "', - '" . $EnteredGLCode->GLCode . "', - '" . $_SESSION['SuppTrans']->SupplierID . " " . $EnteredGLCode->Narrative . "', - '" . round(-$EnteredGLCode->Amount/$_SESSION['SuppTrans']->ExRate,2) ."', - '' )"; + '" . $CreditNoteNo . "', + '" . $SQLCreditNoteDate . "', + '" . $PeriodNo . "', + '" . $EnteredGLCode->GLCode . "', + '" . $_SESSION['SuppTrans']->SupplierID . " " . $EnteredGLCode->Narrative . "', + '" . round(-$EnteredGLCode->Amount/$_SESSION['SuppTrans']->ExRate,2) ."', + '' )"; $ErrMsg = _('CRITICAL ERROR') . '! ' . _('NOTE DOWN THIS ERROR AND SEEK ASSISTANCE') . ': ' . _('The general ledger transaction could not be added because'); @@ -697,19 +702,19 @@ these entries are reversed from the GRN suspense when the shipment is closed - entries only to open shipts*/ $SQL = "INSERT INTO gltrans (type, - typeno, - trandate, - periodno, - account, - narrative, - amount) + typeno, + trandate, + periodno, + account, + narrative, + amount) VALUES (21, - '" . $CreditNoteNo . "', - '" . $SQLCreditNoteDate . "', - '" . $PeriodNo . "', - '" . $_SESSION['SuppTrans']->GRNAct . "', - '" . $_SESSION['SuppTrans']->SupplierID . ' ' . _('Shipment credit against') . ' ' . $ShiptChg->ShiptRef . "', - '" . round(-$ShiptChg->Amount/$_SESSION['SuppTrans']->ExRate,2) . "')"; + '" . $CreditNoteNo . "', + '" . $SQLCreditNoteDate . "', + '" . $PeriodNo . "', + '" . $_SESSION['SuppTrans']->GRNAct . "', + '" . $_SESSION['SuppTrans']->SupplierID . ' ' . _('Shipment credit against') . ' ' . $ShiptChg->ShiptRef . "', + '" . round(-$ShiptChg->Amount/$_SESSION['SuppTrans']->ExRate,2) . "')"; $ErrMsg = _('CRITICAL ERROR') . '! ' . _('NOTE DOWN THIS ERROR AND SEEK ASSISTANCE') . ': ' . _('The general ledger transaction for the shipment') . ' ' . $ShiptChg->ShiptRef . ' ' . _('could not be added because'); $DbgMsg = _('The following SQL to insert the GL transaction was used'); @@ -722,20 +727,20 @@ foreach ($_SESSION['SuppTrans']->Assets as $AssetAddition){ /* only the GL entries if the creditors->GL integration is enabled */ - $SQL = 'INSERT INTO gltrans (type, - typeno, - trandate, - periodno, - account, - narrative, - amount) - VALUES (21, ' . - $CreditNoteNo . ", - '" . $SQLCreditNoteDate . "', - '" . $PeriodNo . "', - '". $AssetAddition->CostAct . "', - '" . $_SESSION['SuppTrans']->SupplierID . ' ' . _('Asset Credit') . ' ' . $AssetAddition->AssetID . ': ' . $AssetAddition->Description . "', - '" . (-$AssetAddition->Amount/ $_SESSION['SuppTrans']->ExRate) . "')"; + $SQL = "INSERT INTO gltrans (type, + typeno, + trandate, + periodno, + account, + narrative, + amount) + VALUES ('21', + '" . $CreditNoteNo . "', + '" . $SQLCreditNoteDate . "', + '" . $PeriodNo . "', + '". $AssetAddition->CostAct . "', + '" . $_SESSION['SuppTrans']->SupplierID . ' ' . _('Asset Credit') . ' ' . $AssetAddition->AssetID . ': ' . $AssetAddition->Description . "', + '" . (-$AssetAddition->Amount/ $_SESSION['SuppTrans']->ExRate) . "')"; $ErrMsg = _('CRITICAL ERROR') . '! ' . _('NOTE DOWN THIS ERROR AND SEEK ASSISTANCE') . ': ' . _('The general ledger transaction for the asset addition could not be added because'); $DbgMsg = _('The following SQL to insert the GL transaction was used'); $Result = DB_query($SQL, $db, $ErrMsg, $DbgMsg, True); @@ -749,9 +754,9 @@ * debit postings to this WIP account * the WIP account is tidied up when the contract is closed*/ $result = DB_query("SELECT wipact FROM stockcategory - INNER JOIN stockmaster ON - stockcategory.categoryid=stockmaster.categoryid - WHERE stockmaster.stockid='" . $Contract->ContractRef . "'",$db); + INNER JOIN stockmaster ON + stockcategory.categoryid=stockmaster.categoryid + WHERE stockmaster.stockid='" . $Contract->ContractRef . "'",$db); $WIPRow = DB_fetch_row($result); $WIPAccount = $WIPRow[0]; @@ -794,7 +799,7 @@ account, narrative, amount) - VALUES (21, + VALUES ('21', '" . $CreditNoteNo . "', '" . $SQLCreditNoteDate . "', '" . $PeriodNo . "', @@ -858,22 +863,22 @@ * (($EnteredGRN->ChgPrice / $_SESSION['SuppTrans']->ExRate) - $EnteredGRN->StdCostUnit); $SQL = "INSERT INTO gltrans (type, - typeno, - trandate, - periodno, - account, - narrative, - amount) - VALUES (21, - '" . $CreditNoteNo . "', - '" . $SQLCreditNoteDate . "', - '" . $PeriodNo . "', - '" . $StockGLCode['purchpricevaract'] . "', - '" . $_SESSION['SuppTrans']->SupplierID . ' - ' . _('GRN Credit Note') . ' ' . $EnteredGRN->GRNNo . - ' - ' . $EnteredGRN->ItemCode . ' x ' . ($EnteredGRN->This_QuantityInv-$TotalQuantityOnHand) . ' x ' . _('price var of') . ' ' . - number_format(($EnteredGRN->ChgPrice / $_SESSION['SuppTrans']->ExRate) - $EnteredGRN->StdCostUnit,2) . - "', '" . (-$WriteOffToVariances) . "')"; - + typeno, + trandate, + periodno, + account, + narrative, + amount) + VALUES (21, + '" . $CreditNoteNo . "', + '" . $SQLCreditNoteDate . "', + '" . $PeriodNo . "', + '" . $StockGLCode['purchpricevaract'] . "', + '" . $_SESSION['SuppTrans']->SupplierID . ' - ' . _('GRN Credit Note') . ' ' . $EnteredGRN->GRNNo . + ' - ' . $EnteredGRN->ItemCode . ' x ' . ($EnteredGRN->This_QuantityInv-$TotalQuantityOnHand) . ' x ' . _('price var of') . ' ' . + number_format(($EnteredGRN->ChgPrice / $_SESSION['SuppTrans']->ExRate) - $EnteredGRN->StdCostUnit,2) . + "', '" . (-$WriteOffToVariances) . "')"; + $ErrMsg = _('CRITICAL ERROR') . '! ' . _('NOTE DOWN THIS ERROR AND SEEK ASSISTANCE') . ': ' . _('The general ledger transaction could not be added for the price variance of the stock item because'); $DbgMsg = _('The following SQL to insert the GL transaction was used'); @@ -883,22 +888,22 @@ /*Now post any remaining price variance to stock rather than price variances */ $SQL = "INSERT INTO gltrans (type, - typeno, - trandate, - periodno, - account, - narrative, - amount) - VALUES (21, - '" . $CreditNoteNo . "', - '" . $SQLCreditNoteDate . "', - '" . $PeriodNo . "', - '" . $StockGLCode['stockact'] . "', - '" . $_SESSION['SuppTrans']->SupplierID . ' - ' . _('Average Cost Adj') . - ' - ' . $EnteredGRN->ItemCode . ' x ' . $TotalQuantityOnHand . ' x ' . - number_format(($EnteredGRN->ChgPrice / $_SESSION['SuppTrans']->ExRate) - $EnteredGRN->StdCostUnit,2) . "', - '" . (-($PurchPriceVar - $WriteOffToVariances)) . "')"; - + typeno, + trandate, + periodno, + account, + narrative, + amount) + VALUES (21, + '" . $CreditNoteNo . "', + '" . $SQLCreditNoteDate . "', + '" . $PeriodNo . "', + '" . $StockGLCode['stockact'] . "', + '" . $_SESSION['SuppTrans']->SupplierID . ' - ' . _('Average Cost Adj') . + ' - ' . $EnteredGRN->ItemCode . ' x ' . $TotalQuantityOnHand . ' x ' . + number_format(($EnteredGRN->ChgPrice / $_SESSION['SuppTrans']->ExRate) - $EnteredGRN->StdCostUnit,2) . "', + '" . (-($PurchPriceVar - $WriteOffToVariances)) . "')"; + $ErrMsg = _('CRITICAL ERROR') . '! ' . _('NOTE DOWN THIS ERROR AND SEEK ASSISTANCE') . ': ' . _('The general ledger transaction could not be added for the price variance of the stock item because'); $DbgMsg = _('The following SQL to insert the GL transaction was used'); @@ -916,11 +921,12 @@ if ($TotalQuantityOnHand>0) { - $CostIncrement = ($PurchPriceVar - $WriteOffToVariances) / $TotalQuantityOnHand; $sql = "UPDATE stockmaster SET lastcost=materialcost+overheadcost+labourcost, - materialcost=materialcost+" . $CostIncrement . " WHERE stockid='" . $EnteredGRN->ItemCode . "'"; + materialcost=materialcost+" . $CostIncrement . " + WHERE stockid='" . $EnteredGRN->ItemCode . "'"; + $Result = DB_query($sql, $db, $ErrMsg, $DbgMsg, True); } else { $sql = "UPDATE stockmaster SET lastcost=materialcost+overheadcost+labourcost, @@ -932,22 +938,22 @@ } else { //It must be Standard Costing $SQL = "INSERT INTO gltrans (type, - typeno, - trandate, - periodno, - account, - narrative, - amount) - VALUES (21, - '" . $CreditNoteNo . "', - '" . $SQLCreditNoteDate . "', - '" . $PeriodNo . "', - '" . $StockGLCode['purchpricevaract'] . "', - '" . $_SESSION['SuppTrans']->SupplierID . ' - ' . _('GRN') . ' ' . $EnteredGRN->GRNNo . - ' - ' . $EnteredGRN->ItemCode . ' x ' . $EnteredGRN->This_QuantityInv . ' x ' . _('price var of') . ' ' . - number_format(($EnteredGRN->ChgPrice / $_SESSION['SuppTrans']->ExRate) - $EnteredGRN->StdCostUnit,2) . "', - '" . (-$PurchPriceVar) . "')"; - + typeno, + trandate, + periodno, + account, + narrative, + amount) + VALUES (21, + '" . $CreditNoteNo . "', + '" . $SQLCreditNoteDate . "', + '" . $PeriodNo . "', + '" . $StockGLCode['purchpricevaract'] . "', + '" . $_SESSION['SuppTrans']->SupplierID . ' - ' . _('GRN') . ' ' . $EnteredGRN->GRNNo . + ' - ' . $EnteredGRN->ItemCode . ' x ' . $EnteredGRN->This_QuantityInv . ' x ' . _('price var of') . ' ' . + number_format(($EnteredGRN->ChgPrice / $_SESSION['SuppTrans']->ExRate) - $EnteredGRN->StdCostUnit,2) . "', + '" . (-$PurchPriceVar) . "')"; + $ErrMsg = _('CRITICAL ERROR') . '! ' . _('NOTE DOWN THIS ERROR AND SEEK ASSISTANCE') . ': ' . _('The general ledger transaction could not be added for the price variance of the stock item because'); $DbgMsg = _('The following SQL to insert the GL transaction was used'); @@ -964,22 +970,22 @@ if ($EnteredGRN->AssetID!=0) { //then it is an asset /*Need to get the asset details for posting */ - $result = DB_query('SELECT costact - FROM fixedassets INNER JOIN fixedassetcategories - ON fixedassets.assetcategoryid= fixedassetcategories.categoryid - WHERE assetid="' . $EnteredGRN->AssetID . '"',$db); + $result = DB_query("SELECT costact + FROM fixedassets INNER JOIN fixedassetcategories + ON fixedassets.assetcategoryid= fixedassetcategories.categoryid + WHERE assetid='" . $EnteredGRN->AssetID . "'",$db); $AssetRow = DB_fetch_array($result); $GLCode = $AssetRow['costact']; } //the item was an asset $SQL = "INSERT INTO gltrans (type, - typeno, - trandate, - periodno, - account, - narrative, - amount) - VALUES (21, + typeno, + trandate, + periodno, + account, + narrative, + amount) + VALUES (21, '" . $CreditNoteNo . "', '" . $SQLCreditNoteDate . "', '" . $PeriodNo . "', @@ -1115,13 +1121,12 @@ foreach ($_SESSION['SuppTrans']->Taxes AS $TaxTotals) { $SQL = "INSERT INTO supptranstaxes (supptransid, - taxauthid, - taxamount) - VALUES ( - '" . $SuppTransID . "', - '" . $TaxTotals->TaxAuthID . "', - '" . -$TaxTotals->TaxOvAmount . "')"; - + taxauthid, + taxamount) + VALUES ('" . $SuppTransID . "', + '" . $TaxTotals->TaxAuthID . "', + '" . -$TaxTotals->TaxOvAmount . "')"; + $ErrMsg =_('CRITICAL ERROR') . '! ' . _('NOTE DOWN THIS ERROR AND SEEK ASSISTANCE') . ': ' . _('The supplier transaction taxes records could not be inserted because'); $DbgMsg = _('The following SQL to insert the supplier transaction taxes record was used:'); $Result = DB_query($SQL,$db,$ErrMsg,$DbgMsg,true); @@ -1132,8 +1137,8 @@ foreach ($_SESSION['SuppTrans']->GRNs as $EnteredGRN){ - $SQL = "UPDATE purchorderdetails SET qtyinvoiced = qtyinvoiced - " . - $EnteredGRN->This_QuantityInv . " WHERE podetailitem = '" . $EnteredGRN->PODetailItem ."'"; + $SQL = "UPDATE purchorderdetails SET qtyinvoiced = qtyinvoiced - " .$EnteredGRN->This_QuantityInv . " + WHERE podetailitem = '" . $EnteredGRN->PODetailItem ."'"; $ErrMsg = _('CRITICAL ERROR') . '! ' . _('NOTE DOWN THIS ERROR AND SEEK ASSISTANCE') . ': ' . _('The quantity credited of the purchase order line could not be updated because'); $DbgMsg = _('The following SQL to update the purchase order details was used'); @@ -1154,18 +1159,17 @@ /* and insert the shipment charge records */ $SQL = "INSERT INTO shipmentcharges (shiptref, - transtype, - transno, - stockid, - value) - VALUES ( - '" . $EnteredGRN->ShiptRef . "', - 21, - '" . $CreditNoteNo . "', - '" . $EnteredGRN->ItemCode . "', - '" . round(-$EnteredGRN->This_QuantityInv * $EnteredGRN->ChgPrice / $_SESSION['SuppTrans']->ExRate,2) . "' - )"; - + transtype, + transno, + stockid, + value) + VALUES ('" . $EnteredGRN->ShiptRef . "', + 21, + '" . $CreditNoteNo . "', + '" . $EnteredGRN->ItemCode . "', + '" . round(-$EnteredGRN->This_QuantityInv * $EnteredGRN->ChgPrice / $_SESSION['SuppTrans']->ExRate,2) . "' + )"; + $ErrMsg = _('CRITICAL ERROR') . '! ' . _('NOTE DOWN THIS ERROR AND SEEK ASSISTANCE') . ': ' . _('The shipment charge record for the shipment') . ' ' . $EnteredGRN->ShiptRef . ' ' . _('could not be added because'); $DbgMsg = _('The following SQL to insert the Shipment charge record was used'); @@ -1176,21 +1180,21 @@ if ($PurchPriceVar !=0){ /*Add the fixed asset trans for the difference in the cost */ $SQL = "INSERT INTO fixedassettrans (assetid, - transtype, - transno, - transdate, - periodno, - inputdate, - fixedassettranstype, - amount) - VALUES ('" . $EnteredGRN->AssetID . "', - 21, - '" . $CreditNoteNo . "', - '" . $SQLCreditNoteDate . "', - '" . $PeriodNo . "', - '" . Date('Y-m-d') . "', - 'cost', - '" . -($PurchPriceVar) . "')"; + transtype, + transno, + transdate, + periodno, + inputdate, + fixedassettranstype, + amount) + VALUES ('" . $EnteredGRN->AssetID . "', + 21, + '" . $CreditNoteNo . "', + '" . $SQLCreditNoteDate . "', + '" . $PeriodNo . "', + '" . Date('Y-m-d') . "', + 'cost', + '" . -($PurchPriceVar) . "')"; $ErrMsg = _('CRITICAL ERROR! NOTE DOWN THIS ERROR AND SEEK ASSISTANCE The fixed asset transaction could not be inserted because'); $DbgMsg = _('The following SQL to insert the fixed asset transaction record was used'); $Result = DB_query($SQL,$db,$ErrMsg, $DbgMsg, true); @@ -1235,18 +1239,18 @@ $Anticipated =0; } $SQL = "INSERT INTO contractcharges (contractref, - transtype, - transno, - amount, - narrative, - anticipated) - VALUES ( - '" . $Contract->ContractRef . "', - '21', - '" . $CreditNoteNo . "', - '" . -$Contract->Amount/ $_SESSION['SuppTrans']->ExRate . "', - '" . $Contract->Narrative . "', - '" . $Anticipated . "')"; + transtype, + transno, + amount, + narrative, + anticipated) + VALUES ( + '" . $Contract->ContractRef . "', + '21', + '" . $CreditNoteNo . "', + '" . -$Contract->Amount/ $_SESSION['SuppTrans']->ExRate . "', + '" . $Contract->Narrative . "', + '" . $Anticipated . "')"; $ErrMsg = _('CRITICAL ERROR') . '! ' . _('NOTE DOWN THIS ERROR AND SEEK ASSISTANCE') . ': ' . _('The contract charge record for contract') . ' ' . $Contract->ContractRef . ' ' . _('could not be added because'); $DbgMsg = _('The following SQL to insert the contract charge record was used'); @@ -1264,29 +1268,28 @@ /* First the fixed asset transaction */ $SQL = "INSERT INTO fixedassettrans (assetid, - transtype, - transno, - transdate, - periodno, - inputdate, - fixedassettranstype, - amount) - VALUES ('" . $AssetAddition->AssetID . "', - 21, - '" . $CreditNoteNo . "', - '" . $SQLCreditNoteDate . "', - '" . $PeriodNo . "', - '" . Date('Y-m-d') . "', - 'cost', - '" . (-$AssetAddition->Amount / $_SESSION['SuppTrans']->ExRate) . "')"; + transtype, + transno, + transdate, + periodno, + inputdate, + fixedassettranstype, + amount) + VALUES ('" . $AssetAddition->AssetID . "', + 21, + '" . $CreditNoteNo . "', + '" . $SQLCreditNoteDate . "', + '" . $PeriodNo . "', + '" . Date('Y-m-d') . "', + 'cost', + '" . (-$AssetAddition->Amount / $_SESSION['SuppTrans']->ExRate) . "')"; $ErrMsg = _('CRITICAL ERROR! NOTE DOWN THIS ERROR AND SEEK ASSISTANCE The fixed asset transaction could not be inserted because'); $DbgMsg = _('The following SQL to insert the fixed asset transaction record was used'); $Result = DB_query($SQL,$db,$ErrMsg, $DbgMsg, true); /*Now update the asset cost in fixedassets table */ - $SQL = "UPDATE fixedassets - SET cost = cost - " . ($AssetAddition->Amount / $_SESSION['SuppTrans']->ExRate) . " - WHERE assetid = '" . $AssetAddition->AssetID . "'"; + $SQL = "UPDATE fixedassets SET cost = cost - " . ($AssetAddition->Amount / $_SESSION['SuppTrans']->ExRate) . " + WHERE assetid = '" . $AssetAddition->AssetID . "'"; $ErrMsg = _('CRITICAL ERROR! NOTE DOWN THIS ERROR AND SEEK ASSISTANCE. The fixed asset cost was not able to be updated because:'); $DbgMsg = _('The following SQL was used to attempt the update of the asset cost:'); $Result = DB_query($SQL,$db,$ErrMsg, $DbgMsg, true); @@ -1295,7 +1298,7 @@ DB_Txn_Commit($db); prnMsg(_('Supplier credit note number') . ' ' . $CreditNoteNo . ' ' . _('has been processed'),'success'); - echo '<br><div class="centre"><a href="' . $rootpath . '/SupplierCredit.php?&SupplierID=' .$_SESSION['SuppTrans']->SupplierID . '">' . _('Enter another Credit Note for this Supplier') . '</a></div>'; + echo '<br /><div class="centre"><a href="' . $rootpath . '/SupplierCredit.php?&SupplierID=' .$_SESSION['SuppTrans']->SupplierID . '">' . _('Enter another Credit Note for this Supplier') . '</a></div>'; unset($_SESSION['SuppTrans']->GRNs); unset($_SESSION['SuppTrans']->Shipts); unset($_SESSION['SuppTrans']->GLCodes); Modified: trunk/SupplierInquiry.php =================================================================== --- trunk/SupplierInquiry.php 2011-04-03 03:24:25 UTC (rev 4537) +++ trunk/SupplierInquiry.php 2011-04-04 10:14:30 UTC (rev 4538) @@ -4,20 +4,18 @@ include('includes/SQL_CommonFunctions.inc'); -//$PageSecurity=2; - include('includes/session.inc'); $title = _('Supplier Inquiry'); include('includes/header.inc'); // This is already linked from the menu -//echo "<a href='" . $rootpath . '/SelectSupplier.php?' . SID . "'>" . _('Back to Suppliers') . '</a><br>'; +//echo "<a href='" . $rootpath . '/SelectSupplier.php?' . SID . "'>" . _('Back to Suppliers') . '</a><br />'; // always figure out the SQL required from the inputs available if(!isset($_GET['SupplierID']) AND !isset($_SESSION['SupplierID'])){ - echo '<br>' . _('To display the enquiry a Supplier must first be selected from the Supplier selection screen') . - "<br><div class='centre'>><a href='". $rootpath . "/SelectSupplier.php'>" . _('Select a Supplier to Inquire On') . '</a></div>'; + echo '<br />' . _('To display the enquiry a Supplier must first be selected from the Supplier selection screen') . + '<br /><div class="centre"><a href="' . $rootpath . '/SelectSupplier.php">' . _('Select a Supplier to Inquire On') . '</a></div>'; exit; } else { if (isset($_GET['SupplierID'])){ @@ -35,7 +33,7 @@ } -$SQL = 'SELECT suppliers.suppname, +$SQL = "SELECT suppliers.suppname, suppliers.currcode, currencies.currency, paymentterms.terms, @@ -44,21 +42,21 @@ CASE WHEN (TO_DAYS(Now()) - TO_DAYS(supptrans.trandate)) >= paymentterms.daysbeforedue THEN supptrans.ovamount + supptrans.ovgst - supptrans.alloc ELSE 0 END ELSE - CASE WHEN TO_DAYS(Now()) - TO_DAYS(DATE_ADD(DATE_ADD(supptrans.trandate, ' . INTERVAL('1', 'MONTH') . '), ' . INTERVAL('(paymentterms.dayinfollowingmonth - DAYOFMONTH(supptrans.trandate))', 'DAY') . ')) >= 0 THEN supptrans.ovamount + supptrans.ovgst - supptrans.alloc ELSE 0 END + CASE WHEN TO_DAYS(Now()) - TO_DAYS(DATE_ADD(DATE_ADD(supptrans.trandate, " . INTERVAL('1', 'MONTH') . "), " . INTERVAL('(paymentterms.dayinfollowingmonth - DAYOFMONTH(supptrans.trandate))', 'DAY') . ")) >= 0 THEN supptrans.ovamount + supptrans.ovgst - supptrans.alloc ELSE 0 END END) AS due, SUM(CASE WHEN paymentterms.daysbeforedue > 0 THEN CASE WHEN (TO_DAYS(Now()) - TO_DAYS(supptrans.trandate)) > paymentterms.daysbeforedue - AND (TO_DAYS(Now()) - TO_DAYS(supptrans.trandate)) >= (paymentterms.daysbeforedue + ' . $_SESSION['PastDueDays1'] . ') + AND (TO_DAYS(Now()) - TO_DAYS(supptrans.trandate)) >= (paymentterms.daysbeforedue + " . $_SESSION['PastDueDays1'] . ") THEN supptrans.ovamount + supptrans.ovgst - supptrans.alloc ELSE 0 END ELSE - CASE WHEN (TO_DAYS(Now()) - TO_DAYS(DATE_ADD(DATE_ADD(supptrans.trandate, ' . INTERVAL('1','MONTH') . '), ' . INTERVAL('(paymentterms.dayinfollowingmonth - DAYOFMONTH(supptrans.trandate))', 'DAY') .')) >= ' . $_SESSION['PastDueDays1'] . ') + CASE WHEN (TO_DAYS(Now()) - TO_DAYS(DATE_ADD(DATE_ADD(supptrans.trandate, " . INTERVAL('1','MONTH') . "), " . INTERVAL('(paymentterms.dayinfollowingmonth - DAYOFMONTH(supptrans.trandate))', 'DAY') .")) >= '" . $_SESSION['PastDueDays1'] . "') THEN supptrans.ovamount + supptrans.ovgst - supptrans.alloc ELSE 0 END END) AS overdue1, Sum(CASE WHEN paymentterms.daysbeforedue > 0 THEN - CASE WHEN TO_DAYS(Now()) - TO_DAYS(supptrans.trandate) > paymentterms.daysbeforedue AND TO_DAYS(Now()) - TO_DAYS(supptrans.trandate) >= (paymentterms.daysbeforedue + ' . $_SESSION['PastDueDays2'] . ') + CASE WHEN TO_DAYS(Now()) - TO_DAYS(supptrans.trandate) > paymentterms.daysbeforedue AND TO_DAYS(Now()) - TO_DAYS(supptrans.trandate) >= (paymentterms.daysbeforedue + " . $_SESSION['PastDueDays2'] . ") THEN supptrans.ovamount + supptrans.ovgst - supptrans.alloc ELSE 0 END ELSE - CASE WHEN (TO_DAYS(Now()) - TO_DAYS(DATE_ADD(DATE_ADD(supptrans.trandate, ' . INTERVAL('1','MONTH') . '), ' . INTERVAL('(paymentterms.dayinfollowingmonth - DAYOFMONTH(supptrans.trandate))', 'DAY') . ')) >= ' . $_SESSION['PastDueDays2'] . ") + CASE WHEN (TO_DAYS(Now()) - TO_DAYS(DATE_ADD(DATE_ADD(supptrans.trandate, " . INTERVAL('1','MONTH') . "), " . INTERVAL('(paymentterms.dayinfollowingmonth - DAYOFMONTH(supptrans.trandate))', 'DAY') . ")) >= '" . $_SESSION['PastDueDays2'] . "') THEN supptrans.ovamount + supptrans.ovgst - supptrans.alloc ELSE 0 END END ) AS overdue2 FROM suppliers, @@ -122,9 +120,13 @@ if (isset($_GET['HoldType']) AND isset($_GET['HoldTrans'])){ if ($_GET['HoldStatus'] == _('Hold')){ - $SQL = "UPDATE supptrans SET hold=1 WHERE type='" . $_GET['HoldType'] . "' AND transno='" . $_GET['HoldTrans'] . "'"; + $SQL = "UPDATE supptrans SET hold=1 + WHERE type='" . $_GET['HoldType'] . "' + AND transno='" . $_GET['HoldTrans'] . "'"; } elseif ($_GET['HoldStatus'] == _('Release')){ - $SQL = "UPDATE supptrans SET hold=0 WHERE type='" . $_GET['HoldType'] . "' AND transno='" . $_GET['HoldTrans'] . "'"; + $SQL = "UPDATE supptrans SET hold=0 + WHERE type='" . $_GET['HoldType'] . "' + AND transno='" . $_GET['HoldTrans'] . "'"; } $ErrMsg = _('The Supplier Transactions could not be updated because'); @@ -133,12 +135,13 @@ } -echo "<table width=90% class=selection><tr><th>" . _('Total Balance') . - "</th><th>" . _('Current') . - "</th><th>" . _('Now Due') . - "</th><th>" . $_SESSION['PastDueDays1'] . '-' . $_SESSION['PastDueDays2'] . - ' ' . _('Days Overdue') . - "</th><th>" . _('Over') . ' ' . $_SESSION['PastDueDays2'] . ' ' . _('Days Overdue') . '</th></tr>'; +echo '<table width=90% class="selection"> + <tr><th>' . _('Total Balance') . '</th> + <th>' . _('Current') . '</th> + <th>' . _('Now Due') . '</th> + <th>' . $_SESSION['PastDueDays1'] . '-' . $_SESSION['PastDueDays2'] . ' ' . _('Days Overdue') . '</th> + <th>' . _('Over') . ' ' . $_SESSION['PastDueDays2'] . ' ' . _('Days Overdue') . '</th> + </tr>'; echo '<tr><td class=number>' . number_format($SupplierRecord['balance'],2) . '</td><td class=number>' . number_format(($SupplierRecord['balance'] - $SupplierRecord['due']),2) . @@ -146,10 +149,12 @@ '</td><td class=number>' . number_format(($SupplierRecord['overdue1']-$SupplierRecord['overdue2']) ,2) . '</td><td class=number>' . number_format($SupplierRecord['overdue2'],2) . '</td></tr></table>'; -echo "<br><div class='centre'><form action='" . $_SERVER['PHP_SELF'] . "?" . SID . "' method=post>"; +echo '<br /><div class="centre"><form action="' . $_SERVER['PHP_SELF'] . '" method="post">'; echo '<input type="hidden" name="FormID" value="' . $_SESSION['FormID'] . '" />'; -echo _('Show all transactions after') . ': ' ."<input type=text class='date' alt='".$_SESSION['DefaultDateFormat']."' name='TransAfterDate' VALUE='" . - $_POST['TransAfterDate'] . "' maxlength =10 size=10> <input type=submit name='Refresh Inquiry' VALUE='" . _('Refresh Inquiry') . "'></form><br>"; +echo _('Show all transactions after') . ': ' .'<input type="text" class="date" alt="' .$_SESSION['DefaultDateFormat'] .'" name="TransAfterDate" value="' . $_POST['TransAfterDate'] . '" maxlength="10" size="10" /> + <input type="submit" name="Refresh Inquiry" value="' . _('Refresh Inquiry') . '" /> + </form> + <br />'; echo '</div>'; $DateAfterCriteria = FormatDateForSQL($_POST['TransAfterDate']); @@ -189,16 +194,18 @@ echo '<table width="90%" cellpadding="2" colspan="7" class=selection>'; -$TableHeader = "<tr BGCOLOR =#800000><th>" . _('Trans') . ' #' . - "</th><th>" . _('Type') . - "</th><th>" . _('Supplier Ref') . - "</th><th>" . _('Date') . - "</th><th>" . _('Total') . - "</th><th>" . _('Allocated') . - "</th><th>" . _('Balance') . - "</th><th>" . _('Comments') . - "</th><th>" . _('More Info') . - "</th><th>" . _('More Info') . '</td></tr>'; +$TableHeader = '<tr> + <th>' . _('Trans') . ' #' .'</th> + <th>' . _('Type') . '</th> + <th>' . _('Supplier Ref') . '</th> + <th>' . _('Date') . '</th> + <th>' . _('Total') . '</th> + <th>' . _('Allocated') . '</th> + <th>' . _('Balance') . '</th> + <th>' . _('Comments') . '</th> + <th>' . _('More Info') . '</th> + <th>' . _('More Info') . '</td> + </tr>'; echo $TableHeader; @@ -232,43 +239,41 @@ /*The trans is settled so don't show option to hold */ - echo "<td>".$myrow['transno']."</td>"; - echo "<td>".$myrow['typename']."</td>"; - echo "<td>".$myrow['suppreference']."</td>"; - echo "<td>".ConvertSQLDate($myrow['trandate'])."</td>"; - echo "<td class=number>".number_format($myrow['totalamount'],2)."</td>"; - echo "<td class=number>".number_format($myrow['allocated'],2)."</td>"; - echo "<td class=number>".number_format($myrow['totalamount']-$myrow['allocated'],2)."</td>"; - echo "<td align=left>".$myrow['transtext']."</td>"; - echo "<td><a target='_blank' href='".$rootpath."/GLTransInquiry.php?".SID."&TypeID=".$myrow['type']."&TransNo=".$myrow['transno']."'>" . _('View GL Postings') . "</a></td>"; - echo "<td><a href='".$rootpath."/PaymentAllocations.php?".SID."SuppID=".$myrow['supplierno']."&InvID=".$myrow['suppreference']."'>" . _('View Payments') . "</a></td></tr>"; + echo '<td>' . $myrow['transno'] . '</td> + <td>' . $myrow['typename'] . '</td> + <td>' . $myrow['suppreference'] . '</td> + <td>' . ConvertSQLDate($myrow['trandate']) . '</td> + <td class="number">' . number_format($myrow['totalamount'],2) .'</td> + <td class="number">' . number_format($myrow['allocated'],2) . '</td> + <td class="number">' . number_format($myrow['totalamount']-$myrow['allocated'],2) . '</td> + <td align="left">' . $myrow['transtext'] . '</td> + <td><a target="_blank" href="' . $rootpath . '/GLTransInquiry.php?TypeID=' . $myrow['type'] . '&TransNo=' . $myrow['transno'] .'">' . _('View GL Postings') . '</a></td> + <td><a href="' . $rootpath . '/PaymentAllocations.php?SuppID=' . $myrow['supplierno'] . '&InvID=' . $myrow['suppreference'] .'">' . _('View Payments') . '</a></td></tr>'; } else { - echo "<td>".$myrow['transno']."</td>"; - echo "<td>".$myrow['typename']."</td>"; - echo "<td>".$myrow['suppreference']."</td>"; - echo "<td>".ConvertSQLDate($myrow['trandate'])."</td>"; - echo "<td class=number>".number_format($myrow['totalamount'],2)."</td>"; - echo "<td class=number>".number_format($myrow['allocated'],2)."</td>"; - echo "<td class=number>".number_format($myrow['totalamount'] - $myrow['allocated'],2)."</td>"; - echo "<td align=left>".$myrow['transtext']."</td>"; - $authsql='SELECT offhold - FROM purchorderauth - WHERE userid="'.$_SESSION['UserID'] . - '" AND currabrev="'.$SupplierRecord['currcode'].'"'; + echo '<td>' . $myrow['transno'] . '</td> + <td>' . $myrow['typename'] . '</td> + <td>' . $myrow['suppreference'] . '</td> + <td>' . ConvertSQLDate($myrow['trandate']) . '</td> + <td class="number">' . number_format($myrow['totalamount'],2) . '</td> + <td class="number">' .number_format($myrow['allocated'],2) . '</td> + <td class="number">' . number_format($myrow['totalamount'] - $myrow['allocated'],2) .'</td> + <td align="left">' . $myrow['transtext'] . '</td>'; + $authsql="SELECT offhold + FROM purchorderauth + WHERE userid='" . $_SESSION['UserID'] . "' + AND currabrev='" . $SupplierRecord['currcode']."'"; $authresult=DB_query($authsql, $db); $authrow=DB_fetch_array($authresult); if ($authrow[0]==0) { - echo "<td><a href='".$_SERVER['PHP_SELF']."?".SID."&HoldType=".$myrow['type']."&HoldTrans=".$myrow['transno']. - "&HoldStatus=".$HoldValue."&FromDate=".$_POST['TransAfterDate']."'>".$HoldValue."</a></td>"; + echo '<td><a href="' .$_SERVER['PHP_SELF'] . '?HoldType=' . $myrow['type'] . '&HoldTrans=' . $myrow['transno']. '&HoldStatus=' . $HoldValue . '&FromDate=' . $_POST['TransAfterDate'].'">' . $HoldValue .'</a></td>'; } else { if ($HoldValue==_('Release')) { - echo "<td>".$HoldValue."</a></td>"; + echo '<td>' . $HoldValue .'</a></td>'; } else { - echo "<td><a href='".$_SERVER['PHP_SELF']."?".SID."&HoldType=".$myrow['type']."&HoldTrans=".$myrow['transno']. - "&Hol... [truncated message content] |
From: <dai...@us...> - 2011-04-04 10:14:39
|
Revision: 4538 http://web-erp.svn.sourceforge.net/web-erp/?rev=4538&view=rev Author: daintree Date: 2011-04-04 10:14:30 +0000 (Mon, 04 Apr 2011) Log Message: ----------- SQL and xhmtl quotes Modified Paths: -------------- trunk/StockReorderLevel.php trunk/SuppFixedAssetChgs.php trunk/SupplierCredit.php trunk/SupplierInquiry.php trunk/SupplierInvoice.php trunk/SupplierTenders.php Modified: trunk/StockReorderLevel.php =================================================================== --- trunk/StockReorderLevel.php 2011-04-03 03:24:25 UTC (rev 4537) +++ trunk/StockReorderLevel.php 2011-04-04 10:14:30 UTC (rev 4538) @@ -17,7 +17,7 @@ echo '<p class="page_title_text"><img src="'.$rootpath.'/css/'.$theme.'/images/inventory.png" title="' . _('Inventory') . '" alt="" /><b>' . $title. '</b></p>'; -$result = DB_query("SELECT description, units FROM stockmaster WHERE stockid='$StockID'", $db); +$result = DB_query("SELECT description, units FROM stockmaster WHERE stockid='" . $StockID . "'", $db); $myrow = DB_fetch_row($result); echo '<form action="' . $_SERVER['PHP_SELF'] . '" method="post">'; @@ -41,8 +41,8 @@ $LocStockResult = DB_query($sql, $db, $ErrMsg, $DbgMsg); echo '<table cellpadding="2" class="selection">'; -echo '<tr><th colspan=3'._('Stock Code') . ":<input type=TEXT name='StockID' size=21 VALUE='$StockID' maxlength=20>"; -echo " <input type=submit name='Show' VALUE='" . _('Show Re-Order Levels') . "'></th></tr>"; +echo '<tr><th colspan="3">' . _('Stock Code') . ':<input type="text" name="StockID" size="21" value="' . $StockID . '" maxlength="20">'; +echo '<input type="submit" name="Show" value="' . _('Show Re-Order Levels') . '"></th></tr>'; echo '<tr><th colspan=3><font color=BLUE size=3><b>' . $StockID . ' - ' . $myrow[0] . '</b> (' . _('In Units of') . ' ' . $myrow[1] . ')</font></th></tr>'; $TableHeader = '<tr> @@ -79,7 +79,7 @@ <td class=number>%s</td> <td><input type=text class='number' name=%s maxlength=10 size=10 VALUE=%s></td>", $myrow['locationname'], - number_format($myrow['quantity'],StockDecimalPlaces($StockID, $db)), + number_format($myrow['quantity'],$myrow['decimalplaces']), $myrow['loccode'], $myrow['reorderlevel']); $j++; @@ -91,11 +91,11 @@ } //end of while loop -echo "</table><br /><div class='centre'><input type=submit name='UpdateData' VALUE='" . _('Update') . "'><br /><br />"; -echo "<a href='$rootpath/StockMovements.php?StockID=$StockID'>" . _('Show Stock Movements') . '</a>'; -echo "<br /><a href='$rootpath/StockUsage.php?StockID=$StockID'>" . _('Show Stock Usage') . '</a>'; -echo "<br /><a href='$rootpath/SelectSalesOrder.php?SelectedStockItem=$StockID'>" . _('Search Outstanding Sales Orders') . '</a>'; -echo "<br /><a href='$rootpath/SelectCompletedOrder.php?SelectedStockItem=$StockID'>" . _('Search Completed Sales Orders') . '</a>'; +echo '</table><br /><div class="centre"><input type="submit" name="UpdateData" value="' . _('Update') . '"><br /><br />'; +echo '<a href="' . $rootpath . '/StockMovements.php?StockID=' . $StockID . '">' . _('Show Stock Movements') . '</a>'; +echo '<br /><a href="' . $rootpath . '/StockUsage.php?StockID=' . $StockID . '">' . _('Show Stock Usage') . '</a>'; +echo '<br /><a href="' . $rootpath . '/SelectSalesOrder.php?SelectedStockItem=' . $StockID . '">' . _('Search Outstanding Sales Orders') . '</a>'; +echo '<br /><a href="' . $rootpath . '/SelectCompletedOrder.php?SelectedStockItem=' . $StockID . '">' . _('Search Completed Sales Orders') . '</a>'; echo '</div></form>'; include('includes/footer.inc'); Modified: trunk/SuppFixedAssetChgs.php =================================================================== --- trunk/SuppFixedAssetChgs.php 2011-04-03 03:24:25 UTC (rev 4537) +++ trunk/SuppFixedAssetChgs.php 2011-04-04 10:14:30 UTC (rev 4538) @@ -1,8 +1,7 @@ <?php +/* $Id: SuppFixedAssetChgs.php 4473 2011-01-23 04:08:53Z daintree $ */ -/* $Id: SuppFixedAssetChgs.php 4391 2010-12-22 16:21:35Z tim_schofield $*/ - /*The supplier transaction uses the SuppTrans class to hold the information about the invoice the SuppTrans class contains an array of Asset objects called Assets- containing details of all asset additions on a supplier invoice Asset additions are posted to the debit of fixed asset category cost account if the creditors GL link is on */ @@ -28,7 +27,12 @@ $InputError = False; if ($_POST['AssetID'] == ''){ - $_POST['AssetID'] = $_POST['AssetSelection']; + if ($_POST['AssetSelection']==''){ + $InputError = True; + prnMsg(_('A valid asset must be either selected from the list or entered'),'error'); + } else { + $_POST['AssetID'] = $_POST['AssetSelection']; + } } else { $result = DB_query("SELECT assetid FROM fixedassets WHERE assetid='" . $_POST['AssetID'] . "'",$db); if (DB_num_rows($result)==0) { @@ -96,7 +100,7 @@ } /*Set up a form to allow input of new Shipment charges */ -echo '<br /><form action="' . $_SERVER['PHP_SELF'] . '?' . SID . '" method="post">'; +echo '<br /><form action="' . $_SERVER['PHP_SELF'] . '" method="post" />'; echo '<input type="hidden" name="FormID" value="' . $_SESSION['FormID'] . '" />'; if (!isset($_POST['AssetID'])) { @@ -134,10 +138,10 @@ $_POST['Amount']=0; } echo '<tr><td>' . _('Amount') . ':</td> - <td><input type="text" class="number" name="Amount" size="12" maxlength="11" VALUE="' . $_POST['Amount'] . '"></td></tr>'; + <td><input type="text" class="number" name="Amount" size="12" maxlength="11" value="' . $_POST['Amount'] . '"></td></tr>'; echo '</table>'; -echo '<br /><div class=centre><input type="submit" name="AddAssetToInvoice" VALUE="' . _('Enter Fixed Asset') . '"></div>'; +echo '<br /><div class=centre><input type="submit" name="AddAssetToInvoice" value="' . _('Enter Fixed Asset') . '"></div>'; echo '</form>'; include('includes/footer.inc'); Modified: trunk/SupplierCredit.php =================================================================== --- trunk/SupplierCredit.php 2011-04-03 03:24:25 UTC (rev 4537) +++ trunk/SupplierCredit.php 2011-04-04 10:14:30 UTC (rev 4538) @@ -21,8 +21,6 @@ include('includes/DefineSuppTransClass.php'); -//$PageSecurity = 5; - /* Session started in header.inc for password checking and authorisation level check */ include('includes/session.inc'); @@ -33,14 +31,14 @@ include('includes/SQL_CommonFunctions.inc'); //this is available from the menu on this page already -//echo "<a href='" . $rootpath . '/SelectSupplier.php?' . SID . "'>" . _('Back to Suppliers') . '</a><br>'; +//echo "<a href='" . $rootpath . '/SelectSupplier.php?' . SID . "'>" . _('Back to Suppliers') . '</a><br />'; if (isset($_GET['New'])) { unset($_SESSION['SuppTrans']); } if (!isset($_SESSION['SuppTrans']->SupplierName)) { - $sql='SELECT suppname FROM suppliers WHERE supplierid="'.$_GET['SupplierID'].'"'; + $sql="SELECT suppname FROM suppliers WHERE supplierid='" . $_GET['SupplierID']."'"; $result = DB_query($sql,$db); $myrow = DB_fetch_row($result); $SupplierName=$myrow[0]; @@ -73,23 +71,23 @@ /*Now retrieve supplier information - name, currency, default ex rate, terms, tax rate etc */ $sql = "SELECT suppliers.suppname, - suppliers.supplierid, - paymentterms.terms, - paymentterms.daysbeforedue, - paymentterms.dayinfollowingmonth, - suppliers.currcode, - currencies.rate AS exrate, - suppliers.taxgroupid, - taxgroups.taxgroupdescription - FROM suppliers, - taxgroups, - currencies, - paymentterms, - taxauthorities - WHERE suppliers.taxgroupid=taxgroups.taxgroupid - AND suppliers.currcode=currencies.currabrev - AND suppliers.paymentterms=paymentterms.termsindicator - AND suppliers.supplierid = '" . $_GET['SupplierID'] . "'"; + suppliers.supplierid, + paymentterms.terms, + paymentterms.daysbeforedue, + paymentterms.dayinfollowingmonth, + suppliers.currcode, + currencies.rate AS exrate, + suppliers.taxgroupid, + taxgroups.taxgroupdescription + FROM suppliers, + taxgroups, + currencies, + paymentterms, + taxauthorities + WHERE suppliers.taxgroupid=taxgroups.taxgroupid + AND suppliers.currcode=currencies.currabrev + AND suppliers.paymentterms=paymentterms.termsindicator + AND suppliers.supplierid = '" . $_GET['SupplierID'] . "'"; $ErrMsg = _('The supplier record selected') . ': ' . $_GET['SupplierID'] . ' ' ._('cannot be retrieved because'); $DbgMsg = _('The SQL used to retrieve the supplier details and failed was'); @@ -115,8 +113,8 @@ $_SESSION['SuppTrans']->SupplierID = $_GET['SupplierID']; $LocalTaxProvinceResult = DB_query("SELECT taxprovinceid - FROM locations - WHERE loccode = '" . $_SESSION['UserStockLocation'] . "'", $db); + FROM locations + WHERE loccode = '" . $_SESSION['UserStockLocation'] . "'", $db); if(DB_num_rows($LocalTaxProvinceResult)==0){ prnMsg(_('The tax province associated with your user account has not been set up in this database. Tax calculations are based on the tax group of the supplier and the tax province of the user entering the invoice. The system administrator should redefine your account with a valid default stocking location and this location should refer to a valid tax province'),'error'); @@ -139,10 +137,9 @@ } elseif (!isset($_SESSION['SuppTrans'])){ prnMsg(_('To enter a supplier credit note the supplier must first be selected from the supplier selection screen'),'warn'); - echo '<br><a href="' . $rootpath . '/SelectSupplier.php?' . SID .'">' . _('Select A Supplier to Enter an Credit Note For') . '</a>'; + echo '<br /><a href="' . $rootpath . '/SelectSupplier.php">' . _('Select A Supplier to Enter an Credit Note For') . '</a>'; include('includes/footer.inc'); exit; - /*It all stops here if there aint no supplier selected */ } @@ -215,9 +212,9 @@ echo '<meta http-equiv="Refresh" content="0; url=' . $rootpath . '/SuppCreditGRNs.php?' . SID . '">'; echo '<p>' . _('You should automatically be forwarded to the entry of credit notes against goods received page') . '. ' . - _('If this does not happen') . ' (' . _('if the browser does not support META Refresh') . ') ' . - '<a href="' . $rootpath . '/SuppCreditGRNs.php?' . SID . '">' . - _('click here') . '</a> ' . _('to continue') . '.<br>'; + _('If this does not happen') . ' (' . _('if the browser does not support META Refresh') . ') ' . + '<a href="' . $rootpath . '/SuppCreditGRNs.php">' . + _('click here') . '</a> ' . _('to continue') . '.<br />'; include('includes/footer.inc'); exit; } @@ -225,11 +222,11 @@ /*This ensures that any changes in the page are stored in the session before calling the shipments page */ - echo '<meta http-equiv="Refresh" content="0; url=' . $rootpath . '/SuppShiptChgs.php?' . SID . '">'; + echo '<meta http-equiv="Refresh" content="0; url=' . $rootpath . '/SuppShiptChgs.php">'; echo '<p>' . _('You should automatically be forwarded to the entry of credit notes against shipments page') . '. ' . - _('If this does not happen') . ' (' . _('if the browser does not support META Refresh') . ') ' . - '<a href="' . $rootpath . '/SuppShiptChgs.php?' . SID . '">' . - _('click here') . '</a> ' . _('to continue') . '.<br>'; + _('If this does not happen') . ' (' . _('if the browser does not support META Refresh') . ') ' . + '<a href="' . $rootpath . '/SuppShiptChgs.php">' . + _('click here') . '</a> ' . _('to continue') . '.<br />'; include('includes/footer.inc'); exit; } @@ -237,11 +234,11 @@ /*This ensures that any changes in the page are stored in the session before calling the shipments page */ - echo '<meta http-equiv="Refresh" content="0; url=' . $rootpath . '/SuppTransGLAnalysis.php?' . SID . '">'; + echo '<meta http-equiv="Refresh" content="0; url=' . $rootpath . '/SuppTransGLAnalysis.php">'; echo '<p>' . _('You should automatically be forwarded to the entry of credit notes against the general ledger page') . '. ' . - _('If this does not happen') . ' (' . _('if the browser does not support META Refresh') . ') ' . - '<a href="' . $rootpath . '/SuppTransGLAnalysis.php?' . SID . '">' . - _('click here') . '</a> ' . _('to continue') . '.<br>'; + _('If this does not happen') . ' (' . _('if the browser does not support META Refresh') . ') ' . + '<a href="' . $rootpath . '/SuppTransGLAnalysis.php">' . + _('click here') . '</a> ' . _('to continue') . '.<br />'; include('includes/footer.inc'); exit; } @@ -250,7 +247,7 @@ echo '<meta http-equiv="refresh" content="0; url=' . $rootpath . '/SuppContractChgs.php?' . SID . '">'; echo '<DIV class="centre">' . _('You should automatically be forwarded to the entry of supplier credit notes against contracts page') . '. ' . _('If this does not happen') . ' (' . _('if the browser does not support META Refresh'). ') ' . - '<a href="' . $rootpath . '/SuppContractChgs.php?' . SID . '">' . _('click here') . '</a> ' . _('to continue') . '.</DIV><br>'; + '<a href="' . $rootpath . '/SuppContractChgs.php">' . _('click here') . '</a> ' . _('to continue') . '.</DIV><br />'; exit; } if (isset($_POST['FixedAssets']) and $_POST['FixedAssets'] == _('Fixed Assets')){ @@ -258,16 +255,18 @@ echo '<meta http-equiv="refresh" content="0; url=' . $rootpath . '/SuppFixedAssetChgs.php?' . SID . '">'; echo '<DIV class="centre">' . _('You should automatically be forwarded to the entry of invoices against fixed assets page') . '. ' . _('If this does not happen') . ' (' . _('if the browser does not support META Refresh'). ') ' . - '<a href="' . $rootpath . '/SuppFixedAssetChgs.php?' . SID . '">' . _('click here') . '</a> ' . _('to continue') . '.</DIV><br>'; + '<a href="' . $rootpath . '/SuppFixedAssetChgs.php">' . _('click here') . '</a> ' . _('to continue') . '.</DIV><br />'; exit; } /* everything below here only do if a Supplier is selected fisrt add a header to show who we are making an credit note for */ -echo "<table class=selection colspan=4><tr><th>" . _('Supplier') . "</th> - <th>" . _('Currency') . "</th> - <th>" . _('Terms') . "</th> - <th>" . _('Tax Group') . '</th></tr>'; +echo '<table class="selection" colspan="4"> + <tr><th>' . _('Supplier') . '</th> + <th>' . _('Currency') . '</th> + <th>' . _('Terms') . '</th> + <th>' . _('Tax Group') . '</th> + </tr>'; echo '<tr><td><font color=blue><b>' . $_SESSION['SuppTrans']->SupplierID . ' - ' . $_SESSION['SuppTrans']->SupplierName . '</b></font></td> @@ -277,29 +276,29 @@ </tr> </table>'; -echo "<form action='" . $_SERVER['PHP_SELF'] . "?" . SID . "' method=post name=form1>"; +echo '<form action="' . $_SERVER['PHP_SELF'] . '" method="post" name="form1">'; echo '<input type="hidden" name="FormID" value="' . $_SESSION['FormID'] . '" />'; echo '<br /><table class=selection>'; echo '<tr><td><font color=red>' . _('Supplier Credit Note Reference') . ":</font></td> - <td><font size=2><input type=TEXT size=20 maxlength=20 name=SuppReference VALUE='" . $_SESSION['SuppTrans']->SuppReference . "'></td>"; + <td><font size=2><input type=TEXT size=20 maxlength=20 name=SuppReference value='" . $_SESSION['SuppTrans']->SuppReference . "'></td>"; if (!isset($_SESSION['SuppTrans']->TranDate)){ $_SESSION['SuppTrans']->TranDate= Date($_SESSION['DefaultDateFormat'], Mktime(0,0,0,Date('m'),Date('d')-1,Date('y'))); } echo '<td><font color=red>' . _('Credit Note Date') . ' (' . _('in format') . ' ' . $_SESSION['DefaultDateFormat'] . ") :</font></td> - <td><input type=TEXT class='date' alt='".$_SESSION['DefaultDateFormat']. "' size=11 maxlength=10 name='TranDate' VALUE=" . $_SESSION['SuppTrans']->TranDate . '></td>'; + <td><input type=TEXT class='date' alt='".$_SESSION['DefaultDateFormat']. "' size=11 maxlength=10 name='TranDate' value=" . $_SESSION['SuppTrans']->TranDate . '></td>'; echo '<td><font color=red>' . _('Exchange Rate') . ":</font></td> - <td><input type=TEXT class='number' size=11 maxlength=10 name='ExRate' VALUE=" . $_SESSION['SuppTrans']->ExRate . '></td></tr>'; + <td><input type=TEXT class='number' size=11 maxlength=10 name='ExRate' value=" . $_SESSION['SuppTrans']->ExRate . '></td></tr>'; echo '</table>'; -echo '<br><div class="centre"><input type="submit" name="GRNS" VALUE="' . _('Purchase Orders') . '"> '; +echo '<br /><div class="centre"><input type="submit" name="GRNS" value="' . _('Purchase Orders') . '"> '; echo '<input type="submit" name="Shipts" value="' . _('Shipments') . '"> '; -echo '<input type="submit" name="Contracts" VALUE="' . _('Contracts') . '"> '; +echo '<input type="submit" name="Contracts" value="' . _('Contracts') . '"> '; if ( $_SESSION['SuppTrans']->GLLink_Creditors ==1){ echo '<input type="submit" name="GL" value="' . _('General Ledger') . '"> '; } -echo '<input type="submit" name="FixedAssets" VALUE="' . _('Fixed Assets') . '"></div>'; +echo '<input type="submit" name="FixedAssets" value="' . _('Fixed Assets') . '"></div>'; echo '<br />'; if (count($_SESSION['SuppTrans']->GRNs)>0){ /*if there are some GRNs selected for crediting then */ @@ -309,14 +308,15 @@ echo '<table cellpadding=2 class=selection> <tr><th colspan="6">' . _('Purchase Order Credits') . '</th></tr>'; - $TableHeader = "<tr><th>" . _('GRN') . "</th> - <th>" . _('Item Code') . "</th> - <th>" . _('Description') . "</th> - <th>" . _('Quantity') . '<br>' . _('Credited') . "</th> - <th>" . _('Price Credited') . '<br>' . _('in') . ' ' . $_SESSION['SuppTrans']->CurrCode . "</th> - <th>" . _('Line Total') . '<br>' . _('in') . ' ' . $_SESSION['SuppTrans']->CurrCode . '</th></tr>'; + $TableHeader = '<tr><th>' . _('GRN') . '</th> + <th>' . _('Item Code') . '</th> + <th>' . _('Description') . '</th> + <th>' . _('Quantity') . '<br />' . _('Credited') . '</th> + <th>' . _('Price Credited') . '<br />' . _('in') . ' ' . $_SESSION['SuppTrans']->CurrCode . '</th> + <th>' . _('Line Total') . '<br />' . _('in') . ' ' . $_SESSION['SuppTrans']->CurrCode . '</th> + </tr>'; echo $TableHeader; - $TotalGRNValue=0; + $TotalGRNvalue=0; foreach ($_SESSION['SuppTrans']->GRNs as $EnteredGRN){ @@ -341,27 +341,29 @@ echo '<table cellpadding=2 class=selection> <tr><th colspan="2">' . _('Shipment Credits') . '</th></tr>'; - $TableHeader = "<tr><th>" . _('Shipment') . "</th> - <th>" . _('Amount') . '</th></tr>'; + $TableHeader = '<tr><th>' . _('Shipment') . '</th> + <th>' . _('Amount') . '</th></tr>'; echo $TableHeader; - $TotalShiptValue=0; + $TotalShiptvalue=0; $i=0; foreach ($_SESSION['SuppTrans']->Shipts as $EnteredShiptRef){ echo '<tr> - <td>' . $EnteredShiptRef->ShiptRef . '</td> - <td class=number>' . number_format($EnteredShiptRef->Amount,2) . '</td> - </tr>'; + <td>' . $EnteredShiptRef->ShiptRef . '</td> + <td class=number>' . number_format($EnteredShiptRef->Amount,2) . '</td> + </tr>'; $TotalShiptValue += $EnteredShiptRef->Amount; } echo '<tr><td class=number><font color=red>' . _('Total Credited Against Shipments') . ':</font></td> - <td class=number><fontcolor=red><U>' . number_format($TotalShiptValue,2) . '</U></font></td></tr></table><br />'; + <td class=number><fontcolor=red><U>' . number_format($TotalShiptValue,2) . '</U></font></td> + </tr> + </table><br />'; } if (count( $_SESSION['SuppTrans']->Assets) > 0){ /*if there are any fixed assets on the invoice*/ @@ -369,8 +371,8 @@ echo '<br /><table cellpadding=2 class=selection> <tr><th colspan=3>' . _('Fixed Asset Credits') . '</th></tr>'; $TableHeader = '<tr><th>' . _('Asset ID') . '</th> - <th>' . _('Description') . '</th> - <th>' . _('Amount') . ' ' . $_SESSION['SuppTrans']->CurrCode . '</th></tr>'; + <th>' . _('Description') . '</th> + <th>' . _('Amount') . ' ' . $_SESSION['SuppTrans']->CurrCode . '</th></tr>'; echo $TableHeader; $TotalAssetValue = 0; @@ -378,8 +380,8 @@ foreach ($_SESSION['SuppTrans']->Assets as $EnteredAsset){ echo '<tr><td>' . $EnteredAsset->AssetID . '</td> - <td>' . $EnteredAsset->Description . '</td> - <td class=number>' . number_format($EnteredAsset->Amount,2) . '</td></tr>'; + <td>' . $EnteredAsset->Description . '</td> + <td class=number>' . number_format($EnteredAsset->Amount,2) . '</td></tr>'; $TotalAssetValue += $EnteredAsset->Amount; @@ -391,7 +393,9 @@ } echo '<tr><td colspan=2 class=number><font size=4 color=blue>' . _('Total') . ':</font></td> - <td class=number><font size=4 color=BLUE><U>' . number_format($TotalAssetValue,2) . '</U></font></td></tr></table>'; + <td class=number><font size=4 color=BLUE><U>' . number_format($TotalAssetValue,2) . '</U></font></td> + </tr> + </table>'; } //end loop around fixed assets @@ -400,8 +404,9 @@ echo '<table cellpadding="2" class=selection> <tr><th colspan="3">' . _('Contract Charges') . '</th></tr>'; $TableHeader = '<tr><th>' . _('Contract') . '</th> - <th>' . _('Amount') . '</th> - <th>' . _('Narrative') . '</th></tr>'; + <th>' . _('Amount') . '</th> + <th>' . _('Narrative') . '</th> + </tr>'; echo $TableHeader; $TotalContractsValue = 0; @@ -409,9 +414,9 @@ foreach ($_SESSION['SuppTrans']->Contracts as $Contract){ echo '<tr><td>' . $Contract->ContractRef . '</td> - <td class=number>' . number_format($Contract->Amount,2) . '</td> - <td>' . $Contract->Narrative . '</td> - </tr>'; + <td class=number>' . number_format($Contract->Amount,2) . '</td> + <td>' . $Contract->Narrative . '</td> + </tr>'; $TotalContractsValue += $Contract->Amount; @@ -434,12 +439,12 @@ echo '<table cellpadding=2 class=selection> <tr><th colspan="3">' . _('General Ledger Analysis') . '</th></tr>'; $TableHeader = '<tr><th>' . _('Account') . '</th> - <th>' . _('Name') . '</th> - <th>' . _('Amount') . '<br>' . _('in') . ' ' . $_SESSION['SuppTrans']->CurrCode . '</th> - <th>' . _('Narrative') . '</th></tr>'; + <th>' . _('Name') . '</th> + <th>' . _('Amount') . '<br />' . _('in') . ' ' . $_SESSION['SuppTrans']->CurrCode . '</th> + <th>' . _('Narrative') . '</th></tr>'; echo $TableHeader; - $TotalGLValue=0; + $TotalGLvalue=0; foreach ($_SESSION['SuppTrans']->GLCodes as $EnteredGLCode){ @@ -463,13 +468,13 @@ } if (!isset($TotalGRNValue)) { - $TotalGRNValue=0; + $TotalGRNvalue=0; } if (!isset($TotalGLValue)) { - $TotalGLValue=0; + $TotalGLvalue=0; } if (!isset($TotalShiptValue)) { - $TotalShiptValue=0; + $TotalShiptvalue=0; } if (!isset($TotalContractsValue)){ $TotalContractsValue = 0; @@ -484,16 +489,16 @@ } else { echo '<table class=selection><tr><td><font color=red>' . _('Credit Amount in Supplier Currency') . ':</font></td> - <td colspan=2 class=number><input type=TEXT size="12" maxlength="10" name="OvAmount" VALUE=' . number_format($_SESSION['SuppTrans']->OvAmount,2) . '></td></tr>'; + <td colspan=2 class=number><input type=TEXT size="12" maxlength="10" name="OvAmount" value=' . number_format($_SESSION['SuppTrans']->OvAmount,2) . '></td></tr>'; } -echo "<tr><td colspan=2><input type=Submit name='ToggleTaxMethod'VALUE='" . _('Change Tax Calculation Method') . +echo "<tr><td colspan=2><input type=Submit name='ToggleTaxMethod'value='" . _('Change Tax Calculation Method') . "'></td><td><select name='OverRideTax' onChange='ReloadForm(form1.ToggleTaxMethod)'>"; if ($_POST['OverRideTax']=='Man'){ - echo "<option VALUE='Auto'>" . _('Automatic') . "<option selected VALUE='Man'>" . _('Manual Entry'); + echo "<option value='Auto'>" . _('Automatic') . "<option selected value='Man'>" . _('Manual Entry'); } else { - echo "<option selected VALUE='Auto'>" . _('Automatic') . "<option VALUE='Man'>" . _('Manual Entry'); + echo "<option selected value='Auto'>" . _('Automatic') . "<option value='Man'>" . _('Manual Entry'); } echo '</select></td></tr>'; @@ -512,7 +517,7 @@ if (!isset($_POST['OverRideTax']) or $_POST['OverRideTax']=='Auto'){ - echo ' <input type=TEXT class="number" name=TaxRate' . $Tax->TaxCalculationOrder . ' maxlength=4 size=4 VALUE=' . $_SESSION['SuppTrans']->Taxes[$Tax->TaxCalculationOrder]->TaxRate * 100 . '>%'; + echo ' <input type=TEXT class="number" name=TaxRate' . $Tax->TaxCalculationOrder . ' maxlength=4 size=4 value=' . $_SESSION['SuppTrans']->Taxes[$Tax->TaxCalculationOrder]->TaxRate * 100 . ' />%'; /*Now recaluclate the tax depending on the method */ if ($Tax->TaxOnTax ==1){ @@ -526,17 +531,17 @@ } - echo '<input type=hidden name="TaxAmount' . $Tax->TaxCalculationOrder . '" VALUE=' . round($_SESSION['SuppTrans']->Taxes[$Tax->TaxCalculationOrder]->TaxOvAmount,2) . '>'; + echo '<input type=hidden name="TaxAmount' . $Tax->TaxCalculationOrder . '" value=' . round($_SESSION['SuppTrans']->Taxes[$Tax->TaxCalculationOrder]->TaxOvAmount,2) . ' />'; echo '</td><td class=number>' . number_format($_SESSION['SuppTrans']->Taxes[$Tax->TaxCalculationOrder]->TaxOvAmount,2); } else { /*Tax being entered manually accept the taxamount entered as is*/ $_SESSION['SuppTrans']->Taxes[$Tax->TaxCalculationOrder]->TaxOvAmount = $_POST['TaxAmount' . $Tax->TaxCalculationOrder]; - echo ' <input type=hidden name=TaxRate' . $Tax->TaxCalculationOrder . ' VALUE=' . $_SESSION['SuppTrans']->Taxes[$Tax->TaxCalculationOrder]->TaxRate * 100 . '>'; + echo ' <input type=hidden name=TaxRate' . $Tax->TaxCalculationOrder . ' value=' . $_SESSION['SuppTrans']->Taxes[$Tax->TaxCalculationOrder]->TaxRate * 100 . ' />'; - echo '</td><td><input type=TEXT class="number" size=12 maxlength=12 name="TaxAmount' . $Tax->TaxCalculationOrder . '" VALUE=' . round($_SESSION['SuppTrans']->Taxes[$Tax->TaxCalculationOrder]->TaxOvAmount,2) . '>'; + echo '</td><td><input type=TEXT class="number" size=12 maxlength=12 name="TaxAmount' . $Tax->TaxCalculationOrder . '" value=' . round($_SESSION['SuppTrans']->Taxes[$Tax->TaxCalculationOrder]->TaxOvAmount,2) . '>'; } @@ -554,7 +559,7 @@ echo '<table class=selection><tr><td><font color=red>' . _('Comments') . '</font></td><td><textarea name=Comments cols=40 rows=2>' . $_SESSION['SuppTrans']->Comments . '</textarea></td></tr></table>'; -echo "<p><div class='centre'><input type=submit name='PostCreditNote' VALUE='" . _('Enter Credit Note') . "'></div>"; +echo "<p><div class='centre'><input type=submit name='PostCreditNote' value='" . _('Enter Credit Note') . "'></div>"; if (isset($_POST['PostCreditNote'])){ @@ -665,21 +670,21 @@ the debit is to creditors control act done later for the total credit note value + tax*/ $SQL = "INSERT INTO gltrans (type, - typeno, - trandate, - periodno, - account, - narrative, - amount, - jobref) + typeno, + trandate, + periodno, + account, + narrative, + amount, + jobref) VALUES (21, - '" . $CreditNoteNo . "', - '" . $SQLCreditNoteDate . "', - '" . $PeriodNo . "', - '" . $EnteredGLCode->GLCode . "', - '" . $_SESSION['SuppTrans']->SupplierID . " " . $EnteredGLCode->Narrative . "', - '" . round(-$EnteredGLCode->Amount/$_SESSION['SuppTrans']->ExRate,2) ."', - '' )"; + '" . $CreditNoteNo . "', + '" . $SQLCreditNoteDate . "', + '" . $PeriodNo . "', + '" . $EnteredGLCode->GLCode . "', + '" . $_SESSION['SuppTrans']->SupplierID . " " . $EnteredGLCode->Narrative . "', + '" . round(-$EnteredGLCode->Amount/$_SESSION['SuppTrans']->ExRate,2) ."', + '' )"; $ErrMsg = _('CRITICAL ERROR') . '! ' . _('NOTE DOWN THIS ERROR AND SEEK ASSISTANCE') . ': ' . _('The general ledger transaction could not be added because'); @@ -697,19 +702,19 @@ these entries are reversed from the GRN suspense when the shipment is closed - entries only to open shipts*/ $SQL = "INSERT INTO gltrans (type, - typeno, - trandate, - periodno, - account, - narrative, - amount) + typeno, + trandate, + periodno, + account, + narrative, + amount) VALUES (21, - '" . $CreditNoteNo . "', - '" . $SQLCreditNoteDate . "', - '" . $PeriodNo . "', - '" . $_SESSION['SuppTrans']->GRNAct . "', - '" . $_SESSION['SuppTrans']->SupplierID . ' ' . _('Shipment credit against') . ' ' . $ShiptChg->ShiptRef . "', - '" . round(-$ShiptChg->Amount/$_SESSION['SuppTrans']->ExRate,2) . "')"; + '" . $CreditNoteNo . "', + '" . $SQLCreditNoteDate . "', + '" . $PeriodNo . "', + '" . $_SESSION['SuppTrans']->GRNAct . "', + '" . $_SESSION['SuppTrans']->SupplierID . ' ' . _('Shipment credit against') . ' ' . $ShiptChg->ShiptRef . "', + '" . round(-$ShiptChg->Amount/$_SESSION['SuppTrans']->ExRate,2) . "')"; $ErrMsg = _('CRITICAL ERROR') . '! ' . _('NOTE DOWN THIS ERROR AND SEEK ASSISTANCE') . ': ' . _('The general ledger transaction for the shipment') . ' ' . $ShiptChg->ShiptRef . ' ' . _('could not be added because'); $DbgMsg = _('The following SQL to insert the GL transaction was used'); @@ -722,20 +727,20 @@ foreach ($_SESSION['SuppTrans']->Assets as $AssetAddition){ /* only the GL entries if the creditors->GL integration is enabled */ - $SQL = 'INSERT INTO gltrans (type, - typeno, - trandate, - periodno, - account, - narrative, - amount) - VALUES (21, ' . - $CreditNoteNo . ", - '" . $SQLCreditNoteDate . "', - '" . $PeriodNo . "', - '". $AssetAddition->CostAct . "', - '" . $_SESSION['SuppTrans']->SupplierID . ' ' . _('Asset Credit') . ' ' . $AssetAddition->AssetID . ': ' . $AssetAddition->Description . "', - '" . (-$AssetAddition->Amount/ $_SESSION['SuppTrans']->ExRate) . "')"; + $SQL = "INSERT INTO gltrans (type, + typeno, + trandate, + periodno, + account, + narrative, + amount) + VALUES ('21', + '" . $CreditNoteNo . "', + '" . $SQLCreditNoteDate . "', + '" . $PeriodNo . "', + '". $AssetAddition->CostAct . "', + '" . $_SESSION['SuppTrans']->SupplierID . ' ' . _('Asset Credit') . ' ' . $AssetAddition->AssetID . ': ' . $AssetAddition->Description . "', + '" . (-$AssetAddition->Amount/ $_SESSION['SuppTrans']->ExRate) . "')"; $ErrMsg = _('CRITICAL ERROR') . '! ' . _('NOTE DOWN THIS ERROR AND SEEK ASSISTANCE') . ': ' . _('The general ledger transaction for the asset addition could not be added because'); $DbgMsg = _('The following SQL to insert the GL transaction was used'); $Result = DB_query($SQL, $db, $ErrMsg, $DbgMsg, True); @@ -749,9 +754,9 @@ * debit postings to this WIP account * the WIP account is tidied up when the contract is closed*/ $result = DB_query("SELECT wipact FROM stockcategory - INNER JOIN stockmaster ON - stockcategory.categoryid=stockmaster.categoryid - WHERE stockmaster.stockid='" . $Contract->ContractRef . "'",$db); + INNER JOIN stockmaster ON + stockcategory.categoryid=stockmaster.categoryid + WHERE stockmaster.stockid='" . $Contract->ContractRef . "'",$db); $WIPRow = DB_fetch_row($result); $WIPAccount = $WIPRow[0]; @@ -794,7 +799,7 @@ account, narrative, amount) - VALUES (21, + VALUES ('21', '" . $CreditNoteNo . "', '" . $SQLCreditNoteDate . "', '" . $PeriodNo . "', @@ -858,22 +863,22 @@ * (($EnteredGRN->ChgPrice / $_SESSION['SuppTrans']->ExRate) - $EnteredGRN->StdCostUnit); $SQL = "INSERT INTO gltrans (type, - typeno, - trandate, - periodno, - account, - narrative, - amount) - VALUES (21, - '" . $CreditNoteNo . "', - '" . $SQLCreditNoteDate . "', - '" . $PeriodNo . "', - '" . $StockGLCode['purchpricevaract'] . "', - '" . $_SESSION['SuppTrans']->SupplierID . ' - ' . _('GRN Credit Note') . ' ' . $EnteredGRN->GRNNo . - ' - ' . $EnteredGRN->ItemCode . ' x ' . ($EnteredGRN->This_QuantityInv-$TotalQuantityOnHand) . ' x ' . _('price var of') . ' ' . - number_format(($EnteredGRN->ChgPrice / $_SESSION['SuppTrans']->ExRate) - $EnteredGRN->StdCostUnit,2) . - "', '" . (-$WriteOffToVariances) . "')"; - + typeno, + trandate, + periodno, + account, + narrative, + amount) + VALUES (21, + '" . $CreditNoteNo . "', + '" . $SQLCreditNoteDate . "', + '" . $PeriodNo . "', + '" . $StockGLCode['purchpricevaract'] . "', + '" . $_SESSION['SuppTrans']->SupplierID . ' - ' . _('GRN Credit Note') . ' ' . $EnteredGRN->GRNNo . + ' - ' . $EnteredGRN->ItemCode . ' x ' . ($EnteredGRN->This_QuantityInv-$TotalQuantityOnHand) . ' x ' . _('price var of') . ' ' . + number_format(($EnteredGRN->ChgPrice / $_SESSION['SuppTrans']->ExRate) - $EnteredGRN->StdCostUnit,2) . + "', '" . (-$WriteOffToVariances) . "')"; + $ErrMsg = _('CRITICAL ERROR') . '! ' . _('NOTE DOWN THIS ERROR AND SEEK ASSISTANCE') . ': ' . _('The general ledger transaction could not be added for the price variance of the stock item because'); $DbgMsg = _('The following SQL to insert the GL transaction was used'); @@ -883,22 +888,22 @@ /*Now post any remaining price variance to stock rather than price variances */ $SQL = "INSERT INTO gltrans (type, - typeno, - trandate, - periodno, - account, - narrative, - amount) - VALUES (21, - '" . $CreditNoteNo . "', - '" . $SQLCreditNoteDate . "', - '" . $PeriodNo . "', - '" . $StockGLCode['stockact'] . "', - '" . $_SESSION['SuppTrans']->SupplierID . ' - ' . _('Average Cost Adj') . - ' - ' . $EnteredGRN->ItemCode . ' x ' . $TotalQuantityOnHand . ' x ' . - number_format(($EnteredGRN->ChgPrice / $_SESSION['SuppTrans']->ExRate) - $EnteredGRN->StdCostUnit,2) . "', - '" . (-($PurchPriceVar - $WriteOffToVariances)) . "')"; - + typeno, + trandate, + periodno, + account, + narrative, + amount) + VALUES (21, + '" . $CreditNoteNo . "', + '" . $SQLCreditNoteDate . "', + '" . $PeriodNo . "', + '" . $StockGLCode['stockact'] . "', + '" . $_SESSION['SuppTrans']->SupplierID . ' - ' . _('Average Cost Adj') . + ' - ' . $EnteredGRN->ItemCode . ' x ' . $TotalQuantityOnHand . ' x ' . + number_format(($EnteredGRN->ChgPrice / $_SESSION['SuppTrans']->ExRate) - $EnteredGRN->StdCostUnit,2) . "', + '" . (-($PurchPriceVar - $WriteOffToVariances)) . "')"; + $ErrMsg = _('CRITICAL ERROR') . '! ' . _('NOTE DOWN THIS ERROR AND SEEK ASSISTANCE') . ': ' . _('The general ledger transaction could not be added for the price variance of the stock item because'); $DbgMsg = _('The following SQL to insert the GL transaction was used'); @@ -916,11 +921,12 @@ if ($TotalQuantityOnHand>0) { - $CostIncrement = ($PurchPriceVar - $WriteOffToVariances) / $TotalQuantityOnHand; $sql = "UPDATE stockmaster SET lastcost=materialcost+overheadcost+labourcost, - materialcost=materialcost+" . $CostIncrement . " WHERE stockid='" . $EnteredGRN->ItemCode . "'"; + materialcost=materialcost+" . $CostIncrement . " + WHERE stockid='" . $EnteredGRN->ItemCode . "'"; + $Result = DB_query($sql, $db, $ErrMsg, $DbgMsg, True); } else { $sql = "UPDATE stockmaster SET lastcost=materialcost+overheadcost+labourcost, @@ -932,22 +938,22 @@ } else { //It must be Standard Costing $SQL = "INSERT INTO gltrans (type, - typeno, - trandate, - periodno, - account, - narrative, - amount) - VALUES (21, - '" . $CreditNoteNo . "', - '" . $SQLCreditNoteDate . "', - '" . $PeriodNo . "', - '" . $StockGLCode['purchpricevaract'] . "', - '" . $_SESSION['SuppTrans']->SupplierID . ' - ' . _('GRN') . ' ' . $EnteredGRN->GRNNo . - ' - ' . $EnteredGRN->ItemCode . ' x ' . $EnteredGRN->This_QuantityInv . ' x ' . _('price var of') . ' ' . - number_format(($EnteredGRN->ChgPrice / $_SESSION['SuppTrans']->ExRate) - $EnteredGRN->StdCostUnit,2) . "', - '" . (-$PurchPriceVar) . "')"; - + typeno, + trandate, + periodno, + account, + narrative, + amount) + VALUES (21, + '" . $CreditNoteNo . "', + '" . $SQLCreditNoteDate . "', + '" . $PeriodNo . "', + '" . $StockGLCode['purchpricevaract'] . "', + '" . $_SESSION['SuppTrans']->SupplierID . ' - ' . _('GRN') . ' ' . $EnteredGRN->GRNNo . + ' - ' . $EnteredGRN->ItemCode . ' x ' . $EnteredGRN->This_QuantityInv . ' x ' . _('price var of') . ' ' . + number_format(($EnteredGRN->ChgPrice / $_SESSION['SuppTrans']->ExRate) - $EnteredGRN->StdCostUnit,2) . "', + '" . (-$PurchPriceVar) . "')"; + $ErrMsg = _('CRITICAL ERROR') . '! ' . _('NOTE DOWN THIS ERROR AND SEEK ASSISTANCE') . ': ' . _('The general ledger transaction could not be added for the price variance of the stock item because'); $DbgMsg = _('The following SQL to insert the GL transaction was used'); @@ -964,22 +970,22 @@ if ($EnteredGRN->AssetID!=0) { //then it is an asset /*Need to get the asset details for posting */ - $result = DB_query('SELECT costact - FROM fixedassets INNER JOIN fixedassetcategories - ON fixedassets.assetcategoryid= fixedassetcategories.categoryid - WHERE assetid="' . $EnteredGRN->AssetID . '"',$db); + $result = DB_query("SELECT costact + FROM fixedassets INNER JOIN fixedassetcategories + ON fixedassets.assetcategoryid= fixedassetcategories.categoryid + WHERE assetid='" . $EnteredGRN->AssetID . "'",$db); $AssetRow = DB_fetch_array($result); $GLCode = $AssetRow['costact']; } //the item was an asset $SQL = "INSERT INTO gltrans (type, - typeno, - trandate, - periodno, - account, - narrative, - amount) - VALUES (21, + typeno, + trandate, + periodno, + account, + narrative, + amount) + VALUES (21, '" . $CreditNoteNo . "', '" . $SQLCreditNoteDate . "', '" . $PeriodNo . "', @@ -1115,13 +1121,12 @@ foreach ($_SESSION['SuppTrans']->Taxes AS $TaxTotals) { $SQL = "INSERT INTO supptranstaxes (supptransid, - taxauthid, - taxamount) - VALUES ( - '" . $SuppTransID . "', - '" . $TaxTotals->TaxAuthID . "', - '" . -$TaxTotals->TaxOvAmount . "')"; - + taxauthid, + taxamount) + VALUES ('" . $SuppTransID . "', + '" . $TaxTotals->TaxAuthID . "', + '" . -$TaxTotals->TaxOvAmount . "')"; + $ErrMsg =_('CRITICAL ERROR') . '! ' . _('NOTE DOWN THIS ERROR AND SEEK ASSISTANCE') . ': ' . _('The supplier transaction taxes records could not be inserted because'); $DbgMsg = _('The following SQL to insert the supplier transaction taxes record was used:'); $Result = DB_query($SQL,$db,$ErrMsg,$DbgMsg,true); @@ -1132,8 +1137,8 @@ foreach ($_SESSION['SuppTrans']->GRNs as $EnteredGRN){ - $SQL = "UPDATE purchorderdetails SET qtyinvoiced = qtyinvoiced - " . - $EnteredGRN->This_QuantityInv . " WHERE podetailitem = '" . $EnteredGRN->PODetailItem ."'"; + $SQL = "UPDATE purchorderdetails SET qtyinvoiced = qtyinvoiced - " .$EnteredGRN->This_QuantityInv . " + WHERE podetailitem = '" . $EnteredGRN->PODetailItem ."'"; $ErrMsg = _('CRITICAL ERROR') . '! ' . _('NOTE DOWN THIS ERROR AND SEEK ASSISTANCE') . ': ' . _('The quantity credited of the purchase order line could not be updated because'); $DbgMsg = _('The following SQL to update the purchase order details was used'); @@ -1154,18 +1159,17 @@ /* and insert the shipment charge records */ $SQL = "INSERT INTO shipmentcharges (shiptref, - transtype, - transno, - stockid, - value) - VALUES ( - '" . $EnteredGRN->ShiptRef . "', - 21, - '" . $CreditNoteNo . "', - '" . $EnteredGRN->ItemCode . "', - '" . round(-$EnteredGRN->This_QuantityInv * $EnteredGRN->ChgPrice / $_SESSION['SuppTrans']->ExRate,2) . "' - )"; - + transtype, + transno, + stockid, + value) + VALUES ('" . $EnteredGRN->ShiptRef . "', + 21, + '" . $CreditNoteNo . "', + '" . $EnteredGRN->ItemCode . "', + '" . round(-$EnteredGRN->This_QuantityInv * $EnteredGRN->ChgPrice / $_SESSION['SuppTrans']->ExRate,2) . "' + )"; + $ErrMsg = _('CRITICAL ERROR') . '! ' . _('NOTE DOWN THIS ERROR AND SEEK ASSISTANCE') . ': ' . _('The shipment charge record for the shipment') . ' ' . $EnteredGRN->ShiptRef . ' ' . _('could not be added because'); $DbgMsg = _('The following SQL to insert the Shipment charge record was used'); @@ -1176,21 +1180,21 @@ if ($PurchPriceVar !=0){ /*Add the fixed asset trans for the difference in the cost */ $SQL = "INSERT INTO fixedassettrans (assetid, - transtype, - transno, - transdate, - periodno, - inputdate, - fixedassettranstype, - amount) - VALUES ('" . $EnteredGRN->AssetID . "', - 21, - '" . $CreditNoteNo . "', - '" . $SQLCreditNoteDate . "', - '" . $PeriodNo . "', - '" . Date('Y-m-d') . "', - 'cost', - '" . -($PurchPriceVar) . "')"; + transtype, + transno, + transdate, + periodno, + inputdate, + fixedassettranstype, + amount) + VALUES ('" . $EnteredGRN->AssetID . "', + 21, + '" . $CreditNoteNo . "', + '" . $SQLCreditNoteDate . "', + '" . $PeriodNo . "', + '" . Date('Y-m-d') . "', + 'cost', + '" . -($PurchPriceVar) . "')"; $ErrMsg = _('CRITICAL ERROR! NOTE DOWN THIS ERROR AND SEEK ASSISTANCE The fixed asset transaction could not be inserted because'); $DbgMsg = _('The following SQL to insert the fixed asset transaction record was used'); $Result = DB_query($SQL,$db,$ErrMsg, $DbgMsg, true); @@ -1235,18 +1239,18 @@ $Anticipated =0; } $SQL = "INSERT INTO contractcharges (contractref, - transtype, - transno, - amount, - narrative, - anticipated) - VALUES ( - '" . $Contract->ContractRef . "', - '21', - '" . $CreditNoteNo . "', - '" . -$Contract->Amount/ $_SESSION['SuppTrans']->ExRate . "', - '" . $Contract->Narrative . "', - '" . $Anticipated . "')"; + transtype, + transno, + amount, + narrative, + anticipated) + VALUES ( + '" . $Contract->ContractRef . "', + '21', + '" . $CreditNoteNo . "', + '" . -$Contract->Amount/ $_SESSION['SuppTrans']->ExRate . "', + '" . $Contract->Narrative . "', + '" . $Anticipated . "')"; $ErrMsg = _('CRITICAL ERROR') . '! ' . _('NOTE DOWN THIS ERROR AND SEEK ASSISTANCE') . ': ' . _('The contract charge record for contract') . ' ' . $Contract->ContractRef . ' ' . _('could not be added because'); $DbgMsg = _('The following SQL to insert the contract charge record was used'); @@ -1264,29 +1268,28 @@ /* First the fixed asset transaction */ $SQL = "INSERT INTO fixedassettrans (assetid, - transtype, - transno, - transdate, - periodno, - inputdate, - fixedassettranstype, - amount) - VALUES ('" . $AssetAddition->AssetID . "', - 21, - '" . $CreditNoteNo . "', - '" . $SQLCreditNoteDate . "', - '" . $PeriodNo . "', - '" . Date('Y-m-d') . "', - 'cost', - '" . (-$AssetAddition->Amount / $_SESSION['SuppTrans']->ExRate) . "')"; + transtype, + transno, + transdate, + periodno, + inputdate, + fixedassettranstype, + amount) + VALUES ('" . $AssetAddition->AssetID . "', + 21, + '" . $CreditNoteNo . "', + '" . $SQLCreditNoteDate . "', + '" . $PeriodNo . "', + '" . Date('Y-m-d') . "', + 'cost', + '" . (-$AssetAddition->Amount / $_SESSION['SuppTrans']->ExRate) . "')"; $ErrMsg = _('CRITICAL ERROR! NOTE DOWN THIS ERROR AND SEEK ASSISTANCE The fixed asset transaction could not be inserted because'); $DbgMsg = _('The following SQL to insert the fixed asset transaction record was used'); $Result = DB_query($SQL,$db,$ErrMsg, $DbgMsg, true); /*Now update the asset cost in fixedassets table */ - $SQL = "UPDATE fixedassets - SET cost = cost - " . ($AssetAddition->Amount / $_SESSION['SuppTrans']->ExRate) . " - WHERE assetid = '" . $AssetAddition->AssetID . "'"; + $SQL = "UPDATE fixedassets SET cost = cost - " . ($AssetAddition->Amount / $_SESSION['SuppTrans']->ExRate) . " + WHERE assetid = '" . $AssetAddition->AssetID . "'"; $ErrMsg = _('CRITICAL ERROR! NOTE DOWN THIS ERROR AND SEEK ASSISTANCE. The fixed asset cost was not able to be updated because:'); $DbgMsg = _('The following SQL was used to attempt the update of the asset cost:'); $Result = DB_query($SQL,$db,$ErrMsg, $DbgMsg, true); @@ -1295,7 +1298,7 @@ DB_Txn_Commit($db); prnMsg(_('Supplier credit note number') . ' ' . $CreditNoteNo . ' ' . _('has been processed'),'success'); - echo '<br><div class="centre"><a href="' . $rootpath . '/SupplierCredit.php?&SupplierID=' .$_SESSION['SuppTrans']->SupplierID . '">' . _('Enter another Credit Note for this Supplier') . '</a></div>'; + echo '<br /><div class="centre"><a href="' . $rootpath . '/SupplierCredit.php?&SupplierID=' .$_SESSION['SuppTrans']->SupplierID . '">' . _('Enter another Credit Note for this Supplier') . '</a></div>'; unset($_SESSION['SuppTrans']->GRNs); unset($_SESSION['SuppTrans']->Shipts); unset($_SESSION['SuppTrans']->GLCodes); Modified: trunk/SupplierInquiry.php =================================================================== --- trunk/SupplierInquiry.php 2011-04-03 03:24:25 UTC (rev 4537) +++ trunk/SupplierInquiry.php 2011-04-04 10:14:30 UTC (rev 4538) @@ -4,20 +4,18 @@ include('includes/SQL_CommonFunctions.inc'); -//$PageSecurity=2; - include('includes/session.inc'); $title = _('Supplier Inquiry'); include('includes/header.inc'); // This is already linked from the menu -//echo "<a href='" . $rootpath . '/SelectSupplier.php?' . SID . "'>" . _('Back to Suppliers') . '</a><br>'; +//echo "<a href='" . $rootpath . '/SelectSupplier.php?' . SID . "'>" . _('Back to Suppliers') . '</a><br />'; // always figure out the SQL required from the inputs available if(!isset($_GET['SupplierID']) AND !isset($_SESSION['SupplierID'])){ - echo '<br>' . _('To display the enquiry a Supplier must first be selected from the Supplier selection screen') . - "<br><div class='centre'>><a href='". $rootpath . "/SelectSupplier.php'>" . _('Select a Supplier to Inquire On') . '</a></div>'; + echo '<br />' . _('To display the enquiry a Supplier must first be selected from the Supplier selection screen') . + '<br /><div class="centre"><a href="' . $rootpath . '/SelectSupplier.php">' . _('Select a Supplier to Inquire On') . '</a></div>'; exit; } else { if (isset($_GET['SupplierID'])){ @@ -35,7 +33,7 @@ } -$SQL = 'SELECT suppliers.suppname, +$SQL = "SELECT suppliers.suppname, suppliers.currcode, currencies.currency, paymentterms.terms, @@ -44,21 +42,21 @@ CASE WHEN (TO_DAYS(Now()) - TO_DAYS(supptrans.trandate)) >= paymentterms.daysbeforedue THEN supptrans.ovamount + supptrans.ovgst - supptrans.alloc ELSE 0 END ELSE - CASE WHEN TO_DAYS(Now()) - TO_DAYS(DATE_ADD(DATE_ADD(supptrans.trandate, ' . INTERVAL('1', 'MONTH') . '), ' . INTERVAL('(paymentterms.dayinfollowingmonth - DAYOFMONTH(supptrans.trandate))', 'DAY') . ')) >= 0 THEN supptrans.ovamount + supptrans.ovgst - supptrans.alloc ELSE 0 END + CASE WHEN TO_DAYS(Now()) - TO_DAYS(DATE_ADD(DATE_ADD(supptrans.trandate, " . INTERVAL('1', 'MONTH') . "), " . INTERVAL('(paymentterms.dayinfollowingmonth - DAYOFMONTH(supptrans.trandate))', 'DAY') . ")) >= 0 THEN supptrans.ovamount + supptrans.ovgst - supptrans.alloc ELSE 0 END END) AS due, SUM(CASE WHEN paymentterms.daysbeforedue > 0 THEN CASE WHEN (TO_DAYS(Now()) - TO_DAYS(supptrans.trandate)) > paymentterms.daysbeforedue - AND (TO_DAYS(Now()) - TO_DAYS(supptrans.trandate)) >= (paymentterms.daysbeforedue + ' . $_SESSION['PastDueDays1'] . ') + AND (TO_DAYS(Now()) - TO_DAYS(supptrans.trandate)) >= (paymentterms.daysbeforedue + " . $_SESSION['PastDueDays1'] . ") THEN supptrans.ovamount + supptrans.ovgst - supptrans.alloc ELSE 0 END ELSE - CASE WHEN (TO_DAYS(Now()) - TO_DAYS(DATE_ADD(DATE_ADD(supptrans.trandate, ' . INTERVAL('1','MONTH') . '), ' . INTERVAL('(paymentterms.dayinfollowingmonth - DAYOFMONTH(supptrans.trandate))', 'DAY') .')) >= ' . $_SESSION['PastDueDays1'] . ') + CASE WHEN (TO_DAYS(Now()) - TO_DAYS(DATE_ADD(DATE_ADD(supptrans.trandate, " . INTERVAL('1','MONTH') . "), " . INTERVAL('(paymentterms.dayinfollowingmonth - DAYOFMONTH(supptrans.trandate))', 'DAY') .")) >= '" . $_SESSION['PastDueDays1'] . "') THEN supptrans.ovamount + supptrans.ovgst - supptrans.alloc ELSE 0 END END) AS overdue1, Sum(CASE WHEN paymentterms.daysbeforedue > 0 THEN - CASE WHEN TO_DAYS(Now()) - TO_DAYS(supptrans.trandate) > paymentterms.daysbeforedue AND TO_DAYS(Now()) - TO_DAYS(supptrans.trandate) >= (paymentterms.daysbeforedue + ' . $_SESSION['PastDueDays2'] . ') + CASE WHEN TO_DAYS(Now()) - TO_DAYS(supptrans.trandate) > paymentterms.daysbeforedue AND TO_DAYS(Now()) - TO_DAYS(supptrans.trandate) >= (paymentterms.daysbeforedue + " . $_SESSION['PastDueDays2'] . ") THEN supptrans.ovamount + supptrans.ovgst - supptrans.alloc ELSE 0 END ELSE - CASE WHEN (TO_DAYS(Now()) - TO_DAYS(DATE_ADD(DATE_ADD(supptrans.trandate, ' . INTERVAL('1','MONTH') . '), ' . INTERVAL('(paymentterms.dayinfollowingmonth - DAYOFMONTH(supptrans.trandate))', 'DAY') . ')) >= ' . $_SESSION['PastDueDays2'] . ") + CASE WHEN (TO_DAYS(Now()) - TO_DAYS(DATE_ADD(DATE_ADD(supptrans.trandate, " . INTERVAL('1','MONTH') . "), " . INTERVAL('(paymentterms.dayinfollowingmonth - DAYOFMONTH(supptrans.trandate))', 'DAY') . ")) >= '" . $_SESSION['PastDueDays2'] . "') THEN supptrans.ovamount + supptrans.ovgst - supptrans.alloc ELSE 0 END END ) AS overdue2 FROM suppliers, @@ -122,9 +120,13 @@ if (isset($_GET['HoldType']) AND isset($_GET['HoldTrans'])){ if ($_GET['HoldStatus'] == _('Hold')){ - $SQL = "UPDATE supptrans SET hold=1 WHERE type='" . $_GET['HoldType'] . "' AND transno='" . $_GET['HoldTrans'] . "'"; + $SQL = "UPDATE supptrans SET hold=1 + WHERE type='" . $_GET['HoldType'] . "' + AND transno='" . $_GET['HoldTrans'] . "'"; } elseif ($_GET['HoldStatus'] == _('Release')){ - $SQL = "UPDATE supptrans SET hold=0 WHERE type='" . $_GET['HoldType'] . "' AND transno='" . $_GET['HoldTrans'] . "'"; + $SQL = "UPDATE supptrans SET hold=0 + WHERE type='" . $_GET['HoldType'] . "' + AND transno='" . $_GET['HoldTrans'] . "'"; } $ErrMsg = _('The Supplier Transactions could not be updated because'); @@ -133,12 +135,13 @@ } -echo "<table width=90% class=selection><tr><th>" . _('Total Balance') . - "</th><th>" . _('Current') . - "</th><th>" . _('Now Due') . - "</th><th>" . $_SESSION['PastDueDays1'] . '-' . $_SESSION['PastDueDays2'] . - ' ' . _('Days Overdue') . - "</th><th>" . _('Over') . ' ' . $_SESSION['PastDueDays2'] . ' ' . _('Days Overdue') . '</th></tr>'; +echo '<table width=90% class="selection"> + <tr><th>' . _('Total Balance') . '</th> + <th>' . _('Current') . '</th> + <th>' . _('Now Due') . '</th> + <th>' . $_SESSION['PastDueDays1'] . '-' . $_SESSION['PastDueDays2'] . ' ' . _('Days Overdue') . '</th> + <th>' . _('Over') . ' ' . $_SESSION['PastDueDays2'] . ' ' . _('Days Overdue') . '</th> + </tr>'; echo '<tr><td class=number>' . number_format($SupplierRecord['balance'],2) . '</td><td class=number>' . number_format(($SupplierRecord['balance'] - $SupplierRecord['due']),2) . @@ -146,10 +149,12 @@ '</td><td class=number>' . number_format(($SupplierRecord['overdue1']-$SupplierRecord['overdue2']) ,2) . '</td><td class=number>' . number_format($SupplierRecord['overdue2'],2) . '</td></tr></table>'; -echo "<br><div class='centre'><form action='" . $_SERVER['PHP_SELF'] . "?" . SID . "' method=post>"; +echo '<br /><div class="centre"><form action="' . $_SERVER['PHP_SELF'] . '" method="post">'; echo '<input type="hidden" name="FormID" value="' . $_SESSION['FormID'] . '" />'; -echo _('Show all transactions after') . ': ' ."<input type=text class='date' alt='".$_SESSION['DefaultDateFormat']."' name='TransAfterDate' VALUE='" . - $_POST['TransAfterDate'] . "' maxlength =10 size=10> <input type=submit name='Refresh Inquiry' VALUE='" . _('Refresh Inquiry') . "'></form><br>"; +echo _('Show all transactions after') . ': ' .'<input type="text" class="date" alt="' .$_SESSION['DefaultDateFormat'] .'" name="TransAfterDate" value="' . $_POST['TransAfterDate'] . '" maxlength="10" size="10" /> + <input type="submit" name="Refresh Inquiry" value="' . _('Refresh Inquiry') . '" /> + </form> + <br />'; echo '</div>'; $DateAfterCriteria = FormatDateForSQL($_POST['TransAfterDate']); @@ -189,16 +194,18 @@ echo '<table width="90%" cellpadding="2" colspan="7" class=selection>'; -$TableHeader = "<tr BGCOLOR =#800000><th>" . _('Trans') . ' #' . - "</th><th>" . _('Type') . - "</th><th>" . _('Supplier Ref') . - "</th><th>" . _('Date') . - "</th><th>" . _('Total') . - "</th><th>" . _('Allocated') . - "</th><th>" . _('Balance') . - "</th><th>" . _('Comments') . - "</th><th>" . _('More Info') . - "</th><th>" . _('More Info') . '</td></tr>'; +$TableHeader = '<tr> + <th>' . _('Trans') . ' #' .'</th> + <th>' . _('Type') . '</th> + <th>' . _('Supplier Ref') . '</th> + <th>' . _('Date') . '</th> + <th>' . _('Total') . '</th> + <th>' . _('Allocated') . '</th> + <th>' . _('Balance') . '</th> + <th>' . _('Comments') . '</th> + <th>' . _('More Info') . '</th> + <th>' . _('More Info') . '</td> + </tr>'; echo $TableHeader; @@ -232,43 +239,41 @@ /*The trans is settled so don't show option to hold */ - echo "<td>".$myrow['transno']."</td>"; - echo "<td>".$myrow['typename']."</td>"; - echo "<td>".$myrow['suppreference']."</td>"; - echo "<td>".ConvertSQLDate($myrow['trandate'])."</td>"; - echo "<td class=number>".number_format($myrow['totalamount'],2)."</td>"; - echo "<td class=number>".number_format($myrow['allocated'],2)."</td>"; - echo "<td class=number>".number_format($myrow['totalamount']-$myrow['allocated'],2)."</td>"; - echo "<td align=left>".$myrow['transtext']."</td>"; - echo "<td><a target='_blank' href='".$rootpath."/GLTransInquiry.php?".SID."&TypeID=".$myrow['type']."&TransNo=".$myrow['transno']."'>" . _('View GL Postings') . "</a></td>"; - echo "<td><a href='".$rootpath."/PaymentAllocations.php?".SID."SuppID=".$myrow['supplierno']."&InvID=".$myrow['suppreference']."'>" . _('View Payments') . "</a></td></tr>"; + echo '<td>' . $myrow['transno'] . '</td> + <td>' . $myrow['typename'] . '</td> + <td>' . $myrow['suppreference'] . '</td> + <td>' . ConvertSQLDate($myrow['trandate']) . '</td> + <td class="number">' . number_format($myrow['totalamount'],2) .'</td> + <td class="number">' . number_format($myrow['allocated'],2) . '</td> + <td class="number">' . number_format($myrow['totalamount']-$myrow['allocated'],2) . '</td> + <td align="left">' . $myrow['transtext'] . '</td> + <td><a target="_blank" href="' . $rootpath . '/GLTransInquiry.php?TypeID=' . $myrow['type'] . '&TransNo=' . $myrow['transno'] .'">' . _('View GL Postings') . '</a></td> + <td><a href="' . $rootpath . '/PaymentAllocations.php?SuppID=' . $myrow['supplierno'] . '&InvID=' . $myrow['suppreference'] .'">' . _('View Payments') . '</a></td></tr>'; } else { - echo "<td>".$myrow['transno']."</td>"; - echo "<td>".$myrow['typename']."</td>"; - echo "<td>".$myrow['suppreference']."</td>"; - echo "<td>".ConvertSQLDate($myrow['trandate'])."</td>"; - echo "<td class=number>".number_format($myrow['totalamount'],2)."</td>"; - echo "<td class=number>".number_format($myrow['allocated'],2)."</td>"; - echo "<td class=number>".number_format($myrow['totalamount'] - $myrow['allocated'],2)."</td>"; - echo "<td align=left>".$myrow['transtext']."</td>"; - $authsql='SELECT offhold - FROM purchorderauth - WHERE userid="'.$_SESSION['UserID'] . - '" AND currabrev="'.$SupplierRecord['currcode'].'"'; + echo '<td>' . $myrow['transno'] . '</td> + <td>' . $myrow['typename'] . '</td> + <td>' . $myrow['suppreference'] . '</td> + <td>' . ConvertSQLDate($myrow['trandate']) . '</td> + <td class="number">' . number_format($myrow['totalamount'],2) . '</td> + <td class="number">' .number_format($myrow['allocated'],2) . '</td> + <td class="number">' . number_format($myrow['totalamount'] - $myrow['allocated'],2) .'</td> + <td align="left">' . $myrow['transtext'] . '</td>'; + $authsql="SELECT offhold + FROM purchorderauth + WHERE userid='" . $_SESSION['UserID'] . "' + AND currabrev='" . $SupplierRecord['currcode']."'"; $authresult=DB_query($authsql, $db); $authrow=DB_fetch_array($authresult); if ($authrow[0]==0) { - echo "<td><a href='".$_SERVER['PHP_SELF']."?".SID."&HoldType=".$myrow['type']."&HoldTrans=".$myrow['transno']. - "&HoldStatus=".$HoldValue."&FromDate=".$_POST['TransAfterDate']."'>".$HoldValue."</a></td>"; + echo '<td><a href="' .$_SERVER['PHP_SELF'] . '?HoldType=' . $myrow['type'] . '&HoldTrans=' . $myrow['transno']. '&HoldStatus=' . $HoldValue . '&FromDate=' . $_POST['TransAfterDate'].'">' . $HoldValue .'</a></td>'; } else { if ($HoldValue==_('Release')) { - echo "<td>".$HoldValue."</a></td>"; + echo '<td>' . $HoldValue .'</a></td>'; } else { - echo "<td><a href='".$_SERVER['PHP_SELF']."?".SID."&HoldType=".$myrow['type']."&HoldTrans=".$myrow['transno']. - "&Hol... [truncated message content] |
From: <dai...@us...> - 2011-04-03 03:24:33
|
Revision: 4537 http://web-erp.svn.sourceforge.net/web-erp/?rev=4537&view=rev Author: daintree Date: 2011-04-03 03:24:25 +0000 (Sun, 03 Apr 2011) Log Message: ----------- SQL and xhtml fixes Modified Paths: -------------- trunk/SMTPServer.php trunk/SelectSalesOrder.php trunk/SelectWorkOrder.php trunk/ShipmentCosting.php trunk/StockAdjustments.php trunk/StockDispatch.php trunk/StockTransfers.php trunk/SuppFixedAssetChgs.php trunk/SupplierAllocations.php Modified: trunk/SMTPServer.php =================================================================== --- trunk/SMTPServer.php 2011-04-02 09:40:49 UTC (rev 4536) +++ trunk/SMTPServer.php 2011-04-03 03:24:25 UTC (rev 4537) @@ -1,7 +1,5 @@ <?php - -//$PageSecurity =15; - +/* $Id: SMTPServer.php 4469 2011-01-15 02:28:37Z daintree $*/ include('includes/session.inc'); $title = _('SMTP Server details'); @@ -25,17 +23,20 @@ } $sql='SELECT id, - host, - port, - heloaddress, - username, - password, - timeout, - auth - FROM emailsettings'; + host, + port, + heloaddress, + username, + password, + timeout, + auth + FROM emailsettings'; + $result=DB_query($sql, $db); + $myrow=DB_fetch_array($result); -echo "<form method='post' action=" . $_SERVER['PHP_SELF'] . "?" . SID . ">"; + +echo '<form method="post" action="' . $_SERVER['PHP_SELF'] . '">'; echo '<input type="hidden" name="FormID" value="' . $_SESSION['FormID'] . '" />'; echo '<table class=selection>'; echo '<tr><td>'._('Server Host Name').'</td> Modified: trunk/SelectSalesOrder.php =================================================================== --- trunk/SelectSalesOrder.php 2011-04-02 09:40:49 UTC (rev 4536) +++ trunk/SelectSalesOrder.php 2011-04-03 03:24:25 UTC (rev 4537) @@ -14,9 +14,9 @@ for ($i=1;$i<count($_POST);$i++){ if (isset($_POST['PlacePO_' . $i])) { //checkboxes only set if they are checked if ($OrdersToPlacePOFor==''){ - $OrdersToPlacePOFor .= ' orderno=' . $_POST['OrderNo_PO_'.$i]; + $OrdersToPlacePOFor .= " orderno='" . $_POST['OrderNo_PO_'.$i] . "'"; } else { - $OrdersToPlacePOFor .= ' OR orderno=' . $_POST['OrderNo_PO_'.$i]; + $OrdersToPlacePOFor .= " OR orderno='" . $_POST['OrderNo_PO_'.$i] . "'"; } } } @@ -97,9 +97,9 @@ /* if an order is/has been created already and the supplier of this item has changed - so need to finish off the order */ //if the user has authority to authorise the PO then it should be created as authorised $AuthSQL ="SELECT authlevel - FROM purchorderauth - WHERE userid='".$_SESSION['UserID']."' - AND currabrev='".$SuppRow['currcode']."'"; + FROM purchorderauth + WHERE userid='".$_SESSION['UserID']."' + AND currabrev='".$SuppRow['currcode']."'"; $AuthResult=DB_query($AuthSQL,$db); $AuthRow=DB_fetch_array($AuthResult); @@ -280,8 +280,8 @@ $ErrMsg = _('Could not update purchase order status to Authorised'); $Debug = _('The SQL that failed was'); $result = DB_query("UPDATE purchorders SET allowprint=1, - status='Authorised', - stat_comment='" . $StatusComment . "' + status='Authorised', + stat_comment='" . $StatusComment . "' WHERE orderno='" . $PO_OrderNo . "'", $db,$ErrMsg,$DbgMsg,true); } else { // no authority to authorise this order Modified: trunk/SelectWorkOrder.php =================================================================== --- trunk/SelectWorkOrder.php 2011-04-02 09:40:49 UTC (rev 4536) +++ trunk/SelectWorkOrder.php 2011-04-03 03:24:25 UTC (rev 4537) @@ -2,14 +2,12 @@ /* $Id$*/ -//$PageSecurity = 2; - include('includes/session.inc'); $title = _('Search Work Orders'); include('includes/header.inc'); echo '<p class="page_title_text"><img src="'.$rootpath.'/css/'.$theme.'/images/magnifier.png" title="' . _('Search') . '" alt="" />' . ' ' . $title . '</p>'; -echo '<form action=' . $_SERVER['PHP_SELF'] .'?' .SID . ' method=post>'; +echo '<form action="' . $_SERVER['PHP_SELF'] . '" method=post>'; echo '<input type="hidden" name="FormID" value="' . $_SESSION['FormID'] . '" />'; @@ -117,14 +115,14 @@ while ($myrow=DB_fetch_array($resultStkLocs)){ if (isset($_POST['StockLocation'])){ if ($myrow['loccode'] == $_POST['StockLocation']){ - echo "<option selected Value='" . $myrow['loccode'] . "'>" . $myrow['locationname']; + echo '<option selected value="' . $myrow['loccode'] . '">' . $myrow['locationname'] . '</option>'; } else { - echo "<option Value='" . $myrow['loccode'] . "'>" . $myrow['locationname']; + echo '<option value="' . $myrow['loccode'] . '">' . $myrow['locationname'] . '</option>'; } } elseif ($myrow['loccode']==$_SESSION['UserStockLocation']){ - echo "<option selected Value='" . $myrow['loccode'] . "'>" . $myrow['locationname']; + echo '<option selected value="' . $myrow['loccode'] . '">' . $myrow['locationname'] . '</option>'; } else { - echo "<option Value='" . $myrow['loccode'] . "'>" . $myrow['locationname']; + echo '<option Value="' . $myrow['loccode'] . '">' . $myrow['locationname'] . '</option>'; } } @@ -162,30 +160,30 @@ <select name='StockCat'>"; while ($myrow1 = DB_fetch_array($result1)) { - echo "<option value='". $myrow1['categoryid'] . "'>" . $myrow1['categorydescription']; + echo '<option value="'. $myrow1['categoryid'] . '">' . $myrow1['categorydescription'] . '</option>'; } echo '</select> - <td><font size=1>' . _('Enter text extract(s) in the description') . ":</font></td> - <td><input type='Text' name='Keywords' size=20 maxlength=25></td> + <td><font size=1>' . _('Enter text extract(s) in the description') . ':</font></td> + <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><input type='Text' name='StockCode' size=15 maxlength=18></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><br />"; - echo "<div class=centre><input type=submit name='SearchParts' value='" . _('Search Items Now') . "'> - <input type=submit name='ResetPart' value='" . _('Show All') . "'></div>"; + </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 '<br /><table cellpadding=2 colspan=7 class=selection>'; - $TableHeader = "<tr> - <th>" . _('Code') . "</th> - <th>" . _('Description') . "</th> - <th>" . _('On Hand') . "</th> - <th>" . _('Units') . "</th> - </tr>"; + $TableHeader = '<tr> + <th>' . _('Code') . '</th> + <th>' . _('Description') . '</th> + <th>' . _('On Hand') . '</th> + <th>' . _('Units') . '</th> + </tr>'; echo $TableHeader; $j = 1; @@ -249,7 +247,7 @@ WHERE workorders.closed='" . $ClosedOrOpen . "' AND workorders.wo='". $_REQUEST['WO'] ."' ORDER BY workorders.wo, - woitems.stockid"; + woitems.stockid"; } else { /* $DateAfterCriteria = FormatDateforSQL($OrdersAfterDate); */ @@ -293,18 +291,18 @@ echo '<br /><table cellpadding=2 colspan=7 width=95% class=selection>'; - $tableheader = "<tr> - <th>" . _('Modify') . "</th> - <th>" . _('Status') . "</th> - <th>" . _('Receive') . "</th> - <th>" . _('Issue To') . "</th> - <th>" . _('Costing') . "</th> - <th>" . _('Item') . "</th> - <th>" . _('Quantity Required') . "</th> - <th>" . _('Quantity Received') . "</th> - <th>" . _('Quantity Outstanding') . "</th> - <th>" . _('Required Date') . "</th> - </tr>"; + $tableheader = '<tr> + <th>' . _('Modify') . '</th> + <th>' . _('Status') . '</th> + <th>' . _('Receive') . '</th> + <th>' . _('Issue To') . '</th> + <th>' . _('Costing') . '</th> + <th>' . _('Item') . '</th> + <th>' . _('Quantity Required') . '</th> + <th>' . _('Quantity Received') . '</th> + <th>' . _('Quantity Outstanding') . '</th> + <th>' . _('Required Date') . '</th> + </tr>'; echo $tableheader; } @@ -320,11 +318,11 @@ $k++; } - $ModifyPage = $rootpath . "/WorkOrderEntry.php?" . SID . '&WO=' . $myrow['wo']; - $Status_WO = $rootpath . '/WorkOrderStatus.php?' . SID . '&WO=' .$myrow['wo'] . '&StockID=' . $myrow['stockid']; - $Receive_WO = $rootpath . '/WorkOrderReceive.php?' . SID . '&WO=' .$myrow['wo'] . '&StockID=' . $myrow['stockid']; - $Issue_WO = $rootpath . '/WorkOrderIssue.php?' . SID . '&WO=' .$myrow['wo'] . '&StockID=' . $myrow['stockid']; - $Costing_WO =$rootpath . '/WorkOrderCosting.php?' . SID . '&WO=' .$myrow['wo']; + $ModifyPage = $rootpath . '/WorkOrderEntry.php?WO=' . $myrow['wo']; + $Status_WO = $rootpath . '/WorkOrderStatus.php?WO=' .$myrow['wo'] . '&StockID=' . $myrow['stockid']; + $Receive_WO = $rootpath . '/WorkOrderReceive.php?WO=' .$myrow['wo'] . '&StockID=' . $myrow['stockid']; + $Issue_WO = $rootpath . '/WorkOrderIssue.php?WO=' .$myrow['wo'] . '&StockID=' . $myrow['stockid']; + $Costing_WO =$rootpath . '/WorkOrderCosting.php?WO=' .$myrow['wo']; $FormatedRequiredByDate = ConvertSQLDate($myrow['requiredby']); Modified: trunk/ShipmentCosting.php =================================================================== --- trunk/ShipmentCosting.php 2011-04-02 09:40:49 UTC (rev 4536) +++ trunk/ShipmentCosting.php 2011-04-03 03:24:25 UTC (rev 4537) @@ -2,8 +2,6 @@ /* $Id$*/ -//$PageSecurity = 11; - include('includes/session.inc'); $title = _('Shipment Costing'); /* Session started in header.inc for password checking and authorisation level check */ @@ -20,9 +18,9 @@ if (!isset($_GET['SelectedShipment'])){ - echo '<br>'; + echo '<br />'; prnMsg( _('This page is expected to be called with the shipment number to show the costing for'), 'error'); - include ("includes/footer.inc"); + include ('includes/footer.inc'); exit; } @@ -40,14 +38,14 @@ $ErrMsg = _('Shipment').' '. $_GET['SelectedShipment'] . ' ' . _('cannot be retrieved because a database error occurred'); $GetShiptHdrResult = DB_query($ShipmentHeaderSQL,$db, $ErrMsg); if (DB_num_rows($GetShiptHdrResult)==0) { - echo '<br>'; + echo '<br />'; prnMsg( _('Shipment') . ' ' . $_GET['SelectedShipment'] . ' ' . _('could not be located in the database') , 'error'); - include ("includes/footer.inc"); + include ('includes/footer.inc'); exit; } $HeaderData = DB_fetch_array($GetShiptHdrResult); -echo '<br>'; +echo '<br />'; echo '<table class=selection>'; echo '<tr><th colspan=4><font size=3 color=navy>'._('Shipment Details').'</font></th></tr>'; echo '<tr> @@ -73,7 +71,7 @@ $ErrMsg = _('Shipment') . ' ' . $_GET['SelectedShipment'] . ' ' . _('general costs cannot be retrieved from the database'); $GetShiptCostsResult = DB_query($sql,$db, $ErrMsg); if (DB_num_rows($GetShiptCostsResult)==0) { - echo '<br>'; + echo '<br />'; prnMsg ( _('No General Cost Records exist for Shipment') . ' ' . $_GET['SelectedShipment'] . ' ' . _('in the database'), 'error'); include ('includes/footer.inc'); exit; @@ -90,7 +88,7 @@ $ErrMsg = _('Shipment') . ' ' . $_GET['SelectedShipment'] . ' ' . _('Item costs cannot be retrieved from the database'); $GetShiptCostsResult = DB_query($sql,$db); if (DB_error_no($db) !=0 OR DB_num_rows($GetShiptCostsResult)==0) { - echo '<br>'; + echo '<br />'; prnMsg ( _('No Item Cost Records exist for Shipment') . ' ' . $_GET['SelectedShipment'] . ' ' . _('in the database'), 'error'); include ('includes/footer.inc'); exit; @@ -137,12 +135,12 @@ 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> - <th>'. _('Quantity'). '<br>'. _('Received'). '</th> - <th>'. _('Invoiced'). '<br>'. _('Charges'). '</th> - <th>'. _('Shipment'). '<br>'. _('Charges'). '</th> - <th>'. _('Shipment'). '<br>'. _('Cost'). '</th> - <th>'. _('Standard'). '<br>'. _('Cost'). '</th> + <th>'. _('Quantity'). '<br />'. _('Invoiced'). '</th> + <th>'. _('Quantity'). '<br />'. _('Received'). '</th> + <th>'. _('Invoiced'). '<br />'. _('Charges'). '</th> + <th>'. _('Shipment'). '<br />'. _('Charges'). '</th> + <th>'. _('Shipment'). '<br />'. _('Cost'). '</th> + <th>'. _('Standard'). '<br />'. _('Cost'). '</th> <th>'. _('Variance'). '</th> <th>%</th></tr>'; echo $TableHeader; @@ -215,27 +213,27 @@ 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 */ - $sql ='SELECT SUM(quantity) FROM locstock WHERE stockid="' . $myrow['itemcode'] . '"'; + $sql ="SELECT SUM(quantity) FROM locstock WHERE stockid='" . $myrow['itemcode'] . "'"; $ErrMsg = _('CRITICAL ERROR') . '! ' . _('NOTE DOWN THIS ERROR AND SEEK ASSISTANCE') . ': ' . _('The quantity on hand could not be retrieved from the database'); $DbgMsg = _('The following SQL to retrieve the total stock quantity was used'); $Result = DB_query($sql, $db, $ErrMsg, $DbgMsg); @@ -247,68 +245,68 @@ 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*/ - if ($myrow['totqtyinvoiced'] > $TotalQuantityOnHand){ + if ($myrow['totqtyinvoiced'] > $TotalQuantityOnHand){ - $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 . ")"; + $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 . ")"; + + $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, + 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) . "')"; + + $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 variance posting for'). ' ' . $myrow['itemcode'] . ' '. _('could not be inserted into the database because'); - $result = DB_query($sql,$db, $ErrMsg,'',TRUE); + } /* end of average cost GL stuff */ - } - /*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) . "')"; - $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 */ - - /*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 @@ -324,54 +322,54 @@ $CostIncrement = ($myrow['totqtyinvoiced'] *($ItemShipmentCost - $StdCostUnit) - $WriteOffToVariances) / $TotalQuantityOnHand; $sql = 'UPDATE stockmaster SET lastcost=materialcost+overheadcost+labourcost, - materialcost=materialcost+' . $CostIncrement . ' WHERE stockid="' . $myrow['itemcode'] . '"'; + 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, - 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) . ' 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 */ + if ($_SESSION['CompanyRecord']['gllink_stock']==1){ + $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) . ' 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 */ - if ($_SESSION['CompanyRecord']['gllink_stock']==1){ + 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, - account, - narrative, - amount) - VALUES (31, - '" . $_GET['SelectedShipment'] . "', - '" . Date('Y-m-d') . "', - '" . $PeriodNo . "', - '" . $_SESSION['CompanyRecord']['grnact'] . "', - '" . $myrow['itemcode'] . ' ' ._('shipment cost') . ' ' . number_format($ItemShipmentCost,2) . ' x ' . _('Qty invoiced') . ' ' . $myrow['totqtyinvoiced'] . "', - " . ($Variance * $myrow['totqtyinvoiced']) . ")"; + $sql = "INSERT INTO gltrans (type, + typeno, + trandate, + periodno, + account, + narrative, + amount) + VALUES (31, + '" . $_GET['SelectedShipment'] . "', + '" . Date('Y-m-d') . "', + '" . $PeriodNo . "', + '" . $_SESSION['CompanyRecord']['grnact'] . "', + '" . $myrow['itemcode'] . ' ' ._('shipment cost') . ' ' . number_format($ItemShipmentCost,2) . ' x ' . _('Qty invoiced') . ' ' . $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'); @@ -381,66 +379,66 @@ 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]; + $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){ - $CostUpdateNo = GetNextTransNo(35, $db); - $PeriodNo = GetPeriod(Date("d/m/Y"), $db); + if ($_SESSION['CompanyRecord']['gllink_stock']==1){ + $CostUpdateNo = GetNextTransNo(35, $db); + $PeriodNo = GetPeriod(Date("d/m/Y"), $db); - $ValueOfChange = $QOH * ($ItemShipmentCost - $StdCostUnit); + $ValueOfChange = $QOH * ($ItemShipmentCost - $StdCostUnit); - $SQL = "INSERT INTO gltrans (type, - typeno, - trandate, - periodno, - account, - narrative, - amount) - VALUES (35, - '" . $CostUpdateNo . "', - '" . Date('Y-m-d') . "', - '" . $PeriodNo . "', - '" . $StockGLCodes['adjglact'] . "', - '" . _('Shipment of') . ' ' . $myrow['itemcode'] . " " . _('cost was') . ' ' . $StdCostUnit . ' ' . _('changed to') . ' ' . number_format($ItemShipmentCost,2) . ' x ' . _('QOH of') . ' ' . $QOH . "', " . (-$ValueOfChange) . ")"; + $SQL = "INSERT INTO gltrans (type, + typeno, + trandate, + periodno, + account, + narrative, + amount) + VALUES (35, + '" . $CostUpdateNo . "', + '" . Date('Y-m-d') . "', + '" . $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); + $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); + + $Result = DB_query($SQL,$db, $ErrMsg,'',TRUE); + + $SQL = "INSERT INTO gltrans (type, + typeno, + trandate, + periodno, + account, + narrative, + amount) + VALUES (35, + '" . $CostUpdateNo . "', + '" . Date('Y-m-d') . "', + '" . $PeriodNo . "', + '" . $StockGLCodes['stockact'] . "', + '" . _('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 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 */ - $Result = DB_query($SQL,$db, $ErrMsg,'',TRUE); - - $SQL = "INSERT INTO gltrans (type, - typeno, - trandate, - periodno, - account, - narrative, - amount) - VALUES (35, - '" . $CostUpdateNo . "', - '" . Date('Y-m-d') . "', - '" . $PeriodNo . "', - '" . $StockGLCodes['stockact'] . "', - '" . _('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 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 */ - /* Only the material cost is important for imported items */ - $sql = "UPDATE stockmaster SET materialcost=" . $ItemShipmentCost . ", - labourcost=0, - overheadcost=0, - lastcost='" . $StdCostUnit . "' - WHERE stockid='" . $myrow['itemcode'] . "'"; + $sql = "UPDATE stockmaster SET materialcost=" . $ItemShipmentCost . ", + labourcost=0, + overheadcost=0, + 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); + $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); - $result = DB_query($sql,$db, $ErrMsg,'',TRUE); + $result = DB_query($sql,$db, $ErrMsg,'',TRUE); - } // end of update cost code + } // end of update cost code } // end of Close shipment item updates @@ -502,7 +500,7 @@ <th>'. _('Ref'). '</th> <th>'. _('Date'). '</th> <th>'. _('Item'). '</th> - <th>'. _('Local Amount'). '<br>'. _('Charged'). '</th></tr>'; + <th>'. _('Local Amount'). '<br />'. _('Charged'). '</th></tr>'; echo $TableHeader; @@ -572,7 +570,7 @@ <th>'. _('Type'). '</th> <th>'. _('Ref'). '</th> <th>'. _('Date'). '</th> - <th>'. _('Local Amount'). '<br>'. _('Charged'). '</th></tr>'; + <th>'. _('Local Amount'). '<br />'. _('Charged'). '</th></tr>'; echo $TableHeader; @@ -613,16 +611,17 @@ if ( isset($_GET['Close'])) { /* Only an opportunity to confirm user wishes to close */ // if the page was called with Close=Yes then show options to confirm OK to c - echo '<div class+"centre"><form method="POST" action="' . $_SERVER['PHP_SELF'] .'?' . SID .'&SelectedShipment=' . $_GET['SelectedShipment'] . '">'; + echo '<div class+"centre"><form method="POST" action="' . $_SERVER['PHP_SELF'] .'?SelectedShipment=' . $_GET['SelectedShipment'] . '">'; echo '<input type="hidden" name="FormID" value="' . $_SESSION['FormID'] . '" />'; 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>'; + <option selected VALUE="Yes">'. _('Yes') . '</option> + <option VALUE="No">'. _('No') . '</option> + </select>'; } - echo '<br><br><input type=submit name="Close" VALUE="'. _('Confirm OK to Close'). '">'; + echo '<br /><br /><input type=submit name="Close" VALUE="'. _('Confirm OK to Close'). '">'; echo '</form></div>'; } @@ -651,14 +650,14 @@ $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>'; + echo '<br /><br />'; prnMsg( _('Shipment'). ' ' . $_GET['SelectedShipment'] . ' ' . _('has been closed') ); if ($_SESSION['CompanyRecord']['gllink_stock']==1) { - echo '<br>'; + echo '<br />'; prnMsg ( _('All variances were posted to the general ledger') ); } If ($_POST['UpdateCost']=='Yes'){ - echo '<br>'; + echo '<br />'; prnMsg ( _('All shipment items have had their standard costs updated') ); } } Modified: trunk/StockAdjustments.php =================================================================== --- trunk/StockAdjustments.php 2011-04-02 09:40:49 UTC (rev 4536) +++ trunk/StockAdjustments.php 2011-04-03 03:24:25 UTC (rev 4537) @@ -4,8 +4,6 @@ include('includes/DefineStockAdjustment.php'); include('includes/DefineSerialItems.php'); - -//$PageSecurity = 11; include('includes/session.inc'); $title = _('Stock Adjustments'); @@ -61,16 +59,18 @@ '" alt="" />' . ' ' . _('Select Item to Adjust') . '</p>'; if (strlen($_POST['StockText'])>0) { - $sql='SELECT stockid, description from stockmaster where description like "%'.$_POST['StockText'].'%"'; + $sql="SELECT stockid, description from stockmaster where description like '%" . $_POST['StockText'] ."%'"; } else { - $sql='SELECT stockid, description from stockmaster where stockid like "%'.$_POST['StockCode'].'%"'; + $sql="SELECT stockid, description from stockmaster where stockid like '%" . $_POST['StockCode'] ."%'"; } $ErrMsg=_('The stock information cannot be retrieved because'); $DbgMsg=_('The SQL to get the stock description was'); $result = DB_query($sql,$db,$ErrMsg,$DbgMsg); echo '<table class=selection><tr><th>'._('Stock Code').'</th><th>'._('Stock Description').'</th></tr>'; while ($myrow = DB_fetch_row($result)) { - echo '<tr><td>'.$myrow[0].'</td><td>'.$myrow[1].'</td><td><a href="StockAdjustments.php?StockID='.$myrow[0].'&Description='.$myrow[1].'">'._('Adjust').'</a></tr>'; + echo '<tr><td>'.$myrow[0].'</td> + <td>'.$myrow[1].'</td> + <td><a href="StockAdjustments.php?StockID='.$myrow[0].'&Description='.$myrow[1].'">'._('Adjust').'</a></tr>'; } echo '</table>'; include('includes/footer.inc'); @@ -132,27 +132,26 @@ $QtyOnHandPrior = 0; } - $SQL = "INSERT INTO stockmoves ( - stockid, - type, - transno, - loccode, - trandate, - prd, - reference, - qty, - newqoh) - VALUES ( - '" . $_SESSION['Adjustment']->StockID . "', - 17, - '" . $AdjustmentNumber . "', - '" . $_SESSION['Adjustment']->StockLocation . "', - '" . $SQLAdjustmentDate . "', - '" . $PeriodNo . "', - '" . $_SESSION['Adjustment']->Narrative ."', - '" . $_SESSION['Adjustment']->Quantity . "', - '" . ($QtyOnHandPrior + $_SESSION['Adjustment']->Quantity) . "' - )"; + $SQL = "INSERT INTO stockmoves ( stockid, + type, + transno, + loccode, + trandate, + prd, + reference, + qty, + newqoh) + VALUES ( + '" . $_SESSION['Adjustment']->StockID . "', + 17, + '" . $AdjustmentNumber . "', + '" . $_SESSION['Adjustment']->StockLocation . "', + '" . $SQLAdjustmentDate . "', + '" . $PeriodNo . "', + '" . $_SESSION['Adjustment']->Narrative ."', + '" . $_SESSION['Adjustment']->Quantity . "', + '" . ($QtyOnHandPrior + $_SESSION['Adjustment']->Quantity) . "' + )"; $ErrMsg = _('CRITICAL ERROR') . '! ' . _('NOTE DOWN THIS ERROR AND SEEK ASSISTANCE') . ': ' . _('The stock movement record cannot be inserted because'); @@ -172,23 +171,22 @@ /*First need to check if the serial items already exists or not */ $SQL = "SELECT COUNT(*) - FROM stockserialitems - WHERE - stockid='" . $_SESSION['Adjustment']->StockID . "' - AND loccode='" . $_SESSION['Adjustment']->StockLocation . "' - AND serialno='" . $Item->BundleRef . "'"; + FROM stockserialitems + WHERE + stockid='" . $_SESSION['Adjustment']->StockID . "' + AND loccode='" . $_SESSION['Adjustment']->StockLocation . "' + AND serialno='" . $Item->BundleRef . "'"; $ErrMsg = _('Unable to determine if the serial item exists'); $Result = DB_query($SQL,$db,$ErrMsg); $SerialItemExistsRow = DB_fetch_row($Result); if ($SerialItemExistsRow[0]==1){ - $SQL = "UPDATE stockserialitems SET - quantity= quantity + " . $Item->BundleQty . " - WHERE - stockid='" . $_SESSION['Adjustment']->StockID . "' - AND loccode='" . $_SESSION['Adjustment']->StockLocation . "' - AND serialno='" . $Item->BundleRef . "'"; + $SQL = "UPDATE stockserialitems SET quantity= quantity + " . $Item->BundleQty . " + WHERE + stockid='" . $_SESSION['Adjustment']->StockID . "' + AND loccode='" . $_SESSION['Adjustment']->StockLocation . "' + AND serialno='" . $Item->BundleRef . "'"; $ErrMsg = _('CRITICAL ERROR') . '! ' . _('NOTE DOWN THIS ERROR AND SEEK ASSISTANCE') . ': ' . _('The serial stock item record could not be updated because'); $DbgMsg = _('The following SQL to update the serial stock item record was used'); @@ -196,16 +194,16 @@ } else { /*Need to insert a new serial item record */ $SQL = "INSERT INTO stockserialitems (stockid, - loccode, - serialno, - qualitytext, - quantity) - VALUES ('" . $_SESSION['Adjustment']->StockID . "', - '" . $_SESSION['Adjustment']->StockLocation . "', - '" . $Item->BundleRef . "', - '', - '" . $Item->BundleQty . "' - )"; + loccode, + serialno, + qualitytext, + quantity) + VALUES ('" . $_SESSION['Adjustment']->StockID . "', + '" . $_SESSION['Adjustment']->StockLocation . "', + '" . $Item->BundleRef . "', + '', + '" . $Item->BundleQty . "' + )"; $ErrMsg = _('CRITICAL ERROR') . '! ' . _('NOTE DOWN THIS ERROR AND SEEK ASSISTANCE') . ': ' . _('The serial stock item record could not be updated because'); $DbgMsg = _('The following SQL to update the serial stock item record was used'); @@ -216,13 +214,13 @@ /* now insert the serial stock movement */ $SQL = "INSERT INTO stockserialmoves (stockmoveno, - stockid, - serialno, - moveqty) - VALUES ('" . $StkMoveNo . "', - '" . $_SESSION['Adjustment']->StockID . "', - '" . $Item->BundleRef . "', - '" . $Item->BundleQty . "')"; + stockid, + serialno, + moveqty) + VALUES ('" . $StkMoveNo . "', + '" . $_SESSION['Adjustment']->StockID . "', + '" . $Item->BundleRef . "', + '" . $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 records was used'); $Result = DB_query($SQL, $db, $ErrMsg, $DbgMsg, true); @@ -246,45 +244,45 @@ $StockGLCodes = GetStockGLCode($_SESSION['Adjustment']->StockID,$db); $SQL = "INSERT INTO gltrans (type, - typeno, - trandate, - periodno, - account, - amount, - narrative, - tag) - VALUES (17, - '" .$AdjustmentNumber . "', - '" . $SQLAdjustmentDate . "', - '" . $PeriodNo . "', - '" . $StockGLCodes['adjglact'] . "', - '" . $_SESSION['Adjustment']->StandardCost * -($_SESSION['Adjustment']->Quantity) . "', - '" . $_SESSION['Adjustment']->StockID . " x " . $_SESSION['Adjustment']->Quantity . " @ " . - $_SESSION['Adjustment']->StandardCost . " " . $_SESSION['Adjustment']->Narrative . "', - '" . $_SESSION['Adjustment']->tag . "' - )"; + typeno, + trandate, + periodno, + account, + amount, + narrative, + tag) + VALUES (17, + '" .$AdjustmentNumber . "', + '" . $SQLAdjustmentDate . "', + '" . $PeriodNo . "', + '" . $StockGLCodes['adjglact'] . "', + '" . $_SESSION['Adjustment']->StandardCost * -($_SESSION['Adjustment']->Quantity) . "', + '" . $_SESSION['Adjustment']->StockID . " x " . $_SESSION['Adjustment']->Quantity . " @ " . + $_SESSION['Adjustment']->StandardCost . " " . $_SESSION['Adjustment']->Narrative . "', + '" . $_SESSION['Adjustment']->tag . "' + )"; $ErrMsg = _('CRITICAL ERROR') . '! ' . _('NOTE DOWN THIS ERROR AND SEEK ASSISTANCE') . ': ' . _('The general ledger transaction entries could not be added because'); $DbgMsg = _('The following SQL to insert the GL entries was used'); $Result = DB_query($SQL,$db, $ErrMsg, $DbgMsg, true); $SQL = "INSERT INTO gltrans (type, - typeno, - trandate, - periodno, - account, - amount, - narrative, - tag) - VALUES (17, - '" .$AdjustmentNumber . "', - '" . $SQLAdjustmentDate . "', - '" . $PeriodNo . "', - '" . $StockGLCodes['stockact'] . "', - '" . $_SESSION['Adjustment']->StandardCost * $_SESSION['Adjustment']->Quantity . "', - '" . $_SESSION['Adjustment']->StockID . " x " . $_SESSION['Adjustment']->Quantity . " @ " . $_SESSION['Adjustment']->StandardCost . " " . $_SESSION['Adjustment']->Narrative . "', - '" . $_SESSION['Adjustment']->tag . "' - )"; + typeno, + trandate, + periodno, + account, + amount, + narrative, + tag) + VALUES (17, + '" .$AdjustmentNumber . "', + '" . $SQLAdjustmentDate . "', + '" . $PeriodNo . "', + '" . $StockGLCodes['stockact'] . "', + '" . $_SESSION['Adjustment']->StandardCost * $_SESSION['Adjustment']->Quantity . "', + '" . $_SESSION['Adjustment']->StockID . " x " . $_SESSION['Adjustment']->Quantity . " @ " . $_SESSION['Adjustment']->StandardCost . " " . $_SESSION['Adjustment']->Narrative . "', + '" . $_SESSION['Adjustment']->tag . "' + )"; $Errmsg = _('CRITICAL ERROR') . '! ' . _('NOTE DOWN THIS ERROR AND SEEK ASSISTANCE') . ': ' . _('The general ledger transaction entries could not be added because'); $DbgMsg = _('The following SQL to insert the GL entries was used'); @@ -388,18 +386,18 @@ //Select the tag echo '<tr><td>'._('Select Tag').'</td><td><select name="tag">'; -$SQL = "SELECT tagref, +$SQL = 'SELECT tagref, tagdescription FROM tags - ORDER BY tagref"; + ORDER BY tagref'; $result=DB_query($SQL,$db); echo '<option value=0>0 - None'; while ($myrow=DB_fetch_array($result)){ if (isset($_SESSION['Adjustment']->tag) and $_SESSION['Adjustment']->tag==$myrow['tagref']){ - echo '<option selected value=' . $myrow['tagref'] . '>' . $myrow['tagref'].' - ' .$myrow['tagdescription']; + echo '<option selected value=' . $myrow['tagref'] . '>' . $myrow['tagref'].' - ' .$myrow['tagdescription'] . '</option>'; } else { - echo '<option value=' . $myrow['tagref'] . '>' . $myrow['tagref'].' - ' .$myrow['tagdescription']; + echo '<option value=' . $myrow['tagref'] . '>' . $myrow['tagref'].' - ' .$myrow['tagdescription']. '</option>'; } } echo '</select></td>'; @@ -411,11 +409,11 @@ $_POST['StockLocation']=''; } -echo '<br><a href="'. $rootpath. '/StockStatus.php?' . SID . '&StockID='. $StockID . '">'._('Show Stock Status').'</a>'; -echo '<br><a href="'.$rootpath.'/StockMovements.php?' . SID . '&StockID=' . $StockID . '">'._('Show Movements').'</a>'; -echo '<br><a href="'.$rootpath.'/StockUsage.php?' . SID . '&StockID=' . $StockID . '&StockLocation=' . $_POST['StockLocation'] . '">'._('Show Stock Usage').'</a>'; -echo '<br><a href="'.$rootpath.'/SelectSalesOrder.php?' . SID . '&SelectedStockItem='. $StockID .'&StockLocation=' . $_POST['StockLocation'] . '">'. _('Search Outstanding Sales Orders').'</a>'; -echo '<br><a href="'.$rootpath.'/SelectCompletedOrder.php?' . SID . '&SelectedStockItem=' . $StockID .'">'._('Search Completed Sales Orders').'</a>'; +echo '<br><a href="'. $rootpath. '/StockStatus.php?StockID='. $StockID . '">'._('Show Stock Status').'</a>'; +echo '<br><a href="'.$rootpath.'/StockMovements.php?StockID=' . $StockID . '">'._('Show Movements').'</a>'; +echo '<br><a href="'.$rootpath.'/StockUsage.php?StockID=' . $StockID . '&StockLocation=' . $_POST['StockLocation'] . '">'._('Show Stock Usage').'</a>'; +echo '<br><a href="'.$rootpath.'/SelectSalesOrder.php?SelectedStockItem='. $StockID .'&StockLocation=' . $_POST['StockLocation'] . '">'. _('Search Outstanding Sales Orders').'</a>'; +echo '<br><a href="'.$rootpath.'/SelectCompletedOrder.php?SelectedStockItem=' . $StockID .'">'._('Search Completed Sales Orders').'</a>'; echo '</div></form>'; include('includes/footer.inc'); Modified: trunk/StockDispatch.php =================================================================== --- trunk/StockDispatch.php 2011-04-02 09:40:49 UTC (rev 4536) +++ trunk/StockDispatch.php 2011-04-03 03:24:25 UTC (rev 4537) @@ -1,11 +1,10 @@ <?php /* $Id$*/ + // StockDispatch.php - Report of parts with overstock at one location that can be transferred // to another location to cover shortage based on reorder level. Creates loctransfer records // that can be processed using Bulk Inventory Transfer - Receive. - -//$PageSecurity = 2; include('includes/session.inc'); include('includes/SQL_CommonFunctions.inc'); If (isset($_POST['PrintPDF'])) { @@ -49,9 +48,9 @@ // Creates WHERE clause for stock categories. StockCat is defined as an array so can choose // more than one category - $wherecategory = " "; + $WhereCategory = " "; if ($_POST['StockCat'] != 'All') { - $wherecategory = " AND stockmaster.categoryid ='" . $_POST['StockCat'] . "' "; + $WhereCategory = " AND stockmaster.categoryid ='" . $_POST['StockCat'] . "' "; } @@ -82,7 +81,7 @@ AND (fromlocstock.quantity - fromlocstock.reorderlevel) > 0 AND stockcategory.stocktype<>'A' 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); @@ -236,13 +235,13 @@ if (!isset($_POST['FromLocation'])) { $_POST['FromLocation']=$DefaultLocation; } - echo '<table class=selection><tr><td>' . _('Dispatch Percent') . ":</td><td><input type ='text' name='Percent' class=number size='8' value=0>"; + echo '<table class=selection><tr><td>' . _('Dispatch Percent') . ':</td><td><input type ="text" name="Percent" class="number" size="8" value=0>'; echo '<tr><td>' . _('From Stock Location') . ':</td><td><select name="FromLocation"> '; while ($myrow=DB_fetch_array($resultStkLocs)){ if ($myrow['loccode'] == $_POST['FromLocation']){ - echo '<option selected Value="' . $myrow['loccode'] . '">' . $myrow['locationname']; + echo '<option selected Value="' . $myrow['loccode'] . '">' . $myrow['locationname'] . '</option>'; } else { - echo '<option Value="' . $myrow['loccode'] . '">' . $myrow['locationname']; + echo '<option Value="' . $myrow['loccode'] . '">' . $myrow['locationname'] . '</option>'; } } echo '</select></td></tr>'; @@ -253,60 +252,60 @@ echo '<tr><td>' . _('To Stock Location') . ':</td><td><select name="ToLocation"> '; while ($myrow=DB_fetch_array($resultStkLocs)){ if ($myrow['loccode'] == $_POST['ToLocation']){ - echo '<option selected Value="' . $myrow['loccode'] . '">' . $myrow['locationname']; + echo '<option selected Value="' . $myrow['loccode'] . '">' . $myrow['locationname'] . '</option>'; } else { - echo '<option Value="' . $myrow['loccode'] . '">' . $myrow['locationname']; + echo '<option Value="' . $myrow['loccode'] . '">' . $myrow['locationname'] . '</option>'; } } echo '</select></td></tr>'; - $SQL='SELECT categoryid, categorydescription FROM stockcategory WHERE stocktype<>"A" 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> </table> <p>'; prnMsg(_('There are no stock categories currently defined please use the link below to set them up'),'warn'); - echo '<br><a href="' . $rootpath . '/StockCategories.php?' . SID .'">' . _('Define Stock Categories') . '</a>'; + echo '<br><a href="' . $rootpath . '/StockCategories.php">' . _('Define Stock Categories') . '</a>'; include ('includes/footer.inc'); exit; } // Define StockCat with 'name="StockCat[ ]" multiple' so can select more than one - // Also have to change way define $wherecategory for WHERE clause + // Also have to change way define $WhereCategory for WHERE clause echo '<tr><td>' . _('In Stock Category') . ':</td><td><select name="StockCat">'; if (!isset($_POST['StockCat'])){ $_POST['StockCat']='All'; } if ($_POST['StockCat']=='All'){ - echo '<option selected value="All">' . _('All'); + echo '<option selected value="All">' . _('All') . '</option>'; } else { - echo '<option value="All">' . _('All'); + echo '<option value="All">' . _('All') . '</option>'; } while ($myrow1 = DB_fetch_array($result1)) { if ($myrow1['categoryid']==$_POST['StockCat']){ - echo '<option selected value="' . $myrow1['categoryid'] . '">' . $myrow1['categorydescription']; + echo '<option selected value="' . $myrow1['categoryid'] . '">' . $myrow1['categorydescription'] . '</option>'; } else { - echo '<option value="' . $myrow1['categoryid'] . '">' . $myrow1['categorydescription']; + echo '<option value="' . $myrow1['categoryid'] . '">' . $myrow1['categorydescription'] . '</option>'; } } echo '</select></td></tr>'; echo '<tr></tr><tr></tr><tr><td>' . _('Report Type') . ':</td>'; - echo "<td><select name='ReportType'>"; - echo "<option selected value='Batch'>" . _('Create Batch'); - echo "<option value='Report'>" . _('Report Only'); + echo '<td><select name="ReportType">'; + echo '<option selected value="Batch">' . _('Create Batch') . '</option>'; + echo '<option value="Report">' . _('Report Only') . '</option>'; echo '</select></td><td> </td></tr>'; echo '<tr><td>' . _('Template') . ':</td>'; - echo "<td><select name='template'>"; - echo "<option selected value='standard'>" . _('Standard'); - echo "<option value='simple'>" . _('Simple'); + echo '<td><select name="template">'; + echo '<option selected value="standard">' . _('Standard') . '</option>'; + echo '<option value="simple">' . _('Simple') . '</option>'; echo '</select></td><td> </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'); @@ -377,4 +376,4 @@ $FontSize=8; $PageNumber++; } // End of PrintHeader() function -?> +?> \ No newline at end of file Modified: trunk/StockTransfers.php =================================================================== --- trunk/StockTransfers.php 2011-04-02 09:40:49 UTC (rev 4536) +++ trunk/StockTransfers.php 2011-04-03 03:24:25 UTC (rev 4537) @@ -5,7 +5,6 @@ include('includes/DefineSerialItems.php'); include('includes/DefineStockTransfers.php'); -//$PageSecurity = 11; include('includes/session.inc'); $title = _('Stock Transfers'); @@ -18,16 +17,21 @@ '" alt="" />' . ' ' . _('Select Item to Transfer') . '</p>'; if (strlen($_POST['StockText'])>0) { - $sql='SELECT stockid, description from stockmaster where description like "%'.$_POST['StockText'].'%"'; + $sql="SELECT stockid, description from stockmaster where description like '%" . $_POST['StockText'] . "%'"; } else { - $sql='SELECT stockid, description from stockmaster where stockid like "%'.$_POST['StockCode'].'%"'; + $sql="SELECT stockid, description from stockmaster where stockid like '%" . $_POST['StockCode']."%'"; } $ErrMsg=_('The stock information cannot be retrieved because'); $DbgMsg=_('The SQL to get the stock description was'); $result = DB_query($sql,$db,$ErrMsg,$DbgMsg); - echo '<table class=selection><tr><th>'._('Stock Code').'</th><th>'._('Stock Description').'</th></tr>'; + echo '<table class=selection><tr><th>'._('Stock Code').'</th> + <th>'._('Stock Description').'</th> + </tr>'; while ($myrow = DB_fetch_row($result)) { - echo '<tr><td>'.$myrow[0].'</td><td>'.$myrow[1].'</td><td><a href="StockTransfers.php?StockID='.$myrow[0].'&Description='.$myrow[1].'">Transfer</a></tr>'; + echo '<tr><td>'.$myrow[0].'</td> + <td>'.$myrow[1].'</td> + <td><a href="StockTransfers.php?StockID='.$myrow[0].'&Description='.$myrow[1].'">Transfer</a></td> + </tr>'; } echo '</table>'; include('includes/footer.inc'); @@ -57,42 +61,42 @@ if ($NewTransfer){ $_SESSION['Transfer']= new StockTransfer(0, - $_POST['StockLocationFrom'], - '', - $_POST['StockLocationTo'], - '', - Date($_SESSION['DefaultDateFormat']) - ); + $_POST['StockLocationFrom'], + '', + $_POST['StockLocationTo'], + '', + Date($_SESSION['DefaultDateFormat']) + ); $result = DB_query("SELECT description, - units, - mbflag, - materialcost+labourcost+overheadcost as standardcost, - controlled, - serialised, - decimalplaces - FROM stockmaster - WHERE stockid='" . trim(strtoupper($_POST['StockID'])) . "'", - $db); + units, + mbflag, + materialcost+labourcost+overheadcost as standardcost, + controlled, + serialised, + decimalplaces + FROM stockmaster + WHERE stockid='" . trim(strtoupper($_POST['StockID'])) . "'", + $db); $myrow = DB_fetch_row($result); if (DB_num_rows($result) == 0){ prnMsg( _('Unable to locate Stock Code').' '.strtoupper($_POST['StockID']), 'error' ); } elseif (DB_num_rows($result)>0){ $_SESSION['Transfer']->TransferItem[0] = new LineItem ( trim(strtoupper($_POST['StockID'])), - $myrow[0], - $_POST['Quantity'], - $myrow[1], - $myrow[4], - $myrow[5], - $myrow[6]); + $myrow[0], + $_POST['Quantity'], + $myrow[1], + $myrow[4], + $myrow[5], + $myrow[6]); + - $_SESSION['Transfer']->TransferItem[0]->StandardCost = $myrow[3]; if ($myrow[2]=='D' OR $myrow[2]=='A' OR $myrow[2]=='K'){ prnMsg(_('The part entered is either or a dummy part or an assembly or a kit-set part') . '. ' . _('These parts are not physical parts and no stock holding is maintained for them') . '. ' . _('Stock Transfers are therefore not possible'),'warn'); echo '.<hr>'; - echo "<a href='" . $rootpath . '/StockTransfers.php?' . SID ."&NewTransfer=Yes'>" . _('Enter another Transfer') . '</a>'; + echo '<a href="' . $rootpath . '/StockTransfers.php?NewTransfer=Yes">' . _('Enter another Transfer') . '</a>'; unset ($_SESSION['Transfer']); include ('includes/footer.inc'); exit; @@ -373,8 +377,7 @@ } /*end if the transfer item is a controlled item */ - $SQL = "UPDATE locstock - SET quantity = quantity - '" . $_SESSION['Transfer']->TransferItem[0]->Quantity . "' + $SQL = "UPDATE locstock SET quantity = quantity - '" . $_SESSION['Transfer']->TransferItem[0]->Quantity . "' WHERE stockid='" . $_SESSION['Transfer']->TransferItem[0]->StockID . "' AND loccode='" . $_SESSION['Transfer']->StockLocationFrom . "'"; @@ -416,7 +419,7 @@ echo '<p class="page_title_text"><img src="'.$rootpath.'/css/'.$theme.'/images/supplier.png" title="' . _('Dispatch') . '" alt="" />' . ' ' . $title . '</p>'; -echo '<form action="'. $_SERVER['PHP_SELF'] . '?' . SID . '" method=post>'; +echo '<form action="'. $_SERVER['PHP_SELF'] . '" method=post>'; echo '<input type="hidden" name="FormID" value="' . $_SESSION['FormID'] . '" />'; //echo '<table> @@ -454,15 +457,15 @@ while ($myrow=DB_fetch_array($resultStkLocs)){ if (isset($_SESSION['Transfer']->StockLocationFrom)){ if ($myrow['loccode'] == $_SESSION['Transfer']->StockLocationFrom){ - echo '<option selected Value="' . $myrow['loccode'] . '">' . $myrow['locationname']; + echo '<option selected Value="' . $myrow['loccode'] . '">' . $myrow['locationname'] . '</option>'; } else { - echo '<option Value="' . $myrow['loccode'] . '">' . $myrow['locationname']; + echo '<option Value="' . $myrow['loccode'] . '">' . $myrow['locationname'] . '</option>'; } } elseif ($myrow['loccode']==$_SESSION['UserStockLocation']){ - echo '<option selected Value="' . $myrow['loccode'] . '">' . $myrow['locationname']; - $_SESSION['Transfer']->StockLocationFrom=$myrow['loccode']; + echo '<option selected Value="' . $myrow['loccode'] . '">' . $myrow['locationname'] . '</option>'; + $_SESSION['Transfer']->StockLocationFrom=$myrow['loccode'] . '</option>'; } else { - echo '<option Value="' . $myrow['loccode'] . '">' . $myrow['locationname']; + echo '<option Value="' . $myrow['loccode'] . '">' . $myrow['locationname'] . '</option>'; } } @@ -475,15 +478,15 @@ while ($myrow=DB_fetch_array($resultStkLocs)){ if (isset($_SESSION['Transfer']->StockLocationTo)){ if ($myrow['loccode'] == $_SESSION['Transfer']->StockLocationTo){ - echo '<option selected Value="' . $myrow['loccode'] . '">' . $myrow['locationname']; + echo '<option selected Value="' . $myrow['loccode'] . '">' . $myrow['locationname'] . '</option>'; } else { - echo '<option Value="' . $myrow['loccode'] . '">' . $myrow['locationname']; + echo '<option Value="' . $myrow['loccode'] . '">' . $myrow['locationname'] . '</option>'; } } elseif ($myrow['loccode']==$_SESSION['UserStockLocation']){ - echo '<option selected Value="' . $myrow['loccode'] . '">' . $myrow['locationname']; - $_SESSION['Transfer']->StockLocationTo=$myrow['loccode']; + echo '<option selected Value="' . $myrow['loccode'] . '">' . $myrow['locationname'] . '</option>'; + $_SESSION['Transfer']->StockLocationTo=$myrow['loccode'] . '</option>'; } else { - echo '<option Value="' . $myrow['loccode'] . '">' . $myrow['locationname']; + echo '<option Value="' . $myrow['loccode'] . '">' . $myrow['locationname'] . '</option>'; } } @@ -497,12 +500,12 @@ } if ($_SESSION['Transfer']->TransferItem[0]->Controlled==1){ - echo '<td class=number><input type=hidden name="Quantity" value=' . $_SESSION['Transfer']->TransferItem[0]->Quantity . '><a href="' . $rootpath .'/StockTransferControlled.php?' . SID . '">' . $_SESSION['Transfer']->TransferItem[0]->Quantity . '</a></td></tr>'; + echo '<td class=number><input type=hidden name="Quantity" value=' . $_SESSION['Transfer']->TransferItem[0]->Quantity . '><a href="' . $rootpath .'/StockTransferControlled.php">' . $_SESSION['Transfer']->TransferItem[0]->Quantity . '</a></td></tr>'; } else { - echo '<td><input type=text class="number" name="Quantity" size=12 maxlength=12 Value=' . $_SESSION['Transfer']->TransferItem[0]->Quantity . '></td></tr>'; + echo '<td><input type=text class="number" name="Quantity" size=12 maxlength=12 value=' . $_SESSION['Transfer']->TransferItem[0]->Quantity . '></td></tr>'; } -echo "</table><div class='centre'><br><input type=submit name='EnterTransfer' VALUE='" . _('Enter Stock Transfer') . "'><br>"; +echo '</table><div class="centre"><br /><input type="submit" name="EnterTransfer" value="' . _('Enter Stock Transfer') . '"><br />'; if (empty($_SESSION['Transfer']->TransferItem[0]->StockID) and isset($_POST['StockID'])) { $Stoc... [truncated message content] |