This list is closed, nobody may subscribe to it.
2011 |
Jan
(14) |
Feb
(42) |
Mar
(56) |
Apr
(60) |
May
(54) |
Jun
(48) |
Jul
(74) |
Aug
(52) |
Sep
(68) |
Oct
(64) |
Nov
(42) |
Dec
(62) |
---|---|---|---|---|---|---|---|---|---|---|---|---|
2012 |
Jan
(142) |
Feb
(270) |
Mar
(374) |
Apr
(230) |
May
(214) |
Jun
(116) |
Jul
(234) |
Aug
(66) |
Sep
(120) |
Oct
(16) |
Nov
(17) |
Dec
(41) |
2013 |
Jan
(19) |
Feb
(18) |
Mar
(8) |
Apr
(40) |
May
(121) |
Jun
(42) |
Jul
(127) |
Aug
(145) |
Sep
(27) |
Oct
(38) |
Nov
(83) |
Dec
(61) |
2014 |
Jan
(33) |
Feb
(35) |
Mar
(59) |
Apr
(41) |
May
(38) |
Jun
(45) |
Jul
(17) |
Aug
(58) |
Sep
(46) |
Oct
(51) |
Nov
(55) |
Dec
(36) |
2015 |
Jan
(57) |
Feb
(67) |
Mar
(70) |
Apr
(34) |
May
(32) |
Jun
(11) |
Jul
(3) |
Aug
(17) |
Sep
(16) |
Oct
(13) |
Nov
(30) |
Dec
(30) |
2016 |
Jan
(17) |
Feb
(12) |
Mar
(17) |
Apr
(20) |
May
(47) |
Jun
(15) |
Jul
(13) |
Aug
(30) |
Sep
(32) |
Oct
(20) |
Nov
(32) |
Dec
(24) |
2017 |
Jan
(16) |
Feb
|
Mar
(11) |
Apr
(11) |
May
(5) |
Jun
(42) |
Jul
(9) |
Aug
(10) |
Sep
(14) |
Oct
(15) |
Nov
(2) |
Dec
(29) |
2018 |
Jan
(28) |
Feb
(49) |
Mar
|
Apr
|
May
|
Jun
|
Jul
|
Aug
|
Sep
|
Oct
|
Nov
|
Dec
|
From: <dai...@us...> - 2011-07-24 03:17:14
|
Revision: 4637 http://web-erp.svn.sourceforge.net/web-erp/?rev=4637&view=rev Author: daintree Date: 2011-07-24 03:17:05 +0000 (Sun, 24 Jul 2011) Log Message: ----------- Modified Paths: -------------- trunk/UpgradeDatabase.php trunk/doc/Change.log trunk/install/save.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/vi_VN.utf8/LC_MESSAGES/messages.mo trunk/locale/vi_VN.utf8/LC_MESSAGES/messages.po trunk/locale/zh_CN.utf8/LC_MESSAGES/messages.mo trunk/locale/zh_CN.utf8/LC_MESSAGES/messages.po trunk/locale/zh_HK.utf8/LC_MESSAGES/messages.mo trunk/locale/zh_HK.utf8/LC_MESSAGES/messages.po trunk/sql/mysql/weberp-demo.sql trunk/sql/mysql/weberp-new.sql Modified: trunk/UpgradeDatabase.php =================================================================== --- trunk/UpgradeDatabase.php 2011-07-24 00:14:27 UTC (rev 4636) +++ trunk/UpgradeDatabase.php 2011-07-24 03:17:05 UTC (rev 4637) @@ -9,7 +9,7 @@ if (!isset($_POST['DoUpgrade'])){ - prnMsg(_('This script will perform any modifications to the database required to allow the additional functionality in later scripts'),'info'); + prnMsg(_('This script will perform any modifications to the database required to allow the additional functionality in later scripts.') . '<br />' . _('You should do a backup now before proceeding!'),'info'); echo '<p><form method="post" action="' . $_SERVER['PHP_SELF'] . '">'; echo '<input type="hidden" name="FormID" value="' . $_SESSION['FormID'] . '" />'; Modified: trunk/doc/Change.log =================================================================== --- trunk/doc/Change.log 2011-07-24 00:14:27 UTC (rev 4636) +++ trunk/doc/Change.log 2011-07-24 03:17:05 UTC (rev 4637) @@ -1,7 +1,10 @@ webERP Change Log -23/7/11 Phil: CustLoginSetup.php and SuppLoginSetup can no longer edit user accounts - only add -23/7/11 Phil: Updated Hungarian/German/Portuguese/Japanese translations from launchpad. +24/7/11 Version 4.04.5 + +24/7/11 Phil: CustomerBranches.php check for existance of Shippers and TaxGroups +24/7/11 Phil: CustLoginSetup.php and SuppLoginSetup can no longer edit user accounts - only add +24/7/11 Phil: Updated Hungarian/German/Portuguese/Japanese translations from launchpad. 22/7/11 Phil: Make link from SelectCustomer.php to CounterSales.php so that sales together with payment can be entered directly against a selected customer. 22/7/11 Phil: Change SelectCreditItems.php and SelectCustomer.php to select customer and branch using form variables in the same way as SelectOrderItems.php to avoid difficulties with spaces and hyphens - and to be consistent. 17/7/11 Phil: error in taxes GL posting SelectCreditItems.php Modified: trunk/install/save.php =================================================================== --- trunk/install/save.php 2011-07-24 00:14:27 UTC (rev 4636) +++ trunk/install/save.php 2011-07-24 03:17:05 UTC (rev 4637) @@ -264,7 +264,6 @@ //$msg holds the text of the new config.php file $msg = "<?php\n\n"; -$msg .= "/* \$Revision: 1.7 $ */\n"; $msg .= "// User configurable variables\n"; $msg .= "//---------------------------------------------------\n\n"; $msg .= "//DefaultLanguage to use for the login screen and the setup of new users - the users language selection will override\n"; 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-07-24 00:14:27 UTC (rev 4636) +++ trunk/locale/cs_CZ.utf8/LC_MESSAGES/messages.po 2011-07-24 03:17:05 UTC (rev 4637) @@ -7,7 +7,7 @@ msgstr "" "Project-Id-Version: webERP 3.08\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2011-07-02 20:11+1200\n" +"POT-Creation-Date: 2011-07-24 12:24+1200\n" "PO-Revision-Date: 2011-02-07 15:33+0000\n" "Last-Translator: Tim Schofield <Unknown>\n" "Language-Team: Czech <cs...@li...>\n" @@ -122,7 +122,7 @@ msgid "The SQL that was used to insert the account group was" msgstr "SQL, který byl použit pro vložení na účet skupina byla" -#: AccountGroups.php:158 AccountSections.php:116 PaymentMethods.php:106 +#: AccountGroups.php:158 AccountSections.php:116 PaymentMethods.php:103 msgid "Record inserted" msgstr "Záznam vložen" @@ -144,16 +144,16 @@ #: CustomerBranches.php:286 CustomerBranches.php:296 CustomerBranches.php:306 #: CustomerBranches.php:316 Customers.php:312 Customers.php:321 #: Customers.php:329 Customers.php:337 CustomerTypes.php:147 -#: CustomerTypes.php:157 Factors.php:134 FixedAssetCategories.php:130 -#: GLAccounts.php:80 GLAccounts.php:94 Locations.php:244 Locations.php:252 -#: Locations.php:261 Locations.php:269 Locations.php:277 Locations.php:285 -#: Locations.php:293 Locations.php:301 MRPDemandTypes.php:87 -#: PaymentMethods.php:140 PaymentTerms.php:147 PaymentTerms.php:154 +#: CustomerTypes.php:157 Factors.php:134 FixedAssetCategories.php:129 +#: GLAccounts.php:80 GLAccounts.php:96 Locations.php:237 Locations.php:245 +#: Locations.php:256 Locations.php:265 Locations.php:274 Locations.php:283 +#: Locations.php:292 Locations.php:301 MRPDemandTypes.php:87 +#: PaymentMethods.php:138 PaymentTerms.php:144 PaymentTerms.php:151 #: PcExpenses.php:152 SalesCategories.php:125 SalesCategories.php:133 #: SalesPeople.php:149 SalesPeople.php:156 SalesTypes.php:150 #: SalesTypes.php:160 Shippers.php:82 Shippers.php:94 StockCategories.php:179 -#: Stocks.php:475 Stocks.php:484 Stocks.php:492 Stocks.php:500 Stocks.php:508 -#: Stocks.php:516 Suppliers.php:609 Suppliers.php:618 Suppliers.php:626 +#: Stocks.php:481 Stocks.php:490 Stocks.php:498 Stocks.php:506 Stocks.php:514 +#: Stocks.php:522 Suppliers.php:609 Suppliers.php:618 Suppliers.php:626 #: SupplierTypes.php:145 TaxCategories.php:131 TaxGroups.php:127 #: TaxGroups.php:134 TaxProvinces.php:125 UnitsOfMeasure.php:138 #: WorkCentres.php:89 WorkCentres.php:95 WWW_Access.php:83 @@ -207,16 +207,16 @@ #: Areas.php:144 AuditTrail.php:11 BankReconciliation.php:13 #: BOMExtendedQty.php:259 BOMIndented.php:246 BOMIndentedReverse.php:236 #: BOMInquiry.php:171 BOMListing.php:112 BOMs.php:208 BOMs.php:798 -#: COGSGLPostings.php:18 CompanyPreferences.php:153 CounterSales.php:1983 -#: CounterSales.php:2107 Credit_Invoice.php:255 CreditStatus.php:20 +#: COGSGLPostings.php:18 CompanyPreferences.php:153 CounterSales.php:1995 +#: CounterSales.php:2116 Credit_Invoice.php:255 CreditStatus.php:20 #: Currencies.php:28 CustEDISetup.php:17 DailyBankTransactions.php:10 -#: DebtorsAtPeriodEnd.php:124 DiscountCategories.php:10 -#: DiscountCategories.php:128 DiscountMatrix.php:16 EDIMessageFormat.php:104 +#: DebtorsAtPeriodEnd.php:125 DiscountCategories.php:10 +#: DiscountCategories.php:131 DiscountMatrix.php:16 EDIMessageFormat.php:104 #: FixedAssetLocations.php:9 FixedAssetRegister.php:13 -#: FixedAssetRegister.php:238 FixedAssetTransfer.php:31 FormDesigner.php:129 +#: FixedAssetRegister.php:237 FixedAssetTransfer.php:31 FormDesigner.php:129 #: GLBalanceSheet.php:351 GLBudgets.php:28 GLJournal.php:228 -#: InventoryPlanning.php:374 InventoryPlanningPrefSupplier.php:474 -#: Labels.php:117 Labels.php:273 MRPReport.php:515 OutstandingGRNs.php:150 +#: InventoryPlanning.php:373 InventoryPlanningPrefSupplier.php:467 +#: Labels.php:115 Labels.php:270 MRPReport.php:515 OutstandingGRNs.php:160 #: PcAssignCashToTab.php:56 PcAssignCashToTab.php:130 #: PcAssignCashToTab.php:146 PcAssignCashToTab.php:183 PDFPickingList.php:28 #: PDFPrintLabel.php:131 PDFStockLocTransfer.php:21 @@ -226,10 +226,10 @@ #: PurchData.php:268 RecurringSalesOrders.php:310 SalesAnalReptCols.php:51 #: SalesAnalRepts.php:11 SalesCategories.php:11 SalesGLPostings.php:17 #: SalesGraph.php:34 SalesPeople.php:20 SalesTypes.php:20 SelectAsset.php:45 -#: SelectCompletedOrder.php:11 SelectContract.php:78 SelectCreditItems.php:202 -#: SelectCreditItems.php:270 SelectCustomer.php:323 SelectGLAccount.php:19 -#: SelectGLAccount.php:79 SelectOrderItems.php:618 SelectOrderItems.php:1463 -#: SelectOrderItems.php:1583 SelectProduct.php:485 SelectSalesOrder.php:454 +#: SelectCompletedOrder.php:11 SelectContract.php:78 SelectCreditItems.php:208 +#: SelectCreditItems.php:275 SelectCustomer.php:339 SelectGLAccount.php:19 +#: SelectGLAccount.php:79 SelectOrderItems.php:618 SelectOrderItems.php:1511 +#: SelectOrderItems.php:1633 SelectProduct.php:485 SelectSalesOrder.php:454 #: SelectSupplier.php:9 SelectSupplier.php:192 SelectWorkOrder.php:9 #: SelectWorkOrder.php:145 ShipmentCosting.php:11 Shipments.php:17 #: Shippers.php:123 Shippers.php:159 Shipt_Select.php:8 @@ -256,7 +256,7 @@ msgstr "V pořadí TB" #: AccountGroups.php:232 AccountGroups.php:378 GLProfit_Loss.php:6 -#: GLProfit_Loss.php:105 GLProfit_Loss.php:106 GLProfit_Loss.php:157 +#: GLProfit_Loss.php:113 GLProfit_Loss.php:114 GLProfit_Loss.php:165 #: SelectGLAccount.php:45 SelectGLAccount.php:59 msgid "Profit and Loss" msgstr "Zisky a ztráty" @@ -272,12 +272,12 @@ #: CompanyPreferences.php:469 CompanyPreferences.php:471 #: ContractCosting.php:194 CustomerBranches.php:410 Customers.php:597 #: Customers.php:865 Customers.php:873 Customers.php:876 -#: DeliveryDetails.php:1064 DeliveryDetails.php:1104 DeliveryDetails.php:1107 -#: GLTransInquiry.php:69 MRPCalendar.php:220 MRP.php:529 MRP.php:533 -#: MRP.php:537 MRP.php:541 PaymentMethods.php:199 PaymentMethods.php:200 -#: PaymentMethods.php:201 PaymentMethods.php:264 PaymentMethods.php:270 -#: PaymentMethods.php:276 PcAuthorizeExpenses.php:239 PDFChequeListing.php:62 -#: PDFDeliveryDifferences.php:64 PDFDIFOT.php:67 +#: DeliveryDetails.php:1063 DeliveryDetails.php:1103 DeliveryDetails.php:1106 +#: GLTransInquiry.php:68 MRPCalendar.php:221 MRP.php:529 MRP.php:533 +#: MRP.php:537 MRP.php:541 PaymentMethods.php:197 PaymentMethods.php:198 +#: PaymentMethods.php:199 PaymentMethods.php:262 PaymentMethods.php:268 +#: PaymentMethods.php:275 PcAuthorizeExpenses.php:239 PDFChequeListing.php:62 +#: PDFDeliveryDifferences.php:65 PDFDIFOT.php:75 #: PO_AuthorisationLevels.php:132 PO_AuthorisationLevels.php:137 #: PO_Header.php:761 PO_PDFPurchOrder.php:370 PO_PDFPurchOrder.php:373 #: PurchData.php:187 PurchData.php:489 PurchData.php:492 @@ -286,17 +286,16 @@ #: SalesAnalReptCols.php:404 SalesAnalRepts.php:404 SalesAnalRepts.php:407 #: SalesAnalRepts.php:430 SalesAnalRepts.php:433 SalesAnalRepts.php:456 #: SalesAnalRepts.php:459 SalesPeople.php:208 SalesPeople.php:316 -#: SalesPeople.php:318 SelectProduct.php:374 ShipmentCosting.php:627 -#: Stocks.php:878 Stocks.php:880 Stocks.php:898 Stocks.php:900 -#: SuppContractChgs.php:83 SuppLoginSetup.php:508 SuppLoginSetup.php:510 -#: SystemParameters.php:383 SystemParameters.php:406 SystemParameters.php:422 -#: SystemParameters.php:485 SystemParameters.php:493 SystemParameters.php:533 -#: SystemParameters.php:606 SystemParameters.php:615 SystemParameters.php:623 -#: SystemParameters.php:641 SystemParameters.php:648 SystemParameters.php:775 -#: SystemParameters.php:906 SystemParameters.php:908 SystemParameters.php:918 -#: SystemParameters.php:920 SystemParameters.php:974 SystemParameters.php:986 -#: SystemParameters.php:988 TaxGroups.php:293 TaxGroups.php:296 -#: TaxGroups.php:345 WWW_Users.php:592 WWW_Users.php:594 +#: SalesPeople.php:318 SelectProduct.php:374 ShipmentCosting.php:630 +#: Stocks.php:888 Stocks.php:890 Stocks.php:908 Stocks.php:910 +#: SuppContractChgs.php:83 SystemParameters.php:383 SystemParameters.php:406 +#: SystemParameters.php:422 SystemParameters.php:485 SystemParameters.php:493 +#: SystemParameters.php:533 SystemParameters.php:606 SystemParameters.php:615 +#: SystemParameters.php:623 SystemParameters.php:641 SystemParameters.php:648 +#: SystemParameters.php:775 SystemParameters.php:906 SystemParameters.php:908 +#: SystemParameters.php:918 SystemParameters.php:920 SystemParameters.php:974 +#: SystemParameters.php:986 SystemParameters.php:988 TaxGroups.php:293 +#: TaxGroups.php:296 TaxGroups.php:345 WWW_Users.php:592 WWW_Users.php:594 msgid "Yes" msgstr "Ano" @@ -308,12 +307,12 @@ #: CompanyPreferences.php:468 CompanyPreferences.php:472 #: ContractCosting.php:192 CustomerBranches.php:410 Customers.php:596 #: Customers.php:861 Customers.php:872 Customers.php:875 -#: DeliveryDetails.php:1065 DeliveryDetails.php:1105 DeliveryDetails.php:1108 -#: GLTransInquiry.php:123 MRPCalendar.php:222 MRP.php:527 MRP.php:531 -#: MRP.php:535 MRP.php:539 PaymentMethods.php:199 PaymentMethods.php:200 -#: PaymentMethods.php:201 PaymentMethods.php:265 PaymentMethods.php:271 -#: PaymentMethods.php:277 PcAuthorizeExpenses.php:237 PDFChequeListing.php:61 -#: PDFDeliveryDifferences.php:63 PDFDIFOT.php:66 +#: DeliveryDetails.php:1064 DeliveryDetails.php:1104 DeliveryDetails.php:1107 +#: GLTransInquiry.php:122 MRPCalendar.php:223 MRP.php:527 MRP.php:531 +#: MRP.php:535 MRP.php:539 PaymentMethods.php:197 PaymentMethods.php:198 +#: PaymentMethods.php:199 PaymentMethods.php:263 PaymentMethods.php:269 +#: PaymentMethods.php:276 PcAuthorizeExpenses.php:237 PDFChequeListing.php:61 +#: PDFDeliveryDifferences.php:64 PDFDIFOT.php:74 #: PO_AuthorisationLevels.php:134 PO_AuthorisationLevels.php:139 #: PO_Header.php:760 PO_PDFPurchOrder.php:371 PO_PDFPurchOrder.php:374 #: PurchData.php:190 PurchData.php:490 PurchData.php:493 @@ -322,17 +321,16 @@ #: SalesAnalReptCols.php:405 SalesAnalRepts.php:403 SalesAnalRepts.php:406 #: SalesAnalRepts.php:429 SalesAnalRepts.php:432 SalesAnalRepts.php:455 #: SalesAnalRepts.php:458 SalesPeople.php:208 SalesPeople.php:321 -#: SalesPeople.php:323 SelectProduct.php:376 ShipmentCosting.php:628 -#: Stocks.php:873 Stocks.php:875 Stocks.php:893 Stocks.php:895 -#: SuppContractChgs.php:85 SuppLoginSetup.php:507 SuppLoginSetup.php:511 -#: SystemParameters.php:384 SystemParameters.php:407 SystemParameters.php:423 -#: SystemParameters.php:486 SystemParameters.php:494 SystemParameters.php:534 -#: SystemParameters.php:607 SystemParameters.php:616 SystemParameters.php:624 -#: SystemParameters.php:642 SystemParameters.php:649 SystemParameters.php:776 -#: SystemParameters.php:905 SystemParameters.php:909 SystemParameters.php:917 -#: SystemParameters.php:921 SystemParameters.php:975 SystemParameters.php:985 -#: SystemParameters.php:989 TaxGroups.php:294 TaxGroups.php:297 -#: TaxGroups.php:347 WWW_Users.php:591 WWW_Users.php:595 +#: SalesPeople.php:323 SelectProduct.php:376 ShipmentCosting.php:631 +#: Stocks.php:883 Stocks.php:885 Stocks.php:903 Stocks.php:905 +#: SuppContractChgs.php:85 SystemParameters.php:384 SystemParameters.php:407 +#: SystemParameters.php:423 SystemParameters.php:486 SystemParameters.php:494 +#: SystemParameters.php:534 SystemParameters.php:607 SystemParameters.php:616 +#: SystemParameters.php:624 SystemParameters.php:642 SystemParameters.php:649 +#: SystemParameters.php:776 SystemParameters.php:905 SystemParameters.php:909 +#: SystemParameters.php:917 SystemParameters.php:921 SystemParameters.php:975 +#: SystemParameters.php:985 SystemParameters.php:989 TaxGroups.php:294 +#: TaxGroups.php:297 TaxGroups.php:347 WWW_Users.php:591 WWW_Users.php:595 #: includes/PDFLowGPPageHeader.inc:44 includes/PDFTaxPageHeader.inc:35 msgid "No" msgstr "Ne" @@ -341,58 +339,61 @@ #: AddCustomerNotes.php:132 AddCustomerTypeNotes.php:123 Areas.php:164 #: BankAccounts.php:223 BOMs.php:144 COGSGLPostings.php:107 #: COGSGLPostings.php:204 CreditStatus.php:172 Currencies.php:269 -#: CustLoginSetup.php:219 CustomerBranches.php:414 Customers.php:940 -#: Customers.php:973 CustomerTypes.php:202 EDIMessageFormat.php:150 -#: Factors.php:299 FixedAssetCategories.php:180 FixedAssetLocations.php:102 -#: FreightCosts.php:240 GeocodeSetup.php:170 GLAccounts.php:308 GLTags.php:82 -#: Labels.php:414 Locations.php:377 MRPDemands.php:305 MRPDemandTypes.php:120 -#: PaymentMethods.php:202 PaymentTerms.php:203 PcAssignCashToTab.php:255 +#: CustomerBranches.php:414 Customers.php:940 Customers.php:973 +#: CustomerTypes.php:202 EDIMessageFormat.php:150 Factors.php:300 +#: FixedAssetCategories.php:182 FixedAssetLocations.php:102 +#: FreightCosts.php:240 GeocodeSetup.php:173 GLAccounts.php:312 GLTags.php:83 +#: Labels.php:411 Locations.php:381 MRPDemands.php:305 MRPDemandTypes.php:120 +#: PaymentMethods.php:200 PaymentTerms.php:201 PcAssignCashToTab.php:255 #: PcClaimExpensesFromTab.php:252 PcExpenses.php:208 PcTabs.php:234 #: PcTypeTabs.php:172 PO_AuthorisationLevels.php:149 Prices_Customer.php:280 #: Prices.php:246 PurchData.php:202 SalesCategories.php:256 #: SalesGLPostings.php:132 SalesGLPostings.php:245 SalesPeople.php:219 -#: SalesTypes.php:216 SecurityTokens.php:110 SelectCustomer.php:614 -#: SelectCustomer.php:632 SelectCustomer.php:656 SelectCustomer.php:673 -#: SelectCustomer.php:696 SelectCustomer.php:712 Shippers.php:144 +#: SalesTypes.php:216 SecurityTokens.php:110 SelectCustomer.php:668 +#: SelectCustomer.php:686 SelectCustomer.php:710 SelectCustomer.php:727 +#: SelectCustomer.php:751 SelectCustomer.php:768 Shippers.php:144 #: StockCategories.php:240 SupplierContacts.php:157 SupplierTypes.php:189 -#: SuppLoginSetup.php:271 SuppTransGLAnalysis.php:118 TaxAuthorities.php:172 -#: TaxCategories.php:182 TaxGroups.php:178 TaxProvinces.php:176 -#: UnitsOfMeasure.php:188 WorkCentres.php:137 WWW_Access.php:123 -#: WWW_Users.php:306 includes/InputSerialItems.php:88 -#: includes/OutputSerialItems.php:21 +#: SuppTransGLAnalysis.php:118 TaxAuthorities.php:172 TaxCategories.php:182 +#: TaxGroups.php:178 TaxProvinces.php:176 UnitsOfMeasure.php:188 +#: WorkCentres.php:137 WWW_Access.php:123 WWW_Users.php:306 +#: includes/InputSerialItems.php:88 includes/OutputSerialItems.php:21 #, php-format msgid "Edit" msgstr "Upravit" +#: AccountGroups.php:265 +#, fuzzy +msgid "Are you sure you wish to delete this account group?" +msgstr "Jste si jisti, že chcete smazat tento obor?" + #: AccountGroups.php:265 AccountSections.php:200 AddCustomerContacts.php:150 #: AddCustomerNotes.php:133 AddCustomerTypeNotes.php:124 Areas.php:165 #: BankAccounts.php:224 BOMs.php:146 COGSGLPostings.php:108 #: COGSGLPostings.php:205 ContractBOM.php:266 ContractOtherReqts.php:117 -#: CounterSales.php:781 Credit_Invoice.php:384 CreditStatus.php:173 -#: Currencies.php:272 CustLoginSetup.php:220 CustomerReceipt.php:863 -#: Customers.php:974 CustomerTypes.php:203 DiscountCategories.php:215 -#: DiscountMatrix.php:173 EDIMessageFormat.php:151 -#: FixedAssetCategories.php:181 FreightCosts.php:241 GeocodeSetup.php:171 -#: GLAccounts.php:309 GLJournal.php:382 GLTags.php:83 Labels.php:414 -#: Locations.php:378 MRPDemands.php:306 MRPDemandTypes.php:121 -#: PaymentMethods.php:203 Payments.php:1006 PaymentTerms.php:204 +#: CounterSales.php:793 Credit_Invoice.php:381 CreditStatus.php:173 +#: Currencies.php:272 CustomerReceipt.php:863 Customers.php:974 +#: CustomerTypes.php:203 DiscountCategories.php:219 DiscountMatrix.php:175 +#: EDIMessageFormat.php:151 FixedAssetCategories.php:183 FreightCosts.php:241 +#: GeocodeSetup.php:174 GLAccounts.php:313 GLJournal.php:382 GLTags.php:84 +#: Labels.php:411 Locations.php:382 MRPDemands.php:306 MRPDemandTypes.php:121 +#: PaymentMethods.php:201 Payments.php:1015 PaymentTerms.php:202 #: PcAssignCashToTab.php:259 PcClaimExpensesFromTab.php:253 PcExpenses.php:209 #: PcExpensesTypeTab.php:185 PcTabs.php:235 PcTypeTabs.php:173 -#: PO_AuthorisationLevels.php:151 PO_Items.php:688 Prices_Customer.php:281 +#: PO_AuthorisationLevels.php:151 PO_Items.php:684 Prices_Customer.php:281 #: Prices.php:247 PurchData.php:203 SalesAnalReptCols.php:294 #: SalesAnalRepts.php:302 SalesCategories.php:257 SalesGLPostings.php:133 #: SalesGLPostings.php:246 SalesPeople.php:220 SalesTypes.php:217 -#: SecurityTokens.php:111 SelectCreditItems.php:745 SelectCustomer.php:615 -#: SelectCustomer.php:633 SelectCustomer.php:657 SelectCustomer.php:674 -#: SelectCustomer.php:697 SelectCustomer.php:713 SelectOrderItems.php:1390 +#: SecurityTokens.php:111 SelectCreditItems.php:754 SelectCustomer.php:669 +#: SelectCustomer.php:687 SelectCustomer.php:711 SelectCustomer.php:728 +#: SelectCustomer.php:752 SelectCustomer.php:769 SelectOrderItems.php:1430 #: Shipments.php:423 Shippers.php:145 SpecialOrder.php:581 #: StockCategories.php:241 StockCategories.php:535 SuppContractChgs.php:91 #: SuppCreditGRNs.php:92 SuppFixedAssetChgs.php:84 SuppInvGRNs.php:132 -#: SupplierContacts.php:158 SupplierTypes.php:191 SuppLoginSetup.php:272 -#: SuppShiptChgs.php:89 SuppTransGLAnalysis.php:119 TaxAuthorities.php:173 -#: TaxCategories.php:183 TaxGroups.php:179 TaxProvinces.php:177 -#: UnitsOfMeasure.php:189 WorkCentres.php:138 WOSerialNos.php:303 -#: WWW_Access.php:124 WWW_Users.php:307 includes/InputSerialItemsKeyed.php:59 +#: SupplierContacts.php:158 SupplierTypes.php:191 SuppShiptChgs.php:89 +#: SuppTransGLAnalysis.php:119 TaxAuthorities.php:173 TaxCategories.php:183 +#: TaxGroups.php:179 TaxProvinces.php:177 UnitsOfMeasure.php:189 +#: WorkCentres.php:138 WOSerialNos.php:303 WWW_Access.php:124 +#: WWW_Users.php:307 includes/InputSerialItemsKeyed.php:59 #: includes/OutputSerialItems.php:98 #, php-format msgid "Delete" @@ -418,7 +419,7 @@ msgid "The account group name does not exist in the database" msgstr "Účet jméno skupiny neexistuje v databázi" -#: AccountGroups.php:313 GLAccounts.php:239 GLAccounts.php:288 +#: AccountGroups.php:313 GLAccounts.php:243 GLAccounts.php:292 #: Z_ImportGLAccountGroups.php:26 msgid "Account Group" msgstr "Účetní skupina" @@ -438,16 +439,16 @@ #: AccountGroups.php:399 AccountSections.php:264 AddCustomerContacts.php:244 #: AddCustomerNotes.php:211 AddCustomerTypeNotes.php:191 Areas.php:220 #: BankAccounts.php:391 BOMs.php:730 COGSGLPostings.php:342 -#: CreditStatus.php:250 Currencies.php:393 CustLoginSetup.php:439 +#: CreditStatus.php:250 Currencies.php:393 CustLoginSetup.php:257 #: DiscountMatrix.php:136 EDIMessageFormat.php:247 #: FixedAssetCategories.php:322 FixedAssetLocations.php:148 -#: FreightCosts.php:339 GeocodeSetup.php:267 GLAccounts.php:258 -#: Locations.php:561 MRPDemands.php:411 MRPDemandTypes.php:180 +#: FreightCosts.php:339 GeocodeSetup.php:270 GLAccounts.php:262 +#: Locations.php:567 MRPDemands.php:411 MRPDemandTypes.php:185 #: OffersReceived.php:52 OffersReceived.php:129 PaymentMethods.php:282 -#: PaymentTerms.php:284 PO_AuthorisationLevels.php:244 Prices_Customer.php:350 +#: PaymentTerms.php:293 PO_AuthorisationLevels.php:244 Prices_Customer.php:350 #: SalesAnalReptCols.php:510 SalesAnalRepts.php:494 SalesGLPostings.php:416 #: SalesPeople.php:329 Shippers.php:196 StockCategories.php:557 -#: SupplierContacts.php:258 SuppLoginSetup.php:529 TaxAuthorities.php:312 +#: SupplierContacts.php:258 SuppLoginSetup.php:287 TaxAuthorities.php:312 #: TaxCategories.php:233 TaxProvinces.php:227 UnitsOfMeasure.php:240 #: WorkCentres.php:261 WWW_Users.php:625 msgid "Enter Information" @@ -514,8 +515,8 @@ msgid "Could not retrieve the requested section please try again." msgstr "Nepodařilo se získat požadovanou sekci prosím zkuste to znovu." -#: AddCustomerContacts.php:6 AddCustomerContacts.php:61 SelectCustomer.php:607 -#: SelectCustomer.php:639 +#: AddCustomerContacts.php:6 AddCustomerContacts.php:61 SelectCustomer.php:661 +#: SelectCustomer.php:693 msgid "Customer Contacts" msgstr "Zákazník Kontakty" @@ -558,10 +559,10 @@ #: AddCustomerContacts.php:61 AddCustomerNotes.php:50 #: AddCustomerTypeNotes.php:48 Areas.php:73 CustomerTypes.php:69 -#: DeliveryDetails.php:771 Factors.php:105 FixedAssetItems.php:236 +#: DeliveryDetails.php:770 Factors.php:105 FixedAssetItems.php:243 #: PcAssignCashToTab.php:88 PcClaimExpensesFromTab.php:79 PcExpenses.php:93 -#: PcTabs.php:102 PcTypeTabs.php:60 PO_Items.php:356 SalesAnalReptCols.php:129 -#: SalesPeople.php:96 SalesTypes.php:66 Stocks.php:355 Suppliers.php:510 +#: PcTabs.php:102 PcTypeTabs.php:60 PO_Items.php:354 SalesAnalReptCols.php:129 +#: SalesPeople.php:96 SalesTypes.php:66 Stocks.php:361 Suppliers.php:510 #: SupplierTypes.php:67 msgid "has been updated" msgstr "byla aktualizována" @@ -576,7 +577,7 @@ #: AddCustomerContacts.php:128 CompanyPreferences.php:222 #: CustomerBranches.php:368 Customers.php:928 Customers.php:935 -#: SalesPeople.php:191 SelectCustomer.php:609 StockDispatch.php:185 +#: SalesPeople.php:191 SelectCustomer.php:663 StockDispatch.php:185 #: StockDispatch.php:197 SupplierContacts.php:145 SupplierCredit.php:441 #: SupplierInvoice.php:408 SuppTransGLAnalysis.php:103 #: includes/InputSerialItemsFile.php:84 includes/InputSerialItemsFile.php:124 @@ -585,7 +586,7 @@ msgstr "Název" #: AddCustomerContacts.php:129 AddCustomerContacts.php:220 Customers.php:929 -#: Customers.php:936 SelectCustomer.php:610 WWW_Access.php:107 +#: Customers.php:936 SelectCustomer.php:664 WWW_Access.php:107 #: WWW_Access.php:168 msgid "Role" msgstr "Roli" @@ -595,15 +596,14 @@ msgstr "Telefonní číslo" #: AddCustomerContacts.php:131 AddCustomerContacts.php:232 -#: CustLoginSetup.php:193 CustomerBranches.php:374 CustomerBranches.php:716 -#: CustomerInquiry.php:249 Customers.php:931 Customers.php:938 -#: EmailCustTrans.php:15 EmailCustTrans.php:63 Factors.php:226 Factors.php:263 -#: Locations.php:533 OrderDetails.php:105 PDFRemittanceAdvice.php:251 -#: PO_PDFPurchOrder.php:357 PO_PDFPurchOrder.php:360 PrintCustTrans.php:694 -#: PrintCustTrans.php:914 PrintCustTrans.php:961 -#: PrintCustTransPortrait.php:715 PrintCustTransPortrait.php:935 -#: PrintCustTransPortrait.php:979 SelectCustomer.php:612 -#: SupplierContacts.php:149 SupplierContacts.php:253 SuppLoginSetup.php:237 +#: CustomerBranches.php:374 CustomerBranches.php:718 CustomerInquiry.php:249 +#: Customers.php:931 Customers.php:938 EmailCustTrans.php:15 +#: EmailCustTrans.php:63 Factors.php:225 Factors.php:263 Locations.php:539 +#: OrderDetails.php:104 PDFRemittanceAdvice.php:251 PO_PDFPurchOrder.php:357 +#: PO_PDFPurchOrder.php:360 PrintCustTrans.php:709 PrintCustTrans.php:931 +#: PrintCustTrans.php:980 PrintCustTransPortrait.php:728 +#: PrintCustTransPortrait.php:949 PrintCustTransPortrait.php:997 +#: SelectCustomer.php:666 SupplierContacts.php:149 SupplierContacts.php:253 #: UserSettings.php:180 WWW_Users.php:262 includes/PDFPickingListHeader.inc:25 #: includes/PDFStatementPageHeader.inc:67 includes/PDFTransPageHeader.inc:82 #: includes/PDFTransPageHeaderPortrait.inc:109 @@ -614,7 +614,7 @@ #: AddCustomerContacts.php:132 AddCustomerContacts.php:238 Customers.php:932 #: Customers.php:939 PcAssignCashToTab.php:220 PcAssignCashToTab.php:346 #: PcAuthorizeExpenses.php:91 PcClaimExpensesFromTab.php:214 -#: PcClaimExpensesFromTab.php:372 PcReportTab.php:327 SelectCustomer.php:613 +#: PcClaimExpensesFromTab.php:372 PcReportTab.php:327 SelectCustomer.php:667 #: SystemParameters.php:322 WOSerialNos.php:280 WOSerialNos.php:282 msgid "Notes" msgstr "Bere na vědomí" @@ -632,20 +632,20 @@ msgid "Contact Code" msgstr "Kontakt kód" -#: AddCustomerContacts.php:214 Factors.php:220 SupplierContacts.php:225 +#: AddCustomerContacts.php:214 Factors.php:219 SupplierContacts.php:225 msgid "Contact Name" msgstr "Jméno kontaktní osoby" #: AddCustomerContacts.php:226 Contracts.php:777 PDFRemittanceAdvice.php:247 -#: PO_Header.php:965 PO_Header.php:1035 SelectCreditItems.php:223 -#: SelectCustomer.php:463 SelectOrderItems.php:647 +#: PO_Header.php:965 PO_Header.php:1035 SelectCreditItems.php:230 +#: SelectCustomer.php:487 SelectOrderItems.php:647 #: includes/PDFStatementPageHeader.inc:63 includes/PDFTransPageHeader.inc:81 #: includes/PDFTransPageHeaderPortrait.inc:105 msgid "Phone" msgstr "Telefon" -#: AddCustomerNotes.php:6 AddCustomerNotes.php:50 SelectCustomer.php:649 -#: SelectCustomer.php:680 +#: AddCustomerNotes.php:6 AddCustomerNotes.php:50 SelectCustomer.php:703 +#: SelectCustomer.php:734 msgid "Customer Notes" msgstr "Zákazník bere na vědomí" @@ -682,17 +682,17 @@ #: BankMatching.php:231 BankReconciliation.php:198 BankReconciliation.php:270 #: ContractCosting.php:169 CustomerAllocations.php:331 #: CustomerAllocations.php:357 CustomerInquiry.php:192 -#: CustomerTransInquiry.php:90 GLAccountInquiry.php:154 -#: GLAccountReport.php:369 GLTransInquiry.php:41 MRPCalendar.php:215 -#: PaymentAllocations.php:77 PcAssignCashToTab.php:216 +#: CustomerTransInquiry.php:90 GLAccountInquiry.php:152 +#: GLAccountReport.php:349 GLTransInquiry.php:40 MRPCalendar.php:216 +#: PaymentAllocations.php:62 PcAssignCashToTab.php:216 #: PcAuthorizeExpenses.php:87 PDFRemittanceAdvice.php:308 -#: PrintCustTrans.php:793 PrintCustTransPortrait.php:817 ReverseGRN.php:378 -#: ShipmentCosting.php:508 ShipmentCosting.php:579 Shipments.php:466 +#: PrintCustTrans.php:809 PrintCustTransPortrait.php:829 ReverseGRN.php:378 +#: ShipmentCosting.php:510 ShipmentCosting.php:581 Shipments.php:466 #: StockDispatch.php:187 StockDispatch.php:199 StockLocMovements.php:83 #: StockMovements.php:92 StockSerialItemResearch.php:79 #: SupplierAllocations.php:454 SupplierAllocations.php:559 #: SupplierAllocations.php:630 SupplierInquiry.php:201 -#: SupplierTransInquiry.php:89 includes/PDFQuotationPageHeader.inc:91 +#: SupplierTransInquiry.php:89 includes/PDFQuotationPageHeader.inc:92 #: includes/PDFQuotationPortraitPageHeader.inc:90 #: includes/PDFStatementPageHeader.inc:169 includes/PDFTaxPageHeader.inc:36 #: includes/PDFTransPageHeader.inc:48 @@ -701,7 +701,7 @@ msgstr "Datum" #: AddCustomerNotes.php:114 AddCustomerTypeNotes.php:105 PcReportTab.php:173 -#: Stocks.php:882 UpgradeDatabase.php:171 UpgradeDatabase.php:174 +#: Stocks.php:892 UpgradeDatabase.php:171 UpgradeDatabase.php:174 #: UpgradeDatabase.php:177 UpgradeDatabase.php:180 UpgradeDatabase.php:183 #: UpgradeDatabase.php:186 UpgradeDatabase.php:189 UpgradeDatabase.php:192 #: Z_Upgrade_3.10-3.11.php:62 Z_Upgrade_3.10-3.11.php:66 @@ -733,7 +733,7 @@ msgid "Contact Note" msgstr "Kontakt Poznámka:" -#: AddCustomerTypeNotes.php:5 SelectCustomer.php:689 +#: AddCustomerTypeNotes.php:5 SelectCustomer.php:744 msgid "Customer Type (Group) Notes" msgstr "Typ zákazníka (Group) Poznámky" @@ -741,7 +741,7 @@ msgid "The Contact priority must be an integer." msgstr "Prioritou Kontakt musí být celé číslo." -#: AddCustomerTypeNotes.php:48 SelectCustomer.php:719 +#: AddCustomerTypeNotes.php:48 SelectCustomer.php:775 msgid "Customer Group Notes" msgstr "Zákaznická skupina bere na vědomí" @@ -793,21 +793,21 @@ #: AgedDebtors.php:270 AgedDebtors.php:369 AgedDebtors.php:434 #: AgedSuppliers.php:107 BOMExtendedQty.php:149 BOMIndented.php:150 #: BOMIndentedReverse.php:141 BOMListing.php:44 BOMListing.php:55 -#: DebtorsAtPeriodEnd.php:56 DebtorsAtPeriodEnd.php:68 GLBalanceSheet.php:90 -#: GLBalanceSheet.php:128 GLProfit_Loss.php:157 GLTagProfit_Loss.php:172 -#: GLTrialBalance.php:151 InventoryPlanning.php:99 InventoryPlanning.php:174 -#: InventoryPlanning.php:209 InventoryPlanning.php:257 -#: InventoryPlanning.php:295 InventoryPlanningPrefSupplier.php:208 -#: InventoryPlanningPrefSupplier.php:276 InventoryPlanningPrefSupplier.php:310 -#: InventoryPlanningPrefSupplier.php:355 InventoryPlanningPrefSupplier.php:401 -#: InventoryQuantities.php:81 InventoryValuation.php:78 -#: MailInventoryValuation.php:115 MRPPlannedPurchaseOrders.php:114 -#: MRPPlannedWorkOrders.php:105 MRPReport.php:147 MRPReport.php:508 +#: DebtorsAtPeriodEnd.php:57 DebtorsAtPeriodEnd.php:69 GLBalanceSheet.php:90 +#: GLBalanceSheet.php:128 GLProfit_Loss.php:165 GLTagProfit_Loss.php:186 +#: GLTrialBalance.php:155 InventoryPlanning.php:98 InventoryPlanning.php:173 +#: InventoryPlanning.php:208 InventoryPlanning.php:256 +#: InventoryPlanning.php:294 InventoryPlanningPrefSupplier.php:201 +#: InventoryPlanningPrefSupplier.php:269 InventoryPlanningPrefSupplier.php:303 +#: InventoryPlanningPrefSupplier.php:348 InventoryPlanningPrefSupplier.php:394 +#: InventoryQuantities.php:84 InventoryValuation.php:78 +#: MailInventoryValuation.php:114 MRPPlannedPurchaseOrders.php:114 +#: MRPPlannedWorkOrders.php:106 MRPReport.php:147 MRPReport.php:508 #: MRPReschedules.php:45 MRPReschedules.php:57 MRPShortages.php:155 -#: MRPShortages.php:167 OutstandingGRNs.php:48 OutstandingGRNs.php:60 +#: MRPShortages.php:167 OutstandingGRNs.php:53 OutstandingGRNs.php:65 #: PDFCustomerList.php:18 PDFCustomerList.php:230 PDFCustomerList.php:242 -#: PDFLowGP.php:20 PDFStockCheckComparison.php:35 -#: PDFStockCheckComparison.php:61 PDFStockCheckComparison.php:262 +#: PDFLowGP.php:20 PDFStockCheckComparison.php:32 +#: PDFStockCheckComparison.php:58 PDFStockCheckComparison.php:263 #: ReorderLevel.php:57 SelectAsset.php:37 SelectProduct.php:39 #: StockCheck.php:65 StockCheck.php:139 SupplierTenders.php:326 #: SuppPriceList.php:118 includes/PDFPaymentRun_PymtFooter.php:149 @@ -815,7 +815,7 @@ msgstr "Problém" #: AgedDebtors.php:272 CustomerInquiry.php:85 CustomerInquiry.php:109 -#: DebtorsAtPeriodEnd.php:58 +#: DebtorsAtPeriodEnd.php:59 msgid "The customer details could not be retrieved by the SQL because" msgstr "Zákazník podrobnosti se nepodařilo získat do SQL, protože" @@ -823,29 +823,29 @@ #: AgedSuppliers.php:110 AgedSuppliers.php:192 BOMExtendedQty.php:152 #: BOMExtendedQty.php:246 BOMIndented.php:153 BOMIndented.php:234 #: BOMIndentedReverse.php:145 BOMIndentedReverse.php:222 BOMListing.php:47 -#: Credit_Invoice.php:184 DebtorsAtPeriodEnd.php:59 DebtorsAtPeriodEnd.php:71 +#: Credit_Invoice.php:184 DebtorsAtPeriodEnd.php:60 DebtorsAtPeriodEnd.php:72 #: FTP_RadioBeacon.php:187 GetStockImage.php:154 GLBalanceSheet.php:93 -#: GLBalanceSheet.php:131 GLBalanceSheet.php:294 GLProfit_Loss.php:160 -#: GLProfit_Loss.php:172 GLTagProfit_Loss.php:175 GLTagProfit_Loss.php:187 -#: GLTrialBalance.php:154 GLTrialBalance.php:166 InventoryPlanning.php:102 -#: InventoryPlanning.php:177 InventoryPlanning.php:212 -#: InventoryPlanning.php:260 InventoryPlanning.php:298 -#: InventoryPlanning.php:361 InventoryPlanningPrefSupplier.php:211 -#: InventoryPlanningPrefSupplier.php:279 InventoryPlanningPrefSupplier.php:313 -#: InventoryPlanningPrefSupplier.php:358 InventoryPlanningPrefSupplier.php:404 -#: InventoryPlanningPrefSupplier.php:460 InventoryQuantities.php:84 -#: InventoryQuantities.php:95 InventoryValuation.php:81 -#: InventoryValuation.php:92 MailInventoryValuation.php:118 -#: MailInventoryValuation.php:214 MRPPlannedPurchaseOrders.php:117 -#: MRPPlannedPurchaseOrders.php:128 MRPPlannedWorkOrders.php:108 -#: MRPPlannedWorkOrders.php:119 MRPPlannedWorkOrders.php:306 MRPReport.php:39 +#: GLBalanceSheet.php:131 GLBalanceSheet.php:294 GLProfit_Loss.php:168 +#: GLProfit_Loss.php:180 GLTagProfit_Loss.php:190 GLTagProfit_Loss.php:203 +#: GLTrialBalance.php:158 GLTrialBalance.php:170 InventoryPlanning.php:101 +#: InventoryPlanning.php:176 InventoryPlanning.php:211 +#: InventoryPlanning.php:259 InventoryPlanning.php:297 +#: InventoryPlanning.php:360 InventoryPlanningPrefSupplier.php:204 +#: InventoryPlanningPrefSupplier.php:272 InventoryPlanningPrefSupplier.php:306 +#: InventoryPlanningPrefSupplier.php:351 InventoryPlanningPrefSupplier.php:397 +#: InventoryPlanningPrefSupplier.php:453 InventoryQuantities.php:87 +#: InventoryQuantities.php:98 InventoryValuation.php:81 +#: InventoryValuation.php:92 MailInventoryValuation.php:117 +#: MailInventoryValuation.php:213 MRPPlannedPurchaseOrders.php:117 +#: MRPPlannedPurchaseOrders.php:128 MRPPlannedWorkOrders.php:109 +#: MRPPlannedWorkOrders.php:120 MRPPlannedWorkOrders.php:307 MRPReport.php:39 #: MRPReport.php:50 MRPReport.php:150 MRPReschedules.php:48 #: MRPReschedules.php:60 MRPShortages.php:158 MRPShortages.php:170 -#: OutstandingGRNs.php:51 OutstandingGRNs.php:63 PDFCustomerList.php:233 -#: PDFCustomerList.php:245 PDFGrn.php:123 PDFLowGP.php:60 PDFLowGP.php:72 -#: PDFPriceList.php:124 PDFQuotation.php:234 PDFQuotationPortrait.php:235 -#: PDFRemittanceAdvice.php:84 PDFStockCheckComparison.php:39 -#: PDFStockCheckComparison.php:65 PDFStockCheckComparison.php:266 +#: OutstandingGRNs.php:56 OutstandingGRNs.php:68 PDFCustomerList.php:233 +#: PDFCustomerList.php:245 PDFGrn.php:123 PDFLowGP.php:59 PDFLowGP.php:71 +#: PDFPriceList.php:124 PDFQuotation.php:250 PDFQuotationPortrait.php:264 +#: PDFRemittanceAdvice.php:84 PDFStockCheckComparison.php:36 +#: PDFStockCheckComparison.php:62 PDFStockCheckComparison.php:267 #: PO_PDFPurchOrder.php:31 PO_PDFPurchOrder.php:149 #: PrintCustOrder_generic.php:243 PrintCustOrder.php:198 ReorderLevel.php:60 #: ReorderLevel.php:149 SalesAnalysis_UserDefined.php:28 @@ -875,8 +875,8 @@ msgstr "Podrobnosti o nesplacených transakcí pro zákazníka" #: AgedDebtors.php:371 AgedSuppliers.php:191 GLAccountCSV.php:168 -#: GLAccountInquiry.php:145 GLAccountReport.php:93 PO_Items.php:416 -#: PO_Items.php:539 PO_Items.php:563 SalesAnalReptCols.php:356 +#: GLAccountInquiry.php:143 GLAccountReport.php:94 PO_Items.php:414 +#: PO_Items.php:535 PO_Items.php:559 SalesAnalReptCols.php:356 #: SpecialOrder.php:370 StockLocTransferReceive.php:373 #: StockQuantityByDate.php:110 includes/SelectOrderItems_IntoCart.inc:53 msgid "could not be retrieved because" @@ -884,13 +884,13 @@ #: AgedDebtors.php:374 AgedSuppliers.php:194 Areas.php:95 #: ConfirmDispatch_Invoice.php:150 ConfirmDispatch_Invoice.php:957 -#: ConfirmDispatch_Invoice.php:971 Contracts.php:581 CounterSales.php:1323 -#: CounterSales.php:1337 Credit_Invoice.php:703 Credit_Invoice.php:725 +#: ConfirmDispatch_Invoice.php:971 Contracts.php:581 CounterSales.php:1335 +#: CounterSales.php:1349 Credit_Invoice.php:699 Credit_Invoice.php:721 #: CustomerReceipt.php:523 CustomerReceipt.php:655 CustomerReceipt.php:683 -#: CustomerTransInquiry.php:82 DeliveryDetails.php:393 GLProfit_Loss.php:579 -#: GLTagProfit_Loss.php:488 Payments.php:312 PDFRemittanceAdvice.php:86 +#: CustomerTransInquiry.php:82 DeliveryDetails.php:393 GLProfit_Loss.php:587 +#: GLTagProfit_Loss.php:507 Payments.php:319 PDFRemittanceAdvice.php:86 #: PurchData.php:87 PurchData.php:105 PurchData.php:237 ReverseGRN.php:191 -#: ReverseGRN.php:205 ReverseGRN.php:366 SelectCreditItems.php:1372 +#: ReverseGRN.php:205 ReverseGRN.php:366 SelectCreditItems.php:1396 #: SelectSalesOrder.php:113 SelectSalesOrder.php:277 StockCheck.php:225 #: StockCostUpdate.php:76 StockCostUpdate.php:86 StockLocStatus.php:147 #: StockMovements.php:85 StockQuantityByDate.php:86 StockReorderLevel.php:39 @@ -899,7 +899,7 @@ #: SupplierInquiry.php:130 SupplierInquiry.php:182 SupplierTransInquiry.php:81 #: SuppPaymentRun.php:111 SuppPaymentRun.php:186 SuppPaymentRun.php:216 #: WorkOrderCosting.php:399 WorkOrderReceive.php:270 WOSerialNos.php:45 -#: Z_ChangeBranchCode.php:108 Z_ChangeCustomerCode.php:92 +#: Z_ChangeBranchCode.php:105 Z_ChangeCustomerCode.php:92 #: Z_DeleteCreditNote.php:58 Z_DeleteInvoice.php:87 #: includes/PDFPaymentRun_PymtFooter.php:59 #: includes/PDFPaymentRun_PymtFooter.php:89 @@ -918,11 +918,11 @@ msgid "Aged Debtor Analysis" msgstr "Ve věku dlužníka analýza" -#: AgedDebtors.php:464 DebtorsAtPeriodEnd.php:135 +#: AgedDebtors.php:464 DebtorsAtPeriodEnd.php:136 msgid "From Customer Code" msgstr "Od kódu zákazníka" -#: AgedDebtors.php:467 DebtorsAtPeriodEnd.php:138 +#: AgedDebtors.php:467 DebtorsAtPeriodEnd.php:139 msgid "To Customer Code" msgstr "Do kódu zákazníka" @@ -969,14 +969,14 @@ #: AgedDebtors.php:515 AgedSuppliers.php:312 BOMExtendedQty.php:282 #: BOMIndented.php:272 BOMIndentedReverse.php:250 BOMListing.php:132 -#: DebtorsAtPeriodEnd.php:156 InventoryPlanning.php:442 -#: InventoryPlanningPrefSupplier.php:518 InventoryQuantities.php:187 -#: InventoryValuation.php:251 MRPPlannedPurchaseOrders.php:282 -#: MRPPlannedWorkOrders.php:335 MRPReschedules.php:140 MRPShortages.php:290 -#: OutstandingGRNs.php:162 PDFCustomerList.php:410 PDFLowGP.php:145 +#: DebtorsAtPeriodEnd.php:157 InventoryPlanning.php:442 +#: InventoryPlanningPrefSupplier.php:516 InventoryQuantities.php:203 +#: InventoryValuation.php:255 MRPPlannedPurchaseOrders.php:282 +#: MRPPlannedWorkOrders.php:336 MRPReschedules.php:140 MRPShortages.php:302 +#: OutstandingGRNs.php:172 PDFCustomerList.php:410 PDFLowGP.php:146 #: PDFPriceList.php:301 PDFRemittanceAdvice.php:152 -#: PDFStockCheckComparison.php:379 PrintCustTrans.php:536 -#: PrintCustTransPortrait.php:558 ReorderLevel.php:217 StockDispatch.php:308 +#: PDFStockCheckComparison.php:357 PrintCustTrans.php:542 +#: PrintCustTransPortrait.php:562 ReorderLevel.php:217 StockDispatch.php:308 #: SupplierBalsAtPeriodEnd.php:150 SuppPriceList.php:228 Tax.php:344 msgid "Print PDF" msgstr "Tisknout PDF" @@ -1009,12 +1009,12 @@ msgid "Aged Supplier Analysis" msgstr "Dodavatel ve věku analýza" -#: AgedSuppliers.php:278 OutstandingGRNs.php:157 PDFRemittanceAdvice.php:138 +#: AgedSuppliers.php:278 OutstandingGRNs.php:167 PDFRemittanceAdvice.php:138 #: SupplierBalsAtPeriodEnd.php:131 SuppPaymentRun.php:259 msgid "From Supplier Code" msgstr "Od kódu dodavatele" -#: AgedSuppliers.php:281 OutstandingGRNs.php:159 PDFRemittanceAdvice.php:140 +#: AgedSuppliers.php:281 OutstandingGRNs.php:169 PDFRemittanceAdvice.php:140 #: SupplierBalsAtPeriodEnd.php:133 SuppPaymentRun.php:261 msgid "To Supplier Code" msgstr "Do kódu dodavatele" @@ -1100,7 +1100,7 @@ msgstr "Kód oblasti" #: Areas.php:132 CustomerTypes.php:164 Factors.php:140 -#: FixedAssetCategories.php:135 GLAccounts.php:193 Locations.php:325 +#: FixedAssetCategories.php:134 GLAccounts.php:197 Locations.php:328 #: MRPDemands.php:248 PcAssignCashToTab.php:135 PcClaimExpensesFromTab.php:126 #: PcExpenses.php:160 PcExpensesTypeTab.php:101 PcTabs.php:166 #: PcTypeTabs.php:135 SalesAnalReptCols.php:215 SalesCategories.php:137 @@ -1135,12 +1135,12 @@ msgstr "Nesprávné datum používaného formátu, prosím, re-zadání" #: AuditTrail.php:35 BOMIndented.php:310 BOMIndentedReverse.php:289 -#: MRPCalendar.php:258 +#: MRPCalendar.php:260 msgid "From Date" msgstr "Od data" #: AuditTrail.php:37 BOMIndented.php:311 BOMIndentedReverse.php:290 -#: MRPCalendar.php:260 +#: MRPCalendar.php:262 msgid "To Date" msgstr "To Date" @@ -1151,18 +1151,18 @@ msgstr "ID uživatele" #: AuditTrail.php:43 AuditTrail.php:56 ContractBOM.php:298 -#: CounterSales.php:2113 CounterSales.php:2116 CustomerTransInquiry.php:29 +#: CounterSales.php:2122 CounterSales.php:2125 CustomerTransInquiry.php:29 #: DailySalesInquiry.php:41 DailySalesInquiry.php:43 FixedAssetRegister.php:56 -#: FixedAssetRegister.php:65 InventoryQuantities.php:153 -#: InventoryQuantities.php:175 InventoryQuantities.php:177 MRP.php:564 +#: FixedAssetRegister.php:65 InventoryQuantities.php:163 +#: InventoryQuantities.php:188 InventoryQuantities.php:190 MRP.php:564 #: MRPReport.php:523 MRPReport.php:525 MRPReschedules.php:135 #: PDFPeriodStockTransListing.php:58 PDFPriceList.php:194 -#: PDFPrintLabel.php:239 PO_Items.php:884 POReport.php:1548 +#: PDFPrintLabel.php:239 PO_Items.php:880 POReport.php:1548 #: ReorderLevel.php:175 ReorderLevel.php:177 ReorderLevel.php:205 #: ReorderLevel.php:207 SalesGraph.php:91 SalesGraph.php:93 SalesGraph.php:111 #: SalesGraph.php:113 SalesGraph.php:134 SalesGraph.php:136 SalesGraph.php:168 -#: SalesInquiry.php:1053 SalesInquiry.php:1092 SelectCreditItems.php:923 -#: SelectOrderItems.php:1589 SelectOrderItems.php:1592 SelectProduct.php:493 +#: SalesInquiry.php:1053 SalesInquiry.php:1092 SelectCreditItems.php:940 +#: SelectOrderItems.php:1639 SelectOrderItems.php:1642 SelectProduct.php:493 #: SelectProduct.php:495 StockDispatch.php:282 StockDispatch.php:284 #: StockLocStatus.php:67 StockLocStatus.php:69 StockLocStatus.php:87 #: StockLocStatus.php:91 StockLocStatus.php:95 StockQuantityByDate.php:21 @@ -1194,10 +1194,10 @@ #: AuditTrail.php:146 BankReconciliation.php:199 BankReconciliation.php:271 #: CustomerAllocations.php:355 CustomerInquiry.php:190 #: CustomerTransInquiry.php:18 CustomerTransInquiry.php:88 -#: CustWhereAlloc.php:17 CustWhereAlloc.php:88 DailyBankTransactions.php:104 -#: GLAccountInquiry.php:152 GLAccountReport.php:367 GLJournal.php:240 +#: CustWhereAlloc.php:18 CustWhereAlloc.php:92 DailyBankTransactions.php:105 +#: GLAccountInquiry.php:150 GLAccountReport.php:347 GLJournal.php:240 #: MRPReschedules.php:178 SalesByTypePeriodInquiry.php:327 -#: SelectCustomer.php:462 ShipmentCosting.php:506 ShipmentCosting.php:577 +#: SelectCustomer.php:486 ShipmentCosting.php:508 ShipmentCosting.php:579 #: StockCategories.php:215 StockLocMovements.php:81 StockMovements.php:90 #: SupplierAllocations.php:452 SupplierInquiry.php:199 #: SupplierTransInquiry.php:19 SupplierTransInquiry.php:86 @@ -1213,7 +1213,7 @@ msgstr "Tabulka" #: AuditTrail.php:148 api/api_xml-rpc.php:314 api/api_xml-rpc.php:729 -#: api/api_xml-rpc.php:1892 +#: api/api_xml-rpc.php:1914 msgid "Field Name" msgstr "Název pole" @@ -1394,7 +1394,7 @@ msgid "Bank Account Matching - Receipts" msgstr "Bankovní účet odpovídající - Příjmy" -#: BankMatching.php:20 PaymentAllocations.php:33 PaymentMethods.php:11 +#: BankMatching.php:20 PaymentAllocations.php:30 PaymentMethods.php:11 #: PDFSuppTransListing.php:41 msgid "Payments" msgstr "Platby" @@ -1439,7 +1439,7 @@ "zjistíte, odpovídající transakce." #: BankMatching.php:87 BankReconciliation.php:101 CustomerReceipt.php:726 -#: DailyBankTransactions.php:29 Payments.php:737 PDFChequeListing.php:44 +#: DailyBankTransactions.php:29 Payments.php:734 PDFChequeListing.php:44 #: TaxAuthorities.php:149 TaxAuthorities.php:305 msgid "Bank Account" msgstr "Bankovní účet" @@ -1448,8 +1448,8 @@ msgid "Show" msgstr "Zobrazit" -#: BankMatching.php:110 CreditItemsControlled.php:78 FreightCosts.php:267 -#: GoodsReceivedControlled.php:65 GoodsReceived.php:65 +#: BankMatching.php:110 CounterSales.php:218 CreditItemsControlled.php:78 +#: FreightCosts.php:267 GoodsReceivedControlled.php:65 GoodsReceived.php:65 #: StockLocTransferReceive.php:426 SupplierAllocations.php:434 #: SuppShiptChgs.php:129 msgid "from" @@ -1457,18 +1457,18 @@ #: BankMatching.php:113 ConfirmDispatchControlled_Invoice.php:58 #: EmailCustTrans.php:63 FixedAssetRegister.php:78 FTP_RadioBeacon.php:280 -#: GLAccountCSV.php:171 GLAccountReport.php:102 Payments.php:717 +#: GLAccountCSV.php:171 GLAccountReport.php:103 Payments.php:714 #: PcReportTab.php:102 PDFChequeListing.php:107 PDFChequeListing.php:117 -#: PDFChequeListing.php:192 PDFDeliveryDifferences.php:166 -#: PDFDeliveryDifferences.php:179 PDFDeliveryDifferences.php:287 -#: PDFDIFOT.php:172 PDFDIFOT.php:185 PDFDIFOT.php:289 PDFOrdersInvoiced.php:71 -#: PDFOrdersInvoiced.php:268 PDFOrderStatus.php:78 PDFOrderStatus.php:253 +#: PDFChequeListing.php:192 PDFDeliveryDifferences.php:172 +#: PDFDeliveryDifferences.php:185 PDFDeliveryDifferences.php:281 +#: PDFDIFOT.php:190 PDFDIFOT.php:203 PDFDIFOT.php:307 PDFOrdersInvoiced.php:77 +#: PDFOrdersInvoiced.php:274 PDFOrderStatus.php:82 PDFOrderStatus.php:256 #: PO_PDFPurchOrder.php:323 PricesBasedOnMarkUp.php:216 -#: PricesBasedOnMarkUp.php:355 PrintCustStatements.php:50 +#: PricesBasedOnMarkUp.php:355 PrintCustStatements.php:45 #: PrintCustTrans.php:60 PrintCustTrans.php:63 PrintCustTransPortrait.php:58 #: PrintCustTransPortrait.php:61 SalesGraph.php:200 SalesGraph.php:229 #: SalesGraph.php:233 StockLocTransferReceive.php:310 -#: StockLocTransferReceive.php:426 Stocks.php:231 Stocks.php:236 +#: StockLocTransferReceive.php:426 Stocks.php:234 Stocks.php:239 #: StockStatus.php:309 StockStatus.php:350 StockTransfers.php:426 #: includes/PDFAgedDebtorsPageHeader.inc:18 #: includes/PDFAgedSuppliersPageHeader.inc:17 @@ -1564,19 +1564,19 @@ msgid "The payments with the selected criteria could not be retrieved because" msgstr "Platby podle zadaných kriterií se nepodařilo získat, protože" -#: BankMatching.php:229 ShipmentCosting.php:507 ShipmentCosting.php:578 +#: BankMatching.php:229 ShipmentCosting.php:509 ShipmentCosting.php:580 #: SupplierAllocations.php:455 msgid "Ref" msgstr "Ref" #: BankMatching.php:232 ConfirmDispatch_Invoice.php:274 Credit_Invoice.php:279 #: CustomerAllocations.php:358 CustomerReceipt.php:842 -#: CustomerTransInquiry.php:97 CustWhereAlloc.php:92 PaymentAllocations.php:78 -#: Payments.php:969 Payments.php:972 Payments.php:984 +#: CustomerTransInquiry.php:97 CustWhereAlloc.php:96 PaymentAllocations.php:63 +#: Payments.php:972 Payments.php:976 Payments.php:992 #: PcAssignCashToTab.php:218 PcAssignCashToTab.php:339 #: PcAuthorizeExpenses.php:89 PcClaimExpensesFromTab.php:212 #: PcClaimExpensesFromTab.php:365 PcReportTab.php:172 PcReportTab.php:326 -#: PrintCheque.php:70 PrintCheque.php:84 SelectCreditItems.php:659 +#: PrintCheque.php:64 PrintCheque.php:78 SelectCreditItems.php:671 #: SuppContractChgs.php:73 SuppContractChgs.php:142 SuppFixedAssetChgs.php:74 #: SuppFixedAssetChgs.php:140 SupplierAllocations.php:456 #: SupplierCredit.php:344 SupplierCredit.php:374 SupplierCredit.php:406 @@ -1590,7 +1590,7 @@ msgstr "Částka" #: BankMatching.php:233 BankReconciliation.php:203 BankReconciliation.php:275 -#: PDFOrdersInvoiced.php:345 PDFOrderStatus.php:319 +#: PDFOrdersInvoiced.php:351 PDFOrderStatus.php:322 #: PO_SelectOSPurchOrder.php:213 PO_SelectPurchOrder.php:180 #: Shipt_Select.php:182 SuppCreditGRNs.php:227 #: includes/PDFStatementPageHeader.inc:173 @@ -1653,7 +1653,7 @@ msgstr "Bankovní účty se nepodařilo získat na SQL, protože" #: BankReconciliation.php:98 CustomerReceipt.php:717 -#: DailyBankTransactions.php:26 Payments.php:734 SuppPaymentRun.php:302 +#: DailyBankTransactions.php:26 Payments.php:731 SuppPaymentRun.php:302 msgid "The SQL used to retrieve the bank accounts was" msgstr "SQL slouží k získání bankovní účty byly" @@ -1666,12 +1666,12 @@ msgstr "Musíte nejprve" #: BankReconciliation.php:108 CustomerReceipt.php:731 -#: DailyBankTransactions.php:34 Payments.php:742 SuppPaymentRun.php:310 +#: DailyBankTransactions.php:35 Payments.php:739 SuppPaymentRun.php:310 msgid "define the bank accounts" msgstr "definovat bankovních účtů" #: BankReconciliation.php:108 CustomerReceipt.php:731 -#: DailyBankTransactions.php:34 Payments.php:742 SuppPaymentRun.php:310 +#: DailyBankTransactions.php:35 Payments.php:739 SuppPaymentRun.php:310 msgid "and general ledger accounts to be affected" msgstr "a účtů hlavní knihy mohly být postiženy" @@ -1703,15 +1703,15 @@ #: BankReconciliation.php:200 BankReconciliation.php:272 #: CustomerAllocations.php:330 CustomerAllocations.php:356 -#: CustomerInquiry.php:191 CustomerTransInquiry.php:89 CustWhereAlloc.php:89 -#: EmailCustTrans.php:15 GLAccountInquiry.php:153 PrintCustTrans.php:480 -#: PrintCustTrans.php:681 PrintCustTrans.php:901 PrintCustTrans.php:948 -#: PrintCustTransPortrait.php:502 PrintCustTransPortrait.php:703 -#: PrintCustTransPortrait.php:922 PrintCustTransPortrait.php:967 +#: CustomerInquiry.php:191 CustomerTransInquiry.php:89 CustWhereAlloc.php:93 +#: EmailCustTrans.php:15 GLAccountInquiry.php:151 PrintCustTrans.php:486 +#: PrintCustTrans.php:696 PrintCustTrans.php:918 PrintCustTrans.php:967 +#: PrintCustTransPortrait.php:506 PrintCustTransPortrait.php:716 +#: PrintCustTransPortrait.php:936 PrintCustTransPortrait.php:983 #: StockMovements.php:91 SupplierAllocations.php:453 #: SupplierAllocations.php:558 SupplierAllocations.php:629 #: SupplierTransInquiry.php:87 Z_CheckAllocs.php:58 -#: Z_CheckGLTransBalance.php:12 includes/PDFQuotationPageHeader.inc:87 +#: Z_CheckGLTransBalance.php:12 includes/PDFQuotationPageHeader.inc:88 #: includes/PDFQuotationPortraitPageHeader.inc:86 #: includes/PDFStatementPageHeader.inc:168 #: includes/PDFStatementPageHeader.inc:179 includes/PDFTransPageHeader.inc:44 @@ -1721,8 +1721,8 @@ #: BankReconciliation.php:201 BankReconciliation.php:273 #: ContractCosting.php:168 CustomerInquiry.php:194 CustomerTransInquiry.php:93 -#: CustWhereAlloc.php:90 DailyBankTransactions.php:105 GLAccountReport.php:368 -#: PaymentAllocations.php:75 PaymentAllocations.php:76 +#: CustWhereAlloc.php:94 DailyBankTransactions.php:106 GLAccountReport.php:348 +#: PaymentAllocations.php:60 PaymentAllocations.php:61 #: PDFRemittanceAdvice.php:309 ShiptsList.php:37 StockCounts.php:99 #: StockCounts.php:135 StockLocMovements.php:86 StockMovements.php:96 #: Z_CheckAllocs.php:59 includes/PDFBankingSummaryPageHeader.inc:40 @@ -1776,8 +1776,8 @@ "zůstatek na účtu. Je důležité, že směnný kurz výše odráží současnou hodnotu " "měny bankovního účtu" -#: BankReconciliation.php:331 CounterSales.php:781 Customers.php:1000 -#: SelectOrderItems.php:1401 Stocks.php:1041 WorkOrderCosting.php:518 +#: BankReconciliation.php:331 CounterSales.php:793 Customers.php:1000 +#: SelectOrderItems.php:1441 Stocks.php:1051 WorkOrderCosting.php:518 #: WorkOrderEntry.php:548 msgid "Are You Sure?" msgstr "Opravdu provést?" @@ -1844,26 +1844,26 @@ #: BOMIndentedReverse.php:288 BOMInquiry.php:178 BOMs.php:522 BOMs.php:685 #: ContractBOM.php:237 ContractBOM.php:345 ContractCosting.php:77 #: ContractCosting.php:83 ContractCosting.php:148 ContractOtherReqts.php:92 -#: Contracts.php:938 Contracts.php:973 CounterSales.php:701 -#: CounterSales.php:1994 CounterSales.php:2174 CounterSales.php:2302 -#: Credit_Invoice.php:273 DeliveryDetails.php:822 DeliveryDetails.php:887 -#: GoodsReceived.php:88 GoodsReceived.php:92 GoodsReceived.php:95 -#: InventoryPlanningPrefSupplier.php:83 InventoryQuantities.php:223 +#: Contracts.php:938 Contracts.php:973 CounterSales.php:713 +#: CounterSales.php:2006 CounterSales.php:2183 CounterSales.php:2307 +#: Credit_Invoice.php:273 DeliveryDetails.php:821 DeliveryDetails.php:886 +#: GoodsReceived.php:92 GoodsReceived.php:96 GoodsReceived.php:99 +#: InventoryPlanningPrefSupplier.php:78 InventoryQuantities.php:240 #: MRPDemands.php:293 MRPDemands.php:383 MRPPlannedPurchaseOrders.php:326 -#: MRPPlannedWorkOrders.php:258 MRPPlannedWorkOrders.php:379 MRPReport.php:413 +#: MRPPlannedWorkOrders.php:259 MRPPlannedWorkOrders.php:380 MRPReport.php:413 #: MRPReport.php:419 MRPReschedules.php:179 OffersReceived.php:95 -#: OffersReceived.php:197 OffersReceived.php:244 OrderDetails.php:155 -#: PDFOrdersInvoiced.php:384 POReport.php:743 POReport.php:1428 -#: PrintCustTrans.php:831 PrintCustTrans.php:919 PrintCustTrans.php:966 -#: PrintCustTransPortrait.php:857 PrintCustTransPortrait.php:940 -#: PrintCustTransPortrait.php:984 RecurringSalesOrders.php:321 +#: OffersReceived.php:197 OffersReceived.php:244 OrderDetails.php:154 +#: PDFOrdersInvoiced.php:390 POReport.php:743 POReport.php:1428 +#: PrintCustTrans.php:848 PrintCustTrans.php:937 PrintCustTrans.php:986 +#: PrintCustTransPortrait.php:870 PrintCustTransPortrait.php:955 +#: PrintCustTransPortrait.php:1005 RecurringSalesOrders.php:321 #: ReorderLevel.php:256 ReverseGRN.php:379 ReverseGRN.php:380 #: SalesAnalReptCols.php:18 SalesAnalReptCols.php:20 SalesGraph.php:177 #: SalesGraph.php:258 SalesInquiry.php:965 SalesTopItemsInquiry.php:222 -#: SelectCreditItems.php:651 SelectCreditItems.php:1004 -#: SelectOrderItems.php:1325 SelectOrderItems.php:1474 -#: SelectOrderItems.php:1654 SelectOrderItems.php:1778 ShipmentCosting.php:144 -#: ShipmentCosting.php:145 Shipments.php:385 Shipments.php:387 +#: SelectCreditItems.php:663 SelectCreditItems.php:1022 +#: SelectOrderItems.php:1365 SelectOrderItems.php:1523 +#: SelectOrderItems.php:1705 SelectOrderItems.php:1830 ShipmentCosting.php:145 +#: ShipmentCosting.php:146 Shipments.php:385 Shipments.php:387 #: Shipments.php:388 Shipments.php:463 Shipments.php:465 SpecialOrder.php:542 #: StockCounts.php:98 StockLocMovements.php:85 StockLocTransfer.php:185 #: StockMovements.php:95 StockStatus.php:312 StockUsageGraph.php:12 @@ -1879,14 +1879,14 @@ #: includes/PDFOrderPageHeader_generic.inc:93 #: includes/PDFPeriodStockTransListingPageHeader.inc:50 #: includes/PDFPickingListHeader.inc:74 -#: includes/PDFQuotationPageHeader.inc:102 -#: includes/PDFQuotationPortraitPageHeader.inc:101 +#: includes/PDFQuotationPageHeader.inc:103 +#: includes/PDFQuotationPortraitPageHeader.inc:103 #: includes/PDFSalesOrder_generic.inc:95 #: includes/PDFStockCheckPageHeader.inc:44 #: includes/PDFStockNegativesHeader.inc:33 #: includes/PDFStockTransferHeader.inc:39 includes/PDFTransPageHeader.inc:209 -#: includes/PO_PDFOrderPageHeader.inc:78 api/api_xml-rpc.php:2235 -#: api/api_xml-rpc.php:2281 api/api_xml-rpc.php:2477 +#: includes/PO_PDFOrderPageHeader.inc:78 api/api_xml-rpc.php:2260 +#: api/api_xml-rpc.php:2306 api/api_xml-rpc.php:2502 msgid "Quantity" msgstr "Množství" @@ -1903,20 +1903,20 @@ msgstr "Zobrazit pouze Nedostatky" #: BOMExtendedQty.php:273 BOMIndented.php:264 BOMIndentedReverse.php:244 -#: MRPPlannedPurchaseOrders.php:276 MRPPlannedWorkOrders.php:327 -#: MRPReschedules.php:130 MRPShortages.php:286 +#: MRPPlannedPurchaseOrders.php:276 MRPPlannedWorkOrders.php:328 +#: MRPReschedules.php:130 MRPShortages.php:292 msgid "Print Option" msgstr "Možnost tisku" #: BOMExtendedQty.php:275 BOMIndented.php:266 BOMIndentedReverse.php:246 -#: MRPPlannedPurchaseOrders.php:277 MRPPlannedWorkOrders.php:328 -#: MRPReschedules.php:131 MRPShortages.php:287 +#: MRPPlannedPurchaseOrders.php:277 MRPPlannedWorkOrders.php:329 +#: MRPReschedules.php:131 MRPShortages.php:294 msgid "Print With Alternating Highlighted Lines" msgstr "Tisk se střídavými Zvýrazněné Lines" #: BOMExtendedQty.php:276 BOMIndented.php:267 BOMIndentedReverse.php:247 -#: MRPPlannedPurchaseOrders.php:278 MRPPlannedWorkOrders.php:329 -#: MRPReschedules.php:132 MRPShortages.php:288 +#: MRPPlannedPurchaseOrders.php:278 MRPPlannedWorkOrders.php:330 +#: MRPReschedules.php:132 MRPShortages.php:295 msgid "Plain Print" msgstr "Prostý Tisk" @@ -1925,10 +1925,10 @@ msgstr "Rozšířená Množství kusovníku výpis " #: BOMExtendedQty.php:307 BOMIndented.php:296 BOMIndentedReverse.php:275 -#: GLAccountReport.php:353 InventoryPlanningPrefSupplier.php:63 -#: InventoryQuantities.php:209 MRPPlannedPurchaseOrders.php:305 -#: MRPPlannedWorkOrders.php:358 MRPReport.php:805 MRPReschedules.php:164 -#: MRPShortages.php:318 PDFOrderStatus.php:302 PDFPriceList.php:331 +#: GLAccountReport.php:3... [truncated message content] |
From: <dai...@us...> - 2011-07-24 00:14:36
|
Revision: 4636 http://web-erp.svn.sourceforge.net/web-erp/?rev=4636&view=rev Author: daintree Date: 2011-07-24 00:14:27 +0000 (Sun, 24 Jul 2011) Log Message: ----------- Modified Paths: -------------- trunk/CustLoginSetup.php trunk/CustomerBranches.php trunk/OrderDetails.php trunk/OutstandingGRNs.php trunk/PDFCustTransListing.php trunk/PDFDIFOT.php trunk/PDFGrn.php trunk/PDFLowGP.php trunk/PDFOrderStatus.php trunk/PDFOrdersInvoiced.php trunk/PDFPeriodStockTransListing.php trunk/PageSecurity.php trunk/PaymentAllocations.php trunk/PaymentMethods.php trunk/PaymentTerms.php trunk/Payments.php trunk/SelectOrderItems.php trunk/SuppLoginSetup.php trunk/doc/Change.log trunk/doc/Manual/ManualPrices.html trunk/includes/DefinePaymentClass.php trunk/locale/de_DE.utf8/LC_MESSAGES/messages.po trunk/locale/hu_HU.utf8/LC_MESSAGES/messages.po trunk/locale/it_IT.utf8/LC_MESSAGES/messages.po trunk/locale/ja_JP.utf8/LC_MESSAGES/messages.po trunk/locale/pt_PT.utf8/LC_MESSAGES/messages.po Modified: trunk/CustLoginSetup.php =================================================================== --- trunk/CustLoginSetup.php 2011-07-19 09:35:25 UTC (rev 4635) +++ trunk/CustLoginSetup.php 2011-07-24 00:14:27 UTC (rev 4636) @@ -22,11 +22,6 @@ '" alt="" />' . ' ' . _('Customer') . ' : ' . $_SESSION['CustomerID'] . ' - ' . $CustomerName. _(' has been selected') . '</p><br />'; -if (isset($_GET['SelectedUser'])){ - $SelectedUser = $_GET['SelectedUser']; -} elseif (isset($_POST['SelectedUser'])){ - $SelectedUser = $_POST['SelectedUser']; -} if (isset($_POST['submit'])) { @@ -48,7 +43,7 @@ $InputError = 1; prnMsg(_('The password entered must be at least 5 characters long'),'error'); } - } elseif (mb_strstr($_POST['Password'],$_POST['UserID'])!= False){ + } elseif (mb_strstr($_POST['Password'],$_POST['UserID'])!= false){ $InputError = 1; prnMsg(_('The password cannot contain the user id'),'error'); } elseif ((mb_strlen($_POST['Cust'])>0) AND (mb_strlen($_POST['BranchCode'])==0)) { @@ -60,7 +55,7 @@ // check that the entered branch is valid for the customer code $sql = "SELECT defaultlocation FROM custbranch - WHERE debtorno='" . $_POST['Cust'] . "' + WHERE debtorno='" . $_SESSION['CustomerID'] . "' AND branchcode='" . $_POST['BranchCode'] . "'"; $ErrMsg = _('The check on validity of the customer code and branch failed because'); @@ -75,47 +70,25 @@ $InventoryLocation = $myrow[0]; } - if (isset($SelectedUser) AND $InputError !=1) { + if ($InputError !=1) { - $UpdatePassword = ''; - if ($_POST['Password'] != ""){ - $UpdatePassword = "password='" . CryptPass($_POST['Password']) . "',"; - } - - $sql = "UPDATE www_users SET realname='" . $_POST['RealName'] . "', - phone='" . $_POST['Phone'] ."', - email='" . $_POST['Email'] ."', - ".$UpdatePassword." - branchcode='" . $_POST['BranchCode'] . "', - pagesize='" . $_POST['PageSize'] . "', - theme='" . $_POST['Theme'] . "', - language ='" . $_POST['UserLanguage'] . "', - defaultlocation='" . $InventoryLocation ."', - blocked='" . $_POST['Blocked'] . "' - WHERE userid = '".$SelectedUser."'"; - - prnMsg( _('The selected user record has been updated'), 'success' ); - - - } else { //no selected user so it's an insert of new user - - $sql = "INSERT INTO www_users (userid, - realname, - customerid, - branchcode, - password, - phone, - email, - pagesize, - fullaccess, - defaultlocation, - modulesallowed, - displayrecordsmax, - theme, - language) - VALUES ('" . $_POST['UserID'] . "', + $sql = "INSERT INTO www_users (userid, + realname, + customerid, + branchcode, + password, + phone, + email, + pagesize, + fullaccess, + defaultlocation, + modulesallowed, + displayrecordsmax, + theme, + language) + VALUES ('" . $_POST['UserID'] . "', '" . $_POST['RealName'] ."', - '" . $_POST['Cust'] ."', + '" . $_SESSION['CustomerID'] ."', '" . $_POST['BranchCode'] ."', '" . CryptPass($_POST['Password']) ."', '" . $_POST['Phone'] . "', @@ -127,166 +100,27 @@ '" . $_SESSION['DefaultDisplayRecordsMax'] . "', '" . $_POST['Theme'] . "', '". $_POST['UserLanguage'] ."')"; - prnMsg( _('A new user record has been inserted'), 'success' ); + + $ErrMsg = _('The user could not be added because'); + $DbgMsg = _('The SQL that was used to insert the new user and failed was'); + $result = DB_query($sql,$db,$ErrMsg,$DbgMsg); + prnMsg( _('A new customer login has been created'), 'success' ); + include('includes/footer.inc'); + exit; } } - if ($InputError!=1){ - //run the SQL from either of the above possibilites - $ErrMsg = _('The user alterations could not be processed because'); - $DbgMsg = _('The SQL that was used to update the user and failed was'); - $result = DB_query($sql,$db,$ErrMsg,$DbgMsg); - - unset($_POST['UserID']); - unset($_POST['RealName']); - unset($_POST['Cust']); - unset($_POST['BranchCode']); - unset($_POST['Phone']); - unset($_POST['Email']); - unset($_POST['Password']); - unset($_POST['PageSize']); - unset($_POST['Theme']); - unset($_POST['UserLanguage']); - unset($_POST['Blocked']); - unset($SelectedUser); - } - -} elseif (isset($_GET['delete'])) { -//the link to delete a selected record was clicked instead of the submit button - - $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'); - } else { - - $sql="DELETE FROM www_users WHERE userid='".$SelectedUser."'"; - $ErrMsg = _('The User could not be deleted because');; - $result = DB_query($sql,$db,$ErrMsg); - prnMsg(_('User Deleted'),'info'); - } - unset($SelectedUser); } -if (!isset($SelectedUser)) { - -/* If its the first time the page has been displayed with no parameters then none of the above are true and the list of Users will be displayed with links to delete or edit each. These will call the same page again and allow update/input or deletion of the records*/ - - $sql = "SELECT userid, - realname, - phone, - email, - customerid, - branchcode, - lastvisitdate, - pagesize, - theme, - language - FROM www_users WHERE customerid = '" . $_SESSION['CustomerID'] . "'"; - $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>' . _('Last Visit') . '</th> - <th>' . _('Report Size') .'</th> - <th>' . _('Theme') .'</th> - <th>' . _('Language') .'</th> - </tr>'; - - $k=0; //row colour counter - - while ($myrow = DB_fetch_array($result)) { - if ($k==1){ - echo '<tr class="EvenTableRows">'; - $k=0; - } else { - echo '<tr class="OddTableRows">'; - $k=1; - } - - printf('<td>%s</td> - <td>%s</td> - <td>%s</td> - <td>%s</td> - <td>%s</td> - <td>%s</td> - <td>%s</td> - <td>%s</td> - <td><a href="%s&SelectedUser=%s">' . _('Edit') . '</a></td> - <td><a href="%s&SelectedUser=%s&delete=1" onclick="return confirm(\'' . _('Are you sure you wish to delete this user login?') . '\');">' . _('Delete') . '</a></td> - </tr>', - $myrow['userid'], - $myrow['realname'], - $myrow['phone'], - $myrow['email'], - $LastVisitDate, - $myrow['pagesize'], - $myrow['theme'], - $LanguagesArray[$myrow['language']], - $_SERVER['PHP_SELF'] . '?', - $myrow['userid'], - $_SERVER['PHP_SELF'] . '?', - $myrow['userid']); - - } //END WHILE LIST LOOP - echo '</table><br />'; -} //end of if there is no selected user - - -if (isset($SelectedUser)) { - echo '<div class="centre"><a href="' . $_SERVER['PHP_SELF'] .'">' . _('Review Existing Users') . '</a></div><br />'; -} echo '<form method="post" action="' . $_SERVER['PHP_SELF'] . '">'; echo '<input type="hidden" name="FormID" value="' . $_SESSION['FormID'] . '" />'; -if (isset($SelectedUser)) { - //editing an existing User +echo '<table class="selection"> + <tr> + <td>' . _('User Login') . ':</td> + <td><input type="text" name="UserID" size="22" maxlength="20" /></td> + </tr>'; - $sql = "SELECT userid, - realname, - phone, - email, - customerid, - password, - branchcode, - pagesize, - theme, - language - FROM www_users - WHERE userid='" . $SelectedUser . "'"; - - $result = DB_query($sql, $db); - $myrow = DB_fetch_array($result); - - $_POST['UserID'] = $myrow['userid']; - $_POST['RealName'] = $myrow['realname']; - $_POST['Phone'] = $myrow['phone']; - $_POST['Email'] = $myrow['email']; - $_POST['PageSize'] = $myrow['pagesize']; - $_POST['Theme'] = $myrow['theme']; - $_POST['UserLanguage'] = $myrow['language']; - - echo '<input type="hidden" name="SelectedUser" value="' . $SelectedUser . '">'; - echo '<input type="hidden" name="UserID" value="' . $_POST['UserID'] . '">'; - - echo '<table class="selection"> - <tr> - <td>' . _('User code') . ':</td> - <td>' . $_POST['UserID'] . '</td> - </tr>'; - -} else { //end of if $SelectedUser only do the else when a new record is being entered - echo '<table class="selection"> - <tr> - <td>' . _('User Login') . ':</td> - <td><input type="text" name="UserID" size="22" maxlength="20" /></td> - </tr>'; -} - if (!isset($_POST['Password'])) { $_POST['Password']=''; } @@ -312,15 +146,11 @@ //Customer is fixed by selection of customer -$_POST['Cust']=$_SESSION['CustomerID']; -echo '<input type="hidden" name="Cust" value="' . $_POST['Cust'] . '">'; -echo '<tr><td>'._('Customer Code').':</td> - <td>' . $_POST['Cust'] . '</td></tr>'; echo '<tr><td>' . _('Branch Code') . ':</td> <td><select name="BranchCode">'; -$sql = "SELECT branchcode FROM custbranch WHERE debtorno = '" . $_POST['Cust'] . "'"; +$sql = "SELECT branchcode FROM custbranch WHERE debtorno = '" . $_SESSION['CustomerID'] . "'"; $result = DB_query($sql,$db); while ($myrow=DB_fetch_array($result)){ @@ -420,20 +250,8 @@ echo '<option value="' . $LanguageEntry . '">' . $LanguageName .'</option>'; } } - - echo '</select></td></tr>'; -echo '<tr><td>' . _('Account Status') . ':</td> - <td><select name="Blocked">'; -if ($_POST['Blocked']==0){ - echo '<option selected value="0">' . _('Open') . '</option> - <option value="1">' . _('Blocked') . '</option>'; -} else { - echo '<option value="0">' . _('Open') . '</option> - <option selected value="1">' . _('Blocked') . '</option>'; -} -echo '</select></td></tr>'; echo '</table><br /> <div class="centre"><input type="submit" name="submit" value="' . _('Enter Information') . '"></div> Modified: trunk/CustomerBranches.php =================================================================== --- trunk/CustomerBranches.php 2011-07-19 09:35:25 UTC (rev 4635) +++ trunk/CustomerBranches.php 2011-07-24 00:14:27 UTC (rev 4636) @@ -431,14 +431,14 @@ echo '<b>'.($TotalEnable+$TotalDisable). '</b> ' . _('Total Branches') . '</div></td></tr></table>'; } else { $sql = "SELECT debtorsmaster.name, - address1, - address2, - address3, - address4, - address5, - address6 - FROM debtorsmaster - WHERE debtorno = '".$DebtorNo."'"; + address1, + address2, + address3, + address4, + address5, + address6 + FROM debtorsmaster + WHERE debtorno = '".$DebtorNo."'"; $result = DB_query($sql,$db); $myrow = DB_fetch_row($result); @@ -463,35 +463,35 @@ //editing an existing branch $sql = "SELECT branchcode, - brname, - braddress1, - braddress2, - braddress3, - braddress4, - braddress5, - braddress6, - specialinstructions, - estdeliverydays, - fwddate, - salesman, - area, - phoneno, - faxno, - contactname, - email, - taxgroupid, - defaultlocation, - brpostaddr1, - brpostaddr2, - brpostaddr3, - brpostaddr4, - disabletrans, - defaultshipvia, - custbranchcode, - deliverblind - FROM custbranch - WHERE branchcode='".$SelectedBranch."' - AND debtorno='".$DebtorNo."'"; + brname, + braddress1, + braddress2, + braddress3, + braddress4, + braddress5, + braddress6, + specialinstructions, + estdeliverydays, + fwddate, + salesman, + area, + phoneno, + faxno, + contactname, + email, + taxgroupid, + defaultlocation, + brpostaddr1, + brpostaddr2, + brpostaddr3, + brpostaddr4, + disabletrans, + defaultshipvia, + custbranchcode, + deliverblind + FROM custbranch + WHERE branchcode='".$SelectedBranch."' + AND debtorno='".$DebtorNo."'"; $result = DB_query($sql, $db); $myrow = DB_fetch_array($result); @@ -547,12 +547,12 @@ */ if (isset($_GET['BranchCode'])){ $sql="SELECT name, - address1, - address2, - address3, - address4, - address5, - address6 + address1, + address2, + address3, + address4, + address5, + address6 FROM debtorsmaster WHERE debtorno='".$_GET['BranchCode']."'"; @@ -579,22 +579,7 @@ $_POST['DeliverBlind'] = $_SESSION['DefaultBlindPackNote']; } - //SQL to poulate account selection boxes - $sql = "SELECT salesmanname, - salesmancode - FROM salesman - WHERE current = 1"; - $result = DB_query($sql,$db); - - if (DB_num_rows($result)==0){ - echo '</table>'; - prnMsg(_('There are no sales people defined as yet') . ' - ' . _('customer branches must be allocated to a sales person') . '. ' . _('Please use the link below to define at least one sales person'),'error'); - echo '<p align="center"><a href="' . $rootpath . '/SalesPeople.php">'._('Define Sales People') . '</a>'; - include('includes/footer.inc'); - exit; - } - echo '<input type=hidden name="DebtorNo" value="'. $DebtorNo . '" />'; @@ -636,6 +621,23 @@ if (!isset($_POST['FwdDate'])) {$_POST['FwdDate']=0;} echo '<td><input ' .(in_array('FwdDate',$Errors) ? 'class="inputerror"' : '' ) .' tabindex=12 type="text" class=number name="FwdDate" size=4 maxlength=2 value='. $_POST['FwdDate'].'></td></tr>'; + + //SQL to poulate account selection boxes + $sql = "SELECT salesmanname, + salesmancode + FROM salesman + WHERE current = 1"; + + $result = DB_query($sql,$db); + + if (DB_num_rows($result)==0){ + echo '</table>'; + prnMsg(_('There are no sales people defined as yet') . ' - ' . _('customer branches must be allocated to a sales person') . '. ' . _('Please use the link below to define at least one sales person'),'error'); + echo '<p align="center"><a href="' . $rootpath . '/SalesPeople.php">'._('Define Sales People') . '</a>'; + include('includes/footer.inc'); + exit; + } + echo '<tr><td>'._('Salesperson').':</td>'; echo '<td><select tabindex=13 name="Salesman">'; @@ -717,15 +719,22 @@ //only display email link if there is an email address echo '<td><input tabindex=18 type="text" name="Email" size=56 maxlength=55 value="'. $_POST['Email'].'"></td></tr>'; - echo '<tr><td>'._('Tax Group').':</td>'; - echo '<td><select tabindex=19 name="TaxGroup">'; DB_data_seek($result,0); $sql = "SELECT taxgroupid, taxgroupdescription FROM taxgroups"; - $result = DB_query($sql,$db); - - while ($myrow = DB_fetch_array($result)) { + $TaxGroupResults = DB_query($sql,$db); + if (DB_num_rows($TaxGroupResults)==0){ + echo '</table>'; + prnMsg(_('There are no tax groups defined - these must be set up first before any branches can be set up') . ' + <br /><a href="' . $rootpath . '/TaxGroups.php">' . _('Define Tax Groups') . '</a>','error'); + include('includes/footer.inc'); + exit; + } + echo '<tr><td>'._('Tax Group').':</td> + <td><select tabindex=19 name="TaxGroup">'; + + while ($myrow = DB_fetch_array($TaxGroupResults)) { if (isset($_POST['TaxGroup']) and $myrow['taxgroupid']==$_POST['TaxGroup']) { echo '<option selected value="'; } else { @@ -748,10 +757,18 @@ echo ' </select></td></tr>'; + + $SQL = "SELECT shipper_id, shippername FROM shippers"; + $ShipperResults = DB_query($SQL,$db); + if (DB_num_rows($ShipperResults)==0){ + echo '</table>'; + prnMsg(_('There are no shippers defined - these must be set up first before any branches can be set up') . ' + <br /><a href="' . $rootpath . '/Shippers.php">' . _('Define Shippers') . '</a>','error'); + include('includes/footer.inc'); + exit; + } echo '<tr><td>'._('Default freight/shipper method') . ':</td> <td><select tabindex=21 name="DefaultShipVia">'; - $SQL = "SELECT shipper_id, shippername FROM shippers"; - $ShipperResults = DB_query($SQL,$db); while ($myrow=DB_fetch_array($ShipperResults)){ if (isset($_POST['DefaultShipVia'])and $myrow['shipper_id']==$_POST['DefaultShipVia']){ echo '<option selected value=' . $myrow['shipper_id'] . '>' . $myrow['shippername'] . '</option>'; Modified: trunk/OrderDetails.php =================================================================== --- trunk/OrderDetails.php 2011-07-19 09:35:25 UTC (rev 4635) +++ trunk/OrderDetails.php 2011-07-24 00:14:27 UTC (rev 4636) @@ -1,9 +1,7 @@ <?php -/* $Revision: 1.25 $ */ + /* $Id$*/ -//$PageSecurity = 2; - /* Session started in header.inc for password checking and authorisation level check */ include('includes/session.inc'); @@ -21,34 +19,33 @@ include('includes/header.inc'); -$OrderHeaderSQL = "SELECT - salesorders.debtorno, - debtorsmaster.name, - salesorders.branchcode, - salesorders.customerref, - salesorders.comments, - salesorders.orddate, - salesorders.ordertype, - salesorders.shipvia, - salesorders.deliverto, - salesorders.deladd1, - salesorders.deladd2, - salesorders.deladd3, - salesorders.deladd4, - salesorders.deladd5, - salesorders.deladd6, - salesorders.contactphone, - salesorders.contactemail, - salesorders.freightcost, - salesorders.deliverydate, - debtorsmaster.currcode, - salesorders.fromstkloc - FROM - salesorders, - debtorsmaster - WHERE - salesorders.debtorno = debtorsmaster.debtorno - AND salesorders.orderno = '" . $_GET['OrderNumber'] . "'"; +$OrderHeaderSQL = "SELECT salesorders.debtorno, + debtorsmaster.name, + salesorders.branchcode, + salesorders.customerref, + salesorders.comments, + salesorders.orddate, + salesorders.ordertype, + salesorders.shipvia, + salesorders.deliverto, + salesorders.deladd1, + salesorders.deladd2, + salesorders.deladd3, + salesorders.deladd4, + salesorders.deladd5, + salesorders.deladd6, + salesorders.contactphone, + salesorders.contactemail, + salesorders.freightcost, + salesorders.deliverydate, + debtorsmaster.currcode, + salesorders.fromstkloc, + currencies.decimalplaces + FROM salesorders INNER JOIN debtorsmaster + ON salesorders.debtorno = debtorsmaster.debtorno + INNER JOIN currencies + ON debtorsmaster.currcode=currencies.currabrev + WHERE salesorders.orderno = '" . $_GET['OrderNumber'] . "'"; $ErrMsg = _('The order cannot be retrieved because'); $DbgMsg = _('The SQL that failed to get the order header was'); @@ -59,7 +56,9 @@ _('Order Details') . '" alt="" />' . ' ' . $title . '</p>'; $myrow = DB_fetch_array($GetOrdHdrResult); - echo '<table class=selection>'; + $CurrDecimalPlaces = $myrow['decimalplaces']; + + echo '<table class="selection">'; echo '<tr><th colspan=4><font color=blue>'._('Order Header Details For Order No').' '.$_GET['OrderNumber'].'</font></th></tr>'; echo '<tr> <th style="text-align: left">' . _('Customer Code') . ':</th> @@ -118,24 +117,24 @@ /*Now get the line items */ - $LineItemsSQL = "SELECT - stkcode, - stockmaster.description, - stockmaster.volume, - stockmaster.kgs, - stockmaster.decimalplaces, - stockmaster.mbflag, - stockmaster.units, - stockmaster.discountcategory, - stockmaster.controlled, - stockmaster.serialised, - unitprice, - quantity, - discountpercent, - actualdispatchdate, - qtyinvoiced - FROM salesorderdetails, stockmaster - WHERE salesorderdetails.stkcode = stockmaster.stockid AND orderno ='" . $_GET['OrderNumber'] . "'"; + $LineItemsSQL = "SELECT stkcode, + stockmaster.description, + stockmaster.volume, + stockmaster.kgs, + stockmaster.decimalplaces, + stockmaster.mbflag, + stockmaster.units, + stockmaster.discountcategory, + stockmaster.controlled, + stockmaster.serialised, + unitprice, + quantity, + discountpercent, + actualdispatchdate, + qtyinvoiced + FROM salesorderdetails INNER JOIN stockmaster + ON salesorderdetails.stkcode = stockmaster.stockid + WHERE orderno ='" . $_GET['OrderNumber'] . "'"; $ErrMsg = _('The line items of the order cannot be retrieved because'); $DbgMsg = _('The SQL used to retrieve the line items, that failed was'); @@ -150,15 +149,15 @@ echo '<br /><table cellpadding=2 colspan=9 class=selection>'; echo '<tr><th colspan=9><font color=blue>'._('Order Line Details For Order No').' '.$_GET['OrderNumber'].'</font></th></tr>'; echo '<tr> - <th>' . _('Item Code') . '</th> - <th>' . _('Item Description') . '</th> - <th>' . _('Quantity') . '</th> - <th>' . _('Unit') . '</th> - <th>' . _('Price') . '</th> - <th>' . _('Discount') . '</th> - <th>' . _('Total') . '</th> - <th>' . _('Qty Del') . '</th> - <th>' . _('Last Del') . '</th> + <th>' . _('Item Code') . '</th> + <th>' . _('Item Description') . '</th> + <th>' . _('Quantity') . '</th> + <th>' . _('Unit') . '</th> + <th>' . _('Price') . '</th> + <th>' . _('Discount') . '</th> + <th>' . _('Total') . '</th> + <th>' . _('Qty Del') . '</th> + <th>' . _('Last Del') . '</th> </tr>'; $k=0; while ($myrow=db_fetch_array($LineItemsResult)) { @@ -181,10 +180,10 @@ <td>' . $myrow['description'] . '</td> <td class=number>' . $myrow['quantity'] . '</td> <td>' . $myrow['units'] . '</td> - <td class=number>' . number_format($myrow['unitprice'],2) . '</td> + <td class=number>' . number_format($myrow['unitprice'],$CurrDecimalPlaces) . '</td> <td class=number>' . number_format(($myrow['discountpercent'] * 100),2) . '%' . '</td> - <td class=number>' . number_format($myrow['quantity'] * $myrow['unitprice'] * (1 - $myrow['discountpercent']),2) . '</td> - <td class=number>' . number_format($myrow['qtyinvoiced'],2) . '</td> + <td class=number>' . number_format($myrow['quantity'] * $myrow['unitprice'] * (1 - $myrow['discountpercent']),$CurrDecimalPlaces) . '</td> + <td class=number>' . number_format($myrow['qtyinvoiced'],$myrow['decimalplaces']) . '</td> <td>' . $DisplayActualDeliveryDate . '</td> </tr>'; @@ -193,7 +192,7 @@ $OrderTotalWeight = $OrderTotalWeight + $myrow['quantity'] * $myrow['kgs']; } - $DisplayTotal = number_format($OrderTotal,2); + $DisplayTotal = number_format($OrderTotal,$CurrDecimalPlaces); $DisplayVolume = number_format($OrderTotalVolume,2); $DisplayWeight = number_format($OrderTotalWeight,2); Modified: trunk/OutstandingGRNs.php =================================================================== --- trunk/OutstandingGRNs.php 2011-07-19 09:35:25 UTC (rev 4635) +++ trunk/OutstandingGRNs.php 2011-07-24 00:14:27 UTC (rev 4636) @@ -30,13 +30,18 @@ quantityinv, grns.stdcostunit, actprice, - unitprice - FROM grns, - purchorderdetails, - suppliers - WHERE grns.supplierid=suppliers.supplierid - AND grns.podetailitem = purchorderdetails.podetailitem - AND qtyrecd-quantityinv>0 + unitprice, + currencies.decimalplaces as currdecimalplaces, + stockmaster.decimalplaces as itemdecimalplaces + FROM grns INNER JOIN purchorderdetails + ON grns.podetailitem = purchorderdetails.podetailitem + INNER JOIN suppliers + ON grns.supplierid=suppliers.supplierid + INNER JOIN currencies + ON suppliers.currcode=currencies.currabrev + LEFT JOIN stockmaster + ON grns.itemcode=stockmaster.stockid + WHERE qtyrecd-quantityinv>0 AND grns.supplierid >='" . $_POST['FromCriteria'] . "' AND grns.supplierid <='" . $_POST['ToCriteria'] . "' ORDER BY supplierid, @@ -81,7 +86,7 @@ /* need to print the total of previous supplier */ $YPos -= (2*$line_height); $LeftOvers = $pdf->addTextWrap($Left_Margin,$YPos,260-$Left_Margin,$FontSize,_('Total for') . ' ' . $Supplier . ' - ' . $SupplierName); - $DisplaySuppTotVal = number_format($SuppTot_Val,2); + $DisplaySuppTotVal = number_format($SuppTot_Val,$GRNs['decimalplaces']); $LeftOvers = $pdf->addTextWrap(500,$YPos,60,$FontSize,$DisplaySuppTotVal, 'right'); $YPos -=$line_height; $pdf->line($Left_Margin, $YPos+$line_height-2,$Page_Width-$Right_Margin, $YPos+$line_height-2); @@ -93,16 +98,21 @@ $SupplierName = $GRNs['suppname']; } $YPos -=$line_height; - + + if ($GRNs['itemdecimalplaces']==null){ + $ItemDecimalPlaces = 2; + } else { + $ItemDecimalPlaces = $GRNs['itemdecimalplaces']; + } $LeftOvers = $pdf->addTextWrap(32,$YPos,40,$FontSize,$GRNs['grnno']); $LeftOvers = $pdf->addTextWrap(70,$YPos,40,$FontSize,$GRNs['orderno']); $LeftOvers = $pdf->addTextWrap(110,$YPos,200,$FontSize,$GRNs['itemcode'] . ' - ' . $GRNs['itemdescription']); - $DisplayStdCost = number_format($GRNs['stdcostunit'],2); - $DisplayQtyRecd = number_format($GRNs['qtyrecd'],2); - $DisplayQtyInv = number_format($GRNs['quantityinv'],2); - $DisplayQtyOstg = number_format($GRNs['qtyrecd']- $GRNs['quantityinv'],2); + $DisplayStdCost = number_format($GRNs['stdcostunit'],$_SESSION['CompanyRecord']['decimalplaces']); + $DisplayQtyRecd = number_format($GRNs['qtyrecd'],$ItemDecimalPlaces); + $DisplayQtyInv = number_format($GRNs['quantityinv'],$ItemDecimalPlaces); + $DisplayQtyOstg = number_format($GRNs['qtyrecd']- $GRNs['quantityinv'],$ItemDecimalPlaces); $LineValue = ($GRNs['qtyrecd']- $GRNs['quantityinv'])*$GRNs['stdcostunit']; - $DisplayValue = number_format($LineValue,2); + $DisplayValue = number_format($LineValue,$_SESSION['CompanyRecord']['decimalplaces']); $LeftOvers = $pdf->addTextWrap(310,$YPos,50,$FontSize,$DisplayQtyRecd,'right'); $LeftOvers = $pdf->addTextWrap(360,$YPos,50,$FontSize,$DisplayQtyInv, 'right'); Modified: trunk/PDFCustTransListing.php =================================================================== --- trunk/PDFCustTransListing.php 2011-07-19 09:35:25 UTC (rev 4635) +++ trunk/PDFCustTransListing.php 2011-07-24 00:14:27 UTC (rev 4636) @@ -54,15 +54,20 @@ } $sql= "SELECT type, - debtorno, - transno, - trandate, - ovamount, - ovgst, - invtext - FROM debtortrans - WHERE type='" . $_POST['TransType'] . "' - AND date_format(inputdate, '%Y-%m-%d')='".FormatDateForSQL($_POST['Date'])."'"; + debtortrans.debtorno, + transno, + trandate, + ovamount, + ovgst, + invtext, + debtortrans.rate, + decimalplaces + FROM debtortrans INNER JOIN debtorsmaster + ON debtortrans.debtorno=debtorsmaster.debtorno + INNER JOIN currencies + ON debtorsmaster.currcode=currencies.currabrev + WHERE type='" . $_POST['TransType'] . "' + AND date_format(inputdate, '%Y-%m-%d')='".FormatDateForSQL($_POST['Date'])."'"; $result=DB_query($sql,$db,'','',false,false); @@ -70,8 +75,8 @@ $title = _('Payment Listing'); 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'); + if ($debug==1){ + prnMsg(_('The SQL used to get the transaction information that failed was') . ':<br />' . $sql,'error'); } include('includes/footer.inc'); exit; @@ -92,7 +97,7 @@ $pdf->addInfo('Subject',_('Customer transaction listing from') . ' ' . $_POST['Date'] ); $line_height=12; $PageNumber = 1; -$TotalCheques = 0; +$TotalAmount = 0; include ('includes/PDFCustTransListingPageHeader.inc'); @@ -105,12 +110,12 @@ $LeftOvers = $pdf->addTextWrap($Left_Margin,$YPos,160,$FontSize,$supplierrow['name'], 'left'); $LeftOvers = $pdf->addTextWrap($Left_Margin+162,$YPos,80,$FontSize,$myrow['transno'], 'left'); $LeftOvers = $pdf->addTextWrap($Left_Margin+242,$YPos,70,$FontSize,ConvertSQLDate($myrow['trandate']), 'left'); - $LeftOvers = $pdf->addTextWrap($Left_Margin+312,$YPos,70,$FontSize,number_format($myrow['ovamount'],2), 'right'); - $LeftOvers = $pdf->addTextWrap($Left_Margin+382,$YPos,70,$FontSize,number_format($myrow['ovgst'],2), 'right'); - $LeftOvers = $pdf->addTextWrap($Left_Margin+452,$YPos,70,$FontSize,number_format($myrow['ovamount']+$myrow['ovgst'],2), 'right'); + $LeftOvers = $pdf->addTextWrap($Left_Margin+312,$YPos,70,$FontSize,number_format($myrow['ovamount'],$myrow['decimalplaces']), 'right'); + $LeftOvers = $pdf->addTextWrap($Left_Margin+382,$YPos,70,$FontSize,number_format($myrow['ovgst'],$myrow['decimalplaces']), 'right'); + $LeftOvers = $pdf->addTextWrap($Left_Margin+452,$YPos,70,$FontSize,number_format($myrow['ovamount']+$myrow['ovgst'],$myrow['decimalplaces']), 'right'); $YPos -= ($line_height); - $TotalCheques = $TotalCheques - $myrow['ovamount']; + $TotalAmount = $TotalAmount + ($myrow['ovamount']/$myrow['rate']); if ($YPos - (2 *$line_height) < $Bottom_Margin){ /*Then set up a new page */ @@ -121,8 +126,8 @@ $YPos-=$line_height; -$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'); +$LeftOvers = $pdf->addTextWrap($Left_Margin+452,$YPos,70,$FontSize,number_format($TotalAmount,$_SESSION['CompanyRecord']['decimalplaces']), 'right'); +$LeftOvers = $pdf->addTextWrap($Left_Margin+265,$YPos,300,$FontSize,_('Total') . ' ' . _('Transactions') . ' ' . $_SESSION['CompanyRecord']['CurrencyDefault'], 'left'); $ReportFileName = $_SESSION['DatabaseName'] . '_CustTransListing_' . date('Y-m-d').'.pdf'; $pdf->OutputD($ReportFileName); Modified: trunk/PDFDIFOT.php =================================================================== --- trunk/PDFDIFOT.php 2011-07-19 09:35:25 UTC (rev 4635) +++ trunk/PDFDIFOT.php 2011-07-24 00:14:27 UTC (rev 4636) @@ -26,7 +26,7 @@ echo '<form method="post" action="' . $_SERVER['PHP_SELF'] . '">'; echo '<input type="hidden" name="FormID" value="' . $_SESSION['FormID'] . '" />'; - echo '<table class=selection> + echo '<table class="selection"> <tr> <td>' . _('Enter the date from which variances between orders and deliveries 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')-1,0,Date('y'))) . '"></td> @@ -41,9 +41,9 @@ } echo '<tr> - <td>' . _('Enter the number of days considered acceptable between delivery requested date and invoice date(ie the date dispatched)') . ':</td> - <td><input type="text" class="number" name="DaysAcceptable" maxlength=2 size=2 value="' . $_POST['DaysAcceptable'] . '"></td> - </tr>'; + <td>' . _('Enter the number of days considered acceptable between delivery requested date and invoice date(ie the date dispatched)') . ':</td> + <td><input type="text" class="number" name="DaysAcceptable" maxlength=2 size=2 value="' . $_POST['DaysAcceptable'] . '"></td> + </tr>'; echo '<tr><td>' . _('Inventory Category') . '</td><td>'; $sql = "SELECT categorydescription, categoryid FROM stockcategory WHERE stocktype<>'D' AND stocktype<>'L'"; @@ -57,7 +57,6 @@ echo '<option value="' . $myrow['categoryid'] . '">' . $myrow['categorydescription'] . '</option>'; } - echo '</select></td></tr>'; echo '<tr><td>' . _('Inventory Location') . ':</td> @@ -99,6 +98,7 @@ salesorderdetails.quantity, salesorderdetails.stkcode, stockmaster.description, + stockmaster.decimalplaces, salesorders.debtorno, salesorders.branchcode FROM salesorderdetails INNER JOIN stockmaster @@ -116,6 +116,7 @@ salesorderdetails.quantity, salesorderdetails.stkcode, stockmaster.description, + stockmaster.decimalplaces, salesorders.debtorno, salesorders.branchcode FROM salesorderdetails INNER JOIN stockmaster @@ -136,6 +137,7 @@ salesorderdetails.quantity, salesorderdetails.stkcode, stockmaster.description, + stockmaster.decimalplaces, salesorders.debtorno, salesorders.branchcode FROM salesorderdetails INNER JOIN stockmaster @@ -156,6 +158,7 @@ salesorderdetails.quantity, salesorderdetails.stkcode, stockmaster.description, + stockmaster.decimalplaces, salesorders.debtorno, salesorders.branchcode FROM salesorderdetails INNER JOIN stockmaster @@ -214,7 +217,7 @@ if ($DaysDiff > $_POST['DaysAcceptable']){ $LeftOvers = $pdf->addTextWrap($Left_Margin,$YPos,40,$FontSize,$myrow['orderno'], 'left'); $LeftOvers = $pdf->addTextWrap($Left_Margin+40,$YPos,200,$FontSize,$myrow['stkcode'] .' - ' . $myrow['description'], 'left'); - $LeftOvers = $pdf->addTextWrap($Left_Margin+240,$YPos,50,$FontSize,number_format($myrow['quantity']), 'right'); + $LeftOvers = $pdf->addTextWrap($Left_Margin+240,$YPos,50,$FontSize,number_format($myrow['quantity'],$myrow['decimalplaces']), 'right'); $LeftOvers = $pdf->addTextWrap($Left_Margin+295,$YPos,50,$FontSize,$myrow['debtorno'], 'left'); $LeftOvers = $pdf->addTextWrap($Left_Margin+345,$YPos,50,$FontSize,$myrow['branchcode'], 'left'); $LeftOvers = $pdf->addTextWrap($Left_Margin+395,$YPos,50,$FontSize,ConvertSQLDate($myrow['actualdispatchdate']), 'left'); @@ -286,14 +289,14 @@ $ReportFileName = $_SESSION['DatabaseName'] . '_DIFOT_' . date('Y-m-d').'.pdf'; -$pdf->OutputD($ReportFileName);//UldisN -$pdf->__destruct(); //UldisN +$pdf->OutputD($ReportFileName); +$pdf->__destruct(); if ($_POST['Email']=='Yes'){ if (file_exists($_SESSION['reports_dir'] . '/'.$ReportFileName)){ unlink($_SESSION['reports_dir'] . '/'.$ReportFileName); } - $fp = fopen( $_SESSION['reports_dir'] . '/'.$ReportFileName,'wb'); + $fp = fopen( $_SESSION['reports_dir'] . '/'.$ReportFileName,'wb'); fwrite ($fp, $pdfcode); fclose ($fp); Modified: trunk/PDFGrn.php =================================================================== --- trunk/PDFGrn.php 2011-07-19 09:35:25 UTC (rev 4635) +++ trunk/PDFGrn.php 2011-07-24 00:14:27 UTC (rev 4636) @@ -41,35 +41,35 @@ } else { //NOT PREVIEW $sql="SELECT grns.itemcode, - grns.grnno, - grns.deliverydate, - grns.itemdescription, - grns.qtyrecd, - grns.supplierid, - purchorderdetails.suppliersunit, - purchorderdetails.conversionfactor, - stockmaster.units, - stockmaster.decimalplaces - FROM grns INNER JOIN purchorderdetails - ON grns.podetailitem=purchorderdetails.podetailitem - LEFT JOIN stockmaster - ON grns.itemcode=stockmaster.stockid - WHERE grnbatch='".$GRNNo."'"; + grns.grnno, + grns.deliverydate, + grns.itemdescription, + grns.qtyrecd, + grns.supplierid, + purchorderdetails.suppliersunit, + purchorderdetails.conversionfactor, + stockmaster.units, + stockmaster.decimalplaces + FROM grns INNER JOIN purchorderdetails + ON grns.podetailitem=purchorderdetails.podetailitem + LEFT JOIN stockmaster + ON grns.itemcode=stockmaster.stockid + WHERE grnbatch='".$GRNNo."'"; $GRNResult=DB_query($sql, $db); $NoOfGRNs = DB_num_rows($GRNResult); if($NoOfGRNs>0) { //there are GRNs to print $sql = "SELECT suppliers.suppname, - suppliers.address1, - suppliers.address2 , - suppliers.address3, - suppliers.address4, - suppliers.address5, - suppliers.address6 - FROM grns INNER JOIN suppliers - ON grns.supplierid=suppliers.supplierid - WHERE grnbatch='".$GRNNo."'"; + suppliers.address1, + suppliers.address2 , + suppliers.address3, + suppliers.address4, + suppliers.address5, + suppliers.address6 + FROM grns INNER JOIN suppliers + ON grns.supplierid=suppliers.supplierid + WHERE grnbatch='".$GRNNo."'"; $SuppResult = DB_query($sql,$db,_('Could not get the supplier of the selected GRN')); $SuppRow = DB_fetch_array($SuppResult); } Modified: trunk/PDFLowGP.php =================================================================== --- trunk/PDFLowGP.php 2011-07-19 09:35:25 UTC (rev 4635) +++ trunk/PDFLowGP.php 2011-07-24 00:14:27 UTC (rev 4636) @@ -28,27 +28,26 @@ /*Now figure out the data to report for the category range under review */ $SQL = "SELECT stockmaster.categoryid, - stockmaster.stockid, - stockmoves.transno, - stockmoves.trandate, - systypes.typename, - stockmaster.materialcost + stockmaster.labourcost + stockmaster.overheadcost as unitcost, - stockmoves.qty, - stockmoves.debtorno, - stockmoves.branchcode, - stockmoves.price*(1-stockmoves.discountpercent) as sellingprice, - (stockmoves.price*(1-stockmoves.discountpercent)) - (stockmaster.materialcost + stockmaster.labourcost + stockmaster.overheadcost) AS gp, - debtorsmaster.name - FROM stockmaster, - stockmoves, - systypes, - debtorsmaster - WHERE stockmoves.type=systypes.typeid - AND stockmaster.stockid=stockmoves.stockid - AND stockmoves.trandate >= '" . FormatDateForSQL($_POST['FromDate']) . "' + stockmaster.stockid, + stockmoves.transno, + stockmoves.trandate, + systypes.typename, + stockmaster.materialcost + stockmaster.labourcost + stockmaster.overheadcost as unitcost, + stockmoves.qty, + stockmoves.debtorno, + stockmoves.branchcode, + stockmoves.price*(1-stockmoves.discountpercent) as sellingprice, + (stockmoves.price*(1-stockmoves.discountpercent)) - (stockmaster.materialcost + stockmaster.labourcost + stockmaster.overheadcost) AS gp, + debtorsmaster.name + FROM stockmaster INNER JOIN stockmoves + ON stockmaster.stockid=stockmoves.stockid + INNER JOIN systypes + ON stockmoves.type=systypes.typeid + INNER JOIN debtorsmaster + ON stockmoves.debtorno=debtorsmaster.debtorno + WHERE stockmoves.trandate >= '" . FormatDateForSQL($_POST['FromDate']) . "' AND stockmoves.trandate <= '" . FormatDateForSQL($_POST['ToDate']) . "' AND ((stockmoves.price*(1-stockmoves.discountpercent)) - (stockmaster.materialcost + stockmaster.labourcost + stockmaster.overheadcost))/(stockmoves.price*(1-stockmoves.discountpercent)) <=" . ($_POST['GPMin']/100) . " - AND stockmoves.debtorno=debtorsmaster.debtorno ORDER BY stockmaster.stockid"; $LowGPSalesResult = DB_query($SQL,$db,'','',false,false); @@ -90,9 +89,9 @@ $LeftOvers = $pdf->addTextWrap(100,$YPos,30,$FontSize,$LowGPItems['transno']); $LeftOvers = $pdf->addTextWrap(130,$YPos,50,$FontSize,$LowGPItems['stockid']); $LeftOvers = $pdf->addTextWrap(220,$YPos,50,$FontSize,$LowGPItems['name']); - $DisplayUnitCost = number_format($LowGPItems['unitcost'],2); - $DisplaySellingPrice = number_format($LowGPItems['sellingprice'],2); - $DisplayGP = number_format($LowGPItems['gp'],2); + $DisplayUnitCost = number_format($LowGPItems['unitcost'],$_SESSION['CompanyRecord']['decimalplaces']); + $DisplaySellingPrice = number_format($LowGPItems['sellingprice'],$_SESSION['CompanyRecord']['decimalplaces']); + $DisplayGP = number_format($LowGPItems['gp'],$_SESSION['CompanyRecord']['decimalplaces']); $DisplayGPPercent = number_format(($LowGPItems['gp']*100)/$LowGPItems['sellingprice'],1); $LeftOvers = $pdf->addTextWrap(330,$YPos,60,$FontSize,$DisplaySellingPrice,'right'); @@ -138,11 +137,14 @@ </tr>'; echo '<tr><td>' . _('Show sales with GP') . '%' . _('below') . ':</td> - <td><input type="text" class="number" name="GPMin" maxlength="3" size="3" value="' . $_POST['GPMin'] . '"></td> - </tr>'; + <td><input type="text" class="number" name="GPMin" maxlength="3" size="3" value="' . $_POST['GPMin'] . '"></td> + </tr>'; echo '</table> - <br /><div class="centre"><input type="submit" name="PrintPDF" value="' . _('Print PDF') . '"></div>'; + <br /> + <div class="centre"> + <input type="submit" name="PrintPDF" value="' . _('Print PDF') . '"> + </div>'; } include('includes/footer.inc'); Modified: trunk/PDFOrderStatus.php =================================================================== --- trunk/PDFOrderStatus.php 2011-07-19 09:35:25 UTC (rev 4635) +++ trunk/PDFOrderStatus.php 2011-07-24 00:14:27 UTC (rev 4636) @@ -61,13 +61,17 @@ } echo '</select></td></tr>'; - echo '<tr><td>' . _('Back Order Only') . ':</td><td><select name="BackOrders">'; - echo '<option selected value="Yes">' . _('Only Show Back Orders') . '</option>'; - echo '<option value="No">' . _('Show All Orders') . '</option>'; - echo '</select></td> - </tr> - </table> - <br /><div class="centre"><input type=submit name="Go" value="' . _('Create PDF') . '"></div>'; + echo '<tr><td>' . _('Back Order Only') . ':</td> + <td><select name="BackOrders"> + <option selected value="Yes">' . _('Only Show Back Orders') . '</option> + <option value="No">' . _('Show All Orders') . '</option> + </select></td> + </tr> + </table> + <br /> + <div class="centre"> + <input type=submit name="Go" value="' . _('Create PDF') . '"> + </div>'; include('includes/footer.inc'); exit; @@ -228,7 +232,6 @@ AND salesorders.orddate >='" . FormatDateForSQL($_POST['FromDate']) . "' AND salesorders.orddate <='" . FormatDateForSQL($_POST['ToDate']) . "' AND salesorders.quotation=0"; - } if ($_POST['BackOrders']=='Yes'){ Modified: trunk/PDFOrdersInvoiced.php =================================================================== --- trunk/PDFOrdersInvoiced.php 2011-07-19 09:35:25 UTC (rev 4635) +++ trunk/PDFOrdersInvoiced.php 2011-07-24 00:14:27 UTC (rev 4636) @@ -35,7 +35,11 @@ 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>'; @@ -55,7 +59,7 @@ 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); + $result= DB_query("SELECT loccode, locationname FROM locations",$db); while ($myrow=DB_fetch_array($result)){ echo '<option value="' . $myrow['loccode'] . '">' . $myrow['locationname'] . '</option>'; } @@ -108,16 +112,16 @@ ON salesorders.fromstkloc=locations.loccode WHERE orddate >='" . FormatDateForSQL($_POST['FromDate']) . "' AND orddate <='" . FormatDateForSQL($_POST['ToDate']) . "' - GROUP BY salesorders.orderno, - salesorders.debtorno, - salesorders.branchcode, - salesorders.customerref, - salesorders.orddate, - salesorders.fromstkloc, - salesorderdetails.stkcode, - stockmaster.description, - stockmaster.units, - stockmaster.decimalplaces"; + GROUP BY salesorders.orderno, + salesorders.debtorno, + salesorders.branchcode, + salesorders.customerref, + salesorders.orddate, + salesorders.fromstkloc, + salesorderdetails.stkcode, + stockmaster.description, + stockmaster.units, + stockmaster.decimalplaces"; } elseif ($_POST['CategoryID']!='All' AND $_POST['Location']=='All') { @@ -153,17 +157,17 @@ WHERE stockmaster.categoryid ='" . $_POST['CategoryID'] . "' AND orddate >='" . FormatDateForSQL($_POST['FromDate']) . "' AND orddate <='" . FormatDateForSQL($_POST['ToDate']) . "' - GROUP BY salesorders.orderno, - salesorders.debtorno, - salesorders.branchcode, - salesorders.customerref, - salesorders.orddate, - salesorders.fromstkloc, - salesorderdetails.stkcode, - stockmaster.description, - stockmaster.units, - stockmaster.decimalplaces"; - + GROUP BY salesorders.orderno, + salesorders.debtorno, + salesorders.branchcode, + salesorders.customerref, + salesorders.orddate, + salesorders.fromstkloc, + salesorderdetails.stkcode, + stockmaster.description, + stockmaster.units, + stockmaster.decimalplaces"; + } elseif ($_POST['CategoryID']=='All' AND $_POST['Location']!='All') { $sql= "SELECT salesorders.orderno, salesorders.debtorno, @@ -227,7 +231,7 @@ SUM(salesorderdetails.qtyinvoiced) AS totqtyinvoiced INNER JOIN locations ON salesorders.fromstkloc=locations.loccode - FROM salesorders + FROM salesorders INNER JOIN salesorderdetails ON salesorders.orderno = salesorderdetails.orderno INNER JOIN stockmaster @@ -237,20 +241,20 @@ INNER JOIN custbranch ON custbranch.debtorno=salesorders.debtorno AND custbranch.branchcode=salesorders.branchcode - WHERE stockmaster.categoryid ='" . $_POST['CategoryID'] . "' + WHERE stockmaster.categoryid ='" . $_POST['CategoryID'] . "' AND salesorders.fromstkloc ='" . $_POST['Location'] . "' AND orddate >='" . FormatDateForSQL($_POST['FromDate']) . "' AND orddate <='" . FormatDateForSQL($_POST['ToDate']) . "' - GROUP BY salesorders.orderno, - salesorders.debtorno, - salesorders.branchcode, - salesorders.customerref, - salesorders.orddate, - salesorders.fromstkloc, - salesorderdetails.stkcode, - stockmaster.description, - stockmaster.units, - stockmaster.decimalplaces"; + GROUP BY salesorders.orderno, + salesorders.debtorno, + salesorders.branchcode, + salesorders.customerref, + salesorders.orddate, + salesorders.fromstkloc, + salesorderdetails.stkcode, + stockmaster.description, + stockmaster.units, + stockmaster.decimalplaces"; } $sql .= " ORDER BY salesorders.orderno"; Modified: trunk/PDFPeriodStockTransListing.php =================================================================== --- trunk/PDFPeriodStockTransListing.php 2011-07-19 09:35:25 UTC (rev 4635) +++ trunk/PDFPeriodStockTransListing.php 2011-07-24 00:14:27 UTC (rev 4636) @@ -1,7 +1,6 @@ <?php /* $Id: PDFPeriodStockTransListing.php 4307 2010-12-22 16:06:03Z tim_schofield $*/ - include('includes/SQL_CommonFunctions.inc'); include ('includes/session.inc'); @@ -17,8 +16,9 @@ $title = _('Stock Transaction Listing'); include ('includes/header.inc'); - echo '<div class="centre"><p class="page_title_text"><img src="'.$rootpath.'/css/'.$theme.'/images/transactions.png" title="' . $title . '" alt="">' . ' ' - . _('Stock Transaction Listing').'</img></p></div>'; + echo '<div class="centre"> + <p class="page_title_text"><img src="'.$rootpath.'/css/'.$theme.'/images/transactions.png" title="' . $title . '" alt="">' . ' '. _('Stock Transaction Listing').'</img></p> + </div>'; if ($InputError==1){ prnMsg($msg,'error'); @@ -26,8 +26,8 @@ echo '<form method="post" action="' . $_SERVER['PHP_SELF'] . '">'; echo '<input type="hidden" name="FormID" value="' . $_SESSION['FormID'] . '" />'; - echo '<table class=selection>'; - echo '<tr> + echo '<table class="selection">'; + echo '<tr> <td>' . _('Enter the date from which the transactions are to be listed') . ':</td> <td><input type="text" name="FromDate" maxlength="10" size="10" class="date" alt="' . $_SESSION['DefaultDateFormat'] . '" value="' . Date($_SESSION['DefaultDateFormat']) . '"></td> </tr>'; @@ -55,24 +55,28 @@ echo '<tr><td>' . _('For Stock Location') . ':</td> <td><select name="StockLocation">'; - echo '<option VALUE="All">' . _('All') . '</option>'; + echo '<option value="All">' . _('All') . '</option>'; while ($myrow=DB_fetch_array($resultStkLocs)){ if (isset($_POST['StockLocation']) AND $_POST['StockLocation']!='All'){ if ($myrow['loccode'] == $_POST['StockLocation']){ - echo '<option selected VALUE="' . $myrow['loccode'] . '">' . $myrow['locationname'] . '</option>'; + echo '<option selected value="' . $myrow['loccode'] . '">' . $myrow['locationname'] . '</option>'; } else { - echo '<option VALUE="' . $myrow['loccode'] . '">' . $myrow['locationname'] . '</option>'; + echo '<option value="' . $myrow['loccode'] . '">' . $myrow['locationname'] . '</option>'; } } elseif ($myrow['loccode']==$_SESSION['UserStockLocation']){ - echo '<option selected VALUE="' . $myrow['loccode'] . '">' . $myrow['locationname'] . '</option>'; + echo '<option selected value="' . $myrow['loccode'] . '">' . $myrow['locationname'] . '</option>'; $_POST['StockLocation']=$myrow['loccode']; } else { - echo '<option VALUE="' . $myrow['loccode'] . '">' . $myrow['locationname'] . '</option>'; + 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; @@ -84,43 +88,43 @@ if ($_POST['StockLocation']=='All') { $sql= "SELECT stockmoves.type, - stockmoves.stockid, - stockmaster.description, - stockmaster.decimalplaces, - stockmoves.transno, - stockmoves.trandate, - stockmoves.qty, - stockmoves.reference, - stockmoves.narrative, - locations.locationname - FROM stockmoves - LEFT JOIN stockmaster - ON stockmoves.stockid=stockmaster.stockid - LEFT JOIN locations - ON stockmoves.loccode=locations.loccode - WHERE type='" . $_POST['TransType'] . "' - AND date_format(trandate, '%Y-%m-%d')>='".FormatDateForSQL($_POST['FromDate'])."' - AND date_format(trandate, '%Y-%m-%d')<='".FormatDateForSQL($_POST['ToDate'])."'"; + stockmoves.stockid, + stockmaster.description, + stockmaster.decimalplaces, + stockmoves.transno, + stockmoves.trandate, + stockmoves.qty, + stockmoves.reference, + stockmoves.narrative, + locations.locationname + FROM stockmoves + LEFT JOIN stockmaster + ON stockmoves.stockid=stockmaster.stockid + LEFT JOIN locations + ON stockmoves.loccode=locations.loccode + WHERE type='" . $_POST['TransType'] . "' + AND date_format(trandate, '%Y-%m-%d')>='".FormatDateForSQL($_POST['FromDate'])."' + AND date_format(trandate, '%Y-%m-%d')<='".FormatDateForSQL($_POST['ToDate'])."'"; } else { $sql= "SELECT stockmoves.type, - stockmoves.stockid, - stockmaster.description, - stockmaster.decimalplaces, - stockmoves.transno, - stockmoves.trandate, - stockmoves.qty, - stockmoves.reference, - stockmoves.narrative, - locations.locationname - FROM stockmoves - LEFT JOIN stockmaster - ON stockmoves.stockid=stockmaster.stockid - LEFT JOIN locations - ON stockmoves.loccode=locations.loccode - WHERE type='" . $_POST['TransType'] . "' - AND date_format(trandate, '%Y-%m-%d')>='".FormatDateForSQL($_POST['FromDate'])."' - AND date_format(trandate, '%Y-%m-%d')<='".FormatDateForSQL($_POST['ToDate'])."' - AND stockmoves.loccode='" . $_POST['StockLocation'] . "'"; + stockmoves.stockid, + stockmaster.description, + stockmaster.decimalplaces, + stockmoves.transno, + stockmoves.trandate, + stockmoves.qty, + stockmoves.reference, + stockmoves.narrative, + locations.locationname + FROM stockmoves + LEFT JOIN stockmaster + ON stockmoves.stockid=stockmaster.stockid + LEFT JOIN locations + ON stockmoves.loccode=locations.loccode + WHERE type='" . $_POST['TransType'] . "' + AND date_format(trandate, '%Y-%m-%d')>='".FormatDateForSQL($_POST['FromDate'])."' + AND date_format(trandate, '%Y-%m-%d')<='".FormatDateForSQL($_POST['ToDate'])."' + AND stockmoves.loccode='" . $_POST['StockLocation'] . "'"; } $result=DB_query($sql,$db,'','',false,false); Modified: trunk/PageSecurity.php =================================================================== --- trunk/PageSecurity.php 2011-07-19 09:35:25 UTC (rev 4635) +++ trunk/PageSecurity.php 2011-07-24 00:14:27 UTC (rev 4636) @@ -53,7 +53,11 @@ echo '</table><br />'; -echo '<div class="centre"><input type="submit" name="Update" value="'._('Update Security Levels').'" /></div><br /></form>'; +echo '<div class="centre"> + <input type="submit" name="Update" value="'._('Update Security Levels').'" /> + </div> + <br /> + </form>'; include('includes/footer.inc'); ?> \ No newline at end of file Modified: trunk/PaymentAllocations.php =================================================================== --- trunk/PaymentAllocations.php 2011-07-19 09:35:25 UTC (rev 4635) +++ trunk/PaymentAllocations.php 2011-07-24 00:14:27 UTC (rev 4636) @@ -1,14 +1,11 @@ <?php /* $Id$*/ -/* $Revision: 1.6 $ */ + /* This page is called from SupplierInquiry.php when the 'view payments' button is selected */ - -//$PageSecurity = 5; - include('includes/session.inc'); $title = _('Payment Allocations'); @@ -16,17 +13,17 @@ include('includes/header.inc'); include('includes/SQL_CommonFunctions.inc'); - if (!isset($_GET['SuppID'])){ - prnMsg( _('Supplier ID Number is not Set, can not display result'),'warn'); - include('includes/footer.inc'); - exit; - } +if (!isset($_GET['SuppID'])){ + prnMsg( _('Supplier ID Number is not Set, can not display result'),'warn'); + include('includes/footer.inc'); + exit; +} - if (!isset($_GET['InvID'])){ - prnMsg( _('Invoice Number is not Set, can not display result'),'warn'); - include('includes/footer.inc'); - exit; - } +if (!isset($_GET['InvID'])){ + prnMsg( _('Invoice Number is not Set, can not display result'),'warn'); + include('includes/footer.inc'); + exit; +} $SuppID = $_GET['SuppID']; $InvID = $_GET['InvID']; @@ -34,48 +31,37 @@ echo '<div class="page_help_text">' . _('This shows how the payment to the supplier was allocated') . '<a href="SupplierInquiry.php?&SupplierID=' . $SuppID . '"><br /> ' . _('Back to supplier inquiry') . '</a></div><br />'; -//echo "<br /><font size=4 color=BLUE>Payment Allocation for Supplier: '$SuppID' and Invoice: '$InvID'</font>"; - -// $_SESSION['SuppID'] = new SupplierID; -// $_SESSION['InvID'] = new InvoiceID; - $SQL= "SELECT supptrans.supplierno, - supptrans.suppreference, - supptrans.trandate, - supptrans.alloc - FROM supptrans - WHERE supptrans.id IN (SELECT suppallocs.transid_allocfrom - FROM supptrans, suppallocs - WHERE supptrans.supplierno = '$SuppID' - AND supptrans.suppreference = '$InvID' - AND supptrans.id = suppallocs.transid_allocto)"; + supptrans.suppreference, + supptrans.trandate, + supptrans.alloc, + currencies.decimalplaces + FROM supptrans INNER JOIN suppliers + ON supptrans.supplierno=suppliers.supplierid + INNER JOIN currencies + ON suppliers.currcode=currencies.currabrev + WHERE supptrans.id IN (SELECT suppallocs.transid_allocfrom + FROM supptrans, suppallocs + WHERE supptrans.supplierno = '" . $SuppID . "' + AND supptrans.suppreference = '" . $InvID . "' + AND supptrans.id = suppallocs.transid_allocto)"; -/* -Might be a way of doing this query without a subquery -$SQL= "SELECT supptrans.supplierno, - supptrans.suppreference, - supptrans.trandate, - supptrans.alloc - FROM supptrans INNER JOIN suppallocs ON supptrans.id=suppallocs.transid_allocfrom - WHERE supptrans.supplierno = '$SuppID' - AND supptrans.suppreference = '$InvID' -*/ - $Result = DB_query($SQL, $db); if (DB_num_rows($Result) == 0){ prnMsg(_('There may be a problem retrieving the information. No data is returned'),'warn'); - echo '<br /><a HREF ="javascript:history.back()">' . _('Go back') . '</a>'; + echo '<br /><a href ="javascript:history.back()">' . _('Go back') . '</a>'; include('includes/foooter.inc'); exit; } -echo '<table cellpadding=2 colspan=7 width=80% class=selection>'; -$TableHeader = "<tr> -<th>" . _('Supplier Number') . '<br />' . _('Reference') . "</th> -<th>" . _('Payment') .'<br />' . _('Reference') . "</th> -<th>" . _('Payment') . '<br />' . _('Date') . "</th> -<th>" . _('Total Payment') . '<br />' . _('Amount') . '</th></tr>'; +echo '<table cellpadding="2" colspan="7 width="80%" class="selection">'; +$TableHeader = '<tr> + <th>' . _('Supplier Number') . '<br />' . _('Reference') . '</th> + <th>' . _('Payment') .'<br />' . _('Reference') . '</th> + <th>' . _('Payment') . '<br />' . _('Date') . '</th> + <th>' . _('Total Payment') . '<br />' . _('Amount') . '</th> + </tr>'; echo $TableHeader; @@ -93,7 +79,7 @@ echo '<td>'.$myrow['supplierno'].'</td> <td>'.$myrow['suppreference'].'</td> <td>'.ConvertSQLDate($myrow['trandate']).'</td> - <td class=number>'.number_format($myrow['alloc'],2).'</td> + <td class="number">'.number_format($myrow['alloc'],$myrow['decimalplaces']).'</td> </tr>'; $j++; @@ -106,4 +92,4 @@ echo '</table>'; include('includes/footer.inc'); -?> +?> \ No newline at end of file Modified: trunk/PaymentMethods.php =================================================================== --- trunk/PaymentMethods.php 2011-07-19 09:35:25 UTC (rev 4635) +++ trunk/PaymentMethods.php 2011-07-24 00:14:27 UTC (rev 4636) @@ -62,17 +62,17 @@ // Get the old name and check that the record still exists need to be very careful here $sql = "SELECT paymentname FROM paymentmethods - WHERE paymentid = '" . $SelectedPaymentID . "'"; + WHERE paymentid = '" . $SelectedPaymentID . "'"; $result = DB_query($sql,$db); if ( DB_num_rows($result) != 0 ) { $myrow = DB_fetch_row($result); $OldName = $myrow[0]; $sql = "UPDATE paymentmethods - SET paymentname='" . $_POST['MethodName'] . "', - paymenttype = '" . $_POST['ForPayment'] . "', - receipttype = '" . $_POST['ForReceipt'] . "', - usepreprintedstationery = '" . $_POST['UsePrePrintedStationery']. "' - WHERE paymentname " . LIKE . " '".$OldName."'"; + SET paymentname='" . $_POST['MethodName'] . "', + paymenttype = '" . $_POST['ForPayment'] . "', + receipttype = '" . $_POST['ForReceipt'] . "', + usepreprintedstationery = '" . $_POST['UsePrePrintedStationery']. "' + WHERE paymentname " . LIKE . " '".$OldName."'"; } else { $InputError = 1; @@ -91,17 +91,14 @@ $InputError = 1; prnMsg( _('The payment method can not be created because another with the same name already exists.'),'error'); } else { - $sql = "INSERT INTO paymentmethods ( - paymentname, - paymenttype, - receipttype, - usepreprintedstationery) - VALUES ( - '" . $_POST['MethodName'] ."', - '" . $_POST['ForPayment'] ."', - '" . $_POST['ForReceipt'] ."', - '" . $_POST['UsePrePrintedStationery'] ."' - )"; + $sql = "INSERT INTO paymentmethods ( paymentname, + paymenttype, + receipttype, + usepreprintedstationery) + VALUES ('" . $_POST['MethodName'] ."', + '" . $_POS... [truncated message content] |
From: <dai...@us...> - 2011-07-24 00:14:36
|
Revision: 4636 http://web-erp.svn.sourceforge.net/web-erp/?rev=4636&view=rev Author: daintree Date: 2011-07-24 00:14:27 +0000 (Sun, 24 Jul 2011) Log Message: ----------- Modified Paths: -------------- trunk/CustLoginSetup.php trunk/CustomerBranches.php trunk/OrderDetails.php trunk/OutstandingGRNs.php trunk/PDFCustTransListing.php trunk/PDFDIFOT.php trunk/PDFGrn.php trunk/PDFLowGP.php trunk/PDFOrderStatus.php trunk/PDFOrdersInvoiced.php trunk/PDFPeriodStockTransListing.php trunk/PageSecurity.php trunk/PaymentAllocations.php trunk/PaymentMethods.php trunk/PaymentTerms.php trunk/Payments.php trunk/SelectOrderItems.php trunk/SuppLoginSetup.php trunk/doc/Change.log trunk/doc/Manual/ManualPrices.html trunk/includes/DefinePaymentClass.php trunk/locale/de_DE.utf8/LC_MESSAGES/messages.po trunk/locale/hu_HU.utf8/LC_MESSAGES/messages.po trunk/locale/it_IT.utf8/LC_MESSAGES/messages.po trunk/locale/ja_JP.utf8/LC_MESSAGES/messages.po trunk/locale/pt_PT.utf8/LC_MESSAGES/messages.po Modified: trunk/CustLoginSetup.php =================================================================== --- trunk/CustLoginSetup.php 2011-07-19 09:35:25 UTC (rev 4635) +++ trunk/CustLoginSetup.php 2011-07-24 00:14:27 UTC (rev 4636) @@ -22,11 +22,6 @@ '" alt="" />' . ' ' . _('Customer') . ' : ' . $_SESSION['CustomerID'] . ' - ' . $CustomerName. _(' has been selected') . '</p><br />'; -if (isset($_GET['SelectedUser'])){ - $SelectedUser = $_GET['SelectedUser']; -} elseif (isset($_POST['SelectedUser'])){ - $SelectedUser = $_POST['SelectedUser']; -} if (isset($_POST['submit'])) { @@ -48,7 +43,7 @@ $InputError = 1; prnMsg(_('The password entered must be at least 5 characters long'),'error'); } - } elseif (mb_strstr($_POST['Password'],$_POST['UserID'])!= False){ + } elseif (mb_strstr($_POST['Password'],$_POST['UserID'])!= false){ $InputError = 1; prnMsg(_('The password cannot contain the user id'),'error'); } elseif ((mb_strlen($_POST['Cust'])>0) AND (mb_strlen($_POST['BranchCode'])==0)) { @@ -60,7 +55,7 @@ // check that the entered branch is valid for the customer code $sql = "SELECT defaultlocation FROM custbranch - WHERE debtorno='" . $_POST['Cust'] . "' + WHERE debtorno='" . $_SESSION['CustomerID'] . "' AND branchcode='" . $_POST['BranchCode'] . "'"; $ErrMsg = _('The check on validity of the customer code and branch failed because'); @@ -75,47 +70,25 @@ $InventoryLocation = $myrow[0]; } - if (isset($SelectedUser) AND $InputError !=1) { + if ($InputError !=1) { - $UpdatePassword = ''; - if ($_POST['Password'] != ""){ - $UpdatePassword = "password='" . CryptPass($_POST['Password']) . "',"; - } - - $sql = "UPDATE www_users SET realname='" . $_POST['RealName'] . "', - phone='" . $_POST['Phone'] ."', - email='" . $_POST['Email'] ."', - ".$UpdatePassword." - branchcode='" . $_POST['BranchCode'] . "', - pagesize='" . $_POST['PageSize'] . "', - theme='" . $_POST['Theme'] . "', - language ='" . $_POST['UserLanguage'] . "', - defaultlocation='" . $InventoryLocation ."', - blocked='" . $_POST['Blocked'] . "' - WHERE userid = '".$SelectedUser."'"; - - prnMsg( _('The selected user record has been updated'), 'success' ); - - - } else { //no selected user so it's an insert of new user - - $sql = "INSERT INTO www_users (userid, - realname, - customerid, - branchcode, - password, - phone, - email, - pagesize, - fullaccess, - defaultlocation, - modulesallowed, - displayrecordsmax, - theme, - language) - VALUES ('" . $_POST['UserID'] . "', + $sql = "INSERT INTO www_users (userid, + realname, + customerid, + branchcode, + password, + phone, + email, + pagesize, + fullaccess, + defaultlocation, + modulesallowed, + displayrecordsmax, + theme, + language) + VALUES ('" . $_POST['UserID'] . "', '" . $_POST['RealName'] ."', - '" . $_POST['Cust'] ."', + '" . $_SESSION['CustomerID'] ."', '" . $_POST['BranchCode'] ."', '" . CryptPass($_POST['Password']) ."', '" . $_POST['Phone'] . "', @@ -127,166 +100,27 @@ '" . $_SESSION['DefaultDisplayRecordsMax'] . "', '" . $_POST['Theme'] . "', '". $_POST['UserLanguage'] ."')"; - prnMsg( _('A new user record has been inserted'), 'success' ); + + $ErrMsg = _('The user could not be added because'); + $DbgMsg = _('The SQL that was used to insert the new user and failed was'); + $result = DB_query($sql,$db,$ErrMsg,$DbgMsg); + prnMsg( _('A new customer login has been created'), 'success' ); + include('includes/footer.inc'); + exit; } } - if ($InputError!=1){ - //run the SQL from either of the above possibilites - $ErrMsg = _('The user alterations could not be processed because'); - $DbgMsg = _('The SQL that was used to update the user and failed was'); - $result = DB_query($sql,$db,$ErrMsg,$DbgMsg); - - unset($_POST['UserID']); - unset($_POST['RealName']); - unset($_POST['Cust']); - unset($_POST['BranchCode']); - unset($_POST['Phone']); - unset($_POST['Email']); - unset($_POST['Password']); - unset($_POST['PageSize']); - unset($_POST['Theme']); - unset($_POST['UserLanguage']); - unset($_POST['Blocked']); - unset($SelectedUser); - } - -} elseif (isset($_GET['delete'])) { -//the link to delete a selected record was clicked instead of the submit button - - $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'); - } else { - - $sql="DELETE FROM www_users WHERE userid='".$SelectedUser."'"; - $ErrMsg = _('The User could not be deleted because');; - $result = DB_query($sql,$db,$ErrMsg); - prnMsg(_('User Deleted'),'info'); - } - unset($SelectedUser); } -if (!isset($SelectedUser)) { - -/* If its the first time the page has been displayed with no parameters then none of the above are true and the list of Users will be displayed with links to delete or edit each. These will call the same page again and allow update/input or deletion of the records*/ - - $sql = "SELECT userid, - realname, - phone, - email, - customerid, - branchcode, - lastvisitdate, - pagesize, - theme, - language - FROM www_users WHERE customerid = '" . $_SESSION['CustomerID'] . "'"; - $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>' . _('Last Visit') . '</th> - <th>' . _('Report Size') .'</th> - <th>' . _('Theme') .'</th> - <th>' . _('Language') .'</th> - </tr>'; - - $k=0; //row colour counter - - while ($myrow = DB_fetch_array($result)) { - if ($k==1){ - echo '<tr class="EvenTableRows">'; - $k=0; - } else { - echo '<tr class="OddTableRows">'; - $k=1; - } - - printf('<td>%s</td> - <td>%s</td> - <td>%s</td> - <td>%s</td> - <td>%s</td> - <td>%s</td> - <td>%s</td> - <td>%s</td> - <td><a href="%s&SelectedUser=%s">' . _('Edit') . '</a></td> - <td><a href="%s&SelectedUser=%s&delete=1" onclick="return confirm(\'' . _('Are you sure you wish to delete this user login?') . '\');">' . _('Delete') . '</a></td> - </tr>', - $myrow['userid'], - $myrow['realname'], - $myrow['phone'], - $myrow['email'], - $LastVisitDate, - $myrow['pagesize'], - $myrow['theme'], - $LanguagesArray[$myrow['language']], - $_SERVER['PHP_SELF'] . '?', - $myrow['userid'], - $_SERVER['PHP_SELF'] . '?', - $myrow['userid']); - - } //END WHILE LIST LOOP - echo '</table><br />'; -} //end of if there is no selected user - - -if (isset($SelectedUser)) { - echo '<div class="centre"><a href="' . $_SERVER['PHP_SELF'] .'">' . _('Review Existing Users') . '</a></div><br />'; -} echo '<form method="post" action="' . $_SERVER['PHP_SELF'] . '">'; echo '<input type="hidden" name="FormID" value="' . $_SESSION['FormID'] . '" />'; -if (isset($SelectedUser)) { - //editing an existing User +echo '<table class="selection"> + <tr> + <td>' . _('User Login') . ':</td> + <td><input type="text" name="UserID" size="22" maxlength="20" /></td> + </tr>'; - $sql = "SELECT userid, - realname, - phone, - email, - customerid, - password, - branchcode, - pagesize, - theme, - language - FROM www_users - WHERE userid='" . $SelectedUser . "'"; - - $result = DB_query($sql, $db); - $myrow = DB_fetch_array($result); - - $_POST['UserID'] = $myrow['userid']; - $_POST['RealName'] = $myrow['realname']; - $_POST['Phone'] = $myrow['phone']; - $_POST['Email'] = $myrow['email']; - $_POST['PageSize'] = $myrow['pagesize']; - $_POST['Theme'] = $myrow['theme']; - $_POST['UserLanguage'] = $myrow['language']; - - echo '<input type="hidden" name="SelectedUser" value="' . $SelectedUser . '">'; - echo '<input type="hidden" name="UserID" value="' . $_POST['UserID'] . '">'; - - echo '<table class="selection"> - <tr> - <td>' . _('User code') . ':</td> - <td>' . $_POST['UserID'] . '</td> - </tr>'; - -} else { //end of if $SelectedUser only do the else when a new record is being entered - echo '<table class="selection"> - <tr> - <td>' . _('User Login') . ':</td> - <td><input type="text" name="UserID" size="22" maxlength="20" /></td> - </tr>'; -} - if (!isset($_POST['Password'])) { $_POST['Password']=''; } @@ -312,15 +146,11 @@ //Customer is fixed by selection of customer -$_POST['Cust']=$_SESSION['CustomerID']; -echo '<input type="hidden" name="Cust" value="' . $_POST['Cust'] . '">'; -echo '<tr><td>'._('Customer Code').':</td> - <td>' . $_POST['Cust'] . '</td></tr>'; echo '<tr><td>' . _('Branch Code') . ':</td> <td><select name="BranchCode">'; -$sql = "SELECT branchcode FROM custbranch WHERE debtorno = '" . $_POST['Cust'] . "'"; +$sql = "SELECT branchcode FROM custbranch WHERE debtorno = '" . $_SESSION['CustomerID'] . "'"; $result = DB_query($sql,$db); while ($myrow=DB_fetch_array($result)){ @@ -420,20 +250,8 @@ echo '<option value="' . $LanguageEntry . '">' . $LanguageName .'</option>'; } } - - echo '</select></td></tr>'; -echo '<tr><td>' . _('Account Status') . ':</td> - <td><select name="Blocked">'; -if ($_POST['Blocked']==0){ - echo '<option selected value="0">' . _('Open') . '</option> - <option value="1">' . _('Blocked') . '</option>'; -} else { - echo '<option value="0">' . _('Open') . '</option> - <option selected value="1">' . _('Blocked') . '</option>'; -} -echo '</select></td></tr>'; echo '</table><br /> <div class="centre"><input type="submit" name="submit" value="' . _('Enter Information') . '"></div> Modified: trunk/CustomerBranches.php =================================================================== --- trunk/CustomerBranches.php 2011-07-19 09:35:25 UTC (rev 4635) +++ trunk/CustomerBranches.php 2011-07-24 00:14:27 UTC (rev 4636) @@ -431,14 +431,14 @@ echo '<b>'.($TotalEnable+$TotalDisable). '</b> ' . _('Total Branches') . '</div></td></tr></table>'; } else { $sql = "SELECT debtorsmaster.name, - address1, - address2, - address3, - address4, - address5, - address6 - FROM debtorsmaster - WHERE debtorno = '".$DebtorNo."'"; + address1, + address2, + address3, + address4, + address5, + address6 + FROM debtorsmaster + WHERE debtorno = '".$DebtorNo."'"; $result = DB_query($sql,$db); $myrow = DB_fetch_row($result); @@ -463,35 +463,35 @@ //editing an existing branch $sql = "SELECT branchcode, - brname, - braddress1, - braddress2, - braddress3, - braddress4, - braddress5, - braddress6, - specialinstructions, - estdeliverydays, - fwddate, - salesman, - area, - phoneno, - faxno, - contactname, - email, - taxgroupid, - defaultlocation, - brpostaddr1, - brpostaddr2, - brpostaddr3, - brpostaddr4, - disabletrans, - defaultshipvia, - custbranchcode, - deliverblind - FROM custbranch - WHERE branchcode='".$SelectedBranch."' - AND debtorno='".$DebtorNo."'"; + brname, + braddress1, + braddress2, + braddress3, + braddress4, + braddress5, + braddress6, + specialinstructions, + estdeliverydays, + fwddate, + salesman, + area, + phoneno, + faxno, + contactname, + email, + taxgroupid, + defaultlocation, + brpostaddr1, + brpostaddr2, + brpostaddr3, + brpostaddr4, + disabletrans, + defaultshipvia, + custbranchcode, + deliverblind + FROM custbranch + WHERE branchcode='".$SelectedBranch."' + AND debtorno='".$DebtorNo."'"; $result = DB_query($sql, $db); $myrow = DB_fetch_array($result); @@ -547,12 +547,12 @@ */ if (isset($_GET['BranchCode'])){ $sql="SELECT name, - address1, - address2, - address3, - address4, - address5, - address6 + address1, + address2, + address3, + address4, + address5, + address6 FROM debtorsmaster WHERE debtorno='".$_GET['BranchCode']."'"; @@ -579,22 +579,7 @@ $_POST['DeliverBlind'] = $_SESSION['DefaultBlindPackNote']; } - //SQL to poulate account selection boxes - $sql = "SELECT salesmanname, - salesmancode - FROM salesman - WHERE current = 1"; - $result = DB_query($sql,$db); - - if (DB_num_rows($result)==0){ - echo '</table>'; - prnMsg(_('There are no sales people defined as yet') . ' - ' . _('customer branches must be allocated to a sales person') . '. ' . _('Please use the link below to define at least one sales person'),'error'); - echo '<p align="center"><a href="' . $rootpath . '/SalesPeople.php">'._('Define Sales People') . '</a>'; - include('includes/footer.inc'); - exit; - } - echo '<input type=hidden name="DebtorNo" value="'. $DebtorNo . '" />'; @@ -636,6 +621,23 @@ if (!isset($_POST['FwdDate'])) {$_POST['FwdDate']=0;} echo '<td><input ' .(in_array('FwdDate',$Errors) ? 'class="inputerror"' : '' ) .' tabindex=12 type="text" class=number name="FwdDate" size=4 maxlength=2 value='. $_POST['FwdDate'].'></td></tr>'; + + //SQL to poulate account selection boxes + $sql = "SELECT salesmanname, + salesmancode + FROM salesman + WHERE current = 1"; + + $result = DB_query($sql,$db); + + if (DB_num_rows($result)==0){ + echo '</table>'; + prnMsg(_('There are no sales people defined as yet') . ' - ' . _('customer branches must be allocated to a sales person') . '. ' . _('Please use the link below to define at least one sales person'),'error'); + echo '<p align="center"><a href="' . $rootpath . '/SalesPeople.php">'._('Define Sales People') . '</a>'; + include('includes/footer.inc'); + exit; + } + echo '<tr><td>'._('Salesperson').':</td>'; echo '<td><select tabindex=13 name="Salesman">'; @@ -717,15 +719,22 @@ //only display email link if there is an email address echo '<td><input tabindex=18 type="text" name="Email" size=56 maxlength=55 value="'. $_POST['Email'].'"></td></tr>'; - echo '<tr><td>'._('Tax Group').':</td>'; - echo '<td><select tabindex=19 name="TaxGroup">'; DB_data_seek($result,0); $sql = "SELECT taxgroupid, taxgroupdescription FROM taxgroups"; - $result = DB_query($sql,$db); - - while ($myrow = DB_fetch_array($result)) { + $TaxGroupResults = DB_query($sql,$db); + if (DB_num_rows($TaxGroupResults)==0){ + echo '</table>'; + prnMsg(_('There are no tax groups defined - these must be set up first before any branches can be set up') . ' + <br /><a href="' . $rootpath . '/TaxGroups.php">' . _('Define Tax Groups') . '</a>','error'); + include('includes/footer.inc'); + exit; + } + echo '<tr><td>'._('Tax Group').':</td> + <td><select tabindex=19 name="TaxGroup">'; + + while ($myrow = DB_fetch_array($TaxGroupResults)) { if (isset($_POST['TaxGroup']) and $myrow['taxgroupid']==$_POST['TaxGroup']) { echo '<option selected value="'; } else { @@ -748,10 +757,18 @@ echo ' </select></td></tr>'; + + $SQL = "SELECT shipper_id, shippername FROM shippers"; + $ShipperResults = DB_query($SQL,$db); + if (DB_num_rows($ShipperResults)==0){ + echo '</table>'; + prnMsg(_('There are no shippers defined - these must be set up first before any branches can be set up') . ' + <br /><a href="' . $rootpath . '/Shippers.php">' . _('Define Shippers') . '</a>','error'); + include('includes/footer.inc'); + exit; + } echo '<tr><td>'._('Default freight/shipper method') . ':</td> <td><select tabindex=21 name="DefaultShipVia">'; - $SQL = "SELECT shipper_id, shippername FROM shippers"; - $ShipperResults = DB_query($SQL,$db); while ($myrow=DB_fetch_array($ShipperResults)){ if (isset($_POST['DefaultShipVia'])and $myrow['shipper_id']==$_POST['DefaultShipVia']){ echo '<option selected value=' . $myrow['shipper_id'] . '>' . $myrow['shippername'] . '</option>'; Modified: trunk/OrderDetails.php =================================================================== --- trunk/OrderDetails.php 2011-07-19 09:35:25 UTC (rev 4635) +++ trunk/OrderDetails.php 2011-07-24 00:14:27 UTC (rev 4636) @@ -1,9 +1,7 @@ <?php -/* $Revision: 1.25 $ */ + /* $Id$*/ -//$PageSecurity = 2; - /* Session started in header.inc for password checking and authorisation level check */ include('includes/session.inc'); @@ -21,34 +19,33 @@ include('includes/header.inc'); -$OrderHeaderSQL = "SELECT - salesorders.debtorno, - debtorsmaster.name, - salesorders.branchcode, - salesorders.customerref, - salesorders.comments, - salesorders.orddate, - salesorders.ordertype, - salesorders.shipvia, - salesorders.deliverto, - salesorders.deladd1, - salesorders.deladd2, - salesorders.deladd3, - salesorders.deladd4, - salesorders.deladd5, - salesorders.deladd6, - salesorders.contactphone, - salesorders.contactemail, - salesorders.freightcost, - salesorders.deliverydate, - debtorsmaster.currcode, - salesorders.fromstkloc - FROM - salesorders, - debtorsmaster - WHERE - salesorders.debtorno = debtorsmaster.debtorno - AND salesorders.orderno = '" . $_GET['OrderNumber'] . "'"; +$OrderHeaderSQL = "SELECT salesorders.debtorno, + debtorsmaster.name, + salesorders.branchcode, + salesorders.customerref, + salesorders.comments, + salesorders.orddate, + salesorders.ordertype, + salesorders.shipvia, + salesorders.deliverto, + salesorders.deladd1, + salesorders.deladd2, + salesorders.deladd3, + salesorders.deladd4, + salesorders.deladd5, + salesorders.deladd6, + salesorders.contactphone, + salesorders.contactemail, + salesorders.freightcost, + salesorders.deliverydate, + debtorsmaster.currcode, + salesorders.fromstkloc, + currencies.decimalplaces + FROM salesorders INNER JOIN debtorsmaster + ON salesorders.debtorno = debtorsmaster.debtorno + INNER JOIN currencies + ON debtorsmaster.currcode=currencies.currabrev + WHERE salesorders.orderno = '" . $_GET['OrderNumber'] . "'"; $ErrMsg = _('The order cannot be retrieved because'); $DbgMsg = _('The SQL that failed to get the order header was'); @@ -59,7 +56,9 @@ _('Order Details') . '" alt="" />' . ' ' . $title . '</p>'; $myrow = DB_fetch_array($GetOrdHdrResult); - echo '<table class=selection>'; + $CurrDecimalPlaces = $myrow['decimalplaces']; + + echo '<table class="selection">'; echo '<tr><th colspan=4><font color=blue>'._('Order Header Details For Order No').' '.$_GET['OrderNumber'].'</font></th></tr>'; echo '<tr> <th style="text-align: left">' . _('Customer Code') . ':</th> @@ -118,24 +117,24 @@ /*Now get the line items */ - $LineItemsSQL = "SELECT - stkcode, - stockmaster.description, - stockmaster.volume, - stockmaster.kgs, - stockmaster.decimalplaces, - stockmaster.mbflag, - stockmaster.units, - stockmaster.discountcategory, - stockmaster.controlled, - stockmaster.serialised, - unitprice, - quantity, - discountpercent, - actualdispatchdate, - qtyinvoiced - FROM salesorderdetails, stockmaster - WHERE salesorderdetails.stkcode = stockmaster.stockid AND orderno ='" . $_GET['OrderNumber'] . "'"; + $LineItemsSQL = "SELECT stkcode, + stockmaster.description, + stockmaster.volume, + stockmaster.kgs, + stockmaster.decimalplaces, + stockmaster.mbflag, + stockmaster.units, + stockmaster.discountcategory, + stockmaster.controlled, + stockmaster.serialised, + unitprice, + quantity, + discountpercent, + actualdispatchdate, + qtyinvoiced + FROM salesorderdetails INNER JOIN stockmaster + ON salesorderdetails.stkcode = stockmaster.stockid + WHERE orderno ='" . $_GET['OrderNumber'] . "'"; $ErrMsg = _('The line items of the order cannot be retrieved because'); $DbgMsg = _('The SQL used to retrieve the line items, that failed was'); @@ -150,15 +149,15 @@ echo '<br /><table cellpadding=2 colspan=9 class=selection>'; echo '<tr><th colspan=9><font color=blue>'._('Order Line Details For Order No').' '.$_GET['OrderNumber'].'</font></th></tr>'; echo '<tr> - <th>' . _('Item Code') . '</th> - <th>' . _('Item Description') . '</th> - <th>' . _('Quantity') . '</th> - <th>' . _('Unit') . '</th> - <th>' . _('Price') . '</th> - <th>' . _('Discount') . '</th> - <th>' . _('Total') . '</th> - <th>' . _('Qty Del') . '</th> - <th>' . _('Last Del') . '</th> + <th>' . _('Item Code') . '</th> + <th>' . _('Item Description') . '</th> + <th>' . _('Quantity') . '</th> + <th>' . _('Unit') . '</th> + <th>' . _('Price') . '</th> + <th>' . _('Discount') . '</th> + <th>' . _('Total') . '</th> + <th>' . _('Qty Del') . '</th> + <th>' . _('Last Del') . '</th> </tr>'; $k=0; while ($myrow=db_fetch_array($LineItemsResult)) { @@ -181,10 +180,10 @@ <td>' . $myrow['description'] . '</td> <td class=number>' . $myrow['quantity'] . '</td> <td>' . $myrow['units'] . '</td> - <td class=number>' . number_format($myrow['unitprice'],2) . '</td> + <td class=number>' . number_format($myrow['unitprice'],$CurrDecimalPlaces) . '</td> <td class=number>' . number_format(($myrow['discountpercent'] * 100),2) . '%' . '</td> - <td class=number>' . number_format($myrow['quantity'] * $myrow['unitprice'] * (1 - $myrow['discountpercent']),2) . '</td> - <td class=number>' . number_format($myrow['qtyinvoiced'],2) . '</td> + <td class=number>' . number_format($myrow['quantity'] * $myrow['unitprice'] * (1 - $myrow['discountpercent']),$CurrDecimalPlaces) . '</td> + <td class=number>' . number_format($myrow['qtyinvoiced'],$myrow['decimalplaces']) . '</td> <td>' . $DisplayActualDeliveryDate . '</td> </tr>'; @@ -193,7 +192,7 @@ $OrderTotalWeight = $OrderTotalWeight + $myrow['quantity'] * $myrow['kgs']; } - $DisplayTotal = number_format($OrderTotal,2); + $DisplayTotal = number_format($OrderTotal,$CurrDecimalPlaces); $DisplayVolume = number_format($OrderTotalVolume,2); $DisplayWeight = number_format($OrderTotalWeight,2); Modified: trunk/OutstandingGRNs.php =================================================================== --- trunk/OutstandingGRNs.php 2011-07-19 09:35:25 UTC (rev 4635) +++ trunk/OutstandingGRNs.php 2011-07-24 00:14:27 UTC (rev 4636) @@ -30,13 +30,18 @@ quantityinv, grns.stdcostunit, actprice, - unitprice - FROM grns, - purchorderdetails, - suppliers - WHERE grns.supplierid=suppliers.supplierid - AND grns.podetailitem = purchorderdetails.podetailitem - AND qtyrecd-quantityinv>0 + unitprice, + currencies.decimalplaces as currdecimalplaces, + stockmaster.decimalplaces as itemdecimalplaces + FROM grns INNER JOIN purchorderdetails + ON grns.podetailitem = purchorderdetails.podetailitem + INNER JOIN suppliers + ON grns.supplierid=suppliers.supplierid + INNER JOIN currencies + ON suppliers.currcode=currencies.currabrev + LEFT JOIN stockmaster + ON grns.itemcode=stockmaster.stockid + WHERE qtyrecd-quantityinv>0 AND grns.supplierid >='" . $_POST['FromCriteria'] . "' AND grns.supplierid <='" . $_POST['ToCriteria'] . "' ORDER BY supplierid, @@ -81,7 +86,7 @@ /* need to print the total of previous supplier */ $YPos -= (2*$line_height); $LeftOvers = $pdf->addTextWrap($Left_Margin,$YPos,260-$Left_Margin,$FontSize,_('Total for') . ' ' . $Supplier . ' - ' . $SupplierName); - $DisplaySuppTotVal = number_format($SuppTot_Val,2); + $DisplaySuppTotVal = number_format($SuppTot_Val,$GRNs['decimalplaces']); $LeftOvers = $pdf->addTextWrap(500,$YPos,60,$FontSize,$DisplaySuppTotVal, 'right'); $YPos -=$line_height; $pdf->line($Left_Margin, $YPos+$line_height-2,$Page_Width-$Right_Margin, $YPos+$line_height-2); @@ -93,16 +98,21 @@ $SupplierName = $GRNs['suppname']; } $YPos -=$line_height; - + + if ($GRNs['itemdecimalplaces']==null){ + $ItemDecimalPlaces = 2; + } else { + $ItemDecimalPlaces = $GRNs['itemdecimalplaces']; + } $LeftOvers = $pdf->addTextWrap(32,$YPos,40,$FontSize,$GRNs['grnno']); $LeftOvers = $pdf->addTextWrap(70,$YPos,40,$FontSize,$GRNs['orderno']); $LeftOvers = $pdf->addTextWrap(110,$YPos,200,$FontSize,$GRNs['itemcode'] . ' - ' . $GRNs['itemdescription']); - $DisplayStdCost = number_format($GRNs['stdcostunit'],2); - $DisplayQtyRecd = number_format($GRNs['qtyrecd'],2); - $DisplayQtyInv = number_format($GRNs['quantityinv'],2); - $DisplayQtyOstg = number_format($GRNs['qtyrecd']- $GRNs['quantityinv'],2); + $DisplayStdCost = number_format($GRNs['stdcostunit'],$_SESSION['CompanyRecord']['decimalplaces']); + $DisplayQtyRecd = number_format($GRNs['qtyrecd'],$ItemDecimalPlaces); + $DisplayQtyInv = number_format($GRNs['quantityinv'],$ItemDecimalPlaces); + $DisplayQtyOstg = number_format($GRNs['qtyrecd']- $GRNs['quantityinv'],$ItemDecimalPlaces); $LineValue = ($GRNs['qtyrecd']- $GRNs['quantityinv'])*$GRNs['stdcostunit']; - $DisplayValue = number_format($LineValue,2); + $DisplayValue = number_format($LineValue,$_SESSION['CompanyRecord']['decimalplaces']); $LeftOvers = $pdf->addTextWrap(310,$YPos,50,$FontSize,$DisplayQtyRecd,'right'); $LeftOvers = $pdf->addTextWrap(360,$YPos,50,$FontSize,$DisplayQtyInv, 'right'); Modified: trunk/PDFCustTransListing.php =================================================================== --- trunk/PDFCustTransListing.php 2011-07-19 09:35:25 UTC (rev 4635) +++ trunk/PDFCustTransListing.php 2011-07-24 00:14:27 UTC (rev 4636) @@ -54,15 +54,20 @@ } $sql= "SELECT type, - debtorno, - transno, - trandate, - ovamount, - ovgst, - invtext - FROM debtortrans - WHERE type='" . $_POST['TransType'] . "' - AND date_format(inputdate, '%Y-%m-%d')='".FormatDateForSQL($_POST['Date'])."'"; + debtortrans.debtorno, + transno, + trandate, + ovamount, + ovgst, + invtext, + debtortrans.rate, + decimalplaces + FROM debtortrans INNER JOIN debtorsmaster + ON debtortrans.debtorno=debtorsmaster.debtorno + INNER JOIN currencies + ON debtorsmaster.currcode=currencies.currabrev + WHERE type='" . $_POST['TransType'] . "' + AND date_format(inputdate, '%Y-%m-%d')='".FormatDateForSQL($_POST['Date'])."'"; $result=DB_query($sql,$db,'','',false,false); @@ -70,8 +75,8 @@ $title = _('Payment Listing'); 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'); + if ($debug==1){ + prnMsg(_('The SQL used to get the transaction information that failed was') . ':<br />' . $sql,'error'); } include('includes/footer.inc'); exit; @@ -92,7 +97,7 @@ $pdf->addInfo('Subject',_('Customer transaction listing from') . ' ' . $_POST['Date'] ); $line_height=12; $PageNumber = 1; -$TotalCheques = 0; +$TotalAmount = 0; include ('includes/PDFCustTransListingPageHeader.inc'); @@ -105,12 +110,12 @@ $LeftOvers = $pdf->addTextWrap($Left_Margin,$YPos,160,$FontSize,$supplierrow['name'], 'left'); $LeftOvers = $pdf->addTextWrap($Left_Margin+162,$YPos,80,$FontSize,$myrow['transno'], 'left'); $LeftOvers = $pdf->addTextWrap($Left_Margin+242,$YPos,70,$FontSize,ConvertSQLDate($myrow['trandate']), 'left'); - $LeftOvers = $pdf->addTextWrap($Left_Margin+312,$YPos,70,$FontSize,number_format($myrow['ovamount'],2), 'right'); - $LeftOvers = $pdf->addTextWrap($Left_Margin+382,$YPos,70,$FontSize,number_format($myrow['ovgst'],2), 'right'); - $LeftOvers = $pdf->addTextWrap($Left_Margin+452,$YPos,70,$FontSize,number_format($myrow['ovamount']+$myrow['ovgst'],2), 'right'); + $LeftOvers = $pdf->addTextWrap($Left_Margin+312,$YPos,70,$FontSize,number_format($myrow['ovamount'],$myrow['decimalplaces']), 'right'); + $LeftOvers = $pdf->addTextWrap($Left_Margin+382,$YPos,70,$FontSize,number_format($myrow['ovgst'],$myrow['decimalplaces']), 'right'); + $LeftOvers = $pdf->addTextWrap($Left_Margin+452,$YPos,70,$FontSize,number_format($myrow['ovamount']+$myrow['ovgst'],$myrow['decimalplaces']), 'right'); $YPos -= ($line_height); - $TotalCheques = $TotalCheques - $myrow['ovamount']; + $TotalAmount = $TotalAmount + ($myrow['ovamount']/$myrow['rate']); if ($YPos - (2 *$line_height) < $Bottom_Margin){ /*Then set up a new page */ @@ -121,8 +126,8 @@ $YPos-=$line_height; -$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'); +$LeftOvers = $pdf->addTextWrap($Left_Margin+452,$YPos,70,$FontSize,number_format($TotalAmount,$_SESSION['CompanyRecord']['decimalplaces']), 'right'); +$LeftOvers = $pdf->addTextWrap($Left_Margin+265,$YPos,300,$FontSize,_('Total') . ' ' . _('Transactions') . ' ' . $_SESSION['CompanyRecord']['CurrencyDefault'], 'left'); $ReportFileName = $_SESSION['DatabaseName'] . '_CustTransListing_' . date('Y-m-d').'.pdf'; $pdf->OutputD($ReportFileName); Modified: trunk/PDFDIFOT.php =================================================================== --- trunk/PDFDIFOT.php 2011-07-19 09:35:25 UTC (rev 4635) +++ trunk/PDFDIFOT.php 2011-07-24 00:14:27 UTC (rev 4636) @@ -26,7 +26,7 @@ echo '<form method="post" action="' . $_SERVER['PHP_SELF'] . '">'; echo '<input type="hidden" name="FormID" value="' . $_SESSION['FormID'] . '" />'; - echo '<table class=selection> + echo '<table class="selection"> <tr> <td>' . _('Enter the date from which variances between orders and deliveries 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')-1,0,Date('y'))) . '"></td> @@ -41,9 +41,9 @@ } echo '<tr> - <td>' . _('Enter the number of days considered acceptable between delivery requested date and invoice date(ie the date dispatched)') . ':</td> - <td><input type="text" class="number" name="DaysAcceptable" maxlength=2 size=2 value="' . $_POST['DaysAcceptable'] . '"></td> - </tr>'; + <td>' . _('Enter the number of days considered acceptable between delivery requested date and invoice date(ie the date dispatched)') . ':</td> + <td><input type="text" class="number" name="DaysAcceptable" maxlength=2 size=2 value="' . $_POST['DaysAcceptable'] . '"></td> + </tr>'; echo '<tr><td>' . _('Inventory Category') . '</td><td>'; $sql = "SELECT categorydescription, categoryid FROM stockcategory WHERE stocktype<>'D' AND stocktype<>'L'"; @@ -57,7 +57,6 @@ echo '<option value="' . $myrow['categoryid'] . '">' . $myrow['categorydescription'] . '</option>'; } - echo '</select></td></tr>'; echo '<tr><td>' . _('Inventory Location') . ':</td> @@ -99,6 +98,7 @@ salesorderdetails.quantity, salesorderdetails.stkcode, stockmaster.description, + stockmaster.decimalplaces, salesorders.debtorno, salesorders.branchcode FROM salesorderdetails INNER JOIN stockmaster @@ -116,6 +116,7 @@ salesorderdetails.quantity, salesorderdetails.stkcode, stockmaster.description, + stockmaster.decimalplaces, salesorders.debtorno, salesorders.branchcode FROM salesorderdetails INNER JOIN stockmaster @@ -136,6 +137,7 @@ salesorderdetails.quantity, salesorderdetails.stkcode, stockmaster.description, + stockmaster.decimalplaces, salesorders.debtorno, salesorders.branchcode FROM salesorderdetails INNER JOIN stockmaster @@ -156,6 +158,7 @@ salesorderdetails.quantity, salesorderdetails.stkcode, stockmaster.description, + stockmaster.decimalplaces, salesorders.debtorno, salesorders.branchcode FROM salesorderdetails INNER JOIN stockmaster @@ -214,7 +217,7 @@ if ($DaysDiff > $_POST['DaysAcceptable']){ $LeftOvers = $pdf->addTextWrap($Left_Margin,$YPos,40,$FontSize,$myrow['orderno'], 'left'); $LeftOvers = $pdf->addTextWrap($Left_Margin+40,$YPos,200,$FontSize,$myrow['stkcode'] .' - ' . $myrow['description'], 'left'); - $LeftOvers = $pdf->addTextWrap($Left_Margin+240,$YPos,50,$FontSize,number_format($myrow['quantity']), 'right'); + $LeftOvers = $pdf->addTextWrap($Left_Margin+240,$YPos,50,$FontSize,number_format($myrow['quantity'],$myrow['decimalplaces']), 'right'); $LeftOvers = $pdf->addTextWrap($Left_Margin+295,$YPos,50,$FontSize,$myrow['debtorno'], 'left'); $LeftOvers = $pdf->addTextWrap($Left_Margin+345,$YPos,50,$FontSize,$myrow['branchcode'], 'left'); $LeftOvers = $pdf->addTextWrap($Left_Margin+395,$YPos,50,$FontSize,ConvertSQLDate($myrow['actualdispatchdate']), 'left'); @@ -286,14 +289,14 @@ $ReportFileName = $_SESSION['DatabaseName'] . '_DIFOT_' . date('Y-m-d').'.pdf'; -$pdf->OutputD($ReportFileName);//UldisN -$pdf->__destruct(); //UldisN +$pdf->OutputD($ReportFileName); +$pdf->__destruct(); if ($_POST['Email']=='Yes'){ if (file_exists($_SESSION['reports_dir'] . '/'.$ReportFileName)){ unlink($_SESSION['reports_dir'] . '/'.$ReportFileName); } - $fp = fopen( $_SESSION['reports_dir'] . '/'.$ReportFileName,'wb'); + $fp = fopen( $_SESSION['reports_dir'] . '/'.$ReportFileName,'wb'); fwrite ($fp, $pdfcode); fclose ($fp); Modified: trunk/PDFGrn.php =================================================================== --- trunk/PDFGrn.php 2011-07-19 09:35:25 UTC (rev 4635) +++ trunk/PDFGrn.php 2011-07-24 00:14:27 UTC (rev 4636) @@ -41,35 +41,35 @@ } else { //NOT PREVIEW $sql="SELECT grns.itemcode, - grns.grnno, - grns.deliverydate, - grns.itemdescription, - grns.qtyrecd, - grns.supplierid, - purchorderdetails.suppliersunit, - purchorderdetails.conversionfactor, - stockmaster.units, - stockmaster.decimalplaces - FROM grns INNER JOIN purchorderdetails - ON grns.podetailitem=purchorderdetails.podetailitem - LEFT JOIN stockmaster - ON grns.itemcode=stockmaster.stockid - WHERE grnbatch='".$GRNNo."'"; + grns.grnno, + grns.deliverydate, + grns.itemdescription, + grns.qtyrecd, + grns.supplierid, + purchorderdetails.suppliersunit, + purchorderdetails.conversionfactor, + stockmaster.units, + stockmaster.decimalplaces + FROM grns INNER JOIN purchorderdetails + ON grns.podetailitem=purchorderdetails.podetailitem + LEFT JOIN stockmaster + ON grns.itemcode=stockmaster.stockid + WHERE grnbatch='".$GRNNo."'"; $GRNResult=DB_query($sql, $db); $NoOfGRNs = DB_num_rows($GRNResult); if($NoOfGRNs>0) { //there are GRNs to print $sql = "SELECT suppliers.suppname, - suppliers.address1, - suppliers.address2 , - suppliers.address3, - suppliers.address4, - suppliers.address5, - suppliers.address6 - FROM grns INNER JOIN suppliers - ON grns.supplierid=suppliers.supplierid - WHERE grnbatch='".$GRNNo."'"; + suppliers.address1, + suppliers.address2 , + suppliers.address3, + suppliers.address4, + suppliers.address5, + suppliers.address6 + FROM grns INNER JOIN suppliers + ON grns.supplierid=suppliers.supplierid + WHERE grnbatch='".$GRNNo."'"; $SuppResult = DB_query($sql,$db,_('Could not get the supplier of the selected GRN')); $SuppRow = DB_fetch_array($SuppResult); } Modified: trunk/PDFLowGP.php =================================================================== --- trunk/PDFLowGP.php 2011-07-19 09:35:25 UTC (rev 4635) +++ trunk/PDFLowGP.php 2011-07-24 00:14:27 UTC (rev 4636) @@ -28,27 +28,26 @@ /*Now figure out the data to report for the category range under review */ $SQL = "SELECT stockmaster.categoryid, - stockmaster.stockid, - stockmoves.transno, - stockmoves.trandate, - systypes.typename, - stockmaster.materialcost + stockmaster.labourcost + stockmaster.overheadcost as unitcost, - stockmoves.qty, - stockmoves.debtorno, - stockmoves.branchcode, - stockmoves.price*(1-stockmoves.discountpercent) as sellingprice, - (stockmoves.price*(1-stockmoves.discountpercent)) - (stockmaster.materialcost + stockmaster.labourcost + stockmaster.overheadcost) AS gp, - debtorsmaster.name - FROM stockmaster, - stockmoves, - systypes, - debtorsmaster - WHERE stockmoves.type=systypes.typeid - AND stockmaster.stockid=stockmoves.stockid - AND stockmoves.trandate >= '" . FormatDateForSQL($_POST['FromDate']) . "' + stockmaster.stockid, + stockmoves.transno, + stockmoves.trandate, + systypes.typename, + stockmaster.materialcost + stockmaster.labourcost + stockmaster.overheadcost as unitcost, + stockmoves.qty, + stockmoves.debtorno, + stockmoves.branchcode, + stockmoves.price*(1-stockmoves.discountpercent) as sellingprice, + (stockmoves.price*(1-stockmoves.discountpercent)) - (stockmaster.materialcost + stockmaster.labourcost + stockmaster.overheadcost) AS gp, + debtorsmaster.name + FROM stockmaster INNER JOIN stockmoves + ON stockmaster.stockid=stockmoves.stockid + INNER JOIN systypes + ON stockmoves.type=systypes.typeid + INNER JOIN debtorsmaster + ON stockmoves.debtorno=debtorsmaster.debtorno + WHERE stockmoves.trandate >= '" . FormatDateForSQL($_POST['FromDate']) . "' AND stockmoves.trandate <= '" . FormatDateForSQL($_POST['ToDate']) . "' AND ((stockmoves.price*(1-stockmoves.discountpercent)) - (stockmaster.materialcost + stockmaster.labourcost + stockmaster.overheadcost))/(stockmoves.price*(1-stockmoves.discountpercent)) <=" . ($_POST['GPMin']/100) . " - AND stockmoves.debtorno=debtorsmaster.debtorno ORDER BY stockmaster.stockid"; $LowGPSalesResult = DB_query($SQL,$db,'','',false,false); @@ -90,9 +89,9 @@ $LeftOvers = $pdf->addTextWrap(100,$YPos,30,$FontSize,$LowGPItems['transno']); $LeftOvers = $pdf->addTextWrap(130,$YPos,50,$FontSize,$LowGPItems['stockid']); $LeftOvers = $pdf->addTextWrap(220,$YPos,50,$FontSize,$LowGPItems['name']); - $DisplayUnitCost = number_format($LowGPItems['unitcost'],2); - $DisplaySellingPrice = number_format($LowGPItems['sellingprice'],2); - $DisplayGP = number_format($LowGPItems['gp'],2); + $DisplayUnitCost = number_format($LowGPItems['unitcost'],$_SESSION['CompanyRecord']['decimalplaces']); + $DisplaySellingPrice = number_format($LowGPItems['sellingprice'],$_SESSION['CompanyRecord']['decimalplaces']); + $DisplayGP = number_format($LowGPItems['gp'],$_SESSION['CompanyRecord']['decimalplaces']); $DisplayGPPercent = number_format(($LowGPItems['gp']*100)/$LowGPItems['sellingprice'],1); $LeftOvers = $pdf->addTextWrap(330,$YPos,60,$FontSize,$DisplaySellingPrice,'right'); @@ -138,11 +137,14 @@ </tr>'; echo '<tr><td>' . _('Show sales with GP') . '%' . _('below') . ':</td> - <td><input type="text" class="number" name="GPMin" maxlength="3" size="3" value="' . $_POST['GPMin'] . '"></td> - </tr>'; + <td><input type="text" class="number" name="GPMin" maxlength="3" size="3" value="' . $_POST['GPMin'] . '"></td> + </tr>'; echo '</table> - <br /><div class="centre"><input type="submit" name="PrintPDF" value="' . _('Print PDF') . '"></div>'; + <br /> + <div class="centre"> + <input type="submit" name="PrintPDF" value="' . _('Print PDF') . '"> + </div>'; } include('includes/footer.inc'); Modified: trunk/PDFOrderStatus.php =================================================================== --- trunk/PDFOrderStatus.php 2011-07-19 09:35:25 UTC (rev 4635) +++ trunk/PDFOrderStatus.php 2011-07-24 00:14:27 UTC (rev 4636) @@ -61,13 +61,17 @@ } echo '</select></td></tr>'; - echo '<tr><td>' . _('Back Order Only') . ':</td><td><select name="BackOrders">'; - echo '<option selected value="Yes">' . _('Only Show Back Orders') . '</option>'; - echo '<option value="No">' . _('Show All Orders') . '</option>'; - echo '</select></td> - </tr> - </table> - <br /><div class="centre"><input type=submit name="Go" value="' . _('Create PDF') . '"></div>'; + echo '<tr><td>' . _('Back Order Only') . ':</td> + <td><select name="BackOrders"> + <option selected value="Yes">' . _('Only Show Back Orders') . '</option> + <option value="No">' . _('Show All Orders') . '</option> + </select></td> + </tr> + </table> + <br /> + <div class="centre"> + <input type=submit name="Go" value="' . _('Create PDF') . '"> + </div>'; include('includes/footer.inc'); exit; @@ -228,7 +232,6 @@ AND salesorders.orddate >='" . FormatDateForSQL($_POST['FromDate']) . "' AND salesorders.orddate <='" . FormatDateForSQL($_POST['ToDate']) . "' AND salesorders.quotation=0"; - } if ($_POST['BackOrders']=='Yes'){ Modified: trunk/PDFOrdersInvoiced.php =================================================================== --- trunk/PDFOrdersInvoiced.php 2011-07-19 09:35:25 UTC (rev 4635) +++ trunk/PDFOrdersInvoiced.php 2011-07-24 00:14:27 UTC (rev 4636) @@ -35,7 +35,11 @@ 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>'; @@ -55,7 +59,7 @@ 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); + $result= DB_query("SELECT loccode, locationname FROM locations",$db); while ($myrow=DB_fetch_array($result)){ echo '<option value="' . $myrow['loccode'] . '">' . $myrow['locationname'] . '</option>'; } @@ -108,16 +112,16 @@ ON salesorders.fromstkloc=locations.loccode WHERE orddate >='" . FormatDateForSQL($_POST['FromDate']) . "' AND orddate <='" . FormatDateForSQL($_POST['ToDate']) . "' - GROUP BY salesorders.orderno, - salesorders.debtorno, - salesorders.branchcode, - salesorders.customerref, - salesorders.orddate, - salesorders.fromstkloc, - salesorderdetails.stkcode, - stockmaster.description, - stockmaster.units, - stockmaster.decimalplaces"; + GROUP BY salesorders.orderno, + salesorders.debtorno, + salesorders.branchcode, + salesorders.customerref, + salesorders.orddate, + salesorders.fromstkloc, + salesorderdetails.stkcode, + stockmaster.description, + stockmaster.units, + stockmaster.decimalplaces"; } elseif ($_POST['CategoryID']!='All' AND $_POST['Location']=='All') { @@ -153,17 +157,17 @@ WHERE stockmaster.categoryid ='" . $_POST['CategoryID'] . "' AND orddate >='" . FormatDateForSQL($_POST['FromDate']) . "' AND orddate <='" . FormatDateForSQL($_POST['ToDate']) . "' - GROUP BY salesorders.orderno, - salesorders.debtorno, - salesorders.branchcode, - salesorders.customerref, - salesorders.orddate, - salesorders.fromstkloc, - salesorderdetails.stkcode, - stockmaster.description, - stockmaster.units, - stockmaster.decimalplaces"; - + GROUP BY salesorders.orderno, + salesorders.debtorno, + salesorders.branchcode, + salesorders.customerref, + salesorders.orddate, + salesorders.fromstkloc, + salesorderdetails.stkcode, + stockmaster.description, + stockmaster.units, + stockmaster.decimalplaces"; + } elseif ($_POST['CategoryID']=='All' AND $_POST['Location']!='All') { $sql= "SELECT salesorders.orderno, salesorders.debtorno, @@ -227,7 +231,7 @@ SUM(salesorderdetails.qtyinvoiced) AS totqtyinvoiced INNER JOIN locations ON salesorders.fromstkloc=locations.loccode - FROM salesorders + FROM salesorders INNER JOIN salesorderdetails ON salesorders.orderno = salesorderdetails.orderno INNER JOIN stockmaster @@ -237,20 +241,20 @@ INNER JOIN custbranch ON custbranch.debtorno=salesorders.debtorno AND custbranch.branchcode=salesorders.branchcode - WHERE stockmaster.categoryid ='" . $_POST['CategoryID'] . "' + WHERE stockmaster.categoryid ='" . $_POST['CategoryID'] . "' AND salesorders.fromstkloc ='" . $_POST['Location'] . "' AND orddate >='" . FormatDateForSQL($_POST['FromDate']) . "' AND orddate <='" . FormatDateForSQL($_POST['ToDate']) . "' - GROUP BY salesorders.orderno, - salesorders.debtorno, - salesorders.branchcode, - salesorders.customerref, - salesorders.orddate, - salesorders.fromstkloc, - salesorderdetails.stkcode, - stockmaster.description, - stockmaster.units, - stockmaster.decimalplaces"; + GROUP BY salesorders.orderno, + salesorders.debtorno, + salesorders.branchcode, + salesorders.customerref, + salesorders.orddate, + salesorders.fromstkloc, + salesorderdetails.stkcode, + stockmaster.description, + stockmaster.units, + stockmaster.decimalplaces"; } $sql .= " ORDER BY salesorders.orderno"; Modified: trunk/PDFPeriodStockTransListing.php =================================================================== --- trunk/PDFPeriodStockTransListing.php 2011-07-19 09:35:25 UTC (rev 4635) +++ trunk/PDFPeriodStockTransListing.php 2011-07-24 00:14:27 UTC (rev 4636) @@ -1,7 +1,6 @@ <?php /* $Id: PDFPeriodStockTransListing.php 4307 2010-12-22 16:06:03Z tim_schofield $*/ - include('includes/SQL_CommonFunctions.inc'); include ('includes/session.inc'); @@ -17,8 +16,9 @@ $title = _('Stock Transaction Listing'); include ('includes/header.inc'); - echo '<div class="centre"><p class="page_title_text"><img src="'.$rootpath.'/css/'.$theme.'/images/transactions.png" title="' . $title . '" alt="">' . ' ' - . _('Stock Transaction Listing').'</img></p></div>'; + echo '<div class="centre"> + <p class="page_title_text"><img src="'.$rootpath.'/css/'.$theme.'/images/transactions.png" title="' . $title . '" alt="">' . ' '. _('Stock Transaction Listing').'</img></p> + </div>'; if ($InputError==1){ prnMsg($msg,'error'); @@ -26,8 +26,8 @@ echo '<form method="post" action="' . $_SERVER['PHP_SELF'] . '">'; echo '<input type="hidden" name="FormID" value="' . $_SESSION['FormID'] . '" />'; - echo '<table class=selection>'; - echo '<tr> + echo '<table class="selection">'; + echo '<tr> <td>' . _('Enter the date from which the transactions are to be listed') . ':</td> <td><input type="text" name="FromDate" maxlength="10" size="10" class="date" alt="' . $_SESSION['DefaultDateFormat'] . '" value="' . Date($_SESSION['DefaultDateFormat']) . '"></td> </tr>'; @@ -55,24 +55,28 @@ echo '<tr><td>' . _('For Stock Location') . ':</td> <td><select name="StockLocation">'; - echo '<option VALUE="All">' . _('All') . '</option>'; + echo '<option value="All">' . _('All') . '</option>'; while ($myrow=DB_fetch_array($resultStkLocs)){ if (isset($_POST['StockLocation']) AND $_POST['StockLocation']!='All'){ if ($myrow['loccode'] == $_POST['StockLocation']){ - echo '<option selected VALUE="' . $myrow['loccode'] . '">' . $myrow['locationname'] . '</option>'; + echo '<option selected value="' . $myrow['loccode'] . '">' . $myrow['locationname'] . '</option>'; } else { - echo '<option VALUE="' . $myrow['loccode'] . '">' . $myrow['locationname'] . '</option>'; + echo '<option value="' . $myrow['loccode'] . '">' . $myrow['locationname'] . '</option>'; } } elseif ($myrow['loccode']==$_SESSION['UserStockLocation']){ - echo '<option selected VALUE="' . $myrow['loccode'] . '">' . $myrow['locationname'] . '</option>'; + echo '<option selected value="' . $myrow['loccode'] . '">' . $myrow['locationname'] . '</option>'; $_POST['StockLocation']=$myrow['loccode']; } else { - echo '<option VALUE="' . $myrow['loccode'] . '">' . $myrow['locationname'] . '</option>'; + 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; @@ -84,43 +88,43 @@ if ($_POST['StockLocation']=='All') { $sql= "SELECT stockmoves.type, - stockmoves.stockid, - stockmaster.description, - stockmaster.decimalplaces, - stockmoves.transno, - stockmoves.trandate, - stockmoves.qty, - stockmoves.reference, - stockmoves.narrative, - locations.locationname - FROM stockmoves - LEFT JOIN stockmaster - ON stockmoves.stockid=stockmaster.stockid - LEFT JOIN locations - ON stockmoves.loccode=locations.loccode - WHERE type='" . $_POST['TransType'] . "' - AND date_format(trandate, '%Y-%m-%d')>='".FormatDateForSQL($_POST['FromDate'])."' - AND date_format(trandate, '%Y-%m-%d')<='".FormatDateForSQL($_POST['ToDate'])."'"; + stockmoves.stockid, + stockmaster.description, + stockmaster.decimalplaces, + stockmoves.transno, + stockmoves.trandate, + stockmoves.qty, + stockmoves.reference, + stockmoves.narrative, + locations.locationname + FROM stockmoves + LEFT JOIN stockmaster + ON stockmoves.stockid=stockmaster.stockid + LEFT JOIN locations + ON stockmoves.loccode=locations.loccode + WHERE type='" . $_POST['TransType'] . "' + AND date_format(trandate, '%Y-%m-%d')>='".FormatDateForSQL($_POST['FromDate'])."' + AND date_format(trandate, '%Y-%m-%d')<='".FormatDateForSQL($_POST['ToDate'])."'"; } else { $sql= "SELECT stockmoves.type, - stockmoves.stockid, - stockmaster.description, - stockmaster.decimalplaces, - stockmoves.transno, - stockmoves.trandate, - stockmoves.qty, - stockmoves.reference, - stockmoves.narrative, - locations.locationname - FROM stockmoves - LEFT JOIN stockmaster - ON stockmoves.stockid=stockmaster.stockid - LEFT JOIN locations - ON stockmoves.loccode=locations.loccode - WHERE type='" . $_POST['TransType'] . "' - AND date_format(trandate, '%Y-%m-%d')>='".FormatDateForSQL($_POST['FromDate'])."' - AND date_format(trandate, '%Y-%m-%d')<='".FormatDateForSQL($_POST['ToDate'])."' - AND stockmoves.loccode='" . $_POST['StockLocation'] . "'"; + stockmoves.stockid, + stockmaster.description, + stockmaster.decimalplaces, + stockmoves.transno, + stockmoves.trandate, + stockmoves.qty, + stockmoves.reference, + stockmoves.narrative, + locations.locationname + FROM stockmoves + LEFT JOIN stockmaster + ON stockmoves.stockid=stockmaster.stockid + LEFT JOIN locations + ON stockmoves.loccode=locations.loccode + WHERE type='" . $_POST['TransType'] . "' + AND date_format(trandate, '%Y-%m-%d')>='".FormatDateForSQL($_POST['FromDate'])."' + AND date_format(trandate, '%Y-%m-%d')<='".FormatDateForSQL($_POST['ToDate'])."' + AND stockmoves.loccode='" . $_POST['StockLocation'] . "'"; } $result=DB_query($sql,$db,'','',false,false); Modified: trunk/PageSecurity.php =================================================================== --- trunk/PageSecurity.php 2011-07-19 09:35:25 UTC (rev 4635) +++ trunk/PageSecurity.php 2011-07-24 00:14:27 UTC (rev 4636) @@ -53,7 +53,11 @@ echo '</table><br />'; -echo '<div class="centre"><input type="submit" name="Update" value="'._('Update Security Levels').'" /></div><br /></form>'; +echo '<div class="centre"> + <input type="submit" name="Update" value="'._('Update Security Levels').'" /> + </div> + <br /> + </form>'; include('includes/footer.inc'); ?> \ No newline at end of file Modified: trunk/PaymentAllocations.php =================================================================== --- trunk/PaymentAllocations.php 2011-07-19 09:35:25 UTC (rev 4635) +++ trunk/PaymentAllocations.php 2011-07-24 00:14:27 UTC (rev 4636) @@ -1,14 +1,11 @@ <?php /* $Id$*/ -/* $Revision: 1.6 $ */ + /* This page is called from SupplierInquiry.php when the 'view payments' button is selected */ - -//$PageSecurity = 5; - include('includes/session.inc'); $title = _('Payment Allocations'); @@ -16,17 +13,17 @@ include('includes/header.inc'); include('includes/SQL_CommonFunctions.inc'); - if (!isset($_GET['SuppID'])){ - prnMsg( _('Supplier ID Number is not Set, can not display result'),'warn'); - include('includes/footer.inc'); - exit; - } +if (!isset($_GET['SuppID'])){ + prnMsg( _('Supplier ID Number is not Set, can not display result'),'warn'); + include('includes/footer.inc'); + exit; +} - if (!isset($_GET['InvID'])){ - prnMsg( _('Invoice Number is not Set, can not display result'),'warn'); - include('includes/footer.inc'); - exit; - } +if (!isset($_GET['InvID'])){ + prnMsg( _('Invoice Number is not Set, can not display result'),'warn'); + include('includes/footer.inc'); + exit; +} $SuppID = $_GET['SuppID']; $InvID = $_GET['InvID']; @@ -34,48 +31,37 @@ echo '<div class="page_help_text">' . _('This shows how the payment to the supplier was allocated') . '<a href="SupplierInquiry.php?&SupplierID=' . $SuppID . '"><br /> ' . _('Back to supplier inquiry') . '</a></div><br />'; -//echo "<br /><font size=4 color=BLUE>Payment Allocation for Supplier: '$SuppID' and Invoice: '$InvID'</font>"; - -// $_SESSION['SuppID'] = new SupplierID; -// $_SESSION['InvID'] = new InvoiceID; - $SQL= "SELECT supptrans.supplierno, - supptrans.suppreference, - supptrans.trandate, - supptrans.alloc - FROM supptrans - WHERE supptrans.id IN (SELECT suppallocs.transid_allocfrom - FROM supptrans, suppallocs - WHERE supptrans.supplierno = '$SuppID' - AND supptrans.suppreference = '$InvID' - AND supptrans.id = suppallocs.transid_allocto)"; + supptrans.suppreference, + supptrans.trandate, + supptrans.alloc, + currencies.decimalplaces + FROM supptrans INNER JOIN suppliers + ON supptrans.supplierno=suppliers.supplierid + INNER JOIN currencies + ON suppliers.currcode=currencies.currabrev + WHERE supptrans.id IN (SELECT suppallocs.transid_allocfrom + FROM supptrans, suppallocs + WHERE supptrans.supplierno = '" . $SuppID . "' + AND supptrans.suppreference = '" . $InvID . "' + AND supptrans.id = suppallocs.transid_allocto)"; -/* -Might be a way of doing this query without a subquery -$SQL= "SELECT supptrans.supplierno, - supptrans.suppreference, - supptrans.trandate, - supptrans.alloc - FROM supptrans INNER JOIN suppallocs ON supptrans.id=suppallocs.transid_allocfrom - WHERE supptrans.supplierno = '$SuppID' - AND supptrans.suppreference = '$InvID' -*/ - $Result = DB_query($SQL, $db); if (DB_num_rows($Result) == 0){ prnMsg(_('There may be a problem retrieving the information. No data is returned'),'warn'); - echo '<br /><a HREF ="javascript:history.back()">' . _('Go back') . '</a>'; + echo '<br /><a href ="javascript:history.back()">' . _('Go back') . '</a>'; include('includes/foooter.inc'); exit; } -echo '<table cellpadding=2 colspan=7 width=80% class=selection>'; -$TableHeader = "<tr> -<th>" . _('Supplier Number') . '<br />' . _('Reference') . "</th> -<th>" . _('Payment') .'<br />' . _('Reference') . "</th> -<th>" . _('Payment') . '<br />' . _('Date') . "</th> -<th>" . _('Total Payment') . '<br />' . _('Amount') . '</th></tr>'; +echo '<table cellpadding="2" colspan="7 width="80%" class="selection">'; +$TableHeader = '<tr> + <th>' . _('Supplier Number') . '<br />' . _('Reference') . '</th> + <th>' . _('Payment') .'<br />' . _('Reference') . '</th> + <th>' . _('Payment') . '<br />' . _('Date') . '</th> + <th>' . _('Total Payment') . '<br />' . _('Amount') . '</th> + </tr>'; echo $TableHeader; @@ -93,7 +79,7 @@ echo '<td>'.$myrow['supplierno'].'</td> <td>'.$myrow['suppreference'].'</td> <td>'.ConvertSQLDate($myrow['trandate']).'</td> - <td class=number>'.number_format($myrow['alloc'],2).'</td> + <td class="number">'.number_format($myrow['alloc'],$myrow['decimalplaces']).'</td> </tr>'; $j++; @@ -106,4 +92,4 @@ echo '</table>'; include('includes/footer.inc'); -?> +?> \ No newline at end of file Modified: trunk/PaymentMethods.php =================================================================== --- trunk/PaymentMethods.php 2011-07-19 09:35:25 UTC (rev 4635) +++ trunk/PaymentMethods.php 2011-07-24 00:14:27 UTC (rev 4636) @@ -62,17 +62,17 @@ // Get the old name and check that the record still exists need to be very careful here $sql = "SELECT paymentname FROM paymentmethods - WHERE paymentid = '" . $SelectedPaymentID . "'"; + WHERE paymentid = '" . $SelectedPaymentID . "'"; $result = DB_query($sql,$db); if ( DB_num_rows($result) != 0 ) { $myrow = DB_fetch_row($result); $OldName = $myrow[0]; $sql = "UPDATE paymentmethods - SET paymentname='" . $_POST['MethodName'] . "', - paymenttype = '" . $_POST['ForPayment'] . "', - receipttype = '" . $_POST['ForReceipt'] . "', - usepreprintedstationery = '" . $_POST['UsePrePrintedStationery']. "' - WHERE paymentname " . LIKE . " '".$OldName."'"; + SET paymentname='" . $_POST['MethodName'] . "', + paymenttype = '" . $_POST['ForPayment'] . "', + receipttype = '" . $_POST['ForReceipt'] . "', + usepreprintedstationery = '" . $_POST['UsePrePrintedStationery']. "' + WHERE paymentname " . LIKE . " '".$OldName."'"; } else { $InputError = 1; @@ -91,17 +91,14 @@ $InputError = 1; prnMsg( _('The payment method can not be created because another with the same name already exists.'),'error'); } else { - $sql = "INSERT INTO paymentmethods ( - paymentname, - paymenttype, - receipttype, - usepreprintedstationery) - VALUES ( - '" . $_POST['MethodName'] ."', - '" . $_POST['ForPayment'] ."', - '" . $_POST['ForReceipt'] ."', - '" . $_POST['UsePrePrintedStationery'] ."' - )"; + $sql = "INSERT INTO paymentmethods ( paymentname, + paymenttype, + receipttype, + usepreprintedstationery) + VALUES ('" . $_POST['MethodName'] ."', + '" . $_POS... [truncated message content] |
From: <dai...@us...> - 2011-07-19 09:35:34
|
Revision: 4635 http://web-erp.svn.sourceforge.net/web-erp/?rev=4635&view=rev Author: daintree Date: 2011-07-19 09:35:25 +0000 (Tue, 19 Jul 2011) Log Message: ----------- consistency Modified Paths: -------------- trunk/CounterSales.php trunk/CustomerInquiry.php trunk/FixedAssetItems.php trunk/FixedAssetRegister.php trunk/FixedAssetTransfer.php trunk/InventoryPlanning.php trunk/InventoryPlanningPrefSupplier.php trunk/InventoryQuantities.php trunk/InventoryValuation.php trunk/Labels.php trunk/Locations.php trunk/MRP.php trunk/MRPCalendar.php trunk/MRPCreateDemands.php trunk/MRPDemandTypes.php trunk/MRPDemands.php trunk/MRPPlannedWorkOrders.php trunk/MRPShortages.php trunk/MailInventoryValuation.php trunk/MailSalesReport.php trunk/MailSalesReport_csv.php trunk/SelectCustomer.php trunk/css/fresh/default.css trunk/index.php trunk/javascripts/MiscFunctions.js Modified: trunk/CounterSales.php =================================================================== --- trunk/CounterSales.php 2011-07-17 03:31:55 UTC (rev 4634) +++ trunk/CounterSales.php 2011-07-19 09:35:25 UTC (rev 4635) @@ -84,30 +84,37 @@ include('includes/footer.inc'); exit; } - - $_SESSION['Items'.$identifier]->Branch = $myrow['cashsalebranch']; - $_SESSION['Items'.$identifier]->DebtorNo = $myrow['cashsalecustomer']; + if (isset($_GET['DebtorNo'])) { + $_SESSION['Items'.$identifier]->DebtorNo = $_GET['DebtorNo']; + $_SESSION['Items'.$identifier]->Branch = $_GET['BranchNo']; + } else { + $_SESSION['Items'.$identifier]->Branch = $myrow['cashsalebranch']; + $_SESSION['Items'.$identifier]->DebtorNo = $myrow['cashsalecustomer']; + } + $_SESSION['Items'.$identifier]->LocationName = $myrow['locationname']; $_SESSION['Items'.$identifier]->Location = $_SESSION['UserStockLocation']; $_SESSION['Items'.$identifier]->DispatchTaxProvince = $myrow['taxprovinceid']; // Now check to ensure this account exists and set defaults */ $sql = "SELECT debtorsmaster.name, - holdreasons.dissallowinvoices, - debtorsmaster.salestype, - salestypes.sales_type, - debtorsmaster.currcode, - debtorsmaster.customerpoline, - paymentterms.terms - FROM debtorsmaster, - holdreasons, - salestypes, - paymentterms - WHERE debtorsmaster.salestype=salestypes.typeabbrev - AND debtorsmaster.holdreason=holdreasons.reasoncode - AND debtorsmaster.paymentterms=paymentterms.termsindicator - AND debtorsmaster.debtorno = '" . $_SESSION['Items'.$identifier]->DebtorNo . "'"; - + holdreasons.dissallowinvoices, + debtorsmaster.salestype, + salestypes.sales_type, + debtorsmaster.currcode, + debtorsmaster.customerpoline, + paymentterms.terms, + currencies.decimalplaces + FROM debtorsmaster INNER JOIN holdreasons + ON debtorsmaster.holdreason=holdreasons.reasoncode + INNER JOIN salestypes + ON debtorsmaster.salestype=salestypes.typeabbrev + INNER JOIN paymentterms + ON debtorsmaster.paymentterms=paymentterms.termsindicator + INNER JOIN currencies + ON debtorsmaster.currcode=currencies.currabrev + WHERE debtorsmaster.debtorno = '" . $_SESSION['Items'.$identifier]->DebtorNo . "'"; + $ErrMsg = _('The details of the customer selected') . ': ' . $_SESSION['Items'.$identifier]->DebtorNo . ' ' . _('cannot be retrieved because'); $DbgMsg = _('The SQL used to retrieve the customer details and failed was') . ':'; // echo $sql; @@ -127,7 +134,7 @@ $_SESSION['Items'.$identifier]->DefaultCurrency = $myrow['currcode']; $_SESSION['Items'.$identifier]->DefaultPOLine = $myrow['customerpoline']; $_SESSION['Items'.$identifier]->PaymentTerms = $myrow['terms']; - + $_SESSION['Items'.$identifier]->CurrDecimalPlaces = $myrow['decimalplaces']; /* now get the branch defaults from the customer branches table CustBranch. */ $sql = "SELECT custbranch.brname, @@ -208,7 +215,7 @@ } else { /*Not cancelling the order */ echo '<p class="page_title_text"><img src="'.$rootpath.'/css/'.$theme.'/images/inventory.png" title="' . _('Counter Sales') . '" alt="" />' . ' '; - echo _('Counter Sale') . ' - ' . $_SESSION['Items'.$identifier]->LocationName . ' (' . _('all amounts in') . ' ' . $_SESSION['Items'.$identifier]->DefaultCurrency . ')'; + echo $_SESSION['Items'.$identifier]->CustomerName . ' ' . _('Counter Sale') . ' ' ._('from') . ' ' . $_SESSION['Items'.$identifier]->LocationName . ' ' . _('inventory') . ' (' . _('all amounts in') . ' ' . $_SESSION['Items'.$identifier]->DefaultCurrency . ')'; echo '</p>'; } @@ -228,30 +235,30 @@ if ($_POST['StockCat']=='All'){ $SQL = "SELECT stockmaster.stockid, - stockmaster.description, - stockmaster.units - FROM stockmaster, - stockcategory - WHERE stockmaster.categoryid=stockcategory.categoryid - AND (stockcategory.stocktype='F' OR stockcategory.stocktype='D') - AND stockmaster.mbflag <>'G' - AND stockmaster.controlled <> 1 - AND stockmaster.description " . LIKE . " '" . $SearchString . "' - AND stockmaster.discontinued=0 - ORDER BY stockmaster.stockid"; + stockmaster.description, + stockmaster.units + FROM stockmaster, + stockcategory + WHERE stockmaster.categoryid=stockcategory.categoryid + AND (stockcategory.stocktype='F' OR stockcategory.stocktype='D') + AND stockmaster.mbflag <>'G' + AND stockmaster.controlled <> 1 + AND stockmaster.description " . LIKE . " '" . $SearchString . "' + AND stockmaster.discontinued=0 + ORDER BY stockmaster.stockid"; } else { $SQL = "SELECT stockmaster.stockid, - stockmaster.description, - stockmaster.units - FROM stockmaster, stockcategory - WHERE stockmaster.categoryid=stockcategory.categoryid - AND (stockcategory.stocktype='F' OR stockcategory.stocktype='D') - AND stockmaster.mbflag <>'G' - AND stockmaster.controlled <> 1 - AND stockmaster.discontinued=0 - AND stockmaster.description " . LIKE . " '" . $SearchString . "' - AND stockmaster.categoryid='" . $_POST['StockCat'] . "' - ORDER BY stockmaster.stockid"; + stockmaster.description, + stockmaster.units + FROM stockmaster, stockcategory + WHERE stockmaster.categoryid=stockcategory.categoryid + AND (stockcategory.stocktype='F' OR stockcategory.stocktype='D') + AND stockmaster.mbflag <>'G' + AND stockmaster.controlled <> 1 + AND stockmaster.discontinued=0 + AND stockmaster.description " . LIKE . " '" . $SearchString . "' + AND stockmaster.categoryid='" . $_POST['StockCat'] . "' + ORDER BY stockmaster.stockid"; } } else if (mb_strlen($_POST['StockCode'])>0){ @@ -261,55 +268,55 @@ if ($_POST['StockCat']=='All'){ $SQL = "SELECT stockmaster.stockid, - stockmaster.description, - stockmaster.units - FROM stockmaster, stockcategory - WHERE stockmaster.categoryid=stockcategory.categoryid - AND (stockcategory.stocktype='F' OR stockcategory.stocktype='D') - AND stockmaster.stockid " . LIKE . " '" . $SearchString . "' - AND stockmaster.mbflag <>'G' - AND stockmaster.controlled <> 1 - AND stockmaster.discontinued=0 - ORDER BY stockmaster.stockid"; + stockmaster.description, + stockmaster.units + FROM stockmaster, stockcategory + WHERE stockmaster.categoryid=stockcategory.categoryid + AND (stockcategory.stocktype='F' OR stockcategory.stocktype='D') + AND stockmaster.stockid " . LIKE . " '" . $SearchString . "' + AND stockmaster.mbflag <>'G' + AND stockmaster.controlled <> 1 + AND stockmaster.discontinued=0 + ORDER BY stockmaster.stockid"; } else { $SQL = "SELECT stockmaster.stockid, - stockmaster.description, - stockmaster.units - FROM stockmaster, stockcategory - WHERE stockmaster.categoryid=stockcategory.categoryid - AND (stockcategory.stocktype='F' OR stockcategory.stocktype='D') - AND stockmaster.stockid " . LIKE . " '" . $SearchString . "' - AND stockmaster.mbflag <>'G' - AND stockmaster.controlled <> 1 - AND stockmaster.discontinued=0 - AND stockmaster.categoryid='" . $_POST['StockCat'] . "' - ORDER BY stockmaster.stockid"; + stockmaster.description, + stockmaster.units + FROM stockmaster, stockcategory + WHERE stockmaster.categoryid=stockcategory.categoryid + AND (stockcategory.stocktype='F' OR stockcategory.stocktype='D') + AND stockmaster.stockid " . LIKE . " '" . $SearchString . "' + AND stockmaster.mbflag <>'G' + AND stockmaster.controlled <> 1 + AND stockmaster.discontinued=0 + AND stockmaster.categoryid='" . $_POST['StockCat'] . "' + ORDER BY stockmaster.stockid"; } } else { if ($_POST['StockCat']=='All'){ $SQL = "SELECT stockmaster.stockid, - stockmaster.description, - stockmaster.units - FROM stockmaster, stockcategory - WHERE stockmaster.categoryid=stockcategory.categoryid - AND (stockcategory.stocktype='F' OR stockcategory.stocktype='D') - AND stockmaster.mbflag <>'G' - AND stockmaster.controlled <> 1 - AND stockmaster.discontinued=0 - ORDER BY stockmaster.stockid"; + stockmaster.description, + stockmaster.units + FROM stockmaster, stockcategory + WHERE stockmaster.categoryid=stockcategory.categoryid + AND (stockcategory.stocktype='F' OR stockcategory.stocktype='D') + AND stockmaster.mbflag <>'G' + AND stockmaster.controlled <> 1 + AND stockmaster.discontinued=0 + ORDER BY stockmaster.stockid"; } else { $SQL = "SELECT stockmaster.stockid, - stockmaster.description, - stockmaster.units - FROM stockmaster, stockcategory - WHERE stockmaster.categoryid=stockcategory.categoryid - AND (stockcategory.stocktype='F' OR stockcategory.stocktype='D') - AND stockmaster.mbflag <>'G' - AND stockmaster.controlled <> 1 - AND stockmaster.discontinued=0 - AND stockmaster.categoryid='" . $_POST['StockCat'] . "' - ORDER BY stockmaster.stockid"; + stockmaster.description, + stockmaster.units + FROM stockmaster, stockcategory + WHERE stockmaster.categoryid=stockcategory.categoryid + AND (stockcategory.stocktype='F' OR stockcategory.stocktype='D') + AND stockmaster.mbflag <>'G' + AND stockmaster.controlled <> 1 + AND stockmaster.discontinued=0 + AND stockmaster.categoryid='" . $_POST['StockCat'] . "' + ORDER BY stockmaster.stockid"; } } @@ -345,7 +352,7 @@ /* Always do the stuff below */ -echo '<form action="' . $_SERVER['PHP_SELF'] . '?' . SID .'identifier='.$identifier . '" name="SelectParts" method="post">'; +echo '<form action="' . $_SERVER['PHP_SELF'] . '?identifier='.$identifier . '" name="SelectParts" method="post">'; echo '<input type="hidden" name="FormID" value="' . $_SESSION['FormID'] . '" />'; //Get The exchange rate used for GPPercent calculations on adding or amending items @@ -373,7 +380,10 @@ $Discount = 0; $i=1; - while ($i<=$_SESSION['QuickEntries'] and isset($_POST['part_' . $i]) and $_POST['part_' . $i]!='') { + while ($i<=$_SESSION['QuickEntries'] + AND isset($_POST['part_' . $i]) + AND $_POST['part_' . $i]!='') { + $QuickEntryCode = 'part_' . $i; $QuickEntryQty = 'qty_' . $i; $QuickEntryPOLine = 'poline_' . $i; @@ -409,9 +419,10 @@ $NewItemDue = DateAdd (Date($_SESSION['DefaultDateFormat']),'d', $_SESSION['Items'.$identifier]->DeliveryDays); } /*Now figure out if the item is a kit set - the field MBFlag='K'*/ - $sql = "SELECT stockmaster.mbflag, stockmaster.controlled - FROM stockmaster - WHERE stockmaster.stockid='". $NewItem ."'"; + $sql = "SELECT stockmaster.mbflag, + stockmaster.controlled + FROM stockmaster + WHERE stockmaster.stockid='". $NewItem ."'"; $ErrMsg = _('Could not determine if the part being ordered was a kitset or not because'); $DbgMsg = _('The sql that was used to determine if the part being ordered was a kitset or not was '); @@ -423,11 +434,11 @@ } elseif ($myrow=DB_fetch_array($KitResult)){ if ($myrow['mbflag']=='K'){ /*It is a kit set item */ $sql = "SELECT bom.component, - bom.quantity - FROM bom - WHERE bom.parent='" . $NewItem . "' - AND bom.effectiveto > '" . Date('Y-m-d') . "' - AND bom.effectiveafter < '" . Date('Y-m-d') . "'"; + bom.quantity + FROM bom + WHERE bom.parent='" . $NewItem . "' + AND bom.effectiveto > '" . Date('Y-m-d') . "' + AND bom.effectiveafter < '" . Date('Y-m-d') . "'"; $ErrMsg = _('Could not retrieve kitset components from the database because') . ' '; $KitResult = DB_query($sql,$db,$ErrMsg,$DbgMsg); @@ -515,9 +526,9 @@ foreach ($_SESSION['Items'.$identifier]->LineItems as $OrderLine) { $NewItem=$OrderLine->StockID; $sql = "SELECT stockmaster.mbflag, - stockmaster.controlled - FROM stockmaster - WHERE stockmaster.stockid='". $OrderLine->StockID."'"; + stockmaster.controlled + FROM stockmaster + WHERE stockmaster.stockid='". $OrderLine->StockID."'"; $ErrMsg = _('Could not determine if the part being ordered was a kitset or not because'); $DbgMsg = _('The sql that was used to determine if the part being ordered was a kitset or not was '); @@ -525,12 +536,12 @@ if ($myrow=DB_fetch_array($KitResult)){ if ($myrow['mbflag']=='K'){ /*It is a kit set item */ $sql = "SELECT bom.component, - bom.quantity - FROM bom - WHERE bom.parent='" . $OrderLine->StockID. "' - AND bom.effectiveto > '" . Date('Y-m-d') . "' - AND bom.effectiveafter < '" . Date('Y-m-d') . "'"; - + bom.quantity + FROM bom + WHERE bom.parent='" . $OrderLine->StockID. "' + AND bom.effectiveto > '" . Date('Y-m-d') . "' + AND bom.effectiveafter < '" . Date('Y-m-d') . "'"; + $ErrMsg = _('Could not retrieve kitset components from the database because'); $KitResult = DB_query($sql,$db,$ErrMsg); @@ -559,9 +570,9 @@ * controlled items and ghost/phantom items cannot be selected because the SQL to show items to select doesn't show 'em * */ $sql = "SELECT stockmaster.mbflag, - stockmaster.taxcatid - FROM stockmaster - WHERE stockmaster.stockid='". $NewItem ."'"; + stockmaster.taxcatid + FROM stockmaster + WHERE stockmaster.stockid='". $NewItem ."'"; $ErrMsg = _('Could not determine if the part being ordered was a kitset or not because'); @@ -573,12 +584,12 @@ if ($myrow=DB_fetch_array($KitResult)){ if ($myrow['mbflag']=='K'){ /*It is a kit set item */ $sql = "SELECT bom.component, - bom.quantity - FROM bom - WHERE bom.parent='" . $NewItem . "' - AND bom.effectiveto > '" . Date('Y-m-d') . "' - AND bom.effectiveafter < '" . Date('Y-m-d') . "'"; - + bom.quantity + FROM bom + WHERE bom.parent='" . $NewItem . "' + AND bom.effectiveto > '" . Date('Y-m-d') . "' + AND bom.effectiveafter < '" . Date('Y-m-d') . "'"; + $ErrMsg = _('Could not retrieve kitset components from the database because'); $KitResult = DB_query($sql,$db,$ErrMsg); @@ -610,8 +621,8 @@ foreach($NewItemArray as $NewItem => $NewItemQty) { if($NewItemQty > 0) { $sql = "SELECT stockmaster.mbflag - FROM stockmaster - WHERE stockmaster.stockid='". $NewItem ."'"; + FROM stockmaster + WHERE stockmaster.stockid='". $NewItem ."'"; $ErrMsg = _('Could not determine if the part being ordered was a kitset or not because'); @@ -625,9 +636,9 @@ $sql = "SELECT bom.component, bom.quantity FROM bom - WHERE bom.parent='" . $NewItem . "' - AND bom.effectiveto > '" . Date('Y-m-d') . "' - AND bom.effectiveafter < '" . Date('Y-m-d') . "'"; + WHERE bom.parent='" . $NewItem . "' + AND bom.effectiveto > '" . Date('Y-m-d') . "' + AND bom.effectiveafter < '" . Date('Y-m-d') . "'"; $ErrMsg = _('Could not retrieve kitset components from the database because'); $KitResult = DB_query($sql,$db,$ErrMsg); @@ -659,7 +670,7 @@ $counter =0; foreach ($_SESSION['Items'.$identifier]->LineItems as $OrderLine) { - if ($OrderLine->DiscCat !="" AND ! in_array($OrderLine->DiscCat,$DiscCatsDone)){ + if ($OrderLine->DiscCat !='' AND ! in_array($OrderLine->DiscCat,$DiscCatsDone)){ $DiscCatsDone[$counter]=$OrderLine->DiscCat; $QuantityOfDiscCat =0; @@ -670,10 +681,10 @@ } } $result = DB_query("SELECT MAX(discountrate) AS discount - FROM discountmatrix - WHERE salestype='" . $_SESSION['Items'.$identifier]->DefaultSalesType . "' - AND discountcategory ='" . $OrderLine->DiscCat . "' - AND quantitybreak <'" . $QuantityOfDiscCat . "'",$db); + FROM discountmatrix + WHERE salestype='" . $_SESSION['Items'.$identifier]->DefaultSalesType . "' + AND discountcategory ='" . $OrderLine->DiscCat . "' + AND quantitybreak <'" . $QuantityOfDiscCat . "'",$db); $myrow = DB_fetch_row($result); if ($myrow[0]!=0){ /* need to update the lines affected */ foreach ($_SESSION['Items'.$identifier]->LineItems as $StkItems_2) { @@ -686,7 +697,8 @@ } } /* end of discount matrix lookup code */ -if (count($_SESSION['Items'.$identifier]->LineItems)>0 and !isset($_POST['ProcessSale'])){ /*only show order lines if there are any */ +if (count($_SESSION['Items'.$identifier]->LineItems)>0 + AND !isset($_POST['ProcessSale'])){ /*only show order lines if there are any */ /* // ************************************************************************* // T H I S W H E R E T H E S A L E I S D I S P L A Y E D @@ -738,7 +750,7 @@ echo '<input type="hidden" name="POLine_' . $OrderLine->LineNumber . '" value="" />'; echo '<input type="hidden" name="ItemDue_' . $OrderLine->LineNumber . '" value="'.$OrderLine->ItemDue.'" />'; - echo '<td><a target="_blank" href="' . $rootpath . '/StockStatus.php?' . SID .'identifier='.$identifier . '&StockID=' . $OrderLine->StockID . '&DebtorNo=' . $_SESSION['Items'.$identifier]->DebtorNo . '">' . $OrderLine->StockID . '</a></td> + echo '<td><a target="_blank" href="' . $rootpath . '/StockStatus.php?identifier='.$identifier . '&StockID=' . $OrderLine->StockID . '&DebtorNo=' . $_SESSION['Items'.$identifier]->DebtorNo . '">' . $OrderLine->StockID . '</a></td> <td>' . $OrderLine->ItemDescription . '</td>'; echo '<td><input class="number" tabindex="2" type="text" name="Quantity_' . $OrderLine->LineNumber . '" size="6" maxlength="6" value="' . $OrderLine->Quantity . '" />'; @@ -750,7 +762,7 @@ echo '<td><input class="number" type="text" name="Price_' . $OrderLine->LineNumber . '" size="16" maxlength="16" value="' . $OrderLine->Price . '" /></td> <td><input class="number" type="text" name="Discount_' . $OrderLine->LineNumber . '" size="5" maxlength="4" value="' . ($OrderLine->DiscountPercent * 100) . '" /></td> <td><input class="number" type="text" name="GPPercent_' . $OrderLine->LineNumber . '" size="3" maxlength="40" value="' . $OrderLine->GPPercent . '" /></td>'; - echo '<td class="number">' . number_format($SubTotal,2) . '</td>'; + echo '<td class="number">' . number_format($SubTotal,$_SESSION['Items'.$identifier]->CurrDecimalPlaces) . '</td>'; $LineDueDate = $OrderLine->ItemDue; if (!Is_Date($OrderLine->ItemDue)){ $LineDueDate = DateAdd (Date($_SESSION['DefaultDateFormat']),'d', $_SESSION['Items'.$identifier]->DeliveryDays); @@ -776,9 +788,9 @@ $TaxTotal += $TaxLineTotal; $_SESSION['Items'.$identifier]->TaxTotals=$TaxTotals; $_SESSION['Items'.$identifier]->TaxGLCodes=$TaxGLCodes; - echo '<td class="number">' . number_format($TaxLineTotal ,2) . '</td>'; - echo '<td class="number">' . number_format($SubTotal + $TaxLineTotal ,2) . '</td>'; - echo '<td><a href="' . $_SERVER['PHP_SELF'] . '?' . SID .'&identifier='.$identifier . '&Delete=' . $OrderLine->LineNumber . '" onclick="return confirm(\'' . _('Are You Sure?') . '\');">' . _('Delete') . '</a></td></tr>'; + echo '<td class="number">' . number_format($TaxLineTotal ,$_SESSION['Items'.$identifier]->CurrDecimalPlaces) . '</td>'; + echo '<td class="number">' . number_format($SubTotal + $TaxLineTotal ,$_SESSION['Items'.$identifier]->CurrDecimalPlaces) . '</td>'; + echo '<td><a href="' . $_SERVER['PHP_SELF'] . '?identifier='.$identifier . '&Delete=' . $OrderLine->LineNumber . '" onclick="return confirm(\'' . _('Are You Sure?') . '\');">' . _('Delete') . '</a></td></tr>'; if ($_SESSION['AllowOrderLineItemNarrative'] == 1){ echo $RowStarter; @@ -794,9 +806,9 @@ } /* end of loop around items */ echo '<tr class="EvenTableRows"><td colspan="8" class="number"><b>' . _('Total') . '</b></td> - <td class="number">' . number_format(($_SESSION['Items'.$identifier]->total),2) . '</td> - <td class="number">' . number_format($TaxTotal,2) . '</td> - <td class="number">' . number_format(($_SESSION['Items'.$identifier]->total+$TaxTotal),2) . '</td> + <td class="number">' . number_format(($_SESSION['Items'.$identifier]->total),$_SESSION['Items'.$identifier]->CurrDecimalPlaces) . '</td> + <td class="number">' . number_format($TaxTotal,$_SESSION['Items'.$identifier]->CurrDecimalPlaces) . '</td> + <td class="number">' . number_format(($_SESSION['Items'.$identifier]->total+$TaxTotal),$_SESSION['Items'.$identifier]->CurrDecimalPlaces) . '</td> </tr> </table>'; echo '<input type="hidden" name="TaxTotal" value="'.$TaxTotal.'" />'; @@ -1938,9 +1950,9 @@ echo '<br /><div class="centre">'; if ($_SESSION['InvoicePortraitFormat']==0){ - echo '<img src="'.$rootpath.'/css/'.$theme.'/images/printer.png" title="' . _('Print') . '" alt="" />' . ' ' . '<a target="_blank" href="'.$rootpath.'/PrintCustTrans.php?' . SID . 'FromTransNo='.$InvoiceNo.'&InvOrCredit=Invoice&PrintPDF=True">'. _('Print this invoice'). ' (' . _('Landscape') . ')</a><br /><br />'; + echo '<img src="'.$rootpath.'/css/'.$theme.'/images/printer.png" title="' . _('Print') . '" alt="" />' . ' ' . '<a target="_blank" href="'.$rootpath.'/PrintCustTrans.php?FromTransNo='.$InvoiceNo.'&InvOrCredit=Invoice&PrintPDF=True">'. _('Print this invoice'). ' (' . _('Landscape') . ')</a><br /><br />'; } else { - echo '<img src="'.$rootpath.'/css/'.$theme.'/images/printer.png" title="' . _('Print') . '" alt="" />' . ' ' . '<a target="_blank" href="'.$rootpath.'/PrintCustTransPortrait.php?' . SID . 'FromTransNo='.$InvoiceNo.'&InvOrCredit=Invoice&PrintPDF=True">'. _('Print this invoice'). ' (' . _('Portrait') . ')</a><br /><br />'; + echo '<img src="'.$rootpath.'/css/'.$theme.'/images/printer.png" title="' . _('Print') . '" alt="" />' . ' ' . '<a target="_blank" href="'.$rootpath.'/PrintCustTransPortrait.php?FromTransNo='.$InvoiceNo.'&InvOrCredit=Invoice&PrintPDF=True">'. _('Print this invoice'). ' (' . _('Portrait') . ')</a><br /><br />'; } echo '<br /><br /><a href="' .$_SERVER['PHP_SELF'] . '">' . _('Start a new Counter Sale') . '</a></div>'; @@ -2077,7 +2089,7 @@ <td style="text-align:center">%s</td> <td style="text-align:center">%s</td> <td style="text-align:center">%s</td> - <td><font size=1><input class="number" tabindex="'.number_format($j+7).'" type="textbox" size="6" name="itm'.$myrow['stockid'].'" value="0" /> + <td><font size=1><input class="number" tabindex="'.number_format($j+7).'" type="textbox" size="6" name="itm%s" value="0" /> </td> </tr>', $myrow['stockid'], @@ -2087,9 +2099,6 @@ $DemandQty, $OnOrder, $Available, - $ImageSource, - $rootpath, - SID, $myrow['stockid']); if ($j==1) { $jsCall = '<script type="text/javascript">if (document.SelectParts) {defaultControl(document.SelectParts.itm'.$myrow['stockid'].');}</script>'; @@ -2110,20 +2119,20 @@ echo '<table class="selection"><tr><td><b>' . _('Select a Stock Category') . ': </b><select tabindex="1" name="StockCat">'; if (!isset($_POST['StockCat'])){ - echo "<option selected='True' value='All'>" . _('All').'</option>'; + echo '<option selected="true" value="All">' . _('All').'</option>'; $_POST['StockCat'] ='All'; } else { - echo "<option value='All'>" . _('All').'</option>'; + echo '<option value="All">' . _('All').'</option>'; } $SQL="SELECT categoryid, - categorydescription - FROM stockcategory - WHERE stocktype='F' OR stocktype='D' - ORDER BY categorydescription"; + categorydescription + FROM stockcategory + WHERE stocktype='F' OR stocktype='D' + ORDER BY categorydescription"; $result1 = DB_query($SQL,$db); while ($myrow1 = DB_fetch_array($result1)) { if ($_POST['StockCat']==$myrow1['categoryid']){ - echo '<option selected="True" value="' . $myrow1['categoryid'] . '">' . $myrow1['categorydescription'].'</option>'; + echo '<option selected="true" value="' . $myrow1['categoryid'] . '">' . $myrow1['categorydescription'].'</option>'; } else { echo '<option value="'. $myrow1['categoryid'] . '">' . $myrow1['categorydescription'].'</option>'; } @@ -2180,22 +2189,22 @@ // Find the quantity in stock at location $QOHSql = "SELECT sum(quantity) AS QOH, - stockmaster.decimalplaces - FROM locstock INNER JOIN stockmaster - WHERE locstock.stockid='" .$myrow['stockid'] . "' - AND loccode = '" . $_SESSION['Items'.$identifier]->Location . "'"; + stockmaster.decimalplaces + FROM locstock INNER JOIN stockmaster + WHERE locstock.stockid='" .$myrow['stockid'] . "' + AND loccode = '" . $_SESSION['Items'.$identifier]->Location . "'"; $QOHResult = DB_query($QOHSql,$db); $QOHRow = DB_fetch_array($QOHResult); $QOH = $QOHRow['QOH']; // Find the quantity on outstanding sales orders $sql = "SELECT SUM(salesorderdetails.quantity-salesorderdetails.qtyinvoiced) AS dem - FROM salesorderdetails INNER JOIN salesorders - ON salesorders.orderno = salesorderdetails.orderno - WHERE salesorders.fromstkloc='" . $_SESSION['Items'.$identifier]->Location . "' - AND salesorderdetails.completed=0 - AND salesorders.quotation=0 - AND salesorderdetails.stkcode='" . $myrow['stockid'] . "'"; + FROM salesorderdetails INNER JOIN salesorders + ON salesorders.orderno = salesorderdetails.orderno + WHERE salesorders.fromstkloc='" . $_SESSION['Items'.$identifier]->Location . "' + AND salesorderdetails.completed=0 + AND salesorders.quotation=0 + AND salesorderdetails.stkcode='" . $myrow['stockid'] . "'"; $ErrMsg = _('The demand for this product from') . ' ' . $_SESSION['Items'.$identifier]->Location . ' ' . _('cannot be retrieved because'); $DemandResult = DB_query($sql,$db,$ErrMsg); @@ -2227,8 +2236,8 @@ // Find the quantity on works orders $sql = "SELECT SUM(woitems.qtyreqd - woitems.qtyrecd) AS dedm - FROM woitems - WHERE stockid='" . $myrow['stockid'] ."'"; + FROM woitems + WHERE stockid='" . $myrow['stockid'] ."'"; $ErrMsg = _('The order details for this product cannot be retrieved because'); $WoResult = db_query($sql,$db,$ErrMsg); @@ -2251,26 +2260,22 @@ $Available = $qoh - $DemandQty + $OnOrder; printf('<td>%s</td> - <td>%s</td> - <td>%s</td> - <td class="number">%s</td> - <td class="number">%s</td> - <td class="number">%s</td> - <td class="number">%s</td> - <td><font size="1"><input class="number" tabindex="'.number_format($j+7).'" type="textbox" size="6" name="itm'.$myrow['stockid'].'" value="0" /> - </font></td> - </tr>', - $myrow['stockid'], - $myrow['description'], - $myrow['units'], - number_format($QOH, $QOHRow['decimalplaces']), - number_format($DemandQty, $QOHRow['decimalplaces']), - number_format($OnOrder, $QOHRow['decimalplaces']), - number_format($Available, $QOHRow['decimalplaces']), - $ImageSource, - $rootpath, - SID, - $myrow['stockid']); + <td>%s</td> + <td>%s</td> + <td class="number">%s</td> + <td class="number">%s</td> + <td class="number">%s</td> + <td class="number">%s</td> + <td><font size="1"><input class="number" tabindex="'.number_format($j+7).'" type="textbox" size="6" name="itm%s" value="0" /></font></td> + </tr>', + $myrow['stockid'], + $myrow['description'], + $myrow['units'], + number_format($QOH, $QOHRow['decimalplaces']), + number_format($DemandQty, $QOHRow['decimalplaces']), + number_format($OnOrder, $QOHRow['decimalplaces']), + number_format($Available, $QOHRow['decimalplaces']), + $myrow['stockid']); if ($j==1) { $jsCall = '<script type="text/javascript">if (document.SelectParts) {defaultControl(document.SelectParts.itm'.$myrow['stockid'].');}</script>'; } @@ -2295,12 +2300,12 @@ else { /* show the quick entry form variable */ echo '<div class="page_help_text"><b>' . _('Use this form to add items quickly if the item codes are already known') . '</b></div><br /> - <table border="1"> - <tr>'; + <table border="1"> + <tr>'; /*do not display colum unless customer requires po line number by sales order line*/ echo '<th>' . _('Item Code') . '</th> - <th>' . _('Quantity') . '</th> - </tr>'; + <th>' . _('Quantity') . '</th> + </tr>'; $DefaultDeliveryDate = DateAdd(Date($_SESSION['DefaultDateFormat']),'d',$_SESSION['Items'.$identifier]->DeliveryDays); if (count($_SESSION['Items'.$identifier]->LineItems)==0) { echo '<input type="hidden" name="CustRef" value="'.$_SESSION['Items'.$identifier]->CustRef.'" />'; @@ -2315,8 +2320,7 @@ /* Do not display colum unless customer requires po line number by sales order line*/ echo '<td><input type="text" name="part_' . $i . '" size="21" maxlength="20" /></td> <td><input type="text" class="number" name="qty_' . $i . '" size="6" maxlength="6" /></td> - <input type="hidden" class="date" name="ItemDue_' . $i . '" - value="' . $DefaultDeliveryDate . '" /></tr>'; + <input type="hidden" class="date" name="ItemDue_' . $i . '" value="' . $DefaultDeliveryDate . '" /></tr>'; } echo '<script type="text/javascript">if (document.SelectParts) {defaultControl(document.SelectParts.part_1);}</script>'; @@ -2330,4 +2334,4 @@ } echo '</form>'; include('includes/footer.inc'); -?> +?> \ No newline at end of file Modified: trunk/CustomerInquiry.php =================================================================== --- trunk/CustomerInquiry.php 2011-07-17 03:31:55 UTC (rev 4634) +++ trunk/CustomerInquiry.php 2011-07-19 09:35:25 UTC (rev 4635) @@ -103,7 +103,7 @@ INNER JOIN holdreasons ON debtorsmaster.holdreason = holdreasons.reasoncode INNER JOIN currencies - debtorsmaster.currcode = currencies.currabrev + ON debtorsmaster.currcode = currencies.currabrev WHERE debtorsmaster.debtorno = '" . $CustomerID . "'"; $ErrMsg =_('The customer details could not be retrieved by the SQL because'); Modified: trunk/FixedAssetItems.php =================================================================== --- trunk/FixedAssetItems.php 2011-07-17 03:31:55 UTC (rev 4634) +++ trunk/FixedAssetItems.php 2011-07-19 09:35:25 UTC (rev 4635) @@ -123,28 +123,35 @@ $result = DB_Txn_Begin($db); /*Need to check if changing the balance sheet codes - as will need to do journals for the cost and accum depn of the asset to the new category */ - $result = DB_query("SELECT assetcategoryid, cost, accumdepn, costact, accumdepnact FROM fixedassets INNER JOIN fixedassetcategories WHERE assetid='" . $AssetID . "'",$db); + $result = DB_query("SELECT assetcategoryid, + cost, + accumdepn, + costact, + accumdepnact + FROM fixedassets INNER JOIN fixedassetcategories + ON fixedassets.assetcategoryid=fixedassetcategories.categoryid + WHERE assetid='" . $AssetID . "'",$db); $OldDetails = DB_fetch_array($result); if ($OldDetails['assetcategoryid'] !=$_POST['AssetCategoryID'] AND $OldDetails['cost']!=0){ $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); + accumdepnact + FROM fixedassetcategories + WHERE categoryid='" . $_POST['AssetCategoryID'] . "'",$db); $NewAccounts = DB_fetch_array($result); $TransNo = GetNextTransNo( 42, $db); /* transaction type is asset category change */ //credit cost for the old category $SQL = "INSERT INTO gltrans (type, - typeno, - trandate, - periodno, - account, - narrative, - amount) + typeno, + trandate, + periodno, + account, + narrative, + amount) VALUES ('42', '" . $TransNo . "', '" . Date('Y-m-d') . "', @@ -159,12 +166,12 @@ //debit cost for the new category $SQL = "INSERT INTO gltrans (type, - typeno, - trandate, - periodno, - account, - narrative, - amount) + typeno, + trandate, + periodno, + account, + narrative, + amount) VALUES ('42', '" . $TransNo . "', '" . Date('Y-m-d') . "', @@ -179,12 +186,12 @@ if ($OldDetails['accumdepn']!=0) { //debit accumdepn for the old category $SQL = "INSERT INTO gltrans (type, - typeno, - trandate, - periodno, - account, - narrative, - amount) + typeno, + trandate, + periodno, + account, + narrative, + amount) VALUES ('42', '" . $TransNo . "', '" . Date('Y-m-d') . "', @@ -199,12 +206,12 @@ //credit accum depn for the new category $SQL = "INSERT INTO gltrans (type, - typeno, - trandate, - periodno, - account, - narrative, - amount) + typeno, + trandate, + periodno, + account, + narrative, + amount) VALUES ('42', '" . $TransNo . "', '" . Date('Y-m-d') . "', @@ -237,13 +244,13 @@ echo '<br />'; } else { //it is a NEW part $sql = "INSERT INTO fixedassets (description, - longdescription, - assetcategoryid, - assetlocation, - depntype, - depnrate, - barcode, - serialno) + longdescription, + assetcategoryid, + assetlocation, + depntype, + depnrate, + barcode, + serialno) VALUES ( '" . $_POST['Description'] . "', '" . $_POST['LongDescription'] . "', @@ -278,12 +285,12 @@ $CancelDelete = 0; //what validation is required before allowing deletion of assets .... maybe there should be no deletion option? $result = DB_query("SELECT cost, - accumdepn, - accumdepnact, - costact - FROM fixedassets INNER JOIN fixedassetcategories - ON fixedassets.assetcategoryid=fixedassetcategories.categoryid - WHERE assetid='" . $AssetID . "'", $db); + accumdepn, + accumdepnact, + costact + FROM fixedassets INNER JOIN fixedassetcategories + ON fixedassets.assetcategoryid=fixedassetcategories.categoryid + WHERE assetid='" . $AssetID . "'", $db); $AssetRow = DB_fetch_array($result); $NBV = $AssetRow['cost'] -$AssetRow['accumdepn']; if ($NBV!=0) { @@ -309,12 +316,12 @@ if ($AssetRow['cost'] > 0){ //credit cost for the asset deleted $SQL = "INSERT INTO gltrans (type, - typeno, - trandate, - periodno, - account, - narrative, - amount) + typeno, + trandate, + periodno, + account, + narrative, + amount) VALUES ('43', '" . $TransNo . "', '" . Date('Y-m-d') . "', @@ -329,12 +336,12 @@ //debit accumdepn for the depreciation removed on deletion of this asset $SQL = "INSERT INTO gltrans (type, - typeno, - trandate, - periodno, - account, - narrative, - amount) + typeno, + trandate, + periodno, + account, + narrative, + amount) VALUES ('43', '" . $TransNo . "', '" . Date('Y-m-d') . "', @@ -394,19 +401,19 @@ } elseif ($InputError!=1) { // Must be modifying an existing item and no changes made yet - need to lookup the details $sql = "SELECT assetid, - description, - longdescription, - assetcategoryid, - serialno, - assetlocation, - datepurchased, - depntype, - depnrate, - cost, - accumdepn, - barcode - FROM fixedassets - WHERE assetid ='" . $AssetID . "'"; + description, + longdescription, + assetcategoryid, + serialno, + assetlocation, + datepurchased, + depntype, + depnrate, + cost, + accumdepn, + barcode + FROM fixedassets + WHERE assetid ='" . $AssetID . "'"; $result = DB_query($sql, $db); $AssetRow = DB_fetch_array($result); @@ -441,14 +448,14 @@ } else { $LongDescription =''; } -echo '<tr><td>' . _('Asset Description') . ' (' . _('long') . '):</td><td><textarea ' . (in_array('LongDescription',$Errors) ? 'class="texterror"' : '' ) .' name="LongDescription" cols=40 rows=4>' . stripslashes($LongDescription) . '</textarea></td></tr>'."\n"; +echo '<tr><td>' . _('Asset Description') . ' (' . _('long') . '):</td><td><textarea ' . (in_array('LongDescription',$Errors) ? 'class="texterror"' : '' ) .' name="LongDescription" cols=40 rows=4>' . stripslashes($LongDescription) . '</textarea></td></tr>'; if (!isset($New) ) { //ie not new at all! echo '<tr><td>'. _('Image File (.jpg)') . ':</td><td><input type="file" id="ItemPicture" name="ItemPicture"></td>'; if (function_exists('imagecreatefromjpg')){ - $StockImgLink = '<img src="GetStockImage.php?automake=1&textcolor=FFFFFF&bgcolor=CCCCCC'. + $AssetImgLink = '<img src="GetStockImage.php?automake=1&textcolor=FFFFFF&bgcolor=CCCCCC'. '&AssetID='.urlencode($AssetID). '&text='. '&width=64'. @@ -473,16 +480,16 @@ echo '<tr><td>' . _('Asset Category') . ':</td><td><select name="AssetCategoryID">'; -$sql = 'SELECT categoryid, categorydescription FROM fixedassetcategories'; +$sql = "SELECT categoryid, categorydescription FROM fixedassetcategories"; $ErrMsg = _('The asset categories could not be retrieved because'); $DbgMsg = _('The SQL used to retrieve stock categories and failed was'); $result = DB_query($sql,$db,$ErrMsg,$DbgMsg); while ($myrow=DB_fetch_array($result)){ if (!isset($_POST['AssetCategoryID']) or $myrow['categoryid']==$_POST['AssetCategoryID']){ - echo '<option selected VALUE="'. $myrow['categoryid'] . '">' . $myrow['categorydescription'] . '</option>'; + echo '<option selected value="'. $myrow['categoryid'] . '">' . $myrow['categorydescription'] . '</option>'; } else { - echo '<option VALUE="'. $myrow['categoryid'] . '">' . $myrow['categorydescription']. '</option>'; + echo '<option value="'. $myrow['categoryid'] . '">' . $myrow['categorydescription']. '</option>'; } $category=$myrow['categoryid']; } @@ -495,7 +502,7 @@ echo '<tr><td>' . _('Date Purchased') . ':</td><td>' . ConvertSQLDate($AssetRow['datepurchased']) . '</td></tr>'; } -$sql = 'SELECT locationid, locationdescription FROM fixedassetlocations'; +$sql = "SELECT locationid, locationdescription FROM fixedassetlocations"; $ErrMsg = _('The asset locations could not be retrieved because'); $DbgMsg = _('The SQL used to retrieve asset locations and failed was'); $result = DB_query($sql,$db,$ErrMsg,$DbgMsg); @@ -536,17 +543,17 @@ /*Get the last period depreciation (depn is transtype =44) was posted for */ echo '<table><tr><th colspan=2>' . _('Asset Financial Summary') . '</th></tr>'; -echo '<tr><td>' . _('Accumulated Costs') . ':</td><td class="number">' . number_format($AssetRow['cost'],2) . '</td></tr>'; -echo '<tr><td>' . _('Accumulated Depreciation') . ':</td><td class="number">' . number_format($AssetRow['accumdepn'],2) . '</td></tr>'; -echo '<tr><td>' . _('Net Book Value') . ':</td><td class="number">' . number_format($AssetRow['cost']-$AssetRow['accumdepn'],2) . '</td></tr>'; +echo '<tr><td>' . _('Accumulated Costs') . ':</td><td class="number">' . number_format($AssetRow['cost'],$_SESSION['CompanyRecord']['decimalplaces']) . '</td></tr>'; +echo '<tr><td>' . _('Accumulated Depreciation') . ':</td><td class="number">' . number_format($AssetRow['accumdepn'],$_SESSION['CompanyRecord']['decimalplaces']) . '</td></tr>'; +echo '<tr><td>' . _('Net Book Value') . ':</td><td class="number">' . number_format($AssetRow['cost']-$AssetRow['accumdepn'],$_SESSION['CompanyRecord']['decimalplaces']) . '</td></tr>'; -$result = DB_query('SELECT periods.lastdate_in_period, +$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); + ORDER BY periods.lastdate_in_period DESC",$db); $LastDepnRun = DB_fetch_row($result); if(DB_num_rows($result)==0){ @@ -559,13 +566,13 @@ if (isset($New)) { - echo '<div class=centre><br /><input type="Submit" name="submit" value="' . _('Insert New Fixed Asset') . '">'; + echo '<div class="centre"><br /><input type="submit" name="submit" value="' . _('Insert New Fixed Asset') . '">'; } else { - echo '<br /><div class=centre><input type="submit" name="submit" value="' . _('Update') . '"></div>'; + echo '<br /><div class="centre"><input type="submit" name="submit" value="' . _('Update') . '"></div>'; prnMsg( _('Only click the Delete button if you are sure you wish to delete the asset. Only assets with a zero book value can be deleted'), 'warn', _('WARNING')); - echo '<br /><div class=centre><input type="Submit" name="delete" value="' . _('Delete This Asset') . '" onclick="return confirm(\'' . _('Are You Sure? Only assets with a zero book value can be deleted.') . '\');"></div>'; + echo '<br /><div class="centre"><input type="submit" name="delete" value="' . _('Delete This Asset') . '" onclick="return confirm(\'' . _('Are You Sure? Only assets with a zero book value can be deleted.') . '\');"></div>'; } echo '</form></div>'; Modified: trunk/FixedAssetRegister.php =================================================================== --- trunk/FixedAssetRegister.php 2011-07-17 03:31:55 UTC (rev 4634) +++ trunk/FixedAssetRegister.php 2011-07-19 09:35:25 UTC (rev 4635) @@ -73,10 +73,10 @@ } elseif (isset($_POST['csv'])) { $csv_output = "'Asset ID','Description','Serial Number','Location','Date Acquired','Cost B/Fwd','Period Additions','Depn B/Fwd','Period Depreciation','Cost C/Fwd', 'Accum Depn C/Fwd','NBV','Disposal Value'\n"; } else { - echo '<form name="RegisterForm" method="post" action="' . $_SERVER['PHP_SELF'] . '?' . SID . '"><table class=selection>'; + echo '<form name="RegisterForm" method="post" action="' . $_SERVER['PHP_SELF'] . '?' . SID . '"><table class="selection">'; echo '<input type="hidden" name="FormID" value="' . $_SESSION['FormID'] . '" />'; echo '<div class="centre">' ._('From') . ':' . $_POST['FromDate'] . ' ' . _('to') . ' ' . $_POST['ToDate'] . '</div>'; - echo '<br /><table width=80% cellspacing="1" class=selection><tr>'; + echo '<br /><table width=80% cellspacing="1" class="selection"><tr>'; echo '<th>' . _('Asset ID') . '</th>'; echo '<th>' . _('Description') . '</th>'; echo '<th>' . _('Serial Number') . '</th>'; @@ -196,13 +196,13 @@ if (isset($_POST['pdf'])) { $LeftOvers = $pdf->addTextWrap($XPos, $YPos, 300 - $Left_Margin, $FontSize, _('TOTAL')); - $LeftOvers = $pdf->addTextWrap($XPos + 270, $YPos, 70, $FontSize, number_format($TotalCostBfwd, 0), 'right'); - $LeftOvers = $pdf->addTextWrap($XPos + 340, $YPos, 70, $FontSize, number_format($TotalDepnBfwd, 0), 'right'); - $LeftOvers = $pdf->addTextWrap($XPos + 410, $YPos, 70, $FontSize, number_format($TotalAdditions, 0), 'right'); - $LeftOvers = $pdf->addTextWrap($XPos + 480, $YPos, 70, $FontSize, number_format($TotalDepn, 0), 'right'); - $LeftOvers = $pdf->addTextWrap($XPos + 550, $YPos, 70, $FontSize, number_format($TotalCostCfwd, 0), 'right'); - $LeftOvers = $pdf->addTextWrap($XPos + 620, $YPos, 70, $FontSize, number_format($TotalDepnCfwd, 0), 'right'); - $LeftOvers = $pdf->addTextWrap($XPos + 690, $YPos, 70, $FontSize, number_format($TotalNBV, 0), 'right'); + $LeftOvers = $pdf->addTextWrap($XPos + 270, $YPos, 70, $FontSize, number_format($TotalCostBfwd, $_SESSION['CompanyRecord']['decimalplaces']), 'right'); + $LeftOvers = $pdf->addTextWrap($XPos + 340, $YPos, 70, $FontSize, number_format($TotalDepnBfwd, $_SESSION['CompanyRecord']['decimalplaces']), 'right'); + $LeftOvers = $pdf->addTextWrap($XPos + 410, $YPos, 70, $FontSize, number_format($TotalAdditions, $_SESSION['CompanyRecord']['decimalplaces']), 'right'); + $LeftOvers = $pdf->addTextWrap($XPos + 480, $YPos, 70, $FontSize, number_format($TotalDepn, $_SESSION['CompanyRecord']['decimalplaces']), 'right'); + $LeftOvers = $pdf->addTextWrap($XPos + 550, $YPos, 70, $FontSize, number_format($TotalCostCfwd, $_SESSION['CompanyRecord']['decimalplaces']), 'right'); + $LeftOvers = $pdf->addTextWrap($XPos + 620, $YPos, 70, $FontSize, number_format($TotalDepnCfwd, $_SESSION['CompanyRecord']['decimalplaces']), 'right'); + $LeftOvers = $pdf->addTextWrap($XPos + 690, $YPos, 70, $FontSize, number_format($TotalNBV, $_SESSION['CompanyRecord']['decimalplaces']), 'right'); $pdf->Output($_SESSION['DatabaseName'] . '_Asset Register_' . date('Y-m-d') . '.pdf', 'I'); exit; @@ -213,11 +213,11 @@ header('Location: ' .$_SESSION['reports_dir'] . '/FixedAssetRegister_' . Date('Y-m-d') .'.csv'); } else { - echo '<input type=hidden name=FromDate value="' . $_POST['FromDate'] . '">'; - echo '<input type=hidden name=ToDate value=' . $_POST['ToDate'] . '>'; - echo '<input type=hidden name=AssetCategory value=' . $_POST['AssetCategory'] . '>'; - echo '<input type=hidden name=AssetID value=' . $_POST['AssetID'] . '>'; - echo '<input type=hidden name=AssetLocation value=' . $_POST['AssetLocation'] . '>'; + echo '<input type=hidden name="FromDate" value="' . $_POST['FromDate'] . '">'; + echo '<input type=hidden name="ToDate" value=' . $_POST['ToDate'] . '>'; + echo '<input type=hidden name="AssetCategory" value=' . $_POST['AssetCategory'] . '>'; + echo '<input type=hidden name="AssetID" value=' . $_POST['AssetID'] . '>'; + echo '<input type=hidden name="AssetLocation" value=' . $_POST['AssetLocation'] . '>'; //Total Values echo '<tr><th style="vertical-align:top" colspan="5">' . _('TOTAL') . '</th>'; echo '<th style="text-align:right">' . number_format($TotalCostBfwd, $_SESSION['CompanyRecord']['decimalplaces']) . '</th>'; @@ -253,7 +253,7 @@ $sql = "SELECT locationid, locationdescription FROM fixedassetlocations"; $result = DB_query($sql, $db); echo '<tr><th>' . _('Asset Location') . '</th>'; - echo '<td><select name=AssetLocation>'; + echo '<td><select name="AssetLocation">'; echo '<option value="%">' . _('ALL') . '</option>'; while ($myrow = DB_fetch_array($result)) { if (isset($_POST['AssetLocation']) AND $myrow['locationid'] == $_POST['AssetLocation']) { @@ -290,7 +290,7 @@ </table> <br />'; - echo '<div class="centre"><input type="Submit" name="submit" value="' . _('Show Assets') . '"> '; + echo '<div class="centre"><input type="submit" name="submit" value="' . _('Show Assets') . '"> '; echo '<input type="Submit" name="pdf" value="' . _('Print as a pdf') . '"> '; echo '<input type="Submit" name = "csv" value= "' . _('Print as CSV') . '"></div>'; echo '</form>'; Modified: trunk/FixedAssetTransfer.php =================================================================== --- trunk/FixedAssetTransfer.php 2011-07-17 03:31:55 UTC (rev 4634) +++ trunk/FixedAssetTransfer.php 2011-07-19 09:35:25 UTC (rev 4635) @@ -24,25 +24,25 @@ } else if (isset($_POST['AssetID'])) { $AssetID=$_POST['AssetID']; } else { - $sql='SELECT categoryid, categorydescription FROM fixedassetcategories'; + $sql="SELECT categoryid, categorydescription FROM fixedassetcategories"; $result=DB_query($sql, $db); echo '<form action="'. $_SERVER['PHP_SELF'] . '" method=post>'; echo '<input type="hidden" name="FormID" value="' . $_SESSION['FormID'] . '" />'; echo '<p class="page_title_text"><img src="'.$rootpath.'/css/'.$theme.'/images/magnifier.png" title="' . _('Search') . '" alt="" />' . ' ' . $title . '</p>'; - echo '<table class=selection><tr>'; + echo '<table class="selection"><tr>'; echo '<td>'. _('In Asset Category') . ': '; echo '<select name="AssetCat">'; if (!isset($_POST['AssetCat'])) { - $_POST['AssetCat'] = ""; + $_POST['AssetCat'] = ''; } while ($myrow = DB_fetch_array($result)) { if ($myrow['categoryid'] == $_POST['AssetCat']) { - echo '<option selected VALUE="' . $myrow['categoryid'] . '">' . $myrow['categorydescription']; + echo '<option selected value="' . $myrow['categoryid'] . '">' . $myrow['categorydescription'] . '</option>'; } else { - echo '<option value="' . $myrow['categoryid'] . '">' . $myrow['categorydescription']; + echo '<option value="' . $myrow['categoryid'] . '">' . $myrow['categorydescription'] . '</option>'; } } @@ -88,14 +88,14 @@ } $sql= "SELECT fixedassets.assetid, - fixedassets.cost, - fixedassets.accumdepn, - fixedassets.description, - fixedassets.depntype, - fixedassets.serialno, - fixedassets.barcode, - fixedassets.assetlocation, - fixedassetlocations.locationdescription + fixedassets.cost, + fixedassets.accumdepn, + fixedassets.description, + fixedassets.depntype, + fixedassets.serialno, + fixedassets.barcode, + fixedassets.assetlocation, + fixedassetlocations.locationdescription FROM fixedassets INNER JOIN fixedassetlocations ON fixedassets.assetlocation=fixedassetlocations.locationid @@ -115,7 +115,7 @@ <th>' . _('Move To :') . '</th> </tr>'; - $locationsql='SELECT locationid, locationdescription from fixedassetlocations'; + $locationsql="SELECT locationid, locationdescription from fixedassetlocations"; $LocationResult=DB_query($locationsql, $db); while ($myrow=DB_fetch_array($Result)) { @@ -123,8 +123,8 @@ echo '<tr><td>'.$myrow['assetid'].'</td> <td>'.$myrow['description'].'</td> <td>'.$myrow['serialno'].'</td> - <td class=number>'.number_format($myrow['cost'],2).'</td> - <td class=number>'.number_format($myrow['accumdepn'],2).'</td> + <td class="number">'.number_format($myrow['cost'],$_SESSION['CompanyRecord']['decimalplaces']).'</td> + <td class="number">'.number_format($myrow['accumdepn'],$_SESSION['CompanyRecord']['decimalplaces']).'</td> <td>'.$myrow['locationdescription'].'</td>'; echo '<td><select name="Location'.$myrow['assetid'].'" onChange="ReloadForm(Move'.$myrow['assetid'].')">'; echo '<option></option>'; @@ -141,7 +141,7 @@ echo '<input type="hidden" name="Keywords" value="' . $_POST['Keywords'].'"'; echo '<input type="hidden" name="AssetID" value="' . $_POST['AssetID'].'"'; echo '<input type="hidden" name="Search" value="' . $_POST['Search'].'"'; - echo '<td><input type="submit" name="Move'.$myrow['assetid'].'" value=Move></td>'; + echo '<td><input type="submit" name="Move'.$myrow['assetid'].'" value="Move"></td>'; echo '</tr>'; } echo '</table></form>'; Modified: trunk/InventoryPlanning.php =================================================================== --- trunk/InventoryPlanning.php 2011-07-17 03:31:55 UTC (rev 4634) +++ trunk/InventoryPlanning.php 2011-07-19 09:35:25 UTC (rev 4635) @@ -2,7 +2,6 @@ /* $Id$ */ -//$PageSecurity = 2; include('includes/session.inc'); if (isset($_POST['PrintPDF']) @@ -53,26 +52,26 @@ need QOH, QOO, QDem, Sales Mth -1, Sales Mth -2, Sales Mth -3, Sales Mth -4*/ if ($_POST['Location']=='All'){ $SQL = "SELECT stockmaster.categoryid, - stockmaster.description, - stockcategory.categorydescription, - locstock.stockid, - SUM(locstock.quantity) AS qoh - FROM locstock, - stockmaster, - stockcategory - WHERE locstock.stockid=stockmaster.stockid - AND stockmaster.discontinued = 0 - AND stockmaster.categoryid=stockcategory.categoryid - AND (stockmaster.mbflag='B' OR stockmaster.mbflag='M') - AND stockmaster.categoryid >= '" . $_POST['FromCriteria'] . "' - AND stockmaster.categoryid <= '" . $_POST['ToCriteria'] . "' - GROUP BY stockmaster.categoryid, - stockmaster.description, - stockcategory.categorydescription, - locstock.stockid, - stockmaster.stockid - ORDER BY stockmaster.categoryid, - stockmaster.stockid"; + stockmaster.description, + stockcategory.categorydescription, + locstock.stockid, + SUM(locstock.quantity) AS qoh + FROM locstock, + stockmaster, + stockcategory + WHERE locstock.stockid=stockmaster.stockid + AND stockmaster.discontinued = 0 + AND stockmaster.categoryid=stockcategory.categoryid + AND (stockmaster.mbflag='B' OR stockmaster.mbflag='M') + AND stockmaster.categoryid >= '" . $_POST['FromCriteria'] . "' + AND stockmaster.categoryid <= '" . $_POST['ToCriteria'] . "' + GROUP BY stockmaster.categoryid, + stockmaster.description, + stockcategory.categorydescription, + locstock.stockid, + stockmaster.stockid + ORDER BY stockmaster.categoryid, + stockmaster.stockid"; } else { $SQL = "SELECT stockmaster.categoryid, locstock.stockid, @@ -99,9 +98,9 @@ $title = _('Inventory Planning') . ' - ' . _('Problem Report') . '....'; include('includes/header.inc'); prnMsg(_('The inventory quantities 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; @@ -145,27 +144,27 @@ if ($_POST['Location']=='All'){ $SQL = "SELECT SUM(CASE WHEN prd='" . $CurrentPeriod . "' THEN -qty ELSE 0 END) AS prd0, - SUM(CASE WHEN prd='" . $Period_1 . "' THEN -qty ELSE 0 END) AS prd1, - SUM(CASE WHEN prd='" . $Period_2 . "' THEN -qty ELSE 0 END) AS prd2, - SUM(CASE WHEN prd='" . $Period_3 . "' THEN -qty ELSE 0 END) AS prd3, - SUM(CASE WHEN prd='" . $Period_4 . "' THEN -qty ELSE 0 END) AS prd4, - SUM(CASE WHEN prd='" . $Period_5 . "' THEN -qty ELSE 0 END) AS prd5 - FROM stockmoves - WHERE stockid='" . $InventoryPlan['stockid'] . "' - AND (type=10 OR type=11) - AND stockmoves.hidemovt=0"; + SUM(CASE WHEN prd='" . $Period_1 . "' THEN -qty ELSE 0 END) AS prd1, + SUM(CASE WHEN prd='" . $Period_2 . "' THEN -qty ELSE 0 END) AS prd2, + SUM(CASE WHEN prd='" . $Period_3 . "' THEN -qty ELSE 0 END) AS prd3, + SUM(CASE WHEN prd='" . $Period_4 . "' THEN -qty ELSE 0 END) AS prd4, + SUM(CASE WHEN prd='" . $Period_5 . "' THEN -qty ELSE 0 END) AS prd5 + FROM stockmoves + WHERE stockid='" . $InventoryPlan['stockid'] . "' + AND (type=10 OR type=11) + AND stockmoves.hidemovt=0"; } else { $SQL = "SELECT SUM(CASE WHEN prd='" . $CurrentPeriod . "' THEN -qty ELSE 0 END) AS prd0, - SUM(CASE WHEN prd='" . $Period_1 . "' THEN -qty ELSE 0 END) AS prd1, - SUM(CASE WHEN prd='" . $Period_2 . "' THEN -qty ELSE 0 END) AS prd2, - SUM(CASE WHEN prd='" . $Period_3 . "' THEN -qty ELSE 0 END) AS prd3, - SUM(CASE WHEN prd='" . $Period_4 . "' THEN -qty ELSE 0 END) AS prd4, - SUM(CASE WHEN prd='" . $Period_5 . "' THEN -qty ELSE 0 END) AS prd5 - FROM stockmoves - WHERE stockid='" . $InventoryPlan['stockid'] . "' - AND stockmoves.loccode ='" . $_POST['Location'] . "' - AND (stockmoves.type=10 OR stockmoves.type=11) - AND stockmoves.hidemovt=0"; + SUM(CASE WHEN prd='" . $Period_1 . "' THEN -qty ELSE 0 END) AS prd1, + SUM(CASE WHEN prd='" . $Period_2 . "' THEN -qty ELSE 0 END) AS prd2, + SUM(CASE WHEN prd='" . $Period_3 . "' THEN -qty ELSE 0 END) AS prd3, + SUM(CASE WHEN prd='" . $Period_4 . "' THEN -qty ELSE 0 END) AS prd4, + SUM(CASE WHEN prd='" . $Period_5 . "' THEN -qty ELSE 0 END) AS prd5 + FROM stockmoves + WHERE stockid='" . $InventoryPlan['stockid'] . "' + AND stockmoves.loccode ='" . $_POST['Location'] . "' + AND (stockmoves.type=10 OR stockmoves.type=11) + AND stockmoves.hidemovt=0"; } $SalesResult = DB_query($SQL,$db,'','', false, false); @@ -174,9 +173,9 @@ $title = _('Inventory Planning') . ' - ' . _('Problem Report') . '....'; include('includes/header.inc'); prnMsg( _('The sales quantities 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'); @@ -209,9 +208,9 @@ $title = _('Inventory Planning') . ' - ' . _('Problem Report') . '....'; include('includes/header.inc'); prnMsg( _('The sales order demand quantities could not be retrieved by the SQL because') . ' - ' . DB_error_msg($db),'error'); - echo "<br /><a href='" .$rootpath ."/index.php?" . SID . "'>" . _('Back to the menu') . '</a>'; + echo '<br /><a href="' .$rootpath .'/index.php">' . _('Back to the menu') . '</a>'; if ($debug==1){ - echo "<br />$SQL"; + echo '<br />'.$SQL; } include('includes/footer.inc'); exit; @@ -257,9 +256,9 @@ $title = _('Inventory Planning') . ' - ' . _('Problem Report') . '....'; include('includes/header.inc'); prnMsg( _('The sales order demand quantities from parent assemblies 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; @@ -267,23 +266,23 @@ if ($_POST['Location']=='All'){ $SQL = "SELECT SUM(purchorderdetails.quantityord - purchorderdetails.quantityrecd) as qtyonorder - FROM purchorderdetails INNER JOIN purchorders - ON purchorderdetails.orderno = purchorders.orderno - WHERE purchorderdetails.itemcode = '" . $InventoryPlan['stockid'] . "' - AND purchorderdetails.completed = 0 - AND purchorders.status <> 'Cancelled' - AND purchorders.status <> 'Rejected' - AND purchorders.status <> 'Pending'"; + FROM purchorderdetails INNER JOIN purchorders + ON purchorderdetails.orderno = purchorders.orderno + WHERE purchorderdetails.itemcode = '" . $InventoryPlan['stockid'] . "' + AND purchorderdetails.completed = 0 + AND purchorders.status <> 'Cancelled' + AND purchorders.status <> 'Rejected' + AND purchorders.status <> 'Pending'"; } else { $SQL = "SELECT SUM(purchorderdetails.quantityord - purchorderdetails.quantityrecd) as qtyonorder - FROM purchorderdetails INNER JOIN purchorders - ON purchorderdetails.orderno = purchorders.orderno - WHERE purchorderdetails.itemcode = '" . $InventoryPlan['stockid'] . "' - AND purchorderdetails.completed = 0 - AND purchorders.intostoc... [truncated message content] |
From: <dai...@us...> - 2011-07-19 09:35:34
|
Revision: 4635 http://web-erp.svn.sourceforge.net/web-erp/?rev=4635&view=rev Author: daintree Date: 2011-07-19 09:35:25 +0000 (Tue, 19 Jul 2011) Log Message: ----------- consistency Modified Paths: -------------- trunk/CounterSales.php trunk/CustomerInquiry.php trunk/FixedAssetItems.php trunk/FixedAssetRegister.php trunk/FixedAssetTransfer.php trunk/InventoryPlanning.php trunk/InventoryPlanningPrefSupplier.php trunk/InventoryQuantities.php trunk/InventoryValuation.php trunk/Labels.php trunk/Locations.php trunk/MRP.php trunk/MRPCalendar.php trunk/MRPCreateDemands.php trunk/MRPDemandTypes.php trunk/MRPDemands.php trunk/MRPPlannedWorkOrders.php trunk/MRPShortages.php trunk/MailInventoryValuation.php trunk/MailSalesReport.php trunk/MailSalesReport_csv.php trunk/SelectCustomer.php trunk/css/fresh/default.css trunk/index.php trunk/javascripts/MiscFunctions.js Modified: trunk/CounterSales.php =================================================================== --- trunk/CounterSales.php 2011-07-17 03:31:55 UTC (rev 4634) +++ trunk/CounterSales.php 2011-07-19 09:35:25 UTC (rev 4635) @@ -84,30 +84,37 @@ include('includes/footer.inc'); exit; } - - $_SESSION['Items'.$identifier]->Branch = $myrow['cashsalebranch']; - $_SESSION['Items'.$identifier]->DebtorNo = $myrow['cashsalecustomer']; + if (isset($_GET['DebtorNo'])) { + $_SESSION['Items'.$identifier]->DebtorNo = $_GET['DebtorNo']; + $_SESSION['Items'.$identifier]->Branch = $_GET['BranchNo']; + } else { + $_SESSION['Items'.$identifier]->Branch = $myrow['cashsalebranch']; + $_SESSION['Items'.$identifier]->DebtorNo = $myrow['cashsalecustomer']; + } + $_SESSION['Items'.$identifier]->LocationName = $myrow['locationname']; $_SESSION['Items'.$identifier]->Location = $_SESSION['UserStockLocation']; $_SESSION['Items'.$identifier]->DispatchTaxProvince = $myrow['taxprovinceid']; // Now check to ensure this account exists and set defaults */ $sql = "SELECT debtorsmaster.name, - holdreasons.dissallowinvoices, - debtorsmaster.salestype, - salestypes.sales_type, - debtorsmaster.currcode, - debtorsmaster.customerpoline, - paymentterms.terms - FROM debtorsmaster, - holdreasons, - salestypes, - paymentterms - WHERE debtorsmaster.salestype=salestypes.typeabbrev - AND debtorsmaster.holdreason=holdreasons.reasoncode - AND debtorsmaster.paymentterms=paymentterms.termsindicator - AND debtorsmaster.debtorno = '" . $_SESSION['Items'.$identifier]->DebtorNo . "'"; - + holdreasons.dissallowinvoices, + debtorsmaster.salestype, + salestypes.sales_type, + debtorsmaster.currcode, + debtorsmaster.customerpoline, + paymentterms.terms, + currencies.decimalplaces + FROM debtorsmaster INNER JOIN holdreasons + ON debtorsmaster.holdreason=holdreasons.reasoncode + INNER JOIN salestypes + ON debtorsmaster.salestype=salestypes.typeabbrev + INNER JOIN paymentterms + ON debtorsmaster.paymentterms=paymentterms.termsindicator + INNER JOIN currencies + ON debtorsmaster.currcode=currencies.currabrev + WHERE debtorsmaster.debtorno = '" . $_SESSION['Items'.$identifier]->DebtorNo . "'"; + $ErrMsg = _('The details of the customer selected') . ': ' . $_SESSION['Items'.$identifier]->DebtorNo . ' ' . _('cannot be retrieved because'); $DbgMsg = _('The SQL used to retrieve the customer details and failed was') . ':'; // echo $sql; @@ -127,7 +134,7 @@ $_SESSION['Items'.$identifier]->DefaultCurrency = $myrow['currcode']; $_SESSION['Items'.$identifier]->DefaultPOLine = $myrow['customerpoline']; $_SESSION['Items'.$identifier]->PaymentTerms = $myrow['terms']; - + $_SESSION['Items'.$identifier]->CurrDecimalPlaces = $myrow['decimalplaces']; /* now get the branch defaults from the customer branches table CustBranch. */ $sql = "SELECT custbranch.brname, @@ -208,7 +215,7 @@ } else { /*Not cancelling the order */ echo '<p class="page_title_text"><img src="'.$rootpath.'/css/'.$theme.'/images/inventory.png" title="' . _('Counter Sales') . '" alt="" />' . ' '; - echo _('Counter Sale') . ' - ' . $_SESSION['Items'.$identifier]->LocationName . ' (' . _('all amounts in') . ' ' . $_SESSION['Items'.$identifier]->DefaultCurrency . ')'; + echo $_SESSION['Items'.$identifier]->CustomerName . ' ' . _('Counter Sale') . ' ' ._('from') . ' ' . $_SESSION['Items'.$identifier]->LocationName . ' ' . _('inventory') . ' (' . _('all amounts in') . ' ' . $_SESSION['Items'.$identifier]->DefaultCurrency . ')'; echo '</p>'; } @@ -228,30 +235,30 @@ if ($_POST['StockCat']=='All'){ $SQL = "SELECT stockmaster.stockid, - stockmaster.description, - stockmaster.units - FROM stockmaster, - stockcategory - WHERE stockmaster.categoryid=stockcategory.categoryid - AND (stockcategory.stocktype='F' OR stockcategory.stocktype='D') - AND stockmaster.mbflag <>'G' - AND stockmaster.controlled <> 1 - AND stockmaster.description " . LIKE . " '" . $SearchString . "' - AND stockmaster.discontinued=0 - ORDER BY stockmaster.stockid"; + stockmaster.description, + stockmaster.units + FROM stockmaster, + stockcategory + WHERE stockmaster.categoryid=stockcategory.categoryid + AND (stockcategory.stocktype='F' OR stockcategory.stocktype='D') + AND stockmaster.mbflag <>'G' + AND stockmaster.controlled <> 1 + AND stockmaster.description " . LIKE . " '" . $SearchString . "' + AND stockmaster.discontinued=0 + ORDER BY stockmaster.stockid"; } else { $SQL = "SELECT stockmaster.stockid, - stockmaster.description, - stockmaster.units - FROM stockmaster, stockcategory - WHERE stockmaster.categoryid=stockcategory.categoryid - AND (stockcategory.stocktype='F' OR stockcategory.stocktype='D') - AND stockmaster.mbflag <>'G' - AND stockmaster.controlled <> 1 - AND stockmaster.discontinued=0 - AND stockmaster.description " . LIKE . " '" . $SearchString . "' - AND stockmaster.categoryid='" . $_POST['StockCat'] . "' - ORDER BY stockmaster.stockid"; + stockmaster.description, + stockmaster.units + FROM stockmaster, stockcategory + WHERE stockmaster.categoryid=stockcategory.categoryid + AND (stockcategory.stocktype='F' OR stockcategory.stocktype='D') + AND stockmaster.mbflag <>'G' + AND stockmaster.controlled <> 1 + AND stockmaster.discontinued=0 + AND stockmaster.description " . LIKE . " '" . $SearchString . "' + AND stockmaster.categoryid='" . $_POST['StockCat'] . "' + ORDER BY stockmaster.stockid"; } } else if (mb_strlen($_POST['StockCode'])>0){ @@ -261,55 +268,55 @@ if ($_POST['StockCat']=='All'){ $SQL = "SELECT stockmaster.stockid, - stockmaster.description, - stockmaster.units - FROM stockmaster, stockcategory - WHERE stockmaster.categoryid=stockcategory.categoryid - AND (stockcategory.stocktype='F' OR stockcategory.stocktype='D') - AND stockmaster.stockid " . LIKE . " '" . $SearchString . "' - AND stockmaster.mbflag <>'G' - AND stockmaster.controlled <> 1 - AND stockmaster.discontinued=0 - ORDER BY stockmaster.stockid"; + stockmaster.description, + stockmaster.units + FROM stockmaster, stockcategory + WHERE stockmaster.categoryid=stockcategory.categoryid + AND (stockcategory.stocktype='F' OR stockcategory.stocktype='D') + AND stockmaster.stockid " . LIKE . " '" . $SearchString . "' + AND stockmaster.mbflag <>'G' + AND stockmaster.controlled <> 1 + AND stockmaster.discontinued=0 + ORDER BY stockmaster.stockid"; } else { $SQL = "SELECT stockmaster.stockid, - stockmaster.description, - stockmaster.units - FROM stockmaster, stockcategory - WHERE stockmaster.categoryid=stockcategory.categoryid - AND (stockcategory.stocktype='F' OR stockcategory.stocktype='D') - AND stockmaster.stockid " . LIKE . " '" . $SearchString . "' - AND stockmaster.mbflag <>'G' - AND stockmaster.controlled <> 1 - AND stockmaster.discontinued=0 - AND stockmaster.categoryid='" . $_POST['StockCat'] . "' - ORDER BY stockmaster.stockid"; + stockmaster.description, + stockmaster.units + FROM stockmaster, stockcategory + WHERE stockmaster.categoryid=stockcategory.categoryid + AND (stockcategory.stocktype='F' OR stockcategory.stocktype='D') + AND stockmaster.stockid " . LIKE . " '" . $SearchString . "' + AND stockmaster.mbflag <>'G' + AND stockmaster.controlled <> 1 + AND stockmaster.discontinued=0 + AND stockmaster.categoryid='" . $_POST['StockCat'] . "' + ORDER BY stockmaster.stockid"; } } else { if ($_POST['StockCat']=='All'){ $SQL = "SELECT stockmaster.stockid, - stockmaster.description, - stockmaster.units - FROM stockmaster, stockcategory - WHERE stockmaster.categoryid=stockcategory.categoryid - AND (stockcategory.stocktype='F' OR stockcategory.stocktype='D') - AND stockmaster.mbflag <>'G' - AND stockmaster.controlled <> 1 - AND stockmaster.discontinued=0 - ORDER BY stockmaster.stockid"; + stockmaster.description, + stockmaster.units + FROM stockmaster, stockcategory + WHERE stockmaster.categoryid=stockcategory.categoryid + AND (stockcategory.stocktype='F' OR stockcategory.stocktype='D') + AND stockmaster.mbflag <>'G' + AND stockmaster.controlled <> 1 + AND stockmaster.discontinued=0 + ORDER BY stockmaster.stockid"; } else { $SQL = "SELECT stockmaster.stockid, - stockmaster.description, - stockmaster.units - FROM stockmaster, stockcategory - WHERE stockmaster.categoryid=stockcategory.categoryid - AND (stockcategory.stocktype='F' OR stockcategory.stocktype='D') - AND stockmaster.mbflag <>'G' - AND stockmaster.controlled <> 1 - AND stockmaster.discontinued=0 - AND stockmaster.categoryid='" . $_POST['StockCat'] . "' - ORDER BY stockmaster.stockid"; + stockmaster.description, + stockmaster.units + FROM stockmaster, stockcategory + WHERE stockmaster.categoryid=stockcategory.categoryid + AND (stockcategory.stocktype='F' OR stockcategory.stocktype='D') + AND stockmaster.mbflag <>'G' + AND stockmaster.controlled <> 1 + AND stockmaster.discontinued=0 + AND stockmaster.categoryid='" . $_POST['StockCat'] . "' + ORDER BY stockmaster.stockid"; } } @@ -345,7 +352,7 @@ /* Always do the stuff below */ -echo '<form action="' . $_SERVER['PHP_SELF'] . '?' . SID .'identifier='.$identifier . '" name="SelectParts" method="post">'; +echo '<form action="' . $_SERVER['PHP_SELF'] . '?identifier='.$identifier . '" name="SelectParts" method="post">'; echo '<input type="hidden" name="FormID" value="' . $_SESSION['FormID'] . '" />'; //Get The exchange rate used for GPPercent calculations on adding or amending items @@ -373,7 +380,10 @@ $Discount = 0; $i=1; - while ($i<=$_SESSION['QuickEntries'] and isset($_POST['part_' . $i]) and $_POST['part_' . $i]!='') { + while ($i<=$_SESSION['QuickEntries'] + AND isset($_POST['part_' . $i]) + AND $_POST['part_' . $i]!='') { + $QuickEntryCode = 'part_' . $i; $QuickEntryQty = 'qty_' . $i; $QuickEntryPOLine = 'poline_' . $i; @@ -409,9 +419,10 @@ $NewItemDue = DateAdd (Date($_SESSION['DefaultDateFormat']),'d', $_SESSION['Items'.$identifier]->DeliveryDays); } /*Now figure out if the item is a kit set - the field MBFlag='K'*/ - $sql = "SELECT stockmaster.mbflag, stockmaster.controlled - FROM stockmaster - WHERE stockmaster.stockid='". $NewItem ."'"; + $sql = "SELECT stockmaster.mbflag, + stockmaster.controlled + FROM stockmaster + WHERE stockmaster.stockid='". $NewItem ."'"; $ErrMsg = _('Could not determine if the part being ordered was a kitset or not because'); $DbgMsg = _('The sql that was used to determine if the part being ordered was a kitset or not was '); @@ -423,11 +434,11 @@ } elseif ($myrow=DB_fetch_array($KitResult)){ if ($myrow['mbflag']=='K'){ /*It is a kit set item */ $sql = "SELECT bom.component, - bom.quantity - FROM bom - WHERE bom.parent='" . $NewItem . "' - AND bom.effectiveto > '" . Date('Y-m-d') . "' - AND bom.effectiveafter < '" . Date('Y-m-d') . "'"; + bom.quantity + FROM bom + WHERE bom.parent='" . $NewItem . "' + AND bom.effectiveto > '" . Date('Y-m-d') . "' + AND bom.effectiveafter < '" . Date('Y-m-d') . "'"; $ErrMsg = _('Could not retrieve kitset components from the database because') . ' '; $KitResult = DB_query($sql,$db,$ErrMsg,$DbgMsg); @@ -515,9 +526,9 @@ foreach ($_SESSION['Items'.$identifier]->LineItems as $OrderLine) { $NewItem=$OrderLine->StockID; $sql = "SELECT stockmaster.mbflag, - stockmaster.controlled - FROM stockmaster - WHERE stockmaster.stockid='". $OrderLine->StockID."'"; + stockmaster.controlled + FROM stockmaster + WHERE stockmaster.stockid='". $OrderLine->StockID."'"; $ErrMsg = _('Could not determine if the part being ordered was a kitset or not because'); $DbgMsg = _('The sql that was used to determine if the part being ordered was a kitset or not was '); @@ -525,12 +536,12 @@ if ($myrow=DB_fetch_array($KitResult)){ if ($myrow['mbflag']=='K'){ /*It is a kit set item */ $sql = "SELECT bom.component, - bom.quantity - FROM bom - WHERE bom.parent='" . $OrderLine->StockID. "' - AND bom.effectiveto > '" . Date('Y-m-d') . "' - AND bom.effectiveafter < '" . Date('Y-m-d') . "'"; - + bom.quantity + FROM bom + WHERE bom.parent='" . $OrderLine->StockID. "' + AND bom.effectiveto > '" . Date('Y-m-d') . "' + AND bom.effectiveafter < '" . Date('Y-m-d') . "'"; + $ErrMsg = _('Could not retrieve kitset components from the database because'); $KitResult = DB_query($sql,$db,$ErrMsg); @@ -559,9 +570,9 @@ * controlled items and ghost/phantom items cannot be selected because the SQL to show items to select doesn't show 'em * */ $sql = "SELECT stockmaster.mbflag, - stockmaster.taxcatid - FROM stockmaster - WHERE stockmaster.stockid='". $NewItem ."'"; + stockmaster.taxcatid + FROM stockmaster + WHERE stockmaster.stockid='". $NewItem ."'"; $ErrMsg = _('Could not determine if the part being ordered was a kitset or not because'); @@ -573,12 +584,12 @@ if ($myrow=DB_fetch_array($KitResult)){ if ($myrow['mbflag']=='K'){ /*It is a kit set item */ $sql = "SELECT bom.component, - bom.quantity - FROM bom - WHERE bom.parent='" . $NewItem . "' - AND bom.effectiveto > '" . Date('Y-m-d') . "' - AND bom.effectiveafter < '" . Date('Y-m-d') . "'"; - + bom.quantity + FROM bom + WHERE bom.parent='" . $NewItem . "' + AND bom.effectiveto > '" . Date('Y-m-d') . "' + AND bom.effectiveafter < '" . Date('Y-m-d') . "'"; + $ErrMsg = _('Could not retrieve kitset components from the database because'); $KitResult = DB_query($sql,$db,$ErrMsg); @@ -610,8 +621,8 @@ foreach($NewItemArray as $NewItem => $NewItemQty) { if($NewItemQty > 0) { $sql = "SELECT stockmaster.mbflag - FROM stockmaster - WHERE stockmaster.stockid='". $NewItem ."'"; + FROM stockmaster + WHERE stockmaster.stockid='". $NewItem ."'"; $ErrMsg = _('Could not determine if the part being ordered was a kitset or not because'); @@ -625,9 +636,9 @@ $sql = "SELECT bom.component, bom.quantity FROM bom - WHERE bom.parent='" . $NewItem . "' - AND bom.effectiveto > '" . Date('Y-m-d') . "' - AND bom.effectiveafter < '" . Date('Y-m-d') . "'"; + WHERE bom.parent='" . $NewItem . "' + AND bom.effectiveto > '" . Date('Y-m-d') . "' + AND bom.effectiveafter < '" . Date('Y-m-d') . "'"; $ErrMsg = _('Could not retrieve kitset components from the database because'); $KitResult = DB_query($sql,$db,$ErrMsg); @@ -659,7 +670,7 @@ $counter =0; foreach ($_SESSION['Items'.$identifier]->LineItems as $OrderLine) { - if ($OrderLine->DiscCat !="" AND ! in_array($OrderLine->DiscCat,$DiscCatsDone)){ + if ($OrderLine->DiscCat !='' AND ! in_array($OrderLine->DiscCat,$DiscCatsDone)){ $DiscCatsDone[$counter]=$OrderLine->DiscCat; $QuantityOfDiscCat =0; @@ -670,10 +681,10 @@ } } $result = DB_query("SELECT MAX(discountrate) AS discount - FROM discountmatrix - WHERE salestype='" . $_SESSION['Items'.$identifier]->DefaultSalesType . "' - AND discountcategory ='" . $OrderLine->DiscCat . "' - AND quantitybreak <'" . $QuantityOfDiscCat . "'",$db); + FROM discountmatrix + WHERE salestype='" . $_SESSION['Items'.$identifier]->DefaultSalesType . "' + AND discountcategory ='" . $OrderLine->DiscCat . "' + AND quantitybreak <'" . $QuantityOfDiscCat . "'",$db); $myrow = DB_fetch_row($result); if ($myrow[0]!=0){ /* need to update the lines affected */ foreach ($_SESSION['Items'.$identifier]->LineItems as $StkItems_2) { @@ -686,7 +697,8 @@ } } /* end of discount matrix lookup code */ -if (count($_SESSION['Items'.$identifier]->LineItems)>0 and !isset($_POST['ProcessSale'])){ /*only show order lines if there are any */ +if (count($_SESSION['Items'.$identifier]->LineItems)>0 + AND !isset($_POST['ProcessSale'])){ /*only show order lines if there are any */ /* // ************************************************************************* // T H I S W H E R E T H E S A L E I S D I S P L A Y E D @@ -738,7 +750,7 @@ echo '<input type="hidden" name="POLine_' . $OrderLine->LineNumber . '" value="" />'; echo '<input type="hidden" name="ItemDue_' . $OrderLine->LineNumber . '" value="'.$OrderLine->ItemDue.'" />'; - echo '<td><a target="_blank" href="' . $rootpath . '/StockStatus.php?' . SID .'identifier='.$identifier . '&StockID=' . $OrderLine->StockID . '&DebtorNo=' . $_SESSION['Items'.$identifier]->DebtorNo . '">' . $OrderLine->StockID . '</a></td> + echo '<td><a target="_blank" href="' . $rootpath . '/StockStatus.php?identifier='.$identifier . '&StockID=' . $OrderLine->StockID . '&DebtorNo=' . $_SESSION['Items'.$identifier]->DebtorNo . '">' . $OrderLine->StockID . '</a></td> <td>' . $OrderLine->ItemDescription . '</td>'; echo '<td><input class="number" tabindex="2" type="text" name="Quantity_' . $OrderLine->LineNumber . '" size="6" maxlength="6" value="' . $OrderLine->Quantity . '" />'; @@ -750,7 +762,7 @@ echo '<td><input class="number" type="text" name="Price_' . $OrderLine->LineNumber . '" size="16" maxlength="16" value="' . $OrderLine->Price . '" /></td> <td><input class="number" type="text" name="Discount_' . $OrderLine->LineNumber . '" size="5" maxlength="4" value="' . ($OrderLine->DiscountPercent * 100) . '" /></td> <td><input class="number" type="text" name="GPPercent_' . $OrderLine->LineNumber . '" size="3" maxlength="40" value="' . $OrderLine->GPPercent . '" /></td>'; - echo '<td class="number">' . number_format($SubTotal,2) . '</td>'; + echo '<td class="number">' . number_format($SubTotal,$_SESSION['Items'.$identifier]->CurrDecimalPlaces) . '</td>'; $LineDueDate = $OrderLine->ItemDue; if (!Is_Date($OrderLine->ItemDue)){ $LineDueDate = DateAdd (Date($_SESSION['DefaultDateFormat']),'d', $_SESSION['Items'.$identifier]->DeliveryDays); @@ -776,9 +788,9 @@ $TaxTotal += $TaxLineTotal; $_SESSION['Items'.$identifier]->TaxTotals=$TaxTotals; $_SESSION['Items'.$identifier]->TaxGLCodes=$TaxGLCodes; - echo '<td class="number">' . number_format($TaxLineTotal ,2) . '</td>'; - echo '<td class="number">' . number_format($SubTotal + $TaxLineTotal ,2) . '</td>'; - echo '<td><a href="' . $_SERVER['PHP_SELF'] . '?' . SID .'&identifier='.$identifier . '&Delete=' . $OrderLine->LineNumber . '" onclick="return confirm(\'' . _('Are You Sure?') . '\');">' . _('Delete') . '</a></td></tr>'; + echo '<td class="number">' . number_format($TaxLineTotal ,$_SESSION['Items'.$identifier]->CurrDecimalPlaces) . '</td>'; + echo '<td class="number">' . number_format($SubTotal + $TaxLineTotal ,$_SESSION['Items'.$identifier]->CurrDecimalPlaces) . '</td>'; + echo '<td><a href="' . $_SERVER['PHP_SELF'] . '?identifier='.$identifier . '&Delete=' . $OrderLine->LineNumber . '" onclick="return confirm(\'' . _('Are You Sure?') . '\');">' . _('Delete') . '</a></td></tr>'; if ($_SESSION['AllowOrderLineItemNarrative'] == 1){ echo $RowStarter; @@ -794,9 +806,9 @@ } /* end of loop around items */ echo '<tr class="EvenTableRows"><td colspan="8" class="number"><b>' . _('Total') . '</b></td> - <td class="number">' . number_format(($_SESSION['Items'.$identifier]->total),2) . '</td> - <td class="number">' . number_format($TaxTotal,2) . '</td> - <td class="number">' . number_format(($_SESSION['Items'.$identifier]->total+$TaxTotal),2) . '</td> + <td class="number">' . number_format(($_SESSION['Items'.$identifier]->total),$_SESSION['Items'.$identifier]->CurrDecimalPlaces) . '</td> + <td class="number">' . number_format($TaxTotal,$_SESSION['Items'.$identifier]->CurrDecimalPlaces) . '</td> + <td class="number">' . number_format(($_SESSION['Items'.$identifier]->total+$TaxTotal),$_SESSION['Items'.$identifier]->CurrDecimalPlaces) . '</td> </tr> </table>'; echo '<input type="hidden" name="TaxTotal" value="'.$TaxTotal.'" />'; @@ -1938,9 +1950,9 @@ echo '<br /><div class="centre">'; if ($_SESSION['InvoicePortraitFormat']==0){ - echo '<img src="'.$rootpath.'/css/'.$theme.'/images/printer.png" title="' . _('Print') . '" alt="" />' . ' ' . '<a target="_blank" href="'.$rootpath.'/PrintCustTrans.php?' . SID . 'FromTransNo='.$InvoiceNo.'&InvOrCredit=Invoice&PrintPDF=True">'. _('Print this invoice'). ' (' . _('Landscape') . ')</a><br /><br />'; + echo '<img src="'.$rootpath.'/css/'.$theme.'/images/printer.png" title="' . _('Print') . '" alt="" />' . ' ' . '<a target="_blank" href="'.$rootpath.'/PrintCustTrans.php?FromTransNo='.$InvoiceNo.'&InvOrCredit=Invoice&PrintPDF=True">'. _('Print this invoice'). ' (' . _('Landscape') . ')</a><br /><br />'; } else { - echo '<img src="'.$rootpath.'/css/'.$theme.'/images/printer.png" title="' . _('Print') . '" alt="" />' . ' ' . '<a target="_blank" href="'.$rootpath.'/PrintCustTransPortrait.php?' . SID . 'FromTransNo='.$InvoiceNo.'&InvOrCredit=Invoice&PrintPDF=True">'. _('Print this invoice'). ' (' . _('Portrait') . ')</a><br /><br />'; + echo '<img src="'.$rootpath.'/css/'.$theme.'/images/printer.png" title="' . _('Print') . '" alt="" />' . ' ' . '<a target="_blank" href="'.$rootpath.'/PrintCustTransPortrait.php?FromTransNo='.$InvoiceNo.'&InvOrCredit=Invoice&PrintPDF=True">'. _('Print this invoice'). ' (' . _('Portrait') . ')</a><br /><br />'; } echo '<br /><br /><a href="' .$_SERVER['PHP_SELF'] . '">' . _('Start a new Counter Sale') . '</a></div>'; @@ -2077,7 +2089,7 @@ <td style="text-align:center">%s</td> <td style="text-align:center">%s</td> <td style="text-align:center">%s</td> - <td><font size=1><input class="number" tabindex="'.number_format($j+7).'" type="textbox" size="6" name="itm'.$myrow['stockid'].'" value="0" /> + <td><font size=1><input class="number" tabindex="'.number_format($j+7).'" type="textbox" size="6" name="itm%s" value="0" /> </td> </tr>', $myrow['stockid'], @@ -2087,9 +2099,6 @@ $DemandQty, $OnOrder, $Available, - $ImageSource, - $rootpath, - SID, $myrow['stockid']); if ($j==1) { $jsCall = '<script type="text/javascript">if (document.SelectParts) {defaultControl(document.SelectParts.itm'.$myrow['stockid'].');}</script>'; @@ -2110,20 +2119,20 @@ echo '<table class="selection"><tr><td><b>' . _('Select a Stock Category') . ': </b><select tabindex="1" name="StockCat">'; if (!isset($_POST['StockCat'])){ - echo "<option selected='True' value='All'>" . _('All').'</option>'; + echo '<option selected="true" value="All">' . _('All').'</option>'; $_POST['StockCat'] ='All'; } else { - echo "<option value='All'>" . _('All').'</option>'; + echo '<option value="All">' . _('All').'</option>'; } $SQL="SELECT categoryid, - categorydescription - FROM stockcategory - WHERE stocktype='F' OR stocktype='D' - ORDER BY categorydescription"; + categorydescription + FROM stockcategory + WHERE stocktype='F' OR stocktype='D' + ORDER BY categorydescription"; $result1 = DB_query($SQL,$db); while ($myrow1 = DB_fetch_array($result1)) { if ($_POST['StockCat']==$myrow1['categoryid']){ - echo '<option selected="True" value="' . $myrow1['categoryid'] . '">' . $myrow1['categorydescription'].'</option>'; + echo '<option selected="true" value="' . $myrow1['categoryid'] . '">' . $myrow1['categorydescription'].'</option>'; } else { echo '<option value="'. $myrow1['categoryid'] . '">' . $myrow1['categorydescription'].'</option>'; } @@ -2180,22 +2189,22 @@ // Find the quantity in stock at location $QOHSql = "SELECT sum(quantity) AS QOH, - stockmaster.decimalplaces - FROM locstock INNER JOIN stockmaster - WHERE locstock.stockid='" .$myrow['stockid'] . "' - AND loccode = '" . $_SESSION['Items'.$identifier]->Location . "'"; + stockmaster.decimalplaces + FROM locstock INNER JOIN stockmaster + WHERE locstock.stockid='" .$myrow['stockid'] . "' + AND loccode = '" . $_SESSION['Items'.$identifier]->Location . "'"; $QOHResult = DB_query($QOHSql,$db); $QOHRow = DB_fetch_array($QOHResult); $QOH = $QOHRow['QOH']; // Find the quantity on outstanding sales orders $sql = "SELECT SUM(salesorderdetails.quantity-salesorderdetails.qtyinvoiced) AS dem - FROM salesorderdetails INNER JOIN salesorders - ON salesorders.orderno = salesorderdetails.orderno - WHERE salesorders.fromstkloc='" . $_SESSION['Items'.$identifier]->Location . "' - AND salesorderdetails.completed=0 - AND salesorders.quotation=0 - AND salesorderdetails.stkcode='" . $myrow['stockid'] . "'"; + FROM salesorderdetails INNER JOIN salesorders + ON salesorders.orderno = salesorderdetails.orderno + WHERE salesorders.fromstkloc='" . $_SESSION['Items'.$identifier]->Location . "' + AND salesorderdetails.completed=0 + AND salesorders.quotation=0 + AND salesorderdetails.stkcode='" . $myrow['stockid'] . "'"; $ErrMsg = _('The demand for this product from') . ' ' . $_SESSION['Items'.$identifier]->Location . ' ' . _('cannot be retrieved because'); $DemandResult = DB_query($sql,$db,$ErrMsg); @@ -2227,8 +2236,8 @@ // Find the quantity on works orders $sql = "SELECT SUM(woitems.qtyreqd - woitems.qtyrecd) AS dedm - FROM woitems - WHERE stockid='" . $myrow['stockid'] ."'"; + FROM woitems + WHERE stockid='" . $myrow['stockid'] ."'"; $ErrMsg = _('The order details for this product cannot be retrieved because'); $WoResult = db_query($sql,$db,$ErrMsg); @@ -2251,26 +2260,22 @@ $Available = $qoh - $DemandQty + $OnOrder; printf('<td>%s</td> - <td>%s</td> - <td>%s</td> - <td class="number">%s</td> - <td class="number">%s</td> - <td class="number">%s</td> - <td class="number">%s</td> - <td><font size="1"><input class="number" tabindex="'.number_format($j+7).'" type="textbox" size="6" name="itm'.$myrow['stockid'].'" value="0" /> - </font></td> - </tr>', - $myrow['stockid'], - $myrow['description'], - $myrow['units'], - number_format($QOH, $QOHRow['decimalplaces']), - number_format($DemandQty, $QOHRow['decimalplaces']), - number_format($OnOrder, $QOHRow['decimalplaces']), - number_format($Available, $QOHRow['decimalplaces']), - $ImageSource, - $rootpath, - SID, - $myrow['stockid']); + <td>%s</td> + <td>%s</td> + <td class="number">%s</td> + <td class="number">%s</td> + <td class="number">%s</td> + <td class="number">%s</td> + <td><font size="1"><input class="number" tabindex="'.number_format($j+7).'" type="textbox" size="6" name="itm%s" value="0" /></font></td> + </tr>', + $myrow['stockid'], + $myrow['description'], + $myrow['units'], + number_format($QOH, $QOHRow['decimalplaces']), + number_format($DemandQty, $QOHRow['decimalplaces']), + number_format($OnOrder, $QOHRow['decimalplaces']), + number_format($Available, $QOHRow['decimalplaces']), + $myrow['stockid']); if ($j==1) { $jsCall = '<script type="text/javascript">if (document.SelectParts) {defaultControl(document.SelectParts.itm'.$myrow['stockid'].');}</script>'; } @@ -2295,12 +2300,12 @@ else { /* show the quick entry form variable */ echo '<div class="page_help_text"><b>' . _('Use this form to add items quickly if the item codes are already known') . '</b></div><br /> - <table border="1"> - <tr>'; + <table border="1"> + <tr>'; /*do not display colum unless customer requires po line number by sales order line*/ echo '<th>' . _('Item Code') . '</th> - <th>' . _('Quantity') . '</th> - </tr>'; + <th>' . _('Quantity') . '</th> + </tr>'; $DefaultDeliveryDate = DateAdd(Date($_SESSION['DefaultDateFormat']),'d',$_SESSION['Items'.$identifier]->DeliveryDays); if (count($_SESSION['Items'.$identifier]->LineItems)==0) { echo '<input type="hidden" name="CustRef" value="'.$_SESSION['Items'.$identifier]->CustRef.'" />'; @@ -2315,8 +2320,7 @@ /* Do not display colum unless customer requires po line number by sales order line*/ echo '<td><input type="text" name="part_' . $i . '" size="21" maxlength="20" /></td> <td><input type="text" class="number" name="qty_' . $i . '" size="6" maxlength="6" /></td> - <input type="hidden" class="date" name="ItemDue_' . $i . '" - value="' . $DefaultDeliveryDate . '" /></tr>'; + <input type="hidden" class="date" name="ItemDue_' . $i . '" value="' . $DefaultDeliveryDate . '" /></tr>'; } echo '<script type="text/javascript">if (document.SelectParts) {defaultControl(document.SelectParts.part_1);}</script>'; @@ -2330,4 +2334,4 @@ } echo '</form>'; include('includes/footer.inc'); -?> +?> \ No newline at end of file Modified: trunk/CustomerInquiry.php =================================================================== --- trunk/CustomerInquiry.php 2011-07-17 03:31:55 UTC (rev 4634) +++ trunk/CustomerInquiry.php 2011-07-19 09:35:25 UTC (rev 4635) @@ -103,7 +103,7 @@ INNER JOIN holdreasons ON debtorsmaster.holdreason = holdreasons.reasoncode INNER JOIN currencies - debtorsmaster.currcode = currencies.currabrev + ON debtorsmaster.currcode = currencies.currabrev WHERE debtorsmaster.debtorno = '" . $CustomerID . "'"; $ErrMsg =_('The customer details could not be retrieved by the SQL because'); Modified: trunk/FixedAssetItems.php =================================================================== --- trunk/FixedAssetItems.php 2011-07-17 03:31:55 UTC (rev 4634) +++ trunk/FixedAssetItems.php 2011-07-19 09:35:25 UTC (rev 4635) @@ -123,28 +123,35 @@ $result = DB_Txn_Begin($db); /*Need to check if changing the balance sheet codes - as will need to do journals for the cost and accum depn of the asset to the new category */ - $result = DB_query("SELECT assetcategoryid, cost, accumdepn, costact, accumdepnact FROM fixedassets INNER JOIN fixedassetcategories WHERE assetid='" . $AssetID . "'",$db); + $result = DB_query("SELECT assetcategoryid, + cost, + accumdepn, + costact, + accumdepnact + FROM fixedassets INNER JOIN fixedassetcategories + ON fixedassets.assetcategoryid=fixedassetcategories.categoryid + WHERE assetid='" . $AssetID . "'",$db); $OldDetails = DB_fetch_array($result); if ($OldDetails['assetcategoryid'] !=$_POST['AssetCategoryID'] AND $OldDetails['cost']!=0){ $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); + accumdepnact + FROM fixedassetcategories + WHERE categoryid='" . $_POST['AssetCategoryID'] . "'",$db); $NewAccounts = DB_fetch_array($result); $TransNo = GetNextTransNo( 42, $db); /* transaction type is asset category change */ //credit cost for the old category $SQL = "INSERT INTO gltrans (type, - typeno, - trandate, - periodno, - account, - narrative, - amount) + typeno, + trandate, + periodno, + account, + narrative, + amount) VALUES ('42', '" . $TransNo . "', '" . Date('Y-m-d') . "', @@ -159,12 +166,12 @@ //debit cost for the new category $SQL = "INSERT INTO gltrans (type, - typeno, - trandate, - periodno, - account, - narrative, - amount) + typeno, + trandate, + periodno, + account, + narrative, + amount) VALUES ('42', '" . $TransNo . "', '" . Date('Y-m-d') . "', @@ -179,12 +186,12 @@ if ($OldDetails['accumdepn']!=0) { //debit accumdepn for the old category $SQL = "INSERT INTO gltrans (type, - typeno, - trandate, - periodno, - account, - narrative, - amount) + typeno, + trandate, + periodno, + account, + narrative, + amount) VALUES ('42', '" . $TransNo . "', '" . Date('Y-m-d') . "', @@ -199,12 +206,12 @@ //credit accum depn for the new category $SQL = "INSERT INTO gltrans (type, - typeno, - trandate, - periodno, - account, - narrative, - amount) + typeno, + trandate, + periodno, + account, + narrative, + amount) VALUES ('42', '" . $TransNo . "', '" . Date('Y-m-d') . "', @@ -237,13 +244,13 @@ echo '<br />'; } else { //it is a NEW part $sql = "INSERT INTO fixedassets (description, - longdescription, - assetcategoryid, - assetlocation, - depntype, - depnrate, - barcode, - serialno) + longdescription, + assetcategoryid, + assetlocation, + depntype, + depnrate, + barcode, + serialno) VALUES ( '" . $_POST['Description'] . "', '" . $_POST['LongDescription'] . "', @@ -278,12 +285,12 @@ $CancelDelete = 0; //what validation is required before allowing deletion of assets .... maybe there should be no deletion option? $result = DB_query("SELECT cost, - accumdepn, - accumdepnact, - costact - FROM fixedassets INNER JOIN fixedassetcategories - ON fixedassets.assetcategoryid=fixedassetcategories.categoryid - WHERE assetid='" . $AssetID . "'", $db); + accumdepn, + accumdepnact, + costact + FROM fixedassets INNER JOIN fixedassetcategories + ON fixedassets.assetcategoryid=fixedassetcategories.categoryid + WHERE assetid='" . $AssetID . "'", $db); $AssetRow = DB_fetch_array($result); $NBV = $AssetRow['cost'] -$AssetRow['accumdepn']; if ($NBV!=0) { @@ -309,12 +316,12 @@ if ($AssetRow['cost'] > 0){ //credit cost for the asset deleted $SQL = "INSERT INTO gltrans (type, - typeno, - trandate, - periodno, - account, - narrative, - amount) + typeno, + trandate, + periodno, + account, + narrative, + amount) VALUES ('43', '" . $TransNo . "', '" . Date('Y-m-d') . "', @@ -329,12 +336,12 @@ //debit accumdepn for the depreciation removed on deletion of this asset $SQL = "INSERT INTO gltrans (type, - typeno, - trandate, - periodno, - account, - narrative, - amount) + typeno, + trandate, + periodno, + account, + narrative, + amount) VALUES ('43', '" . $TransNo . "', '" . Date('Y-m-d') . "', @@ -394,19 +401,19 @@ } elseif ($InputError!=1) { // Must be modifying an existing item and no changes made yet - need to lookup the details $sql = "SELECT assetid, - description, - longdescription, - assetcategoryid, - serialno, - assetlocation, - datepurchased, - depntype, - depnrate, - cost, - accumdepn, - barcode - FROM fixedassets - WHERE assetid ='" . $AssetID . "'"; + description, + longdescription, + assetcategoryid, + serialno, + assetlocation, + datepurchased, + depntype, + depnrate, + cost, + accumdepn, + barcode + FROM fixedassets + WHERE assetid ='" . $AssetID . "'"; $result = DB_query($sql, $db); $AssetRow = DB_fetch_array($result); @@ -441,14 +448,14 @@ } else { $LongDescription =''; } -echo '<tr><td>' . _('Asset Description') . ' (' . _('long') . '):</td><td><textarea ' . (in_array('LongDescription',$Errors) ? 'class="texterror"' : '' ) .' name="LongDescription" cols=40 rows=4>' . stripslashes($LongDescription) . '</textarea></td></tr>'."\n"; +echo '<tr><td>' . _('Asset Description') . ' (' . _('long') . '):</td><td><textarea ' . (in_array('LongDescription',$Errors) ? 'class="texterror"' : '' ) .' name="LongDescription" cols=40 rows=4>' . stripslashes($LongDescription) . '</textarea></td></tr>'; if (!isset($New) ) { //ie not new at all! echo '<tr><td>'. _('Image File (.jpg)') . ':</td><td><input type="file" id="ItemPicture" name="ItemPicture"></td>'; if (function_exists('imagecreatefromjpg')){ - $StockImgLink = '<img src="GetStockImage.php?automake=1&textcolor=FFFFFF&bgcolor=CCCCCC'. + $AssetImgLink = '<img src="GetStockImage.php?automake=1&textcolor=FFFFFF&bgcolor=CCCCCC'. '&AssetID='.urlencode($AssetID). '&text='. '&width=64'. @@ -473,16 +480,16 @@ echo '<tr><td>' . _('Asset Category') . ':</td><td><select name="AssetCategoryID">'; -$sql = 'SELECT categoryid, categorydescription FROM fixedassetcategories'; +$sql = "SELECT categoryid, categorydescription FROM fixedassetcategories"; $ErrMsg = _('The asset categories could not be retrieved because'); $DbgMsg = _('The SQL used to retrieve stock categories and failed was'); $result = DB_query($sql,$db,$ErrMsg,$DbgMsg); while ($myrow=DB_fetch_array($result)){ if (!isset($_POST['AssetCategoryID']) or $myrow['categoryid']==$_POST['AssetCategoryID']){ - echo '<option selected VALUE="'. $myrow['categoryid'] . '">' . $myrow['categorydescription'] . '</option>'; + echo '<option selected value="'. $myrow['categoryid'] . '">' . $myrow['categorydescription'] . '</option>'; } else { - echo '<option VALUE="'. $myrow['categoryid'] . '">' . $myrow['categorydescription']. '</option>'; + echo '<option value="'. $myrow['categoryid'] . '">' . $myrow['categorydescription']. '</option>'; } $category=$myrow['categoryid']; } @@ -495,7 +502,7 @@ echo '<tr><td>' . _('Date Purchased') . ':</td><td>' . ConvertSQLDate($AssetRow['datepurchased']) . '</td></tr>'; } -$sql = 'SELECT locationid, locationdescription FROM fixedassetlocations'; +$sql = "SELECT locationid, locationdescription FROM fixedassetlocations"; $ErrMsg = _('The asset locations could not be retrieved because'); $DbgMsg = _('The SQL used to retrieve asset locations and failed was'); $result = DB_query($sql,$db,$ErrMsg,$DbgMsg); @@ -536,17 +543,17 @@ /*Get the last period depreciation (depn is transtype =44) was posted for */ echo '<table><tr><th colspan=2>' . _('Asset Financial Summary') . '</th></tr>'; -echo '<tr><td>' . _('Accumulated Costs') . ':</td><td class="number">' . number_format($AssetRow['cost'],2) . '</td></tr>'; -echo '<tr><td>' . _('Accumulated Depreciation') . ':</td><td class="number">' . number_format($AssetRow['accumdepn'],2) . '</td></tr>'; -echo '<tr><td>' . _('Net Book Value') . ':</td><td class="number">' . number_format($AssetRow['cost']-$AssetRow['accumdepn'],2) . '</td></tr>'; +echo '<tr><td>' . _('Accumulated Costs') . ':</td><td class="number">' . number_format($AssetRow['cost'],$_SESSION['CompanyRecord']['decimalplaces']) . '</td></tr>'; +echo '<tr><td>' . _('Accumulated Depreciation') . ':</td><td class="number">' . number_format($AssetRow['accumdepn'],$_SESSION['CompanyRecord']['decimalplaces']) . '</td></tr>'; +echo '<tr><td>' . _('Net Book Value') . ':</td><td class="number">' . number_format($AssetRow['cost']-$AssetRow['accumdepn'],$_SESSION['CompanyRecord']['decimalplaces']) . '</td></tr>'; -$result = DB_query('SELECT periods.lastdate_in_period, +$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); + ORDER BY periods.lastdate_in_period DESC",$db); $LastDepnRun = DB_fetch_row($result); if(DB_num_rows($result)==0){ @@ -559,13 +566,13 @@ if (isset($New)) { - echo '<div class=centre><br /><input type="Submit" name="submit" value="' . _('Insert New Fixed Asset') . '">'; + echo '<div class="centre"><br /><input type="submit" name="submit" value="' . _('Insert New Fixed Asset') . '">'; } else { - echo '<br /><div class=centre><input type="submit" name="submit" value="' . _('Update') . '"></div>'; + echo '<br /><div class="centre"><input type="submit" name="submit" value="' . _('Update') . '"></div>'; prnMsg( _('Only click the Delete button if you are sure you wish to delete the asset. Only assets with a zero book value can be deleted'), 'warn', _('WARNING')); - echo '<br /><div class=centre><input type="Submit" name="delete" value="' . _('Delete This Asset') . '" onclick="return confirm(\'' . _('Are You Sure? Only assets with a zero book value can be deleted.') . '\');"></div>'; + echo '<br /><div class="centre"><input type="submit" name="delete" value="' . _('Delete This Asset') . '" onclick="return confirm(\'' . _('Are You Sure? Only assets with a zero book value can be deleted.') . '\');"></div>'; } echo '</form></div>'; Modified: trunk/FixedAssetRegister.php =================================================================== --- trunk/FixedAssetRegister.php 2011-07-17 03:31:55 UTC (rev 4634) +++ trunk/FixedAssetRegister.php 2011-07-19 09:35:25 UTC (rev 4635) @@ -73,10 +73,10 @@ } elseif (isset($_POST['csv'])) { $csv_output = "'Asset ID','Description','Serial Number','Location','Date Acquired','Cost B/Fwd','Period Additions','Depn B/Fwd','Period Depreciation','Cost C/Fwd', 'Accum Depn C/Fwd','NBV','Disposal Value'\n"; } else { - echo '<form name="RegisterForm" method="post" action="' . $_SERVER['PHP_SELF'] . '?' . SID . '"><table class=selection>'; + echo '<form name="RegisterForm" method="post" action="' . $_SERVER['PHP_SELF'] . '?' . SID . '"><table class="selection">'; echo '<input type="hidden" name="FormID" value="' . $_SESSION['FormID'] . '" />'; echo '<div class="centre">' ._('From') . ':' . $_POST['FromDate'] . ' ' . _('to') . ' ' . $_POST['ToDate'] . '</div>'; - echo '<br /><table width=80% cellspacing="1" class=selection><tr>'; + echo '<br /><table width=80% cellspacing="1" class="selection"><tr>'; echo '<th>' . _('Asset ID') . '</th>'; echo '<th>' . _('Description') . '</th>'; echo '<th>' . _('Serial Number') . '</th>'; @@ -196,13 +196,13 @@ if (isset($_POST['pdf'])) { $LeftOvers = $pdf->addTextWrap($XPos, $YPos, 300 - $Left_Margin, $FontSize, _('TOTAL')); - $LeftOvers = $pdf->addTextWrap($XPos + 270, $YPos, 70, $FontSize, number_format($TotalCostBfwd, 0), 'right'); - $LeftOvers = $pdf->addTextWrap($XPos + 340, $YPos, 70, $FontSize, number_format($TotalDepnBfwd, 0), 'right'); - $LeftOvers = $pdf->addTextWrap($XPos + 410, $YPos, 70, $FontSize, number_format($TotalAdditions, 0), 'right'); - $LeftOvers = $pdf->addTextWrap($XPos + 480, $YPos, 70, $FontSize, number_format($TotalDepn, 0), 'right'); - $LeftOvers = $pdf->addTextWrap($XPos + 550, $YPos, 70, $FontSize, number_format($TotalCostCfwd, 0), 'right'); - $LeftOvers = $pdf->addTextWrap($XPos + 620, $YPos, 70, $FontSize, number_format($TotalDepnCfwd, 0), 'right'); - $LeftOvers = $pdf->addTextWrap($XPos + 690, $YPos, 70, $FontSize, number_format($TotalNBV, 0), 'right'); + $LeftOvers = $pdf->addTextWrap($XPos + 270, $YPos, 70, $FontSize, number_format($TotalCostBfwd, $_SESSION['CompanyRecord']['decimalplaces']), 'right'); + $LeftOvers = $pdf->addTextWrap($XPos + 340, $YPos, 70, $FontSize, number_format($TotalDepnBfwd, $_SESSION['CompanyRecord']['decimalplaces']), 'right'); + $LeftOvers = $pdf->addTextWrap($XPos + 410, $YPos, 70, $FontSize, number_format($TotalAdditions, $_SESSION['CompanyRecord']['decimalplaces']), 'right'); + $LeftOvers = $pdf->addTextWrap($XPos + 480, $YPos, 70, $FontSize, number_format($TotalDepn, $_SESSION['CompanyRecord']['decimalplaces']), 'right'); + $LeftOvers = $pdf->addTextWrap($XPos + 550, $YPos, 70, $FontSize, number_format($TotalCostCfwd, $_SESSION['CompanyRecord']['decimalplaces']), 'right'); + $LeftOvers = $pdf->addTextWrap($XPos + 620, $YPos, 70, $FontSize, number_format($TotalDepnCfwd, $_SESSION['CompanyRecord']['decimalplaces']), 'right'); + $LeftOvers = $pdf->addTextWrap($XPos + 690, $YPos, 70, $FontSize, number_format($TotalNBV, $_SESSION['CompanyRecord']['decimalplaces']), 'right'); $pdf->Output($_SESSION['DatabaseName'] . '_Asset Register_' . date('Y-m-d') . '.pdf', 'I'); exit; @@ -213,11 +213,11 @@ header('Location: ' .$_SESSION['reports_dir'] . '/FixedAssetRegister_' . Date('Y-m-d') .'.csv'); } else { - echo '<input type=hidden name=FromDate value="' . $_POST['FromDate'] . '">'; - echo '<input type=hidden name=ToDate value=' . $_POST['ToDate'] . '>'; - echo '<input type=hidden name=AssetCategory value=' . $_POST['AssetCategory'] . '>'; - echo '<input type=hidden name=AssetID value=' . $_POST['AssetID'] . '>'; - echo '<input type=hidden name=AssetLocation value=' . $_POST['AssetLocation'] . '>'; + echo '<input type=hidden name="FromDate" value="' . $_POST['FromDate'] . '">'; + echo '<input type=hidden name="ToDate" value=' . $_POST['ToDate'] . '>'; + echo '<input type=hidden name="AssetCategory" value=' . $_POST['AssetCategory'] . '>'; + echo '<input type=hidden name="AssetID" value=' . $_POST['AssetID'] . '>'; + echo '<input type=hidden name="AssetLocation" value=' . $_POST['AssetLocation'] . '>'; //Total Values echo '<tr><th style="vertical-align:top" colspan="5">' . _('TOTAL') . '</th>'; echo '<th style="text-align:right">' . number_format($TotalCostBfwd, $_SESSION['CompanyRecord']['decimalplaces']) . '</th>'; @@ -253,7 +253,7 @@ $sql = "SELECT locationid, locationdescription FROM fixedassetlocations"; $result = DB_query($sql, $db); echo '<tr><th>' . _('Asset Location') . '</th>'; - echo '<td><select name=AssetLocation>'; + echo '<td><select name="AssetLocation">'; echo '<option value="%">' . _('ALL') . '</option>'; while ($myrow = DB_fetch_array($result)) { if (isset($_POST['AssetLocation']) AND $myrow['locationid'] == $_POST['AssetLocation']) { @@ -290,7 +290,7 @@ </table> <br />'; - echo '<div class="centre"><input type="Submit" name="submit" value="' . _('Show Assets') . '"> '; + echo '<div class="centre"><input type="submit" name="submit" value="' . _('Show Assets') . '"> '; echo '<input type="Submit" name="pdf" value="' . _('Print as a pdf') . '"> '; echo '<input type="Submit" name = "csv" value= "' . _('Print as CSV') . '"></div>'; echo '</form>'; Modified: trunk/FixedAssetTransfer.php =================================================================== --- trunk/FixedAssetTransfer.php 2011-07-17 03:31:55 UTC (rev 4634) +++ trunk/FixedAssetTransfer.php 2011-07-19 09:35:25 UTC (rev 4635) @@ -24,25 +24,25 @@ } else if (isset($_POST['AssetID'])) { $AssetID=$_POST['AssetID']; } else { - $sql='SELECT categoryid, categorydescription FROM fixedassetcategories'; + $sql="SELECT categoryid, categorydescription FROM fixedassetcategories"; $result=DB_query($sql, $db); echo '<form action="'. $_SERVER['PHP_SELF'] . '" method=post>'; echo '<input type="hidden" name="FormID" value="' . $_SESSION['FormID'] . '" />'; echo '<p class="page_title_text"><img src="'.$rootpath.'/css/'.$theme.'/images/magnifier.png" title="' . _('Search') . '" alt="" />' . ' ' . $title . '</p>'; - echo '<table class=selection><tr>'; + echo '<table class="selection"><tr>'; echo '<td>'. _('In Asset Category') . ': '; echo '<select name="AssetCat">'; if (!isset($_POST['AssetCat'])) { - $_POST['AssetCat'] = ""; + $_POST['AssetCat'] = ''; } while ($myrow = DB_fetch_array($result)) { if ($myrow['categoryid'] == $_POST['AssetCat']) { - echo '<option selected VALUE="' . $myrow['categoryid'] . '">' . $myrow['categorydescription']; + echo '<option selected value="' . $myrow['categoryid'] . '">' . $myrow['categorydescription'] . '</option>'; } else { - echo '<option value="' . $myrow['categoryid'] . '">' . $myrow['categorydescription']; + echo '<option value="' . $myrow['categoryid'] . '">' . $myrow['categorydescription'] . '</option>'; } } @@ -88,14 +88,14 @@ } $sql= "SELECT fixedassets.assetid, - fixedassets.cost, - fixedassets.accumdepn, - fixedassets.description, - fixedassets.depntype, - fixedassets.serialno, - fixedassets.barcode, - fixedassets.assetlocation, - fixedassetlocations.locationdescription + fixedassets.cost, + fixedassets.accumdepn, + fixedassets.description, + fixedassets.depntype, + fixedassets.serialno, + fixedassets.barcode, + fixedassets.assetlocation, + fixedassetlocations.locationdescription FROM fixedassets INNER JOIN fixedassetlocations ON fixedassets.assetlocation=fixedassetlocations.locationid @@ -115,7 +115,7 @@ <th>' . _('Move To :') . '</th> </tr>'; - $locationsql='SELECT locationid, locationdescription from fixedassetlocations'; + $locationsql="SELECT locationid, locationdescription from fixedassetlocations"; $LocationResult=DB_query($locationsql, $db); while ($myrow=DB_fetch_array($Result)) { @@ -123,8 +123,8 @@ echo '<tr><td>'.$myrow['assetid'].'</td> <td>'.$myrow['description'].'</td> <td>'.$myrow['serialno'].'</td> - <td class=number>'.number_format($myrow['cost'],2).'</td> - <td class=number>'.number_format($myrow['accumdepn'],2).'</td> + <td class="number">'.number_format($myrow['cost'],$_SESSION['CompanyRecord']['decimalplaces']).'</td> + <td class="number">'.number_format($myrow['accumdepn'],$_SESSION['CompanyRecord']['decimalplaces']).'</td> <td>'.$myrow['locationdescription'].'</td>'; echo '<td><select name="Location'.$myrow['assetid'].'" onChange="ReloadForm(Move'.$myrow['assetid'].')">'; echo '<option></option>'; @@ -141,7 +141,7 @@ echo '<input type="hidden" name="Keywords" value="' . $_POST['Keywords'].'"'; echo '<input type="hidden" name="AssetID" value="' . $_POST['AssetID'].'"'; echo '<input type="hidden" name="Search" value="' . $_POST['Search'].'"'; - echo '<td><input type="submit" name="Move'.$myrow['assetid'].'" value=Move></td>'; + echo '<td><input type="submit" name="Move'.$myrow['assetid'].'" value="Move"></td>'; echo '</tr>'; } echo '</table></form>'; Modified: trunk/InventoryPlanning.php =================================================================== --- trunk/InventoryPlanning.php 2011-07-17 03:31:55 UTC (rev 4634) +++ trunk/InventoryPlanning.php 2011-07-19 09:35:25 UTC (rev 4635) @@ -2,7 +2,6 @@ /* $Id$ */ -//$PageSecurity = 2; include('includes/session.inc'); if (isset($_POST['PrintPDF']) @@ -53,26 +52,26 @@ need QOH, QOO, QDem, Sales Mth -1, Sales Mth -2, Sales Mth -3, Sales Mth -4*/ if ($_POST['Location']=='All'){ $SQL = "SELECT stockmaster.categoryid, - stockmaster.description, - stockcategory.categorydescription, - locstock.stockid, - SUM(locstock.quantity) AS qoh - FROM locstock, - stockmaster, - stockcategory - WHERE locstock.stockid=stockmaster.stockid - AND stockmaster.discontinued = 0 - AND stockmaster.categoryid=stockcategory.categoryid - AND (stockmaster.mbflag='B' OR stockmaster.mbflag='M') - AND stockmaster.categoryid >= '" . $_POST['FromCriteria'] . "' - AND stockmaster.categoryid <= '" . $_POST['ToCriteria'] . "' - GROUP BY stockmaster.categoryid, - stockmaster.description, - stockcategory.categorydescription, - locstock.stockid, - stockmaster.stockid - ORDER BY stockmaster.categoryid, - stockmaster.stockid"; + stockmaster.description, + stockcategory.categorydescription, + locstock.stockid, + SUM(locstock.quantity) AS qoh + FROM locstock, + stockmaster, + stockcategory + WHERE locstock.stockid=stockmaster.stockid + AND stockmaster.discontinued = 0 + AND stockmaster.categoryid=stockcategory.categoryid + AND (stockmaster.mbflag='B' OR stockmaster.mbflag='M') + AND stockmaster.categoryid >= '" . $_POST['FromCriteria'] . "' + AND stockmaster.categoryid <= '" . $_POST['ToCriteria'] . "' + GROUP BY stockmaster.categoryid, + stockmaster.description, + stockcategory.categorydescription, + locstock.stockid, + stockmaster.stockid + ORDER BY stockmaster.categoryid, + stockmaster.stockid"; } else { $SQL = "SELECT stockmaster.categoryid, locstock.stockid, @@ -99,9 +98,9 @@ $title = _('Inventory Planning') . ' - ' . _('Problem Report') . '....'; include('includes/header.inc'); prnMsg(_('The inventory quantities 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; @@ -145,27 +144,27 @@ if ($_POST['Location']=='All'){ $SQL = "SELECT SUM(CASE WHEN prd='" . $CurrentPeriod . "' THEN -qty ELSE 0 END) AS prd0, - SUM(CASE WHEN prd='" . $Period_1 . "' THEN -qty ELSE 0 END) AS prd1, - SUM(CASE WHEN prd='" . $Period_2 . "' THEN -qty ELSE 0 END) AS prd2, - SUM(CASE WHEN prd='" . $Period_3 . "' THEN -qty ELSE 0 END) AS prd3, - SUM(CASE WHEN prd='" . $Period_4 . "' THEN -qty ELSE 0 END) AS prd4, - SUM(CASE WHEN prd='" . $Period_5 . "' THEN -qty ELSE 0 END) AS prd5 - FROM stockmoves - WHERE stockid='" . $InventoryPlan['stockid'] . "' - AND (type=10 OR type=11) - AND stockmoves.hidemovt=0"; + SUM(CASE WHEN prd='" . $Period_1 . "' THEN -qty ELSE 0 END) AS prd1, + SUM(CASE WHEN prd='" . $Period_2 . "' THEN -qty ELSE 0 END) AS prd2, + SUM(CASE WHEN prd='" . $Period_3 . "' THEN -qty ELSE 0 END) AS prd3, + SUM(CASE WHEN prd='" . $Period_4 . "' THEN -qty ELSE 0 END) AS prd4, + SUM(CASE WHEN prd='" . $Period_5 . "' THEN -qty ELSE 0 END) AS prd5 + FROM stockmoves + WHERE stockid='" . $InventoryPlan['stockid'] . "' + AND (type=10 OR type=11) + AND stockmoves.hidemovt=0"; } else { $SQL = "SELECT SUM(CASE WHEN prd='" . $CurrentPeriod . "' THEN -qty ELSE 0 END) AS prd0, - SUM(CASE WHEN prd='" . $Period_1 . "' THEN -qty ELSE 0 END) AS prd1, - SUM(CASE WHEN prd='" . $Period_2 . "' THEN -qty ELSE 0 END) AS prd2, - SUM(CASE WHEN prd='" . $Period_3 . "' THEN -qty ELSE 0 END) AS prd3, - SUM(CASE WHEN prd='" . $Period_4 . "' THEN -qty ELSE 0 END) AS prd4, - SUM(CASE WHEN prd='" . $Period_5 . "' THEN -qty ELSE 0 END) AS prd5 - FROM stockmoves - WHERE stockid='" . $InventoryPlan['stockid'] . "' - AND stockmoves.loccode ='" . $_POST['Location'] . "' - AND (stockmoves.type=10 OR stockmoves.type=11) - AND stockmoves.hidemovt=0"; + SUM(CASE WHEN prd='" . $Period_1 . "' THEN -qty ELSE 0 END) AS prd1, + SUM(CASE WHEN prd='" . $Period_2 . "' THEN -qty ELSE 0 END) AS prd2, + SUM(CASE WHEN prd='" . $Period_3 . "' THEN -qty ELSE 0 END) AS prd3, + SUM(CASE WHEN prd='" . $Period_4 . "' THEN -qty ELSE 0 END) AS prd4, + SUM(CASE WHEN prd='" . $Period_5 . "' THEN -qty ELSE 0 END) AS prd5 + FROM stockmoves + WHERE stockid='" . $InventoryPlan['stockid'] . "' + AND stockmoves.loccode ='" . $_POST['Location'] . "' + AND (stockmoves.type=10 OR stockmoves.type=11) + AND stockmoves.hidemovt=0"; } $SalesResult = DB_query($SQL,$db,'','', false, false); @@ -174,9 +173,9 @@ $title = _('Inventory Planning') . ' - ' . _('Problem Report') . '....'; include('includes/header.inc'); prnMsg( _('The sales quantities 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'); @@ -209,9 +208,9 @@ $title = _('Inventory Planning') . ' - ' . _('Problem Report') . '....'; include('includes/header.inc'); prnMsg( _('The sales order demand quantities could not be retrieved by the SQL because') . ' - ' . DB_error_msg($db),'error'); - echo "<br /><a href='" .$rootpath ."/index.php?" . SID . "'>" . _('Back to the menu') . '</a>'; + echo '<br /><a href="' .$rootpath .'/index.php">' . _('Back to the menu') . '</a>'; if ($debug==1){ - echo "<br />$SQL"; + echo '<br />'.$SQL; } include('includes/footer.inc'); exit; @@ -257,9 +256,9 @@ $title = _('Inventory Planning') . ' - ' . _('Problem Report') . '....'; include('includes/header.inc'); prnMsg( _('The sales order demand quantities from parent assemblies 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; @@ -267,23 +266,23 @@ if ($_POST['Location']=='All'){ $SQL = "SELECT SUM(purchorderdetails.quantityord - purchorderdetails.quantityrecd) as qtyonorder - FROM purchorderdetails INNER JOIN purchorders - ON purchorderdetails.orderno = purchorders.orderno - WHERE purchorderdetails.itemcode = '" . $InventoryPlan['stockid'] . "' - AND purchorderdetails.completed = 0 - AND purchorders.status <> 'Cancelled' - AND purchorders.status <> 'Rejected' - AND purchorders.status <> 'Pending'"; + FROM purchorderdetails INNER JOIN purchorders + ON purchorderdetails.orderno = purchorders.orderno + WHERE purchorderdetails.itemcode = '" . $InventoryPlan['stockid'] . "' + AND purchorderdetails.completed = 0 + AND purchorders.status <> 'Cancelled' + AND purchorders.status <> 'Rejected' + AND purchorders.status <> 'Pending'"; } else { $SQL = "SELECT SUM(purchorderdetails.quantityord - purchorderdetails.quantityrecd) as qtyonorder - FROM purchorderdetails INNER JOIN purchorders - ON purchorderdetails.orderno = purchorders.orderno - WHERE purchorderdetails.itemcode = '" . $InventoryPlan['stockid'] . "' - AND purchorderdetails.completed = 0 - AND purchorders.intostoc... [truncated message content] |
From: <dai...@us...> - 2011-07-17 03:32:03
|
Revision: 4634 http://web-erp.svn.sourceforge.net/web-erp/?rev=4634&view=rev Author: daintree Date: 2011-07-17 03:31:55 +0000 (Sun, 17 Jul 2011) Log Message: ----------- credit tax cock-up fixed Modified Paths: -------------- trunk/Credit_Invoice.php trunk/SelectCreditItems.php trunk/SelectOrderItems.php trunk/doc/Change.log Modified: trunk/Credit_Invoice.php =================================================================== --- trunk/Credit_Invoice.php 2011-07-16 03:37:58 UTC (rev 4633) +++ trunk/Credit_Invoice.php 2011-07-17 03:31:55 UTC (rev 4634) @@ -181,7 +181,7 @@ } else { /* there are no stock movement records created for that invoice */ - echo '<div class="centre"><a href="' . $rootpath . '/index.php?' . SID . '">' . _('Back to the menu') . '</a></div>'; + echo '<div class="centre"><a href="' . $rootpath . '/index.php">' . _('Back to the menu') . '</a></div>'; prnMsg( _('There are no line items that were retrieved for this invoice') . '. ' . _('The automatic credit program can not create a credit note from this invoice'),'warn'); include('includes/footer.inc'); exit; @@ -350,9 +350,6 @@ $TaxLineTotal =0; //initialise tax total for the line if (is_array($LnItm->Taxes) ){ foreach ($LnItm->Taxes as $Tax) { - $TaxTotals[$Tax->TaxAuthID]=0; - } - foreach ($LnItm->Taxes as $Tax) { if ($i>0){ echo '<br />'; } @@ -673,9 +670,9 @@ if ($MBFlag=='B' OR $MBFlag=='M') { $SQL = "UPDATE locstock - SET locstock.quantity = locstock.quantity + " . $CreditLine->QtyDispatched . " - WHERE locstock.stockid = '" . $CreditLine->StockID . "' - AND loccode = '" . $_SESSION['CreditItems']->Location . "'"; + SET locstock.quantity = locstock.quantity + " . $CreditLine->QtyDispatched . " + WHERE locstock.stockid = '" . $CreditLine->StockID . "' + AND loccode = '" . $_SESSION['CreditItems']->Location . "'"; $ErrMsg = _('CRITICAL ERROR') . '! ' . _('NOTE DOWN THIS ERROR AND SEEK ASSISTANCE') . ': ' . _('Location stock record could not be updated because'); $DbgMsg = _('The following SQL to update the location stock record was used'); @@ -686,18 +683,17 @@ and of course update the Location stock balances */ $StandardCost =0; /*To start with - accumulate the cost of the comoponents for use in journals later on */ - $sql = "SELECT - bom.component, - bom.quantity, - stockmaster.materialcost - + stockmaster.labourcost - + stockmaster.overheadcost AS standard - FROM bom, - stockmaster - WHERE bom.component=stockmaster.stockid - AND bom.parent='" . $CreditLine->StockID . "' - AND bom.effectiveto > '" . Date('Y-m-d') . "' - AND bom.effectiveafter < '" . Date('Y-m-d') . "'"; + $sql = "SELECT bom.component, + bom.quantity, + stockmaster.materialcost + + stockmaster.labourcost + + stockmaster.overheadcost AS standard + FROM bom, + stockmaster + WHERE bom.component=stockmaster.stockid + AND bom.parent='" . $CreditLine->StockID . "' + AND bom.effectiveto > '" . Date('Y-m-d') . "' + AND bom.effectiveafter < '" . Date('Y-m-d') . "'"; $ErrMsg = _('Could not retrieve assembly components from the database for') . ' ' . $CreditLine->StockID . ' ' . _('because'); $DbgMsg = _('The SQL that failed was'); Modified: trunk/SelectCreditItems.php =================================================================== --- trunk/SelectCreditItems.php 2011-07-16 03:37:58 UTC (rev 4633) +++ trunk/SelectCreditItems.php 2011-07-17 03:31:55 UTC (rev 4634) @@ -20,7 +20,7 @@ if (isset($_POST['ProcessCredit']) AND !isset($_SESSION['CreditItems'])){ prnMsg(_('This credit note has already been processed. Refreshing the page will not enter the credit note again') . '<br />' . _('Please use the navigation links provided rather than using the browser back button and then having to refresh'),'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; } @@ -37,62 +37,66 @@ if (!isset($_SESSION['CreditItems'])){ /* It must be a new credit note being created $_SESSION['CreditItems'] would be set up from a previous call*/ - $_SESSION['CreditItems'] = new cart; + $_SESSION['CreditItems'] = new cart; - $_SESSION['RequireCustomerSelection'] = 1; + $_SESSION['RequireCustomerSelection'] = 1; } if (isset($_POST['ChangeCustomer'])){ - $_SESSION['RequireCustomerSelection']=1; + $_SESSION['RequireCustomerSelection']=1; } if (isset($_POST['Quick'])){ - unset($_POST['PartSearch']); + unset($_POST['PartSearch']); } if (isset($_POST['CancelCredit'])) { - unset($_SESSION['CreditItems']->LineItems); - unset($_SESSION['CreditItems']); - $_SESSION['CreditItems'] = new cart; - $_SESSION['RequireCustomerSelection'] = 1; + unset($_SESSION['CreditItems']->LineItems); + unset($_SESSION['CreditItems']); + $_SESSION['CreditItems'] = new cart; + $_SESSION['RequireCustomerSelection'] = 1; } if (isset($_POST['SearchCust']) AND $_SESSION['RequireCustomerSelection']==1){ - if ($_POST['Keywords'] AND $_POST['CustCode']) { + if ($_POST['Keywords'] AND $_POST['CustCode']) { prnMsg( _('Customer name keywords have been used in preference to the customer code extract entered'), 'info' ); - } - if ($_POST['Keywords']=='' AND $_POST['CustCode']=='') { + } + if ($_POST['Keywords']=='' AND $_POST['CustCode']=='') { prnMsg( _('At least one Customer Name keyword OR an extract of a Customer Code must be entered for the search'), 'info' ); - } else { - If (mb_strlen($_POST['Keywords'])>0) { + } else { + if (mb_strlen($_POST['Keywords'])>0) { //insert wildcard characters in spaces $SearchString = '%' . str_replace(' ', '%', $_POST['Keywords']) . '%'; - $SQL = 'SELECT - custbranch.debtorno, - custbranch.brname, - custbranch.contactname, - custbranch.phoneno, - custbranch.faxno, - custbranch.branchcode - FROM custbranch - WHERE custbranch.brname ' . LIKE . " '" . $SearchString . "' - AND custbranch.disabletrans='0'"; + $SQL = "SELECT debtorsmaster.name, + custbranch.debtorno, + custbranch.brname, + custbranch.contactname, + custbranch.phoneno, + custbranch.faxno, + custbranch.branchcode + FROM custbranch + INNER JOIN debtorsmaster + ON custbranch.debtorno=debtorsmaster.debtorno + WHERE custbranch.brname " . LIKE . " '" . $SearchString . "' + AND custbranch.disabletrans='0'"; } elseif (mb_strlen($_POST['CustCode'])>0){ - $SQL = 'SELECT - custbranch.debtorno, - custbranch.brname, - custbranch.contactname, - custbranch.phoneno, - custbranch.faxno, - custbranch.branchcode - FROM custbranch - WHERE custbranch.branchcode ' . LIKE . "'%" . $_POST['CustCode'] . "%' - AND custbranch.disabletrans='0'"; + $SQL = "SELECT debtorsmaster.name, + custbranch.debtorno, + custbranch.brname, + custbranch.contactname, + custbranch.phoneno, + custbranch.faxno, + custbranch.branchcode + FROM custbranch + INNER JOIN debtorsmaster + ON custbranch.debtorno=debtorsmaster.debtorno + WHERE custbranch.debtorno " . LIKE . "'%" . $_POST['CustCode'] . "%' + AND custbranch.disabletrans='0'"; } $ErrMsg = _('Customer branch records requested cannot be retrieved because'); @@ -102,7 +106,8 @@ if (DB_num_rows($result_CustSelect)==1){ $myrow=DB_fetch_array($result_CustSelect); - $_POST['Select'] = $myrow['debtorno'] . ' - ' . $myrow['branchcode']; + $SelectedCustomer = trim($myrow['debtorno']); + $SelectedBranch = trim($myrow['branchcode']); } elseif (DB_num_rows($result_CustSelect)==0){ prnMsg(_('Sorry') . ' ... ' . _('there are no customer branch records contain the selected text') . ' - ' . _('please alter your search criteria and try again'),'info'); } @@ -111,156 +116,156 @@ } /*end of if search button for customers was hit*/ -if (isset($_POST['Select']) AND $_POST['Select']!='') { +if (isset($_POST['JustSelectedACustomer']) AND !isset($SelectedCustomer)){ + /*Need to figure out the number of the form variable that the user clicked on */ + for ($i=1;$i<count($_POST);$i++){ //loop through the returned customers + if(isset($_POST['SubmitCustomerSelection'.$i])){ + break; + } + } + if ($i==count($_POST)){ + prnMsg(_('Unable to identify the selected customer'),'error'); + } else { + $SelectedCustomer = trim($_POST['SelectedCustomer'.$i]); + $SelectedBranch = trim($_POST['SelectedBranch'.$i]); + } +} + +if (isset($SelectedCustomer) AND isset($_POST['JustSelectedACustomer'])) { + /*will only be true if page called from customer selection form -parse the $Select string into customer code and branch code */ + Now retrieve customer information - name, salestype, currency, terms etc +*/ - $_SESSION['CreditItems']->Branch = mb_substr($_POST['Select'],mb_strpos($_POST['Select'],' - ')+3); - $_POST['Select'] = mb_substr($_POST['Select'],0,mb_strpos($_POST['Select'],' - ')); + $_SESSION['CreditItems']->DebtorNo = $SelectedCustomer; + $_SESSION['CreditItems']->Branch = $SelectedBranch; + $_SESSION['RequireCustomerSelection'] = 0; -/*Now retrieve customer information - name, salestype, currency, terms etc */ +/* default the branch information from the customer branches table CustBranch -particularly where the stock +will be booked back into. */ - $sql = "SELECT - debtorsmaster.name, - debtorsmaster.salestype, - debtorsmaster.currcode, - currencies.rate - FROM debtorsmaster, - currencies - WHERE debtorsmaster.currcode=currencies.currabrev - AND debtorsmaster.debtorno = '" . $_POST['Select'] . "'"; - - $ErrMsg = _('The customer record of the customer selected') . ': ' . $_POST['Select'] . ' ' . _('cannot be retrieved because'); - $DbgMsg = _('The SQL used to retrieve the customer details and failed was'); + $sql = "SELECT debtorsmaster.name, + debtorsmaster.salestype, + debtorsmaster.currcode, + currencies.rate, + currencies.decimalplaces, + custbranch.brname, + custbranch.braddress1, + custbranch.braddress2, + custbranch.braddress3, + custbranch.braddress4, + custbranch.braddress5, + custbranch.braddress6, + custbranch.phoneno, + custbranch.email, + custbranch.defaultlocation, + custbranch.taxgroupid, + locations.taxprovinceid + FROM custbranch + INNER JOIN locations ON locations.loccode=custbranch.defaultlocation + INNER JOIN debtorsmaster ON custbranch.debtorno=debtorsmaster.debtorno + INNER JOIN currencies ON debtorsmaster.currcode=currencies.currabrev + WHERE custbranch.branchcode='" . $_SESSION['CreditItems']->Branch . "' + AND custbranch.debtorno = '" . $_SESSION['CreditItems']->DebtorNo . "'"; + + $ErrMsg = _('The customer branch record of the customer selected') . ': ' . $SelectedCustomer . ' ' . _('cannot be retrieved because'); + $DbgMsg = _('SQL used to retrieve the branch details was'); $result =DB_query($sql,$db,$ErrMsg,$DbgMsg); - $myrow = DB_fetch_row($result); + $myrow = DB_fetch_array($result); - $_SESSION['CreditItems']->DebtorNo = $_POST['Select']; - $_SESSION['RequireCustomerSelection'] = 0; - $_SESSION['CreditItems']->CustomerName = $myrow[0]; - /* the sales type determines the price list to be used by default the customer of the user is defaulted from the entry of the userid and password. */ - - $_SESSION['CreditItems']->DefaultSalesType = $myrow[1]; - $_SESSION['CreditItems']->DefaultCurrency = $myrow[2]; - $_SESSION['CurrencyRate'] = $myrow[3]; - -/* default the branch information from the customer branches table CustBranch -particularly where the stock -will be booked back into. */ - - $sql = "SELECT - custbranch.brname, - custbranch.braddress1, - custbranch.braddress2, - custbranch.braddress3, - custbranch.braddress4, - custbranch.braddress5, - custbranch.braddress6, - custbranch.phoneno, - custbranch.email, - custbranch.defaultlocation, - custbranch.taxgroupid, - locations.taxprovinceid - FROM custbranch - INNER JOIN locations ON locations.loccode=custbranch.defaultlocation - WHERE custbranch.branchcode='" . $_SESSION['CreditItems']->Branch . "' - AND custbranch.debtorno = '" . $_SESSION['CreditItems']->DebtorNo . "'"; - - $ErrMsg = _('The customer branch record of the customer selected') . ': ' . $_POST['Select'] . ' ' . _('cannot be retrieved because'); - $DbgMsg = _('SQL used to retrieve the branch details was'); - $result =DB_query($sql,$db,$ErrMsg,$DbgMsg); - - $myrow = DB_fetch_array($result); - $_SESSION['CreditItems']->DeliverTo = $myrow['brname']; - $_SESSION['CreditItems']->BrAdd1 = $myrow['braddress1']; - $_SESSION['CreditItems']->BrAdd2 = $myrow['braddress2']; - $_SESSION['CreditItems']->BrAdd3 = $myrow['braddress3']; - $_SESSION['CreditItems']->BrAdd4 = $myrow['braddress4']; - $_SESSION['CreditItems']->BrAdd5 = $myrow['braddress5']; - $_SESSION['CreditItems']->BrAdd6 = $myrow['braddress6']; - $_SESSION['CreditItems']->PhoneNo = $myrow['phoneno']; - $_SESSION['CreditItems']->Email = $myrow['email']; - $_SESSION['CreditItems']->Location = $myrow['defaultlocation']; - $_SESSION['CreditItems']->TaxGroup = $myrow['taxgroupid']; - $_SESSION['CreditItems']->DispatchTaxProvince = $myrow['taxprovinceid']; - $_SESSION['CreditItems']->GetFreightTaxes(); + $_SESSION['CreditItems']->CustomerName = $myrow['name']; + $_SESSION['CreditItems']->DefaultSalesType = $myrow['salestype']; + $_SESSION['CreditItems']->DefaultCurrency = $myrow['currcode']; + $_SESSION['CreditItems']->CurrDecimalPlaces = $myrow['decimalplaces']; + $_SESSION['CurrencyRate'] = $myrow['rate']; + $_SESSION['CreditItems']->DeliverTo = $myrow['brname']; + $_SESSION['CreditItems']->BrAdd1 = $myrow['braddress1']; + $_SESSION['CreditItems']->BrAdd2 = $myrow['braddress2']; + $_SESSION['CreditItems']->BrAdd3 = $myrow['braddress3']; + $_SESSION['CreditItems']->BrAdd4 = $myrow['braddress4']; + $_SESSION['CreditItems']->BrAdd5 = $myrow['braddress5']; + $_SESSION['CreditItems']->BrAdd6 = $myrow['braddress6']; + $_SESSION['CreditItems']->PhoneNo = $myrow['phoneno']; + $_SESSION['CreditItems']->Email = $myrow['email']; + $_SESSION['CreditItems']->Location = $myrow['defaultlocation']; + $_SESSION['CreditItems']->TaxGroup = $myrow['taxgroupid']; + $_SESSION['CreditItems']->DispatchTaxProvince = $myrow['taxprovinceid']; + $_SESSION['CreditItems']->GetFreightTaxes(); } - - /* if the change customer button hit or the customer has not already been selected */ if ($_SESSION['RequireCustomerSelection'] ==1 OR !isset($_SESSION['CreditItems']->DebtorNo) OR $_SESSION['CreditItems']->DebtorNo=='' ) { - 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 '<p class="page_title_text"><img src="' . $rootpath . '/css/' . $theme . '/images/magnifier.png" title="' . _('Search') . '" alt="" />' . ' ' . _('Select Customer For Credit Note').'</p>'; - echo '<table cellpadding=3 colspan=4 class=selection>'; - echo '<tr><th colspan=5><font size=3 color=navy><b> ' . _('Customer Selection') . '</b></font></th></tr>'; + echo '<table cellpadding="3" colspan="4" class="selection">'; + echo '<tr><th colspan="5"><font size="3" color="navy"><b> ' . _('Customer Selection') . '</b></font></th></tr>'; echo '<tr>'; - echo '<td><font size=1>' . _('Enter text in the customer name') . ':</font></td>'; - echo '<td><input type="Text" name="Keywords" size=20 maxlength=25></td>'; - echo '<td><font size=3><b>' . _('OR') . '</b></font></td>'; - echo '<td><font size=1>' . _('Enter text extract in the customer code') . ':</font></td>'; - echo '<td><input type="Text" name="CustCode" size=15 maxlength=18></td>'; + echo '<td><font size="1">' . _('Enter text in the customer name') . ':</font></td>'; + echo '<td><input type="text" name="Keywords" size=20 maxlength=25></td>'; + echo '<td><font size="3"><b>' . _('OR') . '</b></font></td>'; + echo '<td><font size="1">' . _('Enter text extract in the customer code') . ':</font></td>'; + echo '<td><input type="text" name="CustCode" size="15" maxlength="18"></td>'; echo '</tr>'; echo '</table>'; - echo '<br /><div class="centre"><input type=submit name="SearchCust" VALUE="' . _('Search Now') . '"></div>'; + echo '<br /><div class="centre"><input type="submit" name="SearchCust" value="' . _('Search Now') . '"></div>'; if (isset($result_CustSelect)) { - echo '<br /><table cellpadding=2 colspan=7 class=selection>'; + echo '<table cellpadding="2" colspan="7">'; - $TableHeader = '<tr> - <th>' . _('Code') . '</th> + $TableHeader = '<br /> + <tr> + <th>' . _('Customer') . '</th> <th>' . _('Branch') . '</th> <th>' . _('Contact') . '</th> <th>' . _('Phone') . '</th> <th>' . _('Fax') . '</th> - </tr>'; + </tr>'; + echo $TableHeader; - echo $TableHeader; + $j = 1; + $k = 0; //row counter to determine background colour + $LastCustomer=''; + while ($myrow=DB_fetch_array($result_CustSelect)) { - $j = 1; - $k = 0; //row counter to determine background colour + if ($k==1){ + echo '<tr class="EvenTableRows">'; + $k=0; + } else { + echo '<tr class="OddTableRows">'; + $k=1; + } + echo '<form action="' . $_SERVER['PHP_SELF'] . '?identifier='.$identifier . '" name="SelectParts" method="post">'; + echo '<input type="hidden" name="FormID" value="' . $_SESSION['FormID'] . '" />'; + if ($LastCustomer != $myrow['name']) { + echo '<td>'.$myrow['name'].'</td>'; + } else { + echo '<td></td>'; + } + echo '<td><input tabindex='.($j+5).' type=submit name="SubmitCustomerSelection' . $j .'" value="' . htmlentities($myrow['brname'], ENT_QUOTES,'UTF-8'). '"></td> + <input type="hidden" name="SelectedCustomer' . $j .'" value="'.$myrow['debtorno'].'"><input type="hidden" name="SelectedBranch' . $j .'" value="'. $myrow['branchcode'].'" /> + <td>'.$myrow['contactname'].'</td> + <td>'.$myrow['phoneno'].'</td> + <td>'.$myrow['faxno'].'</td> + </tr>'; + $LastCustomer=$myrow['name']; + $j++; + //end of page full new headings if + } //end of while loop + echo '<input type="hidden" name="JustSelectedACustomer" value="Yes">'; + echo '</table></form>'; - while ($myrow=DB_fetch_array($result_CustSelect)) { - - if ($k==1){ - echo '<tr class="EvenTableRows">'; - $k=0; - } else { - echo '<tr class="OddTableRows">'; - $k=1; - } - - printf("<td><font size=1><input type=submit name='Select' VALUE='%s - %s'</font></td> - <td><font size=1>%s</font></td> - <td><font size=1>%s</font></td> - <td><font size=1>%s</font></td> - <td><font size=1>%s</font></td> - </tr>", - $myrow['debtorno'], - $myrow['branchcode'], - $myrow['brname'], - $myrow['contactname'], - $myrow['phoneno'], - $myrow['faxno']); - -//end of page full new headings if - } -//end of while loop - - echo '</table>'; - - } -//end if results to show - + }//end if results to show + //end if RequireCustomerSelection } else { /* everything below here only do if a customer is selected @@ -424,21 +429,20 @@ if ($AlreadyOnThisCredit!=1){ - $sql = "SELECT - stockmaster.description, - stockmaster.stockid, - stockmaster.units, - stockmaster.volume, - stockmaster.kgs, - (materialcost+labourcost+overheadcost) AS standardcost, - stockmaster.mbflag, - stockmaster.decimalplaces, - stockmaster.controlled, - stockmaster.serialised, - stockmaster.discountcategory, - stockmaster.taxcatid - FROM stockmaster - WHERE stockmaster.stockid = '". $_POST['NewItem'] . "'"; + $sql = "SELECT stockmaster.description, + stockmaster.stockid, + stockmaster.units, + stockmaster.volume, + stockmaster.kgs, + (materialcost+labourcost+overheadcost) AS standardcost, + stockmaster.mbflag, + stockmaster.decimalplaces, + stockmaster.controlled, + stockmaster.serialised, + stockmaster.discountcategory, + stockmaster.taxcatid + FROM stockmaster + WHERE stockmaster.stockid = '". $_POST['NewItem'] . "'"; $ErrMsg = _('There is a problem selecting the part because'); $result1 = DB_query($sql,$db,$ErrMsg); @@ -505,7 +509,7 @@ $_SESSION['CreditItems']->FreightCost = $_POST['ChargeFreightCost']; } - If (isset($_POST['Location']) AND $_POST['Location'] != $_SESSION['CreditItems']->Location){ + if (isset($_POST['Location']) AND $_POST['Location'] != $_SESSION['CreditItems']->Location){ $_SESSION['CreditItems']->Location = $_POST['Location']; @@ -541,7 +545,7 @@ $Price = $_POST['Price_' . $LineItem->LineNumber]; } - $DiscountPercentage = $_POST['Discount_' . $LineItem->LineNumber]; + $DiscountPercentage = $_POST['Discount_' . $LineItem->LineNumber]; foreach ($LineItem->Taxes as $TaxLine) { if (isset($_POST[$LineItem->LineNumber . $TaxLine->TaxCalculationOrder . '_TaxRate'])){ @@ -552,7 +556,15 @@ if ($Quantity<0 OR $Price <0 OR $DiscountPercentage >100 OR $DiscountPercentage <0){ prnMsg(_('The item could not be updated because you are attempting to set the quantity credited to less than 0 or the price less than 0 or the discount more than 100% or less than 0%'),'warn'); } elseif (isset($_POST['Quantity_' . $LineItem->LineNumber])) { - $_SESSION['CreditItems']->update_cart_item($LineItem->LineNumber, $Quantity, $Price, $DiscountPercentage/100, $Narrative, 'No', $LineItem->ItemDue, $LineItem->POLine, 0); + $_SESSION['CreditItems']->update_cart_item($LineItem->LineNumber, + $Quantity, + $Price, + $DiscountPercentage/100, + $Narrative, + 'No', + $LineItem->ItemDue, + $LineItem->POLine, + 0); } } @@ -564,7 +576,7 @@ } } - If (isset($_POST['NewItem'])){ + if (isset($_POST['NewItem'])){ /* get the item details from the database and hold them in the cart object make the quantity 1 by default then add it to the cart */ $AlreadyOnThisCredit =0; @@ -583,19 +595,19 @@ if ($AlreadyOnThisCredit!=1){ $sql = "SELECT stockmaster.description, - stockmaster.stockid, - stockmaster.units, - stockmaster.volume, - stockmaster.kgs, - stockmaster.mbflag, - stockmaster.discountcategory, - stockmaster.controlled, - stockmaster.decimalplaces, - stockmaster.serialised, - (materialcost+labourcost+overheadcost) AS standardcost, - stockmaster.taxcatid - FROM stockmaster - WHERE stockmaster.stockid = '". $_POST['NewItem'] . "'"; + stockmaster.stockid, + stockmaster.units, + stockmaster.volume, + stockmaster.kgs, + stockmaster.mbflag, + stockmaster.discountcategory, + stockmaster.controlled, + stockmaster.decimalplaces, + stockmaster.serialised, + (materialcost+labourcost+overheadcost) AS standardcost, + stockmaster.taxcatid + FROM stockmaster + WHERE stockmaster.stockid = '". $_POST['NewItem'] . "'"; $ErrMsg = _('The item details could not be retrieved because'); $DbgMsg = _('The SQL used to retrieve the item details but failed was'); @@ -644,21 +656,21 @@ /* This is where the credit note as selected should be displayed reflecting any deletions or insertions*/ - echo '<table cellpadding=2 colspan=7 class=selection> - <tr> - <th>' . _('Item Code') . '</th> - <th>' . _('Item Description') . '</th> - <th>' . _('Quantity') . '</th> - <th>' . _('Unit') . '</th> - <th>' . _('Price') . '</th> - <th>' . _('Gross') . '</th> - <th>' . _('Discount') . '</th> - <th>' . _('Total') . '<br />' . _('Excl Tax') . '</th> - <th>' . _('Tax Authority') . '</th> - <th>' . _('Tax') . '<br />' . _('Rate') . '</th> - <th>' . _('Tax') . '<br />' . _('Amount') . '</th> - <th>' . _('Total') . '<br />' . _('Incl Tax') . '</th> - </tr>'; + echo '<table cellpadding="2" colspan="7" class="selection"> + <tr> + <th>' . _('Item Code') . '</th> + <th>' . _('Item Description') . '</th> + <th>' . _('Quantity') . '</th> + <th>' . _('Unit') . '</th> + <th>' . _('Price') . '</th> + <th>' . _('Gross') . '</th> + <th>' . _('Discount') . '</th> + <th>' . _('Total') . '<br />' . _('Excl Tax') . '</th> + <th>' . _('Tax Authority') . '</th> + <th>' . _('Tax') . '<br />' . _('Rate') . '</th> + <th>' . _('Tax') . '<br />' . _('Amount') . '</th> + <th>' . _('Total') . '<br />' . _('Incl Tax') . '</th> + </tr>'; $_SESSION['CreditItems']->total = 0; $_SESSION['CreditItems']->totalVolume = 0; @@ -671,8 +683,8 @@ $k =0; //row colour counter foreach ($_SESSION['CreditItems']->LineItems as $LineItem) { - $LineTotal = $LineItem->Quantity * $LineItem->Price * (1 - $LineItem->DiscountPercent); - $DisplayLineTotal = number_format($LineTotal,2); + $LineTotal = round($LineItem->Quantity * $LineItem->Price * (1 - $LineItem->DiscountPercent),$_SESSION['CreditItems']->CurrDecimalPlaces); + $DisplayLineTotal = number_format($LineTotal,$_SESSION['CreditItems']->CurrDecimalPlaces); if ($k==1){ $RowStarter = '<tr class="EvenTableRows">'; @@ -686,16 +698,16 @@ <td>' . $LineItem->ItemDescription . '</td>'; if ($LineItem->Controlled==0){ - echo '<td><input type="text" class="number" name="Quantity_' . $LineItem->LineNumber . '" maxlength=6 size=6 VALUE=' . $LineItem->Quantity . '></td>'; + echo '<td><input type="text" class="number" name="Quantity_' . $LineItem->LineNumber . '" maxlength=6 size=6 value=' . $LineItem->Quantity . '></td>'; } else { - echo '<td class=number><a href="' . $rootpath . '/CreditItemsControlled.php?' . SID . '&LineNo=' . $LineItem->LineNumber . '">' . $LineItem->Quantity . '</a> + echo '<td class=number><a href="' . $rootpath . '/CreditItemsControlled.php?LineNo=' . $LineItem->LineNumber . '">' . $LineItem->Quantity . '</a> <input type=hidden name="Quantity_' . $LineItem->LineNumber . '" value=' . $LineItem->Quantity . '></td>'; } echo '<td>' . $LineItem->Units . '</td> - <td><input type="text" class="number" name="Price_' . $LineItem->LineNumber . '" size=10 maxlength=12 VALUE=' . $LineItem->Price . '></td> - <td><input type="CheckBox" name="Gross" VALUE=False></td> - <td><input type="text" class="number" name="Discount_' . $LineItem->LineNumber . '" size=3 maxlength=3 VALUE=' . ($LineItem->DiscountPercent * 100) . '>%</td> + <td><input type="text" class="number" name="Price_' . $LineItem->LineNumber . '" size=10 maxlength=12 value=' . $LineItem->Price . '></td> + <td><input type="CheckBox" name="Gross" value=False></td> + <td><input type="text" class="number" name="Discount_' . $LineItem->LineNumber . '" size=3 maxlength=3 value=' . ($LineItem->DiscountPercent * 100) . '>%</td> <td class=number>' . $DisplayLineTotal . '</td>'; @@ -716,9 +728,6 @@ $TaxLineTotal =0; //initialise tax total for the line foreach ($LineItem->Taxes AS $Tax) { - $TaxTotals[$Tax->TaxAuthID] =0; - } - foreach ($LineItem->Taxes AS $Tax) { if ($i>0){ echo '<br />'; } @@ -737,14 +746,12 @@ $TaxTotal += $TaxLineTotal; - $DisplayTaxAmount = number_format($TaxLineTotal ,2); - $DisplayGrossLineTotal = number_format($LineTotal+ $TaxLineTotal,2); + $DisplayTaxAmount = number_format($TaxLineTotal ,$_SESSION['CreditItems']->CurrDecimalPlaces); + $DisplayGrossLineTotal = number_format($LineTotal+ $TaxLineTotal,$_SESSION['CreditItems']->CurrDecimalPlaces); - echo '<td class=number>' . $DisplayTaxAmount . '</td> - <td class=number>' . $DisplayGrossLineTotal . '</td> - <td><a href="' . $_SERVER['PHP_SELF'] . '?' . SID . '&Delete=' . $LineItem->LineNumber . '" onclick="return confirm(\'' . _('Are you sure you wish to delete this line item from the credit note?') . '\');">' . _('Delete') . '</a></td> - - + echo '<td class="number">' . $DisplayTaxAmount . '</td> + <td class="number">' . $DisplayGrossLineTotal . '</td> + <td><a href="' . $_SERVER['PHP_SELF'] . '?Delete=' . $LineItem->LineNumber . '" onclick="return confirm(\'' . _('Are you sure you wish to delete this line item from the credit note?') . '\');">' . _('Delete') . '</a></td> </tr>'; echo $RowStarter; @@ -762,8 +769,8 @@ <td colspan=5></td>'; - echo '<td colspan=2 class=number>'. _('Credit Freight').'</td> - <td><input type="text" class="number" size=6 maxlength=6 name=ChargeFreightCost VALUE=' . $_SESSION['CreditItems']->FreightCost . '></td>'; + echo '<td colspan="2" class="number">'. _('Credit Freight').'</td> + <td><input type="text" class="number" size=6 maxlength=6 name="ChargeFreightCost" value="' . $_SESSION['CreditItems']->FreightCost . '" /></td>'; $FreightTaxTotal =0; //initialise tax total @@ -786,7 +793,7 @@ echo '<br />'; } - echo '<input type="text" class="number" name=FreightTaxRate' . $FreightTaxLine->TaxCalculationOrder . ' maxlength=4 size=4 VALUE=' . $FreightTaxLine->TaxRate * 100 . '>'; + echo '<input type="text" class="number" name=FreightTaxRate' . $FreightTaxLine->TaxCalculationOrder . ' maxlength=4 size=4 value="' . $FreightTaxLine->TaxRate * 100 . '" />'; if ($FreightTaxLine->TaxOnTax ==1){ $TaxTotals[$FreightTaxLine->TaxAuthID] += ($FreightTaxLine->TaxRate * ($_SESSION['CreditItems']->FreightCost + $FreightTaxTotal)); @@ -800,38 +807,43 @@ } echo '</td>'; - echo '<td class=number>' . number_format($FreightTaxTotal,2) . '</td> - <td class=number>' . number_format($FreightTaxTotal+ $_SESSION['CreditItems']->FreightCost,2) . '</td> + echo '<td class="number">' . number_format($FreightTaxTotal,$_SESSION['CreditItems']->CurrDecimalPlaces) . '</td> + <td class="number">' . number_format($FreightTaxTotal+ $_SESSION['CreditItems']->FreightCost,$_SESSION['CreditItems']->CurrDecimalPlaces) . '</td> </tr>'; $TaxTotal += $FreightTaxTotal; - $DisplayTotal = number_format($_SESSION['CreditItems']->total + $_SESSION['CreditItems']->FreightCost,2); + $DisplayTotal = number_format($_SESSION['CreditItems']->total + $_SESSION['CreditItems']->FreightCost,$_SESSION['CreditItems']->CurrDecimalPlaces); - echo '<tr> - <td colspan=7 class=number>' . _('Credit Totals') . "</td> - <td class=number><b>$DisplayTotal</b></td> - <td colspan=2></td> - <td class=number><b>" . number_format($TaxTotal,2) . "</td> - <td class=number><b>" . number_format($TaxTotal+($_SESSION['CreditItems']->total + $_SESSION['CreditItems']->FreightCost),2) . "</b></td> - </tr></table>"; + <td colspan="7" class="number">' . _('Credit Totals') . '</td> + <td class="number"><b>' . $DisplayTotal . '</b></td> + <td colspan="2"></td> + <td class="number"><b>' . number_format($TaxTotal,$_SESSION['CreditItems']->CurrDecimalPlaces) . '</td> + <td class="number"><b>' . number_format($TaxTotal+($_SESSION['CreditItems']->total + $_SESSION['CreditItems']->FreightCost),$_SESSION['CreditItems']->CurrDecimalPlaces) . '</b></td> + </tr> + </table>'; /*Now show options for the credit note */ - echo '<br /><table class=selection><tr><td>' . _('Credit Note Type') . ' :</td><td><select name=CreditType>'; + echo '<br /> + <table class="selection"> + <tr> + <td>' . _('Credit Note Type') . ' :</td> + <td><select name="CreditType">'; + if (!isset($_POST['CreditType']) OR $_POST['CreditType']=='Return'){ - echo '<option selected value="Return">' . _('Goods returned to store') . '</option>'; - echo '<option value="WriteOff">' . _('Goods written off') . '</option>'; - echo '<option value="ReverseOverCharge">' . _('Reverse an Overcharge') . '</option>'; + echo '<option selected value="Return">' . _('Goods returned to store') . '</option> + <option value="WriteOff">' . _('Goods written off') . '</option> + <option value="ReverseOverCharge">' . _('Reverse an Overcharge') . '</option>'; } elseif ($_POST['CreditType']=='WriteOff') { - echo '<option selected value="WriteOff">' . _('Goods written off') . '</option>'; - echo '<option value="Return">' . _('Goods returned to store') . '</option>'; - echo '<option value="ReverseOverCharge">' . _('Reverse an Overcharge') . '</option>'; + echo '<option selected value="WriteOff">' . _('Goods written off') . '</option> + <option value="Return">' . _('Goods returned to store') . '</option> + <option value="ReverseOverCharge">' . _('Reverse an Overcharge') . '</option>'; } elseif($_POST['CreditType']=='ReverseOverCharge'){ - echo '<option selected value="ReverseOverCharge">' . _('Reverse Overcharge Only') . '</option>'; - echo '<option value="Return">' . _('Goods Returned To Store') . '</option>'; - echo '<option value="WriteOff">' . _('Good written off') . '</option>'; + echo '<option selected value="ReverseOverCharge">' . _('Reverse Overcharge Only') . '</option> + <option value="Return">' . _('Goods Returned To Store') . '</option> + <option value="WriteOff">' . _('Good written off') . '</option>'; } echo '</select></td></tr>'; @@ -843,7 +855,7 @@ echo '<tr><td>' . _('Goods Returned to Location') . ' :</td><td><select name=Location>'; - $SQL='SELECT loccode, locationname FROM locations'; + $SQL="SELECT loccode, locationname FROM locations"; $Result = DB_query($SQL,$db); if (!isset($_POST['Location'])){ @@ -852,9 +864,9 @@ while ($myrow = DB_fetch_array($Result)) { if ($_POST['Location']==$myrow['loccode']){ - echo '<option selected VALUE="' . $myrow['loccode'] . '">' . $myrow['locationname'] . '</option>'; + echo '<option selected value="' . $myrow['loccode'] . '">' . $myrow['locationname'] . '</option>'; } else { - echo '<option VALUE="' . $myrow['loccode'] . '">' . $myrow['locationname'] . '</option>'; + echo '<option value="' . $myrow['loccode'] . '">' . $myrow['locationname'] . '</option>'; } } echo '</select></td></tr>'; @@ -863,20 +875,20 @@ echo '<tr><td>' . _('Write off the cost of the goods to') . '</td><td><select name=WriteOffGLCode>'; - $SQL='SELECT accountcode, - accountname - FROM chartmaster, - accountgroups - WHERE chartmaster.group_=accountgroups.groupname - AND accountgroups.pandl=1 ORDER BY accountcode'; + $SQL="SELECT accountcode, + accountname + FROM chartmaster, + accountgroups + WHERE chartmaster.group_=accountgroups.groupname + AND accountgroups.pandl=1 ORDER BY accountcode"; $Result = DB_query($SQL,$db); while ($myrow = DB_fetch_array($Result)) { if ($_POST['WriteOffGLCode']==$myrow['accountcode']){ - echo '<option selected VALUE=' . $myrow['accountcode'] . '>' . $myrow['accountcode'] . ' - ' . $myrow['accountname'] . '</option>'; + echo '<option selected value="' . $myrow['accountcode'] . '">' . $myrow['accountcode'] . ' - ' . $myrow['accountname'] . '</option>'; } else { - echo '<option VALUE=' . $myrow['accountcode'] . '>' . $myrow['accountcode'] . ' - ' . $myrow['accountname'] . '</option>'; + echo '<option value="' . $myrow['accountcode'] . '">' . $myrow['accountcode'] . ' - ' . $myrow['accountname'] . '</option>'; } } echo '</select></td></tr>'; @@ -885,7 +897,7 @@ $_POST['CreditText']=''; } echo '<tr><td>' . _('Credit Note Text') . ' :</td> - <td><textarea name=CreditText COLS=31 ROWS=5>' . $_POST['CreditText'] . '</textarea></td> + <td><textarea name="CreditText" COLS="31" rows="5">' . $_POST['CreditText'] . '</textarea></td> </tr> </table><br />'; @@ -895,11 +907,14 @@ prnMsg (_('The GL code to write off the credit value to must be specified. Please select the appropriate GL code for the selection box'),'info'); $OKToProcess = false; } - echo '<div class="centre"><input type=submit name="Update" VALUE="' . _('Update') . '"> - <input type=submit name="CancelCredit" VALUE="' . _('Cancel') . '" onclick="return confirm(\'' . _('Are you sure you wish to cancel the whole of this credit note?') . '\');">'; + echo '<div class="centre"> + <input type=submit name="Update" value="' . _('Update') . '" /> + <input type=submit name="CancelCredit" value="' . _('Cancel') . '" onclick="return confirm(\'' . _('Are you sure you wish to cancel the whole of this credit note?') . '\');" />'; if (!isset($_POST['ProcessCredit']) AND $OKToProcess == true){ - echo '<input type=submit name="ProcessCredit" VALUE="' . _('Process Credit Note') . '"></div><br />'; + echo '<input type=submit name="ProcessCredit" value="' . _('Process Credit Note') . '" /> + <br />'; } + echo '</div>'; } # end of if lines @@ -907,29 +922,31 @@ if (isset($_POST['PartSearch']) AND $_POST['PartSearch']!="" AND !isset($_POST['ProcessCredit'])){ - echo '<input type="hidden" name="PartSearch" value="' . _('Yes Please') . '">'; + echo '<input type="hidden" name="PartSearch" value="' . _('Yes Please') . '" />'; $SQL="SELECT categoryid, - categorydescription - FROM stockcategory - WHERE stocktype='F' - ORDER BY categorydescription"; + categorydescription + FROM stockcategory + WHERE stocktype='F' + ORDER BY categorydescription"; $result1 = DB_query($SQL,$db); - echo '<br /><table class=selection> - <tr><td>' . _('Select a stock category') . ': <select name="StockCat">'; + echo '<br /> + <table class="selection"> + <tr> + <td>' . _('Select a stock category') . ': <select name="StockCat">'; - echo '<option selected VALUE="All">' . _('All'); + echo '<option selected value="All">' . _('All'); while ($myrow1 = DB_fetch_array($result1)) { if (isset($_POST['StockCat']) and $_POST['StockCat']==$myrow1['categoryid']){ - echo '<option selected VALUE=' . $myrow1['categoryid'] . '>' . $myrow1['categorydescription'] . '</option>'; + echo '<option selected value=' . $myrow1['categoryid'] . '>' . $myrow1['categorydescription'] . '</option>'; } else { - echo '<option VALUE=' . $myrow1['categoryid'] . '>' . $myrow1['categorydescription'] . '</option>'; + echo '<option value=' . $myrow1['categoryid'] . '>' . $myrow1['categorydescription'] . '</option>'; } } - echo '</select>'; + echo '</select></td>'; if (!isset($_POST['Keywords'])) { $_POST['Keywords'] = ''; } @@ -940,22 +957,24 @@ echo '<td><input type="Text" name="Keywords" size="20" maxlength="25" value="' . $_POST['Keywords'] . '"></td></tr>'; echo '<tr><td></td>'; echo '<td><font SIZE="3"><b>' ._('OR') . '</b></font> ' . _('Enter extract of the Stock Code') . ': </td>'; - echo '<td><input type="Text" name="StockCode" size="15" maxlength="18" value="' . $_POST['StockCode'] . '"></td>'; + echo '<td><input type="text" name="StockCode" size="15" maxlength="18" value="' . $_POST['StockCode'] . '"></td>'; echo '</tr>'; - echo '</table><br /><div class="centre">'; + echo '</table> + <br /> + <div class="centre">'; - echo '<input type=submit name="Search" value="' . _('Search Now') .'">'; - echo '<input type=submit Name="ChangeCustomer" value="' . _('Change Customer') . '">'; - echo '<input type=submit Name="Quick" value="' . _('Quick Entry') . '">'; - echo '</div>'; + echo '<input type=submit name="Search" value="' . _('Search Now') .'" /> + <input type=submit Name="ChangeCustomer" value="' . _('Change Customer') . '" /> + <input type=submit Name="Quick" value="' . _('Quick Entry') . '" /> + </div>'; if (isset($SearchResult)) { - echo '<table cellpadding=2 colspan=7 class=selection>'; + echo '<table cellpadding="2" colspan="7" class="selection">'; $TableHeader = '<tr> - <th>' . _('Code') . '</th> - <th>' . _('Description') . '</th> - <th>' . _('Units') .'</th> + <th>' . _('Code') . '</th> + <th>' . _('Description') . '</th> + <th>' . _('Units') .'</th> </tr>'; echo $TableHeader; @@ -963,32 +982,31 @@ $k=0; //row colour counter while ($myrow=DB_fetch_array($SearchResult)) { - - $ImageSource = $_SESSION['part_pics_dir'] . '/' . $myrow['stockid'] . '.jpg'; - if (file_exists($ImageSource)){ - $ImageSource = '<img src="'.$ImageSource.'">'; - } else { - $ImageSource = '<i>'._('No Image').'</i>'; - } - /* $_SESSION['part_pics_dir'] is a user defined variable in config.php */ - - if ($k==1){ - echo '<tr class="EvenTableRows">'; - $k=0; - } else { - echo '<tr class="OddTableRows">'; - $k++; - } - - printf("<td><font size=1><input type=submit name='NewItem' VALUE='%s'></font></td> - <td><font size=1>%s</font></td> - <td><font size=1>%s</font></td> - <td>%s</td></tr>", - $myrow['stockid'], - $myrow['description'], - $myrow['units'], - $ImageSource); - + if ($k==1){ + echo '<tr class="EvenTableRows">'; + $k=0; + } else { + echo '<tr class="OddTableRows">'; + $k++; + } + if(file_exists($_SESSION['part_pics_dir'] . '/' .mb_strtoupper($myrow['stockid']).'.jpg') ) { + printf('<td><font size=1><input type=submit name="NewItem" value="%s"></font></td> + <td><font size=1>%s</font></td> + <td><font size=1>%s</font></td> + <td><img src="GetStockImage.php?automake=1&textcolor=FFFFFF&bgcolor=CCCCCC&StockID=%s&text=&width=120&height=120"></td></tr>', + $myrow['stockid'], + $myrow['description'], + $myrow['units'], + $myrow['stockid']); + } else { //don't try to show the image + printf('<td><font size=1><input type=submit name="NewItem" value="%s"></font></td> + <td><font size=1>%s</font></td> + <td><font size=1>%s</font></td> + <td>' . _('No Image') . '</td></tr>', + $myrow['stockid'], + $myrow['description'], + $myrow['units']); + } #end of page full new headings if } #end of while loop @@ -997,21 +1015,27 @@ } /*end if part searching required */ elseif(!isset($_POST['ProcessCredit'])) { /*quick entry form */ /*FORM VARIABLES TO POST TO THE CREDIT NOTE 10 AT A TIME WITH PART CODE AND QUANTITY */ - echo '<table class=selection>'; - echo '<tr><th colspan=2><font size=3 color=navy><b>' . _('Quick Entry') . '</th></tr>'; + echo '<table class="selection">'; + echo '<tr><th colspan="2"><font size="3" color="navy"><b>' . _('Quick Entry') . '</th></tr>'; echo '<tr> - <th>' . _('Part Code') . '</th> - <th>' . _('Quantity') . '</th> - </tr>'; + <th>' . _('Part Code') . '</th> + <th>' . _('Quantity') . '</th> + </tr>'; for ($i=1;$i<=$_SESSION['QuickEntries'];$i++){ - echo '<tr class="OddTableRows"><td><input type="text" name="part_' . $i . '" size=21 maxlength=20></td> - <td><input type="text" class="number" name="qty_' . $i . '" size=6 maxlength=6></td></tr>'; + echo '<tr class="OddTableRows"> + <td><input type="text" name="part_' . $i . '" size="21" maxlength="20" /></td> + <td><input type="text" class="number" name="qty_' . $i . '" size="6" maxlength="6" /></td> + </tr>'; } - echo '</table><br /><div class="centre"><input type="submit" name="QuickEntry" value="' . _('Process Entries') . '"> - <input type="submit" name="PartSearch" value="' . _('Search Parts') . '"></div>'; + echo '</table> + <br /> + <div class="centre"> + <input type="submit" name="QuickEntry" value="' . _('Process Entries') . '"> + <input type="submit" name="PartSearch" value="' . _('Search Parts') . '"> + </div>'; } @@ -1023,7 +1047,7 @@ First Get the area where the credit note is to from the branches table */ $SQL = "SELECT area - FROM custbranch + FROM custbranch WHERE custbranch.debtorno ='". $_SESSION['CreditItems']->DebtorNo . "' AND custbranch.branchcode = '" . $_SESSION['CreditItems']->Branch . "'"; $ErrMsg = _('CRITICAL ERROR') . '! ' . _('NOTE DOWN THIS ERROR AND SEEK ASSISTANCE') . ': ' . _('The area cannot be determined for this customer'); @@ -1742,24 +1766,22 @@ /* The double entry required is to reverse the cost of sales entry as above then debit the expense account the stock is to written off to */ - $SQL = "INSERT INTO gltrans ( - type, - typeno, - trandate, - periodno, - account, - narrative, - amount) - VALUES ( - 11, - '" . $CreditNo . "', - '" . $SQLCreditDate . "', - '" . $PeriodNo . "', - '" . $_POST['WriteOffGLCode'] . "', - '" . $_SESSION['CreditItems']->DebtorNo . " - " . $CreditLine->StockID . " x " . $CreditLine->Quantity . " @ " . $CreditLine->StandardCost . "', - '" . ($CreditLine->StandardCost * $CreditLine->Quantity) . "' - )"; - + $SQL = "INSERT INTO gltrans (type, + typeno, + trandate, + periodno, + account, + narrative, + amount) + VALUES (11, + '" . $CreditNo . "', + '" . $SQLCreditDate . "', + '" . $PeriodNo . "', + '" . $_POST['WriteOffGLCode'] . "', + '" . $_SESSION['CreditItems']->DebtorNo . " - " . $CreditLine->StockID . " x " . $CreditLine->Quantity . " @ " . $CreditLine->StandardCost . "', + '" . ($CreditLine->StandardCost * $CreditLine->Quantity) . "' + )"; + $ErrMsg = _('CRITICAL ERROR') . '! ' . _('NOTE DOWN THIS ERROR AND SEEK ASSISTANCE') . ': ' . _('The cost of the stock credited GL posting could not be inserted because'); $DbgMsg = _('The following SQL to insert the GLTrans record was used'); $Result = DB_query($SQL, $db, $ErrMsg, $DbgMsg, true); @@ -1767,24 +1789,22 @@ /*the goods are coming back into stock so debit the stock account*/ $StockGLCode = GetStockGLCode($CreditLine->StockID, $db); - $SQL = "INSERT INTO gltrans ( - type, - typeno, - trandate, - periodno, - account, - narrative, - amount) - VALUES ( - 11, - '" . $CreditNo . "', - '" . $SQLCreditDate . "', - '" . $PeriodNo . "', - '" . $StockGLCode['stockact'] . "', - '" . $_SESSION['CreditItems']->DebtorNo . " - " . $CreditLine->StockID . " x " . $CreditLine->Quantity . " @ " . $CreditLine->StandardCost . "', - '" . ($CreditLine->StandardCost * $CreditLine->Quantity) . "' - )"; - + $SQL = "INSERT INTO gltrans (type, + typeno, + trandate, + periodno, + account, + narrative, + amount) + VALUES (11, + '" . $CreditNo . "', + '" . $SQLCreditDate . "', + '" . $PeriodNo . "', + '" . $StockGLCode['stockact'] . "', + '" . $_SESSION['CreditItems']->DebtorNo . " - " . $CreditLine->StockID . " x " . $CreditLine->Quantity . " @ " . $CreditLine->StandardCost . "', + '" . ($CreditLine->StandardCost * $CreditLine->Quantity) . "' + )"; + $ErrMsg = _('CRITICAL ERROR') . '! ' . _('NOTE DOWN THIS ERROR AND SEEK ASSISTANCE') . ': ' . _('The stock side (or write off) of the cost of sales GL posting could not be inserted because'); $DbgMsg = _('The following SQL to insert the GLTrans record was used'); $Result = DB_query($SQL, $db, $ErrMsg, $DbgMsg, true); @@ -1800,49 +1820,45 @@ $_SESSION['CreditItems']->DefaultSalesType, $db); - $SQL = "INSERT INTO gltrans ( - type, - typeno, - trandate, - periodno, - account, - narrative, - amount) - VALUES ( - 11, - '" . $CreditNo . "', - '" . $SQLCreditDate . "', - '" . $PeriodNo . "', - '" . $SalesGLAccounts['salesglcode'] . "', - '" . $_SESSION['CreditItems']->DebtorNo . " - " . $CreditLine->StockID . " x " . $CreditLine->Quantity . " @ " . $CreditLine->Price . "', - '" . ($CreditLine->Price * $CreditLine->Quantity)/$_SESSION['CurrencyRate'] . "' - )"; - + $SQL = "INSERT INTO gltrans (type, + typeno, + trandate, + periodno, + account, + narrative, + amount) + VALUES (11, + '" . $CreditNo . "', + '" . $SQLCreditDate . "', + '" . $PeriodNo . "', + '" . $SalesGLAccounts['salesglcode'] . "', + '" . $_SESSION['CreditItems']->DebtorNo . " - " . $CreditLine->StockID . " x " . $CreditLine->Quantity . " @ " . $CreditLine->Price . "', + '" . ($CreditLine->Price * $CreditLine->Quantity)/$_SESSION['CurrencyRate'] . "' + )"; + $ErrMsg = _('CRITICAL ERROR') . '! ' . _('NOTE DOWN THIS ERROR AND SEEK ASSISTANCE') . ': ' . _('The credit note GL posting could not be inserted because'); $DbgMsg = _('The following SQL to insert the GLTrans record was used'); $Result = DB_query($SQL, $db, $ErrMsg, $DbgMsg, true); if ($CreditLine->DiscountPercent !=0){ - $SQL = "INSERT INTO gltrans ( - type, - typeno, - trandate, - periodno, - account, - narrative, - amount) - VALUES ( - 11, - '" . $CreditNo . "', - '" . $SQLCreditDate . "', - '" . $PeriodNo . "', - '" . $SalesGLAccounts['discountglcode'] . "', - '" . $_SESSION['CreditItems']->DebtorNo . " - " . $CreditLine->StockID . " @ " . ($CreditLine->DiscountPercent * 100) . "%', - '" . -($CreditLine->Price * $CreditLine->Quantity * $CreditLine->DiscountPercent)/$_SESSION['CurrencyRate'] . "' - )"; + $SQL = "INSERT INTO gltrans (type, + typeno, + trandate, + periodno, + account, + narrative, + amount) + VALUES (11, + '" . $CreditNo . "', + '" . $SQLCreditDate . "', + '" . $PeriodNo . "', + '" . $SalesGLAccounts['discountglcode'] . "', + '" . $_SESSION['CreditItems']->DebtorNo . " - " . $CreditLine->StockID . " @ " . ($CreditLine->DiscountPercent * 100) . "%', + '" . -($CreditLine->Price * $CreditLine->Quantity * $CreditLine->DiscountPercent)/$_SESSION['CurrencyRate'] . "' + )"; + - $ErrMsg = _('CRITICAL ERROR') . '! ' . _('NOTE DOWN THIS ERROR AND SEEK ASSISTANCE') . ': ' . _('The credit note discount GL posting could not be inserted because'); $DbgMsg = _('The following SQL to insert the GLTrans record was used'); $Result = DB_query($SQL, $db, $ErrMsg, $DbgMsg, true); @@ -1856,45 +1872,40 @@ /*Post credit note transaction to GL credit debtors, debit freight re-charged and debit sales */ if (($_SESSION['CreditItems']->total + $_SESSION['CreditItems']->FreightCost + $TaxTotal) !=0) { - $SQL = "INSERT INTO gltrans ( - type, - typeno, - trandate, - periodno, - account, - narrative, - amount) - VALUES ( - 11, - '" . $CreditNo . "', - '" . $SQLCreditDate . "', - '" . $PeriodNo . "', - '" . $_SESSION['CompanyRecord']['debtorsact'] . "', - '" . $_SESSION['CreditItems']->DebtorNo . "', - '" . -($_SESSION['CreditItems']->total + $_SESSION['CreditItems']->FreightCost + $TaxTotal)/$_SESSION['CurrencyRate'] . "')"; - + $SQL = "INSERT INTO gltrans (type, + typeno, + trandate, + periodno, + account, + narrative, + amount) + VALUES (11, + '" . $CreditNo . "', + '" . $SQLCreditDate . "', + '" . $PeriodNo . "', + '" . $_SESSION['CompanyRecord']['debtorsact'] . "', + '" . $_SESSION['CreditItems']->DebtorNo . "', + '" . -($_SESSION['CreditItems']->total + $_SESSION['CreditItems']->FreightCost + $TaxTotal)/$_SESSION['CurrencyRate'] . "')"; + $ErrMsg = _('CRITICAL ERROR') . '! ' . _('NOTE DOWN THIS ERROR AND SEEK ASSISTANCE') . ': ' . _('The total debtor GL posting for the credit note could not be inserted because'); $DbgMsg = _('The following SQL to insert the GLTrans record was used'); $Result = DB_query($SQL, $db, $ErrMsg, $DbgMsg, true); } if ($_SESSION['CreditItems']->FreightCost !=0) { - $SQL = "INSERT INTO gltrans ( - type, - typeno, - trandate, - periodno, - account, - narrative, - amount) - VALUES ( - 11, - '" . $CreditNo . "', - '" . $SQLCreditDate . "', - '" . $PeriodNo . "', - '" . $_SESSION['CompanyRecord']['freightact'] . "', - '" . $_SESSION['CreditItems']->DebtorNo . "', - '" . $_SESSION['CreditItems']->FreightCost/$_SESSION['CurrencyRate'] . "' - )"; + $SQL = "INSERT INTO gltrans (type, + typeno, + trandate, + periodno, + account, + narrative, + amount) + VALUES (11, + '" . $CreditNo . "', + '" . $SQLCreditDate . "', + '" . $PeriodNo . "', + '" . $_SESSION['CompanyRecord']['freightact'] . "', + '" . $_SESSION['CreditItems']->DebtorNo . "', + '" . $_SESSION['CreditItems']->FreightCost/$_SESSION['CurrencyRate'] . "')"; $ErrMsg = _('CRITICAL ERROR') . '! ' . _('NOTE DOWN THIS ERROR AND SEEK ASSISTANCE') . ': ' . _('The freight GL posting for this credit note could not be inserted because'); $DbgMsg = _('The following SQL to insert the GLTrans record was used'); @@ -1902,24 +1913,20 @@ } foreach ( $TaxTotals as $TaxAuthID => $TaxAmount){ if ($TaxAmount !=0 ){ - $SQL = "INSERT INTO gltrans ( - type, - typeno, - trandate, - periodno, - account, - narrative, - amount - ) - VALUES ( - 11, - '" . $CreditNo . "', - '" . $SQLCreditDate . "', - '" . $PeriodNo . "', - '" . $TaxGLCodes[$TaxAuthID] . "', - '" . $_SESSION['CreditItems']->DebtorNo . "', - '" . ($TaxAmount/$_SESSION['CurrencyRate']) . "' - )"; + $SQL = "INSERT INTO gltrans (type, + typeno, + trandate, + periodno, + account, + narrative, + amount ) + VALUES (11, + '" . $CreditNo . "', + '" . $SQLCreditDate . "', + '" . $PeriodNo . "', + '" . $TaxGLCodes[$TaxAuthID] . "', + '" . $_SESSION['CreditItems']->DebtorNo . "', + '" . ($TaxAmount/$_SESSION['CurrencyRate']) . "')"; $ErrMsg = _('CRITICAL ERROR') . '! ' . _('NOTE DOWN THIS ERROR AND SEEK ASSISTANCE') . ': ' . _('The tax GL posting could not be inserted because'); $DbgMsg = _('The following SQL to insert the GLTrans record was used'); @@ -1940,7 +1947,7 @@ } else { echo '<a href="' . $rootpath . '/PrintCustTransPortrait.php?FromTransNo=' . $CreditNo . '&InvOrCredit=Credit&PrintPDF=True">' . _('Print this Credit Note') . '</a>'; } - echo '<p><a href="' . $rootpath . '/SelectCreditItems.php">' . _('Enter Another Credit Note') . '</a>'; + echo '<br /><a href="' . $rootpath . '/SelectCreditItems.php">' . _('Enter Another Credit Note') . '</a>'; } /*end of process credit note */ Modified: trunk/SelectOrderItems.php =================================================================== --- trunk/SelectOrderItems.php 2011-07-16 03:37:58 UTC (rev 4633) +++ trunk/SelectOrderItems.php 2011-07-17 03:31:55 UTC (rev 4634) @@ -79,52 +79,52 @@ /*read in all the guff from the selected order into the Items cart */ $OrderHeaderSQL = "SELECT salesorders.debtorno, - debtorsmaster.name, - salesorders.branchcode, - salesorders.customerref, - salesorders.comments, - salesorders.orddate, - salesorders.ordertype, - salestypes.sales_type, - salesorders.shipvia, - salesorders.deliverto, - salesorders.deladd1, - salesorders.deladd2, - salesorders.deladd3, - salesorders.deladd4, - salesorders.deladd5, - salesorders.deladd6, - salesorders.contactphone, - salesorders.contactemail, - salesorders.freightcost, - salesorders.deliverydate, - debtorsmaster.currcode, - currencies.decimalplaces, - paymentterms.terms, - salesorders.fromstkloc, - salesorders.printedpackingslip, - salesorders.datepackingslipprinted, - salesorders.quotation, - salesorders.deliverblind, - debtorsmaster.customerpoline, - locations.locationname, - custbranch.estdeliverydays, - custbranch.salesman - FROM salesorders - INNER JOIN debtorsmaster - ON salesorders.debtorno = debtorsmaster.debtorno - INNER JOIN salestypes - ON salesorders.ordertype=salestypes.typeabbrev - INNER JOIN custbranch - ON salesorders.debtorno = custbranch.debtorno - AND salesorders.branchcode = custbranch.branchcode - INNER JOIN paymentterms - ON debtorsmaster.paymentterms=paymentterms.termsindicator - INNER JOIN locations - ON locations.loccode=salesorders.fromstkloc - INNER JOIN currencies - ON debtorsmaster.currcode=currencies.currabrev - WHERE salesorders.orderno = '" . $_GET['ModifyOrderNumber'] . "'"; + debtorsmaster.name, + salesorders.branchcode, + salesorders.customerref, + salesorders.comments, + salesorders.orddate, + salesorders.ordertype, + salestypes.sales_type, + salesorders.shipvia, + salesorders.deliverto, + salesorders.deladd1, + salesorders.deladd2, + salesorders.deladd3, + salesorders.deladd4, + salesorders.deladd5, + salesorders.deladd6, + salesorders.contactphone, + salesorders.contactemail, + salesorders.freightcost, + salesorders.deliverydate, + debtorsmaster.currcode, + currencies.decimalplaces, + paymentterms.terms, + salesorders.fromstkloc, + salesorders.printedpackingslip, + salesorders.datepackingslipprinted, + salesorders.quotation, + salesorders.deliverblind, + debtorsmaster.customerpoline, + locations.locationname, + custbranch.estdeliverydays, + custbranch.salesman + FROM salesorders + INNER JOIN debtorsmaster + ON salesorders.debtorno = debtorsmaster.debtorno + INNER JOIN salestypes + ON salesorders.ordertype=salestypes.typeabbrev + INNER JOIN custbranch + ON salesorders.debtorno = custbranch.debtorno + AND salesorders.branchcode = custbranch.branchcode + INNER JOIN paymentterms + ON debtorsmaster.paymentterms=paymentterms.termsindicator + INNER JOIN locations + ON locations.loccode=salesorders.fromstkloc + INNER JOIN currencies + ON debtorsmaster.currcode=currencies.currabrev + WHERE salesorders.orderno = '" . $_GET['ModifyOrderNumber'] . "'"; $ErrMsg = _('The order cannot be retrieved because'); $GetOrdHdrResult = DB_query($OrderHeaderSQL,$db,$ErrMsg); @@ -224,32 +224,32 @@ while ($myrow=db_fetch_array($LineItemsResult)) { if ($myrow['completed']==0){ $_SESSION['Items'.$identifier]->add_to_cart($myrow['stkcode'], - $myrow['quantity'], - $myrow['description'], - $myrow['unitprice'], - $myrow['discountpercent'], - $myrow['units'], - $myrow['volume'], - $myrow['kgs'], - $myrow['qohatloc'], - $myrow['mbflag'], - $myrow['actualdispatchdate'], - $myrow['qtyinvoiced'], - $myrow['discountcategory'], - 0, /*Controlled*/ - ... [truncated message content] |
From: <dai...@us...> - 2011-07-17 03:32:03
|
Revision: 4634 http://web-erp.svn.sourceforge.net/web-erp/?rev=4634&view=rev Author: daintree Date: 2011-07-17 03:31:55 +0000 (Sun, 17 Jul 2011) Log Message: ----------- credit tax cock-up fixed Modified Paths: -------------- trunk/Credit_Invoice.php trunk/SelectCreditItems.php trunk/SelectOrderItems.php trunk/doc/Change.log Modified: trunk/Credit_Invoice.php =================================================================== --- trunk/Credit_Invoice.php 2011-07-16 03:37:58 UTC (rev 4633) +++ trunk/Credit_Invoice.php 2011-07-17 03:31:55 UTC (rev 4634) @@ -181,7 +181,7 @@ } else { /* there are no stock movement records created for that invoice */ - echo '<div class="centre"><a href="' . $rootpath . '/index.php?' . SID . '">' . _('Back to the menu') . '</a></div>'; + echo '<div class="centre"><a href="' . $rootpath . '/index.php">' . _('Back to the menu') . '</a></div>'; prnMsg( _('There are no line items that were retrieved for this invoice') . '. ' . _('The automatic credit program can not create a credit note from this invoice'),'warn'); include('includes/footer.inc'); exit; @@ -350,9 +350,6 @@ $TaxLineTotal =0; //initialise tax total for the line if (is_array($LnItm->Taxes) ){ foreach ($LnItm->Taxes as $Tax) { - $TaxTotals[$Tax->TaxAuthID]=0; - } - foreach ($LnItm->Taxes as $Tax) { if ($i>0){ echo '<br />'; } @@ -673,9 +670,9 @@ if ($MBFlag=='B' OR $MBFlag=='M') { $SQL = "UPDATE locstock - SET locstock.quantity = locstock.quantity + " . $CreditLine->QtyDispatched . " - WHERE locstock.stockid = '" . $CreditLine->StockID . "' - AND loccode = '" . $_SESSION['CreditItems']->Location . "'"; + SET locstock.quantity = locstock.quantity + " . $CreditLine->QtyDispatched . " + WHERE locstock.stockid = '" . $CreditLine->StockID . "' + AND loccode = '" . $_SESSION['CreditItems']->Location . "'"; $ErrMsg = _('CRITICAL ERROR') . '! ' . _('NOTE DOWN THIS ERROR AND SEEK ASSISTANCE') . ': ' . _('Location stock record could not be updated because'); $DbgMsg = _('The following SQL to update the location stock record was used'); @@ -686,18 +683,17 @@ and of course update the Location stock balances */ $StandardCost =0; /*To start with - accumulate the cost of the comoponents for use in journals later on */ - $sql = "SELECT - bom.component, - bom.quantity, - stockmaster.materialcost - + stockmaster.labourcost - + stockmaster.overheadcost AS standard - FROM bom, - stockmaster - WHERE bom.component=stockmaster.stockid - AND bom.parent='" . $CreditLine->StockID . "' - AND bom.effectiveto > '" . Date('Y-m-d') . "' - AND bom.effectiveafter < '" . Date('Y-m-d') . "'"; + $sql = "SELECT bom.component, + bom.quantity, + stockmaster.materialcost + + stockmaster.labourcost + + stockmaster.overheadcost AS standard + FROM bom, + stockmaster + WHERE bom.component=stockmaster.stockid + AND bom.parent='" . $CreditLine->StockID . "' + AND bom.effectiveto > '" . Date('Y-m-d') . "' + AND bom.effectiveafter < '" . Date('Y-m-d') . "'"; $ErrMsg = _('Could not retrieve assembly components from the database for') . ' ' . $CreditLine->StockID . ' ' . _('because'); $DbgMsg = _('The SQL that failed was'); Modified: trunk/SelectCreditItems.php =================================================================== --- trunk/SelectCreditItems.php 2011-07-16 03:37:58 UTC (rev 4633) +++ trunk/SelectCreditItems.php 2011-07-17 03:31:55 UTC (rev 4634) @@ -20,7 +20,7 @@ if (isset($_POST['ProcessCredit']) AND !isset($_SESSION['CreditItems'])){ prnMsg(_('This credit note has already been processed. Refreshing the page will not enter the credit note again') . '<br />' . _('Please use the navigation links provided rather than using the browser back button and then having to refresh'),'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; } @@ -37,62 +37,66 @@ if (!isset($_SESSION['CreditItems'])){ /* It must be a new credit note being created $_SESSION['CreditItems'] would be set up from a previous call*/ - $_SESSION['CreditItems'] = new cart; + $_SESSION['CreditItems'] = new cart; - $_SESSION['RequireCustomerSelection'] = 1; + $_SESSION['RequireCustomerSelection'] = 1; } if (isset($_POST['ChangeCustomer'])){ - $_SESSION['RequireCustomerSelection']=1; + $_SESSION['RequireCustomerSelection']=1; } if (isset($_POST['Quick'])){ - unset($_POST['PartSearch']); + unset($_POST['PartSearch']); } if (isset($_POST['CancelCredit'])) { - unset($_SESSION['CreditItems']->LineItems); - unset($_SESSION['CreditItems']); - $_SESSION['CreditItems'] = new cart; - $_SESSION['RequireCustomerSelection'] = 1; + unset($_SESSION['CreditItems']->LineItems); + unset($_SESSION['CreditItems']); + $_SESSION['CreditItems'] = new cart; + $_SESSION['RequireCustomerSelection'] = 1; } if (isset($_POST['SearchCust']) AND $_SESSION['RequireCustomerSelection']==1){ - if ($_POST['Keywords'] AND $_POST['CustCode']) { + if ($_POST['Keywords'] AND $_POST['CustCode']) { prnMsg( _('Customer name keywords have been used in preference to the customer code extract entered'), 'info' ); - } - if ($_POST['Keywords']=='' AND $_POST['CustCode']=='') { + } + if ($_POST['Keywords']=='' AND $_POST['CustCode']=='') { prnMsg( _('At least one Customer Name keyword OR an extract of a Customer Code must be entered for the search'), 'info' ); - } else { - If (mb_strlen($_POST['Keywords'])>0) { + } else { + if (mb_strlen($_POST['Keywords'])>0) { //insert wildcard characters in spaces $SearchString = '%' . str_replace(' ', '%', $_POST['Keywords']) . '%'; - $SQL = 'SELECT - custbranch.debtorno, - custbranch.brname, - custbranch.contactname, - custbranch.phoneno, - custbranch.faxno, - custbranch.branchcode - FROM custbranch - WHERE custbranch.brname ' . LIKE . " '" . $SearchString . "' - AND custbranch.disabletrans='0'"; + $SQL = "SELECT debtorsmaster.name, + custbranch.debtorno, + custbranch.brname, + custbranch.contactname, + custbranch.phoneno, + custbranch.faxno, + custbranch.branchcode + FROM custbranch + INNER JOIN debtorsmaster + ON custbranch.debtorno=debtorsmaster.debtorno + WHERE custbranch.brname " . LIKE . " '" . $SearchString . "' + AND custbranch.disabletrans='0'"; } elseif (mb_strlen($_POST['CustCode'])>0){ - $SQL = 'SELECT - custbranch.debtorno, - custbranch.brname, - custbranch.contactname, - custbranch.phoneno, - custbranch.faxno, - custbranch.branchcode - FROM custbranch - WHERE custbranch.branchcode ' . LIKE . "'%" . $_POST['CustCode'] . "%' - AND custbranch.disabletrans='0'"; + $SQL = "SELECT debtorsmaster.name, + custbranch.debtorno, + custbranch.brname, + custbranch.contactname, + custbranch.phoneno, + custbranch.faxno, + custbranch.branchcode + FROM custbranch + INNER JOIN debtorsmaster + ON custbranch.debtorno=debtorsmaster.debtorno + WHERE custbranch.debtorno " . LIKE . "'%" . $_POST['CustCode'] . "%' + AND custbranch.disabletrans='0'"; } $ErrMsg = _('Customer branch records requested cannot be retrieved because'); @@ -102,7 +106,8 @@ if (DB_num_rows($result_CustSelect)==1){ $myrow=DB_fetch_array($result_CustSelect); - $_POST['Select'] = $myrow['debtorno'] . ' - ' . $myrow['branchcode']; + $SelectedCustomer = trim($myrow['debtorno']); + $SelectedBranch = trim($myrow['branchcode']); } elseif (DB_num_rows($result_CustSelect)==0){ prnMsg(_('Sorry') . ' ... ' . _('there are no customer branch records contain the selected text') . ' - ' . _('please alter your search criteria and try again'),'info'); } @@ -111,156 +116,156 @@ } /*end of if search button for customers was hit*/ -if (isset($_POST['Select']) AND $_POST['Select']!='') { +if (isset($_POST['JustSelectedACustomer']) AND !isset($SelectedCustomer)){ + /*Need to figure out the number of the form variable that the user clicked on */ + for ($i=1;$i<count($_POST);$i++){ //loop through the returned customers + if(isset($_POST['SubmitCustomerSelection'.$i])){ + break; + } + } + if ($i==count($_POST)){ + prnMsg(_('Unable to identify the selected customer'),'error'); + } else { + $SelectedCustomer = trim($_POST['SelectedCustomer'.$i]); + $SelectedBranch = trim($_POST['SelectedBranch'.$i]); + } +} + +if (isset($SelectedCustomer) AND isset($_POST['JustSelectedACustomer'])) { + /*will only be true if page called from customer selection form -parse the $Select string into customer code and branch code */ + Now retrieve customer information - name, salestype, currency, terms etc +*/ - $_SESSION['CreditItems']->Branch = mb_substr($_POST['Select'],mb_strpos($_POST['Select'],' - ')+3); - $_POST['Select'] = mb_substr($_POST['Select'],0,mb_strpos($_POST['Select'],' - ')); + $_SESSION['CreditItems']->DebtorNo = $SelectedCustomer; + $_SESSION['CreditItems']->Branch = $SelectedBranch; + $_SESSION['RequireCustomerSelection'] = 0; -/*Now retrieve customer information - name, salestype, currency, terms etc */ +/* default the branch information from the customer branches table CustBranch -particularly where the stock +will be booked back into. */ - $sql = "SELECT - debtorsmaster.name, - debtorsmaster.salestype, - debtorsmaster.currcode, - currencies.rate - FROM debtorsmaster, - currencies - WHERE debtorsmaster.currcode=currencies.currabrev - AND debtorsmaster.debtorno = '" . $_POST['Select'] . "'"; - - $ErrMsg = _('The customer record of the customer selected') . ': ' . $_POST['Select'] . ' ' . _('cannot be retrieved because'); - $DbgMsg = _('The SQL used to retrieve the customer details and failed was'); + $sql = "SELECT debtorsmaster.name, + debtorsmaster.salestype, + debtorsmaster.currcode, + currencies.rate, + currencies.decimalplaces, + custbranch.brname, + custbranch.braddress1, + custbranch.braddress2, + custbranch.braddress3, + custbranch.braddress4, + custbranch.braddress5, + custbranch.braddress6, + custbranch.phoneno, + custbranch.email, + custbranch.defaultlocation, + custbranch.taxgroupid, + locations.taxprovinceid + FROM custbranch + INNER JOIN locations ON locations.loccode=custbranch.defaultlocation + INNER JOIN debtorsmaster ON custbranch.debtorno=debtorsmaster.debtorno + INNER JOIN currencies ON debtorsmaster.currcode=currencies.currabrev + WHERE custbranch.branchcode='" . $_SESSION['CreditItems']->Branch . "' + AND custbranch.debtorno = '" . $_SESSION['CreditItems']->DebtorNo . "'"; + + $ErrMsg = _('The customer branch record of the customer selected') . ': ' . $SelectedCustomer . ' ' . _('cannot be retrieved because'); + $DbgMsg = _('SQL used to retrieve the branch details was'); $result =DB_query($sql,$db,$ErrMsg,$DbgMsg); - $myrow = DB_fetch_row($result); + $myrow = DB_fetch_array($result); - $_SESSION['CreditItems']->DebtorNo = $_POST['Select']; - $_SESSION['RequireCustomerSelection'] = 0; - $_SESSION['CreditItems']->CustomerName = $myrow[0]; - /* the sales type determines the price list to be used by default the customer of the user is defaulted from the entry of the userid and password. */ - - $_SESSION['CreditItems']->DefaultSalesType = $myrow[1]; - $_SESSION['CreditItems']->DefaultCurrency = $myrow[2]; - $_SESSION['CurrencyRate'] = $myrow[3]; - -/* default the branch information from the customer branches table CustBranch -particularly where the stock -will be booked back into. */ - - $sql = "SELECT - custbranch.brname, - custbranch.braddress1, - custbranch.braddress2, - custbranch.braddress3, - custbranch.braddress4, - custbranch.braddress5, - custbranch.braddress6, - custbranch.phoneno, - custbranch.email, - custbranch.defaultlocation, - custbranch.taxgroupid, - locations.taxprovinceid - FROM custbranch - INNER JOIN locations ON locations.loccode=custbranch.defaultlocation - WHERE custbranch.branchcode='" . $_SESSION['CreditItems']->Branch . "' - AND custbranch.debtorno = '" . $_SESSION['CreditItems']->DebtorNo . "'"; - - $ErrMsg = _('The customer branch record of the customer selected') . ': ' . $_POST['Select'] . ' ' . _('cannot be retrieved because'); - $DbgMsg = _('SQL used to retrieve the branch details was'); - $result =DB_query($sql,$db,$ErrMsg,$DbgMsg); - - $myrow = DB_fetch_array($result); - $_SESSION['CreditItems']->DeliverTo = $myrow['brname']; - $_SESSION['CreditItems']->BrAdd1 = $myrow['braddress1']; - $_SESSION['CreditItems']->BrAdd2 = $myrow['braddress2']; - $_SESSION['CreditItems']->BrAdd3 = $myrow['braddress3']; - $_SESSION['CreditItems']->BrAdd4 = $myrow['braddress4']; - $_SESSION['CreditItems']->BrAdd5 = $myrow['braddress5']; - $_SESSION['CreditItems']->BrAdd6 = $myrow['braddress6']; - $_SESSION['CreditItems']->PhoneNo = $myrow['phoneno']; - $_SESSION['CreditItems']->Email = $myrow['email']; - $_SESSION['CreditItems']->Location = $myrow['defaultlocation']; - $_SESSION['CreditItems']->TaxGroup = $myrow['taxgroupid']; - $_SESSION['CreditItems']->DispatchTaxProvince = $myrow['taxprovinceid']; - $_SESSION['CreditItems']->GetFreightTaxes(); + $_SESSION['CreditItems']->CustomerName = $myrow['name']; + $_SESSION['CreditItems']->DefaultSalesType = $myrow['salestype']; + $_SESSION['CreditItems']->DefaultCurrency = $myrow['currcode']; + $_SESSION['CreditItems']->CurrDecimalPlaces = $myrow['decimalplaces']; + $_SESSION['CurrencyRate'] = $myrow['rate']; + $_SESSION['CreditItems']->DeliverTo = $myrow['brname']; + $_SESSION['CreditItems']->BrAdd1 = $myrow['braddress1']; + $_SESSION['CreditItems']->BrAdd2 = $myrow['braddress2']; + $_SESSION['CreditItems']->BrAdd3 = $myrow['braddress3']; + $_SESSION['CreditItems']->BrAdd4 = $myrow['braddress4']; + $_SESSION['CreditItems']->BrAdd5 = $myrow['braddress5']; + $_SESSION['CreditItems']->BrAdd6 = $myrow['braddress6']; + $_SESSION['CreditItems']->PhoneNo = $myrow['phoneno']; + $_SESSION['CreditItems']->Email = $myrow['email']; + $_SESSION['CreditItems']->Location = $myrow['defaultlocation']; + $_SESSION['CreditItems']->TaxGroup = $myrow['taxgroupid']; + $_SESSION['CreditItems']->DispatchTaxProvince = $myrow['taxprovinceid']; + $_SESSION['CreditItems']->GetFreightTaxes(); } - - /* if the change customer button hit or the customer has not already been selected */ if ($_SESSION['RequireCustomerSelection'] ==1 OR !isset($_SESSION['CreditItems']->DebtorNo) OR $_SESSION['CreditItems']->DebtorNo=='' ) { - 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 '<p class="page_title_text"><img src="' . $rootpath . '/css/' . $theme . '/images/magnifier.png" title="' . _('Search') . '" alt="" />' . ' ' . _('Select Customer For Credit Note').'</p>'; - echo '<table cellpadding=3 colspan=4 class=selection>'; - echo '<tr><th colspan=5><font size=3 color=navy><b> ' . _('Customer Selection') . '</b></font></th></tr>'; + echo '<table cellpadding="3" colspan="4" class="selection">'; + echo '<tr><th colspan="5"><font size="3" color="navy"><b> ' . _('Customer Selection') . '</b></font></th></tr>'; echo '<tr>'; - echo '<td><font size=1>' . _('Enter text in the customer name') . ':</font></td>'; - echo '<td><input type="Text" name="Keywords" size=20 maxlength=25></td>'; - echo '<td><font size=3><b>' . _('OR') . '</b></font></td>'; - echo '<td><font size=1>' . _('Enter text extract in the customer code') . ':</font></td>'; - echo '<td><input type="Text" name="CustCode" size=15 maxlength=18></td>'; + echo '<td><font size="1">' . _('Enter text in the customer name') . ':</font></td>'; + echo '<td><input type="text" name="Keywords" size=20 maxlength=25></td>'; + echo '<td><font size="3"><b>' . _('OR') . '</b></font></td>'; + echo '<td><font size="1">' . _('Enter text extract in the customer code') . ':</font></td>'; + echo '<td><input type="text" name="CustCode" size="15" maxlength="18"></td>'; echo '</tr>'; echo '</table>'; - echo '<br /><div class="centre"><input type=submit name="SearchCust" VALUE="' . _('Search Now') . '"></div>'; + echo '<br /><div class="centre"><input type="submit" name="SearchCust" value="' . _('Search Now') . '"></div>'; if (isset($result_CustSelect)) { - echo '<br /><table cellpadding=2 colspan=7 class=selection>'; + echo '<table cellpadding="2" colspan="7">'; - $TableHeader = '<tr> - <th>' . _('Code') . '</th> + $TableHeader = '<br /> + <tr> + <th>' . _('Customer') . '</th> <th>' . _('Branch') . '</th> <th>' . _('Contact') . '</th> <th>' . _('Phone') . '</th> <th>' . _('Fax') . '</th> - </tr>'; + </tr>'; + echo $TableHeader; - echo $TableHeader; + $j = 1; + $k = 0; //row counter to determine background colour + $LastCustomer=''; + while ($myrow=DB_fetch_array($result_CustSelect)) { - $j = 1; - $k = 0; //row counter to determine background colour + if ($k==1){ + echo '<tr class="EvenTableRows">'; + $k=0; + } else { + echo '<tr class="OddTableRows">'; + $k=1; + } + echo '<form action="' . $_SERVER['PHP_SELF'] . '?identifier='.$identifier . '" name="SelectParts" method="post">'; + echo '<input type="hidden" name="FormID" value="' . $_SESSION['FormID'] . '" />'; + if ($LastCustomer != $myrow['name']) { + echo '<td>'.$myrow['name'].'</td>'; + } else { + echo '<td></td>'; + } + echo '<td><input tabindex='.($j+5).' type=submit name="SubmitCustomerSelection' . $j .'" value="' . htmlentities($myrow['brname'], ENT_QUOTES,'UTF-8'). '"></td> + <input type="hidden" name="SelectedCustomer' . $j .'" value="'.$myrow['debtorno'].'"><input type="hidden" name="SelectedBranch' . $j .'" value="'. $myrow['branchcode'].'" /> + <td>'.$myrow['contactname'].'</td> + <td>'.$myrow['phoneno'].'</td> + <td>'.$myrow['faxno'].'</td> + </tr>'; + $LastCustomer=$myrow['name']; + $j++; + //end of page full new headings if + } //end of while loop + echo '<input type="hidden" name="JustSelectedACustomer" value="Yes">'; + echo '</table></form>'; - while ($myrow=DB_fetch_array($result_CustSelect)) { - - if ($k==1){ - echo '<tr class="EvenTableRows">'; - $k=0; - } else { - echo '<tr class="OddTableRows">'; - $k=1; - } - - printf("<td><font size=1><input type=submit name='Select' VALUE='%s - %s'</font></td> - <td><font size=1>%s</font></td> - <td><font size=1>%s</font></td> - <td><font size=1>%s</font></td> - <td><font size=1>%s</font></td> - </tr>", - $myrow['debtorno'], - $myrow['branchcode'], - $myrow['brname'], - $myrow['contactname'], - $myrow['phoneno'], - $myrow['faxno']); - -//end of page full new headings if - } -//end of while loop - - echo '</table>'; - - } -//end if results to show - + }//end if results to show + //end if RequireCustomerSelection } else { /* everything below here only do if a customer is selected @@ -424,21 +429,20 @@ if ($AlreadyOnThisCredit!=1){ - $sql = "SELECT - stockmaster.description, - stockmaster.stockid, - stockmaster.units, - stockmaster.volume, - stockmaster.kgs, - (materialcost+labourcost+overheadcost) AS standardcost, - stockmaster.mbflag, - stockmaster.decimalplaces, - stockmaster.controlled, - stockmaster.serialised, - stockmaster.discountcategory, - stockmaster.taxcatid - FROM stockmaster - WHERE stockmaster.stockid = '". $_POST['NewItem'] . "'"; + $sql = "SELECT stockmaster.description, + stockmaster.stockid, + stockmaster.units, + stockmaster.volume, + stockmaster.kgs, + (materialcost+labourcost+overheadcost) AS standardcost, + stockmaster.mbflag, + stockmaster.decimalplaces, + stockmaster.controlled, + stockmaster.serialised, + stockmaster.discountcategory, + stockmaster.taxcatid + FROM stockmaster + WHERE stockmaster.stockid = '". $_POST['NewItem'] . "'"; $ErrMsg = _('There is a problem selecting the part because'); $result1 = DB_query($sql,$db,$ErrMsg); @@ -505,7 +509,7 @@ $_SESSION['CreditItems']->FreightCost = $_POST['ChargeFreightCost']; } - If (isset($_POST['Location']) AND $_POST['Location'] != $_SESSION['CreditItems']->Location){ + if (isset($_POST['Location']) AND $_POST['Location'] != $_SESSION['CreditItems']->Location){ $_SESSION['CreditItems']->Location = $_POST['Location']; @@ -541,7 +545,7 @@ $Price = $_POST['Price_' . $LineItem->LineNumber]; } - $DiscountPercentage = $_POST['Discount_' . $LineItem->LineNumber]; + $DiscountPercentage = $_POST['Discount_' . $LineItem->LineNumber]; foreach ($LineItem->Taxes as $TaxLine) { if (isset($_POST[$LineItem->LineNumber . $TaxLine->TaxCalculationOrder . '_TaxRate'])){ @@ -552,7 +556,15 @@ if ($Quantity<0 OR $Price <0 OR $DiscountPercentage >100 OR $DiscountPercentage <0){ prnMsg(_('The item could not be updated because you are attempting to set the quantity credited to less than 0 or the price less than 0 or the discount more than 100% or less than 0%'),'warn'); } elseif (isset($_POST['Quantity_' . $LineItem->LineNumber])) { - $_SESSION['CreditItems']->update_cart_item($LineItem->LineNumber, $Quantity, $Price, $DiscountPercentage/100, $Narrative, 'No', $LineItem->ItemDue, $LineItem->POLine, 0); + $_SESSION['CreditItems']->update_cart_item($LineItem->LineNumber, + $Quantity, + $Price, + $DiscountPercentage/100, + $Narrative, + 'No', + $LineItem->ItemDue, + $LineItem->POLine, + 0); } } @@ -564,7 +576,7 @@ } } - If (isset($_POST['NewItem'])){ + if (isset($_POST['NewItem'])){ /* get the item details from the database and hold them in the cart object make the quantity 1 by default then add it to the cart */ $AlreadyOnThisCredit =0; @@ -583,19 +595,19 @@ if ($AlreadyOnThisCredit!=1){ $sql = "SELECT stockmaster.description, - stockmaster.stockid, - stockmaster.units, - stockmaster.volume, - stockmaster.kgs, - stockmaster.mbflag, - stockmaster.discountcategory, - stockmaster.controlled, - stockmaster.decimalplaces, - stockmaster.serialised, - (materialcost+labourcost+overheadcost) AS standardcost, - stockmaster.taxcatid - FROM stockmaster - WHERE stockmaster.stockid = '". $_POST['NewItem'] . "'"; + stockmaster.stockid, + stockmaster.units, + stockmaster.volume, + stockmaster.kgs, + stockmaster.mbflag, + stockmaster.discountcategory, + stockmaster.controlled, + stockmaster.decimalplaces, + stockmaster.serialised, + (materialcost+labourcost+overheadcost) AS standardcost, + stockmaster.taxcatid + FROM stockmaster + WHERE stockmaster.stockid = '". $_POST['NewItem'] . "'"; $ErrMsg = _('The item details could not be retrieved because'); $DbgMsg = _('The SQL used to retrieve the item details but failed was'); @@ -644,21 +656,21 @@ /* This is where the credit note as selected should be displayed reflecting any deletions or insertions*/ - echo '<table cellpadding=2 colspan=7 class=selection> - <tr> - <th>' . _('Item Code') . '</th> - <th>' . _('Item Description') . '</th> - <th>' . _('Quantity') . '</th> - <th>' . _('Unit') . '</th> - <th>' . _('Price') . '</th> - <th>' . _('Gross') . '</th> - <th>' . _('Discount') . '</th> - <th>' . _('Total') . '<br />' . _('Excl Tax') . '</th> - <th>' . _('Tax Authority') . '</th> - <th>' . _('Tax') . '<br />' . _('Rate') . '</th> - <th>' . _('Tax') . '<br />' . _('Amount') . '</th> - <th>' . _('Total') . '<br />' . _('Incl Tax') . '</th> - </tr>'; + echo '<table cellpadding="2" colspan="7" class="selection"> + <tr> + <th>' . _('Item Code') . '</th> + <th>' . _('Item Description') . '</th> + <th>' . _('Quantity') . '</th> + <th>' . _('Unit') . '</th> + <th>' . _('Price') . '</th> + <th>' . _('Gross') . '</th> + <th>' . _('Discount') . '</th> + <th>' . _('Total') . '<br />' . _('Excl Tax') . '</th> + <th>' . _('Tax Authority') . '</th> + <th>' . _('Tax') . '<br />' . _('Rate') . '</th> + <th>' . _('Tax') . '<br />' . _('Amount') . '</th> + <th>' . _('Total') . '<br />' . _('Incl Tax') . '</th> + </tr>'; $_SESSION['CreditItems']->total = 0; $_SESSION['CreditItems']->totalVolume = 0; @@ -671,8 +683,8 @@ $k =0; //row colour counter foreach ($_SESSION['CreditItems']->LineItems as $LineItem) { - $LineTotal = $LineItem->Quantity * $LineItem->Price * (1 - $LineItem->DiscountPercent); - $DisplayLineTotal = number_format($LineTotal,2); + $LineTotal = round($LineItem->Quantity * $LineItem->Price * (1 - $LineItem->DiscountPercent),$_SESSION['CreditItems']->CurrDecimalPlaces); + $DisplayLineTotal = number_format($LineTotal,$_SESSION['CreditItems']->CurrDecimalPlaces); if ($k==1){ $RowStarter = '<tr class="EvenTableRows">'; @@ -686,16 +698,16 @@ <td>' . $LineItem->ItemDescription . '</td>'; if ($LineItem->Controlled==0){ - echo '<td><input type="text" class="number" name="Quantity_' . $LineItem->LineNumber . '" maxlength=6 size=6 VALUE=' . $LineItem->Quantity . '></td>'; + echo '<td><input type="text" class="number" name="Quantity_' . $LineItem->LineNumber . '" maxlength=6 size=6 value=' . $LineItem->Quantity . '></td>'; } else { - echo '<td class=number><a href="' . $rootpath . '/CreditItemsControlled.php?' . SID . '&LineNo=' . $LineItem->LineNumber . '">' . $LineItem->Quantity . '</a> + echo '<td class=number><a href="' . $rootpath . '/CreditItemsControlled.php?LineNo=' . $LineItem->LineNumber . '">' . $LineItem->Quantity . '</a> <input type=hidden name="Quantity_' . $LineItem->LineNumber . '" value=' . $LineItem->Quantity . '></td>'; } echo '<td>' . $LineItem->Units . '</td> - <td><input type="text" class="number" name="Price_' . $LineItem->LineNumber . '" size=10 maxlength=12 VALUE=' . $LineItem->Price . '></td> - <td><input type="CheckBox" name="Gross" VALUE=False></td> - <td><input type="text" class="number" name="Discount_' . $LineItem->LineNumber . '" size=3 maxlength=3 VALUE=' . ($LineItem->DiscountPercent * 100) . '>%</td> + <td><input type="text" class="number" name="Price_' . $LineItem->LineNumber . '" size=10 maxlength=12 value=' . $LineItem->Price . '></td> + <td><input type="CheckBox" name="Gross" value=False></td> + <td><input type="text" class="number" name="Discount_' . $LineItem->LineNumber . '" size=3 maxlength=3 value=' . ($LineItem->DiscountPercent * 100) . '>%</td> <td class=number>' . $DisplayLineTotal . '</td>'; @@ -716,9 +728,6 @@ $TaxLineTotal =0; //initialise tax total for the line foreach ($LineItem->Taxes AS $Tax) { - $TaxTotals[$Tax->TaxAuthID] =0; - } - foreach ($LineItem->Taxes AS $Tax) { if ($i>0){ echo '<br />'; } @@ -737,14 +746,12 @@ $TaxTotal += $TaxLineTotal; - $DisplayTaxAmount = number_format($TaxLineTotal ,2); - $DisplayGrossLineTotal = number_format($LineTotal+ $TaxLineTotal,2); + $DisplayTaxAmount = number_format($TaxLineTotal ,$_SESSION['CreditItems']->CurrDecimalPlaces); + $DisplayGrossLineTotal = number_format($LineTotal+ $TaxLineTotal,$_SESSION['CreditItems']->CurrDecimalPlaces); - echo '<td class=number>' . $DisplayTaxAmount . '</td> - <td class=number>' . $DisplayGrossLineTotal . '</td> - <td><a href="' . $_SERVER['PHP_SELF'] . '?' . SID . '&Delete=' . $LineItem->LineNumber . '" onclick="return confirm(\'' . _('Are you sure you wish to delete this line item from the credit note?') . '\');">' . _('Delete') . '</a></td> - - + echo '<td class="number">' . $DisplayTaxAmount . '</td> + <td class="number">' . $DisplayGrossLineTotal . '</td> + <td><a href="' . $_SERVER['PHP_SELF'] . '?Delete=' . $LineItem->LineNumber . '" onclick="return confirm(\'' . _('Are you sure you wish to delete this line item from the credit note?') . '\');">' . _('Delete') . '</a></td> </tr>'; echo $RowStarter; @@ -762,8 +769,8 @@ <td colspan=5></td>'; - echo '<td colspan=2 class=number>'. _('Credit Freight').'</td> - <td><input type="text" class="number" size=6 maxlength=6 name=ChargeFreightCost VALUE=' . $_SESSION['CreditItems']->FreightCost . '></td>'; + echo '<td colspan="2" class="number">'. _('Credit Freight').'</td> + <td><input type="text" class="number" size=6 maxlength=6 name="ChargeFreightCost" value="' . $_SESSION['CreditItems']->FreightCost . '" /></td>'; $FreightTaxTotal =0; //initialise tax total @@ -786,7 +793,7 @@ echo '<br />'; } - echo '<input type="text" class="number" name=FreightTaxRate' . $FreightTaxLine->TaxCalculationOrder . ' maxlength=4 size=4 VALUE=' . $FreightTaxLine->TaxRate * 100 . '>'; + echo '<input type="text" class="number" name=FreightTaxRate' . $FreightTaxLine->TaxCalculationOrder . ' maxlength=4 size=4 value="' . $FreightTaxLine->TaxRate * 100 . '" />'; if ($FreightTaxLine->TaxOnTax ==1){ $TaxTotals[$FreightTaxLine->TaxAuthID] += ($FreightTaxLine->TaxRate * ($_SESSION['CreditItems']->FreightCost + $FreightTaxTotal)); @@ -800,38 +807,43 @@ } echo '</td>'; - echo '<td class=number>' . number_format($FreightTaxTotal,2) . '</td> - <td class=number>' . number_format($FreightTaxTotal+ $_SESSION['CreditItems']->FreightCost,2) . '</td> + echo '<td class="number">' . number_format($FreightTaxTotal,$_SESSION['CreditItems']->CurrDecimalPlaces) . '</td> + <td class="number">' . number_format($FreightTaxTotal+ $_SESSION['CreditItems']->FreightCost,$_SESSION['CreditItems']->CurrDecimalPlaces) . '</td> </tr>'; $TaxTotal += $FreightTaxTotal; - $DisplayTotal = number_format($_SESSION['CreditItems']->total + $_SESSION['CreditItems']->FreightCost,2); + $DisplayTotal = number_format($_SESSION['CreditItems']->total + $_SESSION['CreditItems']->FreightCost,$_SESSION['CreditItems']->CurrDecimalPlaces); - echo '<tr> - <td colspan=7 class=number>' . _('Credit Totals') . "</td> - <td class=number><b>$DisplayTotal</b></td> - <td colspan=2></td> - <td class=number><b>" . number_format($TaxTotal,2) . "</td> - <td class=number><b>" . number_format($TaxTotal+($_SESSION['CreditItems']->total + $_SESSION['CreditItems']->FreightCost),2) . "</b></td> - </tr></table>"; + <td colspan="7" class="number">' . _('Credit Totals') . '</td> + <td class="number"><b>' . $DisplayTotal . '</b></td> + <td colspan="2"></td> + <td class="number"><b>' . number_format($TaxTotal,$_SESSION['CreditItems']->CurrDecimalPlaces) . '</td> + <td class="number"><b>' . number_format($TaxTotal+($_SESSION['CreditItems']->total + $_SESSION['CreditItems']->FreightCost),$_SESSION['CreditItems']->CurrDecimalPlaces) . '</b></td> + </tr> + </table>'; /*Now show options for the credit note */ - echo '<br /><table class=selection><tr><td>' . _('Credit Note Type') . ' :</td><td><select name=CreditType>'; + echo '<br /> + <table class="selection"> + <tr> + <td>' . _('Credit Note Type') . ' :</td> + <td><select name="CreditType">'; + if (!isset($_POST['CreditType']) OR $_POST['CreditType']=='Return'){ - echo '<option selected value="Return">' . _('Goods returned to store') . '</option>'; - echo '<option value="WriteOff">' . _('Goods written off') . '</option>'; - echo '<option value="ReverseOverCharge">' . _('Reverse an Overcharge') . '</option>'; + echo '<option selected value="Return">' . _('Goods returned to store') . '</option> + <option value="WriteOff">' . _('Goods written off') . '</option> + <option value="ReverseOverCharge">' . _('Reverse an Overcharge') . '</option>'; } elseif ($_POST['CreditType']=='WriteOff') { - echo '<option selected value="WriteOff">' . _('Goods written off') . '</option>'; - echo '<option value="Return">' . _('Goods returned to store') . '</option>'; - echo '<option value="ReverseOverCharge">' . _('Reverse an Overcharge') . '</option>'; + echo '<option selected value="WriteOff">' . _('Goods written off') . '</option> + <option value="Return">' . _('Goods returned to store') . '</option> + <option value="ReverseOverCharge">' . _('Reverse an Overcharge') . '</option>'; } elseif($_POST['CreditType']=='ReverseOverCharge'){ - echo '<option selected value="ReverseOverCharge">' . _('Reverse Overcharge Only') . '</option>'; - echo '<option value="Return">' . _('Goods Returned To Store') . '</option>'; - echo '<option value="WriteOff">' . _('Good written off') . '</option>'; + echo '<option selected value="ReverseOverCharge">' . _('Reverse Overcharge Only') . '</option> + <option value="Return">' . _('Goods Returned To Store') . '</option> + <option value="WriteOff">' . _('Good written off') . '</option>'; } echo '</select></td></tr>'; @@ -843,7 +855,7 @@ echo '<tr><td>' . _('Goods Returned to Location') . ' :</td><td><select name=Location>'; - $SQL='SELECT loccode, locationname FROM locations'; + $SQL="SELECT loccode, locationname FROM locations"; $Result = DB_query($SQL,$db); if (!isset($_POST['Location'])){ @@ -852,9 +864,9 @@ while ($myrow = DB_fetch_array($Result)) { if ($_POST['Location']==$myrow['loccode']){ - echo '<option selected VALUE="' . $myrow['loccode'] . '">' . $myrow['locationname'] . '</option>'; + echo '<option selected value="' . $myrow['loccode'] . '">' . $myrow['locationname'] . '</option>'; } else { - echo '<option VALUE="' . $myrow['loccode'] . '">' . $myrow['locationname'] . '</option>'; + echo '<option value="' . $myrow['loccode'] . '">' . $myrow['locationname'] . '</option>'; } } echo '</select></td></tr>'; @@ -863,20 +875,20 @@ echo '<tr><td>' . _('Write off the cost of the goods to') . '</td><td><select name=WriteOffGLCode>'; - $SQL='SELECT accountcode, - accountname - FROM chartmaster, - accountgroups - WHERE chartmaster.group_=accountgroups.groupname - AND accountgroups.pandl=1 ORDER BY accountcode'; + $SQL="SELECT accountcode, + accountname + FROM chartmaster, + accountgroups + WHERE chartmaster.group_=accountgroups.groupname + AND accountgroups.pandl=1 ORDER BY accountcode"; $Result = DB_query($SQL,$db); while ($myrow = DB_fetch_array($Result)) { if ($_POST['WriteOffGLCode']==$myrow['accountcode']){ - echo '<option selected VALUE=' . $myrow['accountcode'] . '>' . $myrow['accountcode'] . ' - ' . $myrow['accountname'] . '</option>'; + echo '<option selected value="' . $myrow['accountcode'] . '">' . $myrow['accountcode'] . ' - ' . $myrow['accountname'] . '</option>'; } else { - echo '<option VALUE=' . $myrow['accountcode'] . '>' . $myrow['accountcode'] . ' - ' . $myrow['accountname'] . '</option>'; + echo '<option value="' . $myrow['accountcode'] . '">' . $myrow['accountcode'] . ' - ' . $myrow['accountname'] . '</option>'; } } echo '</select></td></tr>'; @@ -885,7 +897,7 @@ $_POST['CreditText']=''; } echo '<tr><td>' . _('Credit Note Text') . ' :</td> - <td><textarea name=CreditText COLS=31 ROWS=5>' . $_POST['CreditText'] . '</textarea></td> + <td><textarea name="CreditText" COLS="31" rows="5">' . $_POST['CreditText'] . '</textarea></td> </tr> </table><br />'; @@ -895,11 +907,14 @@ prnMsg (_('The GL code to write off the credit value to must be specified. Please select the appropriate GL code for the selection box'),'info'); $OKToProcess = false; } - echo '<div class="centre"><input type=submit name="Update" VALUE="' . _('Update') . '"> - <input type=submit name="CancelCredit" VALUE="' . _('Cancel') . '" onclick="return confirm(\'' . _('Are you sure you wish to cancel the whole of this credit note?') . '\');">'; + echo '<div class="centre"> + <input type=submit name="Update" value="' . _('Update') . '" /> + <input type=submit name="CancelCredit" value="' . _('Cancel') . '" onclick="return confirm(\'' . _('Are you sure you wish to cancel the whole of this credit note?') . '\');" />'; if (!isset($_POST['ProcessCredit']) AND $OKToProcess == true){ - echo '<input type=submit name="ProcessCredit" VALUE="' . _('Process Credit Note') . '"></div><br />'; + echo '<input type=submit name="ProcessCredit" value="' . _('Process Credit Note') . '" /> + <br />'; } + echo '</div>'; } # end of if lines @@ -907,29 +922,31 @@ if (isset($_POST['PartSearch']) AND $_POST['PartSearch']!="" AND !isset($_POST['ProcessCredit'])){ - echo '<input type="hidden" name="PartSearch" value="' . _('Yes Please') . '">'; + echo '<input type="hidden" name="PartSearch" value="' . _('Yes Please') . '" />'; $SQL="SELECT categoryid, - categorydescription - FROM stockcategory - WHERE stocktype='F' - ORDER BY categorydescription"; + categorydescription + FROM stockcategory + WHERE stocktype='F' + ORDER BY categorydescription"; $result1 = DB_query($SQL,$db); - echo '<br /><table class=selection> - <tr><td>' . _('Select a stock category') . ': <select name="StockCat">'; + echo '<br /> + <table class="selection"> + <tr> + <td>' . _('Select a stock category') . ': <select name="StockCat">'; - echo '<option selected VALUE="All">' . _('All'); + echo '<option selected value="All">' . _('All'); while ($myrow1 = DB_fetch_array($result1)) { if (isset($_POST['StockCat']) and $_POST['StockCat']==$myrow1['categoryid']){ - echo '<option selected VALUE=' . $myrow1['categoryid'] . '>' . $myrow1['categorydescription'] . '</option>'; + echo '<option selected value=' . $myrow1['categoryid'] . '>' . $myrow1['categorydescription'] . '</option>'; } else { - echo '<option VALUE=' . $myrow1['categoryid'] . '>' . $myrow1['categorydescription'] . '</option>'; + echo '<option value=' . $myrow1['categoryid'] . '>' . $myrow1['categorydescription'] . '</option>'; } } - echo '</select>'; + echo '</select></td>'; if (!isset($_POST['Keywords'])) { $_POST['Keywords'] = ''; } @@ -940,22 +957,24 @@ echo '<td><input type="Text" name="Keywords" size="20" maxlength="25" value="' . $_POST['Keywords'] . '"></td></tr>'; echo '<tr><td></td>'; echo '<td><font SIZE="3"><b>' ._('OR') . '</b></font> ' . _('Enter extract of the Stock Code') . ': </td>'; - echo '<td><input type="Text" name="StockCode" size="15" maxlength="18" value="' . $_POST['StockCode'] . '"></td>'; + echo '<td><input type="text" name="StockCode" size="15" maxlength="18" value="' . $_POST['StockCode'] . '"></td>'; echo '</tr>'; - echo '</table><br /><div class="centre">'; + echo '</table> + <br /> + <div class="centre">'; - echo '<input type=submit name="Search" value="' . _('Search Now') .'">'; - echo '<input type=submit Name="ChangeCustomer" value="' . _('Change Customer') . '">'; - echo '<input type=submit Name="Quick" value="' . _('Quick Entry') . '">'; - echo '</div>'; + echo '<input type=submit name="Search" value="' . _('Search Now') .'" /> + <input type=submit Name="ChangeCustomer" value="' . _('Change Customer') . '" /> + <input type=submit Name="Quick" value="' . _('Quick Entry') . '" /> + </div>'; if (isset($SearchResult)) { - echo '<table cellpadding=2 colspan=7 class=selection>'; + echo '<table cellpadding="2" colspan="7" class="selection">'; $TableHeader = '<tr> - <th>' . _('Code') . '</th> - <th>' . _('Description') . '</th> - <th>' . _('Units') .'</th> + <th>' . _('Code') . '</th> + <th>' . _('Description') . '</th> + <th>' . _('Units') .'</th> </tr>'; echo $TableHeader; @@ -963,32 +982,31 @@ $k=0; //row colour counter while ($myrow=DB_fetch_array($SearchResult)) { - - $ImageSource = $_SESSION['part_pics_dir'] . '/' . $myrow['stockid'] . '.jpg'; - if (file_exists($ImageSource)){ - $ImageSource = '<img src="'.$ImageSource.'">'; - } else { - $ImageSource = '<i>'._('No Image').'</i>'; - } - /* $_SESSION['part_pics_dir'] is a user defined variable in config.php */ - - if ($k==1){ - echo '<tr class="EvenTableRows">'; - $k=0; - } else { - echo '<tr class="OddTableRows">'; - $k++; - } - - printf("<td><font size=1><input type=submit name='NewItem' VALUE='%s'></font></td> - <td><font size=1>%s</font></td> - <td><font size=1>%s</font></td> - <td>%s</td></tr>", - $myrow['stockid'], - $myrow['description'], - $myrow['units'], - $ImageSource); - + if ($k==1){ + echo '<tr class="EvenTableRows">'; + $k=0; + } else { + echo '<tr class="OddTableRows">'; + $k++; + } + if(file_exists($_SESSION['part_pics_dir'] . '/' .mb_strtoupper($myrow['stockid']).'.jpg') ) { + printf('<td><font size=1><input type=submit name="NewItem" value="%s"></font></td> + <td><font size=1>%s</font></td> + <td><font size=1>%s</font></td> + <td><img src="GetStockImage.php?automake=1&textcolor=FFFFFF&bgcolor=CCCCCC&StockID=%s&text=&width=120&height=120"></td></tr>', + $myrow['stockid'], + $myrow['description'], + $myrow['units'], + $myrow['stockid']); + } else { //don't try to show the image + printf('<td><font size=1><input type=submit name="NewItem" value="%s"></font></td> + <td><font size=1>%s</font></td> + <td><font size=1>%s</font></td> + <td>' . _('No Image') . '</td></tr>', + $myrow['stockid'], + $myrow['description'], + $myrow['units']); + } #end of page full new headings if } #end of while loop @@ -997,21 +1015,27 @@ } /*end if part searching required */ elseif(!isset($_POST['ProcessCredit'])) { /*quick entry form */ /*FORM VARIABLES TO POST TO THE CREDIT NOTE 10 AT A TIME WITH PART CODE AND QUANTITY */ - echo '<table class=selection>'; - echo '<tr><th colspan=2><font size=3 color=navy><b>' . _('Quick Entry') . '</th></tr>'; + echo '<table class="selection">'; + echo '<tr><th colspan="2"><font size="3" color="navy"><b>' . _('Quick Entry') . '</th></tr>'; echo '<tr> - <th>' . _('Part Code') . '</th> - <th>' . _('Quantity') . '</th> - </tr>'; + <th>' . _('Part Code') . '</th> + <th>' . _('Quantity') . '</th> + </tr>'; for ($i=1;$i<=$_SESSION['QuickEntries'];$i++){ - echo '<tr class="OddTableRows"><td><input type="text" name="part_' . $i . '" size=21 maxlength=20></td> - <td><input type="text" class="number" name="qty_' . $i . '" size=6 maxlength=6></td></tr>'; + echo '<tr class="OddTableRows"> + <td><input type="text" name="part_' . $i . '" size="21" maxlength="20" /></td> + <td><input type="text" class="number" name="qty_' . $i . '" size="6" maxlength="6" /></td> + </tr>'; } - echo '</table><br /><div class="centre"><input type="submit" name="QuickEntry" value="' . _('Process Entries') . '"> - <input type="submit" name="PartSearch" value="' . _('Search Parts') . '"></div>'; + echo '</table> + <br /> + <div class="centre"> + <input type="submit" name="QuickEntry" value="' . _('Process Entries') . '"> + <input type="submit" name="PartSearch" value="' . _('Search Parts') . '"> + </div>'; } @@ -1023,7 +1047,7 @@ First Get the area where the credit note is to from the branches table */ $SQL = "SELECT area - FROM custbranch + FROM custbranch WHERE custbranch.debtorno ='". $_SESSION['CreditItems']->DebtorNo . "' AND custbranch.branchcode = '" . $_SESSION['CreditItems']->Branch . "'"; $ErrMsg = _('CRITICAL ERROR') . '! ' . _('NOTE DOWN THIS ERROR AND SEEK ASSISTANCE') . ': ' . _('The area cannot be determined for this customer'); @@ -1742,24 +1766,22 @@ /* The double entry required is to reverse the cost of sales entry as above then debit the expense account the stock is to written off to */ - $SQL = "INSERT INTO gltrans ( - type, - typeno, - trandate, - periodno, - account, - narrative, - amount) - VALUES ( - 11, - '" . $CreditNo . "', - '" . $SQLCreditDate . "', - '" . $PeriodNo . "', - '" . $_POST['WriteOffGLCode'] . "', - '" . $_SESSION['CreditItems']->DebtorNo . " - " . $CreditLine->StockID . " x " . $CreditLine->Quantity . " @ " . $CreditLine->StandardCost . "', - '" . ($CreditLine->StandardCost * $CreditLine->Quantity) . "' - )"; - + $SQL = "INSERT INTO gltrans (type, + typeno, + trandate, + periodno, + account, + narrative, + amount) + VALUES (11, + '" . $CreditNo . "', + '" . $SQLCreditDate . "', + '" . $PeriodNo . "', + '" . $_POST['WriteOffGLCode'] . "', + '" . $_SESSION['CreditItems']->DebtorNo . " - " . $CreditLine->StockID . " x " . $CreditLine->Quantity . " @ " . $CreditLine->StandardCost . "', + '" . ($CreditLine->StandardCost * $CreditLine->Quantity) . "' + )"; + $ErrMsg = _('CRITICAL ERROR') . '! ' . _('NOTE DOWN THIS ERROR AND SEEK ASSISTANCE') . ': ' . _('The cost of the stock credited GL posting could not be inserted because'); $DbgMsg = _('The following SQL to insert the GLTrans record was used'); $Result = DB_query($SQL, $db, $ErrMsg, $DbgMsg, true); @@ -1767,24 +1789,22 @@ /*the goods are coming back into stock so debit the stock account*/ $StockGLCode = GetStockGLCode($CreditLine->StockID, $db); - $SQL = "INSERT INTO gltrans ( - type, - typeno, - trandate, - periodno, - account, - narrative, - amount) - VALUES ( - 11, - '" . $CreditNo . "', - '" . $SQLCreditDate . "', - '" . $PeriodNo . "', - '" . $StockGLCode['stockact'] . "', - '" . $_SESSION['CreditItems']->DebtorNo . " - " . $CreditLine->StockID . " x " . $CreditLine->Quantity . " @ " . $CreditLine->StandardCost . "', - '" . ($CreditLine->StandardCost * $CreditLine->Quantity) . "' - )"; - + $SQL = "INSERT INTO gltrans (type, + typeno, + trandate, + periodno, + account, + narrative, + amount) + VALUES (11, + '" . $CreditNo . "', + '" . $SQLCreditDate . "', + '" . $PeriodNo . "', + '" . $StockGLCode['stockact'] . "', + '" . $_SESSION['CreditItems']->DebtorNo . " - " . $CreditLine->StockID . " x " . $CreditLine->Quantity . " @ " . $CreditLine->StandardCost . "', + '" . ($CreditLine->StandardCost * $CreditLine->Quantity) . "' + )"; + $ErrMsg = _('CRITICAL ERROR') . '! ' . _('NOTE DOWN THIS ERROR AND SEEK ASSISTANCE') . ': ' . _('The stock side (or write off) of the cost of sales GL posting could not be inserted because'); $DbgMsg = _('The following SQL to insert the GLTrans record was used'); $Result = DB_query($SQL, $db, $ErrMsg, $DbgMsg, true); @@ -1800,49 +1820,45 @@ $_SESSION['CreditItems']->DefaultSalesType, $db); - $SQL = "INSERT INTO gltrans ( - type, - typeno, - trandate, - periodno, - account, - narrative, - amount) - VALUES ( - 11, - '" . $CreditNo . "', - '" . $SQLCreditDate . "', - '" . $PeriodNo . "', - '" . $SalesGLAccounts['salesglcode'] . "', - '" . $_SESSION['CreditItems']->DebtorNo . " - " . $CreditLine->StockID . " x " . $CreditLine->Quantity . " @ " . $CreditLine->Price . "', - '" . ($CreditLine->Price * $CreditLine->Quantity)/$_SESSION['CurrencyRate'] . "' - )"; - + $SQL = "INSERT INTO gltrans (type, + typeno, + trandate, + periodno, + account, + narrative, + amount) + VALUES (11, + '" . $CreditNo . "', + '" . $SQLCreditDate . "', + '" . $PeriodNo . "', + '" . $SalesGLAccounts['salesglcode'] . "', + '" . $_SESSION['CreditItems']->DebtorNo . " - " . $CreditLine->StockID . " x " . $CreditLine->Quantity . " @ " . $CreditLine->Price . "', + '" . ($CreditLine->Price * $CreditLine->Quantity)/$_SESSION['CurrencyRate'] . "' + )"; + $ErrMsg = _('CRITICAL ERROR') . '! ' . _('NOTE DOWN THIS ERROR AND SEEK ASSISTANCE') . ': ' . _('The credit note GL posting could not be inserted because'); $DbgMsg = _('The following SQL to insert the GLTrans record was used'); $Result = DB_query($SQL, $db, $ErrMsg, $DbgMsg, true); if ($CreditLine->DiscountPercent !=0){ - $SQL = "INSERT INTO gltrans ( - type, - typeno, - trandate, - periodno, - account, - narrative, - amount) - VALUES ( - 11, - '" . $CreditNo . "', - '" . $SQLCreditDate . "', - '" . $PeriodNo . "', - '" . $SalesGLAccounts['discountglcode'] . "', - '" . $_SESSION['CreditItems']->DebtorNo . " - " . $CreditLine->StockID . " @ " . ($CreditLine->DiscountPercent * 100) . "%', - '" . -($CreditLine->Price * $CreditLine->Quantity * $CreditLine->DiscountPercent)/$_SESSION['CurrencyRate'] . "' - )"; + $SQL = "INSERT INTO gltrans (type, + typeno, + trandate, + periodno, + account, + narrative, + amount) + VALUES (11, + '" . $CreditNo . "', + '" . $SQLCreditDate . "', + '" . $PeriodNo . "', + '" . $SalesGLAccounts['discountglcode'] . "', + '" . $_SESSION['CreditItems']->DebtorNo . " - " . $CreditLine->StockID . " @ " . ($CreditLine->DiscountPercent * 100) . "%', + '" . -($CreditLine->Price * $CreditLine->Quantity * $CreditLine->DiscountPercent)/$_SESSION['CurrencyRate'] . "' + )"; + - $ErrMsg = _('CRITICAL ERROR') . '! ' . _('NOTE DOWN THIS ERROR AND SEEK ASSISTANCE') . ': ' . _('The credit note discount GL posting could not be inserted because'); $DbgMsg = _('The following SQL to insert the GLTrans record was used'); $Result = DB_query($SQL, $db, $ErrMsg, $DbgMsg, true); @@ -1856,45 +1872,40 @@ /*Post credit note transaction to GL credit debtors, debit freight re-charged and debit sales */ if (($_SESSION['CreditItems']->total + $_SESSION['CreditItems']->FreightCost + $TaxTotal) !=0) { - $SQL = "INSERT INTO gltrans ( - type, - typeno, - trandate, - periodno, - account, - narrative, - amount) - VALUES ( - 11, - '" . $CreditNo . "', - '" . $SQLCreditDate . "', - '" . $PeriodNo . "', - '" . $_SESSION['CompanyRecord']['debtorsact'] . "', - '" . $_SESSION['CreditItems']->DebtorNo . "', - '" . -($_SESSION['CreditItems']->total + $_SESSION['CreditItems']->FreightCost + $TaxTotal)/$_SESSION['CurrencyRate'] . "')"; - + $SQL = "INSERT INTO gltrans (type, + typeno, + trandate, + periodno, + account, + narrative, + amount) + VALUES (11, + '" . $CreditNo . "', + '" . $SQLCreditDate . "', + '" . $PeriodNo . "', + '" . $_SESSION['CompanyRecord']['debtorsact'] . "', + '" . $_SESSION['CreditItems']->DebtorNo . "', + '" . -($_SESSION['CreditItems']->total + $_SESSION['CreditItems']->FreightCost + $TaxTotal)/$_SESSION['CurrencyRate'] . "')"; + $ErrMsg = _('CRITICAL ERROR') . '! ' . _('NOTE DOWN THIS ERROR AND SEEK ASSISTANCE') . ': ' . _('The total debtor GL posting for the credit note could not be inserted because'); $DbgMsg = _('The following SQL to insert the GLTrans record was used'); $Result = DB_query($SQL, $db, $ErrMsg, $DbgMsg, true); } if ($_SESSION['CreditItems']->FreightCost !=0) { - $SQL = "INSERT INTO gltrans ( - type, - typeno, - trandate, - periodno, - account, - narrative, - amount) - VALUES ( - 11, - '" . $CreditNo . "', - '" . $SQLCreditDate . "', - '" . $PeriodNo . "', - '" . $_SESSION['CompanyRecord']['freightact'] . "', - '" . $_SESSION['CreditItems']->DebtorNo . "', - '" . $_SESSION['CreditItems']->FreightCost/$_SESSION['CurrencyRate'] . "' - )"; + $SQL = "INSERT INTO gltrans (type, + typeno, + trandate, + periodno, + account, + narrative, + amount) + VALUES (11, + '" . $CreditNo . "', + '" . $SQLCreditDate . "', + '" . $PeriodNo . "', + '" . $_SESSION['CompanyRecord']['freightact'] . "', + '" . $_SESSION['CreditItems']->DebtorNo . "', + '" . $_SESSION['CreditItems']->FreightCost/$_SESSION['CurrencyRate'] . "')"; $ErrMsg = _('CRITICAL ERROR') . '! ' . _('NOTE DOWN THIS ERROR AND SEEK ASSISTANCE') . ': ' . _('The freight GL posting for this credit note could not be inserted because'); $DbgMsg = _('The following SQL to insert the GLTrans record was used'); @@ -1902,24 +1913,20 @@ } foreach ( $TaxTotals as $TaxAuthID => $TaxAmount){ if ($TaxAmount !=0 ){ - $SQL = "INSERT INTO gltrans ( - type, - typeno, - trandate, - periodno, - account, - narrative, - amount - ) - VALUES ( - 11, - '" . $CreditNo . "', - '" . $SQLCreditDate . "', - '" . $PeriodNo . "', - '" . $TaxGLCodes[$TaxAuthID] . "', - '" . $_SESSION['CreditItems']->DebtorNo . "', - '" . ($TaxAmount/$_SESSION['CurrencyRate']) . "' - )"; + $SQL = "INSERT INTO gltrans (type, + typeno, + trandate, + periodno, + account, + narrative, + amount ) + VALUES (11, + '" . $CreditNo . "', + '" . $SQLCreditDate . "', + '" . $PeriodNo . "', + '" . $TaxGLCodes[$TaxAuthID] . "', + '" . $_SESSION['CreditItems']->DebtorNo . "', + '" . ($TaxAmount/$_SESSION['CurrencyRate']) . "')"; $ErrMsg = _('CRITICAL ERROR') . '! ' . _('NOTE DOWN THIS ERROR AND SEEK ASSISTANCE') . ': ' . _('The tax GL posting could not be inserted because'); $DbgMsg = _('The following SQL to insert the GLTrans record was used'); @@ -1940,7 +1947,7 @@ } else { echo '<a href="' . $rootpath . '/PrintCustTransPortrait.php?FromTransNo=' . $CreditNo . '&InvOrCredit=Credit&PrintPDF=True">' . _('Print this Credit Note') . '</a>'; } - echo '<p><a href="' . $rootpath . '/SelectCreditItems.php">' . _('Enter Another Credit Note') . '</a>'; + echo '<br /><a href="' . $rootpath . '/SelectCreditItems.php">' . _('Enter Another Credit Note') . '</a>'; } /*end of process credit note */ Modified: trunk/SelectOrderItems.php =================================================================== --- trunk/SelectOrderItems.php 2011-07-16 03:37:58 UTC (rev 4633) +++ trunk/SelectOrderItems.php 2011-07-17 03:31:55 UTC (rev 4634) @@ -79,52 +79,52 @@ /*read in all the guff from the selected order into the Items cart */ $OrderHeaderSQL = "SELECT salesorders.debtorno, - debtorsmaster.name, - salesorders.branchcode, - salesorders.customerref, - salesorders.comments, - salesorders.orddate, - salesorders.ordertype, - salestypes.sales_type, - salesorders.shipvia, - salesorders.deliverto, - salesorders.deladd1, - salesorders.deladd2, - salesorders.deladd3, - salesorders.deladd4, - salesorders.deladd5, - salesorders.deladd6, - salesorders.contactphone, - salesorders.contactemail, - salesorders.freightcost, - salesorders.deliverydate, - debtorsmaster.currcode, - currencies.decimalplaces, - paymentterms.terms, - salesorders.fromstkloc, - salesorders.printedpackingslip, - salesorders.datepackingslipprinted, - salesorders.quotation, - salesorders.deliverblind, - debtorsmaster.customerpoline, - locations.locationname, - custbranch.estdeliverydays, - custbranch.salesman - FROM salesorders - INNER JOIN debtorsmaster - ON salesorders.debtorno = debtorsmaster.debtorno - INNER JOIN salestypes - ON salesorders.ordertype=salestypes.typeabbrev - INNER JOIN custbranch - ON salesorders.debtorno = custbranch.debtorno - AND salesorders.branchcode = custbranch.branchcode - INNER JOIN paymentterms - ON debtorsmaster.paymentterms=paymentterms.termsindicator - INNER JOIN locations - ON locations.loccode=salesorders.fromstkloc - INNER JOIN currencies - ON debtorsmaster.currcode=currencies.currabrev - WHERE salesorders.orderno = '" . $_GET['ModifyOrderNumber'] . "'"; + debtorsmaster.name, + salesorders.branchcode, + salesorders.customerref, + salesorders.comments, + salesorders.orddate, + salesorders.ordertype, + salestypes.sales_type, + salesorders.shipvia, + salesorders.deliverto, + salesorders.deladd1, + salesorders.deladd2, + salesorders.deladd3, + salesorders.deladd4, + salesorders.deladd5, + salesorders.deladd6, + salesorders.contactphone, + salesorders.contactemail, + salesorders.freightcost, + salesorders.deliverydate, + debtorsmaster.currcode, + currencies.decimalplaces, + paymentterms.terms, + salesorders.fromstkloc, + salesorders.printedpackingslip, + salesorders.datepackingslipprinted, + salesorders.quotation, + salesorders.deliverblind, + debtorsmaster.customerpoline, + locations.locationname, + custbranch.estdeliverydays, + custbranch.salesman + FROM salesorders + INNER JOIN debtorsmaster + ON salesorders.debtorno = debtorsmaster.debtorno + INNER JOIN salestypes + ON salesorders.ordertype=salestypes.typeabbrev + INNER JOIN custbranch + ON salesorders.debtorno = custbranch.debtorno + AND salesorders.branchcode = custbranch.branchcode + INNER JOIN paymentterms + ON debtorsmaster.paymentterms=paymentterms.termsindicator + INNER JOIN locations + ON locations.loccode=salesorders.fromstkloc + INNER JOIN currencies + ON debtorsmaster.currcode=currencies.currabrev + WHERE salesorders.orderno = '" . $_GET['ModifyOrderNumber'] . "'"; $ErrMsg = _('The order cannot be retrieved because'); $GetOrdHdrResult = DB_query($OrderHeaderSQL,$db,$ErrMsg); @@ -224,32 +224,32 @@ while ($myrow=db_fetch_array($LineItemsResult)) { if ($myrow['completed']==0){ $_SESSION['Items'.$identifier]->add_to_cart($myrow['stkcode'], - $myrow['quantity'], - $myrow['description'], - $myrow['unitprice'], - $myrow['discountpercent'], - $myrow['units'], - $myrow['volume'], - $myrow['kgs'], - $myrow['qohatloc'], - $myrow['mbflag'], - $myrow['actualdispatchdate'], - $myrow['qtyinvoiced'], - $myrow['discountcategory'], - 0, /*Controlled*/ - ... [truncated message content] |
From: <dai...@us...> - 2011-07-16 03:38:05
|
Revision: 4633 http://web-erp.svn.sourceforge.net/web-erp/?rev=4633&view=rev Author: daintree Date: 2011-07-16 03:37:58 +0000 (Sat, 16 Jul 2011) Log Message: ----------- type=text quoting Modified Paths: -------------- trunk/PDFDIFOT.php trunk/PDFOrdersInvoiced.php trunk/SelectWorkOrder.php Modified: trunk/PDFDIFOT.php =================================================================== --- trunk/PDFDIFOT.php 2011-07-16 02:59:14 UTC (rev 4632) +++ trunk/PDFDIFOT.php 2011-07-16 03:37:58 UTC (rev 4633) @@ -2,9 +2,6 @@ /* $Id$*/ -/* $Revision: 1.4 $ */ - -//$PageSecurity = 3; include ('includes/session.inc'); include('includes/SQL_CommonFunctions.inc'); @@ -27,45 +24,63 @@ echo '<p class="page_title_text"><img src="'.$rootpath.'/css/'.$theme.'/images/transactions.png" title="' . $title . '" alt="" />' . ' ' . _('DIFOT 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 variances between orders and deliveries 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')-1,0,Date('y'))) . "'></td></tr>"; - echo '<tr><td>' . _('Enter the date to which variances between orders and deliveries 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 '<table class=selection> + <tr> + <td>' . _('Enter the date from which variances between orders and deliveries 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')-1,0,Date('y'))) . '"></td> + </tr>'; + echo '<tr> + <td>' . _('Enter the date to which variances between orders and deliveries 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>'; if (!isset($_POST['DaysAcceptable'])){ $_POST['DaysAcceptable'] = 1; } - echo '<tr><td>' . _('Enter the number of days considered acceptable between delivery requested date and invoice date(ie the date dispatched)') . ":</td><td><input type="text" class=number name='DaysAcceptable' maxlength=2 size=2 VALUE=" . $_POST['DaysAcceptable'] . "></td></tr>"; + echo '<tr> + <td>' . _('Enter the number of days considered acceptable between delivery requested date and invoice date(ie the date dispatched)') . ':</td> + <td><input type="text" class="number" name="DaysAcceptable" maxlength=2 size=2 value="' . $_POST['DaysAcceptable'] . '"></td> + </tr>'; echo '<tr><td>' . _('Inventory Category') . '</td><td>'; $sql = "SELECT categorydescription, categoryid FROM stockcategory WHERE stocktype<>'D' AND stocktype<>'L'"; $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']; - } + while ($myrow=DB_fetch_array($result)){ + 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']; - } + $result= DB_query("SELECT loccode, locationname FROM locations",$db); + while ($myrow=DB_fetch_array($result)){ + echo '<option value="' . $myrow['loccode'] . '">' . $myrow['locationname'] . '</option>'; + } echo '</select></td></tr>'; - echo '<tr><td>' . _('Email the report off') . ":</td><td><select name='Email'>"; - echo "<option selected value='No'>" . _('No'); - echo "<option value='Yes'>" . _('Yes'); - echo "</select></td></tr></table><br /><div class='centre'><input type=submit name='Go' value='" . _('Create PDF') . "'></div>"; + echo '<tr><td>' . _('Email the report off') . ':</td> + <td><select name="Email"> + <option selected value="No">' . _('No') . '</option> + <option value="Yes">' . _('Yes') . '</option> + </select></td> + </tr> + </table> + <br /> + <div class="centre"> + <input type="submit" name="Go" value="' . _('Create PDF') . '" /> + </div>'; if ($InputError==1){ prnMsg($msg,'error'); @@ -78,79 +93,79 @@ if ($_POST['CategoryID']=='All' AND $_POST['Location']=='All'){ $sql= "SELECT salesorders.orderno, - salesorders.deliverydate, - salesorderdetails.actualdispatchdate, - TO_DAYS(salesorderdetails.actualdispatchdate) - TO_DAYS(salesorders.deliverydate) AS daydiff, - salesorderdetails.quantity, - salesorderdetails.stkcode, - stockmaster.description, - salesorders.debtorno, - salesorders.branchcode - FROM salesorderdetails INNER JOIN stockmaster + salesorders.deliverydate, + salesorderdetails.actualdispatchdate, + TO_DAYS(salesorderdetails.actualdispatchdate) - TO_DAYS(salesorders.deliverydate) AS daydiff, + salesorderdetails.quantity, + salesorderdetails.stkcode, + stockmaster.description, + salesorders.debtorno, + salesorders.branchcode + FROM salesorderdetails INNER JOIN stockmaster ON salesorderdetails.stkcode=stockmaster.stockid - INNER JOIN salesorders ON salesorderdetails.orderno=salesorders.orderno - WHERE salesorders.deliverydate >='" . FormatDateForSQL($_POST['FromDate']) . "' - AND salesorders.deliverydate <='" . FormatDateForSQL($_POST['ToDate']) . "' - AND (TO_DAYS(salesorderdetails.actualdispatchdate) - TO_DAYS(salesorders.deliverydate)) >'" . $_POST['DaysAcceptable']."'"; + INNER JOIN salesorders ON salesorderdetails.orderno=salesorders.orderno + WHERE salesorders.deliverydate >='" . FormatDateForSQL($_POST['FromDate']) . "' + AND salesorders.deliverydate <='" . FormatDateForSQL($_POST['ToDate']) . "' + AND (TO_DAYS(salesorderdetails.actualdispatchdate) - TO_DAYS(salesorders.deliverydate)) >'" . $_POST['DaysAcceptable']."'"; } elseif ($_POST['CategoryID']!='All' AND $_POST['Location']=='All') { $sql= "SELECT salesorders.orderno, - salesorders.deliverydate, - salesorderdetails.actualdispatchdate, - TO_DAYS(salesorderdetails.actualdispatchdate) - TO_DAYS(salesorders.deliverydate) AS daydiff, - salesorderdetails.quantity, - salesorderdetails.stkcode, - stockmaster.description, - salesorders.debtorno, - salesorders.branchcode - FROM salesorderdetails INNER JOIN stockmaster - ON salesorderdetails.stkcode=stockmaster.stockid - INNER JOIN salesorders ON salesorderdetails.orderno=salesorders.orderno - WHERE salesorders.deliverydate >='" . FormatDateForSQL($_POST['FromDate']) . "' - AND salesorders.deliverydate <='" . FormatDateForSQL($_POST['ToDate']) . "' - AND stockmaster.categoryid='" . $_POST['CategoryID'] ."' - AND (TO_DAYS(salesorderdetails.actualdispatchdate) - - TO_DAYS(salesorders.deliverydate)) >'" . $_POST['DaysAcceptable']."'"; + salesorders.deliverydate, + salesorderdetails.actualdispatchdate, + TO_DAYS(salesorderdetails.actualdispatchdate) - TO_DAYS(salesorders.deliverydate) AS daydiff, + salesorderdetails.quantity, + salesorderdetails.stkcode, + stockmaster.description, + salesorders.debtorno, + salesorders.branchcode + FROM salesorderdetails INNER JOIN stockmaster + ON salesorderdetails.stkcode=stockmaster.stockid + INNER JOIN salesorders ON salesorderdetails.orderno=salesorders.orderno + WHERE salesorders.deliverydate >='" . FormatDateForSQL($_POST['FromDate']) . "' + AND salesorders.deliverydate <='" . FormatDateForSQL($_POST['ToDate']) . "' + AND stockmaster.categoryid='" . $_POST['CategoryID'] ."' + AND (TO_DAYS(salesorderdetails.actualdispatchdate) + - TO_DAYS(salesorders.deliverydate)) >'" . $_POST['DaysAcceptable']."'"; } elseif ($_POST['CategoryID']=='All' AND $_POST['Location']!='All') { $sql= "SELECT salesorders.orderno, - salesorders.deliverydate, - salesorderdetails.actualdispatchdate, - TO_DAYS(salesorderdetails.actualdispatchdate) - TO_DAYS(salesorders.deliverydate) AS daydiff, - salesorderdetails.quantity, - salesorderdetails.stkcode, - stockmaster.description, - salesorders.debtorno, - salesorders.branchcode - FROM salesorderdetails INNER JOIN stockmaster - ON salesorderdetails.stkcode=stockmaster.stockid - INNER JOIN salesorders ON salesorderdetails.orderno=salesorders.orderno - WHERE salesorders.deliverydate >='" . FormatDateForSQL($_POST['FromDate']) . "' - AND salesorders.deliverydate <='" . FormatDateForSQL($_POST['ToDate']) . "' - AND salesorders.fromstkloc='" . $_POST['Location'] . "' - AND (TO_DAYS(salesorderdetails.actualdispatchdate) + salesorders.deliverydate, + salesorderdetails.actualdispatchdate, + TO_DAYS(salesorderdetails.actualdispatchdate) - TO_DAYS(salesorders.deliverydate) AS daydiff, + salesorderdetails.quantity, + salesorderdetails.stkcode, + stockmaster.description, + salesorders.debtorno, + salesorders.branchcode + FROM salesorderdetails INNER JOIN stockmaster + ON salesorderdetails.stkcode=stockmaster.stockid + INNER JOIN salesorders ON salesorderdetails.orderno=salesorders.orderno + WHERE salesorders.deliverydate >='" . FormatDateForSQL($_POST['FromDate']) . "' + AND salesorders.deliverydate <='" . FormatDateForSQL($_POST['ToDate']) . "' + AND salesorders.fromstkloc='" . $_POST['Location'] . "' + AND (TO_DAYS(salesorderdetails.actualdispatchdate) - TO_DAYS(salesorders.deliverydate)) >'" . $_POST['DaysAcceptable'] . "'"; } elseif ($_POST['CategoryID']!='All' AND $_POST['Location']!='All'){ $sql= "SELECT salesorders.orderno, - salesorders.deliverydate, - salesorderdetails.actualdispatchdate, - TO_DAYS(salesorderdetails.actualdispatchdate) - TO_DAYS(salesorders.deliverydate) AS daydiff, - salesorderdetails.quantity, - salesorderdetails.stkcode, - stockmaster.description, - salesorders.debtorno, - salesorders.branchcode - FROM salesorderdetails INNER JOIN stockmaster - ON salesorderdetails.stkcode=stockmaster.stockid - INNER JOIN salesorders ON salesorderdetails.orderno=salesorders.orderno - WHERE salesorders.deliverydate >='" . FormatDateForSQL($_POST['FromDate']) . "' - AND salesorders.deliverydate <='" . FormatDateForSQL($_POST['ToDate']) . "' - AND stockmaster.categoryid='" . $_POST['CategoryID'] ."' - AND salesorders.fromstkloc='" . $_POST['Location'] . "' - AND (TO_DAYS(salesorderdetails.actualdispatchdate) + salesorders.deliverydate, + salesorderdetails.actualdispatchdate, + TO_DAYS(salesorderdetails.actualdispatchdate) - TO_DAYS(salesorders.deliverydate) AS daydiff, + salesorderdetails.quantity, + salesorderdetails.stkcode, + stockmaster.description, + salesorders.debtorno, + salesorders.branchcode + FROM salesorderdetails INNER JOIN stockmaster + ON salesorderdetails.stkcode=stockmaster.stockid + INNER JOIN salesorders ON salesorderdetails.orderno=salesorders.orderno + WHERE salesorders.deliverydate >='" . FormatDateForSQL($_POST['FromDate']) . "' + AND salesorders.deliverydate <='" . FormatDateForSQL($_POST['ToDate']) . "' + AND stockmaster.categoryid='" . $_POST['CategoryID'] ."' + AND salesorders.fromstkloc='" . $_POST['Location'] . "' + AND (TO_DAYS(salesorderdetails.actualdispatchdate) - TO_DAYS(salesorders.deliverydate)) >'" . $_POST['DaysAcceptable'] . "'"; } Modified: trunk/PDFOrdersInvoiced.php =================================================================== --- trunk/PDFOrdersInvoiced.php 2011-07-16 02:59:14 UTC (rev 4632) +++ trunk/PDFOrdersInvoiced.php 2011-07-16 03:37:58 UTC (rev 4633) @@ -36,8 +36,8 @@ 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 '<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>' . _('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>'; $sql = "SELECT categorydescription, categoryid FROM stockcategory WHERE stocktype<>'D' AND stocktype<>'L'"; @@ -61,7 +61,9 @@ } 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; @@ -195,17 +197,17 @@ WHERE salesorders.fromstkloc ='" . $_POST['Location'] . "' AND orddate >='" . FormatDateForSQL($_POST['FromDate']) . "' AND orddate <='" . FormatDateForSQL($_POST['ToDate']) . "' - GROUP BY salesorders.orderno, - salesorders.debtorno, - salesorders.branchcode, - salesorders.customerref, - salesorders.orddate, - salesorders.fromstkloc, - salesorderdetails.stkcode, - stockmaster.description, - stockmaster.units, - stockmaster.decimalplaces"; - + GROUP BY salesorders.orderno, + salesorders.debtorno, + salesorders.branchcode, + salesorders.customerref, + salesorders.orddate, + salesorders.fromstkloc, + salesorderdetails.stkcode, + stockmaster.description, + stockmaster.units, + stockmaster.decimalplaces"; + } elseif ($_POST['CategoryID']!='All' AND $_POST['location']!='All'){ $sql= "SELECT salesorders.orderno, @@ -251,7 +253,7 @@ stockmaster.decimalplaces"; } -$sql .= ' ORDER BY salesorders.orderno'; +$sql .= " ORDER BY salesorders.orderno"; $Result=DB_query($sql,$db,'','',false,false); //dont trap errors here @@ -367,16 +369,16 @@ /*OK now get the invoices where the item was charged */ $sql = "SELECT debtortrans.order_, - systypes.typename, - debtortrans.transno, - stockmoves.price, - -stockmoves.qty AS quantity - FROM debtortrans INNER JOIN stockmoves - ON debtortrans.type = stockmoves.type - AND debtortrans.transno=stockmoves.transno - INNER JOIN systypes ON debtortrans.type=systypes.typeid - WHERE debtortrans.order_ ='" . $OrderNo . "' - AND stockmoves.stockid ='" . $myrow['stkcode'] . "'"; + systypes.typename, + debtortrans.transno, + stockmoves.price, + -stockmoves.qty AS quantity + FROM debtortrans INNER JOIN stockmoves + ON debtortrans.type = stockmoves.type + AND debtortrans.transno=stockmoves.transno + INNER JOIN systypes ON debtortrans.type=systypes.typeid + WHERE debtortrans.order_ ='" . $OrderNo . "' + AND stockmoves.stockid ='" . $myrow['stkcode'] . "'"; $InvoicesResult =DB_query($sql,$db); if (DB_num_rows($InvoicesResult)>0){ Modified: trunk/SelectWorkOrder.php =================================================================== --- trunk/SelectWorkOrder.php 2011-07-16 02:59:14 UTC (rev 4632) +++ trunk/SelectWorkOrder.php 2011-07-16 03:37:58 UTC (rev 4633) @@ -7,7 +7,7 @@ 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'] . '" method=post>'; +echo '<form action="' . $_SERVER['PHP_SELF'] . '" method="post">'; echo '<input type="hidden" name="FormID" value="' . $_SESSION['FormID'] . '" />'; @@ -37,50 +37,50 @@ $SearchString = '%' . str_replace(' ', '%', $_POST['Keywords']) . '%'; $SQL = "SELECT stockmaster.stockid, - stockmaster.description, - SUM(locstock.quantity) AS qoh, - stockmaster.units - FROM stockmaster, - locstock - WHERE stockmaster.stockid=locstock.stockid - AND stockmaster.description " . LIKE . " '" . $SearchString . "' - AND stockmaster.categoryid='" . $_POST['StockCat']. "' - AND stockmaster.mbflag='M' - GROUP BY stockmaster.stockid, - stockmaster.description, - stockmaster.units - ORDER BY stockmaster.stockid"; + stockmaster.description, + SUM(locstock.quantity) AS qoh, + stockmaster.units + FROM stockmaster, + locstock + WHERE stockmaster.stockid=locstock.stockid + AND stockmaster.description " . LIKE . " '" . $SearchString . "' + AND stockmaster.categoryid='" . $_POST['StockCat']. "' + AND stockmaster.mbflag='M' + GROUP BY stockmaster.stockid, + stockmaster.description, + stockmaster.units + ORDER BY stockmaster.stockid"; } elseif (isset($_POST['StockCode'])){ $SQL = "SELECT stockmaster.stockid, - stockmaster.description, - sum(locstock.quantity) as qoh, - stockmaster.units - FROM stockmaster, - locstock - WHERE stockmaster.stockid=locstock.stockid - AND stockmaster.stockid " . LIKE . " '%" . $_POST['StockCode'] . "%' - AND stockmaster.categoryid='" . $_POST['StockCat'] . "' - AND stockmaster.mbflag='M' - GROUP BY stockmaster.stockid, - stockmaster.description, - stockmaster.units - ORDER BY stockmaster.stockid"; + stockmaster.description, + sum(locstock.quantity) as qoh, + stockmaster.units + FROM stockmaster, + locstock + WHERE stockmaster.stockid=locstock.stockid + AND stockmaster.stockid " . LIKE . " '%" . $_POST['StockCode'] . "%' + AND stockmaster.categoryid='" . $_POST['StockCat'] . "' + AND stockmaster.mbflag='M' + GROUP BY stockmaster.stockid, + stockmaster.description, + stockmaster.units + ORDER BY stockmaster.stockid"; } elseif (!isset($_POST['StockCode']) AND !isset($_POST['Keywords'])) { $SQL = "SELECT stockmaster.stockid, - stockmaster.description, - sum(locstock.quantity) as qoh, - stockmaster.units - FROM stockmaster, - locstock - WHERE stockmaster.stockid=locstock.stockid - AND stockmaster.categoryid='" . $_POST['StockCat'] ."' - AND stockmaster.mbflag='M' - GROUP BY stockmaster.stockid, - stockmaster.description, - stockmaster.units - ORDER BY stockmaster.stockid"; + stockmaster.description, + sum(locstock.quantity) as qoh, + stockmaster.units + FROM stockmaster, + locstock + WHERE stockmaster.stockid=locstock.stockid + AND stockmaster.categoryid='" . $_POST['StockCat'] ."' + AND stockmaster.mbflag='M' + GROUP BY stockmaster.stockid, + stockmaster.description, + stockmaster.units + ORDER BY stockmaster.stockid"; } $ErrMsg = _('No items were returned by the SQL because'); @@ -104,11 +104,11 @@ if (!isset($_REQUEST['WO']) or ($_REQUEST['WO']=='')){ echo '<table class=selection><tr><td>'; if (isset($_REQUEST['SelectedStockItem'])) { - echo _('For the item') . ': ' . $_REQUEST['SelectedStockItem'] . ' ' . _('and') . " <input type=hidden name='SelectedStockItem' value='" . $_REQUEST['SelectedStockItem'] . "'>"; + echo _('For the item') . ': ' . $_REQUEST['SelectedStockItem'] . ' ' . _('and') . ' <input type="hidden" name="SelectedStockItem" value="' . $_REQUEST['SelectedStockItem'] . '" />'; } - echo _('Work Order number') . ": <input type="text" name='WO' MAXLENGTH =8 size=9>  " . _('Processing at') . ":<select name='StockLocation'> "; + echo _('Work Order number') . ': <input type="text" name="WO" maxlength="8" size="9" />  ' . _('Processing at') . ':<select name="StockLocation"> '; - $sql = 'SELECT loccode, locationname FROM locations'; + $sql = "SELECT loccode, locationname FROM locations"; $resultStkLocs = DB_query($sql,$db); @@ -142,233 +142,235 @@ } echo '</select>   '; - echo "<input type=submit name='SearchOrders' value='" . _('Search') . "'>"; - echo ' <a href="' . $rootpath . '/WorkOrderEntry.php?' . SID . '">' . _('New Work Order') . '</a></td></tr></table><br />'; + echo '<input type="submit" name="SearchOrders" value="' . _('Search') . '">'; + echo ' <a href="' . $rootpath . '/WorkOrderEntry.php">' . _('New Work Order') . '</a></td></tr></table><br />'; } - $SQL='SELECT categoryid, + $SQL="SELECT categoryid, categorydescription - FROM stockcategory - ORDER BY categorydescription'; + FROM stockcategory + ORDER BY categorydescription"; $result1 = DB_query($SQL,$db); - echo "<table class=selection> - <tr><th colspan=6><font size=3 color=navy>" . _('To search for work orders for a specific item use the item selection facilities below') . "</font></th></tr> - <tr> - <td><font size=1>" . _('Select a stock category') . ":</font> - <select name='StockCat'>"; + echo '<table class="selection"> + <tr> + <th colspan="6"><font size="3" color="navy">' . _('To search for work orders for a specific item use the item selection facilities below') . '</font></th> + </tr> + <tr> + <td><font size="1">' . _('Select a stock category') . ':</font> + <select name="StockCat">'; while ($myrow1 = DB_fetch_array($result1)) { echo '<option value="'. $myrow1['categoryid'] . '">' . $myrow1['categorydescription'] . '</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> - </tr> + <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><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>'; -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>'; - echo $TableHeader; - - $j = 1; - $k=0; //row colour counter - - while ($myrow=DB_fetch_array($StockItemsResult)) { - - if ($k==1){ - echo '<tr class="EvenTableRows">'; - $k=0; - } else { - echo '<tr class="OddTableRows">'; - $k++; - } - - printf("<td><input type=submit name='SelectedStockItem' value='%s'</td> - <td>%s</td> - <td class=number>%s</td> - <td>%s</td> - </tr>", - $myrow['stockid'], - $myrow['description'], - $myrow['qoh'], - $myrow['units']); - - $j++; - if ($j == 12){ - $j=1; - echo $TableHeader; - } -//end of page full new headings if - } -//end of while loop - - echo '</table>'; - -} -//end if stock search results to show - else { - - if (!isset($_POST['StockLocation'])) { - $_POST['StockLocation'] = ''; - } - - //figure out the SQL required from the inputs available - if (isset($_POST['ClosedOrOpen']) and $_POST['ClosedOrOpen']=='Open_Only'){ - $ClosedOrOpen = 0; - } else { - $ClosedOrOpen = 1; - } - if (isset($_REQUEST['WO']) && $_REQUEST['WO'] !='') { - $SQL = "SELECT workorders.wo, - woitems.stockid, - stockmaster.description, - woitems.qtyreqd, - woitems.qtyrecd, - workorders.requiredby - FROM workorders - INNER JOIN woitems ON workorders.wo=woitems.wo - INNER JOIN stockmaster ON woitems.stockid=stockmaster.stockid - WHERE workorders.closed='" . $ClosedOrOpen . "' - AND workorders.wo='". $_REQUEST['WO'] ."' - ORDER BY workorders.wo, - woitems.stockid"; - } else { - /* $DateAfterCriteria = FormatDateforSQL($OrdersAfterDate); */ - - if (isset($_REQUEST['SelectedStockItem'])) { - $SQL = "SELECT workorders.wo, - woitems.stockid, - stockmaster.description, - woitems.qtyreqd, - woitems.qtyrecd, - workorders.requiredby - FROM workorders - INNER JOIN woitems ON workorders.wo=woitems.wo - INNER JOIN stockmaster ON woitems.stockid=stockmaster.stockid - WHERE workorders.closed='" . $ClosedOrOpen . "' - AND woitems.stockid='". $_REQUEST['SelectedStockItem'] ."' - AND workorders.loccode='" . $_POST['StockLocation'] . "' - ORDER BY workorders.wo, - woitems.stockid"; + 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>'; + echo $TableHeader; + + $j = 1; + $k=0; //row colour counter + + while ($myrow=DB_fetch_array($StockItemsResult)) { + + if ($k==1){ + echo '<tr class="EvenTableRows">'; + $k=0; } else { - $SQL = "SELECT workorders.wo, - woitems.stockid, - stockmaster.description, - woitems.qtyreqd, - woitems.qtyrecd, - workorders.requiredby - FROM workorders - INNER JOIN woitems ON workorders.wo=woitems.wo - INNER JOIN stockmaster ON woitems.stockid=stockmaster.stockid - WHERE workorders.closed='" . $ClosedOrOpen . "' - AND workorders.loccode='" . $_POST['StockLocation'] . "' - ORDER BY workorders.wo, - woitems.stockid"; + echo '<tr class="OddTableRows">'; + $k++; } - } //end not order number selected - - $ErrMsg = _('No works orders were returned by the SQL because'); - $WorkOrdersResult = DB_query($SQL,$db,$ErrMsg); - - /*show a table of the orders returned by the SQL */ - if (DB_num_rows($WorkOrdersResult)>0) { - echo '<br /><table cellpadding=2 colspan=7 width=95% class=selection>'; - - - $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; + + printf('<td><input type="submit" name="SelectedStockItem" value="%s" /></td> + <td>%s</td> + <td class="number">%s</td> + <td>%s</td> + </tr>', + $myrow['stockid'], + $myrow['description'], + $myrow['qoh'], + $myrow['units']); + + $j++; + if ($j == 12){ + $j=1; + echo $TableHeader; + } + //end of page full new headings if + } + //end of while loop + + echo '</table>'; + } - $j = 1; - $k=0; //row colour counter - while ($myrow=DB_fetch_array($WorkOrdersResult)) { - - if ($k==1){ - echo '<tr class="EvenTableRows">'; - $k=0; + //end if stock search results to show + else { + + if (!isset($_POST['StockLocation'])) { + $_POST['StockLocation'] = ''; + } + + //figure out the SQL required from the inputs available + if (isset($_POST['ClosedOrOpen']) and $_POST['ClosedOrOpen']=='Open_Only'){ + $ClosedOrOpen = 0; } else { - echo '<tr class="OddTableRows">'; - $k++; + $ClosedOrOpen = 1; } - - $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']); - - - printf("<td><a href='%s'>%s</a></td> - <td><a href='%s'>" . _('Status') . "</a></td> - <td><a href='%s'>" . _('Receive') . "</a></td> - <td><a href='%s'>" . _('Issue To') . "</a></td> - <td><a href='%s'>" . _('Costing') . "</a></td> - <td>%s - %s</td> - <td class=number>%s</td> - <td class=number>%s</td> - <td class=number>%s</td> - <td>%s</td> - </tr>", - $ModifyPage, - $myrow['wo'], - $Status_WO, - $Receive_WO, - $Issue_WO, - $Costing_WO, - $myrow['stockid'], - $myrow['description'], - $myrow['qtyreqd'], - $myrow['qtyrecd'], - $myrow['qtyreqd']-$myrow['qtyrecd'], - $FormatedRequiredByDate); - - $j++; - if ($j == 12){ - $j=1; + if (isset($_REQUEST['WO']) && $_REQUEST['WO'] !='') { + $SQL = "SELECT workorders.wo, + woitems.stockid, + stockmaster.description, + woitems.qtyreqd, + woitems.qtyrecd, + workorders.requiredby + FROM workorders + INNER JOIN woitems ON workorders.wo=woitems.wo + INNER JOIN stockmaster ON woitems.stockid=stockmaster.stockid + WHERE workorders.closed='" . $ClosedOrOpen . "' + AND workorders.wo='". $_REQUEST['WO'] ."' + ORDER BY workorders.wo, + woitems.stockid"; + } else { + /* $DateAfterCriteria = FormatDateforSQL($OrdersAfterDate); */ + + if (isset($_REQUEST['SelectedStockItem'])) { + $SQL = "SELECT workorders.wo, + woitems.stockid, + stockmaster.description, + woitems.qtyreqd, + woitems.qtyrecd, + workorders.requiredby + FROM workorders + INNER JOIN woitems ON workorders.wo=woitems.wo + INNER JOIN stockmaster ON woitems.stockid=stockmaster.stockid + WHERE workorders.closed='" . $ClosedOrOpen . "' + AND woitems.stockid='". $_REQUEST['SelectedStockItem'] ."' + AND workorders.loccode='" . $_POST['StockLocation'] . "' + ORDER BY workorders.wo, + woitems.stockid"; + } else { + $SQL = "SELECT workorders.wo, + woitems.stockid, + stockmaster.description, + woitems.qtyreqd, + woitems.qtyrecd, + workorders.requiredby + FROM workorders + INNER JOIN woitems ON workorders.wo=woitems.wo + INNER JOIN stockmaster ON woitems.stockid=stockmaster.stockid + WHERE workorders.closed='" . $ClosedOrOpen . "' + AND workorders.loccode='" . $_POST['StockLocation'] . "' + ORDER BY workorders.wo, + woitems.stockid"; + } + } //end not order number selected + + $ErrMsg = _('No works orders were returned by the SQL because'); + $WorkOrdersResult = DB_query($SQL,$db,$ErrMsg); + + /*show a table of the orders returned by the SQL */ + if (DB_num_rows($WorkOrdersResult)>0) { + echo '<br /> + <table cellpadding="2" colspan="7" width="95%" class="selection">'; + + + $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; } - //end of page full new headings if + $j = 1; + $k=0; //row colour counter + while ($myrow=DB_fetch_array($WorkOrdersResult)) { + + if ($k==1){ + echo '<tr class="EvenTableRows">'; + $k=0; + } else { + echo '<tr class="OddTableRows">'; + $k++; + } + + $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']); + + + printf('<td><a href="%s">%s</a></td> + <td><a href="%s">' . _('Status') . '</a></td> + <td><a href="%s">' . _('Receive') . '</a></td> + <td><a href="%s">' . _('Issue To') . '</a></td> + <td><a href="%s">' . _('Costing') . '</a></td> + <td>%s - %s</td> + <td class="number">%s</td> + <td class="number">%s</td> + <td class="number">%s</td> + <td>%s</td> + </tr>', + $ModifyPage, + $myrow['wo'], + $Status_WO, + $Receive_WO, + $Issue_WO, + $Costing_WO, + $myrow['stockid'], + $myrow['description'], + $myrow['qtyreqd'], + $myrow['qtyrecd'], + $myrow['qtyreqd']-$myrow['qtyrecd'], + $FormatedRequiredByDate); + + $j++; + if ($j == 12){ + $j=1; + echo $tableheader; + } + //end of page full new headings if + } + //end of while loop + + echo '</table>'; } - //end of while loop - - echo '</table>'; + + echo '<script>defaultControl(document.forms[0].WO);</script>'; + + echo '</form>'; } -echo "<script>defaultControl(document.forms[0].WO);</script>"; - -?> -</form> - -<?php } - include('includes/footer.inc'); ?> \ No newline at end of file This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <dai...@us...> - 2011-07-16 03:38:05
|
Revision: 4633 http://web-erp.svn.sourceforge.net/web-erp/?rev=4633&view=rev Author: daintree Date: 2011-07-16 03:37:58 +0000 (Sat, 16 Jul 2011) Log Message: ----------- type=text quoting Modified Paths: -------------- trunk/PDFDIFOT.php trunk/PDFOrdersInvoiced.php trunk/SelectWorkOrder.php Modified: trunk/PDFDIFOT.php =================================================================== --- trunk/PDFDIFOT.php 2011-07-16 02:59:14 UTC (rev 4632) +++ trunk/PDFDIFOT.php 2011-07-16 03:37:58 UTC (rev 4633) @@ -2,9 +2,6 @@ /* $Id$*/ -/* $Revision: 1.4 $ */ - -//$PageSecurity = 3; include ('includes/session.inc'); include('includes/SQL_CommonFunctions.inc'); @@ -27,45 +24,63 @@ echo '<p class="page_title_text"><img src="'.$rootpath.'/css/'.$theme.'/images/transactions.png" title="' . $title . '" alt="" />' . ' ' . _('DIFOT 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 variances between orders and deliveries 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')-1,0,Date('y'))) . "'></td></tr>"; - echo '<tr><td>' . _('Enter the date to which variances between orders and deliveries 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 '<table class=selection> + <tr> + <td>' . _('Enter the date from which variances between orders and deliveries 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')-1,0,Date('y'))) . '"></td> + </tr>'; + echo '<tr> + <td>' . _('Enter the date to which variances between orders and deliveries 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>'; if (!isset($_POST['DaysAcceptable'])){ $_POST['DaysAcceptable'] = 1; } - echo '<tr><td>' . _('Enter the number of days considered acceptable between delivery requested date and invoice date(ie the date dispatched)') . ":</td><td><input type="text" class=number name='DaysAcceptable' maxlength=2 size=2 VALUE=" . $_POST['DaysAcceptable'] . "></td></tr>"; + echo '<tr> + <td>' . _('Enter the number of days considered acceptable between delivery requested date and invoice date(ie the date dispatched)') . ':</td> + <td><input type="text" class="number" name="DaysAcceptable" maxlength=2 size=2 value="' . $_POST['DaysAcceptable'] . '"></td> + </tr>'; echo '<tr><td>' . _('Inventory Category') . '</td><td>'; $sql = "SELECT categorydescription, categoryid FROM stockcategory WHERE stocktype<>'D' AND stocktype<>'L'"; $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']; - } + while ($myrow=DB_fetch_array($result)){ + 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']; - } + $result= DB_query("SELECT loccode, locationname FROM locations",$db); + while ($myrow=DB_fetch_array($result)){ + echo '<option value="' . $myrow['loccode'] . '">' . $myrow['locationname'] . '</option>'; + } echo '</select></td></tr>'; - echo '<tr><td>' . _('Email the report off') . ":</td><td><select name='Email'>"; - echo "<option selected value='No'>" . _('No'); - echo "<option value='Yes'>" . _('Yes'); - echo "</select></td></tr></table><br /><div class='centre'><input type=submit name='Go' value='" . _('Create PDF') . "'></div>"; + echo '<tr><td>' . _('Email the report off') . ':</td> + <td><select name="Email"> + <option selected value="No">' . _('No') . '</option> + <option value="Yes">' . _('Yes') . '</option> + </select></td> + </tr> + </table> + <br /> + <div class="centre"> + <input type="submit" name="Go" value="' . _('Create PDF') . '" /> + </div>'; if ($InputError==1){ prnMsg($msg,'error'); @@ -78,79 +93,79 @@ if ($_POST['CategoryID']=='All' AND $_POST['Location']=='All'){ $sql= "SELECT salesorders.orderno, - salesorders.deliverydate, - salesorderdetails.actualdispatchdate, - TO_DAYS(salesorderdetails.actualdispatchdate) - TO_DAYS(salesorders.deliverydate) AS daydiff, - salesorderdetails.quantity, - salesorderdetails.stkcode, - stockmaster.description, - salesorders.debtorno, - salesorders.branchcode - FROM salesorderdetails INNER JOIN stockmaster + salesorders.deliverydate, + salesorderdetails.actualdispatchdate, + TO_DAYS(salesorderdetails.actualdispatchdate) - TO_DAYS(salesorders.deliverydate) AS daydiff, + salesorderdetails.quantity, + salesorderdetails.stkcode, + stockmaster.description, + salesorders.debtorno, + salesorders.branchcode + FROM salesorderdetails INNER JOIN stockmaster ON salesorderdetails.stkcode=stockmaster.stockid - INNER JOIN salesorders ON salesorderdetails.orderno=salesorders.orderno - WHERE salesorders.deliverydate >='" . FormatDateForSQL($_POST['FromDate']) . "' - AND salesorders.deliverydate <='" . FormatDateForSQL($_POST['ToDate']) . "' - AND (TO_DAYS(salesorderdetails.actualdispatchdate) - TO_DAYS(salesorders.deliverydate)) >'" . $_POST['DaysAcceptable']."'"; + INNER JOIN salesorders ON salesorderdetails.orderno=salesorders.orderno + WHERE salesorders.deliverydate >='" . FormatDateForSQL($_POST['FromDate']) . "' + AND salesorders.deliverydate <='" . FormatDateForSQL($_POST['ToDate']) . "' + AND (TO_DAYS(salesorderdetails.actualdispatchdate) - TO_DAYS(salesorders.deliverydate)) >'" . $_POST['DaysAcceptable']."'"; } elseif ($_POST['CategoryID']!='All' AND $_POST['Location']=='All') { $sql= "SELECT salesorders.orderno, - salesorders.deliverydate, - salesorderdetails.actualdispatchdate, - TO_DAYS(salesorderdetails.actualdispatchdate) - TO_DAYS(salesorders.deliverydate) AS daydiff, - salesorderdetails.quantity, - salesorderdetails.stkcode, - stockmaster.description, - salesorders.debtorno, - salesorders.branchcode - FROM salesorderdetails INNER JOIN stockmaster - ON salesorderdetails.stkcode=stockmaster.stockid - INNER JOIN salesorders ON salesorderdetails.orderno=salesorders.orderno - WHERE salesorders.deliverydate >='" . FormatDateForSQL($_POST['FromDate']) . "' - AND salesorders.deliverydate <='" . FormatDateForSQL($_POST['ToDate']) . "' - AND stockmaster.categoryid='" . $_POST['CategoryID'] ."' - AND (TO_DAYS(salesorderdetails.actualdispatchdate) - - TO_DAYS(salesorders.deliverydate)) >'" . $_POST['DaysAcceptable']."'"; + salesorders.deliverydate, + salesorderdetails.actualdispatchdate, + TO_DAYS(salesorderdetails.actualdispatchdate) - TO_DAYS(salesorders.deliverydate) AS daydiff, + salesorderdetails.quantity, + salesorderdetails.stkcode, + stockmaster.description, + salesorders.debtorno, + salesorders.branchcode + FROM salesorderdetails INNER JOIN stockmaster + ON salesorderdetails.stkcode=stockmaster.stockid + INNER JOIN salesorders ON salesorderdetails.orderno=salesorders.orderno + WHERE salesorders.deliverydate >='" . FormatDateForSQL($_POST['FromDate']) . "' + AND salesorders.deliverydate <='" . FormatDateForSQL($_POST['ToDate']) . "' + AND stockmaster.categoryid='" . $_POST['CategoryID'] ."' + AND (TO_DAYS(salesorderdetails.actualdispatchdate) + - TO_DAYS(salesorders.deliverydate)) >'" . $_POST['DaysAcceptable']."'"; } elseif ($_POST['CategoryID']=='All' AND $_POST['Location']!='All') { $sql= "SELECT salesorders.orderno, - salesorders.deliverydate, - salesorderdetails.actualdispatchdate, - TO_DAYS(salesorderdetails.actualdispatchdate) - TO_DAYS(salesorders.deliverydate) AS daydiff, - salesorderdetails.quantity, - salesorderdetails.stkcode, - stockmaster.description, - salesorders.debtorno, - salesorders.branchcode - FROM salesorderdetails INNER JOIN stockmaster - ON salesorderdetails.stkcode=stockmaster.stockid - INNER JOIN salesorders ON salesorderdetails.orderno=salesorders.orderno - WHERE salesorders.deliverydate >='" . FormatDateForSQL($_POST['FromDate']) . "' - AND salesorders.deliverydate <='" . FormatDateForSQL($_POST['ToDate']) . "' - AND salesorders.fromstkloc='" . $_POST['Location'] . "' - AND (TO_DAYS(salesorderdetails.actualdispatchdate) + salesorders.deliverydate, + salesorderdetails.actualdispatchdate, + TO_DAYS(salesorderdetails.actualdispatchdate) - TO_DAYS(salesorders.deliverydate) AS daydiff, + salesorderdetails.quantity, + salesorderdetails.stkcode, + stockmaster.description, + salesorders.debtorno, + salesorders.branchcode + FROM salesorderdetails INNER JOIN stockmaster + ON salesorderdetails.stkcode=stockmaster.stockid + INNER JOIN salesorders ON salesorderdetails.orderno=salesorders.orderno + WHERE salesorders.deliverydate >='" . FormatDateForSQL($_POST['FromDate']) . "' + AND salesorders.deliverydate <='" . FormatDateForSQL($_POST['ToDate']) . "' + AND salesorders.fromstkloc='" . $_POST['Location'] . "' + AND (TO_DAYS(salesorderdetails.actualdispatchdate) - TO_DAYS(salesorders.deliverydate)) >'" . $_POST['DaysAcceptable'] . "'"; } elseif ($_POST['CategoryID']!='All' AND $_POST['Location']!='All'){ $sql= "SELECT salesorders.orderno, - salesorders.deliverydate, - salesorderdetails.actualdispatchdate, - TO_DAYS(salesorderdetails.actualdispatchdate) - TO_DAYS(salesorders.deliverydate) AS daydiff, - salesorderdetails.quantity, - salesorderdetails.stkcode, - stockmaster.description, - salesorders.debtorno, - salesorders.branchcode - FROM salesorderdetails INNER JOIN stockmaster - ON salesorderdetails.stkcode=stockmaster.stockid - INNER JOIN salesorders ON salesorderdetails.orderno=salesorders.orderno - WHERE salesorders.deliverydate >='" . FormatDateForSQL($_POST['FromDate']) . "' - AND salesorders.deliverydate <='" . FormatDateForSQL($_POST['ToDate']) . "' - AND stockmaster.categoryid='" . $_POST['CategoryID'] ."' - AND salesorders.fromstkloc='" . $_POST['Location'] . "' - AND (TO_DAYS(salesorderdetails.actualdispatchdate) + salesorders.deliverydate, + salesorderdetails.actualdispatchdate, + TO_DAYS(salesorderdetails.actualdispatchdate) - TO_DAYS(salesorders.deliverydate) AS daydiff, + salesorderdetails.quantity, + salesorderdetails.stkcode, + stockmaster.description, + salesorders.debtorno, + salesorders.branchcode + FROM salesorderdetails INNER JOIN stockmaster + ON salesorderdetails.stkcode=stockmaster.stockid + INNER JOIN salesorders ON salesorderdetails.orderno=salesorders.orderno + WHERE salesorders.deliverydate >='" . FormatDateForSQL($_POST['FromDate']) . "' + AND salesorders.deliverydate <='" . FormatDateForSQL($_POST['ToDate']) . "' + AND stockmaster.categoryid='" . $_POST['CategoryID'] ."' + AND salesorders.fromstkloc='" . $_POST['Location'] . "' + AND (TO_DAYS(salesorderdetails.actualdispatchdate) - TO_DAYS(salesorders.deliverydate)) >'" . $_POST['DaysAcceptable'] . "'"; } Modified: trunk/PDFOrdersInvoiced.php =================================================================== --- trunk/PDFOrdersInvoiced.php 2011-07-16 02:59:14 UTC (rev 4632) +++ trunk/PDFOrdersInvoiced.php 2011-07-16 03:37:58 UTC (rev 4633) @@ -36,8 +36,8 @@ 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 '<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>' . _('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>'; $sql = "SELECT categorydescription, categoryid FROM stockcategory WHERE stocktype<>'D' AND stocktype<>'L'"; @@ -61,7 +61,9 @@ } 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; @@ -195,17 +197,17 @@ WHERE salesorders.fromstkloc ='" . $_POST['Location'] . "' AND orddate >='" . FormatDateForSQL($_POST['FromDate']) . "' AND orddate <='" . FormatDateForSQL($_POST['ToDate']) . "' - GROUP BY salesorders.orderno, - salesorders.debtorno, - salesorders.branchcode, - salesorders.customerref, - salesorders.orddate, - salesorders.fromstkloc, - salesorderdetails.stkcode, - stockmaster.description, - stockmaster.units, - stockmaster.decimalplaces"; - + GROUP BY salesorders.orderno, + salesorders.debtorno, + salesorders.branchcode, + salesorders.customerref, + salesorders.orddate, + salesorders.fromstkloc, + salesorderdetails.stkcode, + stockmaster.description, + stockmaster.units, + stockmaster.decimalplaces"; + } elseif ($_POST['CategoryID']!='All' AND $_POST['location']!='All'){ $sql= "SELECT salesorders.orderno, @@ -251,7 +253,7 @@ stockmaster.decimalplaces"; } -$sql .= ' ORDER BY salesorders.orderno'; +$sql .= " ORDER BY salesorders.orderno"; $Result=DB_query($sql,$db,'','',false,false); //dont trap errors here @@ -367,16 +369,16 @@ /*OK now get the invoices where the item was charged */ $sql = "SELECT debtortrans.order_, - systypes.typename, - debtortrans.transno, - stockmoves.price, - -stockmoves.qty AS quantity - FROM debtortrans INNER JOIN stockmoves - ON debtortrans.type = stockmoves.type - AND debtortrans.transno=stockmoves.transno - INNER JOIN systypes ON debtortrans.type=systypes.typeid - WHERE debtortrans.order_ ='" . $OrderNo . "' - AND stockmoves.stockid ='" . $myrow['stkcode'] . "'"; + systypes.typename, + debtortrans.transno, + stockmoves.price, + -stockmoves.qty AS quantity + FROM debtortrans INNER JOIN stockmoves + ON debtortrans.type = stockmoves.type + AND debtortrans.transno=stockmoves.transno + INNER JOIN systypes ON debtortrans.type=systypes.typeid + WHERE debtortrans.order_ ='" . $OrderNo . "' + AND stockmoves.stockid ='" . $myrow['stkcode'] . "'"; $InvoicesResult =DB_query($sql,$db); if (DB_num_rows($InvoicesResult)>0){ Modified: trunk/SelectWorkOrder.php =================================================================== --- trunk/SelectWorkOrder.php 2011-07-16 02:59:14 UTC (rev 4632) +++ trunk/SelectWorkOrder.php 2011-07-16 03:37:58 UTC (rev 4633) @@ -7,7 +7,7 @@ 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'] . '" method=post>'; +echo '<form action="' . $_SERVER['PHP_SELF'] . '" method="post">'; echo '<input type="hidden" name="FormID" value="' . $_SESSION['FormID'] . '" />'; @@ -37,50 +37,50 @@ $SearchString = '%' . str_replace(' ', '%', $_POST['Keywords']) . '%'; $SQL = "SELECT stockmaster.stockid, - stockmaster.description, - SUM(locstock.quantity) AS qoh, - stockmaster.units - FROM stockmaster, - locstock - WHERE stockmaster.stockid=locstock.stockid - AND stockmaster.description " . LIKE . " '" . $SearchString . "' - AND stockmaster.categoryid='" . $_POST['StockCat']. "' - AND stockmaster.mbflag='M' - GROUP BY stockmaster.stockid, - stockmaster.description, - stockmaster.units - ORDER BY stockmaster.stockid"; + stockmaster.description, + SUM(locstock.quantity) AS qoh, + stockmaster.units + FROM stockmaster, + locstock + WHERE stockmaster.stockid=locstock.stockid + AND stockmaster.description " . LIKE . " '" . $SearchString . "' + AND stockmaster.categoryid='" . $_POST['StockCat']. "' + AND stockmaster.mbflag='M' + GROUP BY stockmaster.stockid, + stockmaster.description, + stockmaster.units + ORDER BY stockmaster.stockid"; } elseif (isset($_POST['StockCode'])){ $SQL = "SELECT stockmaster.stockid, - stockmaster.description, - sum(locstock.quantity) as qoh, - stockmaster.units - FROM stockmaster, - locstock - WHERE stockmaster.stockid=locstock.stockid - AND stockmaster.stockid " . LIKE . " '%" . $_POST['StockCode'] . "%' - AND stockmaster.categoryid='" . $_POST['StockCat'] . "' - AND stockmaster.mbflag='M' - GROUP BY stockmaster.stockid, - stockmaster.description, - stockmaster.units - ORDER BY stockmaster.stockid"; + stockmaster.description, + sum(locstock.quantity) as qoh, + stockmaster.units + FROM stockmaster, + locstock + WHERE stockmaster.stockid=locstock.stockid + AND stockmaster.stockid " . LIKE . " '%" . $_POST['StockCode'] . "%' + AND stockmaster.categoryid='" . $_POST['StockCat'] . "' + AND stockmaster.mbflag='M' + GROUP BY stockmaster.stockid, + stockmaster.description, + stockmaster.units + ORDER BY stockmaster.stockid"; } elseif (!isset($_POST['StockCode']) AND !isset($_POST['Keywords'])) { $SQL = "SELECT stockmaster.stockid, - stockmaster.description, - sum(locstock.quantity) as qoh, - stockmaster.units - FROM stockmaster, - locstock - WHERE stockmaster.stockid=locstock.stockid - AND stockmaster.categoryid='" . $_POST['StockCat'] ."' - AND stockmaster.mbflag='M' - GROUP BY stockmaster.stockid, - stockmaster.description, - stockmaster.units - ORDER BY stockmaster.stockid"; + stockmaster.description, + sum(locstock.quantity) as qoh, + stockmaster.units + FROM stockmaster, + locstock + WHERE stockmaster.stockid=locstock.stockid + AND stockmaster.categoryid='" . $_POST['StockCat'] ."' + AND stockmaster.mbflag='M' + GROUP BY stockmaster.stockid, + stockmaster.description, + stockmaster.units + ORDER BY stockmaster.stockid"; } $ErrMsg = _('No items were returned by the SQL because'); @@ -104,11 +104,11 @@ if (!isset($_REQUEST['WO']) or ($_REQUEST['WO']=='')){ echo '<table class=selection><tr><td>'; if (isset($_REQUEST['SelectedStockItem'])) { - echo _('For the item') . ': ' . $_REQUEST['SelectedStockItem'] . ' ' . _('and') . " <input type=hidden name='SelectedStockItem' value='" . $_REQUEST['SelectedStockItem'] . "'>"; + echo _('For the item') . ': ' . $_REQUEST['SelectedStockItem'] . ' ' . _('and') . ' <input type="hidden" name="SelectedStockItem" value="' . $_REQUEST['SelectedStockItem'] . '" />'; } - echo _('Work Order number') . ": <input type="text" name='WO' MAXLENGTH =8 size=9>  " . _('Processing at') . ":<select name='StockLocation'> "; + echo _('Work Order number') . ': <input type="text" name="WO" maxlength="8" size="9" />  ' . _('Processing at') . ':<select name="StockLocation"> '; - $sql = 'SELECT loccode, locationname FROM locations'; + $sql = "SELECT loccode, locationname FROM locations"; $resultStkLocs = DB_query($sql,$db); @@ -142,233 +142,235 @@ } echo '</select>   '; - echo "<input type=submit name='SearchOrders' value='" . _('Search') . "'>"; - echo ' <a href="' . $rootpath . '/WorkOrderEntry.php?' . SID . '">' . _('New Work Order') . '</a></td></tr></table><br />'; + echo '<input type="submit" name="SearchOrders" value="' . _('Search') . '">'; + echo ' <a href="' . $rootpath . '/WorkOrderEntry.php">' . _('New Work Order') . '</a></td></tr></table><br />'; } - $SQL='SELECT categoryid, + $SQL="SELECT categoryid, categorydescription - FROM stockcategory - ORDER BY categorydescription'; + FROM stockcategory + ORDER BY categorydescription"; $result1 = DB_query($SQL,$db); - echo "<table class=selection> - <tr><th colspan=6><font size=3 color=navy>" . _('To search for work orders for a specific item use the item selection facilities below') . "</font></th></tr> - <tr> - <td><font size=1>" . _('Select a stock category') . ":</font> - <select name='StockCat'>"; + echo '<table class="selection"> + <tr> + <th colspan="6"><font size="3" color="navy">' . _('To search for work orders for a specific item use the item selection facilities below') . '</font></th> + </tr> + <tr> + <td><font size="1">' . _('Select a stock category') . ':</font> + <select name="StockCat">'; while ($myrow1 = DB_fetch_array($result1)) { echo '<option value="'. $myrow1['categoryid'] . '">' . $myrow1['categorydescription'] . '</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> - </tr> + <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><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>'; -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>'; - echo $TableHeader; - - $j = 1; - $k=0; //row colour counter - - while ($myrow=DB_fetch_array($StockItemsResult)) { - - if ($k==1){ - echo '<tr class="EvenTableRows">'; - $k=0; - } else { - echo '<tr class="OddTableRows">'; - $k++; - } - - printf("<td><input type=submit name='SelectedStockItem' value='%s'</td> - <td>%s</td> - <td class=number>%s</td> - <td>%s</td> - </tr>", - $myrow['stockid'], - $myrow['description'], - $myrow['qoh'], - $myrow['units']); - - $j++; - if ($j == 12){ - $j=1; - echo $TableHeader; - } -//end of page full new headings if - } -//end of while loop - - echo '</table>'; - -} -//end if stock search results to show - else { - - if (!isset($_POST['StockLocation'])) { - $_POST['StockLocation'] = ''; - } - - //figure out the SQL required from the inputs available - if (isset($_POST['ClosedOrOpen']) and $_POST['ClosedOrOpen']=='Open_Only'){ - $ClosedOrOpen = 0; - } else { - $ClosedOrOpen = 1; - } - if (isset($_REQUEST['WO']) && $_REQUEST['WO'] !='') { - $SQL = "SELECT workorders.wo, - woitems.stockid, - stockmaster.description, - woitems.qtyreqd, - woitems.qtyrecd, - workorders.requiredby - FROM workorders - INNER JOIN woitems ON workorders.wo=woitems.wo - INNER JOIN stockmaster ON woitems.stockid=stockmaster.stockid - WHERE workorders.closed='" . $ClosedOrOpen . "' - AND workorders.wo='". $_REQUEST['WO'] ."' - ORDER BY workorders.wo, - woitems.stockid"; - } else { - /* $DateAfterCriteria = FormatDateforSQL($OrdersAfterDate); */ - - if (isset($_REQUEST['SelectedStockItem'])) { - $SQL = "SELECT workorders.wo, - woitems.stockid, - stockmaster.description, - woitems.qtyreqd, - woitems.qtyrecd, - workorders.requiredby - FROM workorders - INNER JOIN woitems ON workorders.wo=woitems.wo - INNER JOIN stockmaster ON woitems.stockid=stockmaster.stockid - WHERE workorders.closed='" . $ClosedOrOpen . "' - AND woitems.stockid='". $_REQUEST['SelectedStockItem'] ."' - AND workorders.loccode='" . $_POST['StockLocation'] . "' - ORDER BY workorders.wo, - woitems.stockid"; + 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>'; + echo $TableHeader; + + $j = 1; + $k=0; //row colour counter + + while ($myrow=DB_fetch_array($StockItemsResult)) { + + if ($k==1){ + echo '<tr class="EvenTableRows">'; + $k=0; } else { - $SQL = "SELECT workorders.wo, - woitems.stockid, - stockmaster.description, - woitems.qtyreqd, - woitems.qtyrecd, - workorders.requiredby - FROM workorders - INNER JOIN woitems ON workorders.wo=woitems.wo - INNER JOIN stockmaster ON woitems.stockid=stockmaster.stockid - WHERE workorders.closed='" . $ClosedOrOpen . "' - AND workorders.loccode='" . $_POST['StockLocation'] . "' - ORDER BY workorders.wo, - woitems.stockid"; + echo '<tr class="OddTableRows">'; + $k++; } - } //end not order number selected - - $ErrMsg = _('No works orders were returned by the SQL because'); - $WorkOrdersResult = DB_query($SQL,$db,$ErrMsg); - - /*show a table of the orders returned by the SQL */ - if (DB_num_rows($WorkOrdersResult)>0) { - echo '<br /><table cellpadding=2 colspan=7 width=95% class=selection>'; - - - $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; + + printf('<td><input type="submit" name="SelectedStockItem" value="%s" /></td> + <td>%s</td> + <td class="number">%s</td> + <td>%s</td> + </tr>', + $myrow['stockid'], + $myrow['description'], + $myrow['qoh'], + $myrow['units']); + + $j++; + if ($j == 12){ + $j=1; + echo $TableHeader; + } + //end of page full new headings if + } + //end of while loop + + echo '</table>'; + } - $j = 1; - $k=0; //row colour counter - while ($myrow=DB_fetch_array($WorkOrdersResult)) { - - if ($k==1){ - echo '<tr class="EvenTableRows">'; - $k=0; + //end if stock search results to show + else { + + if (!isset($_POST['StockLocation'])) { + $_POST['StockLocation'] = ''; + } + + //figure out the SQL required from the inputs available + if (isset($_POST['ClosedOrOpen']) and $_POST['ClosedOrOpen']=='Open_Only'){ + $ClosedOrOpen = 0; } else { - echo '<tr class="OddTableRows">'; - $k++; + $ClosedOrOpen = 1; } - - $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']); - - - printf("<td><a href='%s'>%s</a></td> - <td><a href='%s'>" . _('Status') . "</a></td> - <td><a href='%s'>" . _('Receive') . "</a></td> - <td><a href='%s'>" . _('Issue To') . "</a></td> - <td><a href='%s'>" . _('Costing') . "</a></td> - <td>%s - %s</td> - <td class=number>%s</td> - <td class=number>%s</td> - <td class=number>%s</td> - <td>%s</td> - </tr>", - $ModifyPage, - $myrow['wo'], - $Status_WO, - $Receive_WO, - $Issue_WO, - $Costing_WO, - $myrow['stockid'], - $myrow['description'], - $myrow['qtyreqd'], - $myrow['qtyrecd'], - $myrow['qtyreqd']-$myrow['qtyrecd'], - $FormatedRequiredByDate); - - $j++; - if ($j == 12){ - $j=1; + if (isset($_REQUEST['WO']) && $_REQUEST['WO'] !='') { + $SQL = "SELECT workorders.wo, + woitems.stockid, + stockmaster.description, + woitems.qtyreqd, + woitems.qtyrecd, + workorders.requiredby + FROM workorders + INNER JOIN woitems ON workorders.wo=woitems.wo + INNER JOIN stockmaster ON woitems.stockid=stockmaster.stockid + WHERE workorders.closed='" . $ClosedOrOpen . "' + AND workorders.wo='". $_REQUEST['WO'] ."' + ORDER BY workorders.wo, + woitems.stockid"; + } else { + /* $DateAfterCriteria = FormatDateforSQL($OrdersAfterDate); */ + + if (isset($_REQUEST['SelectedStockItem'])) { + $SQL = "SELECT workorders.wo, + woitems.stockid, + stockmaster.description, + woitems.qtyreqd, + woitems.qtyrecd, + workorders.requiredby + FROM workorders + INNER JOIN woitems ON workorders.wo=woitems.wo + INNER JOIN stockmaster ON woitems.stockid=stockmaster.stockid + WHERE workorders.closed='" . $ClosedOrOpen . "' + AND woitems.stockid='". $_REQUEST['SelectedStockItem'] ."' + AND workorders.loccode='" . $_POST['StockLocation'] . "' + ORDER BY workorders.wo, + woitems.stockid"; + } else { + $SQL = "SELECT workorders.wo, + woitems.stockid, + stockmaster.description, + woitems.qtyreqd, + woitems.qtyrecd, + workorders.requiredby + FROM workorders + INNER JOIN woitems ON workorders.wo=woitems.wo + INNER JOIN stockmaster ON woitems.stockid=stockmaster.stockid + WHERE workorders.closed='" . $ClosedOrOpen . "' + AND workorders.loccode='" . $_POST['StockLocation'] . "' + ORDER BY workorders.wo, + woitems.stockid"; + } + } //end not order number selected + + $ErrMsg = _('No works orders were returned by the SQL because'); + $WorkOrdersResult = DB_query($SQL,$db,$ErrMsg); + + /*show a table of the orders returned by the SQL */ + if (DB_num_rows($WorkOrdersResult)>0) { + echo '<br /> + <table cellpadding="2" colspan="7" width="95%" class="selection">'; + + + $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; } - //end of page full new headings if + $j = 1; + $k=0; //row colour counter + while ($myrow=DB_fetch_array($WorkOrdersResult)) { + + if ($k==1){ + echo '<tr class="EvenTableRows">'; + $k=0; + } else { + echo '<tr class="OddTableRows">'; + $k++; + } + + $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']); + + + printf('<td><a href="%s">%s</a></td> + <td><a href="%s">' . _('Status') . '</a></td> + <td><a href="%s">' . _('Receive') . '</a></td> + <td><a href="%s">' . _('Issue To') . '</a></td> + <td><a href="%s">' . _('Costing') . '</a></td> + <td>%s - %s</td> + <td class="number">%s</td> + <td class="number">%s</td> + <td class="number">%s</td> + <td>%s</td> + </tr>', + $ModifyPage, + $myrow['wo'], + $Status_WO, + $Receive_WO, + $Issue_WO, + $Costing_WO, + $myrow['stockid'], + $myrow['description'], + $myrow['qtyreqd'], + $myrow['qtyrecd'], + $myrow['qtyreqd']-$myrow['qtyrecd'], + $FormatedRequiredByDate); + + $j++; + if ($j == 12){ + $j=1; + echo $tableheader; + } + //end of page full new headings if + } + //end of while loop + + echo '</table>'; } - //end of while loop - - echo '</table>'; + + echo '<script>defaultControl(document.forms[0].WO);</script>'; + + echo '</form>'; } -echo "<script>defaultControl(document.forms[0].WO);</script>"; - -?> -</form> - -<?php } - include('includes/footer.inc'); ?> \ No newline at end of file This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <dai...@us...> - 2011-07-16 02:59:22
|
Revision: 4632 http://web-erp.svn.sourceforge.net/web-erp/?rev=4632&view=rev Author: daintree Date: 2011-07-16 02:59:14 +0000 (Sat, 16 Jul 2011) Log Message: ----------- type=text quoting Modified Paths: -------------- trunk/AuditTrail.php trunk/Credit_Invoice.php trunk/DeliveryDetails.php trunk/EDIMessageFormat.php trunk/FixedAssetLocations.php trunk/GoodsReceived.php trunk/OutstandingGRNs.php trunk/PDFChequeListing.php trunk/PDFCustTransListing.php trunk/PDFDIFOT.php trunk/PDFDeliveryDifferences.php trunk/PDFLowGP.php trunk/PDFOrderStatus.php trunk/PDFOrdersInvoiced.php trunk/PDFPeriodStockTransListing.php trunk/PDFPickingList.php trunk/PDFRemittanceAdvice.php trunk/PDFStockLocTransfer.php trunk/PDFStockTransfer.php trunk/PDFSuppTransListing.php trunk/PO_Header.php trunk/PO_SelectPurchOrder.php trunk/PcAssignCashToTab.php trunk/Prices.php trunk/PricesBasedOnMarkUp.php trunk/PurchData.php trunk/ReverseGRN.php trunk/SMTPServer.php trunk/SelectCreditItems.php trunk/SelectOrderItems.php trunk/SelectWorkOrder.php trunk/Shipt_Select.php trunk/StockAdjustments.php trunk/StockCostUpdate.php trunk/StockLocTransfer.php trunk/StockLocTransferReceive.php trunk/StockMovements.php trunk/StockReorderLevel.php trunk/StockTransfers.php trunk/StockUsage.php trunk/SuppPaymentRun.php trunk/SupplierContacts.php trunk/SupplierTenders.php trunk/UserSettings.php trunk/WhereUsedInquiry.php trunk/WorkOrderIssue.php trunk/Z_ReverseSuppPaymentRun.php trunk/includes/InputSerialItemsKeyed.php trunk/includes/OutputSerialItems.php Modified: trunk/AuditTrail.php =================================================================== --- trunk/AuditTrail.php 2011-07-16 02:55:44 UTC (rev 4631) +++ trunk/AuditTrail.php 2011-07-16 02:59:14 UTC (rev 4632) @@ -33,9 +33,9 @@ echo '<table class="selection">'; echo '<tr><td>'. _('From Date') . ' ' . $_SESSION['DefaultDateFormat'] .'</td> - <td><input tabindex="1" type=text class=date alt="'.$_SESSION['DefaultDateFormat'].'" name="FromDate" size="11" maxlength="10" value=' .$_POST['FromDate'].'></td></tr>'; + <td><input tabindex="1" type="text" class=date alt="'.$_SESSION['DefaultDateFormat'].'" name="FromDate" size="11" maxlength="10" value=' .$_POST['FromDate'].'></td></tr>'; echo '<tr><td>'. _('To Date') . ' ' . $_SESSION['DefaultDateFormat'] .'</td> - <td><input tabindex="2" type=text class=date alt="'.$_SESSION['DefaultDateFormat'].'" name="ToDate" size="11" maxlength="10" value=' . $_POST['ToDate'] . '></td></tr>'; + <td><input tabindex="2" type="text" class=date alt="'.$_SESSION['DefaultDateFormat'].'" name="ToDate" size="11" maxlength="10" value=' . $_POST['ToDate'] . '></td></tr>'; // Show user selections echo '<tr><td>'. _('User ID'). '</td> Modified: trunk/Credit_Invoice.php =================================================================== --- trunk/Credit_Invoice.php 2011-07-16 02:55:44 UTC (rev 4631) +++ trunk/Credit_Invoice.php 2011-07-16 02:59:14 UTC (rev 4632) @@ -326,8 +326,8 @@ $DisplayLineTotal = number_format($LineTotal,$_SESSION['CreditItems']->CurrDecimalPlaces); $j++; - echo '<td><input tabindex=' . $j . ' type=text class=number name="Price_' . $LnItm->LineNumber . '" maxlength=12 size=6 value=' . $LnItm->Price . '></td> - <td><input tabindex=' . $j . ' type=text class="number" name="Discount_' . $LnItm->LineNumber . '" maxlength=3 size=3 value=' . ($LnItm->DiscountPercent * 100) . '></td> + echo '<td><input tabindex=' . $j . ' type="text" class=number name="Price_' . $LnItm->LineNumber . '" maxlength=12 size=6 value=' . $LnItm->Price . '></td> + <td><input tabindex=' . $j . ' type="text" class="number" name="Discount_' . $LnItm->LineNumber . '" maxlength=3 size=3 value=' . ($LnItm->DiscountPercent * 100) . '></td> <td class=number>' . $DisplayLineTotal . '</td>'; /*Need to list the taxes applicable to this line */ @@ -398,7 +398,7 @@ <td class=number>' . number_format($_SESSION['Old_FreightCost'],$_SESSION['CreditItems']->CurrDecimalPlaces) . '</td> <td></td> <td colspan=2 class=number>' . _('Credit Freight Cost') . '</td> - <td><input tabindex='.$j.' type=text class="number" size=6 maxlength=6 name="ChargeFreightCost" value="' . $_SESSION['CreditItems']->FreightCost . '"></td>'; + <td><input tabindex='.$j.' type="text" class="number" size=6 maxlength=6 name="ChargeFreightCost" value="' . $_SESSION['CreditItems']->FreightCost . '"></td>'; echo '<td>'; echo '</td><td>'; @@ -421,7 +421,7 @@ } if (!isset($_POST['ProcessCredit'])) { - echo '<input type=text class=number name=FreightTaxRate' . $FreightTaxLine->TaxCalculationOrder . ' maxlength=4 size=4 value=' . $FreightTaxLine->TaxRate * 100 . '>'; + echo '<input type="text" class=number name=FreightTaxRate' . $FreightTaxLine->TaxCalculationOrder . ' maxlength=4 size=4 value=' . $FreightTaxLine->TaxRate * 100 . '>'; } if ($FreightTaxLine->TaxOnTax ==1){ $TaxTotals[$FreightTaxLine->TaxAuthID] += ($FreightTaxLine->TaxRate * ($_SESSION['CreditItems']->FreightCost + $FreightTaxTotal)); Modified: trunk/DeliveryDetails.php =================================================================== --- trunk/DeliveryDetails.php 2011-07-16 02:55:44 UTC (rev 4631) +++ trunk/DeliveryDetails.php 2011-07-16 02:59:14 UTC (rev 4632) @@ -941,7 +941,7 @@ echo '<br /><table class=selection><tr> <td>'. _('Deliver To') .':</td> - <td><input type=text size=42 maxlength=40 name="DeliverTo" value="' . $_SESSION['Items'.$identifier]->DeliverTo . '"></td> + <td><input type="text" size=42 maxlength=40 name="DeliverTo" value="' . $_SESSION['Items'.$identifier]->DeliverTo . '"></td> </tr>'; echo '<tr> @@ -1011,28 +1011,28 @@ echo '<tr> <td>'. _('Delivery Address 4') . ':</td> - <td><input type=text size=42 maxlength=40 name="BrAdd4" value="' . $_SESSION['Items'.$identifier]->DelAdd4 . '"></td> + <td><input type="text" size=42 maxlength=40 name="BrAdd4" value="' . $_SESSION['Items'.$identifier]->DelAdd4 . '"></td> </tr>'; echo '<tr> <td>'. _('Delivery Address 5') . ':</td> - <td><input type=text size=42 maxlength=40 name="BrAdd5" value="' . $_SESSION['Items'.$identifier]->DelAdd5 . '"></td> + <td><input type="text" size=42 maxlength=40 name="BrAdd5" value="' . $_SESSION['Items'.$identifier]->DelAdd5 . '"></td> </tr>'; echo '<tr> <td>'. _('Delivery Address 6') . ':</td> - <td><input type=text size=42 maxlength=40 name="BrAdd6" value="' . $_SESSION['Items'.$identifier]->DelAdd6 . '"></td> + <td><input type="text" size=42 maxlength=40 name="BrAdd6" value="' . $_SESSION['Items'.$identifier]->DelAdd6 . '"></td> </tr>'; echo '<tr> <td>'. _('Contact Phone Number') .':</td> - <td><input type=text size=25 maxlength=25 name="PhoneNo" value="' . $_SESSION['Items'.$identifier]->PhoneNo . '"></td> + <td><input type="text" size=25 maxlength=25 name="PhoneNo" value="' . $_SESSION['Items'.$identifier]->PhoneNo . '"></td> </tr>'; -echo '<tr><td>' . _('Contact Email') . ':</td><td><input type=text size=40 maxlength=38 name="Email" value="' . $_SESSION['Items'.$identifier]->Email . '"></td></tr>'; +echo '<tr><td>' . _('Contact Email') . ':</td><td><input type="text" size=40 maxlength=38 name="Email" value="' . $_SESSION['Items'.$identifier]->Email . '"></td></tr>'; echo '<tr><td>'. _('Customer Reference') .':</td> - <td><input type=text size=25 maxlength=25 name="CustRef" value="' . $_SESSION['Items'.$identifier]->CustRef . '"></td> + <td><input type="text" size=25 maxlength=25 name="CustRef" value="' . $_SESSION['Items'.$identifier]->CustRef . '"></td> </tr>'; echo '<tr> @@ -1068,7 +1068,7 @@ } echo '<tr><td>'. _('Charge Freight Cost inc tax') .':</td>'; -echo '<td><input type=text class="number" size=10 maxlength=12 name="FreightCost" value="' . $_SESSION['Items'.$identifier]->FreightCost . '"></td>'; +echo '<td><input type="text" class="number" size=10 maxlength=12 name="FreightCost" value="' . $_SESSION['Items'.$identifier]->FreightCost . '"></td>'; if ($_SESSION['DoFreightCalc']==true){ echo '<td><input type=submit name="Update" value="' . _('Recalc Freight Cost') . '"></td></tr>'; Modified: trunk/EDIMessageFormat.php =================================================================== --- trunk/EDIMessageFormat.php 2011-07-16 02:55:44 UTC (rev 4631) +++ trunk/EDIMessageFormat.php 2011-07-16 02:59:14 UTC (rev 4632) @@ -234,7 +234,7 @@ echo '</td></tr>'; echo '<tr><td>Sequence Number:</td>'; -echo '<td><input tabindex=3 type=text name=SequenceNo size=3 maxlength=3 value='.$_POST['SequenceNo'].'>'; +echo '<td><input tabindex=3 type="text" name=SequenceNo size=3 maxlength=3 value='.$_POST['SequenceNo'].'>'; echo '</td></tr>'; echo '<tr><td>' . _('Line Text') . ':' .'</td>'; echo '<td>'; Modified: trunk/FixedAssetLocations.php =================================================================== --- trunk/FixedAssetLocations.php 2011-07-16 02:55:44 UTC (rev 4631) +++ trunk/FixedAssetLocations.php 2011-07-16 02:59:14 UTC (rev 4632) @@ -110,11 +110,11 @@ echo '<input type=hidden name=LocationID value="'.$LocationID.'">'; echo '<td>'.$LocationID.'</td>'; } else { - echo '<td><input type=text name=LocationID size=6 value="'.$LocationID.'"></td></tr>'; + echo '<td><input type="text" name=LocationID size=6 value="'.$LocationID.'"></td></tr>'; } echo '<tr><th style="text-align:left">'._('Location Description').'</th>'; -echo '<td><input type=text name=LocationDescription size=20 value="'.$LocationDescription.'"></td></tr>'; +echo '<td><input type="text" name=LocationDescription size=20 value="'.$LocationDescription.'"></td></tr>'; echo '<tr><th style="text-align:left">'._('Parent Location').'</th>'; echo '<td><select name=ParentLocationID>'; Modified: trunk/GoodsReceived.php =================================================================== --- trunk/GoodsReceived.php 2011-07-16 02:55:44 UTC (rev 4631) +++ trunk/GoodsReceived.php 2011-07-16 02:59:14 UTC (rev 4632) @@ -75,7 +75,7 @@ echo '<table class="selection"> <tr> <td>'. _('Date Goods/Service Received'). ':</td> - <td><input type=text class=date alt="'. $_SESSION['DefaultDateFormat'] .'" maxlength=10 size=10 onChange="return isDate(this, this.value, '."'". + <td><input type="text" class=date alt="'. $_SESSION['DefaultDateFormat'] .'" maxlength=10 size=10 onChange="return isDate(this, this.value, '."'". $_SESSION['DefaultDateFormat']."'".')" name="DefaultReceivedDate" value="' . $_POST['DefaultReceivedDate'] . '"></td> </tr> </table> @@ -161,7 +161,7 @@ echo '<input type=hidden name="RecvQty_' . $LnItm->LineNo . '" value="' . $LnItm->ReceiveQty . '"><a href="GoodsReceivedControlled.php?identifier=' . $identifier . '&LineNo=' . $LnItm->LineNo . '">' . number_format($LnItm->ReceiveQty,$LnItm->DecimalPlaces) . '</a></td>'; } else { - echo '<input type=text class=number name="RecvQty_' . $LnItm->LineNo . '" maxlength=10 size=10 value="' . $LnItm->ReceiveQty . '"></td>'; + echo '<input type="text" class=number name="RecvQty_' . $LnItm->LineNo . '" maxlength=10 size=10 value="' . $LnItm->ReceiveQty . '"></td>'; } if ($_SESSION['ShowValueOnGRN']==1) { Modified: trunk/OutstandingGRNs.php =================================================================== --- trunk/OutstandingGRNs.php 2011-07-16 02:55:44 UTC (rev 4631) +++ trunk/OutstandingGRNs.php 2011-07-16 02:59:14 UTC (rev 4632) @@ -155,9 +155,9 @@ echo '<input type="hidden" name="FormID" value="' . $_SESSION['FormID'] . '" />'; echo '<tr><td>' . _('From Supplier Code') . ':</td> - <td><input type=text name="FromCriteria" value="0"></td></tr>'; + <td><input type="text" name="FromCriteria" value="0"></td></tr>'; echo '<tr><td>' . _('To Supplier Code'). ':</td> - <td><input type=text name="ToCriteria" value="zzzzzzz"></td></tr>'; + <td><input type="text" name="ToCriteria" value="zzzzzzz"></td></tr>'; echo '</table><br /><div class="centre"><input type=Submit Name="PrintPDF" value="' . _('Print PDF') . '"></div>'; Modified: trunk/PDFChequeListing.php =================================================================== --- trunk/PDFChequeListing.php 2011-07-16 02:55:44 UTC (rev 4631) +++ trunk/PDFChequeListing.php 2011-07-16 02:59:14 UTC (rev 4632) @@ -39,7 +39,7 @@ <td><input type="text" name="FromDate" maxlength="10" size="10" class=date alt="' . $_SESSION['DefaultDateFormat'] . '" value="' . Date($_SESSION['DefaultDateFormat']) . '"></td> </tr>'; echo '<tr><td>' . _('Enter the date to which cheques are to be listed') . ':</td> - <td><input type=text name="ToDate" maxlength="10" size="10" class=date alt="' . $_SESSION['DefaultDateFormat'] . '" value="' . Date($_SESSION['DefaultDateFormat']) . '"></td> + <td><input type="text" name="ToDate" maxlength="10" size="10" class=date alt="' . $_SESSION['DefaultDateFormat'] . '" value="' . Date($_SESSION['DefaultDateFormat']) . '"></td> </tr>'; echo '<tr><td>' . _('Bank Account') . '</td><td>'; Modified: trunk/PDFCustTransListing.php =================================================================== --- trunk/PDFCustTransListing.php 2011-07-16 02:55:44 UTC (rev 4631) +++ trunk/PDFCustTransListing.php 2011-07-16 02:59:14 UTC (rev 4632) @@ -29,7 +29,7 @@ echo '<table class=selection> <tr> <td>' . _('Enter the date for which the transactions are to be listed') . ':</td> - <td><input type=text name="Date" maxlength="10" size="10" class=date alt="' . $_SESSION['DefaultDateFormat'] . '" value="' . Date($_SESSION['DefaultDateFormat']) . '"></td> + <td><input type="text" name="Date" maxlength="10" size="10" class=date alt="' . $_SESSION['DefaultDateFormat'] . '" value="' . Date($_SESSION['DefaultDateFormat']) . '"></td> </tr>'; echo '<tr><td>' . _('Transaction type') . '</td><td>'; Modified: trunk/PDFDIFOT.php =================================================================== --- trunk/PDFDIFOT.php 2011-07-16 02:55:44 UTC (rev 4631) +++ trunk/PDFDIFOT.php 2011-07-16 02:59:14 UTC (rev 4632) @@ -29,14 +29,14 @@ echo "<form method='post' action='" . $_SERVER['PHP_SELF'] . '?' . sid . "'>"; echo '<input type="hidden" name="FormID" value="' . $_SESSION['FormID'] . '" />'; - echo '<table class=selection><tr><td>' . _('Enter the date from which variances between orders and deliveries 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')-1,0,Date('y'))) . "'></td></tr>"; - echo '<tr><td>' . _('Enter the date to which variances between orders and deliveries 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 '<table class=selection><tr><td>' . _('Enter the date from which variances between orders and deliveries 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')-1,0,Date('y'))) . "'></td></tr>"; + echo '<tr><td>' . _('Enter the date to which variances between orders and deliveries 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>"; if (!isset($_POST['DaysAcceptable'])){ $_POST['DaysAcceptable'] = 1; } - echo '<tr><td>' . _('Enter the number of days considered acceptable between delivery requested date and invoice date(ie the date dispatched)') . ":</td><td><input type=text class=number name='DaysAcceptable' maxlength=2 size=2 VALUE=" . $_POST['DaysAcceptable'] . "></td></tr>"; + echo '<tr><td>' . _('Enter the number of days considered acceptable between delivery requested date and invoice date(ie the date dispatched)') . ":</td><td><input type="text" class=number name='DaysAcceptable' maxlength=2 size=2 VALUE=" . $_POST['DaysAcceptable'] . "></td></tr>"; echo '<tr><td>' . _('Inventory Category') . '</td><td>'; $sql = "SELECT categorydescription, categoryid FROM stockcategory WHERE stocktype<>'D' AND stocktype<>'L'"; Modified: trunk/PDFDeliveryDifferences.php =================================================================== --- trunk/PDFDeliveryDifferences.php 2011-07-16 02:55:44 UTC (rev 4631) +++ trunk/PDFDeliveryDifferences.php 2011-07-16 02:59:14 UTC (rev 4632) @@ -29,7 +29,7 @@ echo '<table class=selection> <tr> <td>' . _('Enter the date from which variances between orders and deliveries 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')-1,0,Date('y'))) . '"></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')-1,0,Date('y'))) . '"></td> </tr>'; echo '<tr> <td>' . _('Enter the date to which variances between orders and deliveries 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> Modified: trunk/PDFLowGP.php =================================================================== --- trunk/PDFLowGP.php 2011-07-16 02:55:44 UTC (rev 4631) +++ trunk/PDFLowGP.php 2011-07-16 02:59:14 UTC (rev 4632) @@ -130,15 +130,15 @@ echo '<input type="hidden" name="FormID" value="' . $_SESSION['FormID'] . '" />'; echo '<tr><td>' . _('Sales Made From') . ' (' . _('in the format') . ' ' . $_SESSION['DefaultDateFormat'] . '):</td> - <td><input type=text class="date" alt="' . $_SESSION['DefaultDateFormat'] . '" name="FromDate" size=10 maxlength="10" value="' . $_POST['FromDate'] . '"></td> + <td><input type="text" class="date" alt="' . $_SESSION['DefaultDateFormat'] . '" name="FromDate" size=10 maxlength="10" value="' . $_POST['FromDate'] . '"></td> </tr>'; echo '<tr><td>' . _('Sales Made To') . ' (' . _('in the format') . ' ' . $_SESSION['DefaultDateFormat'] . '):</td> - <td><input type=text class="date" alt="' . $_SESSION['DefaultDateFormat'] . '" name="ToDate" size="10" maxlength="10" value="' . $_POST['ToDate'] . '"></td> + <td><input type="text" class="date" alt="' . $_SESSION['DefaultDateFormat'] . '" name="ToDate" size="10" maxlength="10" value="' . $_POST['ToDate'] . '"></td> </tr>'; echo '<tr><td>' . _('Show sales with GP') . '%' . _('below') . ':</td> - <td><input type=text class="number" name="GPMin" maxlength="3" size="3" value="' . $_POST['GPMin'] . '"></td> + <td><input type="text" class="number" name="GPMin" maxlength="3" size="3" value="' . $_POST['GPMin'] . '"></td> </tr>'; echo '</table> Modified: trunk/PDFOrderStatus.php =================================================================== --- trunk/PDFOrderStatus.php 2011-07-16 02:55:44 UTC (rev 4631) +++ trunk/PDFOrderStatus.php 2011-07-16 02:59:14 UTC (rev 4632) @@ -34,7 +34,7 @@ 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> + <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>'; echo '<input type="text" class="date" alt="' . $_SESSION['DefaultDateFormat'] . '" name="ToDate" maxlength=10 size=10 value="' . Date($_SESSION['DefaultDateFormat']) . '"></td></tr>'; Modified: trunk/PDFOrdersInvoiced.php =================================================================== --- trunk/PDFOrdersInvoiced.php 2011-07-16 02:55:44 UTC (rev 4631) +++ trunk/PDFOrdersInvoiced.php 2011-07-16 02:59:14 UTC (rev 4632) @@ -37,7 +37,7 @@ 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 '<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>"; + <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>'; $sql = "SELECT categorydescription, categoryid FROM stockcategory WHERE stocktype<>'D' AND stocktype<>'L'"; Modified: trunk/PDFPeriodStockTransListing.php =================================================================== --- trunk/PDFPeriodStockTransListing.php 2011-07-16 02:55:44 UTC (rev 4631) +++ trunk/PDFPeriodStockTransListing.php 2011-07-16 02:59:14 UTC (rev 4632) @@ -33,7 +33,7 @@ </tr>'; echo '<tr> <td>' . _('Enter the date to which the transactions are to be listed') . ':</td> - <td><input type=text name="ToDate" maxlength="10" size="10" class="date" alt="' . $_SESSION['DefaultDateFormat'] . '" value="' . Date($_SESSION['DefaultDateFormat']) . '"></td> + <td><input type="text" name="ToDate" maxlength="10" size="10" class="date" alt="' . $_SESSION['DefaultDateFormat'] . '" value="' . Date($_SESSION['DefaultDateFormat']) . '"></td> </tr>'; echo '<tr><td>' . _('Transaction type') . '</td><td>'; Modified: trunk/PDFPickingList.php =================================================================== --- trunk/PDFPickingList.php 2011-07-16 02:55:44 UTC (rev 4631) +++ trunk/PDFPickingList.php 2011-07-16 02:59:14 UTC (rev 4632) @@ -30,7 +30,7 @@ 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 '<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">'; while ($myrow=DB_fetch_array($result)) { Modified: trunk/PDFRemittanceAdvice.php =================================================================== --- trunk/PDFRemittanceAdvice.php 2011-07-16 02:55:44 UTC (rev 4631) +++ trunk/PDFRemittanceAdvice.php 2011-07-16 02:59:14 UTC (rev 4632) @@ -136,9 +136,9 @@ $DefaultToCriteria = $_POST['ToCriteria']; } echo '<tr><td>' . _('From Supplier Code') . ':</font></td> - <td><input Type=text maxlength=6 size=7 name=FromCriteria value="' . $DefaultFromCriteria . '"></td></tr>'; + <td><input type="text" maxlength=6 size=7 name=FromCriteria value="' . $DefaultFromCriteria . '"></td></tr>'; echo '<tr><td>' . _('To Supplier Code') . ':</td> - <td><input Type=text maxlength=6 size=7 name=ToCriteria value="' . $DefaultToCriteria . '"></td></tr>'; + <td><input type="text" maxlength=6 size=7 name=ToCriteria value="' . $DefaultToCriteria . '"></td></tr>'; if (!isset($_POST['PaymentDate'])){ $DefaultDate = Date($_SESSION['DefaultDateFormat'], Mktime(0,0,0,Date('m')+1,0 ,Date('y'))); @@ -147,7 +147,7 @@ } echo '<tr><td>' . _('Date Of Payment') . ':</td> - <td><input type=text class="date" alt="'.$_SESSION['DefaultDateFormat'].'" name="PaymentDate" maxlength=11 size=12 VALUE=' . $DefaultDate . '></td></tr>'; + <td><input type="text" class="date" alt="'.$_SESSION['DefaultDateFormat'].'" name="PaymentDate" maxlength=11 size=12 VALUE=' . $DefaultDate . '></td></tr>'; echo '</table><div class="centre"><input type=Submit Name="PrintPDF" Value="' . _('Print PDF') . '"></div>'; Modified: trunk/PDFStockLocTransfer.php =================================================================== --- trunk/PDFStockLocTransfer.php 2011-07-16 02:55:44 UTC (rev 4631) +++ trunk/PDFStockLocTransfer.php 2011-07-16 02:59:14 UTC (rev 4632) @@ -23,7 +23,7 @@ echo '<form method="POST" action="' . $_SERVER['PHP_SELF'] . '?' . SID . '">'; echo '<input type="hidden" name="FormID" value="' . $_SESSION['FormID'] . '" />'; echo '<table><tr><td>'._('Transfer docket to reprint').'</td>'; - echo '<td><input type=text class=number size=10 name="TransferNo"></td></tr></table>'; + echo '<td><input type="text" class=number size=10 name="TransferNo"></td></tr></table>'; echo '<div class="centre"><input type=submit Name="Print" Value="' . _('Print') .'">'; include ('includes/footer.inc'); exit; Modified: trunk/PDFStockTransfer.php =================================================================== --- trunk/PDFStockTransfer.php 2011-07-16 02:55:44 UTC (rev 4631) +++ trunk/PDFStockTransfer.php 2011-07-16 02:59:14 UTC (rev 4632) @@ -24,7 +24,7 @@ echo '<input type="hidden" name="FormID" value="' . $_SESSION['FormID'] . '" />'; echo '<table class="selection"><tr>'; echo '<td>'._('Print Stock Transfer Note').' : '.'</td>'; - echo '<td><input type=text class="number" name="TransferNo" maxlength=10 size=11 /></td></tr>'; + echo '<td><input type="text" class="number" name="TransferNo" maxlength=10 size=11 /></td></tr>'; echo '</table>'; echo '<br /><div class="centre"><input type="submit" name="Process" value="' . _('Print Transfer Note') . '"></div></form>'; include('includes/footer.inc'); Modified: trunk/PDFSuppTransListing.php =================================================================== --- trunk/PDFSuppTransListing.php 2011-07-16 02:55:44 UTC (rev 4631) +++ trunk/PDFSuppTransListing.php 2011-07-16 02:59:14 UTC (rev 4632) @@ -29,7 +29,7 @@ echo '<table class=selection> <tr> <td>' . _('Enter the date for which the transactions are to be listed') . ":</td> - <td><input type=text name='Date' maxlength=10 size=10 class=date alt='" . $_SESSION['DefaultDateFormat'] . "' VALUE='" . Date($_SESSION['DefaultDateFormat']) . "'></td> + <td><input type="text" name='Date' maxlength=10 size=10 class=date alt='" . $_SESSION['DefaultDateFormat'] . "' VALUE='" . Date($_SESSION['DefaultDateFormat']) . "'></td> </tr>"; echo '<tr><td>' . _('Transaction type') . '</td><td>'; Modified: trunk/PO_Header.php =================================================================== --- trunk/PO_Header.php 2011-07-16 02:55:44 UTC (rev 4631) +++ trunk/PO_Header.php 2011-07-16 02:59:14 UTC (rev 4632) @@ -816,7 +816,7 @@ echo '</select></td></tr>'; echo '<tr><td>' . _('Status Comment') . ':</td> - <td><input type=text name="StatusComments" size=50></td></tr> + <td><input type="text" name="StatusComments" size=50></td></tr> <tr><td colspan=2><b>' . $_SESSION['PO'.$identifier]->StatusComments .'</b></td></tr>'; echo '<input type="hidden" name="StatusCommentsComplete" value="' . htmlentities($_SESSION['PO'.$identifier]->StatusComments, ENT_QUOTES,'UTF-8') .'" />'; @@ -1063,7 +1063,7 @@ if ($_SESSION['PO'.$identifier]->CurrCode != $_SESSION['CompanyRecord']['currencydefault']) { echo '<tr><td>'. _('Exchange Rate').':'.'</td> - <td><input type=text name="ExRate" value='.$_POST['ExRate'].' class="number" size=11></td> + <td><input type="text" name="ExRate" value='.$_POST['ExRate'].' class="number" size=11></td> </tr>'; } else { echo '<input type=hidden name="ExRate" value="1">'; Modified: trunk/PO_SelectPurchOrder.php =================================================================== --- trunk/PO_SelectPurchOrder.php 2011-07-16 02:55:44 UTC (rev 4631) +++ trunk/PO_SelectPurchOrder.php 2011-07-16 02:59:14 UTC (rev 4632) @@ -104,7 +104,7 @@ if (isset($SelectedStockItem)) { echo _('For the part') . ':<b>' . $SelectedStockItem . '</b> ' . _('and') . ' <input type=hidden name="SelectedStockItem" value="' . $SelectedStockItem . '">'; } - echo _('Order Number') . ': <input type=text name="OrderNumber" maxlength=8 size=9> ' . _('Into Stock Location') . ':<select name="StockLocation"> '; + echo _('Order Number') . ': <input type="text" name="OrderNumber" maxlength=8 size=9> ' . _('Into Stock Location') . ':<select name="StockLocation"> '; $sql = "SELECT loccode, locationname FROM locations"; $resultStkLocs = DB_query($sql, $db); while ($myrow = DB_fetch_array($resultStkLocs)) { Modified: trunk/PcAssignCashToTab.php =================================================================== --- trunk/PcAssignCashToTab.php 2011-07-16 02:55:44 UTC (rev 4631) +++ trunk/PcAssignCashToTab.php 2011-07-16 02:59:14 UTC (rev 4632) @@ -329,7 +329,7 @@ echo '<tr><td>' . _('Cash Assignation Date') . ':</td>'; - echo '<td><input type=text class="date" alt="'.$_SESSION['DefaultDateFormat'].'" name="Date" size=10 maxlength=10 value=' . $_POST['Date'] . '></td></tr>'; + echo '<td><input type="text" class="date" alt="'.$_SESSION['DefaultDateFormat'].'" name="Date" size=10 maxlength=10 value=' . $_POST['Date'] . '></td></tr>'; if (!isset($_POST['Amount'])) { Modified: trunk/Prices.php =================================================================== --- trunk/Prices.php 2011-07-16 02:55:44 UTC (rev 4631) +++ trunk/Prices.php 2011-07-16 02:59:14 UTC (rev 4632) @@ -211,7 +211,7 @@ echo '<table class=selection>'; echo '<tr><th colspan=7><form method="post" action="' . $_SERVER['PHP_SELF'] . '">'; echo '<input type="hidden" name="FormID" value="' . $_SESSION['FormID'] . '" />'; - echo _('Pricing for part') . ':<input type=text name="Item" maxsizee=22 value="' . $Item . '" maxlength=20><input type=submit name="NewPart" value="' . _('Review Prices') . '">'; + echo _('Pricing for part') . ':<input type="text" name="Item" maxsizee=22 value="' . $Item . '" maxlength=20><input type=submit name="NewPart" value="' . _('Review Prices') . '">'; echo '</th></tr></form>'; echo '<tr><th>' . _('Currency') . '</th> Modified: trunk/PricesBasedOnMarkUp.php =================================================================== --- trunk/PricesBasedOnMarkUp.php 2011-07-16 02:55:44 UTC (rev 4631) +++ trunk/PricesBasedOnMarkUp.php 2011-07-16 02:59:14 UTC (rev 4632) @@ -148,20 +148,20 @@ } echo '<tr><td>' . _('Rounding Factor') . ':</td> - <td><input type=text class=number name="RoundingFactor" size="6" maxlength="6" value=' . $_POST['RoundingFactor'] . '></td></tr>'; + <td><input type="text" class=number name="RoundingFactor" size="6" maxlength="6" value=' . $_POST['RoundingFactor'] . '></td></tr>'; echo '<tr><td>' . _('New Price To Be Effective From') . ':</td> - <td><input type=text class=date alt="' . $_SESSION['DefaultDateFormat'] . '" name="PriceStartDate" size="10" maxlength="10" value="' . $_POST['PriceStartDate'] . '"></td></tr>'; + <td><input type="text" class=date alt="' . $_SESSION['DefaultDateFormat'] . '" name="PriceStartDate" size="10" maxlength="10" value="' . $_POST['PriceStartDate'] . '"></td></tr>'; echo '<tr><td>' . _('New Price To Be Effective To (Blank = No End Date)') . ':</td> - <td><input type=text class=date alt="' . $_SESSION['DefaultDateFormat'] . '" name="PriceEndDate" size="10" maxlength="10" value="' . $_POST['PriceEndDate'] . '"></td></tr>'; + <td><input type="text" class=date alt="' . $_SESSION['DefaultDateFormat'] . '" name="PriceEndDate" size="10" maxlength="10" value="' . $_POST['PriceEndDate'] . '"></td></tr>'; if (!isset($_POST['IncreasePercent'])){ $_POST['IncreasePercent']=0; } echo '<tr><td>' . _('Percentage Increase (positive) or decrease (negative)') . '</td> - <td><input type=text name="IncreasePercent" class=number size=4 maxlength=4 VALUE="' . $_POST['IncreasePercent'] . '"></td></tr></table>'; + <td><input type="text" name="IncreasePercent" class=number size=4 maxlength=4 VALUE="' . $_POST['IncreasePercent'] . '"></td></tr></table>'; echo '<p><div class="centre"><input type=submit name="UpdatePrices" VALUE="' . _('Update Prices') . '\' onclick="return confirm(\'' . _('Are you sure you wish to update or add all the prices according to the criteria selected?') . '\');"></div>'; Modified: trunk/PurchData.php =================================================================== --- trunk/PurchData.php 2011-07-16 02:55:44 UTC (rev 4631) +++ trunk/PurchData.php 2011-07-16 02:59:14 UTC (rev 4632) @@ -471,18 +471,18 @@ $_POST['ConversionFactor'] = 1; } echo '<tr><td>' . _('Conversion Factor (to our UOM)') . ':</td> - <td><input type=text class=number name="ConversionFactor" maxlength=12 size=12 value=' . $_POST['ConversionFactor'] . '></td></tr>'; + <td><input type="text" class=number name="ConversionFactor" maxlength=12 size=12 value=' . $_POST['ConversionFactor'] . '></td></tr>'; echo '<tr><td>' . _('Supplier Stock Code') . ':</td> - <td><input type=text name="SupplierCode" maxlength=15 size=15 value="' . $_POST['SupplierCode'] . '"></td></tr>'; + <td><input type="text" name="SupplierCode" maxlength=15 size=15 value="' . $_POST['SupplierCode'] . '"></td></tr>'; echo '<tr><td>' . _('MinOrderQty') . ':</td> - <td><input type=text class=number name="MinOrderQty" maxlength=15 size=15 value="' . $_POST['MinOrderQty'] . '"></td></tr>'; + <td><input type="text" class=number name="MinOrderQty" maxlength=15 size=15 value="' . $_POST['MinOrderQty'] . '"></td></tr>'; echo '<tr><td>' . _('Supplier Stock Description') . ':</td> - <td><input type=text name="SupplierDescription" maxlength=50 size=51 value="' . $_POST['SupplierDescription'] . '"></td></tr>'; + <td><input type="text" name="SupplierDescription" maxlength=50 size=51 value="' . $_POST['SupplierDescription'] . '"></td></tr>'; if (!isset($_POST['LeadTime']) OR $_POST['LeadTime'] == "") { $_POST['LeadTime'] = 1; } echo '<tr><td>' . _('Lead Time') . ' (' . _('in days from date of order') . '):</td> - <td><input type=text class=number name="LeadTime" maxlength=4 size=5 value=' . $_POST['LeadTime'] . '></td></tr>'; + <td><input type="text" class=number name="LeadTime" maxlength=4 size=5 value=' . $_POST['LeadTime'] . '></td></tr>'; echo '<tr><td>' . _('Preferred Supplier') . ':</td> <td><select name="Preferred">'; if ($_POST['Preferred'] == 1) { Modified: trunk/ReverseGRN.php =================================================================== --- trunk/ReverseGRN.php 2011-07-16 02:55:44 UTC (rev 4631) +++ trunk/ReverseGRN.php 2011-07-16 02:59:14 UTC (rev 4632) @@ -344,7 +344,7 @@ echo '<table class=selection><tr>'; echo '<input type=hidden name="SupplierID" VALUE="' . $_POST['SupplierID'] . '">'; echo '<input type=hidden name="SuppName" VALUE="' . $_POST['SuppName'] . '">'; - echo '<td>'._('Show all goods received after') . ': </td><td><input type=text class=date alt="'. + echo '<td>'._('Show all goods received after') . ': </td><td><input type="text" class=date alt="'. $_SESSION['DefaultDateFormat'].'" name="RecdAfterDate" Value="' . $_POST['RecdAfterDate'] . '" MAXLENGTH =10 size=10></td></tr>';; echo '</table>'; Modified: trunk/SMTPServer.php =================================================================== --- trunk/SMTPServer.php 2011-07-16 02:55:44 UTC (rev 4631) +++ trunk/SMTPServer.php 2011-07-16 02:59:14 UTC (rev 4632) @@ -40,11 +40,11 @@ echo '<input type="hidden" name="FormID" value="' . $_SESSION['FormID'] . '" />'; echo '<table class=selection>'; echo '<tr><td>'._('Server Host Name').'</td> - <td><input type=text name=host value='.$myrow['host'].'></td></tr>'; + <td><input type="text" name=host value='.$myrow['host'].'></td></tr>'; echo '<tr><td>'._('SMTP port').'</td> - <td><input type=text name=port size=4 class=number value='.$myrow['port'].'></td></tr>'; + <td><input type="text" name=port size=4 class=number value='.$myrow['port'].'></td></tr>'; echo '<tr><td>'._('Helo Command').'</td> - <td><input type=text name=heloaddress value='.$myrow['heloaddress'].'></td></tr>'; + <td><input type="text" name=heloaddress value='.$myrow['heloaddress'].'></td></tr>'; echo '<tr><td>'._('Authorisation Required').'</td><td>'; echo '<select name=auth>'; if ($myrow['auth']==1) { @@ -56,11 +56,11 @@ } echo '</select></td></tr>'; echo '<tr><td>'._('User Name').'</td> - <td><input type=text name=username value='.$myrow['username'].'></td></tr>'; + <td><input type="text" name=username value='.$myrow['username'].'></td></tr>'; echo '<tr><td>'._('Password').'</td> <td><input type=password name=password value='.$myrow['password'].'></td></tr>'; echo '<tr><td>'._('Timeout (seconds)').'</td> - <td><input type=text size=5 name=timeout class=number value='.$myrow['timeout'].'></td></tr>'; + <td><input type="text" size=5 name=timeout class=number value='.$myrow['timeout'].'></td></tr>'; echo '<tr><td colspan=2><div class=centre><input type="submit" name="submit" value="' . _('Update') . '"></div></td></tr>'; echo '</table></form>'; Modified: trunk/SelectCreditItems.php =================================================================== --- trunk/SelectCreditItems.php 2011-07-16 02:55:44 UTC (rev 4631) +++ trunk/SelectCreditItems.php 2011-07-16 02:59:14 UTC (rev 4632) @@ -686,16 +686,16 @@ <td>' . $LineItem->ItemDescription . '</td>'; if ($LineItem->Controlled==0){ - echo '<td><input type=TEXT class="number" name="Quantity_' . $LineItem->LineNumber . '" maxlength=6 size=6 VALUE=' . $LineItem->Quantity . '></td>'; + echo '<td><input type="text" class="number" name="Quantity_' . $LineItem->LineNumber . '" maxlength=6 size=6 VALUE=' . $LineItem->Quantity . '></td>'; } else { echo '<td class=number><a href="' . $rootpath . '/CreditItemsControlled.php?' . SID . '&LineNo=' . $LineItem->LineNumber . '">' . $LineItem->Quantity . '</a> <input type=hidden name="Quantity_' . $LineItem->LineNumber . '" value=' . $LineItem->Quantity . '></td>'; } echo '<td>' . $LineItem->Units . '</td> - <td><input type=TEXT class="number" name="Price_' . $LineItem->LineNumber . '" size=10 maxlength=12 VALUE=' . $LineItem->Price . '></td> + <td><input type="text" class="number" name="Price_' . $LineItem->LineNumber . '" size=10 maxlength=12 VALUE=' . $LineItem->Price . '></td> <td><input type="CheckBox" name="Gross" VALUE=False></td> - <td><input type=TEXT class="number" name="Discount_' . $LineItem->LineNumber . '" size=3 maxlength=3 VALUE=' . ($LineItem->DiscountPercent * 100) . '>%</td> + <td><input type="text" class="number" name="Discount_' . $LineItem->LineNumber . '" size=3 maxlength=3 VALUE=' . ($LineItem->DiscountPercent * 100) . '>%</td> <td class=number>' . $DisplayLineTotal . '</td>'; @@ -722,7 +722,7 @@ if ($i>0){ echo '<br />'; } - echo '<input type=text class="number" name="' . $LineItem->LineNumber . $Tax->TaxCalculationOrder . '_TaxRate" maxlength=4 size=4 value="' . $Tax->TaxRate*100 . '">'; + echo '<input type="text" class="number" name="' . $LineItem->LineNumber . $Tax->TaxCalculationOrder . '_TaxRate" maxlength=4 size=4 value="' . $Tax->TaxRate*100 . '">'; $i++; if ($Tax->TaxOnTax ==1){ $TaxTotals[$Tax->TaxAuthID] += ($Tax->TaxRate * ($LineTotal + $TaxLineTotal)); @@ -763,7 +763,7 @@ echo '<td colspan=2 class=number>'. _('Credit Freight').'</td> - <td><input type=TEXT class="number" size=6 maxlength=6 name=ChargeFreightCost VALUE=' . $_SESSION['CreditItems']->FreightCost . '></td>'; + <td><input type="text" class="number" size=6 maxlength=6 name=ChargeFreightCost VALUE=' . $_SESSION['CreditItems']->FreightCost . '></td>'; $FreightTaxTotal =0; //initialise tax total @@ -786,7 +786,7 @@ echo '<br />'; } - echo '<input type=TEXT class="number" name=FreightTaxRate' . $FreightTaxLine->TaxCalculationOrder . ' maxlength=4 size=4 VALUE=' . $FreightTaxLine->TaxRate * 100 . '>'; + echo '<input type="text" class="number" name=FreightTaxRate' . $FreightTaxLine->TaxCalculationOrder . ' maxlength=4 size=4 VALUE=' . $FreightTaxLine->TaxRate * 100 . '>'; if ($FreightTaxLine->TaxOnTax ==1){ $TaxTotals[$FreightTaxLine->TaxAuthID] += ($FreightTaxLine->TaxRate * ($_SESSION['CreditItems']->FreightCost + $FreightTaxTotal)); Modified: trunk/SelectOrderItems.php =================================================================== --- trunk/SelectOrderItems.php 2011-07-16 02:55:44 UTC (rev 4631) +++ trunk/SelectOrderItems.php 2011-07-16 02:59:14 UTC (rev 4632) @@ -1395,7 +1395,7 @@ echo $RowStarter; if($_SESSION['Items'.$identifier]->DefaultPOLine ==1){ //show the input field only if required - echo '<td><input tabindex=1 type=text name="POLine_' . $OrderLine->LineNumber . '" size=20 maxlength=20 value=' . $OrderLine->POLine . '></td>'; + echo '<td><input tabindex=1 type="text" name="POLine_' . $OrderLine->LineNumber . '" size=20 maxlength=20 value=' . $OrderLine->POLine . '></td>'; } else { echo '<input type="hidden" name="POLine_' . $OrderLine->LineNumber . '" value="">'; } @@ -1413,9 +1413,9 @@ if (in_array(2,$_SESSION['AllowedPageSecurityTokens'])){ /*OK to display with discount if it is an internal user with appropriate permissions */ - echo '<td><input class="number" type=text name="Price_' . $OrderLine->LineNumber . '" size=16 maxlength=16 value=' . $OrderLine->Price . '></td> - <td><input class="number" type=text name="Discount_' . $OrderLine->LineNumber . '" size=5 maxlength=4 value=' . ($OrderLine->DiscountPercent * 100) . '></td> - <td><input class="number" type=text name="GPPercent_' . $OrderLine->LineNumber . '" size=3 maxlength=40 value=' . $OrderLine->GPPercent . '></td>'; + echo '<td><input class="number" type="text" name="Price_' . $OrderLine->LineNumber . '" size=16 maxlength=16 value=' . $OrderLine->Price . '></td> + <td><input class="number" type="text" name="Discount_' . $OrderLine->LineNumber . '" size=5 maxlength=4 value=' . ($OrderLine->DiscountPercent * 100) . '></td> + <td><input class="number" type="text" name="GPPercent_' . $OrderLine->LineNumber . '" size=3 maxlength=40 value=' . $OrderLine->GPPercent . '></td>'; } else { echo '<td class=number>' . $OrderLine->Price . '</td><td></td>'; echo '<input type=hidden name="Price_' . $OrderLine->LineNumber . '" value=' . $OrderLine->Price . '>'; @@ -1432,7 +1432,7 @@ $_SESSION['Items'.$identifier]->LineItems[$OrderLine->LineNumber]->ItemDue= $LineDueDate; } - echo '<td><input type=text class="date" alt="'.$_SESSION['DefaultDateFormat'].'" name="ItemDue_' . $OrderLine->LineNumber . '" size=10 maxlength=10 value=' . $LineDueDate . '></td>'; + echo '<td><input type="text" class="date" alt="'.$_SESSION['DefaultDateFormat'].'" name="ItemDue_' . $OrderLine->LineNumber . '" size=10 maxlength=10 value=' . $LineDueDate . '></td>'; echo '<td><a href="' . $_SERVER['PHP_SELF'] . '?identifier=' . $identifier . '&Delete=' . $OrderLine->LineNumber . '" onclick="return confirm(\'' . _('Are You Sure?') . '\');">' . $RemTxt . '</a></td></tr>'; Modified: trunk/SelectWorkOrder.php =================================================================== --- trunk/SelectWorkOrder.php 2011-07-16 02:55:44 UTC (rev 4631) +++ trunk/SelectWorkOrder.php 2011-07-16 02:59:14 UTC (rev 4632) @@ -106,7 +106,7 @@ if (isset($_REQUEST['SelectedStockItem'])) { echo _('For the item') . ': ' . $_REQUEST['SelectedStockItem'] . ' ' . _('and') . " <input type=hidden name='SelectedStockItem' value='" . $_REQUEST['SelectedStockItem'] . "'>"; } - echo _('Work Order number') . ": <input type=text name='WO' MAXLENGTH =8 size=9>  " . _('Processing at') . ":<select name='StockLocation'> "; + echo _('Work Order number') . ": <input type="text" name='WO' MAXLENGTH =8 size=9>  " . _('Processing at') . ":<select name='StockLocation'> "; $sql = 'SELECT loccode, locationname FROM locations'; Modified: trunk/Shipt_Select.php =================================================================== --- trunk/Shipt_Select.php 2011-07-16 02:55:44 UTC (rev 4631) +++ trunk/Shipt_Select.php 2011-07-16 02:59:14 UTC (rev 4632) @@ -103,7 +103,7 @@ if (!isset($ShiptRef) or $ShiptRef==""){ echo '<table class=selection><tr><td>'; - echo _('Shipment Number'). ': <input type=text name="ShiptRef" MAXLENGTH =10 size=10> '. + echo _('Shipment Number'). ': <input type="text" name="ShiptRef" MAXLENGTH =10 size=10> '. _('Into Stock Location').' :<select name="StockLocation"> '; $sql = "SELECT loccode, locationname FROM locations"; $resultStkLocs = DB_query($sql,$db); Modified: trunk/StockAdjustments.php =================================================================== --- trunk/StockAdjustments.php 2011-07-16 02:55:44 UTC (rev 4631) +++ trunk/StockAdjustments.php 2011-07-16 02:59:14 UTC (rev 4632) @@ -334,16 +334,16 @@ } echo '<tr><td>'. _('Stock Code'). ':</td><td>'; if (isset($StockID)) { - echo '<input type=text name="StockID" size=21 value="' . $StockID . '" maxlength=20></td></tr>'; + echo '<input type="text" name="StockID" size=21 value="' . $StockID . '" maxlength=20></td></tr>'; } else { - echo '<input type=text name="StockID" size=21 value="" maxlength=20></td></tr>'; + echo '<input type="text" name="StockID" size=21 value="" maxlength=20></td></tr>'; } -echo '<tr><td>'. _('Partial Description'). ':</td><td><input type=text name="StockText" size=21 value="' . +echo '<tr><td>'. _('Partial Description'). ':</td><td><input type="text" name="StockText" size=21 value="' . $_GET['Description'] .'"> '._('Partial Stock Code'). ':</td><td>'; if (isset($StockID)) { - echo '<input type=text name="StockCode" size=21 value="' . $StockID .'" maxlength=20>'; + echo '<input type="text" name="StockCode" size=21 value="' . $StockID .'" maxlength=20>'; } else { - echo '<input type=text name="StockCode" size=21 value="" maxlength=20>'; + echo '<input type="text" name="StockCode" size=21 value="" maxlength=20>'; } echo '</td><td><input type=submit name="CheckCode" VALUE="'._('Check Part').'"></td></tr>'; if (isset($_SESSION['Adjustment']) and mb_strlen($_SESSION['Adjustment']->ItemDescription)>1){ @@ -377,7 +377,7 @@ } echo '<tr><td>'. _('Comments On Why').':</td> - <td><input type=text name="Narrative" size=32 maxlength=30 value="' . $_SESSION['Adjustment']->Narrative . '"></td></tr>'; + <td><input type="text" name="Narrative" size=32 maxlength=30 value="' . $_SESSION['Adjustment']->Narrative . '"></td></tr>'; echo '<tr><td>'._('Adjustment Quantity').':</td>'; @@ -391,7 +391,7 @@ [<a href="'.$rootpath.'/StockAdjustmentsControlled.php?AdjType=REMOVE&' . SID . '">'._('Remove').'</a>] [<a href="'.$rootpath.'/StockAdjustmentsControlled.php?AdjType=ADD&' . SID . '">'._('Add').'</a>]'; } else { - echo '<input type=TEXT class="number" name="Quantity" size=12 maxlength=12 Value="' . $Quantity . '">'; + echo '<input type="text" class="number" name="Quantity" size=12 maxlength=12 Value="' . $Quantity . '">'; } echo '</td></tr>'; //Select the tag Modified: trunk/StockCostUpdate.php =================================================================== --- trunk/StockCostUpdate.php 2011-07-16 02:55:44 UTC (rev 4631) +++ trunk/StockCostUpdate.php 2011-07-16 02:59:14 UTC (rev 4632) @@ -152,8 +152,8 @@ if ($myrow['mbflag']=='M'){ echo '<input type=hidden name="MaterialCost" VALUE=' . $myrow['materialcost'] . '>'; echo '<tr><td>' . _('Standard Material Cost Per Unit') .':</td><td class=number>' . number_format($myrow['materialcost'],4) . '</td></tr>'; - echo '<tr><td>' . _('Standard Labour Cost Per Unit') . ':</td><td class=number><input type=text class="number" name="LabourCost" value=' . $myrow['labourcost'] . '></td></tr>'; - echo '<tr><td>' . _('Standard Overhead Cost Per Unit') . ':</td><td class=number><input type=text class="number" name="OverheadCost" value=' . $myrow['overheadcost'] . '></td></tr>'; + echo '<tr><td>' . _('Standard Labour Cost Per Unit') . ':</td><td class=number><input type="text" class="number" name="LabourCost" value=' . $myrow['labourcost'] . '></td></tr>'; + echo '<tr><td>' . _('Standard Overhead Cost Per Unit') . ':</td><td class=number><input type="text" class="number" name="OverheadCost" value=' . $myrow['overheadcost'] . '></td></tr>'; } elseif ($myrow['mbflag']=='B' OR $myrow['mbflag']=='D') { echo '<tr><td>' . _('Standard Cost') .':</td><td class=number><input type="text" class="number" name="MaterialCost" value=' . $myrow['materialcost'] . '></td></tr>'; } else { Modified: trunk/StockLocTransfer.php =================================================================== --- trunk/StockLocTransfer.php 2011-07-16 02:55:44 UTC (rev 4631) +++ trunk/StockLocTransfer.php 2011-07-16 02:59:14 UTC (rev 4632) @@ -197,8 +197,8 @@ $k++; echo '<tr> - <td><input type=text name="StockID' . $i .'" size="21" maxlength="20" value="' . $_POST['StockID' . $i] . '"></td> - <td><input type=text name="StockQTY' . $i .'" size="10" maxlength="10" class="number" value="' . $_POST['StockQTY' . $i] . '"></td> + <td><input type="text" name="StockID' . $i .'" size="21" maxlength="20" value="' . $_POST['StockID' . $i] . '"></td> + <td><input type="text" name="StockQTY' . $i .'" size="10" maxlength="10" class="number" value="' . $_POST['StockQTY' . $i] . '"></td> </tr>'; } }else { @@ -215,8 +215,8 @@ $_POST['StockQTY' . $i]=0; } echo '<tr> - <td><input type=text name="StockID' . $i .'" size=21 maxlength=20 value="' . $_POST['StockID' . $i] . '"></td> - <td><input type=text name="StockQTY' . $i .'" size=10 maxlength=10 class="number" value="' . $_POST['StockQTY' . $i] . '"></td> + <td><input type="text" name="StockID' . $i .'" size=21 maxlength=20 value="' . $_POST['StockID' . $i] . '"></td> + <td><input type="text" name="StockQTY' . $i .'" size=10 maxlength=10 class="number" value="' . $_POST['StockQTY' . $i] . '"></td> </tr>'; $i++; } Modified: trunk/StockLocTransferReceive.php =================================================================== --- trunk/StockLocTransferReceive.php 2011-07-16 02:55:44 UTC (rev 4631) +++ trunk/StockLocTransferReceive.php 2011-07-16 02:59:14 UTC (rev 4632) @@ -468,7 +468,7 @@ if ($TrfLine->Controlled==1){ echo '<td class=number><input type=hidden name="Qty' . $i . '" VALUE="' . $Qty . '"><a href="' . $rootpath .'/StockTransferControlled.php?' . SID . '&TransferItem=' . $i . '">' . $Qty . '</a></td>'; } else { - echo '<td><input type=text class="number" name="Qty' . $i . '" maxlength=10 class="number" size=auto VALUE="' . $Qty . '"></td>'; + echo '<td><input type="text" class="number" name="Qty' . $i . '" maxlength=10 class="number" size=auto VALUE="' . $Qty . '"></td>'; } echo '<td>' . $TrfLine->PartUnit . '</td>'; Modified: trunk/StockMovements.php =================================================================== --- trunk/StockMovements.php 2011-07-16 02:55:44 UTC (rev 4631) +++ trunk/StockMovements.php 2011-07-16 02:59:14 UTC (rev 4632) @@ -51,8 +51,8 @@ } echo '</select></th></tr>'; -echo '<tr><th colspan=10>' . _('Show Movements before') . ': <input type=text name="BeforeDate" class="date" alt="'.$_SESSION['DefaultDateFormat'].'" size="12" maxlength="12" VALUE="' . $_POST['BeforeDate'] . '">'; -echo ' ' . _('But after') . ': <input type=TEXT name="AfterDate" class="date" alt="'.$_SESSION['DefaultDateFormat'].'" size="12" maxlength="12" VALUE="' . $_POST['AfterDate'] . '">'; +echo '<tr><th colspan=10>' . _('Show Movements before') . ': <input type="text" name="BeforeDate" class="date" alt="'.$_SESSION['DefaultDateFormat'].'" size="12" maxlength="12" VALUE="' . $_POST['BeforeDate'] . '">'; +echo ' ' . _('But after') . ': <input type="text" name="AfterDate" class="date" alt="'.$_SESSION['DefaultDateFormat'].'" size="12" maxlength="12" VALUE="' . $_POST['AfterDate'] . '">'; echo ' <input type="submit" name="ShowMoves" value="' . _('Show Stock Movements') . '"></th></tr>'; $SQLBeforeDate = FormatDateForSQL($_POST['BeforeDate']); Modified: trunk/StockReorderLevel.php =================================================================== --- trunk/StockReorderLevel.php 2011-07-16 02:55:44 UTC (rev 4631) +++ trunk/StockReorderLevel.php 2011-07-16 02:59:14 UTC (rev 4632) @@ -77,7 +77,7 @@ printf("<td>%s</td> <td class=number>%s</td> - <td><input type=text class='number' name=%s maxlength=10 size=10 VALUE=%s></td>", + <td><input type="text" class='number' name=%s maxlength=10 size=10 VALUE=%s></td>", $myrow['locationname'], number_format($myrow['quantity'],$myrow['decimalplaces']), $myrow['loccode'], Modified: trunk/StockTransfers.php =================================================================== --- trunk/StockTransfers.php 2011-07-16 02:55:44 UTC (rev 4631) +++ trunk/StockTransfers.php 2011-07-16 02:59:14 UTC (rev 4632) @@ -444,16 +444,16 @@ } echo '<table class=selection><tr><td>'. _('Stock Code'). ':</td><td>'; if (isset($_POST['StockID'])) { - echo '<input type=text name="StockID" size=21 value="' . $_POST['StockID'] . '" maxlength=20></td></tr>'; + echo '<input type="text" name="StockID" size=21 value="' . $_POST['StockID'] . '" maxlength=20></td></tr>'; } else { - echo '<input type=text name="StockID" size=21 value="" maxlength=20></td></tr>'; + echo '<input type="text" name="StockID" size=21 value="" maxlength=20></td></tr>'; } -echo '<tr><td>'. _('Partial Description'). ':</td><td><input type=text name="StockText" size=21 value="' . +echo '<tr><td>'. _('Partial Description'). ':</td><td><input type="text" name="StockText" size=21 value="' . $_GET['Description'] .'"></td><td>'._('Partial Stock Code'). ':</td><td>'; if (isset($_POST['StockID'])) { - echo '<input type=text name="StockCode" size=21 value="' . $_POST['StockID'] .'" maxlength=20>'; + echo '<input type="text" name="StockCode" size=21 value="' . $_POST['StockID'] .'" maxlength=20>'; } else { - echo '<input type=text name="StockCode" size=21 value="" maxlength=20>'; + echo '<input type="text" name="StockCode" size=21 value="" maxlength=20>'; } echo '</td><td><input type=submit name="CheckCode" value="'._('Check Part').'"></td></tr>'; @@ -510,9 +510,9 @@ echo '<td class=number><input type=hidden name="Quantity" value=' . $_SESSION['Transfer']->TransferItem[0]->Quantity . '><a href="' . $rootpath .'/StockTransferControlled.php?StockLocationFrom='.$_SESSION['Transfer']->StockLocationFrom.'">' . $_SESSION['Transfer']->TransferItem[0]->Quantity . '</a></td></tr>'; } elseif (isset($_SESSION['Transfer']->TransferItem[0]->Controlled)){ - echo '<td><input type=text class="number" name="Quantity" size=12 maxlength=12 value=' . $_SESSION['Transfer']->TransferItem[0]->Quantity . '></td></tr>'; + echo '<td><input type="text" class="number" name="Quantity" size=12 maxlength=12 value=' . $_SESSION['Transfer']->TransferItem[0]->Quantity . '></td></tr>'; } else { - echo '<td><input type=text class="number" name="Quantity" size=12 maxlength=12 Value="0"></td></tr>'; + echo '<td><input type="text" class="number" name="Quantity" size=12 maxlength=12 Value="0"></td></tr>'; } echo '</table><div class="centre"><br /><input type="submit" name="EnterTransfer" value="' . _('Enter Stock Transfer') . '"><br />'; Modified: trunk/StockUsage.php =================================================================== --- trunk/StockUsage.php 2011-07-16 02:55:44 UTC (rev 4631) +++ trunk/StockUsage.php 2011-07-16 02:59:14 UTC (rev 4632) @@ -55,7 +55,7 @@ echo '<form action="' . $_SERVER['PHP_SELF'] . '" method=post>'; echo '<input type="hidden" name="FormID" value="' . $_SESSION['FormID'] . '" />'; -echo '<tr><td>' . _('Stock Code') . ':<input type=text name="StockID" size="21" maxlength="20" value="' . $StockID . '" />'; +echo '<tr><td>' . _('Stock Code') . ':<input type="text" name="StockID" size="21" maxlength="20" value="' . $StockID . '" />'; echo _('From Stock Location') . ':<select name="StockLocation">'; Modified: trunk/SuppPaymentRun.php =================================================================== --- trunk/SuppPaymentRun.php 2011-07-16 02:55:44 UTC (rev 4631) +++ trunk/SuppPaymentRun.php 2011-07-16 02:59:14 UTC (rev 4632) @@ -257,9 +257,9 @@ $DefaultToCriteria = $_POST['ToCriteria']; } echo '<tr><td>' . _('From Supplier Code') . ':</font></td> - <td><input Type=text maxlength=6 size=7 name=FromCriteria value="' . $DefaultFromCriteria . '"></td></tr>'; + <td><input type="text" maxlength=6 size=7 name=FromCriteria value="' . $DefaultFromCriteria . '"></td></tr>'; echo '<tr><td>' . _('To Supplier Code') . ':</td> - <td><input Type=text maxlength=6 size=7 name=ToCriteria value="' . $DefaultToCriteria . '"></td></tr>'; + <td><input type="text" maxlength=6 size=7 name=ToCriteria value="' . $DefaultToCriteria . '"></td></tr>'; echo '<tr><td>' . _('For Suppliers Trading in') . ':</td><td><select name="Currency">'; @@ -281,7 +281,7 @@ $DefaultExRate = $_POST['ExRate']; } echo '<tr><td>' . _('Exchange Rate') . ':</td> - <td><input type=text class="number" name="ExRate" maxlength=11 size=12 VALUE=' . $DefaultExRate . '></td></tr>'; + <td><input type="text" class="number" name="ExRate" maxlength=11 size=12 VALUE=' . $DefaultExRate . '></td></tr>'; if (!isset($_POST['AmountsDueBy'])){ $DefaultDate = Date($_SESSION['DefaultDateFormat'], Mktime(0,0,0,Date('m')+1,0 ,Date('y'))); @@ -290,7 +290,7 @@ } echo '<tr><td>' . _('Payments Due To') . ':</td> - <td><input type=text class="date" alt="'.$_SESSION['DefaultDateFormat'].'" name="AmountsDueBy" maxlength=11 size=12 VALUE=' . $DefaultDate . '></td></tr>'; + <td><input type="text" class="date" alt="'.$_SESSION['DefaultDateFormat'].'" name="AmountsDueBy" maxlength=11 size=12 VALUE=' . $DefaultDate . '></td></tr>'; $SQL = 'SELECT bankaccountname, accountcode FROM bankaccounts'; @@ -348,7 +348,7 @@ } echo '<tr><td>' . _('Starting Reference no (eg chq no)') . ':</td> - <td><input type=text name="Ref" maxlength=11 size=12 VALUE=' . $_POST['Ref'] . '></td></tr>'; + <td><input type="text" name="Ref" maxlength=11 size=12 VALUE=' . $_POST['Ref'] . '></td></tr>'; echo '</table><br /><div class="centre"><input type=Submit Name="PrintPDF" Value="' . _('Print PDF Only') . '"> <input type=Submit Name="PrintPDFAndProcess" Value="' . _('Print and Process Payments') . '"></div>'; Modified: trunk/SupplierContacts.php =================================================================== --- trunk/SupplierContacts.php 2011-07-16 02:55:44 UTC (rev 4631) +++ trunk/SupplierContacts.php 2011-07-16 02:59:14 UTC (rev 4632) @@ -245,13 +245,13 @@ <tr><td>' . _('Position') . ':</td> <td><input type="text" name="Position" size=31 maxlength=30 value="' . $_POST['Position'] . '"></td></tr> <tr><td>' . _('Telephone No') . ':</td> - <td><input type=text name="Tel" size=31 maxlength=30 value="' . $_POST['Tel'] . '"></td></tr> + <td><input type="text" name="Tel" size=31 maxlength=30 value="' . $_POST['Tel'] . '"></td></tr> <tr><td>' . _('Facsimile No') . ':</td> - <td><input type=text name="Fax" size=31 maxlength=30 value="' . $_POST['Fax'] . '"></td></tr> + <td><input type="text" name="Fax" size... [truncated message content] |
From: <dai...@us...> - 2011-07-16 02:59:22
|
Revision: 4632 http://web-erp.svn.sourceforge.net/web-erp/?rev=4632&view=rev Author: daintree Date: 2011-07-16 02:59:14 +0000 (Sat, 16 Jul 2011) Log Message: ----------- type=text quoting Modified Paths: -------------- trunk/AuditTrail.php trunk/Credit_Invoice.php trunk/DeliveryDetails.php trunk/EDIMessageFormat.php trunk/FixedAssetLocations.php trunk/GoodsReceived.php trunk/OutstandingGRNs.php trunk/PDFChequeListing.php trunk/PDFCustTransListing.php trunk/PDFDIFOT.php trunk/PDFDeliveryDifferences.php trunk/PDFLowGP.php trunk/PDFOrderStatus.php trunk/PDFOrdersInvoiced.php trunk/PDFPeriodStockTransListing.php trunk/PDFPickingList.php trunk/PDFRemittanceAdvice.php trunk/PDFStockLocTransfer.php trunk/PDFStockTransfer.php trunk/PDFSuppTransListing.php trunk/PO_Header.php trunk/PO_SelectPurchOrder.php trunk/PcAssignCashToTab.php trunk/Prices.php trunk/PricesBasedOnMarkUp.php trunk/PurchData.php trunk/ReverseGRN.php trunk/SMTPServer.php trunk/SelectCreditItems.php trunk/SelectOrderItems.php trunk/SelectWorkOrder.php trunk/Shipt_Select.php trunk/StockAdjustments.php trunk/StockCostUpdate.php trunk/StockLocTransfer.php trunk/StockLocTransferReceive.php trunk/StockMovements.php trunk/StockReorderLevel.php trunk/StockTransfers.php trunk/StockUsage.php trunk/SuppPaymentRun.php trunk/SupplierContacts.php trunk/SupplierTenders.php trunk/UserSettings.php trunk/WhereUsedInquiry.php trunk/WorkOrderIssue.php trunk/Z_ReverseSuppPaymentRun.php trunk/includes/InputSerialItemsKeyed.php trunk/includes/OutputSerialItems.php Modified: trunk/AuditTrail.php =================================================================== --- trunk/AuditTrail.php 2011-07-16 02:55:44 UTC (rev 4631) +++ trunk/AuditTrail.php 2011-07-16 02:59:14 UTC (rev 4632) @@ -33,9 +33,9 @@ echo '<table class="selection">'; echo '<tr><td>'. _('From Date') . ' ' . $_SESSION['DefaultDateFormat'] .'</td> - <td><input tabindex="1" type=text class=date alt="'.$_SESSION['DefaultDateFormat'].'" name="FromDate" size="11" maxlength="10" value=' .$_POST['FromDate'].'></td></tr>'; + <td><input tabindex="1" type="text" class=date alt="'.$_SESSION['DefaultDateFormat'].'" name="FromDate" size="11" maxlength="10" value=' .$_POST['FromDate'].'></td></tr>'; echo '<tr><td>'. _('To Date') . ' ' . $_SESSION['DefaultDateFormat'] .'</td> - <td><input tabindex="2" type=text class=date alt="'.$_SESSION['DefaultDateFormat'].'" name="ToDate" size="11" maxlength="10" value=' . $_POST['ToDate'] . '></td></tr>'; + <td><input tabindex="2" type="text" class=date alt="'.$_SESSION['DefaultDateFormat'].'" name="ToDate" size="11" maxlength="10" value=' . $_POST['ToDate'] . '></td></tr>'; // Show user selections echo '<tr><td>'. _('User ID'). '</td> Modified: trunk/Credit_Invoice.php =================================================================== --- trunk/Credit_Invoice.php 2011-07-16 02:55:44 UTC (rev 4631) +++ trunk/Credit_Invoice.php 2011-07-16 02:59:14 UTC (rev 4632) @@ -326,8 +326,8 @@ $DisplayLineTotal = number_format($LineTotal,$_SESSION['CreditItems']->CurrDecimalPlaces); $j++; - echo '<td><input tabindex=' . $j . ' type=text class=number name="Price_' . $LnItm->LineNumber . '" maxlength=12 size=6 value=' . $LnItm->Price . '></td> - <td><input tabindex=' . $j . ' type=text class="number" name="Discount_' . $LnItm->LineNumber . '" maxlength=3 size=3 value=' . ($LnItm->DiscountPercent * 100) . '></td> + echo '<td><input tabindex=' . $j . ' type="text" class=number name="Price_' . $LnItm->LineNumber . '" maxlength=12 size=6 value=' . $LnItm->Price . '></td> + <td><input tabindex=' . $j . ' type="text" class="number" name="Discount_' . $LnItm->LineNumber . '" maxlength=3 size=3 value=' . ($LnItm->DiscountPercent * 100) . '></td> <td class=number>' . $DisplayLineTotal . '</td>'; /*Need to list the taxes applicable to this line */ @@ -398,7 +398,7 @@ <td class=number>' . number_format($_SESSION['Old_FreightCost'],$_SESSION['CreditItems']->CurrDecimalPlaces) . '</td> <td></td> <td colspan=2 class=number>' . _('Credit Freight Cost') . '</td> - <td><input tabindex='.$j.' type=text class="number" size=6 maxlength=6 name="ChargeFreightCost" value="' . $_SESSION['CreditItems']->FreightCost . '"></td>'; + <td><input tabindex='.$j.' type="text" class="number" size=6 maxlength=6 name="ChargeFreightCost" value="' . $_SESSION['CreditItems']->FreightCost . '"></td>'; echo '<td>'; echo '</td><td>'; @@ -421,7 +421,7 @@ } if (!isset($_POST['ProcessCredit'])) { - echo '<input type=text class=number name=FreightTaxRate' . $FreightTaxLine->TaxCalculationOrder . ' maxlength=4 size=4 value=' . $FreightTaxLine->TaxRate * 100 . '>'; + echo '<input type="text" class=number name=FreightTaxRate' . $FreightTaxLine->TaxCalculationOrder . ' maxlength=4 size=4 value=' . $FreightTaxLine->TaxRate * 100 . '>'; } if ($FreightTaxLine->TaxOnTax ==1){ $TaxTotals[$FreightTaxLine->TaxAuthID] += ($FreightTaxLine->TaxRate * ($_SESSION['CreditItems']->FreightCost + $FreightTaxTotal)); Modified: trunk/DeliveryDetails.php =================================================================== --- trunk/DeliveryDetails.php 2011-07-16 02:55:44 UTC (rev 4631) +++ trunk/DeliveryDetails.php 2011-07-16 02:59:14 UTC (rev 4632) @@ -941,7 +941,7 @@ echo '<br /><table class=selection><tr> <td>'. _('Deliver To') .':</td> - <td><input type=text size=42 maxlength=40 name="DeliverTo" value="' . $_SESSION['Items'.$identifier]->DeliverTo . '"></td> + <td><input type="text" size=42 maxlength=40 name="DeliverTo" value="' . $_SESSION['Items'.$identifier]->DeliverTo . '"></td> </tr>'; echo '<tr> @@ -1011,28 +1011,28 @@ echo '<tr> <td>'. _('Delivery Address 4') . ':</td> - <td><input type=text size=42 maxlength=40 name="BrAdd4" value="' . $_SESSION['Items'.$identifier]->DelAdd4 . '"></td> + <td><input type="text" size=42 maxlength=40 name="BrAdd4" value="' . $_SESSION['Items'.$identifier]->DelAdd4 . '"></td> </tr>'; echo '<tr> <td>'. _('Delivery Address 5') . ':</td> - <td><input type=text size=42 maxlength=40 name="BrAdd5" value="' . $_SESSION['Items'.$identifier]->DelAdd5 . '"></td> + <td><input type="text" size=42 maxlength=40 name="BrAdd5" value="' . $_SESSION['Items'.$identifier]->DelAdd5 . '"></td> </tr>'; echo '<tr> <td>'. _('Delivery Address 6') . ':</td> - <td><input type=text size=42 maxlength=40 name="BrAdd6" value="' . $_SESSION['Items'.$identifier]->DelAdd6 . '"></td> + <td><input type="text" size=42 maxlength=40 name="BrAdd6" value="' . $_SESSION['Items'.$identifier]->DelAdd6 . '"></td> </tr>'; echo '<tr> <td>'. _('Contact Phone Number') .':</td> - <td><input type=text size=25 maxlength=25 name="PhoneNo" value="' . $_SESSION['Items'.$identifier]->PhoneNo . '"></td> + <td><input type="text" size=25 maxlength=25 name="PhoneNo" value="' . $_SESSION['Items'.$identifier]->PhoneNo . '"></td> </tr>'; -echo '<tr><td>' . _('Contact Email') . ':</td><td><input type=text size=40 maxlength=38 name="Email" value="' . $_SESSION['Items'.$identifier]->Email . '"></td></tr>'; +echo '<tr><td>' . _('Contact Email') . ':</td><td><input type="text" size=40 maxlength=38 name="Email" value="' . $_SESSION['Items'.$identifier]->Email . '"></td></tr>'; echo '<tr><td>'. _('Customer Reference') .':</td> - <td><input type=text size=25 maxlength=25 name="CustRef" value="' . $_SESSION['Items'.$identifier]->CustRef . '"></td> + <td><input type="text" size=25 maxlength=25 name="CustRef" value="' . $_SESSION['Items'.$identifier]->CustRef . '"></td> </tr>'; echo '<tr> @@ -1068,7 +1068,7 @@ } echo '<tr><td>'. _('Charge Freight Cost inc tax') .':</td>'; -echo '<td><input type=text class="number" size=10 maxlength=12 name="FreightCost" value="' . $_SESSION['Items'.$identifier]->FreightCost . '"></td>'; +echo '<td><input type="text" class="number" size=10 maxlength=12 name="FreightCost" value="' . $_SESSION['Items'.$identifier]->FreightCost . '"></td>'; if ($_SESSION['DoFreightCalc']==true){ echo '<td><input type=submit name="Update" value="' . _('Recalc Freight Cost') . '"></td></tr>'; Modified: trunk/EDIMessageFormat.php =================================================================== --- trunk/EDIMessageFormat.php 2011-07-16 02:55:44 UTC (rev 4631) +++ trunk/EDIMessageFormat.php 2011-07-16 02:59:14 UTC (rev 4632) @@ -234,7 +234,7 @@ echo '</td></tr>'; echo '<tr><td>Sequence Number:</td>'; -echo '<td><input tabindex=3 type=text name=SequenceNo size=3 maxlength=3 value='.$_POST['SequenceNo'].'>'; +echo '<td><input tabindex=3 type="text" name=SequenceNo size=3 maxlength=3 value='.$_POST['SequenceNo'].'>'; echo '</td></tr>'; echo '<tr><td>' . _('Line Text') . ':' .'</td>'; echo '<td>'; Modified: trunk/FixedAssetLocations.php =================================================================== --- trunk/FixedAssetLocations.php 2011-07-16 02:55:44 UTC (rev 4631) +++ trunk/FixedAssetLocations.php 2011-07-16 02:59:14 UTC (rev 4632) @@ -110,11 +110,11 @@ echo '<input type=hidden name=LocationID value="'.$LocationID.'">'; echo '<td>'.$LocationID.'</td>'; } else { - echo '<td><input type=text name=LocationID size=6 value="'.$LocationID.'"></td></tr>'; + echo '<td><input type="text" name=LocationID size=6 value="'.$LocationID.'"></td></tr>'; } echo '<tr><th style="text-align:left">'._('Location Description').'</th>'; -echo '<td><input type=text name=LocationDescription size=20 value="'.$LocationDescription.'"></td></tr>'; +echo '<td><input type="text" name=LocationDescription size=20 value="'.$LocationDescription.'"></td></tr>'; echo '<tr><th style="text-align:left">'._('Parent Location').'</th>'; echo '<td><select name=ParentLocationID>'; Modified: trunk/GoodsReceived.php =================================================================== --- trunk/GoodsReceived.php 2011-07-16 02:55:44 UTC (rev 4631) +++ trunk/GoodsReceived.php 2011-07-16 02:59:14 UTC (rev 4632) @@ -75,7 +75,7 @@ echo '<table class="selection"> <tr> <td>'. _('Date Goods/Service Received'). ':</td> - <td><input type=text class=date alt="'. $_SESSION['DefaultDateFormat'] .'" maxlength=10 size=10 onChange="return isDate(this, this.value, '."'". + <td><input type="text" class=date alt="'. $_SESSION['DefaultDateFormat'] .'" maxlength=10 size=10 onChange="return isDate(this, this.value, '."'". $_SESSION['DefaultDateFormat']."'".')" name="DefaultReceivedDate" value="' . $_POST['DefaultReceivedDate'] . '"></td> </tr> </table> @@ -161,7 +161,7 @@ echo '<input type=hidden name="RecvQty_' . $LnItm->LineNo . '" value="' . $LnItm->ReceiveQty . '"><a href="GoodsReceivedControlled.php?identifier=' . $identifier . '&LineNo=' . $LnItm->LineNo . '">' . number_format($LnItm->ReceiveQty,$LnItm->DecimalPlaces) . '</a></td>'; } else { - echo '<input type=text class=number name="RecvQty_' . $LnItm->LineNo . '" maxlength=10 size=10 value="' . $LnItm->ReceiveQty . '"></td>'; + echo '<input type="text" class=number name="RecvQty_' . $LnItm->LineNo . '" maxlength=10 size=10 value="' . $LnItm->ReceiveQty . '"></td>'; } if ($_SESSION['ShowValueOnGRN']==1) { Modified: trunk/OutstandingGRNs.php =================================================================== --- trunk/OutstandingGRNs.php 2011-07-16 02:55:44 UTC (rev 4631) +++ trunk/OutstandingGRNs.php 2011-07-16 02:59:14 UTC (rev 4632) @@ -155,9 +155,9 @@ echo '<input type="hidden" name="FormID" value="' . $_SESSION['FormID'] . '" />'; echo '<tr><td>' . _('From Supplier Code') . ':</td> - <td><input type=text name="FromCriteria" value="0"></td></tr>'; + <td><input type="text" name="FromCriteria" value="0"></td></tr>'; echo '<tr><td>' . _('To Supplier Code'). ':</td> - <td><input type=text name="ToCriteria" value="zzzzzzz"></td></tr>'; + <td><input type="text" name="ToCriteria" value="zzzzzzz"></td></tr>'; echo '</table><br /><div class="centre"><input type=Submit Name="PrintPDF" value="' . _('Print PDF') . '"></div>'; Modified: trunk/PDFChequeListing.php =================================================================== --- trunk/PDFChequeListing.php 2011-07-16 02:55:44 UTC (rev 4631) +++ trunk/PDFChequeListing.php 2011-07-16 02:59:14 UTC (rev 4632) @@ -39,7 +39,7 @@ <td><input type="text" name="FromDate" maxlength="10" size="10" class=date alt="' . $_SESSION['DefaultDateFormat'] . '" value="' . Date($_SESSION['DefaultDateFormat']) . '"></td> </tr>'; echo '<tr><td>' . _('Enter the date to which cheques are to be listed') . ':</td> - <td><input type=text name="ToDate" maxlength="10" size="10" class=date alt="' . $_SESSION['DefaultDateFormat'] . '" value="' . Date($_SESSION['DefaultDateFormat']) . '"></td> + <td><input type="text" name="ToDate" maxlength="10" size="10" class=date alt="' . $_SESSION['DefaultDateFormat'] . '" value="' . Date($_SESSION['DefaultDateFormat']) . '"></td> </tr>'; echo '<tr><td>' . _('Bank Account') . '</td><td>'; Modified: trunk/PDFCustTransListing.php =================================================================== --- trunk/PDFCustTransListing.php 2011-07-16 02:55:44 UTC (rev 4631) +++ trunk/PDFCustTransListing.php 2011-07-16 02:59:14 UTC (rev 4632) @@ -29,7 +29,7 @@ echo '<table class=selection> <tr> <td>' . _('Enter the date for which the transactions are to be listed') . ':</td> - <td><input type=text name="Date" maxlength="10" size="10" class=date alt="' . $_SESSION['DefaultDateFormat'] . '" value="' . Date($_SESSION['DefaultDateFormat']) . '"></td> + <td><input type="text" name="Date" maxlength="10" size="10" class=date alt="' . $_SESSION['DefaultDateFormat'] . '" value="' . Date($_SESSION['DefaultDateFormat']) . '"></td> </tr>'; echo '<tr><td>' . _('Transaction type') . '</td><td>'; Modified: trunk/PDFDIFOT.php =================================================================== --- trunk/PDFDIFOT.php 2011-07-16 02:55:44 UTC (rev 4631) +++ trunk/PDFDIFOT.php 2011-07-16 02:59:14 UTC (rev 4632) @@ -29,14 +29,14 @@ echo "<form method='post' action='" . $_SERVER['PHP_SELF'] . '?' . sid . "'>"; echo '<input type="hidden" name="FormID" value="' . $_SESSION['FormID'] . '" />'; - echo '<table class=selection><tr><td>' . _('Enter the date from which variances between orders and deliveries 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')-1,0,Date('y'))) . "'></td></tr>"; - echo '<tr><td>' . _('Enter the date to which variances between orders and deliveries 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 '<table class=selection><tr><td>' . _('Enter the date from which variances between orders and deliveries 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')-1,0,Date('y'))) . "'></td></tr>"; + echo '<tr><td>' . _('Enter the date to which variances between orders and deliveries 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>"; if (!isset($_POST['DaysAcceptable'])){ $_POST['DaysAcceptable'] = 1; } - echo '<tr><td>' . _('Enter the number of days considered acceptable between delivery requested date and invoice date(ie the date dispatched)') . ":</td><td><input type=text class=number name='DaysAcceptable' maxlength=2 size=2 VALUE=" . $_POST['DaysAcceptable'] . "></td></tr>"; + echo '<tr><td>' . _('Enter the number of days considered acceptable between delivery requested date and invoice date(ie the date dispatched)') . ":</td><td><input type="text" class=number name='DaysAcceptable' maxlength=2 size=2 VALUE=" . $_POST['DaysAcceptable'] . "></td></tr>"; echo '<tr><td>' . _('Inventory Category') . '</td><td>'; $sql = "SELECT categorydescription, categoryid FROM stockcategory WHERE stocktype<>'D' AND stocktype<>'L'"; Modified: trunk/PDFDeliveryDifferences.php =================================================================== --- trunk/PDFDeliveryDifferences.php 2011-07-16 02:55:44 UTC (rev 4631) +++ trunk/PDFDeliveryDifferences.php 2011-07-16 02:59:14 UTC (rev 4632) @@ -29,7 +29,7 @@ echo '<table class=selection> <tr> <td>' . _('Enter the date from which variances between orders and deliveries 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')-1,0,Date('y'))) . '"></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')-1,0,Date('y'))) . '"></td> </tr>'; echo '<tr> <td>' . _('Enter the date to which variances between orders and deliveries 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> Modified: trunk/PDFLowGP.php =================================================================== --- trunk/PDFLowGP.php 2011-07-16 02:55:44 UTC (rev 4631) +++ trunk/PDFLowGP.php 2011-07-16 02:59:14 UTC (rev 4632) @@ -130,15 +130,15 @@ echo '<input type="hidden" name="FormID" value="' . $_SESSION['FormID'] . '" />'; echo '<tr><td>' . _('Sales Made From') . ' (' . _('in the format') . ' ' . $_SESSION['DefaultDateFormat'] . '):</td> - <td><input type=text class="date" alt="' . $_SESSION['DefaultDateFormat'] . '" name="FromDate" size=10 maxlength="10" value="' . $_POST['FromDate'] . '"></td> + <td><input type="text" class="date" alt="' . $_SESSION['DefaultDateFormat'] . '" name="FromDate" size=10 maxlength="10" value="' . $_POST['FromDate'] . '"></td> </tr>'; echo '<tr><td>' . _('Sales Made To') . ' (' . _('in the format') . ' ' . $_SESSION['DefaultDateFormat'] . '):</td> - <td><input type=text class="date" alt="' . $_SESSION['DefaultDateFormat'] . '" name="ToDate" size="10" maxlength="10" value="' . $_POST['ToDate'] . '"></td> + <td><input type="text" class="date" alt="' . $_SESSION['DefaultDateFormat'] . '" name="ToDate" size="10" maxlength="10" value="' . $_POST['ToDate'] . '"></td> </tr>'; echo '<tr><td>' . _('Show sales with GP') . '%' . _('below') . ':</td> - <td><input type=text class="number" name="GPMin" maxlength="3" size="3" value="' . $_POST['GPMin'] . '"></td> + <td><input type="text" class="number" name="GPMin" maxlength="3" size="3" value="' . $_POST['GPMin'] . '"></td> </tr>'; echo '</table> Modified: trunk/PDFOrderStatus.php =================================================================== --- trunk/PDFOrderStatus.php 2011-07-16 02:55:44 UTC (rev 4631) +++ trunk/PDFOrderStatus.php 2011-07-16 02:59:14 UTC (rev 4632) @@ -34,7 +34,7 @@ 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> + <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>'; echo '<input type="text" class="date" alt="' . $_SESSION['DefaultDateFormat'] . '" name="ToDate" maxlength=10 size=10 value="' . Date($_SESSION['DefaultDateFormat']) . '"></td></tr>'; Modified: trunk/PDFOrdersInvoiced.php =================================================================== --- trunk/PDFOrdersInvoiced.php 2011-07-16 02:55:44 UTC (rev 4631) +++ trunk/PDFOrdersInvoiced.php 2011-07-16 02:59:14 UTC (rev 4632) @@ -37,7 +37,7 @@ 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 '<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>"; + <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>'; $sql = "SELECT categorydescription, categoryid FROM stockcategory WHERE stocktype<>'D' AND stocktype<>'L'"; Modified: trunk/PDFPeriodStockTransListing.php =================================================================== --- trunk/PDFPeriodStockTransListing.php 2011-07-16 02:55:44 UTC (rev 4631) +++ trunk/PDFPeriodStockTransListing.php 2011-07-16 02:59:14 UTC (rev 4632) @@ -33,7 +33,7 @@ </tr>'; echo '<tr> <td>' . _('Enter the date to which the transactions are to be listed') . ':</td> - <td><input type=text name="ToDate" maxlength="10" size="10" class="date" alt="' . $_SESSION['DefaultDateFormat'] . '" value="' . Date($_SESSION['DefaultDateFormat']) . '"></td> + <td><input type="text" name="ToDate" maxlength="10" size="10" class="date" alt="' . $_SESSION['DefaultDateFormat'] . '" value="' . Date($_SESSION['DefaultDateFormat']) . '"></td> </tr>'; echo '<tr><td>' . _('Transaction type') . '</td><td>'; Modified: trunk/PDFPickingList.php =================================================================== --- trunk/PDFPickingList.php 2011-07-16 02:55:44 UTC (rev 4631) +++ trunk/PDFPickingList.php 2011-07-16 02:59:14 UTC (rev 4632) @@ -30,7 +30,7 @@ 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 '<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">'; while ($myrow=DB_fetch_array($result)) { Modified: trunk/PDFRemittanceAdvice.php =================================================================== --- trunk/PDFRemittanceAdvice.php 2011-07-16 02:55:44 UTC (rev 4631) +++ trunk/PDFRemittanceAdvice.php 2011-07-16 02:59:14 UTC (rev 4632) @@ -136,9 +136,9 @@ $DefaultToCriteria = $_POST['ToCriteria']; } echo '<tr><td>' . _('From Supplier Code') . ':</font></td> - <td><input Type=text maxlength=6 size=7 name=FromCriteria value="' . $DefaultFromCriteria . '"></td></tr>'; + <td><input type="text" maxlength=6 size=7 name=FromCriteria value="' . $DefaultFromCriteria . '"></td></tr>'; echo '<tr><td>' . _('To Supplier Code') . ':</td> - <td><input Type=text maxlength=6 size=7 name=ToCriteria value="' . $DefaultToCriteria . '"></td></tr>'; + <td><input type="text" maxlength=6 size=7 name=ToCriteria value="' . $DefaultToCriteria . '"></td></tr>'; if (!isset($_POST['PaymentDate'])){ $DefaultDate = Date($_SESSION['DefaultDateFormat'], Mktime(0,0,0,Date('m')+1,0 ,Date('y'))); @@ -147,7 +147,7 @@ } echo '<tr><td>' . _('Date Of Payment') . ':</td> - <td><input type=text class="date" alt="'.$_SESSION['DefaultDateFormat'].'" name="PaymentDate" maxlength=11 size=12 VALUE=' . $DefaultDate . '></td></tr>'; + <td><input type="text" class="date" alt="'.$_SESSION['DefaultDateFormat'].'" name="PaymentDate" maxlength=11 size=12 VALUE=' . $DefaultDate . '></td></tr>'; echo '</table><div class="centre"><input type=Submit Name="PrintPDF" Value="' . _('Print PDF') . '"></div>'; Modified: trunk/PDFStockLocTransfer.php =================================================================== --- trunk/PDFStockLocTransfer.php 2011-07-16 02:55:44 UTC (rev 4631) +++ trunk/PDFStockLocTransfer.php 2011-07-16 02:59:14 UTC (rev 4632) @@ -23,7 +23,7 @@ echo '<form method="POST" action="' . $_SERVER['PHP_SELF'] . '?' . SID . '">'; echo '<input type="hidden" name="FormID" value="' . $_SESSION['FormID'] . '" />'; echo '<table><tr><td>'._('Transfer docket to reprint').'</td>'; - echo '<td><input type=text class=number size=10 name="TransferNo"></td></tr></table>'; + echo '<td><input type="text" class=number size=10 name="TransferNo"></td></tr></table>'; echo '<div class="centre"><input type=submit Name="Print" Value="' . _('Print') .'">'; include ('includes/footer.inc'); exit; Modified: trunk/PDFStockTransfer.php =================================================================== --- trunk/PDFStockTransfer.php 2011-07-16 02:55:44 UTC (rev 4631) +++ trunk/PDFStockTransfer.php 2011-07-16 02:59:14 UTC (rev 4632) @@ -24,7 +24,7 @@ echo '<input type="hidden" name="FormID" value="' . $_SESSION['FormID'] . '" />'; echo '<table class="selection"><tr>'; echo '<td>'._('Print Stock Transfer Note').' : '.'</td>'; - echo '<td><input type=text class="number" name="TransferNo" maxlength=10 size=11 /></td></tr>'; + echo '<td><input type="text" class="number" name="TransferNo" maxlength=10 size=11 /></td></tr>'; echo '</table>'; echo '<br /><div class="centre"><input type="submit" name="Process" value="' . _('Print Transfer Note') . '"></div></form>'; include('includes/footer.inc'); Modified: trunk/PDFSuppTransListing.php =================================================================== --- trunk/PDFSuppTransListing.php 2011-07-16 02:55:44 UTC (rev 4631) +++ trunk/PDFSuppTransListing.php 2011-07-16 02:59:14 UTC (rev 4632) @@ -29,7 +29,7 @@ echo '<table class=selection> <tr> <td>' . _('Enter the date for which the transactions are to be listed') . ":</td> - <td><input type=text name='Date' maxlength=10 size=10 class=date alt='" . $_SESSION['DefaultDateFormat'] . "' VALUE='" . Date($_SESSION['DefaultDateFormat']) . "'></td> + <td><input type="text" name='Date' maxlength=10 size=10 class=date alt='" . $_SESSION['DefaultDateFormat'] . "' VALUE='" . Date($_SESSION['DefaultDateFormat']) . "'></td> </tr>"; echo '<tr><td>' . _('Transaction type') . '</td><td>'; Modified: trunk/PO_Header.php =================================================================== --- trunk/PO_Header.php 2011-07-16 02:55:44 UTC (rev 4631) +++ trunk/PO_Header.php 2011-07-16 02:59:14 UTC (rev 4632) @@ -816,7 +816,7 @@ echo '</select></td></tr>'; echo '<tr><td>' . _('Status Comment') . ':</td> - <td><input type=text name="StatusComments" size=50></td></tr> + <td><input type="text" name="StatusComments" size=50></td></tr> <tr><td colspan=2><b>' . $_SESSION['PO'.$identifier]->StatusComments .'</b></td></tr>'; echo '<input type="hidden" name="StatusCommentsComplete" value="' . htmlentities($_SESSION['PO'.$identifier]->StatusComments, ENT_QUOTES,'UTF-8') .'" />'; @@ -1063,7 +1063,7 @@ if ($_SESSION['PO'.$identifier]->CurrCode != $_SESSION['CompanyRecord']['currencydefault']) { echo '<tr><td>'. _('Exchange Rate').':'.'</td> - <td><input type=text name="ExRate" value='.$_POST['ExRate'].' class="number" size=11></td> + <td><input type="text" name="ExRate" value='.$_POST['ExRate'].' class="number" size=11></td> </tr>'; } else { echo '<input type=hidden name="ExRate" value="1">'; Modified: trunk/PO_SelectPurchOrder.php =================================================================== --- trunk/PO_SelectPurchOrder.php 2011-07-16 02:55:44 UTC (rev 4631) +++ trunk/PO_SelectPurchOrder.php 2011-07-16 02:59:14 UTC (rev 4632) @@ -104,7 +104,7 @@ if (isset($SelectedStockItem)) { echo _('For the part') . ':<b>' . $SelectedStockItem . '</b> ' . _('and') . ' <input type=hidden name="SelectedStockItem" value="' . $SelectedStockItem . '">'; } - echo _('Order Number') . ': <input type=text name="OrderNumber" maxlength=8 size=9> ' . _('Into Stock Location') . ':<select name="StockLocation"> '; + echo _('Order Number') . ': <input type="text" name="OrderNumber" maxlength=8 size=9> ' . _('Into Stock Location') . ':<select name="StockLocation"> '; $sql = "SELECT loccode, locationname FROM locations"; $resultStkLocs = DB_query($sql, $db); while ($myrow = DB_fetch_array($resultStkLocs)) { Modified: trunk/PcAssignCashToTab.php =================================================================== --- trunk/PcAssignCashToTab.php 2011-07-16 02:55:44 UTC (rev 4631) +++ trunk/PcAssignCashToTab.php 2011-07-16 02:59:14 UTC (rev 4632) @@ -329,7 +329,7 @@ echo '<tr><td>' . _('Cash Assignation Date') . ':</td>'; - echo '<td><input type=text class="date" alt="'.$_SESSION['DefaultDateFormat'].'" name="Date" size=10 maxlength=10 value=' . $_POST['Date'] . '></td></tr>'; + echo '<td><input type="text" class="date" alt="'.$_SESSION['DefaultDateFormat'].'" name="Date" size=10 maxlength=10 value=' . $_POST['Date'] . '></td></tr>'; if (!isset($_POST['Amount'])) { Modified: trunk/Prices.php =================================================================== --- trunk/Prices.php 2011-07-16 02:55:44 UTC (rev 4631) +++ trunk/Prices.php 2011-07-16 02:59:14 UTC (rev 4632) @@ -211,7 +211,7 @@ echo '<table class=selection>'; echo '<tr><th colspan=7><form method="post" action="' . $_SERVER['PHP_SELF'] . '">'; echo '<input type="hidden" name="FormID" value="' . $_SESSION['FormID'] . '" />'; - echo _('Pricing for part') . ':<input type=text name="Item" maxsizee=22 value="' . $Item . '" maxlength=20><input type=submit name="NewPart" value="' . _('Review Prices') . '">'; + echo _('Pricing for part') . ':<input type="text" name="Item" maxsizee=22 value="' . $Item . '" maxlength=20><input type=submit name="NewPart" value="' . _('Review Prices') . '">'; echo '</th></tr></form>'; echo '<tr><th>' . _('Currency') . '</th> Modified: trunk/PricesBasedOnMarkUp.php =================================================================== --- trunk/PricesBasedOnMarkUp.php 2011-07-16 02:55:44 UTC (rev 4631) +++ trunk/PricesBasedOnMarkUp.php 2011-07-16 02:59:14 UTC (rev 4632) @@ -148,20 +148,20 @@ } echo '<tr><td>' . _('Rounding Factor') . ':</td> - <td><input type=text class=number name="RoundingFactor" size="6" maxlength="6" value=' . $_POST['RoundingFactor'] . '></td></tr>'; + <td><input type="text" class=number name="RoundingFactor" size="6" maxlength="6" value=' . $_POST['RoundingFactor'] . '></td></tr>'; echo '<tr><td>' . _('New Price To Be Effective From') . ':</td> - <td><input type=text class=date alt="' . $_SESSION['DefaultDateFormat'] . '" name="PriceStartDate" size="10" maxlength="10" value="' . $_POST['PriceStartDate'] . '"></td></tr>'; + <td><input type="text" class=date alt="' . $_SESSION['DefaultDateFormat'] . '" name="PriceStartDate" size="10" maxlength="10" value="' . $_POST['PriceStartDate'] . '"></td></tr>'; echo '<tr><td>' . _('New Price To Be Effective To (Blank = No End Date)') . ':</td> - <td><input type=text class=date alt="' . $_SESSION['DefaultDateFormat'] . '" name="PriceEndDate" size="10" maxlength="10" value="' . $_POST['PriceEndDate'] . '"></td></tr>'; + <td><input type="text" class=date alt="' . $_SESSION['DefaultDateFormat'] . '" name="PriceEndDate" size="10" maxlength="10" value="' . $_POST['PriceEndDate'] . '"></td></tr>'; if (!isset($_POST['IncreasePercent'])){ $_POST['IncreasePercent']=0; } echo '<tr><td>' . _('Percentage Increase (positive) or decrease (negative)') . '</td> - <td><input type=text name="IncreasePercent" class=number size=4 maxlength=4 VALUE="' . $_POST['IncreasePercent'] . '"></td></tr></table>'; + <td><input type="text" name="IncreasePercent" class=number size=4 maxlength=4 VALUE="' . $_POST['IncreasePercent'] . '"></td></tr></table>'; echo '<p><div class="centre"><input type=submit name="UpdatePrices" VALUE="' . _('Update Prices') . '\' onclick="return confirm(\'' . _('Are you sure you wish to update or add all the prices according to the criteria selected?') . '\');"></div>'; Modified: trunk/PurchData.php =================================================================== --- trunk/PurchData.php 2011-07-16 02:55:44 UTC (rev 4631) +++ trunk/PurchData.php 2011-07-16 02:59:14 UTC (rev 4632) @@ -471,18 +471,18 @@ $_POST['ConversionFactor'] = 1; } echo '<tr><td>' . _('Conversion Factor (to our UOM)') . ':</td> - <td><input type=text class=number name="ConversionFactor" maxlength=12 size=12 value=' . $_POST['ConversionFactor'] . '></td></tr>'; + <td><input type="text" class=number name="ConversionFactor" maxlength=12 size=12 value=' . $_POST['ConversionFactor'] . '></td></tr>'; echo '<tr><td>' . _('Supplier Stock Code') . ':</td> - <td><input type=text name="SupplierCode" maxlength=15 size=15 value="' . $_POST['SupplierCode'] . '"></td></tr>'; + <td><input type="text" name="SupplierCode" maxlength=15 size=15 value="' . $_POST['SupplierCode'] . '"></td></tr>'; echo '<tr><td>' . _('MinOrderQty') . ':</td> - <td><input type=text class=number name="MinOrderQty" maxlength=15 size=15 value="' . $_POST['MinOrderQty'] . '"></td></tr>'; + <td><input type="text" class=number name="MinOrderQty" maxlength=15 size=15 value="' . $_POST['MinOrderQty'] . '"></td></tr>'; echo '<tr><td>' . _('Supplier Stock Description') . ':</td> - <td><input type=text name="SupplierDescription" maxlength=50 size=51 value="' . $_POST['SupplierDescription'] . '"></td></tr>'; + <td><input type="text" name="SupplierDescription" maxlength=50 size=51 value="' . $_POST['SupplierDescription'] . '"></td></tr>'; if (!isset($_POST['LeadTime']) OR $_POST['LeadTime'] == "") { $_POST['LeadTime'] = 1; } echo '<tr><td>' . _('Lead Time') . ' (' . _('in days from date of order') . '):</td> - <td><input type=text class=number name="LeadTime" maxlength=4 size=5 value=' . $_POST['LeadTime'] . '></td></tr>'; + <td><input type="text" class=number name="LeadTime" maxlength=4 size=5 value=' . $_POST['LeadTime'] . '></td></tr>'; echo '<tr><td>' . _('Preferred Supplier') . ':</td> <td><select name="Preferred">'; if ($_POST['Preferred'] == 1) { Modified: trunk/ReverseGRN.php =================================================================== --- trunk/ReverseGRN.php 2011-07-16 02:55:44 UTC (rev 4631) +++ trunk/ReverseGRN.php 2011-07-16 02:59:14 UTC (rev 4632) @@ -344,7 +344,7 @@ echo '<table class=selection><tr>'; echo '<input type=hidden name="SupplierID" VALUE="' . $_POST['SupplierID'] . '">'; echo '<input type=hidden name="SuppName" VALUE="' . $_POST['SuppName'] . '">'; - echo '<td>'._('Show all goods received after') . ': </td><td><input type=text class=date alt="'. + echo '<td>'._('Show all goods received after') . ': </td><td><input type="text" class=date alt="'. $_SESSION['DefaultDateFormat'].'" name="RecdAfterDate" Value="' . $_POST['RecdAfterDate'] . '" MAXLENGTH =10 size=10></td></tr>';; echo '</table>'; Modified: trunk/SMTPServer.php =================================================================== --- trunk/SMTPServer.php 2011-07-16 02:55:44 UTC (rev 4631) +++ trunk/SMTPServer.php 2011-07-16 02:59:14 UTC (rev 4632) @@ -40,11 +40,11 @@ echo '<input type="hidden" name="FormID" value="' . $_SESSION['FormID'] . '" />'; echo '<table class=selection>'; echo '<tr><td>'._('Server Host Name').'</td> - <td><input type=text name=host value='.$myrow['host'].'></td></tr>'; + <td><input type="text" name=host value='.$myrow['host'].'></td></tr>'; echo '<tr><td>'._('SMTP port').'</td> - <td><input type=text name=port size=4 class=number value='.$myrow['port'].'></td></tr>'; + <td><input type="text" name=port size=4 class=number value='.$myrow['port'].'></td></tr>'; echo '<tr><td>'._('Helo Command').'</td> - <td><input type=text name=heloaddress value='.$myrow['heloaddress'].'></td></tr>'; + <td><input type="text" name=heloaddress value='.$myrow['heloaddress'].'></td></tr>'; echo '<tr><td>'._('Authorisation Required').'</td><td>'; echo '<select name=auth>'; if ($myrow['auth']==1) { @@ -56,11 +56,11 @@ } echo '</select></td></tr>'; echo '<tr><td>'._('User Name').'</td> - <td><input type=text name=username value='.$myrow['username'].'></td></tr>'; + <td><input type="text" name=username value='.$myrow['username'].'></td></tr>'; echo '<tr><td>'._('Password').'</td> <td><input type=password name=password value='.$myrow['password'].'></td></tr>'; echo '<tr><td>'._('Timeout (seconds)').'</td> - <td><input type=text size=5 name=timeout class=number value='.$myrow['timeout'].'></td></tr>'; + <td><input type="text" size=5 name=timeout class=number value='.$myrow['timeout'].'></td></tr>'; echo '<tr><td colspan=2><div class=centre><input type="submit" name="submit" value="' . _('Update') . '"></div></td></tr>'; echo '</table></form>'; Modified: trunk/SelectCreditItems.php =================================================================== --- trunk/SelectCreditItems.php 2011-07-16 02:55:44 UTC (rev 4631) +++ trunk/SelectCreditItems.php 2011-07-16 02:59:14 UTC (rev 4632) @@ -686,16 +686,16 @@ <td>' . $LineItem->ItemDescription . '</td>'; if ($LineItem->Controlled==0){ - echo '<td><input type=TEXT class="number" name="Quantity_' . $LineItem->LineNumber . '" maxlength=6 size=6 VALUE=' . $LineItem->Quantity . '></td>'; + echo '<td><input type="text" class="number" name="Quantity_' . $LineItem->LineNumber . '" maxlength=6 size=6 VALUE=' . $LineItem->Quantity . '></td>'; } else { echo '<td class=number><a href="' . $rootpath . '/CreditItemsControlled.php?' . SID . '&LineNo=' . $LineItem->LineNumber . '">' . $LineItem->Quantity . '</a> <input type=hidden name="Quantity_' . $LineItem->LineNumber . '" value=' . $LineItem->Quantity . '></td>'; } echo '<td>' . $LineItem->Units . '</td> - <td><input type=TEXT class="number" name="Price_' . $LineItem->LineNumber . '" size=10 maxlength=12 VALUE=' . $LineItem->Price . '></td> + <td><input type="text" class="number" name="Price_' . $LineItem->LineNumber . '" size=10 maxlength=12 VALUE=' . $LineItem->Price . '></td> <td><input type="CheckBox" name="Gross" VALUE=False></td> - <td><input type=TEXT class="number" name="Discount_' . $LineItem->LineNumber . '" size=3 maxlength=3 VALUE=' . ($LineItem->DiscountPercent * 100) . '>%</td> + <td><input type="text" class="number" name="Discount_' . $LineItem->LineNumber . '" size=3 maxlength=3 VALUE=' . ($LineItem->DiscountPercent * 100) . '>%</td> <td class=number>' . $DisplayLineTotal . '</td>'; @@ -722,7 +722,7 @@ if ($i>0){ echo '<br />'; } - echo '<input type=text class="number" name="' . $LineItem->LineNumber . $Tax->TaxCalculationOrder . '_TaxRate" maxlength=4 size=4 value="' . $Tax->TaxRate*100 . '">'; + echo '<input type="text" class="number" name="' . $LineItem->LineNumber . $Tax->TaxCalculationOrder . '_TaxRate" maxlength=4 size=4 value="' . $Tax->TaxRate*100 . '">'; $i++; if ($Tax->TaxOnTax ==1){ $TaxTotals[$Tax->TaxAuthID] += ($Tax->TaxRate * ($LineTotal + $TaxLineTotal)); @@ -763,7 +763,7 @@ echo '<td colspan=2 class=number>'. _('Credit Freight').'</td> - <td><input type=TEXT class="number" size=6 maxlength=6 name=ChargeFreightCost VALUE=' . $_SESSION['CreditItems']->FreightCost . '></td>'; + <td><input type="text" class="number" size=6 maxlength=6 name=ChargeFreightCost VALUE=' . $_SESSION['CreditItems']->FreightCost . '></td>'; $FreightTaxTotal =0; //initialise tax total @@ -786,7 +786,7 @@ echo '<br />'; } - echo '<input type=TEXT class="number" name=FreightTaxRate' . $FreightTaxLine->TaxCalculationOrder . ' maxlength=4 size=4 VALUE=' . $FreightTaxLine->TaxRate * 100 . '>'; + echo '<input type="text" class="number" name=FreightTaxRate' . $FreightTaxLine->TaxCalculationOrder . ' maxlength=4 size=4 VALUE=' . $FreightTaxLine->TaxRate * 100 . '>'; if ($FreightTaxLine->TaxOnTax ==1){ $TaxTotals[$FreightTaxLine->TaxAuthID] += ($FreightTaxLine->TaxRate * ($_SESSION['CreditItems']->FreightCost + $FreightTaxTotal)); Modified: trunk/SelectOrderItems.php =================================================================== --- trunk/SelectOrderItems.php 2011-07-16 02:55:44 UTC (rev 4631) +++ trunk/SelectOrderItems.php 2011-07-16 02:59:14 UTC (rev 4632) @@ -1395,7 +1395,7 @@ echo $RowStarter; if($_SESSION['Items'.$identifier]->DefaultPOLine ==1){ //show the input field only if required - echo '<td><input tabindex=1 type=text name="POLine_' . $OrderLine->LineNumber . '" size=20 maxlength=20 value=' . $OrderLine->POLine . '></td>'; + echo '<td><input tabindex=1 type="text" name="POLine_' . $OrderLine->LineNumber . '" size=20 maxlength=20 value=' . $OrderLine->POLine . '></td>'; } else { echo '<input type="hidden" name="POLine_' . $OrderLine->LineNumber . '" value="">'; } @@ -1413,9 +1413,9 @@ if (in_array(2,$_SESSION['AllowedPageSecurityTokens'])){ /*OK to display with discount if it is an internal user with appropriate permissions */ - echo '<td><input class="number" type=text name="Price_' . $OrderLine->LineNumber . '" size=16 maxlength=16 value=' . $OrderLine->Price . '></td> - <td><input class="number" type=text name="Discount_' . $OrderLine->LineNumber . '" size=5 maxlength=4 value=' . ($OrderLine->DiscountPercent * 100) . '></td> - <td><input class="number" type=text name="GPPercent_' . $OrderLine->LineNumber . '" size=3 maxlength=40 value=' . $OrderLine->GPPercent . '></td>'; + echo '<td><input class="number" type="text" name="Price_' . $OrderLine->LineNumber . '" size=16 maxlength=16 value=' . $OrderLine->Price . '></td> + <td><input class="number" type="text" name="Discount_' . $OrderLine->LineNumber . '" size=5 maxlength=4 value=' . ($OrderLine->DiscountPercent * 100) . '></td> + <td><input class="number" type="text" name="GPPercent_' . $OrderLine->LineNumber . '" size=3 maxlength=40 value=' . $OrderLine->GPPercent . '></td>'; } else { echo '<td class=number>' . $OrderLine->Price . '</td><td></td>'; echo '<input type=hidden name="Price_' . $OrderLine->LineNumber . '" value=' . $OrderLine->Price . '>'; @@ -1432,7 +1432,7 @@ $_SESSION['Items'.$identifier]->LineItems[$OrderLine->LineNumber]->ItemDue= $LineDueDate; } - echo '<td><input type=text class="date" alt="'.$_SESSION['DefaultDateFormat'].'" name="ItemDue_' . $OrderLine->LineNumber . '" size=10 maxlength=10 value=' . $LineDueDate . '></td>'; + echo '<td><input type="text" class="date" alt="'.$_SESSION['DefaultDateFormat'].'" name="ItemDue_' . $OrderLine->LineNumber . '" size=10 maxlength=10 value=' . $LineDueDate . '></td>'; echo '<td><a href="' . $_SERVER['PHP_SELF'] . '?identifier=' . $identifier . '&Delete=' . $OrderLine->LineNumber . '" onclick="return confirm(\'' . _('Are You Sure?') . '\');">' . $RemTxt . '</a></td></tr>'; Modified: trunk/SelectWorkOrder.php =================================================================== --- trunk/SelectWorkOrder.php 2011-07-16 02:55:44 UTC (rev 4631) +++ trunk/SelectWorkOrder.php 2011-07-16 02:59:14 UTC (rev 4632) @@ -106,7 +106,7 @@ if (isset($_REQUEST['SelectedStockItem'])) { echo _('For the item') . ': ' . $_REQUEST['SelectedStockItem'] . ' ' . _('and') . " <input type=hidden name='SelectedStockItem' value='" . $_REQUEST['SelectedStockItem'] . "'>"; } - echo _('Work Order number') . ": <input type=text name='WO' MAXLENGTH =8 size=9>  " . _('Processing at') . ":<select name='StockLocation'> "; + echo _('Work Order number') . ": <input type="text" name='WO' MAXLENGTH =8 size=9>  " . _('Processing at') . ":<select name='StockLocation'> "; $sql = 'SELECT loccode, locationname FROM locations'; Modified: trunk/Shipt_Select.php =================================================================== --- trunk/Shipt_Select.php 2011-07-16 02:55:44 UTC (rev 4631) +++ trunk/Shipt_Select.php 2011-07-16 02:59:14 UTC (rev 4632) @@ -103,7 +103,7 @@ if (!isset($ShiptRef) or $ShiptRef==""){ echo '<table class=selection><tr><td>'; - echo _('Shipment Number'). ': <input type=text name="ShiptRef" MAXLENGTH =10 size=10> '. + echo _('Shipment Number'). ': <input type="text" name="ShiptRef" MAXLENGTH =10 size=10> '. _('Into Stock Location').' :<select name="StockLocation"> '; $sql = "SELECT loccode, locationname FROM locations"; $resultStkLocs = DB_query($sql,$db); Modified: trunk/StockAdjustments.php =================================================================== --- trunk/StockAdjustments.php 2011-07-16 02:55:44 UTC (rev 4631) +++ trunk/StockAdjustments.php 2011-07-16 02:59:14 UTC (rev 4632) @@ -334,16 +334,16 @@ } echo '<tr><td>'. _('Stock Code'). ':</td><td>'; if (isset($StockID)) { - echo '<input type=text name="StockID" size=21 value="' . $StockID . '" maxlength=20></td></tr>'; + echo '<input type="text" name="StockID" size=21 value="' . $StockID . '" maxlength=20></td></tr>'; } else { - echo '<input type=text name="StockID" size=21 value="" maxlength=20></td></tr>'; + echo '<input type="text" name="StockID" size=21 value="" maxlength=20></td></tr>'; } -echo '<tr><td>'. _('Partial Description'). ':</td><td><input type=text name="StockText" size=21 value="' . +echo '<tr><td>'. _('Partial Description'). ':</td><td><input type="text" name="StockText" size=21 value="' . $_GET['Description'] .'"> '._('Partial Stock Code'). ':</td><td>'; if (isset($StockID)) { - echo '<input type=text name="StockCode" size=21 value="' . $StockID .'" maxlength=20>'; + echo '<input type="text" name="StockCode" size=21 value="' . $StockID .'" maxlength=20>'; } else { - echo '<input type=text name="StockCode" size=21 value="" maxlength=20>'; + echo '<input type="text" name="StockCode" size=21 value="" maxlength=20>'; } echo '</td><td><input type=submit name="CheckCode" VALUE="'._('Check Part').'"></td></tr>'; if (isset($_SESSION['Adjustment']) and mb_strlen($_SESSION['Adjustment']->ItemDescription)>1){ @@ -377,7 +377,7 @@ } echo '<tr><td>'. _('Comments On Why').':</td> - <td><input type=text name="Narrative" size=32 maxlength=30 value="' . $_SESSION['Adjustment']->Narrative . '"></td></tr>'; + <td><input type="text" name="Narrative" size=32 maxlength=30 value="' . $_SESSION['Adjustment']->Narrative . '"></td></tr>'; echo '<tr><td>'._('Adjustment Quantity').':</td>'; @@ -391,7 +391,7 @@ [<a href="'.$rootpath.'/StockAdjustmentsControlled.php?AdjType=REMOVE&' . SID . '">'._('Remove').'</a>] [<a href="'.$rootpath.'/StockAdjustmentsControlled.php?AdjType=ADD&' . SID . '">'._('Add').'</a>]'; } else { - echo '<input type=TEXT class="number" name="Quantity" size=12 maxlength=12 Value="' . $Quantity . '">'; + echo '<input type="text" class="number" name="Quantity" size=12 maxlength=12 Value="' . $Quantity . '">'; } echo '</td></tr>'; //Select the tag Modified: trunk/StockCostUpdate.php =================================================================== --- trunk/StockCostUpdate.php 2011-07-16 02:55:44 UTC (rev 4631) +++ trunk/StockCostUpdate.php 2011-07-16 02:59:14 UTC (rev 4632) @@ -152,8 +152,8 @@ if ($myrow['mbflag']=='M'){ echo '<input type=hidden name="MaterialCost" VALUE=' . $myrow['materialcost'] . '>'; echo '<tr><td>' . _('Standard Material Cost Per Unit') .':</td><td class=number>' . number_format($myrow['materialcost'],4) . '</td></tr>'; - echo '<tr><td>' . _('Standard Labour Cost Per Unit') . ':</td><td class=number><input type=text class="number" name="LabourCost" value=' . $myrow['labourcost'] . '></td></tr>'; - echo '<tr><td>' . _('Standard Overhead Cost Per Unit') . ':</td><td class=number><input type=text class="number" name="OverheadCost" value=' . $myrow['overheadcost'] . '></td></tr>'; + echo '<tr><td>' . _('Standard Labour Cost Per Unit') . ':</td><td class=number><input type="text" class="number" name="LabourCost" value=' . $myrow['labourcost'] . '></td></tr>'; + echo '<tr><td>' . _('Standard Overhead Cost Per Unit') . ':</td><td class=number><input type="text" class="number" name="OverheadCost" value=' . $myrow['overheadcost'] . '></td></tr>'; } elseif ($myrow['mbflag']=='B' OR $myrow['mbflag']=='D') { echo '<tr><td>' . _('Standard Cost') .':</td><td class=number><input type="text" class="number" name="MaterialCost" value=' . $myrow['materialcost'] . '></td></tr>'; } else { Modified: trunk/StockLocTransfer.php =================================================================== --- trunk/StockLocTransfer.php 2011-07-16 02:55:44 UTC (rev 4631) +++ trunk/StockLocTransfer.php 2011-07-16 02:59:14 UTC (rev 4632) @@ -197,8 +197,8 @@ $k++; echo '<tr> - <td><input type=text name="StockID' . $i .'" size="21" maxlength="20" value="' . $_POST['StockID' . $i] . '"></td> - <td><input type=text name="StockQTY' . $i .'" size="10" maxlength="10" class="number" value="' . $_POST['StockQTY' . $i] . '"></td> + <td><input type="text" name="StockID' . $i .'" size="21" maxlength="20" value="' . $_POST['StockID' . $i] . '"></td> + <td><input type="text" name="StockQTY' . $i .'" size="10" maxlength="10" class="number" value="' . $_POST['StockQTY' . $i] . '"></td> </tr>'; } }else { @@ -215,8 +215,8 @@ $_POST['StockQTY' . $i]=0; } echo '<tr> - <td><input type=text name="StockID' . $i .'" size=21 maxlength=20 value="' . $_POST['StockID' . $i] . '"></td> - <td><input type=text name="StockQTY' . $i .'" size=10 maxlength=10 class="number" value="' . $_POST['StockQTY' . $i] . '"></td> + <td><input type="text" name="StockID' . $i .'" size=21 maxlength=20 value="' . $_POST['StockID' . $i] . '"></td> + <td><input type="text" name="StockQTY' . $i .'" size=10 maxlength=10 class="number" value="' . $_POST['StockQTY' . $i] . '"></td> </tr>'; $i++; } Modified: trunk/StockLocTransferReceive.php =================================================================== --- trunk/StockLocTransferReceive.php 2011-07-16 02:55:44 UTC (rev 4631) +++ trunk/StockLocTransferReceive.php 2011-07-16 02:59:14 UTC (rev 4632) @@ -468,7 +468,7 @@ if ($TrfLine->Controlled==1){ echo '<td class=number><input type=hidden name="Qty' . $i . '" VALUE="' . $Qty . '"><a href="' . $rootpath .'/StockTransferControlled.php?' . SID . '&TransferItem=' . $i . '">' . $Qty . '</a></td>'; } else { - echo '<td><input type=text class="number" name="Qty' . $i . '" maxlength=10 class="number" size=auto VALUE="' . $Qty . '"></td>'; + echo '<td><input type="text" class="number" name="Qty' . $i . '" maxlength=10 class="number" size=auto VALUE="' . $Qty . '"></td>'; } echo '<td>' . $TrfLine->PartUnit . '</td>'; Modified: trunk/StockMovements.php =================================================================== --- trunk/StockMovements.php 2011-07-16 02:55:44 UTC (rev 4631) +++ trunk/StockMovements.php 2011-07-16 02:59:14 UTC (rev 4632) @@ -51,8 +51,8 @@ } echo '</select></th></tr>'; -echo '<tr><th colspan=10>' . _('Show Movements before') . ': <input type=text name="BeforeDate" class="date" alt="'.$_SESSION['DefaultDateFormat'].'" size="12" maxlength="12" VALUE="' . $_POST['BeforeDate'] . '">'; -echo ' ' . _('But after') . ': <input type=TEXT name="AfterDate" class="date" alt="'.$_SESSION['DefaultDateFormat'].'" size="12" maxlength="12" VALUE="' . $_POST['AfterDate'] . '">'; +echo '<tr><th colspan=10>' . _('Show Movements before') . ': <input type="text" name="BeforeDate" class="date" alt="'.$_SESSION['DefaultDateFormat'].'" size="12" maxlength="12" VALUE="' . $_POST['BeforeDate'] . '">'; +echo ' ' . _('But after') . ': <input type="text" name="AfterDate" class="date" alt="'.$_SESSION['DefaultDateFormat'].'" size="12" maxlength="12" VALUE="' . $_POST['AfterDate'] . '">'; echo ' <input type="submit" name="ShowMoves" value="' . _('Show Stock Movements') . '"></th></tr>'; $SQLBeforeDate = FormatDateForSQL($_POST['BeforeDate']); Modified: trunk/StockReorderLevel.php =================================================================== --- trunk/StockReorderLevel.php 2011-07-16 02:55:44 UTC (rev 4631) +++ trunk/StockReorderLevel.php 2011-07-16 02:59:14 UTC (rev 4632) @@ -77,7 +77,7 @@ printf("<td>%s</td> <td class=number>%s</td> - <td><input type=text class='number' name=%s maxlength=10 size=10 VALUE=%s></td>", + <td><input type="text" class='number' name=%s maxlength=10 size=10 VALUE=%s></td>", $myrow['locationname'], number_format($myrow['quantity'],$myrow['decimalplaces']), $myrow['loccode'], Modified: trunk/StockTransfers.php =================================================================== --- trunk/StockTransfers.php 2011-07-16 02:55:44 UTC (rev 4631) +++ trunk/StockTransfers.php 2011-07-16 02:59:14 UTC (rev 4632) @@ -444,16 +444,16 @@ } echo '<table class=selection><tr><td>'. _('Stock Code'). ':</td><td>'; if (isset($_POST['StockID'])) { - echo '<input type=text name="StockID" size=21 value="' . $_POST['StockID'] . '" maxlength=20></td></tr>'; + echo '<input type="text" name="StockID" size=21 value="' . $_POST['StockID'] . '" maxlength=20></td></tr>'; } else { - echo '<input type=text name="StockID" size=21 value="" maxlength=20></td></tr>'; + echo '<input type="text" name="StockID" size=21 value="" maxlength=20></td></tr>'; } -echo '<tr><td>'. _('Partial Description'). ':</td><td><input type=text name="StockText" size=21 value="' . +echo '<tr><td>'. _('Partial Description'). ':</td><td><input type="text" name="StockText" size=21 value="' . $_GET['Description'] .'"></td><td>'._('Partial Stock Code'). ':</td><td>'; if (isset($_POST['StockID'])) { - echo '<input type=text name="StockCode" size=21 value="' . $_POST['StockID'] .'" maxlength=20>'; + echo '<input type="text" name="StockCode" size=21 value="' . $_POST['StockID'] .'" maxlength=20>'; } else { - echo '<input type=text name="StockCode" size=21 value="" maxlength=20>'; + echo '<input type="text" name="StockCode" size=21 value="" maxlength=20>'; } echo '</td><td><input type=submit name="CheckCode" value="'._('Check Part').'"></td></tr>'; @@ -510,9 +510,9 @@ echo '<td class=number><input type=hidden name="Quantity" value=' . $_SESSION['Transfer']->TransferItem[0]->Quantity . '><a href="' . $rootpath .'/StockTransferControlled.php?StockLocationFrom='.$_SESSION['Transfer']->StockLocationFrom.'">' . $_SESSION['Transfer']->TransferItem[0]->Quantity . '</a></td></tr>'; } elseif (isset($_SESSION['Transfer']->TransferItem[0]->Controlled)){ - echo '<td><input type=text class="number" name="Quantity" size=12 maxlength=12 value=' . $_SESSION['Transfer']->TransferItem[0]->Quantity . '></td></tr>'; + echo '<td><input type="text" class="number" name="Quantity" size=12 maxlength=12 value=' . $_SESSION['Transfer']->TransferItem[0]->Quantity . '></td></tr>'; } else { - echo '<td><input type=text class="number" name="Quantity" size=12 maxlength=12 Value="0"></td></tr>'; + echo '<td><input type="text" class="number" name="Quantity" size=12 maxlength=12 Value="0"></td></tr>'; } echo '</table><div class="centre"><br /><input type="submit" name="EnterTransfer" value="' . _('Enter Stock Transfer') . '"><br />'; Modified: trunk/StockUsage.php =================================================================== --- trunk/StockUsage.php 2011-07-16 02:55:44 UTC (rev 4631) +++ trunk/StockUsage.php 2011-07-16 02:59:14 UTC (rev 4632) @@ -55,7 +55,7 @@ echo '<form action="' . $_SERVER['PHP_SELF'] . '" method=post>'; echo '<input type="hidden" name="FormID" value="' . $_SESSION['FormID'] . '" />'; -echo '<tr><td>' . _('Stock Code') . ':<input type=text name="StockID" size="21" maxlength="20" value="' . $StockID . '" />'; +echo '<tr><td>' . _('Stock Code') . ':<input type="text" name="StockID" size="21" maxlength="20" value="' . $StockID . '" />'; echo _('From Stock Location') . ':<select name="StockLocation">'; Modified: trunk/SuppPaymentRun.php =================================================================== --- trunk/SuppPaymentRun.php 2011-07-16 02:55:44 UTC (rev 4631) +++ trunk/SuppPaymentRun.php 2011-07-16 02:59:14 UTC (rev 4632) @@ -257,9 +257,9 @@ $DefaultToCriteria = $_POST['ToCriteria']; } echo '<tr><td>' . _('From Supplier Code') . ':</font></td> - <td><input Type=text maxlength=6 size=7 name=FromCriteria value="' . $DefaultFromCriteria . '"></td></tr>'; + <td><input type="text" maxlength=6 size=7 name=FromCriteria value="' . $DefaultFromCriteria . '"></td></tr>'; echo '<tr><td>' . _('To Supplier Code') . ':</td> - <td><input Type=text maxlength=6 size=7 name=ToCriteria value="' . $DefaultToCriteria . '"></td></tr>'; + <td><input type="text" maxlength=6 size=7 name=ToCriteria value="' . $DefaultToCriteria . '"></td></tr>'; echo '<tr><td>' . _('For Suppliers Trading in') . ':</td><td><select name="Currency">'; @@ -281,7 +281,7 @@ $DefaultExRate = $_POST['ExRate']; } echo '<tr><td>' . _('Exchange Rate') . ':</td> - <td><input type=text class="number" name="ExRate" maxlength=11 size=12 VALUE=' . $DefaultExRate . '></td></tr>'; + <td><input type="text" class="number" name="ExRate" maxlength=11 size=12 VALUE=' . $DefaultExRate . '></td></tr>'; if (!isset($_POST['AmountsDueBy'])){ $DefaultDate = Date($_SESSION['DefaultDateFormat'], Mktime(0,0,0,Date('m')+1,0 ,Date('y'))); @@ -290,7 +290,7 @@ } echo '<tr><td>' . _('Payments Due To') . ':</td> - <td><input type=text class="date" alt="'.$_SESSION['DefaultDateFormat'].'" name="AmountsDueBy" maxlength=11 size=12 VALUE=' . $DefaultDate . '></td></tr>'; + <td><input type="text" class="date" alt="'.$_SESSION['DefaultDateFormat'].'" name="AmountsDueBy" maxlength=11 size=12 VALUE=' . $DefaultDate . '></td></tr>'; $SQL = 'SELECT bankaccountname, accountcode FROM bankaccounts'; @@ -348,7 +348,7 @@ } echo '<tr><td>' . _('Starting Reference no (eg chq no)') . ':</td> - <td><input type=text name="Ref" maxlength=11 size=12 VALUE=' . $_POST['Ref'] . '></td></tr>'; + <td><input type="text" name="Ref" maxlength=11 size=12 VALUE=' . $_POST['Ref'] . '></td></tr>'; echo '</table><br /><div class="centre"><input type=Submit Name="PrintPDF" Value="' . _('Print PDF Only') . '"> <input type=Submit Name="PrintPDFAndProcess" Value="' . _('Print and Process Payments') . '"></div>'; Modified: trunk/SupplierContacts.php =================================================================== --- trunk/SupplierContacts.php 2011-07-16 02:55:44 UTC (rev 4631) +++ trunk/SupplierContacts.php 2011-07-16 02:59:14 UTC (rev 4632) @@ -245,13 +245,13 @@ <tr><td>' . _('Position') . ':</td> <td><input type="text" name="Position" size=31 maxlength=30 value="' . $_POST['Position'] . '"></td></tr> <tr><td>' . _('Telephone No') . ':</td> - <td><input type=text name="Tel" size=31 maxlength=30 value="' . $_POST['Tel'] . '"></td></tr> + <td><input type="text" name="Tel" size=31 maxlength=30 value="' . $_POST['Tel'] . '"></td></tr> <tr><td>' . _('Facsimile No') . ':</td> - <td><input type=text name="Fax" size=31 maxlength=30 value="' . $_POST['Fax'] . '"></td></tr> + <td><input type="text" name="Fax" size... [truncated message content] |
From: <dai...@us...> - 2011-07-16 02:55:52
|
Revision: 4631 http://web-erp.svn.sourceforge.net/web-erp/?rev=4631&view=rev Author: daintree Date: 2011-07-16 02:55:44 +0000 (Sat, 16 Jul 2011) Log Message: ----------- fix invoice/credit note printing Modified Paths: -------------- trunk/Credit_Invoice.php trunk/PrintCustTrans.php trunk/PrintCustTransPortrait.php Modified: trunk/Credit_Invoice.php =================================================================== --- trunk/Credit_Invoice.php 2011-07-14 10:27:29 UTC (rev 4630) +++ trunk/Credit_Invoice.php 2011-07-16 02:55:44 UTC (rev 4631) @@ -49,20 +49,20 @@ stockmoves.loccode, locations.taxprovinceid, currencies.decimalplaces - FROM debtortrans INNER JOIN debtorsmaster ON - debtortrans.debtorno = debtorsmaster.debtorno - INNER JOIN custbranch ON - debtortrans.branchcode = custbranch.branchcode - AND debtortrans.debtorno = custbranch.debtorno - INNER JOIN currencies ON - debtorsmaster.currcode = currencies.currabrev - INNER JOIN stockmoves ON - stockmoves.transno=debtortrans.transno - INNER JOIN locations ON - stockmoves.loccode = locations.loccode + FROM debtortrans INNER JOIN debtorsmaster + ON debtortrans.debtorno = debtorsmaster.debtorno + INNER JOIN custbranch + ON debtortrans.branchcode = custbranch.branchcode + AND debtortrans.debtorno = custbranch.debtorno + INNER JOIN currencies + ON debtorsmaster.currcode = currencies.currabrev + INNER JOIN stockmoves + ON stockmoves.transno=debtortrans.transno + AND stockmoves.type=debtortrans.type + INNER JOIN locations ON + stockmoves.loccode = locations.loccode WHERE debtortrans.transno = '" . $_GET['InvoiceNumber'] . "' - AND debtortrans.type=10 - AND stockmoves.type=10"; + AND stockmoves.type=10"; $ErrMsg = _('A credit cannot be produced for the selected invoice') . '. ' . _('The invoice details cannot be retrieved because'); $DbgMsg = _('The SQL used to retrieve the invoice details was'); @@ -533,10 +533,10 @@ /*Now need to update the invoice DebtorTrans record for the amount to be allocated and if the invoice is now settled*/ $SQL = "UPDATE debtortrans - SET alloc = alloc + " . $Allocate_amount . ", - settled='" . $SettledInvoice . "' - WHERE transno = '" . $_SESSION['ProcessingCredit'] . "' - AND type=10"; + SET alloc = alloc + " . $Allocate_amount . ", + settled='" . $SettledInvoice . "' + WHERE transno = '" . $_SESSION['ProcessingCredit'] . "' + AND type=10"; $ErrMsg = _('CRITICAL ERROR') . '! ' . _('NOTE DOWN THIS ERROR AND SEEK ASSISTANCE') . ': ' . _('The alteration to the invoice record to reflect the allocation of the credit note to the invoice could not be done because'); $DbgMsg = _('The following SQL to update the invoice allocation was used'); @@ -545,39 +545,39 @@ /*Now insert the Credit Note into the DebtorTrans table with the allocations as calculated above*/ $SQL = "INSERT INTO debtortrans (transno, - type, - debtorno, - branchcode, - trandate, - inputdate, - prd, - reference, - tpe, - order_, - ovamount, - ovgst, - ovfreight, - rate, - invtext, - alloc, - settled) - VALUES (". $CreditNo . ", - 11, - '" . $_SESSION['CreditItems']->DebtorNo . "', - '" . $_SESSION['CreditItems']->Branch . "', - '" . $DefaultDispatchDate . "', - '" . date('Y-m-d H-i-s') . "', - '" . $PeriodNo . "', - 'Inv-" . $_SESSION['ProcessingCredit'] . "', - '" . $_SESSION['CreditItems']->DefaultSalesType . "', - '" . $_SESSION['CreditItems']->OrderNo . "', - '" . -($_SESSION['CreditItems']->total) . "', - '" . -$TaxTotal . "', - '" . -$_SESSION['CreditItems']->FreightCost . "', - '" . $_SESSION['CurrencyRate'] . "', - '" . $_POST['CreditText'] . "', - '" . -$Allocate_amount . "', - '" . $Settled . "')"; + type, + debtorno, + branchcode, + trandate, + inputdate, + prd, + reference, + tpe, + order_, + ovamount, + ovgst, + ovfreight, + rate, + invtext, + alloc, + settled) + VALUES (". $CreditNo . ", + 11, + '" . $_SESSION['CreditItems']->DebtorNo . "', + '" . $_SESSION['CreditItems']->Branch . "', + '" . $DefaultDispatchDate . "', + '" . date('Y-m-d H-i-s') . "', + '" . $PeriodNo . "', + 'Inv-" . $_SESSION['ProcessingCredit'] . "', + '" . $_SESSION['CreditItems']->DefaultSalesType . "', + '" . $_SESSION['CreditItems']->OrderNo . "', + '" . -($_SESSION['CreditItems']->total) . "', + '" . -$TaxTotal . "', + '" . -$_SESSION['CreditItems']->FreightCost . "', + '" . $_SESSION['CurrencyRate'] . "', + '" . $_POST['CreditText'] . "', + '" . -$Allocate_amount . "', + '" . $Settled . "')"; $ErrMsg = _('CRITICAL ERROR') . '! ' . _('NOTE DOWN THIS ERROR AND SEEK ASSISTANCE') . ': ' . _('The customer credit note transaction could not be added to the database because'); $DbgMsg = _('The following SQL to insert the customer credit note was used'); @@ -620,16 +620,16 @@ /* Update sales order details quantity invoiced less this credit quantity. */ - foreach ($_SESSION['CreditItems']->LineItems as $OrderLine) { + foreach ($_SESSION['CreditItems']->LineItems as $CreditLine) { - if ($OrderLine->QtyDispatched >0){ - $LocalCurrencyPrice= round(($OrderLine->Price / $_SESSION['CurrencyRate']),$_SESSION['CompanyRecord']['decimalplaces']); + if ($CreditLine->QtyDispatched >0){ + $LocalCurrencyPrice= round(($CreditLine->Price / $_SESSION['CurrencyRate']),$_SESSION['CompanyRecord']['decimalplaces']); /*Determine the type of stock item being credited */ - $SQL = "SELECT mbflag FROM stockmaster WHERE stockid = '" . $OrderLine->StockID . "'"; + $SQL = "SELECT mbflag FROM stockmaster WHERE stockid = '" . $CreditLine->StockID . "'"; $Result = DB_query($SQL, $db, - _('Could not determine if the item') . ' ' . $OrderLine->StockID . ' ' . _('is purchased or manufactured'), + _('Could not determine if the item') . ' ' . $CreditLine->StockID . ' ' . _('is purchased or manufactured'), _('The SQL used that failed was'),true); $MBFlagRow = DB_fetch_row($Result); $MBFlag = $MBFlagRow[0]; @@ -637,7 +637,7 @@ /*Need to get the current location quantity will need it later for the stock movements */ $SQL="SELECT locstock.quantity FROM locstock - WHERE locstock.stockid='" . $OrderLine->StockID . "' + WHERE locstock.stockid='" . $CreditLine->StockID . "' AND loccode= '" . $_SESSION['CreditItems']->Location . "'"; $Result = DB_query($SQL, $db); if (DB_num_rows($Result)==1){ @@ -656,11 +656,11 @@ /* some want this some do not */ $SQL = "UPDATE salesorderdetails - SET qtyinvoiced = qtyinvoiced - " . $OrderLine->QtyDispatched . ", + SET qtyinvoiced = qtyinvoiced - " . $CreditLine->QtyDispatched . ", completed=0 WHERE orderno = '" . $_SESSION['CreditItems']->OrderNo . "' - AND stkcode = '" . $OrderLine->StockID . "' - AND orderlineno='" . $OrderLine->LineNumber."'"; + AND stkcode = '" . $CreditLine->StockID . "' + AND orderlineno='" . $CreditLine->LineNumber."'"; $ErrMsg = _('CRITICAL ERROR') . '! ' . _('NOTE DOWN THIS ERROR AND SEEK ASSISTANCE') . ': ' . _('The sales order detail record could not be updated for the reduced quantity invoiced because'); $DbgMsg = _('The following SQL to update the sales order detail record was used'); @@ -673,8 +673,8 @@ if ($MBFlag=='B' OR $MBFlag=='M') { $SQL = "UPDATE locstock - SET locstock.quantity = locstock.quantity + " . $OrderLine->QtyDispatched . " - WHERE locstock.stockid = '" . $OrderLine->StockID . "' + SET locstock.quantity = locstock.quantity + " . $CreditLine->QtyDispatched . " + WHERE locstock.stockid = '" . $CreditLine->StockID . "' AND loccode = '" . $_SESSION['CreditItems']->Location . "'"; $ErrMsg = _('CRITICAL ERROR') . '! ' . _('NOTE DOWN THIS ERROR AND SEEK ASSISTANCE') . ': ' . _('Location stock record could not be updated because'); @@ -695,11 +695,11 @@ FROM bom, stockmaster WHERE bom.component=stockmaster.stockid - AND bom.parent='" . $OrderLine->StockID . "' + AND bom.parent='" . $CreditLine->StockID . "' AND bom.effectiveto > '" . Date('Y-m-d') . "' AND bom.effectiveafter < '" . Date('Y-m-d') . "'"; - $ErrMsg = _('Could not retrieve assembly components from the database for') . ' ' . $OrderLine->StockID . ' ' . _('because'); + $ErrMsg = _('Could not retrieve assembly components from the database for') . ' ' . $CreditLine->StockID . ' ' . _('because'); $DbgMsg = _('The SQL that failed was'); $AssResult = DB_query($sql,$db, $ErrMsg, $DbgMsg, true); @@ -758,11 +758,11 @@ '" . $_SESSION['CreditItems']->DebtorNo . "', '" . $_SESSION['CreditItems']->Branch . "', '" . $PeriodNo . "', - '" . _('Ex Inv') . ': ' . $_SESSION['ProcessingCredit'] . ' ' . _('Assembly') . ': ' . $OrderLine->StockID . "', - '" . $AssParts['quantity'] * $OrderLine->QtyDispatched . "', + '" . _('Ex Inv') . ': ' . $_SESSION['ProcessingCredit'] . ' ' . _('Assembly') . ': ' . $CreditLine->StockID . "', + '" . $AssParts['quantity'] * $CreditLine->QtyDispatched . "', '" . $AssParts['standard'] . "', 0, - '" . ($QtyOnHandPrior + ($AssParts['quantity'] * $OrderLine->QtyDispatched)) . "' + '" . ($QtyOnHandPrior + ($AssParts['quantity'] * $CreditLine->QtyDispatched)) . "' )"; } else { @@ -787,19 +787,19 @@ '" . $_SESSION['CreditItems']->DebtorNo . "', '" . $_SESSION['CreditItems']->Branch . "', '" . $PeriodNo . "', - '" . _('Ex Inv') . ': ' . $_SESSION['ProcessingCredit'] . ' ' . _('Assembly') . ': ' . $OrderLine->StockID . "', - '" . $AssParts['quantity'] * $OrderLine->QtyDispatched . "', + '" . _('Ex Inv') . ': ' . $_SESSION['ProcessingCredit'] . ' ' . _('Assembly') . ': ' . $CreditLine->StockID . "', + '" . $AssParts['quantity'] * $CreditLine->QtyDispatched . "', '" . $AssParts['standard'] . "', 0)"; } - $ErrMsg = _('CRITICAL ERROR') . '! ' . _('NOTE DOWN THIS ERROR AND SEEK ASSISTANCE') . ': ' . _('Stock movement records for the assembly components of') .' ' . $OrderLine->StockID . ' ' . _('could not be inserted because'); + $ErrMsg = _('CRITICAL ERROR') . '! ' . _('NOTE DOWN THIS ERROR AND SEEK ASSISTANCE') . ': ' . _('Stock movement records for the assembly components of') .' ' . $CreditLine->StockID . ' ' . _('could not be inserted because'); $DbgMsg = _('The following SQL to insert the assembly components stock movement records was used'); $Result = DB_query($SQL, $db, $ErrMsg, $DbgMsg, true); if ($Component_MBFlag=="M" OR $Component_MBFlag=="B"){ $SQL = "UPDATE locstock - SET locstock.quantity = locstock.quantity + " . $AssParts['quantity'] * $OrderLine->QtyDispatched . " + SET locstock.quantity = locstock.quantity + " . $AssParts['quantity'] * $CreditLine->QtyDispatched . " WHERE locstock.stockid = '" . $AssParts['component'] . "' AND loccode = '" . $_SESSION['CreditItems']->Location . "'"; @@ -813,8 +813,8 @@ } } /* end of assembly explosion and updates */ /*Update the cart with the recalculated standard cost from the explosion of the assembly's components*/ - $_SESSION['CreditItems']->LineItems[$OrderLine->LineNumber]->StandardCost = $StandardCost; - $OrderLine->StandardCost = $StandardCost; + $_SESSION['CreditItems']->LineItems[$CreditLine->LineNumber]->StandardCost = $StandardCost; + $CreditLine->StandardCost = $StandardCost; } /* Insert stock movements for the stock coming back in - with unit cost */ @@ -836,7 +836,7 @@ standardcost, newqoh, narrative) - VALUES ('" . $OrderLine->StockID . "', + VALUES ('" . $CreditLine->StockID . "', 11, '" . $CreditNo . "', '" . $_SESSION['CreditItems']->Location . "', @@ -846,11 +846,11 @@ '" . $LocalCurrencyPrice . "', '" . $PeriodNo . "', '" . _('Ex Inv') .' - ' . $_SESSION['ProcessingCredit'] . "', - '" . $OrderLine->QtyDispatched . "', - '" . $OrderLine->DiscountPercent . "', - '" . $OrderLine->StandardCost . "', - '" . ($QtyOnHandPrior + $OrderLine->QtyDispatched) . "', - '" . $OrderLine->Narrative . "')"; + '" . $CreditLine->QtyDispatched . "', + '" . $CreditLine->DiscountPercent . "', + '" . $CreditLine->StandardCost . "', + '" . ($QtyOnHandPrior + $CreditLine->QtyDispatched) . "', + '" . $CreditLine->Narrative . "')"; } else { $SQL = "INSERT INTO stockmoves ( @@ -868,7 +868,7 @@ discountpercent, standardcost, narrative) - VALUES ('" . $OrderLine->StockID . "', + VALUES ('" . $CreditLine->StockID . "', 11, '" . $CreditNo . "', '" . $_SESSION['CreditItems']->Location . "', @@ -878,10 +878,10 @@ '" . $LocalCurrencyPrice . "', '" . $PeriodNo . "', '" . _('Ex Inv') . " - " . $_SESSION['ProcessingCredit'] . "', - '" . $OrderLine->QtyDispatched . "', - '" . $OrderLine->DiscountPercent . "', - '" . $OrderLine->StandardCost . "', - '" . $OrderLine->Narrative . "' + '" . $CreditLine->QtyDispatched . "', + '" . $CreditLine->DiscountPercent . "', + '" . $CreditLine->StandardCost . "', + '" . $CreditLine->Narrative . "' )"; } @@ -891,12 +891,12 @@ $StkMoveNo = DB_Last_Insert_ID($db,'stockmoves','stkmoveno'); /*Insert the StockSerialMovements and update the StockSerialItems for controlled items*/ - //echo "<div align=left><pre>"; var_dump($OrderLine); echo "</pre> </div>"; - if ($OrderLine->Controlled ==1){ - foreach($OrderLine->SerialItems as $Item){ + //echo "<div align=left><pre>"; var_dump($CreditLine); echo "</pre> </div>"; + if ($CreditLine->Controlled ==1){ + foreach($CreditLine->SerialItems as $Item){ /*We need to add the StockSerialItem record and The StockSerialMoves as well */ $SQL = "SELECT quantity from stockserialitems - WHERE stockid='" . $OrderLine->StockID . "' + WHERE stockid='" . $CreditLine->StockID . "' AND loccode='" . $_SESSION['CreditItems']->Location . "' AND serialno='" . $Item->BundleRef . "'"; @@ -910,7 +910,7 @@ serialno, quantity) VALUES - ('" . $OrderLine->StockID . "', + ('" . $CreditLine->StockID . "', '" . $_SESSION['CreditItems']->Location . "', '" . $Item->BundleRef . "', '". $Item->BundleQty ."')"; @@ -922,7 +922,7 @@ $SQL = "UPDATE stockserialitems SET quantity= quantity + " . $Item->BundleQty . " - WHERE stockid='" . $OrderLine->StockID . "' + WHERE stockid='" . $CreditLine->StockID . "' AND loccode='" . $_SESSION['CreditItems']->Location . "' AND serialno='" . $Item->BundleRef . "'"; $ErrMsg = _('CRITICAL ERROR') . '! ' . _('NOTE DOWN THIS ERROR AND SEEK ASSISTANCE') . ': ' . _('The serial stock item record could not be updated because'); @@ -937,7 +937,7 @@ serialno, moveqty) VALUES ('" . $StkMoveNo . "', - '" . $OrderLine->StockID . "', + '" . $CreditLine->StockID . "', '" . $Item->BundleRef . "', '" . $Item->BundleQty . "')"; $ErrMsg = _('CRITICAL ERROR') . '! ' . _('NOTE DOWN THIS ERROR AND SEEK ASSISTANCE') . ': ' . _('The serial stock movement record could not be inserted because'); @@ -968,7 +968,7 @@ standardcost, newqoh, narrative ) - VALUES ('" . $OrderLine->StockID . "', + VALUES ('" . $CreditLine->StockID . "', 11, '" . $CreditNo . "', '" . $_SESSION['CreditItems']->Location . "', @@ -978,11 +978,11 @@ '" . $LocalCurrencyPrice . "', '" . $PeriodNo . "', '" . _('Ex Inv') . ' - ' . $_SESSION['ProcessingCredit'] . "', - '" . $OrderLine->QtyDispatched . "', - '" . $OrderLine->DiscountPercent . "', - '" . $OrderLine->StandardCost . "', - '" . ($QtyOnHandPrior +$OrderLine->QtyDispatched) . "', - '" . $OrderLine->Narrative . "')"; + '" . $CreditLine->QtyDispatched . "', + '" . $CreditLine->DiscountPercent . "', + '" . $CreditLine->StandardCost . "', + '" . ($QtyOnHandPrior +$CreditLine->QtyDispatched) . "', + '" . $CreditLine->Narrative . "')"; $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'); @@ -1006,7 +1006,7 @@ newqoh, narrative ) - VALUES ('" . $OrderLine->StockID . "', + VALUES ('" . $CreditLine->StockID . "', 11, '" . $CreditNo . "', '" . $_SESSION['CreditItems']->Location . "', @@ -1016,12 +1016,12 @@ '" . $LocalCurrencyPrice . "', '" . $PeriodNo . "', '" . _('Written off ex Inv') . ' - ' . $_SESSION['ProcessingCredit'] . "', - '" . -$OrderLine->QtyDispatched . "', - '" . $OrderLine->DiscountPercent . "', - '" . $OrderLine->StandardCost . "', + '" . -$CreditLine->QtyDispatched . "', + '" . $CreditLine->DiscountPercent . "', + '" . $CreditLine->StandardCost . "', 0, '" . $QtyOnHandPrior . "', - '" . $OrderLine->Narrative . "')"; + '" . $CreditLine->Narrative . "')"; $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'); @@ -1046,7 +1046,7 @@ newqoh, hidemovt, narrative) - VALUES ('" . $OrderLine->StockID . "', + VALUES ('" . $CreditLine->StockID . "', 11, '" . $CreditNo . "', '" . $_SESSION['CreditItems']->Location . "', @@ -1056,12 +1056,12 @@ '" . $LocalCurrencyPrice . "', '" . $PeriodNo . "', '" . _('Ex Inv') .' - ' . $_SESSION['ProcessingCredit'] . "', - '" . $OrderLine->QtyDispatched . "', - '" . $OrderLine->DiscountPercent . "', - '" . $OrderLine->StandardCost . "', + '" . $CreditLine->QtyDispatched . "', + '" . $CreditLine->DiscountPercent . "', + '" . $CreditLine->StandardCost . "', '" . $QtyOnHandPrior . "', 1, - '" . $OrderLine->Narrative . "')"; + '" . $CreditLine->Narrative . "')"; $ErrMsg = _('CRITICAL ERROR') . '! ' . _('NOTE DOWN THIS ERROR AND SEEK ASSISTANCE') . ': ' . _('Stock movement records could not be inserted because'); @@ -1074,7 +1074,7 @@ $StkMoveNo = DB_Last_Insert_ID($db,'stockmoves','stkmoveno'); /*Insert the taxes that applied to this line */ - foreach ($OrderLine->Taxes as $Tax) { + foreach ($CreditLine->Taxes as $Tax) { $SQL = "INSERT INTO stockmovestaxes (stkmoveno, taxauthid, @@ -1111,7 +1111,7 @@ AND periodno='" . $PeriodNo . "' AND cust = '" . $_SESSION['CreditItems']->DebtorNo . "' AND custbranch = '" . $_SESSION['CreditItems']->Branch . "' - AND salesanalysis.stockid = '" . $OrderLine->StockID . "' + AND salesanalysis.stockid = '" . $CreditLine->StockID . "' AND budgetoractual=1 GROUP BY stkcategory, salesanalysis.area, salesperson"; @@ -1127,32 +1127,32 @@ if ($_POST['CreditType']=='ReverseOverCharge'){ $SQL = "UPDATE salesanalysis - SET amt=amt-" . ($OrderLine->Price * $OrderLine->QtyDispatched / $_SESSION['CurrencyRate']) . ", - disc=disc-" . ($OrderLine->DiscountPercent * $OrderLine->Price * $OrderLine->QtyDispatched / $_SESSION['CurrencyRate']) . " + SET amt=amt-" . ($CreditLine->Price * $CreditLine->QtyDispatched / $_SESSION['CurrencyRate']) . ", + disc=disc-" . ($CreditLine->DiscountPercent * $CreditLine->Price * $CreditLine->QtyDispatched / $_SESSION['CurrencyRate']) . " WHERE salesanalysis.area='" . $myrow[2] . "' AND salesanalysis.salesperson='" . $myrow[3] . "' AND typeabbrev ='" . $_SESSION['CreditItems']->DefaultSalesType . "' AND periodno = '" . $PeriodNo . "' AND cust = '" . $_SESSION['CreditItems']->DebtorNo . "' AND custbranch = '" . $_SESSION['CreditItems']->Branch . "' - AND stockid = '" . $OrderLine->StockID . "' + AND stockid = '" . $CreditLine->StockID . "' AND salesanalysis.stkcategory ='" . $myrow[1] . "' AND budgetoractual=1"; } else { $SQL = "UPDATE salesanalysis - SET amt=amt-" . ($OrderLine->Price * $OrderLine->QtyDispatched / $_SESSION['CurrencyRate']) . ", - cost=cost-" . ($OrderLine->StandardCost * $OrderLine->QtyDispatched) . ", - qty=qty-" . $OrderLine->QtyDispatched . ", - disc=disc-" . ($OrderLine->DiscountPercent * $OrderLine->Price * $OrderLine->QtyDispatched / $_SESSION['CurrencyRate']) . " + SET amt=amt-" . ($CreditLine->Price * $CreditLine->QtyDispatched / $_SESSION['CurrencyRate']) . ", + cost=cost-" . ($CreditLine->StandardCost * $CreditLine->QtyDispatched) . ", + qty=qty-" . $CreditLine->QtyDispatched . ", + disc=disc-" . ($CreditLine->DiscountPercent * $CreditLine->Price * $CreditLine->QtyDispatched / $_SESSION['CurrencyRate']) . " WHERE salesanalysis.area='" . $myrow[2] . "' AND salesanalysis.salesperson='" . $myrow[3] . "' AND typeabbrev ='" . $_SESSION['CreditItems']->DefaultSalesType . "' AND periodno = '" . $PeriodNo . "' AND cust = '" . $_SESSION['CreditItems']->DebtorNo . "' AND custbranch = '" . $_SESSION['CreditItems']->Branch . "' - AND stockid = '" . $OrderLine->StockID . "' + AND stockid = '" . $CreditLine->StockID . "' AND salesanalysis.stkcategory ='" . $myrow[1] . "' AND budgetoractual=1"; } @@ -1175,19 +1175,19 @@ stkcategory) SELECT '" . $_SESSION['CreditItems']->DefaultSalesType . "', '" . $PeriodNo . "', - '" . -($OrderLine->Price * $OrderLine->QtyDispatched / $_SESSION['CurrencyRate']) . "', + '" . -($CreditLine->Price * $CreditLine->QtyDispatched / $_SESSION['CurrencyRate']) . "', '" . $_SESSION['CreditItems']->DebtorNo . "', '" . $_SESSION['CreditItems']->Branch . "', 0, - '" . -($OrderLine->DiscountPercent * $OrderLine->Price * $OrderLine->QtyDispatched / $_SESSION['CurrencyRate']) . "', - '" . $OrderLine->StockID . "', + '" . -($CreditLine->DiscountPercent * $CreditLine->Price * $CreditLine->QtyDispatched / $_SESSION['CurrencyRate']) . "', + '" . $CreditLine->StockID . "', custbranch.area, 1, custbranch.salesman, stockmaster.categoryid FROM stockmaster, custbranch - WHERE stockmaster.stockid = '" . $OrderLine->StockID . "' + WHERE stockmaster.stockid = '" . $CreditLine->StockID . "' AND custbranch.debtorno = '" . $_SESSION['CreditItems']->DebtorNo . "' AND custbranch.branchcode='" . $_SESSION['CreditItems']->Branch . "'"; } else { @@ -1207,20 +1207,20 @@ stkcategory) SELECT '" . $_SESSION['CreditItems']->DefaultSalesType . "', '" . $PeriodNo . "', - '" . -($OrderLine->Price * $OrderLine->QtyDispatched / $_SESSION['CurrencyRate']) . "', - '" . -($OrderLine->StandardCost * $OrderLine->QtyDispatched) . "', + '" . -($CreditLine->Price * $CreditLine->QtyDispatched / $_SESSION['CurrencyRate']) . "', + '" . -($CreditLine->StandardCost * $CreditLine->QtyDispatched) . "', '" . $_SESSION['CreditItems']->DebtorNo . "', '" . $_SESSION['CreditItems']->Branch . "', - '" . -$OrderLine->QtyDispatched . "', - '" . -($OrderLine->DiscountPercent * $OrderLine->Price * $OrderLine->QtyDispatched / $_SESSION['CurrencyRate']) . "', - '" . $OrderLine->StockID . "', + '" . -$CreditLine->QtyDispatched . "', + '" . -($CreditLine->DiscountPercent * $CreditLine->Price * $CreditLine->QtyDispatched / $_SESSION['CurrencyRate']) . "', + '" . $CreditLine->StockID . "', custbranch.area, 1, custbranch.salesman, stockmaster.categoryid FROM stockmaster, custbranch - WHERE stockmaster.stockid = '" . $OrderLine->StockID . "' + WHERE stockmaster.stockid = '" . $CreditLine->StockID . "' AND custbranch.debtorno = '" . $_SESSION['CreditItems']->DebtorNo . "' AND custbranch.branchcode='" . $_SESSION['CreditItems']->Branch . "'"; @@ -1235,12 +1235,12 @@ /* If GLLink_Stock then insert GLTrans to credit stock and debit cost of sales at standard cost*/ if ($_SESSION['CompanyRecord']['gllink_stock']==1 - AND ($OrderLine->StandardCost !=0 OR (isset($StandardCost) and $StandardCost !=0)) + AND ($CreditLine->StandardCost !=0 OR (isset($StandardCost) and $StandardCost !=0)) AND $_POST['CreditType']!='ReverseOverCharge'){ /*first the cost of sales entry*/ - $COGSAccount = GetCOGSGLAccount($Area, $OrderLine->StockID, $_SESSION['CreditItems']->DefaultSalesType, $db); + $COGSAccount = GetCOGSGLAccount($Area, $CreditLine->StockID, $_SESSION['CreditItems']->DefaultSalesType, $db); $SQL = "INSERT INTO gltrans (type, typeno, @@ -1254,8 +1254,8 @@ '" . $DefaultDispatchDate . "', '" . $PeriodNo . "', '" . $COGSAccount . "', - '" . $_SESSION['CreditItems']->DebtorNo . " - " . $OrderLine->StockID . " x " . $OrderLine->QtyDispatched . " @ " . $OrderLine->StandardCost . "', - '" . -round($OrderLine->StandardCost * $OrderLine->QtyDispatched,$_SESSION['CompanyRecord']['decimalplaces']) . "' + '" . $_SESSION['CreditItems']->DebtorNo . " - " . $CreditLine->StockID . " x " . $CreditLine->QtyDispatched . " @ " . $CreditLine->StandardCost . "', + '" . -round($CreditLine->StandardCost * $CreditLine->QtyDispatched,$_SESSION['CompanyRecord']['decimalplaces']) . "' )"; $ErrMsg = _('CRITICAL ERROR') . '! ' . _('NOTE DOWN THIS ERROR AND SEEK ASSISTANCE') . ': ' . _('The cost of sales GL posting could not be inserted because'); @@ -1278,10 +1278,10 @@ '" . $DefaultDispatchDate . "', '" . $PeriodNo . "', '" . $_POST['WriteOffGLCode'] . "', - '" . $_SESSION['CreditItems']->DebtorNo . " - " . $OrderLine->StockID . " x " . $OrderLine->QtyDispatched . " @ " . $OrderLine->StandardCost . "', - '" . round($OrderLine->StandardCost * $OrderLine->QtyDispatched,$_SESSION['CompanyRecord']['decimalplaces']) . "')"; + '" . $_SESSION['CreditItems']->DebtorNo . " - " . $CreditLine->StockID . " x " . $CreditLine->QtyDispatched . " @ " . $CreditLine->StandardCost . "', + '" . round($CreditLine->StandardCost * $CreditLine->QtyDispatched,$_SESSION['CompanyRecord']['decimalplaces']) . "')"; } else { - $StockGLCode = GetStockGLCode($OrderLine->StockID, $db); + $StockGLCode = GetStockGLCode($CreditLine->StockID, $db); $SQL = "INSERT INTO gltrans (type, typeno, trandate, @@ -1294,8 +1294,8 @@ '" . $DefaultDispatchDate . "', '" . $PeriodNo . "', '" . $StockGLCode['stockact'] . "', - '" . $_SESSION['CreditItems']->DebtorNo . " - " . $OrderLine->StockID . " x " . $OrderLine->QtyDispatched . " @ " . $OrderLine->StandardCost . "', - '" . round($OrderLine->StandardCost * $OrderLine->QtyDispatched,$_SESSION['CompanyRecord']['decimalplaces']) . "')"; + '" . $_SESSION['CreditItems']->DebtorNo . " - " . $CreditLine->StockID . " x " . $CreditLine->QtyDispatched . " @ " . $CreditLine->StandardCost . "', + '" . round($CreditLine->StandardCost * $CreditLine->QtyDispatched,$_SESSION['CompanyRecord']['decimalplaces']) . "')"; } $ErrMsg = _('CRITICAL ERROR') . '! ' . _('NOTE DOWN THIS ERROR AND SEEK ASSISTANCE') . ': ' . _('The stock side or write off of the cost of sales GL posting could not be inserted because'); @@ -1304,10 +1304,10 @@ } /* end of if GL and stock integrated and standard cost !=0 */ - if ($_SESSION['CompanyRecord']['gllink_debtors']==1 AND $OrderLine->Price !=0){ + if ($_SESSION['CompanyRecord']['gllink_debtors']==1 AND $CreditLine->Price !=0){ //Post sales transaction to GL credit sales - $SalesGLAccounts = GetSalesGLAccount($Area, $OrderLine->StockID, $_SESSION['CreditItems']->DefaultSalesType, $db); + $SalesGLAccounts = GetSalesGLAccount($Area, $CreditLine->StockID, $_SESSION['CreditItems']->DefaultSalesType, $db); $SQL = "INSERT INTO gltrans (type, typeno, @@ -1321,15 +1321,15 @@ '" . $DefaultDispatchDate . "', '" . $PeriodNo . "', '" . $SalesGLAccounts['salesglcode'] . "', - '" . $_SESSION['CreditItems']->DebtorNo . " - " . $OrderLine->StockID . " x " . $OrderLine->QtyDispatched . " @ " . $OrderLine->Price . "', - '" . round(($OrderLine->Price * $OrderLine->QtyDispatched)/$_SESSION['CurrencyRate'],$_SESSION['CompanyRecord']['decimalplaces']) . "' + '" . $_SESSION['CreditItems']->DebtorNo . " - " . $CreditLine->StockID . " x " . $CreditLine->QtyDispatched . " @ " . $CreditLine->Price . "', + '" . round(($CreditLine->Price * $CreditLine->QtyDispatched)/$_SESSION['CurrencyRate'],$_SESSION['CompanyRecord']['decimalplaces']) . "' )"; $ErrMsg = _('CRITICAL ERROR') . '! ' . _('NOTE DOWN THIS ERROR AND SEEK ASSISTANCE') . ': ' . _('The credit note GL posting could not be inserted because'); $DbgMsg = _('The following SQL to insert the GLTrans record was used'); $Result = DB_query($SQL,$db,$ErrMsg, $DbgMsg, true); - if ($OrderLine->DiscountPercent !=0){ + if ($CreditLine->DiscountPercent !=0){ $SQL = "INSERT INTO gltrans (type, typeno, @@ -1343,8 +1343,8 @@ '" . $DefaultDispatchDate . "', '" . $PeriodNo . "', '" . $SalesGLAccounts['discountglcode'] . "', - '" . $_SESSION['CreditItems']->DebtorNo . " - " . $OrderLine->StockID . " @ " . ($OrderLine->DiscountPercent * 100) . "%', - '" . -round(($OrderLine->Price * $OrderLine->QtyDispatched * $OrderLine->DiscountPercent)/$_SESSION['CurrencyRate'],$_SESSION['CompanyRecord']['decimalplaces']) . "' + '" . $_SESSION['CreditItems']->DebtorNo . " - " . $CreditLine->StockID . " @ " . ($CreditLine->DiscountPercent * 100) . "%', + '" . -round(($CreditLine->Price * $CreditLine->QtyDispatched * $CreditLine->DiscountPercent)/$_SESSION['CurrencyRate'],$_SESSION['CompanyRecord']['decimalplaces']) . "' )"; $ErrMsg = _('CRITICAL ERROR') . '! ' . _('NOTE DOWN THIS ERROR AND SEEK ASSISTANCE') . ': ' . _('The credit note discount GL posting could not be inserted because'); $DbgMsg = _('The following SQL to insert the GLTrans record was used'); Modified: trunk/PrintCustTrans.php =================================================================== --- trunk/PrintCustTrans.php 2011-07-14 10:27:29 UTC (rev 4630) +++ trunk/PrintCustTrans.php 2011-07-16 02:55:44 UTC (rev 4631) @@ -125,25 +125,27 @@ custbranch.brpostaddr6, salesman.salesmanname, debtortrans.debtorno, - debtortrans.branchcode - FROM debtortrans, - debtorsmaster, - custbranch, - salesorders, - shippers, - salesman, - locations, - paymentterms - WHERE debtortrans.order_ = salesorders.orderno - AND debtortrans.type=10 - AND debtortrans.transno='" . $FromTransNo . "' - AND debtortrans.shipvia=shippers.shipper_id - AND debtortrans.debtorno=debtorsmaster.debtorno - AND debtorsmaster.paymentterms=paymentterms.termsindicator - AND debtortrans.debtorno=custbranch.debtorno + debtortrans.branchcode, + currencies.decimalplaces + FROM debtortrans INNER JOIN debtorsmaster + ON debtortrans.debtorno=debtorsmaster.debtorno + INNER JOIN custbranch + ON debtortrans.debtorno=custbranch.debtorno AND debtortrans.branchcode=custbranch.branchcode - AND custbranch.salesman=salesman.salesmancode - AND salesorders.fromstkloc=locations.loccode"; + INNER JOIN salesorders + ON debtortrans.order_ = salesorders.orderno + INNER JOIN shippers + ON debtortrans.shipvia=shippers.shipper_id + INNER JOIN salesman + ON custbranch.salesman=salesman.salesmancode + INNER JOIN locations + ON salesorders.fromstkloc=locations.loccode + INNER JOIN paymentterms + ON debtorsmaster.paymentterms=paymentterms.termsindicator + INNER JOIN currencies + ON debtorsmaster.currcode=currencies.currabrev + WHERE debtortrans.type=10 + AND debtortrans.transno='" . $FromTransNo . "'"; if (isset($_POST['PrintEDI']) and $_POST['PrintEDI']=='No') { $sql = $sql . " AND debtorsmaster.ediinvoices=0"; @@ -182,19 +184,21 @@ salesman.salesmanname, debtortrans.debtorno, debtortrans.branchcode, - paymentterms.terms - FROM debtortrans, - debtorsmaster, - custbranch, - salesman, - paymentterms + paymentterms.terms, + currencies.decimalplaces + FROM debtortrans INNER JOIN debtorsmaster + ON debtortrans.debtorno=debtorsmaster.debtorno + INNER JOIN custbranch + ON debtortrans.debtorno=custbranch.debtorno + AND debtortrans.branchcode=custbranch.branchcode + INNER JOIN salesman + ON custbranch.salesman=salesman.salesmancode + INNER JOIN paymentterms + ON debtorsmaster.paymentterms=paymentterms.termsindicator + INNER JOIN currencies + ON debtorsmaster.currcode=currencies.currabrev WHERE debtortrans.type=11 - AND debtorsmaster.paymentterms = paymentterms.termsindicator - AND debtortrans.transno='" . $FromTransNo . "' - AND debtortrans.debtorno=debtorsmaster.debtorno - AND debtortrans.debtorno=custbranch.debtorno - AND debtortrans.branchcode=custbranch.branchcode - AND custbranch.salesman=salesman.salesmancode"; + AND debtortrans.transno='" . $FromTransNo . "'"; if ($_POST['PrintEDI']=='No') { $sql = $sql . " AND debtorsmaster.ediinvoices=0"; @@ -225,7 +229,8 @@ ((1 - stockmoves.discountpercent) * stockmoves.price * " . $ExchRate . "* -stockmoves.qty) AS fxnet, (stockmoves.price * " . $ExchRate . ") AS fxprice, stockmoves.narrative, - stockmaster.units + stockmaster.units, + stockmaster.decimalplaces FROM stockmoves, stockmaster WHERE stockmoves.stockid = stockmaster.stockid @@ -241,7 +246,8 @@ ((1 - stockmoves.discountpercent) * stockmoves.price * " . $ExchRate . " * stockmoves.qty) AS fxnet, (stockmoves.price * " . $ExchRate . ") AS fxprice, stockmoves.narrative, - stockmaster.units + stockmaster.units, + stockmaster.decimalplaces FROM stockmoves, stockmaster WHERE stockmoves.stockid = stockmaster.stockid @@ -277,9 +283,9 @@ $DisplayDiscount = number_format($myrow2['discountpercent']*100,2) . '%'; $DiscountPrice=$myrow2['fxprice']*(1-$myrow2['discountpercent']); } - $DisplayNet=number_format($myrow2['fxnet'],2); - $DisplayPrice=number_format($myrow2['fxprice'],3); - $DisplayQty=$myrow2['quantity']; + $DisplayNet=number_format($myrow2['fxnet'],$myrow['decimalplaces']); + $DisplayPrice=number_format($myrow2['fxprice'],$myrow['decimalplaces']); + $DisplayQty=number_format($myrow2['quantity'],$myrow2['decimalplaces']); $LeftOvers = $pdf->addTextWrap($Left_Margin+3,$YPos,95,$FontSize,$myrow2['stockid']); $LeftOvers = $pdf->addTextWrap($Left_Margin+100,$YPos,123,$FontSize,$myrow2['description']); @@ -351,17 +357,17 @@ if ($InvOrCredit=='Invoice') { - $DisplaySubTot = number_format($myrow['ovamount'],2); - $DisplayFreight = number_format($myrow['ovfreight'],2); - $DisplayTax = number_format($myrow['ovgst'],2); - $DisplayTotal = number_format($myrow['ovfreight']+$myrow['ovgst']+$myrow['ovamount'],2); + $DisplaySubTot = number_format($myrow['ovamount'],$myrow['decimalplaces']); + $DisplayFreight = number_format($myrow['ovfreight'],$myrow['decimalplaces']); + $DisplayTax = number_format($myrow['ovgst'],$myrow['decimalplaces']); + $DisplayTotal = number_format($myrow['ovfreight']+$myrow['ovgst']+$myrow['ovamount'],$myrow['decimalplaces']); } else { - $DisplaySubTot = number_format(-$myrow['ovamount'],2); - $DisplayFreight = number_format(-$myrow['ovfreight'],2); - $DisplayTax = number_format(-$myrow['ovgst'],2); - $DisplayTotal = number_format(-$myrow['ovfreight']-$myrow['ovgst']-$myrow['ovamount'],2); + $DisplaySubTot = number_format(-$myrow['ovamount'],$myrow['decimalplaces']); + $DisplayFreight = number_format(-$myrow['ovfreight'],$myrow['decimalplaces']); + $DisplayTax = number_format(-$myrow['ovgst'],$myrow['decimalplaces']); + $DisplayTotal = number_format(-$myrow['ovfreight']-$myrow['ovgst']-$myrow['ovamount'],$myrow['decimalplaces']); } /* Print out the invoice text entered */ $YPos = $Bottom_Margin+(3*$line_height); @@ -559,93 +565,102 @@ if ($InvOrCredit=='Invoice') { - $sql = "SELECT - debtortrans.trandate, - debtortrans.ovamount, - debtortrans.ovdiscount, - debtortrans.ovfreight, - debtortrans.ovgst, - debtortrans.rate, - debtortrans.invtext, - debtortrans.consignment, - debtorsmaster.name, - debtorsmaster.address1, - debtorsmaster.address2, - debtorsmaster.address3, - debtorsmaster.address4, - debtorsmaster.address5, - debtorsmaster.address6, - debtorsmaster.currcode, - salesorders.deliverto, - salesorders.deladd1, - salesorders.deladd2, - salesorders.deladd3, - salesorders.deladd4, - salesorders.deladd5, - salesorders.deladd6, - salesorders.customerref, - salesorders.orderno, - salesorders.orddate, - shippers.shippername, - custbranch.brname, - custbranch.braddress1, - custbranch.braddress2, - custbranch.braddress3, - custbranch.braddress4, - custbranch.braddress5, - custbranch.braddress6, - salesman.salesmanname, - debtortrans.debtorno - FROM debtortrans, - debtorsmaster, - custbranch, - salesorders, - shippers, - salesman - WHERE debtortrans.order_ = salesorders.orderno - AND debtortrans.type=10 - AND debtortrans.transno='" . $FromTransNo . "' - AND debtortrans.shipvia=shippers.shipper_id - AND debtortrans.debtorno=debtorsmaster.debtorno - AND debtortrans.debtorno=custbranch.debtorno - AND debtortrans.branchcode=custbranch.branchcode - AND custbranch.salesman=salesman.salesmancode"; + $sql = "SELECT debtortrans.trandate, + debtortrans.ovamount, + debtortrans.ovdiscount, + debtortrans.ovfreight, + debtortrans.ovgst, + debtortrans.rate, + debtortrans.invtext, + debtortrans.consignment, + debtorsmaster.name, + debtorsmaster.address1, + debtorsmaster.address2, + debtorsmaster.address3, + debtorsmaster.address4, + debtorsmaster.address5, + debtorsmaster.address6, + debtorsmaster.currcode, + salesorders.deliverto, + salesorders.deladd1, + salesorders.deladd2, + salesorders.deladd3, + salesorders.deladd4, + salesorders.deladd5, + salesorders.deladd6, + salesorders.customerref, + salesorders.orderno, + salesorders.orddate, + shippers.shippername, + custbranch.brname, + custbranch.braddress1, + custbranch.braddress2, + custbranch.braddress3, + custbranch.braddress4, + custbranch.braddress5, + custbranch.braddress6, + salesman.salesmanname, + debtortrans.debtorno, + currencies.decimalplaces + FROM debtortrans INNER JOIN debtorsmaster + ON debtortrans.debtorno=debtorsmaster.debtorno + INNER JOIN custbranch + ON debtortrans.debtorno=custbranch.debtorno + AND debtortrans.branchcode=custbranch.branchcode + INNER JOIN salesorders + ON debtortrans.order_ = salesorders.orderno + INNER JOIN shippers + ON debtortrans.shipvia=shippers.shipper_id + INNER JOIN salesman + ON custbranch.salesman=salesman.salesmancode + INNER JOIN locations + ON salesorders.fromstkloc=locations.loccode + INNER JOIN paymentterms + ON debtorsmaster.paymentterms=paymentterms.termsindicator + INNER JOIN currencies + ON debtorsmaster.currcode=currencies.currabrev + WHERE debtortrans.type=10 + AND debtortrans.transno='" . $FromTransNo . "'"; } else { $sql = "SELECT debtortrans.trandate, - debtortrans.ovamount, - debtortrans.ovdiscount, - debtortrans.ovfreight, - debtortrans.ovgst, - debtortrans.rate, - debtortrans.invtext, - debtorsmaster.name, - debtorsmaster.address1, - debtorsmaster.address2, - debtorsmaster.address3, - debtorsmaster.address4, - debtorsmaster.address5, - debtorsmaster.address6, - debtorsmaster.currcode, - custbranch.brname, - custbranch.braddress1, - custbranch.braddress2, - custbranch.braddress3, - custbranch.braddress4, - custbranch.braddress5, - custbranch.braddress6, - salesman.salesmanname, - debtortrans.debtorno - FROM debtortrans, - debtorsmaster, - custbranch, - salesman - WHERE debtortrans.type=11 - AND debtortrans.transno='" . $FromTransNo . "' - AND debtortrans.debtorno=debtorsmaster.debtorno - AND debtortrans.debtorno=custbranch.debtorno - AND debtortrans.branchcode=custbranch.branchcode - AND custbranch.salesman=salesman.salesmancode"; + debtortrans.ovamount, + debtortrans.ovdiscount, + debtortrans.ovfreight, + debtortrans.ovgst, + debtortrans.rate, + debtortrans.invtext, + debtorsmaster.name, + debtorsmaster.address1, + debtorsmaster.address2, + debtorsmaster.address3, + debtorsmaster.address4, + debtorsmaster.address5, + debtorsmaster.address6, + debtorsmaster.currcode, + custbranch.brname, + custbranch.braddress1, + custbranch.braddress2, + custbranch.braddress3, + custbranch.braddress4, + custbranch.braddress5, + custbranch.braddress6, + salesman.salesmanname, + debtortrans.debtorno, + currencies.decimalplaces + FROM debtortrans INNER JOIN debtorsmaster + ON debtortrans.debtorno=debtorsmaster.debtorno + INNER JOIN custbranch + ON debtortrans.debtorno=custbranch.debtorno + AND debtortrans.branchcode=custbranch.branchcode + INNER JOIN salesman + ON custbranch.salesman=salesman.salesmancode + INNER JOIN paymentterms + ON debtorsmaster.paymentterms=paymentterms.termsindicator + INNER JOIN currencies + ON debtorsmaster.currcode=currencies.currabrev + WHERE debtortrans.type=11 + AND debtortrans.transno='" . $FromTransNo . "'"; } $result=DB_query($sql,$db); @@ -761,19 +776,20 @@ </table>'; $sql ="SELECT stockmoves.stockid, - stockmaster.description, - -stockmoves.qty as quantity, - stockmoves.discountpercent, - ((1 - stockmoves.discountpercent) * stockmoves.price * " . $ExchRate . "* -stockmoves.qty) AS fxnet, - (stockmoves.price * " . $ExchRate . ") AS fxprice, - stockmoves.narrative, - stockmaster.units - FROM stockmoves, - stockmaster - WHERE stockmoves.stockid = stockmaster.stockid - AND stockmoves.type=10 - AND stockmoves.transno='" . $FromTransNo . "' - AND stockmoves.show_on_inv_crds=1"; + stockmaster.description, + -stockmoves.qty as quantity, + stockmoves.discountpercent, + ((1 - stockmoves.discountpercent) * stockmoves.price * " . $ExchRate . "* -stockmoves.qty) AS fxnet, + (stockmoves.price * " . $ExchRate . ") AS fxprice, + stockmoves.narrative, + stockmaster.units, + stockmaster.decimalplaces + FROM stockmoves, + stockmaster + WHERE stockmoves.stockid = stockmaster.stockid + AND stockmoves.type=10 + AND stockmoves.transno='" . $FromTransNo . "' + AND stockmoves.show_on_inv_crds=1"; } else { /* then its a credit note */ @@ -799,20 +815,21 @@ </tr></table>'; $sql ="SELECT stockmoves.stockid, - stockmaster.description, - stockmoves.qty as quantity, - stockmoves.discountpercent, ((1 - stockmoves.discountpercent) * stockmoves.price * ' . $ExchRate . ' * stockmoves.qty) AS fxnet, - (stockmoves.price * ' . $ExchRate . ') AS fxprice, - stockmaster.units - FROM stockmoves, - stockmaster - WHERE stockmoves.stockid = stockmaster.stockid - AND stockmoves.type=11 - AND stockmoves.transno='" . $FromTransNo . "' - AND stockmoves.show_on_inv_crds=1"; + stockmaster.description, + stockmoves.qty as quantity, + stockmoves.discountpercent, ((1 - stockmoves.discountpercent) * stockmoves.price * " . $ExchRate . " * stockmoves.qty) AS fxnet, + (stockmoves.price * " . $ExchRate . ") AS fxprice, + stockmaster.units, + stockmaster.decimalplaces + FROM stockmoves, + stockmaster + WHERE stockmoves.stockid = stockmaster.stockid + AND stockmoves.type=11 + AND stockmoves.transno='" . $FromTransNo . "' + AND stockmoves.show_on_inv_crds=1"; } - echo '<hr>'; + echo '<hr />'; echo '<div class="centre"><font size=2>' . _('All amounts stated in') . ' ' . $myrow['currcode'] . '</font></div>'; $result=DB_query($sql,$db); @@ -850,9 +867,9 @@ echo $RowStarter; - $DisplayPrice = number_format($myrow2['fxprice'],2); - $DisplayQty = number_format($myrow2['quantity'],2); - $DisplayNet = number_format($myrow2['fxnet'],2); + $DisplayPrice = number_format($myrow2['fxprice'],$myrow['decimalplaces']); + $DisplayQty = number_format($myrow2['quantity'],$myrow2['decimalplaces']); + $DisplayNet = number_format($myrow2['fxnet'],$myrow['decimalplaces']); if ($myrow2['discountpercent']==0){ $DisplayDiscount =''; @@ -912,15 +929,17 @@ echo _('Telephone') . ': ' . $_SESSION['CompanyRecord']['telephone'] . '<br />'; echo _('Facsimile') . ': ' . $_SESSION['CompanyRecord']['fax'] . '<br />'; echo _('Email') . ': ' . $_SESSION['CompanyRecord']['email'] . '<br />'; - echo '</td><td class=number>' . _('Page') . ': ' . $PageNumber . '</td></tr></table>'; - echo '<table class="table1"><tr> - <th>' . _('Item Code') . '</th> - <th>' . _('Item Description') . '</th> - <th>' . _('Quantity') . '</th> - <th>' . _('Unit') . '</th> - <th>' . _('Price') . '</th> - <th>' . _('Discount') . '</th> - <th>' . _('Net') . '</th></tr>'; + echo '</td><td class="number">' . _('Page') . ': ' . $PageNumber . '</td></tr></table>'; + echo '<table class="table1"> + <tr> + <th>' . _('Item Code') . '</th> + <th>' . _('Item Description') . '</th> + <th>' . _('Quantity') . '</th> + <th>' . _('Unit') . '</th> + <th>' . _('Price') . '</th> + <th>' . _('Discount') . '</th> + <th>' . _('Net') . '</th> + </tr>'; $LineCounter = 10; @@ -960,14 +979,16 @@ echo _('Facsimile') . ': ' . $_SESSION['CompanyRecord']['fax'] . '<br />'; echo _('Email') . ': ' . $_SESSION['CompanyRecord']['email'] . '<br />'; echo '</td><td class=number>' . _('Page') . ': ' . $PageNumber . '</td></tr></table>'; - echo '<table class="table1"><tr> - <th>' . _('Item Code') . '</th> - <th>' . _('Item Description') . '</th> - <th>' . _('Quantity') . '</th> - <th>' . _('Unit') . '</th> - <th>' . _('Price') . '</th> - <th>' . _('Discount') . '</th> - <th>' . _('Net') . '</th></tr>'; + echo '<table class="table1"> + <tr> + <th>' . _('Item Code') . '</th> + <th>' . _('Item Description') . '</th> + <th>' . _('Quantity') . '</th> + <th>' . _('Unit') . '</th> + <th>' . _('Price') . '</th> + <th>' . _('Discount') . '</th> + <th>' . _('Net') . '</th> + </tr>'; $LineCounter = 10; } @@ -986,15 +1007,15 @@ if ($InvOrCredit=='Invoice') { - $DisplaySubTot = number_format($myrow['ovamount'],2); - $DisplayFreight = number_format($myrow['ovfreight'],2); - $DisplayTax = number_format($myrow['ovgst'],2); - $DisplayTotal = number_format($myrow['ovfreight']+$myrow['ovgst']+$myrow['ovamount'],2); + $DisplaySubTot = number_format($myrow['ovamount'],$myrow['decimalplaces']); + $DisplayFreight = number_format($myrow['ovfreight'],$myrow['decimalplaces']); + $DisplayTax = number_format($myrow['ovgst'],$myrow['decimalplaces']); + $DisplayTotal = number_format($myrow['ovfreight']+$myrow['ovgst']+$myrow['ovamount'],$myrow['decimalplaces']); } else { - $DisplaySubTot = number_format(-$myrow['ovamount'],2); - $DisplayFreight = number_format(-$myrow['ovfreight'],2); - $DisplayTax = number_format(-$myrow['ovgst'],2); - $DisplayTotal = number_format(-$myrow['ovfreight']-$myrow['ovgst']-$myrow['ovamount'],2); + $DisplaySubTot = number_format(-$myrow['ovamount'],$myrow['decimalplaces']); + $DisplayFreight = number_format(-$myrow['ovfreight'],$myrow['decimalplaces']); + $DisplayTax = number_format(-$myrow['ovgst'],$myrow['decimalplaces']); + $DisplayTotal = number_format(-$myrow['ovfreight']-$myrow['ovgst']-$myrow['ovamount'],$myrow['decimalplaces']); } /*Print out the invoice text entered */ Modified: trunk/PrintCustTransPortrait.php =================================================================== --- trunk/PrintCustTransPortrait.php 2011-07-14 10:27:29 UTC (rev 4630) +++ trunk/PrintCustTransPortrait.php 2011-07-16 02:55:44 UTC (rev 4631) @@ -99,123 +99,127 @@ if ($InvOrCredit=='Invoice') { $sql = "SELECT debtortrans.trandate, - debtortrans.ovamount, - debtortrans.ovdiscount, - debtortrans.ovfreight, - debtortrans.ovgst, - debtortrans.rate, - debtortrans.invtext, - debtortrans.consignment, - debtorsmaster.name, - debtorsmaster.address1, - debtorsmaster.address2, - debtorsmaster.address3, - debtorsmaster.address4, - debtorsmaster.address5, - debtorsmaster.address6, - debtorsmaster.currcode, - debtorsmaster.invaddrbranch, - debtorsmaster.taxref, - paymentterms.terms, - salesorders.deliverto, - salesorders.deladd1, - salesorders.deladd2, - salesorders.deladd3, - salesorders.deladd4, - salesorders.deladd5, - salesorders.deladd6, - salesorders.customerref, - salesorders.orderno, - salesorders.orddate, - locations.locationname, - shippers.shippername, - custbranch.brname, - custbranch.braddress1, - custbranch.braddress2, - custbranch.braddress3, - custbranch.braddress4, - custbranch.braddress5, - custbranch.braddress6, - custbranch.brpostaddr1, - custbranch.brpostaddr2, - custbranch.brpostaddr3, - custbranch.brpostaddr4, - custbranch.brpostaddr5, - custbranch.brpostaddr6, - salesman.salesmanname, - debtortrans.debtorno, - debtortrans.branchcode - FROM debtortrans, - debtorsmaster, - custbranch, - salesorders, - shippers, - salesman, - locations, - paymentterms - WHERE debtortrans.order_ = salesorders.orderno - AND debtortrans.type=10 - AND debtortrans.transno='" . $FromTransNo . "' - AND debtortrans.shipvia=shippers.shipper_id - AND debtortrans.debtorno=debtorsmaster.debtorno - AND debtorsmaster.paymentterms=paymentterms.termsindicator - AND debtortrans.debtorno=custbranch.debtorno - AND debtortrans.branchcode=custbranch.branchcode - AND custbranch.salesman=salesman.salesmancode - AND salesorders.fromstkloc=locations.loccode"; + debtortrans.ovamount, + debtortrans.ovdiscount, + debtortrans.ovfreight, + debtortrans.ovgst, + debtortrans.rate, + debtortrans.invtext, + debtortrans.consignment, + debtorsmaster.name, + debtorsmaster.address1, + debtorsmaster.address2, + debtorsmaster.address3, + debtorsmaster.address4, + debtorsmaster.address5, + debtorsmaster.address6, + debtorsmaster.currcode, + debtorsmaster.invaddrbranch, + debtorsmaster.taxref, + paymentterms.terms, + salesorders.deliverto, + salesorders.deladd1, + salesorders.deladd2, + salesorders.deladd3, + salesorders.deladd4, + salesorders.deladd5, + salesorders.deladd6, + salesorders.customerref, + salesorders.orderno, + salesorders.orddate, + locations.locationname, + shippers.shippername, + custbranch.brname, + custbranch.braddress1, + custbranch.braddress2, + custbranch.braddress3, + custbranch.braddress4, + custbranch.braddress5, + custbranch.braddress6, + custbranch.brpostaddr1, + custbranch.brpostaddr2, + custbranch.brpostaddr3, + custbranch.brpostaddr4, + custbranch.brpostaddr5, + custbranch.brpostaddr6, + salesman.salesmanname, + debtortrans.debtorno, + debtortrans.branchcode, + currencies.decimalplaces + FROM debtortrans INNER JOIN debtorsmaster + ON debtortrans.debtorno=debtorsmaster.debtorno + INNER JOIN custbranch + ON debtortrans.debtorno=custbranch.debtorno + AND debtortrans.branchcode=custbranch.branchcode + INNER JOIN salesorders + ON debtortrans.order_ = salesorders.orderno + INNER JOIN shippers + ON debtortrans.shipvia=shippers.shipper_id + INNER JOIN salesman + ON custbranch.salesman=salesman.salesmancode + INNER JOIN locations + ON salesorders.fromstkloc=locations.loccode + INNER JOIN paymentterms + ON debtorsmaster.paymentterms=paymentterms.termsindicator + INNER JOIN currencies + ON debtorsmaster.currcode=currencies.currabrev + WHERE debtortrans.type=10 + AND debtortrans.transno='" . $FromTransNo . "'"; - if (isset($_POST['PrintEDI']) and $_POST['PrintEDI']=='No'){ - $sql = $sql . ' AND debtorsmaster.ediinvoices=0'; + if (isset($_POST['PrintEDI']) and $_POST['PrintEDI']=='No') { + $sql = $sql . " AND debtorsmaster.ediinvoices=0"; } } else { - $sql = "SELECT debtortrans.trandate, - debtortrans.ovamount, - debtortrans.ovdiscount, - debtortrans.ovfreight, - debtortrans.ovgst, - debtortrans.rate, - debtortrans.invtext, - debtorsmaster.invaddrbranch, - debtorsmaster.name, - debtorsmaster.address1, - debtorsmaster.address2, - debtorsmaster.address3, - debtorsmaster.address4, - debtorsmaster.address5, - debtorsmaster.address6, - debtorsmaster.currcode, - debtorsmaster.taxref, - custbranch.brname, - custbranch.braddress1, - custbranch.braddress2, - custbranch.braddress3, - custbranch.braddress4, - custbranch.braddress5, - custbranch.braddress6, - custbranch.brpostaddr1, - custbranch.brpostaddr2, - custbranch.brpostaddr3, - custbranch.brpostaddr4, - custbranch.brpostaddr5, - custbranch.brpostaddr6, - salesman.salesmanname, - debtortrans.debtorno, - debtortrans.branchcode, - paymentterms.terms - FROM debtortrans, - debtorsmaster, - custbranch, - salesman, - paymentterms - WHERE debtortrans.type=11 - AND debtorsmaster.paymentterms = paymentterms.termsindicator - AND debtortrans.transno='" . $FromTransNo ."' - AND debtortrans.debtorno=debtorsmaster.debtorno - AND debtortrans.debtorno=custbranch.debtorno - AND debtortrans.branchcode=custbranch.branchcode - AND custbranch.salesman=salesman.salesmancode"; + debtortrans.ovamount, + debtortrans.ovdiscount, + debtortrans.ovfreight, + debtortrans.ovgst, + debtortrans.rate, + debtortrans.invtext, + debtorsmaster.invaddrbranch, + debtorsmaster.name, + debtorsmaster.address1, + debtorsmaster.address2, + debtorsmaster.address3, + debtorsmaster.address4, + debtorsmaster.address5, + debtorsmaster.address6, + debtorsmaster.currcode, + debtorsmaster.taxref, + custbranch.brname, + custbranch.braddress1, + custbranch.braddress2, + custbranch.braddress3, + custbranch.braddress4, + custbranch.braddress5, + custbranch.braddress6, + custbranch.brpostaddr1, + custbranch.brpostaddr2, + custbranch.brpostaddr3, + custbranch.brpostaddr4, + custbranch.brpostaddr5, + custbranch.brpostaddr6, + salesman.salesmanname, + debtortrans.debtorno, + debtortrans.branchcode, + paymentterms.terms, + currencies.decimalplaces + FROM debtortrans INNER JOIN debtorsmaster + ON debtortrans.debtorno=debtorsmaster.debtorno + INNER JOIN custbranch + ON debtortrans.debtorno=custbranch.debtorno + AND debtortrans.branchcode=custbranch.branchcode + INNER JOIN salesman + ON custbranch.salesman=salesman.salesmancode + INNER JOIN paymentterms + ON debtorsmaster.paymentterms=paymentterms.termsindicator + INNER JOIN currencies + ON debtorsmaster.currcode=currencies.currabrev + WHERE debtortrans.type=11 + AND debtortrans.transno='" . $FromTransNo . "'"; + if (isset($_POST['PrintEDI']) and $_POST['PrintEDI']=='No'){ $sql = $sql . ' AND debtorsmaster.ediinvoices=0'; } @@ -250,11 +254,11 @@ stockmoves.narrative, stockmaster.controlled, stockmaster.units, - stockmoves.stkmoveno - FROM stockmoves, - stockmaster - WHERE stockmoves.stockid = stockmaster.stockid - AND stockmoves.type=10 + stockmoves.stkmoveno, + stockmaster.decimalplaces + FROM stockmoves INNER JOIN stockmaster + ON stockmoves.stockid = stockmaster.stockid + WHERE stockmoves.type=10 AND stockmoves.transno='" . $FromTransNo . "' AND stockmoves.show_on_inv_crds=1"; } else { @@ -268,11 +272,11 @@ stockmoves.narrative, stockmaster.controlled, stockmaster.units, - stockmoves.stkmoveno - FROM stockmoves, - stockmaster - WHERE stockmoves.stockid = stockmaster.stockid - AND stockmoves.type=11 + stockmoves.stkmoveno, + stockmaster.decimalplaces + FROM stockmoves INNER JOIN stockmaster + ON stockmoves.stockid = stockmaster.stockid + WHERE stockmoves.type=11 AND stockmoves.transno='" . $FromTransNo . "' AND stockmoves.show_on_inv_crds=1"; } // end else @@ -305,9 +309,9 @@ $DisplayDiscount = number_format($myrow2['discountpercent'] * 100, 2) . '%'; $DiscountPrice = $myrow2['fxprice'] * (1 - $myrow2['discountpercent']); } - $DisplayNet = $myrow2['fxnet']; - $DisplayPrice = $myrow2['fxprice']; - $DisplayQty = $myrow2['quantity']; + $DisplayNet = number_format($myrow2['fxnet'],$myrow['decimalplaces']); + $DisplayPrice = number_format($myrow2['fxprice'],$myrow['decimalplaces']); + $DisplayQty = number_format($myrow2['quantity'],$myrow2['decimalplaces']); $LeftOvers = $pdf->addTextWrap($Left_Margin+5,$YPos,71,$FontSize,$myrow2['stockid']); $LeftOvers = $pdf->addTextWrap($Left_Margin+80,$YPos,186,$FontSize,$myrow2['description']); @@ -318,11 +322,11 @@ $lines++; } - $... [truncated message content] |
From: <dai...@us...> - 2011-07-16 02:55:52
|
Revision: 4631 http://web-erp.svn.sourceforge.net/web-erp/?rev=4631&view=rev Author: daintree Date: 2011-07-16 02:55:44 +0000 (Sat, 16 Jul 2011) Log Message: ----------- fix invoice/credit note printing Modified Paths: -------------- trunk/Credit_Invoice.php trunk/PrintCustTrans.php trunk/PrintCustTransPortrait.php Modified: trunk/Credit_Invoice.php =================================================================== --- trunk/Credit_Invoice.php 2011-07-14 10:27:29 UTC (rev 4630) +++ trunk/Credit_Invoice.php 2011-07-16 02:55:44 UTC (rev 4631) @@ -49,20 +49,20 @@ stockmoves.loccode, locations.taxprovinceid, currencies.decimalplaces - FROM debtortrans INNER JOIN debtorsmaster ON - debtortrans.debtorno = debtorsmaster.debtorno - INNER JOIN custbranch ON - debtortrans.branchcode = custbranch.branchcode - AND debtortrans.debtorno = custbranch.debtorno - INNER JOIN currencies ON - debtorsmaster.currcode = currencies.currabrev - INNER JOIN stockmoves ON - stockmoves.transno=debtortrans.transno - INNER JOIN locations ON - stockmoves.loccode = locations.loccode + FROM debtortrans INNER JOIN debtorsmaster + ON debtortrans.debtorno = debtorsmaster.debtorno + INNER JOIN custbranch + ON debtortrans.branchcode = custbranch.branchcode + AND debtortrans.debtorno = custbranch.debtorno + INNER JOIN currencies + ON debtorsmaster.currcode = currencies.currabrev + INNER JOIN stockmoves + ON stockmoves.transno=debtortrans.transno + AND stockmoves.type=debtortrans.type + INNER JOIN locations ON + stockmoves.loccode = locations.loccode WHERE debtortrans.transno = '" . $_GET['InvoiceNumber'] . "' - AND debtortrans.type=10 - AND stockmoves.type=10"; + AND stockmoves.type=10"; $ErrMsg = _('A credit cannot be produced for the selected invoice') . '. ' . _('The invoice details cannot be retrieved because'); $DbgMsg = _('The SQL used to retrieve the invoice details was'); @@ -533,10 +533,10 @@ /*Now need to update the invoice DebtorTrans record for the amount to be allocated and if the invoice is now settled*/ $SQL = "UPDATE debtortrans - SET alloc = alloc + " . $Allocate_amount . ", - settled='" . $SettledInvoice . "' - WHERE transno = '" . $_SESSION['ProcessingCredit'] . "' - AND type=10"; + SET alloc = alloc + " . $Allocate_amount . ", + settled='" . $SettledInvoice . "' + WHERE transno = '" . $_SESSION['ProcessingCredit'] . "' + AND type=10"; $ErrMsg = _('CRITICAL ERROR') . '! ' . _('NOTE DOWN THIS ERROR AND SEEK ASSISTANCE') . ': ' . _('The alteration to the invoice record to reflect the allocation of the credit note to the invoice could not be done because'); $DbgMsg = _('The following SQL to update the invoice allocation was used'); @@ -545,39 +545,39 @@ /*Now insert the Credit Note into the DebtorTrans table with the allocations as calculated above*/ $SQL = "INSERT INTO debtortrans (transno, - type, - debtorno, - branchcode, - trandate, - inputdate, - prd, - reference, - tpe, - order_, - ovamount, - ovgst, - ovfreight, - rate, - invtext, - alloc, - settled) - VALUES (". $CreditNo . ", - 11, - '" . $_SESSION['CreditItems']->DebtorNo . "', - '" . $_SESSION['CreditItems']->Branch . "', - '" . $DefaultDispatchDate . "', - '" . date('Y-m-d H-i-s') . "', - '" . $PeriodNo . "', - 'Inv-" . $_SESSION['ProcessingCredit'] . "', - '" . $_SESSION['CreditItems']->DefaultSalesType . "', - '" . $_SESSION['CreditItems']->OrderNo . "', - '" . -($_SESSION['CreditItems']->total) . "', - '" . -$TaxTotal . "', - '" . -$_SESSION['CreditItems']->FreightCost . "', - '" . $_SESSION['CurrencyRate'] . "', - '" . $_POST['CreditText'] . "', - '" . -$Allocate_amount . "', - '" . $Settled . "')"; + type, + debtorno, + branchcode, + trandate, + inputdate, + prd, + reference, + tpe, + order_, + ovamount, + ovgst, + ovfreight, + rate, + invtext, + alloc, + settled) + VALUES (". $CreditNo . ", + 11, + '" . $_SESSION['CreditItems']->DebtorNo . "', + '" . $_SESSION['CreditItems']->Branch . "', + '" . $DefaultDispatchDate . "', + '" . date('Y-m-d H-i-s') . "', + '" . $PeriodNo . "', + 'Inv-" . $_SESSION['ProcessingCredit'] . "', + '" . $_SESSION['CreditItems']->DefaultSalesType . "', + '" . $_SESSION['CreditItems']->OrderNo . "', + '" . -($_SESSION['CreditItems']->total) . "', + '" . -$TaxTotal . "', + '" . -$_SESSION['CreditItems']->FreightCost . "', + '" . $_SESSION['CurrencyRate'] . "', + '" . $_POST['CreditText'] . "', + '" . -$Allocate_amount . "', + '" . $Settled . "')"; $ErrMsg = _('CRITICAL ERROR') . '! ' . _('NOTE DOWN THIS ERROR AND SEEK ASSISTANCE') . ': ' . _('The customer credit note transaction could not be added to the database because'); $DbgMsg = _('The following SQL to insert the customer credit note was used'); @@ -620,16 +620,16 @@ /* Update sales order details quantity invoiced less this credit quantity. */ - foreach ($_SESSION['CreditItems']->LineItems as $OrderLine) { + foreach ($_SESSION['CreditItems']->LineItems as $CreditLine) { - if ($OrderLine->QtyDispatched >0){ - $LocalCurrencyPrice= round(($OrderLine->Price / $_SESSION['CurrencyRate']),$_SESSION['CompanyRecord']['decimalplaces']); + if ($CreditLine->QtyDispatched >0){ + $LocalCurrencyPrice= round(($CreditLine->Price / $_SESSION['CurrencyRate']),$_SESSION['CompanyRecord']['decimalplaces']); /*Determine the type of stock item being credited */ - $SQL = "SELECT mbflag FROM stockmaster WHERE stockid = '" . $OrderLine->StockID . "'"; + $SQL = "SELECT mbflag FROM stockmaster WHERE stockid = '" . $CreditLine->StockID . "'"; $Result = DB_query($SQL, $db, - _('Could not determine if the item') . ' ' . $OrderLine->StockID . ' ' . _('is purchased or manufactured'), + _('Could not determine if the item') . ' ' . $CreditLine->StockID . ' ' . _('is purchased or manufactured'), _('The SQL used that failed was'),true); $MBFlagRow = DB_fetch_row($Result); $MBFlag = $MBFlagRow[0]; @@ -637,7 +637,7 @@ /*Need to get the current location quantity will need it later for the stock movements */ $SQL="SELECT locstock.quantity FROM locstock - WHERE locstock.stockid='" . $OrderLine->StockID . "' + WHERE locstock.stockid='" . $CreditLine->StockID . "' AND loccode= '" . $_SESSION['CreditItems']->Location . "'"; $Result = DB_query($SQL, $db); if (DB_num_rows($Result)==1){ @@ -656,11 +656,11 @@ /* some want this some do not */ $SQL = "UPDATE salesorderdetails - SET qtyinvoiced = qtyinvoiced - " . $OrderLine->QtyDispatched . ", + SET qtyinvoiced = qtyinvoiced - " . $CreditLine->QtyDispatched . ", completed=0 WHERE orderno = '" . $_SESSION['CreditItems']->OrderNo . "' - AND stkcode = '" . $OrderLine->StockID . "' - AND orderlineno='" . $OrderLine->LineNumber."'"; + AND stkcode = '" . $CreditLine->StockID . "' + AND orderlineno='" . $CreditLine->LineNumber."'"; $ErrMsg = _('CRITICAL ERROR') . '! ' . _('NOTE DOWN THIS ERROR AND SEEK ASSISTANCE') . ': ' . _('The sales order detail record could not be updated for the reduced quantity invoiced because'); $DbgMsg = _('The following SQL to update the sales order detail record was used'); @@ -673,8 +673,8 @@ if ($MBFlag=='B' OR $MBFlag=='M') { $SQL = "UPDATE locstock - SET locstock.quantity = locstock.quantity + " . $OrderLine->QtyDispatched . " - WHERE locstock.stockid = '" . $OrderLine->StockID . "' + SET locstock.quantity = locstock.quantity + " . $CreditLine->QtyDispatched . " + WHERE locstock.stockid = '" . $CreditLine->StockID . "' AND loccode = '" . $_SESSION['CreditItems']->Location . "'"; $ErrMsg = _('CRITICAL ERROR') . '! ' . _('NOTE DOWN THIS ERROR AND SEEK ASSISTANCE') . ': ' . _('Location stock record could not be updated because'); @@ -695,11 +695,11 @@ FROM bom, stockmaster WHERE bom.component=stockmaster.stockid - AND bom.parent='" . $OrderLine->StockID . "' + AND bom.parent='" . $CreditLine->StockID . "' AND bom.effectiveto > '" . Date('Y-m-d') . "' AND bom.effectiveafter < '" . Date('Y-m-d') . "'"; - $ErrMsg = _('Could not retrieve assembly components from the database for') . ' ' . $OrderLine->StockID . ' ' . _('because'); + $ErrMsg = _('Could not retrieve assembly components from the database for') . ' ' . $CreditLine->StockID . ' ' . _('because'); $DbgMsg = _('The SQL that failed was'); $AssResult = DB_query($sql,$db, $ErrMsg, $DbgMsg, true); @@ -758,11 +758,11 @@ '" . $_SESSION['CreditItems']->DebtorNo . "', '" . $_SESSION['CreditItems']->Branch . "', '" . $PeriodNo . "', - '" . _('Ex Inv') . ': ' . $_SESSION['ProcessingCredit'] . ' ' . _('Assembly') . ': ' . $OrderLine->StockID . "', - '" . $AssParts['quantity'] * $OrderLine->QtyDispatched . "', + '" . _('Ex Inv') . ': ' . $_SESSION['ProcessingCredit'] . ' ' . _('Assembly') . ': ' . $CreditLine->StockID . "', + '" . $AssParts['quantity'] * $CreditLine->QtyDispatched . "', '" . $AssParts['standard'] . "', 0, - '" . ($QtyOnHandPrior + ($AssParts['quantity'] * $OrderLine->QtyDispatched)) . "' + '" . ($QtyOnHandPrior + ($AssParts['quantity'] * $CreditLine->QtyDispatched)) . "' )"; } else { @@ -787,19 +787,19 @@ '" . $_SESSION['CreditItems']->DebtorNo . "', '" . $_SESSION['CreditItems']->Branch . "', '" . $PeriodNo . "', - '" . _('Ex Inv') . ': ' . $_SESSION['ProcessingCredit'] . ' ' . _('Assembly') . ': ' . $OrderLine->StockID . "', - '" . $AssParts['quantity'] * $OrderLine->QtyDispatched . "', + '" . _('Ex Inv') . ': ' . $_SESSION['ProcessingCredit'] . ' ' . _('Assembly') . ': ' . $CreditLine->StockID . "', + '" . $AssParts['quantity'] * $CreditLine->QtyDispatched . "', '" . $AssParts['standard'] . "', 0)"; } - $ErrMsg = _('CRITICAL ERROR') . '! ' . _('NOTE DOWN THIS ERROR AND SEEK ASSISTANCE') . ': ' . _('Stock movement records for the assembly components of') .' ' . $OrderLine->StockID . ' ' . _('could not be inserted because'); + $ErrMsg = _('CRITICAL ERROR') . '! ' . _('NOTE DOWN THIS ERROR AND SEEK ASSISTANCE') . ': ' . _('Stock movement records for the assembly components of') .' ' . $CreditLine->StockID . ' ' . _('could not be inserted because'); $DbgMsg = _('The following SQL to insert the assembly components stock movement records was used'); $Result = DB_query($SQL, $db, $ErrMsg, $DbgMsg, true); if ($Component_MBFlag=="M" OR $Component_MBFlag=="B"){ $SQL = "UPDATE locstock - SET locstock.quantity = locstock.quantity + " . $AssParts['quantity'] * $OrderLine->QtyDispatched . " + SET locstock.quantity = locstock.quantity + " . $AssParts['quantity'] * $CreditLine->QtyDispatched . " WHERE locstock.stockid = '" . $AssParts['component'] . "' AND loccode = '" . $_SESSION['CreditItems']->Location . "'"; @@ -813,8 +813,8 @@ } } /* end of assembly explosion and updates */ /*Update the cart with the recalculated standard cost from the explosion of the assembly's components*/ - $_SESSION['CreditItems']->LineItems[$OrderLine->LineNumber]->StandardCost = $StandardCost; - $OrderLine->StandardCost = $StandardCost; + $_SESSION['CreditItems']->LineItems[$CreditLine->LineNumber]->StandardCost = $StandardCost; + $CreditLine->StandardCost = $StandardCost; } /* Insert stock movements for the stock coming back in - with unit cost */ @@ -836,7 +836,7 @@ standardcost, newqoh, narrative) - VALUES ('" . $OrderLine->StockID . "', + VALUES ('" . $CreditLine->StockID . "', 11, '" . $CreditNo . "', '" . $_SESSION['CreditItems']->Location . "', @@ -846,11 +846,11 @@ '" . $LocalCurrencyPrice . "', '" . $PeriodNo . "', '" . _('Ex Inv') .' - ' . $_SESSION['ProcessingCredit'] . "', - '" . $OrderLine->QtyDispatched . "', - '" . $OrderLine->DiscountPercent . "', - '" . $OrderLine->StandardCost . "', - '" . ($QtyOnHandPrior + $OrderLine->QtyDispatched) . "', - '" . $OrderLine->Narrative . "')"; + '" . $CreditLine->QtyDispatched . "', + '" . $CreditLine->DiscountPercent . "', + '" . $CreditLine->StandardCost . "', + '" . ($QtyOnHandPrior + $CreditLine->QtyDispatched) . "', + '" . $CreditLine->Narrative . "')"; } else { $SQL = "INSERT INTO stockmoves ( @@ -868,7 +868,7 @@ discountpercent, standardcost, narrative) - VALUES ('" . $OrderLine->StockID . "', + VALUES ('" . $CreditLine->StockID . "', 11, '" . $CreditNo . "', '" . $_SESSION['CreditItems']->Location . "', @@ -878,10 +878,10 @@ '" . $LocalCurrencyPrice . "', '" . $PeriodNo . "', '" . _('Ex Inv') . " - " . $_SESSION['ProcessingCredit'] . "', - '" . $OrderLine->QtyDispatched . "', - '" . $OrderLine->DiscountPercent . "', - '" . $OrderLine->StandardCost . "', - '" . $OrderLine->Narrative . "' + '" . $CreditLine->QtyDispatched . "', + '" . $CreditLine->DiscountPercent . "', + '" . $CreditLine->StandardCost . "', + '" . $CreditLine->Narrative . "' )"; } @@ -891,12 +891,12 @@ $StkMoveNo = DB_Last_Insert_ID($db,'stockmoves','stkmoveno'); /*Insert the StockSerialMovements and update the StockSerialItems for controlled items*/ - //echo "<div align=left><pre>"; var_dump($OrderLine); echo "</pre> </div>"; - if ($OrderLine->Controlled ==1){ - foreach($OrderLine->SerialItems as $Item){ + //echo "<div align=left><pre>"; var_dump($CreditLine); echo "</pre> </div>"; + if ($CreditLine->Controlled ==1){ + foreach($CreditLine->SerialItems as $Item){ /*We need to add the StockSerialItem record and The StockSerialMoves as well */ $SQL = "SELECT quantity from stockserialitems - WHERE stockid='" . $OrderLine->StockID . "' + WHERE stockid='" . $CreditLine->StockID . "' AND loccode='" . $_SESSION['CreditItems']->Location . "' AND serialno='" . $Item->BundleRef . "'"; @@ -910,7 +910,7 @@ serialno, quantity) VALUES - ('" . $OrderLine->StockID . "', + ('" . $CreditLine->StockID . "', '" . $_SESSION['CreditItems']->Location . "', '" . $Item->BundleRef . "', '". $Item->BundleQty ."')"; @@ -922,7 +922,7 @@ $SQL = "UPDATE stockserialitems SET quantity= quantity + " . $Item->BundleQty . " - WHERE stockid='" . $OrderLine->StockID . "' + WHERE stockid='" . $CreditLine->StockID . "' AND loccode='" . $_SESSION['CreditItems']->Location . "' AND serialno='" . $Item->BundleRef . "'"; $ErrMsg = _('CRITICAL ERROR') . '! ' . _('NOTE DOWN THIS ERROR AND SEEK ASSISTANCE') . ': ' . _('The serial stock item record could not be updated because'); @@ -937,7 +937,7 @@ serialno, moveqty) VALUES ('" . $StkMoveNo . "', - '" . $OrderLine->StockID . "', + '" . $CreditLine->StockID . "', '" . $Item->BundleRef . "', '" . $Item->BundleQty . "')"; $ErrMsg = _('CRITICAL ERROR') . '! ' . _('NOTE DOWN THIS ERROR AND SEEK ASSISTANCE') . ': ' . _('The serial stock movement record could not be inserted because'); @@ -968,7 +968,7 @@ standardcost, newqoh, narrative ) - VALUES ('" . $OrderLine->StockID . "', + VALUES ('" . $CreditLine->StockID . "', 11, '" . $CreditNo . "', '" . $_SESSION['CreditItems']->Location . "', @@ -978,11 +978,11 @@ '" . $LocalCurrencyPrice . "', '" . $PeriodNo . "', '" . _('Ex Inv') . ' - ' . $_SESSION['ProcessingCredit'] . "', - '" . $OrderLine->QtyDispatched . "', - '" . $OrderLine->DiscountPercent . "', - '" . $OrderLine->StandardCost . "', - '" . ($QtyOnHandPrior +$OrderLine->QtyDispatched) . "', - '" . $OrderLine->Narrative . "')"; + '" . $CreditLine->QtyDispatched . "', + '" . $CreditLine->DiscountPercent . "', + '" . $CreditLine->StandardCost . "', + '" . ($QtyOnHandPrior +$CreditLine->QtyDispatched) . "', + '" . $CreditLine->Narrative . "')"; $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'); @@ -1006,7 +1006,7 @@ newqoh, narrative ) - VALUES ('" . $OrderLine->StockID . "', + VALUES ('" . $CreditLine->StockID . "', 11, '" . $CreditNo . "', '" . $_SESSION['CreditItems']->Location . "', @@ -1016,12 +1016,12 @@ '" . $LocalCurrencyPrice . "', '" . $PeriodNo . "', '" . _('Written off ex Inv') . ' - ' . $_SESSION['ProcessingCredit'] . "', - '" . -$OrderLine->QtyDispatched . "', - '" . $OrderLine->DiscountPercent . "', - '" . $OrderLine->StandardCost . "', + '" . -$CreditLine->QtyDispatched . "', + '" . $CreditLine->DiscountPercent . "', + '" . $CreditLine->StandardCost . "', 0, '" . $QtyOnHandPrior . "', - '" . $OrderLine->Narrative . "')"; + '" . $CreditLine->Narrative . "')"; $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'); @@ -1046,7 +1046,7 @@ newqoh, hidemovt, narrative) - VALUES ('" . $OrderLine->StockID . "', + VALUES ('" . $CreditLine->StockID . "', 11, '" . $CreditNo . "', '" . $_SESSION['CreditItems']->Location . "', @@ -1056,12 +1056,12 @@ '" . $LocalCurrencyPrice . "', '" . $PeriodNo . "', '" . _('Ex Inv') .' - ' . $_SESSION['ProcessingCredit'] . "', - '" . $OrderLine->QtyDispatched . "', - '" . $OrderLine->DiscountPercent . "', - '" . $OrderLine->StandardCost . "', + '" . $CreditLine->QtyDispatched . "', + '" . $CreditLine->DiscountPercent . "', + '" . $CreditLine->StandardCost . "', '" . $QtyOnHandPrior . "', 1, - '" . $OrderLine->Narrative . "')"; + '" . $CreditLine->Narrative . "')"; $ErrMsg = _('CRITICAL ERROR') . '! ' . _('NOTE DOWN THIS ERROR AND SEEK ASSISTANCE') . ': ' . _('Stock movement records could not be inserted because'); @@ -1074,7 +1074,7 @@ $StkMoveNo = DB_Last_Insert_ID($db,'stockmoves','stkmoveno'); /*Insert the taxes that applied to this line */ - foreach ($OrderLine->Taxes as $Tax) { + foreach ($CreditLine->Taxes as $Tax) { $SQL = "INSERT INTO stockmovestaxes (stkmoveno, taxauthid, @@ -1111,7 +1111,7 @@ AND periodno='" . $PeriodNo . "' AND cust = '" . $_SESSION['CreditItems']->DebtorNo . "' AND custbranch = '" . $_SESSION['CreditItems']->Branch . "' - AND salesanalysis.stockid = '" . $OrderLine->StockID . "' + AND salesanalysis.stockid = '" . $CreditLine->StockID . "' AND budgetoractual=1 GROUP BY stkcategory, salesanalysis.area, salesperson"; @@ -1127,32 +1127,32 @@ if ($_POST['CreditType']=='ReverseOverCharge'){ $SQL = "UPDATE salesanalysis - SET amt=amt-" . ($OrderLine->Price * $OrderLine->QtyDispatched / $_SESSION['CurrencyRate']) . ", - disc=disc-" . ($OrderLine->DiscountPercent * $OrderLine->Price * $OrderLine->QtyDispatched / $_SESSION['CurrencyRate']) . " + SET amt=amt-" . ($CreditLine->Price * $CreditLine->QtyDispatched / $_SESSION['CurrencyRate']) . ", + disc=disc-" . ($CreditLine->DiscountPercent * $CreditLine->Price * $CreditLine->QtyDispatched / $_SESSION['CurrencyRate']) . " WHERE salesanalysis.area='" . $myrow[2] . "' AND salesanalysis.salesperson='" . $myrow[3] . "' AND typeabbrev ='" . $_SESSION['CreditItems']->DefaultSalesType . "' AND periodno = '" . $PeriodNo . "' AND cust = '" . $_SESSION['CreditItems']->DebtorNo . "' AND custbranch = '" . $_SESSION['CreditItems']->Branch . "' - AND stockid = '" . $OrderLine->StockID . "' + AND stockid = '" . $CreditLine->StockID . "' AND salesanalysis.stkcategory ='" . $myrow[1] . "' AND budgetoractual=1"; } else { $SQL = "UPDATE salesanalysis - SET amt=amt-" . ($OrderLine->Price * $OrderLine->QtyDispatched / $_SESSION['CurrencyRate']) . ", - cost=cost-" . ($OrderLine->StandardCost * $OrderLine->QtyDispatched) . ", - qty=qty-" . $OrderLine->QtyDispatched . ", - disc=disc-" . ($OrderLine->DiscountPercent * $OrderLine->Price * $OrderLine->QtyDispatched / $_SESSION['CurrencyRate']) . " + SET amt=amt-" . ($CreditLine->Price * $CreditLine->QtyDispatched / $_SESSION['CurrencyRate']) . ", + cost=cost-" . ($CreditLine->StandardCost * $CreditLine->QtyDispatched) . ", + qty=qty-" . $CreditLine->QtyDispatched . ", + disc=disc-" . ($CreditLine->DiscountPercent * $CreditLine->Price * $CreditLine->QtyDispatched / $_SESSION['CurrencyRate']) . " WHERE salesanalysis.area='" . $myrow[2] . "' AND salesanalysis.salesperson='" . $myrow[3] . "' AND typeabbrev ='" . $_SESSION['CreditItems']->DefaultSalesType . "' AND periodno = '" . $PeriodNo . "' AND cust = '" . $_SESSION['CreditItems']->DebtorNo . "' AND custbranch = '" . $_SESSION['CreditItems']->Branch . "' - AND stockid = '" . $OrderLine->StockID . "' + AND stockid = '" . $CreditLine->StockID . "' AND salesanalysis.stkcategory ='" . $myrow[1] . "' AND budgetoractual=1"; } @@ -1175,19 +1175,19 @@ stkcategory) SELECT '" . $_SESSION['CreditItems']->DefaultSalesType . "', '" . $PeriodNo . "', - '" . -($OrderLine->Price * $OrderLine->QtyDispatched / $_SESSION['CurrencyRate']) . "', + '" . -($CreditLine->Price * $CreditLine->QtyDispatched / $_SESSION['CurrencyRate']) . "', '" . $_SESSION['CreditItems']->DebtorNo . "', '" . $_SESSION['CreditItems']->Branch . "', 0, - '" . -($OrderLine->DiscountPercent * $OrderLine->Price * $OrderLine->QtyDispatched / $_SESSION['CurrencyRate']) . "', - '" . $OrderLine->StockID . "', + '" . -($CreditLine->DiscountPercent * $CreditLine->Price * $CreditLine->QtyDispatched / $_SESSION['CurrencyRate']) . "', + '" . $CreditLine->StockID . "', custbranch.area, 1, custbranch.salesman, stockmaster.categoryid FROM stockmaster, custbranch - WHERE stockmaster.stockid = '" . $OrderLine->StockID . "' + WHERE stockmaster.stockid = '" . $CreditLine->StockID . "' AND custbranch.debtorno = '" . $_SESSION['CreditItems']->DebtorNo . "' AND custbranch.branchcode='" . $_SESSION['CreditItems']->Branch . "'"; } else { @@ -1207,20 +1207,20 @@ stkcategory) SELECT '" . $_SESSION['CreditItems']->DefaultSalesType . "', '" . $PeriodNo . "', - '" . -($OrderLine->Price * $OrderLine->QtyDispatched / $_SESSION['CurrencyRate']) . "', - '" . -($OrderLine->StandardCost * $OrderLine->QtyDispatched) . "', + '" . -($CreditLine->Price * $CreditLine->QtyDispatched / $_SESSION['CurrencyRate']) . "', + '" . -($CreditLine->StandardCost * $CreditLine->QtyDispatched) . "', '" . $_SESSION['CreditItems']->DebtorNo . "', '" . $_SESSION['CreditItems']->Branch . "', - '" . -$OrderLine->QtyDispatched . "', - '" . -($OrderLine->DiscountPercent * $OrderLine->Price * $OrderLine->QtyDispatched / $_SESSION['CurrencyRate']) . "', - '" . $OrderLine->StockID . "', + '" . -$CreditLine->QtyDispatched . "', + '" . -($CreditLine->DiscountPercent * $CreditLine->Price * $CreditLine->QtyDispatched / $_SESSION['CurrencyRate']) . "', + '" . $CreditLine->StockID . "', custbranch.area, 1, custbranch.salesman, stockmaster.categoryid FROM stockmaster, custbranch - WHERE stockmaster.stockid = '" . $OrderLine->StockID . "' + WHERE stockmaster.stockid = '" . $CreditLine->StockID . "' AND custbranch.debtorno = '" . $_SESSION['CreditItems']->DebtorNo . "' AND custbranch.branchcode='" . $_SESSION['CreditItems']->Branch . "'"; @@ -1235,12 +1235,12 @@ /* If GLLink_Stock then insert GLTrans to credit stock and debit cost of sales at standard cost*/ if ($_SESSION['CompanyRecord']['gllink_stock']==1 - AND ($OrderLine->StandardCost !=0 OR (isset($StandardCost) and $StandardCost !=0)) + AND ($CreditLine->StandardCost !=0 OR (isset($StandardCost) and $StandardCost !=0)) AND $_POST['CreditType']!='ReverseOverCharge'){ /*first the cost of sales entry*/ - $COGSAccount = GetCOGSGLAccount($Area, $OrderLine->StockID, $_SESSION['CreditItems']->DefaultSalesType, $db); + $COGSAccount = GetCOGSGLAccount($Area, $CreditLine->StockID, $_SESSION['CreditItems']->DefaultSalesType, $db); $SQL = "INSERT INTO gltrans (type, typeno, @@ -1254,8 +1254,8 @@ '" . $DefaultDispatchDate . "', '" . $PeriodNo . "', '" . $COGSAccount . "', - '" . $_SESSION['CreditItems']->DebtorNo . " - " . $OrderLine->StockID . " x " . $OrderLine->QtyDispatched . " @ " . $OrderLine->StandardCost . "', - '" . -round($OrderLine->StandardCost * $OrderLine->QtyDispatched,$_SESSION['CompanyRecord']['decimalplaces']) . "' + '" . $_SESSION['CreditItems']->DebtorNo . " - " . $CreditLine->StockID . " x " . $CreditLine->QtyDispatched . " @ " . $CreditLine->StandardCost . "', + '" . -round($CreditLine->StandardCost * $CreditLine->QtyDispatched,$_SESSION['CompanyRecord']['decimalplaces']) . "' )"; $ErrMsg = _('CRITICAL ERROR') . '! ' . _('NOTE DOWN THIS ERROR AND SEEK ASSISTANCE') . ': ' . _('The cost of sales GL posting could not be inserted because'); @@ -1278,10 +1278,10 @@ '" . $DefaultDispatchDate . "', '" . $PeriodNo . "', '" . $_POST['WriteOffGLCode'] . "', - '" . $_SESSION['CreditItems']->DebtorNo . " - " . $OrderLine->StockID . " x " . $OrderLine->QtyDispatched . " @ " . $OrderLine->StandardCost . "', - '" . round($OrderLine->StandardCost * $OrderLine->QtyDispatched,$_SESSION['CompanyRecord']['decimalplaces']) . "')"; + '" . $_SESSION['CreditItems']->DebtorNo . " - " . $CreditLine->StockID . " x " . $CreditLine->QtyDispatched . " @ " . $CreditLine->StandardCost . "', + '" . round($CreditLine->StandardCost * $CreditLine->QtyDispatched,$_SESSION['CompanyRecord']['decimalplaces']) . "')"; } else { - $StockGLCode = GetStockGLCode($OrderLine->StockID, $db); + $StockGLCode = GetStockGLCode($CreditLine->StockID, $db); $SQL = "INSERT INTO gltrans (type, typeno, trandate, @@ -1294,8 +1294,8 @@ '" . $DefaultDispatchDate . "', '" . $PeriodNo . "', '" . $StockGLCode['stockact'] . "', - '" . $_SESSION['CreditItems']->DebtorNo . " - " . $OrderLine->StockID . " x " . $OrderLine->QtyDispatched . " @ " . $OrderLine->StandardCost . "', - '" . round($OrderLine->StandardCost * $OrderLine->QtyDispatched,$_SESSION['CompanyRecord']['decimalplaces']) . "')"; + '" . $_SESSION['CreditItems']->DebtorNo . " - " . $CreditLine->StockID . " x " . $CreditLine->QtyDispatched . " @ " . $CreditLine->StandardCost . "', + '" . round($CreditLine->StandardCost * $CreditLine->QtyDispatched,$_SESSION['CompanyRecord']['decimalplaces']) . "')"; } $ErrMsg = _('CRITICAL ERROR') . '! ' . _('NOTE DOWN THIS ERROR AND SEEK ASSISTANCE') . ': ' . _('The stock side or write off of the cost of sales GL posting could not be inserted because'); @@ -1304,10 +1304,10 @@ } /* end of if GL and stock integrated and standard cost !=0 */ - if ($_SESSION['CompanyRecord']['gllink_debtors']==1 AND $OrderLine->Price !=0){ + if ($_SESSION['CompanyRecord']['gllink_debtors']==1 AND $CreditLine->Price !=0){ //Post sales transaction to GL credit sales - $SalesGLAccounts = GetSalesGLAccount($Area, $OrderLine->StockID, $_SESSION['CreditItems']->DefaultSalesType, $db); + $SalesGLAccounts = GetSalesGLAccount($Area, $CreditLine->StockID, $_SESSION['CreditItems']->DefaultSalesType, $db); $SQL = "INSERT INTO gltrans (type, typeno, @@ -1321,15 +1321,15 @@ '" . $DefaultDispatchDate . "', '" . $PeriodNo . "', '" . $SalesGLAccounts['salesglcode'] . "', - '" . $_SESSION['CreditItems']->DebtorNo . " - " . $OrderLine->StockID . " x " . $OrderLine->QtyDispatched . " @ " . $OrderLine->Price . "', - '" . round(($OrderLine->Price * $OrderLine->QtyDispatched)/$_SESSION['CurrencyRate'],$_SESSION['CompanyRecord']['decimalplaces']) . "' + '" . $_SESSION['CreditItems']->DebtorNo . " - " . $CreditLine->StockID . " x " . $CreditLine->QtyDispatched . " @ " . $CreditLine->Price . "', + '" . round(($CreditLine->Price * $CreditLine->QtyDispatched)/$_SESSION['CurrencyRate'],$_SESSION['CompanyRecord']['decimalplaces']) . "' )"; $ErrMsg = _('CRITICAL ERROR') . '! ' . _('NOTE DOWN THIS ERROR AND SEEK ASSISTANCE') . ': ' . _('The credit note GL posting could not be inserted because'); $DbgMsg = _('The following SQL to insert the GLTrans record was used'); $Result = DB_query($SQL,$db,$ErrMsg, $DbgMsg, true); - if ($OrderLine->DiscountPercent !=0){ + if ($CreditLine->DiscountPercent !=0){ $SQL = "INSERT INTO gltrans (type, typeno, @@ -1343,8 +1343,8 @@ '" . $DefaultDispatchDate . "', '" . $PeriodNo . "', '" . $SalesGLAccounts['discountglcode'] . "', - '" . $_SESSION['CreditItems']->DebtorNo . " - " . $OrderLine->StockID . " @ " . ($OrderLine->DiscountPercent * 100) . "%', - '" . -round(($OrderLine->Price * $OrderLine->QtyDispatched * $OrderLine->DiscountPercent)/$_SESSION['CurrencyRate'],$_SESSION['CompanyRecord']['decimalplaces']) . "' + '" . $_SESSION['CreditItems']->DebtorNo . " - " . $CreditLine->StockID . " @ " . ($CreditLine->DiscountPercent * 100) . "%', + '" . -round(($CreditLine->Price * $CreditLine->QtyDispatched * $CreditLine->DiscountPercent)/$_SESSION['CurrencyRate'],$_SESSION['CompanyRecord']['decimalplaces']) . "' )"; $ErrMsg = _('CRITICAL ERROR') . '! ' . _('NOTE DOWN THIS ERROR AND SEEK ASSISTANCE') . ': ' . _('The credit note discount GL posting could not be inserted because'); $DbgMsg = _('The following SQL to insert the GLTrans record was used'); Modified: trunk/PrintCustTrans.php =================================================================== --- trunk/PrintCustTrans.php 2011-07-14 10:27:29 UTC (rev 4630) +++ trunk/PrintCustTrans.php 2011-07-16 02:55:44 UTC (rev 4631) @@ -125,25 +125,27 @@ custbranch.brpostaddr6, salesman.salesmanname, debtortrans.debtorno, - debtortrans.branchcode - FROM debtortrans, - debtorsmaster, - custbranch, - salesorders, - shippers, - salesman, - locations, - paymentterms - WHERE debtortrans.order_ = salesorders.orderno - AND debtortrans.type=10 - AND debtortrans.transno='" . $FromTransNo . "' - AND debtortrans.shipvia=shippers.shipper_id - AND debtortrans.debtorno=debtorsmaster.debtorno - AND debtorsmaster.paymentterms=paymentterms.termsindicator - AND debtortrans.debtorno=custbranch.debtorno + debtortrans.branchcode, + currencies.decimalplaces + FROM debtortrans INNER JOIN debtorsmaster + ON debtortrans.debtorno=debtorsmaster.debtorno + INNER JOIN custbranch + ON debtortrans.debtorno=custbranch.debtorno AND debtortrans.branchcode=custbranch.branchcode - AND custbranch.salesman=salesman.salesmancode - AND salesorders.fromstkloc=locations.loccode"; + INNER JOIN salesorders + ON debtortrans.order_ = salesorders.orderno + INNER JOIN shippers + ON debtortrans.shipvia=shippers.shipper_id + INNER JOIN salesman + ON custbranch.salesman=salesman.salesmancode + INNER JOIN locations + ON salesorders.fromstkloc=locations.loccode + INNER JOIN paymentterms + ON debtorsmaster.paymentterms=paymentterms.termsindicator + INNER JOIN currencies + ON debtorsmaster.currcode=currencies.currabrev + WHERE debtortrans.type=10 + AND debtortrans.transno='" . $FromTransNo . "'"; if (isset($_POST['PrintEDI']) and $_POST['PrintEDI']=='No') { $sql = $sql . " AND debtorsmaster.ediinvoices=0"; @@ -182,19 +184,21 @@ salesman.salesmanname, debtortrans.debtorno, debtortrans.branchcode, - paymentterms.terms - FROM debtortrans, - debtorsmaster, - custbranch, - salesman, - paymentterms + paymentterms.terms, + currencies.decimalplaces + FROM debtortrans INNER JOIN debtorsmaster + ON debtortrans.debtorno=debtorsmaster.debtorno + INNER JOIN custbranch + ON debtortrans.debtorno=custbranch.debtorno + AND debtortrans.branchcode=custbranch.branchcode + INNER JOIN salesman + ON custbranch.salesman=salesman.salesmancode + INNER JOIN paymentterms + ON debtorsmaster.paymentterms=paymentterms.termsindicator + INNER JOIN currencies + ON debtorsmaster.currcode=currencies.currabrev WHERE debtortrans.type=11 - AND debtorsmaster.paymentterms = paymentterms.termsindicator - AND debtortrans.transno='" . $FromTransNo . "' - AND debtortrans.debtorno=debtorsmaster.debtorno - AND debtortrans.debtorno=custbranch.debtorno - AND debtortrans.branchcode=custbranch.branchcode - AND custbranch.salesman=salesman.salesmancode"; + AND debtortrans.transno='" . $FromTransNo . "'"; if ($_POST['PrintEDI']=='No') { $sql = $sql . " AND debtorsmaster.ediinvoices=0"; @@ -225,7 +229,8 @@ ((1 - stockmoves.discountpercent) * stockmoves.price * " . $ExchRate . "* -stockmoves.qty) AS fxnet, (stockmoves.price * " . $ExchRate . ") AS fxprice, stockmoves.narrative, - stockmaster.units + stockmaster.units, + stockmaster.decimalplaces FROM stockmoves, stockmaster WHERE stockmoves.stockid = stockmaster.stockid @@ -241,7 +246,8 @@ ((1 - stockmoves.discountpercent) * stockmoves.price * " . $ExchRate . " * stockmoves.qty) AS fxnet, (stockmoves.price * " . $ExchRate . ") AS fxprice, stockmoves.narrative, - stockmaster.units + stockmaster.units, + stockmaster.decimalplaces FROM stockmoves, stockmaster WHERE stockmoves.stockid = stockmaster.stockid @@ -277,9 +283,9 @@ $DisplayDiscount = number_format($myrow2['discountpercent']*100,2) . '%'; $DiscountPrice=$myrow2['fxprice']*(1-$myrow2['discountpercent']); } - $DisplayNet=number_format($myrow2['fxnet'],2); - $DisplayPrice=number_format($myrow2['fxprice'],3); - $DisplayQty=$myrow2['quantity']; + $DisplayNet=number_format($myrow2['fxnet'],$myrow['decimalplaces']); + $DisplayPrice=number_format($myrow2['fxprice'],$myrow['decimalplaces']); + $DisplayQty=number_format($myrow2['quantity'],$myrow2['decimalplaces']); $LeftOvers = $pdf->addTextWrap($Left_Margin+3,$YPos,95,$FontSize,$myrow2['stockid']); $LeftOvers = $pdf->addTextWrap($Left_Margin+100,$YPos,123,$FontSize,$myrow2['description']); @@ -351,17 +357,17 @@ if ($InvOrCredit=='Invoice') { - $DisplaySubTot = number_format($myrow['ovamount'],2); - $DisplayFreight = number_format($myrow['ovfreight'],2); - $DisplayTax = number_format($myrow['ovgst'],2); - $DisplayTotal = number_format($myrow['ovfreight']+$myrow['ovgst']+$myrow['ovamount'],2); + $DisplaySubTot = number_format($myrow['ovamount'],$myrow['decimalplaces']); + $DisplayFreight = number_format($myrow['ovfreight'],$myrow['decimalplaces']); + $DisplayTax = number_format($myrow['ovgst'],$myrow['decimalplaces']); + $DisplayTotal = number_format($myrow['ovfreight']+$myrow['ovgst']+$myrow['ovamount'],$myrow['decimalplaces']); } else { - $DisplaySubTot = number_format(-$myrow['ovamount'],2); - $DisplayFreight = number_format(-$myrow['ovfreight'],2); - $DisplayTax = number_format(-$myrow['ovgst'],2); - $DisplayTotal = number_format(-$myrow['ovfreight']-$myrow['ovgst']-$myrow['ovamount'],2); + $DisplaySubTot = number_format(-$myrow['ovamount'],$myrow['decimalplaces']); + $DisplayFreight = number_format(-$myrow['ovfreight'],$myrow['decimalplaces']); + $DisplayTax = number_format(-$myrow['ovgst'],$myrow['decimalplaces']); + $DisplayTotal = number_format(-$myrow['ovfreight']-$myrow['ovgst']-$myrow['ovamount'],$myrow['decimalplaces']); } /* Print out the invoice text entered */ $YPos = $Bottom_Margin+(3*$line_height); @@ -559,93 +565,102 @@ if ($InvOrCredit=='Invoice') { - $sql = "SELECT - debtortrans.trandate, - debtortrans.ovamount, - debtortrans.ovdiscount, - debtortrans.ovfreight, - debtortrans.ovgst, - debtortrans.rate, - debtortrans.invtext, - debtortrans.consignment, - debtorsmaster.name, - debtorsmaster.address1, - debtorsmaster.address2, - debtorsmaster.address3, - debtorsmaster.address4, - debtorsmaster.address5, - debtorsmaster.address6, - debtorsmaster.currcode, - salesorders.deliverto, - salesorders.deladd1, - salesorders.deladd2, - salesorders.deladd3, - salesorders.deladd4, - salesorders.deladd5, - salesorders.deladd6, - salesorders.customerref, - salesorders.orderno, - salesorders.orddate, - shippers.shippername, - custbranch.brname, - custbranch.braddress1, - custbranch.braddress2, - custbranch.braddress3, - custbranch.braddress4, - custbranch.braddress5, - custbranch.braddress6, - salesman.salesmanname, - debtortrans.debtorno - FROM debtortrans, - debtorsmaster, - custbranch, - salesorders, - shippers, - salesman - WHERE debtortrans.order_ = salesorders.orderno - AND debtortrans.type=10 - AND debtortrans.transno='" . $FromTransNo . "' - AND debtortrans.shipvia=shippers.shipper_id - AND debtortrans.debtorno=debtorsmaster.debtorno - AND debtortrans.debtorno=custbranch.debtorno - AND debtortrans.branchcode=custbranch.branchcode - AND custbranch.salesman=salesman.salesmancode"; + $sql = "SELECT debtortrans.trandate, + debtortrans.ovamount, + debtortrans.ovdiscount, + debtortrans.ovfreight, + debtortrans.ovgst, + debtortrans.rate, + debtortrans.invtext, + debtortrans.consignment, + debtorsmaster.name, + debtorsmaster.address1, + debtorsmaster.address2, + debtorsmaster.address3, + debtorsmaster.address4, + debtorsmaster.address5, + debtorsmaster.address6, + debtorsmaster.currcode, + salesorders.deliverto, + salesorders.deladd1, + salesorders.deladd2, + salesorders.deladd3, + salesorders.deladd4, + salesorders.deladd5, + salesorders.deladd6, + salesorders.customerref, + salesorders.orderno, + salesorders.orddate, + shippers.shippername, + custbranch.brname, + custbranch.braddress1, + custbranch.braddress2, + custbranch.braddress3, + custbranch.braddress4, + custbranch.braddress5, + custbranch.braddress6, + salesman.salesmanname, + debtortrans.debtorno, + currencies.decimalplaces + FROM debtortrans INNER JOIN debtorsmaster + ON debtortrans.debtorno=debtorsmaster.debtorno + INNER JOIN custbranch + ON debtortrans.debtorno=custbranch.debtorno + AND debtortrans.branchcode=custbranch.branchcode + INNER JOIN salesorders + ON debtortrans.order_ = salesorders.orderno + INNER JOIN shippers + ON debtortrans.shipvia=shippers.shipper_id + INNER JOIN salesman + ON custbranch.salesman=salesman.salesmancode + INNER JOIN locations + ON salesorders.fromstkloc=locations.loccode + INNER JOIN paymentterms + ON debtorsmaster.paymentterms=paymentterms.termsindicator + INNER JOIN currencies + ON debtorsmaster.currcode=currencies.currabrev + WHERE debtortrans.type=10 + AND debtortrans.transno='" . $FromTransNo . "'"; } else { $sql = "SELECT debtortrans.trandate, - debtortrans.ovamount, - debtortrans.ovdiscount, - debtortrans.ovfreight, - debtortrans.ovgst, - debtortrans.rate, - debtortrans.invtext, - debtorsmaster.name, - debtorsmaster.address1, - debtorsmaster.address2, - debtorsmaster.address3, - debtorsmaster.address4, - debtorsmaster.address5, - debtorsmaster.address6, - debtorsmaster.currcode, - custbranch.brname, - custbranch.braddress1, - custbranch.braddress2, - custbranch.braddress3, - custbranch.braddress4, - custbranch.braddress5, - custbranch.braddress6, - salesman.salesmanname, - debtortrans.debtorno - FROM debtortrans, - debtorsmaster, - custbranch, - salesman - WHERE debtortrans.type=11 - AND debtortrans.transno='" . $FromTransNo . "' - AND debtortrans.debtorno=debtorsmaster.debtorno - AND debtortrans.debtorno=custbranch.debtorno - AND debtortrans.branchcode=custbranch.branchcode - AND custbranch.salesman=salesman.salesmancode"; + debtortrans.ovamount, + debtortrans.ovdiscount, + debtortrans.ovfreight, + debtortrans.ovgst, + debtortrans.rate, + debtortrans.invtext, + debtorsmaster.name, + debtorsmaster.address1, + debtorsmaster.address2, + debtorsmaster.address3, + debtorsmaster.address4, + debtorsmaster.address5, + debtorsmaster.address6, + debtorsmaster.currcode, + custbranch.brname, + custbranch.braddress1, + custbranch.braddress2, + custbranch.braddress3, + custbranch.braddress4, + custbranch.braddress5, + custbranch.braddress6, + salesman.salesmanname, + debtortrans.debtorno, + currencies.decimalplaces + FROM debtortrans INNER JOIN debtorsmaster + ON debtortrans.debtorno=debtorsmaster.debtorno + INNER JOIN custbranch + ON debtortrans.debtorno=custbranch.debtorno + AND debtortrans.branchcode=custbranch.branchcode + INNER JOIN salesman + ON custbranch.salesman=salesman.salesmancode + INNER JOIN paymentterms + ON debtorsmaster.paymentterms=paymentterms.termsindicator + INNER JOIN currencies + ON debtorsmaster.currcode=currencies.currabrev + WHERE debtortrans.type=11 + AND debtortrans.transno='" . $FromTransNo . "'"; } $result=DB_query($sql,$db); @@ -761,19 +776,20 @@ </table>'; $sql ="SELECT stockmoves.stockid, - stockmaster.description, - -stockmoves.qty as quantity, - stockmoves.discountpercent, - ((1 - stockmoves.discountpercent) * stockmoves.price * " . $ExchRate . "* -stockmoves.qty) AS fxnet, - (stockmoves.price * " . $ExchRate . ") AS fxprice, - stockmoves.narrative, - stockmaster.units - FROM stockmoves, - stockmaster - WHERE stockmoves.stockid = stockmaster.stockid - AND stockmoves.type=10 - AND stockmoves.transno='" . $FromTransNo . "' - AND stockmoves.show_on_inv_crds=1"; + stockmaster.description, + -stockmoves.qty as quantity, + stockmoves.discountpercent, + ((1 - stockmoves.discountpercent) * stockmoves.price * " . $ExchRate . "* -stockmoves.qty) AS fxnet, + (stockmoves.price * " . $ExchRate . ") AS fxprice, + stockmoves.narrative, + stockmaster.units, + stockmaster.decimalplaces + FROM stockmoves, + stockmaster + WHERE stockmoves.stockid = stockmaster.stockid + AND stockmoves.type=10 + AND stockmoves.transno='" . $FromTransNo . "' + AND stockmoves.show_on_inv_crds=1"; } else { /* then its a credit note */ @@ -799,20 +815,21 @@ </tr></table>'; $sql ="SELECT stockmoves.stockid, - stockmaster.description, - stockmoves.qty as quantity, - stockmoves.discountpercent, ((1 - stockmoves.discountpercent) * stockmoves.price * ' . $ExchRate . ' * stockmoves.qty) AS fxnet, - (stockmoves.price * ' . $ExchRate . ') AS fxprice, - stockmaster.units - FROM stockmoves, - stockmaster - WHERE stockmoves.stockid = stockmaster.stockid - AND stockmoves.type=11 - AND stockmoves.transno='" . $FromTransNo . "' - AND stockmoves.show_on_inv_crds=1"; + stockmaster.description, + stockmoves.qty as quantity, + stockmoves.discountpercent, ((1 - stockmoves.discountpercent) * stockmoves.price * " . $ExchRate . " * stockmoves.qty) AS fxnet, + (stockmoves.price * " . $ExchRate . ") AS fxprice, + stockmaster.units, + stockmaster.decimalplaces + FROM stockmoves, + stockmaster + WHERE stockmoves.stockid = stockmaster.stockid + AND stockmoves.type=11 + AND stockmoves.transno='" . $FromTransNo . "' + AND stockmoves.show_on_inv_crds=1"; } - echo '<hr>'; + echo '<hr />'; echo '<div class="centre"><font size=2>' . _('All amounts stated in') . ' ' . $myrow['currcode'] . '</font></div>'; $result=DB_query($sql,$db); @@ -850,9 +867,9 @@ echo $RowStarter; - $DisplayPrice = number_format($myrow2['fxprice'],2); - $DisplayQty = number_format($myrow2['quantity'],2); - $DisplayNet = number_format($myrow2['fxnet'],2); + $DisplayPrice = number_format($myrow2['fxprice'],$myrow['decimalplaces']); + $DisplayQty = number_format($myrow2['quantity'],$myrow2['decimalplaces']); + $DisplayNet = number_format($myrow2['fxnet'],$myrow['decimalplaces']); if ($myrow2['discountpercent']==0){ $DisplayDiscount =''; @@ -912,15 +929,17 @@ echo _('Telephone') . ': ' . $_SESSION['CompanyRecord']['telephone'] . '<br />'; echo _('Facsimile') . ': ' . $_SESSION['CompanyRecord']['fax'] . '<br />'; echo _('Email') . ': ' . $_SESSION['CompanyRecord']['email'] . '<br />'; - echo '</td><td class=number>' . _('Page') . ': ' . $PageNumber . '</td></tr></table>'; - echo '<table class="table1"><tr> - <th>' . _('Item Code') . '</th> - <th>' . _('Item Description') . '</th> - <th>' . _('Quantity') . '</th> - <th>' . _('Unit') . '</th> - <th>' . _('Price') . '</th> - <th>' . _('Discount') . '</th> - <th>' . _('Net') . '</th></tr>'; + echo '</td><td class="number">' . _('Page') . ': ' . $PageNumber . '</td></tr></table>'; + echo '<table class="table1"> + <tr> + <th>' . _('Item Code') . '</th> + <th>' . _('Item Description') . '</th> + <th>' . _('Quantity') . '</th> + <th>' . _('Unit') . '</th> + <th>' . _('Price') . '</th> + <th>' . _('Discount') . '</th> + <th>' . _('Net') . '</th> + </tr>'; $LineCounter = 10; @@ -960,14 +979,16 @@ echo _('Facsimile') . ': ' . $_SESSION['CompanyRecord']['fax'] . '<br />'; echo _('Email') . ': ' . $_SESSION['CompanyRecord']['email'] . '<br />'; echo '</td><td class=number>' . _('Page') . ': ' . $PageNumber . '</td></tr></table>'; - echo '<table class="table1"><tr> - <th>' . _('Item Code') . '</th> - <th>' . _('Item Description') . '</th> - <th>' . _('Quantity') . '</th> - <th>' . _('Unit') . '</th> - <th>' . _('Price') . '</th> - <th>' . _('Discount') . '</th> - <th>' . _('Net') . '</th></tr>'; + echo '<table class="table1"> + <tr> + <th>' . _('Item Code') . '</th> + <th>' . _('Item Description') . '</th> + <th>' . _('Quantity') . '</th> + <th>' . _('Unit') . '</th> + <th>' . _('Price') . '</th> + <th>' . _('Discount') . '</th> + <th>' . _('Net') . '</th> + </tr>'; $LineCounter = 10; } @@ -986,15 +1007,15 @@ if ($InvOrCredit=='Invoice') { - $DisplaySubTot = number_format($myrow['ovamount'],2); - $DisplayFreight = number_format($myrow['ovfreight'],2); - $DisplayTax = number_format($myrow['ovgst'],2); - $DisplayTotal = number_format($myrow['ovfreight']+$myrow['ovgst']+$myrow['ovamount'],2); + $DisplaySubTot = number_format($myrow['ovamount'],$myrow['decimalplaces']); + $DisplayFreight = number_format($myrow['ovfreight'],$myrow['decimalplaces']); + $DisplayTax = number_format($myrow['ovgst'],$myrow['decimalplaces']); + $DisplayTotal = number_format($myrow['ovfreight']+$myrow['ovgst']+$myrow['ovamount'],$myrow['decimalplaces']); } else { - $DisplaySubTot = number_format(-$myrow['ovamount'],2); - $DisplayFreight = number_format(-$myrow['ovfreight'],2); - $DisplayTax = number_format(-$myrow['ovgst'],2); - $DisplayTotal = number_format(-$myrow['ovfreight']-$myrow['ovgst']-$myrow['ovamount'],2); + $DisplaySubTot = number_format(-$myrow['ovamount'],$myrow['decimalplaces']); + $DisplayFreight = number_format(-$myrow['ovfreight'],$myrow['decimalplaces']); + $DisplayTax = number_format(-$myrow['ovgst'],$myrow['decimalplaces']); + $DisplayTotal = number_format(-$myrow['ovfreight']-$myrow['ovgst']-$myrow['ovamount'],$myrow['decimalplaces']); } /*Print out the invoice text entered */ Modified: trunk/PrintCustTransPortrait.php =================================================================== --- trunk/PrintCustTransPortrait.php 2011-07-14 10:27:29 UTC (rev 4630) +++ trunk/PrintCustTransPortrait.php 2011-07-16 02:55:44 UTC (rev 4631) @@ -99,123 +99,127 @@ if ($InvOrCredit=='Invoice') { $sql = "SELECT debtortrans.trandate, - debtortrans.ovamount, - debtortrans.ovdiscount, - debtortrans.ovfreight, - debtortrans.ovgst, - debtortrans.rate, - debtortrans.invtext, - debtortrans.consignment, - debtorsmaster.name, - debtorsmaster.address1, - debtorsmaster.address2, - debtorsmaster.address3, - debtorsmaster.address4, - debtorsmaster.address5, - debtorsmaster.address6, - debtorsmaster.currcode, - debtorsmaster.invaddrbranch, - debtorsmaster.taxref, - paymentterms.terms, - salesorders.deliverto, - salesorders.deladd1, - salesorders.deladd2, - salesorders.deladd3, - salesorders.deladd4, - salesorders.deladd5, - salesorders.deladd6, - salesorders.customerref, - salesorders.orderno, - salesorders.orddate, - locations.locationname, - shippers.shippername, - custbranch.brname, - custbranch.braddress1, - custbranch.braddress2, - custbranch.braddress3, - custbranch.braddress4, - custbranch.braddress5, - custbranch.braddress6, - custbranch.brpostaddr1, - custbranch.brpostaddr2, - custbranch.brpostaddr3, - custbranch.brpostaddr4, - custbranch.brpostaddr5, - custbranch.brpostaddr6, - salesman.salesmanname, - debtortrans.debtorno, - debtortrans.branchcode - FROM debtortrans, - debtorsmaster, - custbranch, - salesorders, - shippers, - salesman, - locations, - paymentterms - WHERE debtortrans.order_ = salesorders.orderno - AND debtortrans.type=10 - AND debtortrans.transno='" . $FromTransNo . "' - AND debtortrans.shipvia=shippers.shipper_id - AND debtortrans.debtorno=debtorsmaster.debtorno - AND debtorsmaster.paymentterms=paymentterms.termsindicator - AND debtortrans.debtorno=custbranch.debtorno - AND debtortrans.branchcode=custbranch.branchcode - AND custbranch.salesman=salesman.salesmancode - AND salesorders.fromstkloc=locations.loccode"; + debtortrans.ovamount, + debtortrans.ovdiscount, + debtortrans.ovfreight, + debtortrans.ovgst, + debtortrans.rate, + debtortrans.invtext, + debtortrans.consignment, + debtorsmaster.name, + debtorsmaster.address1, + debtorsmaster.address2, + debtorsmaster.address3, + debtorsmaster.address4, + debtorsmaster.address5, + debtorsmaster.address6, + debtorsmaster.currcode, + debtorsmaster.invaddrbranch, + debtorsmaster.taxref, + paymentterms.terms, + salesorders.deliverto, + salesorders.deladd1, + salesorders.deladd2, + salesorders.deladd3, + salesorders.deladd4, + salesorders.deladd5, + salesorders.deladd6, + salesorders.customerref, + salesorders.orderno, + salesorders.orddate, + locations.locationname, + shippers.shippername, + custbranch.brname, + custbranch.braddress1, + custbranch.braddress2, + custbranch.braddress3, + custbranch.braddress4, + custbranch.braddress5, + custbranch.braddress6, + custbranch.brpostaddr1, + custbranch.brpostaddr2, + custbranch.brpostaddr3, + custbranch.brpostaddr4, + custbranch.brpostaddr5, + custbranch.brpostaddr6, + salesman.salesmanname, + debtortrans.debtorno, + debtortrans.branchcode, + currencies.decimalplaces + FROM debtortrans INNER JOIN debtorsmaster + ON debtortrans.debtorno=debtorsmaster.debtorno + INNER JOIN custbranch + ON debtortrans.debtorno=custbranch.debtorno + AND debtortrans.branchcode=custbranch.branchcode + INNER JOIN salesorders + ON debtortrans.order_ = salesorders.orderno + INNER JOIN shippers + ON debtortrans.shipvia=shippers.shipper_id + INNER JOIN salesman + ON custbranch.salesman=salesman.salesmancode + INNER JOIN locations + ON salesorders.fromstkloc=locations.loccode + INNER JOIN paymentterms + ON debtorsmaster.paymentterms=paymentterms.termsindicator + INNER JOIN currencies + ON debtorsmaster.currcode=currencies.currabrev + WHERE debtortrans.type=10 + AND debtortrans.transno='" . $FromTransNo . "'"; - if (isset($_POST['PrintEDI']) and $_POST['PrintEDI']=='No'){ - $sql = $sql . ' AND debtorsmaster.ediinvoices=0'; + if (isset($_POST['PrintEDI']) and $_POST['PrintEDI']=='No') { + $sql = $sql . " AND debtorsmaster.ediinvoices=0"; } } else { - $sql = "SELECT debtortrans.trandate, - debtortrans.ovamount, - debtortrans.ovdiscount, - debtortrans.ovfreight, - debtortrans.ovgst, - debtortrans.rate, - debtortrans.invtext, - debtorsmaster.invaddrbranch, - debtorsmaster.name, - debtorsmaster.address1, - debtorsmaster.address2, - debtorsmaster.address3, - debtorsmaster.address4, - debtorsmaster.address5, - debtorsmaster.address6, - debtorsmaster.currcode, - debtorsmaster.taxref, - custbranch.brname, - custbranch.braddress1, - custbranch.braddress2, - custbranch.braddress3, - custbranch.braddress4, - custbranch.braddress5, - custbranch.braddress6, - custbranch.brpostaddr1, - custbranch.brpostaddr2, - custbranch.brpostaddr3, - custbranch.brpostaddr4, - custbranch.brpostaddr5, - custbranch.brpostaddr6, - salesman.salesmanname, - debtortrans.debtorno, - debtortrans.branchcode, - paymentterms.terms - FROM debtortrans, - debtorsmaster, - custbranch, - salesman, - paymentterms - WHERE debtortrans.type=11 - AND debtorsmaster.paymentterms = paymentterms.termsindicator - AND debtortrans.transno='" . $FromTransNo ."' - AND debtortrans.debtorno=debtorsmaster.debtorno - AND debtortrans.debtorno=custbranch.debtorno - AND debtortrans.branchcode=custbranch.branchcode - AND custbranch.salesman=salesman.salesmancode"; + debtortrans.ovamount, + debtortrans.ovdiscount, + debtortrans.ovfreight, + debtortrans.ovgst, + debtortrans.rate, + debtortrans.invtext, + debtorsmaster.invaddrbranch, + debtorsmaster.name, + debtorsmaster.address1, + debtorsmaster.address2, + debtorsmaster.address3, + debtorsmaster.address4, + debtorsmaster.address5, + debtorsmaster.address6, + debtorsmaster.currcode, + debtorsmaster.taxref, + custbranch.brname, + custbranch.braddress1, + custbranch.braddress2, + custbranch.braddress3, + custbranch.braddress4, + custbranch.braddress5, + custbranch.braddress6, + custbranch.brpostaddr1, + custbranch.brpostaddr2, + custbranch.brpostaddr3, + custbranch.brpostaddr4, + custbranch.brpostaddr5, + custbranch.brpostaddr6, + salesman.salesmanname, + debtortrans.debtorno, + debtortrans.branchcode, + paymentterms.terms, + currencies.decimalplaces + FROM debtortrans INNER JOIN debtorsmaster + ON debtortrans.debtorno=debtorsmaster.debtorno + INNER JOIN custbranch + ON debtortrans.debtorno=custbranch.debtorno + AND debtortrans.branchcode=custbranch.branchcode + INNER JOIN salesman + ON custbranch.salesman=salesman.salesmancode + INNER JOIN paymentterms + ON debtorsmaster.paymentterms=paymentterms.termsindicator + INNER JOIN currencies + ON debtorsmaster.currcode=currencies.currabrev + WHERE debtortrans.type=11 + AND debtortrans.transno='" . $FromTransNo . "'"; + if (isset($_POST['PrintEDI']) and $_POST['PrintEDI']=='No'){ $sql = $sql . ' AND debtorsmaster.ediinvoices=0'; } @@ -250,11 +254,11 @@ stockmoves.narrative, stockmaster.controlled, stockmaster.units, - stockmoves.stkmoveno - FROM stockmoves, - stockmaster - WHERE stockmoves.stockid = stockmaster.stockid - AND stockmoves.type=10 + stockmoves.stkmoveno, + stockmaster.decimalplaces + FROM stockmoves INNER JOIN stockmaster + ON stockmoves.stockid = stockmaster.stockid + WHERE stockmoves.type=10 AND stockmoves.transno='" . $FromTransNo . "' AND stockmoves.show_on_inv_crds=1"; } else { @@ -268,11 +272,11 @@ stockmoves.narrative, stockmaster.controlled, stockmaster.units, - stockmoves.stkmoveno - FROM stockmoves, - stockmaster - WHERE stockmoves.stockid = stockmaster.stockid - AND stockmoves.type=11 + stockmoves.stkmoveno, + stockmaster.decimalplaces + FROM stockmoves INNER JOIN stockmaster + ON stockmoves.stockid = stockmaster.stockid + WHERE stockmoves.type=11 AND stockmoves.transno='" . $FromTransNo . "' AND stockmoves.show_on_inv_crds=1"; } // end else @@ -305,9 +309,9 @@ $DisplayDiscount = number_format($myrow2['discountpercent'] * 100, 2) . '%'; $DiscountPrice = $myrow2['fxprice'] * (1 - $myrow2['discountpercent']); } - $DisplayNet = $myrow2['fxnet']; - $DisplayPrice = $myrow2['fxprice']; - $DisplayQty = $myrow2['quantity']; + $DisplayNet = number_format($myrow2['fxnet'],$myrow['decimalplaces']); + $DisplayPrice = number_format($myrow2['fxprice'],$myrow['decimalplaces']); + $DisplayQty = number_format($myrow2['quantity'],$myrow2['decimalplaces']); $LeftOvers = $pdf->addTextWrap($Left_Margin+5,$YPos,71,$FontSize,$myrow2['stockid']); $LeftOvers = $pdf->addTextWrap($Left_Margin+80,$YPos,186,$FontSize,$myrow2['description']); @@ -318,11 +322,11 @@ $lines++; } - $... [truncated message content] |
From: <dai...@us...> - 2011-07-14 10:27:37
|
Revision: 4630 http://web-erp.svn.sourceforge.net/web-erp/?rev=4630&view=rev Author: daintree Date: 2011-07-14 10:27:29 +0000 (Thu, 14 Jul 2011) Log Message: ----------- consistency review Modified Paths: -------------- trunk/GLAccountCSV.php trunk/GLAccountInquiry.php trunk/GLAccountReport.php trunk/GLProfit_Loss.php trunk/GLTagProfit_Loss.php trunk/GLTags.php trunk/GLTransInquiry.php trunk/GLTrialBalance.php trunk/GLTrialBalance_csv.php trunk/GetStockImage.php trunk/GoodsReceived.php trunk/Stocks.php trunk/includes/session.inc Modified: trunk/GLAccountCSV.php =================================================================== --- trunk/GLAccountCSV.php 2011-07-09 08:22:59 UTC (rev 4629) +++ trunk/GLAccountCSV.php 2011-07-14 10:27:29 UTC (rev 4630) @@ -43,7 +43,7 @@ echo '</select></td>'; echo '<td>'._('For Period range').':</td> - <td><select Name=Period[] multiple>'; + <td><select name="Period[]" multiple>'; $sql = "SELECT periodno, lastdate_in_period FROM periods ORDER BY periodno DESC"; $Periods = DB_query($sql,$db); $id=0; @@ -139,30 +139,30 @@ gltrans.periodno, gltrans.tag FROM gltrans, systypes - WHERE gltrans.account = '$SelectedAccount' + WHERE gltrans.account = '" . $SelectedAccount . "' AND systypes.typeid=gltrans.type AND posted=1 - AND periodno>='$FirstPeriodSelected' - AND periodno<='$LastPeriodSelected' + AND periodno>='" . $FirstPeriodSelected . "' + AND periodno<='" . $LastPeriodSelected . "' ORDER BY periodno, gltrans.trandate, counterindex"; } else { $sql= "SELECT gltrans.type, - gltrans.typename, - gltrans.typeno, - gltrans.trandate, - gltrans.narrative, - gltrans.amount, - gltrans.periodno, - gltrans.tag - FROM gltrans, systypes - WHERE gltrans.account = '$SelectedAccount' - AND systypes.typeid=gltrans.type - AND posted=1 - AND periodno>='$FirstPeriodSelected' - AND periodno<='$LastPeriodSelected' - AND tag='".$_POST['tag']."' - ORDER BY periodno, gltrans.trandate, counterindex"; + gltrans.typename, + gltrans.typeno, + gltrans.trandate, + gltrans.narrative, + gltrans.amount, + gltrans.periodno, + gltrans.tag + FROM gltrans, systypes + WHERE gltrans.account = '" . $SelectedAccount . "' + AND systypes.typeid=gltrans.type + AND posted=1 + AND periodno>='" . $FirstPeriodSelected . "' + AND periodno<='" . $LastPeriodSelected . "' + AND tag='".$_POST['tag']."' + ORDER BY periodno, gltrans.trandate, counterindex"; } $ErrMsg = _('The transactions for account') . ' ' . $SelectedAccount . ' ' . _('could not be retrieved because') ; @@ -176,7 +176,7 @@ actual, period FROM chartdetails - WHERE chartdetails.accountcode= '$SelectedAccount' + WHERE chartdetails.accountcode= '" . $SelectedAccount . "' AND chartdetails.period='" . $FirstPeriodSelected . "'"; $ErrMsg = _('The chart details for account') . ' ' . $SelectedAccount . ' ' . _('could not be retrieved'); @@ -202,11 +202,11 @@ if ($PeriodNo!=-9999){ //ie its not the first time around /*Get the ChartDetails balance b/fwd and the actual movement in the account for the period as recorded in the chart details - need to ensure integrity of transactions to the chart detail movements. Also, for a balance sheet account it is the balance carried forward that is important, not just the transactions*/ $sql = "SELECT bfwd, - actual, - period - FROM chartdetails - WHERE chartdetails.accountcode= '$SelectedAccount' - AND chartdetails.period='" . $PeriodNo . "'"; + actual, + period + FROM chartdetails + WHERE chartdetails.accountcode= '" . $SelectedAccount . "' + AND chartdetails.period='" . $PeriodNo . "'"; $ErrMsg = _('The chart details for account') . ' ' . $SelectedAccount . ' ' . _('could not be retrieved'); $ChartDetailsResult = DB_query($sql,$db,$ErrMsg); Modified: trunk/GLAccountInquiry.php =================================================================== --- trunk/GLAccountInquiry.php 2011-07-09 08:22:59 UTC (rev 4629) +++ trunk/GLAccountInquiry.php 2011-07-14 10:27:29 UTC (rev 4630) @@ -1,9 +1,7 @@ <?php /* $Id$*/ -/* $Revision: 1.28 $ */ -//$PageSecurity = 8; include ('includes/session.inc'); $title = _('General Ledger Account Inquiry'); include('includes/header.inc'); Modified: trunk/GLAccountReport.php =================================================================== --- trunk/GLAccountReport.php 2011-07-09 08:22:59 UTC (rev 4629) +++ trunk/GLAccountReport.php 2011-07-14 10:27:29 UTC (rev 4630) @@ -1,9 +1,6 @@ <?php +/* $Id: GLAccountReport.php 4618 2011-07-02 23:04:59Z daintree $*/ -/* $Id: $*/ -/* $Revision: 1.00 $ */ - -//$PageSecurity = 8; include ('includes/session.inc'); if (isset($_POST['Period'])){ @@ -39,10 +36,10 @@ foreach ($_POST['Account'] as $SelectedAccount){ /*Is the account a balance sheet or a profit and loss account */ $result = DB_query("SELECT chartmaster.accountname, - accountgroups.pandl - FROM accountgroups - INNER JOIN chartmaster ON accountgroups.groupname=chartmaster.group_ - WHERE chartmaster.accountcode=$SelectedAccount",$db); + accountgroups.pandl + FROM accountgroups + INNER JOIN chartmaster ON accountgroups.groupname=chartmaster.group_ + WHERE chartmaster.accountcode='" . $SelectedAccount . "'",$db); $AccountDetailRow = DB_fetch_row($result); $AccountName = $AccountDetailRow[0]; if ($AccountDetailRow[1]==1){ @@ -56,38 +53,42 @@ if ($_POST['tag']==0) { $sql= "SELECT type, - typename, - gltrans.typeno, - gltrans.trandate, - gltrans.narrative, - gltrans.amount, - gltrans.periodno, - gltrans.tag - FROM gltrans, systypes - WHERE gltrans.account = $SelectedAccount - AND systypes.typeid=gltrans.type - AND posted=1 - AND periodno>=$FirstPeriodSelected - AND periodno<=$LastPeriodSelected - ORDER BY periodno, gltrans.trandate, counterindex"; + typename, + gltrans.typeno, + gltrans.trandate, + gltrans.narrative, + gltrans.amount, + gltrans.periodno, + gltrans.tag + FROM gltrans INNER JOIN systypes + ON gltrans.type=systypes.typeid + WHERE gltrans.account = '" . $SelectedAccount . "' + AND posted=1 + AND periodno>='" . $FirstPeriodSelected . "' + AND periodno<='" . $LastPeriodSelected . "' + ORDER BY periodno, + gltrans.trandate, + counterindex"; } else { $sql= "SELECT gltrans.type, - gltrans.typename, - gltrans.typeno, - gltrans.trandate, - gltrans.narrative, - gltrans.amount, - gltrans.periodno, - gltrans.tag - FROM gltrans, systypes - WHERE gltrans.account = $SelectedAccount - AND systypes.typeid=gltrans.type - AND posted=1 - AND periodno>=$FirstPeriodSelected - AND periodno<=$LastPeriodSelected - AND tag='".$_POST['tag']."' - ORDER BY periodno, gltrans.trandate, counterindex"; + gltrans.typename, + gltrans.typeno, + gltrans.trandate, + gltrans.narrative, + gltrans.amount, + gltrans.periodno, + gltrans.tag + FROM gltrans INNER JOIN systypes + ON gltrans.type=systypes.typeid + WHERE gltrans.account = '" . $SelectedAccount . "' + AND posted=1 + AND periodno>='" . $FirstPeriodSelected . "' + AND periodno<='" . $LastPeriodSelected . "' + AND tag='" . $_POST['tag'] . "' + ORDER BY periodno, + gltrans.trandate, + counterindex"; } $ErrMsg = _('The transactions for account') . ' ' . $SelectedAccount . ' ' . _('could not be retrieved because') ; @@ -105,11 +106,11 @@ $RunningTotal = 0; } else { $sql = "SELECT bfwd, - actual, - period - FROM chartdetails - WHERE chartdetails.accountcode='" . $SelectedAccount . - "' AND chartdetails.period='" . $FirstPeriodSelected . "'"; + actual, + period + FROM chartdetails + WHERE chartdetails.accountcode='" . $SelectedAccount . "' + AND chartdetails.period='" . $FirstPeriodSelected . "'"; $ErrMsg = _('The chart details for account') . ' ' . $SelectedAccount . ' ' . _('could not be retrieved'); $ChartDetailsResult = DB_query($sql,$db,$ErrMsg); @@ -137,11 +138,11 @@ if ($PeriodNo!=-9999){ //ie its not the first time around /*Get the ChartDetails balance b/fwd and the actual movement in the account for the period as recorded in the chart details - need to ensure integrity of transactions to the chart detail movements. Also, for a balance sheet account it is the balance carried forward that is important, not just the transactions*/ $sql = "SELECT bfwd, - actual, - period - FROM chartdetails - WHERE chartdetails.accountcode='" . $SelectedAccount . - "' AND chartdetails.period='" . $PeriodNo . "'"; + actual, + period + FROM chartdetails + WHERE chartdetails.accountcode='" . $SelectedAccount . "' + AND chartdetails.period='" . $PeriodNo . "'"; $ErrMsg = _('The chart details for account') . ' ' . $SelectedAccount . ' ' . _('could not be retrieved'); $ChartDetailsResult = DB_query($sql,$db,$ErrMsg); @@ -149,9 +150,9 @@ $YPos -=$line_height; $LeftOvers = $pdf->addTextWrap($Left_Margin,$YPos,150,$FontSize, _('Period Total')); if ($PeriodTotal < 0 ){ //its a credit balance b/fwd - $LeftOvers = $pdf->addTextWrap(210,$YPos,50,$FontSize, number_format(-$PeriodTotal,2) , 'right'); + $LeftOvers = $pdf->addTextWrap(210,$YPos,50,$FontSize, number_format(-$PeriodTotal,$_SESSION['CompanyRecord']['decimalplaces']) , 'right'); } else { //its a debit balance b/fwd - $LeftOvers = $pdf->addTextWrap(160,$YPos,50,$FontSize, number_format($PeriodTotal,2) , 'right'); + $LeftOvers = $pdf->addTextWrap(160,$YPos,50,$FontSize, number_format($PeriodTotal,$_SESSION['CompanyRecord']['decimalplaces']) , 'right'); } } $PeriodNo = $myrow['periodno']; @@ -162,10 +163,10 @@ $PeriodTotal += $myrow['amount']; if($myrow['amount']>=0){ - $DebitAmount = number_format($myrow['amount'],2); + $DebitAmount = number_format($myrow['amount'],$_SESSION['CompanyRecord']['decimalplaces']); $CreditAmount = ''; } elseif ($myrow['amount']<0){ - $CreditAmount = number_format(-$myrow['amount'],2); + $CreditAmount = number_format(-$myrow['amount'],$_SESSION['CompanyRecord']['decimalplaces']); $DebitAmount = ''; } @@ -201,9 +202,9 @@ $LeftOvers = $pdf->addTextWrap($Left_Margin,$YPos,150,$FontSize, _('Balance C/Fwd')); } if ($RunningTotal < 0){ - $LeftOvers = $pdf->addTextWrap(210,$YPos,50,$FontSize, number_format(-$RunningTotal,2) , 'right'); + $LeftOvers = $pdf->addTextWrap(210,$YPos,50,$FontSize, number_format(-$RunningTotal,$_SESSION['CompanyRecord']['decimalplaces']) , 'right'); } else { //its a debit balance b/fwd - $LeftOvers = $pdf->addTextWrap(160,$YPos,50,$FontSize, number_format($RunningTotal,2) , 'right'); + $LeftOvers = $pdf->addTextWrap(160,$YPos,50,$FontSize, number_format($RunningTotal,$_SESSION['CompanyRecord']['decimalplaces']) , 'right'); } $YPos -=$line_height; //draw a line under each account printed @@ -218,28 +219,6 @@ } else { //print the report - /* - $pdfcode = $pdf->output(); - $len = mb_strlen($pdfcode); - - if ($len<=20){ - $title = _('Print GL Accounts Report Error'); - include('includes/header.inc'); - prnMsg (_('There were no accounts to print out'),'error'); - echo "<br /><a href='$rootpath/index.php?" . SID . "'>" . _('Back to the menu') . '</a>'; - include('includes/footer.inc'); - exit; - } else { - header('Content-type: application/pdf'); - header('Content-Length: ' . $len); - header('Content-Disposition: inline; filename=GL_Accounts_' . date('Y-m-d') . '.pdf'); - header('Expires: 0'); - header('Cache-Control: must-revalidate, post-check=0, pre-check=0'); - header('Pragma: public'); - - $pdf->Output('GL_Accounts_' . date('Y-m-d') . '.pdf', 'I'); - } - */ $pdf->OutputD($_SESSION['DatabaseName'] . '_GL_Accounts_' . date('Y-m-d') . '.pdf'); $pdf->__destruct(); } //end if the report has some output @@ -253,7 +232,7 @@ echo '<div class="page_help_text">' . _('Use the keyboard Shift key to select multiple accounts and periods') . '</div><br />'; - echo "<form method='POST' action=" . $_SERVER['PHP_SELF'] . '?' . SID . '>'; + echo '<form method="POST" action="' . $_SERVER['PHP_SELF'] . '">'; echo '<input type="hidden" name="FormID" value="' . $_SESSION['FormID'] . '" />'; /*Dates in SQL format for the last day of last month*/ @@ -269,10 +248,10 @@ $i=0; while ($myrow=DB_fetch_array($AccountsResult,$db)){ if(isset($_POST['Account'][$i]) AND $myrow['accountcode'] == $_POST['Account'][$i]){ - echo '<option selected VALUE=' . $myrow['accountcode'] . '>' . $myrow['accountcode'] . ' ' . $myrow['accountname']; + echo '<option selected value="' . $myrow['accountcode'] . '">' . $myrow['accountcode'] . ' ' . $myrow['accountname'] . '</option>'; $i++; } else { - echo '<option VALUE=' . $myrow['accountcode'] . '>' . $myrow['accountcode'] . ' ' . $myrow['accountname']; + echo '<option value="' . $myrow['accountcode'] . '">' . $myrow['accountcode'] . ' ' . $myrow['accountname'] . '</option>'; } } echo '</select></td>'; @@ -285,29 +264,31 @@ while ($myrow=DB_fetch_array($Periods,$db)){ if (isset($SelectedPeriod[$id]) and $myrow['periodno'] == $SelectedPeriod[$id]){ - echo '<option selected VALUE=' . $myrow['periodno'] . '>' . _(MonthAndYearFromSQLDate($myrow['lastdate_in_period'])); + echo '<option selected value="' . $myrow['periodno'] . '">' . _(MonthAndYearFromSQLDate($myrow['lastdate_in_period'])) . '</option>'; $id++; } else { - echo '<option VALUE=' . $myrow['periodno'] . '>' . _(MonthAndYearFromSQLDate($myrow['lastdate_in_period'])); + echo '<option value=' . $myrow['periodno'] . '>' . _(MonthAndYearFromSQLDate($myrow['lastdate_in_period'])) . '</option>'; } } echo '</select></td></tr>'; //Select the tag - echo '<tr><td>' . _('Select Tag') . ':</td><td><select name="tag">'; + echo '<tr> + <td>' . _('Select Tag') . ':</td> + <td><select name="tag">'; $SQL = "SELECT tagref, - tagdescription - FROM tags - ORDER BY tagref"; + tagdescription + FROM tags + ORDER BY tagref"; $result=DB_query($SQL,$db); - echo '<option value=0>0 - '._('All tags'); + echo '<option value=0>0 - '._('All tags') . '</option>'; while ($myrow=DB_fetch_array($result)){ if (isset($_POST['tag']) and $_POST['tag']==$myrow['tagref']){ - echo '<option selected value=' . $myrow['tagref'] . '>' . $myrow['tagref'].' - ' .$myrow['tagdescription']; + echo '<option selected value=' . $myrow['tagref'] . '>' . $myrow['tagref'].' - ' .$myrow['tagdescription'] . '</option>'; } else { - echo '<option value=' . $myrow['tagref'] . '>' . $myrow['tagref'].' - ' .$myrow['tagdescription']; + echo '<option value=' . $myrow['tagref'] . '>' . $myrow['tagref'].' - ' .$myrow['tagdescription'] . '</option>'; } } echo '</select></td></tr>'; @@ -315,7 +296,7 @@ echo '</table><p> <div class="centre"> - <input type=submit name="RunReport" VALUE="' ._('Run Report'). '"></div> + <input type=submit name="RunReport" value="' ._('Run Report'). '"></div> </form>'; include ('includes/footer.inc'); @@ -323,7 +304,6 @@ } - function NewPageHeader () { global $PageNumber, $pdf, Modified: trunk/GLProfit_Loss.php =================================================================== --- trunk/GLProfit_Loss.php 2011-07-09 08:22:59 UTC (rev 4629) +++ trunk/GLProfit_Loss.php 2011-07-14 10:27:29 UTC (rev 4630) @@ -21,7 +21,7 @@ . _('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'] . '">'; + echo '<form method="post" action="' . $_SERVER['PHP_SELF'] . '">'; echo '<input type="hidden" name="FormID" value="' . $_SESSION['FormID'] . '" />'; if (Date('m') > $_SESSION['YearEnd']){ @@ -39,22 +39,25 @@ <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']) . '</option>'; + echo '<option selected value=' . $myrow['periodno'] . '>' .MonthAndYearFromSQLDate($myrow['lastdate_in_period']) . '</option>'; } else { - echo '<option VALUE=' . $myrow['periodno'] . '>' . MonthAndYearFromSQLDate($myrow['lastdate_in_period']) . '</option>'; + 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']) . '</option>'; + echo '<option selected value=' . $myrow['periodno'] . '>' . MonthAndYearFromSQLDate($myrow['lastdate_in_period']) . '</option>'; } else { - echo '<option VALUE=' . $myrow['periodno'] . '>' . MonthAndYearFromSQLDate($myrow['lastdate_in_period']) . '</option>'; + echo '<option value=' . $myrow['periodno'] . '>' . MonthAndYearFromSQLDate($myrow['lastdate_in_period']) . '</option>'; } } } @@ -71,29 +74,34 @@ $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']) . '</option>'; + echo '<option selected value=' . $myrow['periodno'] . '>' . MonthAndYearFromSQLDate($myrow['lastdate_in_period']) . '</option>'; } else { - echo '<option VALUE =' . $myrow['periodno'] . '>' . MonthAndYearFromSQLDate($myrow['lastdate_in_period']) . '</option>'; + 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') . '</option>'; - echo '<option selected VALUE="Detailed">'._('All Accounts') . '</option>'; - echo '</select></td></tr>'; + echo '<tr><td>'._('Detail Or Summary').':</td> + <td><select name="Detail"> + <option selected value="Summary">'._('Summary') . '</option> + <option selected value="Detailed">'._('All Accounts') . '</option> + </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 */ @@ -126,30 +134,30 @@ $SQL = "SELECT accountgroups.sectioninaccounts, - accountgroups.groupname, - accountgroups.parentgroupname, - chartdetails.accountcode , - chartmaster.accountname, - Sum(CASE WHEN chartdetails.period='" . $_POST['FromPeriod'] . "' THEN chartdetails.bfwd ELSE 0 END) AS firstprdbfwd, - Sum(CASE WHEN chartdetails.period='" . $_POST['FromPeriod'] . "' THEN chartdetails.bfwdbudget ELSE 0 END) AS firstprdbudgetbfwd, - Sum(CASE WHEN chartdetails.period='" . $_POST['ToPeriod'] . "' THEN chartdetails.bfwd + chartdetails.actual ELSE 0 END) AS lastprdcfwd, - Sum(CASE WHEN chartdetails.period='" . ($_POST['FromPeriod'] - 12) . "' THEN chartdetails.bfwd ELSE 0 END) AS lyfirstprdbfwd, - Sum(CASE WHEN chartdetails.period='" . ($_POST['ToPeriod']-12) . "' THEN chartdetails.bfwd + chartdetails.actual ELSE 0 END) AS lylastprdcfwd, - Sum(CASE WHEN chartdetails.period='" . $_POST['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 - WHERE accountgroups.pandl=1 - GROUP BY accountgroups.sectioninaccounts, - accountgroups.groupname, - accountgroups.parentgroupname, - chartdetails.accountcode, - chartmaster.accountname, - accountgroups.sequenceintb - ORDER BY accountgroups.sectioninaccounts, - accountgroups.sequenceintb, - accountgroups.groupname, - chartdetails.accountcode"; + accountgroups.groupname, + accountgroups.parentgroupname, + chartdetails.accountcode , + chartmaster.accountname, + Sum(CASE WHEN chartdetails.period='" . $_POST['FromPeriod'] . "' THEN chartdetails.bfwd ELSE 0 END) AS firstprdbfwd, + Sum(CASE WHEN chartdetails.period='" . $_POST['FromPeriod'] . "' THEN chartdetails.bfwdbudget ELSE 0 END) AS firstprdbudgetbfwd, + Sum(CASE WHEN chartdetails.period='" . $_POST['ToPeriod'] . "' THEN chartdetails.bfwd + chartdetails.actual ELSE 0 END) AS lastprdcfwd, + Sum(CASE WHEN chartdetails.period='" . ($_POST['FromPeriod'] - 12) . "' THEN chartdetails.bfwd ELSE 0 END) AS lyfirstprdbfwd, + Sum(CASE WHEN chartdetails.period='" . ($_POST['ToPeriod']-12) . "' THEN chartdetails.bfwd + chartdetails.actual ELSE 0 END) AS lylastprdcfwd, + Sum(CASE WHEN chartdetails.period='" . $_POST['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 + WHERE accountgroups.pandl=1 + GROUP BY accountgroups.sectioninaccounts, + accountgroups.groupname, + accountgroups.parentgroupname, + chartdetails.accountcode, + chartmaster.accountname, + accountgroups.sequenceintb + ORDER BY accountgroups.sectioninaccounts, + accountgroups.sequenceintb, + accountgroups.groupname, + chartdetails.accountcode"; $AccountsResult = DB_query($SQL,$db); @@ -157,7 +165,7 @@ $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">'. _('Back to the menu'). '</a>'; if ($debug == 1){ echo '<br />'. $SQL; } @@ -167,9 +175,9 @@ if (DB_num_rows($AccountsResult)==0){ $title = _('Print Profit and Loss Error'); include('includes/header.inc'); - echo '<p>'; + echo '<br />'; 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">'. _('Back to the menu'). '</a>'; include('includes/footer.inc'); exit; } @@ -213,15 +221,15 @@ } if ($Section == 1){ /*Income */ $LeftOvers = $pdf->addTextWrap($Left_Margin +($Level*10),$YPos,200 -($Level*10),$FontSize,$ActGrpLabel); - $LeftOvers = $pdf->addTextWrap($Left_Margin+310,$YPos,70,$FontSize,number_format(-$GrpPrdActual[$Level]),'right'); - $LeftOvers = $pdf->addTextWrap($Left_Margin+370,$YPos,70,$FontSize,number_format(-$GrpPrdBudget[$Level]),'right'); - $LeftOvers = $pdf->addTextWrap($Left_Margin+430,$YPos,70,$FontSize,number_format(-$GrpPrdLY[$Level]),'right'); + $LeftOvers = $pdf->addTextWrap($Left_Margin+310,$YPos,70,$FontSize,number_format(-$GrpPrdActual[$Level],$_SESSION['CompanyRecord']['decimalplaces']),'right'); + $LeftOvers = $pdf->addTextWrap($Left_Margin+370,$YPos,70,$FontSize,number_format(-$GrpPrdBudget[$Level],$_SESSION['CompanyRecord']['decimalplaces']),'right'); + $LeftOvers = $pdf->addTextWrap($Left_Margin+430,$YPos,70,$FontSize,number_format(-$GrpPrdLY[$Level],$_SESSION['CompanyRecord']['decimalplaces']),'right'); $YPos -= (2 * $line_height); } else { /*Costs */ $LeftOvers = $pdf->addTextWrap($Left_Margin +($Level*10),$YPos,200 -($Level*10),$FontSize,$ActGrpLabel); - $LeftOvers = $pdf->addTextWrap($Left_Margin+310,$YPos,70,$FontSize,number_format($GrpPrdActual[$Level]),'right'); - $LeftOvers = $pdf->addTextWrap($Left_Margin+370,$YPos,70,$FontSize,number_format($GrpPrdBudget[$Level]),'right'); - $LeftOvers = $pdf->addTextWrap($Left_Margin+430,$YPos,70,$FontSize,number_format($GrpPrdLY[$Level]),'right'); + $LeftOvers = $pdf->addTextWrap($Left_Margin+310,$YPos,70,$FontSize,number_format($GrpPrdActual[$Level],$_SESSION['CompanyRecord']['decimalplaces']),'right'); + $LeftOvers = $pdf->addTextWrap($Left_Margin+370,$YPos,70,$FontSize,number_format($GrpPrdBudget[$Level],$_SESSION['CompanyRecord']['decimalplaces']),'right'); + $LeftOvers = $pdf->addTextWrap($Left_Margin+430,$YPos,70,$FontSize,number_format($GrpPrdLY[$Level],$_SESSION['CompanyRecord']['decimalplaces']),'right'); $YPos -= (2 * $line_height); } $GrpPrdLY[$Level] = 0; @@ -241,15 +249,15 @@ $ActGrpLabel = $ParentGroups[$Level]; } if ($Section == 1){ /*Income */ - $LeftOvers = $pdf->addTextWrap($Left_Margin +($Level*10),$YPos,200 -($Level*10),$FontSize,$ActGrpLabel); $pdf->addTextWrap($Left_Margin+310,$YPos,70,$FontSize,number_format(-$GrpPrdActual[$Level]),'right'); - $LeftOvers = $pdf->addTextWrap($Left_Margin+370,$YPos,70,$FontSize,number_format(-$GrpPrdBudget[$Level]),'right'); - $LeftOvers = $pdf->addTextWrap($Left_Margin+430,$YPos,70,$FontSize,number_format(-$GrpPrdLY[$Level]),'right'); + $LeftOvers = $pdf->addTextWrap($Left_Margin +($Level*10),$YPos,200 -($Level*10),$FontSize,$ActGrpLabel); $pdf->addTextWrap($Left_Margin+310,$YPos,70,$FontSize,number_format(-$GrpPrdActual[$Level],$_SESSION['CompanyRecord']['decimalplaces']),'right'); + $LeftOvers = $pdf->addTextWrap($Left_Margin+370,$YPos,70,$FontSize,number_format(-$GrpPrdBudget[$Level],$_SESSION['CompanyRecord']['decimalplaces']),'right'); + $LeftOvers = $pdf->addTextWrap($Left_Margin+430,$YPos,70,$FontSize,number_format(-$GrpPrdLY[$Level],$_SESSION['CompanyRecord']['decimalplaces']),'right'); $YPos -= (2 * $line_height); } else { /*Costs */ $LeftOvers = $pdf->addTextWrap($Left_Margin +($Level*10),$YPos,200 -($Level*10),$FontSize,$ActGrpLabel); - $LeftOvers = $pdf->addTextWrap($Left_Margin+310,$YPos,70,$FontSize,number_format($GrpPrdActual[$Level]),'right'); - $LeftOvers = $pdf->addTextWrap($Left_Margin+370,$YPos,70,$FontSize,number_format($GrpPrdBudget[$Level]),'right'); - $LeftOvers = $pdf->addTextWrap($Left_Margin+430,$YPos,70,$FontSize,number_format($GrpPrdLY[$Level]),'right'); + $LeftOvers = $pdf->addTextWrap($Left_Margin+310,$YPos,70,$FontSize,number_format($GrpPrdActual[$Level],$_SESSION['CompanyRecord']['decimalplaces']),'right'); + $LeftOvers = $pdf->addTextWrap($Left_Margin+370,$YPos,70,$FontSize,number_format($GrpPrdBudget[$Level],$_SESSION['CompanyRecord']['decimalplaces']),'right'); + $LeftOvers = $pdf->addTextWrap($Left_Margin+430,$YPos,70,$FontSize,number_format($GrpPrdLY[$Level],$_SESSION['CompanyRecord']['decimalplaces']),'right'); $YPos -= (2 * $line_height); } $GrpPrdLY[$Level] = 0; @@ -274,9 +282,9 @@ if ($Section == 1) { /*Income*/ $LeftOvers = $pdf->addTextWrap($Left_Margin,$YPos,200,$FontSize,$Sections[$Section]); - $LeftOvers = $pdf->addTextWrap($Left_Margin+310,$YPos,70,$FontSize,number_format(-$SectionPrdActual),'right'); - $LeftOvers = $pdf->addTextWrap($Left_Margin+370,$YPos,70,$FontSize,number_format(-$SectionPrdBudget),'right'); - $LeftOvers = $pdf->addTextWrap($Left_Margin+430,$YPos,70,$FontSize,number_format(-$SectionPrdLY),'right'); + $LeftOvers = $pdf->addTextWrap($Left_Margin+310,$YPos,70,$FontSize,number_format(-$SectionPrdActual,$_SESSION['CompanyRecord']['decimalplaces']),'right'); + $LeftOvers = $pdf->addTextWrap($Left_Margin+370,$YPos,70,$FontSize,number_format(-$SectionPrdBudget,$_SESSION['CompanyRecord']['decimalplaces']),'right'); + $LeftOvers = $pdf->addTextWrap($Left_Margin+430,$YPos,70,$FontSize,number_format(-$SectionPrdLY,$_SESSION['CompanyRecord']['decimalplaces']),'right'); $YPos -= (2 * $line_height); $TotalIncome = -$SectionPrdActual; @@ -284,16 +292,16 @@ $TotalLYIncome = -$SectionPrdLY; } else { $LeftOvers = $pdf->addTextWrap($Left_Margin,$YPos,200,$FontSize,$Sections[$Section]); - $LeftOvers = $pdf->addTextWrap($Left_Margin+310,$YPos,70,$FontSize,number_format($SectionPrdActual),'right'); - $LeftOvers = $pdf->addTextWrap($Left_Margin+370,$YPos,70,$FontSize,number_format($SectionPrdBudget),'right'); - $LeftOvers = $pdf->addTextWrap($Left_Margin+430,$YPos,70,$FontSize,number_format($SectionPrdLY),'right'); + $LeftOvers = $pdf->addTextWrap($Left_Margin+310,$YPos,70,$FontSize,number_format($SectionPrdActual,$_SESSION['CompanyRecord']['decimalplaces']),'right'); + $LeftOvers = $pdf->addTextWrap($Left_Margin+370,$YPos,70,$FontSize,number_format($SectionPrdBudget,$_SESSION['CompanyRecord']['decimalplaces']),'right'); + $LeftOvers = $pdf->addTextWrap($Left_Margin+430,$YPos,70,$FontSize,number_format($SectionPrdLY,$_SESSION['CompanyRecord']['decimalplaces']),'right'); $YPos -= (2 * $line_height); } if ($Section == 2){ /*Cost of Sales - need sub total for Gross Profit*/ $LeftOvers = $pdf->addTextWrap($Left_Margin,$YPos,200,$FontSize,_('Gross Profit')); - $LeftOvers = $pdf->addTextWrap($Left_Margin+310,$YPos,70,$FontSize,number_format($TotalIncome - $SectionPrdActual),'right'); - $LeftOvers = $pdf->addTextWrap($Left_Margin+370,$YPos,70,$FontSize,number_format($TotalBudgetIncome - $SectionPrdBudget),'right'); - $LeftOvers = $pdf->addTextWrap($Left_Margin+430,$YPos,70,$FontSize,number_format($TotalLYIncome - $SectionPrdLY),'right'); + $LeftOvers = $pdf->addTextWrap($Left_Margin+310,$YPos,70,$FontSize,number_format($TotalIncome - $SectionPrdActual,$_SESSION['CompanyRecord']['decimalplaces']),'right'); + $LeftOvers = $pdf->addTextWrap($Left_Margin+370,$YPos,70,$FontSize,number_format($TotalBudgetIncome - $SectionPrdBudget,$_SESSION['CompanyRecord']['decimalplaces']),'right'); + $LeftOvers = $pdf->addTextWrap($Left_Margin+430,$YPos,70,$FontSize,number_format($TotalLYIncome - $SectionPrdLY,$_SESSION['CompanyRecord']['decimalplaces']),'right'); $pdf->line($Left_Margin+310, $YPos+$line_height,$Left_Margin+500, $YPos+$line_height); $pdf->line($Left_Margin+310, $YPos,$Left_Margin+500, $YPos); $YPos -= (2 * $line_height); @@ -381,13 +389,13 @@ $LeftOvers = $pdf->addTextWrap($Left_Margin,$YPos,60,$FontSize,$myrow['accountcode']); $LeftOvers = $pdf->addTextWrap($Left_Margin+60,$YPos,190,$FontSize,$myrow['accountname']); if ($Section == 1) { /*Income*/ - $LeftOvers = $pdf->addTextWrap($Left_Margin+310,$YPos,70,$FontSize,number_format(-$AccountPeriodActual),'right'); - $LeftOvers = $pdf->addTextWrap($Left_Margin+370,$YPos,70,$FontSize,number_format(-$AccountPeriodBudget),'right'); - $LeftOvers = $pdf->addTextWrap($Left_Margin+430,$YPos,70,$FontSize,number_format(-$AccountPeriodLY),'right'); + $LeftOvers = $pdf->addTextWrap($Left_Margin+310,$YPos,70,$FontSize,number_format(-$AccountPeriodActual,$_SESSION['CompanyRecord']['decimalplaces']),'right'); + $LeftOvers = $pdf->addTextWrap($Left_Margin+370,$YPos,70,$FontSize,number_format(-$AccountPeriodBudget,$_SESSION['CompanyRecord']['decimalplaces']),'right'); + $LeftOvers = $pdf->addTextWrap($Left_Margin+430,$YPos,70,$FontSize,number_format(-$AccountPeriodLY,$_SESSION['CompanyRecord']['decimalplaces']),'right'); } else { - $LeftOvers = $pdf->addTextWrap($Left_Margin+310,$YPos,70,$FontSize,number_format($AccountPeriodActual),'right'); - $LeftOvers = $pdf->addTextWrap($Left_Margin+370,$YPos,70,$FontSize,number_format($AccountPeriodBudget),'right'); - $LeftOvers = $pdf->addTextWrap($Left_Margin+430,$YPos,70,$FontSize,number_format($AccountPeriodLY),'right'); + $LeftOvers = $pdf->addTextWrap($Left_Margin+310,$YPos,70,$FontSize,number_format($AccountPeriodActual,$_SESSION['CompanyRecord']['decimalplaces']),'right'); + $LeftOvers = $pdf->addTextWrap($Left_Margin+370,$YPos,70,$FontSize,number_format($AccountPeriodBudget,$_SESSION['CompanyRecord']['decimalplaces']),'right'); + $LeftOvers = $pdf->addTextWrap($Left_Margin+430,$YPos,70,$FontSize,number_format($AccountPeriodLY,$_SESSION['CompanyRecord']['decimalplaces']),'right'); } $YPos -= $line_height; } @@ -406,15 +414,15 @@ } if ($Section == 1){ /*Income */ $LeftOvers = $pdf->addTextWrap($Left_Margin +($Level*10),$YPos,200 -($Level*10),$FontSize,$ActGrpLabel); - $LeftOvers = $pdf->addTextWrap($Left_Margin+310,$YPos,70,$FontSize,number_format(-$GrpPrdActual[$Level]),'right'); - $LeftOvers = $pdf->addTextWrap($Left_Margin+370,$YPos,70,$FontSize,number_format(-$GrpPrdBudget[$Level]),'right'); - $LeftOvers = $pdf->addTextWrap($Left_Margin+430,$YPos,70,$FontSize,number_format(-$GrpPrdLY[$Level]),'right'); + $LeftOvers = $pdf->addTextWrap($Left_Margin+310,$YPos,70,$FontSize,number_format(-$GrpPrdActual[$Level],$_SESSION['CompanyRecord']['decimalplaces']),'right'); + $LeftOvers = $pdf->addTextWrap($Left_Margin+370,$YPos,70,$FontSize,number_format(-$GrpPrdBudget[$Level],$_SESSION['CompanyRecord']['decimalplaces']),'right'); + $LeftOvers = $pdf->addTextWrap($Left_Margin+430,$YPos,70,$FontSize,number_format(-$GrpPrdLY[$Level],$_SESSION['CompanyRecord']['decimalplaces']),'right'); $YPos -= (2 * $line_height); } else { /*Costs */ $LeftOvers = $pdf->addTextWrap($Left_Margin +($Level*10),$YPos,200 -($Level*10),$FontSize,$ActGrpLabel); - $LeftOvers = $pdf->addTextWrap($Left_Margin+310,$YPos,70,$FontSize,number_format($GrpPrdActual[$Level]),'right'); - $LeftOvers = $pdf->addTextWrap($Left_Margin+370,$YPos,70,$FontSize,number_format($GrpPrdBudget[$Level]),'right'); - $LeftOvers = $pdf->addTextWrap($Left_Margin+430,$YPos,70,$FontSize,number_format($GrpPrdLY[$Level]),'right'); + $LeftOvers = $pdf->addTextWrap($Left_Margin+310,$YPos,70,$FontSize,number_format($GrpPrdActual[$Level],$_SESSION['CompanyRecord']['decimalplaces']),'right'); + $LeftOvers = $pdf->addTextWrap($Left_Margin+370,$YPos,70,$FontSize,number_format($GrpPrdBudget[$Level],$_SESSION['CompanyRecord']['decimalplaces']),'right'); + $LeftOvers = $pdf->addTextWrap($Left_Margin+430,$YPos,70,$FontSize,number_format($GrpPrdLY[$Level],$_SESSION['CompanyRecord']['decimalplaces']),'right'); $YPos -= (2 * $line_height); } $GrpPrdLY[$Level] = 0; @@ -434,15 +442,15 @@ $ActGrpLabel = $ParentGroups[$Level]; } if ($Section == 1){ /*Income */ - $LeftOvers = $pdf->addTextWrap($Left_Margin +($Level*10),$YPos,200 -($Level*10),$FontSize,$ActGrpLabel); $pdf->addTextWrap($Left_Margin+310,$YPos,70,$FontSize,number_format(-$GrpPrdActual[$Level]),'right'); - $LeftOvers = $pdf->addTextWrap($Left_Margin+370,$YPos,70,$FontSize,number_format(-$GrpPrdBudget[$Level]),'right'); - $LeftOvers = $pdf->addTextWrap($Left_Margin+430,$YPos,70,$FontSize,number_format(-$GrpPrdLY[$Level]),'right'); + $LeftOvers = $pdf->addTextWrap($Left_Margin +($Level*10),$YPos,200 -($Level*10),$FontSize,$ActGrpLabel); $pdf->addTextWrap($Left_Margin+310,$YPos,70,$FontSize,number_format(-$GrpPrdActual[$Level],$_SESSION['CompanyRecord']['decimalplaces']),'right'); + $LeftOvers = $pdf->addTextWrap($Left_Margin+370,$YPos,70,$FontSize,number_format(-$GrpPrdBudget[$Level],$_SESSION['CompanyRecord']['decimalplaces']),'right'); + $LeftOvers = $pdf->addTextWrap($Left_Margin+430,$YPos,70,$FontSize,number_format(-$GrpPrdLY[$Level],$_SESSION['CompanyRecord']['decimalplaces']),'right'); $YPos -= (2 * $line_height); } else { /*Costs */ $LeftOvers = $pdf->addTextWrap($Left_Margin +($Level*10),$YPos,200 -($Level*10),$FontSize,$ActGrpLabel); - $LeftOvers = $pdf->addTextWrap($Left_Margin+310,$YPos,70,$FontSize,number_format($GrpPrdActual[$Level]),'right'); - $LeftOvers = $pdf->addTextWrap($Left_Margin+370,$YPos,70,$FontSize,number_format($GrpPrdBudget[$Level]),'right'); - $LeftOvers = $pdf->addTextWrap($Left_Margin+430,$YPos,70,$FontSize,number_format($GrpPrdLY[$Level]),'right'); + $LeftOvers = $pdf->addTextWrap($Left_Margin+310,$YPos,70,$FontSize,number_format($GrpPrdActual[$Level],$_SESSION['CompanyRecord']['decimalplaces']),'right'); + $LeftOvers = $pdf->addTextWrap($Left_Margin+370,$YPos,70,$FontSize,number_format($GrpPrdBudget[$Level],$_SESSION['CompanyRecord']['decimalplaces']),'right'); + $LeftOvers = $pdf->addTextWrap($Left_Margin+430,$YPos,70,$FontSize,number_format($GrpPrdLY[$Level],$_SESSION['CompanyRecord']['decimalplaces']),'right'); $YPos -= (2 * $line_height); } $GrpPrdLY[$Level] = 0; @@ -463,9 +471,9 @@ if ($Section == 1) { /*Income*/ $LeftOvers = $pdf->addTextWrap($Left_Margin,$YPos,200,$FontSize,$Sections[$Section]); - $LeftOvers = $pdf->addTextWrap($Left_Margin+310,$YPos,70,$FontSize,number_format(-$SectionPrdActual),'right'); - $LeftOvers = $pdf->addTextWrap($Left_Margin+370,$YPos,70,$FontSize,number_format(-$SectionPrdBudget),'right'); - $LeftOvers = $pdf->addTextWrap($Left_Margin+430,$YPos,70,$FontSize,number_format(-$SectionPrdLY),'right'); + $LeftOvers = $pdf->addTextWrap($Left_Margin+310,$YPos,70,$FontSize,number_format(-$SectionPrdActual,$_SESSION['CompanyRecord']['decimalplaces']),'right'); + $LeftOvers = $pdf->addTextWrap($Left_Margin+370,$YPos,70,$FontSize,number_format(-$SectionPrdBudget,$_SESSION['CompanyRecord']['decimalplaces']),'right'); + $LeftOvers = $pdf->addTextWrap($Left_Margin+430,$YPos,70,$FontSize,number_format(-$SectionPrdLY,$_SESSION['CompanyRecord']['decimalplaces']),'right'); $YPos -= (2 * $line_height); $TotalIncome = -$SectionPrdActual; @@ -473,16 +481,16 @@ $TotalLYIncome = -$SectionPrdLY; } else { $LeftOvers = $pdf->addTextWrap($Left_Margin,$YPos,60,$FontSize,$Sections[$Section]); - $LeftOvers = $pdf->addTextWrap($Left_Margin+310,$YPos,70,$FontSize,number_format($SectionPrdActual),'right'); - $LeftOvers = $pdf->addTextWrap($Left_Margin+370,$YPos,70,$FontSize,number_format($SectionPrdBudget),'right'); - $LeftOvers = $pdf->addTextWrap($Left_Margin+430,$YPos,70,$FontSize,number_format($SectionPrdLY),'right'); + $LeftOvers = $pdf->addTextWrap($Left_Margin+310,$YPos,70,$FontSize,number_format($SectionPrdActual,$_SESSION['CompanyRecord']['decimalplaces']),'right'); + $LeftOvers = $pdf->addTextWrap($Left_Margin+370,$YPos,70,$FontSize,number_format($SectionPrdBudget,$_SESSION['CompanyRecord']['decimalplaces']),'right'); + $LeftOvers = $pdf->addTextWrap($Left_Margin+430,$YPos,70,$FontSize,number_format($SectionPrdLY,$_SESSION['CompanyRecord']['decimalplaces']),'right'); $YPos -= (2 * $line_height); } if ($Section == 2){ /*Cost of Sales - need sub total for Gross Profit*/ $LeftOvers = $pdf->addTextWrap($Left_Margin,$YPos,60,$FontSize,_('Gross Profit')); - $LeftOvers = $pdf->addTextWrap($Left_Margin+310,$YPos,70,$FontSize,number_format($TotalIncome - $SectionPrdActual),'right'); - $LeftOvers = $pdf->addTextWrap($Left_Margin+370,$YPos,70,$FontSize,number_format($TotalBudgetIncome - $SectionPrdBudget),'right'); - $LeftOvers = $pdf->addTextWrap($Left_Margin+430,$YPos,70,$FontSize,number_format($TotalLYIncome - $SectionPrdLY),'right'); + $LeftOvers = $pdf->addTextWrap($Left_Margin+310,$YPos,70,$FontSize,number_format($TotalIncome - $SectionPrdActual,$_SESSION['CompanyRecord']['decimalplaces']),'right'); + $LeftOvers = $pdf->addTextWrap($Left_Margin+370,$YPos,70,$FontSize,number_format($TotalBudgetIncome - $SectionPrdBudget,$_SESSION['CompanyRecord']['decimalplaces']),'right'); + $LeftOvers = $pdf->addTextWrap($Left_Margin+430,$YPos,70,$FontSize,number_format($TotalLYIncome - $SectionPrdLY,$_SESSION['CompanyRecord']['decimalplaces']),'right'); $YPos -= (2 * $line_height); $LeftOvers = $pdf->addTextWrap($Left_Margin+310,$YPos,70,$FontSize,number_format(100*($TotalIncome - $SectionPrdActual)/$TotalIncome,1) . '%','right'); @@ -493,9 +501,9 @@ } $LeftOvers = $pdf->addTextWrap($Left_Margin,$YPos,60,$FontSize,_('Profit').' - '._('Loss')); - $LeftOvers = $pdf->addTextWrap($Left_Margin+310,$YPos,70,$FontSize,number_format(-$PeriodProfitLoss),'right'); + $LeftOvers = $pdf->addTextWrap($Left_Margin+310,$YPos,70,$FontSize,number_format(-$PeriodProfitLoss,$_SESSION['CompanyRecord']['decimalplaces']),'right'); $LeftOvers = $pdf->addTextWrap($Left_Margin+370,$YPos,70,$FontSize,number_format(-$PeriodBudgetProfitLoss),'right'); - $LeftOvers = $pdf->addTextWrap($Left_Margin+430,$YPos,70,$FontSize,number_format(-$PeriodLYProfitLoss),'right'); + $LeftOvers = $pdf->addTextWrap($Left_Margin+430,$YPos,70,$FontSize,number_format(-$PeriodLYProfitLoss,$_SESSION['CompanyRecord']['decimalplaces']),'right'); $YPos -= (2 * $line_height); if ($TotalIncome != 0){ @@ -531,13 +539,13 @@ include('includes/header.inc'); 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; if ($NumberOfMonths >12){ - echo '<p>'; + echo '<br />'; prnMsg(_('A period up to 12 months in duration can be specified') . ' - ' . _('the system automatically shows a comparative for the same period from the previous year') . ' - ' . _('it cannot do this if a period of more than 12 months is specified') . '. ' . _('Please select an alternative period range'),'error'); include('includes/footer.inc'); exit; @@ -550,32 +558,32 @@ $SQL = "SELECT accountgroups.sectioninaccounts, - accountgroups.parentgroupname, - accountgroups.groupname, - chartdetails.accountcode, - chartmaster.accountname, - Sum(CASE WHEN chartdetails.period='" . $_POST['FromPeriod'] . "' THEN chartdetails.bfwd ELSE 0 END) AS firstprdbfwd, - Sum(CASE WHEN chartdetails.period='" . $_POST['FromPeriod'] . "' THEN chartdetails.bfwdbudget ELSE 0 END) AS firstprdbudgetbfwd, - Sum(CASE WHEN chartdetails.period='" . $_POST['ToPeriod'] . "' THEN chartdetails.bfwd + chartdetails.actual ELSE 0 END) AS lastprdcfwd, - Sum(CASE WHEN chartdetails.period='" . ($_POST['FromPeriod'] - 12) . "' THEN chartdetails.bfwd ELSE 0 END) AS lyfirstprdbfwd, - Sum(CASE WHEN chartdetails.period='" . ($_POST['ToPeriod']-12) . "' THEN chartdetails.bfwd + chartdetails.actual ELSE 0 END) AS lylastprdcfwd, - Sum(CASE WHEN chartdetails.period='" . $_POST['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 - WHERE accountgroups.pandl=1 - GROUP BY accountgroups.sectioninaccounts, - accountgroups.parentgroupname, - accountgroups.groupname, - chartdetails.accountcode, - chartmaster.accountname, - accountgroups.sequenceintb - ORDER BY accountgroups.sectioninaccounts, - accountgroups.sequenceintb, - accountgroups.groupname, - accountgroups.sequenceintb, - chartdetails.accountcode"; - + accountgroups.parentgroupname, + accountgroups.groupname, + chartdetails.accountcode, + chartmaster.accountname, + SUM(CASE WHEN chartdetails.period='" . $_POST['FromPeriod'] . "' THEN chartdetails.bfwd ELSE 0 END) AS firstprdbfwd, + SUM(CASE WHEN chartdetails.period='" . $_POST['FromPeriod'] . "' THEN chartdetails.bfwdbudget ELSE 0 END) AS firstprdbudgetbfwd, + SUM(CASE WHEN chartdetails.period='" . $_POST['ToPeriod'] . "' THEN chartdetails.bfwd + chartdetails.actual ELSE 0 END) AS lastprdcfwd, + SUM(CASE WHEN chartdetails.period='" . ($_POST['FromPeriod'] - 12) . "' THEN chartdetails.bfwd ELSE 0 END) AS lyfirstprdbfwd, + SUM(CASE WHEN chartdetails.period='" . ($_POST['ToPeriod']-12) . "' THEN chartdetails.bfwd + chartdetails.actual ELSE 0 END) AS lylastprdcfwd, + SUM(CASE WHEN chartdetails.period='" . $_POST['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 + WHERE accountgroups.pandl=1 + GROUP BY accountgroups.sectioninaccounts, + accountgroups.parentgroupname, + accountgroups.groupname, + chartdetails.accountcode, + chartmaster.accountname, + accountgroups.sequenceintb + ORDER BY accountgroups.sectioninaccounts, + accountgroups.sequenceintb, + accountgroups.groupname, + accountgroups.sequenceintb, + chartdetails.accountcode"; + $AccountsResult = DB_query($SQL,$db,_('No general ledger accounts were returned by the SQL because'),_('The SQL that failed was')); echo '<p class="page_title_text"><img src="'.$rootpath.'/css/'.$theme.'/images/transactions.png" title="' . _('General Ledger Profit Loss Inquiry') . '" alt="" />' . ' ' . _('Statement of Profit and Loss for the') . ' ' . $NumberOfMonths . ' ' . _('months to') . ' and including ' . $PeriodToDate . '</p>'; @@ -587,19 +595,19 @@ 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>'; + <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>'; + <th colspan=2></th> + <th colspan=2>' . _('Period Actual') .'</th> + <th colspan=2>' . _('Period Budget') . '</th> + <th colspan=2>' . _('Last Year') . '</th> + </tr>'; } @@ -635,41 +643,41 @@ while ($myrow['groupname']!=$ParentGroups[$Level] AND $Level>0) { if ($_POST['Detail']=='Detailed'){ echo '<tr> - <td colspan=2></td> - <td colspan=6><hr></td> - </tr>'; + <td colspan=2></td> + <td colspan=6><hr></td> + </tr>'; $ActGrpLabel = str_repeat('___',$Level) . $ParentGroups[$Level] . ' ' . _('total'); } else { $ActGrpLabel = str_repeat('___',$Level) . $ParentGroups[$Level]; } if ($Section ==1){ /*Income */ printf('<tr> - <td colspan=2><font size=2><I>%s </I></font></td> - <td></td> - <td class=number>%s</td> - <td></td> - <td class=number>%s</td> - <td></td> - <td class=number>%s</td> - </tr>', - $ActGrpLabel, - number_format(-$GrpPrdActual[$Level]), - number_format(-$GrpPrdBudget[$Level]), - number_format(-$GrpPrdLY[$Level])); + <td colspan=2><font size=2><I>%s </I></font></td> + <td></td> + <td class=number>%s</td> + <td></td> + <td class=number>%s</td> + <td></td> + <td class=number>%s</td> + </tr>', + $ActGrpLabel, + number_format(-$GrpPrdActual[$Level],$_SESSION['CompanyRecord']['decimalplaces']), + number_format(-$GrpPrdBudget[$Level],$_SESSION['CompanyRecord']['decimalplaces']), + number_format(-$GrpPrdLY[$Level],$_SESSION['CompanyRecord']['decimalplaces'])); } else { /*Costs */ printf('<tr> - <td colspan=2><font size=2><I>%s </I></font></td> - <td class=number>%s</td> - <td></td> - <td class=number>%s</td> - <td></td> - <td class=number>%s</td> - <td></td> - </tr>', - $ActGrpLabel, - number_format($GrpPrdActual[$Level]), - number_format($GrpPrdBudget[$Level]), - number_format($GrpPrdLY[$Level])); + <td colspan=2><font size=2><I>%s </I></font></td> + <td class=number>%s</td> + <td></td> + <td class=number>%s</td> + <td></td> + <td class=number>%s</td> + <td></td> + </tr>', + $ActGrpLabel, + number_format($GrpPrdActual[$Level],$_SESSION['CompanyRecord']['decimalplaces']), + number_format($GrpPrdBudget[$Level],$_SESSION['CompanyRecord']['decimalplaces']), + number_format($GrpPrdLY[$Level],$_SESSION['CompanyRecord']['decimalplaces'])); } $GrpPrdLY[$Level] = 0; $GrpPrdActual[$Level] = 0; @@ -680,9 +688,9 @@ //still need to print out the old group totals if ($_POST['Detail']=='Detailed'){ echo '<tr> - <td colspan=2></td> - <td colspan=6><hr></td> - </tr>'; + <td colspan=2></td> + <td colspan=6><hr></td> + </tr>'; $ActGrpLabel = str_repeat('___',$Level) . $ParentGroups[$Level] . ' ' . _('total'); } else { $ActGrpLabel = str_repeat('___',$Level) . $ParentGroups[$Level]; @@ -690,32 +698,32 @@ if ($Section ==1){ /*Income */ printf('<tr> - <td colspan=2><font size=2><I>%s </I></font></td> - <td></td> - <td class=number>%s</td> - <td></td> - <td class=number>%s</td> - <td></td> - <td class=number>%s</td> - </tr>', - $ActGrpLabel, - number_format(-$GrpPrdActual[$Level]), - number_format(-$GrpPrdBudget[$Level]), - number_format(-$GrpPrdLY[$Level])); + <td colspan=2><font size=2><I>%s </I></font></td> + <td></td> + <td class=number>%s</td> + <td></td> + <td class=number>%s</td> + <td></td> + <td class=number>%s</td> + </tr>', + $ActGrpLabel, + number_format(-$GrpPrdActual[$Level],$_SESSION['CompanyRecord']['decimalplaces']), + number_format(-$GrpPrdBudget[$Level],$_SESSION['CompanyRecord']['decimalplaces']), + number_format(-$GrpPrdLY[$Level],$_SESSION['CompanyRecord']['decimalplaces'])); } else { /*Costs */ printf('<tr> - <td colspan=2><font size=2><I>%s </I></font></td> - <td class=number>%s</td> - <td></td> - <td class=number>%s</td> - <td></td> - <td class=number>%s</td> - <td></td> - </tr>', - $ActGrpLabel, - number_format($GrpPrdActual[$Level]), - number_format($GrpPrdBudget[$Level]), - number_format($GrpPrdLY[$Level])); + <td colspan=2><font size=2><I>%s </I></font></td> + <td class=number>%s</td> + <td></td> + <td class=number>%s</td> + <td></td> + <td class=number>%s</td> + <td></td> + </tr>', + $ActGrpLabel, + number_format($GrpPrdActual[$Level],$_SESSION['CompanyRecord']['decimalplaces']), + number_format($GrpPrdBudget[$Level],$_SESSION['CompanyRecord']['decimalplaces']), + number_format($GrpPrdLY[$Level],$_SESSION['CompanyRecord']['decimalplaces'])); } $GrpPrdLY[$Level] = 0; $GrpPrdActual[$Level] = 0; @@ -731,71 +739,71 @@ if ($Section==1) { /*Income*/ echo '<tr> - <td colspan=3></td> + <td colspan=3></td> <td><hr></td> - <td></td> - <td><hr></td> - <td></td> - <td><hr></td> - </tr>'; + <td></td> + <td><hr></td> + <td></td> + <td><hr></td> + </tr>'; printf('<tr> - <td colspan=2><font size=4>%s</font></td> - <td></td> - <td class=number>%s</td> - <td></td> - <td class=number>%s</td> - <td></td> - <td class=number>%s</td> - </tr>', - $Sections[$Section], - number_format(-$SectionPrdActual), - number_format(-$SectionPrdBudget), - number_format(-$SectionPrdLY)); - $TotalIncome = -$SectionPrdActual; - $TotalBudgetIncome = -$SectionPrdBudget; - $TotalLYIncome = -$SectionPrdLY; + <td colspan=2><font size=4>%s</font></td> + <td></td> + <td class=number>%s</td> + <td></td> + <td class=number>%s</td> + <td></td> + <td class=number>%s</td> + </tr>', + $Sections[$Section], + number_format(-$SectionPrdActual,$_SESSION['CompanyRecord']['decimalplaces']), + number_format(-$SectionPrdBudget,$_SESSION['CompanyRecord']['decimalplaces']), + number_format(-$SectionPrdLY,$_SESSION['CompanyRecord']['decimalplaces'])); + $TotalIncome = -$SectionPrdActual; + $TotalBudgetIncome = -$SectionPrdBudget; + $TotalLYIncome = -$SectionPrdLY; } else { echo '<tr> - <td colspan=2></td> - <td><hr></td> - <td></td> - <td><hr></td> - <td></td> - <td><hr></td> - </tr>'; - printf('<tr> - <td colspan=2><font size=4>%s</font></td> - <td></td> - <td class=number>%s</td> - <td></td> - <td class=number>%s</td> - <td></td> - <td class=number>%s</td> - </tr>', - $Sections[$Section], - number_format($SectionPrdActual), - number_format($SectionPrdBudget), - number_format($SectionPrdLY)); + <td colspan=2></td> + <td><hr></td> + <td></td> + <td><hr></td> + <td></td> + <td><hr></td> + </tr>'; + printf('<tr> + <td colspan=2><font size=4>%s</font></td> + <td></td> + <td class=number>%s</td> + <td></td> + <td class=number>%s</td> + <td></td> + <td class=number>%s</td> + </tr>', + $Sections[$Section], + number_format($SectionPrdActual,$_SESSION['CompanyRecord']['decimalplaces']), + number_format($SectionPrdBudget,$_SESSION['CompanyRecord']['decimalplaces']), + number_format($SectionPrdLY,$_SESSION['CompanyRecord']['decimalplaces'])); } if ($Section==2){ /*Cost of Sales - need sub total for Gross Profit*/ echo '<tr> - <td colspan=2></td> - <td colspan=6><hr></td> - </tr>'; + <td colspan=2></td> + <td colspan=6><hr></td> + </tr>'; printf('<tr> - <td colspan=2><font size=4>'._('Gross Profit').'</font></td> - <td></td> - <td class=number>%s</td> - <td></td> - <td class=number>%s</td> - <td></td> - <td class=number>%s</td> - </tr>', - number_format($TotalIncome - $SectionPrdActual), - number_format($TotalBudgetIncome - $SectionPrdBudget), - number_format($TotalLYIncome - $SectionPrdLY)); - + <td colspan=2><font size=4>'._('Gross Profit').'</font></td> + <td></td> + <td class=number>%s</td> + <td></td> + <td class=number>%s</td> + <td></td> + <td class=number>%s</td> + </tr>', + number_format($TotalIncome - $SectionPrdActual,$_SESSION['CompanyRecord']['decimalplaces']), + number_format($TotalBudgetIncome - $SectionPrdBudget,$_SESSION['CompanyRecord']['decimalplaces']), + number_format($TotalLYIncome - $SectionPrdLY,$_SESSION['CompanyRecord']['decimalplaces'])); + if ($TotalIncome !=0){ $PrdGPPercent = 100*($TotalIncome - $SectionPrdActual)/$TotalIncome; } else { @@ -812,21 +820,21 @@ $LYGPPercent = 0; } echo '<tr> - <td colspan=2></td> - <td colspan=6><hr></td> - </tr>'; + <td colspan=2></td> + <td colspan=6><hr></td> + </tr>'; printf('<tr> - <td colspan=2><font size=2><I>'._('Gross Profit Percent').'</I></font></td> - <td></td> - <td class=number><I>%s</I></td> - <td></td> - <td class=number><I>%s</I></td> - <td></td> - <td class=number><I>%s</I></td> - </tr><tr><td colspan=6> </td></tr>', - number_format($PrdGPPercent,1) . '%', - number_format($BudgetGPPercent,1) . '%', - number_format($LYGPPercent,1). '%'); + <td colspan=2><font size=2><I>'._('Gross Profit Percent').'</I></font></td> + <td></td> + <td class=number><I>%s</I></td> + <td></td> + <td class=number><I>%s</I></td> + <td></td> + <td class=number><I>%s</I></td> + </tr><tr><td colspan=6> </td></tr>', + number_format($PrdGPPercent,1) . '%', + number_format($BudgetGPPercent,1) . '%', + number_format($LYGPPercent,1). '%'); $j++; } } @@ -898,34 +906,34 @@ if ($Section ==1){ printf('<td>%s</td> - <td>%s</td> - <td></td> - <td class=number>%s</td> - <td></td> - <td class=number>%s</td> - <td></td> - <td class=number>%s</td> - </tr>', - $ActEnquiryURL, - $myrow['accountname'], - number_format(-$AccountPeriodActual), - number_format(-$AccountPeriodBudget), - number_format(-$AccountPeriodLY)); + <td>%s</td> + <td></td> + <td class=number>%s</td> + <td></td> + <td class=number>%s</td> + <td></td> + <td class=number>%s</td> + </tr>', + $ActEnquiryURL, + $myrow['accountname'], + number_format(-$AccountPeriodActual,$_SESSION['CompanyRecord']['decimalplaces']), + number_format(-$AccountPeriodBudget,$_SESSION['CompanyRecord']['decimalplaces']), + number_format(-$AccountPeriodLY,$_SESSION['CompanyRecord']['decimalplaces'])); } else { printf('<td>%s</td> - <td>%s</td> - <td class=number>%s</td> - <td></td> - <td class=number>%s</td> - <td></td> - <td class=number>%s</td> - <td></td> - </tr>', - $ActEnquiryURL, - $myrow['accountname'], - number_format($AccountPeriodActual), - number_format($AccountPeriodBudget), - number_format($AccountPeriodLY)); + <td>%s</td> + <td class=number>%s</td> + <td></td> + <td class=number>%s</td> + <td></td> + <td class=number>%s</td> + <td></td> + </tr>', + $ActEnquiryURL, + $myrow['accountname'], + number_format($AccountPeriodActual,$_SESSION['CompanyRecord']['decimalplaces']), + number_format($AccountPeriodBudget,$_SESSION['CompanyRecord']['decimalplaces']), + number_format($AccountPeriodLY,$_SESSION['Compan... [truncated message content] |
From: <dai...@us...> - 2011-07-14 10:27:37
|
Revision: 4630 http://web-erp.svn.sourceforge.net/web-erp/?rev=4630&view=rev Author: daintree Date: 2011-07-14 10:27:29 +0000 (Thu, 14 Jul 2011) Log Message: ----------- consistency review Modified Paths: -------------- trunk/GLAccountCSV.php trunk/GLAccountInquiry.php trunk/GLAccountReport.php trunk/GLProfit_Loss.php trunk/GLTagProfit_Loss.php trunk/GLTags.php trunk/GLTransInquiry.php trunk/GLTrialBalance.php trunk/GLTrialBalance_csv.php trunk/GetStockImage.php trunk/GoodsReceived.php trunk/Stocks.php trunk/includes/session.inc Modified: trunk/GLAccountCSV.php =================================================================== --- trunk/GLAccountCSV.php 2011-07-09 08:22:59 UTC (rev 4629) +++ trunk/GLAccountCSV.php 2011-07-14 10:27:29 UTC (rev 4630) @@ -43,7 +43,7 @@ echo '</select></td>'; echo '<td>'._('For Period range').':</td> - <td><select Name=Period[] multiple>'; + <td><select name="Period[]" multiple>'; $sql = "SELECT periodno, lastdate_in_period FROM periods ORDER BY periodno DESC"; $Periods = DB_query($sql,$db); $id=0; @@ -139,30 +139,30 @@ gltrans.periodno, gltrans.tag FROM gltrans, systypes - WHERE gltrans.account = '$SelectedAccount' + WHERE gltrans.account = '" . $SelectedAccount . "' AND systypes.typeid=gltrans.type AND posted=1 - AND periodno>='$FirstPeriodSelected' - AND periodno<='$LastPeriodSelected' + AND periodno>='" . $FirstPeriodSelected . "' + AND periodno<='" . $LastPeriodSelected . "' ORDER BY periodno, gltrans.trandate, counterindex"; } else { $sql= "SELECT gltrans.type, - gltrans.typename, - gltrans.typeno, - gltrans.trandate, - gltrans.narrative, - gltrans.amount, - gltrans.periodno, - gltrans.tag - FROM gltrans, systypes - WHERE gltrans.account = '$SelectedAccount' - AND systypes.typeid=gltrans.type - AND posted=1 - AND periodno>='$FirstPeriodSelected' - AND periodno<='$LastPeriodSelected' - AND tag='".$_POST['tag']."' - ORDER BY periodno, gltrans.trandate, counterindex"; + gltrans.typename, + gltrans.typeno, + gltrans.trandate, + gltrans.narrative, + gltrans.amount, + gltrans.periodno, + gltrans.tag + FROM gltrans, systypes + WHERE gltrans.account = '" . $SelectedAccount . "' + AND systypes.typeid=gltrans.type + AND posted=1 + AND periodno>='" . $FirstPeriodSelected . "' + AND periodno<='" . $LastPeriodSelected . "' + AND tag='".$_POST['tag']."' + ORDER BY periodno, gltrans.trandate, counterindex"; } $ErrMsg = _('The transactions for account') . ' ' . $SelectedAccount . ' ' . _('could not be retrieved because') ; @@ -176,7 +176,7 @@ actual, period FROM chartdetails - WHERE chartdetails.accountcode= '$SelectedAccount' + WHERE chartdetails.accountcode= '" . $SelectedAccount . "' AND chartdetails.period='" . $FirstPeriodSelected . "'"; $ErrMsg = _('The chart details for account') . ' ' . $SelectedAccount . ' ' . _('could not be retrieved'); @@ -202,11 +202,11 @@ if ($PeriodNo!=-9999){ //ie its not the first time around /*Get the ChartDetails balance b/fwd and the actual movement in the account for the period as recorded in the chart details - need to ensure integrity of transactions to the chart detail movements. Also, for a balance sheet account it is the balance carried forward that is important, not just the transactions*/ $sql = "SELECT bfwd, - actual, - period - FROM chartdetails - WHERE chartdetails.accountcode= '$SelectedAccount' - AND chartdetails.period='" . $PeriodNo . "'"; + actual, + period + FROM chartdetails + WHERE chartdetails.accountcode= '" . $SelectedAccount . "' + AND chartdetails.period='" . $PeriodNo . "'"; $ErrMsg = _('The chart details for account') . ' ' . $SelectedAccount . ' ' . _('could not be retrieved'); $ChartDetailsResult = DB_query($sql,$db,$ErrMsg); Modified: trunk/GLAccountInquiry.php =================================================================== --- trunk/GLAccountInquiry.php 2011-07-09 08:22:59 UTC (rev 4629) +++ trunk/GLAccountInquiry.php 2011-07-14 10:27:29 UTC (rev 4630) @@ -1,9 +1,7 @@ <?php /* $Id$*/ -/* $Revision: 1.28 $ */ -//$PageSecurity = 8; include ('includes/session.inc'); $title = _('General Ledger Account Inquiry'); include('includes/header.inc'); Modified: trunk/GLAccountReport.php =================================================================== --- trunk/GLAccountReport.php 2011-07-09 08:22:59 UTC (rev 4629) +++ trunk/GLAccountReport.php 2011-07-14 10:27:29 UTC (rev 4630) @@ -1,9 +1,6 @@ <?php +/* $Id: GLAccountReport.php 4618 2011-07-02 23:04:59Z daintree $*/ -/* $Id: $*/ -/* $Revision: 1.00 $ */ - -//$PageSecurity = 8; include ('includes/session.inc'); if (isset($_POST['Period'])){ @@ -39,10 +36,10 @@ foreach ($_POST['Account'] as $SelectedAccount){ /*Is the account a balance sheet or a profit and loss account */ $result = DB_query("SELECT chartmaster.accountname, - accountgroups.pandl - FROM accountgroups - INNER JOIN chartmaster ON accountgroups.groupname=chartmaster.group_ - WHERE chartmaster.accountcode=$SelectedAccount",$db); + accountgroups.pandl + FROM accountgroups + INNER JOIN chartmaster ON accountgroups.groupname=chartmaster.group_ + WHERE chartmaster.accountcode='" . $SelectedAccount . "'",$db); $AccountDetailRow = DB_fetch_row($result); $AccountName = $AccountDetailRow[0]; if ($AccountDetailRow[1]==1){ @@ -56,38 +53,42 @@ if ($_POST['tag']==0) { $sql= "SELECT type, - typename, - gltrans.typeno, - gltrans.trandate, - gltrans.narrative, - gltrans.amount, - gltrans.periodno, - gltrans.tag - FROM gltrans, systypes - WHERE gltrans.account = $SelectedAccount - AND systypes.typeid=gltrans.type - AND posted=1 - AND periodno>=$FirstPeriodSelected - AND periodno<=$LastPeriodSelected - ORDER BY periodno, gltrans.trandate, counterindex"; + typename, + gltrans.typeno, + gltrans.trandate, + gltrans.narrative, + gltrans.amount, + gltrans.periodno, + gltrans.tag + FROM gltrans INNER JOIN systypes + ON gltrans.type=systypes.typeid + WHERE gltrans.account = '" . $SelectedAccount . "' + AND posted=1 + AND periodno>='" . $FirstPeriodSelected . "' + AND periodno<='" . $LastPeriodSelected . "' + ORDER BY periodno, + gltrans.trandate, + counterindex"; } else { $sql= "SELECT gltrans.type, - gltrans.typename, - gltrans.typeno, - gltrans.trandate, - gltrans.narrative, - gltrans.amount, - gltrans.periodno, - gltrans.tag - FROM gltrans, systypes - WHERE gltrans.account = $SelectedAccount - AND systypes.typeid=gltrans.type - AND posted=1 - AND periodno>=$FirstPeriodSelected - AND periodno<=$LastPeriodSelected - AND tag='".$_POST['tag']."' - ORDER BY periodno, gltrans.trandate, counterindex"; + gltrans.typename, + gltrans.typeno, + gltrans.trandate, + gltrans.narrative, + gltrans.amount, + gltrans.periodno, + gltrans.tag + FROM gltrans INNER JOIN systypes + ON gltrans.type=systypes.typeid + WHERE gltrans.account = '" . $SelectedAccount . "' + AND posted=1 + AND periodno>='" . $FirstPeriodSelected . "' + AND periodno<='" . $LastPeriodSelected . "' + AND tag='" . $_POST['tag'] . "' + ORDER BY periodno, + gltrans.trandate, + counterindex"; } $ErrMsg = _('The transactions for account') . ' ' . $SelectedAccount . ' ' . _('could not be retrieved because') ; @@ -105,11 +106,11 @@ $RunningTotal = 0; } else { $sql = "SELECT bfwd, - actual, - period - FROM chartdetails - WHERE chartdetails.accountcode='" . $SelectedAccount . - "' AND chartdetails.period='" . $FirstPeriodSelected . "'"; + actual, + period + FROM chartdetails + WHERE chartdetails.accountcode='" . $SelectedAccount . "' + AND chartdetails.period='" . $FirstPeriodSelected . "'"; $ErrMsg = _('The chart details for account') . ' ' . $SelectedAccount . ' ' . _('could not be retrieved'); $ChartDetailsResult = DB_query($sql,$db,$ErrMsg); @@ -137,11 +138,11 @@ if ($PeriodNo!=-9999){ //ie its not the first time around /*Get the ChartDetails balance b/fwd and the actual movement in the account for the period as recorded in the chart details - need to ensure integrity of transactions to the chart detail movements. Also, for a balance sheet account it is the balance carried forward that is important, not just the transactions*/ $sql = "SELECT bfwd, - actual, - period - FROM chartdetails - WHERE chartdetails.accountcode='" . $SelectedAccount . - "' AND chartdetails.period='" . $PeriodNo . "'"; + actual, + period + FROM chartdetails + WHERE chartdetails.accountcode='" . $SelectedAccount . "' + AND chartdetails.period='" . $PeriodNo . "'"; $ErrMsg = _('The chart details for account') . ' ' . $SelectedAccount . ' ' . _('could not be retrieved'); $ChartDetailsResult = DB_query($sql,$db,$ErrMsg); @@ -149,9 +150,9 @@ $YPos -=$line_height; $LeftOvers = $pdf->addTextWrap($Left_Margin,$YPos,150,$FontSize, _('Period Total')); if ($PeriodTotal < 0 ){ //its a credit balance b/fwd - $LeftOvers = $pdf->addTextWrap(210,$YPos,50,$FontSize, number_format(-$PeriodTotal,2) , 'right'); + $LeftOvers = $pdf->addTextWrap(210,$YPos,50,$FontSize, number_format(-$PeriodTotal,$_SESSION['CompanyRecord']['decimalplaces']) , 'right'); } else { //its a debit balance b/fwd - $LeftOvers = $pdf->addTextWrap(160,$YPos,50,$FontSize, number_format($PeriodTotal,2) , 'right'); + $LeftOvers = $pdf->addTextWrap(160,$YPos,50,$FontSize, number_format($PeriodTotal,$_SESSION['CompanyRecord']['decimalplaces']) , 'right'); } } $PeriodNo = $myrow['periodno']; @@ -162,10 +163,10 @@ $PeriodTotal += $myrow['amount']; if($myrow['amount']>=0){ - $DebitAmount = number_format($myrow['amount'],2); + $DebitAmount = number_format($myrow['amount'],$_SESSION['CompanyRecord']['decimalplaces']); $CreditAmount = ''; } elseif ($myrow['amount']<0){ - $CreditAmount = number_format(-$myrow['amount'],2); + $CreditAmount = number_format(-$myrow['amount'],$_SESSION['CompanyRecord']['decimalplaces']); $DebitAmount = ''; } @@ -201,9 +202,9 @@ $LeftOvers = $pdf->addTextWrap($Left_Margin,$YPos,150,$FontSize, _('Balance C/Fwd')); } if ($RunningTotal < 0){ - $LeftOvers = $pdf->addTextWrap(210,$YPos,50,$FontSize, number_format(-$RunningTotal,2) , 'right'); + $LeftOvers = $pdf->addTextWrap(210,$YPos,50,$FontSize, number_format(-$RunningTotal,$_SESSION['CompanyRecord']['decimalplaces']) , 'right'); } else { //its a debit balance b/fwd - $LeftOvers = $pdf->addTextWrap(160,$YPos,50,$FontSize, number_format($RunningTotal,2) , 'right'); + $LeftOvers = $pdf->addTextWrap(160,$YPos,50,$FontSize, number_format($RunningTotal,$_SESSION['CompanyRecord']['decimalplaces']) , 'right'); } $YPos -=$line_height; //draw a line under each account printed @@ -218,28 +219,6 @@ } else { //print the report - /* - $pdfcode = $pdf->output(); - $len = mb_strlen($pdfcode); - - if ($len<=20){ - $title = _('Print GL Accounts Report Error'); - include('includes/header.inc'); - prnMsg (_('There were no accounts to print out'),'error'); - echo "<br /><a href='$rootpath/index.php?" . SID . "'>" . _('Back to the menu') . '</a>'; - include('includes/footer.inc'); - exit; - } else { - header('Content-type: application/pdf'); - header('Content-Length: ' . $len); - header('Content-Disposition: inline; filename=GL_Accounts_' . date('Y-m-d') . '.pdf'); - header('Expires: 0'); - header('Cache-Control: must-revalidate, post-check=0, pre-check=0'); - header('Pragma: public'); - - $pdf->Output('GL_Accounts_' . date('Y-m-d') . '.pdf', 'I'); - } - */ $pdf->OutputD($_SESSION['DatabaseName'] . '_GL_Accounts_' . date('Y-m-d') . '.pdf'); $pdf->__destruct(); } //end if the report has some output @@ -253,7 +232,7 @@ echo '<div class="page_help_text">' . _('Use the keyboard Shift key to select multiple accounts and periods') . '</div><br />'; - echo "<form method='POST' action=" . $_SERVER['PHP_SELF'] . '?' . SID . '>'; + echo '<form method="POST" action="' . $_SERVER['PHP_SELF'] . '">'; echo '<input type="hidden" name="FormID" value="' . $_SESSION['FormID'] . '" />'; /*Dates in SQL format for the last day of last month*/ @@ -269,10 +248,10 @@ $i=0; while ($myrow=DB_fetch_array($AccountsResult,$db)){ if(isset($_POST['Account'][$i]) AND $myrow['accountcode'] == $_POST['Account'][$i]){ - echo '<option selected VALUE=' . $myrow['accountcode'] . '>' . $myrow['accountcode'] . ' ' . $myrow['accountname']; + echo '<option selected value="' . $myrow['accountcode'] . '">' . $myrow['accountcode'] . ' ' . $myrow['accountname'] . '</option>'; $i++; } else { - echo '<option VALUE=' . $myrow['accountcode'] . '>' . $myrow['accountcode'] . ' ' . $myrow['accountname']; + echo '<option value="' . $myrow['accountcode'] . '">' . $myrow['accountcode'] . ' ' . $myrow['accountname'] . '</option>'; } } echo '</select></td>'; @@ -285,29 +264,31 @@ while ($myrow=DB_fetch_array($Periods,$db)){ if (isset($SelectedPeriod[$id]) and $myrow['periodno'] == $SelectedPeriod[$id]){ - echo '<option selected VALUE=' . $myrow['periodno'] . '>' . _(MonthAndYearFromSQLDate($myrow['lastdate_in_period'])); + echo '<option selected value="' . $myrow['periodno'] . '">' . _(MonthAndYearFromSQLDate($myrow['lastdate_in_period'])) . '</option>'; $id++; } else { - echo '<option VALUE=' . $myrow['periodno'] . '>' . _(MonthAndYearFromSQLDate($myrow['lastdate_in_period'])); + echo '<option value=' . $myrow['periodno'] . '>' . _(MonthAndYearFromSQLDate($myrow['lastdate_in_period'])) . '</option>'; } } echo '</select></td></tr>'; //Select the tag - echo '<tr><td>' . _('Select Tag') . ':</td><td><select name="tag">'; + echo '<tr> + <td>' . _('Select Tag') . ':</td> + <td><select name="tag">'; $SQL = "SELECT tagref, - tagdescription - FROM tags - ORDER BY tagref"; + tagdescription + FROM tags + ORDER BY tagref"; $result=DB_query($SQL,$db); - echo '<option value=0>0 - '._('All tags'); + echo '<option value=0>0 - '._('All tags') . '</option>'; while ($myrow=DB_fetch_array($result)){ if (isset($_POST['tag']) and $_POST['tag']==$myrow['tagref']){ - echo '<option selected value=' . $myrow['tagref'] . '>' . $myrow['tagref'].' - ' .$myrow['tagdescription']; + echo '<option selected value=' . $myrow['tagref'] . '>' . $myrow['tagref'].' - ' .$myrow['tagdescription'] . '</option>'; } else { - echo '<option value=' . $myrow['tagref'] . '>' . $myrow['tagref'].' - ' .$myrow['tagdescription']; + echo '<option value=' . $myrow['tagref'] . '>' . $myrow['tagref'].' - ' .$myrow['tagdescription'] . '</option>'; } } echo '</select></td></tr>'; @@ -315,7 +296,7 @@ echo '</table><p> <div class="centre"> - <input type=submit name="RunReport" VALUE="' ._('Run Report'). '"></div> + <input type=submit name="RunReport" value="' ._('Run Report'). '"></div> </form>'; include ('includes/footer.inc'); @@ -323,7 +304,6 @@ } - function NewPageHeader () { global $PageNumber, $pdf, Modified: trunk/GLProfit_Loss.php =================================================================== --- trunk/GLProfit_Loss.php 2011-07-09 08:22:59 UTC (rev 4629) +++ trunk/GLProfit_Loss.php 2011-07-14 10:27:29 UTC (rev 4630) @@ -21,7 +21,7 @@ . _('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'] . '">'; + echo '<form method="post" action="' . $_SERVER['PHP_SELF'] . '">'; echo '<input type="hidden" name="FormID" value="' . $_SESSION['FormID'] . '" />'; if (Date('m') > $_SESSION['YearEnd']){ @@ -39,22 +39,25 @@ <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']) . '</option>'; + echo '<option selected value=' . $myrow['periodno'] . '>' .MonthAndYearFromSQLDate($myrow['lastdate_in_period']) . '</option>'; } else { - echo '<option VALUE=' . $myrow['periodno'] . '>' . MonthAndYearFromSQLDate($myrow['lastdate_in_period']) . '</option>'; + 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']) . '</option>'; + echo '<option selected value=' . $myrow['periodno'] . '>' . MonthAndYearFromSQLDate($myrow['lastdate_in_period']) . '</option>'; } else { - echo '<option VALUE=' . $myrow['periodno'] . '>' . MonthAndYearFromSQLDate($myrow['lastdate_in_period']) . '</option>'; + echo '<option value=' . $myrow['periodno'] . '>' . MonthAndYearFromSQLDate($myrow['lastdate_in_period']) . '</option>'; } } } @@ -71,29 +74,34 @@ $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']) . '</option>'; + echo '<option selected value=' . $myrow['periodno'] . '>' . MonthAndYearFromSQLDate($myrow['lastdate_in_period']) . '</option>'; } else { - echo '<option VALUE =' . $myrow['periodno'] . '>' . MonthAndYearFromSQLDate($myrow['lastdate_in_period']) . '</option>'; + 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') . '</option>'; - echo '<option selected VALUE="Detailed">'._('All Accounts') . '</option>'; - echo '</select></td></tr>'; + echo '<tr><td>'._('Detail Or Summary').':</td> + <td><select name="Detail"> + <option selected value="Summary">'._('Summary') . '</option> + <option selected value="Detailed">'._('All Accounts') . '</option> + </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 */ @@ -126,30 +134,30 @@ $SQL = "SELECT accountgroups.sectioninaccounts, - accountgroups.groupname, - accountgroups.parentgroupname, - chartdetails.accountcode , - chartmaster.accountname, - Sum(CASE WHEN chartdetails.period='" . $_POST['FromPeriod'] . "' THEN chartdetails.bfwd ELSE 0 END) AS firstprdbfwd, - Sum(CASE WHEN chartdetails.period='" . $_POST['FromPeriod'] . "' THEN chartdetails.bfwdbudget ELSE 0 END) AS firstprdbudgetbfwd, - Sum(CASE WHEN chartdetails.period='" . $_POST['ToPeriod'] . "' THEN chartdetails.bfwd + chartdetails.actual ELSE 0 END) AS lastprdcfwd, - Sum(CASE WHEN chartdetails.period='" . ($_POST['FromPeriod'] - 12) . "' THEN chartdetails.bfwd ELSE 0 END) AS lyfirstprdbfwd, - Sum(CASE WHEN chartdetails.period='" . ($_POST['ToPeriod']-12) . "' THEN chartdetails.bfwd + chartdetails.actual ELSE 0 END) AS lylastprdcfwd, - Sum(CASE WHEN chartdetails.period='" . $_POST['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 - WHERE accountgroups.pandl=1 - GROUP BY accountgroups.sectioninaccounts, - accountgroups.groupname, - accountgroups.parentgroupname, - chartdetails.accountcode, - chartmaster.accountname, - accountgroups.sequenceintb - ORDER BY accountgroups.sectioninaccounts, - accountgroups.sequenceintb, - accountgroups.groupname, - chartdetails.accountcode"; + accountgroups.groupname, + accountgroups.parentgroupname, + chartdetails.accountcode , + chartmaster.accountname, + Sum(CASE WHEN chartdetails.period='" . $_POST['FromPeriod'] . "' THEN chartdetails.bfwd ELSE 0 END) AS firstprdbfwd, + Sum(CASE WHEN chartdetails.period='" . $_POST['FromPeriod'] . "' THEN chartdetails.bfwdbudget ELSE 0 END) AS firstprdbudgetbfwd, + Sum(CASE WHEN chartdetails.period='" . $_POST['ToPeriod'] . "' THEN chartdetails.bfwd + chartdetails.actual ELSE 0 END) AS lastprdcfwd, + Sum(CASE WHEN chartdetails.period='" . ($_POST['FromPeriod'] - 12) . "' THEN chartdetails.bfwd ELSE 0 END) AS lyfirstprdbfwd, + Sum(CASE WHEN chartdetails.period='" . ($_POST['ToPeriod']-12) . "' THEN chartdetails.bfwd + chartdetails.actual ELSE 0 END) AS lylastprdcfwd, + Sum(CASE WHEN chartdetails.period='" . $_POST['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 + WHERE accountgroups.pandl=1 + GROUP BY accountgroups.sectioninaccounts, + accountgroups.groupname, + accountgroups.parentgroupname, + chartdetails.accountcode, + chartmaster.accountname, + accountgroups.sequenceintb + ORDER BY accountgroups.sectioninaccounts, + accountgroups.sequenceintb, + accountgroups.groupname, + chartdetails.accountcode"; $AccountsResult = DB_query($SQL,$db); @@ -157,7 +165,7 @@ $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">'. _('Back to the menu'). '</a>'; if ($debug == 1){ echo '<br />'. $SQL; } @@ -167,9 +175,9 @@ if (DB_num_rows($AccountsResult)==0){ $title = _('Print Profit and Loss Error'); include('includes/header.inc'); - echo '<p>'; + echo '<br />'; 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">'. _('Back to the menu'). '</a>'; include('includes/footer.inc'); exit; } @@ -213,15 +221,15 @@ } if ($Section == 1){ /*Income */ $LeftOvers = $pdf->addTextWrap($Left_Margin +($Level*10),$YPos,200 -($Level*10),$FontSize,$ActGrpLabel); - $LeftOvers = $pdf->addTextWrap($Left_Margin+310,$YPos,70,$FontSize,number_format(-$GrpPrdActual[$Level]),'right'); - $LeftOvers = $pdf->addTextWrap($Left_Margin+370,$YPos,70,$FontSize,number_format(-$GrpPrdBudget[$Level]),'right'); - $LeftOvers = $pdf->addTextWrap($Left_Margin+430,$YPos,70,$FontSize,number_format(-$GrpPrdLY[$Level]),'right'); + $LeftOvers = $pdf->addTextWrap($Left_Margin+310,$YPos,70,$FontSize,number_format(-$GrpPrdActual[$Level],$_SESSION['CompanyRecord']['decimalplaces']),'right'); + $LeftOvers = $pdf->addTextWrap($Left_Margin+370,$YPos,70,$FontSize,number_format(-$GrpPrdBudget[$Level],$_SESSION['CompanyRecord']['decimalplaces']),'right'); + $LeftOvers = $pdf->addTextWrap($Left_Margin+430,$YPos,70,$FontSize,number_format(-$GrpPrdLY[$Level],$_SESSION['CompanyRecord']['decimalplaces']),'right'); $YPos -= (2 * $line_height); } else { /*Costs */ $LeftOvers = $pdf->addTextWrap($Left_Margin +($Level*10),$YPos,200 -($Level*10),$FontSize,$ActGrpLabel); - $LeftOvers = $pdf->addTextWrap($Left_Margin+310,$YPos,70,$FontSize,number_format($GrpPrdActual[$Level]),'right'); - $LeftOvers = $pdf->addTextWrap($Left_Margin+370,$YPos,70,$FontSize,number_format($GrpPrdBudget[$Level]),'right'); - $LeftOvers = $pdf->addTextWrap($Left_Margin+430,$YPos,70,$FontSize,number_format($GrpPrdLY[$Level]),'right'); + $LeftOvers = $pdf->addTextWrap($Left_Margin+310,$YPos,70,$FontSize,number_format($GrpPrdActual[$Level],$_SESSION['CompanyRecord']['decimalplaces']),'right'); + $LeftOvers = $pdf->addTextWrap($Left_Margin+370,$YPos,70,$FontSize,number_format($GrpPrdBudget[$Level],$_SESSION['CompanyRecord']['decimalplaces']),'right'); + $LeftOvers = $pdf->addTextWrap($Left_Margin+430,$YPos,70,$FontSize,number_format($GrpPrdLY[$Level],$_SESSION['CompanyRecord']['decimalplaces']),'right'); $YPos -= (2 * $line_height); } $GrpPrdLY[$Level] = 0; @@ -241,15 +249,15 @@ $ActGrpLabel = $ParentGroups[$Level]; } if ($Section == 1){ /*Income */ - $LeftOvers = $pdf->addTextWrap($Left_Margin +($Level*10),$YPos,200 -($Level*10),$FontSize,$ActGrpLabel); $pdf->addTextWrap($Left_Margin+310,$YPos,70,$FontSize,number_format(-$GrpPrdActual[$Level]),'right'); - $LeftOvers = $pdf->addTextWrap($Left_Margin+370,$YPos,70,$FontSize,number_format(-$GrpPrdBudget[$Level]),'right'); - $LeftOvers = $pdf->addTextWrap($Left_Margin+430,$YPos,70,$FontSize,number_format(-$GrpPrdLY[$Level]),'right'); + $LeftOvers = $pdf->addTextWrap($Left_Margin +($Level*10),$YPos,200 -($Level*10),$FontSize,$ActGrpLabel); $pdf->addTextWrap($Left_Margin+310,$YPos,70,$FontSize,number_format(-$GrpPrdActual[$Level],$_SESSION['CompanyRecord']['decimalplaces']),'right'); + $LeftOvers = $pdf->addTextWrap($Left_Margin+370,$YPos,70,$FontSize,number_format(-$GrpPrdBudget[$Level],$_SESSION['CompanyRecord']['decimalplaces']),'right'); + $LeftOvers = $pdf->addTextWrap($Left_Margin+430,$YPos,70,$FontSize,number_format(-$GrpPrdLY[$Level],$_SESSION['CompanyRecord']['decimalplaces']),'right'); $YPos -= (2 * $line_height); } else { /*Costs */ $LeftOvers = $pdf->addTextWrap($Left_Margin +($Level*10),$YPos,200 -($Level*10),$FontSize,$ActGrpLabel); - $LeftOvers = $pdf->addTextWrap($Left_Margin+310,$YPos,70,$FontSize,number_format($GrpPrdActual[$Level]),'right'); - $LeftOvers = $pdf->addTextWrap($Left_Margin+370,$YPos,70,$FontSize,number_format($GrpPrdBudget[$Level]),'right'); - $LeftOvers = $pdf->addTextWrap($Left_Margin+430,$YPos,70,$FontSize,number_format($GrpPrdLY[$Level]),'right'); + $LeftOvers = $pdf->addTextWrap($Left_Margin+310,$YPos,70,$FontSize,number_format($GrpPrdActual[$Level],$_SESSION['CompanyRecord']['decimalplaces']),'right'); + $LeftOvers = $pdf->addTextWrap($Left_Margin+370,$YPos,70,$FontSize,number_format($GrpPrdBudget[$Level],$_SESSION['CompanyRecord']['decimalplaces']),'right'); + $LeftOvers = $pdf->addTextWrap($Left_Margin+430,$YPos,70,$FontSize,number_format($GrpPrdLY[$Level],$_SESSION['CompanyRecord']['decimalplaces']),'right'); $YPos -= (2 * $line_height); } $GrpPrdLY[$Level] = 0; @@ -274,9 +282,9 @@ if ($Section == 1) { /*Income*/ $LeftOvers = $pdf->addTextWrap($Left_Margin,$YPos,200,$FontSize,$Sections[$Section]); - $LeftOvers = $pdf->addTextWrap($Left_Margin+310,$YPos,70,$FontSize,number_format(-$SectionPrdActual),'right'); - $LeftOvers = $pdf->addTextWrap($Left_Margin+370,$YPos,70,$FontSize,number_format(-$SectionPrdBudget),'right'); - $LeftOvers = $pdf->addTextWrap($Left_Margin+430,$YPos,70,$FontSize,number_format(-$SectionPrdLY),'right'); + $LeftOvers = $pdf->addTextWrap($Left_Margin+310,$YPos,70,$FontSize,number_format(-$SectionPrdActual,$_SESSION['CompanyRecord']['decimalplaces']),'right'); + $LeftOvers = $pdf->addTextWrap($Left_Margin+370,$YPos,70,$FontSize,number_format(-$SectionPrdBudget,$_SESSION['CompanyRecord']['decimalplaces']),'right'); + $LeftOvers = $pdf->addTextWrap($Left_Margin+430,$YPos,70,$FontSize,number_format(-$SectionPrdLY,$_SESSION['CompanyRecord']['decimalplaces']),'right'); $YPos -= (2 * $line_height); $TotalIncome = -$SectionPrdActual; @@ -284,16 +292,16 @@ $TotalLYIncome = -$SectionPrdLY; } else { $LeftOvers = $pdf->addTextWrap($Left_Margin,$YPos,200,$FontSize,$Sections[$Section]); - $LeftOvers = $pdf->addTextWrap($Left_Margin+310,$YPos,70,$FontSize,number_format($SectionPrdActual),'right'); - $LeftOvers = $pdf->addTextWrap($Left_Margin+370,$YPos,70,$FontSize,number_format($SectionPrdBudget),'right'); - $LeftOvers = $pdf->addTextWrap($Left_Margin+430,$YPos,70,$FontSize,number_format($SectionPrdLY),'right'); + $LeftOvers = $pdf->addTextWrap($Left_Margin+310,$YPos,70,$FontSize,number_format($SectionPrdActual,$_SESSION['CompanyRecord']['decimalplaces']),'right'); + $LeftOvers = $pdf->addTextWrap($Left_Margin+370,$YPos,70,$FontSize,number_format($SectionPrdBudget,$_SESSION['CompanyRecord']['decimalplaces']),'right'); + $LeftOvers = $pdf->addTextWrap($Left_Margin+430,$YPos,70,$FontSize,number_format($SectionPrdLY,$_SESSION['CompanyRecord']['decimalplaces']),'right'); $YPos -= (2 * $line_height); } if ($Section == 2){ /*Cost of Sales - need sub total for Gross Profit*/ $LeftOvers = $pdf->addTextWrap($Left_Margin,$YPos,200,$FontSize,_('Gross Profit')); - $LeftOvers = $pdf->addTextWrap($Left_Margin+310,$YPos,70,$FontSize,number_format($TotalIncome - $SectionPrdActual),'right'); - $LeftOvers = $pdf->addTextWrap($Left_Margin+370,$YPos,70,$FontSize,number_format($TotalBudgetIncome - $SectionPrdBudget),'right'); - $LeftOvers = $pdf->addTextWrap($Left_Margin+430,$YPos,70,$FontSize,number_format($TotalLYIncome - $SectionPrdLY),'right'); + $LeftOvers = $pdf->addTextWrap($Left_Margin+310,$YPos,70,$FontSize,number_format($TotalIncome - $SectionPrdActual,$_SESSION['CompanyRecord']['decimalplaces']),'right'); + $LeftOvers = $pdf->addTextWrap($Left_Margin+370,$YPos,70,$FontSize,number_format($TotalBudgetIncome - $SectionPrdBudget,$_SESSION['CompanyRecord']['decimalplaces']),'right'); + $LeftOvers = $pdf->addTextWrap($Left_Margin+430,$YPos,70,$FontSize,number_format($TotalLYIncome - $SectionPrdLY,$_SESSION['CompanyRecord']['decimalplaces']),'right'); $pdf->line($Left_Margin+310, $YPos+$line_height,$Left_Margin+500, $YPos+$line_height); $pdf->line($Left_Margin+310, $YPos,$Left_Margin+500, $YPos); $YPos -= (2 * $line_height); @@ -381,13 +389,13 @@ $LeftOvers = $pdf->addTextWrap($Left_Margin,$YPos,60,$FontSize,$myrow['accountcode']); $LeftOvers = $pdf->addTextWrap($Left_Margin+60,$YPos,190,$FontSize,$myrow['accountname']); if ($Section == 1) { /*Income*/ - $LeftOvers = $pdf->addTextWrap($Left_Margin+310,$YPos,70,$FontSize,number_format(-$AccountPeriodActual),'right'); - $LeftOvers = $pdf->addTextWrap($Left_Margin+370,$YPos,70,$FontSize,number_format(-$AccountPeriodBudget),'right'); - $LeftOvers = $pdf->addTextWrap($Left_Margin+430,$YPos,70,$FontSize,number_format(-$AccountPeriodLY),'right'); + $LeftOvers = $pdf->addTextWrap($Left_Margin+310,$YPos,70,$FontSize,number_format(-$AccountPeriodActual,$_SESSION['CompanyRecord']['decimalplaces']),'right'); + $LeftOvers = $pdf->addTextWrap($Left_Margin+370,$YPos,70,$FontSize,number_format(-$AccountPeriodBudget,$_SESSION['CompanyRecord']['decimalplaces']),'right'); + $LeftOvers = $pdf->addTextWrap($Left_Margin+430,$YPos,70,$FontSize,number_format(-$AccountPeriodLY,$_SESSION['CompanyRecord']['decimalplaces']),'right'); } else { - $LeftOvers = $pdf->addTextWrap($Left_Margin+310,$YPos,70,$FontSize,number_format($AccountPeriodActual),'right'); - $LeftOvers = $pdf->addTextWrap($Left_Margin+370,$YPos,70,$FontSize,number_format($AccountPeriodBudget),'right'); - $LeftOvers = $pdf->addTextWrap($Left_Margin+430,$YPos,70,$FontSize,number_format($AccountPeriodLY),'right'); + $LeftOvers = $pdf->addTextWrap($Left_Margin+310,$YPos,70,$FontSize,number_format($AccountPeriodActual,$_SESSION['CompanyRecord']['decimalplaces']),'right'); + $LeftOvers = $pdf->addTextWrap($Left_Margin+370,$YPos,70,$FontSize,number_format($AccountPeriodBudget,$_SESSION['CompanyRecord']['decimalplaces']),'right'); + $LeftOvers = $pdf->addTextWrap($Left_Margin+430,$YPos,70,$FontSize,number_format($AccountPeriodLY,$_SESSION['CompanyRecord']['decimalplaces']),'right'); } $YPos -= $line_height; } @@ -406,15 +414,15 @@ } if ($Section == 1){ /*Income */ $LeftOvers = $pdf->addTextWrap($Left_Margin +($Level*10),$YPos,200 -($Level*10),$FontSize,$ActGrpLabel); - $LeftOvers = $pdf->addTextWrap($Left_Margin+310,$YPos,70,$FontSize,number_format(-$GrpPrdActual[$Level]),'right'); - $LeftOvers = $pdf->addTextWrap($Left_Margin+370,$YPos,70,$FontSize,number_format(-$GrpPrdBudget[$Level]),'right'); - $LeftOvers = $pdf->addTextWrap($Left_Margin+430,$YPos,70,$FontSize,number_format(-$GrpPrdLY[$Level]),'right'); + $LeftOvers = $pdf->addTextWrap($Left_Margin+310,$YPos,70,$FontSize,number_format(-$GrpPrdActual[$Level],$_SESSION['CompanyRecord']['decimalplaces']),'right'); + $LeftOvers = $pdf->addTextWrap($Left_Margin+370,$YPos,70,$FontSize,number_format(-$GrpPrdBudget[$Level],$_SESSION['CompanyRecord']['decimalplaces']),'right'); + $LeftOvers = $pdf->addTextWrap($Left_Margin+430,$YPos,70,$FontSize,number_format(-$GrpPrdLY[$Level],$_SESSION['CompanyRecord']['decimalplaces']),'right'); $YPos -= (2 * $line_height); } else { /*Costs */ $LeftOvers = $pdf->addTextWrap($Left_Margin +($Level*10),$YPos,200 -($Level*10),$FontSize,$ActGrpLabel); - $LeftOvers = $pdf->addTextWrap($Left_Margin+310,$YPos,70,$FontSize,number_format($GrpPrdActual[$Level]),'right'); - $LeftOvers = $pdf->addTextWrap($Left_Margin+370,$YPos,70,$FontSize,number_format($GrpPrdBudget[$Level]),'right'); - $LeftOvers = $pdf->addTextWrap($Left_Margin+430,$YPos,70,$FontSize,number_format($GrpPrdLY[$Level]),'right'); + $LeftOvers = $pdf->addTextWrap($Left_Margin+310,$YPos,70,$FontSize,number_format($GrpPrdActual[$Level],$_SESSION['CompanyRecord']['decimalplaces']),'right'); + $LeftOvers = $pdf->addTextWrap($Left_Margin+370,$YPos,70,$FontSize,number_format($GrpPrdBudget[$Level],$_SESSION['CompanyRecord']['decimalplaces']),'right'); + $LeftOvers = $pdf->addTextWrap($Left_Margin+430,$YPos,70,$FontSize,number_format($GrpPrdLY[$Level],$_SESSION['CompanyRecord']['decimalplaces']),'right'); $YPos -= (2 * $line_height); } $GrpPrdLY[$Level] = 0; @@ -434,15 +442,15 @@ $ActGrpLabel = $ParentGroups[$Level]; } if ($Section == 1){ /*Income */ - $LeftOvers = $pdf->addTextWrap($Left_Margin +($Level*10),$YPos,200 -($Level*10),$FontSize,$ActGrpLabel); $pdf->addTextWrap($Left_Margin+310,$YPos,70,$FontSize,number_format(-$GrpPrdActual[$Level]),'right'); - $LeftOvers = $pdf->addTextWrap($Left_Margin+370,$YPos,70,$FontSize,number_format(-$GrpPrdBudget[$Level]),'right'); - $LeftOvers = $pdf->addTextWrap($Left_Margin+430,$YPos,70,$FontSize,number_format(-$GrpPrdLY[$Level]),'right'); + $LeftOvers = $pdf->addTextWrap($Left_Margin +($Level*10),$YPos,200 -($Level*10),$FontSize,$ActGrpLabel); $pdf->addTextWrap($Left_Margin+310,$YPos,70,$FontSize,number_format(-$GrpPrdActual[$Level],$_SESSION['CompanyRecord']['decimalplaces']),'right'); + $LeftOvers = $pdf->addTextWrap($Left_Margin+370,$YPos,70,$FontSize,number_format(-$GrpPrdBudget[$Level],$_SESSION['CompanyRecord']['decimalplaces']),'right'); + $LeftOvers = $pdf->addTextWrap($Left_Margin+430,$YPos,70,$FontSize,number_format(-$GrpPrdLY[$Level],$_SESSION['CompanyRecord']['decimalplaces']),'right'); $YPos -= (2 * $line_height); } else { /*Costs */ $LeftOvers = $pdf->addTextWrap($Left_Margin +($Level*10),$YPos,200 -($Level*10),$FontSize,$ActGrpLabel); - $LeftOvers = $pdf->addTextWrap($Left_Margin+310,$YPos,70,$FontSize,number_format($GrpPrdActual[$Level]),'right'); - $LeftOvers = $pdf->addTextWrap($Left_Margin+370,$YPos,70,$FontSize,number_format($GrpPrdBudget[$Level]),'right'); - $LeftOvers = $pdf->addTextWrap($Left_Margin+430,$YPos,70,$FontSize,number_format($GrpPrdLY[$Level]),'right'); + $LeftOvers = $pdf->addTextWrap($Left_Margin+310,$YPos,70,$FontSize,number_format($GrpPrdActual[$Level],$_SESSION['CompanyRecord']['decimalplaces']),'right'); + $LeftOvers = $pdf->addTextWrap($Left_Margin+370,$YPos,70,$FontSize,number_format($GrpPrdBudget[$Level],$_SESSION['CompanyRecord']['decimalplaces']),'right'); + $LeftOvers = $pdf->addTextWrap($Left_Margin+430,$YPos,70,$FontSize,number_format($GrpPrdLY[$Level],$_SESSION['CompanyRecord']['decimalplaces']),'right'); $YPos -= (2 * $line_height); } $GrpPrdLY[$Level] = 0; @@ -463,9 +471,9 @@ if ($Section == 1) { /*Income*/ $LeftOvers = $pdf->addTextWrap($Left_Margin,$YPos,200,$FontSize,$Sections[$Section]); - $LeftOvers = $pdf->addTextWrap($Left_Margin+310,$YPos,70,$FontSize,number_format(-$SectionPrdActual),'right'); - $LeftOvers = $pdf->addTextWrap($Left_Margin+370,$YPos,70,$FontSize,number_format(-$SectionPrdBudget),'right'); - $LeftOvers = $pdf->addTextWrap($Left_Margin+430,$YPos,70,$FontSize,number_format(-$SectionPrdLY),'right'); + $LeftOvers = $pdf->addTextWrap($Left_Margin+310,$YPos,70,$FontSize,number_format(-$SectionPrdActual,$_SESSION['CompanyRecord']['decimalplaces']),'right'); + $LeftOvers = $pdf->addTextWrap($Left_Margin+370,$YPos,70,$FontSize,number_format(-$SectionPrdBudget,$_SESSION['CompanyRecord']['decimalplaces']),'right'); + $LeftOvers = $pdf->addTextWrap($Left_Margin+430,$YPos,70,$FontSize,number_format(-$SectionPrdLY,$_SESSION['CompanyRecord']['decimalplaces']),'right'); $YPos -= (2 * $line_height); $TotalIncome = -$SectionPrdActual; @@ -473,16 +481,16 @@ $TotalLYIncome = -$SectionPrdLY; } else { $LeftOvers = $pdf->addTextWrap($Left_Margin,$YPos,60,$FontSize,$Sections[$Section]); - $LeftOvers = $pdf->addTextWrap($Left_Margin+310,$YPos,70,$FontSize,number_format($SectionPrdActual),'right'); - $LeftOvers = $pdf->addTextWrap($Left_Margin+370,$YPos,70,$FontSize,number_format($SectionPrdBudget),'right'); - $LeftOvers = $pdf->addTextWrap($Left_Margin+430,$YPos,70,$FontSize,number_format($SectionPrdLY),'right'); + $LeftOvers = $pdf->addTextWrap($Left_Margin+310,$YPos,70,$FontSize,number_format($SectionPrdActual,$_SESSION['CompanyRecord']['decimalplaces']),'right'); + $LeftOvers = $pdf->addTextWrap($Left_Margin+370,$YPos,70,$FontSize,number_format($SectionPrdBudget,$_SESSION['CompanyRecord']['decimalplaces']),'right'); + $LeftOvers = $pdf->addTextWrap($Left_Margin+430,$YPos,70,$FontSize,number_format($SectionPrdLY,$_SESSION['CompanyRecord']['decimalplaces']),'right'); $YPos -= (2 * $line_height); } if ($Section == 2){ /*Cost of Sales - need sub total for Gross Profit*/ $LeftOvers = $pdf->addTextWrap($Left_Margin,$YPos,60,$FontSize,_('Gross Profit')); - $LeftOvers = $pdf->addTextWrap($Left_Margin+310,$YPos,70,$FontSize,number_format($TotalIncome - $SectionPrdActual),'right'); - $LeftOvers = $pdf->addTextWrap($Left_Margin+370,$YPos,70,$FontSize,number_format($TotalBudgetIncome - $SectionPrdBudget),'right'); - $LeftOvers = $pdf->addTextWrap($Left_Margin+430,$YPos,70,$FontSize,number_format($TotalLYIncome - $SectionPrdLY),'right'); + $LeftOvers = $pdf->addTextWrap($Left_Margin+310,$YPos,70,$FontSize,number_format($TotalIncome - $SectionPrdActual,$_SESSION['CompanyRecord']['decimalplaces']),'right'); + $LeftOvers = $pdf->addTextWrap($Left_Margin+370,$YPos,70,$FontSize,number_format($TotalBudgetIncome - $SectionPrdBudget,$_SESSION['CompanyRecord']['decimalplaces']),'right'); + $LeftOvers = $pdf->addTextWrap($Left_Margin+430,$YPos,70,$FontSize,number_format($TotalLYIncome - $SectionPrdLY,$_SESSION['CompanyRecord']['decimalplaces']),'right'); $YPos -= (2 * $line_height); $LeftOvers = $pdf->addTextWrap($Left_Margin+310,$YPos,70,$FontSize,number_format(100*($TotalIncome - $SectionPrdActual)/$TotalIncome,1) . '%','right'); @@ -493,9 +501,9 @@ } $LeftOvers = $pdf->addTextWrap($Left_Margin,$YPos,60,$FontSize,_('Profit').' - '._('Loss')); - $LeftOvers = $pdf->addTextWrap($Left_Margin+310,$YPos,70,$FontSize,number_format(-$PeriodProfitLoss),'right'); + $LeftOvers = $pdf->addTextWrap($Left_Margin+310,$YPos,70,$FontSize,number_format(-$PeriodProfitLoss,$_SESSION['CompanyRecord']['decimalplaces']),'right'); $LeftOvers = $pdf->addTextWrap($Left_Margin+370,$YPos,70,$FontSize,number_format(-$PeriodBudgetProfitLoss),'right'); - $LeftOvers = $pdf->addTextWrap($Left_Margin+430,$YPos,70,$FontSize,number_format(-$PeriodLYProfitLoss),'right'); + $LeftOvers = $pdf->addTextWrap($Left_Margin+430,$YPos,70,$FontSize,number_format(-$PeriodLYProfitLoss,$_SESSION['CompanyRecord']['decimalplaces']),'right'); $YPos -= (2 * $line_height); if ($TotalIncome != 0){ @@ -531,13 +539,13 @@ include('includes/header.inc'); 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; if ($NumberOfMonths >12){ - echo '<p>'; + echo '<br />'; prnMsg(_('A period up to 12 months in duration can be specified') . ' - ' . _('the system automatically shows a comparative for the same period from the previous year') . ' - ' . _('it cannot do this if a period of more than 12 months is specified') . '. ' . _('Please select an alternative period range'),'error'); include('includes/footer.inc'); exit; @@ -550,32 +558,32 @@ $SQL = "SELECT accountgroups.sectioninaccounts, - accountgroups.parentgroupname, - accountgroups.groupname, - chartdetails.accountcode, - chartmaster.accountname, - Sum(CASE WHEN chartdetails.period='" . $_POST['FromPeriod'] . "' THEN chartdetails.bfwd ELSE 0 END) AS firstprdbfwd, - Sum(CASE WHEN chartdetails.period='" . $_POST['FromPeriod'] . "' THEN chartdetails.bfwdbudget ELSE 0 END) AS firstprdbudgetbfwd, - Sum(CASE WHEN chartdetails.period='" . $_POST['ToPeriod'] . "' THEN chartdetails.bfwd + chartdetails.actual ELSE 0 END) AS lastprdcfwd, - Sum(CASE WHEN chartdetails.period='" . ($_POST['FromPeriod'] - 12) . "' THEN chartdetails.bfwd ELSE 0 END) AS lyfirstprdbfwd, - Sum(CASE WHEN chartdetails.period='" . ($_POST['ToPeriod']-12) . "' THEN chartdetails.bfwd + chartdetails.actual ELSE 0 END) AS lylastprdcfwd, - Sum(CASE WHEN chartdetails.period='" . $_POST['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 - WHERE accountgroups.pandl=1 - GROUP BY accountgroups.sectioninaccounts, - accountgroups.parentgroupname, - accountgroups.groupname, - chartdetails.accountcode, - chartmaster.accountname, - accountgroups.sequenceintb - ORDER BY accountgroups.sectioninaccounts, - accountgroups.sequenceintb, - accountgroups.groupname, - accountgroups.sequenceintb, - chartdetails.accountcode"; - + accountgroups.parentgroupname, + accountgroups.groupname, + chartdetails.accountcode, + chartmaster.accountname, + SUM(CASE WHEN chartdetails.period='" . $_POST['FromPeriod'] . "' THEN chartdetails.bfwd ELSE 0 END) AS firstprdbfwd, + SUM(CASE WHEN chartdetails.period='" . $_POST['FromPeriod'] . "' THEN chartdetails.bfwdbudget ELSE 0 END) AS firstprdbudgetbfwd, + SUM(CASE WHEN chartdetails.period='" . $_POST['ToPeriod'] . "' THEN chartdetails.bfwd + chartdetails.actual ELSE 0 END) AS lastprdcfwd, + SUM(CASE WHEN chartdetails.period='" . ($_POST['FromPeriod'] - 12) . "' THEN chartdetails.bfwd ELSE 0 END) AS lyfirstprdbfwd, + SUM(CASE WHEN chartdetails.period='" . ($_POST['ToPeriod']-12) . "' THEN chartdetails.bfwd + chartdetails.actual ELSE 0 END) AS lylastprdcfwd, + SUM(CASE WHEN chartdetails.period='" . $_POST['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 + WHERE accountgroups.pandl=1 + GROUP BY accountgroups.sectioninaccounts, + accountgroups.parentgroupname, + accountgroups.groupname, + chartdetails.accountcode, + chartmaster.accountname, + accountgroups.sequenceintb + ORDER BY accountgroups.sectioninaccounts, + accountgroups.sequenceintb, + accountgroups.groupname, + accountgroups.sequenceintb, + chartdetails.accountcode"; + $AccountsResult = DB_query($SQL,$db,_('No general ledger accounts were returned by the SQL because'),_('The SQL that failed was')); echo '<p class="page_title_text"><img src="'.$rootpath.'/css/'.$theme.'/images/transactions.png" title="' . _('General Ledger Profit Loss Inquiry') . '" alt="" />' . ' ' . _('Statement of Profit and Loss for the') . ' ' . $NumberOfMonths . ' ' . _('months to') . ' and including ' . $PeriodToDate . '</p>'; @@ -587,19 +595,19 @@ 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>'; + <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>'; + <th colspan=2></th> + <th colspan=2>' . _('Period Actual') .'</th> + <th colspan=2>' . _('Period Budget') . '</th> + <th colspan=2>' . _('Last Year') . '</th> + </tr>'; } @@ -635,41 +643,41 @@ while ($myrow['groupname']!=$ParentGroups[$Level] AND $Level>0) { if ($_POST['Detail']=='Detailed'){ echo '<tr> - <td colspan=2></td> - <td colspan=6><hr></td> - </tr>'; + <td colspan=2></td> + <td colspan=6><hr></td> + </tr>'; $ActGrpLabel = str_repeat('___',$Level) . $ParentGroups[$Level] . ' ' . _('total'); } else { $ActGrpLabel = str_repeat('___',$Level) . $ParentGroups[$Level]; } if ($Section ==1){ /*Income */ printf('<tr> - <td colspan=2><font size=2><I>%s </I></font></td> - <td></td> - <td class=number>%s</td> - <td></td> - <td class=number>%s</td> - <td></td> - <td class=number>%s</td> - </tr>', - $ActGrpLabel, - number_format(-$GrpPrdActual[$Level]), - number_format(-$GrpPrdBudget[$Level]), - number_format(-$GrpPrdLY[$Level])); + <td colspan=2><font size=2><I>%s </I></font></td> + <td></td> + <td class=number>%s</td> + <td></td> + <td class=number>%s</td> + <td></td> + <td class=number>%s</td> + </tr>', + $ActGrpLabel, + number_format(-$GrpPrdActual[$Level],$_SESSION['CompanyRecord']['decimalplaces']), + number_format(-$GrpPrdBudget[$Level],$_SESSION['CompanyRecord']['decimalplaces']), + number_format(-$GrpPrdLY[$Level],$_SESSION['CompanyRecord']['decimalplaces'])); } else { /*Costs */ printf('<tr> - <td colspan=2><font size=2><I>%s </I></font></td> - <td class=number>%s</td> - <td></td> - <td class=number>%s</td> - <td></td> - <td class=number>%s</td> - <td></td> - </tr>', - $ActGrpLabel, - number_format($GrpPrdActual[$Level]), - number_format($GrpPrdBudget[$Level]), - number_format($GrpPrdLY[$Level])); + <td colspan=2><font size=2><I>%s </I></font></td> + <td class=number>%s</td> + <td></td> + <td class=number>%s</td> + <td></td> + <td class=number>%s</td> + <td></td> + </tr>', + $ActGrpLabel, + number_format($GrpPrdActual[$Level],$_SESSION['CompanyRecord']['decimalplaces']), + number_format($GrpPrdBudget[$Level],$_SESSION['CompanyRecord']['decimalplaces']), + number_format($GrpPrdLY[$Level],$_SESSION['CompanyRecord']['decimalplaces'])); } $GrpPrdLY[$Level] = 0; $GrpPrdActual[$Level] = 0; @@ -680,9 +688,9 @@ //still need to print out the old group totals if ($_POST['Detail']=='Detailed'){ echo '<tr> - <td colspan=2></td> - <td colspan=6><hr></td> - </tr>'; + <td colspan=2></td> + <td colspan=6><hr></td> + </tr>'; $ActGrpLabel = str_repeat('___',$Level) . $ParentGroups[$Level] . ' ' . _('total'); } else { $ActGrpLabel = str_repeat('___',$Level) . $ParentGroups[$Level]; @@ -690,32 +698,32 @@ if ($Section ==1){ /*Income */ printf('<tr> - <td colspan=2><font size=2><I>%s </I></font></td> - <td></td> - <td class=number>%s</td> - <td></td> - <td class=number>%s</td> - <td></td> - <td class=number>%s</td> - </tr>', - $ActGrpLabel, - number_format(-$GrpPrdActual[$Level]), - number_format(-$GrpPrdBudget[$Level]), - number_format(-$GrpPrdLY[$Level])); + <td colspan=2><font size=2><I>%s </I></font></td> + <td></td> + <td class=number>%s</td> + <td></td> + <td class=number>%s</td> + <td></td> + <td class=number>%s</td> + </tr>', + $ActGrpLabel, + number_format(-$GrpPrdActual[$Level],$_SESSION['CompanyRecord']['decimalplaces']), + number_format(-$GrpPrdBudget[$Level],$_SESSION['CompanyRecord']['decimalplaces']), + number_format(-$GrpPrdLY[$Level],$_SESSION['CompanyRecord']['decimalplaces'])); } else { /*Costs */ printf('<tr> - <td colspan=2><font size=2><I>%s </I></font></td> - <td class=number>%s</td> - <td></td> - <td class=number>%s</td> - <td></td> - <td class=number>%s</td> - <td></td> - </tr>', - $ActGrpLabel, - number_format($GrpPrdActual[$Level]), - number_format($GrpPrdBudget[$Level]), - number_format($GrpPrdLY[$Level])); + <td colspan=2><font size=2><I>%s </I></font></td> + <td class=number>%s</td> + <td></td> + <td class=number>%s</td> + <td></td> + <td class=number>%s</td> + <td></td> + </tr>', + $ActGrpLabel, + number_format($GrpPrdActual[$Level],$_SESSION['CompanyRecord']['decimalplaces']), + number_format($GrpPrdBudget[$Level],$_SESSION['CompanyRecord']['decimalplaces']), + number_format($GrpPrdLY[$Level],$_SESSION['CompanyRecord']['decimalplaces'])); } $GrpPrdLY[$Level] = 0; $GrpPrdActual[$Level] = 0; @@ -731,71 +739,71 @@ if ($Section==1) { /*Income*/ echo '<tr> - <td colspan=3></td> + <td colspan=3></td> <td><hr></td> - <td></td> - <td><hr></td> - <td></td> - <td><hr></td> - </tr>'; + <td></td> + <td><hr></td> + <td></td> + <td><hr></td> + </tr>'; printf('<tr> - <td colspan=2><font size=4>%s</font></td> - <td></td> - <td class=number>%s</td> - <td></td> - <td class=number>%s</td> - <td></td> - <td class=number>%s</td> - </tr>', - $Sections[$Section], - number_format(-$SectionPrdActual), - number_format(-$SectionPrdBudget), - number_format(-$SectionPrdLY)); - $TotalIncome = -$SectionPrdActual; - $TotalBudgetIncome = -$SectionPrdBudget; - $TotalLYIncome = -$SectionPrdLY; + <td colspan=2><font size=4>%s</font></td> + <td></td> + <td class=number>%s</td> + <td></td> + <td class=number>%s</td> + <td></td> + <td class=number>%s</td> + </tr>', + $Sections[$Section], + number_format(-$SectionPrdActual,$_SESSION['CompanyRecord']['decimalplaces']), + number_format(-$SectionPrdBudget,$_SESSION['CompanyRecord']['decimalplaces']), + number_format(-$SectionPrdLY,$_SESSION['CompanyRecord']['decimalplaces'])); + $TotalIncome = -$SectionPrdActual; + $TotalBudgetIncome = -$SectionPrdBudget; + $TotalLYIncome = -$SectionPrdLY; } else { echo '<tr> - <td colspan=2></td> - <td><hr></td> - <td></td> - <td><hr></td> - <td></td> - <td><hr></td> - </tr>'; - printf('<tr> - <td colspan=2><font size=4>%s</font></td> - <td></td> - <td class=number>%s</td> - <td></td> - <td class=number>%s</td> - <td></td> - <td class=number>%s</td> - </tr>', - $Sections[$Section], - number_format($SectionPrdActual), - number_format($SectionPrdBudget), - number_format($SectionPrdLY)); + <td colspan=2></td> + <td><hr></td> + <td></td> + <td><hr></td> + <td></td> + <td><hr></td> + </tr>'; + printf('<tr> + <td colspan=2><font size=4>%s</font></td> + <td></td> + <td class=number>%s</td> + <td></td> + <td class=number>%s</td> + <td></td> + <td class=number>%s</td> + </tr>', + $Sections[$Section], + number_format($SectionPrdActual,$_SESSION['CompanyRecord']['decimalplaces']), + number_format($SectionPrdBudget,$_SESSION['CompanyRecord']['decimalplaces']), + number_format($SectionPrdLY,$_SESSION['CompanyRecord']['decimalplaces'])); } if ($Section==2){ /*Cost of Sales - need sub total for Gross Profit*/ echo '<tr> - <td colspan=2></td> - <td colspan=6><hr></td> - </tr>'; + <td colspan=2></td> + <td colspan=6><hr></td> + </tr>'; printf('<tr> - <td colspan=2><font size=4>'._('Gross Profit').'</font></td> - <td></td> - <td class=number>%s</td> - <td></td> - <td class=number>%s</td> - <td></td> - <td class=number>%s</td> - </tr>', - number_format($TotalIncome - $SectionPrdActual), - number_format($TotalBudgetIncome - $SectionPrdBudget), - number_format($TotalLYIncome - $SectionPrdLY)); - + <td colspan=2><font size=4>'._('Gross Profit').'</font></td> + <td></td> + <td class=number>%s</td> + <td></td> + <td class=number>%s</td> + <td></td> + <td class=number>%s</td> + </tr>', + number_format($TotalIncome - $SectionPrdActual,$_SESSION['CompanyRecord']['decimalplaces']), + number_format($TotalBudgetIncome - $SectionPrdBudget,$_SESSION['CompanyRecord']['decimalplaces']), + number_format($TotalLYIncome - $SectionPrdLY,$_SESSION['CompanyRecord']['decimalplaces'])); + if ($TotalIncome !=0){ $PrdGPPercent = 100*($TotalIncome - $SectionPrdActual)/$TotalIncome; } else { @@ -812,21 +820,21 @@ $LYGPPercent = 0; } echo '<tr> - <td colspan=2></td> - <td colspan=6><hr></td> - </tr>'; + <td colspan=2></td> + <td colspan=6><hr></td> + </tr>'; printf('<tr> - <td colspan=2><font size=2><I>'._('Gross Profit Percent').'</I></font></td> - <td></td> - <td class=number><I>%s</I></td> - <td></td> - <td class=number><I>%s</I></td> - <td></td> - <td class=number><I>%s</I></td> - </tr><tr><td colspan=6> </td></tr>', - number_format($PrdGPPercent,1) . '%', - number_format($BudgetGPPercent,1) . '%', - number_format($LYGPPercent,1). '%'); + <td colspan=2><font size=2><I>'._('Gross Profit Percent').'</I></font></td> + <td></td> + <td class=number><I>%s</I></td> + <td></td> + <td class=number><I>%s</I></td> + <td></td> + <td class=number><I>%s</I></td> + </tr><tr><td colspan=6> </td></tr>', + number_format($PrdGPPercent,1) . '%', + number_format($BudgetGPPercent,1) . '%', + number_format($LYGPPercent,1). '%'); $j++; } } @@ -898,34 +906,34 @@ if ($Section ==1){ printf('<td>%s</td> - <td>%s</td> - <td></td> - <td class=number>%s</td> - <td></td> - <td class=number>%s</td> - <td></td> - <td class=number>%s</td> - </tr>', - $ActEnquiryURL, - $myrow['accountname'], - number_format(-$AccountPeriodActual), - number_format(-$AccountPeriodBudget), - number_format(-$AccountPeriodLY)); + <td>%s</td> + <td></td> + <td class=number>%s</td> + <td></td> + <td class=number>%s</td> + <td></td> + <td class=number>%s</td> + </tr>', + $ActEnquiryURL, + $myrow['accountname'], + number_format(-$AccountPeriodActual,$_SESSION['CompanyRecord']['decimalplaces']), + number_format(-$AccountPeriodBudget,$_SESSION['CompanyRecord']['decimalplaces']), + number_format(-$AccountPeriodLY,$_SESSION['CompanyRecord']['decimalplaces'])); } else { printf('<td>%s</td> - <td>%s</td> - <td class=number>%s</td> - <td></td> - <td class=number>%s</td> - <td></td> - <td class=number>%s</td> - <td></td> - </tr>', - $ActEnquiryURL, - $myrow['accountname'], - number_format($AccountPeriodActual), - number_format($AccountPeriodBudget), - number_format($AccountPeriodLY)); + <td>%s</td> + <td class=number>%s</td> + <td></td> + <td class=number>%s</td> + <td></td> + <td class=number>%s</td> + <td></td> + </tr>', + $ActEnquiryURL, + $myrow['accountname'], + number_format($AccountPeriodActual,$_SESSION['CompanyRecord']['decimalplaces']), + number_format($AccountPeriodBudget,$_SESSION['CompanyRecord']['decimalplaces']), + number_format($AccountPeriodLY,$_SESSION['Compan... [truncated message content] |
From: <dai...@us...> - 2011-07-09 08:23:06
|
Revision: 4629 http://web-erp.svn.sourceforge.net/web-erp/?rev=4629&view=rev Author: daintree Date: 2011-07-09 08:22:59 +0000 (Sat, 09 Jul 2011) Log Message: ----------- wrapping text on quotation comments Modified Paths: -------------- trunk/GLAccounts.php trunk/PDFQuotation.php trunk/doc/Change.log Modified: trunk/GLAccounts.php =================================================================== --- trunk/GLAccounts.php 2011-07-08 10:43:09 UTC (rev 4628) +++ trunk/GLAccounts.php 2011-07-09 08:22:59 UTC (rev 4629) @@ -37,7 +37,7 @@ $sql = "UPDATE chartmaster SET accountname='" . $_POST['AccountName'] . "', group_='" . $_POST['Group'] . "' - WHERE accountcode ='" . $SelectedAccount . "'"; + WHERE accountcode ='" . $SelectedAccount . "'"; $ErrMsg = _('Could not update the account because'); $result = DB_query($sql,$db,$ErrMsg); @@ -52,8 +52,7 @@ group_) VALUES ('" . $_POST['AccountCode'] . "', '" . $_POST['AccountName'] . "', - '" . $_POST['Group'] . "' - )"; + '" . $_POST['Group'] . "')"; $result = DB_query($sql,$db,$ErrMsg); prnMsg(_('The new general ledger account has been added'),'success'); @@ -69,9 +68,10 @@ // PREVENT DELETES IF DEPENDENT RECORDS IN 'ChartDetails' - - - $sql= "SELECT COUNT(*) FROM chartdetails WHERE chartdetails.accountcode ='" . $SelectedAccount . "' AND chartdetails.actual <>0"; + $sql= "SELECT COUNT(*) + FROM chartdetails + WHERE chartdetails.accountcode ='" . $SelectedAccount . "' + AND chartdetails.actual <>0"; $result = DB_query($sql,$db); $myrow = DB_fetch_row($result); if ($myrow[0]>0) { @@ -81,7 +81,9 @@ } else { // PREVENT DELETES IF DEPENDENT RECORDS IN 'GLTrans' - $sql= "SELECT COUNT(*) FROM gltrans WHERE gltrans.account ='" . $SelectedAccount . "'"; + $sql= "SELECT COUNT(*) + FROM gltrans + WHERE gltrans.account ='" . $SelectedAccount . "'"; $ErrMsg = _('Could not test for existing transactions because'); @@ -96,14 +98,14 @@ } else { //PREVENT DELETES IF Company default accounts set up to this account $sql= "SELECT COUNT(*) FROM companies - WHERE debtorsact='" . $SelectedAccount ."' - OR pytdiscountact='" . $SelectedAccount ."' - OR creditorsact='" . $SelectedAccount ."' - OR payrollact='" . $SelectedAccount ."' - OR grnact='" . $SelectedAccount ."' - OR exchangediffact='" . $SelectedAccount ."' - OR purchasesexchangediffact='" . $SelectedAccount ."' - OR retainedearnings='" . $SelectedAccount ."'"; + WHERE debtorsact='" . $SelectedAccount ."' + OR pytdiscountact='" . $SelectedAccount ."' + OR creditorsact='" . $SelectedAccount ."' + OR payrollact='" . $SelectedAccount ."' + OR grnact='" . $SelectedAccount ."' + OR exchangediffact='" . $SelectedAccount ."' + OR purchasesexchangediffact='" . $SelectedAccount ."' + OR retainedearnings='" . $SelectedAccount ."'"; $ErrMsg = _('Could not test for default company GL codes because'); @@ -144,7 +146,9 @@ prnMsg( _('Cannot delete this account because it is used by one of the sales GL posting interface records'),'warn'); } else { //PREVENT DELETES IF COGS POSTINGS USE THE GL ACCOUNT - $sql= "SELECT COUNT(*) FROM cogsglpostings WHERE glcode='" . $SelectedAccount ."'"; + $sql= "SELECT COUNT(*) + FROM cogsglpostings + WHERE glcode='" . $SelectedAccount ."'"; $ErrMsg = _('Could not test for existing cost of sales interface codes because'); @@ -158,11 +162,11 @@ } else { //PREVENT DELETES IF STOCK POSTINGS USE THE GL ACCOUNT $sql= "SELECT COUNT(*) FROM stockcategory - WHERE stockact='" . $SelectedAccount ."' - OR adjglact='" . $SelectedAccount ."' - OR purchpricevaract='" . $SelectedAccount ."' - OR materialuseagevarac='" . $SelectedAccount ."' - OR wipact='" . $SelectedAccount ."'"; + WHERE stockact='" . $SelectedAccount ."' + OR adjglact='" . $SelectedAccount ."' + OR purchpricevaract='" . $SelectedAccount ."' + OR materialuseagevarac='" . $SelectedAccount ."' + OR wipact='" . $SelectedAccount ."'"; $Errmsg = _('Could not test for existing stock GL codes because'); Modified: trunk/PDFQuotation.php =================================================================== --- trunk/PDFQuotation.php 2011-07-08 10:43:09 UTC (rev 4628) +++ trunk/PDFQuotation.php 2011-07-09 08:22:59 UTC (rev 4629) @@ -186,10 +186,10 @@ $LeftOvers = $pdf->addTextWrap(700,$YPos,90,$FontSize,$DisplayTotal,'right'); if (mb_strlen($myrow2['narrative'])>1){ $YPos -= ($line_height); - $LeftOvers = $pdf->addTextWrap($XPos+1,$YPos,800,$FontSize,$myrow2['narrative']); + $LeftOvers = $pdf->addTextWrap($XPos+1,$YPos,870,$FontSize,$myrow2['narrative']); if (mb_strlen($LeftOvers) >1){ $YPos -= 11; - $LeftOvers = $pdf->addTextWrap($XPos+1,$YPos,800,$FontSize,$LeftOvers); + $LeftOvers = $pdf->addTextWrap($XPos+1,$YPos,870,$FontSize,$LeftOvers); } } $QuotationTotal +=$LineTotal; @@ -209,35 +209,36 @@ include ('includes/PDFQuotationPageHeader.inc'); } //end if need a new page headed up - $LeftOvers = $pdf->addTextWrap($XPos,$YPos-80,200,10,_('Notes:')); - $LeftOvers = $pdf->addText($XPos,$YPos-95,10,$myrow['comments']); - + $YPos -= ($line_height); + $LeftOvers = $pdf->addTextWrap(40,$YPos,655,$FontSize,_('Total Tax'),'right'); + $LeftOvers = $pdf->addTextWrap(700,$YPos,90,$FontSize,number_format($TaxTotal,2),'right'); + $YPos -= 12; + $LeftOvers = $pdf->addTextWrap(40,$YPos,655,$FontSize,_('Quotation Excluding Tax'),'right'); + $LeftOvers = $pdf->addTextWrap(700,$YPos,90,$FontSize,number_format($QuotationTotalEx,2),'right'); + $YPos -= 12; + $LeftOvers = $pdf->addTextWrap(40,$YPos,655,$FontSize,_('Quotation Including Tax'),'right'); + $LeftOvers = $pdf->addTextWrap(700,$YPos,90,$FontSize,number_format($QuotationTotal,2),'right'); + + $YPos -= ($line_height); + $LeftOvers = $pdf->addTextWrap($XPos,$YPos,20,10,_('Notes:')); + $LeftOvers = $pdf->addTextWrap($XPos+28,$YPos,800,10,$myrow['comments']); + if (mb_strlen($LeftOvers)>1){ $YPos -= 10; - $LeftOvers = $pdf->addTextWrap($XPos,$YPos,700,10,$LeftOvers); + $LeftOvers = $pdf->addTextWrap($XPos,$YPos,850,10,$LeftOvers); if (mb_strlen($LeftOvers)>1){ $YPos -= 10; - $LeftOvers = $pdf->addTextWrap($XPos,$YPos,700,10,$LeftOvers); + $LeftOvers = $pdf->addTextWrap($XPos,$YPos,850,10,$LeftOvers); if (mb_strlen($LeftOvers)>1){ $YPos -= 10; - $LeftOvers = $pdf->addTextWrap($XPos,$YPos,700,10,$LeftOvers); + $LeftOvers = $pdf->addTextWrap($XPos,$YPos,850,10,$LeftOvers); if (mb_strlen($LeftOvers)>1){ $YPos -= 10; - $LeftOvers = $pdf->addTextWrap($XPos,$YPos,10,$FontSize,$LeftOvers); + $LeftOvers = $pdf->addTextWrap($XPos,$YPos,850,10,$LeftOvers); } } } } - $YPos -= ($line_height); - $LeftOvers = $pdf->addTextWrap(40,$YPos,655,$FontSize,_('Total Tax'),'right'); - $LeftOvers = $pdf->addTextWrap(700,$YPos,90,$FontSize,number_format($TaxTotal,2),'right'); - $YPos -= 12; - $LeftOvers = $pdf->addTextWrap(40,$YPos,655,$FontSize,_('Quotation Excluding Tax'),'right'); - $LeftOvers = $pdf->addTextWrap(700,$YPos,90,$FontSize,number_format($QuotationTotalEx,2),'right'); - $YPos -= 12; - $LeftOvers = $pdf->addTextWrap(40,$YPos,655,$FontSize,_('Quotation Including Tax'),'right'); - $LeftOvers = $pdf->addTextWrap(700,$YPos,90,$FontSize,number_format($QuotationTotal,2),'right'); - } /*end if there are line details to show on the quotation*/ Modified: trunk/doc/Change.log =================================================================== --- trunk/doc/Change.log 2011-07-08 10:43:09 UTC (rev 4628) +++ trunk/doc/Change.log 2011-07-09 08:22:59 UTC (rev 4629) @@ -1,6 +1,7 @@ webERP Change Log -8/7/11 Phil: Remove duplication of checking for illegal characters - use the same function in MiscFunctions.php ContainsIllegalCharacters in Currencies and the utility scripts +9/7/11 Phil/Beth Lesko: Comments not wrapping correctly on quotations - fixed landscape quotation +8/7/11 Phil: Remove duplication of checking for illegal characters - use the same function in MiscFunctions.php ContainsIllegalCharacters in Currencies and the utility scripts Z_ChangeBranchCode.php and Z_ImportStockCodes.php 8/7/11 Phil: Change all strstr occurrences to use multi-byte function mb_strstr 8/7/11 Phil: Trap codes with decimal point "." in them in the IllegalCharacters function 8/7/11 Phil: Fix discount matrix calculations on order entry and amendment This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <dai...@us...> - 2011-07-09 08:23:06
|
Revision: 4629 http://web-erp.svn.sourceforge.net/web-erp/?rev=4629&view=rev Author: daintree Date: 2011-07-09 08:22:59 +0000 (Sat, 09 Jul 2011) Log Message: ----------- wrapping text on quotation comments Modified Paths: -------------- trunk/GLAccounts.php trunk/PDFQuotation.php trunk/doc/Change.log Modified: trunk/GLAccounts.php =================================================================== --- trunk/GLAccounts.php 2011-07-08 10:43:09 UTC (rev 4628) +++ trunk/GLAccounts.php 2011-07-09 08:22:59 UTC (rev 4629) @@ -37,7 +37,7 @@ $sql = "UPDATE chartmaster SET accountname='" . $_POST['AccountName'] . "', group_='" . $_POST['Group'] . "' - WHERE accountcode ='" . $SelectedAccount . "'"; + WHERE accountcode ='" . $SelectedAccount . "'"; $ErrMsg = _('Could not update the account because'); $result = DB_query($sql,$db,$ErrMsg); @@ -52,8 +52,7 @@ group_) VALUES ('" . $_POST['AccountCode'] . "', '" . $_POST['AccountName'] . "', - '" . $_POST['Group'] . "' - )"; + '" . $_POST['Group'] . "')"; $result = DB_query($sql,$db,$ErrMsg); prnMsg(_('The new general ledger account has been added'),'success'); @@ -69,9 +68,10 @@ // PREVENT DELETES IF DEPENDENT RECORDS IN 'ChartDetails' - - - $sql= "SELECT COUNT(*) FROM chartdetails WHERE chartdetails.accountcode ='" . $SelectedAccount . "' AND chartdetails.actual <>0"; + $sql= "SELECT COUNT(*) + FROM chartdetails + WHERE chartdetails.accountcode ='" . $SelectedAccount . "' + AND chartdetails.actual <>0"; $result = DB_query($sql,$db); $myrow = DB_fetch_row($result); if ($myrow[0]>0) { @@ -81,7 +81,9 @@ } else { // PREVENT DELETES IF DEPENDENT RECORDS IN 'GLTrans' - $sql= "SELECT COUNT(*) FROM gltrans WHERE gltrans.account ='" . $SelectedAccount . "'"; + $sql= "SELECT COUNT(*) + FROM gltrans + WHERE gltrans.account ='" . $SelectedAccount . "'"; $ErrMsg = _('Could not test for existing transactions because'); @@ -96,14 +98,14 @@ } else { //PREVENT DELETES IF Company default accounts set up to this account $sql= "SELECT COUNT(*) FROM companies - WHERE debtorsact='" . $SelectedAccount ."' - OR pytdiscountact='" . $SelectedAccount ."' - OR creditorsact='" . $SelectedAccount ."' - OR payrollact='" . $SelectedAccount ."' - OR grnact='" . $SelectedAccount ."' - OR exchangediffact='" . $SelectedAccount ."' - OR purchasesexchangediffact='" . $SelectedAccount ."' - OR retainedearnings='" . $SelectedAccount ."'"; + WHERE debtorsact='" . $SelectedAccount ."' + OR pytdiscountact='" . $SelectedAccount ."' + OR creditorsact='" . $SelectedAccount ."' + OR payrollact='" . $SelectedAccount ."' + OR grnact='" . $SelectedAccount ."' + OR exchangediffact='" . $SelectedAccount ."' + OR purchasesexchangediffact='" . $SelectedAccount ."' + OR retainedearnings='" . $SelectedAccount ."'"; $ErrMsg = _('Could not test for default company GL codes because'); @@ -144,7 +146,9 @@ prnMsg( _('Cannot delete this account because it is used by one of the sales GL posting interface records'),'warn'); } else { //PREVENT DELETES IF COGS POSTINGS USE THE GL ACCOUNT - $sql= "SELECT COUNT(*) FROM cogsglpostings WHERE glcode='" . $SelectedAccount ."'"; + $sql= "SELECT COUNT(*) + FROM cogsglpostings + WHERE glcode='" . $SelectedAccount ."'"; $ErrMsg = _('Could not test for existing cost of sales interface codes because'); @@ -158,11 +162,11 @@ } else { //PREVENT DELETES IF STOCK POSTINGS USE THE GL ACCOUNT $sql= "SELECT COUNT(*) FROM stockcategory - WHERE stockact='" . $SelectedAccount ."' - OR adjglact='" . $SelectedAccount ."' - OR purchpricevaract='" . $SelectedAccount ."' - OR materialuseagevarac='" . $SelectedAccount ."' - OR wipact='" . $SelectedAccount ."'"; + WHERE stockact='" . $SelectedAccount ."' + OR adjglact='" . $SelectedAccount ."' + OR purchpricevaract='" . $SelectedAccount ."' + OR materialuseagevarac='" . $SelectedAccount ."' + OR wipact='" . $SelectedAccount ."'"; $Errmsg = _('Could not test for existing stock GL codes because'); Modified: trunk/PDFQuotation.php =================================================================== --- trunk/PDFQuotation.php 2011-07-08 10:43:09 UTC (rev 4628) +++ trunk/PDFQuotation.php 2011-07-09 08:22:59 UTC (rev 4629) @@ -186,10 +186,10 @@ $LeftOvers = $pdf->addTextWrap(700,$YPos,90,$FontSize,$DisplayTotal,'right'); if (mb_strlen($myrow2['narrative'])>1){ $YPos -= ($line_height); - $LeftOvers = $pdf->addTextWrap($XPos+1,$YPos,800,$FontSize,$myrow2['narrative']); + $LeftOvers = $pdf->addTextWrap($XPos+1,$YPos,870,$FontSize,$myrow2['narrative']); if (mb_strlen($LeftOvers) >1){ $YPos -= 11; - $LeftOvers = $pdf->addTextWrap($XPos+1,$YPos,800,$FontSize,$LeftOvers); + $LeftOvers = $pdf->addTextWrap($XPos+1,$YPos,870,$FontSize,$LeftOvers); } } $QuotationTotal +=$LineTotal; @@ -209,35 +209,36 @@ include ('includes/PDFQuotationPageHeader.inc'); } //end if need a new page headed up - $LeftOvers = $pdf->addTextWrap($XPos,$YPos-80,200,10,_('Notes:')); - $LeftOvers = $pdf->addText($XPos,$YPos-95,10,$myrow['comments']); - + $YPos -= ($line_height); + $LeftOvers = $pdf->addTextWrap(40,$YPos,655,$FontSize,_('Total Tax'),'right'); + $LeftOvers = $pdf->addTextWrap(700,$YPos,90,$FontSize,number_format($TaxTotal,2),'right'); + $YPos -= 12; + $LeftOvers = $pdf->addTextWrap(40,$YPos,655,$FontSize,_('Quotation Excluding Tax'),'right'); + $LeftOvers = $pdf->addTextWrap(700,$YPos,90,$FontSize,number_format($QuotationTotalEx,2),'right'); + $YPos -= 12; + $LeftOvers = $pdf->addTextWrap(40,$YPos,655,$FontSize,_('Quotation Including Tax'),'right'); + $LeftOvers = $pdf->addTextWrap(700,$YPos,90,$FontSize,number_format($QuotationTotal,2),'right'); + + $YPos -= ($line_height); + $LeftOvers = $pdf->addTextWrap($XPos,$YPos,20,10,_('Notes:')); + $LeftOvers = $pdf->addTextWrap($XPos+28,$YPos,800,10,$myrow['comments']); + if (mb_strlen($LeftOvers)>1){ $YPos -= 10; - $LeftOvers = $pdf->addTextWrap($XPos,$YPos,700,10,$LeftOvers); + $LeftOvers = $pdf->addTextWrap($XPos,$YPos,850,10,$LeftOvers); if (mb_strlen($LeftOvers)>1){ $YPos -= 10; - $LeftOvers = $pdf->addTextWrap($XPos,$YPos,700,10,$LeftOvers); + $LeftOvers = $pdf->addTextWrap($XPos,$YPos,850,10,$LeftOvers); if (mb_strlen($LeftOvers)>1){ $YPos -= 10; - $LeftOvers = $pdf->addTextWrap($XPos,$YPos,700,10,$LeftOvers); + $LeftOvers = $pdf->addTextWrap($XPos,$YPos,850,10,$LeftOvers); if (mb_strlen($LeftOvers)>1){ $YPos -= 10; - $LeftOvers = $pdf->addTextWrap($XPos,$YPos,10,$FontSize,$LeftOvers); + $LeftOvers = $pdf->addTextWrap($XPos,$YPos,850,10,$LeftOvers); } } } } - $YPos -= ($line_height); - $LeftOvers = $pdf->addTextWrap(40,$YPos,655,$FontSize,_('Total Tax'),'right'); - $LeftOvers = $pdf->addTextWrap(700,$YPos,90,$FontSize,number_format($TaxTotal,2),'right'); - $YPos -= 12; - $LeftOvers = $pdf->addTextWrap(40,$YPos,655,$FontSize,_('Quotation Excluding Tax'),'right'); - $LeftOvers = $pdf->addTextWrap(700,$YPos,90,$FontSize,number_format($QuotationTotalEx,2),'right'); - $YPos -= 12; - $LeftOvers = $pdf->addTextWrap(40,$YPos,655,$FontSize,_('Quotation Including Tax'),'right'); - $LeftOvers = $pdf->addTextWrap(700,$YPos,90,$FontSize,number_format($QuotationTotal,2),'right'); - } /*end if there are line details to show on the quotation*/ Modified: trunk/doc/Change.log =================================================================== --- trunk/doc/Change.log 2011-07-08 10:43:09 UTC (rev 4628) +++ trunk/doc/Change.log 2011-07-09 08:22:59 UTC (rev 4629) @@ -1,6 +1,7 @@ webERP Change Log -8/7/11 Phil: Remove duplication of checking for illegal characters - use the same function in MiscFunctions.php ContainsIllegalCharacters in Currencies and the utility scripts +9/7/11 Phil/Beth Lesko: Comments not wrapping correctly on quotations - fixed landscape quotation +8/7/11 Phil: Remove duplication of checking for illegal characters - use the same function in MiscFunctions.php ContainsIllegalCharacters in Currencies and the utility scripts Z_ChangeBranchCode.php and Z_ImportStockCodes.php 8/7/11 Phil: Change all strstr occurrences to use multi-byte function mb_strstr 8/7/11 Phil: Trap codes with decimal point "." in them in the IllegalCharacters function 8/7/11 Phil: Fix discount matrix calculations on order entry and amendment This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <dai...@us...> - 2011-07-08 10:43:15
|
Revision: 4628 http://web-erp.svn.sourceforge.net/web-erp/?rev=4628&view=rev Author: daintree Date: 2011-07-08 10:43:09 +0000 (Fri, 08 Jul 2011) Log Message: ----------- various Modified Paths: -------------- trunk/Currencies.php trunk/Z_ChangeBranchCode.php trunk/Z_ImportStocks.php trunk/doc/Change.log Modified: trunk/Currencies.php =================================================================== --- trunk/Currencies.php 2011-07-08 10:30:40 UTC (rev 4627) +++ trunk/Currencies.php 2011-07-08 10:43:09 UTC (rev 4628) @@ -100,7 +100,7 @@ $InputError = 1; prnMsg(_('The functional currency cannot be modified or deleted'),'error'); } - if (mb_strstr($_POST['Abbreviation'],"'") OR mb_strstr($_POST['Abbreviation'],'+') OR mb_strstr($_POST['Abbreviation'],"\"") OR mb_strstr($_POST['Abbreviation'],'&') OR mb_strstr($_POST['Abbreviation'],' ') OR mb_strstr($_POST['Abbreviation'],"\\") OR mb_strstr($_POST['Abbreviation'],'.') OR mb_strstr($_POST['Abbreviation'],'"')) { + if (ContainsIllegalCharacters($_POST['Abbreviation'])) { $InputError = 1; prnMsg( _('The currency code cannot contain any of the following characters') . " . - ' & + \" " . _('or a space'),'error'); $Errors[$i] = 'Abbreviation'; Modified: trunk/Z_ChangeBranchCode.php =================================================================== --- trunk/Z_ChangeBranchCode.php 2011-07-08 10:30:40 UTC (rev 4627) +++ trunk/Z_ChangeBranchCode.php 2011-07-08 10:43:09 UTC (rev 4628) @@ -1,8 +1,6 @@ <?php /* $Id$*/ -/*Script to Delete all sales transactions*/ -//$PageSecurity=15; include ('includes/session.inc'); $title = _('UTILITY PAGE To Changes A Customer Branch Code In All Tables'); include('includes/header.inc'); @@ -11,29 +9,28 @@ /*First check the customer code exists */ $result=DB_query("SELECT debtorno, - branchcode - FROM custbranch - WHERE debtorno='" . $_POST['DebtorNo'] . "' - AND branchcode='" . $_POST['OldBranchCode'] . "'",$db); + branchcode + FROM custbranch + WHERE debtorno='" . $_POST['DebtorNo'] . "' + AND branchcode='" . $_POST['OldBranchCode'] . "'",$db); if (DB_num_rows($result)==0){ prnMsg (_('The customer branch code') . ': ' . $_POST['DebtorNo'] . ' - ' . $_POST['OldBranchCode'] . ' ' . _('does not currently exist as a customer branch code in the system'),'error'); include('includes/footer.inc'); exit; } - if ($_POST['NewBranchCode']==""){ + if ($_POST['NewBranchCode']==''){ prnMsg(_('The new customer branch code to change the old code to must be entered as well'),'error'); include('includes/footer.inc'); exit; } - if (mb_strstr($_POST['NewBranchCode'],".")>0 OR mb_strstr($_POST['NewBranchCode'],"&") OR mb_strstr($_POST['NewBranchCode'],"-") OR mb_strstr($_POST['NewBranchCode']," ")){ + if (ContainsIllegalCharacters($_POST['NewBranchCode']) OR mb_strstr($_POST['NewBranchCode'],' ')){ prnMsg(_('The new customer branch code cannot contain') . ' - & . ' . _('or a space'),'error'); include('includes/footer.inc'); exit; } - /*Now check that the new code doesn't already exist */ $result=DB_query("SELECT debtorno FROM custbranch WHERE debtorno='" . $_POST['DebtorNo'] . "' AND branchcode ='" . $_POST['NewBranchCode'] . "'",$db); if (DB_num_rows($result)!=0){ Modified: trunk/Z_ImportStocks.php =================================================================== --- trunk/Z_ImportStocks.php 2011-07-08 10:30:40 UTC (rev 4627) +++ trunk/Z_ImportStocks.php 2011-07-08 10:43:09 UTC (rev 4628) @@ -1,8 +1,6 @@ <?php /* $Id$*/ -/* Script to make stock locations for all parts that do not have stock location records set up*/ -//$PageSecurity = 15; include('includes/session.inc'); $title = _('Import Items'); include('includes/header.inc'); @@ -120,7 +118,7 @@ $InputError = 1; prnMsg (_('The Stock Item code cannot be empty'),'error'); } - if (mb_strstr($StockID,' ') OR mb_strstr($StockID,"'") OR mb_strstr($StockID,'+') OR mb_strstr($StockID,"\\") OR mb_strstr($StockID,"\"") OR mb_strstr($StockID,'&') OR mb_strstr($StockID,'"')) { + if (ContainsIllegalCharacters($StockID) OR mb_strstr($StockID,' ')) { $InputError = 1; prnMsg(_('The stock item code cannot contain any of the following characters') . " ' & + \" \\ " . _('or a space'). " (". $StockID. ")",'error'); $StockID=''; Modified: trunk/doc/Change.log =================================================================== --- trunk/doc/Change.log 2011-07-08 10:30:40 UTC (rev 4627) +++ trunk/doc/Change.log 2011-07-08 10:43:09 UTC (rev 4628) @@ -1,5 +1,6 @@ webERP Change Log +8/7/11 Phil: Remove duplication of checking for illegal characters - use the same function in MiscFunctions.php ContainsIllegalCharacters in Currencies and the utility scripts 8/7/11 Phil: Change all strstr occurrences to use multi-byte function mb_strstr 8/7/11 Phil: Trap codes with decimal point "." in them in the IllegalCharacters function 8/7/11 Phil: Fix discount matrix calculations on order entry and amendment This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <dai...@us...> - 2011-07-08 10:43:15
|
Revision: 4628 http://web-erp.svn.sourceforge.net/web-erp/?rev=4628&view=rev Author: daintree Date: 2011-07-08 10:43:09 +0000 (Fri, 08 Jul 2011) Log Message: ----------- various Modified Paths: -------------- trunk/Currencies.php trunk/Z_ChangeBranchCode.php trunk/Z_ImportStocks.php trunk/doc/Change.log Modified: trunk/Currencies.php =================================================================== --- trunk/Currencies.php 2011-07-08 10:30:40 UTC (rev 4627) +++ trunk/Currencies.php 2011-07-08 10:43:09 UTC (rev 4628) @@ -100,7 +100,7 @@ $InputError = 1; prnMsg(_('The functional currency cannot be modified or deleted'),'error'); } - if (mb_strstr($_POST['Abbreviation'],"'") OR mb_strstr($_POST['Abbreviation'],'+') OR mb_strstr($_POST['Abbreviation'],"\"") OR mb_strstr($_POST['Abbreviation'],'&') OR mb_strstr($_POST['Abbreviation'],' ') OR mb_strstr($_POST['Abbreviation'],"\\") OR mb_strstr($_POST['Abbreviation'],'.') OR mb_strstr($_POST['Abbreviation'],'"')) { + if (ContainsIllegalCharacters($_POST['Abbreviation'])) { $InputError = 1; prnMsg( _('The currency code cannot contain any of the following characters') . " . - ' & + \" " . _('or a space'),'error'); $Errors[$i] = 'Abbreviation'; Modified: trunk/Z_ChangeBranchCode.php =================================================================== --- trunk/Z_ChangeBranchCode.php 2011-07-08 10:30:40 UTC (rev 4627) +++ trunk/Z_ChangeBranchCode.php 2011-07-08 10:43:09 UTC (rev 4628) @@ -1,8 +1,6 @@ <?php /* $Id$*/ -/*Script to Delete all sales transactions*/ -//$PageSecurity=15; include ('includes/session.inc'); $title = _('UTILITY PAGE To Changes A Customer Branch Code In All Tables'); include('includes/header.inc'); @@ -11,29 +9,28 @@ /*First check the customer code exists */ $result=DB_query("SELECT debtorno, - branchcode - FROM custbranch - WHERE debtorno='" . $_POST['DebtorNo'] . "' - AND branchcode='" . $_POST['OldBranchCode'] . "'",$db); + branchcode + FROM custbranch + WHERE debtorno='" . $_POST['DebtorNo'] . "' + AND branchcode='" . $_POST['OldBranchCode'] . "'",$db); if (DB_num_rows($result)==0){ prnMsg (_('The customer branch code') . ': ' . $_POST['DebtorNo'] . ' - ' . $_POST['OldBranchCode'] . ' ' . _('does not currently exist as a customer branch code in the system'),'error'); include('includes/footer.inc'); exit; } - if ($_POST['NewBranchCode']==""){ + if ($_POST['NewBranchCode']==''){ prnMsg(_('The new customer branch code to change the old code to must be entered as well'),'error'); include('includes/footer.inc'); exit; } - if (mb_strstr($_POST['NewBranchCode'],".")>0 OR mb_strstr($_POST['NewBranchCode'],"&") OR mb_strstr($_POST['NewBranchCode'],"-") OR mb_strstr($_POST['NewBranchCode']," ")){ + if (ContainsIllegalCharacters($_POST['NewBranchCode']) OR mb_strstr($_POST['NewBranchCode'],' ')){ prnMsg(_('The new customer branch code cannot contain') . ' - & . ' . _('or a space'),'error'); include('includes/footer.inc'); exit; } - /*Now check that the new code doesn't already exist */ $result=DB_query("SELECT debtorno FROM custbranch WHERE debtorno='" . $_POST['DebtorNo'] . "' AND branchcode ='" . $_POST['NewBranchCode'] . "'",$db); if (DB_num_rows($result)!=0){ Modified: trunk/Z_ImportStocks.php =================================================================== --- trunk/Z_ImportStocks.php 2011-07-08 10:30:40 UTC (rev 4627) +++ trunk/Z_ImportStocks.php 2011-07-08 10:43:09 UTC (rev 4628) @@ -1,8 +1,6 @@ <?php /* $Id$*/ -/* Script to make stock locations for all parts that do not have stock location records set up*/ -//$PageSecurity = 15; include('includes/session.inc'); $title = _('Import Items'); include('includes/header.inc'); @@ -120,7 +118,7 @@ $InputError = 1; prnMsg (_('The Stock Item code cannot be empty'),'error'); } - if (mb_strstr($StockID,' ') OR mb_strstr($StockID,"'") OR mb_strstr($StockID,'+') OR mb_strstr($StockID,"\\") OR mb_strstr($StockID,"\"") OR mb_strstr($StockID,'&') OR mb_strstr($StockID,'"')) { + if (ContainsIllegalCharacters($StockID) OR mb_strstr($StockID,' ')) { $InputError = 1; prnMsg(_('The stock item code cannot contain any of the following characters') . " ' & + \" \\ " . _('or a space'). " (". $StockID. ")",'error'); $StockID=''; Modified: trunk/doc/Change.log =================================================================== --- trunk/doc/Change.log 2011-07-08 10:30:40 UTC (rev 4627) +++ trunk/doc/Change.log 2011-07-08 10:43:09 UTC (rev 4628) @@ -1,5 +1,6 @@ webERP Change Log +8/7/11 Phil: Remove duplication of checking for illegal characters - use the same function in MiscFunctions.php ContainsIllegalCharacters in Currencies and the utility scripts 8/7/11 Phil: Change all strstr occurrences to use multi-byte function mb_strstr 8/7/11 Phil: Trap codes with decimal point "." in them in the IllegalCharacters function 8/7/11 Phil: Fix discount matrix calculations on order entry and amendment This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <dai...@us...> - 2011-07-08 10:30:48
|
Revision: 4627 http://web-erp.svn.sourceforge.net/web-erp/?rev=4627&view=rev Author: daintree Date: 2011-07-08 10:30:40 +0000 (Fri, 08 Jul 2011) Log Message: ----------- various Modified Paths: -------------- trunk/CounterSales.php trunk/Currencies.php trunk/CustEDISetup.php trunk/CustLoginSetup.php trunk/CustomerBranches.php trunk/SelectOrderItems.php trunk/StockSerialItemResearch.php trunk/SuppLoginSetup.php trunk/SystemParameters.php trunk/UpgradeDatabase.php trunk/WWW_Users.php trunk/WorkCentres.php trunk/Z_ChangeBranchCode.php trunk/Z_ImportStocks.php trunk/Z_MakeNewCompany.php trunk/Z_Upgrade_3.04-3.05.php trunk/Z_Upgrade_3.05-3.06.php trunk/Z_Upgrade_3.07-3.08.php trunk/Z_Upgrade_3.08-3.09.php trunk/Z_Upgrade_3.09-3.10.php trunk/Z_Upgrade_3.10-3.11.php trunk/Z_Upgrade_3.11-4.00.php trunk/api/api_debtortransactions.php trunk/api/api_salesorders.php trunk/api/api_stock.php trunk/api/api_suppliers.php trunk/api/api_workorders.php trunk/doc/Change.log trunk/includes/MiscFunctions.php trunk/install/save.php Modified: trunk/CounterSales.php =================================================================== --- trunk/CounterSales.php 2011-07-08 10:28:14 UTC (rev 4626) +++ trunk/CounterSales.php 2011-07-08 10:30:40 UTC (rev 4627) @@ -35,7 +35,7 @@ if (isset($_POST['OrderItems'])){ foreach ($_POST as $key => $value) { - if (strstr($key,'itm')) { + if (mb_strstr($key,'itm')) { $NewItemArray[mb_substr($key,3)] = trim($value); } } Modified: trunk/Currencies.php =================================================================== --- trunk/Currencies.php 2011-07-08 10:28:14 UTC (rev 4626) +++ trunk/Currencies.php 2011-07-08 10:30:40 UTC (rev 4627) @@ -100,7 +100,7 @@ $InputError = 1; prnMsg(_('The functional currency cannot be modified or deleted'),'error'); } - if (strstr($_POST['Abbreviation'],"'") OR strstr($_POST['Abbreviation'],'+') OR strstr($_POST['Abbreviation'],"\"") OR strstr($_POST['Abbreviation'],'&') OR strstr($_POST['Abbreviation'],' ') OR strstr($_POST['Abbreviation'],"\\") OR strstr($_POST['Abbreviation'],'.') OR strstr($_POST['Abbreviation'],'"')) { + if (mb_strstr($_POST['Abbreviation'],"'") OR mb_strstr($_POST['Abbreviation'],'+') OR mb_strstr($_POST['Abbreviation'],"\"") OR mb_strstr($_POST['Abbreviation'],'&') OR mb_strstr($_POST['Abbreviation'],' ') OR mb_strstr($_POST['Abbreviation'],"\\") OR mb_strstr($_POST['Abbreviation'],'.') OR mb_strstr($_POST['Abbreviation'],'"')) { $InputError = 1; prnMsg( _('The currency code cannot contain any of the following characters') . " . - ' & + \" " . _('or a space'),'error'); $Errors[$i] = 'Abbreviation'; Modified: trunk/CustEDISetup.php =================================================================== --- trunk/CustEDISetup.php 2011-07-08 10:28:14 UTC (rev 4626) +++ trunk/CustEDISetup.php 2011-07-08 10:30:40 UTC (rev 4627) @@ -26,7 +26,7 @@ //first off validate inputs sensible if (ContainsIllegalCharacters($_POST['EDIReference']) - OR strstr($_POST['EDIReference'],' ')) { + OR mb_strstr($_POST['EDIReference'],' ')) { $InputError = 1; prnMsg(_('The customers EDI reference code cannot contain any of the following characters') .' - \' & + \" ' . _('or a space'),'warn'); } Modified: trunk/CustLoginSetup.php =================================================================== --- trunk/CustLoginSetup.php 2011-07-08 10:28:14 UTC (rev 4626) +++ trunk/CustLoginSetup.php 2011-07-08 10:30:40 UTC (rev 4627) @@ -40,7 +40,7 @@ if (mb_strlen($_POST['UserID'])<3){ $InputError = 1; prnMsg(_('The user ID entered must be at least 4 characters long'),'error'); - } elseif (ContainsIllegalCharacters($_POST['UserID']) OR strstr($_POST['UserID'],' ')) { + } elseif (ContainsIllegalCharacters($_POST['UserID']) OR mb_strstr($_POST['UserID'],' ')) { $InputError = 1; prnMsg(_('User names cannot contain any of the following characters') . " - ' & + \" \\ " . _('or a space'),'error'); } elseif (mb_strlen($_POST['Password'])<5){ @@ -48,7 +48,7 @@ $InputError = 1; prnMsg(_('The password entered must be at least 5 characters long'),'error'); } - } elseif (strstr($_POST['Password'],$_POST['UserID'])!= False){ + } elseif (mb_strstr($_POST['Password'],$_POST['UserID'])!= False){ $InputError = 1; prnMsg(_('The password cannot contain the user id'),'error'); } elseif ((mb_strlen($_POST['Cust'])>0) AND (mb_strlen($_POST['BranchCode'])==0)) { Modified: trunk/CustomerBranches.php =================================================================== --- trunk/CustomerBranches.php 2011-07-08 10:28:14 UTC (rev 4626) +++ trunk/CustomerBranches.php 2011-07-08 10:30:40 UTC (rev 4627) @@ -46,7 +46,7 @@ $_POST['BranchCode'] = mb_strtoupper($_POST['BranchCode']); - if (ContainsIllegalCharacters($_POST['BranchCode']) OR strstr($_POST['BranchCode'],' ')) { + if (ContainsIllegalCharacters($_POST['BranchCode']) OR mb_strstr($_POST['BranchCode'],' ')) { $InputError = 1; prnMsg(_('The Branch code cannot contain any of the following characters')." - & \'",'error'); $Errors[$i] = 'BranchCode'; Modified: trunk/SelectOrderItems.php =================================================================== --- trunk/SelectOrderItems.php 2011-07-08 10:28:14 UTC (rev 4626) +++ trunk/SelectOrderItems.php 2011-07-08 10:30:40 UTC (rev 4627) @@ -24,7 +24,7 @@ if (isset($_POST['order_items'])){ foreach ($_POST as $key => $value) { - if (strstr($key,'itm')) { + if (mb_strstr($key,'itm')) { $NewItem_array[mb_substr($key,3)] = trim($value); } } Modified: trunk/StockSerialItemResearch.php =================================================================== --- trunk/StockSerialItemResearch.php 2011-07-08 10:28:14 UTC (rev 4626) +++ trunk/StockSerialItemResearch.php 2011-07-08 10:30:40 UTC (rev 4627) @@ -38,8 +38,8 @@ if ($SN!='') { //the point here is to allow a semi fuzzy search, but still keep someone from killing the db server - if (strstr($SN,'%')){ - while(strstr($SN,'%%')) { + if (mb_strstr($SN,'%')){ + while(mb_strstr($SN,'%%')) { $SN = str_replace('%%','%',$SN); } if (mb_strlen($SN) < 11){ Modified: trunk/SuppLoginSetup.php =================================================================== --- trunk/SuppLoginSetup.php 2011-07-08 10:28:14 UTC (rev 4626) +++ trunk/SuppLoginSetup.php 2011-07-08 10:30:40 UTC (rev 4627) @@ -82,7 +82,7 @@ $InputError = 1; prnMsg(_('The password entered must be at least 5 characters long'),'error'); } - } elseif (strstr($_POST['Password'],$_POST['UserID'])!= False){ + } elseif (mb_strstr($_POST['Password'],$_POST['UserID'])!= False){ $InputError = 1; prnMsg(_('The password cannot contain the user id'),'error'); } Modified: trunk/SystemParameters.php =================================================================== --- trunk/SystemParameters.php 2011-07-08 10:28:14 UTC (rev 4626) +++ trunk/SystemParameters.php 2011-07-08 10:30:40 UTC (rev 4627) @@ -33,7 +33,7 @@ } elseif (mb_strlen($_POST['X_DefaultCreditLimit']) > 12 || !is_numeric($_POST['X_DefaultCreditLimit']) ) { $InputError = 1; prnMsg(_('Default Credit Limit must be a number'),'error'); - } elseif (strstr($_POST['X_RomalpaClause'], "'") || mb_strlen($_POST['X_RomalpaClause']) > 5000) { + } elseif (mb_strstr($_POST['X_RomalpaClause'], "'") || mb_strlen($_POST['X_RomalpaClause']) > 5000) { $InputError = 1; prnMsg(_('The Romalpa Clause may not contain single quotes and may not be longer than 5000 chars'),'error'); } elseif (mb_strlen($_POST['X_QuickEntries']) > 2 || !is_numeric($_POST['X_QuickEntries']) || Modified: trunk/UpgradeDatabase.php =================================================================== --- trunk/UpgradeDatabase.php 2011-07-08 10:28:14 UTC (rev 4626) +++ trunk/UpgradeDatabase.php 2011-07-08 10:30:40 UTC (rev 4627) @@ -146,7 +146,7 @@ if (mb_substr($SQLEntries[$i], 0, 2) != '--' AND mb_substr($SQLEntries[$i], 0, 3) != 'USE' - AND strstr($SQLEntries[$i],'/*')==FALSE + AND mb_strstr($SQLEntries[$i],'/*')==FALSE AND mb_strlen($SQLEntries[$i])>1){ $sql .= ' ' . $SQLEntries[$i]; Modified: trunk/WWW_Users.php =================================================================== --- trunk/WWW_Users.php 2011-07-08 10:28:14 UTC (rev 4626) +++ trunk/WWW_Users.php 2011-07-08 10:30:40 UTC (rev 4627) @@ -70,7 +70,7 @@ $InputError = 1; prnMsg(_('The password entered must be at least 5 characters long'),'error'); } - } elseif (strstr($_POST['Password'],$_POST['UserID'])!= False){ + } elseif (mb_strstr($_POST['Password'],$_POST['UserID'])!= False){ $InputError = 1; prnMsg(_('The password cannot contain the user id'),'error'); } elseif ((mb_strlen($_POST['Cust'])>0) AND (mb_strlen($_POST['BranchCode'])==0)) { Modified: trunk/WorkCentres.php =================================================================== --- trunk/WorkCentres.php 2011-07-08 10:28:14 UTC (rev 4626) +++ trunk/WorkCentres.php 2011-07-08 10:30:40 UTC (rev 4627) @@ -30,7 +30,7 @@ $InputError = 1; prnMsg(_('The Work Centre description must be at least 3 characters long'),'error'); } - if (strstr($_POST['Code'],' ') OR ContainsIllegalCharacters($_POST['Code']) ) { + if (mb_strstr($_POST['Code'],' ') OR ContainsIllegalCharacters($_POST['Code']) ) { $InputError = 1; prnMsg(_('The work centre code cannot contain any of the following characters') . " - ' & + \" \\ " . _('or a space'),'error'); } Modified: trunk/Z_ChangeBranchCode.php =================================================================== --- trunk/Z_ChangeBranchCode.php 2011-07-08 10:28:14 UTC (rev 4626) +++ trunk/Z_ChangeBranchCode.php 2011-07-08 10:30:40 UTC (rev 4627) @@ -26,7 +26,7 @@ include('includes/footer.inc'); exit; } - if (strstr($_POST['NewBranchCode'],".")>0 OR strstr($_POST['NewBranchCode'],"&") OR strstr($_POST['NewBranchCode'],"-") OR strstr($_POST['NewBranchCode']," ")){ + if (mb_strstr($_POST['NewBranchCode'],".")>0 OR mb_strstr($_POST['NewBranchCode'],"&") OR mb_strstr($_POST['NewBranchCode'],"-") OR mb_strstr($_POST['NewBranchCode']," ")){ prnMsg(_('The new customer branch code cannot contain') . ' - & . ' . _('or a space'),'error'); include('includes/footer.inc'); exit; Modified: trunk/Z_ImportStocks.php =================================================================== --- trunk/Z_ImportStocks.php 2011-07-08 10:28:14 UTC (rev 4626) +++ trunk/Z_ImportStocks.php 2011-07-08 10:30:40 UTC (rev 4627) @@ -120,7 +120,7 @@ $InputError = 1; prnMsg (_('The Stock Item code cannot be empty'),'error'); } - if (strstr($StockID,' ') OR strstr($StockID,"'") OR strstr($StockID,'+') OR strstr($StockID,"\\") OR strstr($StockID,"\"") OR strstr($StockID,'&') OR strstr($StockID,'"')) { + if (mb_strstr($StockID,' ') OR mb_strstr($StockID,"'") OR mb_strstr($StockID,'+') OR mb_strstr($StockID,"\\") OR mb_strstr($StockID,"\"") OR mb_strstr($StockID,'&') OR mb_strstr($StockID,'"')) { $InputError = 1; prnMsg(_('The stock item code cannot contain any of the following characters') . " ' & + \" \\ " . _('or a space'). " (". $StockID. ")",'error'); $StockID=''; Modified: trunk/Z_MakeNewCompany.php =================================================================== --- trunk/Z_MakeNewCompany.php 2011-07-08 10:28:14 UTC (rev 4626) +++ trunk/Z_MakeNewCompany.php 2011-07-08 10:30:40 UTC (rev 4627) @@ -105,7 +105,7 @@ if (mb_substr($SQLScriptFile[$i], 0, 2) != '--' AND mb_substr($SQLScriptFile[$i], 0, 3) != 'USE' - AND strstr($SQLScriptFile[$i],'/*')==FALSE + AND mb_strstr($SQLScriptFile[$i],'/*')==FALSE AND mb_strlen($SQLScriptFile[$i])>1){ $SQL .= ' ' . $SQLScriptFile[$i]; Modified: trunk/Z_Upgrade_3.04-3.05.php =================================================================== --- trunk/Z_Upgrade_3.04-3.05.php 2011-07-08 10:28:14 UTC (rev 4626) +++ trunk/Z_Upgrade_3.04-3.05.php 2011-07-08 10:30:40 UTC (rev 4627) @@ -36,7 +36,7 @@ if (mb_substr($SQLScriptFile[$i], 0, 2) != '--' AND mb_substr($SQLScriptFile[$i], 0, 3) != 'USE' - AND strstr($SQLScriptFile[$i],'/*')==FALSE + AND mb_strstr($SQLScriptFile[$i],'/*')==FALSE AND mb_strlen($SQLScriptFile[$i])>1){ $SQL .= ' ' . $SQLScriptFile[$i]; Modified: trunk/Z_Upgrade_3.05-3.06.php =================================================================== --- trunk/Z_Upgrade_3.05-3.06.php 2011-07-08 10:28:14 UTC (rev 4626) +++ trunk/Z_Upgrade_3.05-3.06.php 2011-07-08 10:30:40 UTC (rev 4627) @@ -28,7 +28,7 @@ if (mb_substr($SQLScriptFile[$i], 0, 2) != '--' AND mb_substr($SQLScriptFile[$i], 0, 3) != 'USE' - AND strstr($SQLScriptFile[$i],'/*')==FALSE + AND mb_strstr($SQLScriptFile[$i],'/*')==FALSE AND mb_strlen($SQLScriptFile[$i])>1){ $SQL .= ' ' . $SQLScriptFile[$i]; Modified: trunk/Z_Upgrade_3.07-3.08.php =================================================================== --- trunk/Z_Upgrade_3.07-3.08.php 2011-07-08 10:28:14 UTC (rev 4626) +++ trunk/Z_Upgrade_3.07-3.08.php 2011-07-08 10:30:40 UTC (rev 4627) @@ -28,7 +28,7 @@ if (mb_substr($SQLScriptFile[$i], 0, 2) != '--' AND mb_substr($SQLScriptFile[$i], 0, 3) != 'USE' - AND strstr($SQLScriptFile[$i],'/*')==FALSE + AND mb_strstr($SQLScriptFile[$i],'/*')==FALSE AND mb_strlen($SQLScriptFile[$i])>1){ $SQL .= ' ' . $SQLScriptFile[$i]; Modified: trunk/Z_Upgrade_3.08-3.09.php =================================================================== --- trunk/Z_Upgrade_3.08-3.09.php 2011-07-08 10:28:14 UTC (rev 4626) +++ trunk/Z_Upgrade_3.08-3.09.php 2011-07-08 10:30:40 UTC (rev 4627) @@ -28,7 +28,7 @@ if (mb_substr($SQLScriptFile[$i], 0, 2) != '--' AND mb_substr($SQLScriptFile[$i], 0, 3) != 'USE' - AND strstr($SQLScriptFile[$i],'/*')==FALSE + AND mb_strstr($SQLScriptFile[$i],'/*')==FALSE AND mb_strlen($SQLScriptFile[$i])>1){ $SQL .= ' ' . $SQLScriptFile[$i]; Modified: trunk/Z_Upgrade_3.09-3.10.php =================================================================== --- trunk/Z_Upgrade_3.09-3.10.php 2011-07-08 10:28:14 UTC (rev 4626) +++ trunk/Z_Upgrade_3.09-3.10.php 2011-07-08 10:30:40 UTC (rev 4627) @@ -28,7 +28,7 @@ if (mb_substr($SQLScriptFile[$i], 0, 2) != '--' AND mb_substr($SQLScriptFile[$i], 0, 3) != 'USE' - AND strstr($SQLScriptFile[$i],'/*')==FALSE + AND mb_strstr($SQLScriptFile[$i],'/*')==FALSE AND mb_strlen($SQLScriptFile[$i])>1){ $SQL .= ' ' . $SQLScriptFile[$i]; Modified: trunk/Z_Upgrade_3.10-3.11.php =================================================================== --- trunk/Z_Upgrade_3.10-3.11.php 2011-07-08 10:28:14 UTC (rev 4626) +++ trunk/Z_Upgrade_3.10-3.11.php 2011-07-08 10:30:40 UTC (rev 4627) @@ -38,7 +38,7 @@ if (mb_substr($SQLScriptFile[$i], 0, 2) != '--' AND mb_substr($SQLScriptFile[$i], 0, 3) != 'USE' - AND strstr($SQLScriptFile[$i],'/*')==FALSE + AND mb_strstr($SQLScriptFile[$i],'/*')==FALSE AND mb_strlen($SQLScriptFile[$i])>1){ $sql .= ' ' . $SQLScriptFile[$i]; Modified: trunk/Z_Upgrade_3.11-4.00.php =================================================================== --- trunk/Z_Upgrade_3.11-4.00.php 2011-07-08 10:28:14 UTC (rev 4626) +++ trunk/Z_Upgrade_3.11-4.00.php 2011-07-08 10:30:40 UTC (rev 4627) @@ -38,7 +38,7 @@ if (mb_substr($SQLScriptFile[$i], 0, 2) != '--' AND mb_substr($SQLScriptFile[$i], 0, 3) != 'USE' - AND strstr($SQLScriptFile[$i],'/*')==FALSE + AND mb_strstr($SQLScriptFile[$i],'/*')==FALSE AND mb_strlen($SQLScriptFile[$i])>1){ $sql .= ' ' . $SQLScriptFile[$i]; Modified: trunk/api/api_debtortransactions.php =================================================================== --- trunk/api/api_debtortransactions.php 2011-07-08 10:28:14 UTC (rev 4626) +++ trunk/api/api_debtortransactions.php 2011-07-08 10:30:40 UTC (rev 4627) @@ -87,9 +87,9 @@ $result=DB_query($sql, $db); $myrow=DB_fetch_array($result); $DateFormat=$myrow[0]; - if (strstr('/',$PeriodEnd)) { + if (mb_strstr('/',$PeriodEnd)) { $Date_Array = explode('/',$PeriodEnd); - } elseif (strstr('.',$PeriodEnd)) { + } elseif (mb_strstr('.',$PeriodEnd)) { $Date_Array = explode('.',$PeriodEnd); } if ($DateFormat=='d/m/Y') { Modified: trunk/api/api_salesorders.php =================================================================== --- trunk/api/api_salesorders.php 2011-07-08 10:28:14 UTC (rev 4626) +++ trunk/api/api_salesorders.php 2011-07-08 10:30:40 UTC (rev 4627) @@ -43,9 +43,9 @@ $result=api_DB_query($sql, $db); $myrow=DB_fetch_array($result); $DateFormat=$myrow[0]; - if (strstr($orddate,"/")) { + if (mb_strstr($orddate,"/")) { $DateArray = explode('/',$orddate); - } elseif (strstr($orddate,".")) { + } elseif (mb_strstr($orddate,".")) { $DateArray = explode('.',$orddate); } if ($DateFormat=='d/m/Y') { @@ -121,9 +121,9 @@ $result=api_DB_query($sql, $db); $myrow=DB_fetch_array($result); $DateFormat=$myrow[0]; - if (strstr($deliverydate,'/')) { + if (mb_strstr($deliverydate,'/')) { $DateArray = explode('/',$deliverydate); - } elseif (strstr($PeriodEnd,'.')) { + } elseif (mb_strstr($PeriodEnd,'.')) { $DateArray = explode('.',$deliverydate); } if ($DateFormat=='d/m/Y') { @@ -231,9 +231,9 @@ $result=api_DB_query($sql, $db); $myrow=DB_fetch_array($result); $DateFormat=$myrow[0]; - if (strstr($itemdue,'/')) { + if (mb_strstr($itemdue,'/')) { $DateArray = explode('/',$itemdue); - } elseif (strstr($itemdue,'.')) { + } elseif (mb_strstr($itemdue,'.')) { $DateArray = explode('.',$itemdue); } if ($DateFormat=='d/m/Y') { Modified: trunk/api/api_stock.php =================================================================== --- trunk/api/api_stock.php 2011-07-08 10:28:14 UTC (rev 4626) +++ trunk/api/api_stock.php 2011-07-08 10:30:40 UTC (rev 4627) @@ -79,9 +79,9 @@ $result=DB_query($sql, $db); $myrow=DB_fetch_array($result); $DateFormat=$myrow[0]; - if (strstr('/',$PeriodEnd)) { + if (mb_strstr('/',$PeriodEnd)) { $Date_Array = explode('/',$PeriodEnd); - } elseif (strstr('.',$PeriodEnd)) { + } elseif (mb_strstr('.',$PeriodEnd)) { $Date_Array = explode('.',$PeriodEnd); } if ($DateFormat=='d/m/Y') { Modified: trunk/api/api_suppliers.php =================================================================== --- trunk/api/api_suppliers.php 2011-07-08 10:28:14 UTC (rev 4626) +++ trunk/api/api_suppliers.php 2011-07-08 10:30:40 UTC (rev 4627) @@ -51,9 +51,9 @@ $result=DB_query($sql, $db); $myrow=DB_fetch_array($result); $DateFormat=$myrow[0]; - if (strstr('/',$PeriodEnd)) { + if (mb_strstr('/',$PeriodEnd)) { $Date_Array = explode('/',$PeriodEnd); - } elseif (strstr('.',$PeriodEnd)) { + } elseif (mb_strstr('.',$PeriodEnd)) { $Date_Array = explode('.',$PeriodEnd); } if ($DateFormat=='d/m/Y') { Modified: trunk/api/api_workorders.php =================================================================== --- trunk/api/api_workorders.php 2011-07-08 10:28:14 UTC (rev 4626) +++ trunk/api/api_workorders.php 2011-07-08 10:30:40 UTC (rev 4627) @@ -48,9 +48,9 @@ $result=DB_query($sql, $db); $myrow=DB_fetch_array($result); $DateFormat=$myrow[0]; - if (strstr('/',$PeriodEnd)) { + if (mb_strstr('/',$PeriodEnd)) { $Date_Array = explode('/',$PeriodEnd); - } elseif (strstr('.',$PeriodEnd)) { + } elseif (mb_strstr('.',$PeriodEnd)) { $Date_Array = explode('.',$PeriodEnd); } if ($DateFormat=='d/m/Y') { @@ -81,9 +81,9 @@ $result=DB_query($sql, $db); $myrow=DB_fetch_array($result); $DateFormat=$myrow[0]; - if (strstr('/',$PeriodEnd)) { + if (mb_strstr('/',$PeriodEnd)) { $Date_Array = explode('/',$PeriodEnd); - } elseif (strstr('.',$PeriodEnd)) { + } elseif (mb_strstr('.',$PeriodEnd)) { $Date_Array = explode('.',$PeriodEnd); } if ($DateFormat=='d/m/Y') { Modified: trunk/doc/Change.log =================================================================== --- trunk/doc/Change.log 2011-07-08 10:28:14 UTC (rev 4626) +++ trunk/doc/Change.log 2011-07-08 10:30:40 UTC (rev 4627) @@ -1,5 +1,6 @@ webERP Change Log +8/7/11 Phil: Change all strstr occurrences to use multi-byte function mb_strstr 8/7/11 Phil: Trap codes with decimal point "." in them in the IllegalCharacters function 8/7/11 Phil: Fix discount matrix calculations on order entry and amendment 5/7/11 Phil: Amend menu to use PDFStockLocTransfer.php to reprint transfer list - as reported by Ron Wong Modified: trunk/includes/MiscFunctions.php =================================================================== --- trunk/includes/MiscFunctions.php 2011-07-08 10:28:14 UTC (rev 4626) +++ trunk/includes/MiscFunctions.php 2011-07-08 10:30:40 UTC (rev 4627) @@ -109,16 +109,16 @@ function ContainsIllegalCharacters ($CheckVariable) { - if (strstr($CheckVariable,"'") - OR strstr($CheckVariable,'+') - OR strstr($CheckVariable,'?') - OR strstr($CheckVariable,'.') - OR strstr($CheckVariable,"\"") - OR strstr($CheckVariable,'&') - OR strstr($CheckVariable,"\\") - OR strstr($CheckVariable,'"') - OR strstr($CheckVariable,'>') - OR strstr($CheckVariable,'<')){ + if (mb_strstr($CheckVariable,"'") + OR mb_strstr($CheckVariable,'+') + OR mb_strstr($CheckVariable,'?') + OR mb_strstr($CheckVariable,'.') + OR mb_strstr($CheckVariable,"\"") + OR mb_strstr($CheckVariable,'&') + OR mb_strstr($CheckVariable,"\\") + OR mb_strstr($CheckVariable,'"') + OR mb_strstr($CheckVariable,'>') + OR mb_strstr($CheckVariable,'<')){ return true; } else { Modified: trunk/install/save.php =================================================================== --- trunk/install/save.php 2011-07-08 10:28:14 UTC (rev 4626) +++ trunk/install/save.php 2011-07-08 10:30:40 UTC (rev 4627) @@ -348,7 +348,7 @@ $SQLScriptFile[$i] = trim($SQLScriptFile[$i]); //ignore lines that start with -- or USE or /* if (mb_substr($SQLScriptFile[$i], 0, 2) != '--' - AND strstr($SQLScriptFile[$i],'/*')==FALSE + AND mb_strstr($SQLScriptFile[$i],'/*')==FALSE AND mb_strlen($SQLScriptFile[$i])>1){ $SQL .= ' ' . $SQLScriptFile[$i]; This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <dai...@us...> - 2011-07-08 10:30:48
|
Revision: 4627 http://web-erp.svn.sourceforge.net/web-erp/?rev=4627&view=rev Author: daintree Date: 2011-07-08 10:30:40 +0000 (Fri, 08 Jul 2011) Log Message: ----------- various Modified Paths: -------------- trunk/CounterSales.php trunk/Currencies.php trunk/CustEDISetup.php trunk/CustLoginSetup.php trunk/CustomerBranches.php trunk/SelectOrderItems.php trunk/StockSerialItemResearch.php trunk/SuppLoginSetup.php trunk/SystemParameters.php trunk/UpgradeDatabase.php trunk/WWW_Users.php trunk/WorkCentres.php trunk/Z_ChangeBranchCode.php trunk/Z_ImportStocks.php trunk/Z_MakeNewCompany.php trunk/Z_Upgrade_3.04-3.05.php trunk/Z_Upgrade_3.05-3.06.php trunk/Z_Upgrade_3.07-3.08.php trunk/Z_Upgrade_3.08-3.09.php trunk/Z_Upgrade_3.09-3.10.php trunk/Z_Upgrade_3.10-3.11.php trunk/Z_Upgrade_3.11-4.00.php trunk/api/api_debtortransactions.php trunk/api/api_salesorders.php trunk/api/api_stock.php trunk/api/api_suppliers.php trunk/api/api_workorders.php trunk/doc/Change.log trunk/includes/MiscFunctions.php trunk/install/save.php Modified: trunk/CounterSales.php =================================================================== --- trunk/CounterSales.php 2011-07-08 10:28:14 UTC (rev 4626) +++ trunk/CounterSales.php 2011-07-08 10:30:40 UTC (rev 4627) @@ -35,7 +35,7 @@ if (isset($_POST['OrderItems'])){ foreach ($_POST as $key => $value) { - if (strstr($key,'itm')) { + if (mb_strstr($key,'itm')) { $NewItemArray[mb_substr($key,3)] = trim($value); } } Modified: trunk/Currencies.php =================================================================== --- trunk/Currencies.php 2011-07-08 10:28:14 UTC (rev 4626) +++ trunk/Currencies.php 2011-07-08 10:30:40 UTC (rev 4627) @@ -100,7 +100,7 @@ $InputError = 1; prnMsg(_('The functional currency cannot be modified or deleted'),'error'); } - if (strstr($_POST['Abbreviation'],"'") OR strstr($_POST['Abbreviation'],'+') OR strstr($_POST['Abbreviation'],"\"") OR strstr($_POST['Abbreviation'],'&') OR strstr($_POST['Abbreviation'],' ') OR strstr($_POST['Abbreviation'],"\\") OR strstr($_POST['Abbreviation'],'.') OR strstr($_POST['Abbreviation'],'"')) { + if (mb_strstr($_POST['Abbreviation'],"'") OR mb_strstr($_POST['Abbreviation'],'+') OR mb_strstr($_POST['Abbreviation'],"\"") OR mb_strstr($_POST['Abbreviation'],'&') OR mb_strstr($_POST['Abbreviation'],' ') OR mb_strstr($_POST['Abbreviation'],"\\") OR mb_strstr($_POST['Abbreviation'],'.') OR mb_strstr($_POST['Abbreviation'],'"')) { $InputError = 1; prnMsg( _('The currency code cannot contain any of the following characters') . " . - ' & + \" " . _('or a space'),'error'); $Errors[$i] = 'Abbreviation'; Modified: trunk/CustEDISetup.php =================================================================== --- trunk/CustEDISetup.php 2011-07-08 10:28:14 UTC (rev 4626) +++ trunk/CustEDISetup.php 2011-07-08 10:30:40 UTC (rev 4627) @@ -26,7 +26,7 @@ //first off validate inputs sensible if (ContainsIllegalCharacters($_POST['EDIReference']) - OR strstr($_POST['EDIReference'],' ')) { + OR mb_strstr($_POST['EDIReference'],' ')) { $InputError = 1; prnMsg(_('The customers EDI reference code cannot contain any of the following characters') .' - \' & + \" ' . _('or a space'),'warn'); } Modified: trunk/CustLoginSetup.php =================================================================== --- trunk/CustLoginSetup.php 2011-07-08 10:28:14 UTC (rev 4626) +++ trunk/CustLoginSetup.php 2011-07-08 10:30:40 UTC (rev 4627) @@ -40,7 +40,7 @@ if (mb_strlen($_POST['UserID'])<3){ $InputError = 1; prnMsg(_('The user ID entered must be at least 4 characters long'),'error'); - } elseif (ContainsIllegalCharacters($_POST['UserID']) OR strstr($_POST['UserID'],' ')) { + } elseif (ContainsIllegalCharacters($_POST['UserID']) OR mb_strstr($_POST['UserID'],' ')) { $InputError = 1; prnMsg(_('User names cannot contain any of the following characters') . " - ' & + \" \\ " . _('or a space'),'error'); } elseif (mb_strlen($_POST['Password'])<5){ @@ -48,7 +48,7 @@ $InputError = 1; prnMsg(_('The password entered must be at least 5 characters long'),'error'); } - } elseif (strstr($_POST['Password'],$_POST['UserID'])!= False){ + } elseif (mb_strstr($_POST['Password'],$_POST['UserID'])!= False){ $InputError = 1; prnMsg(_('The password cannot contain the user id'),'error'); } elseif ((mb_strlen($_POST['Cust'])>0) AND (mb_strlen($_POST['BranchCode'])==0)) { Modified: trunk/CustomerBranches.php =================================================================== --- trunk/CustomerBranches.php 2011-07-08 10:28:14 UTC (rev 4626) +++ trunk/CustomerBranches.php 2011-07-08 10:30:40 UTC (rev 4627) @@ -46,7 +46,7 @@ $_POST['BranchCode'] = mb_strtoupper($_POST['BranchCode']); - if (ContainsIllegalCharacters($_POST['BranchCode']) OR strstr($_POST['BranchCode'],' ')) { + if (ContainsIllegalCharacters($_POST['BranchCode']) OR mb_strstr($_POST['BranchCode'],' ')) { $InputError = 1; prnMsg(_('The Branch code cannot contain any of the following characters')." - & \'",'error'); $Errors[$i] = 'BranchCode'; Modified: trunk/SelectOrderItems.php =================================================================== --- trunk/SelectOrderItems.php 2011-07-08 10:28:14 UTC (rev 4626) +++ trunk/SelectOrderItems.php 2011-07-08 10:30:40 UTC (rev 4627) @@ -24,7 +24,7 @@ if (isset($_POST['order_items'])){ foreach ($_POST as $key => $value) { - if (strstr($key,'itm')) { + if (mb_strstr($key,'itm')) { $NewItem_array[mb_substr($key,3)] = trim($value); } } Modified: trunk/StockSerialItemResearch.php =================================================================== --- trunk/StockSerialItemResearch.php 2011-07-08 10:28:14 UTC (rev 4626) +++ trunk/StockSerialItemResearch.php 2011-07-08 10:30:40 UTC (rev 4627) @@ -38,8 +38,8 @@ if ($SN!='') { //the point here is to allow a semi fuzzy search, but still keep someone from killing the db server - if (strstr($SN,'%')){ - while(strstr($SN,'%%')) { + if (mb_strstr($SN,'%')){ + while(mb_strstr($SN,'%%')) { $SN = str_replace('%%','%',$SN); } if (mb_strlen($SN) < 11){ Modified: trunk/SuppLoginSetup.php =================================================================== --- trunk/SuppLoginSetup.php 2011-07-08 10:28:14 UTC (rev 4626) +++ trunk/SuppLoginSetup.php 2011-07-08 10:30:40 UTC (rev 4627) @@ -82,7 +82,7 @@ $InputError = 1; prnMsg(_('The password entered must be at least 5 characters long'),'error'); } - } elseif (strstr($_POST['Password'],$_POST['UserID'])!= False){ + } elseif (mb_strstr($_POST['Password'],$_POST['UserID'])!= False){ $InputError = 1; prnMsg(_('The password cannot contain the user id'),'error'); } Modified: trunk/SystemParameters.php =================================================================== --- trunk/SystemParameters.php 2011-07-08 10:28:14 UTC (rev 4626) +++ trunk/SystemParameters.php 2011-07-08 10:30:40 UTC (rev 4627) @@ -33,7 +33,7 @@ } elseif (mb_strlen($_POST['X_DefaultCreditLimit']) > 12 || !is_numeric($_POST['X_DefaultCreditLimit']) ) { $InputError = 1; prnMsg(_('Default Credit Limit must be a number'),'error'); - } elseif (strstr($_POST['X_RomalpaClause'], "'") || mb_strlen($_POST['X_RomalpaClause']) > 5000) { + } elseif (mb_strstr($_POST['X_RomalpaClause'], "'") || mb_strlen($_POST['X_RomalpaClause']) > 5000) { $InputError = 1; prnMsg(_('The Romalpa Clause may not contain single quotes and may not be longer than 5000 chars'),'error'); } elseif (mb_strlen($_POST['X_QuickEntries']) > 2 || !is_numeric($_POST['X_QuickEntries']) || Modified: trunk/UpgradeDatabase.php =================================================================== --- trunk/UpgradeDatabase.php 2011-07-08 10:28:14 UTC (rev 4626) +++ trunk/UpgradeDatabase.php 2011-07-08 10:30:40 UTC (rev 4627) @@ -146,7 +146,7 @@ if (mb_substr($SQLEntries[$i], 0, 2) != '--' AND mb_substr($SQLEntries[$i], 0, 3) != 'USE' - AND strstr($SQLEntries[$i],'/*')==FALSE + AND mb_strstr($SQLEntries[$i],'/*')==FALSE AND mb_strlen($SQLEntries[$i])>1){ $sql .= ' ' . $SQLEntries[$i]; Modified: trunk/WWW_Users.php =================================================================== --- trunk/WWW_Users.php 2011-07-08 10:28:14 UTC (rev 4626) +++ trunk/WWW_Users.php 2011-07-08 10:30:40 UTC (rev 4627) @@ -70,7 +70,7 @@ $InputError = 1; prnMsg(_('The password entered must be at least 5 characters long'),'error'); } - } elseif (strstr($_POST['Password'],$_POST['UserID'])!= False){ + } elseif (mb_strstr($_POST['Password'],$_POST['UserID'])!= False){ $InputError = 1; prnMsg(_('The password cannot contain the user id'),'error'); } elseif ((mb_strlen($_POST['Cust'])>0) AND (mb_strlen($_POST['BranchCode'])==0)) { Modified: trunk/WorkCentres.php =================================================================== --- trunk/WorkCentres.php 2011-07-08 10:28:14 UTC (rev 4626) +++ trunk/WorkCentres.php 2011-07-08 10:30:40 UTC (rev 4627) @@ -30,7 +30,7 @@ $InputError = 1; prnMsg(_('The Work Centre description must be at least 3 characters long'),'error'); } - if (strstr($_POST['Code'],' ') OR ContainsIllegalCharacters($_POST['Code']) ) { + if (mb_strstr($_POST['Code'],' ') OR ContainsIllegalCharacters($_POST['Code']) ) { $InputError = 1; prnMsg(_('The work centre code cannot contain any of the following characters') . " - ' & + \" \\ " . _('or a space'),'error'); } Modified: trunk/Z_ChangeBranchCode.php =================================================================== --- trunk/Z_ChangeBranchCode.php 2011-07-08 10:28:14 UTC (rev 4626) +++ trunk/Z_ChangeBranchCode.php 2011-07-08 10:30:40 UTC (rev 4627) @@ -26,7 +26,7 @@ include('includes/footer.inc'); exit; } - if (strstr($_POST['NewBranchCode'],".")>0 OR strstr($_POST['NewBranchCode'],"&") OR strstr($_POST['NewBranchCode'],"-") OR strstr($_POST['NewBranchCode']," ")){ + if (mb_strstr($_POST['NewBranchCode'],".")>0 OR mb_strstr($_POST['NewBranchCode'],"&") OR mb_strstr($_POST['NewBranchCode'],"-") OR mb_strstr($_POST['NewBranchCode']," ")){ prnMsg(_('The new customer branch code cannot contain') . ' - & . ' . _('or a space'),'error'); include('includes/footer.inc'); exit; Modified: trunk/Z_ImportStocks.php =================================================================== --- trunk/Z_ImportStocks.php 2011-07-08 10:28:14 UTC (rev 4626) +++ trunk/Z_ImportStocks.php 2011-07-08 10:30:40 UTC (rev 4627) @@ -120,7 +120,7 @@ $InputError = 1; prnMsg (_('The Stock Item code cannot be empty'),'error'); } - if (strstr($StockID,' ') OR strstr($StockID,"'") OR strstr($StockID,'+') OR strstr($StockID,"\\") OR strstr($StockID,"\"") OR strstr($StockID,'&') OR strstr($StockID,'"')) { + if (mb_strstr($StockID,' ') OR mb_strstr($StockID,"'") OR mb_strstr($StockID,'+') OR mb_strstr($StockID,"\\") OR mb_strstr($StockID,"\"") OR mb_strstr($StockID,'&') OR mb_strstr($StockID,'"')) { $InputError = 1; prnMsg(_('The stock item code cannot contain any of the following characters') . " ' & + \" \\ " . _('or a space'). " (". $StockID. ")",'error'); $StockID=''; Modified: trunk/Z_MakeNewCompany.php =================================================================== --- trunk/Z_MakeNewCompany.php 2011-07-08 10:28:14 UTC (rev 4626) +++ trunk/Z_MakeNewCompany.php 2011-07-08 10:30:40 UTC (rev 4627) @@ -105,7 +105,7 @@ if (mb_substr($SQLScriptFile[$i], 0, 2) != '--' AND mb_substr($SQLScriptFile[$i], 0, 3) != 'USE' - AND strstr($SQLScriptFile[$i],'/*')==FALSE + AND mb_strstr($SQLScriptFile[$i],'/*')==FALSE AND mb_strlen($SQLScriptFile[$i])>1){ $SQL .= ' ' . $SQLScriptFile[$i]; Modified: trunk/Z_Upgrade_3.04-3.05.php =================================================================== --- trunk/Z_Upgrade_3.04-3.05.php 2011-07-08 10:28:14 UTC (rev 4626) +++ trunk/Z_Upgrade_3.04-3.05.php 2011-07-08 10:30:40 UTC (rev 4627) @@ -36,7 +36,7 @@ if (mb_substr($SQLScriptFile[$i], 0, 2) != '--' AND mb_substr($SQLScriptFile[$i], 0, 3) != 'USE' - AND strstr($SQLScriptFile[$i],'/*')==FALSE + AND mb_strstr($SQLScriptFile[$i],'/*')==FALSE AND mb_strlen($SQLScriptFile[$i])>1){ $SQL .= ' ' . $SQLScriptFile[$i]; Modified: trunk/Z_Upgrade_3.05-3.06.php =================================================================== --- trunk/Z_Upgrade_3.05-3.06.php 2011-07-08 10:28:14 UTC (rev 4626) +++ trunk/Z_Upgrade_3.05-3.06.php 2011-07-08 10:30:40 UTC (rev 4627) @@ -28,7 +28,7 @@ if (mb_substr($SQLScriptFile[$i], 0, 2) != '--' AND mb_substr($SQLScriptFile[$i], 0, 3) != 'USE' - AND strstr($SQLScriptFile[$i],'/*')==FALSE + AND mb_strstr($SQLScriptFile[$i],'/*')==FALSE AND mb_strlen($SQLScriptFile[$i])>1){ $SQL .= ' ' . $SQLScriptFile[$i]; Modified: trunk/Z_Upgrade_3.07-3.08.php =================================================================== --- trunk/Z_Upgrade_3.07-3.08.php 2011-07-08 10:28:14 UTC (rev 4626) +++ trunk/Z_Upgrade_3.07-3.08.php 2011-07-08 10:30:40 UTC (rev 4627) @@ -28,7 +28,7 @@ if (mb_substr($SQLScriptFile[$i], 0, 2) != '--' AND mb_substr($SQLScriptFile[$i], 0, 3) != 'USE' - AND strstr($SQLScriptFile[$i],'/*')==FALSE + AND mb_strstr($SQLScriptFile[$i],'/*')==FALSE AND mb_strlen($SQLScriptFile[$i])>1){ $SQL .= ' ' . $SQLScriptFile[$i]; Modified: trunk/Z_Upgrade_3.08-3.09.php =================================================================== --- trunk/Z_Upgrade_3.08-3.09.php 2011-07-08 10:28:14 UTC (rev 4626) +++ trunk/Z_Upgrade_3.08-3.09.php 2011-07-08 10:30:40 UTC (rev 4627) @@ -28,7 +28,7 @@ if (mb_substr($SQLScriptFile[$i], 0, 2) != '--' AND mb_substr($SQLScriptFile[$i], 0, 3) != 'USE' - AND strstr($SQLScriptFile[$i],'/*')==FALSE + AND mb_strstr($SQLScriptFile[$i],'/*')==FALSE AND mb_strlen($SQLScriptFile[$i])>1){ $SQL .= ' ' . $SQLScriptFile[$i]; Modified: trunk/Z_Upgrade_3.09-3.10.php =================================================================== --- trunk/Z_Upgrade_3.09-3.10.php 2011-07-08 10:28:14 UTC (rev 4626) +++ trunk/Z_Upgrade_3.09-3.10.php 2011-07-08 10:30:40 UTC (rev 4627) @@ -28,7 +28,7 @@ if (mb_substr($SQLScriptFile[$i], 0, 2) != '--' AND mb_substr($SQLScriptFile[$i], 0, 3) != 'USE' - AND strstr($SQLScriptFile[$i],'/*')==FALSE + AND mb_strstr($SQLScriptFile[$i],'/*')==FALSE AND mb_strlen($SQLScriptFile[$i])>1){ $SQL .= ' ' . $SQLScriptFile[$i]; Modified: trunk/Z_Upgrade_3.10-3.11.php =================================================================== --- trunk/Z_Upgrade_3.10-3.11.php 2011-07-08 10:28:14 UTC (rev 4626) +++ trunk/Z_Upgrade_3.10-3.11.php 2011-07-08 10:30:40 UTC (rev 4627) @@ -38,7 +38,7 @@ if (mb_substr($SQLScriptFile[$i], 0, 2) != '--' AND mb_substr($SQLScriptFile[$i], 0, 3) != 'USE' - AND strstr($SQLScriptFile[$i],'/*')==FALSE + AND mb_strstr($SQLScriptFile[$i],'/*')==FALSE AND mb_strlen($SQLScriptFile[$i])>1){ $sql .= ' ' . $SQLScriptFile[$i]; Modified: trunk/Z_Upgrade_3.11-4.00.php =================================================================== --- trunk/Z_Upgrade_3.11-4.00.php 2011-07-08 10:28:14 UTC (rev 4626) +++ trunk/Z_Upgrade_3.11-4.00.php 2011-07-08 10:30:40 UTC (rev 4627) @@ -38,7 +38,7 @@ if (mb_substr($SQLScriptFile[$i], 0, 2) != '--' AND mb_substr($SQLScriptFile[$i], 0, 3) != 'USE' - AND strstr($SQLScriptFile[$i],'/*')==FALSE + AND mb_strstr($SQLScriptFile[$i],'/*')==FALSE AND mb_strlen($SQLScriptFile[$i])>1){ $sql .= ' ' . $SQLScriptFile[$i]; Modified: trunk/api/api_debtortransactions.php =================================================================== --- trunk/api/api_debtortransactions.php 2011-07-08 10:28:14 UTC (rev 4626) +++ trunk/api/api_debtortransactions.php 2011-07-08 10:30:40 UTC (rev 4627) @@ -87,9 +87,9 @@ $result=DB_query($sql, $db); $myrow=DB_fetch_array($result); $DateFormat=$myrow[0]; - if (strstr('/',$PeriodEnd)) { + if (mb_strstr('/',$PeriodEnd)) { $Date_Array = explode('/',$PeriodEnd); - } elseif (strstr('.',$PeriodEnd)) { + } elseif (mb_strstr('.',$PeriodEnd)) { $Date_Array = explode('.',$PeriodEnd); } if ($DateFormat=='d/m/Y') { Modified: trunk/api/api_salesorders.php =================================================================== --- trunk/api/api_salesorders.php 2011-07-08 10:28:14 UTC (rev 4626) +++ trunk/api/api_salesorders.php 2011-07-08 10:30:40 UTC (rev 4627) @@ -43,9 +43,9 @@ $result=api_DB_query($sql, $db); $myrow=DB_fetch_array($result); $DateFormat=$myrow[0]; - if (strstr($orddate,"/")) { + if (mb_strstr($orddate,"/")) { $DateArray = explode('/',$orddate); - } elseif (strstr($orddate,".")) { + } elseif (mb_strstr($orddate,".")) { $DateArray = explode('.',$orddate); } if ($DateFormat=='d/m/Y') { @@ -121,9 +121,9 @@ $result=api_DB_query($sql, $db); $myrow=DB_fetch_array($result); $DateFormat=$myrow[0]; - if (strstr($deliverydate,'/')) { + if (mb_strstr($deliverydate,'/')) { $DateArray = explode('/',$deliverydate); - } elseif (strstr($PeriodEnd,'.')) { + } elseif (mb_strstr($PeriodEnd,'.')) { $DateArray = explode('.',$deliverydate); } if ($DateFormat=='d/m/Y') { @@ -231,9 +231,9 @@ $result=api_DB_query($sql, $db); $myrow=DB_fetch_array($result); $DateFormat=$myrow[0]; - if (strstr($itemdue,'/')) { + if (mb_strstr($itemdue,'/')) { $DateArray = explode('/',$itemdue); - } elseif (strstr($itemdue,'.')) { + } elseif (mb_strstr($itemdue,'.')) { $DateArray = explode('.',$itemdue); } if ($DateFormat=='d/m/Y') { Modified: trunk/api/api_stock.php =================================================================== --- trunk/api/api_stock.php 2011-07-08 10:28:14 UTC (rev 4626) +++ trunk/api/api_stock.php 2011-07-08 10:30:40 UTC (rev 4627) @@ -79,9 +79,9 @@ $result=DB_query($sql, $db); $myrow=DB_fetch_array($result); $DateFormat=$myrow[0]; - if (strstr('/',$PeriodEnd)) { + if (mb_strstr('/',$PeriodEnd)) { $Date_Array = explode('/',$PeriodEnd); - } elseif (strstr('.',$PeriodEnd)) { + } elseif (mb_strstr('.',$PeriodEnd)) { $Date_Array = explode('.',$PeriodEnd); } if ($DateFormat=='d/m/Y') { Modified: trunk/api/api_suppliers.php =================================================================== --- trunk/api/api_suppliers.php 2011-07-08 10:28:14 UTC (rev 4626) +++ trunk/api/api_suppliers.php 2011-07-08 10:30:40 UTC (rev 4627) @@ -51,9 +51,9 @@ $result=DB_query($sql, $db); $myrow=DB_fetch_array($result); $DateFormat=$myrow[0]; - if (strstr('/',$PeriodEnd)) { + if (mb_strstr('/',$PeriodEnd)) { $Date_Array = explode('/',$PeriodEnd); - } elseif (strstr('.',$PeriodEnd)) { + } elseif (mb_strstr('.',$PeriodEnd)) { $Date_Array = explode('.',$PeriodEnd); } if ($DateFormat=='d/m/Y') { Modified: trunk/api/api_workorders.php =================================================================== --- trunk/api/api_workorders.php 2011-07-08 10:28:14 UTC (rev 4626) +++ trunk/api/api_workorders.php 2011-07-08 10:30:40 UTC (rev 4627) @@ -48,9 +48,9 @@ $result=DB_query($sql, $db); $myrow=DB_fetch_array($result); $DateFormat=$myrow[0]; - if (strstr('/',$PeriodEnd)) { + if (mb_strstr('/',$PeriodEnd)) { $Date_Array = explode('/',$PeriodEnd); - } elseif (strstr('.',$PeriodEnd)) { + } elseif (mb_strstr('.',$PeriodEnd)) { $Date_Array = explode('.',$PeriodEnd); } if ($DateFormat=='d/m/Y') { @@ -81,9 +81,9 @@ $result=DB_query($sql, $db); $myrow=DB_fetch_array($result); $DateFormat=$myrow[0]; - if (strstr('/',$PeriodEnd)) { + if (mb_strstr('/',$PeriodEnd)) { $Date_Array = explode('/',$PeriodEnd); - } elseif (strstr('.',$PeriodEnd)) { + } elseif (mb_strstr('.',$PeriodEnd)) { $Date_Array = explode('.',$PeriodEnd); } if ($DateFormat=='d/m/Y') { Modified: trunk/doc/Change.log =================================================================== --- trunk/doc/Change.log 2011-07-08 10:28:14 UTC (rev 4626) +++ trunk/doc/Change.log 2011-07-08 10:30:40 UTC (rev 4627) @@ -1,5 +1,6 @@ webERP Change Log +8/7/11 Phil: Change all strstr occurrences to use multi-byte function mb_strstr 8/7/11 Phil: Trap codes with decimal point "." in them in the IllegalCharacters function 8/7/11 Phil: Fix discount matrix calculations on order entry and amendment 5/7/11 Phil: Amend menu to use PDFStockLocTransfer.php to reprint transfer list - as reported by Ron Wong Modified: trunk/includes/MiscFunctions.php =================================================================== --- trunk/includes/MiscFunctions.php 2011-07-08 10:28:14 UTC (rev 4626) +++ trunk/includes/MiscFunctions.php 2011-07-08 10:30:40 UTC (rev 4627) @@ -109,16 +109,16 @@ function ContainsIllegalCharacters ($CheckVariable) { - if (strstr($CheckVariable,"'") - OR strstr($CheckVariable,'+') - OR strstr($CheckVariable,'?') - OR strstr($CheckVariable,'.') - OR strstr($CheckVariable,"\"") - OR strstr($CheckVariable,'&') - OR strstr($CheckVariable,"\\") - OR strstr($CheckVariable,'"') - OR strstr($CheckVariable,'>') - OR strstr($CheckVariable,'<')){ + if (mb_strstr($CheckVariable,"'") + OR mb_strstr($CheckVariable,'+') + OR mb_strstr($CheckVariable,'?') + OR mb_strstr($CheckVariable,'.') + OR mb_strstr($CheckVariable,"\"") + OR mb_strstr($CheckVariable,'&') + OR mb_strstr($CheckVariable,"\\") + OR mb_strstr($CheckVariable,'"') + OR mb_strstr($CheckVariable,'>') + OR mb_strstr($CheckVariable,'<')){ return true; } else { Modified: trunk/install/save.php =================================================================== --- trunk/install/save.php 2011-07-08 10:28:14 UTC (rev 4626) +++ trunk/install/save.php 2011-07-08 10:30:40 UTC (rev 4627) @@ -348,7 +348,7 @@ $SQLScriptFile[$i] = trim($SQLScriptFile[$i]); //ignore lines that start with -- or USE or /* if (mb_substr($SQLScriptFile[$i], 0, 2) != '--' - AND strstr($SQLScriptFile[$i],'/*')==FALSE + AND mb_strstr($SQLScriptFile[$i],'/*')==FALSE AND mb_strlen($SQLScriptFile[$i])>1){ $SQL .= ' ' . $SQLScriptFile[$i]; This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <dai...@us...> - 2011-07-08 10:28:21
|
Revision: 4626 http://web-erp.svn.sourceforge.net/web-erp/?rev=4626&view=rev Author: daintree Date: 2011-07-08 10:28:14 +0000 (Fri, 08 Jul 2011) Log Message: ----------- various Modified Paths: -------------- trunk/PO_Items.php trunk/SelectOrderItems.php trunk/doc/Change.log trunk/includes/MiscFunctions.php trunk/includes/SelectOrderItems_IntoCart.inc Modified: trunk/PO_Items.php =================================================================== --- trunk/PO_Items.php 2011-07-06 09:30:42 UTC (rev 4625) +++ trunk/PO_Items.php 2011-07-08 10:28:14 UTC (rev 4626) @@ -159,39 +159,38 @@ deliverydate, paymentterms, allowprint) - VALUES( '" . $_SESSION['PO'.$identifier]->OrderNo . "', - '" . $_SESSION['PO'.$identifier]->SupplierID . "', - '" . $_SESSION['PO'.$identifier]->Comments . "', - '" . Date('Y-m-d') . "', - '" . $_SESSION['PO'.$identifier]->ExRate . "', - '" . $_SESSION['PO'.$identifier]->Initiator . "', - '" . $_SESSION['PO'.$identifier]->RequisitionNo . "', - '" . $_SESSION['PO'.$identifier]->Location . "', - '" . $_SESSION['PO'.$identifier]->DelAdd1 . "', - '" . $_SESSION['PO'.$identifier]->DelAdd2 . "', - '" . $_SESSION['PO'.$identifier]->DelAdd3 . "', - '" . $_SESSION['PO'.$identifier]->DelAdd4 . "', - '" . $_SESSION['PO'.$identifier]->DelAdd5 . "', - '" . $_SESSION['PO'.$identifier]->DelAdd6 . "', - '" . $_SESSION['PO'.$identifier]->Tel . "', - '" . $_SESSION['PO'.$identifier]->SuppDelAdd1 . "', - '" . $_SESSION['PO'.$identifier]->SuppDelAdd2 . "', - '" . $_SESSION['PO'.$identifier]->SuppDelAdd3 . "', - '" . $_SESSION['PO'.$identifier]->SuppDelAdd4 . "', - '" . $_SESSION['PO'.$identifier]->SuppDelAdd5 . "', - '" . $_SESSION['PO'.$identifier]->SuppDelAdd6 . "', - '" . $_SESSION['PO'.$identifier]->SupplierContact . "', - '" . $_SESSION['PO'.$identifier]->SuppTel. "', - '" . $_SESSION['PO'.$identifier]->Contact . "', - '" . $_SESSION['PO'.$identifier]->Version . "', - '" . Date('Y-m-d') . "', - '" . $_SESSION['PO'.$identifier]->DeliveryBy . "', - '" . $_SESSION['PO'.$identifier]->Status . "', - '" . $StatusComment . "', - '" . FormatDateForSQL($_SESSION['PO'.$identifier]->DeliveryDate) . "', - '" . $_SESSION['PO'.$identifier]->PaymentTerms. "', - '" . $_SESSION['PO'.$identifier]->AllowPrintPO . "' - )"; + VALUES( '" . $_SESSION['PO'.$identifier]->OrderNo . "', + '" . $_SESSION['PO'.$identifier]->SupplierID . "', + '" . $_SESSION['PO'.$identifier]->Comments . "', + '" . Date('Y-m-d') . "', + '" . $_SESSION['PO'.$identifier]->ExRate . "', + '" . $_SESSION['PO'.$identifier]->Initiator . "', + '" . $_SESSION['PO'.$identifier]->RequisitionNo . "', + '" . $_SESSION['PO'.$identifier]->Location . "', + '" . $_SESSION['PO'.$identifier]->DelAdd1 . "', + '" . $_SESSION['PO'.$identifier]->DelAdd2 . "', + '" . $_SESSION['PO'.$identifier]->DelAdd3 . "', + '" . $_SESSION['PO'.$identifier]->DelAdd4 . "', + '" . $_SESSION['PO'.$identifier]->DelAdd5 . "', + '" . $_SESSION['PO'.$identifier]->DelAdd6 . "', + '" . $_SESSION['PO'.$identifier]->Tel . "', + '" . $_SESSION['PO'.$identifier]->SuppDelAdd1 . "', + '" . $_SESSION['PO'.$identifier]->SuppDelAdd2 . "', + '" . $_SESSION['PO'.$identifier]->SuppDelAdd3 . "', + '" . $_SESSION['PO'.$identifier]->SuppDelAdd4 . "', + '" . $_SESSION['PO'.$identifier]->SuppDelAdd5 . "', + '" . $_SESSION['PO'.$identifier]->SuppDelAdd6 . "', + '" . $_SESSION['PO'.$identifier]->SupplierContact . "', + '" . $_SESSION['PO'.$identifier]->SuppTel. "', + '" . $_SESSION['PO'.$identifier]->Contact . "', + '" . $_SESSION['PO'.$identifier]->Version . "', + '" . Date('Y-m-d') . "', + '" . $_SESSION['PO'.$identifier]->DeliveryBy . "', + '" . $_SESSION['PO'.$identifier]->Status . "', + '" . $StatusComment . "', + '" . FormatDateForSQL($_SESSION['PO'.$identifier]->DeliveryDate) . "', + '" . $_SESSION['PO'.$identifier]->PaymentTerms. "', + '" . $_SESSION['PO'.$identifier]->AllowPrintPO . "' )"; $ErrMsg = _('The purchase order header record could not be inserted into the database because'); $DbgMsg = _('The SQL statement used to insert the purchase order header record and failed was'); @@ -213,20 +212,19 @@ suppliers_partno, assetid, conversionfactor ) - VALUES ( - '" . $_SESSION['PO'.$identifier]->OrderNo . "', - '" . $POLine->StockID . "', - '" . FormatDateForSQL($POLine->ReqDelDate) . "', - '" . $POLine->ItemDescription . "', - '" . $POLine->GLCode . "', - '" . $POLine->Price . "', - '" . $POLine->Quantity . "', - '" . $POLine->ShiptRef . "', - '" . $POLine->JobRef . "', - '" . $POLine->SuppliersUnit . "', - '" . $POLine->Suppliers_PartNo . "', - '" . $POLine->AssetID . "', - '" . $POLine->ConversionFactor . "')"; + VALUES ('" . $_SESSION['PO'.$identifier]->OrderNo . "', + '" . $POLine->StockID . "', + '" . FormatDateForSQL($POLine->ReqDelDate) . "', + '" . $POLine->ItemDescription . "', + '" . $POLine->GLCode . "', + '" . $POLine->Price . "', + '" . $POLine->Quantity . "', + '" . $POLine->ShiptRef . "', + '" . $POLine->JobRef . "', + '" . $POLine->SuppliersUnit . "', + '" . $POLine->Suppliers_PartNo . "', + '" . $POLine->AssetID . "', + '" . $POLine->ConversionFactor . "')"; $ErrMsg =_('One of the purchase order detail records could not be inserted into the database because'); $DbgMsg =_('The SQL statement used to insert the purchase order detail record and failed was'); @@ -386,7 +384,7 @@ if (isset($_POST['EnterLine'])){ /*Inputs from the form directly without selecting a stock item from the search */ $AllowUpdate = true; /*always assume the best */ - if (!is_numeric(doubleval(str_replace($locale_info['thousands_sep'],'',$_POST['Qty'])))){ + if (!is_numeric($_POST['Qty'])){ $AllowUpdate = false; prnMsg( _('Cannot Enter this order line') . '<br />' . _('The quantity of the order item must be numeric'),'error'); } @@ -394,7 +392,7 @@ $AllowUpdate = false; prnMsg( _('Cannot Enter this order line') . '<br />' . _('The quantity of the ordered item entered must be a positive amount'),'error'); } - if (!is_numeric(doubleval(str_replace($locale_info['thousands_sep'],'',$_POST['Price'])))){ + if (!is_numeric($_POST['Price'])){ $AllowUpdate = false; prnMsg( _('Cannot Enter this order line') . '<br />' . _('The price entered must be numeric'),'error'); } @@ -465,8 +463,6 @@ if ($AllowUpdate == true){ //adding the non-stock item - $_POST['Price'] = doubleval(str_replace($locale_info['thousands_sep'],'',$_POST['Price'])); - $_POST['Qty'] = doubleval(str_replace($locale_info['thousands_sep'],'',$_POST['Qty'])); $_SESSION['PO'.$identifier]->add_to_order ($_SESSION['PO'.$identifier]->LinesOnOrder+1, '', @@ -505,10 +501,10 @@ foreach ($_POST as $FormVariableName => $Quantity) { if (mb_substr($FormVariableName, 0, 6)=='NewQty') { //if the form variable represents a Qty to add to the order - + $ItemCode = mb_substr($FormVariableName, 6, mb_strlen($FormVariableName)-6); $AlreadyOnThisOrder = 0; - + if ($_SESSION['PO_AllowSameItemMultipleTimes'] ==false){ if (count($_SESSION['PO'.$identifier]->LineItems)!=0){ @@ -530,11 +526,11 @@ decimalplaces, stockact, accountname - FROM stockmaster INNER JOIN stockcategory - ON stockcategory.categoryid = stockmaster.categoryid - INNER JOIN chartmaster - ON chartmaster.accountcode = stockcategory.stockact - WHERE stockmaster.stockid = '". $ItemCode . "'"; + FROM stockmaster INNER JOIN stockcategory + ON stockcategory.categoryid = stockmaster.categoryid + INNER JOIN chartmaster + ON chartmaster.accountcode = stockcategory.stockact + WHERE stockmaster.stockid = '". $ItemCode . "'"; $ErrMsg = _('The item details for') . ' ' . $ItemCode . ' ' . _('could not be retrieved because'); $DbgMsg = _('The SQL used to retrieve the item details but failed was'); @@ -661,9 +657,9 @@ // Note if the price is greater than 1 use 2 decimal place, if the price is a fraction of 1, use 4 decimal places // This should help display where item-price is a fraction if ($POLine->Price > 1) { - $DisplayPrice = number_format($POLine->Price,$_SESSION['PO'.$identifier]->CurrDecimalPlaces,'.',''); + $DisplayPrice = number_format($POLine->Price,$_SESSION['PO'.$identifier]->CurrDecimalPlaces); } else { - $DisplayPrice = number_format($POLine->Price,4,'.',''); + $DisplayPrice = number_format($POLine->Price,4); } if ($k==1){ @@ -705,7 +701,7 @@ echo '<br /><table class="selection"><tr> <td>' . _('Item Description') . '</td>'; - echo '<td><input type=text name=ItemDescription size=40></td></tr>'; + echo '<td><input type="text" name="ItemDescription" size="40" /></td></tr>'; echo '<tr><td>' . _('General Ledger Code') . '</td>'; echo '<td><select name="GLCode">'; $sql="SELECT accountcode, @@ -759,29 +755,29 @@ $sql = "SELECT stockmaster.stockid, stockmaster.description, stockmaster.units - FROM stockmaster INNER JOIN stockcategory - ON stockmaster.categoryid=stockcategory.categoryid - WHERE stockmaster.mbflag<>'D' - AND stockmaster.mbflag<>'K' - AND stockmaster.mbflag<>'G' - AND stockmaster.discontinued<>1 - AND stockmaster.description " . LIKE . " '" . $SearchString ."' - ORDER BY stockmaster.stockid - LIMIT " .$_SESSION['DefaultDisplayRecordsMax']; + FROM stockmaster INNER JOIN stockcategory + ON stockmaster.categoryid=stockcategory.categoryid + WHERE stockmaster.mbflag<>'D' + AND stockmaster.mbflag<>'K' + AND stockmaster.mbflag<>'G' + AND stockmaster.discontinued<>1 + AND stockmaster.description " . LIKE . " '" . $SearchString ."' + ORDER BY stockmaster.stockid + LIMIT " .$_SESSION['DefaultDisplayRecordsMax']; } else { $sql = "SELECT stockmaster.stockid, stockmaster.description, stockmaster.units - FROM stockmaster INNER JOIN stockcategory - ON stockmaster.categoryid=stockcategory.categoryid - WHERE stockmaster.mbflag<>'D' - AND stockmaster.mbflag<>'K' - AND stockmaster.mbflag<>'G' - AND stockmaster.discontinued<>1 - AND stockmaster.description " . LIKE . " '". $SearchString ."' - AND stockmaster.categoryid='" . $_POST['StockCat'] . "' - ORDER BY stockmaster.stockid - LIMIT ".$_SESSION['DefaultDisplayRecordsMax']; + FROM stockmaster INNER JOIN stockcategory + ON stockmaster.categoryid=stockcategory.categoryid + WHERE stockmaster.mbflag<>'D' + AND stockmaster.mbflag<>'K' + AND stockmaster.mbflag<>'G' + AND stockmaster.discontinued<>1 + AND stockmaster.description " . LIKE . " '". $SearchString ."' + AND stockmaster.categoryid='" . $_POST['StockCat'] . "' + ORDER BY stockmaster.stockid + LIMIT ".$_SESSION['DefaultDisplayRecordsMax']; } } elseif ($_POST['StockCode']){ @@ -792,29 +788,29 @@ $sql = "SELECT stockmaster.stockid, stockmaster.description, stockmaster.units - FROM stockmaster INNER JOIN stockcategory - ON stockmaster.categoryid=stockcategory.categoryid - WHERE stockmaster.mbflag<>'D' - AND stockmaster.mbflag<>'K' - AND stockmaster.mbflag<>'G' - AND stockmaster.discontinued<>1 - AND stockmaster.stockid " . LIKE . " '" . $_POST['StockCode'] . "' - ORDER BY stockmaster.stockid - LIMIT ".$_SESSION['DefaultDisplayRecordsMax']; + FROM stockmaster INNER JOIN stockcategory + ON stockmaster.categoryid=stockcategory.categoryid + WHERE stockmaster.mbflag<>'D' + AND stockmaster.mbflag<>'K' + AND stockmaster.mbflag<>'G' + AND stockmaster.discontinued<>1 + AND stockmaster.stockid " . LIKE . " '" . $_POST['StockCode'] . "' + ORDER BY stockmaster.stockid + LIMIT ".$_SESSION['DefaultDisplayRecordsMax']; } else { $sql = "SELECT stockmaster.stockid, stockmaster.description, stockmaster.units - FROM stockmaster INNER JOIN stockcategory - ON stockmaster.categoryid=stockcategory.categoryid - WHERE stockmaster.mbflag<>'D' - AND stockmaster.mbflag<>'K' - AND stockmaster.mbflag<>'G' - and stockmaster.discontinued<>1 - AND stockmaster.stockid " . LIKE . " '" . $_POST['StockCode'] . "' - AND stockmaster.categoryid='" . $_POST['StockCat'] . "' - ORDER BY stockmaster.stockid - LIMIT ".$_SESSION['DefaultDisplayRecordsMax']; + FROM stockmaster INNER JOIN stockcategory + ON stockmaster.categoryid=stockcategory.categoryid + WHERE stockmaster.mbflag<>'D' + AND stockmaster.mbflag<>'K' + AND stockmaster.mbflag<>'G' + and stockmaster.discontinued<>1 + AND stockmaster.stockid " . LIKE . " '" . $_POST['StockCode'] . "' + AND stockmaster.categoryid='" . $_POST['StockCat'] . "' + ORDER BY stockmaster.stockid + LIMIT ".$_SESSION['DefaultDisplayRecordsMax']; } } else { @@ -822,27 +818,27 @@ $sql = "SELECT stockmaster.stockid, stockmaster.description, stockmaster.units - FROM stockmaster INNER JOIN stockcategory - ON stockmaster.categoryid=stockcategory.categoryid - WHERE stockmaster.mbflag<>'D' - AND stockmaster.mbflag<>'K' - AND stockmaster.mbflag<>'G' - AND stockmaster.discontinued<>1 - ORDER BY stockmaster.stockid - LIMIT " . $_SESSION['DefaultDisplayRecordsMax']; + FROM stockmaster INNER JOIN stockcategory + ON stockmaster.categoryid=stockcategory.categoryid + WHERE stockmaster.mbflag<>'D' + AND stockmaster.mbflag<>'K' + AND stockmaster.mbflag<>'G' + AND stockmaster.discontinued<>1 + ORDER BY stockmaster.stockid + LIMIT " . $_SESSION['DefaultDisplayRecordsMax']; } else { $sql = "SELECT stockmaster.stockid, stockmaster.description, stockmaster.units - FROM stockmaster INNER JOIN stockcategory - ON stockmaster.categoryid=stockcategory.categoryid - WHERE stockmaster.mbflag<>'D' - AND stockmaster.mbflag<>'K' - AND stockmaster.mbflag<>'G' - AND stockmaster.discontinued<>1 - AND stockmaster.categoryid='" . $_POST['StockCat'] . "' - ORDER BY stockmaster.stockid - LIMIT " . $_SESSION['DefaultDisplayRecordsMax']; + FROM stockmaster INNER JOIN stockcategory + ON stockmaster.categoryid=stockcategory.categoryid + WHERE stockmaster.mbflag<>'D' + AND stockmaster.mbflag<>'K' + AND stockmaster.mbflag<>'G' + AND stockmaster.discontinued<>1 + AND stockmaster.categoryid='" . $_POST['StockCat'] . "' + ORDER BY stockmaster.stockid + LIMIT " . $_SESSION['DefaultDisplayRecordsMax']; } } @@ -865,10 +861,10 @@ if (!isset($_GET['Edit'])) { $sql="SELECT categoryid, categorydescription - FROM stockcategory - WHERE stocktype<>'L' - AND stocktype<>'D' - ORDER BY categorydescription"; + FROM stockcategory + WHERE stocktype<>'L' + AND stocktype<>'D' + ORDER BY categorydescription"; $ErrMsg = _('The supplier category details could not be retrieved because'); $DbgMsg = _('The SQL used to retrieve the category details but failed was'); $result1 = DB_query($sql,$db,$ErrMsg,$DbgMsg); @@ -926,13 +922,13 @@ echo '<table cellpadding="1" colspan="7" class="selection">'; $TableHeader = '<tr> - <th>' . _('Code') . '</th> - <th>' . _('Description') . '</th> - <th>' . _('Our Units') . '</th> - <th>' . _('Conversion') . '<br />' ._('Factor') . '</th> - <th>' . _('Supplier/Order') . '<br />' . _('Units') . '</th> - <th colspan=2><a href="#end">'._('Go to end of list').'</a></th> - </tr>'; + <th>' . _('Code') . '</th> + <th>' . _('Description') . '</th> + <th>' . _('Our Units') . '</th> + <th>' . _('Conversion') . '<br />' ._('Factor') . '</th> + <th>' . _('Supplier/Order') . '<br />' . _('Units') . '</th> + <th colspan=2><a href="#end">'._('Go to end of list').'</a></th> + </tr>'; echo $TableHeader; $j = 1; Modified: trunk/SelectOrderItems.php =================================================================== --- trunk/SelectOrderItems.php 2011-07-06 09:30:42 UTC (rev 4625) +++ trunk/SelectOrderItems.php 2011-07-08 10:28:14 UTC (rev 4626) @@ -897,6 +897,7 @@ $ExRate = 1; } + /*Process Quick Entry */ /* If enter is pressed on the quick entry screen, the default button may be Recalculate */ if (isset($_POST['order_items']) @@ -906,8 +907,8 @@ /* get the item details from the database and hold them in the cart object */ /*Discount can only be set later on -- after quick entry -- so default discount to 0 in the first place */ - $Discount = 0; - + $Discount = 0; + $AlreadyWarnedAboutCredit = false; $i=1; while ($i<=$_SESSION['QuickEntries'] and isset($_POST['part_' . $i]) and $_POST['part_' . $i]!='') { $QuickEntryCode = 'part_' . $i; @@ -1053,14 +1054,14 @@ taxcatid, materialcost) VALUES ('" . $AssetStockID . "', - '" . $AssetRow['description'] . "', - '" . $AssetRow['longdescription'] . "', - 'ASSETS', - 'D', - '0', - '0', - '" . $_SESSION['DefaultTaxCategory'] . "', - '". $NBV . "')" , $db); + '" . $AssetRow['description'] . "', + '" . $AssetRow['longdescription'] . "', + 'ASSETS', + 'D', + '0', + '0', + '" . $_SESSION['DefaultTaxCategory'] . "', + '". $NBV . "')" , $db); /*not forgetting the location records too */ $InsertStkLocRecsResult = DB_query("INSERT INTO locstock (loccode, stockid) @@ -1091,7 +1092,9 @@ $_SESSION['Items'.$identifier]->LineItems[$_GET['Delete']]->Quantity = $QuantityAlreadyDelivered; } } - + + $AlreadyWarnedAboutCredit = false; + foreach ($_SESSION['Items'.$identifier]->LineItems as $OrderLine) { if (isset($_POST['Quantity_' . $OrderLine->LineNumber])){ @@ -1142,18 +1145,20 @@ $WithinCreditLimit = true; - if ($_SESSION['CheckCreditLimits'] > 0){ /*Check credit limits is 1 for warn - and 2 for prohibit sales */ + if ($_SESSION['CheckCreditLimits'] > 0 AND $AlreadyWarnedAboutCredit==false){ /*Check credit limits is 1 for warn + breach their credit limit and 2 for prohibit sales */ $DifferenceInOrderValue = ($Quantity*$Price*(1-$DiscountPercentage/100)) - ($OrderLine->Quantity*$OrderLine->Price*(1-$OrderLine->DiscountPercentage)); $_SESSION['Items'.$identifier]->CreditAvailable -= $DifferenceInOrderValue; if ($_SESSION['CheckCreditLimits']==1 AND $_SESSION['Items'.$identifier]->CreditAvailable <=0){ prnMsg(_('The customer account will breach their credit limit'),'warn'); + $AlreadyWarnedAboutCredit = true; } elseif ($_SESSION['CheckCreditLimits']==2 AND $_SESSION['Items'.$identifier]->CreditAvailable <=0){ prnMsg(_('This change would put the customer over their credit limit and is prohibited'),'warn'); $WithinCreditLimit = false; $_SESSION['Items'.$identifier]->CreditAvailable += $DifferenceInOrderValue; + $AlreadyWarnedAboutCredit = true; } } @@ -1170,8 +1175,39 @@ } //within credit limit so make changes } //there are changes to the order line to process } //page not called from itself - POST variables not set - } - } + } // Loop around all items on the order + + + /* Now Run through each line of the order again to work out the appropriate discount from the discount matrix */ + $DiscCatsDone = array(); + foreach ($_SESSION['Items'.$identifier]->LineItems as $OrderLine) { + + if ($OrderLine->DiscCat !='' AND ! in_array($OrderLine->DiscCat,$DiscCatsDone)){ + $DiscCatsDone[]=$OrderLine->DiscCat; + $QuantityOfDiscCat = 0; + + foreach ($_SESSION['Items'.$identifier]->LineItems as $OrderLine_2) { + /* add up total quantity of all lines of this DiscCat */ + if ($OrderLine_2->DiscCat==$OrderLine->DiscCat){ + $QuantityOfDiscCat += $OrderLine_2->Quantity; + } + } + $result = DB_query("SELECT MAX(discountrate) AS discount + FROM discountmatrix + WHERE salestype='" . $_SESSION['Items'.$identifier]->DefaultSalesType . "' + AND discountcategory ='" . $OrderLine->DiscCat . "' + AND quantitybreak <" . $QuantityOfDiscCat,$db); + $myrow = DB_fetch_row($result); + if ($myrow[0]!=0){ /* need to update the lines affected */ + foreach ($_SESSION['Items'.$identifier]->LineItems as $OrderLine_2) { + if ($OrderLine_2->DiscCat==$OrderLine->DiscCat){ + $_SESSION['Items'.$identifier]->LineItems[$OrderLine_2->LineNumber]->DiscountPercent = $myrow[0]; + } + } + }//a none zero discount percentage was returned + } + } /* end of discount matrix lookup code */ + } // the order session is started or there is a new item being added if (isset($_POST['DeliveryDetails'])){ echo '<meta http-equiv="Refresh" content="0; url=' . $rootpath . '/DeliveryDetails.php?' . SID .'identifier='.$identifier . '">'; prnMsg(_('You should automatically be forwarded to the entry of the delivery details page') . '. ' . _('if this does not happen') . ' (' . _('if the browser does not support META Refresh') . ') ' . @@ -1229,6 +1265,7 @@ if (isset($NewItem_array) AND isset($_POST['order_items'])){ /* get the item details from the database and hold them in the cart object make the quantity 1 by default then add it to the cart */ /*Now figure out if the item is a kit set - the field MBFlag='K'*/ + $AlreadyWarnedAboutCredit = false; foreach($NewItem_array as $NewItem => $NewItemQty) { if($NewItemQty > 0) { $sql = "SELECT stockmaster.mbflag @@ -1245,11 +1282,11 @@ if ($myrow=DB_fetch_array($KitResult)){ if ($myrow['mbflag']=='K'){ /*It is a kit set item */ $sql = "SELECT bom.component, - bom.quantity - FROM bom - WHERE bom.parent='" . $NewItem . "' - AND bom.effectiveto > '" . Date('Y-m-d') . "' - AND bom.effectiveafter < '" . Date('Y-m-d') . "'"; + bom.quantity + FROM bom + WHERE bom.parent='" . $NewItem . "' + AND bom.effectiveto > '" . Date('Y-m-d') . "' + AND bom.effectiveafter < '" . Date('Y-m-d') . "'"; $ErrMsg = _('Could not retrieve kitset components from the database because'); $KitResult = DB_query($sql,$db,$ErrMsg); @@ -1300,8 +1337,7 @@ $myrow = DB_fetch_row($result); if ($myrow[0]!=0){ /* need to update the lines affected */ foreach ($_SESSION['Items'.$identifier]->LineItems as $StkItems_2) { - /* add up total quantity of all lines of this DiscCat */ - if ($StkItems_2->DiscCat==$OrderLine->DiscCat AND $StkItems_2->DiscountPercent == 0){ + if ($StkItems_2->DiscCat==$OrderLine->DiscCat){ $_SESSION['Items'.$identifier]->LineItems[$StkItems_2->LineNumber]->DiscountPercent = $myrow[0]; } } @@ -1415,12 +1451,13 @@ $DisplayTotal = number_format($_SESSION['Items'.$identifier]->total,$_SESSION['Items'.$identifier]->CurrDecimalPlaces); if (in_array(2,$_SESSION['AllowedPageSecurityTokens'])){ - $ColSpanNumber = 3; + $ColSpanNumber = 2; } else { $ColSpanNumber = 1; } - echo '<tr class="EvenTableRows"><td class="number" colspan=7><b>' . _('TOTAL Excl Tax/Freight') . '</b></td> - <td colspan="' . $ColSpanNumber . '" class=number>' . $DisplayTotal . '</td></tr></table>'; + echo '<tr class="EvenTableRows"> + <td class="number" colspan=7><b>' . _('TOTAL Excl Tax/Freight') . '</b></td> + <td colspan="' . $ColSpanNumber . '" class=number>' . $DisplayTotal . '</td></tr></table>'; $DisplayVolume = number_format($_SESSION['Items'.$identifier]->totalVolume,2); $DisplayWeight = number_format($_SESSION['Items'.$identifier]->totalWeight,2); @@ -1431,8 +1468,10 @@ </tr></table>'; - echo '<br /><div class="centre"><input type=submit name="Recalculate" Value="' . _('Re-Calculate') . '"> - <input type=submit name="DeliveryDetails" value="' . _('Enter Delivery Details and Confirm Order') . '"></div><hr>'; + echo '<br /> + <div class="centre"> + <input type="submit" name="Recalculate" value="' . _('Re-Calculate') . '"> + <input type="submit" name="DeliveryDetails" value="' . _('Enter Delivery Details and Confirm Order') . '"></div><hr />'; } # end of if lines /* Now show the stock item selection search stuff below */ Modified: trunk/doc/Change.log =================================================================== --- trunk/doc/Change.log 2011-07-06 09:30:42 UTC (rev 4625) +++ trunk/doc/Change.log 2011-07-08 10:28:14 UTC (rev 4626) @@ -1,5 +1,7 @@ webERP Change Log +8/7/11 Phil: Trap codes with decimal point "." in them in the IllegalCharacters function +8/7/11 Phil: Fix discount matrix calculations on order entry and amendment 5/7/11 Phil: Amend menu to use PDFStockLocTransfer.php to reprint transfer list - as reported by Ron Wong 3/7/11 Phil: changed all strpos to mb_strpos 3/7/11 Phil: changed all strtoupper to mb_strtoupper Modified: trunk/includes/MiscFunctions.php =================================================================== --- trunk/includes/MiscFunctions.php 2011-07-06 09:30:42 UTC (rev 4625) +++ trunk/includes/MiscFunctions.php 2011-07-08 10:28:14 UTC (rev 4626) @@ -112,6 +112,7 @@ if (strstr($CheckVariable,"'") OR strstr($CheckVariable,'+') OR strstr($CheckVariable,'?') + OR strstr($CheckVariable,'.') OR strstr($CheckVariable,"\"") OR strstr($CheckVariable,'&') OR strstr($CheckVariable,"\\") Modified: trunk/includes/SelectOrderItems_IntoCart.inc =================================================================== --- trunk/includes/SelectOrderItems_IntoCart.inc 2011-07-06 09:30:42 UTC (rev 4625) +++ trunk/includes/SelectOrderItems_IntoCart.inc 2011-07-08 10:28:14 UTC (rev 4626) @@ -89,7 +89,7 @@ $NewLineNo = -1; /* this is ok b/c CartClass will change to the correct line no */ } - if (isset($StockItem) and $myItemRow['discountcategory'] != "" ){ + if (isset($StockItem) and $myItemRow['discountcategory'] != '' ){ $DiscCatsDone[$Counter]=$StockItem->DiscCat; $QuantityOfDiscCat =0; $result = DB_query("SELECT MAX(discountrate) AS discount @@ -114,15 +114,17 @@ if ($_SESSION['Items'.$identifier]->SpecialInstructions) { prnMsg($_SESSION['Items'.$identifier]->SpecialInstructions,'warn'); } - if ($_SESSION['CheckCreditLimits'] > 0){ /*Check credit limits is 1 for warn + if ($_SESSION['CheckCreditLimits'] > 0 AND $AlreadyWarnedAboutCredit==false){ /*Check credit limits is 1 for warn and 2 for prohibit sales */ $_SESSION['Items'.$identifier]->CreditAvailable -= round(($NewItemQty * $Price * (1- $Discount)),2); if ($_SESSION['CheckCreditLimits']==1 AND $_SESSION['Items'.$identifier]->CreditAvailable <=0){ prnMsg(_('The customer account will breach their credit limit'),'warn'); + $AlreadyWarnedAboutCredit = true; } elseif ($_SESSION['CheckCreditLimits']==2 AND $_SESSION['Items'.$identifier]->CreditAvailable <=0){ prnMsg(_('No more lines can be added to this order the customer account is currently at or over their credit limit'),'warn'); $WithinCreditLimit = false; + $AlreadyWarnedAboutCredit = true; } } This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <dai...@us...> - 2011-07-08 10:28:21
|
Revision: 4626 http://web-erp.svn.sourceforge.net/web-erp/?rev=4626&view=rev Author: daintree Date: 2011-07-08 10:28:14 +0000 (Fri, 08 Jul 2011) Log Message: ----------- various Modified Paths: -------------- trunk/PO_Items.php trunk/SelectOrderItems.php trunk/doc/Change.log trunk/includes/MiscFunctions.php trunk/includes/SelectOrderItems_IntoCart.inc Modified: trunk/PO_Items.php =================================================================== --- trunk/PO_Items.php 2011-07-06 09:30:42 UTC (rev 4625) +++ trunk/PO_Items.php 2011-07-08 10:28:14 UTC (rev 4626) @@ -159,39 +159,38 @@ deliverydate, paymentterms, allowprint) - VALUES( '" . $_SESSION['PO'.$identifier]->OrderNo . "', - '" . $_SESSION['PO'.$identifier]->SupplierID . "', - '" . $_SESSION['PO'.$identifier]->Comments . "', - '" . Date('Y-m-d') . "', - '" . $_SESSION['PO'.$identifier]->ExRate . "', - '" . $_SESSION['PO'.$identifier]->Initiator . "', - '" . $_SESSION['PO'.$identifier]->RequisitionNo . "', - '" . $_SESSION['PO'.$identifier]->Location . "', - '" . $_SESSION['PO'.$identifier]->DelAdd1 . "', - '" . $_SESSION['PO'.$identifier]->DelAdd2 . "', - '" . $_SESSION['PO'.$identifier]->DelAdd3 . "', - '" . $_SESSION['PO'.$identifier]->DelAdd4 . "', - '" . $_SESSION['PO'.$identifier]->DelAdd5 . "', - '" . $_SESSION['PO'.$identifier]->DelAdd6 . "', - '" . $_SESSION['PO'.$identifier]->Tel . "', - '" . $_SESSION['PO'.$identifier]->SuppDelAdd1 . "', - '" . $_SESSION['PO'.$identifier]->SuppDelAdd2 . "', - '" . $_SESSION['PO'.$identifier]->SuppDelAdd3 . "', - '" . $_SESSION['PO'.$identifier]->SuppDelAdd4 . "', - '" . $_SESSION['PO'.$identifier]->SuppDelAdd5 . "', - '" . $_SESSION['PO'.$identifier]->SuppDelAdd6 . "', - '" . $_SESSION['PO'.$identifier]->SupplierContact . "', - '" . $_SESSION['PO'.$identifier]->SuppTel. "', - '" . $_SESSION['PO'.$identifier]->Contact . "', - '" . $_SESSION['PO'.$identifier]->Version . "', - '" . Date('Y-m-d') . "', - '" . $_SESSION['PO'.$identifier]->DeliveryBy . "', - '" . $_SESSION['PO'.$identifier]->Status . "', - '" . $StatusComment . "', - '" . FormatDateForSQL($_SESSION['PO'.$identifier]->DeliveryDate) . "', - '" . $_SESSION['PO'.$identifier]->PaymentTerms. "', - '" . $_SESSION['PO'.$identifier]->AllowPrintPO . "' - )"; + VALUES( '" . $_SESSION['PO'.$identifier]->OrderNo . "', + '" . $_SESSION['PO'.$identifier]->SupplierID . "', + '" . $_SESSION['PO'.$identifier]->Comments . "', + '" . Date('Y-m-d') . "', + '" . $_SESSION['PO'.$identifier]->ExRate . "', + '" . $_SESSION['PO'.$identifier]->Initiator . "', + '" . $_SESSION['PO'.$identifier]->RequisitionNo . "', + '" . $_SESSION['PO'.$identifier]->Location . "', + '" . $_SESSION['PO'.$identifier]->DelAdd1 . "', + '" . $_SESSION['PO'.$identifier]->DelAdd2 . "', + '" . $_SESSION['PO'.$identifier]->DelAdd3 . "', + '" . $_SESSION['PO'.$identifier]->DelAdd4 . "', + '" . $_SESSION['PO'.$identifier]->DelAdd5 . "', + '" . $_SESSION['PO'.$identifier]->DelAdd6 . "', + '" . $_SESSION['PO'.$identifier]->Tel . "', + '" . $_SESSION['PO'.$identifier]->SuppDelAdd1 . "', + '" . $_SESSION['PO'.$identifier]->SuppDelAdd2 . "', + '" . $_SESSION['PO'.$identifier]->SuppDelAdd3 . "', + '" . $_SESSION['PO'.$identifier]->SuppDelAdd4 . "', + '" . $_SESSION['PO'.$identifier]->SuppDelAdd5 . "', + '" . $_SESSION['PO'.$identifier]->SuppDelAdd6 . "', + '" . $_SESSION['PO'.$identifier]->SupplierContact . "', + '" . $_SESSION['PO'.$identifier]->SuppTel. "', + '" . $_SESSION['PO'.$identifier]->Contact . "', + '" . $_SESSION['PO'.$identifier]->Version . "', + '" . Date('Y-m-d') . "', + '" . $_SESSION['PO'.$identifier]->DeliveryBy . "', + '" . $_SESSION['PO'.$identifier]->Status . "', + '" . $StatusComment . "', + '" . FormatDateForSQL($_SESSION['PO'.$identifier]->DeliveryDate) . "', + '" . $_SESSION['PO'.$identifier]->PaymentTerms. "', + '" . $_SESSION['PO'.$identifier]->AllowPrintPO . "' )"; $ErrMsg = _('The purchase order header record could not be inserted into the database because'); $DbgMsg = _('The SQL statement used to insert the purchase order header record and failed was'); @@ -213,20 +212,19 @@ suppliers_partno, assetid, conversionfactor ) - VALUES ( - '" . $_SESSION['PO'.$identifier]->OrderNo . "', - '" . $POLine->StockID . "', - '" . FormatDateForSQL($POLine->ReqDelDate) . "', - '" . $POLine->ItemDescription . "', - '" . $POLine->GLCode . "', - '" . $POLine->Price . "', - '" . $POLine->Quantity . "', - '" . $POLine->ShiptRef . "', - '" . $POLine->JobRef . "', - '" . $POLine->SuppliersUnit . "', - '" . $POLine->Suppliers_PartNo . "', - '" . $POLine->AssetID . "', - '" . $POLine->ConversionFactor . "')"; + VALUES ('" . $_SESSION['PO'.$identifier]->OrderNo . "', + '" . $POLine->StockID . "', + '" . FormatDateForSQL($POLine->ReqDelDate) . "', + '" . $POLine->ItemDescription . "', + '" . $POLine->GLCode . "', + '" . $POLine->Price . "', + '" . $POLine->Quantity . "', + '" . $POLine->ShiptRef . "', + '" . $POLine->JobRef . "', + '" . $POLine->SuppliersUnit . "', + '" . $POLine->Suppliers_PartNo . "', + '" . $POLine->AssetID . "', + '" . $POLine->ConversionFactor . "')"; $ErrMsg =_('One of the purchase order detail records could not be inserted into the database because'); $DbgMsg =_('The SQL statement used to insert the purchase order detail record and failed was'); @@ -386,7 +384,7 @@ if (isset($_POST['EnterLine'])){ /*Inputs from the form directly without selecting a stock item from the search */ $AllowUpdate = true; /*always assume the best */ - if (!is_numeric(doubleval(str_replace($locale_info['thousands_sep'],'',$_POST['Qty'])))){ + if (!is_numeric($_POST['Qty'])){ $AllowUpdate = false; prnMsg( _('Cannot Enter this order line') . '<br />' . _('The quantity of the order item must be numeric'),'error'); } @@ -394,7 +392,7 @@ $AllowUpdate = false; prnMsg( _('Cannot Enter this order line') . '<br />' . _('The quantity of the ordered item entered must be a positive amount'),'error'); } - if (!is_numeric(doubleval(str_replace($locale_info['thousands_sep'],'',$_POST['Price'])))){ + if (!is_numeric($_POST['Price'])){ $AllowUpdate = false; prnMsg( _('Cannot Enter this order line') . '<br />' . _('The price entered must be numeric'),'error'); } @@ -465,8 +463,6 @@ if ($AllowUpdate == true){ //adding the non-stock item - $_POST['Price'] = doubleval(str_replace($locale_info['thousands_sep'],'',$_POST['Price'])); - $_POST['Qty'] = doubleval(str_replace($locale_info['thousands_sep'],'',$_POST['Qty'])); $_SESSION['PO'.$identifier]->add_to_order ($_SESSION['PO'.$identifier]->LinesOnOrder+1, '', @@ -505,10 +501,10 @@ foreach ($_POST as $FormVariableName => $Quantity) { if (mb_substr($FormVariableName, 0, 6)=='NewQty') { //if the form variable represents a Qty to add to the order - + $ItemCode = mb_substr($FormVariableName, 6, mb_strlen($FormVariableName)-6); $AlreadyOnThisOrder = 0; - + if ($_SESSION['PO_AllowSameItemMultipleTimes'] ==false){ if (count($_SESSION['PO'.$identifier]->LineItems)!=0){ @@ -530,11 +526,11 @@ decimalplaces, stockact, accountname - FROM stockmaster INNER JOIN stockcategory - ON stockcategory.categoryid = stockmaster.categoryid - INNER JOIN chartmaster - ON chartmaster.accountcode = stockcategory.stockact - WHERE stockmaster.stockid = '". $ItemCode . "'"; + FROM stockmaster INNER JOIN stockcategory + ON stockcategory.categoryid = stockmaster.categoryid + INNER JOIN chartmaster + ON chartmaster.accountcode = stockcategory.stockact + WHERE stockmaster.stockid = '". $ItemCode . "'"; $ErrMsg = _('The item details for') . ' ' . $ItemCode . ' ' . _('could not be retrieved because'); $DbgMsg = _('The SQL used to retrieve the item details but failed was'); @@ -661,9 +657,9 @@ // Note if the price is greater than 1 use 2 decimal place, if the price is a fraction of 1, use 4 decimal places // This should help display where item-price is a fraction if ($POLine->Price > 1) { - $DisplayPrice = number_format($POLine->Price,$_SESSION['PO'.$identifier]->CurrDecimalPlaces,'.',''); + $DisplayPrice = number_format($POLine->Price,$_SESSION['PO'.$identifier]->CurrDecimalPlaces); } else { - $DisplayPrice = number_format($POLine->Price,4,'.',''); + $DisplayPrice = number_format($POLine->Price,4); } if ($k==1){ @@ -705,7 +701,7 @@ echo '<br /><table class="selection"><tr> <td>' . _('Item Description') . '</td>'; - echo '<td><input type=text name=ItemDescription size=40></td></tr>'; + echo '<td><input type="text" name="ItemDescription" size="40" /></td></tr>'; echo '<tr><td>' . _('General Ledger Code') . '</td>'; echo '<td><select name="GLCode">'; $sql="SELECT accountcode, @@ -759,29 +755,29 @@ $sql = "SELECT stockmaster.stockid, stockmaster.description, stockmaster.units - FROM stockmaster INNER JOIN stockcategory - ON stockmaster.categoryid=stockcategory.categoryid - WHERE stockmaster.mbflag<>'D' - AND stockmaster.mbflag<>'K' - AND stockmaster.mbflag<>'G' - AND stockmaster.discontinued<>1 - AND stockmaster.description " . LIKE . " '" . $SearchString ."' - ORDER BY stockmaster.stockid - LIMIT " .$_SESSION['DefaultDisplayRecordsMax']; + FROM stockmaster INNER JOIN stockcategory + ON stockmaster.categoryid=stockcategory.categoryid + WHERE stockmaster.mbflag<>'D' + AND stockmaster.mbflag<>'K' + AND stockmaster.mbflag<>'G' + AND stockmaster.discontinued<>1 + AND stockmaster.description " . LIKE . " '" . $SearchString ."' + ORDER BY stockmaster.stockid + LIMIT " .$_SESSION['DefaultDisplayRecordsMax']; } else { $sql = "SELECT stockmaster.stockid, stockmaster.description, stockmaster.units - FROM stockmaster INNER JOIN stockcategory - ON stockmaster.categoryid=stockcategory.categoryid - WHERE stockmaster.mbflag<>'D' - AND stockmaster.mbflag<>'K' - AND stockmaster.mbflag<>'G' - AND stockmaster.discontinued<>1 - AND stockmaster.description " . LIKE . " '". $SearchString ."' - AND stockmaster.categoryid='" . $_POST['StockCat'] . "' - ORDER BY stockmaster.stockid - LIMIT ".$_SESSION['DefaultDisplayRecordsMax']; + FROM stockmaster INNER JOIN stockcategory + ON stockmaster.categoryid=stockcategory.categoryid + WHERE stockmaster.mbflag<>'D' + AND stockmaster.mbflag<>'K' + AND stockmaster.mbflag<>'G' + AND stockmaster.discontinued<>1 + AND stockmaster.description " . LIKE . " '". $SearchString ."' + AND stockmaster.categoryid='" . $_POST['StockCat'] . "' + ORDER BY stockmaster.stockid + LIMIT ".$_SESSION['DefaultDisplayRecordsMax']; } } elseif ($_POST['StockCode']){ @@ -792,29 +788,29 @@ $sql = "SELECT stockmaster.stockid, stockmaster.description, stockmaster.units - FROM stockmaster INNER JOIN stockcategory - ON stockmaster.categoryid=stockcategory.categoryid - WHERE stockmaster.mbflag<>'D' - AND stockmaster.mbflag<>'K' - AND stockmaster.mbflag<>'G' - AND stockmaster.discontinued<>1 - AND stockmaster.stockid " . LIKE . " '" . $_POST['StockCode'] . "' - ORDER BY stockmaster.stockid - LIMIT ".$_SESSION['DefaultDisplayRecordsMax']; + FROM stockmaster INNER JOIN stockcategory + ON stockmaster.categoryid=stockcategory.categoryid + WHERE stockmaster.mbflag<>'D' + AND stockmaster.mbflag<>'K' + AND stockmaster.mbflag<>'G' + AND stockmaster.discontinued<>1 + AND stockmaster.stockid " . LIKE . " '" . $_POST['StockCode'] . "' + ORDER BY stockmaster.stockid + LIMIT ".$_SESSION['DefaultDisplayRecordsMax']; } else { $sql = "SELECT stockmaster.stockid, stockmaster.description, stockmaster.units - FROM stockmaster INNER JOIN stockcategory - ON stockmaster.categoryid=stockcategory.categoryid - WHERE stockmaster.mbflag<>'D' - AND stockmaster.mbflag<>'K' - AND stockmaster.mbflag<>'G' - and stockmaster.discontinued<>1 - AND stockmaster.stockid " . LIKE . " '" . $_POST['StockCode'] . "' - AND stockmaster.categoryid='" . $_POST['StockCat'] . "' - ORDER BY stockmaster.stockid - LIMIT ".$_SESSION['DefaultDisplayRecordsMax']; + FROM stockmaster INNER JOIN stockcategory + ON stockmaster.categoryid=stockcategory.categoryid + WHERE stockmaster.mbflag<>'D' + AND stockmaster.mbflag<>'K' + AND stockmaster.mbflag<>'G' + and stockmaster.discontinued<>1 + AND stockmaster.stockid " . LIKE . " '" . $_POST['StockCode'] . "' + AND stockmaster.categoryid='" . $_POST['StockCat'] . "' + ORDER BY stockmaster.stockid + LIMIT ".$_SESSION['DefaultDisplayRecordsMax']; } } else { @@ -822,27 +818,27 @@ $sql = "SELECT stockmaster.stockid, stockmaster.description, stockmaster.units - FROM stockmaster INNER JOIN stockcategory - ON stockmaster.categoryid=stockcategory.categoryid - WHERE stockmaster.mbflag<>'D' - AND stockmaster.mbflag<>'K' - AND stockmaster.mbflag<>'G' - AND stockmaster.discontinued<>1 - ORDER BY stockmaster.stockid - LIMIT " . $_SESSION['DefaultDisplayRecordsMax']; + FROM stockmaster INNER JOIN stockcategory + ON stockmaster.categoryid=stockcategory.categoryid + WHERE stockmaster.mbflag<>'D' + AND stockmaster.mbflag<>'K' + AND stockmaster.mbflag<>'G' + AND stockmaster.discontinued<>1 + ORDER BY stockmaster.stockid + LIMIT " . $_SESSION['DefaultDisplayRecordsMax']; } else { $sql = "SELECT stockmaster.stockid, stockmaster.description, stockmaster.units - FROM stockmaster INNER JOIN stockcategory - ON stockmaster.categoryid=stockcategory.categoryid - WHERE stockmaster.mbflag<>'D' - AND stockmaster.mbflag<>'K' - AND stockmaster.mbflag<>'G' - AND stockmaster.discontinued<>1 - AND stockmaster.categoryid='" . $_POST['StockCat'] . "' - ORDER BY stockmaster.stockid - LIMIT " . $_SESSION['DefaultDisplayRecordsMax']; + FROM stockmaster INNER JOIN stockcategory + ON stockmaster.categoryid=stockcategory.categoryid + WHERE stockmaster.mbflag<>'D' + AND stockmaster.mbflag<>'K' + AND stockmaster.mbflag<>'G' + AND stockmaster.discontinued<>1 + AND stockmaster.categoryid='" . $_POST['StockCat'] . "' + ORDER BY stockmaster.stockid + LIMIT " . $_SESSION['DefaultDisplayRecordsMax']; } } @@ -865,10 +861,10 @@ if (!isset($_GET['Edit'])) { $sql="SELECT categoryid, categorydescription - FROM stockcategory - WHERE stocktype<>'L' - AND stocktype<>'D' - ORDER BY categorydescription"; + FROM stockcategory + WHERE stocktype<>'L' + AND stocktype<>'D' + ORDER BY categorydescription"; $ErrMsg = _('The supplier category details could not be retrieved because'); $DbgMsg = _('The SQL used to retrieve the category details but failed was'); $result1 = DB_query($sql,$db,$ErrMsg,$DbgMsg); @@ -926,13 +922,13 @@ echo '<table cellpadding="1" colspan="7" class="selection">'; $TableHeader = '<tr> - <th>' . _('Code') . '</th> - <th>' . _('Description') . '</th> - <th>' . _('Our Units') . '</th> - <th>' . _('Conversion') . '<br />' ._('Factor') . '</th> - <th>' . _('Supplier/Order') . '<br />' . _('Units') . '</th> - <th colspan=2><a href="#end">'._('Go to end of list').'</a></th> - </tr>'; + <th>' . _('Code') . '</th> + <th>' . _('Description') . '</th> + <th>' . _('Our Units') . '</th> + <th>' . _('Conversion') . '<br />' ._('Factor') . '</th> + <th>' . _('Supplier/Order') . '<br />' . _('Units') . '</th> + <th colspan=2><a href="#end">'._('Go to end of list').'</a></th> + </tr>'; echo $TableHeader; $j = 1; Modified: trunk/SelectOrderItems.php =================================================================== --- trunk/SelectOrderItems.php 2011-07-06 09:30:42 UTC (rev 4625) +++ trunk/SelectOrderItems.php 2011-07-08 10:28:14 UTC (rev 4626) @@ -897,6 +897,7 @@ $ExRate = 1; } + /*Process Quick Entry */ /* If enter is pressed on the quick entry screen, the default button may be Recalculate */ if (isset($_POST['order_items']) @@ -906,8 +907,8 @@ /* get the item details from the database and hold them in the cart object */ /*Discount can only be set later on -- after quick entry -- so default discount to 0 in the first place */ - $Discount = 0; - + $Discount = 0; + $AlreadyWarnedAboutCredit = false; $i=1; while ($i<=$_SESSION['QuickEntries'] and isset($_POST['part_' . $i]) and $_POST['part_' . $i]!='') { $QuickEntryCode = 'part_' . $i; @@ -1053,14 +1054,14 @@ taxcatid, materialcost) VALUES ('" . $AssetStockID . "', - '" . $AssetRow['description'] . "', - '" . $AssetRow['longdescription'] . "', - 'ASSETS', - 'D', - '0', - '0', - '" . $_SESSION['DefaultTaxCategory'] . "', - '". $NBV . "')" , $db); + '" . $AssetRow['description'] . "', + '" . $AssetRow['longdescription'] . "', + 'ASSETS', + 'D', + '0', + '0', + '" . $_SESSION['DefaultTaxCategory'] . "', + '". $NBV . "')" , $db); /*not forgetting the location records too */ $InsertStkLocRecsResult = DB_query("INSERT INTO locstock (loccode, stockid) @@ -1091,7 +1092,9 @@ $_SESSION['Items'.$identifier]->LineItems[$_GET['Delete']]->Quantity = $QuantityAlreadyDelivered; } } - + + $AlreadyWarnedAboutCredit = false; + foreach ($_SESSION['Items'.$identifier]->LineItems as $OrderLine) { if (isset($_POST['Quantity_' . $OrderLine->LineNumber])){ @@ -1142,18 +1145,20 @@ $WithinCreditLimit = true; - if ($_SESSION['CheckCreditLimits'] > 0){ /*Check credit limits is 1 for warn - and 2 for prohibit sales */ + if ($_SESSION['CheckCreditLimits'] > 0 AND $AlreadyWarnedAboutCredit==false){ /*Check credit limits is 1 for warn + breach their credit limit and 2 for prohibit sales */ $DifferenceInOrderValue = ($Quantity*$Price*(1-$DiscountPercentage/100)) - ($OrderLine->Quantity*$OrderLine->Price*(1-$OrderLine->DiscountPercentage)); $_SESSION['Items'.$identifier]->CreditAvailable -= $DifferenceInOrderValue; if ($_SESSION['CheckCreditLimits']==1 AND $_SESSION['Items'.$identifier]->CreditAvailable <=0){ prnMsg(_('The customer account will breach their credit limit'),'warn'); + $AlreadyWarnedAboutCredit = true; } elseif ($_SESSION['CheckCreditLimits']==2 AND $_SESSION['Items'.$identifier]->CreditAvailable <=0){ prnMsg(_('This change would put the customer over their credit limit and is prohibited'),'warn'); $WithinCreditLimit = false; $_SESSION['Items'.$identifier]->CreditAvailable += $DifferenceInOrderValue; + $AlreadyWarnedAboutCredit = true; } } @@ -1170,8 +1175,39 @@ } //within credit limit so make changes } //there are changes to the order line to process } //page not called from itself - POST variables not set - } - } + } // Loop around all items on the order + + + /* Now Run through each line of the order again to work out the appropriate discount from the discount matrix */ + $DiscCatsDone = array(); + foreach ($_SESSION['Items'.$identifier]->LineItems as $OrderLine) { + + if ($OrderLine->DiscCat !='' AND ! in_array($OrderLine->DiscCat,$DiscCatsDone)){ + $DiscCatsDone[]=$OrderLine->DiscCat; + $QuantityOfDiscCat = 0; + + foreach ($_SESSION['Items'.$identifier]->LineItems as $OrderLine_2) { + /* add up total quantity of all lines of this DiscCat */ + if ($OrderLine_2->DiscCat==$OrderLine->DiscCat){ + $QuantityOfDiscCat += $OrderLine_2->Quantity; + } + } + $result = DB_query("SELECT MAX(discountrate) AS discount + FROM discountmatrix + WHERE salestype='" . $_SESSION['Items'.$identifier]->DefaultSalesType . "' + AND discountcategory ='" . $OrderLine->DiscCat . "' + AND quantitybreak <" . $QuantityOfDiscCat,$db); + $myrow = DB_fetch_row($result); + if ($myrow[0]!=0){ /* need to update the lines affected */ + foreach ($_SESSION['Items'.$identifier]->LineItems as $OrderLine_2) { + if ($OrderLine_2->DiscCat==$OrderLine->DiscCat){ + $_SESSION['Items'.$identifier]->LineItems[$OrderLine_2->LineNumber]->DiscountPercent = $myrow[0]; + } + } + }//a none zero discount percentage was returned + } + } /* end of discount matrix lookup code */ + } // the order session is started or there is a new item being added if (isset($_POST['DeliveryDetails'])){ echo '<meta http-equiv="Refresh" content="0; url=' . $rootpath . '/DeliveryDetails.php?' . SID .'identifier='.$identifier . '">'; prnMsg(_('You should automatically be forwarded to the entry of the delivery details page') . '. ' . _('if this does not happen') . ' (' . _('if the browser does not support META Refresh') . ') ' . @@ -1229,6 +1265,7 @@ if (isset($NewItem_array) AND isset($_POST['order_items'])){ /* get the item details from the database and hold them in the cart object make the quantity 1 by default then add it to the cart */ /*Now figure out if the item is a kit set - the field MBFlag='K'*/ + $AlreadyWarnedAboutCredit = false; foreach($NewItem_array as $NewItem => $NewItemQty) { if($NewItemQty > 0) { $sql = "SELECT stockmaster.mbflag @@ -1245,11 +1282,11 @@ if ($myrow=DB_fetch_array($KitResult)){ if ($myrow['mbflag']=='K'){ /*It is a kit set item */ $sql = "SELECT bom.component, - bom.quantity - FROM bom - WHERE bom.parent='" . $NewItem . "' - AND bom.effectiveto > '" . Date('Y-m-d') . "' - AND bom.effectiveafter < '" . Date('Y-m-d') . "'"; + bom.quantity + FROM bom + WHERE bom.parent='" . $NewItem . "' + AND bom.effectiveto > '" . Date('Y-m-d') . "' + AND bom.effectiveafter < '" . Date('Y-m-d') . "'"; $ErrMsg = _('Could not retrieve kitset components from the database because'); $KitResult = DB_query($sql,$db,$ErrMsg); @@ -1300,8 +1337,7 @@ $myrow = DB_fetch_row($result); if ($myrow[0]!=0){ /* need to update the lines affected */ foreach ($_SESSION['Items'.$identifier]->LineItems as $StkItems_2) { - /* add up total quantity of all lines of this DiscCat */ - if ($StkItems_2->DiscCat==$OrderLine->DiscCat AND $StkItems_2->DiscountPercent == 0){ + if ($StkItems_2->DiscCat==$OrderLine->DiscCat){ $_SESSION['Items'.$identifier]->LineItems[$StkItems_2->LineNumber]->DiscountPercent = $myrow[0]; } } @@ -1415,12 +1451,13 @@ $DisplayTotal = number_format($_SESSION['Items'.$identifier]->total,$_SESSION['Items'.$identifier]->CurrDecimalPlaces); if (in_array(2,$_SESSION['AllowedPageSecurityTokens'])){ - $ColSpanNumber = 3; + $ColSpanNumber = 2; } else { $ColSpanNumber = 1; } - echo '<tr class="EvenTableRows"><td class="number" colspan=7><b>' . _('TOTAL Excl Tax/Freight') . '</b></td> - <td colspan="' . $ColSpanNumber . '" class=number>' . $DisplayTotal . '</td></tr></table>'; + echo '<tr class="EvenTableRows"> + <td class="number" colspan=7><b>' . _('TOTAL Excl Tax/Freight') . '</b></td> + <td colspan="' . $ColSpanNumber . '" class=number>' . $DisplayTotal . '</td></tr></table>'; $DisplayVolume = number_format($_SESSION['Items'.$identifier]->totalVolume,2); $DisplayWeight = number_format($_SESSION['Items'.$identifier]->totalWeight,2); @@ -1431,8 +1468,10 @@ </tr></table>'; - echo '<br /><div class="centre"><input type=submit name="Recalculate" Value="' . _('Re-Calculate') . '"> - <input type=submit name="DeliveryDetails" value="' . _('Enter Delivery Details and Confirm Order') . '"></div><hr>'; + echo '<br /> + <div class="centre"> + <input type="submit" name="Recalculate" value="' . _('Re-Calculate') . '"> + <input type="submit" name="DeliveryDetails" value="' . _('Enter Delivery Details and Confirm Order') . '"></div><hr />'; } # end of if lines /* Now show the stock item selection search stuff below */ Modified: trunk/doc/Change.log =================================================================== --- trunk/doc/Change.log 2011-07-06 09:30:42 UTC (rev 4625) +++ trunk/doc/Change.log 2011-07-08 10:28:14 UTC (rev 4626) @@ -1,5 +1,7 @@ webERP Change Log +8/7/11 Phil: Trap codes with decimal point "." in them in the IllegalCharacters function +8/7/11 Phil: Fix discount matrix calculations on order entry and amendment 5/7/11 Phil: Amend menu to use PDFStockLocTransfer.php to reprint transfer list - as reported by Ron Wong 3/7/11 Phil: changed all strpos to mb_strpos 3/7/11 Phil: changed all strtoupper to mb_strtoupper Modified: trunk/includes/MiscFunctions.php =================================================================== --- trunk/includes/MiscFunctions.php 2011-07-06 09:30:42 UTC (rev 4625) +++ trunk/includes/MiscFunctions.php 2011-07-08 10:28:14 UTC (rev 4626) @@ -112,6 +112,7 @@ if (strstr($CheckVariable,"'") OR strstr($CheckVariable,'+') OR strstr($CheckVariable,'?') + OR strstr($CheckVariable,'.') OR strstr($CheckVariable,"\"") OR strstr($CheckVariable,'&') OR strstr($CheckVariable,"\\") Modified: trunk/includes/SelectOrderItems_IntoCart.inc =================================================================== --- trunk/includes/SelectOrderItems_IntoCart.inc 2011-07-06 09:30:42 UTC (rev 4625) +++ trunk/includes/SelectOrderItems_IntoCart.inc 2011-07-08 10:28:14 UTC (rev 4626) @@ -89,7 +89,7 @@ $NewLineNo = -1; /* this is ok b/c CartClass will change to the correct line no */ } - if (isset($StockItem) and $myItemRow['discountcategory'] != "" ){ + if (isset($StockItem) and $myItemRow['discountcategory'] != '' ){ $DiscCatsDone[$Counter]=$StockItem->DiscCat; $QuantityOfDiscCat =0; $result = DB_query("SELECT MAX(discountrate) AS discount @@ -114,15 +114,17 @@ if ($_SESSION['Items'.$identifier]->SpecialInstructions) { prnMsg($_SESSION['Items'.$identifier]->SpecialInstructions,'warn'); } - if ($_SESSION['CheckCreditLimits'] > 0){ /*Check credit limits is 1 for warn + if ($_SESSION['CheckCreditLimits'] > 0 AND $AlreadyWarnedAboutCredit==false){ /*Check credit limits is 1 for warn and 2 for prohibit sales */ $_SESSION['Items'.$identifier]->CreditAvailable -= round(($NewItemQty * $Price * (1- $Discount)),2); if ($_SESSION['CheckCreditLimits']==1 AND $_SESSION['Items'.$identifier]->CreditAvailable <=0){ prnMsg(_('The customer account will breach their credit limit'),'warn'); + $AlreadyWarnedAboutCredit = true; } elseif ($_SESSION['CheckCreditLimits']==2 AND $_SESSION['Items'.$identifier]->CreditAvailable <=0){ prnMsg(_('No more lines can be added to this order the customer account is currently at or over their credit limit'),'warn'); $WithinCreditLimit = false; + $AlreadyWarnedAboutCredit = true; } } This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <dai...@us...> - 2011-07-06 09:30:55
|
Revision: 4625 http://web-erp.svn.sourceforge.net/web-erp/?rev=4625&view=rev Author: daintree Date: 2011-07-06 09:30:42 +0000 (Wed, 06 Jul 2011) Log Message: ----------- various Modified Paths: -------------- trunk/GeocodeSetup.php trunk/GetStockImage.php trunk/MRPShortages.php trunk/PDFStockTransfer.php trunk/ShipmentCosting.php trunk/Z_CheckDebtorsControl.php trunk/api/api_session.inc trunk/api/api_xml-rpc.php trunk/doc/Change.log trunk/geo_displaymap_customers.php trunk/geo_displaymap_suppliers.php trunk/includes/session.inc trunk/index.php trunk/locale/it_IT.utf8/LC_MESSAGES/messages.mo trunk/locale/it_IT.utf8/LC_MESSAGES/messages.po Modified: trunk/GeocodeSetup.php =================================================================== --- trunk/GeocodeSetup.php 2011-07-05 10:36:13 UTC (rev 4624) +++ trunk/GeocodeSetup.php 2011-07-06 09:30:42 UTC (rev 4625) @@ -29,14 +29,14 @@ //first off validate inputs are sensible $sql="SELECT count(geocodeid) - FROM geocode_param WHERE geocodeid='".$_POST['geocodeid']."'"; + FROM geocode_param WHERE geocodeid='".$_POST['GeoCodeID']."'"; $result=DB_query($sql, $db); $myrow=DB_fetch_row($result); if ($myrow[0]!=0 and !isset($SelectedParam)) { $InputError = 1; prnMsg( _('That geocode ID already exists in the database'),'error'); - $Errors[$i] = 'geocodeid'; + $Errors[$i] = 'GeoCodeID'; $i++; } @@ -46,14 +46,14 @@ /*SelectedParam could also exist if submit had not been clicked this code would not run in this case cos submit is false of course see the delete code below*/ - if (isset($_POST['geocode_key']) and isset($_POST['geocode_key']) ){ + if (isset($_POST['GeoCode_Key']) and isset($_POST['GeoCode_Key']) ){ $sql = "UPDATE geocode_param SET - geocode_key='" . $_POST['geocode_key'] . "', - center_long='" . $_POST['center_long'] . "', - center_lat='" . $_POST['center_lat'] . "', - map_height='" . $_POST['map_height'] . "', - map_width='" . $_POST['map_width'] . "', - map_host='" . $_POST['map_host'] . "' + geocode_key='" . $_POST['GeoCode_Key'] . "', + center_long='" . $_POST['Center_Long'] . "', + center_lat='" . $_POST['Center_Lat'] . "', + map_height='" . $_POST['Map_Height'] . "', + map_width='" . $_POST['Map_Width'] . "', + map_host='" . $_POST['Map_Host'] . "' WHERE geocodeid = '" . $SelectedParam . "'"; } $msg = _('The geocode status record has been updated'); @@ -62,48 +62,42 @@ /*Selected Param is null cos no item selected on first time round so must be adding a record must be submitting new entries in the new status code form */ - if (isset($_POST['geocode_key']) and $_POST['geocode_key']>0){ + if (isset($_POST['GeoCode_Key']) and $_POST['GeoCode_Key']>0){ - $sql = "INSERT INTO geocode_param ( - geocodeid, - geocode_key, - center_long, - center_lat, - map_height, - map_width, - map_host) - VALUES (" . " - '', - '" . $_POST['geocode_key'] . "', - '" . $_POST['center_long'] . "', - '" . $_POST['center_lat'] . "', - '" . $_POST['map_height'] . "', - '" . $_POST['map_width'] . "', - '" . $_POST['map_host'] . "' - )"; + $sql = "INSERT INTO geocode_param (geocodeid, + geocode_key, + center_long, + center_lat, + map_height, + map_width, + map_host) + VALUES ('', + '" . $_POST['GeoCode_Key'] . "', + '" . $_POST['Center_Long'] . "', + '" . $_POST['Center_Lat'] . "', + '" . $_POST['Map_Height'] . "', + '" . $_POST['Map_Width'] . "', + '" . $_POST['Map_Host'] . "')"; } else { - $sql = "INSERT INTO geocode_param ( - geocodeid, - geocode_key, - center_long, - center_lat, - map_height, - map_width, - map_host) - VALUES ( - '" . $_POST['geocodeid'] . "', - '" . $_POST['geocode_key'] . "', - '" . $_POST['center_long'] . "', - '" . $_POST['center_lat'] . "', - '" . $_POST['map_height'] . "', - '" . $_POST['map_width'] . "', - '" . $_POST['map_host'] . " - ')"; + $sql = "INSERT INTO geocode_param (geocodeid, + geocode_key, + center_long, + center_lat, + map_height, + map_width, + map_host) + VALUES ('" . $_POST['GeoCodeID'] . "', + '" . $_POST['GeoCode_Key'] . "', + '" . $_POST['Center_Long'] . "', + '" . $_POST['Center_Lat'] . "', + '" . $_POST['Map_Height'] . "', + '" . $_POST['Map_Width'] . "', + '" . $_POST['Map_Host'] . "')"; } $msg = _('A new geocode status record has been inserted'); unset ($SelectedParam); - unset ($_POST['geocode_key']); + unset ($_POST['GeoCode_Key']); } //run the SQL from either of the above possibilites $result = DB_query($sql,$db); @@ -128,7 +122,14 @@ links to delete or edit each. These will call the same page again and allow update/input or deletion of the records*/ - $sql = "SELECT geocodeid, geocode_key, center_long, center_lat, map_height, map_width, map_host FROM geocode_param"; + $sql = "SELECT geocodeid, + geocode_key, + center_long, + center_lat, + map_height, + map_width, + map_host + FROM geocode_param"; $result = DB_query($sql, $db); echo '<p class="page_title_text"><img src="'.$rootpath.'/css/'.$theme.'/images/maintenance.png" title="' . _('Geocode Setup') . '" alt="" />'. @@ -137,17 +138,19 @@ '<a href="http://code.google.com/apis/maps/signup.html" target="_blank"> http://code.google.com/apis/maps/signup.html</a></b>'; echo '<div class="centre"><p>'. _('Find the lat/long for your map center point at ') . '<a href="http://www.batchgeocode.com/lookup/" target="_blank">http://www.batchgeocode.com/lookup/</a></b>'; - echo '<p>'. _('Set the maps centre point using the Center Longitude and Center Latitude. Set the maps screen size using the height and width in pixels (px)').'</div><br />'; + prnMsg(_('Set the maps centre point using the Center Longitude and Center Latitude. Set the maps screen size using the height and width in pixels (px)'),'info'); + echo '</div><br />'; echo '<table border=1>'; echo '<tr> - <th>'. _('Geocode ID') .'</th> - <th>'. _('Geocode Key') .'</th> - <th>'. _('Center Longitude') .'</th> - <th>'. _('Center Latitude') .'</th> - <th>'. _('Map height (px)') .'</th> - <th>'. _('Map width (px)') .'</th> - <th>'. _('Map host') .'</th>'; + <th>'. _('Geocode ID') .'</th> + <th>'. _('Geocode Key') .'</th> + <th>'. _('Center Longitude') . '</th> + <th>'. _('Center Latitude') . '</th> + <th>'. _('Map height (px)') . '</th> + <th>'. _('Map width (px)') . '</th> + <th>'. _('Map host') . '</th> + </tr>'; $k=0; //row colour counter while ($myrow=DB_fetch_row($result)) { @@ -161,27 +164,27 @@ } printf('<td>%s</td> - <td>%s</td> - <td>%s</td> - <td>%s</td> - <td>%s</td> - <td>%s</td> - <td>%s</td> - <td><a href=\'%s?SelectedParam=%s\'>' . _('Edit') . '</a></td> - <td><a href=\'%s?SelectedParam=%s&delete=%s\'>'. _('Delete') .'</a></td> - </tr>', - $myrow[0], - $myrow[1], - $myrow[2], - $myrow[3], - $myrow[4], - $myrow[5], - $myrow[6], - $_SERVER['PHP_SELF'], - $myrow[0], - $_SERVER['PHP_SELF'], - $myrow[0], - $myrow[0]); + <td>%s</td> + <td>%s</td> + <td>%s</td> + <td>%s</td> + <td>%s</td> + <td>%s</td> + <td><a href=\'%s?SelectedParam=%s\'>' . _('Edit') . '</a></td> + <td><a href=\'%s?SelectedParam=%s&delete=%s\'>'. _('Delete') .'</a></td> + </tr>', + $myrow[0], + $myrow[1], + $myrow[2], + $myrow[3], + $myrow[4], + $myrow[5], + $myrow[6], + $_SERVER['PHP_SELF'], + $myrow[0], + $_SERVER['PHP_SELF'], + $myrow[0], + $myrow[0]); } //END WHILE LIST LOOP echo '</table>'; @@ -201,70 +204,72 @@ //editing an existing status code $sql = "SELECT geocodeid, - geocode_key, - center_long, - center_lat, - map_height, - map_width, - map_host - FROM geocode_param - WHERE geocodeid='" . $SelectedParam . "'"; + geocode_key, + center_long, + center_lat, + map_height, + map_width, + map_host + FROM geocode_param + WHERE geocodeid='" . $SelectedParam . "'"; $result = DB_query($sql, $db); $myrow = DB_fetch_array($result); - $_POST['geocodeid'] = $myrow['geocodeid']; - $_POST['geocode_key'] = $myrow['geocode_key']; - $_POST['center_long'] = $myrow['center_long']; - $_POST['center_lat'] = $myrow['center_lat']; - $_POST['map_height'] = $myrow['map_height']; - $_POST['map_width'] = $myrow['map_width']; - $_POST['map_host'] = $myrow['map_host']; + $_POST['GeoCodeID'] = $myrow['geocodeid']; + $_POST['GeoCode_Key'] = $myrow['geocode_key']; + $_POST['Center_Long'] = $myrow['center_long']; + $_POST['Center_Lat'] = $myrow['center_lat']; + $_POST['Map_Height'] = $myrow['map_height']; + $_POST['Map_Width'] = $myrow['map_width']; + $_POST['Map_Host'] = $myrow['map_host']; echo '<input type="hidden" name="SelectedParam" value="' . $SelectedParam . '" />'; - echo '<input type="hidden" name="geocodeid" value="' . $_POST['geocodeid'] . '" />'; + echo '<input type="hidden" name="GeoCodeID" value="' . $_POST['GeoCodeID'] . '" />'; echo '<p class="page_title_text"><img src="'.$rootpath.'/css/'.$theme.'/images/maintenance.png" title="' . _('Geocode Setup') . '" alt="">'. _('Setup configuration for Geocoding of Customers and Suppliers') .'</p>'; echo '<table> <tr><td>'. _('Geocode Code') .':</td> - <td>' . $_POST['geocodeid'] . '</td></tr>'; + <td>' . $_POST['GeoCodeID'] . '</td></tr>'; } else { //end of if $SelectedParam only do the else when a new record is being entered - if (!isset($_POST['geocodeid'])) { - $_POST['geocodeid'] = ''; + if (!isset($_POST['GeoCodeID'])) { + $_POST['GeoCodeID'] = ''; } echo '<table>'; // <tr> // <td>'. _('Geocode Code') .":</td> -// <td><input " . (in_array('geocodeid',$Errors) ? 'class="inputerror"' : '' ) . -// " tabindex=1 type='Text' name='geocodeid' VALUE='". $_POST['geocodeid'] ."' size=3 maxlength=2></td> +// <td><input " . (in_array('GeoCodeID',$Errors) ? 'class="inputerror"' : '' ) . +// " tabindex=1 type='Text' name='GeoCodeID' VALUE='". $_POST['GeoCodeID'] ."' size=3 maxlength=2></td> // </tr>"; } - if (!isset($_POST['geocode_key'])) { - $_POST['geocode_key'] = ''; + if (!isset($_POST['GeoCode_Key'])) { + $_POST['GeoCode_Key'] = ''; } echo '<br /><tr> <td>'. _('Geocode Key') .':</td> - <td><input ' . (in_array('geocode_key',$Errors) ? 'class="inputerror"' : '' ) . - ' tabindex=2 type="text" name="geocode_key" VALUE="'. $_POST['geocode_key'] .'" size=28 maxlength=300> + <td><input ' . (in_array('GeoCode_Key',$Errors) ? 'class="inputerror"' : '' ) . + ' tabindex=2 type="text" name="GeoCode_Key" value="'. $_POST['GeoCode_Key'] .'" size=28 maxlength=300> </td></tr> <tr><td>'. _('Geocode Center Long') . '</td> - <td><input tabindex=3 type="text" name="center_long" VALUE="'. $_POST['center_long'] .'" size=28 maxlength=300></td></tr> + <td><input tabindex=3 type="text" name="Center_Long" value="'. $_POST['Center_Long'] .'" size=28 maxlength=300></td></tr> <tr><td>'. _('Geocode Center Lat') . '</td> - <td><input tabindex=4 type="text" name="center_lat" VALUE="'. $_POST['center_lat'] .'" size=28 maxlength=300></td></tr> + <td><input tabindex=4 type="text" name="Center_Lat" value="'. $_POST['Center_Lat'] .'" size=28 maxlength=300></td></tr> <tr><td>'. _('Geocode Map Height') . '</td> - <td><input tabindex=5 type="text" name="map_height" VALUE="'. $_POST['map_height'] .'" size=28 maxlength=300></td></tr> + <td><input tabindex=5 type="text" name="Map_Height" value="'. $_POST['Map_Height'] .'" size=28 maxlength=300></td></tr> <tr><td>'. _('Geocode Map Width') . '</td> - <td><input tabindex=6 type="text" name="map_width" VALUE="'. $_POST['map_width'] .'" size=28 maxlength=300></td></tr> + <td><input tabindex=6 type="text" name="Map_Width" value="'. $_POST['Map_Width'] .'" size=28 maxlength=300></td></tr> <tr><td>'. _('Geocode Host') . '</td> - <td><input tabindex=7 type="text" name="map_host" VALUE="'. $_POST['map_host'] .'" size=20 maxlength=300></td></tr> + <td><input tabindex=7 type="text" name="Map_Host" value="'. $_POST['Map_Host'] .'" size=20 maxlength=300></td></tr> </table> - <div class="centre"><input tabindex=4 type="Submit" name="submit" value="' . _('Enter Information') . '"</div><br /><br /> + <div class="centre"><input tabindex=4 type="submit" name="submit" value="' . _('Enter Information') . '"</div> + <br /> + <br /> </form>'; echo '<div class="page_help_text">' . _('When ready, click on the link below to run the GeoCode process. This will Geocode all Branches and Suppliers. This may take some time. Errors will be returned to the screen.') . '</p>'; echo '<p>' . _('Suppliers and Customer Branches are geocoded when being entered/updated. You can rerun the geocode process from this screen at any time.') . '</p></div><br />'; Modified: trunk/GetStockImage.php =================================================================== --- trunk/GetStockImage.php 2011-07-05 10:36:13 UTC (rev 4624) +++ trunk/GetStockImage.php 2011-07-06 09:30:42 UTC (rev 4625) @@ -20,33 +20,33 @@ */ // Color decode function -function DecodeBgColor( $colorstr ) { - if ( $colorstr[0] == '#' ) { - $colorstr = mb_substr($colorstr,1,mb_strlen($colorstr)); +function DecodeBgColor( $ColourStr ) { + if ( $ColourStr[0] == '#' ) { + $ColourStr = mb_substr($ColourStr,1,mb_strlen($ColourStr)); } - $red = 0; - if(mb_strlen($colorstr) > 1) { - $red = hexdec(mb_substr($colorstr,0,2)); - $colorstr = mb_substr($colorstr,2,mb_strlen($colorstr)); + $Red = 0; + if(mb_strlen($ColourStr) > 1) { + $Red = hexdec(mb_substr($ColourStr,0,2)); + $ColourStr = mb_substr($ColourStr,2,mb_strlen($ColourStr)); } - $green = 0; - if(mb_strlen($colorstr) > 1) { - $green = hexdec(mb_substr($colorstr,0,2)); - $colorstr = mb_substr($colorstr,2,mb_strlen($colorstr)); + $Green = 0; + if(mb_strlen($ColourStr) > 1) { + $Green = hexdec(mb_substr($ColourStr,0,2)); + $ColourStr = mb_substr($ColourStr,2,mb_strlen($ColourStr)); } - $blue = 0; - if(mb_strlen($colorstr) > 1) { - $blue = hexdec(mb_substr($colorstr,0,2)); - $colorstr = mb_substr($colorstr,2,mb_strlen($colorstr)); + $Blue = 0; + if(mb_strlen($ColourStr) > 1) { + $Blue = hexdec(mb_substr($ColourStr,0,2)); + $ColourStr = mb_substr($ColourStr,2,mb_strlen($ColourStr)); } - if(mb_strlen($colorstr) > 1) { - $alpha = hexdec(mb_substr($colorstr,0,2)); - $colorstr = mb_substr($colorstr,2,mb_strlen($colorstr)); + if(mb_strlen($ColourStr) > 1) { + $Alpha = hexdec(mb_substr($ColourStr,0,2)); + $ColourStr = mb_substr($ColourStr,2,mb_strlen($ColourStr)); } - if ( isset($alpha) ) - return array('red' => $red, 'green' => $green, 'blue' => $blue, 'alpha' => $alpha ); + if ( isset($Alpha) ) + return array('red' => $Red, 'green' => $Green, 'blue' => $Blue, 'alpha' => $Alpha ); else - return array('red' => $red, 'green' => $green, 'blue' => $blue ); + return array('red' => $Red, 'green' => $Green, 'blue' => $Blue ); } if (!function_exists('imagecreatefrompng')){ @@ -56,7 +56,7 @@ include('includes/footer.inc'); exit; } -$defaultimage = 'webERPsmall.png'; +$DefaultImage = 'webERPsmall.png'; // FOR APACHE if ( $_SERVER['PATH_TRANSLATED'][0] == '/' OR $_SERVER['PATH_TRANSLATED'][0]=='') { @@ -66,13 +66,13 @@ //Windows $pathsep = "\\"; } -$filepath = $_SESSION['part_pics_dir'] . $pathsep; +$FilePath = $_SESSION['part_pics_dir'] . $pathsep; -$stockid = trim(mb_strtoupper($_GET['StockID'])); +$StockID = trim(mb_strtoupper($_GET['StockID'])); if( isset($_GET['bgcolor']) ) - $bgcolor = $_GET['bgcolor']; + $BackgroundColour = $_GET['bgcolor']; if( isset($_GET['textcolor']) ) - $textcolor = $_GET['textcolor']; + $TextColour = $_GET['textcolor']; if( isset($_GET['width']) ) $width = $_GET['width']; if( isset($_GET['height']) ) @@ -89,7 +89,7 @@ } if( isset($_GET['transcolor'])) { $doTrans = true; - $transcolor = $_GET['transcolor']; + $TranspColour = $_GET['transcolor']; } if( isset($_GET['bevel']) ) { $bevel = $_GET['bevel']; @@ -111,17 +111,17 @@ // Extension requirements and Stock ID Isolation -if($stockid == '') { - $stockid = $defaultimage; +if($StockID == '') { + $StockID = $DefaultImage; $blanktext = true; } -$i = strrpos($stockid,'.'); +$i = strrpos($StockID,'.'); if( $i === false ) $type = 'png'; else { - $type = strtolower(mb_substr($stockid,$i+1,mb_strlen($stockid))); - $stockid = mb_substr($stockid,0,$i); + $type = strtolower(mb_substr($StockID,$i+1,mb_strlen($StockID))); + $StockID = mb_substr($StockID,0,$i); if($blanktext && !isset($text)) $text = ''; } @@ -132,22 +132,22 @@ $functype = 'jpeg'; } -$tmpfilename = $filepath.$stockid; +$tmpFileName = $FilePath.$StockID; // First check for an image this is not the type requested -if ( file_exists($tmpfilename.'.jpg') ) { - $filename = $stockid.'.jpg'; - $isjpeg = true; -} elseif (file_exists($tmpfilename.'.jpeg')) { - $filename = $stockid.'.jpeg'; - $isjpeg = true; -} elseif (file_exists($tmpfilename.'.png')) { - $filename = $stockid.'.png'; - $isjpeg = false; +if ( file_exists($tmpFileName.'.jpg') ) { + $FileName = $StockID.'.jpg'; + $IsJpeg = true; +} elseif (file_exists($tmpFileName.'.jpeg')) { + $FileName = $StockID.'.jpeg'; + $IsJpeg = true; +} elseif (file_exists($tmpFileName.'.png')) { + $FileName = $StockID.'.png'; + $IsJpeg = false; } else { - $filename = $defaultimage; - $isjpeg = $defaultisjpeg; + $FileName = $DefaultImage; + $IsJpeg = $DefaultIsJpeg; } -if( !$automake && !isset($filename) ) { +if( !$automake && !isset($FileName) ) { $title = _('Stock Image Retrieval ....'); include('includes/header.inc'); prnMsg( _('The Image could not be retrieved because it does not exist'), 'error'); @@ -159,9 +159,9 @@ /* $title = _('Stock Image Retrieval ....'); include('includes/header.inc'); - echo 'The image ' . $filename . ' using functype ' . $functype - . '<br /> The tmpfilename = ' . $tmpfilename . '<br /> The temppath = ' . $filepath . '<br />The stockid = ' . $stockid . '<br /> filepath . stockid .jpg = ' . $filepath . $stockid .'.jpg<br /> The result of file_exists($filepath . $stockid .jpg) =' . file_exists($filepath . $stockid .'.jpg') - . '<br />filepath = ' . $filepath + echo 'The image ' . $FileName . ' using functype ' . $functype + . '<br /> The tmpFileName = ' . $tmpFileName . '<br /> The temppath = ' . $FilePath . '<br />The stockid = ' . $StockID . '<br /> filepath . stockid .jpg = ' . $FilePath . $StockID .'.jpg<br /> The result of file_exists($FilePath . $StockID .jpg) =' . file_exists($FilePath . $StockID .'.jpg') + . '<br />filepath = ' . $FilePath . '<br />rootpath = ' . $rootpath; include('includes/footer.inc'); exit; @@ -170,7 +170,7 @@ // See if we need to automake this image -if( $automake && !isset($filename) || $useblank ) { +if( $automake && !isset($FileName) || $useblank ) { // Have we got height and width specs if( !isset($width) ) $width = 64; @@ -178,39 +178,39 @@ $height = 64; // Have we got a background color $im = imagecreate($width, $height); - if( isset($bgcolor) ) - $bgcolor = DecodeBgColor( $bgcolor ); + if( isset($BackgroundColour) ) + $BackgroundColour = DecodeBgColor( $BackgroundColour ); else - $bgcolor = DecodeBgColor( '#7F7F7F' ); - if( !isset($bgcolor['alpha']) ) { + $BackgroundColour = DecodeBgColor( '#7F7F7F' ); + if( !isset($BackgroundColour['alpha']) ) { $ixbgcolor = imagecolorallocate($im, - $bgcolor['red'],$bgcolor['green'],$bgcolor['blue']); + $BackgroundColour['red'],$BackgroundColour['green'],$BackgroundColour['blue']); } else { $ixbgcolor = imagecolorallocatealpha($im, - $bgcolor['red'],$bgcolor['green'],$bgcolor['blue'],$bgcolor['alpha']); + $BackgroundColour['red'],$BackgroundColour['green'],$BackgroundColour['blue'],$BackgroundColour['alpha']); } // Have we got a text color - if( isset($textcolor) ) - $textcolor = DecodeBgColor( $textcolor ); + if( isset($TextColour) ) + $TextColour = DecodeBgColor( $TextColour ); else - $textcolor = DecodeBgColor( '#000000' ); - if( !isset($textcolor['alpha']) ) { + $TextColour = DecodeBgColor( '#000000' ); + if( !isset($TextColour['alpha']) ) { $ixtextcolor = imagecolorallocate($im, - $textcolor['red'],$textcolor['green'],$textcolor['blue']); + $TextColour['red'],$TextColour['green'],$TextColour['blue']); } else { $ixtextcolor = imagecolorallocatealpha($im, - $textcolor['red'],$textcolor['green'],$textcolor['blue'],$textcolor['alpha']); + $TextColour['red'],$TextColour['green'],$TextColour['blue'],$TextColour['alpha']); } // Have we got transparency requirements - if( isset($transcolor) ) { - $transcolor = DecodeBgColor( $transcolor ); - if( $transcolor != $bgcolor ) { - if( !isset($textcolor['alpha']) ) { + if( isset($TranspColour) ) { + $TranspColour = DecodeBgColor( $TranspColour ); + if( $TranspColour != $BackgroundColour ) { + if( !isset($TextColour['alpha']) ) { $ixtranscolor = imagecolorallocate($im, - $transcolor['red'],$transcolor['green'],$transcolor['blue']); + $TranspColour['red'],$TranspColour['green'],$TranspColour['blue']); } else { $ixtranscolor = imagecolorallocatealpha($im, - $transcolor['red'],$transcolor['green'],$transcolor['blue'],$transcolor['alpha']); + $TranspColour['red'],$TranspColour['green'],$TranspColour['blue'],$TranspColour['alpha']); } } else { $ixtranscolor = $ixbgcolor; @@ -223,7 +223,7 @@ } if(!isset($text)) - $text = $stockid; + $text = $StockID; if(mb_strlen($text) > 0 ) { $fw = imagefontwidth($fontsize); $fh = imagefontheight($fontsize); @@ -237,35 +237,35 @@ } } else { - $tmpfilename = $filepath.$filename; - if( $isjpeg ) { - $im = imagecreatefromjpeg($tmpfilename); + $tmpFileName = $FilePath.$FileName; + if( $IsJpeg ) { + $im = imagecreatefromjpeg($tmpFileName); } else { - $im = imagecreatefrompng($tmpfilename); + $im = imagecreatefrompng($tmpFileName); } // Have we got a background color - if( isset($bgcolor) ) - $bgcolor = DecodeBgColor( $bgcolor ); + if( isset($BackgroundColour) ) + $BackgroundColour = DecodeBgColor( $BackgroundColour ); else - $bgcolor = DecodeBgColor( '#7F7F7F' ); - if( !isset($bgcolor['alpha']) ) { + $BackgroundColour = DecodeBgColor( '#7F7F7F' ); + if( !isset($BackgroundColour['alpha']) ) { $ixbgcolor = imagecolorallocate($im, - $bgcolor['red'],$bgcolor['green'],$bgcolor['blue']); + $BackgroundColour['red'],$BackgroundColour['green'],$BackgroundColour['blue']); } else { $ixbgcolor = imagecolorallocatealpha($im, - $bgcolor['red'],$bgcolor['green'],$bgcolor['blue'],$bgcolor['alpha']); + $BackgroundColour['red'],$BackgroundColour['green'],$BackgroundColour['blue'],$BackgroundColour['alpha']); } // Have we got a text color - if( isset($textcolor) ) - $textcolor = DecodeBgColor( $textcolor ); + if( isset($TextColour) ) + $TextColour = DecodeBgColor( $TextColour ); else - $textcolor = DecodeBgColor( '#000000' ); - if( !isset($textcolor['alpha']) ) { + $TextColour = DecodeBgColor( '#000000' ); + if( !isset($TextColour['alpha']) ) { $ixtextcolor = imagecolorallocate($im, - $textcolor['red'],$textcolor['green'],$textcolor['blue']); + $TextColour['red'],$TextColour['green'],$TextColour['blue']); } else { $ixtextcolor = imagecolorallocatealpha($im, - $textcolor['red'],$textcolor['green'],$textcolor['blue'],$textcolor['alpha']); + $TextColour['red'],$TextColour['green'],$TextColour['blue'],$TextColour['alpha']); } $sw = imagesx($im); $sh = imagesy($im); @@ -281,32 +281,32 @@ $im = $tmpim; unset($tmpim); - if( !isset($bgcolor['alpha']) ) { + if( !isset($BackgroundColour['alpha']) ) { $ixbgcolor = imagecolorallocate($im, - $bgcolor['red'],$bgcolor['green'],$bgcolor['blue']); + $BackgroundColour['red'],$BackgroundColour['green'],$BackgroundColour['blue']); } else { $ixbgcolor = imagecolorallocatealpha($im, - $bgcolor['red'],$bgcolor['green'],$bgcolor['blue'],$bgcolor['alpha']); + $BackgroundColour['red'],$BackgroundColour['green'],$BackgroundColour['blue'],$BackgroundColour['alpha']); } - if( !isset($textcolor['alpha']) ) { + if( !isset($TextColour['alpha']) ) { $ixtextcolor = imagecolorallocate($im, - $textcolor['red'],$textcolor['green'],$textcolor['blue']); + $TextColour['red'],$TextColour['green'],$TextColour['blue']); } else { $ixtextcolor = imagecolorallocatealpha($im, - $textcolor['red'],$textcolor['green'],$textcolor['blue'],$textcolor['alpha']); + $TextColour['red'],$TextColour['green'],$TextColour['blue'],$TextColour['alpha']); } //imagealphablending ( $im, false); } // Have we got transparency requirements - if( isset($transcolor) ) { - $transcolor = DecodeBgColor( $transcolor ); - if( $transcolor != $bgcolor ) { - if( !isset($textcolor['alpha']) ) { + if( isset($TranspColour) ) { + $TranspColour = DecodeBgColor( $TranspColour ); + if( $TranspColour != $BackgroundColour ) { + if( !isset($TextColour['alpha']) ) { $ixtranscolor = imagecolorallocate($im, - $transcolor['red'],$transcolor['green'],$transcolor['blue']); + $TranspColour['red'],$TranspColour['green'],$TranspColour['blue']); } else { $ixtranscolor = imagecolorallocatealpha($im, - $transcolor['red'],$transcolor['green'],$transcolor['blue'],$transcolor['alpha']); + $TranspColour['red'],$TranspColour['green'],$TranspColour['blue'],$TranspColour['alpha']); } } else { $ixtranscolor = $ixbgcolor; @@ -322,7 +322,7 @@ // $ixtextbgcolor = imagecolorallocatealpha($im, // 0,0,0,0); if(!isset($text)) - $text = $stockid; + $text = $StockID; if(mb_strlen($text) > 0 ) { $fw = imagefontwidth($fontsize); $fh = imagefontheight($fontsize); @@ -348,7 +348,7 @@ imageline($im, imagesx($im)-1,0,imagesx($im)-1, imagesy($im)-1, $silver); // right } // Set up headers -header('Content-Disposition: filename='.$stockid.'.'.$type); +header('Content-Disposition: filename='.$StockID.'.'.$type); header('Cache-Control: must-revalidate, post-check=0, pre-check=0'); header('Pragma: public'); header('Content-type: image/'.$style); Modified: trunk/MRPShortages.php =================================================================== --- trunk/MRPShortages.php 2011-07-05 10:36:13 UTC (rev 4624) +++ trunk/MRPShortages.php 2011-07-06 09:30:42 UTC (rev 4625) @@ -260,15 +260,15 @@ echo '<p class="page_title_text"><img src="'.$rootpath.'/css/'.$theme.'/images/inventory.png" title="' . _('Stock') . '" alt="" />' . ' ' . $title . '</p>'; - echo '<form action=' . $_SERVER['PHP_SELF'] . " method='post'>"; + echo '<form action="' . $_SERVER['PHP_SELF'] . '" method="post">'; echo '<input type="hidden" name="FormID" value="' . $_SESSION['FormID'] . '" />'; echo '<table class=selection>'; echo '</select></td></tr>'; echo '<tr><td>' . _('Inventory Category') . ':</td><td><select name="CategoryID">'; - echo '<option selected value="All">' . _('All Stock Categories'); + echo '<option selected value="All">' . _('All Stock Categories') .'</option>'; $sql = 'SELECT categoryid, - categorydescription - FROM stockcategory'; + categorydescription + FROM stockcategory"; $result = DB_query($sql,$db); while ($myrow = DB_fetch_array($result)) { echo '<option value="' . $myrow['categoryid'] . '">' . $myrow['categoryid'] . ' - ' .$myrow['categorydescription'] . '</option>'; Modified: trunk/PDFStockTransfer.php =================================================================== --- trunk/PDFStockTransfer.php 2011-07-05 10:36:13 UTC (rev 4624) +++ trunk/PDFStockTransfer.php 2011-07-06 09:30:42 UTC (rev 4625) @@ -2,6 +2,8 @@ /* $Id$*/ +/* This script is superseded by the PDFStockLocTransfer.php which produces a multiple item stock transfer listing - this was for the old individual stock transfers where there is just single items being transferred */ + include('includes/session.inc'); if (!isset($_GET['TransferNo'])){ Modified: trunk/ShipmentCosting.php =================================================================== --- trunk/ShipmentCosting.php 2011-07-05 10:36:13 UTC (rev 4624) +++ trunk/ShipmentCosting.php 2011-07-06 09:30:42 UTC (rev 4625) @@ -25,15 +25,15 @@ } $ShipmentHeaderSQL = "SELECT shipments.supplierid, - suppliers.suppname, - shipments.eta, - suppliers.currcode, - shipments.vessel, - shipments.voyageref, - shipments.closed - FROM shipments INNER JOIN suppliers - ON shipments.supplierid = suppliers.supplierid - WHERE shipments.shiptref = '" . $_GET['SelectedShipment'] . "'"; + suppliers.suppname, + shipments.eta, + suppliers.currcode, + shipments.vessel, + shipments.voyageref, + shipments.closed + FROM shipments INNER JOIN suppliers + ON shipments.supplierid = suppliers.supplierid + WHERE shipments.shiptref = '" . $_GET['SelectedShipment'] . "'"; $ErrMsg = _('Shipment').' '. $_GET['SelectedShipment'] . ' ' . _('cannot be retrieved because a database error occurred'); $GetShiptHdrResult = DB_query($ShipmentHeaderSQL,$db, $ErrMsg); @@ -46,7 +46,7 @@ $HeaderData = DB_fetch_array($GetShiptHdrResult); echo '<br />'; -echo '<table class=selection>'; +echo '<table class="selection">'; echo '<tr><th colspan=4><font size=3 color=navy>'._('Shipment Details').'</font></th></tr>'; echo '<tr> <td><b>'. _('Shipment') .': </td> @@ -140,15 +140,17 @@ echo '<br /><table cellpadding=2 colspan=7 class=selection>'; echo '<tr><th colspan=9><font color=navy size=3>' . _('Items on shipment'). '</font></th></tr>'; - $TableHeader = '<tr> <th>'. _('Item'). '</th> - <th>'. _('Quantity'). '<br />'. _('Invoiced'). '</th> - <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>'; + $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>'. _('Variance'). '</th> + <th>%</th> + </tr>'; echo $TableHeader; /*show the line items on the shipment with the value invoiced and shipt cost */ @@ -618,17 +620,18 @@ if ( isset($_GET['Close'])) { /* Only an opportunity to confirm user wishes to close */ // if the page was called with Close=Yes then show options to confirm OK to c - echo '<div class+"centre"><form method="POST" action="' . $_SERVER['PHP_SELF'] .'?SelectedShipment=' . $_GET['SelectedShipment'] . '">'; + echo '<div class="centre"> + <form method="POST" action="' . $_SERVER['PHP_SELF'] .'?SelectedShipment=' . $_GET['SelectedShipment'] . '">'; echo '<input type="hidden" name="FormID" value="' . $_SESSION['FormID'] . '" />'; if ($_SESSION['WeightedAverageCosting']==0){ /* We are standard costing - so show the option to update costs - under W. Avg cost updates are implicit */ echo _('Update Standard Costs') .':<select name="UpdateCost"> - <option selected value="Yes">'. _('Yes') . '</option> - <option value="No">'. _('No') . '</option> + <option selected value="Yes">'. _('Yes') . '</option> + <option value="No">'. _('No') . '</option> </select>'; } - echo '<br /><br /><input type=submit name="Close" VALUE="'. _('Confirm OK to Close'). '">'; + echo '<br /><br /><input type=submit name="Close" value="'. _('Confirm OK to Close'). '">'; echo '</form></div>'; } Modified: trunk/Z_CheckDebtorsControl.php =================================================================== --- trunk/Z_CheckDebtorsControl.php 2011-07-05 10:36:13 UTC (rev 4624) +++ trunk/Z_CheckDebtorsControl.php 2011-07-06 09:30:42 UTC (rev 4625) @@ -88,13 +88,12 @@ $GLOpening = $invTotal = $RecTotal = $GLClosing = $CalcTotal = $DiffTotal = 0; $j=0; - while ( $CurPeriod <= $_POST['ToPeriod'] ) - { + while ( $CurPeriod <= $_POST['ToPeriod'] ) { $SQL = "SELECT bfwd, - actual - FROM chartdetails - WHERE period = " . $CurPeriod . " - AND accountcode=" . $_SESSION['CompanyRecord']['debtorsact']; + actual + FROM chartdetails + WHERE period = " . $CurPeriod . " + AND accountcode=" . $_SESSION['CompanyRecord']['debtorsact']; $dtResult = DB_query($SQL,$db); $dtRow = DB_fetch_array($dtResult); DB_free_result($dtResult); @@ -165,7 +164,6 @@ echo '</table></form>'; } -echo '</td></tr></table>'; // end Page Border include('includes/footer.inc'); ?> \ No newline at end of file Modified: trunk/api/api_session.inc =================================================================== --- trunk/api/api_session.inc 2011-07-05 10:36:13 UTC (rev 4624) +++ trunk/api/api_session.inc 2011-07-06 09:30:42 UTC (rev 4625) @@ -40,7 +40,7 @@ $_SESSION['AttemptsCounter'] = 0; } -if ($_SESSION['HTTPS_Only']==1){ +if (isset($_SESSION['HTTPS_Only']) AND $_SESSION['HTTPS_Only']==1){ if ($_SERVER['HTTPS']!='on'){ prnMsg(_('webERP is configured to allow only secure socket connections. Pages must be called with https://') . ' .....','error'); exit; @@ -51,8 +51,7 @@ // value must be set in the script before header.inc is included. $SecurityGroups is an array of // arrays defining access for each group of users. These definitions can be modified by a system admin under setup - -if (!is_array($_SESSION['AllowedPageSecurityTokens']) AND !isset($AllowAnyone)) { +if (isset($_SESSION['AllowedPageSecurityTokens']) AND !is_array($_SESSION['AllowedPageSecurityTokens']) AND !isset($AllowAnyone)) { /* NO HTML output - but may need an XMLRPC style error message here. Lindsay: 12Jan10 $title = _('Account Error Report'); Modified: trunk/api/api_xml-rpc.php =================================================================== --- trunk/api/api_xml-rpc.php 2011-07-05 10:36:13 UTC (rev 4624) +++ trunk/api/api_xml-rpc.php 2011-07-06 09:30:42 UTC (rev 4625) @@ -1043,7 +1043,7 @@ unset($Description); unset($Parameter); unset($ReturnValue); - + $ReturnValue = _('Return Value Descriptions go here'); $Description = _('This function is used to insert a new Sales Credit to the webERP database.'); $Parameter[0]['name'] = _('Credit Details'); $Parameter[0]['description'] = _('An array of index/value items describing the credit. All values must be negative.'); @@ -1212,7 +1212,8 @@ unset($Description); unset($Parameter); unset($ReturnValue); - + $ReturnValue = _('Return Value Descriptions go here'); + $Description = _('Function Description go here'); $Parameter[0]['name'] = _('Account Details'); $Parameter[0]['description'] = _('An array of index/value items describing the GL Account and fields to set.'); $Parameter[1]['name'] = _('User name'); @@ -1242,6 +1243,9 @@ unset($Parameter); unset($ReturnValue); + $ReturnValue = _('Return Value Descriptions go here'); + $Description = _('Function Description go here'); + $Parameter[0]['name'] = _('Account Section Details'); $Parameter[0]['description'] = _('An array of index/value items describing the account section to insert.'); $Parameter[1]['name'] = _('User name'); @@ -1271,6 +1275,9 @@ unset($Parameter); unset($ReturnValue); + $ReturnValue = _('Return Value Descriptions go here'); + $Description = _('Function Description go here'); + $Parameter[0]['name'] = _('Account Group Details'); $Parameter[0]['description'] = _('An array of index/value items describing the account group to insert.'); $Parameter[1]['name'] = _('User name'); @@ -1299,7 +1306,7 @@ unset($Description); unset($Parameter); unset($ReturnValue); - + $Description = _('This function returns a list of stock location ids.'); $Parameter[0]['name'] = _('User name'); $Parameter[0]['description'] = _('A valid weberp username. This user should have security access to this data.'); @@ -1507,6 +1514,9 @@ unset($Parameter); unset($ReturnValue); + $ReturnValue = _('Return Value Descriptions go here'); + $Description = _('Function Description go here'); + $Parameter[0]['name'] = _('Sales Area Details'); $Parameter[0]['description'] = _('An array of index/value items describing the sales area to insert.'); $Parameter[1]['name'] = _('User name'); @@ -1626,6 +1636,9 @@ unset($Parameter); unset($ReturnValue); + $ReturnValue = _('Return Value Descriptions go here'); + $Description = _('Function Description go here'); + $Parameter[0]['name'] = _('Salesman Details'); $Parameter[0]['description'] = _('An array of index/value items describing the salesman to insert.'); $Parameter[1]['name'] = _('User name'); @@ -1773,6 +1786,9 @@ unset($Parameter); unset($ReturnValue); + $ReturnValue = _('Return Value Descriptions go here'); + $Description = _('Function Description go here'); + $Parameter[0]['name'] = _('Category Details'); $Parameter[0]['description'] = _('An array of index/value items describing the stock category to insert.'); $Parameter[1]['name'] = _('User name'); @@ -1802,6 +1818,9 @@ unset($Parameter); unset($ReturnValue); + $ReturnValue = _('Return Value Descriptions go here'); + $Description = _('Function Description go here'); + $Parameter[0]['name'] = _('Category Details'); $Parameter[0]['description'] = _('An array of index/value items describing the stock category to modify.'); $Parameter[1]['name'] = _('User name'); @@ -1889,6 +1908,9 @@ unset($Parameter); unset($ReturnValue); + $ReturnValue = _('Return Value Descriptions go here'); + $Description = _('Function Description go here'); + $Parameter[0]['name'] = _('Field Name'); $Parameter[0]['description'] = _('The field name to search on.'); $Parameter[1]['name'] = _('Match Criteria'); @@ -1922,6 +1944,9 @@ unset($Parameter); unset($ReturnValue); + $ReturnValue = _('Return Value Descriptions go here'); + $Description = _('Function Description go here'); + $Parameter[0]['name'] = _('Label Name'); $Parameter[0]['description'] = _('The category label to search on.'); $Parameter[1]['name'] = _('Match Criteria'); Modified: trunk/doc/Change.log =================================================================== --- trunk/doc/Change.log 2011-07-05 10:36:13 UTC (rev 4624) +++ trunk/doc/Change.log 2011-07-06 09:30:42 UTC (rev 4625) @@ -1,5 +1,6 @@ webERP Change Log +5/7/11 Phil: Amend menu to use PDFStockLocTransfer.php to reprint transfer list - as reported by Ron Wong 3/7/11 Phil: changed all strpos to mb_strpos 3/7/11 Phil: changed all strtoupper to mb_strtoupper 3/7/11 Phil: changed all substr to mb_substr Modified: trunk/geo_displaymap_customers.php =================================================================== --- trunk/geo_displaymap_customers.php 2011-07-05 10:36:13 UTC (rev 4624) +++ trunk/geo_displaymap_customers.php 2011-07-06 09:30:42 UTC (rev 4625) @@ -1,7 +1,7 @@ <?php /* $Id$*/ -//$PageSecurity = 3; + $title = _('Geocoded Customer Branches Report'); include ('includes/session.inc'); @@ -13,14 +13,14 @@ $result = DB_query($sql, $db, $ErrMsg); $myrow = DB_fetch_array($result); -$api_key = $myrow['geocode_key']; -$center_long = $myrow['center_long']; -$center_lat = $myrow['center_lat']; -$map_height = $myrow['map_height']; -$map_width = $myrow['map_width']; -$map_host = $myrow['map_host']; +$Api_Key = $myrow['geocode_key']; +$Center_Long = $myrow['center_long']; +$Center_Lat = $myrow['center_lat']; +$Map_Height = $myrow['map_height']; +$Map_Width = $myrow['map_width']; +$Map_Host = $myrow['map_host']; -echo '<script src="http://' . $map_host . '/maps?file=api&v=2&key=' . $api_key . '"'; +echo '<script src="http://' . $Map_Host . '/maps?file=api&v=2&key=' . $Api_Key . '"'; echo ' type="text/javascript"></script>'; echo ' <script type="text/javascript">'; echo " //<![CDATA[ "; ?> @@ -51,7 +51,7 @@ map.addControl(new GSmallMapControl()); map.addControl(new GMapTypeControl()); -<? echo 'map.setCenter(new GLatLng(' . $center_lat . ', ' . $center_long . '), 10);'; ?> +<? echo 'map.setCenter(new GLatLng(' . $Center_Lat . ', ' . $Center_Long . '), 10);'; ?> GDownloadUrl("geocode_genxml_customers.php", function(data) { var xml = GXml.parse(data); @@ -83,7 +83,7 @@ <body onload="load()" onunload="GUnload()"> <p> -<? echo '<div class="centre" id="map" style="width: ' . $map_width . 'px; height: ' . $map_height . 'px"></div>'; ?> +<? echo '<div class="centre" id="map" style="width: ' . $Map_Width . 'px; height: ' . $Map_Height . 'px"></div>'; ?> </p> </body> <? Modified: trunk/geo_displaymap_suppliers.php =================================================================== --- trunk/geo_displaymap_suppliers.php 2011-07-05 10:36:13 UTC (rev 4624) +++ trunk/geo_displaymap_suppliers.php 2011-07-06 09:30:42 UTC (rev 4625) @@ -1,7 +1,7 @@ <?php /* $Id$*/ -//$PageSecurity = 3; + $title = _('Geocoded Supplier Report'); include ('includes/session.inc'); @@ -13,14 +13,14 @@ $result = DB_query($sql, $db, $ErrMsg); $myrow = DB_fetch_array($result); -$api_key = $myrow['geocode_key']; -$center_long = $myrow['center_long']; -$center_lat = $myrow['center_lat']; -$map_height = $myrow['map_height']; -$map_width = $myrow['map_width']; -$map_host = $myrow['map_host']; +$Api_Key = $myrow['geocode_key']; +$Center_Long = $myrow['center_long']; +$Center_Lat = $myrow['center_lat']; +$Map_Height = $myrow['map_height']; +$Map_Width = $myrow['map_width']; +$Map_Host = $myrow['map_host']; -echo '<script src="http://' . $map_host . '/maps?file=api&v=2&key=' . $api_key . '"'; +echo '<script src="http://' . $Map_Host . '/maps?file=api&v=2&key=' . $Api_Key . '"'; echo ' type="text/javascript"></script>'; echo ' <script type="text/javascript">'; echo " //<![CDATA[ "; ?> @@ -51,7 +51,7 @@ map.addControl(new GSmallMapControl()); map.addControl(new GMapTypeControl()); -<? echo 'map.setCenter(new GLatLng(' . $center_lat . ', ' . $center_long . '), 10);'; ?> +<? echo 'map.setCenter(new GLatLng(' . $Center_Lat . ', ' . $Center_Long . '), 10);'; ?> GDownloadUrl("geocode_genxml_suppliers.php", function(data) { var xml = GXml.parse(data); @@ -83,7 +83,7 @@ <body onload="load()" onunload="GUnload()"> <p> -<? echo '<div class="centre" id="map" style="width: ' . $map_width . 'px; height: ' . $map_height . 'px"></div>'; ?> +<? echo '<div class="centre" id="map" style="width: ' . $Map_Width . 'px; height: ' . $Map_Height . 'px"></div>'; ?> </p> </body> <? Modified: trunk/includes/session.inc =================================================================== --- trunk/includes/session.inc 2011-07-05 10:36:13 UTC (rev 4624) +++ trunk/includes/session.inc 2011-07-06 09:30:42 UTC (rev 4625) @@ -291,7 +291,8 @@ echo '</td> </tr> </table> - </td>'; + </td> + </tr>'; include($PathPrefix . 'includes/footer.inc'); exit; Modified: trunk/index.php =================================================================== --- trunk/index.php 2011-07-05 10:36:13 UTC (rev 4624) +++ trunk/index.php 2011-07-06 09:30:42 UTC (rev 4625) @@ -714,7 +714,7 @@ </tr> <tr> <td class="menu_group_item"> - <?php echo '<p>• <a href="' . $rootpath . '/PDFStockTransfer.php">' . _('Stock Transfer Note') . '</a></p>'; ?> + <?php echo '<p>• <a href="' . $rootpath . '/PDFStockLocTransfer.php">' . _('Stock Transfer Note') . '</a></p>'; ?> </td> </tr> <tr> Modified: trunk/locale/it_IT.utf8/LC_MESSAGES/messages.mo =================================================================== (Binary files differ) Modified: trunk/locale/it_IT.utf8/LC_MESSAGES/messages.po =================================================================== --- trunk/locale/it_IT.utf8/LC_MESSAGES/messages.po 2011-07-05 10:36:13 UTC (rev 4624) +++ trunk/locale/it_IT.utf8/LC_MESSAGES/messages.po 2011-07-06 09:30:42 UTC (rev 4625) @@ -1,5 +1,4 @@ # SOME DESCRIPTIVE TITLE. -# Copyright (C) 2005 Logic Works Ltd # This file is distributed under the GPL # FIRST AUTHOR <xlyz> .2004/2005 # @@ -7,9 +6,9 @@ msgstr "" "Project-Id-Version: Weberp\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2011-07-02 20:11+1200\n" -"PO-Revision-Date: 2011-03-04 18:03+0000\n" -"Last-Translator: Martino Barbon <Unknown>\n" +"POT-Creation-Date: 2011-05-30 20:51+1200\n" +"PO-Revision-Date: 2011-07-05 12:26+0100\n" +"Last-Translator: Gioacchino Cipriano <gio...@gm...>\n" "Language-Team: italian <none>\n" "MIME-Version: 1.0\n" "Content-Type: text/plain; charset=UTF-8\n" @@ -18,31 +17,25 @@ "X-Generator: Launchpad (build 12696)\n" "Language: \n" -#: AccountGroups.php:7 index.php:1296 +#: AccountGroups.php:7 +#: index.php:1296 msgid "Account Groups" msgstr "Gestione dei conti" #: AccountGroups.php:17 -msgid "" -"An error occurred in retrieving the account groups of the parent account " -"group during the check for recursion" -msgstr "" -"È verificato un errore durante il recupero dei gruppi conto del gruppo di " -"conto genitore durante il controllo per la ricorsione" +msgid "An error occurred in retrieving the account groups of the parent account group during the check for recursion" +msgstr "È verificato un errore durante il recupero dei gruppi conto del gruppo di conto genitore durante il controllo per la ricorsione" #: AccountGroups.php:18 -msgid "" -"The SQL that was used to retrieve the account groups of the parent account " -"group and that failed in the process was" -msgstr "" -"Il SQL che è stata utilizzata per recuperare i gruppi conto del gruppo di " -"account principale e che ha fallito nel processo è stato" +msgid "The SQL that was used to retrieve the account groups of the parent account group and that failed in the process was" +msgstr "Il SQL che è stata utilizzata per recuperare i gruppi conto del gruppo di account principale e che ha fallito nel processo è stato" -#: AccountGroups.php:55 AccountGroups.php:92 AccountGroups.php:176 -#: AccountGroups.php:186 +#: AccountGroups.php:55 +#: AccountGroups.php:92 +#: AccountGroups.php:175 +#: AccountGroups.php:185 msgid "The SQL that was used to retrieve the information was" -msgstr "" -"Il SQL che è stato utilizzato per recuperare le informazioni sono state" +msgstr "Il SQL che è stato utilizzato per recuperare le informazioni sono state" #: AccountGroups.php:56 msgid "Could not check whether the group exists because" @@ -54,415 +47,774 @@ #: AccountGroups.php:69 msgid "The account group name cannot contain the character" -msgstr "Il nome del conto non può contenere il carattere" +msgstr "Il nome del conto non può contenere il carattere" -#: AccountGroups.php:69 TaxCategories.php:31 TaxProvinces.php:30 +#: AccountGroups.php:69 +#: TaxCategories.php:31 +#: TaxProvinces.php:30 #: UnitsOfMeasure.php:30 msgid "or the character" msgstr "o il carattere" #: AccountGroups.php:75 msgid "The account group name must be at least one character long" -msgstr "Il nome del gruppo account deve essere almeno un carattere a lungo" +msgstr "Il nome del gruppo account deve essere lungo almeno un carattere" #: AccountGroups.php:82 -msgid "" -"The parent account group selected appears to result in a recursive account " -"structure - select an alternative parent account group or make this group a " -"top level account group" -msgstr "" -"Il gruppo di account principale selezionato sembra comportare una struttura " -"ricorsiva conto - selezionare un'alternativa gruppo di account " -"principale o fanno di questo gruppo un gruppo di alto livello di account" +msgid "The parent account group selected appears to result in a recursive account structure - select an alternative parent account group or make this group a top level account group" +msgstr "Il gruppo di account principale selezionato sembra comportare una struttura ricorsiva conto - selezionare un'alternativa gruppo di account principale o fanno di questo gruppo un gruppo di alto livello di account" #: AccountGroups.php:93 msgid "Could not check whether the group is recursive because" msgstr "Impossibile verificare se il gruppo è ricorsivo perché" -#: AccountGroups.php:101 -msgid "" -"Since this account group is a child group, the sequence in the trial " -"balance, the section in the accounts and whether or not the account group " -"appears in the balance sheet or profit and loss account are all properties " -"inherited from the parent account group. Any changes made to these fields " -"will have no effect." -msgstr "" - -#: AccountGroups.php:106 +#: AccountGroups.php:105 msgid "The section in accounts must be an integer" msgstr "Il codice del gruppo di conti deve essere un numero intero" -#: AccountGroups.php:112 +#: AccountGroups.php:111 msgid "The sequence in the trial balance must be an integer" -msgstr "" -"Il numero che indica la posizione nel bilancio deve essere un numero intero" +msgstr "Il numero che indica la posizione nel bilancio deve essere un numero intero" -#: AccountGroups.php:118 +#: AccountGroups.php:117 msgid "The sequence in the TB must be numeric and less than" msgstr "La sequenza della TB deve essere numerico e meno" -#: AccountGroups.php:135 +#: AccountGroups.php:134 msgid "An error occurred in updating the account group" -msgstr "È verificato un errore nell'aggiornamento del gruppo di account" +msgstr "Si è verificato un errore nell'aggiornamento del gruppo di account" -#: AccountGroups.php:136 +#: AccountGroups.php:135 msgid "The SQL that was used to update the account group was" -msgstr "" -"Il SQL che è stato utilizzato per aggiornare il gruppo di conto è stato" +msgstr "Il SQL che è stato utilizzato per aggiornare il gruppo di conto è stato" -#: AccountGroups.php:138 AccountSections.php:104 PaymentMethods.php:82 +#: AccountGroups.php:137 +#: AccountSections.php:104 +#: PaymentMethods.php:82 msgid "Record Updated" msgstr "Record aggiornato" -#: AccountGroups.php:156 +#: AccountGroups.php:155 msgid "An error occurred in inserting the account group" msgstr "È verificato un errore nel mettere il gruppo di account" -#: AccountGroups.php:157 +#: AccountGroups.php:156 msgid "The SQL that was used to insert the account group was" -msgstr "" -"L'SQL che è stato utilizzato per inserire il gruppo di conto è stato" +msgstr "L'SQL che è stato utilizzato per inserire il gruppo di conto è stato" -#: AccountGroups.php:158 AccountSections.php:116 PaymentMethods.php:106 +#: AccountGroups.php:157 +#: AccountSections.php:116 +#: PaymentMethods.php:106 msgid "Record inserted" msgstr "Record inserito" -#: AccountGroups.php:175 +#: AccountGroups.php:174 msgid "An error occurred in retrieving the group information from chartmaster" -msgstr "" -"È verificato un errore di estrarre le informazioni sul gruppo da chartmaster" +msgstr "È verificato un errore di estrarre le informazioni sul gruppo da chartmaster" +#: AccountGroups.php:179 +msgid "Cannot delete this account group because general ledger accounts have been created using this group" +msgstr "Impossibile eliminare questo gruppo di conti, perché ci sono conti di contabilità generale che sono stati creati utilizzando questo gruppo" + #: AccountGroups.php:180 -msgid "" -"Cannot delete this account group because general ledger accounts have been " -"created using this group" -msgstr "" -"Non ĂŠ possibile cancellare questo conto perchĂŠ ci sono dei sottoconti che " -"vi fanno riferimento" - -#: AccountGroups.php:181 AccountGroups.php:191 AccountSections.php:137 -#: Areas.php:116 Areas.php:125 BankAccounts.php:158 CreditStatus.php:123 -#: Currencies.php:164 Currencies.php:172 Currencies.php:180 -#: CustomerBranches.php:286 CustomerBranches.php:296 CustomerBranches.php:306 -#: CustomerBranches.php:316 Customers.php:312 Customers.php:321 -#: Customers.php:329 Customers.php:337 CustomerTypes.php:147 -#: CustomerTypes.php:157 Factors.php:134 FixedAssetCategories.php:130 -#: GLAccounts.php:80 GLAccounts.php:94 Locations.php:244 Locations.php:252 -#: Locations.php:261 Locations.php:269 Locations.php:277 Locations.php:285 -#: Locations.php:293 Locations.php:301 MRPDemandTypes.php:87 -#: PaymentMethods.php:140 PaymentTerms.php:147 PaymentTerms.php:154 -#: PcExpenses.php:152 SalesCategories.php:125 SalesCategories.php:133 -#: SalesPeople.php:149 SalesPeople.php:156 SalesTypes.php:150 -#: SalesTypes.php:160 Shippers.php:82 Shippers.php:94 StockCategories.php:179 -#: Stocks.php:475 Stocks.php:484 Stocks.php:492 Stocks.php:500 Stocks.php:508 -#: Stocks.php:516 Suppliers.php:609 Suppliers.php:618 Suppliers.php:626 -#: SupplierTypes.php:145 TaxCategories.php:131 TaxGroups.php:127 -#: TaxGroups.php:134 TaxProvinces.php:125 UnitsOfMeasure.php:138 -#: WorkCentres.php:89 WorkCentres.php:95 WWW_Access.php:83 +#: AccountGroups.php:190 +#: AccountSections.php:137 +#: Areas.php:116 +#: Areas.php:125 +#: BankAccounts.php:157 +#: CreditStatus.php:125 +#: Currencies.php:143 +#: Currencies.php:151 +#: Currencies.php:158 +#: CustomerBranches.php:286 +#: CustomerBranches.php:296 +#: CustomerBranches.php:306 +#: CustomerBranches.php:316 +#: Customers.php:311 +#: Customers.php:320 +#: Customers.php:328 +#: Customers.php:336 +#: CustomerTypes.php:147 +#: CustomerTypes.php:157 +#: Factors.php:134 +#: FixedAssetCategories.php:130 +#: GLAccounts.php:80 +#: GLAccounts.php:94 +#: Locations.php:244 +#: Locations.php:252 +#: Locations.php:261 +#: Locations.php:269 +#: Locations.php:277 +#: Locations.php:285 +#: Locations.php:293 +#: Locations.php:301 +#: MRPDemandTypes.php:87 +#: PaymentMethods.php:140 +#: PaymentTerms.php:147 +#: PaymentTerms.php:154 +#: PcExpenses.php:152 +#: SalesCategories.php:125 +#: SalesCategories.php:133 +#: SalesPeople.php:144 +#: SalesPeople.php:151 +#: SalesTypes.php:145 +#: SalesTypes.php:155 +#: Shippers.php:82 +#: Shippers.php:94 +#: StockCategories.php:179 +#: Stocks.php:475 +#: Stocks.php:484 +#: Stocks.php:492 +#: Stocks.php:500 +#: Stocks.php:508 +#: Stocks.php:516 +#: Suppliers.php:609 +#: Suppliers.php:618 +#: Suppliers.php:626 +#: SupplierTypes.php:145 +#: TaxCategories.php:131 +#: TaxGroups.php:127 +#: TaxGroups.php:134 +#: TaxProvinces.php:125 +#: UnitsOfMeasure.php:138 +#: WorkCentres.php:89 +#: WorkCentres.php:95 +#: WWW_Access.php:83 msgid "There are" msgstr "Ci sono" -#: AccountGroups.php:181 +#: AccountGroups.php:180 msgid "general ledger accounts that refer to this account group" msgstr "sottoconti fanno riferimento a questo conto" -#: AccountGroups.php:185 +#: AccountGroups.php:184 msgid "An error occurred in retrieving the parent group information" -msgstr "" -"È verificato un errore di estrarre le informazioni del gruppo di genitore" +msgstr "È verificato un errore di estrarre le informazioni del gruppo di genitore" +#: AccountGroups.php:189 +msgid "Cannot delete this account group because it is a parent account group of other account group(s)" +msgstr "Impossibile eliminare questo gruppo considerazione perché si tratta di un gruppo di account principale del gruppo di altri account" + #: AccountGroups.php:190 -msgid "" -"Cannot delete this account group because it is a parent account group of " -"other account group(s)" -msgstr "" -"Impossibile eliminare questo gruppo considerazione perché si tratta di un " -"gruppo di account principale del gruppo di altri account (s)" - -#: AccountGroups.php:191 msgid "account groups that have this group as its/there parent account group" -msgstr "" -"gruppi di account che hanno questo gruppo come il suo / gruppo di " -"appartenenza ci conto" +msgstr "gruppi di account che hanno questo gruppo come il suo / gruppo di appartenenza ci conto" -#: AccountGroups.php:194 +#: AccountGroups.php:193 msgid "An error occurred in deleting the account group" -msgstr "" -"È verificato un errore durante l'eliminazione del gruppo di account" +msgstr "Si è verificato un errore durante l'eliminazione del gruppo di account" -#: AccountGroups.php:195 +#: AccountGroups.php:194 msgid "The SQL that was used to delete the account group was" -msgstr "" -"L'SQL che è stato utilizzato per eliminare il gruppo di conto è stato" +msgstr "L'SQL che è stato utilizzato per eliminare il gruppo di conto è stato" -#: AccountGroups.php:197 +#: AccountGroups.php:196 msgid "group has been deleted" msgstr "e' stato cancellato" -#: AccountGroups.php:222 +#: AccountGroups.php:221 msgid "The sql that was used to retrieve the account group information was " -msgstr "" -"L'SQL che è stato utilizzato per recuperare le informazioni di account " -"di gruppo è stato " +msgstr "L'SQL che è stato utilizzato per recuperare le informazioni di account di gruppo è stato " -#: AccountGroups.php:223 +#: AccountGroups.php:222 msgid "Could not get account groups because" -msgstr "Non ĂŠ possibile estrarre il piano dei conti perchè" +msgstr "Non àŠ possibile estrarre il piano dei conti perchè" -#: AccountGroups.php:225 AccountSections.php:175 AddCustomerContacts.php:25 -#: AddCustomerContacts.php:28 AddCustomerNotes.php:101 -#: AddCustomerTypeNotes.php:95 AgedDebtors.php:454 AgedSuppliers.php:268 -#: Areas.php:144 AuditTrail.php:11 BankReconciliation.php:13 -#: BOMExtendedQty.php:259 BOMIndented.php:246 BOMIndentedReverse.php:236 -#: BOMInquiry.php:171 BOMListing.php:112 BOMs.php:208 BOMs.php:798 -#: COGSGLPostings.php:18 CompanyPreferences.php:153 CounterSales.php:1983 -#: CounterSales.php:2107 Credit_Invoice.php:255 CreditStatus.php:20 -#: Currencies.php:28 CustEDISetup.php:17 DailyBankTransactions.php:10 -#: DebtorsAtPeriodEnd.php:124 DiscountCategories.php:10 -#: DiscountCategories.php:128 DiscountMatrix.php:16 EDIMessageFormat.php:104 -#: FixedAssetLocations.php:9 FixedAssetRegister.php:13 -#: FixedAssetRegister.php:238 FixedAssetTransfer.php:31 FormDesigner.php:129 -#: GLBalanceSheet.php:351 GLBudgets.php:28 GLJournal.php:228 -#: InventoryPlanning.php:374 InventoryPlanningPrefSupplier.php:474 -#: Labels.php:117 Labels.php:273 MRPReport.php:515 OutstandingGRNs.php:150 -#: PcAssignCashToTab.php:56 PcAssignCashToTab.php:130 -#: PcAssignCashToTab.php:146 PcAssignCashToTab.php:183 PDFPickingList.php:28 -#: PDFPrintLabel.php:131 PDFStockLocTransfer.php:21 -#: PO_AuthorisationLevels.php:10 POReport.php:60 POReport.php:64 -#: POReport.php:68 PO_SelectOSPurchOrder.php:133 PricesBasedOnMarkUp.php:11 -#: Prices_Customer.php:39 Prices.php:30 PurchData.php:138 PurchData.php:249 -#: PurchData.php:268 RecurringSalesOrders.php:310 SalesAnalReptCols.php:51 -#: SalesAnalRepts.php:11 SalesCategories.php:11 SalesGLPostings.php:17 -#: SalesGraph.php:34 SalesPeople.php:20 SalesTypes.php:20 SelectAsset.php:45 -#: SelectCompletedOrder.php:11 SelectContract.php:78 SelectCreditItems.php:202 -#: SelectCreditItems.php:270 SelectCustomer.php:323 SelectGLAccount.php:19 -#: SelectGLAccount.php:79 SelectOrderItems.php:618 SelectOrderItems.php:1463 -#: SelectOrderItems.php:1583 SelectProduct.php:485 SelectSalesOrder.php:454 -#: SelectSupplier.php:9 SelectSupplier.php:192 SelectWorkOrder.php:9 -#: SelectWorkOrder.php:145 ShipmentCosting.php:11 Shipments.php:17 -#: Shippers.php:123 Shippers.php:159 Shipt_Select.php:8 -#: StockLocMovements.php:13 StockLocStatus.php:26 Suppliers.php:302 -#: SupplierTenders.php:260 SupplierTenders.php:317 SupplierTransInquiry.php:11 -#: TaxGroups.php:15 TaxProvinces.php:10 TopItems.php:65 -#: WhereUsedInquiry.php:18 WorkCentres.php:110 WorkCentres.php:157 -#: WorkOrderCosting.php:12 WorkOrderEntry.php:10 WorkOrderIssue.php:20 -#: WorkOrderReceive.php:13 WorkOrderStatus.php:41 WWW_Access.php:11 -#: WWW_Users.php:32 Z_BottomUpCosts.php:51 +#: AccountGroups.php:224 +#: AccountSections.php:175 +#: AddCustomerContacts.php:25 +#: AddCustomerContacts.php:28 +#: AddCustomerNotes.php:97 +#: AddCustomerTypeNotes.php:94 +#: AgedDebtors.php:454 +#: AgedSuppliers.php:277 +#: Areas.php:144 +#: AuditTrail.php:11 +#: BankReconciliation.php:13 +#: BOMExtendedQty.php:272 +#: BOMIndented.ph... [truncated message content] |
From: <dai...@us...> - 2011-07-06 09:30:53
|
Revision: 4625 http://web-erp.svn.sourceforge.net/web-erp/?rev=4625&view=rev Author: daintree Date: 2011-07-06 09:30:42 +0000 (Wed, 06 Jul 2011) Log Message: ----------- various Modified Paths: -------------- trunk/GeocodeSetup.php trunk/GetStockImage.php trunk/MRPShortages.php trunk/PDFStockTransfer.php trunk/ShipmentCosting.php trunk/Z_CheckDebtorsControl.php trunk/api/api_session.inc trunk/api/api_xml-rpc.php trunk/doc/Change.log trunk/geo_displaymap_customers.php trunk/geo_displaymap_suppliers.php trunk/includes/session.inc trunk/index.php trunk/locale/it_IT.utf8/LC_MESSAGES/messages.mo trunk/locale/it_IT.utf8/LC_MESSAGES/messages.po Modified: trunk/GeocodeSetup.php =================================================================== --- trunk/GeocodeSetup.php 2011-07-05 10:36:13 UTC (rev 4624) +++ trunk/GeocodeSetup.php 2011-07-06 09:30:42 UTC (rev 4625) @@ -29,14 +29,14 @@ //first off validate inputs are sensible $sql="SELECT count(geocodeid) - FROM geocode_param WHERE geocodeid='".$_POST['geocodeid']."'"; + FROM geocode_param WHERE geocodeid='".$_POST['GeoCodeID']."'"; $result=DB_query($sql, $db); $myrow=DB_fetch_row($result); if ($myrow[0]!=0 and !isset($SelectedParam)) { $InputError = 1; prnMsg( _('That geocode ID already exists in the database'),'error'); - $Errors[$i] = 'geocodeid'; + $Errors[$i] = 'GeoCodeID'; $i++; } @@ -46,14 +46,14 @@ /*SelectedParam could also exist if submit had not been clicked this code would not run in this case cos submit is false of course see the delete code below*/ - if (isset($_POST['geocode_key']) and isset($_POST['geocode_key']) ){ + if (isset($_POST['GeoCode_Key']) and isset($_POST['GeoCode_Key']) ){ $sql = "UPDATE geocode_param SET - geocode_key='" . $_POST['geocode_key'] . "', - center_long='" . $_POST['center_long'] . "', - center_lat='" . $_POST['center_lat'] . "', - map_height='" . $_POST['map_height'] . "', - map_width='" . $_POST['map_width'] . "', - map_host='" . $_POST['map_host'] . "' + geocode_key='" . $_POST['GeoCode_Key'] . "', + center_long='" . $_POST['Center_Long'] . "', + center_lat='" . $_POST['Center_Lat'] . "', + map_height='" . $_POST['Map_Height'] . "', + map_width='" . $_POST['Map_Width'] . "', + map_host='" . $_POST['Map_Host'] . "' WHERE geocodeid = '" . $SelectedParam . "'"; } $msg = _('The geocode status record has been updated'); @@ -62,48 +62,42 @@ /*Selected Param is null cos no item selected on first time round so must be adding a record must be submitting new entries in the new status code form */ - if (isset($_POST['geocode_key']) and $_POST['geocode_key']>0){ + if (isset($_POST['GeoCode_Key']) and $_POST['GeoCode_Key']>0){ - $sql = "INSERT INTO geocode_param ( - geocodeid, - geocode_key, - center_long, - center_lat, - map_height, - map_width, - map_host) - VALUES (" . " - '', - '" . $_POST['geocode_key'] . "', - '" . $_POST['center_long'] . "', - '" . $_POST['center_lat'] . "', - '" . $_POST['map_height'] . "', - '" . $_POST['map_width'] . "', - '" . $_POST['map_host'] . "' - )"; + $sql = "INSERT INTO geocode_param (geocodeid, + geocode_key, + center_long, + center_lat, + map_height, + map_width, + map_host) + VALUES ('', + '" . $_POST['GeoCode_Key'] . "', + '" . $_POST['Center_Long'] . "', + '" . $_POST['Center_Lat'] . "', + '" . $_POST['Map_Height'] . "', + '" . $_POST['Map_Width'] . "', + '" . $_POST['Map_Host'] . "')"; } else { - $sql = "INSERT INTO geocode_param ( - geocodeid, - geocode_key, - center_long, - center_lat, - map_height, - map_width, - map_host) - VALUES ( - '" . $_POST['geocodeid'] . "', - '" . $_POST['geocode_key'] . "', - '" . $_POST['center_long'] . "', - '" . $_POST['center_lat'] . "', - '" . $_POST['map_height'] . "', - '" . $_POST['map_width'] . "', - '" . $_POST['map_host'] . " - ')"; + $sql = "INSERT INTO geocode_param (geocodeid, + geocode_key, + center_long, + center_lat, + map_height, + map_width, + map_host) + VALUES ('" . $_POST['GeoCodeID'] . "', + '" . $_POST['GeoCode_Key'] . "', + '" . $_POST['Center_Long'] . "', + '" . $_POST['Center_Lat'] . "', + '" . $_POST['Map_Height'] . "', + '" . $_POST['Map_Width'] . "', + '" . $_POST['Map_Host'] . "')"; } $msg = _('A new geocode status record has been inserted'); unset ($SelectedParam); - unset ($_POST['geocode_key']); + unset ($_POST['GeoCode_Key']); } //run the SQL from either of the above possibilites $result = DB_query($sql,$db); @@ -128,7 +122,14 @@ links to delete or edit each. These will call the same page again and allow update/input or deletion of the records*/ - $sql = "SELECT geocodeid, geocode_key, center_long, center_lat, map_height, map_width, map_host FROM geocode_param"; + $sql = "SELECT geocodeid, + geocode_key, + center_long, + center_lat, + map_height, + map_width, + map_host + FROM geocode_param"; $result = DB_query($sql, $db); echo '<p class="page_title_text"><img src="'.$rootpath.'/css/'.$theme.'/images/maintenance.png" title="' . _('Geocode Setup') . '" alt="" />'. @@ -137,17 +138,19 @@ '<a href="http://code.google.com/apis/maps/signup.html" target="_blank"> http://code.google.com/apis/maps/signup.html</a></b>'; echo '<div class="centre"><p>'. _('Find the lat/long for your map center point at ') . '<a href="http://www.batchgeocode.com/lookup/" target="_blank">http://www.batchgeocode.com/lookup/</a></b>'; - echo '<p>'. _('Set the maps centre point using the Center Longitude and Center Latitude. Set the maps screen size using the height and width in pixels (px)').'</div><br />'; + prnMsg(_('Set the maps centre point using the Center Longitude and Center Latitude. Set the maps screen size using the height and width in pixels (px)'),'info'); + echo '</div><br />'; echo '<table border=1>'; echo '<tr> - <th>'. _('Geocode ID') .'</th> - <th>'. _('Geocode Key') .'</th> - <th>'. _('Center Longitude') .'</th> - <th>'. _('Center Latitude') .'</th> - <th>'. _('Map height (px)') .'</th> - <th>'. _('Map width (px)') .'</th> - <th>'. _('Map host') .'</th>'; + <th>'. _('Geocode ID') .'</th> + <th>'. _('Geocode Key') .'</th> + <th>'. _('Center Longitude') . '</th> + <th>'. _('Center Latitude') . '</th> + <th>'. _('Map height (px)') . '</th> + <th>'. _('Map width (px)') . '</th> + <th>'. _('Map host') . '</th> + </tr>'; $k=0; //row colour counter while ($myrow=DB_fetch_row($result)) { @@ -161,27 +164,27 @@ } printf('<td>%s</td> - <td>%s</td> - <td>%s</td> - <td>%s</td> - <td>%s</td> - <td>%s</td> - <td>%s</td> - <td><a href=\'%s?SelectedParam=%s\'>' . _('Edit') . '</a></td> - <td><a href=\'%s?SelectedParam=%s&delete=%s\'>'. _('Delete') .'</a></td> - </tr>', - $myrow[0], - $myrow[1], - $myrow[2], - $myrow[3], - $myrow[4], - $myrow[5], - $myrow[6], - $_SERVER['PHP_SELF'], - $myrow[0], - $_SERVER['PHP_SELF'], - $myrow[0], - $myrow[0]); + <td>%s</td> + <td>%s</td> + <td>%s</td> + <td>%s</td> + <td>%s</td> + <td>%s</td> + <td><a href=\'%s?SelectedParam=%s\'>' . _('Edit') . '</a></td> + <td><a href=\'%s?SelectedParam=%s&delete=%s\'>'. _('Delete') .'</a></td> + </tr>', + $myrow[0], + $myrow[1], + $myrow[2], + $myrow[3], + $myrow[4], + $myrow[5], + $myrow[6], + $_SERVER['PHP_SELF'], + $myrow[0], + $_SERVER['PHP_SELF'], + $myrow[0], + $myrow[0]); } //END WHILE LIST LOOP echo '</table>'; @@ -201,70 +204,72 @@ //editing an existing status code $sql = "SELECT geocodeid, - geocode_key, - center_long, - center_lat, - map_height, - map_width, - map_host - FROM geocode_param - WHERE geocodeid='" . $SelectedParam . "'"; + geocode_key, + center_long, + center_lat, + map_height, + map_width, + map_host + FROM geocode_param + WHERE geocodeid='" . $SelectedParam . "'"; $result = DB_query($sql, $db); $myrow = DB_fetch_array($result); - $_POST['geocodeid'] = $myrow['geocodeid']; - $_POST['geocode_key'] = $myrow['geocode_key']; - $_POST['center_long'] = $myrow['center_long']; - $_POST['center_lat'] = $myrow['center_lat']; - $_POST['map_height'] = $myrow['map_height']; - $_POST['map_width'] = $myrow['map_width']; - $_POST['map_host'] = $myrow['map_host']; + $_POST['GeoCodeID'] = $myrow['geocodeid']; + $_POST['GeoCode_Key'] = $myrow['geocode_key']; + $_POST['Center_Long'] = $myrow['center_long']; + $_POST['Center_Lat'] = $myrow['center_lat']; + $_POST['Map_Height'] = $myrow['map_height']; + $_POST['Map_Width'] = $myrow['map_width']; + $_POST['Map_Host'] = $myrow['map_host']; echo '<input type="hidden" name="SelectedParam" value="' . $SelectedParam . '" />'; - echo '<input type="hidden" name="geocodeid" value="' . $_POST['geocodeid'] . '" />'; + echo '<input type="hidden" name="GeoCodeID" value="' . $_POST['GeoCodeID'] . '" />'; echo '<p class="page_title_text"><img src="'.$rootpath.'/css/'.$theme.'/images/maintenance.png" title="' . _('Geocode Setup') . '" alt="">'. _('Setup configuration for Geocoding of Customers and Suppliers') .'</p>'; echo '<table> <tr><td>'. _('Geocode Code') .':</td> - <td>' . $_POST['geocodeid'] . '</td></tr>'; + <td>' . $_POST['GeoCodeID'] . '</td></tr>'; } else { //end of if $SelectedParam only do the else when a new record is being entered - if (!isset($_POST['geocodeid'])) { - $_POST['geocodeid'] = ''; + if (!isset($_POST['GeoCodeID'])) { + $_POST['GeoCodeID'] = ''; } echo '<table>'; // <tr> // <td>'. _('Geocode Code') .":</td> -// <td><input " . (in_array('geocodeid',$Errors) ? 'class="inputerror"' : '' ) . -// " tabindex=1 type='Text' name='geocodeid' VALUE='". $_POST['geocodeid'] ."' size=3 maxlength=2></td> +// <td><input " . (in_array('GeoCodeID',$Errors) ? 'class="inputerror"' : '' ) . +// " tabindex=1 type='Text' name='GeoCodeID' VALUE='". $_POST['GeoCodeID'] ."' size=3 maxlength=2></td> // </tr>"; } - if (!isset($_POST['geocode_key'])) { - $_POST['geocode_key'] = ''; + if (!isset($_POST['GeoCode_Key'])) { + $_POST['GeoCode_Key'] = ''; } echo '<br /><tr> <td>'. _('Geocode Key') .':</td> - <td><input ' . (in_array('geocode_key',$Errors) ? 'class="inputerror"' : '' ) . - ' tabindex=2 type="text" name="geocode_key" VALUE="'. $_POST['geocode_key'] .'" size=28 maxlength=300> + <td><input ' . (in_array('GeoCode_Key',$Errors) ? 'class="inputerror"' : '' ) . + ' tabindex=2 type="text" name="GeoCode_Key" value="'. $_POST['GeoCode_Key'] .'" size=28 maxlength=300> </td></tr> <tr><td>'. _('Geocode Center Long') . '</td> - <td><input tabindex=3 type="text" name="center_long" VALUE="'. $_POST['center_long'] .'" size=28 maxlength=300></td></tr> + <td><input tabindex=3 type="text" name="Center_Long" value="'. $_POST['Center_Long'] .'" size=28 maxlength=300></td></tr> <tr><td>'. _('Geocode Center Lat') . '</td> - <td><input tabindex=4 type="text" name="center_lat" VALUE="'. $_POST['center_lat'] .'" size=28 maxlength=300></td></tr> + <td><input tabindex=4 type="text" name="Center_Lat" value="'. $_POST['Center_Lat'] .'" size=28 maxlength=300></td></tr> <tr><td>'. _('Geocode Map Height') . '</td> - <td><input tabindex=5 type="text" name="map_height" VALUE="'. $_POST['map_height'] .'" size=28 maxlength=300></td></tr> + <td><input tabindex=5 type="text" name="Map_Height" value="'. $_POST['Map_Height'] .'" size=28 maxlength=300></td></tr> <tr><td>'. _('Geocode Map Width') . '</td> - <td><input tabindex=6 type="text" name="map_width" VALUE="'. $_POST['map_width'] .'" size=28 maxlength=300></td></tr> + <td><input tabindex=6 type="text" name="Map_Width" value="'. $_POST['Map_Width'] .'" size=28 maxlength=300></td></tr> <tr><td>'. _('Geocode Host') . '</td> - <td><input tabindex=7 type="text" name="map_host" VALUE="'. $_POST['map_host'] .'" size=20 maxlength=300></td></tr> + <td><input tabindex=7 type="text" name="Map_Host" value="'. $_POST['Map_Host'] .'" size=20 maxlength=300></td></tr> </table> - <div class="centre"><input tabindex=4 type="Submit" name="submit" value="' . _('Enter Information') . '"</div><br /><br /> + <div class="centre"><input tabindex=4 type="submit" name="submit" value="' . _('Enter Information') . '"</div> + <br /> + <br /> </form>'; echo '<div class="page_help_text">' . _('When ready, click on the link below to run the GeoCode process. This will Geocode all Branches and Suppliers. This may take some time. Errors will be returned to the screen.') . '</p>'; echo '<p>' . _('Suppliers and Customer Branches are geocoded when being entered/updated. You can rerun the geocode process from this screen at any time.') . '</p></div><br />'; Modified: trunk/GetStockImage.php =================================================================== --- trunk/GetStockImage.php 2011-07-05 10:36:13 UTC (rev 4624) +++ trunk/GetStockImage.php 2011-07-06 09:30:42 UTC (rev 4625) @@ -20,33 +20,33 @@ */ // Color decode function -function DecodeBgColor( $colorstr ) { - if ( $colorstr[0] == '#' ) { - $colorstr = mb_substr($colorstr,1,mb_strlen($colorstr)); +function DecodeBgColor( $ColourStr ) { + if ( $ColourStr[0] == '#' ) { + $ColourStr = mb_substr($ColourStr,1,mb_strlen($ColourStr)); } - $red = 0; - if(mb_strlen($colorstr) > 1) { - $red = hexdec(mb_substr($colorstr,0,2)); - $colorstr = mb_substr($colorstr,2,mb_strlen($colorstr)); + $Red = 0; + if(mb_strlen($ColourStr) > 1) { + $Red = hexdec(mb_substr($ColourStr,0,2)); + $ColourStr = mb_substr($ColourStr,2,mb_strlen($ColourStr)); } - $green = 0; - if(mb_strlen($colorstr) > 1) { - $green = hexdec(mb_substr($colorstr,0,2)); - $colorstr = mb_substr($colorstr,2,mb_strlen($colorstr)); + $Green = 0; + if(mb_strlen($ColourStr) > 1) { + $Green = hexdec(mb_substr($ColourStr,0,2)); + $ColourStr = mb_substr($ColourStr,2,mb_strlen($ColourStr)); } - $blue = 0; - if(mb_strlen($colorstr) > 1) { - $blue = hexdec(mb_substr($colorstr,0,2)); - $colorstr = mb_substr($colorstr,2,mb_strlen($colorstr)); + $Blue = 0; + if(mb_strlen($ColourStr) > 1) { + $Blue = hexdec(mb_substr($ColourStr,0,2)); + $ColourStr = mb_substr($ColourStr,2,mb_strlen($ColourStr)); } - if(mb_strlen($colorstr) > 1) { - $alpha = hexdec(mb_substr($colorstr,0,2)); - $colorstr = mb_substr($colorstr,2,mb_strlen($colorstr)); + if(mb_strlen($ColourStr) > 1) { + $Alpha = hexdec(mb_substr($ColourStr,0,2)); + $ColourStr = mb_substr($ColourStr,2,mb_strlen($ColourStr)); } - if ( isset($alpha) ) - return array('red' => $red, 'green' => $green, 'blue' => $blue, 'alpha' => $alpha ); + if ( isset($Alpha) ) + return array('red' => $Red, 'green' => $Green, 'blue' => $Blue, 'alpha' => $Alpha ); else - return array('red' => $red, 'green' => $green, 'blue' => $blue ); + return array('red' => $Red, 'green' => $Green, 'blue' => $Blue ); } if (!function_exists('imagecreatefrompng')){ @@ -56,7 +56,7 @@ include('includes/footer.inc'); exit; } -$defaultimage = 'webERPsmall.png'; +$DefaultImage = 'webERPsmall.png'; // FOR APACHE if ( $_SERVER['PATH_TRANSLATED'][0] == '/' OR $_SERVER['PATH_TRANSLATED'][0]=='') { @@ -66,13 +66,13 @@ //Windows $pathsep = "\\"; } -$filepath = $_SESSION['part_pics_dir'] . $pathsep; +$FilePath = $_SESSION['part_pics_dir'] . $pathsep; -$stockid = trim(mb_strtoupper($_GET['StockID'])); +$StockID = trim(mb_strtoupper($_GET['StockID'])); if( isset($_GET['bgcolor']) ) - $bgcolor = $_GET['bgcolor']; + $BackgroundColour = $_GET['bgcolor']; if( isset($_GET['textcolor']) ) - $textcolor = $_GET['textcolor']; + $TextColour = $_GET['textcolor']; if( isset($_GET['width']) ) $width = $_GET['width']; if( isset($_GET['height']) ) @@ -89,7 +89,7 @@ } if( isset($_GET['transcolor'])) { $doTrans = true; - $transcolor = $_GET['transcolor']; + $TranspColour = $_GET['transcolor']; } if( isset($_GET['bevel']) ) { $bevel = $_GET['bevel']; @@ -111,17 +111,17 @@ // Extension requirements and Stock ID Isolation -if($stockid == '') { - $stockid = $defaultimage; +if($StockID == '') { + $StockID = $DefaultImage; $blanktext = true; } -$i = strrpos($stockid,'.'); +$i = strrpos($StockID,'.'); if( $i === false ) $type = 'png'; else { - $type = strtolower(mb_substr($stockid,$i+1,mb_strlen($stockid))); - $stockid = mb_substr($stockid,0,$i); + $type = strtolower(mb_substr($StockID,$i+1,mb_strlen($StockID))); + $StockID = mb_substr($StockID,0,$i); if($blanktext && !isset($text)) $text = ''; } @@ -132,22 +132,22 @@ $functype = 'jpeg'; } -$tmpfilename = $filepath.$stockid; +$tmpFileName = $FilePath.$StockID; // First check for an image this is not the type requested -if ( file_exists($tmpfilename.'.jpg') ) { - $filename = $stockid.'.jpg'; - $isjpeg = true; -} elseif (file_exists($tmpfilename.'.jpeg')) { - $filename = $stockid.'.jpeg'; - $isjpeg = true; -} elseif (file_exists($tmpfilename.'.png')) { - $filename = $stockid.'.png'; - $isjpeg = false; +if ( file_exists($tmpFileName.'.jpg') ) { + $FileName = $StockID.'.jpg'; + $IsJpeg = true; +} elseif (file_exists($tmpFileName.'.jpeg')) { + $FileName = $StockID.'.jpeg'; + $IsJpeg = true; +} elseif (file_exists($tmpFileName.'.png')) { + $FileName = $StockID.'.png'; + $IsJpeg = false; } else { - $filename = $defaultimage; - $isjpeg = $defaultisjpeg; + $FileName = $DefaultImage; + $IsJpeg = $DefaultIsJpeg; } -if( !$automake && !isset($filename) ) { +if( !$automake && !isset($FileName) ) { $title = _('Stock Image Retrieval ....'); include('includes/header.inc'); prnMsg( _('The Image could not be retrieved because it does not exist'), 'error'); @@ -159,9 +159,9 @@ /* $title = _('Stock Image Retrieval ....'); include('includes/header.inc'); - echo 'The image ' . $filename . ' using functype ' . $functype - . '<br /> The tmpfilename = ' . $tmpfilename . '<br /> The temppath = ' . $filepath . '<br />The stockid = ' . $stockid . '<br /> filepath . stockid .jpg = ' . $filepath . $stockid .'.jpg<br /> The result of file_exists($filepath . $stockid .jpg) =' . file_exists($filepath . $stockid .'.jpg') - . '<br />filepath = ' . $filepath + echo 'The image ' . $FileName . ' using functype ' . $functype + . '<br /> The tmpFileName = ' . $tmpFileName . '<br /> The temppath = ' . $FilePath . '<br />The stockid = ' . $StockID . '<br /> filepath . stockid .jpg = ' . $FilePath . $StockID .'.jpg<br /> The result of file_exists($FilePath . $StockID .jpg) =' . file_exists($FilePath . $StockID .'.jpg') + . '<br />filepath = ' . $FilePath . '<br />rootpath = ' . $rootpath; include('includes/footer.inc'); exit; @@ -170,7 +170,7 @@ // See if we need to automake this image -if( $automake && !isset($filename) || $useblank ) { +if( $automake && !isset($FileName) || $useblank ) { // Have we got height and width specs if( !isset($width) ) $width = 64; @@ -178,39 +178,39 @@ $height = 64; // Have we got a background color $im = imagecreate($width, $height); - if( isset($bgcolor) ) - $bgcolor = DecodeBgColor( $bgcolor ); + if( isset($BackgroundColour) ) + $BackgroundColour = DecodeBgColor( $BackgroundColour ); else - $bgcolor = DecodeBgColor( '#7F7F7F' ); - if( !isset($bgcolor['alpha']) ) { + $BackgroundColour = DecodeBgColor( '#7F7F7F' ); + if( !isset($BackgroundColour['alpha']) ) { $ixbgcolor = imagecolorallocate($im, - $bgcolor['red'],$bgcolor['green'],$bgcolor['blue']); + $BackgroundColour['red'],$BackgroundColour['green'],$BackgroundColour['blue']); } else { $ixbgcolor = imagecolorallocatealpha($im, - $bgcolor['red'],$bgcolor['green'],$bgcolor['blue'],$bgcolor['alpha']); + $BackgroundColour['red'],$BackgroundColour['green'],$BackgroundColour['blue'],$BackgroundColour['alpha']); } // Have we got a text color - if( isset($textcolor) ) - $textcolor = DecodeBgColor( $textcolor ); + if( isset($TextColour) ) + $TextColour = DecodeBgColor( $TextColour ); else - $textcolor = DecodeBgColor( '#000000' ); - if( !isset($textcolor['alpha']) ) { + $TextColour = DecodeBgColor( '#000000' ); + if( !isset($TextColour['alpha']) ) { $ixtextcolor = imagecolorallocate($im, - $textcolor['red'],$textcolor['green'],$textcolor['blue']); + $TextColour['red'],$TextColour['green'],$TextColour['blue']); } else { $ixtextcolor = imagecolorallocatealpha($im, - $textcolor['red'],$textcolor['green'],$textcolor['blue'],$textcolor['alpha']); + $TextColour['red'],$TextColour['green'],$TextColour['blue'],$TextColour['alpha']); } // Have we got transparency requirements - if( isset($transcolor) ) { - $transcolor = DecodeBgColor( $transcolor ); - if( $transcolor != $bgcolor ) { - if( !isset($textcolor['alpha']) ) { + if( isset($TranspColour) ) { + $TranspColour = DecodeBgColor( $TranspColour ); + if( $TranspColour != $BackgroundColour ) { + if( !isset($TextColour['alpha']) ) { $ixtranscolor = imagecolorallocate($im, - $transcolor['red'],$transcolor['green'],$transcolor['blue']); + $TranspColour['red'],$TranspColour['green'],$TranspColour['blue']); } else { $ixtranscolor = imagecolorallocatealpha($im, - $transcolor['red'],$transcolor['green'],$transcolor['blue'],$transcolor['alpha']); + $TranspColour['red'],$TranspColour['green'],$TranspColour['blue'],$TranspColour['alpha']); } } else { $ixtranscolor = $ixbgcolor; @@ -223,7 +223,7 @@ } if(!isset($text)) - $text = $stockid; + $text = $StockID; if(mb_strlen($text) > 0 ) { $fw = imagefontwidth($fontsize); $fh = imagefontheight($fontsize); @@ -237,35 +237,35 @@ } } else { - $tmpfilename = $filepath.$filename; - if( $isjpeg ) { - $im = imagecreatefromjpeg($tmpfilename); + $tmpFileName = $FilePath.$FileName; + if( $IsJpeg ) { + $im = imagecreatefromjpeg($tmpFileName); } else { - $im = imagecreatefrompng($tmpfilename); + $im = imagecreatefrompng($tmpFileName); } // Have we got a background color - if( isset($bgcolor) ) - $bgcolor = DecodeBgColor( $bgcolor ); + if( isset($BackgroundColour) ) + $BackgroundColour = DecodeBgColor( $BackgroundColour ); else - $bgcolor = DecodeBgColor( '#7F7F7F' ); - if( !isset($bgcolor['alpha']) ) { + $BackgroundColour = DecodeBgColor( '#7F7F7F' ); + if( !isset($BackgroundColour['alpha']) ) { $ixbgcolor = imagecolorallocate($im, - $bgcolor['red'],$bgcolor['green'],$bgcolor['blue']); + $BackgroundColour['red'],$BackgroundColour['green'],$BackgroundColour['blue']); } else { $ixbgcolor = imagecolorallocatealpha($im, - $bgcolor['red'],$bgcolor['green'],$bgcolor['blue'],$bgcolor['alpha']); + $BackgroundColour['red'],$BackgroundColour['green'],$BackgroundColour['blue'],$BackgroundColour['alpha']); } // Have we got a text color - if( isset($textcolor) ) - $textcolor = DecodeBgColor( $textcolor ); + if( isset($TextColour) ) + $TextColour = DecodeBgColor( $TextColour ); else - $textcolor = DecodeBgColor( '#000000' ); - if( !isset($textcolor['alpha']) ) { + $TextColour = DecodeBgColor( '#000000' ); + if( !isset($TextColour['alpha']) ) { $ixtextcolor = imagecolorallocate($im, - $textcolor['red'],$textcolor['green'],$textcolor['blue']); + $TextColour['red'],$TextColour['green'],$TextColour['blue']); } else { $ixtextcolor = imagecolorallocatealpha($im, - $textcolor['red'],$textcolor['green'],$textcolor['blue'],$textcolor['alpha']); + $TextColour['red'],$TextColour['green'],$TextColour['blue'],$TextColour['alpha']); } $sw = imagesx($im); $sh = imagesy($im); @@ -281,32 +281,32 @@ $im = $tmpim; unset($tmpim); - if( !isset($bgcolor['alpha']) ) { + if( !isset($BackgroundColour['alpha']) ) { $ixbgcolor = imagecolorallocate($im, - $bgcolor['red'],$bgcolor['green'],$bgcolor['blue']); + $BackgroundColour['red'],$BackgroundColour['green'],$BackgroundColour['blue']); } else { $ixbgcolor = imagecolorallocatealpha($im, - $bgcolor['red'],$bgcolor['green'],$bgcolor['blue'],$bgcolor['alpha']); + $BackgroundColour['red'],$BackgroundColour['green'],$BackgroundColour['blue'],$BackgroundColour['alpha']); } - if( !isset($textcolor['alpha']) ) { + if( !isset($TextColour['alpha']) ) { $ixtextcolor = imagecolorallocate($im, - $textcolor['red'],$textcolor['green'],$textcolor['blue']); + $TextColour['red'],$TextColour['green'],$TextColour['blue']); } else { $ixtextcolor = imagecolorallocatealpha($im, - $textcolor['red'],$textcolor['green'],$textcolor['blue'],$textcolor['alpha']); + $TextColour['red'],$TextColour['green'],$TextColour['blue'],$TextColour['alpha']); } //imagealphablending ( $im, false); } // Have we got transparency requirements - if( isset($transcolor) ) { - $transcolor = DecodeBgColor( $transcolor ); - if( $transcolor != $bgcolor ) { - if( !isset($textcolor['alpha']) ) { + if( isset($TranspColour) ) { + $TranspColour = DecodeBgColor( $TranspColour ); + if( $TranspColour != $BackgroundColour ) { + if( !isset($TextColour['alpha']) ) { $ixtranscolor = imagecolorallocate($im, - $transcolor['red'],$transcolor['green'],$transcolor['blue']); + $TranspColour['red'],$TranspColour['green'],$TranspColour['blue']); } else { $ixtranscolor = imagecolorallocatealpha($im, - $transcolor['red'],$transcolor['green'],$transcolor['blue'],$transcolor['alpha']); + $TranspColour['red'],$TranspColour['green'],$TranspColour['blue'],$TranspColour['alpha']); } } else { $ixtranscolor = $ixbgcolor; @@ -322,7 +322,7 @@ // $ixtextbgcolor = imagecolorallocatealpha($im, // 0,0,0,0); if(!isset($text)) - $text = $stockid; + $text = $StockID; if(mb_strlen($text) > 0 ) { $fw = imagefontwidth($fontsize); $fh = imagefontheight($fontsize); @@ -348,7 +348,7 @@ imageline($im, imagesx($im)-1,0,imagesx($im)-1, imagesy($im)-1, $silver); // right } // Set up headers -header('Content-Disposition: filename='.$stockid.'.'.$type); +header('Content-Disposition: filename='.$StockID.'.'.$type); header('Cache-Control: must-revalidate, post-check=0, pre-check=0'); header('Pragma: public'); header('Content-type: image/'.$style); Modified: trunk/MRPShortages.php =================================================================== --- trunk/MRPShortages.php 2011-07-05 10:36:13 UTC (rev 4624) +++ trunk/MRPShortages.php 2011-07-06 09:30:42 UTC (rev 4625) @@ -260,15 +260,15 @@ echo '<p class="page_title_text"><img src="'.$rootpath.'/css/'.$theme.'/images/inventory.png" title="' . _('Stock') . '" alt="" />' . ' ' . $title . '</p>'; - echo '<form action=' . $_SERVER['PHP_SELF'] . " method='post'>"; + echo '<form action="' . $_SERVER['PHP_SELF'] . '" method="post">'; echo '<input type="hidden" name="FormID" value="' . $_SESSION['FormID'] . '" />'; echo '<table class=selection>'; echo '</select></td></tr>'; echo '<tr><td>' . _('Inventory Category') . ':</td><td><select name="CategoryID">'; - echo '<option selected value="All">' . _('All Stock Categories'); + echo '<option selected value="All">' . _('All Stock Categories') .'</option>'; $sql = 'SELECT categoryid, - categorydescription - FROM stockcategory'; + categorydescription + FROM stockcategory"; $result = DB_query($sql,$db); while ($myrow = DB_fetch_array($result)) { echo '<option value="' . $myrow['categoryid'] . '">' . $myrow['categoryid'] . ' - ' .$myrow['categorydescription'] . '</option>'; Modified: trunk/PDFStockTransfer.php =================================================================== --- trunk/PDFStockTransfer.php 2011-07-05 10:36:13 UTC (rev 4624) +++ trunk/PDFStockTransfer.php 2011-07-06 09:30:42 UTC (rev 4625) @@ -2,6 +2,8 @@ /* $Id$*/ +/* This script is superseded by the PDFStockLocTransfer.php which produces a multiple item stock transfer listing - this was for the old individual stock transfers where there is just single items being transferred */ + include('includes/session.inc'); if (!isset($_GET['TransferNo'])){ Modified: trunk/ShipmentCosting.php =================================================================== --- trunk/ShipmentCosting.php 2011-07-05 10:36:13 UTC (rev 4624) +++ trunk/ShipmentCosting.php 2011-07-06 09:30:42 UTC (rev 4625) @@ -25,15 +25,15 @@ } $ShipmentHeaderSQL = "SELECT shipments.supplierid, - suppliers.suppname, - shipments.eta, - suppliers.currcode, - shipments.vessel, - shipments.voyageref, - shipments.closed - FROM shipments INNER JOIN suppliers - ON shipments.supplierid = suppliers.supplierid - WHERE shipments.shiptref = '" . $_GET['SelectedShipment'] . "'"; + suppliers.suppname, + shipments.eta, + suppliers.currcode, + shipments.vessel, + shipments.voyageref, + shipments.closed + FROM shipments INNER JOIN suppliers + ON shipments.supplierid = suppliers.supplierid + WHERE shipments.shiptref = '" . $_GET['SelectedShipment'] . "'"; $ErrMsg = _('Shipment').' '. $_GET['SelectedShipment'] . ' ' . _('cannot be retrieved because a database error occurred'); $GetShiptHdrResult = DB_query($ShipmentHeaderSQL,$db, $ErrMsg); @@ -46,7 +46,7 @@ $HeaderData = DB_fetch_array($GetShiptHdrResult); echo '<br />'; -echo '<table class=selection>'; +echo '<table class="selection">'; echo '<tr><th colspan=4><font size=3 color=navy>'._('Shipment Details').'</font></th></tr>'; echo '<tr> <td><b>'. _('Shipment') .': </td> @@ -140,15 +140,17 @@ echo '<br /><table cellpadding=2 colspan=7 class=selection>'; echo '<tr><th colspan=9><font color=navy size=3>' . _('Items on shipment'). '</font></th></tr>'; - $TableHeader = '<tr> <th>'. _('Item'). '</th> - <th>'. _('Quantity'). '<br />'. _('Invoiced'). '</th> - <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>'; + $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>'. _('Variance'). '</th> + <th>%</th> + </tr>'; echo $TableHeader; /*show the line items on the shipment with the value invoiced and shipt cost */ @@ -618,17 +620,18 @@ if ( isset($_GET['Close'])) { /* Only an opportunity to confirm user wishes to close */ // if the page was called with Close=Yes then show options to confirm OK to c - echo '<div class+"centre"><form method="POST" action="' . $_SERVER['PHP_SELF'] .'?SelectedShipment=' . $_GET['SelectedShipment'] . '">'; + echo '<div class="centre"> + <form method="POST" action="' . $_SERVER['PHP_SELF'] .'?SelectedShipment=' . $_GET['SelectedShipment'] . '">'; echo '<input type="hidden" name="FormID" value="' . $_SESSION['FormID'] . '" />'; if ($_SESSION['WeightedAverageCosting']==0){ /* We are standard costing - so show the option to update costs - under W. Avg cost updates are implicit */ echo _('Update Standard Costs') .':<select name="UpdateCost"> - <option selected value="Yes">'. _('Yes') . '</option> - <option value="No">'. _('No') . '</option> + <option selected value="Yes">'. _('Yes') . '</option> + <option value="No">'. _('No') . '</option> </select>'; } - echo '<br /><br /><input type=submit name="Close" VALUE="'. _('Confirm OK to Close'). '">'; + echo '<br /><br /><input type=submit name="Close" value="'. _('Confirm OK to Close'). '">'; echo '</form></div>'; } Modified: trunk/Z_CheckDebtorsControl.php =================================================================== --- trunk/Z_CheckDebtorsControl.php 2011-07-05 10:36:13 UTC (rev 4624) +++ trunk/Z_CheckDebtorsControl.php 2011-07-06 09:30:42 UTC (rev 4625) @@ -88,13 +88,12 @@ $GLOpening = $invTotal = $RecTotal = $GLClosing = $CalcTotal = $DiffTotal = 0; $j=0; - while ( $CurPeriod <= $_POST['ToPeriod'] ) - { + while ( $CurPeriod <= $_POST['ToPeriod'] ) { $SQL = "SELECT bfwd, - actual - FROM chartdetails - WHERE period = " . $CurPeriod . " - AND accountcode=" . $_SESSION['CompanyRecord']['debtorsact']; + actual + FROM chartdetails + WHERE period = " . $CurPeriod . " + AND accountcode=" . $_SESSION['CompanyRecord']['debtorsact']; $dtResult = DB_query($SQL,$db); $dtRow = DB_fetch_array($dtResult); DB_free_result($dtResult); @@ -165,7 +164,6 @@ echo '</table></form>'; } -echo '</td></tr></table>'; // end Page Border include('includes/footer.inc'); ?> \ No newline at end of file Modified: trunk/api/api_session.inc =================================================================== --- trunk/api/api_session.inc 2011-07-05 10:36:13 UTC (rev 4624) +++ trunk/api/api_session.inc 2011-07-06 09:30:42 UTC (rev 4625) @@ -40,7 +40,7 @@ $_SESSION['AttemptsCounter'] = 0; } -if ($_SESSION['HTTPS_Only']==1){ +if (isset($_SESSION['HTTPS_Only']) AND $_SESSION['HTTPS_Only']==1){ if ($_SERVER['HTTPS']!='on'){ prnMsg(_('webERP is configured to allow only secure socket connections. Pages must be called with https://') . ' .....','error'); exit; @@ -51,8 +51,7 @@ // value must be set in the script before header.inc is included. $SecurityGroups is an array of // arrays defining access for each group of users. These definitions can be modified by a system admin under setup - -if (!is_array($_SESSION['AllowedPageSecurityTokens']) AND !isset($AllowAnyone)) { +if (isset($_SESSION['AllowedPageSecurityTokens']) AND !is_array($_SESSION['AllowedPageSecurityTokens']) AND !isset($AllowAnyone)) { /* NO HTML output - but may need an XMLRPC style error message here. Lindsay: 12Jan10 $title = _('Account Error Report'); Modified: trunk/api/api_xml-rpc.php =================================================================== --- trunk/api/api_xml-rpc.php 2011-07-05 10:36:13 UTC (rev 4624) +++ trunk/api/api_xml-rpc.php 2011-07-06 09:30:42 UTC (rev 4625) @@ -1043,7 +1043,7 @@ unset($Description); unset($Parameter); unset($ReturnValue); - + $ReturnValue = _('Return Value Descriptions go here'); $Description = _('This function is used to insert a new Sales Credit to the webERP database.'); $Parameter[0]['name'] = _('Credit Details'); $Parameter[0]['description'] = _('An array of index/value items describing the credit. All values must be negative.'); @@ -1212,7 +1212,8 @@ unset($Description); unset($Parameter); unset($ReturnValue); - + $ReturnValue = _('Return Value Descriptions go here'); + $Description = _('Function Description go here'); $Parameter[0]['name'] = _('Account Details'); $Parameter[0]['description'] = _('An array of index/value items describing the GL Account and fields to set.'); $Parameter[1]['name'] = _('User name'); @@ -1242,6 +1243,9 @@ unset($Parameter); unset($ReturnValue); + $ReturnValue = _('Return Value Descriptions go here'); + $Description = _('Function Description go here'); + $Parameter[0]['name'] = _('Account Section Details'); $Parameter[0]['description'] = _('An array of index/value items describing the account section to insert.'); $Parameter[1]['name'] = _('User name'); @@ -1271,6 +1275,9 @@ unset($Parameter); unset($ReturnValue); + $ReturnValue = _('Return Value Descriptions go here'); + $Description = _('Function Description go here'); + $Parameter[0]['name'] = _('Account Group Details'); $Parameter[0]['description'] = _('An array of index/value items describing the account group to insert.'); $Parameter[1]['name'] = _('User name'); @@ -1299,7 +1306,7 @@ unset($Description); unset($Parameter); unset($ReturnValue); - + $Description = _('This function returns a list of stock location ids.'); $Parameter[0]['name'] = _('User name'); $Parameter[0]['description'] = _('A valid weberp username. This user should have security access to this data.'); @@ -1507,6 +1514,9 @@ unset($Parameter); unset($ReturnValue); + $ReturnValue = _('Return Value Descriptions go here'); + $Description = _('Function Description go here'); + $Parameter[0]['name'] = _('Sales Area Details'); $Parameter[0]['description'] = _('An array of index/value items describing the sales area to insert.'); $Parameter[1]['name'] = _('User name'); @@ -1626,6 +1636,9 @@ unset($Parameter); unset($ReturnValue); + $ReturnValue = _('Return Value Descriptions go here'); + $Description = _('Function Description go here'); + $Parameter[0]['name'] = _('Salesman Details'); $Parameter[0]['description'] = _('An array of index/value items describing the salesman to insert.'); $Parameter[1]['name'] = _('User name'); @@ -1773,6 +1786,9 @@ unset($Parameter); unset($ReturnValue); + $ReturnValue = _('Return Value Descriptions go here'); + $Description = _('Function Description go here'); + $Parameter[0]['name'] = _('Category Details'); $Parameter[0]['description'] = _('An array of index/value items describing the stock category to insert.'); $Parameter[1]['name'] = _('User name'); @@ -1802,6 +1818,9 @@ unset($Parameter); unset($ReturnValue); + $ReturnValue = _('Return Value Descriptions go here'); + $Description = _('Function Description go here'); + $Parameter[0]['name'] = _('Category Details'); $Parameter[0]['description'] = _('An array of index/value items describing the stock category to modify.'); $Parameter[1]['name'] = _('User name'); @@ -1889,6 +1908,9 @@ unset($Parameter); unset($ReturnValue); + $ReturnValue = _('Return Value Descriptions go here'); + $Description = _('Function Description go here'); + $Parameter[0]['name'] = _('Field Name'); $Parameter[0]['description'] = _('The field name to search on.'); $Parameter[1]['name'] = _('Match Criteria'); @@ -1922,6 +1944,9 @@ unset($Parameter); unset($ReturnValue); + $ReturnValue = _('Return Value Descriptions go here'); + $Description = _('Function Description go here'); + $Parameter[0]['name'] = _('Label Name'); $Parameter[0]['description'] = _('The category label to search on.'); $Parameter[1]['name'] = _('Match Criteria'); Modified: trunk/doc/Change.log =================================================================== --- trunk/doc/Change.log 2011-07-05 10:36:13 UTC (rev 4624) +++ trunk/doc/Change.log 2011-07-06 09:30:42 UTC (rev 4625) @@ -1,5 +1,6 @@ webERP Change Log +5/7/11 Phil: Amend menu to use PDFStockLocTransfer.php to reprint transfer list - as reported by Ron Wong 3/7/11 Phil: changed all strpos to mb_strpos 3/7/11 Phil: changed all strtoupper to mb_strtoupper 3/7/11 Phil: changed all substr to mb_substr Modified: trunk/geo_displaymap_customers.php =================================================================== --- trunk/geo_displaymap_customers.php 2011-07-05 10:36:13 UTC (rev 4624) +++ trunk/geo_displaymap_customers.php 2011-07-06 09:30:42 UTC (rev 4625) @@ -1,7 +1,7 @@ <?php /* $Id$*/ -//$PageSecurity = 3; + $title = _('Geocoded Customer Branches Report'); include ('includes/session.inc'); @@ -13,14 +13,14 @@ $result = DB_query($sql, $db, $ErrMsg); $myrow = DB_fetch_array($result); -$api_key = $myrow['geocode_key']; -$center_long = $myrow['center_long']; -$center_lat = $myrow['center_lat']; -$map_height = $myrow['map_height']; -$map_width = $myrow['map_width']; -$map_host = $myrow['map_host']; +$Api_Key = $myrow['geocode_key']; +$Center_Long = $myrow['center_long']; +$Center_Lat = $myrow['center_lat']; +$Map_Height = $myrow['map_height']; +$Map_Width = $myrow['map_width']; +$Map_Host = $myrow['map_host']; -echo '<script src="http://' . $map_host . '/maps?file=api&v=2&key=' . $api_key . '"'; +echo '<script src="http://' . $Map_Host . '/maps?file=api&v=2&key=' . $Api_Key . '"'; echo ' type="text/javascript"></script>'; echo ' <script type="text/javascript">'; echo " //<![CDATA[ "; ?> @@ -51,7 +51,7 @@ map.addControl(new GSmallMapControl()); map.addControl(new GMapTypeControl()); -<? echo 'map.setCenter(new GLatLng(' . $center_lat . ', ' . $center_long . '), 10);'; ?> +<? echo 'map.setCenter(new GLatLng(' . $Center_Lat . ', ' . $Center_Long . '), 10);'; ?> GDownloadUrl("geocode_genxml_customers.php", function(data) { var xml = GXml.parse(data); @@ -83,7 +83,7 @@ <body onload="load()" onunload="GUnload()"> <p> -<? echo '<div class="centre" id="map" style="width: ' . $map_width . 'px; height: ' . $map_height . 'px"></div>'; ?> +<? echo '<div class="centre" id="map" style="width: ' . $Map_Width . 'px; height: ' . $Map_Height . 'px"></div>'; ?> </p> </body> <? Modified: trunk/geo_displaymap_suppliers.php =================================================================== --- trunk/geo_displaymap_suppliers.php 2011-07-05 10:36:13 UTC (rev 4624) +++ trunk/geo_displaymap_suppliers.php 2011-07-06 09:30:42 UTC (rev 4625) @@ -1,7 +1,7 @@ <?php /* $Id$*/ -//$PageSecurity = 3; + $title = _('Geocoded Supplier Report'); include ('includes/session.inc'); @@ -13,14 +13,14 @@ $result = DB_query($sql, $db, $ErrMsg); $myrow = DB_fetch_array($result); -$api_key = $myrow['geocode_key']; -$center_long = $myrow['center_long']; -$center_lat = $myrow['center_lat']; -$map_height = $myrow['map_height']; -$map_width = $myrow['map_width']; -$map_host = $myrow['map_host']; +$Api_Key = $myrow['geocode_key']; +$Center_Long = $myrow['center_long']; +$Center_Lat = $myrow['center_lat']; +$Map_Height = $myrow['map_height']; +$Map_Width = $myrow['map_width']; +$Map_Host = $myrow['map_host']; -echo '<script src="http://' . $map_host . '/maps?file=api&v=2&key=' . $api_key . '"'; +echo '<script src="http://' . $Map_Host . '/maps?file=api&v=2&key=' . $Api_Key . '"'; echo ' type="text/javascript"></script>'; echo ' <script type="text/javascript">'; echo " //<![CDATA[ "; ?> @@ -51,7 +51,7 @@ map.addControl(new GSmallMapControl()); map.addControl(new GMapTypeControl()); -<? echo 'map.setCenter(new GLatLng(' . $center_lat . ', ' . $center_long . '), 10);'; ?> +<? echo 'map.setCenter(new GLatLng(' . $Center_Lat . ', ' . $Center_Long . '), 10);'; ?> GDownloadUrl("geocode_genxml_suppliers.php", function(data) { var xml = GXml.parse(data); @@ -83,7 +83,7 @@ <body onload="load()" onunload="GUnload()"> <p> -<? echo '<div class="centre" id="map" style="width: ' . $map_width . 'px; height: ' . $map_height . 'px"></div>'; ?> +<? echo '<div class="centre" id="map" style="width: ' . $Map_Width . 'px; height: ' . $Map_Height . 'px"></div>'; ?> </p> </body> <? Modified: trunk/includes/session.inc =================================================================== --- trunk/includes/session.inc 2011-07-05 10:36:13 UTC (rev 4624) +++ trunk/includes/session.inc 2011-07-06 09:30:42 UTC (rev 4625) @@ -291,7 +291,8 @@ echo '</td> </tr> </table> - </td>'; + </td> + </tr>'; include($PathPrefix . 'includes/footer.inc'); exit; Modified: trunk/index.php =================================================================== --- trunk/index.php 2011-07-05 10:36:13 UTC (rev 4624) +++ trunk/index.php 2011-07-06 09:30:42 UTC (rev 4625) @@ -714,7 +714,7 @@ </tr> <tr> <td class="menu_group_item"> - <?php echo '<p>• <a href="' . $rootpath . '/PDFStockTransfer.php">' . _('Stock Transfer Note') . '</a></p>'; ?> + <?php echo '<p>• <a href="' . $rootpath . '/PDFStockLocTransfer.php">' . _('Stock Transfer Note') . '</a></p>'; ?> </td> </tr> <tr> Modified: trunk/locale/it_IT.utf8/LC_MESSAGES/messages.mo =================================================================== (Binary files differ) Modified: trunk/locale/it_IT.utf8/LC_MESSAGES/messages.po =================================================================== --- trunk/locale/it_IT.utf8/LC_MESSAGES/messages.po 2011-07-05 10:36:13 UTC (rev 4624) +++ trunk/locale/it_IT.utf8/LC_MESSAGES/messages.po 2011-07-06 09:30:42 UTC (rev 4625) @@ -1,5 +1,4 @@ # SOME DESCRIPTIVE TITLE. -# Copyright (C) 2005 Logic Works Ltd # This file is distributed under the GPL # FIRST AUTHOR <xlyz> .2004/2005 # @@ -7,9 +6,9 @@ msgstr "" "Project-Id-Version: Weberp\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2011-07-02 20:11+1200\n" -"PO-Revision-Date: 2011-03-04 18:03+0000\n" -"Last-Translator: Martino Barbon <Unknown>\n" +"POT-Creation-Date: 2011-05-30 20:51+1200\n" +"PO-Revision-Date: 2011-07-05 12:26+0100\n" +"Last-Translator: Gioacchino Cipriano <gio...@gm...>\n" "Language-Team: italian <none>\n" "MIME-Version: 1.0\n" "Content-Type: text/plain; charset=UTF-8\n" @@ -18,31 +17,25 @@ "X-Generator: Launchpad (build 12696)\n" "Language: \n" -#: AccountGroups.php:7 index.php:1296 +#: AccountGroups.php:7 +#: index.php:1296 msgid "Account Groups" msgstr "Gestione dei conti" #: AccountGroups.php:17 -msgid "" -"An error occurred in retrieving the account groups of the parent account " -"group during the check for recursion" -msgstr "" -"È verificato un errore durante il recupero dei gruppi conto del gruppo di " -"conto genitore durante il controllo per la ricorsione" +msgid "An error occurred in retrieving the account groups of the parent account group during the check for recursion" +msgstr "È verificato un errore durante il recupero dei gruppi conto del gruppo di conto genitore durante il controllo per la ricorsione" #: AccountGroups.php:18 -msgid "" -"The SQL that was used to retrieve the account groups of the parent account " -"group and that failed in the process was" -msgstr "" -"Il SQL che è stata utilizzata per recuperare i gruppi conto del gruppo di " -"account principale e che ha fallito nel processo è stato" +msgid "The SQL that was used to retrieve the account groups of the parent account group and that failed in the process was" +msgstr "Il SQL che è stata utilizzata per recuperare i gruppi conto del gruppo di account principale e che ha fallito nel processo è stato" -#: AccountGroups.php:55 AccountGroups.php:92 AccountGroups.php:176 -#: AccountGroups.php:186 +#: AccountGroups.php:55 +#: AccountGroups.php:92 +#: AccountGroups.php:175 +#: AccountGroups.php:185 msgid "The SQL that was used to retrieve the information was" -msgstr "" -"Il SQL che è stato utilizzato per recuperare le informazioni sono state" +msgstr "Il SQL che è stato utilizzato per recuperare le informazioni sono state" #: AccountGroups.php:56 msgid "Could not check whether the group exists because" @@ -54,415 +47,774 @@ #: AccountGroups.php:69 msgid "The account group name cannot contain the character" -msgstr "Il nome del conto non può contenere il carattere" +msgstr "Il nome del conto non può contenere il carattere" -#: AccountGroups.php:69 TaxCategories.php:31 TaxProvinces.php:30 +#: AccountGroups.php:69 +#: TaxCategories.php:31 +#: TaxProvinces.php:30 #: UnitsOfMeasure.php:30 msgid "or the character" msgstr "o il carattere" #: AccountGroups.php:75 msgid "The account group name must be at least one character long" -msgstr "Il nome del gruppo account deve essere almeno un carattere a lungo" +msgstr "Il nome del gruppo account deve essere lungo almeno un carattere" #: AccountGroups.php:82 -msgid "" -"The parent account group selected appears to result in a recursive account " -"structure - select an alternative parent account group or make this group a " -"top level account group" -msgstr "" -"Il gruppo di account principale selezionato sembra comportare una struttura " -"ricorsiva conto - selezionare un'alternativa gruppo di account " -"principale o fanno di questo gruppo un gruppo di alto livello di account" +msgid "The parent account group selected appears to result in a recursive account structure - select an alternative parent account group or make this group a top level account group" +msgstr "Il gruppo di account principale selezionato sembra comportare una struttura ricorsiva conto - selezionare un'alternativa gruppo di account principale o fanno di questo gruppo un gruppo di alto livello di account" #: AccountGroups.php:93 msgid "Could not check whether the group is recursive because" msgstr "Impossibile verificare se il gruppo è ricorsivo perché" -#: AccountGroups.php:101 -msgid "" -"Since this account group is a child group, the sequence in the trial " -"balance, the section in the accounts and whether or not the account group " -"appears in the balance sheet or profit and loss account are all properties " -"inherited from the parent account group. Any changes made to these fields " -"will have no effect." -msgstr "" - -#: AccountGroups.php:106 +#: AccountGroups.php:105 msgid "The section in accounts must be an integer" msgstr "Il codice del gruppo di conti deve essere un numero intero" -#: AccountGroups.php:112 +#: AccountGroups.php:111 msgid "The sequence in the trial balance must be an integer" -msgstr "" -"Il numero che indica la posizione nel bilancio deve essere un numero intero" +msgstr "Il numero che indica la posizione nel bilancio deve essere un numero intero" -#: AccountGroups.php:118 +#: AccountGroups.php:117 msgid "The sequence in the TB must be numeric and less than" msgstr "La sequenza della TB deve essere numerico e meno" -#: AccountGroups.php:135 +#: AccountGroups.php:134 msgid "An error occurred in updating the account group" -msgstr "È verificato un errore nell'aggiornamento del gruppo di account" +msgstr "Si è verificato un errore nell'aggiornamento del gruppo di account" -#: AccountGroups.php:136 +#: AccountGroups.php:135 msgid "The SQL that was used to update the account group was" -msgstr "" -"Il SQL che è stato utilizzato per aggiornare il gruppo di conto è stato" +msgstr "Il SQL che è stato utilizzato per aggiornare il gruppo di conto è stato" -#: AccountGroups.php:138 AccountSections.php:104 PaymentMethods.php:82 +#: AccountGroups.php:137 +#: AccountSections.php:104 +#: PaymentMethods.php:82 msgid "Record Updated" msgstr "Record aggiornato" -#: AccountGroups.php:156 +#: AccountGroups.php:155 msgid "An error occurred in inserting the account group" msgstr "È verificato un errore nel mettere il gruppo di account" -#: AccountGroups.php:157 +#: AccountGroups.php:156 msgid "The SQL that was used to insert the account group was" -msgstr "" -"L'SQL che è stato utilizzato per inserire il gruppo di conto è stato" +msgstr "L'SQL che è stato utilizzato per inserire il gruppo di conto è stato" -#: AccountGroups.php:158 AccountSections.php:116 PaymentMethods.php:106 +#: AccountGroups.php:157 +#: AccountSections.php:116 +#: PaymentMethods.php:106 msgid "Record inserted" msgstr "Record inserito" -#: AccountGroups.php:175 +#: AccountGroups.php:174 msgid "An error occurred in retrieving the group information from chartmaster" -msgstr "" -"È verificato un errore di estrarre le informazioni sul gruppo da chartmaster" +msgstr "È verificato un errore di estrarre le informazioni sul gruppo da chartmaster" +#: AccountGroups.php:179 +msgid "Cannot delete this account group because general ledger accounts have been created using this group" +msgstr "Impossibile eliminare questo gruppo di conti, perché ci sono conti di contabilità generale che sono stati creati utilizzando questo gruppo" + #: AccountGroups.php:180 -msgid "" -"Cannot delete this account group because general ledger accounts have been " -"created using this group" -msgstr "" -"Non ĂŠ possibile cancellare questo conto perchĂŠ ci sono dei sottoconti che " -"vi fanno riferimento" - -#: AccountGroups.php:181 AccountGroups.php:191 AccountSections.php:137 -#: Areas.php:116 Areas.php:125 BankAccounts.php:158 CreditStatus.php:123 -#: Currencies.php:164 Currencies.php:172 Currencies.php:180 -#: CustomerBranches.php:286 CustomerBranches.php:296 CustomerBranches.php:306 -#: CustomerBranches.php:316 Customers.php:312 Customers.php:321 -#: Customers.php:329 Customers.php:337 CustomerTypes.php:147 -#: CustomerTypes.php:157 Factors.php:134 FixedAssetCategories.php:130 -#: GLAccounts.php:80 GLAccounts.php:94 Locations.php:244 Locations.php:252 -#: Locations.php:261 Locations.php:269 Locations.php:277 Locations.php:285 -#: Locations.php:293 Locations.php:301 MRPDemandTypes.php:87 -#: PaymentMethods.php:140 PaymentTerms.php:147 PaymentTerms.php:154 -#: PcExpenses.php:152 SalesCategories.php:125 SalesCategories.php:133 -#: SalesPeople.php:149 SalesPeople.php:156 SalesTypes.php:150 -#: SalesTypes.php:160 Shippers.php:82 Shippers.php:94 StockCategories.php:179 -#: Stocks.php:475 Stocks.php:484 Stocks.php:492 Stocks.php:500 Stocks.php:508 -#: Stocks.php:516 Suppliers.php:609 Suppliers.php:618 Suppliers.php:626 -#: SupplierTypes.php:145 TaxCategories.php:131 TaxGroups.php:127 -#: TaxGroups.php:134 TaxProvinces.php:125 UnitsOfMeasure.php:138 -#: WorkCentres.php:89 WorkCentres.php:95 WWW_Access.php:83 +#: AccountGroups.php:190 +#: AccountSections.php:137 +#: Areas.php:116 +#: Areas.php:125 +#: BankAccounts.php:157 +#: CreditStatus.php:125 +#: Currencies.php:143 +#: Currencies.php:151 +#: Currencies.php:158 +#: CustomerBranches.php:286 +#: CustomerBranches.php:296 +#: CustomerBranches.php:306 +#: CustomerBranches.php:316 +#: Customers.php:311 +#: Customers.php:320 +#: Customers.php:328 +#: Customers.php:336 +#: CustomerTypes.php:147 +#: CustomerTypes.php:157 +#: Factors.php:134 +#: FixedAssetCategories.php:130 +#: GLAccounts.php:80 +#: GLAccounts.php:94 +#: Locations.php:244 +#: Locations.php:252 +#: Locations.php:261 +#: Locations.php:269 +#: Locations.php:277 +#: Locations.php:285 +#: Locations.php:293 +#: Locations.php:301 +#: MRPDemandTypes.php:87 +#: PaymentMethods.php:140 +#: PaymentTerms.php:147 +#: PaymentTerms.php:154 +#: PcExpenses.php:152 +#: SalesCategories.php:125 +#: SalesCategories.php:133 +#: SalesPeople.php:144 +#: SalesPeople.php:151 +#: SalesTypes.php:145 +#: SalesTypes.php:155 +#: Shippers.php:82 +#: Shippers.php:94 +#: StockCategories.php:179 +#: Stocks.php:475 +#: Stocks.php:484 +#: Stocks.php:492 +#: Stocks.php:500 +#: Stocks.php:508 +#: Stocks.php:516 +#: Suppliers.php:609 +#: Suppliers.php:618 +#: Suppliers.php:626 +#: SupplierTypes.php:145 +#: TaxCategories.php:131 +#: TaxGroups.php:127 +#: TaxGroups.php:134 +#: TaxProvinces.php:125 +#: UnitsOfMeasure.php:138 +#: WorkCentres.php:89 +#: WorkCentres.php:95 +#: WWW_Access.php:83 msgid "There are" msgstr "Ci sono" -#: AccountGroups.php:181 +#: AccountGroups.php:180 msgid "general ledger accounts that refer to this account group" msgstr "sottoconti fanno riferimento a questo conto" -#: AccountGroups.php:185 +#: AccountGroups.php:184 msgid "An error occurred in retrieving the parent group information" -msgstr "" -"È verificato un errore di estrarre le informazioni del gruppo di genitore" +msgstr "È verificato un errore di estrarre le informazioni del gruppo di genitore" +#: AccountGroups.php:189 +msgid "Cannot delete this account group because it is a parent account group of other account group(s)" +msgstr "Impossibile eliminare questo gruppo considerazione perché si tratta di un gruppo di account principale del gruppo di altri account" + #: AccountGroups.php:190 -msgid "" -"Cannot delete this account group because it is a parent account group of " -"other account group(s)" -msgstr "" -"Impossibile eliminare questo gruppo considerazione perché si tratta di un " -"gruppo di account principale del gruppo di altri account (s)" - -#: AccountGroups.php:191 msgid "account groups that have this group as its/there parent account group" -msgstr "" -"gruppi di account che hanno questo gruppo come il suo / gruppo di " -"appartenenza ci conto" +msgstr "gruppi di account che hanno questo gruppo come il suo / gruppo di appartenenza ci conto" -#: AccountGroups.php:194 +#: AccountGroups.php:193 msgid "An error occurred in deleting the account group" -msgstr "" -"È verificato un errore durante l'eliminazione del gruppo di account" +msgstr "Si è verificato un errore durante l'eliminazione del gruppo di account" -#: AccountGroups.php:195 +#: AccountGroups.php:194 msgid "The SQL that was used to delete the account group was" -msgstr "" -"L'SQL che è stato utilizzato per eliminare il gruppo di conto è stato" +msgstr "L'SQL che è stato utilizzato per eliminare il gruppo di conto è stato" -#: AccountGroups.php:197 +#: AccountGroups.php:196 msgid "group has been deleted" msgstr "e' stato cancellato" -#: AccountGroups.php:222 +#: AccountGroups.php:221 msgid "The sql that was used to retrieve the account group information was " -msgstr "" -"L'SQL che è stato utilizzato per recuperare le informazioni di account " -"di gruppo è stato " +msgstr "L'SQL che è stato utilizzato per recuperare le informazioni di account di gruppo è stato " -#: AccountGroups.php:223 +#: AccountGroups.php:222 msgid "Could not get account groups because" -msgstr "Non ĂŠ possibile estrarre il piano dei conti perchè" +msgstr "Non àŠ possibile estrarre il piano dei conti perchè" -#: AccountGroups.php:225 AccountSections.php:175 AddCustomerContacts.php:25 -#: AddCustomerContacts.php:28 AddCustomerNotes.php:101 -#: AddCustomerTypeNotes.php:95 AgedDebtors.php:454 AgedSuppliers.php:268 -#: Areas.php:144 AuditTrail.php:11 BankReconciliation.php:13 -#: BOMExtendedQty.php:259 BOMIndented.php:246 BOMIndentedReverse.php:236 -#: BOMInquiry.php:171 BOMListing.php:112 BOMs.php:208 BOMs.php:798 -#: COGSGLPostings.php:18 CompanyPreferences.php:153 CounterSales.php:1983 -#: CounterSales.php:2107 Credit_Invoice.php:255 CreditStatus.php:20 -#: Currencies.php:28 CustEDISetup.php:17 DailyBankTransactions.php:10 -#: DebtorsAtPeriodEnd.php:124 DiscountCategories.php:10 -#: DiscountCategories.php:128 DiscountMatrix.php:16 EDIMessageFormat.php:104 -#: FixedAssetLocations.php:9 FixedAssetRegister.php:13 -#: FixedAssetRegister.php:238 FixedAssetTransfer.php:31 FormDesigner.php:129 -#: GLBalanceSheet.php:351 GLBudgets.php:28 GLJournal.php:228 -#: InventoryPlanning.php:374 InventoryPlanningPrefSupplier.php:474 -#: Labels.php:117 Labels.php:273 MRPReport.php:515 OutstandingGRNs.php:150 -#: PcAssignCashToTab.php:56 PcAssignCashToTab.php:130 -#: PcAssignCashToTab.php:146 PcAssignCashToTab.php:183 PDFPickingList.php:28 -#: PDFPrintLabel.php:131 PDFStockLocTransfer.php:21 -#: PO_AuthorisationLevels.php:10 POReport.php:60 POReport.php:64 -#: POReport.php:68 PO_SelectOSPurchOrder.php:133 PricesBasedOnMarkUp.php:11 -#: Prices_Customer.php:39 Prices.php:30 PurchData.php:138 PurchData.php:249 -#: PurchData.php:268 RecurringSalesOrders.php:310 SalesAnalReptCols.php:51 -#: SalesAnalRepts.php:11 SalesCategories.php:11 SalesGLPostings.php:17 -#: SalesGraph.php:34 SalesPeople.php:20 SalesTypes.php:20 SelectAsset.php:45 -#: SelectCompletedOrder.php:11 SelectContract.php:78 SelectCreditItems.php:202 -#: SelectCreditItems.php:270 SelectCustomer.php:323 SelectGLAccount.php:19 -#: SelectGLAccount.php:79 SelectOrderItems.php:618 SelectOrderItems.php:1463 -#: SelectOrderItems.php:1583 SelectProduct.php:485 SelectSalesOrder.php:454 -#: SelectSupplier.php:9 SelectSupplier.php:192 SelectWorkOrder.php:9 -#: SelectWorkOrder.php:145 ShipmentCosting.php:11 Shipments.php:17 -#: Shippers.php:123 Shippers.php:159 Shipt_Select.php:8 -#: StockLocMovements.php:13 StockLocStatus.php:26 Suppliers.php:302 -#: SupplierTenders.php:260 SupplierTenders.php:317 SupplierTransInquiry.php:11 -#: TaxGroups.php:15 TaxProvinces.php:10 TopItems.php:65 -#: WhereUsedInquiry.php:18 WorkCentres.php:110 WorkCentres.php:157 -#: WorkOrderCosting.php:12 WorkOrderEntry.php:10 WorkOrderIssue.php:20 -#: WorkOrderReceive.php:13 WorkOrderStatus.php:41 WWW_Access.php:11 -#: WWW_Users.php:32 Z_BottomUpCosts.php:51 +#: AccountGroups.php:224 +#: AccountSections.php:175 +#: AddCustomerContacts.php:25 +#: AddCustomerContacts.php:28 +#: AddCustomerNotes.php:97 +#: AddCustomerTypeNotes.php:94 +#: AgedDebtors.php:454 +#: AgedSuppliers.php:277 +#: Areas.php:144 +#: AuditTrail.php:11 +#: BankReconciliation.php:13 +#: BOMExtendedQty.php:272 +#: BOMIndented.ph... [truncated message content] |