From: <dai...@us...> - 2011-03-28 09:49:36
|
Revision: 4520 http://web-erp.svn.sourceforge.net/web-erp/?rev=4520&view=rev Author: daintree Date: 2011-03-28 09:49:25 +0000 (Mon, 28 Mar 2011) Log Message: ----------- zh_HK and zh_CN fix up Modified Paths: -------------- trunk/AddCustomerContacts.php trunk/GoodsReceived.php trunk/UnitsOfMeasure.php trunk/locale/cs_CZ.utf8/LC_MESSAGES/messages.mo trunk/locale/cs_CZ.utf8/LC_MESSAGES/messages.po trunk/locale/de_DE.utf8/LC_MESSAGES/messages.mo trunk/locale/de_DE.utf8/LC_MESSAGES/messages.po trunk/locale/el_GR.utf8/LC_MESSAGES/messages.mo trunk/locale/el_GR.utf8/LC_MESSAGES/messages.po trunk/locale/en_GB.utf8/LC_MESSAGES/messages.pot trunk/locale/en_US.utf8/LC_MESSAGES/messages.mo trunk/locale/en_US.utf8/LC_MESSAGES/messages.po trunk/locale/es_ES.utf8/LC_MESSAGES/messages.mo trunk/locale/es_ES.utf8/LC_MESSAGES/messages.po trunk/locale/et_EE.utf8/LC_MESSAGES/messages.mo trunk/locale/et_EE.utf8/LC_MESSAGES/messages.po trunk/locale/fa_IR.utf8/LC_MESSAGES/messages.mo trunk/locale/fa_IR.utf8/LC_MESSAGES/messages.po trunk/locale/fr_FR.utf8/LC_MESSAGES/messages.mo trunk/locale/fr_FR.utf8/LC_MESSAGES/messages.po trunk/locale/hi_IN.utf8/LC_MESSAGES/messages.mo trunk/locale/hi_IN.utf8/LC_MESSAGES/messages.po trunk/locale/hr_HR.utf8/LC_MESSAGES/messages.mo trunk/locale/hr_HR.utf8/LC_MESSAGES/messages.po trunk/locale/hu_HU.utf8/LC_MESSAGES/messages.mo trunk/locale/hu_HU.utf8/LC_MESSAGES/messages.po trunk/locale/id_ID.utf8/LC_MESSAGES/messages.mo trunk/locale/id_ID.utf8/LC_MESSAGES/messages.po trunk/locale/it_IT.utf8/LC_MESSAGES/messages.mo trunk/locale/it_IT.utf8/LC_MESSAGES/messages.po trunk/locale/ja_JP.utf8/LC_MESSAGES/messages.mo trunk/locale/ja_JP.utf8/LC_MESSAGES/messages.po trunk/locale/lv_LV.utf8/LC_MESSAGES/messages.mo trunk/locale/lv_LV.utf8/LC_MESSAGES/messages.po trunk/locale/nl_NL.utf8/LC_MESSAGES/messages.mo trunk/locale/nl_NL.utf8/LC_MESSAGES/messages.po trunk/locale/pl_PL.utf8/LC_MESSAGES/messages.mo trunk/locale/pl_PL.utf8/LC_MESSAGES/messages.po trunk/locale/pt_BR.utf8/LC_MESSAGES/messages.mo trunk/locale/pt_BR.utf8/LC_MESSAGES/messages.po trunk/locale/pt_PT.utf8/LC_MESSAGES/messages.mo trunk/locale/pt_PT.utf8/LC_MESSAGES/messages.po trunk/locale/ro_RO.utf8/LC_MESSAGES/messages.mo trunk/locale/ro_RO.utf8/LC_MESSAGES/messages.po trunk/locale/ru_RU.utf8/LC_MESSAGES/messages.mo trunk/locale/ru_RU.utf8/LC_MESSAGES/messages.po trunk/locale/sq_AL.utf8/LC_MESSAGES/messages.mo trunk/locale/sq_AL.utf8/LC_MESSAGES/messages.po trunk/locale/sv_SE.utf8/LC_MESSAGES/messages.mo trunk/locale/sv_SE.utf8/LC_MESSAGES/messages.po trunk/locale/sw_KE.utf8/LC_MESSAGES/messages.mo trunk/locale/sw_KE.utf8/LC_MESSAGES/messages.po trunk/locale/tr_TR.utf8/LC_MESSAGES/messages.mo trunk/locale/tr_TR.utf8/LC_MESSAGES/messages.po trunk/locale/zh_CN.utf8/LC_MESSAGES/messages.mo trunk/locale/zh_CN.utf8/LC_MESSAGES/messages.po trunk/sql/mysql/weberp-demo.sql trunk/sql/mysql/weberp-new.sql Modified: trunk/AddCustomerContacts.php =================================================================== --- trunk/AddCustomerContacts.php 2011-03-27 01:50:33 UTC (rev 4519) +++ trunk/AddCustomerContacts.php 2011-03-28 09:49:25 UTC (rev 4520) @@ -1,7 +1,7 @@ <?php /* $Revision: 1.6 $ */ /* $Id$*/ -//$PageSecurity = 3; + include('includes/session.inc'); $title = _('Customer Contacts'); include('includes/header.inc'); @@ -18,7 +18,7 @@ $DebtorNo = $_GET['DebtorNo']; } echo "<a href='" . $rootpath . '/Customers.php?' . SID .'&DebtorNo='.$DebtorNo."'>" . _('Back to Customers') . '</a><br>'; -$SQLname='SELECT * from debtorsmaster where debtorno="'.$DebtorNo.'"'; +$SQLname="SELECT * from debtorsmaster where debtorno='" .$DebtorNo."'"; $Result = DB_query($SQLname,$db); $row = DB_fetch_array($Result); if (!isset($_GET['Id'])) { Modified: trunk/GoodsReceived.php =================================================================== --- trunk/GoodsReceived.php 2011-03-27 01:50:33 UTC (rev 4519) +++ trunk/GoodsReceived.php 2011-03-28 09:49:25 UTC (rev 4520) @@ -28,7 +28,7 @@ if (isset($_GET['PONumber']) and $_GET['PONumber']<=0 and !isset($_SESSION['PO'.$identifier])) { /* This page can only be called with a purchase order number for invoicing*/ - echo '<div class="centre"><a href= "' . $rootpath . '/PO_SelectOSPurchOrder.php?' . SID . '">'. + echo '<div class="centre"><a href= "' . $rootpath . '/PO_SelectOSPurchOrder.php">'. _('Select a purchase order to receive').'</a></div>'; echo '<br />'. _('This page can only be opened if a purchase order has been selected. Please select a purchase order first'); include ('includes/footer.inc'); @@ -65,7 +65,7 @@ _('Receive') . '" alt="" />' . ' ' . _('Receive Purchase Order') . ''; echo ' : '. $_SESSION['PO'.$identifier]->OrderNo .' '. _('from'). ' ' . $_SESSION['PO'.$identifier]->SupplierName . '</p>'; -echo '<form action="' . $_SERVER['PHP_SELF'] . '?' . SID . 'identifier=' . $identifier . '" method=post>'; +echo '<form action="' . $_SERVER['PHP_SELF'] . '?identifier=' . $identifier . '" method=post>'; echo '<input type="hidden" name="FormID" value="' . $_SESSION['FormID'] . '" />'; if (!isset($_POST['ProcessGoodsReceived'])) { @@ -83,7 +83,7 @@ <tr><th colspan="2"></th> <th align="centre" colspan="3"><b>' . _('Supplier Units') . '</b></th> <th></th> - <th align="centre" colspan="5"><b>' . _('Our Units') . '</b></th> + <th align="centre" colspan="5"><b>' . _('Our Receiving Units') . '</b></th> </tr> <tr><th>' . _('Item Code') . '</th> <th>' . _('Description') . '</th> @@ -209,9 +209,11 @@ } if ($OrderLine->ReceiveQty < 0 AND $_SESSION['ProhibitNegativeStock']==1){ - $SQL = "SELECT locstock.quantity FROM - locstock WHERE locstock.stockid='" . $OrderLine->StockID . "' - AND loccode= '" . $_SESSION['PO'.$identifier]->Location . "'"; + $SQL = "SELECT locstock.quantity + FROM locstock + WHERE locstock.stockid='" . $OrderLine->StockID . "' + AND loccode= '" . $_SESSION['PO'.$identifier]->Location . "'"; + $CheckNegResult = DB_query($SQL,$db); $CheckNegRow = DB_fetch_row($CheckNegResult); if ($CheckNegRow[0]+$OrderLine->ReceiveQty<0){ @@ -256,16 +258,16 @@ /*Now need to check that the order details are the same as they were when they were read into the Items array. If they've changed then someone else must have altered them */ // Otherwise if you try to fullfill item quantities separately will give error. $SQL = "SELECT itemcode, - glcode, - quantityord, - quantityrecd, - qtyinvoiced, - shiptref, - jobref - FROM purchorderdetails - WHERE orderno='" . (int) $_SESSION['PO'.$identifier]->OrderNo . "' - AND completed=0 - ORDER BY podetailitem"; + glcode, + quantityord, + quantityrecd, + qtyinvoiced, + shiptref, + jobref + FROM purchorderdetails + WHERE orderno='" . (int) $_SESSION['PO'.$identifier]->OrderNo . "' + AND completed=0 + ORDER BY podetailitem"; $ErrMsg = _('CRITICAL ERROR') . '! ' . _('NOTE DOWN THIS ERROR AND SEEK ASSISTANCE') . ': ' . _('Could not check that the details of the purchase order had not been changed by another user because'). ':'; $DbgMsg = _('The following SQL to retrieve the purchase order details was used'); @@ -404,21 +406,21 @@ /*Need to insert a GRN item */ $SQL = "INSERT INTO grns (grnbatch, - podetailitem, - itemcode, - itemdescription, - deliverydate, - qtyrecd, - supplierid, - stdcostunit) - VALUES ('" . $GRN . "', - '" . $OrderLine->PODetailRec . "', - '" . $OrderLine->StockID . "', - '" . $OrderLine->ItemDescription . "', - '" . $_POST['DefaultReceivedDate'] . "', - '" . $OrderLine->ReceiveQty . "', - '" . $_SESSION['PO'.$identifier]->SupplierID . "', - '" . $CurrentStandardCost . "')"; + podetailitem, + itemcode, + itemdescription, + deliverydate, + qtyrecd, + supplierid, + stdcostunit) + VALUES ('" . $GRN . "', + '" . $OrderLine->PODetailRec . "', + '" . $OrderLine->StockID . "', + '" . $OrderLine->ItemDescription . "', + '" . $_POST['DefaultReceivedDate'] . "', + '" . $OrderLine->ReceiveQty . "', + '" . $_SESSION['PO'.$identifier]->SupplierID . "', + '" . $CurrentStandardCost . "')"; $ErrMsg = _('CRITICAL ERROR') . '! ' . _('NOTE DOWN THIS ERROR AND SEEK ASSISTANCE') . ': ' . _('A GRN record could not be inserted') . '. ' . _('This receipt of goods has not been processed because'); $DbgMsg = _('The following SQL to insert the GRN record was used'); @@ -455,29 +457,29 @@ /* Insert stock movements - with unit cost */ $SQL = "INSERT INTO stockmoves (stockid, - type, - transno, - loccode, - trandate, - price, - prd, - reference, - qty, - standardcost, - newqoh) - VALUES ( - '" . $OrderLine->StockID . "', - 25, - '" . $GRN . "', - '" . $_SESSION['PO'.$identifier]->Location . "', - '" . $_POST['DefaultReceivedDate'] . "', - '" . $LocalCurrencyPrice . "', - '" . $PeriodNo . "', - '" . $_SESSION['PO'.$identifier]->SupplierID . " (" . $_SESSION['PO'.$identifier]->SupplierName . ") - " .$_SESSION['PO'.$identifier]->OrderNo . "', - '" . $OrderLine->ReceiveQty . "', - '" . $_SESSION['PO'.$identifier]->LineItems[$OrderLine->LineNo]->StandardCost . "', - '" . ($QtyOnHandPrior + $OrderLine->ReceiveQty) . "' - )"; + type, + transno, + loccode, + trandate, + price, + prd, + reference, + qty, + standardcost, + newqoh) + VALUES ( + '" . $OrderLine->StockID . "', + 25, + '" . $GRN . "', + '" . $_SESSION['PO'.$identifier]->Location . "', + '" . $_POST['DefaultReceivedDate'] . "', + '" . $LocalCurrencyPrice . "', + '" . $PeriodNo . "', + '" . $_SESSION['PO'.$identifier]->SupplierID . " (" . $_SESSION['PO'.$identifier]->SupplierName . ") - " .$_SESSION['PO'.$identifier]->OrderNo . "', + '" . $OrderLine->ReceiveQty . "', + '" . $_SESSION['PO'.$identifier]->LineItems[$OrderLine->LineNo]->StandardCost . "', + '" . ($QtyOnHandPrior + $OrderLine->ReceiveQty) . "' + )"; $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'); @@ -684,7 +686,7 @@ echo '<br /><div class=centre>'. _('GRN number'). ' '. $GRN .' '. _('has been processed').'<br />'; echo '<br /><a href=PDFGrn.php?GRNNo='.$GRN .'&PONo='.$PONo.'>'. _('Print this Goods Received Note (GRN)').'</a><br /><br />'; - echo '<a href="' . $rootpath . '/PO_SelectOSPurchOrder.php?' . SID . '">' . + echo '<a href="' . $rootpath . '/PO_SelectOSPurchOrder.php">' . _('Select a different purchase order for receiving goods against'). '</a></div>'; /*end of process goods received entry */ include('includes/footer.inc'); @@ -692,7 +694,7 @@ } else { /*Process Goods received not set so show a link to allow mod of line items on order and allow input of date goods received*/ - echo '<br /><div class="centre"><a href="' . $rootpath . '/PO_Items.php">' . _('Modify Order Items'). '</a></div>'; + echo '<br /><div class="centre"><a href="' . $rootpath . '/PO_Header.php?ModifyOrderNumber=' .$_SESSION['PO'.$identifier]->OrderNo . '">' . _('Modify Order Items'). '</a></div>'; echo '<br /><div class="centre"><input type=submit name=Update Value=' . _('Update') . '><p>'; echo '<input type=submit name="ProcessGoodsReceived" Value="' . _('Process Goods Received') . '"></div>'; Modified: trunk/UnitsOfMeasure.php =================================================================== --- trunk/UnitsOfMeasure.php 2011-03-27 01:50:33 UTC (rev 4519) +++ trunk/UnitsOfMeasure.php 2011-03-28 09:49:25 UTC (rev 4520) @@ -64,9 +64,6 @@ $sql[] = "UPDATE stockmaster SET units='" . $_POST['MeasureName'] . "' WHERE units ".LIKE." '" . $OldMeasureName . "'"; - $sql[] = "UPDATE contracts - SET units='" . $_POST['MeasureName'] . "' - WHERE units ".LIKE." '" . $OldMeasureName . "'"; } else { $InputError = 1; prnMsg( _('The unit of measure no longer exist.'),'error'); Modified: trunk/locale/cs_CZ.utf8/LC_MESSAGES/messages.mo =================================================================== (Binary files differ) Modified: trunk/locale/cs_CZ.utf8/LC_MESSAGES/messages.po =================================================================== --- trunk/locale/cs_CZ.utf8/LC_MESSAGES/messages.po 2011-03-27 01:50:33 UTC (rev 4519) +++ trunk/locale/cs_CZ.utf8/LC_MESSAGES/messages.po 2011-03-28 09:49:25 UTC (rev 4520) @@ -7,7 +7,7 @@ msgstr "" "Project-Id-Version: webERP 3.08\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2011-03-26 16:22+1200\n" +"POT-Creation-Date: 2011-03-27 19:34+1200\n" "PO-Revision-Date: 2010-07-25 17:04+0000\n" "Last-Translator: Tim Schofield <ti...@we...>\n" "Language-Team: Czech <cs...@li...>\n" @@ -266,12 +266,12 @@ #: CustomerBranches.php:420 Customers.php:600 Customers.php:857 #: Customers.php:864 Customers.php:867 DeliveryDetails.php:1034 #: DeliveryDetails.php:1074 DeliveryDetails.php:1077 GLTransInquiry.php:73 -#: MRPCalendar.php:222 MRP.php:530 MRP.php:534 MRP.php:538 MRP.php:542 +#: MRPCalendar.php:222 MRP.php:529 MRP.php:533 MRP.php:537 MRP.php:541 #: PaymentMethods.php:203 PaymentMethods.php:204 PaymentMethods.php:264 #: PaymentMethods.php:270 PDFChequeListing.php:63 #: PDFDeliveryDifferences.php:64 PDFDIFOT.php:67 #: PO_AuthorisationLevels.php:132 PO_AuthorisationLevels.php:137 -#: PO_Header.php:758 PO_PDFPurchOrder.php:344 PO_PDFPurchOrder.php:347 +#: PO_Header.php:754 PO_PDFPurchOrder.php:344 PO_PDFPurchOrder.php:347 #: PurchData.php:192 PurchData.php:494 PurchData.php:497 #: RecurringSalesOrders.php:483 RecurringSalesOrders.php:486 #: SalesAnalReptCols.php:279 SalesAnalReptCols.php:401 @@ -301,12 +301,12 @@ #: CustomerBranches.php:420 Customers.php:599 Customers.php:855 #: Customers.php:863 Customers.php:866 DeliveryDetails.php:1035 #: DeliveryDetails.php:1075 DeliveryDetails.php:1078 GLTransInquiry.php:127 -#: MRPCalendar.php:224 MRP.php:528 MRP.php:532 MRP.php:536 MRP.php:540 +#: MRPCalendar.php:224 MRP.php:527 MRP.php:531 MRP.php:535 MRP.php:539 #: PaymentMethods.php:203 PaymentMethods.php:204 PaymentMethods.php:265 #: PaymentMethods.php:271 PDFChequeListing.php:62 #: PDFDeliveryDifferences.php:63 PDFDIFOT.php:66 #: PO_AuthorisationLevels.php:134 PO_AuthorisationLevels.php:139 -#: PO_Header.php:757 PO_PDFPurchOrder.php:345 PO_PDFPurchOrder.php:348 +#: PO_Header.php:753 PO_PDFPurchOrder.php:345 PO_PDFPurchOrder.php:348 #: PurchData.php:195 PurchData.php:495 PurchData.php:498 #: RecurringSalesOrders.php:482 RecurringSalesOrders.php:485 #: SalesAnalReptCols.php:277 SalesAnalReptCols.php:402 @@ -367,7 +367,7 @@ #: Payments.php:958 PaymentTerms.php:204 PcAssignCashToTab.php:255 #: PcClaimExpensesFromTab.php:230 PcExpenses.php:187 PcExpensesTypeTab.php:164 #: PcTabs.php:189 PcTypeTabs.php:175 PO_AuthorisationLevels.php:150 -#: PO_Items.php:764 Prices_Customer.php:284 Prices.php:228 PurchData.php:208 +#: PO_Items.php:762 Prices_Customer.php:284 Prices.php:228 PurchData.php:208 #: SalesAnalReptCols.php:294 SalesAnalRepts.php:305 SalesCategories.php:264 #: SalesGLPostings.php:136 SalesGLPostings.php:248 SalesPeople.php:211 #: SalesTypes.php:207 SelectCreditItems.php:745 SelectCustomer.php:611 @@ -535,7 +535,7 @@ #: AddCustomerTypeNotes.php:49 Areas.php:74 CustomerTypes.php:71 #: DeliveryDetails.php:748 Factors.php:117 FixedAssetItems.php:236 #: PcAssignCashToTab.php:73 PcClaimExpensesFromTab.php:61 PcExpenses.php:70 -#: PcTabs.php:60 PcTypeTabs.php:62 PO_Items.php:413 SalesAnalReptCols.php:129 +#: PcTabs.php:60 PcTypeTabs.php:62 PO_Items.php:411 SalesAnalReptCols.php:129 #: SalesPeople.php:94 SalesTypes.php:63 Stocks.php:353 Suppliers.php:514 #: SupplierTypes.php:69 msgid "has been updated" @@ -591,7 +591,7 @@ msgstr "Jméno kontaktní osoby" #: AddCustomerContacts.php:196 Contracts.php:777 PDFRemittanceAdvice.php:247 -#: PO_Header.php:958 PO_Header.php:1028 SelectCreditItems.php:223 +#: PO_Header.php:956 PO_Header.php:1026 SelectCreditItems.php:223 #: SelectCustomer.php:464 SelectOrderItems.php:639 #: includes/PDFStatementPageHeader.inc:63 includes/PDFTransPageHeader.inc:117 #: includes/PDFTransPageHeaderPortrait.inc:105 @@ -824,8 +824,8 @@ msgstr "Podrobnosti o nesplacených transakcí pro zákazníka" #: AgedDebtors.php:367 AgedSuppliers.php:189 GLAccountCSV.php:169 -#: GLAccountInquiry.php:145 GLAccountReport.php:93 PO_Items.php:473 -#: PO_Items.php:607 PO_Items.php:634 SalesAnalReptCols.php:356 +#: GLAccountInquiry.php:145 GLAccountReport.php:93 PO_Items.php:471 +#: PO_Items.php:605 PO_Items.php:632 SalesAnalReptCols.php:356 #: SpecialOrder.php:369 StockLocTransferReceive.php:373 #: StockQuantityByDate.php:114 includes/SelectOrderItems_IntoCart.inc:53 msgid "could not be retrieved because" @@ -854,7 +854,7 @@ #: includes/PDFPaymentRun_PymtFooter.php:89 #: includes/PDFPaymentRun_PymtFooter.php:118 #: includes/PDFPaymentRun_PymtFooter.php:154 -#: includes/PDFPaymentRun_PymtFooter.php:185 includes/ConnectDB_mysqli.inc:86 +#: includes/PDFPaymentRun_PymtFooter.php:185 includes/ConnectDB_mysqli.inc:79 #: includes/ConnectDB_mysql.inc:68 msgid "The SQL that failed was" msgstr "SQL příkaz, který selhal, byl" @@ -1824,7 +1824,7 @@ #: InventoryQuantities.php:210 MRPPlannedPurchaseOrders.php:305 #: MRPPlannedWorkOrders.php:367 MRPReport.php:826 MRPReschedules.php:190 #: MRPShortages.php:283 PDFOrderStatus.php:299 PDFPriceList.php:331 -#: PDFReceipt.php:32 PO_Header.php:792 PO_PDFPurchOrder.php:59 +#: PDFReceipt.php:32 PO_Header.php:789 PO_PDFPurchOrder.php:59 #: PO_SelectOSPurchOrder.php:476 ReorderLevel.php:251 StockDispatch.php:337 #: SuppPriceList.php:254 Tax.php:252 includes/PDFAgedDebtorsPageHeader.inc:34 #: includes/PDFAgedSuppliersPageHeader.inc:21 @@ -2006,7 +2006,7 @@ #: MRPShortages.php:299 PaymentTerms.php:180 PcExpenses.php:159 #: PcExpenses.php:248 PcExpensesTypeTab.php:148 PcReportTab.php:174 #: PcTypeTabs.php:158 PDFOrdersInvoiced.php:345 PDFOrderStatus.php:313 -#: PDFPrintLabel.php:239 PO_Items.php:715 PO_Items.php:1042 +#: PDFPrintLabel.php:239 PO_Items.php:713 PO_Items.php:1046 #: PO_SelectOSPurchOrder.php:213 PO_SelectPurchOrder.php:178 #: PricesByCost.php:119 ReorderLevelLocation.php:55 ReorderLevel.php:266 #: ReverseGRN.php:377 SalesCategories.php:427 SelectAsset.php:225 @@ -2112,7 +2112,7 @@ #: CustomerReceipt.php:1029 CustomerReceipt.php:1032 #: DiscountCategories.php:103 DiscountCategories.php:106 #: FixedAssetTransfer.php:61 MRPDemands.php:330 MRPDemands.php:333 -#: MRPReport.php:563 PO_Header.php:516 PO_Items.php:1021 PO_Items.php:1026 +#: MRPReport.php:563 PO_Header.php:516 PO_Items.php:1025 PO_Items.php:1030 #: PO_SelectOSPurchOrder.php:202 PO_SelectPurchOrder.php:170 PurchData.php:264 #: SelectAsset.php:93 SelectCompletedOrder.php:518 SelectCreditItems.php:208 #: SelectCreditItems.php:942 SelectCustomer.php:331 SelectCustomer.php:337 @@ -2145,7 +2145,7 @@ #: BOMInquiry.php:26 BOMs.php:803 ContractBOM.php:331 Contracts.php:766 #: CounterSales.php:2142 CustomerReceipt.php:1037 FixedAssetTransfer.php:72 -#: MRPDemands.php:335 MRPReport.php:571 PO_Header.php:521 PO_Items.php:1029 +#: MRPDemands.php:335 MRPReport.php:571 PO_Header.php:521 PO_Items.php:1033 #: SelectAsset.php:101 SelectCreditItems.php:213 SelectCreditItems.php:947 #: SelectCustomer.php:419 SelectGLAccount.php:98 SelectOrderItems.php:627 #: SelectOrderItems.php:1596 SelectProduct.php:508 SelectSupplier.php:212 @@ -2155,7 +2155,7 @@ msgstr "Vyhledat" #: BOMInquiry.php:36 BOMs.php:738 ContractBOM.php:51 MRPDemands.php:57 -#: MRPReport.php:589 PO_Items.php:826 PO_SelectOSPurchOrder.php:64 +#: MRPReport.php:589 PO_Items.php:824 PO_SelectOSPurchOrder.php:64 #: PO_SelectPurchOrder.php:43 SelectCompletedOrder.php:95 #: SelectCreditItems.php:276 SelectProduct.php:521 SelectSalesOrder.php:348 #: SelectWorkOrder.php:35 Shipt_Select.php:62 SupplierTenders.php:378 @@ -2185,7 +2185,7 @@ #: CustomerReceipt.php:1043 GLCodesInquiry.php:28 MRPDemands.php:91 #: MRPPlannedWorkOrders.php:257 MRPReport.php:759 PDFOrdersInvoiced.php:344 #: PDFOrderStatus.php:312 PDFPrintLabel.php:239 PO_Header.php:531 -#: PO_Items.php:1041 PO_SelectOSPurchOrder.php:212 PO_SelectPurchOrder.php:177 +#: PO_Items.php:1045 PO_SelectOSPurchOrder.php:212 PO_SelectPurchOrder.php:177 #: PricesByCost.php:118 PurchData.php:338 ReorderLevelLocation.php:54 #: ReorderLevelLocation.php:203 SalesPeople.php:184 #: SelectCompletedOrder.php:534 SelectCreditItems.php:220 @@ -2202,7 +2202,7 @@ #: BOMInquiry.php:95 BOMs.php:812 ConfirmDispatch_Invoice.php:271 #: ContractBOM.php:345 CounterSales.php:1989 CounterSales.php:2169 #: Credit_Invoice.php:273 GoodsReceived.php:91 GoodsReceived.php:95 -#: MRPReport.php:762 OffersReceived.php:95 PO_Items.php:1044 +#: MRPReport.php:762 OffersReceived.php:95 PO_Items.php:1049 #: PO_SelectOSPurchOrder.php:216 PO_SelectPurchOrder.php:181 #: SelectCompletedOrder.php:539 SelectCreditItems.php:957 #: SelectOrderItems.php:1437 SelectOrderItems.php:1621 SelectProduct.php:108 @@ -2528,7 +2528,7 @@ msgstr "Úroveň" #: BOMs.php:519 BOMs.php:636 Contracts.php:868 FixedAssetRegister.php:83 -#: InventoryQuantities.php:223 Locations.php:328 MRP.php:549 MRP.php:563 +#: InventoryQuantities.php:223 Locations.php:328 MRP.php:548 MRP.php:562 #: PDFOrdersInvoiced.php:306 PDFOrderStatus.php:272 #: ReorderLevelLocation.php:173 ReorderLevel.php:258 ReorderLevel.php:267 #: StockCounts.php:133 StockReorderLevel.php:49 StockSerialItemResearch.php:78 @@ -2871,8 +2871,8 @@ #: CompanyPreferences.php:472 ConfirmDispatch_Invoice.php:626 #: ConfirmDispatch_Invoice.php:1658 Credit_Invoice.php:1529 #: FixedAssetItems.php:123 FixedAssetItems.php:570 GLBudgets.php:219 -#: GLTags.php:44 GoodsReceived.php:228 GoodsReceived.php:234 -#: GoodsReceived.php:241 GoodsReceived.php:697 Labels.php:262 +#: GLTags.php:44 GoodsReceived.php:230 GoodsReceived.php:236 +#: GoodsReceived.php:243 GoodsReceived.php:699 Labels.php:262 #: MRPCalendar.php:309 Payments.php:852 PcAuthorizeExpenses.php:262 #: PO_AuthoriseMyOrders.php:125 PricesByCost.php:188 PurchData.php:502 #: ReorderLevelLocation.php:156 SelectCreditItems.php:898 SMTPServer.php:63 @@ -3050,7 +3050,7 @@ #: ConfirmDispatch_Invoice.php:268 ContractBOM.php:241 ContractCosting.php:72 #: ContractCosting.php:78 Contracts.php:930 CounterSales.php:699 #: CounterSales.php:2301 Credit_Invoice.php:270 DeliveryDetails.php:783 -#: GoodsReceived.php:88 OrderDetails.php:153 PO_Items.php:714 +#: GoodsReceived.php:88 OrderDetails.php:153 PO_Items.php:712 #: PO_OrderDetails.php:142 PrintCustTrans.php:648 PrintCustTrans.php:711 #: PrintCustTrans.php:749 PrintCustTransPortrait.php:827 #: PrintCustTransPortrait.php:910 PrintCustTransPortrait.php:954 @@ -3075,7 +3075,7 @@ #: ConfirmDispatch_Invoice.php:269 ContractCosting.php:73 #: ContractCosting.php:79 Contracts.php:931 CounterSales.php:700 #: Credit_Invoice.php:271 DeliveryDetails.php:784 DeliveryDetails.php:849 -#: OrderDetails.php:154 PO_Items.php:782 PO_OrderDetails.php:143 +#: OrderDetails.php:154 PO_Items.php:780 PO_OrderDetails.php:143 #: PrintCustTrans.php:649 PrintCustTrans.php:712 PrintCustTrans.php:750 #: PrintCustTransPortrait.php:828 PrintCustTransPortrait.php:911 #: PrintCustTransPortrait.php:955 RecurringSalesOrders.php:321 @@ -3321,12 +3321,12 @@ msgstr "Prosím nápravě tohoto" #: ConfirmDispatch_Invoice.php:653 Credit_Invoice.php:484 -#: GoodsReceived.php:251 +#: GoodsReceived.php:253 msgid "The company information and preferences could not be retrieved" msgstr "Informace o společnosti a preference se nepodařilo získat" #: ConfirmDispatch_Invoice.php:653 Credit_Invoice.php:484 -#: GoodsReceived.php:251 +#: GoodsReceived.php:253 msgid "see your system administrator" msgstr "kontaktujte administrátora" @@ -3346,7 +3346,7 @@ "Tento příkaz byl změněn nebo fakturovány, protože tato dodávka byla zahájena " "bude potvrzeno" -#: ConfirmDispatch_Invoice.php:681 GoodsReceived.php:288 +#: ConfirmDispatch_Invoice.php:681 GoodsReceived.php:290 msgid "Processing halted" msgstr "Zpracování zastaveno" @@ -3437,10 +3437,10 @@ #: Credit_Invoice.php:1070 Credit_Invoice.php:1093 Credit_Invoice.php:1264 #: Credit_Invoice.php:1304 Credit_Invoice.php:1331 Credit_Invoice.php:1352 #: Credit_Invoice.php:1381 Credit_Invoice.php:1407 Credit_Invoice.php:1433 -#: GoodsReceived.php:270 GoodsReceived.php:351 GoodsReceived.php:393 -#: GoodsReceived.php:423 GoodsReceived.php:451 GoodsReceived.php:482 -#: GoodsReceived.php:500 GoodsReceived.php:529 GoodsReceived.php:546 -#: GoodsReceived.php:634 GoodsReceived.php:659 PDFStockCheckComparison.php:122 +#: GoodsReceived.php:272 GoodsReceived.php:353 GoodsReceived.php:395 +#: GoodsReceived.php:425 GoodsReceived.php:453 GoodsReceived.php:484 +#: GoodsReceived.php:502 GoodsReceived.php:531 GoodsReceived.php:548 +#: GoodsReceived.php:636 GoodsReceived.php:661 PDFStockCheckComparison.php:122 #: PDFStockCheckComparison.php:130 PDFStockCheckComparison.php:137 #: PDFStockCheckComparison.php:156 PDFStockCheckComparison.php:175 #: RecurringSalesOrdersProcess.php:321 RecurringSalesOrdersProcess.php:361 @@ -3546,11 +3546,11 @@ #: Credit_Invoice.php:990 Credit_Invoice.php:1029 Credit_Invoice.php:1070 #: Credit_Invoice.php:1093 Credit_Invoice.php:1264 Credit_Invoice.php:1304 #: Credit_Invoice.php:1331 Credit_Invoice.php:1352 Credit_Invoice.php:1381 -#: Credit_Invoice.php:1407 Credit_Invoice.php:1433 GoodsReceived.php:270 -#: GoodsReceived.php:351 GoodsReceived.php:393 GoodsReceived.php:423 -#: GoodsReceived.php:451 GoodsReceived.php:482 GoodsReceived.php:500 -#: GoodsReceived.php:529 GoodsReceived.php:546 GoodsReceived.php:634 -#: GoodsReceived.php:659 PDFStockCheckComparison.php:122 +#: Credit_Invoice.php:1407 Credit_Invoice.php:1433 GoodsReceived.php:272 +#: GoodsReceived.php:353 GoodsReceived.php:395 GoodsReceived.php:425 +#: GoodsReceived.php:453 GoodsReceived.php:484 GoodsReceived.php:502 +#: GoodsReceived.php:531 GoodsReceived.php:548 GoodsReceived.php:636 +#: GoodsReceived.php:661 PDFStockCheckComparison.php:122 #: PDFStockCheckComparison.php:130 PDFStockCheckComparison.php:137 #: PDFStockCheckComparison.php:156 PDFStockCheckComparison.php:175 #: RecurringSalesOrdersProcess.php:321 RecurringSalesOrdersProcess.php:361 @@ -3701,7 +3701,7 @@ msgstr "Umístění skladové evidenci nelze aktualizovat, protože" #: ConfirmDispatch_Invoice.php:950 ContractCosting.php:306 -#: CounterSales.php:1304 Credit_Invoice.php:684 GoodsReceived.php:452 +#: CounterSales.php:1304 Credit_Invoice.php:684 GoodsReceived.php:454 #: ReverseGRN.php:220 SelectCreditItems.php:1360 StockTransfers.php:382 #: StockTransfers.php:392 WorkOrderIssue.php:163 WorkOrderReceive.php:320 #: WorkOrderReceive.php:426 @@ -3789,7 +3789,7 @@ #: ConfirmDispatch_Invoice.php:1119 ContractCosting.php:335 #: CounterSales.php:1474 Credit_Invoice.php:892 Credit_Invoice.php:991 -#: Credit_Invoice.php:1030 GoodsReceived.php:483 +#: Credit_Invoice.php:1030 GoodsReceived.php:485 #: RecurringSalesOrdersProcess.php:362 ReverseGRN.php:249 #: SelectCreditItems.php:1254 WorkOrderIssue.php:194 WorkOrderReceive.php:349 #: WorkOrderReceive.php:456 @@ -3828,7 +3828,7 @@ msgstr "Následující SQL aktualizovat sériové skladě záznam byl použit" #: ConfirmDispatch_Invoice.php:1172 Credit_Invoice.php:946 -#: GoodsReceived.php:546 SelectCreditItems.php:1338 StockAdjustments.php:226 +#: GoodsReceived.php:548 SelectCreditItems.php:1338 StockAdjustments.php:226 #: StockLocTransferReceive.php:172 StockLocTransferReceive.php:285 #: StockTransfers.php:260 StockTransfers.php:368 WorkOrderIssue.php:230 #: WorkOrderIssue.php:285 WorkOrderReceive.php:507 WorkOrderReceive.php:578 @@ -3836,7 +3836,7 @@ msgstr "Sériové fotografie hnutí záznam nemůže být vložen, protože" #: ConfirmDispatch_Invoice.php:1173 Credit_Invoice.php:947 -#: GoodsReceived.php:547 StockAdjustments.php:227 +#: GoodsReceived.php:549 StockAdjustments.php:227 #: StockLocTransferReceive.php:173 StockLocTransferReceive.php:286 #: StockTransfers.php:261 StockTransfers.php:369 WorkOrderIssue.php:231 #: WorkOrderIssue.php:286 WorkOrderReceive.php:508 WorkOrderReceive.php:579 @@ -3949,7 +3949,7 @@ msgid "The fixed asset transaction could not be inserted because" msgstr "Dlouhodobého majetku transakce nemůže být vložen, protože" -#: ConfirmDispatch_Invoice.php:1509 GoodsReceived.php:584 ReverseGRN.php:176 +#: ConfirmDispatch_Invoice.php:1509 GoodsReceived.php:586 ReverseGRN.php:176 #: SupplierCredit.php:1195 SupplierCredit.php:1283 SupplierInvoice.php:1182 #: SupplierInvoice.php:1267 msgid "The following SQL to insert the fixed asset transaction record was used" @@ -4096,18 +4096,18 @@ msgid "to continue" msgstr "pro pokračování" -#: ContractBOM.php:143 CounterSales.php:327 PO_Items.php:966 +#: ContractBOM.php:143 CounterSales.php:327 PO_Items.php:970 #: SelectCreditItems.php:368 SelectOrderItems.php:856 SupplierTenders.php:469 #: WorkOrderEntry.php:151 WorkOrderIssue.php:469 msgid "There is a problem selecting the part records to display because" msgstr "To je problém výběru část záznamy k zobrazení, protože" -#: ContractBOM.php:144 PO_Items.php:967 SupplierTenders.php:470 +#: ContractBOM.php:144 PO_Items.php:971 SupplierTenders.php:470 #: Z_ChangeStockCategory.php:63 Z_ChangeStockCode.php:95 msgid "The SQL statement that failed was" msgstr "Příkazu SQL, který byl neúspěšný" -#: ContractBOM.php:148 PO_Items.php:971 SupplierTenders.php:474 +#: ContractBOM.php:148 PO_Items.php:975 SupplierTenders.php:474 msgid "There are no products to display matching the criteria provided" msgstr "Nejsou žádné výrobky k zobrazení odpovídající kritériím stanoveným" @@ -4118,7 +4118,7 @@ msgstr "" "Smlouvu kusovníku nelze alterned, protože zákazník má již umístěn objednávky" -#: ContractBOM.php:185 PO_Items.php:587 +#: ContractBOM.php:185 PO_Items.php:585 #: includes/SelectOrderItems_IntoCart.inc:26 #: includes/SelectOrderItems_IntoCart.inc:63 msgid "The item" @@ -4138,11 +4138,11 @@ msgid "The item details could not be retrieved" msgstr "Položku Podrobnosti se nepodařilo získat" -#: ContractBOM.php:201 PO_Items.php:608 SelectCreditItems.php:600 +#: ContractBOM.php:201 PO_Items.php:606 SelectCreditItems.php:600 msgid "The SQL used to retrieve the item details but failed was" msgstr "SQL používá k načtení položky detaily, ale nepodařilo se" -#: ContractBOM.php:213 CounterSales.php:422 PO_Items.php:685 +#: ContractBOM.php:213 CounterSales.php:422 PO_Items.php:683 #: SelectOrderItems.php:950 includes/SelectOrderItems_IntoCart.inc:58 #: includes/SelectOrderItems_IntoCart.inc:162 msgid "The item code" @@ -4180,24 +4180,24 @@ msgid "Back To Contract Header" msgstr "Zpět na záhlaví smlouvy" -#: ContractBOM.php:290 PO_Items.php:989 +#: ContractBOM.php:290 PO_Items.php:993 msgid "The supplier category details could not be retrieved because" msgstr "Podrobnosti dodavatel kategorie se nepodařilo získat, protože" -#: ContractBOM.php:291 PO_Items.php:990 +#: ContractBOM.php:291 PO_Items.php:994 msgid "The SQL used to retrieve the category details but failed was" msgstr "SQL používá k načtení kategorii detaily, ale nepodařilo se" -#: ContractBOM.php:294 PO_Items.php:993 +#: ContractBOM.php:294 PO_Items.php:997 msgid "Search For Stock Items" msgstr "Hledat na sklade" #: ContractBOM.php:299 CounterSales.php:2113 CounterSales.php:2116 #: DailySalesInquiry.php:44 DailySalesInquiry.php:46 FixedAssetRegister.php:56 #: FixedAssetRegister.php:65 InventoryQuantities.php:155 -#: InventoryQuantities.php:176 InventoryQuantities.php:178 MRP.php:565 +#: InventoryQuantities.php:176 InventoryQuantities.php:178 MRP.php:564 #: MRPReport.php:544 MRPReport.php:546 MRPReschedules.php:161 -#: PDFPriceList.php:194 PDFPrintLabel.php:240 PO_Items.php:997 +#: PDFPriceList.php:194 PDFPrintLabel.php:240 PO_Items.php:1001 #: POReport.php:1486 ReorderLevel.php:187 ReorderLevel.php:189 #: ReorderLevel.php:217 ReorderLevel.php:219 SalesGraph.php:91 #: SalesGraph.php:93 SalesGraph.php:111 SalesGraph.php:113 SalesGraph.php:134 @@ -4214,18 +4214,18 @@ msgid "All" msgstr "Všechny" -#: ContractBOM.php:320 PO_Items.php:1018 SelectCompletedOrder.php:515 +#: ContractBOM.php:320 PO_Items.php:1022 SelectCompletedOrder.php:515 #: SelectCreditItems.php:939 msgid "Enter text extracts in the description" msgstr "Zadejte text extrakty v popisu" -#: ContractBOM.php:323 CounterSales.php:2138 PO_Items.php:1021 +#: ContractBOM.php:323 CounterSales.php:2138 PO_Items.php:1025 #: SelectCompletedOrder.php:518 SelectCreditItems.php:942 #: SelectOrderItems.php:1589 SelectSalesOrder.php:485 SelectWorkOrder.php:173 msgid "Enter extract of the Stock Code" msgstr "Zadejte extrakt skladem zákoníku" -#: ContractBOM.php:329 PO_Items.php:1027 +#: ContractBOM.php:329 PO_Items.php:1031 msgid "Create a New Stock Item" msgstr "Vytvoření nové položky skladem" @@ -4235,22 +4235,22 @@ msgstr "Obrázek" #: ContractBOM.php:368 CounterSales.php:2001 FixedAssetItems.php:465 -#: FixedAssetItems.php:469 PO_Items.php:1068 SelectCreditItems.php:969 +#: FixedAssetItems.php:469 PO_Items.php:1073 SelectCreditItems.php:969 #: SelectOrderItems.php:1449 SelectOrderItems.php:1628 SelectProduct.php:408 #: Stocks.php:709 Stocks.php:713 SupplierTenders.php:517 #: WorkOrderEntry.php:616 WorkOrderIssue.php:676 msgid "No Image" msgstr "Obrázek není k dispozici" -#: ContractBOM.php:390 PO_Items.php:1094 SupplierTenders.php:561 +#: ContractBOM.php:390 PO_Items.php:1102 SupplierTenders.php:561 msgid "Only the first" msgstr "Pouze první" -#: ContractBOM.php:390 PO_Items.php:1094 SupplierTenders.php:561 +#: ContractBOM.php:390 PO_Items.php:1102 SupplierTenders.php:561 msgid "can be displayed" msgstr "mohou být zobrazeny" -#: ContractBOM.php:391 PO_Items.php:1095 SupplierTenders.php:562 +#: ContractBOM.php:391 PO_Items.php:1103 SupplierTenders.php:562 msgid "Please restrict your search to only the parts required" msgstr "Prosím, omezit vyhledávání pouze na požadované části" @@ -4305,7 +4305,7 @@ #: ContractCosting.php:75 ContractCosting.php:81 Contracts.php:933 #: CounterSales.php:703 DeliveryDetails.php:786 DeliveryDetails.php:851 -#: OrderDetails.php:156 PO_Items.php:814 PrintCustTrans.php:651 +#: OrderDetails.php:156 PO_Items.php:812 PrintCustTrans.php:651 #: PrintCustTrans.php:714 PrintCustTrans.php:752 #: PrintCustTransPortrait.php:830 PrintCustTransPortrait.php:913 #: PrintCustTransPortrait.php:957 RecurringSalesOrders.php:323 @@ -4399,7 +4399,7 @@ msgid "The SQL used to close the work order was:" msgstr "SQL použitý k uzavření pracovního příkazu byl:" -#: ContractCosting.php:305 GoodsReceived.php:451 +#: ContractCosting.php:305 GoodsReceived.php:453 #: PDFStockCheckComparison.php:130 ReverseGRN.php:219 StockAdjustments.php:239 #: StockLocTransferReceive.php:297 StockLocTransferReceive.php:306 #: StockTransfers.php:381 StockTransfers.php:391 WorkOrderIssue.php:162 @@ -5068,7 +5068,7 @@ msgid "Quote" msgstr "Citovat" -#: Contracts.php:908 PO_Header.php:795 POReport.php:1487 +#: Contracts.php:908 PO_Header.php:793 POReport.php:1487 #: PO_SelectPurchOrder.php:140 PO_SelectPurchOrder.php:142 #: SalesInquiry.php:1104 SelectContract.php:52 SelectContract.php:58 #: SelectContract.php:64 SelectContract.php:70 SelectContract.php:76 @@ -5991,7 +5991,7 @@ msgid "Credit Note number" msgstr "Dobropis číslo" -#: Credit_Invoice.php:1447 GoodsReceived.php:685 SupplierCredit.php:1297 +#: Credit_Invoice.php:1447 GoodsReceived.php:687 SupplierCredit.php:1297 #: SupplierInvoice.php:1288 WorkOrderIssue.php:354 WorkOrderReceive.php:674 #: Z_BottomUpCosts.php:33 msgid "has been processed" @@ -6419,7 +6419,7 @@ #: CustLoginSetup.php:16 index.php:17 InventoryQuantities.php:147 #: InventoryValuation.php:202 Locations.php:353 Locations.php:412 #: MRPCalendar.php:22 MRPCreateDemands.php:187 MRPDemands.php:28 -#: MRPDemandTypes.php:19 MRP.php:518 MRPPlannedPurchaseOrders.php:267 +#: MRPDemandTypes.php:19 MRP.php:517 MRPPlannedPurchaseOrders.php:267 #: MRPPlannedWorkOrders.php:249 MRPPlannedWorkOrders.php:330 #: PricesByCost.php:9 ReorderLevelLocation.php:13 ReorderLevel.php:173 #: SelectProduct.php:71 StockDispatch.php:220 StockMovements.php:26 @@ -7648,7 +7648,7 @@ msgid "Banked into the" msgstr "Naklonila do" -#: CustomerReceipt.php:841 Payments.php:719 PO_Items.php:258 +#: CustomerReceipt.php:841 Payments.php:719 PO_Items.php:256 #: SelectSalesOrder.php:135 SelectSalesOrder.php:300 SpecialOrder.php:400 msgid "on" msgstr "na" @@ -7870,14 +7870,14 @@ "S cílem vytvořit nový zákazník, musíte se nejprve nastavit alespoň jedno " "prodejní typ / ceník" -#: Customers.php:436 Customers.php:445 includes/ConnectDB_mysqli.inc:35 +#: Customers.php:436 Customers.php:445 includes/ConnectDB_mysqli.inc:29 #: includes/ConnectDB_mysql.inc:29 msgid "Click" msgstr "Klepněte na tlačítko" #: Customers.php:436 Customers.php:445 MRPPlannedPurchaseOrders.php:18 #: MRPPlannedWorkOrders.php:15 MRPReschedules.php:18 MRPShortages.php:17 -#: OffersReceived.php:229 PO_Header.php:437 includes/ConnectDB_mysqli.inc:35 +#: OffersReceived.php:229 PO_Header.php:437 includes/ConnectDB_mysqli.inc:29 #: includes/ConnectDB_mysql.inc:29 msgid "here" msgstr "zde" @@ -7976,7 +7976,7 @@ "kartu Nastavení v hlavním menu a nastavit alespoň jeden jako první" #: Customers.php:550 Customers.php:799 Customers.php:802 index.php:1059 -#: PaymentTerms.php:13 PO_Header.php:1034 PrintCustTrans.php:324 +#: PaymentTerms.php:13 PO_Header.php:1032 PrintCustTrans.php:324 #: PrintCustTransPortrait.php:437 Suppliers.php:680 Suppliers.php:833 #: includes/PO_PDFOrderPageHeader.inc:62 includes/PO_PDFOrderPageHeader.inc:64 msgid "Payment Terms" @@ -8147,7 +8147,7 @@ #: CustomerTypes.php:95 PcAssignCashToTab.php:97 PcClaimExpensesFromTab.php:88 #: PcExpenses.php:96 PcExpensesTypeTab.php:61 PcTabs.php:97 PcTypeTabs.php:87 -#: PO_Items.php:259 SalesTypes.php:88 SelectSalesOrder.php:135 +#: PO_Items.php:257 SalesTypes.php:88 SelectSalesOrder.php:135 #: SelectSalesOrder.php:300 SpecialOrder.php:400 SupplierTypes.php:93 msgid "has been created" msgstr "byl vytvořen" @@ -8839,7 +8839,7 @@ msgid "Discount Category Code" msgstr "Kód slevové skupiny" -#: DiscountCategories.php:90 DiscountCategories.php:231 PO_Header.php:848 +#: DiscountCategories.php:90 DiscountCategories.php:231 PO_Header.php:846 #: SalesCategories.php:262 SuppInvGRNs.php:276 SupplierTenders.php:57 #, php-format msgid "Select" @@ -10426,7 +10426,7 @@ msgstr "Hodnota k dispozici" #: FixedAssetRegister.php:199 FixedAssetRegister.php:223 -#: PDFBankingSummary.php:169 PDFChequeListing.php:176 PO_Items.php:770 +#: PDFBankingSummary.php:169 PDFChequeListing.php:176 PO_Items.php:768 #: includes/PDFSalesAnalysis.inc:71 includes/PDFSalesAnalysis.inc:125 #: includes/PDFSalesAnalysis.inc:178 includes/PDFSalesAnalysis.inc:312 #: includes/PDFSalesAnalysis.inc:364 includes/PDFSalesAnalysis.inc:414 @@ -10790,7 +10790,7 @@ msgid "Req Del Date" msgstr "Req Del Datum" -#: FTP_RadioBeacon.php:57 PO_Header.php:824 PO_Header.php:1050 +#: FTP_RadioBeacon.php:57 PO_Header.php:822 PO_Header.php:1050 #: SelectCompletedOrder.php:590 SelectSalesOrder.php:752 #: SelectSalesOrder.php:768 includes/PDFQuotationPageHeader.inc:31 #: includes/PDFQuotationPortraitPageHeader.inc:30 @@ -12108,17 +12108,17 @@ msgid "Supplier Units" msgstr "Jednotka dodavatele" -#: GoodsReceived.php:86 PO_Items.php:1043 +#: GoodsReceived.php:86 #, fuzzy -msgid "Our Units" +msgid "Our Receiving Units" msgstr "Jednotky" -#: GoodsReceived.php:93 +#: GoodsReceived.php:93 PO_Items.php:1048 #, fuzzy msgid "Conversion" msgstr "Konverzní faktor (na náš UOM)" -#: GoodsReceived.php:93 +#: GoodsReceived.php:93 PO_Items.php:1048 #, fuzzy msgid "Factor" msgstr "Pro" @@ -12143,7 +12143,7 @@ msgid "Total value of goods received" msgstr "Celková hodnota zboží přijatého" -#: GoodsReceived.php:219 +#: GoodsReceived.php:221 msgid "" "Receiving a negative quantity that results in negative stock is prohibited " "by the parameter settings. This delivery of stock cannot be processed until " @@ -12153,15 +12153,15 @@ "nastavení parametrů. Tato dodávka zásob nelze zpracovat, dokud se zásoby " "této položky je opravena." -#: GoodsReceived.php:227 +#: GoodsReceived.php:229 msgid "There is nothing to process" msgstr "Neexistuje nic, co proces" -#: GoodsReceived.php:227 +#: GoodsReceived.php:229 msgid "Please enter valid quantities greater than zero" msgstr "Zadejte prosím platný množství větší než nula" -#: GoodsReceived.php:232 +#: GoodsReceived.php:234 msgid "" "Negative stocks would result by processing a negative delivery - quantities " "must be changed or the stock quantity of the item going negative corrected " @@ -12171,7 +12171,7 @@ "změnit, nebo populaci množství položek bude opraven před tímto negativním " "dodávky budou zpracovány." -#: GoodsReceived.php:238 +#: GoodsReceived.php:240 msgid "" "Entered quantities cannot be greater than the quantity entered on the " "purchase invoice including the allowed over-receive percentage" @@ -12179,14 +12179,14 @@ "Zadané množství nemůže být větší než množství uvedené na faktuře včetně " "povolené přes-přijímat procento" -#: GoodsReceived.php:240 +#: GoodsReceived.php:242 msgid "" "Modify the ordered items on the purchase invoice if you wish to increase the " "quantities" msgstr "" "Změnit objednaného zboží na nákupní faktuře, pokud chcete zvýšit množství" -#: GoodsReceived.php:270 +#: GoodsReceived.php:272 msgid "" "Could not check that the details of the purchase order had not been changed " "by another user because" @@ -12194,11 +12194,11 @@ "Nepodařilo se zkontrolovat, zda údaje v objednávce nebyl změněn jiným " "uživatelem, protože" -#: GoodsReceived.php:271 +#: GoodsReceived.php:273 msgid "The following SQL to retrieve the purchase order details was used" msgstr "Následující SQL získat podrobnosti objednávky bylo použito" -#: GoodsReceived.php:288 +#: GoodsReceived.php:290 msgid "" "This order has been changed or invoiced since this delivery was started to " "be actioned" @@ -12206,11 +12206,11 @@ "Tento příkaz byl změněn nebo fakturované protože to dodávka byla začaly být " "actioned" -#: GoodsReceived.php:288 +#: GoodsReceived.php:290 msgid "To enter a delivery against this purchase order" msgstr "Chcete-li zadat dodání proti této objednávce" -#: GoodsReceived.php:288 +#: GoodsReceived.php:290 msgid "" "it must be re-selected and re-read again to update the changes made by the " "other user" @@ -12218,83 +12218,83 @@ "to musí být re-vybraný a re-číst a aktualizovat změny provedené ostatními " "uživateli" -#: GoodsReceived.php:292 +#: GoodsReceived.php:294 msgid "GL Code of the Line Item" msgstr "GL Kód Line bod" -#: GoodsReceived.php:295 +#: GoodsReceived.php:297 msgid "ShiptRef of the Line Item" msgstr "ShiptRef linie bod" -#: GoodsReceived.php:298 +#: GoodsReceived.php:300 msgid "Contract Reference of the Line Item" msgstr "Smlouva Odkaz na řádkové položky" -#: GoodsReceived.php:302 +#: GoodsReceived.php:304 msgid "Quantity Invoiced of the Line Item" msgstr "Množství fakturovaná linie bod" -#: GoodsReceived.php:305 +#: GoodsReceived.php:307 msgid "Stock Code of the Line Item" msgstr "Skladem Kód Line bod" -#: GoodsReceived.php:308 +#: GoodsReceived.php:310 msgid "Order Quantity of the Line Item" msgstr "Aby Množství Line bod" -#: GoodsReceived.php:311 +#: GoodsReceived.php:313 msgid "Quantity of the Line Item Already Received" msgstr "Množství řádkové položky již obdržela" -#: GoodsReceived.php:317 GoodsReceived.php:688 +#: GoodsReceived.php:319 GoodsReceived.php:690 msgid "Select a different purchase order for receiving goods against" msgstr "Vyberte jinou objednávku pro příjem zboží proti" -#: GoodsReceived.php:319 +#: GoodsReceived.php:321 msgid "Re-read the updated purchase order for receiving goods against" msgstr "Re-read aktualizovaný objednávky pro příjem zboží proti" -#: GoodsReceived.php:351 +#: GoodsReceived.php:353 msgid "" "The standard cost of the item being received cannot be retrieved because" msgstr "Standardní pořizovací cena položky je obdržela, nemůže získat, protože" -#: GoodsReceived.php:352 +#: GoodsReceived.php:354 msgid "The following SQL to retrieve the standard cost was used" msgstr "Následující SQL získat standardní náklady byly použity" -#: GoodsReceived.php:393 +#: GoodsReceived.php:395 msgid "" "The purchase order detail record could not be updated with the quantity " "received because" msgstr "" "Objednávce detail záznamu nelze aktualizovat s množstvím přijaté protože" -#: GoodsReceived.php:394 ReverseGRN.php:128 +#: GoodsReceived.php:396 ReverseGRN.php:128 msgid "The following SQL to update the purchase order detail record was used" msgstr "Následující SQL aktualizovat objednávky detail záznamu byla použita" -#: GoodsReceived.php:423 +#: GoodsReceived.php:425 msgid "A GRN record could not be inserted" msgstr "ZEL záznam nemůže být vložen" -#: GoodsReceived.php:423 +#: GoodsReceived.php:425 msgid "This receipt of goods has not been processed because" msgstr "Toto přijetí zboží nebylo zpracováno, protože" -#: GoodsReceived.php:424 ReverseGRN.php:156 +#: GoodsReceived.php:426 ReverseGRN.php:156 msgid "The following SQL to insert the GRN record was used" msgstr "Následující SQL vložit záznam GRN byla použita" -#: GoodsReceived.php:482 +#: GoodsReceived.php:484 msgid "stock movement records could not be inserted because" msgstr "Záznamy zásob pohybu nemůže být vložen, protože" -#: GoodsReceived.php:500 +#: GoodsReceived.php:502 msgid "Could not check if a batch or lot stock item already exists because" msgstr "Nemohl zkontrolovat, zda šarže na skladě již existuje, protože" -#: GoodsReceived.php:501 +#: GoodsReceived.php:503 msgid "" "The following SQL to test for an already existing controlled but not " "serialised stock item was used" @@ -12302,17 +12302,17 @@ "Následující SQL k testu na již existující kontrolované, ale ne serializoval " "na skladě byla použita" -#: GoodsReceived.php:529 WorkOrderIssue.php:215 WorkOrderReceive.php:492 +#: GoodsReceived.php:531 WorkOrderIssue.php:215 WorkOrderReceive.php:492 #: WorkOrderReceive.php:563 msgid "The serial stock item record could not be inserted because" msgstr "Pořadové skladová položka záznam nemůže být vložen, protože" -#: GoodsReceived.php:530 WorkOrderIssue.php:216 WorkOrderReceive.php:493 +#: GoodsReceived.php:532 WorkOrderIssue.php:216 WorkOrderReceive.php:493 #: WorkOrderReceive.php:564 msgid "The following SQL to insert the serial stock item records was used" msgstr "Následující SQL vložit sériové záznamy na skladě byla použita" -#: GoodsReceived.php:583 ReverseGRN.php:175 SupplierCredit.php:1194 +#: GoodsReceived.php:585 ReverseGRN.php:175 SupplierCredit.php:1194 #: SupplierCredit.php:1282 SupplierInvoice.php:1181 SupplierInvoice.php:1266 msgid "" "CRITICAL ERROR! NOTE DOWN THIS ERROR AND SEEK ASSISTANCE The fixed asset " @@ -12321,7 +12321,7 @@ "Critical Error! POZNÁMKA DOWN tuto chybu a požádat o pomoc hmotného majetku " "transakce nemůže být vložen, protože" -#: GoodsReceived.php:603 SupplierInvoice.php:1281 +#: GoodsReceived.php:605 SupplierInvoice.php:1281 msgid "" "CRITICAL ERROR! NOTE DOWN THIS ERROR AND SEEK ASSISTANCE. The fixed asset " "cost and date purchased was not able to be updated because:" @@ -12329,7 +12329,7 @@ "Critical Error! POZNÁMKA DOWN této chyby a hledat pomoc. Investičního " "majetku náklady a datum koupě nemohl být aktualizován, protože:" -#: GoodsReceived.php:604 SupplierInvoice.php:1282 +#: GoodsReceived.php:606 SupplierInvoice.php:1282 msgid "" "The following SQL was used to attempt the update of the cost and the date " "the asset was purchased" @@ -12337,44 +12337,44 @@ "Následující SQL byl použit k pokusu aktualizace nákladů a datum majetku byl " "zakoupen" -#: GoodsReceived.php:634 +#: GoodsReceived.php:636 msgid "The purchase GL posting could not be inserted because" msgstr "Nákup GL vysílání nemohly být zařazeny, protože" -#: GoodsReceived.php:635 ReverseGRN.php:303 +#: GoodsReceived.php:637 ReverseGRN.php:303 msgid "The following SQL to insert the purchase GLTrans record was used" msgstr "Následující SQL vložit na nákup GLTrans záznam byl použit" -#: GoodsReceived.php:653 SelectSalesOrder.php:896 +#: GoodsReceived.php:655 SelectSalesOrder.php:896 msgid "PO" msgstr "PO" -#: GoodsReceived.php:659 ReverseGRN.php:324 +#: GoodsReceived.php:661 ReverseGRN.php:324 msgid "The GRN suspense side of the GL posting could not be inserted because" msgstr "Napětí ZEL straně GL vyslání nemůže být vložen, protože" -#: GoodsReceived.php:660 ReverseGRN.php:325 +#: GoodsReceived.php:662 ReverseGRN.php:325 msgid "The following SQL to insert the GRN Suspense GLTrans record was used" msgstr "Následující SQL vložit GRN napětí GLTrans záznam byl použit" -#: GoodsReceived.php:670 +#: GoodsReceived.php:672 #, fuzzy msgid "Order Completed" msgstr "Dokončeno" -#: GoodsReceived.php:685 ReverseGRN.php:332 +#: GoodsReceived.php:687 ReverseGRN.php:332 msgid "GRN number" msgstr "GRN číslo" -#: GoodsReceived.php:686 +#: GoodsReceived.php:688 msgid "Print this Goods Received Note (GRN)" msgstr "Vytisknout tuto Zboží Přijaté Poznámka (GRN)" -#: GoodsReceived.php:695 +#: GoodsReceived.php:697 msgid "Modify Order Items" msgstr "Změnit pořadí položek" -#: GoodsReceived.php:698 +#: GoodsReceived.php:700 msgid "Process Goods Received" msgstr "Proces přijetí zboží" @@ -14146,103 +14146,103 @@ msgid "Loading requirements from sales orders" msgstr "Načítání požadavků z prodejních objednávek" -#: MRP.php:255 +#: MRP.php:254 msgid "Loading requirements from work orders" msgstr "Načítání požadavků z pracovních příkazů" -#: MRP.php:297 +#: MRP.php:296 msgid "Loading requirements based on mrpdemands" msgstr "Načítání požadavky založené na mrpdemands" -#: MRP.php:317 +#: MRP.php:316 msgid "Loading requirements based on reorder level" msgstr "Načítání požadavky založené na pořadí úrovni" -#: MRP.php:324 +#: MRP.php:323 msgid "Creating supplies table" msgstr "Vytváření zásob tabulka" -#: MRP.php:338 +#: MRP.php:337 msgid "Create of mrpsupplies failed because" msgstr "Vytvořit z mrpsupplies se nezdařila, protože" -#: MRP.php:340 +#: MRP.php:339 msgid "Loading supplies from purchase orders" msgstr "Načítání dodávky z objednávek" -#: MRP.php:366 +#: MRP.php:365 msgid "Loading supplies from inventory on hand" msgstr "Načítání dodávky z inventáře na ruce" -#: MRP.php:407 +#: MRP.php:406 msgid "Loading supplies from work orders" msgstr "Načítání dodávky z pracovních příkazů" -#: MRP.php:436 +#: MRP.php:435 msgid "Creating planned orders table" msgstr "Vytvoření tabulky plánované zakázky" -#: MRP.php:448 +#: MRP.php:447 msgid "Create of mrpplannedorders failed because" msgstr "Vytvořit z mrpplannedorders se nezdařila, protože" -#: MRP.php:467 +#: MRP.php:466 msgid "Processing level" msgstr "Úrovně zpracování" -#: MRP.php:474 +#: MRP.php:473 msgid "End time" msgstr "Čas konce" -#: MRP.php:546 +#: MRP.php:545 msgid "Last Run Details" msgstr "Poslední Spustit Podrobnosti" -#: MRP.php:548 +#: MRP.php:547 msgid "Last Run Time" msgstr "Čas posledního spuštění" -#: MRP.php:550 MRP.php:579 +#: MRP.php:549 MRP.php:578 msgid "Days Leeway" msgstr "Dny volnost" -#: MRP.php:551 +#: MRP.php:550 msgid "Use MRP Demands" msgstr "Použití MRP požaduje" -#: MRP.php:552 +#: MRP.php:551 msgid "Use EOQ" msgstr "Použijte EOQ" -#: MRP.php:553 +#: MRP.php:552 msgid "Use Pan Size" msgstr "Použijte Pan Velikost" -#: MRP.php:554 +#: MRP.php:553 msgid "Use Shrinkage" msgstr "Použijte smrštění" -#: MRP.php:561 +#: MRP.php:560 msgid "This Run Details" msgstr "Tento běh Podrobnosti" -#: MRP.php:580 +#: MRP.php:579 msgid "Use MRP Demands?" msgstr "Použijte MRP požaduje?" -#: MRP.php:582 +#: MRP.php:581 msgid "Use EOQ?" msgstr "Použijte EOQ?" -#: MRP.php:584 +#: MRP.php:583 msgid "Use Pan Size?" msgstr "Použijte Pan velikost?" -#: MRP.php:586 +#: MRP.php:585 msgid "Use Shrinkage?" msgstr "Smrštění použití?" -#: MRP.php:588 +#: MRP.php:587 msgid "Run MRP" msgstr "Běhu MRP" @@ -14718,8 +14718,8 @@ msgid "An official order will be sent to you in due course" msgstr "Oficiální objednávka bude zaslána v pravý čas" -#: OffersReceived.php:180 PO_AuthoriseMyOrders.php:89 PO_Header.php:782 -#: PO_Header.php:787 PO_Header.php:791 PO_Header.php:799 PO_Header.php:805 +#: OffersReceived.php:180 PO_AuthoriseMyOrders.php:89 PO_Header.php:778 +#: PO_Header.php:783 PO_Header.php:788 PO_Header.php:797 PO_Header.php:803 #: PO_SelectOSPurchOrder.php:161 PO_SelectOSPurchOrder.php:163 #: PO_SelectPurchOrder.php:130 PO_SelectPurchOrder.php:132 msgid "Pending" @@ -15445,8 +15445,8 @@ msgid "Expense Code" msgstr "Náklady kód" -#: PcAssignCashToTab.php:215 PO_AuthoriseMyOrders.php:90 PO_Header.php:783 -#: PO_Header.php:788 PO_Header.php:800 PO_Header.php:804 +#: PcAssignCashToTab.php:215 PO_AuthoriseMyOrders.php:90 PO_Header.php:779 +#: PO_Header.php:784 PO_Header.php:798 PO_Header.php:802 #: PO_SelectOSPurchOrder.php:166 PO_SelectOSPurchOrder.php:168 #: PO_SelectPurchOrder.php:135 PO_SelectPurchOrder.php:137 msgid "Authorised" @@ -15713,7 +15713,7 @@ #: PcReportTab.php:97 PcReportTab.php:99 PcReportTab.php:107 #: PDFOrdersInvoiced.php:263 PDFOrdersInvoiced.php:265 -#: PDFOrdersInvoiced.php:273 includes/ConnectDB_mysqli.inc:93 +#: PDFOrdersInvoiced.php:273 includes/ConnectDB_mysqli.inc:86 #: includes/ConnectDB_mysql.inc:75 msgid "Database Error" msgstr "Chyba databáze" @@ -16471,7 +16471,7 @@ msgid "Order Status Report - No Data" msgstr "Aby Status Report - žádná data" -#: PDFOrderStatus.php:273 PO_AuthoriseMyOrders.php:60 PO_Header.php:778 +#: PDFOrderStatus.php:273 PO_AuthoriseMyOrders.php:60 PO_Header.php:774 #: PO_OrderDetails.php:123 PO_SelectOSPurchOrder.php:449 #: PO_SelectPurchOrder.php:370 SelectWorkOrder.php:298 SelectWorkOrder.php:333 #: WorkOrderCosting.php:88 WorkOrderCosting.php:100 @@ -16480,7 +16480,7 @@ msgid "Status" msgstr "Stav" -#: PDFOrderStatus.php:301 PO_Header.php:746 PO_OrderDetails.php:115 +#: PDFOrderStatus.php:301 PO_Header.php:742 PO_OrderDetails.php:115 msgid "Not yet printed" msgstr "Ještě netisknuto" @@ -17262,18 +17262,19 @@ msgid "Initiator" msgstr "Iniciátor" -#: PO_AuthoriseMyOrders.php:59 PO_Header.php:722 PO_Items.php:816 +#: PO_AuthoriseMyOrders.php:59 PO_Header.php:722 PO_Items.php:814 #: POReport.php:1429 includes/PDFPickingListHeader.inc:46 msgid "Delivery Date" msgstr "Datum dodání" -#: PO_AuthoriseMyOrders.php:91 PO_Header.php:784 PO_Header.php:798 +#: PO_AuthoriseMyOrders.php:91 PO_Header.php:780 PO_Header.php:796 #: PO_SelectOSPurchOrder.php:176 PO_SelectOSPurchOrder.php:178 #: PO_SelectPurchOrder.php:150 PO_SelectPurchOrder.php:152 msgid "Rejected" msgstr "Odmítnuto" -#: PO_AuthoriseMyOrders.php:92 PO_Header.php:803 PO_SelectOSPurchOrder.php:171 +#: PO_AuthoriseMyOrders.php:92 PO_Header.php:785 PO_Header.php:790 +#: PO_Header.php:801 PO_SelectOSPurchOrder.php:171 #: PO_SelectOSPurchOrder.php:173 PO_SelectPurchOrder.php:145 #: PO_SelectPurchOrder.php:147 msgid "Cancelled" @@ -17334,22 +17335,22 @@ "This is a new order. It must be created before you can change the status" msgstr "" -#: PO_Header.php:93 PO_Items.php:109 SelectSalesOrder.php:126 +#: PO_Header.php:93 PO_Items.php:107 SelectSalesOrder.php:126 #: SelectSalesOrder.php:294 msgid "You do not have permission to authorise this purchase order" msgstr "Nemáte oprávnění k autorizaci této objednávce" -#: PO_Header.php:93 PO_Header.php:117 PO_Header.php:138 PO_Items.php:109 +#: PO_Header.php:93 PO_Header.php:117 PO_Header.php:138 PO_Items.php:107 #: SelectSalesOrder.php:126 SelectSalesOrder.php:294 msgid "This order is for" msgstr "Tato zakázka je pro" -#: PO_Header.php:95 PO_Items.php:106 SelectSalesOrder.php:123 +#: PO_Header.php:95 PO_Items.php:104 SelectSalesOrder.php:123 #: SelectSalesOrder.php:291 msgid "You can only authorise up to" msgstr "Můžete povolit pouze až" -#: PO_Header.php:96 PO_Header.php:120 PO_Header.php:138 PO_Items.php:112 +#: PO_Header.php:96 PO_Header.php:120 PO_Header.php:138 PO_Items.php:110 #: SelectSalesOrder.php:128 SelectSalesOrder.php:294 msgid "If you think this is a mistake please contact the systems administrator" msgstr "" @@ -17482,8 +17483,8 @@ msgid "You can setup authorisations" msgstr "Můžete nastavit oprávnění" -#: PO_Header.php:508 PO_Header.php:579 PO_Items.php:258 PO_Items.php:413 -#: PO_Items.php:706 PO_Items.php:709 PO_OrderDetails.php:86 +#: PO_Header.php:508 PO_Header.php:579 PO_Items.php:256 PO_Items.php:411 +#: PO_Items.php:704 PO_Items.php:707 PO_OrderDetails.php:86 #: PO_PDFPurchOrder.php:185 PO_PDFPurchOrder.php:299 SelectSalesOrder.php:135 #: SelectSalesOrder.php:300 SpecialOrder.php:400 msgid "Purchase Order" @@ -17510,9 +17511,9 @@ msgid "Supplier Name" msgstr "Název dodavatele" -#: PO_Header.php:533 PO_Header.php:940 PO_Header.php:943 PO_Header.php:946 -#: PO_Header.php:949 PO_Header.php:952 PO_Header.php:955 PO_Header.php:1013 -#: PO_Header.php:1016 PO_Header.php:1019 PO_Header.php:1022 PO_Header.php:1025 +#: PO_Header.php:533 PO_Header.php:938 PO_Header.php:941 PO_Header.php:944 +#: PO_Header.php:947 PO_Header.php:950 PO_Header.php:953 PO_Header.php:1011 +#: PO_Header.php:1014 PO_Header.php:1017 PO_Header.php:1020 PO_Header.php:1023 msgid "Address" msgstr "Adresa" @@ -17552,48 +17553,48 @@ msgid "Requisition Ref" msgstr "Žádanka Ref" -#: PO_Header.php:740 +#: PO_Header.php:736 msgid "Date Printed" msgstr "Vytištěno" -#: PO_Header.php:755 +#: PO_Header.php:751 msgid "Allow Reprint" msgstr "Povolit Dotisk" -#: PO_Header.php:762 +#: PO_Header.php:758 msgid "Reprint Now" msgstr "Dotisk teď" -#: PO_Header.php:772 +#: PO_Header.php:768 msgid "Receive this order" msgstr "Přijmout tuto objednávku" -#: PO_Header.php:776 +#: PO_Header.php:772 #, fuzzy msgid "New Purchase Order" msgstr "Nákupní objednávka" -#: PO_Header.php:811 +#: PO_Header.php:809 msgid "Status Comment" msgstr "Stav komentář" -#: PO_Header.php:816 +#: PO_Header.php:814 msgid "Status Update" msgstr "Status Update" -#: PO_Header.php:823 +#: PO_Header.php:821 msgid "Warehouse Info" msgstr "Sklad Info" -#: PO_Header.php:825 +#: PO_Header.php:823 msgid "Supplier Info" msgstr "Dodavatel Info" -#: PO_Header.php:830 includes/PDFPickingListHeader.inc:13 +#: PO_Header.php:828 includes/PDFPickingListHeader.inc:13 msgid "Warehouse" msgstr "Sklad" -#: PO_Header.php:894 +#: PO_Header.php:892 msgid "" "The default stock location set up for this user is not a currently defined " "stock location" @@ -17601,27 +17602,27 @@ "Výchozí umístění skladu nastavit pro tohoto uživatele není v současnosti " "definován Umístění skladu" -#: PO_Header.php:895 +#: PO_Header.php:893 msgid "Your system administrator needs to amend your user record" msgstr "Správce systému musí změnit své uživatelské záznam" -#: PO_Header.php:937 +#: PO_Header.php:935 msgid "Delivery Contact" msgstr "Dodací Kontakt" -#: PO_Header.php:962 +#: PO_Header.php:960 msgid "De... [truncated message content] |
From: <dai...@us...> - 2011-03-29 09:04:29
|
Revision: 4521 http://web-erp.svn.sourceforge.net/web-erp/?rev=4521&view=rev Author: daintree Date: 2011-03-29 09:04:20 +0000 (Tue, 29 Mar 2011) Log Message: ----------- SQL to ansi and other html to xhtml Modified Paths: -------------- trunk/BOMExtendedQty.php trunk/BOMIndented.php trunk/BOMIndentedReverse.php trunk/COGSGLPostings.php trunk/CompanyPreferences.php trunk/Credit_Invoice.php trunk/CustomerReceipt.php trunk/Customers.php trunk/MRP.php trunk/api/api_branches.php trunk/api/api_currencies.php trunk/api/api_customers.php trunk/api/api_customertypes.php trunk/api/api_glaccounts.php trunk/api/api_holdreasons.php trunk/api/api_locations.php trunk/api/api_salesareas.php trunk/api/api_salesman.php trunk/api/api_salesorders.php trunk/api/api_salestypes.php trunk/api/api_shippers.php trunk/api/api_stock.php trunk/api/api_stockcategories.php trunk/api/api_suppliers.php trunk/api/api_taxgroups.php trunk/api/api_workorders.php trunk/includes/ConnectDB_mysql.inc Added Paths: ----------- trunk/locale/zh_CN.utf8/Manual/ManualSalesAnalysis.html trunk/locale/zh_CN.utf8/Manual/ManualSalesPeople.html trunk/locale/zh_CN.utf8/Manual/ManualShipments.html Modified: trunk/BOMExtendedQty.php =================================================================== --- trunk/BOMExtendedQty.php 2011-03-28 09:49:25 UTC (rev 4520) +++ trunk/BOMExtendedQty.php 2011-03-29 09:04:20 UTC (rev 4521) @@ -2,8 +2,6 @@ /* $Id$*/ -/* $Revision: 1.8 $ */ - // BOMExtendedQty.php - Quantiy Extended Bill of Materials //$PageSecurity = 2; include('includes/session.inc'); @@ -30,7 +28,7 @@ $sql = 'CREATE TEMPORARY TABLE passbom ( part char(20), extendedqpa double, - sortpart text)'; + sortpart text) DEFAULT CHARSET=utf8'; $ErrMsg = _('The SQL to to create passbom failed with the message'); $result = DB_query($sql,$db,$ErrMsg); @@ -43,7 +41,7 @@ loccode char(5), effectiveafter date, effectiveto date, - quantity double)'; + quantity double) DEFAULT CHARSET=utf8'; $result = DB_query($sql,$db,_('Create of tempbom failed because')); // First, find first level of components below requested assembly // Put those first level parts in passbom, use COMPONENT in passbom @@ -56,8 +54,9 @@ (" . $_POST['Quantity'] . " * bom.quantity) as extendedqpa, CONCAT(bom.parent,bom.component) AS sortpart FROM bom - WHERE bom.parent =" . "'" . $_POST['Part'] . "' - AND bom.effectiveto >= NOW() AND bom.effectiveafter <= NOW()"; + WHERE bom.parent ='" . $_POST['Part'] . "' + AND bom.effectiveto >= NOW() + AND bom.effectiveafter <= NOW()"; $result = DB_query($sql,$db); $levelctr = 2; @@ -82,8 +81,9 @@ bom.effectiveto, (" . $_POST['Quantity'] . " * bom.quantity) as extendedqpa FROM bom - WHERE bom.parent =" . "'" . $_POST['Part'] . "' - AND bom.effectiveto >= NOW() AND bom.effectiveafter <= NOW()"; + WHERE bom.parent ='" . $_POST['Part'] . "' + AND bom.effectiveto >= NOW() + AND bom.effectiveafter <= NOW()"; $result = DB_query($sql,$db); //echo "</br>sql is $sql</br>"; // This while routine finds the other levels as long as $componentctr - the @@ -114,7 +114,8 @@ (bom.quantity * passbom.extendedqpa) FROM bom,passbom WHERE bom.parent = passbom.part - AND bom.effectiveto >= NOW() AND bom.effectiveafter <= NOW()"; + AND bom.effectiveto >= NOW() + AND bom.effectiveafter <= NOW()"; $result = DB_query($sql,$db); $sql = 'DROP TABLE IF EXISTS passbom2'; @@ -129,7 +130,7 @@ $sql = 'CREATE TEMPORARY TABLE passbom ( part char(20), extendedqpa decimal(10,3), - sortpart text)'; + sortpart text) DEFAULT CHARSET=utf8'; $result = DB_query($sql,$db); @@ -138,13 +139,15 @@ (bom.quantity * passbom2.extendedqpa), CONCAT(passbom2.sortpart,bom.component) AS sortpart FROM bom,passbom2 - WHERE bom.parent = passbom2.part - AND bom.effectiveto >= NOW() AND bom.effectiveafter <= NOW()"; + WHERE bom.parent = passbom2.part + AND bom.effectiveto >= NOW() + AND bom.effectiveafter <= NOW()"; $result = DB_query($sql,$db); - $sql = 'SELECT COUNT(*) FROM bom,passbom WHERE bom.parent = passbom.part - GROUP BY passbom.part'; + $sql = 'SELECT COUNT(*) FROM bom, passbom + WHERE bom.parent = passbom.part + GROUP BY passbom.part'; $result = DB_query($sql,$db); $myrow = DB_fetch_row($result); @@ -156,9 +159,9 @@ $title = _('Quantity Extended BOM Listing') . ' - ' . _('Problem Report'); include('includes/header.inc'); prnMsg( _('The Quantiy Extended BOM Listing 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; @@ -168,11 +171,11 @@ $Right_Margin); $sql = "SELECT stockmaster.stockid,stockmaster.description FROM stockmaster - WHERE stockid = " . "'" . $_POST['Part'] . "'"; + WHERE stockid = '" . $_POST['Part'] . "'"; $result = DB_query($sql,$db); $myrow = DB_fetch_array($result,$db); - $assembly = $_POST['Part']; - $assemblydesc = $myrow['description']; + $Assembly = $_POST['Part']; + $AssemblyDescription = $myrow['description']; $FontSize=8; $Tot_Val=0; @@ -209,14 +212,12 @@ $ListCount = DB_num_rows($result); // UldisN While ($myrow = DB_fetch_array($result,$db)){ - - // Parameters for addTextWrap are defined in /includes/class.pdf.php // 1) X position 2) Y position 3) Width // 4) Height 5) Text 6) Alignment 7) Border 8) Fill - True to use SetFillColor // and False to set to transparent - $difference = $myrow['quantity'] - ($myrow['qoh'] + $myrow['poqty'] + $myrow['woqty']); - if (($_POST['Select'] == 'All') or ($difference > 0)) { + $Difference = $myrow['quantity'] - ($myrow['qoh'] + $myrow['poqty'] + $myrow['woqty']); + if (($_POST['Select'] == 'All') or ($Difference > 0)) { $YPos -=$line_height; $FontSize=8; // Use to alternate between lines with transparent and painted background @@ -234,7 +235,7 @@ $myrow['decimalplaces']),'right',0,$fill); $pdf->addTextWrap(440,$YPos,40,$FontSize,number_format($myrow['woqty'], $myrow['decimalplaces']),'right',0,$fill); - $pdf->addTextWrap(480,$YPos,50,$FontSize,number_format($difference, + $pdf->addTextWrap(480,$YPos,50,$FontSize,number_format($Difference, $myrow['decimalplaces']),'right',0,$fill); } if ($YPos < $Bottom_Margin + $line_height){ @@ -251,33 +252,18 @@ PrintHeader($pdf,$YPos,$PageNumber,$Page_Height,$Top_Margin,$Left_Margin,$Page_Width, $Right_Margin); } -/* Uldisn:This actually would produce the output - $pdfcode = $pdf->output(); - $len = strlen($pdfcode); -*/ -// if ($len<=20){ - if ($ListCount == 0) { //UldisN - $title = _('Print Indented BOM Listing Error'); - include('includes/header.inc'); - prnMsg(_('There were no items for the selected assembly'),'error'); - echo "<br><a href='$rootpath/index.php?" . SID . "'>" . _('Back to the menu') . '</a>'; - include('includes/footer.inc'); - exit; + if ($ListCount == 0) { + $title = _('Print Indented BOM Listing Error'); + include('includes/header.inc'); + prnMsg(_('There were no items for the selected assembly'),'error'); + echo "<br /><a href='$rootpath/index.php?" . SID . "'>" . _('Back to the menu') . '</a>'; + include('includes/footer.inc'); + exit; } else { -/* UldisN - header('Content-type: application/pdf'); - header("Content-Length: " . $len); - header('Content-Disposition: inline; filename=Customer_trans.pdf'); - header('Expires: 0'); - header('Cache-Control: private, post-check=0, pre-check=0'); - header('Pragma: public'); + $pdf->OutputD($_SESSION['DatabaseName'] . '_BOM_Extended_Qty_' . date('Y-m-d').'.pdf'); + $pdf->__destruct(); + } - $pdf->Output('BOMExtendedQty', 'I'); -*/ - $pdf->OutputD($_SESSION['DatabaseName'] . '_Customer_trans_' . date('Y-m-d').'.pdf');//UldisN - $pdf-> __destruct(); - } - } else { /*The option to print PDF was not hit so display form */ $title=_('Quantity Extended BOM Listing'); @@ -297,7 +283,7 @@ echo "<option selected value='yes'>" . _('Print With Alternating Highlighted Lines'); echo "<option value='no'>" . _('Plain Print'); echo '</select></td></tr>'; - echo "</table></br></br><div class='centre'><br><input type=submit name='PrintPDF' value='" . _('Print PDF') . "'></div>"; + echo "</table></br></br><div class='centre'><br /><input type=submit name='PrintPDF' value='" . _('Print PDF') . "'></div>"; include('includes/footer.inc'); @@ -348,6 +334,4 @@ $YPos =$YPos - (2*$line_height); $PageNumber++; } // End of PrintHeader function - - ?> Modified: trunk/BOMIndented.php =================================================================== --- trunk/BOMIndented.php 2011-03-28 09:49:25 UTC (rev 4520) +++ trunk/BOMIndented.php 2011-03-29 09:04:20 UTC (rev 4521) @@ -2,10 +2,8 @@ /* $Id$*/ -/* $Revision: 1.5 $ */ - // BOMIndented.php - Indented Bill of Materials -//$PageSecurity = 2; + include('includes/session.inc'); if (isset($_POST['PrintPDF'])) { @@ -25,7 +23,7 @@ $result = DB_query($sql,$db); $sql = 'CREATE TEMPORARY TABLE passbom ( part char(20), - sortpart text)'; + sortpart text) DEFAULT CHARSET=utf8'; $ErrMsg = _('The SQL to create passbom failed with the message'); $result = DB_query($sql,$db,$ErrMsg); @@ -38,7 +36,7 @@ loccode char(5), effectiveafter date, effectiveto date, - quantity double)'; + quantity double) DEFAULT CHARSET=utf8'; $result = DB_query($sql,$db,_('Create of tempbom failed because')); // First, find first level of components below requested assembly // Put those first level parts in passbom, use COMPONENT in passbom @@ -50,8 +48,9 @@ SELECT bom.component AS part, CONCAT(bom.parent,bom.component) AS sortpart FROM bom - WHERE bom.parent =" . "'" . $_POST['Part'] . "' - AND bom.effectiveto >= NOW() AND bom.effectiveafter <= NOW()"; + WHERE bom.parent ='" . $_POST['Part'] . "' + AND bom.effectiveto >= NOW() + AND bom.effectiveafter <= NOW()"; $result = DB_query($sql,$db); $levelctr = 2; @@ -77,7 +76,8 @@ bom.quantity FROM bom WHERE bom.parent ='" . $_POST['Part'] . "' - AND bom.effectiveto >= NOW() AND bom.effectiveafter <= NOW()"; + AND bom.effectiveto >= NOW() + AND bom.effectiveafter <= NOW()"; $result = DB_query($sql,$db); //echo "</br>sql is $sql</br>"; // This while routine finds the other levels as long as $componentctr - the @@ -107,7 +107,7 @@ bom.effectiveafter, bom.effectiveto, bom.quantity - FROM bom,passbom + FROM bom, passbom WHERE bom.parent = passbom.part AND bom.effectiveto >= NOW() AND bom.effectiveafter <= NOW()"; $result = DB_query($sql,$db); @@ -123,16 +123,17 @@ $sql = 'CREATE TEMPORARY TABLE passbom ( part char(20), - sortpart text)'; + sortpart text) DEFAULT CHARSET=utf8'; $result = DB_query($sql,$db); - $sql = "INSERT INTO passbom (part, sortpart) + $sql = 'INSERT INTO passbom (part, sortpart) SELECT bom.component AS part, CONCAT(passbom2.sortpart,bom.component) AS sortpart FROM bom,passbom2 WHERE bom.parent = passbom2.part - AND bom.effectiveto >= NOW() AND bom.effectiveafter <= NOW()"; + AND bom.effectiveto >= NOW() + AND bom.effectiveafter <= NOW()'; $result = DB_query($sql,$db); @@ -181,9 +182,9 @@ // $fill is used to alternate between lines with transparent and painted background $fill = false; - $pdf->SetFillColor(224,235,255); + $pdf->SetFillColor(224,235,255); - $ListCount = DB_num_rows($result); // UldisN + $ListCount = DB_num_rows($result); while ($myrow = DB_fetch_array($result,$db)){ @@ -239,19 +240,8 @@ include('includes/footer.inc'); exit; } else { - /* UldisN - header('Content-type: application/pdf'); - header("Content-Length: " . $len); - header('Content-Disposition: inline; filename=Customer_trans.pdf'); - header('Expires: 0'); - header('Cache-Control: private, post-check=0, pre-check=0'); - header('Pragma: public'); - - $pdf->Output('BOMIndented.pdf', 'I'); - */ - $pdf->OutputD($_SESSION['DatabaseName'] . '_Customer_trans_' . date('Y-m-d').'.pdf');//UldisN - $pdf-> __destruct(); - + $pdf->OutputD($_SESSION['DatabaseName'] . '_Customer_trans_' . date('Y-m-d').'.pdf');//UldisN + $pdf->__destruct(); } } else { /*The option to print PDF was not hit so display form */ @@ -333,5 +323,4 @@ } // End of PrintHeader function - -?> +?> \ No newline at end of file Modified: trunk/BOMIndentedReverse.php =================================================================== --- trunk/BOMIndentedReverse.php 2011-03-28 09:49:25 UTC (rev 4520) +++ trunk/BOMIndentedReverse.php 2011-03-29 09:04:20 UTC (rev 4521) @@ -2,11 +2,9 @@ /* $Id$*/ -/* $Revision: 1.1 $ */ - // BOMIndented.php - Reverse Indented Bill of Materials - From lowest level component to top level // assembly -//$PageSecurity = 2; + include('includes/session.inc'); if (isset($_POST['PrintPDF'])) { @@ -26,7 +24,8 @@ $result = DB_query($sql,$db); $sql = 'CREATE TEMPORARY TABLE passbom ( part char(20), - sortpart text)'; + sortpart text) DEFAULT CHARSET=utf8'; + $ErrMsg = _('The SQL to to create passbom failed with the message'); $result = DB_query($sql,$db,$ErrMsg); @@ -39,7 +38,7 @@ loccode char(5), effectiveafter date, effectiveto date, - quantity double)'; + quantity double) DEFAULT CHARSET=utf8'; $result = DB_query($sql,$db,_('Create of tempbom failed because')); // First, find first level of components below requested assembly // Put those first level parts in passbom, use COMPONENT in passbom @@ -51,8 +50,9 @@ SELECT bom.parent AS part, CONCAT(bom.component,bom.parent) AS sortpart FROM bom - WHERE bom.component =" . "'" . $_POST['Part'] . "' - AND bom.effectiveto >= NOW() AND bom.effectiveafter <= NOW()"; + WHERE bom.component ='" . $_POST['Part'] . "' + AND bom.effectiveto >= NOW() + AND bom.effectiveafter <= NOW()"; $result = DB_query($sql,$db); $levelctr = 2; @@ -78,7 +78,8 @@ bom.quantity FROM bom WHERE bom.component ='" . $_POST['Part'] . "' - AND bom.effectiveto >= NOW() AND bom.effectiveafter <= NOW()"; + AND bom.effectiveto >= NOW() + AND bom.effectiveafter <= NOW()"; $result = DB_query($sql,$db); // This while routine finds the other levels as long as $componentctr - the @@ -107,9 +108,10 @@ bom.effectiveafter, bom.effectiveto, bom.quantity - FROM bom,passbom - WHERE bom.component = passbom.part - AND bom.effectiveto >= NOW() AND bom.effectiveafter <= NOW()"; + FROM bom,passbom + WHERE bom.component = passbom.part + AND bom.effectiveto >= NOW() + AND bom.effectiveafter <= NOW()"; $result = DB_query($sql,$db); $sql = 'DROP TABLE IF EXISTS passbom2'; @@ -123,7 +125,7 @@ $sql = 'CREATE TEMPORARY TABLE passbom ( part char(20), - sortpart text)'; + sortpart text) DEFAULT CHARSET=utf8'; $result = DB_query($sql,$db); @@ -132,7 +134,8 @@ CONCAT(passbom2.sortpart,bom.parent) AS sortpart FROM bom,passbom2 WHERE bom.component = passbom2.part - AND bom.effectiveto >= NOW() AND bom.effectiveafter <= NOW()"; + AND bom.effectiveto >= NOW() + AND bom.effectiveafter <= NOW()"; $result = DB_query($sql,$db); @@ -160,7 +163,7 @@ $sql = "SELECT stockmaster.stockid, stockmaster.description FROM stockmaster - WHERE stockid = " . "'" . $_POST['Part'] . "'"; + WHERE stockid = '" . $_POST['Part'] . "'"; $result = DB_query($sql,$db); $myrow = DB_fetch_array($result,$db); $assembly = $_POST['Part']; @@ -222,12 +225,6 @@ PrintHeader($pdf,$YPos,$PageNumber,$Page_Height,$Top_Margin,$Left_Margin,$Page_Width, $Right_Margin,$assemblydesc); } -/* UldisN - $pdfcode = $pdf->output(); - $len = strlen($pdfcode); - - if ($len<=20){ -*/ if ($ListCount == 0) { $title = _('Print Reverse Indented BOM Listing Error'); include('includes/header.inc'); @@ -236,16 +233,8 @@ include('includes/footer.inc'); exit; } else { -// header('Content-type: application/pdf'); -// header("Content-Length: " . $len); -// header('Content-Disposition: inline; filename=Customer_trans.pdf'); -// header('Expires: 0'); -// header('Cache-Control: private, post-check=0, pre-check=0'); -// header('Pragma: public'); -// -// $pdf->Output('BOMIndentedReverse.pdf', 'I'); - $pdf->OutputD($_SESSION['DatabaseName'] . '_Customer_trans_' . date('Y-m-d').'.pdf');//UldisN - $pdf-> __destruct(); + $pdf->OutputD($_SESSION['DatabaseName'] . '_Customer_trans_' . date('Y-m-d').'.pdf');//UldisN + $pdf->__destruct(); } } else { /*The option to print PDF was not hit so display form */ @@ -255,7 +244,7 @@ echo '<p class="page_title_text"><img src="'.$rootpath.'/css/'.$theme.'/images/maintenance.png" title="' . _('Search') . '" alt="" />' . ' ' . $title.'</p><br />'; - echo '</br></br><form action=' . $_SERVER['PHP_SELF'] . " method='post'><table class=selection>"; + echo '</br></br><form action=' . $_SERVER['PHP_SELF'] . ' method="post"><table class="selection">'; echo '<input type="hidden" name="FormID" value="' . $_SESSION['FormID'] . '" />'; echo '<tr><td>' . _('Part') . ":</td>"; echo "<td><input type ='text' name='Part' size='20'>"; @@ -319,5 +308,4 @@ } // End of PrintHeader function - -?> +?> \ No newline at end of file Modified: trunk/COGSGLPostings.php =================================================================== --- trunk/COGSGLPostings.php 2011-03-28 09:49:25 UTC (rev 4520) +++ trunk/COGSGLPostings.php 2011-03-29 09:04:20 UTC (rev 4521) @@ -58,7 +58,7 @@ $result = DB_query($sql,$db); prnMsg ($msg,'info'); - echo '<br>'; + echo '<br />'; unset ($SelectedCOGSPostingID); } elseif (isset($_GET['delete'])) { @@ -67,7 +67,7 @@ $sql="DELETE FROM cogsglpostings WHERE id='".$SelectedCOGSPostingID."'"; $result = DB_query($sql,$db); prnMsg( _('The cost of sales posting code record has been deleted'),'info'); - echo '<br>'; + echo '<br />'; unset ($SelectedCOGSPostingID); } @@ -90,11 +90,11 @@ $ShowLivePostingRecords = false; prnMsg (_('The following cost of sales posting records that do not have valid general ledger code specified - these records must be amended.'),'error'); echo '<table class=selection>'; - echo "<tr><th>" . _('Area') . "</th> - <th>" . _('Stock Category') . "</th> - <th>" . _('Sales Type') . "</th> - <th>" . _('COGS Account') . "</th> - </tr>"; + echo '<tr><th>' . _('Area') . '</th> + <th>' . _('Stock Category') . '</th> + <th>' . _('Sales Type') . '</th> + <th>' . _('COGS Account') . '</th> + </tr>'; $k=0; //row colour counter while ($myrow = DB_fetch_row($result)) { @@ -116,9 +116,9 @@ $myrow[2], $myrow[3], $myrow[4], - $_SERVER['PHP_SELF'] . '?' . SID . '&', + $_SERVER['PHP_SELF'] . '?', $myrow[0], - $_SERVER['PHP_SELF']. '?' . SID . '&', + $_SERVER['PHP_SELF']. '?', $myrow[0]); }//end while echo '</table>'; @@ -146,13 +146,13 @@ sequenceintb ) VALUES ( 'Sales', - 1, - 1, - 10)"; + '1', + '1', + '10')"; $result = DB_query($sql,$db); } - $sql = 'SELECT accountcode FROM chartmaster WHERE accountcode =1'; + $sql = "SELECT accountcode FROM chartmaster WHERE accountcode ='1' "; $result = DB_query($sql,$db); if (DB_num_rows($result)==0){ /* account number 1 is not used, so insert a new account */ @@ -162,7 +162,7 @@ group_ ) VALUES ( - 1, + '1', 'Default Sales/Discounts', 'Sales' )"; @@ -177,7 +177,7 @@ VALUES ('AN', 'ANY', 'AN', - 1)"; + '1')"; $result = DB_query($sql,$db); } @@ -194,14 +194,11 @@ $result = DB_query($sql,$db); echo '<table class=selection>'; - echo '<tr><th>' . _('Area') . - '</th><th>' . _('Stock Category') . - '</th><th>' . _('Sales Type') . - '</th><th>' . _('GL Account') . - '</th></tr>'; - + echo '<tr><th>' . _('Area') . '</th> + <th>' . _('Stock Category') . '</th> + <th>' . _('Sales Type') . '</th> + <th>' . _('GL Account') . '</th></tr>'; $k = 0; - while ($myrow = DB_fetch_row($result)) { if ($k==1){ echo '<tr class="EvenTableRows">'; @@ -222,9 +219,9 @@ $myrow[2], $myrow[3], $myrow[4], - $_SERVER['PHP_SELF'] . '?' . SID . '&', + $_SERVER['PHP_SELF'] . '?', $myrow[0], - $_SERVER['PHP_SELF'] . '?' . SID . '&', + $_SERVER['PHP_SELF'] . '?', $myrow[0]); }//END WHILE LIST LOOP @@ -234,12 +231,12 @@ //end of ifs and buts! if (isset($SelectedCOGSPostingID)) { - echo "<div class='centre'><a href=" . $_SERVER['PHP_SELF'] .">" . _('Show all cost of sales posting records') . "</a></div>"; + echo '<div class="centre"><a href="' . $_SERVER['PHP_SELF'] .'">' . _('Show all cost of sales posting records') . '</a></div>'; } -echo "<p>"; +echo '<p />'; -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'] . '" />'; if (isset($SelectedCOGSPostingID)) { @@ -265,20 +262,23 @@ } //end of if $SelectedCOGSPostingID only do the else when a new record is being entered -$sql = "SELECT areacode, +$sql = 'SELECT areacode, areadescription - FROM areas"; + FROM areas'; $result = DB_query($sql,$db); -echo "<table class=selection><tr><td>" . _('Area') . ":</td><td><select tabindex=1 name='Area'><option value='AN'>" . _('Any Other'); +echo '<table class=selection> + <tr><td>' . _('Area') . ':</td> + <td><select tabindex=1 name="Area"> + <option value="AN">' . _('Any Other') . '</option>'; while ($myrow = DB_fetch_array($result)) { if (isset($_POST['Area']) and $myrow['areacode']==$_POST['Area']) { - echo "<option selected VALUE='"; + echo '<option selected VALUE="'; } else { - echo "<option VALUE='"; + echo '<option VALUE="'; } - echo $myrow['areacode'] . "'>" . $myrow['areadescription']; + echo $myrow['areacode'] . '">' . $myrow['areadescription'] . '</option>'; } //end while loop DB_free_result($result); @@ -286,16 +286,18 @@ $sql = 'SELECT categoryid, categorydescription FROM stockcategory'; $result = DB_query($sql,$db); -echo "</select></td></tr><tr><td>" . _('Stock Category') . ":</td><td><select tabindex=2 name='StkCat'> - <option VALUE='ANY'>" . _('Any Other'); +echo '</select></td></tr> + <tr><td>' . _('Stock Category') . ':</td> + <td><select tabindex=2 name="StkCat"> + <option VALUE="ANY">' . _('Any Other') . '</option>'; while ($myrow = DB_fetch_array($result)) { if (isset($_POST['StkCat']) and $myrow["categoryid"]==$_POST['StkCat']) { - echo "<option selected VALUE='"; + echo '<option selected VALUE="'; } else { - echo "<option VALUE='"; + echo '<option VALUE="'; } - echo $myrow['categoryid'] . "'>" . $myrow['categorydescription']; + echo $myrow['categoryid'] . '">' . $myrow['categorydescription'] . '</option>'; } //end while loop @@ -304,23 +306,27 @@ $sql = 'SELECT typeabbrev, sales_type FROM salestypes'; $result = DB_query($sql,$db); -echo "</select></td></tr><tr><td>" . _('Sales Type') . " / " . _('Price List') . ":</td> - <td><select tabindex=3 name='SalesType'><option VALUE='AN'>" . _('Any Other'); +echo '</select></td></tr> + <tr><td>' . _('Sales Type') . ' / ' . _('Price List') . ':</td> + <td><select tabindex=3 name="SalesType"> + <option VALUE="AN">' . _('Any Other') . '</option>'; while ($myrow = DB_fetch_array($result)) { if (isset($_POST['SalesType']) and $myrow['typeabbrev']==$_POST['SalesType']) { - echo "<option selected VALUE='"; + echo '<option selected VALUE="'; } else { - echo "<option VALUE='"; + echo '<option VALUE="'; } - echo $myrow["typeabbrev"] . "'>" . $myrow['sales_type']; + echo $myrow['typeabbrev'] . '">' . $myrow['sales_type'] . '</option>'; } //end while loop -echo "</select></td></tr><tr><td>" . _('Post to GL account') . ":</td><td><select tabindex=4 name='GLCode'>"; +echo '</select></td></tr> + <tr><td>' . _('Post to GL account') . ':</td> + <td><select tabindex="4" name="GLCode">'; DB_free_result($result); -$sql = "SELECT chartmaster.accountcode, +$sql = 'SELECT chartmaster.accountcode, chartmaster.accountname FROM chartmaster, accountgroups @@ -328,23 +334,23 @@ AND accountgroups.pandl=1 ORDER BY accountgroups.sequenceintb, chartmaster.accountcode, - chartmaster.accountname"; + chartmaster.accountname'; $result = DB_query($sql,$db); while ($myrow = DB_fetch_array($result)) { if (isset($_POST['GLCode']) and $myrow['accountcode']==$_POST['GLCode']) { - echo "<option selected VALUE='"; + echo '<option selected VALUE="'; } else { - echo "<option VALUE='"; + echo '<option VALUE="'; } - echo $myrow['accountcode'] . "'>" . $myrow['accountcode'] . ' - ' . $myrow['accountname']; + echo $myrow['accountcode'] . '">' . $myrow['accountcode'] . ' - ' . $myrow['accountname'] . '</option>'; } //end while loop DB_free_result($result); -echo "</select></td></tr></table>"; -echo "<br><div class='centre'><input tabindex=5 type='Submit' name='submit' value=" . _('Enter Information') . "></form></div>"; +echo '</select></td></tr></table>'; +echo '<br /><div class="centre"><input tabindex="5" type="Submit" name="submit" value="' . _('Enter Information') . '"></form></div>'; include('includes/footer.inc'); ?> \ No newline at end of file Modified: trunk/CompanyPreferences.php =================================================================== --- trunk/CompanyPreferences.php 2011-03-28 09:49:25 UTC (rev 4520) +++ trunk/CompanyPreferences.php 2011-03-29 09:04:20 UTC (rev 4521) @@ -1,10 +1,7 @@ <?php -/* $Revision: 1.18 $ */ /* $Id$*/ -//$PageSecurity =10; - include('includes/session.inc'); $title = _('Company Preferences'); @@ -133,13 +130,13 @@ /* Alter the exchange rates in the currencies table */ /* Get default currency rate */ - $sql='SELECT rate from currencies WHERE currabrev="'.$_POST['CurrencyDefault'].'"'; + $sql="SELECT rate from currencies WHERE currabrev='" . $_POST['CurrencyDefault'] . "'"; $result = DB_query($sql,$db); $myrow = DB_fetch_row($result); $NewCurrencyRate=$myrow[0]; /* Set new rates */ - $sql='UPDATE currencies SET rate=rate/"'.$NewCurrencyRate.'"'; + $sql="UPDATE currencies SET rate=rate/'".$NewCurrencyRate."'"; $ErrMsg = _('Could not update the currency rates'); $result = DB_query($sql,$db,$ErrMsg); @@ -163,36 +160,34 @@ echo '<table class=selection>'; if ($InputError != 1) { - $sql = "SELECT coyname, - gstno, - companynumber, - regoffice1, - regoffice2, - regoffice3, - regoffice4, - regoffice5, - regoffice6, - telephone, - fax, - email, - currencydefault, - debtorsact, - pytdiscountact, - creditorsact, - payrollact, - grnact, - exchangediffact, - purchasesexchangediffact, - retainedearnings, - gllink_debtors, - gllink_creditors, - gllink_stock, - freightact - FROM companies - WHERE coycode=1"; + $sql = 'SELECT coyname, + gstno, + companynumber, + regoffice1, + regoffice2, + regoffice3, + regoffice4, + regoffice5, + regoffice6, + telephone, + fax, + email, + currencydefault, + debtorsact, + pytdiscountact, + creditorsact, + payrollact, + grnact, + exchangediffact, + purchasesexchangediffact, + retainedearnings, + gllink_debtors, + gllink_creditors, + gllink_stock, + freightact + FROM companies + WHERE coycode=1'; - - $ErrMsg = _('The company preferences could not be retrieved because'); $result = DB_query($sql, $db,$ErrMsg); @@ -275,15 +270,15 @@ </tr>'; -$result=DB_query("SELECT currabrev, currency FROM currencies",$db); +$result=DB_query('SELECT currabrev, currency FROM currencies',$db); echo '<tr><td>' . _('Home Currency') . ':</td><td><select tabindex="13" Name=CurrencyDefault>'; while ($myrow = DB_fetch_array($result)) { if ($_POST['CurrencyDefault']==$myrow['currabrev']){ - echo "<option selected VALUE='". $myrow['currabrev'] . "'>" . $myrow['currency']; + echo '<option selected VALUE="'. $myrow['currabrev'] . '">' . $myrow['currency'] . '</option>'; } else { - echo "<option VALUE='". $myrow['currabrev'] . "'>" . $myrow['currency']; + echo '<option VALUE="' . $myrow['currabrev'] . '">' . $myrow['currency']. '</option>'; } } //end while loop @@ -291,21 +286,21 @@ echo '</select></td></tr>'; -$result=DB_query("SELECT accountcode, - accountname - FROM chartmaster, - accountgroups - WHERE chartmaster.group_=accountgroups.groupname - AND accountgroups.pandl=0 - ORDER BY chartmaster.accountcode",$db); +$result=DB_query('SELECT accountcode, + accountname + FROM chartmaster INNER JOIN accountgroups + ON chartmaster.group_=accountgroups.groupname + WHERE accountgroups.pandl=0 + ORDER BY chartmaster.accountcode',$db); -echo '<tr><td>' . _('Debtors Control GL Account') . ':</td><td><select tabindex="14" Name=DebtorsAct>'; +echo '<tr><td>' . _('Debtors Control GL Account') . ':</td> + <td><select tabindex="14" Name=DebtorsAct>'; while ($myrow = DB_fetch_row($result)) { if ($_POST['DebtorsAct']==$myrow[0]){ - echo "<option selected VALUE='". $myrow[0] . "'>" . $myrow[1] . ' ('.$myrow[0].')'; + echo '<option selected VALUE="'. $myrow[0] . '">' . $myrow[1] . ' ('.$myrow[0].')</option>'; } else { - echo "<option VALUE='". $myrow[0] . "'>" . $myrow[1] . ' ('.$myrow[0].')'; + echo '<option VALUE="'. $myrow[0] . '">' . $myrow[1] . ' ('.$myrow[0].')</option>'; } } //end while loop @@ -317,9 +312,9 @@ while ($myrow = DB_fetch_row($result)) { if ($_POST['CreditorsAct']==$myrow[0]){ - echo "<option selected VALUE='". $myrow[0] . "'>" . $myrow[1] . ' ('.$myrow[0].')'; + echo '<option selected VALUE="'. $myrow[0] . '">' . $myrow[1] . ' ('.$myrow[0].')</option>'; } else { - echo "<option VALUE='". $myrow[0] . "'>" . $myrow[1] . ' ('.$myrow[0].')'; + echo '<option VALUE="' . $myrow[0] . '">' . $myrow[1] . ' ('.$myrow[0].')</option>'; } } //end while loop @@ -331,9 +326,9 @@ while ($myrow = DB_fetch_row($result)) { if ($_POST['PayrollAct']==$myrow[0]){ - echo "<option selected VALUE='". $myrow[0] . "'>" . $myrow[1] . ' ('.$myrow[0].')'; + echo '<option selected VALUE="'. $myrow[0] . '">' . $myrow[1] . ' ('.$myrow[0].')</option>'; } else { - echo "<option VALUE='". $myrow[0] . "'>" . $myrow[1] . ' ('.$myrow[0].')'; + echo '<option VALUE="'. $myrow[0] . '">' . $myrow[1] . ' ('.$myrow[0].')</option>'; } } //end while loop @@ -345,22 +340,23 @@ while ($myrow = DB_fetch_row($result)) { if ($_POST['GRNAct']==$myrow[0]){ - echo "<option selected VALUE='". $myrow[0] . "'>" . $myrow[1] . ' ('.$myrow[0].')'; + echo '<option selected VALUE="'. $myrow[0] . '">' . $myrow[1] . ' ('.$myrow[0].')</option>'; } else { - echo "<option VALUE='". $myrow[0] . "'>" . $myrow[1] . ' ('.$myrow[0].')'; + echo '<option VALUE="'. $myrow[0] . '">' . $myrow[1] . ' ('.$myrow[0].')</option>'; } } //end while loop DB_data_seek($result,0); echo '</select></td></tr>'; -echo '<tr><td>' . _('Retained Earning Clearing GL Account') . ':</td><td><select tabindex="18" Name=RetainedEarnings>'; +echo '<tr><td>' . _('Retained Earning Clearing GL Account') . ':</td> + <td><select tabindex="18" Name="RetainedEarnings">'; while ($myrow = DB_fetch_row($result)) { if ($_POST['RetainedEarnings']==$myrow[0]){ - echo "<option selected VALUE='". $myrow[0] . "'>" . $myrow[1] . ' ('.$myrow[0].')'; + echo '<option selected VALUE="'. $myrow[0] . '">' . $myrow[1] . ' ('.$myrow[0].')</option>'; } else { - echo "<option VALUE='". $myrow[0] . "'>" . $myrow[1] . ' ('.$myrow[0].')'; + echo '<option VALUE="'. $myrow[0] . '">' . $myrow[1] . ' ('.$myrow[0].')</option>'; } } //end while loop @@ -368,21 +364,21 @@ echo '</select></td></tr>'; -echo '<tr><td>' . _('Freight Re-charged GL Account') . ':</td><td><select tabindex="19" Name=FreightAct>'; +echo '<tr><td>' . _('Freight Re-charged GL Account') . ':</td> + <td><select tabindex="19" Name="FreightAct">'; $result=DB_query('SELECT accountcode, - accountname - FROM chartmaster, - accountgroups - WHERE chartmaster.group_=accountgroups.groupname - AND accountgroups.pandl=1 - ORDER BY chartmaster.accountcode',$db); + accountname + FROM chartmaster INNER JOIN accountgroups + ON chartmaster.group_=accountgroups.groupname + WHERE accountgroups.pandl=1 + ORDER BY chartmaster.accountcode',$db); while ($myrow = DB_fetch_row($result)) { if ($_POST['FreightAct']==$myrow[0]){ - echo "<option selected VALUE='". $myrow[0] . "'>" . $myrow[1] . ' ('.$myrow[0].')'; + echo '<option selected VALUE="'. $myrow[0] . '">' . $myrow[1] . ' ('.$myrow[0].')</option>'; } else { - echo "<option VALUE='". $myrow[0] . "'>" . $myrow[1] . ' ('.$myrow[0].')'; + echo '<option VALUE="'. $myrow[0] . '">' . $myrow[1] . ' ('.$myrow[0].')</option>'; } } //end while loop @@ -390,13 +386,14 @@ echo '</select></td></tr>'; -echo '<tr><td>' . _('Sales Exchange Variances GL Account') . ':</td><td><select tabindex="20" Name=ExchangeDiffAct>'; +echo '<tr><td>' . _('Sales Exchange Variances GL Account') . ':</td> + <td><select tabindex="20" Name="ExchangeDiffAct">'; while ($myrow = DB_fetch_row($result)) { if ($_POST['ExchangeDiffAct']==$myrow[0]){ - echo "<option selected VALUE='". $myrow[0] . "'>" . $myrow[1] . ' ('.$myrow[0].')'; + echo '<option selected VALUE="'. $myrow[0] . '">' . $myrow[1] . ' ('.$myrow[0].')</option>'; } else { - echo "<option VALUE='". $myrow[0] . "'>" . $myrow[1] . ' ('.$myrow[0].')'; + echo '<option VALUE="'. $myrow[0] . '">' . $myrow[1] . ' ('.$myrow[0].')</option>'; } } //end while loop @@ -404,13 +401,14 @@ echo '</select></td></tr>'; -echo '<tr><td>' . _('Purchases Exchange Variances GL Account') . ':</td><td><select tabindex="21" Name=PurchasesExchangeDiffAct>'; +echo '<tr><td>' . _('Purchases Exchange Variances GL Account') . ':</td> + <td><select tabindex="21" Name="PurchasesExchangeDiffAct">'; while ($myrow = DB_fetch_row($result)) { if ($_POST['PurchasesExchangeDiffAct']==$myrow[0]){ - echo "<option selected VALUE='". $myrow[0] . "'>" . $myrow[1] . ' ('.$myrow[0].')'; + echo '<option selected VALUE="'. $myrow[0] . '">' . $myrow[1] . ' ('.$myrow[0].')</option>'; } else { - echo "<option VALUE='". $myrow[0] . "'>" . $myrow[1] . ' ('.$myrow[0].')'; + echo '<option VALUE="'. $myrow[0] . '">' . $myrow[1] . ' ('.$myrow[0].')</option>'; } } //end while loop @@ -418,13 +416,14 @@ echo '</select></td></tr>'; -echo '<tr><td>' . _('Payment Discount GL Account') . ':</td><td><select tabindex="22" Name=PytDiscountAct>'; +echo '<tr><td>' . _('Payment Discount GL Account') . ':</td> + <td><select tabindex="22" Name="PytDiscountAct">'; while ($myrow = DB_fetch_row($result)) { if ($_POST['PytDiscountAct']==$myrow[0]){ - echo "<option selected VALUE='". $myrow[0] . "'>" . $myrow[1] . ' ('.$myrow[0].')'; + echo '<option selected VALUE="'. $myrow[0] . '">' . $myrow[1] . ' ('.$myrow[0].')</option>'; } else { - echo "<option VALUE='". $myrow[0] . "'>" . $myrow[1] . ' ('.$myrow[0].')'; + echo '<option VALUE="'. $myrow[0] . '">' . $myrow[1] . ' ('.$myrow[0].')</option>'; } } //end while loop @@ -432,44 +431,47 @@ echo '</select></td></tr>'; -echo '<tr><td>' . _('Create GL entries for accounts receivable transactions') . ':</td><td><select tabindex="23" Name=GLLink_Debtors>'; +echo '<tr><td>' . _('Create GL entries for accounts receivable transactions') . ':</td> + <td><select tabindex="23" Name="GLLink_Debtors">'; if ($_POST['GLLink_Debtors']==0){ - echo '<option selected VALUE=0>' . _('No'); - echo '<option VALUE=1>' . _('Yes'); + echo '<option selected VALUE="0">' . _('No') . '</option>'; + echo '<option VALUE="1">' . _('Yes'). '</option>'; } else { - echo '<option selected VALUE=1>' . _('Yes'); - echo '<option VALUE=0>' . _('No'); + echo '<option selected VALUE="1">' . _('Yes'). '</option>'; + echo '<option VALUE="0">' . _('No'). '</option>'; } echo '</select></td></tr>'; -echo '<tr><td>' . _('Create GL entries for accounts payable transactions') . ':</td><td><select tabindex="24" Name=GLLink_Creditors>'; +echo '<tr><td>' . _('Create GL entries for accounts payable transactions') . ':</td> + <td><select tabindex="24" Name="GLLink_Creditors">'; if ($_POST['GLLink_Creditors']==0){ - echo '<option selected VALUE=0>' . _('No'); - echo '<option VALUE=1>' . _('Yes'); + echo '<option selected VALUE="0">' . _('No') . '</option>'; + echo '<option VALUE="1">' . _('Yes') . '</option>'; } else { - echo '<option selected VALUE=1>' . _('Yes'); - echo '<option VALUE=0>' . _('No'); + echo '<option selected VALUE="1">' . _('Yes') . '</option>'; + echo '<option VALUE="0">' . _('No') . '</option>'; } echo '</select></td></tr>'; -echo '<tr><td>' . _('Create GL entries for stock transactions') . '):</td><td><select tabindex="25" Name=GLLink_Stock>'; +echo '<tr><td>' . _('Create GL entries for stock transactions') . '):</td> + <td><select tabindex="25" Name="GLLink_Stock">'; -if ($_POST['GLLink_Stock']==0){ - echo '<option selected VALUE=0>' . _('No'); - echo '<option VALUE=1>' . _('Yes'); +if ($_POST['GLLink_Stock']=='0'){ + echo '<option selected VALUE="0">' . _('No') . '</option>'; + echo '<option VALUE="1">' . _('Yes') . '</option>'; } else { - echo '<option selected VALUE=1>' . _('Yes'); - echo '<option VALUE=0>' . _('No'); + echo '<option selected VALUE="1">' . _('Yes') . '</option>'; + echo '<option VALUE="0">' . _('No') . '</option>'; } echo '</select></td></tr>'; -echo '</table><br><div class="centre"><input tabindex="26" type="Submit" Name="submit" value="' . _('Update') . '"></div>'; +echo '</table><br /><div class="centre"><input tabindex="26" type="Submit" Name="submit" value="' . _('Update') . '"></div>'; include('includes/footer.inc'); ?> \ No newline at end of file Modified: trunk/Credit_Invoice.php =================================================================== --- trunk/Credit_Invoice.php 2011-03-28 09:49:25 UTC (rev 4520) +++ trunk/Credit_Invoice.php 2011-03-29 09:04:20 UTC (rev 4521) @@ -257,28 +257,28 @@ if (!isset($_POST['ProcessCredit'])) { - 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 cellpadding=2 colspan=7 class=selection><tr>"; - echo "<tr><th colspan=13>"; + echo '<table cellpadding="2" colspan="7" class="selection"><tr>'; + echo '<tr><th colspan="13">'; echo '<div class="centre"><font color=blue size=4><b>' . _('Credit Invoice') . ' ' . $_SESSION['ProcessingCredit'] . '</b> <b>'.' - ' . $_SESSION['CreditItems']->CustomerName . '</b></font> - <font size=3 color=blue> - ' . _('Credit Note amounts stated in') . ' ' . $_SESSION['CreditItems']->DefaultCurrency . "</div></font>"; - echo "</th></tr>"; - echo "<th>" . _('Item Code') . "</th> - <th>" . _('Item Description') . "</th> - <th>" . _('Invoiced') . "</th> - <th>" . _('Units') . "</th> - <th>" . _('Credit') . '<br>' . _('Quantity') . "</th> - <th>" . _('Price') . "</th> - <th>" . _('Discount') . ' %' . "</th> - <th>" . _('Total') . '<br>' . _('Excl Tax') . "</th> - <th>" . _('Tax Authority') . "</th> - <th>" . _('Tax') . ' %' . "</th> - <th>" . _('Tax') . '<br>' . _('Amount') . "</th> - <th>" . _('Total') . '<br>' . _('Incl Tax') . "</th></tr>"; + <font size=3 color=blue> - ' . _('Credit Note amounts stated in') . ' ' . $_SESSION['CreditItems']->DefaultCurrency . '</div></font>'; + echo '</th></tr>'; + echo '<th>' . _('Item Code') . '</th> + <th>' . _('Item Description') . '</th> + <th>' . _('Invoiced') . '</th> + <th>' . _('Units') . '</th> + <th>' . _('Credit') . '<br />' . _('Quantity') . '</th> + <th>' . _('Price') . '</th> + <th>' . _('Discount') . ' %' . '</th> + <th>' . _('Total') . '<br />' . _('Excl Tax') . '</th> + <th>' . _('Tax Authority') . '</th> + <th>' . _('Tax') . ' %' . '</th> + <th>' . _('Tax') . '<br />' . _('Amount') . '</th> + <th>' . _('Total') . '<br />' . _('Incl Tax') . '</th></tr>'; $_SESSION['CreditItems']->total = 0; $_SESSION['CreditItems']->totalVolume = 0; Modified: trunk/CustomerReceipt.php =================================================================== --- trunk/CustomerReceipt.php 2011-03-28 09:49:25 UTC (rev 4520) +++ trunk/CustomerReceipt.php 2011-03-29 09:04:20 UTC (rev 4521) @@ -1,11 +1,8 @@ <?php /* $Id$ */ -/* $Revision: 1.46 $ */ include('includes/DefineReceiptClass.php'); - -//$PageSecurity = 3; now retrieved from the DB include('includes/session.inc'); $title = _('Receipt Entry'); @@ -127,7 +124,7 @@ $SuggestedFunctionalExRate = $myrow[0]; /*Get the exchange rate between the functional currency and the receipt currency*/ - $result = DB_query("select rate FROM currencies WHERE currabrev='" . $_SESSION['ReceiptBatch']->Currency . "'",$db); + $result = DB_query("SELECT rate FROM currencies WHERE currabrev='" . $_SESSION['ReceiptBatch']->Currency . "'",$db); $myrow = DB_fetch_row($result); $tableExRate = $myrow[0]; //this is the rate of exchange between the functional currency and the receipt currency /*Calculate cross rate to suggest appropriate exchange rate between receipt currency and account currency */ @@ -212,7 +209,7 @@ } /*Make an array of the defined bank accounts */ - $SQL = "SELECT accountcode FROM bankaccounts"; + $SQL = 'SELECT accountcode FROM bankaccounts'; $result = DB_query($SQL,$db); $BankAccounts = array(); $i=0; @@ -267,13 +264,13 @@ if ($ReceiptItem->GLCode !=''){ //so its a GL receipt if ($_SESSION['CompanyRecord']['gllink_debtors']==1){ /* then enter a GLTrans record */ $SQL = "INSERT INTO gltrans (type, - typeno, - trandate, - periodno, - account, - narrative, - amount, - tag) + typeno, + trandate, + periodno, + account, + narrative, + amount, + tag) VALUES ( 12, '" . $_SESSION['ReceiptBatch']->BatchNo . "', @@ -341,15 +338,15 @@ $PaymentTransNo = GetNextTransNo( 1, $db); $SQL="INSERT INTO banktrans (transno, - type, - bankact, - ref, - exrate, - functionalexrate, - transdate, - banktranstype, - amount, - currcode) + type, + bankact, + ref, + exrate, + functionalexrate, + transdate, + banktranstype, + amount, + currcode) VALUES ( '" . $PaymentTransNo . "', 1, @@ -374,18 +371,18 @@ /*Create a DebtorTrans entry for each customer deposit */ $SQL = "INSERT INTO debtortrans (transno, - type, - debtorno, - branchcode, - trandate, - inputdate, - prd, - reference, - tpe, - rate, - ovamount, - ovdiscount, - invtext) + type, + debtorno, + branchcode, + trandate, + inputdate, + prd, + reference, + tpe, + rate, + ovamount, + ovdiscount, + invtext) VALUES ( '" . $_SESSION['ReceiptBatch']->BatchNo . "', 12, @@ -426,12 +423,12 @@ if ($BatchReceiptsTotal!=0){ /* Bank account entry first */ $SQL="INSERT INTO gltrans (type, - typeno, - trandate, - periodno, - account, - narrative, - amount) + typeno, + trandate, + periodno, + account, + narrative, + amount) VALUES ( 12, '" . $_SESSION['ReceiptBatch']->BatchNo . "', @@ -448,15 +445,15 @@ /*now enter the BankTrans entry */ $SQL="INSERT INTO banktrans (type, - transno, - bankact, - ref, - exrate, - functionalexrate, - transdate, - banktranstype, - amount, - currcode) + transno, + bankact, + ref, + exrate, + functionalexrate, + transdate, + banktranstype, + amount, + currcode) VALUES ( 12, '" . $_SESSION['ReceiptBatch']->BatchNo . "', @@ -476,12 +473,12 @@ if ($BatchDebtorTotal!=0){ /* Now Credit Debtors account with receipts + discounts */ $SQL="INSERT INTO gltrans ( type, - typeno, - trandate, - periodno, - account, - narrative, - amount) + typeno, + trandate, + periodno, + account, + narrative, + amount) VALUES ( 12, '" . $_SESSION['ReceiptBatch']->BatchNo . "', @@ -500,12 +497,12 @@ if ($BatchDiscount!=0){ /* Now Debit Discount account with discounts allowed*/ $SQL="INSERT INTO gltrans ( type, - typeno, - trandate, - periodno, - account, - narrative, - amount) + typeno, + trandate, + periodno, + account, + narrative, + amount) VALUES ( 12, '" . $_SESSION['ReceiptBatch']->BatchNo . "', @@ -552,7 +549,7 @@ $SQL = "SELECT debtorsmaster.debtorno, debtorsmaster.name FROM debtorsmaster - WHERE debtorsmaster.name LIKE '". $SearchString."' + WHERE debtorsmaster.name " . LIKE . " '". $SearchString . "' AND debtorsmaster.currcode= '" . $_SESSION['ReceiptBatch']->Currency . "'"; } elseif (strlen($_POST['CustCode'])>0){ @@ -665,22 +662,22 @@ $NIL_BALANCE = True; $SQL = "SELECT debtorsmaster.name, - debtorsmaster.pymtdiscount, - currencies.currency, - currencies.rate, - paymentterms.terms, - debtorsmaster.creditlimit, - debtorsmaster.currcode, - holdreasons.dissallowinvoices, - holdreasons.reasondescription - FROM debtorsmaster, - paymentterms, - holdreasons, - currencies - WHERE debtorsmaster.paymentterms = paymentterms.termsindicator - AND debtorsmaster.currcode = currencies.currabrev - AND debtorsmaster.holdreason = holdreasons.reasoncode - AND debtorsmaster.debtorno = '" . $_POST['CustomerID'] . "'"; + debtorsmaster.pymtdiscount, + currencies.currency, + currencies.rate, + paymentterms.terms, + debtorsmaster.creditlimit, + debtorsmaster.currcode, + holdreasons.dissallowinvoices, + holdreasons.reasondescription + FROM debtorsmaster, + paymentterms, + holdreasons, + currencies + WHERE debtorsmaster.paymentterms = paymentterms.termsindicator + AND debtorsmaster.currcode = currencies.currabrev + AND debtorsmaster.holdreason = holdreasons.reasoncode + AND debtorsmaster.debtorno = '" . $_POST['CustomerID'] . "'"; $ErrMsg = _('The customer details could not be retrieved because'); $DbgMsg = _('The SQL that failed was'); @@ -813,7 +810,7 @@ <td>' . ' ' . $SuggestedFunctionalExRateText . ' <i>' . _('The exchange rate between the currency of the business (the functional currency) and the currency of the bank account') . '. 1 ' . $_SESSION['CompanyRecord']['currencydefault'] . ' = ? ' . $_SESSION['ReceiptBatch']->AccountCurrency . '</i></td></tr>'; } -echo '<tr><td>' . _('Receipt Type') . ":</td><td><select tabindex=6 name=ReceiptType>"; +echo '<tr><td>' . _('Receipt Type') . ':</td><td><select tabindex=6 name="ReceiptType">'; include('includes/GetPaymentMethods.php'); /* The array ReceiptTypes is defined from the setup tab of the main menu under payment methods - the array is populated from the include file GetPaymentMethods.php */ @@ -853,7 +850,7 @@ foreach ($_SESSION['ReceiptBatch']->Items as $ReceiptItem) { - $SQL = "select accountname FROM chartmaster WHERE accountcode='" . $ReceiptItem->GLCode . "'"; + $SQL = "SELECT accountname FROM chartmaster WHERE accountcode='" . $ReceiptItem->GLCode . "'"; $Result=DB_query($SQL,$db); $myrow=DB_fetch_array($Result); @@ -863,11 +860,9 @@ <td>' . stripslashes($ReceiptItem->CustomerName) . '</td> <td>'.$ReceiptItem->GLCode.' - '.$myrow['accountname'].'</td> <td>'.$ReceiptItem->Narrative . "</td> - <td><a href='" . $_SERVER['PHP_SELF'] . '?' . SID . '&Delete=' . $ReceiptItem->ID . "&Type=".$_GET['Type']."'>" . _('Delete') . '</a></td> + <td><a href='" . $_SERVER['PHP_SELF'] . '?Delete=' . $ReceiptItem->ID . "&Type=".$_GET['Type']."'>" . _('Delete') . '</a></td> </tr>'; - $BatchTotal= $BatchTotal + $ReceiptItem->Amount; - } echo '<tr><td class=number><b>' . number_format($BatchTotal,2) . '</b></td></tr></table>'; @@ -939,7 +934,7 @@ echo '<tr><td>' . _('Select Tag') . ':</td><td><select name="tag">'; $SQL = 'SELECT tagref, - tagdescription + tagdescription FROM tags ORDER BY tagref'; @@ -947,9 +942,9 @@ echo '<option value=0></option>'; while ($myrow=DB_fetch_array($result)){ if (isset($_POST['tag']) and $_POST['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></tr>'; @@ -1075,7 +1070,7 @@ } //end if results to show if (isset($_SESSION['ReceiptBatch']->Items) and count($_SESSION['ReceiptBatch']->Items) > 0){ - echo '<div class="centre"><br/><input tabindex=13 type=submit name="CommitBatch" VALUE="' . _('Accept and Process Batch') . '"></div>'; + echo '<div class="centre"><br/><input tabindex="13" type="submit" name="CommitBatch" VALUE="' . _('Accept and Process Batch') . '"></div>'; } } Modified: trunk/Customers.php =================================================================== --- trunk/Customers.php 2011-03-28 09:49:25 UTC (rev 4520) +++ trunk/Customers.php 2011-03-29 09:04:20 UTC (rev 4521) @@ -1,10 +1,7 @@ <?php /* $Id$ */ -/* $Revision: 1.44 $ */ -//$PageSecurity = 3; - include('includes/session.inc'); $title = _('Customer Maintenance'); @@ -56,9 +53,6 @@ prnMsg( _('The customer code cannot contain any of the following characters') . " . - ' & + \" " . _('or a space'),'error'); $Errors[$i] = 'DebtorNo'; $i++; -// } elseif (ContainsIllegalCharacters($_POST['Address1']) OR ContainsIllegalCharacters($_POST['Address2'])) { -// $InputError = 1; -// prnMsg( _('Lines of the address must not contain illegal characters'),'error'); } elseif (strlen($_POST['Address1']) >40) { $InputError = 1; prnMsg( _('The Line 1 of the address must be forty characters or less long'),'error'); @@ -225,7 +219,7 @@ $ErrMsg = _('The customer could not be updated because'); $result = DB_query($sql,$db,$ErrMsg); prnMsg( _('Customer updated'),'success'); - echo '<br>'; + echo '<br />'; } else { //it is a new customer /* set the DebtorNo if $AutoDebtorNo in config.php has been set to @@ -314,7 +308,7 @@ if ($myrow[0]>0) { $CancelDelete = 1; prnMsg( _('This customer cannot be deleted because there are transactions that refer to it'),'warn'); - echo '<br> ' . _('There are') . ' ' . $myrow[0] . ' ' . _('transactions against this customer'); + echo '<br /> ' . _('There are') . ' ' . $myrow[0] . ' ' . _('transactions against this customer'); } else { $sql= "SELECT COUNT(*) FROM salesorders WHERE debtorno='" . $_POST['DebtorNo'] . "'"; @@ -323,7 +317,7 @@ if ($myrow[0]>0) { $CancelDelete = 1; prnMsg( _('Cannot delete the customer record because orders have been created against it'),'warn'); - echo '<br> ' . _('There are') . ' ' . $myrow[0] . ' ' . _('orders against this customer'); + echo '<br /> ' . _('There are') . ' ' . $myrow[0] . ' ' . _('orders against this customer'); } else { $sql= "SELECT COUNT(*) FROM salesanalysis WHERE cust='" . $_POST['DebtorNo'] . "'"; $result = DB_query($sql,$db); @@ -331,7 +325,7 @@ if ($myrow[0]>0) { $CancelDelete = 1; prnMsg( _('Cannot delete this customer record because sales analysis records exist for it'),'warn'); - echo '<br> ' . _('There are') . ' ' . $myrow[0] . ' ' . _('sales analysis records against this customer'); + echo '<br /> ' . _('There are') . ' ' . $myrow[0] . ' ' . _('sales analysis records against this customer'); } else { $sql= "SELECT COUNT(*) FROM custbranch WHERE debtorno='" . $_POST['DebtorNo'] . "'"; $result = DB_query($sql,$db); @@ -339,7 +333,7 @@ if ($myrow[0]>0) { $CancelDelete = 1; prnMsg(_('Cannot delete this customer because there are branch records set up against it'),'warn'); - echo '<br> ' . _('There are') . ' ' . $myrow[0] . ' ' . _('branch records relating to this customer'); + echo '<br /> ' . _('There are') . ' ' . $myrow[0] . ' ' . _('branch records relating to this customer'); } } } @@ -418,7 +412,7 @@ } // This link is already on menu bar -//echo "<a href='" . $rootpath . '/SelectCustomer.php?' . SID . "'>" . _('Back to Customers') . '</a><br>'; +//echo "<a href='" . $rootpath . '/SelectCustomer.php?' . SID . "'>" . _('Back to Customers') . '</a><br />'; if (!isset($DebtorNo)) { @@ -494,7 +488,7 @@ $result=DB_query('SELECT typeabbrev, sales_type FROM salestypes ',$db); if (DB_num_rows($result)==0){ $DataError =1; - echo '<a href="SalesTypes.php?" target="_parent">Setup Types</a>'; + echo '<a href="SalesTypes.php?" target="_parent">' . _('Setup Types') . '</a>'; echo '<tr><td colspan=2>' . prnMsg(_('No sales types/price lists defined'),'error') . '</td></tr>'; } else { echo '<tr><td>' . _('Sales Type/Price List') . ':</td> @@ -508,10 +502,10 @@ } // Show Customer Type drop down list - $result=DB_query('SELECT typeid, typename FROM debtortype ',$db); + $result=DB_query('SELECT typeid, typename FROM debtortype', $db); if (DB_num_rows($result)==0){ $DataError =1; - echo '<a href="SalesTypes.php?" target="_parent">Setup Types</a>'; + echo '<a href="SalesTypes.php?" target="_parent">' . _('Setup Types') . '</a>'; echo '<tr><td colspan=2>' . prnMsg(_('No Customer types/price lists defined'),'error') . '</td></tr>'; } else { echo '<tr><td>' . _('Customer Type') . ':</td> @@ -524,12 +518,9 @@ echo '</select></td></tr>'; } - - - - $DateString = Date($_SESSION['DefaultDateFormat']); - echo '<tr><td>' . _('Customer Since') . ' (' . $_SESSION['DefaultDateFormat'] . '):</td><td><input tabindex=10 type="text" class="date" alt="'.$_SESSION['DefaultDateFormat'].'" name="ClientSince" value="' . $DateString . '" size=12 maxlength=10></td></tr>'; + echo '<tr><td>' . _('Customer Since') . ' (' . $_SESSION['DefaultDateFormat'] . '):</td> + <td><input tabindex=10 type="text" class="date" alt="'.$_SESSION['DefaultDateFormat'].'" name="ClientSince" value="' . $DateString . '" size=12 maxlength=10></td></tr>'; echo '<tr><td>' . _('Discount Percent') . ':</td> <td><input tabindex=11 type="textbox" class="number" name="Discount" value=0 size=5 maxlength=4></td></tr>'; echo '<tr><td>' . _('Discount Code') . ':</td> @@ -594,20 +585,19 @@ echo '</select></td></tr>'; } - /*added line 8/23/2007 by Morris Kelly to set po line parameter Y/N*/ - echo '<tr><td>' . _('Customer PO Line on SO') . ":</td><td><select tabindex=18 name='CustomerPOLine'>"; - echo '<option selected value=0>' . _('No'); - echo '<option value=1>' . _('Yes'); + echo '<tr><td>' . _('Customer PO Line on SO') . ':</td><td><select tabindex="18" name="CustomerPOLine">'; + echo '<option selected value=0>' . _('No') . '</option>'; + echo '<option value=1>' . _('Yes') . '</option>'; echo '</select></td></tr>'; - echo '<tr><td>' . _('Invoice Addressing') . ":</td><td><select tabindex=19 name='AddrInvBranch'>"; + echo '<tr><td>' . _('Invoice Addressing') . ':</td><td><select tabindex="19" name="AddrInvBranch">'; echo '<option selected VALUE=0>' . _('Address to HO'); echo '<option VALUE=1>' . _('Address to Branch'); echo '</select></td></tr>'; echo'</table></td></tr></table>'; if ($DataError ==0){ - echo "<br><div class='centre'><input tabindex=20 type='Submit' name='submit' value='" . _('Add New Customer') . "'> <input tabindex=21 type=submit action=RESET VALUE='" . _('Reset') . "'></div>"; + echo "<br /><div class='centre'><input tabindex=20 type='Submit' name='submit' value='" . _('Add New Customer') . "'> <input tabindex=21 type=submit action=RESET VALUE='" . _('Reset') . "'></div>"; } echo '</form>'; @@ -990,7 +980,7 @@ Where debtorno='".$DebtorNo."' and contid='".$Edit."'"; $resultupcc = DB_query($SQLupdatecc,$db); - echo '<br>'.$SQLupdatecc; + echo '<br />'.$SQLupdatecc; echo '<meta http-equiv="Refresh" content="0; url="' . $_SERVER['PHP_SELF'] . '?'.SID.'&DebtorNo='.$DebtorNo.'&ID='.$ID.'">'; } if (isset($_GET['delete'])) { @@ -999,7 +989,7 @@ $resultupcc = DB_query($SQl,$db); echo '<meta http-equiv="Refresh" content="0; url=' . $_SERVER['PHP_SELF'] . '?'.SID.'&DebtorNo='.$DebtorNo.'">'; - echo '<br>'.$SQl; + echo '<br />'.$SQl; prnmsg('Contact Deleted','success'); } @@ -1007,18 +997,18 @@ echo'</td></tr></table>'; if (isset($_POST['New']) and $_POST['New']) { - echo "<div class='centre'><input type='Submit' name='submit' VALUE='" . _('Add New Customer') . - "'> <input type=submit name='reset' VALUE='" . _('Reset') . "'></div></form>"; + echo '<div class="centre"><input type="Submit" name="submit" VALUE="' . _('Add New Customer') . + '"> <input type=submit name="reset" VALUE="' . _('Reset') . '"></div></form>'; } else if (!isset($_GET['Modify'])){ - echo "<br><div class='centre'><input type='Submit' name='submit' VALUE='" . _('Update Customer') . "'>"; + echo '<br /><div class="centre"><input type="Submit" name="submit" VALUE="' . _('Update Customer') . '">'; echo ' <input type="Submit" name="delete" VALUE="' . _('Delete Customer') . '" onclick="return confirm(\'' . _('Are You Sure?') . '\');">'; } if(isset($_POST['addcontact']) AND (isset($_POST['addcontact'])!='')) { - echo '<meta http-equiv="Refresh" content="0; url=' . $rootpath . '/AddCustomerContacts.php?' . SID . '&DebtorNo=' .$DebtorNo.'">'; + echo '<meta http-equiv="Refresh" content="0; url=' . $rootpath . '/AddCustomerContacts.php?DebtorNo=' .$DebtorNo.'">'; } echo '</div>'; } // end of main ifs include('includes/footer.inc'); -?> +?> \ No newline at end of file Modified: trunk/MRP.php ===========================================... [truncated message content] |
From: <dai...@us...> - 2011-03-29 09:04:29
|
Revision: 4521 http://web-erp.svn.sourceforge.net/web-erp/?rev=4521&view=rev Author: daintree Date: 2011-03-29 09:04:20 +0000 (Tue, 29 Mar 2011) Log Message: ----------- SQL to ansi and other html to xhtml Modified Paths: -------------- trunk/BOMExtendedQty.php trunk/BOMIndented.php trunk/BOMIndentedReverse.php trunk/COGSGLPostings.php trunk/CompanyPreferences.php trunk/Credit_Invoice.php trunk/CustomerReceipt.php trunk/Customers.php trunk/MRP.php trunk/api/api_branches.php trunk/api/api_currencies.php trunk/api/api_customers.php trunk/api/api_customertypes.php trunk/api/api_glaccounts.php trunk/api/api_holdreasons.php trunk/api/api_locations.php trunk/api/api_salesareas.php trunk/api/api_salesman.php trunk/api/api_salesorders.php trunk/api/api_salestypes.php trunk/api/api_shippers.php trunk/api/api_stock.php trunk/api/api_stockcategories.php trunk/api/api_suppliers.php trunk/api/api_taxgroups.php trunk/api/api_workorders.php trunk/includes/ConnectDB_mysql.inc Added Paths: ----------- trunk/locale/zh_CN.utf8/Manual/ManualSalesAnalysis.html trunk/locale/zh_CN.utf8/Manual/ManualSalesPeople.html trunk/locale/zh_CN.utf8/Manual/ManualShipments.html Modified: trunk/BOMExtendedQty.php =================================================================== --- trunk/BOMExtendedQty.php 2011-03-28 09:49:25 UTC (rev 4520) +++ trunk/BOMExtendedQty.php 2011-03-29 09:04:20 UTC (rev 4521) @@ -2,8 +2,6 @@ /* $Id$*/ -/* $Revision: 1.8 $ */ - // BOMExtendedQty.php - Quantiy Extended Bill of Materials //$PageSecurity = 2; include('includes/session.inc'); @@ -30,7 +28,7 @@ $sql = 'CREATE TEMPORARY TABLE passbom ( part char(20), extendedqpa double, - sortpart text)'; + sortpart text) DEFAULT CHARSET=utf8'; $ErrMsg = _('The SQL to to create passbom failed with the message'); $result = DB_query($sql,$db,$ErrMsg); @@ -43,7 +41,7 @@ loccode char(5), effectiveafter date, effectiveto date, - quantity double)'; + quantity double) DEFAULT CHARSET=utf8'; $result = DB_query($sql,$db,_('Create of tempbom failed because')); // First, find first level of components below requested assembly // Put those first level parts in passbom, use COMPONENT in passbom @@ -56,8 +54,9 @@ (" . $_POST['Quantity'] . " * bom.quantity) as extendedqpa, CONCAT(bom.parent,bom.component) AS sortpart FROM bom - WHERE bom.parent =" . "'" . $_POST['Part'] . "' - AND bom.effectiveto >= NOW() AND bom.effectiveafter <= NOW()"; + WHERE bom.parent ='" . $_POST['Part'] . "' + AND bom.effectiveto >= NOW() + AND bom.effectiveafter <= NOW()"; $result = DB_query($sql,$db); $levelctr = 2; @@ -82,8 +81,9 @@ bom.effectiveto, (" . $_POST['Quantity'] . " * bom.quantity) as extendedqpa FROM bom - WHERE bom.parent =" . "'" . $_POST['Part'] . "' - AND bom.effectiveto >= NOW() AND bom.effectiveafter <= NOW()"; + WHERE bom.parent ='" . $_POST['Part'] . "' + AND bom.effectiveto >= NOW() + AND bom.effectiveafter <= NOW()"; $result = DB_query($sql,$db); //echo "</br>sql is $sql</br>"; // This while routine finds the other levels as long as $componentctr - the @@ -114,7 +114,8 @@ (bom.quantity * passbom.extendedqpa) FROM bom,passbom WHERE bom.parent = passbom.part - AND bom.effectiveto >= NOW() AND bom.effectiveafter <= NOW()"; + AND bom.effectiveto >= NOW() + AND bom.effectiveafter <= NOW()"; $result = DB_query($sql,$db); $sql = 'DROP TABLE IF EXISTS passbom2'; @@ -129,7 +130,7 @@ $sql = 'CREATE TEMPORARY TABLE passbom ( part char(20), extendedqpa decimal(10,3), - sortpart text)'; + sortpart text) DEFAULT CHARSET=utf8'; $result = DB_query($sql,$db); @@ -138,13 +139,15 @@ (bom.quantity * passbom2.extendedqpa), CONCAT(passbom2.sortpart,bom.component) AS sortpart FROM bom,passbom2 - WHERE bom.parent = passbom2.part - AND bom.effectiveto >= NOW() AND bom.effectiveafter <= NOW()"; + WHERE bom.parent = passbom2.part + AND bom.effectiveto >= NOW() + AND bom.effectiveafter <= NOW()"; $result = DB_query($sql,$db); - $sql = 'SELECT COUNT(*) FROM bom,passbom WHERE bom.parent = passbom.part - GROUP BY passbom.part'; + $sql = 'SELECT COUNT(*) FROM bom, passbom + WHERE bom.parent = passbom.part + GROUP BY passbom.part'; $result = DB_query($sql,$db); $myrow = DB_fetch_row($result); @@ -156,9 +159,9 @@ $title = _('Quantity Extended BOM Listing') . ' - ' . _('Problem Report'); include('includes/header.inc'); prnMsg( _('The Quantiy Extended BOM Listing 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; @@ -168,11 +171,11 @@ $Right_Margin); $sql = "SELECT stockmaster.stockid,stockmaster.description FROM stockmaster - WHERE stockid = " . "'" . $_POST['Part'] . "'"; + WHERE stockid = '" . $_POST['Part'] . "'"; $result = DB_query($sql,$db); $myrow = DB_fetch_array($result,$db); - $assembly = $_POST['Part']; - $assemblydesc = $myrow['description']; + $Assembly = $_POST['Part']; + $AssemblyDescription = $myrow['description']; $FontSize=8; $Tot_Val=0; @@ -209,14 +212,12 @@ $ListCount = DB_num_rows($result); // UldisN While ($myrow = DB_fetch_array($result,$db)){ - - // Parameters for addTextWrap are defined in /includes/class.pdf.php // 1) X position 2) Y position 3) Width // 4) Height 5) Text 6) Alignment 7) Border 8) Fill - True to use SetFillColor // and False to set to transparent - $difference = $myrow['quantity'] - ($myrow['qoh'] + $myrow['poqty'] + $myrow['woqty']); - if (($_POST['Select'] == 'All') or ($difference > 0)) { + $Difference = $myrow['quantity'] - ($myrow['qoh'] + $myrow['poqty'] + $myrow['woqty']); + if (($_POST['Select'] == 'All') or ($Difference > 0)) { $YPos -=$line_height; $FontSize=8; // Use to alternate between lines with transparent and painted background @@ -234,7 +235,7 @@ $myrow['decimalplaces']),'right',0,$fill); $pdf->addTextWrap(440,$YPos,40,$FontSize,number_format($myrow['woqty'], $myrow['decimalplaces']),'right',0,$fill); - $pdf->addTextWrap(480,$YPos,50,$FontSize,number_format($difference, + $pdf->addTextWrap(480,$YPos,50,$FontSize,number_format($Difference, $myrow['decimalplaces']),'right',0,$fill); } if ($YPos < $Bottom_Margin + $line_height){ @@ -251,33 +252,18 @@ PrintHeader($pdf,$YPos,$PageNumber,$Page_Height,$Top_Margin,$Left_Margin,$Page_Width, $Right_Margin); } -/* Uldisn:This actually would produce the output - $pdfcode = $pdf->output(); - $len = strlen($pdfcode); -*/ -// if ($len<=20){ - if ($ListCount == 0) { //UldisN - $title = _('Print Indented BOM Listing Error'); - include('includes/header.inc'); - prnMsg(_('There were no items for the selected assembly'),'error'); - echo "<br><a href='$rootpath/index.php?" . SID . "'>" . _('Back to the menu') . '</a>'; - include('includes/footer.inc'); - exit; + if ($ListCount == 0) { + $title = _('Print Indented BOM Listing Error'); + include('includes/header.inc'); + prnMsg(_('There were no items for the selected assembly'),'error'); + echo "<br /><a href='$rootpath/index.php?" . SID . "'>" . _('Back to the menu') . '</a>'; + include('includes/footer.inc'); + exit; } else { -/* UldisN - header('Content-type: application/pdf'); - header("Content-Length: " . $len); - header('Content-Disposition: inline; filename=Customer_trans.pdf'); - header('Expires: 0'); - header('Cache-Control: private, post-check=0, pre-check=0'); - header('Pragma: public'); + $pdf->OutputD($_SESSION['DatabaseName'] . '_BOM_Extended_Qty_' . date('Y-m-d').'.pdf'); + $pdf->__destruct(); + } - $pdf->Output('BOMExtendedQty', 'I'); -*/ - $pdf->OutputD($_SESSION['DatabaseName'] . '_Customer_trans_' . date('Y-m-d').'.pdf');//UldisN - $pdf-> __destruct(); - } - } else { /*The option to print PDF was not hit so display form */ $title=_('Quantity Extended BOM Listing'); @@ -297,7 +283,7 @@ echo "<option selected value='yes'>" . _('Print With Alternating Highlighted Lines'); echo "<option value='no'>" . _('Plain Print'); echo '</select></td></tr>'; - echo "</table></br></br><div class='centre'><br><input type=submit name='PrintPDF' value='" . _('Print PDF') . "'></div>"; + echo "</table></br></br><div class='centre'><br /><input type=submit name='PrintPDF' value='" . _('Print PDF') . "'></div>"; include('includes/footer.inc'); @@ -348,6 +334,4 @@ $YPos =$YPos - (2*$line_height); $PageNumber++; } // End of PrintHeader function - - ?> Modified: trunk/BOMIndented.php =================================================================== --- trunk/BOMIndented.php 2011-03-28 09:49:25 UTC (rev 4520) +++ trunk/BOMIndented.php 2011-03-29 09:04:20 UTC (rev 4521) @@ -2,10 +2,8 @@ /* $Id$*/ -/* $Revision: 1.5 $ */ - // BOMIndented.php - Indented Bill of Materials -//$PageSecurity = 2; + include('includes/session.inc'); if (isset($_POST['PrintPDF'])) { @@ -25,7 +23,7 @@ $result = DB_query($sql,$db); $sql = 'CREATE TEMPORARY TABLE passbom ( part char(20), - sortpart text)'; + sortpart text) DEFAULT CHARSET=utf8'; $ErrMsg = _('The SQL to create passbom failed with the message'); $result = DB_query($sql,$db,$ErrMsg); @@ -38,7 +36,7 @@ loccode char(5), effectiveafter date, effectiveto date, - quantity double)'; + quantity double) DEFAULT CHARSET=utf8'; $result = DB_query($sql,$db,_('Create of tempbom failed because')); // First, find first level of components below requested assembly // Put those first level parts in passbom, use COMPONENT in passbom @@ -50,8 +48,9 @@ SELECT bom.component AS part, CONCAT(bom.parent,bom.component) AS sortpart FROM bom - WHERE bom.parent =" . "'" . $_POST['Part'] . "' - AND bom.effectiveto >= NOW() AND bom.effectiveafter <= NOW()"; + WHERE bom.parent ='" . $_POST['Part'] . "' + AND bom.effectiveto >= NOW() + AND bom.effectiveafter <= NOW()"; $result = DB_query($sql,$db); $levelctr = 2; @@ -77,7 +76,8 @@ bom.quantity FROM bom WHERE bom.parent ='" . $_POST['Part'] . "' - AND bom.effectiveto >= NOW() AND bom.effectiveafter <= NOW()"; + AND bom.effectiveto >= NOW() + AND bom.effectiveafter <= NOW()"; $result = DB_query($sql,$db); //echo "</br>sql is $sql</br>"; // This while routine finds the other levels as long as $componentctr - the @@ -107,7 +107,7 @@ bom.effectiveafter, bom.effectiveto, bom.quantity - FROM bom,passbom + FROM bom, passbom WHERE bom.parent = passbom.part AND bom.effectiveto >= NOW() AND bom.effectiveafter <= NOW()"; $result = DB_query($sql,$db); @@ -123,16 +123,17 @@ $sql = 'CREATE TEMPORARY TABLE passbom ( part char(20), - sortpart text)'; + sortpart text) DEFAULT CHARSET=utf8'; $result = DB_query($sql,$db); - $sql = "INSERT INTO passbom (part, sortpart) + $sql = 'INSERT INTO passbom (part, sortpart) SELECT bom.component AS part, CONCAT(passbom2.sortpart,bom.component) AS sortpart FROM bom,passbom2 WHERE bom.parent = passbom2.part - AND bom.effectiveto >= NOW() AND bom.effectiveafter <= NOW()"; + AND bom.effectiveto >= NOW() + AND bom.effectiveafter <= NOW()'; $result = DB_query($sql,$db); @@ -181,9 +182,9 @@ // $fill is used to alternate between lines with transparent and painted background $fill = false; - $pdf->SetFillColor(224,235,255); + $pdf->SetFillColor(224,235,255); - $ListCount = DB_num_rows($result); // UldisN + $ListCount = DB_num_rows($result); while ($myrow = DB_fetch_array($result,$db)){ @@ -239,19 +240,8 @@ include('includes/footer.inc'); exit; } else { - /* UldisN - header('Content-type: application/pdf'); - header("Content-Length: " . $len); - header('Content-Disposition: inline; filename=Customer_trans.pdf'); - header('Expires: 0'); - header('Cache-Control: private, post-check=0, pre-check=0'); - header('Pragma: public'); - - $pdf->Output('BOMIndented.pdf', 'I'); - */ - $pdf->OutputD($_SESSION['DatabaseName'] . '_Customer_trans_' . date('Y-m-d').'.pdf');//UldisN - $pdf-> __destruct(); - + $pdf->OutputD($_SESSION['DatabaseName'] . '_Customer_trans_' . date('Y-m-d').'.pdf');//UldisN + $pdf->__destruct(); } } else { /*The option to print PDF was not hit so display form */ @@ -333,5 +323,4 @@ } // End of PrintHeader function - -?> +?> \ No newline at end of file Modified: trunk/BOMIndentedReverse.php =================================================================== --- trunk/BOMIndentedReverse.php 2011-03-28 09:49:25 UTC (rev 4520) +++ trunk/BOMIndentedReverse.php 2011-03-29 09:04:20 UTC (rev 4521) @@ -2,11 +2,9 @@ /* $Id$*/ -/* $Revision: 1.1 $ */ - // BOMIndented.php - Reverse Indented Bill of Materials - From lowest level component to top level // assembly -//$PageSecurity = 2; + include('includes/session.inc'); if (isset($_POST['PrintPDF'])) { @@ -26,7 +24,8 @@ $result = DB_query($sql,$db); $sql = 'CREATE TEMPORARY TABLE passbom ( part char(20), - sortpart text)'; + sortpart text) DEFAULT CHARSET=utf8'; + $ErrMsg = _('The SQL to to create passbom failed with the message'); $result = DB_query($sql,$db,$ErrMsg); @@ -39,7 +38,7 @@ loccode char(5), effectiveafter date, effectiveto date, - quantity double)'; + quantity double) DEFAULT CHARSET=utf8'; $result = DB_query($sql,$db,_('Create of tempbom failed because')); // First, find first level of components below requested assembly // Put those first level parts in passbom, use COMPONENT in passbom @@ -51,8 +50,9 @@ SELECT bom.parent AS part, CONCAT(bom.component,bom.parent) AS sortpart FROM bom - WHERE bom.component =" . "'" . $_POST['Part'] . "' - AND bom.effectiveto >= NOW() AND bom.effectiveafter <= NOW()"; + WHERE bom.component ='" . $_POST['Part'] . "' + AND bom.effectiveto >= NOW() + AND bom.effectiveafter <= NOW()"; $result = DB_query($sql,$db); $levelctr = 2; @@ -78,7 +78,8 @@ bom.quantity FROM bom WHERE bom.component ='" . $_POST['Part'] . "' - AND bom.effectiveto >= NOW() AND bom.effectiveafter <= NOW()"; + AND bom.effectiveto >= NOW() + AND bom.effectiveafter <= NOW()"; $result = DB_query($sql,$db); // This while routine finds the other levels as long as $componentctr - the @@ -107,9 +108,10 @@ bom.effectiveafter, bom.effectiveto, bom.quantity - FROM bom,passbom - WHERE bom.component = passbom.part - AND bom.effectiveto >= NOW() AND bom.effectiveafter <= NOW()"; + FROM bom,passbom + WHERE bom.component = passbom.part + AND bom.effectiveto >= NOW() + AND bom.effectiveafter <= NOW()"; $result = DB_query($sql,$db); $sql = 'DROP TABLE IF EXISTS passbom2'; @@ -123,7 +125,7 @@ $sql = 'CREATE TEMPORARY TABLE passbom ( part char(20), - sortpart text)'; + sortpart text) DEFAULT CHARSET=utf8'; $result = DB_query($sql,$db); @@ -132,7 +134,8 @@ CONCAT(passbom2.sortpart,bom.parent) AS sortpart FROM bom,passbom2 WHERE bom.component = passbom2.part - AND bom.effectiveto >= NOW() AND bom.effectiveafter <= NOW()"; + AND bom.effectiveto >= NOW() + AND bom.effectiveafter <= NOW()"; $result = DB_query($sql,$db); @@ -160,7 +163,7 @@ $sql = "SELECT stockmaster.stockid, stockmaster.description FROM stockmaster - WHERE stockid = " . "'" . $_POST['Part'] . "'"; + WHERE stockid = '" . $_POST['Part'] . "'"; $result = DB_query($sql,$db); $myrow = DB_fetch_array($result,$db); $assembly = $_POST['Part']; @@ -222,12 +225,6 @@ PrintHeader($pdf,$YPos,$PageNumber,$Page_Height,$Top_Margin,$Left_Margin,$Page_Width, $Right_Margin,$assemblydesc); } -/* UldisN - $pdfcode = $pdf->output(); - $len = strlen($pdfcode); - - if ($len<=20){ -*/ if ($ListCount == 0) { $title = _('Print Reverse Indented BOM Listing Error'); include('includes/header.inc'); @@ -236,16 +233,8 @@ include('includes/footer.inc'); exit; } else { -// header('Content-type: application/pdf'); -// header("Content-Length: " . $len); -// header('Content-Disposition: inline; filename=Customer_trans.pdf'); -// header('Expires: 0'); -// header('Cache-Control: private, post-check=0, pre-check=0'); -// header('Pragma: public'); -// -// $pdf->Output('BOMIndentedReverse.pdf', 'I'); - $pdf->OutputD($_SESSION['DatabaseName'] . '_Customer_trans_' . date('Y-m-d').'.pdf');//UldisN - $pdf-> __destruct(); + $pdf->OutputD($_SESSION['DatabaseName'] . '_Customer_trans_' . date('Y-m-d').'.pdf');//UldisN + $pdf->__destruct(); } } else { /*The option to print PDF was not hit so display form */ @@ -255,7 +244,7 @@ echo '<p class="page_title_text"><img src="'.$rootpath.'/css/'.$theme.'/images/maintenance.png" title="' . _('Search') . '" alt="" />' . ' ' . $title.'</p><br />'; - echo '</br></br><form action=' . $_SERVER['PHP_SELF'] . " method='post'><table class=selection>"; + echo '</br></br><form action=' . $_SERVER['PHP_SELF'] . ' method="post"><table class="selection">'; echo '<input type="hidden" name="FormID" value="' . $_SESSION['FormID'] . '" />'; echo '<tr><td>' . _('Part') . ":</td>"; echo "<td><input type ='text' name='Part' size='20'>"; @@ -319,5 +308,4 @@ } // End of PrintHeader function - -?> +?> \ No newline at end of file Modified: trunk/COGSGLPostings.php =================================================================== --- trunk/COGSGLPostings.php 2011-03-28 09:49:25 UTC (rev 4520) +++ trunk/COGSGLPostings.php 2011-03-29 09:04:20 UTC (rev 4521) @@ -58,7 +58,7 @@ $result = DB_query($sql,$db); prnMsg ($msg,'info'); - echo '<br>'; + echo '<br />'; unset ($SelectedCOGSPostingID); } elseif (isset($_GET['delete'])) { @@ -67,7 +67,7 @@ $sql="DELETE FROM cogsglpostings WHERE id='".$SelectedCOGSPostingID."'"; $result = DB_query($sql,$db); prnMsg( _('The cost of sales posting code record has been deleted'),'info'); - echo '<br>'; + echo '<br />'; unset ($SelectedCOGSPostingID); } @@ -90,11 +90,11 @@ $ShowLivePostingRecords = false; prnMsg (_('The following cost of sales posting records that do not have valid general ledger code specified - these records must be amended.'),'error'); echo '<table class=selection>'; - echo "<tr><th>" . _('Area') . "</th> - <th>" . _('Stock Category') . "</th> - <th>" . _('Sales Type') . "</th> - <th>" . _('COGS Account') . "</th> - </tr>"; + echo '<tr><th>' . _('Area') . '</th> + <th>' . _('Stock Category') . '</th> + <th>' . _('Sales Type') . '</th> + <th>' . _('COGS Account') . '</th> + </tr>'; $k=0; //row colour counter while ($myrow = DB_fetch_row($result)) { @@ -116,9 +116,9 @@ $myrow[2], $myrow[3], $myrow[4], - $_SERVER['PHP_SELF'] . '?' . SID . '&', + $_SERVER['PHP_SELF'] . '?', $myrow[0], - $_SERVER['PHP_SELF']. '?' . SID . '&', + $_SERVER['PHP_SELF']. '?', $myrow[0]); }//end while echo '</table>'; @@ -146,13 +146,13 @@ sequenceintb ) VALUES ( 'Sales', - 1, - 1, - 10)"; + '1', + '1', + '10')"; $result = DB_query($sql,$db); } - $sql = 'SELECT accountcode FROM chartmaster WHERE accountcode =1'; + $sql = "SELECT accountcode FROM chartmaster WHERE accountcode ='1' "; $result = DB_query($sql,$db); if (DB_num_rows($result)==0){ /* account number 1 is not used, so insert a new account */ @@ -162,7 +162,7 @@ group_ ) VALUES ( - 1, + '1', 'Default Sales/Discounts', 'Sales' )"; @@ -177,7 +177,7 @@ VALUES ('AN', 'ANY', 'AN', - 1)"; + '1')"; $result = DB_query($sql,$db); } @@ -194,14 +194,11 @@ $result = DB_query($sql,$db); echo '<table class=selection>'; - echo '<tr><th>' . _('Area') . - '</th><th>' . _('Stock Category') . - '</th><th>' . _('Sales Type') . - '</th><th>' . _('GL Account') . - '</th></tr>'; - + echo '<tr><th>' . _('Area') . '</th> + <th>' . _('Stock Category') . '</th> + <th>' . _('Sales Type') . '</th> + <th>' . _('GL Account') . '</th></tr>'; $k = 0; - while ($myrow = DB_fetch_row($result)) { if ($k==1){ echo '<tr class="EvenTableRows">'; @@ -222,9 +219,9 @@ $myrow[2], $myrow[3], $myrow[4], - $_SERVER['PHP_SELF'] . '?' . SID . '&', + $_SERVER['PHP_SELF'] . '?', $myrow[0], - $_SERVER['PHP_SELF'] . '?' . SID . '&', + $_SERVER['PHP_SELF'] . '?', $myrow[0]); }//END WHILE LIST LOOP @@ -234,12 +231,12 @@ //end of ifs and buts! if (isset($SelectedCOGSPostingID)) { - echo "<div class='centre'><a href=" . $_SERVER['PHP_SELF'] .">" . _('Show all cost of sales posting records') . "</a></div>"; + echo '<div class="centre"><a href="' . $_SERVER['PHP_SELF'] .'">' . _('Show all cost of sales posting records') . '</a></div>'; } -echo "<p>"; +echo '<p />'; -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'] . '" />'; if (isset($SelectedCOGSPostingID)) { @@ -265,20 +262,23 @@ } //end of if $SelectedCOGSPostingID only do the else when a new record is being entered -$sql = "SELECT areacode, +$sql = 'SELECT areacode, areadescription - FROM areas"; + FROM areas'; $result = DB_query($sql,$db); -echo "<table class=selection><tr><td>" . _('Area') . ":</td><td><select tabindex=1 name='Area'><option value='AN'>" . _('Any Other'); +echo '<table class=selection> + <tr><td>' . _('Area') . ':</td> + <td><select tabindex=1 name="Area"> + <option value="AN">' . _('Any Other') . '</option>'; while ($myrow = DB_fetch_array($result)) { if (isset($_POST['Area']) and $myrow['areacode']==$_POST['Area']) { - echo "<option selected VALUE='"; + echo '<option selected VALUE="'; } else { - echo "<option VALUE='"; + echo '<option VALUE="'; } - echo $myrow['areacode'] . "'>" . $myrow['areadescription']; + echo $myrow['areacode'] . '">' . $myrow['areadescription'] . '</option>'; } //end while loop DB_free_result($result); @@ -286,16 +286,18 @@ $sql = 'SELECT categoryid, categorydescription FROM stockcategory'; $result = DB_query($sql,$db); -echo "</select></td></tr><tr><td>" . _('Stock Category') . ":</td><td><select tabindex=2 name='StkCat'> - <option VALUE='ANY'>" . _('Any Other'); +echo '</select></td></tr> + <tr><td>' . _('Stock Category') . ':</td> + <td><select tabindex=2 name="StkCat"> + <option VALUE="ANY">' . _('Any Other') . '</option>'; while ($myrow = DB_fetch_array($result)) { if (isset($_POST['StkCat']) and $myrow["categoryid"]==$_POST['StkCat']) { - echo "<option selected VALUE='"; + echo '<option selected VALUE="'; } else { - echo "<option VALUE='"; + echo '<option VALUE="'; } - echo $myrow['categoryid'] . "'>" . $myrow['categorydescription']; + echo $myrow['categoryid'] . '">' . $myrow['categorydescription'] . '</option>'; } //end while loop @@ -304,23 +306,27 @@ $sql = 'SELECT typeabbrev, sales_type FROM salestypes'; $result = DB_query($sql,$db); -echo "</select></td></tr><tr><td>" . _('Sales Type') . " / " . _('Price List') . ":</td> - <td><select tabindex=3 name='SalesType'><option VALUE='AN'>" . _('Any Other'); +echo '</select></td></tr> + <tr><td>' . _('Sales Type') . ' / ' . _('Price List') . ':</td> + <td><select tabindex=3 name="SalesType"> + <option VALUE="AN">' . _('Any Other') . '</option>'; while ($myrow = DB_fetch_array($result)) { if (isset($_POST['SalesType']) and $myrow['typeabbrev']==$_POST['SalesType']) { - echo "<option selected VALUE='"; + echo '<option selected VALUE="'; } else { - echo "<option VALUE='"; + echo '<option VALUE="'; } - echo $myrow["typeabbrev"] . "'>" . $myrow['sales_type']; + echo $myrow['typeabbrev'] . '">' . $myrow['sales_type'] . '</option>'; } //end while loop -echo "</select></td></tr><tr><td>" . _('Post to GL account') . ":</td><td><select tabindex=4 name='GLCode'>"; +echo '</select></td></tr> + <tr><td>' . _('Post to GL account') . ':</td> + <td><select tabindex="4" name="GLCode">'; DB_free_result($result); -$sql = "SELECT chartmaster.accountcode, +$sql = 'SELECT chartmaster.accountcode, chartmaster.accountname FROM chartmaster, accountgroups @@ -328,23 +334,23 @@ AND accountgroups.pandl=1 ORDER BY accountgroups.sequenceintb, chartmaster.accountcode, - chartmaster.accountname"; + chartmaster.accountname'; $result = DB_query($sql,$db); while ($myrow = DB_fetch_array($result)) { if (isset($_POST['GLCode']) and $myrow['accountcode']==$_POST['GLCode']) { - echo "<option selected VALUE='"; + echo '<option selected VALUE="'; } else { - echo "<option VALUE='"; + echo '<option VALUE="'; } - echo $myrow['accountcode'] . "'>" . $myrow['accountcode'] . ' - ' . $myrow['accountname']; + echo $myrow['accountcode'] . '">' . $myrow['accountcode'] . ' - ' . $myrow['accountname'] . '</option>'; } //end while loop DB_free_result($result); -echo "</select></td></tr></table>"; -echo "<br><div class='centre'><input tabindex=5 type='Submit' name='submit' value=" . _('Enter Information') . "></form></div>"; +echo '</select></td></tr></table>'; +echo '<br /><div class="centre"><input tabindex="5" type="Submit" name="submit" value="' . _('Enter Information') . '"></form></div>'; include('includes/footer.inc'); ?> \ No newline at end of file Modified: trunk/CompanyPreferences.php =================================================================== --- trunk/CompanyPreferences.php 2011-03-28 09:49:25 UTC (rev 4520) +++ trunk/CompanyPreferences.php 2011-03-29 09:04:20 UTC (rev 4521) @@ -1,10 +1,7 @@ <?php -/* $Revision: 1.18 $ */ /* $Id$*/ -//$PageSecurity =10; - include('includes/session.inc'); $title = _('Company Preferences'); @@ -133,13 +130,13 @@ /* Alter the exchange rates in the currencies table */ /* Get default currency rate */ - $sql='SELECT rate from currencies WHERE currabrev="'.$_POST['CurrencyDefault'].'"'; + $sql="SELECT rate from currencies WHERE currabrev='" . $_POST['CurrencyDefault'] . "'"; $result = DB_query($sql,$db); $myrow = DB_fetch_row($result); $NewCurrencyRate=$myrow[0]; /* Set new rates */ - $sql='UPDATE currencies SET rate=rate/"'.$NewCurrencyRate.'"'; + $sql="UPDATE currencies SET rate=rate/'".$NewCurrencyRate."'"; $ErrMsg = _('Could not update the currency rates'); $result = DB_query($sql,$db,$ErrMsg); @@ -163,36 +160,34 @@ echo '<table class=selection>'; if ($InputError != 1) { - $sql = "SELECT coyname, - gstno, - companynumber, - regoffice1, - regoffice2, - regoffice3, - regoffice4, - regoffice5, - regoffice6, - telephone, - fax, - email, - currencydefault, - debtorsact, - pytdiscountact, - creditorsact, - payrollact, - grnact, - exchangediffact, - purchasesexchangediffact, - retainedearnings, - gllink_debtors, - gllink_creditors, - gllink_stock, - freightact - FROM companies - WHERE coycode=1"; + $sql = 'SELECT coyname, + gstno, + companynumber, + regoffice1, + regoffice2, + regoffice3, + regoffice4, + regoffice5, + regoffice6, + telephone, + fax, + email, + currencydefault, + debtorsact, + pytdiscountact, + creditorsact, + payrollact, + grnact, + exchangediffact, + purchasesexchangediffact, + retainedearnings, + gllink_debtors, + gllink_creditors, + gllink_stock, + freightact + FROM companies + WHERE coycode=1'; - - $ErrMsg = _('The company preferences could not be retrieved because'); $result = DB_query($sql, $db,$ErrMsg); @@ -275,15 +270,15 @@ </tr>'; -$result=DB_query("SELECT currabrev, currency FROM currencies",$db); +$result=DB_query('SELECT currabrev, currency FROM currencies',$db); echo '<tr><td>' . _('Home Currency') . ':</td><td><select tabindex="13" Name=CurrencyDefault>'; while ($myrow = DB_fetch_array($result)) { if ($_POST['CurrencyDefault']==$myrow['currabrev']){ - echo "<option selected VALUE='". $myrow['currabrev'] . "'>" . $myrow['currency']; + echo '<option selected VALUE="'. $myrow['currabrev'] . '">' . $myrow['currency'] . '</option>'; } else { - echo "<option VALUE='". $myrow['currabrev'] . "'>" . $myrow['currency']; + echo '<option VALUE="' . $myrow['currabrev'] . '">' . $myrow['currency']. '</option>'; } } //end while loop @@ -291,21 +286,21 @@ echo '</select></td></tr>'; -$result=DB_query("SELECT accountcode, - accountname - FROM chartmaster, - accountgroups - WHERE chartmaster.group_=accountgroups.groupname - AND accountgroups.pandl=0 - ORDER BY chartmaster.accountcode",$db); +$result=DB_query('SELECT accountcode, + accountname + FROM chartmaster INNER JOIN accountgroups + ON chartmaster.group_=accountgroups.groupname + WHERE accountgroups.pandl=0 + ORDER BY chartmaster.accountcode',$db); -echo '<tr><td>' . _('Debtors Control GL Account') . ':</td><td><select tabindex="14" Name=DebtorsAct>'; +echo '<tr><td>' . _('Debtors Control GL Account') . ':</td> + <td><select tabindex="14" Name=DebtorsAct>'; while ($myrow = DB_fetch_row($result)) { if ($_POST['DebtorsAct']==$myrow[0]){ - echo "<option selected VALUE='". $myrow[0] . "'>" . $myrow[1] . ' ('.$myrow[0].')'; + echo '<option selected VALUE="'. $myrow[0] . '">' . $myrow[1] . ' ('.$myrow[0].')</option>'; } else { - echo "<option VALUE='". $myrow[0] . "'>" . $myrow[1] . ' ('.$myrow[0].')'; + echo '<option VALUE="'. $myrow[0] . '">' . $myrow[1] . ' ('.$myrow[0].')</option>'; } } //end while loop @@ -317,9 +312,9 @@ while ($myrow = DB_fetch_row($result)) { if ($_POST['CreditorsAct']==$myrow[0]){ - echo "<option selected VALUE='". $myrow[0] . "'>" . $myrow[1] . ' ('.$myrow[0].')'; + echo '<option selected VALUE="'. $myrow[0] . '">' . $myrow[1] . ' ('.$myrow[0].')</option>'; } else { - echo "<option VALUE='". $myrow[0] . "'>" . $myrow[1] . ' ('.$myrow[0].')'; + echo '<option VALUE="' . $myrow[0] . '">' . $myrow[1] . ' ('.$myrow[0].')</option>'; } } //end while loop @@ -331,9 +326,9 @@ while ($myrow = DB_fetch_row($result)) { if ($_POST['PayrollAct']==$myrow[0]){ - echo "<option selected VALUE='". $myrow[0] . "'>" . $myrow[1] . ' ('.$myrow[0].')'; + echo '<option selected VALUE="'. $myrow[0] . '">' . $myrow[1] . ' ('.$myrow[0].')</option>'; } else { - echo "<option VALUE='". $myrow[0] . "'>" . $myrow[1] . ' ('.$myrow[0].')'; + echo '<option VALUE="'. $myrow[0] . '">' . $myrow[1] . ' ('.$myrow[0].')</option>'; } } //end while loop @@ -345,22 +340,23 @@ while ($myrow = DB_fetch_row($result)) { if ($_POST['GRNAct']==$myrow[0]){ - echo "<option selected VALUE='". $myrow[0] . "'>" . $myrow[1] . ' ('.$myrow[0].')'; + echo '<option selected VALUE="'. $myrow[0] . '">' . $myrow[1] . ' ('.$myrow[0].')</option>'; } else { - echo "<option VALUE='". $myrow[0] . "'>" . $myrow[1] . ' ('.$myrow[0].')'; + echo '<option VALUE="'. $myrow[0] . '">' . $myrow[1] . ' ('.$myrow[0].')</option>'; } } //end while loop DB_data_seek($result,0); echo '</select></td></tr>'; -echo '<tr><td>' . _('Retained Earning Clearing GL Account') . ':</td><td><select tabindex="18" Name=RetainedEarnings>'; +echo '<tr><td>' . _('Retained Earning Clearing GL Account') . ':</td> + <td><select tabindex="18" Name="RetainedEarnings">'; while ($myrow = DB_fetch_row($result)) { if ($_POST['RetainedEarnings']==$myrow[0]){ - echo "<option selected VALUE='". $myrow[0] . "'>" . $myrow[1] . ' ('.$myrow[0].')'; + echo '<option selected VALUE="'. $myrow[0] . '">' . $myrow[1] . ' ('.$myrow[0].')</option>'; } else { - echo "<option VALUE='". $myrow[0] . "'>" . $myrow[1] . ' ('.$myrow[0].')'; + echo '<option VALUE="'. $myrow[0] . '">' . $myrow[1] . ' ('.$myrow[0].')</option>'; } } //end while loop @@ -368,21 +364,21 @@ echo '</select></td></tr>'; -echo '<tr><td>' . _('Freight Re-charged GL Account') . ':</td><td><select tabindex="19" Name=FreightAct>'; +echo '<tr><td>' . _('Freight Re-charged GL Account') . ':</td> + <td><select tabindex="19" Name="FreightAct">'; $result=DB_query('SELECT accountcode, - accountname - FROM chartmaster, - accountgroups - WHERE chartmaster.group_=accountgroups.groupname - AND accountgroups.pandl=1 - ORDER BY chartmaster.accountcode',$db); + accountname + FROM chartmaster INNER JOIN accountgroups + ON chartmaster.group_=accountgroups.groupname + WHERE accountgroups.pandl=1 + ORDER BY chartmaster.accountcode',$db); while ($myrow = DB_fetch_row($result)) { if ($_POST['FreightAct']==$myrow[0]){ - echo "<option selected VALUE='". $myrow[0] . "'>" . $myrow[1] . ' ('.$myrow[0].')'; + echo '<option selected VALUE="'. $myrow[0] . '">' . $myrow[1] . ' ('.$myrow[0].')</option>'; } else { - echo "<option VALUE='". $myrow[0] . "'>" . $myrow[1] . ' ('.$myrow[0].')'; + echo '<option VALUE="'. $myrow[0] . '">' . $myrow[1] . ' ('.$myrow[0].')</option>'; } } //end while loop @@ -390,13 +386,14 @@ echo '</select></td></tr>'; -echo '<tr><td>' . _('Sales Exchange Variances GL Account') . ':</td><td><select tabindex="20" Name=ExchangeDiffAct>'; +echo '<tr><td>' . _('Sales Exchange Variances GL Account') . ':</td> + <td><select tabindex="20" Name="ExchangeDiffAct">'; while ($myrow = DB_fetch_row($result)) { if ($_POST['ExchangeDiffAct']==$myrow[0]){ - echo "<option selected VALUE='". $myrow[0] . "'>" . $myrow[1] . ' ('.$myrow[0].')'; + echo '<option selected VALUE="'. $myrow[0] . '">' . $myrow[1] . ' ('.$myrow[0].')</option>'; } else { - echo "<option VALUE='". $myrow[0] . "'>" . $myrow[1] . ' ('.$myrow[0].')'; + echo '<option VALUE="'. $myrow[0] . '">' . $myrow[1] . ' ('.$myrow[0].')</option>'; } } //end while loop @@ -404,13 +401,14 @@ echo '</select></td></tr>'; -echo '<tr><td>' . _('Purchases Exchange Variances GL Account') . ':</td><td><select tabindex="21" Name=PurchasesExchangeDiffAct>'; +echo '<tr><td>' . _('Purchases Exchange Variances GL Account') . ':</td> + <td><select tabindex="21" Name="PurchasesExchangeDiffAct">'; while ($myrow = DB_fetch_row($result)) { if ($_POST['PurchasesExchangeDiffAct']==$myrow[0]){ - echo "<option selected VALUE='". $myrow[0] . "'>" . $myrow[1] . ' ('.$myrow[0].')'; + echo '<option selected VALUE="'. $myrow[0] . '">' . $myrow[1] . ' ('.$myrow[0].')</option>'; } else { - echo "<option VALUE='". $myrow[0] . "'>" . $myrow[1] . ' ('.$myrow[0].')'; + echo '<option VALUE="'. $myrow[0] . '">' . $myrow[1] . ' ('.$myrow[0].')</option>'; } } //end while loop @@ -418,13 +416,14 @@ echo '</select></td></tr>'; -echo '<tr><td>' . _('Payment Discount GL Account') . ':</td><td><select tabindex="22" Name=PytDiscountAct>'; +echo '<tr><td>' . _('Payment Discount GL Account') . ':</td> + <td><select tabindex="22" Name="PytDiscountAct">'; while ($myrow = DB_fetch_row($result)) { if ($_POST['PytDiscountAct']==$myrow[0]){ - echo "<option selected VALUE='". $myrow[0] . "'>" . $myrow[1] . ' ('.$myrow[0].')'; + echo '<option selected VALUE="'. $myrow[0] . '">' . $myrow[1] . ' ('.$myrow[0].')</option>'; } else { - echo "<option VALUE='". $myrow[0] . "'>" . $myrow[1] . ' ('.$myrow[0].')'; + echo '<option VALUE="'. $myrow[0] . '">' . $myrow[1] . ' ('.$myrow[0].')</option>'; } } //end while loop @@ -432,44 +431,47 @@ echo '</select></td></tr>'; -echo '<tr><td>' . _('Create GL entries for accounts receivable transactions') . ':</td><td><select tabindex="23" Name=GLLink_Debtors>'; +echo '<tr><td>' . _('Create GL entries for accounts receivable transactions') . ':</td> + <td><select tabindex="23" Name="GLLink_Debtors">'; if ($_POST['GLLink_Debtors']==0){ - echo '<option selected VALUE=0>' . _('No'); - echo '<option VALUE=1>' . _('Yes'); + echo '<option selected VALUE="0">' . _('No') . '</option>'; + echo '<option VALUE="1">' . _('Yes'). '</option>'; } else { - echo '<option selected VALUE=1>' . _('Yes'); - echo '<option VALUE=0>' . _('No'); + echo '<option selected VALUE="1">' . _('Yes'). '</option>'; + echo '<option VALUE="0">' . _('No'). '</option>'; } echo '</select></td></tr>'; -echo '<tr><td>' . _('Create GL entries for accounts payable transactions') . ':</td><td><select tabindex="24" Name=GLLink_Creditors>'; +echo '<tr><td>' . _('Create GL entries for accounts payable transactions') . ':</td> + <td><select tabindex="24" Name="GLLink_Creditors">'; if ($_POST['GLLink_Creditors']==0){ - echo '<option selected VALUE=0>' . _('No'); - echo '<option VALUE=1>' . _('Yes'); + echo '<option selected VALUE="0">' . _('No') . '</option>'; + echo '<option VALUE="1">' . _('Yes') . '</option>'; } else { - echo '<option selected VALUE=1>' . _('Yes'); - echo '<option VALUE=0>' . _('No'); + echo '<option selected VALUE="1">' . _('Yes') . '</option>'; + echo '<option VALUE="0">' . _('No') . '</option>'; } echo '</select></td></tr>'; -echo '<tr><td>' . _('Create GL entries for stock transactions') . '):</td><td><select tabindex="25" Name=GLLink_Stock>'; +echo '<tr><td>' . _('Create GL entries for stock transactions') . '):</td> + <td><select tabindex="25" Name="GLLink_Stock">'; -if ($_POST['GLLink_Stock']==0){ - echo '<option selected VALUE=0>' . _('No'); - echo '<option VALUE=1>' . _('Yes'); +if ($_POST['GLLink_Stock']=='0'){ + echo '<option selected VALUE="0">' . _('No') . '</option>'; + echo '<option VALUE="1">' . _('Yes') . '</option>'; } else { - echo '<option selected VALUE=1>' . _('Yes'); - echo '<option VALUE=0>' . _('No'); + echo '<option selected VALUE="1">' . _('Yes') . '</option>'; + echo '<option VALUE="0">' . _('No') . '</option>'; } echo '</select></td></tr>'; -echo '</table><br><div class="centre"><input tabindex="26" type="Submit" Name="submit" value="' . _('Update') . '"></div>'; +echo '</table><br /><div class="centre"><input tabindex="26" type="Submit" Name="submit" value="' . _('Update') . '"></div>'; include('includes/footer.inc'); ?> \ No newline at end of file Modified: trunk/Credit_Invoice.php =================================================================== --- trunk/Credit_Invoice.php 2011-03-28 09:49:25 UTC (rev 4520) +++ trunk/Credit_Invoice.php 2011-03-29 09:04:20 UTC (rev 4521) @@ -257,28 +257,28 @@ if (!isset($_POST['ProcessCredit'])) { - 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 cellpadding=2 colspan=7 class=selection><tr>"; - echo "<tr><th colspan=13>"; + echo '<table cellpadding="2" colspan="7" class="selection"><tr>'; + echo '<tr><th colspan="13">'; echo '<div class="centre"><font color=blue size=4><b>' . _('Credit Invoice') . ' ' . $_SESSION['ProcessingCredit'] . '</b> <b>'.' - ' . $_SESSION['CreditItems']->CustomerName . '</b></font> - <font size=3 color=blue> - ' . _('Credit Note amounts stated in') . ' ' . $_SESSION['CreditItems']->DefaultCurrency . "</div></font>"; - echo "</th></tr>"; - echo "<th>" . _('Item Code') . "</th> - <th>" . _('Item Description') . "</th> - <th>" . _('Invoiced') . "</th> - <th>" . _('Units') . "</th> - <th>" . _('Credit') . '<br>' . _('Quantity') . "</th> - <th>" . _('Price') . "</th> - <th>" . _('Discount') . ' %' . "</th> - <th>" . _('Total') . '<br>' . _('Excl Tax') . "</th> - <th>" . _('Tax Authority') . "</th> - <th>" . _('Tax') . ' %' . "</th> - <th>" . _('Tax') . '<br>' . _('Amount') . "</th> - <th>" . _('Total') . '<br>' . _('Incl Tax') . "</th></tr>"; + <font size=3 color=blue> - ' . _('Credit Note amounts stated in') . ' ' . $_SESSION['CreditItems']->DefaultCurrency . '</div></font>'; + echo '</th></tr>'; + echo '<th>' . _('Item Code') . '</th> + <th>' . _('Item Description') . '</th> + <th>' . _('Invoiced') . '</th> + <th>' . _('Units') . '</th> + <th>' . _('Credit') . '<br />' . _('Quantity') . '</th> + <th>' . _('Price') . '</th> + <th>' . _('Discount') . ' %' . '</th> + <th>' . _('Total') . '<br />' . _('Excl Tax') . '</th> + <th>' . _('Tax Authority') . '</th> + <th>' . _('Tax') . ' %' . '</th> + <th>' . _('Tax') . '<br />' . _('Amount') . '</th> + <th>' . _('Total') . '<br />' . _('Incl Tax') . '</th></tr>'; $_SESSION['CreditItems']->total = 0; $_SESSION['CreditItems']->totalVolume = 0; Modified: trunk/CustomerReceipt.php =================================================================== --- trunk/CustomerReceipt.php 2011-03-28 09:49:25 UTC (rev 4520) +++ trunk/CustomerReceipt.php 2011-03-29 09:04:20 UTC (rev 4521) @@ -1,11 +1,8 @@ <?php /* $Id$ */ -/* $Revision: 1.46 $ */ include('includes/DefineReceiptClass.php'); - -//$PageSecurity = 3; now retrieved from the DB include('includes/session.inc'); $title = _('Receipt Entry'); @@ -127,7 +124,7 @@ $SuggestedFunctionalExRate = $myrow[0]; /*Get the exchange rate between the functional currency and the receipt currency*/ - $result = DB_query("select rate FROM currencies WHERE currabrev='" . $_SESSION['ReceiptBatch']->Currency . "'",$db); + $result = DB_query("SELECT rate FROM currencies WHERE currabrev='" . $_SESSION['ReceiptBatch']->Currency . "'",$db); $myrow = DB_fetch_row($result); $tableExRate = $myrow[0]; //this is the rate of exchange between the functional currency and the receipt currency /*Calculate cross rate to suggest appropriate exchange rate between receipt currency and account currency */ @@ -212,7 +209,7 @@ } /*Make an array of the defined bank accounts */ - $SQL = "SELECT accountcode FROM bankaccounts"; + $SQL = 'SELECT accountcode FROM bankaccounts'; $result = DB_query($SQL,$db); $BankAccounts = array(); $i=0; @@ -267,13 +264,13 @@ if ($ReceiptItem->GLCode !=''){ //so its a GL receipt if ($_SESSION['CompanyRecord']['gllink_debtors']==1){ /* then enter a GLTrans record */ $SQL = "INSERT INTO gltrans (type, - typeno, - trandate, - periodno, - account, - narrative, - amount, - tag) + typeno, + trandate, + periodno, + account, + narrative, + amount, + tag) VALUES ( 12, '" . $_SESSION['ReceiptBatch']->BatchNo . "', @@ -341,15 +338,15 @@ $PaymentTransNo = GetNextTransNo( 1, $db); $SQL="INSERT INTO banktrans (transno, - type, - bankact, - ref, - exrate, - functionalexrate, - transdate, - banktranstype, - amount, - currcode) + type, + bankact, + ref, + exrate, + functionalexrate, + transdate, + banktranstype, + amount, + currcode) VALUES ( '" . $PaymentTransNo . "', 1, @@ -374,18 +371,18 @@ /*Create a DebtorTrans entry for each customer deposit */ $SQL = "INSERT INTO debtortrans (transno, - type, - debtorno, - branchcode, - trandate, - inputdate, - prd, - reference, - tpe, - rate, - ovamount, - ovdiscount, - invtext) + type, + debtorno, + branchcode, + trandate, + inputdate, + prd, + reference, + tpe, + rate, + ovamount, + ovdiscount, + invtext) VALUES ( '" . $_SESSION['ReceiptBatch']->BatchNo . "', 12, @@ -426,12 +423,12 @@ if ($BatchReceiptsTotal!=0){ /* Bank account entry first */ $SQL="INSERT INTO gltrans (type, - typeno, - trandate, - periodno, - account, - narrative, - amount) + typeno, + trandate, + periodno, + account, + narrative, + amount) VALUES ( 12, '" . $_SESSION['ReceiptBatch']->BatchNo . "', @@ -448,15 +445,15 @@ /*now enter the BankTrans entry */ $SQL="INSERT INTO banktrans (type, - transno, - bankact, - ref, - exrate, - functionalexrate, - transdate, - banktranstype, - amount, - currcode) + transno, + bankact, + ref, + exrate, + functionalexrate, + transdate, + banktranstype, + amount, + currcode) VALUES ( 12, '" . $_SESSION['ReceiptBatch']->BatchNo . "', @@ -476,12 +473,12 @@ if ($BatchDebtorTotal!=0){ /* Now Credit Debtors account with receipts + discounts */ $SQL="INSERT INTO gltrans ( type, - typeno, - trandate, - periodno, - account, - narrative, - amount) + typeno, + trandate, + periodno, + account, + narrative, + amount) VALUES ( 12, '" . $_SESSION['ReceiptBatch']->BatchNo . "', @@ -500,12 +497,12 @@ if ($BatchDiscount!=0){ /* Now Debit Discount account with discounts allowed*/ $SQL="INSERT INTO gltrans ( type, - typeno, - trandate, - periodno, - account, - narrative, - amount) + typeno, + trandate, + periodno, + account, + narrative, + amount) VALUES ( 12, '" . $_SESSION['ReceiptBatch']->BatchNo . "', @@ -552,7 +549,7 @@ $SQL = "SELECT debtorsmaster.debtorno, debtorsmaster.name FROM debtorsmaster - WHERE debtorsmaster.name LIKE '". $SearchString."' + WHERE debtorsmaster.name " . LIKE . " '". $SearchString . "' AND debtorsmaster.currcode= '" . $_SESSION['ReceiptBatch']->Currency . "'"; } elseif (strlen($_POST['CustCode'])>0){ @@ -665,22 +662,22 @@ $NIL_BALANCE = True; $SQL = "SELECT debtorsmaster.name, - debtorsmaster.pymtdiscount, - currencies.currency, - currencies.rate, - paymentterms.terms, - debtorsmaster.creditlimit, - debtorsmaster.currcode, - holdreasons.dissallowinvoices, - holdreasons.reasondescription - FROM debtorsmaster, - paymentterms, - holdreasons, - currencies - WHERE debtorsmaster.paymentterms = paymentterms.termsindicator - AND debtorsmaster.currcode = currencies.currabrev - AND debtorsmaster.holdreason = holdreasons.reasoncode - AND debtorsmaster.debtorno = '" . $_POST['CustomerID'] . "'"; + debtorsmaster.pymtdiscount, + currencies.currency, + currencies.rate, + paymentterms.terms, + debtorsmaster.creditlimit, + debtorsmaster.currcode, + holdreasons.dissallowinvoices, + holdreasons.reasondescription + FROM debtorsmaster, + paymentterms, + holdreasons, + currencies + WHERE debtorsmaster.paymentterms = paymentterms.termsindicator + AND debtorsmaster.currcode = currencies.currabrev + AND debtorsmaster.holdreason = holdreasons.reasoncode + AND debtorsmaster.debtorno = '" . $_POST['CustomerID'] . "'"; $ErrMsg = _('The customer details could not be retrieved because'); $DbgMsg = _('The SQL that failed was'); @@ -813,7 +810,7 @@ <td>' . ' ' . $SuggestedFunctionalExRateText . ' <i>' . _('The exchange rate between the currency of the business (the functional currency) and the currency of the bank account') . '. 1 ' . $_SESSION['CompanyRecord']['currencydefault'] . ' = ? ' . $_SESSION['ReceiptBatch']->AccountCurrency . '</i></td></tr>'; } -echo '<tr><td>' . _('Receipt Type') . ":</td><td><select tabindex=6 name=ReceiptType>"; +echo '<tr><td>' . _('Receipt Type') . ':</td><td><select tabindex=6 name="ReceiptType">'; include('includes/GetPaymentMethods.php'); /* The array ReceiptTypes is defined from the setup tab of the main menu under payment methods - the array is populated from the include file GetPaymentMethods.php */ @@ -853,7 +850,7 @@ foreach ($_SESSION['ReceiptBatch']->Items as $ReceiptItem) { - $SQL = "select accountname FROM chartmaster WHERE accountcode='" . $ReceiptItem->GLCode . "'"; + $SQL = "SELECT accountname FROM chartmaster WHERE accountcode='" . $ReceiptItem->GLCode . "'"; $Result=DB_query($SQL,$db); $myrow=DB_fetch_array($Result); @@ -863,11 +860,9 @@ <td>' . stripslashes($ReceiptItem->CustomerName) . '</td> <td>'.$ReceiptItem->GLCode.' - '.$myrow['accountname'].'</td> <td>'.$ReceiptItem->Narrative . "</td> - <td><a href='" . $_SERVER['PHP_SELF'] . '?' . SID . '&Delete=' . $ReceiptItem->ID . "&Type=".$_GET['Type']."'>" . _('Delete') . '</a></td> + <td><a href='" . $_SERVER['PHP_SELF'] . '?Delete=' . $ReceiptItem->ID . "&Type=".$_GET['Type']."'>" . _('Delete') . '</a></td> </tr>'; - $BatchTotal= $BatchTotal + $ReceiptItem->Amount; - } echo '<tr><td class=number><b>' . number_format($BatchTotal,2) . '</b></td></tr></table>'; @@ -939,7 +934,7 @@ echo '<tr><td>' . _('Select Tag') . ':</td><td><select name="tag">'; $SQL = 'SELECT tagref, - tagdescription + tagdescription FROM tags ORDER BY tagref'; @@ -947,9 +942,9 @@ echo '<option value=0></option>'; while ($myrow=DB_fetch_array($result)){ if (isset($_POST['tag']) and $_POST['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></tr>'; @@ -1075,7 +1070,7 @@ } //end if results to show if (isset($_SESSION['ReceiptBatch']->Items) and count($_SESSION['ReceiptBatch']->Items) > 0){ - echo '<div class="centre"><br/><input tabindex=13 type=submit name="CommitBatch" VALUE="' . _('Accept and Process Batch') . '"></div>'; + echo '<div class="centre"><br/><input tabindex="13" type="submit" name="CommitBatch" VALUE="' . _('Accept and Process Batch') . '"></div>'; } } Modified: trunk/Customers.php =================================================================== --- trunk/Customers.php 2011-03-28 09:49:25 UTC (rev 4520) +++ trunk/Customers.php 2011-03-29 09:04:20 UTC (rev 4521) @@ -1,10 +1,7 @@ <?php /* $Id$ */ -/* $Revision: 1.44 $ */ -//$PageSecurity = 3; - include('includes/session.inc'); $title = _('Customer Maintenance'); @@ -56,9 +53,6 @@ prnMsg( _('The customer code cannot contain any of the following characters') . " . - ' & + \" " . _('or a space'),'error'); $Errors[$i] = 'DebtorNo'; $i++; -// } elseif (ContainsIllegalCharacters($_POST['Address1']) OR ContainsIllegalCharacters($_POST['Address2'])) { -// $InputError = 1; -// prnMsg( _('Lines of the address must not contain illegal characters'),'error'); } elseif (strlen($_POST['Address1']) >40) { $InputError = 1; prnMsg( _('The Line 1 of the address must be forty characters or less long'),'error'); @@ -225,7 +219,7 @@ $ErrMsg = _('The customer could not be updated because'); $result = DB_query($sql,$db,$ErrMsg); prnMsg( _('Customer updated'),'success'); - echo '<br>'; + echo '<br />'; } else { //it is a new customer /* set the DebtorNo if $AutoDebtorNo in config.php has been set to @@ -314,7 +308,7 @@ if ($myrow[0]>0) { $CancelDelete = 1; prnMsg( _('This customer cannot be deleted because there are transactions that refer to it'),'warn'); - echo '<br> ' . _('There are') . ' ' . $myrow[0] . ' ' . _('transactions against this customer'); + echo '<br /> ' . _('There are') . ' ' . $myrow[0] . ' ' . _('transactions against this customer'); } else { $sql= "SELECT COUNT(*) FROM salesorders WHERE debtorno='" . $_POST['DebtorNo'] . "'"; @@ -323,7 +317,7 @@ if ($myrow[0]>0) { $CancelDelete = 1; prnMsg( _('Cannot delete the customer record because orders have been created against it'),'warn'); - echo '<br> ' . _('There are') . ' ' . $myrow[0] . ' ' . _('orders against this customer'); + echo '<br /> ' . _('There are') . ' ' . $myrow[0] . ' ' . _('orders against this customer'); } else { $sql= "SELECT COUNT(*) FROM salesanalysis WHERE cust='" . $_POST['DebtorNo'] . "'"; $result = DB_query($sql,$db); @@ -331,7 +325,7 @@ if ($myrow[0]>0) { $CancelDelete = 1; prnMsg( _('Cannot delete this customer record because sales analysis records exist for it'),'warn'); - echo '<br> ' . _('There are') . ' ' . $myrow[0] . ' ' . _('sales analysis records against this customer'); + echo '<br /> ' . _('There are') . ' ' . $myrow[0] . ' ' . _('sales analysis records against this customer'); } else { $sql= "SELECT COUNT(*) FROM custbranch WHERE debtorno='" . $_POST['DebtorNo'] . "'"; $result = DB_query($sql,$db); @@ -339,7 +333,7 @@ if ($myrow[0]>0) { $CancelDelete = 1; prnMsg(_('Cannot delete this customer because there are branch records set up against it'),'warn'); - echo '<br> ' . _('There are') . ' ' . $myrow[0] . ' ' . _('branch records relating to this customer'); + echo '<br /> ' . _('There are') . ' ' . $myrow[0] . ' ' . _('branch records relating to this customer'); } } } @@ -418,7 +412,7 @@ } // This link is already on menu bar -//echo "<a href='" . $rootpath . '/SelectCustomer.php?' . SID . "'>" . _('Back to Customers') . '</a><br>'; +//echo "<a href='" . $rootpath . '/SelectCustomer.php?' . SID . "'>" . _('Back to Customers') . '</a><br />'; if (!isset($DebtorNo)) { @@ -494,7 +488,7 @@ $result=DB_query('SELECT typeabbrev, sales_type FROM salestypes ',$db); if (DB_num_rows($result)==0){ $DataError =1; - echo '<a href="SalesTypes.php?" target="_parent">Setup Types</a>'; + echo '<a href="SalesTypes.php?" target="_parent">' . _('Setup Types') . '</a>'; echo '<tr><td colspan=2>' . prnMsg(_('No sales types/price lists defined'),'error') . '</td></tr>'; } else { echo '<tr><td>' . _('Sales Type/Price List') . ':</td> @@ -508,10 +502,10 @@ } // Show Customer Type drop down list - $result=DB_query('SELECT typeid, typename FROM debtortype ',$db); + $result=DB_query('SELECT typeid, typename FROM debtortype', $db); if (DB_num_rows($result)==0){ $DataError =1; - echo '<a href="SalesTypes.php?" target="_parent">Setup Types</a>'; + echo '<a href="SalesTypes.php?" target="_parent">' . _('Setup Types') . '</a>'; echo '<tr><td colspan=2>' . prnMsg(_('No Customer types/price lists defined'),'error') . '</td></tr>'; } else { echo '<tr><td>' . _('Customer Type') . ':</td> @@ -524,12 +518,9 @@ echo '</select></td></tr>'; } - - - - $DateString = Date($_SESSION['DefaultDateFormat']); - echo '<tr><td>' . _('Customer Since') . ' (' . $_SESSION['DefaultDateFormat'] . '):</td><td><input tabindex=10 type="text" class="date" alt="'.$_SESSION['DefaultDateFormat'].'" name="ClientSince" value="' . $DateString . '" size=12 maxlength=10></td></tr>'; + echo '<tr><td>' . _('Customer Since') . ' (' . $_SESSION['DefaultDateFormat'] . '):</td> + <td><input tabindex=10 type="text" class="date" alt="'.$_SESSION['DefaultDateFormat'].'" name="ClientSince" value="' . $DateString . '" size=12 maxlength=10></td></tr>'; echo '<tr><td>' . _('Discount Percent') . ':</td> <td><input tabindex=11 type="textbox" class="number" name="Discount" value=0 size=5 maxlength=4></td></tr>'; echo '<tr><td>' . _('Discount Code') . ':</td> @@ -594,20 +585,19 @@ echo '</select></td></tr>'; } - /*added line 8/23/2007 by Morris Kelly to set po line parameter Y/N*/ - echo '<tr><td>' . _('Customer PO Line on SO') . ":</td><td><select tabindex=18 name='CustomerPOLine'>"; - echo '<option selected value=0>' . _('No'); - echo '<option value=1>' . _('Yes'); + echo '<tr><td>' . _('Customer PO Line on SO') . ':</td><td><select tabindex="18" name="CustomerPOLine">'; + echo '<option selected value=0>' . _('No') . '</option>'; + echo '<option value=1>' . _('Yes') . '</option>'; echo '</select></td></tr>'; - echo '<tr><td>' . _('Invoice Addressing') . ":</td><td><select tabindex=19 name='AddrInvBranch'>"; + echo '<tr><td>' . _('Invoice Addressing') . ':</td><td><select tabindex="19" name="AddrInvBranch">'; echo '<option selected VALUE=0>' . _('Address to HO'); echo '<option VALUE=1>' . _('Address to Branch'); echo '</select></td></tr>'; echo'</table></td></tr></table>'; if ($DataError ==0){ - echo "<br><div class='centre'><input tabindex=20 type='Submit' name='submit' value='" . _('Add New Customer') . "'> <input tabindex=21 type=submit action=RESET VALUE='" . _('Reset') . "'></div>"; + echo "<br /><div class='centre'><input tabindex=20 type='Submit' name='submit' value='" . _('Add New Customer') . "'> <input tabindex=21 type=submit action=RESET VALUE='" . _('Reset') . "'></div>"; } echo '</form>'; @@ -990,7 +980,7 @@ Where debtorno='".$DebtorNo."' and contid='".$Edit."'"; $resultupcc = DB_query($SQLupdatecc,$db); - echo '<br>'.$SQLupdatecc; + echo '<br />'.$SQLupdatecc; echo '<meta http-equiv="Refresh" content="0; url="' . $_SERVER['PHP_SELF'] . '?'.SID.'&DebtorNo='.$DebtorNo.'&ID='.$ID.'">'; } if (isset($_GET['delete'])) { @@ -999,7 +989,7 @@ $resultupcc = DB_query($SQl,$db); echo '<meta http-equiv="Refresh" content="0; url=' . $_SERVER['PHP_SELF'] . '?'.SID.'&DebtorNo='.$DebtorNo.'">'; - echo '<br>'.$SQl; + echo '<br />'.$SQl; prnmsg('Contact Deleted','success'); } @@ -1007,18 +997,18 @@ echo'</td></tr></table>'; if (isset($_POST['New']) and $_POST['New']) { - echo "<div class='centre'><input type='Submit' name='submit' VALUE='" . _('Add New Customer') . - "'> <input type=submit name='reset' VALUE='" . _('Reset') . "'></div></form>"; + echo '<div class="centre"><input type="Submit" name="submit" VALUE="' . _('Add New Customer') . + '"> <input type=submit name="reset" VALUE="' . _('Reset') . '"></div></form>'; } else if (!isset($_GET['Modify'])){ - echo "<br><div class='centre'><input type='Submit' name='submit' VALUE='" . _('Update Customer') . "'>"; + echo '<br /><div class="centre"><input type="Submit" name="submit" VALUE="' . _('Update Customer') . '">'; echo ' <input type="Submit" name="delete" VALUE="' . _('Delete Customer') . '" onclick="return confirm(\'' . _('Are You Sure?') . '\');">'; } if(isset($_POST['addcontact']) AND (isset($_POST['addcontact'])!='')) { - echo '<meta http-equiv="Refresh" content="0; url=' . $rootpath . '/AddCustomerContacts.php?' . SID . '&DebtorNo=' .$DebtorNo.'">'; + echo '<meta http-equiv="Refresh" content="0; url=' . $rootpath . '/AddCustomerContacts.php?DebtorNo=' .$DebtorNo.'">'; } echo '</div>'; } // end of main ifs include('includes/footer.inc'); -?> +?> \ No newline at end of file Modified: trunk/MRP.php ===========================================... [truncated message content] |
From: <dai...@us...> - 2011-03-30 09:06:41
|
Revision: 4526 http://web-erp.svn.sourceforge.net/web-erp/?rev=4526&view=rev Author: daintree Date: 2011-03-30 09:06:33 +0000 (Wed, 30 Mar 2011) Log Message: ----------- SQL fixing quotes - not many, fixing gettext a few strings, Tims Reprint GRN Modified Paths: -------------- trunk/EDIMessageFormat.php trunk/EDISendInvoices.php trunk/FixedAssetCategories.php trunk/FixedAssetDepreciation.php trunk/FixedAssetItems.php trunk/GLAccountCSV.php trunk/GLBudgets.php trunk/GLCodesInquiry.php trunk/GLJournal.php trunk/PDFGrn.php trunk/doc/Change.log.html trunk/includes/ConnectDB.inc trunk/index.php trunk/sql/mysql/upgrade3.11.1-4.00.sql Modified: trunk/EDIMessageFormat.php =================================================================== --- trunk/EDIMessageFormat.php 2011-03-29 13:55:41 UTC (rev 4525) +++ trunk/EDIMessageFormat.php 2011-03-30 09:06:33 UTC (rev 4526) @@ -1,9 +1,7 @@ <?php -/* $Revision: 1.10 $ */ + /* $Id$*/ -//$PageSecurity = 10; - include('includes/session.inc'); $title = _('EDI Message Format'); include('includes/header.inc'); @@ -92,7 +90,7 @@ $sql="DELETE FROM edimessageformat WHERE id='" . $_GET['delete']."'"; $result = DB_query($sql,$db); - $msg='The selected message line has been deleted'; + $msg=_('The selected message line has been deleted'); } if (isset($msg)) { @@ -174,13 +172,13 @@ if (isset($SelectedMessageLine)) { //editing an existing message line - $sql = 'SELECT messagetype, + $sql = "SELECT messagetype, partnercode, section, sequenceno, linetext FROM edimessageformat - WHERE id=' . $SelectedMessageLine; + WHERE id='" . $SelectedMessageLine . "'"; $result = DB_query($sql, $db); $myrow = DB_fetch_array($result); @@ -206,25 +204,25 @@ echo '<tr><th colspan=2><font size=3>' . _('Definition of') . ' ' . $myrow['messagetype'] . ' ' . _('for') . ' ' . $myrow['partnercode'].'</font></th></tr>'; } -echo '<tr><td>Section:</td>'; +echo '<tr><td>' . _('Section') . ':</td>'; echo '<td>'; echo '<select tabindex=2 name="Section">'; if ($_POST['Section']=='Heading') { - echo "<option selected VALUE='Heading'>" . _('Heading'); + echo "<option selected VALUE='Heading'>" . _('Heading') . '</option>'; } else { - echo "<option value='Heading'>" . _('Heading'); + echo "<option value='Heading'>" . _('Heading') . '</option>'; } if (isset($_POST['Section']) and $_POST['Section']=='Detail') { - echo "<option selected VALUE='Detail'>" . _('Detail'); + echo "<option selected VALUE='Detail'>" . _('Detail') . '</option>'; } else { - echo "<option value='Detail'>" . _('Detail'); + echo "<option value='Detail'>" . _('Detail') . '</option>'; } if (isset($_POST['Section']) and $_POST['Section']=='Summary') { - echo "<option selected VALUE='Summary'>" . _('Summary'); + echo "<option selected VALUE='Summary'>" . _('Summary') . '</option>'; } else { - echo "<option value='Summary'>" . _('Summary'); + echo "<option value='Summary'>" . _('Summary') . '</option>'; } echo '</select>'; Modified: trunk/EDISendInvoices.php =================================================================== --- trunk/EDISendInvoices.php 2011-03-29 13:55:41 UTC (rev 4525) +++ trunk/EDISendInvoices.php 2011-03-30 09:06:33 UTC (rev 4526) @@ -1,10 +1,7 @@ <?php -/* $Revision: 1.11 $ */ /* $Id$*/ -//$PageSecurity =15; - include ('includes/session.inc'); include ('includes/header.inc'); include('includes/SQL_CommonFunctions.inc'); //need for EDITransNo @@ -100,7 +97,11 @@ then replace variable names with data write the output to a file one line at a time */ - $sql = "SELECT section, linetext FROM edimessageformat WHERE partnercode='" . $CustDetails['debtorno'] . "' AND messagetype='INVOIC' ORDER BY sequenceno"; + $sql = "SELECT section, + linetext + FROM edimessageformat + WHERE partnercode='" . $CustDetails['debtorno'] . "' + AND messagetype='INVOIC' ORDER BY sequenceno"; $ErrMsg = _('An error occurred in getting the EDI format template for') . ' ' . $CustDetails['debtorno'] . ' ' . _('because'); $MessageLinesResult = DB_query($sql, $db,$ErrMsg); @@ -145,7 +146,7 @@ stockmaster WHERE stockmoves.stockid = stockmaster.stockid AND stockmoves.type=10 - AND stockmoves.transno=" . $TransNo . " + AND stockmoves.transno='" . $TransNo . "' AND stockmoves.show_on_inv_crds=1"; } else { /* credit note */ @@ -160,7 +161,7 @@ FROM stockmoves, stockmaster WHERE stockmoves.stockid = stockmaster.stockid - AND stockmoves.type=11 and stockmoves.transno=" . $TransNo . " + AND stockmoves.type=11 and stockmoves.transno='" . $TransNo . "' AND stockmoves.show_on_inv_crds=1"; } $TransLinesResult = DB_query($sql,$db); @@ -218,10 +219,10 @@ $MessageSent = $mail->send(array($CustDetails['ediaddress'])); if ($MessageSent==True){ - echo '<br><br>'; + echo '<br /><br />'; prnMsg(_('EDI Message') . ' ' . $EDITransNo . ' ' . _('was successfully emailed'),'success'); } else { - echo '<br><br>'; + echo '<br /><br />'; prnMsg(_('EDI Message') . ' ' . $EDITransNo . _('could not be emailed to') . ' ' . $CustDetails['ediaddress'],'error'); } } else { /*it must be ftp transport */ @@ -230,16 +231,16 @@ $conn_id = ftp_connect($CustDetails['ediaddress']); // login with username and password $login_result = ftp_login($conn_id, $CustDetails['ediserveruser'], $CustDetails['ediserverpwd']); // check connection if ((!$conn_id) || (!$login_result)) { - prnMsg( _('Ftp connection has failed'). '<br>' . _('Attempted to connect to') . ' ' . $CustDetails['ediaddress'] . ' ' ._('for user') . ' ' . $CustDetails['ediserveruser'],'error'); + prnMsg( _('Ftp connection has failed'). '<br />' . _('Attempted to connect to') . ' ' . $CustDetails['ediaddress'] . ' ' ._('for user') . ' ' . $CustDetails['ediserveruser'],'error'); include('includes/footer.inc'); exit; } $MessageSent = ftp_put($conn_id, $_SESSION['EDI_MsgPending'] . '/EDI_INV_' . $EDITransNo, 'EDI_INV_' . $EDITransNo, FTP_ASCII); // check upload status if (!$MessageSent) { - echo '<br><br>'; + echo '<br /><br />'; prnMsg(_('EDI Message') . ' ' . $EDITransNo . ' ' . _('could not be sent via ftp to') .' ' . $CustDetails['ediaddress'],'error'); } else { - echo '<br><br>'; + echo '<br /><br />'; prnMsg( _('Successfully uploaded EDI_INV_') . $EDITransNo . ' ' . _('via ftp to') . ' ' . $CustDetails['ediaddress'],'success'); } // close the FTP stream ftp_quit($conn_id); Modified: trunk/FixedAssetCategories.php =================================================================== --- trunk/FixedAssetCategories.php 2011-03-29 13:55:41 UTC (rev 4525) +++ trunk/FixedAssetCategories.php 2011-03-30 09:06:33 UTC (rev 4526) @@ -1,7 +1,6 @@ <?php -/* $Revision: 1.1 $ */ -//$PageSecurity = 11; +/* $Id$*/ include('includes/session.inc'); @@ -93,18 +92,18 @@ } elseif ($InputError !=1) { $sql = "INSERT INTO fixedassetcategories (categoryid, - categorydescription, - costact, - depnact, - disposalact, - accumdepnact) - VALUES ( - '" . $_POST['CategoryID'] . "', - '" . $_POST['CategoryDescription'] . "', - '" . $_POST['CostAct'] . "', - '" . $_POST['DepnAct'] . "', - '" . $_POST['DisposalAct'] . "', - '" . $_POST['AccumDepnAct'] . "')"; + categorydescription, + costact, + depnact, + disposalact, + accumdepnact) + VALUES ( + '" . $_POST['CategoryID'] . "', + '" . $_POST['CategoryDescription'] . "', + '" . $_POST['CostAct'] . "', + '" . $_POST['DepnAct'] . "', + '" . $_POST['DisposalAct'] . "', + '" . $_POST['AccumDepnAct'] . "')"; $ErrMsg = _('Could not insert the new fixed asset category') . $_POST['CategoryDescription'] . _('because'); $result = DB_query($sql,$db,$ErrMsg); prnMsg(_('A new fixed asset category record has been added for') . ' ' . $_POST['CategoryDescription'],'success'); @@ -129,7 +128,7 @@ $myrow = DB_fetch_row($result); if ($myrow[0]>0) { prnMsg(_('Cannot delete this fixed asset category because fixed assets have been created using this category') . - '<br> ' . _('There are') . ' ' . $myrow[0] . ' ' . _('fixed assets referring to this category code'),'warn'); + '<br /> ' . _('There are') . ' ' . $myrow[0] . ' ' . _('fixed assets referring to this category code'),'warn'); } else { $sql="DELETE FROM fixedassetcategories WHERE categoryid='" . $SelectedCategory . "'"; @@ -147,15 +146,15 @@ or deletion of the records*/ $sql = 'SELECT categoryid, - categorydescription, - costact, - depnact, - disposalact, - accumdepnact - FROM fixedassetcategories'; + categorydescription, + costact, + depnact, + disposalact, + accumdepnact + FROM fixedassetcategories'; $result = DB_query($sql,$db); - echo "<br><table class=selection>\n"; + echo "<br /><table class=selection>\n"; echo '<tr><th>' . _('Cat Code') . '</th> <th>' . _('Description') . '</th> <th>' . _('Cost GL') . '</th> @@ -200,7 +199,7 @@ //end of ifs and buts! if (isset($SelectedCategory)) { - echo "<br><div class='centre'><a href='" . $_SERVER['PHP_SELF'] . '?' . SID . ">" ._('Show All Fixed Asset Categories') . "</a></div>"; + echo "<br /><div class='centre'><a href='" . $_SERVER['PHP_SELF'] . '?' . SID . ">" ._('Show All Fixed Asset Categories') . "</a></div>"; } echo '<form name="CategoryForm" method="post" action="' . $_SERVER['PHP_SELF'] . '?' . SID . '">'; @@ -240,23 +239,23 @@ } //SQL to poulate account selection boxes -$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'; $BSAccountsResult = DB_query($sql,$db); -$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'; $PnLAccountsResult = DB_query($sql,$db); @@ -323,7 +322,7 @@ } //end while loop -echo '</select></td></tr></table><br>'; +echo '</select></td></tr></table><br />'; echo '<div class="centre"><input type="Submit" name="submit" value="' . _('Enter Information') . '"></div>'; Modified: trunk/FixedAssetDepreciation.php =================================================================== --- trunk/FixedAssetDepreciation.php 2011-03-29 13:55:41 UTC (rev 4525) +++ trunk/FixedAssetDepreciation.php 2011-03-30 09:06:33 UTC (rev 4526) @@ -1,8 +1,6 @@ <?php - /* $Id: FixedAssetDepreciation.php 4213 2010-12-22 14:33:20Z tim_schofield $*/ -//$PageSecurity = 10; Now from DB include('includes/session.inc'); $title = _('Depreciation Journal Entry'); @@ -12,12 +10,12 @@ /*Get the last period depreciation (depn is transtype =44) was posted for */ $result = DB_query('SELECT periods.lastdate_in_period, - max(fixedassettrans.periodno) - FROM fixedassettrans INNER JOIN periods - ON fixedassettrans.periodno=periods.periodno - WHERE transtype=44 - GROUP BY periods.lastdate_in_period - ORDER BY periods.lastdate_in_period DESC',$db); + max(fixedassettrans.periodno) + FROM fixedassettrans INNER JOIN periods + ON fixedassettrans.periodno=periods.periodno + WHERE transtype=44 + GROUP BY periods.lastdate_in_period + ORDER BY periods.lastdate_in_period DESC',$db); $LastDepnRun = DB_fetch_row($result); @@ -44,30 +42,30 @@ /* Get list of assets for journal */ $sql="SELECT fixedassets.assetid, - fixedassets.description, - fixedassets.depntype, - fixedassets.depnrate, - fixedassets.datepurchased, - fixedassetcategories.accumdepnact, - fixedassetcategories.depnact, - fixedassetcategories.categorydescription, - SUM(CASE WHEN fixedassettrans.fixedassettranstype='cost' THEN fixedassettrans.amount ELSE 0 END) AS costtotal, - SUM(CASE WHEN fixedassettrans.fixedassettranstype='depn' THEN fixedassettrans.amount ELSE 0 END) AS depnbfwd - FROM fixedassets - INNER JOIN fixedassetcategories - ON fixedassets.assetcategoryid=fixedassetcategories.categoryid - INNER JOIN fixedassettrans - ON fixedassets.assetid=fixedassettrans.assetid - WHERE fixedassettrans.transdate<='" . FormatDateForSQL($_POST['ProcessDate']) . "' - GROUP BY fixedassets.assetid, - fixedassets.description, - fixedassets.depntype, - fixedassets.depnrate, - fixedassets.datepurchased, - fixedassetcategories.accumdepnact, - fixedassetcategories.depnact, - fixedassetcategories.categorydescription - ORDER BY assetcategoryid, assetid"; + fixedassets.description, + fixedassets.depntype, + fixedassets.depnrate, + fixedassets.datepurchased, + fixedassetcategories.accumdepnact, + fixedassetcategories.depnact, + fixedassetcategories.categorydescription, + SUM(CASE WHEN fixedassettrans.fixedassettranstype='cost' THEN fixedassettrans.amount ELSE 0 END) AS costtotal, + SUM(CASE WHEN fixedassettrans.fixedassettranstype='depn' THEN fixedassettrans.amount ELSE 0 END) AS depnbfwd + FROM fixedassets + INNER JOIN fixedassetcategories + ON fixedassets.assetcategoryid=fixedassetcategories.categoryid + INNER JOIN fixedassettrans + ON fixedassets.assetid=fixedassettrans.assetid + WHERE fixedassettrans.transdate<='" . FormatDateForSQL($_POST['ProcessDate']) . "' + GROUP BY fixedassets.assetid, + fixedassets.description, + fixedassets.depntype, + fixedassets.depnrate, + fixedassets.datepurchased, + fixedassetcategories.accumdepnact, + fixedassetcategories.depnact, + fixedassetcategories.categorydescription +ORDER BY assetcategoryid, assetid"; $AssetsResult=DB_query($sql, $db); $InputError = false; //always hope for the best @@ -83,15 +81,15 @@ echo '<p></p><table>'; $Heading = '<tr><th>' . _('Asset ID') . '</th> - <th>' . _('Description') . '</th> - <th>' . _('Date Purchased') . '</th> - <th>' . _('Cost') . '</th> - <th>' . _('Accum Depn') . '</th> - <th>' . _('B/fwd Book Value') . '</th> - <th>'. _('Depn Type') . '</th> - <th>'. _('Depn Rate') . '</th> - <th>' . _('New Depn') . '</th> - </tr>'; + <th>' . _('Description') . '</th> + <th>' . _('Date Purchased') . '</th> + <th>' . _('Cost') . '</th> + <th>' . _('Accum Depn') . '</th> + <th>' . _('B/fwd Book Value') . '</th> + <th>'. _('Depn Type') . '</th> + <th>'. _('Depn Rate') . '</th> + <th>' . _('New Depn') . '</th> + </tr>'; echo $Heading; $AssetCategoryDescription ='0'; @@ -106,12 +104,12 @@ if ($AssetCategoryDescription != $AssetRow['categorydescription'] OR $AssetCategoryDescription =='0'){ if ($AssetCategoryDescription !='0'){ //then print totals echo '<tr><th colspan=3 align="right">' . _('Total for') . ' ' . $AssetCategoryDescription . ' </th> - <th class="number">' . number_format($TotalCategoryCost,2) . '</th> - <th class="number">' . number_format($TotalCategoryAccumDepn,2) . '</th> - <th class="number">' . number_format(($TotalCategoryCost-$TotalCategoryAccumDepn),2) . '</th> - <th colspan=2></th> - <th class="number">' . number_format($TotalCategoryDepn,2) . '</th> - </tr>'; + <th class="number">' . number_format($TotalCategoryCost,2) . '</th> + <th class="number">' . number_format($TotalCategoryAccumDepn,2) . '</th> + <th class="number">' . number_format(($TotalCategoryCost-$TotalCategoryAccumDepn),2) . '</th> + <th colspan=2></th> + <th class="number">' . number_format($TotalCategoryDepn,2) . '</th> + </tr>'; } echo '<tr><th colspan=9 align="left">' . $AssetRow['categorydescription'] . '</th></tr>'; $AssetCategoryDescription = $AssetRow['categorydescription']; @@ -147,15 +145,15 @@ $k++; } echo '<td>' . $AssetRow['assetid'] . '</td> - <td>' . $AssetRow['description'] . '</td> - <td>' . ConvertSQLDate($AssetRow['datepurchased']) . '</td> - <td class="number">' . number_format($AssetRow['costtotal'],2) . '</td> - <td class="number">' . number_format($AssetRow['depnbfwd'],2) . '</td> - <td class="number">' . number_format($AssetRow['costtotal']-$AssetRow['depnbfwd'],2) . '</td> - <td align="center">' . $DepreciationType . '</td> - <td class="number">' . $AssetRow['depnrate'] . '</td> - <td class="number">' . number_format($NewDepreciation ,2) . '</td> - </tr>'; + <td>' . $AssetRow['description'] . '</td> + <td>' . ConvertSQLDate($AssetRow['datepurchased']) . '</td> + <td class="number">' . number_format($AssetRow['costtotal'],2) . '</td> + <td class="number">' . number_format($AssetRow['depnbfwd'],2) . '</td> + <td class="number">' . number_format($AssetRow['costtotal']-$AssetRow['depnbfwd'],2) . '</td> + <td align="center">' . $DepreciationType . '</td> + <td class="number">' . $AssetRow['depnrate'] . '</td> + <td class="number">' . number_format($NewDepreciation ,2) . '</td> + </tr>'; $TotalCategoryCost +=$AssetRow['costtotal']; $TotalCategoryAccumDepn +=$AssetRow['depnbfwd']; $TotalCategoryDepn +=$NewDepreciation; @@ -167,62 +165,62 @@ //debit depreciation expense $SQL = "INSERT INTO gltrans (type, - typeno, - trandate, - periodno, - account, - narrative, - amount) - VALUES (44, - '" . $TransNo . "', - '" . FormatDateForSQL($_POST['ProcessDate']) . "', - '" . $PeriodNo . "', - '" . $AssetRow['depnact'] . "', - '" . $AssetRow['assetid'] . "', - '" . $NewDepreciation ."')"; + typeno, + trandate, + periodno, + account, + narrative, + amount) + VALUES (44, + '" . $TransNo . "', + '" . FormatDateForSQL($_POST['ProcessDate']) . "', + '" . $PeriodNo . "', + '" . $AssetRow['depnact'] . "', + '" . $AssetRow['assetid'] . "', + '" . $NewDepreciation ."')"; $ErrMsg = _('Cannot insert a depreciation GL entry for the depreciation because'); $DbgMsg = _('The SQL that failed to insert the GL Trans record was'); $result = DB_query($SQL,$db,$ErrMsg,$DbgMsg,true); $SQL = "INSERT INTO gltrans (type, - typeno, - trandate, - periodno, - account, - narrative, - amount) - VALUES (44, - '" . $TransNo . "', - '" . FormatDateForSQL($_POST['ProcessDate']) . "', - '" . $PeriodNo . "', - '" . $AssetRow['accumdepnact'] . "', - '" . $AssetRow['assetid'] . "', - '" . -$NewDepreciation ."')"; + typeno, + trandate, + periodno, + account, + narrative, + amount) + VALUES (44, + '" . $TransNo . "', + '" . FormatDateForSQL($_POST['ProcessDate']) . "', + '" . $PeriodNo . "', + '" . $AssetRow['accumdepnact'] . "', + '" . $AssetRow['assetid'] . "', + '" . -$NewDepreciation ."')"; $result = DB_query($SQL,$db,$ErrMsg,$DbgMsg,true); //insert the fixedassettrans record $SQL = "INSERT INTO fixedassettrans (assetid, - transtype, - transno, - transdate, - periodno, - inputdate, - fixedassettranstype, - amount) - VALUES ('" . $AssetRow['assetid'] . "', - '44', - '" . $TransNo . "', - '" . FormatDateForSQL($_POST['ProcessDate']) . "', - '" . $PeriodNo . "', - '" . Date('Y-m-d') . "', - 'depn', - '" . $NewDepreciation . "')"; + transtype, + transno, + transdate, + periodno, + inputdate, + fixedassettranstype, + amount) + VALUES ('" . $AssetRow['assetid'] . "', + '44', + '" . $TransNo . "', + '" . FormatDateForSQL($_POST['ProcessDate']) . "', + '" . $PeriodNo . "', + '" . Date('Y-m-d') . "', + 'depn', + '" . $NewDepreciation . "')"; $ErrMsg = _('Cannot insert a fixed asset transaction entry for the depreciation because'); $DbgMsg = _('The SQL that failed to insert the fixed asset transaction record was'); $result = DB_query($SQL,$db,$ErrMsg,$DbgMsg,true); /*now update the accum depn in fixedassets */ $SQL = "UPDATE fixedassets SET accumdepn = accumdepn + " . $NewDepreciation . " - WHERE assetid = '" . $AssetRow['assetid'] . "'"; + WHERE assetid = '" . $AssetRow['assetid'] . "'"; $ErrMsg = _('CRITICAL ERROR! NOTE DOWN THIS ERROR AND SEEK ASSISTANCE. The fixed asset accumulated depreciation could not be updated:'); $DbgMsg = _('The following SQL was used to attempt the update the accumulated depreciation of the asset was:'); $Result = DB_query($SQL,$db,$ErrMsg, $DbgMsg, true); @@ -249,7 +247,7 @@ $result = DB_Txn_Commit($db); prnMsg(_('Depreciation') . ' ' . $TransNo . ' ' . _('has been successfully entered'),'success'); unset($_POST['ProcessDate']); - echo '<br><a href="index.php' . '?' . SID . '">' ._('Return to main menu').'</a>'; + echo '<br /><a href="index.php' . '?' . SID . '">' ._('Return to main menu').'</a>'; /*And post the journal too */ include ('includes/GLPostings.inc'); } else { @@ -265,7 +263,7 @@ <td>' . $_POST['ProcessDate'] .'</td>'; } echo '<td><div class="centre"><input type="submit" name="CommitDepreciation" value="'._('Commit Depreciation').'"></div>'; - echo '</tr></table><br>'; + echo '</tr></table><br />'; echo '</form>'; } include('includes/footer.inc'); Modified: trunk/FixedAssetItems.php =================================================================== --- trunk/FixedAssetItems.php 2011-03-29 13:55:41 UTC (rev 4525) +++ trunk/FixedAssetItems.php 2011-03-30 09:06:33 UTC (rev 4526) @@ -1,16 +1,13 @@ <?php /* $Id$ */ -/* $Revision: 1.3 $ */ -//$PageSecurity = 11; - include('includes/session.inc'); $title = _('Fixed Assets'); include('includes/header.inc'); include('includes/SQL_CommonFunctions.inc'); -echo '<a href="' . $rootpath . '/SelectAsset.php?' . SID . '">' . _('Back to Select') . '</a><br>' . "\n"; +echo '<a href="' . $rootpath . '/SelectAsset.php">' . _('Back to Select') . '</a><br />' . "\n"; echo '<p class="page_title_text"><img src="'.$rootpath.'/css/'.$theme.'/images/money_add.png" title="' . _('Fixed Asset Items') . '" alt="" />' . ' ' . $title . '</p>'; @@ -132,7 +129,10 @@ $PeriodNo = GetPeriod(Date($_SESSION['DefaultDateFormat']),$db); /* Get the new account codes for the new asset category */ - $result = DB_query("SELECT costact, accumdepnact FROM fixedassetcategories WHERE categoryid='" . $_POST['AssetCategoryID'] . "'",$db); + $result = DB_query("SELECT costact, + accumdepnact + FROM fixedassetcategories + WHERE categoryid='" . $_POST['AssetCategoryID'] . "'",$db); $NewAccounts = DB_fetch_array($result); $TransNo = GetNextTransNo( 42, $db); /* transaction type is asset category change */ @@ -144,75 +144,75 @@ periodno, account, narrative, - amount) "; - $SQL= $SQL . "VALUES (42, - '" . $TransNo . "', - '" . Date('Y-m-d') . "', - '" . $PeriodNo . "', - '" . $OldDetails['costact'] . "', - '" . $AssetID . ' ' . _('change category') . ' ' . $OldDetails['assetcategoryid'] . ' - ' . $_POST['AssetCategoryID'] . "', - '" . -$OldDetails['cost']. "' - )"; + amount) + VALUES ('42', + '" . $TransNo . "', + '" . Date('Y-m-d') . "', + '" . $PeriodNo . "', + '" . $OldDetails['costact'] . "', + '" . $AssetID . ' ' . _('change category') . ' ' . $OldDetails['assetcategoryid'] . ' - ' . $_POST['AssetCategoryID'] . "', + '" . -$OldDetails['cost']. "' + )"; $ErrMsg = _('Cannot insert a GL entry for the change of asset category because'); $DbgMsg = _('The SQL that failed to insert the cost GL Trans record was'); $result = DB_query($SQL,$db,$ErrMsg,$DbgMsg,true); //debit cost for the new category $SQL = "INSERT INTO gltrans (type, - typeno, - trandate, - periodno, - account, - narrative, - amount) "; - $SQL= $SQL . "VALUES (42, - '" . $TransNo . "', - '" . Date('Y-m-d') . "', - '" . $PeriodNo . "', - '" . $NewAccounts['costact'] . "', - '" . $AssetID . ' ' . _('change category') . ' ' . $OldDetails['assetcategoryid'] . ' - ' . $_POST['AssetCategoryID'] . "', - '" . $OldDetails['cost']. "' - )"; + typeno, + trandate, + periodno, + account, + narrative, + amount) + VALUES ('42', + '" . $TransNo . "', + '" . Date('Y-m-d') . "', + '" . $PeriodNo . "', + '" . $NewAccounts['costact'] . "', + '" . $AssetID . ' ' . _('change category') . ' ' . $OldDetails['assetcategoryid'] . ' - ' . $_POST['AssetCategoryID'] . "', + '" . $OldDetails['cost']. "' + )"; $ErrMsg = _('Cannot insert a GL entry for the change of asset category because'); $DbgMsg = _('The SQL that failed to insert the cost GL Trans record was'); $result = DB_query($SQL,$db,$ErrMsg,$DbgMsg,true); if ($OldDetails['accumdepn']!=0) { //debit accumdepn for the old category $SQL = "INSERT INTO gltrans (type, - typeno, - trandate, - periodno, - account, - narrative, - amount) "; - $SQL= $SQL . "VALUES (42, - '" . $TransNo . "', - '" . Date('Y-m-d') . "', - '" . $PeriodNo . "', - '" . $OldDetails['accumdepnact'] . "', - '" . $AssetID . ' ' . _('change category') . ' ' . $OldDetails['assetcategoryid'] . ' - ' . $_POST['AssetCategoryID'] . "', - '" . $OldDetails['accumdepn']. "' - )"; + typeno, + trandate, + periodno, + account, + narrative, + amount) + VALUES ('42', + '" . $TransNo . "', + '" . Date('Y-m-d') . "', + '" . $PeriodNo . "', + '" . $OldDetails['accumdepnact'] . "', + '" . $AssetID . ' ' . _('change category') . ' ' . $OldDetails['assetcategoryid'] . ' - ' . $_POST['AssetCategoryID'] . "', + '" . $OldDetails['accumdepn']. "' + )"; $ErrMsg = _('Cannot insert a GL entry for the change of asset category because'); $DbgMsg = _('The SQL that failed to insert the cost GL Trans record was'); $result = DB_query($SQL,$db,$ErrMsg,$DbgMsg,true); //credit accum depn for the new category $SQL = "INSERT INTO gltrans (type, - typeno, - trandate, - periodno, - account, - narrative, - amount) "; - $SQL= $SQL . "VALUES (42, - '" . $TransNo . "', - '" . Date('Y-m-d') . "', - '" . $PeriodNo . "', - '" . $NewAccounts['accumdepnact'] . "', - '" . $AssetID . ' ' . _('change category') . ' ' . $OldDetails['assetcategoryid'] . ' - ' . $_POST['AssetCategoryID'] . "', - '" . $OldDetails['accumdepn']. "' - )"; + typeno, + trandate, + periodno, + account, + narrative, + amount) + VALUES ('42', + '" . $TransNo . "', + '" . Date('Y-m-d') . "', + '" . $PeriodNo . "', + '" . $NewAccounts['accumdepnact'] . "', + '" . $AssetID . ' ' . _('change category') . ' ' . $OldDetails['assetcategoryid'] . ' - ' . $_POST['AssetCategoryID'] . "', + '" . $OldDetails['accumdepn']. "' + )"; $ErrMsg = _('Cannot insert a GL entry for the change of asset category because'); $DbgMsg = _('The SQL that failed to insert the cost GL Trans record was'); $result = DB_query($SQL,$db,$ErrMsg,$DbgMsg,true); @@ -234,25 +234,25 @@ $result = DB_query($sql,$db,$ErrMsg,$DbgMsg); prnMsg( _('Asset') . ' ' . $AssetID . ' ' . _('has been updated'), 'success'); - echo '<br>'; + echo '<br />'; } else { //it is a NEW part $sql = "INSERT INTO fixedassets (description, - longdescription, - assetcategoryid, - assetlocation, - depntype, - depnrate, - barcode, - serialno) - VALUES ( - '" . $_POST['Description'] . "', - '" . $_POST['LongDescription'] . "', - '" . $_POST['AssetCategoryID'] . "', - '" . $_POST['AssetLocation'] . "', - '" . $_POST['DepnType'] . "', - '" . $_POST['DepnRate']. "', - '" . $_POST['BarCode'] . "', - '" . $_POST['SerialNo'] . "' )"; + longdescription, + assetcategoryid, + assetlocation, + depntype, + depnrate, + barcode, + serialno) + VALUES ( + '" . $_POST['Description'] . "', + '" . $_POST['LongDescription'] . "', + '" . $_POST['AssetCategoryID'] . "', + '" . $_POST['AssetLocation'] . "', + '" . $_POST['DepnType'] . "', + '" . $_POST['DepnRate']. "', + '" . $_POST['BarCode'] . "', + '" . $_POST['SerialNo'] . "' )"; $ErrMsg = _('The asset could not be added because'); $DbgMsg = _('The SQL that was used to add the asset failed was'); $result = DB_query($sql,$db, $ErrMsg, $DbgMsg); @@ -272,7 +272,7 @@ $result = DB_Txn_Commit($db); } } else { - echo '<br>'. "\n"; + echo '<br />'. "\n"; prnMsg( _('Validation failed, no updates or deletes took place'), 'error'); } @@ -282,12 +282,12 @@ $CancelDelete = 0; //what validation is required before allowing deletion of assets .... maybe there should be no deletion option? $result = DB_query("SELECT cost, - accumdepn, - accumdepnact, - costact - FROM fixedassets INNER JOIN fixedassetcategories - ON fixedassets.assetcategoryid=fixedassetcategories.categoryid - WHERE assetid='" . $AssetID . "'", $db); + accumdepn, + accumdepnact, + costact + FROM fixedassets INNER JOIN fixedassetcategories + ON fixedassets.assetcategoryid=fixedassetcategories.categoryid + WHERE assetid='" . $AssetID . "'", $db); $AssetRow = DB_fetch_array($result); $NBV = $AssetRow['cost'] -$AssetRow['accumdepn']; if ($NBV!=0) { @@ -313,40 +313,40 @@ if ($AssetRow['cost'] > 0){ //credit cost for the asset deleted $SQL = "INSERT INTO gltrans (type, - typeno, - trandate, - periodno, - account, - narrative, - amount) "; - $SQL= $SQL . "VALUES (43, - '" . $TransNo . "', - '" . Date('Y-m-d') . "', - '" . $PeriodNo . "', - '" . $AssetRow['costact'] . "', - '" . _('Delete asset') . ' ' . $AssetID . "', - '" . -$AssetRow['cost']. "' - )"; + typeno, + trandate, + periodno, + account, + narrative, + amount) + VALUES ('43', + '" . $TransNo . "', + '" . Date('Y-m-d') . "', + '" . $PeriodNo . "', + '" . $AssetRow['costact'] . "', + '" . _('Delete asset') . ' ' . $AssetID . "', + '" . -$AssetRow['cost']. "' + )"; $ErrMsg = _('Cannot insert a GL entry for the deletion of the asset because'); $DbgMsg = _('The SQL that failed to insert the cost GL Trans record was'); $result = DB_query($SQL,$db,$ErrMsg,$DbgMsg,true); //debit accumdepn for the depreciation removed on deletion of this asset $SQL = "INSERT INTO gltrans (type, - typeno, - trandate, - periodno, - account, - narrative, - amount) "; - $SQL= $SQL . "VALUES (43, - '" . $TransNo . "', - '" . Date('Y-m-d') . "', - '" . $PeriodNo . "', - '" . $AssetRow['accumdepnact'] . "', - '" . _('Delete asset') . ' ' . $AssetID . "', - '" . $Asset['accumdepn']. "' - )"; + typeno, + trandate, + periodno, + account, + narrative, + amount) + VALUES ('43', + '" . $TransNo . "', + '" . Date('Y-m-d') . "', + '" . $PeriodNo . "', + '" . $AssetRow['accumdepnact'] . "', + '" . _('Delete asset') . ' ' . $AssetID . "', + '" . $Asset['accumdepn']. "' + )"; $ErrMsg = _('Cannot insert a GL entry for the reversal of accumulated depreciation on deletion of the asset because'); $DbgMsg = _('The SQL that failed to insert the cost GL Trans record was'); $result = DB_query($SQL,$db,$ErrMsg,$DbgMsg,true); @@ -467,7 +467,7 @@ } if ($AssetImgLink!=_('No Image')) { - echo '<td>' . _('Image') . '<br>'.$AssetImgLink . '</td></tr>'; + echo '<td>' . _('Image') . '<br />'.$AssetImgLink . '</td></tr>'; } else { echo '</td></tr>'; } @@ -484,13 +484,13 @@ while ($myrow=DB_fetch_array($result)){ if (!isset($_POST['AssetCategoryID']) or $myrow['categoryid']==$_POST['AssetCategoryID']){ - 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>'; } $category=$myrow['categoryid']; } -echo '</select><a target="_blank" href="'. $rootpath . '/FixedAssetCategories.php?' . SID . '">'.' ' . _('Add or Modify Asset Categories') . '</a></td></tr>'; +echo '</select><a target="_blank" href="'. $rootpath . '/FixedAssetCategories.php">'.' ' . _('Add or Modify Asset Categories') . '</a></td></tr>'; if (!isset($_POST['AssetCategoryID'])) { $_POST['AssetCategoryID']=$category; } @@ -545,12 +545,12 @@ echo '<tr><td>' . _('Net Book Value') . ':</td><td class="number">' . number_format($AssetRow['cost']-$AssetRow['accumdepn'],2) . '</td></tr>'; $result = DB_query('SELECT periods.lastdate_in_period, - max(fixedassettrans.periodno) - FROM fixedassettrans INNER JOIN periods - ON fixedassettrans.periodno=periods.periodno - WHERE transtype=44 - GROUP BY periods.lastdate_in_period - ORDER BY periods.lastdate_in_period DESC',$db); + max(fixedassettrans.periodno) + FROM fixedassettrans INNER JOIN periods + ON fixedassettrans.periodno=periods.periodno + WHERE transtype=44 + GROUP BY periods.lastdate_in_period + ORDER BY periods.lastdate_in_period DESC',$db); $LastDepnRun = DB_fetch_row($result); if(DB_num_rows($result)==0){ @@ -563,13 +563,13 @@ if (isset($New)) { - echo '<div class=centre><br><input type="Submit" name="submit" value="' . _('Insert New Fixed Asset') . '">'; + echo '<div class=centre><br /><input type="Submit" name="submit" value="' . _('Insert New Fixed Asset') . '">'; } else { - echo '<br><div class=centre><input type="submit" name="submit" value="' . _('Update') . '"></div>'; + echo '<br /><div class=centre><input type="submit" name="submit" value="' . _('Update') . '"></div>'; prnMsg( _('Only click the Delete button if you are sure you wish to delete the asset. Only assets with a zero book value can be deleted'), 'warn', _('WARNING')); - echo '<br><div class=centre><input type="Submit" name="delete" value="' . _('Delete This Asset') . '" onclick="return confirm(\'' . _('Are You Sure? Only assets with a zero book value can be deleted.') . '\');"></div>'; + echo '<br /><div class=centre><input type="Submit" name="delete" value="' . _('Delete This Asset') . '" onclick="return confirm(\'' . _('Are You Sure? Only assets with a zero book value can be deleted.') . '\');"></div>'; } echo '</form></div>'; Modified: trunk/GLAccountCSV.php =================================================================== --- trunk/GLAccountCSV.php 2011-03-29 13:55:41 UTC (rev 4525) +++ trunk/GLAccountCSV.php 2011-03-30 09:06:33 UTC (rev 4526) @@ -1,9 +1,8 @@ <?php -/* $Id: $*/ -/* $Revision: 1.00 $ */ -//$PageSecurity = 8; +/* $Id: GLAccountCSV.php 4492 2011-02-18 09:56:52Z daintree $ */ + include ('includes/session.inc'); $title = _('General Ledger Account Report'); include('includes/header.inc'); @@ -19,7 +18,7 @@ echo '<div class="page_help_text">' . _('Use the keyboard Shift key to select multiple accounts and periods') . '</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'] . '" />'; /*Dates in SQL format for the last day of last month*/ @@ -35,10 +34,10 @@ $i=0; while ($myrow=DB_fetch_array($AccountsResult,$db)){ if(isset($_POST['Account'][$i]) AND $myrow['accountcode'] == $_POST['Account'][$i]){ - echo '<option selected VALUE=' . $myrow['accountcode'] . '>' . $myrow['accountcode'] . ' ' . $myrow['accountname']; + echo '<option selected VALUE=' . $myrow['accountcode'] . '>' . $myrow['accountcode'] . ' ' . $myrow['accountname'] . '</option>'; $i++; } else { - echo '<option VALUE=' . $myrow['accountcode'] . '>' . $myrow['accountcode'] . ' ' . $myrow['accountname']; + echo '<option VALUE=' . $myrow['accountcode'] . '>' . $myrow['accountcode'] . ' ' . $myrow['accountname'] . '</option>'; } } echo '</select></td>'; @@ -51,10 +50,10 @@ while ($myrow=DB_fetch_array($Periods,$db)){ if (isset($SelectedPeriod[$id]) and $myrow['periodno'] == $SelectedPeriod[$id]){ - echo '<option selected VALUE=' . $myrow['periodno'] . '>' . _(MonthAndYearFromSQLDate($myrow['lastdate_in_period'])); + echo '<option selected VALUE=' . $myrow['periodno'] . '>' . _(MonthAndYearFromSQLDate($myrow['lastdate_in_period'])) . '</option>'; $id++; } else { - 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>'; @@ -71,9 +70,9 @@ echo '<option value=0>0 - '._('All tags'); while ($myrow=DB_fetch_array($result)){ if (isset($_POST['tag']) and $_POST['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></tr>'; @@ -95,7 +94,6 @@ prnMsg(_('An account or range of accounts must be selected from the list box'),'info'); include('includes/footer.inc'); exit; - } if (!file_exists($_SESSION['reports_dir'])){ @@ -115,10 +113,10 @@ foreach ($_POST['Account'] as $SelectedAccount){ /*Is the account a balance sheet or a profit and loss account */ $result = DB_query("SELECT chartmaster.accountname, - accountgroups.pandl - FROM accountgroups - INNER JOIN chartmaster ON accountgroups.groupname=chartmaster.group_ - WHERE chartmaster.accountcode=$SelectedAccount",$db); + accountgroups.pandl + FROM accountgroups + INNER JOIN chartmaster ON accountgroups.groupname=chartmaster.group_ + WHERE chartmaster.accountcode=$SelectedAccount",$db); $AccountDetailRow = DB_fetch_row($result); $AccountName = $AccountDetailRow[1]; if ($AccountDetailRow[1]==1){ @@ -140,11 +138,11 @@ gltrans.periodno, gltrans.tag FROM gltrans, systypes - WHERE gltrans.account = $SelectedAccount + WHERE gltrans.account = '$SelectedAccount' AND systypes.typeid=gltrans.type AND posted=1 - AND periodno>=$FirstPeriodSelected - AND periodno<=$LastPeriodSelected + AND periodno>='$FirstPeriodSelected' + AND periodno<='$LastPeriodSelected' ORDER BY periodno, gltrans.trandate, counterindex"; } else { @@ -157,11 +155,11 @@ gltrans.periodno, gltrans.tag FROM gltrans, systypes - WHERE gltrans.account = $SelectedAccount + WHERE gltrans.account = '$SelectedAccount' AND systypes.typeid=gltrans.type AND posted=1 - AND periodno>=$FirstPeriodSelected - AND periodno<=$LastPeriodSelected + AND periodno>='$FirstPeriodSelected' + AND periodno<='$LastPeriodSelected' AND tag='".$_POST['tag']."' ORDER BY periodno, gltrans.trandate, counterindex"; } @@ -177,8 +175,8 @@ actual, period FROM chartdetails - WHERE chartdetails.accountcode= $SelectedAccount - AND chartdetails.period=" . $FirstPeriodSelected; + WHERE chartdetails.accountcode= '$SelectedAccount' + AND chartdetails.period='" . $FirstPeriodSelected . "'"; $ErrMsg = _('The chart details for account') . ' ' . $SelectedAccount . ' ' . _('could not be retrieved'); $ChartDetailsResult = DB_query($sql,$db,$ErrMsg); @@ -206,8 +204,8 @@ actual, period FROM chartdetails - WHERE chartdetails.accountcode= $SelectedAccount - AND chartdetails.period=" . $PeriodNo; + WHERE chartdetails.accountcode= '$SelectedAccount' + AND chartdetails.period='" . $PeriodNo . "'"; $ErrMsg = _('The chart details for account') . ' ' . $SelectedAccount . ' ' . _('could not be retrieved'); $ChartDetailsResult = DB_query($sql,$db,$ErrMsg); @@ -225,7 +223,6 @@ $RunningTotal += $myrow['amount']; $PeriodTotal += $myrow['amount']; - $FormatedTranDate = ConvertSQLDate($myrow['trandate']); $tagsql="SELECT tagdescription FROM tags WHERE tagref='".$myrow['tag'] . "'"; @@ -264,4 +261,4 @@ } /* end of if CreateCSV button hit */ include('includes/footer.inc'); -?> +?> \ No newline at end of file Modified: trunk/GLBudgets.php =================================================================== --- trunk/GLBudgets.php 2011-03-29 13:55:41 UTC (rev 4525) +++ trunk/GLBudgets.php 2011-03-30 09:06:33 UTC (rev 4526) @@ -1,7 +1,5 @@ <?php - /* $Id$*/ -//$PageSecurity = 10; include('includes/session.inc'); include('includes/SQL_CommonFunctions.inc'); @@ -23,12 +21,12 @@ } if (isset($_POST['update'])) { - prnMsg('Budget updated successfully', 'success'); + prnMsg(_('Budget updated successfully'), 'success'); } //If an account hasn't been selected then select one here. echo '<p class="page_title_text"><img src="'.$rootpath.'/css/'.$theme.'/images/maintenance.png" title="' . _('Search') . '" alt="" />' . ' ' . $title.'</p>'; -echo '<form action=' . $_SERVER['PHP_SELF'] . '?' . SID . ' method=post name="selectaccount">'; +echo '<form action="' . $_SERVER['PHP_SELF'] . '" method="post" name="selectaccount">'; echo '<input type="hidden" name="FormID" value="' . $_SESSION['FormID'] . '" />'; echo '<table>'; @@ -36,9 +34,9 @@ onChange='ReloadForm(selectaccount.Select)'>"; $SQL = 'SELECT accountcode, - accountname - FROM chartmaster - ORDER BY accountcode'; + accountname + FROM chartmaster + ORDER BY accountcode'; $result=DB_query($SQL,$db); if (DB_num_rows($result)==0){ @@ -48,10 +46,10 @@ while ($myrow=DB_fetch_array($result)){ $account = $myrow['accountcode'] . ' - ' . $myrow['accountname']; if (isset($SelectedAccount) and isset($LastCode) and $SelectedAccount==$myrow['accountcode']){ - echo '<option selected value=' . $myrow['accountcode'] . '>' . $account; + echo '<option selected value=' . $myrow['accountcode'] . '>' . $account . '</option>'; $PrevCode=$LastCode; } else { - echo '<option value=' . $myrow['accountcode'] . '>' . $account; + echo '<option value=' . $myrow['accountcode'] . '>' . $account . '</option>'; if (isset($SelectedAccount) and isset($LastCode) and $SelectedAccount == $LastCode) { $NextCode=$myrow['accountcode']; } @@ -148,7 +146,7 @@ // Table Headers - echo '<form name="form" action=' . $_SERVER['PHP_SELF'] . '?' . SID . ' method=post>'; + echo '<form name="form" action="' . $_SERVER['PHP_SELF'] . '" method=post>'; echo '<input type="hidden" name="FormID" value="' . $_SESSION['FormID'] . '" />'; echo '<br /><table class=selection>'; echo '<tr><th colspan=3>'. _('Last Financial Year') .'</th>'; @@ -156,7 +154,7 @@ echo '<th colspan=3>'. _('Next Financial Year') .'</th></tr>'; echo '<tr><th colspan=3>'. _('Year ended').' - '. - Date($_SESSION['DefaultDateFormat'],YearEndDate($_SESSION['YearEnd'], -1)) .'</th>'; + Date($_SESSION['DefaultDateFormat'],YearEndDate($_SESSION['YearEnd'],-1)) .'</th>'; echo '<th colspan=3>'. _('Year ended').' - '. Date($_SESSION['DefaultDateFormat'],YearEndDate($_SESSION['YearEnd'],0)) .'</th>'; echo '<th colspan=3>'. _('Year ended').' - '. @@ -170,7 +168,6 @@ } echo '</tr>'; - // Main Table for ($i=1; $i<=12; $i++) { Modified: trunk/GLCodesInquiry.php =================================================================== --- trunk/GLCodesInquiry.php 2011-03-29 13:55:41 UTC (rev 4525) +++ trunk/GLCodesInquiry.php 2011-03-30 09:06:33 UTC (rev 4526) @@ -1,9 +1,7 @@ <?php /* $Id$*/ -/* $Revision: 1.9 $ */ -//$PageSecurity = 8; include ('includes/session.inc'); $title = _('GL Codes Inquiry'); @@ -13,20 +11,20 @@ $SQL = 'SELECT group_, accountcode , accountname - FROM chartmaster INNER JOIN accountgroups ON chartmaster.group_ = accountgroups.groupname - ORDER BY sequenceintb, - accountcode'; + FROM chartmaster INNER JOIN accountgroups ON chartmaster.group_ = accountgroups.groupname + ORDER BY sequenceintb, + accountcode'; $ErrMsg = _('No general ledger accounts were returned by the SQL because'); $AccountsResult = DB_query($SQL,$db,$ErrMsg); /*show a table of the orders returned by the SQL */ -echo "<table cellpadding=2 colspan=2> +echo '<table cellpadding=2 colspan=2> <tr> - <th>"._('Group')."</font></th> - <th>"._('Code')."</font></th> - <th>"._('Account Name').'</font></th> + <th>' . _('Group') . '</font></th> + <th>' . _('Code') . '</font></th> + <th>' . _('Account Name') . '</font></th> </tr>'; $j = 1; @@ -63,7 +61,5 @@ //end of while loop echo '</table>'; - include('includes/footer.inc'); - -?> +?> \ No newline at end of file Modified: trunk/GLJournal.php =================================================================== --- trunk/GLJournal.php 2011-03-29 13:55:41 UTC (rev 4525) +++ trunk/GLJournal.php 2011-03-30 09:06:33 UTC (rev 4526) @@ -1,11 +1,9 @@ <?php /* $Id$*/ -/* $Revision: 1.27 $ */ include('includes/DefineJournalClass.php'); -//$PageSecurity = 10; include('includes/session.inc'); $title = _('Journal Entry'); @@ -24,7 +22,7 @@ Journals cannot be entered against bank accounts GL postings involving bank accounts must be done using a receipt or a payment transaction to ensure a bank trans is available for matching off vs statements */ - $SQL = "SELECT accountcode FROM bankaccounts"; + $SQL = 'SELECT accountcode FROM bankaccounts'; $result = DB_query($SQL,$db); $i=0; while ($Act = DB_fetch_row($result)){ @@ -68,8 +66,8 @@ account, narrative, amount, - tag) "; - $SQL= $SQL . "VALUES (0, + tag) + VALUES ('0', '" . $TransNo . "', '" . FormatDateForSQL($_SESSION['JournalDetail']->JnlDate) . "', '" . $PeriodNo . "', @@ -90,8 +88,8 @@ account, narrative, amount, - tag) "; - $SQL= $SQL . "VALUES (0, + tag) + VALUES ('0', '" . $TransNo . "', '" . FormatDateForSQL($_SESSION['JournalDetail']->JnlDate) . "', '" . ($PeriodNo + 1) . "', @@ -104,7 +102,6 @@ $ErrMsg =_('Cannot insert a GL entry for the reversing journal because'); $DbgMsg = _('The SQL that failed to insert the GL Trans record was'); $result = DB_query($SQL,$db,$ErrMsg,$DbgMsg,true); - } } @@ -120,7 +117,7 @@ unset($_SESSION['JournalDetail']); /*Set up a newy in case user wishes to enter another */ - echo "<br /><a href='" . $_SERVER['PHP_SELF'] . '?' . SID . "&NewJournal=Yes'>"._('Enter Another General Ledger Journal').'</a>'; + echo '<br /><a href="' . $_SERVER['PHP_SELF'] . '?NewJournal=Yes">'._('Enter Another General Ledger Journal').'</a>'; /*And post the journal too */ include ('includes/GLPostings.inc'); include ('includes/footer.inc'); @@ -132,21 +129,17 @@ $_SESSION['JournalDetail']->Remove_GLEntry($_GET['Delete']); } elseif (isset($_POST['Process']) and $_POST['Process']==_('Accept')){ //user hit submit a new GL Analysis line into the journal - if($_POST['GLCode']!='') - { + if ($_POST['GLCode']!='') { $extract = explode(' - ',$_POST['GLCode']); $_POST['GLCode'] = $extract[0]; } - if($_POST['Debit']>0) - { + if ($_POST['Debit']>0) { $_POST['GLAmount'] = $_POST['Debit']; - } - elseif($_POST['Credit']>0) - { + } elseif ($_POST['Credit']>0) { $_POST['GLAmount'] = '-' . $_POST['Credit']; } if ($_POST['GLManualCode'] != '' AND is_numeric($_POST['GLManualCode'])){ - // If a manual code was entered need to check it exists and isnt a bank account + // If a manual code was entered need to check it exists and isnt a bank account $AllowThisPosting = true; //by default if ($_SESSION['ProhibitJournalsToControlAccounts'] == 1){ if ($_SESSION['CompanyRecord']['gllink_debtors'] == '1' AND $_POST['GLManualCode'] == $_SESSION['CompanyRecord']['debtorsact']){ @@ -228,18 +221,10 @@ unset($_POST['GLManualCode']); } -// set up the form whatever -/* -if (!isset($_SESSION['JournalDetail']->JnlDate)){ - $_POST['JournalProcessDate']= Date($_SESSION['DefaultDateFormat']); - $_SESSION['JournalDetail']->JnlDate = $_POST['JournalProcessDate']; -} -*/ -echo '<form action="' . $_SERVER['PHP_SELF'] . '?' . SID . '" method="post" name="form">'; +echo '<form action="' . $_SERVER['PHP_SELF'] . '" method="post" name="form">'; echo '<input type="hidden" name="FormID" value="' . $_SESSION['FormID'] . '" />'; - echo '<p class="page_title_text"><img src="'.$rootpath.'/css/'.$theme.'/images/maintenance.png" title="' . _('Search') . '" alt="" />' . ' ' . $title.'</p>'; // A new table in the first column of the main table @@ -287,8 +272,8 @@ $SQL = 'SELECT tagref, tagdescription - FROM tags - ORDER BY tagref'; + FROM tags + ORDER BY tagref'; $result=DB_query($SQL,$db); echo '<option value="0">0 - None</option>'; @@ -309,10 +294,10 @@ "'".'The account code '."'".'+ this.value+ '."'".' doesnt exist'."'".')"' . ' value="'. $_POST['GLManualCode'] .'" /></td>'; -$sql="SELECT accountcode, +$sql='SELECT accountcode, accountname FROM chartmaster - ORDER BY accountcode"; + ORDER BY accountcode'; $result=DB_query($sql, $db); echo '<td><select name="GLCode" onChange="return assignComboToInput(this,'.'GLManualCode'.')">'; @@ -336,15 +321,14 @@ $_POST['Debit'] = ''; } - echo '</tr><tr><th>' . _('Debit') . '</th>'.'<td><input type="text" class="number" Name = "Debit" ' . 'onChange="eitherOr(this, '.'Credit'.')"'. ' Maxlength="12" size="10" value="' . $_POST['Debit'] . '" /></td>'; -echo '</tr><tr><th>' . _('Credit') . "</th>".'<td><input type="text" class="number" Name = "Credit" ' . +echo '</tr><tr><th>' . _('Credit') . '</th><td><input type="text" class="number" Name = "Credit" ' . 'onChange="eitherOr(this, '.'Debit'.')"'. ' Maxlength="12" size="10" value="' . $_POST['Credit'] . '" /></td>'; echo '</tr><tr><td></td><td></td><th>'. _('Narrative'). '</th>'; -echo '</tr><tr><th></th><th>' . _('GL Narrative') . "</th>"; +echo '</tr><tr><th></th><th>' . _('GL Narrative') . '</th>'; echo '<td><input type="text" name="GLNarrative" maxlength="100" size="100" value="' . $_POST['GLNarrative'] . '" /></td>'; @@ -398,22 +382,22 @@ } echo '<td>' . $JournalItem->Narrative . "</td> - <td><a href='" . $_SERVER['PHP_SELF'] . '?' . SID . '&Delete=' . $JournalItem->ID . "'>"._('Delete').'</a></td> + <td><a href='" . $_SERVER['PHP_SELF'] . '?Delete=' . $JournalItem->ID . "'>"._('Delete').'</a></td> </tr>'; } echo '<tr class="EvenTableRows"><td></td> - <td class="number"><b> Total </b></td> + <td class="number"><b>' . _('Total') . '</b></td> <td class="number"><b>' . number_format($debittotal,2) . '</b></td> <td class="number"><b>' . number_format($credittotal,2) . '</b></td></tr>'; if ($debittotal!=$credittotal) { - echo '<td align="center" style="background-color: #fddbdb"><b>Required to balance - </b>' . + echo '<td align="center" style="background-color: #fddbdb"><b>' . _('Required to balance') .' - </b>' . number_format(abs($debittotal-$credittotal),2); } if ($debittotal>$credittotal) { - echo ' Credit</td></tr>'; + echo ' ' . _('Credit') . '</td></tr>'; } else if ($debittotal<$credittotal) { - echo ' Debit</td></tr>'; + echo ' ' . _('Debit') . '</td></tr>'; } echo '</table>'; Modified: trunk/PDFGrn.php =================================================================== --- trunk/PDFGrn.php 2011-03-29 13:55:41 UTC (rev 4525) +++ trunk/PDFGrn.php 2011-03-30 09:06:33 UTC (rev 4526) @@ -2,7 +2,6 @@ /* $Id$*/ -//$PageSecurity = 2; Now comes from DB - read in from session include('includes/session.inc'); if (isset($_GET['GRNNo'])) { Modified: trunk/doc/Change.log.html =================================================================== --- trunk/doc/Change.log.html 2011-03-29 13:55:41 UTC (rev 4525) +++ trunk/doc/Change.log.html 2011-03-30 09:06:33 UTC (rev 4526) @@ -1,5 +1,8 @@ <p><font SIZE=4 COLOR=BLUE><b>webERP Change Log</b></font></p> -<p> +<p /> +<p>30/3/11 Tim - New ReprintGRN.php script takes a purchase order and allows any line received to have GRN(s) reprinted</p> +<p>29/3/11 Phil - checking for unquoted SQL and for SQL where literals quoted with double quotes rather than single - double quotes are not ANSI compatible - so making the SQL more ANSI compatible by doing this as suggested by Tim. Many many scripts involved will take a week or so</p> +<p /> <p>27/3/11 - Version 4.03.5 Release <p> <p>27/3/11: Phil fixed SQL upgrade script to add the Z_ChangeSupplierCode.php script is added to the scripts table</p> Modified: trunk/includes/ConnectDB.inc =================================================================== --- trunk/includes/ConnectDB.inc 2011-03-29 13:55:41 UTC (rev 4525) +++ trunk/includes/ConnectDB.inc 2011-03-30 09:06:33 UTC (rev 4526) @@ -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.5'; //must update manually every time there is a DB change +$Version='4.03.6'; //must update manually every time there is a DB change require_once ($PathPrefix .'includes/MiscFunctions.php'); Modified: trunk/index.php =================================================================== --- trunk/index.php 2011-03-29 13:55:41 UTC (rev 4525) +++ trunk/index.php 2011-03-30 09:06:33 UTC (rev 4526) @@ -605,17 +605,17 @@ <table width="100%" class="table_index"> <tr> <td class="menu_group_item"> - <?php echo '<p>• <a href="' . $rootpath . "/StockSerialItemResearch.php?" . SID . '">' . _('Serial Item Research Tool') . '</a></p>'; ?> + <?php echo '<p>• <a href="' . $rootpath . '/StockSerialItemResearch.php">' . _('Serial Item Research Tool') . '</a></p>'; ?> </td> </tr> <tr> <td class="menu_group_item"> - <?php echo '<p>• <a href="' . $rootpath . "/PDFPrintLabel.php?" . SID . '">' . _('Print Price Labels') . '</a></p>'; ?> + <?php echo '<p>• <a href="' . $rootpath . '/PDFPrintLabel.php">' . _('Print Price Labels') . '</a></p>'; ?> </td> </tr> <tr> <td class="menu_group_item"> - <?php echo '<p>• <a href="' . $rootpath . "/StockMovements.php?" . SID . '">' . _('Inventory Item Movements') . '</a></p>'; ?> + <?php echo '<p>• <a href="' . $rootpath . '/StockMovements.php">' . _('Inventory Item Movements') . '</a></p>'; ?> </td> </tr> <tr> @@ -705,6 +705,11 @@ </tr> <tr> <td class="menu_group_item"> + <?php echo '<p>• <a href="' . $rootpath . '/ReprintGRN.php">' . _('Reprint GRN') . '</a></p>'; ?> + </td> + </tr> + <tr> + <td class="menu_group_item"> <?php echo GetRptLinks('inv'); ?> </td> </tr> Modified: trunk/sql/mysql/upgrade3.11.1-4.00.sql =================================================================== --- trunk/sql/mysql/upgrade3.11.1-4.00.sql 2011-03-29 13:55:41 UTC (rev 4525) +++ trunk/sql/mysql/upgrade3.11.1-4.00.sql 2011-03-30 09:06:33 UTC (rev 4526) @@ -835,4 +835,6 @@ ALTER TABLE `locations` CHANGE `cashsalecustomer` `cashsalecustomer` VARCHAR( 10 ) DEFAULT ''; UPDATE config SET confvalue='4.03.3' WHERE confname='VersionNumber'; INSERT INTO `scripts` (`script`, `pagesecurity`, `description`) VALUES ('Z_ChangeSupplierCode.php', '15', 'Script to change a supplier code accross all tables necessary'); -UPDATE config SET confvalue='4.03.5' WHERE confname='VersionNumber'; \ No newline at end of file +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'; This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <dai...@us...> - 2011-03-30 09:06:41
|
Revision: 4526 http://web-erp.svn.sourceforge.net/web-erp/?rev=4526&view=rev Author: daintree Date: 2011-03-30 09:06:33 +0000 (Wed, 30 Mar 2011) Log Message: ----------- SQL fixing quotes - not many, fixing gettext a few strings, Tims Reprint GRN Modified Paths: -------------- trunk/EDIMessageFormat.php trunk/EDISendInvoices.php trunk/FixedAssetCategories.php trunk/FixedAssetDepreciation.php trunk/FixedAssetItems.php trunk/GLAccountCSV.php trunk/GLBudgets.php trunk/GLCodesInquiry.php trunk/GLJournal.php trunk/PDFGrn.php trunk/doc/Change.log.html trunk/includes/ConnectDB.inc trunk/index.php trunk/sql/mysql/upgrade3.11.1-4.00.sql Modified: trunk/EDIMessageFormat.php =================================================================== --- trunk/EDIMessageFormat.php 2011-03-29 13:55:41 UTC (rev 4525) +++ trunk/EDIMessageFormat.php 2011-03-30 09:06:33 UTC (rev 4526) @@ -1,9 +1,7 @@ <?php -/* $Revision: 1.10 $ */ + /* $Id$*/ -//$PageSecurity = 10; - include('includes/session.inc'); $title = _('EDI Message Format'); include('includes/header.inc'); @@ -92,7 +90,7 @@ $sql="DELETE FROM edimessageformat WHERE id='" . $_GET['delete']."'"; $result = DB_query($sql,$db); - $msg='The selected message line has been deleted'; + $msg=_('The selected message line has been deleted'); } if (isset($msg)) { @@ -174,13 +172,13 @@ if (isset($SelectedMessageLine)) { //editing an existing message line - $sql = 'SELECT messagetype, + $sql = "SELECT messagetype, partnercode, section, sequenceno, linetext FROM edimessageformat - WHERE id=' . $SelectedMessageLine; + WHERE id='" . $SelectedMessageLine . "'"; $result = DB_query($sql, $db); $myrow = DB_fetch_array($result); @@ -206,25 +204,25 @@ echo '<tr><th colspan=2><font size=3>' . _('Definition of') . ' ' . $myrow['messagetype'] . ' ' . _('for') . ' ' . $myrow['partnercode'].'</font></th></tr>'; } -echo '<tr><td>Section:</td>'; +echo '<tr><td>' . _('Section') . ':</td>'; echo '<td>'; echo '<select tabindex=2 name="Section">'; if ($_POST['Section']=='Heading') { - echo "<option selected VALUE='Heading'>" . _('Heading'); + echo "<option selected VALUE='Heading'>" . _('Heading') . '</option>'; } else { - echo "<option value='Heading'>" . _('Heading'); + echo "<option value='Heading'>" . _('Heading') . '</option>'; } if (isset($_POST['Section']) and $_POST['Section']=='Detail') { - echo "<option selected VALUE='Detail'>" . _('Detail'); + echo "<option selected VALUE='Detail'>" . _('Detail') . '</option>'; } else { - echo "<option value='Detail'>" . _('Detail'); + echo "<option value='Detail'>" . _('Detail') . '</option>'; } if (isset($_POST['Section']) and $_POST['Section']=='Summary') { - echo "<option selected VALUE='Summary'>" . _('Summary'); + echo "<option selected VALUE='Summary'>" . _('Summary') . '</option>'; } else { - echo "<option value='Summary'>" . _('Summary'); + echo "<option value='Summary'>" . _('Summary') . '</option>'; } echo '</select>'; Modified: trunk/EDISendInvoices.php =================================================================== --- trunk/EDISendInvoices.php 2011-03-29 13:55:41 UTC (rev 4525) +++ trunk/EDISendInvoices.php 2011-03-30 09:06:33 UTC (rev 4526) @@ -1,10 +1,7 @@ <?php -/* $Revision: 1.11 $ */ /* $Id$*/ -//$PageSecurity =15; - include ('includes/session.inc'); include ('includes/header.inc'); include('includes/SQL_CommonFunctions.inc'); //need for EDITransNo @@ -100,7 +97,11 @@ then replace variable names with data write the output to a file one line at a time */ - $sql = "SELECT section, linetext FROM edimessageformat WHERE partnercode='" . $CustDetails['debtorno'] . "' AND messagetype='INVOIC' ORDER BY sequenceno"; + $sql = "SELECT section, + linetext + FROM edimessageformat + WHERE partnercode='" . $CustDetails['debtorno'] . "' + AND messagetype='INVOIC' ORDER BY sequenceno"; $ErrMsg = _('An error occurred in getting the EDI format template for') . ' ' . $CustDetails['debtorno'] . ' ' . _('because'); $MessageLinesResult = DB_query($sql, $db,$ErrMsg); @@ -145,7 +146,7 @@ stockmaster WHERE stockmoves.stockid = stockmaster.stockid AND stockmoves.type=10 - AND stockmoves.transno=" . $TransNo . " + AND stockmoves.transno='" . $TransNo . "' AND stockmoves.show_on_inv_crds=1"; } else { /* credit note */ @@ -160,7 +161,7 @@ FROM stockmoves, stockmaster WHERE stockmoves.stockid = stockmaster.stockid - AND stockmoves.type=11 and stockmoves.transno=" . $TransNo . " + AND stockmoves.type=11 and stockmoves.transno='" . $TransNo . "' AND stockmoves.show_on_inv_crds=1"; } $TransLinesResult = DB_query($sql,$db); @@ -218,10 +219,10 @@ $MessageSent = $mail->send(array($CustDetails['ediaddress'])); if ($MessageSent==True){ - echo '<br><br>'; + echo '<br /><br />'; prnMsg(_('EDI Message') . ' ' . $EDITransNo . ' ' . _('was successfully emailed'),'success'); } else { - echo '<br><br>'; + echo '<br /><br />'; prnMsg(_('EDI Message') . ' ' . $EDITransNo . _('could not be emailed to') . ' ' . $CustDetails['ediaddress'],'error'); } } else { /*it must be ftp transport */ @@ -230,16 +231,16 @@ $conn_id = ftp_connect($CustDetails['ediaddress']); // login with username and password $login_result = ftp_login($conn_id, $CustDetails['ediserveruser'], $CustDetails['ediserverpwd']); // check connection if ((!$conn_id) || (!$login_result)) { - prnMsg( _('Ftp connection has failed'). '<br>' . _('Attempted to connect to') . ' ' . $CustDetails['ediaddress'] . ' ' ._('for user') . ' ' . $CustDetails['ediserveruser'],'error'); + prnMsg( _('Ftp connection has failed'). '<br />' . _('Attempted to connect to') . ' ' . $CustDetails['ediaddress'] . ' ' ._('for user') . ' ' . $CustDetails['ediserveruser'],'error'); include('includes/footer.inc'); exit; } $MessageSent = ftp_put($conn_id, $_SESSION['EDI_MsgPending'] . '/EDI_INV_' . $EDITransNo, 'EDI_INV_' . $EDITransNo, FTP_ASCII); // check upload status if (!$MessageSent) { - echo '<br><br>'; + echo '<br /><br />'; prnMsg(_('EDI Message') . ' ' . $EDITransNo . ' ' . _('could not be sent via ftp to') .' ' . $CustDetails['ediaddress'],'error'); } else { - echo '<br><br>'; + echo '<br /><br />'; prnMsg( _('Successfully uploaded EDI_INV_') . $EDITransNo . ' ' . _('via ftp to') . ' ' . $CustDetails['ediaddress'],'success'); } // close the FTP stream ftp_quit($conn_id); Modified: trunk/FixedAssetCategories.php =================================================================== --- trunk/FixedAssetCategories.php 2011-03-29 13:55:41 UTC (rev 4525) +++ trunk/FixedAssetCategories.php 2011-03-30 09:06:33 UTC (rev 4526) @@ -1,7 +1,6 @@ <?php -/* $Revision: 1.1 $ */ -//$PageSecurity = 11; +/* $Id$*/ include('includes/session.inc'); @@ -93,18 +92,18 @@ } elseif ($InputError !=1) { $sql = "INSERT INTO fixedassetcategories (categoryid, - categorydescription, - costact, - depnact, - disposalact, - accumdepnact) - VALUES ( - '" . $_POST['CategoryID'] . "', - '" . $_POST['CategoryDescription'] . "', - '" . $_POST['CostAct'] . "', - '" . $_POST['DepnAct'] . "', - '" . $_POST['DisposalAct'] . "', - '" . $_POST['AccumDepnAct'] . "')"; + categorydescription, + costact, + depnact, + disposalact, + accumdepnact) + VALUES ( + '" . $_POST['CategoryID'] . "', + '" . $_POST['CategoryDescription'] . "', + '" . $_POST['CostAct'] . "', + '" . $_POST['DepnAct'] . "', + '" . $_POST['DisposalAct'] . "', + '" . $_POST['AccumDepnAct'] . "')"; $ErrMsg = _('Could not insert the new fixed asset category') . $_POST['CategoryDescription'] . _('because'); $result = DB_query($sql,$db,$ErrMsg); prnMsg(_('A new fixed asset category record has been added for') . ' ' . $_POST['CategoryDescription'],'success'); @@ -129,7 +128,7 @@ $myrow = DB_fetch_row($result); if ($myrow[0]>0) { prnMsg(_('Cannot delete this fixed asset category because fixed assets have been created using this category') . - '<br> ' . _('There are') . ' ' . $myrow[0] . ' ' . _('fixed assets referring to this category code'),'warn'); + '<br /> ' . _('There are') . ' ' . $myrow[0] . ' ' . _('fixed assets referring to this category code'),'warn'); } else { $sql="DELETE FROM fixedassetcategories WHERE categoryid='" . $SelectedCategory . "'"; @@ -147,15 +146,15 @@ or deletion of the records*/ $sql = 'SELECT categoryid, - categorydescription, - costact, - depnact, - disposalact, - accumdepnact - FROM fixedassetcategories'; + categorydescription, + costact, + depnact, + disposalact, + accumdepnact + FROM fixedassetcategories'; $result = DB_query($sql,$db); - echo "<br><table class=selection>\n"; + echo "<br /><table class=selection>\n"; echo '<tr><th>' . _('Cat Code') . '</th> <th>' . _('Description') . '</th> <th>' . _('Cost GL') . '</th> @@ -200,7 +199,7 @@ //end of ifs and buts! if (isset($SelectedCategory)) { - echo "<br><div class='centre'><a href='" . $_SERVER['PHP_SELF'] . '?' . SID . ">" ._('Show All Fixed Asset Categories') . "</a></div>"; + echo "<br /><div class='centre'><a href='" . $_SERVER['PHP_SELF'] . '?' . SID . ">" ._('Show All Fixed Asset Categories') . "</a></div>"; } echo '<form name="CategoryForm" method="post" action="' . $_SERVER['PHP_SELF'] . '?' . SID . '">'; @@ -240,23 +239,23 @@ } //SQL to poulate account selection boxes -$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'; $BSAccountsResult = DB_query($sql,$db); -$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'; $PnLAccountsResult = DB_query($sql,$db); @@ -323,7 +322,7 @@ } //end while loop -echo '</select></td></tr></table><br>'; +echo '</select></td></tr></table><br />'; echo '<div class="centre"><input type="Submit" name="submit" value="' . _('Enter Information') . '"></div>'; Modified: trunk/FixedAssetDepreciation.php =================================================================== --- trunk/FixedAssetDepreciation.php 2011-03-29 13:55:41 UTC (rev 4525) +++ trunk/FixedAssetDepreciation.php 2011-03-30 09:06:33 UTC (rev 4526) @@ -1,8 +1,6 @@ <?php - /* $Id: FixedAssetDepreciation.php 4213 2010-12-22 14:33:20Z tim_schofield $*/ -//$PageSecurity = 10; Now from DB include('includes/session.inc'); $title = _('Depreciation Journal Entry'); @@ -12,12 +10,12 @@ /*Get the last period depreciation (depn is transtype =44) was posted for */ $result = DB_query('SELECT periods.lastdate_in_period, - max(fixedassettrans.periodno) - FROM fixedassettrans INNER JOIN periods - ON fixedassettrans.periodno=periods.periodno - WHERE transtype=44 - GROUP BY periods.lastdate_in_period - ORDER BY periods.lastdate_in_period DESC',$db); + max(fixedassettrans.periodno) + FROM fixedassettrans INNER JOIN periods + ON fixedassettrans.periodno=periods.periodno + WHERE transtype=44 + GROUP BY periods.lastdate_in_period + ORDER BY periods.lastdate_in_period DESC',$db); $LastDepnRun = DB_fetch_row($result); @@ -44,30 +42,30 @@ /* Get list of assets for journal */ $sql="SELECT fixedassets.assetid, - fixedassets.description, - fixedassets.depntype, - fixedassets.depnrate, - fixedassets.datepurchased, - fixedassetcategories.accumdepnact, - fixedassetcategories.depnact, - fixedassetcategories.categorydescription, - SUM(CASE WHEN fixedassettrans.fixedassettranstype='cost' THEN fixedassettrans.amount ELSE 0 END) AS costtotal, - SUM(CASE WHEN fixedassettrans.fixedassettranstype='depn' THEN fixedassettrans.amount ELSE 0 END) AS depnbfwd - FROM fixedassets - INNER JOIN fixedassetcategories - ON fixedassets.assetcategoryid=fixedassetcategories.categoryid - INNER JOIN fixedassettrans - ON fixedassets.assetid=fixedassettrans.assetid - WHERE fixedassettrans.transdate<='" . FormatDateForSQL($_POST['ProcessDate']) . "' - GROUP BY fixedassets.assetid, - fixedassets.description, - fixedassets.depntype, - fixedassets.depnrate, - fixedassets.datepurchased, - fixedassetcategories.accumdepnact, - fixedassetcategories.depnact, - fixedassetcategories.categorydescription - ORDER BY assetcategoryid, assetid"; + fixedassets.description, + fixedassets.depntype, + fixedassets.depnrate, + fixedassets.datepurchased, + fixedassetcategories.accumdepnact, + fixedassetcategories.depnact, + fixedassetcategories.categorydescription, + SUM(CASE WHEN fixedassettrans.fixedassettranstype='cost' THEN fixedassettrans.amount ELSE 0 END) AS costtotal, + SUM(CASE WHEN fixedassettrans.fixedassettranstype='depn' THEN fixedassettrans.amount ELSE 0 END) AS depnbfwd + FROM fixedassets + INNER JOIN fixedassetcategories + ON fixedassets.assetcategoryid=fixedassetcategories.categoryid + INNER JOIN fixedassettrans + ON fixedassets.assetid=fixedassettrans.assetid + WHERE fixedassettrans.transdate<='" . FormatDateForSQL($_POST['ProcessDate']) . "' + GROUP BY fixedassets.assetid, + fixedassets.description, + fixedassets.depntype, + fixedassets.depnrate, + fixedassets.datepurchased, + fixedassetcategories.accumdepnact, + fixedassetcategories.depnact, + fixedassetcategories.categorydescription +ORDER BY assetcategoryid, assetid"; $AssetsResult=DB_query($sql, $db); $InputError = false; //always hope for the best @@ -83,15 +81,15 @@ echo '<p></p><table>'; $Heading = '<tr><th>' . _('Asset ID') . '</th> - <th>' . _('Description') . '</th> - <th>' . _('Date Purchased') . '</th> - <th>' . _('Cost') . '</th> - <th>' . _('Accum Depn') . '</th> - <th>' . _('B/fwd Book Value') . '</th> - <th>'. _('Depn Type') . '</th> - <th>'. _('Depn Rate') . '</th> - <th>' . _('New Depn') . '</th> - </tr>'; + <th>' . _('Description') . '</th> + <th>' . _('Date Purchased') . '</th> + <th>' . _('Cost') . '</th> + <th>' . _('Accum Depn') . '</th> + <th>' . _('B/fwd Book Value') . '</th> + <th>'. _('Depn Type') . '</th> + <th>'. _('Depn Rate') . '</th> + <th>' . _('New Depn') . '</th> + </tr>'; echo $Heading; $AssetCategoryDescription ='0'; @@ -106,12 +104,12 @@ if ($AssetCategoryDescription != $AssetRow['categorydescription'] OR $AssetCategoryDescription =='0'){ if ($AssetCategoryDescription !='0'){ //then print totals echo '<tr><th colspan=3 align="right">' . _('Total for') . ' ' . $AssetCategoryDescription . ' </th> - <th class="number">' . number_format($TotalCategoryCost,2) . '</th> - <th class="number">' . number_format($TotalCategoryAccumDepn,2) . '</th> - <th class="number">' . number_format(($TotalCategoryCost-$TotalCategoryAccumDepn),2) . '</th> - <th colspan=2></th> - <th class="number">' . number_format($TotalCategoryDepn,2) . '</th> - </tr>'; + <th class="number">' . number_format($TotalCategoryCost,2) . '</th> + <th class="number">' . number_format($TotalCategoryAccumDepn,2) . '</th> + <th class="number">' . number_format(($TotalCategoryCost-$TotalCategoryAccumDepn),2) . '</th> + <th colspan=2></th> + <th class="number">' . number_format($TotalCategoryDepn,2) . '</th> + </tr>'; } echo '<tr><th colspan=9 align="left">' . $AssetRow['categorydescription'] . '</th></tr>'; $AssetCategoryDescription = $AssetRow['categorydescription']; @@ -147,15 +145,15 @@ $k++; } echo '<td>' . $AssetRow['assetid'] . '</td> - <td>' . $AssetRow['description'] . '</td> - <td>' . ConvertSQLDate($AssetRow['datepurchased']) . '</td> - <td class="number">' . number_format($AssetRow['costtotal'],2) . '</td> - <td class="number">' . number_format($AssetRow['depnbfwd'],2) . '</td> - <td class="number">' . number_format($AssetRow['costtotal']-$AssetRow['depnbfwd'],2) . '</td> - <td align="center">' . $DepreciationType . '</td> - <td class="number">' . $AssetRow['depnrate'] . '</td> - <td class="number">' . number_format($NewDepreciation ,2) . '</td> - </tr>'; + <td>' . $AssetRow['description'] . '</td> + <td>' . ConvertSQLDate($AssetRow['datepurchased']) . '</td> + <td class="number">' . number_format($AssetRow['costtotal'],2) . '</td> + <td class="number">' . number_format($AssetRow['depnbfwd'],2) . '</td> + <td class="number">' . number_format($AssetRow['costtotal']-$AssetRow['depnbfwd'],2) . '</td> + <td align="center">' . $DepreciationType . '</td> + <td class="number">' . $AssetRow['depnrate'] . '</td> + <td class="number">' . number_format($NewDepreciation ,2) . '</td> + </tr>'; $TotalCategoryCost +=$AssetRow['costtotal']; $TotalCategoryAccumDepn +=$AssetRow['depnbfwd']; $TotalCategoryDepn +=$NewDepreciation; @@ -167,62 +165,62 @@ //debit depreciation expense $SQL = "INSERT INTO gltrans (type, - typeno, - trandate, - periodno, - account, - narrative, - amount) - VALUES (44, - '" . $TransNo . "', - '" . FormatDateForSQL($_POST['ProcessDate']) . "', - '" . $PeriodNo . "', - '" . $AssetRow['depnact'] . "', - '" . $AssetRow['assetid'] . "', - '" . $NewDepreciation ."')"; + typeno, + trandate, + periodno, + account, + narrative, + amount) + VALUES (44, + '" . $TransNo . "', + '" . FormatDateForSQL($_POST['ProcessDate']) . "', + '" . $PeriodNo . "', + '" . $AssetRow['depnact'] . "', + '" . $AssetRow['assetid'] . "', + '" . $NewDepreciation ."')"; $ErrMsg = _('Cannot insert a depreciation GL entry for the depreciation because'); $DbgMsg = _('The SQL that failed to insert the GL Trans record was'); $result = DB_query($SQL,$db,$ErrMsg,$DbgMsg,true); $SQL = "INSERT INTO gltrans (type, - typeno, - trandate, - periodno, - account, - narrative, - amount) - VALUES (44, - '" . $TransNo . "', - '" . FormatDateForSQL($_POST['ProcessDate']) . "', - '" . $PeriodNo . "', - '" . $AssetRow['accumdepnact'] . "', - '" . $AssetRow['assetid'] . "', - '" . -$NewDepreciation ."')"; + typeno, + trandate, + periodno, + account, + narrative, + amount) + VALUES (44, + '" . $TransNo . "', + '" . FormatDateForSQL($_POST['ProcessDate']) . "', + '" . $PeriodNo . "', + '" . $AssetRow['accumdepnact'] . "', + '" . $AssetRow['assetid'] . "', + '" . -$NewDepreciation ."')"; $result = DB_query($SQL,$db,$ErrMsg,$DbgMsg,true); //insert the fixedassettrans record $SQL = "INSERT INTO fixedassettrans (assetid, - transtype, - transno, - transdate, - periodno, - inputdate, - fixedassettranstype, - amount) - VALUES ('" . $AssetRow['assetid'] . "', - '44', - '" . $TransNo . "', - '" . FormatDateForSQL($_POST['ProcessDate']) . "', - '" . $PeriodNo . "', - '" . Date('Y-m-d') . "', - 'depn', - '" . $NewDepreciation . "')"; + transtype, + transno, + transdate, + periodno, + inputdate, + fixedassettranstype, + amount) + VALUES ('" . $AssetRow['assetid'] . "', + '44', + '" . $TransNo . "', + '" . FormatDateForSQL($_POST['ProcessDate']) . "', + '" . $PeriodNo . "', + '" . Date('Y-m-d') . "', + 'depn', + '" . $NewDepreciation . "')"; $ErrMsg = _('Cannot insert a fixed asset transaction entry for the depreciation because'); $DbgMsg = _('The SQL that failed to insert the fixed asset transaction record was'); $result = DB_query($SQL,$db,$ErrMsg,$DbgMsg,true); /*now update the accum depn in fixedassets */ $SQL = "UPDATE fixedassets SET accumdepn = accumdepn + " . $NewDepreciation . " - WHERE assetid = '" . $AssetRow['assetid'] . "'"; + WHERE assetid = '" . $AssetRow['assetid'] . "'"; $ErrMsg = _('CRITICAL ERROR! NOTE DOWN THIS ERROR AND SEEK ASSISTANCE. The fixed asset accumulated depreciation could not be updated:'); $DbgMsg = _('The following SQL was used to attempt the update the accumulated depreciation of the asset was:'); $Result = DB_query($SQL,$db,$ErrMsg, $DbgMsg, true); @@ -249,7 +247,7 @@ $result = DB_Txn_Commit($db); prnMsg(_('Depreciation') . ' ' . $TransNo . ' ' . _('has been successfully entered'),'success'); unset($_POST['ProcessDate']); - echo '<br><a href="index.php' . '?' . SID . '">' ._('Return to main menu').'</a>'; + echo '<br /><a href="index.php' . '?' . SID . '">' ._('Return to main menu').'</a>'; /*And post the journal too */ include ('includes/GLPostings.inc'); } else { @@ -265,7 +263,7 @@ <td>' . $_POST['ProcessDate'] .'</td>'; } echo '<td><div class="centre"><input type="submit" name="CommitDepreciation" value="'._('Commit Depreciation').'"></div>'; - echo '</tr></table><br>'; + echo '</tr></table><br />'; echo '</form>'; } include('includes/footer.inc'); Modified: trunk/FixedAssetItems.php =================================================================== --- trunk/FixedAssetItems.php 2011-03-29 13:55:41 UTC (rev 4525) +++ trunk/FixedAssetItems.php 2011-03-30 09:06:33 UTC (rev 4526) @@ -1,16 +1,13 @@ <?php /* $Id$ */ -/* $Revision: 1.3 $ */ -//$PageSecurity = 11; - include('includes/session.inc'); $title = _('Fixed Assets'); include('includes/header.inc'); include('includes/SQL_CommonFunctions.inc'); -echo '<a href="' . $rootpath . '/SelectAsset.php?' . SID . '">' . _('Back to Select') . '</a><br>' . "\n"; +echo '<a href="' . $rootpath . '/SelectAsset.php">' . _('Back to Select') . '</a><br />' . "\n"; echo '<p class="page_title_text"><img src="'.$rootpath.'/css/'.$theme.'/images/money_add.png" title="' . _('Fixed Asset Items') . '" alt="" />' . ' ' . $title . '</p>'; @@ -132,7 +129,10 @@ $PeriodNo = GetPeriod(Date($_SESSION['DefaultDateFormat']),$db); /* Get the new account codes for the new asset category */ - $result = DB_query("SELECT costact, accumdepnact FROM fixedassetcategories WHERE categoryid='" . $_POST['AssetCategoryID'] . "'",$db); + $result = DB_query("SELECT costact, + accumdepnact + FROM fixedassetcategories + WHERE categoryid='" . $_POST['AssetCategoryID'] . "'",$db); $NewAccounts = DB_fetch_array($result); $TransNo = GetNextTransNo( 42, $db); /* transaction type is asset category change */ @@ -144,75 +144,75 @@ periodno, account, narrative, - amount) "; - $SQL= $SQL . "VALUES (42, - '" . $TransNo . "', - '" . Date('Y-m-d') . "', - '" . $PeriodNo . "', - '" . $OldDetails['costact'] . "', - '" . $AssetID . ' ' . _('change category') . ' ' . $OldDetails['assetcategoryid'] . ' - ' . $_POST['AssetCategoryID'] . "', - '" . -$OldDetails['cost']. "' - )"; + amount) + VALUES ('42', + '" . $TransNo . "', + '" . Date('Y-m-d') . "', + '" . $PeriodNo . "', + '" . $OldDetails['costact'] . "', + '" . $AssetID . ' ' . _('change category') . ' ' . $OldDetails['assetcategoryid'] . ' - ' . $_POST['AssetCategoryID'] . "', + '" . -$OldDetails['cost']. "' + )"; $ErrMsg = _('Cannot insert a GL entry for the change of asset category because'); $DbgMsg = _('The SQL that failed to insert the cost GL Trans record was'); $result = DB_query($SQL,$db,$ErrMsg,$DbgMsg,true); //debit cost for the new category $SQL = "INSERT INTO gltrans (type, - typeno, - trandate, - periodno, - account, - narrative, - amount) "; - $SQL= $SQL . "VALUES (42, - '" . $TransNo . "', - '" . Date('Y-m-d') . "', - '" . $PeriodNo . "', - '" . $NewAccounts['costact'] . "', - '" . $AssetID . ' ' . _('change category') . ' ' . $OldDetails['assetcategoryid'] . ' - ' . $_POST['AssetCategoryID'] . "', - '" . $OldDetails['cost']. "' - )"; + typeno, + trandate, + periodno, + account, + narrative, + amount) + VALUES ('42', + '" . $TransNo . "', + '" . Date('Y-m-d') . "', + '" . $PeriodNo . "', + '" . $NewAccounts['costact'] . "', + '" . $AssetID . ' ' . _('change category') . ' ' . $OldDetails['assetcategoryid'] . ' - ' . $_POST['AssetCategoryID'] . "', + '" . $OldDetails['cost']. "' + )"; $ErrMsg = _('Cannot insert a GL entry for the change of asset category because'); $DbgMsg = _('The SQL that failed to insert the cost GL Trans record was'); $result = DB_query($SQL,$db,$ErrMsg,$DbgMsg,true); if ($OldDetails['accumdepn']!=0) { //debit accumdepn for the old category $SQL = "INSERT INTO gltrans (type, - typeno, - trandate, - periodno, - account, - narrative, - amount) "; - $SQL= $SQL . "VALUES (42, - '" . $TransNo . "', - '" . Date('Y-m-d') . "', - '" . $PeriodNo . "', - '" . $OldDetails['accumdepnact'] . "', - '" . $AssetID . ' ' . _('change category') . ' ' . $OldDetails['assetcategoryid'] . ' - ' . $_POST['AssetCategoryID'] . "', - '" . $OldDetails['accumdepn']. "' - )"; + typeno, + trandate, + periodno, + account, + narrative, + amount) + VALUES ('42', + '" . $TransNo . "', + '" . Date('Y-m-d') . "', + '" . $PeriodNo . "', + '" . $OldDetails['accumdepnact'] . "', + '" . $AssetID . ' ' . _('change category') . ' ' . $OldDetails['assetcategoryid'] . ' - ' . $_POST['AssetCategoryID'] . "', + '" . $OldDetails['accumdepn']. "' + )"; $ErrMsg = _('Cannot insert a GL entry for the change of asset category because'); $DbgMsg = _('The SQL that failed to insert the cost GL Trans record was'); $result = DB_query($SQL,$db,$ErrMsg,$DbgMsg,true); //credit accum depn for the new category $SQL = "INSERT INTO gltrans (type, - typeno, - trandate, - periodno, - account, - narrative, - amount) "; - $SQL= $SQL . "VALUES (42, - '" . $TransNo . "', - '" . Date('Y-m-d') . "', - '" . $PeriodNo . "', - '" . $NewAccounts['accumdepnact'] . "', - '" . $AssetID . ' ' . _('change category') . ' ' . $OldDetails['assetcategoryid'] . ' - ' . $_POST['AssetCategoryID'] . "', - '" . $OldDetails['accumdepn']. "' - )"; + typeno, + trandate, + periodno, + account, + narrative, + amount) + VALUES ('42', + '" . $TransNo . "', + '" . Date('Y-m-d') . "', + '" . $PeriodNo . "', + '" . $NewAccounts['accumdepnact'] . "', + '" . $AssetID . ' ' . _('change category') . ' ' . $OldDetails['assetcategoryid'] . ' - ' . $_POST['AssetCategoryID'] . "', + '" . $OldDetails['accumdepn']. "' + )"; $ErrMsg = _('Cannot insert a GL entry for the change of asset category because'); $DbgMsg = _('The SQL that failed to insert the cost GL Trans record was'); $result = DB_query($SQL,$db,$ErrMsg,$DbgMsg,true); @@ -234,25 +234,25 @@ $result = DB_query($sql,$db,$ErrMsg,$DbgMsg); prnMsg( _('Asset') . ' ' . $AssetID . ' ' . _('has been updated'), 'success'); - echo '<br>'; + echo '<br />'; } else { //it is a NEW part $sql = "INSERT INTO fixedassets (description, - longdescription, - assetcategoryid, - assetlocation, - depntype, - depnrate, - barcode, - serialno) - VALUES ( - '" . $_POST['Description'] . "', - '" . $_POST['LongDescription'] . "', - '" . $_POST['AssetCategoryID'] . "', - '" . $_POST['AssetLocation'] . "', - '" . $_POST['DepnType'] . "', - '" . $_POST['DepnRate']. "', - '" . $_POST['BarCode'] . "', - '" . $_POST['SerialNo'] . "' )"; + longdescription, + assetcategoryid, + assetlocation, + depntype, + depnrate, + barcode, + serialno) + VALUES ( + '" . $_POST['Description'] . "', + '" . $_POST['LongDescription'] . "', + '" . $_POST['AssetCategoryID'] . "', + '" . $_POST['AssetLocation'] . "', + '" . $_POST['DepnType'] . "', + '" . $_POST['DepnRate']. "', + '" . $_POST['BarCode'] . "', + '" . $_POST['SerialNo'] . "' )"; $ErrMsg = _('The asset could not be added because'); $DbgMsg = _('The SQL that was used to add the asset failed was'); $result = DB_query($sql,$db, $ErrMsg, $DbgMsg); @@ -272,7 +272,7 @@ $result = DB_Txn_Commit($db); } } else { - echo '<br>'. "\n"; + echo '<br />'. "\n"; prnMsg( _('Validation failed, no updates or deletes took place'), 'error'); } @@ -282,12 +282,12 @@ $CancelDelete = 0; //what validation is required before allowing deletion of assets .... maybe there should be no deletion option? $result = DB_query("SELECT cost, - accumdepn, - accumdepnact, - costact - FROM fixedassets INNER JOIN fixedassetcategories - ON fixedassets.assetcategoryid=fixedassetcategories.categoryid - WHERE assetid='" . $AssetID . "'", $db); + accumdepn, + accumdepnact, + costact + FROM fixedassets INNER JOIN fixedassetcategories + ON fixedassets.assetcategoryid=fixedassetcategories.categoryid + WHERE assetid='" . $AssetID . "'", $db); $AssetRow = DB_fetch_array($result); $NBV = $AssetRow['cost'] -$AssetRow['accumdepn']; if ($NBV!=0) { @@ -313,40 +313,40 @@ if ($AssetRow['cost'] > 0){ //credit cost for the asset deleted $SQL = "INSERT INTO gltrans (type, - typeno, - trandate, - periodno, - account, - narrative, - amount) "; - $SQL= $SQL . "VALUES (43, - '" . $TransNo . "', - '" . Date('Y-m-d') . "', - '" . $PeriodNo . "', - '" . $AssetRow['costact'] . "', - '" . _('Delete asset') . ' ' . $AssetID . "', - '" . -$AssetRow['cost']. "' - )"; + typeno, + trandate, + periodno, + account, + narrative, + amount) + VALUES ('43', + '" . $TransNo . "', + '" . Date('Y-m-d') . "', + '" . $PeriodNo . "', + '" . $AssetRow['costact'] . "', + '" . _('Delete asset') . ' ' . $AssetID . "', + '" . -$AssetRow['cost']. "' + )"; $ErrMsg = _('Cannot insert a GL entry for the deletion of the asset because'); $DbgMsg = _('The SQL that failed to insert the cost GL Trans record was'); $result = DB_query($SQL,$db,$ErrMsg,$DbgMsg,true); //debit accumdepn for the depreciation removed on deletion of this asset $SQL = "INSERT INTO gltrans (type, - typeno, - trandate, - periodno, - account, - narrative, - amount) "; - $SQL= $SQL . "VALUES (43, - '" . $TransNo . "', - '" . Date('Y-m-d') . "', - '" . $PeriodNo . "', - '" . $AssetRow['accumdepnact'] . "', - '" . _('Delete asset') . ' ' . $AssetID . "', - '" . $Asset['accumdepn']. "' - )"; + typeno, + trandate, + periodno, + account, + narrative, + amount) + VALUES ('43', + '" . $TransNo . "', + '" . Date('Y-m-d') . "', + '" . $PeriodNo . "', + '" . $AssetRow['accumdepnact'] . "', + '" . _('Delete asset') . ' ' . $AssetID . "', + '" . $Asset['accumdepn']. "' + )"; $ErrMsg = _('Cannot insert a GL entry for the reversal of accumulated depreciation on deletion of the asset because'); $DbgMsg = _('The SQL that failed to insert the cost GL Trans record was'); $result = DB_query($SQL,$db,$ErrMsg,$DbgMsg,true); @@ -467,7 +467,7 @@ } if ($AssetImgLink!=_('No Image')) { - echo '<td>' . _('Image') . '<br>'.$AssetImgLink . '</td></tr>'; + echo '<td>' . _('Image') . '<br />'.$AssetImgLink . '</td></tr>'; } else { echo '</td></tr>'; } @@ -484,13 +484,13 @@ while ($myrow=DB_fetch_array($result)){ if (!isset($_POST['AssetCategoryID']) or $myrow['categoryid']==$_POST['AssetCategoryID']){ - 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>'; } $category=$myrow['categoryid']; } -echo '</select><a target="_blank" href="'. $rootpath . '/FixedAssetCategories.php?' . SID . '">'.' ' . _('Add or Modify Asset Categories') . '</a></td></tr>'; +echo '</select><a target="_blank" href="'. $rootpath . '/FixedAssetCategories.php">'.' ' . _('Add or Modify Asset Categories') . '</a></td></tr>'; if (!isset($_POST['AssetCategoryID'])) { $_POST['AssetCategoryID']=$category; } @@ -545,12 +545,12 @@ echo '<tr><td>' . _('Net Book Value') . ':</td><td class="number">' . number_format($AssetRow['cost']-$AssetRow['accumdepn'],2) . '</td></tr>'; $result = DB_query('SELECT periods.lastdate_in_period, - max(fixedassettrans.periodno) - FROM fixedassettrans INNER JOIN periods - ON fixedassettrans.periodno=periods.periodno - WHERE transtype=44 - GROUP BY periods.lastdate_in_period - ORDER BY periods.lastdate_in_period DESC',$db); + max(fixedassettrans.periodno) + FROM fixedassettrans INNER JOIN periods + ON fixedassettrans.periodno=periods.periodno + WHERE transtype=44 + GROUP BY periods.lastdate_in_period + ORDER BY periods.lastdate_in_period DESC',$db); $LastDepnRun = DB_fetch_row($result); if(DB_num_rows($result)==0){ @@ -563,13 +563,13 @@ if (isset($New)) { - echo '<div class=centre><br><input type="Submit" name="submit" value="' . _('Insert New Fixed Asset') . '">'; + echo '<div class=centre><br /><input type="Submit" name="submit" value="' . _('Insert New Fixed Asset') . '">'; } else { - echo '<br><div class=centre><input type="submit" name="submit" value="' . _('Update') . '"></div>'; + echo '<br /><div class=centre><input type="submit" name="submit" value="' . _('Update') . '"></div>'; prnMsg( _('Only click the Delete button if you are sure you wish to delete the asset. Only assets with a zero book value can be deleted'), 'warn', _('WARNING')); - echo '<br><div class=centre><input type="Submit" name="delete" value="' . _('Delete This Asset') . '" onclick="return confirm(\'' . _('Are You Sure? Only assets with a zero book value can be deleted.') . '\');"></div>'; + echo '<br /><div class=centre><input type="Submit" name="delete" value="' . _('Delete This Asset') . '" onclick="return confirm(\'' . _('Are You Sure? Only assets with a zero book value can be deleted.') . '\');"></div>'; } echo '</form></div>'; Modified: trunk/GLAccountCSV.php =================================================================== --- trunk/GLAccountCSV.php 2011-03-29 13:55:41 UTC (rev 4525) +++ trunk/GLAccountCSV.php 2011-03-30 09:06:33 UTC (rev 4526) @@ -1,9 +1,8 @@ <?php -/* $Id: $*/ -/* $Revision: 1.00 $ */ -//$PageSecurity = 8; +/* $Id: GLAccountCSV.php 4492 2011-02-18 09:56:52Z daintree $ */ + include ('includes/session.inc'); $title = _('General Ledger Account Report'); include('includes/header.inc'); @@ -19,7 +18,7 @@ echo '<div class="page_help_text">' . _('Use the keyboard Shift key to select multiple accounts and periods') . '</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'] . '" />'; /*Dates in SQL format for the last day of last month*/ @@ -35,10 +34,10 @@ $i=0; while ($myrow=DB_fetch_array($AccountsResult,$db)){ if(isset($_POST['Account'][$i]) AND $myrow['accountcode'] == $_POST['Account'][$i]){ - echo '<option selected VALUE=' . $myrow['accountcode'] . '>' . $myrow['accountcode'] . ' ' . $myrow['accountname']; + echo '<option selected VALUE=' . $myrow['accountcode'] . '>' . $myrow['accountcode'] . ' ' . $myrow['accountname'] . '</option>'; $i++; } else { - echo '<option VALUE=' . $myrow['accountcode'] . '>' . $myrow['accountcode'] . ' ' . $myrow['accountname']; + echo '<option VALUE=' . $myrow['accountcode'] . '>' . $myrow['accountcode'] . ' ' . $myrow['accountname'] . '</option>'; } } echo '</select></td>'; @@ -51,10 +50,10 @@ while ($myrow=DB_fetch_array($Periods,$db)){ if (isset($SelectedPeriod[$id]) and $myrow['periodno'] == $SelectedPeriod[$id]){ - echo '<option selected VALUE=' . $myrow['periodno'] . '>' . _(MonthAndYearFromSQLDate($myrow['lastdate_in_period'])); + echo '<option selected VALUE=' . $myrow['periodno'] . '>' . _(MonthAndYearFromSQLDate($myrow['lastdate_in_period'])) . '</option>'; $id++; } else { - 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>'; @@ -71,9 +70,9 @@ echo '<option value=0>0 - '._('All tags'); while ($myrow=DB_fetch_array($result)){ if (isset($_POST['tag']) and $_POST['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></tr>'; @@ -95,7 +94,6 @@ prnMsg(_('An account or range of accounts must be selected from the list box'),'info'); include('includes/footer.inc'); exit; - } if (!file_exists($_SESSION['reports_dir'])){ @@ -115,10 +113,10 @@ foreach ($_POST['Account'] as $SelectedAccount){ /*Is the account a balance sheet or a profit and loss account */ $result = DB_query("SELECT chartmaster.accountname, - accountgroups.pandl - FROM accountgroups - INNER JOIN chartmaster ON accountgroups.groupname=chartmaster.group_ - WHERE chartmaster.accountcode=$SelectedAccount",$db); + accountgroups.pandl + FROM accountgroups + INNER JOIN chartmaster ON accountgroups.groupname=chartmaster.group_ + WHERE chartmaster.accountcode=$SelectedAccount",$db); $AccountDetailRow = DB_fetch_row($result); $AccountName = $AccountDetailRow[1]; if ($AccountDetailRow[1]==1){ @@ -140,11 +138,11 @@ gltrans.periodno, gltrans.tag FROM gltrans, systypes - WHERE gltrans.account = $SelectedAccount + WHERE gltrans.account = '$SelectedAccount' AND systypes.typeid=gltrans.type AND posted=1 - AND periodno>=$FirstPeriodSelected - AND periodno<=$LastPeriodSelected + AND periodno>='$FirstPeriodSelected' + AND periodno<='$LastPeriodSelected' ORDER BY periodno, gltrans.trandate, counterindex"; } else { @@ -157,11 +155,11 @@ gltrans.periodno, gltrans.tag FROM gltrans, systypes - WHERE gltrans.account = $SelectedAccount + WHERE gltrans.account = '$SelectedAccount' AND systypes.typeid=gltrans.type AND posted=1 - AND periodno>=$FirstPeriodSelected - AND periodno<=$LastPeriodSelected + AND periodno>='$FirstPeriodSelected' + AND periodno<='$LastPeriodSelected' AND tag='".$_POST['tag']."' ORDER BY periodno, gltrans.trandate, counterindex"; } @@ -177,8 +175,8 @@ actual, period FROM chartdetails - WHERE chartdetails.accountcode= $SelectedAccount - AND chartdetails.period=" . $FirstPeriodSelected; + WHERE chartdetails.accountcode= '$SelectedAccount' + AND chartdetails.period='" . $FirstPeriodSelected . "'"; $ErrMsg = _('The chart details for account') . ' ' . $SelectedAccount . ' ' . _('could not be retrieved'); $ChartDetailsResult = DB_query($sql,$db,$ErrMsg); @@ -206,8 +204,8 @@ actual, period FROM chartdetails - WHERE chartdetails.accountcode= $SelectedAccount - AND chartdetails.period=" . $PeriodNo; + WHERE chartdetails.accountcode= '$SelectedAccount' + AND chartdetails.period='" . $PeriodNo . "'"; $ErrMsg = _('The chart details for account') . ' ' . $SelectedAccount . ' ' . _('could not be retrieved'); $ChartDetailsResult = DB_query($sql,$db,$ErrMsg); @@ -225,7 +223,6 @@ $RunningTotal += $myrow['amount']; $PeriodTotal += $myrow['amount']; - $FormatedTranDate = ConvertSQLDate($myrow['trandate']); $tagsql="SELECT tagdescription FROM tags WHERE tagref='".$myrow['tag'] . "'"; @@ -264,4 +261,4 @@ } /* end of if CreateCSV button hit */ include('includes/footer.inc'); -?> +?> \ No newline at end of file Modified: trunk/GLBudgets.php =================================================================== --- trunk/GLBudgets.php 2011-03-29 13:55:41 UTC (rev 4525) +++ trunk/GLBudgets.php 2011-03-30 09:06:33 UTC (rev 4526) @@ -1,7 +1,5 @@ <?php - /* $Id$*/ -//$PageSecurity = 10; include('includes/session.inc'); include('includes/SQL_CommonFunctions.inc'); @@ -23,12 +21,12 @@ } if (isset($_POST['update'])) { - prnMsg('Budget updated successfully', 'success'); + prnMsg(_('Budget updated successfully'), 'success'); } //If an account hasn't been selected then select one here. echo '<p class="page_title_text"><img src="'.$rootpath.'/css/'.$theme.'/images/maintenance.png" title="' . _('Search') . '" alt="" />' . ' ' . $title.'</p>'; -echo '<form action=' . $_SERVER['PHP_SELF'] . '?' . SID . ' method=post name="selectaccount">'; +echo '<form action="' . $_SERVER['PHP_SELF'] . '" method="post" name="selectaccount">'; echo '<input type="hidden" name="FormID" value="' . $_SESSION['FormID'] . '" />'; echo '<table>'; @@ -36,9 +34,9 @@ onChange='ReloadForm(selectaccount.Select)'>"; $SQL = 'SELECT accountcode, - accountname - FROM chartmaster - ORDER BY accountcode'; + accountname + FROM chartmaster + ORDER BY accountcode'; $result=DB_query($SQL,$db); if (DB_num_rows($result)==0){ @@ -48,10 +46,10 @@ while ($myrow=DB_fetch_array($result)){ $account = $myrow['accountcode'] . ' - ' . $myrow['accountname']; if (isset($SelectedAccount) and isset($LastCode) and $SelectedAccount==$myrow['accountcode']){ - echo '<option selected value=' . $myrow['accountcode'] . '>' . $account; + echo '<option selected value=' . $myrow['accountcode'] . '>' . $account . '</option>'; $PrevCode=$LastCode; } else { - echo '<option value=' . $myrow['accountcode'] . '>' . $account; + echo '<option value=' . $myrow['accountcode'] . '>' . $account . '</option>'; if (isset($SelectedAccount) and isset($LastCode) and $SelectedAccount == $LastCode) { $NextCode=$myrow['accountcode']; } @@ -148,7 +146,7 @@ // Table Headers - echo '<form name="form" action=' . $_SERVER['PHP_SELF'] . '?' . SID . ' method=post>'; + echo '<form name="form" action="' . $_SERVER['PHP_SELF'] . '" method=post>'; echo '<input type="hidden" name="FormID" value="' . $_SESSION['FormID'] . '" />'; echo '<br /><table class=selection>'; echo '<tr><th colspan=3>'. _('Last Financial Year') .'</th>'; @@ -156,7 +154,7 @@ echo '<th colspan=3>'. _('Next Financial Year') .'</th></tr>'; echo '<tr><th colspan=3>'. _('Year ended').' - '. - Date($_SESSION['DefaultDateFormat'],YearEndDate($_SESSION['YearEnd'], -1)) .'</th>'; + Date($_SESSION['DefaultDateFormat'],YearEndDate($_SESSION['YearEnd'],-1)) .'</th>'; echo '<th colspan=3>'. _('Year ended').' - '. Date($_SESSION['DefaultDateFormat'],YearEndDate($_SESSION['YearEnd'],0)) .'</th>'; echo '<th colspan=3>'. _('Year ended').' - '. @@ -170,7 +168,6 @@ } echo '</tr>'; - // Main Table for ($i=1; $i<=12; $i++) { Modified: trunk/GLCodesInquiry.php =================================================================== --- trunk/GLCodesInquiry.php 2011-03-29 13:55:41 UTC (rev 4525) +++ trunk/GLCodesInquiry.php 2011-03-30 09:06:33 UTC (rev 4526) @@ -1,9 +1,7 @@ <?php /* $Id$*/ -/* $Revision: 1.9 $ */ -//$PageSecurity = 8; include ('includes/session.inc'); $title = _('GL Codes Inquiry'); @@ -13,20 +11,20 @@ $SQL = 'SELECT group_, accountcode , accountname - FROM chartmaster INNER JOIN accountgroups ON chartmaster.group_ = accountgroups.groupname - ORDER BY sequenceintb, - accountcode'; + FROM chartmaster INNER JOIN accountgroups ON chartmaster.group_ = accountgroups.groupname + ORDER BY sequenceintb, + accountcode'; $ErrMsg = _('No general ledger accounts were returned by the SQL because'); $AccountsResult = DB_query($SQL,$db,$ErrMsg); /*show a table of the orders returned by the SQL */ -echo "<table cellpadding=2 colspan=2> +echo '<table cellpadding=2 colspan=2> <tr> - <th>"._('Group')."</font></th> - <th>"._('Code')."</font></th> - <th>"._('Account Name').'</font></th> + <th>' . _('Group') . '</font></th> + <th>' . _('Code') . '</font></th> + <th>' . _('Account Name') . '</font></th> </tr>'; $j = 1; @@ -63,7 +61,5 @@ //end of while loop echo '</table>'; - include('includes/footer.inc'); - -?> +?> \ No newline at end of file Modified: trunk/GLJournal.php =================================================================== --- trunk/GLJournal.php 2011-03-29 13:55:41 UTC (rev 4525) +++ trunk/GLJournal.php 2011-03-30 09:06:33 UTC (rev 4526) @@ -1,11 +1,9 @@ <?php /* $Id$*/ -/* $Revision: 1.27 $ */ include('includes/DefineJournalClass.php'); -//$PageSecurity = 10; include('includes/session.inc'); $title = _('Journal Entry'); @@ -24,7 +22,7 @@ Journals cannot be entered against bank accounts GL postings involving bank accounts must be done using a receipt or a payment transaction to ensure a bank trans is available for matching off vs statements */ - $SQL = "SELECT accountcode FROM bankaccounts"; + $SQL = 'SELECT accountcode FROM bankaccounts'; $result = DB_query($SQL,$db); $i=0; while ($Act = DB_fetch_row($result)){ @@ -68,8 +66,8 @@ account, narrative, amount, - tag) "; - $SQL= $SQL . "VALUES (0, + tag) + VALUES ('0', '" . $TransNo . "', '" . FormatDateForSQL($_SESSION['JournalDetail']->JnlDate) . "', '" . $PeriodNo . "', @@ -90,8 +88,8 @@ account, narrative, amount, - tag) "; - $SQL= $SQL . "VALUES (0, + tag) + VALUES ('0', '" . $TransNo . "', '" . FormatDateForSQL($_SESSION['JournalDetail']->JnlDate) . "', '" . ($PeriodNo + 1) . "', @@ -104,7 +102,6 @@ $ErrMsg =_('Cannot insert a GL entry for the reversing journal because'); $DbgMsg = _('The SQL that failed to insert the GL Trans record was'); $result = DB_query($SQL,$db,$ErrMsg,$DbgMsg,true); - } } @@ -120,7 +117,7 @@ unset($_SESSION['JournalDetail']); /*Set up a newy in case user wishes to enter another */ - echo "<br /><a href='" . $_SERVER['PHP_SELF'] . '?' . SID . "&NewJournal=Yes'>"._('Enter Another General Ledger Journal').'</a>'; + echo '<br /><a href="' . $_SERVER['PHP_SELF'] . '?NewJournal=Yes">'._('Enter Another General Ledger Journal').'</a>'; /*And post the journal too */ include ('includes/GLPostings.inc'); include ('includes/footer.inc'); @@ -132,21 +129,17 @@ $_SESSION['JournalDetail']->Remove_GLEntry($_GET['Delete']); } elseif (isset($_POST['Process']) and $_POST['Process']==_('Accept')){ //user hit submit a new GL Analysis line into the journal - if($_POST['GLCode']!='') - { + if ($_POST['GLCode']!='') { $extract = explode(' - ',$_POST['GLCode']); $_POST['GLCode'] = $extract[0]; } - if($_POST['Debit']>0) - { + if ($_POST['Debit']>0) { $_POST['GLAmount'] = $_POST['Debit']; - } - elseif($_POST['Credit']>0) - { + } elseif ($_POST['Credit']>0) { $_POST['GLAmount'] = '-' . $_POST['Credit']; } if ($_POST['GLManualCode'] != '' AND is_numeric($_POST['GLManualCode'])){ - // If a manual code was entered need to check it exists and isnt a bank account + // If a manual code was entered need to check it exists and isnt a bank account $AllowThisPosting = true; //by default if ($_SESSION['ProhibitJournalsToControlAccounts'] == 1){ if ($_SESSION['CompanyRecord']['gllink_debtors'] == '1' AND $_POST['GLManualCode'] == $_SESSION['CompanyRecord']['debtorsact']){ @@ -228,18 +221,10 @@ unset($_POST['GLManualCode']); } -// set up the form whatever -/* -if (!isset($_SESSION['JournalDetail']->JnlDate)){ - $_POST['JournalProcessDate']= Date($_SESSION['DefaultDateFormat']); - $_SESSION['JournalDetail']->JnlDate = $_POST['JournalProcessDate']; -} -*/ -echo '<form action="' . $_SERVER['PHP_SELF'] . '?' . SID . '" method="post" name="form">'; +echo '<form action="' . $_SERVER['PHP_SELF'] . '" method="post" name="form">'; echo '<input type="hidden" name="FormID" value="' . $_SESSION['FormID'] . '" />'; - echo '<p class="page_title_text"><img src="'.$rootpath.'/css/'.$theme.'/images/maintenance.png" title="' . _('Search') . '" alt="" />' . ' ' . $title.'</p>'; // A new table in the first column of the main table @@ -287,8 +272,8 @@ $SQL = 'SELECT tagref, tagdescription - FROM tags - ORDER BY tagref'; + FROM tags + ORDER BY tagref'; $result=DB_query($SQL,$db); echo '<option value="0">0 - None</option>'; @@ -309,10 +294,10 @@ "'".'The account code '."'".'+ this.value+ '."'".' doesnt exist'."'".')"' . ' value="'. $_POST['GLManualCode'] .'" /></td>'; -$sql="SELECT accountcode, +$sql='SELECT accountcode, accountname FROM chartmaster - ORDER BY accountcode"; + ORDER BY accountcode'; $result=DB_query($sql, $db); echo '<td><select name="GLCode" onChange="return assignComboToInput(this,'.'GLManualCode'.')">'; @@ -336,15 +321,14 @@ $_POST['Debit'] = ''; } - echo '</tr><tr><th>' . _('Debit') . '</th>'.'<td><input type="text" class="number" Name = "Debit" ' . 'onChange="eitherOr(this, '.'Credit'.')"'. ' Maxlength="12" size="10" value="' . $_POST['Debit'] . '" /></td>'; -echo '</tr><tr><th>' . _('Credit') . "</th>".'<td><input type="text" class="number" Name = "Credit" ' . +echo '</tr><tr><th>' . _('Credit') . '</th><td><input type="text" class="number" Name = "Credit" ' . 'onChange="eitherOr(this, '.'Debit'.')"'. ' Maxlength="12" size="10" value="' . $_POST['Credit'] . '" /></td>'; echo '</tr><tr><td></td><td></td><th>'. _('Narrative'). '</th>'; -echo '</tr><tr><th></th><th>' . _('GL Narrative') . "</th>"; +echo '</tr><tr><th></th><th>' . _('GL Narrative') . '</th>'; echo '<td><input type="text" name="GLNarrative" maxlength="100" size="100" value="' . $_POST['GLNarrative'] . '" /></td>'; @@ -398,22 +382,22 @@ } echo '<td>' . $JournalItem->Narrative . "</td> - <td><a href='" . $_SERVER['PHP_SELF'] . '?' . SID . '&Delete=' . $JournalItem->ID . "'>"._('Delete').'</a></td> + <td><a href='" . $_SERVER['PHP_SELF'] . '?Delete=' . $JournalItem->ID . "'>"._('Delete').'</a></td> </tr>'; } echo '<tr class="EvenTableRows"><td></td> - <td class="number"><b> Total </b></td> + <td class="number"><b>' . _('Total') . '</b></td> <td class="number"><b>' . number_format($debittotal,2) . '</b></td> <td class="number"><b>' . number_format($credittotal,2) . '</b></td></tr>'; if ($debittotal!=$credittotal) { - echo '<td align="center" style="background-color: #fddbdb"><b>Required to balance - </b>' . + echo '<td align="center" style="background-color: #fddbdb"><b>' . _('Required to balance') .' - </b>' . number_format(abs($debittotal-$credittotal),2); } if ($debittotal>$credittotal) { - echo ' Credit</td></tr>'; + echo ' ' . _('Credit') . '</td></tr>'; } else if ($debittotal<$credittotal) { - echo ' Debit</td></tr>'; + echo ' ' . _('Debit') . '</td></tr>'; } echo '</table>'; Modified: trunk/PDFGrn.php =================================================================== --- trunk/PDFGrn.php 2011-03-29 13:55:41 UTC (rev 4525) +++ trunk/PDFGrn.php 2011-03-30 09:06:33 UTC (rev 4526) @@ -2,7 +2,6 @@ /* $Id$*/ -//$PageSecurity = 2; Now comes from DB - read in from session include('includes/session.inc'); if (isset($_GET['GRNNo'])) { Modified: trunk/doc/Change.log.html =================================================================== --- trunk/doc/Change.log.html 2011-03-29 13:55:41 UTC (rev 4525) +++ trunk/doc/Change.log.html 2011-03-30 09:06:33 UTC (rev 4526) @@ -1,5 +1,8 @@ <p><font SIZE=4 COLOR=BLUE><b>webERP Change Log</b></font></p> -<p> +<p /> +<p>30/3/11 Tim - New ReprintGRN.php script takes a purchase order and allows any line received to have GRN(s) reprinted</p> +<p>29/3/11 Phil - checking for unquoted SQL and for SQL where literals quoted with double quotes rather than single - double quotes are not ANSI compatible - so making the SQL more ANSI compatible by doing this as suggested by Tim. Many many scripts involved will take a week or so</p> +<p /> <p>27/3/11 - Version 4.03.5 Release <p> <p>27/3/11: Phil fixed SQL upgrade script to add the Z_ChangeSupplierCode.php script is added to the scripts table</p> Modified: trunk/includes/ConnectDB.inc =================================================================== --- trunk/includes/ConnectDB.inc 2011-03-29 13:55:41 UTC (rev 4525) +++ trunk/includes/ConnectDB.inc 2011-03-30 09:06:33 UTC (rev 4526) @@ -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.5'; //must update manually every time there is a DB change +$Version='4.03.6'; //must update manually every time there is a DB change require_once ($PathPrefix .'includes/MiscFunctions.php'); Modified: trunk/index.php =================================================================== --- trunk/index.php 2011-03-29 13:55:41 UTC (rev 4525) +++ trunk/index.php 2011-03-30 09:06:33 UTC (rev 4526) @@ -605,17 +605,17 @@ <table width="100%" class="table_index"> <tr> <td class="menu_group_item"> - <?php echo '<p>• <a href="' . $rootpath . "/StockSerialItemResearch.php?" . SID . '">' . _('Serial Item Research Tool') . '</a></p>'; ?> + <?php echo '<p>• <a href="' . $rootpath . '/StockSerialItemResearch.php">' . _('Serial Item Research Tool') . '</a></p>'; ?> </td> </tr> <tr> <td class="menu_group_item"> - <?php echo '<p>• <a href="' . $rootpath . "/PDFPrintLabel.php?" . SID . '">' . _('Print Price Labels') . '</a></p>'; ?> + <?php echo '<p>• <a href="' . $rootpath . '/PDFPrintLabel.php">' . _('Print Price Labels') . '</a></p>'; ?> </td> </tr> <tr> <td class="menu_group_item"> - <?php echo '<p>• <a href="' . $rootpath . "/StockMovements.php?" . SID . '">' . _('Inventory Item Movements') . '</a></p>'; ?> + <?php echo '<p>• <a href="' . $rootpath . '/StockMovements.php">' . _('Inventory Item Movements') . '</a></p>'; ?> </td> </tr> <tr> @@ -705,6 +705,11 @@ </tr> <tr> <td class="menu_group_item"> + <?php echo '<p>• <a href="' . $rootpath . '/ReprintGRN.php">' . _('Reprint GRN') . '</a></p>'; ?> + </td> + </tr> + <tr> + <td class="menu_group_item"> <?php echo GetRptLinks('inv'); ?> </td> </tr> Modified: trunk/sql/mysql/upgrade3.11.1-4.00.sql =================================================================== --- trunk/sql/mysql/upgrade3.11.1-4.00.sql 2011-03-29 13:55:41 UTC (rev 4525) +++ trunk/sql/mysql/upgrade3.11.1-4.00.sql 2011-03-30 09:06:33 UTC (rev 4526) @@ -835,4 +835,6 @@ ALTER TABLE `locations` CHANGE `cashsalecustomer` `cashsalecustomer` VARCHAR( 10 ) DEFAULT ''; UPDATE config SET confvalue='4.03.3' WHERE confname='VersionNumber'; INSERT INTO `scripts` (`script`, `pagesecurity`, `description`) VALUES ('Z_ChangeSupplierCode.php', '15', 'Script to change a supplier code accross all tables necessary'); -UPDATE config SET confvalue='4.03.5' WHERE confname='VersionNumber'; \ No newline at end of file +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'; This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <dai...@us...> - 2011-03-31 08:32:34
|
Revision: 4527 http://web-erp.svn.sourceforge.net/web-erp/?rev=4527&view=rev Author: daintree Date: 2011-03-31 08:32:24 +0000 (Thu, 31 Mar 2011) Log Message: ----------- updated languages Modified Paths: -------------- trunk/GLProfit_Loss.php trunk/GLTagProfit_Loss.php trunk/build/make_release.sh trunk/doc/Change.log.html trunk/includes/session.inc trunk/locale/cs_CZ.utf8/LC_MESSAGES/messages.mo trunk/locale/cs_CZ.utf8/LC_MESSAGES/messages.po trunk/locale/de_DE.utf8/LC_MESSAGES/messages.mo trunk/locale/de_DE.utf8/LC_MESSAGES/messages.po trunk/locale/el_GR.utf8/LC_MESSAGES/messages.mo trunk/locale/el_GR.utf8/LC_MESSAGES/messages.po trunk/locale/en_GB.utf8/LC_MESSAGES/messages.pot trunk/locale/en_US.utf8/LC_MESSAGES/messages.mo trunk/locale/en_US.utf8/LC_MESSAGES/messages.po trunk/locale/es_ES.utf8/LC_MESSAGES/messages.mo trunk/locale/es_ES.utf8/LC_MESSAGES/messages.po trunk/locale/et_EE.utf8/LC_MESSAGES/messages.mo trunk/locale/et_EE.utf8/LC_MESSAGES/messages.po trunk/locale/fa_IR.utf8/LC_MESSAGES/messages.mo trunk/locale/fa_IR.utf8/LC_MESSAGES/messages.po trunk/locale/fr_FR.utf8/LC_MESSAGES/messages.mo trunk/locale/fr_FR.utf8/LC_MESSAGES/messages.po trunk/locale/hi_IN.utf8/LC_MESSAGES/messages.mo trunk/locale/hi_IN.utf8/LC_MESSAGES/messages.po trunk/locale/hr_HR.utf8/LC_MESSAGES/messages.mo trunk/locale/hr_HR.utf8/LC_MESSAGES/messages.po trunk/locale/hu_HU.utf8/LC_MESSAGES/messages.mo trunk/locale/hu_HU.utf8/LC_MESSAGES/messages.po trunk/locale/id_ID.utf8/LC_MESSAGES/messages.mo trunk/locale/id_ID.utf8/LC_MESSAGES/messages.po trunk/locale/it_IT.utf8/LC_MESSAGES/messages.mo trunk/locale/it_IT.utf8/LC_MESSAGES/messages.po trunk/locale/ja_JP.utf8/LC_MESSAGES/messages.mo trunk/locale/ja_JP.utf8/LC_MESSAGES/messages.po trunk/locale/lv_LV.utf8/LC_MESSAGES/messages.mo trunk/locale/lv_LV.utf8/LC_MESSAGES/messages.po trunk/locale/nl_NL.utf8/LC_MESSAGES/messages.mo trunk/locale/nl_NL.utf8/LC_MESSAGES/messages.po trunk/locale/pl_PL.utf8/LC_MESSAGES/messages.mo trunk/locale/pl_PL.utf8/LC_MESSAGES/messages.po trunk/locale/pt_BR.utf8/LC_MESSAGES/messages.mo trunk/locale/pt_BR.utf8/LC_MESSAGES/messages.po trunk/locale/pt_PT.utf8/LC_MESSAGES/messages.mo trunk/locale/pt_PT.utf8/LC_MESSAGES/messages.po trunk/locale/ro_RO.utf8/LC_MESSAGES/messages.mo trunk/locale/ro_RO.utf8/LC_MESSAGES/messages.po trunk/locale/ru_RU.utf8/LC_MESSAGES/messages.mo trunk/locale/ru_RU.utf8/LC_MESSAGES/messages.po trunk/locale/sq_AL.utf8/LC_MESSAGES/messages.mo trunk/locale/sq_AL.utf8/LC_MESSAGES/messages.po trunk/locale/sv_SE.utf8/LC_MESSAGES/messages.mo trunk/locale/sv_SE.utf8/LC_MESSAGES/messages.po trunk/locale/sw_KE.utf8/LC_MESSAGES/messages.mo trunk/locale/sw_KE.utf8/LC_MESSAGES/messages.po trunk/locale/tr_TR.utf8/LC_MESSAGES/messages.mo trunk/locale/tr_TR.utf8/LC_MESSAGES/messages.po trunk/locale/zh_CN.utf8/LC_MESSAGES/messages.mo trunk/locale/zh_CN.utf8/LC_MESSAGES/messages.po trunk/sql/mysql/weberp-demo.sql trunk/sql/mysql/weberp-new.sql Added Paths: ----------- trunk/locale/vi_VN.utf8/ trunk/locale/vi_VN.utf8/LC_MESSAGES/ trunk/locale/vi_VN.utf8/LC_MESSAGES/messages.mo trunk/locale/vi_VN.utf8/LC_MESSAGES/messages.po Modified: trunk/GLProfit_Loss.php =================================================================== --- trunk/GLProfit_Loss.php 2011-03-30 09:06:33 UTC (rev 4526) +++ trunk/GLProfit_Loss.php 2011-03-31 08:32:24 UTC (rev 4527) @@ -2,8 +2,6 @@ /* $Id$*/ -//$PageSecurity = 8; - include ('includes/session.inc'); $title = _('Profit and Loss'); include('includes/SQL_CommonFunctions.inc'); @@ -19,11 +17,11 @@ include('includes/header.inc'); echo '<p class="page_title_text"><img src="'.$rootpath.'/css/'.$theme.'/images/printer.png" title="' . _('Print') . '" alt="" />' . ' ' . _('Print Profit and Loss Report') . '</p>'; -echo '<div class="page_help_text">' . _('Profit and loss statement (P&L), also called an Income Statment, or Statement of Operations, this is the statement that indicates how the revenue (money received from the sale of products and services before expenses are taken out, also known as the "top line") is transformed into the net income (the result after all revenues and expenses have been accounted for, also known as the "bottom line").') . '<br>' -. _('The purpose of the income statement is to show whether the company made or lost money during the period being reported.') . '<br>' -. _('The P&L represents a period of time. This contrasts with the Balance Sheet, which represents a single moment in time.') . '<br>' +echo '<div class="page_help_text">' . _('Profit and loss statement (P&L), also called an Income Statment, or Statement of Operations, this is the statement that indicates how the revenue (money received from the sale of products and services before expenses are taken out, also known as the "top line") is transformed into the net income (the result after all revenues and expenses have been accounted for, also known as the "bottom line").') . '<br />' +. _('The purpose of the income statement is to show whether the company made or lost money during the period being reported.') . '<br />' +. _('The P&L represents a period of time. This contrasts with the Balance Sheet, which represents a single moment in time.') . '<br />' . _('webERP is an "accrual" based system (not a "cash based" system). Accrual systems include items when they are invoiced to the customer, and when expenses are owed based on the supplier invoice date.') . '</div>'; - 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 (Date('m') > $_SESSION['YearEnd']){ @@ -37,32 +35,34 @@ $period=GetPeriod($FromDate, $db); /*Show a form to allow input of criteria for profit and loss to show */ - echo '<p><table class="selection"><tr><td>'._('Select Period From').":</td><td><select Name='FromPeriod'>"; + echo '<p><table class="selection"> + <tr><td>' . _('Select Period From') . ':</td> + <td><select Name="FromPeriod">'; - $sql = "SELECT periodno, lastdate_in_period FROM periods ORDER BY periodno DESC"; + $sql = 'SELECT periodno, lastdate_in_period FROM periods ORDER BY periodno DESC'; $Periods = DB_query($sql,$db); while ($myrow=DB_fetch_array($Periods,$db)){ if(isset($_POST['FromPeriod']) AND $_POST['FromPeriod']!=''){ if( $_POST['FromPeriod']== $myrow['periodno']){ - echo '<option selected VALUE=' . $myrow['periodno'] . '>' .MonthAndYearFromSQLDate($myrow['lastdate_in_period']); + echo '<option selected VALUE=' . $myrow['periodno'] . '>' .MonthAndYearFromSQLDate($myrow['lastdate_in_period']) . '</option>'; } else { - echo '<option VALUE=' . $myrow['periodno'] . '>' . MonthAndYearFromSQLDate($myrow['lastdate_in_period']); + echo '<option VALUE=' . $myrow['periodno'] . '>' . MonthAndYearFromSQLDate($myrow['lastdate_in_period']) . '</option>'; } } else { if($myrow['lastdate_in_period']==$DefaultFromDate){ - echo '<option selected VALUE=' . $myrow['periodno'] . '>' . MonthAndYearFromSQLDate($myrow['lastdate_in_period']); + echo '<option selected VALUE=' . $myrow['periodno'] . '>' . MonthAndYearFromSQLDate($myrow['lastdate_in_period']) . '</option>'; } else { - 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>'; if (!isset($_POST['ToPeriod']) OR $_POST['ToPeriod']==''){ - $lastDate = date("Y-m-d",mktime(0,0,0,Date('m')+1,0,Date('Y'))); - $sql = "SELECT periodno FROM periods where lastdate_in_period = '" . $lastDate . "'"; + $LastDate = date('Y-m-d',mktime(0,0,0,Date('m')+1,0,Date('Y'))); + $sql = "SELECT periodno FROM periods where lastdate_in_period = '" . $LastDate . "'"; $MaxPrd = DB_query($sql,$db); $MaxPrdrow = DB_fetch_row($MaxPrd); $DefaultToPeriod = (int) ($MaxPrdrow[0]); @@ -71,29 +71,29 @@ $DefaultToPeriod = $_POST['ToPeriod']; } - echo '<tr><td>' . _('Select Period To') . ":</td><td><select Name='ToPeriod'>"; + echo '<tr><td>' . _('Select Period To') . ':</td><td><select Name="ToPeriod">'; $RetResult = DB_data_seek($Periods,0); while ($myrow=DB_fetch_array($Periods,$db)){ if($myrow['periodno']==$DefaultToPeriod){ - echo '<option selected VALUE=' . $myrow['periodno'] . '>' . MonthAndYearFromSQLDate($myrow['lastdate_in_period']); + echo '<option selected VALUE=' . $myrow['periodno'] . '>' . MonthAndYearFromSQLDate($myrow['lastdate_in_period']) . '</option>'; } else { - 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>'; echo '<tr><td>'._('Detail Or Summary').":</td><td><select Name='Detail'>"; - echo "<option selected VALUE='Summary'>"._('Summary'); - echo "<option selected VALUE='Detailed'>"._('All Accounts'); + echo '<option selected VALUE="Summary">'._('Summary') . '</option>'; + echo '<option selected VALUE="Detailed">'._('All Accounts') . '</option>'; echo '</select></td></tr>'; echo '</table>'; - echo "<br><div class='centre'><input type=submit Name='ShowPL' Value='"._('Show on Screen (HTML)')."'></div>"; - echo "<br><div class='centre'><input type=submit Name='PrintPDF' Value='"._('Produce PDF Report')."'></div>"; + echo "<br /><div class='centre'><input type=submit Name='ShowPL' Value='"._('Show on Screen (HTML)')."'></div>"; + echo "<br /><div class='centre'><input type=submit Name='PrintPDF' Value='"._('Produce PDF Report')."'></div>"; /*Now do the posting while the user is thinking about the period to select */ @@ -119,7 +119,7 @@ exit; } - $sql = 'SELECT lastdate_in_period FROM periods WHERE periodno=' . $_POST['ToPeriod']; + $sql = "SELECT lastdate_in_period FROM periods WHERE periodno='" . $_POST['ToPeriod'] . "'"; $PrdResult = DB_query($sql, $db); $myrow = DB_fetch_row($PrdResult); $PeriodToDate = MonthAndYearFromSQLDate($myrow[0]); @@ -157,9 +157,9 @@ $title = _('Profit and Loss') . ' - ' . _('Problem Report') . '....'; include('includes/header.inc'); prnMsg( _('No general ledger accounts were returned by the SQL 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?' . SID . '">'. _('Back to the menu'). '</a>'; if ($debug == 1){ - echo '<br>'. $SQL; + echo '<br />'. $SQL; } include('includes/footer.inc'); exit; @@ -169,7 +169,7 @@ include('includes/header.inc'); echo '<p>'; prnMsg( _('There were no entries to print out for the selections specified'),'warn' ); - 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>'; include('includes/footer.inc'); exit; } @@ -529,9 +529,10 @@ } else { 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'] . '" />'; - echo "<input type=hidden name='FromPeriod' VALUE=" . $_POST['FromPeriod'] . "><input type=hidden name='ToPeriod' VALUE=" . $_POST['ToPeriod'] . '>'; + echo "<input type=hidden name='FromPeriod' VALUE=" . $_POST['FromPeriod'] . "> + <input type=hidden name='ToPeriod' VALUE=" . $_POST['ToPeriod'] . '>'; $NumberOfMonths = $_POST['ToPeriod'] - $_POST['FromPeriod'] + 1; @@ -585,20 +586,20 @@ echo '<table cellpadding=2 class=selection>'; if ($_POST['Detail']=='Detailed'){ - $TableHeader = "<tr> - <th>"._('Account')."</th> - <th>"._('Account Name')."</th> - <th colspan=2>"._('Period Actual')."</th> - <th colspan=2>"._('Period Budget')."</th> - <th colspan=2>"._('Last Year')."</th> - </tr>"; + $TableHeader = '<tr> + <th>' . _('Account') . '</th> + <th>'._('Account Name') .'</th> + <th colspan=2>' . _('Period Actual') .'</th> + <th colspan=2>' . _('Period Budget') .'</th> + <th colspan=2>' . _('Last Year') . '</th> + </tr>'; } else { /*summary */ - $TableHeader = "<tr> - <th colspan=2></th> - <th colspan=2>"._('Period Actual')."</th> - <th colspan=2>"._('Period Budget')."</th> - <th colspan=2>"._('Last Year')."</th> - </tr>"; + $TableHeader = '<tr> + <th colspan=2></th> + <th colspan=2>' . _('Period Actual') .'</th> + <th colspan=2>' . _('Period Budget') . '</th> + <th colspan=2>' . _('Last Year') . '</th> + </tr>'; } @@ -893,7 +894,7 @@ $k++; } - $ActEnquiryURL = "<a href='$rootpath/GLAccountInquiry.php?" . SID . '&Period=' . $_POST['ToPeriod'] . '&Account=' . $myrow['accountcode'] . "&Show=Yes'>" . $myrow['accountcode'] . '<a>'; + $ActEnquiryURL = '<a href="' . $rootpath . '/GLAccountInquiry.php?Period=' . $_POST['ToPeriod'] . '&Account=' . $myrow['accountcode'] . '&Show=Yes">' . $myrow['accountcode'] . '</a>'; if ($Section ==1){ printf('<td>%s</td> @@ -1206,7 +1207,7 @@ </tr>'; echo '</table>'; - echo "<br><div class='centre'><input type=submit Name='SelectADifferentPeriod' Value='"._('Select A Different Period')."'></div>"; + echo '<br /><div class="centre"><input type="submit" name="SelectADifferentPeriod" Value="' . _('Select A Different Period') . '"></div>'; } echo '</form>'; include('includes/footer.inc'); Modified: trunk/GLTagProfit_Loss.php =================================================================== --- trunk/GLTagProfit_Loss.php 2011-03-30 09:06:33 UTC (rev 4526) +++ trunk/GLTagProfit_Loss.php 2011-03-31 08:32:24 UTC (rev 4527) @@ -2,8 +2,6 @@ /* $Id$*/ -//$PageSecurity = 8; - include ('includes/session.inc'); $title = _('Income and Expenditure by Tag'); include('includes/SQL_CommonFunctions.inc'); @@ -18,7 +16,7 @@ if ((!isset($_POST['FromPeriod']) AND !isset($_POST['ToPeriod'])) OR isset($_POST['SelectADifferentPeriod'])){ 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'] . '" />'; echo '<p class="page_title_text"><img src="'.$rootpath.'/css/'.$theme.'/images/printer.png" title="' . _('Print') . '" alt="" />' . ' ' . $title . '</p>'; @@ -34,7 +32,7 @@ $period=GetPeriod($FromDate, $db); /*Show a form to allow input of criteria for profit and loss to show */ - echo '<table class=selection><tr><td>'._('Select Period From').":</td><td><select Name='FromPeriod'>"; + echo '<table class=selection><tr><td>' . _('Select Period From') . ':</td><td><select Name="FromPeriod">'; $sql = 'SELECT periodno, lastdate_in_period FROM periods ORDER BY periodno DESC'; $Periods = DB_query($sql,$db); @@ -43,22 +41,22 @@ while ($myrow=DB_fetch_array($Periods,$db)){ if(isset($_POST['FromPeriod']) AND $_POST['FromPeriod']!=''){ if( $_POST['FromPeriod']== $myrow['periodno']){ - echo '<option selected VALUE=' . $myrow['periodno'] . '>' .MonthAndYearFromSQLDate($myrow['lastdate_in_period']); + echo '<option selected VALUE=' . $myrow['periodno'] . '>' .MonthAndYearFromSQLDate($myrow['lastdate_in_period']) . '</option>'; } else { - echo '<option VALUE=' . $myrow['periodno'] . '>' . MonthAndYearFromSQLDate($myrow['lastdate_in_period']); + echo '<option VALUE=' . $myrow['periodno'] . '>' . MonthAndYearFromSQLDate($myrow['lastdate_in_period']) . '</option>'; } } else { if($myrow['lastdate_in_period']==$DefaultFromDate){ - echo '<option selected VALUE=' . $myrow['periodno'] . '>' . MonthAndYearFromSQLDate($myrow['lastdate_in_period']); + echo '<option selected VALUE=' . $myrow['periodno'] . '>' . MonthAndYearFromSQLDate($myrow['lastdate_in_period']) . '</option>'; } else { - 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>'; if (!isset($_POST['ToPeriod']) OR $_POST['ToPeriod']==''){ - $lastDate = date("Y-m-d",mktime(0,0,0,Date('m')+1,0,Date('Y'))); + $lastDate = date('Y-m-d',mktime(0,0,0,Date('m')+1,0,Date('Y'))); $sql = "SELECT periodno FROM periods where lastdate_in_period = '$lastDate'"; $MaxPrd = DB_query($sql,$db); $MaxPrdrow = DB_fetch_row($MaxPrd); @@ -68,16 +66,16 @@ $DefaultToPeriod = $_POST['ToPeriod']; } - echo '<tr><td>' . _('Select Period To') . ":</td><td><select Name='ToPeriod'>"; + echo '<tr><td>' . _('Select Period To') . ':</td><td><select Name="ToPeriod">'; $RetResult = DB_data_seek($Periods,0); while ($myrow=DB_fetch_array($Periods,$db)){ if($myrow['periodno']==$DefaultToPeriod){ - echo '<option selected VALUE=' . $myrow['periodno'] . '>' . MonthAndYearFromSQLDate($myrow['lastdate_in_period']); + echo '<option selected VALUE=' . $myrow['periodno'] . '>' . MonthAndYearFromSQLDate($myrow['lastdate_in_period']) . '</option>'; } else { - 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>'; @@ -92,18 +90,18 @@ $result=DB_query($SQL,$db); echo '<option value=0>0 - None'; while ($myrow=DB_fetch_array($result)){ - if (isset($_POST['tag']) and $_POST['tag']==$myrow["tagref"]){ - echo '<option selected value=' . $myrow['tagref'] . '>' . $myrow['tagref'].' - ' .$myrow['tagdescription']; + if (isset($_POST['tag']) and $_POST['tag']==$myrow['tagref']){ + 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>'; // End select tag - echo '<tr><td>'._('Detail Or Summary').":</td><td><select Name='Detail'>"; - echo "<option selected VALUE='Summary'>"._('Summary'); - echo "<option selected VALUE='Detailed'>"._('All Accounts'); + echo '<tr><td>'._('Detail Or Summary').':</td><td><select Name="Detail">'; + echo '<option selected VALUE="Summary">'._('Summary') . '</option>'; + echo '<option selected VALUE="Detailed">'._('All Accounts') . '</option>'; echo '</select></td></tr>'; echo '</table><br>'; @@ -138,24 +136,24 @@ exit; } - $sql = 'SELECT lastdate_in_period FROM periods WHERE periodno=' . $_POST['ToPeriod']; + $sql = "SELECT lastdate_in_period FROM periods WHERE periodno='" . $_POST['ToPeriod'] . "'"; $PrdResult = DB_query($sql, $db); $myrow = DB_fetch_row($PrdResult); $PeriodToDate = MonthAndYearFromSQLDate($myrow[0]); - $SQL = 'SELECT accountgroups.sectioninaccounts, + $SQL = "SELECT accountgroups.sectioninaccounts, accountgroups.groupname, accountgroups.parentgroupname, gltrans.account , chartmaster.accountname, - Sum(CASE WHEN (gltrans.periodno>=' . $_POST['FromPeriod'] . ' and gltrans.periodno<=' . $_POST['ToPeriod'] . ') THEN gltrans.amount ELSE 0 END) AS TotalAllPeriods, - Sum(CASE WHEN (gltrans.periodno=' . $_POST['ToPeriod'] . ') THEN gltrans.amount ELSE 0 END) AS TotalThisPeriod + Sum(CASE WHEN (gltrans.periodno>='" . $_POST['FromPeriod'] . "' and gltrans.periodno<='" . $_POST['ToPeriod'] . "') THEN gltrans.amount ELSE 0 END) AS TotalAllPeriods, + Sum(CASE WHEN (gltrans.periodno='" . $_POST['ToPeriod'] . "') THEN gltrans.amount ELSE 0 END) AS TotalThisPeriod FROM chartmaster INNER JOIN accountgroups ON chartmaster.group_ = accountgroups.groupname INNER JOIN gltrans ON chartmaster.accountcode= gltrans.account WHERE accountgroups.pandl=1 - AND gltrans.tag='.$_POST['tag'].' + AND gltrans.tag='" . $_POST['tag'] . "' GROUP BY accountgroups.sectioninaccounts, accountgroups.groupname, accountgroups.parentgroupname, @@ -165,7 +163,7 @@ ORDER BY accountgroups.sectioninaccounts, accountgroups.sequenceintb, accountgroups.groupname, - gltrans.account'; + gltrans.account"; $AccountsResult = DB_query($SQL,$db); @@ -186,7 +184,7 @@ include('includes/header.inc'); echo '<p>'; prnMsg( _('There were no entries to print out for the selections specified'),'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; } @@ -444,9 +442,9 @@ } else { 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'] . '" />'; - echo "<input type=hidden name='FromPeriod' VALUE=" . $_POST['FromPeriod'] . "><input type=hidden name='ToPeriod' VALUE=" . $_POST['ToPeriod'] . '>'; + echo "<input type=hidden name='FromPeriod' VALUE=" . $_POST['FromPeriod'] . "><input type=hidden name='ToPeriod' VALUE=" . $_POST['ToPeriod'] . ' />'; $NumberOfMonths = $_POST['ToPeriod'] - $_POST['FromPeriod'] + 1; @@ -457,24 +455,24 @@ exit; } - $sql = 'SELECT lastdate_in_period FROM periods WHERE periodno=' . $_POST['ToPeriod']; + $sql = "SELECT lastdate_in_period FROM periods WHERE periodno='" . $_POST['ToPeriod'] . "'"; $PrdResult = DB_query($sql, $db); $myrow = DB_fetch_row($PrdResult); $PeriodToDate = MonthAndYearFromSQLDate($myrow[0]); - $SQL = 'SELECT accountgroups.sectioninaccounts, + $SQL = "SELECT accountgroups.sectioninaccounts, accountgroups.groupname, accountgroups.parentgroupname, gltrans.account , chartmaster.accountname, - Sum(CASE WHEN (gltrans.periodno>=' . $_POST['FromPeriod'] . ' and gltrans.periodno<=' . $_POST['ToPeriod'] . ') THEN gltrans.amount ELSE 0 END) AS TotalAllPeriods, - Sum(CASE WHEN (gltrans.periodno=' . $_POST['ToPeriod'] . ') THEN gltrans.amount ELSE 0 END) AS TotalThisPeriod + Sum(CASE WHEN (gltrans.periodno>='" . $_POST['FromPeriod'] . "' AND gltrans.periodno<='" . $_POST['ToPeriod'] . "') THEN gltrans.amount ELSE 0 END) AS TotalAllPeriods, + Sum(CASE WHEN (gltrans.periodno='" . $_POST['ToPeriod'] . "') THEN gltrans.amount ELSE 0 END) AS TotalThisPeriod FROM chartmaster INNER JOIN accountgroups ON chartmaster.group_ = accountgroups.groupname INNER JOIN gltrans ON chartmaster.accountcode= gltrans.account WHERE accountgroups.pandl=1 - AND gltrans.tag='.$_POST['tag'].' + AND gltrans.tag='" . $_POST['tag'] . "' GROUP BY accountgroups.sectioninaccounts, accountgroups.groupname, accountgroups.parentgroupname, @@ -484,11 +482,11 @@ ORDER BY accountgroups.sectioninaccounts, accountgroups.sequenceintb, accountgroups.groupname, - gltrans.account'; + gltrans.account"; $AccountsResult = DB_query($SQL,$db,_('No general ledger accounts were returned by the SQL because'),_('The SQL that failed was')); - $sql='SELECT tagdescription FROM tags WHERE tagref='.$_POST['tag']; + $sql="SELECT tagdescription FROM tags WHERE tagref='".$_POST['tag'] . "'"; $result=DB_query($sql, $db); $myrow=DB_fetch_row($result); @@ -498,20 +496,19 @@ . _('Print') . '" alt="" />' . ' ' . $title . '</p>'; echo '<table cellpadding=2 class=selection>'; - echo '<tr><th colspan=9><div class="centre"><font size=3 color=blue><b>' . _('Statement of Income and Expenditure for Tag'). ' ' . - $myrow[0]._('during the'). ' ' . $NumberOfMonths . ' ' . _('months to'). ' ' . $PeriodToDate . '</b></font></div></th></tr>'; + echo '<tr><th colspan=9><div class="centre"><font size=3 color=blue><b>' . _('Statement of Income and Expenditure for Tag'). ' ' . $myrow[0]._('during the'). ' ' . $NumberOfMonths . ' ' . _('months to'). ' ' . $PeriodToDate . '</b></font></div></th></tr>'; if ($_POST['Detail']=='Detailed'){ - $TableHeader = "<tr> - <th>"._('Account')."</th> - <th>"._('Account Name')."</th> - <th colspan=2>"._('Period Actual')."</th> - </tr>"; + $TableHeader = '<tr> + <th>' . _('Account') . '</th> + <th>' . _('Account Name') . '</th> + <th colspan=2>' . _('Period Actual') . '</th> + </tr>'; } else { /*summary */ - $TableHeader = "<tr> - <th colspan=2></th> - <th colspan=2>"._('Period Actual')."</th> - </tr>"; + $TableHeader = '<tr> + <th colspan=2></th> + <th colspan=2>' . _('Period Actual') . '</th> + </tr>'; } @@ -734,17 +731,17 @@ $k++; } - $ActEnquiryURL = "<a href='$rootpath/GLAccountInquiry.php?" . SID . '&Period=' . $_POST['ToPeriod'] . '&Account=' . $myrow['account'] . "&Show=Yes'>" . $myrow['account'] . '<a>'; + $ActEnquiryURL = '<a href="' . $rootpath . '/GLAccountInquiry.php?Period=' . $_POST['ToPeriod'] . '&Account=' . $myrow['account'] . '&Show=Yes">' . $myrow['account'] . '</a>'; if ($Section ==4){ printf('<td>%s</td> - <td>%s</td> - <td></td> - <td class=number>%s</td> - </tr>', - $ActEnquiryURL, - $myrow['accountname'], - number_format(-$AccountPeriodActual)); + <td>%s</td> + <td></td> + <td class=number>%s</td> + </tr>', + $ActEnquiryURL, + $myrow['accountname'], + number_format(-$AccountPeriodActual)); } else { printf('<td>%s</td> <td>%s</td> @@ -946,4 +943,4 @@ echo '</form>'; include('includes/footer.inc'); -?> +?> \ No newline at end of file Modified: trunk/build/make_release.sh =================================================================== --- trunk/build/make_release.sh 2011-03-30 09:06:33 UTC (rev 4526) +++ trunk/build/make_release.sh 2011-03-31 08:32:24 UTC (rev 4527) @@ -36,6 +36,7 @@ msgmerge -U --backup=off locale/tr_TR.utf8/LC_MESSAGES/messages.po locale/en_GB.utf8/LC_MESSAGES/messages.pot msgmerge -U --backup=off locale/zh_CN.utf8/LC_MESSAGES/messages.po locale/en_GB.utf8/LC_MESSAGES/messages.pot msgmerge -U --backup=off locale/zh_HK.utf8/LC_MESSAGES/messages.po locale/en_GB.utf8/LC_MESSAGES/messages.pot +msgmerge -U --backup=off locale/vi_VN.utf8/LC_MESSAGES/messages.po locale/en_GB.utf8/LC_MESSAGES/messages.pot msgfmt -o locale/cs_CZ.utf8/LC_MESSAGES/messages.mo locale/cs_CZ.utf8/LC_MESSAGES/messages.po msgfmt -o locale/de_DE.utf8/LC_MESSAGES/messages.mo locale/de_DE.utf8/LC_MESSAGES/messages.po @@ -64,6 +65,7 @@ msgfmt -o locale/tr_TR.utf8/LC_MESSAGES/messages.mo locale/tr_TR.utf8/LC_MESSAGES/messages.po msgfmt -o locale/zh_CN.utf8/LC_MESSAGES/messages.mo locale/zh_CN.utf8/LC_MESSAGES/messages.po msgfmt -o locale/zh_HK.utf8/LC_MESSAGES/messages.mo locale/zh_HK.utf8/LC_MESSAGES/messages.po +msgfmt -o locale/vi_VN.utf8/LC_MESSAGES/messages.mo locale/vi_VN.utf8/LC_MESSAGES/messages.po echo "SET FOREIGN_KEY_CHECKS = 0;" > $BASE_DIR/sql/mysql/weberp-new.sql Modified: trunk/doc/Change.log.html =================================================================== --- trunk/doc/Change.log.html 2011-03-30 09:06:33 UTC (rev 4526) +++ trunk/doc/Change.log.html 2011-03-31 08:32:24 UTC (rev 4527) @@ -1,7 +1,10 @@ <p><font SIZE=4 COLOR=BLUE><b>webERP Change Log</b></font></p> <p /> -<p>30/3/11 Tim - New ReprintGRN.php script takes a purchase order and allows any line received to have GRN(s) reprinted</p> -<p>29/3/11 Phil - checking for unquoted SQL and for SQL where literals quoted with double quotes rather than single - double quotes are not ANSI compatible - so making the SQL more ANSI compatible by doing this as suggested by Tim. Many many scripts involved will take a week or so</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> +<p>30/3/11 Tim: New ReprintGRN.php script takes a purchase order and allows any line received to have GRN(s) reprinted</p> +<p>29/3/11 Phil: checking for unquoted SQL and for SQL where literals quoted with double quotes rather than single - double quotes are not ANSI compatible - so making the SQL more ANSI compatible by doing this as suggested by Tim. Many many scripts involved will take a week or so</p> <p /> <p>27/3/11 - Version 4.03.5 Release <p> Modified: trunk/includes/session.inc =================================================================== --- trunk/includes/session.inc 2011-03-30 09:06:33 UTC (rev 4526) +++ trunk/includes/session.inc 2011-03-31 08:32:24 UTC (rev 4527) @@ -23,7 +23,6 @@ session_start(); -include($PathPrefix . 'includes/LanguageSetup.php'); include($PathPrefix . 'includes/ConnectDB.inc'); include($PathPrefix . 'includes/DateFunctions.inc'); @@ -111,6 +110,7 @@ } } /* only do security checks if AllowAnyone is not true */ +include($PathPrefix . 'includes/LanguageSetup.php'); /*User is logged in so get configuration parameters - save in session*/ include($PathPrefix . 'includes/GetConfig.php'); Modified: trunk/locale/cs_CZ.utf8/LC_MESSAGES/messages.mo =================================================================== (Binary files differ) Modified: trunk/locale/cs_CZ.utf8/LC_MESSAGES/messages.po =================================================================== --- trunk/locale/cs_CZ.utf8/LC_MESSAGES/messages.po 2011-03-30 09:06:33 UTC (rev 4526) +++ trunk/locale/cs_CZ.utf8/LC_MESSAGES/messages.po 2011-03-31 08:32:24 UTC (rev 4527) @@ -7,21 +7,21 @@ msgstr "" "Project-Id-Version: webERP 3.08\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2011-03-27 19:34+1200\n" -"PO-Revision-Date: 2010-07-25 17:04+0000\n" -"Last-Translator: Tim Schofield <ti...@we...>\n" +"POT-Creation-Date: 2011-03-31 20:06+1200\n" +"PO-Revision-Date: 2011-02-07 15:33+0000\n" +"Last-Translator: Tim Schofield <Unknown>\n" "Language-Team: Czech <cs...@li...>\n" "MIME-Version: 1.0\n" "Content-Type: text/plain; charset=UTF-8\n" "Content-Transfer-Encoding: 8bit\n" -"Language: cs\n" -"X-Launchpad-Export-Date: 2011-01-05 16:36+0000\n" -"X-Generator: Launchpad (build 12138)\n" +"X-Launchpad-Export-Date: 2011-03-31 06:23+0000\n" +"X-Generator: Launchpad (build 12696)\n" "X-Poedit-Country: CZECH REPUBLIC\n" +"Language: cs\n" "X-Poedit-Language: Czech\n" "X-Poedit-SourceCharset: utf-8\n" -#: AccountGroups.php:9 index.php:1272 +#: AccountGroups.php:9 index.php:1277 msgid "Account Groups" msgstr "Účetní skupiny" @@ -133,9 +133,9 @@ #: Areas.php:117 Areas.php:126 BankAccounts.php:163 CreditStatus.php:126 #: Currencies.php:144 Currencies.php:152 Currencies.php:159 #: CustomerBranches.php:296 CustomerBranches.php:306 CustomerBranches.php:316 -#: CustomerBranches.php:326 Customers.php:317 Customers.php:326 -#: Customers.php:334 Customers.php:342 CustomerTypes.php:149 -#: CustomerTypes.php:159 Factors.php:136 FixedAssetCategories.php:132 +#: CustomerBranches.php:326 Customers.php:311 Customers.php:320 +#: Customers.php:328 Customers.php:336 CustomerTypes.php:149 +#: CustomerTypes.php:159 Factors.php:136 FixedAssetCategories.php:131 #: GLAccounts.php:95 GLAccounts.php:109 Locations.php:247 Locations.php:255 #: Locations.php:264 Locations.php:272 Locations.php:280 Locations.php:288 #: Locations.php:296 Locations.php:304 MRPDemandTypes.php:89 @@ -146,7 +146,7 @@ #: Stocks.php:469 Stocks.php:478 Stocks.php:486 Stocks.php:494 Stocks.php:502 #: Stocks.php:510 Suppliers.php:613 Suppliers.php:622 Suppliers.php:630 #: SupplierTypes.php:147 TaxCategories.php:133 TaxGroups.php:128 -#: TaxGroups.php:135 TaxProvinces.php:127 UnitsOfMeasure.php:140 +#: TaxGroups.php:135 TaxProvinces.php:127 UnitsOfMeasure.php:137 #: WorkCentres.php:90 WorkCentres.php:96 WWW_Access.php:87 msgid "There are" msgstr "Jsou zde" @@ -186,7 +186,7 @@ #: AccountGroups.php:223 msgid "The sql that was used to retrieve the account group information was " -msgstr "Sql, který byl použit k načtení účtové skupiny informace" +msgstr "Sql, který byl použit k načtení účtové skupiny informace " #: AccountGroups.php:224 msgid "Could not get account groups because" @@ -195,17 +195,17 @@ #: AccountGroups.php:226 AccountSections.php:177 AddCustomerContacts.php:25 #: AddCustomerContacts.php:28 AddCustomerNotes.php:97 #: AddCustomerTypeNotes.php:94 AgedDebtors.php:468 AgedSuppliers.php:277 -#: Areas.php:145 AuditTrail.php:13 BOMExtendedQty.php:286 BOMIndented.php:262 -#: BOMIndentedReverse.php:257 BOMInquiry.php:165 BOMListing.php:128 -#: BOMs.php:214 BOMs.php:793 COGSGLPostings.php:20 CompanyPreferences.php:158 +#: Areas.php:145 AuditTrail.php:13 BOMExtendedQty.php:272 BOMIndented.php:252 +#: BOMIndentedReverse.php:246 BOMInquiry.php:165 BOMListing.php:128 +#: BOMs.php:214 BOMs.php:793 COGSGLPostings.php:20 CompanyPreferences.php:155 #: CounterSales.php:1983 CounterSales.php:2107 Credit_Invoice.php:256 #: CreditStatus.php:21 Currencies.php:29 CustEDISetup.php:19 #: DailyBankTransactions.php:9 DebtorsAtPeriodEnd.php:138 #: DiscountCategories.php:12 DiscountCategories.php:122 DiscountMatrix.php:18 -#: EDIMessageFormat.php:106 FixedAssetLocations.php:9 +#: EDIMessageFormat.php:104 FixedAssetLocations.php:9 #: FixedAssetRegister.php:13 FixedAssetRegister.php:238 #: FixedAssetTransfer.php:31 FormDesigner.php:132 GLBalanceSheet.php:351 -#: GLBudgets.php:30 GLJournal.php:243 InventoryPlanning.php:374 +#: GLBudgets.php:28 GLJournal.php:228 InventoryPlanning.php:374 #: InventoryPlanningPrefSupplier.php:474 Labels.php:117 Labels.php:273 #: MRPReport.php:536 OutstandingGRNs.php:174 PcAssignCashToTab.php:39 #: PcAssignCashToTab.php:113 PcAssignCashToTab.php:129 @@ -238,7 +238,7 @@ msgid "Group Name" msgstr "Název skupiny" -#: AccountGroups.php:231 EDIMessageFormat.php:131 +#: AccountGroups.php:231 EDIMessageFormat.php:129 EDIMessageFormat.php:207 msgid "Section" msgstr "Sekce" @@ -260,11 +260,11 @@ #: AccountGroups.php:386 BankAccounts.php:217 BankAccounts.php:361 #: BankAccounts.php:363 BankAccounts.php:367 BOMs.php:128 BOMs.php:713 #: BOMs.php:715 CompanyPreferences.php:439 CompanyPreferences.php:441 -#: CompanyPreferences.php:451 CompanyPreferences.php:453 -#: CompanyPreferences.php:463 CompanyPreferences.php:465 +#: CompanyPreferences.php:452 CompanyPreferences.php:454 +#: CompanyPreferences.php:465 CompanyPreferences.php:467 #: ContractCosting.php:174 CustLoginSetup.php:590 CustLoginSetup.php:592 -#: CustomerBranches.php:420 Customers.php:600 Customers.php:857 -#: Customers.php:864 Customers.php:867 DeliveryDetails.php:1034 +#: CustomerBranches.php:420 Customers.php:590 Customers.php:847 +#: Customers.php:854 Customers.php:857 DeliveryDetails.php:1034 #: DeliveryDetails.php:1074 DeliveryDetails.php:1077 GLTransInquiry.php:73 #: MRPCalendar.php:222 MRP.php:529 MRP.php:533 MRP.php:537 MRP.php:541 #: PaymentMethods.php:203 PaymentMethods.php:204 PaymentMethods.php:264 @@ -295,11 +295,11 @@ #: BankAccounts.php:215 BankAccounts.php:361 BankAccounts.php:363 #: BankAccounts.php:367 BOMs.php:130 BOMs.php:712 BOMs.php:716 #: CompanyPreferences.php:438 CompanyPreferences.php:442 -#: CompanyPreferences.php:450 CompanyPreferences.php:454 -#: CompanyPreferences.php:462 CompanyPreferences.php:466 +#: CompanyPreferences.php:451 CompanyPreferences.php:455 +#: CompanyPreferences.php:464 CompanyPreferences.php:468 #: ContractCosting.php:172 CustLoginSetup.php:589 CustLoginSetup.php:593 -#: CustomerBranches.php:420 Customers.php:599 Customers.php:855 -#: Customers.php:863 Customers.php:866 DeliveryDetails.php:1035 +#: CustomerBranches.php:420 Customers.php:589 Customers.php:845 +#: Customers.php:853 Customers.php:856 DeliveryDetails.php:1035 #: DeliveryDetails.php:1075 DeliveryDetails.php:1078 GLTransInquiry.php:127 #: MRPCalendar.php:224 MRP.php:527 MRP.php:531 MRP.php:535 MRP.php:539 #: PaymentMethods.php:203 PaymentMethods.php:204 PaymentMethods.php:265 @@ -330,10 +330,10 @@ #: AccountGroups.php:265 AccountSections.php:197 AddCustomerContacts.php:131 #: AddCustomerNotes.php:125 AddCustomerTypeNotes.php:123 Areas.php:165 #: BankAccounts.php:226 BOMs.php:150 COGSGLPostings.php:113 -#: COGSGLPostings.php:218 CreditStatus.php:175 Currencies.php:239 -#: CustLoginSetup.php:312 CustomerBranches.php:424 Customers.php:909 -#: Customers.php:941 CustomerTypes.php:205 EDIMessageFormat.php:152 -#: Factors.php:208 FixedAssetCategories.php:182 FixedAssetLocations.php:102 +#: COGSGLPostings.php:215 CreditStatus.php:175 Currencies.php:239 +#: CustLoginSetup.php:312 CustomerBranches.php:424 Customers.php:899 +#: Customers.php:931 CustomerTypes.php:205 EDIMessageFormat.php:150 +#: Factors.php:208 FixedAssetCategories.php:181 FixedAssetLocations.php:102 #: FreightCosts.php:243 GeocodeSetup.php:169 GLAccounts.php:319 GLTags.php:62 #: Labels.php:414 Locations.php:380 MRPDemands.php:304 MRPDemandTypes.php:122 #: PaymentMethods.php:205 PaymentTerms.php:203 PcAssignCashToTab.php:251 @@ -346,7 +346,7 @@ #: SelectCustomer.php:702 Shippers.php:144 StockCategories.php:244 #: SupplierContacts.php:153 SupplierTypes.php:192 SuppLoginSetup.php:274 #: TaxAuthorities.php:173 TaxCategories.php:184 TaxGroups.php:179 -#: TaxProvinces.php:178 UnitsOfMeasure.php:190 WorkCentres.php:138 +#: TaxProvinces.php:178 UnitsOfMeasure.php:187 WorkCentres.php:138 #: WWW_Access.php:127 WWW_Users.php:307 includes/InputSerialItems.php:88 #: includes/OutputSerialItems.php:21 #, php-format @@ -356,15 +356,15 @@ #: AccountGroups.php:266 AccountSections.php:201 AddCustomerContacts.php:132 #: AddCustomerNotes.php:126 AddCustomerTypeNotes.php:124 Areas.php:166 #: BankAccounts.php:227 BOMs.php:152 COGSGLPostings.php:114 -#: COGSGLPostings.php:219 ContractBOM.php:272 ContractOtherReqts.php:121 +#: COGSGLPostings.php:216 ContractBOM.php:272 ContractOtherReqts.php:121 #: CounterSales.php:781 Credit_Invoice.php:385 CreditStatus.php:176 -#: Currencies.php:242 CustLoginSetup.php:313 CustomerReceipt.php:866 -#: Customers.php:942 CustomerTypes.php:206 DiscountCategories.php:204 -#: DiscountMatrix.php:178 EDIMessageFormat.php:153 -#: FixedAssetCategories.php:183 FreightCosts.php:244 GeocodeSetup.php:170 -#: GLAccounts.php:320 GLJournal.php:401 Labels.php:414 Locations.php:381 +#: Currencies.php:242 CustLoginSetup.php:313 CustomerReceipt.php:863 +#: Customers.php:932 CustomerTypes.php:206 DiscountCategories.php:204 +#: DiscountMatrix.php:178 EDIMessageFormat.php:151 +#: FixedAssetCategories.php:182 FreightCosts.php:244 GeocodeSetup.php:170 +#: GLAccounts.php:320 GLJournal.php:385 Labels.php:414 Locations.php:381 #: MRPDemands.php:305 MRPDemandTypes.php:123 PaymentMethods.php:206 -#: Payments.php:958 PaymentTerms.php:204 PcAssignCashToTab.php:255 +#: Payments.php:959 PaymentTerms.php:204 PcAssignCashToTab.php:255 #: PcClaimExpensesFromTab.php:230 PcExpenses.php:187 PcExpensesTypeTab.php:164 #: PcTabs.php:189 PcTypeTabs.php:175 PO_AuthorisationLevels.php:150 #: PO_Items.php:762 Prices_Customer.php:284 Prices.php:228 PurchData.php:208 @@ -379,7 +379,7 @@ #: SupplierContacts.php:154 SupplierTypes.php:194 SuppLoginSetup.php:275 #: SuppShiptChgs.php:86 SuppTransGLAnalysis.php:111 TaxAuthorities.php:174 #: TaxCategories.php:185 TaxGroups.php:180 TaxProvinces.php:179 -#: UnitsOfMeasure.php:191 WorkCentres.php:139 WOSerialNos.php:300 +#: UnitsOfMeasure.php:188 WorkCentres.php:139 WOSerialNos.php:300 #: WWW_Access.php:128 WWW_Users.php:308 includes/InputSerialItemsKeyed.php:57 #: includes/OutputSerialItems.php:98 #, php-format @@ -425,10 +425,10 @@ #: AccountGroups.php:401 AccountSections.php:262 AddCustomerContacts.php:208 #: AddCustomerNotes.php:201 AddCustomerTypeNotes.php:192 Areas.php:222 -#: BankAccounts.php:373 BOMs.php:725 COGSGLPostings.php:347 +#: BankAccounts.php:373 BOMs.php:725 COGSGLPostings.php:353 #: CreditStatus.php:247 Currencies.php:339 CustLoginSetup.php:611 -#: DiscountMatrix.php:141 EDIMessageFormat.php:249 -#: FixedAssetCategories.php:328 FixedAssetLocations.php:148 +#: DiscountMatrix.php:141 EDIMessageFormat.php:247 +#: FixedAssetCategories.php:327 FixedAssetLocations.php:148 #: FreightCosts.php:342 GeocodeSetup.php:266 GLAccounts.php:269 #: Locations.php:558 MRPDemands.php:402 MRPDemandTypes.php:182 #: OffersReceived.php:52 OffersReceived.php:128 PaymentMethods.php:276 @@ -436,12 +436,12 @@ #: SalesAnalReptCols.php:510 SalesAnalRepts.php:496 SalesGLPostings.php:415 #: SalesPeople.php:302 Shippers.php:196 StockCategories.php:561 #: SupplierContacts.php:250 SuppLoginSetup.php:532 TaxAuthorities.php:313 -#: TaxCategories.php:235 TaxProvinces.php:229 UnitsOfMeasure.php:242 +#: TaxCategories.php:235 TaxProvinces.php:229 UnitsOfMeasure.php:239 #: WorkCentres.php:261 WWW_Users.php:638 msgid "Enter Information" msgstr "Vložit informace" -#: AccountSections.php:9 index.php:1277 +#: AccountSections.php:9 index.php:1282 msgid "Account Sections" msgstr "Sekce účtu" @@ -549,9 +549,9 @@ msgid "The contact record has been deleted" msgstr "Kontakt záznam byl odstraněn" -#: AddCustomerContacts.php:112 CompanyPreferences.php:229 -#: CustomerBranches.php:377 Customers.php:899 Customers.php:905 -#: Customers.php:971 SalesPeople.php:185 SelectCustomer.php:606 +#: AddCustomerContacts.php:112 CompanyPreferences.php:224 +#: CustomerBranches.php:377 Customers.php:889 Customers.php:895 +#: Customers.php:961 SalesPeople.php:185 SelectCustomer.php:606 #: StockDispatch.php:186 StockDispatch.php:198 SupplierContacts.php:141 #: SupplierCredit.php:437 SupplierInvoice.php:408 SuppTransGLAnalysis.php:96 #: includes/InputSerialItemsFile.php:84 includes/InputSerialItemsFile.php:124 @@ -559,18 +559,18 @@ msgid "Name" msgstr "Název" -#: AddCustomerContacts.php:113 AddCustomerContacts.php:190 Customers.php:900 -#: Customers.php:906 Customers.php:972 SelectCustomer.php:607 +#: AddCustomerContacts.php:113 AddCustomerContacts.php:190 Customers.php:890 +#: Customers.php:896 Customers.php:962 SelectCustomer.php:607 #: WWW_Access.php:111 WWW_Access.php:172 msgid "Role" msgstr "Roli" -#: AddCustomerContacts.php:114 Customers.php:973 +#: AddCustomerContacts.php:114 Customers.php:963 msgid "Phone no" msgstr "Telefonní číslo" -#: AddCustomerContacts.php:115 AddCustomerContacts.php:202 Customers.php:902 -#: Customers.php:908 Customers.php:974 PcAssignCashToTab.php:216 +#: AddCustomerContacts.php:115 AddCustomerContacts.php:202 Customers.php:892 +#: Customers.php:898 Customers.php:964 PcAssignCashToTab.php:216 #: PcAssignCashToTab.php:341 PcAuthorizeExpenses.php:85 #: PcClaimExpensesFromTab.php:195 PcClaimExpensesFromTab.php:348 #: PcReportTab.php:348 SelectCustomer.php:609 SystemParameters.php:316 @@ -740,8 +740,8 @@ msgstr "Ve věku od zákaznického účtu analýza" #: AgedDebtors.php:267 AgedDebtors.php:365 AgedDebtors.php:436 -#: AgedSuppliers.php:105 BOMExtendedQty.php:156 BOMIndented.php:149 -#: BOMIndentedReverse.php:148 BOMListing.php:48 BOMListing.php:59 +#: AgedSuppliers.php:105 BOMExtendedQty.php:159 BOMIndented.php:150 +#: BOMIndentedReverse.php:151 BOMListing.php:48 BOMListing.php:59 #: DebtorsAtPeriodEnd.php:58 DebtorsAtPeriodEnd.php:70 GLBalanceSheet.php:90 #: GLBalanceSheet.php:128 GLProfit_Loss.php:157 GLTagProfit_Loss.php:174 #: GLTrialBalance.php:151 InventoryPlanning.php:99 InventoryPlanning.php:174 @@ -769,9 +769,9 @@ msgstr "Zákazník podrobnosti se nepodařilo získat do SQL, protože" #: AgedDebtors.php:270 AgedDebtors.php:368 AgedDebtors.php:442 -#: AgedSuppliers.php:108 AgedSuppliers.php:190 BOMExtendedQty.php:159 -#: BOMExtendedQty.php:263 BOMIndented.php:152 BOMIndented.php:238 -#: BOMIndentedReverse.php:151 BOMIndentedReverse.php:235 BOMListing.php:51 +#: AgedSuppliers.php:108 AgedSuppliers.php:190 BOMExtendedQty.php:162 +#: BOMExtendedQty.php:259 BOMIndented.php:153 BOMIndented.php:239 +#: BOMIndentedReverse.php:154 BOMIndentedReverse.php:232 BOMListing.php:51 #: Credit_Invoice.php:185 DebtorsAtPeriodEnd.php:61 DebtorsAtPeriodEnd.php:73 #: FTP_RadioBeacon.php:188 GetStockImage.php:154 GLBalanceSheet.php:93 #: GLBalanceSheet.php:131 GLBalanceSheet.php:294 GLProfit_Loss.php:160 @@ -791,7 +791,7 @@ #: MRPReport.php:52 MRPReport.php:150 MRPReschedules.php:49 #: MRPReschedules.php:61 MRPShortages.php:148 MRPShortages.php:160 #: OutstandingGRNs.php:54 OutstandingGRNs.php:66 PcReportTab.php:236 -#: PDFCustomerList.php:235 PDFCustomerList.php:247 PDFGrn.php:124 +#: PDFCustomerList.php:235 PDFCustomerList.php:247 PDFGrn.php:123 #: PDFLowGP.php:63 PDFLowGP.php:75 PDFPriceList.php:124 PDFQuotation.php:234 #: PDFQuotationPortrait.php:235 PDFRemittanceAdvice.php:84 #: PDFStockCheckComparison.php:39 PDFStockCheckComparison.php:65 @@ -823,7 +823,7 @@ msgid "The details of outstanding transactions for customer" msgstr "Podrobnosti o nesplacených transakcí pro zákazníka" -#: AgedDebtors.php:367 AgedSuppliers.php:189 GLAccountCSV.php:169 +#: AgedDebtors.php:367 AgedSuppliers.php:189 GLAccountCSV.php:167 #: GLAccountInquiry.php:145 GLAccountReport.php:93 PO_Items.php:471 #: PO_Items.php:605 PO_Items.php:632 SalesAnalReptCols.php:356 #: SpecialOrder.php:369 StockLocTransferReceive.php:373 @@ -835,9 +835,9 @@ #: ConfirmDispatch_Invoice.php:152 ConfirmDispatch_Invoice.php:969 #: ConfirmDispatch_Invoice.php:983 Contracts.php:581 CounterSales.php:1323 #: CounterSales.php:1337 Credit_Invoice.php:706 Credit_Invoice.php:728 -#: CustomerReceipt.php:526 CustomerReceipt.php:658 CustomerReceipt.php:686 +#: CustomerReceipt.php:523 CustomerReceipt.php:655 CustomerReceipt.php:683 #: CustomerTransInquiry.php:79 DeliveryDetails.php:395 GLProfit_Loss.php:578 -#: GLTagProfit_Loss.php:490 Payments.php:307 PDFRemittanceAdvice.php:86 +#: GLTagProfit_Loss.php:490 Payments.php:308 PDFRemittanceAdvice.php:86 #: PurchData.php:89 PurchData.php:108 PurchData.php:244 ReverseGRN.php:191 #: ReverseGRN.php:205 ReverseGRN.php:366 SelectCreditItems.php:1381 #: SelectSalesOrder.php:113 SelectSalesOrder.php:281 StockCheck.php:225 @@ -855,7 +855,7 @@ #: includes/PDFPaymentRun_PymtFooter.php:118 #: includes/PDFPaymentRun_PymtFooter.php:154 #: includes/PDFPaymentRun_PymtFooter.php:185 includes/ConnectDB_mysqli.inc:79 -#: includes/ConnectDB_mysql.inc:68 +#: includes/ConnectDB_mysql.inc:64 msgid "The SQL that failed was" msgstr "SQL příkaz, který selhal, byl" @@ -911,8 +911,8 @@ msgid "Detailed Report" msgstr "Podrobná zpráva" -#: AgedDebtors.php:520 AgedSuppliers.php:320 BOMExtendedQty.php:300 -#: BOMIndented.php:278 BOMIndentedReverse.php:266 BOMListing.php:142 +#: AgedDebtors.php:520 AgedSuppliers.php:320 BOMExtendedQty.php:286 +#: BOMIndented.php:268 BOMIndentedReverse.php:255 BOMListing.php:142 #: DebtorsAtPeriodEnd.php:166 InventoryPlanning.php:442 #: InventoryPlanningPrefSupplier.php:518 InventoryQuantities.php:188 #: InventoryValuation.php:242 MRPPlannedPurchaseOrders.php:282 @@ -1044,7 +1044,7 @@ msgstr "Kód oblasti" #: Areas.php:133 CustomerTypes.php:166 Factors.php:142 -#: FixedAssetCategories.php:137 GLAccounts.php:208 Locations.php:328 +#: FixedAssetCategories.php:136 GLAccounts.php:208 Locations.php:328 #: MRPDemands.php:248 PcAssignCashToTab.php:118 PcClaimExpensesFromTab.php:109 #: PcExpenses.php:137 PcExpensesTypeTab.php:86 PcTabs.php:124 #: PcTypeTabs.php:137 SalesAnalReptCols.php:215 SalesCategories.php:139 @@ -1073,12 +1073,12 @@ msgid "Incorrect date format used, please re-enter" msgstr "Nesprávné datum používaného formátu, prosím, re-zadání" -#: AuditTrail.php:37 BOMIndented.php:317 BOMIndentedReverse.php:305 +#: AuditTrail.php:37 BOMIndented.php:307 BOMIndentedReverse.php:294 #: MRPCalendar.php:260 msgid "From Date" msgstr "Od data" -#: AuditTrail.php:39 BOMIndented.php:318 BOMIndentedReverse.php:306 +#: AuditTrail.php:39 BOMIndented.php:308 BOMIndentedReverse.php:295 #: MRPCalendar.php:262 msgid "To Date" msgstr "To Date" @@ -1091,7 +1091,7 @@ #: AuditTrail.php:56 msgid "Table " -msgstr "Tabulka" +msgstr "Tabulka " #: AuditTrail.php:68 MRPReport.php:789 PO_SelectPurchOrder.php:363 #: SelectContract.php:196 SelectProduct.php:727 @@ -1110,7 +1110,7 @@ #: CustomerAllocations.php:356 CustomerInquiry.php:189 #: CustomerTransInquiry.php:21 CustomerTransInquiry.php:85 #: CustWhereAlloc.php:18 CustWhereAlloc.php:87 DailyBankTransactions.php:99 -#: GLAccountInquiry.php:152 GLAccountReport.php:367 GLJournal.php:256 +#: GLAccountInquiry.php:152 GLAccountReport.php:367 GLJournal.php:241 #: MRPReschedules.php:204 SelectCustomer.php:463 ShipmentCosting.php:501 #: ShipmentCosting.php:572 StockCategories.php:219 StockLocMovements.php:83 #: StockMovements.php:97 SupplierAllocations.php:462 SupplierInquiry.php:193 @@ -1224,7 +1224,7 @@ msgid "The SQL used to retrieve the bank account details was" msgstr "SQL používá k načtení údaje o bankovním účtu bylo" -#: BankAccounts.php:196 GLJournal.php:280 +#: BankAccounts.php:196 GLJournal.php:265 msgid "GL Account Code" msgstr "GL kódu účtu" @@ -1244,7 +1244,7 @@ msgid "Bank Address" msgstr "Adresa banky" -#: BankAccounts.php:201 CustomerReceipt.php:756 CustomerTransInquiry.php:95 +#: BankAccounts.php:201 CustomerReceipt.php:753 CustomerTransInquiry.php:95 #: OffersReceived.php:98 PcReportTab.php:291 PcTabs.php:147 PcTabs.php:295 #: PDFPrintLabel.php:94 PO_AuthorisationLevels.php:125 #: PO_AuthorisationLevels.php:180 PO_AuthorisationLevels.php:183 @@ -1335,8 +1335,8 @@ "účtu. Zkontrolujte, zda vaše bankovní výpis a klikněte na check-box, když " "zjistíte, odpovídající transakce." -#: BankMatching.php:80 BankReconciliation.php:97 CustomerReceipt.php:729 -#: DailyBankTransactions.php:28 Payments.php:732 PDFChequeListing.php:46 +#: BankMatching.php:80 BankReconciliation.php:97 CustomerReceipt.php:726 +#: DailyBankTransactions.php:28 Payments.php:733 PDFChequeListing.php:46 #: TaxAuthorities.php:150 TaxAuthorities.php:306 msgid "Bank Account" msgstr "Bankovní účet" @@ -1354,7 +1354,7 @@ #: BankMatching.php:105 ConfirmDispatchControlled_Invoice.php:59 #: EmailCustTrans.php:65 FixedAssetRegister.php:78 FTP_RadioBeacon.php:281 -#: GLAccountCSV.php:172 GLAccountReport.php:102 Payments.php:712 +#: GLAccountCSV.php:170 GLAccountReport.php:102 Payments.php:713 #: PcReportTab.php:105 PDFChequeListing.php:108 PDFChequeListing.php:118 #: PDFChequeListing.php:205 PDFDeliveryDifferences.php:166 #: PDFDeliveryDifferences.php:179 PDFDeliveryDifferences.php:287 @@ -1466,9 +1466,9 @@ msgstr "Ref" #: BankMatching.php:224 ConfirmDispatch_Invoice.php:279 Credit_Invoice.php:280 -#: CustomerAllocations.php:359 CustomerReceipt.php:845 +#: CustomerAllocations.php:359 CustomerReceipt.php:842 #: CustomerTransInquiry.php:94 CustWhereAlloc.php:91 PaymentAllocations.php:78 -#: Payments.php:925 Payments.php:927 Payments.php:936 +#: Payments.php:926 Payments.php:928 Payments.php:937 #: PcAssignCashToTab.php:214 PcAssignCashToTab.php:335 #: PcAuthorizeExpenses.php:83 PcClaimExpensesFromTab.php:193 #: PcClaimExpensesFromTab.php:342 PcReportTab.php:175 PcReportTab.php:347 @@ -1548,26 +1548,26 @@ msgid "The bank accounts could not be retrieved by the SQL because" msgstr "Bankovní účty se nepodařilo získat na SQL, protože" -#: BankReconciliation.php:94 CustomerReceipt.php:720 -#: DailyBankTransactions.php:25 Payments.php:729 SuppPaymentRun.php:302 +#: BankReconciliation.php:94 CustomerReceipt.php:717 +#: DailyBankTransactions.php:25 Payments.php:730 SuppPaymentRun.php:302 msgid "The SQL used to retrieve the bank accounts was" msgstr "SQL slouží k získání bankovní účty byly" -#: BankReconciliation.php:100 CustomerReceipt.php:734 +#: BankReconciliation.php:100 CustomerReceipt.php:731 msgid "Bank Accounts have not yet been defined" msgstr "Bankovní účty dosud nebyly definovány" -#: BankReconciliation.php:100 CustomerReceipt.php:734 +#: BankReconciliation.php:100 CustomerReceipt.php:731 msgid "You must first" msgstr "Musíte nejprve" -#: BankReconciliation.php:100 CustomerReceipt.php:734 -#: DailyBankTransactions.php:32 Payments.php:736 SuppPaymentRun.php:310 +#: BankReconciliation.php:100 CustomerReceipt.php:731 +#: DailyBankTransactions.php:32 Payments.php:737 SuppPaymentRun.php:310 msgid "define the bank accounts" msgstr "definovat bankovních účtů" -#: BankReconciliation.php:100 CustomerReceipt.php:734 -#: DailyBankTransactions.php:32 Payments.php:736 SuppPaymentRun.php:310 +#: BankReconciliation.php:100 CustomerReceipt.php:731 +#: DailyBankTransactions.php:32 Payments.php:737 SuppPaymentRun.php:310 msgid "and general ledger accounts to be affected" msgstr "a účtů hlavní knihy mohly být postiženy" @@ -1672,7 +1672,7 @@ "zůstatek na účtu. Je důležité, že směnný kurz výše odráží současnou hodnotu " "měny bankovního účtu" -#: BankReconciliation.php:311 CounterSales.php:781 Customers.php:1014 +#: BankReconciliation.php:311 CounterSales.php:781 Customers.php:1004 #: SelectOrderItems.php:1369 Stocks.php:1031 WorkOrderCosting.php:512 #: WorkOrderEntry.php:547 msgid "Are You Sure?" @@ -1703,41 +1703,41 @@ msgid "Match off cleared deposits" msgstr "Utkání vypnutí vymazány vklady" -#: BOMExtendedQty.php:14 BOMExtendedQty.php:15 BOMExtendedQty.php:156 -#: BOMExtendedQty.php:283 +#: BOMExtendedQty.php:12 BOMExtendedQty.php:13 BOMExtendedQty.php:159 +#: BOMExtendedQty.php:269 msgid "Quantity Extended BOM Listing" msgstr "Množství Rozšířené kusovníku Výpis" -#: BOMExtendedQty.php:34 BOMIndentedReverse.php:30 MRPCalendar.php:87 +#: BOMExtendedQty.php:32 BOMIndentedReverse.php:29 MRPCalendar.php:87 #: MRP.php:29 SalesInquiry.php:1191 msgid "The SQL to to create passbom failed with the message" msgstr "SQL k vytvoření passbom nepodařilo se zprávou" -#: BOMExtendedQty.php:47 BOMIndented.php:42 BOMIndentedReverse.php:43 +#: BOMExtendedQty.php:45 BOMIndented.php:40 BOMIndentedReverse.php:42 #: MRP.php:36 msgid "Create of tempbom failed because" msgstr "Vytvořit z tempbom se nezdařila, protože" -#: BOMExtendedQty.php:158 +#: BOMExtendedQty.php:161 msgid "" "The Quantiy Extended BOM Listing could not be retrieved by the SQL because" msgstr "Quantiy Rozšířená rozpisky Výpis se nepodařilo získat na SQL, protože" -#: BOMExtendedQty.php:260 BOMIndented.php:235 +#: BOMExtendedQty.php:256 BOMIndented.php:236 msgid "Print Indented BOM Listing Error" msgstr "Tisk Odsazené kusovníku výpis chyby" -#: BOMExtendedQty.php:262 BOMIndented.php:237 +#: BOMExtendedQty.php:258 BOMIndented.php:238 msgid "There were no items for the selected assembly" msgstr "Nebyly zjištěny žádné položky pro vybraný montáž" -#: BOMExtendedQty.php:290 BOMIndented.php:266 BOMIndentedReverse.php:260 +#: BOMExtendedQty.php:276 BOMIndented.php:256 BOMIndentedReverse.php:249 msgid "Part" msgstr "Část" -#: BOMExtendedQty.php:291 BOMExtendedQty.php:342 BOMExtendedQty.php:343 -#: BOMExtendedQty.php:344 BOMExtendedQty.php:345 BOMIndented.php:316 -#: BOMIndentedReverse.php:304 BOMInquiry.php:173 BOMs.php:521 BOMs.php:678 +#: BOMExtendedQty.php:277 BOMExtendedQty.php:328 BOMExtendedQty.php:329 +#: BOMExtendedQty.php:330 BOMExtendedQty.php:331 BOMIndented.php:306 +#: BOMIndentedReverse.php:293 BOMInquiry.php:173 BOMs.php:521 BOMs.php:678 #: ContractBOM.php:243 ContractBOM.php:347 ContractCosting.php:74 #: ContractCosting.php:80 ContractCosting.php:131 ContractOtherReqts.php:95 #: Contracts.php:932 Contracts.php:956 CounterSales.php:701 @@ -1785,41 +1785,41 @@ msgid "Quantity" msgstr "Množství" -#: BOMExtendedQty.php:292 +#: BOMExtendedQty.php:278 msgid "Selection Option" msgstr "Možnost výběru" -#: BOMExtendedQty.php:293 +#: BOMExtendedQty.php:279 msgid "Show All Parts" msgstr "Zobrazit všechny díly" -#: BOMExtendedQty.php:294 +#: BOMExtendedQty.php:280 msgid "Only Show Shortages" msgstr "Zobrazit pouze Nedostatky" -#: BOMExtendedQty.php:296 BOMIndented.php:274 BOMIndentedReverse.php:262 +#: BOMExtendedQty.php:282 BOMIndented.php:264 BOMIndentedReverse.php:251 #: MRPPlannedPurchaseOrders.php:276 MRPPlannedWorkOrders.php:339 #: MRPReschedules.php:156 MRPShortages.php:255 msgid "Print Option" msgstr "Možnost tisku" -#: BOMExtendedQty.php:297 BOMIndented.php:275 BOMIndentedReverse.php:263 +#: BOMExtendedQty.php:283 BOMIndented.php:265 BOMIndentedReverse.php:252 #: MRPPlannedPurchaseOrders.php:277 MRPPlannedWorkOrders.php:340 #: MRPReschedules.php:157 MRPShortages.php:256 msgid "Print With Alternating Highlighted Lines" msgstr "Tisk se střídavými Zvýrazněné Lines" -#: BOMExtendedQty.php:298 BOMIndented.php:276 BOMIndentedReverse.php:264 +#: BOMExtendedQty.php:284 BOMIndented.php:266 BOMIndentedReverse.php:253 #: MRPPlannedPurchaseOrders.php:278 MRPPlannedWorkOrders.php:341 #: MRPReschedules.php:158 MRPShortages.php:257 msgid "Plain Print" msgstr "Prostý Tisk" -#: BOMExtendedQty.php:322 +#: BOMExtendedQty.php:308 msgid "Extended Quantity BOM Listing For " -msgstr "Rozšířená Množství kusovníku výpis" +msgstr "Rozšířená Množství kusovníku výpis " -#: BOMExtendedQty.php:324 BOMIndented.php:303 BOMIndentedReverse.php:291 +#: BOMExtendedQty.php:310 BOMIndented.php:293 BOMIndentedReverse.php:280 #: GLAccountReport.php:353 InventoryPlanningPrefSupplier.php:63 #: InventoryQuantities.php:210 MRPPlannedPurchaseOrders.php:305 #: MRPPlannedWorkOrders.php:367 MRPReport.php:826 MRPReschedules.php:190 @@ -1855,7 +1855,7 @@ msgid "Printed" msgstr "Vytištěno" -#: BOMExtendedQty.php:325 BOMIndented.php:304 BOMIndentedReverse.php:292 +#: BOMExtendedQty.php:311 BOMIndented.php:294 BOMIndentedReverse.php:281 #: FixedAssetRegister.php:334 GLAccountReport.php:353 #: InventoryPlanningPrefSupplier.php:63 InventoryQuantities.php:211 #: MRPPlannedPurchaseOrders.php:306 MRPPlannedWorkOrders.php:368 @@ -1910,15 +1910,15 @@ msgid "Page" msgstr "Stránky" -#: BOMExtendedQty.php:327 +#: BOMExtendedQty.php:313 msgid "Build Quantity: " -msgstr "Budovat Množství:" +msgstr "Budovat Množství: " -#: BOMExtendedQty.php:334 +#: BOMExtendedQty.php:320 msgid "Build" msgstr "Stavět" -#: BOMExtendedQty.php:335 BOMInquiry.php:94 BOMs.php:811 CounterSales.php:1990 +#: BOMExtendedQty.php:321 BOMInquiry.php:94 BOMs.php:811 CounterSales.php:1990 #: CounterSales.php:2170 PO_SelectOSPurchOrder.php:214 #: PO_SelectPurchOrder.php:179 ReorderLevelLocation.php:58 #: ReorderLevelLocation.php:59 SelectCompletedOrder.php:536 @@ -1928,15 +1928,15 @@ msgid "On Hand" msgstr "Na ruce" -#: BOMExtendedQty.php:336 +#: BOMExtendedQty.php:322 msgid "P.O." msgstr "PO" -#: BOMExtendedQty.php:337 +#: BOMExtendedQty.php:323 msgid "W.O." msgstr "WO" -#: BOMExtendedQty.php:339 BOMIndented.php:311 BOMIndentedReverse.php:299 +#: BOMExtendedQty.php:325 BOMIndented.php:301 BOMIndentedReverse.php:288 #: InventoryQuantities.php:221 MRPDemands.php:289 MRPDemands.php:361 #: MRPDemands.php:368 MRPPlannedPurchaseOrders.php:323 #: MRPPlannedWorkOrders.php:385 MRPReschedules.php:201 MRPShortages.php:253 @@ -1951,52 +1951,52 @@ msgid "Part Number" msgstr "Číslo dílu" -#: BOMExtendedQty.php:340 BOMIndented.php:312 BOMIndentedReverse.php:300 +#: BOMExtendedQty.php:326 BOMIndented.php:302 BOMIndentedReverse.php:289 #: MRPShortages.php:300 msgid "M/B" msgstr "M / B" -#: BOMExtendedQty.php:341 POReport.php:543 POReport.php:604 POReport.php:670 +#: BOMExtendedQty.php:327 POReport.php:543 POReport.php:604 POReport.php:670 #: POReport.php:1231 POReport.php:1282 POReport.php:1336 SalesInquiry.php:815 #: SalesInquiry.php:833 SalesInquiry.php:932 Stocks.php:647 Stocks.php:654 msgid "Part Description" msgstr "Popis části" -#: BOMExtendedQty.php:346 MRPShortages.php:304 +#: BOMExtendedQty.php:332 MRPShortages.php:304 msgid "Shortage" msgstr "Nedostatek" -#: BOMIndented.php:14 BOMIndented.php:15 BOMIndented.php:149 -#: BOMIndented.php:259 BOMIndented.php:302 BOMIndentedReverse.php:15 -#: BOMIndentedReverse.php:16 BOMIndentedReverse.php:148 +#: BOMIndented.php:12 BOMIndented.php:13 BOMIndented.php... [truncated message content] |
From: <dai...@us...> - 2011-03-31 08:32:35
|
Revision: 4527 http://web-erp.svn.sourceforge.net/web-erp/?rev=4527&view=rev Author: daintree Date: 2011-03-31 08:32:24 +0000 (Thu, 31 Mar 2011) Log Message: ----------- updated languages Modified Paths: -------------- trunk/GLProfit_Loss.php trunk/GLTagProfit_Loss.php trunk/build/make_release.sh trunk/doc/Change.log.html trunk/includes/session.inc trunk/locale/cs_CZ.utf8/LC_MESSAGES/messages.mo trunk/locale/cs_CZ.utf8/LC_MESSAGES/messages.po trunk/locale/de_DE.utf8/LC_MESSAGES/messages.mo trunk/locale/de_DE.utf8/LC_MESSAGES/messages.po trunk/locale/el_GR.utf8/LC_MESSAGES/messages.mo trunk/locale/el_GR.utf8/LC_MESSAGES/messages.po trunk/locale/en_GB.utf8/LC_MESSAGES/messages.pot trunk/locale/en_US.utf8/LC_MESSAGES/messages.mo trunk/locale/en_US.utf8/LC_MESSAGES/messages.po trunk/locale/es_ES.utf8/LC_MESSAGES/messages.mo trunk/locale/es_ES.utf8/LC_MESSAGES/messages.po trunk/locale/et_EE.utf8/LC_MESSAGES/messages.mo trunk/locale/et_EE.utf8/LC_MESSAGES/messages.po trunk/locale/fa_IR.utf8/LC_MESSAGES/messages.mo trunk/locale/fa_IR.utf8/LC_MESSAGES/messages.po trunk/locale/fr_FR.utf8/LC_MESSAGES/messages.mo trunk/locale/fr_FR.utf8/LC_MESSAGES/messages.po trunk/locale/hi_IN.utf8/LC_MESSAGES/messages.mo trunk/locale/hi_IN.utf8/LC_MESSAGES/messages.po trunk/locale/hr_HR.utf8/LC_MESSAGES/messages.mo trunk/locale/hr_HR.utf8/LC_MESSAGES/messages.po trunk/locale/hu_HU.utf8/LC_MESSAGES/messages.mo trunk/locale/hu_HU.utf8/LC_MESSAGES/messages.po trunk/locale/id_ID.utf8/LC_MESSAGES/messages.mo trunk/locale/id_ID.utf8/LC_MESSAGES/messages.po trunk/locale/it_IT.utf8/LC_MESSAGES/messages.mo trunk/locale/it_IT.utf8/LC_MESSAGES/messages.po trunk/locale/ja_JP.utf8/LC_MESSAGES/messages.mo trunk/locale/ja_JP.utf8/LC_MESSAGES/messages.po trunk/locale/lv_LV.utf8/LC_MESSAGES/messages.mo trunk/locale/lv_LV.utf8/LC_MESSAGES/messages.po trunk/locale/nl_NL.utf8/LC_MESSAGES/messages.mo trunk/locale/nl_NL.utf8/LC_MESSAGES/messages.po trunk/locale/pl_PL.utf8/LC_MESSAGES/messages.mo trunk/locale/pl_PL.utf8/LC_MESSAGES/messages.po trunk/locale/pt_BR.utf8/LC_MESSAGES/messages.mo trunk/locale/pt_BR.utf8/LC_MESSAGES/messages.po trunk/locale/pt_PT.utf8/LC_MESSAGES/messages.mo trunk/locale/pt_PT.utf8/LC_MESSAGES/messages.po trunk/locale/ro_RO.utf8/LC_MESSAGES/messages.mo trunk/locale/ro_RO.utf8/LC_MESSAGES/messages.po trunk/locale/ru_RU.utf8/LC_MESSAGES/messages.mo trunk/locale/ru_RU.utf8/LC_MESSAGES/messages.po trunk/locale/sq_AL.utf8/LC_MESSAGES/messages.mo trunk/locale/sq_AL.utf8/LC_MESSAGES/messages.po trunk/locale/sv_SE.utf8/LC_MESSAGES/messages.mo trunk/locale/sv_SE.utf8/LC_MESSAGES/messages.po trunk/locale/sw_KE.utf8/LC_MESSAGES/messages.mo trunk/locale/sw_KE.utf8/LC_MESSAGES/messages.po trunk/locale/tr_TR.utf8/LC_MESSAGES/messages.mo trunk/locale/tr_TR.utf8/LC_MESSAGES/messages.po trunk/locale/zh_CN.utf8/LC_MESSAGES/messages.mo trunk/locale/zh_CN.utf8/LC_MESSAGES/messages.po trunk/sql/mysql/weberp-demo.sql trunk/sql/mysql/weberp-new.sql Added Paths: ----------- trunk/locale/vi_VN.utf8/ trunk/locale/vi_VN.utf8/LC_MESSAGES/ trunk/locale/vi_VN.utf8/LC_MESSAGES/messages.mo trunk/locale/vi_VN.utf8/LC_MESSAGES/messages.po Modified: trunk/GLProfit_Loss.php =================================================================== --- trunk/GLProfit_Loss.php 2011-03-30 09:06:33 UTC (rev 4526) +++ trunk/GLProfit_Loss.php 2011-03-31 08:32:24 UTC (rev 4527) @@ -2,8 +2,6 @@ /* $Id$*/ -//$PageSecurity = 8; - include ('includes/session.inc'); $title = _('Profit and Loss'); include('includes/SQL_CommonFunctions.inc'); @@ -19,11 +17,11 @@ include('includes/header.inc'); echo '<p class="page_title_text"><img src="'.$rootpath.'/css/'.$theme.'/images/printer.png" title="' . _('Print') . '" alt="" />' . ' ' . _('Print Profit and Loss Report') . '</p>'; -echo '<div class="page_help_text">' . _('Profit and loss statement (P&L), also called an Income Statment, or Statement of Operations, this is the statement that indicates how the revenue (money received from the sale of products and services before expenses are taken out, also known as the "top line") is transformed into the net income (the result after all revenues and expenses have been accounted for, also known as the "bottom line").') . '<br>' -. _('The purpose of the income statement is to show whether the company made or lost money during the period being reported.') . '<br>' -. _('The P&L represents a period of time. This contrasts with the Balance Sheet, which represents a single moment in time.') . '<br>' +echo '<div class="page_help_text">' . _('Profit and loss statement (P&L), also called an Income Statment, or Statement of Operations, this is the statement that indicates how the revenue (money received from the sale of products and services before expenses are taken out, also known as the "top line") is transformed into the net income (the result after all revenues and expenses have been accounted for, also known as the "bottom line").') . '<br />' +. _('The purpose of the income statement is to show whether the company made or lost money during the period being reported.') . '<br />' +. _('The P&L represents a period of time. This contrasts with the Balance Sheet, which represents a single moment in time.') . '<br />' . _('webERP is an "accrual" based system (not a "cash based" system). Accrual systems include items when they are invoiced to the customer, and when expenses are owed based on the supplier invoice date.') . '</div>'; - 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 (Date('m') > $_SESSION['YearEnd']){ @@ -37,32 +35,34 @@ $period=GetPeriod($FromDate, $db); /*Show a form to allow input of criteria for profit and loss to show */ - echo '<p><table class="selection"><tr><td>'._('Select Period From').":</td><td><select Name='FromPeriod'>"; + echo '<p><table class="selection"> + <tr><td>' . _('Select Period From') . ':</td> + <td><select Name="FromPeriod">'; - $sql = "SELECT periodno, lastdate_in_period FROM periods ORDER BY periodno DESC"; + $sql = 'SELECT periodno, lastdate_in_period FROM periods ORDER BY periodno DESC'; $Periods = DB_query($sql,$db); while ($myrow=DB_fetch_array($Periods,$db)){ if(isset($_POST['FromPeriod']) AND $_POST['FromPeriod']!=''){ if( $_POST['FromPeriod']== $myrow['periodno']){ - echo '<option selected VALUE=' . $myrow['periodno'] . '>' .MonthAndYearFromSQLDate($myrow['lastdate_in_period']); + echo '<option selected VALUE=' . $myrow['periodno'] . '>' .MonthAndYearFromSQLDate($myrow['lastdate_in_period']) . '</option>'; } else { - echo '<option VALUE=' . $myrow['periodno'] . '>' . MonthAndYearFromSQLDate($myrow['lastdate_in_period']); + echo '<option VALUE=' . $myrow['periodno'] . '>' . MonthAndYearFromSQLDate($myrow['lastdate_in_period']) . '</option>'; } } else { if($myrow['lastdate_in_period']==$DefaultFromDate){ - echo '<option selected VALUE=' . $myrow['periodno'] . '>' . MonthAndYearFromSQLDate($myrow['lastdate_in_period']); + echo '<option selected VALUE=' . $myrow['periodno'] . '>' . MonthAndYearFromSQLDate($myrow['lastdate_in_period']) . '</option>'; } else { - 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>'; if (!isset($_POST['ToPeriod']) OR $_POST['ToPeriod']==''){ - $lastDate = date("Y-m-d",mktime(0,0,0,Date('m')+1,0,Date('Y'))); - $sql = "SELECT periodno FROM periods where lastdate_in_period = '" . $lastDate . "'"; + $LastDate = date('Y-m-d',mktime(0,0,0,Date('m')+1,0,Date('Y'))); + $sql = "SELECT periodno FROM periods where lastdate_in_period = '" . $LastDate . "'"; $MaxPrd = DB_query($sql,$db); $MaxPrdrow = DB_fetch_row($MaxPrd); $DefaultToPeriod = (int) ($MaxPrdrow[0]); @@ -71,29 +71,29 @@ $DefaultToPeriod = $_POST['ToPeriod']; } - echo '<tr><td>' . _('Select Period To') . ":</td><td><select Name='ToPeriod'>"; + echo '<tr><td>' . _('Select Period To') . ':</td><td><select Name="ToPeriod">'; $RetResult = DB_data_seek($Periods,0); while ($myrow=DB_fetch_array($Periods,$db)){ if($myrow['periodno']==$DefaultToPeriod){ - echo '<option selected VALUE=' . $myrow['periodno'] . '>' . MonthAndYearFromSQLDate($myrow['lastdate_in_period']); + echo '<option selected VALUE=' . $myrow['periodno'] . '>' . MonthAndYearFromSQLDate($myrow['lastdate_in_period']) . '</option>'; } else { - 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>'; echo '<tr><td>'._('Detail Or Summary').":</td><td><select Name='Detail'>"; - echo "<option selected VALUE='Summary'>"._('Summary'); - echo "<option selected VALUE='Detailed'>"._('All Accounts'); + echo '<option selected VALUE="Summary">'._('Summary') . '</option>'; + echo '<option selected VALUE="Detailed">'._('All Accounts') . '</option>'; echo '</select></td></tr>'; echo '</table>'; - echo "<br><div class='centre'><input type=submit Name='ShowPL' Value='"._('Show on Screen (HTML)')."'></div>"; - echo "<br><div class='centre'><input type=submit Name='PrintPDF' Value='"._('Produce PDF Report')."'></div>"; + echo "<br /><div class='centre'><input type=submit Name='ShowPL' Value='"._('Show on Screen (HTML)')."'></div>"; + echo "<br /><div class='centre'><input type=submit Name='PrintPDF' Value='"._('Produce PDF Report')."'></div>"; /*Now do the posting while the user is thinking about the period to select */ @@ -119,7 +119,7 @@ exit; } - $sql = 'SELECT lastdate_in_period FROM periods WHERE periodno=' . $_POST['ToPeriod']; + $sql = "SELECT lastdate_in_period FROM periods WHERE periodno='" . $_POST['ToPeriod'] . "'"; $PrdResult = DB_query($sql, $db); $myrow = DB_fetch_row($PrdResult); $PeriodToDate = MonthAndYearFromSQLDate($myrow[0]); @@ -157,9 +157,9 @@ $title = _('Profit and Loss') . ' - ' . _('Problem Report') . '....'; include('includes/header.inc'); prnMsg( _('No general ledger accounts were returned by the SQL 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?' . SID . '">'. _('Back to the menu'). '</a>'; if ($debug == 1){ - echo '<br>'. $SQL; + echo '<br />'. $SQL; } include('includes/footer.inc'); exit; @@ -169,7 +169,7 @@ include('includes/header.inc'); echo '<p>'; prnMsg( _('There were no entries to print out for the selections specified'),'warn' ); - 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>'; include('includes/footer.inc'); exit; } @@ -529,9 +529,10 @@ } else { 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'] . '" />'; - echo "<input type=hidden name='FromPeriod' VALUE=" . $_POST['FromPeriod'] . "><input type=hidden name='ToPeriod' VALUE=" . $_POST['ToPeriod'] . '>'; + echo "<input type=hidden name='FromPeriod' VALUE=" . $_POST['FromPeriod'] . "> + <input type=hidden name='ToPeriod' VALUE=" . $_POST['ToPeriod'] . '>'; $NumberOfMonths = $_POST['ToPeriod'] - $_POST['FromPeriod'] + 1; @@ -585,20 +586,20 @@ echo '<table cellpadding=2 class=selection>'; if ($_POST['Detail']=='Detailed'){ - $TableHeader = "<tr> - <th>"._('Account')."</th> - <th>"._('Account Name')."</th> - <th colspan=2>"._('Period Actual')."</th> - <th colspan=2>"._('Period Budget')."</th> - <th colspan=2>"._('Last Year')."</th> - </tr>"; + $TableHeader = '<tr> + <th>' . _('Account') . '</th> + <th>'._('Account Name') .'</th> + <th colspan=2>' . _('Period Actual') .'</th> + <th colspan=2>' . _('Period Budget') .'</th> + <th colspan=2>' . _('Last Year') . '</th> + </tr>'; } else { /*summary */ - $TableHeader = "<tr> - <th colspan=2></th> - <th colspan=2>"._('Period Actual')."</th> - <th colspan=2>"._('Period Budget')."</th> - <th colspan=2>"._('Last Year')."</th> - </tr>"; + $TableHeader = '<tr> + <th colspan=2></th> + <th colspan=2>' . _('Period Actual') .'</th> + <th colspan=2>' . _('Period Budget') . '</th> + <th colspan=2>' . _('Last Year') . '</th> + </tr>'; } @@ -893,7 +894,7 @@ $k++; } - $ActEnquiryURL = "<a href='$rootpath/GLAccountInquiry.php?" . SID . '&Period=' . $_POST['ToPeriod'] . '&Account=' . $myrow['accountcode'] . "&Show=Yes'>" . $myrow['accountcode'] . '<a>'; + $ActEnquiryURL = '<a href="' . $rootpath . '/GLAccountInquiry.php?Period=' . $_POST['ToPeriod'] . '&Account=' . $myrow['accountcode'] . '&Show=Yes">' . $myrow['accountcode'] . '</a>'; if ($Section ==1){ printf('<td>%s</td> @@ -1206,7 +1207,7 @@ </tr>'; echo '</table>'; - echo "<br><div class='centre'><input type=submit Name='SelectADifferentPeriod' Value='"._('Select A Different Period')."'></div>"; + echo '<br /><div class="centre"><input type="submit" name="SelectADifferentPeriod" Value="' . _('Select A Different Period') . '"></div>'; } echo '</form>'; include('includes/footer.inc'); Modified: trunk/GLTagProfit_Loss.php =================================================================== --- trunk/GLTagProfit_Loss.php 2011-03-30 09:06:33 UTC (rev 4526) +++ trunk/GLTagProfit_Loss.php 2011-03-31 08:32:24 UTC (rev 4527) @@ -2,8 +2,6 @@ /* $Id$*/ -//$PageSecurity = 8; - include ('includes/session.inc'); $title = _('Income and Expenditure by Tag'); include('includes/SQL_CommonFunctions.inc'); @@ -18,7 +16,7 @@ if ((!isset($_POST['FromPeriod']) AND !isset($_POST['ToPeriod'])) OR isset($_POST['SelectADifferentPeriod'])){ 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'] . '" />'; echo '<p class="page_title_text"><img src="'.$rootpath.'/css/'.$theme.'/images/printer.png" title="' . _('Print') . '" alt="" />' . ' ' . $title . '</p>'; @@ -34,7 +32,7 @@ $period=GetPeriod($FromDate, $db); /*Show a form to allow input of criteria for profit and loss to show */ - echo '<table class=selection><tr><td>'._('Select Period From').":</td><td><select Name='FromPeriod'>"; + echo '<table class=selection><tr><td>' . _('Select Period From') . ':</td><td><select Name="FromPeriod">'; $sql = 'SELECT periodno, lastdate_in_period FROM periods ORDER BY periodno DESC'; $Periods = DB_query($sql,$db); @@ -43,22 +41,22 @@ while ($myrow=DB_fetch_array($Periods,$db)){ if(isset($_POST['FromPeriod']) AND $_POST['FromPeriod']!=''){ if( $_POST['FromPeriod']== $myrow['periodno']){ - echo '<option selected VALUE=' . $myrow['periodno'] . '>' .MonthAndYearFromSQLDate($myrow['lastdate_in_period']); + echo '<option selected VALUE=' . $myrow['periodno'] . '>' .MonthAndYearFromSQLDate($myrow['lastdate_in_period']) . '</option>'; } else { - echo '<option VALUE=' . $myrow['periodno'] . '>' . MonthAndYearFromSQLDate($myrow['lastdate_in_period']); + echo '<option VALUE=' . $myrow['periodno'] . '>' . MonthAndYearFromSQLDate($myrow['lastdate_in_period']) . '</option>'; } } else { if($myrow['lastdate_in_period']==$DefaultFromDate){ - echo '<option selected VALUE=' . $myrow['periodno'] . '>' . MonthAndYearFromSQLDate($myrow['lastdate_in_period']); + echo '<option selected VALUE=' . $myrow['periodno'] . '>' . MonthAndYearFromSQLDate($myrow['lastdate_in_period']) . '</option>'; } else { - 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>'; if (!isset($_POST['ToPeriod']) OR $_POST['ToPeriod']==''){ - $lastDate = date("Y-m-d",mktime(0,0,0,Date('m')+1,0,Date('Y'))); + $lastDate = date('Y-m-d',mktime(0,0,0,Date('m')+1,0,Date('Y'))); $sql = "SELECT periodno FROM periods where lastdate_in_period = '$lastDate'"; $MaxPrd = DB_query($sql,$db); $MaxPrdrow = DB_fetch_row($MaxPrd); @@ -68,16 +66,16 @@ $DefaultToPeriod = $_POST['ToPeriod']; } - echo '<tr><td>' . _('Select Period To') . ":</td><td><select Name='ToPeriod'>"; + echo '<tr><td>' . _('Select Period To') . ':</td><td><select Name="ToPeriod">'; $RetResult = DB_data_seek($Periods,0); while ($myrow=DB_fetch_array($Periods,$db)){ if($myrow['periodno']==$DefaultToPeriod){ - echo '<option selected VALUE=' . $myrow['periodno'] . '>' . MonthAndYearFromSQLDate($myrow['lastdate_in_period']); + echo '<option selected VALUE=' . $myrow['periodno'] . '>' . MonthAndYearFromSQLDate($myrow['lastdate_in_period']) . '</option>'; } else { - 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>'; @@ -92,18 +90,18 @@ $result=DB_query($SQL,$db); echo '<option value=0>0 - None'; while ($myrow=DB_fetch_array($result)){ - if (isset($_POST['tag']) and $_POST['tag']==$myrow["tagref"]){ - echo '<option selected value=' . $myrow['tagref'] . '>' . $myrow['tagref'].' - ' .$myrow['tagdescription']; + if (isset($_POST['tag']) and $_POST['tag']==$myrow['tagref']){ + 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>'; // End select tag - echo '<tr><td>'._('Detail Or Summary').":</td><td><select Name='Detail'>"; - echo "<option selected VALUE='Summary'>"._('Summary'); - echo "<option selected VALUE='Detailed'>"._('All Accounts'); + echo '<tr><td>'._('Detail Or Summary').':</td><td><select Name="Detail">'; + echo '<option selected VALUE="Summary">'._('Summary') . '</option>'; + echo '<option selected VALUE="Detailed">'._('All Accounts') . '</option>'; echo '</select></td></tr>'; echo '</table><br>'; @@ -138,24 +136,24 @@ exit; } - $sql = 'SELECT lastdate_in_period FROM periods WHERE periodno=' . $_POST['ToPeriod']; + $sql = "SELECT lastdate_in_period FROM periods WHERE periodno='" . $_POST['ToPeriod'] . "'"; $PrdResult = DB_query($sql, $db); $myrow = DB_fetch_row($PrdResult); $PeriodToDate = MonthAndYearFromSQLDate($myrow[0]); - $SQL = 'SELECT accountgroups.sectioninaccounts, + $SQL = "SELECT accountgroups.sectioninaccounts, accountgroups.groupname, accountgroups.parentgroupname, gltrans.account , chartmaster.accountname, - Sum(CASE WHEN (gltrans.periodno>=' . $_POST['FromPeriod'] . ' and gltrans.periodno<=' . $_POST['ToPeriod'] . ') THEN gltrans.amount ELSE 0 END) AS TotalAllPeriods, - Sum(CASE WHEN (gltrans.periodno=' . $_POST['ToPeriod'] . ') THEN gltrans.amount ELSE 0 END) AS TotalThisPeriod + Sum(CASE WHEN (gltrans.periodno>='" . $_POST['FromPeriod'] . "' and gltrans.periodno<='" . $_POST['ToPeriod'] . "') THEN gltrans.amount ELSE 0 END) AS TotalAllPeriods, + Sum(CASE WHEN (gltrans.periodno='" . $_POST['ToPeriod'] . "') THEN gltrans.amount ELSE 0 END) AS TotalThisPeriod FROM chartmaster INNER JOIN accountgroups ON chartmaster.group_ = accountgroups.groupname INNER JOIN gltrans ON chartmaster.accountcode= gltrans.account WHERE accountgroups.pandl=1 - AND gltrans.tag='.$_POST['tag'].' + AND gltrans.tag='" . $_POST['tag'] . "' GROUP BY accountgroups.sectioninaccounts, accountgroups.groupname, accountgroups.parentgroupname, @@ -165,7 +163,7 @@ ORDER BY accountgroups.sectioninaccounts, accountgroups.sequenceintb, accountgroups.groupname, - gltrans.account'; + gltrans.account"; $AccountsResult = DB_query($SQL,$db); @@ -186,7 +184,7 @@ include('includes/header.inc'); echo '<p>'; prnMsg( _('There were no entries to print out for the selections specified'),'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; } @@ -444,9 +442,9 @@ } else { 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'] . '" />'; - echo "<input type=hidden name='FromPeriod' VALUE=" . $_POST['FromPeriod'] . "><input type=hidden name='ToPeriod' VALUE=" . $_POST['ToPeriod'] . '>'; + echo "<input type=hidden name='FromPeriod' VALUE=" . $_POST['FromPeriod'] . "><input type=hidden name='ToPeriod' VALUE=" . $_POST['ToPeriod'] . ' />'; $NumberOfMonths = $_POST['ToPeriod'] - $_POST['FromPeriod'] + 1; @@ -457,24 +455,24 @@ exit; } - $sql = 'SELECT lastdate_in_period FROM periods WHERE periodno=' . $_POST['ToPeriod']; + $sql = "SELECT lastdate_in_period FROM periods WHERE periodno='" . $_POST['ToPeriod'] . "'"; $PrdResult = DB_query($sql, $db); $myrow = DB_fetch_row($PrdResult); $PeriodToDate = MonthAndYearFromSQLDate($myrow[0]); - $SQL = 'SELECT accountgroups.sectioninaccounts, + $SQL = "SELECT accountgroups.sectioninaccounts, accountgroups.groupname, accountgroups.parentgroupname, gltrans.account , chartmaster.accountname, - Sum(CASE WHEN (gltrans.periodno>=' . $_POST['FromPeriod'] . ' and gltrans.periodno<=' . $_POST['ToPeriod'] . ') THEN gltrans.amount ELSE 0 END) AS TotalAllPeriods, - Sum(CASE WHEN (gltrans.periodno=' . $_POST['ToPeriod'] . ') THEN gltrans.amount ELSE 0 END) AS TotalThisPeriod + Sum(CASE WHEN (gltrans.periodno>='" . $_POST['FromPeriod'] . "' AND gltrans.periodno<='" . $_POST['ToPeriod'] . "') THEN gltrans.amount ELSE 0 END) AS TotalAllPeriods, + Sum(CASE WHEN (gltrans.periodno='" . $_POST['ToPeriod'] . "') THEN gltrans.amount ELSE 0 END) AS TotalThisPeriod FROM chartmaster INNER JOIN accountgroups ON chartmaster.group_ = accountgroups.groupname INNER JOIN gltrans ON chartmaster.accountcode= gltrans.account WHERE accountgroups.pandl=1 - AND gltrans.tag='.$_POST['tag'].' + AND gltrans.tag='" . $_POST['tag'] . "' GROUP BY accountgroups.sectioninaccounts, accountgroups.groupname, accountgroups.parentgroupname, @@ -484,11 +482,11 @@ ORDER BY accountgroups.sectioninaccounts, accountgroups.sequenceintb, accountgroups.groupname, - gltrans.account'; + gltrans.account"; $AccountsResult = DB_query($SQL,$db,_('No general ledger accounts were returned by the SQL because'),_('The SQL that failed was')); - $sql='SELECT tagdescription FROM tags WHERE tagref='.$_POST['tag']; + $sql="SELECT tagdescription FROM tags WHERE tagref='".$_POST['tag'] . "'"; $result=DB_query($sql, $db); $myrow=DB_fetch_row($result); @@ -498,20 +496,19 @@ . _('Print') . '" alt="" />' . ' ' . $title . '</p>'; echo '<table cellpadding=2 class=selection>'; - echo '<tr><th colspan=9><div class="centre"><font size=3 color=blue><b>' . _('Statement of Income and Expenditure for Tag'). ' ' . - $myrow[0]._('during the'). ' ' . $NumberOfMonths . ' ' . _('months to'). ' ' . $PeriodToDate . '</b></font></div></th></tr>'; + echo '<tr><th colspan=9><div class="centre"><font size=3 color=blue><b>' . _('Statement of Income and Expenditure for Tag'). ' ' . $myrow[0]._('during the'). ' ' . $NumberOfMonths . ' ' . _('months to'). ' ' . $PeriodToDate . '</b></font></div></th></tr>'; if ($_POST['Detail']=='Detailed'){ - $TableHeader = "<tr> - <th>"._('Account')."</th> - <th>"._('Account Name')."</th> - <th colspan=2>"._('Period Actual')."</th> - </tr>"; + $TableHeader = '<tr> + <th>' . _('Account') . '</th> + <th>' . _('Account Name') . '</th> + <th colspan=2>' . _('Period Actual') . '</th> + </tr>'; } else { /*summary */ - $TableHeader = "<tr> - <th colspan=2></th> - <th colspan=2>"._('Period Actual')."</th> - </tr>"; + $TableHeader = '<tr> + <th colspan=2></th> + <th colspan=2>' . _('Period Actual') . '</th> + </tr>'; } @@ -734,17 +731,17 @@ $k++; } - $ActEnquiryURL = "<a href='$rootpath/GLAccountInquiry.php?" . SID . '&Period=' . $_POST['ToPeriod'] . '&Account=' . $myrow['account'] . "&Show=Yes'>" . $myrow['account'] . '<a>'; + $ActEnquiryURL = '<a href="' . $rootpath . '/GLAccountInquiry.php?Period=' . $_POST['ToPeriod'] . '&Account=' . $myrow['account'] . '&Show=Yes">' . $myrow['account'] . '</a>'; if ($Section ==4){ printf('<td>%s</td> - <td>%s</td> - <td></td> - <td class=number>%s</td> - </tr>', - $ActEnquiryURL, - $myrow['accountname'], - number_format(-$AccountPeriodActual)); + <td>%s</td> + <td></td> + <td class=number>%s</td> + </tr>', + $ActEnquiryURL, + $myrow['accountname'], + number_format(-$AccountPeriodActual)); } else { printf('<td>%s</td> <td>%s</td> @@ -946,4 +943,4 @@ echo '</form>'; include('includes/footer.inc'); -?> +?> \ No newline at end of file Modified: trunk/build/make_release.sh =================================================================== --- trunk/build/make_release.sh 2011-03-30 09:06:33 UTC (rev 4526) +++ trunk/build/make_release.sh 2011-03-31 08:32:24 UTC (rev 4527) @@ -36,6 +36,7 @@ msgmerge -U --backup=off locale/tr_TR.utf8/LC_MESSAGES/messages.po locale/en_GB.utf8/LC_MESSAGES/messages.pot msgmerge -U --backup=off locale/zh_CN.utf8/LC_MESSAGES/messages.po locale/en_GB.utf8/LC_MESSAGES/messages.pot msgmerge -U --backup=off locale/zh_HK.utf8/LC_MESSAGES/messages.po locale/en_GB.utf8/LC_MESSAGES/messages.pot +msgmerge -U --backup=off locale/vi_VN.utf8/LC_MESSAGES/messages.po locale/en_GB.utf8/LC_MESSAGES/messages.pot msgfmt -o locale/cs_CZ.utf8/LC_MESSAGES/messages.mo locale/cs_CZ.utf8/LC_MESSAGES/messages.po msgfmt -o locale/de_DE.utf8/LC_MESSAGES/messages.mo locale/de_DE.utf8/LC_MESSAGES/messages.po @@ -64,6 +65,7 @@ msgfmt -o locale/tr_TR.utf8/LC_MESSAGES/messages.mo locale/tr_TR.utf8/LC_MESSAGES/messages.po msgfmt -o locale/zh_CN.utf8/LC_MESSAGES/messages.mo locale/zh_CN.utf8/LC_MESSAGES/messages.po msgfmt -o locale/zh_HK.utf8/LC_MESSAGES/messages.mo locale/zh_HK.utf8/LC_MESSAGES/messages.po +msgfmt -o locale/vi_VN.utf8/LC_MESSAGES/messages.mo locale/vi_VN.utf8/LC_MESSAGES/messages.po echo "SET FOREIGN_KEY_CHECKS = 0;" > $BASE_DIR/sql/mysql/weberp-new.sql Modified: trunk/doc/Change.log.html =================================================================== --- trunk/doc/Change.log.html 2011-03-30 09:06:33 UTC (rev 4526) +++ trunk/doc/Change.log.html 2011-03-31 08:32:24 UTC (rev 4527) @@ -1,7 +1,10 @@ <p><font SIZE=4 COLOR=BLUE><b>webERP Change Log</b></font></p> <p /> -<p>30/3/11 Tim - New ReprintGRN.php script takes a purchase order and allows any line received to have GRN(s) reprinted</p> -<p>29/3/11 Phil - checking for unquoted SQL and for SQL where literals quoted with double quotes rather than single - double quotes are not ANSI compatible - so making the SQL more ANSI compatible by doing this as suggested by Tim. Many many scripts involved will take a week or so</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> +<p>30/3/11 Tim: New ReprintGRN.php script takes a purchase order and allows any line received to have GRN(s) reprinted</p> +<p>29/3/11 Phil: checking for unquoted SQL and for SQL where literals quoted with double quotes rather than single - double quotes are not ANSI compatible - so making the SQL more ANSI compatible by doing this as suggested by Tim. Many many scripts involved will take a week or so</p> <p /> <p>27/3/11 - Version 4.03.5 Release <p> Modified: trunk/includes/session.inc =================================================================== --- trunk/includes/session.inc 2011-03-30 09:06:33 UTC (rev 4526) +++ trunk/includes/session.inc 2011-03-31 08:32:24 UTC (rev 4527) @@ -23,7 +23,6 @@ session_start(); -include($PathPrefix . 'includes/LanguageSetup.php'); include($PathPrefix . 'includes/ConnectDB.inc'); include($PathPrefix . 'includes/DateFunctions.inc'); @@ -111,6 +110,7 @@ } } /* only do security checks if AllowAnyone is not true */ +include($PathPrefix . 'includes/LanguageSetup.php'); /*User is logged in so get configuration parameters - save in session*/ include($PathPrefix . 'includes/GetConfig.php'); Modified: trunk/locale/cs_CZ.utf8/LC_MESSAGES/messages.mo =================================================================== (Binary files differ) Modified: trunk/locale/cs_CZ.utf8/LC_MESSAGES/messages.po =================================================================== --- trunk/locale/cs_CZ.utf8/LC_MESSAGES/messages.po 2011-03-30 09:06:33 UTC (rev 4526) +++ trunk/locale/cs_CZ.utf8/LC_MESSAGES/messages.po 2011-03-31 08:32:24 UTC (rev 4527) @@ -7,21 +7,21 @@ msgstr "" "Project-Id-Version: webERP 3.08\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2011-03-27 19:34+1200\n" -"PO-Revision-Date: 2010-07-25 17:04+0000\n" -"Last-Translator: Tim Schofield <ti...@we...>\n" +"POT-Creation-Date: 2011-03-31 20:06+1200\n" +"PO-Revision-Date: 2011-02-07 15:33+0000\n" +"Last-Translator: Tim Schofield <Unknown>\n" "Language-Team: Czech <cs...@li...>\n" "MIME-Version: 1.0\n" "Content-Type: text/plain; charset=UTF-8\n" "Content-Transfer-Encoding: 8bit\n" -"Language: cs\n" -"X-Launchpad-Export-Date: 2011-01-05 16:36+0000\n" -"X-Generator: Launchpad (build 12138)\n" +"X-Launchpad-Export-Date: 2011-03-31 06:23+0000\n" +"X-Generator: Launchpad (build 12696)\n" "X-Poedit-Country: CZECH REPUBLIC\n" +"Language: cs\n" "X-Poedit-Language: Czech\n" "X-Poedit-SourceCharset: utf-8\n" -#: AccountGroups.php:9 index.php:1272 +#: AccountGroups.php:9 index.php:1277 msgid "Account Groups" msgstr "Účetní skupiny" @@ -133,9 +133,9 @@ #: Areas.php:117 Areas.php:126 BankAccounts.php:163 CreditStatus.php:126 #: Currencies.php:144 Currencies.php:152 Currencies.php:159 #: CustomerBranches.php:296 CustomerBranches.php:306 CustomerBranches.php:316 -#: CustomerBranches.php:326 Customers.php:317 Customers.php:326 -#: Customers.php:334 Customers.php:342 CustomerTypes.php:149 -#: CustomerTypes.php:159 Factors.php:136 FixedAssetCategories.php:132 +#: CustomerBranches.php:326 Customers.php:311 Customers.php:320 +#: Customers.php:328 Customers.php:336 CustomerTypes.php:149 +#: CustomerTypes.php:159 Factors.php:136 FixedAssetCategories.php:131 #: GLAccounts.php:95 GLAccounts.php:109 Locations.php:247 Locations.php:255 #: Locations.php:264 Locations.php:272 Locations.php:280 Locations.php:288 #: Locations.php:296 Locations.php:304 MRPDemandTypes.php:89 @@ -146,7 +146,7 @@ #: Stocks.php:469 Stocks.php:478 Stocks.php:486 Stocks.php:494 Stocks.php:502 #: Stocks.php:510 Suppliers.php:613 Suppliers.php:622 Suppliers.php:630 #: SupplierTypes.php:147 TaxCategories.php:133 TaxGroups.php:128 -#: TaxGroups.php:135 TaxProvinces.php:127 UnitsOfMeasure.php:140 +#: TaxGroups.php:135 TaxProvinces.php:127 UnitsOfMeasure.php:137 #: WorkCentres.php:90 WorkCentres.php:96 WWW_Access.php:87 msgid "There are" msgstr "Jsou zde" @@ -186,7 +186,7 @@ #: AccountGroups.php:223 msgid "The sql that was used to retrieve the account group information was " -msgstr "Sql, který byl použit k načtení účtové skupiny informace" +msgstr "Sql, který byl použit k načtení účtové skupiny informace " #: AccountGroups.php:224 msgid "Could not get account groups because" @@ -195,17 +195,17 @@ #: AccountGroups.php:226 AccountSections.php:177 AddCustomerContacts.php:25 #: AddCustomerContacts.php:28 AddCustomerNotes.php:97 #: AddCustomerTypeNotes.php:94 AgedDebtors.php:468 AgedSuppliers.php:277 -#: Areas.php:145 AuditTrail.php:13 BOMExtendedQty.php:286 BOMIndented.php:262 -#: BOMIndentedReverse.php:257 BOMInquiry.php:165 BOMListing.php:128 -#: BOMs.php:214 BOMs.php:793 COGSGLPostings.php:20 CompanyPreferences.php:158 +#: Areas.php:145 AuditTrail.php:13 BOMExtendedQty.php:272 BOMIndented.php:252 +#: BOMIndentedReverse.php:246 BOMInquiry.php:165 BOMListing.php:128 +#: BOMs.php:214 BOMs.php:793 COGSGLPostings.php:20 CompanyPreferences.php:155 #: CounterSales.php:1983 CounterSales.php:2107 Credit_Invoice.php:256 #: CreditStatus.php:21 Currencies.php:29 CustEDISetup.php:19 #: DailyBankTransactions.php:9 DebtorsAtPeriodEnd.php:138 #: DiscountCategories.php:12 DiscountCategories.php:122 DiscountMatrix.php:18 -#: EDIMessageFormat.php:106 FixedAssetLocations.php:9 +#: EDIMessageFormat.php:104 FixedAssetLocations.php:9 #: FixedAssetRegister.php:13 FixedAssetRegister.php:238 #: FixedAssetTransfer.php:31 FormDesigner.php:132 GLBalanceSheet.php:351 -#: GLBudgets.php:30 GLJournal.php:243 InventoryPlanning.php:374 +#: GLBudgets.php:28 GLJournal.php:228 InventoryPlanning.php:374 #: InventoryPlanningPrefSupplier.php:474 Labels.php:117 Labels.php:273 #: MRPReport.php:536 OutstandingGRNs.php:174 PcAssignCashToTab.php:39 #: PcAssignCashToTab.php:113 PcAssignCashToTab.php:129 @@ -238,7 +238,7 @@ msgid "Group Name" msgstr "Název skupiny" -#: AccountGroups.php:231 EDIMessageFormat.php:131 +#: AccountGroups.php:231 EDIMessageFormat.php:129 EDIMessageFormat.php:207 msgid "Section" msgstr "Sekce" @@ -260,11 +260,11 @@ #: AccountGroups.php:386 BankAccounts.php:217 BankAccounts.php:361 #: BankAccounts.php:363 BankAccounts.php:367 BOMs.php:128 BOMs.php:713 #: BOMs.php:715 CompanyPreferences.php:439 CompanyPreferences.php:441 -#: CompanyPreferences.php:451 CompanyPreferences.php:453 -#: CompanyPreferences.php:463 CompanyPreferences.php:465 +#: CompanyPreferences.php:452 CompanyPreferences.php:454 +#: CompanyPreferences.php:465 CompanyPreferences.php:467 #: ContractCosting.php:174 CustLoginSetup.php:590 CustLoginSetup.php:592 -#: CustomerBranches.php:420 Customers.php:600 Customers.php:857 -#: Customers.php:864 Customers.php:867 DeliveryDetails.php:1034 +#: CustomerBranches.php:420 Customers.php:590 Customers.php:847 +#: Customers.php:854 Customers.php:857 DeliveryDetails.php:1034 #: DeliveryDetails.php:1074 DeliveryDetails.php:1077 GLTransInquiry.php:73 #: MRPCalendar.php:222 MRP.php:529 MRP.php:533 MRP.php:537 MRP.php:541 #: PaymentMethods.php:203 PaymentMethods.php:204 PaymentMethods.php:264 @@ -295,11 +295,11 @@ #: BankAccounts.php:215 BankAccounts.php:361 BankAccounts.php:363 #: BankAccounts.php:367 BOMs.php:130 BOMs.php:712 BOMs.php:716 #: CompanyPreferences.php:438 CompanyPreferences.php:442 -#: CompanyPreferences.php:450 CompanyPreferences.php:454 -#: CompanyPreferences.php:462 CompanyPreferences.php:466 +#: CompanyPreferences.php:451 CompanyPreferences.php:455 +#: CompanyPreferences.php:464 CompanyPreferences.php:468 #: ContractCosting.php:172 CustLoginSetup.php:589 CustLoginSetup.php:593 -#: CustomerBranches.php:420 Customers.php:599 Customers.php:855 -#: Customers.php:863 Customers.php:866 DeliveryDetails.php:1035 +#: CustomerBranches.php:420 Customers.php:589 Customers.php:845 +#: Customers.php:853 Customers.php:856 DeliveryDetails.php:1035 #: DeliveryDetails.php:1075 DeliveryDetails.php:1078 GLTransInquiry.php:127 #: MRPCalendar.php:224 MRP.php:527 MRP.php:531 MRP.php:535 MRP.php:539 #: PaymentMethods.php:203 PaymentMethods.php:204 PaymentMethods.php:265 @@ -330,10 +330,10 @@ #: AccountGroups.php:265 AccountSections.php:197 AddCustomerContacts.php:131 #: AddCustomerNotes.php:125 AddCustomerTypeNotes.php:123 Areas.php:165 #: BankAccounts.php:226 BOMs.php:150 COGSGLPostings.php:113 -#: COGSGLPostings.php:218 CreditStatus.php:175 Currencies.php:239 -#: CustLoginSetup.php:312 CustomerBranches.php:424 Customers.php:909 -#: Customers.php:941 CustomerTypes.php:205 EDIMessageFormat.php:152 -#: Factors.php:208 FixedAssetCategories.php:182 FixedAssetLocations.php:102 +#: COGSGLPostings.php:215 CreditStatus.php:175 Currencies.php:239 +#: CustLoginSetup.php:312 CustomerBranches.php:424 Customers.php:899 +#: Customers.php:931 CustomerTypes.php:205 EDIMessageFormat.php:150 +#: Factors.php:208 FixedAssetCategories.php:181 FixedAssetLocations.php:102 #: FreightCosts.php:243 GeocodeSetup.php:169 GLAccounts.php:319 GLTags.php:62 #: Labels.php:414 Locations.php:380 MRPDemands.php:304 MRPDemandTypes.php:122 #: PaymentMethods.php:205 PaymentTerms.php:203 PcAssignCashToTab.php:251 @@ -346,7 +346,7 @@ #: SelectCustomer.php:702 Shippers.php:144 StockCategories.php:244 #: SupplierContacts.php:153 SupplierTypes.php:192 SuppLoginSetup.php:274 #: TaxAuthorities.php:173 TaxCategories.php:184 TaxGroups.php:179 -#: TaxProvinces.php:178 UnitsOfMeasure.php:190 WorkCentres.php:138 +#: TaxProvinces.php:178 UnitsOfMeasure.php:187 WorkCentres.php:138 #: WWW_Access.php:127 WWW_Users.php:307 includes/InputSerialItems.php:88 #: includes/OutputSerialItems.php:21 #, php-format @@ -356,15 +356,15 @@ #: AccountGroups.php:266 AccountSections.php:201 AddCustomerContacts.php:132 #: AddCustomerNotes.php:126 AddCustomerTypeNotes.php:124 Areas.php:166 #: BankAccounts.php:227 BOMs.php:152 COGSGLPostings.php:114 -#: COGSGLPostings.php:219 ContractBOM.php:272 ContractOtherReqts.php:121 +#: COGSGLPostings.php:216 ContractBOM.php:272 ContractOtherReqts.php:121 #: CounterSales.php:781 Credit_Invoice.php:385 CreditStatus.php:176 -#: Currencies.php:242 CustLoginSetup.php:313 CustomerReceipt.php:866 -#: Customers.php:942 CustomerTypes.php:206 DiscountCategories.php:204 -#: DiscountMatrix.php:178 EDIMessageFormat.php:153 -#: FixedAssetCategories.php:183 FreightCosts.php:244 GeocodeSetup.php:170 -#: GLAccounts.php:320 GLJournal.php:401 Labels.php:414 Locations.php:381 +#: Currencies.php:242 CustLoginSetup.php:313 CustomerReceipt.php:863 +#: Customers.php:932 CustomerTypes.php:206 DiscountCategories.php:204 +#: DiscountMatrix.php:178 EDIMessageFormat.php:151 +#: FixedAssetCategories.php:182 FreightCosts.php:244 GeocodeSetup.php:170 +#: GLAccounts.php:320 GLJournal.php:385 Labels.php:414 Locations.php:381 #: MRPDemands.php:305 MRPDemandTypes.php:123 PaymentMethods.php:206 -#: Payments.php:958 PaymentTerms.php:204 PcAssignCashToTab.php:255 +#: Payments.php:959 PaymentTerms.php:204 PcAssignCashToTab.php:255 #: PcClaimExpensesFromTab.php:230 PcExpenses.php:187 PcExpensesTypeTab.php:164 #: PcTabs.php:189 PcTypeTabs.php:175 PO_AuthorisationLevels.php:150 #: PO_Items.php:762 Prices_Customer.php:284 Prices.php:228 PurchData.php:208 @@ -379,7 +379,7 @@ #: SupplierContacts.php:154 SupplierTypes.php:194 SuppLoginSetup.php:275 #: SuppShiptChgs.php:86 SuppTransGLAnalysis.php:111 TaxAuthorities.php:174 #: TaxCategories.php:185 TaxGroups.php:180 TaxProvinces.php:179 -#: UnitsOfMeasure.php:191 WorkCentres.php:139 WOSerialNos.php:300 +#: UnitsOfMeasure.php:188 WorkCentres.php:139 WOSerialNos.php:300 #: WWW_Access.php:128 WWW_Users.php:308 includes/InputSerialItemsKeyed.php:57 #: includes/OutputSerialItems.php:98 #, php-format @@ -425,10 +425,10 @@ #: AccountGroups.php:401 AccountSections.php:262 AddCustomerContacts.php:208 #: AddCustomerNotes.php:201 AddCustomerTypeNotes.php:192 Areas.php:222 -#: BankAccounts.php:373 BOMs.php:725 COGSGLPostings.php:347 +#: BankAccounts.php:373 BOMs.php:725 COGSGLPostings.php:353 #: CreditStatus.php:247 Currencies.php:339 CustLoginSetup.php:611 -#: DiscountMatrix.php:141 EDIMessageFormat.php:249 -#: FixedAssetCategories.php:328 FixedAssetLocations.php:148 +#: DiscountMatrix.php:141 EDIMessageFormat.php:247 +#: FixedAssetCategories.php:327 FixedAssetLocations.php:148 #: FreightCosts.php:342 GeocodeSetup.php:266 GLAccounts.php:269 #: Locations.php:558 MRPDemands.php:402 MRPDemandTypes.php:182 #: OffersReceived.php:52 OffersReceived.php:128 PaymentMethods.php:276 @@ -436,12 +436,12 @@ #: SalesAnalReptCols.php:510 SalesAnalRepts.php:496 SalesGLPostings.php:415 #: SalesPeople.php:302 Shippers.php:196 StockCategories.php:561 #: SupplierContacts.php:250 SuppLoginSetup.php:532 TaxAuthorities.php:313 -#: TaxCategories.php:235 TaxProvinces.php:229 UnitsOfMeasure.php:242 +#: TaxCategories.php:235 TaxProvinces.php:229 UnitsOfMeasure.php:239 #: WorkCentres.php:261 WWW_Users.php:638 msgid "Enter Information" msgstr "Vložit informace" -#: AccountSections.php:9 index.php:1277 +#: AccountSections.php:9 index.php:1282 msgid "Account Sections" msgstr "Sekce účtu" @@ -549,9 +549,9 @@ msgid "The contact record has been deleted" msgstr "Kontakt záznam byl odstraněn" -#: AddCustomerContacts.php:112 CompanyPreferences.php:229 -#: CustomerBranches.php:377 Customers.php:899 Customers.php:905 -#: Customers.php:971 SalesPeople.php:185 SelectCustomer.php:606 +#: AddCustomerContacts.php:112 CompanyPreferences.php:224 +#: CustomerBranches.php:377 Customers.php:889 Customers.php:895 +#: Customers.php:961 SalesPeople.php:185 SelectCustomer.php:606 #: StockDispatch.php:186 StockDispatch.php:198 SupplierContacts.php:141 #: SupplierCredit.php:437 SupplierInvoice.php:408 SuppTransGLAnalysis.php:96 #: includes/InputSerialItemsFile.php:84 includes/InputSerialItemsFile.php:124 @@ -559,18 +559,18 @@ msgid "Name" msgstr "Název" -#: AddCustomerContacts.php:113 AddCustomerContacts.php:190 Customers.php:900 -#: Customers.php:906 Customers.php:972 SelectCustomer.php:607 +#: AddCustomerContacts.php:113 AddCustomerContacts.php:190 Customers.php:890 +#: Customers.php:896 Customers.php:962 SelectCustomer.php:607 #: WWW_Access.php:111 WWW_Access.php:172 msgid "Role" msgstr "Roli" -#: AddCustomerContacts.php:114 Customers.php:973 +#: AddCustomerContacts.php:114 Customers.php:963 msgid "Phone no" msgstr "Telefonní číslo" -#: AddCustomerContacts.php:115 AddCustomerContacts.php:202 Customers.php:902 -#: Customers.php:908 Customers.php:974 PcAssignCashToTab.php:216 +#: AddCustomerContacts.php:115 AddCustomerContacts.php:202 Customers.php:892 +#: Customers.php:898 Customers.php:964 PcAssignCashToTab.php:216 #: PcAssignCashToTab.php:341 PcAuthorizeExpenses.php:85 #: PcClaimExpensesFromTab.php:195 PcClaimExpensesFromTab.php:348 #: PcReportTab.php:348 SelectCustomer.php:609 SystemParameters.php:316 @@ -740,8 +740,8 @@ msgstr "Ve věku od zákaznického účtu analýza" #: AgedDebtors.php:267 AgedDebtors.php:365 AgedDebtors.php:436 -#: AgedSuppliers.php:105 BOMExtendedQty.php:156 BOMIndented.php:149 -#: BOMIndentedReverse.php:148 BOMListing.php:48 BOMListing.php:59 +#: AgedSuppliers.php:105 BOMExtendedQty.php:159 BOMIndented.php:150 +#: BOMIndentedReverse.php:151 BOMListing.php:48 BOMListing.php:59 #: DebtorsAtPeriodEnd.php:58 DebtorsAtPeriodEnd.php:70 GLBalanceSheet.php:90 #: GLBalanceSheet.php:128 GLProfit_Loss.php:157 GLTagProfit_Loss.php:174 #: GLTrialBalance.php:151 InventoryPlanning.php:99 InventoryPlanning.php:174 @@ -769,9 +769,9 @@ msgstr "Zákazník podrobnosti se nepodařilo získat do SQL, protože" #: AgedDebtors.php:270 AgedDebtors.php:368 AgedDebtors.php:442 -#: AgedSuppliers.php:108 AgedSuppliers.php:190 BOMExtendedQty.php:159 -#: BOMExtendedQty.php:263 BOMIndented.php:152 BOMIndented.php:238 -#: BOMIndentedReverse.php:151 BOMIndentedReverse.php:235 BOMListing.php:51 +#: AgedSuppliers.php:108 AgedSuppliers.php:190 BOMExtendedQty.php:162 +#: BOMExtendedQty.php:259 BOMIndented.php:153 BOMIndented.php:239 +#: BOMIndentedReverse.php:154 BOMIndentedReverse.php:232 BOMListing.php:51 #: Credit_Invoice.php:185 DebtorsAtPeriodEnd.php:61 DebtorsAtPeriodEnd.php:73 #: FTP_RadioBeacon.php:188 GetStockImage.php:154 GLBalanceSheet.php:93 #: GLBalanceSheet.php:131 GLBalanceSheet.php:294 GLProfit_Loss.php:160 @@ -791,7 +791,7 @@ #: MRPReport.php:52 MRPReport.php:150 MRPReschedules.php:49 #: MRPReschedules.php:61 MRPShortages.php:148 MRPShortages.php:160 #: OutstandingGRNs.php:54 OutstandingGRNs.php:66 PcReportTab.php:236 -#: PDFCustomerList.php:235 PDFCustomerList.php:247 PDFGrn.php:124 +#: PDFCustomerList.php:235 PDFCustomerList.php:247 PDFGrn.php:123 #: PDFLowGP.php:63 PDFLowGP.php:75 PDFPriceList.php:124 PDFQuotation.php:234 #: PDFQuotationPortrait.php:235 PDFRemittanceAdvice.php:84 #: PDFStockCheckComparison.php:39 PDFStockCheckComparison.php:65 @@ -823,7 +823,7 @@ msgid "The details of outstanding transactions for customer" msgstr "Podrobnosti o nesplacených transakcí pro zákazníka" -#: AgedDebtors.php:367 AgedSuppliers.php:189 GLAccountCSV.php:169 +#: AgedDebtors.php:367 AgedSuppliers.php:189 GLAccountCSV.php:167 #: GLAccountInquiry.php:145 GLAccountReport.php:93 PO_Items.php:471 #: PO_Items.php:605 PO_Items.php:632 SalesAnalReptCols.php:356 #: SpecialOrder.php:369 StockLocTransferReceive.php:373 @@ -835,9 +835,9 @@ #: ConfirmDispatch_Invoice.php:152 ConfirmDispatch_Invoice.php:969 #: ConfirmDispatch_Invoice.php:983 Contracts.php:581 CounterSales.php:1323 #: CounterSales.php:1337 Credit_Invoice.php:706 Credit_Invoice.php:728 -#: CustomerReceipt.php:526 CustomerReceipt.php:658 CustomerReceipt.php:686 +#: CustomerReceipt.php:523 CustomerReceipt.php:655 CustomerReceipt.php:683 #: CustomerTransInquiry.php:79 DeliveryDetails.php:395 GLProfit_Loss.php:578 -#: GLTagProfit_Loss.php:490 Payments.php:307 PDFRemittanceAdvice.php:86 +#: GLTagProfit_Loss.php:490 Payments.php:308 PDFRemittanceAdvice.php:86 #: PurchData.php:89 PurchData.php:108 PurchData.php:244 ReverseGRN.php:191 #: ReverseGRN.php:205 ReverseGRN.php:366 SelectCreditItems.php:1381 #: SelectSalesOrder.php:113 SelectSalesOrder.php:281 StockCheck.php:225 @@ -855,7 +855,7 @@ #: includes/PDFPaymentRun_PymtFooter.php:118 #: includes/PDFPaymentRun_PymtFooter.php:154 #: includes/PDFPaymentRun_PymtFooter.php:185 includes/ConnectDB_mysqli.inc:79 -#: includes/ConnectDB_mysql.inc:68 +#: includes/ConnectDB_mysql.inc:64 msgid "The SQL that failed was" msgstr "SQL příkaz, který selhal, byl" @@ -911,8 +911,8 @@ msgid "Detailed Report" msgstr "Podrobná zpráva" -#: AgedDebtors.php:520 AgedSuppliers.php:320 BOMExtendedQty.php:300 -#: BOMIndented.php:278 BOMIndentedReverse.php:266 BOMListing.php:142 +#: AgedDebtors.php:520 AgedSuppliers.php:320 BOMExtendedQty.php:286 +#: BOMIndented.php:268 BOMIndentedReverse.php:255 BOMListing.php:142 #: DebtorsAtPeriodEnd.php:166 InventoryPlanning.php:442 #: InventoryPlanningPrefSupplier.php:518 InventoryQuantities.php:188 #: InventoryValuation.php:242 MRPPlannedPurchaseOrders.php:282 @@ -1044,7 +1044,7 @@ msgstr "Kód oblasti" #: Areas.php:133 CustomerTypes.php:166 Factors.php:142 -#: FixedAssetCategories.php:137 GLAccounts.php:208 Locations.php:328 +#: FixedAssetCategories.php:136 GLAccounts.php:208 Locations.php:328 #: MRPDemands.php:248 PcAssignCashToTab.php:118 PcClaimExpensesFromTab.php:109 #: PcExpenses.php:137 PcExpensesTypeTab.php:86 PcTabs.php:124 #: PcTypeTabs.php:137 SalesAnalReptCols.php:215 SalesCategories.php:139 @@ -1073,12 +1073,12 @@ msgid "Incorrect date format used, please re-enter" msgstr "Nesprávné datum používaného formátu, prosím, re-zadání" -#: AuditTrail.php:37 BOMIndented.php:317 BOMIndentedReverse.php:305 +#: AuditTrail.php:37 BOMIndented.php:307 BOMIndentedReverse.php:294 #: MRPCalendar.php:260 msgid "From Date" msgstr "Od data" -#: AuditTrail.php:39 BOMIndented.php:318 BOMIndentedReverse.php:306 +#: AuditTrail.php:39 BOMIndented.php:308 BOMIndentedReverse.php:295 #: MRPCalendar.php:262 msgid "To Date" msgstr "To Date" @@ -1091,7 +1091,7 @@ #: AuditTrail.php:56 msgid "Table " -msgstr "Tabulka" +msgstr "Tabulka " #: AuditTrail.php:68 MRPReport.php:789 PO_SelectPurchOrder.php:363 #: SelectContract.php:196 SelectProduct.php:727 @@ -1110,7 +1110,7 @@ #: CustomerAllocations.php:356 CustomerInquiry.php:189 #: CustomerTransInquiry.php:21 CustomerTransInquiry.php:85 #: CustWhereAlloc.php:18 CustWhereAlloc.php:87 DailyBankTransactions.php:99 -#: GLAccountInquiry.php:152 GLAccountReport.php:367 GLJournal.php:256 +#: GLAccountInquiry.php:152 GLAccountReport.php:367 GLJournal.php:241 #: MRPReschedules.php:204 SelectCustomer.php:463 ShipmentCosting.php:501 #: ShipmentCosting.php:572 StockCategories.php:219 StockLocMovements.php:83 #: StockMovements.php:97 SupplierAllocations.php:462 SupplierInquiry.php:193 @@ -1224,7 +1224,7 @@ msgid "The SQL used to retrieve the bank account details was" msgstr "SQL používá k načtení údaje o bankovním účtu bylo" -#: BankAccounts.php:196 GLJournal.php:280 +#: BankAccounts.php:196 GLJournal.php:265 msgid "GL Account Code" msgstr "GL kódu účtu" @@ -1244,7 +1244,7 @@ msgid "Bank Address" msgstr "Adresa banky" -#: BankAccounts.php:201 CustomerReceipt.php:756 CustomerTransInquiry.php:95 +#: BankAccounts.php:201 CustomerReceipt.php:753 CustomerTransInquiry.php:95 #: OffersReceived.php:98 PcReportTab.php:291 PcTabs.php:147 PcTabs.php:295 #: PDFPrintLabel.php:94 PO_AuthorisationLevels.php:125 #: PO_AuthorisationLevels.php:180 PO_AuthorisationLevels.php:183 @@ -1335,8 +1335,8 @@ "účtu. Zkontrolujte, zda vaše bankovní výpis a klikněte na check-box, když " "zjistíte, odpovídající transakce." -#: BankMatching.php:80 BankReconciliation.php:97 CustomerReceipt.php:729 -#: DailyBankTransactions.php:28 Payments.php:732 PDFChequeListing.php:46 +#: BankMatching.php:80 BankReconciliation.php:97 CustomerReceipt.php:726 +#: DailyBankTransactions.php:28 Payments.php:733 PDFChequeListing.php:46 #: TaxAuthorities.php:150 TaxAuthorities.php:306 msgid "Bank Account" msgstr "Bankovní účet" @@ -1354,7 +1354,7 @@ #: BankMatching.php:105 ConfirmDispatchControlled_Invoice.php:59 #: EmailCustTrans.php:65 FixedAssetRegister.php:78 FTP_RadioBeacon.php:281 -#: GLAccountCSV.php:172 GLAccountReport.php:102 Payments.php:712 +#: GLAccountCSV.php:170 GLAccountReport.php:102 Payments.php:713 #: PcReportTab.php:105 PDFChequeListing.php:108 PDFChequeListing.php:118 #: PDFChequeListing.php:205 PDFDeliveryDifferences.php:166 #: PDFDeliveryDifferences.php:179 PDFDeliveryDifferences.php:287 @@ -1466,9 +1466,9 @@ msgstr "Ref" #: BankMatching.php:224 ConfirmDispatch_Invoice.php:279 Credit_Invoice.php:280 -#: CustomerAllocations.php:359 CustomerReceipt.php:845 +#: CustomerAllocations.php:359 CustomerReceipt.php:842 #: CustomerTransInquiry.php:94 CustWhereAlloc.php:91 PaymentAllocations.php:78 -#: Payments.php:925 Payments.php:927 Payments.php:936 +#: Payments.php:926 Payments.php:928 Payments.php:937 #: PcAssignCashToTab.php:214 PcAssignCashToTab.php:335 #: PcAuthorizeExpenses.php:83 PcClaimExpensesFromTab.php:193 #: PcClaimExpensesFromTab.php:342 PcReportTab.php:175 PcReportTab.php:347 @@ -1548,26 +1548,26 @@ msgid "The bank accounts could not be retrieved by the SQL because" msgstr "Bankovní účty se nepodařilo získat na SQL, protože" -#: BankReconciliation.php:94 CustomerReceipt.php:720 -#: DailyBankTransactions.php:25 Payments.php:729 SuppPaymentRun.php:302 +#: BankReconciliation.php:94 CustomerReceipt.php:717 +#: DailyBankTransactions.php:25 Payments.php:730 SuppPaymentRun.php:302 msgid "The SQL used to retrieve the bank accounts was" msgstr "SQL slouží k získání bankovní účty byly" -#: BankReconciliation.php:100 CustomerReceipt.php:734 +#: BankReconciliation.php:100 CustomerReceipt.php:731 msgid "Bank Accounts have not yet been defined" msgstr "Bankovní účty dosud nebyly definovány" -#: BankReconciliation.php:100 CustomerReceipt.php:734 +#: BankReconciliation.php:100 CustomerReceipt.php:731 msgid "You must first" msgstr "Musíte nejprve" -#: BankReconciliation.php:100 CustomerReceipt.php:734 -#: DailyBankTransactions.php:32 Payments.php:736 SuppPaymentRun.php:310 +#: BankReconciliation.php:100 CustomerReceipt.php:731 +#: DailyBankTransactions.php:32 Payments.php:737 SuppPaymentRun.php:310 msgid "define the bank accounts" msgstr "definovat bankovních účtů" -#: BankReconciliation.php:100 CustomerReceipt.php:734 -#: DailyBankTransactions.php:32 Payments.php:736 SuppPaymentRun.php:310 +#: BankReconciliation.php:100 CustomerReceipt.php:731 +#: DailyBankTransactions.php:32 Payments.php:737 SuppPaymentRun.php:310 msgid "and general ledger accounts to be affected" msgstr "a účtů hlavní knihy mohly být postiženy" @@ -1672,7 +1672,7 @@ "zůstatek na účtu. Je důležité, že směnný kurz výše odráží současnou hodnotu " "měny bankovního účtu" -#: BankReconciliation.php:311 CounterSales.php:781 Customers.php:1014 +#: BankReconciliation.php:311 CounterSales.php:781 Customers.php:1004 #: SelectOrderItems.php:1369 Stocks.php:1031 WorkOrderCosting.php:512 #: WorkOrderEntry.php:547 msgid "Are You Sure?" @@ -1703,41 +1703,41 @@ msgid "Match off cleared deposits" msgstr "Utkání vypnutí vymazány vklady" -#: BOMExtendedQty.php:14 BOMExtendedQty.php:15 BOMExtendedQty.php:156 -#: BOMExtendedQty.php:283 +#: BOMExtendedQty.php:12 BOMExtendedQty.php:13 BOMExtendedQty.php:159 +#: BOMExtendedQty.php:269 msgid "Quantity Extended BOM Listing" msgstr "Množství Rozšířené kusovníku Výpis" -#: BOMExtendedQty.php:34 BOMIndentedReverse.php:30 MRPCalendar.php:87 +#: BOMExtendedQty.php:32 BOMIndentedReverse.php:29 MRPCalendar.php:87 #: MRP.php:29 SalesInquiry.php:1191 msgid "The SQL to to create passbom failed with the message" msgstr "SQL k vytvoření passbom nepodařilo se zprávou" -#: BOMExtendedQty.php:47 BOMIndented.php:42 BOMIndentedReverse.php:43 +#: BOMExtendedQty.php:45 BOMIndented.php:40 BOMIndentedReverse.php:42 #: MRP.php:36 msgid "Create of tempbom failed because" msgstr "Vytvořit z tempbom se nezdařila, protože" -#: BOMExtendedQty.php:158 +#: BOMExtendedQty.php:161 msgid "" "The Quantiy Extended BOM Listing could not be retrieved by the SQL because" msgstr "Quantiy Rozšířená rozpisky Výpis se nepodařilo získat na SQL, protože" -#: BOMExtendedQty.php:260 BOMIndented.php:235 +#: BOMExtendedQty.php:256 BOMIndented.php:236 msgid "Print Indented BOM Listing Error" msgstr "Tisk Odsazené kusovníku výpis chyby" -#: BOMExtendedQty.php:262 BOMIndented.php:237 +#: BOMExtendedQty.php:258 BOMIndented.php:238 msgid "There were no items for the selected assembly" msgstr "Nebyly zjištěny žádné položky pro vybraný montáž" -#: BOMExtendedQty.php:290 BOMIndented.php:266 BOMIndentedReverse.php:260 +#: BOMExtendedQty.php:276 BOMIndented.php:256 BOMIndentedReverse.php:249 msgid "Part" msgstr "Část" -#: BOMExtendedQty.php:291 BOMExtendedQty.php:342 BOMExtendedQty.php:343 -#: BOMExtendedQty.php:344 BOMExtendedQty.php:345 BOMIndented.php:316 -#: BOMIndentedReverse.php:304 BOMInquiry.php:173 BOMs.php:521 BOMs.php:678 +#: BOMExtendedQty.php:277 BOMExtendedQty.php:328 BOMExtendedQty.php:329 +#: BOMExtendedQty.php:330 BOMExtendedQty.php:331 BOMIndented.php:306 +#: BOMIndentedReverse.php:293 BOMInquiry.php:173 BOMs.php:521 BOMs.php:678 #: ContractBOM.php:243 ContractBOM.php:347 ContractCosting.php:74 #: ContractCosting.php:80 ContractCosting.php:131 ContractOtherReqts.php:95 #: Contracts.php:932 Contracts.php:956 CounterSales.php:701 @@ -1785,41 +1785,41 @@ msgid "Quantity" msgstr "Množství" -#: BOMExtendedQty.php:292 +#: BOMExtendedQty.php:278 msgid "Selection Option" msgstr "Možnost výběru" -#: BOMExtendedQty.php:293 +#: BOMExtendedQty.php:279 msgid "Show All Parts" msgstr "Zobrazit všechny díly" -#: BOMExtendedQty.php:294 +#: BOMExtendedQty.php:280 msgid "Only Show Shortages" msgstr "Zobrazit pouze Nedostatky" -#: BOMExtendedQty.php:296 BOMIndented.php:274 BOMIndentedReverse.php:262 +#: BOMExtendedQty.php:282 BOMIndented.php:264 BOMIndentedReverse.php:251 #: MRPPlannedPurchaseOrders.php:276 MRPPlannedWorkOrders.php:339 #: MRPReschedules.php:156 MRPShortages.php:255 msgid "Print Option" msgstr "Možnost tisku" -#: BOMExtendedQty.php:297 BOMIndented.php:275 BOMIndentedReverse.php:263 +#: BOMExtendedQty.php:283 BOMIndented.php:265 BOMIndentedReverse.php:252 #: MRPPlannedPurchaseOrders.php:277 MRPPlannedWorkOrders.php:340 #: MRPReschedules.php:157 MRPShortages.php:256 msgid "Print With Alternating Highlighted Lines" msgstr "Tisk se střídavými Zvýrazněné Lines" -#: BOMExtendedQty.php:298 BOMIndented.php:276 BOMIndentedReverse.php:264 +#: BOMExtendedQty.php:284 BOMIndented.php:266 BOMIndentedReverse.php:253 #: MRPPlannedPurchaseOrders.php:278 MRPPlannedWorkOrders.php:341 #: MRPReschedules.php:158 MRPShortages.php:257 msgid "Plain Print" msgstr "Prostý Tisk" -#: BOMExtendedQty.php:322 +#: BOMExtendedQty.php:308 msgid "Extended Quantity BOM Listing For " -msgstr "Rozšířená Množství kusovníku výpis" +msgstr "Rozšířená Množství kusovníku výpis " -#: BOMExtendedQty.php:324 BOMIndented.php:303 BOMIndentedReverse.php:291 +#: BOMExtendedQty.php:310 BOMIndented.php:293 BOMIndentedReverse.php:280 #: GLAccountReport.php:353 InventoryPlanningPrefSupplier.php:63 #: InventoryQuantities.php:210 MRPPlannedPurchaseOrders.php:305 #: MRPPlannedWorkOrders.php:367 MRPReport.php:826 MRPReschedules.php:190 @@ -1855,7 +1855,7 @@ msgid "Printed" msgstr "Vytištěno" -#: BOMExtendedQty.php:325 BOMIndented.php:304 BOMIndentedReverse.php:292 +#: BOMExtendedQty.php:311 BOMIndented.php:294 BOMIndentedReverse.php:281 #: FixedAssetRegister.php:334 GLAccountReport.php:353 #: InventoryPlanningPrefSupplier.php:63 InventoryQuantities.php:211 #: MRPPlannedPurchaseOrders.php:306 MRPPlannedWorkOrders.php:368 @@ -1910,15 +1910,15 @@ msgid "Page" msgstr "Stránky" -#: BOMExtendedQty.php:327 +#: BOMExtendedQty.php:313 msgid "Build Quantity: " -msgstr "Budovat Množství:" +msgstr "Budovat Množství: " -#: BOMExtendedQty.php:334 +#: BOMExtendedQty.php:320 msgid "Build" msgstr "Stavět" -#: BOMExtendedQty.php:335 BOMInquiry.php:94 BOMs.php:811 CounterSales.php:1990 +#: BOMExtendedQty.php:321 BOMInquiry.php:94 BOMs.php:811 CounterSales.php:1990 #: CounterSales.php:2170 PO_SelectOSPurchOrder.php:214 #: PO_SelectPurchOrder.php:179 ReorderLevelLocation.php:58 #: ReorderLevelLocation.php:59 SelectCompletedOrder.php:536 @@ -1928,15 +1928,15 @@ msgid "On Hand" msgstr "Na ruce" -#: BOMExtendedQty.php:336 +#: BOMExtendedQty.php:322 msgid "P.O." msgstr "PO" -#: BOMExtendedQty.php:337 +#: BOMExtendedQty.php:323 msgid "W.O." msgstr "WO" -#: BOMExtendedQty.php:339 BOMIndented.php:311 BOMIndentedReverse.php:299 +#: BOMExtendedQty.php:325 BOMIndented.php:301 BOMIndentedReverse.php:288 #: InventoryQuantities.php:221 MRPDemands.php:289 MRPDemands.php:361 #: MRPDemands.php:368 MRPPlannedPurchaseOrders.php:323 #: MRPPlannedWorkOrders.php:385 MRPReschedules.php:201 MRPShortages.php:253 @@ -1951,52 +1951,52 @@ msgid "Part Number" msgstr "Číslo dílu" -#: BOMExtendedQty.php:340 BOMIndented.php:312 BOMIndentedReverse.php:300 +#: BOMExtendedQty.php:326 BOMIndented.php:302 BOMIndentedReverse.php:289 #: MRPShortages.php:300 msgid "M/B" msgstr "M / B" -#: BOMExtendedQty.php:341 POReport.php:543 POReport.php:604 POReport.php:670 +#: BOMExtendedQty.php:327 POReport.php:543 POReport.php:604 POReport.php:670 #: POReport.php:1231 POReport.php:1282 POReport.php:1336 SalesInquiry.php:815 #: SalesInquiry.php:833 SalesInquiry.php:932 Stocks.php:647 Stocks.php:654 msgid "Part Description" msgstr "Popis části" -#: BOMExtendedQty.php:346 MRPShortages.php:304 +#: BOMExtendedQty.php:332 MRPShortages.php:304 msgid "Shortage" msgstr "Nedostatek" -#: BOMIndented.php:14 BOMIndented.php:15 BOMIndented.php:149 -#: BOMIndented.php:259 BOMIndented.php:302 BOMIndentedReverse.php:15 -#: BOMIndentedReverse.php:16 BOMIndentedReverse.php:148 +#: BOMIndented.php:12 BOMIndented.php:13 BOMIndented.php... [truncated message content] |
From: <dai...@us...> - 2011-03-31 09:12:16
|
Revision: 4528 http://web-erp.svn.sourceforge.net/web-erp/?rev=4528&view=rev Author: daintree Date: 2011-03-31 09:12:09 +0000 (Thu, 31 Mar 2011) Log Message: ----------- more SQL fixes - Purchase order creation from SelectProduct link Modified Paths: -------------- trunk/GLTrialBalance_csv.php trunk/PDFPrintLabel.php trunk/PO_Header.php trunk/PurchData.php trunk/StockReorderLevel.php trunk/doc/Change.log.html trunk/includes/GetConfig.php trunk/includes/GetPaymentMethods.php trunk/includes/MiscFunctions.php trunk/includes/PO_ReadInOrder.inc trunk/includes/SQL_CommonFunctions.inc trunk/locale/zh_CN.utf8/Manual/ManualAPIFunctions.php Modified: trunk/GLTrialBalance_csv.php =================================================================== --- trunk/GLTrialBalance_csv.php 2011-03-31 08:32:24 UTC (rev 4527) +++ trunk/GLTrialBalance_csv.php 2011-03-31 09:12:09 UTC (rev 4528) @@ -1,6 +1,6 @@ <?php -/* $Id*/ +/* $Id$*/ /*Through deviousness and cunning, this system allows trial balances for any date range that recalcuates the p & l balances and shows the balance sheets as at the end of the period selected - so first off need to show the input of criteria screen @@ -9,10 +9,9 @@ /*Needs to have FromPeriod and ToPeriod sent with URL * also need to work on authentication with username and password sent too*/ -//$PageSecurity = 8; + $AllowAnyone =true; -//$_POST['UserNameEntryField'] = $_GET['Identifier']; -//$_POST['Password'] = $_GET['IdentifierCheck']; + //Page must be called with GLTrialBalance_csv.php?CompanyName=XXXXX&FromPeriod=Y&ToPeriod=Z $_POST['CompanyNameField'] = $_GET['CompanyName']; //$_SERVER['PHP_SELF'] = dirname($_SERVER['PHP_SELF']) .'/GLTrialBalance_csv.php?ToPeriod=' . $_GET['ToPeriod'] . '&FromPeriod=' . $_GET['FromPeriod']; @@ -26,17 +25,17 @@ $RetainedEarningsAct = $_SESSION['CompanyRecord']['retainedearnings']; -$SQL = 'SELECT accountgroups.groupname, +$SQL = "SELECT accountgroups.groupname, accountgroups.parentgroupname, accountgroups.pandl, chartdetails.accountcode , chartmaster.accountname, - Sum(CASE WHEN chartdetails.period=' . $_GET['FromPeriod'] . ' THEN chartdetails.bfwd ELSE 0 END) AS firstprdbfwd, - Sum(CASE WHEN chartdetails.period=' . $_GET['FromPeriod'] . ' THEN chartdetails.bfwdbudget ELSE 0 END) AS firstprdbudgetbfwd, - Sum(CASE WHEN chartdetails.period=' . $_GET['ToPeriod'] . ' THEN chartdetails.bfwd + chartdetails.actual ELSE 0 END) AS lastprdcfwd, - Sum(CASE WHEN chartdetails.period=' . $_GET['ToPeriod'] . ' THEN chartdetails.actual ELSE 0 END) AS monthactual, - Sum(CASE WHEN chartdetails.period=' . $_GET['ToPeriod'] . ' THEN chartdetails.budget ELSE 0 END) AS monthbudget, - Sum(CASE WHEN chartdetails.period=' . $_GET['ToPeriod'] . ' THEN chartdetails.bfwdbudget + chartdetails.budget ELSE 0 END) AS lastprdbudgetcfwd + Sum(CASE WHEN chartdetails.period='" . $_GET['FromPeriod'] . "' THEN chartdetails.bfwd ELSE 0 END) AS firstprdbfwd, + Sum(CASE WHEN chartdetails.period='" . $_GET['FromPeriod'] . "' THEN chartdetails.bfwdbudget ELSE 0 END) AS firstprdbudgetbfwd, + Sum(CASE WHEN chartdetails.period='" . $_GET['ToPeriod'] . "' THEN chartdetails.bfwd + chartdetails.actual ELSE 0 END) AS lastprdcfwd, + Sum(CASE WHEN chartdetails.period='" . $_GET['ToPeriod'] . "' THEN chartdetails.actual ELSE 0 END) AS monthactual, + Sum(CASE WHEN chartdetails.period='" . $_GET['ToPeriod'] . "' THEN chartdetails.budget ELSE 0 END) AS monthbudget, + Sum(CASE WHEN chartdetails.period='" . $_GET['ToPeriod'] . "' THEN chartdetails.bfwdbudget + chartdetails.budget ELSE 0 END) AS lastprdbudgetcfwd FROM chartmaster INNER JOIN accountgroups ON chartmaster.group_ = accountgroups.groupname INNER JOIN chartdetails ON chartmaster.accountcode= chartdetails.accountcode GROUP BY accountgroups.groupname, @@ -48,7 +47,7 @@ ORDER BY accountgroups.pandl desc, accountgroups.sequenceintb, accountgroups.groupname, - chartdetails.accountcode'; + chartdetails.accountcode"; $AccountsResult = DB_query($SQL,$db); @@ -78,15 +77,6 @@ function stripcomma($str) { //because we're using comma as a delimiter return str_replace(",", "", $str); } -/* -$len = strlen($CSV_File); -header('Content-type: application/csv'); -header('Content-Length: ' . $len ); -header('Content-Disposition: inline; filename=GLTrialBalance.csv'); -header('Expires: 0'); -header('Cache-Control: must-revalidate, post-check=0, pre-check=0'); -header('Pragma: public'); -*/ echo $CSV_File; ?> \ No newline at end of file Modified: trunk/PDFPrintLabel.php =================================================================== --- trunk/PDFPrintLabel.php 2011-03-31 08:32:24 UTC (rev 4527) +++ trunk/PDFPrintLabel.php 2011-03-31 09:12:09 UTC (rev 4528) @@ -1,9 +1,8 @@ <?php -/* $Revision: 1.2 $ */ -//$PageSecurity = 10; +/* $Id: PDFPrintLabel.php 4285 2010-12-22 16:01:51Z tim_schofield $*/ -$Version_adds= "1.2"; +$Version_adds= '1.2'; include('includes/session.inc'); require_once('includes/DefineLabelClass.php'); @@ -19,7 +18,7 @@ // If there is no label templates, the user could select to set up a new one if ($AllLabels==null) { echo '<br/><br/>'; - abortMsg( _("There isn't any label template to select for printing. Click") . + abortMsg( _('There isn\'t any label template to select for printing. Click') . ' <a href="Labels.php"><b>' . _('HERE'). '</b></a> '. _('to set up a new one') ); } @@ -189,15 +188,15 @@ } function selSalesType($type) { - return selectTable("SELECT typeabbrev, sales_type FROM salestypes ORDER BY sales_type", $type); + return selectTable('SELECT typeabbrev, sales_type FROM salestypes ORDER BY sales_type', $type); } function selCurrency($curr) { - return selectTable("SELECT currabrev, currency FROM currencies", $curr); + return selectTable('SELECT currabrev, currency FROM currencies', $curr); } function selCategory(&$categ) { - return selectTable("SELECT categoryid, categorydescription FROM stockcategory ORDER BY categorydescription", $categ); + return selectTable('SELECT categoryid, categorydescription FROM stockcategory ORDER BY categorydescription', $categ); } function selectTable($sql, &$currentKey) { Modified: trunk/PO_Header.php =================================================================== --- trunk/PO_Header.php 2011-03-31 08:32:24 UTC (rev 4527) +++ trunk/PO_Header.php 2011-03-31 09:12:09 UTC (rev 4528) @@ -46,8 +46,8 @@ if (isset($_POST['Select']) and empty($_POST['SupplierContact'])) { $sql = "SELECT contact - FROM suppliercontacts - WHERE supplierid='". $_POST['Select'] ."'"; + FROM suppliercontacts + WHERE supplierid='". $_POST['Select'] ."'"; $SuppCoResult = DB_query($sql,$db); if (DB_num_rows($SuppCoResult)>0) { @@ -158,8 +158,8 @@ } //end if there is actually a status change the class Status != the POST['Status'] } - -if (isset($_GET['NewOrder']) and isset($_GET['StockID']) and isset($_GET['SelectedSupplier'])) { +/*New order initiated by user clicking on supplier purchasing data from items page */ +if (isset($_GET['NewOrder']) AND isset($_GET['StockID']) AND isset($_GET['SelectedSupplier'])) { /* * initialise a new order */ @@ -312,7 +312,7 @@ suppliers.address6, suppliers.currcode FROM suppliers - WHERE suppliers.suppname LIKE '". $SearchString ."' + WHERE suppliers.suppname " . LIKE . " '". $SearchString ."' ORDER BY suppliers.suppname"; } elseif (strlen($_POST['SuppCode'])>0){ @@ -326,7 +326,7 @@ suppliers.address6, suppliers.currcode FROM suppliers - WHERE suppliers.supplierid LIKE '%" . $_POST['SuppCode'] . "%' + WHERE suppliers.supplierid " . LIKE . " '%" . $_POST['SuppCode'] . "%' ORDER BY suppliers.supplierid"; } @@ -371,7 +371,7 @@ if (isset($_POST['Select'])) { -/* will only be true if page called from supplier selection form +/* will only be true if page called from supplier selection form or item purchasing data order link * or set because only one supplier record returned from a search */ @@ -501,8 +501,9 @@ } // part of step 1 -if ($_SESSION['RequireSupplierSelection'] ==1 OR !isset($_SESSION['PO'.$identifier]->SupplierID) OR - $_SESSION['PO'.$identifier]->SupplierID=='' ) { +if ($_SESSION['RequireSupplierSelection'] ==1 + OR !isset($_SESSION['PO'.$identifier]->SupplierID) + OR $_SESSION['PO'.$identifier]->SupplierID=='' ) { echo '<p class="page_title_text"><img src="'.$rootpath.'/css/'.$theme.'/images/supplier.png" title="' . _('Purchase Order') . '" alt="">' . ' ' . _('Purchase Order: Select Supplier') . ''; @@ -586,13 +587,14 @@ } if (isset($Purch_Item)) { + /*This is set if the user hits the link from the supplier purchasing info shown on SelectProduct.php */ prnMsg(_('Purchase Item(s) with this code') . ': ' . $Purch_Item,'info'); echo '<div class="centre">'; echo '<br><table class="table_index"><tr><td class="menu_group_item">'; /* the link */ - echo '<li><a href="'.$rootpath.'/PO_Items.php?' . SID . 'NewItem=' . $Purch_Item . '&identifier=' . $identifier . '">' . _('Enter Line Item to this purchase order') . '</a></li>'; + echo '<li><a href="'.$rootpath.'/PO_Items.php?NewItem=' . $Purch_Item . '&identifier=' . $identifier . '">' . _('Enter Line Item to this purchase order') . '</a></li>'; echo '</td></tr></table></div><br>'; @@ -629,9 +631,9 @@ $Purch_Item, $PurchItemRow['serialised'], $PurchItemRow['controlled'], - $Qty, + $Qty*$PurchItemRow['conversionfactor'], $PurchItemRow['description'], - $PurchItemRow['price'], + $PurchItemRow['price']/$PurchItemRow['conversionfactor'], $PurchItemRow['units'], $PurchItemRow['stockact'], date($_SESSION['DefaultDateFormat']), Modified: trunk/PurchData.php =================================================================== --- trunk/PurchData.php 2011-03-31 08:32:24 UTC (rev 4527) +++ trunk/PurchData.php 2011-03-31 09:12:09 UTC (rev 4528) @@ -1,8 +1,6 @@ <?php /* $Id$*/ -//$PageSecurity = 4; Now comes from DB - include ('includes/session.inc'); $title = _('Supplier Purchasing Data'); @@ -60,50 +58,49 @@ if (!is_numeric($_POST['ConversionFactor'])) { $InputError = 1; unset($_POST['ConversionFactor']); - prnMsg(_('The conversion factor entered was not numeric') . ' (' . _('a number is expected') . '). ' . _('The conversion factor is the number which the price must be divided by to get the unit price in our unit of measure') . '. <br>' . _('E.g.') . ' ' . _('The supplier sells an item by the tonne and we hold stock by the kg') . '. ' . _('The suppliers price must be divided by 1000 to get to our cost per kg') . '. ' . _('The conversion factor to enter is 1000') . '. <br><br>' . _('No changes will be made to the database'), 'error'); + prnMsg(_('The conversion factor entered was not numeric') . ' (' . _('a number is expected') . '). ' . _('The conversion factor is the number which the price must be divided by to get the unit price in our unit of measure') . '. <br />' . _('E.g.') . ' ' . _('The supplier sells an item by the tonne and we hold stock by the kg') . '. ' . _('The suppliers price must be divided by 1000 to get to our cost per kg') . '. ' . _('The conversion factor to enter is 1000') . '. <br /><br />' . _('No changes will be made to the database'), 'error'); } if ($InputError == 0 AND isset($_POST['AddRecord'])) { $sql = "INSERT INTO purchdata (supplierno, - stockid, - price, - effectivefrom, - suppliersuom, - conversionfactor, - supplierdescription, - suppliers_partno, - leadtime, - minorderqty, - preferred) - VALUES ('" . $SupplierID . "', - '" . $StockID . "', - '" . $_POST['Price'] . "', - '" . FormatDateForSQL($_POST['EffectiveFrom']) . "', - '" . $_POST['SuppliersUOM'] . "', - '" . $_POST['ConversionFactor'] . "', - '" . $_POST['SupplierDescription'] . "', - '" . $_POST['SupplierCode'] . "', - '" . $_POST['LeadTime'] . "', - '" . $_POST['MinOrderQty'] . "', - '" . $_POST['Preferred'] . "')"; + stockid, + price, + effectivefrom, + suppliersuom, + conversionfactor, + supplierdescription, + suppliers_partno, + leadtime, + minorderqty, + preferred) + VALUES ('" . $SupplierID . "', + '" . $StockID . "', + '" . $_POST['Price'] . "', + '" . FormatDateForSQL($_POST['EffectiveFrom']) . "', + '" . $_POST['SuppliersUOM'] . "', + '" . $_POST['ConversionFactor'] . "', + '" . $_POST['SupplierDescription'] . "', + '" . $_POST['SupplierCode'] . "', + '" . $_POST['LeadTime'] . "', + '" . $_POST['MinOrderQty'] . "', + '" . $_POST['Preferred'] . "')"; $ErrMsg = _('The supplier purchasing details could not be added to the database because'); $DbgMsg = _('The SQL that failed was'); $AddResult = DB_query($sql, $db, $ErrMsg, $DbgMsg); prnMsg(_('This supplier purchasing data has been added to the database'), 'success'); } if ($InputError == 0 AND isset($_POST['UpdateRecord'])) { - $sql = "UPDATE purchdata SET - price='" . $_POST['Price'] . "', - effectivefrom='" . FormatDateForSQL($_POST['EffectiveFrom']) . "', - suppliersuom='" . $_POST['SuppliersUOM'] . "', - conversionfactor='" . $_POST['ConversionFactor'] . "', - supplierdescription='" . $_POST['SupplierDescription'] . "', - suppliers_partno='" . $_POST['SupplierCode'] . "', - leadtime='" . $_POST['LeadTime'] . "', - minorderqty='" . $_POST['MinOrderQty'] . "', - preferred='" . $_POST['Preferred'] . "' + $sql = "UPDATE purchdata SET price='" . $_POST['Price'] . "', + effectivefrom='" . FormatDateForSQL($_POST['EffectiveFrom']) . "', + suppliersuom='" . $_POST['SuppliersUOM'] . "', + conversionfactor='" . $_POST['ConversionFactor'] . "', + supplierdescription='" . $_POST['SupplierDescription'] . "', + suppliers_partno='" . $_POST['SupplierCode'] . "', + leadtime='" . $_POST['LeadTime'] . "', + minorderqty='" . $_POST['MinOrderQty'] . "', + preferred='" . $_POST['Preferred'] . "' WHERE purchdata.stockid='".$StockID."' AND purchdata.supplierno='".$SupplierID."' - AND purchdata.effectivefrom='" . $_POST['WasEffectiveFrom'] . "'"; + AND purchdata.effectivefrom='" . $_POST['WasEffectiveFrom'] . "'"; $ErrMsg = _('The supplier purchasing details could not be update because'); $DbgMsg = _('The SQL that failed was'); $UpdResult = DB_query($sql, $db, $ErrMsg, $DbgMsg); @@ -195,38 +192,36 @@ $DisplayPreferred = _('No'); } printf("<td>%s</td> - <td class=number>%s</td> - <td>%s</td> - <td class=number>%s</td> - <td class=number>%s</td> - <td>%s</td> - <td>%s</td> - <td>%s</td> - <td>%s " . _('days') . "</td> - <td>%s</td> - <td><a href='%s?%s&StockID=%s&SupplierID=%s&Edit=1&EffectiveFrom=%s'>" . _('Edit') . "</a></td> - <td><a href='%s?%s&StockID=%s&SupplierID=%s&Delete=1&EffectiveFrom=%s' onclick=\"return confirm('" . _('Are you sure you wish to delete this suppliers price?') . "');\">" . _('Delete') . "</a></td> - </tr>", - $myrow['suppname'], - number_format($myrow['price'], 3), - $myrow['unitname'], - $myrow['conversionfactor'], - number_format($myrow['price']/$myrow['conversionfactor'],2), - $myrow['currcode'], - ConvertSQLDate($myrow['effectivefrom']), - $myrow['minorderqty'], - $myrow['leadtime'], - $DisplayPreferred, - $_SERVER['PHP_SELF'], - SID, - $StockID, - $myrow['supplierno'], - $myrow['effectivefrom'], - $_SERVER['PHP_SELF'], - SID, - $StockID, - $myrow['supplierno'], - $myrow['effectivefrom']); + <td class=number>%s</td> + <td>%s</td> + <td class=number>%s</td> + <td class=number>%s</td> + <td>%s</td> + <td>%s</td> + <td>%s</td> + <td>%s " . _('days') . "</td> + <td>%s</td> + <td><a href='%s?StockID=%s&SupplierID=%s&Edit=1&EffectiveFrom=%s'>" . _('Edit') . "</a></td> + <td><a href='%s?StockID=%s&SupplierID=%s&Delete=1&EffectiveFrom=%s' onclick=\"return confirm('" . _('Are you sure you wish to delete this suppliers price?') . "');\">" . _('Delete') . "</a></td> + </tr>", + $myrow['suppname'], + number_format($myrow['price'], 3), + $myrow['unitname'], + $myrow['conversionfactor'], + number_format($myrow['price']/$myrow['conversionfactor'],2), + $myrow['currcode'], + ConvertSQLDate($myrow['effectivefrom']), + $myrow['minorderqty'], + $myrow['leadtime'], + $DisplayPreferred, + $_SERVER['PHP_SELF'], + $StockID, + $myrow['supplierno'], + $myrow['effectivefrom'], + $_SERVER['PHP_SELF'], + $StockID, + $myrow['supplierno'], + $myrow['effectivefrom']); } //end of while loop echo '</table><br/>'; if ($CountPreferreds > 1) { @@ -278,7 +273,7 @@ if (isset($_POST['SearchSupplier'])) { if (isset($_POST['Keywords']) AND isset($_POST['SupplierCode'])) { prnMsg( _('Supplier Name keywords have been used in preference to the Supplier Code extract entered') . '.', 'info' ); - echo '<br>'; + echo '<br />'; } if ($_POST['Keywords'] == '' AND $_POST['SupplierCode'] == '') { $_POST['Keywords'] = ' '; @@ -293,7 +288,7 @@ suppliers.address1, suppliers.address2, suppliers.address3 - FROM suppliers WHERE suppliers.suppname LIKE " ."'".$SearchString."'"; + FROM suppliers WHERE suppliers.suppname " . LIKE . " '".$SearchString."'"; } elseif (strlen($_POST['SupplierCode']) > 0) { $SQL = "SELECT suppliers.supplierid, suppliers.suppname, @@ -302,7 +297,7 @@ suppliers.address2, suppliers.address3 FROM suppliers - WHERE suppliers.supplierid LIKE '%" . $_POST['SupplierCode'] . "%'"; + WHERE suppliers.supplierid " . LIKE . " '%" . $_POST['SupplierCode'] . "%'"; } //one of keywords or SupplierCode was more than a zero length string $ErrMsg = _('The suppliers matching the criteria entered could not be retrieved because'); $DbgMsg = _('The SQL to retrieve supplier details that failed was'); @@ -324,7 +319,7 @@ include ('includes/footer.inc'); exit; } else { - // echo '<br><font color=BLUE size=3><b>' . $StockID . ' - ' . $myrow[0] . ' </b> (' . _('In Units of') . ' ' . $myrow[1] . ' )</font>'; + // echo '<br /><font color=BLUE size=3><b>' . $StockID . ' - ' . $myrow[0] . ' </b> (' . _('In Units of') . ' ' . $myrow[1] . ' )</font>'; } } else { prnMsg(_('Stock Item') . ' - ' . $StockID . ' ' . _('is not defined in the database'), 'warn'); @@ -383,11 +378,14 @@ purchdata.suppliers_partno, purchdata.minorderqty, purchdata.preferred, - stockmaster.units + stockmaster.units, + currencies.decimalplaces FROM purchdata INNER JOIN suppliers ON purchdata.supplierno=suppliers.supplierid INNER JOIN stockmaster ON purchdata.stockid=stockmaster.stockid + INNER JOIN currencies + ON suppliers.currcode = currencies.currabrev WHERE purchdata.supplierno='".$SupplierID."' AND purchdata.stockid='".$StockID."' AND purchdata.effectivefrom='" . $_GET['EffectiveFrom'] . "'"; @@ -405,9 +403,9 @@ $_POST['Preferred'] = $myrow['preferred']; $_POST['MinOrderQty'] = $myrow['minorderqty']; $_POST['SupplierCode'] = $myrow['suppliers_partno']; - $StockUOM=$myrow['units']; + $StockUOM=$myrow['units']; } - echo '<form action="' . $_SERVER['PHP_SELF'] . '?' . SID . '" 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'] . '" />'; if (!isset($SupplierID)) { $SupplierID = ''; @@ -453,7 +451,7 @@ echo '<tr><td>' . _('Currency') . ':</td> <td><input type=hidden name="CurrCode" . VALUE="' . $CurrCode . '">' . $CurrCode . '</td></tr>'; echo '<tr><td>' . _('Price') . ' (' . _('in Supplier Currency') . '):</td> - <td><input type="text" class="number" name="Price" maxlength=12 size=12 VALUE=' . number_format($_POST['Price'], DecimalPlaces($CurrCode, $db),'.','') . '></td></tr>'; + <td><input type="text" class="number" name="Price" maxlength=12 size=12 VALUE=' . number_format($_POST['Price'], $myrow['decimalplaces'] ,'.','') . '></td></tr>'; echo '<tr><td>' . _('Date Updated') . ':</td> <td><input type="text" class="date" alt="' . $_SESSION['DefaultDateFormat'] . '" name="EffectiveFrom" maxlength=10 size=11 VALUE="' . $_POST['EffectiveFrom'] . '"></td></tr>'; echo '<tr><td>' . _('Our Unit of Measure') . ':</td>'; @@ -491,13 +489,13 @@ echo '<tr><td>' . _('Preferred Supplier') . ':</td> <td><select name="Preferred">'; if ($_POST['Preferred'] == 1) { - echo '<option selected VALUE=1>' . _('Yes'); - echo '<option VALUE=0>' . _('No'); + echo '<option selected VALUE=1>' . _('Yes') . '</option>'; + echo '<option VALUE=0>' . _('No') . '</option>'; } else { - echo '<option VALUE=1>' . _('Yes'); - echo '<option selected VALUE=0>' . _('No'); + echo '<option VALUE=1>' . _('Yes') . '</option>'; + echo '<option selected VALUE=0>' . _('No') . '</option>'; } - echo '</select></td></tr></table><br><div class="centre">'; + echo '</select></td></tr></table><br /><div class="centre">'; if (isset($_GET['Edit'])) { echo '<input type=submit name="UpdateRecord" VALUE="' . _('Update') . '">'; } else { @@ -506,10 +504,10 @@ echo '</div>'; echo '<div class="centre">'; if (isset($StockLocation) and isset($StockID) AND strlen($StockID) != 0) { - echo '<br><a href="' . $rootpath . '/StockStatus.php?' . SID . '&StockID=' . $StockID . '">' . _('Show Stock Status') . '</a>'; - echo '<br><a href="' . $rootpath . '/StockMovements.php?' . SID . '&StockID=' . $StockID . '&StockLocation=' . $StockLocation . '">' . _('Show Stock Movements') . '</a>'; - echo '<br><a href="' . $rootpath . '/SelectSalesOrder.php?' . SID . '&SelectedStockItem=' . $StockID . '&StockLocation=' . $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 . '&StockLocation=' . $StockLocation . '">' . _('Show Stock Movements') . '</a>'; + echo '<br /><a href="' . $rootpath . '/SelectSalesOrder.php?SelectedStockItem=' . $StockID . '&StockLocation=' . $StockLocation . '">' . _('Search Outstanding Sales Orders') . '</a>'; + echo '<br /><a href="' . $rootpath . '/SelectCompletedOrder.php?SelectedStockItem=' . $StockID . '">' . _('Search Completed Sales Orders') . '</a>'; } echo '</form></div>'; } Modified: trunk/StockReorderLevel.php =================================================================== --- trunk/StockReorderLevel.php 2011-03-31 08:32:24 UTC (rev 4527) +++ trunk/StockReorderLevel.php 2011-03-31 09:12:09 UTC (rev 4528) @@ -2,8 +2,6 @@ /* $Id$*/ -//$PageSecurity = 4; - include('includes/session.inc'); $title = _('Stock Re-Order Level Maintenance'); include('includes/header.inc'); @@ -14,7 +12,7 @@ $StockID = trim(strtoupper($_POST['StockID'])); } -echo "<a href='" . $rootpath . '/SelectProduct.php?' . SID . "'>" . _('Back to Items') . '</a>'; +echo '<a href="' . $rootpath . '/SelectProduct.php">' . _('Back to Items') . '</a>'; echo '<p class="page_title_text"><img src="'.$rootpath.'/css/'.$theme.'/images/inventory.png" title="' . _('Inventory') . '" alt="" /><b>' . $title. '</b></p>'; @@ -22,17 +20,19 @@ $result = DB_query("SELECT description, units FROM stockmaster WHERE stockid='$StockID'", $db); $myrow = DB_fetch_row($result); -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'] . '" />'; $sql = "SELECT locstock.loccode, locations.locationname, locstock.quantity, - locstock.reorderlevel - FROM locstock, - locations - WHERE locstock.loccode=locations.loccode - AND locstock.stockid = '" . $StockID . "' + locstock.reorderlevel, + stockmaster.decimalplaces + FROM locstock INNER JOIN locations + ON locstock.loccode=locations.loccode + INNER JOIN stockmaster + ON locstock.stockid=stockmaster.stockid + WHERE locstock.stockid = '" . $StockID . "' ORDER BY locstock.loccode"; $ErrMsg = _('The stock held at each location cannot be retrieved because'); @@ -40,16 +40,16 @@ $LocStockResult = DB_query($sql, $db, $ErrMsg, $DbgMsg); -echo "<table cellpadding=2 class=selection>"; +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><font color=BLUE size=3><b>' . $StockID . ' - ' . $myrow[0] . '</b> (' . _('In Units of') . ' ' . $myrow[1] . ')</font></th></tr>'; -$TableHeader = "<tr> - <th>" . _('Location') . "</th> - <th>" . _('Quantity On Hand') . "</th> - <th>" . _('Re-Order Level') . "</th> - </tr>"; +$TableHeader = '<tr> + <th>' . _('Location') . '</th> + <th>' . _('Quantity On Hand') . '</th> + <th>' . _('Re-Order Level') . '</th> + </tr>'; echo $TableHeader; $j = 1; @@ -92,10 +92,10 @@ //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?" . SID . "&StockID=$StockID'>" . _('Show Stock Movements') . '</a>'; -echo "<br><a href='$rootpath/StockUsage.php?" . SID . "&StockID=$StockID'>" . _('Show Stock Usage') . '</a>'; -echo "<br><a href='$rootpath/SelectSalesOrder.php?" . SID . "&SelectedStockItem=$StockID'>" . _('Search Outstanding Sales Orders') . '</a>'; -echo "<br><a href='$rootpath/SelectCompletedOrder.php?" . SID . "&SelectedStockItem=$StockID'>" . _('Search Completed Sales Orders') . '</a>'; +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/doc/Change.log.html =================================================================== --- trunk/doc/Change.log.html 2011-03-31 08:32:24 UTC (rev 4527) +++ trunk/doc/Change.log.html 2011-03-31 09:12:09 UTC (rev 4528) @@ -1,6 +1,6 @@ <p><font SIZE=4 COLOR=BLUE><b>webERP Change Log</b></font></p> <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> <p>30/3/11 Tim: New ReprintGRN.php script takes a purchase order and allows any line received to have GRN(s) reprinted</p> Modified: trunk/includes/GetConfig.php =================================================================== --- trunk/includes/GetConfig.php 2011-03-31 08:32:24 UTC (rev 4527) +++ trunk/includes/GetConfig.php 2011-03-31 09:12:09 UTC (rev 4528) @@ -40,31 +40,31 @@ /* Also reads all the company data set up in the company record and returns an array */ $sql= 'SELECT coyname, - gstno, - regoffice1, - regoffice2, - regoffice3, - regoffice4, - regoffice5, - regoffice6, - telephone, - fax, - email, - currencydefault, - debtorsact, - pytdiscountact, - creditorsact, - payrollact, - grnact, - exchangediffact, - purchasesexchangediffact, - retainedearnings, - freightact, - gllink_debtors, - gllink_creditors, - gllink_stock - FROM companies - WHERE coycode=1'; + gstno, + regoffice1, + regoffice2, + regoffice3, + regoffice4, + regoffice5, + regoffice6, + telephone, + fax, + email, + currencydefault, + debtorsact, + pytdiscountact, + creditorsact, + payrollact, + grnact, + exchangediffact, + purchasesexchangediffact, + retainedearnings, + freightact, + gllink_debtors, + gllink_creditors, + gllink_stock + FROM companies + WHERE coycode=1'; $ErrMsg = _('An error occurred accessing the database to retrieve the company information'); $ReadCoyResult = DB_query($sql,$db,$ErrMsg); Modified: trunk/includes/GetPaymentMethods.php =================================================================== --- trunk/includes/GetPaymentMethods.php 2011-03-31 08:32:24 UTC (rev 4527) +++ trunk/includes/GetPaymentMethods.php 2011-03-31 09:12:09 UTC (rev 4528) @@ -1,6 +1,6 @@ <?php /* $Id$*/ -// I Figure This is the fastest and safest way to load the Sections + $PaytTypes = array(); $ReceiptTypes = array(); @@ -9,12 +9,15 @@ receipttype FROM paymentmethods ORDER by paymentname'; + $PMResult = DB_query($sql,$db); while( $PMrow = DB_fetch_array($PMResult) ) { - if ($PMrow['paymenttype']==1) + if ($PMrow['paymenttype']==1) { $PaytTypes[] = $PMrow['paymentname']; - if ($PMrow['receipttype']==1) + } + if ($PMrow['receipttype']==1) { $ReceiptTypes[] = $PMrow['paymentname']; + } } DB_free_result($PMResult); // no longer needed ?> \ No newline at end of file Modified: trunk/includes/MiscFunctions.php =================================================================== --- trunk/includes/MiscFunctions.php 2011-03-31 08:32:24 UTC (rev 4527) +++ trunk/includes/MiscFunctions.php 2011-03-31 09:12:09 UTC (rev 4528) @@ -2,9 +2,9 @@ /* $Id$*/ -/********************************************/ +/* ****************************************** */ /** STANDARD MESSAGE HANDLING & FORMATTING **/ -/********************************************/ +/* ****************************************** */ function prnMsg($Msg,$Type='info', $Prefix=''){ @@ -231,21 +231,7 @@ }//wikiLink -function DecimalPlaces($currcode, $db) { - $sql='SELECT decimalplaces FROM currencies WHERE currabrev="'.$currcode.'"'; - $result=DB_query($sql, $db); - $myrow=DB_fetch_array($result); - return $myrow['decimalplaces']; -} -function StockDecimalPlaces($StockID, $db) { - $sql='SELECT decimalplaces FROM stockmaster WHERE stockid="'.$StockID.'"'; - $result=DB_query($sql, $db); - $myrow=DB_fetch_array($result); - return $myrow['decimalplaces']; -} - - // Lindsay debug stuff function LogBackTrace( $dest = 0 ) { error_log( "***BEGIN STACK BACKTRACE***", $dest ); Modified: trunk/includes/PO_ReadInOrder.inc =================================================================== --- trunk/includes/PO_ReadInOrder.inc 2011-03-31 08:32:24 UTC (rev 4527) +++ trunk/includes/PO_ReadInOrder.inc 2011-03-31 09:12:09 UTC (rev 4528) @@ -15,45 +15,45 @@ /*read in all the guff from the selected order into the PO PurchOrder Class variable */ - $OrderHeaderSQL = 'SELECT purchorders.supplierno, - suppliers.suppname, - purchorders.comments, - purchorders.orddate, - purchorders.rate, - purchorders.dateprinted, - purchorders.deladd1, - purchorders.deladd2, - purchorders.deladd3, - purchorders.deladd4, - purchorders.deladd5, - purchorders.deladd6, - purchorders.tel, - purchorders.suppdeladdress1, - purchorders.suppdeladdress2, - purchorders.suppdeladdress3, - purchorders.suppdeladdress4, - purchorders.suppdeladdress5, - purchorders.suppdeladdress6, - purchorders.suppliercontact, - purchorders.supptel, - purchorders.contact, - purchorders.allowprint, - purchorders.requisitionno, - purchorders.intostocklocation, - purchorders.initiator, - purchorders.version, - purchorders.status, - purchorders.stat_comment, - purchorders.deliverydate, - purchorders.port, - suppliers.currcode, - locations.managed , - purchorders.paymentterms - FROM purchorders - INNER JOIN locations ON purchorders.intostocklocation=locations.loccode, - suppliers - WHERE purchorders.supplierno = suppliers.supplierid - AND purchorders.orderno = ' . $_GET['ModifyOrderNumber']; + $OrderHeaderSQL = "SELECT purchorders.supplierno, + suppliers.suppname, + purchorders.comments, + purchorders.orddate, + purchorders.rate, + purchorders.dateprinted, + purchorders.deladd1, + purchorders.deladd2, + purchorders.deladd3, + purchorders.deladd4, + purchorders.deladd5, + purchorders.deladd6, + purchorders.tel, + purchorders.suppdeladdress1, + purchorders.suppdeladdress2, + purchorders.suppdeladdress3, + purchorders.suppdeladdress4, + purchorders.suppdeladdress5, + purchorders.suppdeladdress6, + purchorders.suppliercontact, + purchorders.supptel, + purchorders.contact, + purchorders.allowprint, + purchorders.requisitionno, + purchorders.intostocklocation, + purchorders.initiator, + purchorders.version, + purchorders.status, + purchorders.stat_comment, + purchorders.deliverydate, + purchorders.port, + suppliers.currcode, + locations.managed , + purchorders.paymentterms + FROM purchorders + INNER JOIN locations ON purchorders.intostocklocation=locations.loccode, + suppliers + WHERE purchorders.supplierno = suppliers.supplierid + AND purchorders.orderno = '" . $_GET['ModifyOrderNumber'] . "'"; $ErrMsg = _('The order cannot be retrieved because'); $DbgMsg = _('The SQL statement that was used and failed was'); @@ -100,17 +100,17 @@ $_SESSION['PO'.$identifier]->PaymentTerms= $myrow['paymentterms']; $SupplierSQL = "SELECT suppliers.supplierid, - suppliers.suppname, - suppliers.address1, - suppliers.address2, - suppliers.address3, - suppliers.address4, - suppliers.address5, - suppliers.address6, - suppliers.currcode - FROM suppliers - WHERE suppliers.supplierid='" . $_SESSION['PO'.$identifier]->SupplierID."' - ORDER BY suppliers.supplierid"; + suppliers.suppname, + suppliers.address1, + suppliers.address2, + suppliers.address3, + suppliers.address4, + suppliers.address5, + suppliers.address6, + suppliers.currcode + FROM suppliers + WHERE suppliers.supplierid='" . $_SESSION['PO'.$identifier]->SupplierID."' + ORDER BY suppliers.supplierid"; $ErrMsg = _('The searched supplier records requested cannot be retrieved because'); $result_SuppSelect = DB_query($SupplierSQL,$db,$ErrMsg); @@ -125,47 +125,47 @@ /*now populate the line PO array with the purchase order details records */ $LineItemsSQL = "SELECT podetailitem, - purchorderdetails.itemcode, - stockmaster.description, - purchorderdetails.deliverydate, - purchorderdetails.itemdescription, - glcode, - accountname, - purchorderdetails.qtyinvoiced, - purchorderdetails.unitprice, - stockmaster.units, - purchorderdetails.quantityord, - purchorderdetails.quantityrecd, - purchorderdetails.shiptref, - purchorderdetails.completed, - purchorderdetails.jobref, - purchorderdetails.stdcostunit, - purchorderdetails.itemno, - stockmaster.controlled, - stockmaster.serialised, - stockmaster.decimalplaces, - purchorderdetails.subtotal_amount, - purchorderdetails.package, - purchorderdetails.pcunit, - purchorderdetails.netweight, - purchorderdetails.kgs, - purchorderdetails.cuft, - purchorderdetails.total_quantity, - purchorderdetails.total_amount, - purchorderdetails.assetid, - purchorderdetails.conversionfactor, - purchorderdetails.suppliersunit, - purchorderdetails.suppliers_partno - FROM purchorderdetails - LEFT JOIN stockmaster - ON purchorderdetails.itemcode=stockmaster.stockid - INNER JOIN purchorders - ON purchorders.orderno=purchorderdetails.orderno - LEFT JOIN chartmaster - ON purchorderdetails.glcode=chartmaster.accountcode - WHERE purchorderdetails.completed=0 - AND purchorderdetails.orderno ='" . $_GET['ModifyOrderNumber'] . "' - ORDER BY podetailitem"; + purchorderdetails.itemcode, + stockmaster.description, + purchorderdetails.deliverydate, + purchorderdetails.itemdescription, + glcode, + accountname, + purchorderdetails.qtyinvoiced, + purchorderdetails.unitprice, + stockmaster.units, + purchorderdetails.quantityord, + purchorderdetails.quantityrecd, + purchorderdetails.shiptref, + purchorderdetails.completed, + purchorderdetails.jobref, + purchorderdetails.stdcostunit, + purchorderdetails.itemno, + stockmaster.controlled, + stockmaster.serialised, + stockmaster.decimalplaces, + purchorderdetails.subtotal_amount, + purchorderdetails.package, + purchorderdetails.pcunit, + purchorderdetails.netweight, + purchorderdetails.kgs, + purchorderdetails.cuft, + purchorderdetails.total_quantity, + purchorderdetails.total_amount, + purchorderdetails.assetid, + purchorderdetails.conversionfactor, + purchorderdetails.suppliersunit, + purchorderdetails.suppliers_partno + FROM purchorderdetails + LEFT JOIN stockmaster + ON purchorderdetails.itemcode=stockmaster.stockid + INNER JOIN purchorders + ON purchorders.orderno=purchorderdetails.orderno + LEFT JOIN chartmaster + ON purchorderdetails.glcode=chartmaster.accountcode + WHERE purchorderdetails.completed=0 + AND purchorderdetails.orderno ='" . $_GET['ModifyOrderNumber'] . "' + ORDER BY podetailitem"; $ErrMsg = _('The lines on the purchase order cannot be retrieved because'); $DbgMsg = _('The SQL statement that was used to retrieve the purchase order lines was'); @@ -192,36 +192,36 @@ } $_SESSION['PO'.$identifier]->add_to_order($_SESSION['PO'.$identifier]->LinesOnOrder+1, - $StockID, - $myrow['serialised'], - $myrow['controlled'], - $myrow['quantityord'], - stripslashes($myrow['itemdescription']), - $myrow['unitprice'], - $Units, - $GLCode, - ConvertSQLDate($myrow['deliverydate']), - $myrow['shiptref'], - $myrow['completed'], - $myrow['jobref'], - $myrow['qtyinvoiced'], - $myrow['quantityrecd'], - $myrow['accountname'], - $myrow['decimalplaces'], - $myrow['itemno'], - $myrow['suppliersunit'], - $myrow['conversionfactor'], - $myrow['suppliers_partno'], - $myrow['subtotal_amount'], - 0, - $myrow['package'], - $myrow['pcunit'], - $myrow['netweight'], - $myrow['kgs'], - $myrow['cuft'], - $myrow['total_quantity'], - $myrow['total_amount'], - $myrow['assetid'] ); + $StockID, + $myrow['serialised'], + $myrow['controlled'], + $myrow['quantityord'], + stripslashes($myrow['itemdescription']), + $myrow['unitprice'], + $Units, + $GLCode, + ConvertSQLDate($myrow['deliverydate']), + $myrow['shiptref'], + $myrow['completed'], + $myrow['jobref'], + $myrow['qtyinvoiced'], + $myrow['quantityrecd'], + $myrow['accountname'], + $myrow['decimalplaces'], + $myrow['itemno'], + $myrow['suppliersunit'], + $myrow['conversionfactor'], + $myrow['suppliers_partno'], + $myrow['subtotal_amount'], + 0, + $myrow['package'], + $myrow['pcunit'], + $myrow['netweight'], + $myrow['kgs'], + $myrow['cuft'], + $myrow['total_quantity'], + $myrow['total_amount'], + $myrow['assetid'] ); $_SESSION['PO'.$identifier]->LineItems[$_SESSION['PO'.$identifier]->LinesOnOrder]->PODetailRec = $myrow['podetailitem']; $_SESSION['PO'.$identifier]->LineItems[$_SESSION['PO'.$identifier]->LinesOnOrder]->StandardCost = $myrow['stdcostunit']; /*Needed for receiving goods and GL interface */ Modified: trunk/includes/SQL_CommonFunctions.inc =================================================================== --- trunk/includes/SQL_CommonFunctions.inc 2011-03-31 08:32:24 UTC (rev 4527) +++ trunk/includes/SQL_CommonFunctions.inc 2011-03-31 09:12:09 UTC (rev 4528) @@ -18,7 +18,7 @@ DB_query('LOCK TABLES systypes WRITE',$db); - $SQL = 'SELECT typeno FROM systypes WHERE typeid = ' . $TransType; + $SQL = "SELECT typeno FROM systypes WHERE typeid = '" . $TransType . "'"; $ErrMsg = _('CRITICAL ERROR') . '! ' . _('NOTE DOWN THIS ERROR AND SEEK ASSISTANCE') . ': <BR>' . _('The next transaction number could not be retrieved from the database because'); $DbgMsg = _('The following SQL to retrieve the transaction number was used'); @@ -26,12 +26,12 @@ $myrow = DB_fetch_row($GetTransNoResult); - $SQL = 'UPDATE systypes SET typeno = ' . ($myrow[0] + 1) . ' WHERE typeid = ' . $TransType; + $SQL = "UPDATE systypes SET typeno = '" . ($myrow[0] + 1) . "' WHERE typeid = '" . $TransType . "'"; $ErrMsg = _('CRITICAL ERROR') . '! ' . _('NOTE DOWN THIS ERROR AND SEEK ASSISTANCE') . ': ' . _('The transaction number could not be incremented'); $DbgMsg = _('The following SQL to increment the transaction number was used'); $UpdTransNoResult = DB_query($SQL,$db,$ErrMsg,$DbgMsg); - DB_query("UNLOCK TABLES",$db); + DB_query('UNLOCK TABLES',$db); return $myrow[0] + 1; } @@ -41,14 +41,13 @@ /*Gets the GL Codes relevant to the stock item account from the stock category record */ $QuerySQL = "SELECT stockact, - adjglact, - purchpricevaract, - materialuseagevarac, - wipact - FROM stockmaster, - stockcategory - WHERE stockmaster.categoryid=stockcategory.categoryid - AND stockmaster.stockid = '" . $StockID . "'"; + adjglact, + purchpricevaract, + materialuseagevarac, + wipact + FROM stockmaster INNER JOIN stockcategory + ON stockmaster.categoryid=stockcategory.categoryid + WHERE stockmaster.stockid = '" . $StockID . "'"; $ErrMsg = _('The stock GL codes could not be retrieved because'); $GetStkGLResult = DB_query($QuerySQL, $db, $ErrMsg); @@ -62,10 +61,10 @@ /*Gets the Tax rate applicable to an item from the TaxAuthority of the branch and TaxLevel of the item */ $QuerySQL = "SELECT taxrate - FROM taxauthrates - WHERE taxauthority='" . $TaxAuthority . "' - AND dispatchtaxprovince='" . $DispatchTaxProvince . "' - AND taxcatid = '" . $TaxCategory . "'"; + FROM taxauthrates + WHERE taxauthority='" . $TaxAuthority . "' + AND dispatchtaxprovince='" . $DispatchTaxProvince . "' + AND taxcatid = '" . $TaxCategory . "'"; $ErrMsg = _('The tax rate for this item could not be retrieved because'); $GetTaxRateResult = DB_query($QuerySQL,$db,$ErrMsg); @@ -168,19 +167,19 @@ $ValueOfChange = $QOH * ($NewCost - $OldCost); $SQL = "INSERT INTO gltrans (type, - typeno, - trandate, - periodno, - account, - narrative, - amount) - VALUES (35, - " . $CostUpdateNo . ", + typeno, + trandate, + periodno, + account, + narrative, + amount) + VALUES ('35', + '" . $CostUpdateNo . "', '" . Date('Y-m-d') . "', - " . $PeriodNo . ", - " . $StockGLCode['adjglact'] . ", + '" . $PeriodNo . "', + '" . $StockGLCode['adjglact'] . "', '" . $StockID . ' ' . _('cost was') . ' ' . $OldCost . ' ' . _('changed to') . ' ' . $NewCost . ' x ' . _('Quantity on hand of') . ' ' . $QOH . "', - " . (-$ValueOfChange) . ")"; + '" . (-$ValueOfChange) . "')"; $ErrMsg = _('CRITICAL ERROR') . '! ' . _('NOTE DOWN THIS ERROR AND SEEK ASSISTANCE') . ': ' . _('The GL credit for the stock cost adjustment posting could not be inserted because'); $DbgMsg = _('The following SQL to insert the GLTrans record was used'); @@ -193,13 +192,13 @@ account, narrative, amount) - VALUES (35, - " . $CostUpdateNo . ", + VALUES ('35', + '" . $CostUpdateNo . "', '" . Date('Y-m-d') . "', - " . $PeriodNo . ", - " . $StockGLCode['stockact'] . ", + '" . $PeriodNo . "', + '" . $StockGLCode['stockact'] . "', '" . $StockID . ' ' . _('cost was') . ' ' . $OldCost . ' ' . _('changed to') .' ' . $NewCost . ' x ' . _('Quantity on hand of') . ' ' . $QOH . "', - " . $ValueOfChange . ")"; + '" . $ValueOfChange . "')"; $ErrMsg = _('CRITICAL ERROR') . '! ' . _('NOTE DOWN THIS ERROR AND SEEK ASSISTANCE') . ': ' . _('The GL debit for stock cost adjustment posting could not be inserted because'); $DbgMsg = _('The following SQL to insert the GLTrans record was used'); @@ -231,10 +230,10 @@ } /*Iterates through the levels of the bom, recalculating each bom it meets*/ -function UpdateCost($db, $item) { - $SQL = "SELECT parent FROM bom where component = '" . $item . "'"; - $result = DB_query($SQL, $db); - while ($MyRow=DB_fetch_array($result)){ +function UpdateCost($db, $Item) { + $SQL = "SELECT parent FROM bom where component = '" . $Item . "'"; + $Result = DB_query($SQL, $db); + while ($MyRow=DB_fetch_array($Result)){ $NewParent = $MyRow['parent']; $MaterialCost = BomMaterialCost($NewParent, $db); $SQL = 'UPDATE stockmaster SET materialcost=' . $MaterialCost . " WHERE stockid='" . $NewParent . "'"; @@ -264,7 +263,7 @@ qtypu, stdcost, autoissue) - SELECT " . $WO . ", + SELECT '" . $WO . "', '" . $ParentID . "', bom.component, bom.quantity*" . $Qty . ", @@ -278,7 +277,7 @@ AND bom.component NOT IN ( SELECT stockid FROM worequirements - WHERE wo = " . $WO . " + WHERE wo = '" . $WO . "' AND parentstockid = '" . $ParentID . "' )"; $result = DB_query($sql, $db); @@ -304,7 +303,7 @@ AND bom.component IN ( SELECT stockid FROM worequirements - WHERE wo = " . $WO . " + WHERE wo = '" . $WO . "' AND parentstockid = '". $ParentID . "' ) ) AS g ON g.wo=worequirements.wo Modified: trunk/locale/zh_CN.utf8/Manual/ManualAPIFunctions.php =================================================================== --- trunk/locale/zh_CN.utf8/Manual/ManualAPIFunctions.php 2011-03-31 08:32:24 UTC (rev 4527) +++ trunk/locale/zh_CN.utf8/Manual/ManualAPIFunctions.php 2011-03-31 09:12:09 UTC (rev 4528) @@ -19,7 +19,7 @@ echo '<body>'; $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]; This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <dai...@us...> - 2011-03-31 09:12:16
|
Revision: 4528 http://web-erp.svn.sourceforge.net/web-erp/?rev=4528&view=rev Author: daintree Date: 2011-03-31 09:12:09 +0000 (Thu, 31 Mar 2011) Log Message: ----------- more SQL fixes - Purchase order creation from SelectProduct link Modified Paths: -------------- trunk/GLTrialBalance_csv.php trunk/PDFPrintLabel.php trunk/PO_Header.php trunk/PurchData.php trunk/StockReorderLevel.php trunk/doc/Change.log.html trunk/includes/GetConfig.php trunk/includes/GetPaymentMethods.php trunk/includes/MiscFunctions.php trunk/includes/PO_ReadInOrder.inc trunk/includes/SQL_CommonFunctions.inc trunk/locale/zh_CN.utf8/Manual/ManualAPIFunctions.php Modified: trunk/GLTrialBalance_csv.php =================================================================== --- trunk/GLTrialBalance_csv.php 2011-03-31 08:32:24 UTC (rev 4527) +++ trunk/GLTrialBalance_csv.php 2011-03-31 09:12:09 UTC (rev 4528) @@ -1,6 +1,6 @@ <?php -/* $Id*/ +/* $Id$*/ /*Through deviousness and cunning, this system allows trial balances for any date range that recalcuates the p & l balances and shows the balance sheets as at the end of the period selected - so first off need to show the input of criteria screen @@ -9,10 +9,9 @@ /*Needs to have FromPeriod and ToPeriod sent with URL * also need to work on authentication with username and password sent too*/ -//$PageSecurity = 8; + $AllowAnyone =true; -//$_POST['UserNameEntryField'] = $_GET['Identifier']; -//$_POST['Password'] = $_GET['IdentifierCheck']; + //Page must be called with GLTrialBalance_csv.php?CompanyName=XXXXX&FromPeriod=Y&ToPeriod=Z $_POST['CompanyNameField'] = $_GET['CompanyName']; //$_SERVER['PHP_SELF'] = dirname($_SERVER['PHP_SELF']) .'/GLTrialBalance_csv.php?ToPeriod=' . $_GET['ToPeriod'] . '&FromPeriod=' . $_GET['FromPeriod']; @@ -26,17 +25,17 @@ $RetainedEarningsAct = $_SESSION['CompanyRecord']['retainedearnings']; -$SQL = 'SELECT accountgroups.groupname, +$SQL = "SELECT accountgroups.groupname, accountgroups.parentgroupname, accountgroups.pandl, chartdetails.accountcode , chartmaster.accountname, - Sum(CASE WHEN chartdetails.period=' . $_GET['FromPeriod'] . ' THEN chartdetails.bfwd ELSE 0 END) AS firstprdbfwd, - Sum(CASE WHEN chartdetails.period=' . $_GET['FromPeriod'] . ' THEN chartdetails.bfwdbudget ELSE 0 END) AS firstprdbudgetbfwd, - Sum(CASE WHEN chartdetails.period=' . $_GET['ToPeriod'] . ' THEN chartdetails.bfwd + chartdetails.actual ELSE 0 END) AS lastprdcfwd, - Sum(CASE WHEN chartdetails.period=' . $_GET['ToPeriod'] . ' THEN chartdetails.actual ELSE 0 END) AS monthactual, - Sum(CASE WHEN chartdetails.period=' . $_GET['ToPeriod'] . ' THEN chartdetails.budget ELSE 0 END) AS monthbudget, - Sum(CASE WHEN chartdetails.period=' . $_GET['ToPeriod'] . ' THEN chartdetails.bfwdbudget + chartdetails.budget ELSE 0 END) AS lastprdbudgetcfwd + Sum(CASE WHEN chartdetails.period='" . $_GET['FromPeriod'] . "' THEN chartdetails.bfwd ELSE 0 END) AS firstprdbfwd, + Sum(CASE WHEN chartdetails.period='" . $_GET['FromPeriod'] . "' THEN chartdetails.bfwdbudget ELSE 0 END) AS firstprdbudgetbfwd, + Sum(CASE WHEN chartdetails.period='" . $_GET['ToPeriod'] . "' THEN chartdetails.bfwd + chartdetails.actual ELSE 0 END) AS lastprdcfwd, + Sum(CASE WHEN chartdetails.period='" . $_GET['ToPeriod'] . "' THEN chartdetails.actual ELSE 0 END) AS monthactual, + Sum(CASE WHEN chartdetails.period='" . $_GET['ToPeriod'] . "' THEN chartdetails.budget ELSE 0 END) AS monthbudget, + Sum(CASE WHEN chartdetails.period='" . $_GET['ToPeriod'] . "' THEN chartdetails.bfwdbudget + chartdetails.budget ELSE 0 END) AS lastprdbudgetcfwd FROM chartmaster INNER JOIN accountgroups ON chartmaster.group_ = accountgroups.groupname INNER JOIN chartdetails ON chartmaster.accountcode= chartdetails.accountcode GROUP BY accountgroups.groupname, @@ -48,7 +47,7 @@ ORDER BY accountgroups.pandl desc, accountgroups.sequenceintb, accountgroups.groupname, - chartdetails.accountcode'; + chartdetails.accountcode"; $AccountsResult = DB_query($SQL,$db); @@ -78,15 +77,6 @@ function stripcomma($str) { //because we're using comma as a delimiter return str_replace(",", "", $str); } -/* -$len = strlen($CSV_File); -header('Content-type: application/csv'); -header('Content-Length: ' . $len ); -header('Content-Disposition: inline; filename=GLTrialBalance.csv'); -header('Expires: 0'); -header('Cache-Control: must-revalidate, post-check=0, pre-check=0'); -header('Pragma: public'); -*/ echo $CSV_File; ?> \ No newline at end of file Modified: trunk/PDFPrintLabel.php =================================================================== --- trunk/PDFPrintLabel.php 2011-03-31 08:32:24 UTC (rev 4527) +++ trunk/PDFPrintLabel.php 2011-03-31 09:12:09 UTC (rev 4528) @@ -1,9 +1,8 @@ <?php -/* $Revision: 1.2 $ */ -//$PageSecurity = 10; +/* $Id: PDFPrintLabel.php 4285 2010-12-22 16:01:51Z tim_schofield $*/ -$Version_adds= "1.2"; +$Version_adds= '1.2'; include('includes/session.inc'); require_once('includes/DefineLabelClass.php'); @@ -19,7 +18,7 @@ // If there is no label templates, the user could select to set up a new one if ($AllLabels==null) { echo '<br/><br/>'; - abortMsg( _("There isn't any label template to select for printing. Click") . + abortMsg( _('There isn\'t any label template to select for printing. Click') . ' <a href="Labels.php"><b>' . _('HERE'). '</b></a> '. _('to set up a new one') ); } @@ -189,15 +188,15 @@ } function selSalesType($type) { - return selectTable("SELECT typeabbrev, sales_type FROM salestypes ORDER BY sales_type", $type); + return selectTable('SELECT typeabbrev, sales_type FROM salestypes ORDER BY sales_type', $type); } function selCurrency($curr) { - return selectTable("SELECT currabrev, currency FROM currencies", $curr); + return selectTable('SELECT currabrev, currency FROM currencies', $curr); } function selCategory(&$categ) { - return selectTable("SELECT categoryid, categorydescription FROM stockcategory ORDER BY categorydescription", $categ); + return selectTable('SELECT categoryid, categorydescription FROM stockcategory ORDER BY categorydescription', $categ); } function selectTable($sql, &$currentKey) { Modified: trunk/PO_Header.php =================================================================== --- trunk/PO_Header.php 2011-03-31 08:32:24 UTC (rev 4527) +++ trunk/PO_Header.php 2011-03-31 09:12:09 UTC (rev 4528) @@ -46,8 +46,8 @@ if (isset($_POST['Select']) and empty($_POST['SupplierContact'])) { $sql = "SELECT contact - FROM suppliercontacts - WHERE supplierid='". $_POST['Select'] ."'"; + FROM suppliercontacts + WHERE supplierid='". $_POST['Select'] ."'"; $SuppCoResult = DB_query($sql,$db); if (DB_num_rows($SuppCoResult)>0) { @@ -158,8 +158,8 @@ } //end if there is actually a status change the class Status != the POST['Status'] } - -if (isset($_GET['NewOrder']) and isset($_GET['StockID']) and isset($_GET['SelectedSupplier'])) { +/*New order initiated by user clicking on supplier purchasing data from items page */ +if (isset($_GET['NewOrder']) AND isset($_GET['StockID']) AND isset($_GET['SelectedSupplier'])) { /* * initialise a new order */ @@ -312,7 +312,7 @@ suppliers.address6, suppliers.currcode FROM suppliers - WHERE suppliers.suppname LIKE '". $SearchString ."' + WHERE suppliers.suppname " . LIKE . " '". $SearchString ."' ORDER BY suppliers.suppname"; } elseif (strlen($_POST['SuppCode'])>0){ @@ -326,7 +326,7 @@ suppliers.address6, suppliers.currcode FROM suppliers - WHERE suppliers.supplierid LIKE '%" . $_POST['SuppCode'] . "%' + WHERE suppliers.supplierid " . LIKE . " '%" . $_POST['SuppCode'] . "%' ORDER BY suppliers.supplierid"; } @@ -371,7 +371,7 @@ if (isset($_POST['Select'])) { -/* will only be true if page called from supplier selection form +/* will only be true if page called from supplier selection form or item purchasing data order link * or set because only one supplier record returned from a search */ @@ -501,8 +501,9 @@ } // part of step 1 -if ($_SESSION['RequireSupplierSelection'] ==1 OR !isset($_SESSION['PO'.$identifier]->SupplierID) OR - $_SESSION['PO'.$identifier]->SupplierID=='' ) { +if ($_SESSION['RequireSupplierSelection'] ==1 + OR !isset($_SESSION['PO'.$identifier]->SupplierID) + OR $_SESSION['PO'.$identifier]->SupplierID=='' ) { echo '<p class="page_title_text"><img src="'.$rootpath.'/css/'.$theme.'/images/supplier.png" title="' . _('Purchase Order') . '" alt="">' . ' ' . _('Purchase Order: Select Supplier') . ''; @@ -586,13 +587,14 @@ } if (isset($Purch_Item)) { + /*This is set if the user hits the link from the supplier purchasing info shown on SelectProduct.php */ prnMsg(_('Purchase Item(s) with this code') . ': ' . $Purch_Item,'info'); echo '<div class="centre">'; echo '<br><table class="table_index"><tr><td class="menu_group_item">'; /* the link */ - echo '<li><a href="'.$rootpath.'/PO_Items.php?' . SID . 'NewItem=' . $Purch_Item . '&identifier=' . $identifier . '">' . _('Enter Line Item to this purchase order') . '</a></li>'; + echo '<li><a href="'.$rootpath.'/PO_Items.php?NewItem=' . $Purch_Item . '&identifier=' . $identifier . '">' . _('Enter Line Item to this purchase order') . '</a></li>'; echo '</td></tr></table></div><br>'; @@ -629,9 +631,9 @@ $Purch_Item, $PurchItemRow['serialised'], $PurchItemRow['controlled'], - $Qty, + $Qty*$PurchItemRow['conversionfactor'], $PurchItemRow['description'], - $PurchItemRow['price'], + $PurchItemRow['price']/$PurchItemRow['conversionfactor'], $PurchItemRow['units'], $PurchItemRow['stockact'], date($_SESSION['DefaultDateFormat']), Modified: trunk/PurchData.php =================================================================== --- trunk/PurchData.php 2011-03-31 08:32:24 UTC (rev 4527) +++ trunk/PurchData.php 2011-03-31 09:12:09 UTC (rev 4528) @@ -1,8 +1,6 @@ <?php /* $Id$*/ -//$PageSecurity = 4; Now comes from DB - include ('includes/session.inc'); $title = _('Supplier Purchasing Data'); @@ -60,50 +58,49 @@ if (!is_numeric($_POST['ConversionFactor'])) { $InputError = 1; unset($_POST['ConversionFactor']); - prnMsg(_('The conversion factor entered was not numeric') . ' (' . _('a number is expected') . '). ' . _('The conversion factor is the number which the price must be divided by to get the unit price in our unit of measure') . '. <br>' . _('E.g.') . ' ' . _('The supplier sells an item by the tonne and we hold stock by the kg') . '. ' . _('The suppliers price must be divided by 1000 to get to our cost per kg') . '. ' . _('The conversion factor to enter is 1000') . '. <br><br>' . _('No changes will be made to the database'), 'error'); + prnMsg(_('The conversion factor entered was not numeric') . ' (' . _('a number is expected') . '). ' . _('The conversion factor is the number which the price must be divided by to get the unit price in our unit of measure') . '. <br />' . _('E.g.') . ' ' . _('The supplier sells an item by the tonne and we hold stock by the kg') . '. ' . _('The suppliers price must be divided by 1000 to get to our cost per kg') . '. ' . _('The conversion factor to enter is 1000') . '. <br /><br />' . _('No changes will be made to the database'), 'error'); } if ($InputError == 0 AND isset($_POST['AddRecord'])) { $sql = "INSERT INTO purchdata (supplierno, - stockid, - price, - effectivefrom, - suppliersuom, - conversionfactor, - supplierdescription, - suppliers_partno, - leadtime, - minorderqty, - preferred) - VALUES ('" . $SupplierID . "', - '" . $StockID . "', - '" . $_POST['Price'] . "', - '" . FormatDateForSQL($_POST['EffectiveFrom']) . "', - '" . $_POST['SuppliersUOM'] . "', - '" . $_POST['ConversionFactor'] . "', - '" . $_POST['SupplierDescription'] . "', - '" . $_POST['SupplierCode'] . "', - '" . $_POST['LeadTime'] . "', - '" . $_POST['MinOrderQty'] . "', - '" . $_POST['Preferred'] . "')"; + stockid, + price, + effectivefrom, + suppliersuom, + conversionfactor, + supplierdescription, + suppliers_partno, + leadtime, + minorderqty, + preferred) + VALUES ('" . $SupplierID . "', + '" . $StockID . "', + '" . $_POST['Price'] . "', + '" . FormatDateForSQL($_POST['EffectiveFrom']) . "', + '" . $_POST['SuppliersUOM'] . "', + '" . $_POST['ConversionFactor'] . "', + '" . $_POST['SupplierDescription'] . "', + '" . $_POST['SupplierCode'] . "', + '" . $_POST['LeadTime'] . "', + '" . $_POST['MinOrderQty'] . "', + '" . $_POST['Preferred'] . "')"; $ErrMsg = _('The supplier purchasing details could not be added to the database because'); $DbgMsg = _('The SQL that failed was'); $AddResult = DB_query($sql, $db, $ErrMsg, $DbgMsg); prnMsg(_('This supplier purchasing data has been added to the database'), 'success'); } if ($InputError == 0 AND isset($_POST['UpdateRecord'])) { - $sql = "UPDATE purchdata SET - price='" . $_POST['Price'] . "', - effectivefrom='" . FormatDateForSQL($_POST['EffectiveFrom']) . "', - suppliersuom='" . $_POST['SuppliersUOM'] . "', - conversionfactor='" . $_POST['ConversionFactor'] . "', - supplierdescription='" . $_POST['SupplierDescription'] . "', - suppliers_partno='" . $_POST['SupplierCode'] . "', - leadtime='" . $_POST['LeadTime'] . "', - minorderqty='" . $_POST['MinOrderQty'] . "', - preferred='" . $_POST['Preferred'] . "' + $sql = "UPDATE purchdata SET price='" . $_POST['Price'] . "', + effectivefrom='" . FormatDateForSQL($_POST['EffectiveFrom']) . "', + suppliersuom='" . $_POST['SuppliersUOM'] . "', + conversionfactor='" . $_POST['ConversionFactor'] . "', + supplierdescription='" . $_POST['SupplierDescription'] . "', + suppliers_partno='" . $_POST['SupplierCode'] . "', + leadtime='" . $_POST['LeadTime'] . "', + minorderqty='" . $_POST['MinOrderQty'] . "', + preferred='" . $_POST['Preferred'] . "' WHERE purchdata.stockid='".$StockID."' AND purchdata.supplierno='".$SupplierID."' - AND purchdata.effectivefrom='" . $_POST['WasEffectiveFrom'] . "'"; + AND purchdata.effectivefrom='" . $_POST['WasEffectiveFrom'] . "'"; $ErrMsg = _('The supplier purchasing details could not be update because'); $DbgMsg = _('The SQL that failed was'); $UpdResult = DB_query($sql, $db, $ErrMsg, $DbgMsg); @@ -195,38 +192,36 @@ $DisplayPreferred = _('No'); } printf("<td>%s</td> - <td class=number>%s</td> - <td>%s</td> - <td class=number>%s</td> - <td class=number>%s</td> - <td>%s</td> - <td>%s</td> - <td>%s</td> - <td>%s " . _('days') . "</td> - <td>%s</td> - <td><a href='%s?%s&StockID=%s&SupplierID=%s&Edit=1&EffectiveFrom=%s'>" . _('Edit') . "</a></td> - <td><a href='%s?%s&StockID=%s&SupplierID=%s&Delete=1&EffectiveFrom=%s' onclick=\"return confirm('" . _('Are you sure you wish to delete this suppliers price?') . "');\">" . _('Delete') . "</a></td> - </tr>", - $myrow['suppname'], - number_format($myrow['price'], 3), - $myrow['unitname'], - $myrow['conversionfactor'], - number_format($myrow['price']/$myrow['conversionfactor'],2), - $myrow['currcode'], - ConvertSQLDate($myrow['effectivefrom']), - $myrow['minorderqty'], - $myrow['leadtime'], - $DisplayPreferred, - $_SERVER['PHP_SELF'], - SID, - $StockID, - $myrow['supplierno'], - $myrow['effectivefrom'], - $_SERVER['PHP_SELF'], - SID, - $StockID, - $myrow['supplierno'], - $myrow['effectivefrom']); + <td class=number>%s</td> + <td>%s</td> + <td class=number>%s</td> + <td class=number>%s</td> + <td>%s</td> + <td>%s</td> + <td>%s</td> + <td>%s " . _('days') . "</td> + <td>%s</td> + <td><a href='%s?StockID=%s&SupplierID=%s&Edit=1&EffectiveFrom=%s'>" . _('Edit') . "</a></td> + <td><a href='%s?StockID=%s&SupplierID=%s&Delete=1&EffectiveFrom=%s' onclick=\"return confirm('" . _('Are you sure you wish to delete this suppliers price?') . "');\">" . _('Delete') . "</a></td> + </tr>", + $myrow['suppname'], + number_format($myrow['price'], 3), + $myrow['unitname'], + $myrow['conversionfactor'], + number_format($myrow['price']/$myrow['conversionfactor'],2), + $myrow['currcode'], + ConvertSQLDate($myrow['effectivefrom']), + $myrow['minorderqty'], + $myrow['leadtime'], + $DisplayPreferred, + $_SERVER['PHP_SELF'], + $StockID, + $myrow['supplierno'], + $myrow['effectivefrom'], + $_SERVER['PHP_SELF'], + $StockID, + $myrow['supplierno'], + $myrow['effectivefrom']); } //end of while loop echo '</table><br/>'; if ($CountPreferreds > 1) { @@ -278,7 +273,7 @@ if (isset($_POST['SearchSupplier'])) { if (isset($_POST['Keywords']) AND isset($_POST['SupplierCode'])) { prnMsg( _('Supplier Name keywords have been used in preference to the Supplier Code extract entered') . '.', 'info' ); - echo '<br>'; + echo '<br />'; } if ($_POST['Keywords'] == '' AND $_POST['SupplierCode'] == '') { $_POST['Keywords'] = ' '; @@ -293,7 +288,7 @@ suppliers.address1, suppliers.address2, suppliers.address3 - FROM suppliers WHERE suppliers.suppname LIKE " ."'".$SearchString."'"; + FROM suppliers WHERE suppliers.suppname " . LIKE . " '".$SearchString."'"; } elseif (strlen($_POST['SupplierCode']) > 0) { $SQL = "SELECT suppliers.supplierid, suppliers.suppname, @@ -302,7 +297,7 @@ suppliers.address2, suppliers.address3 FROM suppliers - WHERE suppliers.supplierid LIKE '%" . $_POST['SupplierCode'] . "%'"; + WHERE suppliers.supplierid " . LIKE . " '%" . $_POST['SupplierCode'] . "%'"; } //one of keywords or SupplierCode was more than a zero length string $ErrMsg = _('The suppliers matching the criteria entered could not be retrieved because'); $DbgMsg = _('The SQL to retrieve supplier details that failed was'); @@ -324,7 +319,7 @@ include ('includes/footer.inc'); exit; } else { - // echo '<br><font color=BLUE size=3><b>' . $StockID . ' - ' . $myrow[0] . ' </b> (' . _('In Units of') . ' ' . $myrow[1] . ' )</font>'; + // echo '<br /><font color=BLUE size=3><b>' . $StockID . ' - ' . $myrow[0] . ' </b> (' . _('In Units of') . ' ' . $myrow[1] . ' )</font>'; } } else { prnMsg(_('Stock Item') . ' - ' . $StockID . ' ' . _('is not defined in the database'), 'warn'); @@ -383,11 +378,14 @@ purchdata.suppliers_partno, purchdata.minorderqty, purchdata.preferred, - stockmaster.units + stockmaster.units, + currencies.decimalplaces FROM purchdata INNER JOIN suppliers ON purchdata.supplierno=suppliers.supplierid INNER JOIN stockmaster ON purchdata.stockid=stockmaster.stockid + INNER JOIN currencies + ON suppliers.currcode = currencies.currabrev WHERE purchdata.supplierno='".$SupplierID."' AND purchdata.stockid='".$StockID."' AND purchdata.effectivefrom='" . $_GET['EffectiveFrom'] . "'"; @@ -405,9 +403,9 @@ $_POST['Preferred'] = $myrow['preferred']; $_POST['MinOrderQty'] = $myrow['minorderqty']; $_POST['SupplierCode'] = $myrow['suppliers_partno']; - $StockUOM=$myrow['units']; + $StockUOM=$myrow['units']; } - echo '<form action="' . $_SERVER['PHP_SELF'] . '?' . SID . '" 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'] . '" />'; if (!isset($SupplierID)) { $SupplierID = ''; @@ -453,7 +451,7 @@ echo '<tr><td>' . _('Currency') . ':</td> <td><input type=hidden name="CurrCode" . VALUE="' . $CurrCode . '">' . $CurrCode . '</td></tr>'; echo '<tr><td>' . _('Price') . ' (' . _('in Supplier Currency') . '):</td> - <td><input type="text" class="number" name="Price" maxlength=12 size=12 VALUE=' . number_format($_POST['Price'], DecimalPlaces($CurrCode, $db),'.','') . '></td></tr>'; + <td><input type="text" class="number" name="Price" maxlength=12 size=12 VALUE=' . number_format($_POST['Price'], $myrow['decimalplaces'] ,'.','') . '></td></tr>'; echo '<tr><td>' . _('Date Updated') . ':</td> <td><input type="text" class="date" alt="' . $_SESSION['DefaultDateFormat'] . '" name="EffectiveFrom" maxlength=10 size=11 VALUE="' . $_POST['EffectiveFrom'] . '"></td></tr>'; echo '<tr><td>' . _('Our Unit of Measure') . ':</td>'; @@ -491,13 +489,13 @@ echo '<tr><td>' . _('Preferred Supplier') . ':</td> <td><select name="Preferred">'; if ($_POST['Preferred'] == 1) { - echo '<option selected VALUE=1>' . _('Yes'); - echo '<option VALUE=0>' . _('No'); + echo '<option selected VALUE=1>' . _('Yes') . '</option>'; + echo '<option VALUE=0>' . _('No') . '</option>'; } else { - echo '<option VALUE=1>' . _('Yes'); - echo '<option selected VALUE=0>' . _('No'); + echo '<option VALUE=1>' . _('Yes') . '</option>'; + echo '<option selected VALUE=0>' . _('No') . '</option>'; } - echo '</select></td></tr></table><br><div class="centre">'; + echo '</select></td></tr></table><br /><div class="centre">'; if (isset($_GET['Edit'])) { echo '<input type=submit name="UpdateRecord" VALUE="' . _('Update') . '">'; } else { @@ -506,10 +504,10 @@ echo '</div>'; echo '<div class="centre">'; if (isset($StockLocation) and isset($StockID) AND strlen($StockID) != 0) { - echo '<br><a href="' . $rootpath . '/StockStatus.php?' . SID . '&StockID=' . $StockID . '">' . _('Show Stock Status') . '</a>'; - echo '<br><a href="' . $rootpath . '/StockMovements.php?' . SID . '&StockID=' . $StockID . '&StockLocation=' . $StockLocation . '">' . _('Show Stock Movements') . '</a>'; - echo '<br><a href="' . $rootpath . '/SelectSalesOrder.php?' . SID . '&SelectedStockItem=' . $StockID . '&StockLocation=' . $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 . '&StockLocation=' . $StockLocation . '">' . _('Show Stock Movements') . '</a>'; + echo '<br /><a href="' . $rootpath . '/SelectSalesOrder.php?SelectedStockItem=' . $StockID . '&StockLocation=' . $StockLocation . '">' . _('Search Outstanding Sales Orders') . '</a>'; + echo '<br /><a href="' . $rootpath . '/SelectCompletedOrder.php?SelectedStockItem=' . $StockID . '">' . _('Search Completed Sales Orders') . '</a>'; } echo '</form></div>'; } Modified: trunk/StockReorderLevel.php =================================================================== --- trunk/StockReorderLevel.php 2011-03-31 08:32:24 UTC (rev 4527) +++ trunk/StockReorderLevel.php 2011-03-31 09:12:09 UTC (rev 4528) @@ -2,8 +2,6 @@ /* $Id$*/ -//$PageSecurity = 4; - include('includes/session.inc'); $title = _('Stock Re-Order Level Maintenance'); include('includes/header.inc'); @@ -14,7 +12,7 @@ $StockID = trim(strtoupper($_POST['StockID'])); } -echo "<a href='" . $rootpath . '/SelectProduct.php?' . SID . "'>" . _('Back to Items') . '</a>'; +echo '<a href="' . $rootpath . '/SelectProduct.php">' . _('Back to Items') . '</a>'; echo '<p class="page_title_text"><img src="'.$rootpath.'/css/'.$theme.'/images/inventory.png" title="' . _('Inventory') . '" alt="" /><b>' . $title. '</b></p>'; @@ -22,17 +20,19 @@ $result = DB_query("SELECT description, units FROM stockmaster WHERE stockid='$StockID'", $db); $myrow = DB_fetch_row($result); -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'] . '" />'; $sql = "SELECT locstock.loccode, locations.locationname, locstock.quantity, - locstock.reorderlevel - FROM locstock, - locations - WHERE locstock.loccode=locations.loccode - AND locstock.stockid = '" . $StockID . "' + locstock.reorderlevel, + stockmaster.decimalplaces + FROM locstock INNER JOIN locations + ON locstock.loccode=locations.loccode + INNER JOIN stockmaster + ON locstock.stockid=stockmaster.stockid + WHERE locstock.stockid = '" . $StockID . "' ORDER BY locstock.loccode"; $ErrMsg = _('The stock held at each location cannot be retrieved because'); @@ -40,16 +40,16 @@ $LocStockResult = DB_query($sql, $db, $ErrMsg, $DbgMsg); -echo "<table cellpadding=2 class=selection>"; +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><font color=BLUE size=3><b>' . $StockID . ' - ' . $myrow[0] . '</b> (' . _('In Units of') . ' ' . $myrow[1] . ')</font></th></tr>'; -$TableHeader = "<tr> - <th>" . _('Location') . "</th> - <th>" . _('Quantity On Hand') . "</th> - <th>" . _('Re-Order Level') . "</th> - </tr>"; +$TableHeader = '<tr> + <th>' . _('Location') . '</th> + <th>' . _('Quantity On Hand') . '</th> + <th>' . _('Re-Order Level') . '</th> + </tr>'; echo $TableHeader; $j = 1; @@ -92,10 +92,10 @@ //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?" . SID . "&StockID=$StockID'>" . _('Show Stock Movements') . '</a>'; -echo "<br><a href='$rootpath/StockUsage.php?" . SID . "&StockID=$StockID'>" . _('Show Stock Usage') . '</a>'; -echo "<br><a href='$rootpath/SelectSalesOrder.php?" . SID . "&SelectedStockItem=$StockID'>" . _('Search Outstanding Sales Orders') . '</a>'; -echo "<br><a href='$rootpath/SelectCompletedOrder.php?" . SID . "&SelectedStockItem=$StockID'>" . _('Search Completed Sales Orders') . '</a>'; +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/doc/Change.log.html =================================================================== --- trunk/doc/Change.log.html 2011-03-31 08:32:24 UTC (rev 4527) +++ trunk/doc/Change.log.html 2011-03-31 09:12:09 UTC (rev 4528) @@ -1,6 +1,6 @@ <p><font SIZE=4 COLOR=BLUE><b>webERP Change Log</b></font></p> <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> <p>30/3/11 Tim: New ReprintGRN.php script takes a purchase order and allows any line received to have GRN(s) reprinted</p> Modified: trunk/includes/GetConfig.php =================================================================== --- trunk/includes/GetConfig.php 2011-03-31 08:32:24 UTC (rev 4527) +++ trunk/includes/GetConfig.php 2011-03-31 09:12:09 UTC (rev 4528) @@ -40,31 +40,31 @@ /* Also reads all the company data set up in the company record and returns an array */ $sql= 'SELECT coyname, - gstno, - regoffice1, - regoffice2, - regoffice3, - regoffice4, - regoffice5, - regoffice6, - telephone, - fax, - email, - currencydefault, - debtorsact, - pytdiscountact, - creditorsact, - payrollact, - grnact, - exchangediffact, - purchasesexchangediffact, - retainedearnings, - freightact, - gllink_debtors, - gllink_creditors, - gllink_stock - FROM companies - WHERE coycode=1'; + gstno, + regoffice1, + regoffice2, + regoffice3, + regoffice4, + regoffice5, + regoffice6, + telephone, + fax, + email, + currencydefault, + debtorsact, + pytdiscountact, + creditorsact, + payrollact, + grnact, + exchangediffact, + purchasesexchangediffact, + retainedearnings, + freightact, + gllink_debtors, + gllink_creditors, + gllink_stock + FROM companies + WHERE coycode=1'; $ErrMsg = _('An error occurred accessing the database to retrieve the company information'); $ReadCoyResult = DB_query($sql,$db,$ErrMsg); Modified: trunk/includes/GetPaymentMethods.php =================================================================== --- trunk/includes/GetPaymentMethods.php 2011-03-31 08:32:24 UTC (rev 4527) +++ trunk/includes/GetPaymentMethods.php 2011-03-31 09:12:09 UTC (rev 4528) @@ -1,6 +1,6 @@ <?php /* $Id$*/ -// I Figure This is the fastest and safest way to load the Sections + $PaytTypes = array(); $ReceiptTypes = array(); @@ -9,12 +9,15 @@ receipttype FROM paymentmethods ORDER by paymentname'; + $PMResult = DB_query($sql,$db); while( $PMrow = DB_fetch_array($PMResult) ) { - if ($PMrow['paymenttype']==1) + if ($PMrow['paymenttype']==1) { $PaytTypes[] = $PMrow['paymentname']; - if ($PMrow['receipttype']==1) + } + if ($PMrow['receipttype']==1) { $ReceiptTypes[] = $PMrow['paymentname']; + } } DB_free_result($PMResult); // no longer needed ?> \ No newline at end of file Modified: trunk/includes/MiscFunctions.php =================================================================== --- trunk/includes/MiscFunctions.php 2011-03-31 08:32:24 UTC (rev 4527) +++ trunk/includes/MiscFunctions.php 2011-03-31 09:12:09 UTC (rev 4528) @@ -2,9 +2,9 @@ /* $Id$*/ -/********************************************/ +/* ****************************************** */ /** STANDARD MESSAGE HANDLING & FORMATTING **/ -/********************************************/ +/* ****************************************** */ function prnMsg($Msg,$Type='info', $Prefix=''){ @@ -231,21 +231,7 @@ }//wikiLink -function DecimalPlaces($currcode, $db) { - $sql='SELECT decimalplaces FROM currencies WHERE currabrev="'.$currcode.'"'; - $result=DB_query($sql, $db); - $myrow=DB_fetch_array($result); - return $myrow['decimalplaces']; -} -function StockDecimalPlaces($StockID, $db) { - $sql='SELECT decimalplaces FROM stockmaster WHERE stockid="'.$StockID.'"'; - $result=DB_query($sql, $db); - $myrow=DB_fetch_array($result); - return $myrow['decimalplaces']; -} - - // Lindsay debug stuff function LogBackTrace( $dest = 0 ) { error_log( "***BEGIN STACK BACKTRACE***", $dest ); Modified: trunk/includes/PO_ReadInOrder.inc =================================================================== --- trunk/includes/PO_ReadInOrder.inc 2011-03-31 08:32:24 UTC (rev 4527) +++ trunk/includes/PO_ReadInOrder.inc 2011-03-31 09:12:09 UTC (rev 4528) @@ -15,45 +15,45 @@ /*read in all the guff from the selected order into the PO PurchOrder Class variable */ - $OrderHeaderSQL = 'SELECT purchorders.supplierno, - suppliers.suppname, - purchorders.comments, - purchorders.orddate, - purchorders.rate, - purchorders.dateprinted, - purchorders.deladd1, - purchorders.deladd2, - purchorders.deladd3, - purchorders.deladd4, - purchorders.deladd5, - purchorders.deladd6, - purchorders.tel, - purchorders.suppdeladdress1, - purchorders.suppdeladdress2, - purchorders.suppdeladdress3, - purchorders.suppdeladdress4, - purchorders.suppdeladdress5, - purchorders.suppdeladdress6, - purchorders.suppliercontact, - purchorders.supptel, - purchorders.contact, - purchorders.allowprint, - purchorders.requisitionno, - purchorders.intostocklocation, - purchorders.initiator, - purchorders.version, - purchorders.status, - purchorders.stat_comment, - purchorders.deliverydate, - purchorders.port, - suppliers.currcode, - locations.managed , - purchorders.paymentterms - FROM purchorders - INNER JOIN locations ON purchorders.intostocklocation=locations.loccode, - suppliers - WHERE purchorders.supplierno = suppliers.supplierid - AND purchorders.orderno = ' . $_GET['ModifyOrderNumber']; + $OrderHeaderSQL = "SELECT purchorders.supplierno, + suppliers.suppname, + purchorders.comments, + purchorders.orddate, + purchorders.rate, + purchorders.dateprinted, + purchorders.deladd1, + purchorders.deladd2, + purchorders.deladd3, + purchorders.deladd4, + purchorders.deladd5, + purchorders.deladd6, + purchorders.tel, + purchorders.suppdeladdress1, + purchorders.suppdeladdress2, + purchorders.suppdeladdress3, + purchorders.suppdeladdress4, + purchorders.suppdeladdress5, + purchorders.suppdeladdress6, + purchorders.suppliercontact, + purchorders.supptel, + purchorders.contact, + purchorders.allowprint, + purchorders.requisitionno, + purchorders.intostocklocation, + purchorders.initiator, + purchorders.version, + purchorders.status, + purchorders.stat_comment, + purchorders.deliverydate, + purchorders.port, + suppliers.currcode, + locations.managed , + purchorders.paymentterms + FROM purchorders + INNER JOIN locations ON purchorders.intostocklocation=locations.loccode, + suppliers + WHERE purchorders.supplierno = suppliers.supplierid + AND purchorders.orderno = '" . $_GET['ModifyOrderNumber'] . "'"; $ErrMsg = _('The order cannot be retrieved because'); $DbgMsg = _('The SQL statement that was used and failed was'); @@ -100,17 +100,17 @@ $_SESSION['PO'.$identifier]->PaymentTerms= $myrow['paymentterms']; $SupplierSQL = "SELECT suppliers.supplierid, - suppliers.suppname, - suppliers.address1, - suppliers.address2, - suppliers.address3, - suppliers.address4, - suppliers.address5, - suppliers.address6, - suppliers.currcode - FROM suppliers - WHERE suppliers.supplierid='" . $_SESSION['PO'.$identifier]->SupplierID."' - ORDER BY suppliers.supplierid"; + suppliers.suppname, + suppliers.address1, + suppliers.address2, + suppliers.address3, + suppliers.address4, + suppliers.address5, + suppliers.address6, + suppliers.currcode + FROM suppliers + WHERE suppliers.supplierid='" . $_SESSION['PO'.$identifier]->SupplierID."' + ORDER BY suppliers.supplierid"; $ErrMsg = _('The searched supplier records requested cannot be retrieved because'); $result_SuppSelect = DB_query($SupplierSQL,$db,$ErrMsg); @@ -125,47 +125,47 @@ /*now populate the line PO array with the purchase order details records */ $LineItemsSQL = "SELECT podetailitem, - purchorderdetails.itemcode, - stockmaster.description, - purchorderdetails.deliverydate, - purchorderdetails.itemdescription, - glcode, - accountname, - purchorderdetails.qtyinvoiced, - purchorderdetails.unitprice, - stockmaster.units, - purchorderdetails.quantityord, - purchorderdetails.quantityrecd, - purchorderdetails.shiptref, - purchorderdetails.completed, - purchorderdetails.jobref, - purchorderdetails.stdcostunit, - purchorderdetails.itemno, - stockmaster.controlled, - stockmaster.serialised, - stockmaster.decimalplaces, - purchorderdetails.subtotal_amount, - purchorderdetails.package, - purchorderdetails.pcunit, - purchorderdetails.netweight, - purchorderdetails.kgs, - purchorderdetails.cuft, - purchorderdetails.total_quantity, - purchorderdetails.total_amount, - purchorderdetails.assetid, - purchorderdetails.conversionfactor, - purchorderdetails.suppliersunit, - purchorderdetails.suppliers_partno - FROM purchorderdetails - LEFT JOIN stockmaster - ON purchorderdetails.itemcode=stockmaster.stockid - INNER JOIN purchorders - ON purchorders.orderno=purchorderdetails.orderno - LEFT JOIN chartmaster - ON purchorderdetails.glcode=chartmaster.accountcode - WHERE purchorderdetails.completed=0 - AND purchorderdetails.orderno ='" . $_GET['ModifyOrderNumber'] . "' - ORDER BY podetailitem"; + purchorderdetails.itemcode, + stockmaster.description, + purchorderdetails.deliverydate, + purchorderdetails.itemdescription, + glcode, + accountname, + purchorderdetails.qtyinvoiced, + purchorderdetails.unitprice, + stockmaster.units, + purchorderdetails.quantityord, + purchorderdetails.quantityrecd, + purchorderdetails.shiptref, + purchorderdetails.completed, + purchorderdetails.jobref, + purchorderdetails.stdcostunit, + purchorderdetails.itemno, + stockmaster.controlled, + stockmaster.serialised, + stockmaster.decimalplaces, + purchorderdetails.subtotal_amount, + purchorderdetails.package, + purchorderdetails.pcunit, + purchorderdetails.netweight, + purchorderdetails.kgs, + purchorderdetails.cuft, + purchorderdetails.total_quantity, + purchorderdetails.total_amount, + purchorderdetails.assetid, + purchorderdetails.conversionfactor, + purchorderdetails.suppliersunit, + purchorderdetails.suppliers_partno + FROM purchorderdetails + LEFT JOIN stockmaster + ON purchorderdetails.itemcode=stockmaster.stockid + INNER JOIN purchorders + ON purchorders.orderno=purchorderdetails.orderno + LEFT JOIN chartmaster + ON purchorderdetails.glcode=chartmaster.accountcode + WHERE purchorderdetails.completed=0 + AND purchorderdetails.orderno ='" . $_GET['ModifyOrderNumber'] . "' + ORDER BY podetailitem"; $ErrMsg = _('The lines on the purchase order cannot be retrieved because'); $DbgMsg = _('The SQL statement that was used to retrieve the purchase order lines was'); @@ -192,36 +192,36 @@ } $_SESSION['PO'.$identifier]->add_to_order($_SESSION['PO'.$identifier]->LinesOnOrder+1, - $StockID, - $myrow['serialised'], - $myrow['controlled'], - $myrow['quantityord'], - stripslashes($myrow['itemdescription']), - $myrow['unitprice'], - $Units, - $GLCode, - ConvertSQLDate($myrow['deliverydate']), - $myrow['shiptref'], - $myrow['completed'], - $myrow['jobref'], - $myrow['qtyinvoiced'], - $myrow['quantityrecd'], - $myrow['accountname'], - $myrow['decimalplaces'], - $myrow['itemno'], - $myrow['suppliersunit'], - $myrow['conversionfactor'], - $myrow['suppliers_partno'], - $myrow['subtotal_amount'], - 0, - $myrow['package'], - $myrow['pcunit'], - $myrow['netweight'], - $myrow['kgs'], - $myrow['cuft'], - $myrow['total_quantity'], - $myrow['total_amount'], - $myrow['assetid'] ); + $StockID, + $myrow['serialised'], + $myrow['controlled'], + $myrow['quantityord'], + stripslashes($myrow['itemdescription']), + $myrow['unitprice'], + $Units, + $GLCode, + ConvertSQLDate($myrow['deliverydate']), + $myrow['shiptref'], + $myrow['completed'], + $myrow['jobref'], + $myrow['qtyinvoiced'], + $myrow['quantityrecd'], + $myrow['accountname'], + $myrow['decimalplaces'], + $myrow['itemno'], + $myrow['suppliersunit'], + $myrow['conversionfactor'], + $myrow['suppliers_partno'], + $myrow['subtotal_amount'], + 0, + $myrow['package'], + $myrow['pcunit'], + $myrow['netweight'], + $myrow['kgs'], + $myrow['cuft'], + $myrow['total_quantity'], + $myrow['total_amount'], + $myrow['assetid'] ); $_SESSION['PO'.$identifier]->LineItems[$_SESSION['PO'.$identifier]->LinesOnOrder]->PODetailRec = $myrow['podetailitem']; $_SESSION['PO'.$identifier]->LineItems[$_SESSION['PO'.$identifier]->LinesOnOrder]->StandardCost = $myrow['stdcostunit']; /*Needed for receiving goods and GL interface */ Modified: trunk/includes/SQL_CommonFunctions.inc =================================================================== --- trunk/includes/SQL_CommonFunctions.inc 2011-03-31 08:32:24 UTC (rev 4527) +++ trunk/includes/SQL_CommonFunctions.inc 2011-03-31 09:12:09 UTC (rev 4528) @@ -18,7 +18,7 @@ DB_query('LOCK TABLES systypes WRITE',$db); - $SQL = 'SELECT typeno FROM systypes WHERE typeid = ' . $TransType; + $SQL = "SELECT typeno FROM systypes WHERE typeid = '" . $TransType . "'"; $ErrMsg = _('CRITICAL ERROR') . '! ' . _('NOTE DOWN THIS ERROR AND SEEK ASSISTANCE') . ': <BR>' . _('The next transaction number could not be retrieved from the database because'); $DbgMsg = _('The following SQL to retrieve the transaction number was used'); @@ -26,12 +26,12 @@ $myrow = DB_fetch_row($GetTransNoResult); - $SQL = 'UPDATE systypes SET typeno = ' . ($myrow[0] + 1) . ' WHERE typeid = ' . $TransType; + $SQL = "UPDATE systypes SET typeno = '" . ($myrow[0] + 1) . "' WHERE typeid = '" . $TransType . "'"; $ErrMsg = _('CRITICAL ERROR') . '! ' . _('NOTE DOWN THIS ERROR AND SEEK ASSISTANCE') . ': ' . _('The transaction number could not be incremented'); $DbgMsg = _('The following SQL to increment the transaction number was used'); $UpdTransNoResult = DB_query($SQL,$db,$ErrMsg,$DbgMsg); - DB_query("UNLOCK TABLES",$db); + DB_query('UNLOCK TABLES',$db); return $myrow[0] + 1; } @@ -41,14 +41,13 @@ /*Gets the GL Codes relevant to the stock item account from the stock category record */ $QuerySQL = "SELECT stockact, - adjglact, - purchpricevaract, - materialuseagevarac, - wipact - FROM stockmaster, - stockcategory - WHERE stockmaster.categoryid=stockcategory.categoryid - AND stockmaster.stockid = '" . $StockID . "'"; + adjglact, + purchpricevaract, + materialuseagevarac, + wipact + FROM stockmaster INNER JOIN stockcategory + ON stockmaster.categoryid=stockcategory.categoryid + WHERE stockmaster.stockid = '" . $StockID . "'"; $ErrMsg = _('The stock GL codes could not be retrieved because'); $GetStkGLResult = DB_query($QuerySQL, $db, $ErrMsg); @@ -62,10 +61,10 @@ /*Gets the Tax rate applicable to an item from the TaxAuthority of the branch and TaxLevel of the item */ $QuerySQL = "SELECT taxrate - FROM taxauthrates - WHERE taxauthority='" . $TaxAuthority . "' - AND dispatchtaxprovince='" . $DispatchTaxProvince . "' - AND taxcatid = '" . $TaxCategory . "'"; + FROM taxauthrates + WHERE taxauthority='" . $TaxAuthority . "' + AND dispatchtaxprovince='" . $DispatchTaxProvince . "' + AND taxcatid = '" . $TaxCategory . "'"; $ErrMsg = _('The tax rate for this item could not be retrieved because'); $GetTaxRateResult = DB_query($QuerySQL,$db,$ErrMsg); @@ -168,19 +167,19 @@ $ValueOfChange = $QOH * ($NewCost - $OldCost); $SQL = "INSERT INTO gltrans (type, - typeno, - trandate, - periodno, - account, - narrative, - amount) - VALUES (35, - " . $CostUpdateNo . ", + typeno, + trandate, + periodno, + account, + narrative, + amount) + VALUES ('35', + '" . $CostUpdateNo . "', '" . Date('Y-m-d') . "', - " . $PeriodNo . ", - " . $StockGLCode['adjglact'] . ", + '" . $PeriodNo . "', + '" . $StockGLCode['adjglact'] . "', '" . $StockID . ' ' . _('cost was') . ' ' . $OldCost . ' ' . _('changed to') . ' ' . $NewCost . ' x ' . _('Quantity on hand of') . ' ' . $QOH . "', - " . (-$ValueOfChange) . ")"; + '" . (-$ValueOfChange) . "')"; $ErrMsg = _('CRITICAL ERROR') . '! ' . _('NOTE DOWN THIS ERROR AND SEEK ASSISTANCE') . ': ' . _('The GL credit for the stock cost adjustment posting could not be inserted because'); $DbgMsg = _('The following SQL to insert the GLTrans record was used'); @@ -193,13 +192,13 @@ account, narrative, amount) - VALUES (35, - " . $CostUpdateNo . ", + VALUES ('35', + '" . $CostUpdateNo . "', '" . Date('Y-m-d') . "', - " . $PeriodNo . ", - " . $StockGLCode['stockact'] . ", + '" . $PeriodNo . "', + '" . $StockGLCode['stockact'] . "', '" . $StockID . ' ' . _('cost was') . ' ' . $OldCost . ' ' . _('changed to') .' ' . $NewCost . ' x ' . _('Quantity on hand of') . ' ' . $QOH . "', - " . $ValueOfChange . ")"; + '" . $ValueOfChange . "')"; $ErrMsg = _('CRITICAL ERROR') . '! ' . _('NOTE DOWN THIS ERROR AND SEEK ASSISTANCE') . ': ' . _('The GL debit for stock cost adjustment posting could not be inserted because'); $DbgMsg = _('The following SQL to insert the GLTrans record was used'); @@ -231,10 +230,10 @@ } /*Iterates through the levels of the bom, recalculating each bom it meets*/ -function UpdateCost($db, $item) { - $SQL = "SELECT parent FROM bom where component = '" . $item . "'"; - $result = DB_query($SQL, $db); - while ($MyRow=DB_fetch_array($result)){ +function UpdateCost($db, $Item) { + $SQL = "SELECT parent FROM bom where component = '" . $Item . "'"; + $Result = DB_query($SQL, $db); + while ($MyRow=DB_fetch_array($Result)){ $NewParent = $MyRow['parent']; $MaterialCost = BomMaterialCost($NewParent, $db); $SQL = 'UPDATE stockmaster SET materialcost=' . $MaterialCost . " WHERE stockid='" . $NewParent . "'"; @@ -264,7 +263,7 @@ qtypu, stdcost, autoissue) - SELECT " . $WO . ", + SELECT '" . $WO . "', '" . $ParentID . "', bom.component, bom.quantity*" . $Qty . ", @@ -278,7 +277,7 @@ AND bom.component NOT IN ( SELECT stockid FROM worequirements - WHERE wo = " . $WO . " + WHERE wo = '" . $WO . "' AND parentstockid = '" . $ParentID . "' )"; $result = DB_query($sql, $db); @@ -304,7 +303,7 @@ AND bom.component IN ( SELECT stockid FROM worequirements - WHERE wo = " . $WO . " + WHERE wo = '" . $WO . "' AND parentstockid = '". $ParentID . "' ) ) AS g ON g.wo=worequirements.wo Modified: trunk/locale/zh_CN.utf8/Manual/ManualAPIFunctions.php =================================================================== --- trunk/locale/zh_CN.utf8/Manual/ManualAPIFunctions.php 2011-03-31 08:32:24 UTC (rev 4527) +++ trunk/locale/zh_CN.utf8/Manual/ManualAPIFunctions.php 2011-03-31 09:12:09 UTC (rev 4528) @@ -19,7 +19,7 @@ echo '<body>'; $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]; This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <dai...@us...> - 2011-04-01 09:52:57
|
Revision: 4529 http://web-erp.svn.sourceforge.net/web-erp/?rev=4529&view=rev Author: daintree Date: 2011-04-01 09:52:49 +0000 (Fri, 01 Apr 2011) Log Message: ----------- Modified Paths: -------------- trunk/InventoryValuation.php trunk/MRPCreateDemands.php trunk/MRPDemandTypes.php trunk/MRPDemands.php trunk/MRPPlannedPurchaseOrders.php trunk/MRPPlannedWorkOrders.php trunk/MRPReport.php trunk/includes/PO_PDFOrderPageHeader.inc Modified: trunk/InventoryValuation.php =================================================================== --- trunk/InventoryValuation.php 2011-03-31 09:12:09 UTC (rev 4528) +++ trunk/InventoryValuation.php 2011-04-01 09:52:49 UTC (rev 4529) @@ -1,9 +1,7 @@ <?php -/* $Revision: 1.17 $ */ /* $Id$ */ -//$PageSecurity = 2; include('includes/session.inc'); if (isset($_POST['PrintPDF']) @@ -76,9 +74,9 @@ $title = _('Inventory Valuation') . ' - ' . _('Problem Report'); include('includes/header.inc'); prnMsg( _('The inventory valuation 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; @@ -87,7 +85,7 @@ $title = _('Print Inventory Valuation Error'); include('includes/header.inc'); prnMsg(_('There were no items with any value to print out for the location specified'),'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; } @@ -116,9 +114,9 @@ $DisplayCatTotVal = number_format($CatTot_Val,2); $DisplayCatTotQty = number_format($CatTot_Qty,0); - $LeftOvers = $pdf->addTextWrap(500,$YPos,60,$FontSize,$DisplayCatTotVal, 'right'); - $LeftOvers = $pdf->addTextWrap(380,$YPos,60,$FontSize,$DisplayCatTotQty, 'right'); - $YPos -=$line_height; + $LeftOvers = $pdf->addTextWrap(500,$YPos,60,$FontSize,$DisplayCatTotVal, 'right'); + $LeftOvers = $pdf->addTextWrap(380,$YPos,60,$FontSize,$DisplayCatTotQty, 'right'); + $YPos -=$line_height; If ($_POST['DetailedReport']=='Yes'){ /*draw a line under the CATEGORY TOTAL*/ @@ -206,10 +204,10 @@ echo '<tr><td>' . _('From Inventory Category Code') . ':</font></td><td><select name=FromCriteria>'; - $sql='SELECT categoryid, categorydescription FROM stockcategory WHERE stocktype<>"A" ORDER BY categoryid'; + $sql="SELECT categoryid, categorydescription FROM stockcategory WHERE stocktype<>'A' ORDER BY categoryid"; $CatResult= DB_query($sql,$db); While ($myrow = DB_fetch_array($CatResult)){ - echo "<option value='" . $myrow['categoryid'] . "'>" . $myrow['categoryid'] . ' - ' . $myrow['categorydescription']; + echo '<option value="' . $myrow['categoryid'] . '">' . $myrow['categoryid'] . ' - ' . $myrow['categorydescription'] . '</option>'; } echo '</select></td></tr>'; @@ -219,27 +217,27 @@ DB_data_seek($CatResult,0); While ($myrow = DB_fetch_array($CatResult)){ - echo "<option value='" . $myrow['categoryid'] . "'>" . $myrow['categoryid'] . ' - ' . $myrow['categorydescription']; + echo '<option value="' . $myrow['categoryid'] . '">' . $myrow['categoryid'] . ' - ' . $myrow['categorydescription'] . '</option>'; } echo '</select></td></tr>'; - echo '<tr><td>' . _('For Inventory in Location') . ":</td><td><select name='Location'>"; + echo '<tr><td>' . _('For Inventory in Location') . ':</td><td><select name="Location">'; $sql = 'SELECT loccode, locationname FROM locations'; $LocnResult=DB_query($sql,$db); - echo "<option value='All'>" . _('All Locations'); + echo '<option value="All">' . _('All Locations') . '</option>'; while ($myrow=DB_fetch_array($LocnResult)){ - echo "<option Value='" . $myrow['loccode'] . "'>" . $myrow['locationname']; - } + echo '<option Value="' . $myrow['loccode'] . '">' . $myrow['locationname'] . '</option>'; + } echo '</select></td></tr>'; - echo '<tr><td>' . _('Summary or Detailed Report') . ":</td><td><select name='DetailedReport'>"; - echo "<option selected Value='No'>" . _('Summary Report'); - echo "<option Value='Yes'>" . _('Detailed Report'); + echo '<tr><td>' . _('Summary or Detailed Report') . ':</td><td><select name="DetailedReport">'; + echo '<option selected Value="No">' . _('Summary Report') . '</option>'; + echo '<option Value="Yes">' . _('Detailed Report') . '</option>'; echo '</select></td></tr>'; - echo "</table><br><div class='centre'><input type=Submit Name='PrintPDF' Value='" . _('Print PDF') . "'></div>"; + echo '</table><br /><div class="centre"><input type="Submit" name="PrintPDF" value="' . _('Print PDF') . '"></div>'; } include('includes/footer.inc'); Modified: trunk/MRPCreateDemands.php =================================================================== --- trunk/MRPCreateDemands.php 2011-03-31 09:12:09 UTC (rev 4528) +++ trunk/MRPCreateDemands.php 2011-04-01 09:52:49 UTC (rev 4529) @@ -1,10 +1,7 @@ <?php -/* $Revision: 1.8 $ */ /* $Id$*/ // MRPCreateDemands.php - Create mrpdemands based on sales order history -//$PageSecurity=9; - include('includes/session.inc'); $title = _('MRP Create Demands'); include('includes/header.inc'); @@ -32,8 +29,7 @@ unset($_POST['FromoDate']); } if (isset($_POST['DistDate']) AND !Is_Date($_POST['DistDate'])){ - $msg = _('The distribution start date must be specified in the format') . ' ' . - $_SESSION['DefaultDateFormat']; + $msg = _('The distribution start date must be specified in the format') . ' ' . $_SESSION['DefaultDateFormat']; $InputError=1; unset($_POST['DistDate']); } @@ -42,13 +38,13 @@ prnMsg($msg,'error'); } -$wherecategory = " "; +$WhereCategory = " "; if ($_POST['CategoryID']!='All') { - $wherecategory = " AND stockmaster.categoryid ='" . $_POST['CategoryID'] . "' "; + $WhereCategory = " AND stockmaster.categoryid ='" . $_POST['CategoryID'] . "' "; } -$wherelocation = " "; +$WhereLocation = " "; if ($_POST['Location']!='All') { - $wherelocation = " AND salesorders.fromstkloc ='" . $_POST['Location'] . "' "; + $WhereLocation = " AND salesorders.fromstkloc ='" . $_POST['Location'] . "' "; } $sql= "SELECT salesorderdetails.stkcode, @@ -60,11 +56,11 @@ ON salesorders.orderno = salesorderdetails.orderno INNER JOIN stockmaster ON salesorderdetails.stkcode = stockmaster.stockid - WHERE orddate >='" . FormatDateForSQL($_POST['FromDate']) . - "' AND orddate <='" . FormatDateForSQL($_POST['ToDate']) . - "' $wherelocation - $wherecategory " - . " GROUP BY salesorderdetails.stkcode"; + WHERE orddate >='" . FormatDateForSQL($_POST['FromDate']) ."' + AND orddate <='" . FormatDateForSQL($_POST['ToDate']) . "' + " . $WhereLocation . " + " . $WhereCategory . " + GROUP BY salesorderdetails.stkcode"; //echo "</br>$sql</br>"; $result = DB_query($sql,$db); // To get the quantity per period, get the whole number amount of the total quantity divided @@ -114,11 +110,11 @@ $date = date("Y-m-d",mktime(0,0,0,$mm,$dd,$yyyy)); for ($i = 1; $i <= ( $_POST['PeriodNumber'] - 1); $i++) { if ($_POST['Period'] == 'weekly') { - $date = strtotime(date("Y-m-d", strtotime($date)) . " + 1 week"); + $date = strtotime(date('Y-m-d', strtotime($date)) . ' + 1 week'); } else { - $date = strtotime(date("Y-m-d", strtotime($date)) . " + 1 month"); + $date = strtotime(date('Y-m-d', strtotime($date)) . ' + 1 month'); } - $datearray[$i] = date("Y-m-d",$date); + $datearray[$i] = date('Y-m-d',$date); // Following sql finds daynumber for the calculated date and finds // a valid manufacturing date for the daynumber. There is only one valid manufacturing date // for each daynumber, but there could be several non-manufacturing dates for the @@ -136,30 +132,30 @@ if ($myrowdate[0] != 0){ $datearray[$i] = $myrowdate[1]; } - $date = date("Y-m-d",$date); + $date = date('Y-m-d',$date); } -$totalrecords = 0; +$TotalRecords = 0; while ($myrow = DB_fetch_array($result)) { if (($myrow['totqty'] >= $excludeqty) and ($myrow['totextqty'] >= $excludeamt)) { - unset($periodqty); - $periodqty[] = " "; - $totalqty = $myrow['totqtyinvoiced'] * $multiplier; - $wholenumber = floor($totalqty / $_POST['PeriodNumber']); - $remainder = ($totalqty % $_POST['PeriodNumber']); - if ($wholenumber > 0) { + unset($PeriodQty); + $PeriodQty[] = ' '; + $TotalQty = $myrow['totqtyinvoiced'] * $multiplier; + $WholeNumber = floor($TotalQty / $_POST['PeriodNumber']); + $Remainder = ($TotalQty % $_POST['PeriodNumber']); + if ($WholeNumber > 0) { for ($i = 0; $i <= ($_POST['PeriodNumber'] - 1); $i++) { - $periodqty[$i] = $wholenumber; + $PeriodQty[$i] = $WholeNumber; } } - if ($remainder > 0) { - for ($i = 0; $i <= ($remainder - 1); $i++) { - $periodqty[$i] += 1; + if ($Remainder > 0) { + for ($i = 0; $i <= ($Remainder - 1); $i++) { + $PeriodQty[$i] += 1; } } $i = 0; - foreach ($periodqty as $demandqty) { + foreach ($PeriodQty as $demandqty) { $sql = "INSERT INTO mrpdemands (stockid, mrpdemandtype, quantity, @@ -170,14 +166,14 @@ '" . $datearray[$i] . "')"; $insertresult = DB_query($sql,$db); $i++; - $totalrecords++; + $TotalRecords++; } // end of foreach for INSERT } // end of if that checks exludeqty, excludeamt } //end while loop -prnMsg( $totalrecords . ' ' . _('records have been created'),'success'); +prnMsg( $TotalRecords . ' ' . _('records have been created'),'success'); } else { // if submit has not been pressed @@ -185,7 +181,7 @@ } // End of else to create form echo '<p class="page_title_text"><img src="'.$rootpath.'/css/'.$theme.'/images/inventory.png" title="' . _('Inventory') . '" alt="" />' . ' ' . $title . '</p>'; - echo '<form action=' . $_SERVER['PHP_SELF'] . '?' . SID .' method="post"><b><br></b>'; + echo '<form action="' . $_SERVER['PHP_SELF'] . '" method="post"><b><br /></b>'; echo '<input type="hidden" name="FormID" value="' . $_SESSION['FormID'] . '" />'; echo '<table class=selection>'; echo '<tr><td>' . _('Demand Type') . ':</td><td><select name="MRPDemandtype">'; @@ -210,13 +206,13 @@ } //end while loop echo '</select></td></tr>'; echo '<tr><td>' . _('Inventory Location') . ':</td><td><select name="Location">'; - echo '<option selected value="All">' . _('All Locations'); + 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>'; if (!isset($_POST['FromDate'])) { @@ -246,7 +242,7 @@ ":</td><td><input type ='text' class=number name='Excludeamt' size='8' value='0'>"; echo '<tr><td>' . _('Multiplier') . ":</td><td><input type ='text' class=number name='Multiplier' size='2' value=1><tr><td></td></tr></table>"; - echo "<br><div class=centre><input type=submit name='submit' value='" . _('Submit') . "'</div>"; + echo "<br /><div class=centre><input type=submit name='submit' value='" . _('Submit') . "'</div>"; include('includes/footer.inc'); ?> \ No newline at end of file Modified: trunk/MRPDemandTypes.php =================================================================== --- trunk/MRPDemandTypes.php 2011-03-31 09:12:09 UTC (rev 4528) +++ trunk/MRPDemandTypes.php 2011-04-01 09:52:49 UTC (rev 4529) @@ -1,14 +1,12 @@ <?php -/* $Revision: 1.3 $ */ + /* $Id$*/ -//$PageSecurity=9; - include('includes/session.inc'); $title = _('MRP Demand Types'); include('includes/header.inc'); -//SelectedDT is the Selected mrpdemandtype +//SelectedDT is the Selected MRPDemandType if (isset($_POST['SelectedDT'])){ $SelectedDT = trim(strtoupper($_POST['SelectedDT'])); } elseif (isset($_GET['SelectedDT'])){ @@ -28,13 +26,13 @@ //first off validate inputs sensible - if (trim(strtoupper($_POST['mrpdemandtype']) == "WO") or - trim(strtoupper($_POST['mrpdemandtype']) == "SO")) { + if (trim(strtoupper($_POST['MRPDemandType']) == 'WO') or + trim(strtoupper($_POST['MRPDemandType']) == 'SO')) { $InputError = 1; prnMsg(_('The Demand Type is reserved for the system'),'error'); } - if (strlen($_POST['mrpdemandtype']) < 1) { + if (strlen($_POST['MRPDemandType']) < 1) { $InputError = 1; prnMsg(_('The Demand Type code must be at least 1 character long'),'error'); } @@ -59,7 +57,7 @@ $sql = "INSERT INTO mrpdemandtypes (mrpdemandtype, description) - VALUES ('" . trim(strtoupper($_POST['mrpdemandtype'])) . "', + VALUES ('" . trim(strtoupper($_POST['MRPDemandType'])) . "', '" . $_POST['Description'] . "' )"; $msg = _('The new demand type has been added to the database'); @@ -69,9 +67,9 @@ if ($InputError !=1){ $result = DB_query($sql,$db,_('The update/addition of the demand type failed because')); prnMsg($msg,'success'); - echo '<br>'; + echo '<br />'; unset ($_POST['Description']); - unset ($_POST['mrpdemandtype']); + unset ($_POST['MRPDemandType']); unset ($SelectedDT); } @@ -81,17 +79,17 @@ // PREVENT DELETES IF DEPENDENT RECORDS IN 'MRPDemands' $sql= "SELECT COUNT(*) FROM mrpdemands - WHERE mrpdemands.mrpdemandtype='$SelectedDT' + WHERE mrpdemands.mrpdemandtype='" . $SelectedDT . "' GROUP BY mrpdemandtype"; $result = DB_query($sql,$db); $myrow = DB_fetch_row($result); if ($myrow[0]>0) { prnMsg(_('Cannot delete this demand type because MRP Demand records exist for this type') . '<br>' . _('There are') . ' ' . $myrow[0] . ' ' ._('MRP Demands referring to this type'),'warn'); } else { - $sql="DELETE FROM mrpdemandtypes WHERE mrpdemandtype='$SelectedDT'"; + $sql="DELETE FROM mrpdemandtypes WHERE mrpdemandtype='" . $SelectedDT . "'"; $result = DB_query($sql,$db); prnMsg(_('The selected demand type record has been deleted'),'succes'); - echo '<br>'; + echo '<br />'; } // end of MRPDemands test } @@ -110,22 +108,22 @@ $result = DB_query($sql,$db); - echo "<table class=selection> - <tr BGCOLOR =#800000><th>" . _('Demand Type') . "</th> - <th>" . _('Description') . "</th> - </tr></font>"; + echo '<table class=selection> + <tr BGCOLOR =#800000><th>' . _('Demand Type') . '</th> + <th>' . _('Description') . '</th> + </tr></font>'; while ($myrow = DB_fetch_row($result)) { printf("<tr><td>%s</td> <td>%s</td> - <td><a href=\"%s&SelectedDT=%s\">" . _('Edit') . "</td> - <td><a href=\"%s&SelectedDT=%s&delete=yes\">" . _('Delete') ."</td> + <td><a href=\"%sSelectedDT=%s\">" . _('Edit') . "</td> + <td><a href=\"%sSelectedDT=%s&delete=yes\">" . _('Delete') ."</td> </tr>", $myrow[0], $myrow[1], - $_SERVER['PHP_SELF'] . '?' . SID, - $myrow[0], $_SERVER['PHP_SELF'] . '?' . SID, + $_SERVER['PHP_SELF'] . '?', + $myrow[0], $_SERVER['PHP_SELF'] . '?', $myrow[0]); } @@ -136,10 +134,10 @@ //end of ifs and buts! if (isset($SelectedDT) and !isset($_GET['delete'])) { - echo "<div class='centre'><a href='" . $_SERVER['PHP_SELF'] . '?' . SID . "'>" . _('Show all Demand Types') . '</a></div>'; + echo '<div class="centre"><a href="' . $_SERVER['PHP_SELF'] . '">' . _('Show all Demand Types') . '</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($SelectedDT) and !isset($_GET['delete'])) { @@ -148,25 +146,25 @@ $sql = "SELECT mrpdemandtype, description FROM mrpdemandtypes - WHERE mrpdemandtype='$SelectedDT'"; + WHERE mrpdemandtype='" . $SelectedDT . "'"; $result = DB_query($sql, $db); $myrow = DB_fetch_array($result); - $_POST['mrpdemandtype'] = $myrow['mrpdemandtype']; + $_POST['MRPDemandType'] = $myrow['mrpdemandtype']; $_POST['Description'] = $myrow['description']; echo '<input type=hidden name=SelectedDT value=' . $SelectedDT . '>'; - echo "<input type=hidden name=mrpdemandtype value='" . $_POST['mrpdemandtype'] . "'>"; - echo '<table class=selection><tr><td>' ._('Demand Type') . ':</td><td>' . $_POST['mrpdemandtype'] . '</td></tr>'; + echo "<input type=hidden name=MRPDemandType value='" . $_POST['MRPDemandType'] . "'>"; + echo '<table class=selection><tr><td>' ._('Demand Type') . ':</td><td>' . $_POST['MRPDemandType'] . '</td></tr>'; } else { //end of if $SelectedDT only do the else when a new record is being entered - if (!isset($_POST['mrpdemandtype'])) { - $_POST['mrpdemandtype'] = ''; + if (!isset($_POST['MRPDemandType'])) { + $_POST['MRPDemandType'] = ''; } echo '<table class=selection><tr> <td>' . _('Demand Type') . ":</td> - <td><input type='Text' name='mrpdemandtype' size=6 maxlength=5 value='" . $_POST['mrpdemandtype'] . "'></td> + <td><input type='Text' name='MRPDemandType' size=6 maxlength=5 value='" . $_POST['MRPDemandType'] . "'></td> </tr>" ; } Modified: trunk/MRPDemands.php =================================================================== --- trunk/MRPDemands.php 2011-03-31 09:12:09 UTC (rev 4528) +++ trunk/MRPDemands.php 2011-04-01 09:52:49 UTC (rev 4529) @@ -6,8 +6,6 @@ // to pass values of $db and $StockID to functions. - when just used $db as variable, // got error: Catchable fatal error: Object of class mysqli could not be converted to string -//$PageSecurity=9; - include('includes/session.inc'); $title = _('MRP Demands'); include('includes/header.inc'); @@ -32,11 +30,11 @@ } elseif (isset($_POST['submit'])) { submit($db,$StockID,$DemandID); } elseif (isset($_GET['delete'])) { - delete($db,$DemandID,"",$StockID); + delete($db,$DemandID,'',$StockID); } elseif (isset($_POST['deletesome'])) { - delete($db,"",$_POST['MRPDemandtype'],$StockID); + delete($db,'',$_POST['MRPDemandtype'],$StockID); } elseif (isset($_GET['listall'])) { - listall($db,"",""); + listall($db,'',''); } elseif (isset($_POST['listsome'])) { listall($db,$StockID,$_POST['MRPDemandtype']); } else { @@ -85,12 +83,12 @@ // If the SELECT found records, display them if (DB_num_rows($result) > 0) { - 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 cellpadding=2 colspan=7 class=selection>'; $TableHeader = '<tr><th>' . _('Code') . '</th> - <th>' . _('Description') . '</th> - </tr>'; + <th>' . _('Description') . '</th> + </tr>'; echo $TableHeader; $j = 1; @@ -149,7 +147,7 @@ prnMsg(_('Invalid due date'),'error'); } $sql = "SELECT * FROM mrpdemandtypes - WHERE mrpdemandtype='" . $_POST['MRPDemandtype'] . "'"; + WHERE mrpdemandtype='" . $_POST['MRPDemandtype'] . "'"; $result = DB_query($sql, $db); if (DB_num_rows($result) == 0){ @@ -159,7 +157,7 @@ // Check if valid part number - Had done a Select Count(*), but that returned a 1 in DB_num_rows // even if there was no record. $sql = "SELECT * FROM stockmaster - WHERE stockid='" . $StockID . "'"; + WHERE stockid='" . $StockID . "'"; $result = DB_query($sql, $db); if (DB_num_rows($result) == 0){ @@ -236,18 +234,18 @@ // edit/delete or deletes all of a particular demand type if press Delete Demand Type button. $where = " "; if ($demandtype) { - $where = ' WHERE mrpdemandtype =' . "'" . $demandtype . "'"; + $where = " WHERE mrpdemandtype ='" . $demandtype . "'"; } if ($DemandID) { - $where = ' WHERE demandid =' . "'" . $DemandID . "'"; + $where = " WHERE demandid ='" . $DemandID . "'"; } $sql="DELETE FROM mrpdemands $where"; $result = DB_query($sql,$db); if ($DemandID) { - prnMsg(_("The MRP demand record for") ." ". $StockID ." ". _("has been deleted"),'succes'); + prnMsg(_('The MRP demand record for') .' '. $StockID .' '. _('has been deleted'),'succes'); } else { - prnMsg(_("All records for demand type") ." ". $demandtype ." " . _("have been deleted"),'succes'); + prnMsg(_('All records for demand type') .' '. $demandtype .' ' . _('have been deleted'),'succes'); } unset ($DemandID); unset ($StockID); @@ -262,14 +260,14 @@ // Lists some in hit List Selection submit button, and uses part number if it is entered or // demandtype - 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'] . '" />'; $where = " "; if ($demandtype) { - $where = ' WHERE mrpdemandtype =' . "'" . $demandtype . "'"; + $where = " WHERE mrpdemandtype ='" . $demandtype . "'"; } if ($part) { - $where = ' WHERE mrpdemands.stockid =' . "'" . $part . "'"; + $where = " WHERE mrpdemands.stockid ='" . $part . "'"; } // If part is entered, it overrides demandtype $sql = 'SELECT mrpdemands.demandid, @@ -287,27 +285,28 @@ echo "<table class=selection> <tr bgcolor =#800000><th>" . _('Part Number') . "</th> - <th>" . _('Description') . "</th> - <th>" . _('Demand Type') . "</th> - <th>" . _('Quantity') . "</th> - <th>" . _('Due Date') . "</th> - </tr>"; + <th>" . _('Description') . "</th> + <th>" . _('Demand Type') . "</th> + <th>" . _('Quantity') . "</th> + <th>" . _('Due Date') . "</th> + </tr>"; $ctr = 0; while ($myrow = DB_fetch_row($result)) { $displaydate = ConvertSQLDate($myrow[4]); $ctr++; - echo "<tr><td>".$myrow[1]."</td> - <td>".$myrow[5]."</td> - <td>".$myrow[2]."</td> - <td>".$myrow[3]."</td> - <td>".$displaydate."</td> - <td><a href=\"".$_SERVER['PHP_SELF'] . '?' . SID."&DemandID=".$myrow[0]."&StockID=".$myrow[1]."\">" . _('Edit') . "</td> - <td><a href=\"".$_SERVER['PHP_SELF'] . '?' . SID."&DemandID=".$myrow[0]."&StockID=".$myrow[1]."&delete=yes\">" . _('Delete') ."</td> - </tr>"; + echo '<tr><td>' . $myrow[1] . '</td> + <td>' . $myrow[5] . '</td> + <td>' . $myrow[2] . '</td> + <td>' . $myrow[3] . '</td> + <td>' . $displaydate . '</td> + <td><a href="' .$_SERVER['PHP_SELF'] .'DemandID=' . $myrow[0] . '&StockID=' . $myrow[1] . '">' . _('Edit') . '</td> + <td><a href="' . $_SERVER['PHP_SELF'] . 'DemandID=' . $myrow[0] . '&StockID=' . $myrow[1].'&delete=yes">' . _('Delete') .'</td> + </tr>'; } //END WHILE LIST LOOP - echo '<tr><td>' . _('Number of Records') . "</td><td>".$ctr."</td></tr>"; + echo '<tr><td>' . _('Number of Records') . '</td> + <td>' . $ctr . '</td></tr>'; echo '</table>'; echo '</form><br/><br/><br/><br/>'; unset ($StockID); @@ -321,7 +320,7 @@ // Display Seach fields at top and Entry form below that. This function is called the first time // the page is called, and is also invoked at the end of all of the other functions. // echo "<br/>DISPLAY - DemandID = $DemandID<br/>"; - 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($StockID)) { echo'</font><table cellpadding=3 colspan=4 class=selection><tr> @@ -331,7 +330,7 @@ <td><font size=1>' . _('Enter extract of the') . ' <b>' . _('Stock Code') . '</b>:</font></td> <td><input tabindex="2" type="Text" name="StockCode" size="15" maxlength="20"></td> <td><font size=3><b>' . _('OR') . '</b></font></td> - <td><a href="'. $_SERVER['PHP_SELF'] . '?&listall=yes"><font size=3>' . _('List All Demands') .'</font></a></td></tr> + <td><a href="'. $_SERVER['PHP_SELF'] . '?listall=yes"><font size=3>' . _('List All Demands') .'</font></a></td></tr> <tr><td colspan=7><div class="centre"><input tabindex="3" type="submit" name="Search" value="' . _('Search Now') . '"></div></td></tr></table>'; } else { @@ -394,7 +393,7 @@ } else { echo '<option value="'; } - echo $myrow['mrpdemandtype'] . '">' . $myrow['mrpdemandtype'] . ' - ' .$myrow['description']; + echo $myrow['mrpdemandtype'] . '">' . $myrow['mrpdemandtype'] . ' - ' .$myrow['description'] . '</option>'; } //end while loop echo '</select></td></tr>'; Modified: trunk/MRPPlannedPurchaseOrders.php =================================================================== --- trunk/MRPPlannedPurchaseOrders.php 2011-03-31 09:12:09 UTC (rev 4528) +++ trunk/MRPPlannedPurchaseOrders.php 2011-04-01 09:52:49 UTC (rev 4529) @@ -1,13 +1,13 @@ <?php -/* $Revision: 1.5 $ */ + /* $Id$*/ // MRPPlannedPurchaseOrders.php - Report of purchase parts that MRP has determined should have // purchase orders created for them include('includes/session.inc'); -//maybe not ansi sql ?? -$sql='SHOW TABLES WHERE Tables_in_'.$_SESSION['DatabaseName'].'="mrprequirements"'; +//Maybe not ANSI SQL?? +$sql="SHOW TABLES WHERE Tables_in_" . $_SESSION['DatabaseName'] . "='mrprequirements'"; $result=DB_query($sql,$db); if (DB_num_rows($result)==0) { @@ -29,15 +29,15 @@ $line_height=12; $Xpos = $Left_Margin+1; - $wheredate = " "; - $reportdate = " "; + $WhereDate = ' '; + $ReportDate = ' '; if (Is_Date($_POST['cutoffdate'])) { - $formatdate = FormatDateForSQL($_POST['cutoffdate']); - $wheredate = ' AND duedate <= "' . $formatdate . '" '; - $reportdate = _(' Through ') . Format_Date($_POST['cutoffdate']); + $FormatDate = FormatDateForSQL($_POST['cutoffdate']); + $WhereDate = " AND duedate <= '" . $FormatDate . "' "; + $ReportDate = _(' Through ') . Format_Date($_POST['cutoffdate']); } if ($_POST['Consolidation'] == 'None') { - $sql = 'SELECT mrpplannedorders.*, + $sql = "SELECT mrpplannedorders.*, stockmaster.stockid, stockmaster.description, stockmaster.mbflag, @@ -46,11 +46,11 @@ (stockmaster.materialcost + stockmaster.labourcost + stockmaster.overheadcost ) as computedcost FROM mrpplannedorders, stockmaster - WHERE mrpplannedorders.part = stockmaster.stockid ' . "$wheredate" . - ' AND stockmaster.mbflag IN ("B","P") - ORDER BY mrpplannedorders.part,mrpplannedorders.duedate'; + WHERE mrpplannedorders.part = stockmaster.stockid " . $WhereDate . " + AND stockmaster.mbflag IN ('B','P') + ORDER BY mrpplannedorders.part,mrpplannedorders.duedate"; } elseif ($_POST['Consolidation'] == 'Weekly') { - $sql = 'SELECT mrpplannedorders.part, + $sql = "SELECT mrpplannedorders.part, SUM(mrpplannedorders.supplyquantity) as supplyquantity, TRUNCATE(((TO_DAYS(duedate) - TO_DAYS(CURRENT_DATE)) / 7),0) AS weekindex, MIN(mrpplannedorders.duedate) as duedate, @@ -64,8 +64,8 @@ (stockmaster.materialcost + stockmaster.labourcost + stockmaster.overheadcost ) as computedcost FROM mrpplannedorders, stockmaster - WHERE mrpplannedorders.part = stockmaster.stockid ' . "$wheredate" . - ' AND stockmaster.mbflag IN ("B","P") + WHERE mrpplannedorders.part = stockmaster.stockid " . $WhereDate . " + AND stockmaster.mbflag IN ('B','P') GROUP BY mrpplannedorders.part, weekindex, stockmaster.stockid, @@ -77,9 +77,9 @@ stockmaster.labourcost, stockmaster.overheadcost, computedcost - ORDER BY mrpplannedorders.part,weekindex'; + ORDER BY mrpplannedorders.part,weekindex"; } else { // This else consolidates by month - $sql = 'SELECT mrpplannedorders.part, + $sql = "SELECT mrpplannedorders.part, SUM(mrpplannedorders.supplyquantity) as supplyquantity, EXTRACT(YEAR_MONTH from duedate) AS yearmonth, MIN(mrpplannedorders.duedate) as duedate, @@ -93,8 +93,8 @@ (stockmaster.materialcost + stockmaster.labourcost + stockmaster.overheadcost ) as computedcost FROM mrpplannedorders, stockmaster - WHERE mrpplannedorders.part = stockmaster.stockid ' . "$wheredate" . - ' AND stockmaster.mbflag IN ("B","P") + WHERE mrpplannedorders.part = stockmaster.stockid " . $WhereDate . " + AND stockmaster.mbflag IN ('B','P') GROUP BY mrpplannedorders.part, yearmonth, stockmaster.stockid, @@ -106,15 +106,15 @@ stockmaster.labourcost, stockmaster.overheadcost, computedcost - ORDER BY mrpplannedorders.part,yearmonth '; - }; + ORDER BY mrpplannedorders.part,yearmonth "; + } $result = DB_query($sql,$db,'','',false,true); if (DB_error_no($db) !=0) { $title = _('MRP Planned Purchase Orders') . ' - ' . _('Problem Report'); include('includes/header.inc'); prnMsg( _('The MRP planned purchase orders could not be retrieved by the SQL because') . ' ' . DB_error_msg($db),'error'); - echo '<br><a href="' .$rootpath .'/index.php?">' . _('Back to the menu') . '</a>'; + echo '<br><a href="' .$rootpath .'/index.php">' . _('Back to the menu') . '</a>'; if ($debug==1){ echo '<br />' . $sql; } @@ -125,23 +125,23 @@ $title = _('Print MRP Planned Purchase Orders Error'); include('includes/header.inc'); prnMsg(_('There were no items with planned purchase orders'),'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; } PrintHeader($pdf,$YPos,$PageNumber,$Page_Height,$Top_Margin,$Left_Margin, - $Page_Width,$Right_Margin,$_POST['Consolidation'],$reportdate); + $Page_Width,$Right_Margin,$_POST['Consolidation'],$ReportDate); $Total_Shortage=0; $Partctr = 0; $fill = false; $pdf->SetFillColor(224,235,255); // Defines color to make alternating lines highlighted $FontSize=8; - $holdpart = " "; - $holddescription = " "; - $holdmbflag = " "; - $holdcost = " "; + $holdpart = ' '; + $holddescription = ' '; + $holdmbflag = ' '; + $holdcost = ' '; $holddecimalplaces = 0; $totalpartqty = 0; $totalpartcost = 0; @@ -169,7 +169,7 @@ list($lastdate,$lastsupplier,$preferredsupplier) = GetPartInfo($db,$holdpart); $displaydate = $lastdate; if (!Is_Date($lastdate)) { - $displaydate = " "; + $displaydate = ' '; } $YPos -= $line_height; $pdf->addTextWrap(50,$YPos,80,$FontSize,_('Last Purchase Date: '),'left',0,$fill); @@ -215,7 +215,7 @@ if ($YPos < $Bottom_Margin + $line_height){ PrintHeader($pdf,$YPos,$PageNumber,$Page_Height,$Top_Margin,$Left_Margin,$Page_Width, - $Right_Margin,$_POST['Consolidation'],$reportdate); + $Right_Margin,$_POST['Consolidation'],$ReportDate); } } /*end while loop */ @@ -232,7 +232,7 @@ list($lastdate,$lastsupplier,$preferredsupplier) = GetPartInfo($db,$holdpart); $displaydate = $lastdate; if (!Is_Date($lastdate)) { - $displaydate = " "; + $displaydate = ' '; } $YPos -= $line_height; $pdf->addTextWrap(50,$YPos,80,$FontSize,_('Last Purchase Date: '),'left',0,$fill); @@ -246,7 +246,7 @@ if ($YPos < $Bottom_Margin + $line_height){ PrintHeader($pdf,$YPos,$PageNumber,$Page_Height,$Top_Margin,$Left_Margin,$Page_Width, - $Right_Margin,$_POST['Consolidation'],$reportdate); + $Right_Margin,$_POST['Consolidation'],$ReportDate); // include('includes/MRPPlannedPurchaseOrdersPageHeader.inc'); } /*Print out the grand totals */ @@ -266,7 +266,7 @@ echo '<p class="page_title_text"><img src="'.$rootpath.'/css/'.$theme.'/images/inventory.png" title="' . _('Inventory') . '" 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>' . _('Consolidation') . ':</td><td><select name="Consolidation">'; echo '<option selected value="None">' . _('None') . '</option>'; @@ -286,7 +286,7 @@ } /*end of else not PrintPDF */ function PrintHeader(&$pdf,&$YPos,&$PageNumber,$Page_Height,$Top_Margin,$Left_Margin, - $Page_Width,$Right_Margin,$consolidation,$reportdate) { + $Page_Width,$Right_Margin,$consolidation,$ReportDate) { /*PDF page header for MRP Planned Work Orders report */ if ($PageNumber>1){ @@ -301,7 +301,7 @@ $YPos -=$line_height; $pdf->addTextWrap($Left_Margin,$YPos,150,$FontSize,_('MRP Planned Purchase Orders Report')); - $pdf->addTextWrap(190,$YPos,100,$FontSize,$reportdate); + $pdf->addTextWrap(190,$YPos,100,$FontSize,$ReportDate); $pdf->addTextWrap($Page_Width-$Right_Margin-150,$YPos,160,$FontSize,_('Printed') . ': ' . Date($_SESSION['DefaultDateFormat']) . ' ' . _('Page') . ' ' . $PageNumber,'left'); $YPos -= $line_height; @@ -340,32 +340,32 @@ function GetPartInfo(&$db,$part) { // Get last purchase order date and supplier for part, and also preferred supplier // Printed when there is a part break - $sql = 'SELECT orddate as maxdate, + $sql = "SELECT orddate as maxdate, purchorders.orderno FROM purchorders, purchorderdetails WHERE purchorders.orderno = purchorderdetails.orderno - AND purchorderdetails.itemcode = "'.$part .'" - ORDER BY orddate DESC LIMIT 1'; + AND purchorderdetails.itemcode = '" . $part ."' + ORDER BY orddate DESC LIMIT 1"; $result = DB_query($sql,$db); if (DB_num_rows($result)>0) { $myrow = DB_fetch_array($result,$db); - $partinfo[] = ConvertSQLDate($myrow['maxdate']); - $orderno = $myrow['orderno']; - $sql = 'SELECT supplierno - FROM purchorders - WHERE purchorders.orderno = "'.$orderno . '"'; + $PartInfo[] = ConvertSQLDate($myrow['maxdate']); + $OrderNo= $myrow['orderno']; + $sql = "SELECT supplierno + FROM purchorders + WHERE purchorders.orderno = '" .$OrderNo. "'"; $result = DB_query($sql,$db); $myrow = DB_fetch_array($result,$db); - $partinfo[] = $myrow['supplierno']; - $sql = 'SELECT supplierno + $PartInfo[] = $myrow['supplierno']; + $sql = "SELECT supplierno FROM purchdata - WHERE stockid = "' . $part . '" - AND preferred="1"'; + WHERE stockid = '" . $part . "' + AND preferred='1'"; $result = DB_query($sql,$db); $myrow = DB_fetch_array($result,$db); - $partinfo[] = $myrow['supplierno']; - return $partinfo; + $PartInfo[] = $myrow['supplierno']; + return $PartInfo; } else { return array('','',''); } Modified: trunk/MRPPlannedWorkOrders.php =================================================================== --- trunk/MRPPlannedWorkOrders.php 2011-03-31 09:12:09 UTC (rev 4528) +++ trunk/MRPPlannedWorkOrders.php 2011-04-01 09:52:49 UTC (rev 4529) @@ -1,33 +1,34 @@ <?php -/* $Revision: 1.6 $ */ + /* $Id$*/ // MRPPlannedWorkOrders.php - Report of manufactured parts that MRP has determined should have // work orders created for them -//$PageSecurity = 2; + include('includes/session.inc'); -$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) { - $title='MRP error'; + $title=_('MRP error'); include('includes/header.inc'); - echo '<br>'; - prnMsg( _('The MRP calculation must be run before you can run this report').'<br>'. - _('To run the MRP calculation click').' '.'<a href='.$rootpath .'/MRP.php?' . SID .'>'._('here').'</a>', 'error'); + echo '<br />'; + prnMsg( _('The MRP calculation must be run before you can run this report').'<br />'. + _('To run the MRP calculation click').' '.'<a href="' . $rootpath . '/MRP.php">'._('here').'</a>', 'error'); include('includes/footer.inc'); exit; } if ( isset($_POST['PrintPDF']) OR isset($_POST['Review']) ) { - $wheredate = " "; - $reportdate = " "; + $WhereDate = ' '; + $ReportDate = ' '; if (Is_Date($_POST['cutoffdate'])) { - $formatdate = FormatDateForSQL($_POST['cutoffdate']); - $wheredate = ' AND duedate <= "' . $formatdate . '" '; - $reportdate = _(' Through ') . $_POST['cutoffdate']; + $FormatDate = FormatDateForSQL($_POST['cutoffdate']); + $WhereDate = " AND duedate <= '" . $FormatDate . "' "; + $ReportDate = ' ' . _('Through') . ' ' . $_POST['cutoffdate']; } if ($_POST['Consolidation'] == 'None') { - $sql = 'SELECT mrpplannedorders.*, + $sql = "SELECT mrpplannedorders.*, stockmaster.stockid, stockmaster.description, stockmaster.mbflag, @@ -36,11 +37,11 @@ (stockmaster.materialcost + stockmaster.labourcost + stockmaster.overheadcost ) as computedcost FROM mrpplannedorders, stockmaster - WHERE mrpplannedorders.part = stockmaster.stockid ' . "$wheredate" . - ' AND stockmaster.mbflag = "M" - ORDER BY mrpplannedorders.part,mrpplannedorders.duedate'; + WHERE mrpplannedorders.part = stockmaster.stockid " . $WhereDate . " + AND stockmaster.mbflag = 'M' + ORDER BY mrpplannedorders.part,mrpplannedorders.duedate"; } elseif ($_POST['Consolidation'] == 'Weekly') { - $sql = 'SELECT mrpplannedorders.part, + $sql = "SELECT mrpplannedorders.part, SUM(mrpplannedorders.supplyquantity) as supplyquantity, TRUNCATE(((TO_DAYS(duedate) - TO_DAYS(CURRENT_DATE)) / 7),0) AS weekindex, MIN(mrpplannedorders.duedate) as duedate, @@ -54,8 +55,8 @@ (stockmaster.materialcost + stockmaster.labourcost + stockmaster.overheadcost ) as computedcost FROM mrpplannedorders, stockmaster - WHERE mrpplannedorders.part = stockmaster.stockid ' . "$wheredate" . - ' AND stockmaster.mbflag = "M" + WHERE mrpplannedorders.part = stockmaster.stockid " . $WhereDate . " + AND stockmaster.mbflag = 'M' GROUP BY mrpplannedorders.part, weekindex, stockmaster.stockid, @@ -67,10 +68,9 @@ stockmaster.labourcost, stockmaster.overheadcost, computedcost - ORDER BY mrpplannedorders.part,weekindex - '; + ORDER BY mrpplannedorders.part,weekindex"; } else { - $sql = 'SELECT mrpplannedorders.part, + $sql = "SELECT mrpplannedorders.part, SUM(mrpplannedorders.supplyquantity) as supplyquantity, EXTRACT(YEAR_MONTH from duedate) AS yearmonth, MIN(mrpplannedorders.duedate) as duedate, @@ -82,10 +82,10 @@ stockmaster.decimalplaces, stockmaster.actualcost, (stockmaster.materialcost + stockmaster.labourcost + - stockmaster.overheadcost ) as computedcost, + stockmaster.overheadcost ) as computedcost FROM mrpplannedorders, stockmaster - WHERE mrpplannedorders.part = stockmaster.stockid ' . "$wheredate" . - ' AND stockmaster.mbflag = "M" + WHERE mrpplannedorders.part = stockmaster.stockid " . $WhereDate . " + AND stockmaster.mbflag = 'M' GROUP BY mrpplannedorders.part, yearmonth, stockmaster.stockid, @@ -97,17 +97,17 @@ stockmaster.labourcost, stockmaster.overheadcost, computedcost - ORDER BY mrpplannedorders.part,yearmonth '; - }; + ORDER BY mrpplannedorders.part,yearmonth"; + } $result = DB_query($sql,$db,'','',false,true); if (DB_error_no($db) !=0) { $title = _('MRP Planned Work Orders') . ' - ' . _('Problem Report'); include('includes/header.inc'); prnMsg( _('The MRP planned work orders 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; @@ -116,13 +116,11 @@ $title = _('MRP Planned Work Orders'); include('includes/header.inc'); prnMsg(_('There were no items with demand greater than supply'),'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; } - - if (isset($_POST['PrintPDF'])) { // Print planned work orders include('includes/PDFStarter.php'); @@ -136,17 +134,17 @@ $Xpos = $Left_Margin+1; PrintHeader($pdf,$YPos,$PageNumber,$Page_Height,$Top_Margin,$Left_Margin, - $Page_Width,$Right_Margin,$_POST['Consolidation'],$reportdate); + $Page_Width,$Right_Margin,$_POST['Consolidation'],$ReportDate); $Total_EXTcost=0; $Partctr = 0; $fill = false; $pdf->SetFillColor(224,235,255); // Defines color to make alternating lines highlighted $FontSize=8; - $holdpart = " "; - $holddescription = " "; - $holdmbflag = " "; - $holdcost = " "; + $holdpart = ' '; + $holddescription = ' '; + $holdmbflag = ' '; + $holdcost = ' '; $holddecimalplaces = 0; $totalpartqty = 0; $totalpartcost = 0; @@ -207,7 +205,7 @@ if ($YPos < $Bottom_Margin + $line_height){ PrintHeader($pdf,$YPos,$PageNumber,$Page_Height,$Top_Margin,$Left_Margin,$Page_Width, - $Right_Margin,$_POST['Consolidation'],$reportdate); + $Right_Margin,$_POST['Consolidation'],$ReportDate); // include('includes/MRPPlannedWorkOrdersPageHeader.inc'); } @@ -226,7 +224,7 @@ if ($YPos < $Bottom_Margin + $line_height){ PrintHeader($pdf,$YPos,$PageNumber,$Page_Height,$Top_Margin,$Left_Margin,$Page_Width, - $Right_Margin,$_POST['Consolidation'],$reportdate); + $Right_Margin,$_POST['Consolidation'],$ReportDate); // include('includes/MRPPlannedWorkOrdersPageHeader.inc'); } /*Print out the grand totals */ @@ -248,21 +246,21 @@ echo '<p class="page_title_text"><img src="'.$rootpath.'/css/'.$theme.'/images/inventory.png" title="' . _('Inventory') . '" alt="" />' . ' ' . $title . '</p>'; - echo "<form action='MRPConvertWorkOrders.php' method='post'>"; + echo '<form action="MRPConvertWorkOrders.php" method="post">'; echo '<input type="hidden" name="FormID" value="' . $_SESSION['FormID'] . '" />'; - echo "<table class=selection>"; - echo "<tr><th colspan=9><font size=3 color=blue>Consolidation: " . $_POST['Consolidation'] . - " Cutoff Date: " . $_POST['cutoffdate'] . "</font></th></tr>"; - echo "<tr><th></th> - <th>" . _('Code') . "</th> - <th>" . _('Description') . "</th> - <th>" . _('MRP Date') . "</th> - <th>" . _('Due Date') . "</th> - <th>" . _('Quantity') . "</th> - <th>" . _('Unit Cost') . "</th> - <th>" . _('Ext. Cost') . "</th> - <th>" . _('Consolidations') . "</th> - </tr>"; + echo '<table class="selection">'; + echo '<tr><th colspan="9"><font size="3" color="blue">' . _('Consolidation') . ': ' . $_POST['Consolidation'] . + " " . _('Cutoff Date') . ': ' . $_POST['cutoffdate'] . '</font></th></tr>'; + echo '<tr><th></th> + <th>' . _('Code') . '</th> + <th>' . _('Description') . '</th> + <th>' . _('MRP Date') . '</th> + <th>' . _('Due Date') . '</th> + <th>' . _('Quantity') . '</th> + <th>' . _('Unit Cost') . '</th> + <th>' . _('Ext. Cost') . '</th> + <th>' . _('Consolidations') . '</th> + </tr>'; $totalpartqty = 0; $totalpartcost = 0; @@ -315,13 +313,11 @@ number_format($Total_Extcost,2) ); - 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'); } - - } else { /*The option to print PDF was not hit so display form */ $title=_('MRP Planned Work Orders Reporting'); @@ -329,17 +325,20 @@ echo '<p class="page_title_text"><img src="'.$rootpath.'/css/'.$theme.'/images/inventory.png" title="' . _('Inventory') . '" alt="" />' . ' ' . $title . '</p>'; - echo '</br></br><form action=' . $_SERVER['PHP_SELF'] . " method='post'><table class=selection>"; + echo '</br></br><form action="' . $_SERVER['PHP_SELF'] . '" method="post"><table class="selection">'; echo '<input type="hidden" name="FormID" value="' . $_SESSION['FormID'] . '" />'; - echo '<tr><td>' . _('Consolidation') . ":</td><td><select name='Consolidation'>"; - echo "<option selected value='None'>" . _('None'); - echo "<option value='Weekly'>" . _('Weekly'); - echo "<option value='Monthly'>" . _('Monthly'); + + echo '<tr><td>' . _('Consolidation') . ':</td><td><select name="Consolidation">'; + echo '<option selected value="None">' . _('None') . '</option>'; + echo '<option value="Weekly">' . _('Weekly') . '</option>'; + echo '<option value="Monthly">' . _('Monthly') . '</option>'; echo '</select></td></tr>'; - echo '<tr><td>' . _('Print Option') . ":</td><td><select name='Fill'>"; - echo "<option selected value='yes'>" . _('Print With Alternating Highlighted Lines'); - echo "<option value='no'>" . _('Plain Print'); + + echo '<tr><td>' . _('Print Option') . ':</td><td><select name="Fill">'; + echo '<option selected value="yes">' . _('Print With Alternating Highlighted Lines') . '</option>'; + echo '<option value="no">' . _('Plain Print') . '</option>'; echo '</select></td></tr>'; + echo '<tr><td>' . _('Cut Off Date') . ":</td><td><input type ='text' class=date alt='".$_SESSION['DefaultDateFormat'] ."' name='cutoffdate' size='10' value='".date($_SESSION['DefaultDateFormat'])."'></tr>"; echo "</table><p><div class='centre'><input type=submit name='Review' value='" . _('Review') . "'> <input type=submit name='PrintPDF' value='" . _('Print PDF') . "'></div>"; @@ -348,7 +347,7 @@ } /*end of else not PrintPDF */ function PrintHeader(&$pdf,&$YPos,&$PageNumber,$Page_Height,$Top_Margin,$Left_Margin, - $Page_Width,$Right_Margin,$consolidation,$reportdate) { + $Page_Width,$Right_Margin,$consolidation,$ReportDate) { /*PDF page header for MRP Planned Work Orders report */ if ($PageNumber>1){ @@ -363,7 +362,7 @@ $YPos -=$line_height; $pdf->addTextWrap($Left_Margin,$YPos,150,$FontSize,_('MRP Planned Work Orders Report')); - $pdf->addTextWrap(190,$YPos,100,$FontSize,$reportdate); + $pdf->addTextWrap(190,$YPos,100,$FontSize,$ReportDate); $pdf->addTextWrap($Page_Width-$Right_Margin-150,$YPos,160,$FontSize,_('Printed') . ': ' . Date($_SESSION['DefaultDateFormat']) . ' ' . _('Page') . ' ' . $PageNumber,'left'); $YPos -= $line_height; Modified: trunk/MRPReport.php =================================================================== --- trunk/MRPReport.php 2011-03-31 09:12:09 UTC (rev 4528) +++ trunk/MRPReport.php 2011-04-01 09:52:49 UTC (rev 4529) @@ -2,10 +2,8 @@ /* $Id$*/ -/* $Revision: 1.5 $ */ - // MRPReport.php - Shows supply and demand for a part as determined by MRP -//$PageSecurity = 2; + include('includes/session.inc'); if (isset($_POST['Select'])) { @@ -22,7 +20,7 @@ $PageNumber=1; $line_height=10 ; - // Load mrprequirements into $requirements array + // Load mrprequirements into $Requirements array // Use weekindex to assign supplies, requirements, and planned orders to weekly buckets $sql = "SELECT mrprequirements.*, TRUNCATE(((TO_DAYS(daterequired) - TO_DAYS(CURRENT_DATE)) / 7),0) AS weekindex, @@ -38,7 +36,7 @@ $title = _('Print MRP Report Error'); include('includes/header.inc'); prnMsg(_('The MRP calculation must be run before this report will have any output. MRP requires set up of many parameters, including, EOQ, lead times, minimums, bills of materials, demand types, master schedule etc'),'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>'; include('includes/footer.inc'); exit; } @@ -49,65 +47,67 @@ $title = _('Print MRP Report Warning'); include('includes/header.inc'); prnMsg(_('The MRP calculation must be run before this report will have any output. MRP requires set up of many parameters, including, EOQ, lead times, minimums, bills of materials, demand types, master schedule, etc'), 'warn'); - 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; } - $requirements = array(); - $weeklyreq = array(); + $Requirements = array(); + $WeeklyReq = array(); for ($i=0;$i<28;$i++) { - $weeklyreq[$i]=0; + $WeeklyReq[$i]=0; } - $pastduereq = 0; - $futurereq = 0; - $grossreq = 0; + $PastDueReq = 0; + $FutureReq = 0; + $GrossReq = 0; while ($myrow=DB_fetch_array($result)) { - array_push($requirements,$myrow); - $grossreq += $myrow['quantity']; + array_push($Requirements,$myrow); + $GrossReq += $myrow['quantity']; if ($myrow['datediff'] < 0) { - $pastduereq += $myrow['quantity']; + $PastDueReq += $myrow['quantity']; } elseif ($myrow['weekindex'] > 27) { - $futurereq += $myrow['quantity']; + $FutureReq += $myrow['quantity']; } else { - $weeklyreq[$myrow['weekindex']] += $myrow['quantity']; + $WeeklyReq[$myrow['weekindex']] += $myrow['quantity']; } } //end of while loop - // Load mrpsupplies into $supplies array + // Load mrpsupplies into $Supplies array $sql = "SELECT mrpsupplies.*, TRUNCATE(((TO_DAYS(duedate) - TO_DAYS(CURRENT_DATE)) / 7),0) AS weekindex, TO_DAYS(duedate) - TO_DAYS(CURRENT_DATE) AS datediff - FROM mrpsupplies WHERE part = '" . $_POST['Part'] . "' ORDER BY mrpdate"; + FROM mrpsupplies + WHERE part = '" . $_POST['Part'] . "' + ORDER BY mrpdate"; $result = DB_query($sql,$db,'','',false,true); if (DB_error_no($db) !=0) { $errors = 1; $holddb = $db; } - $supplies = array(); - $weeklysup = array(); + $Supplies = array(); + $WeeklySup = array(); for ($i=0;$i<28;$i++) { - $weeklysup[$i]=0; + $WeeklySup[$i]=0; } - $pastduesup = 0; - $futuresup = 0; + $PastDueSup = 0; + $FutureSup = 0; $qoh = 0; // Get quantity on Hand to display - $openord = 0; + $OpenOrd = 0; while ($myrow=DB_fetch_array($result)) { if ($myrow['ordertype'] == 'QOH') { $qoh += $myrow['supplyquantity']; } else { - $openord += $myrow['supplyquantity']; + $OpenOrd += $myrow['supplyquantity']; if ($myrow['datediff'] < 0) { - $pastduesup += $myrow['supplyquantity']; + $PastDueSup += $myrow['supplyquantity']; } elseif ($myrow['weekindex'] > 27) { - $futuresup += $myrow['supplyquantity']; + $FutureSup += $myrow['supplyquantity']; } else { - $weeklysup[$myrow['weekindex']] += $myrow['supplyquantity']; + $WeeklySup[$myrow['weekindex']] += $myrow['supplyquantity']; } } - array_push($supplies,$myrow); + array_push($Supplies,$myrow); } //end of while loop $sql = "SELECT mrpplannedorders.*, @@ -128,7 +128,7 @@ $pastdueplan = 0; $futureplan = 0; while ($myrow=DB_fetch_array($result)) { - array_push($supplies,$myrow); + array_push($Supplies,$myrow); if ($myrow['datediff'] < 0) { $pastdueplan += $myrow['supplyquantity']; } elseif ($myrow['weekindex'] > 27) { @@ -137,9 +137,9 @@ $weeklyplan[$myrow['weekindex']] += $myrow['supplyquantity']; } } //end of while loop - // The following sorts the $supplies array by mrpdate. Have to sort because are loading + // The following sorts the $Supplies array by mrpdate. Have to sort because are loading // mrpsupplies and mrpplannedorders into same array - foreach ($supplies as $key => $row) { + foreach ($Supplies as $key => $row) { $mrpdate[$key] = $row['mrpdate']; } @@ -147,16 +147,16 @@ $title = _('MRP Report') . ' - ' . _('Problem Report'); include('includes/header.inc'); prnMsg( _('The MRP Report could not be retrieved by the SQL because') . ' ' . DB_error_msg($holddb),'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 (count($supplies)) { - array_multisort($mrpdate, SORT_ASC, $supplies); + if (count($Supplies)) { + array_multisort($mrpdate, SORT_ASC, $Supplies); } PrintHeader($pdf,$YPos,$PageNumber,$Page_Height,$Top_Margin,$Left_Margin,$Page_Width, $Right_Margin); @@ -188,14 +188,14 @@ $pdf->addTextWrap(245,$YPos,40,$FontSize,_('Pan Size:'),'right'); $pdf->addTextWrap(285,$YPos,45,$FontSize,number_format($myrow['pansize'],$myrow['decimalplaces']),'right'); $pdf->addTextWrap(360,$YPos,50,$FontSize,_('On Order:'),'right'); - $pdf->addTextWrap(410,$YPos,50,$FontSize,number_format($openord,$myrow['decimalplaces']),'right'); + $pdf->addTextWrap(410,$YPos,50,$FontSize,number_format($OpenOrd,$myrow['decimalplaces']),'right'); $YPos -=$line_height; $pdf->addTextWrap($Left_Margin,$YPos,30,$FontSize,'M/B:',''); $pdf->addTextWrap(70,$YPos,150,$FontSize,$myrow['mbflag'],''); $pdf->addTextWrap(225,$YPos,60,$FontSize,'Shrinkage:','right'); $pdf->addTextWrap(300,$YPos,30,$FontSize,number_format($myrow['shrinkfactor'],$myrow['decimalplaces']),'right'); $pdf->addTextWrap(360,$YPos,50,$FontSize,_('Gross Req:'),'right'); - $pdf->addTextWrap(410,$YPos,50,$FontSize,number_format($grossreq,$myrow['decimalplaces']),'right'); + $pdf->addTextWrap(410,$YPos,50,$FontSize,number_format($GrossReq,$myrow['decimalplaces']),'right'); $YPos -=$line_height; $pdf->addTextWrap(225,$YPos,60,$FontSize,'Lead Time:','right'); $pdf->addTextWrap(300,$YPos,30,$FontSize,$myrow['leadtime'],'right'); @@ -204,13 +204,13 @@ $YPos -= (2*$line_height); // Calculate fields for prjected available weekly buckets - $pastdueavail = ($qoh + $pastduesup + $pastdueplan) - $pastduereq; + $pastdueavail = ($qoh + $PastDueSup + $pastdueplan) - $PastDueReq; $weeklyavail = array(); - $weeklyavail[0] = ($pastdueavail + $weeklysup[0] + $weeklyplan[0]) - $weeklyreq[0]; + $weeklyavail[0] = ($pastdueavail + $WeeklySup[0] + $weeklyplan[0]) - $WeeklyReq[0]; for ($i = 1; $i < 28; $i++) { - $weeklyavail[$i] = ($weeklyavail[$i - 1] + $weeklysup[$i] + $weeklyplan[$i]) - $weeklyreq[$i]; + $weeklyavail[$i] = ($weeklyavail[$i - 1] + $WeeklySup[$i] + $weeklyplan[$i]) - $WeeklyReq[$i]; } - $futureavail = ($weeklyavail[27] + $futuresup + $futureplan) - $futurereq; + $futureavail = ($weeklyavail[27] + $FutureSup + $futureplan) - $FutureReq; // Headers for Weekly Buckets $FontSize =7; @@ -218,39 +218,39 @@ $today = date("$dateformat"); $pdf->addTextWrap($Left_Margin+40,$YPos,45,$FontSize,_('Past Due'),'right'); $pdf->addTextWrap(130,$YPos,45,$FontSize,$today,'right'); - $pdf->addTextWrap(175,$YPos,45,$FontSize,DateAdd($today,"w",1),'right'); - $pdf->addTextWrap(220,$YPos,45,$FontSize,DateAdd($today,"w",2),'right'); - $pdf->addTextWrap(265,$YPos,45,$FontSize,DateAdd($today,"w",3),'right'); - $pdf->addTextWrap(310,$YPos,45,$FontSize,DateAdd($today,"w",4),'right'); - $pdf->addTextWrap(355,$YPos,45,$FontSize,DateAdd($today,"w",5),'right'); - $pdf->addTextWrap(400,$YPos,45,$FontSize,DateAdd($today,"w",6),'right'); - $pdf->addTextWrap(445,$YPos,45,$FontSize,DateAdd($today,"w",7),'right'); - $pdf->addTextWrap(490,$YPos,45,$FontSize,DateAdd($today,"w",8),'right'); + $pdf->addTextWrap(175,$YPos,45,$FontSize,DateAdd($today,'w',1),'right'); + $pdf->addTextWrap(220,$YPos,45,$FontSize,DateAdd($today,'w',2),'right'); + $pdf->addTextWrap(265,$YPos,45,$FontSize,DateAdd($today,'w',3),'right'); + $pdf->addTextWrap(310,$YPos,45,$FontSize,DateAdd($today,'w',4),'right'); + $pdf->addTextWrap(355,$YPos,45,$FontSize,DateAdd($today,'w',5),'right'); + $pdf->addTextWrap(400,$YPos,45,$FontSize,DateAdd($today,'w',6),'right'); + $pdf->addTextWrap(445,$YPos,45,$FontSize,DateAdd($today,'w',7),'right'); + $pdf->addTextWrap(490,$YPos,45,$FontSize,DateAdd($today,'w',8),'right'); $YPos -=$line_height; $pdf->addTextWrap($Left_Margin,$YPos,40,$FontSize,_('Gross Reqts')); - $pdf->addTextWrap($Left_Margin+40,$YPos,45,$FontSize,number_format($pastduereq,0),'right'); - $pdf->addTextWrap(130,$YPos,45,$FontSize,number_format($weeklyreq[0],0),'right'); - $pdf->addTextWrap(175,$YPos,45,$FontSize,number_format($weeklyreq[1],0),'right'); - $pdf->addTextWrap(220,$YPos,45,$FontSize,number_format($weeklyreq[2],0),'right'); - $pdf->addTextWrap(265,$YPos,45,$FontSize,number_format($weeklyreq[3],0),'right'); - $pdf->addTextWrap(310,$YPos,45,$FontSize,number_format($weeklyreq[4],0),'right'); - $pdf->addTextWrap(355,$YPos,45,$FontSize,number_format($weeklyreq[5],0),'right'); - $pdf->addTextWrap(400,$YPos,45,$FontSize,number_format($weeklyreq[6],0),'right'); - $pdf->addTextWrap(445,$YPos,45,$FontSize,number_format($weeklyreq[7],0),'right'); - $pdf->addTextWrap(490,$YPos,45,$FontSize,number_format($weeklyreq[8],0),'right'); + $pdf->addTextWrap($Left_Margin+40,$YPos,45,$FontSize,number_format($PastDueReq,0),'right'); + $pdf->addTextWrap(130,$YPos,45,$FontSize,number_format($WeeklyReq[0],0),'right'); + $pdf->addTextWrap(175,$YPos,45,$FontSize,number_format($WeeklyReq[1],0),'right'); + $pdf->addTextWrap(220,$YPos,45,$FontSize,number_format($WeeklyReq[2],0),'right'); + $pdf->addTextWrap(265,$YPos,45,$FontSize,number_format($WeeklyReq[3],0),'right'); + $pdf->addTextWrap(310,$YPos,45,$FontSize,number_format($WeeklyReq[4],0),'right'); + $pdf->addTextWrap(355,$YPos,45,$FontSize,number_format($WeeklyReq[5],0),'right'); + $pdf->addTextWrap(400,$YPos,45,$FontSize,number_format($WeeklyReq[6],0),'right'); + $pdf->addTextWrap(445,$YPos,45,$FontSize,number_format($WeeklyReq[7],0),'right'); + $pdf->addTextWrap(490,$YPos,45,$FontSize,number_format($WeeklyReq[8],0),'right'); $YPos -=$line_height; $pdf->addTextWrap($Left_Margin,$YPos,40,$FontSize,_('Open Order')); - $pdf->addTextWrap($Left_Margin+40,$YPos,45,$FontSize,number_format($pastduesup,0),'right'); - $pdf->addTextWrap(130,$YPos,45,$FontSize,number_format($weeklysup[0],0),'right'); - $pdf->addTextWrap(175,$YPos,45,$FontSize,number_format($weeklysup[1],0),'right'); - $pdf->addTextWrap(220,$YPos,45,$FontSize,number_format($weeklysup[2],0),'right'); - $pdf->addTextWrap(265,$YPos,45,$FontSize,number_format($weeklysup[3],0),'right'); - $pdf->addTextWrap(310,$YPos,45,$FontSize,number_format($weeklysup[4],0),'right'); - $pdf->addTextWrap(355,$YPos,45,$FontSize,number_format($weeklysup[5],0),'right'); - $pdf->addTextWrap(400,$YPos,45,$FontSize,number_format($weeklysup[6],0),'right'); - $pdf->addTextWrap(445,$YPos,45,$FontSize,number_format($weeklysup[7],0),'right'); - $pdf->addTextWrap(490,$YPos,45,$FontSize,number_format($weeklysup[8],0),'right'); + $pdf->addTextWrap($Left_Margin+40,$YPos,45,$FontSize,number_format($PastDueSup,0),'right'); + $pdf->addTextWrap(130,$YPos,45,$FontSize,number_format($WeeklySup[0],0),'right'); + $pdf->addTextWrap(175,$YPos,45,$FontSize,number_format($WeeklySup[1],0),'right'); + $pdf->addTextWrap(220,$YPos,45,$FontSize,number_format($WeeklySup[2],0),'right'); + $pdf->addTextWrap(265,$YPos,45,$FontSize,number_format($WeeklySup[3],0),'right'); + $pdf->addTextWrap(310,$YPos,45,$FontSize,number_format($WeeklySup[4],0),'right'); + $pdf->addTextWrap(355,$YPos,45,$FontSize,number_format($WeeklySup[5],0),'right'); + $pdf->addTextWrap(400,$YPos,45,$FontSize,number_format($WeeklySup[6],0),'right'); + $pdf->addTextWrap(445,$YPos,45,$FontSize,number_format($WeeklySup[7],0),'right'); + $pdf->addTextWrap(490,$YPos,45,$FontSize,number_format($WeeklySup[8],0),'right'); $YPos -=$line_height; $pdf->addTextWrap($Left_Margin,$YPos,40,$FontSize,_('Planned')); $pdf->addTextWrap($Left_Margin+40,$YPos,45,$FontSize,number_format($pastdueplan,0),'right'); @@ -278,41 +278,41 @@ $YPos -= 2 * $line_height; // Second Group of Weeks - $pdf->addTextWrap($Left_Margin+40,$YPos,45,$FontSize,DateAdd($today,"w",9),'right'); - $pdf->addTextWrap(130,$YPos,45,$FontSize,DateAdd($today,"w",10),'right'); - $pdf->addTextWrap(175,$YPos,45,$FontSize,DateAdd($today,"w",11),'right'); - $pdf->addTextWrap(220,$YPos,45,$FontSize,DateAdd($today,"w",12),'right'); - $pdf->addTextWrap(265,$YP... [truncated message content] |
From: <dai...@us...> - 2011-04-01 09:52:57
|
Revision: 4529 http://web-erp.svn.sourceforge.net/web-erp/?rev=4529&view=rev Author: daintree Date: 2011-04-01 09:52:49 +0000 (Fri, 01 Apr 2011) Log Message: ----------- Modified Paths: -------------- trunk/InventoryValuation.php trunk/MRPCreateDemands.php trunk/MRPDemandTypes.php trunk/MRPDemands.php trunk/MRPPlannedPurchaseOrders.php trunk/MRPPlannedWorkOrders.php trunk/MRPReport.php trunk/includes/PO_PDFOrderPageHeader.inc Modified: trunk/InventoryValuation.php =================================================================== --- trunk/InventoryValuation.php 2011-03-31 09:12:09 UTC (rev 4528) +++ trunk/InventoryValuation.php 2011-04-01 09:52:49 UTC (rev 4529) @@ -1,9 +1,7 @@ <?php -/* $Revision: 1.17 $ */ /* $Id$ */ -//$PageSecurity = 2; include('includes/session.inc'); if (isset($_POST['PrintPDF']) @@ -76,9 +74,9 @@ $title = _('Inventory Valuation') . ' - ' . _('Problem Report'); include('includes/header.inc'); prnMsg( _('The inventory valuation 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; @@ -87,7 +85,7 @@ $title = _('Print Inventory Valuation Error'); include('includes/header.inc'); prnMsg(_('There were no items with any value to print out for the location specified'),'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; } @@ -116,9 +114,9 @@ $DisplayCatTotVal = number_format($CatTot_Val,2); $DisplayCatTotQty = number_format($CatTot_Qty,0); - $LeftOvers = $pdf->addTextWrap(500,$YPos,60,$FontSize,$DisplayCatTotVal, 'right'); - $LeftOvers = $pdf->addTextWrap(380,$YPos,60,$FontSize,$DisplayCatTotQty, 'right'); - $YPos -=$line_height; + $LeftOvers = $pdf->addTextWrap(500,$YPos,60,$FontSize,$DisplayCatTotVal, 'right'); + $LeftOvers = $pdf->addTextWrap(380,$YPos,60,$FontSize,$DisplayCatTotQty, 'right'); + $YPos -=$line_height; If ($_POST['DetailedReport']=='Yes'){ /*draw a line under the CATEGORY TOTAL*/ @@ -206,10 +204,10 @@ echo '<tr><td>' . _('From Inventory Category Code') . ':</font></td><td><select name=FromCriteria>'; - $sql='SELECT categoryid, categorydescription FROM stockcategory WHERE stocktype<>"A" ORDER BY categoryid'; + $sql="SELECT categoryid, categorydescription FROM stockcategory WHERE stocktype<>'A' ORDER BY categoryid"; $CatResult= DB_query($sql,$db); While ($myrow = DB_fetch_array($CatResult)){ - echo "<option value='" . $myrow['categoryid'] . "'>" . $myrow['categoryid'] . ' - ' . $myrow['categorydescription']; + echo '<option value="' . $myrow['categoryid'] . '">' . $myrow['categoryid'] . ' - ' . $myrow['categorydescription'] . '</option>'; } echo '</select></td></tr>'; @@ -219,27 +217,27 @@ DB_data_seek($CatResult,0); While ($myrow = DB_fetch_array($CatResult)){ - echo "<option value='" . $myrow['categoryid'] . "'>" . $myrow['categoryid'] . ' - ' . $myrow['categorydescription']; + echo '<option value="' . $myrow['categoryid'] . '">' . $myrow['categoryid'] . ' - ' . $myrow['categorydescription'] . '</option>'; } echo '</select></td></tr>'; - echo '<tr><td>' . _('For Inventory in Location') . ":</td><td><select name='Location'>"; + echo '<tr><td>' . _('For Inventory in Location') . ':</td><td><select name="Location">'; $sql = 'SELECT loccode, locationname FROM locations'; $LocnResult=DB_query($sql,$db); - echo "<option value='All'>" . _('All Locations'); + echo '<option value="All">' . _('All Locations') . '</option>'; while ($myrow=DB_fetch_array($LocnResult)){ - echo "<option Value='" . $myrow['loccode'] . "'>" . $myrow['locationname']; - } + echo '<option Value="' . $myrow['loccode'] . '">' . $myrow['locationname'] . '</option>'; + } echo '</select></td></tr>'; - echo '<tr><td>' . _('Summary or Detailed Report') . ":</td><td><select name='DetailedReport'>"; - echo "<option selected Value='No'>" . _('Summary Report'); - echo "<option Value='Yes'>" . _('Detailed Report'); + echo '<tr><td>' . _('Summary or Detailed Report') . ':</td><td><select name="DetailedReport">'; + echo '<option selected Value="No">' . _('Summary Report') . '</option>'; + echo '<option Value="Yes">' . _('Detailed Report') . '</option>'; echo '</select></td></tr>'; - echo "</table><br><div class='centre'><input type=Submit Name='PrintPDF' Value='" . _('Print PDF') . "'></div>"; + echo '</table><br /><div class="centre"><input type="Submit" name="PrintPDF" value="' . _('Print PDF') . '"></div>'; } include('includes/footer.inc'); Modified: trunk/MRPCreateDemands.php =================================================================== --- trunk/MRPCreateDemands.php 2011-03-31 09:12:09 UTC (rev 4528) +++ trunk/MRPCreateDemands.php 2011-04-01 09:52:49 UTC (rev 4529) @@ -1,10 +1,7 @@ <?php -/* $Revision: 1.8 $ */ /* $Id$*/ // MRPCreateDemands.php - Create mrpdemands based on sales order history -//$PageSecurity=9; - include('includes/session.inc'); $title = _('MRP Create Demands'); include('includes/header.inc'); @@ -32,8 +29,7 @@ unset($_POST['FromoDate']); } if (isset($_POST['DistDate']) AND !Is_Date($_POST['DistDate'])){ - $msg = _('The distribution start date must be specified in the format') . ' ' . - $_SESSION['DefaultDateFormat']; + $msg = _('The distribution start date must be specified in the format') . ' ' . $_SESSION['DefaultDateFormat']; $InputError=1; unset($_POST['DistDate']); } @@ -42,13 +38,13 @@ prnMsg($msg,'error'); } -$wherecategory = " "; +$WhereCategory = " "; if ($_POST['CategoryID']!='All') { - $wherecategory = " AND stockmaster.categoryid ='" . $_POST['CategoryID'] . "' "; + $WhereCategory = " AND stockmaster.categoryid ='" . $_POST['CategoryID'] . "' "; } -$wherelocation = " "; +$WhereLocation = " "; if ($_POST['Location']!='All') { - $wherelocation = " AND salesorders.fromstkloc ='" . $_POST['Location'] . "' "; + $WhereLocation = " AND salesorders.fromstkloc ='" . $_POST['Location'] . "' "; } $sql= "SELECT salesorderdetails.stkcode, @@ -60,11 +56,11 @@ ON salesorders.orderno = salesorderdetails.orderno INNER JOIN stockmaster ON salesorderdetails.stkcode = stockmaster.stockid - WHERE orddate >='" . FormatDateForSQL($_POST['FromDate']) . - "' AND orddate <='" . FormatDateForSQL($_POST['ToDate']) . - "' $wherelocation - $wherecategory " - . " GROUP BY salesorderdetails.stkcode"; + WHERE orddate >='" . FormatDateForSQL($_POST['FromDate']) ."' + AND orddate <='" . FormatDateForSQL($_POST['ToDate']) . "' + " . $WhereLocation . " + " . $WhereCategory . " + GROUP BY salesorderdetails.stkcode"; //echo "</br>$sql</br>"; $result = DB_query($sql,$db); // To get the quantity per period, get the whole number amount of the total quantity divided @@ -114,11 +110,11 @@ $date = date("Y-m-d",mktime(0,0,0,$mm,$dd,$yyyy)); for ($i = 1; $i <= ( $_POST['PeriodNumber'] - 1); $i++) { if ($_POST['Period'] == 'weekly') { - $date = strtotime(date("Y-m-d", strtotime($date)) . " + 1 week"); + $date = strtotime(date('Y-m-d', strtotime($date)) . ' + 1 week'); } else { - $date = strtotime(date("Y-m-d", strtotime($date)) . " + 1 month"); + $date = strtotime(date('Y-m-d', strtotime($date)) . ' + 1 month'); } - $datearray[$i] = date("Y-m-d",$date); + $datearray[$i] = date('Y-m-d',$date); // Following sql finds daynumber for the calculated date and finds // a valid manufacturing date for the daynumber. There is only one valid manufacturing date // for each daynumber, but there could be several non-manufacturing dates for the @@ -136,30 +132,30 @@ if ($myrowdate[0] != 0){ $datearray[$i] = $myrowdate[1]; } - $date = date("Y-m-d",$date); + $date = date('Y-m-d',$date); } -$totalrecords = 0; +$TotalRecords = 0; while ($myrow = DB_fetch_array($result)) { if (($myrow['totqty'] >= $excludeqty) and ($myrow['totextqty'] >= $excludeamt)) { - unset($periodqty); - $periodqty[] = " "; - $totalqty = $myrow['totqtyinvoiced'] * $multiplier; - $wholenumber = floor($totalqty / $_POST['PeriodNumber']); - $remainder = ($totalqty % $_POST['PeriodNumber']); - if ($wholenumber > 0) { + unset($PeriodQty); + $PeriodQty[] = ' '; + $TotalQty = $myrow['totqtyinvoiced'] * $multiplier; + $WholeNumber = floor($TotalQty / $_POST['PeriodNumber']); + $Remainder = ($TotalQty % $_POST['PeriodNumber']); + if ($WholeNumber > 0) { for ($i = 0; $i <= ($_POST['PeriodNumber'] - 1); $i++) { - $periodqty[$i] = $wholenumber; + $PeriodQty[$i] = $WholeNumber; } } - if ($remainder > 0) { - for ($i = 0; $i <= ($remainder - 1); $i++) { - $periodqty[$i] += 1; + if ($Remainder > 0) { + for ($i = 0; $i <= ($Remainder - 1); $i++) { + $PeriodQty[$i] += 1; } } $i = 0; - foreach ($periodqty as $demandqty) { + foreach ($PeriodQty as $demandqty) { $sql = "INSERT INTO mrpdemands (stockid, mrpdemandtype, quantity, @@ -170,14 +166,14 @@ '" . $datearray[$i] . "')"; $insertresult = DB_query($sql,$db); $i++; - $totalrecords++; + $TotalRecords++; } // end of foreach for INSERT } // end of if that checks exludeqty, excludeamt } //end while loop -prnMsg( $totalrecords . ' ' . _('records have been created'),'success'); +prnMsg( $TotalRecords . ' ' . _('records have been created'),'success'); } else { // if submit has not been pressed @@ -185,7 +181,7 @@ } // End of else to create form echo '<p class="page_title_text"><img src="'.$rootpath.'/css/'.$theme.'/images/inventory.png" title="' . _('Inventory') . '" alt="" />' . ' ' . $title . '</p>'; - echo '<form action=' . $_SERVER['PHP_SELF'] . '?' . SID .' method="post"><b><br></b>'; + echo '<form action="' . $_SERVER['PHP_SELF'] . '" method="post"><b><br /></b>'; echo '<input type="hidden" name="FormID" value="' . $_SESSION['FormID'] . '" />'; echo '<table class=selection>'; echo '<tr><td>' . _('Demand Type') . ':</td><td><select name="MRPDemandtype">'; @@ -210,13 +206,13 @@ } //end while loop echo '</select></td></tr>'; echo '<tr><td>' . _('Inventory Location') . ':</td><td><select name="Location">'; - echo '<option selected value="All">' . _('All Locations'); + 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>'; if (!isset($_POST['FromDate'])) { @@ -246,7 +242,7 @@ ":</td><td><input type ='text' class=number name='Excludeamt' size='8' value='0'>"; echo '<tr><td>' . _('Multiplier') . ":</td><td><input type ='text' class=number name='Multiplier' size='2' value=1><tr><td></td></tr></table>"; - echo "<br><div class=centre><input type=submit name='submit' value='" . _('Submit') . "'</div>"; + echo "<br /><div class=centre><input type=submit name='submit' value='" . _('Submit') . "'</div>"; include('includes/footer.inc'); ?> \ No newline at end of file Modified: trunk/MRPDemandTypes.php =================================================================== --- trunk/MRPDemandTypes.php 2011-03-31 09:12:09 UTC (rev 4528) +++ trunk/MRPDemandTypes.php 2011-04-01 09:52:49 UTC (rev 4529) @@ -1,14 +1,12 @@ <?php -/* $Revision: 1.3 $ */ + /* $Id$*/ -//$PageSecurity=9; - include('includes/session.inc'); $title = _('MRP Demand Types'); include('includes/header.inc'); -//SelectedDT is the Selected mrpdemandtype +//SelectedDT is the Selected MRPDemandType if (isset($_POST['SelectedDT'])){ $SelectedDT = trim(strtoupper($_POST['SelectedDT'])); } elseif (isset($_GET['SelectedDT'])){ @@ -28,13 +26,13 @@ //first off validate inputs sensible - if (trim(strtoupper($_POST['mrpdemandtype']) == "WO") or - trim(strtoupper($_POST['mrpdemandtype']) == "SO")) { + if (trim(strtoupper($_POST['MRPDemandType']) == 'WO') or + trim(strtoupper($_POST['MRPDemandType']) == 'SO')) { $InputError = 1; prnMsg(_('The Demand Type is reserved for the system'),'error'); } - if (strlen($_POST['mrpdemandtype']) < 1) { + if (strlen($_POST['MRPDemandType']) < 1) { $InputError = 1; prnMsg(_('The Demand Type code must be at least 1 character long'),'error'); } @@ -59,7 +57,7 @@ $sql = "INSERT INTO mrpdemandtypes (mrpdemandtype, description) - VALUES ('" . trim(strtoupper($_POST['mrpdemandtype'])) . "', + VALUES ('" . trim(strtoupper($_POST['MRPDemandType'])) . "', '" . $_POST['Description'] . "' )"; $msg = _('The new demand type has been added to the database'); @@ -69,9 +67,9 @@ if ($InputError !=1){ $result = DB_query($sql,$db,_('The update/addition of the demand type failed because')); prnMsg($msg,'success'); - echo '<br>'; + echo '<br />'; unset ($_POST['Description']); - unset ($_POST['mrpdemandtype']); + unset ($_POST['MRPDemandType']); unset ($SelectedDT); } @@ -81,17 +79,17 @@ // PREVENT DELETES IF DEPENDENT RECORDS IN 'MRPDemands' $sql= "SELECT COUNT(*) FROM mrpdemands - WHERE mrpdemands.mrpdemandtype='$SelectedDT' + WHERE mrpdemands.mrpdemandtype='" . $SelectedDT . "' GROUP BY mrpdemandtype"; $result = DB_query($sql,$db); $myrow = DB_fetch_row($result); if ($myrow[0]>0) { prnMsg(_('Cannot delete this demand type because MRP Demand records exist for this type') . '<br>' . _('There are') . ' ' . $myrow[0] . ' ' ._('MRP Demands referring to this type'),'warn'); } else { - $sql="DELETE FROM mrpdemandtypes WHERE mrpdemandtype='$SelectedDT'"; + $sql="DELETE FROM mrpdemandtypes WHERE mrpdemandtype='" . $SelectedDT . "'"; $result = DB_query($sql,$db); prnMsg(_('The selected demand type record has been deleted'),'succes'); - echo '<br>'; + echo '<br />'; } // end of MRPDemands test } @@ -110,22 +108,22 @@ $result = DB_query($sql,$db); - echo "<table class=selection> - <tr BGCOLOR =#800000><th>" . _('Demand Type') . "</th> - <th>" . _('Description') . "</th> - </tr></font>"; + echo '<table class=selection> + <tr BGCOLOR =#800000><th>' . _('Demand Type') . '</th> + <th>' . _('Description') . '</th> + </tr></font>'; while ($myrow = DB_fetch_row($result)) { printf("<tr><td>%s</td> <td>%s</td> - <td><a href=\"%s&SelectedDT=%s\">" . _('Edit') . "</td> - <td><a href=\"%s&SelectedDT=%s&delete=yes\">" . _('Delete') ."</td> + <td><a href=\"%sSelectedDT=%s\">" . _('Edit') . "</td> + <td><a href=\"%sSelectedDT=%s&delete=yes\">" . _('Delete') ."</td> </tr>", $myrow[0], $myrow[1], - $_SERVER['PHP_SELF'] . '?' . SID, - $myrow[0], $_SERVER['PHP_SELF'] . '?' . SID, + $_SERVER['PHP_SELF'] . '?', + $myrow[0], $_SERVER['PHP_SELF'] . '?', $myrow[0]); } @@ -136,10 +134,10 @@ //end of ifs and buts! if (isset($SelectedDT) and !isset($_GET['delete'])) { - echo "<div class='centre'><a href='" . $_SERVER['PHP_SELF'] . '?' . SID . "'>" . _('Show all Demand Types') . '</a></div>'; + echo '<div class="centre"><a href="' . $_SERVER['PHP_SELF'] . '">' . _('Show all Demand Types') . '</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($SelectedDT) and !isset($_GET['delete'])) { @@ -148,25 +146,25 @@ $sql = "SELECT mrpdemandtype, description FROM mrpdemandtypes - WHERE mrpdemandtype='$SelectedDT'"; + WHERE mrpdemandtype='" . $SelectedDT . "'"; $result = DB_query($sql, $db); $myrow = DB_fetch_array($result); - $_POST['mrpdemandtype'] = $myrow['mrpdemandtype']; + $_POST['MRPDemandType'] = $myrow['mrpdemandtype']; $_POST['Description'] = $myrow['description']; echo '<input type=hidden name=SelectedDT value=' . $SelectedDT . '>'; - echo "<input type=hidden name=mrpdemandtype value='" . $_POST['mrpdemandtype'] . "'>"; - echo '<table class=selection><tr><td>' ._('Demand Type') . ':</td><td>' . $_POST['mrpdemandtype'] . '</td></tr>'; + echo "<input type=hidden name=MRPDemandType value='" . $_POST['MRPDemandType'] . "'>"; + echo '<table class=selection><tr><td>' ._('Demand Type') . ':</td><td>' . $_POST['MRPDemandType'] . '</td></tr>'; } else { //end of if $SelectedDT only do the else when a new record is being entered - if (!isset($_POST['mrpdemandtype'])) { - $_POST['mrpdemandtype'] = ''; + if (!isset($_POST['MRPDemandType'])) { + $_POST['MRPDemandType'] = ''; } echo '<table class=selection><tr> <td>' . _('Demand Type') . ":</td> - <td><input type='Text' name='mrpdemandtype' size=6 maxlength=5 value='" . $_POST['mrpdemandtype'] . "'></td> + <td><input type='Text' name='MRPDemandType' size=6 maxlength=5 value='" . $_POST['MRPDemandType'] . "'></td> </tr>" ; } Modified: trunk/MRPDemands.php =================================================================== --- trunk/MRPDemands.php 2011-03-31 09:12:09 UTC (rev 4528) +++ trunk/MRPDemands.php 2011-04-01 09:52:49 UTC (rev 4529) @@ -6,8 +6,6 @@ // to pass values of $db and $StockID to functions. - when just used $db as variable, // got error: Catchable fatal error: Object of class mysqli could not be converted to string -//$PageSecurity=9; - include('includes/session.inc'); $title = _('MRP Demands'); include('includes/header.inc'); @@ -32,11 +30,11 @@ } elseif (isset($_POST['submit'])) { submit($db,$StockID,$DemandID); } elseif (isset($_GET['delete'])) { - delete($db,$DemandID,"",$StockID); + delete($db,$DemandID,'',$StockID); } elseif (isset($_POST['deletesome'])) { - delete($db,"",$_POST['MRPDemandtype'],$StockID); + delete($db,'',$_POST['MRPDemandtype'],$StockID); } elseif (isset($_GET['listall'])) { - listall($db,"",""); + listall($db,'',''); } elseif (isset($_POST['listsome'])) { listall($db,$StockID,$_POST['MRPDemandtype']); } else { @@ -85,12 +83,12 @@ // If the SELECT found records, display them if (DB_num_rows($result) > 0) { - 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 cellpadding=2 colspan=7 class=selection>'; $TableHeader = '<tr><th>' . _('Code') . '</th> - <th>' . _('Description') . '</th> - </tr>'; + <th>' . _('Description') . '</th> + </tr>'; echo $TableHeader; $j = 1; @@ -149,7 +147,7 @@ prnMsg(_('Invalid due date'),'error'); } $sql = "SELECT * FROM mrpdemandtypes - WHERE mrpdemandtype='" . $_POST['MRPDemandtype'] . "'"; + WHERE mrpdemandtype='" . $_POST['MRPDemandtype'] . "'"; $result = DB_query($sql, $db); if (DB_num_rows($result) == 0){ @@ -159,7 +157,7 @@ // Check if valid part number - Had done a Select Count(*), but that returned a 1 in DB_num_rows // even if there was no record. $sql = "SELECT * FROM stockmaster - WHERE stockid='" . $StockID . "'"; + WHERE stockid='" . $StockID . "'"; $result = DB_query($sql, $db); if (DB_num_rows($result) == 0){ @@ -236,18 +234,18 @@ // edit/delete or deletes all of a particular demand type if press Delete Demand Type button. $where = " "; if ($demandtype) { - $where = ' WHERE mrpdemandtype =' . "'" . $demandtype . "'"; + $where = " WHERE mrpdemandtype ='" . $demandtype . "'"; } if ($DemandID) { - $where = ' WHERE demandid =' . "'" . $DemandID . "'"; + $where = " WHERE demandid ='" . $DemandID . "'"; } $sql="DELETE FROM mrpdemands $where"; $result = DB_query($sql,$db); if ($DemandID) { - prnMsg(_("The MRP demand record for") ." ". $StockID ." ". _("has been deleted"),'succes'); + prnMsg(_('The MRP demand record for') .' '. $StockID .' '. _('has been deleted'),'succes'); } else { - prnMsg(_("All records for demand type") ." ". $demandtype ." " . _("have been deleted"),'succes'); + prnMsg(_('All records for demand type') .' '. $demandtype .' ' . _('have been deleted'),'succes'); } unset ($DemandID); unset ($StockID); @@ -262,14 +260,14 @@ // Lists some in hit List Selection submit button, and uses part number if it is entered or // demandtype - 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'] . '" />'; $where = " "; if ($demandtype) { - $where = ' WHERE mrpdemandtype =' . "'" . $demandtype . "'"; + $where = " WHERE mrpdemandtype ='" . $demandtype . "'"; } if ($part) { - $where = ' WHERE mrpdemands.stockid =' . "'" . $part . "'"; + $where = " WHERE mrpdemands.stockid ='" . $part . "'"; } // If part is entered, it overrides demandtype $sql = 'SELECT mrpdemands.demandid, @@ -287,27 +285,28 @@ echo "<table class=selection> <tr bgcolor =#800000><th>" . _('Part Number') . "</th> - <th>" . _('Description') . "</th> - <th>" . _('Demand Type') . "</th> - <th>" . _('Quantity') . "</th> - <th>" . _('Due Date') . "</th> - </tr>"; + <th>" . _('Description') . "</th> + <th>" . _('Demand Type') . "</th> + <th>" . _('Quantity') . "</th> + <th>" . _('Due Date') . "</th> + </tr>"; $ctr = 0; while ($myrow = DB_fetch_row($result)) { $displaydate = ConvertSQLDate($myrow[4]); $ctr++; - echo "<tr><td>".$myrow[1]."</td> - <td>".$myrow[5]."</td> - <td>".$myrow[2]."</td> - <td>".$myrow[3]."</td> - <td>".$displaydate."</td> - <td><a href=\"".$_SERVER['PHP_SELF'] . '?' . SID."&DemandID=".$myrow[0]."&StockID=".$myrow[1]."\">" . _('Edit') . "</td> - <td><a href=\"".$_SERVER['PHP_SELF'] . '?' . SID."&DemandID=".$myrow[0]."&StockID=".$myrow[1]."&delete=yes\">" . _('Delete') ."</td> - </tr>"; + echo '<tr><td>' . $myrow[1] . '</td> + <td>' . $myrow[5] . '</td> + <td>' . $myrow[2] . '</td> + <td>' . $myrow[3] . '</td> + <td>' . $displaydate . '</td> + <td><a href="' .$_SERVER['PHP_SELF'] .'DemandID=' . $myrow[0] . '&StockID=' . $myrow[1] . '">' . _('Edit') . '</td> + <td><a href="' . $_SERVER['PHP_SELF'] . 'DemandID=' . $myrow[0] . '&StockID=' . $myrow[1].'&delete=yes">' . _('Delete') .'</td> + </tr>'; } //END WHILE LIST LOOP - echo '<tr><td>' . _('Number of Records') . "</td><td>".$ctr."</td></tr>"; + echo '<tr><td>' . _('Number of Records') . '</td> + <td>' . $ctr . '</td></tr>'; echo '</table>'; echo '</form><br/><br/><br/><br/>'; unset ($StockID); @@ -321,7 +320,7 @@ // Display Seach fields at top and Entry form below that. This function is called the first time // the page is called, and is also invoked at the end of all of the other functions. // echo "<br/>DISPLAY - DemandID = $DemandID<br/>"; - 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($StockID)) { echo'</font><table cellpadding=3 colspan=4 class=selection><tr> @@ -331,7 +330,7 @@ <td><font size=1>' . _('Enter extract of the') . ' <b>' . _('Stock Code') . '</b>:</font></td> <td><input tabindex="2" type="Text" name="StockCode" size="15" maxlength="20"></td> <td><font size=3><b>' . _('OR') . '</b></font></td> - <td><a href="'. $_SERVER['PHP_SELF'] . '?&listall=yes"><font size=3>' . _('List All Demands') .'</font></a></td></tr> + <td><a href="'. $_SERVER['PHP_SELF'] . '?listall=yes"><font size=3>' . _('List All Demands') .'</font></a></td></tr> <tr><td colspan=7><div class="centre"><input tabindex="3" type="submit" name="Search" value="' . _('Search Now') . '"></div></td></tr></table>'; } else { @@ -394,7 +393,7 @@ } else { echo '<option value="'; } - echo $myrow['mrpdemandtype'] . '">' . $myrow['mrpdemandtype'] . ' - ' .$myrow['description']; + echo $myrow['mrpdemandtype'] . '">' . $myrow['mrpdemandtype'] . ' - ' .$myrow['description'] . '</option>'; } //end while loop echo '</select></td></tr>'; Modified: trunk/MRPPlannedPurchaseOrders.php =================================================================== --- trunk/MRPPlannedPurchaseOrders.php 2011-03-31 09:12:09 UTC (rev 4528) +++ trunk/MRPPlannedPurchaseOrders.php 2011-04-01 09:52:49 UTC (rev 4529) @@ -1,13 +1,13 @@ <?php -/* $Revision: 1.5 $ */ + /* $Id$*/ // MRPPlannedPurchaseOrders.php - Report of purchase parts that MRP has determined should have // purchase orders created for them include('includes/session.inc'); -//maybe not ansi sql ?? -$sql='SHOW TABLES WHERE Tables_in_'.$_SESSION['DatabaseName'].'="mrprequirements"'; +//Maybe not ANSI SQL?? +$sql="SHOW TABLES WHERE Tables_in_" . $_SESSION['DatabaseName'] . "='mrprequirements'"; $result=DB_query($sql,$db); if (DB_num_rows($result)==0) { @@ -29,15 +29,15 @@ $line_height=12; $Xpos = $Left_Margin+1; - $wheredate = " "; - $reportdate = " "; + $WhereDate = ' '; + $ReportDate = ' '; if (Is_Date($_POST['cutoffdate'])) { - $formatdate = FormatDateForSQL($_POST['cutoffdate']); - $wheredate = ' AND duedate <= "' . $formatdate . '" '; - $reportdate = _(' Through ') . Format_Date($_POST['cutoffdate']); + $FormatDate = FormatDateForSQL($_POST['cutoffdate']); + $WhereDate = " AND duedate <= '" . $FormatDate . "' "; + $ReportDate = _(' Through ') . Format_Date($_POST['cutoffdate']); } if ($_POST['Consolidation'] == 'None') { - $sql = 'SELECT mrpplannedorders.*, + $sql = "SELECT mrpplannedorders.*, stockmaster.stockid, stockmaster.description, stockmaster.mbflag, @@ -46,11 +46,11 @@ (stockmaster.materialcost + stockmaster.labourcost + stockmaster.overheadcost ) as computedcost FROM mrpplannedorders, stockmaster - WHERE mrpplannedorders.part = stockmaster.stockid ' . "$wheredate" . - ' AND stockmaster.mbflag IN ("B","P") - ORDER BY mrpplannedorders.part,mrpplannedorders.duedate'; + WHERE mrpplannedorders.part = stockmaster.stockid " . $WhereDate . " + AND stockmaster.mbflag IN ('B','P') + ORDER BY mrpplannedorders.part,mrpplannedorders.duedate"; } elseif ($_POST['Consolidation'] == 'Weekly') { - $sql = 'SELECT mrpplannedorders.part, + $sql = "SELECT mrpplannedorders.part, SUM(mrpplannedorders.supplyquantity) as supplyquantity, TRUNCATE(((TO_DAYS(duedate) - TO_DAYS(CURRENT_DATE)) / 7),0) AS weekindex, MIN(mrpplannedorders.duedate) as duedate, @@ -64,8 +64,8 @@ (stockmaster.materialcost + stockmaster.labourcost + stockmaster.overheadcost ) as computedcost FROM mrpplannedorders, stockmaster - WHERE mrpplannedorders.part = stockmaster.stockid ' . "$wheredate" . - ' AND stockmaster.mbflag IN ("B","P") + WHERE mrpplannedorders.part = stockmaster.stockid " . $WhereDate . " + AND stockmaster.mbflag IN ('B','P') GROUP BY mrpplannedorders.part, weekindex, stockmaster.stockid, @@ -77,9 +77,9 @@ stockmaster.labourcost, stockmaster.overheadcost, computedcost - ORDER BY mrpplannedorders.part,weekindex'; + ORDER BY mrpplannedorders.part,weekindex"; } else { // This else consolidates by month - $sql = 'SELECT mrpplannedorders.part, + $sql = "SELECT mrpplannedorders.part, SUM(mrpplannedorders.supplyquantity) as supplyquantity, EXTRACT(YEAR_MONTH from duedate) AS yearmonth, MIN(mrpplannedorders.duedate) as duedate, @@ -93,8 +93,8 @@ (stockmaster.materialcost + stockmaster.labourcost + stockmaster.overheadcost ) as computedcost FROM mrpplannedorders, stockmaster - WHERE mrpplannedorders.part = stockmaster.stockid ' . "$wheredate" . - ' AND stockmaster.mbflag IN ("B","P") + WHERE mrpplannedorders.part = stockmaster.stockid " . $WhereDate . " + AND stockmaster.mbflag IN ('B','P') GROUP BY mrpplannedorders.part, yearmonth, stockmaster.stockid, @@ -106,15 +106,15 @@ stockmaster.labourcost, stockmaster.overheadcost, computedcost - ORDER BY mrpplannedorders.part,yearmonth '; - }; + ORDER BY mrpplannedorders.part,yearmonth "; + } $result = DB_query($sql,$db,'','',false,true); if (DB_error_no($db) !=0) { $title = _('MRP Planned Purchase Orders') . ' - ' . _('Problem Report'); include('includes/header.inc'); prnMsg( _('The MRP planned purchase orders could not be retrieved by the SQL because') . ' ' . DB_error_msg($db),'error'); - echo '<br><a href="' .$rootpath .'/index.php?">' . _('Back to the menu') . '</a>'; + echo '<br><a href="' .$rootpath .'/index.php">' . _('Back to the menu') . '</a>'; if ($debug==1){ echo '<br />' . $sql; } @@ -125,23 +125,23 @@ $title = _('Print MRP Planned Purchase Orders Error'); include('includes/header.inc'); prnMsg(_('There were no items with planned purchase orders'),'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; } PrintHeader($pdf,$YPos,$PageNumber,$Page_Height,$Top_Margin,$Left_Margin, - $Page_Width,$Right_Margin,$_POST['Consolidation'],$reportdate); + $Page_Width,$Right_Margin,$_POST['Consolidation'],$ReportDate); $Total_Shortage=0; $Partctr = 0; $fill = false; $pdf->SetFillColor(224,235,255); // Defines color to make alternating lines highlighted $FontSize=8; - $holdpart = " "; - $holddescription = " "; - $holdmbflag = " "; - $holdcost = " "; + $holdpart = ' '; + $holddescription = ' '; + $holdmbflag = ' '; + $holdcost = ' '; $holddecimalplaces = 0; $totalpartqty = 0; $totalpartcost = 0; @@ -169,7 +169,7 @@ list($lastdate,$lastsupplier,$preferredsupplier) = GetPartInfo($db,$holdpart); $displaydate = $lastdate; if (!Is_Date($lastdate)) { - $displaydate = " "; + $displaydate = ' '; } $YPos -= $line_height; $pdf->addTextWrap(50,$YPos,80,$FontSize,_('Last Purchase Date: '),'left',0,$fill); @@ -215,7 +215,7 @@ if ($YPos < $Bottom_Margin + $line_height){ PrintHeader($pdf,$YPos,$PageNumber,$Page_Height,$Top_Margin,$Left_Margin,$Page_Width, - $Right_Margin,$_POST['Consolidation'],$reportdate); + $Right_Margin,$_POST['Consolidation'],$ReportDate); } } /*end while loop */ @@ -232,7 +232,7 @@ list($lastdate,$lastsupplier,$preferredsupplier) = GetPartInfo($db,$holdpart); $displaydate = $lastdate; if (!Is_Date($lastdate)) { - $displaydate = " "; + $displaydate = ' '; } $YPos -= $line_height; $pdf->addTextWrap(50,$YPos,80,$FontSize,_('Last Purchase Date: '),'left',0,$fill); @@ -246,7 +246,7 @@ if ($YPos < $Bottom_Margin + $line_height){ PrintHeader($pdf,$YPos,$PageNumber,$Page_Height,$Top_Margin,$Left_Margin,$Page_Width, - $Right_Margin,$_POST['Consolidation'],$reportdate); + $Right_Margin,$_POST['Consolidation'],$ReportDate); // include('includes/MRPPlannedPurchaseOrdersPageHeader.inc'); } /*Print out the grand totals */ @@ -266,7 +266,7 @@ echo '<p class="page_title_text"><img src="'.$rootpath.'/css/'.$theme.'/images/inventory.png" title="' . _('Inventory') . '" 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>' . _('Consolidation') . ':</td><td><select name="Consolidation">'; echo '<option selected value="None">' . _('None') . '</option>'; @@ -286,7 +286,7 @@ } /*end of else not PrintPDF */ function PrintHeader(&$pdf,&$YPos,&$PageNumber,$Page_Height,$Top_Margin,$Left_Margin, - $Page_Width,$Right_Margin,$consolidation,$reportdate) { + $Page_Width,$Right_Margin,$consolidation,$ReportDate) { /*PDF page header for MRP Planned Work Orders report */ if ($PageNumber>1){ @@ -301,7 +301,7 @@ $YPos -=$line_height; $pdf->addTextWrap($Left_Margin,$YPos,150,$FontSize,_('MRP Planned Purchase Orders Report')); - $pdf->addTextWrap(190,$YPos,100,$FontSize,$reportdate); + $pdf->addTextWrap(190,$YPos,100,$FontSize,$ReportDate); $pdf->addTextWrap($Page_Width-$Right_Margin-150,$YPos,160,$FontSize,_('Printed') . ': ' . Date($_SESSION['DefaultDateFormat']) . ' ' . _('Page') . ' ' . $PageNumber,'left'); $YPos -= $line_height; @@ -340,32 +340,32 @@ function GetPartInfo(&$db,$part) { // Get last purchase order date and supplier for part, and also preferred supplier // Printed when there is a part break - $sql = 'SELECT orddate as maxdate, + $sql = "SELECT orddate as maxdate, purchorders.orderno FROM purchorders, purchorderdetails WHERE purchorders.orderno = purchorderdetails.orderno - AND purchorderdetails.itemcode = "'.$part .'" - ORDER BY orddate DESC LIMIT 1'; + AND purchorderdetails.itemcode = '" . $part ."' + ORDER BY orddate DESC LIMIT 1"; $result = DB_query($sql,$db); if (DB_num_rows($result)>0) { $myrow = DB_fetch_array($result,$db); - $partinfo[] = ConvertSQLDate($myrow['maxdate']); - $orderno = $myrow['orderno']; - $sql = 'SELECT supplierno - FROM purchorders - WHERE purchorders.orderno = "'.$orderno . '"'; + $PartInfo[] = ConvertSQLDate($myrow['maxdate']); + $OrderNo= $myrow['orderno']; + $sql = "SELECT supplierno + FROM purchorders + WHERE purchorders.orderno = '" .$OrderNo. "'"; $result = DB_query($sql,$db); $myrow = DB_fetch_array($result,$db); - $partinfo[] = $myrow['supplierno']; - $sql = 'SELECT supplierno + $PartInfo[] = $myrow['supplierno']; + $sql = "SELECT supplierno FROM purchdata - WHERE stockid = "' . $part . '" - AND preferred="1"'; + WHERE stockid = '" . $part . "' + AND preferred='1'"; $result = DB_query($sql,$db); $myrow = DB_fetch_array($result,$db); - $partinfo[] = $myrow['supplierno']; - return $partinfo; + $PartInfo[] = $myrow['supplierno']; + return $PartInfo; } else { return array('','',''); } Modified: trunk/MRPPlannedWorkOrders.php =================================================================== --- trunk/MRPPlannedWorkOrders.php 2011-03-31 09:12:09 UTC (rev 4528) +++ trunk/MRPPlannedWorkOrders.php 2011-04-01 09:52:49 UTC (rev 4529) @@ -1,33 +1,34 @@ <?php -/* $Revision: 1.6 $ */ + /* $Id$*/ // MRPPlannedWorkOrders.php - Report of manufactured parts that MRP has determined should have // work orders created for them -//$PageSecurity = 2; + include('includes/session.inc'); -$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) { - $title='MRP error'; + $title=_('MRP error'); include('includes/header.inc'); - echo '<br>'; - prnMsg( _('The MRP calculation must be run before you can run this report').'<br>'. - _('To run the MRP calculation click').' '.'<a href='.$rootpath .'/MRP.php?' . SID .'>'._('here').'</a>', 'error'); + echo '<br />'; + prnMsg( _('The MRP calculation must be run before you can run this report').'<br />'. + _('To run the MRP calculation click').' '.'<a href="' . $rootpath . '/MRP.php">'._('here').'</a>', 'error'); include('includes/footer.inc'); exit; } if ( isset($_POST['PrintPDF']) OR isset($_POST['Review']) ) { - $wheredate = " "; - $reportdate = " "; + $WhereDate = ' '; + $ReportDate = ' '; if (Is_Date($_POST['cutoffdate'])) { - $formatdate = FormatDateForSQL($_POST['cutoffdate']); - $wheredate = ' AND duedate <= "' . $formatdate . '" '; - $reportdate = _(' Through ') . $_POST['cutoffdate']; + $FormatDate = FormatDateForSQL($_POST['cutoffdate']); + $WhereDate = " AND duedate <= '" . $FormatDate . "' "; + $ReportDate = ' ' . _('Through') . ' ' . $_POST['cutoffdate']; } if ($_POST['Consolidation'] == 'None') { - $sql = 'SELECT mrpplannedorders.*, + $sql = "SELECT mrpplannedorders.*, stockmaster.stockid, stockmaster.description, stockmaster.mbflag, @@ -36,11 +37,11 @@ (stockmaster.materialcost + stockmaster.labourcost + stockmaster.overheadcost ) as computedcost FROM mrpplannedorders, stockmaster - WHERE mrpplannedorders.part = stockmaster.stockid ' . "$wheredate" . - ' AND stockmaster.mbflag = "M" - ORDER BY mrpplannedorders.part,mrpplannedorders.duedate'; + WHERE mrpplannedorders.part = stockmaster.stockid " . $WhereDate . " + AND stockmaster.mbflag = 'M' + ORDER BY mrpplannedorders.part,mrpplannedorders.duedate"; } elseif ($_POST['Consolidation'] == 'Weekly') { - $sql = 'SELECT mrpplannedorders.part, + $sql = "SELECT mrpplannedorders.part, SUM(mrpplannedorders.supplyquantity) as supplyquantity, TRUNCATE(((TO_DAYS(duedate) - TO_DAYS(CURRENT_DATE)) / 7),0) AS weekindex, MIN(mrpplannedorders.duedate) as duedate, @@ -54,8 +55,8 @@ (stockmaster.materialcost + stockmaster.labourcost + stockmaster.overheadcost ) as computedcost FROM mrpplannedorders, stockmaster - WHERE mrpplannedorders.part = stockmaster.stockid ' . "$wheredate" . - ' AND stockmaster.mbflag = "M" + WHERE mrpplannedorders.part = stockmaster.stockid " . $WhereDate . " + AND stockmaster.mbflag = 'M' GROUP BY mrpplannedorders.part, weekindex, stockmaster.stockid, @@ -67,10 +68,9 @@ stockmaster.labourcost, stockmaster.overheadcost, computedcost - ORDER BY mrpplannedorders.part,weekindex - '; + ORDER BY mrpplannedorders.part,weekindex"; } else { - $sql = 'SELECT mrpplannedorders.part, + $sql = "SELECT mrpplannedorders.part, SUM(mrpplannedorders.supplyquantity) as supplyquantity, EXTRACT(YEAR_MONTH from duedate) AS yearmonth, MIN(mrpplannedorders.duedate) as duedate, @@ -82,10 +82,10 @@ stockmaster.decimalplaces, stockmaster.actualcost, (stockmaster.materialcost + stockmaster.labourcost + - stockmaster.overheadcost ) as computedcost, + stockmaster.overheadcost ) as computedcost FROM mrpplannedorders, stockmaster - WHERE mrpplannedorders.part = stockmaster.stockid ' . "$wheredate" . - ' AND stockmaster.mbflag = "M" + WHERE mrpplannedorders.part = stockmaster.stockid " . $WhereDate . " + AND stockmaster.mbflag = 'M' GROUP BY mrpplannedorders.part, yearmonth, stockmaster.stockid, @@ -97,17 +97,17 @@ stockmaster.labourcost, stockmaster.overheadcost, computedcost - ORDER BY mrpplannedorders.part,yearmonth '; - }; + ORDER BY mrpplannedorders.part,yearmonth"; + } $result = DB_query($sql,$db,'','',false,true); if (DB_error_no($db) !=0) { $title = _('MRP Planned Work Orders') . ' - ' . _('Problem Report'); include('includes/header.inc'); prnMsg( _('The MRP planned work orders 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; @@ -116,13 +116,11 @@ $title = _('MRP Planned Work Orders'); include('includes/header.inc'); prnMsg(_('There were no items with demand greater than supply'),'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; } - - if (isset($_POST['PrintPDF'])) { // Print planned work orders include('includes/PDFStarter.php'); @@ -136,17 +134,17 @@ $Xpos = $Left_Margin+1; PrintHeader($pdf,$YPos,$PageNumber,$Page_Height,$Top_Margin,$Left_Margin, - $Page_Width,$Right_Margin,$_POST['Consolidation'],$reportdate); + $Page_Width,$Right_Margin,$_POST['Consolidation'],$ReportDate); $Total_EXTcost=0; $Partctr = 0; $fill = false; $pdf->SetFillColor(224,235,255); // Defines color to make alternating lines highlighted $FontSize=8; - $holdpart = " "; - $holddescription = " "; - $holdmbflag = " "; - $holdcost = " "; + $holdpart = ' '; + $holddescription = ' '; + $holdmbflag = ' '; + $holdcost = ' '; $holddecimalplaces = 0; $totalpartqty = 0; $totalpartcost = 0; @@ -207,7 +205,7 @@ if ($YPos < $Bottom_Margin + $line_height){ PrintHeader($pdf,$YPos,$PageNumber,$Page_Height,$Top_Margin,$Left_Margin,$Page_Width, - $Right_Margin,$_POST['Consolidation'],$reportdate); + $Right_Margin,$_POST['Consolidation'],$ReportDate); // include('includes/MRPPlannedWorkOrdersPageHeader.inc'); } @@ -226,7 +224,7 @@ if ($YPos < $Bottom_Margin + $line_height){ PrintHeader($pdf,$YPos,$PageNumber,$Page_Height,$Top_Margin,$Left_Margin,$Page_Width, - $Right_Margin,$_POST['Consolidation'],$reportdate); + $Right_Margin,$_POST['Consolidation'],$ReportDate); // include('includes/MRPPlannedWorkOrdersPageHeader.inc'); } /*Print out the grand totals */ @@ -248,21 +246,21 @@ echo '<p class="page_title_text"><img src="'.$rootpath.'/css/'.$theme.'/images/inventory.png" title="' . _('Inventory') . '" alt="" />' . ' ' . $title . '</p>'; - echo "<form action='MRPConvertWorkOrders.php' method='post'>"; + echo '<form action="MRPConvertWorkOrders.php" method="post">'; echo '<input type="hidden" name="FormID" value="' . $_SESSION['FormID'] . '" />'; - echo "<table class=selection>"; - echo "<tr><th colspan=9><font size=3 color=blue>Consolidation: " . $_POST['Consolidation'] . - " Cutoff Date: " . $_POST['cutoffdate'] . "</font></th></tr>"; - echo "<tr><th></th> - <th>" . _('Code') . "</th> - <th>" . _('Description') . "</th> - <th>" . _('MRP Date') . "</th> - <th>" . _('Due Date') . "</th> - <th>" . _('Quantity') . "</th> - <th>" . _('Unit Cost') . "</th> - <th>" . _('Ext. Cost') . "</th> - <th>" . _('Consolidations') . "</th> - </tr>"; + echo '<table class="selection">'; + echo '<tr><th colspan="9"><font size="3" color="blue">' . _('Consolidation') . ': ' . $_POST['Consolidation'] . + " " . _('Cutoff Date') . ': ' . $_POST['cutoffdate'] . '</font></th></tr>'; + echo '<tr><th></th> + <th>' . _('Code') . '</th> + <th>' . _('Description') . '</th> + <th>' . _('MRP Date') . '</th> + <th>' . _('Due Date') . '</th> + <th>' . _('Quantity') . '</th> + <th>' . _('Unit Cost') . '</th> + <th>' . _('Ext. Cost') . '</th> + <th>' . _('Consolidations') . '</th> + </tr>'; $totalpartqty = 0; $totalpartcost = 0; @@ -315,13 +313,11 @@ number_format($Total_Extcost,2) ); - 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'); } - - } else { /*The option to print PDF was not hit so display form */ $title=_('MRP Planned Work Orders Reporting'); @@ -329,17 +325,20 @@ echo '<p class="page_title_text"><img src="'.$rootpath.'/css/'.$theme.'/images/inventory.png" title="' . _('Inventory') . '" alt="" />' . ' ' . $title . '</p>'; - echo '</br></br><form action=' . $_SERVER['PHP_SELF'] . " method='post'><table class=selection>"; + echo '</br></br><form action="' . $_SERVER['PHP_SELF'] . '" method="post"><table class="selection">'; echo '<input type="hidden" name="FormID" value="' . $_SESSION['FormID'] . '" />'; - echo '<tr><td>' . _('Consolidation') . ":</td><td><select name='Consolidation'>"; - echo "<option selected value='None'>" . _('None'); - echo "<option value='Weekly'>" . _('Weekly'); - echo "<option value='Monthly'>" . _('Monthly'); + + echo '<tr><td>' . _('Consolidation') . ':</td><td><select name="Consolidation">'; + echo '<option selected value="None">' . _('None') . '</option>'; + echo '<option value="Weekly">' . _('Weekly') . '</option>'; + echo '<option value="Monthly">' . _('Monthly') . '</option>'; echo '</select></td></tr>'; - echo '<tr><td>' . _('Print Option') . ":</td><td><select name='Fill'>"; - echo "<option selected value='yes'>" . _('Print With Alternating Highlighted Lines'); - echo "<option value='no'>" . _('Plain Print'); + + echo '<tr><td>' . _('Print Option') . ':</td><td><select name="Fill">'; + echo '<option selected value="yes">' . _('Print With Alternating Highlighted Lines') . '</option>'; + echo '<option value="no">' . _('Plain Print') . '</option>'; echo '</select></td></tr>'; + echo '<tr><td>' . _('Cut Off Date') . ":</td><td><input type ='text' class=date alt='".$_SESSION['DefaultDateFormat'] ."' name='cutoffdate' size='10' value='".date($_SESSION['DefaultDateFormat'])."'></tr>"; echo "</table><p><div class='centre'><input type=submit name='Review' value='" . _('Review') . "'> <input type=submit name='PrintPDF' value='" . _('Print PDF') . "'></div>"; @@ -348,7 +347,7 @@ } /*end of else not PrintPDF */ function PrintHeader(&$pdf,&$YPos,&$PageNumber,$Page_Height,$Top_Margin,$Left_Margin, - $Page_Width,$Right_Margin,$consolidation,$reportdate) { + $Page_Width,$Right_Margin,$consolidation,$ReportDate) { /*PDF page header for MRP Planned Work Orders report */ if ($PageNumber>1){ @@ -363,7 +362,7 @@ $YPos -=$line_height; $pdf->addTextWrap($Left_Margin,$YPos,150,$FontSize,_('MRP Planned Work Orders Report')); - $pdf->addTextWrap(190,$YPos,100,$FontSize,$reportdate); + $pdf->addTextWrap(190,$YPos,100,$FontSize,$ReportDate); $pdf->addTextWrap($Page_Width-$Right_Margin-150,$YPos,160,$FontSize,_('Printed') . ': ' . Date($_SESSION['DefaultDateFormat']) . ' ' . _('Page') . ' ' . $PageNumber,'left'); $YPos -= $line_height; Modified: trunk/MRPReport.php =================================================================== --- trunk/MRPReport.php 2011-03-31 09:12:09 UTC (rev 4528) +++ trunk/MRPReport.php 2011-04-01 09:52:49 UTC (rev 4529) @@ -2,10 +2,8 @@ /* $Id$*/ -/* $Revision: 1.5 $ */ - // MRPReport.php - Shows supply and demand for a part as determined by MRP -//$PageSecurity = 2; + include('includes/session.inc'); if (isset($_POST['Select'])) { @@ -22,7 +20,7 @@ $PageNumber=1; $line_height=10 ; - // Load mrprequirements into $requirements array + // Load mrprequirements into $Requirements array // Use weekindex to assign supplies, requirements, and planned orders to weekly buckets $sql = "SELECT mrprequirements.*, TRUNCATE(((TO_DAYS(daterequired) - TO_DAYS(CURRENT_DATE)) / 7),0) AS weekindex, @@ -38,7 +36,7 @@ $title = _('Print MRP Report Error'); include('includes/header.inc'); prnMsg(_('The MRP calculation must be run before this report will have any output. MRP requires set up of many parameters, including, EOQ, lead times, minimums, bills of materials, demand types, master schedule etc'),'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>'; include('includes/footer.inc'); exit; } @@ -49,65 +47,67 @@ $title = _('Print MRP Report Warning'); include('includes/header.inc'); prnMsg(_('The MRP calculation must be run before this report will have any output. MRP requires set up of many parameters, including, EOQ, lead times, minimums, bills of materials, demand types, master schedule, etc'), 'warn'); - 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; } - $requirements = array(); - $weeklyreq = array(); + $Requirements = array(); + $WeeklyReq = array(); for ($i=0;$i<28;$i++) { - $weeklyreq[$i]=0; + $WeeklyReq[$i]=0; } - $pastduereq = 0; - $futurereq = 0; - $grossreq = 0; + $PastDueReq = 0; + $FutureReq = 0; + $GrossReq = 0; while ($myrow=DB_fetch_array($result)) { - array_push($requirements,$myrow); - $grossreq += $myrow['quantity']; + array_push($Requirements,$myrow); + $GrossReq += $myrow['quantity']; if ($myrow['datediff'] < 0) { - $pastduereq += $myrow['quantity']; + $PastDueReq += $myrow['quantity']; } elseif ($myrow['weekindex'] > 27) { - $futurereq += $myrow['quantity']; + $FutureReq += $myrow['quantity']; } else { - $weeklyreq[$myrow['weekindex']] += $myrow['quantity']; + $WeeklyReq[$myrow['weekindex']] += $myrow['quantity']; } } //end of while loop - // Load mrpsupplies into $supplies array + // Load mrpsupplies into $Supplies array $sql = "SELECT mrpsupplies.*, TRUNCATE(((TO_DAYS(duedate) - TO_DAYS(CURRENT_DATE)) / 7),0) AS weekindex, TO_DAYS(duedate) - TO_DAYS(CURRENT_DATE) AS datediff - FROM mrpsupplies WHERE part = '" . $_POST['Part'] . "' ORDER BY mrpdate"; + FROM mrpsupplies + WHERE part = '" . $_POST['Part'] . "' + ORDER BY mrpdate"; $result = DB_query($sql,$db,'','',false,true); if (DB_error_no($db) !=0) { $errors = 1; $holddb = $db; } - $supplies = array(); - $weeklysup = array(); + $Supplies = array(); + $WeeklySup = array(); for ($i=0;$i<28;$i++) { - $weeklysup[$i]=0; + $WeeklySup[$i]=0; } - $pastduesup = 0; - $futuresup = 0; + $PastDueSup = 0; + $FutureSup = 0; $qoh = 0; // Get quantity on Hand to display - $openord = 0; + $OpenOrd = 0; while ($myrow=DB_fetch_array($result)) { if ($myrow['ordertype'] == 'QOH') { $qoh += $myrow['supplyquantity']; } else { - $openord += $myrow['supplyquantity']; + $OpenOrd += $myrow['supplyquantity']; if ($myrow['datediff'] < 0) { - $pastduesup += $myrow['supplyquantity']; + $PastDueSup += $myrow['supplyquantity']; } elseif ($myrow['weekindex'] > 27) { - $futuresup += $myrow['supplyquantity']; + $FutureSup += $myrow['supplyquantity']; } else { - $weeklysup[$myrow['weekindex']] += $myrow['supplyquantity']; + $WeeklySup[$myrow['weekindex']] += $myrow['supplyquantity']; } } - array_push($supplies,$myrow); + array_push($Supplies,$myrow); } //end of while loop $sql = "SELECT mrpplannedorders.*, @@ -128,7 +128,7 @@ $pastdueplan = 0; $futureplan = 0; while ($myrow=DB_fetch_array($result)) { - array_push($supplies,$myrow); + array_push($Supplies,$myrow); if ($myrow['datediff'] < 0) { $pastdueplan += $myrow['supplyquantity']; } elseif ($myrow['weekindex'] > 27) { @@ -137,9 +137,9 @@ $weeklyplan[$myrow['weekindex']] += $myrow['supplyquantity']; } } //end of while loop - // The following sorts the $supplies array by mrpdate. Have to sort because are loading + // The following sorts the $Supplies array by mrpdate. Have to sort because are loading // mrpsupplies and mrpplannedorders into same array - foreach ($supplies as $key => $row) { + foreach ($Supplies as $key => $row) { $mrpdate[$key] = $row['mrpdate']; } @@ -147,16 +147,16 @@ $title = _('MRP Report') . ' - ' . _('Problem Report'); include('includes/header.inc'); prnMsg( _('The MRP Report could not be retrieved by the SQL because') . ' ' . DB_error_msg($holddb),'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 (count($supplies)) { - array_multisort($mrpdate, SORT_ASC, $supplies); + if (count($Supplies)) { + array_multisort($mrpdate, SORT_ASC, $Supplies); } PrintHeader($pdf,$YPos,$PageNumber,$Page_Height,$Top_Margin,$Left_Margin,$Page_Width, $Right_Margin); @@ -188,14 +188,14 @@ $pdf->addTextWrap(245,$YPos,40,$FontSize,_('Pan Size:'),'right'); $pdf->addTextWrap(285,$YPos,45,$FontSize,number_format($myrow['pansize'],$myrow['decimalplaces']),'right'); $pdf->addTextWrap(360,$YPos,50,$FontSize,_('On Order:'),'right'); - $pdf->addTextWrap(410,$YPos,50,$FontSize,number_format($openord,$myrow['decimalplaces']),'right'); + $pdf->addTextWrap(410,$YPos,50,$FontSize,number_format($OpenOrd,$myrow['decimalplaces']),'right'); $YPos -=$line_height; $pdf->addTextWrap($Left_Margin,$YPos,30,$FontSize,'M/B:',''); $pdf->addTextWrap(70,$YPos,150,$FontSize,$myrow['mbflag'],''); $pdf->addTextWrap(225,$YPos,60,$FontSize,'Shrinkage:','right'); $pdf->addTextWrap(300,$YPos,30,$FontSize,number_format($myrow['shrinkfactor'],$myrow['decimalplaces']),'right'); $pdf->addTextWrap(360,$YPos,50,$FontSize,_('Gross Req:'),'right'); - $pdf->addTextWrap(410,$YPos,50,$FontSize,number_format($grossreq,$myrow['decimalplaces']),'right'); + $pdf->addTextWrap(410,$YPos,50,$FontSize,number_format($GrossReq,$myrow['decimalplaces']),'right'); $YPos -=$line_height; $pdf->addTextWrap(225,$YPos,60,$FontSize,'Lead Time:','right'); $pdf->addTextWrap(300,$YPos,30,$FontSize,$myrow['leadtime'],'right'); @@ -204,13 +204,13 @@ $YPos -= (2*$line_height); // Calculate fields for prjected available weekly buckets - $pastdueavail = ($qoh + $pastduesup + $pastdueplan) - $pastduereq; + $pastdueavail = ($qoh + $PastDueSup + $pastdueplan) - $PastDueReq; $weeklyavail = array(); - $weeklyavail[0] = ($pastdueavail + $weeklysup[0] + $weeklyplan[0]) - $weeklyreq[0]; + $weeklyavail[0] = ($pastdueavail + $WeeklySup[0] + $weeklyplan[0]) - $WeeklyReq[0]; for ($i = 1; $i < 28; $i++) { - $weeklyavail[$i] = ($weeklyavail[$i - 1] + $weeklysup[$i] + $weeklyplan[$i]) - $weeklyreq[$i]; + $weeklyavail[$i] = ($weeklyavail[$i - 1] + $WeeklySup[$i] + $weeklyplan[$i]) - $WeeklyReq[$i]; } - $futureavail = ($weeklyavail[27] + $futuresup + $futureplan) - $futurereq; + $futureavail = ($weeklyavail[27] + $FutureSup + $futureplan) - $FutureReq; // Headers for Weekly Buckets $FontSize =7; @@ -218,39 +218,39 @@ $today = date("$dateformat"); $pdf->addTextWrap($Left_Margin+40,$YPos,45,$FontSize,_('Past Due'),'right'); $pdf->addTextWrap(130,$YPos,45,$FontSize,$today,'right'); - $pdf->addTextWrap(175,$YPos,45,$FontSize,DateAdd($today,"w",1),'right'); - $pdf->addTextWrap(220,$YPos,45,$FontSize,DateAdd($today,"w",2),'right'); - $pdf->addTextWrap(265,$YPos,45,$FontSize,DateAdd($today,"w",3),'right'); - $pdf->addTextWrap(310,$YPos,45,$FontSize,DateAdd($today,"w",4),'right'); - $pdf->addTextWrap(355,$YPos,45,$FontSize,DateAdd($today,"w",5),'right'); - $pdf->addTextWrap(400,$YPos,45,$FontSize,DateAdd($today,"w",6),'right'); - $pdf->addTextWrap(445,$YPos,45,$FontSize,DateAdd($today,"w",7),'right'); - $pdf->addTextWrap(490,$YPos,45,$FontSize,DateAdd($today,"w",8),'right'); + $pdf->addTextWrap(175,$YPos,45,$FontSize,DateAdd($today,'w',1),'right'); + $pdf->addTextWrap(220,$YPos,45,$FontSize,DateAdd($today,'w',2),'right'); + $pdf->addTextWrap(265,$YPos,45,$FontSize,DateAdd($today,'w',3),'right'); + $pdf->addTextWrap(310,$YPos,45,$FontSize,DateAdd($today,'w',4),'right'); + $pdf->addTextWrap(355,$YPos,45,$FontSize,DateAdd($today,'w',5),'right'); + $pdf->addTextWrap(400,$YPos,45,$FontSize,DateAdd($today,'w',6),'right'); + $pdf->addTextWrap(445,$YPos,45,$FontSize,DateAdd($today,'w',7),'right'); + $pdf->addTextWrap(490,$YPos,45,$FontSize,DateAdd($today,'w',8),'right'); $YPos -=$line_height; $pdf->addTextWrap($Left_Margin,$YPos,40,$FontSize,_('Gross Reqts')); - $pdf->addTextWrap($Left_Margin+40,$YPos,45,$FontSize,number_format($pastduereq,0),'right'); - $pdf->addTextWrap(130,$YPos,45,$FontSize,number_format($weeklyreq[0],0),'right'); - $pdf->addTextWrap(175,$YPos,45,$FontSize,number_format($weeklyreq[1],0),'right'); - $pdf->addTextWrap(220,$YPos,45,$FontSize,number_format($weeklyreq[2],0),'right'); - $pdf->addTextWrap(265,$YPos,45,$FontSize,number_format($weeklyreq[3],0),'right'); - $pdf->addTextWrap(310,$YPos,45,$FontSize,number_format($weeklyreq[4],0),'right'); - $pdf->addTextWrap(355,$YPos,45,$FontSize,number_format($weeklyreq[5],0),'right'); - $pdf->addTextWrap(400,$YPos,45,$FontSize,number_format($weeklyreq[6],0),'right'); - $pdf->addTextWrap(445,$YPos,45,$FontSize,number_format($weeklyreq[7],0),'right'); - $pdf->addTextWrap(490,$YPos,45,$FontSize,number_format($weeklyreq[8],0),'right'); + $pdf->addTextWrap($Left_Margin+40,$YPos,45,$FontSize,number_format($PastDueReq,0),'right'); + $pdf->addTextWrap(130,$YPos,45,$FontSize,number_format($WeeklyReq[0],0),'right'); + $pdf->addTextWrap(175,$YPos,45,$FontSize,number_format($WeeklyReq[1],0),'right'); + $pdf->addTextWrap(220,$YPos,45,$FontSize,number_format($WeeklyReq[2],0),'right'); + $pdf->addTextWrap(265,$YPos,45,$FontSize,number_format($WeeklyReq[3],0),'right'); + $pdf->addTextWrap(310,$YPos,45,$FontSize,number_format($WeeklyReq[4],0),'right'); + $pdf->addTextWrap(355,$YPos,45,$FontSize,number_format($WeeklyReq[5],0),'right'); + $pdf->addTextWrap(400,$YPos,45,$FontSize,number_format($WeeklyReq[6],0),'right'); + $pdf->addTextWrap(445,$YPos,45,$FontSize,number_format($WeeklyReq[7],0),'right'); + $pdf->addTextWrap(490,$YPos,45,$FontSize,number_format($WeeklyReq[8],0),'right'); $YPos -=$line_height; $pdf->addTextWrap($Left_Margin,$YPos,40,$FontSize,_('Open Order')); - $pdf->addTextWrap($Left_Margin+40,$YPos,45,$FontSize,number_format($pastduesup,0),'right'); - $pdf->addTextWrap(130,$YPos,45,$FontSize,number_format($weeklysup[0],0),'right'); - $pdf->addTextWrap(175,$YPos,45,$FontSize,number_format($weeklysup[1],0),'right'); - $pdf->addTextWrap(220,$YPos,45,$FontSize,number_format($weeklysup[2],0),'right'); - $pdf->addTextWrap(265,$YPos,45,$FontSize,number_format($weeklysup[3],0),'right'); - $pdf->addTextWrap(310,$YPos,45,$FontSize,number_format($weeklysup[4],0),'right'); - $pdf->addTextWrap(355,$YPos,45,$FontSize,number_format($weeklysup[5],0),'right'); - $pdf->addTextWrap(400,$YPos,45,$FontSize,number_format($weeklysup[6],0),'right'); - $pdf->addTextWrap(445,$YPos,45,$FontSize,number_format($weeklysup[7],0),'right'); - $pdf->addTextWrap(490,$YPos,45,$FontSize,number_format($weeklysup[8],0),'right'); + $pdf->addTextWrap($Left_Margin+40,$YPos,45,$FontSize,number_format($PastDueSup,0),'right'); + $pdf->addTextWrap(130,$YPos,45,$FontSize,number_format($WeeklySup[0],0),'right'); + $pdf->addTextWrap(175,$YPos,45,$FontSize,number_format($WeeklySup[1],0),'right'); + $pdf->addTextWrap(220,$YPos,45,$FontSize,number_format($WeeklySup[2],0),'right'); + $pdf->addTextWrap(265,$YPos,45,$FontSize,number_format($WeeklySup[3],0),'right'); + $pdf->addTextWrap(310,$YPos,45,$FontSize,number_format($WeeklySup[4],0),'right'); + $pdf->addTextWrap(355,$YPos,45,$FontSize,number_format($WeeklySup[5],0),'right'); + $pdf->addTextWrap(400,$YPos,45,$FontSize,number_format($WeeklySup[6],0),'right'); + $pdf->addTextWrap(445,$YPos,45,$FontSize,number_format($WeeklySup[7],0),'right'); + $pdf->addTextWrap(490,$YPos,45,$FontSize,number_format($WeeklySup[8],0),'right'); $YPos -=$line_height; $pdf->addTextWrap($Left_Margin,$YPos,40,$FontSize,_('Planned')); $pdf->addTextWrap($Left_Margin+40,$YPos,45,$FontSize,number_format($pastdueplan,0),'right'); @@ -278,41 +278,41 @@ $YPos -= 2 * $line_height; // Second Group of Weeks - $pdf->addTextWrap($Left_Margin+40,$YPos,45,$FontSize,DateAdd($today,"w",9),'right'); - $pdf->addTextWrap(130,$YPos,45,$FontSize,DateAdd($today,"w",10),'right'); - $pdf->addTextWrap(175,$YPos,45,$FontSize,DateAdd($today,"w",11),'right'); - $pdf->addTextWrap(220,$YPos,45,$FontSize,DateAdd($today,"w",12),'right'); - $pdf->addTextWrap(265,$YP... [truncated message content] |
From: <dai...@us...> - 2011-04-01 20:14:21
|
Revision: 4532 http://web-erp.svn.sourceforge.net/web-erp/?rev=4532&view=rev Author: daintree Date: 2011-04-01 20:14:14 +0000 (Fri, 01 Apr 2011) Log Message: ----------- More SQL quoting and xhtml fixes Modified Paths: -------------- trunk/MRPShortages.php trunk/OffersReceived.php trunk/PDFBankingSummary.php trunk/PDFCustomerList.php trunk/PageSecurity.php trunk/Payments.php trunk/PcExpenses.php trunk/PcTabs.php Modified: trunk/MRPShortages.php =================================================================== --- trunk/MRPShortages.php 2011-04-01 19:34:44 UTC (rev 4531) +++ trunk/MRPShortages.php 2011-04-01 20:14:14 UTC (rev 4532) @@ -6,13 +6,13 @@ 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) { $title=_('MRP error'); include('includes/header.inc'); - echo '<br>'; + echo '<br />'; prnMsg( _('The MRP calculation must be run before you can run this report').'<br />'. _('To run the MRP calculation click').' '.'<a href="'.$rootpath .'/MRP.php">'._('here').'</a>', 'error'); include('includes/footer.inc'); @@ -159,7 +159,7 @@ prnMsg( _('No MRP shortages retrieved'), 'warn'); 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; @@ -225,8 +225,8 @@ $DisplayTotalVal = number_format($Total_Shortage,2); $pdf->addTextWrap(510,$YPos,60,$FontSize,$DisplayTotalVal, 'right'); - $pdf->OutputD($_SESSION['DatabaseName'] . '_MRPShortages_' . date('Y-m-d').'.pdf');//UldisN - $pdf->__destruct(); //UldisN + $pdf->OutputD($_SESSION['DatabaseName'] . '_MRPShortages_' . date('Y-m-d').'.pdf'); + $pdf->__destruct(); } else { /*The option to print PDF was not hit so display form */ $title=_('MRP Shortages Reporting'); @@ -256,7 +256,7 @@ echo "<option selected value='yes'>" . _('Print With Alternating Highlighted Lines').'</option>'; echo "<option value='no'>" . _('Plain Print').'</option>'; echo '</select></td></tr>'; - echo "</table><br><div class='centre'><input type=submit name='PrintPDF' value='" . _('Print PDF') . "'></div>"; + echo "</table><br /><div class='centre'><input type=submit name='PrintPDF' value='" . _('Print PDF') . "'></div>"; include('includes/footer.inc'); Modified: trunk/OffersReceived.php =================================================================== --- trunk/OffersReceived.php 2011-04-01 19:34:44 UTC (rev 4531) +++ trunk/OffersReceived.php 2011-04-01 20:14:14 UTC (rev 4532) @@ -1,6 +1,6 @@ <?php -//$PageSecurity = 4; +/*$Id: OffersReceived.php 4500 2011-02-27 09:18:42Z daintree $ */ include('includes/session.inc'); $title = _('Supplier Offers'); @@ -40,7 +40,7 @@ } else { echo '<p class="page_title_text"><img src="'.$rootpath.'/css/'.$theme.'/images/supplier.png" title="' . _('Select Supplier') . '" alt="" />' . ' ' . _('Select Supplier') . '</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>'; echo '<tr><td>'._('Select Supplier').'</td>'; @@ -81,7 +81,7 @@ ORDER BY offerid"; $result=DB_query($sql, $db); - 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 '<p class="page_title_text"><img src="'.$rootpath.'/css/'.$theme.'/images/supplier.png" title="' . @@ -153,7 +153,7 @@ $_SESSION['CompanyRecord']['coyname']."\n"; $MailText.=_('The following offers you made have been accepted')."\n"; $MailText.=_('An official order will be sent to you in due course')."\n\n"; - $sql='SELECT rate FROM currencies where currabrev="'.$CurrCode.'"'; + $sql="SELECT rate FROM currencies where currabrev='" . $CurrCode ."'"; $result=DB_query($sql, $db); $myrow=DB_fetch_array($result); $Rate=$myrow['rate']; @@ -226,7 +226,7 @@ $result = $mail->send(array($Email), 'smtp'); prnMsg(_('The accepted offers from').' '.$SupplierName.' '._('have been converted to purchase orders and an email sent to') .' '.$Email."\n"._('Please review the order contents').' '.'<a href="'.$rootpath . - "/PO_Header.php?" . SID . "&ModifyOrderNumber=" . $OrderNo.'">'._('here').'</a>"', 'success'); + "/PO_Header.php?ModifyOrderNumber=" . $OrderNo.'">'._('here').'</a>"', 'success'); } if (sizeOf($rejects)>0){ $MailText=_('This email has been automatically generated by the webERP installation at').' '. Modified: trunk/PDFBankingSummary.php =================================================================== --- trunk/PDFBankingSummary.php 2011-04-01 19:34:44 UTC (rev 4531) +++ trunk/PDFBankingSummary.php 2011-04-01 20:14:14 UTC (rev 4532) @@ -2,9 +2,6 @@ /* $Id$*/ -/* $Revision: 1.14 $ */ - -//$PageSecurity = 3; include ('includes/session.inc'); include('includes/SQL_CommonFunctions.inc'); @@ -27,35 +24,35 @@ ORDER BY transno DESC'; $result=DB_query($sql, $db); - echo "<form method='post' action=" . $_SERVER['PHP_SELF'] . '><table class=selection>'; + echo '<form method="post" action="' . $_SERVER['PHP_SELF'] . '"><table class=selection>'; echo '<input type="hidden" name="FormID" value="' . $_SESSION['FormID'] . '" />'; echo '<tr><td>' . _('Select the batch number of receipts to be printed') . ':</td>'; - echo '<td><select name=BatchNo>'; + echo '<td><select name="BatchNo">'; while ($myrow=DB_fetch_array($result)) { echo '<option value="'.$myrow['transno'].'">'._('Batch') .' '. $myrow['transno'].' - '.ConvertSqlDate($myrow['transdate']).'</option>'; } echo '</select></td></tr></table>'; - echo "<br><div class='centre'><input type=submit name='EnterBatchNo' VALUE='" . _('Create PDF') . "'></div></form>"; + echo '<br /><div class="centre"><input type="submit" name="EnterBatchNo" value="' . _('Create PDF') . '"></div></form>'; include ('includes/footer.inc'); exit; } if (isset($_POST['BatchNo']) and $_POST['BatchNo']!='') { - $SQL= 'SELECT bankaccountname, - bankaccountnumber, - ref, - transdate, - banktranstype, - bankact, - banktrans.exrate, - banktrans.functionalexrate, - banktrans.currcode - FROM bankaccounts, - banktrans - WHERE bankaccounts.accountcode=banktrans.bankact - AND banktrans.transno="' . $_POST['BatchNo'] . '" - AND banktrans.type=12'; + $SQL= "SELECT bankaccountname, + bankaccountnumber, + ref, + transdate, + banktranstype, + bankact, + banktrans.exrate, + banktrans.functionalexrate, + banktrans.currcode + FROM bankaccounts, + banktrans + WHERE bankaccounts.accountcode=banktrans.bankact + AND banktrans.transno='" . $_POST['BatchNo'] . "' + AND banktrans.type=12"; $ErrMsg = _('An error occurred getting the header information about the receipt batch number') . ' ' . $_POST['BatchNo']; $DbgMsg = _('The SQL used to get the receipt header information that failed was'); @@ -65,111 +62,111 @@ $title = _('Create PDF Print-out For A Batch Of Receipts'); include ('includes/header.inc'); prnMsg(_('The receipt batch number') . ' ' . $_POST['BatchNo'] . ' ' . _('was not found in the database') . '. ' . _('Please try again selecting a different batch number'), 'warn'); - include('includes/footer.inc'); - exit; -} -/* OK get the row of receipt batch header info from the BankTrans table */ -$myrow = DB_fetch_array($Result); -$ExRate = $myrow['exrate']; -$FunctionalExRate = $myrow['functionalexrate']; -$Currency = $myrow['currcode']; -$BankTransType = $myrow['banktranstype']; -$BankedDate = $myrow['transdate']; -$BankActName = $myrow['bankaccountname']; -$BankActNumber = $myrow['bankaccountnumber']; -$BankingReference = $myrow['ref']; - - -$SQL = "SELECT debtorsmaster.name, - ovamount, - invtext, - reference - FROM debtorsmaster INNER JOIN debtortrans - ON debtorsmaster.debtorno=debtortrans.debtorno - WHERE debtortrans.transno='" . $_POST['BatchNo'] . "' - AND debtortrans.type=12"; - -$CustRecs=DB_query($SQL,$db,'','',false,false); -if (DB_error_no($db)!=0){ - $title = _('Create PDF Print-out For A Batch Of Receipts'); - include ('includes/header.inc'); - prnMsg(_('An error occurred getting the customer receipts for batch number') . ' ' . $_POST['BatchNo'],'error'); - if ($debug==1){ - prnMsg(_('The SQL used to get the customer receipt information that failed was') . '<br>' . $SQL,'error'); - } - include('includes/footer.inc'); - exit; -} -$SQL = "SELECT narrative, - amount - FROM gltrans - WHERE gltrans.typeno='" . $_POST['BatchNo'] . "' - AND gltrans.type=12 and gltrans.amount <0 - AND gltrans.account !='" . $myrow['bankact'] . "' - AND gltrans.account !='" . $_SESSION['CompanyRecord']['debtorsact'] . "'"; - -$GLRecs=DB_query($SQL,$db,'','',false,false); -if (DB_error_no($db)!=0){ - $title = _('Create PDF Print-out For A Batch Of Receipts'); - include ('includes/header.inc'); - prnMsg(_('An error occurred getting the GL receipts for batch number') . ' ' . $_POST['BatchNo'],'error'); - if ($debug==1){ - prnMsg(_('The SQL used to get the GL receipt information that failed was') . ':<br>' . $SQL,'error'); + include('includes/footer.inc'); + exit; } - include('includes/footer.inc'); - exit; + /* OK get the row of receipt batch header info from the BankTrans table */ + $myrow = DB_fetch_array($Result); + $ExRate = $myrow['exrate']; + $FunctionalExRate = $myrow['functionalexrate']; + $Currency = $myrow['currcode']; + $BankTransType = $myrow['banktranstype']; + $BankedDate = $myrow['transdate']; + $BankActName = $myrow['bankaccountname']; + $BankActNumber = $myrow['bankaccountnumber']; + $BankingReference = $myrow['ref']; + + + $SQL = "SELECT debtorsmaster.name, + ovamount, + invtext, + reference + FROM debtorsmaster INNER JOIN debtortrans + ON debtorsmaster.debtorno=debtortrans.debtorno + WHERE debtortrans.transno='" . $_POST['BatchNo'] . "' + AND debtortrans.type=12"; + + $CustRecs=DB_query($SQL,$db,'','',false,false); + if (DB_error_no($db)!=0){ + $title = _('Create PDF Print-out For A Batch Of Receipts'); + include ('includes/header.inc'); + prnMsg(_('An error occurred getting the customer receipts for batch number') . ' ' . $_POST['BatchNo'],'error'); + if ($debug==1){ + prnMsg(_('The SQL used to get the customer receipt information that failed was') . '<br />' . $SQL,'error'); + } + include('includes/footer.inc'); + exit; + } + $SQL = "SELECT narrative, + amount + FROM gltrans + WHERE gltrans.typeno='" . $_POST['BatchNo'] . "' + AND gltrans.type=12 and gltrans.amount <0 + AND gltrans.account !='" . $myrow['bankact'] . "' + AND gltrans.account !='" . $_SESSION['CompanyRecord']['debtorsact'] . "'"; + + $GLRecs=DB_query($SQL,$db,'','',false,false); + if (DB_error_no($db)!=0){ + $title = _('Create PDF Print-out For A Batch Of Receipts'); + include ('includes/header.inc'); + prnMsg(_('An error occurred getting the GL receipts for batch number') . ' ' . $_POST['BatchNo'],'error'); + if ($debug==1){ + prnMsg(_('The SQL used to get the GL receipt information that failed was') . ':<br />' . $SQL,'error'); + } + 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',_('Banking Summary')); + $pdf->addInfo('Subject',_('Banking Summary Number') . ' ' . $_POST['BatchNo']); + $line_height=12; + $PageNumber = 0; + $TotalBanked = 0; + + include ('includes/PDFBankingSummaryPageHeader.inc'); + + while ($myrow=DB_fetch_array($CustRecs)){ + + $LeftOvers = $pdf->addTextWrap($Left_Margin,$YPos,60,$FontSize,number_format(-$myrow['ovamount'],2), 'right'); + $LeftOvers = $pdf->addTextWrap($Left_Margin+65,$YPos,150,$FontSize,$myrow['name'], 'left'); + $LeftOvers = $pdf->addTextWrap($Left_Margin+215,$YPos,100,$FontSize,$myrow['invtext'], 'left'); + $LeftOvers = $pdf->addTextWrap($Left_Margin+315,$YPos,100,$FontSize,$myrow['reference'], 'left'); + + $YPos -= ($line_height); + $TotalBanked -= $myrow['ovamount']; + + if ($YPos - (2 *$line_height) < $Bottom_Margin){ + /*Then set up a new page */ + include ('includes/PDFBankingSummaryPageHeader.inc'); + } /*end of new page header */ + } /* end of while there are customer receipts in the batch to print */ + + /* Right now print out the GL receipt entries in the batch */ + while ($myrow=DB_fetch_array($GLRecs)){ + + $LeftOvers = $pdf->addTextWrap($Left_Margin,$YPos,60,$FontSize,number_format((-$myrow['amount']*$ExRate*$FunctionalExRate),2), 'right'); + $LeftOvers = $pdf->addTextWrap($Left_Margin+65,$YPos,300,$FontSize,$myrow['narrative'], 'left'); + $YPos -= ($line_height); + $TotalBanked += (-$myrow['amount']*$ExRate); + + if ($YPos - (2 *$line_height) < $Bottom_Margin){ + /*Then set up a new page */ + include ('includes/PDFBankingSummaryPageHeader.inc'); + } /*end of new page header */ + } /* end of while there are GL receipts in the batch to print */ + + + $YPos-=$line_height; + $LeftOvers = $pdf->addTextWrap($Left_Margin,$YPos,60,$FontSize,number_format($TotalBanked,2), 'right'); + $LeftOvers = $pdf->addTextWrap($Left_Margin+65,$YPos,300,$FontSize,_('TOTAL') . ' ' . $Currency . ' ' . _('BANKED'), 'left'); + + $pdf->OutputD($_SESSION['DatabaseName'] . '_BankingSummary_' . date('Y-m-d').'.pdf');//UldisN + $pdf->__destruct(); } - -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',_('Banking Summary')); -$pdf->addInfo('Subject',_('Banking Summary Number') . ' ' . $_POST['BatchNo']); -$line_height=12; -$PageNumber = 0; -$TotalBanked = 0; - -include ('includes/PDFBankingSummaryPageHeader.inc'); - -while ($myrow=DB_fetch_array($CustRecs)){ - - $LeftOvers = $pdf->addTextWrap($Left_Margin,$YPos,60,$FontSize,number_format(-$myrow['ovamount'],2), 'right'); - $LeftOvers = $pdf->addTextWrap($Left_Margin+65,$YPos,150,$FontSize,$myrow['name'], 'left'); - $LeftOvers = $pdf->addTextWrap($Left_Margin+215,$YPos,100,$FontSize,$myrow['invtext'], 'left'); - $LeftOvers = $pdf->addTextWrap($Left_Margin+315,$YPos,100,$FontSize,$myrow['reference'], 'left'); - - $YPos -= ($line_height); - $TotalBanked -= $myrow['ovamount']; - - if ($YPos - (2 *$line_height) < $Bottom_Margin){ - /*Then set up a new page */ - include ('includes/PDFBankingSummaryPageHeader.inc'); - } /*end of new page header */ -} /* end of while there are customer receipts in the batch to print */ - -/* Right now print out the GL receipt entries in the batch */ -while ($myrow=DB_fetch_array($GLRecs)){ - - $LeftOvers = $pdf->addTextWrap($Left_Margin,$YPos,60,$FontSize,number_format((-$myrow['amount']*$ExRate*$FunctionalExRate),2), 'right'); - $LeftOvers = $pdf->addTextWrap($Left_Margin+65,$YPos,300,$FontSize,$myrow['narrative'], 'left'); - $YPos -= ($line_height); - $TotalBanked += (-$myrow['amount']*$ExRate); - - if ($YPos - (2 *$line_height) < $Bottom_Margin){ - /*Then set up a new page */ - include ('includes/PDFBankingSummaryPageHeader.inc'); - } /*end of new page header */ -} /* end of while there are GL receipts in the batch to print */ - - -$YPos-=$line_height; -$LeftOvers = $pdf->addTextWrap($Left_Margin,$YPos,60,$FontSize,number_format($TotalBanked,2), 'right'); -$LeftOvers = $pdf->addTextWrap($Left_Margin+65,$YPos,300,$FontSize,_('TOTAL') . ' ' . $Currency . ' ' . _('BANKED'), 'left'); - -$pdf->OutputD($_SESSION['DatabaseName'] . '_BankingSummary_' . date('Y-m-d').'.pdf');//UldisN -$pdf->__destruct(); //UldisN -} - ?> \ No newline at end of file Modified: trunk/PDFCustomerList.php =================================================================== --- trunk/PDFCustomerList.php 2011-04-01 19:34:44 UTC (rev 4531) +++ trunk/PDFCustomerList.php 2011-04-01 20:14:14 UTC (rev 4532) @@ -1,9 +1,7 @@ <?php -/* $Revision: 1.13 $ */ /* $Id$*/ -//$PageSecurity = 2; include('includes/session.inc'); if (isset($_POST['PrintPDF'])){ @@ -359,8 +357,8 @@ } /*end if $PrintThisCustomer == true */ } /*end while loop */ - $pdf->OutputD($_SESSION['DatabaseName'] . '_CustomerList_' . date('Y-m-d').'.pdf');//UldisN - $pdf->__destruct(); //UldisN + $pdf->OutputD($_SESSION['DatabaseName'] . '_CustomerList_' . date('Y-m-d').'.pdf');//UldisN + $pdf->__destruct(); exit; } else { @@ -377,10 +375,10 @@ $sql='SELECT areacode, areadescription FROM areas'; $AreasResult= DB_query($sql,$db); - echo '<option selected value="All">' . _('All Areas'); + echo '<option selected value="All">' . _('All Areas') . '</option>'; While ($myrow = DB_fetch_array($AreasResult)){ - echo '<option value="' . $myrow['areacode'] . '">' . $myrow['areadescription']; + echo '<option value="' . $myrow['areacode'] . '">' . $myrow['areadescription'] . '</option>'; } echo '</select></td></tr>'; @@ -398,16 +396,16 @@ echo '<tr><td>' . _('Level Of Activity'). ':</td><td><select name="Activity">'; - echo '<option selected value="All">'. _('All customers'); - echo '<option value="GreaterThan">'. _('Sales Greater Than'); - echo '<option value="LessThan">'. _('Sales Less Than'); + echo '<option selected value="All">'. _('All customers') . '</option>'; + echo '<option value="GreaterThan">'. _('Sales Greater Than') . '</option>'; + echo '<option value="LessThan">'. _('Sales Less Than') . '</option>'; echo '</select></td><td>'; echo '<input type="text" class=number name="ActivityAmount" size=8 maxlength=8 value=0></td></tr>'; $DefaultActivitySince = Date($_SESSION['DefaultDateFormat'], Mktime(0,0,0,Date('m')-6,0,Date('y'))); - echo '<tr><td>' . _('Activity Since'). ':</td><td><input type="text" class=date alt="'.$_SESSION['DefaultDateFormat'].'" name="ActivitySince" size=10 maxlength=10 - VALUE="' . $DefaultActivitySince . '"></td></tr>'; + echo '<tr><td>' . _('Activity Since'). ':</td> + <td><input type="text" class=date alt="'.$_SESSION['DefaultDateFormat'].'" name="ActivitySince" size=10 maxlength=10 value="' . $DefaultActivitySince . '"></td></tr>'; echo '</table><br><div class="centre"><input type=Submit Name="PrintPDF" Value="'. _('Print PDF'). '"></div>'; Modified: trunk/PageSecurity.php =================================================================== --- trunk/PageSecurity.php 2011-04-01 19:34:44 UTC (rev 4531) +++ trunk/PageSecurity.php 2011-04-01 20:14:14 UTC (rev 4532) @@ -1,5 +1,7 @@ <?php +/*$Id: PageSecurity.php 4500 2011-02-27 09:18:42Z daintree $ */ + include('includes/session.inc'); $title = _('Page Security Levels'); @@ -19,20 +21,20 @@ } $sql='SELECT script, - pagesecurity, - description - FROM scripts'; + pagesecurity, + description + FROM scripts'; $result=DB_query($sql, $db); -echo '<br /><form method="post" id="PageSecurity" action="' . $_SERVER['PHP_SELF'] . '?' . SID . '">'; +echo '<br /><form method="post" id="PageSecurity" action="' . $_SERVER['PHP_SELF'] . '">'; echo '<input type="hidden" name="FormID" value="' . $_SESSION['FormID'] . '" />'; echo '<table class="selection">'; -$TokenSql="SELECT tokenid, +$TokenSql='SELECT tokenid, tokenname - FROM securitytokens"; + FROM securitytokens'; $TokenResult=DB_query($TokenSql, $db); while ($myrow=DB_fetch_array($result)) { Modified: trunk/Payments.php =================================================================== --- trunk/Payments.php 2011-04-01 19:34:44 UTC (rev 4531) +++ trunk/Payments.php 2011-04-01 20:14:14 UTC (rev 4532) @@ -1,10 +1,7 @@ <?php /* $Id$*/ -/* $Revision: 1.39 $ */ -//$PageSecurity = 5; - include('includes/DefinePaymentClass.php'); include('includes/session.inc'); @@ -30,7 +27,9 @@ $_SESSION['PaymentDetail']->GLItemCounter = 1; } -if ((isset($_POST['UpdateHeader']) and $_POST['BankAccount']=='') or (isset($_POST['Process']) and $_POST['BankAccount']=='')) { +if ((isset($_POST['UpdateHeader']) + AND $_POST['BankAccount']=='') + OR (isset($_POST['Process']) AND $_POST['BankAccount']=='')) { prnMsg(_('A bank account must be selected to make this payment from'), 'warn'); $BankAccountEmpty=TRUE; } else { @@ -38,11 +37,11 @@ } //note this is already linked from this page -//echo "<a href='" . $rootpath . '/SelectSupplier.php?' . SID . "'>" . _('Back to Suppliers') . '</a><br>'; +//echo "<a href='" . $rootpath . '/SelectSupplier.php?' . SID . "'>" . _('Back to Suppliers') . '</a><br />'; echo '<p class="page_title_text"><img src="'.$rootpath.'/css/'.$theme.'/images/transactions.png" title="' . _('Payment Entry') . '" alt="" />' . ' ' . _('Payment Entry') . '</p>'; -echo '<div class="page_help_text">' . _('Use this screen to enter payments FROM your bank account. <br>Note: To enter a payment FROM a supplier, first select the Supplier, click Enter a Payment to, or Receipt from the Supplier, and use a negative Payment amount on this form.') . '</div><br><div class="centre">'; +echo '<div class="page_help_text">' . _('Use this screen to enter payments FROM your bank account. <br />Note: To enter a payment FROM a supplier, first select the Supplier, click Enter a Payment to, or Receipt from the Supplier, and use a negative Payment amount on this form.') . '</div><br /><div class="centre">'; if (isset($_GET['SupplierID'])){ /*The page was called with a supplierID check it is valid and default the inputs for Supplier Name and currency of payment */ @@ -113,7 +112,7 @@ $_SESSION['PaymentDetail']->Account=$_POST['BankAccount']; /*Get the bank account currency and set that too */ $ErrMsg = _('Could not get the currency of the bank account'); - $result = DB_query('SELECT currcode FROM bankaccounts WHERE accountcode =' . $_POST['BankAccount'],$db,$ErrMsg); + $result = DB_query("SELECT currcode FROM bankaccounts WHERE accountcode ='" . $_POST['BankAccount'] . "'",$db,$ErrMsg); $myrow = DB_fetch_row($result); $_SESSION['PaymentDetail']->AccountCurrency=$myrow[0]; @@ -168,7 +167,7 @@ $SuggestedFunctionalExRate = $myrow[0]; /*Get the exchange rate between the functional currency and the payment currency*/ - $result = DB_query("select rate FROM currencies WHERE currabrev='" . $_SESSION['PaymentDetail']->Currency . "'",$db); + $result = DB_query("SELECT rate FROM currencies WHERE currabrev='" . $_SESSION['PaymentDetail']->Currency . "'",$db); $myrow = DB_fetch_row($result); $tableExRate = $myrow[0]; //this is the rate of exchange between the functional currency and the payment currency /*Calculate cross rate to suggest appropriate exchange rate between payment currency and account currency */ @@ -235,7 +234,7 @@ $SQL = 'SELECT bankaccounts.accountcode FROM bankaccounts, chartmaster - WHERE bankaccounts.accountcode=chartmaster.accountcode'; + WHERE bankaccounts.accountcode=chartmaster.accountcode'; $result = DB_query($SQL,$db); $BankAccounts = array(); $i=0; @@ -254,11 +253,11 @@ AND ($_SESSION['PaymentDetail']->Paymenttype == 'Cheque')) { // 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>'; + echo '<br /><a href="' . $rootpath . '/PrintCheque.php?' . SID . '&ChequeNum=' . $_POST['ChequeNum'] . '">' . _('Print Cheque using pre-printed stationery') . '</a><br /><br />'; echo '<form method=post action="' . $_SERVER['PHP_SELF'] . '">'; echo '<input type="hidden" name="FormID" value="' . $_SESSION['FormID'] . '" />'; - echo _('Has the cheque been printed') . '?<br><br>'; + echo _('Has the cheque been printed') . '?<br /><br />'; echo '<input type="hidden" name="CommitBatch" value="' . $_POST['CommitBatch'] . '">'; echo '<input type="hidden" name="BankAccount" value="' . $_POST['BankAccount'] . '">'; echo '<input type="submit" name="ChequePrinted" value="' . _('Yes / Continue') . '"> '; @@ -593,10 +592,10 @@ $sql="SELECT suppname FROM suppliers WHERE supplierid='".$lastSupplier."'"; $result=DB_query($sql, $db); $myrow=DB_fetch_array($result); - echo '<br><a href="' . $rootpath . '/Payments.php?SupplierID=' . $lastSupplier . '">' . + echo '<br /><a href="' . $rootpath . '/Payments.php?SupplierID=' . $lastSupplier . '">' . _('Enter another Payment for') . ' ' . $myrow['suppname'] . '</a>'; } else { - echo '<br><a href="' . $_SERVER['PHP_SELF'] . '?' . SID . '">' . _('Enter another General Ledger Payment') . '</a><br>'; + echo '<br /><a href="' . $_SERVER['PHP_SELF'] . '?' . SID . '">' . _('Enter another General Ledger Payment') . '</a><br />'; } } @@ -853,13 +852,13 @@ echo '<tr><td colspan=3><div class="centre"><input type="submit" name="UpdateHeader" value="' . _('Update'). '"></td></tr>'; -echo '</table><br>'; +echo '</table><br />'; if ($_SESSION['CompanyRecord']['gllink_creditors']==1 AND $_SESSION['PaymentDetail']->SupplierID==''){ /* Set upthe form for the transaction entry for a GL Payment Analysis item */ - echo '<br><table class=selection>'; + echo '<br /><table class=selection>'; echo '<tr><th colspan=2><font size=3 color=blue>' . _('General Ledger Payment Analysis Entry') . '</font></th></tr>'; //Select the tag @@ -928,11 +927,11 @@ echo '<tr><td>' . _('Amount') . ' (' . $_SESSION['PaymentDetail']->Currency . '):</td><td><input type=Text Name="GLAmount" Maxlength=12 size=12 class=number></td></tr>'; } - echo '</table><br>'; + echo '</table><br />'; echo '<div class="centre"><input type=submit name="Process" value="' . _('Accept') . '"><input type=submit name="Cancel" value="' . _('Cancel') . '"></div>'; if (sizeOf($_SESSION['PaymentDetail']->GLItems)>0) { - echo '<br><table class=selection><tr> + echo '<br /><table class=selection><tr> <th>' . _('Cheque No').'</th> <th>' . _('Amount') . ' (' . $_SESSION['PaymentDetail']->Currency . ')</th> <th>' . _('GL Account') . '</th> @@ -942,25 +941,25 @@ $PaymentTotal = 0; foreach ($_SESSION['PaymentDetail']->GLItems as $PaymentItem) { - $tagsql='SELECT tagdescription from tags where tagref='.$PaymentItem->tag; - $tagresult=DB_query($tagsql, $db); - $tagmyrow=DB_fetch_row($tagresult); + $tagsql="SELECT tagdescription from tags where tagref='" . $PaymentItem->tag . "'"; + $TagResult=DB_query($tagsql, $db); + $TagMyrow=DB_fetch_row($TagResult); if ($PaymentItem->tag==0) { - $tagname='None'; + $TagName='None'; } else { - $tagname=$tagmyrow[0]; + $TagName=$TagMyrow[0]; } echo '<tr> <td align=left>' . $PaymentItem->cheque . '</td> <td class=number>' . number_format($PaymentItem->Amount,2) . '</td> <td>' . $PaymentItem->GLCode . ' - ' . $PaymentItem->GLActName . '</td> <td>' . stripslashes($PaymentItem->Narrative) . '</td> - <td>' . $PaymentItem->tag . ' - ' . $tagname . '</td> + <td>' . $PaymentItem->tag . ' - ' . $TagName . '</td> <td><a href="' . $_SERVER['PHP_SELF'] . '?' . SID . '&Delete=' . $PaymentItem->ID . '">' . _('Delete') . '</a></td> </tr>'; $PaymentTotal += $PaymentItem->Amount; } - echo '<tr><td></td><td class=number><b>' . number_format($PaymentTotal,2) . '</b></td><td></td><td></td><td></td></tr></table><br>'; + echo '<tr><td></td><td class=number><b>' . number_format($PaymentTotal,2) . '</b></td><td></td><td></td><td></td></tr></table><br />'; echo '<input type=submit name="CommitBatch" value="' . _('Accept and Process Payment') . '">'; } @@ -978,7 +977,7 @@ } else { echo '<input type="hidden" name="discount" Value=0>'; } - echo '</table><br>'; + echo '</table><br />'; echo '<input type=submit name="CommitBatch" value="' . _('Accept and Process Payment') . '">'; } echo '</form>'; Modified: trunk/PcExpenses.php =================================================================== --- trunk/PcExpenses.php 2011-04-01 19:34:44 UTC (rev 4531) +++ trunk/PcExpenses.php 2011-04-01 20:14:14 UTC (rev 4532) @@ -1,7 +1,6 @@ <?php -/* $Revision: 1.0$ */ -//$PageSecurity = 15; +/* $Id$*/ include('includes/session.inc'); $title = _('Maintenance Of Petty Cash Of Expenses'); @@ -95,7 +94,7 @@ $msg = _('Expense ') . ' ' . $_POST['codeexpense'] . ' ' . _('has been created'); $checkSql = "SELECT count(codeexpense) - FROM pcexpenses"; + FROM pcexpenses"; $result = DB_query($checkSql, $db); $row = DB_fetch_row($result); @@ -154,12 +153,12 @@ $result = DB_query($sql,$db); echo '<table class=selection>'; - echo "<tr> - <th>" . _('Code Of Expense') . "</th> - <th>" . _('Description') . "</th> - <th>" . _('Account Code') . "</th> - <th>" . _('Account Description') . "</th> - </tr>"; + echo '<tr> + <th>' . _('Code Of Expense') . '</th> + <th>' . _('Description') . '</th> + <th>' . _('Account Code') . '</th> + <th>' . _('Account Description') . '</th> + </tr>'; $k=0; //row colour counter @@ -190,8 +189,8 @@ $myrow[1], $myrow[2], $Description[0], - $_SERVER['PHP_SELF'] . '?' . SID, $myrow[0], - $_SERVER['PHP_SELF'] . '?' . SID, $myrow[0]); + $_SERVER['PHP_SELF'] . '?', $myrow[0], + $_SERVER['PHP_SELF'] . '?', $myrow[0]); } //END WHILE LIST LOOP echo '</table>'; @@ -200,11 +199,11 @@ //end of ifs and buts! if (isset($SelectedExpense)) { - echo '<p><div class="centre"><a href="' . $_SERVER['PHP_SELF'] . '?' . SID . '">' . _('Show All Petty Cash Expenses Defined') . '</a></div><p>'; + echo '<p><div class="centre"><a href="' . $_SERVER['PHP_SELF'] . '">' . _('Show All Petty Cash Expenses Defined') . '</a></div><p>'; } 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'] . '" />'; echo '<p><table class=selection>'; //Main table @@ -216,7 +215,7 @@ description, glaccount FROM pcexpenses - WHERE codeexpense='$SelectedExpense'"; + WHERE codeexpense='" . $SelectedExpense . "'"; $result = DB_query($sql, $db); $myrow = DB_fetch_array($result); @@ -225,9 +224,9 @@ $_POST['description'] = $myrow['description']; $_POST['glaccount'] = $myrow['glaccount']; - echo "<input type=hidden name='SelectedExpense' VALUE=" . $SelectedExpense . ">"; - echo "<input type=hidden name='codeexpense' VALUE=" . $_POST['codeexpense']. ">"; - echo "<table class=selection> <tr><td>" . _('Code Of Expense') . ":</td><td>"; + echo '<input type=hidden name="SelectedExpense" value="' . $SelectedExpense . '">'; + echo '<input type=hidden name="codeexpense" VALUE="' . $_POST['codeexpense']. '">'; + echo '<table class="selection"> <tr><td>' . _('Code Of Expense') . ':</td><td>'; // We dont allow the user to change an existing type code @@ -237,32 +236,33 @@ // This is a new type so the user may volunteer a type code - echo "<table class=selection><tr><td>" . _('Code Of Expense') . ":</td><td><input type='Text' - " . (in_array('SalesType',$Errors) ? 'class="inputerror"' : '' ) ." name='codeexpense'></td></tr>"; + echo '<table class=selection> + <tr><td>' . _('Code Of Expense') . ':</td> + <td><input type="Text"' . (in_array('SalesType',$Errors) ? 'class="inputerror"' : '' ) .' name="codeexpense"></td></tr>'; } if (!isset($_POST['description'])) { $_POST['description']=''; } - echo "<tr><td>" . _('Description') . ":</td><td><input type='Text' name='description' size=50 maxlength=49 value='" . $_POST['description'] . "'></td></tr>"; + echo '<tr><td>' . _('Description') . ':</td><td><input type="Text" name="description" size=50 maxlength=49 value="' . $_POST['description'] . '"></td></tr>'; - echo '<tr><td>' . _('Account Code') . ":</td><td><select name='glaccount'>"; + echo '<tr><td>' . _('Account Code') . ':</td><td><select name="glaccount">'; DB_free_result($result); - $SQL = "SELECT accountcode, + $SQL = 'SELECT accountcode, accountname FROM chartmaster - ORDER BY accountcode"; + ORDER BY accountcode'; $result = DB_query($SQL,$db); while ($myrow = DB_fetch_array($result)) { if (isset($_POST['glaccount']) and $myrow['accountcode']==$_POST['glaccount']) { - echo "<option selected VALUE='"; + echo '<option selected VALUE="'; } else { - echo "<option VALUE='"; + echo '<option VALUE="'; } - echo $myrow['accountcode'] . "'>" . $myrow['accountcode'] . ' - ' . $myrow['accountname']; + echo $myrow['accountcode'] . '">' . $myrow['accountcode'] . ' - ' . $myrow['accountname'] . '</option>'; } //end while loop Modified: trunk/PcTabs.php =================================================================== --- trunk/PcTabs.php 2011-04-01 19:34:44 UTC (rev 4531) +++ trunk/PcTabs.php 2011-04-01 20:14:14 UTC (rev 4532) @@ -1,8 +1,6 @@ <?php /* $Id$ */ -//$PageSecurity = 15; - include('includes/session.inc'); $title = _('Maintenance Of Petty Cash Tabs'); include('includes/header.inc'); @@ -33,12 +31,12 @@ //first off validate inputs sensible $i=1; - if ($_POST['tabcode']=='' OR $_POST['tabcode']==' ' OR $_POST['tabcode']==' ') { + if ($_POST['TabCode']=='' OR $_POST['TabCode']==' ' OR $_POST['TabCode']==' ') { $InputError = 1; prnMsg('<br>' . _('The Tab code cannot be an empty string or spaces'),'error'); $Errors[$i] = 'TabCode'; $i++; - } elseif (strlen($_POST['tabcode']) >20) { + } elseif (strlen($_POST['TabCode']) >20) { $InputError = 1; echo prnMsg(_('The Tab code must be twenty characters or less long'),'error'); $Errors[$i] = 'TabCode'; @@ -48,14 +46,14 @@ if (isset($SelectedTab) AND $InputError !=1) { $sql = "UPDATE pctabs - SET usercode = '" . $_POST['SelectUser'] . "', - typetabcode = '" . $_POST['SelectTabs'] . "', - currency = '" . $_POST['SelectCurrency'] . "', - tablimit = '" . $_POST['tablimit'] . "', - authorizer = '" . $_POST['SelectAuthorizer'] . "', - glaccountassignment = '" . $_POST['glaccountcash'] . "', - glaccountpcash = '" . $_POST['glaccountpcashtab'] . "' - WHERE tabcode = '".$SelectedTab."'"; + SET usercode = '" . $_POST['SelectUser'] . "', + typetabcode = '" . $_POST['SelectTabs'] . "', + currency = '" . $_POST['SelectCurrency'] . "', + tablimit = '" . $_POST['TabLimit'] . "', + authorizer = '" . $_POST['SelectAuthorizer'] . "', + glaccountassignment = '" . $_POST['glaccountcash'] . "', + glaccountpcash = '" . $_POST['GLAccountPcashTab'] . "' + WHERE tabcode = '".$SelectedTab."'"; $msg = _('The Tabs Of Code') . ' ' . $SelectedTab . ' ' . _('has been updated'); } elseif ( $InputError !=1 ) { @@ -64,14 +62,14 @@ $checkSql = "SELECT count(*) FROM pctabs - WHERE tabcode = '" . $_POST['tabcode'] . "'"; + WHERE tabcode = '" . $_POST['TabCode'] . "'"; - $checkresult = DB_query($checkSql,$db); - $checkrow = DB_fetch_row($checkresult); + $CheckResult = DB_query($checkSql,$db); + $CheckRow = DB_fetch_row($CheckResult); - if ( $checkrow[0] > 0 ) { + if ( $CheckRow[0] > 0 ) { $InputError = 1; - prnMsg( _('The Tab ') . $_POST['tabcode'] . _(' already exist.'),'error'); + prnMsg( _('The Tab ') .' ' . $_POST['TabCode'] . ' ' . _(' already exists'),'error'); } else { // Add new record on submit @@ -85,16 +83,16 @@ authorizer, glaccountassignment, glaccountpcash) - VALUES ('" . $_POST['tabcode'] . "', + VALUES ('" . $_POST['TabCode'] . "', '" . $_POST['SelectUser'] . "', '" . $_POST['SelectTabs'] . "', '" . $_POST['SelectCurrency'] . "', - '" . $_POST['tablimit'] . "', + '" . $_POST['TabLimit'] . "', '" . $_POST['SelectAuthorizer'] . "', '" . $_POST['glaccountcash'] . "', - '" . $_POST['glaccountpcashtab'] . "')"; + '" . $_POST['GLAccountPcashTab'] . "')"; - $msg = _('Tab with Code ') . ' ' . $_POST["tabcode"] . ' ' . _('has been created'); + $msg = _('Tab with Code ') . ' ' . $_POST['TabCode'] . ' ' . _('has been created'); } } @@ -103,15 +101,14 @@ //run the SQL from either of the above possibilites $result = DB_query($sql,$db); prnMsg($msg,'success'); - unset($SelectedTab); unset($_POST['SelectUser'] ); unset($_POST['SelectTabs']); unset($_POST['SelectCurrency']); - unset($_POST['tablimit']); + unset($_POST['TabLimit']); unset($_POST['SelectAuthorizer']); unset($_POST['glaccountcash']); - unset($_POST['glaccountpcashtab']); + unset($_POST['GLAccountPcashTab']); } @@ -122,7 +119,6 @@ $ErrMsg = _('The Tab record could not be deleted because'); $result = DB_query($sql,$db,$ErrMsg); prnMsg(_('Tab type') . ' ' . $SelectedTab . ' ' . _('has been deleted') ,'success'); - unset ($SelectedTab); unset($_GET['delete']); } @@ -140,16 +136,16 @@ $result = DB_query($sql,$db); echo '<br><table class=selection>'; - echo "<tr> - <th>" . _('Tab Code') . "</th> - <th>" . _('User Name') . "</th> - <th>" . _('Type Of Tab') . "</th> - <th>" . _('Currency') . "</th> - <th>" . _('Limit') . "</th> - <th>" . _('Authorizer') . "</th> - <th>" . _('GL Account For Cash Assignment') . "</th> - <th>" . _('GL Account Petty Cash Tab') . "</th> - </tr>"; + echo '<tr> + <th>' . _('Tab Code') . '</th> + <th>' . _('User Name') . '</th> + <th>' . _('Type Of Tab') . '</th> + <th>' . _('Currency') . '</th> + <th>' . _('Limit') . '</th> + <th>' . _('Authorizer') . '</th> + <th>' . _('GL Account For Cash Assignment') . '</th> + <th>' . _('GL Account Petty Cash Tab') . '</th> + </tr>'; $k=0; //row colour counter @@ -196,8 +192,8 @@ $myrow[5], $myrow[6].' - '.$Description[0], $myrow[7].' - '.$DescriptionName[0], - $_SERVER['PHP_SELF'] . '?' . SID, $myrow[0], - $_SERVER['PHP_SELF'] . '?' . SID, $myrow[0]); + $_SERVER['PHP_SELF'] . '?', $myrow[0], + $_SERVER['PHP_SELF'] . '?', $myrow[0]); } //END WHILE LIST LOOP echo '</table>'; @@ -206,11 +202,11 @@ //end of ifs and buts! if (isset($SelectedTab)) { - echo '<p><div class="centre"><a href="' . $_SERVER['PHP_SELF'] . '?' . SID . '">' . _('Show All Tabs Defined') . '</a></div><p>'; + echo '<p><div class="centre"><a href="' . $_SERVER['PHP_SELF'] . '">' . _('Show All Tabs Defined') . '</a></div><p>'; } 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'] . '" />'; echo '<p><table class=selection>'; //Main table @@ -223,29 +219,30 @@ $result = DB_query($sql, $db); $myrow = DB_fetch_array($result); - $_POST['tabcode'] = $myrow['tabcode']; + $_POST['TabCode'] = $myrow['tabcode']; $_POST['SelectUser'] = $myrow['usercode']; $_POST['SelectTabs'] = $myrow['typetabcode']; $_POST['SelectCurrency'] = $myrow['currency']; - $_POST['tablimit'] = $myrow['tablimit']; + $_POST['TabLimit'] = $myrow['tablimit']; $_POST['SelectAuthorizer'] = $myrow['authorizer']; $_POST['glaccountcash'] = $myrow['glaccountassignment']; - $_POST['glaccountpcashtab'] = $myrow['glaccountpcash']; + $_POST['GLAccountPcashTab'] = $myrow['glaccountpcash']; - echo "<input type=hidden name='SelectedTab' VALUE=" . $SelectedTab . ">"; - echo "<input type=hidden name='tabcode' VALUE=" . $_POST['tabcode']. ">"; - echo "<table class=selection> <tr><td>" . _('Tabcode') . ":</td><td>"; + echo '<input type=hidden name="SelectedTab" value="' . $SelectedTab . '">'; + echo '<input type=hidden name="TabCode" value="' . $_POST['TabCode']. '">'; + echo '<table class="selection"> <tr><td>' . _('Tab Code') . ':</td><td>'; // We dont allow the user to change an existing type code - echo $_POST['tabcode'] . '</td></tr>'; + echo $_POST['TabCode'] . '</td></tr>'; } else { // This is a new type so the user may volunteer a type code - echo "<table class=selection><tr><td>" . _('Tabcode') . ":</td><td><input type='Text' - " . (in_array('TypeTabCode',$Errors) ? 'class="inputerror"' : '' ) ." name='tabcode'></td></tr>"; + echo '<table class="selection"> + <tr><td>' . _('Tab Code') . ':</td> + <td><input type="Text"' . (in_array('TypeTabCode',$Errors) ? 'class="inputerror"' : '' ) .' name="TabCode"></td></tr>'; } @@ -253,142 +250,145 @@ $_POST['typetabdescription']=''; } - echo '<tr><td>' . _('User Name') . ":</td><td><select name='SelectUser'>"; + echo '<tr><td>' . _('User Name') . ':</td><td><select name="SelectUser">'; DB_free_result($result); - $SQL = "SELECT userid - FROM www_users ORDER BY userid"; + $SQL = 'SELECT userid + FROM www_users ORDER BY userid'; $result = DB_query($SQL,$db); while ($myrow = DB_fetch_array($result)) { if (isset($_POST['SelectUser']) and $myrow['userid']==$_POST['SelectUser']) { - echo "<option selected VALUE='"; + echo '<option selected VALUE="'; } else { - echo "<option VALUE='"; + echo '<option VALUE="'; } - echo $myrow['userid'] . "'>" . $myrow['userid']; + echo $myrow['userid'] . '">' . $myrow['userid'] . '</option>'; } //end while loop get user echo '</select></td></tr>'; - echo '<tr><td>' . _('Type Of Tab') . ":</td><td><select name='SelectTabs'>"; + echo '<tr><td>' . _('Type Of Tab') . ':</td><td><select name="SelectTabs">'; DB_free_result($result); - $SQL = "SELECT typetabcode FROM pctypetabs ORDER BY typetabcode"; + $SQL = 'SELECT typetabcode FROM pctypetabs ORDER BY typetabcode'; $result = DB_query($SQL,$db); while ($myrow = DB_fetch_array($result)) { if (isset($_POST['SelectTabs']) and $myrow['typetabcode']==$_POST['SelectTabs']) { - echo "<option selected VALUE='"; + echo '<option selected VALUE="'; } else { - echo "<option VALUE='"; + echo '<option VALUE="'; } - echo $myrow['typetabcode'] . "'>" . $myrow['typetabcode']; + echo $myrow['typetabcode'] . '">' . $myrow['typetabcode'] . '</option>'; } //end while loop get type of tab echo '</select></td></tr>'; - echo '<tr><td>' . _('Currency') . ":</td><td><select name='SelectCurrency'>"; + echo '<tr><td>' . _('Currency') . ':</td><td><select name="SelectCurrency">'; DB_free_result($result); - $SQL = "SELECT currency,currabrev - FROM currencies"; + $SQL = 'SELECT currency,currabrev + FROM currencies'; $result = DB_query($SQL,$db); while ($myrow = DB_fetch_array($result)) { if (isset($_POST['SelectCurrency']) and $myrow['currabrev']==$_POST['SelectCurrency']) { - echo "<option selected VALUE='"; + echo '<option selected VALUE="'; } else { - echo "<option VALUE='"; + echo '<option VALUE="'; } - echo $myrow['currabrev'] . "'>" . $myrow['currency']; + echo $myrow['currabrev'] . '">' . $myrow['currency'] . '</option>'; } //end while loop get type of tab echo '</select></td></tr>'; - if (!isset($_POST['tablimit'])) { - $_POST['tablimit']=0; + if (!isset($_POST['TabLimit'])) { + $_POST['TabLimit']=0; } - echo "<tr><td>" . _('Limit Of Tab') . ":</td><td><input type='Text' class='number' name='tablimit' size='12' maxlength='11' value='" . $_POST['tablimit'] . "'></td></tr>"; + echo '<tr><td>' . _('Limit Of Tab') . ':</td> + <td><input type="Text" class="number" name="TabLimit" size="12" maxlength="11" value="' . $_POST['TabLimit'] . '"></td></tr>'; - echo '<tr><td>' . _('Authorizer') . ":</td><td><select name='SelectAuthorizer'>"; + echo '<tr><td>' . _('Authorizer') . ':</td> + <td><select name="SelectAuthorizer">'; DB_free_result($result); - $SQL = "SELECT userid - FROM www_users - ORDER BY userid"; + $SQL = 'SELECT userid + FROM www_users + ORDER BY userid'; $result = DB_query($SQL,$db); while ($myrow = DB_fetch_array($result)) { if (isset($_POST['SelectAuthorizer']) and $myrow['userid']==$_POST['SelectAuthorizer']) { - echo "<option selected VALUE='"; + echo '<option selected value="'; } else { - echo "<option VALUE='"; + echo '<option value="'; } - echo $myrow['userid'] . "'>" . $myrow['userid']; + echo $myrow['userid'] . '">' . $myrow['userid'] . '</option>'; } //end while loop get authorizer echo '</select></td></tr>'; - echo '<tr><td>' . _('GL Account Cash Assignment') . ":</td><td><select name='glaccountcash'>"; + echo '<tr><td>' . _('GL Account Cash Assignment') . ':</td><td><select name="glaccountcash">'; DB_free_result($result); - $SQL = "SELECT chartmaster.accountcode, chartmaster.accountname - FROM chartmaster, bankaccounts - WHERE chartmaster.accountcode = bankaccounts.accountcode - ORDER BY chartmaster.accountcode"; + $SQL = 'SELECT chartmaster.accountcode, + chartmaster.accountname + FROM chartmaster INNER JOIN bankaccounts + ON chartmaster.accountcode = bankaccounts.accountcode + ORDER BY chartmaster.accountcode'; $result = DB_query($SQL,$db); while ($myrow = DB_fetch_array($result)) { if (isset($_POST['glaccountcash']) and $myrow['accountcode']==$_POST['glaccountcash']) { - echo "<option selected VALUE='"; + echo '<option selected value="'; } else { - echo "<option VALUE='"; + echo '<option value="'; } - echo $myrow['accountcode'] . "'>" . $myrow['accountcode'] . ' - ' . $myrow['accountname']; + echo $myrow['accountcode'] . '">' . $myrow['accountcode'] . ' - ' . $myrow['accountname'] . '</option>'; } //end while loop echo '</select></td></tr>'; - echo '<tr><td>' . _('GL Account Petty Cash Tab') . ":</td><td><select name='glaccountpcashtab'>"; + echo '<tr><td>' . _('GL Account Petty Cash Tab') . ':</td> + <td><select name="GLAccountPcashTab">'; DB_free_result($result); - $SQL = "SELECT accountcode, accountname - FROM chartmaster - ORDER BY accountcode"; + $SQL = 'SELECT accountcode, accountname + FROM chartmaster + ORDER BY accountcode'; $result = DB_query($SQL,$db); while ($myrow = DB_fetch_array($result)) { - if (isset($_POST['glaccountpcashtab']) and $myrow['accountcode']==$_POST['glaccountpcashtab']) { - echo "<option selected VALUE='"; + if (isset($_POST['GLAccountPcashTab']) and $myrow['accountcode']==$_POST['GLAccountPcashTab']) { + echo '<option selected value="'; } else { - echo "<option VALUE='"; + echo '<option value="'; } - echo $myrow['accountcode'] . "'>" . $myrow['accountcode'] . ' - ' . $myrow['accountname']; + echo $myrow['accountcode'] . '">' . $myrow['accountcode'] . ' - ' . $myrow['accountname'] . '</option>'; } //end while loop echo '</select></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>'; } // end if user wish to delete - 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-01 20:14:21
|
Revision: 4532 http://web-erp.svn.sourceforge.net/web-erp/?rev=4532&view=rev Author: daintree Date: 2011-04-01 20:14:14 +0000 (Fri, 01 Apr 2011) Log Message: ----------- More SQL quoting and xhtml fixes Modified Paths: -------------- trunk/MRPShortages.php trunk/OffersReceived.php trunk/PDFBankingSummary.php trunk/PDFCustomerList.php trunk/PageSecurity.php trunk/Payments.php trunk/PcExpenses.php trunk/PcTabs.php Modified: trunk/MRPShortages.php =================================================================== --- trunk/MRPShortages.php 2011-04-01 19:34:44 UTC (rev 4531) +++ trunk/MRPShortages.php 2011-04-01 20:14:14 UTC (rev 4532) @@ -6,13 +6,13 @@ 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) { $title=_('MRP error'); include('includes/header.inc'); - echo '<br>'; + echo '<br />'; prnMsg( _('The MRP calculation must be run before you can run this report').'<br />'. _('To run the MRP calculation click').' '.'<a href="'.$rootpath .'/MRP.php">'._('here').'</a>', 'error'); include('includes/footer.inc'); @@ -159,7 +159,7 @@ prnMsg( _('No MRP shortages retrieved'), 'warn'); 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; @@ -225,8 +225,8 @@ $DisplayTotalVal = number_format($Total_Shortage,2); $pdf->addTextWrap(510,$YPos,60,$FontSize,$DisplayTotalVal, 'right'); - $pdf->OutputD($_SESSION['DatabaseName'] . '_MRPShortages_' . date('Y-m-d').'.pdf');//UldisN - $pdf->__destruct(); //UldisN + $pdf->OutputD($_SESSION['DatabaseName'] . '_MRPShortages_' . date('Y-m-d').'.pdf'); + $pdf->__destruct(); } else { /*The option to print PDF was not hit so display form */ $title=_('MRP Shortages Reporting'); @@ -256,7 +256,7 @@ echo "<option selected value='yes'>" . _('Print With Alternating Highlighted Lines').'</option>'; echo "<option value='no'>" . _('Plain Print').'</option>'; echo '</select></td></tr>'; - echo "</table><br><div class='centre'><input type=submit name='PrintPDF' value='" . _('Print PDF') . "'></div>"; + echo "</table><br /><div class='centre'><input type=submit name='PrintPDF' value='" . _('Print PDF') . "'></div>"; include('includes/footer.inc'); Modified: trunk/OffersReceived.php =================================================================== --- trunk/OffersReceived.php 2011-04-01 19:34:44 UTC (rev 4531) +++ trunk/OffersReceived.php 2011-04-01 20:14:14 UTC (rev 4532) @@ -1,6 +1,6 @@ <?php -//$PageSecurity = 4; +/*$Id: OffersReceived.php 4500 2011-02-27 09:18:42Z daintree $ */ include('includes/session.inc'); $title = _('Supplier Offers'); @@ -40,7 +40,7 @@ } else { echo '<p class="page_title_text"><img src="'.$rootpath.'/css/'.$theme.'/images/supplier.png" title="' . _('Select Supplier') . '" alt="" />' . ' ' . _('Select Supplier') . '</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>'; echo '<tr><td>'._('Select Supplier').'</td>'; @@ -81,7 +81,7 @@ ORDER BY offerid"; $result=DB_query($sql, $db); - 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 '<p class="page_title_text"><img src="'.$rootpath.'/css/'.$theme.'/images/supplier.png" title="' . @@ -153,7 +153,7 @@ $_SESSION['CompanyRecord']['coyname']."\n"; $MailText.=_('The following offers you made have been accepted')."\n"; $MailText.=_('An official order will be sent to you in due course')."\n\n"; - $sql='SELECT rate FROM currencies where currabrev="'.$CurrCode.'"'; + $sql="SELECT rate FROM currencies where currabrev='" . $CurrCode ."'"; $result=DB_query($sql, $db); $myrow=DB_fetch_array($result); $Rate=$myrow['rate']; @@ -226,7 +226,7 @@ $result = $mail->send(array($Email), 'smtp'); prnMsg(_('The accepted offers from').' '.$SupplierName.' '._('have been converted to purchase orders and an email sent to') .' '.$Email."\n"._('Please review the order contents').' '.'<a href="'.$rootpath . - "/PO_Header.php?" . SID . "&ModifyOrderNumber=" . $OrderNo.'">'._('here').'</a>"', 'success'); + "/PO_Header.php?ModifyOrderNumber=" . $OrderNo.'">'._('here').'</a>"', 'success'); } if (sizeOf($rejects)>0){ $MailText=_('This email has been automatically generated by the webERP installation at').' '. Modified: trunk/PDFBankingSummary.php =================================================================== --- trunk/PDFBankingSummary.php 2011-04-01 19:34:44 UTC (rev 4531) +++ trunk/PDFBankingSummary.php 2011-04-01 20:14:14 UTC (rev 4532) @@ -2,9 +2,6 @@ /* $Id$*/ -/* $Revision: 1.14 $ */ - -//$PageSecurity = 3; include ('includes/session.inc'); include('includes/SQL_CommonFunctions.inc'); @@ -27,35 +24,35 @@ ORDER BY transno DESC'; $result=DB_query($sql, $db); - echo "<form method='post' action=" . $_SERVER['PHP_SELF'] . '><table class=selection>'; + echo '<form method="post" action="' . $_SERVER['PHP_SELF'] . '"><table class=selection>'; echo '<input type="hidden" name="FormID" value="' . $_SESSION['FormID'] . '" />'; echo '<tr><td>' . _('Select the batch number of receipts to be printed') . ':</td>'; - echo '<td><select name=BatchNo>'; + echo '<td><select name="BatchNo">'; while ($myrow=DB_fetch_array($result)) { echo '<option value="'.$myrow['transno'].'">'._('Batch') .' '. $myrow['transno'].' - '.ConvertSqlDate($myrow['transdate']).'</option>'; } echo '</select></td></tr></table>'; - echo "<br><div class='centre'><input type=submit name='EnterBatchNo' VALUE='" . _('Create PDF') . "'></div></form>"; + echo '<br /><div class="centre"><input type="submit" name="EnterBatchNo" value="' . _('Create PDF') . '"></div></form>'; include ('includes/footer.inc'); exit; } if (isset($_POST['BatchNo']) and $_POST['BatchNo']!='') { - $SQL= 'SELECT bankaccountname, - bankaccountnumber, - ref, - transdate, - banktranstype, - bankact, - banktrans.exrate, - banktrans.functionalexrate, - banktrans.currcode - FROM bankaccounts, - banktrans - WHERE bankaccounts.accountcode=banktrans.bankact - AND banktrans.transno="' . $_POST['BatchNo'] . '" - AND banktrans.type=12'; + $SQL= "SELECT bankaccountname, + bankaccountnumber, + ref, + transdate, + banktranstype, + bankact, + banktrans.exrate, + banktrans.functionalexrate, + banktrans.currcode + FROM bankaccounts, + banktrans + WHERE bankaccounts.accountcode=banktrans.bankact + AND banktrans.transno='" . $_POST['BatchNo'] . "' + AND banktrans.type=12"; $ErrMsg = _('An error occurred getting the header information about the receipt batch number') . ' ' . $_POST['BatchNo']; $DbgMsg = _('The SQL used to get the receipt header information that failed was'); @@ -65,111 +62,111 @@ $title = _('Create PDF Print-out For A Batch Of Receipts'); include ('includes/header.inc'); prnMsg(_('The receipt batch number') . ' ' . $_POST['BatchNo'] . ' ' . _('was not found in the database') . '. ' . _('Please try again selecting a different batch number'), 'warn'); - include('includes/footer.inc'); - exit; -} -/* OK get the row of receipt batch header info from the BankTrans table */ -$myrow = DB_fetch_array($Result); -$ExRate = $myrow['exrate']; -$FunctionalExRate = $myrow['functionalexrate']; -$Currency = $myrow['currcode']; -$BankTransType = $myrow['banktranstype']; -$BankedDate = $myrow['transdate']; -$BankActName = $myrow['bankaccountname']; -$BankActNumber = $myrow['bankaccountnumber']; -$BankingReference = $myrow['ref']; - - -$SQL = "SELECT debtorsmaster.name, - ovamount, - invtext, - reference - FROM debtorsmaster INNER JOIN debtortrans - ON debtorsmaster.debtorno=debtortrans.debtorno - WHERE debtortrans.transno='" . $_POST['BatchNo'] . "' - AND debtortrans.type=12"; - -$CustRecs=DB_query($SQL,$db,'','',false,false); -if (DB_error_no($db)!=0){ - $title = _('Create PDF Print-out For A Batch Of Receipts'); - include ('includes/header.inc'); - prnMsg(_('An error occurred getting the customer receipts for batch number') . ' ' . $_POST['BatchNo'],'error'); - if ($debug==1){ - prnMsg(_('The SQL used to get the customer receipt information that failed was') . '<br>' . $SQL,'error'); - } - include('includes/footer.inc'); - exit; -} -$SQL = "SELECT narrative, - amount - FROM gltrans - WHERE gltrans.typeno='" . $_POST['BatchNo'] . "' - AND gltrans.type=12 and gltrans.amount <0 - AND gltrans.account !='" . $myrow['bankact'] . "' - AND gltrans.account !='" . $_SESSION['CompanyRecord']['debtorsact'] . "'"; - -$GLRecs=DB_query($SQL,$db,'','',false,false); -if (DB_error_no($db)!=0){ - $title = _('Create PDF Print-out For A Batch Of Receipts'); - include ('includes/header.inc'); - prnMsg(_('An error occurred getting the GL receipts for batch number') . ' ' . $_POST['BatchNo'],'error'); - if ($debug==1){ - prnMsg(_('The SQL used to get the GL receipt information that failed was') . ':<br>' . $SQL,'error'); + include('includes/footer.inc'); + exit; } - include('includes/footer.inc'); - exit; + /* OK get the row of receipt batch header info from the BankTrans table */ + $myrow = DB_fetch_array($Result); + $ExRate = $myrow['exrate']; + $FunctionalExRate = $myrow['functionalexrate']; + $Currency = $myrow['currcode']; + $BankTransType = $myrow['banktranstype']; + $BankedDate = $myrow['transdate']; + $BankActName = $myrow['bankaccountname']; + $BankActNumber = $myrow['bankaccountnumber']; + $BankingReference = $myrow['ref']; + + + $SQL = "SELECT debtorsmaster.name, + ovamount, + invtext, + reference + FROM debtorsmaster INNER JOIN debtortrans + ON debtorsmaster.debtorno=debtortrans.debtorno + WHERE debtortrans.transno='" . $_POST['BatchNo'] . "' + AND debtortrans.type=12"; + + $CustRecs=DB_query($SQL,$db,'','',false,false); + if (DB_error_no($db)!=0){ + $title = _('Create PDF Print-out For A Batch Of Receipts'); + include ('includes/header.inc'); + prnMsg(_('An error occurred getting the customer receipts for batch number') . ' ' . $_POST['BatchNo'],'error'); + if ($debug==1){ + prnMsg(_('The SQL used to get the customer receipt information that failed was') . '<br />' . $SQL,'error'); + } + include('includes/footer.inc'); + exit; + } + $SQL = "SELECT narrative, + amount + FROM gltrans + WHERE gltrans.typeno='" . $_POST['BatchNo'] . "' + AND gltrans.type=12 and gltrans.amount <0 + AND gltrans.account !='" . $myrow['bankact'] . "' + AND gltrans.account !='" . $_SESSION['CompanyRecord']['debtorsact'] . "'"; + + $GLRecs=DB_query($SQL,$db,'','',false,false); + if (DB_error_no($db)!=0){ + $title = _('Create PDF Print-out For A Batch Of Receipts'); + include ('includes/header.inc'); + prnMsg(_('An error occurred getting the GL receipts for batch number') . ' ' . $_POST['BatchNo'],'error'); + if ($debug==1){ + prnMsg(_('The SQL used to get the GL receipt information that failed was') . ':<br />' . $SQL,'error'); + } + 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',_('Banking Summary')); + $pdf->addInfo('Subject',_('Banking Summary Number') . ' ' . $_POST['BatchNo']); + $line_height=12; + $PageNumber = 0; + $TotalBanked = 0; + + include ('includes/PDFBankingSummaryPageHeader.inc'); + + while ($myrow=DB_fetch_array($CustRecs)){ + + $LeftOvers = $pdf->addTextWrap($Left_Margin,$YPos,60,$FontSize,number_format(-$myrow['ovamount'],2), 'right'); + $LeftOvers = $pdf->addTextWrap($Left_Margin+65,$YPos,150,$FontSize,$myrow['name'], 'left'); + $LeftOvers = $pdf->addTextWrap($Left_Margin+215,$YPos,100,$FontSize,$myrow['invtext'], 'left'); + $LeftOvers = $pdf->addTextWrap($Left_Margin+315,$YPos,100,$FontSize,$myrow['reference'], 'left'); + + $YPos -= ($line_height); + $TotalBanked -= $myrow['ovamount']; + + if ($YPos - (2 *$line_height) < $Bottom_Margin){ + /*Then set up a new page */ + include ('includes/PDFBankingSummaryPageHeader.inc'); + } /*end of new page header */ + } /* end of while there are customer receipts in the batch to print */ + + /* Right now print out the GL receipt entries in the batch */ + while ($myrow=DB_fetch_array($GLRecs)){ + + $LeftOvers = $pdf->addTextWrap($Left_Margin,$YPos,60,$FontSize,number_format((-$myrow['amount']*$ExRate*$FunctionalExRate),2), 'right'); + $LeftOvers = $pdf->addTextWrap($Left_Margin+65,$YPos,300,$FontSize,$myrow['narrative'], 'left'); + $YPos -= ($line_height); + $TotalBanked += (-$myrow['amount']*$ExRate); + + if ($YPos - (2 *$line_height) < $Bottom_Margin){ + /*Then set up a new page */ + include ('includes/PDFBankingSummaryPageHeader.inc'); + } /*end of new page header */ + } /* end of while there are GL receipts in the batch to print */ + + + $YPos-=$line_height; + $LeftOvers = $pdf->addTextWrap($Left_Margin,$YPos,60,$FontSize,number_format($TotalBanked,2), 'right'); + $LeftOvers = $pdf->addTextWrap($Left_Margin+65,$YPos,300,$FontSize,_('TOTAL') . ' ' . $Currency . ' ' . _('BANKED'), 'left'); + + $pdf->OutputD($_SESSION['DatabaseName'] . '_BankingSummary_' . date('Y-m-d').'.pdf');//UldisN + $pdf->__destruct(); } - -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',_('Banking Summary')); -$pdf->addInfo('Subject',_('Banking Summary Number') . ' ' . $_POST['BatchNo']); -$line_height=12; -$PageNumber = 0; -$TotalBanked = 0; - -include ('includes/PDFBankingSummaryPageHeader.inc'); - -while ($myrow=DB_fetch_array($CustRecs)){ - - $LeftOvers = $pdf->addTextWrap($Left_Margin,$YPos,60,$FontSize,number_format(-$myrow['ovamount'],2), 'right'); - $LeftOvers = $pdf->addTextWrap($Left_Margin+65,$YPos,150,$FontSize,$myrow['name'], 'left'); - $LeftOvers = $pdf->addTextWrap($Left_Margin+215,$YPos,100,$FontSize,$myrow['invtext'], 'left'); - $LeftOvers = $pdf->addTextWrap($Left_Margin+315,$YPos,100,$FontSize,$myrow['reference'], 'left'); - - $YPos -= ($line_height); - $TotalBanked -= $myrow['ovamount']; - - if ($YPos - (2 *$line_height) < $Bottom_Margin){ - /*Then set up a new page */ - include ('includes/PDFBankingSummaryPageHeader.inc'); - } /*end of new page header */ -} /* end of while there are customer receipts in the batch to print */ - -/* Right now print out the GL receipt entries in the batch */ -while ($myrow=DB_fetch_array($GLRecs)){ - - $LeftOvers = $pdf->addTextWrap($Left_Margin,$YPos,60,$FontSize,number_format((-$myrow['amount']*$ExRate*$FunctionalExRate),2), 'right'); - $LeftOvers = $pdf->addTextWrap($Left_Margin+65,$YPos,300,$FontSize,$myrow['narrative'], 'left'); - $YPos -= ($line_height); - $TotalBanked += (-$myrow['amount']*$ExRate); - - if ($YPos - (2 *$line_height) < $Bottom_Margin){ - /*Then set up a new page */ - include ('includes/PDFBankingSummaryPageHeader.inc'); - } /*end of new page header */ -} /* end of while there are GL receipts in the batch to print */ - - -$YPos-=$line_height; -$LeftOvers = $pdf->addTextWrap($Left_Margin,$YPos,60,$FontSize,number_format($TotalBanked,2), 'right'); -$LeftOvers = $pdf->addTextWrap($Left_Margin+65,$YPos,300,$FontSize,_('TOTAL') . ' ' . $Currency . ' ' . _('BANKED'), 'left'); - -$pdf->OutputD($_SESSION['DatabaseName'] . '_BankingSummary_' . date('Y-m-d').'.pdf');//UldisN -$pdf->__destruct(); //UldisN -} - ?> \ No newline at end of file Modified: trunk/PDFCustomerList.php =================================================================== --- trunk/PDFCustomerList.php 2011-04-01 19:34:44 UTC (rev 4531) +++ trunk/PDFCustomerList.php 2011-04-01 20:14:14 UTC (rev 4532) @@ -1,9 +1,7 @@ <?php -/* $Revision: 1.13 $ */ /* $Id$*/ -//$PageSecurity = 2; include('includes/session.inc'); if (isset($_POST['PrintPDF'])){ @@ -359,8 +357,8 @@ } /*end if $PrintThisCustomer == true */ } /*end while loop */ - $pdf->OutputD($_SESSION['DatabaseName'] . '_CustomerList_' . date('Y-m-d').'.pdf');//UldisN - $pdf->__destruct(); //UldisN + $pdf->OutputD($_SESSION['DatabaseName'] . '_CustomerList_' . date('Y-m-d').'.pdf');//UldisN + $pdf->__destruct(); exit; } else { @@ -377,10 +375,10 @@ $sql='SELECT areacode, areadescription FROM areas'; $AreasResult= DB_query($sql,$db); - echo '<option selected value="All">' . _('All Areas'); + echo '<option selected value="All">' . _('All Areas') . '</option>'; While ($myrow = DB_fetch_array($AreasResult)){ - echo '<option value="' . $myrow['areacode'] . '">' . $myrow['areadescription']; + echo '<option value="' . $myrow['areacode'] . '">' . $myrow['areadescription'] . '</option>'; } echo '</select></td></tr>'; @@ -398,16 +396,16 @@ echo '<tr><td>' . _('Level Of Activity'). ':</td><td><select name="Activity">'; - echo '<option selected value="All">'. _('All customers'); - echo '<option value="GreaterThan">'. _('Sales Greater Than'); - echo '<option value="LessThan">'. _('Sales Less Than'); + echo '<option selected value="All">'. _('All customers') . '</option>'; + echo '<option value="GreaterThan">'. _('Sales Greater Than') . '</option>'; + echo '<option value="LessThan">'. _('Sales Less Than') . '</option>'; echo '</select></td><td>'; echo '<input type="text" class=number name="ActivityAmount" size=8 maxlength=8 value=0></td></tr>'; $DefaultActivitySince = Date($_SESSION['DefaultDateFormat'], Mktime(0,0,0,Date('m')-6,0,Date('y'))); - echo '<tr><td>' . _('Activity Since'). ':</td><td><input type="text" class=date alt="'.$_SESSION['DefaultDateFormat'].'" name="ActivitySince" size=10 maxlength=10 - VALUE="' . $DefaultActivitySince . '"></td></tr>'; + echo '<tr><td>' . _('Activity Since'). ':</td> + <td><input type="text" class=date alt="'.$_SESSION['DefaultDateFormat'].'" name="ActivitySince" size=10 maxlength=10 value="' . $DefaultActivitySince . '"></td></tr>'; echo '</table><br><div class="centre"><input type=Submit Name="PrintPDF" Value="'. _('Print PDF'). '"></div>'; Modified: trunk/PageSecurity.php =================================================================== --- trunk/PageSecurity.php 2011-04-01 19:34:44 UTC (rev 4531) +++ trunk/PageSecurity.php 2011-04-01 20:14:14 UTC (rev 4532) @@ -1,5 +1,7 @@ <?php +/*$Id: PageSecurity.php 4500 2011-02-27 09:18:42Z daintree $ */ + include('includes/session.inc'); $title = _('Page Security Levels'); @@ -19,20 +21,20 @@ } $sql='SELECT script, - pagesecurity, - description - FROM scripts'; + pagesecurity, + description + FROM scripts'; $result=DB_query($sql, $db); -echo '<br /><form method="post" id="PageSecurity" action="' . $_SERVER['PHP_SELF'] . '?' . SID . '">'; +echo '<br /><form method="post" id="PageSecurity" action="' . $_SERVER['PHP_SELF'] . '">'; echo '<input type="hidden" name="FormID" value="' . $_SESSION['FormID'] . '" />'; echo '<table class="selection">'; -$TokenSql="SELECT tokenid, +$TokenSql='SELECT tokenid, tokenname - FROM securitytokens"; + FROM securitytokens'; $TokenResult=DB_query($TokenSql, $db); while ($myrow=DB_fetch_array($result)) { Modified: trunk/Payments.php =================================================================== --- trunk/Payments.php 2011-04-01 19:34:44 UTC (rev 4531) +++ trunk/Payments.php 2011-04-01 20:14:14 UTC (rev 4532) @@ -1,10 +1,7 @@ <?php /* $Id$*/ -/* $Revision: 1.39 $ */ -//$PageSecurity = 5; - include('includes/DefinePaymentClass.php'); include('includes/session.inc'); @@ -30,7 +27,9 @@ $_SESSION['PaymentDetail']->GLItemCounter = 1; } -if ((isset($_POST['UpdateHeader']) and $_POST['BankAccount']=='') or (isset($_POST['Process']) and $_POST['BankAccount']=='')) { +if ((isset($_POST['UpdateHeader']) + AND $_POST['BankAccount']=='') + OR (isset($_POST['Process']) AND $_POST['BankAccount']=='')) { prnMsg(_('A bank account must be selected to make this payment from'), 'warn'); $BankAccountEmpty=TRUE; } else { @@ -38,11 +37,11 @@ } //note this is already linked from this page -//echo "<a href='" . $rootpath . '/SelectSupplier.php?' . SID . "'>" . _('Back to Suppliers') . '</a><br>'; +//echo "<a href='" . $rootpath . '/SelectSupplier.php?' . SID . "'>" . _('Back to Suppliers') . '</a><br />'; echo '<p class="page_title_text"><img src="'.$rootpath.'/css/'.$theme.'/images/transactions.png" title="' . _('Payment Entry') . '" alt="" />' . ' ' . _('Payment Entry') . '</p>'; -echo '<div class="page_help_text">' . _('Use this screen to enter payments FROM your bank account. <br>Note: To enter a payment FROM a supplier, first select the Supplier, click Enter a Payment to, or Receipt from the Supplier, and use a negative Payment amount on this form.') . '</div><br><div class="centre">'; +echo '<div class="page_help_text">' . _('Use this screen to enter payments FROM your bank account. <br />Note: To enter a payment FROM a supplier, first select the Supplier, click Enter a Payment to, or Receipt from the Supplier, and use a negative Payment amount on this form.') . '</div><br /><div class="centre">'; if (isset($_GET['SupplierID'])){ /*The page was called with a supplierID check it is valid and default the inputs for Supplier Name and currency of payment */ @@ -113,7 +112,7 @@ $_SESSION['PaymentDetail']->Account=$_POST['BankAccount']; /*Get the bank account currency and set that too */ $ErrMsg = _('Could not get the currency of the bank account'); - $result = DB_query('SELECT currcode FROM bankaccounts WHERE accountcode =' . $_POST['BankAccount'],$db,$ErrMsg); + $result = DB_query("SELECT currcode FROM bankaccounts WHERE accountcode ='" . $_POST['BankAccount'] . "'",$db,$ErrMsg); $myrow = DB_fetch_row($result); $_SESSION['PaymentDetail']->AccountCurrency=$myrow[0]; @@ -168,7 +167,7 @@ $SuggestedFunctionalExRate = $myrow[0]; /*Get the exchange rate between the functional currency and the payment currency*/ - $result = DB_query("select rate FROM currencies WHERE currabrev='" . $_SESSION['PaymentDetail']->Currency . "'",$db); + $result = DB_query("SELECT rate FROM currencies WHERE currabrev='" . $_SESSION['PaymentDetail']->Currency . "'",$db); $myrow = DB_fetch_row($result); $tableExRate = $myrow[0]; //this is the rate of exchange between the functional currency and the payment currency /*Calculate cross rate to suggest appropriate exchange rate between payment currency and account currency */ @@ -235,7 +234,7 @@ $SQL = 'SELECT bankaccounts.accountcode FROM bankaccounts, chartmaster - WHERE bankaccounts.accountcode=chartmaster.accountcode'; + WHERE bankaccounts.accountcode=chartmaster.accountcode'; $result = DB_query($SQL,$db); $BankAccounts = array(); $i=0; @@ -254,11 +253,11 @@ AND ($_SESSION['PaymentDetail']->Paymenttype == 'Cheque')) { // 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>'; + echo '<br /><a href="' . $rootpath . '/PrintCheque.php?' . SID . '&ChequeNum=' . $_POST['ChequeNum'] . '">' . _('Print Cheque using pre-printed stationery') . '</a><br /><br />'; echo '<form method=post action="' . $_SERVER['PHP_SELF'] . '">'; echo '<input type="hidden" name="FormID" value="' . $_SESSION['FormID'] . '" />'; - echo _('Has the cheque been printed') . '?<br><br>'; + echo _('Has the cheque been printed') . '?<br /><br />'; echo '<input type="hidden" name="CommitBatch" value="' . $_POST['CommitBatch'] . '">'; echo '<input type="hidden" name="BankAccount" value="' . $_POST['BankAccount'] . '">'; echo '<input type="submit" name="ChequePrinted" value="' . _('Yes / Continue') . '"> '; @@ -593,10 +592,10 @@ $sql="SELECT suppname FROM suppliers WHERE supplierid='".$lastSupplier."'"; $result=DB_query($sql, $db); $myrow=DB_fetch_array($result); - echo '<br><a href="' . $rootpath . '/Payments.php?SupplierID=' . $lastSupplier . '">' . + echo '<br /><a href="' . $rootpath . '/Payments.php?SupplierID=' . $lastSupplier . '">' . _('Enter another Payment for') . ' ' . $myrow['suppname'] . '</a>'; } else { - echo '<br><a href="' . $_SERVER['PHP_SELF'] . '?' . SID . '">' . _('Enter another General Ledger Payment') . '</a><br>'; + echo '<br /><a href="' . $_SERVER['PHP_SELF'] . '?' . SID . '">' . _('Enter another General Ledger Payment') . '</a><br />'; } } @@ -853,13 +852,13 @@ echo '<tr><td colspan=3><div class="centre"><input type="submit" name="UpdateHeader" value="' . _('Update'). '"></td></tr>'; -echo '</table><br>'; +echo '</table><br />'; if ($_SESSION['CompanyRecord']['gllink_creditors']==1 AND $_SESSION['PaymentDetail']->SupplierID==''){ /* Set upthe form for the transaction entry for a GL Payment Analysis item */ - echo '<br><table class=selection>'; + echo '<br /><table class=selection>'; echo '<tr><th colspan=2><font size=3 color=blue>' . _('General Ledger Payment Analysis Entry') . '</font></th></tr>'; //Select the tag @@ -928,11 +927,11 @@ echo '<tr><td>' . _('Amount') . ' (' . $_SESSION['PaymentDetail']->Currency . '):</td><td><input type=Text Name="GLAmount" Maxlength=12 size=12 class=number></td></tr>'; } - echo '</table><br>'; + echo '</table><br />'; echo '<div class="centre"><input type=submit name="Process" value="' . _('Accept') . '"><input type=submit name="Cancel" value="' . _('Cancel') . '"></div>'; if (sizeOf($_SESSION['PaymentDetail']->GLItems)>0) { - echo '<br><table class=selection><tr> + echo '<br /><table class=selection><tr> <th>' . _('Cheque No').'</th> <th>' . _('Amount') . ' (' . $_SESSION['PaymentDetail']->Currency . ')</th> <th>' . _('GL Account') . '</th> @@ -942,25 +941,25 @@ $PaymentTotal = 0; foreach ($_SESSION['PaymentDetail']->GLItems as $PaymentItem) { - $tagsql='SELECT tagdescription from tags where tagref='.$PaymentItem->tag; - $tagresult=DB_query($tagsql, $db); - $tagmyrow=DB_fetch_row($tagresult); + $tagsql="SELECT tagdescription from tags where tagref='" . $PaymentItem->tag . "'"; + $TagResult=DB_query($tagsql, $db); + $TagMyrow=DB_fetch_row($TagResult); if ($PaymentItem->tag==0) { - $tagname='None'; + $TagName='None'; } else { - $tagname=$tagmyrow[0]; + $TagName=$TagMyrow[0]; } echo '<tr> <td align=left>' . $PaymentItem->cheque . '</td> <td class=number>' . number_format($PaymentItem->Amount,2) . '</td> <td>' . $PaymentItem->GLCode . ' - ' . $PaymentItem->GLActName . '</td> <td>' . stripslashes($PaymentItem->Narrative) . '</td> - <td>' . $PaymentItem->tag . ' - ' . $tagname . '</td> + <td>' . $PaymentItem->tag . ' - ' . $TagName . '</td> <td><a href="' . $_SERVER['PHP_SELF'] . '?' . SID . '&Delete=' . $PaymentItem->ID . '">' . _('Delete') . '</a></td> </tr>'; $PaymentTotal += $PaymentItem->Amount; } - echo '<tr><td></td><td class=number><b>' . number_format($PaymentTotal,2) . '</b></td><td></td><td></td><td></td></tr></table><br>'; + echo '<tr><td></td><td class=number><b>' . number_format($PaymentTotal,2) . '</b></td><td></td><td></td><td></td></tr></table><br />'; echo '<input type=submit name="CommitBatch" value="' . _('Accept and Process Payment') . '">'; } @@ -978,7 +977,7 @@ } else { echo '<input type="hidden" name="discount" Value=0>'; } - echo '</table><br>'; + echo '</table><br />'; echo '<input type=submit name="CommitBatch" value="' . _('Accept and Process Payment') . '">'; } echo '</form>'; Modified: trunk/PcExpenses.php =================================================================== --- trunk/PcExpenses.php 2011-04-01 19:34:44 UTC (rev 4531) +++ trunk/PcExpenses.php 2011-04-01 20:14:14 UTC (rev 4532) @@ -1,7 +1,6 @@ <?php -/* $Revision: 1.0$ */ -//$PageSecurity = 15; +/* $Id$*/ include('includes/session.inc'); $title = _('Maintenance Of Petty Cash Of Expenses'); @@ -95,7 +94,7 @@ $msg = _('Expense ') . ' ' . $_POST['codeexpense'] . ' ' . _('has been created'); $checkSql = "SELECT count(codeexpense) - FROM pcexpenses"; + FROM pcexpenses"; $result = DB_query($checkSql, $db); $row = DB_fetch_row($result); @@ -154,12 +153,12 @@ $result = DB_query($sql,$db); echo '<table class=selection>'; - echo "<tr> - <th>" . _('Code Of Expense') . "</th> - <th>" . _('Description') . "</th> - <th>" . _('Account Code') . "</th> - <th>" . _('Account Description') . "</th> - </tr>"; + echo '<tr> + <th>' . _('Code Of Expense') . '</th> + <th>' . _('Description') . '</th> + <th>' . _('Account Code') . '</th> + <th>' . _('Account Description') . '</th> + </tr>'; $k=0; //row colour counter @@ -190,8 +189,8 @@ $myrow[1], $myrow[2], $Description[0], - $_SERVER['PHP_SELF'] . '?' . SID, $myrow[0], - $_SERVER['PHP_SELF'] . '?' . SID, $myrow[0]); + $_SERVER['PHP_SELF'] . '?', $myrow[0], + $_SERVER['PHP_SELF'] . '?', $myrow[0]); } //END WHILE LIST LOOP echo '</table>'; @@ -200,11 +199,11 @@ //end of ifs and buts! if (isset($SelectedExpense)) { - echo '<p><div class="centre"><a href="' . $_SERVER['PHP_SELF'] . '?' . SID . '">' . _('Show All Petty Cash Expenses Defined') . '</a></div><p>'; + echo '<p><div class="centre"><a href="' . $_SERVER['PHP_SELF'] . '">' . _('Show All Petty Cash Expenses Defined') . '</a></div><p>'; } 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'] . '" />'; echo '<p><table class=selection>'; //Main table @@ -216,7 +215,7 @@ description, glaccount FROM pcexpenses - WHERE codeexpense='$SelectedExpense'"; + WHERE codeexpense='" . $SelectedExpense . "'"; $result = DB_query($sql, $db); $myrow = DB_fetch_array($result); @@ -225,9 +224,9 @@ $_POST['description'] = $myrow['description']; $_POST['glaccount'] = $myrow['glaccount']; - echo "<input type=hidden name='SelectedExpense' VALUE=" . $SelectedExpense . ">"; - echo "<input type=hidden name='codeexpense' VALUE=" . $_POST['codeexpense']. ">"; - echo "<table class=selection> <tr><td>" . _('Code Of Expense') . ":</td><td>"; + echo '<input type=hidden name="SelectedExpense" value="' . $SelectedExpense . '">'; + echo '<input type=hidden name="codeexpense" VALUE="' . $_POST['codeexpense']. '">'; + echo '<table class="selection"> <tr><td>' . _('Code Of Expense') . ':</td><td>'; // We dont allow the user to change an existing type code @@ -237,32 +236,33 @@ // This is a new type so the user may volunteer a type code - echo "<table class=selection><tr><td>" . _('Code Of Expense') . ":</td><td><input type='Text' - " . (in_array('SalesType',$Errors) ? 'class="inputerror"' : '' ) ." name='codeexpense'></td></tr>"; + echo '<table class=selection> + <tr><td>' . _('Code Of Expense') . ':</td> + <td><input type="Text"' . (in_array('SalesType',$Errors) ? 'class="inputerror"' : '' ) .' name="codeexpense"></td></tr>'; } if (!isset($_POST['description'])) { $_POST['description']=''; } - echo "<tr><td>" . _('Description') . ":</td><td><input type='Text' name='description' size=50 maxlength=49 value='" . $_POST['description'] . "'></td></tr>"; + echo '<tr><td>' . _('Description') . ':</td><td><input type="Text" name="description" size=50 maxlength=49 value="' . $_POST['description'] . '"></td></tr>'; - echo '<tr><td>' . _('Account Code') . ":</td><td><select name='glaccount'>"; + echo '<tr><td>' . _('Account Code') . ':</td><td><select name="glaccount">'; DB_free_result($result); - $SQL = "SELECT accountcode, + $SQL = 'SELECT accountcode, accountname FROM chartmaster - ORDER BY accountcode"; + ORDER BY accountcode'; $result = DB_query($SQL,$db); while ($myrow = DB_fetch_array($result)) { if (isset($_POST['glaccount']) and $myrow['accountcode']==$_POST['glaccount']) { - echo "<option selected VALUE='"; + echo '<option selected VALUE="'; } else { - echo "<option VALUE='"; + echo '<option VALUE="'; } - echo $myrow['accountcode'] . "'>" . $myrow['accountcode'] . ' - ' . $myrow['accountname']; + echo $myrow['accountcode'] . '">' . $myrow['accountcode'] . ' - ' . $myrow['accountname'] . '</option>'; } //end while loop Modified: trunk/PcTabs.php =================================================================== --- trunk/PcTabs.php 2011-04-01 19:34:44 UTC (rev 4531) +++ trunk/PcTabs.php 2011-04-01 20:14:14 UTC (rev 4532) @@ -1,8 +1,6 @@ <?php /* $Id$ */ -//$PageSecurity = 15; - include('includes/session.inc'); $title = _('Maintenance Of Petty Cash Tabs'); include('includes/header.inc'); @@ -33,12 +31,12 @@ //first off validate inputs sensible $i=1; - if ($_POST['tabcode']=='' OR $_POST['tabcode']==' ' OR $_POST['tabcode']==' ') { + if ($_POST['TabCode']=='' OR $_POST['TabCode']==' ' OR $_POST['TabCode']==' ') { $InputError = 1; prnMsg('<br>' . _('The Tab code cannot be an empty string or spaces'),'error'); $Errors[$i] = 'TabCode'; $i++; - } elseif (strlen($_POST['tabcode']) >20) { + } elseif (strlen($_POST['TabCode']) >20) { $InputError = 1; echo prnMsg(_('The Tab code must be twenty characters or less long'),'error'); $Errors[$i] = 'TabCode'; @@ -48,14 +46,14 @@ if (isset($SelectedTab) AND $InputError !=1) { $sql = "UPDATE pctabs - SET usercode = '" . $_POST['SelectUser'] . "', - typetabcode = '" . $_POST['SelectTabs'] . "', - currency = '" . $_POST['SelectCurrency'] . "', - tablimit = '" . $_POST['tablimit'] . "', - authorizer = '" . $_POST['SelectAuthorizer'] . "', - glaccountassignment = '" . $_POST['glaccountcash'] . "', - glaccountpcash = '" . $_POST['glaccountpcashtab'] . "' - WHERE tabcode = '".$SelectedTab."'"; + SET usercode = '" . $_POST['SelectUser'] . "', + typetabcode = '" . $_POST['SelectTabs'] . "', + currency = '" . $_POST['SelectCurrency'] . "', + tablimit = '" . $_POST['TabLimit'] . "', + authorizer = '" . $_POST['SelectAuthorizer'] . "', + glaccountassignment = '" . $_POST['glaccountcash'] . "', + glaccountpcash = '" . $_POST['GLAccountPcashTab'] . "' + WHERE tabcode = '".$SelectedTab."'"; $msg = _('The Tabs Of Code') . ' ' . $SelectedTab . ' ' . _('has been updated'); } elseif ( $InputError !=1 ) { @@ -64,14 +62,14 @@ $checkSql = "SELECT count(*) FROM pctabs - WHERE tabcode = '" . $_POST['tabcode'] . "'"; + WHERE tabcode = '" . $_POST['TabCode'] . "'"; - $checkresult = DB_query($checkSql,$db); - $checkrow = DB_fetch_row($checkresult); + $CheckResult = DB_query($checkSql,$db); + $CheckRow = DB_fetch_row($CheckResult); - if ( $checkrow[0] > 0 ) { + if ( $CheckRow[0] > 0 ) { $InputError = 1; - prnMsg( _('The Tab ') . $_POST['tabcode'] . _(' already exist.'),'error'); + prnMsg( _('The Tab ') .' ' . $_POST['TabCode'] . ' ' . _(' already exists'),'error'); } else { // Add new record on submit @@ -85,16 +83,16 @@ authorizer, glaccountassignment, glaccountpcash) - VALUES ('" . $_POST['tabcode'] . "', + VALUES ('" . $_POST['TabCode'] . "', '" . $_POST['SelectUser'] . "', '" . $_POST['SelectTabs'] . "', '" . $_POST['SelectCurrency'] . "', - '" . $_POST['tablimit'] . "', + '" . $_POST['TabLimit'] . "', '" . $_POST['SelectAuthorizer'] . "', '" . $_POST['glaccountcash'] . "', - '" . $_POST['glaccountpcashtab'] . "')"; + '" . $_POST['GLAccountPcashTab'] . "')"; - $msg = _('Tab with Code ') . ' ' . $_POST["tabcode"] . ' ' . _('has been created'); + $msg = _('Tab with Code ') . ' ' . $_POST['TabCode'] . ' ' . _('has been created'); } } @@ -103,15 +101,14 @@ //run the SQL from either of the above possibilites $result = DB_query($sql,$db); prnMsg($msg,'success'); - unset($SelectedTab); unset($_POST['SelectUser'] ); unset($_POST['SelectTabs']); unset($_POST['SelectCurrency']); - unset($_POST['tablimit']); + unset($_POST['TabLimit']); unset($_POST['SelectAuthorizer']); unset($_POST['glaccountcash']); - unset($_POST['glaccountpcashtab']); + unset($_POST['GLAccountPcashTab']); } @@ -122,7 +119,6 @@ $ErrMsg = _('The Tab record could not be deleted because'); $result = DB_query($sql,$db,$ErrMsg); prnMsg(_('Tab type') . ' ' . $SelectedTab . ' ' . _('has been deleted') ,'success'); - unset ($SelectedTab); unset($_GET['delete']); } @@ -140,16 +136,16 @@ $result = DB_query($sql,$db); echo '<br><table class=selection>'; - echo "<tr> - <th>" . _('Tab Code') . "</th> - <th>" . _('User Name') . "</th> - <th>" . _('Type Of Tab') . "</th> - <th>" . _('Currency') . "</th> - <th>" . _('Limit') . "</th> - <th>" . _('Authorizer') . "</th> - <th>" . _('GL Account For Cash Assignment') . "</th> - <th>" . _('GL Account Petty Cash Tab') . "</th> - </tr>"; + echo '<tr> + <th>' . _('Tab Code') . '</th> + <th>' . _('User Name') . '</th> + <th>' . _('Type Of Tab') . '</th> + <th>' . _('Currency') . '</th> + <th>' . _('Limit') . '</th> + <th>' . _('Authorizer') . '</th> + <th>' . _('GL Account For Cash Assignment') . '</th> + <th>' . _('GL Account Petty Cash Tab') . '</th> + </tr>'; $k=0; //row colour counter @@ -196,8 +192,8 @@ $myrow[5], $myrow[6].' - '.$Description[0], $myrow[7].' - '.$DescriptionName[0], - $_SERVER['PHP_SELF'] . '?' . SID, $myrow[0], - $_SERVER['PHP_SELF'] . '?' . SID, $myrow[0]); + $_SERVER['PHP_SELF'] . '?', $myrow[0], + $_SERVER['PHP_SELF'] . '?', $myrow[0]); } //END WHILE LIST LOOP echo '</table>'; @@ -206,11 +202,11 @@ //end of ifs and buts! if (isset($SelectedTab)) { - echo '<p><div class="centre"><a href="' . $_SERVER['PHP_SELF'] . '?' . SID . '">' . _('Show All Tabs Defined') . '</a></div><p>'; + echo '<p><div class="centre"><a href="' . $_SERVER['PHP_SELF'] . '">' . _('Show All Tabs Defined') . '</a></div><p>'; } 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'] . '" />'; echo '<p><table class=selection>'; //Main table @@ -223,29 +219,30 @@ $result = DB_query($sql, $db); $myrow = DB_fetch_array($result); - $_POST['tabcode'] = $myrow['tabcode']; + $_POST['TabCode'] = $myrow['tabcode']; $_POST['SelectUser'] = $myrow['usercode']; $_POST['SelectTabs'] = $myrow['typetabcode']; $_POST['SelectCurrency'] = $myrow['currency']; - $_POST['tablimit'] = $myrow['tablimit']; + $_POST['TabLimit'] = $myrow['tablimit']; $_POST['SelectAuthorizer'] = $myrow['authorizer']; $_POST['glaccountcash'] = $myrow['glaccountassignment']; - $_POST['glaccountpcashtab'] = $myrow['glaccountpcash']; + $_POST['GLAccountPcashTab'] = $myrow['glaccountpcash']; - echo "<input type=hidden name='SelectedTab' VALUE=" . $SelectedTab . ">"; - echo "<input type=hidden name='tabcode' VALUE=" . $_POST['tabcode']. ">"; - echo "<table class=selection> <tr><td>" . _('Tabcode') . ":</td><td>"; + echo '<input type=hidden name="SelectedTab" value="' . $SelectedTab . '">'; + echo '<input type=hidden name="TabCode" value="' . $_POST['TabCode']. '">'; + echo '<table class="selection"> <tr><td>' . _('Tab Code') . ':</td><td>'; // We dont allow the user to change an existing type code - echo $_POST['tabcode'] . '</td></tr>'; + echo $_POST['TabCode'] . '</td></tr>'; } else { // This is a new type so the user may volunteer a type code - echo "<table class=selection><tr><td>" . _('Tabcode') . ":</td><td><input type='Text' - " . (in_array('TypeTabCode',$Errors) ? 'class="inputerror"' : '' ) ." name='tabcode'></td></tr>"; + echo '<table class="selection"> + <tr><td>' . _('Tab Code') . ':</td> + <td><input type="Text"' . (in_array('TypeTabCode',$Errors) ? 'class="inputerror"' : '' ) .' name="TabCode"></td></tr>'; } @@ -253,142 +250,145 @@ $_POST['typetabdescription']=''; } - echo '<tr><td>' . _('User Name') . ":</td><td><select name='SelectUser'>"; + echo '<tr><td>' . _('User Name') . ':</td><td><select name="SelectUser">'; DB_free_result($result); - $SQL = "SELECT userid - FROM www_users ORDER BY userid"; + $SQL = 'SELECT userid + FROM www_users ORDER BY userid'; $result = DB_query($SQL,$db); while ($myrow = DB_fetch_array($result)) { if (isset($_POST['SelectUser']) and $myrow['userid']==$_POST['SelectUser']) { - echo "<option selected VALUE='"; + echo '<option selected VALUE="'; } else { - echo "<option VALUE='"; + echo '<option VALUE="'; } - echo $myrow['userid'] . "'>" . $myrow['userid']; + echo $myrow['userid'] . '">' . $myrow['userid'] . '</option>'; } //end while loop get user echo '</select></td></tr>'; - echo '<tr><td>' . _('Type Of Tab') . ":</td><td><select name='SelectTabs'>"; + echo '<tr><td>' . _('Type Of Tab') . ':</td><td><select name="SelectTabs">'; DB_free_result($result); - $SQL = "SELECT typetabcode FROM pctypetabs ORDER BY typetabcode"; + $SQL = 'SELECT typetabcode FROM pctypetabs ORDER BY typetabcode'; $result = DB_query($SQL,$db); while ($myrow = DB_fetch_array($result)) { if (isset($_POST['SelectTabs']) and $myrow['typetabcode']==$_POST['SelectTabs']) { - echo "<option selected VALUE='"; + echo '<option selected VALUE="'; } else { - echo "<option VALUE='"; + echo '<option VALUE="'; } - echo $myrow['typetabcode'] . "'>" . $myrow['typetabcode']; + echo $myrow['typetabcode'] . '">' . $myrow['typetabcode'] . '</option>'; } //end while loop get type of tab echo '</select></td></tr>'; - echo '<tr><td>' . _('Currency') . ":</td><td><select name='SelectCurrency'>"; + echo '<tr><td>' . _('Currency') . ':</td><td><select name="SelectCurrency">'; DB_free_result($result); - $SQL = "SELECT currency,currabrev - FROM currencies"; + $SQL = 'SELECT currency,currabrev + FROM currencies'; $result = DB_query($SQL,$db); while ($myrow = DB_fetch_array($result)) { if (isset($_POST['SelectCurrency']) and $myrow['currabrev']==$_POST['SelectCurrency']) { - echo "<option selected VALUE='"; + echo '<option selected VALUE="'; } else { - echo "<option VALUE='"; + echo '<option VALUE="'; } - echo $myrow['currabrev'] . "'>" . $myrow['currency']; + echo $myrow['currabrev'] . '">' . $myrow['currency'] . '</option>'; } //end while loop get type of tab echo '</select></td></tr>'; - if (!isset($_POST['tablimit'])) { - $_POST['tablimit']=0; + if (!isset($_POST['TabLimit'])) { + $_POST['TabLimit']=0; } - echo "<tr><td>" . _('Limit Of Tab') . ":</td><td><input type='Text' class='number' name='tablimit' size='12' maxlength='11' value='" . $_POST['tablimit'] . "'></td></tr>"; + echo '<tr><td>' . _('Limit Of Tab') . ':</td> + <td><input type="Text" class="number" name="TabLimit" size="12" maxlength="11" value="' . $_POST['TabLimit'] . '"></td></tr>'; - echo '<tr><td>' . _('Authorizer') . ":</td><td><select name='SelectAuthorizer'>"; + echo '<tr><td>' . _('Authorizer') . ':</td> + <td><select name="SelectAuthorizer">'; DB_free_result($result); - $SQL = "SELECT userid - FROM www_users - ORDER BY userid"; + $SQL = 'SELECT userid + FROM www_users + ORDER BY userid'; $result = DB_query($SQL,$db); while ($myrow = DB_fetch_array($result)) { if (isset($_POST['SelectAuthorizer']) and $myrow['userid']==$_POST['SelectAuthorizer']) { - echo "<option selected VALUE='"; + echo '<option selected value="'; } else { - echo "<option VALUE='"; + echo '<option value="'; } - echo $myrow['userid'] . "'>" . $myrow['userid']; + echo $myrow['userid'] . '">' . $myrow['userid'] . '</option>'; } //end while loop get authorizer echo '</select></td></tr>'; - echo '<tr><td>' . _('GL Account Cash Assignment') . ":</td><td><select name='glaccountcash'>"; + echo '<tr><td>' . _('GL Account Cash Assignment') . ':</td><td><select name="glaccountcash">'; DB_free_result($result); - $SQL = "SELECT chartmaster.accountcode, chartmaster.accountname - FROM chartmaster, bankaccounts - WHERE chartmaster.accountcode = bankaccounts.accountcode - ORDER BY chartmaster.accountcode"; + $SQL = 'SELECT chartmaster.accountcode, + chartmaster.accountname + FROM chartmaster INNER JOIN bankaccounts + ON chartmaster.accountcode = bankaccounts.accountcode + ORDER BY chartmaster.accountcode'; $result = DB_query($SQL,$db); while ($myrow = DB_fetch_array($result)) { if (isset($_POST['glaccountcash']) and $myrow['accountcode']==$_POST['glaccountcash']) { - echo "<option selected VALUE='"; + echo '<option selected value="'; } else { - echo "<option VALUE='"; + echo '<option value="'; } - echo $myrow['accountcode'] . "'>" . $myrow['accountcode'] . ' - ' . $myrow['accountname']; + echo $myrow['accountcode'] . '">' . $myrow['accountcode'] . ' - ' . $myrow['accountname'] . '</option>'; } //end while loop echo '</select></td></tr>'; - echo '<tr><td>' . _('GL Account Petty Cash Tab') . ":</td><td><select name='glaccountpcashtab'>"; + echo '<tr><td>' . _('GL Account Petty Cash Tab') . ':</td> + <td><select name="GLAccountPcashTab">'; DB_free_result($result); - $SQL = "SELECT accountcode, accountname - FROM chartmaster - ORDER BY accountcode"; + $SQL = 'SELECT accountcode, accountname + FROM chartmaster + ORDER BY accountcode'; $result = DB_query($SQL,$db); while ($myrow = DB_fetch_array($result)) { - if (isset($_POST['glaccountpcashtab']) and $myrow['accountcode']==$_POST['glaccountpcashtab']) { - echo "<option selected VALUE='"; + if (isset($_POST['GLAccountPcashTab']) and $myrow['accountcode']==$_POST['GLAccountPcashTab']) { + echo '<option selected value="'; } else { - echo "<option VALUE='"; + echo '<option value="'; } - echo $myrow['accountcode'] . "'>" . $myrow['accountcode'] . ' - ' . $myrow['accountname']; + echo $myrow['accountcode'] . '">' . $myrow['accountcode'] . ' - ' . $myrow['accountname'] . '</option>'; } //end while loop echo '</select></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>'; } // end if user wish to delete - 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-01 21:44:29
|
Revision: 4533 http://web-erp.svn.sourceforge.net/web-erp/?rev=4533&view=rev Author: daintree Date: 2011-04-01 21:44:23 +0000 (Fri, 01 Apr 2011) Log Message: ----------- More SQL quoting and xhtml fixes Modified Paths: -------------- trunk/PDFCustTransListing.php trunk/PDFPickingList.php trunk/PDFSuppTransListing.php trunk/PO_AuthorisationLevels.php Modified: trunk/PDFCustTransListing.php =================================================================== --- trunk/PDFCustTransListing.php 2011-04-01 20:14:14 UTC (rev 4532) +++ trunk/PDFCustTransListing.php 2011-04-01 21:44:23 UTC (rev 4533) @@ -2,9 +2,6 @@ /* $Id$*/ -/* $Revision: 1.13 $ */ - -//$PageSecurity = 3; include('includes/SQL_CommonFunctions.inc'); include ('includes/session.inc'); @@ -27,7 +24,7 @@ prnMsg($msg,'error'); } - 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 '<table class=selection> <tr> @@ -37,17 +34,18 @@ echo '<tr><td>' . _('Transaction type') . '</td><td>'; - echo "<select name='TransType'>"; + echo '<select name="TransType">'; - echo '<option value=10>' . _('Invoices').'</option>'; - echo '<option value=11>' . _('Credit Notes').'</option>'; - echo '<option value=12>' . _('Receipts').'</option>'; + echo '<option value=10>' . _('Invoices') . '</option>'; + echo '<option value=11>' . _('Credit Notes') . '</option>'; + echo '<option value=12>' . _('Receipts') . '</option>'; echo '</select></td></tr>'; - echo "</select></td></tr></table><br><div class='centre'><input type=submit name='Go' value='" . _('Create PDF') . "'></div>"; + echo '</select></td></tr> + </table> + <br /><div class="centre"><input type="submit" name="Go" value="' . _('Create PDF') . '"></div>'; - include('includes/footer.inc'); exit; } else { @@ -73,7 +71,7 @@ include('includes/header.inc'); prnMsg(_('An error occurred getting the transactions'),'error'); if ($Debug==1){ - prnMsg(_('The SQL used to get the transaction information that failed was') . ':<br>' . $SQL,'error'); + prnMsg(_('The SQL used to get the transaction information that failed was') . ':<br />' . $SQL,'error'); } include('includes/footer.inc'); exit; @@ -100,7 +98,7 @@ while ($myrow=DB_fetch_array($result)){ - $sql='SELECT name FROM debtorsmaster WHERE debtorno="'.$myrow['debtorno'].'"'; + $sql="SELECT name FROM debtorsmaster WHERE debtorno='" . $myrow['debtorno'] . "'"; $supplierresult=DB_query($sql, $db); $supplierrow=DB_fetch_array($supplierresult); @@ -126,20 +124,8 @@ $LeftOvers = $pdf->addTextWrap($Left_Margin+452,$YPos,70,$FontSize,number_format(-$TotalCheques,2), 'right'); $LeftOvers = $pdf->addTextWrap($Left_Margin+265,$YPos,300,$FontSize,_('Total') . ' ' . _('Transactions'), 'left'); -/* 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'] . '_CustTransListing_' . date('Y-m-d').'.pdf'; -$pdf->OutputD($ReportFileName);//UldisN -$pdf->__destruct(); //UldisN +$pdf->OutputD($ReportFileName); +$pdf->__destruct(); ?> \ No newline at end of file Modified: trunk/PDFPickingList.php =================================================================== --- trunk/PDFPickingList.php 2011-04-01 20:14:14 UTC (rev 4532) +++ trunk/PDFPickingList.php 2011-04-01 21:44:23 UTC (rev 4533) @@ -2,8 +2,6 @@ /* $Id$*/ -//$PageSecurity = 2; - include('includes/session.inc'); include('includes/SQL_CommonFunctions.inc'); @@ -13,7 +11,7 @@ if ($_SESSION['RequirePickingNote']==0) { $title = _('Picking Lists Not Enabled'); include('includes/header.inc'); - echo '<br>'; + echo '<br />'; prnMsg( _('The system is not configured for picking lists. Please consult your system administrator.'), 'info'); include('includes/footer.inc'); exit; @@ -28,18 +26,19 @@ FROM locations'; $result=DB_query($sql, $db); echo '<p class="page_title_text"><img src="'.$rootpath.'/css/'.$theme.'/images/sales.png" title="' . _('Search') . '" alt="" />' . ' ' . $title.'</p><br />'; - echo '<form action=' . $_SERVER['PHP_SELF'] . '?' . SID . ' method=post name="form">'; + echo '<form action="' . $_SERVER['PHP_SELF'] . '" method="post" name="form">'; echo '<input type="hidden" name="FormID" value="' . $_SESSION['FormID'] . '" />'; echo '<table class="selection"><tr>'; echo '<td>'._('Create picking lists for all deliveries to be made on').' : '.'</td>'; echo '<td><input type=text class="date" alt="'.$_SESSION['DefaultDateFormat'].'" name="TransDate" maxlength=10 size=11 value='.date($_SESSION['DefaultDateFormat'], mktime(date('m'),date('Y'),date('d')+1)).'></td></tr>'; - echo '<tr><td>'._('From Warehouse').' : '.'</td><td><select name="loccode">'; + echo '<tr><td>'._('From Warehouse').' : '.'</td> + <td><select name="loccode">'; while ($myrow=DB_fetch_array($result)) { echo '<option value='.$myrow['loccode'].'>'.$myrow['locationname'].'</option>'; } echo '</select></td></tr>'; echo '</table>'; - echo "<br><div class='centre'><input type=submit name=Process value='" . _('Print Picking Lists') . "'></div></form>"; + echo '<br /><div class="centre"><input type="submit" name="Process" value="' . _('Print Picking Lists') . '"></div></form>'; include('includes/footer.inc'); exit(); } @@ -82,7 +81,8 @@ AND salesorders.shipvia=shippers.shipper_id AND salesorders.fromstkloc=locations.loccode AND salesorders.orderno='" . $_GET['TransNo']."'"; -} else if (isset($_POST['TransDate']) or (isset($_GET['TransNo']) and $_GET['TransNo'] != 'Preview')) { +} else if (isset($_POST['TransDate']) + OR (isset($_GET['TransNo']) AND $_GET['TransNo'] != 'Preview')) { /* We are printing picking lists for all orders on a day */ $sql = "SELECT salesorders.debtorno, salesorders.orderno, @@ -120,18 +120,19 @@ AND salesorders.deliverydate='" . FormatDateForSQL($_POST['TransDate'])."'"; } -if (isset($_POST['TransDate']) or (isset($_GET['TransNo']) and $_GET['TransNo'] != 'Preview')) { +if (isset($_POST['TransDate']) + OR (isset($_GET['TransNo']) AND $_GET['TransNo'] != 'Preview')) { $result=DB_query($sql,$db, $ErrMsg); /*if there are no rows, there's a problem. */ if (DB_num_rows($result)==0){ $title = _('Print Picking List Error'); include('includes/header.inc'); - echo '<br>'; + echo '<br />'; prnMsg( _('Unable to Locate any orders for this criteria '), 'info'); - echo '<br><table class="selection"><tr><td> - <a href="'. $rootpath . '/PDFPickingList.php?'. SID .'">' . _('Enter Another Date') . '</a> - </td></tr></table><br>'; + echo '<br /><table class="selection"><tr><td> + <a href="'. $rootpath . '/PDFPickingList.php">' . _('Enter Another Date') . '</a> + </td></tr></table><br />'; include('includes/footer.inc'); exit(); } @@ -184,7 +185,7 @@ $pdf->addInfo('Title', _('Picking List') ); $pdf->addInfo('Subject', _('Laser Picking List') ); $FontSize=12; -$ListCount = 0; // UldisN +$ListCount = 0; $Copy=''; $line_height=$FormDesign->LineHeight; @@ -204,9 +205,9 @@ $OrdersToPick[$i]['orderno'] . ' ' . _('from the database'); /* Are there any picking lists for this order already */ - $sql='SELECT COUNT(orderno) + $sql="SELECT COUNT(orderno) FROM pickinglists - WHERE orderno='.$OrdersToPick[$i]['orderno']; + WHERE orderno='" . $OrdersToPick[$i]['orderno'] . "'"; $countresult=DB_query($sql, $db); $count=DB_fetch_row($countresult); if ($count[0]==0) { @@ -325,7 +326,7 @@ include('includes/footer.inc'); exit; } else { - $pdf->OutputD($_SESSION['DatabaseName'] . '_PickingLists_' . date('Y-m-d') . '.pdf');//UldisN - $pdf->__destruct(); //UldisN + $pdf->OutputD($_SESSION['DatabaseName'] . '_PickingLists_' . date('Y-m-d') . '.pdf'); + $pdf->__destruct(); } ?> \ No newline at end of file Modified: trunk/PDFSuppTransListing.php =================================================================== --- trunk/PDFSuppTransListing.php 2011-04-01 20:14:14 UTC (rev 4532) +++ trunk/PDFSuppTransListing.php 2011-04-01 21:44:23 UTC (rev 4533) @@ -2,9 +2,6 @@ /* $Id$*/ -/* $Revision: 1.13 $ */ - -//$PageSecurity = 3; include('includes/SQL_CommonFunctions.inc'); include ('includes/session.inc'); @@ -27,7 +24,7 @@ prnMsg($msg,'error'); } - 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 '<table class=selection> <tr> @@ -39,15 +36,16 @@ echo "<select name='TransType'>"; - echo '<option value=20>' . _('Invoices').'</option>'; - echo '<option value=21>' . _('Credit Notes').'</option>'; - echo '<option value=22>' . _('Payments').'</option>'; + echo '<option value=20>' . _('Invoices') . '</option>'; + echo '<option value=21>' . _('Credit Notes') . '</option>'; + echo '<option value=22>' . _('Payments') . '</option>'; echo '</select></td></tr>'; - echo "</select></td></tr></table><br><div class='centre'><input type=submit name='Go' value='" . _('Create PDF') . "'></div>"; + echo '</select></td></tr> + </table> + <br /><div class="centre"><input type="submit" name="Go" value="' . _('Create PDF') . '"></div>'; - include('includes/footer.inc'); exit; } else { @@ -73,7 +71,7 @@ include('includes/header.inc'); prnMsg(_('An error occurred getting the payments'),'error'); if ($Debug==1){ - prnMsg(_('The SQL used to get the receipt header information that failed was') . ':<br>' . $SQL,'error'); + prnMsg(_('The SQL used to get the receipt header information that failed was') . ':<br />' . $SQL,'error'); } include('includes/footer.inc'); exit; @@ -100,7 +98,7 @@ while ($myrow=DB_fetch_array($result)){ - $sql='SELECT suppname FROM suppliers WHERE supplierid="'.$myrow['supplierno'].'"'; + $sql="SELECT suppname FROM suppliers WHERE supplierid='" . $myrow['supplierno']."'"; $supplierresult=DB_query($sql, $db); $supplierrow=DB_fetch_array($supplierresult); @@ -115,9 +113,9 @@ $TotalCheques = $TotalCheques - $myrow['ovamount']; if ($YPos - (2 *$line_height) < $Bottom_Margin){ - /*Then set up a new page */ - $PageNumber++; - include ('includes/PDFChequeListingPageHeader.inc'); + /*Then set up a new page */ + $PageNumber++; + include ('includes/PDFChequeListingPageHeader.inc'); } /*end of new page header */ } /* end of while there are customer receipts in the batch to print */ @@ -126,20 +124,7 @@ $LeftOvers = $pdf->addTextWrap($Left_Margin+452,$YPos,70,$FontSize,number_format(-$TotalCheques,2), 'right'); $LeftOvers = $pdf->addTextWrap($Left_Margin+265,$YPos,300,$FontSize,_('Total') . ' ' . _('Transactions'), 'left'); -/* 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'] . '_SuppTransListing_' . date('Y-m-d').'.pdf'; -$pdf->OutputD($ReportFileName);//UldisN -$pdf->__destruct(); //UldisN - +$pdf->OutputD($ReportFileName); +$pdf->__destruct(); ?> \ No newline at end of file Modified: trunk/PO_AuthorisationLevels.php =================================================================== --- trunk/PO_AuthorisationLevels.php 2011-04-01 20:14:14 UTC (rev 4532) +++ trunk/PO_AuthorisationLevels.php 2011-04-01 21:44:23 UTC (rev 4533) @@ -2,8 +2,6 @@ /* $Id$*/ -//$PageSecurity=15; - include('includes/session.inc'); $title = _('Purchase Order Authorisation Maintenance'); @@ -16,38 +14,37 @@ $OffHold=1; $AuthLevel=0; if (isset($_POST['Submit'])) { - if (isset($_POST['cancreate']) and $_POST['cancreate']=='on') { - $cancreate=0; + if (isset($_POST['CanCreate']) and $_POST['CanCreate']=='on') { + $CanCreate=0; } else { - $cancreate=1; + $CanCreate=1; } - if (isset($_POST['offhold']) and $_POST['offhold']=='on') { - $offhold=0; + if (isset($_POST['OffHold']) and $_POST['OffHold']=='on') { + $OffHold=0; } else { - $offhold=1; + $OffHold=1; } - if ($_POST['authlevel']=='') { - $_POST['authlevel']=0; + if ($_POST['AuthLevel']=='') { + $_POST['AuthLevel']=0; } $sql="SELECT COUNT(*) FROM purchorderauth - WHERE userid='".$_POST['userid']."' - AND currabrev='".$_POST['currabrev']."'"; + WHERE userid='" . $_POST['UserID'] . "' + AND currabrev='" . $_POST['CurrCode'] . "'"; $result=DB_query($sql, $db); $myrow=DB_fetch_array($result); if ($myrow[0]==0) { - $sql="INSERT INTO purchorderauth ( - userid, - currabrev, - cancreate, - offhold, - authlevel) - VALUES( - '".$_POST['userid']."', - '".$_POST['currabrev']."', - '".$cancreate."', - '".$offhold."', - '".$_POST['authlevel']."')"; + $sql="INSERT INTO purchorderauth ( userid, + currabrev, + cancreate, + offhold, + authlevel) + VALUES( + '".$_POST['UserID']."', + '".$_POST['CurrCode']."', + '".$CanCreate."', + '".$OffHold."', + '".$_POST['AuthLevel']."')"; $ErrMsg = _('The authentication details cannot be inserted because'); $Result=DB_query($sql,$db,$ErrMsg); } else { @@ -57,22 +54,22 @@ } if (isset($_POST['Update'])) { - if (isset($_POST['cancreate']) and $_POST['cancreate']=='on') { - $cancreate=0; + if (isset($_POST['CanCreate']) and $_POST['CanCreate']=='on') { + $CanCreate=0; } else { - $cancreate=1; + $CanCreate=1; } - if (isset($_POST['offhold']) and $_POST['offhold']=='on') { - $offhold=0; + if (isset($_POST['OffHold']) and $_POST['OffHold']=='on') { + $OffHold=0; } else { - $offhold=1; + $OffHold=1; } $sql="UPDATE purchorderauth SET - cancreate='".$cancreate."', - offhold='".$offhold."', - authlevel='".$_POST['authlevel']."' - WHERE userid='".$_POST['userid']."' - AND currabrev='".$_POST['currabrev']."'"; + cancreate='".$CanCreate."', + offhold='".$OffHold."', + authlevel='".$_POST['AuthLevel']."' + WHERE userid='".$_POST['UserID']."' + AND currabrev='".$_POST['CurrCode']."'"; $ErrMsg = _('The authentication details cannot be updated because'); $Result=DB_query($sql,$db,$ErrMsg); @@ -99,68 +96,69 @@ $myrow=DB_fetch_array($result); $UserID=$_GET['UserID']; $Currency=$_GET['Currency']; - $CanCreate=$myrow['cancreate']; + $CanCreate=$myrow['CanCreate']; $OffHold=$myrow['offhold']; $AuthLevel=$myrow['authlevel']; } -$sql="SELECT - purchorderauth.userid, - www_users.realname, - currencies.currabrev, - currencies.currency, - purchorderauth.cancreate, - purchorderauth.offhold, - purchorderauth.authlevel - FROM (purchorderauth - LEFT JOIN www_users ON purchorderauth.userid=www_users.userid) - LEFT JOIN currencies ON purchorderauth.currabrev=currencies.currabrev"; +$sql='SELECT purchorderauth.userid, + www_users.realname, + currencies.currabrev, + currencies.currency, + purchorderauth.cancreate, + purchorderauth.offhold, + purchorderauth.authlevel + FROM purchorderauth INNER JOIN www_users + ON purchorderauth.userid=www_users.userid + INNER JOIN currencies + ON purchorderauth.currabrev=currencies.currabrev'; $ErrMsg = _('The authentication details cannot be retrieved because'); $Result=DB_query($sql,$db,$ErrMsg); -echo '<table class=selection><tr>'; -echo '<th>'._('User ID').'</th>'; -echo '<th>'._('User Name').'</th>'; -echo '<th>'._('Currency').'</th>'; -echo '<th>'._('Create Order').'</th>'; -echo '<th>'._('Can Release').'<br />'. _('Invoices').'</th>'; -echo '<th>'._('Authority Level').'</th></tr>'; +echo '<table class="selection"><tr> + <th>' . _('User ID') . '</th> + <th>' . _('User Name') . '</th> + <th>' . _('Currency') . '</th> + <th>' . _('Create Order') . '</th> + <th>' . _('Can Release') . '<br />'. _('Invoices').'</th> + <th>' . _('Authority Level') . '</th></tr>'; while ($myrow=DB_fetch_array($Result)) { if ($myrow['cancreate']==0) { - $cancreate=_('Yes'); + $CanCreate=_('Yes'); } else { - $cancreate=_('No'); + $CanCreate=_('No'); } if ($myrow['offhold']==0) { - $offhold=_('Yes'); + $OffHold=_('Yes'); } else { - $offhold=_('No'); + $OffHold=_('No'); } - echo '<tr><td>'.$myrow['userid'].'</td>'; - echo '<td>'.$myrow['realname'].'</td>'; - echo '<td>'.$myrow['currency'].'</td>'; - echo '<td>'.$cancreate.'</td>'; - echo '<td>'.$offhold.'</td>'; - echo '<td class="number">'.number_format($myrow['authlevel'],2).'</td>'; - echo '<td><a href="'.$rootpath.'/PO_AuthorisationLevels.php?' . SID . 'Edit=Yes&UserID=' . $myrow['userid'] . - '&Currency='.$myrow['currabrev'].'">'._('Edit').'</td>'; - echo '<td><a href="'.$rootpath.'/PO_AuthorisationLevels.php?' . SID . 'Delete=Yes&UserID=' . $myrow['userid'] . - '&Currency='.$myrow['currabrev'].'">'._('Delete').'</td></tr>'; + echo '<tr><td>' . $myrow['userid'] . '</td> + <td>' . $myrow['realname'] . '</td> + <td>' . $myrow['currency'] . '</td> + <td>' . $CanCreate . '</td> + <td>' . $OffHold . '</td> + <td class="number">'.number_format($myrow['authlevel'],2).'</td> + <td><a href="'.$rootpath.'/PO_AuthorisationLevels.php?Edit=Yes&UserID=' . $myrow['userid'] . + '&Currency='.$myrow['currabrev'].'">'._('Edit').'</td> + <td><a href="'.$rootpath.'/PO_AuthorisationLevels.php?Delete=Yes&UserID=' . $myrow['userid'] . + '&Currency='.$myrow['currabrev'].'">'._('Delete').'</td> + </tr>'; } echo '</table><br><br>'; -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 '<table class=selection>'; if (isset($_GET['Edit'])) { echo '<tr><td>'._('User ID').'</td><td>'.$UserID.'</td></tr>'; - echo '<input type=hidden name=userid value="'.$UserID.'"'; + echo '<input type=hidden name=UserID value="'.$UserID.'"'; } else { - echo '<tr><td>'._('User ID').'</td><td><select name=userid>'; + echo '<tr><td>'._('User ID').'</td><td><select name=UserID>'; $usersql='SELECT userid FROM www_users'; $userresult=DB_query($usersql,$db); while ($myrow=DB_fetch_array($userresult)) { @@ -174,13 +172,14 @@ } if (isset($_GET['Edit'])) { - $currencysql='SELECT currency FROM currencies WHERE currabrev="'.$Currency.'"'; - $currencyresult=DB_query($currencysql,$db); - $myrow=DB_fetch_array($currencyresult); - echo '<tr><td>'._('Currency').'</td><td>'.$myrow['currency'].'</td></tr>'; - echo '<input type=hidden name=currabrev value="'.$Currency.'"'; + $CurrencySQL="SELECT currency FROM currencies WHERE currabrev='".$Currency."'"; + $CurrencyResult=DB_query($CurrencySQL,$db); + $myrow=DB_fetch_array($CurrencyResult); + echo '<tr><td>'._('Currency').'</td> + <td>' . $myrow['currency'] . '</td></tr>'; + echo '<input type=hidden name="currabrev" value="'.$Currency.'"'; } else { - echo '<tr><td>'._('Currency').'</td><td><select name=currabrev>'; + echo '<tr><td>'._('Currency').'</td><td><select name="CurrCode">'; $currencysql='SELECT currabrev,currency FROM currencies'; $currencyresult=DB_query($currencysql,$db); while ($myrow=DB_fetch_array($currencyresult)) { @@ -195,20 +194,20 @@ echo '<tr><td>'._('User can create orders').'</td>'; if ($CanCreate==1) { - echo '<td><input type=checkbox name=cancreate></td></tr>'; + echo '<td><input type=checkbox name="CanCreate"></td></tr>'; } else { - echo '<td><input type=checkbox checked name=cancreate></td></tr>'; + echo '<td><input type=checkbox checked name="CanCreate"></td></tr>'; } echo '<tr><td>'._('User can release invoices').'</td>'; if ($OffHold==1) { - echo '<td><input type=checkbox name=offhold></td></tr>'; + echo '<td><input type=checkbox name="OffHold"></td></tr>'; } else { - echo '<td><input type=checkbox checked name=offhold></td></tr>'; + echo '<td><input type=checkbox checked name="OffHold"></td></tr>'; } echo '<tr><td>'._('User can authorise orders up to :').'</td>'; -echo '<td><input type=input name=authlevel size=11 class=number value='.$AuthLevel.'></td</tr>'; +echo '<td><input type=input name="AuthLevel" size=11 class="number" value="' . $AuthLevel . '"></td</tr>'; echo '</table>'; if (isset($_GET['Edit'])) { This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <dai...@us...> - 2011-04-01 21:44:32
|
Revision: 4533 http://web-erp.svn.sourceforge.net/web-erp/?rev=4533&view=rev Author: daintree Date: 2011-04-01 21:44:23 +0000 (Fri, 01 Apr 2011) Log Message: ----------- More SQL quoting and xhtml fixes Modified Paths: -------------- trunk/PDFCustTransListing.php trunk/PDFPickingList.php trunk/PDFSuppTransListing.php trunk/PO_AuthorisationLevels.php Modified: trunk/PDFCustTransListing.php =================================================================== --- trunk/PDFCustTransListing.php 2011-04-01 20:14:14 UTC (rev 4532) +++ trunk/PDFCustTransListing.php 2011-04-01 21:44:23 UTC (rev 4533) @@ -2,9 +2,6 @@ /* $Id$*/ -/* $Revision: 1.13 $ */ - -//$PageSecurity = 3; include('includes/SQL_CommonFunctions.inc'); include ('includes/session.inc'); @@ -27,7 +24,7 @@ prnMsg($msg,'error'); } - 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 '<table class=selection> <tr> @@ -37,17 +34,18 @@ echo '<tr><td>' . _('Transaction type') . '</td><td>'; - echo "<select name='TransType'>"; + echo '<select name="TransType">'; - echo '<option value=10>' . _('Invoices').'</option>'; - echo '<option value=11>' . _('Credit Notes').'</option>'; - echo '<option value=12>' . _('Receipts').'</option>'; + echo '<option value=10>' . _('Invoices') . '</option>'; + echo '<option value=11>' . _('Credit Notes') . '</option>'; + echo '<option value=12>' . _('Receipts') . '</option>'; echo '</select></td></tr>'; - echo "</select></td></tr></table><br><div class='centre'><input type=submit name='Go' value='" . _('Create PDF') . "'></div>"; + echo '</select></td></tr> + </table> + <br /><div class="centre"><input type="submit" name="Go" value="' . _('Create PDF') . '"></div>'; - include('includes/footer.inc'); exit; } else { @@ -73,7 +71,7 @@ include('includes/header.inc'); prnMsg(_('An error occurred getting the transactions'),'error'); if ($Debug==1){ - prnMsg(_('The SQL used to get the transaction information that failed was') . ':<br>' . $SQL,'error'); + prnMsg(_('The SQL used to get the transaction information that failed was') . ':<br />' . $SQL,'error'); } include('includes/footer.inc'); exit; @@ -100,7 +98,7 @@ while ($myrow=DB_fetch_array($result)){ - $sql='SELECT name FROM debtorsmaster WHERE debtorno="'.$myrow['debtorno'].'"'; + $sql="SELECT name FROM debtorsmaster WHERE debtorno='" . $myrow['debtorno'] . "'"; $supplierresult=DB_query($sql, $db); $supplierrow=DB_fetch_array($supplierresult); @@ -126,20 +124,8 @@ $LeftOvers = $pdf->addTextWrap($Left_Margin+452,$YPos,70,$FontSize,number_format(-$TotalCheques,2), 'right'); $LeftOvers = $pdf->addTextWrap($Left_Margin+265,$YPos,300,$FontSize,_('Total') . ' ' . _('Transactions'), 'left'); -/* 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'] . '_CustTransListing_' . date('Y-m-d').'.pdf'; -$pdf->OutputD($ReportFileName);//UldisN -$pdf->__destruct(); //UldisN +$pdf->OutputD($ReportFileName); +$pdf->__destruct(); ?> \ No newline at end of file Modified: trunk/PDFPickingList.php =================================================================== --- trunk/PDFPickingList.php 2011-04-01 20:14:14 UTC (rev 4532) +++ trunk/PDFPickingList.php 2011-04-01 21:44:23 UTC (rev 4533) @@ -2,8 +2,6 @@ /* $Id$*/ -//$PageSecurity = 2; - include('includes/session.inc'); include('includes/SQL_CommonFunctions.inc'); @@ -13,7 +11,7 @@ if ($_SESSION['RequirePickingNote']==0) { $title = _('Picking Lists Not Enabled'); include('includes/header.inc'); - echo '<br>'; + echo '<br />'; prnMsg( _('The system is not configured for picking lists. Please consult your system administrator.'), 'info'); include('includes/footer.inc'); exit; @@ -28,18 +26,19 @@ FROM locations'; $result=DB_query($sql, $db); echo '<p class="page_title_text"><img src="'.$rootpath.'/css/'.$theme.'/images/sales.png" title="' . _('Search') . '" alt="" />' . ' ' . $title.'</p><br />'; - echo '<form action=' . $_SERVER['PHP_SELF'] . '?' . SID . ' method=post name="form">'; + echo '<form action="' . $_SERVER['PHP_SELF'] . '" method="post" name="form">'; echo '<input type="hidden" name="FormID" value="' . $_SESSION['FormID'] . '" />'; echo '<table class="selection"><tr>'; echo '<td>'._('Create picking lists for all deliveries to be made on').' : '.'</td>'; echo '<td><input type=text class="date" alt="'.$_SESSION['DefaultDateFormat'].'" name="TransDate" maxlength=10 size=11 value='.date($_SESSION['DefaultDateFormat'], mktime(date('m'),date('Y'),date('d')+1)).'></td></tr>'; - echo '<tr><td>'._('From Warehouse').' : '.'</td><td><select name="loccode">'; + echo '<tr><td>'._('From Warehouse').' : '.'</td> + <td><select name="loccode">'; while ($myrow=DB_fetch_array($result)) { echo '<option value='.$myrow['loccode'].'>'.$myrow['locationname'].'</option>'; } echo '</select></td></tr>'; echo '</table>'; - echo "<br><div class='centre'><input type=submit name=Process value='" . _('Print Picking Lists') . "'></div></form>"; + echo '<br /><div class="centre"><input type="submit" name="Process" value="' . _('Print Picking Lists') . '"></div></form>'; include('includes/footer.inc'); exit(); } @@ -82,7 +81,8 @@ AND salesorders.shipvia=shippers.shipper_id AND salesorders.fromstkloc=locations.loccode AND salesorders.orderno='" . $_GET['TransNo']."'"; -} else if (isset($_POST['TransDate']) or (isset($_GET['TransNo']) and $_GET['TransNo'] != 'Preview')) { +} else if (isset($_POST['TransDate']) + OR (isset($_GET['TransNo']) AND $_GET['TransNo'] != 'Preview')) { /* We are printing picking lists for all orders on a day */ $sql = "SELECT salesorders.debtorno, salesorders.orderno, @@ -120,18 +120,19 @@ AND salesorders.deliverydate='" . FormatDateForSQL($_POST['TransDate'])."'"; } -if (isset($_POST['TransDate']) or (isset($_GET['TransNo']) and $_GET['TransNo'] != 'Preview')) { +if (isset($_POST['TransDate']) + OR (isset($_GET['TransNo']) AND $_GET['TransNo'] != 'Preview')) { $result=DB_query($sql,$db, $ErrMsg); /*if there are no rows, there's a problem. */ if (DB_num_rows($result)==0){ $title = _('Print Picking List Error'); include('includes/header.inc'); - echo '<br>'; + echo '<br />'; prnMsg( _('Unable to Locate any orders for this criteria '), 'info'); - echo '<br><table class="selection"><tr><td> - <a href="'. $rootpath . '/PDFPickingList.php?'. SID .'">' . _('Enter Another Date') . '</a> - </td></tr></table><br>'; + echo '<br /><table class="selection"><tr><td> + <a href="'. $rootpath . '/PDFPickingList.php">' . _('Enter Another Date') . '</a> + </td></tr></table><br />'; include('includes/footer.inc'); exit(); } @@ -184,7 +185,7 @@ $pdf->addInfo('Title', _('Picking List') ); $pdf->addInfo('Subject', _('Laser Picking List') ); $FontSize=12; -$ListCount = 0; // UldisN +$ListCount = 0; $Copy=''; $line_height=$FormDesign->LineHeight; @@ -204,9 +205,9 @@ $OrdersToPick[$i]['orderno'] . ' ' . _('from the database'); /* Are there any picking lists for this order already */ - $sql='SELECT COUNT(orderno) + $sql="SELECT COUNT(orderno) FROM pickinglists - WHERE orderno='.$OrdersToPick[$i]['orderno']; + WHERE orderno='" . $OrdersToPick[$i]['orderno'] . "'"; $countresult=DB_query($sql, $db); $count=DB_fetch_row($countresult); if ($count[0]==0) { @@ -325,7 +326,7 @@ include('includes/footer.inc'); exit; } else { - $pdf->OutputD($_SESSION['DatabaseName'] . '_PickingLists_' . date('Y-m-d') . '.pdf');//UldisN - $pdf->__destruct(); //UldisN + $pdf->OutputD($_SESSION['DatabaseName'] . '_PickingLists_' . date('Y-m-d') . '.pdf'); + $pdf->__destruct(); } ?> \ No newline at end of file Modified: trunk/PDFSuppTransListing.php =================================================================== --- trunk/PDFSuppTransListing.php 2011-04-01 20:14:14 UTC (rev 4532) +++ trunk/PDFSuppTransListing.php 2011-04-01 21:44:23 UTC (rev 4533) @@ -2,9 +2,6 @@ /* $Id$*/ -/* $Revision: 1.13 $ */ - -//$PageSecurity = 3; include('includes/SQL_CommonFunctions.inc'); include ('includes/session.inc'); @@ -27,7 +24,7 @@ prnMsg($msg,'error'); } - 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 '<table class=selection> <tr> @@ -39,15 +36,16 @@ echo "<select name='TransType'>"; - echo '<option value=20>' . _('Invoices').'</option>'; - echo '<option value=21>' . _('Credit Notes').'</option>'; - echo '<option value=22>' . _('Payments').'</option>'; + echo '<option value=20>' . _('Invoices') . '</option>'; + echo '<option value=21>' . _('Credit Notes') . '</option>'; + echo '<option value=22>' . _('Payments') . '</option>'; echo '</select></td></tr>'; - echo "</select></td></tr></table><br><div class='centre'><input type=submit name='Go' value='" . _('Create PDF') . "'></div>"; + echo '</select></td></tr> + </table> + <br /><div class="centre"><input type="submit" name="Go" value="' . _('Create PDF') . '"></div>'; - include('includes/footer.inc'); exit; } else { @@ -73,7 +71,7 @@ include('includes/header.inc'); prnMsg(_('An error occurred getting the payments'),'error'); if ($Debug==1){ - prnMsg(_('The SQL used to get the receipt header information that failed was') . ':<br>' . $SQL,'error'); + prnMsg(_('The SQL used to get the receipt header information that failed was') . ':<br />' . $SQL,'error'); } include('includes/footer.inc'); exit; @@ -100,7 +98,7 @@ while ($myrow=DB_fetch_array($result)){ - $sql='SELECT suppname FROM suppliers WHERE supplierid="'.$myrow['supplierno'].'"'; + $sql="SELECT suppname FROM suppliers WHERE supplierid='" . $myrow['supplierno']."'"; $supplierresult=DB_query($sql, $db); $supplierrow=DB_fetch_array($supplierresult); @@ -115,9 +113,9 @@ $TotalCheques = $TotalCheques - $myrow['ovamount']; if ($YPos - (2 *$line_height) < $Bottom_Margin){ - /*Then set up a new page */ - $PageNumber++; - include ('includes/PDFChequeListingPageHeader.inc'); + /*Then set up a new page */ + $PageNumber++; + include ('includes/PDFChequeListingPageHeader.inc'); } /*end of new page header */ } /* end of while there are customer receipts in the batch to print */ @@ -126,20 +124,7 @@ $LeftOvers = $pdf->addTextWrap($Left_Margin+452,$YPos,70,$FontSize,number_format(-$TotalCheques,2), 'right'); $LeftOvers = $pdf->addTextWrap($Left_Margin+265,$YPos,300,$FontSize,_('Total') . ' ' . _('Transactions'), 'left'); -/* 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'] . '_SuppTransListing_' . date('Y-m-d').'.pdf'; -$pdf->OutputD($ReportFileName);//UldisN -$pdf->__destruct(); //UldisN - +$pdf->OutputD($ReportFileName); +$pdf->__destruct(); ?> \ No newline at end of file Modified: trunk/PO_AuthorisationLevels.php =================================================================== --- trunk/PO_AuthorisationLevels.php 2011-04-01 20:14:14 UTC (rev 4532) +++ trunk/PO_AuthorisationLevels.php 2011-04-01 21:44:23 UTC (rev 4533) @@ -2,8 +2,6 @@ /* $Id$*/ -//$PageSecurity=15; - include('includes/session.inc'); $title = _('Purchase Order Authorisation Maintenance'); @@ -16,38 +14,37 @@ $OffHold=1; $AuthLevel=0; if (isset($_POST['Submit'])) { - if (isset($_POST['cancreate']) and $_POST['cancreate']=='on') { - $cancreate=0; + if (isset($_POST['CanCreate']) and $_POST['CanCreate']=='on') { + $CanCreate=0; } else { - $cancreate=1; + $CanCreate=1; } - if (isset($_POST['offhold']) and $_POST['offhold']=='on') { - $offhold=0; + if (isset($_POST['OffHold']) and $_POST['OffHold']=='on') { + $OffHold=0; } else { - $offhold=1; + $OffHold=1; } - if ($_POST['authlevel']=='') { - $_POST['authlevel']=0; + if ($_POST['AuthLevel']=='') { + $_POST['AuthLevel']=0; } $sql="SELECT COUNT(*) FROM purchorderauth - WHERE userid='".$_POST['userid']."' - AND currabrev='".$_POST['currabrev']."'"; + WHERE userid='" . $_POST['UserID'] . "' + AND currabrev='" . $_POST['CurrCode'] . "'"; $result=DB_query($sql, $db); $myrow=DB_fetch_array($result); if ($myrow[0]==0) { - $sql="INSERT INTO purchorderauth ( - userid, - currabrev, - cancreate, - offhold, - authlevel) - VALUES( - '".$_POST['userid']."', - '".$_POST['currabrev']."', - '".$cancreate."', - '".$offhold."', - '".$_POST['authlevel']."')"; + $sql="INSERT INTO purchorderauth ( userid, + currabrev, + cancreate, + offhold, + authlevel) + VALUES( + '".$_POST['UserID']."', + '".$_POST['CurrCode']."', + '".$CanCreate."', + '".$OffHold."', + '".$_POST['AuthLevel']."')"; $ErrMsg = _('The authentication details cannot be inserted because'); $Result=DB_query($sql,$db,$ErrMsg); } else { @@ -57,22 +54,22 @@ } if (isset($_POST['Update'])) { - if (isset($_POST['cancreate']) and $_POST['cancreate']=='on') { - $cancreate=0; + if (isset($_POST['CanCreate']) and $_POST['CanCreate']=='on') { + $CanCreate=0; } else { - $cancreate=1; + $CanCreate=1; } - if (isset($_POST['offhold']) and $_POST['offhold']=='on') { - $offhold=0; + if (isset($_POST['OffHold']) and $_POST['OffHold']=='on') { + $OffHold=0; } else { - $offhold=1; + $OffHold=1; } $sql="UPDATE purchorderauth SET - cancreate='".$cancreate."', - offhold='".$offhold."', - authlevel='".$_POST['authlevel']."' - WHERE userid='".$_POST['userid']."' - AND currabrev='".$_POST['currabrev']."'"; + cancreate='".$CanCreate."', + offhold='".$OffHold."', + authlevel='".$_POST['AuthLevel']."' + WHERE userid='".$_POST['UserID']."' + AND currabrev='".$_POST['CurrCode']."'"; $ErrMsg = _('The authentication details cannot be updated because'); $Result=DB_query($sql,$db,$ErrMsg); @@ -99,68 +96,69 @@ $myrow=DB_fetch_array($result); $UserID=$_GET['UserID']; $Currency=$_GET['Currency']; - $CanCreate=$myrow['cancreate']; + $CanCreate=$myrow['CanCreate']; $OffHold=$myrow['offhold']; $AuthLevel=$myrow['authlevel']; } -$sql="SELECT - purchorderauth.userid, - www_users.realname, - currencies.currabrev, - currencies.currency, - purchorderauth.cancreate, - purchorderauth.offhold, - purchorderauth.authlevel - FROM (purchorderauth - LEFT JOIN www_users ON purchorderauth.userid=www_users.userid) - LEFT JOIN currencies ON purchorderauth.currabrev=currencies.currabrev"; +$sql='SELECT purchorderauth.userid, + www_users.realname, + currencies.currabrev, + currencies.currency, + purchorderauth.cancreate, + purchorderauth.offhold, + purchorderauth.authlevel + FROM purchorderauth INNER JOIN www_users + ON purchorderauth.userid=www_users.userid + INNER JOIN currencies + ON purchorderauth.currabrev=currencies.currabrev'; $ErrMsg = _('The authentication details cannot be retrieved because'); $Result=DB_query($sql,$db,$ErrMsg); -echo '<table class=selection><tr>'; -echo '<th>'._('User ID').'</th>'; -echo '<th>'._('User Name').'</th>'; -echo '<th>'._('Currency').'</th>'; -echo '<th>'._('Create Order').'</th>'; -echo '<th>'._('Can Release').'<br />'. _('Invoices').'</th>'; -echo '<th>'._('Authority Level').'</th></tr>'; +echo '<table class="selection"><tr> + <th>' . _('User ID') . '</th> + <th>' . _('User Name') . '</th> + <th>' . _('Currency') . '</th> + <th>' . _('Create Order') . '</th> + <th>' . _('Can Release') . '<br />'. _('Invoices').'</th> + <th>' . _('Authority Level') . '</th></tr>'; while ($myrow=DB_fetch_array($Result)) { if ($myrow['cancreate']==0) { - $cancreate=_('Yes'); + $CanCreate=_('Yes'); } else { - $cancreate=_('No'); + $CanCreate=_('No'); } if ($myrow['offhold']==0) { - $offhold=_('Yes'); + $OffHold=_('Yes'); } else { - $offhold=_('No'); + $OffHold=_('No'); } - echo '<tr><td>'.$myrow['userid'].'</td>'; - echo '<td>'.$myrow['realname'].'</td>'; - echo '<td>'.$myrow['currency'].'</td>'; - echo '<td>'.$cancreate.'</td>'; - echo '<td>'.$offhold.'</td>'; - echo '<td class="number">'.number_format($myrow['authlevel'],2).'</td>'; - echo '<td><a href="'.$rootpath.'/PO_AuthorisationLevels.php?' . SID . 'Edit=Yes&UserID=' . $myrow['userid'] . - '&Currency='.$myrow['currabrev'].'">'._('Edit').'</td>'; - echo '<td><a href="'.$rootpath.'/PO_AuthorisationLevels.php?' . SID . 'Delete=Yes&UserID=' . $myrow['userid'] . - '&Currency='.$myrow['currabrev'].'">'._('Delete').'</td></tr>'; + echo '<tr><td>' . $myrow['userid'] . '</td> + <td>' . $myrow['realname'] . '</td> + <td>' . $myrow['currency'] . '</td> + <td>' . $CanCreate . '</td> + <td>' . $OffHold . '</td> + <td class="number">'.number_format($myrow['authlevel'],2).'</td> + <td><a href="'.$rootpath.'/PO_AuthorisationLevels.php?Edit=Yes&UserID=' . $myrow['userid'] . + '&Currency='.$myrow['currabrev'].'">'._('Edit').'</td> + <td><a href="'.$rootpath.'/PO_AuthorisationLevels.php?Delete=Yes&UserID=' . $myrow['userid'] . + '&Currency='.$myrow['currabrev'].'">'._('Delete').'</td> + </tr>'; } echo '</table><br><br>'; -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 '<table class=selection>'; if (isset($_GET['Edit'])) { echo '<tr><td>'._('User ID').'</td><td>'.$UserID.'</td></tr>'; - echo '<input type=hidden name=userid value="'.$UserID.'"'; + echo '<input type=hidden name=UserID value="'.$UserID.'"'; } else { - echo '<tr><td>'._('User ID').'</td><td><select name=userid>'; + echo '<tr><td>'._('User ID').'</td><td><select name=UserID>'; $usersql='SELECT userid FROM www_users'; $userresult=DB_query($usersql,$db); while ($myrow=DB_fetch_array($userresult)) { @@ -174,13 +172,14 @@ } if (isset($_GET['Edit'])) { - $currencysql='SELECT currency FROM currencies WHERE currabrev="'.$Currency.'"'; - $currencyresult=DB_query($currencysql,$db); - $myrow=DB_fetch_array($currencyresult); - echo '<tr><td>'._('Currency').'</td><td>'.$myrow['currency'].'</td></tr>'; - echo '<input type=hidden name=currabrev value="'.$Currency.'"'; + $CurrencySQL="SELECT currency FROM currencies WHERE currabrev='".$Currency."'"; + $CurrencyResult=DB_query($CurrencySQL,$db); + $myrow=DB_fetch_array($CurrencyResult); + echo '<tr><td>'._('Currency').'</td> + <td>' . $myrow['currency'] . '</td></tr>'; + echo '<input type=hidden name="currabrev" value="'.$Currency.'"'; } else { - echo '<tr><td>'._('Currency').'</td><td><select name=currabrev>'; + echo '<tr><td>'._('Currency').'</td><td><select name="CurrCode">'; $currencysql='SELECT currabrev,currency FROM currencies'; $currencyresult=DB_query($currencysql,$db); while ($myrow=DB_fetch_array($currencyresult)) { @@ -195,20 +194,20 @@ echo '<tr><td>'._('User can create orders').'</td>'; if ($CanCreate==1) { - echo '<td><input type=checkbox name=cancreate></td></tr>'; + echo '<td><input type=checkbox name="CanCreate"></td></tr>'; } else { - echo '<td><input type=checkbox checked name=cancreate></td></tr>'; + echo '<td><input type=checkbox checked name="CanCreate"></td></tr>'; } echo '<tr><td>'._('User can release invoices').'</td>'; if ($OffHold==1) { - echo '<td><input type=checkbox name=offhold></td></tr>'; + echo '<td><input type=checkbox name="OffHold"></td></tr>'; } else { - echo '<td><input type=checkbox checked name=offhold></td></tr>'; + echo '<td><input type=checkbox checked name="OffHold"></td></tr>'; } echo '<tr><td>'._('User can authorise orders up to :').'</td>'; -echo '<td><input type=input name=authlevel size=11 class=number value='.$AuthLevel.'></td</tr>'; +echo '<td><input type=input name="AuthLevel" size=11 class="number" value="' . $AuthLevel . '"></td</tr>'; echo '</table>'; if (isset($_GET['Edit'])) { This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <dai...@us...> - 2011-04-02 09:40:58
|
Revision: 4536 http://web-erp.svn.sourceforge.net/web-erp/?rev=4536&view=rev Author: daintree Date: 2011-04-02 09:40:49 +0000 (Sat, 02 Apr 2011) Log Message: ----------- SQL and xhtml fixes Modified Paths: -------------- trunk/PO_Header.php trunk/PO_Items.php trunk/PricesByCost.php trunk/PrintCustTransPortrait.php trunk/RecurringSalesOrdersProcess.php trunk/SalesGLPostings.php trunk/SalesGraph.php trunk/SelectAsset.php trunk/SelectCreditItems.php trunk/SelectCustomer.php trunk/SelectOrderItems.php trunk/SelectProduct.php Modified: trunk/PO_Header.php =================================================================== --- trunk/PO_Header.php 2011-04-02 01:42:42 UTC (rev 4535) +++ trunk/PO_Header.php 2011-04-02 09:40:49 UTC (rev 4536) @@ -2,8 +2,6 @@ /* $Id PO_Header.php 4183 2010-12-14 09:30:20Z daintree $ */ -//$PageSecurity = 4; now read in from from DB into $_SESSION['PageSecurity'] array and retrieved into a $PageSecuirity variable for the script by session.inc - include('includes/DefinePOClass.php'); include('includes/session.inc'); @@ -86,13 +84,13 @@ if ($_POST['Status'] == 'Authorised') { if ($AuthorityLevel > $OrderTotal) { - $_SESSION['PO'.$identifier]->StatusComments = date($_SESSION['DefaultDateFormat']) . ' - ' . _('Authorised by') . $UserChangedStatus . $_POST['StatusComments'] . '<br>' . html_entity_decode($_POST['StatusCommentsComplete']); + $_SESSION['PO'.$identifier]->StatusComments = date($_SESSION['DefaultDateFormat']) . ' - ' . _('Authorised by') . $UserChangedStatus . $_POST['StatusComments'] . '<br />' . html_entity_decode($_POST['StatusCommentsComplete']); $_SESSION['PO'.$identifier]->AllowPrintPO=1; } else { $OKToUpdateStatus=0; - prnMsg( _('You do not have permission to authorise this purchase order').'.<br>'. _('This order is for').' '. + prnMsg( _('You do not have permission to authorise this purchase order').'.<br />'. _('This order is for').' '. $_SESSION['PO'.$identifier]->CurrCode.' '.$OrderTotal.'. '. - _('You can only authorise up to').' '.$_SESSION['PO'.$identifier]->CurrCode.' '.$AuthorityLevel.'.<br>'. + _('You can only authorise up to').' '.$_SESSION['PO'.$identifier]->CurrCode.' '.$AuthorityLevel.'.<br />'. _('If you think this is a mistake please contact the systems administrator') , 'warn'); } } @@ -111,12 +109,12 @@ } if ($OKToUpdateStatus==1){ // none of the order has been received if ($AuthorityLevel>$OrderTotal) { - $_SESSION['PO'.$identifier]->StatusComments = date($_SESSION['DefaultDateFormat']).' - ' . $_POST['Status'] . ' ' . _('by') . $UserChangedStatus . $_POST['StatusComments'].'<br>' . $_POST['StatusCommentsComplete']; + $_SESSION['PO'.$identifier]->StatusComments = date($_SESSION['DefaultDateFormat']).' - ' . $_POST['Status'] . ' ' . _('by') . $UserChangedStatus . $_POST['StatusComments'].'<br />' . $_POST['StatusCommentsComplete']; } else { $OKToUpdateStatus=0; - prnMsg( _('You do not have permission to reject this purchase order').'.<br>'. _('This order is for').' '. + prnMsg( _('You do not have permission to reject this purchase order').'.<br />'. _('This order is for').' '. $_SESSION['PO'.$identifier]->CurrCode.' '.$OrderTotal.'. '. - _('Your authorisation limit is set at').' '.$_SESSION['PO'.$identifier]->CurrCode.' '.$AuthorityLevel.'.<br>'. + _('Your authorisation limit is set at').' '.$_SESSION['PO'.$identifier]->CurrCode.' '.$AuthorityLevel.'.<br />'. _('If you think this is a mistake please contact the systems administrator') , 'warn'); } } @@ -131,11 +129,11 @@ if (($AuthorityLevel>$OrderTotal OR $_SESSION['UserID']==$_SESSION['PO'.$identifier]->Initiator ) AND $OKToUpdateStatus==1) { - $_SESSION['PO'.$identifier]->StatusComments = date($_SESSION['DefaultDateFormat']).' - ' . _('Order set to pending status by') . $UserChangedStatus . $_POST['StatusComments']. '<br>' .$_POST['StatusCommentsComplete']; + $_SESSION['PO'.$identifier]->StatusComments = date($_SESSION['DefaultDateFormat']).' - ' . _('Order set to pending status by') . $UserChangedStatus . $_POST['StatusComments']. '<br />' .$_POST['StatusCommentsComplete']; } elseif ($AuthorityLevel<$OrderTotal AND $_SESSION['UserID']!=$_SESSION['PO'.$identifier]->Initiator) { $OKToUpdateStatus=0; - prnMsg( _('You do not have permission to change the status of this purchase order').'.<br>'. _('This order is for').' '. $_SESSION['PO'.$identifier]->CurrCode.' '.$OrderTotal.'. '. _('Your authorisation limit is set at').' '.$_SESSION['PO'.$identifier]->CurrCode.' '.$AuthorityLevel.'.<br>'. _('If you think this is a mistake please contact the systems administrator') , 'warn'); + prnMsg( _('You do not have permission to change the status of this purchase order').'.<br />'. _('This order is for').' '. $_SESSION['PO'.$identifier]->CurrCode.' '.$OrderTotal.'. '. _('Your authorisation limit is set at').' '.$_SESSION['PO'.$identifier]->CurrCode.' '.$AuthorityLevel.'.<br />'. _('If you think this is a mistake please contact the systems administrator') , 'warn'); } } @@ -221,7 +219,7 @@ $_SESSION['PO'.$identifier]->AllowPrintPO=1; $sql = "UPDATE purchorders - SET purchorders.allowprint=1 + SET purchorders.allowprint='1' WHERE purchorders.orderno='" . $_SESSION['PO'.$identifier]->OrderNo ."'"; $ErrMsg = _('An error occurred updating the purchase order to allow reprints') . '. ' . _('The error says'); @@ -256,7 +254,8 @@ * code above if a modification to an existing order. Also * $ExistingOrder would be set to 1. The delivery check screen * is where the details of the order are either updated or - * inserted depending on the value of ExistingOrder */ + * inserted depending on the value of ExistingOrder + * */ $_SESSION['ExistingOrder']=0; $_SESSION['PO'.$identifier] = new PurchOrder; @@ -282,9 +281,9 @@ if ($_SESSION['PO'.$identifier]->Any_Already_Received()==0){ $_SESSION['RequireSupplierSelection']=1; $_SESSION['PO'.$identifier]->Status = 'Pending'; - $_SESSION['PO'.$identifier]->StatusComments==date($_SESSION['DefaultDateFormat']).' - ' . _('Supplier changed by') . ' <a href="mailto:'. $_SESSION['UserEmail'] .'">'.$_SESSION['UserID']. '</a> - '.$_POST['StatusComments'].'<br>'.$_POST['StatusCommentsComplete']; + $_SESSION['PO'.$identifier]->StatusComments==date($_SESSION['DefaultDateFormat']).' - ' . _('Supplier changed by') . ' <a href="mailto:'. $_SESSION['UserEmail'] .'">'.$_SESSION['UserID']. '</a> - '.$_POST['StatusComments'].'<br />'.$_POST['StatusCommentsComplete']; } else { - echo '<br><br>'; + echo '<br /><br />'; prnMsg(_('Cannot modify the supplier of the order once some of the order has been received'),'warn'); } } @@ -407,8 +406,8 @@ if (($AuthRow=DB_fetch_array($AuthResult) and $AuthRow['cancreate']==0 ) ) { $_POST['SupplierName'] = $myrow['suppname']; - $_POST['CurrCode'] = $myrow['currcode']; - $_POST['ExRate'] = $myrow['rate']; + $_POST['CurrCode'] = $myrow['currcode']; + $_POST['ExRate'] = $myrow['rate']; $_POST['PaymentTerms']= $myrow['paymentterms']; $_POST['SuppDelAdd1'] = $myrow['address1']; $_POST['SuppDelAdd2'] = $myrow['address2']; @@ -434,7 +433,7 @@ $_SESSION['PO'.$identifier]->SuppTel = $_POST['SuppTel']; $_SESSION['PO'.$identifier]->Port = $_POST['Port']; } else { - prnMsg( _('You do not have the authority to raise Purchase Orders for') . ' ' . $myrow['suppname'] .'. ' . _('Please Consult your system administrator for more information.') . '<br>' . _('You can setup authorisations'). ' ' . '<a href="PO_AuthorisationLevels.php">' . _('here') . '</a>', 'warn'); + prnMsg( _('You do not have the authority to raise Purchase Orders for') . ' ' . $myrow['suppname'] .'. ' . _('Please Consult your system administrator for more information.') . '<br />' . _('You can setup authorisations'). ' ' . '<a href="PO_AuthorisationLevels.php">' . _('here') . '</a>', 'warn'); include('includes/footer.inc'); exit; } @@ -507,7 +506,7 @@ echo '<p class="page_title_text"><img src="'.$rootpath.'/css/'.$theme.'/images/supplier.png" title="' . _('Purchase Order') . '" alt="">' . ' ' . _('Purchase Order: Select Supplier') . ''; - echo "<form action='" . $_SERVER['PHP_SELF'] . '?' . SID . "identifier=".$identifier."' method=post name='choosesupplier'>"; + echo '<form action="' . $_SERVER['PHP_SELF'] . '?identifier=' . $identifier . '" method="post" name="choosesupplier">'; echo '<input type="hidden" name="FormID" value="' . $_SESSION['FormID'] . '" />'; echo '<table cellpadding=3 colspan=4 class=selection> @@ -518,7 +517,7 @@ <td><font size=1>' . _('Enter text extract in the supplier code') . ':</font></td> <td><input type="text" name="SuppCode" size="15" maxlength="18"></td> </tr> - </table><br><div class="centre"> + </table><br /><div class="centre"> <input type="submit" name="SearchSuppliers" value="' . _('Search Now') . '"> <input type="submit" action="reset" value="' . _('Reset') . '"></div>'; @@ -526,7 +525,7 @@ if (isset($result_SuppSelect)) { - echo '<br><table cellpadding=3 colspan=7 class=selection>'; + echo '<br /><table cellpadding=3 colspan=7 class=selection>'; $tableheader = '<tr> <th>' . _('Code') . '</th> @@ -573,7 +572,7 @@ } else { /* everything below here only do if a supplier is selected */ - echo '<form name="form1" action="' . $_SERVER['PHP_SELF'] . '?' . SID . 'identifier=' . $identifier . '" method=post>'; + echo '<form name="form1" action="' . $_SERVER['PHP_SELF'] . '?identifier=' . $identifier . '" method="post">'; echo '<input type="hidden" name="FormID" value="' . $_SESSION['FormID'] . '" />'; echo '<p class="page_title_text"> @@ -591,12 +590,12 @@ prnMsg(_('Purchase Item(s) with this code') . ': ' . $Purch_Item,'info'); echo '<div class="centre">'; - echo '<br><table class="table_index"><tr><td class="menu_group_item">'; + echo '<br /><table class="table_index"><tr><td class="menu_group_item">'; /* the link */ echo '<li><a href="'.$rootpath.'/PO_Items.php?NewItem=' . $Purch_Item . '&identifier=' . $identifier . '">' . _('Enter Line Item to this purchase order') . '</a></li>'; - echo '</td></tr></table></div><br>'; + echo '</td></tr></table></div><br />'; if (isset($_GET['Quantity'])) { $Qty=$_GET['Quantity']; @@ -686,7 +685,7 @@ $_POST['PaymentTerms']=$_SESSION['PO'.$identifier]->PaymentTerms; } - echo '<br><table colspan=1 width=80%> + echo '<br /><table colspan=1 width=80%> <tr> <th><font color=blue size=4><b>' . _('Order Initiation Details') . '</b></font></th> <th><font color=blue size=4><b>' . _('Order Status') . '</b></font></th> @@ -717,12 +716,12 @@ } echo '<tr><td>' . _('Version'). ' #' . ':</td> - <td><input type="hidden" name="Version" size="16" maxlength="15" value="' . $_POST['Version'] . '" />' . $_POST['Version'] . '</td></tr>'; + <td><input type="hidden" name="Version" size="16" maxlength="15" value="' . $_POST['Version'] . '" />' . $_POST['Version'] . '</td></tr>'; echo '<tr><td>' . _('Revised') . ':</td> - <td><input type="hidden" name="Revised" size="11" maxlength="15" value="' . date($_SESSION['DefaultDateFormat']) . '" />' . date($_SESSION['DefaultDateFormat']) . '</td></tr>'; + <td><input type="hidden" name="Revised" size="11" maxlength="15" value="' . date($_SESSION['DefaultDateFormat']) . '" />' . date($_SESSION['DefaultDateFormat']) . '</td></tr>'; echo '<tr><td>' . _('Delivery Date') . ':</td> - <td><input type="text" class="date" alt="' .$_SESSION['DefaultDateFormat'] .'" name="DeliveryDate" size="11" value="' . $_POST['DeliveryDate'] . '" /></td></tr>'; + <td><input type="text" class="date" alt="' .$_SESSION['DefaultDateFormat'] .'" name="DeliveryDate" size="11" value="' . $_POST['DeliveryDate'] . '" /></td></tr>'; if (!isset($_POST['Initiator'])) { $_POST['Initiator'] = $_SESSION['UserID']; @@ -733,7 +732,7 @@ <td><input type="hidden" name="Initiator" size="11" maxlength="10" value="' . $_POST['Initiator'] . '" />' . $_POST['Initiator'] . '</td></tr>'; echo '<tr><td>' . _('Requisition Ref') . ':</td> - <td><input type="text" name="Requisition" size="16" maxlength="15" value="' . $_POST['Requisition'] . '" /></td></tr>'; + <td><input type="text" name="Requisition" size="16" maxlength="15" value="' . $_POST['Requisition'] . '" /></td></tr>'; echo '<tr><td>' . _('Date Printed') . ':</td><td>'; if (isset($_SESSION['PO'.$identifier]->DatePurchaseOrderPrinted) AND strlen($_SESSION['PO'.$identifier]->DatePurchaseOrderPrinted)>6){ @@ -751,13 +750,13 @@ if ($_SESSION['PO'.$identifier]->AllowPrintPO==0 AND empty($_POST['RePrint'])){ echo '<tr><td>' . _('Allow Reprint') . ':</td> - <td><select name="RePrint" onChange="ReloadForm(form1.AllowRePrint)"> - <option selected value="0">' . _('No') . '</option> - <option value="1">' . _('Yes') . '</option> - </select></td>'; + <td><select name="RePrint" onChange="ReloadForm(form1.AllowRePrint)"> + <option selected value="0">' . _('No') . '</option> + <option value="1">' . _('Yes') . '</option> + </select></td>'; echo '<td><input type=submit name="AllowRePrint" value="Update"></td></tr>'; } elseif ($Printed) { - echo '<tr><td colspan=2><a target="_blank" href="' . $rootpath . '/PO_PDFPurchOrder.php?' . SID . 'OrderNo=' . $_SESSION['ExistingOrder'] . '&identifier='.$identifier. '">' . _('Reprint Now') . '</a></td></tr>'; + echo '<tr><td colspan=2><a target="_blank" href="' . $rootpath . '/PO_PDFPurchOrder.php?OrderNo=' . $_SESSION['ExistingOrder'] . '&identifier='.$identifier. '">' . _('Reprint Now') . '</a></td></tr>'; } echo '</table>'; @@ -812,7 +811,7 @@ <td><input type=text name="StatusComments" size=50></td></tr> <tr><td colspan=2><b>' . $_SESSION['PO'.$identifier]->StatusComments .'</b></td></tr>'; //need to use single quotes as double quotes inside the string of StatusComments - echo "<input type='hidden' name='StatusCommentsComplete' value='" . $_SESSION['PO'.$identifier]->StatusComments ."'>"; + echo '<input type="hidden" name="StatusCommentsComplete" value="' . $_SESSION['PO'.$identifier]->StatusComments .'">'; echo '<tr><td><input type="submit" name="UpdateStatus" value="' . _('Status Update') .'"></td>'; } //end its not a new order @@ -965,7 +964,7 @@ while ($ShipperRow=DB_fetch_array($ShipperResult)){ if (isset($_POST['DeliveryBy']) and ($_POST['DeliveryBy'] == $ShipperRow['shipper_id'])) { - echo '<option selected value="' . $ShipperRow['shipper_id'] . "'>" . $ShipperRow['shippername'] . '</option>'; + echo '<option selected value="' . $ShipperRow['shipper_id'] . '">' . $ShipperRow['shippername'] . '</option>'; } else { echo '<option value="' . $ShipperRow['shipper_id'] . '">' . $ShipperRow['shippername'] . '</option>'; } @@ -1010,21 +1009,21 @@ echo '</select> '; echo '</td></tr>'; - echo '<tr><td>' . _('Address') . " 1 :</td> - </td><td><input type='text' name=SuppDelAdd1 size=41 maxlength=40 value='" . $_POST['SuppDelAdd1'] . "'></td> - </tr>"; - echo '<tr><td>' . _('Address') . " 2 :</td> - </td><td><input type='text' name=SuppDelAdd2 size=41 maxlength=40 value='" . $_POST['SuppDelAdd2'] . "'></td> - </tr>"; - echo '<tr><td>' . _('Address') . " 3 :</td> - </td><td><input type='text' name=SuppDelAdd3 size=41 maxlength=40 value='" . $_POST['SuppDelAdd3'] . "'></td> - </tr>"; - echo '<tr><td>' . _('Address') . " 4 :</td> - </td><td><input type='text' name=SuppDelAdd5 size=21 maxlength=20 value='" . $_POST['SuppDelAdd5'] . "'></td> - </tr>"; - echo '<tr><td>' . _('Address') . " 5 :</td> - </td><td><input type='text' name=SuppDelAdd4 size=41 maxlength=40 value='" . $_POST['SuppDelAdd4'] . "'></td> - </tr>"; + echo '<tr><td>' . _('Address') . ' 1 :</td> + </td><td><input type="text" name="SuppDelAdd1" size="41" maxlength="40" value="' . $_POST['SuppDelAdd1'] . '"></td> + </tr>'; + echo '<tr><td>' . _('Address') . ' 2 :</td> + </td><td><input type="text" name="SuppDelAdd2" size="41" maxlength="40" value="' . $_POST['SuppDelAdd2'] . '"></td> + </tr>'; + echo '<tr><td>' . _('Address') . ' 3 :</td> + </td><td><input type="text" name="SuppDelAdd3" size="41" maxlength="40" value="' . $_POST['SuppDelAdd3'] . '"></td> + </tr>'; + echo '<tr><td>' . _('Address') . ' 4 :</td> + </td><td><input type="text" name="SuppDelAdd5" size="21" maxlength="20" value="' . $_POST['SuppDelAdd5'] . '"></td> + </tr>'; + echo '<tr><td>' . _('Address') . ' 5 :</td> + </td><td><input type="text" name="SuppDelAdd4" size="41" maxlength="40" value="' . $_POST['SuppDelAdd4'] . '"></td> + </tr>'; echo '<tr><td>' . _('Phone') . ': </td><td><input type="text" name="SuppTel" size="31" maxlength="30" value="' . $_SESSION['PO'.$identifier]->SuppTel . '"></td> </tr>'; Modified: trunk/PO_Items.php =================================================================== --- trunk/PO_Items.php 2011-04-02 01:42:42 UTC (rev 4535) +++ trunk/PO_Items.php 2011-04-02 09:40:49 UTC (rev 4536) @@ -694,7 +694,7 @@ /* This is where the order as selected should be displayed reflecting any deletions or insertions*/ -echo '<form name="form1" action="' . $_SERVER['PHP_SELF'] . '?' . SID . 'identifier=' . $identifier . '" method=post>'; +echo '<form name="form1" action="' . $_SERVER['PHP_SELF'] . '?identifier=' . $identifier . '" method=post>'; echo '<input type="hidden" name="FormID" value="' . $_SESSION['FormID'] . '" />'; /*need to set up entry for item description where not a stock item and GL Codes */ @@ -777,12 +777,12 @@ if (isset($_POST['NonStockOrder'])) { - echo '<br /><table class=selection><tr><td>'._('Item Description').'</td>'; + echo '<br /><table class=selection><tr><td>' . _('Item Description') . '</td>'; echo '<td><input type=text name=ItemDescription size=40></td></tr>'; - echo '<tr><td>'._('General Ledger Code').'</td>'; + echo '<tr><td>' . _('General Ledger Code') . '</td>'; echo '<td><select name="GLCode">'; $sql='SELECT accountcode, - accountname + accountname FROM chartmaster ORDER BY accountcode ASC'; @@ -848,7 +848,7 @@ AND (purchdata.supplierno='" . $_SESSION['PO'.$identifier]->SupplierID."' OR purchdata.supplierno IS NULL) ORDER BY stockmaster.stockid - LIMIT ".$_SESSION['DefaultDisplayRecordsMax']; + LIMIT " .$_SESSION['DefaultDisplayRecordsMax']; } else { $sql = "SELECT stockmaster.stockid, stockmaster.description, @@ -985,7 +985,7 @@ if (!isset($_GET['Edit'])) { $sql="SELECT categoryid, - categorydescription + categorydescription FROM stockcategory WHERE stocktype<>'L' AND stocktype<>'D' @@ -1027,12 +1027,11 @@ <td><input type='text' name='StockCode' size=15 maxlength=18 value='" . $_POST['StockCode'] . "'></td> </tr> <tr><td></td> - <td><font size=3><b>" . _('OR') . ' </b></font><a target="_blank" href="'.$rootpath.'/Stocks.php?"' . SID . - '">' . _('Create a New Stock Item') . "</a></td></tr> + <td><font size=3><b>" . _('OR') . ' </b></font><a target="_blank" href="'.$rootpath.'/Stocks.php?">' . _('Create a New Stock Item') . '</a></td></tr> </table><br /> - <div class='centre'><input type=submit name='Search' value='" . _('Search Now') . "'> - <input type=submit name='NonStockOrder' value='" . _('Order a non stock item') . "'> - </div><br />"; + <div class="centre"><input type="submit" name="Search" value="' . _('Search Now') . '"> + <input type="submit" name="NonStockOrder" value="' . _('Order a non stock item') . '"> + </div><br />'; $PartsDisplayed =0; } @@ -1066,9 +1065,7 @@ $FileName = $myrow['stockid'] . '.jpg'; if (file_exists( $_SESSION['part_pics_dir'] . '/' . $FileName) ) { - $ImageSource = '<img src="'.$rootpath . '/' . $_SESSION['part_pics_dir'] . '/' . $myrow['stockid'] . - '.jpg" width="50" height="50">'; - + $ImageSource = '<img src="'.$rootpath . '/' . $_SESSION['part_pics_dir'] . '/' . $myrow['stockid'] . '.jpg" width="50" height="50">'; } else { $ImageSource = '<i>'._('No Image').'</i>'; } Modified: trunk/PricesByCost.php =================================================================== --- trunk/PricesByCost.php 2011-04-02 01:42:42 UTC (rev 4535) +++ trunk/PricesByCost.php 2011-04-02 09:40:49 UTC (rev 4536) @@ -1,7 +1,6 @@ <?php /* $Id$ */ -//$PageSecurity = 11; Now from DB include ('includes/session.inc'); $title = _('Update of Prices By A Multiple Of Cost'); include ('includes/header.inc'); @@ -46,48 +45,48 @@ $PriceCounter =0; while ($myrow = DB_fetch_array($result)) { - $SQLTestExists = "SELECT price FROM prices - WHERE stockid = '" . $_POST['StockID_' . $PriceCounter] . "' - AND prices.typeabbrev ='" . $_POST['SalesType'] . "' - AND prices.currabrev ='" . $_POST['CurrCode'] . "' - AND prices.debtorno ='" . $_POST['DebtorNo_' . $PriceCounter] . "' - AND prices.branchcode ='" . $_POST['BranchCode_' . $PriceCounter] . "' - AND prices.startdate ='" . date('Y-m-d') . "'"; - $TestExistsResult = DB_query($SQLTestExists,$db); - if (DB_num_rows($TestExistsResult)==1){ + $SQLTestExists = "SELECT price FROM prices + WHERE stockid = '" . $_POST['StockID_' . $PriceCounter] . "' + AND prices.typeabbrev ='" . $_POST['SalesType'] . "' + AND prices.currabrev ='" . $_POST['CurrCode'] . "' + AND prices.debtorno ='" . $_POST['DebtorNo_' . $PriceCounter] . "' + AND prices.branchcode ='" . $_POST['BranchCode_' . $PriceCounter] . "' + AND prices.startdate ='" . date('Y-m-d') . "'"; + $TestExistsResult = DB_query($SQLTestExists,$db); + if (DB_num_rows($TestExistsResult)==1){ //then we are updating - $SQLUpdate = "UPDATE prices SET price = '" . $_POST['Price_' . $PriceCounter] . "' - WHERE stockid = '" . $_POST['StockID_' . $PriceCounter] . "' - AND prices.typeabbrev ='" . $_POST['SalesType'] . "' + $SQLUpdate = "UPDATE prices SET price = '" . $_POST['Price_' . $PriceCounter] . "' + WHERE stockid = '" . $_POST['StockID_' . $PriceCounter] . "' + AND prices.typeabbrev ='" . $_POST['SalesType'] . "' AND prices.currabrev ='" . $_POST['CurrCode'] . "' AND prices.debtorno ='" . $_POST['DebtorNo_' . $PriceCounter] . "' AND prices.branchcode ='" . $_POST['BranchCode_' . $PriceCounter] . "' AND prices.startdate ='" . date('Y-m-d') . "' AND prices.enddate ='" . $_POST['EndDate_' . $PriceCounter] . "'"; - $ResultUpdate = DB_query($SQLUpdate, $db); - } else { - //we need to add a new price from today - $SQLInsert = "INSERT INTO prices ( - stockid, - price, - typeabbrev, - currabrev, - debtorno, - branchcode, - startdate - ) VALUES ( - '" . $_POST['StockID_' . $PriceCounter] . "', - '" . $_POST['Price_' . $PriceCounter] . "', - '" . $_POST['SalesType'] . "', - '" . $_POST['CurrCode'] . "', - '" . $_POST['DebtorNo_' . $PriceCounter] . "', - '" . $_POST['BranchCode_' . $PriceCounter] . "', - '" . date('Y-m-d') . "' - )"; - $ResultInsert = DB_query($SQLInsert, $db); - } + $ResultUpdate = DB_query($SQLUpdate, $db); + } else { + //we need to add a new price from today + $SQLInsert = "INSERT INTO prices ( + stockid, + price, + typeabbrev, + currabrev, + debtorno, + branchcode, + startdate + ) VALUES ( + '" . $_POST['StockID_' . $PriceCounter] . "', + '" . $_POST['Price_' . $PriceCounter] . "', + '" . $_POST['SalesType'] . "', + '" . $_POST['CurrCode'] . "', + '" . $_POST['DebtorNo_' . $PriceCounter] . "', + '" . $_POST['BranchCode_' . $PriceCounter] . "', + '" . date('Y-m-d') . "' + )"; + $ResultInsert = DB_query($SQLInsert, $db); + } $PriceCounter++; - } + }//end while loop DB_free_result($result); //clear the old result $result = DB_query($sql, $db); //re-run the query with the updated prices $numrow = DB_num_rows($result); // get the new number - should be the same!! @@ -116,24 +115,24 @@ if ($numrow > 0) { //the number of prices returned from the main prices query is echo '<table class=selection>'; echo '<tr><th>' . _('Code') . '</th> - <th>' . _('Description') . '</th> - <th>' . _('Customer') . '</th> - <th>' . _('Branch') . '</th> - <th>' . _('Start Date') . '</th> - <th>' . _('End Date') . '</th> - <th>' . _('Cost') . '</th> - <th>' . _('GP %') . '</th> - <th>' . _('Price Proposed') . '</th> - <th>' . _('List Price') . '</th> - <tr>'; + <th>' . _('Description') . '</th> + <th>' . _('Customer') . '</th> + <th>' . _('Branch') . '</th> + <th>' . _('Start Date') . '</th> + <th>' . _('End Date') . '</th> + <th>' . _('Cost') . '</th> + <th>' . _('GP %') . '</th> + <th>' . _('Price Proposed') . '</th> + <th>' . _('List Price') . '</th> + <tr>'; $k = 0; //row colour counter echo '<form action="' .$_SERVER['PHP_SELF'] .'" method="POST" name="update">'; echo '<input type="hidden" name="FormID" value="' . $_SESSION['FormID'] . '" />'; echo'<input type="hidden" value=' . $_POST['StockCat'] . ' name="StockCat"> - <input type="hidden" value=' . $_POST['Margin'] . ' name="Margin"> - <input type="hidden" value=' . $_POST['CurrCode'] . ' name="CurrCode"> - <input type="hidden" value=' . $_POST['Comparator'] . ' name="Comparator"> - <input type="hidden" value=' . $_POST['SalesType'] . ' name="SalesType">'; + <input type="hidden" value=' . $_POST['Margin'] . ' name="Margin"> + <input type="hidden" value=' . $_POST['CurrCode'] . ' name="CurrCode"> + <input type="hidden" value=' . $_POST['Comparator'] . ' name="Comparator"> + <input type="hidden" value=' . $_POST['SalesType'] . ' name="SalesType">'; $PriceCounter =0; while ($myrow = DB_fetch_array($result)) { @@ -154,10 +153,10 @@ //variables for update echo '<input type="hidden" value=' . $myrow['stockid'] . ' name="StockID_' . $PriceCounter .'"> - <input type="hidden" value=' . $myrow['debtorno'] . ' name="DebtorNo_' . $PriceCounter .'"> - <input type="hidden" value=' . $myrow['branchcode'] . ' name="BranchCode_' . $PriceCounter .'"> - <input type="hidden" value=' . $myrow['startdate'] . ' name="StartDate_' . $PriceCounter .'"> - <input type="hidden" value=' . $myrow['enddate'] . ' name="EndDate_' . $PriceCounter .'">'; + <input type="hidden" value=' . $myrow['debtorno'] . ' name="DebtorNo_' . $PriceCounter .'"> + <input type="hidden" value=' . $myrow['branchcode'] . ' name="BranchCode_' . $PriceCounter .'"> + <input type="hidden" value=' . $myrow['startdate'] . ' name="StartDate_' . $PriceCounter .'"> + <input type="hidden" value=' . $myrow['enddate'] . ' name="EndDate_' . $PriceCounter .'">'; //variable for current margin if ($myrow['price'] != 0){ $CurrentGP = ($myrow['price']-$Cost)*100 / $myrow['price']; @@ -172,25 +171,25 @@ $EndDateDisplay = ConvertSQLDate($myrow['enddate']); } echo ' <td>' . $myrow['stockid'] . '</td> - <td>' . $myrow['description'] . '</td> - <td>' . $myrow['customer'] . '</td> - <td>' . $myrow['branch'] . '</td> - <td>' . ConvertSQLDate($myrow['startdate']) . '</td> - <td>' . $EndDateDisplay . '</td> - <td class="number">' . number_format($Cost, 2) . '</td> - <td class="number">' . number_format($CurrentGP, 1) . '%</td> - <td class="number">' . number_format($Proposed, 2) . '</td> - <td><input type="text" class="number" name="Price_' . $PriceCounter . '" maxlength=14 size=10 value="' . $myrow['price'] . '"></td> - </tr> '; + <td>' . $myrow['description'] . '</td> + <td>' . $myrow['customer'] . '</td> + <td>' . $myrow['branch'] . '</td> + <td>' . ConvertSQLDate($myrow['startdate']) . '</td> + <td>' . $EndDateDisplay . '</td> + <td class="number">' . number_format($Cost, 2) . '</td> + <td class="number">' . number_format($CurrentGP, 1) . '%</td> + <td class="number">' . number_format($Proposed, 2) . '</td> + <td><input type="text" class="number" name="Price_' . $PriceCounter . '" maxlength=14 size=10 value="' . $myrow['price'] . '"></td> + </tr> '; $PriceCounter++; } //end of looping echo '<tr> <td style="text-align:right" colspan=4><input type=submit name=submit value=' . _('Update') . '></td> - <td style="text-align:left" colspan=3><a href="' . $_SERVER['PHP_SELF'] . '?' . SID . '"><input type=submit value=' . _('Back') . '><a/></td> + <td style="text-align:left" colspan=3><a href="' . $_SERVER['PHP_SELF'] . '"><input type=submit value=' . _('Back') . '><a/></td> </tr></form>'; } else { prnMsg(_('There were no prices meeting the criteria specified to review'),'info'); - echo '<p><div class="centre"><a href="' . $_SERVER['PHP_SELF'] . '?' . SID . '">' . _('Back') . '<a/></div><p>'; + echo '<p><div class="centre"><a href="' . $_SERVER['PHP_SELF'] . '">' . _('Back') . '<a/></div><p>'; } } else { /*The option to submit was not hit so display form */ echo '<div class="page_help_text">' . _('Use this report to display price list with the cost.') . '</div><br>'; @@ -206,13 +205,13 @@ <td><select name="StockCat">'; echo '<option value="all">' . _('All Categories') . ''; while ($myrow1 = DB_fetch_array($result1)) { - echo '<option value="' . $myrow1['categoryid'] . '">' . $myrow1['categorydescription']; + echo '<option value="' . $myrow1['categoryid'] . '">' . $myrow1['categorydescription'] . '</option>'; } echo '</select></td></tr>'; echo '<tr><td>' . _('Price') . ' <select name="Comparator">'; - echo '<option value="1">' . _('Less than or equal to') . ''; - echo '<option value="2">' . _('Greater than or equal to') . ''; + echo '<option value="1">' . _('Less than or equal to') . '</option>'; + echo '<option value="2">' . _('Greater than or equal to') . '</option>'; if ($_SESSION['WeightedAverageCosting']==1) { echo '</select>'.' '. _('Average Cost') . ' x </td>'; } else { @@ -221,23 +220,22 @@ if (!isset($_POST['Margin'])){ $_POST['Margin']=1; } - echo '<td> - <input type="text" class="number" name="Margin" MAXLENGTH =8 size=8 value=' .$_POST['Margin'] . '></td></tr>'; + echo '<td><input type="text" class="number" name="Margin" MAXLENGTH =8 size=8 value=' .$_POST['Margin'] . '></td></tr>'; $result = DB_query('SELECT typeabbrev, sales_type FROM salestypes ', $db); - echo '<tr><td>' . _('Sales Type') . '/' . _('Price List') . ":</td> - <td><select name='SalesType'>"; + echo '<tr><td>' . _('Sales Type') . '/' . _('Price List') . ':</td> + <td><select name="SalesType">'; while ($myrow = DB_fetch_array($result)) { if ($_POST['SalesType'] == $myrow['typeabbrev']) { - echo "<option selected value='" . $myrow['typeabbrev'] . "'>" . $myrow['sales_type'] . '</option>'; + echo '<option selected value="' . $myrow['typeabbrev'] . '">' . $myrow['sales_type'] . '</option>'; } else { - echo "<option value='" . $myrow['typeabbrev'] . "'>" . $myrow['sales_type'] . '</option>'; + echo '<option value="' . $myrow['typeabbrev'] . '">' . $myrow['sales_type'] . '</option>'; } } //end while loop DB_data_seek($result, 0); $result = DB_query('SELECT currency, currabrev FROM currencies', $db); echo '</select></td></tr> - <tr><td>' . _('Currency') . ":</td> - <td><select name='CurrCode'>"; + <tr><td>' . _('Currency') . ':</td> + <td><select name="CurrCode">'; while ($myrow = DB_fetch_array($result)) { if (isset($_POST['CurrCode']) and $_POST['CurrCode'] == $myrow['currabrev']) { echo '<option selected value=' . $myrow['currabrev'] . '>' . $myrow['currency'] . '</option>'; @@ -247,7 +245,8 @@ } //end while loop DB_data_seek($result, 0); echo '</select></td></tr>'; - echo "</table></br><p><div class='centre'><input type=submit name='submit' value='" . _('Submit') . "'></div></p>"; + echo '</table> + </br><p><div class="centre"><input type="submit" name="submit" value="' . _('Submit') . '"></div></p>'; } /*end of else not submit */ include ('includes/footer.inc'); ?> \ No newline at end of file Modified: trunk/PrintCustTransPortrait.php =================================================================== --- trunk/PrintCustTransPortrait.php 2011-04-02 01:42:42 UTC (rev 4535) +++ trunk/PrintCustTransPortrait.php 2011-04-02 09:40:49 UTC (rev 4536) @@ -2,8 +2,6 @@ /* $Id$ */ -//$PageSecurity = 1; - include('includes/session.inc'); if (isset($_GET['FromTransNo'])) { @@ -81,9 +79,11 @@ nobble the invoice reprints */ // check if the user has set a default bank account for invoices, if not leave it blank - $sql = 'SELECT bankaccounts.invoice, bankaccounts.bankaccountnumber, bankaccounts.bankaccountcode - from bankaccounts - WHERE bankaccounts.invoice = 1'; + $sql = "SELECT bankaccounts.invoice, + bankaccounts.bankaccountnumber, + bankaccounts.bankaccountcode + FROM bankaccounts + WHERE bankaccounts.invoice = '1'"; $result=DB_query($sql,$db,'','',false,false); if (DB_error_no($db)!=1) { if (DB_num_rows($result)==1){ @@ -233,7 +233,7 @@ prnMsg( _('There was a problem retrieving the invoice or credit note details for note number') . ' ' . $InvoiceToPrint . ' ' . _('from the database') . '. ' . _('To print an invoice, the sales order record, the customer transaction record and the branch record for the customer must not have been purged') . '. ' . _('To print a credit note only requires the customer, transaction, salesman and branch records be available'),'error'); if ($debug==1){ - prnMsg (_('The SQL used to get this information that failed was') . "<br>" . $sql,'error'); + prnMsg (_('The SQL used to get this information that failed was') . "<br />" . $sql,'error'); } include ('includes/footer.inc'); exit; @@ -284,9 +284,9 @@ if (DB_error_no($db)!=0) { $title = _('Transaction Print Error Report'); include ('includes/header.inc'); - echo '<br>' . _('There was a problem retrieving the invoice or credit note stock movement details for invoice number') . ' ' . $FromTransNo . ' ' . _('from the database'); + echo '<br />' . _('There was a problem retrieving the invoice or credit note stock movement details for invoice number') . ' ' . $FromTransNo . ' ' . _('from the database'); if ($debug==1){ - echo '<br>' . _('The SQL used to get this information that failed was') . "<br>$sql"; + echo '<br />' . _('The SQL used to get this information that failed was') . '<br />' . $sql; } include('includes/footer.inc'); exit; @@ -329,9 +329,10 @@ if ($myrow2['controlled']==1){ - $GetControlMovts = DB_query('SELECT moveqty, serialno + $GetControlMovts = DB_query("SELECT moveqty, + serialno FROM stockserialmoves - WHERE stockmoveno=' . $myrow2['stkmoveno'],$db); + WHERE stockmoveno='" . $myrow2['stkmoveno'] . "'",$db); if ($myrow2['serialised']==1){ while ($ControlledMovtRow = DB_fetch_array($GetControlMovts)){ @@ -469,7 +470,7 @@ } /* Add Images for Visa / Mastercard / Paypal */ if (file_exists('companies/' . $_SESSION['DatabaseName'] . '/payment.jpg')) { - $pdf->addJpegFromFile('companies/' . $_SESSION['DatabaseName'] . '/payment.jpg',$Page_Width/2 -60,$YPos-15,0,20); + $pdf->addJpegFromFile('companies/' . $_SESSION['DatabaseName'] . '/payment.jpg',$Page_Width/2 -60,$YPos-15,0,20); } // Print Bank acount details if available and default for invoices is selected $pdf->addText($Page_Width-$Right_Margin-450, $YPos - ($line_height*3)+22,$FontSize, $DefaultBankAccountCode . ' ' . $DefaultBankAccountNumber); @@ -503,12 +504,12 @@ $title = _('Emailing') . ' ' .$InvOrCredit . ' ' . _('Number') . ' ' . $FromTransNo; include('includes/header.inc'); - echo '<p>' . $InvOrCredit . ' ' . _('number') . ' ' . $_GET['FromTransNo'] . ' ' . _('has been emailed to') . ' ' . $_GET['Email']; + echo '<p>' . $InvOrCredit . ' ' . _('number') . ' ' . $FromTransNo . ' ' . _('has been emailed to') . ' ' . $_GET['Email']; include('includes/footer.inc'); exit; } else { //its not an email just print the invoice to PDF - $pdf->OutputD($_SESSION['DatabaseName'] . '_' . $InvOrCredit . '_' . $_GET['FromTransNo'] . '.pdf'); + $pdf->OutputD($_SESSION['DatabaseName'] . '_' . $InvOrCredit . '_' . $FromTransNo . '.pdf'); } $pdf->__destruct(); @@ -522,56 +523,56 @@ /*if FromTransNo is not set then show a form to allow input of either a single invoice number or a range of invoices to be printed. Also get the last invoice number created to show the user where the current range is up to */ - echo '<form action="' . $_SERVER['PHP_SELF'] . '?' . SID . '" 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 '<p class="page_title_text"><img src="'.$rootpath.'/css/'.$theme.'/images/printer.png" title="' . _('Print') . '" alt="" />' . ' ' . _('Print Invoices or Credit Notes (Portrait Mode)') . '</p>'; - echo '<tr><td>' . _('Print Invoices or Credit Notes') . '</td><td><select name=InvOrCredit>'; + echo '<tr><td>' . _('Print Invoices or Credit Notes') . '</td> + <td><select name="InvOrCredit">'; if ($InvOrCredit=='Invoice' OR !isset($InvOrCredit)){ - echo "<option selected VALUE='Invoice'>" . _('Invoices'); - echo "<option VALUE='Credit'>" . _('Credit Notes'); - + echo '<option selected value="Invoice">' . _('Invoices') . '</option>'; + echo '<option value="Credit">' . _('Credit Notes') . '</option>'; } else { - - echo "<option selected VALUE='Credit'>" . _('Credit Notes'); - echo "<option VALUE='Invoice'>" . _('Invoices'); - + echo '<option selected value="Credit">' . _('Credit Notes') . '</option>'; + echo '<option VALUE="Invoice">' . _('Invoices') . '</option>'; } - echo '</select></td></tr>'; - echo '<tr><td>' . _('Print EDI Transactions') . '</td><td><select name=PrintEDI>'; + echo '<tr><td>' . _('Print EDI Transactions') . '</td><td><select name="PrintEDI">'; if ($InvOrCredit=='Invoice' OR !isset($InvOrCredit)){ - echo "<option selected VALUE='No'>" . _('Do not Print PDF EDI Transactions'); - echo "<option VALUE='Yes'>" . _('Print PDF EDI Transactions Too'); + echo '<option selected value="No">' . _('Do not Print PDF EDI Transactions') . '</option>'; + echo '<option VALUE="Yes">' . _('Print PDF EDI Transactions Too') . '</option>'; } else { - echo "<option VALUE='No'>" . _('Do not Print PDF EDI Transactions'); - echo "<option selected VALUE='Yes'>" . _('Print PDF EDI Transactions Too'); + echo '<option VALUE="No">' . _('Do not Print PDF EDI Transactions') . '</option>'; + echo '<option selected value="Yes">' . _('Print PDF EDI Transactions Too') . '</option>'; } echo '</select></td></tr>'; - echo '<tr><td>' . _('Start invoice/credit note number to print') . '</td><td><input class=number type=text max=6 size=7 name=FromTransNo></td></tr>'; - echo '<tr><td>' . _('End invoice/credit note number to print') . "</td><td><input class=number type=text max=6 size=7 name='ToTransNo'></td></tr></table>"; - echo "<div class='centre'><br><input type=Submit Name='Print' Value='" . _('Print Preview') . "'><p>"; - echo "<input type=Submit Name='PrintPDF' Value='" . _('Print PDF') . "'></div>"; + echo '<tr><td>' . _('Start invoice/credit note number to print') . '</td> + <td><input class="number" type="text" max="6" size="7" name="FromTransNo"></td></tr>'; + echo '<tr><td>' . _('End invoice/credit note number to print') . '</td> + <td><input class="number" type="text" max="6" size="7" name="ToTransNo"></td></tr> + </table>'; + echo '<div class="centre"><br /><input type="submit" name="Print" value="' . _('Print Preview') . '"><p>'; + echo '<input type="submit" name="PrintPDF" value="' . _('Print PDF') . '"></div>'; $sql = 'SELECT typeno FROM systypes WHERE typeid=10'; $result = DB_query($sql,$db); $myrow = DB_fetch_row($result); - echo '<div class="page_help_text"><b>' . _('The last invoice created was number') . ' ' . $myrow[0] . '</b><br>' . _('If only a single invoice is required') . ', ' . _('enter the invoice number to print in the Start transaction number to print field and leave the End transaction number to print field blank') . '. ' . _('Only use the end invoice to print field if you wish to print a sequential range of invoices') . ''; + echo '<div class="page_help_text"><b>' . _('The last invoice created was number') . ' ' . $myrow[0] . '</b><br />' . _('If only a single invoice is required') . ', ' . _('enter the invoice number to print in the Start transaction number to print field and leave the End transaction number to print field blank') . '. ' . _('Only use the end invoice to print field if you wish to print a sequential range of invoices') . ''; - $sql = 'SELECT typeno FROM systypes WHERE typeid=11'; + $sql = "SELECT typeno FROM systypes WHERE typeid='11'"; $result = DB_query($sql,$db); $myrow = DB_fetch_row($result); - echo '<br><b>' . _('The last credit note created was number') . ' ' . $myrow[0] . '</b><br>' . _('A sequential range can be printed using the same method as for invoices above') . '. ' . _('A single credit note can be printed by only entering a start transaction number') . '</DIV'; + echo '<br /><b>' . _('The last credit note created was number') . ' ' . $myrow[0] . '</b><br />' . _('A sequential range can be printed using the same method as for invoices above') . '. ' . _('A single credit note can be printed by only entering a start transaction number') . '</DIV'; } else { @@ -677,7 +678,7 @@ if (DB_num_rows($result)==0 OR DB_error_no($db)!=0) { echo '<p>' . _('There was a problem retrieving the invoice or credit note details for note number') . ' ' . $InvoiceToPrint . ' ' . _('from the database') . '. ' . _('To print an invoice, the sales order record, the customer transaction record and the branch record for the customer must not have been purged') . '. ' . _('To print a credit note only requires the customer, transaction, salesman and branch records be available'); if ($debug==1){ - echo _('The SQL used to get this information that failed was') . "<br>$sql"; + echo _('The SQL used to get this information that failed was') . "<br />$sql"; } break; include('includes/footer.inc'); @@ -694,33 +695,41 @@ $ExchRate = $myrow['rate']; $PageNumber = 1; - echo '<table class="table1"><tr><td VALIGN=TOP WIDTH=10%><img src="' . $_SESSION['LogoFile'] . '"></td><td bgcolor="#bbb"><b>'; + echo '<table class="table1"> + <tr><td valign=top width=10%><img src="' . $_SESSION['LogoFile'] . '"></td><td bgcolor="#bbb"><b>'; if ($InvOrCredit=='Invoice') { echo '<font size=4>' . _('TAX INVOICE') . ' '; } else { echo '<font color=RED size=4>' . _('TAX CREDIT NOTE') . ' '; } - echo '</b>' . _('Number') . ' ' . $FromTransNo . '</font><br><font size=1>' . _('Tax Authority Ref') . '. ' . $_SESSION['CompanyRecord']['gstno'] . '</td></tr></table>'; + echo '</b>' . _('Number') . ' ' . $FromTransNo . '</font><br /><font size=1>' . _('Tax Authority Ref') . '. ' . $_SESSION['CompanyRecord']['gstno'] . '</td></tr></table>'; /*Now print out the logo and company name and address */ - echo '<table class"table1"><tr><td><font size=4 color="#333"><b>' . $_SESSION['CompanyRecord']['coyname'] . '</b></font><br>'; - echo $_SESSION['CompanyRecord']['regoffice1'] . '<br>'; - echo $_SESSION['CompanyRecord']['regoffice2'] . '<br>'; - echo $_SESSION['CompanyRecord']['regoffice3'] . '<br>'; - echo $_SESSION['CompanyRecord']['regoffice4'] . '<br>'; - echo $_SESSION['CompanyRecord']['regoffice5'] . '<br>'; - echo $_SESSION['CompanyRecord']['regoffice6'] . '<br>'; - echo _('Telephone') . ': ' . $_SESSION['CompanyRecord']['telephone'] . '<br>'; - echo _('Facsimile') . ': ' . $_SESSION['CompanyRecord']['fax'] . '<br>'; - echo _('Email') . ': ' . $_SESSION['CompanyRecord']['email'] . '<br>'; + echo '<table class"table1"><tr><td><font size=4 color="#333"><b>' . $_SESSION['CompanyRecord']['coyname'] . '</b></font><br />'; + echo $_SESSION['CompanyRecord']['regoffice1'] . '<br />'; + echo $_SESSION['CompanyRecord']['regoffice2'] . '<br />'; + echo $_SESSION['CompanyRecord']['regoffice3'] . '<br />'; + echo $_SESSION['CompanyRecord']['regoffice4'] . '<br />'; + echo $_SESSION['CompanyRecord']['regoffice5'] . '<br />'; + echo $_SESSION['CompanyRecord']['regoffice6'] . '<br />'; + echo _('Telephone') . ': ' . $_SESSION['CompanyRecord']['telephone'] . '<br />'; + echo _('Facsimile') . ': ' . $_SESSION['CompanyRecord']['fax'] . '<br />'; + echo _('Email') . ': ' . $_SESSION['CompanyRecord']['email'] . '<br />'; echo '</td><td width=50% class=number>'; /*Now the customer charged to details in a sub table within a cell of the main table*/ echo '<table class="table1"><tr><td align="left" bgcolor="#bbb"><b>' . _('Charge To') . ':</b></td></tr><tr><td bgcolor="#eee">'; - echo $myrow['name'] . '<br>' . $myrow['address1'] . '<br>' . $myrow['address2'] . '<br>' . $myrow['address3'] . '<br>' . $myrow['address4'] . '<br>' . $myrow['address5'] . '<br>' . $myrow['address6']; + echo $myrow['name'] . + '<br />' . $myrow['address1'] . + '<br />' . $myrow['address2'] . + '<br />' . $myrow['address3'] . + '<br />' . $myrow['address4'] . + '<br />' . $myrow['address5'] . + '<br />' . $myrow['address6']; + echo '</td></tr></table>'; /*end of the small table showing charge to account details */ echo _('Page') . ': ' . $PageNumber; @@ -735,9 +744,23 @@ <td align=left bgcolor="#bbb"><b>' . _('Delivered To') . ':</b></td> </tr>'; echo '<tr> - <td bgcolor="#eee">' .$myrow['brname'] . '<br />' . $myrow['braddress1'] . '<br />' . $myrow['braddress2'] . '<br />' . $myrow['braddress3'] . '<br />' . $myrow['braddress4'] . '<br />' . $myrow['braddress5'] . '<br />' . $myrow['braddress6'] . '</td>'; + <td bgcolor="#eee">' .$myrow['brname'] . + '<br />' . $myrow['braddress1'] . + '<br />' . $myrow['braddress2'] . + '<br />' . $myrow['braddress3'] . + '<br />' . $myrow['braddress4'] . + '<br />' . $myrow['braddress5'] . + '<br />' . $myrow['braddress6'] . + '</td>'; - echo '<td bgcolor="#eee">' . $myrow['deliverto'] . '<br />' . $myrow['deladd1'] . '<br />' . $myrow['deladd2'] . '<br />' . $myrow['deladd3'] . '<br />' . $myrow['deladd4'] . '<br />' . $myrow['deladd5'] . '<br />' . $myrow['deladd6'] . '</td>'; + echo '<td bgcolor="#eee">' . $myrow['deliverto'] . + '<br />' . $myrow['deladd1'] . + '<br />' . $myrow['deladd2'] . + '<br />' . $myrow['deladd3'] . + '<br />' . $myrow['deladd4'] . + '<br />' . $myrow['deladd5'] . + '<br />' . $myrow['deladd6'] . + '</td>'; echo '</tr> </table><hr>'; @@ -751,16 +774,16 @@ <td align=left bgcolor="#bbb"><b>' . _('Shipper') . '</b></td> <td align=left bgcolor="#bbb"><b>' . _('Consignment Ref') . '</b></td> </tr>'; - echo "<tr> - <td bgcolor='#EEEEEE'>" . $myrow['customerref'] . "</td> - <td bgcolor='#EEEEEE'>" .$myrow['orderno'] . "</td> - <td bgcolor='#EEEEEE'>" . ConvertSQLDate($myrow['orddate']) . "</td> - <td bgcolor='#EEEEEE'>" . ConvertSQLDate($myrow['trandate']) . "</td> - <td bgcolor='#EEEEEE'>" . $myrow['salesmanname'] . "</td> - <td bgcolor='#EEEEEE'>" . $myrow['shippername'] . "</td> - <td bgcolor='#EEEEEE'>" . $myrow['consignment'] . "</td> + echo '<tr> + <td bgcolor="#EEEEEE">' . $myrow['customerref'] . '</td> + <td bgcolor="#EEEEEE">' .$myrow['orderno'] . '</td> + <td bgcolor="#EEEEEE">' . ConvertSQLDate($myrow['orddate']) . '</td> + <td bgcolor="#EEEEEE">' . ConvertSQLDate($myrow['trandate']) . '</td> + <td bgcolor="#EEEEEE">' . $myrow['salesmanname'] . '</td> + <td bgcolor="#EEEEEE">' . $myrow['shippername'] . '</td> + <td bgcolor="#EEEEEE">' . $myrow['consignment'] . '</td> </tr> - </table>"; + </table>'; $sql ="SELECT stockmoves.stockid, stockmaster.description, @@ -780,19 +803,26 @@ } else { /* then its a credit note */ - echo "<table WIDTH=50%><tr> - <td align=left bgcolor='#BBBBBB'><b>" . _('Branch') . ":</b></td> - </tr>"; - echo "<tr> - <td bgcolor='#EEEEEE'>" .$myrow['brname'] . '<br>' . $myrow['braddress1'] . '<br>' . $myrow['braddress2'] . '<br>' . $myrow['braddress3'] . '<br>' . $myrow['braddress4'] . '<br>' . $myrow['braddress5'] . '<br>' . $myrow['braddress6'] . '</td> + echo '<table WIDTH=50%><tr> + <td align=left bgcolor="#BBBBBB"><b>' . _('Branch') . ':</b></td> + </tr>'; + echo '<tr> + <td bgcolor="#EEEEEE">' .$myrow['brname'] . + '<br />' . $myrow['braddress1'] . + '<br />' . $myrow['braddress2'] . + '<br />' . $myrow['braddress3'] . + '<br />' . $myrow['braddress4'] . + '<br />' . $myrow['braddress5'] . + '<br />' . $myrow['braddress6'] . + '</td> </tr></table>'; echo '<hr><table class="table1"><tr> - <td align=left bgcolor="#bbb"><b>' . _('Date') . "</b></td> - <td align=left bgcolor='#BBBBBB'><b>" . _('Sales Person') . "</font></b></td> - </tr>"; - echo "<tr> - <td bgcolor='#EEEEEE'>" . ConvertSQLDate($myrow['trandate']) . "</td> - <td bgcolor='#EEEEEE'>" . $myrow['salesmanname'] . '</td> + <td align=left bgcolor="#bbbbbb"><b>' . _('Date') . '</b></td> + <td align=left bgcolor="#BBBBBB"><b>' . _('Sales Person') . '</font></b></td> + </tr>'; + echo '<tr> + <td bgcolor="#EEEEEE">' . ConvertSQLDate($myrow['trandate']) . '</td> + <td bgcolor="#EEEEEE">' . $myrow['salesmanname'] . '</td> </tr></table>'; @@ -801,7 +831,8 @@ stockmoves.qty as quantity, stockmoves.discountpercent, ((1 - stockmoves.discountpercent) * stockmoves.price * " . $ExchRate . " * stockmoves.qty) AS fxnet, (stockmoves.price * " . $ExchRate . ") AS fxprice, - stockmaster.units + stockmaster.units, + stockmoves.narrative FROM stockmoves, stockmaster WHERE stockmoves.stockid = stockmaster.stockid @@ -815,22 +846,22 @@ $result=DB_query($sql,$db); if (DB_error_no($db)!=0) { - echo '<br>' . _('There was a problem retrieving the invoice or credit note stock movement details for invoice number') . ' ' . $FromTransNo . ' ' . _('from the database'); + echo '<br />' . _('There was a problem retrieving the invoice or credit note stock movement details for invoice number') . ' ' . $FromTransNo . ' ' . _('from the database'); if ($debug==1){ - echo '<br>' . _('The SQL used to get this information that failed was') . "<br>$sql"; + echo '<br />' . _('The SQL used to get this information that failed was') . '<br />' . $sql; } exit; } if (DB_num_rows($result)>0){ echo '<table class="table1"> - <tr><th>' . _('Item Code') . "</th> - <th>" . _('Item Description') . "</th> - <th>" . _('Quantity') . "</th> - <th>" . _('Unit') . "</th> - <th>" . _('Price') . "</th> - <th>" . _('Discount') . "</th> - <th>" . _('Net') . '</th></tr>'; + <tr><th>' . _('Item Code') . '</th> + <th>' . _('Item Description') . '</th> + <th>' . _('Quantity') . '</th> + <th>' . _('Unit') . '</th> + <th>' . _('Price') . '</th> + <th>' . _('Discount') . '</th> + <th>' . _('Net') . '</th></tr>'; $LineCounter =17; $k=0; //row colour counter @@ -891,29 +922,29 @@ } else { echo '<font color=RED size=4>' . _('TAX CREDIT NOTE') . ' '; } - echo '</b>' . _('Number') . ' ' . $FromTransNo . '</font><br><font size=1>' . _('GST Number') . ' - ' . $_SESSION['CompanyRecord']['gstno'] . '</td></tr></table>'; + echo '</b>' . _('Number') . ' ' . $FromTransNo . '</font><br /><font size=1>' . _('GST Number') . ' - ' . $_SESSION['CompanyRecord']['gstno'] . '</td></tr></table>'; /*Now print out company name and address */ echo '<table class="table1"><tr> - <td><font size=4 color="#333"><b>' . $_SESSION['CompanyRecord']['coyname'] . '</b></font><br>'; - echo $_SESSION['CompanyRecord']['regoffice1'] . '<br>'; - echo $_SESSION['CompanyRecord']['regoffice2'] . '<br>'; - echo $_SESSION['CompanyRecord']['regoffice3'] . '<br>'; - echo $_SESSION['CompanyRecord']['regoffice4'] . '<br>'; - echo $_SESSION['CompanyRecord']['regoffice5'] . '<br>'; - echo $_SESSION['CompanyRecord']['regoffice6'] . '<br>'; - echo _('Telephone') . ': ' . $_SESSION['CompanyRecord']['telephone'] . '<br>'; - echo _('Facsimile') . ': ' . $_SESSION['CompanyRecord']['fax'] . '<br>'; - echo _('Email') . ': ' . $_SESSION['CompanyRecord']['email'] . '<br>'; - echo '</td><td class=number>' . _('Page') . ": $PageNumber</td></tr></table>"; + <td><font size=4 color="#333"><b>' . $_SESSION['CompanyRecord']['coyname'] . '</b></font><br />'; + echo $_SESSION['CompanyRecord']['regoffice1'] . '<br />'; + echo $_SESSION['CompanyRecord']['regoffice2'] . '<br />'; + echo $_SESSION['CompanyRecord']['regoffice3'] . '<br />'; + echo $_SESSION['CompanyRecord']['regoffice4'] . '<br />'; + echo $_SESSION['CompanyRecord']['regoffice5'] . '<br />'; + echo $_SESSION['CompanyRecord']['regoffice6'] . '<br />'; + echo _('Telephone') . ': ' . $_SESSION['CompanyRecord']['telephone'] . '<br />'; + echo _('Facsimile') . ': ' . $_SESSION['CompanyRecord']['fax'] . '<br />'; + echo _('Email') . ': ' . $_SESSION['CompanyRecord']['email'] . '<br />'; + echo '</td><td class=number>' . _('Page') . ': ' . $PageNumber . '</td></tr></table>'; echo '<table class="table1"><tr> - <th>' . _('Item Code') . "</th> - <th>" . _('Item Description') . "</th> - <th>" . _('Quantity') . "</th> - <th>" . _('Unit') . "</th> - <th>" . _('Price') . "</th> - <th>" . _('Discount') . "</th> - <th>" . _('Net') . "</th></tr>"; + <th>' . _('Item Code') . '</th> + <th>' . _('Item Description') . '</th> + <th>' . _('Quantity') . '</th> + <th>' . _('Unit') . '</th> + <th>' . _('Price') . '</th> + <th>' . _('Discount') . '</th> + <th>' . _('Net') . '</th></tr>'; $LineCounter = 10; @@ -936,28 +967,28 @@ } else { echo '<font color=RED size=4>' . _('TAX CREDIT NOTE') . ' '; } - echo '</b>' . _('Number') . ' ' . $FromTransNo . '</font><br><font size=1>' . _('GST Number') . ' - ' . $_SESSION['CompanyRecord']['gstno'] . '</td></tr></table>'; + echo '</b>' . _('Number') . ' ' . $FromTransNo . '</font><br /><font size=1>' . _('GST Number') . ' - ' . $_SESSION['CompanyRecord']['gstno'] . '</td></tr></table>'; /*Print out the logo and company name and address */ - echo '<table class="table1"><tr><td><font size=4 color="#333"><b>' . $_SESSION['CompanyRecord']['coyname'] . '</b></font><br>'; - echo $_SESSION['CompanyRecord']['regoffice1'] . '<br>'; - echo $_SESSION['CompanyRecord']['regoffice2'] . '<br>'; - echo $_SESSION['CompanyRecord']['regoffice3'] . '<br>'; - echo $_SESSION['CompanyRecord']['regoffice4'] . '<br>'; - echo $_SESSION['CompanyRecord']['regoffice5'] . '<br>'; - echo $_SESSION['CompanyRecord']['regoffice6'] . '<br>'; - echo _('Telephone') . ': ' . $_SESSION['CompanyRecord']['telephone'] . '<br>'; - echo _('Facsimile') . ': ' . $_SESSION['CompanyRecord']['fax'] . '<br>'; - echo _('Email') . ': ' . $_SESSION['CompanyRecord']['email'] . '<br>'; + echo '<table class="table1"><tr><td><font size=4 color="#333"><b>' . $_SESSION['CompanyRecord']['coyname'] . '</b></font><br />'; + echo $_SESSION['CompanyRecord']['regoffice1'] . '<br />'; + echo $_SESSION['CompanyRecord']['regoffice2'] . '<br />'; + echo $_SESSION['CompanyRecord']['regoffice3'] . '<br />'; + echo $_SESSION['CompanyRecord']['regoffice4'] . '<br />'; + echo $_SESSION['CompanyRecord']['regoffice5'] . '<br />'; + echo $_SESSION['CompanyRecord']['regoffice6'] . '<br />'; + echo _('Telephone') . ': ' . $_SESSION['CompanyRecord']['telephone'] . '<br />'; + echo _('Facsimile') . ': ' . $_SESSION['CompanyRecord']['fax'] . '<br />'; + echo _('Email') . ': ' . $_SESSION['CompanyRecord']['email'] . '<br />'; echo '</td><td class=number>' . _('Page') . ": $PageNumber</td></tr></table>"; echo '<table class="table1"><tr> - <th>' . _('Item Code') . "</th> - <th>" . _('Item Description') . "</th> - <th>" . _('Quantity') . "</th> - <th>" . _('Unit') . "</th> - <th>" . _('Price') . "</th> - <th>" . _('Discount') . "</th> - <th>" . _('Net') . '</th></tr></table>'; + <th>' . _('Item Code') . '</th> + <th>' . _('Item Description') . '</th> + <th>' . _('Quantity') . '</th> + <th>' . _('Unit') . '</th> + <th>' . _('Price') . '</th> + <th>' . _('Discount') . '</th> + <th>' . _('Net') . '</th></tr></table>'; $LineCounter = 10; } @@ -988,18 +1019,18 @@ } /*Print out the invoice text entered */ echo '<table class="table1"><tr> - <td class=number>' . _('Sub Total') . "</td> - <td class=number bgcolor='#EEEEEE' WIDTH='15%'>$DisplaySubTot</td></tr>"; - echo '<tr><td class=number>' . _('Freight') . "</td> - <td class=number bgcolor='#EEEEEE'>$DisplayFreight</td></tr>"; - echo '<tr><td class=number>' . _('Tax') . "</td> - <td class=number bgcolor='#EEEEEE'>$DisplayTax</td></tr>"; + <td class="number">' . _('Sub Total') . '</td> + <td class="number" bgcolor="#EEEEEE" WIDTH="15%">' . $DisplaySubTot . '</td></tr>'; + echo '<tr><td class="number">' . _('Freight') . '</td> + <td class="number" bgcolor="#EEEEEE">' . $DisplayFreight . '</td></tr>'; + echo '<tr><td class="number">' . _('Tax') . '</td> + <td class="number" bgcolor="#EEEEEE">' . $DisplayTax . '</td></tr>'; if ($InvOrCredit=='Invoice'){ - echo '<tr><td class=number><b>' . _('TOTAL INVOICE') . "</b></td> - <td class=number bgcolor='#EEEEEE'><U><b>$DisplayTotal</b></U></td></tr>"; + echo '<tr><td class="number"><b>' . _('TOTAL INVOICE') . '</b></td> + <td class="number" bgcolor="#EEEEEE"><U><b>' . $DisplayTotal . '</b></U></td></tr>'; } else { - echo '<tr><td class=number><font color=RED><b>' . _('TOTAL CREDIT') . "</b></font></td> - <td class=number bgcolor='#EEEEEE'><font color=RED><U><b>$DisplayTotal</b></U></font></td></tr>"; + echo '<tr><td class=number><font color=RED><b>' . _('TOTAL CREDIT') . '</b></font></td> + <td class="number" bgcolor="#EEEEEE"><font color="red"><U><b>' . $DisplayTotal . '</b></u></font></td></tr>'; } echo '</table>'; } /* end of check to see that there was an invoice record to print */ Modified: trunk/RecurringSalesOrdersProcess.php =================================================================== --- trunk/RecurringSalesOrdersProcess.php 2011-04-02 01:42:42 UTC (rev 4535) +++ trunk/RecurringSalesOrdersProcess.php 2011-04-02 09:40:49 UTC (rev 4536) @@ -85,7 +85,7 @@ while ($RecurrOrderRow = DB_fetch_array($RecurrOrdersDueResult)){ $EmailText =''; - echo '<br>' . _('Rec... [truncated message content] |
From: <dai...@us...> - 2011-04-02 09:40:59
|
Revision: 4536 http://web-erp.svn.sourceforge.net/web-erp/?rev=4536&view=rev Author: daintree Date: 2011-04-02 09:40:49 +0000 (Sat, 02 Apr 2011) Log Message: ----------- SQL and xhtml fixes Modified Paths: -------------- trunk/PO_Header.php trunk/PO_Items.php trunk/PricesByCost.php trunk/PrintCustTransPortrait.php trunk/RecurringSalesOrdersProcess.php trunk/SalesGLPostings.php trunk/SalesGraph.php trunk/SelectAsset.php trunk/SelectCreditItems.php trunk/SelectCustomer.php trunk/SelectOrderItems.php trunk/SelectProduct.php Modified: trunk/PO_Header.php =================================================================== --- trunk/PO_Header.php 2011-04-02 01:42:42 UTC (rev 4535) +++ trunk/PO_Header.php 2011-04-02 09:40:49 UTC (rev 4536) @@ -2,8 +2,6 @@ /* $Id PO_Header.php 4183 2010-12-14 09:30:20Z daintree $ */ -//$PageSecurity = 4; now read in from from DB into $_SESSION['PageSecurity'] array and retrieved into a $PageSecuirity variable for the script by session.inc - include('includes/DefinePOClass.php'); include('includes/session.inc'); @@ -86,13 +84,13 @@ if ($_POST['Status'] == 'Authorised') { if ($AuthorityLevel > $OrderTotal) { - $_SESSION['PO'.$identifier]->StatusComments = date($_SESSION['DefaultDateFormat']) . ' - ' . _('Authorised by') . $UserChangedStatus . $_POST['StatusComments'] . '<br>' . html_entity_decode($_POST['StatusCommentsComplete']); + $_SESSION['PO'.$identifier]->StatusComments = date($_SESSION['DefaultDateFormat']) . ' - ' . _('Authorised by') . $UserChangedStatus . $_POST['StatusComments'] . '<br />' . html_entity_decode($_POST['StatusCommentsComplete']); $_SESSION['PO'.$identifier]->AllowPrintPO=1; } else { $OKToUpdateStatus=0; - prnMsg( _('You do not have permission to authorise this purchase order').'.<br>'. _('This order is for').' '. + prnMsg( _('You do not have permission to authorise this purchase order').'.<br />'. _('This order is for').' '. $_SESSION['PO'.$identifier]->CurrCode.' '.$OrderTotal.'. '. - _('You can only authorise up to').' '.$_SESSION['PO'.$identifier]->CurrCode.' '.$AuthorityLevel.'.<br>'. + _('You can only authorise up to').' '.$_SESSION['PO'.$identifier]->CurrCode.' '.$AuthorityLevel.'.<br />'. _('If you think this is a mistake please contact the systems administrator') , 'warn'); } } @@ -111,12 +109,12 @@ } if ($OKToUpdateStatus==1){ // none of the order has been received if ($AuthorityLevel>$OrderTotal) { - $_SESSION['PO'.$identifier]->StatusComments = date($_SESSION['DefaultDateFormat']).' - ' . $_POST['Status'] . ' ' . _('by') . $UserChangedStatus . $_POST['StatusComments'].'<br>' . $_POST['StatusCommentsComplete']; + $_SESSION['PO'.$identifier]->StatusComments = date($_SESSION['DefaultDateFormat']).' - ' . $_POST['Status'] . ' ' . _('by') . $UserChangedStatus . $_POST['StatusComments'].'<br />' . $_POST['StatusCommentsComplete']; } else { $OKToUpdateStatus=0; - prnMsg( _('You do not have permission to reject this purchase order').'.<br>'. _('This order is for').' '. + prnMsg( _('You do not have permission to reject this purchase order').'.<br />'. _('This order is for').' '. $_SESSION['PO'.$identifier]->CurrCode.' '.$OrderTotal.'. '. - _('Your authorisation limit is set at').' '.$_SESSION['PO'.$identifier]->CurrCode.' '.$AuthorityLevel.'.<br>'. + _('Your authorisation limit is set at').' '.$_SESSION['PO'.$identifier]->CurrCode.' '.$AuthorityLevel.'.<br />'. _('If you think this is a mistake please contact the systems administrator') , 'warn'); } } @@ -131,11 +129,11 @@ if (($AuthorityLevel>$OrderTotal OR $_SESSION['UserID']==$_SESSION['PO'.$identifier]->Initiator ) AND $OKToUpdateStatus==1) { - $_SESSION['PO'.$identifier]->StatusComments = date($_SESSION['DefaultDateFormat']).' - ' . _('Order set to pending status by') . $UserChangedStatus . $_POST['StatusComments']. '<br>' .$_POST['StatusCommentsComplete']; + $_SESSION['PO'.$identifier]->StatusComments = date($_SESSION['DefaultDateFormat']).' - ' . _('Order set to pending status by') . $UserChangedStatus . $_POST['StatusComments']. '<br />' .$_POST['StatusCommentsComplete']; } elseif ($AuthorityLevel<$OrderTotal AND $_SESSION['UserID']!=$_SESSION['PO'.$identifier]->Initiator) { $OKToUpdateStatus=0; - prnMsg( _('You do not have permission to change the status of this purchase order').'.<br>'. _('This order is for').' '. $_SESSION['PO'.$identifier]->CurrCode.' '.$OrderTotal.'. '. _('Your authorisation limit is set at').' '.$_SESSION['PO'.$identifier]->CurrCode.' '.$AuthorityLevel.'.<br>'. _('If you think this is a mistake please contact the systems administrator') , 'warn'); + prnMsg( _('You do not have permission to change the status of this purchase order').'.<br />'. _('This order is for').' '. $_SESSION['PO'.$identifier]->CurrCode.' '.$OrderTotal.'. '. _('Your authorisation limit is set at').' '.$_SESSION['PO'.$identifier]->CurrCode.' '.$AuthorityLevel.'.<br />'. _('If you think this is a mistake please contact the systems administrator') , 'warn'); } } @@ -221,7 +219,7 @@ $_SESSION['PO'.$identifier]->AllowPrintPO=1; $sql = "UPDATE purchorders - SET purchorders.allowprint=1 + SET purchorders.allowprint='1' WHERE purchorders.orderno='" . $_SESSION['PO'.$identifier]->OrderNo ."'"; $ErrMsg = _('An error occurred updating the purchase order to allow reprints') . '. ' . _('The error says'); @@ -256,7 +254,8 @@ * code above if a modification to an existing order. Also * $ExistingOrder would be set to 1. The delivery check screen * is where the details of the order are either updated or - * inserted depending on the value of ExistingOrder */ + * inserted depending on the value of ExistingOrder + * */ $_SESSION['ExistingOrder']=0; $_SESSION['PO'.$identifier] = new PurchOrder; @@ -282,9 +281,9 @@ if ($_SESSION['PO'.$identifier]->Any_Already_Received()==0){ $_SESSION['RequireSupplierSelection']=1; $_SESSION['PO'.$identifier]->Status = 'Pending'; - $_SESSION['PO'.$identifier]->StatusComments==date($_SESSION['DefaultDateFormat']).' - ' . _('Supplier changed by') . ' <a href="mailto:'. $_SESSION['UserEmail'] .'">'.$_SESSION['UserID']. '</a> - '.$_POST['StatusComments'].'<br>'.$_POST['StatusCommentsComplete']; + $_SESSION['PO'.$identifier]->StatusComments==date($_SESSION['DefaultDateFormat']).' - ' . _('Supplier changed by') . ' <a href="mailto:'. $_SESSION['UserEmail'] .'">'.$_SESSION['UserID']. '</a> - '.$_POST['StatusComments'].'<br />'.$_POST['StatusCommentsComplete']; } else { - echo '<br><br>'; + echo '<br /><br />'; prnMsg(_('Cannot modify the supplier of the order once some of the order has been received'),'warn'); } } @@ -407,8 +406,8 @@ if (($AuthRow=DB_fetch_array($AuthResult) and $AuthRow['cancreate']==0 ) ) { $_POST['SupplierName'] = $myrow['suppname']; - $_POST['CurrCode'] = $myrow['currcode']; - $_POST['ExRate'] = $myrow['rate']; + $_POST['CurrCode'] = $myrow['currcode']; + $_POST['ExRate'] = $myrow['rate']; $_POST['PaymentTerms']= $myrow['paymentterms']; $_POST['SuppDelAdd1'] = $myrow['address1']; $_POST['SuppDelAdd2'] = $myrow['address2']; @@ -434,7 +433,7 @@ $_SESSION['PO'.$identifier]->SuppTel = $_POST['SuppTel']; $_SESSION['PO'.$identifier]->Port = $_POST['Port']; } else { - prnMsg( _('You do not have the authority to raise Purchase Orders for') . ' ' . $myrow['suppname'] .'. ' . _('Please Consult your system administrator for more information.') . '<br>' . _('You can setup authorisations'). ' ' . '<a href="PO_AuthorisationLevels.php">' . _('here') . '</a>', 'warn'); + prnMsg( _('You do not have the authority to raise Purchase Orders for') . ' ' . $myrow['suppname'] .'. ' . _('Please Consult your system administrator for more information.') . '<br />' . _('You can setup authorisations'). ' ' . '<a href="PO_AuthorisationLevels.php">' . _('here') . '</a>', 'warn'); include('includes/footer.inc'); exit; } @@ -507,7 +506,7 @@ echo '<p class="page_title_text"><img src="'.$rootpath.'/css/'.$theme.'/images/supplier.png" title="' . _('Purchase Order') . '" alt="">' . ' ' . _('Purchase Order: Select Supplier') . ''; - echo "<form action='" . $_SERVER['PHP_SELF'] . '?' . SID . "identifier=".$identifier."' method=post name='choosesupplier'>"; + echo '<form action="' . $_SERVER['PHP_SELF'] . '?identifier=' . $identifier . '" method="post" name="choosesupplier">'; echo '<input type="hidden" name="FormID" value="' . $_SESSION['FormID'] . '" />'; echo '<table cellpadding=3 colspan=4 class=selection> @@ -518,7 +517,7 @@ <td><font size=1>' . _('Enter text extract in the supplier code') . ':</font></td> <td><input type="text" name="SuppCode" size="15" maxlength="18"></td> </tr> - </table><br><div class="centre"> + </table><br /><div class="centre"> <input type="submit" name="SearchSuppliers" value="' . _('Search Now') . '"> <input type="submit" action="reset" value="' . _('Reset') . '"></div>'; @@ -526,7 +525,7 @@ if (isset($result_SuppSelect)) { - echo '<br><table cellpadding=3 colspan=7 class=selection>'; + echo '<br /><table cellpadding=3 colspan=7 class=selection>'; $tableheader = '<tr> <th>' . _('Code') . '</th> @@ -573,7 +572,7 @@ } else { /* everything below here only do if a supplier is selected */ - echo '<form name="form1" action="' . $_SERVER['PHP_SELF'] . '?' . SID . 'identifier=' . $identifier . '" method=post>'; + echo '<form name="form1" action="' . $_SERVER['PHP_SELF'] . '?identifier=' . $identifier . '" method="post">'; echo '<input type="hidden" name="FormID" value="' . $_SESSION['FormID'] . '" />'; echo '<p class="page_title_text"> @@ -591,12 +590,12 @@ prnMsg(_('Purchase Item(s) with this code') . ': ' . $Purch_Item,'info'); echo '<div class="centre">'; - echo '<br><table class="table_index"><tr><td class="menu_group_item">'; + echo '<br /><table class="table_index"><tr><td class="menu_group_item">'; /* the link */ echo '<li><a href="'.$rootpath.'/PO_Items.php?NewItem=' . $Purch_Item . '&identifier=' . $identifier . '">' . _('Enter Line Item to this purchase order') . '</a></li>'; - echo '</td></tr></table></div><br>'; + echo '</td></tr></table></div><br />'; if (isset($_GET['Quantity'])) { $Qty=$_GET['Quantity']; @@ -686,7 +685,7 @@ $_POST['PaymentTerms']=$_SESSION['PO'.$identifier]->PaymentTerms; } - echo '<br><table colspan=1 width=80%> + echo '<br /><table colspan=1 width=80%> <tr> <th><font color=blue size=4><b>' . _('Order Initiation Details') . '</b></font></th> <th><font color=blue size=4><b>' . _('Order Status') . '</b></font></th> @@ -717,12 +716,12 @@ } echo '<tr><td>' . _('Version'). ' #' . ':</td> - <td><input type="hidden" name="Version" size="16" maxlength="15" value="' . $_POST['Version'] . '" />' . $_POST['Version'] . '</td></tr>'; + <td><input type="hidden" name="Version" size="16" maxlength="15" value="' . $_POST['Version'] . '" />' . $_POST['Version'] . '</td></tr>'; echo '<tr><td>' . _('Revised') . ':</td> - <td><input type="hidden" name="Revised" size="11" maxlength="15" value="' . date($_SESSION['DefaultDateFormat']) . '" />' . date($_SESSION['DefaultDateFormat']) . '</td></tr>'; + <td><input type="hidden" name="Revised" size="11" maxlength="15" value="' . date($_SESSION['DefaultDateFormat']) . '" />' . date($_SESSION['DefaultDateFormat']) . '</td></tr>'; echo '<tr><td>' . _('Delivery Date') . ':</td> - <td><input type="text" class="date" alt="' .$_SESSION['DefaultDateFormat'] .'" name="DeliveryDate" size="11" value="' . $_POST['DeliveryDate'] . '" /></td></tr>'; + <td><input type="text" class="date" alt="' .$_SESSION['DefaultDateFormat'] .'" name="DeliveryDate" size="11" value="' . $_POST['DeliveryDate'] . '" /></td></tr>'; if (!isset($_POST['Initiator'])) { $_POST['Initiator'] = $_SESSION['UserID']; @@ -733,7 +732,7 @@ <td><input type="hidden" name="Initiator" size="11" maxlength="10" value="' . $_POST['Initiator'] . '" />' . $_POST['Initiator'] . '</td></tr>'; echo '<tr><td>' . _('Requisition Ref') . ':</td> - <td><input type="text" name="Requisition" size="16" maxlength="15" value="' . $_POST['Requisition'] . '" /></td></tr>'; + <td><input type="text" name="Requisition" size="16" maxlength="15" value="' . $_POST['Requisition'] . '" /></td></tr>'; echo '<tr><td>' . _('Date Printed') . ':</td><td>'; if (isset($_SESSION['PO'.$identifier]->DatePurchaseOrderPrinted) AND strlen($_SESSION['PO'.$identifier]->DatePurchaseOrderPrinted)>6){ @@ -751,13 +750,13 @@ if ($_SESSION['PO'.$identifier]->AllowPrintPO==0 AND empty($_POST['RePrint'])){ echo '<tr><td>' . _('Allow Reprint') . ':</td> - <td><select name="RePrint" onChange="ReloadForm(form1.AllowRePrint)"> - <option selected value="0">' . _('No') . '</option> - <option value="1">' . _('Yes') . '</option> - </select></td>'; + <td><select name="RePrint" onChange="ReloadForm(form1.AllowRePrint)"> + <option selected value="0">' . _('No') . '</option> + <option value="1">' . _('Yes') . '</option> + </select></td>'; echo '<td><input type=submit name="AllowRePrint" value="Update"></td></tr>'; } elseif ($Printed) { - echo '<tr><td colspan=2><a target="_blank" href="' . $rootpath . '/PO_PDFPurchOrder.php?' . SID . 'OrderNo=' . $_SESSION['ExistingOrder'] . '&identifier='.$identifier. '">' . _('Reprint Now') . '</a></td></tr>'; + echo '<tr><td colspan=2><a target="_blank" href="' . $rootpath . '/PO_PDFPurchOrder.php?OrderNo=' . $_SESSION['ExistingOrder'] . '&identifier='.$identifier. '">' . _('Reprint Now') . '</a></td></tr>'; } echo '</table>'; @@ -812,7 +811,7 @@ <td><input type=text name="StatusComments" size=50></td></tr> <tr><td colspan=2><b>' . $_SESSION['PO'.$identifier]->StatusComments .'</b></td></tr>'; //need to use single quotes as double quotes inside the string of StatusComments - echo "<input type='hidden' name='StatusCommentsComplete' value='" . $_SESSION['PO'.$identifier]->StatusComments ."'>"; + echo '<input type="hidden" name="StatusCommentsComplete" value="' . $_SESSION['PO'.$identifier]->StatusComments .'">'; echo '<tr><td><input type="submit" name="UpdateStatus" value="' . _('Status Update') .'"></td>'; } //end its not a new order @@ -965,7 +964,7 @@ while ($ShipperRow=DB_fetch_array($ShipperResult)){ if (isset($_POST['DeliveryBy']) and ($_POST['DeliveryBy'] == $ShipperRow['shipper_id'])) { - echo '<option selected value="' . $ShipperRow['shipper_id'] . "'>" . $ShipperRow['shippername'] . '</option>'; + echo '<option selected value="' . $ShipperRow['shipper_id'] . '">' . $ShipperRow['shippername'] . '</option>'; } else { echo '<option value="' . $ShipperRow['shipper_id'] . '">' . $ShipperRow['shippername'] . '</option>'; } @@ -1010,21 +1009,21 @@ echo '</select> '; echo '</td></tr>'; - echo '<tr><td>' . _('Address') . " 1 :</td> - </td><td><input type='text' name=SuppDelAdd1 size=41 maxlength=40 value='" . $_POST['SuppDelAdd1'] . "'></td> - </tr>"; - echo '<tr><td>' . _('Address') . " 2 :</td> - </td><td><input type='text' name=SuppDelAdd2 size=41 maxlength=40 value='" . $_POST['SuppDelAdd2'] . "'></td> - </tr>"; - echo '<tr><td>' . _('Address') . " 3 :</td> - </td><td><input type='text' name=SuppDelAdd3 size=41 maxlength=40 value='" . $_POST['SuppDelAdd3'] . "'></td> - </tr>"; - echo '<tr><td>' . _('Address') . " 4 :</td> - </td><td><input type='text' name=SuppDelAdd5 size=21 maxlength=20 value='" . $_POST['SuppDelAdd5'] . "'></td> - </tr>"; - echo '<tr><td>' . _('Address') . " 5 :</td> - </td><td><input type='text' name=SuppDelAdd4 size=41 maxlength=40 value='" . $_POST['SuppDelAdd4'] . "'></td> - </tr>"; + echo '<tr><td>' . _('Address') . ' 1 :</td> + </td><td><input type="text" name="SuppDelAdd1" size="41" maxlength="40" value="' . $_POST['SuppDelAdd1'] . '"></td> + </tr>'; + echo '<tr><td>' . _('Address') . ' 2 :</td> + </td><td><input type="text" name="SuppDelAdd2" size="41" maxlength="40" value="' . $_POST['SuppDelAdd2'] . '"></td> + </tr>'; + echo '<tr><td>' . _('Address') . ' 3 :</td> + </td><td><input type="text" name="SuppDelAdd3" size="41" maxlength="40" value="' . $_POST['SuppDelAdd3'] . '"></td> + </tr>'; + echo '<tr><td>' . _('Address') . ' 4 :</td> + </td><td><input type="text" name="SuppDelAdd5" size="21" maxlength="20" value="' . $_POST['SuppDelAdd5'] . '"></td> + </tr>'; + echo '<tr><td>' . _('Address') . ' 5 :</td> + </td><td><input type="text" name="SuppDelAdd4" size="41" maxlength="40" value="' . $_POST['SuppDelAdd4'] . '"></td> + </tr>'; echo '<tr><td>' . _('Phone') . ': </td><td><input type="text" name="SuppTel" size="31" maxlength="30" value="' . $_SESSION['PO'.$identifier]->SuppTel . '"></td> </tr>'; Modified: trunk/PO_Items.php =================================================================== --- trunk/PO_Items.php 2011-04-02 01:42:42 UTC (rev 4535) +++ trunk/PO_Items.php 2011-04-02 09:40:49 UTC (rev 4536) @@ -694,7 +694,7 @@ /* This is where the order as selected should be displayed reflecting any deletions or insertions*/ -echo '<form name="form1" action="' . $_SERVER['PHP_SELF'] . '?' . SID . 'identifier=' . $identifier . '" method=post>'; +echo '<form name="form1" action="' . $_SERVER['PHP_SELF'] . '?identifier=' . $identifier . '" method=post>'; echo '<input type="hidden" name="FormID" value="' . $_SESSION['FormID'] . '" />'; /*need to set up entry for item description where not a stock item and GL Codes */ @@ -777,12 +777,12 @@ if (isset($_POST['NonStockOrder'])) { - echo '<br /><table class=selection><tr><td>'._('Item Description').'</td>'; + echo '<br /><table class=selection><tr><td>' . _('Item Description') . '</td>'; echo '<td><input type=text name=ItemDescription size=40></td></tr>'; - echo '<tr><td>'._('General Ledger Code').'</td>'; + echo '<tr><td>' . _('General Ledger Code') . '</td>'; echo '<td><select name="GLCode">'; $sql='SELECT accountcode, - accountname + accountname FROM chartmaster ORDER BY accountcode ASC'; @@ -848,7 +848,7 @@ AND (purchdata.supplierno='" . $_SESSION['PO'.$identifier]->SupplierID."' OR purchdata.supplierno IS NULL) ORDER BY stockmaster.stockid - LIMIT ".$_SESSION['DefaultDisplayRecordsMax']; + LIMIT " .$_SESSION['DefaultDisplayRecordsMax']; } else { $sql = "SELECT stockmaster.stockid, stockmaster.description, @@ -985,7 +985,7 @@ if (!isset($_GET['Edit'])) { $sql="SELECT categoryid, - categorydescription + categorydescription FROM stockcategory WHERE stocktype<>'L' AND stocktype<>'D' @@ -1027,12 +1027,11 @@ <td><input type='text' name='StockCode' size=15 maxlength=18 value='" . $_POST['StockCode'] . "'></td> </tr> <tr><td></td> - <td><font size=3><b>" . _('OR') . ' </b></font><a target="_blank" href="'.$rootpath.'/Stocks.php?"' . SID . - '">' . _('Create a New Stock Item') . "</a></td></tr> + <td><font size=3><b>" . _('OR') . ' </b></font><a target="_blank" href="'.$rootpath.'/Stocks.php?">' . _('Create a New Stock Item') . '</a></td></tr> </table><br /> - <div class='centre'><input type=submit name='Search' value='" . _('Search Now') . "'> - <input type=submit name='NonStockOrder' value='" . _('Order a non stock item') . "'> - </div><br />"; + <div class="centre"><input type="submit" name="Search" value="' . _('Search Now') . '"> + <input type="submit" name="NonStockOrder" value="' . _('Order a non stock item') . '"> + </div><br />'; $PartsDisplayed =0; } @@ -1066,9 +1065,7 @@ $FileName = $myrow['stockid'] . '.jpg'; if (file_exists( $_SESSION['part_pics_dir'] . '/' . $FileName) ) { - $ImageSource = '<img src="'.$rootpath . '/' . $_SESSION['part_pics_dir'] . '/' . $myrow['stockid'] . - '.jpg" width="50" height="50">'; - + $ImageSource = '<img src="'.$rootpath . '/' . $_SESSION['part_pics_dir'] . '/' . $myrow['stockid'] . '.jpg" width="50" height="50">'; } else { $ImageSource = '<i>'._('No Image').'</i>'; } Modified: trunk/PricesByCost.php =================================================================== --- trunk/PricesByCost.php 2011-04-02 01:42:42 UTC (rev 4535) +++ trunk/PricesByCost.php 2011-04-02 09:40:49 UTC (rev 4536) @@ -1,7 +1,6 @@ <?php /* $Id$ */ -//$PageSecurity = 11; Now from DB include ('includes/session.inc'); $title = _('Update of Prices By A Multiple Of Cost'); include ('includes/header.inc'); @@ -46,48 +45,48 @@ $PriceCounter =0; while ($myrow = DB_fetch_array($result)) { - $SQLTestExists = "SELECT price FROM prices - WHERE stockid = '" . $_POST['StockID_' . $PriceCounter] . "' - AND prices.typeabbrev ='" . $_POST['SalesType'] . "' - AND prices.currabrev ='" . $_POST['CurrCode'] . "' - AND prices.debtorno ='" . $_POST['DebtorNo_' . $PriceCounter] . "' - AND prices.branchcode ='" . $_POST['BranchCode_' . $PriceCounter] . "' - AND prices.startdate ='" . date('Y-m-d') . "'"; - $TestExistsResult = DB_query($SQLTestExists,$db); - if (DB_num_rows($TestExistsResult)==1){ + $SQLTestExists = "SELECT price FROM prices + WHERE stockid = '" . $_POST['StockID_' . $PriceCounter] . "' + AND prices.typeabbrev ='" . $_POST['SalesType'] . "' + AND prices.currabrev ='" . $_POST['CurrCode'] . "' + AND prices.debtorno ='" . $_POST['DebtorNo_' . $PriceCounter] . "' + AND prices.branchcode ='" . $_POST['BranchCode_' . $PriceCounter] . "' + AND prices.startdate ='" . date('Y-m-d') . "'"; + $TestExistsResult = DB_query($SQLTestExists,$db); + if (DB_num_rows($TestExistsResult)==1){ //then we are updating - $SQLUpdate = "UPDATE prices SET price = '" . $_POST['Price_' . $PriceCounter] . "' - WHERE stockid = '" . $_POST['StockID_' . $PriceCounter] . "' - AND prices.typeabbrev ='" . $_POST['SalesType'] . "' + $SQLUpdate = "UPDATE prices SET price = '" . $_POST['Price_' . $PriceCounter] . "' + WHERE stockid = '" . $_POST['StockID_' . $PriceCounter] . "' + AND prices.typeabbrev ='" . $_POST['SalesType'] . "' AND prices.currabrev ='" . $_POST['CurrCode'] . "' AND prices.debtorno ='" . $_POST['DebtorNo_' . $PriceCounter] . "' AND prices.branchcode ='" . $_POST['BranchCode_' . $PriceCounter] . "' AND prices.startdate ='" . date('Y-m-d') . "' AND prices.enddate ='" . $_POST['EndDate_' . $PriceCounter] . "'"; - $ResultUpdate = DB_query($SQLUpdate, $db); - } else { - //we need to add a new price from today - $SQLInsert = "INSERT INTO prices ( - stockid, - price, - typeabbrev, - currabrev, - debtorno, - branchcode, - startdate - ) VALUES ( - '" . $_POST['StockID_' . $PriceCounter] . "', - '" . $_POST['Price_' . $PriceCounter] . "', - '" . $_POST['SalesType'] . "', - '" . $_POST['CurrCode'] . "', - '" . $_POST['DebtorNo_' . $PriceCounter] . "', - '" . $_POST['BranchCode_' . $PriceCounter] . "', - '" . date('Y-m-d') . "' - )"; - $ResultInsert = DB_query($SQLInsert, $db); - } + $ResultUpdate = DB_query($SQLUpdate, $db); + } else { + //we need to add a new price from today + $SQLInsert = "INSERT INTO prices ( + stockid, + price, + typeabbrev, + currabrev, + debtorno, + branchcode, + startdate + ) VALUES ( + '" . $_POST['StockID_' . $PriceCounter] . "', + '" . $_POST['Price_' . $PriceCounter] . "', + '" . $_POST['SalesType'] . "', + '" . $_POST['CurrCode'] . "', + '" . $_POST['DebtorNo_' . $PriceCounter] . "', + '" . $_POST['BranchCode_' . $PriceCounter] . "', + '" . date('Y-m-d') . "' + )"; + $ResultInsert = DB_query($SQLInsert, $db); + } $PriceCounter++; - } + }//end while loop DB_free_result($result); //clear the old result $result = DB_query($sql, $db); //re-run the query with the updated prices $numrow = DB_num_rows($result); // get the new number - should be the same!! @@ -116,24 +115,24 @@ if ($numrow > 0) { //the number of prices returned from the main prices query is echo '<table class=selection>'; echo '<tr><th>' . _('Code') . '</th> - <th>' . _('Description') . '</th> - <th>' . _('Customer') . '</th> - <th>' . _('Branch') . '</th> - <th>' . _('Start Date') . '</th> - <th>' . _('End Date') . '</th> - <th>' . _('Cost') . '</th> - <th>' . _('GP %') . '</th> - <th>' . _('Price Proposed') . '</th> - <th>' . _('List Price') . '</th> - <tr>'; + <th>' . _('Description') . '</th> + <th>' . _('Customer') . '</th> + <th>' . _('Branch') . '</th> + <th>' . _('Start Date') . '</th> + <th>' . _('End Date') . '</th> + <th>' . _('Cost') . '</th> + <th>' . _('GP %') . '</th> + <th>' . _('Price Proposed') . '</th> + <th>' . _('List Price') . '</th> + <tr>'; $k = 0; //row colour counter echo '<form action="' .$_SERVER['PHP_SELF'] .'" method="POST" name="update">'; echo '<input type="hidden" name="FormID" value="' . $_SESSION['FormID'] . '" />'; echo'<input type="hidden" value=' . $_POST['StockCat'] . ' name="StockCat"> - <input type="hidden" value=' . $_POST['Margin'] . ' name="Margin"> - <input type="hidden" value=' . $_POST['CurrCode'] . ' name="CurrCode"> - <input type="hidden" value=' . $_POST['Comparator'] . ' name="Comparator"> - <input type="hidden" value=' . $_POST['SalesType'] . ' name="SalesType">'; + <input type="hidden" value=' . $_POST['Margin'] . ' name="Margin"> + <input type="hidden" value=' . $_POST['CurrCode'] . ' name="CurrCode"> + <input type="hidden" value=' . $_POST['Comparator'] . ' name="Comparator"> + <input type="hidden" value=' . $_POST['SalesType'] . ' name="SalesType">'; $PriceCounter =0; while ($myrow = DB_fetch_array($result)) { @@ -154,10 +153,10 @@ //variables for update echo '<input type="hidden" value=' . $myrow['stockid'] . ' name="StockID_' . $PriceCounter .'"> - <input type="hidden" value=' . $myrow['debtorno'] . ' name="DebtorNo_' . $PriceCounter .'"> - <input type="hidden" value=' . $myrow['branchcode'] . ' name="BranchCode_' . $PriceCounter .'"> - <input type="hidden" value=' . $myrow['startdate'] . ' name="StartDate_' . $PriceCounter .'"> - <input type="hidden" value=' . $myrow['enddate'] . ' name="EndDate_' . $PriceCounter .'">'; + <input type="hidden" value=' . $myrow['debtorno'] . ' name="DebtorNo_' . $PriceCounter .'"> + <input type="hidden" value=' . $myrow['branchcode'] . ' name="BranchCode_' . $PriceCounter .'"> + <input type="hidden" value=' . $myrow['startdate'] . ' name="StartDate_' . $PriceCounter .'"> + <input type="hidden" value=' . $myrow['enddate'] . ' name="EndDate_' . $PriceCounter .'">'; //variable for current margin if ($myrow['price'] != 0){ $CurrentGP = ($myrow['price']-$Cost)*100 / $myrow['price']; @@ -172,25 +171,25 @@ $EndDateDisplay = ConvertSQLDate($myrow['enddate']); } echo ' <td>' . $myrow['stockid'] . '</td> - <td>' . $myrow['description'] . '</td> - <td>' . $myrow['customer'] . '</td> - <td>' . $myrow['branch'] . '</td> - <td>' . ConvertSQLDate($myrow['startdate']) . '</td> - <td>' . $EndDateDisplay . '</td> - <td class="number">' . number_format($Cost, 2) . '</td> - <td class="number">' . number_format($CurrentGP, 1) . '%</td> - <td class="number">' . number_format($Proposed, 2) . '</td> - <td><input type="text" class="number" name="Price_' . $PriceCounter . '" maxlength=14 size=10 value="' . $myrow['price'] . '"></td> - </tr> '; + <td>' . $myrow['description'] . '</td> + <td>' . $myrow['customer'] . '</td> + <td>' . $myrow['branch'] . '</td> + <td>' . ConvertSQLDate($myrow['startdate']) . '</td> + <td>' . $EndDateDisplay . '</td> + <td class="number">' . number_format($Cost, 2) . '</td> + <td class="number">' . number_format($CurrentGP, 1) . '%</td> + <td class="number">' . number_format($Proposed, 2) . '</td> + <td><input type="text" class="number" name="Price_' . $PriceCounter . '" maxlength=14 size=10 value="' . $myrow['price'] . '"></td> + </tr> '; $PriceCounter++; } //end of looping echo '<tr> <td style="text-align:right" colspan=4><input type=submit name=submit value=' . _('Update') . '></td> - <td style="text-align:left" colspan=3><a href="' . $_SERVER['PHP_SELF'] . '?' . SID . '"><input type=submit value=' . _('Back') . '><a/></td> + <td style="text-align:left" colspan=3><a href="' . $_SERVER['PHP_SELF'] . '"><input type=submit value=' . _('Back') . '><a/></td> </tr></form>'; } else { prnMsg(_('There were no prices meeting the criteria specified to review'),'info'); - echo '<p><div class="centre"><a href="' . $_SERVER['PHP_SELF'] . '?' . SID . '">' . _('Back') . '<a/></div><p>'; + echo '<p><div class="centre"><a href="' . $_SERVER['PHP_SELF'] . '">' . _('Back') . '<a/></div><p>'; } } else { /*The option to submit was not hit so display form */ echo '<div class="page_help_text">' . _('Use this report to display price list with the cost.') . '</div><br>'; @@ -206,13 +205,13 @@ <td><select name="StockCat">'; echo '<option value="all">' . _('All Categories') . ''; while ($myrow1 = DB_fetch_array($result1)) { - echo '<option value="' . $myrow1['categoryid'] . '">' . $myrow1['categorydescription']; + echo '<option value="' . $myrow1['categoryid'] . '">' . $myrow1['categorydescription'] . '</option>'; } echo '</select></td></tr>'; echo '<tr><td>' . _('Price') . ' <select name="Comparator">'; - echo '<option value="1">' . _('Less than or equal to') . ''; - echo '<option value="2">' . _('Greater than or equal to') . ''; + echo '<option value="1">' . _('Less than or equal to') . '</option>'; + echo '<option value="2">' . _('Greater than or equal to') . '</option>'; if ($_SESSION['WeightedAverageCosting']==1) { echo '</select>'.' '. _('Average Cost') . ' x </td>'; } else { @@ -221,23 +220,22 @@ if (!isset($_POST['Margin'])){ $_POST['Margin']=1; } - echo '<td> - <input type="text" class="number" name="Margin" MAXLENGTH =8 size=8 value=' .$_POST['Margin'] . '></td></tr>'; + echo '<td><input type="text" class="number" name="Margin" MAXLENGTH =8 size=8 value=' .$_POST['Margin'] . '></td></tr>'; $result = DB_query('SELECT typeabbrev, sales_type FROM salestypes ', $db); - echo '<tr><td>' . _('Sales Type') . '/' . _('Price List') . ":</td> - <td><select name='SalesType'>"; + echo '<tr><td>' . _('Sales Type') . '/' . _('Price List') . ':</td> + <td><select name="SalesType">'; while ($myrow = DB_fetch_array($result)) { if ($_POST['SalesType'] == $myrow['typeabbrev']) { - echo "<option selected value='" . $myrow['typeabbrev'] . "'>" . $myrow['sales_type'] . '</option>'; + echo '<option selected value="' . $myrow['typeabbrev'] . '">' . $myrow['sales_type'] . '</option>'; } else { - echo "<option value='" . $myrow['typeabbrev'] . "'>" . $myrow['sales_type'] . '</option>'; + echo '<option value="' . $myrow['typeabbrev'] . '">' . $myrow['sales_type'] . '</option>'; } } //end while loop DB_data_seek($result, 0); $result = DB_query('SELECT currency, currabrev FROM currencies', $db); echo '</select></td></tr> - <tr><td>' . _('Currency') . ":</td> - <td><select name='CurrCode'>"; + <tr><td>' . _('Currency') . ':</td> + <td><select name="CurrCode">'; while ($myrow = DB_fetch_array($result)) { if (isset($_POST['CurrCode']) and $_POST['CurrCode'] == $myrow['currabrev']) { echo '<option selected value=' . $myrow['currabrev'] . '>' . $myrow['currency'] . '</option>'; @@ -247,7 +245,8 @@ } //end while loop DB_data_seek($result, 0); echo '</select></td></tr>'; - echo "</table></br><p><div class='centre'><input type=submit name='submit' value='" . _('Submit') . "'></div></p>"; + echo '</table> + </br><p><div class="centre"><input type="submit" name="submit" value="' . _('Submit') . '"></div></p>'; } /*end of else not submit */ include ('includes/footer.inc'); ?> \ No newline at end of file Modified: trunk/PrintCustTransPortrait.php =================================================================== --- trunk/PrintCustTransPortrait.php 2011-04-02 01:42:42 UTC (rev 4535) +++ trunk/PrintCustTransPortrait.php 2011-04-02 09:40:49 UTC (rev 4536) @@ -2,8 +2,6 @@ /* $Id$ */ -//$PageSecurity = 1; - include('includes/session.inc'); if (isset($_GET['FromTransNo'])) { @@ -81,9 +79,11 @@ nobble the invoice reprints */ // check if the user has set a default bank account for invoices, if not leave it blank - $sql = 'SELECT bankaccounts.invoice, bankaccounts.bankaccountnumber, bankaccounts.bankaccountcode - from bankaccounts - WHERE bankaccounts.invoice = 1'; + $sql = "SELECT bankaccounts.invoice, + bankaccounts.bankaccountnumber, + bankaccounts.bankaccountcode + FROM bankaccounts + WHERE bankaccounts.invoice = '1'"; $result=DB_query($sql,$db,'','',false,false); if (DB_error_no($db)!=1) { if (DB_num_rows($result)==1){ @@ -233,7 +233,7 @@ prnMsg( _('There was a problem retrieving the invoice or credit note details for note number') . ' ' . $InvoiceToPrint . ' ' . _('from the database') . '. ' . _('To print an invoice, the sales order record, the customer transaction record and the branch record for the customer must not have been purged') . '. ' . _('To print a credit note only requires the customer, transaction, salesman and branch records be available'),'error'); if ($debug==1){ - prnMsg (_('The SQL used to get this information that failed was') . "<br>" . $sql,'error'); + prnMsg (_('The SQL used to get this information that failed was') . "<br />" . $sql,'error'); } include ('includes/footer.inc'); exit; @@ -284,9 +284,9 @@ if (DB_error_no($db)!=0) { $title = _('Transaction Print Error Report'); include ('includes/header.inc'); - echo '<br>' . _('There was a problem retrieving the invoice or credit note stock movement details for invoice number') . ' ' . $FromTransNo . ' ' . _('from the database'); + echo '<br />' . _('There was a problem retrieving the invoice or credit note stock movement details for invoice number') . ' ' . $FromTransNo . ' ' . _('from the database'); if ($debug==1){ - echo '<br>' . _('The SQL used to get this information that failed was') . "<br>$sql"; + echo '<br />' . _('The SQL used to get this information that failed was') . '<br />' . $sql; } include('includes/footer.inc'); exit; @@ -329,9 +329,10 @@ if ($myrow2['controlled']==1){ - $GetControlMovts = DB_query('SELECT moveqty, serialno + $GetControlMovts = DB_query("SELECT moveqty, + serialno FROM stockserialmoves - WHERE stockmoveno=' . $myrow2['stkmoveno'],$db); + WHERE stockmoveno='" . $myrow2['stkmoveno'] . "'",$db); if ($myrow2['serialised']==1){ while ($ControlledMovtRow = DB_fetch_array($GetControlMovts)){ @@ -469,7 +470,7 @@ } /* Add Images for Visa / Mastercard / Paypal */ if (file_exists('companies/' . $_SESSION['DatabaseName'] . '/payment.jpg')) { - $pdf->addJpegFromFile('companies/' . $_SESSION['DatabaseName'] . '/payment.jpg',$Page_Width/2 -60,$YPos-15,0,20); + $pdf->addJpegFromFile('companies/' . $_SESSION['DatabaseName'] . '/payment.jpg',$Page_Width/2 -60,$YPos-15,0,20); } // Print Bank acount details if available and default for invoices is selected $pdf->addText($Page_Width-$Right_Margin-450, $YPos - ($line_height*3)+22,$FontSize, $DefaultBankAccountCode . ' ' . $DefaultBankAccountNumber); @@ -503,12 +504,12 @@ $title = _('Emailing') . ' ' .$InvOrCredit . ' ' . _('Number') . ' ' . $FromTransNo; include('includes/header.inc'); - echo '<p>' . $InvOrCredit . ' ' . _('number') . ' ' . $_GET['FromTransNo'] . ' ' . _('has been emailed to') . ' ' . $_GET['Email']; + echo '<p>' . $InvOrCredit . ' ' . _('number') . ' ' . $FromTransNo . ' ' . _('has been emailed to') . ' ' . $_GET['Email']; include('includes/footer.inc'); exit; } else { //its not an email just print the invoice to PDF - $pdf->OutputD($_SESSION['DatabaseName'] . '_' . $InvOrCredit . '_' . $_GET['FromTransNo'] . '.pdf'); + $pdf->OutputD($_SESSION['DatabaseName'] . '_' . $InvOrCredit . '_' . $FromTransNo . '.pdf'); } $pdf->__destruct(); @@ -522,56 +523,56 @@ /*if FromTransNo is not set then show a form to allow input of either a single invoice number or a range of invoices to be printed. Also get the last invoice number created to show the user where the current range is up to */ - echo '<form action="' . $_SERVER['PHP_SELF'] . '?' . SID . '" 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 '<p class="page_title_text"><img src="'.$rootpath.'/css/'.$theme.'/images/printer.png" title="' . _('Print') . '" alt="" />' . ' ' . _('Print Invoices or Credit Notes (Portrait Mode)') . '</p>'; - echo '<tr><td>' . _('Print Invoices or Credit Notes') . '</td><td><select name=InvOrCredit>'; + echo '<tr><td>' . _('Print Invoices or Credit Notes') . '</td> + <td><select name="InvOrCredit">'; if ($InvOrCredit=='Invoice' OR !isset($InvOrCredit)){ - echo "<option selected VALUE='Invoice'>" . _('Invoices'); - echo "<option VALUE='Credit'>" . _('Credit Notes'); - + echo '<option selected value="Invoice">' . _('Invoices') . '</option>'; + echo '<option value="Credit">' . _('Credit Notes') . '</option>'; } else { - - echo "<option selected VALUE='Credit'>" . _('Credit Notes'); - echo "<option VALUE='Invoice'>" . _('Invoices'); - + echo '<option selected value="Credit">' . _('Credit Notes') . '</option>'; + echo '<option VALUE="Invoice">' . _('Invoices') . '</option>'; } - echo '</select></td></tr>'; - echo '<tr><td>' . _('Print EDI Transactions') . '</td><td><select name=PrintEDI>'; + echo '<tr><td>' . _('Print EDI Transactions') . '</td><td><select name="PrintEDI">'; if ($InvOrCredit=='Invoice' OR !isset($InvOrCredit)){ - echo "<option selected VALUE='No'>" . _('Do not Print PDF EDI Transactions'); - echo "<option VALUE='Yes'>" . _('Print PDF EDI Transactions Too'); + echo '<option selected value="No">' . _('Do not Print PDF EDI Transactions') . '</option>'; + echo '<option VALUE="Yes">' . _('Print PDF EDI Transactions Too') . '</option>'; } else { - echo "<option VALUE='No'>" . _('Do not Print PDF EDI Transactions'); - echo "<option selected VALUE='Yes'>" . _('Print PDF EDI Transactions Too'); + echo '<option VALUE="No">' . _('Do not Print PDF EDI Transactions') . '</option>'; + echo '<option selected value="Yes">' . _('Print PDF EDI Transactions Too') . '</option>'; } echo '</select></td></tr>'; - echo '<tr><td>' . _('Start invoice/credit note number to print') . '</td><td><input class=number type=text max=6 size=7 name=FromTransNo></td></tr>'; - echo '<tr><td>' . _('End invoice/credit note number to print') . "</td><td><input class=number type=text max=6 size=7 name='ToTransNo'></td></tr></table>"; - echo "<div class='centre'><br><input type=Submit Name='Print' Value='" . _('Print Preview') . "'><p>"; - echo "<input type=Submit Name='PrintPDF' Value='" . _('Print PDF') . "'></div>"; + echo '<tr><td>' . _('Start invoice/credit note number to print') . '</td> + <td><input class="number" type="text" max="6" size="7" name="FromTransNo"></td></tr>'; + echo '<tr><td>' . _('End invoice/credit note number to print') . '</td> + <td><input class="number" type="text" max="6" size="7" name="ToTransNo"></td></tr> + </table>'; + echo '<div class="centre"><br /><input type="submit" name="Print" value="' . _('Print Preview') . '"><p>'; + echo '<input type="submit" name="PrintPDF" value="' . _('Print PDF') . '"></div>'; $sql = 'SELECT typeno FROM systypes WHERE typeid=10'; $result = DB_query($sql,$db); $myrow = DB_fetch_row($result); - echo '<div class="page_help_text"><b>' . _('The last invoice created was number') . ' ' . $myrow[0] . '</b><br>' . _('If only a single invoice is required') . ', ' . _('enter the invoice number to print in the Start transaction number to print field and leave the End transaction number to print field blank') . '. ' . _('Only use the end invoice to print field if you wish to print a sequential range of invoices') . ''; + echo '<div class="page_help_text"><b>' . _('The last invoice created was number') . ' ' . $myrow[0] . '</b><br />' . _('If only a single invoice is required') . ', ' . _('enter the invoice number to print in the Start transaction number to print field and leave the End transaction number to print field blank') . '. ' . _('Only use the end invoice to print field if you wish to print a sequential range of invoices') . ''; - $sql = 'SELECT typeno FROM systypes WHERE typeid=11'; + $sql = "SELECT typeno FROM systypes WHERE typeid='11'"; $result = DB_query($sql,$db); $myrow = DB_fetch_row($result); - echo '<br><b>' . _('The last credit note created was number') . ' ' . $myrow[0] . '</b><br>' . _('A sequential range can be printed using the same method as for invoices above') . '. ' . _('A single credit note can be printed by only entering a start transaction number') . '</DIV'; + echo '<br /><b>' . _('The last credit note created was number') . ' ' . $myrow[0] . '</b><br />' . _('A sequential range can be printed using the same method as for invoices above') . '. ' . _('A single credit note can be printed by only entering a start transaction number') . '</DIV'; } else { @@ -677,7 +678,7 @@ if (DB_num_rows($result)==0 OR DB_error_no($db)!=0) { echo '<p>' . _('There was a problem retrieving the invoice or credit note details for note number') . ' ' . $InvoiceToPrint . ' ' . _('from the database') . '. ' . _('To print an invoice, the sales order record, the customer transaction record and the branch record for the customer must not have been purged') . '. ' . _('To print a credit note only requires the customer, transaction, salesman and branch records be available'); if ($debug==1){ - echo _('The SQL used to get this information that failed was') . "<br>$sql"; + echo _('The SQL used to get this information that failed was') . "<br />$sql"; } break; include('includes/footer.inc'); @@ -694,33 +695,41 @@ $ExchRate = $myrow['rate']; $PageNumber = 1; - echo '<table class="table1"><tr><td VALIGN=TOP WIDTH=10%><img src="' . $_SESSION['LogoFile'] . '"></td><td bgcolor="#bbb"><b>'; + echo '<table class="table1"> + <tr><td valign=top width=10%><img src="' . $_SESSION['LogoFile'] . '"></td><td bgcolor="#bbb"><b>'; if ($InvOrCredit=='Invoice') { echo '<font size=4>' . _('TAX INVOICE') . ' '; } else { echo '<font color=RED size=4>' . _('TAX CREDIT NOTE') . ' '; } - echo '</b>' . _('Number') . ' ' . $FromTransNo . '</font><br><font size=1>' . _('Tax Authority Ref') . '. ' . $_SESSION['CompanyRecord']['gstno'] . '</td></tr></table>'; + echo '</b>' . _('Number') . ' ' . $FromTransNo . '</font><br /><font size=1>' . _('Tax Authority Ref') . '. ' . $_SESSION['CompanyRecord']['gstno'] . '</td></tr></table>'; /*Now print out the logo and company name and address */ - echo '<table class"table1"><tr><td><font size=4 color="#333"><b>' . $_SESSION['CompanyRecord']['coyname'] . '</b></font><br>'; - echo $_SESSION['CompanyRecord']['regoffice1'] . '<br>'; - echo $_SESSION['CompanyRecord']['regoffice2'] . '<br>'; - echo $_SESSION['CompanyRecord']['regoffice3'] . '<br>'; - echo $_SESSION['CompanyRecord']['regoffice4'] . '<br>'; - echo $_SESSION['CompanyRecord']['regoffice5'] . '<br>'; - echo $_SESSION['CompanyRecord']['regoffice6'] . '<br>'; - echo _('Telephone') . ': ' . $_SESSION['CompanyRecord']['telephone'] . '<br>'; - echo _('Facsimile') . ': ' . $_SESSION['CompanyRecord']['fax'] . '<br>'; - echo _('Email') . ': ' . $_SESSION['CompanyRecord']['email'] . '<br>'; + echo '<table class"table1"><tr><td><font size=4 color="#333"><b>' . $_SESSION['CompanyRecord']['coyname'] . '</b></font><br />'; + echo $_SESSION['CompanyRecord']['regoffice1'] . '<br />'; + echo $_SESSION['CompanyRecord']['regoffice2'] . '<br />'; + echo $_SESSION['CompanyRecord']['regoffice3'] . '<br />'; + echo $_SESSION['CompanyRecord']['regoffice4'] . '<br />'; + echo $_SESSION['CompanyRecord']['regoffice5'] . '<br />'; + echo $_SESSION['CompanyRecord']['regoffice6'] . '<br />'; + echo _('Telephone') . ': ' . $_SESSION['CompanyRecord']['telephone'] . '<br />'; + echo _('Facsimile') . ': ' . $_SESSION['CompanyRecord']['fax'] . '<br />'; + echo _('Email') . ': ' . $_SESSION['CompanyRecord']['email'] . '<br />'; echo '</td><td width=50% class=number>'; /*Now the customer charged to details in a sub table within a cell of the main table*/ echo '<table class="table1"><tr><td align="left" bgcolor="#bbb"><b>' . _('Charge To') . ':</b></td></tr><tr><td bgcolor="#eee">'; - echo $myrow['name'] . '<br>' . $myrow['address1'] . '<br>' . $myrow['address2'] . '<br>' . $myrow['address3'] . '<br>' . $myrow['address4'] . '<br>' . $myrow['address5'] . '<br>' . $myrow['address6']; + echo $myrow['name'] . + '<br />' . $myrow['address1'] . + '<br />' . $myrow['address2'] . + '<br />' . $myrow['address3'] . + '<br />' . $myrow['address4'] . + '<br />' . $myrow['address5'] . + '<br />' . $myrow['address6']; + echo '</td></tr></table>'; /*end of the small table showing charge to account details */ echo _('Page') . ': ' . $PageNumber; @@ -735,9 +744,23 @@ <td align=left bgcolor="#bbb"><b>' . _('Delivered To') . ':</b></td> </tr>'; echo '<tr> - <td bgcolor="#eee">' .$myrow['brname'] . '<br />' . $myrow['braddress1'] . '<br />' . $myrow['braddress2'] . '<br />' . $myrow['braddress3'] . '<br />' . $myrow['braddress4'] . '<br />' . $myrow['braddress5'] . '<br />' . $myrow['braddress6'] . '</td>'; + <td bgcolor="#eee">' .$myrow['brname'] . + '<br />' . $myrow['braddress1'] . + '<br />' . $myrow['braddress2'] . + '<br />' . $myrow['braddress3'] . + '<br />' . $myrow['braddress4'] . + '<br />' . $myrow['braddress5'] . + '<br />' . $myrow['braddress6'] . + '</td>'; - echo '<td bgcolor="#eee">' . $myrow['deliverto'] . '<br />' . $myrow['deladd1'] . '<br />' . $myrow['deladd2'] . '<br />' . $myrow['deladd3'] . '<br />' . $myrow['deladd4'] . '<br />' . $myrow['deladd5'] . '<br />' . $myrow['deladd6'] . '</td>'; + echo '<td bgcolor="#eee">' . $myrow['deliverto'] . + '<br />' . $myrow['deladd1'] . + '<br />' . $myrow['deladd2'] . + '<br />' . $myrow['deladd3'] . + '<br />' . $myrow['deladd4'] . + '<br />' . $myrow['deladd5'] . + '<br />' . $myrow['deladd6'] . + '</td>'; echo '</tr> </table><hr>'; @@ -751,16 +774,16 @@ <td align=left bgcolor="#bbb"><b>' . _('Shipper') . '</b></td> <td align=left bgcolor="#bbb"><b>' . _('Consignment Ref') . '</b></td> </tr>'; - echo "<tr> - <td bgcolor='#EEEEEE'>" . $myrow['customerref'] . "</td> - <td bgcolor='#EEEEEE'>" .$myrow['orderno'] . "</td> - <td bgcolor='#EEEEEE'>" . ConvertSQLDate($myrow['orddate']) . "</td> - <td bgcolor='#EEEEEE'>" . ConvertSQLDate($myrow['trandate']) . "</td> - <td bgcolor='#EEEEEE'>" . $myrow['salesmanname'] . "</td> - <td bgcolor='#EEEEEE'>" . $myrow['shippername'] . "</td> - <td bgcolor='#EEEEEE'>" . $myrow['consignment'] . "</td> + echo '<tr> + <td bgcolor="#EEEEEE">' . $myrow['customerref'] . '</td> + <td bgcolor="#EEEEEE">' .$myrow['orderno'] . '</td> + <td bgcolor="#EEEEEE">' . ConvertSQLDate($myrow['orddate']) . '</td> + <td bgcolor="#EEEEEE">' . ConvertSQLDate($myrow['trandate']) . '</td> + <td bgcolor="#EEEEEE">' . $myrow['salesmanname'] . '</td> + <td bgcolor="#EEEEEE">' . $myrow['shippername'] . '</td> + <td bgcolor="#EEEEEE">' . $myrow['consignment'] . '</td> </tr> - </table>"; + </table>'; $sql ="SELECT stockmoves.stockid, stockmaster.description, @@ -780,19 +803,26 @@ } else { /* then its a credit note */ - echo "<table WIDTH=50%><tr> - <td align=left bgcolor='#BBBBBB'><b>" . _('Branch') . ":</b></td> - </tr>"; - echo "<tr> - <td bgcolor='#EEEEEE'>" .$myrow['brname'] . '<br>' . $myrow['braddress1'] . '<br>' . $myrow['braddress2'] . '<br>' . $myrow['braddress3'] . '<br>' . $myrow['braddress4'] . '<br>' . $myrow['braddress5'] . '<br>' . $myrow['braddress6'] . '</td> + echo '<table WIDTH=50%><tr> + <td align=left bgcolor="#BBBBBB"><b>' . _('Branch') . ':</b></td> + </tr>'; + echo '<tr> + <td bgcolor="#EEEEEE">' .$myrow['brname'] . + '<br />' . $myrow['braddress1'] . + '<br />' . $myrow['braddress2'] . + '<br />' . $myrow['braddress3'] . + '<br />' . $myrow['braddress4'] . + '<br />' . $myrow['braddress5'] . + '<br />' . $myrow['braddress6'] . + '</td> </tr></table>'; echo '<hr><table class="table1"><tr> - <td align=left bgcolor="#bbb"><b>' . _('Date') . "</b></td> - <td align=left bgcolor='#BBBBBB'><b>" . _('Sales Person') . "</font></b></td> - </tr>"; - echo "<tr> - <td bgcolor='#EEEEEE'>" . ConvertSQLDate($myrow['trandate']) . "</td> - <td bgcolor='#EEEEEE'>" . $myrow['salesmanname'] . '</td> + <td align=left bgcolor="#bbbbbb"><b>' . _('Date') . '</b></td> + <td align=left bgcolor="#BBBBBB"><b>' . _('Sales Person') . '</font></b></td> + </tr>'; + echo '<tr> + <td bgcolor="#EEEEEE">' . ConvertSQLDate($myrow['trandate']) . '</td> + <td bgcolor="#EEEEEE">' . $myrow['salesmanname'] . '</td> </tr></table>'; @@ -801,7 +831,8 @@ stockmoves.qty as quantity, stockmoves.discountpercent, ((1 - stockmoves.discountpercent) * stockmoves.price * " . $ExchRate . " * stockmoves.qty) AS fxnet, (stockmoves.price * " . $ExchRate . ") AS fxprice, - stockmaster.units + stockmaster.units, + stockmoves.narrative FROM stockmoves, stockmaster WHERE stockmoves.stockid = stockmaster.stockid @@ -815,22 +846,22 @@ $result=DB_query($sql,$db); if (DB_error_no($db)!=0) { - echo '<br>' . _('There was a problem retrieving the invoice or credit note stock movement details for invoice number') . ' ' . $FromTransNo . ' ' . _('from the database'); + echo '<br />' . _('There was a problem retrieving the invoice or credit note stock movement details for invoice number') . ' ' . $FromTransNo . ' ' . _('from the database'); if ($debug==1){ - echo '<br>' . _('The SQL used to get this information that failed was') . "<br>$sql"; + echo '<br />' . _('The SQL used to get this information that failed was') . '<br />' . $sql; } exit; } if (DB_num_rows($result)>0){ echo '<table class="table1"> - <tr><th>' . _('Item Code') . "</th> - <th>" . _('Item Description') . "</th> - <th>" . _('Quantity') . "</th> - <th>" . _('Unit') . "</th> - <th>" . _('Price') . "</th> - <th>" . _('Discount') . "</th> - <th>" . _('Net') . '</th></tr>'; + <tr><th>' . _('Item Code') . '</th> + <th>' . _('Item Description') . '</th> + <th>' . _('Quantity') . '</th> + <th>' . _('Unit') . '</th> + <th>' . _('Price') . '</th> + <th>' . _('Discount') . '</th> + <th>' . _('Net') . '</th></tr>'; $LineCounter =17; $k=0; //row colour counter @@ -891,29 +922,29 @@ } else { echo '<font color=RED size=4>' . _('TAX CREDIT NOTE') . ' '; } - echo '</b>' . _('Number') . ' ' . $FromTransNo . '</font><br><font size=1>' . _('GST Number') . ' - ' . $_SESSION['CompanyRecord']['gstno'] . '</td></tr></table>'; + echo '</b>' . _('Number') . ' ' . $FromTransNo . '</font><br /><font size=1>' . _('GST Number') . ' - ' . $_SESSION['CompanyRecord']['gstno'] . '</td></tr></table>'; /*Now print out company name and address */ echo '<table class="table1"><tr> - <td><font size=4 color="#333"><b>' . $_SESSION['CompanyRecord']['coyname'] . '</b></font><br>'; - echo $_SESSION['CompanyRecord']['regoffice1'] . '<br>'; - echo $_SESSION['CompanyRecord']['regoffice2'] . '<br>'; - echo $_SESSION['CompanyRecord']['regoffice3'] . '<br>'; - echo $_SESSION['CompanyRecord']['regoffice4'] . '<br>'; - echo $_SESSION['CompanyRecord']['regoffice5'] . '<br>'; - echo $_SESSION['CompanyRecord']['regoffice6'] . '<br>'; - echo _('Telephone') . ': ' . $_SESSION['CompanyRecord']['telephone'] . '<br>'; - echo _('Facsimile') . ': ' . $_SESSION['CompanyRecord']['fax'] . '<br>'; - echo _('Email') . ': ' . $_SESSION['CompanyRecord']['email'] . '<br>'; - echo '</td><td class=number>' . _('Page') . ": $PageNumber</td></tr></table>"; + <td><font size=4 color="#333"><b>' . $_SESSION['CompanyRecord']['coyname'] . '</b></font><br />'; + echo $_SESSION['CompanyRecord']['regoffice1'] . '<br />'; + echo $_SESSION['CompanyRecord']['regoffice2'] . '<br />'; + echo $_SESSION['CompanyRecord']['regoffice3'] . '<br />'; + echo $_SESSION['CompanyRecord']['regoffice4'] . '<br />'; + echo $_SESSION['CompanyRecord']['regoffice5'] . '<br />'; + echo $_SESSION['CompanyRecord']['regoffice6'] . '<br />'; + echo _('Telephone') . ': ' . $_SESSION['CompanyRecord']['telephone'] . '<br />'; + echo _('Facsimile') . ': ' . $_SESSION['CompanyRecord']['fax'] . '<br />'; + echo _('Email') . ': ' . $_SESSION['CompanyRecord']['email'] . '<br />'; + echo '</td><td class=number>' . _('Page') . ': ' . $PageNumber . '</td></tr></table>'; echo '<table class="table1"><tr> - <th>' . _('Item Code') . "</th> - <th>" . _('Item Description') . "</th> - <th>" . _('Quantity') . "</th> - <th>" . _('Unit') . "</th> - <th>" . _('Price') . "</th> - <th>" . _('Discount') . "</th> - <th>" . _('Net') . "</th></tr>"; + <th>' . _('Item Code') . '</th> + <th>' . _('Item Description') . '</th> + <th>' . _('Quantity') . '</th> + <th>' . _('Unit') . '</th> + <th>' . _('Price') . '</th> + <th>' . _('Discount') . '</th> + <th>' . _('Net') . '</th></tr>'; $LineCounter = 10; @@ -936,28 +967,28 @@ } else { echo '<font color=RED size=4>' . _('TAX CREDIT NOTE') . ' '; } - echo '</b>' . _('Number') . ' ' . $FromTransNo . '</font><br><font size=1>' . _('GST Number') . ' - ' . $_SESSION['CompanyRecord']['gstno'] . '</td></tr></table>'; + echo '</b>' . _('Number') . ' ' . $FromTransNo . '</font><br /><font size=1>' . _('GST Number') . ' - ' . $_SESSION['CompanyRecord']['gstno'] . '</td></tr></table>'; /*Print out the logo and company name and address */ - echo '<table class="table1"><tr><td><font size=4 color="#333"><b>' . $_SESSION['CompanyRecord']['coyname'] . '</b></font><br>'; - echo $_SESSION['CompanyRecord']['regoffice1'] . '<br>'; - echo $_SESSION['CompanyRecord']['regoffice2'] . '<br>'; - echo $_SESSION['CompanyRecord']['regoffice3'] . '<br>'; - echo $_SESSION['CompanyRecord']['regoffice4'] . '<br>'; - echo $_SESSION['CompanyRecord']['regoffice5'] . '<br>'; - echo $_SESSION['CompanyRecord']['regoffice6'] . '<br>'; - echo _('Telephone') . ': ' . $_SESSION['CompanyRecord']['telephone'] . '<br>'; - echo _('Facsimile') . ': ' . $_SESSION['CompanyRecord']['fax'] . '<br>'; - echo _('Email') . ': ' . $_SESSION['CompanyRecord']['email'] . '<br>'; + echo '<table class="table1"><tr><td><font size=4 color="#333"><b>' . $_SESSION['CompanyRecord']['coyname'] . '</b></font><br />'; + echo $_SESSION['CompanyRecord']['regoffice1'] . '<br />'; + echo $_SESSION['CompanyRecord']['regoffice2'] . '<br />'; + echo $_SESSION['CompanyRecord']['regoffice3'] . '<br />'; + echo $_SESSION['CompanyRecord']['regoffice4'] . '<br />'; + echo $_SESSION['CompanyRecord']['regoffice5'] . '<br />'; + echo $_SESSION['CompanyRecord']['regoffice6'] . '<br />'; + echo _('Telephone') . ': ' . $_SESSION['CompanyRecord']['telephone'] . '<br />'; + echo _('Facsimile') . ': ' . $_SESSION['CompanyRecord']['fax'] . '<br />'; + echo _('Email') . ': ' . $_SESSION['CompanyRecord']['email'] . '<br />'; echo '</td><td class=number>' . _('Page') . ": $PageNumber</td></tr></table>"; echo '<table class="table1"><tr> - <th>' . _('Item Code') . "</th> - <th>" . _('Item Description') . "</th> - <th>" . _('Quantity') . "</th> - <th>" . _('Unit') . "</th> - <th>" . _('Price') . "</th> - <th>" . _('Discount') . "</th> - <th>" . _('Net') . '</th></tr></table>'; + <th>' . _('Item Code') . '</th> + <th>' . _('Item Description') . '</th> + <th>' . _('Quantity') . '</th> + <th>' . _('Unit') . '</th> + <th>' . _('Price') . '</th> + <th>' . _('Discount') . '</th> + <th>' . _('Net') . '</th></tr></table>'; $LineCounter = 10; } @@ -988,18 +1019,18 @@ } /*Print out the invoice text entered */ echo '<table class="table1"><tr> - <td class=number>' . _('Sub Total') . "</td> - <td class=number bgcolor='#EEEEEE' WIDTH='15%'>$DisplaySubTot</td></tr>"; - echo '<tr><td class=number>' . _('Freight') . "</td> - <td class=number bgcolor='#EEEEEE'>$DisplayFreight</td></tr>"; - echo '<tr><td class=number>' . _('Tax') . "</td> - <td class=number bgcolor='#EEEEEE'>$DisplayTax</td></tr>"; + <td class="number">' . _('Sub Total') . '</td> + <td class="number" bgcolor="#EEEEEE" WIDTH="15%">' . $DisplaySubTot . '</td></tr>'; + echo '<tr><td class="number">' . _('Freight') . '</td> + <td class="number" bgcolor="#EEEEEE">' . $DisplayFreight . '</td></tr>'; + echo '<tr><td class="number">' . _('Tax') . '</td> + <td class="number" bgcolor="#EEEEEE">' . $DisplayTax . '</td></tr>'; if ($InvOrCredit=='Invoice'){ - echo '<tr><td class=number><b>' . _('TOTAL INVOICE') . "</b></td> - <td class=number bgcolor='#EEEEEE'><U><b>$DisplayTotal</b></U></td></tr>"; + echo '<tr><td class="number"><b>' . _('TOTAL INVOICE') . '</b></td> + <td class="number" bgcolor="#EEEEEE"><U><b>' . $DisplayTotal . '</b></U></td></tr>'; } else { - echo '<tr><td class=number><font color=RED><b>' . _('TOTAL CREDIT') . "</b></font></td> - <td class=number bgcolor='#EEEEEE'><font color=RED><U><b>$DisplayTotal</b></U></font></td></tr>"; + echo '<tr><td class=number><font color=RED><b>' . _('TOTAL CREDIT') . '</b></font></td> + <td class="number" bgcolor="#EEEEEE"><font color="red"><U><b>' . $DisplayTotal . '</b></u></font></td></tr>'; } echo '</table>'; } /* end of check to see that there was an invoice record to print */ Modified: trunk/RecurringSalesOrdersProcess.php =================================================================== --- trunk/RecurringSalesOrdersProcess.php 2011-04-02 01:42:42 UTC (rev 4535) +++ trunk/RecurringSalesOrdersProcess.php 2011-04-02 09:40:49 UTC (rev 4536) @@ -85,7 +85,7 @@ while ($RecurrOrderRow = DB_fetch_array($RecurrOrdersDueResult)){ $EmailText =''; - echo '<br>' . _('Rec... [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] |
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] |
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-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-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-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-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. |