From: <tim...@us...> - 2010-12-22 14:38:00
|
Revision: 4222 http://web-erp.svn.sourceforge.net/web-erp/?rev=4222&view=rev Author: tim_schofield Date: 2010-12-22 14:37:50 +0000 (Wed, 22 Dec 2010) Log Message: ----------- $Message Modified Paths: -------------- trunk/includes/session.inc trunk/locale/pt_BR.utf8/LC_MESSAGES/messages.po trunk/locale/sv_SE.utf8/LC_MESSAGES/messages.po trunk/locale/zh_HK.utf8/LC_MESSAGES/messages.po Modified: trunk/includes/session.inc =================================================================== --- trunk/includes/session.inc 2010-12-22 14:36:25 UTC (rev 4221) +++ trunk/includes/session.inc 2010-12-22 14:37:50 UTC (rev 4222) @@ -12,7 +12,7 @@ header('Location:' . $rootpath . '/install/index.php'); } include($PathPrefix . 'config.php'); -$DBVersion=49; +$DBVersion=50; if (isset($SessionSavePath)){ session_save_path($SessionSavePath); } Modified: trunk/locale/pt_BR.utf8/LC_MESSAGES/messages.po =================================================================== --- trunk/locale/pt_BR.utf8/LC_MESSAGES/messages.po 2010-12-22 14:36:25 UTC (rev 4221) +++ trunk/locale/pt_BR.utf8/LC_MESSAGES/messages.po 2010-12-22 14:37:50 UTC (rev 4222) @@ -12,6 +12,8 @@ "Content-Transfer-Encoding: 8bit\n" "X-Poedit-Language: Portuguese\n" "X-Poedit-Country: BRAZIL\n" +"X-Launchpad-Export-Date: 2010-09-16 09:48+0000\n" +"X-Generator: Launchpad (build Unknown)\n" #: AccountGroups.php:9 index.php:1251 msgid "Account Groups" Modified: trunk/locale/sv_SE.utf8/LC_MESSAGES/messages.po =================================================================== --- trunk/locale/sv_SE.utf8/LC_MESSAGES/messages.po 2010-12-22 14:36:25 UTC (rev 4221) +++ trunk/locale/sv_SE.utf8/LC_MESSAGES/messages.po 2010-12-22 14:37:50 UTC (rev 4222) @@ -14,6 +14,8 @@ "MIME-Version: 1.0\n" "Content-Type: text/plain; charset=UTF-8\n" "Content-Transfer-Encoding: 8bit\n" +"X-Launchpad-Export-Date: 2010-09-16 09:48+0000\n" +"X-Generator: Launchpad (build Unknown)\n" #: AccountGroups.php:9 index.php:1251 msgid "Account Groups" Modified: trunk/locale/zh_HK.utf8/LC_MESSAGES/messages.po =================================================================== --- trunk/locale/zh_HK.utf8/LC_MESSAGES/messages.po 2010-12-22 14:36:25 UTC (rev 4221) +++ trunk/locale/zh_HK.utf8/LC_MESSAGES/messages.po 2010-12-22 14:37:50 UTC (rev 4222) @@ -14,40 +14,42 @@ "MIME-Version: 1.0\n" "Content-Type: text/plain; charset=Big5\n" "Content-Transfer-Encoding: 8bit\n" +"X-Launchpad-Export-Date: 2010-09-16 09:48+0000\n" +"X-Generator: Launchpad (build Unknown)\n" #: AccountGroups.php:8 index.php:1038 msgid "Account Groups" -msgstr "\xB7|\xADp\xAC\xEC\xA5\xD8" +msgstr "·|p¬ì¥Ø" #: AccountGroups.php:18 msgid "" "An error occurred in retrieving the account groups of the parent account " "group during the check for recursion" -msgstr "\xA6b\xBB\xBC\xC2k\xC0ˬd\xAEɴ\xA3\xA8\xFA\xA5D\xB7|\xADp\xB8s\xB2ժ\xBA\xB7|\xADp\xAC\xEC\xA5خɵo\xA5Ϳ\xF9\xBB~" +msgstr "Šb»ŒÂkÀˬd®ÉŽ£šú¥D·|pžs²Õªº·|p¬ì¥Ø®Éµo¥Í¿ù»~" #: AccountGroups.php:19 msgid "" "The SQL that was used to retrieve the account groups of the parent account " "group and that failed in the process was" -msgstr "\xA5Χ@\xB4\xA3\xA8\x{2924D23}\xA8\xFA\xB7|\xADp\xAC\xEC\xA5إD\xB1b\xA5زծɻ~\xA5\xA2\xB1Ѫ\xBA SQL \xACO" +msgstr "¥Î§@Ž£šú€€Ž£šú·|p¬ì¥Ø¥D±b¥Ø²Õ®É»~¥¢±Ñªº SQL ¬O" #: AccountGroups.php:61 #, fuzzy msgid "The account group name already exists in the database" -msgstr "\xB7|\xADp\xAC\xEC\xA5ئW\xBA٤\xA3\xAF\xE0\xA5]\xA7t\xB3o\xA6r\xA4\xB8" +msgstr "·|p¬ì¥ØŠWºÙ€£¯à¥]§t³oŠr€ž" #: AccountGroups.php:67 msgid "The account group name cannot contain the character" -msgstr "\xB7|\xADp\xAC\xEC\xA5ئW\xBA٤\xA3\xAF\xE0\xA5]\xA7t\xB3o\xA6r\xA4\xB8" +msgstr "·|p¬ì¥ØŠWºÙ€£¯à¥]§t³oŠr€ž" #: AccountGroups.php:67 AccountSections.php:74 PaymentMethods.php:37 #: TaxCategories.php:30 TaxProvinces.php:30 UnitsOfMeasure.php:30 msgid "or the character" -msgstr "\xA9γo\xA6r\xA4\xB8" +msgstr "©Î³oŠr€ž" #: AccountGroups.php:73 msgid "The account group name must be at least one character long" -msgstr "\xB7|\xADp\xAC\xEC\xA5ئW\xBA٥\xB2\xB6\xB7\xA4\xA3\xA4֩\xF3 1 \xADӦr\xA4\xB8" +msgstr "·|p¬ì¥ØŠWºÙ¥²¶·€£€Ö©ó 1 ÓŠr€ž" #: AccountGroups.php:80 msgid "" @@ -55,35 +57,35 @@ "structure - select an alternative parent account group or make this group a " "top level account group" msgstr "" -"\xBF\xEF\xA8\xFA\xAA\xBA\xA5D\xB7|\xADp\xB8s\xB2\xD5\xC5\xE3\xA5ܵ\xB2\xAAG\xA9\xF3\xBB\xBC\xC2k\xAA\xBA\xB7|\xADp\xB5\xB2\xBAc - \xBF\xEF\xA8\xFA\xA8\xE4\xA5L\xA5D\xB7|\xADp\xAC\xEC\xA5\xD8 \xA9\xCE \xA8ϳo\xB8s\xB2լ\xB0\xB3\xBB" -"\xBCh\xB8s\xB2\xD5" +"¿ïšúªº¥D·|pžs²ÕÅã¥Üµ²ªG©ó»ŒÂkªº·|pµ²ºc - ¿ïšúšä¥L¥D·|p¬ì¥Ø ©Î šÏ³ožs²Õ¬°³»" +"Œhžs²Õ" #: AccountGroups.php:99 msgid "The section in accounts must be an integer" -msgstr "\xB7|\xADp\xAC\xEC\xA5\xD8\xC3\xFE\xA7O\xA5\xB2\xB6\xB7\xACO\xBE\xE3\xBC\xC6" +msgstr "·|p¬ì¥ØÃþ§O¥²¶·¬OŸãŒÆ" #: AccountGroups.php:105 msgid "The sequence in the trial balance must be an integer" -msgstr "\xB8պ\xE2\xAA\x{D9B8}\xA7ǥ\xB2\xB6\xB7\xACO\xBE\xE3\xBC\xC6" +msgstr "žÕºâªíŠž§Ç¥²¶·¬OŸãŒÆ" #: AccountGroups.php:111 #, fuzzy msgid "The sequence in the TB must be numeric and less than" -msgstr "\xB8պ\xE2\xAA\x{DABA}\xA6\xB8\xA7ǥ\xB2\xB6\xB7\xACO\xA4֩\xF3" +msgstr "žÕºâªíªºŠž§Ç¥²¶·¬O€Ö©ó" #: AccountGroups.php:129 AccountSections.php:105 PaymentMethods.php:87 msgid "Record Updated" -msgstr "\xA7\xF3\xB7s\xB0O\xBF\xFD" +msgstr "§ó·s°O¿ý" #: AccountGroups.php:147 AccountSections.php:117 PaymentMethods.php:109 msgid "Record inserted" -msgstr "\xB4\xA1\xA4J\xB0O\xBF\xFD" +msgstr "Ž¡€J°O¿ý" #: AccountGroups.php:167 msgid "" "Cannot delete this account group because general ledger accounts have been " "created using this group" -msgstr "\xC1`\xB1b\xA4w\xB2\xA3\xA5ͦ\xB9\xB7|\xADp\xAC\xEC\xA5\xD8, \xA4\xA3\xAF\xE0\xA7R\xB0\xA3" +msgstr "Á`±b€w²£¥Íй·|p¬ì¥Ø, €£¯à§R°£" #: AccountGroups.php:168 AccountGroups.php:176 AccountSections.php:138 #: Areas.php:117 Areas.php:126 BankAccounts.php:149 CreditStatus.php:123 @@ -104,51 +106,51 @@ #: UnitsOfMeasure.php:140 UnitsOfMeasure.php:147 WorkCentres.php:90 #: WorkCentres.php:96 WWW_Access.php:84 msgid "There are" -msgstr "\xB3o\xACO" +msgstr "³o¬O" #: AccountGroups.php:168 msgid "general ledger accounts that refer to this account group" -msgstr "\xA6\xB9\xB7|\xADp\xAC\xEC\xA5ت\xBA\xC1`\xB1b" +msgstr "й·|p¬ì¥ØªºÁ`±b" #: AccountGroups.php:175 msgid "" "Cannot delete this account group because it is a parent account group of " "other account group(s)" -msgstr "\xA5\xBC\xAF\xE0\xA7R\xB0\xA3\xB3o\xB7|\xADp\xAC\xEC\xA5\xD8, \xA6]\xAC\xB0\xB3o\xACO\xA8\xE4\xA5L\xAC\xEC\xA5ت\xBA\xA5D\xB1b\xA5ز\xD5" +msgstr "¥Œ¯à§R°£³o·|p¬ì¥Ø, Š]¬°³o¬Ošä¥L¬ì¥Øªº¥D±b¥Ø²Õ" #: AccountGroups.php:176 msgid "account groups that have this group as its/there parent account group" -msgstr "\xB3o\xA5D\xB8s\xB2դU\xC4ݪ\xBA\xB7|\xADp\xAC\xEC\xA5\xD8" +msgstr "³o¥Džs²Õ€UÄݪº·|p¬ì¥Ø" #: AccountGroups.php:180 msgid "group has been deleted" -msgstr "\xAC\xEC\xA5ؤw\xA7R\xB0\xA3" +msgstr "¬ì¥Ø€w§R°£" #: AccountGroups.php:205 msgid "Could not get account groups because" -msgstr "\xA4\xA3\xAF\xE0\xA8\xFA\xB1o\xB7|\xADp\xAC\xEC\xA5\xD8, \xA6]\xAC\xB0" +msgstr "€£¯àšú±o·|p¬ì¥Ø, Š]¬°" #: AccountGroups.php:210 msgid "Group Name" -msgstr "\xAC\xEC\xA5ئW\xBA\xD9" +msgstr "¬ì¥ØŠWºÙ" #: AccountGroups.php:211 EDIMessageFormat.php:140 msgid "Section" -msgstr "\xA4\xC0\xC3\xFE" +msgstr "€ÀÃþ" #: AccountGroups.php:212 AccountGroups.php:367 msgid "Sequence In TB" -msgstr "\xB8պ\xE2\xAA\x{D9B8}\xA7\xC7" +msgstr "žÕºâªíŠž§Ç" #: AccountGroups.php:213 AccountGroups.php:351 GLProfit_Loss.php:8 #: GLProfit_Loss.php:101 GLProfit_Loss.php:102 GLProfit_Loss.php:149 #: SelectGLAccount.php:51 SelectGLAccount.php:65 msgid "Profit and Loss" -msgstr "\xB7l\xAFq\xAA\xED" +msgstr "·l¯qªí" #: AccountGroups.php:214 AccountGroups.php:312 msgid "Parent Group" -msgstr "\xA5D\xB8s\xB2\xD5" +msgstr "¥Džs²Õ" #: AccountGroups.php:230 AccountGroups.php:233 AccountGroups.php:355 #: AccountGroups.php:357 BOMs.php:127 BOMs.php:689 BOMs.php:691 @@ -175,7 +177,7 @@ #: SystemParameters.php:806 SystemParameters.php:808 TaxGroups.php:295 #: TaxGroups.php:364 TaxGroups.php:367 WWW_Users.php:536 WWW_Users.php:538 msgid "Yes" -msgstr "\xACO" +msgstr "¬O" #: AccountGroups.php:236 AccountGroups.php:360 AccountGroups.php:362 #: BOMs.php:129 BOMs.php:688 BOMs.php:692 CompanyPreferences.php:435 @@ -202,7 +204,7 @@ #: TaxGroups.php:365 TaxGroups.php:368 WWW_Users.php:535 WWW_Users.php:539 #: includes/PDFLowGPPageHeader.inc:31 includes/PDFTaxPageHeader.inc:34 msgid "No" -msgstr "\xA7_" +msgstr "§_" #: AccountGroups.php:245 AccountSections.php:195 AddCustomerContacts.php:121 #: AddCustomerNotes.php:121 AddCustomerTypeNotes.php:121 Areas.php:162 @@ -223,7 +225,7 @@ #: includes/InputSerialItems.php:82 #, php-format msgid "Edit" -msgstr "\xBDs\xBF\xE8" +msgstr "œs¿è" #: AccountGroups.php:246 AccountSections.php:199 AddCustomerContacts.php:122 #: AddCustomerNotes.php:122 AddCustomerTypeNotes.php:122 Areas.php:163 @@ -249,29 +251,29 @@ #: WWW_Users.php:277 includes/InputSerialItemsKeyed.php:53 #, php-format msgid "Delete" -msgstr "\xA7R\xB0\xA3" +msgstr "§R°£" #: AccountGroups.php:254 msgid "Review Account Groups" -msgstr "\xC0˵\xF8\xB7|\xADp\xAC\xEC\xA5\xD8" +msgstr "À˵ø·|p¬ì¥Ø" #: AccountGroups.php:285 GLAccounts.php:244 GLAccounts.php:297 #: Z_ImportGLAccountGroups.php:27 msgid "Account Group" -msgstr "\xB7|\xADp\xAC\xEC\xA5\xD8" +msgstr "·|p¬ì¥Ø" #: AccountGroups.php:309 #, fuzzy msgid "Account Group Name" -msgstr "\xB7|\xADp\xAC\xEC\xA5ئW\xBA\xD9" +msgstr "·|p¬ì¥ØŠWºÙ" #: AccountGroups.php:319 AccountGroups.php:321 msgid "Top Level Group" -msgstr "\xB3\xBB\xBCh\xB8s\xB2\xD5" +msgstr "³»Œhžs²Õ" #: AccountGroups.php:335 msgid "Section In Accounts" -msgstr "\xB7|\xADp\xC3\xFE\xA7O" +msgstr "·|pÃþ§O" #: AccountGroups.php:374 AccountSections.php:262 AddCustomerContacts.php:182 #: AddCustomerNotes.php:182 AddCustomerTypeNotes.php:182 Areas.php:218 @@ -286,93 +288,93 @@ #: TaxProvinces.php:226 UnitsOfMeasure.php:250 WorkCentres.php:260 #: WWW_Users.php:557 msgid "Enter Information" -msgstr "\xBF\xE9\xA4J\xB8\xEA\xAE\xC6" +msgstr "¿é€Jžê®Æ" #: AccountSections.php:8 index.php:1043 msgid "Account Sections" -msgstr "\xB7|\xADp\xC3\xFE\xA7O" +msgstr "·|pÃþ§O" #: AccountSections.php:67 #, fuzzy msgid "The account section already exists in the database" -msgstr "\xBF\xE9\xA4J\xAA\xBA\xB3\xA1\xA5\xF3\xBDs\xBDX\xA4\xA3\xA6s\xA6b\xA9\xF3\xB8\xEA\xAEƮw" +msgstr "¿é€Jªº³¡¥óœsœX€£ŠsŠb©óžê®Æ®w" #: AccountSections.php:74 msgid "The account section name cannot contain the character" -msgstr "\xB7|\xADp\xC3\xFE\xA7O\xA4\xA3\xAF\xE0\xA7t\xA6\xB3\xB3o\xA6r\xA4\xB8" +msgstr "·|pÃþ§O€£¯à§tг³oŠr€ž" #: AccountSections.php:80 #, fuzzy msgid "The account section name must contain at least one character" -msgstr "\xB7|\xADp\xC3\xFE\xA7O\xA4\xA3\xAF\xE0\xA7t\xA6\xB3\xB3o\xA6r\xA4\xB8" +msgstr "·|pÃþ§O€£¯à§tг³oŠr€ž" #: AccountSections.php:86 AccountSections.php:92 msgid "The section number must be an integer" -msgstr "\xB7|\xADp\xC3\xFE\xA7O\xA5\xB2\xB6\xB7\xACO\xBE\xE3\xBC\xC6" +msgstr "·|pÃþ§O¥²¶·¬OŸãŒÆ" #: AccountSections.php:137 msgid "" "Cannot delete this account section because general ledger accounts groups " "have been created using this section" -msgstr "\xC1`\xB1b\xA4w\xB2\xA3\xA5ͦ\xB9\xB7|\xADp\xC3\xFE\xA7O, \xA4\xA3\xAF\xE0\xA7R\xB0\xA3" +msgstr "Á`±b€w²£¥Íй·|pÃþ§O, €£¯à§R°£" #: AccountSections.php:138 msgid "general ledger accounts groups that refer to this account section" -msgstr "\xA6\xB9\xB7|\xADp\xC3\xFE\xA7O\xAA\xBA\xC1`\xB1b" +msgstr "й·|pÃþ§OªºÁ`±b" #: AccountSections.php:149 msgid "section has been deleted" -msgstr "\xC3\xFE\xA7O\xA4w\xA7R\xB0\xA3" +msgstr "Ãþ§O€w§R°£" #: AccountSections.php:174 msgid "Could not get account group sections because" -msgstr "\xA4\xA3\xAF\xE0\xA8\xFA\xB1o\xB7|\xADp\xC3\xFE\xA7O, \xA6]\xAC\xB0" +msgstr "€£¯àšú±o·|pÃþ§O, Š]¬°" #: AccountSections.php:179 AccountSections.php:237 AccountSections.php:254 msgid "Section Number" -msgstr "\xC3\xFE\xA7O\xBDs\xB8\xB9" +msgstr "Ãþ§Oœsž¹" #: AccountSections.php:180 AccountSections.php:257 msgid "Section Description" -msgstr "\xC3\xFE\xA7O\xA4\xBA\xAEe" +msgstr "Ãþ§O€º®e" #: AccountSections.php:197 msgid "Restricted" -msgstr "\xA8\xFC\xAD\xAD\xA8\xEE" +msgstr "šüšî" #: AccountSections.php:208 msgid "Review Account Sections" -msgstr "\xC0˵\xF8\xB7|\xADp\xC3\xFE\xA7O" +msgstr "À˵ø·|pÃþ§O" #: AccountSections.php:227 msgid "Could not retrieve the requested section please try again." -msgstr "\xA4\xA3\xAF\xE0\xA8\xFA\xA6^\xADn\xA8D\xAA\xBA\xC3\xFE\xA7O, \xBDЭ\xAB\xB8\xD5" +msgstr "€£¯àšúŠ^nšDªºÃþ§O, œÐ«žÕ" #: AddCustomerContacts.php:5 AddCustomerContacts.php:48 SelectCustomer.php:613 #: SelectCustomer.php:653 #, fuzzy msgid "Customer Contacts" -msgstr "\xABȤ\xE1\xB3\xF8\xBB\xF9\xB3\xE6" +msgstr "«È€á³ø»ù³æ" #: AddCustomerContacts.php:19 CustEDISetup.php:10 Customers.php:385 #: Z_CheckDebtorsControl.php:20 msgid "Back to Customers" -msgstr "\xB7j\xB4M\xABȤ\xE1" +msgstr "·jŽM«È€á" #: AddCustomerContacts.php:30 #, fuzzy msgid "The Contact must be an integer." -msgstr "\xB1b\xA5ؽs\xBDX\xA5\xB2\xB6\xB7\xACO\xBE\xE3\xBC\xC6" +msgstr "±b¥ØœsœX¥²¶·¬OŸãŒÆ" #: AddCustomerContacts.php:33 #, fuzzy msgid "The contact's name must be forty characters or less long" -msgstr "\xB1b\xA4\xE1\xA6W\xBA٥\xB2\xB6\xB7\xA4\xA3\xA6h\xA9\xF3 50 \xA6r\xA4\xB8" +msgstr "±b€áŠWºÙ¥²¶·€£Šh©ó 50 Šr€ž" #: AddCustomerContacts.php:36 #, fuzzy msgid "The contact's name may not be empty" -msgstr "\xB5|\xC3\xFE\xA6W\xBA٤\xA3\xAF\xE0\xAFd\xAA\xC5" +msgstr "µ|ÃþŠWºÙ€£¯à¯dªÅ" #: AddCustomerContacts.php:48 AddCustomerNotes.php:48 #: AddCustomerTypeNotes.php:48 Areas.php:74 CustomerTypes.php:48 @@ -380,22 +382,22 @@ #: SalesAnalReptCols.php:128 SalesPeople.php:92 SalesTypes.php:61 #: Stocks.php:335 Suppliers.php:475 msgid "has been updated" -msgstr "\xA4w\xA7\xF3\xB7s" +msgstr "€w§ó·s" #: AddCustomerContacts.php:59 #, fuzzy msgid "The contact record has been added" -msgstr "\xA7馩\xB0w\xB7s\xBCW" +msgstr "§éŠ©°ò·¡€w·sŒW" #: AddCustomerContacts.php:83 #, fuzzy msgid "The contact record has been deleted" -msgstr "\xA7馩\xB0w\xA7R\xB0\xA3" +msgstr "§éŠ©°ò·¡€w§R°£" #: AddCustomerContacts.php:93 #, fuzzy msgid "Contacts for Customer: <b>" -msgstr "\xA9M\xA9\xF3\xABȤ\xE1" +msgstr "©M©ó«È€á" #: AddCustomerContacts.php:102 CompanyPreferences.php:226 #: CustomerBranches.php:365 Customers.php:748 Customers.php:799 @@ -405,23 +407,23 @@ #: includes/InputSerialItemsFile.php:84 includes/InputSerialItemsFile.php:124 #: includes/PDFTaxPageHeader.inc:36 msgid "Name" -msgstr "\xA6W\xBA\xD9" +msgstr "ŠWºÙ" #: AddCustomerContacts.php:103 AddCustomerContacts.php:175 Customers.php:749 #: Customers.php:800 SelectCustomer.php:617 WWW_Access.php:108 #: WWW_Access.php:168 msgid "Role" -msgstr "\xA8\xAD\xA5\xF7" +msgstr "š¥÷" #: AddCustomerContacts.php:104 Customers.php:801 #, fuzzy msgid "Phone no" -msgstr "\xB9q\xB8\xDC" +msgstr "¹qžÜ" #: AddCustomerContacts.php:105 AddCustomerContacts.php:179 Customers.php:751 #: Customers.php:802 SelectCustomer.php:619 SystemParameters.php:270 msgid "Notes" -msgstr "\xB3Ƶ\xF9" +msgstr "³Æµù" #: AddCustomerContacts.php:139 msgid "Review all contacts for this Customer" @@ -430,60 +432,60 @@ #: AddCustomerContacts.php:168 #, fuzzy msgid "Contact Code" -msgstr "\xC3\xFE\xA7O\xBDs\xBDX" +msgstr "Ãþ§OœsœX" #: AddCustomerContacts.php:173 Factors.php:212 Factors.php:230 #: SupplierContacts.php:217 msgid "Contact Name" -msgstr "\xC1pô\xA6W\xBA\xD9" +msgstr "ÁpÃŽŠWºÙ" #: AddCustomerContacts.php:177 PO_Header.php:511 SelectCreditItems.php:234 #: SelectCustomer.php:444 SelectOrderItems.php:583 #: includes/PDFStatementPageHeader.inc:63 includes/PDFTransPageHeader.inc:81 #: includes/PDFTransPageHeaderPortrait.inc:104 msgid "Phone" -msgstr "\xB9q\xB8\xDC" +msgstr "¹qžÜ" #: AddCustomerNotes.php:5 AddCustomerNotes.php:48 SelectCustomer.php:661 #: SelectCustomer.php:700 #, fuzzy msgid "Customer Notes" -msgstr "\xABȤ\xE1\xBDs\xBDX" +msgstr "«È€áœsœX" #: AddCustomerNotes.php:19 AddCustomerTypeNotes.php:19 #, fuzzy msgid "Back to Select Customer" -msgstr "\xB7j\xB4M\xABȤ\xE1" +msgstr "·jŽM«È€á" #: AddCustomerNotes.php:30 #, fuzzy msgid "The contact priority must be an integer." -msgstr "\xB1b\xA5ؽs\xBDX\xA5\xB2\xB6\xB7\xACO\xBE\xE3\xBC\xC6" +msgstr "±b¥ØœsœX¥²¶·¬OŸãŒÆ" #: AddCustomerNotes.php:33 AddCustomerTypeNotes.php:33 #, fuzzy msgid "The contact's notes must be two hundred characters or less long" -msgstr "\xB1b\xA4\xE1\xA6W\xBA٥\xB2\xB6\xB7\xA4\xA3\xA6h\xA9\xF3 50 \xA6r\xA4\xB8" +msgstr "±b€áŠWºÙ¥²¶·€£Šh©ó 50 Šr€ž" #: AddCustomerNotes.php:36 AddCustomerTypeNotes.php:36 #, fuzzy msgid "The contact's notes may not be empty" -msgstr "\xB5|\xC3\xFE\xA6W\xBA٤\xA3\xAF\xE0\xAFd\xAA\xC5" +msgstr "µ|ÃþŠWºÙ€£¯à¯dªÅ" #: AddCustomerNotes.php:59 #, fuzzy msgid "The contact notes record has been added" -msgstr "\xA7馩\xB0w\xB7s\xBCW" +msgstr "§éŠ©°ò·¡€w·sŒW" #: AddCustomerNotes.php:83 #, fuzzy msgid "The contact note record has been deleted" -msgstr "\xA7馩\xB0w\xA7R\xB0\xA3" +msgstr "§éŠ©°ò·¡€w§R°£" #: AddCustomerNotes.php:93 #, fuzzy msgid "Notes for Customer: <b>" -msgstr "\xA9M\xA9\xF3\xABȤ\xE1" +msgstr "©M©ó«È€á" #: AddCustomerNotes.php:102 AddCustomerNotes.php:177 #: AddCustomerTypeNotes.php:102 AddCustomerTypeNotes.php:177 @@ -502,11 +504,11 @@ #: includes/PDFTransPageHeader.inc:48 #: includes/PDFTransPageHeaderPortrait.inc:57 msgid "Date" -msgstr "\xA4\xE9\xB4\xC1" +msgstr "€éŽÁ" #: AddCustomerNotes.php:103 AddCustomerTypeNotes.php:103 Stocks.php:799 msgid "Note" -msgstr "\xB3Ƶ\xF9" +msgstr "³Æµù" #: AddCustomerNotes.php:104 AddCustomerNotes.php:175 msgid "WWW" @@ -516,79 +518,79 @@ #: AddCustomerTypeNotes.php:105 AddCustomerTypeNotes.php:179 #, fuzzy msgid "Priority" -msgstr "\xA7Q\xBC\xED" +msgstr "§QŒí" #: AddCustomerNotes.php:139 #, fuzzy msgid "Review all notes for this Customer" -msgstr "\xA4\xC0\xA4\xBD\xA5q/\xABȤ᪺\xBEP\xB0\xE2\xADq\xB3\xE6" +msgstr "€À€œ¥q/«È€áªºŸP°âq³æ" #: AddCustomerNotes.php:168 AddCustomerTypeNotes.php:168 #, fuzzy msgid "Note ID" -msgstr "\xB3Ƶ\xF9" +msgstr "³Æµù" #: AddCustomerNotes.php:173 #, fuzzy msgid "Contact Note" -msgstr "\xC3\xFE\xA7O\xBDs\xBDX" +msgstr "Ãþ§OœsœX" #: AddCustomerTypeNotes.php:5 SelectCustomer.php:708 #, fuzzy msgid "Customer Type (Group) Notes" -msgstr "\xABȤ\xE1\xA4w\xA7\xF3\xB7s" +msgstr "«È€á€w§ó·s" #: AddCustomerTypeNotes.php:30 #, fuzzy msgid "The Contact priority must be an integer." -msgstr "\xB1b\xA5ؽs\xBDX\xA5\xB2\xB6\xB7\xACO\xBE\xE3\xBC\xC6" +msgstr "±b¥ØœsœX¥²¶·¬OŸãŒÆ" #: AddCustomerTypeNotes.php:48 SelectCustomer.php:748 #, fuzzy msgid "Customer Group Notes" -msgstr "\xABȤ\xE1\xA4w\xA7\xF3\xB7s" +msgstr "«È€á€w§ó·s" #: AddCustomerTypeNotes.php:59 #, fuzzy msgid "The contact group notes record has been added" -msgstr "\xA7馩\xB0w\xB7s\xBCW" +msgstr "§éŠ©°ò·¡€w·sŒW" #: AddCustomerTypeNotes.php:83 #, fuzzy msgid "The contact group note record has been deleted" -msgstr "\xA7馩\xB0w\xA7R\xB0\xA3" +msgstr "§éŠ©°ò·¡€w§R°£" #: AddCustomerTypeNotes.php:93 #, fuzzy msgid "Notes for Customer Type: <b>" -msgstr "\xA9M\xA9\xF3\xABȤ\xE1" +msgstr "©M©ó«È€á" #: AddCustomerTypeNotes.php:104 AddCustomerTypeNotes.php:175 #, fuzzy msgid "href" -msgstr "\xAD\xBA\xBF\xEF" +msgstr "º¿ï" #: AddCustomerTypeNotes.php:139 #, fuzzy msgid "Review all notes for this Customer Type" -msgstr "\xA4\xC0\xA4\xBD\xA5q/\xABȤ᪺\xBEP\xB0\xE2\xADq\xB3\xE6" +msgstr "€À€œ¥q/«È€áªºŸP°âq³æ" #: AddCustomerTypeNotes.php:173 #, fuzzy msgid "Contact Group Note" -msgstr "\xB7|\xADp\xAC\xEC\xA5ئW\xBA\xD9" +msgstr "·|p¬ì¥ØŠWºÙ" #: AgedDebtors.php:18 msgid "Aged Customer Balance Listing" -msgstr "\xC2«Ȥᵲ\xBEl\xA6C\xAA\xED" +msgstr "«ȀᵲŸlŠCªí" #: AgedDebtors.php:19 msgid "Aged Customer Balances" -msgstr "\xC2«Ȥᵲ\xBEl" +msgstr "«ȀᵲŸl" #: AgedDebtors.php:266 AgedDebtors.php:362 AgedDebtors.php:430 msgid "Aged Customer Account Analysis" -msgstr "\xC2«Ȥ\xE1\xA4\xE1\xA4f\xA4\xC0\xAAR" +msgstr "«Ȁá€á€f€ÀªR" #: AgedDebtors.php:266 AgedDebtors.php:362 AgedDebtors.php:430 #: AgedSuppliers.php:104 BOMListing.php:46 BOMListing.php:57 @@ -608,12 +610,12 @@ #: includes/PDFPaymentRun_PymtFooter.php:181 #: includes/PDFPaymentRun_PymtFooter.php:213 msgid "Problem Report" -msgstr "\xB0\xDD\xC3D\xB3\xF8\xA7i" +msgstr "°ÝÃD³ø§i" #: AgedDebtors.php:268 CustomerInquiry.php:81 CustomerInquiry.php:102 #: DebtorsAtPeriodEnd.php:61 msgid "The customer details could not be retrieved by the SQL because" -msgstr "\xABȤ\xE1\xB8\xEA\xAEƤ\xA3\xAF\xE0\xB1qSQL\xA8\xFA\xB1o, \xA6]\xAC\xB0" +msgstr "«È€ážê®Æ€£¯à±qSQLšú±o, Š]¬°" #: AgedDebtors.php:269 AgedDebtors.php:365 AgedDebtors.php:436 #: AgedSuppliers.php:107 AgedSuppliers.php:187 BOMListing.php:49 @@ -652,11 +654,11 @@ #: includes/ConstructSQLForUserDefinedSalesReport.inc:188 #: includes/ConstructSQLForUserDefinedSalesReport.inc:340 msgid "Back to the menu" -msgstr "\xAA\xF0\xA6^\xA5ؿ\xFD" +msgstr "ªðŠ^¥Ø¿ý" #: AgedDebtors.php:364 msgid "The details of outstanding transactions for customer" -msgstr "\xA5\xBC\xB3B\xB2z\xABȤ\xE1\xA5\xE6\xA9\x{1A49EE}\xC6" +msgstr "¥Œ³B²z«È€á¥æ©ö€§®Æ" #: AgedDebtors.php:364 AgedSuppliers.php:186 GLAccountInquiry.php:145 #: PO_Items.php:364 PO_Items.php:394 PO_Items.php:496 PO_Items.php:568 @@ -664,7 +666,7 @@ #: StockLocTransferReceive.php:369 StockQuantityByDate.php:103 #: includes/SelectOrderItems_IntoCart.inc:49 msgid "could not be retrieved because" -msgstr "\xA4\xA3\xAF\xE0\xA8\xFA\xB1o, \xA6]\xAC\xB0" +msgstr "€£¯àšú±o, Š]¬°" #: AgedDebtors.php:367 AgedSuppliers.php:189 Areas.php:96 #: ConfirmDispatch_Invoice.php:153 ConfirmDispatch_Invoice.php:905 @@ -690,59 +692,59 @@ #: includes/PDFPaymentRun_PymtFooter.php:218 includes/ConnectDB_mysqli.inc:55 #: includes/ConnectDB_mysql.inc:38 msgid "The SQL that failed was" -msgstr "\xA5\xA2\xB1Ѫ\xBA SQL \xACO, " +msgstr "¥¢±Ñªº SQL ¬O, " #: AgedDebtors.php:432 msgid "There are no customers meeting the critiera specified to list" -msgstr "\xA8S\xA6\xB3\xABȤ\xE1\xA5G\xA6X\xACD\xBF\xEF\xA6C\xAA\xED\xB7ǫh" +msgstr "šSг«È€á¥GŠX¬D¿ïŠCªí·Ç«h" #: AgedDebtors.php:452 msgid "Aged Debtor Analysis" -msgstr "\xC2ɤ\xE8\xA4\xC0\xAAR" +msgstr "ÂÂÉ€è€ÀªR" #: AgedDebtors.php:461 DebtorsAtPeriodEnd.php:132 msgid "From Customer Code" -msgstr "\xA5ѫȤ\xE1\xBDs\xB8\xB9" +msgstr "¥Ñ«È€áœsž¹" #: AgedDebtors.php:462 DebtorsAtPeriodEnd.php:133 msgid "To Customer Code" -msgstr "\xA8\xEC\xABȤ\xE1\xBDs\xB8\xB9" +msgstr "šì«È€áœsž¹" #: AgedDebtors.php:464 AgedSuppliers.php:280 msgid "All balances or overdues only" -msgstr "\xA5\xFE\xB3\xA1\xB5\xB2\xBEl\xA9Υu\xA6\xB3\xB9L\xB4\xC1" +msgstr "¥þ³¡µ²Ÿl©Î¥uг¹LŽÁ" #: AgedDebtors.php:465 msgid "All customers with balances" -msgstr "\xA9Ҧ\xB3\xABȤ\xE1\xAA\xFE\xB5\xB2\xBEl" +msgstr "©Òг«È€áªþµ²Ÿl" #: AgedDebtors.php:466 AgedSuppliers.php:283 msgid "Overdue accounts only" -msgstr "\xA5u\xA6\xB3\xB9L\xB4\xC1\xA4\xE1\xA4f" +msgstr "¥uг¹LŽÁ€á€f" #: AgedDebtors.php:467 msgid "Held accounts only" -msgstr "\xA5u\xA6\xB3\xADᵲ\xAA\xBA\xA4\xE1\xA4f" +msgstr "¥uŠ³áµ²ªº€á€f" #: AgedDebtors.php:470 msgid "Only Show Customers Of" -msgstr "\xA5u\xC5\xE3\xA5ܦU\xA4᪺" +msgstr "¥uÅã¥ÜŠU€áªº" #: AgedDebtors.php:482 msgid "Only show customers trading in" -msgstr "\xA5u\xC5\xE3\xA5ܦ\xB3\xA7\xE9\xBB\xF9\xA5\xE6\xA9\x{1AAEAB}Ȥ\xE1" +msgstr "¥uÅã¥Üг§é»ù¥æ©öªº«È€á" #: AgedDebtors.php:498 msgid "Summary or detailed report" -msgstr "\xC1`\xB5\xB2\xA9θԲӳ\xF8\xA7i" +msgstr "Á`µ²©ÎžÔ²Ó³ø§i" #: AgedDebtors.php:500 AgedSuppliers.php:303 InventoryValuation.php:239 msgid "Summary Report" -msgstr "\xC1`\xB5\xB2\xB3\xF8\xA7i" +msgstr "Á`µ²³ø§i" #: AgedDebtors.php:501 AgedSuppliers.php:304 InventoryValuation.php:240 msgid "Detailed Report" -msgstr "\xB8Բӳ\xF8\xA7i" +msgstr "žÔ²Ó³ø§i" #: AgedDebtors.php:504 AgedSuppliers.php:307 BOMListing.php:136 #: DebtorsAtPeriodEnd.php:150 GLBalanceSheet.php:48 InventoryPlanning.php:389 @@ -751,137 +753,137 @@ #: PrintCustTrans.php:609 PrintCustTransPortrait.php:620 #: SupplierBalsAtPeriodEnd.php:152 Tax.php:331 msgid "Print PDF" -msgstr "\xA6C\xA6LPDF" +msgstr "ŠCŠLPDF" #: AgedSuppliers.php:17 msgid "Aged Supplier Listing" -msgstr "\xC2¨\xD1\xC0\xB3\xB0ӦC\xAA\xED" +msgstr "šÑÀ³°ÓŠCªí" #: AgedSuppliers.php:18 msgid "Aged Suppliers" -msgstr "\xC2¨\xD1\xC0\xB3\xB0\xD3" +msgstr "šÑÀ³°Ó" #: AgedSuppliers.php:104 msgid "Aged Supplier Account Analysis" -msgstr "\xC2¨\xD1\xC0\xB3\xB0ӱb\xA5ؤ\xC0\xAAR" +msgstr "šÑÀ³°Ó±b¥Ø€ÀªR" #: AgedSuppliers.php:106 SupplierBalsAtPeriodEnd.php:58 msgid "The Supplier details could not be retrieved by the SQL because" -msgstr "\xA8\xD1\xC0\xB3\xB0Ӹ\xEA\xAEƥ\xBC\xAF\xE0\xA5\xD1 SQL \xA8\xFA\xB1o, \xA6]\xAC\xB0" +msgstr "šÑÀ³°Óžê®Æ¥Œ¯à¥Ñ SQL šú±o, Š]¬°" #: AgedSuppliers.php:184 msgid "Aged Supplier Account Analysis - Problem Report" -msgstr "\xA8\xD1\xC0\xB3\xB0Ӥ\xE1\xA4f\xA4\xC0\xAAR-\xB0\xDD\xC3D\xB3\xF8\xA7i" +msgstr "šÑÀ³°Ó€á€f€ÀªR-°ÝÃD³ø§i" #: AgedSuppliers.php:186 msgid "The details of outstanding transactions for Supplier" -msgstr "\xA5\xBC\xB3B\xB2z\xA8\xD1\xC0\xB3\xB0ӥ\xE6\xA9\xF6\xB8\xEA\xAE\xC6" +msgstr "¥Œ³B²zšÑÀ³°Ó¥æ©öžê®Æ" #: AgedSuppliers.php:264 msgid "Aged Supplier Analysis" -msgstr "\xC2¨\xD1\xC0\xB3\xB0Ӥ\xC0\xAAR" +msgstr "šÑÀ³°Ó€ÀªR" #: AgedSuppliers.php:273 OutstandingGRNs.php:160 #: SupplierBalsAtPeriodEnd.php:129 SuppPaymentRun.php:262 msgid "From Supplier Code" -msgstr "\xA5Ѩ\xD1\xC0\xB3\xB0ӽs\xB8\xB9" +msgstr "¥ÑšÑÀ³°Óœsž¹" #: AgedSuppliers.php:276 OutstandingGRNs.php:162 #: SupplierBalsAtPeriodEnd.php:131 SuppPaymentRun.php:264 msgid "To Supplier Code" -msgstr "\xA6ܨ\xD1\xC0\xB3\xB0ӽs\xB8\xB9" +msgstr "ŠÜšÑÀ³°Óœsž¹" #: AgedSuppliers.php:282 msgid "All suppliers with balances" -msgstr "\xA5\xFE\xB3\xA1\xA8\xD1\xC0\xB3\xB0Ӫ\xFE\xB5\xB2\xBEl" +msgstr "¥þ³¡šÑÀ³°Óªþµ²Ÿl" #: AgedSuppliers.php:286 msgid "For suppliers trading in" -msgstr "\xA7\xE9\xBB\xF9\xA5\xE6\xA9\xF6\xA8\xD1\xC0\xB3\xB0\xD3" +msgstr "§é»ù¥æ©öšÑÀ³°Ó" #: AgedSuppliers.php:301 InventoryValuation.php:238 msgid "Summary or Detailed Report" -msgstr "\xC1`\xB5\xB2\xA9θԲӳ\xF8\xA7i" +msgstr "Á`µ²©ÎžÔ²Ó³ø§i" #: Areas.php:7 msgid "Sales Area Maintenance" -msgstr "\xBEP\xB0\xE2\xA6a\xB0Ϻ\xFB\xC5@" +msgstr "ŸP°âŠa°ÏºûÅ@" #: Areas.php:40 msgid "The area code must be three characters or less long" -msgstr "\xA6a\xB0Ͻs\xB8\xB9\xA5\xB2\xB6\xB7\xACO\xA9Τ֩\xF32\xA6r\xA4\xB8" +msgstr "Ša°Ïœsž¹¥²¶·¬O©Î€Ö©ó2Šr€ž" #: Areas.php:45 #, fuzzy msgid "The area code entered already exists" -msgstr "\xBF\xE9\xA4J\xAA\xBA\xB3\xA1\xA5\xF3\xBDs\xBDX:" +msgstr "¿é€Jªº³¡¥óœsœX:" #: Areas.php:50 msgid "The area description must be twenty five characters or less long" -msgstr "\xA6a\xB0ϻ\xA1\xA9\xFA\xAA\xF8\xABץ\xB2\xB6\xB7\xACO\xA9Τ֩\xF350\xA6r\xA4\xB8" +msgstr "Ša°Ï»¡©úªø«×¥²¶·¬O©Î€Ö©ó50Šr€ž" #: Areas.php:55 msgid "The area code may not be empty" -msgstr "\xA6a\xB0Ͻs\xB8\xB9\xA4\xA3\xAF\xE0\xAFd\xAA\xC5" +msgstr "Ša°Ïœsž¹€£¯à¯dªÅ" #: Areas.php:60 msgid "The area description may not be empty" -msgstr "\xA6a\xB0ϻ\xA1\xA9\xFA\xA4\xA3\xAF\xE0\xAFd\xAA\xC5" +msgstr "Ša°Ï»¡©ú€£¯à¯dªÅ" #: Areas.php:74 msgid "Area code" -msgstr "\xA6a\xB0Ͻs\xB8\xB9" +msgstr "Ša°Ïœsž¹" #: Areas.php:88 msgid "New area code" -msgstr "\xB7s\xA6a\xB0Ͻs\xB8\xB9" +msgstr "·sŠa°Ïœsž¹" #: Areas.php:88 msgid "has been inserted" -msgstr "\xA4w\xB4\xA1\xA4J" +msgstr "€wŽ¡€J" #: Areas.php:95 msgid "The area could not be added or updated because" -msgstr "\xA6a\xB0Ͻs\xB8\xB9\xA4\xA3\xAF\xE0\xB7s\xBCW\xA9Χ\xF3\xB7s, \xA6]\xAC\xB0" +msgstr "Ša°Ïœsž¹€£¯à·sŒW©Î§ó·s, Š]¬°" #: Areas.php:116 msgid "" "Cannot delete this area because customer branches have been created using " "this area" -msgstr "\xA4\xA3\xAF\xE0\xA7R\xB0\xA3\xA6\xB9\xA6a\xB0Ϧ]\xAC\xB0\xA4w\xA6\xB3\xABȤ\xE1\xA4\xC0\xA4\xBD\xA5q\xA6b\xB3o\xA6a\xB0\xCF" +msgstr "€£¯à§R°£Š¹Ša°ÏŠ]¬°€wг«È€á€À€œ¥qŠb³oŠa°Ï" #: Areas.php:117 msgid "branches using this area code" -msgstr "\xA6\xB9\xA6a\xB0Ͻs\xB8\xB9\xAA\xBA\xA4\xC0\xA4\xBD\xA5q" +msgstr "йŠa°Ïœsž¹ªº€À€œ¥q" #: Areas.php:125 msgid "" "Cannot delete this area because sales analysis ecords exist that use this " "area" -msgstr "\xA4\xA3\xAF\xE0\xA7R\xB0\xA3\xB3o\xA6a\xB0Ϧ]\xAC\xB0\xA6\xB9\xA6a\xB0Ϥw\xA5Ω\xF3\xB2{\xA6\xB3\xAA\xBA\xBEP\xB0\xE2\xA4\xC0\xAAR" +msgstr "€£¯à§R°£³oŠa°ÏŠ]¬°Š¹Ša°Ï€w¥Î©ó²{гªºŸP°â€ÀªR" #: Areas.php:126 msgid "sales analysis records referring this area code" -msgstr "\xC4ݩa\xB0Ϫ\xBA\xBEP\xB0\xE2\xB0O\xBF\xFD" +msgstr "Äݩ󊹊a°ÏªºŸP°â°O¿ý" #: Areas.php:133 Areas.php:146 Areas.php:197 Areas.php:208 msgid "Area Code" -msgstr "\xA6a\xB0Ͻs\xB8\xB9" +msgstr "Ša°Ïœsž¹" #: Areas.php:133 CustomerTypes.php:147 Factors.php:135 GLAccounts.php:203 #: Locations.php:298 SalesAnalReptCols.php:214 SalesCategories.php:137 #: SalesTypes.php:161 StockCategories.php:182 Suppliers.php:588 #: Z_DeleteInvoice.php:142 msgid "has been deleted" -msgstr "\xA4w\xA7R\xB0\xA3" +msgstr "€w§R°£" #: Areas.php:147 Areas.php:213 msgid "Area Name" -msgstr "\xA6a\xB0ϦW\xBA\xD9" +msgstr "Ša°ÏŠWºÙ" #: Areas.php:173 msgid "Review Areas Defined" -msgstr "\xC0˵\xF8\xA6a\xB0ϩw\xB8q" +msgstr "À˵øŠa°Ï©wžq" #: AuditTrail.php:7 msgid "Audit Trail" @@ -894,35 +896,35 @@ #: AuditTrail.php:32 #, fuzzy msgid "From Date" -msgstr "\xA5\xD1" +msgstr "¥Ñ" #: AuditTrail.php:34 #, fuzzy msgid "To Date" -msgstr "\xA4\xE9\xB4\xC1" +msgstr "€éŽÁ" #: AuditTrail.php:38 UserSettings.php:100 msgid "User ID" -msgstr "\xA5Τ\xE1 ID" +msgstr "¥Î€á ID" #: AuditTrail.php:51 #, fuzzy msgid "Table " -msgstr "\xB1ҥ\xCE" +msgstr "±Ò¥Î" #: AuditTrail.php:62 PO_SelectPurchOrder.php:376 msgid "View" -msgstr "\xC0˵\xF8" +msgstr "À˵ø" #: AuditTrail.php:139 #, fuzzy msgid "Date/Time" -msgstr "\xA4\xE9\xB4\xC1" +msgstr "€éŽÁ" #: AuditTrail.php:140 #, fuzzy msgid "User" -msgstr "\xA5Τ\xE1 ID" +msgstr "¥Î€á ID" #: AuditTrail.php:141 BankReconciliation.php:182 BankReconciliation.php:254 #: CustomerAllocations.php:371 CustomerInquiry.php:182 @@ -937,23 +939,23 @@ #: includes/InputSerialItemsFile.php:86 includes/InputSerialItemsFile.php:126 #: includes/PDFTaxPageHeader.inc:33 msgid "Type" -msgstr "\xBA\xD8\xC3\xFE" +msgstr "ºØÃþ" #: AuditTrail.php:142 #, fuzzy msgid "Table" -msgstr "\xB1ҥ\xCE" +msgstr "±Ò¥Î" #: AuditTrail.php:143 #, fuzzy msgid "Field Name" -msgstr "\xA5\xFE\xA6W" +msgstr "¥þŠW" #: AuditTrail.php:144 SystemParameters.php:269 #: includes/PDFInventoryValnPageHeader.inc:38 #: includes/PDFOstdgGRNsPageHeader.inc:37 msgid "Value" -msgstr "\xAD\xC8" +msgstr "È" #: AuditTrail.php:181 Logout.php:11 SalesCategories.php:171 #: SalesCategories.php:186 SalesCategories.php:388 SalesCategories.php:390 @@ -964,33 +966,33 @@ #: BankAccounts.php:8 msgid "Bank Accounts Maintenance" -msgstr "\xBBȦ\xE6\xA4\xE1\xA4f\xBA\xFB\xC5@" +msgstr "»ÈŠæ€á€fºûÅ@" #: BankAccounts.php:43 #, fuzzy msgid "The bank account code already exists in the database" -msgstr "\xBF\xE9\xA4J\xAA\xBA\xB3\xA1\xA5\xF3\xBDs\xBDX\xA4\xA3\xA6s\xA6b\xA9\xF3\xB8\xEA\xAEƮw" +msgstr "¿é€Jªº³¡¥óœsœX€£ŠsŠb©óžê®Æ®w" #: BankAccounts.php:49 msgid "The bank account name must be fifty characters or less long" -msgstr "\xBBȦ\xE6\xA4\xE1\xA4f\xA6W\xBA٪\xF8\xABץ\xB2\xB6\xB7\xACO\xA9Τ֩\xF350\xA6r\xA4\xB8" +msgstr "»ÈŠæ€á€fŠWºÙªø«×¥²¶·¬O©Î€Ö©ó50Šr€ž" #: BankAccounts.php:55 msgid "The bank account name may not be empty." -msgstr "\xBBȦ\xE6\xA4\xE1\xA4f\xA6W\xBA٤\xA3\xAF\xE0\xAFd\xAA\xC5" +msgstr "»ÈŠæ€á€fŠWºÙ€£¯à¯dªÅ" #: BankAccounts.php:61 #, fuzzy msgid "The bank account number may not be empty." -msgstr "\xBBȦ\xE6\xA4\xE1\xA4f\xA6W\xBA٤\xA3\xAF\xE0\xAFd\xAA\xC5" +msgstr "»ÈŠæ€á€fŠWºÙ€£¯à¯dªÅ" #: BankAccounts.php:67 msgid "The bank account number must be fifty characters or less long" -msgstr "\xBBȦ\xE6\xA4\xE1\xA4f\xBDs\xB8\xB9\xAA\xF8\xABץ\xB2\xB6\xB7\xACO\xA9Τ֩\xF350\xA6r\xA4\xB8" +msgstr "»ÈŠæ€á€fœsž¹ªø«×¥²¶·¬O©Î€Ö©ó50Šr€ž" #: BankAccounts.php:73 msgid "The bank address must be fifty characters or less long" -msgstr "\xBBȦ\xE6\xA6a\xA7}\xA5\xB2\xB6\xB7\xACO\xA9Τ֩\xF350\xA6r\xA4\xB8" +msgstr "»ÈŠæŠa§}¥²¶·¬O©Î€Ö©ó50Šr€ž" #: BankAccounts.php:90 msgid "" @@ -1000,47 +1002,47 @@ #: BankAccounts.php:100 msgid "The bank account details have been updated" -msgstr "\xBBȦ\xE6\xB8\xEA\xAEƤw\xA7\xF3\xB7s" +msgstr "»ÈŠæžê®Æ€w§ó·s" #: BankAccounts.php:117 msgid "The new bank account has been entered" -msgstr "\xB7s\xBBȦ\xE6\xA4\xE1\xA4f\xA4w\xBF\xE9\xA4J" +msgstr "·s»ÈŠæ€á€f€w¿é€J" #: BankAccounts.php:122 msgid "The bank account could not be inserted or modified because" -msgstr "\xBBȦ\xE6\xA4\xE1\xA4f\xA4\xA3\xAFഡ\xA4J\xA9έק\xEF, \xA6]\xAC\xB0" +msgstr "»ÈŠæ€á€f€£¯àŽ¡€J©Î×§ï, Š]¬°" #: BankAccounts.php:123 msgid "The SQL used to insert/modify the bank account details was" -msgstr "\xA5Χ@\xB4\xA1\xA4J/\xADק\xEF\xBBȦ\xE6\xB1b\xA4\xE1\xB8\xEA\xAEƪ\xBA SQL \xACO" +msgstr "¥Î§@Ž¡€J/×§ï»ÈŠæ±b€ážê®Æªº SQL ¬O" #: BankAccounts.php:148 msgid "" "Cannot delete this bank account because transactions have been created using " "this account" -msgstr "\xA4\xA3\xAF\xE0\xA7R\xB0\xA3\xA6\xB9\xBBȦ\xE6\xA4\xE1\xA4f\xA6]\xAC\xB0\xA6\xB9\xA4\xE1\xA4f\xA4w\xA6\xB3\xA5\xE6\xA9\xF6\xA6s\xA6b" +msgstr "€£¯à§R°£Š¹»ÈŠæ€á€fŠ]¬°Š¹€á€f€wг¥æ©öŠsŠb" #: BankAccounts.php:149 msgid "transactions with this bank account code" -msgstr "\xA6\xB9\xBBȦ\xE6\xA4\xE1\xA4f\xBDs\xBDX\xAA\xBA\xA5\xE6\xA9\xF6" +msgstr "й»ÈŠæ€á€fœsœXªº¥æ©ö" #: BankAccounts.php:155 msgid "Bank account deleted" -msgstr "\xBBȦ\xE6\xA4\xE1\xA4f\xA4w\xA7R\xB0\xA3" +msgstr "»ÈŠæ€á€f€w§R°£" #: BankAccounts.php:174 msgid "The bank accounts set up could not be retreived because" -msgstr "\xA5\xBC\xAF\xE0\xA8\xFA\xB1o\xBBȦ\xE6\xA4\xE1\xA4f\xAA\xBA\xB3]\xA9w, \xA6]\xAC\xB0" +msgstr "¥Œ¯àšú±o»ÈŠæ€á€fªº³]©w, Š]¬°" #: BankAccounts.php:175 msgid "The SQL used to retrieve the bank account details was" -msgstr "\xA5Χ@\xB4\xA3\xA8\xFA\xBBȦ\xE6\xA4\xE1\xA4f\xB8\xEA\xAEƪ\xBA SQL \xACO" +msgstr "¥Î§@Ž£šú»ÈŠæ€á€fžê®Æªº SQL ¬O" #: BankAccounts.php:180 COGSGLPostings.php:194 CustomerReceipt.php:886 #: GLJournal.php:352 GLTransInquiry.php:48 index.php:1028 Payments.php:808 #: SupplierTransInquiry.php:144 TaxAuthorities.php:146 TaxAuthorities.php:147 msgid "GL Account" -msgstr "\xC1`\xB1b\xB1b\xA5\xD8" +msgstr "Á`±b±b¥Ø" #: BankAccounts.php:181 GLAccounts.php:239 GLAccounts.php:296 #: GLBalanceSheet.php:356 GLCodesInquiry.php:28 GLCodesInquiry.php:66 @@ -1048,15 +1050,15 @@ #: includes/PDFProfitAndLossPageHeader.inc:31 #: includes/PDFTrialBalancePageHeader.inc:28 msgid "Account Name" -msgstr "\xB1b\xA4\xE1\xA6W\xBA\xD9" +msgstr "±b€áŠWºÙ" #: BankAccounts.php:182 includes/PDFBankingSummaryPageHeader.inc:38 msgid "Account Number" -msgstr "\xB1b\xA5ظ\xB9\xBDX" +msgstr "±b¥Øž¹œX" #: BankAccounts.php:183 BankAccounts.php:296 msgid "Bank Address" -msgstr "\xBBȦ\xE6\xA6a\xA7}" +msgstr "»ÈŠæŠa§}" #: BankAccounts.php:184 CustomerReceipt.php:691 CustomerTransInquiry.php:93 #: PO_Header.php:313 PO_SelectOSPurchOrder.php:391 PO_SelectPurchOrder.php:378 @@ -1067,79 +1069,79 @@ #: includes/PDFDebtorBalsPageHeader.inc:36 #: includes/PDFSupplierBalsPageHeader.inc:36 msgid "Currency" -msgstr "\xB3f\xB9\xF4" +msgstr "³f¹ô" #: BankAccounts.php:225 msgid "Show All Bank Accounts Defined" -msgstr "\xC5\xE3\xA5ܥ\xFE\xB3\xA1\xBBȦ\xE6\xA4\xE1\xA4f\xA9w\xB8q" +msgstr "Åã¥Ü¥þ³¡»ÈŠæ€á€f©wžq" #: BankAccounts.php:253 BankAccounts.php:256 msgid "Bank Account GL Code" -msgstr "\xBBȦ\xE6\xA4\xE1\xA4f\xC1`\xB1b\xBDs\xBDX" +msgstr "»ÈŠæ€á€fÁ`±bœsœX" #: BankAccounts.php:292 msgid "Bank Account Name" -msgstr "\xBBȦ\xE6\xA4\xE1\xA4f\xA6W\xBA\xD9" +msgstr "»ÈŠæ€á€fŠWºÙ" #: BankAccounts.php:294 msgid "Bank Account Number" -msgstr "\xBBȦ\xE6\xA4\xE1\xA4f\xBDs\xB8\xB9" +msgstr "»ÈŠæ€á€fœsž¹" #: BankAccounts.php:298 #, fuzzy msgid "Currency Of Account" -msgstr "\xBEP\xB0⦨\xA5\xBB\xB1b" +msgstr "ŸP°âŠš¥»±b" #: BankMatching.php:10 Z_CheckDebtorsControl.php:79 msgid "Receipts" -msgstr "\xA6\xAC\xB4\xDA" +msgstr "ЬŽÚ" #: BankMatching.php:11 msgid "Bank Account Deposits Matching" -msgstr "\xBBȦ\xE6\xA6s\xA4J\xB0t\xB9\xEF" +msgstr "»ÈŠæŠs€J°t¹ï" #: BankMatching.php:14 msgid "Payments" -msgstr "\xA5I\xB4\xDA" +msgstr "¥IŽÚ" #: BankMatching.php:15 index.php:970 msgid "Bank Account Payments Matching" -msgstr "\xBBȦ\xE6\xA5I\xB4ڰt\xB9\xEF" +msgstr "»ÈŠæ¥IŽÚ°t¹ï" #: BankMatching.php:17 msgid "This page must be called with a bank transaction type" -msgstr "\xB3o\xAD\xB6\xA5\xB2\xB6\xB7\xB0t\xA6X\xA5\xE6\xA9\xF6\xC3\xFE\xA7O\xA8Ӷǥl" +msgstr "³o¶¥²¶·°tŠX¥æ©öÃþ§OšÓ¶Ç¥l" #: BankMatching.php:17 msgid "It should not be called directly" -msgstr "\xB3o\xA4\xA3\xAF\xE0\xAFu\xB1\xB5\xB6ǥl" +msgstr "³o€£¯à¯u±µ¶Ç¥l" #: BankMatching.php:32 #, fuzzy msgid "Could not retrieve transaction information" -msgstr "\xA5\xBC\xAFണ\xA8\xFA\xB3o\xC0\xB3\xA5I\xA5\xE6\xA9\xF6\xAA\xBA\xC1`\xB1b\xA5\xE6\xA9\xF6" +msgstr "¥Œ¯àŽ£šú³oÀ³¥I¥æ©öªºÁ`±b¥æ©ö" #: BankMatching.php:39 msgid "Could not match off this payment beacause" -msgstr "\xA4\xA3\xAF\xE0\xB0t\xB9\xEF\xB3o\xA5I\xB4\xDA, \xA6]\xAC\xB0" +msgstr "€£¯à°t¹ï³o¥IŽÚ, Š]¬°" #: BankMatching.php:49 msgid "Could not update the amount matched off this bank transaction because" -msgstr "\xA4\xA3\xAF\xE0\xA7\xF3\xB7s\xBBȦ\xE6\xA5\xE6\xA9\xF6\xA6X\xADp\xB0t\xB9\xEF, \xA6]\xAC\xB0" +msgstr "€£¯à§ó·s»ÈŠæ¥æ©öŠXp°t¹ï, Š]¬°" #: BankMatching.php:55 msgid "Could not unclear this bank transaction because" -msgstr "\xA4\xA3\xAF\xE0 \xA5\xBC\xB2M\xBA\xE2 \xA6\xB9\xBBȦ\xE6\xA5\xE6\xA9\xF6, \xA6]\xAC\xB0" +msgstr "€£¯à ¥Œ²Mºâ й»ÈŠæ¥æ©ö, Š]¬°" #: BankMatching.php:63 #, fuzzy msgid "Bank Matching" -msgstr "\xBBȦ\xE6\xA6s\xB4ڰt\xB9\xEF" +msgstr "»ÈŠæŠsŽÚ°t¹ï" #: BankMatching.php:63 #, fuzzy msgid "Bank Account Matching" -msgstr "\xBBȦ\xE6\xA6s\xA4J\xB0t\xB9\xEF" +msgstr "»ÈŠæŠs€J°t¹ï" #: BankMatching.php:64 msgid "" @@ -1150,41 +1152,41 @@ #: Payments.php:674 PDFChequeListing.php:40 TaxAuthorities.php:149 #: TaxAuthorities.php:296 msgid "Bank Account" -msgstr "\xBBȦ\xE6\xA4\xE1\xA4f" +msgstr "»ÈŠæ€á€f" #: BankMatching.php:92 msgid "Show" -msgstr "\xC5\xE3\xA5\xDC" +msgstr "Åã¥Ü" #: BankMatching.php:92 BankMatching.php:127 msgid "before" -msgstr "\xA4\xA7\xABe" +msgstr "€§«e" #: BankMatching.php:94 msgid "but after" -msgstr "\xA6\xFD\xA4\xA7\xAB\xE1" +msgstr "Šý€§«á" #: BankMatching.php:96 msgid "Choose outstanding" -msgstr "\xBF\xEF\xBEܥ\xBC\xA7\xB9\xA6\xA8" +msgstr "¿ïŸÜ¥Œ§¹Šš" #: BankMatching.php:96 msgid "only or all" -msgstr "\xA5u\xA6\xB3\xA9Υ\xFE\xB3\xA1" +msgstr "¥uг©Î¥þ³¡" #: BankMatching.php:96 BankMatching.php:100 BankMatching.php:103 #: BankMatching.php:111 BankMatching.php:114 msgid "in the date range" -msgstr "\xA6b\xA4\xE9\xB4\xC1\xBDd\xB3\xF2" +msgstr "Šb€éŽÁœd³ò" #: BankMatching.php:100 BankMatching.php:103 BankMatching.php:111 #: BankMatching.php:114 msgid "Show all" -msgstr "\xA5\xFE\xB3\xA1\xC5\xE3\xA5\xDC" +msgstr "¥þ³¡Åã¥Ü" #: BankMatching.php:101 BankMatching.php:104 msgid "Show unmatched" -msgstr "\xC5\xE3\xA5ܥ\xBC\xB0t\xB9\xEF" +msgstr "Åã¥Ü¥Œ°t¹ï" #: BankMatching.php:101 BankMatching.php:104 ReverseGRN.php:102 #: includes/PDFCustomerListPageHeader.inc:46 @@ -1193,56 +1195,56 @@ #: includes/PDFOrdersInvoicedPageHeader.inc:24 #: includes/PDFOrderStatusPageHeader.inc:24 msgid "only" -msgstr "\xA5u\xA6\xB3" +msgstr "¥uг" #: BankMatching.php:108 msgid "Choose to display only the first 20 matching" -msgstr "\xBF\xEF\xBEܥu\xC5\xE3\xA5ܭ\xBA 20 \xB1\xF8\xB0t\xB9\xEF" +msgstr "¿ïŸÜ¥uÅã¥Üº 20 ±ø°t¹ï" #: BankMatching.php:109 msgid "or all" -msgstr "\xA9Υ\xFE\xB3\xA1" +msgstr "©Î¥þ³¡" #: BankMatching.php:109 msgid "meeting the criteria" -msgstr "\xB2ŦX\xACD\xBF\xEF\xB1\xF8\xA5\xF3" +msgstr "²ÅŠX¬D¿ï±ø¥ó" #: BankMatching.php:112 BankMatching.php:115 msgid "Show only the first 20" -msgstr "\xA5u\xC5\xE3\xA5ܭ\xBA 20" +msgstr "¥uÅã¥Üº 20" #: BankMatching.php:120 msgid "Show selected" -msgstr "\xC5\xE3\xA5ܤw\xBF諸" +msgstr "Åã¥Ü€w¿ïªº" #: BankMatching.php:121 msgid "Show reconciliation" -msgstr "\xC5\xE3\xA5ܤ@\xADP\xAA\xBA" +msgstr "Åã¥Ü€@Pªº" #: BankMatching.php:127 BankMatching.php:133 msgid "The date entered for the field to show" -msgstr "\xBF\xE9\xA4J\xADn\xC5\xE3\xA5ܪ\xBA\xC4\xE6\xA6\xEC\xA4\xE9\xB4\xC1" +msgstr "¿é€JnÅã¥ÜªºÄæŠì€éŽÁ" #: BankMatching.php:128 BankMatching.php:134 msgid "is not entered in a recognised date format" -msgstr "\xBF\xE9\xA4J\xA4\xE9\xB4\xC1\xAE榡\xA4\xA3\xA9\xFA" +msgstr "¿é€J€éŽÁ®æŠ¡€£©ú" #: BankMatching.php:128 BankMatching.php:134 msgid "Entry is expected in the format" -msgstr "\xBF\xE9\xA4J\xB9w\xB4\xC1\xAA\xBA\xAE榡" +msgstr "¿é€J¹wŽÁªº®æŠ¡" #: BankMatching.php:133 msgid "after" -msgstr "\xA4\xA7\xAB\xE1" +msgstr "€§«á" #: BankMatching.php:207 msgid "The payments with the selected criteria could not be retrieved because" -msgstr "\xA5\xBC\xAFണ\xA8\xFA\xBF\xEF\xA8\xFA\xB1\xF8\xA5I\xB4\xDA, \xA6]\xAC\xB0" +msgstr "¥Œ¯àŽ£šú¿ïšú±ø¥óªº¥IŽÚ, Š]¬°" #: BankMatching.php:210 ShipmentCosting.php:493 ShipmentCosting.php:564 #: SupplierAllocations.php:467 msgid "Ref" -msgstr "\xB0Ѧ\xD2" +msgstr "°ÑŠÒ" #: BankMatching.php:213 ConfirmDispatch_Invoice.php:268 Credit_Invoice.php:273 #: CustomerAllocations.php:374 CustomerReceipt.php:778 @@ -1256,7 +1258,7 @@ #: includes/PDFBankingSummaryPageHeader.inc:55 #: includes/PDFChequeListingPageHeader.inc:37 msgid "Amount" -msgstr "\xC1`\xADp" +msgstr "Á`p" #: BankMatching.php:214 BankReconciliation.php:186 BankReconciliation.php:258 #: PDFOrdersInvoiced.php:286 PDFOrderStatus.php:258 @@ -1265,23 +1267,23 @@ #: includes/PDFStatementPageHeader.inc:173 #: includes/PDFStatementPageHeader.inc:180 msgid "Outstanding" -msgstr "\xA5\xBC\xB3B\xB2z" +msgstr "¥Œ³B²z" #: BankMatching.php:215 msgid "Clear" -msgstr "\xB2M\xBA\xE2" +msgstr "²Mºâ" #: BankMatching.php:215 BankMatching.php:244 msgid "Unclear" -msgstr "\xA5\xBC\xB2M\xBA\xE2" +msgstr "¥Œ²Mºâ" #: BankMatching.php:288 msgid "Update Matching" -msgstr "\xA7\xF3\xB7s\xB0t\xB9\xEF" +msgstr "§ó·s°t¹ï" #: BankReconciliation.php:9 msgid "Bank Reconciliation" -msgstr "\xBBȦ\xE6\xB9\xEF\xBC\xC6" +msgstr "»ÈŠæ¹ïŒÆ" #: BankReconciliation.php:18 msgid "" @@ -1293,87 +1295,87 @@ #: BankReconciliation.php:27 #, fuzzy msgid "Could not retrieve the exchange rate for the selected bank account" -msgstr "\xA5\xBC\xAFണ\xA8\xFA\xBF\xEF\xA8\xFA\xA4u\xA7@\xADq\xB3檺\xB8\xEA\xAE\xC6" +msgstr "¥Œ¯àŽ£šú¿ïšú€u§@q³æªºžê®Æ" #: BankReconciliation.php:57 BankReconciliation.php:74 #, fuzzy msgid "reconciliation on" -msgstr "\xC5\xE3\xA5ܤ@\xADP\xAA\xBA" +msgstr "Åã¥Ü€@Pªº" #: BankReconciliation.php:59 #, fuzzy msgid "Cannot insert a GL entry for the exchange difference because" -msgstr "\xA5\xBC\xAF\xE0\xA5[\xA4J\xC1`\xB1b\xAA\xBA\xA6\xAC\xB4\xDA, \xA6]\xAC\xB0" +msgstr "¥Œ¯à¥[€JÁ`±bªºŠ¬ŽÚ, Š]¬°" #: BankReconciliation.php:60 #, fuzzy msgid "The SQL that failed to insert the exchange difference GL entry was" -msgstr "\xB4\xA1\xA4J\xC1`\xB1b\xA6\xAC\xB4ڥ\xA2\xB1Ѫ\xBA SQL \xACO" +msgstr "Ž¡€JÁ`±bЬŽÚ¥¢±Ñªº SQL ¬O" #: BankReconciliation.php:80 #, fuzzy msgid "Exchange difference of" -msgstr "\xB4\xC1\xB6\xA1\xAEt\xB2\xA7" +msgstr "ŽÁ¶¡®t²§" #: BankReconciliation.php:80 #, fuzzy msgid "has been posted" -msgstr "\xA4w\xA7\xB9\xB5\xB2" +msgstr "€w§¹µ²" #: BankReconciliation.php:90 SuppPaymentRun.php:303 msgid "The bank accounts could not be retrieved by the SQL because" -msgstr "\xBBȦ\xE6\xA4\xE1\xA4f\xA4\xA3\xAF\xE0\xA6\xDBSQL\xA8\xFA\xB1o, \xA6]\xAC\xB0" +msgstr "»ÈŠæ€á€f€£¯àŠÛSQLšú±o, Š]¬°" #: BankReconciliation.php:91 CustomerReceipt.php:656 Payments.php:671 #: SuppPaymentRun.php:305 msgid "The SQL used to retrieve the bank acconts was" -msgstr "\xA5\xBC\xAFണ\xA8\xFA\xBBȦ\xE6\xA4\xE1\xA4f\xAA\xBA SQL \xACO" +msgstr "¥Œ¯àŽ£šú»ÈŠæ€á€fªº SQL ¬O" #: BankReconciliation.php:97 CustomerReceipt.php:666 msgid "Bank Accounts have not yet been defined" -msgstr "\xBBȦ\xE6\xA4\xE1\xA4f\xA5\xBC\xA6\xB3\xB3]\xA9w" +msgstr "»ÈŠæ€á€f¥ŒŠ³³]©w" #: BankReconciliation.php:97 CustomerReceipt.php:666 msgid "You must first" -msgstr "\xA7A\xA5\xB2\xB6\xB7\xA5\xFD" +msgstr "§A¥²¶·¥ý" #: BankReconciliation.php:97 CustomerReceipt.php:666 Payments.php:678 #: SuppPaymentRun.php:313 msgid "define the bank accounts" -msgstr "\xA9w\xB8q\xBBȤ\xE1\xA4f" +msgstr "©wžq»È€á€f" #: BankReconciliation.php:97 CustomerReceipt.php:666 Payments.php:678 #: SuppPaymentRun.php:313 msgid "and general ledger accounts to be affected" -msgstr "\xA9M\xC1`\xB1b\xA4\xE1\xA4f\xB7|\xA8\xFC\xBCv" +msgstr "©MÁ`±b€á€f·|šüŒv" #: BankReconciliation.php:116 msgid "Show bank reconciliation statement" -msgstr "\xC5\xE3\xA5ܻȦ\xE6\xB9\xEF\xBCƳ\xE6" +msgstr "Åã¥Ü»ÈŠæ¹ïŒÆ³æ" #: BankReconciliation.php:131 msgid "The bank account balance could not be returned by the SQL because" -msgstr "\xBBȦ\xE6\xA4\xE1\xA4f\xB5\xB2\xBEl\xA5\xBC\xAF\xE0\xA5\xD1 SQL \xA6^, \xA6]\xAC\xB0" +msgstr "»ÈŠæ€á€fµ²Ÿl¥Œ¯à¥Ñ SQL Š^, Š]¬°" #: BankReconciliation.php:144 #, fuzzy msgid "" "Could not retrieve the currency and exchange rate for the selected bank " "account" -msgstr "\xA5\xBC\xAFണ\xA8\xFA\xBF\xEF\xA8\xFA\xA4u\xA7@\xADq\xB3檺\xB8\xEA\xAE\xC6" +msgstr "¥Œ¯àŽ£šú¿ïšú€u§@q³æªºžê®Æ" #: BankReconciliation.php:152 #, fuzzy msgid "Balance as at" -msgstr "\xB5\xB2\xBEl\xA6p" +msgstr "µ²ŸlŠp" #: BankReconciliation.php:175 msgid "The unpresented cheques could not be retrieved by the SQL because" -msgstr "\xA5\xBC\xB9\xEF\xB2{\xA4䲼\xA5\xBC\xAF\xE0\xB1qSQL\xA8\xFA\xB1o, \xA6]\xAC\xB0" +msgstr "¥Œ¹ï²{€ä²Œ¥Œ¯à±qSQLšú±o, Š]¬°" #: BankReconciliation.php:178 msgid "Add back unpresented cheques" -msgstr "\xBCW\xA5[\xB0h\xA6^\xA5\xBC\xB9\xEF\xB2{\xA4䲼" +msgstr "ŒW¥[°hŠ^¥Œ¹ï²{€ä²Œ" #: BankReconciliation.php:183 BankReconciliation.php:255 #: CustomerAllocations.php:346 CustomerAllocations.php:372 @@ -1390,7 +1392,7 @@ #: includes/PDFStatementPageHeader.inc:179 includes/PDFTransPageHeader.inc:44 #: includes/PDFTransPageHeaderPortrait.inc:51 msgid "Number" -msgstr "\xB8\xB9\xBDX" +msgstr "ž¹œX" #: BankReconciliation.php:184 BankReconciliation.php:256 #: CustomerInquiry.php:186 CustomerTransInquiry.php:88 CustWhereAlloc.php:82 @@ -1400,36 +1402,36 @@ #: includes/PDFBankingSummaryPageHeader.inc:40 #: includes/PDFStockComparisonPageHeader.inc:36 msgid "Reference" -msgstr "\xB0Ѧ\xD2" +msgstr "°ÑŠÒ" #: BankReconciliation.php:185 BankReconciliation.php:257 msgid "Orig Amount" -msgstr "\xAD\xEC\xA8\xD3\xC1`\xC3B" +msgstr "ìšÓÁ`ÃB" #: BankReconciliation.php:228 msgid "Total of all unpresented cheques" -msgstr "\xA5\xFE\xB3\xA1\xA5\xBC\xB9\xEF\xB2{\xA4䲼" +msgstr "¥þ³¡¥Œ¹ï²{€ä²Œ" #: BankReconciliation.php:246 msgid "The uncleared deposits could not be retrieved by the SQL because" -msgstr "\xA5\xBC\xB2M\xBA\xE2\xA6s\xA4J\xA5\xBC\xAF\xE0\xA6\xDB SQL \xA8\xFA\xB1o, \xA6]\xAC\xB0" +msgstr "¥Œ²MºâŠs€J¥Œ¯àŠÛ SQL šú±o, Š]¬°" #: BankReconciliation.php:250 msgid "Less deposits not cleared" -msgstr "\xA6s\xA4J\xAEt\xBCƥ\xBC\xB2M\xBA\xE2" +msgstr "Šs€J®tŒÆ¥Œ²Mºâ" #: BankReconciliation.php:300 msgid "Total of all uncleared deposits" -msgstr "\xA5\xBC\xB2M\xBA\xE2\xA6s\xA4J\xC1`\xADp" +msgstr "¥Œ²MºâŠs€JÁ`p" #: BankReconciliation.php:302 msgid "Bank statement balance should be" -msgstr "\xBBȦ\xE6\xA4뵲\xB3浲\xBEl\xC0\xB3\xACO" +msgstr "»ÈŠæ€ëµ²³æµ²ŸlÀ³¬O" #: BankReconciliation.php:306 #, fuzzy msgid "Enter the actual bank statement balance" -msgstr "\xBF\xE9\xA4J\xADn\xB9B\xA6檺\xA5I\xB4ڤ\xE9\xB4\xC1" +msgstr "¿é€Jn¹BŠæªº¥IŽÚ€éŽÁ" #: BankReconciliation.php:308 BankReconciliation.php:318 msgid "Calculate and Post Exchange Difference" @@ -1445,7 +1447,7 @@ #: BankReconciliation.php:308 Customers.php:840 SelectOrderItems.php:1193 #: Stocks.php:940 WorkOrderCosting.php:495 WorkOrderEntry.php:485 msgid "Are You Sure?" -msgstr "\xACO\xA7_\xBDT\xA9w?" +msgstr "¬O§_œT©w?" #: BankReconciliation.php:317 msgid "" @@ -1460,53 +1462,53 @@ #: BankReconciliation.php:323 msgid "Match off cleared payments" -msgstr "\xA4w\xB2M\xBA\xE2\xA5I\xB4ڰt\xB9\xEF" +msgstr "€w²Mºâ¥IŽÚ°t¹ï" #: BankReconciliation.php:324 msgid "Match off cleared deposits" -msgstr "\xA4w\xB2M\xBA\xE2\xA6s\xA4J\xB0t\xB9\xEF" +msgstr "€w²MºâŠs€J°t¹ï" #: BOMInquiry.php:6 msgid "Costed Bill Of Material" -msgstr "BOM\xA6\xA8\xA5\xBB" +msgstr "BOMŠš¥»" #: BOMInquiry.php:17 BOMs.php:779 msgid "Select a manufactured part" -msgstr "\xBF\xEF\xBEܤw\xA5Ͳ\xA3\xB3\xA1\xA5\xF3" +msgstr "¿ïŸÜ€w¥Í²£³¡¥ó" #: BOMInquiry.php:17 BOMs.php:779 msgid "or Assembly or Kit part" -msgstr "\xA9βո\xCB, \xA9ήM\xB8\xCB" +msgstr "©Î²ÕžË, ©Î®MžË" #: BOMInquiry.php:18 #, fuzzy msgid "to view the costed bill of materials" -msgstr "\xC0˵\xF8BOM\xA6\xA8\xA5\xBB" +msgstr "À˵øBOMŠš¥»" #: BOMInquiry.php:19 BOMs.php:781 msgid "Parts must be defined in the stock item entry" -msgstr "\xB3\xA1\xA5\xB7\xA6b\xA6s\xB3f\xAA\xAB\xAB~\xA4\xA4\xA9w\xB8q" +msgstr "³¡¥ó¥²¶·ŠbŠs³fª««~€€©wžq" #: BOMInquiry.php:19 BOMs.php:781 msgid "modification screen as manufactured" -msgstr "\xADק\xEF\xB5e\xAD\xB1\xA6ܤw\xA5Ͳ\xA3" +msgstr "×§ïµe±ŠÜ€w¥Í²£" #: BOMInquiry.php:20 BOMs.php:782 msgid "" "kits or assemblies to be available for construction of a bill of material" -msgstr "\xA5i\xBAc\xA6\xA8BOM\xAA\xBA\xAEM\xB8˩βո\xCB" +msgstr "¥iºcŠšBOMªº®MžË©Î²ÕžË" #: BOMInquiry.php:21 BOMs.php:783 PO_SelectOSPurchOrder.php:179 #: PO_SelectPurchOrder.php:176 Shipt_Select.php:174 WorkOrderEntry.php:516 #: WorkOrderIssue.php:633 msgid "Enter text extracts in the" -msgstr "\xBF\xE9\xA4J\xBAK\xADn\xA4\xE5\xA6r" +msgstr "¿é€JºKn€åŠr" #: BOMInquiry.php:22 BOMs.php:784 PO_SelectOSPurchOrder.php:179 #: PO_SelectPurchOrder.php:176 Shipt_Select.php:174 WorkOrderEntry.php:516 #: WorkOrderIssue.php:633 msgid "description" -msgstr "\xA4\xBA\xAEe" +msgstr "€º®e" #: BOMInquiry.php:23 BOMs.php:785 CustomerReceipt.php:954 PO_Header.php:298 #: PO_SelectOSPurchOrder.php:182 PO_SelectPurchOrder.php:179 PurchData.php:449 @@ -1517,13 +1519,13 @@ #: SelectSalesOrder.php:186 SelectSupplier.php:244 SelectWorkOrder.php:183 #: Shipt_Select.php:177 WorkOrderEntry.php:519 WorkOrderIssue.php:636 msgid "OR" -msgstr "\xA9\xCE" +msgstr "©Î" #: BOMInquiry.php:23 BOMs.php:785 PO_SelectOSPurchOrder.php:182 #: PO_SelectPurchOrder.php:179 Shipt_Select.php:177 WorkOrderEntry.php:519 #: WorkOrderIssue.php:636 msgid "Enter extract of the" -msgstr "\xBF\xE9\xA4J\xBAK\xADn" +msgstr "¿é€JºKn" #: BOMInquiry.php:24 BOMs.php:786 DiscountCategories.php:139 #: PO_SelectOSPurchOrder.php:182 PO_SelectPurchOrder.php:179 PurchData.php:176 @@ -1534,7 +1536,7 @@ #: StockUsage.php:55 WorkOrderEntry.php:519 WorkOrderIssue.php:636 #: Z_ChangeStockCode.php:231 msgid "Stock Code" -msgstr "\xA6s\xB3f\xBDs\xBDX" +msgstr "Šs³fœsœX" #: BOMInquiry.php:25 BOMs.php:787 CustomerReceipt.php:959 PO_Header.php:303 #: PO_Items.php:970 SelectCreditItems.php:224 SelectCreditItems.php:958 @@ -1542,7 +1544,7 @@ #: SelectOrderItems.php:1266 SelectProduct.php:114 SelectSupplier.php:262 #: SelectSupplier.php:299 WorkOrderEntry.php:523 WorkOrderIssue.php:640 msgid "Search Now" -msgstr "\xB2{\xA6b\xB7j\xB4M" +msgstr "²{Šb·jŽM" #: BOMInquiry.php:34 BOMs.php:714 PO_Items.php:229 #: PO_SelectOSPurchOrder.php:58 PO_SelectPurchOrder.php:58 @@ -1552,17 +1554,17 @@ msgid "" "Stock description keywords have been used in preference to the Stock code " "extract entered" -msgstr "\xA6s\xB3f\xA4\xBA\xAEe\xC3\xF6\xC1\xE4\xA6r\xA4w\xA6b\xA6s\xB3f\xBDs\xB8\xB9\xBAK\xADn\xA4\xA4\xA8ϥ\xCE" +msgstr "Šs³f€º®eÃöÁäŠr€wŠbŠs³fœsž¹ºKn€€šÏ¥Î" #: BOMInquiry.php:37 BOMs.php:717 msgid "" "At least one stock description keyword or an extract of a stock code must be " "entered for the search" -msgstr "\xB3̤֭n\xA6\xB3\xA4@\xADӦs\xB3f\xBB\xA1\xA9\xFA\xC3\xF6\xC1\xE4\xA6r\xA9Φs\xB3f\xBDs\xB8\xB9\xBAK\xADn\xA8Ӥ\xE8\xABK\xB7j\xB4M" +msgstr "³Ì€Önг€@ÓŠs³f»¡©úÃöÁäŠr©ÎŠs³fœsž¹ºKnšÓ€è«K·jŽM" #: BOMInquiry.php:89 BOMs.php:769 msgid "The SQL to find the parts selected failed with the message" -msgstr "\xA7\xE4\xB4M\xA4w\xBF\xEF\xA8\xFA\xB3\xA1\xA5\xF3\xAA\xBA SQL \xA5\xA2\xB1ѩM\xB0T\xAE\xA7" +msgstr "§äŽM€w¿ïšú³¡¥óªº SQL ¥¢±Ñ©M°T®§" #: BOMInquiry.php:98 BOMs.php:498 BOMs.php:792 CustomerBranches.php:364 #: CustomerReceipt.php:969 GLCodesInquiry.php:27 GLCodesInquiry.php:65 @@ -1576,7 +1578,7 @@ #: WorkOrderEntry.php:534 WorkOrderIssue.php:657 #: includes/PDFTaxPageHeader.inc:37 includes/PO_PDFOrderPageHeader.inc:142 msgid "Code" -msgstr "\xBDs\xBDX" +msgstr "œsœX" #: BOMInquiry.php:99 BOMInquiry.php:168 BOMs.php:499 BOMs.php:793 #: CreditStatus.php:150 CreditStatus.php:233 GLTags.php:35 GLTags.php:51 @@ -1597,14 +1599,14 @@ #: includes/PDFStockTransferHeader.inc:36 includes/PDFTransPageHeader.inc:207 #: includes/PDFTransPageHeaderPortrait.inc:259 msgid "Description" -msgstr "\xA4\xBA\xAEe" +msgstr "€º®e" #: BOMInquiry.php:100 BOMs.php:794 PO_SelectOSPurchOrder.php:198 #: PO_SelectPurchOrder.php:193 SelectCompletedOrder.php:413 #: SelectOrderItems.php:1284 SelectSalesOrder.php:198 SelectWorkOrder.php:195 #: Shipt_Select.php:192 msgid "On Hand" -msgstr "\xAEw\xA6s" +msgstr "®wŠs" #: BOMInquiry.php:101 BOMs.php:795 ConfirmDispatch_Invoice.php:260 #: Credit_Invoice.php:266 DeliveryNote.php:226 GoodsReceived.php:53 @@ -1616,28 +1618,28 @@ #: WorkOrderCosting.php:82 WorkOrderEntry.php:536 WorkOrderIssue.php:659 #: WorkOrderIssue.php:731 msgid "Units" -msgstr "\xB3\xE6\xA6\xEC" +msgstr "³æŠì" #: BOMInquiry.php:144 msgid "per" -msgstr "\xA8C" +msgstr "šC" #: BOMInquiry.php:158 msgid "The bill of material could not be retrieved because" -msgstr "BOM\xA4\xA3\xAF\xE0\xA8\xFA\xB1o, \xA6]\xAC\xB0" +msgstr "BOM€£¯àšú±o, Š]¬°" #: BOMInquiry.php:162 msgid "The bill of material for this part is not set up" -msgstr "\xB3o\xB9s\xB3\xA1\xA5\xF3\xAA\xBABOM\xA5\xBC\xB3]\xA9w" +msgstr "³o¹s³¡¥óªºBOM¥Œ³]©w" #: BOMInquiry.php:162 msgid "there are no components defined for it" -msgstr "\xC1٥\xBC\xA6\xB3\xA9w\xB8q\xB9s\xA5\xF3" +msgstr "ÁÙ¥ŒŠ³©wžq¹s¥ó" #: BOMInquiry.php:167 BOMs.php:563 WorkOrderReceive.php:140 #: WorkOrderReceive.php:367 msgid "Component" -msgstr "\xB9s\xA5\xF3" +msgstr "¹s¥ó" #: BOMInquiry.php:169 BOMs.php:502 BOMs.php:654 Credit_Invoice.php:267 #: DeliveryDetails.php:512 DeliveryDetails.php:577 GoodsReceived.php:52 @@ -1665,41 +1667,41 @@ #: includes/PDFStockTransferHeader.inc:39 includes/PDFTransPageHeader.inc:209 #: includes/PO_PDFOrderPageHeader.inc:144 msgid "Quantity" -msgstr "\xBCƶq" +msgstr "ŒÆ¶q" #: BOMInquiry.php:170 SpecialOrder.php:627 StockAdjustments.php:309 #: includes/PDFInventoryValnPageHeader.inc:34 msgid "Unit Cost" -msgstr "\xA8C\xA5\xBB" +msgstr "šC¥óŠš¥»" #: BOMInquiry.php:171 BOMInquiry.php:213 SpecialOrder.php:544 #: SpecialOrder.php:546 msgid "Total Cost" -msgstr "\xC1`\xA6\xA8\xA5\xBB" +msgstr "Á`Šš¥»" #: BOMInquiry.php:220 msgid "Enter a stock item code above" -msgstr "\xA6b\xA4W\xAD\xB1\xBF\xE9\xA4J\xA6s\xB3f\xBDs\xB8\xB9" +msgstr "Šb€W±¿é€JŠs³fœsž¹" #: BOMInquiry.php:220 msgid "to view the costed bill of material for" -msgstr "\xC0˵\xF8BOM\xA6\xA8\xA5\xBB" +msgstr "À˵øBOMŠš¥»" #: BOMListing.php:16 BOMListing.php:17 BOMListing.php:122 msgid "Bill Of Material Listing" -msgstr "\xAA\xAB\xAEƲM\xB3\xE6\xA6C\xAA\xED" +msgstr "ª«®Æ²M³æŠCªí" #: BOMListing.php:46 BOMListing.php:57 msgid "Bill of Materials Listing" -msgstr "\xAA\xAB\xAEƲM\xB3\xE6\xA6C\xAA\xED" +msgstr "ª«®Æ²M³æŠCªí" #: BOMListing.php:48 msgid "The Bill of Material listing could not be retrieved by the SQL because" -msgstr "BOM\xA5\xBC\xAF\xE0\xA6\xDBSQL\xB4\xA3\xA8\xFA, \xA6]\xAC\xB0" +msgstr "BOM¥Œ¯àŠÛSQLŽ£šú, Š]¬°" #: BOMListing.php:59 msgid "The Bill of Material listing has no bills to report on" -msgstr "BOM\xB2M\xB3\xE6\xA8S\xA6\xB3\xADn\xB3\xF8\xA7i\xA9\xF3" +msgstr "BOM²M³æšSгn³ø§i©ó" #: BOMListing.php:124 BOMs.php:213 BOMs.php:777 GLBudgets.php:29 #: GLJournal.php:236 PO_SelectOSPurchOrder.php:136 SelectCompletedOrder.php:13 @@ -1709,103 +1711,103 @@ #: Suppliers.php:306 WhereUsedInquiry.php:18 WorkCentres.php:111 #: WorkCentres.php:158 WorkOrderEntry.php:13 msgid "Search" -msgstr "\xB7j\xB4M" +msgstr "·jŽM" #: BOMListing.php:131 msgid "From Inventory Part Code" -msgstr "\xA5ѭܦs\xB9s\xB3\xA1\xA5\xF3\xBDs\xB8\xB9" +msgstr "¥ÑÜŠs¹s³¡¥óœsž¹" #: BOMListing.php:133 msgid "To Inventory Part Code" -msgstr "\xA8\xEC\xADܦs\xB9s\xB3\xA1\xA5\xF3\xBDs\xB8\xB9" +msgstr "šìÜŠs¹s³¡¥óœsž¹" #: BOMs.php:8 msgid "Multi-Level Bill Of Materials Maintenance" -msgstr "\xA6h\xBCh\xA6\xB8\xAA\xAB\xAEƲM\xB3\xE6\xBA\xFB\xC5@" +msgstr "ŠhŒhŠžª«®Æ²M³æºûÅ@" #: BOMs.php:35 msgid "A maximum of 15 levels of bill of materials only can be displayed" -msgstr "\xA5u\xAF\xE0\xC5\xE3\xA5̦ܳh15\xBCh\xAA\xBA\xAA\xAB\xAEƲM\xB3\xE6" +msgstr "¥u¯àÅã¥Ü³ÌŠh15Œhªºª«®Æ²M³æ" #: BOMs.php:56 msgid "" "An error occurred in retrieving the components of the BOM during the check " "for recursion" -msgstr "\xB4\xA3\xA8\xFABOM\xB9s\xA5\xF3\xACO\xB5o\xA5Ϳ\xF9\xBB~\xA9\xF3\xB4`\xC0\xF4\xC0ˬd" +msgstr "Ž£šúBOM¹s¥ó¬Oµo¥Í¿ù»~©óŽ`ÀôÀˬd" #: BOMs.php:57 msgid "" "The SQL that was used to retrieve the components of the BOM and that failed " "in the process was" -msgstr "\xA5Χ@\xB4\xA3\xA8\xFABOM\xB9s\xA5\xF3\xA9M\xB0\xF5\xA6楢\xB1Ѫ\xBA SQL \xACO" +msgstr "¥Î§@Ž£šúBOM¹s¥ó©M°õŠæ¥¢±Ñªº SQL ¬O" #: BOMs.php:105 msgid "Could not retrieve the BOM components because" -msgstr "\xA5\xBC\xAF\xE0\xA8\xFA\xB1oBOM\xB9s\xA5\xF3, \xA6]\xAC\xB0" +msgstr "¥Œ¯àšú±oBOM¹s¥ó, Š]¬°" #: BOMs.php:106 msgid "The SQL used to retrieve the components was" -msgstr "\xA5Χ@\xB4\xA3\xA8\xFA\xB9s\xA5\xF3\xAA\xBA SQL \xACO" +msgstr "¥Î§@Ž£šú¹s¥óªº SQL ¬O" #: BOMs.php:120 msgid "Drill Down" -msgstr "Drill Down (\xB2`\xA8s)" +msgstr "Drill Down (²`šs)" #: BOMs.php:125 BOMs.php:131 BOMs.php:135 OrderDetails.php:171 #: PaymentTerms.php:185 PaymentTerms.php:191 SalesAnalReptCols.php:279 #: SelectProduct.php:463 SelectProduct.php:506 SelectProduct.php:517 #: SelectProduct.php:614 SelectProduct.php:615 msgid "N/A" -msgstr "\xB5L" +msgstr "µL" #: BOMs.php:223 msgid "" "The effective after date field must be a date in the format dd/mm/yy or dd/" "mm/yyyy or ddmmyy or ddmmyyyy or dd-mm-yy or dd-mm-yyyy" msgstr "" -"\xA5ͮĩ\xF3\xA4\xE9\xB4\xC1\xC4楲\xB6\xB7\xACO\xA4\xE9\xB4\xC1\xAE榡\xA4\xE9\xA4\xEB\xA6~, dd/mm/yy \xA9\xCE dd/mm/yyyy \xA9\xCE ddmmyy \xA9\xCE " -"ddmmyyyy \xA9\xCE dd-mm-yy \xA9\xCE dd-mm-yyyy " +"¥Í®Ä©ó€éŽÁÄæ¥²¶·¬O€éŽÁ®æŠ¡€é€ëŠ~, dd/mm/yy ©Î dd/mm/yyyy ©Î ddmmyy ©Î " +"ddmmyyyy ©Î dd-mm-yy ©Î dd-mm-yyyy " #: BOMs.php:229 msgid "" "The effective to date field must be a date in the format dd/mm/yy or dd/mm/" "yyyy or ddmmyy or ddmmyyyy or dd-mm-yy or dd-mm-yyyy" msgstr "" -"\xA5ͮĦܤ\xE9\xB4\xC1\xC4楲\xB6\xB7\xACO\xA4\xE9\xB4\xC1\xAE榡\xA4\xE9\xA4\xEB\xA6~, dd/mm/yy \xA9\xCE dd/mm/yyyy \xA9\xCE ddmmyy \xA9\xCE " -"ddmmyyyy \xA9\xCE dd-mm-yy \xA9\xCE dd-mm-yyyy " +"¥Í®ÄŠÜ€éŽÁÄæ¥²¶·¬O€éŽÁ®æŠ¡€é€ëŠ~, dd/mm/yy ©Î dd/mm/yyyy ©Î ddmmyy ©Î " +"ddmmyyyy ©Î dd-mm-yy ©Î dd-mm-yyyy " #: BOMs.php:235 StockAdjustments.php:90 StockTransfers.php:124 #: WorkOrderEntry.php:247 msgid "The quantity entered must be numeric" -msgstr "\xBCƶq\xA5\xB2\xB6\xB7\xBF\xE9\xA4J\xBCƦr" +msgstr "ŒÆ¶q¥²¶·¿é€JŒÆŠr" #: BOMs.php:241 StockAdjustments.php:93 msgid "The quantity entered cannot be zero" -msgstr "\xBF\xE9\xA4J\xAA\xBA\xBCƶq\xA4\xA3\xAF\xE0\xACO 0" +msgstr "¿é€JªºŒÆ¶q€£¯à¬O 0" #: BOMs.php:247 msgid "The effective to date must be a date after the effective after date" -msgstr "\xA5ͮĦܤ\xE9\xB4\xC1 \xA5\xB2\xB6\xB7\xACO\xB8\xFB\xAB\xE1\xA9\xF3 \xA5ͮĩ\xF3\xA4\xE9\xB4\xC1" +msgstr "¥Í®ÄŠÜ€éŽÁ ¥²¶·¬Ožû«á©ó ¥Í®Ä©ó€éŽÁ" #: BOMs.php:247 msgid "The effective to date is" -msgstr "\xA5ͮĨ\xEC\xA4\xE9\xB4\xC1\xACO" +msgstr "¥Í®Äšì€éŽÁ¬O" #: BOMs.php:247 msgid "days before the effective after date" -msgstr "\xC1٦\xB3\xA6h\xA4֤\xE9\xA4~\xA8\xEC\xA5ͮĩ\xF3\xA4\xE9\xB4\xC1" +msgstr "ÁÙŠ³Šh€Ö€é€~šì¥Í®Ä©ó€éŽÁ" #: BOMs.php:247 msgid "No updates have been performed" -msgs... [truncated message content] |
From: <tim...@us...> - 2010-12-22 15:49:41
|
Revision: 4224 http://web-erp.svn.sourceforge.net/web-erp/?rev=4224&view=rev Author: tim_schofield Date: 2010-12-22 15:49:35 +0000 (Wed, 22 Dec 2010) Log Message: ----------- $Message Modified Paths: -------------- trunk/FixedAssetRegister.php trunk/SelectOrderItems.php trunk/includes/session.inc Modified: trunk/FixedAssetRegister.php =================================================================== --- trunk/FixedAssetRegister.php 2010-12-22 14:40:39 UTC (rev 4223) +++ trunk/FixedAssetRegister.php 2010-12-22 15:49:35 UTC (rev 4224) @@ -1,5 +1,5 @@ <?php -//$PageSecurity = 11; +$PageSecurity = 11; include ('includes/session.inc'); $title = _('Fixed Asset Register'); $csv_output = ''; @@ -58,7 +58,7 @@ $CategoryRow=DB_fetch_array($CategoryResult); $AssetCategory=$CategoryRow['categorydescription']; } - + if ($_POST['AssetID']=='%') { $AssetDescription =_('All'); } else { @@ -96,7 +96,7 @@ $TotalDepn = 0; $TotalDisposals = 0; $TotalNBV = 0; - + while ($myrow = DB_fetch_array($result)) { /* * $Ancestors = array(); @@ -198,7 +198,7 @@ $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'); - + $pdf->Output($_SESSION['DatabaseName'] . '_Asset Register_' . date('Y-m-d') . '.pdf', 'I'); exit; } elseif (isset($_POST['csv'])) { @@ -230,7 +230,7 @@ } else { include ('includes/header.inc'); echo '<p class="page_title_text"><img src="' . $rootpath . '/css/' . $theme . '/images/magnifier.png" title="' . _('Search') . '" alt="">' . ' ' . $title; - + $result = DB_query('SELECT categoryid,categorydescription FROM fixedassetcategories', $db); echo '<form name="RegisterForm" method="post" action="' . $_SERVER['PHP_SELF'] . '?' . SID . '"><table class=selection>'; echo '<input type="hidden" name="FormID" value="' . $_SESSION['FormID'] . '" />'; @@ -306,18 +306,18 @@ $line_height; $AssetDescription; $AssetCategory; - + if ($PageNumber>1){ $pdf->newPage(); } - + $FontSize=10; $YPos= $Page_Height-$Top_Margin; $XPos=0; $pdf->addJpegFromFile($_SESSION['LogoFile'] ,$XPos+20,$YPos-50,0,60); - - - + + + $LeftOvers = $pdf->addTextWrap($Page_Width-$Right_Margin-240,$YPos,240,$FontSize,$_SESSION['CompanyRecord']['coyname']); $LeftOvers = $pdf->addTextWrap($Page_Width-$Right_Margin-240,$YPos-($line_height*1),240,$FontSize, _('Asset Category ').' ' . $AssetCategory ); $LeftOvers = $pdf->addTextWrap($Page_Width-$Right_Margin-240,$YPos-($line_height*2),240,$FontSize, _('Asset Location ').' ' . $_POST['AssetLocation'] ); @@ -325,21 +325,21 @@ $LeftOvers = $pdf->addTextWrap($Page_Width-$Right_Margin-240,$YPos-($line_height*4),240,$FontSize, _('From').': ' . $_POST['FromDate']); $LeftOvers = $pdf->addTextWrap($Page_Width-$Right_Margin-240,$YPos-($line_height*5),240,$FontSize, _('To').': ' . $_POST['ToDate']); $LeftOvers = $pdf->addTextWrap($Page_Width-$Right_Margin-240,$YPos-($line_height*7),240,$FontSize, _('Page'). ' ' . $PageNumber); - + $YPos -= 60; - + $YPos -=2*$line_height; //Note, this is ok for multilang as this is the value of a Select, text in option is different - + $YPos -=(2*$line_height); - + /*Draw a rectangle to put the headings in */ $YTopLeft=$YPos+$line_height; $pdf->line($Left_Margin, $YPos+$line_height,$Page_Width-$Right_Margin, $YPos+$line_height); $pdf->line($Left_Margin, $YPos+$line_height,$Left_Margin, $YPos- $line_height); $pdf->line($Left_Margin, $YPos- $line_height,$Page_Width-$Right_Margin, $YPos- $line_height); $pdf->line($Page_Width-$Right_Margin, $YPos+$line_height,$Page_Width-$Right_Margin, $YPos- $line_height); - + /*set up the headings */ $FontSize=10; $XPos = $Left_Margin+1; @@ -356,15 +356,15 @@ $LeftOvers = $pdf->addTextWrap($XPos+620,$YPos,70,$FontSize, _('Depn C/Fwd'), 'centre'); $LeftOvers = $pdf->addTextWrap($XPos+690,$YPos,70,$FontSize, _('Net Book Value'), 'centre'); //$LeftOvers = $pdf->addTextWrap($XPos+760,$YPos,70,$FontSize, _('Disposal Proceeds'), 'centre'); - + $pdf->line($Left_Margin, $YTopLeft,$Page_Width-$Right_Margin, $YTopLeft); $pdf->line($Left_Margin, $YTopLeft,$Left_Margin, $Bottom_Margin); $pdf->line($Left_Margin, $Bottom_Margin,$Page_Width-$Right_Margin, $Bottom_Margin); $pdf->line($Page_Width-$Right_Margin, $Bottom_Margin,$Page_Width-$Right_Margin, $YTopLeft); - + $FontSize=8; $YPos -= (1.5 * $line_height); - + $PageNumber++; } Modified: trunk/SelectOrderItems.php =================================================================== --- trunk/SelectOrderItems.php 2010-12-22 14:40:39 UTC (rev 4223) +++ trunk/SelectOrderItems.php 2010-12-22 15:49:35 UTC (rev 4224) @@ -959,13 +959,15 @@ $AssetDetailsResult = DB_query('SELECT fixedassets.description, fixedassets.longdescription, fixedassets.barcode, - fixedassetcategories.costact + fixedassetcategories.costact, + fixedassets.cost-fixedassets.accumdepn AS nbv FROM fixedassetcategories INNER JOIN fixedassets ON fixedassetcategories.categoryid=fixedassets.assetcategoryid WHERE fixedassets.assetid="' . $_POST['AssetToDisposeOf'] . '"',$db); - $AssetRow = DB_fetch_array($AssetCatDetailsResult); + $AssetRow = DB_fetch_array($AssetDetailsResult); - $AssetCategoryResult = DB_query('SELECT categoryid FROM stockcategory WHERE categoryid="ASSETS"',$db); + /* Check that the stock category for disposal "ASSETS" is defined already */ + $AssetCategoryResult = DB_query('SELECT categoryid FROM stockcategory WHERE categoryid="ASSETS"',$db); if (DB_num_rows($AssetCategoryResult)==0){ /*Although asset GL posting will come from the asset category - we should set the GL codes to something sensible * based on the category of the asset under review at the moment - this may well change for any other assets sold subsequentely */ @@ -982,39 +984,46 @@ /*First check to see that it doesn't exist already assets are of the format "ASSET-" . $AssetID */ $TestAssetExistsAlreadyResult = DB_query('SELECT stockid FROM stockmaster WHERE stockid ="ASSET-' . $_POST['AssetToDisposeOf'] . '"',$db); - if (DB_num_rows($TestAssetExistsAlreadyResult)==1){ //then it exists already ... bum - $j=1; - while (DB_num_rows($TestAssetExistsAlreadyResult)==1) { - $TestAssetExistsAlreadyResult = DB_query('SELECT stockid FROM stockmaster WHERE stockid ="ASSET-' . $_POST['AssetToDisposeOf'] . '-' . $j . '"',$db); - $j++; - } + $j=0; + while (DB_num_rows($TestAssetExistsAlreadyResult)==1) { //then it exists already ... bum + $j++; + $TestAssetExistsAlreadyResult = DB_query('SELECT stockid FROM stockmaster WHERE stockid ="ASSET-' . $_POST['AssetToDisposeOf'] . '-' . $j . '"',$db); + } + if ($j>0){ $AssetStockID = 'ASSET-' . $_POST['AssetToDisposeOf'] . '-' . $j; } else { $AssetStockID = 'ASSET-' . $_POST['AssetToDisposeOf']; } - /* Perhaps ought to check that the asset exists already as a stock item first */ - + if ($AssetRow['nbv']==0){ + $NBV = 0.001; /* stock must have a cost to be invoiced if the flag is set so set to 0.001 */ + } else { + $NBV = $AssetRow['nbv']; + } /*OK now we can insert the item for this asset */ $InsertAssetAsStockItemResult = DB_query('INSERT INTO stockmaster ( stockid, description, + longdescription, categoryid, - longdescription, mbflag, controlled, serialised, - taxcatid) + taxcatid, + materialcost) VALUES ("' . $AssetStockID . '", "' . $AssetRow['description'] . '", "' . $AssetRow['longdescription'] . '", "ASSETS", - "B", + "D", "0", "0", - "' . $_SESSION['DefaultTaxCategory'] . '")' , $db); + "' . $_SESSION['DefaultTaxCategory'] . '", + "'. $NBV . '")' , $db); /*not forgetting the location records too */ $InsertStkLocRecsResult = DB_query('INSERT INTO locstock (loccode, stockid) - SELECT loccode, "' . $AssetStockID . '" FROM locations',$db); + SELECT loccode, + "' . $AssetStockID . '" + FROM locations',$db); /*Now the asset has been added to the stock master we can add it to the sales order */ $NewItemDue = date($_SESSION['DefaultDateFormat']); if (isset($_POST['POLine']){ Modified: trunk/includes/session.inc =================================================================== --- trunk/includes/session.inc 2010-12-22 14:40:39 UTC (rev 4223) +++ trunk/includes/session.inc 2010-12-22 15:49:35 UTC (rev 4224) @@ -12,7 +12,7 @@ header('Location:' . $rootpath . '/install/index.php'); } include($PathPrefix . 'config.php'); -$DBVersion=50; +$DBVersion=51; if (isset($SessionSavePath)){ session_save_path($SessionSavePath); } This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <tim...@us...> - 2010-12-22 15:55:15
|
Revision: 4252 http://web-erp.svn.sourceforge.net/web-erp/?rev=4252&view=rev Author: tim_schofield Date: 2010-12-22 15:55:09 +0000 (Wed, 22 Dec 2010) Log Message: ----------- $Message Modified Paths: -------------- trunk/CustLoginSetup.php trunk/CustomerAllocations.php Modified: trunk/CustLoginSetup.php =================================================================== --- trunk/CustLoginSetup.php 2010-12-22 15:54:45 UTC (rev 4251) +++ trunk/CustLoginSetup.php 2010-12-22 15:55:09 UTC (rev 4252) @@ -32,8 +32,8 @@ $CustomerName=$myrow['name']; echo '<p class="page_title_text"><img src="'.$rootpath.'/css/'.$theme.'/images/customer.png" title="' . _('Customer') . - '" alt="">' . ' ' . _('Customer') . ' : ' . $_SESSION['CustomerID'] . ' - ' . $CustomerName. _(' has been selected') . - '<br>';//'</p>'; + '" alt="" />' . ' ' . _('Customer') . ' : ' . $_SESSION['CustomerID'] . ' - ' . $CustomerName. _(' has been selected') . + '</p><br />';//'</p>'; //echo '<p class="page_title_text"><img src="'.$rootpath.'/css/'.$theme.'/images/group_add.png" title="' . _('Search') . '" alt="">' . ' ' . $title.'<br>'; Modified: trunk/CustomerAllocations.php =================================================================== --- trunk/CustomerAllocations.php 2010-12-22 15:54:45 UTC (rev 4251) +++ trunk/CustomerAllocations.php 2010-12-22 15:55:09 UTC (rev 4252) @@ -322,7 +322,7 @@ } - echo '<p class="page_title_text"><img src="'.$rootpath.'/css/'.$theme.'/images/transactions.png" title="' . _('Allocate Receipt') . '" alt="">' . ' ' . _('Allocate Receipts') . '</p>'; + echo '<p class="page_title_text"><img src="'.$rootpath.'/css/'.$theme.'/images/transactions.png" title="' . _('Allocate Receipt') . '" alt="" />' . ' ' . _('Allocate Receipts') . '</p>'; $TableHeader = "<tr> <th>" . _('Trans Type') . "</th> This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <tim...@us...> - 2010-12-22 15:57:07
|
Revision: 4262 http://web-erp.svn.sourceforge.net/web-erp/?rev=4262&view=rev Author: tim_schofield Date: 2010-12-22 15:57:01 +0000 (Wed, 22 Dec 2010) Log Message: ----------- $Message Modified Paths: -------------- trunk/DebtorsAtPeriodEnd.php trunk/DeliveryDetails.php Modified: trunk/DebtorsAtPeriodEnd.php =================================================================== --- trunk/DebtorsAtPeriodEnd.php 2010-12-22 15:56:50 UTC (rev 4261) +++ trunk/DebtorsAtPeriodEnd.php 2010-12-22 15:57:01 UTC (rev 4262) @@ -136,7 +136,7 @@ $title=_('Debtor Balances'); include('includes/header.inc'); echo '<p class="page_title_text"><img src="'.$rootpath.'/css/'.$theme.'/images/customer.png" title="' . _('Search') . - '" alt="">' . ' ' . $title.'<br>'; + '" alt="" />' . ' ' . $title.'</p><br />'; if (!isset($_POST['FromCriteria']) || !isset($_POST['ToCriteria'])) { Modified: trunk/DeliveryDetails.php =================================================================== --- trunk/DeliveryDetails.php 2010-12-22 15:56:50 UTC (rev 4261) +++ trunk/DeliveryDetails.php 2010-12-22 15:57:01 UTC (rev 4262) @@ -759,8 +759,8 @@ if (isset($_SESSION['Items'.$identifier]->SpecialInstructions) and strlen($_SESSION['Items'.$identifier]->SpecialInstructions)>0) { prnMsg($_SESSION['Items'.$identifier]->SpecialInstructions,'info'); } -echo '<p class="page_title_text"><img src="'.$rootpath.'/css/'.$theme.'/images/inventory.png" title="' . _('Delivery') . '" alt="">' . ' ' . _('Delivery Details'); -echo '<p class="page_title_text"><img src="'.$rootpath.'/css/'.$theme.'/images/customer.png" title="' . _('Customer') . '" alt="">' . ' ' . _('Customer Code') . ' :<b> ' . $_SESSION['Items'.$identifier]->DebtorNo; +echo '<p class="page_title_text"><img src="'.$rootpath.'/css/'.$theme.'/images/inventory.png" title="' . _('Delivery') . '" alt="" />' . ' ' . _('Delivery Details'); +echo '<p class="page_title_text"><img src="'.$rootpath.'/css/'.$theme.'/images/customer.png" title="' . _('Customer') . '" alt="" />' . ' ' . _('Customer Code') . ' :<b> ' . $_SESSION['Items'.$identifier]->DebtorNo; echo '</b> ' . _('Customer Name') . ' :<b> ' . $_SESSION['Items'.$identifier]->CustomerName . '</p>'; //echo '<font size=4><b>'. _('Customer') .' : ' . $_SESSION['Items'.$identifier]->CustomerName . '</b></font>'; echo '<form action="' . $_SERVER['PHP_SELF'] . '?' . SID.'identifier='.$identifier . '" method=post>'; This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <tim...@us...> - 2010-12-22 16:03:50
|
Revision: 4295 http://web-erp.svn.sourceforge.net/web-erp/?rev=4295&view=rev Author: tim_schofield Date: 2010-12-22 16:03:44 +0000 (Wed, 22 Dec 2010) Log Message: ----------- $Message Modified Paths: -------------- trunk/MRP.php trunk/MRPCalendar.php trunk/MRPCreateDemands.php Modified: trunk/MRP.php =================================================================== --- trunk/MRP.php 2010-12-22 16:03:33 UTC (rev 4294) +++ trunk/MRP.php 2010-12-22 16:03:44 UTC (rev 4295) @@ -527,7 +527,7 @@ } else { // End of if submit isset // Display form if submit has not been hit echo '<p class="page_title_text"><img src="'.$rootpath.'/css/'.$theme.'/images/inventory.png" title="' . - _('Inventory') . '" alt="">' . ' ' . $title . ''; + _('Inventory') . '" alt="" />' . ' ' . $title . '</p>'; // Display parameters from last run $sql = 'SELECT * FROM mrpparameters'; Modified: trunk/MRPCalendar.php =================================================================== --- trunk/MRPCalendar.php 2010-12-22 16:03:33 UTC (rev 4294) +++ trunk/MRPCalendar.php 2010-12-22 16:03:44 UTC (rev 4295) @@ -19,7 +19,7 @@ } echo '<p class="page_title_text"><img src="'.$rootpath.'/css/'.$theme.'/images/inventory.png" title="' . - _('Inventory') . '" alt="">' . ' ' . $title . '</p>'; + _('Inventory') . '" alt="" />' . ' ' . $title . '</p>'; if (isset($_POST['submit'])) { submit($db,$ChangeDate); Modified: trunk/MRPCreateDemands.php =================================================================== --- trunk/MRPCreateDemands.php 2010-12-22 16:03:33 UTC (rev 4294) +++ trunk/MRPCreateDemands.php 2010-12-22 16:03:44 UTC (rev 4295) @@ -184,7 +184,7 @@ } // End of else to create form echo '<p class="page_title_text"><img src="'.$rootpath.'/css/'.$theme.'/images/inventory.png" title="' . - _('Inventory') . '" alt="">' . ' ' . $title . '</p>'; + _('Inventory') . '" alt="" />' . ' ' . $title . '</p>'; echo '<form action=' . $_SERVER['PHP_SELF'] . '?' . SID .' method="post"><b><br></b>'; echo '<input type="hidden" name="FormID" value="' . $_SESSION['FormID'] . '" />'; echo '<table class=selection>'; This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <tim...@us...> - 2010-12-22 16:07:39
|
Revision: 4316 http://web-erp.svn.sourceforge.net/web-erp/?rev=4316&view=rev Author: tim_schofield Date: 2010-12-22 16:07:33 +0000 (Wed, 22 Dec 2010) Log Message: ----------- $Message Modified Paths: -------------- trunk/PcTabs.php trunk/PcTypeTabs.php Modified: trunk/PcTabs.php =================================================================== --- trunk/PcTabs.php 2010-12-22 16:07:23 UTC (rev 4315) +++ trunk/PcTabs.php 2010-12-22 16:07:33 UTC (rev 4316) @@ -8,7 +8,7 @@ include('includes/header.inc'); echo '<p class="page_title_text"><img src="'.$rootpath.'/css/'.$theme.'/images/money_add.png" title="' . _('Payment Entry') - . '" alt="">' . ' ' . $title . '</p>'; + . '" alt="" />' . ' ' . $title . '</p>'; if (isset($_POST['SelectedTab'])){ $SelectedTab = strtoupper($_POST['SelectedTab']); Modified: trunk/PcTypeTabs.php =================================================================== --- trunk/PcTypeTabs.php 2010-12-22 16:07:23 UTC (rev 4315) +++ trunk/PcTypeTabs.php 2010-12-22 16:07:33 UTC (rev 4316) @@ -8,7 +8,7 @@ include('includes/header.inc'); echo '<p class="page_title_text"><img src="'.$rootpath.'/css/'.$theme.'/images/money_add.png" title="' . _('Payment Entry') - . '" alt="">' . ' ' . $title . '</p>'; + . '" alt="" />' . ' ' . $title . '</p>'; if (isset($_POST['SelectedTab'])){ $SelectedTab = strtoupper($_POST['SelectedTab']); This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <tim...@us...> - 2010-12-22 16:09:57
|
Revision: 4329 http://web-erp.svn.sourceforge.net/web-erp/?rev=4329&view=rev Author: tim_schofield Date: 2010-12-22 16:09:51 +0000 (Wed, 22 Dec 2010) Log Message: ----------- $Message Modified Paths: -------------- trunk/PDFStockCheckComparison.php trunk/PDFStockLocTransfer.php Modified: trunk/PDFStockCheckComparison.php =================================================================== --- trunk/PDFStockCheckComparison.php 2010-12-22 16:09:42 UTC (rev 4328) +++ trunk/PDFStockCheckComparison.php 2010-12-22 16:09:51 UTC (rev 4329) @@ -347,7 +347,7 @@ $title= _('Inventory Comparison Report'); include('includes/header.inc'); - echo '<p class="page_title_text"><img src="'.$rootpath.'/css/'.$theme.'/images/transactions.png" title="' . $title . '" alt=""></img>' . ' ' + echo '<p class="page_title_text"><img src="'.$rootpath.'/css/'.$theme.'/images/transactions.png" title="' . $title . '" alt="" />' . ' ' . $title . '</p>'; echo '<form action="' . $_SERVER['PHP_SELF'] . '" method="POST"><table class=selection>'; Modified: trunk/PDFStockLocTransfer.php =================================================================== --- trunk/PDFStockLocTransfer.php 2010-12-22 16:09:42 UTC (rev 4328) +++ trunk/PDFStockLocTransfer.php 2010-12-22 16:09:51 UTC (rev 4329) @@ -19,7 +19,7 @@ include ('includes/header.inc'); echo '<p class="page_title_text"><img src="'.$rootpath.'/css/'.$theme.'/images/maintenance.png" title="' . _('Search') . - '" alt="">' . ' ' . _('Reprint transfer docket').'<br>'; + '" alt="" />' . ' ' . _('Reprint transfer docket').'</p><br />'; 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>'; This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <tim...@us...> - 2010-12-22 16:17:56
|
Revision: 4373 http://web-erp.svn.sourceforge.net/web-erp/?rev=4373&view=rev Author: tim_schofield Date: 2010-12-22 16:17:50 +0000 (Wed, 22 Dec 2010) Log Message: ----------- $Message Modified Paths: -------------- trunk/SMTPServer.php trunk/StockAdjustments.php Modified: trunk/SMTPServer.php =================================================================== --- trunk/SMTPServer.php 2010-12-22 16:17:40 UTC (rev 4372) +++ trunk/SMTPServer.php 2010-12-22 16:17:50 UTC (rev 4373) @@ -9,7 +9,7 @@ include('includes/header.inc'); echo '<p class="page_title_text"><img src="' . $rootpath . '/css/' . $theme . '/images/email.gif" title="' . - _('SMTP Server') . '" alt="">' . ' ' . _('SMTP Server Settings') . '</p>'; + _('SMTP Server') . '" alt="" />' . ' ' . _('SMTP Server Settings') . '</p>'; if (isset($_POST['submit'])) { $sql="UPDATE emailsettings SET Modified: trunk/StockAdjustments.php =================================================================== --- trunk/StockAdjustments.php 2010-12-22 16:17:40 UTC (rev 4372) +++ trunk/StockAdjustments.php 2010-12-22 16:17:50 UTC (rev 4373) @@ -47,12 +47,12 @@ } echo '<p class="page_title_text"><img src="'.$rootpath.'/css/'.$theme.'/images/supplier.png" title="' . - _('Inventory Adjustment') . '" alt="">' . ' ' . _('Inventory Adjustment') . '</p>'; + _('Inventory Adjustment') . '" alt="" />' . ' ' . _('Inventory Adjustment') . '</p>'; if (isset($_POST['CheckCode'])) { echo '<p class="page_title_text"><img src="'.$rootpath.'/css/'.$theme.'/images/magnifier.png" title="' . _('Dispatch') . - '" alt="">' . ' ' . _('Select Item to Adjust') . ''; + '" alt="" />' . ' ' . _('Select Item to Adjust') . '</p>'; if (strlen($_POST['StockText'])>0) { $sql='SELECT stockid, description from stockmaster where description like "%'.$_POST['StockText'].'%"'; This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <tim...@us...> - 2010-12-22 16:24:01
|
Revision: 4404 http://web-erp.svn.sourceforge.net/web-erp/?rev=4404&view=rev Author: tim_schofield Date: 2010-12-22 16:23:55 +0000 (Wed, 22 Dec 2010) Log Message: ----------- $Message Modified Paths: -------------- trunk/SupplierTenders.php trunk/SupplierTransInquiry.php Modified: trunk/SupplierTenders.php =================================================================== --- trunk/SupplierTenders.php 2010-12-22 16:23:42 UTC (rev 4403) +++ trunk/SupplierTenders.php 2010-12-22 16:23:55 UTC (rev 4404) @@ -45,7 +45,7 @@ echo "<form method='post' action=" . $_SERVER['PHP_SELF'] . "?" . SID . ">"; echo '<input type="hidden" name="FormID" value="' . $_SESSION['FormID'] . '" />'; echo '<p class="page_title_text"><img src="' . $rootpath . '/css/' . $theme . '/images/supplier.png" title="' . - _('Tenders') . '" alt="">' . ' ' . _('Create or View Offers from') . ' '.$Supplier.'</p>'; + _('Tenders') . '" alt="" />' . ' ' . _('Create or View Offers from') . ' '.$Supplier.'</p>'; echo '<table class=selection>'; echo'<tr><td>'._('Select option for tendering').'</td>'; echo '<td><select name=TenderType>'; @@ -258,7 +258,7 @@ echo "<form method='post' action=" . $_SERVER['PHP_SELF'] . "?" . SID . ">"; echo '<input type="hidden" name="FormID" value="' . $_SESSION['FormID'] . '" />'; echo '<p class="page_title_text"><img src="' . $rootpath . '/css/' . $theme . '/images/supplier.png" title="' . - _('Search') . '" alt="">' . ' ' . _('Items to offer from').' '.$Supplier; + _('Search') . '" alt="" />' . ' ' . _('Items to offer from').' '.$Supplier .'</p>'; echo '<table>'; echo '<tr>'; echo '<th>'._('Stock ID').'</th>'; @@ -315,7 +315,7 @@ echo '<form action="' . $_SERVER['PHP_SELF'] . '?' . SID . '" 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="">' . ' ' . _('Search for Inventory Items'); + _('Search') . '" alt="" />' . ' ' . _('Search for Inventory Items') . '</p>'; $sql = 'SELECT categoryid, categorydescription FROM stockcategory @@ -372,7 +372,7 @@ echo "<form method='post' action=" . $_SERVER['PHP_SELF'] . "?" . SID . ">"; echo '<input type="hidden" name="FormID" value="' . $_SESSION['FormID'] . '" />'; echo '<p class="page_title_text"><img src="' . $rootpath . '/css/' . $theme . '/images/supplier.png" title="' . - _('Tenders') . '" alt="">' . ' ' . _('Select items to offer from').' '.$Supplier .'</p>'; + _('Tenders') . '" alt="" />' . ' ' . _('Select items to offer from').' '.$Supplier .'</p>'; if ($_POST['Keywords'] AND $_POST['StockCode']) { prnMsg( _('Stock description keywords have been used in preference to the Stock code extract entered'), 'info' ); Modified: trunk/SupplierTransInquiry.php =================================================================== --- trunk/SupplierTransInquiry.php 2010-12-22 16:23:42 UTC (rev 4403) +++ trunk/SupplierTransInquiry.php 2010-12-22 16:23:55 UTC (rev 4404) @@ -9,7 +9,7 @@ include('includes/header.inc'); echo '<p class="page_title_text"><img src="'.$rootpath.'/css/'.$theme.'/images/supplier.png" title="' . _('Search') . - '" alt="">' . ' ' . $title . '</p>'; + '" alt="" />' . ' ' . $title . '</p>'; echo "<form action='" . $_SERVER['PHP_SELF'] . "' method=post>"; echo '<input type="hidden" name="FormID" value="' . $_SESSION['FormID'] . '" />'; This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <tim...@us...> - 2010-12-22 17:14:16
|
Revision: 4438 http://web-erp.svn.sourceforge.net/web-erp/?rev=4438&view=rev Author: tim_schofield Date: 2010-12-22 17:14:09 +0000 (Wed, 22 Dec 2010) Log Message: ----------- Corrections to purchase ordering scripts for cancelled orders. Modified Paths: -------------- trunk/PO_Header.php trunk/PO_Items.php Modified: trunk/PO_Header.php =================================================================== --- trunk/PO_Header.php 2010-12-22 17:07:58 UTC (rev 4437) +++ trunk/PO_Header.php 2010-12-22 17:14:09 UTC (rev 4438) @@ -6,7 +6,18 @@ include('includes/DefinePOClass.php'); include('includes/session.inc'); +/* Dummy for gettext */ +$sDummy = _('New Order') . + _('Pending') . + _('Authorised') . + _('Rejected') . + _('Cancelled') . + _('Printed') . + _('Completed'); + +unset($sDummy); + if (isset($_GET['ModifyOrderNumber'])) { $title = _('Modify Purchase Order') . ' ' . $_GET['ModifyOrderNumber']; } else { @@ -45,9 +56,9 @@ if (isset($_POST['Select']) and empty($_POST['SupplierContact'])) { $sql = "SELECT contact - FROM suppliercontacts - WHERE supplierid='". $_POST['Select'] ."'"; - + FROM suppliercontacts + WHERE supplierid='". $_POST['Select'] ."'"; + $SuppCoResult = DB_query($sql,$db); if (DB_num_rows($SuppCoResult)>0) { $myrow = DB_fetch_row($SuppCoResult); @@ -57,128 +68,105 @@ } } -if ($_POST['Status']=='NewOrder'){ - $_POST['UpdateStatus']='Yes please'; - $_POST['Status'] = 'Pending'; -} - -if ((isset($_POST['UpdateStatus']) AND $_POST['UpdateStatus']!='') ) { - $OKToUpdateStatus = 1; +if (isset($_POST['UpdateStat']) AND $_POST['UpdateStat']!='') { + /*The cancel button on the header screen - to delete order */ + $OK_to_updstat = 1; + $OldStatus=$_SESSION['PO'.$identifier]->Stat; + $NewStatus=$_POST['Stat']; $EmailSQL='SELECT email FROM www_users WHERE userid="'.$_SESSION['PO'.$identifier]->Initiator.'"'; $EmailResult=DB_query($EmailSQL, $db); $EmailRow=DB_fetch_array($EmailResult); - - if ($_SESSION['PO'.$identifier]->Status !=$_POST['Status']) { //the old status != new status - $AuthSQL ="SELECT authlevel - FROM purchorderauth - WHERE userid='".$_SESSION['UserID']."' - AND currabrev='".$_SESSION['PO'.$identifier]->CurrCode."'"; + if ($OldStatus!=$NewStatus) { + /* assume this in the first instance */ + $authsql="SELECT authlevel + FROM purchorderauth + WHERE userid='".$_SESSION['UserID']."' + AND currabrev='".$_SESSION['PO'.$identifier]->CurrCode."'"; - $AuthResult=DB_query($AuthSQL,$db); - $myrow=DB_fetch_array($AuthResult); + $authresult=DB_query($authsql,$db); + $myrow=DB_fetch_array($authresult); $AuthorityLevel=$myrow['authlevel']; $OrderTotal=$_SESSION['PO'.$identifier]->Order_Value(); - if ($_POST['StatusComments']!='') { - $_POST['StatusComments']=' - '.$_POST['StatusComments']; + if ($_POST['StatComments']!='') { + $_POST['StatComments']=' - '.$_POST['StatComments']; } - if ($_POST['Status'] == 'Authorised') { - if ($AuthorityLevel > $OrderTotal) { - $_SESSION['PO'.$identifier]->StatusComments = date($_SESSION['DefaultDateFormat']) . ' - ' . _('Authorised by') . ' <a href="mailto:' . $EmailRow['email'] . '">'. $_SESSION['UserID']. '</a>' . $_POST['StatusComments'] . '<br>' . $_POST['StatusCommentsComplete']; - $_SESSION['PO'.$identifier]->Status=$_POST['Status']; + if ($NewStatus == PurchOrder::STATUS_AUTHORISED) { + if ($AuthorityLevel>$OrderTotal) { + $StatusComment= date($_SESSION['DefaultDateFormat']).' - Authorised by <a href="mailto:'.$EmailRow['email'].'">'.$_SESSION['UserID']. + '</a>'.$_POST['StatComments'].'<br />'.$_POST['statcommentscomplete']; + $_SESSION['PO'.$identifier]->StatComments=$StatusComment; + $_SESSION['PO'.$identifier]->Stat=$NewStatus; $_SESSION['PO'.$identifier]->AllowPrintPO=1; } else { - $OKToUpdateStatus=0; - prnMsg( _('You do not have permission to authorise this purchase order').'.<br>'. _('This order is for').' '. + $OK_to_updstat=0; + prnMsg( _('You do not have permission to authorise this purchase order').'.<br />'. _('This order is for').' '. $_SESSION['PO'.$identifier]->CurrCode.' '.$OrderTotal.'. '. - _('You can only authorise up to').' '.$_SESSION['PO'.$identifier]->CurrCode.' '.$AuthorityLevel.'.<br>'. + _('You can only authorise up to').' '.$_SESSION['PO'.$identifier]->CurrCode.' '.$AuthorityLevel.'.<br />'. _('If you think this is a mistake please contact the systems administrator') , 'warn'); } } - - if ($_POST['Status'] == 'Rejected' AND $OKToUpdateStatus==1) { - $OKToReject = 1; //to start with - if(!isset($_SESSION['ExistingOrder']) OR $_SESSION['ExistingOrder']!=0) { - /* need to check that not already dispatched or invoiced - * by the supplier */ - - if($_SESSION['PO'.$identifier]->Any_Already_Received()==1){ - $OKToReject =0; //its not ok to reject - prnMsg( _('This order cannot be cancelled because some of it has already been received') . '. ' . - _('The line item quantities may be modified to quantities more than already received') . '. ' . - _('Prices cannot be altered for lines that have already been received') .' '. - _('and quantities cannot be reduced below the quantity already received'),'warn'); - } + if ($NewStatus == PurchOrder::STATUS_CANCELLED and $OK_to_updstat==1) { + if ($AuthorityLevel>$OrderTotal or $_SESSION['UserID']==$_SESSION['PO'.$identifier]->Initiator ) { + $StatusComment=date($_SESSION['DefaultDateFormat']).' - Cancelled by <a href="mailto:'.$EmailRow['email'].'">'.$_SESSION['UserID']. + '</a>'.$_POST['StatComments'].'<br />'.$_POST['statcommentscomplete']; + $_SESSION['PO'.$identifier]->StatComments=$StatusComment; + $_SESSION['PO'.$identifier]->Stat=$NewStatus; + } else { + $OK_to_updstat=0; + prnMsg( _('You do not have permission to cancel this purchase order').'.<br />'. _('This order is for').' '. + $_SESSION['PO'.$identifier]->CurrCode.' '.$OrderTotal.'. '. + _('Your authorisation limit is set at').' '.$_SESSION['PO'.$identifier]->CurrCode.' '.$AuthorityLevel.'.<br />'. + _('If you think this is a mistake please contact the systems administrator') , 'warn'); } - if ($OKToReject==1){ - if ($AuthorityLevel>$OrderTotal) { - $_SESSION['PO'.$identifier]->StatusComments = date($_SESSION['DefaultDateFormat']).' - ' . _('Rejected by') . '<a href="mailto:' . $EmailRow['email'] . '">' . $_SESSION['UserID']. '</a>'.$_POST['StatusComments'].'<br>'.$_POST['StatusCommentsComplete']; - $_SESSION['PO'.$identifier]->Status=$_POST['Status']; - } else { - $OKToUpdateStatus=0; - prnMsg( _('You do not have permission to reject this purchase order').'.<br>'. _('This order is for').' '. - $_SESSION['PO'.$identifier]->CurrCode.' '.$OrderTotal.'. '. - _('Your authorisation limit is set at').' '.$_SESSION['PO'.$identifier]->CurrCode.' '.$AuthorityLevel.'.<br>'. - _('If you think this is a mistake please contact the systems administrator') , 'warn'); - } - } } - if ($_POST['Status'] == 'Cancelled') { - $OKToCancel =1; //to start with - if(!isset($_SESSION['ExistingOrder']) OR $_SESSION['ExistingOrder']!=0) { - /* need to check that not already dispatched or invoiced - * by the supplier */ - if($_SESSION['PO'.$identifier]->Any_Already_Received()==1){ - $OKToCancel =0; - prnMsg( _('This order cannot be cancelled because some of it has already been received') . '. ' . - _('The line item quantities may be modified to quantities more than already received') . '. ' . - _('Prices cannot be altered for lines that have already been received') .' '. - _('and quantities cannot be reduced below the quantity already received'),'warn'); - } + if ($NewStatus == PurchOrder::STATUS_REJECTED and $OK_to_updstat==1) { + if ($AuthorityLevel>$OrderTotal) { + $StatusComment=date($_SESSION['DefaultDateFormat']).' - Rejected by <a href="mailto:'.$EmailRow['email'].'">'.$_SESSION['UserID']. + '</a>'.$_POST['StatComments'].'<br />'.$_POST['statcommentscomplete']; + $_SESSION['PO'.$identifier]->StatComments=$StatusComment; + $_SESSION['PO'.$identifier]->Stat=$NewStatus; + } else { + $OK_to_updstat=0; + prnMsg( _('You do not have permission to reject this purchase order').'.<br />'. _('This order is for').' '. + $_SESSION['PO'.$identifier]->CurrCode.' '.$OrderTotal.'. '. + _('Your authorisation limit is set at').' '.$_SESSION['PO'.$identifier]->CurrCode.' '.$AuthorityLevel.'.<br />'. + _('If you think this is a mistake please contact the systems administrator') , 'warn'); } - - if ($OKToCancel==1){ - - if ($AuthorityLevel>$OrderTotal) { - $_SESSION['PO'.$identifier]->StatusComments = date($_SESSION['DefaultDateFormat']).' - ' . _('Cancelled by') . '<a href="mailto:' . $EmailRow['email'] . '">' . $_SESSION['UserID']. '</a>'.$_POST['StatusComments'].'<br>'.$_POST['StatusCommentsComplete']; - $_SESSION['PO'.$identifier]->Status=$_POST['Status']; - } else { - $OKToUpdateStatus=0; - prnMsg( _('You do not have permission to cancel this purchase order').'.<br>'. _('This order is for').' '. - $_SESSION['PO'.$identifier]->CurrCode.' '.$OrderTotal.'. '. - _('Your authorisation limit is set at').' '.$_SESSION['PO'.$identifier]->CurrCode.' '.$AuthorityLevel.'.<br>'. - _('If you think this is a mistake please contact the systems administrator') , 'warn'); - } - } //end if OKToCancel } - if ($_POST['Status'] == 'Pending' and $OKToUpdateStatus==1) { + if ($NewStatus == PurchOrder::STATUS_PENDING and $OK_to_updstat==1) { if ($AuthorityLevel>$OrderTotal or $_SESSION['UserID']==$_SESSION['PO'.$identifier]->Initiator ) { - $_SESSION['PO'.$identifier]->StatusComments = date($_SESSION['DefaultDateFormat']).' - ' . _('Returned to Pending status by') . ' <a href="mailto:'. $EmailRow['email'] . '">'.$_SESSION['UserID']. - '</a>'.$_POST['StatusComments'].'<br>'.$_POST['StatusCommentsComplete']; - $_SESSION['PO'.$identifier]->Status=$_POST['Status']; + $StatusComment=date($_SESSION['DefaultDateFormat']).' - Returned to Pending status by <a href="mailto:'.$EmailRow['email'].'">'.$_SESSION['UserID']. + '</a>'.$_POST['StatComments'].'<br />'.$_POST['statcommentscomplete']; + $_SESSION['PO'.$identifier]->StatComments=$StatusComment; + $_SESSION['PO'.$identifier]->Stat=$NewStatus; } else { - $OKToUpdateStatus=0; - prnMsg( _('You do not have permission to change the status of this purchase order').'.<br>'. _('This order is for').' '. + $OK_to_updstat=0; + prnMsg( _('You do not have permission to change the status of this purchase order').'.<br />'. _('This order is for').' '. $_SESSION['PO'.$identifier]->CurrCode.' '.$OrderTotal.'. '. - _('Your authorisation limit is set at').' '.$_SESSION['PO'.$identifier]->CurrCode.' '.$AuthorityLevel.'.<br>'. + _('Your authorisation limit is set at').' '.$_SESSION['PO'.$identifier]->CurrCode.' '.$AuthorityLevel.'.<br />'. _('If you think this is a mistake please contact the systems administrator') , 'warn'); } } - if ($OKToUpdateStatus==1){ + if ($OK_to_updstat==1){ +// unset($_SESSION['PO'.$identifier]->LineItems); +// unset($_SESSION['PO'.$identifier]); +// $_SESSION['PO'.$identifier] = new PurchOrder; +// $_SESSION['RequireSupplierSelection'] = 1; if($_SESSION['ExistingOrder']!=0){ - if ($_SESSION['PO'.$identifier]->Status=='Authorised') { + if ($_SESSION['PO'.$identifier]->Stat==PurchOrder::STATUS_AUTHORISED) { $AllowPrint=1; } else { $AllowPrint=0; } - $SQL = "UPDATE purchorders SET status='" . $_POST['Status']. "', + $SQL = "UPDATE purchorders SET status='" . $_POST['Stat']. "', stat_comment='" . $StatusComment ."', allowprint='".$AllowPrint."' WHERE purchorders.orderno ='" . $_SESSION['ExistingOrder'] ."'"; @@ -247,7 +235,7 @@ $_SESSION['PO'.$identifier]->ExRate = $_POST['ExRate']; $_SESSION['PO'.$identifier]->Comments = $_POST['Comments']; $_SESSION['PO'.$identifier]->DeliveryBy = $_POST['DeliveryBy']; - $_SESSION['PO'.$identifier]->StatusMessage = $_POST['StatusComments']; + $_SESSION['PO'.$identifier]->StatusMessage = $_POST['StatComments']; $_SESSION['PO'.$identifier]->PaymentTerms = $_POST['PaymentTerms']; $_SESSION['PO'.$identifier]->Contact = $_POST['Contact']; $_SESSION['PO'.$identifier]->Tel = $_POST['Tel']; @@ -262,7 +250,8 @@ WHERE purchorders.orderno='" . $_SESSION['PO'.$identifier]->OrderNo ."'"; $ErrMsg = _('An error occurred updating the purchase order to allow reprints') . '. ' . _('The error says'); - $UpdateResult = DB_query($sql,$db,$ErrMsg); + $updateResult = DB_query($sql,$db,$ErrMsg); + } else { $_POST['RePrint'] = 0; } @@ -286,7 +275,61 @@ include ('includes/PO_ReadInOrder.inc'); } +if (isset($_POST['CancelOrder']) AND $_POST['CancelOrder']!='') { +/*The cancel button on the header screen - to delete order */ + $OK_to_delete = 1; //assume this in the first instance + if(!isset($_SESSION['ExistingOrder']) OR $_SESSION['ExistingOrder']!=0) { + /* need to check that not already dispatched or invoiced + * by the supplier */ + + if($_SESSION['PO'.$identifier]->Any_Already_Received()==1){ + $OK_to_delete =0; + prnMsg( _('This order cannot be cancelled because some of it has already been received') . '. ' . + _('The line item quantities may be modified to quantities more than already received') . '. ' . + _('Prices cannot be altered for lines that have already been received') .' '. + _('and quantities cannot be reduced below the quantity already received'),'warn'); + } + + } + + if ($OK_to_delete==1){ + $EmailSQL="SELECT email FROM www_users WHERE userid='".$_SESSION['PO'.$identifier]->Initiator."'"; + $EmailResult=DB_query($EmailSQL, $db); + $EmailRow=DB_fetch_array($EmailResult); + $StatusComment=date($_SESSION['DefaultDateFormat']). + ' - Order Cancelled by <a href="mailto:'.$EmailRow['email'].'">'.$_SESSION['UserID'].'</a><br />'.$_POST['statcommentscomplete']; + unset($_SESSION['PO'.$identifier]->LineItems); + unset($_SESSION['PO'.$identifier]); + $_SESSION['PO'.$identifier] = new PurchOrder; + $_SESSION['RequireSupplierSelection'] = 1; + + if($_SESSION['ExistingOrder']!=0){ + + $sql = "UPDATE purchorderdetails + SET completed=1 + WHERE purchorderdetails.orderno ='" . $_SESSION['ExistingOrder'] ."'"; + $ErrMsg = _('The order detail lines could not be deleted because'); + $DelResult=DB_query($sql,$db,$ErrMsg); + + $sql="UPDATE purchorders + SET status='".PurchOrder::STATUS_CANCELLED."', + stat_comment='".$StatusComment."' + WHERE orderno='".$_SESSION['ExistingOrder']."'"; + + $ErrMsg = _('The order header could not be deleted because'); + $DelResult=DB_query($sql,$db,$ErrMsg); + prnMsg( _('Order number').' '.$_SESSION['ExistingOrder'].' '._('has been cancelled'), 'success'); + unset($_SESSION['PO'.$identifier]); + unset($_SESSION['ExistingOrder']); + } else { + // Re-Direct to right place + unset($_SESSION['PO'.$identifier]); + prnMsg( _('The creation of the new order has been cancelled'), 'success'); + } + } +} + if (!isset($_SESSION['PO'.$identifier])){ /* It must be a new order being created * $_SESSION['PO'.$identifier] would be set up from the order modification @@ -315,61 +358,65 @@ if (isset($_POST['ChangeSupplier'])) { - if ($_SESSION['PO'.$identifier]->Status == PurchOrder::STATUS_PENDING and $_SESSION['UserID']==$_SESSION['PO'.$identifier]->Initiator) { +/* change supplier only allowed with appropriate permissions - + * button only displayed to modify is AccessLevel >10 + * (see below)*/ + if ($_SESSION['PO'.$identifier]->Stat == PurchOrder::STATUS_PENDING and $_SESSION['UserID']==$_SESSION['PO'.$identifier]->Initiator) { if ($_SESSION['PO'.$identifier]->Any_Already_Received()==0){ $EmailSQL='SELECT email FROM www_users WHERE userid="'.$_SESSION['PO'.$identifier]->Initiator.'"'; $EmailResult=DB_query($EmailSQL, $db); $EmailRow=DB_fetch_array($EmailResult); $_SESSION['RequireSupplierSelection']=1; - $_SESSION['PO'.$identifier]->Status = PurchOrder::STATUS_PENDING; - $StatusComment=date($_SESSION['DefaultDateFormat']).' - ' . _('Supplier changed by') . ' <a href="mailto:'.$EmailRow['email'].'">'.$_SESSION['UserID']. - '</a> - '.$_POST['StatusComments'].'<br>'.$_POST['StatusCommentsComplete']; - $_SESSION['PO'.$identifier]->StatusComments=$StatusComment; + $_SESSION['PO'.$identifier]->Stat = PurchOrder::STATUS_PENDING; + $StatusComment=date($_SESSION['DefaultDateFormat']).' - Supplier changed by <a href="mailto:'.$EmailRow['email'].'">'.$_SESSION['UserID']. + '</a> - '.$_POST['StatComments'].'<br />'.$_POST['statcommentscomplete']; + $_SESSION['PO'.$identifier]->StatComments=$StatusComment; } else { - echo '<br><br>'; + echo '<br /><br />'; prnMsg(_('Cannot modify the supplier of the order once some of the order has been received'),'warn'); } } } +$msg=''; if (isset($_POST['SearchSuppliers'])){ if (strlen($_POST['Keywords'])>0 AND strlen($_SESSION['PO'.$identifier]->SupplierID)>0) { - prnMsg(_('Supplier name keywords have been used in preference to the supplier code extract entered'),'warn'); + $msg=_('Supplier name keywords have been used in preference to the supplier code extract entered'); } if ($_POST['Keywords']=='' AND $_POST['SuppCode']=='') { - prnMsg(_('At least one Supplier Name keyword OR an extract of a Supplier Code must be entered for the search'),'error'); + $msg=_('At least one Supplier Name keyword OR an extract of a Supplier Code must be entered for the search'); } else { if (strlen($_POST['Keywords'])>0) { //insert wildcard characters in spaces $SearchString = '%' . str_replace(' ', '%', $_POST['Keywords']) . '%'; $SQL = "SELECT suppliers.supplierid, - suppliers.suppname, - suppliers.address1, - suppliers.address2, - suppliers.address3, - suppliers.address4, - suppliers.address5, - suppliers.address6, - suppliers.currcode - FROM suppliers - WHERE suppliers.suppname LIKE '". $SearchString ."' - ORDER BY suppliers.suppname"; + suppliers.suppname, + suppliers.address1, + suppliers.address2, + suppliers.address3, + suppliers.address4, + suppliers.address5, + suppliers.address6, + suppliers.currcode + FROM suppliers + WHERE suppliers.suppname LIKE '". $SearchString ."' + ORDER BY suppliers.suppname"; } elseif (strlen($_POST['SuppCode'])>0){ $SQL = "SELECT suppliers.supplierid, - suppliers.suppname, - suppliers.address1, - suppliers.address2, - suppliers.address3, - suppliers.address4, - suppliers.address5, - suppliers.address6, - suppliers.currcode - FROM suppliers - WHERE suppliers.supplierid LIKE '%" . $_POST['SuppCode'] . "%' - ORDER BY suppliers.supplierid"; + suppliers.suppname, + suppliers.address1, + suppliers.address2, + suppliers.address3, + suppliers.address4, + suppliers.address5, + suppliers.address6, + suppliers.currcode + FROM suppliers + WHERE suppliers.supplierid LIKE '%" . $_POST['SuppCode'] . "%' + ORDER BY suppliers.supplierid"; } $ErrMsg = _('The searched supplier records requested cannot be retrieved because'); @@ -386,10 +433,11 @@ } /*end of if search for supplier codes/names */ +// added by Hudson if((!isset($_POST['SearchSuppliers']) or $_POST['SearchSuppliers']=='' ) AND (isset($_SESSION['PO'.$identifier]->SupplierID) AND $_SESSION['PO'.$identifier]->SupplierID!='')){ - /*The session variables are set but the form variables could have been lost + /*The session variables are set but the form variables have been lost * need to restore the form variables from the session */ $_POST['SupplierID']=$_SESSION['PO'.$identifier]->SupplierID; $_POST['SupplierName']=$_SESSION['PO'.$identifier]->SupplierName; @@ -415,41 +463,46 @@ /* will only be true if page called from supplier selection form * or set because only one supplier record returned from a search - */ + * so parse the $Select string into supplier code and branch code */ + $sql="SELECT currcode FROM suppliers where supplierid='".$_POST['Select']."'"; + $result=DB_query($sql,$db); + $myrow=DB_fetch_array($result); + $SupplierCurrCode=$myrow['currcode']; + $authsql="SELECT cancreate + FROM purchorderauth + WHERE userid='".$_SESSION['UserID']."' + AND currabrev='".$SupplierCurrCode."'"; + + $authresult=DB_query($authsql,$db); + $sql = "SELECT suppliers.suppname, - suppliers.currcode, - currencies.rate, - suppliers.paymentterms, - suppliers.address1, - suppliers.address2, - suppliers.address3, - suppliers.address4, - suppliers.address5, - suppliers.address6, - suppliers.phn, - suppliers.port - FROM suppliers INNER JOIN currencies - ON suppliers.currcode=currencies.currabrev - WHERE supplierid='" . $_POST['Select'] . "'"; - + suppliers.currcode, + currencies.rate, + suppliers.paymentterms, + suppliers.address1, + suppliers.address2, + suppliers.address3, + suppliers.address4, + suppliers.address5, + suppliers.address6, + suppliers.phn, + suppliers.port + FROM suppliers INNER JOIN currencies + ON suppliers.currcode=currencies.currabrev + WHERE supplierid='" . $_POST['Select'] . "'"; + $ErrMsg = _('The supplier record of the supplier selected') . ': ' . $_POST['Select'] . ' ' . _('cannot be retrieved because'); $DbgMsg = _('The SQL used to retrieve the supplier details and failed was'); $result =DB_query($sql,$db,$ErrMsg,$DbgMsg); - $myrow = DB_fetch_array($result); + $myrow = DB_fetch_row($result); + $SupplierName = $myrow[0]; // added for suppliers lookup fields - $AuthSql="SELECT cancreate - FROM purchorderauth - WHERE userid='". $_SESSION['UserID'] . "' - AND currabrev='". $myrow['currcode'] . "'"; - - $AuthResult=DB_query($AuthSql,$db); - - if (($AuthRow=DB_fetch_array($AuthResult) and $AuthRow['cancreate']==0 ) ) { - $_POST['SupplierName'] = $myrow['suppname']; - $_POST['CurrCode'] = $myrow['currcode']; + if (($authmyrow=DB_fetch_array($authresult) and $authmyrow[0]==0 ) ) { + $_POST['SupplierName'] = $myrow[0]; + $_POST['CurrCode'] = $myrow[1]; $_POST['ExRate'] = $myrow[2]; $_POST['PaymentTerms']= $myrow[3]; $_POST['SuppDelAdd1'] = $myrow[4]; @@ -476,7 +529,9 @@ $_SESSION['PO'.$identifier]->SuppTel = $_POST['SuppTel']; $_SESSION['PO'.$identifier]->Port = $_POST['Port']; } else { - prnMsg( _('You do not have the authority to raise Purchase Orders for') . ' ' . $myrow['suppname'] .'. ' . _('Please Consult your system administrator for more information.') . '<br>' . _('You can setup authorisations'). ' ' . '<a href="PO_AuthorisationLevels.php">' . _('here') . '</a>', 'warn'); + prnMsg( _('You do not have the authority to raise Purchase Orders for '). + $SupplierName.'. '._('Please Consult your system administrator for more information').'. ' + ._('You can setup authorisations ').'<a href=PO_AuthorisationLevels.php>'._('here').'.</a>', 'warn'); include('includes/footer.inc'); exit; } @@ -505,8 +560,10 @@ $DbgMsg = _('The SQL used to retrieve the supplier details and failed was'); $result =DB_query($sql,$db,$ErrMsg,$DbgMsg); + $myrow = DB_fetch_row($result); + // added for suppliers lookup fields if (!isset($_SESSION['PO'.$identifier])) { $_POST['SupplierName'] = $myrow[0]; @@ -539,39 +596,45 @@ } } +// MADE THE SUPPILERS BECOME SELECT MENU NOT BY SEARCHING By Hudson @2008/6/30 + // part of step 1 if ($_SESSION['RequireSupplierSelection'] ==1 OR !isset($_SESSION['PO'.$identifier]->SupplierID) OR $_SESSION['PO'.$identifier]->SupplierID=='' ) { //if (true) { echo '<p class="page_title_text"><img src="'.$rootpath.'/css/'.$theme.'/images/supplier.png" title="' . - _('Purchase Order') . '" alt="">' . ' ' . _('Purchase Order: Select Supplier') . ''; - echo "<form action='" . $_SERVER['PHP_SELF'] . '?' . SID . "identifier=".$identifier."' method=post name='choosesupplier'>"; + _('Purchase Order') . '" alt="" />' . ' ' . _('Purchase Order: Select Supplier') . '</p>'; + echo "<form action='" . $_SERVER['PHP_SELF'] . '?' . SID . "identifier=".$identifier."' method='post' name='choosesupplier'>"; echo '<input type="hidden" name="FormID" value="' . $_SESSION['FormID'] . '" />'; + if (strlen($msg)>1){ + prnMsg($msg,'warn'); + echo '<br />'; + } - echo '<table cellpadding=3 colspan=4 class=selection> + echo '<table cellpadding="3" colspan="4" class="selection"> <tr> - <td><font size=1>' . _('Enter text in the supplier name') . ":</font></td> - <td><input type='Text' name='Keywords' size=20 maxlength=25></td> - <td><font size=3><b>" . _('OR') . '</b></font></td> - <td><font size=1>' . _('Enter text extract in the supplier code') . ":</font></td> - <td><input type='text' name='SuppCode' size=15 maxlength=18></td> + <td><font size="1">' . _('Enter text in the supplier name') . ":</font></td> + <td><input type='Text' name='Keywords' size='20' maxlength='25' /></td> + <td><font size='3'><b>" . _('OR') . '</b></font></td> + <td><font size="1">' . _('Enter text extract in the supplier code') . ":</font></td> + <td><input type='text' name='SuppCode' size='15' maxlength='18' /></td> </tr> - </table><br><div class='centre'> - <input type=submit name='SearchSuppliers' value=" . _('Search Now') . "> - <input type=submit action=reset value='" . _('Reset') . "'></div>"; + </table><br /><div class='centre'> + <input type='submit' name='SearchSuppliers' value='" . _('Search Now') . "' /> + <input type='submit' action='reset' value='" . _('Reset') . "' /></div>"; echo '<script type="text/javascript">defaultControl(document.forms[0].Keywords);</script>'; if (isset($result_SuppSelect)) { - echo '<br><table cellpadding=3 colspan=7 class=selection>'; + echo '<br /><table cellpadding="3" colspan="7" class="selection">'; - $tableheader = '<tr> - <th>' . _('Code') . '</th> - <th>' . _('Supplier Name') . '</th> - <th>' . _('Address') . '</th> - <th>' . _('Currency') . '</th> - </tr>'; + $tableheader = "<tr> + <th>" . _('Code') . "</th> + <th>" . _('Supplier Name') . "</th> + <th>" . _('Address') . "</th> + <th>" . _('Currency') . '</th> + </tr>'; echo $tableheader; @@ -611,32 +674,36 @@ } else { /* everything below here only do if a supplier is selected */ - echo '<form name="form1" action="' . $_SERVER['PHP_SELF'] . '?' . SID . 'identifier=' . $identifier . '" method=post>'; + echo "<form name='form1' action='" . $_SERVER['PHP_SELF'] . '?' . SID . "identifier=".$identifier. "' method='post'>"; echo '<input type="hidden" name="FormID" value="' . $_SESSION['FormID'] . '" />'; +// Be careful not made confused by orderno and realorderno +// $orderno = previous_id("purchorders","orderno"); +// $_SESSION['PO'.$identifier]->OrderNo2 = $orderno; echo '<p class="page_title_text"> - <img src="'.$rootpath.'/css/'.$theme.'/images/supplier.png" title="' . _('Purchase Order') . '" alt=""> - ' . $_SESSION['PO'.$identifier]->SupplierName . ' - ' . _('All amounts stated in') . ' - ' . $_SESSION['PO'.$identifier]->CurrCode . '<br />'; - + <img src="'.$rootpath.'/css/'.$theme.'/images/supplier.png" title="' . _('Purchase Order') . '" alt="" /> + ' . $_SESSION['PO'.$identifier]->SupplierName . ' - ' . _('All amounts stated in') . ' + ' . $_SESSION['PO'.$identifier]->CurrCode . '<br />'; if ($_SESSION['ExistingOrder']) { echo _(' Modify Purchase Order Number') . ' ' . $_SESSION['PO'.$identifier]->OrderNo; - - echo '</p>'; - } + echo '</p>'; if (isset($Purch_Item)) { prnMsg(_('Purchase Item(s) with this code') . ': ' . $Purch_Item,'info'); - echo '<div class="centre">'; - echo '<br><table class="table_index"><tr><td class="menu_group_item">'; + /** + * Now go ahead to PO_Items.php + * with NewItem=$Purch_Item + */ + echo "<div class='centre'>"; + echo '<br /><table class="table_index"><tr><td class="menu_group_item">'; /* the link */ - echo '<li><a href="'.$rootpath.'/PO_Items.php?' . SID . 'NewItem=' . $Purch_Item . '&identifier=' . $identifier . '">' . + echo '<li><a href="'.$rootpath.'/PO_Items.php?' . SID . 'NewItem=' . $Purch_Item . "&identifier=".$identifier. '">' . _('Enter Line Item to this purchase order') . '</a></li>'; /**/ - echo '</td></tr></table></div><br>'; + echo "</td></tr></table></div><br />"; if (isset($_GET['Quantity'])) { $Qty=$_GET['Quantity']; @@ -696,7 +763,6 @@ 0, $Qty, $Qty*$PurchItemRow['price']); - echo "<meta http-equiv='Refresh' content='0; url=" . $rootpath . '/PO_Items.php?' . SID . 'identifier='.$identifier. "'>"; } @@ -707,33 +773,34 @@ /* The session variables are set but the form variables have * been lost -- * need to restore the form variables from the session */ - $_POST['StkLocation']=$_SESSION['PO'.$identifier]->Location; + $_POST['StkLocation']=$_SESSION['PO'.$identifier]->Location; $_POST['SupplierContact']=$_SESSION['PO'.$identifier]->SupplierContact; - $_POST['DelAdd1']=$_SESSION['PO'.$identifier]->DelAdd1; - $_POST['DelAdd2']=$_SESSION['PO'.$identifier]->DelAdd2; - $_POST['DelAdd3']=$_SESSION['PO'.$identifier]->DelAdd3; - $_POST['DelAdd4']=$_SESSION['PO'.$identifier]->DelAdd4; - $_POST['DelAdd5']=$_SESSION['PO'.$identifier]->DelAdd5; - $_POST['DelAdd6']=$_SESSION['PO'.$identifier]->DelAdd6; - $_POST['Initiator']=$_SESSION['PO'.$identifier]->Initiator; - $_POST['Requisition']=$_SESSION['PO'.$identifier]->RequisitionNo; - $_POST['Version']=$_SESSION['PO'.$identifier]->Version; - $_POST['DeliveryDate']=$_SESSION['PO'.$identifier]->DeliveryDate; - $_POST['Revised']=$_SESSION['PO'.$identifier]->Revised; - $_POST['ExRate']=$_SESSION['PO'.$identifier]->ExRate; - $_POST['Comments']=$_SESSION['PO'.$identifier]->Comments; - $_POST['DeliveryBy']=$_SESSION['PO'.$identifier]->DeliveryBy; - $_POST['PaymentTerms']=$_SESSION['PO'.$identifier]->PaymentTerms; + $_POST['DelAdd1']=$_SESSION['PO'.$identifier]->DelAdd1; + $_POST['DelAdd2']=$_SESSION['PO'.$identifier]->DelAdd2; + $_POST['DelAdd3']=$_SESSION['PO'.$identifier]->DelAdd3; + $_POST['DelAdd4']=$_SESSION['PO'.$identifier]->DelAdd4; + $_POST['DelAdd5']=$_SESSION['PO'.$identifier]->DelAdd5; + $_POST['DelAdd6']=$_SESSION['PO'.$identifier]->DelAdd6; + $_POST['Initiator']=$_SESSION['PO'.$identifier]->Initiator; + $_POST['Requisition']=$_SESSION['PO'.$identifier]->RequisitionNo; + $_POST['Version']=$_SESSION['PO'.$identifier]->Version; + $_POST['DeliveryDate']=$_SESSION['PO'.$identifier]->DeliveryDate; + $_POST['Revised']=$_SESSION['PO'.$identifier]->Revised; + $_POST['ExRate']=$_SESSION['PO'.$identifier]->ExRate; + $_POST['Comments']=$_SESSION['PO'.$identifier]->Comments; + $_POST['DeliveryBy']=$_SESSION['PO'.$identifier]->DeliveryBy; + $_POST['PaymentTerms']=$_SESSION['PO'.$identifier]->PaymentTerms; } - echo '<br><table colspan=1 width=80%> +// move apart by Hudson + echo '<br /><table colspan="1" width="80%"> <tr> - <th><font color=blue size=4><b>' . _('Order Initiation Details') . '</b></font></th> + <th><font color="blue" size="4"><b>' . _('Order Initiation Details') . '</b></font></th> - <th><font color=blue size=4><b>' . _('Order Status') . '</b></font></th> + <th><font color="blue" size="4"><b>' . _('Order Status') . '</b></font></th> </tr> <tr><td style="width:50%">'; - echo '<table class=selection width=100%>'; + echo '<table class="selection" width="100%">'; echo '<tr><td>' . _('PO Date') . ':</td><td>'; if ($_SESSION['ExistingOrder']!=0){ echo ConvertSQLDate($_SESSION['PO'.$identifier]->Orig_OrderDate); @@ -795,61 +862,75 @@ } if ($_SESSION['PO'.$identifier]->AllowPrintPO==0 AND empty($_POST['RePrint'])){ - echo '<tr><td>' . _('Allow Reprint') . ':</td> - <td><select name="RePrint" onChange="ReloadForm(form1.AllowRePrint)"> - <option selected value=0>' . _('No') . '</option> - <option value=1>' . _('Yes') . '</option> - </select></td>'; - echo '<td><input type=submit name="AllowRePrint" value="Update"></td></tr>'; + echo '<tr><td>' . _('Allow Reprint') . ":</td><td><select name='RePrint' onChange='ReloadForm(form1.AllowRePrint)'><option selected value=0>" . + _('No') . "<option value=1>" . _('Yes') . '</select></td>'; + echo '<td><input type=submit name="AllowRePrint" value="Update" /></td></tr>'; } elseif ($Printed) { - echo '<tr><td colspan=2><a target="_blank" href="' . $rootpath . '/PO_PDFPurchOrder.php?' . SID . 'OrderNo=' . $_SESSION['ExistingOrder'] . '&identifier='.$identifier. '">' . _('Reprint Now') . '</a></td></tr>'; + echo "<tr><td colspan='2'><a target='_blank' href='$rootpath/PO_PDFPurchOrder.php?" . + SID . "OrderNo=" . $_SESSION['ExistingOrder'] . "&identifier=".$identifier. "'>" . _('Reprint Now') . '</a></td></tr>'; } echo '</table>'; - echo '<td style="width:50%" valign=top><table class=selection width=100%>'; - - if($_SESSION['ExistingOrder'] != 0 AND $_SESSION['PO'.$identifier]->Status == 'Printed'){ - - echo '<tr><td><a href="' . $rootpath . '/GoodsReceived.php?' . SID . '&PONumber=' . - $_SESSION['PO'.$identifier]->OrderNo . '&identifier=' . $identifier . '">'._('Receive this order').'</a></td></tr>'; + echo '<td style="width:50%" valign="top"><table class="selection" width="100%">'; + if($_SESSION['ExistingOrder'] != 0 and $_SESSION['PO'.$identifier]->Stat == PurchOrder::STATUS_PRINTED){ + echo '<tr><td><a href="' .$rootpath . "/GoodsReceived.php?" . SID . "&PONumber=" . + $_SESSION['PO'.$identifier]->OrderNo . "&identifier=".$identifier.'">'._('Receive this order').'</a></td></tr>'; } - if ($_SESSION['PO'.$identifier]->Status==''){ //then its a new order - echo '<input type="hidden" name="Status" value="NewOrder">'; - echo '<tr><td>' . _('New Purchase Order') . '</td></tr>'; - } else { - echo '<tr><td>' . _('Status') . ' : </td><td><select name="Status" onChange="ReloadForm(form1.UpdateStatus)">'; - - switch ($_SESSION['PO'.$identifier]->Status) { - case 'Pending': - echo '<option selected value="Pending">' . _('Pending') . '</option> - <option value="Authorised">' . _('Authorised') . '</option> - <option value="Rejected">' . _('Rejected') . '</option>'; - break; - case 'Authorised': - echo '<option value="Pending">' . _('Pending') . '</option> - <option selected value="Authorised">' . _('Authorised') . '</option>'; - break; - case 'Printed': - echo '<option selected value="Pending">' . _('Pending') . '</option> - <option value="Printed">' . _('Printed') . '</option>'; - break; - case 'Completed': - echo '<option selected value="Completed">' . _('Completed') . '</option>'; - break; + echo '<td>' . _('Status') . ' : </td><td><select name="Stat" onChange="ReloadForm(form1.UpdateStat)">'; + + switch ($_SESSION['PO'.$identifier]->Stat) { + case '': + $StatusList = array(PurchOrder::STATUS_NEW_ORDER); + break; + case PurchOrder::STATUS_PENDING: + $StatusList = array(PurchOrder::STATUS_PENDING, PurchOrder::STATUS_AUTHORISED, + PurchOrder::STATUS_REJECTED, PurchOrder::STATUS_CANCELLED); + break; + case PurchOrder::STATUS_AUTHORISED: + $StatusList = array(PurchOrder::STATUS_PENDING, PurchOrder::STATUS_AUTHORISED, + PurchOrder::STATUS_CANCELLED); + break; + case PurchOrder::STATUS_REJECTED: + $StatusList = array(PurchOrder::STATUS_PENDING, PurchOrder::STATUS_AUTHORISED, + PurchOrder::STATUS_REJECTED, PurchOrder::STATUS_CANCELLED); + break; + case PurchOrder::STATUS_CANCELLED: + $StatusList = array(PurchOrder::STATUS_PENDING, PurchOrder::STATUS_CANCELLED); + break; + case PurchOrder::STATUS_PRINTED: + $StatusList = array(PurchOrder::STATUS_PENDING, PurchOrder::STATUS_PRINTED, + PurchOrder::STATUS_CANCELLED); + break; + case PurchOrder::STATUS_COMPLITED: + $StatusList = array(PurchOrder::STATUS_COMPLITED); + break; + default: + $StatusList = array(PurchOrder::STATUS_NEW_ORDER, PurchOrder::STATUS_PENDING, + PurchOrder::STATUS_AUTHORISED, PurchOrder::STATUS_REJECTED, + PurchOrder::STATUS_CANCELLED); + break; + } + + foreach ($StatusList as $Status) { + if ($_SESSION['PO'.$identifier]->Stat == $Status){ + echo '<option selected value="' . $Status . '">' . _($Status) . '</option>'; + } else { + echo '<option value="'.$Status.'">' . _($Status) . '</option>'; } + } + echo '</select></td></tr>'; - echo '</select></td></tr>'; - - echo '<tr><td>' . _('Status Comment') . ':</td> - <td><input type=text name="StatusComments" size=50></td></tr> - <tr><td colspan=2><b>' . html_entity_decode($_SESSION['PO'.$identifier]->StatusComments) .'</b></td></tr>'; - echo '<input type=hidden name="StatusCommentsComplete" value="' . $_SESSION['PO'.$identifier]->StatusComments .'">'; - echo '<tr><td><input type="submit" name="UpdateStatus" value="' . _('Status Update') .'"></td>'; - } //end its not a new order - - echo '</tr></table></td>'; + echo '<tr><td>' . _('Status Comment'); + echo ":</td><td><input type=text name='StatComments' size=50></td></tr><tr><td colspan=2><b>" . html_entity_decode($_SESSION['PO'.$identifier]->StatComments) .'</b></td></tr>'; + echo "<input type=hidden name='statcommentscomplete' value='".$_SESSION['PO'.$identifier]->StatComments."'>"; + echo '<tr><td><input type="submit" name=UpdateStat value="' . _("Status Update") .'"></td>'; + echo "<td><input type='submit' name='CancelOrder' value='" . _("Cancel and Delete Order") . "'></td></tr>"; + echo '</table></td>'; + +// end of move by Hudson + echo '<table width=80%> <tr> <th><font color=blue size=4><b>' . _('Warehouse Info') . '</b></font></th> @@ -862,17 +943,17 @@ echo '<table class=selection width=100%><tr><td>' . _('Warehouse') . ':</td> <td><select name=StkLocation onChange="ReloadForm(form1.LookupDeliveryAddress)">'; - $sql = 'SELECT loccode, - locationname - FROM locations'; + $sql = "SELECT loccode, + locationname + FROM locations"; $LocnResult = DB_query($sql,$db); while ($LocnRow=DB_fetch_array($LocnResult)){ if (isset($_POST['StkLocation']) and ($_POST['StkLocation'] == $LocnRow['loccode'] OR ($_POST['StkLocation']=='' AND $LocnRow['loccode']==$_SESSION['UserStockLocation']))){ - echo '<option selected value="' . $LocnRow['loccode'] . '">' . $LocnRow['locationname'] . '</option>'; + echo "<option selected value='" . $LocnRow['loccode'] . "'>" . $LocnRow['locationname']; } else { - echo '<option value="' . $LocnRow['loccode'] . '">' . $LocnRow['locationname'] . '</option>'; + echo "<option value='" . $LocnRow['loccode'] . "'>" . $LocnRow['locationname']; } } @@ -888,15 +969,15 @@ $_POST['StkLocation'] = $_SESSION['UserStockLocation']; $sql = "SELECT deladd1, - deladd2, - deladd3, - deladd4, - deladd5, - deladd6, - tel, - contact - FROM locations - WHERE loccode='" . $_POST['StkLocation'] . "'"; + deladd2, + deladd3, + deladd4, + deladd5, + deladd6, + tel, + contact + FROM locations + WHERE loccode='" . $_POST['StkLocation'] . "'"; $LocnAddrResult = DB_query($sql,$db); if (DB_num_rows($LocnAddrResult)==1){ @@ -931,15 +1012,15 @@ } elseif (isset($_POST['LookupDeliveryAddress'])){ $sql = "SELECT deladd1, - deladd2, - deladd3, - deladd4, - deladd5, - deladd6, - tel, - contact - FROM locations - WHERE loccode='" . $_POST['StkLocation'] . "'"; + deladd2, + deladd3, + deladd4, + deladd5, + deladd6, + tel, + contact + FROM locations + WHERE loccode='" . $_POST['StkLocation'] . "'"; $LocnAddrResult = DB_query($sql,$db); if (DB_num_rows($LocnAddrResult)==1){ @@ -1110,11 +1191,11 @@ echo '</td></tr></table><br />'; /* end of main table */ // discard change supplier submit buttom - + // kept enter line item but remove Delete button by Hudson 11/16,and added status field echo "<div class='centre'> <input type=submit name='EnterLines' value='" . _('Enter Line Items') . "'></div>"; + // Delete PO when necessrary - } /*end of if supplier selected */ echo '</form>'; Modified: trunk/PO_Items.php =================================================================== --- trunk/PO_Items.php 2010-12-22 17:07:58 UTC (rev 4437) +++ trunk/PO_Items.php 2010-12-22 17:14:09 UTC (rev 4438) @@ -33,7 +33,7 @@ } // add new request here 08-09-26 -if (isset($_POST['StockID2']) AND $_GET['Edit']=='') { +if (isset($_POST['StockID2']) && $_GET['Edit']=='') { /* If a stock item is selected and a purchdata record * exists for it then find that record. */ @@ -95,15 +95,15 @@ /*If all clear then proceed to update the database */ if ($InputError!=1){ - $EmailSql="SELECT email FROM www_users WHERE userid='".$_SESSION['PO'.$identifier]->Initiator."'"; - $EmailResult=DB_query($EmailSql, $db); - $EmailRow=DB_fetch_array($EmailResult); - + $emailsql="SELECT email FROM www_users WHERE userid='".$_SESSION['PO'.$identifier]->Initiator."'"; + $emailresult=DB_query($emailsql, $db); + $emailrow=DB_fetch_array($emailresult); + $result = DB_Txn_Begin($db); if ($_SESSION['ExistingOrder']==0){ /*its a new order to be inserted */ - $StatusComment=date($_SESSION['DefaultDateFormat']).' - ' . _('Order Created by') . ' <a href="mailto:'.$EmailRow['email'].'">'.$_SESSION['PO'.$identifier]->Initiator. + $StatusComment=date($_SESSION['DefaultDateFormat']).' - Order Created by <a href="mailto:'.$emailrow['email'].'">'.$_SESSION['PO'.$identifier]->Initiator. '</a> - '.$_SESSION['PO'.$identifier]->StatusMessage.'<br>'; /*Get the order number */ @@ -168,7 +168,7 @@ '" . $_SESSION['PO'.$identifier]->Version . "', '" . Date('Y-m-d') . "', '" . $_SESSION['PO'.$identifier]->DeliveryBy . "', - 'Pending', + '" . 'Pending' . "', '" . $StatusComment . "', '" . FormatDateForSQL($_SESSION['PO'.$identifier]->DeliveryDate) . "', '" . $_SESSION['PO'.$identifier]->PaymentTerms. "' @@ -264,7 +264,7 @@ contact='" . $_SESSION['PO'.$identifier]->Contact . "', paymentterms='" . $_SESSION['PO'.$identifier]->PaymentTerms . "', allowprint='" . $_SESSION['PO'.$identifier]->AllowPrintPO . "', - status = 'Pending' + status = '" . PurchOrder::STATUS_PENDING . "' WHERE orderno = '" . $_SESSION['PO'.$identifier]->OrderNo ."'"; $ErrMsg = _('The purchase order could not be updated because'); This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <tim...@us...> - 2010-12-23 15:30:38
|
Revision: 4443 http://web-erp.svn.sourceforge.net/web-erp/?rev=4443&view=rev Author: tim_schofield Date: 2010-12-23 15:30:30 +0000 (Thu, 23 Dec 2010) Log Message: ----------- Remove unnecessary $PageSecurity assignments Modified Paths: -------------- trunk/AddCustomerTypeNotes.php trunk/Areas.php trunk/BOMInquiry.php trunk/Credit_Invoice.php trunk/Currencies.php trunk/CustWhereAlloc.php trunk/EmailConfirmation.php trunk/FixedAssetRegister.php trunk/FormDesigner.php trunk/GLBudgets.php trunk/GLTags.php trunk/GeocodeSetup.php trunk/GetStockImage.php trunk/Logout.php trunk/PDFTopItems.php trunk/PO_AuthoriseMyOrders.php trunk/PO_PDFPurchOrder.php trunk/PO_SelectOSPurchOrder.php trunk/PO_SelectPurchOrder.php trunk/PricesBasedOnMarkUp.php trunk/Prices_Customer.php trunk/PrintCustTrans.php trunk/SalesGLPostings.php trunk/SalesGraph.php trunk/SelectCustomer.php trunk/SelectProduct.php trunk/SelectRecurringSalesOrder.php trunk/SelectSupplier.php trunk/StockCheck.php trunk/StockCostUpdate.php trunk/StockUsageGraph.php trunk/SystemCheck.php trunk/TaxGroups.php trunk/UpgradeDatabase.php trunk/Z_ChangeStockCategory.php trunk/Z_CheckDebtorsControl.php trunk/Z_CheckGLTransBalance.php trunk/Z_CurrencyDebtorsBalances.php trunk/Z_CurrencySuppliersBalances.php trunk/Z_ImportStocks.php trunk/Z_PriceChanges.php trunk/Z_Upgrade3.10.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_index.php trunk/geo_displaymap_customers.php trunk/geo_displaymap_suppliers.php trunk/geocode.php trunk/geocode_genxml_customers.php trunk/geocode_genxml_suppliers.php trunk/index.php Modified: trunk/AddCustomerTypeNotes.php =================================================================== --- trunk/AddCustomerTypeNotes.php 2010-12-23 10:52:28 UTC (rev 4442) +++ trunk/AddCustomerTypeNotes.php 2010-12-23 15:30:30 UTC (rev 4443) @@ -1,7 +1,7 @@ <?php /* $Revision: 1.3 $ */ /* $Id$*/ -$PageSecurity = 3; +//$PageSecurity = 3; include('includes/session.inc'); $title = _('Customer Type (Group) Notes'); include('includes/header.inc'); Modified: trunk/Areas.php =================================================================== --- trunk/Areas.php 2010-12-23 10:52:28 UTC (rev 4442) +++ trunk/Areas.php 2010-12-23 15:30:30 UTC (rev 4443) @@ -1,7 +1,7 @@ <?php /* $Revision: 1.22 $ */ /* $Id$*/ -$PageSecurity = 3; +//$PageSecurity = 3; include('includes/session.inc'); Modified: trunk/BOMInquiry.php =================================================================== --- trunk/BOMInquiry.php 2010-12-23 10:52:28 UTC (rev 4442) +++ trunk/BOMInquiry.php 2010-12-23 15:30:30 UTC (rev 4443) @@ -1,7 +1,7 @@ <?php /* $Revision: 1.12 $ */ /* $Id$*/ -$PageSecurity = 2; +//$PageSecurity = 2; include('includes/session.inc'); $title = _('Costed Bill Of Material'); Modified: trunk/Credit_Invoice.php =================================================================== --- trunk/Credit_Invoice.php 2010-12-23 10:52:28 UTC (rev 4442) +++ trunk/Credit_Invoice.php 2010-12-23 15:30:30 UTC (rev 4443) @@ -1,7 +1,7 @@ <?php /* $Revision: 1.35 $ */ /* $Id$*/ -$PageSecurity =3; +//$PageSecurity =3; /*Functions to get the GL codes to post the transaction to */ Modified: trunk/Currencies.php =================================================================== --- trunk/Currencies.php 2010-12-23 10:52:28 UTC (rev 4442) +++ trunk/Currencies.php 2010-12-23 15:30:30 UTC (rev 4443) @@ -1,7 +1,7 @@ <?php /* $Revision: 1.20 $ */ /* $Id$*/ -$PageSecurity = 9; +//$PageSecurity = 9; include('includes/session.inc'); $title = _('Currencies Maintenance'); Modified: trunk/CustWhereAlloc.php =================================================================== --- trunk/CustWhereAlloc.php 2010-12-23 10:52:28 UTC (rev 4442) +++ trunk/CustWhereAlloc.php 2010-12-23 15:30:30 UTC (rev 4443) @@ -1,7 +1,7 @@ <?php /* $Revision: 1.10 $ */ /* $Id$*/ -$PageSecurity = 2; +//$PageSecurity = 2; include('includes/session.inc'); $title = _('Customer How Paid Inquiry'); Modified: trunk/EmailConfirmation.php =================================================================== --- trunk/EmailConfirmation.php 2010-12-23 10:52:28 UTC (rev 4442) +++ trunk/EmailConfirmation.php 2010-12-23 15:30:30 UTC (rev 4443) @@ -1,7 +1,7 @@ <?php /* $Id$*/ -$PageSecurity = 2; +//$PageSecurity = 2; include('includes/session.inc'); include('includes/SQL_CommonFunctions.inc'); Modified: trunk/FixedAssetRegister.php =================================================================== --- trunk/FixedAssetRegister.php 2010-12-23 10:52:28 UTC (rev 4442) +++ trunk/FixedAssetRegister.php 2010-12-23 15:30:30 UTC (rev 4443) @@ -1,5 +1,5 @@ <?php -$PageSecurity = 11; +//$PageSecurity = 11; include ('includes/session.inc'); $title = _('Fixed Asset Register'); $csv_output = ''; Modified: trunk/FormDesigner.php =================================================================== --- trunk/FormDesigner.php 2010-12-23 10:52:28 UTC (rev 4442) +++ trunk/FormDesigner.php 2010-12-23 15:30:30 UTC (rev 4443) @@ -1,6 +1,6 @@ <?php /* $Id$ */ -$PageSecurity = 14; +//$PageSecurity = 14; include('includes/session.inc'); $title = _('Form Designer'); include('includes/header.inc'); Modified: trunk/GLBudgets.php =================================================================== --- trunk/GLBudgets.php 2010-12-23 10:52:28 UTC (rev 4442) +++ trunk/GLBudgets.php 2010-12-23 15:30:30 UTC (rev 4443) @@ -1,7 +1,7 @@ <?php /* $Id$*/ -$PageSecurity = 10; +//$PageSecurity = 10; include('includes/session.inc'); include('includes/SQL_CommonFunctions.inc'); Modified: trunk/GLTags.php =================================================================== --- trunk/GLTags.php 2010-12-23 10:52:28 UTC (rev 4442) +++ trunk/GLTags.php 2010-12-23 15:30:30 UTC (rev 4443) @@ -1,7 +1,7 @@ <?php /* $Id$*/ -$PageSecurity = 10; +//$PageSecurity = 10; include('includes/session.inc'); $title = _('Maintain General Ledger Tags'); Modified: trunk/GeocodeSetup.php =================================================================== --- trunk/GeocodeSetup.php 2010-12-23 10:52:28 UTC (rev 4442) +++ trunk/GeocodeSetup.php 2010-12-23 15:30:30 UTC (rev 4443) @@ -1,7 +1,7 @@ <?php /* $Id$*/ -$PageSecurity = 3; +//$PageSecurity = 3; include('includes/session.inc'); $title = _('Geocode Maintenance'); include('includes/header.inc'); Modified: trunk/GetStockImage.php =================================================================== --- trunk/GetStockImage.php 2010-12-23 10:52:28 UTC (rev 4442) +++ trunk/GetStockImage.php 2010-12-23 15:30:30 UTC (rev 4443) @@ -1,7 +1,7 @@ <?php /* $Id$*/ -$PageSecurity = 1; +//$PageSecurity = 1; include ('includes/session.inc'); /* http://127.0.0.1/~brink/webERP/GetStockImage.php Modified: trunk/Logout.php =================================================================== --- trunk/Logout.php 2010-12-23 10:52:28 UTC (rev 4442) +++ trunk/Logout.php 2010-12-23 15:30:30 UTC (rev 4443) @@ -1,7 +1,7 @@ <?php /* $Revision: 1.17 $ */ /* $Id$*/ -$PageSecurity =1; +//$PageSecurity =1; $AllowAnyone=True; /* Allow all users to log off - needed for autoamted runs */ include('includes/session.inc'); Modified: trunk/PDFTopItems.php =================================================================== --- trunk/PDFTopItems.php 2010-12-23 10:52:28 UTC (rev 4442) +++ trunk/PDFTopItems.php 2010-12-23 15:30:30 UTC (rev 4443) @@ -1,7 +1,7 @@ <?php /* $Revision: 1.2 $ */ /* $Id$*/ -$PageSecurity = 2; +//$PageSecurity = 2; include ('includes/session.inc'); include ('includes/PDFStarter.php'); $FontSize = 10; Modified: trunk/PO_AuthoriseMyOrders.php =================================================================== --- trunk/PO_AuthoriseMyOrders.php 2010-12-23 10:52:28 UTC (rev 4442) +++ trunk/PO_AuthoriseMyOrders.php 2010-12-23 15:30:30 UTC (rev 4443) @@ -1,7 +1,7 @@ <?php /* $Id$*/ -$PageSecurity = 4; +//$PageSecurity = 4; include('includes/session.inc'); $title = _('Authorise Purchase Orders'); Modified: trunk/PO_PDFPurchOrder.php =================================================================== --- trunk/PO_PDFPurchOrder.php 2010-12-23 10:52:28 UTC (rev 4442) +++ trunk/PO_PDFPurchOrder.php 2010-12-23 15:30:30 UTC (rev 4443) @@ -1,6 +1,6 @@ <?php /* $Id$*/ -$PageSecurity = 2; +//$PageSecurity = 2; include('includes/session.inc'); include('includes/SQL_CommonFunctions.inc'); include('includes/DefinePOClass.php'); Modified: trunk/PO_SelectOSPurchOrder.php =================================================================== --- trunk/PO_SelectOSPurchOrder.php 2010-12-23 10:52:28 UTC (rev 4442) +++ trunk/PO_SelectOSPurchOrder.php 2010-12-23 15:30:30 UTC (rev 4443) @@ -442,9 +442,9 @@ } else { $PrintPurchOrder = _('Printed'); } - + $PrintPurchOrder2 = '<a target="_blank" href="' . $rootpath . '/PO_PDFPurchOrder.php?' . SID . '&OrderNo=' . $myrow['orderno'] . '&realorderno=' . $myrow['realorderno'] . '&ViewingOnly=1">' . _('Show') . '</a>'; - + $s2 = '<a target="_blank" href="' . $rootpath . '/PO_PDFPurchOrder.php?' . SID . '&OrderNo=' . $myrow['orderno'] . '&realorderno=' . $myrow['realorderno'] . '&ViewingOnly=1">' . $myrow['realorderno']. '</a>'; $FormatedOrderDate = ConvertSQLDate($myrow['orddate']); Modified: trunk/PO_SelectPurchOrder.php =================================================================== --- trunk/PO_SelectPurchOrder.php 2010-12-23 10:52:28 UTC (rev 4442) +++ trunk/PO_SelectPurchOrder.php 2010-12-23 15:30:30 UTC (rev 4443) @@ -1,6 +1,6 @@ <?php /* $Id$*/ -$PageSecurity = 2; +//$PageSecurity = 2; include ('includes/session.inc'); $title = _('Search Purchase Orders'); include ('includes/header.inc'); Modified: trunk/PricesBasedOnMarkUp.php =================================================================== --- trunk/PricesBasedOnMarkUp.php 2010-12-23 10:52:28 UTC (rev 4442) +++ trunk/PricesBasedOnMarkUp.php 2010-12-23 15:30:30 UTC (rev 4443) @@ -1,7 +1,7 @@ <?php /* $Revision: 1.9 $ */ /* $Id$*/ -$PageSecurity=11; +//$PageSecurity=11; include('includes/session.inc'); Modified: trunk/Prices_Customer.php =================================================================== --- trunk/Prices_Customer.php 2010-12-23 10:52:28 UTC (rev 4442) +++ trunk/Prices_Customer.php 2010-12-23 15:30:30 UTC (rev 4443) @@ -1,7 +1,7 @@ <?php /* $Revision: 1.11 $ */ /* $Id$*/ -$PageSecurity = 11; +//$PageSecurity = 11; include('includes/session.inc'); Modified: trunk/PrintCustTrans.php =================================================================== --- trunk/PrintCustTrans.php 2010-12-23 10:52:28 UTC (rev 4442) +++ trunk/PrintCustTrans.php 2010-12-23 15:30:30 UTC (rev 4443) @@ -1,6 +1,6 @@ <?php /* $Id$ */ -$PageSecurity = 1; +//$PageSecurity = 1; include ('includes/session.inc'); if (isset($_GET['FromTransNo'])) { $FromTransNo = trim($_GET['FromTransNo']); Modified: trunk/SalesGLPostings.php =================================================================== --- trunk/SalesGLPostings.php 2010-12-23 10:52:28 UTC (rev 4442) +++ trunk/SalesGLPostings.php 2010-12-23 15:30:30 UTC (rev 4443) @@ -1,7 +1,7 @@ <?php /* $Id$*/ -$PageSecurity = 10; +//$PageSecurity = 10; include('includes/session.inc'); $title = _('Sales GL Postings Set Up'); Modified: trunk/SalesGraph.php =================================================================== --- trunk/SalesGraph.php 2010-12-23 10:52:28 UTC (rev 4442) +++ trunk/SalesGraph.php 2010-12-23 15:30:30 UTC (rev 4443) @@ -1,7 +1,7 @@ <?php /* $Id$*/ -$PageSecurity = 6; +//$PageSecurity = 6; include('includes/session.inc'); include('includes/phplot/phplot.php'); $title=_('Sales Report Graph'); Modified: trunk/SelectCustomer.php =================================================================== --- trunk/SelectCustomer.php 2010-12-23 10:52:28 UTC (rev 4442) +++ trunk/SelectCustomer.php 2010-12-23 15:30:30 UTC (rev 4443) @@ -1,6 +1,6 @@ <?php /* $Id$*/ -$PageSecurity = 2; +//$PageSecurity = 2; include ('includes/session.inc'); $title = _('Search Customers'); include ('includes/header.inc'); Modified: trunk/SelectProduct.php =================================================================== --- trunk/SelectProduct.php 2010-12-23 10:52:28 UTC (rev 4442) +++ trunk/SelectProduct.php 2010-12-23 15:30:30 UTC (rev 4443) @@ -1,6 +1,6 @@ <?php /* $Id$*/ -$PageSecurity = 2; +//$PageSecurity = 2; $PricesSecurity = 12; include ('includes/session.inc'); $title = _('Search Inventory Items'); Modified: trunk/SelectRecurringSalesOrder.php =================================================================== --- trunk/SelectRecurringSalesOrder.php 2010-12-23 10:52:28 UTC (rev 4442) +++ trunk/SelectRecurringSalesOrder.php 2010-12-23 15:30:30 UTC (rev 4443) @@ -1,6 +1,6 @@ <?php /* $Id$*/ -$PageSecurity = 2; +//$PageSecurity = 2; include('includes/session.inc'); $title = _('Search Recurring Sales Orders'); Modified: trunk/SelectSupplier.php =================================================================== --- trunk/SelectSupplier.php 2010-12-23 10:52:28 UTC (rev 4442) +++ trunk/SelectSupplier.php 2010-12-23 15:30:30 UTC (rev 4443) @@ -1,6 +1,6 @@ <?php /* $Id$*/ -$PageSecurity = 2; +//$PageSecurity = 2; include ('includes/session.inc'); $title = _('Search Suppliers'); include ('includes/header.inc'); Modified: trunk/StockCheck.php =================================================================== --- trunk/StockCheck.php 2010-12-23 10:52:28 UTC (rev 4442) +++ trunk/StockCheck.php 2010-12-23 15:30:30 UTC (rev 4443) @@ -1,7 +1,7 @@ <?php /* $Revision: 1.13 $ */ /* $Id$*/ -$PageSecurity = 2; +//$PageSecurity = 2; include('includes/session.inc'); If (isset($_POST['PrintPDF']) Modified: trunk/StockCostUpdate.php =================================================================== --- trunk/StockCostUpdate.php 2010-12-23 10:52:28 UTC (rev 4442) +++ trunk/StockCostUpdate.php 2010-12-23 15:30:30 UTC (rev 4443) @@ -4,7 +4,7 @@ //$PageSecurity = 9; /*viewing possible with inquiries but not mods */ -$UpdateSecurity =10; +//$UpdateSecurity =10; include('includes/session.inc'); $title = _('Stock Cost Update'); Modified: trunk/StockUsageGraph.php =================================================================== --- trunk/StockUsageGraph.php 2010-12-23 10:52:28 UTC (rev 4442) +++ trunk/StockUsageGraph.php 2010-12-23 15:30:30 UTC (rev 4443) @@ -1,6 +1,6 @@ <?php /* $Id$*/ -$PageSecurity = 2; +//$PageSecurity = 2; include('includes/session.inc'); $result = DB_query("SELECT description FROM stockmaster WHERE stockid='" . trim(strtoupper($_GET['StockID'])) . "'",$db); $myrow = DB_fetch_row($result); Modified: trunk/SystemCheck.php =================================================================== --- trunk/SystemCheck.php 2010-12-23 10:52:28 UTC (rev 4442) +++ trunk/SystemCheck.php 2010-12-23 15:30:30 UTC (rev 4443) @@ -1,6 +1,6 @@ <?php /* $Id$*/ -$PageSecurity =10; +//$PageSecurity =10; include('includes/session.inc'); $title = _('System Check'); include('includes/header.inc'); Modified: trunk/TaxGroups.php =================================================================== --- trunk/TaxGroups.php 2010-12-23 10:52:28 UTC (rev 4442) +++ trunk/TaxGroups.php 2010-12-23 15:30:30 UTC (rev 4443) @@ -1,6 +1,6 @@ <?php /* $Id$*/ -$PageSecurity=15; +//PageSecurity=15; include('includes/session.inc'); Modified: trunk/UpgradeDatabase.php =================================================================== --- trunk/UpgradeDatabase.php 2010-12-23 10:52:28 UTC (rev 4442) +++ trunk/UpgradeDatabase.php 2010-12-23 15:30:30 UTC (rev 4443) @@ -1,6 +1,6 @@ <?php -$PageSecurity = 15; +//$PageSecurity = 15; include('includes/session.inc'); Modified: trunk/Z_ChangeStockCategory.php =================================================================== --- trunk/Z_ChangeStockCategory.php 2010-12-23 10:52:28 UTC (rev 4442) +++ trunk/Z_ChangeStockCategory.php 2010-12-23 15:30:30 UTC (rev 4443) @@ -1,7 +1,7 @@ <?php /* $Id$ */ -$PageSecurity = 15; +//$PageSecurity = 15; include ('includes/session.inc'); $title = _('UTILITY PAGE Change A Stock Category'); include ('includes/header.inc'); Modified: trunk/Z_CheckDebtorsControl.php =================================================================== --- trunk/Z_CheckDebtorsControl.php 2010-12-23 10:52:28 UTC (rev 4442) +++ trunk/Z_CheckDebtorsControl.php 2010-12-23 15:30:30 UTC (rev 4443) @@ -1,6 +1,6 @@ <?php /* $Id$*/ -$PageSecurity=15; +//$PageSecurity=15; include('includes/session.inc'); $title=_('Debtors Control Integrity'); Modified: trunk/Z_CheckGLTransBalance.php =================================================================== --- trunk/Z_CheckGLTransBalance.php 2010-12-23 10:52:28 UTC (rev 4442) +++ trunk/Z_CheckGLTransBalance.php 2010-12-23 15:30:30 UTC (rev 4443) @@ -1,6 +1,6 @@ <?php /* $Id$*/ -$PageSecurity=15; +//$PageSecurity=15; include('includes/session.inc'); $title=_('Check Period Sales Ledger Control Account'); Modified: trunk/Z_CurrencyDebtorsBalances.php =================================================================== --- trunk/Z_CurrencyDebtorsBalances.php 2010-12-23 10:52:28 UTC (rev 4442) +++ trunk/Z_CurrencyDebtorsBalances.php 2010-12-23 15:30:30 UTC (rev 4443) @@ -1,6 +1,6 @@ <?php /* $Id$*/ -$PageSecurity=15; +//$PageSecurity=15; include('includes/session.inc'); $title=_('Currency Debtor Balances'); Modified: trunk/Z_CurrencySuppliersBalances.php =================================================================== --- trunk/Z_CurrencySuppliersBalances.php 2010-12-23 10:52:28 UTC (rev 4442) +++ trunk/Z_CurrencySuppliersBalances.php 2010-12-23 15:30:30 UTC (rev 4443) @@ -1,6 +1,6 @@ <?php /* $Id$*/ -$PageSecurity=15; +//$PageSecurity=15; include('includes/session.inc'); $title=_('Currency Debtor Balances'); Modified: trunk/Z_ImportStocks.php =================================================================== --- trunk/Z_ImportStocks.php 2010-12-23 10:52:28 UTC (rev 4442) +++ trunk/Z_ImportStocks.php 2010-12-23 15:30:30 UTC (rev 4443) @@ -2,7 +2,7 @@ /* $Id: Z_ImportStocks.php 4043 2010-09-30 16:17:53Z tim_schofield $*/ /* Script to make stock locations for all parts that do not have stock location records set up*/ -$PageSecurity = 15; +//$PageSecurity = 15; include('includes/session.inc'); $title = _('Import Items'); include('includes/header.inc'); Modified: trunk/Z_PriceChanges.php =================================================================== --- trunk/Z_PriceChanges.php 2010-12-23 10:52:28 UTC (rev 4442) +++ trunk/Z_PriceChanges.php 2010-12-23 15:30:30 UTC (rev 4443) @@ -1,6 +1,6 @@ <?php /* $Id$*/ -$PageSecurity=15; +//$PageSecurity=15; include('includes/session.inc'); Modified: trunk/Z_Upgrade3.10.php =================================================================== --- trunk/Z_Upgrade3.10.php 2010-12-23 10:52:28 UTC (rev 4442) +++ trunk/Z_Upgrade3.10.php 2010-12-23 15:30:30 UTC (rev 4443) @@ -1,6 +1,6 @@ <?php /* $Id$*/ -$PageSecurity = 15; +//$PageSecurity = 15; include('includes/session.inc'); $title = _('Upgrade webERP to version 3.10.5'); include('includes/header.inc'); Modified: trunk/Z_Upgrade_3.05-3.06.php =================================================================== --- trunk/Z_Upgrade_3.05-3.06.php 2010-12-23 10:52:28 UTC (rev 4442) +++ trunk/Z_Upgrade_3.05-3.06.php 2010-12-23 15:30:30 UTC (rev 4443) @@ -1,6 +1,6 @@ <?php /* $Id$*/ -$PageSecurity = 15; +//$PageSecurity = 15; include('includes/session.inc'); $title = _('Upgrade webERP 3.06 - 3.07'); include('includes/header.inc'); Modified: trunk/Z_Upgrade_3.07-3.08.php =================================================================== --- trunk/Z_Upgrade_3.07-3.08.php 2010-12-23 10:52:28 UTC (rev 4442) +++ trunk/Z_Upgrade_3.07-3.08.php 2010-12-23 15:30:30 UTC (rev 4443) @@ -1,6 +1,6 @@ <?php /* $Id$*/ -$PageSecurity = 15; +//$PageSecurity = 15; include('includes/session.inc'); $title = _('Upgrade webERP 3.071 - 3.08'); include('includes/header.inc'); Modified: trunk/Z_Upgrade_3.08-3.09.php =================================================================== --- trunk/Z_Upgrade_3.08-3.09.php 2010-12-23 10:52:28 UTC (rev 4442) +++ trunk/Z_Upgrade_3.08-3.09.php 2010-12-23 15:30:30 UTC (rev 4443) @@ -1,6 +1,6 @@ <?php /* $Id$*/ -$PageSecurity = 15; +//$PageSecurity = 15; include('includes/session.inc'); $title = _('Upgrade webERP 3.08 - 3.09'); include('includes/header.inc'); Modified: trunk/Z_Upgrade_3.09-3.10.php =================================================================== --- trunk/Z_Upgrade_3.09-3.10.php 2010-12-23 10:52:28 UTC (rev 4442) +++ trunk/Z_Upgrade_3.09-3.10.php 2010-12-23 15:30:30 UTC (rev 4443) @@ -1,6 +1,6 @@ <?php /* $Id$*/ -$PageSecurity = 15; +//$PageSecurity = 15; include('includes/session.inc'); $title = _('Upgrade webERP 3.09 - 3.10'); include('includes/header.inc'); Modified: trunk/Z_Upgrade_3.10-3.11.php =================================================================== --- trunk/Z_Upgrade_3.10-3.11.php 2010-12-23 10:52:28 UTC (rev 4442) +++ trunk/Z_Upgrade_3.10-3.11.php 2010-12-23 15:30:30 UTC (rev 4443) @@ -1,6 +1,6 @@ <?php /* $Id$*/ -$PageSecurity = 15; +//$PageSecurity = 15; include('includes/session.inc'); $title = _('Upgrade webERP 3.10 - 3.11'); include('includes/header.inc'); Modified: trunk/Z_index.php =================================================================== --- trunk/Z_index.php 2010-12-23 10:52:28 UTC (rev 4442) +++ trunk/Z_index.php 2010-12-23 15:30:30 UTC (rev 4443) @@ -1,6 +1,6 @@ <?php /* $Id$*/ - $PageSecurity = 15; +// $PageSecurity = 15; include('includes/session.inc'); $title = _('Special Fixes and Utilities') . ' - ' . _('Only System Administrator'); Modified: trunk/geo_displaymap_customers.php =================================================================== --- trunk/geo_displaymap_customers.php 2010-12-23 10:52:28 UTC (rev 4442) +++ trunk/geo_displaymap_customers.php 2010-12-23 15:30:30 UTC (rev 4443) @@ -1,7 +1,7 @@ <?php /* $Id$*/ -$PageSecurity = 3; +//$PageSecurity = 3; $title = _('Geocoded Customer Branches Report'); include ('includes/session.inc'); Modified: trunk/geo_displaymap_suppliers.php =================================================================== --- trunk/geo_displaymap_suppliers.php 2010-12-23 10:52:28 UTC (rev 4442) +++ trunk/geo_displaymap_suppliers.php 2010-12-23 15:30:30 UTC (rev 4443) @@ -1,7 +1,7 @@ <?php /* $Id$*/ -$PageSecurity = 3; +//$PageSecurity = 3; $title = _('Geocoded Supplier Report'); include ('includes/session.inc'); Modified: trunk/geocode.php =================================================================== --- trunk/geocode.php 2010-12-23 10:52:28 UTC (rev 4442) +++ trunk/geocode.php 2010-12-23 15:30:30 UTC (rev 4443) @@ -1,7 +1,7 @@ <?php /* $Id$*/ -$PageSecurity = 3; +//$PageSecurity = 3; $title = _('Geocode Generate'); include ('includes/session.inc'); Modified: trunk/geocode_genxml_customers.php =================================================================== --- trunk/geocode_genxml_customers.php 2010-12-23 10:52:28 UTC (rev 4442) +++ trunk/geocode_genxml_customers.php 2010-12-23 15:30:30 UTC (rev 4443) @@ -1,21 +1,21 @@ <?php /* $Id$*/ -$PageSecurity = 3; +//$PageSecurity = 3; $title = _('Geocode Generate XML'); include ('includes/session.inc'); include('includes/SQL_CommonFunctions.inc'); -function parseToXML($htmlStr) -{ -$xmlStr=str_replace('<','<',$htmlStr); -$xmlStr=str_replace('>','>',$xmlStr); -$xmlStr=str_replace('"','"',$xmlStr); -$xmlStr=str_replace("'",''',$xmlStr); -$xmlStr=str_replace("&",'&',$xmlStr); -return $xmlStr; -} +function parseToXML($htmlStr) +{ +$xmlStr=str_replace('<','<',$htmlStr); +$xmlStr=str_replace('>','>',$xmlStr); +$xmlStr=str_replace('"','"',$xmlStr); +$xmlStr=str_replace("'",''',$xmlStr); +$xmlStr=str_replace("&",'&',$xmlStr); +return $xmlStr; +} $sql = "SELECT * FROM custbranch WHERE 1"; $ErrMsg = _('An error occurred in retrieving the information');; Modified: trunk/geocode_genxml_suppliers.php =================================================================== --- trunk/geocode_genxml_suppliers.php 2010-12-23 10:52:28 UTC (rev 4442) +++ trunk/geocode_genxml_suppliers.php 2010-12-23 15:30:30 UTC (rev 4443) @@ -1,21 +1,21 @@ <?php /* $Id$*/ -$PageSecurity = 3; +//$PageSecurity = 3; $title = _('Geocode Generate XML'); include ('includes/session.inc'); include('includes/SQL_CommonFunctions.inc'); -function parseToXML($htmlStr) -{ -$xmlStr=str_replace('<','<',$htmlStr); -$xmlStr=str_replace('>','>',$xmlStr); -$xmlStr=str_replace('"','"',$xmlStr); -$xmlStr=str_replace("'",''',$xmlStr); -$xmlStr=str_replace("&",'&',$xmlStr); -return $xmlStr; -} +function parseToXML($htmlStr) +{ +$xmlStr=str_replace('<','<',$htmlStr); +$xmlStr=str_replace('>','>',$xmlStr); +$xmlStr=str_replace('"','"',$xmlStr); +$xmlStr=str_replace("'",''',$xmlStr); +$xmlStr=str_replace("&",'&',$xmlStr); +return $xmlStr; +} $sql = "SELECT * FROM suppliers WHERE 1"; $ErrMsg = _('An error occurred in retrieving the information');; Modified: trunk/index.php =================================================================== --- trunk/index.php 2010-12-23 10:52:28 UTC (rev 4442) +++ trunk/index.php 2010-12-23 15:30:30 UTC (rev 4443) @@ -4,7 +4,7 @@ /* $Revision: 1.91 $ */ -$PageSecurity = 1; +//$PageSecurity = 1; include('includes/session.inc'); $title=_('Main Menu'); This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <dai...@us...> - 2010-12-26 08:33:35
|
Revision: 4447 http://web-erp.svn.sourceforge.net/web-erp/?rev=4447&view=rev Author: daintree Date: 2010-12-26 08:33:29 +0000 (Sun, 26 Dec 2010) Log Message: ----------- User login fix - SQL Modified Paths: -------------- trunk/Logout.php trunk/UpgradeDatabase.php trunk/UserSettings.php trunk/Z_ChangeBranchCode.php trunk/includes/GetConfig.php trunk/includes/UserLogin.php trunk/includes/class.pdf.php trunk/includes/session.inc trunk/sql/mysql/upgrade3.11.1-4.00.sql Modified: trunk/Logout.php =================================================================== --- trunk/Logout.php 2010-12-24 09:53:30 UTC (rev 4446) +++ trunk/Logout.php 2010-12-26 08:33:29 UTC (rev 4447) @@ -2,7 +2,7 @@ /* $Revision: 1.17 $ */ /* $Id$*/ //$PageSecurity =1; -$AllowAnyone=True; /* Allow all users to log off - needed for autoamted runs */ +$AllowAnyone=True; /* Allow all users to log off */ include('includes/session.inc'); Modified: trunk/UpgradeDatabase.php =================================================================== --- trunk/UpgradeDatabase.php 2010-12-24 09:53:30 UTC (rev 4446) +++ trunk/UpgradeDatabase.php 2010-12-26 08:33:29 UTC (rev 4447) @@ -6,7 +6,7 @@ $title = _('Database Upgrade'); -ob_start(); +//ob_start(); /*what is this for? */ include('includes/header.inc'); @@ -390,7 +390,7 @@ } else { $StartingUpdate=$_SESSION['DBUpdateNumber']+1; $EndingUpdate=$DBVersion; - ob_end_flush(); + //ob_end_flush(); echo '<table>'; for($UpdateNumber=$StartingUpdate; $UpdateNumber<=$EndingUpdate; $UpdateNumber++) { ob_start(); Modified: trunk/UserSettings.php =================================================================== --- trunk/UserSettings.php 2010-12-24 09:53:30 UTC (rev 4446) +++ trunk/UserSettings.php 2010-12-26 08:33:29 UTC (rev 4447) @@ -12,13 +12,8 @@ _('User Settings') . '" alt="" />' . ' ' . _('User Settings') . '</p>'; $PDFLanguages = array(_('Latin Western Languages'), - _('Eastern European Russian Japanese'), - _('Chinese'), - _('Korean'), - _('Vietnamese'), - _('Hebrew'), - _('Arabic'), - _('Thai')); + _('Eastern European Russian Japanese Korean Hebrew Arabic Thai'), + _('Chinese')); if (isset($_POST['Modify'])) { Modified: trunk/Z_ChangeBranchCode.php =================================================================== --- trunk/Z_ChangeBranchCode.php 2010-12-24 09:53:30 UTC (rev 4446) +++ trunk/Z_ChangeBranchCode.php 2010-12-26 08:33:29 UTC (rev 4447) @@ -37,7 +37,7 @@ /*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){ - prmMsg(_('The replacement customer branch code') . ': ' . $_POST['NewBranchCode'] . ' ' . _('already exists as a branch code for the same customer') . ' - ' . _('a unique branch code must be entered for the new code'),'error'); + prnMsg(_('The replacement customer branch code') . ': ' . $_POST['NewBranchCode'] . ' ' . _('already exists as a branch code for the same customer') . ' - ' . _('a unique branch code must be entered for the new code'),'error'); include('includes/footer.inc'); exit; } Modified: trunk/includes/GetConfig.php =================================================================== --- trunk/includes/GetConfig.php 2010-12-24 09:53:30 UTC (rev 4446) +++ trunk/includes/GetConfig.php 2010-12-26 08:33:29 UTC (rev 4447) @@ -5,8 +5,9 @@ if(isset($ForceConfigReload) and $ForceConfigReload==TRUE OR !isset($_SESSION['CompanyDefaultsLoaded'])) { global $db; // It is global, we may not be. - $sql = 'SELECT confname, confvalue FROM config'; // dont care about the order by - $ConfigResult = DB_query($sql,$db); + $sql = 'SELECT confname, confvalue FROM config'; + $ErrMsg = _('Could not get the configuration parameters from the database because'); + $ConfigResult = DB_query($sql,$db,$ErrMsg); while( $myrow = DB_fetch_row($ConfigResult) ) { if (is_numeric($myrow[1]) and $myrow[0]!='DefaultPriceList'){ //the variable name is given by $myrow[0] @@ -14,64 +15,60 @@ } else { $_SESSION[$myrow[0]] = $myrow[1]; } - } //end loop through all config variables $_SESSION['CompanyDefaultsLoaded'] = true; + if (!isset($_SESSION['DBUpdateNumber'])){ // the config record for DBUpdateNumber is not yet added + $_SESSION['DBUpdateNumber']=-1; + header('Location: UpgradeDatabase.php'); //divert to the db upgrade if the DBUpdateNumber is not in the config table + } + DB_free_result($ConfigResult); // no longer needed /*Maybe we should check config directories exist and try to create if not */ - $sql="SHOW tables WHERE Tables_in_".$_SESSION['DatabaseName']."='pagesecurity'"; - $result=DB_query($sql, $db); + $sql='SHOW tables WHERE Tables_in_'.$_SESSION['DatabaseName']."='pagesecurity'"; + $ErrMsg = _('Could not determine if the pagesecurity table is in the database'); + $result=DB_query($sql, $db,$ErrMsg); if (DB_num_rows($result)>0) { - $sql="SELECT script, security FROM pagesecurity"; + $sql='SELECT script, security FROM pagesecurity'; + $ErrMsg = _('Could not get the page security details from the database because'); $result=DB_query($sql, $db); - } else if (basename($_SERVER['SCRIPT_NAME'])!='UpgradeDatabase.php') { - header("Location: UpgradeDatabase.php"); + } else if (basename($_SERVER['SCRIPT_NAME'])!='UpgradeDatabase.php') { + header('Location: UpgradeDatabase.php'); //divert to upgrade database if the pagesecurity table does not exist } while ($myrow=DB_fetch_array($result)) { $_SESSION[$myrow['script']]=$myrow['security']; } - - $sql="SELECT confvalue FROM config WHERE confname='DBUpdateNumber'"; - $result=DB_query($sql, $db); - if (DB_num_rows($result)==0) { - $_SESSION['DBUpdateNumber']=-1; - } else { - $myrow=DB_fetch_array($result); - $_SESSION['DBUpdateNumber']=$myrow['confvalue']; - } - + /* Also reads all the company data set up in the company record and returns an array */ - $sql= 'SELECT - coyname, - gstno, - regoffice1, - regoffice2, - regoffice3, - regoffice4, - regoffice5, - regoffice6, - telephone, - fax, - email, - currencydefault, - debtorsact, - pytdiscountact, - creditorsact, - payrollact, - grnact, - exchangediffact, - purchasesexchangediffact, - retainedearnings, - freightact, - gllink_debtors, - gllink_creditors, - gllink_stock - FROM companies - WHERE coycode=1'; - + $sql= 'SELECT coyname, + gstno, + regoffice1, + regoffice2, + regoffice3, + regoffice4, + regoffice5, + regoffice6, + telephone, + fax, + email, + currencydefault, + debtorsact, + pytdiscountact, + creditorsact, + payrollact, + grnact, + exchangediffact, + purchasesexchangediffact, + retainedearnings, + freightact, + gllink_debtors, + gllink_creditors, + gllink_stock + FROM companies + WHERE coycode=1'; + $ErrMsg = _('An error occurred accessing the database to retrieve the company information'); $ReadCoyResult = DB_query($sql,$db,$ErrMsg); @@ -84,41 +81,32 @@ } } //end if force reload or not set already -$sql="SHOW tables WHERE Tables_in_".$_SESSION['DatabaseName']."='emailsettings'"; +$sql='SELECT id, + host, + port, + heloaddress, + username, + password, + timeout, + auth + FROM emailsettings'; $result=DB_query($sql, $db); -if (DB_num_rows($result)>0) { - $sql='SELECT id, - host, - port, - heloaddress, - username, - password, - timeout, - auth - FROM emailsettings'; - $result=DB_query($sql, $db); - $myrow=DB_fetch_array($result); +$myrow=DB_fetch_array($result); - $_SESSION['SMTPSettings']['host']=$myrow['host']; - $_SESSION['SMTPSettings']['port']=$myrow['port']; - $_SESSION['SMTPSettings']['heloaddress']=$myrow['heloaddress']; - $_SESSION['SMTPSettings']['username']=$myrow['username']; - $_SESSION['SMTPSettings']['password']=$myrow['password']; - $_SESSION['SMTPSettings']['timeout']=$myrow['timeout']; - $_SESSION['SMTPSettings']['auth']=$myrow['auth']; -} else if (basename($_SERVER['SCRIPT_NAME'])!='UpgradeDatabase.php') { - header("Location: UpgradeDatabase.php"); -} +$_SESSION['SMTPSettings']['host']=$myrow['host']; +$_SESSION['SMTPSettings']['port']=$myrow['port']; +$_SESSION['SMTPSettings']['heloaddress']=$myrow['heloaddress']; +$_SESSION['SMTPSettings']['username']=$myrow['username']; +$_SESSION['SMTPSettings']['password']=$myrow['password']; +$_SESSION['SMTPSettings']['timeout']=$myrow['timeout']; +$_SESSION['SMTPSettings']['auth']=$myrow['auth']; - /* +/* +These variable if required are in config.php - -Stay in config.php $DefaultLanguage = en_GB $allow_demo_mode = 1 - - $EDIHeaderMsgId = D:01B:UN:EAN010 $EDIReference = WEBERP $EDI_MsgPending = EDI_Pending Modified: trunk/includes/UserLogin.php =================================================================== --- trunk/includes/UserLogin.php 2010-12-24 09:53:30 UTC (rev 4446) +++ trunk/includes/UserLogin.php 2010-12-26 08:33:29 UTC (rev 4447) @@ -7,9 +7,8 @@ define('UL_NOTVALID', 1); /* User/password do not agree */ define('UL_BLOCKED', 2); /* Account locked, too many failed logins */ define('UL_CONFIGERR', 3); /* Configuration error in webERP or server */ -define('UL_SHOWLOGIN', 4); /* Can this happen? */ -// Following not in use at 18 Nov 09. -define('UL_MAINTENANCE', 5); /* Maintenance mode - no user logins */ +define('UL_SHOWLOGIN', 4); +define('UL_MAINTENANCE', 5); /* UserLogin * Function to validate user name, perform validity checks and initialise @@ -19,7 +18,9 @@ */ function userLogin($Name, $Password, $db) { - + + global $debug; + if (!isset($_SESSION['AccessLevel']) OR $_SESSION['AccessLevel'] == '' OR (isset($Name) AND $Name != '')) { /* if not logged in */ @@ -35,16 +36,32 @@ if (!isset($Name) or $Name == '') { return UL_SHOWLOGIN; } - $sql = "SELECT * + $sql = "SELECT customerid, +- lastvisitdate, +- pagesize, +- defaultlocation, +- branchcode, +- modulesallowed, +- blocked, +- realname, +- theme, +- displayrecordsmax, +- userid, +- language, +- salesman, +- pdflanguage, + fullaccess FROM www_users WHERE www_users.userid='" . $Name . "' AND (www_users.password='" . CryptPass($Password) . "' OR www_users.password='" . $Password . "')"; - $Auth_Result = DB_query($sql, $db); + $ErrMsg = _('Could not retrieve user details on login because'); + $debug =1; + $Auth_Result = DB_query($sql, $db,$ErrMsg); // Populate session variables with data base results if (DB_num_rows($Auth_Result) > 0) { $myrow = DB_fetch_array($Auth_Result); - if ($myrow[7]==1){ + if ($myrow['blocked']==1){ //the account is blocked return UL_BLOCKED; } @@ -64,7 +81,7 @@ if (isset($myrow['pdflanguage'])) { $_SESSION['PDFLanguage'] = $myrow['pdflanguage']; } else { - $_SESSION['PDFLanguage'] = ''; + $_SESSION['PDFLanguage'] = '0'; //default to latin western languages } if ($myrow[10] > 0) { @@ -73,12 +90,12 @@ $_SESSION['DisplayRecordsMax'] = $_SESSION['DefaultDisplayRecordsMax']; // default comes from config.php } $_SESSION['UserID'] = $myrow['userid']; - $sql = "UPDATE www_users SET lastvisitdate='". date("Y-m-d H:i:s") ."' - WHERE www_users.userid='" . $Name . "'"; + $sql = "UPDATE www_users SET lastvisitdate='". date('Y-m-d H:i:s') ."' + WHERE www_users.userid='" . $Name . "'"; $Auth_Result = DB_query($sql, $db); /*get the security tokens that the user has access to */ $sql = 'SELECT tokenid FROM securitygroups - WHERE secroleid = ' . $_SESSION['AccessLevel']; + WHERE secroleid = ' . $_SESSION['AccessLevel']; $Sec_Result = DB_query($sql, $db); $_SESSION['AllowedPageSecurityTokens'] = array(); if (DB_num_rows($Sec_Result)==0){ @@ -98,8 +115,8 @@ } elseif ($_SESSION['AttemptsCounter'] >= 5 AND isset($Name)) { /*User blocked from future accesses until sysadmin releases */ $sql = "UPDATE www_users - SET blocked=1 - WHERE www_users.userid='" . $Name . "'"; + SET blocked=1 + WHERE www_users.userid='" . $Name . "'"; $Auth_Result = DB_query($sql, $db); return UL_BLOCKED; } Modified: trunk/includes/class.pdf.php =================================================================== --- trunk/includes/class.pdf.php 2010-12-24 09:53:30 UTC (rev 4446) +++ trunk/includes/class.pdf.php 2010-12-26 08:33:29 UTC (rev 4447) @@ -36,24 +36,19 @@ if (isset($_SESSION['PDFLanguage'])) { - $userpdflang = $_SESSION['PDFLanguage']; + $UserPdfLang = $_SESSION['PDFLanguage']; - switch ($userpdflang) { - case 0: $userpdffont = 'times'; break; - case 1: $userpdffont = 'javierjp'; break; - case 2: $userpdffont = 'javiergb'; break; - case 3: $userpdffont = 'javierjp'; break; - case 4: $userpdffont = 'javierjp'; break; - case 5: $userpdffont = 'javierjp'; break; - case 6: $userpdffont = 'javierjp'; break; - case 7: $userpdffont = 'javierjp'; break; + switch ($UserPdfLang) { + case 0: $UserPdfFont = 'times'; break; + case 1: $UserPdfFont = 'javierjp'; break; + case 2: $UserPdfFont = 'javiergb'; break; } } else { - $userpdffont = 'helvetica'; + $UserPdfFont = 'helvetica'; } - $this->SetFont($userpdffont, '', 11); + $this->SetFont($UserPdfFont, '', 11); // SetFont($family, $style='', $size=0, $fontfile='') } Modified: trunk/includes/session.inc =================================================================== --- trunk/includes/session.inc 2010-12-24 09:53:30 UTC (rev 4446) +++ trunk/includes/session.inc 2010-12-26 08:33:29 UTC (rev 4447) @@ -4,6 +4,7 @@ if (!isset($PathPrefix)) { $PathPrefix=''; } + if (!file_exists($PathPrefix . 'config.php')){ $rootpath = dirname($_SERVER['PHP_SELF']); if ($rootpath == '/' OR $rootpath == "\\") { @@ -110,13 +111,14 @@ } } /* only do security checks if AllowAnyone is not true */ + /*User is logged in so get configuration parameters - save in session*/ include($PathPrefix . 'includes/GetConfig.php'); if (isset($_SESSION[basename($_SERVER['SCRIPT_NAME'])])) { $PageSecurity = $_SESSION[basename($_SERVER['SCRIPT_NAME'])]; } - + if (($DBVersion>$_SESSION['DBUpdateNumber']) and (basename($_SERVER['SCRIPT_NAME'])!='UpgradeDatabase.php')) { header("Location: UpgradeDatabase.php"); } @@ -264,7 +266,12 @@ } else { $SupplierLogin=0; } +/* Nasty kludge to allow Supplier only logins as well as Customer logins - .... hmmmmm */ +if ($SupplierLogin==1) { + $_SESSION['AllowedPageSecurityTokens'][0]=9; +} + if (!isset($AllowAnyone)){ if ((!in_array($PageSecurity, $_SESSION['AllowedPageSecurityTokens']) OR !isset($PageSecurity))) { $title = _('Security Permissions Problem'); @@ -276,24 +283,20 @@ echo '<b><font style="size:+1; text-align:center;">' . _('The security settings on your account do not permit you to access this function') . '</font></b>'; echo '</td> - </tr> - </table> - </td>'; - + </tr> + </table> + </td>'; + include($PathPrefix . 'includes/footer.inc'); exit; } } -/* Nasty kludge to allow Supplier only logins as well as Customer logins */ -if ($SupplierLogin==1) { - $_SESSION['AllowedPageSecurityTokens'][0]=9; -} -if (in_array(15, $_SESSION['AllowedPageSecurityTokens'])) { - $debug = 1; +if (in_array(15, $_SESSION['AllowedPageSecurityTokens'])) { /*System administrator login */ + $debug = 1; //allow debug messages } else { - $debug = 0; + $debug = 0; //don't allow debug messages } function CryptPass( $Password ) { global $CryptFunction; Modified: trunk/sql/mysql/upgrade3.11.1-4.00.sql =================================================================== --- trunk/sql/mysql/upgrade3.11.1-4.00.sql 2010-12-24 09:53:30 UTC (rev 4446) +++ trunk/sql/mysql/upgrade3.11.1-4.00.sql 2010-12-26 08:33:29 UTC (rev 4447) @@ -474,5 +474,6 @@ ALTER TABLE purchorderdetails ADD COLUMN assetid int NOT NULL DEFAULT 0; INSERT INTO `systypes` (`typeid` ,`typename` ,`typeno`) VALUES ('49', 'Import Fixed Assets', '1'); +ALTER TABLE `debtortrans` DROP FOREIGN KEY `debtortrans_ibfk_1` UPDATE config SET confvalue='4.0-RC2' WHERE confname='VersionName'; \ No newline at end of file This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <tim...@us...> - 2010-12-26 12:28:53
|
Revision: 4448 http://web-erp.svn.sourceforge.net/web-erp/?rev=4448&view=rev Author: tim_schofield Date: 2010-12-26 12:28:47 +0000 (Sun, 26 Dec 2010) Log Message: ----------- Add new database upgrade. Removes constraint from debtortrans Modified Paths: -------------- trunk/includes/session.inc Added Paths: ----------- trunk/sql/mysql/updates/53.php Modified: trunk/includes/session.inc =================================================================== --- trunk/includes/session.inc 2010-12-26 08:33:29 UTC (rev 4447) +++ trunk/includes/session.inc 2010-12-26 12:28:47 UTC (rev 4448) @@ -13,7 +13,7 @@ header('Location:' . $rootpath . '/install/index.php'); } include($PathPrefix . 'config.php'); -$DBVersion=52; +$DBVersion=53; if (isset($SessionSavePath)){ session_save_path($SessionSavePath); } @@ -118,7 +118,7 @@ if (isset($_SESSION[basename($_SERVER['SCRIPT_NAME'])])) { $PageSecurity = $_SESSION[basename($_SERVER['SCRIPT_NAME'])]; } - + if (($DBVersion>$_SESSION['DBUpdateNumber']) and (basename($_SERVER['SCRIPT_NAME'])!='UpgradeDatabase.php')) { header("Location: UpgradeDatabase.php"); } @@ -286,7 +286,7 @@ </tr> </table> </td>'; - + include($PathPrefix . 'includes/footer.inc'); exit; } Added: trunk/sql/mysql/updates/53.php =================================================================== --- trunk/sql/mysql/updates/53.php (rev 0) +++ trunk/sql/mysql/updates/53.php 2010-12-26 12:28:47 UTC (rev 4448) @@ -0,0 +1,10 @@ +<?php + +/* Remove foreign key from debtortrans table + */ + +DropConstraint('debtortrans', 'debtortrans_ibfk_1', $db); + +UpdateDBNo(53, $db); + +?> \ 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...> - 2010-12-27 04:58:58
|
Revision: 4451 http://web-erp.svn.sourceforge.net/web-erp/?rev=4451&view=rev Author: daintree Date: 2010-12-27 04:58:50 +0000 (Mon, 27 Dec 2010) Log Message: ----------- modified Z_ChangeBranchCode.php to defeat foreign key checks when deleting the branch code from custbranch Modified Paths: -------------- trunk/Z_ChangeBranchCode.php trunk/includes/ConnectDB_mysqli.inc trunk/sql/mysql/upgrade3.11.1-4.00.sql Modified: trunk/Z_ChangeBranchCode.php =================================================================== --- trunk/Z_ChangeBranchCode.php 2010-12-26 12:45:46 UTC (rev 4450) +++ trunk/Z_ChangeBranchCode.php 2010-12-27 04:58:50 UTC (rev 4451) @@ -11,10 +11,10 @@ /*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'); @@ -189,7 +189,7 @@ AND branchcode='" . $_POST['OldBranchCode'] . "'"; $ErrMsg = _('The SQL to delete the old customer branch record failed because'); - $result = DB_query($sql,$db,$ErrMsg,$DbgMsg,true); + $result = DB_query($sql,$db,$ErrMsg,$DbgMsg,true,true); } Modified: trunk/includes/ConnectDB_mysqli.inc =================================================================== --- trunk/includes/ConnectDB_mysqli.inc 2010-12-26 12:45:46 UTC (rev 4450) +++ trunk/includes/ConnectDB_mysqli.inc 2010-12-27 04:58:50 UTC (rev 4451) @@ -65,7 +65,8 @@ $ErrorMessage='', $DebugMessage= '', $Transaction=false, - $TrapErrors=true){ + $TrapErrors=true, + $IgnoreForeignKeys=false){ global $debug; global $PathPrefix; @@ -74,6 +75,10 @@ 20071102 Change from mysql to mysqli; $result=mysql_query($SQL,$Conn); */ + + if ($IgnoreForeignKeys) { + $SQL = 'SET FOREIGN_KEY_CHECKS=0; ' . $SQL . ' SET FOREIGN_KEY_CHECKS=1;'; + } $result=mysqli_query($Conn, $SQL); $_SESSION['LastInsertId'] = mysqli_insert_id($Conn); Modified: trunk/sql/mysql/upgrade3.11.1-4.00.sql =================================================================== --- trunk/sql/mysql/upgrade3.11.1-4.00.sql 2010-12-26 12:45:46 UTC (rev 4450) +++ trunk/sql/mysql/upgrade3.11.1-4.00.sql 2010-12-27 04:58:50 UTC (rev 4451) @@ -474,6 +474,5 @@ ALTER TABLE purchorderdetails ADD COLUMN assetid int NOT NULL DEFAULT 0; INSERT INTO `systypes` (`typeid` ,`typename` ,`typeno`) VALUES ('49', 'Import Fixed Assets', '1'); -ALTER TABLE `debtortrans` DROP FOREIGN KEY `debtortrans_ibfk_1` UPDATE config SET confvalue='4.0-RC2' WHERE confname='VersionName'; \ No newline at end of file This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <tim...@us...> - 2010-12-27 11:34:05
|
Revision: 4453 http://web-erp.svn.sourceforge.net/web-erp/?rev=4453&view=rev Author: tim_schofield Date: 2010-12-27 11:33:59 +0000 (Mon, 27 Dec 2010) Log Message: ----------- Re-apply code wrongly removed, to make the databse upgrade system work properly. Please leave unless you have something better. Modified Paths: -------------- trunk/UpgradeDatabase.php trunk/includes/GetConfig.php trunk/includes/UserLogin.php Modified: trunk/UpgradeDatabase.php =================================================================== --- trunk/UpgradeDatabase.php 2010-12-27 07:30:17 UTC (rev 4452) +++ trunk/UpgradeDatabase.php 2010-12-27 11:33:59 UTC (rev 4453) @@ -1,6 +1,6 @@ <?php -//$PageSecurity = 15; +$PageSecurity = 15; include('includes/session.inc'); Modified: trunk/includes/GetConfig.php =================================================================== --- trunk/includes/GetConfig.php 2010-12-27 07:30:17 UTC (rev 4452) +++ trunk/includes/GetConfig.php 2010-12-27 11:33:59 UTC (rev 4453) @@ -5,7 +5,7 @@ if(isset($ForceConfigReload) and $ForceConfigReload==TRUE OR !isset($_SESSION['CompanyDefaultsLoaded'])) { global $db; // It is global, we may not be. - $sql = 'SELECT confname, confvalue FROM config'; + $sql = 'SELECT confname, confvalue FROM config'; $ErrMsg = _('Could not get the configuration parameters from the database because'); $ConfigResult = DB_query($sql,$db,$ErrMsg); while( $myrow = DB_fetch_row($ConfigResult) ) { @@ -21,7 +21,7 @@ $_SESSION['DBUpdateNumber']=-1; header('Location: UpgradeDatabase.php'); //divert to the db upgrade if the DBUpdateNumber is not in the config table } - + DB_free_result($ConfigResult); // no longer needed /*Maybe we should check config directories exist and try to create if not */ @@ -32,14 +32,21 @@ $sql='SELECT script, security FROM pagesecurity'; $ErrMsg = _('Could not get the page security details from the database because'); $result=DB_query($sql, $db); - } else if (basename($_SERVER['SCRIPT_NAME'])!='UpgradeDatabase.php') { + } else if (basename($_SERVER['SCRIPT_NAME'])!='UpgradeDatabase.php') { header('Location: UpgradeDatabase.php'); //divert to upgrade database if the pagesecurity table does not exist } while ($myrow=DB_fetch_array($result)) { $_SESSION[$myrow['script']]=$myrow['security']; } - + $sql="SELECT confvalue FROM config WHERE confname='DBUpdateNumber'"; + $result=DB_query($sql, $db); + if (DB_num_rows($result)==0) { + $_SESSION['DBUpdateNumber']=-1; + } else { + $myrow=DB_fetch_array($result); + $_SESSION['DBUpdateNumber']=$myrow['confvalue']; + } /* Also reads all the company data set up in the company record and returns an array */ $sql= 'SELECT coyname, @@ -68,7 +75,7 @@ gllink_stock FROM companies WHERE coycode=1'; - + $ErrMsg = _('An error occurred accessing the database to retrieve the company information'); $ReadCoyResult = DB_query($sql,$db,$ErrMsg); @@ -81,26 +88,31 @@ } } //end if force reload or not set already -$sql='SELECT id, - host, - port, - heloaddress, - username, - password, - timeout, - auth - FROM emailsettings'; +$sql="SHOW tables WHERE Tables_in_".$_SESSION['DatabaseName']."='emailsettings'"; $result=DB_query($sql, $db); -$myrow=DB_fetch_array($result); +if (DB_num_rows($result)>0) { + $sql='SELECT id, + host, + port, + heloaddress, + username, + password, + timeout, + auth + FROM emailsettings'; + $result=DB_query($sql, $db); + $myrow=DB_fetch_array($result); -$_SESSION['SMTPSettings']['host']=$myrow['host']; -$_SESSION['SMTPSettings']['port']=$myrow['port']; -$_SESSION['SMTPSettings']['heloaddress']=$myrow['heloaddress']; -$_SESSION['SMTPSettings']['username']=$myrow['username']; -$_SESSION['SMTPSettings']['password']=$myrow['password']; -$_SESSION['SMTPSettings']['timeout']=$myrow['timeout']; -$_SESSION['SMTPSettings']['auth']=$myrow['auth']; - + $_SESSION['SMTPSettings']['host']=$myrow['host']; + $_SESSION['SMTPSettings']['port']=$myrow['port']; + $_SESSION['SMTPSettings']['heloaddress']=$myrow['heloaddress']; + $_SESSION['SMTPSettings']['username']=$myrow['username']; + $_SESSION['SMTPSettings']['password']=$myrow['password']; + $_SESSION['SMTPSettings']['timeout']=$myrow['timeout']; + $_SESSION['SMTPSettings']['auth']=$myrow['auth']; +} else if (basename($_SERVER['SCRIPT_NAME'])!='UpgradeDatabase.php') { + header("Location: UpgradeDatabase.php"); +} /* These variable if required are in config.php Modified: trunk/includes/UserLogin.php =================================================================== --- trunk/includes/UserLogin.php 2010-12-27 07:30:17 UTC (rev 4452) +++ trunk/includes/UserLogin.php 2010-12-27 11:33:59 UTC (rev 4453) @@ -36,21 +36,7 @@ if (!isset($Name) or $Name == '') { return UL_SHOWLOGIN; } - $sql = "SELECT customerid, - lastvisitdate, - pagesize, - defaultlocation, - branchcode, - modulesallowed, - blocked, - realname, - theme, - displayrecordsmax, - userid, - language, - salesman, - pdflanguage, - fullaccess + $sql = "SELECT * FROM www_users WHERE www_users.userid='" . $Name . "' AND (www_users.password='" . CryptPass($Password) . "' This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <dai...@us...> - 2010-12-29 09:54:03
|
Revision: 4454 http://web-erp.svn.sourceforge.net/web-erp/?rev=4454&view=rev Author: daintree Date: 2010-12-29 09:53:54 +0000 (Wed, 29 Dec 2010) Log Message: ----------- upgrade script modification to use single script between version in plain ol SQL Modified Paths: -------------- trunk/InventoryPlanning.php trunk/InventoryQuantities.php trunk/InventoryValuation.php trunk/ReorderLevel.php trunk/ReorderLevelLocation.php trunk/SelectProduct.php trunk/UpgradeDatabase.php trunk/Z_ChangeBranchCode.php trunk/config.distrib.php trunk/doc/Change.log.html trunk/includes/ConnectDB.inc trunk/includes/ConnectDB_mysql.inc trunk/includes/ConnectDB_mysqli.inc trunk/includes/GetConfig.php trunk/includes/session.inc trunk/sql/mysql/upgrade3.11.1-4.00.sql Removed Paths: ------------- trunk/sql/mysql/updates/ Modified: trunk/InventoryPlanning.php =================================================================== --- trunk/InventoryPlanning.php 2010-12-27 11:33:59 UTC (rev 4453) +++ trunk/InventoryPlanning.php 2010-12-29 09:53:54 UTC (rev 4454) @@ -53,26 +53,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, @@ -261,34 +261,24 @@ } if ($_POST['Location']=='All'){ - $SQL = "SELECT SUM(purchorderdetails.quantityord*(CASE WHEN purchdata.conversionfactor IS NULL THEN 1 ELSE purchdata.conversionfactor END) - - purchorderdetails.quantityrecd*(CASE WHEN purchdata.conversionfactor IS NULL THEN 1 ELSE purchdata.conversionfactor END)) as qtyonorder - FROM purchorderdetails - LEFT JOIN purchorders - ON purchorderdetails.orderno = purchorders.orderno - LEFT JOIN purchdata - ON purchorders.supplierno=purchdata.supplierno - AND purchorderdetails.itemcode=purchdata.stockid - WHERE purchorderdetails.itemcode = '" . $InventoryPlan['stockid'] . "' - AND purchorderdetails.completed = 0 - AND purchorders.status <> 'Cancelled' - AND purchorders.status <> 'Rejected' - AND purchorders.status <> 'Pending'"; + $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'"; } else { - $SQL = "SELECT SUM(purchorderdetails.quantityord*(CASE WHEN purchdata.conversionfactor IS NULL THEN 1 ELSE purchdata.conversionfactor END) - - purchorderdetails.quantityrecd*(CASE WHEN purchdata.conversionfactor IS NULL THEN 1 ELSE purchdata.conversionfactor END)) as qtyonorder - FROM purchorderdetails - LEFT JOIN purchorders - ON purchorderdetails.orderno = purchorders.orderno - LEFT JOIN purchdata - ON purchorders.supplierno=purchdata.supplierno - AND purchorderdetails.itemcode=purchdata.stockid - WHERE purchorderdetails.itemcode = '" . $InventoryPlan['stockid'] . "' - AND purchorderdetails.completed = 0 - AND purchorders.intostocklocation= '" . $_POST['Location'] . "' - AND purchorders.status <> 'Cancelled' - AND purchorders.status <> 'Rejected' - AND purchorders.status <> 'Pending'"; + $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.intostocklocation= '" . $_POST['Location'] . "' + AND purchorders.status <> 'Cancelled' + AND purchorders.status <> 'Rejected' + AND purchorders.status <> 'Pending'"; } $DemandRow = DB_fetch_array($DemandResult); @@ -300,9 +290,9 @@ $title = _('Inventory Planning') . ' - ' . _('Problem Report') . '....'; include('includes/header.inc'); prnMsg( _('The purchase order 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?' . SID . "'>" . _('Back to the menu') . '</a>'; if ($debug==1){ - echo "<br />$SQL"; + echo '<br />' . $SQL; } include('includes/footer.inc'); exit; Modified: trunk/InventoryQuantities.php =================================================================== --- trunk/InventoryQuantities.php 2010-12-27 11:33:59 UTC (rev 4453) +++ trunk/InventoryQuantities.php 2010-12-29 09:53:54 UTC (rev 4454) @@ -18,14 +18,14 @@ $line_height=12; $Xpos = $Left_Margin+1; - $wherecategory = " "; - $catdescription = " "; + $WhereCategory = " "; + $CatDescription = " "; if ($_POST['StockCat'] != 'All') { - $wherecategory = " AND stockmaster.categoryid='" . $_POST['StockCat'] . "' AND stockcategory.stocktype<>'A'"; + $WhereCategory = " AND stockmaster.categoryid='" . $_POST['StockCat'] . "'"; $sql= "SELECT categoryid, categorydescription FROM stockcategory WHERE categoryid='" . $_POST['StockCat'] . "' "; $result = DB_query($sql,$db); $myrow = DB_fetch_row($result); - $catdescription = $myrow[1]; + $CatDescription = $myrow[1]; } if ($_POST['Selection'] == 'All') { @@ -47,7 +47,7 @@ AND locstock.loccode=locations.loccode AND locstock.quantity <> 0 AND (stockmaster.mbflag='B' OR stockmaster.mbflag='M') " . - $wherecategory . " ORDER BY locstock.stockid,locstock.loccode"; + $WhereCategory . " ORDER BY locstock.stockid,locstock.loccode"; } else { // sql to only select parts in more than one location // The SELECT statement at the beginning of the WHERE clause limits the selection to @@ -73,7 +73,7 @@ AND locstock.loccode=locations.loccode AND locstock.quantity <> 0 AND (stockmaster.mbflag='B' OR stockmaster.mbflag='M') " . - $wherecategory . " ORDER BY locstock.stockid,locstock.loccode"; + $WhereCategory . " ORDER BY locstock.stockid,locstock.loccode"; } @@ -100,7 +100,7 @@ } PrintHeader($pdf,$YPos,$PageNumber,$Page_Height,$Top_Margin,$Left_Margin, - $Page_Width,$Right_Margin,$catdescription); + $Page_Width,$Right_Margin,$CatDescription); $FontSize=8; @@ -128,13 +128,13 @@ if ($YPos < $Bottom_Margin + $line_height){ PrintHeader($pdf,$YPos,$PageNumber,$Page_Height,$Top_Margin,$Left_Margin,$Page_Width, - $Right_Margin,$catdescription); + $Right_Margin,$CatDescription); } } /*end while loop */ if ($YPos < $Bottom_Margin + $line_height){ PrintHeader($pdf,$YPos,$PageNumber,$Page_Height,$Top_Margin,$Left_Margin,$Page_Width, - $Right_Margin,$catdescription); + $Right_Margin,$CatDescription); } /*Print out the grand totals */ @@ -192,7 +192,7 @@ } /*end of else not PrintPDF */ function PrintHeader(&$pdf,&$YPos,&$PageNumber,$Page_Height,$Top_Margin,$Left_Margin, - $Page_Width,$Right_Margin,$catdescription) { + $Page_Width,$Right_Margin,$CatDescription) { /*PDF page header for Reorder Level report */ if ($PageNumber>1){ @@ -212,7 +212,7 @@ $YPos -= $line_height; $pdf->addTextWrap($Left_Margin,$YPos,50,$FontSize,_('Category')); $pdf->addTextWrap(95,$YPos,50,$FontSize,$_POST['StockCat']); - $pdf->addTextWrap(160,$YPos,150,$FontSize,$catdescription,'left'); + $pdf->addTextWrap(160,$YPos,150,$FontSize,$CatDescription,'left'); $YPos -=(2*$line_height); /*set up the headings */ Modified: trunk/InventoryValuation.php =================================================================== --- trunk/InventoryValuation.php 2010-12-27 11:33:59 UTC (rev 4453) +++ trunk/InventoryValuation.php 2010-12-29 09:53:54 UTC (rev 4454) @@ -35,7 +35,6 @@ locstock WHERE stockmaster.stockid=locstock.stockid AND stockmaster.categoryid=stockcategory.categoryid - AND stockcategory.stocktype<>'A' GROUP BY stockmaster.categoryid, stockcategory.categorydescription, unitcost, @@ -68,7 +67,6 @@ AND stockmaster.categoryid >= '" . $_POST['FromCriteria'] . "' AND stockmaster.categoryid <= '" . $_POST['ToCriteria'] . "' AND locstock.loccode = '" . $_POST['Location'] . "' - AND stockcategory.stocktype<>'A' ORDER BY stockmaster.categoryid, stockmaster.stockid"; } Modified: trunk/ReorderLevel.php =================================================================== --- trunk/ReorderLevel.php 2010-12-27 11:33:59 UTC (rev 4453) +++ trunk/ReorderLevel.php 2010-12-29 09:53:54 UTC (rev 4454) @@ -21,8 +21,8 @@ $wherecategory = " "; $catdescription = " "; if ($_POST['StockCat'] != 'All') { - $wherecategory = " AND stockmaster.categoryid='" . $_POST['StockCat'] . "' AND stockcategory.stocktype<>'A'"; - $sql= "SELECT categoryid, categorydescription FROM stockcategory WHERE categoryid='" . $_POST['StockCat'] . "' "; + $wherecategory = " AND stockmaster.categoryid='" . $_POST['StockCat'] . "'"; + $sql= "SELECT categoryid, categorydescription FROM stockcategory WHERE categoryid='" . $_POST['StockCat'] . "'"; $result = DB_query($sql,$db); $myrow = DB_fetch_row($result); $catdescription = $myrow[1]; @@ -33,25 +33,25 @@ } $sql = "SELECT locstock.stockid, - stockmaster.description, - locstock.loccode, - locations.locationname, - locstock.quantity, - locstock.reorderlevel, - stockmaster.decimalplaces, - stockmaster.serialised, - stockmaster.controlled - FROM locstock, - stockmaster - LEFT JOIN stockcategory - ON stockmaster.categoryid=stockcategory.categoryid, - locations - WHERE locstock.stockid=stockmaster.stockid " . - $wherelocation . - "AND locstock.loccode=locations.loccode - AND locstock.reorderlevel > locstock.quantity - AND (stockmaster.mbflag='B' OR stockmaster.mbflag='M') " . - $wherecategory . " ORDER BY locstock.loccode,locstock.stockid"; + stockmaster.description, + locstock.loccode, + locations.locationname, + locstock.quantity, + locstock.reorderlevel, + stockmaster.decimalplaces, + stockmaster.serialised, + stockmaster.controlled + FROM locstock, + stockmaster + LEFT JOIN stockcategory + ON stockmaster.categoryid=stockcategory.categoryid, + locations + WHERE locstock.stockid=stockmaster.stockid " . + $wherelocation . + "AND locstock.loccode=locations.loccode + AND locstock.reorderlevel > locstock.quantity + AND (stockmaster.mbflag='B' OR stockmaster.mbflag='M') " . + $wherecategory . " ORDER BY locstock.loccode,locstock.stockid"; $result = DB_query($sql,$db,'','',false,true); Modified: trunk/ReorderLevelLocation.php =================================================================== --- trunk/ReorderLevelLocation.php 2010-12-27 11:33:59 UTC (rev 4453) +++ trunk/ReorderLevelLocation.php 2010-12-29 09:53:54 UTC (rev 4454) @@ -3,7 +3,7 @@ /* $Id$*/ // ReorderLevelLocation.php - Report of reorder level by category -//$PageSecurity = 2; +//$PageSecurity = 2; now comes from DB include('includes/session.inc'); @@ -181,14 +181,13 @@ echo '</select></td></tr>'; $SQL="SELECT categoryid, categorydescription - FROM stockcategory - WHERE stocktype<>'A' - ORDER BY categorydescription"; + FROM stockcategory + ORDER BY categorydescription"; $result1 = DB_query($SQL,$db); echo '<tr><td>' . _('Category') . ':</td> - <td><select name="StockCat">'; + <td><select name="StockCat">'; while ($myrow1 = DB_fetch_array($result1)) { echo '<option value="' . $myrow1['categoryid'] . '">' . $myrow1['categorydescription']; Modified: trunk/SelectProduct.php =================================================================== --- trunk/SelectProduct.php 2010-12-27 11:33:59 UTC (rev 4453) +++ trunk/SelectProduct.php 2010-12-29 09:53:54 UTC (rev 4454) @@ -29,10 +29,9 @@ } // Always show the search facilities $SQL = "SELECT categoryid, - categorydescription - FROM stockcategory - WHERE stocktype<>'A' - ORDER BY categorydescription"; + categorydescription + FROM stockcategory + ORDER BY categorydescription"; $result1 = DB_query($SQL, $db); if (DB_num_rows($result1) == 0) { echo '<p><font size=4 color=red>' . _('Problem Report') . ':</font><br />' . _('There are no stock categories currently defined please use the link below to set them up').'</p>'; @@ -50,20 +49,20 @@ $StockID = $_SESSION['SelectedStockItem']; } $result = DB_query("SELECT stockmaster.description, - stockmaster.mbflag, - stockcategory.stocktype, - stockmaster.units, - stockmaster.decimalplaces, - stockmaster.controlled, - stockmaster.serialised, - stockmaster.materialcost+stockmaster.labourcost+stockmaster.overheadcost AS cost, - stockmaster.discontinued, - stockmaster.eoq, - stockmaster.volume, - stockmaster.kgs - FROM stockmaster INNER JOIN stockcategory - ON stockmaster.categoryid=stockcategory.categoryid - WHERE stockid='" . $StockID . "'", $db); + stockmaster.mbflag, + stockcategory.stocktype, + stockmaster.units, + stockmaster.decimalplaces, + stockmaster.controlled, + stockmaster.serialised, + stockmaster.materialcost+stockmaster.labourcost+stockmaster.overheadcost AS cost, + stockmaster.discontinued, + stockmaster.eoq, + stockmaster.volume, + stockmaster.kgs + FROM stockmaster INNER JOIN stockcategory + ON stockmaster.categoryid=stockcategory.categoryid + WHERE stockid='" . $StockID . "'", $db); $myrow = DB_fetch_array($result); $Its_A_Kitset_Assembly_Or_Dummy = false; $Its_A_Dummy = false; @@ -113,20 +112,19 @@ if (in_array($PricesSecurity, $_SESSION['AllowedPageSecurityTokens']) OR !isset($PricesSecurity)) { echo '<tr><th colspan="2">' . _('Sell Price') . ':</th><td class="select">'; $PriceResult = DB_query("SELECT typeabbrev, price FROM prices - WHERE currabrev ='" . $_SESSION['CompanyRecord']['currencydefault'] . "' - AND typeabbrev = '" . $_SESSION['DefaultPriceList'] . "' - AND debtorno='' - AND branchcode='' - AND stockid='" . $StockID . "'", $db); + WHERE currabrev ='" . $_SESSION['CompanyRecord']['currencydefault'] . "' + AND typeabbrev = '" . $_SESSION['DefaultPriceList'] . "' + AND debtorno='' + AND branchcode='' + AND stockid='" . $StockID . "'", $db); if ($myrow['mbflag'] == 'K' OR $myrow['mbflag'] == 'A') { - $CostResult = DB_query("SELECT SUM(bom.quantity* - (stockmaster.materialcost+stockmaster.labourcost+stockmaster.overheadcost)) AS cost - FROM bom INNER JOIN - stockmaster - ON bom.component=stockmaster.stockid - WHERE bom.parent='" . $StockID . "' - AND bom.effectiveto > '" . Date("Y-m-d") . "' - AND bom.effectiveafter < '" . Date("Y-m-d") . "'", $db); + $CostResult = DB_query("SELECT SUM(bom.quantity * (stockmaster.materialcost+stockmaster.labourcost+stockmaster.overheadcost)) AS cost + FROM bom INNER JOIN + stockmaster + ON bom.component=stockmaster.stockid + WHERE bom.parent='" . $StockID . "' + AND bom.effectiveto > '" . Date('Y-m-d') . "' + AND bom.effectiveafter < '" . Date('Y-m-d') . "'", $db); $CostRow = DB_fetch_row($CostResult); $Cost = $CostRow[0]; } else { @@ -160,14 +158,13 @@ } } if ($myrow['mbflag'] == 'K' OR $myrow['mbflag'] == 'A') { - $CostResult = DB_query("SELECT SUM(bom.quantity* - (stockmaster.materialcost+stockmaster.labourcost+stockmaster.overheadcost)) AS cost - FROM bom INNER JOIN - stockmaster - ON bom.component=stockmaster.stockid - WHERE bom.parent='" . $StockID . "' - AND bom.effectiveto > '" . Date("Y-m-d") . "' - AND bom.effectiveafter < '" . Date("Y-m-d") . "'", $db); + $CostResult = DB_query("SELECT SUM(bom.quantity * (stockmaster.materialcost+stockmaster.labourcost+stockmaster.overheadcost)) AS cost + FROM bom INNER JOIN + stockmaster + ON bom.component=stockmaster.stockid + WHERE bom.parent='" . $StockID . "' + AND bom.effectiveto > '" . Date('Y-m-d') . "' + AND bom.effectiveafter < '" . Date('Y-m-d') . "'", $db); $CostRow = DB_fetch_row($CostResult); $Cost = $CostRow[0]; } else { @@ -179,26 +176,26 @@ // Item Category Property mod: display the item properties echo '<table align="left">'; $CatValResult = DB_query("SELECT categoryid - FROM stockmaster - WHERE stockid='" . $StockID . "'", $db); + FROM stockmaster + WHERE stockid='" . $StockID . "'", $db); $CatValRow = DB_fetch_row($CatValResult); $CatValue = $CatValRow[0]; $sql = "SELECT stkcatpropid, - label, - controltype, - defaultvalue - FROM stockcatproperties - WHERE categoryid ='" . $CatValue . "' - AND reqatsalesorder =0 - ORDER BY stkcatpropid"; + label, + controltype, + defaultvalue + FROM stockcatproperties + WHERE categoryid ='" . $CatValue . "' + AND reqatsalesorder =0 + ORDER BY stkcatpropid"; $PropertiesResult = DB_query($sql, $db); $PropertyCounter = 0; $PropertyWidth = array(); while ($PropertyRow = DB_fetch_array($PropertiesResult)) { $PropValResult = DB_query("SELECT value - FROM stockitemproperties - WHERE stockid='" . $StockID . "' - AND stkcatpropid ='" . $PropertyRow['stkcatpropid']."'", $db); + FROM stockitemproperties + WHERE stockid='" . $StockID . "' + AND stkcatpropid ='" . $PropertyRow['stkcatpropid']."'", $db); $PropValRow = DB_fetch_row($PropValResult); $PropertyValue = $PropValRow[0]; echo '<tr><th align="right">' . $PropertyRow['label'] . ':</th>'; @@ -247,17 +244,15 @@ WHERE stockid = '" . $StockID . "'", $db); $QOHRow = DB_fetch_row($QOHResult); $QOH = number_format($QOHRow[0], $myrow['decimalplaces']); - $QOOSQL="SELECT SUM(purchorderdetails.quantityord*(CASE WHEN purchdata.conversionfactor IS NULL THEN 1 ELSE purchdata.conversionfactor END) - - purchorderdetails.quantityrecd*(CASE WHEN purchdata.conversionfactor IS NULL THEN 1 ELSE purchdata.conversionfactor END)) - FROM purchorders - LEFT JOIN purchorderdetails + $QOOSQL="SELECT SUM(purchorderdetails.quantityord -purchorderdetails.quantityrecd) AS QtyOnOrder + FROM purchorders INNER JOIN purchorderdetails ON purchorders.orderno=purchorderdetails.orderno - LEFT JOIN purchdata - ON purchorders.supplierno=purchdata.supplierno - AND purchorderdetails.itemcode=purchdata.stockid + AND purchorderdetails.itemcode=purchdata.stockid WHERE purchorderdetails.itemcode='" . $StockID . "' - AND (purchorders.status<>'Cancelled' - AND purchorders.status<>'Pending')"; + AND purchorderdetails.completed =0 + AND purchorders.status<>'Cancelled' + AND purchorders.status<>'Pending' + AND purchorders.status<>'Rejected'"; $QOOResult = DB_query($QOOSQL, $db); if (DB_num_rows($QOOResult) == 0) { $QOO = 0; @@ -267,10 +262,10 @@ } //Also the on work order quantities $sql = "SELECT SUM(woitems.qtyreqd-woitems.qtyrecd) AS qtywo - FROM woitems INNER JOIN workorders - ON woitems.wo=workorders.wo - WHERE workorders.closed=0 - AND woitems.stockid='" . $StockID . "'"; + FROM woitems INNER JOIN workorders + ON woitems.wo=workorders.wo + WHERE workorders.closed=0 + AND woitems.stockid='" . $StockID . "'"; $ErrMsg = _('The quantity on work orders for this product cannot be retrieved because'); $QOOResult = DB_query($sql, $db, $ErrMsg); if (DB_num_rows($QOOResult) == 1) { @@ -282,25 +277,25 @@ } $Demand = 0; $DemResult = DB_query("SELECT SUM(salesorderdetails.quantity-salesorderdetails.qtyinvoiced) AS dem - FROM salesorderdetails INNER JOIN salesorders - ON salesorders.orderno = salesorderdetails.orderno - WHERE salesorderdetails.completed=0 - AND salesorders.quotation=0 - AND salesorderdetails.stkcode='" . $StockID . "'", $db); + FROM salesorderdetails INNER JOIN salesorders + ON salesorders.orderno = salesorderdetails.orderno + WHERE salesorderdetails.completed=0 + AND salesorders.quotation=0 + AND salesorderdetails.stkcode='" . $StockID . "'", $db); $DemRow = DB_fetch_row($DemResult); $Demand = $DemRow[0]; $DemAsComponentResult = DB_query("SELECT SUM((salesorderdetails.quantity-salesorderdetails.qtyinvoiced)*bom.quantity) AS dem - FROM salesorderdetails, - salesorders, - bom, - stockmaster - WHERE salesorderdetails.stkcode=bom.parent - AND salesorders.orderno = salesorderdetails.orderno - AND salesorderdetails.quantity-salesorderdetails.qtyinvoiced > 0 - AND bom.component='" . $StockID . "' - AND stockmaster.stockid=bom.parent - AND stockmaster.mbflag='A' - AND salesorders.quotation=0", $db); + FROM salesorderdetails, + salesorders, + bom, + stockmaster + WHERE salesorderdetails.stkcode=bom.parent + AND salesorders.orderno = salesorderdetails.orderno + AND salesorderdetails.quantity-salesorderdetails.qtyinvoiced > 0 + AND bom.component='" . $StockID . "' + AND stockmaster.stockid=bom.parent + AND stockmaster.mbflag='A' + AND salesorders.quotation=0", $db); $DemAsComponentRow = DB_fetch_row($DemAsComponentResult); $Demand+= $DemAsComponentRow[0]; //Also the demand for the item as a component of works orders @@ -333,34 +328,30 @@ <th width="10%">' . _('Min Order Qty') . '</th> <th width="5%">' . _('Prefer') . '</th></tr>'; $SuppResult = DB_query("SELECT suppliers.suppname, - suppliers.currcode, - suppliers.supplierid, - purchdata.price, - purchdata.effectivefrom, - purchdata.leadtime, - purchdata.conversionfactor, - purchdata.minorderqty, - purchdata.preferred - FROM purchdata INNER JOIN suppliers - ON purchdata.supplierno=suppliers.supplierid - WHERE purchdata.stockid = '" . $StockID . "' - ORDER BY purchdata.preferred DESC, purchdata.effectivefrom DESC", $db); + suppliers.currcode, + suppliers.supplierid, + purchdata.price, + purchdata.effectivefrom, + purchdata.leadtime, + purchdata.conversionfactor, + purchdata.minorderqty, + purchdata.preferred + FROM purchdata INNER JOIN suppliers + ON purchdata.supplierno=suppliers.supplierid + WHERE purchdata.stockid = '" . $StockID . "' + ORDER BY purchdata.preferred DESC, purchdata.effectivefrom DESC", $db); while ($SuppRow = DB_fetch_array($SuppResult)) { echo '<tr><td class="select">' . $SuppRow['suppname'] . '</td> <td class="select">' . number_format($SuppRow['price'] / $SuppRow['conversionfactor'], 2) . '</td> <td class="select">' . $SuppRow['currcode'] . '</td> <td class="select">' . ConvertSQLDate($SuppRow['effectivefrom']) . '</td> - <td class="select">' . $SuppRow['leadtime'] . '</td> + <td class="select">' . $SuppRow['leadtime'] . '</td> <td class="select">' . $SuppRow['minorderqty'] . '</td>'; - switch ($SuppRow['preferred']) { - /* 2008-08-19 ToPu */ - case 1: - echo '<td class="select">' . _('Yes') . '</td>'; - break; - case 0: - echo '<td class="select">' . _('No') . '</td>'; - break; + if ($SuppRow['preferred']==1) { //then this is the preferred supplier + echo '<td class="select">' . _('Yes') . '</td>'; + } else { + echo '<td class="select">' . _('No') . '</td>'; } echo '<td class="select"><a href="' . $rootpath . '/PO_Header.php?' . SID . '&NewOrder=Yes' . '&SelectedSupplier=' . $SuppRow['supplierid'] . '&StockID=' . $StockID . '&Quantity='.$SuppRow['minorderqty'].'">' . _('Order') . ' </a></td>'; @@ -402,31 +393,23 @@ if ($Its_A_Kitset_Assembly_Or_Dummy == False) { echo '<a href="' . $rootpath . '/StockAdjustments.php?' . SID . '&StockID=' . $StockID . '">' . _('Quantity Adjustments') . '</a><br />'; echo '<a href="' . $rootpath . '/StockTransfers.php?' . SID . '&StockID=' . $StockID . '">' . _('Location Transfers') . '</a><br />'; - /** - * 2008-08-19 ToPu - * enter a purchase order for this SelectedStockItem and suppliers - * supplierid -- one link for each supplierid. - */ if ($myrow['mbflag'] == 'B') { - /**/ echo '<br />'; $SuppResult = DB_query("SELECT suppliers.suppname, - suppliers.supplierid, - purchdata.preferred, - purchdata.minorderqty - FROM purchdata INNER JOIN suppliers - ON purchdata.supplierno=suppliers.supplierid - WHERE purchdata.stockid = '" . $StockID . "'", $db); + suppliers.supplierid, + purchdata.preferred, + purchdata.minorderqty + FROM purchdata INNER JOIN suppliers + ON purchdata.supplierno=suppliers.supplierid + WHERE purchdata.stockid = '" . $StockID . "'", $db); while ($SuppRow = DB_fetch_array($SuppResult)) { - /**/ - // if ($myrow['eoq'] == 0) { $EOQ = $SuppRow['minorderqty']; } else { $EOQ = $myrow['eoq']; } echo '<a href="' . $rootpath . '/PO_Header.php?' . SID . '&NewOrder=Yes' . '&SelectedSupplier=' . $SuppRow['supplierid'] . - '&StockID=' . $StockID . '&Quantity=' . $EOQ . '">' . _('Purchase this Item from') . ' ' . $SuppRow['suppname'] . ' (default)</a><br />'; + '&StockID=' . $StockID . '&Quantity=' . $EOQ . '">' . _('Purchase this Item from') . ' ' . $SuppRow['suppname'] . ' (' . _('default') . ')</a><br />'; /**/ } /* end of while */ } /* end of $myrow['mbflag'] == 'B' */ @@ -527,65 +510,63 @@ $SearchString = '%' . str_replace(' ', '%', $_POST['Keywords']) . '%'; if ($_POST['StockCat'] == 'All') { $SQL = "SELECT stockmaster.stockid, - stockmaster.description, - SUM(locstock.quantity) AS qoh, - stockmaster.units, - stockmaster.mbflag, - stockmaster.decimalplaces - FROM stockmaster - LEFT JOIN stockcategory - ON stockmaster.categoryid=stockcategory.categoryid, - locstock - WHERE stockmaster.stockid=locstock.stockid - AND stockmaster.description " . LIKE . " '$SearchString' - AND stockcategory.stocktype<>'A' - GROUP BY stockmaster.stockid, - stockmaster.description, - stockmaster.units, - stockmaster.mbflag, - stockmaster.decimalplaces - ORDER BY stockmaster.stockid"; + stockmaster.description, + SUM(locstock.quantity) AS qoh, + stockmaster.units, + stockmaster.mbflag, + stockmaster.decimalplaces + FROM stockmaster + LEFT JOIN stockcategory + ON stockmaster.categoryid=stockcategory.categoryid, + locstock + WHERE stockmaster.stockid=locstock.stockid + AND stockmaster.description " . LIKE . " '$SearchString' + GROUP BY stockmaster.stockid, + stockmaster.description, + stockmaster.units, + stockmaster.mbflag, + stockmaster.decimalplaces + ORDER BY stockmaster.stockid"; } else { $SQL = "SELECT stockmaster.stockid, - stockmaster.description, - SUM(locstock.quantity) AS qoh, - stockmaster.units, - stockmaster.mbflag, - stockmaster.decimalplaces - FROM stockmaster, - locstock - WHERE stockmaster.stockid=locstock.stockid - AND description " . LIKE . " '$SearchString' - AND categoryid='" . $_POST['StockCat'] . "' - GROUP BY stockmaster.stockid, - stockmaster.description, - stockmaster.units, - stockmaster.mbflag, - stockmaster.decimalplaces - ORDER BY stockmaster.stockid"; + stockmaster.description, + SUM(locstock.quantity) AS qoh, + stockmaster.units, + stockmaster.mbflag, + stockmaster.decimalplaces + FROM stockmaster, + locstock + WHERE stockmaster.stockid=locstock.stockid + AND description " . LIKE . " '$SearchString' + AND categoryid='" . $_POST['StockCat'] . "' + GROUP BY stockmaster.stockid, + stockmaster.description, + stockmaster.units, + stockmaster.mbflag, + stockmaster.decimalplaces + ORDER BY stockmaster.stockid"; } } elseif (isset($_POST['StockCode'])) { $_POST['StockCode'] = strtoupper($_POST['StockCode']); if ($_POST['StockCat'] == 'All') { $SQL = "SELECT stockmaster.stockid, - stockmaster.description, - stockmaster.mbflag, - SUM(locstock.quantity) AS qoh, - stockmaster.units, - stockmaster.decimalplaces - FROM stockmaster - LEFT JOIN stockcategory - ON stockmaster.categoryid=stockcategory.categoryid, - locstock - WHERE stockmaster.stockid=locstock.stockid - AND stockmaster.stockid " . LIKE . " '%" . $_POST['StockCode'] . "%' - AND stockcategory.stocktype<>'A' - GROUP BY stockmaster.stockid, - stockmaster.description, - stockmaster.units, - stockmaster.mbflag, - stockmaster.decimalplaces - ORDER BY stockmaster.stockid"; + stockmaster.description, + stockmaster.mbflag, + SUM(locstock.quantity) AS qoh, + stockmaster.units, + stockmaster.decimalplaces + FROM stockmaster + INNER JOIN stockcategory + ON stockmaster.categoryid=stockcategory.categoryid, + locstock + WHERE stockmaster.stockid=locstock.stockid + AND stockmaster.stockid " . LIKE . " '%" . $_POST['StockCode'] . "%' + GROUP BY stockmaster.stockid, + stockmaster.description, + stockmaster.units, + stockmaster.mbflag, + stockmaster.decimalplaces + ORDER BY stockmaster.stockid"; } else { $SQL = "SELECT stockmaster.stockid, stockmaster.description, @@ -618,7 +599,6 @@ ON stockmaster.categoryid=stockcategory.categoryid, locstock WHERE stockmaster.stockid=locstock.stockid - AND stockcategory.stocktype<>'A' GROUP BY stockmaster.stockid, stockmaster.description, stockmaster.units, @@ -720,16 +700,16 @@ $k++; } if ($myrow['mbflag'] == 'D') { - $qoh = 'N/A'; + $qoh = _('N/A'); } else { - $qoh = number_format($myrow["qoh"], $myrow['decimalplaces']); + $qoh = number_format($myrow['qoh'], $myrow['decimalplaces']); } echo "<td><input type='submit' name='Select' value='".$myrow['stockid']."' /></td> <td>".$myrow['description']."</td> <td class='number'>".$qoh."</td> <td>".$myrow['units']."</td> - <td><a target='_blank' href='" . $rootpath . "/StockStatus.php?" . SID . "&StockID=".$myrow['stockid']."'>" . _('View') . "</a></td> - </tr>"; + <td><a target='_blank' href='" . $rootpath . '/StockStatus.php?' . SID . '&StockID=' . $myrow['stockid']."'>" . _('View') . '</a></td> + </tr>'; $j++; if ($j == 20 AND ($RowIndex + 1 != $_SESSION['DisplayRecordsMax'])) { $j = 1; Modified: trunk/UpgradeDatabase.php =================================================================== --- trunk/UpgradeDatabase.php 2010-12-27 11:33:59 UTC (rev 4453) +++ trunk/UpgradeDatabase.php 2010-12-29 09:53:54 UTC (rev 4454) @@ -1,410 +1,112 @@ <?php - +/* $Id: $*/ $PageSecurity = 15; - include('includes/session.inc'); - -$title = _('Database Upgrade'); - -//ob_start(); /*what is this for? */ - +$title = _('Upgrade webERP Database'); include('includes/header.inc'); -function executeSQL($sql, $db, $TrapErrors=False) { -/* Run an sql statement and return an error code */ - $result = DB_query($sql, $db, '', '', false, $TrapErrors); - return DB_error_no($db); -} -function updateDBNo($NewNumber, $db) { - $sql="UPDATE config SET confvalue='".$NewNumber."' WHERE confname='DBUpdateNumber'"; - executeSQL($sql, $db); - $_SESSION['DBUpdateNumber']=$NewNumber; -} +if (empty($_POST['DoUpgrade'])){ + + prnMsg(_('This script will run perform any modifications to the database since v 3.11 required to allow the additional functionality in later scripts'),'info'); -function CharacterSet($table, $db) { - $sql="SELECT TABLE_COLLATION - FROM information_schema.tables - WHERE TABLE_SCHEMA='".$_SESSION['DatabaseName']."' - AND TABLE_NAME='".$table."'"; - $result=DB_query($sql, $db); - $myrow=DB_fetch_array($result); - return $myrow['TABLE_COLLATION']; + echo "<p><form method='post' action='" . $_SERVER['PHP_SELF'] . '?' . SID . "'>"; + echo '<input type="hidden" name="FormID" value="' . $_SESSION['FormID'] . '" />'; + echo '<div class="centre"><input type="submit" name="DoUpgrade" VALUE="' . _('Perform Database Upgrade') . '"></div>'; + echo '</form>'; } -function AddColumn($Column, $Table, $Type, $Null, $Default, $After, $db) { - $sql="desc ".$Table." ".$Column; - $result = DB_query($sql, $db); - if (DB_num_rows($result)==0) { - if ($Type=='text') { - $response=executeSQL("ALTER TABLE `".$Table."` ADD COLUMN `".$Column."` ".$Type." ".$Null. - " AFTER `".$After."`", $db, False); - } else { - $response=executeSQL("ALTER TABLE `".$Table."` ADD COLUMN `".$Column."` ".$Type." ".$Null." DEFAULT '".$Default. - "' AFTER `".$After."`", $db, False); - } - if ($response==0) { - OutputResult( _('The column').' '.$Column.' '._('has been inserted') , 'success'); - } else { - OutputResult( _('The column').' '.$Column.' '._('could not be inserted') , 'error'); - } - } else { - OutputResult( _('The column').' '.$Column.' '._('already exists') , 'info'); - } -} +if ($_POST['DoUpgrade'] == _('Perform Database Upgrade')){ -function DropColumn($Column, $Table, $db) { - $sql="desc ".$Table." ".$Column; - $result = DB_query($sql, $db); - if (DB_num_rows($result)!=0) { - $response=executeSQL("ALTER TABLE `".$Table."` DROP `".$Column, $db, False); - if ($response==0) { - OutputResult( _('The column').' '.$Column.' '._('has been removed') , 'success'); - } else { - OutputResult( _('The column').' '.$Column.' '._('could not be removed') , 'error'); - } - } else { - OutputResult( _('The column').' '.$Column.' '._('is already removed') , 'info'); - } -} + echo '<br>'; + prnMsg(_('If there are any failures then please check with your system administrator'). + '. '._('Please read all notes carefully to ensure they are expected'),'info'); -function ChangeColumnSize($Column, $Table, $Type, $Null, $Default, $Size, $db) { - $sql="SELECT CHARACTER_MAXIMUM_LENGTH - FROM information_schema.columns - WHERE TABLE_SCHEMA='".$_SESSION['DatabaseName']."' - AND TABLE_NAME='".$Table."' - AND COLUMN_NAME='".$Column."'"; - $result=DB_query($sql, $db); - $myrow=DB_fetch_row($result); - if ($myrow[0]<>$Size) { - $response=executeSQL("ALTER TABLE ".$Table." CHANGE COLUMN ".$Column." ".$Column." ".$Type." ".$Null." DEFAULT '".$Default."'", $db, False); - if ($response==0) { - OutputResult( _('The column').' '.$Column.' '._('has been changed') , 'success'); - } else { - OutputResult( _('The column').' '.$Column.' '._('could not be changed') , 'error'); + if($_SESSION['DBUpdateNumber']< 1) { /* DBUpdateNumber set to 1 when upgrade3.11.1-4.00.sql is run */ + if ($dbType=='mysql' OR $dbType =='mysqli'){ + $SQLScripts[0] = './sql/mysql/upgrade3.11.1-4.00.sql'; } - } else { - OutputResult( _('The column').' '.$Column.' '._('is already changed') , 'info'); } -} + $result = DB_IgnoreForeignKeys($db); + + foreach ($SQLScripts AS $SQLScriptFile) { + + $SQLEntries = file($SQLScriptFile); + $ScriptFileEntries = sizeof($SQLEntries); + $ErrMsg = _('The script to upgrade the database failed because'); + $sql =''; + $InAFunction = false; + echo '<br><table> + <tr><th colspan=2>' . _('Applying') . ' ' . $SQLScriptFile . '</th></tr>'; -function ChangeColumnName($OldName, $Table, $Type, $Null, $Default, $NewName, $db, $AutoIncrement='') { - $sql="SELECT CHARACTER_MAXIMUM_LENGTH - FROM information_schema.columns - WHERE TABLE_SCHEMA='".$_SESSION['DatabaseName']."' - AND TABLE_NAME='".$Table."' - AND COLUMN_NAME='".$OldName."'"; - $result=DB_query($sql, $db); - if (DB_num_rows($result)>0) { - if ($AutoIncrement=='') { - $response=executeSQL("ALTER TABLE ".$Table." CHANGE COLUMN ".$OldName." ".$NewName." ".$Type." ".$Null." DEFAULT '".$Default."'", $db, False); - } else { - $response=executeSQL("ALTER TABLE ".$Table." CHANGE COLUMN ".$OldName." ".$NewName." ".$Type." ".$Null." ".$AutoIncrement, $db, False); - } - if ($response==0) { - OutputResult( _('The column').' '.$OldName.' '._('has been renamed').' '.$NewName , 'success'); - } else { - OutputResult( _('The column').' '.$OldName.' '._('could not be renamed') , 'error'); - } - } else { - OutputResult( _('The column').' '.$OldName.' '._('is already changed') , 'info'); - } -} + for ($i=0; $i<=$ScriptFileEntries; $i++) { + + $SQLEntries[$i] = trim($SQLEntries[$i]); -function ChangeColumnType($Column, $Table, $Type, $Null, $Default, $db) { - $sql="SELECT DATA_TYPE - FROM information_schema.columns - WHERE TABLE_SCHEMA='".$_SESSION['DatabaseName']."' - AND TABLE_NAME='".$Table."' - AND COLUMN_NAME='".$Column."'"; - $result=DB_query($sql, $db); - $myrow=DB_fetch_row($result); - if ($myrow[0]<>$Type) { - $response=executeSQL("ALTER TABLE ".$Table." CHANGE COLUMN ".$Column." ".$Column." ".$Type." ".$Null." DEFAULT '".$Default."'", $db, False); - if ($response==0) { - OutputResult( _('The column').' '.$Column.' '._('has been changed') , 'success'); - } else { - OutputResult( _('The column').' '.$Column.' '._('could not be changed') , 'error'); - } - } else { - OutputResult( _('The column').' '.$Column.' '._('is already changed') , 'info'); - } -} - -function ChangeColumnDefault($Column, $Table, $Type, $Null, $Default, $db) { - $sql="SELECT COLUMN_DEFAULT - FROM information_schema.columns - WHERE TABLE_SCHEMA='".$_SESSION['DatabaseName']."' - AND TABLE_NAME='".$Table."' - AND COLUMN_NAME='".$Column."'"; - $result=DB_query($sql, $db); - $myrow=DB_fetch_row($result); - if ($myrow[0]<>$Default) { - $response=executeSQL("ALTER TABLE ".$Table." CHANGE COLUMN ".$Column." ".$Column." ".$Type." ".$Null." DEFAULT '".$Default."'", $db, False); - if ($response==0) { - OutputResult( _('The column').' '.$Column.' '._('has been changed') , 'success'); - } else { - OutputResult( _('The column').' '.$Column.' '._('could not be changed') , 'error'); - } - } else { - OutputResult( _('The column').' '.$Column.' '._('is already changed') , 'info'); - } -} - -function NewConfigValue($ConfName, $ConfValue, $db) { - $sql="SELECT confvalue - FROM config - WHERE confname='".$ConfName."'"; - $result=DB_query($sql, $db); - $myrow=DB_fetch_row($result); - if (DB_num_rows($result)==0) { - $response=executeSQL("INSERT INTO `config` (`confname`, `confvalue`) VALUES ('".$ConfName."', '".$ConfValue."')", $db, False); - if ($response==0) { - OutputResult( _('The config value').' '.$ConfName.' '._('has been inserted') , 'success'); - } else { - OutputResult( _('The config value').' '.$ConfName.' '._('could not be inserted') , 'error'); - } - } else { - OutputResult( _('The config value').' '.$ConfName.' '._('is in') , 'info'); - } -} - -function CreateTable($Table, $sql, $db) { - $ShowSQL="SHOW TABLES WHERE Tables_in_".$_SESSION['DatabaseName']."='".$Table."'"; - $result=DB_Query($ShowSQL, $db); - - if (DB_num_rows($result)==0) { - $response=executeSQL($sql, $db, False); - if ($response==0) { - OutputResult( _('The table').' '.$Table.' '._('has been created') , 'success'); - } else { - OutputResult( _('The table').' '.$Table.' '._('could not be created') , 'error'); - } - } else { - OutputResult( _('The table').' '.$Table.' '._('already exists') , 'info'); - } -} - -function ConstraintExists($Table, $Constraint, $db) { - $sql="SELECT CONSTRAINT_NAME - FROM information_schema.TABLE_CONSTRAINTS - WHERE TABLE_SCHEMA='".$_SESSION['DatabaseName']."' - AND TABLE_NAME='".$Table."' - AND CONSTRAINT_NAME='".$Constraint."'"; - $result=DB_query($sql, $db); - if (DB_num_rows($result)==0) { - return false; - } else { - return true; - } -} - -function DropConstraint($Table, $Constraint, $db) { - if (ConstraintExists($Table, $Constraint, $db)) { - $response=executeSQL("ALTER TABLE `".$Table."` DROP FOREIGN KEY `".$Constraint."`", $db, False); - if ($response==0) { - OutputResult( _('The constraint').' '.$Constraint.' '._('has been removed') , 'success'); - } else { - OutputResult( _('The constraint').' '.$Constraint.' '._('could not be removed') , 'error'); - } - } else { - OutputResult( _('The constraint').' '.$Constraint.' '._('does not exist') , 'info'); - } -} - -function AddConstraint($Table, $Constraint, $Field, $ReferenceTable, $ReferenceField, $db) { - if (!ConstraintExists($Table, $Constraint, $db)) { - $response=executeSQL("ALTER TABLE ".$Table. " ADD CONSTRAINT ".$Constraint." FOREIGN KEY (".$Field. - ") REFERENCES ".$ReferenceTable." (".$ReferenceField.")", $db, False); - if ($response==0) { - OutputResult( _('The constraint').' '.$Constraint.' '._('has been added') , 'success'); - } else { - OutputResult( _('The constraint').' '.$Constraint.' '._('could not be added') , 'error'); - } - } else { - OutputResult( _('The constraint').' '.$Constraint.' '._('already exists') , 'info'); - } -} - -function UpdateField($Table, $Field, $NewValue, $Criteria, $db) { - $sql="SELECT ".$Field." FROM ".$Table." WHERE ".$Criteria; - $result=DB_query($sql, $db); - $myrow=DB_fetch_row($result); - if ($myrow[0]!=$NewValue) { - $response=executeSQL("UPDATE ".$Table." SET ".$Field."='".$NewValue."' WHERE ".$Criteria, $db, False); - if ($response==0) { - OutputResult( _('The field').' '.$Field.' '._('has been updated') , 'success'); - } else { - OutputResult( _('The field').' '.$Field.' '._('could not be updated') , 'error'); - } - } else { - OutputResult( _('The field').' '.$Field.' '._('is already correct') , 'info'); - } -} - -function DeleteRecords($Table, $Criteria, $db) { - $sql="SELECT * FROM ".$Table." WHERE ".$Criteria; - $result=DB_query($sql, $db); - if (DB_num_rows($result)>0) { - $response=executeSQL("DELETE FROM ".$Table." WHERE ".$Criteria, $db, False); - if ($response==0) { - OutputResult( _('Rows have been deleted from').' '.$Table , 'success'); - } else { - OutputResult( _('Rows could not be deleted from').' '.$Table , 'error'); - } - } else { - OutputResult( _('There was nothing to delete from').' '.$Table , 'info'); - } -} - -function DropTable($Table, $Field, $db) { - $sql="SHOW tables WHERE Tables_in_".$_SESSION['DatabaseName']." ='".$Table."'"; - $result=DB_query($sql, $db); - $CanDrop=False; - if (DB_num_rows($result)>0) { - $CanDrop=True; - $sql="desc ".$Table." ".$Field; - $result = DB_query($sql, $db); - if (DB_num_rows($result)>0) { - $CanDrop=True; - } else { - $CanDrop=False; - } - } - if ($CanDrop) { - $response=executeSQL("DROP TABLE IF EXISTS `".$Table."`", $db); - if ($response==0) { - OutputResult( _('The old table').' '.$Table.' '._('has been removed') , 'success'); - } else { - OutputResult( _('The old table').' '.$Table.' '._('could not be removed') , 'error'); - } - } else { - OutputResult( _('The old table').' '.$Table.' '._('has already been removed') , 'info'); - } -} - -function InsertRecord($Table, $CheckFields, $CheckValues, $Fields, $Values, $db) { - $sql="SELECT * FROM ".$Table." WHERE "; - for ($i=0;$i<sizeOf($CheckFields);$i++) { - $sql = $sql.$CheckFields[$i]."='".$CheckValues[$i]."' AND "; - } - $sql=substr($sql, 0, strlen($sql)-5); - $result=DB_query($sql, $db); - if (DB_num_rows($result)==0) { - $sql="INSERT INTO ".$Table." ("; - for ($i=0;$i<sizeOf($Fields);$i++) { - $sql = $sql.$Fields[$i].","; - } - $sql=substr($sql, 0, strlen($sql)-1).") VALUES ("; - for ($i=0;$i<sizeOf($Values);$i++) { - $sql = $sql."'".$Values[$i]."',"; - } - $sql=substr($sql, 0, strlen($sql)-1).")"; - $response=executeSQL($sql, $db); - if ($response==0) { - OutputResult( _('The record has been inserted') , 'success'); - } else { - OutputResult( _('The record could not be inserted') , 'error'); - } - } else { - OutputResult( _('The record is already in the table') , 'info'); - } -} - -function DropPrimaryKey($Table, $OldKey, $db) { - $Total=0; - foreach ($OldKey as $Field) { - $sql="select * from information_schema.key_column_usage where table_name='".$Table."' and constraint_name='primary' and - table_schema='".$_SESSION['DatabaseName']."' AND COLUMN_NAME='".$Field."'"; - $result = DB_query($sql, $db); - $Total = $Total + DB_num_rows($result); - } - if ($Total==sizeOf($OldKey)) { - $response=executeSQL("ALTER TABLE ".$Table." DROP PRIMARY KEY", $db); - if ($response==0) { - OutputResult( _('The primary key in').' '.$Table.' '._('has been removed') , 'success'); - } else { - OutputResult( _('The primary key in').' '.$Table.' '._('could not be removed') , 'error'); - } - } else { - OutputResult( _('The primary key in').' '.$Table.' '._('has already been removed') , 'info'); - } -} - -function AddPrimaryKey($Table, $Fields, $db) { - $sql="select * from information_schema.key_column_usage where table_name='".$Table."' and constraint_name='primary' and - table_schema='".$_SESSION['DatabaseName']."'"; - $result = DB_query($sql, $db); - if (DB_num_rows($result)!=sizeOf($Fields)) { - $KeyString=implode(",", $Fields); - $response=executeSQL("ALTER TABLE ".$Table." ADD PRIMARY KEY ( ".$KeyString." )", $db); - if ($response==0) { - OutputResult( _('The primary key in').' '.$Table.' '._('has been added') , 'success'); - } else { - OutputResult( _('The primary key in').' '.$Table.' '._('could not be added') , 'error'); - } - } else { - OutputResult( _('The primary key in').' '.$Table.' '._('has already been added') , 'info'); - } -} - -function RenameTable($OldName, $NewName, $db) { - $sql="SHOW TABLES WHERE Tables_in_".$_SESSION['DatabaseName']."='".$OldName."'"; - $result=DB_Query($sql, $db); - - if (DB_num_rows($result)!=0) { - $response=executeSQL("RENAME TABLE ".$OldName." to ".$NewName, $db, False); - if ($response==0) { - OutputResult( _('The table').' '.$OldName.' '._('has been renamed to').' '.$NewName , 'success'); - } else { - OutputResult( _('The table').' '.$OldName.' '._('could not be renamed to').' '.$NewName , 'error'); - } - } else { - OutputResult( _('The table').' '.$NewName.' '._('already exists') , 'info'); - } -} - -function OutputResult($msg, $status) { - if ($status=='error') { - echo '<td style="background-color: #fddbdb;color: red;">'; - } else if ($status=='success') { - echo '<td style="background-color: #b9ecb4;color: #006400;">'; - } else { - echo '<td style="background-color: #c7ccf6;color: navy;">'; - } - echo $msg; - echo '</td>'; -} - -echo '<p class="page_title_text"><img src="'.$rootpath.'/css/'.$theme.'/images/maintenance.png" title="' . _('Search') . '" alt="" />' . ' ' . $title.'</p>'; - -if (!isset($_POST['continue'])) { - echo '<form method="post" id="AccountGroups" action="' . $_SERVER['PHP_SELF'] . '?' . SID . '">'; - echo '<input type="hidden" name="FormID" value="' . $_SESSION['FormID'] . '" />'; - - echo '<div class="page_help_text">' . _('You have database updates that are required.').'<br />'. - _('Please ensure that you have taken a backup of your current database before continuing.'). '</div><br />'; - - echo '<div class="centre"><input type="submit" name="continue" value="'.('Continue With Updates').'" /></div>'; - echo '</form>'; -} else { - $StartingUpdate=$_SESSION['DBUpdateNumber']+1; - $EndingUpdate=$DBVersion; - //ob_end_flush(); - echo '<table>'; - for($UpdateNumber=$StartingUpdate; $UpdateNumber<=$EndingUpdate; $UpdateNumber++) { - ob_start(); - echo '<tr><td>'.$UpdateNumber.'</td>'; - $sql="SET FOREIGN_KEY_CHECKS=0"; - $result=DB_Query($sql, $db); - include('sql/mysql/updates/'.$UpdateNumber.'.php'); - $sql="SET FOREIGN_KEY_CHECKS=1"; - $result=DB_Query($sql, $db); - echo '</tr>'; - ob_end_flush(); - } + if (substr($SQLEntries[$i], 0, 2) != '--' + AND substr($SQLEntries[$i], 0, 3) != 'USE' + AND strstr($SQLEntries[$i],'/*')==FALSE + AND strlen($SQLEntries[$i])>1){ + + $sql .= ' ' . $SQLEntries[$i]; + + //check if this line kicks off a function definition - pg chokes otherwise + if (substr($SQLEntries[$i],0,15) == 'CREATE FUNCTION'){ + $InAFunction = true; + } + //check if this line completes a function definition - pg chokes otherwise + if (substr($SQLEntries[$i],0,8) == 'LANGUAGE'){ + $InAFunction = false; + } + if (strpos($SQLEntries[$i],';')>0 AND ! $InAFunction){ + $sql = substr($sql,0,strlen($sql)-1); + $result = DB_query($sql, $db, $ErrMsg, $DBMsg, false, false); + switch (DB_error_no($db)) { + case 0: + echo '<tr><td>' . $sql . '</td><td bgcolor="green">'._('Success').'</td></tr>'; + break; + case 1050: + echo '<tr><td>' . $sql . '</td><td bgcolor="yellow">'._('Note').' - '. + _('Table has already been created').'</td></tr>'; + break; + case 1060: + echo '<tr><td>' . $sql . '</td><td bgcolor="yellow">'._('Note').' - '. + _('Column has already been created').'</td></tr>'; + break; + case 1061: + echo '<tr><td>' . $sql . '</td><td bgcolor="yellow">'._('Note').' - '. + _('Index already exists').'</td></tr>'; + break; + case 1062: + echo '<tr><td>' . $sql . '</td><td bgcolor="yellow">'._('Note').' - '. + _('Entry has already been done').'</td></tr>'; + break; + case 1068: + echo '<tr><td>' . $sql . '</td><td bgcolor="yellow">'._('Note').' - '. + _('Primary key already exists').'</td></tr>'; + break; + case 1091: + echo '<tr><td>' . $sql . '</td><td bgcolor="yellow">'._('Note').' - '. + _('Index already dropped previously').'</td></tr>'; + break; + default: + echo '<tr><td>' . $sql . '</td><td bgcolor="red">'._('Failure').' - '. + _('Error number').' - '.DB_error_no($db) .'</td></tr>'; + break; + } + unset($sql); + } + } //end if its a valid sql line not a comment + } //end of for loop around the lines of the sql script echo '</table>'; -} + } //end of loop around SQLScripts to apply + $result =DB_ReinstateForeignKeys($db); + /*Now get the modified DBUpgradeNumber */ + $result = DB_query('SELECT confvalue FROM config WHERE confname="DBUpdateNumber"',$db); + $myrow = DB_fetch_array($result); + $_SESSION['DBUpdateNumber'] = $myrow['confvalue']; +} /*Dont do upgrade */ + include('includes/footer.inc'); -?> \ No newline at end of file +?> Modified: trunk/Z_ChangeBranchCode.php =================================================================== --- trunk/Z_ChangeBranchCode.php 2010-12-27 11:33:59 UTC (rev 4453) +++ trunk/Z_ChangeBranchCode.php 2010-12-29 09:53:54 UTC (rev 4454) @@ -111,18 +111,18 @@ prnMsg (_('Changing customer transaction records'),'info'); $sql = "UPDATE debtortrans SET - branchcode='" . $_POST['NewBranchCode'] . "' - WHERE debtorno='" . $_POST['DebtorNo'] . "' - AND branchcode='" . $_POST['OldBranchCode'] . "'"; + branchcode='" . $_POST['NewBranchCode'] . "' + WHERE debtorno='" . $_POST['DebtorNo'] . "' + AND branchcode='" . $_POST['OldBranchCode'] . "'"; $ErrMsg = _('The SQL to update debtor transaction records failed because'); $result = DB_query($sql,$db,$ErrMsg,$DbgMsg,true); prnMsg(_('Changing sales analysis records'),'info'); $sql = "UPDATE salesanalysis - SET custbranch='" . $_POST['NewBranchCode'] . "' - WHERE cust='" . $_POST['DebtorNo'] . "' - AND custbranch='" . $_POST['OldBranchCode'] . "'"; + SET custbranch='" . $_POST['NewBranchCode'] . "' + WHERE cust='" . $_POST['DebtorNo'] . "' + AND custbranch='" . $_POST['OldBranchCode'] . "'"; $ErrMsg = _('The SQL to update Sales Analysis records failed because'); $result = DB_query($sql,$db,$ErrMsg,$DbgMsg,true); @@ -130,9 +130,9 @@ prnMsg(_('Changing order delivery differences records'),'info'); $sql = "UPDATE orderdeliverydifferenceslog - SET branch='" . $_POST['NewBranchCode'] . "' - WHERE debtorno='" . $_POST['DebtorNo'] . "' - AND branch='" . $_POST['OldBranchCode'] . "'"; + SET branch='" . $_POST['NewBranchCode'] . "' + WHERE debtorno='" . $_POST['DebtorNo'] . "' + AND branch='" . $_POST['OldBranchCode'] . "'"; $ErrMsg = _('The SQL to update order delivery differences records failed because'); $result = DB_query($sql,$db,$ErrMsg,$DbgMsg,true); @@ -140,58 +140,59 @@ prnMsg (_('Changing pricing records'),'info'); $sql = "UPDATE prices - SET branchcode='" . $_POST['NewBranchCode'] . "' - WHERE debtorno='" . $_POST['DebtorNo'] . "' - AND branchcode='" . $_POST['OldBranchCode'] . "'"; + SET branchcode='" . $_POST['NewBranchCode'] . "' + WHERE debtorno='" . $_POST['DebtorNo'] . "' + AND branchcode='" . $_POST['OldBranchCode'] . "'"; $ErrMsg = _('The SQL to update the pricing records failed because'); $result = DB_query($sql,$db,$ErrMsg,$DbgMsg,true); prnMsg(_('Changing sales orders records'),'info'); $sql = "UPDATE salesorders - SET branchcode='" . $_POST['NewBranchCode'] . "' - WHERE debtorno='" . $_POST['DebtorNo'] . "' - AND branchcode='" . $_POST['OldBranchCode'] . "'"; + SET branchcode='" . $_POST['NewBranchCode'] . "' + WHERE debtorno='" . $_POST['DebtorNo'] . "' + AND branchcode='" . $_POST['OldBranchCode'] . "'"; $ErrMsg = _('The SQL to update the sales order header records failed because'); $result = DB_query($sql,$db,$ErrMsg,$DbgMsg,true); prnMsg(_('Changing stock movement records'),'info'); $sql = "UPDATE stockmoves - SET branchcode='" . $_POST['NewBranchCode'] . "' - WHERE debtorno='" . $_POST['DebtorNo'] . "' - AND branchcode='" . $_POST['OldBranchCode'] . "'"; + SET branchcode='" . $_POST['NewBranchCode'] . "' + WHERE debtorno='" . $_POST['DebtorNo'] . "' + AND branchcode='" . $_POST['OldBranchCode'] . "'"; $ErrMsg = _('The SQL to update the stock movement records failed because'); $result = DB_query($sql,$db,$ErrMsg,$DbgMsg,true); prnMsg(_('Changing user default customer records'),'info'); $sql = "UPDATE www_users - SET branchcode='" . $_POST['NewBranchCode'] . "' - WHERE customerid='" . $_POST['DebtorNo'] . "' - AND branchcode='" . $_POST['OldBranchCode'] . "'";; + SET branchcode='" . $_POST['NewBranchCode'] . "' + WHERE customerid='" . $_POST['DebtorNo'] . "' + AND branchcode='" . $_POST['OldBranchCode'] . "'";; $ErrMsg = _('The SQL to update the user records failed'); $result = DB_query($sql,$db,$ErrMsg,$DbgMsg,true); prnMsg(_('Changing the customer branch code in contract header records'),'info'); $sql = "UPDATE contracts - SET branchcode='" . $_POST['NewBranchCode'] . "' - WHERE debtorno='" . $_POST['DebtorNo'] . "' - AND branchcode='" . $_POST['OldBranchCode'] . "'"; + SET branchcode='" . $_POST['NewBranchCode'] . "' + WHERE debtorno='" . $_POST['DebtorNo'] . "' + AND branchcode='" . $_POST['OldBranchCode'] . "'"; $ErrMsg = _('The SQL to update contract header records failed because'); $result = DB_query($sql,$db,$ErrMsg,$DbgMsg,true); $result = DB_Txn_Commit($db); + $result = DB_IgnoreForeignKeyChecks($db); prnMsg(_('Deleting the old customer branch record'),'info'); $sql = "DELETE FROM custbranch - WHERE debtorno='" . $_POST['DebtorNo'] . "' - AND branchcode='" . $_POST['OldBranchCode'] . "'"; - + WHERE debtorno='" . $_POST['DebtorNo'] . "' + AND branchcode='" . $_POST['OldBranchCode'] . "'"; + $ErrMsg = _('The SQL to delete the old customer branch record failed because'); $result = DB_query($sql,$db,$ErrMsg,$DbgMsg,true,true); + $result = DB_ReinstateForeignKeyChecks($db); - } echo "<form action='" . $_SERVER['PHP_SELF'] . "?=" . $SID . "' method=post>"; Modified: trunk/config.distrib.php =================================================================== --- trunk/config.distrib.php 2010-12-27 11:33:59 UTC (rev 4453) +++ trunk/config.distrib.php 2010-12-29 09:53:54 UTC (rev 4454) @@ -55,7 +55,6 @@ //this can be left commented out //$SessionSavePath = '/tmp'; - // which encryption function should be used //$CryptFunction = "md5"; // MD5 Hash $CryptFunction = "sha1"; // SHA1 Hash Modified: trunk/doc/Change.log.html =================================================================== --- trunk/doc/Change.log.html 2010-12-27 11:33:59 UTC (rev 4453) +++ trunk/doc/Change.log.html 2010-12-29 09:53:54 UTC (rev 4454) @@ -1,20 +1,21 @@ <p><font SIZE=4 COLOR=BLUE><b>webERP Change Log</b></font></p> <p>/</p> +<p>29/12/10 Phil: Reverted to single SQL upgrade file per release - but retaining Tim's upgrade mechanism if the DBUpgradeNumber is out of date. Removed pseudo SQL language required for upgrade script - just applies plain vanilla SQL from the scripts required</p> +<p>29/12/10 Tim: DB upgrade mechanism with separate sudo SQL for each database change in a separate file + 52 files of updates since 3.11.4</p> <p>21/12/10 Phil : Reworked PDFPrintLabels.php to conform to standards and corrected SQL for prices</p> <p>21/12/10 Ricard Andreu: PDFPrintLabels.php was not checking for end date of prices - fixed</p> -<p>19/12/10 Phil: SelectOrderItems.php ConfirmDispatch_Invoice.php add code to handle asset disposals. +<p>19/12/10 Phil: SelectOrderItems.php ConfirmDispatch_Invoice.php add code to handle asset disposals.</p> <p>14/12/10 Phil: modify purchasing scripts for coding conventions/readability</p> <p>11/12/10 Phil: Have populated the new field stockcheckdate in stockcheckfreeze and modified PDFStockCheckComparison to use this field when posting the GL - stockmoves need to be on the current day otherwise historical balances will all need to be updated. But narrative shows the date of the stock check for which ... [truncated message content] |
From: <dai...@us...> - 2010-12-29 23:18:58
|
Revision: 4455 http://web-erp.svn.sourceforge.net/web-erp/?rev=4455&view=rev Author: daintree Date: 2010-12-29 23:18:49 +0000 (Wed, 29 Dec 2010) Log Message: ----------- Database upgrade Modified Paths: -------------- trunk/UpgradeDatabase.php trunk/includes/ConnectDB.inc trunk/includes/GetConfig.php trunk/includes/footer.inc trunk/includes/session.inc trunk/sql/mysql/upgrade3.11.1-4.00.sql Added Paths: ----------- trunk/sql/mysql/upgrade2.7-2.8.sql trunk/sql/mysql/upgrade2.8-2.9.sql trunk/sql/mysql/upgrade2.9-2.9a.sql trunk/sql/mysql/upgrade2.9a-2.9b.sql trunk/sql/mysql/upgrade3.00-3.01.sql trunk/sql/mysql/upgrade3.01-3.02.sql trunk/sql/mysql/upgrade3.02-3.03.sql trunk/sql/mysql/upgrade3.03-3.04.sql trunk/sql/mysql/upgrade3.04-3.05.sql trunk/sql/mysql/upgrade3.05-3.06.sql trunk/sql/mysql/upgrade3.06-3.07.sql trunk/sql/mysql/upgrade3.07-3.08.sql trunk/sql/mysql/upgrade3.09-3.10.sql trunk/sql/mysql/upgrade3.10-3.11.sql Modified: trunk/UpgradeDatabase.php =================================================================== --- trunk/UpgradeDatabase.php 2010-12-29 09:53:54 UTC (rev 4454) +++ trunk/UpgradeDatabase.php 2010-12-29 23:18:49 UTC (rev 4455) @@ -7,7 +7,8 @@ if (empty($_POST['DoUpgrade'])){ - + if (!isset($_SESSION['VersionNumber')){ + prnMsg(_('The webERP code is version') . ' ' . $Version . ' ' . _('the database is a prior version and upgrade scripts are required to be run. Upgrades to the database prior to ') prnMsg(_('This script will run perform any modifications to the database since v 3.11 required to allow the additional functionality in later scripts'),'info'); echo "<p><form method='post' action='" . $_SERVER['PHP_SELF'] . '?' . SID . "'>"; @@ -22,7 +23,7 @@ prnMsg(_('If there are any failures then please check with your system administrator'). '. '._('Please read all notes carefully to ensure they are expected'),'info'); - if($_SESSION['DBUpdateNumber']< 1) { /* DBUpdateNumber set to 1 when upgrade3.11.1-4.00.sql is run */ + if($_SESSION['VersionNumber']< '4.00') { /* VersionNumber is set to '4.00' when upgrade3.11.1-4.00.sql is run */ if ($dbType=='mysql' OR $dbType =='mysqli'){ $SQLScripts[0] = './sql/mysql/upgrade3.11.1-4.00.sql'; } @@ -99,12 +100,11 @@ } //end if its a valid sql line not a comment } //end of for loop around the lines of the sql script echo '</table>'; - } //end of loop around SQLScripts to apply + } //end of loop around SQLScripts apply $result =DB_ReinstateForeignKeys($db); - /*Now get the modified DBUpgradeNumber */ - $result = DB_query('SELECT confvalue FROM config WHERE confname="DBUpdateNumber"',$db); - $myrow = DB_fetch_array($result); - $_SESSION['DBUpdateNumber'] = $myrow['confvalue']; + /*Now get the modified VersionNumber and script pagesecurities */ + $ForceConfigReload=true; + include('includes/GetConfig.php'); } /*Dont do upgrade */ Modified: trunk/includes/ConnectDB.inc =================================================================== --- trunk/includes/ConnectDB.inc 2010-12-29 09:53:54 UTC (rev 4454) +++ trunk/includes/ConnectDB.inc 2010-12-29 23:18:49 UTC (rev 4455) @@ -1,10 +1,10 @@ <?php /* $Id$*/ -/*DBVersion is compared against the value for config.confvalue WHERE confname=DBUpdateNumber in the database - * this value is saved in the $_SESSION['DBUpdateNumber'] when includes/GetConfig.php is run - * if DBUpdateNumber is < DBVersion then */ +/*Version is compared against the value for config.confvalue WHERE confname=VersionNumber in the database + * this value is saved in the $_SESSION['Versionumber'] when includes/GetConfig.php is run + * if VersionNumber is < $Version then the DB update script is run */ -$DBVersion=1; //must update manually every time there is a DB change +$Version='4.00'; //must update manually every time there is a DB change require_once ($PathPrefix .'includes/MiscFunctions.php'); if (!isset($_SESSION['DatabaseName'])){ Modified: trunk/includes/GetConfig.php =================================================================== --- trunk/includes/GetConfig.php 2010-12-29 09:53:54 UTC (rev 4454) +++ trunk/includes/GetConfig.php 2010-12-29 23:18:49 UTC (rev 4455) @@ -31,9 +31,9 @@ $_SESSION['PageSecurity'][$myrow['script']]=$myrow['pagesecurity']; } - if (!isset($_SESSION['DBUpdateNumber'])){ // the config record for DBUpdateNumber is not yet added - $_SESSION['DBUpdateNumber']=-1; - header('Location: UpgradeDatabase.php'); //divert to the db upgrade if the DBUpdateNumber is not in the config table + if (!isset($_SESSION['VersionNumber'])){ // the config record for VersionNumber is not yet added + $_SESSION['VersionNumber']=-1; + header('Location: UpgradeDatabase.php'); //divert to the db upgrade if the VersionNumber is not in the config table } /* Also reads all the company data set up in the company record and returns an array */ Modified: trunk/includes/footer.inc =================================================================== --- trunk/includes/footer.inc 2010-12-29 09:53:54 UTC (rev 4454) +++ trunk/includes/footer.inc 2010-12-29 23:18:49 UTC (rev 4455) @@ -12,7 +12,6 @@ setlocale(LC_ALL,$_SESSION['Language']); if (!isset($DefaultClock)) { include('config.php'); - $Version=$_SESSION['VersionNumber']; } echo '<p style="text-align:right">'.(strftime('%A')).', '.(date($_SESSION['DefaultDateFormat']).' | '.(strftime(($DefaultClock==12) ? '%I:%M %p' : '%H:%M'))).'</p>'; @@ -26,7 +25,7 @@ echo '</td></tr>'; - echo '<tr><td class="footer">webERP v' . $Version . ' ' . _('Copyright') . ' © weberp.org - '.date('Y').'</td></tr>'; + echo '<tr><td class="footer">webERP v' . $_SESSION['VersionNumber'] . ' ' . _('Copyright') . ' © weberp.org - '.date('Y').'</td></tr>'; if(http_file_exists('http://sflogo.sourceforge.net/sflogo.php')) { echo '<tr><td class="footer"><a href="https://sourceforge.net/projects/web-erp"><img src="http://sflogo.sourceforge.net/sflogo.php?group_id=70949&type=12" width="120" height="30" border="0" alt="Get webERP web-based ERP Accounting at SourceForge.net. Fast, secure and Free Open Source software downloads" /></a></td></tr>'; @@ -36,5 +35,4 @@ echo '</body>'; echo '</html>'; - ?> \ No newline at end of file Modified: trunk/includes/session.inc =================================================================== --- trunk/includes/session.inc 2010-12-29 09:53:54 UTC (rev 4454) +++ trunk/includes/session.inc 2010-12-29 23:18:49 UTC (rev 4455) @@ -121,8 +121,8 @@ */ $PageSecurity = $_SESSION['PageSecurity'][basename($_SERVER['SCRIPT_NAME'])]; } - -if (($DBVersion>$_SESSION['DBUpdateNumber']) and (basename($_SERVER['SCRIPT_NAME'])!='UpgradeDatabase.php')) { +/*If the Code $Version - held in ConnectDB.inc is > than the Database VersionNumber held in config table then do upgrades */ +if (($Version>$_SESSION['VersionNumber']) and (basename($_SERVER['SCRIPT_NAME'])!='UpgradeDatabase.php')) { header('Location: UpgradeDatabase.php'); } Added: trunk/sql/mysql/upgrade2.7-2.8.sql =================================================================== --- trunk/sql/mysql/upgrade2.7-2.8.sql (rev 0) +++ trunk/sql/mysql/upgrade2.7-2.8.sql 2010-12-29 23:18:49 UTC (rev 4455) @@ -0,0 +1,310 @@ +begin; + +ALTER TABLE Locations ADD TaxAuthority tinyint(4) NOT NULL default 1; + +ALTER TABLE StockMaster ADD TaxLevel tinyint(4) NOT NULL default 1; + +CREATE TABLE TaxAuthLevels ( + TaxAuthority tinyint NOT NULL default '1', + DispatchTaxAuthority tinyint NOT NULL default '1', + Level tinyint NOT NULL default '0', + TaxRate double NOT NULL default '0', + PRIMARY KEY (TaxAuthority,DispatchTaxAuthority,Level), + KEY (TaxAuthority), + KEY (DispatchTaxAuthority) +) TYPE=Innodb; + +INSERT INTO TaxAuthLevels VALUES (1, 1, 1, 0.1); +INSERT INTO TaxAuthLevels VALUES (1, 1, 2, 0); + +ALTER TABLE TaxAuthorities DROP COLUMN Rate; +ALTER TABLE TaxAuthorities CHANGE TaxID TaxID tinyint(4) NOT NULL default '0'; + + +ALTER TABLE StockMoves ADD COLUMN TaxRate float NOT NULL default 0; +ALTER TABLE DebtorTrans ADD COLUMN EDISent tinyint(4) NOT NULL default 0; +ALTER TABLE DebtorTrans ADD INDEX(`EDISent`); + +ALTER TABLE CustBranch ADD CustBranchCode VARCHAR(30) NOT NULL default ''; + +ALTER TABLE WWW_Users ADD COLUMN Blocked tinyint(4) NOT NULL default 0; + +ALTER TABLE DebtorsMaster ADD EDIInvoices tinyint(4) NOT NULL default '0'; +ALTER TABLE DebtorsMaster ADD EDIOrders tinyint(4) NOT NULL default '0'; +ALTER TABLE DebtorsMaster ADD EDIReference varchar(20) NOT NULL default ''; +ALTER TABLE DebtorsMaster ADD EDITransport varchar(5) NOT NULL default 'email'; +ALTER TABLE DebtorsMaster ADD EDIAddress varchar(50) NOT NULL default ''; +ALTER TABLE DebtorsMaster ADD EDIServerUser varchar(20) NOT NULL default ''; +ALTER TABLE DebtorsMaster ADD EDIServerPwd varchar(20) NOT NULL default ''; +ALTER TABLE DebtorsMaster ADD INDEX (EDIInvoices); +ALTER TABLE DebtorsMaster ADD INDEX (EDIOrders); + +CREATE TABLE EDIItemMapping ( + SuppOrCust varchar(4) NOT NULL default '', + PartnerCode varchar(10) NOT NULL default '', + StockID varchar(20) NOT NULL default '', + PartnerStockID varchar(50) NOT NULL default '', + PRIMARY KEY (SuppOrCust,PartnerCode,StockID), + KEY PartnerCode (PartnerCode), + KEY StockID (StockID), + KEY PartnerStockID (PartnerStockID), + KEY SuppOrCust (SuppOrCust) +) TYPE=Innodb; + +CREATE TABLE EDIMessageFormat ( + PartnerCode varchar(10) NOT NULL default '', + MessageType varchar(6) NOT NULL default '', + Section varchar(7) NOT NULL default '', + SequenceNo int(11) NOT NULL default '0', + LineText varchar(70) NOT NULL default '', + PRIMARY KEY (PartnerCode,MessageType,SequenceNo), + KEY Section (Section) +) TYPE=Innodb; + + +INSERT INTO EDIMessageFormat VALUES ('DEFAULT', 'INVOIC', 'Heading', 10, 'UNH+[EDITransNo]+INVOIC:D:96A:UN:EAN008\''); +INSERT INTO EDIMessageFormat VALUES ('DEFAULT', 'INVOIC', 'Heading', 20, 'BGM+[InvOrCrd]+[TransNo]+[OrigOrDup]\''); +INSERT INTO EDIMessageFormat VALUES ('DEFAULT', 'INVOIC', 'Heading', 30, 'DTM+137:[TranDate]:102\''); +INSERT INTO EDIMessageFormat VALUES ('DEFAULT', 'INVOIC', 'Heading', 60, 'RFF+ON:[OrderNo]\''); +INSERT INTO EDIMessageFormat VALUES ('DEFAULT', 'INVOIC', 'Heading', 70, 'NAD+BY+[CustBranchCode]::92\''); +INSERT INTO EDIMessageFormat VALUES ('DEFAULT', 'INVOIC', 'Heading', 80, 'NAD+SU+[CompanyEDIReference]::91\''); +INSERT INTO EDIMessageFormat VALUES ('DEFAULT', 'INVOIC', 'Heading', 90, 'NAD+UD++[BranchName]+[BranchStreet]+[BranchCity]+[BranchState]\''); +INSERT INTO EDIMessageFormat VALUES ('DEFAULT', 'INVOIC', 'Heading', 100, 'RFF+AMT:[TaxAuthorityRef]\''); +INSERT INTO EDIMessageFormat VALUES ('DEFAULT', 'INVOIC', 'Heading', 110, 'PAT+1++5:3:D:30\''); +INSERT INTO EDIMessageFormat VALUES ('DEFAULT', 'INVOIC', 'Heading', 120, 'DTM+13:[DatePaymentDue]:102\''); +INSERT INTO EDIMessageFormat VALUES ('DEFAULT', 'INVOIC', 'Heading', 130, 'TAX+7+GST+++:::10\''); +INSERT INTO EDIMessageFormat VALUES ('DEFAULT', 'INVOIC', 'Heading', 150, 'MOA+124:[TaxTotal]\''); +INSERT INTO EDIMessageFormat VALUES ('DEFAULT', 'INVOIC', 'Detail', 160, 'LIN+[LineNumber]\''); +INSERT INTO EDIMessageFormat VALUES ('DEFAULT', 'INVOIC', 'Detail', 170, 'PIA+5+[StockID]:SA+[CustStockID]:IN\''); +INSERT INTO EDIMessageFormat VALUES ('DEFAULT', 'INVOIC', 'Detail', 180, 'IMD+F++:::[ItemDescription]\''); +INSERT INTO EDIMessageFormat VALUES ('DEFAULT', 'INVOIC', 'Heading', 85, 'NAD+IV+[CustEDIReference]::9\''); +INSERT INTO EDIMessageFormat VALUES ('DEFAULT', 'INVOIC', 'Detail', 200, 'QTY+47:[QtyInvoiced]\''); +INSERT INTO EDIMessageFormat VALUES ('DEFAULT', 'INVOIC', 'Detail', 220, 'MOA+128:[LineTotalExclTax]\''); +INSERT INTO EDIMessageFormat VALUES ('DEFAULT', 'INVOIC', 'Detail', 230, 'PRI+AAA:[UnitPrice]\''); +INSERT INTO EDIMessageFormat VALUES ('DEFAULT', 'INVOIC', 'Detail', 240, 'TAX+7+GST+++:::10\''); +INSERT INTO EDIMessageFormat VALUES ('DEFAULT', 'INVOIC', 'Detail', 250, 'MOA+124:[LineTaxAmount]\''); +INSERT INTO EDIMessageFormat VALUES ('DEFAULT', 'INVOIC', 'Summary', 260, 'UNS+S\''); +INSERT INTO EDIMessageFormat VALUES ('DEFAULT', 'INVOIC', 'Summary', 270, 'CNT+2:[NoLines]\''); +INSERT INTO EDIMessageFormat VALUES ('DEFAULT', 'INVOIC', 'Summary', 280, 'MOA+128:[TotalAmountExclTax]\''); +INSERT INTO EDIMessageFormat VALUES ('DEFAULT', 'INVOIC', 'Summary', 290, 'TAX+7+GST+++:::10\''); +INSERT INTO EDIMessageFormat VALUES ('DEFAULT', 'INVOIC', 'Summary', 300, 'MOA+128:[TaxTotal]\''); +INSERT INTO EDIMessageFormat VALUES ('DEFAULT', 'INVOIC', 'Summary', 310, 'UNT+[NoSegments]+[EDITransNo]\''); + +ALTER TABLE AccountGroups Type=Innodb; +ALTER TABLE Areas Type=Innodb; +ALTER TABLE BOM Type=Innodb; +ALTER TABLE BankAccounts Type=Innodb; +ALTER TABLE BankTrans Type=Innodb; +ALTER TABLE Buckets Type=Innodb; +ALTER TABLE COGSGLPostings Type=Innodb; +ALTER TABLE ChartMaster Type=Innodb; +ALTER TABLE Companies Type=Innodb; +ALTER TABLE ContractBOM Type=Innodb; +ALTER TABLE ContractReqts Type=Innodb; +ALTER TABLE Contracts Type=Innodb; +ALTER TABLE Currencies Type=Innodb; +ALTER TABLE CustBranch Type=Innodb; +ALTER TABLE DebtorsMaster Type=Innodb; +ALTER TABLE DiscountMatrix Type=Innodb; +ALTER TABLE FreightCosts Type=Innodb; +ALTER TABLE HoldReasons Type=Innodb; +ALTER TABLE LastCostRollUp Type=Innodb; +ALTER TABLE PaymentTerms Type=Innodb; +ALTER TABLE Prices Type=Innodb; +ALTER TABLE PurchData Type=Innodb; +ALTER TABLE ReportColumns Type=Innodb; +ALTER TABLE ReportHeaders Type=Innodb; +ALTER TABLE SalesGLPostings Type=Innodb; +ALTER TABLE SalesTypes Type=Innodb; +ALTER TABLE Salesman Type=Innodb; +ALTER TABLE ShipmentCharges Type=Innodb; +ALTER TABLE Shippers Type=Innodb; +ALTER TABLE StockCategory Type=Innodb; +ALTER TABLE StockCheckFreeze Type=Innodb; +ALTER TABLE StockCounts Type=Innodb; +ALTER TABLE SupplierContacts Type=Innodb; +ALTER TABLE Suppliers Type=Innodb; +ALTER TABLE TaxAuthorities Type=Innodb; +ALTER TABLE WORequirements Type=Innodb; +ALTER TABLE WWW_Users Type=Innodb; +ALTER TABLE WorkCentres Type=Innodb; +ALTER TABLE Locations Type=Innodb; + + +ALTER TABLE TaxAuthLevels ADD FOREIGN KEY (TaxAuthority) REFERENCES TaxAuthorities (TaxID); +ALTER TABLE TaxAuthLevels ADD FOREIGN KEY (DispatchTaxAuthority) REFERENCES TaxAuthorities (TaxID); + +ALTER TABLE BOM ADD FOREIGN KEY (Parent) REFERENCES StockMaster (StockID); +ALTER TABLE BOM ADD FOREIGN KEY (Component) REFERENCES StockMaster (StockID); +ALTER TABLE BOM ADD FOREIGN KEY (WorkCentreAdded) REFERENCES WorkCentres (Code); +ALTER TABLE BOM ADD FOREIGN KEY (LocCode) REFERENCES Locations (LocCode); + +ALTER TABLE BankAccounts ADD FOREIGN KEY (AccountCode) REFERENCES ChartMaster (AccountCode); + + +ALTER TABLE BankTrans ADD FOREIGN KEY (Type) REFERENCES SysTypes (TypeID); +ALTER TABLE BankTrans ADD FOREIGN KEY (BankAct) REFERENCES BankAccounts (AccountCode); + + +ALTER TABLE Buckets ADD FOREIGN KEY (WorkCentre) REFERENCES WorkCentres (Code); + +ALTER TABLE ChartDetails ADD FOREIGN KEY (AccountCode) REFERENCES ChartMaster (AccountCode); +ALTER TABLE ChartDetails ADD FOREIGN KEY (Period) REFERENCES Periods (PeriodNo); + + +ALTER TABLE ChartMaster ADD FOREIGN KEY (Group_) REFERENCES AccountGroups (GroupName); + + +ALTER TABLE ContractBOM ADD INDEX (WorkCentreAdded); + +ALTER TABLE ContractBOM ADD FOREIGN KEY (WorkCentreAdded) REFERENCES WorkCentres (Code); + +ALTER TABLE ContractBOM ADD FOREIGN KEY (LocCode) REFERENCES Locations (LocCode); +ALTER TABLE ContractBOM ADD FOREIGN KEY (Component) REFERENCES StockMaster (StockID); + + +ALTER TABLE ContractReqts ADD FOREIGN KEY (Contract) REFERENCES Contracts (ContractRef); + + +ALTER TABLE `Contracts` DROP INDEX `DebtorNo` , DROP INDEX `BranchCode`, ADD INDEX `DebtorNo` ( `DebtorNo` , `BranchCode` ); + +ALTER TABLE Contracts ADD FOREIGN KEY (DebtorNo, BranchCode) REFERENCES CustBranch (DebtorNo, BranchCode); +ALTER TABLE Contracts ADD FOREIGN KEY (CategoryID) REFERENCES StockCategory (CategoryID); + +ALTER TABLE Contracts ADD FOREIGN KEY (TypeAbbrev) REFERENCES SalesTypes (TypeAbbrev); + + +ALTER TABLE CustAllocns ADD FOREIGN KEY (TransID_AllocFrom) REFERENCES DebtorTrans (ID); +ALTER TABLE CustAllocns ADD FOREIGN KEY (TransID_AllocTo) REFERENCES DebtorTrans (ID); + +ALTER TABLE CustBranch ADD FOREIGN KEY (DebtorNo) REFERENCES DebtorsMaster (DebtorNo); + +ALTER TABLE CustBranch ADD INDEX (Area); +ALTER TABLE CustBranch ADD FOREIGN KEY (Area) REFERENCES Areas (AreaCode); +ALTER TABLE CustBranch ADD FOREIGN KEY (Salesman) REFERENCES Salesman (SalesmanCode); + +ALTER TABLE `CustBranch` ADD INDEX ( `DefaultLocation` ); +ALTER TABLE `CustBranch` ADD INDEX ( `TaxAuthority` ); +ALTER TABLE `CustBranch` ADD INDEX ( `DefaultShipVia` ); + +ALTER TABLE CustBranch ADD FOREIGN KEY (DefaultLocation) REFERENCES Locations (LocCode); + +ALTER TABLE `CustBranch` CHANGE `TaxAuthority` `TaxAuthority` TINYINT DEFAULT '1' NOT NULL; + +ALTER TABLE CustBranch ADD FOREIGN KEY (TaxAuthority) REFERENCES TaxAuthorities (TaxID); +ALTER TABLE CustBranch ADD FOREIGN KEY (DefaultShipVia) REFERENCES Shippers (Shipper_ID); + +ALTER TABLE DebtorTrans ADD FOREIGN KEY (DebtorNo) REFERENCES CustBranch (DebtorNo); +ALTER TABLE DebtorTrans ADD FOREIGN KEY (Type) REFERENCES SysTypes (TypeID); +ALTER TABLE DebtorTrans ADD FOREIGN KEY (Prd) REFERENCES Periods (PeriodNo); + +ALTER TABLE DebtorsMaster ADD FOREIGN KEY (HoldReason) REFERENCES HoldReasons (ReasonCode); +ALTER TABLE `DebtorsMaster` CHANGE `CurrCode` `CurrCode` VARCHAR( 3 ) NOT NULL; + +ALTER TABLE DebtorsMaster ADD FOREIGN KEY (CurrCode) REFERENCES Currencies (CurrAbrev); +ALTER TABLE DebtorsMaster ADD FOREIGN KEY (PaymentTerms) REFERENCES PaymentTerms (TermsIndicator); +ALTER TABLE DebtorsMaster ADD FOREIGN KEY (SalesType) REFERENCES SalesTypes (TypeAbbrev); +ALTER TABLE DiscountMatrix ADD FOREIGN KEY (SalesType) REFERENCES SalesTypes (TypeAbbrev); +ALTER TABLE EDIItemMapping ADD FOREIGN KEY (StockID) REFERENCES StockMaster (StockID); +ALTER TABLE FreightCosts ADD FOREIGN KEY (LocationFrom) REFERENCES Locations (LocCode); + +ALTER TABLE FreightCosts ADD FOREIGN KEY (ShipperID) REFERENCES Shippers (Shipper_ID); +ALTER TABLE GLTrans ADD FOREIGN KEY (Account) REFERENCES ChartMaster (AccountCode); +ALTER TABLE GLTrans ADD FOREIGN KEY (Type) REFERENCES SysTypes (TypeID); +ALTER TABLE GLTrans ADD FOREIGN KEY (PeriodNo) REFERENCES Periods (PeriodNo); +ALTER TABLE GRNs ADD FOREIGN KEY (SupplierID) REFERENCES Suppliers (SupplierID); +ALTER TABLE GRNs ADD FOREIGN KEY (PODetailItem) REFERENCES PurchOrderDetails (PODetailItem); + +ALTER TABLE LocStock ADD FOREIGN KEY (LocCode) REFERENCES Locations (LocCode); +ALTER TABLE LocStock ADD FOREIGN KEY (StockID) REFERENCES StockMaster (StockID); + +ALTER TABLE OrderDeliveryDifferencesLog ADD FOREIGN KEY (StockID) REFERENCES StockMaster (StockID); + +ALTER TABLE OrderDeliveryDifferencesLog ADD FOREIGN KEY (DebtorNo,Branch) REFERENCES CustBranch (DebtorNo,BranchCode); +ALTER TABLE `OrderDeliveryDifferencesLog` ADD INDEX ( `OrderNo` ); +ALTER TABLE OrderDeliveryDifferencesLog ADD FOREIGN KEY (OrderNo) REFERENCES SalesOrders (OrderNo); + +ALTER TABLE Prices ADD FOREIGN KEY (StockID) REFERENCES StockMaster (StockID); +ALTER TABLE Prices ADD FOREIGN KEY (CurrAbrev) REFERENCES Currencies (CurrAbrev); +ALTER TABLE Prices ADD FOREIGN KEY (TypeAbbrev) REFERENCES SalesTypes (TypeAbbrev); + +ALTER TABLE PurchData ADD FOREIGN KEY (StockID) REFERENCES StockMaster (StockID); +ALTER TABLE PurchData ADD FOREIGN KEY (SupplierNo) REFERENCES Suppliers (SupplierID); + +ALTER TABLE PurchOrderDetails ADD FOREIGN KEY (OrderNo) REFERENCES PurchOrders (OrderNo); + +ALTER TABLE PurchOrders ADD FOREIGN KEY (SupplierNo) REFERENCES Suppliers (SupplierID); +ALTER TABLE PurchOrders ADD FOREIGN KEY (IntoStockLocation) REFERENCES Locations (LocCode); + +ALTER TABLE ReportColumns ADD FOREIGN KEY (ReportID) REFERENCES ReportHeaders (ReportID); + +ALTER TABLE `SalesAnalysis` CHANGE `PeriodNo` `PeriodNo` SMALLINT( 6 ) DEFAULT '0' NOT NULL ; +ALTER TABLE SalesAnalysis ADD FOREIGN KEY (PeriodNo) REFERENCES Periods (PeriodNo); + +ALTER TABLE SalesOrderDetails ADD FOREIGN KEY (OrderNo) REFERENCES SalesOrders (OrderNo); +ALTER TABLE SalesOrderDetails ADD FOREIGN KEY (StkCode) REFERENCES StockMaster (StockID); + +ALTER TABLE `SalesOrders` DROP INDEX `BranchCode`; +ALTER TABLE `SalesOrders` ADD INDEX ( `BranchCode`,`DebtorNo` ); + +ALTER TABLE SalesOrders ADD FOREIGN KEY (BranchCode, DebtorNo) REFERENCES CustBranch (BranchCode, DebtorNo); +ALTER TABLE `SalesOrders` ADD INDEX ( `ShipVia` ); +ALTER TABLE SalesOrders ADD FOREIGN KEY (ShipVia) REFERENCES Shippers (Shipper_ID); +ALTER TABLE SalesOrders ADD FOREIGN KEY (FromStkLoc) REFERENCES Locations (LocCode); + +ALTER TABLE Shipments CHANGE ShiptRef ShiptRef INT(11) NOT NULL; +ALTER TABLE `ShipmentCharges` CHANGE `ShiptRef` `ShiptRef` INT( 11 ) NOT NULL; +ALTER TABLE ShipmentCharges ADD FOREIGN KEY (ShiptRef) REFERENCES Shipments (ShiptRef); +ALTER TABLE `ShipmentCharges` ADD INDEX ( `TransType` ); +ALTER TABLE ShipmentCharges ADD FOREIGN KEY (TransType) REFERENCES SysTypes (TypeID); +ALTER TABLE ShipmentCharges ADD FOREIGN KEY (StockID) REFERENCES StockMaster (StockID); + +ALTER TABLE `Shipments` ADD FOREIGN KEY (SupplierID) REFERENCES Suppliers (SupplierID); + +ALTER TABLE `StockCheckFreeze` ADD FOREIGN KEY (StockID) REFERENCES StockMaster (StockID); +ALTER TABLE `StockCheckFreeze` ADD FOREIGN KEY (LocCode) REFERENCES Locations (LocCode); + +ALTER TABLE `StockCounts` ADD FOREIGN KEY (StockID) REFERENCES StockMaster (StockID); +ALTER TABLE `StockCounts` ADD FOREIGN KEY (LocCode) REFERENCES Locations (LocCode); + +ALTER TABLE `StockMaster` ADD FOREIGN KEY (CategoryID) REFERENCES StockCategory (CategoryID); + +ALTER TABLE `StockMoves` ADD FOREIGN KEY (StockID) REFERENCES StockMaster (StockID); +ALTER TABLE `StockMoves` ADD FOREIGN KEY (Type) REFERENCES SysTypes (TypeID); +ALTER TABLE `StockMoves` ADD FOREIGN KEY (LocCode) REFERENCES Locations (LocCode); +ALTER TABLE `StockMoves` ADD FOREIGN KEY (Prd) REFERENCES Periods (PeriodNo); + +DELETE FROM SuppAllocs WHERE ID=4; + +ALTER TABLE SuppAllocs ADD FOREIGN KEY (TransID_AllocFrom) REFERENCES SuppTrans (ID); +ALTER TABLE `SuppAllocs` ADD FOREIGN KEY (TransID_AllocTo) REFERENCES SuppTrans (ID); + +ALTER TABLE `SuppTrans` ADD FOREIGN KEY (Type) REFERENCES SysTypes (TypeID); +ALTER TABLE `SuppTrans` ADD FOREIGN KEY (SupplierNo) REFERENCES Suppliers (SupplierID); +ALTER TABLE `SupplierContacts` ADD FOREIGN KEY (SupplierID) REFERENCES Suppliers (SupplierID); +ALTER TABLE `Suppliers` ADD FOREIGN KEY (CurrCode) REFERENCES Currencies (CurrAbrev); +ALTER TABLE `Suppliers` ADD FOREIGN KEY (PaymentTerms) REFERENCES PaymentTerms (TermsIndicator); + +ALTER TABLE `Suppliers` CHANGE `TaxAuthority` `TaxAuthority` TINYINT DEFAULT '1' NOT NULL; + +ALTER TABLE `Suppliers` ADD FOREIGN KEY (TaxAuthority) REFERENCES TaxAuthorities (TaxID); +ALTER TABLE `WOIssues` ADD FOREIGN KEY (WORef) REFERENCES WorksOrders (WORef); +ALTER TABLE `WOIssues` ADD FOREIGN KEY (StockID) REFERENCES StockMaster (StockID); +ALTER TABLE `WOIssues` ADD FOREIGN KEY (WorkCentre) REFERENCES WorkCentres (Code); + +ALTER TABLE `WORequirements` ADD FOREIGN KEY (WORef) REFERENCES WorksOrders (WORef); +ALTER TABLE `WORequirements` ADD FOREIGN KEY (StockID) REFERENCES StockMaster (StockID); +ALTER TABLE `WORequirements` ADD FOREIGN KEY (WrkCentre) REFERENCES WorkCentres (Code); + +ALTER TABLE `WWW_Users` ADD INDEX ( `DefaultLocation` ); + +ALTER TABLE `WWW_Users` ADD FOREIGN KEY (DefaultLocation) REFERENCES Locations (LocCode); + +ALTER TABLE `WorkCentres` ADD FOREIGN KEY (Location) REFERENCES Locations (LocCode); + +ALTER TABLE `WorksOrders` ADD FOREIGN KEY (LocCode) REFERENCES Locations (LocCode); +ALTER TABLE `WorksOrders` ADD FOREIGN KEY (StockID) REFERENCES StockMaster (StockID); + +ALTER TABLE DebtorsMaster ADD DiscountCode char(2) NOT NULL default ''; + +commit; \ No newline at end of file Added: trunk/sql/mysql/upgrade2.8-2.9.sql =================================================================== --- trunk/sql/mysql/upgrade2.8-2.9.sql (rev 0) +++ trunk/sql/mysql/upgrade2.8-2.9.sql 2010-12-29 23:18:49 UTC (rev 4455) @@ -0,0 +1,397 @@ +BEGIN; + +ALTER TABLE `BankAccounts` CHANGE `AccountCode` `AccountCode` INT( 11 ) NOT NULL; + +ALTER TABLE TaxAuthorities ADD INDEX (TaxGLCode); +ALTER TABLE TaxAuthorities ADD INDEX (PurchTaxGLAccount); + +ALTER TABLE TaxAuthorities ADD FOREIGN KEY ( TaxGLCode ) REFERENCES ChartMaster( AccountCode ); +ALTER TABLE TaxAuthorities ADD FOREIGN KEY ( PurchTaxGLAccount ) REFERENCES ChartMaster( AccountCode ); + +CREATE TABLE `EDI_ORDERS_Segs` ( + `ID` int(11) NOT NULL auto_increment, + `SegTag` char(3) NOT NULL default '', + `SegGroup` tinyint(4) NOT NULL default '0', + `MaxOccurr` tinyint(4) NOT NULL default '0', + PRIMARY KEY (`ID`), + KEY `SegTag` (`SegTag`), + KEY `SegNo` (`SegGroup`) +) TYPE=InnoDB; + +INSERT INTO `EDI_ORDERS_Segs` (`SegTag` , `SegGroup` , `MaxOccurr` ) VALUES ('UNB', '0', '1'); +INSERT INTO `EDI_ORDERS_Segs` (`SegTag` , `SegGroup` , `MaxOccurr` ) VALUES ('UNH', '0', '1'); +INSERT INTO `EDI_ORDERS_Segs` (`SegTag` , `SegGroup` , `MaxOccurr` ) VALUES ('BGM', '0', '1'); +INSERT INTO `EDI_ORDERS_Segs` (`SegTag` , `SegGroup` , `MaxOccurr` ) VALUES ('DTM', '0', '35'); +INSERT INTO `EDI_ORDERS_Segs` (`SegTag` , `SegGroup` , `MaxOccurr` ) VALUES ('PAI', '0', '1'); +INSERT INTO `EDI_ORDERS_Segs` (`SegTag` , `SegGroup` , `MaxOccurr` ) VALUES ('ALI', '0', '5'); +INSERT INTO `EDI_ORDERS_Segs` (`SegTag` , `SegGroup` , `MaxOccurr` ) VALUES ('FTX', '0', '99'); +INSERT INTO `EDI_ORDERS_Segs` (`SegTag` , `SegGroup` , `MaxOccurr` ) VALUES ('RFF', '1', '1'); +INSERT INTO `EDI_ORDERS_Segs` (`SegTag` , `SegGroup` , `MaxOccurr` ) VALUES ('DTM', '1', '5'); +INSERT INTO `EDI_ORDERS_Segs` (`SegTag` , `SegGroup` , `MaxOccurr` ) VALUES ('NAD', '2', '1'); +INSERT INTO `EDI_ORDERS_Segs` (`SegTag` , `SegGroup` , `MaxOccurr` ) VALUES ('LOC', '2', '99'); +INSERT INTO `EDI_ORDERS_Segs` (`SegTag` , `SegGroup` , `MaxOccurr` ) VALUES ('FII', '2', '5'); +INSERT INTO `EDI_ORDERS_Segs` (`SegTag` , `SegGroup` , `MaxOccurr` ) VALUES ('RFF', '3', '1'); +INSERT INTO `EDI_ORDERS_Segs` (`SegTag` , `SegGroup` , `MaxOccurr` ) VALUES ('CTA', '5', '1'); +INSERT INTO `EDI_ORDERS_Segs` (`SegTag` , `SegGroup` , `MaxOccurr` ) VALUES ('COM', '5', '5'); +INSERT INTO `EDI_ORDERS_Segs` (`SegTag` , `SegGroup` , `MaxOccurr` ) VALUES ('TAX', '6', '1'); +INSERT INTO `EDI_ORDERS_Segs` (`SegTag` , `SegGroup` , `MaxOccurr` ) VALUES ('MOA', '6', '1'); +INSERT INTO `EDI_ORDERS_Segs` (`SegTag` , `SegGroup` , `MaxOccurr` ) VALUES ('CUX', '7', '1'); +INSERT INTO `EDI_ORDERS_Segs` (`SegTag` , `SegGroup` , `MaxOccurr` ) VALUES ('DTM', '7', '5'); +INSERT INTO `EDI_ORDERS_Segs` (`SegTag` , `SegGroup` , `MaxOccurr` ) VALUES ('PAT', '8', '1'); +INSERT INTO `EDI_ORDERS_Segs` (`SegTag` , `SegGroup` , `MaxOccurr` ) VALUES ('DTM', '8', '5'); +INSERT INTO `EDI_ORDERS_Segs` (`SegTag` , `SegGroup` , `MaxOccurr` ) VALUES ('PCD', '8', '1'); +INSERT INTO `EDI_ORDERS_Segs` (`SegTag` , `SegGroup` , `MaxOccurr` ) VALUES ('MOA', '9', '1'); +INSERT INTO `EDI_ORDERS_Segs` (`SegTag` , `SegGroup` , `MaxOccurr` ) VALUES ('TDT', '10', '1'); +INSERT INTO `EDI_ORDERS_Segs` (`SegTag` , `SegGroup` , `MaxOccurr` ) VALUES ('LOC', '11', '1'); +INSERT INTO `EDI_ORDERS_Segs` (`SegTag` , `SegGroup` , `MaxOccurr` ) VALUES ('DTM', '11', '5'); +INSERT INTO `EDI_ORDERS_Segs` (`SegTag` , `SegGroup` , `MaxOccurr` ) VALUES ('TOD', '12', '1'); +INSERT INTO `EDI_ORDERS_Segs` (`SegTag` , `SegGroup` , `MaxOccurr` ) VALUES ('LOC', '12', '2'); +INSERT INTO `EDI_ORDERS_Segs` (`SegTag` , `SegGroup` , `MaxOccurr` ) VALUES ('PAC', '13', '1'); +INSERT INTO `EDI_ORDERS_Segs` (`SegTag` , `SegGroup` , `MaxOccurr` ) VALUES ('PCI', '14', '1'); +INSERT INTO `EDI_ORDERS_Segs` (`SegTag` , `SegGroup` , `MaxOccurr` ) VALUES ('RFF', '14', '1'); +INSERT INTO `EDI_ORDERS_Segs` (`SegTag` , `SegGroup` , `MaxOccurr` ) VALUES ('DTM', '14', '5'); +INSERT INTO `EDI_ORDERS_Segs` (`SegTag` , `SegGroup` , `MaxOccurr` ) VALUES ('GIN', '14', '10'); +INSERT INTO `EDI_ORDERS_Segs` (`SegTag` , `SegGroup` , `MaxOccurr` ) VALUES ('EQD', '15', '1'); +INSERT INTO `EDI_ORDERS_Segs` (`SegTag` , `SegGroup` , `MaxOccurr` ) VALUES ('ALC', '19', '1'); +INSERT INTO `EDI_ORDERS_Segs` (`SegTag` , `SegGroup` , `MaxOccurr` ) VALUES ('ALI', '19', '5'); +INSERT INTO `EDI_ORDERS_Segs` (`SegTag` , `SegGroup` , `MaxOccurr` ) VALUES ('DTM', '19', '5'); +INSERT INTO `EDI_ORDERS_Segs` (`SegTag` , `SegGroup` , `MaxOccurr` ) VALUES ('QTY', '20', '1'); +INSERT INTO `EDI_ORDERS_Segs` (`SegTag` , `SegGroup` , `MaxOccurr` ) VALUES ('RNG', '20', '1'); +INSERT INTO `EDI_ORDERS_Segs` (`SegTag` , `SegGroup` , `MaxOccurr` ) VALUES ('PCD', '21', '1'); +INSERT INTO `EDI_ORDERS_Segs` (`SegTag` , `SegGroup` , `MaxOccurr` ) VALUES ('RNG', '21', '1'); +INSERT INTO `EDI_ORDERS_Segs` (`SegTag` , `SegGroup` , `MaxOccurr` ) VALUES ('MOA', '22', '1'); +INSERT INTO `EDI_ORDERS_Segs` (`SegTag` , `SegGroup` , `MaxOccurr` ) VALUES ('RNG', '22', '1'); +INSERT INTO `EDI_ORDERS_Segs` (`SegTag` , `SegGroup` , `MaxOccurr` ) VALUES ('RTE', '23', '1'); +INSERT INTO `EDI_ORDERS_Segs` (`SegTag` , `SegGroup` , `MaxOccurr` ) VALUES ('RNG', '23', '1'); +INSERT INTO `EDI_ORDERS_Segs` (`SegTag` , `SegGroup` , `MaxOccurr` ) VALUES ('TAX', '24', '1'); +INSERT INTO `EDI_ORDERS_Segs` (`SegTag` , `SegGroup` , `MaxOccurr` ) VALUES ('MOA', '24', '1'); +INSERT INTO `EDI_ORDERS_Segs` (`SegTag` , `SegGroup` , `MaxOccurr` ) VALUES ('LIN', '28', '1'); +INSERT INTO `EDI_ORDERS_Segs` (`SegTag` , `SegGroup` , `MaxOccurr` ) VALUES ('PIA', '28', '25'); +INSERT INTO `EDI_ORDERS_Segs` (`SegTag` , `SegGroup` , `MaxOccurr` ) VALUES ('IMD', '28', '99'); +INSERT INTO `EDI_ORDERS_Segs` (`SegTag` , `SegGroup` , `MaxOccurr` ) VALUES ('MEA', '28', '99'); +INSERT INTO `EDI_ORDERS_Segs` (`SegTag` , `SegGroup` , `MaxOccurr` ) VALUES ('QTY', '28', '99'); +INSERT INTO `EDI_ORDERS_Segs` (`SegTag` , `SegGroup` , `MaxOccurr` ) VALUES ('ALI', '28', '5'); +INSERT INTO `EDI_ORDERS_Segs` (`SegTag` , `SegGroup` , `MaxOccurr` ) VALUES ('DTM', '28', '35'); +INSERT INTO `EDI_ORDERS_Segs` (`SegTag` , `SegGroup` , `MaxOccurr` ) VALUES ('MOA', '28', '10'); +INSERT INTO `EDI_ORDERS_Segs` (`SegTag` , `SegGroup` , `MaxOccurr` ) VALUES ('GIN', '28', '1000'); +INSERT INTO `EDI_ORDERS_Segs` (`SegTag` , `SegGroup` , `MaxOccurr` ) VALUES ('QVR', '28', '1'); +INSERT INTO `EDI_ORDERS_Segs` (`SegTag` , `SegGroup` , `MaxOccurr` ) VALUES ('FTX', '28', '99'); +INSERT INTO `EDI_ORDERS_Segs` (`SegTag` , `SegGroup` , `MaxOccurr` ) VALUES ('PRI', '32', '1'); +INSERT INTO `EDI_ORDERS_Segs` (`SegTag` , `SegGroup` , `MaxOccurr` ) VALUES ('CUX', '32', '1'); +INSERT INTO `EDI_ORDERS_Segs` (`SegTag` , `SegGroup` , `MaxOccurr` ) VALUES ('DTM', '32', '5'); +INSERT INTO `EDI_ORDERS_Segs` (`SegTag` , `SegGroup` , `MaxOccurr` ) VALUES ('RFF', '33', '1'); +INSERT INTO `EDI_ORDERS_Segs` (`SegTag` , `SegGroup` , `MaxOccurr` ) VALUES ('DTM', '33', '5'); +INSERT INTO `EDI_ORDERS_Segs` (`SegTag` , `SegGroup` , `MaxOccurr` ) VALUES ('PAC', '34', '1'); +INSERT INTO `EDI_ORDERS_Segs` (`SegTag` , `SegGroup` , `MaxOccurr` ) VALUES ('QTY', '34', '5'); +INSERT INTO `EDI_ORDERS_Segs` (`SegTag` , `SegGroup` , `MaxOccurr` ) VALUES ('PCI', '36', '1'); +INSERT INTO `EDI_ORDERS_Segs` (`SegTag` , `SegGroup` , `MaxOccurr` ) VALUES ('RFF', '36', '1'); +INSERT INTO `EDI_ORDERS_Segs` (`SegTag` , `SegGroup` , `MaxOccurr` ) VALUES ('DTM', '36', '5'); +INSERT INTO `EDI_ORDERS_Segs` (`SegTag` , `SegGroup` , `MaxOccurr` ) VALUES ('GIN', '36', '10'); +INSERT INTO `EDI_ORDERS_Segs` (`SegTag` , `SegGroup` , `MaxOccurr` ) VALUES ('LOC', '37', '1'); +INSERT INTO `EDI_ORDERS_Segs` (`SegTag` , `SegGroup` , `MaxOccurr` ) VALUES ('QTY', '37', '1'); +INSERT INTO `EDI_ORDERS_Segs` (`SegTag` , `SegGroup` , `MaxOccurr` ) VALUES ('DTM', '37', '5'); +INSERT INTO `EDI_ORDERS_Segs` (`SegTag` , `SegGroup` , `MaxOccurr` ) VALUES ('TAX', '38', '1'); +INSERT INTO `EDI_ORDERS_Segs` (`SegTag` , `SegGroup` , `MaxOccurr` ) VALUES ('MOA', '38', '1'); +INSERT INTO `EDI_ORDERS_Segs` (`SegTag` , `SegGroup` , `MaxOccurr` ) VALUES ('NAD', '39', '1'); +INSERT INTO `EDI_ORDERS_Segs` (`SegTag` , `SegGroup` , `MaxOccurr` ) VALUES ('CTA', '42', '1'); +INSERT INTO `EDI_ORDERS_Segs` (`SegTag` , `SegGroup` , `MaxOccurr` ) VALUES ('COM', '42', '5'); +INSERT INTO `EDI_ORDERS_Segs` (`SegTag` , `SegGroup` , `MaxOccurr` ) VALUES ('ALC', '43', '1'); +INSERT INTO `EDI_ORDERS_Segs` (`SegTag` , `SegGroup` , `MaxOccurr` ) VALUES ('ALI', '43', '5'); +INSERT INTO `EDI_ORDERS_Segs` (`SegTag` , `SegGroup` , `MaxOccurr` ) VALUES ('DTM', '43', '5'); +INSERT INTO `EDI_ORDERS_Segs` (`SegTag` , `SegGroup` , `MaxOccurr` ) VALUES ('QTY', '44', '1'); +INSERT INTO `EDI_ORDERS_Segs` (`SegTag` , `SegGroup` , `MaxOccurr` ) VALUES ('RNG', '44', '1'); +INSERT INTO `EDI_ORDERS_Segs` (`SegTag` , `SegGroup` , `MaxOccurr` ) VALUES ('PCD', '45', '1'); +INSERT INTO `EDI_ORDERS_Segs` (`SegTag` , `SegGroup` , `MaxOccurr` ) VALUES ('RNG', '45', '1'); +INSERT INTO `EDI_ORDERS_Segs` (`SegTag` , `SegGroup` , `MaxOccurr` ) VALUES ('MOA', '46', '1'); +INSERT INTO `EDI_ORDERS_Segs` (`SegTag` , `SegGroup` , `MaxOccurr` ) VALUES ('RNG', '46', '1'); +INSERT INTO `EDI_ORDERS_Segs` (`SegTag` , `SegGroup` , `MaxOccurr` ) VALUES ('RTE', '47', '1'); +INSERT INTO `EDI_ORDERS_Segs` (`SegTag` , `SegGroup` , `MaxOccurr` ) VALUES ('RNG', '47', '1'); +INSERT INTO `EDI_ORDERS_Segs` (`SegTag` , `SegGroup` , `MaxOccurr` ) VALUES ('TAX', '48', '1'); +INSERT INTO `EDI_ORDERS_Segs` (`SegTag` , `SegGroup` , `MaxOccurr` ) VALUES ('MOA', '48', '1'); +INSERT INTO `EDI_ORDERS_Segs` (`SegTag` , `SegGroup` , `MaxOccurr` ) VALUES ('TDT', '49', '1'); +INSERT INTO `EDI_ORDERS_Segs` (`SegTag` , `SegGroup` , `MaxOccurr` ) VALUES ('UNS', '0', '1'); +INSERT INTO `EDI_ORDERS_Segs` (`SegTag` , `SegGroup` , `MaxOccurr` ) VALUES ('MOA', '0', '1'); +INSERT INTO `EDI_ORDERS_Segs` (`SegTag` , `SegGroup` , `MaxOccurr` ) VALUES ('CNT', '0', '1'); +INSERT INTO `EDI_ORDERS_Segs` (`SegTag` , `SegGroup` , `MaxOccurr` ) VALUES ('UNT', '0', '1'); + +CREATE TABLE `EDI_ORDERS_Seg_Groups` ( + `SegGroupNo` tinyint(4) NOT NULL default '0', + `MaxOccurr` int(4) NOT NULL default '0', + `ParentSegGroup` tinyint(4) NOT NULL default '0', + PRIMARY KEY (`SegGroupNo`) +) TYPE=InnoDB; + + +INSERT INTO `EDI_ORDERS_Seg_Groups` VALUES (0, 1, 0); +INSERT INTO `EDI_ORDERS_Seg_Groups` VALUES (1, 9999, 0); +INSERT INTO `EDI_ORDERS_Seg_Groups` VALUES (2, 99, 0); +INSERT INTO `EDI_ORDERS_Seg_Groups` VALUES (3, 99, 2); +INSERT INTO `EDI_ORDERS_Seg_Groups` VALUES (5, 5, 2); +INSERT INTO `EDI_ORDERS_Seg_Groups` VALUES (6, 5, 0); +INSERT INTO `EDI_ORDERS_Seg_Groups` VALUES (7, 5, 0); +INSERT INTO `EDI_ORDERS_Seg_Groups` VALUES (8, 10, 0); +INSERT INTO `EDI_ORDERS_Seg_Groups` VALUES (9, 9999, 8); +INSERT INTO `EDI_ORDERS_Seg_Groups` VALUES (10, 10, 0); +INSERT INTO `EDI_ORDERS_Seg_Groups` VALUES (11, 10, 10); +INSERT INTO `EDI_ORDERS_Seg_Groups` VALUES (12, 5, 0); +INSERT INTO `EDI_ORDERS_Seg_Groups` VALUES (13, 99, 0); +INSERT INTO `EDI_ORDERS_Seg_Groups` VALUES (14, 5, 13); +INSERT INTO `EDI_ORDERS_Seg_Groups` VALUES (15, 10, 0); +INSERT INTO `EDI_ORDERS_Seg_Groups` VALUES (19, 99, 0); +INSERT INTO `EDI_ORDERS_Seg_Groups` VALUES (20, 1, 19); +INSERT INTO `EDI_ORDERS_Seg_Groups` VALUES (21, 1, 19); +INSERT INTO `EDI_ORDERS_Seg_Groups` VALUES (22, 2, 19); +INSERT INTO `EDI_ORDERS_Seg_Groups` VALUES (23, 1, 19); +INSERT INTO `EDI_ORDERS_Seg_Groups` VALUES (24, 5, 19); +INSERT INTO `EDI_ORDERS_Seg_Groups` VALUES (28, 200000, 0); +INSERT INTO `EDI_ORDERS_Seg_Groups` VALUES (32, 25, 28); +INSERT INTO `EDI_ORDERS_Seg_Groups` VALUES (33, 9999, 28); +INSERT INTO `EDI_ORDERS_Seg_Groups` VALUES (34, 99, 28); +INSERT INTO `EDI_ORDERS_Seg_Groups` VALUES (36, 5, 34); +INSERT INTO `EDI_ORDERS_Seg_Groups` VALUES (37, 9999, 28); +INSERT INTO `EDI_ORDERS_Seg_Groups` VALUES (38, 10, 28); +INSERT INTO `EDI_ORDERS_Seg_Groups` VALUES (39, 999, 28); +INSERT INTO `EDI_ORDERS_Seg_Groups` VALUES (42, 5, 39); +INSERT INTO `EDI_ORDERS_Seg_Groups` VALUES (43, 99, 28); +INSERT INTO `EDI_ORDERS_Seg_Groups` VALUES (44, 1, 43); +INSERT INTO `EDI_ORDERS_Seg_Groups` VALUES (45, 1, 43); +INSERT INTO `EDI_ORDERS_Seg_Groups` VALUES (46, 2, 43); +INSERT INTO `EDI_ORDERS_Seg_Groups` VALUES (47, 1, 43); +INSERT INTO `EDI_ORDERS_Seg_Groups` VALUES (48, 5, 43); +INSERT INTO `EDI_ORDERS_Seg_Groups` VALUES (49, 10, 28); + + +CREATE TABLE `LocTransfers` ( + `Reference` int(11) NOT NULL default '0', + `StockID` varchar(20) NOT NULL default '', + `ShipQty` int(11) NOT NULL default '0', + `RecQty` int(11) NOT NULL default '0', + `ShipDate` date NOT NULL default '0000-00-00', + `RecDate` date NOT NULL default '0000-00-00', + `ShipLoc` varchar(7) NOT NULL default '', + `RecLoc` varchar(7) NOT NULL default '', + KEY `Reference` (`Reference`,`StockID`), + KEY `ShipLoc` (`ShipLoc`), + KEY `RecLoc` (`RecLoc`), + KEY `StockID` (`StockID`) +) TYPE=InnoDB COMMENT='Stores Transfers To Other Locations'; + +ALTER TABLE `LocTransfers` + ADD CONSTRAINT `LocTransfers_ibfk_3` FOREIGN KEY (`StockID`) REFERENCES `StockMaster` (`StockID`), + ADD CONSTRAINT `LocTransfers_ibfk_1` FOREIGN KEY (`ShipLoc`) REFERENCES `Locations` (`LocCode`), + ADD CONSTRAINT `LocTransfers_ibfk_2` FOREIGN KEY (`RecLoc`) REFERENCES `Locations` (`LocCode`); + +CREATE TABLE StockSerialItems ( + LocCode varchar(5) NOT NULL default '', + StockID varchar(20) NOT NULL default '', + SerialNo varchar(30) NOT NULL default '', + Quantity float NOT NULL default 0, + PRIMARY KEY (StockID, SerialNo, LocCode), + KEY (StockID), + KEY (LocCode) +) TYPE=InnoDB; + +CREATE TABLE StockSerialMoves ( + StkItmMoveNo int(11) NOT NULL auto_increment, + StockMoveNo int(11) NOT NULL default '0', + StockID varchar(20) NOT NULL default '', + SerialNo varchar(30) NOT NULL default '', + MoveQty float NOT NULL default '0', + PRIMARY KEY (StkItmMoveNo), + KEY StockMoveNo (StockMoveNo), + KEY StockID_SN (StockID, SerialNo) +) TYPE=InnoDB; + +ALTER TABLE StockSerialMoves ADD FOREIGN KEY (StockMoveNo) REFERENCES StockMoves (StkMoveNo); +ALTER TABLE StockSerialItems ADD FOREIGN KEY (StockID) REFERENCES StockMaster (StockID); +ALTER TABLE StockSerialItems ADD FOREIGN KEY (LocCode) REFERENCES Locations (LocCode); +ALTER TABLE StockSerialMoves ADD FOREIGN KEY (StockID, SerialNo) REFERENCES StockSerialItems (StockID, SerialNo); + +ALTER TABLE `StockMaster` ADD `Serialised` TINYINT DEFAULT '0' NOT NULL ; +ALTER TABLE `StockMaster` ADD `DecimalPlaces` TINYINT DEFAULT '0' NOT NULL ; +ALTER TABLE `StockMoves` DROP `Bundle`; + +CREATE TABLE `Help` ( + ID INT NOT NULL AUTO_INCREMENT, + PageID SMALLINT NOT NULL, + Narrative TEXT NOT NULL, + HelpType CHAR NOT NULL DEFAULT 'U', + PRIMARY KEY (`ID`), + INDEX (`PageID`), + INDEX (`HelpType`) +)TYPE=InnoDB COMMENT='Context Sensitive Help Narrative'; + +CREATE TABLE Scripts ( + PageID smallint(4) NOT NULL default '0', + FileName varchar(50) NOT NULL default '', + PageDescription text NOT NULL, + PRIMARY KEY (PageID), + KEY FileName (FileName) +) TYPE=InnoDB COMMENT='Index of all scripts'; + + +ALTER TABLE Help ADD FOREIGN KEY (PageID) REFERENCES Scripts (PageID); + +INSERT INTO Scripts VALUES (1, 'AccountGroups.php', 'Defines the groupings of general ledger accounts'); +INSERT INTO Scripts VALUES (2, 'AgedDebtors.php', 'Lists customer account balances in detail or summary in selected currency'); +INSERT INTO Scripts VALUES (3, 'AgedSuppliers.php', 'Lists supplier account balances in detail or summary in selected currency'); +INSERT INTO Scripts VALUES (4, 'Areas.php', 'Defines the sales areas - all customers must belong to a sales area for the purposes of sales analysis'); +INSERT INTO Scripts VALUES (5, 'BOMInquiry.php', 'Displays the bill of material with cost information'); +INSERT INTO Scripts VALUES (6, 'BOMListing.php', 'Lists the bills of material for a selected range of items'); +INSERT INTO Scripts VALUES (7, 'BOMs.php', 'Administers the bills of material for a selected item'); +INSERT INTO Scripts VALUES (8, 'BankAccounts.php', 'Defines the general ledger code for bank accounts and specifies that bank transactions be created for these accounts for the purposes of reconciliation'); +INSERT INTO Scripts VALUES (9, 'BankMatching.php', 'Allows payments and receipts to be matched off against bank statements'); +INSERT INTO Scripts VALUES (10, 'BankReconciliation.php', 'Displays the bank reconciliation for a selected bank account'); +INSERT INTO Scripts VALUES (11, 'COGSGLPostings.php', 'Defines the general ledger account to be used for cost of sales entries'); +INSERT INTO Scripts VALUES (12, 'CompanyPreferences.php', 'Defines the settings applicable for the company, including name, address, tax authority reference, whether GL integration used etc.'); +INSERT INTO Scripts VALUES (13, 'ConfirmDispatchControlled_Invoice.php', 'Specifies the batch references/serial numbers of items dispatched that are being invoiced'); +INSERT INTO Scripts VALUES (14, 'ConfirmDispatch_Invoice.php', 'Creates sales invoices from entered sales orders based on the quantities dispatched that can be modified'); +INSERT INTO Scripts VALUES (15, 'CreditItemsControlled.php', 'Specifies the batch references/serial numbers of items being credited back into stock'); +INSERT INTO Scripts VALUES (16, 'CreditStatus.php', 'Defines the credit status records. Each customer account is given a credit status from this table. Some credit status records can prohibit invoicing and new orders being entered.'); +INSERT INTO Scripts VALUES (17, 'Credit_Invoice.php', 'Creates a credit note based on the details of an existing invoice'); +INSERT INTO Scripts VALUES (18, 'Currencies.php', 'Defines the currencies available. Each customer and supplier must be defined as transacting in one of the currencies defined here.'); +INSERT INTO Scripts VALUES (19, 'CustEDISetup.php', 'Allows the set up the customer specified EDI parameters for server, email or ftp.'); +INSERT INTO Scripts VALUES (20, 'CustWhereAlloc.php', 'Shows to which invoices a receipt was allocated to'); +INSERT INTO Scripts VALUES (21, 'CustomerAllocations.php', 'Allows customer receipts and credit notes to be allocated to sales invoices'); +INSERT INTO Scripts VALUES (22, 'CustomerBranches.php', 'Defines the details of customer branches such as delivery address and contact details - also sales area, representative etc'); +INSERT INTO Scripts VALUES (23, 'CustomerInquiry.php', 'Shows the customers account transactions with balances outstanding, links available to drill down to invoice/credit note or email invoices/credit notes'); +INSERT INTO Scripts VALUES (24, 'CustomerReceipt.php', 'Entry of both customer receipts against accounts receivable and also general ledger or nominal receipts'); +INSERT INTO Scripts VALUES (25, 'CustomerTransInquiry.php', 'Lists in html the sequence of customer transactions, invoices, credit notes or receipts by a user entered date range'); +INSERT INTO Scripts VALUES (26, 'Customers.php', 'Defines the setup of a customer account, including payment terms, billing address, credit status, currency etc'); +INSERT INTO Scripts VALUES (27, 'DeliveryDetails.php', 'Used during order entry to allow the entry of delivery addresses other than the defaulted branch delivery address and information about carrier/shipping method etc'); +INSERT INTO Scripts VALUES (28, 'DiscountCategories.php', 'Defines the items belonging to a discount category. Discount Categories are used to allow discounts based on quantities across a range of producs'); +INSERT INTO Scripts VALUES (29, 'DiscountMatrix.php', 'Defines the rates of discount applicable to discount categories and the customer groupings to which the rates are to apply'); +INSERT INTO Scripts VALUES (30, 'EDIMessageFormat.php', 'Specifies the EDI message format used by a customer - administrator use only.'); +INSERT INTO Scripts VALUES (31, 'EDIProcessOrders.php', 'Processes incoming EDI orders into sales orders'); +INSERT INTO Scripts VALUES (32, 'EDISendInvoices.php', 'Processes invoiced EDI customer invoices into EDI messages and sends using the customers preferred method either ftp or email attachments.'); +INSERT INTO Scripts VALUES (33, 'EmailCustTrans.php', 'Emails selected invoice or credit to the customer'); +INSERT INTO Scripts VALUES (34, 'FTP_RadioBeacon.php', 'FTPs sales orders for dispatch to a radio beacon software enabled warehouse dispatching facility'); +INSERT INTO Scripts VALUES (35, 'FreightCosts.php', 'Defines the setup of the freight cost using different shipping methods to different destinations. The system can use this information to calculate applicable freight if the items are defined with the correct kgs and cubic volume'); +INSERT INTO Scripts VALUES (36, 'GLAccountInquiry.php', 'Shows the general ledger transactions for a specified account over a specified range of periods'); +INSERT INTO Scripts VALUES (37, 'GLAccounts.php', 'Defines the general ledger accounts'); +INSERT INTO Scripts VALUES (38, 'GLBalanceSheet.php', 'Shows the balance sheet for the company as at a specified date'); +INSERT INTO Scripts VALUES (39, 'GLCodesInquiry.php', 'Shows the list of general ledger codes defined with account names and groupings'); +INSERT INTO Scripts VALUES (40, 'GLJournal.php', 'Entry of general ledger journals, periods are calculated based on the date entered here'); +INSERT INTO Scripts VALUES (41, 'GLProfit_Loss.php', 'Shows the profit and loss of the company for the range of periods entered'); +INSERT INTO Scripts VALUES (42, 'GLTransInquiry.php', 'Shows the general ledger journal created for the sub ledger transaction specified'); +INSERT INTO Scripts VALUES (43, 'GLTrialBalance.php', 'Shows the trial balance for the month and the for the period selected together with the budgeted trial balances'); +INSERT INTO Scripts VALUES (44, 'GoodsReceived.php', 'Entry of items received against purchase orders'); +INSERT INTO Scripts VALUES (45, 'GoodsReceivedControlled.php', 'Entry of the serial numbers or batch references for controlled items received against purchase orders'); +INSERT INTO Scripts VALUES (46, 'InventoryPlanning.php', 'Creates a pdf report showing the last 4 months use of items including as a component of assemblies together with stock quantity on hand, current demand for the item and current quantity on sales order.'); +INSERT INTO Scripts VALUES (47, 'InventoryValuation.php', 'Creates a pdf report showing the value of stock at standard cost for a range of product categories selected'); +INSERT INTO Scripts VALUES (48, 'Locations.php', 'Defines the inventory stocking locations or warehouses'); +INSERT INTO Scripts VALUES (49, 'Logout.php', 'Shows when the user logs out of webERP'); +INSERT INTO Scripts VALUES (50, 'MailInventoryValuation.php', 'Meant to be run as a scheduled process to email the stock valuation off to a specified person. Creates the same stock valuation report as InventoryValuation.php'); +INSERT INTO Scripts VALUES (51, 'MailSalesReport.php', 'Creates a sales analysis pdf report and emails it to the defined receipients. This script is meant to be run as a scheduled process for daily or weekly sales reporting'); +INSERT INTO Scripts VALUES (52, 'MailSalesReport_csv.php', 'Creates a sales analysis report as a comma separated values (csv) file and emails it to the defined receipients. This script is meant to be run as a scheduled process for daily or weekly sales reporting'); +INSERT INTO Scripts VALUES (53, 'OrderDetails.php', 'Shows the detail of a sales order'); +INSERT INTO Scripts VALUES (54, 'OutstandingGRNs.php', 'Creates a pdf showing all GRNs for which there has been no purchase invoice matched off against.'); +INSERT INTO Scripts VALUES (55, 'PDFBankingSummary.php', 'Creates a pdf showing the amounts entered as receipts on a specified date together with references for the purposes of banking'); +INSERT INTO Scripts VALUES (56, 'PDFChequeListing.php', 'Creates a pdf showing all payments that have been made from a specified bank account over a specified period. This can be emailed to an email account defined in config.php - ie a financial controller'); +INSERT INTO Scripts VALUES (57, 'PDFDeliveryDifferences.php', 'Creates a pdf report listing the delivery differences from what the customer requested as recorded in the order entry. The report calculates a percentage of order fill based on the number of orders filled in full on time'); +INSERT INTO Scripts VALUES (58, 'PDFLowGP.php', 'Creates a pdf report showing the low gross profit sales made in the selected date range. The percentage of gp deemed acceptable can also be entered'); +INSERT INTO Scripts VALUES (59, 'PDFPriceList.php', 'Creates a pdf of the price list applicable to a given sales type and customer. Also allows the listing of prices specific to a customer'); +INSERT INTO Scripts VALUES (60, 'PDFStockCheckComparison.php', 'Creates a pdf comparing the quantites entered as counted at a given range of locations against the quantity stored as on hand as at the time a stock check was initiated.'); +INSERT INTO Scripts VALUES (61, 'PDFStockLocTransfer.php', 'Creates a stock location transfer docket for the selected location transfer reference number'); +INSERT INTO Scripts VALUES (62, 'PO_Chk_ShiptRef_JobRef.php', 'Checks the Shipment of JobReference number is correct during AP invoice entry'); +INSERT INTO Scripts VALUES (63, 'PO_Header.php', 'Entry of a purchase order header record - date, references buyer etc'); +INSERT INTO Scripts VALUES (64, 'PO_Items.php', 'Entry of a purchase order items - allows entry of items with lookup of currency cost from Purchasing Data previously entered also allows entry of nominal items against a general ledger code if the AP is integrated to the GL'); +INSERT INTO Scripts VALUES (65, 'PO_OrderDetails.php', 'Purchase order inquiry shows the quantity received and invoiced of purchase order items as well as the header information'); +INSERT INTO Scripts VALUES (66, 'PO_PDFPurchOrder.php', 'Creates a pdf of the selected purchase order for printing or email to one of the supplier contacts entered'); +INSERT INTO Scripts VALUES (67, 'PO_SelectOSPurchOrder.php', 'Shows the outstanding purchase orders for selecting with links to receive or modify the purchase order header and items'); +INSERT INTO Scripts VALUES (68, 'PO_SelectPurchOrder.php', 'Allows selection of any purchase order with links to the inquiry'); +INSERT INTO Scripts VALUES (69, 'PaymentTerms.php', 'Defines the payment terms records, these can be expressed as either a number of days credit or a day in the following month. All customers and suppliers must have a corresponding payment term recorded against their account'); +INSERT INTO Scripts VALUES (70, 'Payments.php', 'Entry of bank account payments either against an AP account or a general ledger payment - if the AP-GL link in company preferences is set'); +INSERT INTO Scripts VALUES (71, 'PeriodsInquiry.php', 'Shows a list of all the system defined periods'); +INSERT INTO Scripts VALUES (72, 'Prices.php', 'Entry of prices for a selected item also allows selection of sales type and currency for the price'); +INSERT INTO Scripts VALUES (73, 'Prices_Customer.php', 'Entry of prices for a selected item and selected customer/branch. The currency and sales type is defaulted from the customer\'s record'); +INSERT INTO Scripts VALUES (74, 'PrintCustOrder.php', 'Creates a pdf of the dispatch note - by default this is expected to be on two part pre-printed stationery to allow pickers to note discrepancies for the confirmer to update the dispatch at the time of invoicing'); +INSERT INTO Scripts VALUES (75, 'PrintCustOrder_generic.php', 'Creates two copies of a laser printed dispatch note - both copies need to be written on by the pickers with any discrepancies to advise customer of any shortfall and on the office copy to ensure the correct quantites are invoiced'); +INSERT INTO Scripts VALUES (76, 'PrintCustStatements.php', 'Creates a pdf for the customer statements in the selected range'); +INSERT INTO Scripts VALUES (77, 'PrintCustTrans.php', 'Creates either a html invoice or credit note or a pdf. A range of invoices or credit notes can be selected also.'); +INSERT INTO Scripts VALUES (78, 'PurchData.php', 'Entry of supplier purchasing data, the suppliers part reference and the suppliers currency cost of the item'); +INSERT INTO Scripts VALUES (79, 'ReverseGRN.php', 'Reverses the entry of goods received - creating stock movements back out and necessary general ledger journals to effect the reversal'); +INSERT INTO Scripts VALUES (80, 'SalesAnalReptCols.php', 'Entry of the definition of a sales analysis report\'s columns.'); +INSERT INTO Scripts VALUES (81, 'SalesAnalRepts.php', 'Entry of the definition of a sales analysis report headers'); +INSERT INTO Scripts VALUES (82, 'SalesAnalysis_UserDefined.php', 'Creates a pdf of a selected user defined sales analysis report'); +INSERT INTO Scripts VALUES (83, 'SalesGLPostings.php', 'Defines the general ledger accounts used to post sales to based on product categories and sales areas'); +INSERT INTO Scripts VALUES (84, 'SalesPeople.php', 'Defines the sales people of the business'); +INSERT INTO Scripts VALUES (85, 'SalesTypes.php', 'Defines the sales types - prices are held against sales types they can be considered price lists. Sales analysis records are held by sales type too.'); +INSERT INTO Scripts VALUES (86, 'SelectCompletedOrder.php', 'Allows the selection of completed sales orders for inquiries - choices to select by item code or customer'); +INSERT INTO Scripts VALUES (87, 'SelectCreditItems.php', 'Entry of credit notes from scratch, selecting the items in either quick entry mode or searching for them manually'); +INSERT INTO Scripts VALUES (88, 'SelectCustomer.php', 'Selection of customer - from where all customer related maintenance, transactions and inquiries start'); +INSERT INTO Scripts VALUES (89, 'SelectGLAccount.php', 'Selection of general ledger account from where all general ledger account maintenance, or inquiries are initiated'); +INSERT INTO Scripts VALUES (90, 'SelectOrderItems.php', 'Entry of sales order items with both quick entry and part search functions'); +INSERT INTO Scripts VALUES (91, 'SelectProduct.php', 'Selection of items. All item maintenance, transactions and inquiries start with this script'); +INSERT INTO Scripts VALUES (92, 'SelectSalesOrder.php', 'Selects a sales order irrespective of completed or not for inquiries'); +INSERT INTO Scripts VALUES (93, 'SelectSupplier.php', 'Selects a supplier. A supplier is required to be selected before any AP transactions and before any maintenance or inquiry of the supplier'); +INSERT INTO Scripts VALUES (94, 'ShipmentCosting.php', 'Shows the costing of a shipment with all the items invoice values and any shipment costs apportioned. Updating the shipment has an option to update standard costs of all items on the shipment and create any general ledger variance journals'); +INSERT INTO Scripts VALUES (95, 'Shipments.php', 'Entry of shipments from outstanding purchase orders for a selected supplier - changes in the delivery date will cascade into the different purchase orders on the shipment'); +INSERT INTO Scripts VALUES (96, 'Shippers.php', 'Defines the shipping methods available. Each customer branch has a default shipping method associated with it which must match a record from this table'); +INSERT INTO Scripts VALUES (97, 'Shipt_Select.php', 'Selection of a shipment for displaying and modification or updating'); +INSERT INTO Scripts VALUES (98, 'ShiptsList.php', 'Shows a list of all the open shipments for a selected supplier. Linked from POItems.php'); +INSERT INTO Scripts VALUES (99, 'SpecialOrder.php', 'Allows for a sales order to be created and an indent order to be created on a supplier for a one off item that may never be purchased again. A dummy part is created based on the description and cost details given.'); +INSERT INTO Scripts VALUES (100, 'StockAdjustments.php', 'Entry of quantity corrections to stocks in a selected location.'); +INSERT INTO Scripts VALUES (101, 'StockAdjustmentsControlled.php', 'Entry of batch references or serial numbers on controlled stock items being adjusted'); +INSERT INTO Scripts VALUES (102, 'StockCategories.php', 'Defines the stock categories. All items must refer to one of these categories. The category record also allows the specification of the general ledger codes where stock items are to be posted - the balance sheet account and the profit and loss effect of any adjustments and the profit and loss effect of any price variances'); +INSERT INTO Scripts VALUES (103, 'StockCheck.php', 'Allows creation of a stock check file - copying the current quantites in stock for later comparison to the entered counts. Also produces a pdf for the count sheets.'); +INSERT INTO Scripts VALUES (104, 'StockCostUpdate.php', 'Allows update of the standard cost of items producing general ledger journals if the company preferences stock GL interface is active'); +INSERT INTO Scripts VALUES (105, 'StockCounts.php', 'Allows entry of stock counts'); +INSERT INTO Scripts VALUES (106, 'StockLocMovements.php', 'Inquiry shows the Movements of all stock items for a specified location'); +INSERT INTO Scripts VALUES (107, 'StockLocQties_csv.php', 'Makes a comma separated values (CSV)file of the stock item codes and quantities'); +INSERT INTO Scripts VALUES (108, 'StockLocStatus.php', 'Shows the stock on hand together with outstanding sales orders and outstanding purchase orders by stock location for all items in the selected stock category'); +INSERT INTO Scripts VALUES (109, 'StockLocTransfer.php', 'Entry of a bulk stock location transfer for many parts from one location to another.'); +INSERT INTO Scripts VALUES (110, 'StockLocTransferReceive.php', 'Effects the transfer and creates the stock movements for a bulk stock location transfer initiated from StockLocTransfer.php'); +INSERT INTO Scripts VALUES (111, 'StockMovements.php', 'Shows a list of all the stock movements for a selected item and stock location including the price at which they were sold in local currency and the price at which they were purchased for in local currency'); +INSERT INTO Scripts VALUES (112, 'StockQties_csv.php', 'Makes a comma separated values (CSV)file of the stock item codes and quantities'); +INSERT INTO Scripts VALUES (113, 'StockReorderLevel.php', 'Entry and review of the re-order level of items by stocking location'); +INSERT INTO Scripts VALUES (114, 'StockSerialItems.php', 'Shows a list of the serial numbers or the batch references and quantities of controlled items. This inquiry is linked from the stock status inquiry'); +INSERT INTO Scripts VALUES (115, 'StockStatus.php', 'Shows the stock on hand together with outstanding sales orders and outstanding purchase orders by stock location for a selected part. Has a link to show the serial numbers in stock at the location selected if the item is controlled'); +INSERT INTO Scripts VALUES (116, 'StockTransferControlled.php', 'Entry of serial numbers/batch references for controlled items being received on a stock transfer. The script is used by both bulk transfers and point to point transfers'); +INSERT INTO Scripts VALUES (117, 'StockTransfers.php', 'Entry of point to point stock location transfers of a single part'); +INSERT INTO Scripts VALUES (118, 'StockUsage.php', 'Inquiry showing the quantity of stock used by period calculated from the sum of the stock movements over that period - by item and stock location. Also available over all locations'); +INSERT INTO Scripts VALUES (119, 'Stocks.php', 'Defines an item - maintenance and addition of new parts'); +INSERT INTO Scripts VALUES (120, 'SuppCreditGRNs.php', 'Entry of a supplier credit notes (debit notes) against existing GRN which have already been matched in full or in part'); +INSERT INTO Scripts VALUES (121, 'SuppInvGRNs.php', 'Entry of supplier invoices against goods received'); +INSERT INTO Scripts VALUES (122, 'SuppPaymentRun.php', 'Automatic creation of payment records based on calculated amounts due from AP invoices entered'); +INSERT INTO Scripts VALUES (123, 'SuppShiptChgs.php', 'Entry of supplier invoices against shipments as charges against a shipment'); +INSERT INTO Scripts VALUES (124, 'SuppTransGLAnalysis.php', 'Entry of supplier invoices against general ledger codes'); +INSERT INTO Script... [truncated message content] |
From: <dai...@us...> - 2010-12-30 05:46:55
|
Revision: 4456 http://web-erp.svn.sourceforge.net/web-erp/?rev=4456&view=rev Author: daintree Date: 2010-12-30 05:46:48 +0000 (Thu, 30 Dec 2010) Log Message: ----------- Upgrade changes Modified Paths: -------------- trunk/MRP.php trunk/PageSecurity.php trunk/UpgradeDatabase.php trunk/includes/ConnectDB.inc trunk/includes/GetConfig.php trunk/includes/session.inc trunk/sql/mysql/upgrade3.11.1-4.00.sql Modified: trunk/MRP.php =================================================================== --- trunk/MRP.php 2010-12-29 23:18:49 UTC (rev 4455) +++ trunk/MRP.php 2010-12-30 05:46:48 UTC (rev 4456) @@ -24,17 +24,15 @@ $result = DB_query('DROP TABLE IF EXISTS bomlevels',$db); $result = DB_query('DROP TABLE IF EXISTS levels',$db); - $sql = 'CREATE TEMPORARY TABLE passbom ( - part char(20), - sortpart text) DEFAULT CHARSET=utf8'; + $sql = 'CREATE TEMPORARY TABLE passbom (part char(20), + sortpart text) DEFAULT CHARSET=utf8'; $ErrMsg = _('The SQL to to create passbom failed with the message'); $result = DB_query($sql,$db,$ErrMsg); - $sql = 'CREATE TEMPORARY TABLE tempbom ( - parent char(20), - component char(20), - sortpart text, - level int) DEFAULT CHARSET=utf8'; + $sql = 'CREATE TEMPORARY TABLE tempbom (parent char(20), + component char(20), + sortpart text, + level int) DEFAULT CHARSET=utf8'; $result = DB_query($sql,$db,_('Create of tempbom failed because')); // To create levels, first, find parts in bom that are top level assemblies. // Do this by doing a LEFT JOIN from bom to bom (as bom2), linking @@ -47,10 +45,10 @@ flush(); // This finds the top level $sql = 'INSERT INTO passbom (part, sortpart) - SELECT bom.component AS part, - CONCAT(bom.parent,"%",bom.component) AS sortpart - FROM bom LEFT JOIN bom as bom2 ON bom.parent = bom2.component - WHERE bom2.component IS NULL'; + SELECT bom.component AS part, + CONCAT(bom.parent,"%",bom.component) AS sortpart + FROM bom LEFT JOIN bom as bom2 ON bom.parent = bom2.component + WHERE bom2.component IS NULL'; $result = DB_query($sql,$db); $lctr = 2; @@ -82,9 +80,8 @@ $result = DB_query('ALTER TABLE passbom RENAME AS passbom2',$db); $result = DB_query('DROP TABLE IF EXISTS passbom',$db); - $sql = 'CREATE TEMPORARY TABLE passbom ( - part char(20), - sortpart text) DEFAULT CHARSET=utf8'; + $sql = 'CREATE TEMPORARY TABLE passbom (part char(20), + sortpart text) DEFAULT CHARSET=utf8'; $result = DB_query($sql,$db); $sql = "INSERT INTO passbom (part, sortpart) @@ -96,8 +93,8 @@ $sql = 'SELECT COUNT(*) FROM bom - INNER JOIN passbom ON bom.parent = passbom.part - GROUP BY bom.parent'; + INNER JOIN passbom ON bom.parent = passbom.part + GROUP BY bom.parent'; $result = DB_query($sql,$db); $myrow = DB_fetch_row($result); @@ -144,23 +141,23 @@ eoq double NOT NULL default "0") DEFAULT CHARSET=utf8'; $result = DB_query($sql,$db); $sql = 'INSERT INTO levels (part, - level, - leadtime, - pansize, - shrinkfactor, - eoq) - SELECT bomlevels.part, - MAX(bomlevels.level), - 0, - pansize, - shrinkfactor, - stockmaster.eoq - FROM bomlevels - INNER JOIN stockmaster ON bomlevels.part = stockmaster.stockid - GROUP BY bomlevels.part, - pansize, - shrinkfactor, - stockmaster.eoq'; + level, + leadtime, + pansize, + shrinkfactor, + eoq) + SELECT bomlevels.part, + MAX(bomlevels.level), + 0, + pansize, + shrinkfactor, + stockmaster.eoq + FROM bomlevels + INNER JOIN stockmaster ON bomlevels.part = stockmaster.stockid + GROUP BY bomlevels.part, + pansize, + shrinkfactor, + stockmaster.eoq'; $result = DB_query($sql,$db); $sql = 'ALTER TABLE levels ADD INDEX part(part)'; $result = DB_query($sql,$db); @@ -188,15 +185,15 @@ // Update leadtime in levels from purchdata. Do it twice so can make sure leadtime from preferred // vendor is used $sql = 'UPDATE levels,purchdata - SET levels.leadtime = purchdata.leadtime - WHERE levels.part = purchdata.stockid - AND purchdata.leadtime > 0'; + SET levels.leadtime = purchdata.leadtime + WHERE levels.part = purchdata.stockid + AND purchdata.leadtime > 0'; $result = DB_query($sql,$db); $sql = 'UPDATE levels,purchdata - SET levels.leadtime = purchdata.leadtime - WHERE levels.part = purchdata.stockid - AND purchdata.preferred = 1 - AND purchdata.leadtime > 0'; + SET levels.leadtime = purchdata.leadtime + WHERE levels.part = purchdata.stockid + AND purchdata.preferred = 1 + AND purchdata.leadtime > 0'; $result = DB_query($sql,$db); prnMsg(_('Levels table has been created'),'info'); @@ -222,105 +219,100 @@ // requirement left and have to pass that down to the BOM parts using the // CreateLowerLevelRequirement() function. Mostly do this so can distinguish the type // of requirements for the MRPShortageReport so don't show double requirements. - $sql = 'CREATE TABLE mrprequirements ( - part char(20), - daterequired date, - quantity double, - mrpdemandtype varchar(6), - orderno int(11), - directdemand smallint, - whererequired char(20)) DEFAULT CHARSET=utf8'; + $sql = 'CREATE TABLE mrprequirements ( part char(20), + daterequired date, + quantity double, + mrpdemandtype varchar(6), + orderno int(11), + directdemand smallint, + whererequired char(20)) DEFAULT CHARSET=utf8'; $result = DB_query($sql,$db,_('Create of mrprequirements failed because')); prnMsg(_('Loading requirements from sales orders'),'info'); flush(); - $sql = 'INSERT INTO mrprequirements - (part, - daterequired, - quantity, - mrpdemandtype, - orderno, - directdemand, - whererequired) - SELECT stkcode, - deliverydate, - (quantity - qtyinvoiced) AS netqty, - "SO", - salesorderdetails.orderno, - "1", - stkcode - FROM salesorders, salesorderdetails - WHERE salesorders.orderno = salesorderdetails.orderno - AND (quantity - qtyinvoiced) > 0 - AND salesorderdetails.completed = 0 - AND salesorders.quotation = 0'; + $sql = 'INSERT INTO mrprequirements (part, + daterequired, + quantity, + mrpdemandtype, + orderno, + directdemand, + whererequired) + SELECT stkcode, + deliverydate, + (quantity - qtyinvoiced) AS netqty, + "SO", + salesorderdetails.orderno, + "1", + stkcode + FROM salesorders, salesorderdetails + WHERE salesorders.orderno = salesorderdetails.orderno + AND (quantity - qtyinvoiced) > 0 + AND salesorderdetails.completed = 0 + AND salesorders.quotation = 0'; $result = DB_query($sql,$db); prnMsg(_('Loading requirements from work orders'),'info'); flush(); // Definition of demand from SelectProduct.php - $sql = 'INSERT INTO mrprequirements - (part, - daterequired, - quantity, - mrpdemandtype, - orderno, - directdemand, - whererequired) - SELECT worequirements.stockid, - workorders.requiredby, - qtypu*(woitems.qtyreqd - woitems.qtyrecd) AS netqty, - "WO", - woitems.wo, - "1", - parentstockid - FROM woitems INNER JOIN worequirements - ON woitems.stockid=worequirements.parentstockid - INNER JOIN workorders - ON woitems.wo=workorders.wo - AND woitems.wo=worequirements.wo - WHERE workorders.closed=0'; + $sql = 'INSERT INTO mrprequirements (part, + daterequired, + quantity, + mrpdemandtype, + orderno, + directdemand, + whererequired) + SELECT worequirements.stockid, + workorders.requiredby, + qtypu*(woitems.qtyreqd - woitems.qtyrecd) AS netqty, + "WO", + woitems.wo, + "1", + parentstockid + FROM woitems INNER JOIN worequirements + ON woitems.stockid=worequirements.parentstockid + INNER JOIN workorders + ON woitems.wo=workorders.wo + AND woitems.wo=worequirements.wo + WHERE workorders.closed=0'; $result = DB_query($sql,$db); - $sql = 'INSERT INTO mrprequirements - (part, - daterequired, - quantity, - mrpdemandtype, - orderno, - directdemand, - whererequired) - SELECT stockid, - duedate, - quantity, - mrpdemandtype, - demandid, - "1", - stockid - FROM mrpdemands'; + $sql = 'INSERT INTO mrprequirements (part, + daterequired, + quantity, + mrpdemandtype, + orderno, + directdemand, + whererequired) + SELECT stockid, + duedate, + quantity, + mrpdemandtype, + demandid, + "1", + stockid + FROM mrpdemands'; if ($_POST['usemrpdemands'] == 'y') { $result = DB_query($sql,$db); prnMsg(_('Loading requirements based on mrpdemands'),'info'); flush(); } - $sql = 'INSERT INTO mrprequirements - (part, - daterequired, - quantity, - mrpdemandtype, - orderno, - directdemand, - whererequired) - SELECT stockid, - NOW(), - (reorderlevel - quantity) AS reordqty, - "REORD", - "1", - "1", - stockid - FROM locstock - WHERE reorderlevel > quantity'; + $sql = 'INSERT INTO mrprequirements (part, + daterequired, + quantity, + mrpdemandtype, + orderno, + directdemand, + whererequired) + SELECT stockid, + NOW(), + (reorderlevel - quantity) AS reordqty, + "REORD", + "1", + "1", + stockid + FROM locstock + WHERE reorderlevel > quantity'; $result = DB_query($sql,$db); prnMsg(_('Loading requirements based on reorder level'),'info'); flush(); @@ -334,108 +326,105 @@ $result = DB_query('DROP TABLE IF EXISTS mrpsupplies',$db); // updateflag is set to 1 in UpdateSupplies if change date when matching requirements to // supplies. Actually only change update flag in the array created from mrpsupplies - $sql = 'CREATE TABLE mrpsupplies ( - id int(11) NOT NULL auto_increment, - part char(20), - duedate date, - supplyquantity double, - ordertype varchar(6), - orderno int(11), - mrpdate date, - updateflag smallint(6), - PRIMARY KEY (id)) DEFAULT CHARSET=utf8'; + $sql = 'CREATE TABLE mrpsupplies ( id int(11) NOT NULL auto_increment, + part char(20), + duedate date, + supplyquantity double, + ordertype varchar(6), + orderno int(11), + mrpdate date, + updateflag smallint(6), + PRIMARY KEY (id)) DEFAULT CHARSET=utf8'; $result = DB_query($sql,$db,_('Create of mrpsupplies failed because')); prnMsg(_('Loading supplies from purchase orders'),'info'); flush(); - $sql = 'INSERT INTO mrpsupplies - (id, - part, - duedate, - supplyquantity, - ordertype, - orderno, - mrpdate, - updateflag) - SELECT Null, - purchorderdetails.itemcode, - purchorderdetails.deliverydate, - (quantityord - quantityrecd) AS netqty, - "PO", - purchorderdetails.orderno, - purchorderdetails.deliverydate, - 0 - FROM purchorderdetails, - purchorders - WHERE purchorderdetails.orderno = purchorders.orderno - AND purchorders.status != "Cancelled" - AND(quantityord - quantityrecd) > 0'; + $sql = 'INSERT INTO mrpsupplies (id, + part, + duedate, + supplyquantity, + ordertype, + orderno, + mrpdate, + updateflag) + SELECT Null, + purchorderdetails.itemcode, + purchorderdetails.deliverydate, + (quantityord - quantityrecd) AS netqty, + "PO", + purchorderdetails.orderno, + purchorderdetails.deliverydate, + 0 + FROM purchorderdetails, + purchorders + WHERE purchorderdetails.orderno = purchorders.orderno + AND purchorders.status != "Cancelled" + AND purchorders.status != "Rejected" + AND(quantityord - quantityrecd) > 0'; $result = DB_query($sql,$db); prnMsg(_('Loading supplies from inventory on hand'),'info'); flush(); // Set date for inventory already onhand to 0000-00-00 so it is first in sort if ($_POST['location'][0] == 'All') { - $whereloc = ' '; + $WhereLocation = ' '; } elseif (sizeof($_POST['location']) == 1) { - $whereloc = " AND loccode ='" . $_POST['location'][0] . "' "; + $WhereLocation = " AND loccode ='" . $_POST['location'][0] . "' "; } else { - $whereloc = " AND loccode IN("; + $WhereLocation = " AND loccode IN("; $commactr = 0; foreach ($_POST['location'] as $key => $value) { - $whereloc .= "'" . $value . "'"; + $WhereLocation .= "'" . $value . "'"; $commactr++; if ($commactr < sizeof($_POST['location'])) { - $whereloc .= ","; + $WhereLocation .= ","; } // End of if } // End of foreach - $whereloc .= ')'; + $WhereLocation .= ')'; } - $sql = 'INSERT INTO mrpsupplies - (id, - part, - duedate, - supplyquantity, - ordertype, - orderno, - mrpdate, - updateflag) - SELECT Null, - stockid, - "0000-00-00", - SUM(quantity), - "QOH", - 1, - "0000-00-00", - 0 - FROM locstock - WHERE quantity > 0 ' . - $whereloc . - 'GROUP BY stockid'; + $sql = 'INSERT INTO mrpsupplies (id, + part, + duedate, + supplyquantity, + ordertype, + orderno, + mrpdate, + updateflag) + SELECT Null, + stockid, + "0000-00-00", + SUM(quantity), + "QOH", + 1, + "0000-00-00", + 0 + FROM locstock + WHERE quantity > 0 ' . + $WhereLocation . + 'GROUP BY stockid'; $result = DB_query($sql,$db); prnMsg(_('Loading supplies from work orders'),'info'); flush(); - $sql = 'INSERT INTO mrpsupplies - (id, - part, - duedate, - supplyquantity, - ordertype, - orderno, - mrpdate, - updateflag) - SELECT Null, - stockid, - workorders.requiredby, - (woitems.qtyreqd-woitems.qtyrecd) AS netqty, - "WO", - woitems.wo, - workorders.requiredby, - 0 - FROM woitems INNER JOIN workorders - ON woitems.wo=workorders.wo - WHERE workorders.closed=0'; + $sql = 'INSERT INTO mrpsupplies (id, + part, + duedate, + supplyquantity, + ordertype, + orderno, + mrpdate, + updateflag) + SELECT Null, + stockid, + workorders.requiredby, + (woitems.qtyreqd-woitems.qtyrecd) AS netqty, + "WO", + woitems.wo, + workorders.requiredby, + 0 + FROM woitems INNER JOIN workorders + ON woitems.wo=workorders.wo + WHERE workorders.closed=0'; $result = DB_query($sql,$db); $sql = 'ALTER TABLE mrpsupplies ADD INDEX part(part)'; @@ -447,16 +436,15 @@ prnMsg(_('Creating planned orders table'),'info'); flush(); $result = DB_query('DROP TABLE IF EXISTS mrpplannedorders',$db); - $sql = 'CREATE TABLE mrpplannedorders ( - id int(11) NOT NULL auto_increment, - part char(20), - duedate date, - supplyquantity double, - ordertype varchar(6), - orderno int(11), - mrpdate date, - updateflag smallint(6), - PRIMARY KEY (id))'; + $sql = 'CREATE TABLE mrpplannedorders (id int(11) NOT NULL auto_increment, + part char(20), + duedate date, + supplyquantity double, + ordertype varchar(6), + orderno int(11), + mrpdate date, + updateflag smallint(6), + PRIMARY KEY (id))'; $result = DB_query($sql,$db,_('Create of mrpplannedorders failed because')); // Find the highest and lowest level number @@ -474,7 +462,7 @@ // part, that serves as a gross requirement for a lower level part, so will read down through // the Bill of Materials to generate those requirements in function LevelNetting(). for ($level = $maxlevel; $level >= $minlevel; $level--) { - $sql = 'SELECT * FROM levels WHERE level = "' . $level .'" LIMIT 50000'; //should cover most eventualities!! + $sql = 'SELECT * FROM levels WHERE level = "' . $level .'" LIMIT 50000'; //should cover most eventualities!! ... yes indeed :-) prnMsg('</br>------ ' . _('Processing level') .' ' . $level . ' ------','info'); flush(); @@ -509,19 +497,19 @@ } // End of if } // End of foreach $sql = "INSERT INTO mrpparameters (runtime, - location, - pansizeflag, - shrinkageflag, - eoqflag, - usemrpdemands, - leeway) - VALUES (NOW(), - '" . $locparm . "', - '" . $_POST['pansizeflag'] . "', - '" . $_POST['shrinkageflag'] . "', - '" . $_POST['eoqflag'] . "', - '" . $_POST['usemrpdemands'] . "', - '" . $_POST['Leeway'] . "')"; + location, + pansizeflag, + shrinkageflag, + eoqflag, + usemrpdemands, + leeway) + VALUES (NOW(), + '" . $locparm . "', + '" . $_POST['pansizeflag'] . "', + '" . $_POST['shrinkageflag'] . "', + '" . $_POST['eoqflag'] . "', + '" . $_POST['usemrpdemands'] . "', + '" . $_POST['Leeway'] . "')"; $result = DB_query($sql,$db); } else { // End of if submit isset @@ -613,7 +601,7 @@ $sql = "SELECT decimalplaces FROM stockmaster WHERE stockid = '" . $part . "'"; $result = DB_query($sql,$db); $myrow=DB_fetch_row($result); - $decimalplaces = $myrow[0]; + $DecimalPlaces = $myrow[0]; // Load mrprequirements into $requirements array $sql = "SELECT * FROM mrprequirements WHERE part = '" .$part. "' ORDER BY daterequired"; @@ -702,7 +690,7 @@ // Should the quantity be rounded? if ($_POST['shrinkageflag'] == 'y' and $shrinkfactor > 0) { $requirement['quantity'] = ($requirement['quantity'] * 100) / (100 - $shrinkfactor); - $requirement['quantity'] = round($requirement['quantity'],$decimalplaces); + $requirement['quantity'] = round($requirement['quantity'],$DecimalPlaces); } if ($excessqty >= $requirement['quantity']) { $plannedqty = 0; Modified: trunk/PageSecurity.php =================================================================== --- trunk/PageSecurity.php 2010-12-29 23:18:49 UTC (rev 4455) +++ trunk/PageSecurity.php 2010-12-30 05:46:48 UTC (rev 4456) @@ -1,6 +1,5 @@ <?php - include('includes/session.inc'); $title = _('Page Security Levels'); @@ -9,23 +8,24 @@ echo '<p class="page_title_text"><img src="'.$rootpath.'/css/'.$theme.'/images/security.png" title="' . _('Page Security Levels') . '" alt="" />' . ' ' . $title.'</p><br />'; -if (isset($_POST['update'])) { - foreach ($_POST as $key => $value) { - if ($key!='update' and $key!='FormID') { - $key=substr($key, 0, strlen($key)-4).'.php'; - $sql="UPDATE pagesecurity SET security='".$value."' WHERE script='".$key."'"; - $updateresult=DB_query($sql, $db); +if (isset($_POST['Update'])) { + foreach ($_POST as $ScriptName => $PageSecurityValue) { + if ($ScriptName!='Update' and $ScriptName!='FormID') { + //$key=substr($key, 0, strlen($key)-4).'.php'; + $sql="UPDATE scripts SET pagesecurity='".$PageSecurityValue."' WHERE script='".$ScriptName."'"; + $UpdateResult=DB_query($sql, $db,_('Could not update the page security value for the script because')); } } } -$sql="SELECT script, - security - FROM pagesecurity"; +$sql='SELECT script, + pagesecurity, + description + FROM scripts'; $result=DB_query($sql, $db); -echo '<br /><form method="post" id="AccountGroups" action="' . $_SERVER['PHP_SELF'] . '?' . SID . '">'; +echo '<br /><form method="post" id="PageSecurity" action="' . $_SERVER['PHP_SELF'] . '?' . SID . '">'; echo '<input type="hidden" name="FormID" value="' . $_SESSION['FormID'] . '" />'; echo '<table class="selection">'; @@ -39,7 +39,7 @@ echo '<tr><td>'.$myrow['script'].'</td>'; echo '<td><select name="'.$myrow['script'].'">'; while ($mytokenrow=DB_fetch_array($TokenResult)) { - if ($mytokenrow['tokenid']==$myrow['security']) { + if ($mytokenrow['tokenid']==$myrow['pagesecurity']) { echo '<option selected="True" value="'.$mytokenrow['tokenid'].'">'.htmlentities($mytokenrow['tokenname']).'</option>'; } else { echo '<option value="'.$mytokenrow['tokenid'].'">'.htmlentities($mytokenrow['tokenname']).'</option>'; @@ -51,8 +51,7 @@ 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/UpgradeDatabase.php =================================================================== --- trunk/UpgradeDatabase.php 2010-12-29 23:18:49 UTC (rev 4455) +++ trunk/UpgradeDatabase.php 2010-12-30 05:46:48 UTC (rev 4456) @@ -7,9 +7,12 @@ if (empty($_POST['DoUpgrade'])){ - if (!isset($_SESSION['VersionNumber')){ - prnMsg(_('The webERP code is version') . ' ' . $Version . ' ' . _('the database is a prior version and upgrade scripts are required to be run. Upgrades to the database prior to ') - prnMsg(_('This script will run perform any modifications to the database since v 3.11 required to allow the additional functionality in later scripts'),'info'); + if (!isset($_SESSION['VersionNumber'])){ + prnMsg(_('The webERP code is version') . ' ' . $Version . ' ' . _('and the database version is not actually recorded at this version'),'info'); + } else { + prnMsg(_('The webERP code is version') . ' ' . $Version . ' ' . _('and the database version is') . ' ' . $_SESSION['VersionNumber'],'info'); + } + prnMsg(_('This script will run perform any modifications to the database required to allow the additional functionality in later scripts'),'info'); echo "<p><form method='post' action='" . $_SERVER['PHP_SELF'] . '?' . SID . "'>"; echo '<input type="hidden" name="FormID" value="' . $_SESSION['FormID'] . '" />'; @@ -82,6 +85,10 @@ echo '<tr><td>' . $sql . '</td><td bgcolor="yellow">'._('Note').' - '. _('Entry has already been done').'</td></tr>'; break; + case 1064: + echo '<tr><td>' . $sql . '</td><td bgcolor="red">'._('Note').' - '. + _('SQL syntax error. The SQL error message is'). ' ' . DB_error_msg($db) . '</td></tr>'; + break; case 1068: echo '<tr><td>' . $sql . '</td><td bgcolor="yellow">'._('Note').' - '. _('Primary key already exists').'</td></tr>'; @@ -92,7 +99,7 @@ break; default: echo '<tr><td>' . $sql . '</td><td bgcolor="red">'._('Failure').' - '. - _('Error number').' - '.DB_error_no($db) .'</td></tr>'; + _('Error number').' - '.DB_error_no($db) .' ' . DB_error_msg($db) . '</td></tr>'; break; } unset($sql); Modified: trunk/includes/ConnectDB.inc =================================================================== --- trunk/includes/ConnectDB.inc 2010-12-29 23:18:49 UTC (rev 4455) +++ trunk/includes/ConnectDB.inc 2010-12-30 05:46:48 UTC (rev 4456) @@ -4,7 +4,7 @@ * this value is saved in the $_SESSION['Versionumber'] when includes/GetConfig.php is run * if VersionNumber is < $Version then the DB update script is run */ -$Version='4.00'; //must update manually every time there is a DB change +$Version='3.12.1'; //must update manually every time there is a DB change require_once ($PathPrefix .'includes/MiscFunctions.php'); if (!isset($_SESSION['DatabaseName'])){ Modified: trunk/includes/GetConfig.php =================================================================== --- trunk/includes/GetConfig.php 2010-12-29 23:18:49 UTC (rev 4455) +++ trunk/includes/GetConfig.php 2010-12-30 05:46:48 UTC (rev 4456) @@ -25,7 +25,7 @@ $sql='SELECT script, pagesecurity FROM scripts'; $ErrMsg = _('Could not get the page security details from the database because'); - $result=DB_query($sql, $db); + $result=DB_query($sql, $db,_('Could not get page security details from the scripts table because')); while ($myrow=DB_fetch_array($result)) { $_SESSION['PageSecurity'][$myrow['script']]=$myrow['pagesecurity']; Modified: trunk/includes/session.inc =================================================================== --- trunk/includes/session.inc 2010-12-29 23:18:49 UTC (rev 4455) +++ trunk/includes/session.inc 2010-12-30 05:46:48 UTC (rev 4456) @@ -115,12 +115,11 @@ /*User is logged in so get configuration parameters - save in session*/ include($PathPrefix . 'includes/GetConfig.php'); -if (isset($_SESSION[basename($_SERVER['SCRIPT_NAME'])])) { - /*The page security variable is now retrieved from the database in GetConfig.php and stored in the $SESSION['PageSecurity'] array - * the key for the array is the script name - the script name is retrieved from the basename ($_SERVER['SCRIPT_NAME']) - */ - $PageSecurity = $_SESSION['PageSecurity'][basename($_SERVER['SCRIPT_NAME'])]; -} +/*The page security variable is now retrieved from the database in GetConfig.php and stored in the $SESSION['PageSecurity'] array + * the key for the array is the script name - the script name is retrieved from the basename ($_SERVER['SCRIPT_NAME']) + */ +$PageSecurity = $_SESSION['PageSecurity'][basename($_SERVER['SCRIPT_NAME'])]; + /*If the Code $Version - held in ConnectDB.inc is > than the Database VersionNumber held in config table then do upgrades */ if (($Version>$_SESSION['VersionNumber']) and (basename($_SERVER['SCRIPT_NAME'])!='UpgradeDatabase.php')) { header('Location: UpgradeDatabase.php'); @@ -311,12 +310,8 @@ return $Password; } } -if (isset($_SESSION['VersionNumber'])) { - $Version = $_SESSION['VersionNumber']; -} else { - $Version=''; -} + if (sizeof($_POST) > 0) { if (!isset($_POST['FormID']) or ($_POST['FormID'] != $_SESSION['FormID'])) { $title = _('Error in form verificationm'); Modified: trunk/sql/mysql/upgrade3.11.1-4.00.sql =================================================================== --- trunk/sql/mysql/upgrade3.11.1-4.00.sql 2010-12-29 23:18:49 UTC (rev 4455) +++ trunk/sql/mysql/upgrade3.11.1-4.00.sql 2010-12-30 05:46:48 UTC (rev 4456) @@ -440,11 +440,12 @@ `longdescription` text NOT NULL, `depntype` int(11) NOT NULL DEFAULT '1', `depnrate` double NOT NULL, - `disposaldate` date NOT NULL DEFAULT '0000-00-00' + `disposaldate` date NOT NULL DEFAULT '0000-00-00', PRIMARY KEY (`assetid`) ) ENGINE=InnoDB DEFAULT CHARSET=utf8; + INSERT INTO `systypes` (`typeid`, `typename`, `typeno`) VALUES ('41', 'Asset Addition', '1'); INSERT INTO `systypes` (`typeid`, `typename`, `typeno`) VALUES ('42', 'Asset Category Change', '1'); INSERT INTO `systypes` (`typeid`, `typename`, `typeno`) VALUES ('43', 'Delete w/down asset', '1'); @@ -802,4 +803,6 @@ ('Z_UploadForm.php', 15, 'Utility to upload a file to a remote server'), ('Z_UploadResult.php', 15, 'Utility to upload a file to a remote server'); -INSERT INTO config (confname, confvalue) VALUES ('VersionNumber', '4.00'); +INSERT INTO config (confname, confvalue) VALUES ('VersionNumber', '3.12.0'); +UPDATE config SET confvalue='3.12.1' WHERE confname='VersionNumber'; + This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <dai...@us...> - 2010-12-30 22:10:50
|
Revision: 4457 http://web-erp.svn.sourceforge.net/web-erp/?rev=4457&view=rev Author: daintree Date: 2010-12-30 22:10:43 +0000 (Thu, 30 Dec 2010) Log Message: ----------- Conventions counter sales Modified Paths: -------------- trunk/CounterSales.php trunk/UpgradeDatabase.php trunk/doc/Change.log.html trunk/includes/ConnectDB.inc Modified: trunk/CounterSales.php =================================================================== --- trunk/CounterSales.php 2010-12-30 05:46:48 UTC (rev 4456) +++ trunk/CounterSales.php 2010-12-30 22:10:43 UTC (rev 4457) @@ -1,10 +1,10 @@ <?php -/* $Id: SelectOrderItems.php 3453 2010-05-06 06:39:52Z lindsayh $*/ +/* $Id: $*/ include('includes/DefineCartClass.php'); //$PageSecurity = 1; /* Session started in session.inc for password checking and authorisation level check -config.php is in turn included in session.inc*/ +config.php is in turn included in session.inc $PageSecurity now comes from session.inc (and gets read in by GetConfig.php*/ include('includes/session.inc'); @@ -33,10 +33,10 @@ unset($_POST['PartSearch']); } -if (isset($_POST['order_items'])){ +if (isset($_POST['OrderItems'])){ foreach ($_POST as $key => $value) { if (strstr($key,'itm')) { - $NewItem_array[substr($key,3)] = trim($value); + $NewItemArray[substr($key,3)] = trim($value); } } } @@ -46,7 +46,7 @@ } if (isset($_GET['NewOrder'])){ - /*New order entry - clear any existing order details from the Items object and initiate a newy*/ + /*New order entry - clear any existing order details from the Items object and initiate a newy*/ if (isset($_SESSION['Items'.$identifier])){ unset ($_SESSION['Items'.$identifier]->LineItems); $_SESSION['Items'.$identifier]->ItemsOrdered=0; @@ -153,13 +153,13 @@ prnMsg(_('The branch details for branch code') . ': ' . $_SESSION['Items'.$identifier]->Branch . ' ' . _('against customer code') . ': ' . $_POST['Select'] . ' ' . _('could not be retrieved') . '. ' . _('Check the set up of the customer and branch'),'error'); if ($debug==1){ - echo '<br>' . _('The SQL that failed to get the branch details was') . ':<br>' . $sql; + echo '<br />' . _('The SQL that failed to get the branch details was') . ':<br />' . $sql; } include('includes/footer.inc'); exit; } // add echo - echo '<br>'; + echo '<br />'; $myrow = DB_fetch_array($result); $_SESSION['Items'.$identifier]->DeliverTo = ''; @@ -170,10 +170,11 @@ $_SESSION['Items'.$identifier]->DeliveryDays = $myrow['estdeliverydays']; $_SESSION['Items'.$identifier]->TaxGroup = $myrow['taxgroupid']; - if ($_SESSION['Items'.$identifier]->SpecialInstructions) - prnMsg($_SESSION['Items'.$identifier]->SpecialInstructions,'warn'); + if ($_SESSION['Items'.$identifier]->SpecialInstructions) { + prnMsg($_SESSION['Items'.$identifier]->SpecialInstructions,'warn'); + } - if ($_SESSION['CheckCreditLimits'] > 0){ /*Check credit limits is 1 for warn and 2 for prohibit sales */ + if ($_SESSION['CheckCreditLimits'] > 0) { /*Check credit limits is 1 for warn and 2 for prohibit sales */ $_SESSION['Items'.$identifier]->CreditAvailable = GetCreditAvailable($_SESSION['Items'.$identifier]->DebtorNo,$db); if ($_SESSION['CheckCreditLimits']==1 AND $_SESSION['Items'.$identifier]->CreditAvailable <=0){ @@ -200,9 +201,9 @@ unset($_SESSION['Items'.$identifier]); $_SESSION['Items'.$identifier] = new cart; - echo '<br><br>'; + echo '<br /><br />'; prnMsg(_('This sale has been cancelled as requested'),'success'); - echo '<br><br><a href="' .$_SERVER['PHP_SELF'] . '">' . _('Start a new Counter Sale') . '</a>'; + echo '<br /><br /><a href="' .$_SERVER['PHP_SELF'] . '">' . _('Start a new Counter Sale') . '</a>'; include('includes/footer.inc'); exit; @@ -211,17 +212,17 @@ 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 '</p></b></div>'; + echo '</p>'; } if (isset($_POST['Search']) or isset($_POST['Next']) or isset($_POST['Prev'])){ if ($_POST['Keywords']!=='' AND $_POST['StockCode']=='') { - $msg='</b><div class="page_help_text">' . _('Item description has been used in search') . '.</div>'; - } elseif ($_POST['StockCode']!=='' AND $_POST['Keywords']=='') { - $msg='</b><div class="page_help_text">' . _('Item Code has been used in search') . '.</div>'; - } elseif ($_POST['Keywords']=='' AND $_POST['StockCode']=='') { - $msg='</b><div class="page_help_text">' . _('Stock Category has been used in search') . '.</div>'; + $msg='<div class="page_help_text">' . _('Item description has been used in search') . '.</div>'; + } else if ($_POST['StockCode']!=='' AND $_POST['Keywords']=='') { + $msg='<div class="page_help_text">' . _('Item Code has been used in search') . '.</div>'; + } else if ($_POST['Keywords']=='' AND $_POST['StockCode']=='') { + $msg='<div class="page_help_text">' . _('Stock Category has been used in search') . '.</div>'; } if (isset($_POST['Keywords']) AND strlen($_POST['Keywords'])>0) { //insert wildcard characters in spaces @@ -256,7 +257,7 @@ ORDER BY stockmaster.stockid"; } - } elseif (strlen($_POST['StockCode'])>0){ + } else if (strlen($_POST['StockCode'])>0){ $_POST['StockCode'] = strtoupper($_POST['StockCode']); $SearchString = '%' . $_POST['StockCode'] . '%'; @@ -316,7 +317,7 @@ } if (isset($_POST['Next'])) { - $Offset = $_POST['nextlist']; + $Offset = $_POST['NextList']; } if (isset($_POST['Prev'])) { $Offset = $_POST['previous']; @@ -347,7 +348,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'] . '?' . SID .'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 @@ -365,21 +366,21 @@ /*Process Quick Entry */ /* If enter is pressed on the quick entry screen, the default button may be Recalculate */ - if (isset($_POST['order_items']) + if (isset($_POST['OrderItems']) OR isset($_POST['QuickEntry']) OR isset($_POST['Recalculate'])){ - /* get the item details from the database and hold them in the cart object */ + /* 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 can only be set later on -- after quick entry -- so default discount to 0 in the first place */ + $Discount = 0; - $i=1; - while ($i<=$_SESSION['QuickEntries'] and isset($_POST['part_' . $i]) and $_POST['part_' . $i]!='') { + $i=1; + while ($i<=$_SESSION['QuickEntries'] and isset($_POST['part_' . $i]) and $_POST['part_' . $i]!='') { $QuickEntryCode = 'part_' . $i; $QuickEntryQty = 'qty_' . $i; $QuickEntryPOLine = 'poline_' . $i; - $QuickEntryItemDue = 'itemdue_' . $i; + $QuickEntryItemDue = 'ItemDue_' . $i; $i++; @@ -406,7 +407,7 @@ } if(!Is_Date($NewItemDue)) { - prnMsg(_('An invalid date entry was made for ') . ' ' . $NewItem . ' ' . _('The date entry') . ' ' . $NewItemDue . ' ' . _('must be in the format') . ' ' . $_SESSION['DefaultDateFormat'],'warn'); + prnMsg(_('An invalid date entry was made for ') . ' ' . $NewItem . ' ' . _('The date entry') . ' ' . $NewItemDue . ' ' . _('must be in the format') . ' ' . $_SESSION['DefaultDateFormat'],'warn'); //Attempt to default the due date to something sensible? $NewItemDue = DateAdd (Date($_SESSION['DefaultDateFormat']),'d', $_SESSION['Items'.$identifier]->DeliveryDays); } @@ -435,16 +436,16 @@ $KitResult = DB_query($sql,$db,$ErrMsg,$DbgMsg); $ParentQty = $NewItemQty; - while ($KitParts = DB_fetch_array($KitResult,$db)){ + while ($KitParts = DB_fetch_array($KitResult,$db)) { $NewItem = $KitParts['component']; $NewItemQty = $KitParts['quantity'] * $ParentQty; $NewPOLine = 0; include('includes/SelectOrderItems_IntoCart.inc'); } - } elseif ($myrow['mbflag']=='G'){ + } else if ($myrow['mbflag']=='G'){ prnMsg(_('Phantom assemblies cannot be sold, these items exist only as bills of materials used in other manufactured items. The following item has not been added to the order:') . ' ' . $NewItem, 'warn'); - } elseif ($myrow['controlled']==1){ + } else if ($myrow['controlled']==1){ prnMsg(_('The system does not currently cater for counter sales of lot controlled or serialised items'),'warn'); } else { /*Its not a kit set item*/ include('includes/SelectOrderItems_IntoCart.inc'); @@ -457,9 +458,9 @@ /*Now do non-quick entry delete/edits/adds */ -if ((isset($_SESSION['Items'.$identifier])) OR isset($NewItem)){ +if ((isset($_SESSION['Items'.$identifier])) OR isset($NewItem)) { - if(isset($_GET['Delete'])){ + if (isset($_GET['Delete'])){ $_SESSION['Items'.$identifier]->remove_from_cart($_GET['Delete']); /*Don't do any DB updates*/ } @@ -469,10 +470,10 @@ $Quantity = $_POST['Quantity_' . $OrderLine->LineNumber]; - if (ABS($OrderLine->Price - $_POST['Price_' . $OrderLine->LineNumber])>0.01){ + if (abs($OrderLine->Price - $_POST['Price_' . $OrderLine->LineNumber])>0.01){ $Price = $_POST['Price_' . $OrderLine->LineNumber]; $_POST['GPPercent_' . $OrderLine->LineNumber] = (($Price*(1-($_POST['Discount_' . $OrderLine->LineNumber]/100))) - $OrderLine->StandardCost*$ExRate)/($Price *(1-$_POST['Discount_' . $OrderLine->LineNumber])/100); - } elseif (ABS($OrderLine->GPPercent - $_POST['GPPercent_' . $OrderLine->LineNumber])>=0.001) { + } else if (abs($OrderLine->GPPercent - $_POST['GPPercent_' . $OrderLine->LineNumber])>=0.001) { //then do a recalculation of the price at this new GP Percentage $Price = ($OrderLine->StandardCost*$ExRate)/(1 -(($_POST['GPPercent_' . $OrderLine->LineNumber] + $_POST['Discount_' . $OrderLine->LineNumber])/100)); } else { @@ -489,14 +490,14 @@ $OrderLine->DiscountPercent = 0; } - if ($Quantity<0 OR $Price <0 OR $DiscountPercentage >100 OR $DiscountPercentage <0){ + if ($Quantity<0 or $Price <0 or $DiscountPercentage >100 or $DiscountPercentage <0){ prnMsg(_('The item could not be updated because you are attempting to set the quantity ordered to less than 0 or the price less than 0 or the discount more than 100% or less than 0%'),'warn'); - } elseif ($OrderLine->Quantity !=$Quantity - OR $OrderLine->Price != $Price - OR ABS($OrderLine->DiscountPercent -$DiscountPercentage/100) >0.001 - OR $OrderLine->Narrative != $Narrative - OR $OrderLine->ItemDue != $_POST['ItemDue_' . $OrderLine->LineNumber] - OR $OrderLine->POLine != $_POST['POLine_' . $OrderLine->LineNumber]) { + } else if ($OrderLine->Quantity !=$Quantity + or $OrderLine->Price != $Price + or abs($OrderLine->DiscountPercent -$DiscountPercentage/100) >0.001 + or $OrderLine->Narrative != $Narrative + or $OrderLine->ItemDue != $_POST['ItemDue_' . $OrderLine->LineNumber] + or $OrderLine->POLine != $_POST['POLine_' . $OrderLine->LineNumber]) { $_SESSION['Items'.$identifier]->update_cart_item($OrderLine->LineNumber, $Quantity, @@ -564,52 +565,52 @@ } /*end of if its a new item */ -if (isset($NewItem_array) && isset($_POST['order_items'])){ +if (isset($NewItemArray) and isset($_POST['OrderItems'])){ /* 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'*/ - foreach($NewItem_array as $NewItem => $NewItemQty) { - if($NewItemQty > 0) { - $sql = "SELECT stockmaster.mbflag - FROM stockmaster - WHERE stockmaster.stockid='". $NewItem ."'"; + foreach($NewItemArray as $NewItem => $NewItemQty) { + if($NewItemQty > 0) { + $sql = "SELECT stockmaster.mbflag + FROM stockmaster + WHERE stockmaster.stockid='". $NewItem ."'"; - $ErrMsg = _('Could not determine if the part being ordered was a kitset or not because'); + $ErrMsg = _('Could not determine if the part being ordered was a kitset or not because'); - $KitResult = DB_query($sql, $db,$ErrMsg); + $KitResult = DB_query($sql, $db,$ErrMsg); - //$NewItemQty = 1; /*By Default */ - $Discount = 0; /*By default - can change later or discount category override */ + //$NewItemQty = 1; /*By Default */ + $Discount = 0; /*By default - can change later or discount category override */ - 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') . "'"; + 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') . "'"; - $ErrMsg = _('Could not retrieve kitset components from the database because'); - $KitResult = DB_query($sql,$db,$ErrMsg); + $ErrMsg = _('Could not retrieve kitset components from the database because'); + $KitResult = DB_query($sql,$db,$ErrMsg); - $ParentQty = $NewItemQty; - while ($KitParts = DB_fetch_array($KitResult,$db)){ - $NewItem = $KitParts['component']; - $NewItemQty = $KitParts['quantity'] * $ParentQty; - $NewItemDue = date($_SESSION['DefaultDateFormat']); - $NewPOLine = 0; - include('includes/SelectOrderItems_IntoCart.inc'); - $_SESSION['Items'.$identifier]->GetTaxes(($_SESSION['Items'.$identifier]->LineCounter - 1)); - } - - } else { /*Its not a kit set item*/ + $ParentQty = $NewItemQty; + while ($KitParts = DB_fetch_array($KitResult,$db)){ + $NewItem = $KitParts['component']; + $NewItemQty = $KitParts['quantity'] * $ParentQty; $NewItemDue = date($_SESSION['DefaultDateFormat']); $NewPOLine = 0; include('includes/SelectOrderItems_IntoCart.inc'); $_SESSION['Items'.$identifier]->GetTaxes(($_SESSION['Items'.$identifier]->LineCounter - 1)); } - } /* end of if its a new item */ - } /*end of if its a new item */ + + } else { /*Its not a kit set item*/ + $NewItemDue = date($_SESSION['DefaultDateFormat']); + $NewPOLine = 0; + include('includes/SelectOrderItems_IntoCart.inc'); + $_SESSION['Items'.$identifier]->GetTaxes(($_SESSION['Items'.$identifier]->LineCounter - 1)); + } + } /* end of if its a new item */ + } /*end of if its a new item */ } } @@ -646,16 +647,16 @@ } } /* end of discount matrix lookup code */ -if (count($_SESSION['Items'.$identifier]->LineItems)>0){ /*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 // ************************************************************************* */ - echo '<br> + echo '<br /> <table width="90%" cellpadding="2" colspan="7"> - <tr bgcolor=#800000>'; + <tr bgcolor="#800000">'; echo '<th>' . _('Item Code') . '</th> <th>' . _('Item Description') . '</th> <th>' . _('Quantity') . '</th> @@ -666,8 +667,8 @@ <th>' . _('GP %') . '</th> <th>' . _('Net') . '</th> <th>' . _('Tax') . '</th> - <th>' . _('Total') . '<br>' . _('Incl Tax') . '</th> - </tr>'; + <th>' . _('Total') . '<br />' . _('Incl Tax') . '</th> + </tr>'; $_SESSION['Items'.$identifier]->total = 0; $_SESSION['Items'.$identifier]->totalVolume = 0; @@ -695,23 +696,24 @@ } echo $RowStarter; - echo '<input type="hidden" name="POLine_' . $OrderLine->LineNumber . '" value="">'; + 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?' . SID .'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=tect name="Quantity_' . $OrderLine->LineNumber . '" size=6 maxlength=6 value=' . $OrderLine->Quantity . '>'; + echo '<td><input class="number" tabindex="2" type="text" name="Quantity_' . $OrderLine->LineNumber . '" size="6" maxlength="6" value="' . $OrderLine->Quantity . '" />'; echo '</td> <td class="number">' . $OrderLine->QOHatLoc . '</td> <td>' . $OrderLine->Units . '</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>'; - echo '</td><td class=number>' . number_format($SubTotal,2) . '</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>'; + echo '<td class="number">' . number_format($SubTotal,2) . '</td>'; $LineDueDate = $OrderLine->ItemDue; - if (!Is_Date($OrderLine->ItemDue)){ + if (!is_Date($OrderLine->ItemDue)){ $LineDueDate = DateAdd (Date($_SESSION['DefaultDateFormat']),'d', $_SESSION['Items'.$identifier]->DeliveryDays); $_SESSION['Items'.$identifier]->LineItems[$OrderLine->LineNumber]->ItemDue= $LineDueDate; } @@ -736,13 +738,13 @@ 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><a href="' . $_SERVER['PHP_SELF'] . '?' . SID .'&identifier='.$identifier . '&Delete=' . $OrderLine->LineNumber . '" onclick="return confirm(\'' . _('Are You Sure?') . '\');">' . _('Delete') . '</a></td></tr>'; if ($_SESSION['AllowOrderLineItemNarrative'] == 1){ echo $RowStarter; - echo '<td valign="top" colspan="11">' . _('Narrative') . ':<textarea name="Narrative_' . $OrderLine->LineNumber . '" cols="100" rows="1">' . stripslashes(AddCarriageReturns($OrderLine->Narrative)) . '</textarea><br></td></tr>'; + echo '<td valign="top" colspan="11">' . _('Narrative') . ':<textarea name="Narrative_' . $OrderLine->LineNumber . '" cols="100" rows="1">' . stripslashes(AddCarriageReturns($OrderLine->Narrative)) . '</textarea><br /></td></tr>'; } else { - echo '<input type=hidden name="Narrative" value="">'; + echo '<input type="hidden" name="Narrative" value="" />'; } $_SESSION['Items'.$identifier]->total = $_SESSION['Items'.$identifier]->total + $SubTotal; @@ -752,31 +754,31 @@ } /* 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),2) . '</td> + <td class="number">' . number_format($TaxTotal,2) . '</td> + <td class="number">' . number_format(($_SESSION['Items'.$identifier]->total+$TaxTotal),2) . '</td> </tr> </table>'; echo '<table><tr><td>'; //nested table echo '<table><tr> <td>'. _('Picked Up By') .':</td> - <td><input type=text size=25 maxlength=25 name="DeliverTo" value="' . $_SESSION['Items'.$identifier]->DeliverTo . '"></td> + <td><input type="text" size="25" maxlength="25" name="DeliverTo" value="' . stripslashes($_SESSION['Items'.$identifier]->DeliverTo) . '" /></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="' . stripslashes($_SESSION['Items'.$identifier]->PhoneNo) . '" /></td> </tr>'; - echo '<tr><td>' . _('Contact Email') . ':</td><td><input type=text size=25 maxlength=30 name="Email" value="' . $_SESSION['Items'.$identifier]->Email . '"></td></tr>'; + echo '<tr><td>' . _('Contact Email') . ':</td><td><input type="text" size="25" maxlength="30" name="Email" value="' . stripslashes($_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="' . stripcslashes($_SESSION['Items'.$identifier]->CustRef) . '" /></td> </tr>'; echo '<tr> <td>'. _('Comments') .':</td> - <td><textarea name=Comments cols=23 rows=5>' . $_SESSION['Items'.$identifier]->Comments .'</textarea></td> + <td><textarea name="Comments" cols="23" rows="5">' . stripcslashes($_SESSION['Items'.$identifier]->Comments) .'</textarea></td> </tr>'; echo '</table>'; //end the sub table in the first column of master table echo '</td><th valign="bottom">'; //for the master table @@ -786,10 +788,10 @@ echo '<tr><td>' . _('Payment Type') . ':</td><td><select name="PaymentMethod">'; while ($PaymentMethodRow = DB_fetch_array($PaymentMethodsResult)){ - if ($_POST['PaymentMethod'] == $PaymentMethodRow['paymentid']){ - echo '<option selected value=' . $PaymentMethodRow['paymentid'] . '>' . $PaymentMethodRow['paymentname'] . '</option>'; + if (isset($_POST['PaymentMethod']) and $_POST['PaymentMethod'] == $PaymentMethodRow['paymentid']){ + echo '<option selected="True" value="' . $PaymentMethodRow['paymentid'] . '">' . $PaymentMethodRow['paymentname'] . '</option>'; } else { - echo '<option value=' . $PaymentMethodRow['paymentid'] . '>' . $PaymentMethodRow['paymentname'] . '</option>'; + echo '<option value="' . $PaymentMethodRow['paymentid'] . '">' . $PaymentMethodRow['paymentname'] . '</option>'; } } echo '</select></td></tr>'; @@ -798,10 +800,10 @@ echo '<tr><td>' . _('Banked to') . ':</td><td><select name="BankAccount">'; while ($BankAccountsRow = DB_fetch_array($BankAccountsResult)){ - if ($_POST['BankAccount'] == $BankAccountsRow['accountcode']){ - echo '<option selected value=' . $BankAccountsRow['accountcode'] . '>' . $BankAccountsRow['bankaccountname'] . '</option>'; + if (isset($_POST['BankAccount']) and $_POST['BankAccount'] == $BankAccountsRow['accountcode']){ + echo '<option selected="True" value="' . $BankAccountsRow['accountcode'] . '">' . $BankAccountsRow['bankaccountname'] . '</option>'; } else { - echo '<option value=' . $BankAccountsRow['accountcode'] . '>' . $BankAccountsRow['bankaccountname'] . '</option>'; + echo '<option value="' . $BankAccountsRow['accountcode'] . '">' . $BankAccountsRow['bankaccountname'] . '</option>'; } } echo '</select></td></tr>'; @@ -809,19 +811,19 @@ if (!isset($_POST['AmountPaid'])){ $_POST['AmountPaid'] =0; } - echo '<tr><td>' . _('Amount Paid') . ':</td><td><input type="text" class="number" name="AmountPaid" maxlength="12" size="12" value=' . $_POST['AmountPaid'] . '></td></tr>'; + echo '<tr><td>' . _('Amount Paid') . ':</td><td><input type="text" class="number" name="AmountPaid" maxlength="12" size="12" value="' . $_POST['AmountPaid'] . '" /></td></tr>'; echo '</table>'; //end the sub table in the second column of master table - echo '</td></tr></table>'; //end of column/row/master table - echo '<br><div class="centre"><input type=submit name="Recalculate" Value="' . _('Re-Calculate') . '"> - <input type=submit name="ProcessSale" value="' . _('Process The Sale') . '"></div><hr>'; + echo '</th></tr></table>'; //end of column/row/master table + echo '<br /><div class="centre"><input type="submit" name="Recalculate" value="' . _('Re-Calculate') . '" /> + <input type="submit" name="ProcessSale" value="' . _('Process The Sale') . '" /></div><hr />'; } # end of if lines /* ********************************** * Invoice Processing Here * ********************************** * */ -if (isset($_POST['ProcessSale']) && $_POST['ProcessSale'] != ""){ +if (isset($_POST['ProcessSale']) and $_POST['ProcessSale'] != ""){ $InputError = false; //always assume the best //but check for the worst @@ -829,7 +831,7 @@ prnMsg(_('There are no lines on this sale. Please enter lines to invoice first'),'error'); $InputError = true; } - if (ABS($_POST['AmountPaid'] -($_SESSION['Items'.$identifier]->total+$TaxTotal))>=0.01) { + if (abs($_POST['AmountPaid'] -($_SESSION['Items'.$identifier]->total+$TaxTotal))>=0.01) { prnMsg(_('The amount entered as payment does not equal the amount of the invoice. Please ensure the customer has paid the correct amount and re-enter'),'error'); $InputError = true; } @@ -855,7 +857,7 @@ prnMsg( _('Invoicing the selected order would result in negative stock. The system parameters are set to prohibit negative stocks from occurring. This invoice cannot be created until the stock on hand is corrected.'),'error',$OrderLine->StockID . ' ' . $CheckNegRow['description'] . ' - ' . _('Negative Stock Prohibited')); $NegativesFound = true; } - } elseif ($CheckNegRow['mbflag']=='A') { + } else if ($CheckNegRow['mbflag']=='A') { /*Now look for assembly components that would go negative */ $SQL = "SELECT bom.component, @@ -941,14 +943,14 @@ confirmeddate, deliverblind) VALUES ( - " . $OrderNo . ", + '" . $OrderNo . "', '" . $_SESSION['Items'.$identifier]->DebtorNo . "', '" . $_SESSION['Items'.$identifier]->Branch . "', '". DB_escape_string($_SESSION['Items'.$identifier]->CustRef) ."', '". DB_escape_string($_SESSION['Items'.$identifier]->Comments) ."', '" . Date("Y-m-d H:i") . "', '" . $_SESSION['Items'.$identifier]->DefaultSalesType . "', - " . $_SESSION['Items'.$identifier]->ShipVia . ", + '" . $_SESSION['Items'.$identifier]->ShipVia . "', '". DB_escape_string($_SESSION['Items'.$identifier]->DeliverTo) . "', '" . _('Counter Sale') . "', '" . $_SESSION['Items'.$identifier]->PhoneNo . "', @@ -978,17 +980,17 @@ foreach ($_SESSION['Items'.$identifier]->LineItems as $StockItem) { $LineItemsSQL = $StartOf_LineItemsSQL . - $StockItem->LineNumber . ', - ' . $OrderNo . ", + "'".$StockItem->LineNumber . "', + '" . $OrderNo . "', '" . $StockItem->StockID . "', - ". $StockItem->Price . ', - ' . $StockItem->Quantity . ', - ' . floatval($StockItem->DiscountPercent) . ", + '". $StockItem->Price . "', + '" . $StockItem->Quantity . "', + '" . floatval($StockItem->DiscountPercent) . "', '" . DB_escape_string($StockItem->Narrative) . "', '" . Date('Y-m-d') . "', '" . Date('Y-m-d') . "', - " . $StockItem->Quantity . ', - 1)'; + '" . $StockItem->Quantity . "', + 1)"; $ErrMsg = _('Unable to add the sales order line'); $Ins_LineItemResult = DB_query($LineItemsSQL,$db,$ErrMsg,$DbgMsg,true); @@ -998,7 +1000,7 @@ * and it is a real order (not just a quotation)*/ if ($StockItem->MBflag=='M' - AND $_SESSION['AutoCreateWOs']==1){ //oh yeah its all on! + and $_SESSION['AutoCreateWOs']==1){ //oh yeah its all on! //now get the data required to test to see if we need to make a new WO $QOHResult = DB_query("SELECT SUM(quantity) FROM locstock WHERE stockid='" . $StockItem->StockID . "'",$db); @@ -1064,7 +1066,7 @@ loccode, requiredby, startdate) - VALUES (" . $WONo . ", + VALUES ('" . $WONo . "', '" . $_SESSION['DefaultFactoryLocation'] . "', '" . Date('Y-m-d') . "', '" . Date('Y-m-d'). "')", @@ -1089,10 +1091,10 @@ stockid, qtyreqd, stdcost) - VALUES ( " . $WONo . ", + VALUES ('" . $WONo . "', '" . $StockItem->StockID . "', - " . $WOQuantity . ", - " . $Cost . ")"; + '" . $WOQuantity . "', + '" . $Cost . "')"; $ErrMsg = _('The work order item could not be added'); $result = DB_query($sql,$db,$ErrMsg,$DbgMsg,true); @@ -1104,32 +1106,33 @@ "\n" . _('These are for') . ' ' . $_SESSION['Items'.$identifier]->CustomerName . ' ' . _('there order ref') . ': ' . $_SESSION['Items'.$identifier]->CustRef . ' ' ._('our order number') . ': ' . $OrderNo; if ($StockItem->Serialised AND $StockItem->NextSerialNo>0){ - //then we must create the serial numbers for the new WO also - $FactoryManagerEmail .= "\n" . _('The following serial numbers have been reserved for this work order') . ':'; + //then we must create the serial numbers for the new WO also + $FactoryManagerEmail .= "\n" . _('The following serial numbers have been reserved for this work order') . ':'; - for ($i=0;$i<$WOQuantity;$i++){ + for ($i=0;$i<$WOQuantity;$i++){ - $result = DB_query("SELECT serialno FROM stockserialitems + $result = DB_query("SELECT serialno FROM stockserialitems WHERE serialno='" . ($StockItem->NextSerialNo + $i) . "' AND stockid='" . $StockItem->StockID ."'",$db); - if (DB_num_rows($result)!=0){ - $WOQuantity++; - prnMsg(($StockItem->NextSerialNo + $i) . ': ' . _('This automatically generated serial number already exists - it cannot be added to the work order'),'error'); - } else { - $sql = 'INSERT INTO woserialnos (wo, + if (DB_num_rows($result)!=0){ + $WOQuantity++; + prnMsg(($StockItem->NextSerialNo + $i) . ': ' . _('This automatically generated serial number already exists - it cannot be added to the work order'),'error'); + } else { + $sql = "INSERT INTO woserialnos (wo, stockid, serialno) - VALUES (' . $WONo . ", + VALUES ('" . $WONo . "', '" . $StockItem->StockID . "', - " . ($StockItem->NextSerialNo + $i) . ')'; - $ErrMsg = _('The serial number for the work order item could not be added'); - $result = DB_query($sql,$db,$ErrMsg,$DbgMsg,true); - $FactoryManagerEmail .= "\n" . ($StockItem->NextSerialNo + $i); - } - } //end loop around creation of woserialnos - $NewNextSerialNo = ($StockItem->NextSerialNo + $WOQuantity +1); - $ErrMsg = _('Could not update the new next serial number for the item'); - $UpdateNextSerialNoResult = DB_query('UPDATE stockmaster SET nextserialno=' . $NewNextSerialNo . " WHERE stockid='" . $StockItem->StockID . "'",$db,$ErrMsg,$DbgMsg,true); + '" . ($StockItem->NextSerialNo + $i) . "')"; + $ErrMsg = _('The serial number for the work order item could not be added'); + $result = DB_query($sql,$db,$ErrMsg,$DbgMsg,true); + $FactoryManagerEmail .= "\n" . ($StockItem->NextSerialNo + $i); + } + } //end loop around creation of woserialnos + $NewNextSerialNo = ($StockItem->NextSerialNo + $WOQuantity +1); + $ErrMsg = _('Could not update the new next serial number for the item'); + $UpdateSQL="UPDATE stockmaster SET nextserialno='" . $NewNextSerialNo . "' WHERE stockid='" . $StockItem->StockID . "'"; + $UpdateNextSerialNoResult = DB_query($UpdateSQL,$db,$ErrMsg,$DbgMsg,true); } // end if the item is serialised and nextserialno is set $EmailSubject = _('New Work Order Number') . ' ' . $WONo . ' ' . _('for') . ' ' . $StockItem->StockID . ' x ' . $WOQuantity; @@ -1158,7 +1161,7 @@ $DefaultDispatchDate = Date('Y-m-d'); /*Update order header for invoice charged on */ - $SQL = "UPDATE salesorders SET comments = CONCAT(comments,'" . ' ' . _('Invoice') . ': ' . "','" . $InvoiceNo . "') WHERE orderno= " . $OrderNo; + $SQL = "UPDATE salesorders SET comments = CONCAT(comments,'" . ' ' . _('Invoice') . ': ' . "','" . $InvoiceNo . "') WHERE orderno= '" . $OrderNo."'"; $ErrMsg = _('CRITICAL ERROR') . ' ' . _('NOTE DOWN THIS ERROR AND SEEK ASSISTANCE') . ': ' . _('The sales order header could not be updated with the invoice number'); $DbgMsg = _('The following SQL to update the sales order was used'); @@ -1184,22 +1187,22 @@ shipvia, alloc ) VALUES ( - ". $InvoiceNo . ", + '". $InvoiceNo . "', 10, '" . $_SESSION['Items'.$identifier]->DebtorNo . "', '" . $_SESSION['Items'.$identifier]->Branch . "', '" . $DefaultDispatchDate . "', '" . date('Y-m-d H-i-s') . "', - " . $PeriodNo . ", + '" . $PeriodNo . "', '" . $_SESSION['Items'.$identifier]->CustRef . "', '" . $_SESSION['Items'.$identifier]->DefaultSalesType . "', - " . $OrderNo . ", - " . $_SESSION['Items'.$identifier]->total . ", - " . $TaxTotal . ", - " . $ExRate . ", + '" . $OrderNo . "', + '" . $_SESSION['Items'.$identifier]->total . "', + '" . $TaxTotal . "', + '" . $ExRate . "', '" . $_SESSION['Items'.$identifier]->Comments . "', - " . $_SESSION['Items'.$identifier]->ShipVia . ', - ' . ($_SESSION['Items'.$identifier]->total + $TaxTotal) . ')'; + '" . $_SESSION['Items'.$identifier]->ShipVia . "', + '" . ($_SESSION['Items'.$identifier]->total + $TaxTotal) . "')"; $ErrMsg =_('CRITICAL ERROR') . '! ' . _('NOTE DOWN THIS ERROR AND SEEK ASSISTANCE') . ': ' . _('The debtor transaction record could not be inserted because'); $DbgMsg = _('The following SQL to insert the debtor transaction record was used'); @@ -1210,12 +1213,12 @@ /* Insert the tax totals for each tax authority where tax was charged on the invoice */ foreach ($TaxTotals AS $TaxAuthID => $TaxAmount) { - $SQL = 'INSERT INTO debtortranstaxes (debtortransid, + $SQL = "INSERT INTO debtortranstaxes (debtortransid, taxauthid, taxamount) - VALUES (' . $DebtorTransID . ', - ' . $TaxAuthID . ', - ' . $TaxAmount/$ExRate . ')'; + VALUES ('" . $DebtorTransID . "', + '" . $TaxAuthID . "', + '" . $TaxAmount/$ExRate . "')"; $ErrMsg =_('CRITICAL ERROR') . '! ' . _('NOTE DOWN THIS ERROR AND SEEK ASSISTANCE') . ': ' . _('The debtor transaction taxes records could not be inserted because'); $DbgMsg = _('The following SQL to insert the debtor transaction taxes record was used'); @@ -1234,7 +1237,7 @@ /* Need to get the current location quantity will need it later for the stock movement */ - $SQL="SELECT locstock.quantity + $SQL="SELECT locstock.quantity FROM locstock WHERE locstock.stockid='" . $OrderLine->StockID . "' AND loccode= '" . $_SESSION['Items'.$identifier]->Location . "'"; @@ -1290,9 +1293,9 @@ $ErrMsg = _('CRITICAL ERROR') . '! ' . _('NOTE DOWN THIS ERROR AND SEEK ASSISTANCE') . ': ' . _('Can not retrieve assembly components location stock quantities because '); $DbgMsg = _('The SQL that failed was'); $Result = DB_query($SQL,$db,$ErrMsg,$DbgMsg,true); - if (DB_num_rows($Result)==1){ - $LocQtyRow = DB_fetch_row($Result); - $QtyOnHandPrior = $LocQtyRow[0]; + if (DB_num_rows($Result)==1){ + $LocQtyRow = DB_fetch_row($Result); + $QtyOnHandPrior = $LocQtyRow[0]; } else { /*There must be some error this should never happen */ $QtyOnHandPrior = 0; @@ -1317,17 +1320,17 @@ ) VALUES ( '" . $AssParts['component'] . "', 10, - " . $InvoiceNo . ", - '" . $_SESSION['Items'.$identifier]->Location . "', - '" . $DefaultDispatchDate . "', - '" . $_SESSION['Items'.$identifier]->DebtorNo . "', - '" . $_SESSION['Items'.$identifier]->Branch . "', - " . $PeriodNo . ", - '" . _('Assembly') . ': ' . $OrderLine->StockID . ' ' . _('Order') . ': ' . $OrderNo . "', - " . -$AssParts['quantity'] * $OrderLine->Quantity . ", - " . $AssParts['standard'] . ", - 0, - newqoh-" . ($AssParts['quantity'] * $OrderLine->Quantity) . " + '" . $InvoiceNo . "', + '" . $_SESSION['Items'.$identifier]->Location . "', + '" . $DefaultDispatchDate . "', + '" . $_SESSION['Items'.$identifier]->DebtorNo . "', + '" . $_SESSION['Items'.$identifier]->Branch . "', + '" . $PeriodNo . "', + '" . _('Assembly') . ': ' . $OrderLine->StockID . ' ' . _('Order') . ': ' . $OrderNo . "', + '" . -$AssParts['quantity'] * $OrderLine->Quantity . "', + '" . $AssParts['standard'] . "', + 0, + newqoh-" . ($AssParts['quantity'] * $OrderLine->Quantity) . " )"; $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'); @@ -1375,18 +1378,18 @@ narrative ) VALUES ('" . $OrderLine->StockID . "', 10, - " . $InvoiceNo . ", + '" . $InvoiceNo . "', '" . $_SESSION['Items'.$identifier]->Location . "', '" . $DefaultDispatchDate . "', '" . $_SESSION['Items'.$identifier]->DebtorNo . "', '" . $_SESSION['Items'.$identifier]->Branch . "', - " . $LocalCurrencyPrice . ", - " . $PeriodNo . ", + '" . $LocalCurrencyPrice . "', + '" . $PeriodNo . "', '" . $OrderNo . "', - " . -$OrderLine->Quantity . ", - " . $OrderLine->DiscountPercent . ", - " . $OrderLine->StandardCost . ", - " . ($QtyOnHandPrior - $OrderLine->Quantity) . ", + '" . -$OrderLine->Quantity . "', + '" . $OrderLine->DiscountPercent . "', + '" . $OrderLine->StandardCost . "', + '" . ($QtyOnHandPrior - $OrderLine->Quantity) . "', '" . DB_escape_string($OrderLine->Narrative) . "' )"; } else { // its an assembly or dummy and assemblies/dummies always have nil stock (by definition they are made up at the time of dispatch so new qty on hand will be nil @@ -1410,17 +1413,17 @@ narrative ) VALUES ('" . $OrderLine->StockID . "', 10, - " . $InvoiceNo . ", + '" . $InvoiceNo . "', '" . $_SESSION['Items'.$identifier]->Location . "', '" . $DefaultDispatchDate . "', '" . $_SESSION['Items'.$identifier]->DebtorNo . "', '" . $_SESSION['Items'.$identifier]->Branch . "', - " . $LocalCurrencyPrice . ", - " . $PeriodNo . ", + '" . $LocalCurrencyPrice . "', + '" . $PeriodNo . "', '" . $OrderNo . "', - " . -$OrderLine->Quantity . ", - " . $OrderLine->DiscountPercent . ", - " . $OrderLine->StandardCost . ", + '" . -$OrderLine->Quantity . "', + '" . $OrderLine->DiscountPercent . "', + '" . $OrderLine->StandardCost . "', '" . DB_escape_string($OrderLine->Narrative) . "')"; } @@ -1434,16 +1437,16 @@ /*Insert the taxes that applied to this line */ foreach ($OrderLine->Taxes as $Tax) { - $SQL = 'INSERT INTO stockmovestaxes (stkmoveno, + $SQL = "INSERT INTO stockmovestaxes (stkmoveno, taxauthid, taxrate, taxcalculationorder, taxontax) - VALUES (' . $StkMoveNo . ', - ' . $Tax->TaxAuthID . ', - ' . $Tax->TaxRate . ', - ' . $Tax->TaxCalculationOrder . ', - ' . $Tax->TaxOnTax . ')'; + VALUES ('" . $StkMoveNo . "', + '" . $Tax->TaxAuthID . "', + '" . $Tax->TaxRate . "', + '" . $Tax->TaxCalculationOrder . "', + '" . $Tax->TaxOnTax . "')"; $ErrMsg = _('CRITICAL ERROR') . '! ' . _('NOTE DOWN THIS ERROR AND SEEK ASSISTANCE') . ': ' . _('Taxes and rates applicable to this invoice line item could not be inserted because'); $DbgMsg = _('The following SQL to insert the stock movement tax detail records was used'); @@ -1510,7 +1513,7 @@ AND salesanalysis.area=custbranch.area AND salesanalysis.salesperson=custbranch.salesman AND salesanalysis.typeabbrev ='" . $_SESSION['Items'.$identifier]->DefaultSalesType . "' - AND salesanalysis.periodno=" . $PeriodNo . " + AND salesanalysis.periodno='" . $PeriodNo . "' AND salesanalysis.cust " . LIKE . " '" . $_SESSION['Items'.$identifier]->DebtorNo . "' AND salesanalysis.custbranch " . LIKE . " '" . $_SESSION['Items'.$identifier]->Branch . "' AND salesanalysis.stockid " . LIKE . " '" . $OrderLine->StockID . "' @@ -1540,7 +1543,7 @@ WHERE salesanalysis.area='" . $myrow[5] . "' AND salesanalysis.salesperson='" . $myrow[8] . "' AND typeabbrev ='" . $_SESSION['Items'.$identifier]->DefaultSalesType . "' - AND periodno = " . $PeriodNo . " + AND periodno = '" . $PeriodNo . "' AND cust " . LIKE . " '" . $_SESSION['Items'.$identifier]->DebtorNo . "' AND custbranch " . LIKE . " '" . $_SESSION['Items'.$identifier]->Branch . "' AND stockid " . LIKE . " '" . $OrderLine->StockID . "' @@ -1563,13 +1566,13 @@ salesperson, stkcategory ) SELECT '" . $_SESSION['Items'.$identifier]->DefaultSalesType . "', - " . $PeriodNo . ", - " . ($OrderLine->Price * $OrderLine->Quantity / $ExRate) . ", - " . ($OrderLine->StandardCost * $OrderLine->Quantity) . ", + '" . $PeriodNo . "', + '" . ($OrderLine->Price * $OrderLine->Quantity / $ExRate) . "', + '" . ($OrderLine->StandardCost * $OrderLine->Quantity) . "', '" . $_SESSION['Items'.$identifier]->DebtorNo . "', '" . $_SESSION['Items'.$identifier]->Branch . "', - " . $OrderLine->Quantity . ", - " . ($OrderLine->DiscountPercent * $OrderLine->Price * $OrderLine->Quantity / $ExRate) . ", + '" . $OrderLine->Quantity . "', + '" . ($OrderLine->DiscountPercent * $OrderLine->Price * $OrderLine->Quantity / $ExRate) . "', '" . $OrderLine->StockID . "', custbranch.area, 1, @@ -1600,7 +1603,7 @@ narrative, amount) VALUES ( 10, - " . $InvoiceNo . ", + '" . $InvoiceNo . "', '" . $DefaultDispatchDate . "', '" . $PeriodNo . "', '" . GetCOGSGLAccount($Area, $OrderLine->StockID, $_SESSION['Items'.$identifier]->DefaultSalesType, $db) . "', @@ -1622,7 +1625,7 @@ narrative, amount ) VALUES ( 10, - " . $InvoiceNo . ", + '" . $InvoiceNo . "', '" . $DefaultDispatchDate . "', '" . $PeriodNo . "', '" . $StockGLCode['stockact'] . "', @@ -1648,7 +1651,7 @@ amount ) VALUES ( 10, - " . $InvoiceNo . ", + '" . $InvoiceNo . "', '" . $DefaultDispatchDate . "', '" . $PeriodNo . "', '" . $SalesGLAccounts['salesglcode'] . "', @@ -1656,7 +1659,7 @@ '" . (-$OrderLine->Price * $OrderLine->Quantity/$ExRate) . "')"; $ErrMsg = _('CRITICAL ERROR') . '! ' . _('NOTE DOWN THIS ERROR AND SEEK ASSISTANCE') . ': ' . _('The sales GL posting could not be inserted because'); - $DbgMsg = '<br>' ._('The following SQL to insert the GLTrans record was used'); + $DbgMsg = '<br />' ._('The following SQL to insert the GLTrans record was used'); $Result = DB_query($SQL,$db,$ErrMsg,$DbgMsg,true); if ($OrderLine->DiscountPercent !=0){ @@ -1670,7 +1673,7 @@ amount ) VALUES ( 10, - " . $InvoiceNo . ", + '" . $InvoiceNo . "', '" . $DefaultDispatchDate . "', '" . $PeriodNo . "', '" . $SalesGLAccounts['discountglcode'] . "', @@ -1696,7 +1699,7 @@ narrative, amount ) VALUES ( 10, - " . $InvoiceNo . ", + '" . $InvoiceNo . "', '" . $DefaultDispatchDate . "', '" . $PeriodNo . "', '" . $_SESSION['CompanyRecord']['debtorsact'] . "', @@ -1719,7 +1722,7 @@ narrative, amount ) VALUES ( 10, - " . $InvoiceNo . ", + '" . $InvoiceNo . "', '" . $DefaultDispatchDate . "', '" . $PeriodNo . "', '" . $TaxGLCodes[$TaxAuthID] . "', @@ -1736,7 +1739,7 @@ if ($_POST['AmountPaid']!=0){ $ReceiptNumber = GetNextTransNo(12,$db); - $SQL='INSERT INTO gltrans (type, + $SQL="INSERT INTO gltrans (type, typeno, trandate, periodno, @@ -1744,7 +1747,7 @@ narrative, amount) VALUES (12, - ' . $ReceiptNumber . ", + '" . $ReceiptNumber . "', '" . $DefaultDispatchDate . "', '" . $PeriodNo . "', '" . $_POST['BankAccount'] . "', @@ -1755,7 +1758,7 @@ $result = DB_query($SQL,$db,$ErrMsg,$DbgMsg,true); /* Now Credit Debtors account with receipt */ - $SQL='INSERT INTO gltrans ( type, + $SQL="INSERT INTO gltrans ( type, typeno, trandate, periodno, @@ -1763,7 +1766,7 @@ narrative, amount) VALUES (12, - ' . $ReceiptNumber . ", + '" . $ReceiptNumber . "', '" . $DefaultDispatchDate . "', '" . $PeriodNo . "', '" . $_SESSION['CompanyRecord']['debtorsact'] . "', @@ -1827,7 +1830,7 @@ //insert a new debtortrans for the receipt - $SQL = 'INSERT INTO debtortrans (transno, + $SQL = "INSERT INTO debtortrans (transno, type, debtorno, trandate, @@ -1838,7 +1841,7 @@ ovamount, alloc, invtext) - VALUES (' . $ReceiptNumber . ", + VALUES ('" . $ReceiptNumber . "', 12, '" . $_SESSION['Items'.$identifier]->DebtorNo . "', '" . $DefaultDispatchDate . "', @@ -1866,11 +1869,11 @@ //and finally add the allocation record between receipt and invoice - $SQL = 'INSERT INTO custallocns ( amt, + $SQL = "INSERT INTO custallocns ( amt, datealloc, transid_allocfrom, transid_allocto ) - VALUES (' . $_POST['AmountPaid'] . ", + VALUES ('" . $_POST['AmountPaid'] . "', '" . $DefaultDispatchDate . "', '" . $ReceiptDebtorTransID . "', '" . $DebtorTransID . "')"; @@ -1889,14 +1892,14 @@ echo prnMsg( _('Invoice number'). ' '. $InvoiceNo .' '. _('processed'), 'success'); - echo '<br><div class="centre">'; + 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?' . SID . '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?' . SID . '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>'; + echo '<br /><br /><a href="' .$_SERVER['PHP_SELF'] . '">' . _('Start a new Counter Sale') . '</a></div>'; } // There were input errors so don't process nuffin @@ -1912,9 +1915,9 @@ /* Now show the stock item selection search stuff below */ if (!isset($_POST['ProcessSale'])){ - if (isset($_POST['PartSearch']) && $_POST['PartSearch']!=''){ + if (isset($_POST['PartSearch']) and $_POST['PartSearch']!=''){ - echo '<input type="hidden" name="PartSearch" value="' . _('Yes Please') . '">'; + echo '<input type="hidden" name="PartSearch" value="' . _('Yes Please') . '" />'; if ($_SESSION['FrequentlyOrderedItems']>0){ //show the Frequently Order Items selection where configured to do so @@ -1936,7 +1939,7 @@ $result2 = DB_query($SQL,$db); echo '<p class="page_title_text"><img src="'.$rootpath.'/css/'.$theme.'/images/magnifier.png" title="' . _('Search') . '" alt="" />' . ' '; echo _('Frequently Ordered Items') . '</p><br />'; - echo '<div class="page_help_text">' . _('Frequently Ordered Items') . _(', shows the most frequently ordered items in the last 6 months. You can choose from this list, or search further for other items') . '.</div><br>'; + echo '<div class="page_help_text">' . _('Frequently Ordered Items') . _(', shows the most frequently ordered items in the last 6 months. You can choose from this list, or search further for other items') . '.</div><br />'; echo '<table class="table1">'; $TableHeader = '<tr><th>' . _('Code') . '</th> <th>' . _('Description') . '</th> @@ -1954,13 +1957,13 @@ // This code needs sorting out, but until then : $ImageSource = _('No Image'); // Find the quantity in stock at location - $qohsql = "SELECT sum(quantity) + $QohSql = "SELECT sum(quantity) FROM locstock WHERE stockid='" .$myrow['stockid'] . "' AND loccode = '" . $_SESSION['Items'.$identifier]->Location . "'"; - $qohresult = DB_query($qohsql,$db); - $qohrow = DB_fetch_row($qohresult); - $qoh = $qohrow[0]; + $QohResult = DB_query($QohSql,$db); + $QohRow = DB_fetch_row($QohResult); + $QOH = $QohRow[0]; // Find the quantity on outstanding sales orders $sql = "SELECT SUM(salesorderdetails.quantity-salesorderdetails.qtyinvoiced) AS dem @@ -2020,7 +2023,7 @@ } $OnOrder = $PurchQty + $WoQty; - $Available = $qoh - $DemandQty + $OnOrder; + $Available = $QOH - $DemandQty + $OnOrder; printf('<td>%s</font></td> <td>%s</td> @@ -2029,13 +2032,13 @@ <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'.$myrow['stockid'].'" value="0" /> </td> </tr>', $myrow['stockid'], $myrow['description'], $myrow['units'], - $qoh, + $QOH, $DemandQty, $OnOrder, $Available, @@ -2050,22 +2053,22 @@ #end of page full new headings if } #end of while loop for Frequently Ordered Items - echo '<td style="text-align:center" colspan=8><input type="hidden" name="order_items" value=1><input tabindex='.number_format($j+8).' type="submit" value="'._('Add to Sale').'"></td>'; + echo '<td style="text-align:center" colspan="8"><input type="hidden" name="OrderItems" value="1" /><input tabindex='.number_format($j+8).' type="submit" value="'._('Add to Sale').'" /></td>'; echo '</table>'; } //end of if Frequently Ordered Items > 0 if (isset($msg)){ - echo '<p><div class="centre"><b><p>' . $msg . '</b></p>'; + echo '<p><div class="centre"><b>' . $msg . '</b></div></p>'; } echo '<p class="page_title_text"><img src="'.$rootpath.'/css/'.$theme.'/images/magnifier.png" title="' . _('Search') . '" alt="" />' . ' '; echo _('Search for Items') . '</p>'; - echo '<div class="page_help_text">' . _('Search for Items') . _(', Searches the database for items, you can narrow the results by selecting a stock category, or just enter a partial item description or partial item code') . '.</div><br>'; - echo '<table class="selection"><tr><td><b>' . _('Select a Stock Category') . ': </b><select tabindex=1 name="StockCat">'; + echo '<div class="page_help_text">' . _('Search for Items') . _(', Searches the database for items, you can narrow the results by selecting a stock category, or just enter a partial item description or partial item code') . '.</div><br />'; + echo '<table class="selection"><tr><td><b>' . _('Select a Stock Category') . ': </b><select tabindex="1" name="StockCat">'; if (!isset($_POST['StockCat'])){ - echo "<option selected value='All'>" . _('All'); + echo "<option selected='True' value='All'>" . _('All').'</option>'; $_POST['StockCat'] ='All'; } else { - echo "<option value='All'>" . _('All'); + echo "<option value='All'>" . _('All').'</option>'; } $SQL="SELECT categoryid, categorydescription @@ -2075,9 +2078,9 @@ $result1 = DB_query($SQL,$db); while ($myrow1 = DB_fetch_array($result1)) { if ($_POST['StockCat']==$myrow1['categoryid']){ - echo '<option selected value=' . $myrow1['categoryid'] . '>' . $myrow1['categorydescription']; + echo '<option selected="True" value="' . $myrow1['categoryid'] . '">' . $myrow1['categorydescription'].'</option>'; } else { - echo '<option value='. $myrow1['categoryid'] . '>' . $myrow1['categorydescription']; + echo '<option value="'. $myrow1['categoryid'] . '">' . $myrow1['categorydescription'].'</option>'; } } @@ -2085,38 +2088,37 @@ </select></td> <td><b><?php echo _('Enter partial Description'); ?>:</b> - <input tabindex=2 type="Text" name="Keywords" size=20 maxlength=25 value="<?php if (isset($_POST['Keywords'])) echo $_POST['Keywords']; ?>"></td> + <input tabindex="2" type="text" name="Keywords" size="20" maxlength="25" value="<?php if (isset($_POST['Keywords'])) echo $_POST['Keywords']; ?>" /></td> <td align="right"><b><?php echo _('OR'); ?> </b><b><?php echo _('Enter extract of the Stock Code'); ?>:</b> - <input tabindex=3 type="Text" name="StockCode" size=15 maxlength=18 value="<?php if (isset($_POST['StockCode'])) echo $_POST['StockCode']; ?>"></td> + <input tabindex="3" type="text" name="StockCode" size="15" maxlength="18" value="<?php if (isset($_POST['StockCode'])) echo $_POST['StockCode']; ?>" /></td> </tr><tr> - <td style="text-align:center" colspan=1><input tabindex=4 type=submit name="Search" value="<?php echo _('Search Now'); ?>"></td> - <td style="text-align:center" colspan=1><input tabindex=5 type=submit name="QuickEntry" value="<?php echo _('Use Quick Entry'); ?>"></td> + <td style="text-align:center" colspan="1"><input tabindex="4" type="submit" name="Search" value="<?php echo _('Search Now'); ?>" /></td> + <td style="text-align:center" colspan="1"><input tabindex="5" type="submit" name="QuickEntry" value="<?php echo _('Use Quick Entry'); ?>" /></td> <?php if (!isset($_POST['PartSearch'])) { echo '<script type="text/javascript">if (document.SelectParts) {defaultControl(document.SelectParts.Keywords);}</script>'; } - echo '</tr></table><br>'; - echo '</b>'; + echo '</tr></table><br />'; // Add some useful help as the order progresses if (isset($SearchResult)) { - echo '<br>'; + echo '<br />'; echo '<div class="page_help_text">' . _('Select an item by entering the quantity required. Click Order when ready.') . '</div>'; - echo '<br>'; + echo '<br />'; } if (isset($SearchResult)) { $j = 1; - echo '<form action="' . $_SERVER['PHP_SELF'] . '?' . SID .'identifier='.$identifier . ' method=post name="orderform">'; + echo '<form action="' . $_SERVER['PHP_SELF'] . '?' . SID .'identifier='.$identifier . '" method="post" name="orderform">'; echo '<input type="hidden" name="FormID" value="' . $_SESSION['FormID'] . '" />'; echo '<table class="table1">'; - echo '<tr><td colspan=><input type="hidden" name="previous" value='.number_format($Offset-1).'><input tabindex='.number_format($j+7).' type="submit" name="Prev" value="'._('Prev').'"></td>'; - echo '<td style="text-align:center" colspan=6><input type="hidden" name="order_items" value=1><input tabindex='.number_format($j+8).' type="submit" value="'._('Add to Sale').'"></td>'; - echo '<td colspan=><input type="hidden" name="nextlist" value='.number_format($Offset+1).'><input tabindex='.number_format($j+9).' type="submit" name="Next" value="'._('Next').'"></td></tr>'; + echo '<tr><td><input type="hidden" name="previous" value="'.number_format($Offset-1).'" /><input tabindex="'.number_format($j+7).'" type="submit" name="Prev" value="'._('Prev').'" /></td>'; + echo '<td style="text-align:center" colspan="6"><input type="hidden" name="OrderItems" value="1" /><input tabindex="'.number_format($j+8).'" type="submit" value="'._('Add to Sale').'" /></td>'; + echo '<td><input type="hidden" name="NextList" value="'.number_format($Offset+1).'" /><input tabindex="'.number_format($j+9).'" type="submit" name="Next" value="'._('Next').'" /></td></tr>'; $TableHeader = '<tr><th>' . _('Code') . '</th> <th>' . _('Description') . '</th> <th>' . _('Units') . '</th> @@ -2146,13 +2148,13 @@ */ // Find the quantity in stock at location - $qohsql = "SELECT sum(quantity) + $QohSql = "SELECT sum(quantity) FROM locstock WHERE stockid='" .$myrow['stockid'] . "' AND loccode = '" . $_SESSION['Items'.$identifier]->Location . "'"; - $qohresult = DB_query($qohsql,$db); - $qohrow = DB_fetch_row($qohresult); - $qoh = $qohrow[0]; + $qohresult = DB_query($QohSql,$db); + $QohRow = DB_fetch_row($QohResult); + $QOH = $qohrow[0]; // Find the quantity on outstanding sales orders $sql = "SELECT SUM(salesorderdetails.quantity-salesorderdetails.qtyinvoiced) AS... [truncated message content] |
From: <dai...@us...> - 2011-01-04 00:34:35
|
Revision: 4458 http://web-erp.svn.sourceforge.net/web-erp/?rev=4458&view=rev Author: daintree Date: 2011-01-04 00:34:27 +0000 (Tue, 04 Jan 2011) Log Message: ----------- various Modified Paths: -------------- trunk/Areas.php trunk/ContractBOM.php trunk/ContractCosting.php trunk/ContractOtherReqts.php trunk/Contracts.php trunk/EmailConfirmation.php trunk/MailSalesReport_csv.php trunk/PO_Header.php trunk/PO_Items.php trunk/PO_SelectOSPurchOrder.php trunk/PO_SelectPurchOrder.php trunk/RecurringSalesOrdersProcess.php trunk/SelectContract.php trunk/SelectProduct.php trunk/UpgradeDatabase.php trunk/doc/Change.log.html trunk/doc/Manual/ManualContents.php trunk/includes/ConnectDB.inc trunk/includes/DefineContractClass.php trunk/includes/DefinePOClass.php trunk/includes/GetConfig.php trunk/includes/PO_ReadInOrder.inc trunk/includes/UserLogin.php trunk/includes/session.inc trunk/index.php trunk/sql/mysql/upgrade3.09-3.10.sql trunk/sql/mysql/upgrade3.10-3.11.sql trunk/sql/mysql/upgrade3.11.1-4.00.sql Modified: trunk/Areas.php =================================================================== --- trunk/Areas.php 2010-12-30 22:10:43 UTC (rev 4457) +++ trunk/Areas.php 2011-01-04 00:34:27 UTC (rev 4458) @@ -180,7 +180,7 @@ if (!isset($_GET['delete'])) { - echo "<form method='post' action=" . $_SERVER['PHP_SELF'] . '?' . SID . '><br>'; + echo '<form method="post" action="' . $_SERVER['PHP_SELF'] . '?' . SID . '"><br>'; echo '<input type="hidden" name="FormID" value="' . $_SESSION['FormID'] . '" />'; if (isset($SelectedArea)) { Modified: trunk/ContractBOM.php =================================================================== --- trunk/ContractBOM.php 2010-12-30 22:10:43 UTC (rev 4457) +++ trunk/ContractBOM.php 2011-01-04 00:34:27 UTC (rev 4458) @@ -38,8 +38,8 @@ if (isset($_POST['BackToHeader'])){ - echo '<meta http-equiv="Refresh" content="0; url=' . $rootpath . '/Contracts.php?' . SID . 'identifier='.$identifier. '">'; - echo '<p>'; + echo '<meta http-equiv="Refresh" content="0; url=' . $rootpath . '/Contracts.php?' . SID . 'identifier='.$identifier. '" />'; + echo '<br />'; prnMsg(_('You should automatically be forwarded to the Contract page. If this does not happen perhaps the browser does not support META Refresh') . '<a href="' . $rootpath . '/Contracts.php?' . SID. 'identifier='.$identifier . '">' . _('click here') . '</a> ' . _('to continue'),'info'); include('includes/footer.inc'); exit; @@ -144,7 +144,7 @@ $DbgMsg = _('The SQL statement that failed was'); $SearchResult = DB_query($sql,$db,$ErrMsg,$DbgMsg); - if (DB_num_rows($SearchResult)==0 && $debug==1){ + if (DB_num_rows($SearchResult)==0 AND $debug==1){ prnMsg( _('There are no products to display matching the criteria provided'),'warn'); } if (DB_num_rows($SearchResult)==1){ @@ -212,7 +212,7 @@ } else { prnMsg (_('The item code') . ' ' . $ItemCode . ' ' . _('does not exist in the database and therefore cannot be added to the contract BOM'),'error'); if ($debug==1){ - echo "<br>".$sql; + echo "<br />".$sql; } include('includes/footer.inc'); exit; @@ -231,11 +231,12 @@ echo '<p class="page_title_text"><img src="'.$rootpath.'/css/'.$theme.'/images/contract.png" title="' . _('Contract Bill of Material') . '" alt="" /> '.$_SESSION['Contract'.$identifier]->CustomerName . '</p>'; + echo '<table cellpadding="2" class="selection">'; + if (isset($_SESSION['Contract'.$identifier]->ContractRef)) { - echo ' ' . _('Contract Reference:') .' '. $_SESSION['Contract'.$identifier]->ContractRef; + echo '<tr><th colspan="7"><font color="navy" size="2">' . _('Contract Reference:') .' '. $_SESSION['Contract'.$identifier]->ContractRef.'</font></th></tr>'; } - echo '<table cellpadding=2 colspan=7 border=1>'; echo '<tr> <th>' . _('Item Code') . '</th> <th>' . _('Description') . '</th> @@ -264,18 +265,18 @@ echo '<td>' . $ContractComponent->StockID . '</td> <td>' . $ContractComponent->ItemDescription . '</td> - <td><input type=text class="number" name="Qty' . $ContractComponent->ComponentID . '" size="11" value="' . $ContractComponent->Quantity . '"></td> + <td><input type="text" class="number" name="Qty' . $ContractComponent->ComponentID . '" size="11" value="' . $ContractComponent->Quantity . '" /></td> <td>' . $ContractComponent->UOM . '</td> <td class="number">' . $ContractComponent->ItemCost . '</td> <td class="number">' . $DisplayLineTotal . '</td> - <td><a href="' . $_SERVER['PHP_SELF'] . '?' . SID . 'identifier='.$identifier. '&Delete=' . $ContractComponent->ComponentID . '">' . _('Delete') . '</a></td></tr>'; + <td><a href="' . $_SERVER['PHP_SELF'] . '?' . SID . 'identifier='.$identifier. '&Delete=' . $ContractComponent->ComponentID . '">' . _('Delete') . '</a></td></tr>'; $TotalCost += $LineTotal; } $DisplayTotal = number_format($TotalCost,2); - echo '<tr><td colspan=6 class="number">' . _('Total Cost') . '</td><td class="number"><b>' . $DisplayTotal . '</b></td></tr></table>'; - echo '<br><div class="centre"><input type="submit" name="UpdateLines" value="' . _('Update Order Lines') . '">'; - echo ' <input type="submit" name="BackToHeader" value="' . _('Back To Contract Header') . '">'; + echo '<tr><td colspan="6" class="number">' . _('Total Cost') . '</td><td class="number"><b>' . $DisplayTotal . '</b></td></tr></table>'; + echo '<br /><div class="centre"><input type="submit" name="UpdateLines" value="' . _('Update Lines') . '" />'; + echo '<input type="submit" name="BackToHeader" value="' . _('Back To Contract Header') . '" /></div>'; } /*Only display the contract BOM lines if there are any !! */ @@ -289,18 +290,18 @@ $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); + echo '<p class="page_title_text"><img src="'.$rootpath.'/css/'.$theme.'/images/magnifier.png" title="' . + _('Print') . '" alt="" />' . ' ' . _('Search For Stock Items') . '</p>'; + echo '<table class="selection"><tr>'; - echo '<table class=selection><tr><p class="page_title_text"><img src="'.$rootpath.'/css/'.$theme.'/images/magnifier.png" title="' . - _('Print') . '" alt="">' . ' ' . _('Search For Stock Items') . ''; + echo ":</tr><tr><td><select name='StockCat'>"; - echo ":</font></tr><tr><td><select name='StockCat'>"; - - echo "<option selected value='All'>" . _('All'); + echo "<option selected='True' value='All'>" . _('All').'</option>'; while ($myrow1 = DB_fetch_array($result1)) { if (isset($_POST['StockCat']) and $_POST['StockCat']==$myrow1['categoryid']){ - echo "<option selected value=". $myrow1['categoryid'] . '>' . $myrow1['categorydescription']; + echo '<option selected value="'. $myrow1['categoryid'] . '">' . $myrow1['categorydescription'].'</option>'; } else { - echo "<option value=". $myrow1['categoryid'] . '>' . $myrow1['categorydescription']; + echo '<option value="'. $myrow1['categoryid'] . '">' . $myrow1['categorydescription'].'</option>'; } } @@ -316,19 +317,19 @@ } echo '</select></td> - <td><font size=2>' . _('Enter text extracts in the description') . ":</font></td> - <td><input type='text' name='Keywords' size=20 maxlength=25 value='" . $_POST['Keywords'] . "'></td></tr> + <td><font size="2">' . _('Enter text extracts in the description') . ':</font></td> + <td><input type="text" name="Keywords" size="20" maxlength="25" value="' . $_POST['Keywords'] . '" /></td></tr> <tr><td></td> - <td><font size=3><b>" . _('OR') . ' </b></font><font size=2>' . _('Enter extract of the Stock Code') . - ":</font></td> - <td><input type='text' name='StockCode' size=15 maxlength=18 value='" . $_POST['StockCode'] . "'></td> + <td><font size="3"> <b>' . _('OR') . ' </b></font><font size="2">' . _('Enter extract of the Stock Code') . + ':</font></td> + <td><input type="text" name="StockCode" size="15" maxlength="18" value="' . $_POST['StockCode'] . '" /></td> </tr> <tr><td></td> - <td><font size=3><b>" . _('OR') . ' </b></font><font size=2><a target="_blank" href="'.$rootpath.'/Stocks.php?"' . SID . - '">' . _('Create a New Stock Item') . "</a></font></td></tr> - </table><br> - <div class='centre'><input type=submit name='Search' value='" . _('Search Now') . "'> - </div><br>"; + <td><font size="3"><b>' . _('OR') . ' </b></font><font size="2"><a target="_blank" href="'.$rootpath.'/Stocks.php?' . SID . + '">' . _('Create a New Stock Item') . '</a></font></td></tr> + </table><br /> + <div class="centre"><input type="submit" name="Search" value="' . _('Search Now') . '" /> + </div><br />'; $PartsDisplayed =0; @@ -336,16 +337,16 @@ if (isset($SearchResult)) { - echo '<table cellpadding=1 colspan=7>'; + echo '<table cellpadding="1" colspan="7">'; - $tableheader = '<tr> + $TableHeader = '<tr> <th>' . _('Code') . '</th> <th>' . _('Description') . '</th> <th>' . _('Units') . '</th> <th>' . _('Image') . '</th> - <th>' . _('Quantity') . '</th + <th>' . _('Quantity') . '</th> </tr>'; - echo $tableheader; + echo $TableHeader; $j = 1; $k=0; //row colour counter @@ -362,7 +363,7 @@ $filename = $myrow['stockid'] . '.jpg'; if (file_exists( $_SESSION['part_pics_dir'] . '/' . $filename) ) { - $ImageSource = '<img src="'.$rootpath . '/' . $_SESSION['part_pics_dir'] . '/' . $filename . '" width="50" height="50">'; + $ImageSource = '<img src="'.$rootpath . '/' . $_SESSION['part_pics_dir'] . '/' . $filename . '" width="50" height="50" />'; } else { $ImageSource = '<i>'._('No Image').'</i>'; } @@ -371,7 +372,7 @@ <td>'.$myrow['description'].'</td> <td>'.$myrow['units'] . '</td> <td>'.$ImageSource.'</td> - <td><input class="number" type="text" size="6" value="0" name="qty'.$myrow['stockid'].'"></td> + <td><input class="number" type="text" size="6" value="0" name="qty'.$myrow['stockid'].'" /></td> </tr>'; $PartsDisplayed++; @@ -389,10 +390,10 @@ prnMsg( _('Only the first') . ' ' . $Maximum_Number_Of_Parts_To_Show . ' ' . _('can be displayed') . '. ' . _('Please restrict your search to only the parts required'),'info'); } - echo '<br><div class="centre"><input type="submit" name="NewItem" value="' . _('Add to Contract Bill Of Material') .'"></div>'; + echo '<br /><div class="centre"><input type="submit" name="NewItem" value="' . _('Add to Contract Bill Of Material') .'" /></div>'; }#end if SearchResults to show -echo '<hr>'; +echo '<hr />'; echo '</form>'; include('includes/footer.inc'); Modified: trunk/ContractCosting.php =================================================================== --- trunk/ContractCosting.php 2010-12-30 22:10:43 UTC (rev 4457) +++ trunk/ContractCosting.php 2011-01-04 00:34:27 UTC (rev 4458) @@ -16,7 +16,7 @@ } if (!isset($_GET['SelectedContract'])){ - echo '<br>'; + echo '<br />'; prnMsg( _('This page is expected to be called with the contract reference to show the costing for'), 'error'); include ('includes/footer.inc'); exit; @@ -52,7 +52,7 @@ } echo '<p class="page_title_text"> - <img src="'.$rootpath.'/css/'.$theme.'/images/contract.png" title="' . _('Contract') . '" alt="" />'; + <img src="'.$rootpath.'/css/'.$theme.'/images/contract.png" title="' . _('Contract') . '" alt="" />'; if ($_SESSION['Contract'.$identifier]->Status==3){ echo _('Closed') . ' '; } elseif ($_SESSION['Contract'.$identifier]->Status==2){ @@ -62,13 +62,12 @@ } echo _('Contract') . '<br />' . $_SESSION['Contract'.$identifier]->CustomerName . '<br />' . $_SESSION['Contract'.$identifier]->ContractDescription.'</p>'; -echo '<table> +echo '<table class="selection"> <tr> - <th colspan=6>' . _('Original Costing') .'</th> - <th colspan=6>' . _('Actual Costs') .'</th></tr> - <tr>'; + <th colspan="6">' . _('Original Costing') .'</th> + <th colspan="6">' . _('Actual Costs') .'</th></tr>'; -echo '<tr><th colspan=12>' . _('Inventory Required') . '</th></tr>'; +echo '<tr><th colspan="12">' . _('Inventory Required') . '</th></tr>'; echo '<tr><th>' . _('Item Code') . '</th> <th>' . _('Item Description') . '</th> @@ -83,7 +82,7 @@ <th>' . _('Unit Cost') . '</th> <th>' . _('Total Cost') . '</th> </tr>'; -$ContractBOMBudget =0; +$ContractBOMBudget = 0; $ContractBOMActual = 0; foreach ($_SESSION['Contract'.$identifier]->ContractBOM as $Component) { echo '<tr><td>' . $Component->StockID . '</td> @@ -95,7 +94,7 @@ $ContractBOMBudget += ($Component->ItemCost * $Component->Quantity); if (isset($InventoryIssues[$Component->StockID])){ $InventoryIssues[$Component->StockID]->Matched=1; - echo '<td colspan=2 align="centre">' . _('Actual usage') . '</td> + echo '<td colspan="2" align="center">' . _('Actual usage') . '</td> <td class="number">' . -$InventoryIssues[$Component->StockID]->Quantity . '</td> <td>' . $InventoryIssues[$Component->StockID]->Units . '</td> <td class="number">' . number_format($InventoryIssues[$Component->StockID]->TotalCost/$InventoryIssues[$Component->StockID]->Quantity,2) . '</td> @@ -127,7 +126,7 @@ $OtherReqtsBudget = 0; //other requirements budget sub-table -echo '<tr><td colspan=6><table> +echo '<tr><td colspan="6"><table class="selection"> <tr><th>' . _('Requirement') . '</th> <th>' . _('Quantity') . '</th> <th>' . _('Unit Cost') . '</th> @@ -144,7 +143,7 @@ </table></td>'; //Now other requirements actual in a sub table -echo '<td colspan="6"><table> +echo '<td colspan="6"><table class="selection"> <tr><th>' . _('Supplier') . '</th> <th>' . _('Reference') . '</th> <th>' . _('Date') . '</th> @@ -215,17 +214,17 @@ narrative, amount) VALUES ( 32, - " . $ContractCloseNo . ", + '" . $ContractCloseNo . "', '" . Date('Y-m-d') . "', '" . $PeriodNo . "', '" . $GLCodes['wipact'] . "', '" . _('Variance on contract') . ' ' . $_SESSION['Contract'.$identifier]->ContractRef . "', '" . -$Variance . "')"; - $ErrMsg = _('CRITICAL ERROR') . '! ' . _('NOTE DOWN THIS ERROR AND SEEK ASSISTANCE') . ': ' . _('The gl entry of WIP for the variance on closing the contract could not be inserted because'); - $DbgMsg = _('The following SQL to insert the GLTrans record was used'); - $Result = DB_query($SQL,$db,$ErrMsg,$DbgMsg,true); - $SQL = "INSERT INTO gltrans ( type, + $ErrMsg = _('CRITICAL ERROR') . '! ' . _('NOTE DOWN THIS ERROR AND SEEK ASSISTANCE') . ': ' . _('The gl entry of WIP for the variance on closing the contract could not be inserted because'); + $DbgMsg = _('The following SQL to insert the GLTrans record was used'); + $Result = DB_query($SQL,$db,$ErrMsg,$DbgMsg,true); + $SQL = "INSERT INTO gltrans ( type, typeno, trandate, periodno, @@ -233,22 +232,24 @@ narrative, amount) VALUES ( 32, - " . $ContractCloseNo . ", + '" . $ContractCloseNo . "', '" . Date('Y-m-d') . "', '" . $PeriodNo . "', '" . $GLCodes['materialuseagevarac'] . "', '" . _('Variance on contract') . ' ' . $_SESSION['Contract'.$identifier]->ContractRef . "', '" . $Variance . "')"; - $ErrMsg = _('CRITICAL ERROR') . '! ' . _('NOTE DOWN THIS ERROR AND SEEK ASSISTANCE') . ': ' . _('The gl entry of WIP for the variance on closing the contract could not be inserted because'); - $DbgMsg = _('The following SQL to insert the GLTrans record was used'); - $Result = DB_query($SQL,$db,$ErrMsg,$DbgMsg,true); + $ErrMsg = _('CRITICAL ERROR') . '! ' . _('NOTE DOWN THIS ERROR AND SEEK ASSISTANCE') . ': ' . _('The gl entry of WIP for the variance on closing the contract could not be inserted because'); + $DbgMsg = _('The following SQL to insert the GLTrans record was used'); + $Result = DB_query($SQL,$db,$ErrMsg,$DbgMsg,true); //Now update the status of the contract to closed - $SQL = "UPDATE contracts SET status=3 WHERE contractref='" . $_SESSION['Contract'.$identifier]->ContractRef . "'"; - $ErrMsg = _('CRITICAL ERROR') . '! ' . _('NOTE DOWN THIS ERROR AND SEEK ASSISTANCE') . ': ' . _('The status of the contract could not be updated to closed because'); - $DbgMsg = _('The following SQL to change the status of the contract was used'); - $Result = DB_query($SQL,$db,$ErrMsg,$DbgMsg,true); + $SQL = "UPDATE contracts + SET status=3 + WHERE contractref='" . $_SESSION['Contract'.$identifier]->ContractRef . "'"; + $ErrMsg = _('CRITICAL ERROR') . '! ' . _('NOTE DOWN THIS ERROR AND SEEK ASSISTANCE') . ': ' . _('The status of the contract could not be updated to closed because'); + $DbgMsg = _('The following SQL to change the status of the contract was used'); + $Result = DB_query($SQL,$db,$ErrMsg,$DbgMsg,true); /*Check if the contract work order is still open */ $CheckIfWOOpenResult = DB_query("SELECT closed @@ -272,146 +273,145 @@ * If work done on the contract is a write off then the user must also write off the stock of the contract item as a separate job */ - $result =DB_query("SELECT qtyrecd FROM woitems + $result =DB_query("SELECT qtyrecd FROM woitems WHERE stockid='" . $_SESSION['Contract'.$identifier]->ContractRef . "' AND wo='" . $_SESSION['Contract'.$identifier]->WO . "'",$db); - if (DB_num_rows($result)==1) { - $myrow=DB_fetch_row($result); - if ($myrow[0]==0){ //then the contract wo has not been received (it will only ever be for 1 item) + if (DB_num_rows($result)==1) { + $myrow=DB_fetch_row($result); + if ($myrow[0]==0){ //then the contract wo has not been received (it will only ever be for 1 item) - $WOReceiptNo = GetNextTransNo(26, $db); + $WOReceiptNo = GetNextTransNo(26, $db); - /* Need to get the current location quantity will need it later for the stock movement */ - $SQL = "SELECT locstock.quantity + /* Need to get the current location quantity will need it later for the stock movement */ + $SQL = "SELECT locstock.quantity FROM locstock WHERE locstock.stockid='" . $_SESSION['Contract'.$identifier]->ContractRef . "' AND loccode= '" . $_SESSION['Contract'.$identifier]->LocCode . "'"; - $Result = DB_query($SQL, $db); - if (DB_num_rows($Result)==1){ - $LocQtyRow = DB_fetch_row($Result); - $QtyOnHandPrior = $LocQtyRow[0]; - } else { - /*There must actually be some error this should never happen */ - $QtyOnHandPrior = 0; - } + $Result = DB_query($SQL, $db); + if (DB_num_rows($Result)==1){ + $LocQtyRow = DB_fetch_row($Result); + $QtyOnHandPrior = $LocQtyRow[0]; + } else { + /*There must actually be some error this should never happen */ + $QtyOnHandPrior = 0; + } - $SQL = "UPDATE locstock - SET quantity = locstock.quantity + 1 - WHERE locstock.stockid = '" . $_SESSION['Contract'.$identifier]->ContractRef . "' + $SQL = "UPDATE locstock + SET quantity = locstock.quantity + 1 + WHERE locstock.stockid = '" . $_SESSION['Contract'.$identifier]->ContractRef . "' AND loccode= '" . $_SESSION['Contract'.$identifier]->LocCode . "'"; - $ErrMsg = _('CRITICAL ERROR') . '! ' . _('NOTE DOWN THIS ERROR AND SEEK ASSISTANCE') . ': ' . _('The location stock record could not be updated because'); - $DbgMsg = _('The following SQL to update the location stock record was used'); - $Result = DB_query($SQL, $db, $ErrMsg, $DbgMsg, true); + $ErrMsg = _('CRITICAL ERROR') . '! ' . _('NOTE DOWN THIS ERROR AND SEEK ASSISTANCE') . ': ' . _('The location stock record could not be updated because'); + $DbgMsg = _('The following SQL to update the location stock record was used'); + $Result = DB_query($SQL, $db, $ErrMsg, $DbgMsg, true); - /*Insert stock movements - with unit cost */ + /*Insert stock movements - with unit cost */ - $SQL = "INSERT INTO stockmoves (stockid, - type, - transno, - loccode, - trandate, - price, - prd, - reference, - qty, - standardcost, - newqoh) - VALUES ('" . $_SESSION['Contract'.$identifier]->ContractRef . "', - 26, - " . $WOReceiptNo . ", - '" . $_SESSION['Contract'.$identifier]->LocCode . "', - '" . Date('Y-m-d') . "', - " . ($OtherReqtsBudget+$ContractBOMBudget) . ", - " . $PeriodNo . ", - '" . $_SESSION['Contract'.$identifier]->WO . "', - 1, - " . ($OtherReqtsBudget+$ContractBOMBudget) . ", - " . ($QtyOnHandPrior + 1) . ")"; + $SQL = "INSERT INTO stockmoves (stockid, + type, + transno, + loccode, + trandate, + price, + prd, + reference, + qty, + standardcost, + newqoh) + VALUES ('" . $_SESSION['Contract'.$identifier]->ContractRef . "', + 26, + '" . $WOReceiptNo . "', + '" . $_SESSION['Contract'.$identifier]->LocCode . "', + '" . Date('Y-m-d') . "', + '" . ($OtherReqtsBudget+$ContractBOMBudget) . "', + '" . $PeriodNo . "', + '" . $_SESSION['Contract'.$identifier]->WO . "', + 1, + '" . ($OtherReqtsBudget+$ContractBOMBudget) . "', + '" . ($QtyOnHandPrior + 1) . "')"; - $ErrMsg = _('CRITICAL ERROR') . '! ' . _('NOTE DOWN THIS ERROR AND SEEK ASSISTANCE') . ': ' . _('stock movement records could not be inserted when processing the work order receipt because'); - $DbgMsg = _('The following SQL to insert the stock movement records was used'); - $Result = DB_query($SQL, $db, $ErrMsg, $DbgMsg, true); + $ErrMsg = _('CRITICAL ERROR') . '! ' . _('NOTE DOWN THIS ERROR AND SEEK ASSISTANCE') . ': ' . _('stock movement records could not be inserted when processing the work order receipt because'); + $DbgMsg = _('The following SQL to insert the stock movement records was used'); + $Result = DB_query($SQL, $db, $ErrMsg, $DbgMsg, true); - /*Get the ID of the StockMove... */ - $StkMoveNo = DB_Last_Insert_ID($db,'stockmoves','stkmoveno'); + /*Get the ID of the StockMove... */ + $StkMoveNo = DB_Last_Insert_ID($db,'stockmoves','stkmoveno'); - /* If GLLink_Stock then insert GLTrans to debit the GL Code and credit GRN Suspense account at standard cost*/ - if ($_SESSION['CompanyRecord']['gllink_stock']==1 AND ($OtherReqtsBudget+$ContractBOMBudget)!=0){ - /*GL integration with stock is activated so need the GL journals to make it so */ + /* If GLLink_Stock then insert GLTrans to debit the GL Code and credit GRN Suspense account at standard cost*/ + if ($_SESSION['CompanyRecord']['gllink_stock']==1 AND ($OtherReqtsBudget+$ContractBOMBudget)!=0){ + /*GL integration with stock is activated so need the GL journals to make it so */ + /*first the debit the finished stock of the item received from the WO + the appropriate account was already retrieved into the $StockGLCode variable as the Processing code is kicked off + it is retrieved from the stock category record of the item by a function in SQL_CommonFunctions.inc*/ - /*first the debit the finished stock of the item received from the WO - the appropriate account was already retrieved into the $StockGLCode variable as the Processing code is kicked off - it is retrieved from the stock category record of the item by a function in SQL_CommonFunctions.inc*/ + $SQL = "INSERT INTO gltrans (type, + typeno, + trandate, + periodno, + account, + narrative, + amount) + VALUES (26, + '" . $WOReceiptNo . "', + '" . Date('Y-m-d') . "', + '" . $PeriodNo . "', + '" . $GLCodes['stockact'] . "', + '" . $_SESSION['Contract'.$identifier]->WO . ' ' . $_SESSION['Contract'.$identifier]->ContractRef . ' - x 1 @ ' . number_format(($OtherReqtsBudget+$ContractBOMBudget),2) . "', + '" . ($OtherReqtsBudget+$ContractBOMBudget) . "')"; - $SQL = "INSERT INTO gltrans (type, - typeno, - trandate, - periodno, - account, - narrative, - amount) - VALUES (26, - " . $WOReceiptNo . ", - '" . Date('Y-m-d') . "', - " . $PeriodNo . ", - " . $GLCodes['stockact'] . ", - '" . $_SESSION['Contract'.$identifier]->WO . ' ' . $_SESSION['Contract'.$identifier]->ContractRef . ' - x 1 @ ' . number_format(($OtherReqtsBudget+$ContractBOMBudget),2) . "', - " . ($OtherReqtsBudget+$ContractBOMBudget) . ')'; + $ErrMsg = _('CRITICAL ERROR') . '! ' . _('NOTE DOWN THIS ERROR AND SEEK ASSISTANCE') . ': ' . _('The receipt of contract work order finished stock GL posting could not be inserted because'); + $DbgMsg = _('The following SQL to insert the work order receipt of finished items GLTrans record was used'); + $Result = DB_query($SQL,$db,$ErrMsg, $DbgMsg, true); - $ErrMsg = _('CRITICAL ERROR') . '! ' . _('NOTE DOWN THIS ERROR AND SEEK ASSISTANCE') . ': ' . _('The receipt of contract work order finished stock GL posting could not be inserted because'); - $DbgMsg = _('The following SQL to insert the work order receipt of finished items GLTrans record was used'); - $Result = DB_query($SQL,$db,$ErrMsg, $DbgMsg, true); + /*now the credit WIP entry*/ + $SQL = "INSERT INTO gltrans (type, + typeno, + trandate, + periodno, + account, + narrative, + amount) + VALUES (26, + '" . $WOReceiptNo . "', + '" . Date('Y-m-d') . "', + '" . $PeriodNo . "', + '" . $GLCodes['wipact'] . "', + '" . $_SESSION['Contract'.$identifier]->WO . ' ' . $_SESSION['Contract'.$identifier]->ContractRef . ' - x 1 @ ' . number_format(($OtherReqtsBudget+$ContractBOMBudget),2) . "', + '" . -($OtherReqtsBudget+$ContractBOMBudget) . "')"; - /*now the credit WIP entry*/ - $SQL = "INSERT INTO gltrans (type, - typeno, - trandate, - periodno, - account, - narrative, - amount) - VALUES (26, - " . $WOReceiptNo . ", - '" . Date('Y-m-d') . "', - " . $PeriodNo . ", - " . $GLCodes['wipact'] . ", - '" . $_SESSION['Contract'.$identifier]->WO . ' ' . $_SESSION['Contract'.$identifier]->ContractRef . ' - x 1 @ ' . number_format(($OtherReqtsBudget+$ContractBOMBudget),2) . "', - " . -($OtherReqtsBudget+$ContractBOMBudget) . ")"; + $ErrMsg = _('CRITICAL ERROR') . '! ' . _('NOTE DOWN THIS ERROR AND SEEK ASSISTANCE') . ': ' . _('The WIP credit on receipt of finished items from a work order GL posting could not be inserted because'); + $DbgMsg = _('The following SQL to insert the WIP GLTrans record was used'); + $Result = DB_query($SQL,$db, $ErrMsg, $DbgMsg,true); - $ErrMsg = _('CRITICAL ERROR') . '! ' . _('NOTE DOWN THIS ERROR AND SEEK ASSISTANCE') . ': ' . _('The WIP credit on receipt of finished items from a work order GL posting could not be inserted because'); - $DbgMsg = _('The following SQL to insert the WIP GLTrans record was used'); - $Result = DB_query($SQL,$db, $ErrMsg, $DbgMsg,true); + } /* end of if GL and stock integrated and standard cost !=0 */ - } /* end of if GL and stock integrated and standard cost !=0 */ - - //update the wo with the new qtyrecd - $ErrMsg = _('CRITICAL ERROR') . '! ' . _('NOTE DOWN THIS ERROR AND SEEK ASSISTANCE') . ': ' ._('Could not update the work order item record with the total quantity received because'); - $DbgMsg = _('The following SQL was used to update the work order'); - $UpdateWOResult =DB_query("UPDATE woitems + //update the wo with the new qtyrecd + $ErrMsg = _('CRITICAL ERROR') . '! ' . _('NOTE DOWN THIS ERROR AND SEEK ASSISTANCE') . ': ' ._('Could not update the work order item record with the total quantity received because'); + $DbgMsg = _('The following SQL was used to update the work order'); + $UpdateWOResult =DB_query("UPDATE woitems SET qtyrecd=qtyrecd+1 - WHERE wo=" . $_SESSION['Contract'.$identifier]->WO . " - AND stockid='" . $_SESSION['Contract'.$identifier]->ContractRef . "'", - $db,$ErrMsg,$DbgMsg,true); - }//end if the contract wo was not received - work order item received/processed above if not - }//end if there was a row returned from the woitems query - } //end if the work order was still open (so end of closing it and processing receipt if necessary) + WHERE wo='" . $_SESSION['Contract'.$identifier]->WO . "' + AND stockid='" . $_SESSION['Contract'.$identifier]->ContractRef . "'", + $db,$ErrMsg,$DbgMsg,true); + }//end if the contract wo was not received - work order item received/processed above if not + }//end if there was a row returned from the woitems query + } //end if the work order was still open (so end of closing it and processing receipt if necessary) - DB_Txn_Commit($db); + DB_Txn_Commit($db); - $_SESSION['Contract'.$identifier]->Status=3; - prnMsg(_('The contract has been closed. No further charges can be posted against this contract.'),'success'); + $_SESSION['Contract'.$identifier]->Status=3; + prnMsg(_('The contract has been closed. No further charges can be posted against this contract.'),'success'); } //end if Closing the contract Close Contract button hit if ($_SESSION['Contract'.$identifier]->Status ==2){//the contract is an order being processed now - echo '<form method="post" action="' . $_SERVER['PHP_SELF'] . '?' .SID .'&SelectedContract=' . $_SESSION['Contract'.$identifier]->ContractRef . '&identifier=' . $identifier . '">'; + echo '<form method="post" action="' . $_SERVER['PHP_SELF'] . '?' .SID .'&SelectedContract=' . $_SESSION['Contract'.$identifier]->ContractRef . '&identifier=' . $identifier . '">'; echo '<input type="hidden" name="FormID" value="' . $_SESSION['FormID'] . '" />'; - echo '<br><div class="centre"><input type="submit" name="CloseContract" Value="' . _('Close Contract') . '" onclick="return confirm(\'' . _('Closing the contract will prevent further stock being issued to it and charges being made against it. Variances will be taken to the profit and loss account. Are You Sure?') . '\');"></div>'; + echo '<br /><div class="centre"><input type="submit" name="CloseContract" value="' . _('Close Contract') . '" onclick="return confirm(\'' . _('Closing the contract will prevent further stock being issued to it and charges being made against it. Variances will be taken to the profit and loss account. Are You Sure?') . '\');" /></div>'; echo '</form>'; } include('includes/footer.inc'); -?> +?> \ No newline at end of file Modified: trunk/ContractOtherReqts.php =================================================================== --- trunk/ContractOtherReqts.php 2010-12-30 22:10:43 UTC (rev 4457) +++ trunk/ContractOtherReqts.php 2011-01-04 00:34:27 UTC (rev 4458) @@ -40,8 +40,8 @@ if (isset($_POST['BackToHeader'])){ - echo '<meta http-equiv="Refresh" content="0; url=' . $rootpath . '/Contracts.php?' . SID . 'identifier='.$identifier. '">'; - echo '<p>'; + echo '<meta http-equiv="Refresh" content="0; url=' . $rootpath . '/Contracts.php?' . SID . 'identifier='.$identifier. '" />'; + echo '<br />'; prnMsg(_('You should automatically be forwarded to the Contract page. If this does not happen perhaps the browser does not support META Refresh') . '<a href="' . $rootpath . '/Contracts.php?' . SID. 'identifier='.$identifier . '">' . _('click here') . '</a> ' . _('to continue'),'info'); include('includes/footer.inc'); exit; @@ -84,12 +84,12 @@ if (count($_SESSION['Contract'.$identifier]->ContractReqts)>0){ + echo '<table cellpadding="2" colspan="7" class="selection">'; if (isset($_SESSION['Contract'.$identifier]->ContractRef)) { - echo ' ' . _('Contract Reference:') .' '. $_SESSION['Contract'.$identifier]->ContractRef; + echo '<tr><th colspan="5">' . _('Contract Reference:') .' '. $_SESSION['Contract'.$identifier]->ContractRef.'</th></tr>'; } - echo '<table cellpadding=2 colspan=7 border=1>'; echo '<tr> <th>' . _('Description') . '</th> <th>' . _('Quantity') . '</th> @@ -115,31 +115,36 @@ } echo '<td><textarea name="Requirement' . $ContractReqtID . '" cols="30" rows="3">' . $ContractComponent->Requirement . '</textarea></td> - <td><input type=text class="number" name="Qty' . $ContractReqtID . '" size="11" value="' . $ContractComponent->Quantity . '"></td> - <td><input type=text class="number" name="CostPerUnit' . $ContractReqtID . '" size="11" value="' . $ContractComponent->CostPerUnit . '"></td> + <td><input type="text" class="number" name="Qty' . $ContractReqtID . '" size="11" value="' . $ContractComponent->Quantity . '" /></td> + <td><input type="text" class="number" name="CostPerUnit' . $ContractReqtID . '" size="11" value="' . $ContractComponent->CostPerUnit . '" /></td> <td class="number">' . $DisplayLineTotal . '</td> - <td><a href="' . $_SERVER['PHP_SELF'] . '?' . SID . 'identifier='.$identifier. '&Delete=' . $ContractReqtID . '">' . _('Delete') . '</a></td></tr>'; + <td><a href="' . $_SERVER['PHP_SELF'] . '?' . SID . 'identifier='.$identifier. '&Delete=' . $ContractReqtID . '">' . _('Delete') . '</a></td></tr>'; $TotalCost += $LineTotal; } $DisplayTotal = number_format($TotalCost,2); echo '<tr><td colspan="4" class="number">' . _('Total Other Requirements Cost') . '</td><td class="number"><b>' . $DisplayTotal . '</b></td></tr></table>'; - echo '<br><div class="centre"><input type="submit" name="UpdateLines" value="' . _('Update Other Requirements Lines') . '">'; - echo ' <input type="submit" name="BackToHeader" value="' . _('Back To Contract Header') . '">'; + echo '<br /><div class="centre"><input type="submit" name="UpdateLines" value="' . _('Update Other Requirements Lines') . '" />'; + echo ' <input type="submit" name="BackToHeader" value="' . _('Back To Contract Header') . '" /></div>'; } /*Only display the contract other requirements lines if there are any !! */ -echo '<hr>'; +echo '<br />'; /*Now show form to add new requirements to the contract */ -echo '<table> +if (!isset($_POST['RequirementDescription'])) { + $_POST['RequirementDescription']=''; + $_POST['Quantity']=0; + $_POST['CostPerUnit']=0; +} +echo '<table class="selection"> <tr><th colspan="2">' . _('Enter New Requirements') . '</th></tr> <tr><td>' . _('Requirement Description') . '</td> <td><textarea name="RequirementDescription" cols="30" rows="3">' . $_POST['RequirementDescription'] . '</textarea></td></tr>'; -echo '<tr><td>' . _('Quantity Required') . ':</td><td><input type="text" name="Quantity" size=10 maxlength=10 value="' . $_POST['Quantity'] . '"></td></tr>'; -echo '<tr><td>' . _('Cost Per Unit') . ':</td><td><input type="text" name="CostPerUnit" size=10 maxlength=10 value="' . $_POST['CostPerUnit'] . '"></td></tr>'; +echo '<tr><td>' . _('Quantity Required') . ':</td><td><input type="text" class="number" name="Quantity" size="10" maxlength="10" value="' . $_POST['Quantity'] . '" /></td></tr>'; +echo '<tr><td>' . _('Cost Per Unit') . ':</td><td><input type="text" class="number" name="CostPerUnit" size="10" maxlength="10" value="' . $_POST['CostPerUnit'] . '" /></td></tr>'; echo '</table>'; -echo '<div class="centre"><input type="submit" name="EnterNewRequirement" value="' . _('Enter New Contract Requirement') . '"></div>'; +echo '<br /><div class="centre"><input type="submit" name="EnterNewRequirement" value="' . _('Enter New Contract Requirement') . '" /></div>'; echo '</form>'; include('includes/footer.inc'); Modified: trunk/Contracts.php =================================================================== --- trunk/Contracts.php 2010-12-30 22:10:43 UTC (rev 4457) +++ trunk/Contracts.php 2011-01-04 00:34:27 UTC (rev 4458) @@ -81,8 +81,8 @@ } if (isset($_POST['EnterContractBOM']) AND !$InputError){ - echo "<meta http-equiv='Refresh' content='0; url=" . $rootpath . '/ContractBOM.php?' . SID . 'identifier='.$identifier. "'>"; - echo '<p>'; + echo "<meta http-equiv='Refresh' content='0; url=" . $rootpath . '/ContractBOM.php?' . SID . 'identifier='.$identifier. "' />"; + echo '<br />'; prnMsg(_('You should automatically be forwarded to the entry of the Contract line items page') . '. ' . _('If this does not happen') . ' (' . _('if the browser does not support META Refresh') . ') ' . "<a href='$rootpath/ContractBOM.php?" . SID. 'identifier='.$identifier . "'>" . _('click here') . '</a> ' . _('to continue'),'info'); @@ -90,8 +90,8 @@ exit; } if (isset($_POST['EnterContractRequirements']) AND !$InputError){ - echo "<meta http-equiv='Refresh' content='0; url=" . $rootpath . '/ContractOtherReqts.php?' . SID . 'identifier='.$identifier. "'>"; - echo '<p>'; + echo "<meta http-equiv='Refresh' content='0; url=" . $rootpath . '/ContractOtherReqts.php?' . SID . 'identifier='.$identifier. "' />"; + echo '<br />'; prnMsg(_('You should automatically be forwarded to the entry of the Contract requirements page') . '. ' . _('If this does not happen') . ' (' . _('if the browser does not support META Refresh') . ') ' . "<a href='$rootpath/ContractOtherReqts.php?" . SID. 'identifier='.$identifier . "'>" . _('click here') . '</a> ' . _('to continue'),'info'); @@ -100,7 +100,7 @@ } } /* end of if going to contract BOM or contract requriements */ -echo '<a href="'. $rootpath . '/SelectContract.php?' . SID .'">'. _('Back to Contract Selection'). '</a><br>'; +echo '<a href="'. $rootpath . '/SelectContract.php?' . SID .'">'. _('Back to Contract Selection'). '</a><br />'; //attempting to upload the drawing image file if (isset($_FILES['Drawing']) AND $_FILES['Drawing']['name'] !='' AND $_SESSION['Contract'.$identifier]->ContractRef!='') { @@ -306,9 +306,9 @@ $sql = "UPDATE contracts SET categoryid = '" . $_POST['CategoryID'] ."', requireddate = '" . FormatDateForSQL($_POST['RequiredDate']) . "', loccode='" . $_POST['LocCode'] . "', - margin = " . $_POST['Margin'] . ", + margin = '" . $_POST['Margin'] . "', customerref = '" . $_POST['CustomerRef'] . "', - exrate = " . $_POST['ExRate'] . " + exrate = '" . $_POST['ExRate'] . "' WHERE contractref ='" . $_POST['ContractRef'] . "'"; $ErrMsg = _('Cannot update the contract because'); $result = DB_query($sql,$db,$ErrMsg); @@ -323,7 +323,7 @@ VALUES ( '" . $_POST['ContractRef'] . "', '" . $Component->StockID . "', '" . $WorkCentre . "', - " . $Component->Quantity . ")"; + '" . $Component->Quantity . "')"; $result = DB_query($sql,$db,$ErrMsg); } @@ -338,7 +338,7 @@ VALUES ( '" . $_POST['ContractRef'] . "', '" . $Requirement->Requirement . "', '" . $Requirement->CostPerUnit . "', - " . $Requirement->Quantity . ")"; + '" . $Requirement->Quantity . "')"; $result = DB_query($sql,$db,$ErrMsg); } @@ -375,7 +375,7 @@ $DbgMsg = _('The SQL that failed to update the quotation was'); $UpdQuoteResult = DB_query($sql,$db,$ErrMsg,$DbgMsg); pnMsg(_('The contract quotation has been updated based on the new contract cost and margin'),'success'); - echo '<br><a href="' .$rootpath . '/SelectSalesOrder.php?OrderNumber=' . $_SESSION['Contract'.$identifier]->OrderNo . '&Quotations=Quotes_Only">' . _('Go to Quotation') . ' ' . $_SESSION['Contract'.$identifier]->OrderNo . '</a>'; + echo '<br /><a href="' .$rootpath . '/SelectSalesOrder.php?OrderNumber=' . $_SESSION['Contract'.$identifier]->OrderNo . '&Quotations=Quotes_Only">' . _('Go to Quotation') . ' ' . $_SESSION['Contract'.$identifier]->OrderNo . '</a>'; } if ($ExistingContract['status'] == 0 AND $_POST['Status']==1){ @@ -405,9 +405,9 @@ '" . $_POST['CategoryID'] . "', '" . $_POST['LocCode'] . "', '" . FormatDateForSQL($_POST['RequiredDate']) . "', - " . $_POST['Margin'] . ", + '" . $_POST['Margin'] . "', '" . $_POST['CustomerRef'] . "', - ". $_POST['ExRate'] .")"; + '". $_POST['ExRate'] ."')"; $ErrMsg = _('The new contract could not be added because'); $result = DB_query($sql,$db,$ErrMsg); @@ -422,7 +422,7 @@ VALUES ( '" . $_POST['ContractRef'] . "', '" . $Component->StockID . "', '" . $WorkCentre . "', - " . $Component->Quantity . ")"; + '" . $Component->Quantity . "')"; $result = DB_query($sql,$db,$ErrMsg); } @@ -435,7 +435,7 @@ VALUES ( '" . $_POST['ContractRef'] . "', '" . $Requirement->Requirement . "', '" . $Requirement->CostPerUnit . "', - " . $Requirement->Quantity . ")"; + '" . $Requirement->Quantity . "')"; $result = DB_query($sql,$db,$ErrMsg); } prnMsg(_('The new contract has been added to the database'),'success'); @@ -595,7 +595,7 @@ $_SESSION['Contract'.$identifier]->Status=1; $_SESSION['Contract'.$identifier]->OrderNo=$OrderNo; prnMsg(_('The contract has been made into quotation number') . ' ' . $OrderNo,'info'); - echo '<br><a href="' . $rootpath . '/SelectSalesOrder.php?OrderNumber=' . $OrderNo . '&Quotations=Quotes_Only">' . _('Go to quotation number:') . ' ' . $OrderNo . '</a>'; + echo '<br /><a href="' . $rootpath . '/SelectSalesOrder.php?OrderNumber=' . $OrderNo . '&Quotations=Quotes_Only">' . _('Go to quotation number:') . ' ' . $OrderNo . '</a>'; } //end of if making a quotation @@ -709,7 +709,7 @@ if (DB_num_rows($result)==0){ prnMsg(_('The customer details were unable to be retrieved'),'error'); if ($debug==1){ - prnMsg(_('The SQL used that failed to get the customer details was:') . '<p>' . $sql,'error'); + prnMsg(_('The SQL used that failed to get the customer details was:') . '<br />' . $sql,'error'); } } else { $_SESSION['Contract'.$identifier]->BranchName = $myrow['brname']; @@ -737,29 +737,29 @@ echo '<p class="page_title_text"><img src="'.$rootpath.'/css/'.$theme.'/images/contract.png" title="' . _('Contract') . '" alt="" />' . ' ' . _('Contract: Select Customer') . '</p>'; - echo '<form action="' . $_SERVER['PHP_SELF'] . '?' .SID .'&identifier=' . $identifier .'" name="CustomerSelection" method=post>'; + echo '<form action="' . $_SERVER['PHP_SELF'] . '?' .SID .'&identifier=' . $identifier .'" name="CustomerSelection" method="post">'; echo '<input type="hidden" name="FormID" value="' . $_SESSION['FormID'] . '" />'; - echo '<table cellpadding=3 colspan=4 class=selection> + echo '<table cellpadding="3" colspan="4" class="selection"> <tr> <td><h5>' . _('Part of the Customer Branch Name') . ':</h5></td> - <td><input tabindex=1 type="Text" name="CustKeywords" size=20 maxlength=25></td> + <td><input tabindex="1" type="text" name="CustKeywords" size="20" maxlength="25" /></td> <td><h2><b>' . _('OR') . '</b></h2></td> <td><h5>' . _('Part of the Customer Branch Code'). ':</h5></td> - <td><input tabindex=2 type="Text" name="CustCode" size=15 maxlength=18></td> + <td><input tabindex="2" type="text" name="CustCode" size="15" maxlength="18" /></td> <td><h2><b>' . _('OR') . '</b></h2></td> <td><h5>' . _('Part of the Branch Phone Number') . ':</h5></td> - <td><input tabindex=3 type="Text" name="CustPhone" size=15 maxlength=18></td> + <td><input tabindex="3" type="text" name="CustPhone" size="15" maxlength="18" /></td> </tr> </table> - <br><div class="centre"><input tabindex=4 type=submit name="SearchCustomers" value="' . _('Search Now') . '"> - <input tabindex=5 type=submit action=reset value="' . _('Reset') .'"></div>'; + <br /><div class="centre"><input tabindex="4" type="submit" name="SearchCustomers" value="' . _('Search Now') . '" /> + <input tabindex="5" type="submit" action="reset" value="' . _('Reset') .'" /></div>'; if (isset($result_CustSelect)) { - echo '<table cellpadding=2 colspan=7>'; + echo '<table cellpadding="2" class="selection">'; - $TableHeader = '<br><tr> + $TableHeader = '<br /><tr> <th>' . _('Customer') . '</th> <th>' . _('Branch') . '</th> <th>' . _('Contact') . '</th> @@ -781,34 +781,34 @@ $k=1; } if ($LastCustomer != $myrow['name']) { - echo '<td>'.$myrow['name'].'</td>'; + echo '<td>'.htmlentities($myrow['name']).'</td>'; } else { echo '<td></td>'; } - echo '<td><input tabindex='.number_format($j+5).' type=submit name="Submit" value="'.$myrow['brname'].'"</td> - <input type=hidden name="SelectedCustomer" value="'.$myrow['debtorno'].' - '.$myrow['branchcode'].'"> - <td>'.$myrow['contactname'].'</td> + echo '<td><input tabindex="'.number_format($j+5).'" type="submit" name="Submit" value="'.htmlentities($myrow['brname']).'" /></td> + <input type="hidden" name="SelectedCustomer" value="'.$myrow['debtorno'].' - '.$myrow['branchcode'].'" /> + <td>'.htmlentities($myrow['contactname']).'</td> <td>'.$myrow['phoneno'].'</td> <td>'.$myrow['faxno'].'</td> - </tr></form>'; + </tr>'; $LastCustomer=$myrow['name']; $j++; //end of page full new headings if } //end of while loop - echo '</table>'; + echo '</table></form>'; }//end if results to show //end if RequireCustomerSelection } else { /*A customer is already selected so get into the contract setup proper */ - echo '<form name="ContractEntry" enctype="multipart/form-data" action="' . $_SERVER['PHP_SELF'] . '?' . SID . '&identifier=' . $identifier . '" method="post">'; + echo '<form name="ContractEntry" enctype="multipart/form-data" action="' . $_SERVER['PHP_SELF'] . '?' . SID . '&identifier=' . $identifier . '" method="post">'; echo '<input type="hidden" name="FormID" value="' . $_SESSION['FormID'] . '" />'; echo '<p class="page_title_text"> - <img src="'.$rootpath.'/css/'.$theme.'/images/contract.png" title="' . _('Contract') . '" alt=""> + <img src="'.$rootpath.'/css/'.$theme.'/images/contract.png" title="' . _('Contract') . '" alt="" /> ' . $_SESSION['Contract'.$identifier]->CustomerName; if ($_SESSION['CompanyRecord']['currencydefault'] != $_SESSION['Contract'.$identifier]->CurrCode){ @@ -821,34 +821,34 @@ /*Set up form for entry of contract header stuff */ - echo '<table>'; + echo '<table class="selection">'; echo '<tr><td>' . _('Contract Reference') . ':</td><td>'; if ($_SESSION['Contract'.$identifier]->Status==0) { /*Then the contract has not become an order yet and we can allow changes to the ContractRef */ - echo '<input type="text" name="ContractRef" size=21 maxlength=20 value="' . $_SESSION['Contract'.$identifier]->ContractRef . '">'; + echo '<input type="text" name="ContractRef" size="21" maxlength="20" value="' . $_SESSION['Contract'.$identifier]->ContractRef . '" />'; } else { /*Just show the contract Ref - dont allow modification */ - echo '<input type="hidden" name="ContractRef" value="' . $_SESSION['Contract'.$identifier]->ContractRef . '">' . $_SESSION['Contract'.$identifier]->ContractRef; + echo '<input type="hidden" name="ContractRef" value="' . $_SESSION['Contract'.$identifier]->ContractRef . '" />' . $_SESSION['Contract'.$identifier]->ContractRef; } echo '</td></tr>'; echo '<tr><td>' . _('Category') . ':</td><td><select name="CategoryID" >'; - $sql = 'SELECT categoryid, categorydescription FROM stockcategory WHERE stocktype!="A"'; + $sql = "SELECT categoryid, categorydescription FROM stockcategory"; $ErrMsg = _('The stock categories could not be retrieved because'); $DbgMsg = _('The SQL used to retrieve stock categories and failed was'); $result = DB_query($sql,$db,$ErrMsg,$DbgMsg); while ($myrow=DB_fetch_array($result)){ if (!isset($_SESSION['Contract'.$identifier]->CategoryID) or $myrow['categoryid']==$_SESSION['Contract'.$identifier]->CategoryID){ - echo '<option selected VALUE="'. $myrow['categoryid'] . '">' . $myrow['categorydescription']; + echo '<option selected="True" value="'. $myrow['categoryid'] . '">' . $myrow['categorydescription'].'</option>'; } else { - echo '<option VALUE="'. $myrow['categoryid'] . '">' . $myrow['categorydescription']; + echo '<option value="'. $myrow['categoryid'] . '">' . $myrow['categorydescription'].'</option>'; } } echo '</select><a target="_blank" href="'. $rootpath . '/StockCategories.php?' . SID . '">' . _('Add or Modify Contract Categories') . '</a></td></tr>'; - $sql = 'SELECT loccode, locationname FROM locations'; + $sql = "SELECT loccode, locationname FROM locations"; $ErrMsg = _('The stock locations could not be retrieved because'); $DbgMsg = _('The SQL used to retrieve stock locations and failed was'); $result = DB_query($sql,$db,$ErrMsg,$DbgMsg); @@ -856,36 +856,36 @@ echo '<tr><td>' . _('Location') . ':</td><td><select name="LocCode" >'; while ($myrow=DB_fetch_array($result)){ if (!isset($_SESSION['Contract'.$identifier]->LocCode) or $myrow['loccode']==$_SESSION['Contract'.$identifier]->LocCode){ - echo '<option selected VALUE="'. $myrow['loccode'] . '">' . $myrow['locationname'] . '</option>'; + echo '<option selected="True" 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>'; echo '<tr><td>' . _('Contract Description'); - echo ':</td><td><textarea name="ContractDescription" style="width:100%" rows=5>' . $_SESSION['Contract'.$identifier]->ContractDescription . '</textarea></td></tr>'; + echo ':</td><td><textarea name="ContractDescription" style="width:100%" rows="5">' . $_SESSION['Contract'.$identifier]->ContractDescription . '</textarea></td></tr>'; - echo '<tr><td>'. _('Drawing File') . ' .jpg' . ' ' . _('format only') .':</td><td><input type="file" id="Drawing" name="Drawing"></td></tr>'; + echo '<tr><td>'. _('Drawing File') . ' .jpg' . ' ' . _('format only') .':</td><td><input type="file" id="Drawing" name="Drawing" /></td></tr>'; if (!isset($_SESSION['Contract'.$identifier]->RequiredDate)) { $_SESSION['Contract'.$identifier]->RequiredDate = DateAdd(date($_SESSION['DefaultDateFormat']),'m',1); } - echo '<tr><td>' . _('Required Date') . ':</td><td><input type="text" class=date alt="' .$_SESSION['DefaultDateFormat'] . '" name="RequiredDate" size=11 value="' . $_SESSION['Contract'.$identifier]->RequiredDate . '"></td></tr>'; + echo '<tr><td>' . _('Required Date') . ':</td><td><input type="text" class="date" alt="' .$_SESSION['DefaultDateFormat'] . '" name="RequiredDate" size="11" value="' . $_SESSION['Contract'.$identifier]->RequiredDate . '" /></td></tr>'; - echo '<tr><td>' . _('Customer Reference') . ':</td><td><input type="text" name="CustomerRef" size=21 maxlength=20 value="' . $_SESSION['Contract'.$identifier]->CustomerRef . '"></td></tr>'; + echo '<tr><td>' . _('Customer Reference') . ':</td><td><input type="text" name="CustomerRef" size="21" maxlength="20" value="' . $_SESSION['Contract'.$identifier]->CustomerRef . '" /></td></tr>'; if (!isset($_SESSION['Contract'.$identifier]->Margin)){ $_SESSION['Contract'.$identifier]->Margin =50; } - echo '<tr><td>' . _('Gross Profit') . ' %:</td><td><input type="text" name="Margin" size=4 maxlength=4 value="' . $_SESSION['Contract'.$identifier]->Margin . '"></td></tr>'; + echo '<tr><td>' . _('Gross Profit') . ' %:</td><td><input type="text" name="Margin" size="4" maxlength="4" value="' . $_SESSION['Contract'.$identifier]->Margin . '" /></td></tr>'; if ($_SESSION['CompanyRecord']['currencydefault'] != $_SESSION['Contract'.$identifier]->CurrCode){ echo '<tr><td>' . $_SESSION['Contract'.$identifier]->CurrCode . ' ' . _('Exchange Rate') . ':</td> - <td><input type="text" name="ExRate" size=10 maxlength=10 value=' . $_SESSION['Contract'.$identifier]->ExRate . '></td></tr>'; + <td><input type="text" name="ExRate" size="10" maxlength="10" value="' . $_SESSION['Contract'.$identifier]->ExRate . '" /></td></tr>'; } else { - echo '<input type="hidden" name="ExRate" value=' . $_SESSION['Contract'.$identifier]->ExRate . '>'; + echo '<input type="hidden" name="ExRate" value="' . $_SESSION['Contract'.$identifier]->ExRate . '" />'; } echo '<tr><td>' . _('Contract Status') . ':</td><td>'; @@ -901,17 +901,18 @@ } elseif ($_SESSION['Contract'.$identifier]->Status == 2){ echo _('Order Placed'); } - echo '</select></td></tr>'; + echo '<input type="hidden" name="Status" value="'.$_SESSION['Contract'.$identifier]->Status.'" />'; + echo '</td></tr>'; if ($_SESSION['Contract'.$identifier]->Status >=1) { - echo '<tr><td>' . _('Quotation Reference/Sales Order No') . ':</td><td><a href="' . $rootpath . '/SelectSalesOrder.php?OrderNumber=' . $_SESSION['Contract'.$identifier]->OrderNo . '&Quotations=Quotes_Only">' . $_SESSION['Contract'.$identifier]->OrderNo . '</a></td></tr>'; + echo '<tr><td>' . _('Quotation Reference/Sales Order No') . ':</td><td><a href="' . $rootpath . '/SelectSalesOrder.php?OrderNumber=' . $_SESSION['Contract'.$identifier]->OrderNo . '&Quotations=Quotes_Only">' . $_SESSION['Contract'.$identifier]->OrderNo . '</a></td></tr>'; } - if ($_SESSION['Contract'.$identifier]->Status!=2) { - echo '<tr><td>' . _('Contract Work Order Ref') . ':</td><td>' . $_SESSION['Contract'.$identifier]->WorkOrder . '</td></tr>'; + if ($_SESSION['Contract'.$identifier]->Status!=2 and isset($_SESSION['Contract'.$identifier]->WO)) { + echo '<tr><td>' . _('Contract Work Order Ref') . ':</td><td>' . $_SESSION['Contract'.$identifier]->WO . '</td></tr>'; } - echo '</table><hr>'; + echo '</table><br />'; echo '<table><tr><td> - <table><tr><th colspan=6>' . _('Stock Items Required') . '</th></tr>'; + <table class="selection"><tr><th colspan="6">' . _('Stock Items Required') . '</th></tr>'; $ContractBOMCost = 0; if (count($_SESSION['Contract'.$identifier]->ContractBOM)!=0){ echo '<tr><th>' . _('Item Code') . '</th> @@ -936,7 +937,7 @@ } echo '</table></td>'; //end of contract BOM table echo '<td valign="top"> - <table><tr><th colspan=4>' . _('Other Requirements') . '</th></tr>'; + <table class="selection"><tr><th colspan="4">' . _('Other Requirements') . '</th></tr>'; $ContractReqtsCost = 0; if (count($_SESSION['Contract'.$identifier]->ContractReqts)!=0){ echo '<tr><th>' . _('Requirement') . '</th> @@ -956,27 +957,27 @@ echo '<tr><td colspan="4"><i>' . _('None Entered') . '</i></td></tr>'; } echo '</table></td></tr></table>'; - echo '<hr>'; - echo'<table><tr><th>' . _('Total Contract Cost') . '</th><th class="number">' . number_format(($ContractBOMCost+$ContractReqtsCost),2) . '</th><th>' . _('Contract Price') . '</th><th class="number">' . number_format(($ContractBOMCost+$ContractReqtsCost)/((100-$_SESSION['Contract'.$identifier]->Margin)/100),2) . '</th></tr></table>'; + echo '<br />'; + echo'<table class="selection"><tr><th>' . _('Total Contract Cost') . '</th><th class="number">' . number_format(($ContractBOMCost+$ContractReqtsCost),2) . '</th><th>' . _('Contract Price') . '</th><th class="number">' . number_format(($ContractBOMCost+$ContractReqtsCost)/((100-$_SESSION['Contract'.$identifier]->Margin)/100),2) . '</th></tr></table>'; echo'<p></p>'; - echo '<div class="centre"><input type="submit" name="EnterContractBOM" value="' . _('Enter Items Required') . '"> - <input type=submit name="EnterContractRequirements" value="' . _('Enter Other Requirements') .'">'; + echo '<div class="centre"><input type="submit" name="EnterContractBOM" value="' . _('Enter Items Required') . '" /> + <input type="submit" name="EnterContractRequirements" value="' . _('Enter Other Requirements') .'" />'; if($_SESSION['Contract'.$identifier]->Status==0){ // not yet quoted - echo '<input type=submit name="CommitContract" value="' . _('Commit Changes') .'">'; + echo '<input type="submit" name="CommitContract" value="' . _('Commit Changes') .'" />'; } elseif($_SESSION['Contract'.$identifier]->Status==1){ //quoted but not yet ordered - echo '<input type=submit name="CommitContract" value="' . _('Update Quotation') .'">'; + echo '<input type="submit" name="CommitContract" value="' . _('Update Quotation') .'" />'; } if($_SESSION['Contract'.$identifier]->Status==0){ //not yet quoted - echo ' <input type=submit name="CreateQuotation" value="' . _('Create Quotation') .'"></div>'; + echo ' <input type="submit" name="CreateQuotation" value="' . _('Create Quotation') .'" /></div>'; } else { echo '</div>'; } if ($_SESSION['Contract'.$identifier]->Status!=2) { - echo '<p><div class="centre"><input type="submit" name="CancelContract" value="' . _('Cancel and Delete Contract') . '"></div></p>'; + echo '<p><div class="centre"><input type="submit" name="CancelContract" value="' . _('Cancel and Delete Contract') . '" /></div></p>'; } + echo '</form>'; } /*end of if customer selected and entering contract header*/ -echo '</form>'; include('includes/footer.inc'); ?> \ No newline at end of file Modified: trunk/EmailConfirmation.php =================================================================== --- trunk/EmailConfirmation.php 2010-12-30 22:10:43 UTC (rev 4457) +++ trunk/EmailConfirmation.php 2011-01-04 00:34:27 UTC (rev 4458) @@ -27,37 +27,37 @@ $ErrMsg = _('There was a problem retrieving the order header details for Order Number') . ' ' . $_GET['TransNo'] . ' ' . _('from the database'); $sql = "SELECT salesorders.debtorno, - salesorders.customerref, - salesorders.comments, - salesorders.orddate, - salesorders.deliverto, - salesorders.deladd1, - salesorders.deladd2, - salesorders.dela... [truncated message content] |
From: <tu...@us...> - 2011-01-05 01:44:09
|
Revision: 4459 http://web-erp.svn.sourceforge.net/web-erp/?rev=4459&view=rev Author: turbopt Date: 2011-01-05 01:44:03 +0000 (Wed, 05 Jan 2011) Log Message: ----------- Insert underscore missing in superglobal. Modified Paths: -------------- trunk/WorkOrderReceive.php trunk/doc/Change.log.html Modified: trunk/WorkOrderReceive.php =================================================================== --- trunk/WorkOrderReceive.php 2011-01-04 00:34:27 UTC (rev 4458) +++ trunk/WorkOrderReceive.php 2011-01-05 01:44:03 UTC (rev 4459) @@ -547,7 +547,7 @@ qualitytext = '" . DB_escape_string($QualityText) . "' WHERE stockid='" . $_POST['StockID'] . "' AND loccode = '" . $_POST['IntoLocation'] . "' - AND serialno = '" . $POST['BatchRef' .$i] . "'"; + AND serialno = '" . $_POST['BatchRef' .$i] . "'"; } else { $SQL = "INSERT INTO stockserialitems (stockid, loccode, Modified: trunk/doc/Change.log.html =================================================================== --- trunk/doc/Change.log.html 2011-01-04 00:34:27 UTC (rev 4458) +++ trunk/doc/Change.log.html 2011-01-05 01:44:03 UTC (rev 4459) @@ -1,5 +1,6 @@ <p><font SIZE=4 COLOR=BLUE><b>webERP Change Log</b></font></p> -<p>/</p> +<p></p> +<p>4/1/11 Paul T: Bug# 3151192 - insert underscore for superglobal.</p> <p>4/1/11 Phil: Rework of purchase order scripts ... again.</p> <p>4/1/11 Phil: Select Purchase orders now defaults to just pending and authorised/printed - other statii are options</p> <p>1/1/11 Phil: Upgrade script make capable of upgrades from any earlier version - and email a backup to the user.</p> This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <dai...@us...> - 2011-01-06 05:16:13
|
Revision: 4461 http://web-erp.svn.sourceforge.net/web-erp/?rev=4461&view=rev Author: daintree Date: 2011-01-06 05:16:06 +0000 (Thu, 06 Jan 2011) Log Message: ----------- report writer - changes Modified Paths: -------------- trunk/Z_PriceChanges.php trunk/api/api_php.php trunk/includes/ConnectDB.inc trunk/reportwriter/FormMaker.php trunk/reportwriter/ReportMaker.php trunk/reportwriter/WriteReport.inc trunk/sql/mysql/upgrade3.11.1-4.00.sql Modified: trunk/Z_PriceChanges.php =================================================================== --- trunk/Z_PriceChanges.php 2011-01-05 09:49:09 UTC (rev 4460) +++ trunk/Z_PriceChanges.php 2011-01-06 05:16:06 UTC (rev 4461) @@ -103,33 +103,33 @@ if ($_POST['WhichPrices'] == 'Only Non-customer special prices'){ $sql = 'UPDATE prices SET price=price*(1+' . $IncrementPercentage . ") - WHERE typeabbrev='" . $_POST['PriceList'] . "' - AND stockid='" . $myrow['stockid'] . "' - AND typeabbrev='" . $_POST['PriceList'] . "' - AND debtorno=''"; + WHERE typeabbrev='" . $_POST['PriceList'] . "' + AND stockid='" . $myrow['stockid'] . "' + AND typeabbrev='" . $_POST['PriceList'] . "' + AND debtorno=''"; }else if ($_POST['WhichPrices'] == 'Only customer special prices'){ $sql = "UPDATE prices SET price=price*(1+" . $IncrementPercentage . ") - WHERE typeabbrev='" . $_POST['PriceList'] . "' - AND stockid='" . $myrow['stockid'] . "' - AND typeabbrev='" . $_POST['PriceList'] . "' - AND debtorno!=''"; + WHERE typeabbrev='" . $_POST['PriceList'] . "' + AND stockid='" . $myrow['stockid'] . "' + AND typeabbrev='" . $_POST['PriceList'] . "' + AND debtorno!=''"; } else if ($_POST['WhichPrices'] == 'Both customer special prices and non-customer special prices'){ $sql = "UPDATE prices SET price=price*(1+" . $IncrementPercentage . ") - WHERE typeabbrev='" . $_POST['PriceList'] . "' - AND stockd='" . $myrow['stockid'] . "' - AND typeabbrev='" . $_POST['PriceList'] . "'"; + WHERE typeabbrev='" . $_POST['PriceList'] . "' + AND stockd='" . $myrow['stockid'] . "' + AND typeabbrev='" . $_POST['PriceList'] . "'"; } else if ($_POST['WhichPrices'] == 'Selected customer special prices only'){ $sql = 'UPDATE prices SET price=price*(1+' . $IncrementPercentage . ") - WHERE typeabbrev='" . $_POST['PriceList'] . "' - AND stockid='" . $myrow['stockid'] . "' - AND typeabbrev='" . $_POST['PriceList'] . "' - AND debtorno='" . $_SESSION['CustomerID'] . "'"; + WHERE typeabbrev='" . $_POST['PriceList'] . "' + AND stockid='" . $myrow['stockid'] . "' + AND typeabbrev='" . $_POST['PriceList'] . "' + AND debtorno='" . $_SESSION['CustomerID'] . "'"; } Modified: trunk/api/api_php.php =================================================================== --- trunk/api/api_php.php 2011-01-05 09:49:09 UTC (rev 4460) +++ trunk/api/api_php.php 2011-01-06 05:16:06 UTC (rev 4461) @@ -10,7 +10,7 @@ $PathPrefix=dirname(__FILE__).'/../'; include('api_session.inc'); - include 'api_errorcodes.php'; + include('api_errorcodes.php'); /* Include SQL_CommonFunctions.inc, to use GetNextTransNo().*/ include($PathPrefix.'includes/SQL_CommonFunctions.inc'); Modified: trunk/includes/ConnectDB.inc =================================================================== --- trunk/includes/ConnectDB.inc 2011-01-05 09:49:09 UTC (rev 4460) +++ trunk/includes/ConnectDB.inc 2011-01-06 05:16:06 UTC (rev 4461) @@ -4,7 +4,7 @@ * this value is saved in the $_SESSION['Versionumber'] when includes/GetConfig.php is run * if VersionNumber is < $Version then the DB update script is run */ -$Version='3.12.1'; //must update manually every time there is a DB change +$Version='3.12.2'; //must update manually every time there is a DB change require_once ($PathPrefix .'includes/MiscFunctions.php'); Modified: trunk/reportwriter/FormMaker.php =================================================================== --- trunk/reportwriter/FormMaker.php 2011-01-05 09:49:09 UTC (rev 4460) +++ trunk/reportwriter/FormMaker.php 2011-01-06 05:16:06 UTC (rev 4461) @@ -3,14 +3,14 @@ $DirectoryLevelsDeep = 1; $PathPrefix = '../'; -$PageSecurity = 1; // set security level for webERP +//$PageSecurity = 1; // set security level for webERP require($PathPrefix . 'includes/session.inc'); // TBD The followiung line needs to be replace when more translations are available $ReportLanguage = 'en_US'; // default language file define('DBReports','reports'); // name of the databse holding the main report information (ReportID) define('DBRptFields','reportfields'); // name of the database holding the report fields -define('FPDF_FONTPATH','../fonts/'); // FPDF path to fonts directory +//define('FPDF_FONTPATH','../fonts/'); FPDF path to fonts directory define('DefRptPath',$PathPrefix . 'companies/' . $_SESSION['DatabaseName'] . '/reportwriter/'); // path to default reports // Fetch necessary include files - Host application specific (webERP) require_once($PathPrefix . 'includes/DateFunctions.inc'); @@ -98,7 +98,7 @@ } } // else use default settings, i.e. no overrides // All done with setup, build the form - require($PathPrefix . 'includes/fpdf.php'); // FPDF class to generate reports + require($PathPrefix . 'includes/tcpdf.php'); // TCPDF class to generate reports require('WriteForm.inc'); // build the pdf pages (this function exits the script if successful; otherwise returns with error) $success = BuildPDF($ReportID, $Prefs); // build and output form, should not return from this function @@ -139,9 +139,14 @@ foreach ($ReportGroups as $key=>$GName) { $OutputString .= '<tr bgcolor="#CCCCCC"><td colspan="3" align="center">'.$GName.'</td></tr>'; $OutputString .= '<tr><td colspan="3" width="250" valign="top">'; - $sql= "SELECT id, groupname, reportname FROM ".DBReports." - WHERE defaultreport='1' AND reporttype='frm' - ORDER BY groupname, reportname"; + $sql= "SELECT id, + groupname, + reportname + FROM ".DBReports." + WHERE defaultreport='1' + AND reporttype='frm' + ORDER BY groupname, + reportname"; $Result=DB_query($sql,$db,'','',false,true); $FormList = ''; while ($Temp = DB_fetch_array($Result)) $FormList[] = $Temp; @@ -160,9 +165,11 @@ $OutputString .= '</td></tr>'; } } else { // fetch the forms specific to a group GroupID - $sql= "SELECT id, reportname FROM ".DBReports." - WHERE defaultreport='1' AND groupname='".$GroupID."' - ORDER BY reportname"; + $sql= "SELECT id, + reportname + FROM ".DBReports." + WHERE defaultreport='1' AND groupname='".$GroupID."' + ORDER BY reportname"; $Result=DB_query($sql,$db,'','',false,true); $OutputString .= '<tr><td colspan="3" width="250" valign="top">'; while ($Forms = DB_fetch_array($Result)) { @@ -175,15 +182,33 @@ function FetchReportDetails($ReportID) { global $db; - $sql= "SELECT reportname, reporttype, groupname, papersize, paperorientation, - margintop, marginbottom, marginleft, marginright, - table1, table2, table2criteria, table3, table3criteria, table4, table4criteria, - table5, table5criteria, table6, table6criteria - FROM ".DBReports." - WHERE id = ".$ReportID.";"; + $sql= "SELECT reportname, + reporttype, + groupname, + papersize, + paperorientation, + margintop, + marginbottom, + marginleft, + marginright, + table1, + table2, + table2criteria, + table3, + table3criteria, + table4, + table4criteria, + table5, + table5criteria, + table6, + table6criteria + FROM " . DBReports . " + WHERE id = ".$ReportID.";"; $Result=DB_query($sql,$db,'','',false,true); $myrow=DB_fetch_assoc($Result); - foreach ($myrow as $key=>$value) $Prefs[$key]=$value; + foreach ($myrow as $key=>$value) { + $Prefs[$key]=$value; + } // Build drop down menus for selectable criteria $Temp = RetrieveFields($ReportID, 'dateselect'); $Prefs['DateListings'] = $Temp[0]; // only need the first field @@ -196,8 +221,9 @@ global $db; $FieldListings = ''; $sql= "SELECT * FROM ".DBRptFields." - WHERE reportid = ".$ReportID." AND entrytype = '".$EntryType."' - ORDER BY seqnum"; + WHERE reportid = '".$ReportID."' + AND entrytype = '".$EntryType."' + ORDER BY seqnum"; $Result=DB_query($sql,$db,'','',false,true); while ($FieldValues = DB_fetch_assoc($Result)) { $FieldListings[] = $FieldValues; } return $FieldListings; @@ -210,9 +236,15 @@ // retrieve the dropdown based on the params field (dropdown type) $Params = explode(':',$FieldListings['params']); // the first value is the criteria type $CritBlocks = explode(':',$CritChoices[array_shift($Params)]); - if (!isset($Params[0])) $Params[0] = '-'; // default to no default if this parameter doesn't exist - if (!isset($Params[1])) $Params[1] = ''; // default to no entry for default from box - if (!isset($Params[2])) $Params[2] = ''; // default to no entry for default to box + if (!isset($Params[0])) { + $Params[0] = '-'; // default to no default if this parameter doesn't exist + } + if (!isset($Params[1])) { + $Params[1] = ''; // default to no entry for default from box + } + if (!isset($Params[2])) { + $Params[2] = ''; // default to no entry for default to box + } switch (array_shift($CritBlocks)) { // determine how many text boxes to build default: case 0: $EndString = '<td> </td><td> </td>'; @@ -225,7 +257,11 @@ } // end switch array_shift($CritBlocks) $CriteriaString .= '<td><select name="defcritsel'.$SeqNum.'">'; foreach ($CritBlocks as $value) { - if ($Params[0]==$value) $Selected = ' selected'; else $Selected = ''; // find the default + if ($Params[0]==$value) { + $Selected = ' selected'; + } else { + $Selected = ''; // find the default + } $CriteriaString .= '<option value="'.$value.'"'.$Selected.'>'.$value.'</option>'; } $CriteriaString .= '</select></td>'; Modified: trunk/reportwriter/ReportMaker.php =================================================================== --- trunk/reportwriter/ReportMaker.php 2011-01-05 09:49:09 UTC (rev 4460) +++ trunk/reportwriter/ReportMaker.php 2011-01-06 05:16:06 UTC (rev 4461) @@ -2,14 +2,14 @@ /* $Revision: 1.7 $ */ $DirectoryLevelsDeep =1; $PathPrefix = '../'; -$PageSecurity = 1; // set security level for webERP +//$PageSecurity = 1; // set security level for webERP // TBD The followiung line needs to be replace when more translations are available $ReportLanguage = 'en_US'; // default language file -define('DBReports','reports'); // name of the databse holding the main report information (ReportID) -define('DBRptFields','reportfields'); // name of the database holding the report fields -define('FPDF_FONTPATH','../fonts/'); // FPDF path to fonts directory +define('DBReports','reports'); // name of the databse table holding the main report information (ReportID) +define('DBRptFields','reportfields'); // name of the database table holding the report fields +//define('FPDF_FONTPATH','../fonts/'); FPDF path to fonts directory // Fetch necessary include files - Host application specific (webERP) require($PathPrefix . 'includes/session.inc'); @@ -49,7 +49,7 @@ if ($SeqNum<>1) $success = ChangeSequence($ReportID, $SeqNum, 'fieldlist', 'up'); } elseif (isset($_POST['dn'.$SeqNum.'_x'])) { // the shift down button was pushed $sql = "SELECT seqnum FROM ".DBRptFields." - WHERE reportid = ".$ReportID." AND entrytype = 'fieldlist';"; + WHERE reportid = ".$ReportID." AND entrytype = 'fieldlist';"; $Result=DB_query($sql,$db,'','',false,true); if ($SeqNum<DB_num_rows($Result)) { $success = ChangeSequence($ReportID, $SeqNum, 'fieldlist', 'down'); @@ -131,7 +131,7 @@ case RPT_BTN_EXPPDF: $Prefs = ReadPostData($ReportID, $Prefs); // include the necessary files to build report - require($PathPrefix . 'includes/fpdf.php'); // FPDF class to generate reports + require($PathPrefix . 'includes/tcpdf/tcpdf.php'); // TCPDF class to generate reports require('WriteReport.inc'); $ReportData = ''; $success = BuildSQL($Prefs); Modified: trunk/reportwriter/WriteReport.inc =================================================================== --- trunk/reportwriter/WriteReport.inc 2011-01-05 09:49:09 UTC (rev 4460) +++ trunk/reportwriter/WriteReport.inc 2011-01-06 05:16:06 UTC (rev 4461) @@ -1,278 +1,267 @@ -<?PHP -// for compatability with extended char sets -if ($_SESSION['Language']=='zh_CN'){ - include($PathPrefix . 'includes/FPDF_Chinese.php'); -} elseif ($_SESSION['Language']=='ja_JP'){ - include($PathPrefix . 'includes/FPDF_Japanese.php'); -} elseif ($_SESSION['Language']=='ko_KR'){ - include($PathPrefix . 'includes/FPDF_Korean.php'); -} else { - class PDF_Language extends FPDF { } -} +<?php +require_once($PathPrefix .'/includes/class.pdf.php'); -class PDF extends PDF_Language { +class PDF extends Cpdf { var $y0; // current y position var $x0; // current x position var $pageY; // y value of bottom of page less bottom margin - -function PDF() { - global $Prefs; - $PaperSize = explode(':',$Prefs['papersize']); - $this->PDF_Language($Prefs['paperorientation'], 'mm', $PaperSize[0]); - if ($Prefs['paperorientation']=='P') { // Portrait - calculate max page height - $this->pageY = $PaperSize[2]-$Prefs['marginbottom']; - } else { // Landscape - $this->pageY = $PaperSize[1]-$Prefs['marginbottom']; + + function PDF() { + global $Prefs; + $PaperSize = explode(':',$Prefs['papersize']); + $this->Cpdf($Prefs['paperorientation'], 'mm', $PaperSize[0]); + if ($Prefs['paperorientation']=='P') { // Portrait - calculate max page height + $this->pageY = $PaperSize[2]-$Prefs['marginbottom']; + } else { // Landscape + $this->pageY = $PaperSize[1]-$Prefs['marginbottom']; + } + $this->SetMargins($Prefs['marginleft'], $Prefs['margintop'], $Prefs['marginright']); + $this->SetAutoPageBreak(0, $Prefs['marginbottom']); + + $this->SetDrawColor(128,0,0); + $this->SetLineWidth(.35); // 1 point + $this->AliasNbPages(); + $this->AddPage(); + } - $this->SetMargins($Prefs['marginleft'], $Prefs['margintop'], $Prefs['marginright']); - $this->SetAutoPageBreak(0, $Prefs['marginbottom']); - $this->SetFont($Prefs['coynamefont']); - $this->SetDrawColor(128,0,0); - $this->SetLineWidth(.35); // 1 point - $this->AliasNbPages(); - $this->AddPage(); - - if ($_SESSION['Language']=='zh_CN'){ - $this->AddBig5Font(); - } elseif ($_SESSION['Language']=='zh_HK'){ - $this->AddCIDFont(); - } elseif ($_SESSION['Language']=='ja_JP'){ - $this->AddSJISFont(); - } elseif ($_SESSION['Language']=='ko_KR'){ - $this->AddUHCFont(); - } -} - -function Header() { - global $Prefs, $Heading, $Seq; - define(RowSpace,2); // define separation between the heading rows - if ($Prefs['coynameshow']) { // Show the company name - $this->SetFont($Prefs['coynamefont'],'B',$Prefs['coynamefontsize']); - $Colors = explode(':',$Prefs['coynamefontcolor']); + + function Header() { + global $Prefs, $Heading, $Seq; + define(RowSpace,2); // define separation between the heading rows + if ($Prefs['coynameshow']) { // Show the company name + $Colors = explode(':',$Prefs['coynamefontcolor']); + $this->SetTextColor($Colors[0], $Colors[1], $Colors[2]); + $CellHeight = ($Prefs['coynamefontsize']+RowSpace)*0.35; + $this->Cell(0,$CellHeight,$_SESSION['CompanyRecord']['coyname'],0,1,$Prefs['coynamealign']); + } + if ($Prefs['title1show']) { // Set title 1 heading + $Colors = explode(':',$Prefs['title1fontcolor']); + $this->SetTextColor($Colors[0], $Colors[1], $Colors[2]); + $CellHeight = ($Prefs['title1fontsize']+RowSpace)*0.35; + $this->Cell(0,$CellHeight,$this->SubTitle($Prefs['title1desc']),0,1,$Prefs['title1fontalign']); + } + if ($Prefs['title2show']) { // Set Title 2 heading + $Colors = explode(':',$Prefs['title2fontcolor']); + $this->SetTextColor($Colors[0], $Colors[1], $Colors[2]); + $CellHeight = ($Prefs['title2fontsize']+RowSpace)*0.35; + $this->Cell(0,$CellHeight,$this->SubTitle($Prefs['title2desc']),0,1,$Prefs['title2fontalign']); + } + // Set the filter heading + $Colors = explode(':',$Prefs['filterfontcolor']); $this->SetTextColor($Colors[0], $Colors[1], $Colors[2]); - $CellHeight = ($Prefs['coynamefontsize']+RowSpace)*0.35; - $this->Cell(0,$CellHeight,$_SESSION['CompanyRecord']['coyname'],0,1,$Prefs['coynamealign']); - } - if ($Prefs['title1show']) { // Set title 1 heading - $this->SetFont($Prefs['title1font'],'',$Prefs['title1fontsize']); - $Colors = explode(':',$Prefs['title1fontcolor']); + $CellHeight = ($Prefs['filterfontsize']+RowSpace)*0.35; // convert points to mm + $this->MultiCell(0,$CellHeight,$Prefs['filterdesc'],'B',1,$Prefs['filterfontalign']); + $this->y0=$this->GetY(); // set y position after report headings before column titles + // Set the table header + $Colors = explode(':',$Prefs['datafontcolor']); $this->SetTextColor($Colors[0], $Colors[1], $Colors[2]); - $CellHeight = ($Prefs['title1fontsize']+RowSpace)*0.35; - $this->Cell(0,$CellHeight,$this->SubTitle($Prefs['title1desc']),0,1,$Prefs['title1fontalign']); + $this->SetDrawColor(128,0,0); + $this->SetLineWidth(.35); // 1 point + $CellHeight = ($Prefs['datafontsize']+RowSpace)*0.35; + // fetch the column widths and put into array to match the columns of data + $CellXPos[0] = $Prefs['marginleft']; + for ($x=1; $x<=20; $x++) { + $CellXPos[$x] = $CellXPos[$x-1] + $Prefs['col'.$x.'width']; + } + // Fetch the column break array + foreach ($Seq as $Temp) { + if ($Temp['break']) { + $ColBreak[] = true; + } else { + $ColBreak[] = false; + } + } + // See if we need to truncate the data + if ($Prefs['TruncListings']['params']=='1') { + $trunc=true; + } else { + $trunc=false; + } + // Ready to draw the column titles in the header + $maxY = $this->y0; // set to track the tallest column + $col = 1; + $LastY = $this->y0; + foreach ($Heading as $key=>$value) { + $this->SetLeftMargin($CellXPos[$col-1]); + $this->SetX($CellXPos[$col-1]); + $this->SetY($LastY); + // truncate data if selected + if ($trunc) { + $value=$this->TruncData($value, $Prefs['col'.$col.'width']); + } + $this->MultiCell($CellXPos[$col]-$CellXPos[$col-1],$CellHeight,$value); + if ($ColBreak[$key]) { + $col++; + $LastY = $this->y0; + } else $LastY = $this->GetY(); + if ($this->GetY()>$maxY) $maxY = $this->GetY(); // check for new col max height + } + // Draw a bottom line for the end of the heading + $this->SetLeftMargin($CellXPos[0]); + $this->SetX($CellXPos[0]); + $this->SetY($this->y0); + $this->Cell(0,$maxY-$this->y0,' ','B'); + $this->y0=$maxY+0.35; } - if ($Prefs['title2show']) { // Set Title 2 heading - $this->SetFont($Prefs['title2font'],'',$Prefs['title2fontsize']); - $Colors = explode(':',$Prefs['title2fontcolor']); - $this->SetTextColor($Colors[0], $Colors[1], $Colors[2]); - $CellHeight = ($Prefs['title2fontsize']+RowSpace)*0.35; - $this->Cell(0,$CellHeight,$this->SubTitle($Prefs['title2desc']),0,1,$Prefs['title2fontalign']); + + function SubTitle($Title) { + global $Prefs; + // substitutes a command string with current information + $Title=preg_replace('/%date%/', date('Y-m-d',time()), $Title); + $Title=preg_replace('/%reportname%/', $Prefs['reportname'], $Title); + return $Title; } - // Set the filter heading - $this->SetFont($Prefs['filterfont'],'',$Prefs['filterfontsize']); - $Colors = explode(':',$Prefs['filterfontcolor']); - $this->SetTextColor($Colors[0], $Colors[1], $Colors[2]); - $CellHeight = ($Prefs['filterfontsize']+RowSpace)*0.35; // convert points to mm - $this->MultiCell(0,$CellHeight,$Prefs['filterdesc'],'B',1,$Prefs['filterfontalign']); - $this->y0=$this->GetY(); // set y position after report headings before column titles - // Set the table header - $this->SetFont($Prefs['datafont'],'',$Prefs['datafontsize']); - $Colors = explode(':',$Prefs['datafontcolor']); - $this->SetTextColor($Colors[0], $Colors[1], $Colors[2]); - $this->SetDrawColor(128,0,0); - $this->SetLineWidth(.35); // 1 point - $CellHeight = ($Prefs['datafontsize']+RowSpace)*0.35; - // fetch the column widths and put into array to match the columns of data - $CellXPos[0] = $Prefs['marginleft']; - for ($x=1; $x<=20; $x++) $CellXPos[$x] = $CellXPos[$x-1] + $Prefs['col'.$x.'width']; - // Fetch the column break array - foreach ($Seq as $Temp) if ($Temp['break']) $ColBreak[] = true; else $ColBreak[] = false; - // See if we need to truncate the data - if ($Prefs['TruncListings']['params']=='1') $trunc=true; else $trunc=false; - // Ready to draw the column titles in the header - $maxY = $this->y0; // set to track the tallest column - $col = 1; - $LastY = $this->y0; - foreach ($Heading as $key=>$value) { - $this->SetLeftMargin($CellXPos[$col-1]); - $this->SetX($CellXPos[$col-1]); - $this->SetY($LastY); - // truncate data if selected - if ($trunc) $value=$this->TruncData($value, $Prefs['col'.$col.'width']); - $this->MultiCell($CellXPos[$col]-$CellXPos[$col-1],$CellHeight,$value); - if ($ColBreak[$key]) { - $col++; - $LastY = $this->y0; - } else $LastY = $this->GetY(); - if ($this->GetY()>$maxY) $maxY = $this->GetY(); // check for new col max height + + function Footer() { + //Position at 1.5 cm from bottom + $this->SetY(-15); + //Arial italic 8 + $this->SetTextColor(0); + //Page number + $this->Cell(0,10,'Page '.$this->PageNo().'/{nb}',0,0,'C'); } - // Draw a bottom line for the end of the heading - $this->SetLeftMargin($CellXPos[0]); - $this->SetX($CellXPos[0]); - $this->SetY($this->y0); - $this->Cell(0,$maxY-$this->y0,' ','B'); - $this->y0=$maxY+0.35; -} - -function SubTitle($Title) { - global $Prefs; - // substitutes a command string with current information - $Title=preg_replace('/%date%/', date('Y-m-d',time()), $Title); - $Title=preg_replace('/%reportname%/', $Prefs['reportname'], $Title); - return $Title; -} - -function Footer() { - //Position at 1.5 cm from bottom - $this->SetY(-15); - //Arial italic 8 - $this->SetFont('Helvetica','',8); - $this->SetTextColor(0); - //Page number - $this->Cell(0,10,'Page '.$this->PageNo().'/{nb}',0,0,'C'); -} - -function ReportTable($Data) { - global $Prefs, $Seq; - - $FillColor = array(224, 235, 255); - $this->SetFont($Prefs['datafont'],'',$Prefs['datafontsize']); - $this->SetFillColor($FillColor[0],$FillColor[1],$FillColor[2]); - $Colors = explode(':',$Prefs['datafontcolor']); - $this->SetTextColor($Colors[0], $Colors[1], $Colors[2]); - $CellHeight = ($Prefs['datafontsize']+RowSpace)*0.35; - // Fetch the column widths and put into array to match the columns of data - $CellXPos[0] = $Prefs['marginleft']; - for ($x=1; $x<=20; $x++) $CellXPos[$x] = $CellXPos[$x-1] + $Prefs['col'.$x.'width']; - // Fetch the column break array - foreach ($Seq as $Temp) { - if ($Temp['break']){ - $ColBreak[] = true; + + function ReportTable($Data) { + global $Prefs, $Seq; + + $FillColor = array(224, 235, 255); + $this->SetFillColor($FillColor[0],$FillColor[1],$FillColor[2]); + $Colors = explode(':',$Prefs['datafontcolor']); + $this->SetTextColor($Colors[0], $Colors[1], $Colors[2]); + $CellHeight = ($Prefs['datafontsize']+RowSpace)*0.35; + // Fetch the column widths and put into array to match the columns of data + $CellXPos[0] = $Prefs['marginleft']; + for ($x=1; $x<=20; $x++) $CellXPos[$x] = $CellXPos[$x-1] + $Prefs['col'.$x.'width']; + // Fetch the column break array + foreach ($Seq as $Temp) { + if ($Temp['break']){ + $ColBreak[] = true; + } else { + $ColBreak[] = false; + } + } + // See if we need to truncate the data + if ($Prefs['TruncListings']['params']=='1') { + $trunc=true; } else { - $ColBreak[] = false; + $trunc=false; } - } - // See if we need to truncate the data - if ($Prefs['TruncListings']['params']=='1') { - $trunc=true; - } else { - $trunc=false; - } - // Ready to draw the column data - $fill=false; - $NeedTop='No'; - $MaxRowHt = 0; //track the tallest row to estimate page breaks - foreach($Data as $myrow) { - $Action = array_shift($myrow); - $todo = explode(':',$Action); // contains a letter of the date type and title/groupname - switch ($todo[0]) { - case "r": // Report Total - case "g": // Group Total - // Draw a fill box - if ($this->y0+(2*$MaxRowHt)>$this->pageY) { - // Fill the end of the report with white space + // Ready to draw the column data + $fill=false; + $NeedTop='No'; + $MaxRowHt = 0; //track the tallest row to estimate page breaks + foreach($Data as $myrow) { + $Action = array_shift($myrow); + $todo = explode(':',$Action); // contains a letter of the date type and title/groupname + switch ($todo[0]) { + case "r": // Report Total + case "g": // Group Total + // Draw a fill box + if ($this->y0+(2*$MaxRowHt)>$this->pageY) { + // Fill the end of the report with white space + $this->SetLeftMargin($CellXPos[0]); + $this->SetX($CellXPos[0]); + $this->SetY($this->y0); + $this->SetFillColor(255); + $this->Cell(0,$this->pageY-$this->y0,'','',0,'L',1); + $this->AddPage(); + $MaxRowHt=0; + } $this->SetLeftMargin($CellXPos[0]); $this->SetX($CellXPos[0]); $this->SetY($this->y0); - $this->SetFillColor(255); - $this->Cell(0,$this->pageY-$this->y0,'','',0,'L',1); - $this->AddPage(); - $MaxRowHt=0; - } - $this->SetLeftMargin($CellXPos[0]); - $this->SetX($CellXPos[0]); - $this->SetY($this->y0); - $this->SetFillColor(240); - $this->Cell(0,$this->pageY-$this->y0,'',$brdr,0,'L',1); - // Add total heading - $this->SetLeftMargin($CellXPos[0]); - $this->SetX($CellXPos[0]); - $this->SetY($this->y0); - if ($todo[0]=='g') $Desc = 'Group'; else $Desc = 'Report'; - $this->Cell(0,$CellHeight,$Desc.' Total For: '.$todo[1],1,1,'C'); - $this->y0=$this->GetY()+0.35; - $NeedTop = 'Next'; - $fill=false; // set so totals data will not be filled - // now fall into the 'd' case to show the data - case "d": // data element - default: - // figure out if a border needs to be drawn for total separation - // and fill color (draws an empty box over the row just written with the fill color) - $brdr = 0; - if ($NeedTop=='Yes') { - $brdr='T'; - $fill=false; // set so first data after total will not be filled - $NeedTop='No'; - } elseif ($NeedTop=='Next') { - $brdr='LR'; - $NeedTop='Yes'; - } - // Draw a fill box - if (($this->y0+$MaxRowHt)>$this->pageY) { - // Fill the end of the report with white space + $this->SetFillColor(240); + $this->Cell(0,$this->pageY-$this->y0,'',$brdr,0,'L',1); + // Add total heading $this->SetLeftMargin($CellXPos[0]); $this->SetX($CellXPos[0]); $this->SetY($this->y0); - $this->SetFillColor(255); - $this->Cell(0,$this->pageY-$this->y0,'','',0,'L',1); - $this->AddPage(); - $MaxRowHt=0; - } - $this->SetLeftMargin($CellXPos[0]); - $this->SetX($CellXPos[0]); - $this->SetY($this->y0); - if ($fill) $this->SetFillColor($FillColor[0],$FillColor[1],$FillColor[2]); else $this->SetFillColor(255); - $this->Cell(0,$this->pageY-$this->y0,'',$brdr,0,'L',1); - // fill in the data - $maxY = $this->y0; // set to current top of row - $col = 1; - $LastY = $this->y0; - foreach ($myrow as $key=>$value) { - $this->SetLeftMargin($CellXPos[$col-1]); - $this->SetX($CellXPos[$col-1]); - $this->SetY($LastY); - // truncate data if necessary - if ($trunc) $value=$this->TruncData($value, $Prefs['col'.$col.'width']); - $this->MultiCell($CellXPos[$col]-$CellXPos[$col-1],$CellHeight,$value,0); - if ($ColBreak[$key]) { - $col++; - $LastY = $this->y0; - } else $LastY = $this->GetY(); - if ($this->GetY()>$maxY) $maxY = $this->GetY(); - } - $this->SetLeftMargin($CellXPos[0]); // restore left margin - break; + if ($todo[0]=='g') $Desc = 'Group'; else $Desc = 'Report'; + $this->Cell(0,$CellHeight,$Desc.' Total For: '.$todo[1],1,1,'C'); + $this->y0=$this->GetY()+0.35; + $NeedTop = 'Next'; + $fill=false; // set so totals data will not be filled + // now fall into the 'd' case to show the data + case "d": // data element + default: + // figure out if a border needs to be drawn for total separation + // and fill color (draws an empty box over the row just written with the fill color) + $brdr = 0; + if ($NeedTop=='Yes') { + $brdr='T'; + $fill=false; // set so first data after total will not be filled + $NeedTop='No'; + } elseif ($NeedTop=='Next') { + $brdr='LR'; + $NeedTop='Yes'; + } + // Draw a fill box + if (($this->y0+$MaxRowHt)>$this->pageY) { + // Fill the end of the report with white space + $this->SetLeftMargin($CellXPos[0]); + $this->SetX($CellXPos[0]); + $this->SetY($this->y0); + $this->SetFillColor(255); + $this->Cell(0,$this->pageY-$this->y0,'','',0,'L',1); + $this->AddPage(); + $MaxRowHt=0; + } + $this->SetLeftMargin($CellXPos[0]); + $this->SetX($CellXPos[0]); + $this->SetY($this->y0); + if ($fill) $this->SetFillColor($FillColor[0],$FillColor[1],$FillColor[2]); else $this->SetFillColor(255); + $this->Cell(0,$this->pageY-$this->y0,'',$brdr,0,'L',1); + // fill in the data + $maxY = $this->y0; // set to current top of row + $col = 1; + $LastY = $this->y0; + foreach ($myrow as $key=>$value) { + $this->SetLeftMargin($CellXPos[$col-1]); + $this->SetX($CellXPos[$col-1]); + $this->SetY($LastY); + // truncate data if necessary + if ($trunc) $value=$this->TruncData($value, $Prefs['col'.$col.'width']); + $this->MultiCell($CellXPos[$col]-$CellXPos[$col-1],$CellHeight,$value,0); + if ($ColBreak[$key]) { + $col++; + $LastY = $this->y0; + } else $LastY = $this->GetY(); + if ($this->GetY()>$maxY) $maxY = $this->GetY(); + } + $this->SetLeftMargin($CellXPos[0]); // restore left margin + break; + } + $ThisRowHt=$maxY-$this->y0; // seee how tall this row was + if ($ThisRowHt>$MaxRowHt) $MaxRowHt = $ThisRowHt; // keep that largest row so far to track pagination + $this->y0=$maxY; // set y position to largest value for next row + $fill=!$fill; + } + // Fill the end of the report with white space + $this->SetLeftMargin($CellXPos[0]); + $this->SetX($CellXPos[0]); + $this->SetY($this->y0); + $this->SetFillColor(255); + $this->Cell(0,$this->pageY-$this->y0,'','T',0,'L',1); + } + + function TruncData($strData, $ColWidth) { + $percent=0.90; //percent to truncate from max to account for proportional spacing + $CurWidth = $this->GetStringWidth($strData); + if ($CurWidth>($ColWidth*.90)) { // then it needs to be truncated + // for now we'll do an approximation based on averages and scale to 90% of the width to allow for variance + // A better aproach would be an recursive call to this function until the string just fits. + $NumChars = strlen($strData); + // Reduce the string by 1-$percent and retest + $strData = $this->TruncData(substr($strData, 0, ($ColWidth/$CurWidth)*$NumChars*$percent), $ColWidth); } - $ThisRowHt=$maxY-$this->y0; // seee how tall this row was - if ($ThisRowHt>$MaxRowHt) $MaxRowHt = $ThisRowHt; // keep that largest row so far to track pagination - $this->y0=$maxY; // set y position to largest value for next row - $fill=!$fill; - } - // Fill the end of the report with white space - $this->SetLeftMargin($CellXPos[0]); - $this->SetX($CellXPos[0]); - $this->SetY($this->y0); - $this->SetFillColor(255); - $this->Cell(0,$this->pageY-$this->y0,'','T',0,'L',1); -} - -function TruncData($strData, $ColWidth) { - $percent=0.90; //percent to truncate from max to account for proportional spacing - $CurWidth = $this->GetStringWidth($strData); - if ($CurWidth>($ColWidth*.90)) { // then it needs to be truncated - // for now we'll do an approximation based on averages and scale to 90% of the width to allow for variance - // A better aproach would be an recursive call to this function until the string just fits. - $NumChars = strlen($strData); - // Reduce the string by 1-$percent and retest - $strData = $this->TruncData(substr($strData, 0, ($ColWidth/$CurWidth)*$NumChars*$percent), $ColWidth); + return $strData; } - return $strData; -} + + function Stream($FileName) { + $this->Output($FileName,'D'); + } -function Stream($FileName) { - $this->Output($FileName,'D'); -} - } // end class function BuildSQL($Prefs) { Modified: trunk/sql/mysql/upgrade3.11.1-4.00.sql =================================================================== --- trunk/sql/mysql/upgrade3.11.1-4.00.sql 2011-01-05 09:49:09 UTC (rev 4460) +++ trunk/sql/mysql/upgrade3.11.1-4.00.sql 2011-01-06 05:16:06 UTC (rev 4461) @@ -804,4 +804,10 @@ ('Z_UploadResult.php', 15, 'Utility to upload a file to a remote server'); INSERT INTO config (confname, confvalue) VALUES ('VersionNumber', '3.12.0'); -UPDATE config SET confvalue='3.12.1' WHERE confname='VersionNumber'; \ No newline at end of file +UPDATE config SET confvalue='3.12.1' WHERE confname='VersionNumber'; + +INSERT INTO `scripts` (`script`, `pagesecurity`, `description`) VALUES +('FormMaker.php', 1, 'Allows running user defined Forms'), +('ReportMaker.php', 1, 'Produces reports from the report writer templates created'), +('ReportCreator.php', 13, 'Report Writer and Form Creator script that creates templates for user defined reports and forms'); +UPDATE config SET confvalue='3.12.2' WHERE confname='VersionNumber'; This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <dai...@us...> - 2011-01-08 08:45:43
|
Revision: 4462 http://web-erp.svn.sourceforge.net/web-erp/?rev=4462&view=rev Author: daintree Date: 2011-01-08 08:45:36 +0000 (Sat, 08 Jan 2011) Log Message: ----------- Ricard fixes Modified Paths: -------------- trunk/Z_ChangeBranchCode.php trunk/Z_ChangeCustomerCode.php trunk/doc/Change.log.html Modified: trunk/Z_ChangeBranchCode.php =================================================================== --- trunk/Z_ChangeBranchCode.php 2011-01-06 05:16:06 UTC (rev 4461) +++ trunk/Z_ChangeBranchCode.php 2011-01-08 08:45:36 UTC (rev 4462) @@ -183,7 +183,7 @@ $result = DB_Txn_Commit($db); - $result = DB_IgnoreForeignKeyChecks($db); + $result = DB_IgnoreForeignKeys($db); prnMsg(_('Deleting the old customer branch record'),'info'); $sql = "DELETE FROM custbranch WHERE debtorno='" . $_POST['DebtorNo'] . "' @@ -191,7 +191,7 @@ $ErrMsg = _('The SQL to delete the old customer branch record failed because'); $result = DB_query($sql,$db,$ErrMsg,$DbgMsg,true,true); - $result = DB_ReinstateForeignKeyChecks($db); + $result = DB_ReinstateForeignKeys($db); } Modified: trunk/Z_ChangeCustomerCode.php =================================================================== --- trunk/Z_ChangeCustomerCode.php 2011-01-06 05:16:06 UTC (rev 4461) +++ trunk/Z_ChangeCustomerCode.php 2011-01-08 08:45:36 UTC (rev 4462) @@ -58,7 +58,8 @@ `editransport`, `ediaddress`, `ediserveruser`, - `ediserverpwd`) + `ediserverpwd`, + `typeid`) SELECT '" . $_POST['NewDebtorNo'] . "', `name`, `address1`, @@ -83,7 +84,8 @@ `editransport`, `ediaddress`, `ediserveruser`, - `ediserverpwd` + `ediserverpwd`, + `typeid` FROM debtorsmaster WHERE debtorno='" . $_POST['OldDebtorNo'] . "'"; Modified: trunk/doc/Change.log.html =================================================================== --- trunk/doc/Change.log.html 2011-01-06 05:16:06 UTC (rev 4461) +++ trunk/doc/Change.log.html 2011-01-08 08:45:36 UTC (rev 4462) @@ -1,5 +1,6 @@ <p><font SIZE=4 COLOR=BLUE><b>webERP Change Log</b></font></p> <p></p> +<p>8/1/11 Ricard Andreu: Z_ChangeCustomerCode.php added typeid field that made change customer code fail. Also corrected typo for foreign key checking side stepping for Z_ChangeBranchCode.php</p> <p>5/1/11 Phil: Bug fixes AssetLocationTransfer and Supplier Contacts</p> <p>4/1/11 Paul T: Bug# 3151192 - insert underscore for superglobal.</p> <p>5/1/11 Phil: Bug fixes AssetLocationTransfer and Supplier Contacts</p> This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <dai...@us...> - 2011-01-10 21:30:34
|
Revision: 4463 http://web-erp.svn.sourceforge.net/web-erp/?rev=4463&view=rev Author: daintree Date: 2011-01-10 21:30:27 +0000 (Mon, 10 Jan 2011) Log Message: ----------- continuation of PO rationalisation Modified Paths: -------------- trunk/PO_Items.php trunk/includes/ConnectDB.inc trunk/includes/DefinePOClass.php trunk/includes/PO_ReadInOrder.inc trunk/sql/mysql/upgrade3.11.1-4.00.sql Modified: trunk/PO_Items.php =================================================================== --- trunk/PO_Items.php 2011-01-08 08:45:36 UTC (rev 4462) +++ trunk/PO_Items.php 2011-01-10 21:30:27 UTC (rev 4463) @@ -2,7 +2,7 @@ /* $Id PO_Items.php 4183 2010-12-14 09:30:20Z daintree $ */ -//$PageSecurity = 4; +//$PageSecurity = 4; Now retrieved from database include('includes/DefinePOClass.php'); include('includes/SQL_CommonFunctions.inc'); @@ -32,13 +32,13 @@ echo '<a href="'.$rootpath.'/PO_Header.php?' . SID . 'identifier=' . $identifier. '">' ._('Back To Purchase Order Header') . '</a><br>'; } -// add new request here 08-09-26 if (isset($_POST['StockID2']) AND $_GET['Edit']=='') { /* If a stock item is selected and a purchdata record * exists for it then find that record. */ $sql = "SELECT stockmaster.description, purchdata.suppliers_partno, + purchdata.converstionfactor, stockmaster.pkg_type, stockmaster.units, stockmaster.netweight, @@ -53,23 +53,24 @@ _('cannot be retrieved because'); $DbgMsg = _('The SQL used to retrieve the supplier details and failed was'); $result =DB_query($sql,$db,$ErrMsg,$DbgMsg); - $myrow = DB_fetch_row($result); + $myrow = DB_fetch_array($result); - $_POST['ItemDescription'] = $myrow[0]; - $_POST['Suppliers_PartNo'] = $myrow[1]; - $_POST['Package'] = $myrow[2]; - $_POST['uom'] = $myrow[3]; - $_POST['nw'] = $myrow[4]; - $_POST['gw'] = $myrow[5]; + $_POST['ItemDescription'] = $myrow['description']; + $_POST['Suppliers_PartNo'] = $myrow['suppliers_partno']; + $_POST['Package'] = $myrow['pkg_type']; + $_POST['uom'] = $myrow['units']; + $_POST['NetWeight'] = $myrow['netweight']; + $_POST['KGs'] = $myrow['kgs']; + $_POST['ConversionFactor']=$myrow['conversionfactor']; $_POST['CuFt'] = $myrow[6]; } // end if (isset($_POST['StockID2']) && $_GET['Edit']=='') if (isset($_POST['UpdateLines']) OR isset($_POST['Commit'])) { foreach ($_SESSION['PO'.$identifier]->LineItems as $POLine) { - if ($POLine->Deleted==False) { + if ($POLine->Deleted == false) { $_SESSION['PO'.$identifier]->LineItems[$POLine->LineNo]->Quantity=$_POST['Qty'.$POLine->LineNo]; $_SESSION['PO'.$identifier]->LineItems[$POLine->LineNo]->Price=$_POST['Price'.$POLine->LineNo]; - $_SESSION['PO'.$identifier]->LineItems[$POLine->LineNo]->nw=$_POST['nw'.$POLine->LineNo]; + $_SESSION['PO'.$identifier]->LineItems[$POLine->LineNo]->NetWeight=$_POST['NetWeight'.$POLine->LineNo]; $_SESSION['PO'.$identifier]->LineItems[$POLine->LineNo]->ReqDelDate=$_POST['ReqDelDate'.$POLine->LineNo]; } } @@ -82,7 +83,7 @@ */ $InputError=0; /*Start off assuming the best */ if ($_SESSION['PO'.$identifier]->DelAdd1=='' or strlen($_SESSION['PO'.$identifier]->DelAdd1)<3){ - prnMsg( _('The purchase order can not be committed to the database because there is no delivery street address specified'),'error'); + prnMsg( _('The purchase order cannot be committed to the database because there is no delivery street address specified'),'error'); $InputError=1; } elseif ($_SESSION['PO'.$identifier]->Location=='' or ! isset($_SESSION['PO'.$identifier]->Location)){ prnMsg( _('The purchase order can not be committed to the database because there is no location specified to book any stock items into'),'error'); @@ -100,6 +101,7 @@ if ($_SESSION['ExistingOrder']==0){ /*its a new order to be inserted */ +//Do we need to check authorisation to create - no because already trapped when new PO session started $StatusComment=date($_SESSION['DefaultDateFormat']).' - ' . _('Order Created by') . ' <a href="mailto:'. $_SESSION['UserEmail'] .'">'.$_SESSION['PO'.$identifier]->Initiator. '</a> - '.$_SESSION['PO'.$identifier]->StatusMessage.'<br>'; @@ -193,12 +195,13 @@ subtotal_amount, package, pcunit, - nw, - gw, + netweight, + kgs, cuft, total_quantity, total_amount, - assetid ) + assetid, + conversionfactor ) VALUES ( '" . $_SESSION['PO'.$identifier]->OrderNo . "', '" . $POLine->StockID . "', @@ -215,12 +218,13 @@ '" . $POLine->SubTotal_Amount . "', '" . $POLine->Package . "', '" . $POLine->PcUnit . "', - '" . $POLine->nw . "', - '" . $POLine->gw . "', + '" . $POLine->NetWeight . "', + '" . $POLine->KGs . "', '" . $POLine->CuFt . "', '" . $POLine->Total_Quantity . "', '" . $POLine->Total_Amount . "', - '" . $POLine->AssetID . "')"; + '" . $POLine->AssetID . "', + '" . $POLine->SuppConversionFactor . "')"; $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'); $result =DB_query($sql,$db,$ErrMsg,$DbgMsg,true); @@ -295,12 +299,13 @@ subtotal_amount, package, pcunit, - nw, - gw, + netweight, + kgs, cuft, total_quantity, total_amount, - assetid ) + assetid, + suppconversionfactor ) VALUES ( '" . $_SESSION['PO'.$identifier]->OrderNo . "', '" . $POLine->StockID . "', @@ -317,12 +322,13 @@ '" . $POLine->SubTotal_Amount . "', '" . $POLine->Package . "', '" . $POLine->PcUnit . "', - '" . $POLine->nw . "', - '" . $POLine->gw . "', + '" . $POLine->NetWeight . "', + '" . $POLine->KGs . "', '" . $POLine->CuFt . "', '" . $POLine->Total_Quantity . "', '" . $POLine->Total_Amount . "', - '" . $POLine->AssetID . "')"; + '" . $POLine->AssetID . "', + '" . $POLine->ConversionFactor . "')"; } else { if ($POLine->Quantity==$POLine->QtyReceived){ @@ -340,13 +346,14 @@ subtotal_amount='" . $POLine->SubTotal_Amount . "', package='" . $POLine->Package . "', pcunit='" . $POLine->PcUnit . "', - nw='" . $POLine->nw . "', - gw='" . $POLine->gw . "', + netweight='" . $POLine->NetWeight . "', + kgs='" . $POLine->KGs . "', cuft='" . $POLine->CuFt . "', total_quantity='" . $POLine->Total_Quantity . "', total_amount='" . $POLine->Total_Amount . "', completed=1, - assetid='" . $POLine->AssetID . "' + assetid='" . $POLine->AssetID . "', + suppconversionfactor = '" . $POLine->ConversionFactor . "' WHERE podetailitem='" . $POLine->PODetailRec . "'"; } else { $sql = "UPDATE purchorderdetails SET itemcode='" . $POLine->StockID . "', @@ -363,12 +370,13 @@ subtotal_amount='" . $POLine->SubTotal_Amount . "', package='" . $POLine->Package . "', pcunit='" . $POLine->PcUnit . "', - nw='" . $POLine->nw . "', - gw='" . $POLine->gw . "', + netweight='" . $POLine->NetWeight . "', + kgs='" . $POLine->KGs . "', cuft='" . $POLine->CuFt . "', total_quantity='" . $POLine->Total_Quantity . "', total_amount='" . $POLine->Total_Amount . "', - assetid='" . $POLine->AssetID . "' + assetid='" . $POLine->AssetID . "', + suppconversionfactor = '" . $POLine->ConversionFactor . "' WHERE podetailitem='" . $POLine->PODetailRec . "'"; } } @@ -409,7 +417,6 @@ FROM stockmaster INNER JOIN stockcategory ON stockmaster.categoryid=stockcategory.categoryid WHERE stockmaster.mbflag!='D' - AND stockmaster.mbflag!='A' AND stockmaster.mbflag!='K' and stockmaster.discontinued!=1 AND stockmaster.description LIKE '" . $SearchString ."' @@ -422,7 +429,6 @@ FROM stockmaster INNER JOIN stockcategory ON stockmaster.categoryid=stockcategory.categoryid WHERE stockmaster.mbflag!='D' - AND stockmaster.mbflag!='A' AND stockmaster.mbflag!='K' and stockmaster.discontinued!=1 AND stockmaster.description LIKE '". $SearchString ."' @@ -442,7 +448,6 @@ FROM stockmaster INNER JOIN stockcategory ON stockmaster.categoryid=stockcategory.categoryid WHERE stockmaster.mbflag!='D' - AND stockmaster.mbflag!='A' AND stockmaster.mbflag!='K' and stockmaster.discontinued!=1 AND stockmaster.stockid LIKE '" . $_POST['StockCode'] . "' @@ -455,7 +460,6 @@ FROM stockmaster INNER JOIN stockcategory ON stockmaster.categoryid=stockcategory.categoryid WHERE stockmaster.mbflag!='D' - AND stockmaster.mbflag!='A' AND stockmaster.mbflag!='K' and stockmaster.discontinued!=1 AND stockmaster.stockid LIKE '" . $_POST['StockCode'] . "' @@ -472,7 +476,6 @@ FROM stockmaster INNER JOIN stockcategory ON stockmaster.categoryid=stockcategory.categoryid WHERE stockmaster.mbflag!='D' - AND stockmaster.mbflag!='A' AND stockmaster.mbflag!='K' and stockmaster.discontinued!=1 ORDER BY stockmaster.stockid @@ -484,7 +487,6 @@ FROM stockmaster INNER JOIN stockcategory ON stockmaster.categoryid=stockcategory.categoryid WHERE stockmaster.mbflag!='D' - AND stockmaster.mbflag!='A' AND stockmaster.mbflag!='K' and stockmaster.discontinued!=1 AND stockmaster.categoryid='" . $_POST['StockCat'] . "' @@ -524,6 +526,7 @@ if (isset($_POST['LookupPrice']) and isset($_POST['StockID2'])){ $sql = "SELECT purchdata.price, purchdata.conversionfactor, + purchdata.suppliersuom, purchdata.supplierdescription FROM purchdata WHERE purchdata.supplierno = '" . $_SESSION['PO'.$identifier]->SupplierID . "' @@ -536,8 +539,11 @@ if (DB_num_rows($LookupResult)==1){ $myrow = DB_fetch_array($LookupResult); $_POST['Price'] = $myrow['price']/$myrow['conversionfactor']; + $_POST['SuppliersUOM'] = $myrow['suppliersuom']; + $_POST['ConversionFactor'] = $myrow['conversionfactor']; + } else { - prnMsg(_('Sorry') . ' ... ' . _('there is no purchasing data set up for this supplier') . ' - ' . $_SESSION['PO'.$identifier]->SupplierID . ' ' . _('and item') . ' ' . strtoupper($_POST['StockID']),'warn'); + prnMsg(_('There is no purchasing data set up for this supplier') . ' - ' . $_SESSION['PO'.$identifier]->SupplierID . ' ' . _('and item') . ' ' . strtoupper($_POST['StockID']),'warn'); } } @@ -590,16 +596,17 @@ $_POST['JobRef'], $_POST['ItemNo'], $_SESSION['PO'.$identifier]->LineItems[$_POST['LineNo']]->uom, - 1, //conversion factor not set?? + $_POST['ConverionFactor'], $_POST['Suppliers_PartNo'], $_POST['Qty']*$_POST['Price'], $_POST['Package'], $_POST['PcUnit'], - $_POST['nw'], - $_POST['gw'], + $_POST['NetWeight'], + $_POST['KGs'], $_POST['CuFt'], $_POST['Qty'], - $_POST['Qty']*$_POST['Price'] ); + $_POST['Qty']*$_POST['Price'], + $_POST['SuppliersUOM'] ); include ('includes/PO_UnsetFormVbls.php'); } @@ -693,7 +700,7 @@ $_POST['Qty'], $_POST['ItemDescription'], $_POST['Price'], - _('each'), + $_POST['uom'], $_POST['GLCode'], $_POST['ReqDelDate'], $_POST['ShiptRef'], @@ -702,21 +709,21 @@ 0, 0, $GLAccountName, - 2, + $_POST['DecimalPlaces'], $_POST['ItemNo'], - $_POST['uom'], - 1, - 1, + $_POST['SuppliersUOM'], + $_POST['ConversionFactor'], + $_POST['LeadTime'], $_POST['Suppliers_PartNo'], $_POST['SubTotal_Amount'], $_POST['Package'], $_POST['PcUnit'], - $_POST['nw'], - $_POST['gw'], + $_POST['NetWeight'], + $_POST['KGs'], $_POST['CuFt'], $_POST['Total_Quantity'], $_POST['Total_Amount'], - $_POST['AssetID'] ); + $_POST['AssetID']); include ('includes/PO_UnsetFormVbls.php'); } @@ -725,11 +732,12 @@ if (isset($_POST['NewItem'])){ /* NewItem is set from the part selection list as the part code selected */ -/* take the form entries and enter the data from the form into the PurchOrder class variable */ - foreach ($_POST as $key => $value) { - if (substr($key, 0, 3)=='qty') { - $ItemCode=substr($key, 3, strlen($key)-3); - $Quantity=$value; +/* take the form entries and enter the data from the form into the PurchOrder class variable + * A series of form variables of the format "Qty" with the ItemCode concatenated are created on the search for adding new items for each of these form variables need to parse out the items and look up the details to add them to the purchase order $_POST is of course the global array of all posted form variables */ + + foreach ($_POST as $FormVariableName => $Quantity) { + if (substr($FormVariableName, 0, 6)=='NewQty') { //if the form variable represents a Qty to add to the order + $ItemCode=substr($FormVariableName, 6, strlen($FormVariableName)-6); $AlreadyOnThisOrder =0; if ($_SESSION['PO_AllowSameItemMultipleTimes'] ==false){ @@ -770,7 +778,7 @@ purchdata.leadtime FROM stockcategory, chartmaster, - stockmaster LEFT JOIN purchdata + stockmaster INNER JOIN purchdata ON stockmaster.stockid = purchdata.stockid LEFT JOIN unitsofmeasure ON purchdata.suppliersuom=unitsofmeasure.unitid @@ -836,8 +844,7 @@ $myrow['kgs'], '', $Quantity, - $Quantity*$myrow['price'] - ); + $Quantity*$myrow['price'] ); } else { /*There was no supplier purchasing data for the item selected so enter a purchase order line with zero price */ @@ -893,8 +900,6 @@ echo "<form name=form1 action='" . $_SERVER['PHP_SELF'] . "?" . SID . "identifier=".$identifier. "' method=post>"; echo '<input type="hidden" name="FormID" value="' . $_SESSION['FormID'] . '" />'; -//echo _('Purchase Order') . ': <font color=BLUE size=4><b>' . $_SESSION['PO'.$identifier]->OrderNo . ' ' . $_SESSION['PO'.$identifier]->SupplierName . ' </b></font> - ' . _('All amounts stated in') . ' ' . $_SESSION['PO'.$identifier]->CurrCode . '<br>'; - /*need to set up entry for item description where not a stock item and GL Codes */ if (count($_SESSION['PO'.$identifier]->LineItems)>0 and !isset($_GET['Edit'])){ @@ -906,17 +911,20 @@ } echo '<br><b>'._(' Order Summary') . '</b>'; echo '<table cellpadding=2 colspan=7 class=selection>'; - echo "<tr> - <th>" . _('Item Code') . "</th> - <th>" . _('Description') . "</th> - <th>" . _('Quantity') . "</th> - <th>" . _('UOM') ."</th> - <th>" . _('Weight') . "</th> - <th>" . _('Price') .' ('.$_SESSION['PO'.$identifier]->CurrCode. ")</th> - <th>" . _('Subtotal') .' ('.$_SESSION['PO'.$identifier]->CurrCode. ")</th> - <th>" . _('Deliver By') ."</th> - </tr>"; - + echo '<tr> + <th>' . _('Item Code') . '</th> + <th>' . _('Description') . '</th> + <th>' . _('Quantity') . '</th> + <th>' . _('Our Unit') .'</th> + <th>' . _('Quantity') . '<th> + <th>' . _('Supp Unit') . '</th> + <th>' . _('Weight') . '</th> + <th>' . _('Price Our Units') .' ('.$_SESSION['PO'.$identifier]->CurrCode. ')</th> + <th>' . _('Price Supp Units') . ' ('.$_SESSION['PO'.$identifier]->CurrCode. ')</th> + <th>' . _('Subtotal') .' ('.$_SESSION['PO'.$identifier]->CurrCode. ')</th> + <th>' . _('Deliver By') .'</th> + </tr>'; + $_SESSION['PO'.$identifier]->Total = 0; $k = 0; //row colour counter @@ -924,9 +932,7 @@ if ($POLine->Deleted==False) { $LineTotal = $POLine->Quantity * $POLine->Price; - // Note decimal places should not fixed at 2, use POLine->DecimalPlaces instead - // $DisplayLineTotal = number_format($LineTotal,2); - $DisplayLineTotal = number_format($LineTotal,2); + $DisplayLineTotal = number_format($LineTotal,$POLine->DecimalPlaces); // 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) { @@ -934,7 +940,6 @@ } else { $DisplayPrice = number_format($POLine->Price,4,'.',''); } - $DisplayQuantity = number_format($POLine->Quantity,$POLine->DecimalPlaces,'.',''); if ($k==1){ echo '<tr class="EvenTableRows">'; @@ -943,35 +948,18 @@ echo '<tr class="OddTableRows">'; $k=1; } - $UomSQL="SELECT conversionfactor, - suppliersuom, - unitsofmeasure. - unitname - FROM purchdata - LEFT JOIN unitsofmeasure - ON purchdata.suppliersuom=unitsofmeasure.unitid - WHERE supplierno='".$_SESSION['PO'.$identifier]->SupplierID."' - AND stockid='".$POLine->StockID."'"; - $UomResult=DB_query($UomSQL, $db); - if (DB_num_rows($UomResult)>0) { - $UomRow=DB_fetch_array($UomResult); - if (strlen($UomRow['suppliersuom'])>0) { - $Uom=$UomRow['unitname']; - } else { - $Uom=$POLine->Units; - } - } else { - $Uom=$POLine->Units; - } - echo '<td>' . $POLine->StockID . '</td> <td>' . $POLine->ItemDescription . '</td> - <td><input type="text" class="number" name="Qty' . $POLine->LineNo .'" size="11" value="' . $DisplayQuantity . '"></td> - <td>' . $Uom . '</td> - <td><input type="text" class="number" name="nw' . $POLine->LineNo . '" size="11" value="' . $POLine->nw . '"></td> + <td><input type="text" class="number" name="Qty' . $POLine->LineNo .'" size="11" value="' . number_format($POLine->Quantity,$POLine->DecimalPlaces) . '"></td> + <td>' . $POLine->Units . '</td> + <td><input type="text" class="number" name="SuppQty' . $POLine->LineNo .'" size="11" value="' . number_format($POLine->Quantity/$POLine->ConversionFactor,$POLine->DecimalPlaces) . '"></td> + <td>' . $POLine->SuppUOM . '</td> + <td><input type="text" class="number" name="NetWeight' . $POLine->LineNo . '" size="11" value="' . $POLine->NetWeight . '"></td> <td><input type="text" class="number" name="Price' . $POLine->LineNo . '" size="11" value="' .$DisplayPrice.'"></td> <td class="number">' . $DisplayLineTotal . '</td> + <td><input type="text" class="number" name="SuppPrice' . $POLine->LineNo . '" size="11" value="' .number_format($POLine->Price/$POLine->ConversionFactor,2) .'"></td> + <td class="number">' . $DisplayLineTotal . '</td> <td><input type="text" class="date" alt="' .$_SESSION['DefaultDateFormat'].'" name="ReqDelDate' . $POLine->LineNo.'" size="11" value="' .$POLine->ReqDelDate .'"></td> <td><a href="' . $_SERVER['PHP_SELF'] . '?' . SID . 'identifier='.$identifier. '&Delete=' . $POLine->LineNo . '">' . _('Delete') . '</a></td></tr>'; $_SESSION['PO'.$identifier]->Total = $_SESSION['PO'.$identifier]->Total + $LineTotal; @@ -1082,13 +1070,12 @@ <input type=submit name='NonStockOrder' value='" . _('Order a non stock item') . "'> </div><br>"; - $PartsDisplayed =0; } if (isset($SearchResult)) { - echo "<table cellpadding=1 colspan=7 class=selection>"; + echo '<table cellpadding="1" colspan="7" class="selection">'; $TableHeader = '<tr> <th>' . _('Code') . '</th> @@ -1145,7 +1132,7 @@ <td>".$myrow['description']."</td> <td>".$Uom."</td> <td>".$ImageSource."</td> - <td><input class='number' type='text' size=6 value=0 name='qty".$myrow['stockid']."'></td> + <td><input class='number' type='text' size=6 value=0 name='NewQty".$myrow['stockid']."'></td> <input type='hidden' size=6 value=".$Uom." name=uom> </tr>"; Modified: trunk/includes/ConnectDB.inc =================================================================== --- trunk/includes/ConnectDB.inc 2011-01-08 08:45:36 UTC (rev 4462) +++ trunk/includes/ConnectDB.inc 2011-01-10 21:30:27 UTC (rev 4463) @@ -4,7 +4,7 @@ * this value is saved in the $_SESSION['Versionumber'] when includes/GetConfig.php is run * if VersionNumber is < $Version then the DB update script is run */ -$Version='3.12.2'; //must update manually every time there is a DB change +$Version='3.12.3'; //must update manually every time there is a DB change require_once ($PathPrefix .'includes/MiscFunctions.php'); @@ -14,8 +14,8 @@ $_SESSION['DatabaseName'] = $_POST['CompanyNameField']; include_once ($PathPrefix . 'includes/ConnectDB_' . $dbType . '.inc'); } else { - prnMsg(_('The company name entered' . ' (' . $_POST['CompanyNameField'] . ') ' . 'is not configured for use with this installation of webERP. Check that a directory named ' . $_POST['CompanyNameField'] . ' is set up under the companies sub-directory.'),'error'); - prnMsg(_('Check the company name entered' . ' (' . $_POST['CompanyNameField'] . ') ' . 'is the same as the database name.'),'error'); + prnMsg(_('The company name entered' . ' (' . $_POST['CompanyNameField'] . ') ' . 'is not configured for use with this installation of webERP. Check that a directory named ' . $_POST['CompanyNameField'] . ' is set up under the companies sub-directory.'),'error'); + prnMsg(_('Check the company name entered' . ' (' . $_POST['CompanyNameField'] . ') ' . 'is the same as the database name.'),'error'); prnMsg(_('The company name abbreviation entered at login must also have a company directory defined. See your system administrator'),'error'); } } elseif (isset($DatabaseName)) { /* Scripts that do not require a login must have the $DatabaseName variable set in hard code */ Modified: trunk/includes/DefinePOClass.php =================================================================== --- trunk/includes/DefinePOClass.php 2011-01-08 08:45:36 UTC (rev 4462) +++ trunk/includes/DefinePOClass.php 2011-01-10 21:30:27 UTC (rev 4463) @@ -81,8 +81,8 @@ $SubTotal_Amount=0, $Package=0, $PcUnit=0, - $nw=0, - $gw=0, + $NetWeight=0, + $KGs=0, $CuFt=0, $Total_Quantity=0, $Total_Amount=0, @@ -115,8 +115,8 @@ $SubTotal_Amount, $Package, $PcUnit, - $nw, - $gw, + $NetWeight, + $KGs, $CuFt, $Total_Quantity, $Total_Amount, @@ -143,11 +143,12 @@ $SubTotal_Amount, $Package, $PcUnit, - $nw, - $gw, + $NetWeight, + $KGs, $CuFt, $Total_Quantity, - $Total_Amount){ + $Total_Amount, + $SuppUOM){ $this->LineItems[$LineNo]->ItemDescription = $ItemDescription; $this->LineItems[$LineNo]->Quantity = $Qty; @@ -164,11 +165,12 @@ $this->LineItems[$LineNo]->Subtotal_Amount = $SubTotal_Amount; $this->LineItems[$LineNo]->Package = $Package; $this->LineItems[$LineNo]->PcUnit = $PcUnit; - $this->LineItems[$LineNo]->nw = $nw; - $this->LineItems[$LineNo]->gw = $gw; + $this->LineItems[$LineNo]->NetWeight = $NetWeight; + $this->LineItems[$LineNo]->KGs = $KGs; $this->LineItems[$LineNo]->CuFt = $CuFt; $this->LineItems[$LineNo]->Total_Quantity = $Total_Quantity; $this->LineItems[$LineNo]->Total_Amount = $Total_Amount; + $this->LineItems[$LineNo]->SuppUOM = $SuppUOM; } function remove_from_order(&$LineNo){ @@ -218,7 +220,7 @@ Var $GLActName; Var $Quantity; Var $Price; - Var $Units; //errrrr what is uom for then + Var $Units; Var $ReqDelDate; Var $QtyInv; Var $QtyReceived; @@ -227,15 +229,15 @@ var $Completed; Var $JobRef; Var $ItemNo; - Var $SuppUOM; var $ConversionFactor; + var $SuppUOM; Var $Suppliers_PartNo; Var $SubTotal_Amount; Var $LeadTime; Var $Package; Var $PcUnit; - Var $nw; - Var $gw; + Var $NetWeight; + Var $KGs; Var $CuFt; Var $Total_Quantity; Var $Total_Amount; @@ -271,8 +273,8 @@ $LeadTime, $Package, $PcUnit, - $nw, - $gw, + $NetWeight, + $KGs, $CuFt, $Total_Quantity, $Total_Amount, @@ -300,8 +302,8 @@ $this->Subtotal_Amount = $SubTotal_Amount; $this->LeadTime = $LeadTime; $this->PcUnit = $PcUnit; - $this->nw = $nw; - $this->gw = $gw; + $this->NetWeight = $NetWeight; + $this->KGs = $KGs; $this->CuFt = $CuFt; $this->Total_Quantity = $Total_Quantity; $this->Total_Amount = $Total_Amount; Modified: trunk/includes/PO_ReadInOrder.inc =================================================================== --- trunk/includes/PO_ReadInOrder.inc 2011-01-08 08:45:36 UTC (rev 4462) +++ trunk/includes/PO_ReadInOrder.inc 2011-01-10 21:30:27 UTC (rev 4463) @@ -50,7 +50,7 @@ locations.managed , purchorders.paymentterms FROM purchorders - LEFT JOIN locations ON purchorders.intostocklocation=locations.loccode, + INNER JOIN locations ON purchorders.intostocklocation=locations.loccode, suppliers WHERE purchorders.supplierno = suppliers.supplierid AND purchorders.orderno = ' . $_GET['ModifyOrderNumber']; Modified: trunk/sql/mysql/upgrade3.11.1-4.00.sql =================================================================== --- trunk/sql/mysql/upgrade3.11.1-4.00.sql 2011-01-08 08:45:36 UTC (rev 4462) +++ trunk/sql/mysql/upgrade3.11.1-4.00.sql 2011-01-10 21:30:27 UTC (rev 4463) @@ -811,3 +811,7 @@ ('ReportMaker.php', 1, 'Produces reports from the report writer templates created'), ('ReportCreator.php', 13, 'Report Writer and Form Creator script that creates templates for user defined reports and forms'); UPDATE config SET confvalue='3.12.2' WHERE confname='VersionNumber'; +ALTER TABLE `purchorderdetails` CHANGE `nw` `netweight` VARCHAR( 50 ) DEFAULT ''; +ALTER TABLE `purchorderdetails` CHANGE `gw` `kgs` VARCHAR( 50 ) DEFAULT ''; +ALTER TABLE `purchorderdetails` ADD `suppconversionfactor` DOUBLE NOT NULL DEFAULT '1'; +UPDATE config SET confvalue='3.12.3' WHERE confname='VersionNumber'; \ 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-01-11 08:58:16
|
Revision: 4464 http://web-erp.svn.sourceforge.net/web-erp/?rev=4464&view=rev Author: daintree Date: 2011-01-11 08:58:07 +0000 (Tue, 11 Jan 2011) Log Message: ----------- fix up of purch orders/reciving etc Modified Paths: -------------- trunk/CustomerInquiry.php trunk/GoodsReceived.php trunk/PO_Items.php trunk/PO_PDFPurchOrder.php trunk/PO_SelectOSPurchOrder.php trunk/PrintCustTrans.php trunk/PrintCustTransPortrait.php trunk/SupplierCredit.php trunk/SupplierInvoice.php trunk/companies/weberpdemo/FormDesigns/SalesInvoice.xml trunk/doc/Change.log.html trunk/includes/DefinePOClass.php trunk/includes/PDFTransPageHeader.inc trunk/includes/PDFTransPageHeaderPortrait.inc trunk/includes/PO_ReadInOrder.inc Modified: trunk/CustomerInquiry.php =================================================================== --- trunk/CustomerInquiry.php 2011-01-10 21:30:27 UTC (rev 4463) +++ trunk/CustomerInquiry.php 2011-01-11 08:58:07 UTC (rev 4464) @@ -15,7 +15,7 @@ if(!isset($_GET['CustomerID']) AND !isset($_SESSION['CustomerID'])){ prnMsg(_('To display the enquiry a customer must first be selected from the customer selection screen'),'info'); - echo "<br><div class='centre'><a href='". $rootpath . "/SelectCustomer.php?" . SID . "'>" . _('Select a Customer to Inquire On') . '</a><br></div>'; + echo '<br><div class="centre"><a href="'. $rootpath . '/SelectCustomer.php?' . SID . '">' . _('Select a Customer to Inquire On') . '</a><br></div>'; include('includes/footer.inc'); exit; } else { @@ -185,26 +185,25 @@ echo '<table class="selection" cellpadding="2" colspan="7">'; -$tableheader = "<tr bgcolor =#800000> - <th>" . _('Type') . "</th> - <th>" . _('Number') . "</th> - <th>" . _('Date') . "</th> - <th>" . _('Branch') . "</th> - <th>" . _('Reference') . "</th> - <th>" . _('Comments') . "</th> - <th>" . _('Order') . "</th> - <th>" . _('Total') . "</th> - <th>" . _('Allocated') . "</th> - <th>" . _('Balance') . "</th> - <th>" . _('More Info') . "</th> - <th>" . _('More Info') . "</th> - <th>" . _('More Info') . "</th> - <th>" . _('More Info') . "</th> - <th>" . _('More Info') . "</th></tr>"; +$tableheader = '<tr> + <th>' . _('Type') . '</th> + <th>' . _('Number') . '</th> + <th>' . _('Date') . '</th> + <th>' . _('Branch') . '</th> + <th>' . _('Reference') . '</th> + <th>' . _('Comments') . '</th> + <th>' . _('Order') . '</th> + <th>' . _('Total') . '</th> + <th>' . _('Allocated') . '</th> + <th>' . _('Balance') . '</th> + <th>' . _('More Info') . '</th> + <th>' . _('More Info') . '</th> + <th>' . _('More Info') . '</th> + <th>' . _('More Info') . '</th> + <th>' . _('More Info') . '</th></tr>'; echo $tableheader; - $j = 1; $k=0; //row colour counter while ($myrow=DB_fetch_array($TransResult)) { @@ -218,33 +217,47 @@ } $FormatedTranDate = ConvertSQLDate($myrow['trandate']); + + if ($_SESSION['InvoicePortraitFormat']==1){ //Invoice/credits in portrait + $PrintCustomerTransactionScript = 'PrintCustTransPortrait.php'; + } else { //produce pdfs in landscape + $PrintCustomerTransactionScript = 'PrintCustTrans.php'; + } + + $BaseFormatString = '<td>%s</td> + <td>%s</td> + <td>%s</td> + <td>%s</td> + <td>%s</td> + <td width="200">%s</td> + <td>%s</td> + <td class=number>%s</td> + <td class=number>%s</td> + <td class=number>%s</td>'; - $base_formatstr = "<td>%s</td> - <td>%s</td> - <td>%s</td> - <td>%s</td> - <td>%s</td> - <td width='200'>%s</td> - <td>%s</td> - <td class=number>%s</td> - <td class=number>%s</td> - <td class=number>%s</td>"; - $credit_invoice_str = "<td><a href='%s/Credit_Invoice.php?InvoiceNumber=%s'>" . _('Credit ') ."<IMG SRC='%s/credit.gif' title='" . _('Click to credit the invoice') . "'></a></td>"; -$preview_invoice_str = "<td><a href='%s/PrintCustTrans.php?FromTransNo=%s&InvOrCredit=Invoice'>" . _('HTML ') . "<IMG SRC='%s/preview.gif' title='" . _('Click to preview the invoice') . "'></a></td> -<td><a href='%s/PrintCustTransPortrait.php?FromTransNo=%s&InvOrCredit=Invoice&PrintPDF=True'>" . _('PDF ') . "<IMG SRC='%s/pdf.png' title='" . _('Click for PDF') . "'></a></td> - <td><a href='%s/EmailCustTrans.php?FromTransNo=%s&InvOrCredit=Invoice'>" . _('Email ') . "<IMG SRC='%s/email.gif' title='" . _('Click to email the invoice') . "'></a></td>"; - $preview_credit_str = "<td><a href='%s/PrintCustTrans.php?FromTransNo=%s&InvOrCredit=Credit'>" . _('HTML ') . " <IMG SRC='%s/preview.gif' title='" . _('Click to preview the credit note') . "'></a></td> -<td><a href='" .$rootpath."/PrintCustTransPortrait.php?FromTransNo=%s&InvOrCredit=Credit&PrintPDF=True'>" . _('PDF ') . "<IMG SRC='" .$rootpath."/css/".$theme."/images/pdf.png' title='" . _('Click for PDF') . "'></a></td> - <td><a href='%s/EmailCustTrans.php?FromTransNo=%s&InvOrCredit=Credit'>" . _('Email') . " <IMG SRC='%s/email.gif' title='" . _('Click to email the credit note') . "'></a></td>"; + $CreditInvoiceFormatString = '<td><a href="%s/Credit_Invoice.php?InvoiceNumber=%s">' . _('Credit ') .'<IMG SRC="%s/credit.gif" title="' . _('Click to credit the invoice') . '"></a></td>'; + + $PreviewInvoiceFormatString = '<td><a href="%s/PrintCustTrans.php?FromTransNo=%s&InvOrCredit=Invoice">' . _('HTML ') . '<IMG SRC="%s/preview.gif" title="' . _('Click to preview the invoice') . '"></a></td> + <td><a href="%s/%s?FromTransNo=%s&InvOrCredit=Invoice&PrintPDF=True">' . _('PDF ') . '<IMG SRC="%s/css/' . $theme . '/images/pdf.png" title="' . _('Click for PDF') . '"></a></td> + <td><a href="%s/EmailCustTrans.php?FromTransNo=%s&InvOrCredit=Invoice">' . _('Email ') . '<IMG SRC="%s/email.gif" title="' . _('Click to email the invoice') . '"></a></td>'; + + $PreviewCreditFormatString = '<td><a href="%s/PrintCustTrans.php?FromTransNo=%s&InvOrCredit=Credit">' . _('HTML ') . ' <IMG SRC="%s/preview.gif" title="' . _('Click to preview the credit note') . '"></a></td> + <td><a href="%s/%s?FromTransNo=%s&InvOrCredit=Credit&PrintPDF=True">' . _('PDF ') . '<IMG SRC="%s/css/' . $theme . '/images/pdf.png" title="' . _('Click for PDF') . '"></a></td> + <td><a href="%s/EmailCustTrans.php?FromTransNo=%s&InvOrCredit=Credit">' . _('Email') . ' <IMG SRC="%s/email.gif" title="' . _('Click to email the credit note') . '"></a></td>'; - if (in_array(3,$_SESSION['AllowedPageSecurityTokens']) && $myrow['type']==10){ /*Show a link to allow an invoice to be credited */ + /* assumed allowed page security token 3 allows the user to create credits for invoices */ + if (in_array(3,$_SESSION['AllowedPageSecurityTokens']) && $myrow['type']==10){ + /*Show a link to allow an invoice to be credited */ + /* assumed allowed page security token 8 allows the user to see GL transaction information */ if ($_SESSION['CompanyRecord']['gllink_debtors']== 1 AND in_array(8,$_SESSION['AllowedPageSecurityTokens'])){ - printf($base_formatstr . - $credit_invoice_str . - $preview_invoice_str . - "<td><a href='%s/GLTransInquiry.php?%s&TypeID=%s&TransNo=%s'>" . _('View GL Entries') . " <IMG SRC='" .$rootpath."/css/".$theme."/images/gl.png' title='" . _('View the GL Entries') . "'></a></td> - </tr>", + + /* format string with GL inquiry options and for invoice to be credited */ + + printf($BaseFormatString . $CreditInvoiceFormatString . $PreviewInvoiceFormatString . + '<td><a href="%s/GLTransInquiry.php?%s&TypeID=%s&TransNo=%s">' . _('View GL Entries') . ' <IMG SRC="' .$rootpath. '/css/'.$theme.'/images/gl.png" title="' . _('View the GL Entries') . '"></a></td> + </tr>', + //$BaseFormatString parameters $myrow['typename'], $myrow['transno'], ConvertSQLDate($myrow['trandate']), @@ -255,27 +268,30 @@ number_format($myrow['totalamount'],2), number_format($myrow['allocated'],2), number_format($myrow['totalamount']-$myrow['allocated'],2), + //$CreditInvoiceFormatString parameters $rootpath, $myrow['transno'], $rootpath.'/css/'.$theme.'/images', + //$PreviewInvoiceFormatString parameters $rootpath, - $myrow['transno'], - $rootpath.'/css/'.$theme.'/images', + $myrow['transno'], + $rootpath.'/css/'.$theme.'/images', $rootpath, + $PrintCustomerTransactionScript, $myrow['transno'], $rootpath.'/css/'.$theme.'/images', $rootpath, $myrow['transno'], $rootpath.'/css/'.$theme.'/images', + //Parameter for string for GL Trans Inquiries $rootpath, SID, $myrow['type'], $myrow['transno']); - } else { - printf($base_formatstr . - $credit_invoice_str . - $preview_invoice_str . - '</tr>', + } else { //user does not have privileges to see GL inquiry stuff + + printf($BaseFormatString . $CreditInvoiceFormatString . $PreviewInvoiceFormatString . '</tr>', + //BaseFormatString parameters $myrow['typename'], $myrow['transno'], ConvertSQLDate($myrow['trandate']), @@ -286,10 +302,17 @@ number_format($myrow['totalamount'],2), number_format($myrow['allocated'],2), number_format($myrow['totalamount']-$myrow['allocated'],2), + //CreditInvoiceFormatString parameters $rootpath, $myrow['transno'], $rootpath.'/css/'.$theme.'/images', - $rootpath, $myrow['transno'], + //$PreviewInvoiceFormatString parameters + $rootpath, + $myrow['transno'], + $rootpath.'/css/'.$theme.'/images', + $rootpath, + $PrintCustomerTransactionScript, + $myrow['transno'], $rootpath.'/css/'.$theme.'/images', $rootpath, $myrow['transno'], @@ -298,35 +321,39 @@ } elseif($myrow['type']==10) { /*its an invoice but not high enough priveliges to credit it */ - printf($base_formatstr . - $preview_invoice_str . + printf($BaseFormatString . + $PreviewInvoiceFormatString . '</tr>', + //$BaseFormatString parameters $myrow['typename'], - $myrow['transno'], - ConvertSQLDate($myrow['trandate']), - $myrow['branchcode'], - $myrow['reference'], - $myrow['invtext'], - $myrow['order_'], - number_format($myrow['totalamount'],2), - number_format($myrow['allocated'],2), - number_format($myrow['totalamount']-$myrow['allocated'],2), - $rootpath, - $myrow['transno'], - $rootpath.'/css/'.$theme.'/images', - $rootpath, - $myrow['transno'], - $rootpath.'/css/'.$theme.'/images', - $rootpath, - $myrow['transno'], - $rootpath.'/css/'.$theme.'/images'); + $myrow['transno'], + ConvertSQLDate($myrow['trandate']), + $myrow['branchcode'], + $myrow['reference'], + $myrow['invtext'], + $myrow['order_'], + number_format($myrow['totalamount'],2), + number_format($myrow['allocated'],2), + number_format($myrow['totalamount']-$myrow['allocated'],2), + //$PreviewInvoiceFormatString parameters + $rootpath, + $myrow['transno'], + $rootpath.'/css/'.$theme.'/images', + $rootpath, + $PrintCustomerTransactionScript, + $myrow['transno'], + $rootpath.'/css/'.$theme.'/images', + $rootpath, + $myrow['transno'], + $rootpath.'/css/'.$theme.'/images'); } elseif ($myrow['type']==11) { /*its a credit note */ if ($_SESSION['CompanyRecord']['gllink_debtors']== 1 AND in_array(8,$_SESSION['AllowedPageSecurityTokens'])){ - printf($base_formatstr . - $preview_credit_str . + printf($BaseFormatString . + $PreviewCreditFormatString . "<td><a href='%s/CustomerAllocations.php?AllocTrans=%s'>" . _('Allocation') . "<IMG SRC='" .$rootpath."/css/".$theme."/images/allocation.png' title='" . _('Click to allocate funds') . "'></a></td> <td><a href='%s/GLTransInquiry.php?%sTypeID=%s&TransNo=%s'>" . _('View GL Entries') . ' <a><IMG SRC="' .$rootpath.'/css/'.$theme.'/images/gl.png" title="' . _('View the GL Entries') . '"></a></td></tr>', + //$BaseFormatString parameters $myrow['typename'], $myrow['transno'], ConvertSQLDate($myrow['trandate']), @@ -337,13 +364,18 @@ number_format($myrow['totalamount'],2), number_format($myrow['allocated'],2), number_format($myrow['totalamount']-$myrow['allocated'],2), + //$PreviewCreditFormatString parameters $rootpath, $myrow['transno'], $rootpath.'/css/'.$theme.'/images', + $rootpath, + $PrintCustomerTransactionScript, $myrow['transno'], + $rootpath.'/css/'.$theme.'/images', $rootpath, $myrow['transno'], $rootpath.'/css/'.$theme.'/images', + // hand coded format string for Allocations and GLTrans Inquiry parameters $rootpath, $myrow['id'], $rootpath, @@ -351,8 +383,8 @@ $myrow['type'], $myrow['transno']); } else { - printf($base_formatstr . - $preview_credit_str . + printf($BaseFormatString . + $PreviewCreditFormatString . "<td><a href='%s/CustomerAllocations.php?AllocTrans=%s'>" . _('Allocation') . "<IMG SRC='%s/allocation.png' title='" . _('Click to allocate funds') . "'></a></td> </tr>", $myrow['typename'], @@ -365,22 +397,27 @@ number_format($myrow['totalamount'],2), number_format($myrow['allocated'],2), number_format($myrow['totalamount']-$myrow['allocated'],2), + //$PreviewCreditFormatString parameters $rootpath, $myrow['transno'], $rootpath.'/css/'.$theme.'/images', $rootpath, - $myrow['transno'], - $rootpath.'/css/'.$theme.'/images', + $PrintCustomerTransactionScript, + $myrow['transno'], + $rootpath.'/css/'.$theme.'/images', $rootpath, $myrow['transno'], $rootpath.'/css/'.$theme.'/images', + //Parameters for hand coded string to show allocations $rootpath, $myrow['id'], $rootpath.'/css/'.$theme.'/images'); } } elseif ($myrow['type']==12 AND $myrow['totalamount']<0) { /*its a receipt which could have an allocation*/ + + //If security token 8 in the allowed page security tokens then assumed ok for GL trans inquiries if ($_SESSION['CompanyRecord']['gllink_debtors']== 1 AND in_array(8,$_SESSION['AllowedPageSecurityTokens'])){ - printf($base_formatstr . + printf($BaseFormatString . "<td><a href='%s/CustomerAllocations.php?AllocTrans=%s'>" . _('Allocation') . "<IMG SRC='" .$rootpath."/css/".$theme."/images/allocation.png' title='" . _('Click to allocate funds') . "'></a></td> <td><a href='%s/GLTransInquiry.php?%s&TypeID=%s&TransNo=%s'>" . _('View GL Entries') . " <IMG SRC='" .$rootpath."/css/".$theme."/images/gl.png' title='" . _('View the GL Entries') . "'></a></td> </tr>", @@ -400,8 +437,8 @@ SID, $myrow['type'], $myrow['transno']); - } else { - printf($base_formatstr . + } else { //no permission for GLTrans Inquiries + printf($BaseFormatString . "<td><a href='%s/CustomerAllocations.php?AllocTrans=%s'>" . _('Allocation') . "<IMG SRC='" .$rootpath."/css/".$theme."/images/allocation.png' title='" . _('Click to allocate funds') . "'></a></td> </tr>", $myrow['typename'], @@ -418,9 +455,11 @@ $myrow['id']); } } elseif ($myrow['type']==12 AND $myrow['totalamount']>0) { /*its a negative receipt */ + + //If security token 8 in the allowed page security tokens then assumed ok for GL trans inquiries if ($_SESSION['CompanyRecord']['gllink_debtors']== 1 AND in_array(8,$_SESSION['AllowedPageSecurityTokens'])){ - printf($base_formatstr . - "<td><a href='%s/GLTransInquiry.php?%s&TypeID=%s&TransNo=%s'>" . _('View GL Entries') . ' <a></td></tr>', + printf($BaseFormatString . + '<td><a href="%s/GLTransInquiry.php?%s&TypeID=%s&TransNo=%s">' . _('View GL Entries') . ' <a></td></tr>', $myrow['typename'], $myrow['transno'], ConvertSQLDate($myrow['trandate']), @@ -435,8 +474,8 @@ SID, $myrow['type'], $myrow['transno']); - } else { - printf($base_formatstr . '<td></tr>', + } else { //no permission for GLTrans Inquiries + printf($BaseFormatString . '<td></tr>', $myrow['typename'], $myrow['transno'], ConvertSQLDate($myrow['trandate']), @@ -449,9 +488,10 @@ number_format($myrow['totalamount']-$myrow['allocated'],2)); } } else { + //If security token 8 in the allowed page security tokens then assumed ok for GL trans inquiries if ($_SESSION['CompanyRecord']['gllink_debtors']== 1 AND in_array(8,$_SESSION['AllowedPageSecurityTokens'])){ - printf($base_formatstr . - "<td><a href='%s/GLTransInquiry.php?%s&TypeID=%s&TransNo=%s'>" . _('View GL Entries') . ' <a></td></tr>', + printf($BaseFormatString . + '<td><a href="%s/GLTransInquiry.php?%s&TypeID=%s&TransNo=%s">' . _('View GL Entries') . ' <a></td></tr>', $myrow['typename'], $myrow['transno'], ConvertSQLDate($myrow['trandate']), @@ -467,7 +507,7 @@ $myrow['type'], $myrow['transno']); } else { - printf($base_formatstr . '</tr>', + printf($BaseFormatString . '</tr>', $myrow['typename'], $myrow['transno'], ConvertSQLDate($myrow['trandate']), Modified: trunk/GoodsReceived.php =================================================================== --- trunk/GoodsReceived.php 2011-01-10 21:30:27 UTC (rev 4463) +++ trunk/GoodsReceived.php 2011-01-11 08:58:07 UTC (rev 4464) @@ -4,22 +4,31 @@ /* $Revision: 1.44 $ */ -//$PageSecurity = 11; +//$PageSecurity = 11; now stored in the database /* Session started in header.inc for password checking and authorisation level check */ include('includes/DefinePOClass.php'); include('includes/DefineSerialItems.php'); include('includes/session.inc'); include('includes/SQL_CommonFunctions.inc'); -if (empty($identifier)) { - $identifier=''; + +/*The identifier makes this goods received session unique so cannot get confused + * with other sessions of goods received on the same machine/browser + * The identifier only needs to be unique for this php session, so a + * unix timestamp will be sufficient. + */ + +if (empty($_GET['identifier'])) { + $identifier=date('U'); +} else { + $identifier=$_GET['identifier']; } $title = _('Receive Purchase Orders'); include('includes/header.inc'); echo '<a href="'. $rootpath . '/PO_SelectOSPurchOrder.php?' . SID . '">' . _('Back to Purchase Orders'). '</a><br>'; -if (isset($_GET['PONumber']) and $_GET['PONumber']<=0 and !isset($_SESSION['PO'])) { +if (isset($_GET['PONumber']) and $_GET['PONumber']<=0 and !isset($_SESSION['PO'.$identifier])) { /* This page can only be called with a purchase order number for invoicing*/ echo '<div class="centre"><a href= "' . $rootpath . '/PO_SelectOSPurchOrder.php?' . SID . '">'. _('Select a purchase order to receive').'</a></div>'; @@ -34,37 +43,31 @@ } elseif (isset($_POST['Update']) OR isset($_POST['ProcessGoodsReceived'])) { /* if update quantities button is hit page has been called and ${$Line->LineNo} would have be - set from the post to the quantity to be received in this receival*/ + set from the post to the quantity to be received */ - foreach ($_SESSION['PO']->LineItems as $Line) { + foreach ($_SESSION['PO'.$identifier]->LineItems as $Line) { $RecvQty = $_POST['RecvQty_' . $Line->LineNo]; if (!is_numeric($RecvQty)){ $RecvQty = 0; } - $_SESSION['PO']->LineItems[$Line->LineNo]->ReceiveQty = $RecvQty; + $_SESSION['PO'.$identifier]->LineItems[$Line->LineNo]->ReceiveQty = $RecvQty; } } -$StatusSQL="SELECT status FROM purchorders WHERE orderno='".$_SESSION['PO']->OrderNo . "'"; -$StatusResult=DB_query($StatusSQL, $db); -$StatusRow=DB_fetch_array($StatusResult); -$Status=$StatusRow['status']; - -if ($Status != PurchOrder::STATUS_PRINTED) { +if ($_SESSION['PO'.$identifier]->Status != 'Printed') { prnMsg( _('Purchase orders must have a status of Printed before they can be received').'.<br>'. - _('Order number') . ' ' . $_GET['PONumber'] . ' ' . _('has a status of') . ' ' . _($Status), 'warn'); + _('Order number') . ' ' . $_GET['PONumber'] . ' ' . _('has a status of') . ' ' . _($_SESSION['PO'.$identifier]->Status), 'warn'); include('includes/footer.inc'); exit; } /* Always display quantities received and recalc balance for all items on the order */ - echo '<p class="page_title_text"><img src="'.$rootpath.'/css/'.$theme.'/images/supplier.png" title="' . _('Receive') . '" alt="" />' . ' ' . _('Receive Purchase Order') . ''; -echo ' : '. $_SESSION['PO']->OrderNo .' '. _('from'). ' ' . $_SESSION['PO']->SupplierName . '</p>'; -echo '<form action="' . $_SERVER['PHP_SELF'] . '?' . SID . '" method=post>'; +echo ' : '. $_SESSION['PO'.$identifier]->OrderNo .' '. _('from'). ' ' . $_SESSION['PO'.$identifier]->SupplierName . '</p>'; +echo '<form action="' . $_SERVER['PHP_SELF'] . '?' . SID . 'identifier=' . $identifier . '" method=post>'; echo '<input type="hidden" name="FormID" value="' . $_SESSION['FormID'] . '" />'; if (!isset($_POST['ProcessGoodsReceived'])) { @@ -93,13 +96,14 @@ </tr>'; /*show the line items on the order with the quantity being received for modification */ - $_SESSION['PO']->Total = 0; + $_SESSION['PO'.$identifier]->Total = 0; } $k=0; //row colour counter -if (count($_SESSION['PO']->LineItems)>0 and !isset($_POST['ProcessGoodsReceived'])){ - foreach ($_SESSION['PO']->LineItems as $LnItm) { +if (count($_SESSION['PO'.$identifier]->LineItems)>0 and !isset($_POST['ProcessGoodsReceived'])){ + + foreach ($_SESSION['PO'.$identifier]->LineItems as $LnItm) { if ($k==1){ echo '<tr class="EvenTableRows">'; @@ -120,7 +124,7 @@ //Setup & Format values for LineItem display $LineTotal = ($LnItm->ReceiveQty * $LnItm->Price ); - $_SESSION['PO']->Total = $_SESSION['PO']->Total + $LineTotal; + $_SESSION['PO'.$identifier]->Total = $_SESSION['PO'.$identifier]->Total + $LineTotal; $DisplayQtyOrd = number_format($LnItm->Quantity,$LnItm->DecimalPlaces); $DisplayQtyRec = number_format($LnItm->QtyReceived,$LnItm->DecimalPlaces); $DisplayLineTotal = number_format($LineTotal,2); @@ -133,7 +137,7 @@ FROM purchdata LEFT JOIN unitsofmeasure ON purchdata.suppliersuom=unitsofmeasure.unitid - WHERE supplierno='".$_SESSION['PO']->SupplierID."' + WHERE supplierno='".$_SESSION['PO'.$identifier]->SupplierID."' AND stockid='".$LnItm->StockID."' GROUP BY unitsofmeasure.unitname"; @@ -185,7 +189,7 @@ echo '</tr>'; }//foreach(LineItem) echo "<script>defaultControl(document.forms[0].RecvQty_$LnItm->LineNo);</script>"; -$DisplayTotal = number_format($_SESSION['PO']->Total,2); +$DisplayTotal = number_format($_SESSION['PO'.$identifier]->Total,2); if ($_SESSION['ShowValueOnGRN']==1) { echo '<tr><td colspan=7 class=number><b>' . _('Total value of goods received'). '</b></td> <td class=number><b>'. $DisplayTotal. '</b></td> @@ -195,14 +199,6 @@ } }//If count(LineItems) > 0 -$SomethingReceived = 0; -if (count($_SESSION['PO']->LineItems)>0){ - foreach ($_SESSION['PO']->LineItems as $OrderLine) { - if ($OrderLine->ReceiveQty>0){ - $SomethingReceived =1; - } - } -} /************************* LINE ITEM VALIDATION ************************/ @@ -213,9 +209,9 @@ $NegativesFound = false; $InputError = false; -if (count($_SESSION['PO']->LineItems)>0){ +if (count($_SESSION['PO'.$identifier]->LineItems)>0){ - foreach ($_SESSION['PO']->LineItems as $OrderLine) { + foreach ($_SESSION['PO'.$identifier]->LineItems as $OrderLine) { if ($OrderLine->ReceiveQty+$OrderLine->QtyReceived > $OrderLine->Quantity * (1+ ($_SESSION['OverReceiveProportion'] / 100))){ $DeliveryQuantityTooLarge =1; @@ -225,7 +221,7 @@ $SQL = "SELECT locstock.quantity FROM locstock WHERE locstock.stockid='" . $OrderLine->StockID . "' - AND loccode= '" . $_SESSION['PO']->Location . "'"; + AND loccode= '" . $_SESSION['PO'.$identifier]->Location . "'"; $CheckNegResult = DB_query($SQL,$db); $CheckNegRow = DB_fetch_row($CheckNegResult); if ($CheckNegRow[0]+$OrderLine->ReceiveQty<0){ @@ -236,7 +232,7 @@ } /* end loop around the items received */ } /* end if there are lines received */ -if ($SomethingReceived==0 AND isset($_POST['ProcessGoodsReceived'])){ /*Then dont bother proceeding cos nothing to do ! */ +if ($_SESSION['PO'.$identifier]->SomethingReceived()==0 AND isset($_POST['ProcessGoodsReceived'])){ /*Then dont bother proceeding cos nothing to do ! */ prnMsg(_('There is nothing to process') . '. ' . _('Please enter valid quantities greater than zero'),'warn'); echo '<div class="centre"><input type=submit name=Update Value=' . _('Update') . '></div>'; @@ -254,7 +250,7 @@ prnMsg(_('Modify the ordered items on the purchase invoice if you wish to increase the quantities'),'info'); echo '<div class="centre"><input type=submit name=Update Value=' . _('Update') . '>'; -} elseif (isset($_POST['ProcessGoodsReceived']) AND $SomethingReceived==1 AND $InputError == false){ +} elseif (isset($_POST['ProcessGoodsReceived']) AND $_SESSION['PO'.$identifier]->SomethingReceived()==1 AND $InputError == false){ /* SQL to process the postings for goods received... */ /* Company record set at login for information on GL Links and debtors GL account*/ @@ -277,7 +273,7 @@ shiptref, jobref FROM purchorderdetails - WHERE orderno='" . (int) $_SESSION['PO']->OrderNo . "' + WHERE orderno='" . (int) $_SESSION['PO'.$identifier]->OrderNo . "' AND completed=0 ORDER BY podetailitem"; @@ -290,13 +286,13 @@ while ($myrow = DB_fetch_array($Result)) { - if ($_SESSION['PO']->LineItems[$LineNo]->GLCode != $myrow['glcode'] OR - $_SESSION['PO']->LineItems[$LineNo]->ShiptRef != $myrow['shiptref'] OR - $_SESSION['PO']->LineItems[$LineNo]->JobRef != $myrow['jobref'] OR - $_SESSION['PO']->LineItems[$LineNo]->QtyInv != $myrow['qtyinvoiced'] OR - $_SESSION['PO']->LineItems[$LineNo]->StockID != $myrow['itemcode'] OR - $_SESSION['PO']->LineItems[$LineNo]->Quantity != $myrow['quantityord'] OR - $_SESSION['PO']->LineItems[$LineNo]->QtyReceived != $myrow['quantityrecd']) { + if ($_SESSION['PO'.$identifier]->LineItems[$LineNo]->GLCode != $myrow['glcode'] OR + $_SESSION['PO'.$identifier]->LineItems[$LineNo]->ShiptRef != $myrow['shiptref'] OR + $_SESSION['PO'.$identifier]->LineItems[$LineNo]->JobRef != $myrow['jobref'] OR + $_SESSION['PO'.$identifier]->LineItems[$LineNo]->QtyInv != $myrow['qtyinvoiced'] OR + $_SESSION['PO'.$identifier]->LineItems[$LineNo]->StockID != $myrow['itemcode'] OR + $_SESSION['PO'.$identifier]->LineItems[$LineNo]->Quantity != $myrow['quantityord'] OR + $_SESSION['PO'.$identifier]->LineItems[$LineNo]->QtyReceived != $myrow['quantityrecd']) { prnMsg(_('This order has been changed or invoiced since this delivery was started to be actioned') . '. ' . _('Processing halted') . '. ' . _('To enter a delivery against this purchase order') . ', ' . _('it must be re-selected and re-read again to update the changes made by the other user'),'warn'); @@ -304,35 +300,35 @@ if ($debug==1){ echo '<table border=1>'; echo '<tr><td>' . _('GL Code of the Line Item') . ':</td> - <td>' . $_SESSION['PO']->LineItems[$LineNo]->GLCode . '</td> + <td>' . $_SESSION['PO'.$identifier]->LineItems[$LineNo]->GLCode . '</td> <td>' . $myrow['glcode'] . '</td></tr>'; echo '<tr><td>' . _('ShiptRef of the Line Item') . ':</td> - <td>' . $_SESSION['PO']->LineItems[$LineNo]->ShiptRef . '</td> + <td>' . $_SESSION['PO'.$identifier]->LineItems[$LineNo]->ShiptRef . '</td> <td>' . $myrow['shiptref'] . '</td></tr>'; echo '<tr><td>' . _('Contract Reference of the Line Item') . ':</td> - <td>' . $_SESSION['PO']->LineItems[$LineNo]->JobRef . '</td> + <td>' . $_SESSION['PO'.$identifier]->LineItems[$LineNo]->JobRef . '</td> <td>' . $myrow['jobref'] . '</td> </tr>'; echo '<tr><td>' . _('Quantity Invoiced of the Line Item') . ':</td> - <td>' . $_SESSION['PO']->LineItems[$LineNo]->QtyInv . '</td> + <td>' . $_SESSION['PO'.$identifier]->LineItems[$LineNo]->QtyInv . '</td> <td>' . $myrow['qtyinvoiced'] . '</td></tr>'; echo '<tr><td>' . _('Stock Code of the Line Item') . ':</td> - <td>'. $_SESSION['PO']->LineItems[$LineNo]->StockID . '</td> + <td>'. $_SESSION['PO'.$identifier]->LineItems[$LineNo]->StockID . '</td> <td>' . $myrow['itemcode'] . '</td></tr>'; echo '<tr><td>' . _('Order Quantity of the Line Item') . ':</td> - <td>' . $_SESSION['PO']->LineItems[$LineNo]->Quantity . '</td> + <td>' . $_SESSION['PO'.$identifier]->LineItems[$LineNo]->Quantity . '</td> <td>' . $myrow['quantityord'] . '</td></tr>'; echo '<tr><td>' . _('Quantity of the Line Item Already Received') . ':</td> - <td>' . $_SESSION['PO']->LineItems[$LineNo]->QtyReceived . '</td> + <td>' . $_SESSION['PO'.$identifier]->LineItems[$LineNo]->QtyReceived . '</td> <td>' . $myrow['quantityrecd'] . '</td></tr>'; echo '</table>'; } echo "<div class='centre'><a href='$rootpath/PO_SelectOSPurchOrder.php?" . SID . "'>". _('Select a different purchase order for receiving goods against').'</a></div>'; echo "<div class='centre'><a href='$rootpath/GoodsReceived.php?" . SID . '&PONumber=' . - $_SESSION['PO']->OrderNumber . '">'. _('Re-read the updated purchase order for receiving goods against'). '</a></div>'; - unset($_SESSION['PO']->LineItems); - unset($_SESSION['PO']); + $_SESSION['PO'.$identifier]->OrderNumber . '">'. _('Re-read the updated purchase order for receiving goods against'). '</a></div>'; + unset($_SESSION['PO'.$identifier]->LineItems); + unset($_SESSION['PO'.$identifier]); unset($_POST['ProcessGoodsReceived']); include ('includes/footer.inc'); exit; @@ -351,11 +347,11 @@ $PeriodNo = GetPeriod($_POST['DefaultReceivedDate'], $db); $_POST['DefaultReceivedDate'] = FormatDateForSQL($_POST['DefaultReceivedDate']); - foreach ($_SESSION['PO']->LineItems as $OrderLine) { + foreach ($_SESSION['PO'.$identifier]->LineItems as $OrderLine) { if ($OrderLine->ReceiveQty !=0 AND $OrderLine->ReceiveQty!='' AND isset($OrderLine->ReceiveQty)) { - $LocalCurrencyPrice = ($OrderLine->Price / $_SESSION['PO']->ExRate); + $LocalCurrencyPrice = ($OrderLine->Price / $_SESSION['PO'.$identifier]->ExRate); if ($OrderLine->StockID!='') { /*Its a stock item line */ /*Need to get the current standard cost as it is now so we can process GL jorunals later*/ @@ -369,23 +365,23 @@ $myrow = DB_fetch_row($Result); if ($OrderLine->QtyReceived==0){ //its the first receipt against this line - $_SESSION['PO']->LineItems[$OrderLine->LineNo]->StandardCost = $myrow[0]; + $_SESSION['PO'.$identifier]->LineItems[$OrderLine->LineNo]->StandardCost = $myrow[0]; } $CurrentStandardCost = $myrow[0]; /*Set the purchase order line stdcostunit = weighted average / standard cost used for all receipts of this line This assures that the quantity received against the purchase order line multiplied by the weighted average of standard costs received = the total of standard cost posted to GRN suspense*/ - $_SESSION['PO']->LineItems[$OrderLine->LineNo]->StandardCost = (($CurrentStandardCost * $OrderLine->ReceiveQty) + ($_SESSION['PO']->LineItems[$OrderLine->LineNo]->StandardCost *$OrderLine->QtyReceived)) / ($OrderLine->ReceiveQty + $OrderLine->QtyReceived); + $_SESSION['PO'.$identifier]->LineItems[$OrderLine->LineNo]->StandardCost = (($CurrentStandardCost * $OrderLine->ReceiveQty) + ($_SESSION['PO'.$identifier]->LineItems[$OrderLine->LineNo]->StandardCost *$OrderLine->QtyReceived)) / ($OrderLine->ReceiveQty + $OrderLine->QtyReceived); } elseif ($OrderLine->QtyReceived==0 AND $OrderLine->StockID=='') { /*Its a nominal item being received */ /*Need to record the value of the order per unit in the standard cost field to ensure GRN account entries clear */ - $_SESSION['PO']->LineItems[$OrderLine->LineNo]->StandardCost = $LocalCurrencyPrice; + $_SESSION['PO'.$identifier]->LineItems[$OrderLine->LineNo]->StandardCost = $LocalCurrencyPrice; } if ($OrderLine->StockID=='') { /*Its a NOMINAL item line */ - $CurrentStandardCost = $_SESSION['PO']->LineItems[$OrderLine->LineNo]->StandardCost; + $CurrentStandardCost = $_SESSION['PO'.$identifier]->LineItems[$OrderLine->LineNo]->StandardCost; } /*Now the SQL to do the update to the PurchOrderDetails */ @@ -393,13 +389,13 @@ if ($OrderLine->ReceiveQty >= ($OrderLine->Quantity - $OrderLine->QtyReceived)){ $SQL = "UPDATE purchorderdetails SET quantityrecd = quantityrecd + '" . $OrderLine->ReceiveQty . "', - stdcostunit='" . $_SESSION['PO']->LineItems[$OrderLine->LineNo]->StandardCost . "', + stdcostunit='" . $_SESSION['PO'.$identifier]->LineItems[$OrderLine->LineNo]->StandardCost . "', completed=1 WHERE podetailitem = '" . $OrderLine->PODetailRec . "'"; } else { $SQL = "UPDATE purchorderdetails SET quantityrecd = quantityrecd + '" . $OrderLine->ReceiveQty . "', - stdcostunit='" . $_SESSION['PO']->LineItems[$OrderLine->LineNo]->StandardCost . "', + stdcostunit='" . $_SESSION['PO'.$identifier]->LineItems[$OrderLine->LineNo]->StandardCost . "', completed=0 WHERE podetailitem = '" . $OrderLine->PODetailRec . "'"; } @@ -412,7 +408,7 @@ if ($OrderLine->StockID !=''){ /*Its a stock item so use the standard cost for the journals */ $UnitCost = $CurrentStandardCost; } else { /*otherwise its a nominal PO item so use the purchase cost converted to local currency */ - $UnitCost = $OrderLine->Price / $_SESSION['PO']->ExRate; + $UnitCost = $OrderLine->Price / $_SESSION['PO'.$identifier]->ExRate; } /*Need to insert a GRN item */ @@ -431,7 +427,7 @@ '" . $OrderLine->ItemDescription . "', '" . $_POST['DefaultReceivedDate'] . "', '" . $OrderLine->ReceiveQty . "', - '" . $_SESSION['PO']->SupplierID . "', + '" . $_SESSION['PO'.$identifier]->SupplierID . "', '" . $CurrentStandardCost . "')"; $ErrMsg = _('CRITICAL ERROR') . '! ' . _('NOTE DOWN THIS ERROR AND SEEK ASSISTANCE') . ': ' . _('A GRN record could not be inserted') . '. ' . _('This receipt of goods has not been processed because'); @@ -446,7 +442,7 @@ $SQL="SELECT locstock.quantity FROM locstock WHERE locstock.stockid='" . $OrderLine->StockID . "' - AND loccode= '" . $_SESSION['PO']->Location . "'"; + AND loccode= '" . $_SESSION['PO'.$identifier]->Location . "'"; $Result = DB_query($SQL, $db); if (DB_num_rows($Result)==1){ @@ -460,7 +456,7 @@ $SQL = "UPDATE locstock SET quantity = locstock.quantity + '" . $OrderLine->ReceiveQty . "' WHERE locstock.stockid = '" . $OrderLine->StockID . "' - AND loccode = '" . $_SESSION['PO']->Location . "'"; + AND loccode = '" . $_SESSION['PO'.$identifier]->Location . "'"; $ErrMsg = _('CRITICAL ERROR') . '! ' . _('NOTE DOWN THIS ERROR AND SEEK ASSISTANCE') . ': ' . _('The location stock record could not be updated because'); $DbgMsg = _('The following SQL to update the location stock record was used'); @@ -483,13 +479,13 @@ '" . $OrderLine->StockID . "', 25, '" . $GRN . "', - '" . $_SESSION['PO']->Location . "', + '" . $_SESSION['PO'.$identifier]->Location . "', '" . $_POST['DefaultReceivedDate'] . "', '" . $LocalCurrencyPrice . "', '" . $PeriodNo . "', - '" . $_SESSION['PO']->SupplierID . " (" . $_SESSION['PO']->SupplierName . ") - " .$_SESSION['PO']->OrderNo . "', + '" . $_SESSION['PO'.$identifier]->SupplierID . " (" . $_SESSION['PO'.$identifier]->SupplierName . ") - " .$_SESSION['PO'.$identifier]->OrderNo . "', '" . $OrderLine->ReceiveQty . "', - '" . $_SESSION['PO']->LineItems[$OrderLine->LineNo]->StandardCost . "', + '" . $_SESSION['PO'.$identifier]->LineItems[$OrderLine->LineNo]->StandardCost . "', '" . ($QtyOnHandPrior + $OrderLine->ReceiveQty) . "' )"; @@ -509,7 +505,7 @@ //need to test if the controlled item exists first already $SQL = "SELECT COUNT(*) FROM stockserialitems WHERE stockid='" . $OrderLine->StockID . "' - AND loccode = '" . $_SESSION['PO']->Location . "' + AND loccode = '" . $_SESSION['PO'.$identifier]->Location . "' AND serialno = '" . $Item->BundleRef . "'"; $ErrMsg = _('CRITICAL ERROR') . '! ' . _('NOTE DOWN THIS ERROR AND SEEK ASSISTANCE') . ': ' . _('Could not check if a batch or lot stock item already exists because'); $DbgMsg = _('The following SQL to test for an already existing controlled but not serialised stock item was used'); @@ -523,7 +519,7 @@ $SQL = "UPDATE stockserialitems SET quantity = quantity + '" . $Item->BundleQty . "'"; } $SQL .= "WHERE stockid='" . $OrderLine->StockID . "' - AND loccode = '" . $_SESSION['PO']->Location . "' + AND loccode = '" . $_SESSION['PO'.$identifier]->Location . "' AND serialno = '" . $Item->BundleRef . "'"; } else { $SQL = "INSERT INTO stockserialitems (stockid, @@ -532,7 +528,7 @@ qualitytext, quantity) VALUES ('" . $OrderLine->StockID . "', - '" . $_SESSION['PO']->Location . "', + '" . $_SESSION['PO'.$identifier]->Location . "', '" . $Item->BundleRef . "', '', '" . $Item->BundleQty . "')"; @@ -582,7 +578,7 @@ transdate, periodno, inputdate, - fixedassettranstype + fixedassettranstype, amount) VALUES ('" . $OrderLine->AssetID . "', 25, @@ -599,9 +595,12 @@ /*Now get the correct cost GL account from the asset category */ $AssetRow = DB_fetch_array($CheckAssetExistsResult); /*Over-ride any GL account specified in the order with the asset category cost account */ - $_SESSION['PO']->LineItems[$OrderLine->LineNo]->GLCode = $AssetRow['costact']; + $_SESSION['PO'.$identifier]->LineItems[$OrderLine->LineNo]->GLCode = $AssetRow['costact']; /*Now if there are no previous additions to this asset update the date purchased */ - if ($AssetRow['datepurchased']=='0000-00-00'){ + if ($AssetRow['datepurchased']=='0000-00-00'){ + /* it is a new addition as the date is set to 0000-00-00 when the asset record is created + * before any cost is added to the asset + */ $SQL = "UPDATE fixedassets SET datepurchased='" . $_POST['DefaultReceivedDate'] . "', cost = cost + " . ($CurrentStandardCost * $OrderLine->ReceiveQty) . " WHERE assetid = '" . $OrderLine->AssetID . "'"; @@ -615,11 +614,12 @@ } //assetid provided doesn't exist so ignore it and treat as a normal nominal item } //assetid is set so the nominal item is an asset -/* If GLLink_Stock then insert GLTrans to debit the GL Code and credit GRN Suspense account at standard cost*/ - if ($_SESSION['PO']->GLLink==1 AND $OrderLine->GLCode !=0){ /*GLCode is set to 0 when the GLLink is not activated this covers a situation where the GLLink is now active but it wasn't when this PO was entered */ + + /* If GLLink_Stock then insert GLTrans to debit the GL Code and credit GRN Suspense account at standard cost*/ + if ($_SESSION['PO'.$identifier]->GLLink==1 AND $OrderLine->GLCode !=0){ + /*GLCode is set to 0 when the GLLink is not activated this covers a situation where the GLLink is now active but it wasn't when this PO was entered */ -/*first the debit using the GLCode in the PO detail record entry*/ - + /*first the debit using the GLCode in the PO detail record entry*/ $SQL = "INSERT INTO gltrans (type, typeno, trandate, @@ -633,7 +633,7 @@ '" . $_POST['DefaultReceivedDate'] . "', '" . $PeriodNo . "', '" . $OrderLine->GLCode . "', - 'PO: " . $_SESSION['PO']->OrderNo . " " . $_SESSION['PO']->SupplierID . " - " . $OrderLine->StockID + 'PO: " . $_SESSION['PO'.$identifier]->OrderNo . " " . $_SESSION['PO'.$identifier]->SupplierID . " - " . $OrderLine->StockID . " - " . $OrderLine->ItemDescription . " x " . $OrderLine->ReceiveQty . " @ " . number_format($CurrentStandardCost,2) . "', '" . $CurrentStandardCost * $OrderLine->ReceiveQty . "' @@ -645,7 +645,7 @@ /* If the CurrentStandardCost != UnitCost (the standard at the time the first delivery was booked in, and its a stock item, then the difference needs to be booked in against the purchase price variance account */ - /*now the GRN suspense entry*/ + /*now the GRN suspense entry*/ $SQL = "INSERT INTO gltrans (type, typeno, trandate, @@ -658,7 +658,7 @@ '" . $_POST['DefaultReceivedDate'] . "', '" . $PeriodNo . "', '" . $_SESSION['CompanyRecord']['grnact'] . "', - '" . _('PO') . ': ' . $_SESSION['PO']->OrderNo . ' ' . $_SESSION['PO']->SupplierID . ' - ' . + '" . _('PO'.$identifier) . ': ' . $_SESSION['PO'.$identifier]->OrderNo . ' ' . $_SESSION['PO'.$identifier]->SupplierID . ' - ' . $OrderLine->StockID . ' - ' . $OrderLine->ItemDescription . ' x ' . $OrderLine->ReceiveQty . ' @ ' . number_format($UnitCost,2) . "', '" . -$UnitCost * $OrderLine->ReceiveQty . "' @@ -671,35 +671,23 @@ } /* end of if GL and stock integrated and standard cost !=0 */ } /*Quantity received is != 0 */ } /*end of OrderLine loop */ - $CompletedSQL="SELECT SUM(completed) as completedlines, - COUNT(podetailitem) as alllines - FROM purchorderdetails - WHERE orderno='".$_SESSION['PO']->OrderNo . "'"; - $CompletedResult=DB_query($CompletedSQL,$db); - $MyCompletedRow=DB_fetch_array($CompletedResult); - $Status=$MyCompletedRow['alllines']-$MyCompletedRow['completedlines']; - - if ($Status==0) { - $sql="SELECT stat_comment - FROM purchorders - WHERE orderno='".$_SESSION['PO']->OrderNo . "'"; - $result=DB_query($sql,$db); - $myrow=DB_fetch_array($result); - $comment=$myrow['stat_comment']; - $date = date($_SESSION['DefaultDateFormat']); - $StatusComment=$date.' - Order Completed'.'<br>'.$comment; + + + + if ($_SESSION['PO'.$identifier]->AllLinesReceived()==1) { //all lines on the purchase order are now completed + $StatusComment=date($_SESSION['DefaultDateFormat']) .' - ' . _('Order Completed') .'<br />' . $_SESSION['PO'.$identifier]->StatusComment; $sql="UPDATE purchorders - SET status='" . PurchOrder::STATUS_COMPLITED . "', + SET status='Completed', stat_comment='" . $StatusComment . "' - WHERE orderno='" . $_SESSION['PO']->OrderNo . "'"; + WHERE orderno='" . $_SESSION['PO'.$identifier]->OrderNo . "'"; $result=DB_query($sql,$db); } $Result = DB_Txn_Commit($db); - $PONo = $_SESSION['PO']->OrderNo; - unset($_SESSION['PO']->LineItems); - unset($_SESSION['PO']); + $PONo = $_SESSION['PO'.$identifier]->OrderNo; + unset($_SESSION['PO'.$identifier]->LineItems); + unset($_SESSION['PO'.$identifier]); unset($_POST['ProcessGoodsReceived']); echo '<br><div class=centre>'. _('GRN number'). ' '. $GRN .' '. _('has been processed').'<br>'; Modified: trunk/PO_Items.php =================================================================== --- trunk/PO_Items.php 2011-01-10 21:30:27 UTC (rev 4463) +++ trunk/PO_Items.php 2011-01-11 08:58:07 UTC (rev 4464) @@ -102,8 +102,7 @@ if ($_SESSION['ExistingOrder']==0){ /*its a new order to be inserted */ //Do we need to check authorisation to create - no because already trapped when new PO session started - $StatusComment=date($_SESSION['DefaultDateFormat']).' - ' . _('Order Created by') . ' <a href="mailto:'. $_SESSION['UserEmail'] .'">'.$_SESSION['PO'.$identifier]->Initiator. - '</a> - '.$_SESSION['PO'.$identifier]->StatusMessage.'<br>'; + $StatusComment=date($_SESSION['DefaultDateFormat']).' - ' . _('Order Created by') . ' <a href="mailto:'. $_SESSION['UserEmail'] .'">' . $_SESSION['PO'.$identifier]->Initiator . '</a> - '.$_SESSION['PO'.$identifier]->StatusMessage.'<br>'; /*Get the order number */ $_SESSION['PO'.$identifier]->OrderNo = GetNextTransNo(18, $db); Modified: trunk/PO_PDFPurchOrder.php =================================================================== --- trunk/PO_PDFPurchOrder.php 2011-01-10 21:30:27 UTC (rev 4463) +++ trunk/PO_PDFPurchOrder.php 2011-01-11 08:58:07 UTC (rev 4464) @@ -4,16 +4,25 @@ include('includes/session.inc'); include('includes/SQL_CommonFunctions.inc'); include('includes/DefinePOClass.php'); + if(!isset($_GET['OrderNo']) && !isset($_POST['OrderNo'])){ $title = _('Select a Purchase Order'); include('includes/header.inc'); echo '<div class="centre"><br><br><br>'; prnMsg( _('Select a Purchase Order Number to Print before calling this page') , 'error'); - echo '<br><br><br><table class="table_index"> - <tr><td class="menu_group_item"> - <li><a href="'. $rootpath . '/PO_SelectOSPurchOrder.php?'.SID .'">' . _('Outstanding Purchase Orders') . '</a></li> - <li><a href="'. $rootpath . '/PO_SelectPurchOrder.php?'. SID .'">' . _('Purchase Order Inquiry') . '</a></li> - </td></tr></table></div><br><br><br>'; + echo '<br /> + <br /> + <br /> + <table class="table_index"> + <tr><td class="menu_group_item"> + <li><a href="'. $rootpath . '/PO_SelectOSPurchOrder.php?'.SID .'">' . _('Outstanding Purchase Orders') . '</a></li> + <li><a href="'. $rootpath . '/PO_SelectPurchOrder.php?'. SID .'">' . _('Purchase Order Inquiry') . '</a></li> + </td> + </tr></table> + </div> + <br /> + <br /> + <br />'; include('includes/footer.inc'); exit(); @@ -29,10 +38,10 @@ $title = _('Print Purchase Order Number').' '. $OrderNo; /* If we are not previewing the order then find * the order status */ -if ($OrderNo != 'Preview') { +if ($OrderNo != 'Preview') { // then we are printing a real order $sql="SELECT status - FROM purchorders - WHERE orderno='".$OrderNo."'"; + FROM purchorders + WHERE orderno='".$OrderNo."'"; $result=DB_query($sql, $db); $myrow=DB_fetch_array($result); $OrderStatus=$myrow['status']; @@ -42,70 +51,81 @@ $OrderStatus = _('Printed'); $MakePDFThenDisplayIt = True; } -if ($OrderStatus != PurchOrder::STATUS_AUTHORISED and $OrderStatus != PurchOrder::STATUS_PRINTED) { +if ($OrderStatus != 'Authorised' AND $OrderStatus != 'Printed') { include('includes/header.inc'); prnMsg( _('Purchase orders can only be printed once they have been authorised') . '. ' . _('This order is currently at a status of') . ' ' . _($OrderStatus),'warn'); include('includes/footer.inc'); exit; } +if ($_POST['PrintOrEmail']=='Email' AND ! IsEmailAddress($_POST['EmailTo'])){ + include('includes/header.inc'); + prnMsg( _('The email address entered does not appear to be valid. No emails have been sent.'),'warn'); + include('includes/footer.inc'); + exit; +} $ViewingOnly = 0; -if (isset($_GET['ViewingOnly']) && $_GET['ViewingOnly']!='') { +if (isset($_GET['ViewingOnly']) AND $_GET['ViewingOnly']!='') { $ViewingOnly = $_GET['ViewingOnly']; -} elseif (isset($_POST['ViewingOnly']) && $_POST['ViewingOnly']!='') { +} elseif (isset($_POST['ViewingOnly']) AND $_POST['ViewingOnly']!='') { $ViewingOnly = $_POST['ViewingOnly']; } -/* If we are previewing the order then we dont - * want to email it */ -if ($OrderNo != 'Preview') { +/* If we are previewing the order then we dont want to email it */ +if ($OrderNo == 'Preview') { //OrderNo is set to 'Preview' when just looking at the format of the printed order $_POST['PrintOrEmail']='Print'; } -if (isset($_POST['DoIt']) AND ($_POST['PrintOrEmail']=='Print' || $ViewingOnly==1) ){ +if (isset($_POST['DoIt']) AND ($_POST['PrintOrEmail']=='Print' OR $ViewingOnly==1) ){ $MakePDFThenDisplayIt = True; -} elseif (isset($_POST['DoIt']) AND $_POST['PrintOrEmail']=='Email' AND strlen($_POST['EmailTo'])>6){ +} elseif (isset($_POST['DoIt']) AND $_POST['PrintOrEmail']=='Email'){ $MakePDFThenEmailIt = True; } -if (isset($OrderNo) && $OrderNo != "" && $OrderNo > 0 && $OrderNo != 'Preview'){ - //Check this up front. Note that the myrow recordset is carried into the actual make pdf section +if (isset($OrderNo) AND $OrderNo != '' AND $OrderNo > 0 AND $OrderNo != 'Preview'){ /*retrieve the order details from the database to print */ $ErrMsg = _('There was a problem retrieving the purchase order header details for Order Number'). ' ' . $OrderNo . ' ' . _('from the database'); - $sql = "SELECT - purchorders.supplierno, - suppliers.suppname, - suppliers.address1, - suppliers.address2, - suppliers.address3, - suppliers.address4, - purchorders.comments, - purchorders.orddate, - purchorders.rate, - purchorders.dateprinted, - purchorders.deladd1, - purchorders.deladd2, - purchorders.deladd3, - purchorders.deladd4, - purchorders.deladd5, - purchorders.deladd6, - purchorders.allowprint, - purchorders.requisitionno, - purchorders.initiator, - purchorders.paymentterms, - suppliers.currcode - FROM purchorders INNER JOIN suppliers - ON purchorders.supplierno = suppliers.supplierid - WHERE purchorders.orderno='" . $OrderNo ."'"; + $sql = "SELECT purchorders.supplierno, + suppliers.suppname, + suppliers.address1, + suppliers.address2, + suppliers.address3, + suppliers.address4, + purchorders.comments, + purchorders.orddate, + purchorders.rate, + purchorders.dateprinted, + purchorders.deladd1, + purchorders.deladd2, + purchorders.deladd3, + purchorders.deladd4, + purchorders.deladd5, + purchorders.deladd6, + purchorders.allowprint, + purchorders.requisitionno, + purchorders.initiator, + purchorders.paymentterms, + suppliers.currcode, + purchorders.status, + purchorders.stat_comment + FROM purchorders INNER JOIN suppliers + ON purchorders.supplierno = suppliers.supplierid + WHERE purchorders.orderno='" . $OrderNo ."'"; $result=DB_query($sql,$db, $ErrMsg); if (DB_num_rows($result)==0){ /*There is no order header returned */ $title = _('Print Purchase Order Error'); include('includes/header.inc'); echo '<div class="centre"><br><br><br>'; prnMsg( _('Unable to Locate Purchase Order Number') . ' : ' . $OrderNo . ' ', 'error'); - echo '<br><br><br><table class="table_index"> - <tr><td class="menu_group_item"> - <li><a href="'. $rootpath . '/PO_SelectOSPurchOrder.php?'.SID .'">' . _('Outstanding Purchase Orders') . '</a></li> - <li><a href="'. $rootpath . '/PO_SelectPurchOrder.php?'. SID .'">' . _('Purchase Order Inquiry') . '</a></li> - </td></tr></table></div><br><br><br>'; + echo '<br /> + <br /> + <br /> + <table class="table_index"> + <tr><td class="menu_group_item"> + <li><a href="'. $rootpath . '/PO_SelectOSPurchOrder.php?'.SID .'">' . _('Outstanding Purchase Orders') . '</a></li> + <li><a href="'. $rootpath . '/PO_SelectPurchOrder.php?'. SID .'">' . _('Purchase Order Inquiry') . '</a></li> + </td> + </tr> + </table> + </div><br><br><br>'; include('includes/footer.inc'); exit(); } elseif (DB_num_rows($result)==1){ /*There is only one order header returned */ @@ -115,8 +135,7 @@ $title = _('Purchase Order Already Printed'); include('includes/header.inc'); echo '<p>'; - prnMsg( _('Purchase Order Number').' ' . $OrderNo . ' '. - _('has previously been printed') . '. ' . _('It was printed on'). ' ' . + prnMsg( _('Purchase Order Number').' ' . $OrderNo . ' '. _('has previously been printed') . '. ' . _('It was printed on'). ' ' . ConvertSQLDate($POHeader['dateprinted']) . '<br>'. _('To re-print the order it must be modified to allow a reprint'). '<br>'. _('This check is there to ensure that duplicate purchase orders are not sent to the supplier resulting in several deliveries of the same supplies'), 'warn'); @@ -179,17 +198,17 @@ $ErrMsg = _('There was a problem retrieving the line details for order number') . ' ' . $OrderNo . ' ' . _('from the database'); $sql = "SELECT itemcode, - deliverydate, - itemdescription, - unitprice, - unitname as units, - quantityord, - decimalplaces - FROM purchorderdetails LEFT JOIN stockmaster - ON purchorderdetails.itemcode=stockmaster.stockid - LEFT JOIN unitsofmeasure - ON purchorderdetails.uom=unitsofmeasure.unitid - WHERE orderno ='" . $OrderNo ."'"; + deliverydate, + itemdescription, + unitprice, + unitname as units, + quantityord, + decimalplaces + FROM purchorderdetails LEFT JOIN stockmaster + ON purchorderdetails.itemcode=stockmaster.stockid + LEFT JOIN unitsofmeasure + ON purchorderdetails.uom=unitsofmeasure.unitid + WHERE orderno ='" . $OrderNo ."'"; $result=DB_query($sql,$db); } if ($OrderNo=='Preview' or DB_num_rows($result)>0){ @@ -213,22 +232,22 @@ if ($_POST['ShowAmounts']=='Yes'){ $DisplayPrice = number_format($POLine['unitprice'],2); } else { - $DisplayPrice = "----"; + $DisplayPrice = '----'; } $DisplayDelDate = ConvertSQLDate($POLine['deliverydate'],2); if ($_POST['ShowAmounts']=='Yes'){ $DisplayLineTotal = number_format($POLine['unitprice']*$POLine['quantityord'],2); } else { - $DisplayLineTotal = "----"; + $DisplayLineTotal = '----'; } /* Dont search for supplier data if it is a preview */ if ($OrderNo !='Preview') { //check the supplier code from code item $sqlsupp = "SELECT supplierdescription - FROM purchdata - WHERE stockid='" . $POLine['itemcode'] . "' - AND supplierno ='" . $POHeader['supplierno'] . "' - AND price='".$POLine['unitprice']."'"; + FROM purchdata + WHERE stockid='" . $POLine['itemcode'] . "' + AND supplierno ='" . $POHeader['supplierno'] . "' + AND price='".$POLine['unitprice']."'"; $SuppResult = DB_query($sqlsupp,$db); $SuppDescRow = DB_fetch_row($SuppResult); } else { @@ -237,7 +256,7 @@ if($SuppDescRow[0]==""){ $Desc=$POLine['itemdescription']; }else{ - $Desc="".$SuppDescRow['0']." - ".$POLine['itemdescription'].""; + $Desc= $SuppDescRow['0'].' - '.$POLine['itemdescription'].""; } $OrderTotal += ($POLine['unitprice']*$POLine['quantityord']); $LeftOvers = $pdf->addTextWrap($FormDesign->Data->Column1->x,$YPos,$FormDesign->Data->Column1->Length,$FormDesign->Data->Column1->FontSize,$POLine['itemcode'], 'left'); @@ -273,66 +292,46 @@ if ($_POST['ShowAmounts']=='Yes'){ $DisplayOrderTotal = number_format($OrderTotal,2); } else { - $DisplayOrderTotal = "----"; + $DisplayOrderTotal = '----'; } $pdf->addText($FormDesign->OrderTotalCaption->x,$Page_Height - $FormDesign->OrderTotalCaption->y, $FormDesign->OrderTotalCaption->FontSize, _('Order Total - excl tax'). ' ' . $POHeader['currcode']); $LeftOvers = $pdf->addTextWrap($FormDesign->OrderTotal->x,$Page_Height - $FormDesign->OrderTotal->y,$FormDesign->OrderTotal->Length,$FormDesign->OrderTotal->FontSize,$DisplayOrderTotal, 'right'); } /*end if there are order details to show on the order*/ //} /* end of check to see that there was an order selected to print */ - //failed var to allow us to print if the email fails. - $failed = false; + + $Success = 1; //assume the best and email goes - has to be set to 1 to allow update status if ($MakePDFThenDisplayIt){ - $pdf->OutputD($_SESSION['DatabaseName'] . '_PurchaseOrder_' . date('Y-m-d') . '.pdf');//UldisN + $pdf->OutputD($_SESSION['DatabaseName'] . '_PurchaseOrder_' . $OrderNo . '_' . date('Y-m-d') . '.pdf');//UldisN $pdf->__destruct(); //UldisN } else { /* must be MakingPDF to email it */ - /* UldisN - $pdfcode = $pdf->output(); - $fp = fopen( $_SESSION['reports_dir'] . '/PurchOrder.pdf','wb'); - fwrite ($fp, $pdfcode); - fclose ($fp); - */ - $PdfFileName = $_SESSION['DatabaseName'] . '_PurchaseOrder_' . date('Y-m-d') . '.pdf'; - $ReportsDirName = $_SESSION['reports_dir']; - $pdf->Output($ReportsDirName . '/' . $PdfFileName,'F');//UldisN - $pdf->__destruct(); //UldisN + + $PdfFileName = $_SESSION['DatabaseName'] . '_PurchaseOrder_' . $OrderNo . '_' .date('Y-m-d') . '.pdf'; + $pdf->Output($_SESSION['reports_dir'] . '/' . $PdfFileName,'F'); + $pdf->__destruct(); include('includes/htmlMimeMail.php'); $mail = new htmlMimeMail(); - $attachment = $mail->getFile($ReportsDirName . '/' . $PdfFileName); + $attachment = $mail->getFile($_SESSION['reports_dir'] . '/' . $PdfFileName); $mail->setText( _('Please find herewith our purchase order number').' ' . $OrderNo); $mail->setSubject( _('Purchase Order Number').' ' . $OrderNo); $mail->addAttachment($attachment, $PdfFileName, 'application/pdf'); $mail->setFrom($_SESSION['CompanyRecord']['coyname'] . "<" . $_SESSION['CompanyRecord']['email'] .">"); - $result = $mail->send(array($_POST['EmailTo'])); - if ($result==1){ - $failed = false; - echo '<p>'; + $Success = $mail->send(array($_POST['EmailTo'])); + if ($Success==1){ + echo '<p />'; prnMsg( _('Purchase Order'). ' ' . $OrderNo.' ' . _('has been emailed to') .' ' . $_POST['EmailTo'] . ' ' . _('as directed'), 'success'); - } else { - $failed = true; - echo '<p>'; + } else { //email failed + echo '<p />'; prnMsg( _('Emailing Purchase order'). ' ' . $OrderNo.' ' . _('to') .' ' . $_POST['EmailTo'] . ' ' . _('failed'), 'error'); } } - if ($ViewingOnly==0 && !$failed) { - $commentsql="SELECT initiator,stat_comment FROM purchorders WHERE orderno='".$OrderNo."'"; - $commentresult=DB_query($commentsql,$db); - $commentrow=DB_fetch_array($commentresult); - $comment=$commentrow['stat_comment']; - $emailsql="SELECT email FROM www_users WHERE userid='".$commentrow['initiator']."'"; - $emailresult=DB_query($emailsql, $db); - $emailrow=DB_fetch_array($emailresult); - $date = date($_SESSION['DefaultDateFormat']); - $StatusComment=$date.' - Printed by <a href="mailto:'.$emailrow['email'].'">'.$_SESSION['UserID']. - '</a><br>'.$comment; - $sql = " - UPDATE purchorders - SET - allowprint = 0, - dateprinted = '" . Date('Y-m-d') . "', - status = '" . PurchOrder::STATUS_PRINTED . "', - stat_comment = '" . $StatusComment . "' - WHERE - purchorders.orderno = '" . $OrderNo."'"; + if ($ViewingOnly==0 AND $Success==1) { + $StatusComment = date($_SESSION['DefaultDateFormat']) .' - ' . _('Printed by') . '<a href="mailto:'.$_SESSION['UserEmail'] .'">'.$_SESSION['UsersRealName']. '</a><br />' . $POHeader['stat_comment']; + + $sql = "UPDATE purchorders SET allowprint = 0, + dateprinted = '" . Date('Y-m-d') . "', + status = 'Printed', + stat_comment = '" . $StatusComment . "' + WHERE purchorders.orderno = '" . $OrderNo."'"; $result = DB_query($sql,$db); } } /* There was enough info to either print or email the purchase order */ @@ -374,19 +373,19 @@ if ($_POST['PrintOrEmail']=='Email'){ $ErrMsg = _('There was a problem retrieving the contact details for the supplier'); $SQL = "SELECT suppliercontacts.contact, - suppliercontacts.email - FROM suppliercontacts INNER JOIN purchorders - ON suppliercontacts.supplierid=purchorders.supplierno - WHERE purchorders.orderno='".$OrderNo."'"; + suppliercontacts.email + FROM suppliercontacts INNER JOIN purchorders + ON suppliercontacts.supplierid=purchorders.supplierno + WHERE purchorders.orde... [truncated message content] |