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" msgs... [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] . '... [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] . '... [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['AssetLocat... [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['AssetLocat... [truncated message content] |
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) @... [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) @... [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/GetPaymentMe... [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/GetPaymentMe... [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;... [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;... [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></di... [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></di... [truncated message content] |
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 o... [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 o... [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 ASSIS... [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 ASSIS... [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 . "', - '" . $_SESSI... [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 . "', - '" . $_SESSI... [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 ... [truncated message content] |
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 ... [truncated message content] |