Merged changes form stabel branch up to the current state (2.3.22+).
authorJanusz Dobrowolski <janusz@frontaccouting.eu>
Thu, 25 Dec 2014 15:59:14 +0000 (16:59 +0100)
committerJanusz Dobrowolski <janusz@frontaccouting.eu>
Thu, 25 Dec 2014 15:59:14 +0000 (16:59 +0100)
66 files changed:
CHANGELOG.txt
access/login.php
admin/company_preferences.php
admin/db/maintenance_db.inc
admin/gl_setup.php
admin/inst_lang.php
admin/users.php
config.default.php
gl/includes/db/gl_db_bank_trans.inc
gl/includes/db/gl_db_rates.inc
includes/archive.inc
includes/db/inventory_db.inc
includes/db/manufacturing_db.inc
includes/db/sql_functions.inc
includes/errors.inc
includes/prefs/sysprefs.inc
includes/session.inc
includes/ui/items_cart.inc
includes/ui/ui_lists.inc
inventory/adjustments.php
inventory/includes/db/items_adjust_db.inc
inventory/includes/db/items_trans_db.inc
inventory/includes/db/items_transfer_db.inc
inventory/includes/item_adjustments_ui.inc
inventory/includes/stock_transfers_ui.inc
inventory/manage/locations.php
inventory/transfers.php
js/inserts.js
js/utils.js
lang/new_language_template/LC_MESSAGES/empty.po
manufacturing/includes/db/work_order_costing_db.inc
manufacturing/includes/db/work_orders_db.inc
manufacturing/includes/work_order_issue_ui.inc
manufacturing/search_work_orders.php
manufacturing/work_order_add_finished.php
manufacturing/work_order_entry.php
manufacturing/work_order_issue.php
purchasing/includes/db/po_db.inc
purchasing/inquiry/po_search.php
purchasing/inquiry/po_search_completed.php
purchasing/supplier_credit.php
reporting/includes/class.graphic.inc
reporting/includes/header2.inc
reporting/includes/html_entity_decode_php4.php
reporting/includes/reports_classes.inc
reporting/rep101.php
reporting/rep111.php
reporting/rep201.php
reporting/rep301.php
reporting/rep308.php
reporting/rep402.php [new file with mode: 0644]
reporting/rep709.php
reporting/reports_main.php
sales/customer_delivery.php
sales/includes/cart_class.inc
sales/includes/db/cust_trans_db.inc
sales/includes/ui/sales_order_ui.inc
sales/inquiry/sales_deliveries_view.php
sales/manage/customers.php
sales/sales_order_entry.php
sql/en_US-demo.sql
sql/en_US-new.sql
themes/aqua/default.css
themes/cool/default.css
themes/default/default.css
update.html

index f75adf628203452ffd3fef339a12314d4a7fe98f..acfb883b55a80651d72dea58b78355436f09451b 100644 (file)
 ------------
 This is a changelog for FrontAccounting All releases.
 
+2014-09-29 16:04 +0200 Joe
+(3421) Changelog change
+ CHANGELOG.txt
+
+2014-09-29 15:57 +0200 Joe
+(3420) Release 2.3.22
+ update.html
+ version.php
+
+2014-09-29 15:35 +0200 Janusz Dobrowolski
+(3419) Updated gettext template.
+ lang/new_language_template/LC_MESSAGES/empty.po
+
+2014-09-26 15:34 +0200 Joe
+(3418) Updated en_US-demo.sql and en_US-new.sql COAs
+ sql/en_US-demo.sql
+ sql/en_US-new.sql
+
+2014-09-24 23:42 +0200 Joe
+(3417) Global option for printing item images on sales quotations.
+ config.default.php
+ reporting/rep111.php
+
+2014-09-24 07:51 +0200 Joe
+(3416) Improved Tax Report. Bank Payments/Deposits show 'order to/name' info in name column.
+ reporting/rep709.php
+
+2014-09-22 23:20 +0200 Janusz Dobrowolski
+(3415) Small cleanups.
+ inventory/transfers.php
+ sales/includes/ui/sales_order_ui.inc
+
+2014-09-21 00:09 +0200 Janusz Dobrowolski
+(3414) Fixed stock quantity checks to block transactions which would result in negative inventory status (if not allowed).
+ gl/includes/db/gl_db_bank_trans.inc
+ includes/db/inventory_db.inc
+ includes/db/manufacturing_db.inc
+ includes/db/sql_functions.inc
+ includes/ui/items_cart.inc
+ inventory/adjustments.php
+ inventory/includes/item_adjustments_ui.inc
+ inventory/includes/stock_transfers_ui.inc
+ inventory/transfers.php
+ manufacturing/includes/work_order_issue_ui.inc
+ manufacturing/work_order_add_finished.php
+ manufacturing/work_order_entry.php
+ manufacturing/work_order_issue.php
+ purchasing/supplier_credit.php
+ sales/customer_delivery.php
+ sales/includes/cart_class.inc
+ sales/includes/ui/sales_order_ui.inc
+ sales/sales_order_entry.php
+
+2014-09-19 09:06 +0200 Joe
+(3413) Set default Show Also Allocated to Yes in aged reports, just like on screen transactions.
+ reporting/includes/reports_classes.inc
+
+2014-09-19 02:40 +0200 Joe
+(3412) Rerun. We must also test for availability on document date.
+ sales/sales_order_entry.php
+
+2014-09-19 02:04 +0200 Joe
+(3411) We must always test for stock availability by todays date.
+ sales/sales_order_entry.php
+
+2014-09-17 11:04 +0200 Janusz Dobrowolski
+(3410) Fixed POST array values paasing on timout screen.
+ access/login.php
+
+2014-09-14 00:43 +0200 Joe
+(3409) Added new report, Work Order Listing.
+ reporting/includes/reports_classes.inc
+ reporting/rep402.php
+ reporting/reports_main.php
+
+2014-09-14 00:42 +0200 Joe
+(3408) Added sorting for number and name in work order inquiry.
+ manufacturing/search_work_orders.php
+
+2014-09-12 08:19 +0200 Joe
+(3407) Bug fixes and option to print Inventory Valuation Report on Costed Values.
+ reporting/rep301.php
+ reporting/rep308.php
+
+2014-09-12 08:18 +0200 Joe
+(3406) CItem Cost Update will also regulate the stock moves standard cost to mirror correct GL.
+ inventory/includes/db/items_trans_db.inc
+
+2014-09-12 08:16 +0200 Joe
+(3405) New flag $use_costed_values in config.php for Inventory Valuation Report
+ config.default.php
+
+2014-09-12 08:15 +0200 Joe
+(3404) Removed redundant mb_flag 'A'.
+ includes/db/manufacturing_db.inc
+
+2014-09-01 14:18 +0200 Janusz Dobrowolski
+(3403) PHP 5.4 warning on deprecated mysql api is ignored to avoid folld in errors file. This is safe to use it with 5.4 in FA 2.3 anyway, will be moved to mysqli in 2.4.
+ includes/errors.inc
+
+2014-08-22 22:26 +0200 Janusz Dobrowolski
+(3402) Fixed php5.4 specific problem with downloading extensions (by campbell-prince)
+ includes/archive.inc
+
+2014-08-15 09:30 +0200 Joe
+(3401) Improved Costed Inventory Movement Report
+ reporting/rep308.php
+
+2014-08-13 23:00 +0200 Joe
+(3400) Wrong parameter when saving Item Transfer
+ inventory/includes/db/items_transfer_db.inc
+
+2014-08-12 23:46 +0200 Joe
+(3399) Wrong parameter when saving Item Adjustment
+ inventory/includes/db/items_adjust_db.inc
+
+2014-07-10 10:43 +0200 Joe
+(3398) Added supplier search in Outstanding Purchase Orders and Purchase Orders Inquiry.
+ purchasing/includes/db/po_db.inc
+ purchasing/inquiry/po_search.php
+ purchasing/inquiry/po_search_completed.php
+ sales/includes/db/cust_trans_db.inc
+
+2014-07-09 11:42 +0200 Joe
+(3397) Added customer search in Search not invoiced Deliveries.
+ sales/includes/db/cust_trans_db.inc
+ sales/inquiry/sales_deliveries_view.php
+
+2014-07-07 10:59 +0200 Joe
+(3396) Improved readability in Graphics engine, x-legends for all languages.
+ reporting/includes/class.graphic.inc
+
+2014-07-05 16:17 +0200 Joe
+(3395) New variable in config.default.php , $UTF8_fontfile. Needed due to FreeSans problem with Arabic and Chinese in Graphics Engine.
+ config.default.php
+
+2014-07-05 16:15 +0200 Joe
+(3394) Enabled RTL text in Graphics Engine. Due to bug in imagettftext.
+ reporting/includes/class.graphic.inc
+
+2014-06-24 09:15 +0200 Joe
+(3393) Fixed line overwrite in documents when using rtl language.
+ reporting/includes/header2.inc
+
+2014-06-17 18:51 +0200 Joe
+(3392) User account should not be deleted if there are any entries on his/her name.
+ admin/users.php
+
+2014-06-13 20:40 +0200 Joe
+(3391) Added short name, name and tax id as search options in customer and supplier lists
+ includes/ui/ui_lists.inc
+
+2014-06-07 23:24 +0200 Janusz Dobrowolski
+(3390) Language template update
+ lang/new_language_template/LC_MESSAGES/empty.po
+
+2014-05-27 20:56 +0200 Janusz Dobrowolski
+(3389) Customer Credit Note: fixed payments allocation after crediting sales invoice.
+ sales/includes/db/custalloc_db.inc
+
+2014-05-27 18:02 +0200 Janusz Dobrowolski
+(3388) Payment/Deposit: new exchange rate was not used for GL postings, now ex_rate is stored before adding transaction.
+ gl/gl_bank.php
+
+2014-05-21 16:00 +0200 Joe
+(3387) Release 2.3.21
+ CHANGELOG.txt
+ update.html
+ version.php
+
+2014-05-21 08:59 +0200 Janusz Dobrowolski
+(3386) Fixed unexpected additional GL postings when tax was used in Supplier Invoice additional GL lines.
+ purchasing/includes/supp_trans_class.inc
+ purchasing/supplier_credit.php
+
+2014-05-21 08:58 +0200 Janusz Dobrowolski
+(3385) Small code cleanups.
+ includes/current_user.inc
+ purchasing/supplier_invoice.php
+
+2014-04-26 09:14 +0200 Janusz Dobrowolski
+(3384) Added option to allow password reset (by Mithy).
+ access/login.php
+ access/password_reset.php
+ admin/db/users_db.inc
+ config.default.php
+ includes/current_user.inc
+ includes/session.inc
+
+2014-04-26 00:57 +0200 Janusz Dobrowolski
+(3383) Fixed directory traversal issues.
+ admin/inst_module.php
+ includes/hooks.inc
+
+2014-04-26 00:12 +0200 Janusz Dobrowolski
+(3382) Redirect all database errors to error log unless $go_debug is switched on.
+ includes/errors.inc
+
+2014-04-26 00:01 +0200 Janusz Dobrowolski
+(3381) A couple of security issues fixed.
+ access/logout.php
+ admin/create_coy.php
+ admin/db/users_db.inc
+ includes/current_user.inc
+ includes/session.inc
+ inventory/includes/db/items_db.inc
+ taxes/db/tax_types_db.inc
+
+2014-03-23 16:02 +0100 Janusz Dobrowolski
+(3380) Fixed email option labels in Supplier Reports.
+ reporting/reports_main.php
+
+2014-05-05 16:19 +0200 Joe
+(3377) Allow changing urrency on customer/supplier as long as no transactions exist.
+ purchasing/manage/suppliers.php
+ sales/manage/customers.php
+
+2014-05-04 09:46 +0200 Joe
+(3376) Backward compatible empty sql mode for MySql databases greater than release 5.5.
+ includes/db/connect_db.inc
+
+2014-04-08 09:20 +0200 Joe
+(3375) Sending location email when below reorder also in Itmes Transfer and Adjustment
+ inventory/includes/db/items_adjust_db.inc
+ inventory/includes/db/items_transfer_db.inc
+ inventory/includes/inventory_db.inc
+ sales/includes/db/sales_order_db.inc
+
+2014-04-05 10:15 +0200 Joe
+(3374) Selecting the cancel button in confirming the voiding of document did not work properly. Rerun
+ sales/sales_order_entry.php
+
+2014-04-05 10:08 +0200 Joe
+(3373) Selecting the cancel button in confirming the voiding of document did not work properly.
+ sales/sales_order_entry.php
+
+2014-04-04 23:51 +0200 Joe
+(3372) When canceling a non finished sales quotation FA should not try to delete record.
+ sales/sales_order_entry.php
+
+2014-04-03 16:37 +0200 Joe
+(3371) Bad elsif sentense in items.php (image upload)
+ inventory/manage/items.php
+
+2014-03-11 23:57 +0100 Joe
+(3370) Changed decimal places in preferences to be number lists.
+ admin/display_prefs.php
+
+2014-03-10 11:06 +0100 Joe
+(3369) Crusial update instructions
+ update.html
+
+2014-03-10 11:01 +0100 Joe
+(3368) New CHANGELOG.txt
+ CHANGELOG.txt
+
+2014-03-10 10:58 +0100 Joe
+(3367) Release 2.3.20
+ version.php
+
+2014-03-10 10:18 +0100 Janusz Dobrowolski
+(3366) Gettext template update.
+ lang/new_language_template/LC_MESSAGES/empty.po
+
+2014-03-07 00:57 +0100 Janusz Dobrowolski
+(3365) Fixed security issues in file uploads.
+ admin/attachments.php
+ admin/company_preferences.php
+ admin/inst_lang.php
+ includes/main.inc
+ inventory/includes/inventory_db.inc
+
+2014-03-10 10:15 +0100 Joe
+(3364) fixed a check that company logo exists when using header3.
+ reporting/includes/pdf_report.inc
+
+2014-02-07 09:02 +0100 Joe
+(3363) If no memo on GL line in GL account inquiry, the comments for the voucher is shown on the line.
+ gl/inquiry/gl_account_inquiry.php
+
+2014-02-07 01:13 +0100 Joe
+(3362) Supplier info not shown on gl inquiry for bank account.
+ purchasing/includes/db/supp_payment_db.inc
+
+2014-02-04 15:35 +0100 Joe
+(3361) Supp credit notes should not be shown in allocable list.
+ purchasing/includes/db/suppalloc_db.inc
+
+2014-02-04 12:47 +0100 Janusz Dobrowolski
+(3360) Fixed bug in Supplier Credit Note allocation to Purchase Invoice.
+ purchasing/includes/db/invoice_db.inc
+
+2014-01-29 08:49 +0100 Joe
+(3359) Link customer payment entry after saving Invoice (if not cash)
+ purchasing/supplier_invoice.php
+ sales/customer_invoice.php
+ sales/sales_order_entry.php
+
+2014-01-17 13:38 +0100 Joe
+(3358) 0002615: Rerun. voiding an allocated currency invoice doesn't clear FX account
+ sales/includes/db/custalloc_db.inc
+
+2014-01-16 19:34 +0100 Joe
+(3357) 0002615: voiding an allocated currency invoice doesn't clear FX account
+ purchasing/includes/db/suppalloc_db.inc
+ sales/includes/db/custalloc_db.inc
+
+2013-12-28 21:04 +0100 Janusz Dobrowolski
+(3349) Added debtor_trans key on order_ field.
+ sql/en_US-demo.sql
+ sql/en_US-new.sql
+
+2013-12-10 08:21 +0100 Joe
+(3348) Avoiding redundant passes in Fiscal Year deletion.
+ admin/db/fiscalyears_db.inc
+
+2013-12-05 09:58 +0100 Joe
+(3347) Rerun. Allowing more than one document attachment.
+ admin/db/attachments_db.inc
+
+2013-12-05 00:17 +0100 Joe
+(3346) Inventory Items Movements always starts with 0 qty. Fixed.
+ inventory/includes/db/movement_types_db.inc
+
+2013-12-04 10:24 +0100 Joe
+(3345) Allowing more than one document attachment.
+ admin/db/attachments_db.inc
+ includes/ui/ui_controls.inc
+
+2013-11-20 16:09 +0100 Janusz Dobrowolski
+(3344) Supplier Payments: Fixed error during payment allocation in strict MySQL mode.
+ includes/ui/allocation_cart.inc
+ purchasing/includes/db/suppalloc_db.inc
+ purchasing/supplier_payment.php
+
+2013-11-19 17:35 +0100 Janusz Dobrowolski
+(3343) Fixed back link presented when trying to modify fully invoiced Customer Delivery.
+ sales/customer_delivery.php
+
+2013-11-19 15:09 +0100 Janusz Dobrowolski
+(3342) Fixed inventory valuation bug after voiding foreign supplier GRN leading to negative inventory.
+ includes/db/inventory_db.inc
+ purchasing/includes/db/grn_db.inc
+
+2013-11-10 15:11 +0100 Janusz Dobrowolski
+(3341) Journal Inquiry (bank transaction view): fixed database error on bank transaction view triggered on some buggy MySQL versions.
+ gl/includes/db/gl_db_bank_trans.inc
+
+2013-11-06 21:13 +0100 Janusz Dobrowolski
+(3340) Payments, Deposits: fixed false error when payment is made in customer/supplier currency.
+ gl/gl_bank.php
+
+2013-11-06 08:01 +0100 Joe
+(3339) CHANGELOG
+ CHANGELOG.txt
+
+2013-11-06 07:52 +0100 Joe
+(3338) Release 2.3.19
+ CHANGELOG.txt
+ version.php
+
+2013-11-05 17:55 +0100 Janusz Dobrowolski
+(3337) Gettext template update.
+ lang/new_language_template/LC_MESSAGES/empty.po
+
+2013-11-03 14:39 +0100 Janusz Dobrowolski
+(3336) Supplier Invoice: Fixed tax input refresh after change in gl/grn items.
+ purchasing/supplier_invoice.php
+
+2013-10-27 00:09 +0200 Janusz Dobrowolski
+(3325) Bank Payment View, Bank Deposit View: fixed 'left to allocate' amount, added value in customer/payment currency.
+ gl/includes/db/gl_db_bank_trans.inc
+ gl/view/gl_deposit_view.php
+ gl/view/gl_payment_view.php
+
+2013-10-27 00:05 +0200 Janusz Dobrowolski
+(3324) Supplier Allocations: Bank Payments transactions were improperly available for supplier payments allocations.
+ purchasing/includes/db/suppalloc_db.inc
+
+2013-10-26 19:15 +0200 Janusz Dobrowolski
+(3323) Bank Transfer: roundings for transfers between two currencies are posted to exchange variance account.
+ gl/includes/db/gl_db_banking.inc
+
+2013-10-18 11:33 +0200 Joe
+(3322) Supplier transactions now show supplier reference for PO Deliveries.
+ purchasing/includes/db/supp_trans_db.inc
+
+2013-10-14 13:53 +0200 Janusz Dobrowolski
+(3321) Fixed person contact deletion.
+ includes/db/crm_contacts_db.inc
+ includes/ui/contacts_view.inc
+
+2013-10-14 11:15 +0200 Joe
+(3320) When automatic creating a branch the contact is also created on the customer (Rerun).
+ sales/manage/customers.php
+
+2013-10-14 00:00 +0200 Joe
+(3319) Ehen automatic creating a branch the contact is also created on the customer.
+ sales/manage/customers.php
+
+2013-10-13 21:11 +0200 Janusz Dobrowolski
+(3318) Customer Allocation Inquiry, Supplier Allocation Inquiry: fixed payment forms initialization, different icons for playment and allocation links.
+ config.default.php
+ includes/types.inc
+ purchasing/allocations/supplier_allocation_main.php
+ purchasing/inquiry/supplier_allocation_inquiry.php
+ purchasing/supplier_payment.php
+ sales/allocations/customer_allocation_main.php
+ sales/customer_payments.php
+ sales/inquiry/customer_allocation_inquiry.php
+ themes/aqua/images/alloc.png
+ themes/cool/images/alloc.png
+ themes/default/images/alloc.png
+
+2013-10-13 19:27 +0200 Janusz Dobrowolski
+(3317) Customer/Supplier Balances Reports: fixed error in recalculation to home currency value.
+ reporting/rep101.php
+ reporting/rep201.php
+
+2013-09-26 12:57 +0200 Joe
+(3316) Some documents views didn't show new lines in comments. Fixed.
+ includes/ui/ui_view.inc
+ purchasing/includes/db/po_db.inc
+ sales/view/view_sales_order.php
+
+2013-09-24 17:45 +0200 Janusz Dobrowolski
+(3315) Supplier Payment: small fix in fixed ui translation.
+ purchasing/supplier_payment.php
+
+2013-09-24 17:43 +0200 Janusz Dobrowolski
+(3314) Added portuguese translation for installer.
+ install/isession.inc
+ install/lang/pt_PT/LC_MESSAGES/pt_PT.mo
+ install/lang/pt_PT/LC_MESSAGES/pt_PT.po
+
+2013-09-24 13:24 +0200 Janusz Dobrowolski
+(3313) Bank Payment/Bank Deposit: removed sparse sign from settled amount input, fixed sign in AR/AP record;
+Fixed amounts displayed in header for customer/supplier bank payments.
+ gl/gl_bank.php
+ gl/includes/db/gl_db_banking.inc
+ gl/includes/ui/gl_bank_ui.inc
+ purchasing/includes/db/supp_trans_db.inc
+ sales/includes/db/cust_trans_db.inc
+
+2013-09-21 00:19 +0200 Janusz Dobrowolski
+(3312) Customer Payments, Payments to Supplier: improved readbility and multiply cleanups in payments allocations.
+ includes/banking.inc
+ includes/ui/allocation_cart.inc
+ purchasing/allocations/supplier_allocate.php
+ purchasing/includes/db/supp_trans_db.inc
+ purchasing/includes/db/suppalloc_db.inc
+ purchasing/includes/ui/invoice_ui.inc
+ purchasing/inquiry/supplier_allocation_inquiry.php
+ purchasing/supplier_payment.php
+ purchasing/view/view_supp_payment.php
+ sales/allocations/customer_allocate.php
+ sales/allocations/customer_allocation_main.php
+ sales/customer_payments.php
+ sales/includes/db/cust_trans_db.inc
+ sales/includes/db/custalloc_db.inc
+ sales/inquiry/customer_allocation_inquiry.php
+
+2013-09-20 16:03 +0200 Janusz Dobrowolski
+(3311) Fixed bug in bank history check resulting in false negative balance errors.
+ gl/includes/db/gl_db_bank_trans.inc
+
+2013-09-18 15:28 +0200 Janusz Dobrowolski
+(3310) Printer Profiles: fixed sql error on update under some MySQL versions.
+ admin/db/printers_db.inc
+
+2013-09-18 15:01 +0200 Janusz Dobrowolski
+(3309) Supplier Payment, Payments, Bank Transfer: fixed account balance limit checks.
+ gl/bank_transfer.php
+ gl/gl_bank.php
+ purchasing/supplier_payment.php
+
+2013-09-17 08:54 +0200 Janusz Dobrowolski
+(3308) Bank Transfer: fixed typo in input description.
+ gl/bank_transfer.php
+
+2013-09-17 10:31 +0200 Joe
+(3307) 0002443: Receipts and Remittances now show discounts.
+ reporting/rep112.php
+ reporting/rep210.php
+
+2013-09-16 23:27 +0200 Joe
+(3306) 0002177: Currency problem in Item Sales Summary Report
+ reporting/rep309.php
+
+2013-09-16 15:35 +0200 Janusz Dobrowolski
+(3305) [0002429] Supplier Invoice: tax was not updated on GRN line addition/removal.
+ purchasing/supplier_invoice.php
+
+2013-09-16 12:49 +0200 Janusz Dobrowolski
+(3304) [0002340] Fixed problem with login after intallation, when special chars are used in password.
+ install/isession.inc
+
+2013-09-14 18:07 +0200 Janusz Dobrowolski
+(3303) Various small code cleanups.
+ gl/bank_transfer.php
+ gl/includes/db/gl_db_banking.inc
+ purchasing/supplier_payment.php
+ sales/customer_payments.php
+ sales/inquiry/customer_inquiry.php
+
+2013-09-11 13:19 +0200 Janusz Dobrowolski
+(3302) Units of Measure: fixed edition problems when abbreviation contains special characters.
+ inventory/manage/item_units.php
+
+2013-09-06 10:48 +0200 Janusz Dobrowolski
+(3301) Page number is now printed on all documents (starting from second page).
+ reporting/includes/header2.inc
+
+2013-09-16 10:55 +0200 Joe
+(3300) 0002430: Order Status Listing Report shows invoiced in heading rather than delivered. Fixed.
+ reporting/rep105.php
+
+2013-09-05 14:39 +0200 Joe
+(3299) CHANGELOG.txt
+ CHANGELOG.txt
+
+2013-09-05 14:36 +0200 Joe
+(3298) Release 2.3.18.
+ version.php
+
+2013-09-05 14:17 +0200 Janusz Dobrowolski
+(3297) Updated gettext template.
+ lang/new_language_template/LC_MESSAGES/empty.po
+
+2013-09-03 08:51 +0200 Janusz Dobrowolski
+(3296) Customer Payment: fixed missing charge amount during edition, fixed submit button name.
+ includes/banking.inc
+ sales/customer_payments.php
+ sales/includes/db/cust_trans_db.inc
+ sales/includes/db/payment_db.inc
+ sales/view/view_receipt.php
+
+2013-09-02 13:28 +0200 Joe
+(3295) Bug no 2409 and 2410. Fixed headers and sql error when deleting a category.
+ admin/crm_categories.php
+
+2013-08-31 09:32 +0200 Janusz Dobrowolski
+(3294) Customer Payment: fixed bug with exchange rates resulting in invalid postings ts AR and foreign Exchange Gain Accounts.
+ sales/includes/db/payment_db.inc
+
+2013-08-29 22:18 +0200 Janusz Dobrowolski
+(3293) Delivery Against Sales Orders: sales orders displayed as overdue after delivery date.
+ sales/inquiry/sales_orders_view.php
+
+2013-08-29 21:13 +0200 Janusz Dobrowolski
+(3292) Customer Balances Report, Supplier Balances Report: balances in home currency were calculated using wrong exchange rates.
+ reporting/rep101.php
+ reporting/rep201.php
+
+2013-08-25 20:39 +0200 Janusz Dobrowolski
+(3291) Fixed problem with customer payment allocations (invalid exrate stored in debtor_trans record).
+ sales/includes/db/payment_db.inc
+
+2013-08-17 14:50 +0200 Janusz Dobrowolski
+(3290) Bank Transfer: fixed problem with entering transfer between accounts of the same currency.
+ gl/bank_transfer.php
+
+2013-08-14 23:56 +0200 Janusz Dobrowolski
+(3289) Added F4 hotkey for item popup editor in sales documents.
+ includes/ui/ui_lists.inc
+ sales/includes/ui/sales_order_ui.inc
+
+2013-08-14 09:34 +0200 Joe
+(3288) Customer/Supplier payments with amounts bigger than 1,000 was truncated. Fixed.
+ purchasing/supplier_payment.php
+ sales/customer_payments.php
+
+2013-08-01 23:50 +0200 Joe
+(3287) New global flags in config.default.php
+ update.html
+
+2013-08-01 12:35 +0200 Janusz Dobrowolski
+(3286) Langauage template update.
+ lang/new_language_template/LC_MESSAGES/empty.po
+
+2013-08-01 12:25 +0200 Joe
+(3285) CHANGELOG.txt
+ CHANGELOG.txt
+
+2013-08-01 12:23 +0200 Joe
+(3284) Release 2.3.17
+ version.php
+
+2013-07-30 13:05 +0200 Janusz Dobrowolski
+(3283) Change password: added current password verification.
+ admin/change_current_user_password.php
+
+2013-07-30 12:57 +0200 Janusz Dobrowolski
+(3282) Fixed CSRF warning after retrying password change.
+ includes/ui/ui_controls.inc
+
+2013-06-23 21:22 +0100 Maxime Bourget
+(3281) Added get_dispatchable_quantity hook.
+ includes/hooks.inc
+ includes/ui/ui_controls.inc
+ sales/customer_delivery.php
+
+2013-06-23 21:14 +0100 Maxime Bourget
+(3280) Updating sales order use UPDATE instead of DELETE/INSERT to preserve extra data added by extensions (if any)
+ sales/includes/db/sales_order_db.inc
+
+2013-06-23 21:13 +0100 Maxime Bourget
+(3279) Added missing db_write_hook in update sales order.
+ sales/includes/db/sales_order_db.inc
+
+2013-06-23 21:02 +0100 Maxime Bourget
+(3278) Improved db_pager widget sorting (now user column selection order is used).
+ includes/db_pager.inc
+
+2013-06-23 20:58 +0100 Maxime Bourget
+(3277) Improved db_pager::set_sql to use array as well as query string.
+ includes/db_pager.inc
+
+2013-06-23 20:54 +0100 Maxime Bourget
+(3276) Fixed qoh to return 0 instead of null when moves history is empty.
+ includes/db/inventory_db.inc
+
+2013-06-27 23:22 +0200 Joe
+(3275) Touch by mistake
+ .htaccess
+
+2013-06-27 22:59 +0200 Joe
+(3274) Fixed nested forms in Items tab.
+ inventory/cost_update.php
+ inventory/prices.php
+ inventory/purchasing_data.php
+ inventory/reorder_level.php
+
+2013-06-27 21:06 +0200 Janusz Dobrowolski
+(3273) Fixed bug in get_next_trans_no() resulting in invisibility of new stock movements entered after some transaction is voided (applies to location transfer and inventory adjustment).
+ includes/systypes.inc
+
+2013-06-26 22:11 +0200 Janusz Dobrowolski
+(3272) Fixed session handling bug resulting in blank page on some pre-5.2 php versions.
+ includes/session.inc
+
+2013-06-26 21:31 +0200 Janusz Dobrowolski
+(3271) Item Categories: categories table is now sorted by category description.
+ inventory/includes/db/items_category_db.inc
+
+2013-06-26 21:24 +0200 Janusz Dobrowolski
+(3270) Fixed mysql 5.0 issue in Print Statements report
+ reporting/rep108.php
+
+2013-06-10 20:47 +0200 Janusz Dobrowolski
+(3269) Fixed bug in voiding GRN/Purchase resulting in invalid average unit cost.
+ includes/db/inventory_db.inc
+ purchasing/includes/db/grn_db.inc
+
+2013-05-29 15:58 +0200 Janusz Dobrowolski
+(3268) Uniform display of exchange rate across aplication, added xr_provider_authoritative option, fixed bug in stored rate value.
+ config.default.php
+ gl/includes/db/gl_db_rates.inc
+ gl/includes/ui/gl_bank_ui.inc
+ includes/ui/ui_view.inc
+ purchasing/includes/ui/grn_ui.inc
+ purchasing/includes/ui/invoice_ui.inc
+ purchasing/includes/ui/po_ui.inc
+ sales/includes/ui/sales_credit_ui.inc
+ sales/includes/ui/sales_order_ui.inc
+
+2013-05-27 19:36 +0200 Janusz Dobrowolski
+(3267) Customer Payment, Supplier Payment: payments can be done in any currency and properly allocated to invoices; exchange rate field removes (bank arte calculated automatically)
+ js/payalloc.js
+ purchasing/includes/db/supp_payment_db.inc
+ purchasing/supplier_payment.php
+ sales/customer_payments.php
+ sales/includes/db/payment_db.inc
+
+2013-05-20 14:36 +0200 Janusz Dobrowolski
+(3266) Bank Transfer: additional field for target currency amount instead of exchange rate display.
+ gl/bank_transfer.php
+ gl/includes/db/gl_db_banking.inc
+
+2013-05-23 22:41 +0200 Janusz Dobrowolski
+(3265) Sales Delivery, Direct Invoice and Sales Credit: added exchange rate edition/storage on new transaction date.
+ sales/includes/cart_class.inc
+ sales/includes/db/sales_credit_db.inc
+ sales/includes/db/sales_delivery_db.inc
+ sales/includes/db/sales_invoice_db.inc
+ sales/includes/ui/sales_order_ui.inc
+ sales/sales_order_entry.php
+
+2013-05-23 15:18 +0200 Janusz Dobrowolski
+(3264) Direct GRN, GRN to PO, Direct Purchase Invoice: added exchange rate edition/storage on new transaction date.
+ purchasing/includes/db/grn_db.inc
+ purchasing/includes/db/invoice_db.inc
+ purchasing/includes/po_class.inc
+ purchasing/includes/supp_trans_class.inc
+ purchasing/includes/ui/grn_ui.inc
+ purchasing/includes/ui/invoice_ui.inc
+ purchasing/includes/ui/po_ui.inc
+ purchasing/po_entry_items.php
+ purchasing/po_receive_items.php
+
+2013-05-23 13:07 +0200 Janusz Dobrowolski
+(3263) Fixed exchange rate ui to be editable for new rates only, bank payment/deposit use amount in supplier/customer currency instead of rate.
+ gl/gl_bank.php
+ gl/includes/db/gl_db_banking.inc
+ gl/includes/db/gl_db_rates.inc
+ gl/includes/ui/gl_bank_ui.inc
+ includes/ui/ui_view.inc
+
+2013-05-20 14:41 +0200 Janusz Dobrowolski
+(3262) Fixing cookie.txt location during access to remote exchange rate server.
+ gl/includes/db/gl_db_rates.inc
+
+2013-06-10 17:40 +0200 Janusz Dobrowolski
+(3261) Small fix in javascript routines to avoid naming conflicts for form.action object.
+ js/utils.js
+
+2013-06-10 17:38 +0200 Janusz Dobrowolski
+(3260) faillog.php file moved to tmp subdir.
+ includes/session.inc
+
+2013-05-24 10:41 +0200 Janusz Dobrowolski
+(3259) Fix to tax overrides (warning in add_supp_invoice()).
+ purchasing/includes/db/invoice_db.inc
+
+2013-05-16 12:39 +0200 Janusz Dobrowolski
+(3258) Payments, Bank Transfer: Fixed payment limit checking bug.
+ gl/bank_transfer.php
+ gl/gl_bank.php
+
+2013-05-10 10:24 +0200 Janusz Dobrowolski
+(3257) Customer Credit Note: warning cleanup in write_credit_note().
+ sales/includes/db/sales_credit_db.inc
+
+2013-05-09 10:52 +0200 Janusz Dobrowolski
+(3256) Supplier Invoices, Direct Invoice, Supplier Credit Notes: added editable tax totals fields to fix variations in tax calculations on supplier side.
+ includes/ui/ui_view.inc
+ purchasing/includes/db/invoice_db.inc
+ purchasing/includes/po_class.inc
+ purchasing/includes/supp_trans_class.inc
+ purchasing/includes/ui/invoice_ui.inc
+ purchasing/includes/ui/po_ui.inc
+ purchasing/po_entry_items.php
+
+2013-05-09 10:43 +0200 Janusz Dobrowolski
+(3255) Fixed bug in cool theme renderer.php
+ themes/cool/renderer.php
+
+2013-05-09 21:51 +0200 Joe Hunt
+(3253) Inventory Purchasing Report. Variable, $stock_dec, not in scope. Fixed.
+ reporting/rep306.php
+
+2013-05-09 21:42 +0200 Joe Hunt
+(3252) Fixed a forgotton currency bug in GRN Valuation Report (rep305.php)
+ reporting/rep305.php
+
+2013-05-08 15:51 +0200 Janusz Dobrowolski
+(3251) Updated empty.po template.
+ lang/new_language_template/LC_MESSAGES/empty.po
+
+2013-05-08 14:42 +0200 Joe Hunt
+(3250) New language file, empty.po
+ lang/new_language_template/LC_MESSAGES/empty.po
+
+2013-05-08 13:51 +0200 Joe Hunt
+(3249) CHANGELOG updated.
+ CHANGELOG.txt
+
 2013-05-08 13:49 +0200 Joe Hunt
 (3248) Release 2.3.16
  update.html
index 799c91c175ff7f102c3b473cc7c7a6542f77ea5b..45294376db2c38bfc262a99fac70dd554ab62cf2 100644 (file)
@@ -125,7 +125,11 @@ function defaultCompany()
                // add all request variables to be resend together with login data
                if (!in_array($p, array('ui_mode', 'user_name_entry_field', 
                        'password', 'SubmitUser', 'company_login_name'))) 
-                       echo "<input type='hidden' name='$p' value='$val'>";
+                       if (!is_array($val))
+                               echo "<input type='hidden' name='$p' value='$val'>";
+                       else
+                               foreach($val as $i => $v)
+                                       echo "<input type='hidden' name='{$p}[$i]' value='$v'>";
        }
        end_form(1);
        $Ajax->addScript(true, "document.forms[0].password.focus();");
index 9859cc8cfcb12a3ab839a48aa0acfbd9d3a70104..c747669b3e63848d8a00142a6f22a15ab76b2212 100644 (file)
@@ -161,15 +161,15 @@ start_outer_table(TABLESTYLE2);
 
 table_section(1);
 
-text_row_ex(_("Name (to appear on reports):"), 'coy_name', 42, 50);
-textarea_row(_("Address:"), 'postal_address', $_POST['postal_address'], 35, 6);
+text_row_ex(_("Name (to appear on reports):"), 'coy_name', 50, 50);
+textarea_row(_("Address:"), 'postal_address', $_POST['postal_address'], 34, 6);
 text_row_ex(_("Domicile:"), 'domicile', 25, 55);
 
 text_row_ex(_("Phone Number:"), 'phone', 25, 55);
 text_row_ex(_("Fax Number:"), 'fax', 25);
-email_row_ex(_("Email Address:"), 'email', 25, 55);
+email_row_ex(_("Email Address:"), 'email', 50, 55);
 
-email_row_ex(_("BCC Address for all outgoing mails:"), 'bcc_email', 25, 55);
+email_row_ex(_("BCC Address for all outgoing mails:"), 'bcc_email', 50, 55);
 
 text_row_ex(_("Official Company Number:"), 'coy_no', 25);
 text_row_ex(_("GSTNo:"), 'gst_no', 25);
index 16434ecd163d46a2933014b4f6dd00797df62732..71081c5763e9b1f1ae0e992e90e85558d94c484d 100644 (file)
@@ -303,10 +303,12 @@ function db_import($filename, $connection, $force=true, $init=true, $protect=fal
 
        ini_set("max_execution_time", "180");
        db_query("SET foreign_key_checks=0");
+       $check_line_len = false;
        // uncrompress gziped backup files
        if (strpos($filename, ".gz") || strpos($filename, ".GZ"))
-               $lines = db_ungzip("lines", $filename);
-       elseif (strpos($filename, ".zip") || strpos($filename, ".ZIP"))
+       {       $lines = db_ungzip("lines", $filename);
+               $check_line_len = true;
+       } elseif (strpos($filename, ".zip") || strpos($filename, ".ZIP"))
                $lines = db_unzip("lines", $filename);
        else
                $lines = file("". $filename);
@@ -317,8 +319,9 @@ function db_import($filename, $connection, $force=true, $init=true, $protect=fal
 
        foreach($lines as $line_no => $line)
        {
+               $gzfile_bug = $check_line_len && (strlen($line) == 8190); // there is a bug in php (at least 4.1.1-5.5.9) gzfile which limits line length to 8190 bytes!
+
                $line = trim($line);
-               
                if ($init)
                        $line = str_replace("0_", $connection["tbpref"], $line);
 
@@ -351,8 +354,7 @@ function db_import($filename, $connection, $force=true, $init=true, $protect=fal
                 if($query_table != '')  // inside allowed query
                 {
                        $table = $query_table;
-
-                       if (substr($line, -strlen($delimiter)) == $delimiter) // end of query found
+                       if (!$gzfile_bug && substr($line, -strlen($delimiter)) == $delimiter) // end of query found 
                        {
                                $line = substr($line, 0, strlen($line) - strlen($delimiter)); // strip delimiter
                                $query_table = '';
index 79cda9b9911aaabbdc52770a66f8f1ef9c65dcda..a160f4488b100ecdc523afacd929db251323dfee 100644 (file)
@@ -72,7 +72,7 @@ if (isset($_POST['submit']) && can_process())
                'default_prompt_payment_act', 'default_inventory_act', 'default_cogs_act',
                'default_adj_act', 'default_inv_sales_act', 'default_assembly_act', 'legal_text',
                'past_due_days', 'default_workorder_required', 'default_dim_required', 'default_receival_required',
-               'default_delivery_required', 'grn_clearing_act', 'tax_algorithm',
+               'default_delivery_required', 'default_quote_valid_days', 'grn_clearing_act', 'tax_algorithm',
                'allow_negative_stock'=> 0, 'accumulate_shipping'=> 0,
                'po_over_receive' => 0.0, 'po_over_charge' => 0.0, 'default_credit_limit'=>0.0
 )));
@@ -98,6 +98,11 @@ if (get_company_pref('default_receival_required') === null) { // new in 2.4 inst
        refresh_sys_prefs();
 }
 
+if (get_company_pref('default_quote_valid_days') === null) { // available from 2.3.23, can be not defined on pre-2.4 installations
+       set_company_pref('default_quote_valid_days', 'glsetup.sales', 'smallint', 6, 30);
+       refresh_sys_prefs();
+}
+
 $myrow = get_company_prefs();
 
 $_POST['retained_earnings_act']  = $myrow["retained_earnings_act"];
@@ -137,6 +142,7 @@ $_POST['default_workorder_required'] = $myrow['default_workorder_required'];
 $_POST['default_dim_required'] = $myrow['default_dim_required'];
 $_POST['default_delivery_required'] = $myrow['default_delivery_required'];
 $_POST['default_receival_required'] = $myrow['default_receival_required'];
+$_POST['default_quote_valid_days'] = $myrow['default_quote_valid_days'];
 
 //---------------
 
@@ -183,6 +189,8 @@ gl_all_accounts_list_row(_("Sales Discount Account:"), 'default_sales_discount_a
 
 gl_all_accounts_list_row(_("Prompt Payment Discount Account:"), 'default_prompt_payment_act');
 
+text_row(_("Quote Valid Days:"), 'default_quote_valid_days', $_POST['default_quote_valid_days'], 6, 6, '', "", _("days"));
+
 text_row(_("Delivery Required By:"), 'default_delivery_required', $_POST['default_delivery_required'], 6, 6, '', "", _("days"));
 
 //---------------
index d533944f71c466e045c5cd2b335effc0fb789d6c..71fedd5b7e3e192d103484720fe9c5f411a4282e 100644 (file)
@@ -77,7 +77,7 @@ function display_languages()
 
                $support = $GetText->check_support($lang, $charset);
 
-               if (function_exists('gettext') && !$support && !get_post('DisplayAll')) continue;
+               if (function_exists('gettext') && !$support && !get_post('DisplayAll') && $lang != 'C') continue;
 
                label_cell($lang);
                label_cell($available ? get_package_view_str($lang, $lang_name) : $lang_name);
index c1de0027fc1659d372f878b325dbca6a0f391678..135e0068cd013819365b6d81c1447f8ec417ab32 100644 (file)
@@ -93,16 +93,25 @@ if (($Mode=='ADD_ITEM' || $Mode=='UPDATE_ITEM') && check_csrf_token())
 
 if ($Mode == 'Delete' && check_csrf_token())
 {
-       delete_user($selected_id);
-       display_notification_centered(_("User has been deleted."));
-       $Mode = 'RESET';
+       $cancel_delete = 0;
+    if (key_in_foreign_table($selected_id, 'audit_trail', 'user'))
+    {
+        $cancel_delete = 1;
+        display_error(_("Cannot delete this user because entries are associated with this user."));
+    }
+    if ($cancel_delete == 0) 
+    {
+       delete_user($selected_id);
+       display_notification_centered(_("User has been deleted."));
+    } //end if Delete group
+    $Mode = 'RESET';
 }
 
 //-------------------------------------------------------------------------------------------------
 if ($Mode == 'RESET')
 {
        $selected_id = -1;
-       $sav = get_post('show_inactive');
+       $sav = get_post('show_inactive', null);
        unset($_POST);  // clean all input fields
        $_POST['show_inactive'] = $sav;
 }
index df15f21f82a1e0b0f85df295e48670c4e580fac1..2588a81e30e348063c466966579c36f3553ab922 100644 (file)
@@ -176,6 +176,9 @@ if (!isset($path_to_root) || isset($_GET['path_to_root']) || isset($_POST['path_
 
        $config_allocation_settled_allowance = 0.005;
 
+       /* Show average costed values instead of fixed standard cost in report, Inventory Valuation Report */
+       $use_costed_values = 0; 
+       
        /* Allow negative prices for dummy/service items. To be moved to GL db settings */
        $allow_negative_prices = 1;
 
@@ -192,6 +195,9 @@ if (!isset($path_to_root) || isset($_GET['path_to_root']) || isset($_POST['path_
     /* Whether to allow sending new password by e-mail */
     $allow_password_reset = false;
 
+    /* Print Item Images on Sales Quotations. Set to 1 if so. */
+    $print_item_images_on_quote = 0;
+
        /* for uploaded item pictures */
        $pic_width              = 80;
        $pic_height     = 50;
@@ -201,6 +207,9 @@ if (!isset($path_to_root) || isset($_GET['path_to_root']) || isset($_POST['path_
           Pallete skin attributes set in reporting/includes/class.graphic.inc */
        $graph_skin     = 1;
 
+       /* UTF-8 font for Business Graphics. Copy it to /reporting/fonts/ folder. */
+       $UTF8_fontfile  = "FreeSans.ttf";
+
 /*     
        Before upgrade from pre-2.2 FA you have to move here your customized
        security roles definitions. If you have used standard roles, you
index f88801526b63b82531213861d15b60ebe8098eb5..62900fc3ddeaac1bea4004b40047526eb3f406a9 100644 (file)
@@ -177,8 +177,8 @@ function check_bank_account_history($delta_amount, $bank_account, $date=null, $u
        if (!isset($balance) && isset($date))
                return null;    // unlimited account
 
-       if ($balance < -$delta_amount)
-               return array('amount' => $balance, 'trans_date'=> $date);
+       if (floatcmp($balance, -$delta_amount) < 0)
+               return array('amount' => $balance - $delta_amount, 'trans_date'=> $date);
 
        $balance += $delta_amount;
 
index 4988ff4c6632cb02ec52fd50463926f2d84156a6..70ab230a630b3e2758ed64080b3fe675ca8cb8f8 100644 (file)
@@ -112,7 +112,7 @@ function get_extern_rate($curr_b, $provider = 'ECB', $date)
        if ($provider == 'ECB')
        {
                $filename = "/stats/eurofxref/eurofxref-daily.xml";
-               $site = "www.ecb.int";
+               $site = "www.ecb.europa.eu";
        }
        elseif ($provider == 'YAHOO')
        {
@@ -141,15 +141,15 @@ function get_extern_rate($curr_b, $provider = 'ECB', $date)
               curl_setopt ($ch, CURLOPT_COOKIEJAR, "$path_to_root/tmp/cookie.txt");
           curl_setopt ($ch, CURLOPT_HEADER, 0);
               curl_setopt ($ch, CURLOPT_RETURNTRANSFER, 1);
-              // prevent warning while save_mode/open_basedir on (redireciton doesn't occur at least on ECB page)
-                  if (!ini_get('save_mode') && !ini_get('open_basedir'))
+              // prevent warning while safe_mode/open_basedir on (redireciton doesn't occur at least on ECB page)
+                  if (!ini_get('safe_mode') && !ini_get('open_basedir'))
                curl_setopt ($ch, CURLOPT_FOLLOWLOCATION, 1);
               curl_setopt ($ch, CURLOPT_TIMEOUT, 3);
           $contents = curl_exec ($ch);
               curl_close($ch);
                        // due to resolver bug in some curl versions (e.g. 7.15.5) 
                        // try again for constant IP.
-                  $site="195.128.2.97";
+                  $site="172.230.157.137";
           } while( ($contents == '') && $retry--);
           
        } else {
index 696903f9b807ad091ecd7d2f2727c5f62aefd2af..131ea413102c445178d302e43d17b8c2c7d01c62 100644 (file)
@@ -324,7 +324,7 @@ class tar_file extends archive
                        {
                                $temp = unpack("a100name/a8mode/a8uid/a8gid/a12size/a12mtime/a8checksum/a1type/a100symlink/a6magic/a2temp/a32temp/a32temp/a8temp/a8temp/a155prefix/a12temp", $block);
                                $file = array (
-                                       'name' => $temp['prefix'] . $temp['name'],
+                                       'name' => rtrim($temp['prefix']) . rtrim($temp['name']),
                                        'stat' => array (
                                                2 => octdec($temp['mode']),
                                                4 => octdec($temp['uid']),
index 2960d567b8823350d4c5f18ace5345a1543d6851..1c4d8d0740dcb866d441b2585abc49e1698be803 100644 (file)
@@ -9,46 +9,77 @@
     MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  
     See the License here <http://www.gnu.org/licenses/gpl-3.0.html>.
 ***********************************************************************/
-function get_qoh_on_date($stock_id, $location=null, $date_=null, $exclude=0)
+function get_qoh_on_date($stock_id, $location=null, $date_=null)
 {
     if ($date_ == null)
-    {
-        $sql = "SELECT SUM(qty) FROM ".TB_PREF."stock_moves
-            WHERE stock_id=".db_escape($stock_id);
         $date_ = Today();
-        $date = date2sql($date_);
-    }
-    else
-    {
-        $date = date2sql($date_);
-        $sql = "SELECT SUM(qty) FROM ".TB_PREF."stock_moves
+
+    $date = date2sql($date_);
+
+    $sql = "SELECT SUM(qty) FROM ".TB_PREF."stock_moves
             WHERE stock_id=".db_escape($stock_id)."
             AND tran_date <= '$date'"; 
-    }
-        
+
     if ($location != null)
         $sql .= " AND loc_code = ".db_escape($location);
 
-    $result = db_query($sql, "QOH calulcation failed");
+    $result = db_query($sql, "QOH calculation failed");
 
     $myrow = db_fetch_row($result);
-    if ($exclude > 0)
-    {
-        $sql = "SELECT SUM(qty) FROM ".TB_PREF."stock_moves
-            WHERE stock_id=".db_escape($stock_id)
-            ." AND type=".db_escape($exclude)
-            ." AND tran_date = '$date'";
-
-        $result = db_query($sql, "QOH calulcation failed");
-        $myrow2 = db_fetch_row($result);
-        if ($myrow2 !== false)
-            $myrow[0] -= $myrow2[0];
-    }
 
     $qoh =  $myrow[0];
                return $qoh ? $qoh : 0;
 }
 
+/**
+*      Check whether change in stock on date would not cause negative qoh in stock history.
+*      Returns null on success or max. available quantity with respective date otherwise.
+*   Running balance is checked on daily basis only, as we do not control time of transaction.
+*
+*      $delta_qty - tested change in stock qty at $date.
+*      $date - check date; when set to null checks all the stock history.
+**/
+
+function check_negative_stock($stock_id, $delta_qty, $location=null, $date=null)
+{
+
+       if ($delta_qty >= 0)
+                return null;   // qty increese is always safe
+
+       if (!isset($date))
+               $date = Today();
+
+       $date = date2sql($date);
+
+       // check stock status on date
+    $sql = "SELECT SUM(qty) qty, '$date' tran_date FROM ".TB_PREF."stock_moves
+            WHERE stock_id=".db_escape($stock_id)."
+            AND tran_date <= '$date'"; 
+
+    if ($location)
+        $sql .= " AND loc_code = ".db_escape($location);
+
+    $result = db_query($sql, "QOH calculation failed");
+    $qos = db_fetch_assoc($result);
+
+       // check also all stock changes after the date to avoid negative stock in future
+       $sql = TB_PREF."stock_moves WHERE stock_id=".db_escape($stock_id) . " AND tran_date > '$date'";
+
+       if ($location)
+               $sql .= " AND loc_code=".db_escape($location);
+
+       $rt = running_total_sql($sql, 'qty', 'tran_date');
+
+       $sql = "SELECT  {$qos['qty']}+total qty, tran_date FROM ($rt) stock_status ORDER by total, tran_date";
+       $history = db_query($sql, 'cannot check stock history');
+       $min_qos = db_fetch($history);
+
+       if ($min_qos && ($min_qos['qty'] < $qos['qty']))
+               $qos = $min_qos;
+
+       return  -$delta_qty > $qos['qty'] ? $qos : null;
+}
+
 //--------------------------------------------------------------------------------------
 
 function get_item_edit_info($stock_id)
index 637ef4b9e25a558b80bca1fa4f4000e15613013a..bfd4070468eb004d0b5ef9ec29e82411c70cc051 100644 (file)
@@ -41,7 +41,7 @@ function load_stock_levels($location)
        $sql = "SELECT stock_id, SUM(qty) FROM ".TB_PREF."stock_moves WHERE tran_date <= '$date'";
        if ($location != '') $sql .= " AND loc_code = ".db_escape($location);
        $sql .= " GROUP BY stock_id";
-       $result = db_query($sql, "QOH calulcation failed");
+       $result = db_query($sql, "QOH calculation failed");
        while ($row = db_fetch($result)) {
                $qoh_stock[$row[0]] = $row[1];
        }
@@ -109,7 +109,7 @@ function get_demand_asm_qty($stock_id, $location)
                $sql .= TB_PREF."sales_orders.from_stk_loc =".db_escape($location)." AND ";
        $sql .= TB_PREF."sales_order_details.quantity-".TB_PREF."sales_order_details.qty_sent > 0 AND
                                   ".TB_PREF."stock_master.stock_id=".TB_PREF."sales_order_details.stk_code AND
-                                  (".TB_PREF."stock_master.mb_flag='M' OR ".TB_PREF."stock_master.mb_flag='A')
+                                  ".TB_PREF."stock_master.mb_flag='M'
                                   GROUP BY ".TB_PREF."sales_order_details.stk_code";
     $result = db_query($sql, "No transactions were returned");
        while ($row = db_fetch_row($result)) {
@@ -161,7 +161,7 @@ function get_on_worder_qty($stock_id, $location)
        else
                $qoo = 0.0;
        $flag = get_mb_flag($stock_id);
-       if ($flag == 'A' || $flag == 'M')
+       if ($flag == 'M')
        {
                $sql = "SELECT SUM((".TB_PREF."workorders.units_reqd-".TB_PREF."workorders.units_issued)) AS qoo
                        FROM ".TB_PREF."workorders 
index febc3af824e4f1246be0f9659a7a6aced26616ab..aead5d376e8c2f415925324f39dae6848dee46ce 100644 (file)
@@ -59,4 +59,21 @@ function update_record_status($id, $status, $table, $key) {
                
        db_query($sql, "Can't update record status");
 }
-?>
+//-----------------------------------------------------------------------------
+//
+//     Helper for sql subquery returning running totals from delta tables like stock_moves or bank_trans
+//
+//     $table - table name with optional WHERE clause
+//  $column - delta column
+//     $index  - comma delimited list of columns for total grouping and order
+//  Returns running totals with respective index column
+//
+function running_total_sql($table, $column, $index)
+{
+
+       return "SELECT daily.$index, daily.$column, (@total:=@total+daily.$column) total 
+               FROM
+                       (SELECT $index, sum($column) $column FROM $table GROUP BY $index ORDER BY $index) daily,
+                       (SELECT @total:=0) total_var";
+}
+
index 86bfac2b0cd3fee9641c0c8bc188a2041e103a61..1102271b658094677b6522362ce5bcf942cb7431 100644 (file)
@@ -62,7 +62,8 @@ function error_handler($errno, $errstr, $file, $line) {
        // Please use restrainedly to not risk loss of important messages
        $excluded_warnings = array(
                'html_entity_decode', 'htmlspecialchars',       // nevermind encodings, special chars are processed anyway
-               'should be compatible with that'                        // ignore cpdf/frontreport wrapper warnings
+               'should be compatible with that',                       // ignore cpdf/frontreport wrapper warnings
+               'mysql extension is deprecated'                         // ignore strict warning in 5.4
        );
        foreach($excluded_warnings as $ref) {
                if (strpos($errstr, $ref) !== false) {
index 3c8613cb4a8323bfd1c811b145503b2d3ffa9d96..426d3a78fcbd3512ca4996a38911f02f11d3be21 100644 (file)
@@ -56,6 +56,11 @@ class sys_prefs
                return $this->prefs['default_workorder_required'];
        }
 
+       function default_quote_valid_days() 
+       {
+               return $this->prefs['default_quote_valid_days'];
+       }
+
        function default_delivery_required_by() 
        {
                return $this->prefs['default_delivery_required'];
index 04518e7b7a12040e6560b4a0da8edcebf1bbbec9..697bb48da6823fed173a4c44d391f7715abe1d2c 100644 (file)
@@ -37,7 +37,7 @@ class SessionManager
                                // Reset session data and regenerate id
                                $_SESSION = array();
                                $_SESSION['IPaddress'] = $_SERVER['REMOTE_ADDR'];
-                               $_SESSION['userAgent'] = $_SERVER['HTTP_USER_AGENT'];
+                               $_SESSION['userAgent'] = @$_SERVER['HTTP_USER_AGENT'];
                                $this->regenerateSession();
 
                        // Give a 5% chance of the session id changing on any request
@@ -63,7 +63,7 @@ class SessionManager
                if ($_SESSION['IPaddress'] != $_SERVER['REMOTE_ADDR'])
                        return false;
 
-               if ( $_SESSION['userAgent'] != $_SERVER['HTTP_USER_AGENT'])
+               if ( $_SESSION['userAgent'] != @$_SERVER['HTTP_USER_AGENT'])
                        return false;
 
                return true;
@@ -316,7 +316,7 @@ function html_cleanup(&$parms)
                if (is_array($value))
                        html_cleanup($parms[$name]);
                else
-                       $parms[$name] = @htmlspecialchars($value, ENT_QUOTES, $_SESSION['language']->encoding);
+                       $parms[$name] = @htmlspecialchars($value, ENT_QUOTES, $_SESSION['language']->encoding=='iso-8859-2' ? 'ISO-8859-1' : $_SESSION['language']->encoding);
        }
        reset($parms); // needed for direct key() usage later throughout the sources
 }
@@ -488,7 +488,8 @@ if (!defined('FA_LOGOUT_PHP_FILE')){
                {
                        // strip ajax marker from uri, to force synchronous page reload
                        $_SESSION['timeout'] = array( 'uri'=>preg_replace('/JsHttpRequest=(?:(\d+)-)?([^&]+)/s',
-                                       '', @htmlspecialchars($_SERVER['REQUEST_URI'], ENT_QUOTES, $_SESSION['language']->encoding)), 
+                                       '', @htmlspecialchars($_SERVER['REQUEST_URI'], ENT_QUOTES, $_SESSION['language']->encoding=='iso-8859-2'
+                                                ? 'ISO-8859-1' : $_SESSION['language']->encoding)), 
                                'post' => $_POST);
 
                        include($path_to_root . "/access/login.php");
index 25101807d61c6b26b04448e5ce2a7b3b1e871edc..d3c2febf98f404ce67ab20edfb1cb78674022647 100644 (file)
@@ -81,15 +81,32 @@ class items_cart
                return count($this->line_items);
        }
 
+       /*
+               Checks cart quantities on document_date.
+               Returns array of stock_ids which stock quantities would go negative on some day.
+       */
        function check_qoh($location, $date_, $reverse=false)
        {
+               $low_stock = array();
+
+               // collect quantities by stock_id
+               $qtys = array();
                foreach ($this->line_items as $line_no => $line_item)
                {
-                       $item_ret = $line_item->check_qoh($location, $date_, $reverse);
-                       if ($item_ret != null)
-                               return $line_no;
+                       $qty = $reverse ? -$line_item->quantity : $line_item->quantity;
+
+                       $qtys[$line_item->stock_id]['qty'] = $qty + @$qtys[$line_item->stock_id]['qty'];
+                       $qtys[$line_item->stock_id]['line'] = $line_no;
                }
-               return -1;
+
+               foreach($qtys as $stock_id => $sum)
+               {
+                       $fail = check_negative_stock($stock_id, $sum['qty'], $location, $date_);
+                       if ($fail)
+                               $low_stock[] = $stock_id;
+               }
+
+               return $low_stock;
        }
 
        // ----------- GL item functions
@@ -240,10 +257,14 @@ class line_item
                $this->price = 0;
        }
 
+       /*
+               This method is generally obsolete and subject to removal in FA 2.4 (preserved for now to support 2.3 extensions).
+               Use items_cart::check_qoh instead.
+       */
        function check_qoh($location, $date_, $reverse)
        {
                global $SysPrefs;
-               
+
        if (!$SysPrefs->allow_negative_stock())
        {
                        if (has_stock_holding($this->mb_flag))
@@ -255,11 +276,9 @@ class line_item
                                if ($quantity >= 0)
                                        return null;
 
-                               $qoh = get_qoh_on_date($this->stock_id, $location, $date_);
-                       if ($quantity + $qoh < 0)
-                       {
-                               return $this;
-                       }
+                               $fail = check_negative_stock($this->stock_id, $quantity, $location, $date_);
+                               if ($fail)
+                                       return $this;
                }
        }
 
index 42644a98339e698150e4af0c7338ac4c0bc76d88..7b21ec09a272e4fe6274ae71529bb4f072543279 100644 (file)
@@ -450,6 +450,7 @@ function supplier_list($name, $selected_id=null, $spec_option=false, $submit_on_
            'order' => array('supp_ref'),
                'search_box' => $mode!=0,
                'type' => 1,
+        'search' => array("supp_ref","supp_name","gst_no"),        
                'spec_option' => $spec_option === true ? _("All Suppliers") : $spec_option,
                'spec_id' => $all_items,
                'select_submit'=> $submit_on_change,
@@ -502,6 +503,7 @@ function customer_list($name, $selected_id=null, $spec_option=false, $submit_on_
                'search_box' => $mode!=0,
                'type' => 1,
                'size' => 20,
+        'search' => array("debtor_ref","name","tax_id"),        
                'spec_option' => $spec_option === true ? _("All Customers") : $spec_option,
                'spec_id' => $all_items,
                'select_submit'=> $submit_on_change,
index 18f26096f98c27f8fdad4536f12d5f8042fa120e..94e10b30d09b9c09d71a296d3d422d94e50d10ae 100644 (file)
@@ -80,7 +80,7 @@ function handle_new_order()
 
 function can_process()
 {
-       global $Refs;
+       global $Refs, $SysPrefs;
 
        $adj = &$_SESSION['adj_items'];
 
@@ -114,16 +114,16 @@ function can_process()
                display_error(_("The entered date is out of fiscal year or is closed for further data entry."));
                set_focus('AdjDate');
                return false;
-       } else {
-               $failed_item = $adj->check_qoh($_POST['StockLocation'], $_POST['AdjDate'], !$_POST['Increase']);
-               if ($failed_item >= 0) 
+       }
+       elseif (!$SysPrefs->allow_negative_stock())
+       {
+               $low_stock = $adj->check_qoh($_POST['StockLocation'], $_POST['AdjDate'], !$_POST['Increase']);
+
+               if ($low_stock)
                {
-                       $line = $adj->line_items[$failed_item];
-               display_error(_("The adjustment cannot be processed because an adjustment item would cause a negative inventory balance :") .
-                       " " . $line->stock_id . " - " .  $line->item_description);
-                       $_POST['Edit'.$failed_item] = 1; // enter edit mode
+               display_error(_("The adjustment cannot be processed because it would cause negative inventory balance for marked items as of document date or later."));
                        unset($_POST['Process']);
-               return false;
+                       return false;
                }
        }
        return true;
@@ -141,6 +141,7 @@ if (isset($_POST['Process']) && can_process()){
        unset($_SESSION['adj_items']);
 
        meta_forward($_SERVER['PHP_SELF'], "AddedID=$trans_no");
+
 } /*end of process credit note */
 
 //-----------------------------------------------------------------------------------------------
index f9ecd6f314de160d939ff1969ee42b84e658775a..6e95c2574fe781978a9cdcf6dc700bf639b0bf92 100644 (file)
@@ -130,7 +130,7 @@ function add_stock_adjustment_item($adj_id, $stock_id, $location, $date_, $type,
        update_average_material_cost(null, $stock_id, $standard_cost, $quantity, $date_);
 
        add_stock_move(ST_INVADJUST, $stock_id, $adj_id, $location,
-        $date_, $reference, $quantity, $standard_cost, $type);
+        $date_, $reference, $quantity, $standard_cost);
 
        if ($standard_cost > 0)
        {
index b54c1980748d8e7e06e4076c4789d3c416d9ad87..cf72ee342f727b48b2b87f7f74a8a6c8f8b9457f 100644 (file)
@@ -70,6 +70,8 @@ function stock_cost_update($stock_id, $material_cost, $labour_cost, $overhead_co
 
                        add_gl_trans_std_cost(ST_COSTUPDATE, $update_no, $date_, $stock_gl_code["inventory_account"], 0, 0, $memo_, 
                                $value_of_change);
+
+                       change_stock_moves_std_cost($stock_id, $date_, $new_cost - $last_cost); 
                }
        }
 
@@ -82,4 +84,11 @@ function stock_cost_update($stock_id, $material_cost, $labour_cost, $overhead_co
 
 //-------------------------------------------------------------------------------------------------------------
 
+function change_stock_moves_std_cost($stock_id, $date, $diff_cost)
+{
+       $date = date2sql($date);
+       $sql = "UPDATE ".TB_PREF."stock_moves SET standard_cost = standard_cost + ".db_escape($diff_cost). " WHERE stock_id = "
+       .       db_escape($stock_id)." AND tran_date <= '$date' AND qty <> 0 AND standard_cost > 0.001 AND type <> ".ST_LOCTRANSFER;
+       db_query($sql,"The stock moves cost details for the inventory item could not be updated");
+}
 ?>
\ No newline at end of file
index 6da83936d00aea7fbd0d5ca19a81444c6d73e462..0acd090081c006b3cd9324e8af25a23cc8c5b295 100644 (file)
@@ -67,10 +67,10 @@ function add_stock_transfer_item($transfer_id, $stock_id, $location_from, $locat
        $date_, $type, $reference, $quantity)
 {
        add_stock_move(ST_LOCTRANSFER, $stock_id, $transfer_id, $location_from,
-               $date_, $reference, -$quantity, 0, $type);
+               $date_, $reference, -$quantity, 0);
 
        add_stock_move(ST_LOCTRANSFER, $stock_id, $transfer_id, $location_to,
-               $date_, $reference, $quantity, 0, $type);
+               $date_, $reference, $quantity, 0);
 
 }
 
index f7af3dadcae60659f001def954399693757bd789..12571b8ac92e91454dc501738dcbe934f1ef341c 100644 (file)
@@ -17,7 +17,7 @@ include_once($path_to_root . "/includes/ui/items_cart.inc");
 function add_to_order(&$order, $new_item, $new_item_qty, $standard_cost)
 {
     if ($order->find_cart_item($new_item))
-         display_error(_("For Part :") . $new_item . " " . "This item is already on this order.  You can change the quantity ordered of the existing line if necessary.");
+         display_error(_("For Part :") . $new_item . " " . "This item is already on this document. You can change the quantity on the existing line if necessary.");
        else
          $order->add_to_cart (count($order->line_items), $new_item, $new_item_qty, $standard_cost);
 }
@@ -67,6 +67,7 @@ function display_adjustment_items($title, &$order)
        $total = 0;
        $k = 0;  //row colour counter
 
+       $low_stock = $order->check_qoh($_POST['StockLocation'], $_POST['AdjDate'], !$_POST['Increase']);
        $id = find_submit('Edit');
        foreach ($order->line_items as $line_no=>$stock_item)
        {
@@ -75,7 +76,10 @@ function display_adjustment_items($title, &$order)
 
                if ($id != $line_no)
                {
-               alt_table_row_color($k);
+                       if (in_array($stock_item->stock_id, $low_stock))
+                               start_row("class='stockmankobg'");      // notice low stock status
+                       else 
+                               alt_table_row_color($k);
 
                        view_stock_status_cell($stock_item->stock_id);
                        label_cell($stock_item->item_description);
@@ -102,6 +106,8 @@ function display_adjustment_items($title, &$order)
        label_row(_("Total"), number_format2($total,user_price_dec()), "align=right colspan=5", "align=right", 2);
 
     end_table();
+       if ($low_stock)
+               display_note(_("Marked items have insufficient quantities in stock as on day of adjustment."), 0, 1, "class='stockmankofg'");
        div_end();
 }
 
index 474fc9df31c692df9d9ee1fbf493365a47797190..026e0b6e07c7ff7b08f19521cb48488c40851c49 100644 (file)
@@ -17,7 +17,7 @@ include_once($path_to_root . "/includes/ui/items_cart.inc");
 function add_to_order(&$order, $new_item, $new_item_qty, $standard_cost)
 {
     if ($order->find_cart_item($new_item))
-         display_error(_("For Part :") . $new_item . " " . "This item is already on this order.  You can change the quantity ordered of the existing line if necessary.");
+         display_error(_("For Part :") . $new_item . " " . "This item is already on this document. You can change the quantity on the existing line if necessary.");
        else
          $order->add_to_cart (count($order->line_items), $new_item, $new_item_qty, $standard_cost);
 }
@@ -63,13 +63,17 @@ function display_transfer_items($title, &$order)
        $subtotal = 0;
        $k = 0;  //row colour counter
 
+       $low_stock = $order->check_qoh($_POST['FromStockLocation'], $_POST['AdjDate'], true);
        $id = find_submit('Edit');
        foreach ($order->line_items as $line_no=>$stock_item)
        {
 
                if ($id != $line_no)
                {
-               alt_table_row_color($k);
+                       if (in_array($stock_item->stock_id, $low_stock))
+                               start_row("class='stockmankobg'");      // notice low stock status
+                       else 
+                               alt_table_row_color($k);
 
                        view_stock_status_cell($stock_item->stock_id);
                label_cell($stock_item->item_description);
@@ -92,6 +96,8 @@ function display_transfer_items($title, &$order)
                transfer_edit_item_controls($order);
 
     end_table();
+       if ($low_stock)
+               display_note(_("Marked items have insufficient quantities in stock as on day of transfer."), 0, 1, "class='stockmankofg'");
        div_end();
 }
 
index 21b3f64176a80cca58f0f75dc8a54559df57aa02..4a762e620541c84312f89f5bdeec943d7c29406c 100644 (file)
@@ -199,12 +199,12 @@ else
 text_row_ex(_("Location Name:"), 'location_name', 50, 50);
 text_row_ex(_("Contact for deliveries:"), 'contact', 30, 30);
 
-textarea_row(_("Address:"), 'delivery_address', null, 35, 5);  
+textarea_row(_("Address:"), 'delivery_address', null, 34, 5);  
 
 text_row_ex(_("Telephone No:"), 'phone', 32, 30);
 text_row_ex(_("Secondary Phone Number:"), 'phone2', 32, 30);
 text_row_ex(_("Facsimile No:"), 'fax', 32, 30);
-email_row_ex(_("E-mail:"), 'email', 30);
+email_row_ex(_("E-mail:"), 'email', 50);
 
 end_table(1);
 submit_add_or_update_center($selected_id == -1, '', 'both');
index 874d7bff79b344e9a8e61e67d6fd3dc8b7274f36..0da6d7559f6da5f200e46b46b2bd27489411caf1 100644 (file)
@@ -76,7 +76,6 @@ function handle_new_order()
 
 if (isset($_POST['Process']))
 {
-       global $Refs;
 
        $tr = &$_SESSION['transfer_items'];
        $input_error = 0;
@@ -84,7 +83,7 @@ if (isset($_POST['Process']))
        if (count($tr->line_items) == 0)        {
                display_error(_("You must enter at least one non empty item line."));
                set_focus('stock_id');
-               return false;
+               $input_error = 1;
        }
        if (!$Refs->is_valid($_POST['ref'])) 
        {
@@ -115,17 +114,14 @@ if (isset($_POST['Process']))
                display_error(_("The locations to transfer from and to must be different."));
                set_focus('FromStockLocation');
                $input_error = 1;
-       } 
-       else 
+       }
+       elseif (!$SysPrefs->allow_negative_stock())
        {
-               $failed_item = $tr->check_qoh($_POST['FromStockLocation'], $_POST['AdjDate'], true);
-               if ($failed_item >= 0) 
+               $low_stock = $tr->check_qoh($_POST['FromStockLocation'], $_POST['AdjDate'], true);
+
+               if ($low_stock)
                {
-                       $line = $tr->line_items[$failed_item];
-               display_error(_("The quantity entered is greater than the available quantity for this item at the source location :") .
-                       " " . $line->stock_id . " - " .  $line->item_description);
-               echo "<br>";
-                       $_POST['Edit'.$failed_item] = 1; // enter edit mode
+               display_error(_("The transfer cannot be processed because it would cause negative inventory balance in source location for marked items as of document date or later."));
                        $input_error = 1;
                }
        }
index 3448c86949691da79ffa36722467b7e72b8caadc..0dd141650f64203d2f864004ae8fd926f0d11728 100644 (file)
@@ -1,11 +1,11 @@
 /**********************************************************************
     Copyright (C) FrontAccounting, LLC.
-       Released under the terms of the GNU General Public License, GPL, 
-       as published by the Free Software Foundation, either version 3 
+       Released under the terms of the GNU General Public License, GPL,
+       as published by the Free Software Foundation, either version 3
        of the License, or (at your option) any later version.
     This program is distributed in the hope that it will be useful,
     but WITHOUT ANY WARRANTY; without even the implied warranty of
-    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  
+    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
     See the License here <http://www.gnu.org/licenses/gpl-3.0.html>.
 ***********************************************************************/
 var _focus;
@@ -46,7 +46,7 @@ function _expand(tabobj) {
 
   if (ul.getAttribute("rel")){
        for (var i=0; i<alltabs.length; i++){
-         alltabs[i].className = "ajaxbutton"  //deselect all tabs
+         alltabs[i].className = "ajaxbutton"  //deselect all tabs // Review CP 2014-11 This will remove all other classes from the element.
        }
        tabobj.className = "current";
        JsHttpRequest.request(tabobj)
@@ -61,17 +61,17 @@ function expandtab(tabcontentid, tabnumber) {
 
 function _set_combo_input(e) {
                e.setAttribute('_last', e.value);
-               e.onblur=function() { 
+               e.onblur=function() {
                  var but_name = this.name.substring(0, this.name.length-4)+'button';
                  var button = document.getElementsByName(but_name)[0];
                  var select = document.getElementsByName(this.getAttribute('rel'))[0];
                  save_focus(select);
-// submit request if there is submit_on_change option set and 
+// submit request if there is submit_on_change option set and
 // search field has changed.
-               
+
                  if (button && (this.value != this.getAttribute('_last'))) {
                        JsHttpRequest.request(button);
-                 } else if(this.className=='combo2') {
+                 } else if(string_contains(this.className, 'combo2')) {
                                this.style.display = 'none';
                                select.style.display = 'inline';
                                setFocus(select);
@@ -82,12 +82,12 @@ function _set_combo_input(e) {
                        var select = document.getElementsByName(this.getAttribute('rel'))[0];
                        if(select && select.selectedIndex>=0) {
                          var len = select.length;
-                         var byid = this.className=='combo' || this.className=='combo3';
+                         var byid = string_contains(this.className, 'combo') || string_contains(this.className, 'combo3');
                          var ac = this.value.toUpperCase();
                          select.options[select.selectedIndex].selected = false;
                          for (i = 0; i < len; i++) {
                                var txt = byid ? select.options[i].value : select.options[i].text;
-                               if (this.className=='combo3') {
+                               if (string_contains(this.className, 'combo3')) {
                                  if(txt.toUpperCase().indexOf(ac) == 0) {
                                        select.options[i].selected = true;
                                        break;
@@ -101,7 +101,7 @@ function _set_combo_input(e) {
                          }
                        }
                };
-       e.onkeydown = function(ev) { 
+       e.onkeydown = function(ev) {
                        ev = ev||window.event;
                        key = ev.keyCode||ev.which;
                        if(key == 13) {
@@ -112,7 +112,7 @@ function _set_combo_input(e) {
 }
 
 function _update_box(s) {
-       var byid = s.className=='combo' || s.className=='combo3';
+       var byid = string_contains(s.className, 'combo') || string_contains(s.className, 'combo3');
        var rel = s.getAttribute('rel');
        var box = document.getElementsByName(rel)[0];
                if(box && s.selectedIndex>=0) {
@@ -128,29 +128,29 @@ function _update_box(s) {
 
 function _set_combo_select(e) {
                // When combo position is changed via js (eg from searchbox)
-               // no onchange event is generated. To ensure proper change 
+               // no onchange event is generated. To ensure proper change
                // signaling we must track selectedIndex in onblur handler.
                e.setAttribute('_last', e.selectedIndex);
                e.onblur = function() {
                    var box = document.getElementsByName(this.getAttribute('rel'))[0];
-//                     if(this.className=='combo')
+//                     if(string_contains(this.className, 'combo'))
 //                         _update_box(this);
                        if ((this.selectedIndex != this.getAttribute('_last'))
-                               ||((this.className=='combo' || this.className=='combo3') && _update_box(this))
+                               ||((string_contains(this.className, 'combo') || string_contains(this.className, 'combo3')) && _update_box(this))
                                )
                                        this.onchange();
                }
                e.onchange = function() {
                        var s = this;
                        this.setAttribute('_last', this.selectedIndex);
-                       if(s.className=='combo' || this.className=='combo3')
+                       if(string_contains(s.className, 'combo') || string_contains(this.className, 'combo3'))
                            _update_box(s);
                        if(s.selectedIndex>=0) {
                                 var sname = '_'+s.name+'_update';
                                 var update = document.getElementsByName(sname)[0];
                                 if(update) {
                                            JsHttpRequest.request(update);
-                               } 
+                               }
                        }
                        return true;
                }
@@ -162,7 +162,7 @@ function _set_combo_select(e) {
                                event.returnValue = false;
                                return false;
                        }
-                   if (box && (key == 32) && (this.className == 'combo2')) {
+                   if (box && (key == 32) && (string_contains(this.className, 'combo2'))) {
                            this.style.display = 'none';
                            box.style.display = 'inline';
                                box.value='';
@@ -178,7 +178,7 @@ function _set_combo_select(e) {
 var _w;
 
 function callEditor(key) {
-  var el = document.getElementsByName(editors[key][1])[0]; 
+  var el = document.getElementsByName(editors[key][1])[0];
   if(_w) _w.close(); // this is really necessary to have window on top in FF2 :/
   var left = (screen.width - editors[key][2]) / 2;
   var top = (screen.height - editors[key][3]) / 2;
@@ -186,7 +186,7 @@ function callEditor(key) {
          "edit","scrollbars=yes,resizable=0,width="+editors[key][2]+",height="+editors[key][3]+",left="+left+",top="+top+",screenX="+left+",screenY="+top);
   if (_w.opener == null)
          _w.opener = self;
-  editors._call = key; // store call point for passBack 
+  editors._call = key; // store call point for passBack
   _w.focus();
 }
 
@@ -196,7 +196,7 @@ function passBack(value) {
                var back = o.editors[o.editors._call]; // form input bindings
                var to = o.document.getElementsByName(back[1])[0];
                if (to) {
-                       if (to[0] != undefined) 
+                       if (to[0] != undefined)
                                to[0].value = value; // ugly hack to set selector to any value
                        to.value = value;
                        // update page after item selection
@@ -230,12 +230,12 @@ function fix_date(date, last)
                day = dat[2]; month = dat[1]; year = dat[0];
        }
        if (cur[1] != undefined && cur[1] != "") // day or month entered, could be string 3
-       { 
+       {
                if (user.datefmt == 0 || user.datefmt == 3 || ((user.datefmt == 2 || user.datefmt == 5) && (cur[2] == undefined || cur[2] == "")))
                        day = cur[1];
-               else    
+               else
                        month = cur[1];
-       }               
+       }
        if (cur[0] != undefined && cur[0] != "") // day or month entered. could be string 3
        {
                if (cur[1] == undefined || cur[1] == "")
@@ -244,7 +244,7 @@ function fix_date(date, last)
                        month = cur[0];
                else if (user.datefmt == 2 || user.datefmt == 5)
                        year = cur[0];
-               else    
+               else
                        day = cur[0];
        }
        if (cur[2] != undefined && cur[2] != "") // year,
@@ -253,11 +253,11 @@ function fix_date(date, last)
                        day = cur[2];
                else
                        year = cur[2];
-       }               
+       }
        if (user.datefmt<3) {
                if (day<10) day = '0'+parseInt(day, 10);
                if (month<10) month = '0'+parseInt(month, 10);
-       }       
+       }
        if (year<100) year = year<60 ? (2000+parseInt(year,10)) : (1900+parseInt(year,10));
 
 //     console.info(day,month,year)
@@ -275,33 +275,33 @@ var inserts = {
        'input': function(e) {
                if(e.onfocus==undefined) {
                        e.onfocus = function() {
-                           save_focus(this);
-                               if (this.className == 'combo' || this.className == 'combo3') 
+                               save_focus(this);
+                               if (string_contains(this.className, 'combo') || string_contains(this.className, 'combo3'))
                                        this.select();
                        };
                }
-               if (e.className == 'combo' || e.className == 'combo2' || e.className == 'combo3') {
+               if (string_contains(e.className, 'combo') || string_contains(e.className, 'combo2') || string_contains(e.className, 'combo3')) {
                                _set_combo_input(e);
-               } 
+               }
                else
                if(e.type == 'text' ) {
-                               e.onkeydown = function(ev) { 
+                               e.onkeydown = function(ev) {
                                        ev = ev||window.event;
                                        key = ev.keyCode||ev.which;
                                        if(key == 13) {
                                                if(e.className == 'searchbox') e.onblur();
                                                return false;
-                                       } 
+                                       }
                                        return true;
                                }
                        }
        },
-       'input.combo2,input[aspect="fallback"]': 
+       'input.combo2,input[aspect="fallback"]':
        function(e) {
            // this hides search button for js enabled browsers
            e.style.display = 'none';
        },
-       'div.js_only': 
+       'div.js_only':
        function(e) {
            // this shows divs for js enabled browsers only
            e.style.display = 'block';
@@ -326,7 +326,7 @@ var inserts = {
 
        },
 //     '.ajaxsubmit,.editbutton,.navibutton': // much slower on IE7
-       'button.ajaxsubmit,input.ajaxsubmit,input.editbutton,button.editbutton,button.navibutton': 
+       'button.ajaxsubmit,input.ajaxsubmit,input.editbutton,button.editbutton,button.navibutton':
        function(e) {
                        e.onclick = function() {
                                if (validate(e)) {
@@ -389,7 +389,7 @@ var inserts = {
                                  "edit","Scrollbars=0,resizable=0,width=800,height=600, top="+top+",left="+left+",screenX="+left+",screenY="+top);
                          if (_w.opener == null)
                                  _w.opener = self;
-                       //  editors._call = key; // store call point for passBack 
+                       //  editors._call = key; // store call point for passBack
 //                       _w.moveTo(50, 50);
                          _w.focus();
                        return false;
@@ -402,7 +402,7 @@ var inserts = {
                        };
                }
                var c = e.className;
-               if (c == 'combo' || c == 'combo2' || c == 'combo3')
+               if (string_contains(c, 'combo') || string_contains(c, 'combo2') || string_contains(c, 'combo3'))
                        _set_combo_select(e);
                else {
                        e.onkeydown = function(ev) {    // block unintentional page escape with 'history back' key pressed on buttons
@@ -433,7 +433,7 @@ var inserts = {
                }
        },
        'a': function(e) { // traverse menu
-               e.onkeydown = function(ev) { 
+               e.onkeydown = function(ev) {
                        ev = ev||window.event;
                        key = ev.keyCode||ev.which;
                        if(key==37 || key==38 || key==39 || key==40) {
@@ -443,18 +443,18 @@ var inserts = {
                        }
                }
                // prevent unneeded transaction entry abortion
-               if (e.className == 'shortcut' 
-                || e.className == 'menu_option' 
+               if (e.className == 'shortcut'
+                || e.className == 'menu_option'
                 || e.className == 'menu_tab'
                 || e.className == 'selected')
                        e.onclick = function(ev) {
-                               if (_validate._processing 
+                               if (_validate._processing
                                 && _validate._modified
                                 && !confirm(_validate._processing)) {
                                        ev.returnValue = false;
                                        return false;
                                }
-                               if (_hotkeys.alt)       // ommit Chrome accesskeys 
+                               if (_hotkeys.alt)       // ommit Chrome accesskeys
                                        return false;
                                window.location = e.href;
                        }
@@ -482,12 +482,12 @@ var inserts = {
                }
        }
 /*     'tr.editrow': function(e) {
-                       e.onkeydown = function(ev) { 
+                       e.onkeydown = function(ev) {
                        ev = ev||window.event;
                        key = ev.keyCode||ev.which;
                        if(key == 13) {
                          // Find & click additem/update button
-                         
+
                        } else  if(key == 27) {
                          return false;
                        }
@@ -520,7 +520,7 @@ function stopEv(ev) {
                        return false;
 }
 /*
-       Modified accesskey system. While Alt key is pressed letter keys moves 
+       Modified accesskey system. While Alt key is pressed letter keys moves
        focus to next marked link. Alt key release activates focused link.
 */
 function setHotKeys() {
@@ -538,7 +538,7 @@ function setHotKeys() {
                        var l = document.getElementsBySelector('[accesskey='+key+']');
                        var cnt = l.length;
                        _hotkeys.list = l;
-                       for (var i=0; i<cnt; i++) { 
+                       for (var i=0; i<cnt; i++) {
                                n = (n+1)%cnt;
                                // check also if the link is visible
                                if (l[n].accessKey==key && (l[n].offsetWidth || l[n].offsetHeight)) {
@@ -563,7 +563,7 @@ function setHotKeys() {
                                        var el = form.elements[i];
                                        var asp = el.getAttribute('aspect');
 
-                                       if (el.className!='editbutton' && (asp && asp.indexOf('selector') !== -1) && (key==13 || key==27)) {
+                                       if (!string_contains(el.className, 'editbutton') && (asp && asp.indexOf('selector') !== -1) && (key==13 || key==27)) {
                                                passBack(key==13 ? el.getAttribute('rel') : false);
                                                ev.returnValue = false;
                                                return false;
@@ -589,7 +589,7 @@ function setHotKeys() {
                if (editors!=='undefined' && editors[key]) {
                        callEditor(key);
                        return stopEv(ev); // prevent default binding
-               } 
+               }
                return true;
        };
        document.onkeyup = function(ev) {
@@ -601,7 +601,7 @@ function setHotKeys() {
                                _hotkeys.alt = false;
                                if (_hotkeys.focus >= 0) {
                                        var link = _hotkeys.list[_hotkeys.focus];
-                                       if(link.onclick) 
+                                       if(link.onclick)
                                                link.onclick();
                                        else
                                                if (link.target=='_blank') {
@@ -611,7 +611,7 @@ function setHotKeys() {
                                                        window.location = link.href;
                                }
                        return stopEv(ev);
-                       } 
+                       }
                }
                return true;
        }
index c5aec13332dea4100dd439ad3cd98f7f5225249b..c0df0b85e01e7b86feb5a22c35dcdc92b1cf50b1 100644 (file)
@@ -1,11 +1,11 @@
 /**********************************************************************
     Copyright (C) FrontAccounting, LLC.
-       Released under the terms of the GNU General Public License, GPL, 
-       as published by the Free Software Foundation, either version 3 
+       Released under the terms of the GNU General Public License, GPL,
+       as published by the Free Software Foundation, either version 3
        of the License, or (at your option) any later version.
     This program is distributed in the hope that it will be useful,
     but WITHOUT ANY WARRANTY; without even the implied warranty of
-    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  
+    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
     See the License here <http://www.gnu.org/licenses/gpl-3.0.html>.
 ***********************************************************************/
 function set_mark(img) {
@@ -31,8 +31,8 @@ function disp_msg(msg, cl) {
 //     - input object - all form values are also submited
 //  - arbitrary string - POST var trigger with value 1 is added to request;
 //             if form parameter exists also form values are submited, otherwise
-//             request is directed to current location 
-// 
+//             request is directed to current location
+//
 JsHttpRequest.request= function(trigger, form, tout) {
 //     if (trigger.type=='submit' && !validate(trigger)) return false;
        tout = tout || 10000;   // default timeout value
@@ -48,27 +48,27 @@ JsHttpRequest._request = function(trigger, form, tout, retry) {
                        var url = trigger.href;
                        if (trigger.id) content[trigger.id] = 1;
                } else {
-               var submitObj = typeof(trigger) == "string" ? 
+               var submitObj = typeof(trigger) == "string" ?
                        document.getElementsByName(trigger)[0] : trigger;
-               
+
                form = form || (submitObj && submitObj.form);
 
                var upload = form && form.enctype=='multipart/form-data';
-               
-               var url = form ? form.getAttribute('action') : 
+
+               var url = form ? form.getAttribute('action') :
                  window.location.toString();
 
                var content = this.formInputs(trigger, form, upload);
 
                if (!form) url = url.substring(0, url.indexOf('?'));
-               
+
                if (!submitObj) {
                        content[trigger] = 1;
                        }
                }
                        // this is to avoid caching problems
                content['_random'] = Math.random()*1234567;
-       
+
                var tcheck = setTimeout(
                        function() {
                                for(var id in JsHttpRequest.PENDING)  {
@@ -89,12 +89,12 @@ JsHttpRequest._request = function(trigger, form, tout, retry) {
         JsHttpRequest.query(
             (upload ? "form." : "")+"POST "+url, // force form loader
                content,
-            // Function is called when an answer arrives. 
+            // Function is called when an answer arrives.
            function(result, errors) {
                 // Write the answer.
                        var newwin = 0;
                if (result) {
-                         for(var i in result ) { 
+                         for(var i in result ) {
                          atom = result[i];
                          cmd = atom['n'];
                          property = atom['p'];
@@ -141,7 +141,7 @@ JsHttpRequest._request = function(trigger, form, tout, retry) {
                        window.scrollTo(0,0);
                        //document.getElementById('msgbox').scrollIntoView(true);
          // Restore focus if we've just lost focus because of DOM element refresh
-                       if(!newwin) { 
+                       if(!newwin) {
                                setFocus();
                        }
                }
@@ -157,7 +157,7 @@ JsHttpRequest._request = function(trigger, form, tout, retry) {
 
                if (typeof(inp) == "string")
                        submitObj = document.getElementsByName(inp)[0]||inp;
-               
+
                objForm = objForm || (submitObj && submitObj.form);
 
                if (objForm)
@@ -168,7 +168,7 @@ JsHttpRequest._request = function(trigger, form, tout, retry) {
                          var el = formElements[i];
                          var name = el.name;
                                if (!el.name) continue;
-                               if(upload) { // for form containing file inputs collect all 
+                               if(upload) { // for form containing file inputs collect all
                                        // form elements and add value of trigger submit button
                                        // (internally form is submitted via form.submit() not button click())
                                        if (submitObj.type=='submit' && el==submitObj)
@@ -178,7 +178,7 @@ JsHttpRequest._request = function(trigger, form, tout, retry) {
                                        }
                                }
                                if (el.type )
-                                 if( 
+                                 if(
                                  ((el.type == 'radio' || el.type == 'checkbox') && el.checked == false)
                                  || (el.type == 'submit' && (!submitObj || el.name!=submitObj.name)))
                                        continue;
@@ -204,7 +204,7 @@ JsHttpRequest._request = function(trigger, form, tout, retry) {
                                        {
                                                q[name] = el.value;
                                        }
-                               } 
+                               }
                        }
                }
                return q;
@@ -224,7 +224,7 @@ function price_format(post, num, dec, label, color) {
        decsize = Math.pow(10, dec);
        num = Math.floor(num*decsize+0.50000000001);
        cents = num%decsize;
-       num = Math.floor(num/decsize).toString(); 
+       num = Math.floor(num/decsize).toString();
        for( i=cents.toString().length; i<dec; i++){
                cents = "0"+cents;
        }
@@ -249,9 +249,9 @@ function get_amount(doc, label) {
            if(label)
                        var val = document.getElementById(doc).innerHTML;
            else
-                       var val = typeof(doc) == "string" ? 
+                       var val = typeof(doc) == "string" ?
                        document.getElementsByName(doc)[0].value : doc.value;
-               
+
                val = val.replace(new RegExp('\\'+user.ts, 'g'),'');
                val = +val.replace(new RegExp('\\'+user.ds, 'g'),'.');
                return isNaN(val) ? 0 : val;
@@ -270,22 +270,22 @@ function setFocus(name, byId) {
        el = name;
  else {
        if(!name) { // page load/ajax update
-               if (_focus)     
+               if (_focus)
                        name = _focus;  // last focus set in onfocus handlers
-               else 
+               else
                        if (document.forms.length) {    // no current focus (first page display) -  set it from from last form
                          var cur = document.getElementsByName('_focus')[document.forms.length-1];
                          if(cur) name = cur.value;
                        }
          }
-      if (name) 
+      if (name)
            if(byId || !(el = document.getElementsByName(name)[0]))
                  el = document.getElementById(name);
   }
   if (el != null && el.focus) {
     // The timeout is needed to prevent unpredictable behaviour on IE & Gecko.
     // Using tmp var prevents crash on IE5
-       
+
     var tmp = function() {el.focus(); if (el.select) el.select();};
        setTimeout(tmp, 0);
   }
@@ -304,7 +304,7 @@ function move_focus(dir, e0, neighbours)
                var p = element_pos(e);
                if (p!=null && (e.className=='menu_option' || e.className=='printlink'
                                 || e.className == 'repclass_link' || e.className == 'repopts_link')) {
-                       if (((dir==40) && (p.y>p0.y)) || (dir==38 && (p.y<p0.y)) 
+                       if (((dir==40) && (p.y>p0.y)) || (dir==38 && (p.y<p0.y))
                                || ((dir==37) && (p.x<p0.x)) || ((dir==39 && (p.x>p0.x)))) {
                                        var l1 = (p.y-p0.y)*(p.y-p0.y)+(p.x-p0.x)*(p.x-p0.x);
                                        if ((l1<l) || (l==0)) {
@@ -354,3 +354,8 @@ function element_pos(e) {
        if (parentNode != document.documentElement) return null;
        return res;
 }
+
+function string_contains(haystack, needle) {
+  var words = haystack.split(' ');
+  return words.indexOf(needle) > -1;
+}
index adf356d540d6dfbd89db98de6641b9121084e1c8..40932dd23787ca73ab45be74de586022c8ee7e84 100644 (file)
@@ -8,7 +8,7 @@ msgid ""
 msgstr ""
 "Project-Id-Version: PACKAGE VERSION\n"
 "Report-Msgid-Bugs-To: \n"
-"POT-Creation-Date: 2014-05-31 13:29+0200\n"
+"POT-Creation-Date: 2014-12-25 16:46+0100\n"
 "PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n"
 "Last-Translator: FULL NAME <EMAIL@ADDRESS>\n"
 "Language-Team: LANGUAGE <LL@li.org>\n"
@@ -75,7 +75,7 @@ msgid "User name"
 msgstr ""
 
 #: ../access/login.php:97
-#: ../admin/users.php:191
+#: ../admin/users.php:200
 msgid "Password:"
 msgstr ""
 
@@ -93,7 +93,7 @@ msgstr ""
 msgid "Login -->"
 msgstr ""
 
-#: ../access/login.php:152
+#: ../access/login.php:156
 #: ../access/password_reset.php:108
 #: ../admin/display_prefs.php:112
 #: ../themes/default/renderer.php:129
@@ -117,7 +117,7 @@ msgstr ""
 #: ../reporting/rep103.php:277
 #: ../reporting/rep106.php:88
 #: ../reporting/rep205.php:195
-#: ../reporting/includes/header2.inc:110
+#: ../reporting/includes/header2.inc:113
 #: ../sales/manage/sales_people.php:99
 msgid "Email"
 msgstr ""
@@ -154,11 +154,11 @@ msgstr ""
 #: ../admin/view_print_transaction.php:72
 #: ../gl/inquiry/journal_inquiry.php:47
 #: ../inventory/includes/item_adjustments_ui.inc:47
-#: ../manufacturing/work_order_add_finished.php:203
+#: ../manufacturing/work_order_add_finished.php:200
 #: ../manufacturing/work_order_costs.php:136
-#: ../manufacturing/work_order_entry.php:379
-#: ../manufacturing/work_order_entry.php:387
-#: ../manufacturing/includes/work_order_issue_ui.inc:161
+#: ../manufacturing/work_order_entry.php:377
+#: ../manufacturing/work_order_entry.php:385
+#: ../manufacturing/includes/work_order_issue_ui.inc:168
 #: ../sales/inquiry/customer_allocation_inquiry.php:47
 msgid "Type:"
 msgstr ""
@@ -172,7 +172,7 @@ msgstr ""
 #: ../admin/printers.php:96
 #: ../admin/shipping_companies.php:106
 #: ../admin/tags.php:140
-#: ../admin/users.php:144
+#: ../admin/users.php:153
 #: ../dimensions/inquiry/search_dimensions.php:120
 #: ../gl/inquiry/journal_inquiry.php:118
 #: ../gl/manage/bank_accounts.php:133
@@ -189,8 +189,8 @@ msgstr ""
 #: ../includes/ui/ui_input.inc:961
 #: ../inventory/prices.php:159
 #: ../inventory/purchasing_data.php:165
-#: ../inventory/includes/item_adjustments_ui.inc:87
-#: ../inventory/includes/stock_transfers_ui.inc:79
+#: ../inventory/includes/item_adjustments_ui.inc:91
+#: ../inventory/includes/stock_transfers_ui.inc:83
 #: ../inventory/manage/item_categories.php:121
 #: ../inventory/manage/item_codes.php:140
 #: ../inventory/manage/item_units.php:110
@@ -200,11 +200,11 @@ msgstr ""
 #: ../manufacturing/search_work_orders.php:109
 #: ../manufacturing/manage/bom_edit.php:86
 #: ../manufacturing/manage/work_centres.php:114
-#: ../manufacturing/includes/work_order_issue_ui.inc:58
+#: ../manufacturing/includes/work_order_issue_ui.inc:63
 #: ../purchasing/includes/ui/invoice_ui.inc:557
 #: ../purchasing/includes/ui/po_ui.inc:275
-#: ../purchasing/inquiry/po_search_completed.php:105
-#: ../purchasing/inquiry/po_search.php:87
+#: ../purchasing/inquiry/po_search_completed.php:108
+#: ../purchasing/inquiry/po_search.php:89
 #: ../sales/manage/credit_status.php:119
 #: ../sales/manage/customer_branches.php:159
 #: ../sales/manage/recurrent_invoices.php:130
@@ -213,10 +213,10 @@ msgstr ""
 #: ../sales/manage/sales_people.php:119
 #: ../sales/manage/sales_points.php:99
 #: ../sales/manage/sales_types.php:121
-#: ../sales/inquiry/sales_deliveries_view.php:154
+#: ../sales/inquiry/sales_deliveries_view.php:156
 #: ../sales/inquiry/sales_orders_view.php:136
 #: ../sales/includes/ui/sales_credit_ui.inc:197
-#: ../sales/includes/ui/sales_order_ui.inc:209
+#: ../sales/includes/ui/sales_order_ui.inc:197
 #: ../taxes/item_tax_types.php:139
 #: ../taxes/sav.tax_types.php:211
 #: ../taxes/sav.tax_types.php:262
@@ -246,7 +246,7 @@ msgstr ""
 #: ../admin/printers.php:97
 #: ../admin/shipping_companies.php:107
 #: ../admin/tags.php:141
-#: ../admin/users.php:146
+#: ../admin/users.php:155
 #: ../gl/gl_budget.php:137
 #: ../gl/manage/bank_accounts.php:134
 #: ../gl/manage/currencies.php:166
@@ -262,8 +262,8 @@ msgstr ""
 #: ../includes/ui/ui_input.inc:286
 #: ../inventory/prices.php:160
 #: ../inventory/purchasing_data.php:166
-#: ../inventory/includes/item_adjustments_ui.inc:89
-#: ../inventory/includes/stock_transfers_ui.inc:81
+#: ../inventory/includes/item_adjustments_ui.inc:93
+#: ../inventory/includes/stock_transfers_ui.inc:85
 #: ../inventory/manage/item_categories.php:122
 #: ../inventory/manage/item_codes.php:141
 #: ../inventory/manage/item_units.php:111
@@ -272,7 +272,7 @@ msgstr ""
 #: ../inventory/manage/sales_kits.php:56
 #: ../manufacturing/manage/bom_edit.php:87
 #: ../manufacturing/manage/work_centres.php:115
-#: ../manufacturing/includes/work_order_issue_ui.inc:60
+#: ../manufacturing/includes/work_order_issue_ui.inc:65
 #: ../purchasing/includes/ui/invoice_ui.inc:319
 #: ../purchasing/includes/ui/po_ui.inc:277
 #: ../sales/manage/credit_status.php:120
@@ -284,7 +284,7 @@ msgstr ""
 #: ../sales/manage/sales_points.php:100
 #: ../sales/manage/sales_types.php:122
 #: ../sales/includes/ui/sales_credit_ui.inc:199
-#: ../sales/includes/ui/sales_order_ui.inc:211
+#: ../sales/includes/ui/sales_order_ui.inc:199
 #: ../taxes/item_tax_types.php:140
 #: ../taxes/sav.tax_types.php:212
 #: ../taxes/tax_groups.php:138
@@ -313,8 +313,8 @@ msgstr ""
 #: ../manufacturing/includes/manufacturing_ui.inc:331
 #: ../purchasing/view/view_po.php:115
 #: ../purchasing/view/view_po.php:140
-#: ../purchasing/inquiry/po_search_completed.php:120
-#: ../purchasing/inquiry/po_search.php:130
+#: ../purchasing/inquiry/po_search_completed.php:123
+#: ../purchasing/inquiry/po_search.php:132
 #: ../purchasing/inquiry/supplier_allocation_inquiry.php:127
 #: ../purchasing/inquiry/supplier_inquiry.php:174
 #: ../purchasing/allocations/supplier_allocation_main.php:95
@@ -371,7 +371,7 @@ msgstr ""
 #: ../reporting/rep305.php:101
 #: ../reporting/rep306.php:141
 #: ../reporting/rep307.php:117
-#: ../reporting/rep308.php:149
+#: ../reporting/rep308.php:230
 #: ../reporting/rep309.php:98
 #: ../reporting/rep401.php:71
 #: ../sales/create_recurrent_invoices.php:134
@@ -458,7 +458,7 @@ msgstr ""
 #: ../includes/system_tests.inc:38
 #: ../includes/system_tests.inc:113
 #: ../includes/system_tests.inc:126
-#: ../includes/ui/ui_lists.inc:1679
+#: ../includes/ui/ui_lists.inc:1681
 #: ../purchasing/manage/suppliers.php:123
 #: ../reporting/rep101.php:114
 #: ../reporting/rep102.php:114
@@ -472,6 +472,8 @@ msgstr ""
 #: ../reporting/rep203.php:89
 #: ../reporting/rep303.php:113
 #: ../reporting/rep303.php:117
+#: ../reporting/rep402.php:99
+#: ../reporting/rep402.php:134
 #: ../reporting/rep501.php:113
 #: ../sales/manage/sales_points.php:94
 #: ../sales/manage/sales_points.php:95
@@ -509,8 +511,8 @@ msgid "Create backup"
 msgstr ""
 
 #: ../admin/backups.php:181
-#: ../sales/includes/ui/sales_order_ui.inc:595
-#: ../sales/includes/ui/sales_order_ui.inc:651
+#: ../sales/includes/ui/sales_order_ui.inc:580
+#: ../sales/includes/ui/sales_order_ui.inc:636
 msgid "Comments:"
 msgstr ""
 
@@ -592,7 +594,7 @@ msgid "Your password has been updated."
 msgstr ""
 
 #: ../admin/change_current_user_password.php:85
-#: ../admin/users.php:180
+#: ../admin/users.php:189
 msgid "User login:"
 msgstr ""
 
@@ -666,7 +668,7 @@ msgstr ""
 #: ../includes/ui/contacts_view.inc:109
 #: ../inventory/manage/locations.php:202
 #: ../sales/manage/customers.php:234
-#: ../sales/includes/ui/sales_order_ui.inc:642
+#: ../sales/includes/ui/sales_order_ui.inc:627
 msgid "Address:"
 msgstr ""
 
@@ -690,7 +692,7 @@ msgid "Fax Number:"
 msgstr ""
 
 #: ../admin/company_preferences.php:170
-#: ../admin/users.php:202
+#: ../admin/users.php:211
 msgid "Email Address:"
 msgstr ""
 
@@ -800,7 +802,7 @@ msgstr ""
 #: ../admin/company_preferences.php:208
 #: ../admin/display_prefs.php:145
 #: ../admin/forms_setup.php:61
-#: ../admin/gl_setup.php:241
+#: ../admin/gl_setup.php:249
 #: ../admin/inst_chart.php:74
 #: ../admin/inst_lang.php:103
 #: ../admin/inst_module.php:137
@@ -818,26 +820,26 @@ msgstr ""
 #: ../includes/ui/simple_crud_class.inc:227
 #: ../includes/ui/ui_input.inc:208
 #: ../includes/ui/ui_input.inc:906
-#: ../inventory/adjustments.php:233
+#: ../inventory/adjustments.php:234
 #: ../inventory/cost_update.php:134
 #: ../inventory/reorder_level.php:112
-#: ../inventory/transfers.php:234
-#: ../inventory/includes/item_adjustments_ui.inc:157
-#: ../inventory/includes/stock_transfers_ui.inc:137
+#: ../inventory/transfers.php:230
+#: ../inventory/includes/item_adjustments_ui.inc:163
+#: ../inventory/includes/stock_transfers_ui.inc:143
 #: ../inventory/manage/sales_kits.php:208
-#: ../manufacturing/work_order_entry.php:459
-#: ../manufacturing/includes/work_order_issue_ui.inc:131
+#: ../manufacturing/work_order_entry.php:457
+#: ../manufacturing/includes/work_order_issue_ui.inc:138
 #: ../purchasing/includes/ui/po_ui.inc:308
 #: ../purchasing/includes/ui/po_ui.inc:459
 #: ../purchasing/po_receive_items.php:332
 #: ../sales/credit_note_entry.php:284
 #: ../sales/customer_credit_invoice.php:380
-#: ../sales/customer_delivery.php:547
+#: ../sales/customer_delivery.php:563
 #: ../sales/customer_invoice.php:693
 #: ../sales/inquiry/sales_orders_view.php:350
 #: ../sales/includes/ui/sales_credit_ui.inc:293
-#: ../sales/includes/ui/sales_order_ui.inc:244
-#: ../sales/includes/ui/sales_order_ui.inc:561
+#: ../sales/includes/ui/sales_order_ui.inc:232
+#: ../sales/includes/ui/sales_order_ui.inc:546
 #: ../taxes/sav.tax_types.php:255
 msgid "Update"
 msgstr ""
@@ -980,7 +982,7 @@ msgstr ""
 #: ../includes/system_tests.inc:38
 #: ../includes/system_tests.inc:113
 #: ../includes/system_tests.inc:126
-#: ../includes/ui/ui_lists.inc:1680
+#: ../includes/ui/ui_lists.inc:1682
 #: ../purchasing/manage/suppliers.php:123
 #: ../reporting/rep101.php:113
 #: ../reporting/rep102.php:113
@@ -994,6 +996,7 @@ msgstr ""
 #: ../reporting/rep203.php:88
 #: ../reporting/rep303.php:108
 #: ../reporting/rep303.php:116
+#: ../reporting/rep402.php:99
 #: ../reporting/rep501.php:111
 #: ../sales/manage/sales_points.php:94
 #: ../sales/manage/sales_points.php:95
@@ -1173,7 +1176,7 @@ msgid "Language"
 msgstr ""
 
 #: ../admin/display_prefs.php:101
-#: ../admin/users.php:206
+#: ../admin/users.php:215
 msgid "Language:"
 msgstr ""
 
@@ -1204,12 +1207,12 @@ msgid "Start-up Tab"
 msgstr ""
 
 #: ../admin/display_prefs.php:127
-#: ../admin/users.php:210
+#: ../admin/users.php:219
 msgid "Printing profile"
 msgstr ""
 
 #: ../admin/display_prefs.php:128
-#: ../admin/users.php:211
+#: ../admin/users.php:220
 msgid "Browser printing support"
 msgstr ""
 
@@ -1218,7 +1221,7 @@ msgid "Use popup window to display reports:"
 msgstr ""
 
 #: ../admin/display_prefs.php:131
-#: ../admin/users.php:214
+#: ../admin/users.php:223
 msgid "Set this option to on if your browser directly supports pdf files"
 msgstr ""
 
@@ -1311,8 +1314,9 @@ msgstr ""
 #: ../dimensions/inquiry/search_dimensions.php:133
 #: ../dimensions/inquiry/search_dimensions.php:139
 #: ../includes/ui/ui_input.inc:959
-#: ../includes/ui/ui_lists.inc:675
+#: ../includes/ui/ui_lists.inc:677
 #: ../manufacturing/search_work_orders.php:108
+#: ../reporting/rep402.php:103
 #: ../reporting/rep501.php:87
 #: ../reporting/rep710.php:113
 #: ../reporting/includes/excel_report.inc:234
@@ -1394,171 +1398,176 @@ msgstr ""
 msgid "The general GL setup has been updated."
 msgstr ""
 
-#: ../admin/gl_setup.php:144
+#: ../admin/gl_setup.php:150
 msgid "General GL"
 msgstr ""
 
-#: ../admin/gl_setup.php:146
+#: ../admin/gl_setup.php:152
 msgid "Past Due Days Interval:"
 msgstr ""
 
-#: ../admin/gl_setup.php:146
-#: ../admin/gl_setup.php:186
+#: ../admin/gl_setup.php:152
+#: ../admin/gl_setup.php:192
 #: ../admin/gl_setup.php:194
-#: ../admin/gl_setup.php:212
-#: ../admin/gl_setup.php:234
+#: ../admin/gl_setup.php:202
+#: ../admin/gl_setup.php:220
+#: ../admin/gl_setup.php:242
 #: ../admin/payment_terms.php:140
 msgid "days"
 msgstr ""
 
-#: ../admin/gl_setup.php:148
+#: ../admin/gl_setup.php:154
 msgid "Retained Earnings:"
 msgstr ""
 
-#: ../admin/gl_setup.php:150
+#: ../admin/gl_setup.php:156
 msgid "Profit/Loss Year:"
 msgstr ""
 
-#: ../admin/gl_setup.php:152
+#: ../admin/gl_setup.php:158
 msgid "Exchange Variances Account:"
 msgstr ""
 
-#: ../admin/gl_setup.php:154
+#: ../admin/gl_setup.php:160
 #: ../gl/manage/bank_accounts.php:193
 msgid "Bank Charges Account:"
 msgstr ""
 
-#: ../admin/gl_setup.php:156
+#: ../admin/gl_setup.php:162
 msgid "Tax Algorithm:"
 msgstr ""
 
-#: ../admin/gl_setup.php:160
+#: ../admin/gl_setup.php:166
 msgid "Customers and Sales"
 msgstr ""
 
-#: ../admin/gl_setup.php:162
+#: ../admin/gl_setup.php:168
 msgid "Default Credit Limit:"
 msgstr ""
 
-#: ../admin/gl_setup.php:164
+#: ../admin/gl_setup.php:170
 msgid "Accumulate batch shipping:"
 msgstr ""
 
-#: ../admin/gl_setup.php:166
+#: ../admin/gl_setup.php:172
 msgid "Legal Text on Invoice:"
 msgstr ""
 
-#: ../admin/gl_setup.php:168
+#: ../admin/gl_setup.php:174
 msgid "Shipping Charged Account:"
 msgstr ""
 
-#: ../admin/gl_setup.php:170
+#: ../admin/gl_setup.php:176
 msgid "Deferred Income Account:"
 msgstr ""
 
-#: ../admin/gl_setup.php:171
+#: ../admin/gl_setup.php:177
 msgid "Not used"
 msgstr ""
 
-#: ../admin/gl_setup.php:175
+#: ../admin/gl_setup.php:181
 msgid "Customers and Sales Defaults"
 msgstr ""
 
-#: ../admin/gl_setup.php:177
+#: ../admin/gl_setup.php:183
 msgid "Receivable Account:"
 msgstr ""
 
-#: ../admin/gl_setup.php:179
-#: ../admin/gl_setup.php:220
+#: ../admin/gl_setup.php:185
+#: ../admin/gl_setup.php:228
 #: ../inventory/manage/item_categories.php:196
 #: ../inventory/manage/items.php:365
 #: ../sales/manage/customer_branches.php:251
 msgid "Sales Account:"
 msgstr ""
 
-#: ../admin/gl_setup.php:182
+#: ../admin/gl_setup.php:188
 #: ../sales/manage/customer_branches.php:252
 msgid "Sales Discount Account:"
 msgstr ""
 
-#: ../admin/gl_setup.php:184
+#: ../admin/gl_setup.php:190
 #: ../sales/manage/customer_branches.php:254
 msgid "Prompt Payment Discount Account:"
 msgstr ""
 
-#: ../admin/gl_setup.php:186
+#: ../admin/gl_setup.php:192
+msgid "Quote Valid Days:"
+msgstr ""
+
+#: ../admin/gl_setup.php:194
 msgid "Delivery Required By:"
 msgstr ""
 
-#: ../admin/gl_setup.php:192
+#: ../admin/gl_setup.php:200
 msgid "Dimension Defaults"
 msgstr ""
 
-#: ../admin/gl_setup.php:194
+#: ../admin/gl_setup.php:202
 msgid "Dimension Required By After:"
 msgstr ""
 
-#: ../admin/gl_setup.php:198
+#: ../admin/gl_setup.php:206
 msgid "Suppliers and Purchasing"
 msgstr ""
 
-#: ../admin/gl_setup.php:200
+#: ../admin/gl_setup.php:208
 msgid "Delivery Over-Receive Allowance:"
 msgstr ""
 
-#: ../admin/gl_setup.php:202
+#: ../admin/gl_setup.php:210
 msgid "Invoice Over-Charge Allowance:"
 msgstr ""
 
-#: ../admin/gl_setup.php:204
+#: ../admin/gl_setup.php:212
 msgid "Suppliers and Purchasing Defaults"
 msgstr ""
 
-#: ../admin/gl_setup.php:206
+#: ../admin/gl_setup.php:214
 msgid "Payable Account:"
 msgstr ""
 
-#: ../admin/gl_setup.php:208
+#: ../admin/gl_setup.php:216
 #: ../purchasing/manage/suppliers.php:133
 msgid "Purchase Discount Account:"
 msgstr ""
 
-#: ../admin/gl_setup.php:210
+#: ../admin/gl_setup.php:218
 msgid "GRN Clearing Account:"
 msgstr ""
 
-#: ../admin/gl_setup.php:210
+#: ../admin/gl_setup.php:218
 msgid "No postings on GRN"
 msgstr ""
 
-#: ../admin/gl_setup.php:212
+#: ../admin/gl_setup.php:220
 msgid "Receival Required By:"
 msgstr ""
 
-#: ../admin/gl_setup.php:214
+#: ../admin/gl_setup.php:222
 #: ../reporting/reports_main.php:206
 msgid "Inventory"
 msgstr ""
 
-#: ../admin/gl_setup.php:216
+#: ../admin/gl_setup.php:224
 msgid "Allow Negative Inventory:"
 msgstr ""
 
-#: ../admin/gl_setup.php:217
+#: ../admin/gl_setup.php:225
 msgid "Warning:  This may cause a delay in GL postings"
 msgstr ""
 
-#: ../admin/gl_setup.php:219
+#: ../admin/gl_setup.php:227
 msgid "Items Defaults"
 msgstr ""
 
-#: ../admin/gl_setup.php:222
+#: ../admin/gl_setup.php:230
 #: ../inventory/manage/item_categories.php:206
 #: ../inventory/manage/items.php:369
 msgid "Inventory Account:"
 msgstr ""
 
-#: ../admin/gl_setup.php:224
+#: ../admin/gl_setup.php:232
 #: ../inventory/manage/item_categories.php:200
 #: ../inventory/manage/item_categories.php:208
 #: ../inventory/manage/items.php:370
@@ -1566,23 +1575,23 @@ msgstr ""
 msgid "C.O.G.S. Account:"
 msgstr ""
 
-#: ../admin/gl_setup.php:226
+#: ../admin/gl_setup.php:234
 #: ../inventory/manage/item_categories.php:209
 #: ../inventory/manage/items.php:371
 msgid "Inventory Adjustments Account:"
 msgstr ""
 
-#: ../admin/gl_setup.php:228
+#: ../admin/gl_setup.php:236
 #: ../inventory/manage/item_categories.php:213
 #: ../inventory/manage/items.php:382
 msgid "Item Assembly Costs Account:"
 msgstr ""
 
-#: ../admin/gl_setup.php:232
+#: ../admin/gl_setup.php:240
 msgid "Manufacturing Defaults"
 msgstr ""
 
-#: ../admin/gl_setup.php:234
+#: ../admin/gl_setup.php:242
 msgid "Work Order Required By After:"
 msgstr ""
 
@@ -1671,8 +1680,8 @@ msgstr ""
 #: ../purchasing/includes/ui/invoice_ui.inc:282
 #: ../purchasing/includes/ui/invoice_ui.inc:284
 #: ../reporting/rep501.php:87
-#: ../reporting/rep709.php:111
-#: ../reporting/rep709.php:112
+#: ../reporting/rep709.php:116
+#: ../reporting/rep709.php:117
 #: ../sales/manage/customer_branches.php:296
 #: ../sales/manage/sales_people.php:99
 #: ../taxes/item_tax_types.php:117
@@ -1778,8 +1787,8 @@ msgid "Install third-party extension."
 msgstr ""
 
 #: ../admin/inst_module.php:168
-#: ../includes/ui/ui_lists.inc:675
-#: ../includes/ui/ui_lists.inc:2160
+#: ../includes/ui/ui_lists.inc:677
+#: ../includes/ui/ui_lists.inc:2162
 #: ../reporting/includes/excel_report.inc:232
 #: ../reporting/includes/pdf_report.inc:264
 msgid "Active"
@@ -1941,6 +1950,7 @@ msgstr ""
 #: ../purchasing/inquiry/supplier_inquiry.php:173
 #: ../reporting/rep102.php:134
 #: ../reporting/rep202.php:139
+#: ../reporting/rep402.php:103
 #: ../reporting/rep501.php:87
 #: ../reporting/rep601.php:79
 #: ../reporting/rep602.php:80
@@ -1948,11 +1958,11 @@ msgstr ""
 #: ../reporting/rep704.php:83
 #: ../reporting/rep704.php:86
 #: ../reporting/rep704.php:89
-#: ../reporting/rep709.php:107
+#: ../reporting/rep709.php:112
 #: ../reporting/rep710.php:78
 #: ../reporting/rep710.php:86
-#: ../reporting/reports_main.php:333
-#: ../reporting/reports_main.php:497
+#: ../reporting/reports_main.php:340
+#: ../reporting/reports_main.php:504
 #: ../reporting/includes/doctext.inc:162
 #: ../reporting/includes/doctext.inc:203
 #: ../reporting/includes/doctext.inc:222
@@ -2206,13 +2216,13 @@ msgstr ""
 #: ../includes/ui/simple_crud_class.inc:231
 #: ../includes/ui/ui_controls.inc:596
 #: ../includes/ui/ui_input.inc:211
-#: ../inventory/includes/item_adjustments_ui.inc:159
-#: ../inventory/includes/stock_transfers_ui.inc:139
+#: ../inventory/includes/item_adjustments_ui.inc:165
+#: ../inventory/includes/stock_transfers_ui.inc:145
 #: ../inventory/manage/items.php:427
-#: ../manufacturing/includes/work_order_issue_ui.inc:133
+#: ../manufacturing/includes/work_order_issue_ui.inc:140
 #: ../purchasing/includes/ui/po_ui.inc:461
 #: ../sales/includes/ui/sales_credit_ui.inc:295
-#: ../sales/includes/ui/sales_order_ui.inc:563
+#: ../sales/includes/ui/sales_order_ui.inc:548
 #: ../taxes/sav.tax_types.php:173
 #: ../taxes/sav.tax_types.php:253
 #: ../taxes/sav.tax_types.php:256
@@ -2226,7 +2236,7 @@ msgstr ""
 
 #: ../admin/shipping_companies.php:15
 #: ../sales/customer_credit_invoice.php:254
-#: ../sales/customer_delivery.php:382
+#: ../sales/customer_delivery.php:392
 #: ../sales/customer_invoice.php:497
 #: ../sales/view/view_credit.php:74
 #: ../sales/view/view_dispatch.php:92
@@ -2312,15 +2322,15 @@ msgid "Unspecified tag type"
 msgstr ""
 
 #: ../admin/tags.php:40
-#: ../reporting/reports_main.php:356
-#: ../reporting/reports_main.php:365
-#: ../reporting/reports_main.php:377
-#: ../reporting/reports_main.php:408
-#: ../reporting/reports_main.php:416
-#: ../reporting/reports_main.php:427
-#: ../reporting/reports_main.php:455
+#: ../reporting/reports_main.php:363
+#: ../reporting/reports_main.php:372
+#: ../reporting/reports_main.php:384
+#: ../reporting/reports_main.php:415
+#: ../reporting/reports_main.php:423
+#: ../reporting/reports_main.php:434
 #: ../reporting/reports_main.php:462
-#: ../reporting/reports_main.php:472
+#: ../reporting/reports_main.php:469
+#: ../reporting/reports_main.php:479
 msgid "Account Tags"
 msgstr ""
 
@@ -2381,64 +2391,68 @@ msgstr ""
 msgid "A new user has been added."
 msgstr ""
 
-#: ../admin/users.php:97
+#: ../admin/users.php:100
+msgid "Cannot delete this user because entries are associated with this user."
+msgstr ""
+
+#: ../admin/users.php:105
 msgid "User has been deleted."
 msgstr ""
 
-#: ../admin/users.php:114
+#: ../admin/users.php:123
 msgid "User login"
 msgstr ""
 
-#: ../admin/users.php:114
-#: ../admin/users.php:198
+#: ../admin/users.php:123
+#: ../admin/users.php:207
 #: ../includes/ui/contacts_view.inc:41
 msgid "Full Name"
 msgstr ""
 
-#: ../admin/users.php:114
+#: ../admin/users.php:123
 #: ../includes/ui/contacts_view.inc:41
 #: ../inventory/manage/locations.php:146
 #: ../reporting/rep106.php:88
-#: ../reporting/includes/header2.inc:98
+#: ../reporting/includes/header2.inc:101
 #: ../sales/manage/sales_people.php:99
 msgid "Phone"
 msgstr ""
 
-#: ../admin/users.php:115
+#: ../admin/users.php:124
 #: ../sales/manage/customer_branches.php:302
 #: ../sales/view/view_sales_order.php:96
 msgid "E-mail"
 msgstr ""
 
-#: ../admin/users.php:115
+#: ../admin/users.php:124
 msgid "Last Visit"
 msgstr ""
 
-#: ../admin/users.php:115
+#: ../admin/users.php:124
 msgid "Access Level"
 msgstr ""
 
-#: ../admin/users.php:184
+#: ../admin/users.php:193
 msgid "User Login:"
 msgstr ""
 
-#: ../admin/users.php:195
+#: ../admin/users.php:204
 msgid "Enter a new password to change, leave empty to keep current."
 msgstr ""
 
-#: ../admin/users.php:200
+#: ../admin/users.php:209
 msgid "Telephone No.:"
 msgstr ""
 
-#: ../admin/users.php:204
+#: ../admin/users.php:213
 msgid "Access Level:"
 msgstr ""
 
-#: ../admin/users.php:208
+#: ../admin/users.php:217
 msgid "User's POS"
 msgstr ""
 
-#: ../admin/users.php:213
+#: ../admin/users.php:222
 msgid "Use popup window for reports:"
 msgstr ""
 
@@ -2450,10 +2464,10 @@ msgstr ""
 #: ../admin/view_print_transaction.php:45
 #: ../admin/view_print_transaction.php:129
 #: ../includes/ui/ui_controls.inc:195
-#: ../purchasing/inquiry/po_search_completed.php:112
-#: ../purchasing/inquiry/po_search.php:93
+#: ../purchasing/inquiry/po_search_completed.php:115
+#: ../purchasing/inquiry/po_search.php:95
 #: ../sales/inquiry/customer_inquiry.php:185
-#: ../sales/inquiry/sales_deliveries_view.php:160
+#: ../sales/inquiry/sales_deliveries_view.php:162
 #: ../sales/inquiry/sales_orders_view.php:125
 msgid "Print"
 msgstr ""
@@ -2478,13 +2492,13 @@ msgstr ""
 #: ../gl/inquiry/journal_inquiry.php:53
 #: ../manufacturing/search_work_orders.php:78
 #: ../purchasing/includes/ui/invoice_ui.inc:489
-#: ../purchasing/inquiry/po_search_completed.php:74
-#: ../purchasing/inquiry/po_search.php:76
+#: ../purchasing/inquiry/po_search_completed.php:77
+#: ../purchasing/inquiry/po_search.php:78
 #: ../purchasing/inquiry/supplier_allocation_inquiry.php:57
 #: ../purchasing/inquiry/supplier_inquiry.php:55
 #: ../sales/inquiry/customer_allocation_inquiry.php:51
 #: ../sales/inquiry/customer_inquiry.php:54
-#: ../sales/inquiry/sales_deliveries_view.php:116
+#: ../sales/inquiry/sales_deliveries_view.php:118
 #: ../sales/inquiry/sales_orders_view.php:270
 msgid "Search"
 msgstr ""
@@ -2531,8 +2545,8 @@ msgstr ""
 #: ../purchasing/view/view_supp_credit.php:43
 #: ../purchasing/view/view_supp_invoice.php:47
 #: ../purchasing/view/view_supp_payment.php:73
-#: ../purchasing/inquiry/po_search_completed.php:121
-#: ../purchasing/inquiry/po_search.php:131
+#: ../purchasing/inquiry/po_search_completed.php:124
+#: ../purchasing/inquiry/po_search.php:133
 #: ../purchasing/inquiry/supplier_allocation_inquiry.php:128
 #: ../purchasing/inquiry/supplier_inquiry.php:175
 #: ../purchasing/allocations/supplier_allocation_main.php:96
@@ -2543,8 +2557,8 @@ msgstr ""
 #: ../reporting/includes/doctext.inc:221
 #: ../sales/customer_credit_invoice.php:245
 #: ../sales/customer_credit_invoice.php:247
-#: ../sales/customer_delivery.php:362
-#: ../sales/customer_delivery.php:364
+#: ../sales/customer_delivery.php:372
+#: ../sales/customer_delivery.php:374
 #: ../sales/customer_invoice.php:469
 #: ../sales/customer_invoice.php:471
 #: ../sales/allocations/customer_allocation_main.php:95
@@ -2554,10 +2568,10 @@ msgstr ""
 #: ../sales/view/view_sales_order.php:94
 #: ../sales/inquiry/customer_allocation_inquiry.php:146
 #: ../sales/inquiry/customer_inquiry.php:203
-#: ../sales/inquiry/sales_deliveries_view.php:184
+#: ../sales/inquiry/sales_deliveries_view.php:186
 #: ../sales/includes/ui/sales_credit_ui.inc:85
 #: ../sales/includes/ui/sales_credit_ui.inc:87
-#: ../sales/includes/ui/sales_order_ui.inc:379
+#: ../sales/includes/ui/sales_order_ui.inc:364
 msgid "Reference"
 msgstr ""
 
@@ -2582,8 +2596,8 @@ msgstr ""
 #: ../inventory/view/view_adjustment.php:45
 #: ../inventory/view/view_transfer.php:47
 #: ../manufacturing/search_work_orders.php:166
-#: ../manufacturing/work_order_entry.php:419
-#: ../manufacturing/work_order_entry.php:425
+#: ../manufacturing/work_order_entry.php:417
+#: ../manufacturing/work_order_entry.php:423
 #: ../manufacturing/view/wo_costs_view.php:46
 #: ../manufacturing/view/wo_production_view.php:45
 #: ../manufacturing/includes/manufacturing_ui.inc:157
@@ -2602,19 +2616,20 @@ msgstr ""
 #: ../reporting/rep107.php:202
 #: ../reporting/rep201.php:110
 #: ../reporting/rep306.php:141
+#: ../reporting/rep402.php:103
 #: ../reporting/rep501.php:87
 #: ../reporting/rep601.php:79
 #: ../reporting/rep602.php:80
 #: ../reporting/rep704.php:83
 #: ../reporting/rep704.php:86
 #: ../reporting/rep704.php:89
-#: ../reporting/rep709.php:111
+#: ../reporting/rep709.php:116
 #: ../reporting/rep710.php:77
 #: ../reporting/includes/doctext.inc:167
 #: ../reporting/includes/doctext.inc:208
 #: ../reporting/includes/doctext.inc:246
-#: ../reporting/includes/header2.inc:135
-#: ../sales/customer_delivery.php:392
+#: ../reporting/includes/header2.inc:138
+#: ../sales/customer_delivery.php:402
 #: ../sales/customer_invoice.php:512
 #: ../sales/allocations/customer_allocation_main.php:96
 #: ../sales/view/view_credit.php:69
@@ -2662,9 +2677,9 @@ msgstr ""
 #: ../gl/inquiry/journal_inquiry.php:56
 #: ../gl/manage/revaluate_currencies.php:106
 #: ../includes/ui/ui_view.inc:344
-#: ../manufacturing/work_order_add_finished.php:210
+#: ../manufacturing/work_order_add_finished.php:207
 #: ../manufacturing/work_order_costs.php:146
-#: ../manufacturing/work_order_entry.php:451
+#: ../manufacturing/work_order_entry.php:449
 #: ../manufacturing/work_order_release.php:103
 #: ../purchasing/includes/ui/invoice_ui.inc:195
 #: ../purchasing/includes/ui/po_ui.inc:494
@@ -2712,7 +2727,7 @@ msgstr ""
 #: ../purchasing/po_receive_items.php:174
 #: ../purchasing/supplier_payment.php:185
 #: ../sales/customer_credit_invoice.php:91
-#: ../sales/sales_order_entry.php:363
+#: ../sales/sales_order_entry.php:366
 #: ../sales/manage/recurrent_invoices.php:41
 #: ../sales/manage/recurrent_invoices.php:46
 #: ../sales/manage/recurrent_invoices.php:51
@@ -2751,8 +2766,8 @@ msgid "Closing Year"
 msgstr ""
 
 #: ../admin/db/fiscalyears_db.inc:219
-#: ../reporting/rep101.php:175
-#: ../reporting/rep201.php:170
+#: ../reporting/rep101.php:173
+#: ../reporting/rep201.php:165
 #: ../reporting/rep706.php:185
 msgid "Open Balance"
 msgstr ""
@@ -2788,13 +2803,13 @@ msgstr ""
 msgid "The language files folder "
 msgstr ""
 
-#: ../admin/db/maintenance_db.inc:389
+#: ../admin/db/maintenance_db.inc:391
 msgid ""
 "This is new format backup file which cannot be restored on database not "
 "migrated to utf8."
 msgstr ""
 
-#: ../admin/db/maintenance_db.inc:471
+#: ../admin/db/maintenance_db.inc:473
 #, php-format
 msgid "SQL script execution failed in line %d: %s"
 msgstr ""
@@ -3022,9 +3037,9 @@ msgid "Ta&x Inquiry"
 msgstr ""
 
 #: ../applications/generalledger.php:44
-#: ../reporting/reports_main.php:383
-#: ../reporting/reports_main.php:433
-#: ../reporting/reports_main.php:478
+#: ../reporting/reports_main.php:390
+#: ../reporting/reports_main.php:440
+#: ../reporting/reports_main.php:485
 msgid "Trial &Balance"
 msgstr ""
 
@@ -3402,10 +3417,11 @@ msgstr ""
 #: ../gl/gl_journal.php:182
 #: ../gl/manage/revaluate_currencies.php:72
 #: ../inventory/adjustments.php:101
-#: ../inventory/transfers.php:97
+#: ../inventory/transfers.php:96
 #: ../manufacturing/work_order_add_finished.php:84
 #: ../manufacturing/work_order_entry.php:139
 #: ../manufacturing/work_order_issue.php:97
+#: ../manufacturing/work_order_issue.php.orig:97
 #: ../purchasing/po_entry_items.php:365
 #: ../purchasing/po_receive_items.php:193
 #: ../purchasing/supplier_credit.php:182
@@ -3414,11 +3430,11 @@ msgstr ""
 #: ../sales/create_recurrent_invoices.php:57
 #: ../sales/credit_note_entry.php:181
 #: ../sales/customer_credit_invoice.php:205
-#: ../sales/customer_delivery.php:324
+#: ../sales/customer_delivery.php:334
 #: ../sales/customer_invoice.php:388
 #: ../sales/customer_payments.php:169
 #: ../sales/customer_payments.php:176
-#: ../sales/sales_order_entry.php:461
+#: ../sales/sales_order_entry.php:475
 msgid "The entered reference is already in use."
 msgstr ""
 
@@ -3428,7 +3444,7 @@ msgstr ""
 
 #: ../dimensions/dimension_entry.php:138
 #: ../manufacturing/work_order_entry.php:154
-#: ../manufacturing/work_order_entry.php:234
+#: ../manufacturing/work_order_entry.php:232
 #: ../purchasing/po_entry_items.php:238
 msgid "The date entered is in an invalid format."
 msgstr ""
@@ -3462,28 +3478,28 @@ msgstr ""
 #: ../reporting/reports_main.php:258
 #: ../reporting/reports_main.php:266
 #: ../reporting/reports_main.php:274
-#: ../reporting/reports_main.php:311
-#: ../reporting/reports_main.php:319
-#: ../reporting/reports_main.php:331
-#: ../reporting/reports_main.php:343
-#: ../reporting/reports_main.php:361
-#: ../reporting/reports_main.php:372
-#: ../reporting/reports_main.php:384
-#: ../reporting/reports_main.php:397
-#: ../reporting/reports_main.php:413
-#: ../reporting/reports_main.php:423
-#: ../reporting/reports_main.php:434
-#: ../reporting/reports_main.php:446
-#: ../reporting/reports_main.php:460
-#: ../reporting/reports_main.php:469
-#: ../reporting/reports_main.php:479
-#: ../reporting/reports_main.php:488
+#: ../reporting/reports_main.php:318
+#: ../reporting/reports_main.php:326
+#: ../reporting/reports_main.php:338
+#: ../reporting/reports_main.php:350
+#: ../reporting/reports_main.php:368
+#: ../reporting/reports_main.php:379
+#: ../reporting/reports_main.php:391
+#: ../reporting/reports_main.php:404
+#: ../reporting/reports_main.php:420
+#: ../reporting/reports_main.php:430
+#: ../reporting/reports_main.php:441
+#: ../reporting/reports_main.php:453
+#: ../reporting/reports_main.php:467
+#: ../reporting/reports_main.php:476
+#: ../reporting/reports_main.php:486
 #: ../reporting/reports_main.php:495
+#: ../reporting/reports_main.php:502
 msgid "Start Date"
 msgstr ""
 
 #: ../dimensions/dimension_entry.php:279
-#: ../manufacturing/work_order_entry.php:420
+#: ../manufacturing/work_order_entry.php:418
 msgid "Date Required By"
 msgstr ""
 
@@ -3661,11 +3677,11 @@ msgstr ""
 #: ../inventory/includes/item_adjustments_ui.inc:35
 #: ../inventory/includes/stock_transfers_ui.inc:40
 #: ../manufacturing/search_work_orders.php:67
-#: ../manufacturing/work_order_add_finished.php:198
+#: ../manufacturing/work_order_add_finished.php:195
 #: ../manufacturing/work_order_costs.php:134
-#: ../manufacturing/work_order_entry.php:378
-#: ../manufacturing/work_order_entry.php:385
-#: ../manufacturing/includes/work_order_issue_ui.inc:156
+#: ../manufacturing/work_order_entry.php:376
+#: ../manufacturing/work_order_entry.php:383
+#: ../manufacturing/includes/work_order_issue_ui.inc:163
 #: ../purchasing/includes/ui/invoice_ui.inc:119
 #: ../purchasing/includes/ui/po_ui.inc:188
 #: ../purchasing/includes/ui/po_ui.inc:193
@@ -3676,7 +3692,7 @@ msgstr ""
 
 #: ../dimensions/inquiry/search_dimensions.php:75
 #: ../includes/ui/allocation_cart.inc:314
-#: ../includes/ui/ui_lists.inc:1927
+#: ../includes/ui/ui_lists.inc:1929
 #: ../reporting/rep101.php:100
 #: ../reporting/rep102.php:96
 #: ../reporting/rep104.php:97
@@ -3687,8 +3703,8 @@ msgstr ""
 #: ../reporting/rep202.php:100
 #: ../reporting/rep203.php:74
 #: ../reporting/rep204.php:77
-#: ../reporting/rep301.php:92
-#: ../reporting/rep301.php:99
+#: ../reporting/rep301.php:156
+#: ../reporting/rep301.php:163
 #: ../reporting/rep302.php:105
 #: ../reporting/rep302.php:112
 #: ../reporting/rep303.php:96
@@ -3702,9 +3718,11 @@ msgstr ""
 #: ../reporting/rep306.php:135
 #: ../reporting/rep307.php:103
 #: ../reporting/rep307.php:110
-#: ../reporting/rep308.php:138
-#: ../reporting/rep308.php:143
+#: ../reporting/rep308.php:219
+#: ../reporting/rep308.php:224
 #: ../reporting/rep309.php:92
+#: ../reporting/rep402.php:87
+#: ../reporting/rep402.php:95
 #: ../reporting/rep702.php:61
 #: ../reporting/rep710.php:86
 #: ../reporting/rep710.php:87
@@ -3770,7 +3788,7 @@ msgstr ""
 #: ../sales/view/view_invoice.php:96
 #: ../sales/inquiry/customer_allocation_inquiry.php:149
 #: ../sales/inquiry/customer_inquiry.php:205
-#: ../sales/includes/ui/sales_order_ui.inc:602
+#: ../sales/includes/ui/sales_order_ui.inc:587
 msgid "Due Date"
 msgstr ""
 
@@ -3833,11 +3851,12 @@ msgstr ""
 #: ../gl/gl_journal.php:168
 #: ../gl/manage/revaluate_currencies.php:59
 #: ../inventory/adjustments.php:114
-#: ../inventory/transfers.php:109
+#: ../inventory/transfers.php:108
 #: ../manufacturing/work_order_add_finished.php:104
 #: ../manufacturing/work_order_costs.php:86
 #: ../manufacturing/work_order_entry.php:160
 #: ../manufacturing/work_order_issue.php:84
+#: ../manufacturing/work_order_issue.php.orig:84
 #: ../purchasing/po_entry_items.php:342
 #: ../purchasing/po_receive_items.php:179
 #: ../purchasing/supplier_credit.php:202
@@ -3849,7 +3868,7 @@ msgstr ""
 #: ../sales/customer_delivery.php:165
 #: ../sales/customer_invoice.php:327
 #: ../sales/customer_payments.php:156
-#: ../sales/sales_order_entry.php:368
+#: ../sales/sales_order_entry.php:371
 msgid ""
 "The entered date is out of fiscal year or is closed for further data entry."
 msgstr ""
@@ -3941,31 +3960,31 @@ msgstr ""
 #: ../reporting/rep708.php:201
 #: ../reporting/rep708.php:203
 #: ../reporting/rep708.php:210
-#: ../reporting/reports_main.php:347
-#: ../reporting/reports_main.php:348
 #: ../reporting/reports_main.php:354
 #: ../reporting/reports_main.php:355
-#: ../reporting/reports_main.php:363
-#: ../reporting/reports_main.php:364
-#: ../reporting/reports_main.php:375
-#: ../reporting/reports_main.php:376
-#: ../reporting/reports_main.php:388
-#: ../reporting/reports_main.php:389
-#: ../reporting/reports_main.php:401
-#: ../reporting/reports_main.php:407
-#: ../reporting/reports_main.php:415
-#: ../reporting/reports_main.php:426
-#: ../reporting/reports_main.php:438
-#: ../sales/customer_delivery.php:409
-#: ../sales/customer_delivery.php:417
+#: ../reporting/reports_main.php:361
+#: ../reporting/reports_main.php:362
+#: ../reporting/reports_main.php:370
+#: ../reporting/reports_main.php:371
+#: ../reporting/reports_main.php:382
+#: ../reporting/reports_main.php:383
+#: ../reporting/reports_main.php:395
+#: ../reporting/reports_main.php:396
+#: ../reporting/reports_main.php:408
+#: ../reporting/reports_main.php:414
+#: ../reporting/reports_main.php:422
+#: ../reporting/reports_main.php:433
+#: ../reporting/reports_main.php:445
+#: ../sales/customer_delivery.php:419
+#: ../sales/customer_delivery.php:427
 #: ../sales/customer_invoice.php:484
 #: ../sales/customer_invoice.php:527
 #: ../sales/manage/customers.php:274
 #: ../sales/manage/customers.php:276
 #: ../sales/includes/ui/sales_credit_ui.inc:132
 #: ../sales/includes/ui/sales_credit_ui.inc:137
-#: ../sales/includes/ui/sales_order_ui.inc:457
-#: ../sales/includes/ui/sales_order_ui.inc:462
+#: ../sales/includes/ui/sales_order_ui.inc:442
+#: ../sales/includes/ui/sales_order_ui.inc:447
 msgid "Dimension"
 msgstr ""
 
@@ -3993,15 +4012,15 @@ msgstr ""
 #: ../gl/includes/ui/gl_journal_ui.inc:90
 #: ../gl/includes/ui/gl_journal_ui.inc:93
 #: ../gl/includes/ui/gl_journal_ui.inc:276
-#: ../inventory/includes/item_adjustments_ui.inc:181
-#: ../inventory/includes/stock_transfers_ui.inc:161
+#: ../inventory/includes/item_adjustments_ui.inc:187
+#: ../inventory/includes/stock_transfers_ui.inc:167
 #: ../manufacturing/view/wo_costs_view.php:46
-#: ../manufacturing/includes/work_order_issue_ui.inc:169
+#: ../manufacturing/includes/work_order_issue_ui.inc:176
 #: ../purchasing/includes/ui/invoice_ui.inc:280
 #: ../purchasing/includes/ui/invoice_ui.inc:282
 #: ../purchasing/includes/ui/invoice_ui.inc:284
 #: ../sales/customer_credit_invoice.php:364
-#: ../sales/customer_delivery.php:543
+#: ../sales/customer_delivery.php:559
 #: ../sales/includes/ui/sales_credit_ui.inc:339
 msgid "Memo"
 msgstr ""
@@ -4070,7 +4089,7 @@ msgstr ""
 #: ../gl/includes/ui/gl_bank_ui.inc:159
 #: ../includes/sysnames.inc:133
 #: ../includes/ui/allocation_cart.inc:290
-#: ../includes/ui/ui_lists.inc:1185
+#: ../includes/ui/ui_lists.inc:1187
 #: ../manufacturing/view/wo_costs_view.php:46
 #: ../manufacturing/includes/manufacturing_ui.inc:236
 #: ../purchasing/includes/ui/invoice_ui.inc:280
@@ -4083,7 +4102,7 @@ msgstr ""
 #: ../reporting/rep107.php:265
 #: ../reporting/rep109.php:195
 #: ../reporting/rep110.php:193
-#: ../reporting/rep111.php:174
+#: ../reporting/rep111.php:192
 #: ../reporting/rep113.php:178
 #: ../reporting/rep202.php:253
 #: ../reporting/rep209.php:195
@@ -4289,10 +4308,11 @@ msgstr ""
 #: ../gl/gl_journal.php:174
 #: ../gl/manage/revaluate_currencies.php:65
 #: ../inventory/adjustments.php:94
-#: ../inventory/transfers.php:91
+#: ../inventory/transfers.php:90
 #: ../manufacturing/work_order_add_finished.php:77
 #: ../manufacturing/work_order_entry.php:132
 #: ../manufacturing/work_order_issue.php:90
+#: ../manufacturing/work_order_issue.php.orig:90
 #: ../purchasing/po_receive_items.php:186
 #: ../purchasing/supplier_payment.php:207
 #: ../sales/credit_note_entry.php:147
@@ -4300,7 +4320,7 @@ msgstr ""
 #: ../sales/customer_delivery.php:178
 #: ../sales/customer_invoice.php:341
 #: ../sales/customer_payments.php:162
-#: ../sales/sales_order_entry.php:432
+#: ../sales/sales_order_entry.php:446
 msgid "You must enter a reference."
 msgstr ""
 
@@ -4496,7 +4516,7 @@ msgstr ""
 #: ../reporting/rep305.php:106
 #: ../reporting/rep306.php:148
 #: ../reporting/rep307.php:122
-#: ../reporting/rep308.php:155
+#: ../reporting/rep308.php:236
 #: ../reporting/rep309.php:103
 #: ../reporting/rep601.php:85
 #: ../reporting/rep602.php:86
@@ -4515,7 +4535,7 @@ msgstr ""
 #: ../reporting/rep708.php:200
 #: ../reporting/rep708.php:209
 #: ../reporting/rep708.php:216
-#: ../reporting/rep709.php:106
+#: ../reporting/rep709.php:111
 #: ../reporting/rep710.php:85
 msgid "Period"
 msgstr ""
@@ -4542,7 +4562,7 @@ msgstr ""
 #: ../gl/includes/ui/gl_bank_ui.inc:202
 #: ../gl/includes/ui/gl_journal_ui.inc:153
 #: ../inventory/includes/item_adjustments_ui.inc:63
-#: ../inventory/includes/item_adjustments_ui.inc:102
+#: ../inventory/includes/item_adjustments_ui.inc:106
 #: ../manufacturing/includes/manufacturing_ui.inc:178
 #: ../purchasing/includes/ui/invoice_ui.inc:344
 #: ../purchasing/includes/ui/invoice_ui.inc:510
@@ -4555,13 +4575,13 @@ msgstr ""
 #: ../reporting/rep106.php:119
 #: ../reporting/rep106.php:162
 #: ../reporting/rep114.php:161
-#: ../reporting/rep201.php:223
+#: ../reporting/rep201.php:224
 #: ../reporting/rep203.php:94
 #: ../reporting/rep203.php:171
 #: ../reporting/rep204.php:113
 #: ../reporting/rep204.php:141
-#: ../reporting/rep301.php:133
-#: ../reporting/rep301.php:170
+#: ../reporting/rep301.php:197
+#: ../reporting/rep301.php:245
 #: ../reporting/rep304.php:146
 #: ../reporting/rep304.php:188
 #: ../reporting/rep305.php:101
@@ -4574,6 +4594,7 @@ msgstr ""
 #: ../reporting/rep306.php:261
 #: ../reporting/rep306.php:276
 #: ../reporting/rep306.php:287
+#: ../reporting/rep308.php:311
 #: ../reporting/rep309.php:126
 #: ../reporting/rep309.php:153
 #: ../reporting/rep702.php:142
@@ -4588,7 +4609,7 @@ msgstr ""
 #: ../reporting/includes/doctext.inc:30
 #: ../reporting/includes/doctext.inc:192
 #: ../sales/customer_credit_invoice.php:281
-#: ../sales/customer_delivery.php:447
+#: ../sales/customer_delivery.php:457
 #: ../sales/customer_invoice.php:551
 #: ../sales/customer_invoice.php:554
 #: ../sales/allocations/customer_allocation_main.php:99
@@ -4600,7 +4621,7 @@ msgstr ""
 #: ../sales/view/view_sales_order.php:179
 #: ../sales/view/view_sales_order.php:220
 #: ../sales/includes/ui/sales_credit_ui.inc:168
-#: ../sales/includes/ui/sales_order_ui.inc:147
+#: ../sales/includes/ui/sales_order_ui.inc:148
 msgid "Total"
 msgstr ""
 
@@ -4786,9 +4807,9 @@ msgid "No zero values"
 msgstr ""
 
 #: ../gl/inquiry/gl_trial_balance.php:61
-#: ../reporting/reports_main.php:387
-#: ../reporting/reports_main.php:437
-#: ../reporting/reports_main.php:482
+#: ../reporting/reports_main.php:394
+#: ../reporting/reports_main.php:444
+#: ../reporting/reports_main.php:489
 msgid "Only balances"
 msgstr ""
 
@@ -4866,7 +4887,7 @@ msgstr ""
 #: ../gl/inquiry/journal_inquiry.php:134
 #: ../reporting/rep710.php:77
 #: ../reporting/rep710.php:87
-#: ../reporting/reports_main.php:498
+#: ../reporting/reports_main.php:505
 msgid "User"
 msgstr ""
 
@@ -4876,26 +4897,26 @@ msgstr ""
 
 #: ../gl/inquiry/profit_loss.php:173
 #: ../reporting/rep707.php:210
-#: ../reporting/includes/reports_classes.inc:245
+#: ../reporting/includes/reports_classes.inc:248
 msgid "Accumulated"
 msgstr ""
 
 #: ../gl/inquiry/profit_loss.php:173
 #: ../reporting/rep707.php:255
-#: ../reporting/includes/reports_classes.inc:245
+#: ../reporting/includes/reports_classes.inc:248
 msgid "Period Y-1"
 msgstr ""
 
 #: ../gl/inquiry/profit_loss.php:173
 #: ../reporting/rep707.php:246
-#: ../reporting/includes/reports_classes.inc:245
+#: ../reporting/includes/reports_classes.inc:248
 msgid "Budget"
 msgstr ""
 
 #: ../gl/inquiry/profit_loss.php:174
-#: ../reporting/reports_main.php:374
-#: ../reporting/reports_main.php:425
-#: ../reporting/reports_main.php:471
+#: ../reporting/reports_main.php:381
+#: ../reporting/reports_main.php:432
+#: ../reporting/reports_main.php:478
 msgid "Compare to"
 msgstr ""
 
@@ -4913,12 +4934,12 @@ msgid "Tax Inquiry"
 msgstr ""
 
 #: ../gl/inquiry/tax_inquiry.php:82
-#: ../reporting/rep709.php:183
+#: ../reporting/rep709.php:188
 msgid "Outputs"
 msgstr ""
 
 #: ../gl/inquiry/tax_inquiry.php:82
-#: ../reporting/rep709.php:183
+#: ../reporting/rep709.php:188
 msgid "Inputs"
 msgstr ""
 
@@ -4927,7 +4948,7 @@ msgid "Charged on sales"
 msgstr ""
 
 #: ../gl/inquiry/tax_inquiry.php:100
-#: ../reporting/rep709.php:183
+#: ../reporting/rep709.php:188
 msgid "Output Tax"
 msgstr ""
 
@@ -4936,7 +4957,7 @@ msgid "Paid on purchases"
 msgstr ""
 
 #: ../gl/inquiry/tax_inquiry.php:106
-#: ../reporting/rep709.php:183
+#: ../reporting/rep709.php:188
 msgid "Input Tax"
 msgstr ""
 
@@ -4945,13 +4966,13 @@ msgid "Net payable or collectible"
 msgstr ""
 
 #: ../gl/inquiry/tax_inquiry.php:119
-#: ../reporting/rep709.php:214
+#: ../reporting/rep709.php:219
 msgid "Total payable or refund"
 msgstr ""
 
 #: ../gl/manage/bank_accounts.php:16
-#: ../reporting/reports_main.php:310
-#: ../reporting/reports_main.php:318
+#: ../reporting/reports_main.php:317
+#: ../reporting/reports_main.php:325
 msgid "Bank Accounts"
 msgstr ""
 
@@ -4996,8 +5017,8 @@ msgstr ""
 #: ../inventory/purchasing_data.php:148
 #: ../purchasing/view/view_supp_credit.php:49
 #: ../purchasing/view/view_supp_invoice.php:54
-#: ../purchasing/inquiry/po_search_completed.php:126
-#: ../purchasing/inquiry/po_search.php:136
+#: ../purchasing/inquiry/po_search_completed.php:129
+#: ../purchasing/inquiry/po_search.php:138
 #: ../purchasing/inquiry/supplier_allocation_inquiry.php:133
 #: ../purchasing/inquiry/supplier_allocation_inquiry.php:143
 #: ../purchasing/inquiry/supplier_inquiry.php:73
@@ -5015,7 +5036,7 @@ msgstr ""
 #: ../reporting/rep203.php:101
 #: ../reporting/rep205.php:150
 #: ../sales/customer_credit_invoice.php:237
-#: ../sales/customer_delivery.php:354
+#: ../sales/customer_delivery.php:364
 #: ../sales/customer_invoice.php:479
 #: ../sales/allocations/customer_allocation_main.php:98
 #: ../sales/allocations/customer_allocation_main.php:106
@@ -5027,7 +5048,7 @@ msgstr ""
 #: ../sales/inquiry/customer_inquiry.php:76
 #: ../sales/inquiry/customer_inquiry.php:208
 #: ../sales/inquiry/customer_inquiry.php:221
-#: ../sales/inquiry/sales_deliveries_view.php:189
+#: ../sales/inquiry/sales_deliveries_view.php:191
 #: ../sales/inquiry/sales_orders_view.php:295
 #: ../sales/inquiry/sales_orders_view.php:309
 msgid "Currency"
@@ -5634,7 +5655,7 @@ msgid "Posted"
 msgstr ""
 
 #: ../gl/manage/gl_quick_entries.php:329
-#: ../sales/customer_delivery.php:447
+#: ../sales/customer_delivery.php:457
 #: ../sales/customer_invoice.php:551
 #: ../sales/customer_invoice.php:554
 msgid "Tax Type"
@@ -5718,7 +5739,7 @@ msgstr ""
 #: ../reporting/reports_main.php:143
 #: ../reporting/reports_main.php:192
 #: ../reporting/reports_main.php:199
-#: ../reporting/reports_main.php:289
+#: ../reporting/reports_main.php:296
 msgid "From"
 msgstr ""
 
@@ -5858,7 +5879,7 @@ msgstr ""
 #: ../reporting/reports_main.php:144
 #: ../reporting/reports_main.php:193
 #: ../reporting/reports_main.php:200
-#: ../reporting/reports_main.php:290
+#: ../reporting/reports_main.php:297
 msgid "To"
 msgstr ""
 
@@ -5876,7 +5897,7 @@ msgstr ""
 #: ../gl/includes/ui/gl_journal_ui.inc:27
 #: ../inventory/includes/item_adjustments_ui.inc:39
 #: ../inventory/includes/stock_transfers_ui.inc:42
-#: ../manufacturing/work_order_add_finished.php:208
+#: ../manufacturing/work_order_add_finished.php:205
 #: ../manufacturing/work_order_costs.php:133
 #: ../purchasing/allocations/supplier_allocate.php:56
 #: ../sales/allocations/customer_allocate.php:54
@@ -5906,7 +5927,7 @@ msgstr ""
 #: ../gl/includes/ui/gl_bank_ui.inc:67
 #: ../sales/manage/recurrent_invoices.php:169
 #: ../sales/includes/ui/sales_credit_ui.inc:29
-#: ../sales/includes/ui/sales_order_ui.inc:285
+#: ../sales/includes/ui/sales_order_ui.inc:270
 msgid "Customer:"
 msgstr ""
 
@@ -5914,7 +5935,7 @@ msgstr ""
 #: ../sales/customer_payments.php:348
 #: ../sales/manage/recurrent_invoices.php:172
 #: ../sales/includes/ui/sales_credit_ui.inc:37
-#: ../sales/includes/ui/sales_order_ui.inc:292
+#: ../sales/includes/ui/sales_order_ui.inc:277
 msgid "Branch:"
 msgstr ""
 
@@ -5937,70 +5958,70 @@ msgstr ""
 
 #: ../gl/includes/ui/gl_bank_ui.inc:187
 #: ../includes/ui/simple_crud_class.inc:52
-#: ../inventory/includes/item_adjustments_ui.inc:88
-#: ../inventory/includes/stock_transfers_ui.inc:80
-#: ../manufacturing/includes/work_order_issue_ui.inc:59
+#: ../inventory/includes/item_adjustments_ui.inc:92
+#: ../inventory/includes/stock_transfers_ui.inc:84
+#: ../manufacturing/includes/work_order_issue_ui.inc:64
 #: ../purchasing/includes/ui/invoice_ui.inc:557
 #: ../purchasing/includes/ui/po_ui.inc:276
 #: ../sales/includes/ui/sales_credit_ui.inc:198
-#: ../sales/includes/ui/sales_order_ui.inc:210
+#: ../sales/includes/ui/sales_order_ui.inc:198
 msgid "Edit document line"
 msgstr ""
 
 #: ../gl/includes/ui/gl_bank_ui.inc:189
 #: ../includes/ui/simple_crud_class.inc:54
-#: ../inventory/includes/item_adjustments_ui.inc:90
-#: ../inventory/includes/stock_transfers_ui.inc:82
-#: ../manufacturing/includes/work_order_issue_ui.inc:61
+#: ../inventory/includes/item_adjustments_ui.inc:94
+#: ../inventory/includes/stock_transfers_ui.inc:86
+#: ../manufacturing/includes/work_order_issue_ui.inc:66
 #: ../purchasing/includes/ui/invoice_ui.inc:320
 #: ../purchasing/includes/ui/po_ui.inc:278
 #: ../sales/includes/ui/sales_credit_ui.inc:200
-#: ../sales/includes/ui/sales_order_ui.inc:212
+#: ../sales/includes/ui/sales_order_ui.inc:200
 msgid "Remove line from document"
 msgstr ""
 
 #: ../gl/includes/ui/gl_bank_ui.inc:278
 #: ../gl/includes/ui/gl_journal_ui.inc:258
 #: ../includes/ui/simple_crud_class.inc:56
-#: ../inventory/includes/item_adjustments_ui.inc:158
-#: ../inventory/includes/stock_transfers_ui.inc:138
-#: ../manufacturing/includes/work_order_issue_ui.inc:132
+#: ../inventory/includes/item_adjustments_ui.inc:164
+#: ../inventory/includes/stock_transfers_ui.inc:144
+#: ../manufacturing/includes/work_order_issue_ui.inc:139
 #: ../purchasing/includes/ui/po_ui.inc:460
 #: ../sales/includes/ui/sales_credit_ui.inc:294
-#: ../sales/includes/ui/sales_order_ui.inc:562
+#: ../sales/includes/ui/sales_order_ui.inc:547
 msgid "Confirm changes"
 msgstr ""
 
 #: ../gl/includes/ui/gl_bank_ui.inc:280
 #: ../gl/includes/ui/gl_journal_ui.inc:260
 #: ../includes/ui/simple_crud_class.inc:58
-#: ../inventory/includes/item_adjustments_ui.inc:160
-#: ../inventory/includes/stock_transfers_ui.inc:140
-#: ../manufacturing/includes/work_order_issue_ui.inc:134
+#: ../inventory/includes/item_adjustments_ui.inc:166
+#: ../inventory/includes/stock_transfers_ui.inc:146
+#: ../manufacturing/includes/work_order_issue_ui.inc:141
 #: ../purchasing/includes/ui/po_ui.inc:462
 #: ../sales/includes/ui/sales_credit_ui.inc:296
-#: ../sales/includes/ui/sales_order_ui.inc:564
+#: ../sales/includes/ui/sales_order_ui.inc:549
 msgid "Cancel changes"
 msgstr ""
 
 #: ../gl/includes/ui/gl_bank_ui.inc:285
 #: ../gl/includes/ui/gl_journal_ui.inc:264
-#: ../inventory/includes/item_adjustments_ui.inc:166
-#: ../inventory/includes/stock_transfers_ui.inc:146
-#: ../manufacturing/includes/work_order_issue_ui.inc:140
+#: ../inventory/includes/item_adjustments_ui.inc:172
+#: ../inventory/includes/stock_transfers_ui.inc:152
+#: ../manufacturing/includes/work_order_issue_ui.inc:147
 #: ../purchasing/includes/ui/po_ui.inc:468
 #: ../sales/includes/ui/sales_credit_ui.inc:302
-#: ../sales/includes/ui/sales_order_ui.inc:570
+#: ../sales/includes/ui/sales_order_ui.inc:555
 msgid "Add Item"
 msgstr ""
 
 #: ../gl/includes/ui/gl_bank_ui.inc:286
-#: ../inventory/includes/item_adjustments_ui.inc:167
-#: ../inventory/includes/stock_transfers_ui.inc:147
-#: ../manufacturing/includes/work_order_issue_ui.inc:141
+#: ../inventory/includes/item_adjustments_ui.inc:173
+#: ../inventory/includes/stock_transfers_ui.inc:153
+#: ../manufacturing/includes/work_order_issue_ui.inc:148
 #: ../purchasing/includes/ui/po_ui.inc:469
 #: ../sales/includes/ui/sales_credit_ui.inc:303
-#: ../sales/includes/ui/sales_order_ui.inc:571
+#: ../sales/includes/ui/sales_order_ui.inc:556
 msgid "Add new item to document"
 msgstr ""
 
@@ -6108,7 +6129,7 @@ msgstr ""
 
 #: ../includes/access_levels.inc:72
 #: ../inventory/manage/items.php:352
-#: ../reporting/reports_main.php:294
+#: ../reporting/reports_main.php:301
 msgid "Dimensions"
 msgstr ""
 
@@ -6633,23 +6654,23 @@ msgstr ""
 msgid "You have no edit access to transactions created by other users."
 msgstr ""
 
-#: ../includes/errors.inc:125
+#: ../includes/errors.inc:126
 msgid "in file"
 msgstr ""
 
-#: ../includes/errors.inc:125
+#: ../includes/errors.inc:126
 msgid "at line "
 msgstr ""
 
-#: ../includes/errors.inc:179
+#: ../includes/errors.inc:180
 msgid "Debug mode database warning:"
 msgstr ""
 
-#: ../includes/errors.inc:181
+#: ../includes/errors.inc:182
 msgid "DATABASE ERROR :"
 msgstr ""
 
-#: ../includes/errors.inc:216
+#: ../includes/errors.inc:217
 msgid ""
 "The entered information is a duplicate. Please go back and enter different "
 "values."
@@ -6871,7 +6892,7 @@ msgid "Sales Order"
 msgstr ""
 
 #: ../includes/sysnames.inc:41
-#: ../sales/sales_order_entry.php:657
+#: ../sales/sales_order_entry.php:658
 msgid "Sales Quotation"
 msgstr ""
 
@@ -7018,7 +7039,7 @@ msgstr ""
 #: ../reporting/reports_main.php:237
 #: ../sales/create_recurrent_invoices.php:134
 #: ../sales/customer_credit_invoice.php:235
-#: ../sales/customer_delivery.php:352
+#: ../sales/customer_delivery.php:362
 #: ../sales/customer_invoice.php:455
 #: ../sales/allocations/customer_allocation_main.php:97
 #: ../sales/allocations/customer_allocation_main.php:105
@@ -7028,7 +7049,7 @@ msgstr ""
 #: ../sales/inquiry/customer_allocation_inquiry.php:160
 #: ../sales/inquiry/customer_inquiry.php:206
 #: ../sales/inquiry/customer_inquiry.php:220
-#: ../sales/inquiry/sales_deliveries_view.php:180
+#: ../sales/inquiry/sales_deliveries_view.php:182
 #: ../sales/inquiry/sales_orders_view.php:287
 #: ../sales/inquiry/sales_orders_view.php:301
 msgid "Customer"
@@ -7043,8 +7064,8 @@ msgstr ""
 #: ../purchasing/includes/ui/po_ui.inc:325
 #: ../purchasing/view/view_supp_credit.php:42
 #: ../purchasing/view/view_supp_invoice.php:46
-#: ../purchasing/inquiry/po_search_completed.php:122
-#: ../purchasing/inquiry/po_search.php:132
+#: ../purchasing/inquiry/po_search_completed.php:125
+#: ../purchasing/inquiry/po_search.php:134
 #: ../purchasing/inquiry/supplier_allocation_inquiry.php:129
 #: ../purchasing/inquiry/supplier_allocation_inquiry.php:142
 #: ../purchasing/inquiry/supplier_inquiry.php:176
@@ -7166,6 +7187,7 @@ msgstr ""
 #: ../includes/sysnames.inc:157
 #: ../manufacturing/search_work_orders.php:165
 #: ../manufacturing/includes/manufacturing_ui.inc:278
+#: ../reporting/rep402.php:103
 msgid "Manufactured"
 msgstr ""
 
@@ -7486,8 +7508,8 @@ msgstr ""
 #: ../includes/system_tests.inc:420
 #: ../includes/ui/view_package.php:47
 #: ../reporting/rep204.php:85
-#: ../reporting/rep301.php:105
-#: ../reporting/rep308.php:150
+#: ../reporting/rep301.php:169
+#: ../reporting/rep308.php:231
 msgid "Value"
 msgstr ""
 
@@ -7524,28 +7546,29 @@ msgstr ""
 #: ../reporting/reports_main.php:277
 #: ../reporting/reports_main.php:285
 #: ../reporting/reports_main.php:292
-#: ../reporting/reports_main.php:301
-#: ../reporting/reports_main.php:314
+#: ../reporting/reports_main.php:299
+#: ../reporting/reports_main.php:308
 #: ../reporting/reports_main.php:321
-#: ../reporting/reports_main.php:327
+#: ../reporting/reports_main.php:328
 #: ../reporting/reports_main.php:334
-#: ../reporting/reports_main.php:349
-#: ../reporting/reports_main.php:357
-#: ../reporting/reports_main.php:368
-#: ../reporting/reports_main.php:380
-#: ../reporting/reports_main.php:390
-#: ../reporting/reports_main.php:402
+#: ../reporting/reports_main.php:341
+#: ../reporting/reports_main.php:356
+#: ../reporting/reports_main.php:364
+#: ../reporting/reports_main.php:375
+#: ../reporting/reports_main.php:387
+#: ../reporting/reports_main.php:397
 #: ../reporting/reports_main.php:409
-#: ../reporting/reports_main.php:419
-#: ../reporting/reports_main.php:430
-#: ../reporting/reports_main.php:439
-#: ../reporting/reports_main.php:450
-#: ../reporting/reports_main.php:456
-#: ../reporting/reports_main.php:465
-#: ../reporting/reports_main.php:475
-#: ../reporting/reports_main.php:483
-#: ../reporting/reports_main.php:491
-#: ../reporting/reports_main.php:499
+#: ../reporting/reports_main.php:416
+#: ../reporting/reports_main.php:426
+#: ../reporting/reports_main.php:437
+#: ../reporting/reports_main.php:446
+#: ../reporting/reports_main.php:457
+#: ../reporting/reports_main.php:463
+#: ../reporting/reports_main.php:472
+#: ../reporting/reports_main.php:482
+#: ../reporting/reports_main.php:490
+#: ../reporting/reports_main.php:498
+#: ../reporting/reports_main.php:506
 #: ../reporting/includes/excel_report.inc:295
 #: ../reporting/includes/excel_report.inc:428
 #: ../reporting/includes/pdf_report.inc:346
@@ -7564,13 +7587,13 @@ msgid ""
 "trail record."
 msgstr ""
 
-#: ../includes/db/inventory_db.inc:253
+#: ../includes/db/inventory_db.inc:284
 #: ../inventory/includes/db/items_trans_db.inc:66
 #, php-format
 msgid "Cost was %s changed to %s x quantity on hand for item '%s'"
 msgstr ""
 
-#: ../includes/db/inventory_db.inc:294
+#: ../includes/db/inventory_db.inc:325
 msgid "Zero/negative inventory handling"
 msgstr ""
 
@@ -7593,7 +7616,7 @@ msgstr ""
 #: ../reporting/rep704.php:83
 #: ../reporting/rep704.php:86
 #: ../reporting/rep704.php:89
-#: ../reporting/rep709.php:111
+#: ../reporting/rep709.php:116
 #: ../sales/view/view_credit.php:68
 #: ../sales/view/view_sales_order.php:109
 #: ../sales/view/view_sales_order.php:142
@@ -7658,7 +7681,7 @@ msgstr ""
 #: ../includes/ui/contacts_view.inc:41
 #: ../reporting/rep103.php:266
 #: ../reporting/rep205.php:184
-#: ../reporting/includes/header2.inc:104
+#: ../reporting/includes/header2.inc:107
 #: ../sales/manage/sales_people.php:99
 msgid "Fax"
 msgstr ""
@@ -7818,9 +7841,11 @@ msgid "Suppliers"
 msgstr ""
 
 #: ../includes/ui/ui_controls.inc:465
-#: ../inventory/transfers.php:228
+#: ../inventory/transfers.php:224
 #: ../inventory/manage/items.php:22
+#: ../reporting/rep402.php:108
 #: ../reporting/reports_main.php:253
+#: ../reporting/reports_main.php:289
 msgid "Items"
 msgstr ""
 
@@ -7829,13 +7854,13 @@ msgid "Entered data has not been saved yet.\\nDo you want to abandon changes?"
 msgstr ""
 
 #: ../includes/ui/ui_input.inc:632
-#: ../reporting/includes/reports_classes.inc:219
+#: ../reporting/includes/reports_classes.inc:222
 msgid "Click Here to Pick up the date"
 msgstr ""
 
 #: ../includes/ui/ui_input.inc:916
-#: ../includes/ui/ui_lists.inc:2160
-#: ../reporting/rep301.php:155
+#: ../includes/ui/ui_lists.inc:2162
+#: ../reporting/rep301.php:229
 #: ../reporting/rep302.php:170
 #: ../reporting/rep303.php:184
 #: ../reporting/rep304.php:170
@@ -7871,153 +7896,153 @@ msgstr ""
 msgid "Enter description fragment to search or * for all"
 msgstr ""
 
-#: ../includes/ui/ui_lists.inc:453
-#: ../includes/ui/ui_lists.inc:1389
+#: ../includes/ui/ui_lists.inc:454
+#: ../includes/ui/ui_lists.inc:1391
 msgid "All Suppliers"
 msgstr ""
 
-#: ../includes/ui/ui_lists.inc:457
+#: ../includes/ui/ui_lists.inc:458
 msgid "Press Space tab to filter by name fragment"
 msgstr ""
 
-#: ../includes/ui/ui_lists.inc:458
+#: ../includes/ui/ui_lists.inc:459
 msgid "Select supplier"
 msgstr ""
 
-#: ../includes/ui/ui_lists.inc:505
+#: ../includes/ui/ui_lists.inc:507
 msgid "All Customers"
 msgstr ""
 
-#: ../includes/ui/ui_lists.inc:509
+#: ../includes/ui/ui_lists.inc:511
 msgid "Press Space tab to filter by name fragment; F2 - entry new customer"
 msgstr ""
 
-#: ../includes/ui/ui_lists.inc:510
+#: ../includes/ui/ui_lists.inc:512
 msgid "Select customer"
 msgstr ""
 
-#: ../includes/ui/ui_lists.inc:557
+#: ../includes/ui/ui_lists.inc:559
 msgid "All branches"
 msgstr ""
 
-#: ../includes/ui/ui_lists.inc:560
+#: ../includes/ui/ui_lists.inc:562
 msgid "Select customer branch"
 msgstr ""
 
-#: ../includes/ui/ui_lists.inc:600
+#: ../includes/ui/ui_lists.inc:602
 msgid "All Locations"
 msgstr ""
 
-#: ../includes/ui/ui_lists.inc:752
-#: ../includes/ui/ui_lists.inc:820
+#: ../includes/ui/ui_lists.inc:754
+#: ../includes/ui/ui_lists.inc:822
 msgid "All Items"
 msgstr ""
 
-#: ../includes/ui/ui_lists.inc:1296
+#: ../includes/ui/ui_lists.inc:1298
 msgid "All Sales Types"
 msgstr ""
 
-#: ../includes/ui/ui_lists.inc:1633
+#: ../includes/ui/ui_lists.inc:1635
 msgid "Use Item Sales Accounts"
 msgstr ""
 
-#: ../includes/ui/ui_lists.inc:1944
-#: ../includes/ui/ui_lists.inc:1961
-#: ../includes/ui/ui_lists.inc:1978
+#: ../includes/ui/ui_lists.inc:1946
+#: ../includes/ui/ui_lists.inc:1963
+#: ../includes/ui/ui_lists.inc:1980
 msgid "All Types"
 msgstr ""
 
-#: ../includes/ui/ui_lists.inc:1945
+#: ../includes/ui/ui_lists.inc:1947
 #: ../sales/view/view_sales_order.php:140
 msgid "Sales Invoices"
 msgstr ""
 
-#: ../includes/ui/ui_lists.inc:1946
-#: ../includes/ui/ui_lists.inc:1963
-#: ../includes/ui/ui_lists.inc:1981
-msgid "Overdue Invoices"
-msgstr ""
+#: ../includes/ui/ui_lists.inc:1948
+#: ../includes/ui/ui_lists.inc:1965
+#: ../includes/ui/ui_lists.inc:1983
+msgid "Overdue Invoices"
+msgstr ""
 
-#: ../includes/ui/ui_lists.inc:1947
-#: ../includes/ui/ui_lists.inc:1964
-#: ../includes/ui/ui_lists.inc:1982
+#: ../includes/ui/ui_lists.inc:1949
+#: ../includes/ui/ui_lists.inc:1966
+#: ../includes/ui/ui_lists.inc:1984
 #: ../includes/ui/ui_view.inc:610
 #: ../includes/ui/ui_view.inc:614
 msgid "Payments"
 msgstr ""
 
-#: ../includes/ui/ui_lists.inc:1948
-#: ../includes/ui/ui_lists.inc:1965
-#: ../includes/ui/ui_lists.inc:1983
+#: ../includes/ui/ui_lists.inc:1950
+#: ../includes/ui/ui_lists.inc:1967
+#: ../includes/ui/ui_lists.inc:1985
 #: ../sales/view/view_sales_order.php:176
 msgid "Credit Notes"
 msgstr ""
 
-#: ../includes/ui/ui_lists.inc:1949
+#: ../includes/ui/ui_lists.inc:1951
 #: ../sales/view/view_sales_order.php:106
 msgid "Delivery Notes"
 msgstr ""
 
-#: ../includes/ui/ui_lists.inc:1962
-#: ../includes/ui/ui_lists.inc:1980
+#: ../includes/ui/ui_lists.inc:1964
+#: ../includes/ui/ui_lists.inc:1982
 msgid "Invoices"
 msgstr ""
 
-#: ../includes/ui/ui_lists.inc:1966
-#: ../includes/ui/ui_lists.inc:1984
+#: ../includes/ui/ui_lists.inc:1968
+#: ../includes/ui/ui_lists.inc:1986
 msgid "Overdue Credit Notes"
 msgstr ""
 
-#: ../includes/ui/ui_lists.inc:1979
+#: ../includes/ui/ui_lists.inc:1981
 msgid "GRNs"
 msgstr ""
 
-#: ../includes/ui/ui_lists.inc:1997
+#: ../includes/ui/ui_lists.inc:1999
 msgid "Automatically put balance on back order"
 msgstr ""
 
-#: ../includes/ui/ui_lists.inc:1998
+#: ../includes/ui/ui_lists.inc:2000
 msgid "Cancel any quantites not delivered"
 msgstr ""
 
-#: ../includes/ui/ui_lists.inc:2015
+#: ../includes/ui/ui_lists.inc:2017
 msgid "Items Returned to Inventory Location"
 msgstr ""
 
-#: ../includes/ui/ui_lists.inc:2016
+#: ../includes/ui/ui_lists.inc:2018
 msgid "Items Written Off"
 msgstr ""
 
-#: ../includes/ui/ui_lists.inc:2186
+#: ../includes/ui/ui_lists.inc:2188
 msgid "New role"
 msgstr ""
 
-#: ../includes/ui/ui_lists.inc:2238
+#: ../includes/ui/ui_lists.inc:2240
 msgid "No tags defined."
 msgstr ""
 
-#: ../includes/ui/ui_lists.inc:2238
+#: ../includes/ui/ui_lists.inc:2240
 msgid "No active tags defined."
 msgstr ""
 
-#: ../includes/ui/ui_lists.inc:2276
+#: ../includes/ui/ui_lists.inc:2278
 #, php-format
 msgid "Activated for '%s'"
 msgstr ""
 
-#: ../includes/ui/ui_lists.inc:2279
+#: ../includes/ui/ui_lists.inc:2281
 msgid "Available and/or installed"
 msgstr ""
 
-#: ../includes/ui/ui_lists.inc:2349
+#: ../includes/ui/ui_lists.inc:2351
 msgid "Standard new company American COA (4 digit)"
 msgstr ""
 
-#: ../includes/ui/ui_lists.inc:2351
+#: ../includes/ui/ui_lists.inc:2353
 msgid "Standard American COA (4 digit) with demo data"
 msgstr ""
 
-#: ../includes/ui/ui_lists.inc:2372
+#: ../includes/ui/ui_lists.inc:2374
 msgid "No payment Link"
 msgstr ""
 
@@ -8040,7 +8065,7 @@ msgstr ""
 #: ../reporting/rep107.php:256
 #: ../reporting/rep109.php:186
 #: ../reporting/rep110.php:184
-#: ../reporting/rep111.php:165
+#: ../reporting/rep111.php:183
 #: ../reporting/rep113.php:169
 #: ../reporting/rep209.php:186
 msgid "Total Tax Excluded"
@@ -8053,7 +8078,7 @@ msgstr ""
 #: ../reporting/rep107.php:265
 #: ../reporting/rep109.php:195
 #: ../reporting/rep110.php:193
-#: ../reporting/rep111.php:174
+#: ../reporting/rep111.php:192
 #: ../reporting/rep113.php:178
 #: ../reporting/rep209.php:195
 msgid "Included"
@@ -8265,8 +8290,8 @@ msgid "Enter &Another Adjustment"
 msgstr ""
 
 #: ../inventory/adjustments.php:88
-#: ../inventory/transfers.php:85
-#: ../sales/sales_order_entry.php:373
+#: ../inventory/transfers.php:84
+#: ../sales/sales_order_entry.php:376
 msgid "You must enter at least one non empty item line."
 msgstr ""
 
@@ -8274,27 +8299,27 @@ msgstr ""
 msgid "The entered date for the adjustment is invalid."
 msgstr ""
 
-#: ../inventory/adjustments.php:122
+#: ../inventory/adjustments.php:124
 msgid ""
-"The adjustment cannot be processed because an adjustment item would cause a "
-"negative inventory balance :"
+"The adjustment cannot be processed because it would cause negative inventory "
+"balance for marked items as of document date or later."
 msgstr ""
 
-#: ../inventory/adjustments.php:152
-#: ../manufacturing/work_order_issue.php:141
+#: ../inventory/adjustments.php:153
+#: ../manufacturing/work_order_issue.php.orig:141
 msgid "The quantity entered is negative or invalid."
 msgstr ""
 
-#: ../inventory/adjustments.php:159
-#: ../manufacturing/work_order_issue.php:148
+#: ../inventory/adjustments.php:160
+#: ../manufacturing/work_order_issue.php.orig:148
 msgid "The entered standard cost is negative or invalid."
 msgstr ""
 
-#: ../inventory/adjustments.php:228
+#: ../inventory/adjustments.php:229
 msgid "Adjustment Items"
 msgstr ""
 
-#: ../inventory/adjustments.php:234
+#: ../inventory/adjustments.php:235
 msgid "Process Adjustment"
 msgstr ""
 
@@ -8331,8 +8356,8 @@ msgstr ""
 #: ../inventory/inquiry/stock_movements.php:49
 #: ../inventory/inquiry/stock_status.php:41
 #: ../inventory/manage/item_codes.php:105
-#: ../manufacturing/work_order_entry.php:396
-#: ../manufacturing/work_order_entry.php:401
+#: ../manufacturing/work_order_entry.php:394
+#: ../manufacturing/work_order_entry.php:399
 #: ../purchasing/inquiry/po_search.php:74
 #: ../sales/inquiry/sales_deliveries_view.php:114
 #: ../sales/inquiry/sales_orders_view.php:263
@@ -8394,7 +8419,7 @@ msgstr ""
 
 #: ../inventory/prices.php:147
 #: ../reporting/rep104.php:118
-#: ../sales/customer_delivery.php:369
+#: ../sales/customer_delivery.php:379
 #: ../sales/customer_invoice.php:477
 #: ../sales/view/view_credit.php:73
 #: ../sales/view/view_dispatch.php:93
@@ -8413,7 +8438,7 @@ msgstr ""
 #: ../reporting/includes/doctext.inc:30
 #: ../reporting/includes/doctext.inc:192
 #: ../sales/customer_credit_invoice.php:281
-#: ../sales/customer_delivery.php:447
+#: ../sales/customer_delivery.php:457
 #: ../sales/customer_invoice.php:551
 #: ../sales/customer_invoice.php:554
 #: ../sales/view/view_credit.php:91
@@ -8548,18 +8573,20 @@ msgstr ""
 #: ../manufacturing/search_work_orders.php:162
 #: ../manufacturing/inquiry/where_used_inquiry.php:45
 #: ../manufacturing/manage/bom_edit.php:70
-#: ../purchasing/inquiry/po_search_completed.php:123
-#: ../purchasing/inquiry/po_search_completed.php:133
-#: ../purchasing/inquiry/po_search.php:133
-#: ../purchasing/inquiry/po_search.php:144
+#: ../purchasing/inquiry/po_search_completed.php:126
+#: ../purchasing/inquiry/po_search_completed.php:136
+#: ../purchasing/inquiry/po_search.php:135
+#: ../purchasing/inquiry/po_search.php:146
 #: ../reporting/rep105.php:120
-#: ../reporting/rep301.php:112
+#: ../reporting/rep301.php:176
 #: ../reporting/rep302.php:132
 #: ../reporting/rep303.php:134
 #: ../reporting/rep304.php:123
 #: ../reporting/rep306.php:150
 #: ../reporting/rep307.php:124
-#: ../reporting/rep308.php:157
+#: ../reporting/rep308.php:238
+#: ../reporting/rep402.php:103
+#: ../reporting/rep402.php:109
 #: ../reporting/reports_main.php:210
 #: ../reporting/reports_main.php:217
 #: ../reporting/reports_main.php:223
@@ -8567,6 +8594,7 @@ msgstr ""
 #: ../reporting/reports_main.php:251
 #: ../reporting/reports_main.php:261
 #: ../reporting/reports_main.php:269
+#: ../reporting/reports_main.php:290
 #: ../sales/manage/sales_points.php:84
 msgid "Location"
 msgstr ""
@@ -8574,9 +8602,7 @@ msgstr ""
 #: ../inventory/reorder_level.php:67
 #: ../inventory/inquiry/stock_movements.php:80
 #: ../inventory/inquiry/stock_status.php:70
-#: ../purchasing/supplier_credit.php:229
-#: ../sales/sales_order_entry.php:534
-#: ../sales/includes/ui/sales_order_ui.inc:182
+#: ../purchasing/supplier_credit.php:228
 msgid "Quantity On Hand"
 msgstr ""
 
@@ -8585,8 +8611,6 @@ msgstr ""
 #: ../inventory/inquiry/stock_status.php:70
 #: ../sales/includes/db/old.sales_order_db.inc:110
 #: ../sales/includes/db/old.sales_order_db.inc:263
-#: ../sales/includes/db/sales_order_db.inc.orig:112
-#: ../sales/includes/db/sales_order_db.inc.orig:291
 msgid "Re-Order Level"
 msgstr ""
 
@@ -8610,49 +8634,43 @@ msgstr ""
 msgid "Enter &Another Inventory Transfer"
 msgstr ""
 
-#: ../inventory/transfers.php:103
+#: ../inventory/transfers.php:102
 msgid "The entered transfer date is invalid."
 msgstr ""
 
-#: ../inventory/transfers.php:115
+#: ../inventory/transfers.php:114
 msgid "The locations to transfer from and to must be different."
 msgstr ""
 
-#: ../inventory/transfers.php:125
+#: ../inventory/transfers.php:124
 msgid ""
-"The quantity entered is greater than the available quantity for this item at "
-"the source location :"
+"The transfer cannot be processed because it would cause negative inventory "
+"balance in source location for marked items as of document date or later."
 msgstr ""
 
-#: ../inventory/transfers.php:158
+#: ../inventory/transfers.php:154
 msgid "The quantity entered must be a positive number."
 msgstr ""
 
-#: ../inventory/transfers.php:235
+#: ../inventory/transfers.php:231
 msgid "Process Transfer"
 msgstr ""
 
 #: ../inventory/includes/inventory_db.inc:69
 #: ../sales/includes/db/old.sales_order_db.inc:107
 #: ../sales/includes/db/old.sales_order_db.inc:259
-#: ../sales/includes/db/sales_order_db.inc.orig:109
-#: ../sales/includes/db/sales_order_db.inc.orig:287
 msgid "Stocks below Re-Order Level at "
 msgstr ""
 
 #: ../inventory/includes/inventory_db.inc:72
 #: ../sales/includes/db/old.sales_order_db.inc:110
 #: ../sales/includes/db/old.sales_order_db.inc:264
-#: ../sales/includes/db/sales_order_db.inc.orig:112
-#: ../sales/includes/db/sales_order_db.inc.orig:292
 msgid "Below"
 msgstr ""
 
 #: ../inventory/includes/inventory_db.inc:73
 #: ../sales/includes/db/old.sales_order_db.inc:111
 #: ../sales/includes/db/old.sales_order_db.inc:265
-#: ../sales/includes/db/sales_order_db.inc.orig:113
-#: ../sales/includes/db/sales_order_db.inc.orig:293
 msgid "Please reorder"
 msgstr ""
 
@@ -8664,7 +8682,7 @@ msgid "For Part :"
 msgstr ""
 
 #: ../inventory/includes/item_adjustments_ui.inc:34
-#: ../manufacturing/work_order_entry.php:210
+#: ../manufacturing/work_order_entry.php:209
 #: ../purchasing/inquiry/po_search.php:67
 #: ../sales/inquiry/sales_deliveries_view.php:107
 #: ../sales/inquiry/sales_orders_view.php:254
@@ -8694,7 +8712,7 @@ msgstr ""
 #: ../reporting/includes/doctext.inc:191
 #: ../reporting/includes/doctext.inc:228
 #: ../sales/customer_credit_invoice.php:280
-#: ../sales/customer_delivery.php:445
+#: ../sales/customer_delivery.php:455
 #: ../sales/customer_invoice.php:550
 #: ../sales/customer_invoice.php:553
 #: ../sales/view/view_credit.php:90
@@ -8702,7 +8720,7 @@ msgstr ""
 #: ../sales/view/view_invoice.php:115
 #: ../sales/view/view_sales_order.php:219
 #: ../sales/includes/ui/sales_credit_ui.inc:167
-#: ../sales/includes/ui/sales_order_ui.inc:145
+#: ../sales/includes/ui/sales_order_ui.inc:146
 msgid "Item Code"
 msgstr ""
 
@@ -8716,7 +8734,7 @@ msgstr ""
 #: ../reporting/includes/doctext.inc:191
 #: ../reporting/includes/doctext.inc:228
 #: ../sales/customer_credit_invoice.php:280
-#: ../sales/customer_delivery.php:445
+#: ../sales/customer_delivery.php:455
 #: ../sales/customer_invoice.php:550
 #: ../sales/customer_invoice.php:553
 #: ../sales/view/view_credit.php:90
@@ -8724,7 +8742,7 @@ msgstr ""
 #: ../sales/view/view_invoice.php:115
 #: ../sales/view/view_sales_order.php:219
 #: ../sales/includes/ui/sales_credit_ui.inc:167
-#: ../sales/includes/ui/sales_order_ui.inc:145
+#: ../sales/includes/ui/sales_order_ui.inc:146
 msgid "Item Description"
 msgstr ""
 
@@ -8744,7 +8762,7 @@ msgstr ""
 #: ../purchasing/includes/ui/po_ui.inc:245
 #: ../purchasing/view/view_grn.php:40
 #: ../purchasing/view/view_po.php:45
-#: ../reporting/rep301.php:105
+#: ../reporting/rep301.php:169
 #: ../reporting/rep303.php:121
 #: ../reporting/rep303.php:127
 #: ../reporting/rep401.php:71
@@ -8757,7 +8775,7 @@ msgstr ""
 #: ../sales/view/view_invoice.php:115
 #: ../sales/view/view_sales_order.php:219
 #: ../sales/includes/ui/sales_credit_ui.inc:167
-#: ../sales/includes/ui/sales_order_ui.inc:145
+#: ../sales/includes/ui/sales_order_ui.inc:146
 msgid "Quantity"
 msgstr ""
 
@@ -8775,7 +8793,7 @@ msgstr ""
 #: ../sales/view/view_invoice.php:116
 #: ../sales/view/view_sales_order.php:219
 #: ../sales/includes/ui/sales_credit_ui.inc:167
-#: ../sales/includes/ui/sales_order_ui.inc:147
+#: ../sales/includes/ui/sales_order_ui.inc:148
 msgid "Unit"
 msgstr ""
 
@@ -8783,13 +8801,18 @@ msgstr ""
 #: ../inventory/view/view_adjustment.php:57
 #: ../manufacturing/includes/manufacturing_ui.inc:29
 #: ../manufacturing/includes/work_order_issue_ui.inc:34
-#: ../reporting/rep301.php:105
+#: ../reporting/rep301.php:169
 msgid "Unit Cost"
 msgstr ""
 
+#: ../inventory/includes/item_adjustments_ui.inc:110
+msgid ""
+"Marked items have insufficient quantities in stock as on day of adjustment."
+msgstr ""
+
 #: ../inventory/includes/stock_transfers_ui.inc:35
 #: ../inventory/inquiry/stock_movements.php:56
-#: ../manufacturing/includes/work_order_issue_ui.inc:164
+#: ../manufacturing/includes/work_order_issue_ui.inc:171
 msgid "From Location:"
 msgstr ""
 
@@ -8801,6 +8824,11 @@ msgstr ""
 msgid "Transfer Type:"
 msgstr ""
 
+#: ../inventory/includes/stock_transfers_ui.inc:100
+msgid ""
+"Marked items have insufficient quantities in stock as on day of transfer."
+msgstr ""
+
 #: ../inventory/includes/db/items_db.inc:121
 msgid ""
 "Cannot delete this item because there are stock movements that refer to this "
@@ -8928,7 +8956,7 @@ msgstr ""
 #: ../manufacturing/manage/bom_edit.php:71
 #: ../purchasing/po_receive_items.php:62
 #: ../sales/customer_credit_invoice.php:280
-#: ../sales/customer_delivery.php:446
+#: ../sales/customer_delivery.php:456
 #: ../sales/customer_invoice.php:550
 #: ../sales/customer_invoice.php:553
 msgid "Units"
@@ -8992,7 +9020,7 @@ msgid "Foreign Item Codes"
 msgstr ""
 
 #: ../inventory/manage/item_codes.php:23
-#: ../sales/sales_order_entry.php:702
+#: ../sales/sales_order_entry.php:703
 msgid "There are no inventory items defined in the system."
 msgstr ""
 
@@ -9030,8 +9058,8 @@ msgstr ""
 #: ../inventory/manage/item_codes.php:125
 #: ../reporting/rep104.php:117
 #: ../reporting/rep105.php:119
-#: ../reporting/rep301.php:105
-#: ../reporting/rep301.php:111
+#: ../reporting/rep301.php:169
+#: ../reporting/rep301.php:175
 #: ../reporting/rep302.php:124
 #: ../reporting/rep302.php:131
 #: ../reporting/rep303.php:133
@@ -9041,8 +9069,8 @@ msgstr ""
 #: ../reporting/rep306.php:149
 #: ../reporting/rep307.php:117
 #: ../reporting/rep307.php:123
-#: ../reporting/rep308.php:149
-#: ../reporting/rep308.php:156
+#: ../reporting/rep308.php:230
+#: ../reporting/rep308.php:237
 #: ../reporting/rep309.php:104
 msgid "Category"
 msgstr ""
@@ -9053,8 +9081,8 @@ msgstr ""
 
 #: ../inventory/manage/item_codes.php:179
 #: ../inventory/manage/sales_kits.php:245
-#: ../manufacturing/work_order_add_finished.php:206
-#: ../manufacturing/work_order_entry.php:424
+#: ../manufacturing/work_order_add_finished.php:203
+#: ../manufacturing/work_order_entry.php:422
 #: ../manufacturing/manage/bom_edit.php:228
 msgid "Quantity:"
 msgstr ""
@@ -9136,6 +9164,7 @@ msgstr ""
 #: ../purchasing/includes/ui/invoice_ui.inc:519
 #: ../reporting/rep204.php:84
 #: ../reporting/rep306.php:152
+#: ../reporting/rep402.php:103
 msgid "Item"
 msgstr ""
 
@@ -9527,9 +9556,9 @@ msgid "for item:"
 msgstr ""
 
 #: ../manufacturing/search_work_orders.php:78
-#: ../purchasing/inquiry/po_search_completed.php:74
-#: ../purchasing/inquiry/po_search.php:76
-#: ../sales/inquiry/sales_deliveries_view.php:116
+#: ../purchasing/inquiry/po_search_completed.php:77
+#: ../purchasing/inquiry/po_search.php:78
+#: ../sales/inquiry/sales_deliveries_view.php:118
 #: ../sales/inquiry/sales_orders_view.php:270
 msgid "Select documents"
 msgstr ""
@@ -9551,12 +9580,14 @@ msgid "Costs"
 msgstr ""
 
 #: ../manufacturing/search_work_orders.php:164
+#: ../reporting/rep402.php:103
 msgid "Required"
 msgstr ""
 
 #: ../manufacturing/search_work_orders.php:167
 #: ../manufacturing/includes/manufacturing_ui.inc:277
 #: ../manufacturing/includes/manufacturing_ui.inc:281
+#: ../reporting/rep402.php:103
 #: ../reporting/includes/doctext.inc:227
 #: ../sales/inquiry/sales_orders_view.php:291
 msgid "Required By"
@@ -9578,6 +9609,7 @@ msgstr ""
 #: ../manufacturing/work_order_costs.php:45
 #: ../manufacturing/work_order_entry.php:56
 #: ../manufacturing/work_order_issue.php:40
+#: ../manufacturing/work_order_issue.php.orig:40
 #: ../manufacturing/work_order_release.php:75
 msgid "View this Work Order"
 msgstr ""
@@ -9585,6 +9617,7 @@ msgstr ""
 #: ../manufacturing/work_order_add_finished.php:48
 #: ../manufacturing/work_order_entry.php:64
 #: ../manufacturing/work_order_issue.php:42
+#: ../manufacturing/work_order_issue.php.orig:42
 msgid "View the GL Journal Entries for this Work Order"
 msgstr ""
 
@@ -9596,12 +9629,13 @@ msgstr ""
 #: ../manufacturing/work_order_add_finished.php:52
 #: ../manufacturing/work_order_costs.php:49
 #: ../manufacturing/work_order_issue.php:44
+#: ../manufacturing/work_order_issue.php.orig:44
 msgid "Select another &Work Order to Process"
 msgstr ""
 
 #: ../manufacturing/work_order_add_finished.php:65
 #: ../manufacturing/work_order_costs.php:62
-#: ../manufacturing/work_order_entry.php:341
+#: ../manufacturing/work_order_entry.php:339
 #: ../manufacturing/includes/db/work_order_issues_db.inc:30
 #: ../manufacturing/includes/db/work_order_produce_items_db.inc:27
 msgid "The order number sent is not valid."
@@ -9621,32 +9655,32 @@ msgid ""
 "The production exceeds the quantity needed. Please change the Work Order."
 msgstr ""
 
-#: ../manufacturing/work_order_add_finished.php:129
+#: ../manufacturing/work_order_add_finished.php:126
 msgid ""
 "The unassembling cannot be processed because there is insufficient stock."
 msgstr ""
 
-#: ../manufacturing/work_order_add_finished.php:147
+#: ../manufacturing/work_order_add_finished.php:144
 msgid ""
 "The production cannot be processed because a required item would cause a "
 "negative inventory balance :"
 msgstr ""
 
-#: ../manufacturing/work_order_add_finished.php:204
+#: ../manufacturing/work_order_add_finished.php:201
 msgid "Produce Finished Items"
 msgstr ""
 
-#: ../manufacturing/work_order_add_finished.php:204
+#: ../manufacturing/work_order_add_finished.php:201
 msgid "Return Items to Work Order"
 msgstr ""
 
-#: ../manufacturing/work_order_add_finished.php:214
+#: ../manufacturing/work_order_add_finished.php:211
 #: ../purchasing/allocations/supplier_allocate.php:75
 #: ../sales/allocations/customer_allocate.php:73
 msgid "Process"
 msgstr ""
 
-#: ../manufacturing/work_order_add_finished.php:215
+#: ../manufacturing/work_order_add_finished.php:212
 msgid "Process And Close Order"
 msgstr ""
 
@@ -9740,110 +9774,113 @@ msgstr ""
 msgid "The cost entered is invalid or less than zero."
 msgstr ""
 
-#: ../manufacturing/work_order_entry.php:209
+#: ../manufacturing/work_order_entry.php:208
 msgid ""
 "The work order cannot be processed because there is an insufficient quantity "
 "for component:"
 msgstr ""
 
-#: ../manufacturing/work_order_entry.php:223
+#: ../manufacturing/work_order_entry.php:221
 msgid ""
 "The selected item cannot be unassembled because there is insufficient stock."
 msgstr ""
 
-#: ../manufacturing/work_order_entry.php:249
+#: ../manufacturing/work_order_entry.php:247
 msgid ""
 "The quantity cannot be changed to be less than the quantity already "
 "manufactured for this order."
 msgstr ""
 
-#: ../manufacturing/work_order_entry.php:298
+#: ../manufacturing/work_order_entry.php:296
 msgid ""
 "This work order cannot be deleted because it has already been processed."
 msgstr ""
 
-#: ../manufacturing/work_order_entry.php:349
+#: ../manufacturing/work_order_entry.php:347
 msgid "This work order is closed and cannot be edited."
 msgstr ""
 
-#: ../manufacturing/work_order_entry.php:397
-#: ../manufacturing/work_order_entry.php:405
+#: ../manufacturing/work_order_entry.php:395
+#: ../manufacturing/work_order_entry.php:403
 msgid "Destination Location:"
 msgstr ""
 
-#: ../manufacturing/work_order_entry.php:416
+#: ../manufacturing/work_order_entry.php:414
 msgid "Quantity Required:"
 msgstr ""
 
-#: ../manufacturing/work_order_entry.php:418
+#: ../manufacturing/work_order_entry.php:416
 msgid "Quantity Manufactured:"
 msgstr ""
 
-#: ../manufacturing/work_order_entry.php:437
+#: ../manufacturing/work_order_entry.php:435
 msgid "Credit Labour Account"
 msgstr ""
 
-#: ../manufacturing/work_order_entry.php:444
+#: ../manufacturing/work_order_entry.php:442
 msgid "Credit Overhead Account"
 msgstr ""
 
-#: ../manufacturing/work_order_entry.php:449
+#: ../manufacturing/work_order_entry.php:447
 msgid "Released On:"
 msgstr ""
 
-#: ../manufacturing/work_order_entry.php:459
+#: ../manufacturing/work_order_entry.php:457
 msgid "Save changes to work order"
 msgstr ""
 
-#: ../manufacturing/work_order_entry.php:462
+#: ../manufacturing/work_order_entry.php:460
 msgid "Close This Work Order"
 msgstr ""
 
-#: ../manufacturing/work_order_entry.php:464
+#: ../manufacturing/work_order_entry.php:462
 msgid "Delete This Work Order"
 msgstr ""
 
-#: ../manufacturing/work_order_entry.php:470
+#: ../manufacturing/work_order_entry.php:468
 msgid "Add Workorder"
 msgstr ""
 
 #: ../manufacturing/work_order_issue.php:31
+#: ../manufacturing/work_order_issue.php.orig:31
 msgid "Issue Items to Work Order"
 msgstr ""
 
 #: ../manufacturing/work_order_issue.php:38
+#: ../manufacturing/work_order_issue.php.orig:38
 msgid "The work order issue has been entered."
 msgstr ""
 
 #: ../manufacturing/work_order_issue.php:78
+#: ../manufacturing/work_order_issue.php.orig:78
 msgid "The entered date for the issue is invalid."
 msgstr ""
 
-#: ../manufacturing/work_order_issue.php:106
+#: ../manufacturing/work_order_issue.php.orig:106
 msgid ""
 "The issue cannot be processed because an entered item would cause a negative "
 "inventory balance :"
 msgstr ""
 
-#: ../manufacturing/work_order_issue.php:124
+#: ../manufacturing/work_order_issue.php.orig:124
 msgid ""
 "The process cannot be completed because there is an insufficient total "
 "quantity for a component."
 msgstr ""
 
-#: ../manufacturing/work_order_issue.php:125
+#: ../manufacturing/work_order_issue.php.orig:125
 msgid "Component is :"
 msgstr ""
 
-#: ../manufacturing/work_order_issue.php:126
+#: ../manufacturing/work_order_issue.php.orig:126
 msgid "From location :"
 msgstr ""
 
-#: ../manufacturing/work_order_issue.php:219
+#: ../manufacturing/work_order_issue.php.orig:219
 msgid "Items to Issue"
 msgstr ""
 
-#: ../manufacturing/work_order_issue.php:225
+#: ../manufacturing/work_order_issue.php.orig:225
 msgid "Process Issue"
 msgstr ""
 
@@ -10174,19 +10211,23 @@ msgstr ""
 msgid "This work order is closed."
 msgstr ""
 
-#: ../manufacturing/includes/work_order_issue_ui.inc:162
+#: ../manufacturing/includes/work_order_issue_ui.inc:82
+msgid "Marked items have insufficient quantities in stock as on day of issue."
+msgstr ""
+
+#: ../manufacturing/includes/work_order_issue_ui.inc:169
 msgid "Return Items to Location"
 msgstr ""
 
-#: ../manufacturing/includes/work_order_issue_ui.inc:162
+#: ../manufacturing/includes/work_order_issue_ui.inc:169
 msgid "Issue Items to Work order"
 msgstr ""
 
-#: ../manufacturing/includes/work_order_issue_ui.inc:165
+#: ../manufacturing/includes/work_order_issue_ui.inc:172
 msgid "To Work Centre:"
 msgstr ""
 
-#: ../manufacturing/includes/work_order_issue_ui.inc:167
+#: ../manufacturing/includes/work_order_issue_ui.inc:174
 msgid "Issue Date:"
 msgstr ""
 
@@ -10214,20 +10255,19 @@ msgstr ""
 msgid "Reversed the production "
 msgstr ""
 
-#: ../manufacturing/includes/db/work_orders_db.inc:79
+#: ../manufacturing/includes/db/work_orders_db.inc.orig:79
 #: ../purchasing/includes/db/po_db.inc:123
 #: ../sales/includes/db/cust_trans_db.inc:114
 #: ../sales/includes/db/old.sales_order_db.inc:249
 #: ../sales/includes/db/sales_order_db.inc:213
-#: ../sales/includes/db/sales_order_db.inc.orig:275
 msgid "Updated."
 msgstr ""
 
-#: ../manufacturing/includes/db/work_orders_db.inc:100
+#: ../manufacturing/includes/db/work_orders_db.inc.orig:100
 msgid "Canceled."
 msgstr ""
 
-#: ../manufacturing/includes/db/work_orders_db.inc:176
+#: ../manufacturing/includes/db/work_orders_db.inc.orig:176
 msgid "Released."
 msgstr ""
 
@@ -10249,7 +10289,7 @@ msgstr ""
 
 #: ../purchasing/includes/db/invoice_db.inc:334
 #: ../reporting/rep106.php:83
-#: ../sales/inquiry/sales_deliveries_view.php:166
+#: ../sales/inquiry/sales_deliveries_view.php:168
 #: ../sales/inquiry/sales_orders_view.php:159
 msgid "Invoice"
 msgstr ""
@@ -10289,8 +10329,8 @@ msgstr ""
 #: ../purchasing/includes/ui/po_ui.inc:353
 #: ../purchasing/view/view_supp_credit.php:44
 #: ../purchasing/view/view_supp_invoice.php:48
-#: ../purchasing/inquiry/po_search_completed.php:124
-#: ../purchasing/inquiry/po_search.php:134
+#: ../purchasing/inquiry/po_search_completed.php:127
+#: ../purchasing/inquiry/po_search.php:136
 #: ../purchasing/inquiry/supplier_inquiry.php:177
 #: ../reporting/includes/doctext.inc:164
 #: ../reporting/includes/doctext.inc:187
@@ -10438,7 +10478,7 @@ msgstr ""
 
 #: ../purchasing/includes/ui/invoice_ui.inc:507
 #: ../purchasing/includes/ui/invoice_ui.inc:519
-#: ../reporting/rep308.php:149
+#: ../reporting/rep308.php:230
 #: ../sales/inquiry/sales_orders_view.php:167
 msgid "Delivery"
 msgstr ""
@@ -10472,13 +10512,13 @@ msgstr ""
 
 #: ../purchasing/includes/ui/invoice_ui.inc:509
 #: ../purchasing/includes/ui/po_ui.inc:247
-#: ../sales/includes/ui/sales_order_ui.inc:147
+#: ../sales/includes/ui/sales_order_ui.inc:148
 msgid "Price after Tax"
 msgstr ""
 
 #: ../purchasing/includes/ui/invoice_ui.inc:509
 #: ../purchasing/includes/ui/po_ui.inc:247
-#: ../sales/includes/ui/sales_order_ui.inc:147
+#: ../sales/includes/ui/sales_order_ui.inc:148
 msgid "Price before Tax"
 msgstr ""
 
@@ -10507,17 +10547,17 @@ msgid "Credits can only be applied to invoiced items."
 msgstr ""
 
 #: ../purchasing/includes/ui/po_ui.inc:166
-#: ../sales/sales_order_entry.php:726
+#: ../sales/sales_order_entry.php:727
 msgid "Order Date:"
 msgstr ""
 
 #: ../purchasing/includes/ui/po_ui.inc:167
-#: ../sales/sales_order_entry.php:713
+#: ../sales/sales_order_entry.php:714
 msgid "Delivery Date:"
 msgstr ""
 
 #: ../purchasing/includes/ui/po_ui.inc:167
-#: ../sales/sales_order_entry.php:707
+#: ../sales/sales_order_entry.php:708
 msgid "Invoice Date:"
 msgstr ""
 
@@ -10557,7 +10597,7 @@ msgid "Received"
 msgstr ""
 
 #: ../purchasing/includes/ui/po_ui.inc:247
-#: ../sales/includes/ui/sales_order_ui.inc:617
+#: ../sales/includes/ui/sales_order_ui.inc:602
 msgid "Required Delivery Date"
 msgstr ""
 
@@ -10572,16 +10612,16 @@ msgstr ""
 #: ../reporting/rep107.php:231
 #: ../reporting/rep109.php:155
 #: ../reporting/rep110.php:159
-#: ../reporting/rep111.php:134
+#: ../reporting/rep111.php:152
 #: ../reporting/rep113.php:144
 #: ../reporting/rep209.php:162
 #: ../sales/customer_credit_invoice.php:322
-#: ../sales/customer_delivery.php:525
+#: ../sales/customer_delivery.php:541
 #: ../sales/customer_invoice.php:656
 #: ../sales/view/view_dispatch.php:146
 #: ../sales/view/view_invoice.php:150
 #: ../sales/includes/ui/sales_credit_ui.inc:217
-#: ../sales/includes/ui/sales_order_ui.inc:236
+#: ../sales/includes/ui/sales_order_ui.inc:224
 msgid "Sub-total"
 msgstr ""
 
@@ -10589,16 +10629,16 @@ msgstr ""
 #: ../purchasing/po_receive_items.php:122
 #: ../purchasing/view/view_grn.php:79
 #: ../purchasing/view/view_po.php:93
-#: ../sales/customer_delivery.php:532
+#: ../sales/customer_delivery.php:548
 #: ../sales/view/view_sales_order.php:262
-#: ../sales/includes/ui/sales_order_ui.inc:243
+#: ../sales/includes/ui/sales_order_ui.inc:231
 msgid "Amount Total"
 msgstr ""
 
 #: ../purchasing/includes/ui/po_ui.inc:308
 #: ../purchasing/allocations/supplier_allocate.php:74
 #: ../sales/allocations/customer_allocate.php:72
-#: ../sales/includes/ui/sales_order_ui.inc:244
+#: ../sales/includes/ui/sales_order_ui.inc:232
 msgid "Refresh"
 msgstr ""
 
@@ -10614,8 +10654,8 @@ msgstr ""
 #: ../purchasing/includes/ui/po_ui.inc:490
 #: ../purchasing/po_entry_items.php:482
 #: ../sales/customer_invoice.php:463
-#: ../sales/includes/ui/sales_order_ui.inc:413
-#: ../sales/includes/ui/sales_order_ui.inc:415
+#: ../sales/includes/ui/sales_order_ui.inc:398
+#: ../sales/includes/ui/sales_order_ui.inc:400
 msgid "Payment:"
 msgstr ""
 
@@ -10625,8 +10665,8 @@ msgid "Delayed"
 msgstr ""
 
 #: ../purchasing/includes/ui/po_ui.inc:492
-#: ../sales/includes/ui/sales_order_ui.inc:628
-#: ../sales/includes/ui/sales_order_ui.inc:630
+#: ../sales/includes/ui/sales_order_ui.inc:613
+#: ../sales/includes/ui/sales_order_ui.inc:615
 msgid "Pre-Payment Required:"
 msgstr ""
 
@@ -10747,7 +10787,7 @@ msgid "Enter a new purchase order"
 msgstr ""
 
 #: ../purchasing/po_entry_items.php:216
-#: ../sales/sales_order_entry.php:506
+#: ../sales/sales_order_entry.php:520
 msgid "Item description cannot be empty."
 msgstr ""
 
@@ -10829,7 +10869,7 @@ msgid "Required prepayment is greater than total invoice value."
 msgstr ""
 
 #: ../purchasing/po_entry_items.php:490
-#: ../sales/sales_order_entry.php:730
+#: ../sales/sales_order_entry.php:731
 msgid "Place Order"
 msgstr ""
 
@@ -10838,7 +10878,7 @@ msgid "Update Order"
 msgstr ""
 
 #: ../purchasing/po_entry_items.php:492
-#: ../sales/sales_order_entry.php:729
+#: ../sales/sales_order_entry.php:730
 msgid "Cancel Order"
 msgstr ""
 
@@ -10864,7 +10904,7 @@ msgid "Update Invoice"
 msgstr ""
 
 #: ../purchasing/po_entry_items.php:501
-#: ../sales/sales_order_entry.php:710
+#: ../sales/sales_order_entry.php:711
 msgid "Cancel Invoice"
 msgstr ""
 
@@ -10892,7 +10932,7 @@ msgstr ""
 
 #: ../purchasing/po_receive_items.php:62
 #: ../reporting/rep105.php:114
-#: ../sales/customer_delivery.php:446
+#: ../sales/customer_delivery.php:456
 msgid "Ordered"
 msgstr ""
 
@@ -10906,7 +10946,7 @@ msgid "Outstanding"
 msgstr ""
 
 #: ../purchasing/po_receive_items.php:63
-#: ../sales/customer_delivery.php:447
+#: ../sales/customer_delivery.php:457
 msgid "This Delivery"
 msgstr ""
 
@@ -11016,21 +11056,21 @@ msgid ""
 "mistake somewhere, the credit note as entered will not be processed."
 msgstr ""
 
-#: ../purchasing/supplier_credit.php:227
+#: ../purchasing/supplier_credit.php:226
 msgid ""
 "The return cannot be processed because there is an insufficient quantity for "
 "item:"
 msgstr ""
 
-#: ../purchasing/supplier_credit.php:270
+#: ../purchasing/supplier_credit.php:269
 msgid "The quantity to credit must be numeric and greater than zero."
 msgstr ""
 
-#: ../purchasing/supplier_credit.php:277
+#: ../purchasing/supplier_credit.php:276
 msgid "The price is either not numeric or negative."
 msgstr ""
 
-#: ../purchasing/supplier_credit.php:379
+#: ../purchasing/supplier_credit.php:378
 msgid "Enter Credit Note"
 msgstr ""
 
@@ -11226,7 +11266,7 @@ msgstr ""
 #: ../reporting/includes/doctext.inc:77
 #: ../reporting/includes/doctext.inc:192
 #: ../reporting/includes/doctext.inc:244
-#: ../sales/inquiry/sales_deliveries_view.php:186
+#: ../sales/inquiry/sales_deliveries_view.php:188
 msgid "Delivery Date"
 msgstr ""
 
@@ -11260,7 +11300,7 @@ msgstr ""
 #: ../purchasing/inquiry/supplier_inquiry.php:197
 #: ../sales/inquiry/customer_allocation_inquiry.php:165
 #: ../sales/inquiry/customer_inquiry.php:227
-#: ../sales/inquiry/sales_deliveries_view.php:206
+#: ../sales/inquiry/sales_deliveries_view.php:208
 #: ../sales/inquiry/sales_orders_view.php:345
 msgid "Marked items are overdue."
 msgstr ""
@@ -11344,7 +11384,7 @@ msgstr ""
 #: ../purchasing/view/view_supp_payment.php:62
 #: ../reporting/rep112.php:150
 #: ../reporting/rep210.php:159
-#: ../sales/customer_delivery.php:447
+#: ../sales/customer_delivery.php:457
 #: ../sales/customer_invoice.php:551
 #: ../sales/customer_invoice.php:554
 #: ../sales/view/view_receipt.php:45
@@ -11520,6 +11560,8 @@ msgid ""
 msgstr ""
 
 #: ../purchasing/manage/suppliers.php:291
+#: ../purchasing/inquiry/po_search_completed.php:75
+#: ../purchasing/inquiry/po_search.php:76
 #: ../purchasing/inquiry/supplier_allocation_inquiry.php:48
 msgid "Select a supplier: "
 msgstr ""
@@ -11553,15 +11595,15 @@ msgstr ""
 msgid "into location:"
 msgstr ""
 
-#: ../purchasing/inquiry/po_search_completed.php:125
-#: ../purchasing/inquiry/po_search.php:135
+#: ../purchasing/inquiry/po_search_completed.php:128
+#: ../purchasing/inquiry/po_search.php:137
 #: ../reporting/includes/doctext.inc:188
 #: ../sales/inquiry/sales_orders_view.php:290
 msgid "Order Date"
 msgstr ""
 
-#: ../purchasing/inquiry/po_search_completed.php:127
-#: ../purchasing/inquiry/po_search.php:137
+#: ../purchasing/inquiry/po_search_completed.php:130
+#: ../purchasing/inquiry/po_search.php:139
 #: ../sales/inquiry/sales_orders_view.php:293
 msgid "Order Total"
 msgstr ""
@@ -11570,11 +11612,11 @@ msgstr ""
 msgid "Search Outstanding Purchase Orders"
 msgstr ""
 
-#: ../purchasing/inquiry/po_search.php:98
+#: ../purchasing/inquiry/po_search.php:100
 msgid "Receive"
 msgstr ""
 
-#: ../purchasing/inquiry/po_search.php:148
+#: ../purchasing/inquiry/po_search.php:150
 msgid "Marked orders have overdue items."
 msgstr ""
 
@@ -11758,7 +11800,7 @@ msgstr ""
 #: ../reporting/rep101.php:118
 #: ../reporting/rep201.php:110
 #: ../reporting/rep203.php:93
-#: ../reporting/rep709.php:111
+#: ../reporting/rep709.php:116
 #: ../reporting/includes/doctext.inc:167
 #: ../reporting/includes/doctext.inc:208
 #: ../reporting/includes/doctext.inc:246
@@ -11799,11 +11841,11 @@ msgstr ""
 #: ../reporting/rep101.php:241
 #: ../reporting/rep102.php:228
 #: ../reporting/rep106.php:171
-#: ../reporting/rep201.php:233
+#: ../reporting/rep201.php:234
 #: ../reporting/rep202.php:235
 #: ../reporting/rep203.php:181
 #: ../reporting/rep204.php:148
-#: ../reporting/rep301.php:179
+#: ../reporting/rep301.php:254
 #: ../reporting/rep304.php:195
 #: ../reporting/rep305.php:188
 #: ../reporting/rep306.php:293
@@ -11814,25 +11856,25 @@ msgstr ""
 #: ../reporting/rep102.php:102
 #: ../reporting/rep106.php:93
 #: ../reporting/rep202.php:106
-#: ../reporting/rep709.php:95
+#: ../reporting/rep709.php:100
 #: ../reporting/reports_main.php:48
 #: ../reporting/reports_main.php:91
 #: ../reporting/reports_main.php:165
 #: ../reporting/reports_main.php:211
-#: ../reporting/reports_main.php:490
+#: ../reporting/reports_main.php:497
 msgid "Summary Only"
 msgstr ""
 
 #: ../reporting/rep102.php:104
 #: ../reporting/rep202.php:108
-#: ../reporting/rep709.php:97
+#: ../reporting/rep709.php:102
 msgid "Detailed Report"
 msgstr ""
 
 #: ../reporting/rep102.php:131
 #: ../reporting/rep202.php:136
 #: ../reporting/rep203.php:99
-#: ../reporting/rep301.php:110
+#: ../reporting/rep301.php:174
 #: ../reporting/reports_main.php:35
 #: ../reporting/reports_main.php:44
 #: ../reporting/reports_main.php:65
@@ -11848,23 +11890,23 @@ msgstr ""
 #: ../reporting/reports_main.php:259
 #: ../reporting/reports_main.php:267
 #: ../reporting/reports_main.php:275
-#: ../reporting/reports_main.php:312
-#: ../reporting/reports_main.php:320
-#: ../reporting/reports_main.php:332
-#: ../reporting/reports_main.php:344
-#: ../reporting/reports_main.php:362
-#: ../reporting/reports_main.php:373
-#: ../reporting/reports_main.php:385
-#: ../reporting/reports_main.php:398
-#: ../reporting/reports_main.php:414
-#: ../reporting/reports_main.php:424
-#: ../reporting/reports_main.php:435
-#: ../reporting/reports_main.php:447
-#: ../reporting/reports_main.php:461
-#: ../reporting/reports_main.php:470
-#: ../reporting/reports_main.php:480
-#: ../reporting/reports_main.php:489
+#: ../reporting/reports_main.php:319
+#: ../reporting/reports_main.php:327
+#: ../reporting/reports_main.php:339
+#: ../reporting/reports_main.php:351
+#: ../reporting/reports_main.php:369
+#: ../reporting/reports_main.php:380
+#: ../reporting/reports_main.php:392
+#: ../reporting/reports_main.php:405
+#: ../reporting/reports_main.php:421
+#: ../reporting/reports_main.php:431
+#: ../reporting/reports_main.php:442
+#: ../reporting/reports_main.php:454
+#: ../reporting/reports_main.php:468
+#: ../reporting/reports_main.php:477
+#: ../reporting/reports_main.php:487
 #: ../reporting/reports_main.php:496
+#: ../reporting/reports_main.php:503
 msgid "End Date"
 msgstr ""
 
@@ -11970,11 +12012,11 @@ msgid "Category/Items"
 msgstr ""
 
 #: ../reporting/rep104.php:111
-#: ../reporting/rep301.php:105
+#: ../reporting/rep301.php:169
 #: ../reporting/rep303.php:121
 #: ../reporting/rep303.php:127
 #: ../reporting/rep307.php:117
-#: ../reporting/rep308.php:149
+#: ../reporting/rep308.php:230
 msgid "UOM"
 msgstr ""
 
@@ -12016,14 +12058,14 @@ msgstr ""
 #: ../reporting/rep112.php:175
 #: ../sales/create_recurrent_invoices.php:134
 #: ../sales/customer_credit_invoice.php:236
-#: ../sales/customer_delivery.php:353
+#: ../sales/customer_delivery.php:363
 #: ../sales/customer_invoice.php:456
 #: ../sales/manage/customers.php:255
 #: ../sales/manage/customers.php:294
 #: ../sales/manage/recurrent_invoices.php:102
 #: ../sales/view/view_credit.php:58
 #: ../sales/inquiry/customer_inquiry.php:207
-#: ../sales/inquiry/sales_deliveries_view.php:182
+#: ../sales/inquiry/sales_deliveries_view.php:184
 #: ../sales/inquiry/sales_orders_view.php:288
 #: ../sales/inquiry/sales_orders_view.php:302
 msgid "Branch"
@@ -12048,9 +12090,9 @@ msgid "Loc"
 msgstr ""
 
 #: ../reporting/rep105.php:114
-#: ../sales/customer_delivery.php:446
+#: ../sales/customer_delivery.php:456
 #: ../sales/customer_invoice.php:553
-#: ../sales/includes/ui/sales_order_ui.inc:146
+#: ../sales/includes/ui/sales_order_ui.inc:147
 msgid "Delivered"
 msgstr ""
 
@@ -12109,7 +12151,7 @@ msgstr ""
 #: ../reporting/rep107.php:234
 #: ../reporting/rep109.php:158
 #: ../reporting/rep110.php:162
-#: ../reporting/rep111.php:137
+#: ../reporting/rep111.php:155
 #: ../reporting/rep113.php:147
 #: ../sales/view/view_credit.php:138
 #: ../sales/view/view_dispatch.php:155
@@ -12121,7 +12163,7 @@ msgstr ""
 
 #: ../reporting/rep107.php:280
 #: ../reporting/rep109.php:210
-#: ../reporting/rep111.php:189
+#: ../reporting/rep111.php:207
 msgid "TOTAL ORDER VAT INCL."
 msgstr ""
 
@@ -12162,7 +12204,7 @@ msgid "QUOTE"
 msgstr ""
 
 #: ../reporting/rep109.php:164
-#: ../reporting/rep111.php:143
+#: ../reporting/rep111.php:161
 msgid "TOTAL ORDER EX VAT"
 msgstr ""
 
@@ -12185,7 +12227,7 @@ msgstr ""
 msgid "TOTAL DELIVERY INCL. VAT"
 msgstr ""
 
-#: ../reporting/rep111.php:60
+#: ../reporting/rep111.php:64
 #: ../reporting/includes/doctext.inc:50
 msgid "SALES QUOTATION"
 msgstr ""
@@ -12249,7 +12291,7 @@ msgid "Total ex. Tax"
 msgstr ""
 
 #: ../reporting/rep114.php:95
-#: ../reporting/rep709.php:112
+#: ../reporting/rep709.php:117
 #: ../taxes/tax_groups.php:171
 msgid "Tax"
 msgstr ""
@@ -12326,7 +12368,7 @@ msgstr ""
 msgid "TOTAL REMITTANCE"
 msgstr ""
 
-#: ../reporting/rep301.php:114
+#: ../reporting/rep301.php:178
 msgid "Inventory Valuation Report"
 msgstr ""
 
@@ -12435,29 +12477,29 @@ msgstr ""
 msgid "Inventory Movements"
 msgstr ""
 
-#: ../reporting/rep308.php:149
+#: ../reporting/rep308.php:230
 msgid "OpeningStock"
 msgstr ""
 
-#: ../reporting/rep308.php:149
+#: ../reporting/rep308.php:230
 msgid "StockIn"
 msgstr ""
 
-#: ../reporting/rep308.php:149
+#: ../reporting/rep308.php:230
 msgid "ClosingStock"
 msgstr ""
 
-#: ../reporting/rep308.php:150
+#: ../reporting/rep308.php:231
 msgid "QTY"
 msgstr ""
 
-#: ../reporting/rep308.php:150
-#: ../reporting/rep709.php:112
+#: ../reporting/rep308.php:231
+#: ../reporting/rep709.php:117
 #: ../taxes/item_tax_types.php:185
 msgid "Rate"
 msgstr ""
 
-#: ../reporting/rep308.php:159
+#: ../reporting/rep308.php:240
 msgid "Costed Inventory Movements"
 msgstr ""
 
@@ -12485,6 +12527,14 @@ msgstr ""
 msgid "Bill of Material Listing"
 msgstr ""
 
+#: ../reporting/rep402.php:110
+msgid "Open Only"
+msgstr ""
+
+#: ../reporting/rep402.php:112
+msgid "Work Order Listing"
+msgstr ""
+
 #: ../reporting/rep409.php:59
 #: ../reporting/rep409.php:72
 #: ../reporting/includes/doctext.inc:214
@@ -12558,9 +12608,9 @@ msgstr ""
 #: ../reporting/rep705.php:247
 #: ../reporting/rep705.php:260
 #: ../reporting/rep705.php:271
-#: ../reporting/reports_main.php:353
-#: ../reporting/reports_main.php:406
-#: ../reporting/reports_main.php:454
+#: ../reporting/reports_main.php:360
+#: ../reporting/reports_main.php:413
+#: ../reporting/reports_main.php:461
 msgid "Year"
 msgstr ""
 
@@ -12594,23 +12644,23 @@ msgstr ""
 msgid "Profit and Loss Statement"
 msgstr ""
 
-#: ../reporting/rep709.php:93
+#: ../reporting/rep709.php:98
 msgid "Tax Report"
 msgstr ""
 
-#: ../reporting/rep709.php:111
+#: ../reporting/rep709.php:116
 msgid "Branch Name"
 msgstr ""
 
-#: ../reporting/rep709.php:112
+#: ../reporting/rep709.php:117
 msgid "Net"
 msgstr ""
 
-#: ../reporting/rep709.php:183
+#: ../reporting/rep709.php:188
 msgid "Tax Rate"
 msgstr ""
 
-#: ../reporting/rep709.php:183
+#: ../reporting/rep709.php:188
 msgid "Net Tax"
 msgstr ""
 
@@ -12627,7 +12677,7 @@ msgid "Action"
 msgstr ""
 
 #: ../reporting/rep710.php:89
-#: ../reporting/reports_main.php:494
+#: ../reporting/reports_main.php:501
 msgid "Audit Trail"
 msgstr ""
 
@@ -12645,7 +12695,7 @@ msgstr ""
 
 #: ../reporting/reports_main.php:37
 #: ../reporting/reports_main.php:154
-#: ../reporting/reports_main.php:300
+#: ../reporting/reports_main.php:307
 msgid "Show Balance"
 msgstr ""
 
@@ -12698,27 +12748,28 @@ msgstr ""
 #: ../reporting/reports_main.php:278
 #: ../reporting/reports_main.php:286
 #: ../reporting/reports_main.php:293
-#: ../reporting/reports_main.php:302
-#: ../reporting/reports_main.php:315
-#: ../reporting/reports_main.php:328
+#: ../reporting/reports_main.php:300
+#: ../reporting/reports_main.php:309
+#: ../reporting/reports_main.php:322
 #: ../reporting/reports_main.php:335
-#: ../reporting/reports_main.php:350
-#: ../reporting/reports_main.php:358
-#: ../reporting/reports_main.php:369
-#: ../reporting/reports_main.php:381
-#: ../reporting/reports_main.php:391
-#: ../reporting/reports_main.php:403
+#: ../reporting/reports_main.php:342
+#: ../reporting/reports_main.php:357
+#: ../reporting/reports_main.php:365
+#: ../reporting/reports_main.php:376
+#: ../reporting/reports_main.php:388
+#: ../reporting/reports_main.php:398
 #: ../reporting/reports_main.php:410
-#: ../reporting/reports_main.php:420
-#: ../reporting/reports_main.php:431
-#: ../reporting/reports_main.php:440
-#: ../reporting/reports_main.php:451
-#: ../reporting/reports_main.php:457
-#: ../reporting/reports_main.php:466
-#: ../reporting/reports_main.php:476
-#: ../reporting/reports_main.php:484
-#: ../reporting/reports_main.php:492
-#: ../reporting/reports_main.php:500
+#: ../reporting/reports_main.php:417
+#: ../reporting/reports_main.php:427
+#: ../reporting/reports_main.php:438
+#: ../reporting/reports_main.php:447
+#: ../reporting/reports_main.php:458
+#: ../reporting/reports_main.php:464
+#: ../reporting/reports_main.php:473
+#: ../reporting/reports_main.php:483
+#: ../reporting/reports_main.php:491
+#: ../reporting/reports_main.php:499
+#: ../reporting/reports_main.php:507
 msgid "Orientation"
 msgstr ""
 
@@ -12744,28 +12795,29 @@ msgstr ""
 #: ../reporting/reports_main.php:272
 #: ../reporting/reports_main.php:279
 #: ../reporting/reports_main.php:287
-#: ../reporting/reports_main.php:303
-#: ../reporting/reports_main.php:316
-#: ../reporting/reports_main.php:322
+#: ../reporting/reports_main.php:294
+#: ../reporting/reports_main.php:310
+#: ../reporting/reports_main.php:323
 #: ../reporting/reports_main.php:329
 #: ../reporting/reports_main.php:336
-#: ../reporting/reports_main.php:351
-#: ../reporting/reports_main.php:359
-#: ../reporting/reports_main.php:370
-#: ../reporting/reports_main.php:382
-#: ../reporting/reports_main.php:392
-#: ../reporting/reports_main.php:404
+#: ../reporting/reports_main.php:343
+#: ../reporting/reports_main.php:358
+#: ../reporting/reports_main.php:366
+#: ../reporting/reports_main.php:377
+#: ../reporting/reports_main.php:389
+#: ../reporting/reports_main.php:399
 #: ../reporting/reports_main.php:411
-#: ../reporting/reports_main.php:421
-#: ../reporting/reports_main.php:432
-#: ../reporting/reports_main.php:441
-#: ../reporting/reports_main.php:452
-#: ../reporting/reports_main.php:458
-#: ../reporting/reports_main.php:467
-#: ../reporting/reports_main.php:477
-#: ../reporting/reports_main.php:485
-#: ../reporting/reports_main.php:493
-#: ../reporting/reports_main.php:501
+#: ../reporting/reports_main.php:418
+#: ../reporting/reports_main.php:428
+#: ../reporting/reports_main.php:439
+#: ../reporting/reports_main.php:448
+#: ../reporting/reports_main.php:459
+#: ../reporting/reports_main.php:465
+#: ../reporting/reports_main.php:474
+#: ../reporting/reports_main.php:484
+#: ../reporting/reports_main.php:492
+#: ../reporting/reports_main.php:500
+#: ../reporting/reports_main.php:508
 msgid "Destination"
 msgstr ""
 
@@ -12775,12 +12827,12 @@ msgstr ""
 
 #: ../reporting/reports_main.php:50
 #: ../reporting/reports_main.php:167
-#: ../reporting/reports_main.php:367
-#: ../reporting/reports_main.php:379
-#: ../reporting/reports_main.php:418
-#: ../reporting/reports_main.php:429
-#: ../reporting/reports_main.php:464
-#: ../reporting/reports_main.php:474
+#: ../reporting/reports_main.php:374
+#: ../reporting/reports_main.php:386
+#: ../reporting/reports_main.php:425
+#: ../reporting/reports_main.php:436
+#: ../reporting/reports_main.php:471
+#: ../reporting/reports_main.php:481
 msgid "Graphics"
 msgstr ""
 
@@ -12992,106 +13044,114 @@ msgid "To product"
 msgstr ""
 
 #: ../reporting/reports_main.php:288
-msgid "Print &Work Orders"
+msgid "Work Order &Listing"
 msgstr ""
 
 #: ../reporting/reports_main.php:291
+msgid "Outstanding Only"
+msgstr ""
+
+#: ../reporting/reports_main.php:295
+msgid "Print &Work Orders"
+msgstr ""
+
+#: ../reporting/reports_main.php:298
 msgid "Email Locations"
 msgstr ""
 
-#: ../reporting/reports_main.php:297
+#: ../reporting/reports_main.php:304
 msgid "Dimension &Summary"
 msgstr ""
 
-#: ../reporting/reports_main.php:298
+#: ../reporting/reports_main.php:305
 msgid "From Dimension"
 msgstr ""
 
-#: ../reporting/reports_main.php:299
+#: ../reporting/reports_main.php:306
 msgid "To Dimension"
 msgstr ""
 
-#: ../reporting/reports_main.php:308
+#: ../reporting/reports_main.php:315
 msgid "Banking"
 msgstr ""
 
-#: ../reporting/reports_main.php:309
+#: ../reporting/reports_main.php:316
 msgid "Bank &Statement"
 msgstr ""
 
-#: ../reporting/reports_main.php:313
-#: ../reporting/reports_main.php:386
-#: ../reporting/reports_main.php:436
-#: ../reporting/reports_main.php:481
+#: ../reporting/reports_main.php:320
+#: ../reporting/reports_main.php:393
+#: ../reporting/reports_main.php:443
+#: ../reporting/reports_main.php:488
 msgid "Zero values"
 msgstr ""
 
-#: ../reporting/reports_main.php:317
+#: ../reporting/reports_main.php:324
 msgid "Bank Statement w/ &Reconcile"
 msgstr ""
 
-#: ../reporting/reports_main.php:324
+#: ../reporting/reports_main.php:331
 msgid "General Ledger"
 msgstr ""
 
-#: ../reporting/reports_main.php:325
+#: ../reporting/reports_main.php:332
 msgid "Chart of &Accounts"
 msgstr ""
 
-#: ../reporting/reports_main.php:326
+#: ../reporting/reports_main.php:333
 msgid "Show Balances"
 msgstr ""
 
-#: ../reporting/reports_main.php:330
+#: ../reporting/reports_main.php:337
 msgid "List of &Journal Entries"
 msgstr ""
 
-#: ../reporting/reports_main.php:342
-#: ../reporting/reports_main.php:396
-#: ../reporting/reports_main.php:445
+#: ../reporting/reports_main.php:349
+#: ../reporting/reports_main.php:403
+#: ../reporting/reports_main.php:452
 msgid "GL Account &Transactions"
 msgstr ""
 
-#: ../reporting/reports_main.php:345
-#: ../reporting/reports_main.php:399
-#: ../reporting/reports_main.php:448
+#: ../reporting/reports_main.php:352
+#: ../reporting/reports_main.php:406
+#: ../reporting/reports_main.php:455
 msgid "From Account"
 msgstr ""
 
-#: ../reporting/reports_main.php:346
-#: ../reporting/reports_main.php:400
-#: ../reporting/reports_main.php:449
+#: ../reporting/reports_main.php:353
+#: ../reporting/reports_main.php:407
+#: ../reporting/reports_main.php:456
 msgid "To Account"
 msgstr ""
 
-#: ../reporting/reports_main.php:352
-#: ../reporting/reports_main.php:405
-#: ../reporting/reports_main.php:453
+#: ../reporting/reports_main.php:359
+#: ../reporting/reports_main.php:412
+#: ../reporting/reports_main.php:460
 msgid "Annual &Expense Breakdown"
 msgstr ""
 
-#: ../reporting/reports_main.php:360
-#: ../reporting/reports_main.php:412
-#: ../reporting/reports_main.php:459
+#: ../reporting/reports_main.php:367
+#: ../reporting/reports_main.php:419
+#: ../reporting/reports_main.php:466
 msgid "&Balance Sheet"
 msgstr ""
 
-#: ../reporting/reports_main.php:366
-#: ../reporting/reports_main.php:378
-#: ../reporting/reports_main.php:417
-#: ../reporting/reports_main.php:428
-#: ../reporting/reports_main.php:463
-#: ../reporting/reports_main.php:473
+#: ../reporting/reports_main.php:373
+#: ../reporting/reports_main.php:385
+#: ../reporting/reports_main.php:424
+#: ../reporting/reports_main.php:435
+#: ../reporting/reports_main.php:470
+#: ../reporting/reports_main.php:480
 msgid "Decimal values"
 msgstr ""
 
-#: ../reporting/reports_main.php:371
-#: ../reporting/reports_main.php:422
-#: ../reporting/reports_main.php:468
+#: ../reporting/reports_main.php:378
+#: ../reporting/reports_main.php:429
+#: ../reporting/reports_main.php:475
 msgid "&Profit and Loss Statement"
 msgstr ""
 
-#: ../reporting/reports_main.php:487
+#: ../reporting/reports_main.php:494
 msgid "Ta&x Report"
 msgstr ""
 
@@ -13113,7 +13173,7 @@ msgstr ""
 #: ../sales/view/view_dispatch.php:113
 #: ../sales/view/view_invoice.php:116
 #: ../sales/includes/ui/sales_credit_ui.inc:168
-#: ../sales/includes/ui/sales_order_ui.inc:147
+#: ../sales/includes/ui/sales_order_ui.inc:148
 msgid "Discount %"
 msgstr ""
 
@@ -13167,7 +13227,7 @@ msgstr ""
 #: ../reporting/includes/doctext.inc:60
 #: ../sales/view/view_sales_order.php:69
 #: ../sales/inquiry/sales_orders_view.php:305
-#: ../sales/includes/ui/sales_order_ui.inc:612
+#: ../sales/includes/ui/sales_order_ui.inc:597
 msgid "Valid until"
 msgstr ""
 
@@ -13302,15 +13362,15 @@ msgstr ""
 msgid "Generated By"
 msgstr ""
 
-#: ../reporting/includes/header2.inc:122
+#: ../reporting/includes/header2.inc:125
 msgid "Our VAT No."
 msgstr ""
 
-#: ../reporting/includes/header2.inc:128
+#: ../reporting/includes/header2.inc:131
 msgid "Domicile"
 msgstr ""
 
-#: ../reporting/includes/header2.inc:143
+#: ../reporting/includes/header2.inc:146
 #: ../reporting/includes/pdf_report.inc:352
 #: ../reporting/includes/pdf_report.inc:501
 #: ../reporting/includes/pdf_report.inc:628
@@ -13396,90 +13456,90 @@ msgstr ""
 msgid "Display: "
 msgstr ""
 
-#: ../reporting/includes/reports_classes.inc:149
+#: ../reporting/includes/reports_classes.inc:152
 msgid "Unknown report parameter type:"
 msgstr ""
 
-#: ../reporting/includes/reports_classes.inc:175
+#: ../reporting/includes/reports_classes.inc:178
 msgid "No Currency Filter"
 msgstr ""
 
-#: ../reporting/includes/reports_classes.inc:231
+#: ../reporting/includes/reports_classes.inc:234
 msgid "PDF/Printer"
 msgstr ""
 
-#: ../reporting/includes/reports_classes.inc:238
+#: ../reporting/includes/reports_classes.inc:241
 msgid "Portrait"
 msgstr ""
 
-#: ../reporting/includes/reports_classes.inc:238
+#: ../reporting/includes/reports_classes.inc:241
 msgid "Landscape"
 msgstr ""
 
-#: ../reporting/includes/reports_classes.inc:249
+#: ../reporting/includes/reports_classes.inc:252
 msgid "No Graphics"
 msgstr ""
 
-#: ../reporting/includes/reports_classes.inc:249
+#: ../reporting/includes/reports_classes.inc:252
 msgid "Vertical bars"
 msgstr ""
 
-#: ../reporting/includes/reports_classes.inc:249
+#: ../reporting/includes/reports_classes.inc:252
 msgid "Horizontal bars"
 msgstr ""
 
-#: ../reporting/includes/reports_classes.inc:250
+#: ../reporting/includes/reports_classes.inc:253
 msgid "Dots"
 msgstr ""
 
-#: ../reporting/includes/reports_classes.inc:250
+#: ../reporting/includes/reports_classes.inc:253
 msgid "Lines"
 msgstr ""
 
-#: ../reporting/includes/reports_classes.inc:250
+#: ../reporting/includes/reports_classes.inc:253
 msgid "Pie"
 msgstr ""
 
-#: ../reporting/includes/reports_classes.inc:250
+#: ../reporting/includes/reports_classes.inc:253
 msgid "Donut"
 msgstr ""
 
-#: ../reporting/includes/reports_classes.inc:254
 #: ../reporting/includes/reports_classes.inc:257
+#: ../reporting/includes/reports_classes.inc:260
 msgid "No Type Filter"
 msgstr ""
 
-#: ../reporting/includes/reports_classes.inc:267
+#: ../reporting/includes/reports_classes.inc:270
 msgid "No Account Group Filter"
 msgstr ""
 
-#: ../reporting/includes/reports_classes.inc:282
-#: ../reporting/includes/reports_classes.inc:288
-#: ../reporting/includes/reports_classes.inc:294
+#: ../reporting/includes/reports_classes.inc:285
+#: ../reporting/includes/reports_classes.inc:291
+#: ../reporting/includes/reports_classes.inc:297
 msgid "No Dimension Filter"
 msgstr ""
 
-#: ../reporting/includes/reports_classes.inc:300
+#: ../reporting/includes/reports_classes.inc:303
 msgid "No Customer Filter"
 msgstr ""
 
-#: ../reporting/includes/reports_classes.inc:308
+#: ../reporting/includes/reports_classes.inc:311
 msgid "No Supplier Filter"
 msgstr ""
 
-#: ../reporting/includes/reports_classes.inc:393
+#: ../reporting/includes/reports_classes.inc:399
 msgid "No Location Filter"
 msgstr ""
 
-#: ../reporting/includes/reports_classes.inc:396
+#: ../reporting/includes/reports_classes.inc:402
 msgid "No Category Filter"
 msgstr ""
 
-#: ../reporting/includes/reports_classes.inc:405
+#: ../reporting/includes/reports_classes.inc:411
 msgid "No Sales Folk Filter"
 msgstr ""
 
-#: ../reporting/includes/reports_classes.inc:412
+#: ../reporting/includes/reports_classes.inc:418
 msgid "No Users Filter"
 msgstr ""
 
@@ -13550,7 +13610,7 @@ msgid "Modifying Customer Credit Note #%d"
 msgstr ""
 
 #: ../sales/credit_note_entry.php:51
-#: ../sales/sales_order_entry.php:704
+#: ../sales/sales_order_entry.php:705
 msgid ""
 "There are no customers, or there are no customers with branches. Please "
 "define customers and customer branches."
@@ -13848,85 +13908,89 @@ msgstr ""
 msgid "There are no item quantities on this delivery note."
 msgstr ""
 
-#: ../sales/customer_delivery.php:297
-#: ../sales/sales_order_entry.php:532
-#: ../sales/includes/ui/sales_order_ui.inc:251
+#: ../sales/customer_delivery.php:206
+msgid ""
+"This document cannot be processed because there is insufficient quantity "
+"for: "
+msgstr ""
+
+#: ../sales/customer_delivery.php:305
 msgid ""
 "The delivery cannot be processed because there is an insufficient quantity "
 "for item:"
 msgstr ""
 
-#: ../sales/customer_delivery.php:367
+#: ../sales/customer_delivery.php:377
 msgid "For Sales Order"
 msgstr ""
 
-#: ../sales/customer_delivery.php:376
+#: ../sales/customer_delivery.php:386
 msgid "Delivery From"
 msgstr ""
 
-#: ../sales/customer_delivery.php:425
+#: ../sales/customer_delivery.php:435
 msgid "Invoice Dead-line"
 msgstr ""
 
-#: ../sales/customer_delivery.php:435
+#: ../sales/customer_delivery.php:445
 #: ../sales/customer_invoice.php:539
 #: ../sales/includes/ui/sales_order_ui.inc:84
-#: ../sales/includes/ui/sales_order_ui.inc:375
+#: ../sales/includes/ui/sales_order_ui.inc:360
 msgid ""
 "The selected customer account is currently on hold. Please contact the "
 "credit control personnel to discuss."
 msgstr ""
 
-#: ../sales/customer_delivery.php:440
+#: ../sales/customer_delivery.php:450
 msgid "Delivery Items"
 msgstr ""
 
-#: ../sales/customer_delivery.php:446
+#: ../sales/customer_delivery.php:456
 msgid "Max. delivery"
 msgstr ""
 
-#: ../sales/customer_delivery.php:446
+#: ../sales/customer_delivery.php:456
 #: ../sales/customer_invoice.php:553
 msgid "Invoiced"
 msgstr ""
 
-#: ../sales/customer_delivery.php:517
+#: ../sales/customer_delivery.php:533
 #: ../sales/customer_invoice.php:642
 msgid "Shipping Cost"
 msgstr ""
 
-#: ../sales/customer_delivery.php:537
-#: ../sales/includes/ui/sales_order_ui.inc:249
+#: ../sales/customer_delivery.php:553
+#: ../sales/includes/ui/sales_order_ui.inc:237
 msgid ""
 "Marked items have insufficient quantities in stock as on day of delivery."
 msgstr ""
 
-#: ../sales/customer_delivery.php:541
+#: ../sales/customer_delivery.php:557
 msgid "Action For Balance"
 msgstr ""
 
-#: ../sales/customer_delivery.php:548
-#: ../sales/customer_delivery.php:550
-#: ../sales/customer_delivery.php:553
+#: ../sales/customer_delivery.php:564
+#: ../sales/customer_delivery.php:566
+#: ../sales/customer_delivery.php:569
 #: ../sales/customer_invoice.php:694
 msgid "Refresh document page"
 msgstr ""
 
-#: ../sales/customer_delivery.php:550
+#: ../sales/customer_delivery.php:566
 msgid "Reset quantity"
 msgstr ""
 
-#: ../sales/customer_delivery.php:553
+#: ../sales/customer_delivery.php:569
 msgid "Clear quantity"
 msgstr ""
 
-#: ../sales/customer_delivery.php:555
+#: ../sales/customer_delivery.php:571
 msgid "Process Dispatch"
 msgstr ""
 
-#: ../sales/customer_delivery.php:556
+#: ../sales/customer_delivery.php:572
 #: ../sales/customer_invoice.php:696
-#: ../sales/sales_order_entry.php:751
+#: ../sales/sales_order_entry.php:752
 msgid "Check entered data and save document"
 msgstr ""
 
@@ -14051,7 +14115,7 @@ msgid "Payment terms:"
 msgstr ""
 
 #: ../sales/customer_invoice.php:545
-#: ../sales/sales_order_entry.php:727
+#: ../sales/sales_order_entry.php:728
 msgid "Sales Order Items"
 msgstr ""
 
@@ -14135,12 +14199,12 @@ msgid "Select Another Customer Payment for &Edition"
 msgstr ""
 
 #: ../sales/customer_payments.php:139
-#: ../sales/sales_order_entry.php:350
+#: ../sales/sales_order_entry.php:353
 msgid "There is no customer selected."
 msgstr ""
 
 #: ../sales/customer_payments.php:146
-#: ../sales/sales_order_entry.php:357
+#: ../sales/sales_order_entry.php:360
 msgid "This customer has no branch defined."
 msgstr ""
 
@@ -14332,193 +14396,200 @@ msgstr ""
 msgid "Enter a &New Direct Invoice"
 msgstr ""
 
-#: ../sales/sales_order_entry.php:380
+#: ../sales/sales_order_entry.php:383
 msgid "Pre-payment required have to be positive and less than total amount."
 msgstr ""
 
-#: ../sales/sales_order_entry.php:385
+#: ../sales/sales_order_entry.php:388
+#: ../sales/sales_order_entry.php:402
 msgid ""
 "You must enter the person or company to whom delivery should be made to."
 msgstr ""
 
-#: ../sales/sales_order_entry.php:392
+#: ../sales/sales_order_entry.php:395
+msgid ""
+"This document cannot be processed because there is insufficient quantity for "
+"items marked."
+msgstr ""
+
+#: ../sales/sales_order_entry.php:407
 msgid ""
 "You should enter the street address in the box provided. Orders cannot be "
 "accepted without a valid street address."
 msgstr ""
 
-#: ../sales/sales_order_entry.php:401
+#: ../sales/sales_order_entry.php:416
 msgid "The shipping cost entered is expected to be numeric."
 msgstr ""
 
-#: ../sales/sales_order_entry.php:407
+#: ../sales/sales_order_entry.php:422
 msgid "The Valid date is invalid."
 msgstr ""
 
-#: ../sales/sales_order_entry.php:409
+#: ../sales/sales_order_entry.php:424
 msgid "The delivery date is invalid."
 msgstr ""
 
-#: ../sales/sales_order_entry.php:416
+#: ../sales/sales_order_entry.php:430
 msgid "The requested valid date is before the date of the quotation."
 msgstr ""
 
-#: ../sales/sales_order_entry.php:418
+#: ../sales/sales_order_entry.php:432
 msgid "The requested delivery date is before the date of the order."
 msgstr ""
 
-#: ../sales/sales_order_entry.php:427
+#: ../sales/sales_order_entry.php:441
 msgid "You need to define a cash account for your Sales Point."
 msgstr ""
 
-#: ../sales/sales_order_entry.php:465
+#: ../sales/sales_order_entry.php:479
 msgid ""
 "The reference number field has been increased. Please save the document "
 "again."
 msgstr ""
 
-#: ../sales/sales_order_entry.php:511
+#: ../sales/sales_order_entry.php:525
 msgid ""
 "The item could not be updated because you are attempting to set the quantity "
 "ordered to less than 0, or the discount percent to more than 100."
 msgstr ""
 
-#: ../sales/sales_order_entry.php:515
+#: ../sales/sales_order_entry.php:529
 msgid "Price for inventory item must be entered and can not be less than 0"
 msgstr ""
 
-#: ../sales/sales_order_entry.php:522
+#: ../sales/sales_order_entry.php:536
 msgid ""
 "You attempting to make the quantity ordered a quantity less than has already "
 "been delivered. The quantity delivered cannot be modified retrospectively."
 msgstr ""
 
-#: ../sales/sales_order_entry.php:553
+#: ../sales/sales_order_entry.php:554
 #, php-format
 msgid "Price %s is below Standard Cost %s"
 msgstr ""
 
-#: ../sales/sales_order_entry.php:578
+#: ../sales/sales_order_entry.php:579
 msgid ""
 "This item cannot be deleted because some of it has already been delivered."
 msgstr ""
 
-#: ../sales/sales_order_entry.php:607
+#: ../sales/sales_order_entry.php:608
 msgid "Direct delivery entry has been cancelled as requested."
 msgstr ""
 
-#: ../sales/sales_order_entry.php:608
+#: ../sales/sales_order_entry.php:609
 msgid "Enter a New Sales Delivery"
 msgstr ""
 
-#: ../sales/sales_order_entry.php:610
+#: ../sales/sales_order_entry.php:611
 msgid "Direct invoice entry has been cancelled as requested."
 msgstr ""
 
-#: ../sales/sales_order_entry.php:611
+#: ../sales/sales_order_entry.php:612
 msgid "Enter a New Sales Invoice"
 msgstr ""
 
-#: ../sales/sales_order_entry.php:616
+#: ../sales/sales_order_entry.php:617
 msgid "This sales quotation has been cancelled as requested."
 msgstr ""
 
-#: ../sales/sales_order_entry.php:617
+#: ../sales/sales_order_entry.php:618
 msgid "Enter a New Sales Quotation"
 msgstr ""
 
-#: ../sales/sales_order_entry.php:624
+#: ../sales/sales_order_entry.php:625
 msgid "Undelivered part of order has been cancelled as requested."
 msgstr ""
 
-#: ../sales/sales_order_entry.php:625
+#: ../sales/sales_order_entry.php:626
 msgid "Select Another Sales Order for Edition"
 msgstr ""
 
-#: ../sales/sales_order_entry.php:629
+#: ../sales/sales_order_entry.php:630
 msgid "This sales order has been cancelled as requested."
 msgstr ""
 
-#: ../sales/sales_order_entry.php:630
+#: ../sales/sales_order_entry.php:631
 msgid "Enter a New Sales Order"
 msgstr ""
 
-#: ../sales/sales_order_entry.php:708
+#: ../sales/sales_order_entry.php:709
 msgid "Sales Invoice Items"
 msgstr ""
 
-#: ../sales/sales_order_entry.php:709
+#: ../sales/sales_order_entry.php:710
 msgid "Enter Delivery Details and Confirm Invoice"
 msgstr ""
 
-#: ../sales/sales_order_entry.php:711
+#: ../sales/sales_order_entry.php:712
 msgid "Place Invoice"
 msgstr ""
 
-#: ../sales/sales_order_entry.php:714
+#: ../sales/sales_order_entry.php:715
 msgid "Delivery Note Items"
 msgstr ""
 
-#: ../sales/sales_order_entry.php:715
+#: ../sales/sales_order_entry.php:716
 msgid "Enter Delivery Details and Confirm Dispatch"
 msgstr ""
 
-#: ../sales/sales_order_entry.php:716
+#: ../sales/sales_order_entry.php:717
 msgid "Cancel Delivery"
 msgstr ""
 
-#: ../sales/sales_order_entry.php:717
+#: ../sales/sales_order_entry.php:718
 msgid "Place Delivery"
 msgstr ""
 
-#: ../sales/sales_order_entry.php:719
+#: ../sales/sales_order_entry.php:720
 msgid "Quotation Date:"
 msgstr ""
 
-#: ../sales/sales_order_entry.php:720
+#: ../sales/sales_order_entry.php:721
 msgid "Sales Quotation Items"
 msgstr ""
 
-#: ../sales/sales_order_entry.php:721
+#: ../sales/sales_order_entry.php:722
 msgid "Enter Delivery Details and Confirm Quotation"
 msgstr ""
 
-#: ../sales/sales_order_entry.php:722
+#: ../sales/sales_order_entry.php:723
 msgid "Cancel Quotation"
 msgstr ""
 
-#: ../sales/sales_order_entry.php:723
+#: ../sales/sales_order_entry.php:724
 msgid "Place Quotation"
 msgstr ""
 
-#: ../sales/sales_order_entry.php:724
+#: ../sales/sales_order_entry.php:725
 msgid "Commit Quotations Changes"
 msgstr ""
 
-#: ../sales/sales_order_entry.php:728
+#: ../sales/sales_order_entry.php:729
 msgid "Enter Delivery Details and Confirm Order"
 msgstr ""
 
-#: ../sales/sales_order_entry.php:731
+#: ../sales/sales_order_entry.php:732
 msgid "Commit Order Changes"
 msgstr ""
 
-#: ../sales/sales_order_entry.php:753
-#: ../sales/sales_order_entry.php:759
+#: ../sales/sales_order_entry.php:754
+#: ../sales/sales_order_entry.php:760
 msgid ""
 "Cancels document entry or removes sales order when editing an old document"
 msgstr ""
 
-#: ../sales/sales_order_entry.php:754
-#: ../sales/sales_order_entry.php:763
+#: ../sales/sales_order_entry.php:755
+#: ../sales/sales_order_entry.php:764
 msgid "You are about to void this Document.\\nDo you want to continue?"
 msgstr ""
 
-#: ../sales/sales_order_entry.php:757
+#: ../sales/sales_order_entry.php:758
 msgid "Validate changes and update document"
 msgstr ""
 
-#: ../sales/sales_order_entry.php:761
+#: ../sales/sales_order_entry.php:762
 msgid ""
 "You are about to cancel undelivered part of this order.\\nDo you want to "
 "continue?"
@@ -14542,6 +14613,7 @@ msgstr ""
 #: ../sales/manage/customers.php:328
 #: ../sales/inquiry/customer_allocation_inquiry.php:42
 #: ../sales/inquiry/customer_inquiry.php:44
+#: ../sales/inquiry/sales_deliveries_view.php:116
 #: ../sales/inquiry/sales_orders_view.php:266
 msgid "Select a customer: "
 msgstr ""
@@ -14706,7 +14778,7 @@ msgid "Disable this Branch:"
 msgstr ""
 
 #: ../sales/manage/customer_branches.php:297
-#: ../sales/inquiry/sales_deliveries_view.php:183
+#: ../sales/inquiry/sales_deliveries_view.php:185
 msgid "Contact"
 msgstr ""
 
@@ -14727,7 +14799,7 @@ msgid "Tax Group"
 msgstr ""
 
 #: ../sales/manage/customer_branches.php:321
-#: ../sales/includes/ui/sales_order_ui.inc:306
+#: ../sales/includes/ui/sales_order_ui.inc:291
 msgid ""
 "The selected customer does not have any branches. Please create at least one "
 "branch."
@@ -15371,27 +15443,27 @@ msgid ""
 "\t\t    the same customer branch."
 msgstr ""
 
-#: ../sales/inquiry/sales_deliveries_view.php:179
+#: ../sales/inquiry/sales_deliveries_view.php:181
 msgid "Delivery #"
 msgstr ""
 
-#: ../sales/inquiry/sales_deliveries_view.php:185
+#: ../sales/inquiry/sales_deliveries_view.php:187
 msgid "Cust Ref"
 msgstr ""
 
-#: ../sales/inquiry/sales_deliveries_view.php:187
+#: ../sales/inquiry/sales_deliveries_view.php:189
 msgid "Due By"
 msgstr ""
 
-#: ../sales/inquiry/sales_deliveries_view.php:188
+#: ../sales/inquiry/sales_deliveries_view.php:190
 msgid "Delivery Total"
 msgstr ""
 
-#: ../sales/inquiry/sales_deliveries_view.php:190
+#: ../sales/inquiry/sales_deliveries_view.php:192
 msgid "Batch"
 msgstr ""
 
-#: ../sales/inquiry/sales_deliveries_view.php:190
+#: ../sales/inquiry/sales_deliveries_view.php:192
 msgid "Batch Invoicing"
 msgstr ""
 
@@ -15489,7 +15561,6 @@ msgstr ""
 
 #: ../sales/includes/db/old.sales_order_db.inc:139
 #: ../sales/includes/db/sales_order_db.inc:103
-#: ../sales/includes/db/sales_order_db.inc.orig:141
 msgid "Deleted."
 msgstr ""
 
@@ -15498,17 +15569,17 @@ msgid "Cash invoice"
 msgstr ""
 
 #: ../sales/includes/ui/sales_credit_ui.inc:94
-#: ../sales/includes/ui/sales_order_ui.inc:385
+#: ../sales/includes/ui/sales_order_ui.inc:370
 msgid "Customer Currency:"
 msgstr ""
 
 #: ../sales/includes/ui/sales_credit_ui.inc:112
-#: ../sales/includes/ui/sales_order_ui.inc:653
+#: ../sales/includes/ui/sales_order_ui.inc:638
 msgid "Shipping Company:"
 msgstr ""
 
 #: ../sales/includes/ui/sales_credit_ui.inc:114
-#: ../sales/includes/ui/sales_order_ui.inc:392
+#: ../sales/includes/ui/sales_order_ui.inc:377
 msgid "Customer Discount:"
 msgstr ""
 
@@ -15522,98 +15593,98 @@ msgid ""
 "have any branches."
 msgstr ""
 
-#: ../sales/includes/ui/sales_order_ui.inc:231
+#: ../sales/includes/ui/sales_order_ui.inc:219
 msgid "Shipping Charge"
 msgstr ""
 
-#: ../sales/includes/ui/sales_order_ui.inc:304
+#: ../sales/includes/ui/sales_order_ui.inc:289
 msgid "No customer found for entered text."
 msgstr ""
 
-#: ../sales/includes/ui/sales_order_ui.inc:330
+#: ../sales/includes/ui/sales_order_ui.inc:315
 #, php-format
 msgid "Customer's payment terms '%s' cannot be selected on this POS"
 msgstr ""
 
-#: ../sales/includes/ui/sales_order_ui.inc:379
+#: ../sales/includes/ui/sales_order_ui.inc:364
 msgid "Reference number unique for this document type"
 msgstr ""
 
-#: ../sales/includes/ui/sales_order_ui.inc:419
-#: ../sales/includes/ui/sales_order_ui.inc:421
+#: ../sales/includes/ui/sales_order_ui.inc:404
+#: ../sales/includes/ui/sales_order_ui.inc:406
 msgid "Price List:"
 msgstr ""
 
-#: ../sales/includes/ui/sales_order_ui.inc:438
+#: ../sales/includes/ui/sales_order_ui.inc:423
 msgid "Date of order receive"
 msgstr ""
 
-#: ../sales/includes/ui/sales_order_ui.inc:588
+#: ../sales/includes/ui/sales_order_ui.inc:573
 msgid "Cash payment"
 msgstr ""
 
-#: ../sales/includes/ui/sales_order_ui.inc:591
-#: ../sales/includes/ui/sales_order_ui.inc:623
+#: ../sales/includes/ui/sales_order_ui.inc:576
+#: ../sales/includes/ui/sales_order_ui.inc:608
 msgid "Deliver from Location:"
 msgstr ""
 
-#: ../sales/includes/ui/sales_order_ui.inc:594
+#: ../sales/includes/ui/sales_order_ui.inc:579
 msgid "Cash account:"
 msgstr ""
 
-#: ../sales/includes/ui/sales_order_ui.inc:601
+#: ../sales/includes/ui/sales_order_ui.inc:586
 msgid "Delivery Details"
 msgstr ""
 
-#: ../sales/includes/ui/sales_order_ui.inc:606
+#: ../sales/includes/ui/sales_order_ui.inc:591
 msgid "Invoice Delivery Details"
 msgstr ""
 
-#: ../sales/includes/ui/sales_order_ui.inc:607
+#: ../sales/includes/ui/sales_order_ui.inc:592
 msgid "Invoice before"
 msgstr ""
 
-#: ../sales/includes/ui/sales_order_ui.inc:611
+#: ../sales/includes/ui/sales_order_ui.inc:596
 msgid "Quotation Delivery Details"
 msgstr ""
 
-#: ../sales/includes/ui/sales_order_ui.inc:616
+#: ../sales/includes/ui/sales_order_ui.inc:601
 msgid "Order Delivery Details"
 msgstr ""
 
-#: ../sales/includes/ui/sales_order_ui.inc:637
+#: ../sales/includes/ui/sales_order_ui.inc:622
 msgid "Enter requested day of delivery"
 msgstr ""
 
-#: ../sales/includes/ui/sales_order_ui.inc:638
+#: ../sales/includes/ui/sales_order_ui.inc:623
 msgid "Enter Valid until Date"
 msgstr ""
 
-#: ../sales/includes/ui/sales_order_ui.inc:639
+#: ../sales/includes/ui/sales_order_ui.inc:624
 msgid "Deliver To:"
 msgstr ""
 
-#: ../sales/includes/ui/sales_order_ui.inc:640
+#: ../sales/includes/ui/sales_order_ui.inc:625
 msgid "Additional identifier for delivery e.g. name of receiving person"
 msgstr ""
 
-#: ../sales/includes/ui/sales_order_ui.inc:643
+#: ../sales/includes/ui/sales_order_ui.inc:628
 msgid "Delivery address. Default is address of customer branch"
 msgstr ""
 
-#: ../sales/includes/ui/sales_order_ui.inc:647
+#: ../sales/includes/ui/sales_order_ui.inc:632
 msgid "Contact Phone Number:"
 msgstr ""
 
-#: ../sales/includes/ui/sales_order_ui.inc:648
+#: ../sales/includes/ui/sales_order_ui.inc:633
 msgid "Phone number of ordering person. Defaults to branch phone number"
 msgstr ""
 
-#: ../sales/includes/ui/sales_order_ui.inc:649
+#: ../sales/includes/ui/sales_order_ui.inc:634
 msgid "Customer Reference:"
 msgstr ""
 
-#: ../sales/includes/ui/sales_order_ui.inc:650
+#: ../sales/includes/ui/sales_order_ui.inc:635
 msgid "Customer reference number for this order (if any)"
 msgstr ""
 
index e6d1e123c33a9229d62e441341d2a2b4dd9b0cfd..418eacd962386ab4e111dc595524cde158d9afef 100644 (file)
@@ -67,9 +67,14 @@ function add_material_cost($stock_id, $qty, $date_, $advanced=false)
                if ($qoh + $qty >= 0)
                        $cost_adjust = true;
                $qoh = 0;
-       }               
-       if ($qoh + $qty != 0)   
-               $material_cost = ($qoh * $material_cost + $qty * $m_cost) /     ($qoh + $qty);
+       }
+       if ($qoh + $qty != 0)
+       {
+               if ($qoh == 0)
+                       $material_cost += $m_cost;
+               else
+                       $material_cost = ($qoh * $material_cost + $qty * $m_cost) /     ($qoh + $qty);
+       }
        
        if ($advanced && $cost_adjust) // new 2010-02-10
                adjust_deliveries($stock_id, $bom_cost, $date_);        
@@ -120,6 +125,8 @@ function add_overhead_cost($stock_id, $qty, $date_, $costs, $adj_only=false)
                        add_audit_trail(ST_JOURNAL, $id, $date_);
                        add_comments(ST_JOURNAL, $id, $date_, $memo);
                        $Refs->save(ST_JOURNAL, $id, $ref);     
+                       if ($qty != 0)
+                               $overhead_cost = ($qoh * $overhead_cost + $costs) / $qty;
                }
        }
        else
@@ -173,6 +180,8 @@ function add_labour_cost($stock_id, $qty, $date_, $costs, $adj_only=false)
                        add_audit_trail(ST_JOURNAL, $id, $date_);
                        add_comments(ST_JOURNAL, $id, $date_, $memo);
                        $Refs->save(ST_JOURNAL, $id, $ref);     
+                       if ($qty != 0)
+                               $labour_cost = ($qoh * $labour_cost + $costs) / $qty;
                }
        }
        else
@@ -226,6 +235,8 @@ function add_issue_cost($stock_id, $qty, $date_, $costs, $adj_only=false)
                        add_audit_trail(ST_JOURNAL, $id, $date_);
                        add_comments(ST_JOURNAL, $id, $date_, $memo);
                        $Refs->save(ST_JOURNAL, $id, $ref);     
+                       if ($qty != 0)
+                               $material_cost = $costs / $qty; 
                }
        }
        else
index c9a352e1f9b93408dd460a25527c4d66f1cc25e3..24bf6e944724a28bb5e9fb8a23bc26c554c69d3e 100644 (file)
@@ -255,8 +255,7 @@ function void_work_order($woid)
 
                        void_stock_move(ST_MANURECEIVE, $row['id']); // and void the stock moves; 
                }
-
-               $result = get_work_order_issues($woid);
+               $result = get_additional_issues($woid); // check the issued quantities
                $cost = 0;
                $issue_no = 0;
                while ($row = db_fetch($result))
@@ -276,13 +275,10 @@ function void_work_order($woid)
                if ($cost != 0)
                        add_issue_cost($work_order['stock_id'], -$qty, $date, $cost);
 
-               //Adust avg labour cost
-               $cost = get_gl_wo_cost($woid, WO_LABOUR); 
+               $cost = get_gl_wo_cost($woid, WO_LABOUR); // get the labour cost and reduce avg cost
                if ($cost != 0)
-                       add_labour_cost($work_order['stock_id'], 1, $date, -$cost, true);
-                       
-               //Adust avg overhead cost
-               $cost = get_gl_wo_cost($woid, WO_OVERHEAD); 
+                       add_labour_cost($work_order['stock_id'], -$qty, $date, $cost);
+               $cost = get_gl_wo_cost($woid, WO_OVERHEAD); // get the overhead cost and reduce avg cost
                if ($cost != 0)
                        add_overhead_cost($work_order['stock_id'], -$qty, $date, $cost);
                
index 7a2baacb143c8cc1d4936e73b4fc82c5ee15ab75..e70ce5711851e5c17a43370efd60c51f0a8b198e 100644 (file)
@@ -38,6 +38,8 @@ function display_issue_items($title, &$order)
 //     $total = 0;
        $k = 0;  //row colour counter
 
+       if (count($order->line_items))
+               $low_stock = $order->check_qoh($_POST['Location'], $_POST['date_'], !$_POST['IssueType']);
        $id = find_submit('Edit');
        foreach ($order->line_items as $line_no=>$stock_item)
        {
@@ -46,7 +48,10 @@ function display_issue_items($title, &$order)
 
                if ($id != $line_no)
                {
-               alt_table_row_color($k);
+                       if (in_array($stock_item->stock_id, $low_stock))
+                               start_row("class='stockmankobg'");      // notice low stock status
+                       else 
+                               alt_table_row_color($k);
 
                        view_stock_status_cell($stock_item->stock_id);
                        label_cell($stock_item->item_description);
@@ -73,6 +78,8 @@ function display_issue_items($title, &$order)
 //     label_row(_("Total"), number_format2($total,user_price_dec()), "colspan=5", "align=right");
 
     end_table();
+       if (@$low_stock)
+               display_note(_("Marked items have insufficient quantities in stock as on day of issue."), 0, 1, "class='stockmankofg'");
        div_end();
 }
 
index 05892e3ec90cb9cdb78db41f2cf37280422b4c1c..7610a1cb9f867edf565748d17e4271cea9dd02b3 100644 (file)
@@ -156,11 +156,11 @@ function dec_amount($row, $amount)
 $sql = get_sql_for_work_orders($outstanding_only, $all_items);
 
 $cols = array(
-       _("#") => array('fun'=>'view_link'), 
+       _("#") => array('fun'=>'view_link', 'ord'=>''), 
        _("Reference"), // viewlink 2 ?
        _("Type") => array('fun'=>'wo_type_name'),
        _("Location"), 
-       _("Item") => array('fun'=>'view_stock'),
+       _("Item") => array('fun'=>'view_stock', 'ord'=>''),
        _("Required") => array('fun'=>'dec_amount', 'align'=>'right'),
        _("Manufactured") => array('fun'=>'dec_amount', 'align'=>'right'),
        _("Date") => array('name'=>'date_', 'type'=>'date', 'ord'=>'desc'), 
index c9c7e6271133e40a0ab0cc16a986ed8133d7667a..35c731767554c36f9f1c24bef773a12bd66604dc 100644 (file)
@@ -121,10 +121,7 @@ function can_process()
        // if unassembling we need to check the qoh
        if (($_POST['ProductionType'] == 0) && !$SysPrefs->allow_negative_stock())
        {
-               $wo_details = get_work_order($_POST['selected_id']);
-
-               $qoh = get_qoh_on_date($wo_details["stock_id"], $wo_details["loc_code"], $_POST['date_']);
-               if (-input_num('quantity') + $qoh < 0)
+               if (check_negative_stock($wo_details["stock_id"], -input_num('quantity'), $wo_details["loc_code"], $_POST['date_']))
                {
                        display_error(_("The unassembling cannot be processed because there is insufficient stock."));
                        set_focus('quantity');
@@ -141,13 +138,13 @@ function can_process()
                {
                        if ($row['mb_flag'] == 'D') // service, non stock
                                continue;
-                       $qoh = get_qoh_on_date($row["stock_id"], $row["loc_code"], $_POST['date_']);
-                       if ($qoh - $row['units_req'] * input_num('quantity') < 0)
+
+                       if (check_negative_stock($row["stock_id"], -$row['units_req'] * input_num('quantity'), $row["loc_code"], $_POST['date_']))
                        {
                        display_error( _("The production cannot be processed because a required item would cause a negative inventory balance :") .
                                " " . $row['stock_id'] . " - " .  $row['description']);
-                       $err = true;    
-                       }       
+                       $err = true;
+                       }
                }
                if ($err)
                {
index aa8361ec346f56b3680872782dd2d7e0ea3a83f9..06e82837a1ade8614b23d621281f7a4666abba9d 100644 (file)
@@ -203,8 +203,7 @@ function can_process()
 
                                $quantity = $bom_item["quantity"] * input_num('quantity');
 
-                        $qoh = get_qoh_on_date($bom_item["component"], $bom_item["loc_code"], $_POST['date_']);
-                               if (-$quantity + $qoh < 0)
+                        if (check_negative_stock($bom_item["component"], -$quantity, $bom_item["loc_code"], $_POST['date_']))
                                {
                                        display_error(_("The work order cannot be processed because there is an insufficient quantity for component:") .
                                                " " . $bom_item["component"] . " - " .  $bom_item["description"] . ".  " . _("Location:") . " " . $bom_item["location_name"]);
@@ -217,8 +216,7 @@ function can_process()
                elseif ($_POST['type'] == WO_UNASSEMBLY)
                {
                        // if unassembling, check item to unassemble
-                               $qoh = get_qoh_on_date($_POST['stock_id'], $_POST['StockLocation'], $_POST['date_']);
-                       if (-input_num('quantity') + $qoh < 0)
+                if (check_negative_stock($_POST['stock_id'], -input_num('quantity'), $_POST['StockLocation'], $_POST['date_']))
                        {
                                display_error(_("The selected item cannot be unassembled because there is insufficient stock."));
                                        return false;
index b5d6e4cc1f0058d6d264f1780b6039a1154fbcaf..d2344f6f76962dcba885ad42232b7d586d08ae6e 100644 (file)
@@ -102,9 +102,7 @@ function can_process()
        $failed_item = $_SESSION['issue_items']->check_qoh($_POST['Location'], $_POST['date_'], !$_POST['IssueType']);
        if ($failed_item != -1) 
        {
-               $item = $_SESSION['issue_items']->line_items[$failed_item];
-       display_error( _("The issue cannot be processed because an entered item would cause a negative inventory balance :") .
-               " " . $item->stock_id . " - " .  $item->item_description);
+               display_error(_("The issue cannot be processed because it would cause negative inventory balance for marked items as of document date or later."));
                return false;
        }
 
index 22a853d140ef49afaa13cfa9778540f4687be111..a097db4617c4bb4b63817b7fa34bc9cdda8b31a2 100644 (file)
@@ -258,7 +258,7 @@ function get_short_info($stock_id)
        return db_query($sql,"The stock details for " . $stock_id . " could not be retrieved");
 }
 
-function get_sql_for_po_search_completed()
+function get_sql_for_po_search_completed($supplier_id=ALL_TEXT)
 {
        global $order_number, $selected_stock_item;;
 
@@ -303,14 +303,16 @@ function get_sql_for_po_search_completed()
                {
                        $sql .= " AND line.item_code=".db_escape($selected_stock_item);
                }
-
+               if ($supplier_id != ALL_TEXT)
+                       $sql .= " AND supplier.supplier_id=".db_escape($supplier_id);
+               
        } //end not order number selected
 
        $sql .= " GROUP BY porder.order_no";
        return $sql;
 }      
 
-function get_sql_for_po_search()
+function get_sql_for_po_search($supplier_id=ALL_TEXT)
 {
        global $all_items, $order_number, $selected_stock_item;;
        
@@ -356,6 +358,8 @@ function get_sql_for_po_search()
                {
                        $sql .= " AND line.item_code=".db_escape($selected_stock_item);
                }
+               if ($supplier_id != ALL_TEXT)
+                       $sql .= " AND supplier.supplier_id=".db_escape($supplier_id);
        } //end not order number selected
 
        $sql .= " GROUP BY porder.order_no";
index 2cd7223a59635e7bdc654441127a9f83544a469f..44b9b357f05139f65c9a23586c4a3c51221e47e9 100644 (file)
@@ -73,6 +73,8 @@ start_row();
 
 stock_items_list_cells(_("Item:"), 'SelectStockFromList', null, true);
 
+supplier_list_cells(_("Select a supplier: "), 'supplier_id', null, true, true);
+
 submit_cells('SearchOrders', _("Search"),'',_('Select documents'), 'default');
 end_row();
 end_table(1);
@@ -121,7 +123,7 @@ else
 }
 
 //figure out the sql required from the inputs available
-$sql = get_sql_for_po_search();
+$sql = get_sql_for_po_search($_POST['supplier_id']);
 
 //$result = db_query($sql,"No orders were returned");
 
index 986a706f3c60d0fe09d5e87820b053f0e8bac00a..196de84e295c1424630927ddd1c61fe0c3adb079 100644 (file)
@@ -71,6 +71,9 @@ start_row();
 
 stock_items_list_cells(_("for item:"), 'SelectStockFromList', null, true);
 
+if (!@$_GET['popup'])
+       supplier_list_cells(_("Select a supplier: "), 'supplier_id', null, true, true);
+
 submit_cells('SearchOrders', _("Search"),'',_('Select documents'), 'default');
 end_row();
 end_table(1);
@@ -114,7 +117,7 @@ function prt_link($row)
 
 //---------------------------------------------------------------------------------------------
 
-$sql = get_sql_for_po_search_completed();
+$sql = get_sql_for_po_search_completed(!@$_GET['popup'] ? $_POST['supplier_id'] : ALL_TEXT);
 
 $cols = array(
                _("#") => array('fun'=>'trans_view', 'ord'=>''), 
index a89acc7f8f33feff48720b5155aedbab09cb090b..0d1e6c9fd75455983b2a322037187d08a3cfdc12 100644 (file)
@@ -220,8 +220,7 @@ function check_data()
                foreach ($_SESSION['supp_trans']->grn_items as $n => $item) {
                        if (is_inventory_item($item->item_code))
                        {
-                               $qoh = get_qoh_on_date($item->item_code, null, $_SESSION['supp_trans']->tran_date);
-                               if ($item->this_quantity_inv > $qoh)
+                               if (check_negative_stock($item->item_code, -$item->this_quantity_inv, null, $_SESSION['supp_trans']->tran_date))
                                {
                                        $stock = get_item($item->item_code);
                                        display_error(_("The return cannot be processed because there is an insufficient quantity for item:") .
index 31f0105fdb7276d4f40722d72e7270d57b65d0d2..9cb88526ebf95049e6af8dd84e363798d372c308 100644 (file)
@@ -145,19 +145,22 @@ class graph
     var $dec1 = 0;
     var $dec2 = 0;
     var $h3d = 15; // 3D height
-       var $built_in = true;
+       var $built_in = false;
        var $fontfile = "";
        var $encoding;
        
     function graph()
     {
-               $this->encoding = $_SESSION['language']->encoding;
+       global $UTF8_fontfile;
+               $this->encoding = strtoupper($_SESSION['language']->encoding);
                $path = dirname(__FILE__).'/../fonts/';
 
-               // If you use utf-8 encoding you have to download and install FreeSans.ttf font.
+               // If you use UTF-8 encoding you have to download and install FreeSans.ttf font.
                // It is not bundled with application due to its size.
-               $this->fontfile = $this->encoding=='UTF-8' ? $path.'FreeSans.ttf' : $path.'LiberationSans-Regular.ttf';
-
+               // You can also use another UTF-8 font and put it in config.php with the name in $UTF8_fontfile 
+               $this->fontfile = $this->encoding == 'UTF-8' ? (isset($UTF8_fontfile) && $UTF8_fontfile != "" ? $path.$UTF8_fontfile : $path.'FreeSans.ttf') : 
+                       $path.'LiberationSans-Regular.ttf';
+               
         $this->x = $this->y = $this->z = array();
         $this->biggest_x        = NULL;
         $this->biggest_y        = NULL;
@@ -270,13 +273,19 @@ class graph
                 if ($i % 2 == 0) 
                 {
                     $value = $this->number_formated($this->higher_value * $i / 10, $this->dec1);
-                    $less = 7 * strlen($value);
+                    $len1 = strlen($this->higher_value_str);
+                    $len2 = strlen($value);
+                    if ($len2 < $len1)
+                       $len2 += ($len1-$len2-1);
+                    $less = 7 * $len2;
+                    //$this->_imagestring($this->img, $this->size, ($x1-$less-7), ($y2-7), $value, $this->color['axis_values']);
                     $this->_imagestring($this->img, $this->size, ($x1-$less-7), ($y2-7), $value, $this->color['axis_values']);
                 }
             }
 
             // Axis X
-            $this->_imagestring($this->img, $this->size, $this->graphic_area_x2+10, $this->graphic_area_y2+3, $this->axis_x, $this->color['title']);
+            //$this->_imagestring($this->img, $this->size, $this->graphic_area_x2+10, $this->graphic_area_y2+3, $this->axis_x, $this->color['title']);
+            $this->_imagestring($this->img, $this->size, $this->graphic_area_x2+40, $this->graphic_area_y2+3, $this->axis_x, $this->color['title']);
             imageline($this->img, $this->graphic_area_x1, $this->graphic_area_y2, $this->graphic_area_x2, $this->graphic_area_y2, $this->color['axis_line']);
             // Axis Y
             $this->_imagestring($this->img, $this->size, 20, $this->graphic_area_y1-20, $this->axis_y, $this->color['title']);
@@ -364,7 +373,8 @@ class graph
                 imageline($this->img, ($x2+1), ($y1-1), ($x2+1), $y2, $this->color['bars_shadow']);
                 imageline($this->img, ($x2+2), ($y1-1), ($x2+2), $y2, $this->color['bars_shadow']);
                 imagefilledrectangle($this->img, $x1, $y1, $x2, $y2, $this->color['bars']);
-                $this->_imagestring($this->img, $this->size, ((($x1+$x2)/2) - (strlen($parameter)*7/2)), ($y2+2), $parameter, $this->color['axis_values'], $alt);
+                //$this->_imagestring($this->img, $this->size, ((($x1+$x2)/2) - (strlen($parameter)*7/2)), ($y2+2), $parameter, $this->color['axis_values'], $alt);
+                $this->_imagestring($this->img, $this->size, $x1, ($y2+2), $parameter, $this->color['axis_values'], $alt);
             }
         }
 
@@ -435,7 +445,8 @@ class graph
                 {
                     imageline($this->img, $x[$i], ($this->graphic_area_y1+10), $x[$i], ($this->graphic_area_y2-1), $this->color['bg_lines']);
                 }
-                $this->_imagestring($this->img, $this->size, ($x[$i] - (strlen($parameter)*7/2 )), ($this->graphic_area_y2+2), $parameter, $this->color['axis_values'], $alt);
+                //$this->_imagestring($this->img, $this->size, ($x[$i] - (strlen($parameter)*7/2 )), ($this->graphic_area_y2+2), $parameter, $this->color['axis_values'], $alt);
+                $this->_imagestring($this->img, $this->size, $x[$i], ($this->graphic_area_y2+2), $parameter, $this->color['axis_values'], $alt);
 
                 $x[$i+1] = $x[$i] + 40;
             }
@@ -771,7 +782,11 @@ class graph
     function string_width($string, $size) 
     {
         $single_width = $size + 4;
-        return $single_width * strlen($string);
+        if ($this->encoding == "UTF-8")
+               $width = mb_strlen($string, "UTF-8");
+        else   
+               $width = strlen($string);
+        return $single_width * $width;
     }
 
     function string_height($size) 
@@ -954,15 +969,30 @@ class graph
 
     function _imagestring($img, $size, $x, $y, $string, $col, $alt=0)
     {
-               if ($alt && strlen($string) > 12)
-                       $string = substr($string, 0, 12);
-
                if ($this->encoding != 'UTF-8') {
                        if (function_exists('iconv'))
                                $string = iconv($this->encoding, 'UTF-8', $string);
                        else
                                $string = mb_convert_encoding($string, 'UTF-8', $this->encoding);
                }
+               
+               // New 2014-06-26 Joe Hunt for handling ev. RTL languages
+               if ($alt)
+               {
+                       if ($this->encoding == 'UTF-8' && is_arabic($string))
+                               $alt_len = 18;
+                       else
+                               $alt_len = 12;
+                       if (strlen($string) > $alt_len)
+                               $string = substr($string, 0, $alt_len);
+               }               
+               if ($this->encoding == 'UTF-8')
+               {
+                       if (is_arabic($string))
+                               $string = arabic($string, "we");
+                       elseif (is_hebrew($string))
+                               $string = hebrew($string);
+               }
 
        if ($this->built_in)
        {
@@ -972,11 +1002,11 @@ class graph
        {
                if ($size == 1)
                        $size = 7;
-               else if ($size == 2)
+               elseif ($size == 2)
                        $size = 8;
-               else if ($size == 3)
+               elseif ($size == 3)
                        $size = 9;
-               else if ($size == 4)
+               elseif ($size == 4)
                        $size = 11;
                else
                        $size = 12;
@@ -985,9 +1015,293 @@ class graph
                //      $angle = -15;
                //else
                                $angle = 0;
-
-               imagettftext($img, $size, $angle, $x, $y + $alt, $col, $this->fontfile, $string);
+                       
+                       imagettftext($img, $size, $angle, $x, $y + $alt, $col, $this->fontfile, $string);
        }
     }  
 }
-?>
\ No newline at end of file
+
+// The following is for handling RTL texts. GD does not handle RTL at all.
+// The function, arabic, has been taken from Milad Rastian and
+// modified by Bagram Siadat.
+// The function has been further modified and several bugs are fixed.
+
+function is_arabic($text)
+{
+       return preg_match('/\p{Arabic}/u', $text);
+} 
+
+function is_hebrew($text)
+{
+       return preg_match('/\p{Hebrew}/u', $text);
+} 
+
+function utf8_strlen($str) 
+{
+       return preg_match_all('/[\x00-\x7F\xC0-\xFD]/', $str, $dummy);
+}
+
+function utf8_chr($uni) 
+{
+       $r = "";
+    # ASCII range (including control chars)
+    if ( ($uni >= 0) && ($uni <= 0x007f) ) 
+            $r .= chr($uni);
+       elseif ($uni <= 0x07ff) // 2 byte sequence
+       {
+               $r .= chr(0xc0 | ($uni >> 6));
+               $r .= chr(0x80 | ($uni & 0x003f));
+       } 
+       elseif($uni == 0xFEFF) // Byte order mark (skip)
+               return chr(0); // nop -- zap the BOM
+       elseif ($uni >= 0xD800 && $uni <= 0xDFFF) // Test for illegal surrogates 
+               return chr(0); // found a surrogate
+       elseif ($uni <= 0xffff) // 3 byte sequence 
+       {
+               $r .= chr(0xe0 | ($uni >> 12));
+               $r .= chr(0x80 | (($uni >> 6) & 0x003f));
+               $r .= chr(0x80 | ($uni & 0x003f));
+       } 
+       elseif ($uni <= 0x10ffff) // 4 byte sequence 
+       {
+               $r .= chr(0xf0 | ($uni >> 18));
+               $r .= chr(0x80 | (($uni >> 12) & 0x3f));
+               $r .= chr(0x80 | (($uni >> 6) & 0x3f));
+               $r .= chr(0x80 | ($uni & 0x3f));
+       } 
+       else 
+               return chr(0);
+       return $r;
+}
+
+global $p_chars;
+$p_chars = array (
+    utf8_chr(0x0622) => array (utf8_chr(0xfe82), utf8_chr(0xfe82), utf8_chr(0x0622)),
+    utf8_chr(0x0627) => array (utf8_chr(0xfe8e), utf8_chr(0xfe8e), utf8_chr(0x0627)),
+    utf8_chr(0x0628) => array (utf8_chr(0xfe90), utf8_chr(0xfe92), utf8_chr(0xfe91)),
+    utf8_chr(0x067e) => array (utf8_chr(0xfb57), utf8_chr(0xfb59), utf8_chr(0xfb58)),
+    utf8_chr(0x062a) => array (utf8_chr(0xfe96), utf8_chr(0xfe98), utf8_chr(0xfe97)),
+    utf8_chr(0x062b) => array (utf8_chr(0xfe9a), utf8_chr(0xfe9c), utf8_chr(0xfe9b)),
+    utf8_chr(0x062c) => array (utf8_chr(0xfe9e), utf8_chr(0xfea0), utf8_chr(0xfe9f)),
+    utf8_chr(0x0686) => array (utf8_chr(0xfb7b), utf8_chr(0xfb7d), utf8_chr(0xfb7c)),
+    utf8_chr(0x062d) => array (utf8_chr(0xfea2), utf8_chr(0xfea4), utf8_chr(0xfea3)),
+    utf8_chr(0x062e) => array (utf8_chr(0xfea6), utf8_chr(0xfea8), utf8_chr(0xfea7)),
+    utf8_chr(0x062f) => array (utf8_chr(0xfeaa), utf8_chr(0xfeaa), utf8_chr(0xfea9)),
+    utf8_chr(0x0630) => array (utf8_chr(0xfeac), utf8_chr(0xfeac), utf8_chr(0xfeab)),
+    utf8_chr(0x0631) => array (utf8_chr(0xfeae), utf8_chr(0xfeae), utf8_chr(0xfead)),
+    utf8_chr(0x0632) => array (utf8_chr(0xfeb0), utf8_chr(0xfeb0), utf8_chr(0xfeaf)),
+    utf8_chr(0x0698) => array (utf8_chr(0xfb8b), utf8_chr(0xfb8b), utf8_chr(0xfb8a)),
+    utf8_chr(0x0633) => array (utf8_chr(0xfeb2), utf8_chr(0xfeb4), utf8_chr(0xfeb3)),
+    utf8_chr(0x0634) => array (utf8_chr(0xfeb6), utf8_chr(0xfeb8), utf8_chr(0xfeb7)),
+    utf8_chr(0x0635) => array (utf8_chr(0xfeba), utf8_chr(0xfebc), utf8_chr(0xfebb)),
+    utf8_chr(0x0636) => array (utf8_chr(0xfebe), utf8_chr(0xfec0), utf8_chr(0xfebf)),
+    utf8_chr(0x0637) => array (utf8_chr(0xfec2), utf8_chr(0xfec4), utf8_chr(0xfec3)),
+    utf8_chr(0x0638) => array (utf8_chr(0xfec6), utf8_chr(0xfec8), utf8_chr(0xfec7)),
+    utf8_chr(0x0639) => array (utf8_chr(0xfeca), utf8_chr(0xfecc), utf8_chr(0xfecb)),
+    utf8_chr(0x063a) => array (utf8_chr(0xfece), utf8_chr(0xfed0), utf8_chr(0xfecf)),
+    utf8_chr(0x0641) => array (utf8_chr(0xfed2), utf8_chr(0xfed4), utf8_chr(0xfed3)),
+    utf8_chr(0x0642) => array (utf8_chr(0xfed6), utf8_chr(0xfed8), utf8_chr(0xfed7)),
+    utf8_chr(0x06a9) => array (utf8_chr(0xfeda), utf8_chr(0xfedc), utf8_chr(0xfedb)),
+    utf8_chr(0x06af) => array (utf8_chr(0xfb93), utf8_chr(0xfb95), utf8_chr(0xfb94)),
+    utf8_chr(0x0644) => array (utf8_chr(0xfede), utf8_chr(0xfee0), utf8_chr(0xfedf)),
+    utf8_chr(0x0645) => array (utf8_chr(0xfee2), utf8_chr(0xfee4), utf8_chr(0xfee3)),
+    utf8_chr(0x0646) => array (utf8_chr(0xfee6), utf8_chr(0xfee8), utf8_chr(0xfee7)),
+    utf8_chr(0x0648) => array (utf8_chr(0xfeee), utf8_chr(0xfeee), utf8_chr(0xfeed)),
+    utf8_chr(0x06cc) => array (utf8_chr(0xfbfd), utf8_chr(0xfbff), utf8_chr(0xfbfe)),
+    utf8_chr(0x0643) => array (utf8_chr(0xfeda), utf8_chr(0xfedc), utf8_chr(0xfedb)),
+    utf8_chr(0x064a) => array (utf8_chr(0xfef2), utf8_chr(0xfef4), utf8_chr(0xfef3)),
+    utf8_chr(0x0623) => array (utf8_chr(0xfe84), utf8_chr(0xfe84), utf8_chr(0xfe83)),
+    utf8_chr(0x0624) => array (utf8_chr(0xfe86), utf8_chr(0xfe86), utf8_chr(0xfe85)),
+    utf8_chr(0x0625) => array (utf8_chr(0xfe88), utf8_chr(0xfe88), utf8_chr(0xfe87)),
+    utf8_chr(0x0626) => array (utf8_chr(0xfe8a), utf8_chr(0xfe8c), utf8_chr(0xfe8b)),
+    utf8_chr(0x0629) => array (utf8_chr(0xfe94), utf8_chr(0xfe98), utf8_chr(0xfe97))
+);
+
+global $nastaligh;
+$nastaligh = array (
+    utf8_chr(0x0647) => array (utf8_chr(0xfbab), utf8_chr(0xfbad), utf8_chr(0xfbac))
+);
+global $normal;
+$normal = array (
+    utf8_chr(0x0647) => array (utf8_chr(0xfeea), utf8_chr(0xfeec), utf8_chr(0xfeeb))
+);
+
+global $mp_chars;
+$mp_chars = array (utf8_chr(0x0622), utf8_chr(0x0627), utf8_chr(0x062f), utf8_chr(0x0630), utf8_chr(0x0631), utf8_chr(0x0632), 
+       utf8_chr(0x0698), utf8_chr(0x0648), utf8_chr(0x0623), utf8_chr(0x0625), utf8_chr(0x0624));
+
+global $ignorelist;
+$ignorelist = array (utf8_chr(0x0000), utf8_chr(0x064c), utf8_chr(0x064d), utf8_chr(0x064b), utf8_chr(0x064f), utf8_chr(0x0650), 
+       utf8_chr(0x064e), utf8_chr(0x0651), utf8_chr(0x0653), utf8_chr(0x0670), utf8_chr(0x0654), utf8_chr(0xfe76), utf8_chr(0xfe7a), 
+       utf8_chr(0xfe78), utf8_chr(0xfe7c), utf8_chr(0xfe7e), utf8_chr(0xfe74), utf8_chr(0xfe70), utf8_chr(0xfc5e), utf8_chr(0xfc5f), 
+       utf8_chr(0xfc60), utf8_chr(0xfc61), utf8_chr(0xfc62), utf8_chr(0xfc63));
+
+///
+function arabic($str,$z="",$method='normal')
+{
+       global $p_chars,$mp_chars, $ignorelist,$nastaligh,$normal;
+       $str_back = $output = $e_output = $str_next = $str1 = $num = "";
+       if ($method == 'nastaligh')
+               $p_chars = array_merge($p_chars, $nastaligh);
+       else
+               $p_chars = array_merge($p_chars, $normal);
+       $str_len = utf8_strlen($str);
+       preg_match_all("/./u", $str, $ar);
+       for ($i = 0; $i < $str_len; $i++)
+       {
+               if (isset($ar[0][$i]))
+                       $str1 = $ar[0][$i];
+               if(isset($ar[0][$i+1]) && in_array($ar[0][$i+1], $ignorelist))
+               {
+                       if (isset($ar[0][$i+2]))
+                               $str_next = $ar[0][$i+2];
+                       if ($i == 2) 
+                               $str_back = $ar[0][$i-2];
+                       if ($i > 1 && $i != 2) 
+                               $str_back = $ar[0][$i-1];
+               }
+               elseif ($i > 0 && isset($ar[0][$i-1]) && !in_array($ar[0][$i-1], $ignorelist))
+               {
+                       if (isset($ar[0][$i+1]))
+                               $str_next = $ar[0][$i+1];
+                       if ($i != 0) 
+                               $str_back = $ar[0][$i-1];
+               }
+               else
+               {
+                       if (isset($ar[0][$i+1]) && !empty($ar[0][$i+1]))
+                               $str_next = $ar[0][$i+1];
+                       elseif ($i > 0 && isset($ar[0][$i-1])) 
+                               $str_next = $ar[0][$i-1];
+                       if ($i > 1 && isset($ar[0][$i-2])) 
+                               $str_back = $ar[0][$i-2];
+               }
+               if (!in_array($str1,$ignorelist))
+               {
+                       if (array_key_exists($str1,$p_chars))
+                       {
+                               if (!$str_back || $str_back==" " || !array_key_exists($str_back,$p_chars))
+                               {
+                                       if (!array_key_exists($str_back, $p_chars) && !array_key_exists($str_next, $p_chars)) 
+                                               $output = $str1.$output;
+                                       else 
+                                               $output = $p_chars[$str1][2].$output;
+                                       continue;
+                               }
+                               elseif (array_key_exists($str_next, $p_chars) && array_key_exists($str_back, $p_chars))
+                               {
+                                       if (in_array($str_back, $mp_chars) && array_key_exists($str_next, $p_chars))
+                                               $output = $p_chars[$str1][2].$output;
+                                       else
+                                               $output = $p_chars[$str1][1].$output;
+                                       continue;
+                               }
+                               elseif (array_key_exists($str_back, $p_chars) && !array_key_exists($str_next, $p_chars))
+                               {
+                                       if (in_array($str_back, $mp_chars))
+                                               $output = $str1.$output;
+                                       else
+                                               $output = $p_chars[$str1][0].$output;
+                                       continue;
+                               }
+                       }
+                       elseif ($z == "we")
+                       {
+                               $number = array('0', '1', '2', '3', '4', '5', '6', '7', '8', '9',
+                                       "\xD9\xA0", "\xD9\xA1", "\xD9\xA2", "\xD9\xA3", "\xD9\xA4", "\xD9\xA5", "\xD9\xA6", 
+                                       "\xD9\xA7", "\xD9\xA8", "\xD9\xA9",     "\xDB\xB0", "\xDB\xB1", "\xDB\xB2", "\xDB\xB3", 
+                                       "\xDB\xB4", "\xDB\xB5", "\xDB\xB6", "\xDB\xB7", "\xDB\xB8", "\xDB\xB9");
+                               if (in_array($str1, $number))
+                               {
+                                       $num .= $str1;
+                                       $str1 = "";
+                               }
+                               if (!in_array($str_next, $number))
+                               {
+                                       $str1 .= $num;
+                                       $num = "";
+                               }
+                               //$output = $str1.$output;
+                               $output = $output.$str1;
+                       }
+                       elseif ($z == "fa")
+                       {
+                               $number = array (utf8_chr(0x0660), utf8_chr(0x0661), utf8_chr(0x0662), 
+                                       utf8_chr(0x0663), utf8_chr(0x0664), utf8_chr(0x0665), utf8_chr(0x0666), 
+                                       utf8_chr(0x0667), utf8_chr(0x0668), utf8_chr(0x0669), utf8_chr(0x06f4), 
+                                       utf8_chr(0x06f5), utf8_chr(0x06f6), utf8_chr(0x0030), utf8_chr(0x0031), 
+                                       utf8_chr(0x0032), utf8_chr(0x0033), utf8_chr(0x0034), utf8_chr(0x0035), 
+                                       utf8_chr(0x0036), utf8_chr(0x0037), utf8_chr(0x0038), utf8_chr(0x0039));
+                               switch ($str1)
+                               {
+                                       case ")" : 
+                                               $str1 = "("; 
+                                               break;
+                                       case "(" : 
+                                               $str1 = ")"; 
+                                               break;
+                                       case "}" : 
+                                               $str1 = "{"; 
+                                               break;
+                                       case "{" : 
+                                               $str1 = "}"; 
+                                               break;
+                                       case "]" : 
+                                               $str1 = "["; 
+                                               break;
+                                       case "[" : 
+                                               $str1 = "]"; 
+                                               break;
+                                       case ">" : 
+                                               $str1 = "<"; 
+                                               break;
+                                       case "<" : 
+                                               $str1 = ">"; 
+                                               break;
+                               }
+                               if (in_array($str1, $number))
+                               {
+                                       $num .= $str1;
+                                       $str1 = "";
+                               }
+                               if (!in_array($str_next, $number))
+                               {
+                                       $str1 .= $num;
+                                       $num = "";
+                               }
+                               $output = $str1.$output;
+                       }
+                       else
+                       {
+                               if (($str1 == utf8_chr(0x060c)) || ($str1 == utf8_chr(0x061f)) || ($str1 == utf8_chr(0x0621)) || 
+                                       (array_key_exists($str_next, $p_chars) && array_key_exists($str_back, $p_chars)) || 
+                                       ($str1 == " " && array_key_exists($str_back, $p_chars)) || ($str1 == " " && 
+                                       array_key_exists($str_next, $p_chars)))
+                               {
+                                       if ($e_output)
+                                       {
+                                               $output = $e_output.$output;
+                                               $e_output = "";
+                                       }
+                                       $output = $str1.$output;
+                               }
+                               else
+                               {
+                                       $e_output .= $str1;
+                                       if (array_key_exists($str_next, $p_chars) || $str_next == "")
+                                       {
+                                               $output = $e_output.$output;
+                                               $e_output = "";
+                                       }
+                               }
+                       }
+               }
+               else
+                       $output = $str1.$output;
+               $str_next = null;
+               $str_back = null;
+       }
+       return  $output;
+}
+
+?>
index 5bda35c6c171c471aaffec419675abf38eada389..c783c915f44545e397ee514dfd578412727eadd9 100644 (file)
                }
                $this->LineTo($right, $iline2 ,$right, $iline4);
                $this->LineTo($this->leftMargin, $iline5 ,$this->leftMargin, $iline7);
-               $this->LineTo($this->cols[$cols - 2] + 4, $iline5 ,$this->cols[$cols - 2] + 4, $iline7);
+               if ($this->l['a_meta_dir'] == 'rtl') // avoid line overwrite in rtl language
+                       $this->LineTo($this->cols[$cols - 2], $iline5 ,$this->cols[$cols - 2], $iline7);
+               else    
+                       $this->LineTo($this->cols[$cols - 2] + 4, $iline5 ,$this->cols[$cols - 2] + 4, $iline7);
                $this->LineTo($right, $iline5 ,$right, $iline7);
 
                // Company Logo
index 1ecad710f053238c35af49248154a976780ae129..27d5f36bcfdd7e03278afea7066d5a1ac41f1369 100644 (file)
@@ -332,8 +332,17 @@ function html_entity_decode_php4($text_to_convert) {
                "&lt;" => "<"
        );
        $return_text = strtr($text_to_convert, $htmlentities_table);
-       $return_text = preg_replace('~&#x([0-9a-f]+);~ei', 'code_to_utf8(hexdec("\\1"))', $return_text);
-       $return_text = preg_replace('~&#([0-9]+);~e', 'code_to_utf8(\\1)', $return_text);
+       
+       if (version_compare(PHP_VERSION, '5.3.0') >= 0) // 07.11.2014, from php 5.3.0 fixed deprecated preg_replace with the /e flag. Joe. 
+       {
+               $return_text = preg_replace_callback('~&#x([0-9a-f]+);~i', function ($m){ return chr(hexdec($m[1]));}, $return_text);
+               $return_text = preg_replace_callback('~&#([0-9]+);~', function ($m){ return chr($m[1]);}, $return_text);
+       }
+       else
+       {
+               $return_text = preg_replace('~&#x([0-9a-f]+);~ei', 'code_to_utf8(hexdec("\\1"))', $return_text);
+               $return_text = preg_replace('~&#([0-9]+);~e', 'code_to_utf8(\\1)', $return_text);
+       }
        return $return_text;
 }
 
index fdb8a17561e50956ca7e81c38f3cf5e773b0898b..d9076691cc04b0059c9dfb09968fa4ed2e31c15a 100644 (file)
@@ -137,6 +137,9 @@ class BoxReports
                                if ($ctrl) break;
                        }
                        if ($ctrl == '') {
+                               if (($id == 102 || $id == 202) && $cnt == 3) // set default Show Also Allocated to Yes in aged reports 2014-09-19 Joe Hunt
+                                       $_POST['PARAM_'.$cnt] = 1;
+                               
                                if (isset($_COOKIE['select'][$id][$cnt])) // saved parameters 2010-10-06 Joe Hunt
                                        $_POST['PARAM_'.$cnt] = $_COOKIE['select'][$id][$cnt];
                                $ctrl = $this->get_ctrl('PARAM_'.$cnt, $type);
@@ -380,6 +383,9 @@ class BoxReports
                                case 'ITEMS':
                                        return stock_manufactured_items_list($name);
 
+                               case 'ITEMS_ALL':
+                                       return stock_manufactured_items_list($name, null, true);
+
                                case 'ITEMS_P':
                                        return stock_purchasable_items_list($name, null, true);
                                
index 74b355d8dc81cfbe667126fb70ab4cf3fb614dc3..3584a0259ecf13cc398a66d344dffea56a2bbfdb 100644 (file)
@@ -142,7 +142,6 @@ function print_customer_balances()
                $sql .= "WHERE debtor_no=".db_escape($fromcust);
        $sql .= " ORDER BY name";
        $result = db_query($sql, "The customers could not be retrieved");
-       $num_lines = 0;
 
        while ($myrow = db_fetch($result))
        {
@@ -166,7 +165,6 @@ function print_customer_balances()
                $res = get_transactions($myrow['debtor_no'], $from, $to);
                if ($no_zeros && db_num_rows($res) == 0) continue;
 
-               $num_lines++;
                $rep->fontSize += 2;
                $rep->TextCol(0, 2, $myrow['name']);
                if ($convert)
@@ -184,9 +182,11 @@ function print_customer_balances()
                        $grandtotal[$i] += $init[$i];
                }
                $rep->NewLine(1, 2);
-               if (db_num_rows($res)==0)
-                       continue;
                $rep->Line($rep->row + 4);
+               if (db_num_rows($res)==0) {
+                       $rep->NewLine(1, 2);
+                       continue;
+               }
                while ($trans = db_fetch($res))
                {
                        if ($no_zeros && floatcmp($trans['TotalAmount'], $trans['Allocated']) == 0) continue;
index a9fa659f2f3cd78e434ecb57deeb9fe924be186a..4287a4de03ed29136426ca17fd6493d5bd2f73ab 100644 (file)
@@ -31,7 +31,7 @@ print_sales_quotations();
 
 function print_sales_quotations()
 {
-       global $path_to_root, $print_as_quote, $print_invoice_no, $no_zero_lines_amount;
+       global $path_to_root, $print_as_quote, $print_invoice_no, $no_zero_lines_amount, $print_item_images_on_quote, $pic_height;
 
        include_once($path_to_root . "/reporting/includes/pdf_report.inc");
 
@@ -47,6 +47,10 @@ function print_sales_quotations()
        $orientation = ($orientation ? 'L' : 'P');
        $dec = user_price_dec();
 
+       $pictures = (isset($print_item_images_on_quote) && $print_item_images_on_quote==1);
+       // If you want a larger image, then increase $pic_height f.i.
+       // $pic_height += 25;
+       
        $cols = array(4, 60, 225, 300, 325, 385, 450, 515);
 
        // $headers in doctext.inc
@@ -116,6 +120,20 @@ function print_sales_quotations()
                                $rep->TextCol(6, 7,     $DisplayNet, -2);
                        }
                        $rep->row = $newrow;
+                       
+                       if ($pictures)
+                       {
+                               $image = company_path(). "/images/" . item_img_name($myrow2['stk_code']) . ".jpg";
+                               if (file_exists($image))
+                               {
+                                       //$rep->NewLine();
+                                       if ($rep->row - $pic_height < $rep->bottomMargin)
+                                               $rep->NewPage();
+                                       $rep->AddImage($image, $rep->cols[1], $rep->row - $pic_height, 0, $pic_height);
+                                       $rep->row -= $pic_height;
+                                       $rep->NewLine();
+                               }
+                       }
                        //$rep->NewLine(1);
                        if ($rep->row < $rep->bottomMargin + (15 * $rep->lineHeight))
                                $rep->NewPage();
index 6fc122ddb88353807a753806c344e9f088153483..3a1288ac5dd894e71fd0624892a22185813c9122 100644 (file)
@@ -142,24 +142,19 @@ function print_supplier_balances()
                if (!$convert && $currency != $myrow['curr_code'])
                        continue;
                $accumulate = 0;
+               $rate = $convert ? get_exchange_rate_from_home_currency($myrow['curr_code'], Today()) : 1;
                $bal = get_open_balance($myrow['supplier_id'], $from);
                $init[0] = $init[1] = 0.0;
-               $init[0] = round2(abs($bal['charges']), $dec);
-               $init[1] = round2(Abs($bal['credits']), $dec);
-               $init[2] = round2($bal['Allocated'], $dec);
+               $init[0] = round2(abs($bal['charges']*$rate), $dec);
+               $init[1] = round2(Abs($bal['credits']*$rate), $dec);
+               $init[2] = round2($bal['Allocated']*$rate, $dec);
                if ($show_balance)
                {
                        $init[3] = $init[0] - $init[1];
                        $accumulate += $init[3];
                }       
                else    
-                       $init[3] = round2($bal['OutStanding'], $dec);
-               $total = array(0,0,0,0);
-               for ($i = 0; $i < 4; $i++)
-               {
-                       $total[$i] += $init[$i];
-                       $grandtotal[$i] += $init[$i];
-               }
+                       $init[3] = round2($bal['OutStanding']*$rate, $dec);
                $res = getTransactions($myrow['supplier_id'], $from, $to);
                if ($no_zeros && db_num_rows($res) == 0) continue;
 
@@ -172,15 +167,21 @@ function print_supplier_balances()
                $rep->AmountCol(5, 6, $init[1], $dec);
                $rep->AmountCol(6, 7, $init[2], $dec);
                $rep->AmountCol(7, 8, $init[3], $dec);
+               $total = array(0,0,0,0);
+               for ($i = 0; $i < 4; $i++)
+               {
+                       $total[$i] += $init[$i];
+                       $grandtotal[$i] += $init[$i];
+               }
                $rep->NewLine(1, 2);
-               if (db_num_rows($res)==0) continue;
-
                $rep->Line($rep->row + 4);
+               if (db_num_rows($res)==0) {
+                       $rep->NewLine(1, 2);
+                       continue;
+               }       
                while ($trans=db_fetch($res))
                {
                        if ($no_zeros && floatcmp(abs($trans['TotalAmount']), $trans['Allocated']) == 0) continue;
-                       $rate = $convert ? get_exchange_rate_from_home_currency($myrow['curr_code'], Today()) : 1;
-
                        $rep->NewLine(1, 2);
                        $rep->TextCol(0, 1, $systypes_array[$trans['type']]);
                        $rep->TextCol(1, 2,     $trans['reference']);
index 5ad1735cb31cb5d2630ca1a0207ce6b4d79a775f..9d2b83bae24da5a40723db8748892bbb91f142ae 100644 (file)
@@ -28,19 +28,84 @@ include_once($path_to_root . "/inventory/includes/db/items_category_db.inc");
 
 print_inventory_valuation_report();
 
+function get_domestic_price($myrow, $stock_id, $qty, $old_std_cost, $old_qty)
+{
+       if ($myrow['type'] == ST_SUPPRECEIVE || $myrow['type'] == ST_SUPPCREDIT)
+       {
+               $price = $myrow['price'];
+               if ($myrow['type'] == ST_SUPPRECEIVE)
+               {
+                       // Has the supplier invoice increased the receival price?
+                       $sql = "SELECT DISTINCT act_price FROM ".TB_PREF."purch_order_details pod INNER JOIN ".TB_PREF."grn_batch grn ON pod.order_no =
+                               grn.purch_order_no WHERE grn.id = ".$myrow['trans_no']." AND pod.item_code = '$stock_id'";
+                       $result = db_query($sql, "Could not retrieve act_price from purch_order_details");
+                       $row = db_fetch_row($result);
+                       if ($row[0] > 0 AND $row[0] <> $myrow['price'])
+                               $price = $row[0];
+               }
+               if ($myrow['person_id'] > 0)
+               {
+                       // Do we have foreign currency?
+                       $supp = get_supplier($myrow['person_id']);
+                       $currency = $supp['curr_code'];
+                       $ex_rate = get_exchange_rate_to_home_currency($currency, sql2date($myrow['tran_date']));
+                       $price /= $ex_rate;
+               }       
+       }
+       elseif ($myrow['type'] != ST_INVADJUST) // calcutale the price from avg. price
+               $price = ($myrow['standard_cost'] * $qty - $old_std_cost * $old_qty) / $myrow['qty'];
+       else
+               $price = $myrow['standard_cost']; // Item Adjustments just have the real cost
+       return $price;
+}      
+
+function getAverageCost($stock_id, $to_date)
+{
+       if ($to_date == null)
+               $to_date = Today();
+
+       $to_date = date2sql($to_date);
+
+       $sql = "SELECT standard_cost, price, tran_date, type, trans_no, qty, person_id FROM ".TB_PREF."stock_moves
+               WHERE stock_id=".db_escape($stock_id)."
+               AND tran_date <= '$to_date' AND standard_cost > 0.001 AND qty <> 0 AND type <> ".ST_LOCTRANSFER;
+
+       $sql .= " ORDER BY tran_date";  
+
+       $result = db_query($sql, "No standard cost transactions were returned");
+    if ($result == false)
+       return 0;
+       $qty = $old_qty = $count = $old_std_cost = $tot_cost = 0;
+       while ($row=db_fetch($result))
+       {
+               $qty += $row['qty'];    
+
+               $price = get_domestic_price($row, $stock_id, $qty, $old_std_cost, $old_qty);
+
+               $old_std_cost = $row['standard_cost'];
+               $tot_cost += $price;
+               $count++;
+               $old_qty = $qty;
+       }
+       if ($count == 0)
+               return 0;
+       return $tot_cost / $count;
+}
+    
 function getTransactions($category, $location, $date)
 {
        $date = date2sql($date);
+       
        $sql = "SELECT ".TB_PREF."stock_master.category_id,
                        ".TB_PREF."stock_category.description AS cat_description,
                        ".TB_PREF."stock_master.stock_id,
                        ".TB_PREF."stock_master.units,
                        ".TB_PREF."stock_master.description, ".TB_PREF."stock_master.inactive,
                        ".TB_PREF."stock_moves.loc_code,
-                       SUM(".TB_PREF."stock_moves.qty) AS QtyOnHand,
+                       SUM(".TB_PREF."stock_moves.qty) AS QtyOnHand, 
                        ".TB_PREF."stock_master.material_cost + ".TB_PREF."stock_master.labour_cost + ".TB_PREF."stock_master.overhead_cost AS UnitCost,
-                       SUM(".TB_PREF."stock_moves.qty) *(".TB_PREF."stock_master.material_cost + ".TB_PREF."stock_master.labour_cost + ".TB_PREF."stock_master.overhead_cost) AS ItemTotal
-               FROM ".TB_PREF."stock_master,
+                       SUM(".TB_PREF."stock_moves.qty) *(".TB_PREF."stock_master.material_cost + ".TB_PREF."stock_master.labour_cost + ".TB_PREF."stock_master.overhead_cost) AS ItemTotal 
+                       FROM ".TB_PREF."stock_master,
                        ".TB_PREF."stock_category,
                        ".TB_PREF."stock_moves
                WHERE ".TB_PREF."stock_master.stock_id=".TB_PREF."stock_moves.stock_id
@@ -51,8 +116,7 @@ function getTransactions($category, $location, $date)
                        ".TB_PREF."stock_category.description, ";
                if ($location != 'all')
                        $sql .= TB_PREF."stock_moves.loc_code, ";
-               $sql .= "UnitCost,
-                       ".TB_PREF."stock_master.stock_id,
+               $sql .= TB_PREF."stock_master.stock_id,
                        ".TB_PREF."stock_master.description
                HAVING SUM(".TB_PREF."stock_moves.qty) != 0";
                if ($category != 0)
@@ -69,7 +133,7 @@ function getTransactions($category, $location, $date)
 
 function print_inventory_valuation_report()
 {
-    global $path_to_root;
+    global $path_to_root, $use_costed_values;;
 
        $date = $_POST['PARAM_0'];
     $category = $_POST['PARAM_1'];
@@ -147,6 +211,16 @@ function print_inventory_valuation_report()
                        if ($detail)
                                $rep->NewLine();
                }
+               if (isset($use_costed_values) && $use_costed_values==1)
+               {
+                       $UnitCost = getAverageCost($trans['stock_id'], $date);
+                       $ItemTotal = $trans['QtyOnHand'] * $UnitCost;
+               }       
+               else
+               {
+                       $UnitCost = $trans['UnitCost'];
+                       $ItemTotal = $trans['ItemTotal'];
+               }       
                if ($detail)
                {
                        $rep->NewLine();
@@ -155,14 +229,15 @@ function print_inventory_valuation_report()
                        $rep->TextCol(1, 2, $trans['description'].($trans['inactive']==1 ? " ("._("Inactive").")" : ""), -1);
                        $rep->TextCol(2, 3, $trans['units']);
                        $rep->AmountCol(3, 4, $trans['QtyOnHand'], get_qty_dec($trans['stock_id']));
+                       
                        $dec2 = 0;
-                       price_decimal_format($trans['UnitCost'], $dec2);
-                       $rep->AmountCol(4, 5, $trans['UnitCost'], $dec2);
-                       $rep->AmountCol(5, 6, $trans['ItemTotal'], $dec);
+                       price_decimal_format($UnitCost, $dec2);
+                       $rep->AmountCol(4, 5, $UnitCost, $dec2);
+                       $rep->AmountCol(5, 6, $ItemTotal, $dec);
                        $rep->fontSize += 2;
                }
-               $total += $trans['ItemTotal'];
-               $grandtotal += $trans['ItemTotal'];
+               $total += $ItemTotal;
+               $grandtotal += $ItemTotal;
        }
        if ($detail)
        {
index f7e18907502b83886f2b9c232f50debd162a8af7..0631e46dba74f0a1535d9a7e45dfa31718831eac 100644 (file)
@@ -12,7 +12,7 @@
 $page_security = 'SA_ITEMSVALREP';
 // ----------------------------------------------------------------
 // $ Revision: 2.0 $
-// Creator:    Jujuk
+// Creator:    Jujuk, Joe Hunt
 // date_:      2011-05-24
 // Title:      Stock Movements
 // ----------------------------------------------------------------
@@ -30,11 +30,41 @@ include_once($path_to_root . "/inventory/includes/inventory_db.inc");
 
 inventory_movements();
 
+function get_domestic_price($myrow, $stock_id, $qty, $old_std_cost, $old_qty)
+{
+       if ($myrow['type'] == ST_SUPPRECEIVE || $myrow['type'] == ST_SUPPCREDIT)
+       {
+               $price = $myrow['price'];
+               if ($myrow['type'] == ST_SUPPRECEIVE)
+               {
+                       // Has the supplier invoice increased the receival price?
+                       $sql = "SELECT DISTINCT act_price FROM ".TB_PREF."purch_order_details pod INNER JOIN ".TB_PREF."grn_batch grn ON pod.order_no =
+                               grn.purch_order_no WHERE grn.id = ".$myrow['trans_no']." AND pod.item_code = '$stock_id'";
+                       $result = db_query($sql, "Could not retrieve act_price from purch_order_details");
+                       $row = db_fetch_row($result);
+                       if ($row[0] > 0 AND $row[0] <> $myrow['price'])
+                               $price = $row[0];
+               }
+               if ($myrow['person_id'] > 0)
+               {
+                       // Do we have foreign currency?
+                       $supp = get_supplier($myrow['person_id']);
+                       $currency = $supp['curr_code'];
+                       $ex_rate = get_exchange_rate_to_home_currency($currency, sql2date($myrow['tran_date']));
+                       $price /= $ex_rate;
+               }       
+       }
+       elseif ($myrow['type'] != ST_INVADJUST) // calcutale the price from avg. price
+               $price = ($myrow['standard_cost'] * $qty - $old_std_cost * $old_qty) / $myrow['qty'];
+       else
+               $price = $myrow['standard_cost']; // Item Adjustments just have the real cost
+       return $price;
+}      
+
 function fetch_items($category=0)
 {
                $sql = "SELECT stock_id, stock.description AS name,
-                               stock.category_id,
-                               units,material_cost,
+                               stock.category_id,units,
                                cat.description
                        FROM ".TB_PREF."stock_master stock LEFT JOIN ".TB_PREF."stock_category cat ON stock.category_id=cat.category_id
                                WHERE mb_flag <> 'D'";
@@ -60,7 +90,7 @@ function trans_qty($stock_id, $location=null, $from_date, $to_date, $inward = tr
        $sql = "SELECT ".($inward ? '' : '-')."SUM(qty) FROM ".TB_PREF."stock_moves
                WHERE stock_id=".db_escape($stock_id)."
                AND tran_date >= '$from_date' 
-               AND tran_date <= '$to_date'";
+               AND tran_date <= '$to_date' AND type <> ".ST_LOCTRANSFER;
 
        if ($location != '')
                $sql .= " AND loc_code = ".db_escape($location);
@@ -78,6 +108,41 @@ function trans_qty($stock_id, $location=null, $from_date, $to_date, $inward = tr
 
 }
 
+function avg_unit_cost($stock_id, $location=null, $to_date)
+{
+       if ($to_date == null)
+               $to_date = Today();
+
+       $to_date = date2sql($to_date);
+
+       $sql = "SELECT standard_cost, price, tran_date, type, trans_no, qty, person_id  FROM ".TB_PREF."stock_moves
+               WHERE stock_id=".db_escape($stock_id)."
+               AND tran_date < '$to_date' AND standard_cost > 0.001 AND qty <> 0 AND type <> ".ST_LOCTRANSFER;
+
+       if ($location != '')
+               $sql .= " AND loc_code = ".db_escape($location);
+       $sql .= " ORDER BY tran_date";  
+
+       $result = db_query($sql, "No standard cost transactions were returned");
+    if ($result == false)
+       return 0;
+       $qty = $old_qty = $count = $old_std_cost = $tot_cost = 0;
+       while ($row=db_fetch($result))
+       {
+               $qty += $row['qty'];    
+
+               $price = get_domestic_price($row, $stock_id, $qty, $old_std_cost, $old_qty);
+       
+               $old_std_cost = $row['standard_cost'];
+               $tot_cost += $price;
+               $count++;
+               $old_qty = $qty;
+       }
+       if ($count == 0)
+               return 0;
+       return $tot_cost / $count;
+}
+
 //----------------------------------------------------------------------------------------------------
 
 function trans_qty_unit_cost($stock_id, $location=null, $from_date, $to_date, $inward = true)
@@ -92,10 +157,9 @@ function trans_qty_unit_cost($stock_id, $location=null, $from_date, $to_date, $i
 
        $to_date = date2sql($to_date);
 
-       $sql = "SELECT AVG (price)   FROM ".TB_PREF."stock_moves
+       $sql = "SELECT standard_cost, price, tran_date, type, trans_no, qty, person_id FROM ".TB_PREF."stock_moves
                WHERE stock_id=".db_escape($stock_id)."
-               AND tran_date >= '$from_date' 
-               AND tran_date <= '$to_date'";
+               AND tran_date <= '$to_date' AND standard_cost > 0.001 AND qty <> 0 AND type <> ".ST_LOCTRANSFER;
 
        if ($location != '')
                $sql .= " AND loc_code = ".db_escape($location);
@@ -104,12 +168,29 @@ function trans_qty_unit_cost($stock_id, $location=null, $from_date, $to_date, $i
                $sql .= " AND qty > 0 ";
        else
                $sql .= " AND qty < 0 ";
+       $sql .= " ORDER BY tran_date";
+       $result = db_query($sql, "No standard cost transactions were returned");
+    if ($result == false)
+       return 0;
+       $qty = $count = $old_qty = $old_std_cost = $tot_cost = 0;
+       while ($row=db_fetch($result))
+       {
+               $qty += $row['qty'];
 
-       $result = db_query($sql, "QOH calculation failed");
-
-       $myrow = db_fetch_row($result); 
-
-       return $myrow[0];
+               $price = get_domestic_price($row, $stock_id, $qty, $old_std_cost, $old_qty);
+       
+               if (strncmp($row['tran_date'], $from_date,10) >= 0)
+               {
+                       $tot_cost += $price;
+                       $count++;
+               }
+               
+               $old_std_cost = $row['standard_cost'];
+               $old_qty = $qty;
+       }       
+       if ($count == 0)
+               return 0;
+       return $tot_cost / $count;
 
 }
 
@@ -144,7 +225,7 @@ function inventory_movements()
        else
                $loc = get_location_name($location);
 
-       $cols = array(0, 60, 130, 160, 185, 210, 250, 275, 300, 340, 365, 390, 430, 455, 480, 520);
+       $cols = array(0, 60, 130, 160, 185, 215, 250, 275, 305, 340, 365, 395, 430, 455, 485, 520);
 
        $headers = array(_('Category'), _('Description'),       _('UOM'), '', '', _('OpeningStock'), '', '',_('StockIn'), '', '', _('Delivery'), '', '', _('ClosingStock'));
        $headers2 = array("", "", "", _("QTY"), _("Rate"), _("Value"), _("QTY"), _("Rate"), _("Value"), _("QTY"), _("Rate"), _("Value"), _("QTY"), _("Rate"), _("Value"));
@@ -164,8 +245,10 @@ function inventory_movements()
     $rep->Info($params, $cols, $headers2, $aligns, $cols, $headers, $aligns);
     $rep->NewPage();
 
+       $totval_open = $totval_in = $totval_out = $totval_close = 0; 
        $result = fetch_items($category);
 
+       $dec = user_price_dec();
        $catgor = '';
        while ($myrow=db_fetch($result))
        {
@@ -178,47 +261,60 @@ function inventory_movements()
                        $rep->fontSize -= 2;
                        $rep->NewLine();
                }
+               $qoh_start = get_qoh_on_date($myrow['stock_id'], $location, add_days($from_date, -1));
+               $qoh_end = get_qoh_on_date($myrow['stock_id'], $location, $to_date);
+               
+               $inward = trans_qty($myrow['stock_id'], $location, $from_date, $to_date);
+               $outward = trans_qty($myrow['stock_id'], $location, $from_date, $to_date, false);
+               $openCost = avg_unit_cost($myrow['stock_id'], $location, $from_date);
+               $unitCost = avg_unit_cost($myrow['stock_id'], $location, add_days($to_date, 1));
+               if ($qoh_start == 0 && $inward == 0 && $outward == 0 && $qoh_end == 0)
+                       continue;
                $rep->NewLine();
                $rep->TextCol(0, 1,     $myrow['stock_id']);
                $rep->TextCol(1, 2, $myrow['name']);
                $rep->TextCol(2, 3, $myrow['units']);
-               $qoh_start= $inward = $outward = $qoh_end = 0; 
-               
-               $qoh_start += get_qoh_on_date($myrow['stock_id'], $location, add_days($from_date, -1));
-               $qoh_end += get_qoh_on_date($myrow['stock_id'], $location, $to_date);
-               
-               $inward += trans_qty($myrow['stock_id'], $location, $from_date, $to_date);
-               $outward += trans_qty($myrow['stock_id'], $location, $from_date, $to_date, false);
-               $unitCost=$myrow['material_cost'];
                $rep->AmountCol(3, 4, $qoh_start, get_qty_dec($myrow['stock_id']));
-//             $rep->AmountCol(4, 5, $unitCost, get_qty_dec($myrow['stock_id']));
-               $rep->AmountCol(4, 5, $myrow['material_cost']);
-               $rep->AmountCol(5, 6, $qoh_start*$unitCost, get_qty_dec($myrow['stock_id']));
+               $rep->AmountCol(4, 5, $openCost, $dec);
+               $openCost *= $qoh_start;
+               $totval_open += $openCost;
+               $rep->AmountCol(5, 6, $openCost);
                
                if($inward>0){
                        $rep->AmountCol(6, 7, $inward, get_qty_dec($myrow['stock_id']));
-                       $unitCost_IN=   trans_qty_unit_cost($myrow['stock_id'], $location, $from_date, $to_date);
-                       $rep->AmountCol(7, 8, $unitCost_IN,get_qty_dec($myrow['stock_id']));
-                       $rep->AmountCol(8, 9, $inward*$unitCost_IN, get_qty_dec($myrow['stock_id']));
+                       $unitCost_in = trans_qty_unit_cost($myrow['stock_id'], $location, $from_date, $to_date);
+                       $rep->AmountCol(7, 8, $unitCost_in,$dec);
+                       $unitCost_in *= $inward;
+                       $totval_in += $unitCost_in;
+                       $rep->AmountCol(8, 9, $unitCost_in);
                }
                
                if($outward>0){
                        $rep->AmountCol(9, 10, $outward, get_qty_dec($myrow['stock_id']));
-               
-                       $unitCost_out=  trans_qty_unit_cost($myrow['stock_id'], $location, $from_date, $to_date, false);
-                       $rep->AmountCol(10, 11, $unitCost_out,get_qty_dec($myrow['stock_id']));
-                       $rep->AmountCol(11, 12, $outward*$unitCost_out, get_qty_dec($myrow['stock_id']));
+                       $unitCost_out = trans_qty_unit_cost($myrow['stock_id'], $location, $from_date, $to_date, false);
+                       $rep->AmountCol(10, 11, $unitCost_out,$dec);
+                       $unitCost_out *= $outward;
+                       $totval_out += $unitCost_out;
+                       $rep->AmountCol(11, 12, $unitCost_out);
                }
                
                $rep->AmountCol(12, 13, $qoh_end, get_qty_dec($myrow['stock_id']));
-               $rep->AmountCol(13, 14, $myrow['material_cost'],get_qty_dec($myrow['stock_id']));
-               $rep->AmountCol(14, 15, $qoh_end*$unitCost, get_qty_dec($myrow['stock_id']));
+               $rep->AmountCol(13, 14, $unitCost,$dec);
+               $unitCost *= $qoh_end;
+               $totval_close += $unitCost;
+               $rep->AmountCol(14, 15, $unitCost);
                
                $rep->NewLine(0, 1);
        }
        $rep->Line($rep->row  - 4);
+       $rep->NewLine(2);
+       $rep->TextCol(0, 1,     _("Total"));
+       $rep->AmountCol(5, 6, $totval_open);
+       $rep->AmountCol(8, 9, $totval_in);
+       $rep->AmountCol(11, 12, $totval_out);
+       $rep->AmountCol(14, 15, $totval_close);
+       $rep->Line($rep->row  - 4);
 
-       $rep->NewLine();
     $rep->End();
 }
 
diff --git a/reporting/rep402.php b/reporting/rep402.php
new file mode 100644 (file)
index 0000000..6b02112
--- /dev/null
@@ -0,0 +1,141 @@
+<?php
+/**********************************************************************
+    Copyright (C) FrontAccounting, LLC.
+       Released under the terms of the GNU General Public License, GPL, 
+       as published by the Free Software Foundation, either version 3 
+       of the License, or (at your option) any later version.
+    This program is distributed in the hope that it will be useful,
+    but WITHOUT ANY WARRANTY; without even the implied warranty of
+    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  
+    See the License here <http://www.gnu.org/licenses/gpl-3.0.html>.
+***********************************************************************/
+$page_security = 'SA_BOMREP';
+// ----------------------------------------------------------------
+// $ Revision: 2.0 $
+// Creator:    Joe Hunt
+// date_:      2005-05-19
+// Title:      Work Order Listing
+// ----------------------------------------------------------------
+$path_to_root="..";
+
+include_once($path_to_root . "/includes/session.inc");
+include_once($path_to_root . "/includes/date_functions.inc");
+include_once($path_to_root . "/includes/data_checks.inc");
+include_once($path_to_root . "/includes/banking.inc");
+include_once($path_to_root . "/gl/includes/gl_db.inc");
+include_once($path_to_root . "/inventory/includes/db/items_category_db.inc");
+
+//----------------------------------------------------------------------------------------------------
+
+print_work_order_listing();
+
+function getTransactions($items, $open_only, $location)
+{
+       $sql = "SELECT
+               workorder.id,
+               workorder.wo_ref,
+               workorder.type,
+               location.location_name,
+               item.description,
+               workorder.units_reqd,
+               workorder.units_issued,
+               workorder.date_,
+               workorder.required_by,
+               workorder.closed,
+               workorder.stock_id
+               FROM ".TB_PREF."workorders as workorder,"
+                       .TB_PREF."stock_master as item,"
+                       .TB_PREF."locations as location
+               WHERE workorder.stock_id=item.stock_id 
+                       AND workorder.loc_code=location.loc_code";
+
+       if ($open_only != 0)
+               $sql .= " AND workorder.closed=0";
+
+       if ($location != '')
+               $sql .= " AND workorder.loc_code=".db_escape($location);
+
+       if ($items != '')
+               $sql .= " AND workorder.stock_id=".db_escape($items);
+       
+       $sql .=" ORDER BY workorder.id";        
+
+    return db_query($sql,"No transactions were returned");
+
+}
+
+//----------------------------------------------------------------------------------------------------
+
+function print_work_order_listing()
+{
+    global $path_to_root, $wo_types_array;
+
+    $item = $_POST['PARAM_0'];
+    $location = $_POST['PARAM_1'];
+    $open_only = $_POST['PARAM_2'];
+       $comments = $_POST['PARAM_3'];
+       $orientation = $_POST['PARAM_4'];
+       $destination = $_POST['PARAM_5'];
+       if ($destination)
+               include_once($path_to_root . "/reporting/includes/excel_report.inc");
+       else
+               include_once($path_to_root . "/reporting/includes/pdf_report.inc");
+
+       $orientation = ($orientation ? 'L' : 'P');
+
+       if ($item == '')
+               $items = _('All');
+       else
+       {
+               $row = get_item($item);
+               $items = $row['description']; 
+       }
+
+       if ($location == '')
+               $loc = _('All');
+       else
+               $loc = get_location_name($location);
+
+       $open = $open_only == 1 ? _('Yes') : _('No');
+       
+       $cols = array(0, 100, 120, 165, 210, 275, 315, 375, 385, 440, 495, 555);
+
+       $headers = array(_('Type'), '#', ('Reference'), _('Location'), _('Item'), _('Required'), _('Manufactured'), ' ', _('Date'), _('Required By'), _('Closed'));
+
+       $aligns = array('left', 'left', 'left', 'left', 'left', 'right', 'right', 'left', 'left', 'left', 'left');
+
+    $params =   array(         0 => $comments,
+                                   1 => array('text' => _('Items'), 'from' => $items, 'to' => ''),
+                                   2 => array('text' => _('Location'), 'from' => $loc, 'to' => ''),
+                                   3 => array('text' => _('Open Only'), 'from' => $open, 'to' => ''));
+
+    $rep = new FrontReport(_('Work Order Listing'), "WorkOrderListing", user_pagesize(), 9, $orientation);
+       if ($orientation == 'L')
+       recalculate_cols($cols);
+
+    $rep->Font();
+    $rep->Info($params, $cols, $headers, $aligns);
+    $rep->NewPage();
+
+       $res = getTransactions($item, $open_only, $location);
+       while ($trans=db_fetch($res))
+       {
+               $rep->TextCol(0, 1, $wo_types_array[$trans['type']]);
+               $rep->TextCol(1, 2, $trans['id'], -1);
+               $rep->TextCol(2, 3, $trans['wo_ref'], -1);
+               $rep->TextCol(3, 4, $trans['location_name'], -1);
+               $rep->TextCol(4, 5, $trans['description'], -1);
+               $dec = get_qty_dec($trans['stock_id']);
+               $rep->AmountCol(5, 6, $trans['units_reqd'], $dec);
+               $rep->AmountCol(6, 7, $trans['units_issued'], $dec);
+               $rep->TextCol(7, 8, '', -1);
+               $rep->TextCol(8, 9, sql2date($trans['date_']), -1);
+               $rep->TextCol(9, 10, sql2date($trans['required_by']), -1);
+               $rep->TextCol(10, 11, $trans['closed'] ? ' ' : _('No'), -1);
+               $rep->NewLine();
+       }
+       $rep->Line($rep->row);
+    $rep->End();
+}
+
+?>
\ No newline at end of file
index 1ffa5f089fe129e9514e6c553df8280ef4c8d1a9..28b75c0f1b141f63dbcb74e1b75305f11a4d38a1 100644 (file)
@@ -35,11 +35,16 @@ function getTaxTransactions($from, $to)
 
        $sql = "SELECT tt.name as taxname, taxrec.*, taxrec.amount*ex_rate AS amount,
                    taxrec.net_amount*ex_rate AS net_amount,
-                               IF(ISNULL(supp.supp_name), debt.name, supp.supp_name) as name,
+                               IF(taxrec.trans_type=".ST_BANKPAYMENT." OR taxrec.trans_type=".ST_BANKDEPOSIT.", 
+                                       IF(gl.person_type_id<>".PT_MISC.", gl.memo_, gl.person_id), 
+                                       IF(ISNULL(supp.supp_name), debt.name, supp.supp_name)) as name,
                                branch.br_name
                FROM ".TB_PREF."trans_tax_details taxrec
                LEFT JOIN ".TB_PREF."tax_types tt
                        ON taxrec.tax_type_id=tt.id
+               LEFT JOIN ".TB_PREF."gl_trans gl 
+                       ON taxrec.trans_type=gl.type AND taxrec.trans_no=gl.type_no AND 
+                       (tt.purchasing_gl_code=gl.account OR tt.sales_gl_code=gl.account)
                LEFT JOIN ".TB_PREF."supp_trans strans
                        ON taxrec.trans_no=strans.trans_no AND taxrec.trans_type=strans.type
                LEFT JOIN ".TB_PREF."suppliers as supp ON strans.supplier_id=supp.supplier_id
index 9a1c5d14dd91afb3d96f95e6f8c3ec276f8ebbf5..039eb3b8bb90278ca9388ef35e5ea060f729fe99 100644 (file)
@@ -285,6 +285,13 @@ $reports->addReport(RC_MANUFACTURE, 401, _('&Bill of Material Listing'),
                        _('Comments') => 'TEXTBOX',
                        _('Orientation') => 'ORIENTATION',
                        _('Destination') => 'DESTINATION'));
+$reports->addReport(RC_MANUFACTURE, 402, _('Work Order &Listing'),
+       array(  _('Items') => 'ITEMS_ALL',
+                       _('Location') => 'LOCATIONS',
+                       _('Outstanding Only') => 'YES_NO',
+                       _('Comments') => 'TEXTBOX',
+                       _('Orientation') => 'ORIENTATION',
+                       _('Destination') => 'DESTINATION'));
 $reports->addReport(RC_MANUFACTURE, 409, _('Print &Work Orders'),
        array(  _('From') => 'WORKORDER',
                        _('To') => 'WORKORDER',
index 41e3726b48a1a3f86b327f12fb31467ca426aa2d..f92538020e8cf61c06d3a928a24af7877f657bcf 100644 (file)
@@ -153,7 +153,7 @@ if (isset($_GET['OrderNumber']) && $_GET['OrderNumber'] > 0) {
 
 function check_data()
 {
-       global $Refs;
+       global $Refs, $SysPrefs;
 
        if (!isset($_POST['DispatchDate']) || !is_date($_POST['DispatchDate'])) {
                display_error(_("The entered date of delivery is invalid."));
@@ -199,6 +199,14 @@ function check_data()
                return false;
        }
 
+       copy_to_cart();
+
+       if (!$SysPrefs->allow_negative_stock() && ($low_stock = $_SESSION['Items']->check_qoh()))
+       {
+               display_error(_("This document cannot be processed because there is insufficient quantity for: ").implode(',', $low_stock));
+               return false;
+       }
+
        return true;
 }
 //------------------------------------------------------------------------------
@@ -248,7 +256,7 @@ function check_quantities()
                        $min = 0;
                        $max = $itm->quantity - $itm->qty_done;
                }
-               
+
                        if (check_num('Line'.$line, $min, $max)) {
                                $_SESSION['Items']->line_items[$line]->qty_dispatched =
                                  input_num('Line'.$line);
@@ -273,7 +281,7 @@ function check_quantities()
 }
 //------------------------------------------------------------------------------
 
-function check_qoh()
+if (isset($_POST['process_delivery']) && check_data())
 {
     global $SysPrefs;
     $dn = &$_SESSION['Items'];
@@ -316,9 +324,11 @@ if (isset($_POST['process_delivery']) && check_data() && check_qoh()) {
        }
        $newdelivery = ($dn->trans_no == 0);
 
-       copy_to_cart();
-       if ($newdelivery) new_doc_date($dn->document_date);
+       if ($newdelivery)
+               new_doc_date($dn->document_date);
+
        $delivery_no = $dn->write($bo_policy);
+
        if ($delivery_no == -1)
        {
                display_error(_("The entered reference is already in use."));
@@ -337,7 +347,7 @@ if (isset($_POST['process_delivery']) && check_data() && check_qoh()) {
        }
 }
 
-if (isset($_POST['Update']) || isset($_POST['_Location_update']) || isset($_POST['qty'])) {
+if (isset($_POST['Update']) || isset($_POST['_Location_update']) || isset($_POST['qty']) || isset($_POST['process_delivery'])) {
        $Ajax->activate('Items');
 }
 //------------------------------------------------------------------------------
@@ -465,16 +475,22 @@ foreach ($_SESSION['Items']->line_items as $line=>$ln_itm) {
                // quantity input box. This allows for example a hook to modify the default quantity to what's dispatchable
                // (if there is not enough in hand), check at other location or other order people etc ...
                // This hook also returns a 'reason' (css classes) which can be used to theme the row.
+               //
+               // FIXME: hook_get_dispatchable definition does not allow qoh checks on transaction level
+               // (but anyway dispatch is checked again later before transaction is saved)
+
+               $qty = $ln_itm->qty_dispatched;
+               if ($check = check_negative_stock($ln_itm->stock_id, $ln_itm->qty_done-$ln_itm->qty_dispatched, $_POST['Location'], $_POST['DispatchDate']))
+                       $qty = $check['qty'];
+
+               $q_class =  hook_get_dispatchable_quantity($ln_itm, $_POST['Location'], $_POST['DispatchDate'], $qty);
 
-               $qoh = get_qoh_on_date($ln_itm->stock_id, $_POST['Location'], $_POST['DispatchDate']);
-               $q_class =  hook_get_dispatchable_quantity($ln_itm, $_POST['Location'], $_POST['DispatchDate'], $qoh);
                // Skip line if needed
                if($q_class === 'skip')  continue;
                if(is_array($q_class)) {
                  list($ln_itm->qty_dispatched, $row_classes) = $q_class;
                        $has_marked = true;
                }
-
        }
 
        alt_table_row_color($k, $row_classes);
@@ -534,7 +550,7 @@ label_row(_("Amount Total"), $display_total, "colspan=$colspan align=right","ali
 end_table(1);
 
 if ($has_marked) {
-       display_note(_("Marked items have insufficient quantities in stock as on day of delivery."), 0, 1, "class='red'");
+       display_note(_("Marked items have insufficient quantities in stock as on day of delivery."), 0, 1, "class='stockmankofg'");
 }
 start_table(TABLESTYLE2);
 
index 60491f564b3202acbc4ba095236198337462d906..78f8309aaae42bb4debab6a444ec97d569c7e3f1 100644 (file)
@@ -558,6 +558,40 @@ class cart
                return $total;
        }
 
+       /*
+               Checks cart quantities on document_date.
+               Returns array of stock_ids which stock quantities would go negative on some day.
+       */
+       function check_qoh($date=null, $location=null)
+       {
+               $low_stock = array();
+               // check only for customer delivery and direct sales invoice 
+               if (!($this->trans_type == ST_CUSTDELIVERY || ($this->trans_type == ST_SALESINVOICE && $this->trans_no==0)))
+                       return $low_stock;
+
+               // collect quantities by stock_id
+               $qtys = array();
+               foreach ($this->line_items as $line_no => $line_item)
+               {
+                       if (has_stock_holding($line_item->mb_flag))
+                       {
+                               if (!$this->trans_no) // new delivery
+                                       $qtys[$line_item->stock_id]['qty'] = $line_item->qty_dispatched + @$qtys[$line_item->stock_id]['qty'];
+                               else    // DN modification: check change in quantity
+                                       $qtys[$line_item->stock_id]['qty'] = ($line_item->qty_dispatched-$line_item->qty_old) + @$qtys[$line_item->stock_id]['qty'];
+                               $qtys[$line_item->stock_id]['line'] = $line_no;
+                       }
+               }
+
+               foreach($qtys as $stock_id => $sum)
+               {
+                       if (check_negative_stock($stock_id, -$sum['qty'], $location ? $location : $this->Location, $date ? $date : $this->document_date))
+                               $low_stock[] = $stock_id;
+               }
+
+               return $low_stock;
+       }
+
        /*
                Returns true for documents issued in prepayment cycle.
        */
index 36697ced6f553f4a549b8860089aad5470df2184..b63ff123c5fb5ddbe1e9cf2e21caddda97c6b250 100644 (file)
@@ -365,7 +365,7 @@ function get_sql_for_customer_inquiry()
        return $sql;
 }
 
-function get_sql_for_sales_deliveries_view($selected_customer, $selected_stock_item=null)
+function get_sql_for_sales_deliveries_view($selected_customer, $selected_stock_item=null, $customer_id=ALL_TEXT)
 {
        $sql = "SELECT trans.trans_no,
                        debtor.name,
@@ -419,6 +419,9 @@ function get_sql_for_sales_deliveries_view($selected_customer, $selected_stock_i
 
                if (isset($_POST['StockLocation']) && $_POST['StockLocation'] != ALL_TEXT)
                        $sql .= " AND sorder.from_stk_loc = ".db_escape($_POST['StockLocation'])." ";
+               
+               if ($customer_id != ALL_TEXT)
+                       $sql .= " AND trans.debtor_no = ".db_escape($customer_id);              
 
                $sql .= " GROUP BY trans.trans_no ";
 
index ed3227379291e8227ba946bb3934624787c31dc9..faa2a3c8e2c2283b7be83a6ad7a0e7efba442fdf 100644 (file)
@@ -123,12 +123,14 @@ function get_customer_details_to_order(&$order, $customer_id, $branch_id)
        }
        elseif ($order->trans_type == ST_SALESORDER)
                $order->due_date = add_days($order->document_date, $SysPrefs->default_delivery_required_by());
+       elseif ($order->trans_type == ST_SALESQUOTE)
+               $order->due_date = add_days($order->document_date, $SysPrefs->default_quote_valid_days());
 
        if($order->payment_terms['cash_sale']) {
                $order->set_location($order->pos["pos_location"], $order->pos["location_name"]);
        } else
                $order->set_location($myrow["default_location"], $myrow["location_name"]);
-               
+
        return $ret_error;
 }
 
@@ -136,7 +138,6 @@ function get_customer_details_to_order(&$order, $customer_id, $branch_id)
 
 function display_order_summary($title, &$order, $editable_items=false)
 {
-       global $SysPrefs;
 
        display_heading($title);
 
@@ -159,8 +160,8 @@ function display_order_summary($title, &$order, $editable_items=false)
        $k = 0;  //row colour counter
 
        $id = find_submit('Edit');
-       $has_marked = false;
 
+       $low_stock = $order->check_qoh($_POST['OrderDate'], $_POST['Location']);
        foreach ($order->get_items() as $line_no=>$stock_item)
        {
 
@@ -170,23 +171,10 @@ function display_order_summary($title, &$order, $editable_items=false)
                $qoh_msg = '';
                if (!$editable_items || $id != $line_no)
                {
-                       if (!$SysPrefs->allow_negative_stock() && is_inventory_item($stock_item->stock_id) && 
-                               $order->trans_type != ST_SALESORDER && $order->trans_type!=ST_SALESQUOTE) {
-                               $qoh = get_qoh_on_date($stock_item->stock_id, 
-                                       $_POST['Location'], $_POST['delivery_date']);
-                               if (($stock_item->qty_dispatched -$stock_item->qty_done) > $qoh)
-                               {
-                                       // oops, we don't have enough of one of the component items
-                                       start_row("class='stockmankobg'");
-                                       $qoh_msg .= $stock_item->stock_id . " - " . $stock_item->item_description . ": " .
-                                       _("Quantity On Hand") . " = " 
-                                       . number_format2($qoh, get_qty_dec($stock_item->stock_id)) . '<br>';
-                                       $has_marked = true;
-                                } else 
-                                       alt_table_row_color($k);
-                       } else {
+                       if (in_array($stock_item->stock_id, $low_stock))
+                               start_row("class='stockmankobg'");      // notice low stock status
+                       else 
                                alt_table_row_color($k);
-                       }
 
                        view_stock_status_cell($stock_item->stock_id);
 
@@ -245,12 +233,9 @@ function display_order_summary($title, &$order, $editable_items=false)
        end_row();
 
        end_table();
-       if ($has_marked) {
+       if ($low_stock)
                display_note(_("Marked items have insufficient quantities in stock as on day of delivery."), 0, 1, "class='stockmankofg'");
-               if ($order->trans_type!=30 && !$SysPrefs->allow_negative_stock())
-                       display_error(_("The delivery cannot be processed because there is an insufficient quantity for item:")
-                               . '<br>'. $qoh_msg);
-       }
+
     div_end();
 }
 
index 4da4d98b5ca06798cf0e60cd5a7029942171141d..f6ac03fa01f95394c30e908c7f4b304f62535598 100644 (file)
@@ -113,6 +113,8 @@ start_row();
 
 stock_items_list_cells(_("Item:"), 'SelectStockFromList', null, true);
 
+customer_list_cells(_("Select a customer: "), 'customer_id', null, true, true);
+
 submit_cells('SearchOrders', _("Search"),'',_('Select documents'), 'default');
 
 hidden('OutstandingOnly', $_POST['OutstandingOnly']);
@@ -173,7 +175,7 @@ function check_overdue($row)
                        $row["Outstanding"]!=0;
 }
 //------------------------------------------------------------------------------------------------
-$sql = get_sql_for_sales_deliveries_view($selected_customer, $selected_stock_item);
+$sql = get_sql_for_sales_deliveries_view($selected_customer, $selected_stock_item, $_POST['customer_id']);
 
 $cols = array(
                _("Delivery #") => array('fun'=>'trans_view'), 
index 65c36c934e795f3ff3a04a5016b69e3b6d0b10ca..6515b8af9624371435d1cc13b82ed522ac4d4ad8 100644 (file)
@@ -117,7 +117,7 @@ function handle_submit(&$selected_id)
                 
                $selected_branch = db_insert_id();
         
-                       add_crm_person($_POST['CustName'], $_POST['cust_ref'], '', $_POST['address'], 
+                       add_crm_person($_POST['cust_ref'], $_POST['CustName'], '', $_POST['address'], 
                                $_POST['phone'], $_POST['phone2'], $_POST['fax'], $_POST['email'], '', '');
 
                        $pers_id = db_insert_id();
index b266c000aeaf1303767ebf92121390f0e63c1e2d..bf4d81138aa77f5353268e0a269fd5de2e163a77 100644 (file)
@@ -343,7 +343,10 @@ function line_start_focus() {
 
 //--------------------------------------------------------------------------------
 function can_process() {
-       global $Refs;
+
+       global $Refs, $SysPrefs;
+
+       copy_to_cart();
 
        if (!get_post('customer_id')) 
        {
@@ -387,7 +390,19 @@ function can_process() {
                        return false;
                }
 
+       if (!$SysPrefs->allow_negative_stock() && ($low_stock = $_SESSION['Items']->check_qoh()))
+       {
+               display_error(_("This document cannot be processed because there is insufficient quantity for items marked."));
+               return false;
+       }
+
+       if ($_SESSION['Items']->payment_terms['cash_sale'] == 0) {
 
+               if (strlen($_POST['deliver_to']) <= 1) {
+                       display_error(_("You must enter the person or company to whom delivery should be made to."));
+                       set_focus('deliver_to');
+                       return false;
+               }
                if ($_SESSION['Items']->trans_type != ST_SALESQUOTE && strlen($_POST['delivery_address']) <= 1) {
                        display_error( _("You should enter the street address in the box provided. Orders cannot be accepted without a valid street address."));
                        set_focus('delivery_address');
@@ -410,7 +425,6 @@ function can_process() {
                        set_focus('delivery_date');
                        return false;
                }
-               //if (date1_greater_date2($_SESSION['Items']->document_date, $_POST['delivery_date'])) {
                if (date1_greater_date2($_POST['OrderDate'], $_POST['delivery_date'])) {
                        if ($_SESSION['Items']->trans_type==ST_SALESQUOTE)
                                display_error(_("The requested valid date is before the date of the quotation."));
@@ -451,7 +465,7 @@ if (isset($_POST['update'])) {
 }
 
 if (isset($_POST['ProcessOrder']) && can_process()) {
-       copy_to_cart();
+
        $modified = ($_SESSION['Items']->trans_no != 0);
        $so_type = $_SESSION['Items']->so_type;
 
@@ -521,21 +535,8 @@ function check_item_data()
                set_focus('qty');
                display_error(_("You attempting to make the quantity ordered a quantity less than has already been delivered. The quantity delivered cannot be modified retrospectively."));
                return false;
-       } // Joe Hunt added 2008-09-22 -------------------------
-       elseif ($is_inventory_item && $_SESSION['Items']->trans_type!=ST_SALESORDER && $_SESSION['Items']->trans_type!=ST_SALESQUOTE 
-               && !$SysPrefs->allow_negative_stock())
-       {
-               $qoh = get_qoh_on_date($_POST['stock_id'], $_POST['Location'], $_POST['OrderDate']);
-               if (input_num('qty') > $qoh)
-               {
-                       $stock = get_item($_POST['stock_id']);
-                       display_error(_("The delivery cannot be processed because there is an insufficient quantity for item:") .
-                               " " . $stock['stock_id'] . " - " . $stock['description'] . " - " .
-                               _("Quantity On Hand") . " = " . number_format2($qoh, get_qty_dec($_POST['stock_id'])));
-                       return false;
-               }
-               return true;
        }
+
        $cost_home = get_standard_cost(get_post('stock_id')); // Added 2011-03-27 Joe Hunt
        $cost = $cost_home / get_exchange_rate_from_home_currency($_SESSION['Items']->customer_currency, $_SESSION['Items']->document_date);
        if (input_num('price') < $cost)
index 99c98e880d7a53870f46e3fc98e8ba7678fbf0de..aabfbb6fecee9529d2f6d7cd08260642ba5efbe4 100644 (file)
@@ -3,7 +3,7 @@
 -- http://www.phpmyadmin.net
 --
 -- Host: localhost
--- Generation Time: May 11, 2010 at 11:32 PM
+-- Generation Time: Sep 26, 2014 at 11:32 AM
 -- Server version: 5.0.51
 -- PHP Version: 5.2.6-1+lenny2
 
@@ -150,17 +150,17 @@ CREATE TABLE IF NOT EXISTS `0_bank_trans` (
 -- Dumping data for table `0_bank_trans`
 --
 
-INSERT INTO `0_bank_trans` VALUES(1, 22, 4, '1', '1', '2009-06-21', -3465, 0, 0, 3, '2', NULL);
-INSERT INTO `0_bank_trans` VALUES(2, 26, 1, '1', '', '2009-06-21', -10, 0, 0, 1, '1', NULL);
-INSERT INTO `0_bank_trans` VALUES(3, 26, 1, '1', '', '2009-06-21', -20, 0, 0, 1, '0', NULL);
-INSERT INTO `0_bank_trans` VALUES(4, 0, 18, '1', '1', '2009-02-20', 1000, 0, 0, 0, '', NULL);
-INSERT INTO `0_bank_trans` VALUES(5, 0, 19, '1', '2', '2009-02-21', 4000, 0, 0, 0, '', NULL);
-INSERT INTO `0_bank_trans` VALUES(6, 2, 5, '1', '1', '2009-06-21', 100, 0, 0, 4, '3', NULL);
-INSERT INTO `0_bank_trans` VALUES(7, 1, 8, '1', '1', '2009-06-21', -50, 0, 0, 4, '1', NULL);
-INSERT INTO `0_bank_trans` VALUES(8, 26, 5, '1', '', '2009-06-21', -10, 0, 0, 1, '1', NULL);
-INSERT INTO `0_bank_trans` VALUES(9, 26, 5, '1', '', '2009-06-21', -20, 0, 0, 1, '0', NULL);
-INSERT INTO `0_bank_trans` VALUES(10, 26, 7, '1', '', '2009-06-21', -10, 0, 0, 1, '1', NULL);
-INSERT INTO `0_bank_trans` VALUES(11, 26, 7, '1', '', '2009-06-21', -20, 0, 0, 1, '0', NULL);
+INSERT INTO `0_bank_trans` VALUES(1, 22, 4, '1', '1', '2014-06-21', -3465, 0, 0, 3, '2', NULL);
+INSERT INTO `0_bank_trans` VALUES(2, 26, 1, '1', '', '2014-06-21', -10, 0, 0, 1, '1', NULL);
+INSERT INTO `0_bank_trans` VALUES(3, 26, 1, '1', '', '2014-06-21', -20, 0, 0, 1, '0', NULL);
+INSERT INTO `0_bank_trans` VALUES(4, 0, 18, '1', '1', '2014-02-20', 1000, 0, 0, 0, '', NULL);
+INSERT INTO `0_bank_trans` VALUES(5, 0, 19, '1', '2', '2014-02-21', 4000, 0, 0, 0, '', NULL);
+INSERT INTO `0_bank_trans` VALUES(6, 2, 5, '1', '1', '2014-06-21', 100, 0, 0, 4, '3', NULL);
+INSERT INTO `0_bank_trans` VALUES(7, 1, 8, '1', '1', '2014-06-21', -50, 0, 0, 4, '1', NULL);
+INSERT INTO `0_bank_trans` VALUES(8, 26, 5, '1', '', '2014-06-21', -10, 0, 0, 1, '1', NULL);
+INSERT INTO `0_bank_trans` VALUES(9, 26, 5, '1', '', '2014-06-21', -20, 0, 0, 1, '0', NULL);
+INSERT INTO `0_bank_trans` VALUES(10, 26, 7, '1', '', '2014-06-21', -10, 0, 0, 1, '1', NULL);
+INSERT INTO `0_bank_trans` VALUES(11, 26, 7, '1', '', '2014-06-21', -20, 0, 0, 1, '0', NULL);
 
 -- --------------------------------------------------------
 
@@ -552,7 +552,7 @@ INSERT INTO `0_currencies` VALUES('US Dollars', 'USD', '$', 'United States', 'Ce
 INSERT INTO `0_currencies` VALUES('CA Dollars', 'CAD', '$', 'Canada', 'Cents', 1, 0);
 INSERT INTO `0_currencies` VALUES('Euro', 'EUR', '?', 'Europe', 'Cents', 1, 0);
 INSERT INTO `0_currencies` VALUES('Pounds', 'GBP', '?', 'England', 'Pence', 1, 0);
-INSERT INTO `0_currencies` VALUES('DK Kroner', 'DKK', '?', 'Denmark', 'Ore', 1, 0);
+INSERT INTO `0_currencies` VALUES('DK Kroner', 'DKK', 'kr', 'Denmark', 'Ore', 1, 0);
 
 -- --------------------------------------------------------
 
@@ -579,7 +579,7 @@ CREATE TABLE IF NOT EXISTS `0_cust_allocations` (
 -- Dumping data for table `0_cust_allocations`
 --
 
-INSERT INTO `0_cust_allocations` VALUES(1, 37.68, '2009-06-21', 3, 11, 18, 10);
+INSERT INTO `0_cust_allocations` VALUES(1, 37.68, '2014-06-21', 3, 11, 18, 10);
 
 -- --------------------------------------------------------
 
@@ -611,6 +611,7 @@ CREATE TABLE IF NOT EXISTS `0_cust_branch` (
   `bank_account` varchar(60) DEFAULT NULL,
   `inactive` tinyint(1) NOT NULL default '0',
   PRIMARY KEY  (`branch_code`,`debtor_no`),
+  KEY `branch_code` (`branch_code`),
   KEY `branch_ref` (`branch_ref`),
   KEY `group_no` (`group_no`)
 ) ENGINE=MyISAM  AUTO_INCREMENT=4 ;
@@ -701,14 +702,14 @@ CREATE TABLE IF NOT EXISTS `0_debtor_trans` (
 -- Dumping data for table `0_debtor_trans`
 --
 
-INSERT INTO `0_debtor_trans` VALUES(17, 10, 0, 2, 2, '2009-06-21', '2009-06-22', '1', 1, 2, 50, 2.5, 0, 0, 0, 0, 0, 1, 1, 0, 0, 4, 0);
-INSERT INTO `0_debtor_trans` VALUES(18, 10, 1, 3, 3, '2009-06-21', '2009-07-01', '2', 2, 3, 35.89, 1.79, 0, 0, 0, 37.68, 0, 1.3932, 1, 2, 0, 3, 0);
-INSERT INTO `0_debtor_trans` VALUES(19, 10, 0, 2, 2, '2009-06-21', '2009-06-22', '3', 1, 5, 50, 0, 5, 0, 0, 0, 0, 1, 1, 0, 0, 4, 0);
-INSERT INTO `0_debtor_trans` VALUES(3, 11, 0, 3, 3, '2009-06-21', '0000-00-00', '1', 2, 3, 35.89, 1.79, 0, 0, 0, 37.68, 0, 1.3932, 1, 2, 0, 3, 0);
-INSERT INTO `0_debtor_trans` VALUES(2, 13, 0, 1, 1, '2009-06-21', '2009-06-22', '1', 2, 1, 60.8, 0, 10, 0, 0, 0, 0, 1.6445729799917, 1, 0, 0, 3, 0);
-INSERT INTO `0_debtor_trans` VALUES(3, 13, 1, 2, 2, '2009-06-21', '2009-06-22', 'auto', 1, 2, 50, 2.5, 0, 0, 0, 0, 0, 1, 1, 0, 0, 4, 0);
-INSERT INTO `0_debtor_trans` VALUES(4, 13, 1, 3, 3, '2009-06-21', '2009-07-01', 'auto', 2, 3, 35.89, 1.79, 0, 0, 0, 0, 0, 1.3932, 1, 2, 0, 3, 0);
-INSERT INTO `0_debtor_trans` VALUES(5, 13, 1, 2, 2, '2009-06-21', '2009-06-22', 'auto', 1, 5, 50, 0, 5, 0, 0, 0, 0, 1, 1, 0, 0, 4, 0);
+INSERT INTO `0_debtor_trans` VALUES(17, 10, 0, 2, 2, '2014-06-21', '2014-06-22', '1', 1, 2, 50, 2.5, 0, 0, 0, 0, 0, 1, 1, 0, 0, 4, 0);
+INSERT INTO `0_debtor_trans` VALUES(18, 10, 1, 3, 3, '2014-06-21', '2014-07-01', '2', 2, 3, 35.89, 1.79, 0, 0, 0, 37.68, 0, 1.3932, 1, 2, 0, 3, 0);
+INSERT INTO `0_debtor_trans` VALUES(19, 10, 0, 2, 2, '2014-06-21', '2014-06-22', '3', 1, 5, 50, 0, 5, 0, 0, 0, 0, 1, 1, 0, 0, 4, 0);
+INSERT INTO `0_debtor_trans` VALUES(3, 11, 0, 3, 3, '2014-06-21', '0000-00-00', '1', 2, 3, 35.89, 1.79, 0, 0, 0, 37.68, 0, 1.3932, 1, 2, 0, 3, 0);
+INSERT INTO `0_debtor_trans` VALUES(2, 13, 0, 1, 1, '2014-06-21', '2014-06-22', '1', 2, 1, 60.8, 0, 10, 0, 0, 0, 0, 1.6445729799917, 1, 0, 0, 3, 0);
+INSERT INTO `0_debtor_trans` VALUES(3, 13, 1, 2, 2, '2014-06-21', '2014-06-22', 'auto', 1, 2, 50, 2.5, 0, 0, 0, 0, 0, 1, 1, 0, 0, 4, 0);
+INSERT INTO `0_debtor_trans` VALUES(4, 13, 1, 3, 3, '2014-06-21', '2014-07-01', 'auto', 2, 3, 35.89, 1.79, 0, 0, 0, 0, 0, 1.3932, 1, 2, 0, 3, 0);
+INSERT INTO `0_debtor_trans` VALUES(5, 13, 1, 2, 2, '2014-06-21', '2014-06-22', 'auto', 1, 5, 50, 0, 5, 0, 0, 0, 0, 1, 1, 0, 0, 4, 0);
 
 -- --------------------------------------------------------
 
@@ -774,8 +775,8 @@ CREATE TABLE IF NOT EXISTS `0_dimensions` (
 -- Dumping data for table `0_dimensions`
 --
 
-INSERT INTO `0_dimensions` VALUES(1, '1', 'Support', 1, 0, '2009-06-21', '2015-07-11');
-INSERT INTO `0_dimensions` VALUES(2, '2', 'Development', 1, 0, '2009-06-21', '2015-07-11');
+INSERT INTO `0_dimensions` VALUES(1, '1', 'Support', 1, 0, '2014-06-21', '2020-07-11');
+INSERT INTO `0_dimensions` VALUES(2, '2', 'Development', 1, 0, '2014-06-21', '2020-07-11');
 
 -- --------------------------------------------------------
 
@@ -798,9 +799,9 @@ CREATE TABLE IF NOT EXISTS `0_exchange_rates` (
 -- Dumping data for table `0_exchange_rates`
 --
 
-INSERT INTO `0_exchange_rates` VALUES(1, 'DKK', 0.18717252868313, 0.18717252868313, '2009-06-21');
-INSERT INTO `0_exchange_rates` VALUES(2, 'GBP', 1.6445729799917, 1.6445729799917, '2009-06-21');
-INSERT INTO `0_exchange_rates` VALUES(3, 'EUR', 1.3932, 1.3932, '2009-06-21');
+INSERT INTO `0_exchange_rates` VALUES(1, 'DKK', 0.18717252868313, 0.18717252868313, '2014-06-21');
+INSERT INTO `0_exchange_rates` VALUES(2, 'GBP', 1.6445729799917, 1.6445729799917, '2014-06-21');
+INSERT INTO `0_exchange_rates` VALUES(3, 'EUR', 1.3932, 1.3932, '2014-06-21');
 
 -- --------------------------------------------------------
 
@@ -817,18 +818,14 @@ CREATE TABLE IF NOT EXISTS `0_fiscal_year` (
   PRIMARY KEY  (`id`),
   UNIQUE KEY `begin` (`begin`),
   UNIQUE KEY `end` (`end`)
-) ENGINE=InnoDB  AUTO_INCREMENT=4 ;
+) ENGINE=InnoDB  AUTO_INCREMENT=3 ;
 
 --
 -- Dumping data for table `0_fiscal_year`
 --
 
-INSERT INTO `0_fiscal_year` VALUES(1, '2008-01-01', '2008-12-31', 1);
-INSERT INTO `0_fiscal_year` VALUES(2, '2009-01-01', '2009-12-31', 1);
-INSERT INTO `0_fiscal_year` VALUES(3, '2010-01-01', '2010-12-31', 0);
-INSERT INTO `0_fiscal_year` VALUES(4, '2011-01-01', '2011-12-31', 0);
-INSERT INTO `0_fiscal_year` VALUES(5, '2012-01-01', '2012-12-31', 0);
-INSERT INTO `0_fiscal_year` VALUES(6, '2013-01-01', '2013-12-31', 0);
+INSERT INTO `0_fiscal_year` VALUES(1, '2013-01-01', '2013-12-31', 0);
+INSERT INTO `0_fiscal_year` VALUES(2, '2014-01-01', '2014-12-31', 0);
 
 --
 -- Table structure for table `0_gl_trans`
@@ -859,91 +856,89 @@ CREATE TABLE IF NOT EXISTS `0_gl_trans` (
 -- Dumping data for table `0_gl_trans`
 --
 
-INSERT INTO `0_gl_trans` VALUES(1, 20, 7, '2009-06-21', '2100', '', -3465, 0, 0, 3, '2');
-INSERT INTO `0_gl_trans` VALUES(2, 20, 7, '2009-06-21', '1510', '', 1000, 0, 0, 3, '2');
-INSERT INTO `0_gl_trans` VALUES(3, 20, 7, '2009-06-21', '1510', '', 1100, 0, 0, 3, '2');
-INSERT INTO `0_gl_trans` VALUES(4, 20, 7, '2009-06-21', '1510', '', 1200, 0, 0, 3, '2');
-INSERT INTO `0_gl_trans` VALUES(5, 20, 7, '2009-06-21', '2150', '', 165, 0, 0, 3, '2');
-INSERT INTO `0_gl_trans` VALUES(6, 22, 4, '2009-06-21', '2100', '', 3465, 0, 0, 3, '2');
-INSERT INTO `0_gl_trans` VALUES(7, 22, 4, '2009-06-21', '1060', '', -3465, 0, 0, 3, '2');
-INSERT INTO `0_gl_trans` VALUES(8, 26, 1, '2009-06-21', '1510', '', -100, 0, 0, NULL, '');
-INSERT INTO `0_gl_trans` VALUES(9, 26, 1, '2009-06-21', '1510', '', -110, 0, 0, NULL, '');
-INSERT INTO `0_gl_trans` VALUES(10, 26, 1, '2009-06-21', '1510', '', -120, 0, 0, NULL, '');
-INSERT INTO `0_gl_trans` VALUES(11, 26, 1, '2009-06-21', '1060', 'Overhead Cost', -10, 0, 0, 1, '1');
-INSERT INTO `0_gl_trans` VALUES(12, 26, 1, '2009-06-21', '1530', 'Overhead Cost', 10, 0, 0, 1, '1');
-INSERT INTO `0_gl_trans` VALUES(13, 26, 1, '2009-06-21', '1060', 'Labour Cost', -20, 0, 0, 1, '0');
-INSERT INTO `0_gl_trans` VALUES(14, 26, 1, '2009-06-21', '1530', 'Labour Cost', 20, 0, 0, 1, '0');
-INSERT INTO `0_gl_trans` VALUES(15, 26, 1, '2009-06-21', '1510', '', 330, 0, 0, NULL, '');
-INSERT INTO `0_gl_trans` VALUES(16, 13, 2, '2009-06-21', '5010', '', 20, 0, 0, 2, '1');
-INSERT INTO `0_gl_trans` VALUES(17, 13, 2, '2009-06-21', '1510', '', -20, 0, 0, 2, '1');
-INSERT INTO `0_gl_trans` VALUES(18, 13, 3, '2009-06-21', '5010', '', 10, 0, 0, 2, '2');
-INSERT INTO `0_gl_trans` VALUES(19, 13, 3, '2009-06-21', '1510', '', -10, 0, 0, 2, '2');
-INSERT INTO `0_gl_trans` VALUES(20, 10, 17, '2009-06-21', '4010', '', -50, 0, 0, 2, '2');
-INSERT INTO `0_gl_trans` VALUES(21, 10, 17, '2009-06-21', '1200', '', 52.5, 0, 0, 2, '2');
-INSERT INTO `0_gl_trans` VALUES(22, 10, 17, '2009-06-21', '2150', '', -2.5, 0, 0, 2, '2');
-INSERT INTO `0_gl_trans` VALUES(23, 13, 4, '2009-06-21', '5010', '', 10, 2, 0, 2, '3');
-INSERT INTO `0_gl_trans` VALUES(24, 13, 4, '2009-06-21', '1510', '', -10, 0, 0, 2, '3');
-INSERT INTO `0_gl_trans` VALUES(25, 10, 18, '2009-06-21', '4010', '', -50, 2, 0, 2, '3');
-INSERT INTO `0_gl_trans` VALUES(26, 10, 18, '2009-06-21', '1200', '', 52.5, 0, 0, 2, '3');
-INSERT INTO `0_gl_trans` VALUES(27, 10, 18, '2009-06-21', '2150', '', -2.5, 0, 0, 2, '3');
-INSERT INTO `0_gl_trans` VALUES(28, 0, 18, '2009-02-20', '1060', '', 1000, 0, 0, NULL, '');
-INSERT INTO `0_gl_trans` VALUES(29, 0, 18, '2009-02-20', '3350', '', -1000, 0, 0, NULL, '');
-INSERT INTO `0_gl_trans` VALUES(30, 0, 19, '2009-02-21', '1060', '', 4000, 0, 0, NULL, '');
-INSERT INTO `0_gl_trans` VALUES(31, 0, 19, '2009-02-21', '3350', '', -4000, 0, 0, NULL, '');
-INSERT INTO `0_gl_trans` VALUES(32, 26, 3, '2009-06-21', '1510', '', -20, 0, 0, NULL, '');
-INSERT INTO `0_gl_trans` VALUES(33, 26, 3, '2009-06-21', '1510', '', -22, 0, 0, NULL, '');
-INSERT INTO `0_gl_trans` VALUES(34, 26, 3, '2009-06-21', '1510', '', -24, 0, 0, NULL, '');
-INSERT INTO `0_gl_trans` VALUES(35, 26, 3, '2009-06-21', '1540', '', 66, 0, 0, NULL, '');
-INSERT INTO `0_gl_trans` VALUES(36, 2, 5, '2009-06-21', '2150', 'Cash Sales', -4.76, 0, 0, 4, '3');
-INSERT INTO `0_gl_trans` VALUES(37, 2, 5, '2009-06-21', '4010', 'Cash Sales', -95.24, 0, 0, 4, '3');
-INSERT INTO `0_gl_trans` VALUES(38, 2, 5, '2009-06-21', '1060', '', 100, 0, 0, 4, '3');
-INSERT INTO `0_gl_trans` VALUES(39, 1, 8, '2009-06-21', '2150', 'Maintenance', 2.38, 0, 0, 4, '1');
-INSERT INTO `0_gl_trans` VALUES(40, 1, 8, '2009-06-21', '5765', 'Maintenance', 47.62, 0, 0, 4, '1');
-INSERT INTO `0_gl_trans` VALUES(41, 1, 8, '2009-06-21', '1060', '', -50, 0, 0, 4, '1');
-INSERT INTO `0_gl_trans` VALUES(42, 20, 8, '2009-06-21', '2100', '', -20, 0, 0, 3, '2');
-INSERT INTO `0_gl_trans` VALUES(43, 20, 8, '2009-06-21', '2150', '', 0.95, 0, 0, 3, '2');
-INSERT INTO `0_gl_trans` VALUES(44, 20, 8, '2009-06-21', '5780', '', 19.05, 0, 0, 3, '2');
-INSERT INTO `0_gl_trans` VALUES(45, 26, 4, '2009-06-21', '1510', '', -40, 0, 0, NULL, '');
-INSERT INTO `0_gl_trans` VALUES(46, 26, 4, '2009-06-21', '1510', '', -44, 0, 0, NULL, '');
-INSERT INTO `0_gl_trans` VALUES(47, 26, 4, '2009-06-21', '1510', '', -48, 0, 0, NULL, '');
-INSERT INTO `0_gl_trans` VALUES(48, 26, 4, '2009-06-21', '1540', '', 132, 0, 0, NULL, '');
-INSERT INTO `0_gl_trans` VALUES(49, 26, 2, '2009-06-21', '1510', '', -20, 0, 0, NULL, '');
-INSERT INTO `0_gl_trans` VALUES(50, 26, 2, '2009-06-21', '1510', '', -22, 0, 0, NULL, '');
-INSERT INTO `0_gl_trans` VALUES(51, 26, 2, '2009-06-21', '1510', '', -24, 0, 0, NULL, '');
-INSERT INTO `0_gl_trans` VALUES(52, 26, 2, '2009-06-21', '1540', '', 66, 0, 0, NULL, '');
-INSERT INTO `0_gl_trans` VALUES(53, 26, 5, '2009-06-21', '1510', '', -50, 0, 0, NULL, '');
-INSERT INTO `0_gl_trans` VALUES(54, 26, 5, '2009-06-21', '1510', '', -55, 0, 0, NULL, '');
-INSERT INTO `0_gl_trans` VALUES(55, 26, 5, '2009-06-21', '1510', '', -60, 0, 0, NULL, '');
-INSERT INTO `0_gl_trans` VALUES(56, 26, 5, '2009-06-21', '1060', 'Overhead Cost', -10, 0, 0, 1, '1');
-INSERT INTO `0_gl_trans` VALUES(57, 26, 5, '2009-06-21', '1530', 'Overhead Cost', 10, 0, 0, 1, '1');
-INSERT INTO `0_gl_trans` VALUES(58, 26, 5, '2009-06-21', '1060', 'Labour Cost', -20, 0, 0, 1, '0');
-INSERT INTO `0_gl_trans` VALUES(59, 26, 5, '2009-06-21', '1530', 'Labour Cost', 20, 0, 0, 1, '0');
-INSERT INTO `0_gl_trans` VALUES(60, 26, 5, '2009-06-21', '1540', '', 165, 0, 0, NULL, '');
-INSERT INTO `0_gl_trans` VALUES(61, 26, 6, '2009-06-21', '1510', '', 50, 0, 0, NULL, '');
-INSERT INTO `0_gl_trans` VALUES(62, 26, 6, '2009-06-21', '1510', '', 55, 0, 0, NULL, '');
-INSERT INTO `0_gl_trans` VALUES(63, 26, 6, '2009-06-21', '1510', '', 60, 0, 0, NULL, '');
-INSERT INTO `0_gl_trans` VALUES(64, 26, 6, '2009-06-21', '1540', '', -165, 0, 0, NULL, '');
-INSERT INTO `0_gl_trans` VALUES(65, 26, 7, '2009-06-21', '1510', '', 20, 0, 0, NULL, '');
-INSERT INTO `0_gl_trans` VALUES(66, 26, 7, '2009-06-21', '1510', '', 22, 0, 0, NULL, '');
-INSERT INTO `0_gl_trans` VALUES(67, 26, 7, '2009-06-21', '1510', '', 24, 0, 0, NULL, '');
-INSERT INTO `0_gl_trans` VALUES(68, 26, 7, '2009-06-21', '1060', 'Overhead Cost', -10, 0, 0, 1, '1');
-INSERT INTO `0_gl_trans` VALUES(69, 26, 7, '2009-06-21', '1530', 'Overhead Cost', 10, 0, 0, 1, '1');
-INSERT INTO `0_gl_trans` VALUES(70, 26, 7, '2009-06-21', '1060', 'Labour Cost', -20, 0, 0, 1, '0');
-INSERT INTO `0_gl_trans` VALUES(71, 26, 7, '2009-06-21', '1530', 'Labour Cost', 20, 0, 0, 1, '0');
-INSERT INTO `0_gl_trans` VALUES(72, 26, 7, '2009-06-21', '1540', '', -66, 0, 0, NULL, '');
-INSERT INTO `0_gl_trans` VALUES(73, 13, 5, '2009-06-21', '5010', '', 10, 0, 0, 2, '2');
-INSERT INTO `0_gl_trans` VALUES(74, 13, 5, '2009-06-21', '1510', '', -10, 0, 0, 2, '2');
-INSERT INTO `0_gl_trans` VALUES(75, 10, 19, '2009-06-21', '4010', '', -47.62, 0, 0, 2, '2');
-INSERT INTO `0_gl_trans` VALUES(76, 10, 19, '2009-06-21', '1200', '', 55, 0, 0, 2, '2');
-INSERT INTO `0_gl_trans` VALUES(77, 10, 19, '2009-06-21', '4430', '', -5, 0, 0, 2, '2');
-INSERT INTO `0_gl_trans` VALUES(78, 10, 19, '2009-06-21', '2150', '', -2.38, 0, 0, 2, '2');
-INSERT INTO `0_gl_trans` VALUES(79, 11, 3, '2009-06-21', '5010', '', -10, 2, 0, 2, '3');
-INSERT INTO `0_gl_trans` VALUES(80, 11, 3, '2009-06-21', '1510', '', 10, 0, 0, 2, '3');
-INSERT INTO `0_gl_trans` VALUES(81, 11, 3, '2009-06-21', '4010', '', 50, 2, 0, 2, '3');
-INSERT INTO `0_gl_trans` VALUES(82, 11, 3, '2009-06-21', '1200', '', -52.5, 0, 0, 2, '3');
-INSERT INTO `0_gl_trans` VALUES(83, 11, 3, '2009-06-21', '2150', '', 2.5, 0, 0, 2, '3');
-INSERT INTO `0_gl_trans` VALUES ('84', '0', '20', '2009-12-31', '3590', 'Closing Year', '-91.19', '0', '0', NULL, NULL);
-INSERT INTO `0_gl_trans` VALUES ('85', '0', '20', '2009-12-31', '9990', 'Closing Year', '91.19', '0', '0', NULL, NULL);
+INSERT INTO `0_gl_trans` VALUES(1, 20, 7, '2014-06-21', '2100', '', -3465, 0, 0, 3, '2');
+INSERT INTO `0_gl_trans` VALUES(2, 20, 7, '2014-06-21', '1510', '', 1000, 0, 0, 3, '2');
+INSERT INTO `0_gl_trans` VALUES(3, 20, 7, '2014-06-21', '1510', '', 1100, 0, 0, 3, '2');
+INSERT INTO `0_gl_trans` VALUES(4, 20, 7, '2014-06-21', '1510', '', 1200, 0, 0, 3, '2');
+INSERT INTO `0_gl_trans` VALUES(5, 20, 7, '2014-06-21', '2150', '', 165, 0, 0, 3, '2');
+INSERT INTO `0_gl_trans` VALUES(6, 22, 4, '2014-06-21', '2100', '', 3465, 0, 0, 3, '2');
+INSERT INTO `0_gl_trans` VALUES(7, 22, 4, '2014-06-21', '1060', '', -3465, 0, 0, 3, '2');
+INSERT INTO `0_gl_trans` VALUES(8, 26, 1, '2014-06-21', '1510', '', -100, 0, 0, NULL, '');
+INSERT INTO `0_gl_trans` VALUES(9, 26, 1, '2014-06-21', '1510', '', -110, 0, 0, NULL, '');
+INSERT INTO `0_gl_trans` VALUES(10, 26, 1, '2014-06-21', '1510', '', -120, 0, 0, NULL, '');
+INSERT INTO `0_gl_trans` VALUES(11, 26, 1, '2014-06-21', '1060', 'Overhead Cost', -10, 0, 0, 1, '1');
+INSERT INTO `0_gl_trans` VALUES(12, 26, 1, '2014-06-21', '1530', 'Overhead Cost', 10, 0, 0, 1, '1');
+INSERT INTO `0_gl_trans` VALUES(13, 26, 1, '2014-06-21', '1060', 'Labour Cost', -20, 0, 0, 1, '0');
+INSERT INTO `0_gl_trans` VALUES(14, 26, 1, '2014-06-21', '1530', 'Labour Cost', 20, 0, 0, 1, '0');
+INSERT INTO `0_gl_trans` VALUES(15, 26, 1, '2014-06-21', '1510', '', 330, 0, 0, NULL, '');
+INSERT INTO `0_gl_trans` VALUES(16, 13, 2, '2014-06-21', '5010', '', 20, 0, 0, 2, '1');
+INSERT INTO `0_gl_trans` VALUES(17, 13, 2, '2014-06-21', '1510', '', -20, 0, 0, 2, '1');
+INSERT INTO `0_gl_trans` VALUES(18, 13, 3, '2014-06-21', '5010', '', 10, 0, 0, 2, '2');
+INSERT INTO `0_gl_trans` VALUES(19, 13, 3, '2014-06-21', '1510', '', -10, 0, 0, 2, '2');
+INSERT INTO `0_gl_trans` VALUES(20, 10, 17, '2014-06-21', '4010', '', -50, 0, 0, 2, '2');
+INSERT INTO `0_gl_trans` VALUES(21, 10, 17, '2014-06-21', '1200', '', 52.5, 0, 0, 2, '2');
+INSERT INTO `0_gl_trans` VALUES(22, 10, 17, '2014-06-21', '2150', '', -2.5, 0, 0, 2, '2');
+INSERT INTO `0_gl_trans` VALUES(23, 13, 4, '2014-06-21', '5010', '', 10, 2, 0, 2, '3');
+INSERT INTO `0_gl_trans` VALUES(24, 13, 4, '2014-06-21', '1510', '', -10, 0, 0, 2, '3');
+INSERT INTO `0_gl_trans` VALUES(25, 10, 18, '2014-06-21', '4010', '', -50, 2, 0, 2, '3');
+INSERT INTO `0_gl_trans` VALUES(26, 10, 18, '2014-06-21', '1200', '', 52.5, 0, 0, 2, '3');
+INSERT INTO `0_gl_trans` VALUES(27, 10, 18, '2014-06-21', '2150', '', -2.5, 0, 0, 2, '3');
+INSERT INTO `0_gl_trans` VALUES(28, 0, 18, '2014-02-20', '1060', '', 1000, 0, 0, NULL, '');
+INSERT INTO `0_gl_trans` VALUES(29, 0, 18, '2014-02-20', '3350', '', -1000, 0, 0, NULL, '');
+INSERT INTO `0_gl_trans` VALUES(30, 0, 19, '2014-02-21', '1060', '', 4000, 0, 0, NULL, '');
+INSERT INTO `0_gl_trans` VALUES(31, 0, 19, '2014-02-21', '3350', '', -4000, 0, 0, NULL, '');
+INSERT INTO `0_gl_trans` VALUES(32, 26, 3, '2014-06-21', '1510', '', -20, 0, 0, NULL, '');
+INSERT INTO `0_gl_trans` VALUES(33, 26, 3, '2014-06-21', '1510', '', -22, 0, 0, NULL, '');
+INSERT INTO `0_gl_trans` VALUES(34, 26, 3, '2014-06-21', '1510', '', -24, 0, 0, NULL, '');
+INSERT INTO `0_gl_trans` VALUES(35, 26, 3, '2014-06-21', '1540', '', 66, 0, 0, NULL, '');
+INSERT INTO `0_gl_trans` VALUES(36, 2, 5, '2014-06-21', '2150', 'Cash Sales', -4.76, 0, 0, 4, '3');
+INSERT INTO `0_gl_trans` VALUES(37, 2, 5, '2014-06-21', '4010', 'Cash Sales', -95.24, 0, 0, 4, '3');
+INSERT INTO `0_gl_trans` VALUES(38, 2, 5, '2014-06-21', '1060', '', 100, 0, 0, 4, '3');
+INSERT INTO `0_gl_trans` VALUES(39, 1, 8, '2014-06-21', '2150', 'Maintenance', 2.38, 0, 0, 4, '1');
+INSERT INTO `0_gl_trans` VALUES(40, 1, 8, '2014-06-21', '5765', 'Maintenance', 47.62, 0, 0, 4, '1');
+INSERT INTO `0_gl_trans` VALUES(41, 1, 8, '2014-06-21', '1060', '', -50, 0, 0, 4, '1');
+INSERT INTO `0_gl_trans` VALUES(42, 20, 8, '2014-06-21', '2100', '', -20, 0, 0, 3, '2');
+INSERT INTO `0_gl_trans` VALUES(43, 20, 8, '2014-06-21', '2150', '', 0.95, 0, 0, 3, '2');
+INSERT INTO `0_gl_trans` VALUES(44, 20, 8, '2014-06-21', '5780', '', 19.05, 0, 0, 3, '2');
+INSERT INTO `0_gl_trans` VALUES(45, 26, 4, '2014-06-21', '1510', '', -40, 0, 0, NULL, '');
+INSERT INTO `0_gl_trans` VALUES(46, 26, 4, '2014-06-21', '1510', '', -44, 0, 0, NULL, '');
+INSERT INTO `0_gl_trans` VALUES(47, 26, 4, '2014-06-21', '1510', '', -48, 0, 0, NULL, '');
+INSERT INTO `0_gl_trans` VALUES(48, 26, 4, '2014-06-21', '1540', '', 132, 0, 0, NULL, '');
+INSERT INTO `0_gl_trans` VALUES(49, 26, 2, '2014-06-21', '1510', '', -20, 0, 0, NULL, '');
+INSERT INTO `0_gl_trans` VALUES(50, 26, 2, '2014-06-21', '1510', '', -22, 0, 0, NULL, '');
+INSERT INTO `0_gl_trans` VALUES(51, 26, 2, '2014-06-21', '1510', '', -24, 0, 0, NULL, '');
+INSERT INTO `0_gl_trans` VALUES(52, 26, 2, '2014-06-21', '1540', '', 66, 0, 0, NULL, '');
+INSERT INTO `0_gl_trans` VALUES(53, 26, 5, '2014-06-21', '1510', '', -50, 0, 0, NULL, '');
+INSERT INTO `0_gl_trans` VALUES(54, 26, 5, '2014-06-21', '1510', '', -55, 0, 0, NULL, '');
+INSERT INTO `0_gl_trans` VALUES(55, 26, 5, '2014-06-21', '1510', '', -60, 0, 0, NULL, '');
+INSERT INTO `0_gl_trans` VALUES(56, 26, 5, '2014-06-21', '1060', 'Overhead Cost', -10, 0, 0, 1, '1');
+INSERT INTO `0_gl_trans` VALUES(57, 26, 5, '2014-06-21', '1530', 'Overhead Cost', 10, 0, 0, 1, '1');
+INSERT INTO `0_gl_trans` VALUES(58, 26, 5, '2014-06-21', '1060', 'Labour Cost', -20, 0, 0, 1, '0');
+INSERT INTO `0_gl_trans` VALUES(59, 26, 5, '2014-06-21', '1530', 'Labour Cost', 20, 0, 0, 1, '0');
+INSERT INTO `0_gl_trans` VALUES(60, 26, 5, '2014-06-21', '1540', '', 165, 0, 0, NULL, '');
+INSERT INTO `0_gl_trans` VALUES(61, 26, 6, '2014-06-21', '1510', '', 50, 0, 0, NULL, '');
+INSERT INTO `0_gl_trans` VALUES(62, 26, 6, '2014-06-21', '1510', '', 55, 0, 0, NULL, '');
+INSERT INTO `0_gl_trans` VALUES(63, 26, 6, '2014-06-21', '1510', '', 60, 0, 0, NULL, '');
+INSERT INTO `0_gl_trans` VALUES(64, 26, 6, '2014-06-21', '1540', '', -165, 0, 0, NULL, '');
+INSERT INTO `0_gl_trans` VALUES(65, 26, 7, '2014-06-21', '1510', '', 20, 0, 0, NULL, '');
+INSERT INTO `0_gl_trans` VALUES(66, 26, 7, '2014-06-21', '1510', '', 22, 0, 0, NULL, '');
+INSERT INTO `0_gl_trans` VALUES(67, 26, 7, '2014-06-21', '1510', '', 24, 0, 0, NULL, '');
+INSERT INTO `0_gl_trans` VALUES(68, 26, 7, '2014-06-21', '1060', 'Overhead Cost', -10, 0, 0, 1, '1');
+INSERT INTO `0_gl_trans` VALUES(69, 26, 7, '2014-06-21', '1530', 'Overhead Cost', 10, 0, 0, 1, '1');
+INSERT INTO `0_gl_trans` VALUES(70, 26, 7, '2014-06-21', '1060', 'Labour Cost', -20, 0, 0, 1, '0');
+INSERT INTO `0_gl_trans` VALUES(71, 26, 7, '2014-06-21', '1530', 'Labour Cost', 20, 0, 0, 1, '0');
+INSERT INTO `0_gl_trans` VALUES(72, 26, 7, '2014-06-21', '1540', '', -66, 0, 0, NULL, '');
+INSERT INTO `0_gl_trans` VALUES(73, 13, 5, '2014-06-21', '5010', '', 10, 0, 0, 2, '2');
+INSERT INTO `0_gl_trans` VALUES(74, 13, 5, '2014-06-21', '1510', '', -10, 0, 0, 2, '2');
+INSERT INTO `0_gl_trans` VALUES(75, 10, 19, '2014-06-21', '4010', '', -47.62, 0, 0, 2, '2');
+INSERT INTO `0_gl_trans` VALUES(76, 10, 19, '2014-06-21', '1200', '', 55, 0, 0, 2, '2');
+INSERT INTO `0_gl_trans` VALUES(77, 10, 19, '2014-06-21', '4430', '', -5, 0, 0, 2, '2');
+INSERT INTO `0_gl_trans` VALUES(78, 10, 19, '2014-06-21', '2150', '', -2.38, 0, 0, 2, '2');
+INSERT INTO `0_gl_trans` VALUES(79, 11, 3, '2014-06-21', '5010', '', -10, 2, 0, 2, '3');
+INSERT INTO `0_gl_trans` VALUES(80, 11, 3, '2014-06-21', '1510', '', 10, 0, 0, 2, '3');
+INSERT INTO `0_gl_trans` VALUES(81, 11, 3, '2014-06-21', '4010', '', 50, 2, 0, 2, '3');
+INSERT INTO `0_gl_trans` VALUES(82, 11, 3, '2014-06-21', '1200', '', -52.5, 0, 0, 2, '3');
+INSERT INTO `0_gl_trans` VALUES(83, 11, 3, '2014-06-21', '2150', '', 2.5, 0, 0, 2, '3');
 
 -- --------------------------------------------------------
 
@@ -959,7 +954,6 @@ CREATE TABLE IF NOT EXISTS `0_grn_batch` (
   `reference` varchar(60) NOT NULL default '',
   `delivery_date` date NOT NULL default '0000-00-00',
   `loc_code` varchar(5) default NULL,
-  `rate` double NOT NULL default '1',
   PRIMARY KEY  (`id`),
   KEY `delivery_date` (`delivery_date`),
   KEY `purch_order_no` (`purch_order_no`)
@@ -969,7 +963,7 @@ CREATE TABLE IF NOT EXISTS `0_grn_batch` (
 -- Dumping data for table `0_grn_batch`
 --
 
-INSERT INTO `0_grn_batch` VALUES(1, 2, 1, '1', '2009-06-21', 'DEF', '1');
+INSERT INTO `0_grn_batch` VALUES(1, 2, 1, '1', '2014-06-21', 'DEF');
 
 -- --------------------------------------------------------
 
@@ -1112,8 +1106,8 @@ CREATE TABLE IF NOT EXISTS `0_item_units` (
 -- Dumping data for table `0_item_units`
 --
 
-INSERT INTO `0_item_units` VALUES('ea.', 'Each', 0, 0);
-INSERT INTO `0_item_units` VALUES('hrs', 'Hours', 1, 0);
+INSERT INTO `0_item_units` VALUES('each', 'Each', 0, 0);
+INSERT INTO `0_item_units` VALUES('hr', 'Hours', 1, 0);
 
 -- --------------------------------------------------------
 
@@ -1349,8 +1343,8 @@ CREATE TABLE IF NOT EXISTS `0_purch_orders` (
 -- Dumping data for table `0_purch_orders`
 --
 
-INSERT INTO `0_purch_orders` VALUES(1, 2, '', '2009-06-01', '1', '', 'DEF', 'Delivery 1\nDelivery 2\nDelivery 3', 0, 0, 0, 0);
-INSERT INTO `0_purch_orders` VALUES(2, 3, '', '2009-06-21', '2', '', 'DEF', 'Delivery 1\nDelivery 2\nDelivery 3', 0, 0, 0, 0);
+INSERT INTO `0_purch_orders` VALUES(1, 2, '', '2014-06-01', '1', '', 'DEF', 'Delivery 1\nDelivery 2\nDelivery 3', 0, 0, 0, 0);
+INSERT INTO `0_purch_orders` VALUES(2, 3, '', '2014-06-21', '2', '', 'DEF', 'Delivery 1\nDelivery 2\nDelivery 3', 0, 0, 0, 0);
 
 -- --------------------------------------------------------
 
@@ -1380,11 +1374,11 @@ CREATE TABLE IF NOT EXISTS `0_purch_order_details` (
 -- Dumping data for table `0_purch_order_details`
 --
 
-INSERT INTO `0_purch_order_details` VALUES(1, 1, '102', '17inch VGA Monitor', '2009-07-01', 100, 10, 10, 10, 100, 100);
-INSERT INTO `0_purch_order_details` VALUES(2, 1, '103', '32MB VGA Card', '2009-07-01', 100, 11, 11, 11, 100, 100);
-INSERT INTO `0_purch_order_details` VALUES(3, 1, '104', '52x CD Drive', '2009-07-01', 100, 12, 12, 12, 100, 100);
-INSERT INTO `0_purch_order_details` VALUES(4, 2, '102', '17inch VGA Monitor', '2009-07-01', 0, 5, 0, 0, 1, 0);
-INSERT INTO `0_purch_order_details` VALUES(5, 2, '103', '32MB VGA Card', '2009-07-01', 0, 5, 0, 0, 1, 0);
+INSERT INTO `0_purch_order_details` VALUES(1, 1, '102', '17inch VGA Monitor', '2014-07-01', 100, 10, 10, 10, 100, 100);
+INSERT INTO `0_purch_order_details` VALUES(2, 1, '103', '32MB VGA Card', '2014-07-01', 100, 11, 11, 11, 100, 100);
+INSERT INTO `0_purch_order_details` VALUES(3, 1, '104', '52x CD Drive', '2014-07-01', 100, 12, 12, 12, 100, 100);
+INSERT INTO `0_purch_order_details` VALUES(4, 2, '102', '17inch VGA Monitor', '2014-07-01', 0, 5, 0, 0, 1, 0);
+INSERT INTO `0_purch_order_details` VALUES(5, 2, '103', '32MB VGA Card', '2014-07-01', 0, 5, 0, 0, 1, 0);
 
 -- --------------------------------------------------------
 
@@ -1556,11 +1550,11 @@ CREATE TABLE IF NOT EXISTS `0_sales_orders` (
 -- Dumping data for table `0_sales_orders`
 --
 
-INSERT INTO `0_sales_orders` VALUES(1, 30, 1, 0, 1, 1, '1', '', '', '2009-06-21', 2, 1, 'Address 1\nAddress 2\nAddress 3', '', '', 'Beefeater Ltd.', 10, 'DEF', '2009-06-22', 3, 0, 0, 0);
-INSERT INTO `0_sales_orders` VALUES(2, 30, 1, 0, 2, 2, '2', '', '', '2009-06-21', 1, 1, 'Address 1\nAddress 2\nAddress 3', '', '', 'Ghostbusters Corp.', 0, 'DEF', '2009-06-22', 4, 0, 0, 0);
-INSERT INTO `0_sales_orders` VALUES(3, 30, 1, 0, 3, 3, '3', '', '', '2009-06-21', 2, 1, 'Address 1\nAddress 2\nAddress 3', '', '', 'Brezan', 0, 'DEF', '2009-07-01', 3, 0, 0, 0);
-INSERT INTO `0_sales_orders` VALUES(4, 30, 0, 0, 1, 1, '4', '', '', '2009-06-21', 2, 1, 'Address 1\nAddress 2\nAddress 3', '', '', 'Beefeater Ltd.', 0, 'DEF', '2009-06-22', 3, 0, 0, 0);
-INSERT INTO `0_sales_orders` VALUES(5, 30, 1, 0, 2, 2, '5', '', '', '2009-06-21', 1, 1, 'Address 1\nAddress 2\nAddress 3', '', '', 'Ghostbusters Corp.', 5, 'DEF', '2009-06-22', 4, 0, 0, 0);
+INSERT INTO `0_sales_orders` VALUES(1, 30, 1, 0, 1, 1, '1', '', '', '2014-06-21', 2, 1, 'Address 1\nAddress 2\nAddress 3', '', '', 'Beefeater Ltd.', 10, 'DEF', '2014-06-22', 3, 0, 0, 0);
+INSERT INTO `0_sales_orders` VALUES(2, 30, 1, 0, 2, 2, '2', '', '', '2014-06-21', 1, 1, 'Address 1\nAddress 2\nAddress 3', '', '', 'Ghostbusters Corp.', 0, 'DEF', '2014-06-22', 4, 0, 0, 0);
+INSERT INTO `0_sales_orders` VALUES(3, 30, 1, 0, 3, 3, '3', '', '', '2014-06-21', 2, 1, 'Address 1\nAddress 2\nAddress 3', '', '', 'Brezan', 0, 'DEF', '2014-07-01', 3, 0, 0, 0);
+INSERT INTO `0_sales_orders` VALUES(4, 30, 0, 0, 1, 1, '4', '', '', '2014-06-21', 2, 1, 'Address 1\nAddress 2\nAddress 3', '', '', 'Beefeater Ltd.', 0, 'DEF', '2014-06-22', 3, 0, 0, 0);
+INSERT INTO `0_sales_orders` VALUES(5, 30, 1, 0, 2, 2, '5', '', '', '2014-06-21', 1, 1, 'Address 1\nAddress 2\nAddress 3', '', '', 'Ghostbusters Corp.', 5, 'DEF', '2014-06-22', 4, 0, 0, 0);
 
 -- --------------------------------------------------------
 
@@ -1756,7 +1750,7 @@ CREATE TABLE IF NOT EXISTS `0_stock_category` (
 INSERT INTO `0_stock_category` VALUES(1, 'Components', 1, 'each', 'B', '4010', '5010', '1510', '5040', '1530', 0, 0, 0, 0, 0);
 INSERT INTO `0_stock_category` VALUES(2, 'Charges', 1, 'each', 'D', '4010', '5010', '1510', '5040', '1530', 0, 0, 0, 0, 0);
 INSERT INTO `0_stock_category` VALUES(3, 'Systems', 1, 'each', 'M', '4010', '5010', '1510', '5040', '1530', 0, 0, 0, 0, 0);
-INSERT INTO `0_stock_category` VALUES(4, 'Services', 1, 'hrs', 'D', '4010', '5010', '1510', '5040', '1530', 0, 0, 0, 0, 0);
+INSERT INTO `0_stock_category` VALUES(4, 'Services', 1, 'hr', 'D', '4010', '5010', '1510', '5040', '1530', 0, 0, 0, 0, 0);
 
 -- --------------------------------------------------------
 
@@ -1796,11 +1790,11 @@ CREATE TABLE IF NOT EXISTS `0_stock_master` (
 -- Dumping data for table `0_stock_master`
 --
 
-INSERT INTO `0_stock_master` VALUES('102', 1, 1, '17inch VGA Monitor', '', 'ea.', 'B', '4010', '5010', '1510', '5040', '1530', 0, 0, 0, 0, 10, 0, 0, 0, 0, 0, 0);
-INSERT INTO `0_stock_master` VALUES('103', 1, 1, '32MB VGA Card', '', 'ea.', 'B', '4010', '5010', '1510', '5040', '1530', 0, 0, 0, 0, 11, 0, 0, 0, 0, 0, 0);
-INSERT INTO `0_stock_master` VALUES('104', 1, 1, '52x CD Drive', '', 'ea.', 'B', '4010', '5010', '1510', '5040', '1530', 0, 0, 0, 0, 12, 0, 0, 0, 0, 0, 0);
-INSERT INTO `0_stock_master` VALUES('201', 4, 1, 'Assembly Labour', '', 'hrs', 'D', '4010', '5010', '5010', '5040', '1530', 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0);
-INSERT INTO `0_stock_master` VALUES('3400', 3, 1, 'P4 Business System', '', 'ea.', 'M', '4010', '5010', '1540', '5040', '1530', 0, 0, 0, 0, 33, 3.9999999999999, 2, 0, 0, 0, 0);
+INSERT INTO `0_stock_master` VALUES('102', 1, 1, '17inch VGA Monitor', '', 'each', 'B', '4010', '5010', '1510', '5040', '1530', 0, 0, 0, 0, 10, 0, 0, 0, 0, 0, 0);
+INSERT INTO `0_stock_master` VALUES('103', 1, 1, '32MB VGA Card', '', 'each', 'B', '4010', '5010', '1510', '5040', '1530', 0, 0, 0, 0, 11, 0, 0, 0, 0, 0, 0);
+INSERT INTO `0_stock_master` VALUES('104', 1, 1, '52x CD Drive', '', 'each', 'B', '4010', '5010', '1510', '5040', '1530', 0, 0, 0, 0, 12, 0, 0, 0, 0, 0, 0);
+INSERT INTO `0_stock_master` VALUES('201', 4, 1, 'Assembly Labour', '', 'hr', 'D', '4010', '5010', '5010', '5040', '1530', 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0);
+INSERT INTO `0_stock_master` VALUES('3400', 3, 1, 'P4 Business System', '', 'each', 'M', '4010', '5010', '1540', '5040', '1530', 0, 0, 0, 0, 33, 3.9999999999999, 2, 0, 0, 0, 0);
 
 -- --------------------------------------------------------
 
@@ -1832,42 +1826,42 @@ CREATE TABLE IF NOT EXISTS `0_stock_moves` (
 -- Dumping data for table `0_stock_moves`
 --
 
-INSERT INTO `0_stock_moves` VALUES(1, 1, '102', 25, 'DEF', '2009-06-21', 2, 10, '', 100, 0, 10, 1);
-INSERT INTO `0_stock_moves` VALUES(2, 1, '103', 25, 'DEF', '2009-06-21', 2, 11, '', 100, 0, 11, 1);
-INSERT INTO `0_stock_moves` VALUES(3, 1, '104', 25, 'DEF', '2009-06-21', 2, 12, '', 100, 0, 12, 1);
-INSERT INTO `0_stock_moves` VALUES(4, 1, '102', 26, 'DEF', '2009-06-21', 0, 0, '1', -10, 0, 0, 1);
-INSERT INTO `0_stock_moves` VALUES(5, 1, '103', 26, 'DEF', '2009-06-21', 0, 0, '1', -10, 0, 0, 1);
-INSERT INTO `0_stock_moves` VALUES(6, 1, '104', 26, 'DEF', '2009-06-21', 0, 0, '1', -10, 0, 0, 1);
-INSERT INTO `0_stock_moves` VALUES(7, 1, '3400', 26, 'DEF', '2009-06-21', 0, 0, '1', 10, 0, 0, 1);
-INSERT INTO `0_stock_moves` VALUES(8, 2, '102', 13, 'DEF', '2009-06-21', 0, 30.4, '1', -2, 0, 10, 1);
-INSERT INTO `0_stock_moves` VALUES(9, 3, '102', 13, 'DEF', '2009-06-21', 0, 50, 'auto', -1, 0, 10, 1);
-INSERT INTO `0_stock_moves` VALUES(10, 4, '102', 13, 'DEF', '2009-06-21', 0, 35.89, 'auto', -1, 0, 10, 1);
-INSERT INTO `0_stock_moves` VALUES(11, 3, '102', 26, 'DEF', '2009-06-21', 0, 0, '3', -2, 0, 0, 1);
-INSERT INTO `0_stock_moves` VALUES(12, 3, '103', 26, 'DEF', '2009-06-21', 0, 0, '3', -2, 0, 0, 1);
-INSERT INTO `0_stock_moves` VALUES(13, 3, '104', 26, 'DEF', '2009-06-21', 0, 0, '3', -2, 0, 0, 1);
-INSERT INTO `0_stock_moves` VALUES(14, 3, '3400', 26, 'DEF', '2009-06-21', 0, 0, '3', 2, 0, 0, 1);
-INSERT INTO `0_stock_moves` VALUES(15, 4, '102', 26, 'DEF', '2009-06-21', 0, 0, '4', -4, 0, 0, 1);
-INSERT INTO `0_stock_moves` VALUES(16, 4, '103', 26, 'DEF', '2009-06-21', 0, 0, '4', -4, 0, 0, 1);
-INSERT INTO `0_stock_moves` VALUES(17, 4, '104', 26, 'DEF', '2009-06-21', 0, 0, '4', -4, 0, 0, 1);
-INSERT INTO `0_stock_moves` VALUES(18, 4, '3400', 26, 'DEF', '2009-06-21', 0, 0, '4', 4, 0, 0, 1);
-INSERT INTO `0_stock_moves` VALUES(19, 2, '102', 26, 'DEF', '2009-06-21', 0, 0, '', -2, 0, 0, 1);
-INSERT INTO `0_stock_moves` VALUES(20, 2, '103', 26, 'DEF', '2009-06-21', 0, 0, '', -2, 0, 0, 1);
-INSERT INTO `0_stock_moves` VALUES(21, 2, '104', 26, 'DEF', '2009-06-21', 0, 0, '', -2, 0, 0, 1);
-INSERT INTO `0_stock_moves` VALUES(22, 1, '3400', 29, 'DEF', '2009-06-21', 0, 0, '', 2, 0, 0, 1);
-INSERT INTO `0_stock_moves` VALUES(23, 5, '102', 26, 'DEF', '2009-06-21', 0, 0, '5', -5, 0, 0, 1);
-INSERT INTO `0_stock_moves` VALUES(24, 5, '103', 26, 'DEF', '2009-06-21', 0, 0, '5', -5, 0, 0, 1);
-INSERT INTO `0_stock_moves` VALUES(25, 5, '104', 26, 'DEF', '2009-06-21', 0, 0, '5', -5, 0, 0, 1);
-INSERT INTO `0_stock_moves` VALUES(26, 5, '3400', 26, 'DEF', '2009-06-21', 0, 0, '5', 5, 0, 0, 1);
-INSERT INTO `0_stock_moves` VALUES(27, 6, '102', 26, 'DEF', '2009-06-21', 0, 0, '6', 5, 0, 0, 1);
-INSERT INTO `0_stock_moves` VALUES(28, 6, '103', 26, 'DEF', '2009-06-21', 0, 0, '6', 5, 0, 0, 1);
-INSERT INTO `0_stock_moves` VALUES(29, 6, '104', 26, 'DEF', '2009-06-21', 0, 0, '6', 5, 0, 0, 1);
-INSERT INTO `0_stock_moves` VALUES(30, 6, '3400', 26, 'DEF', '2009-06-21', 0, 0, '6', -5, 0, 0, 1);
-INSERT INTO `0_stock_moves` VALUES(31, 7, '102', 26, 'DEF', '2009-06-21', 0, 0, '7', 2, 0, 0, 1);
-INSERT INTO `0_stock_moves` VALUES(32, 7, '103', 26, 'DEF', '2009-06-21', 0, 0, '7', 2, 0, 0, 1);
-INSERT INTO `0_stock_moves` VALUES(33, 7, '104', 26, 'DEF', '2009-06-21', 0, 0, '7', 2, 0, 0, 1);
-INSERT INTO `0_stock_moves` VALUES(34, 7, '3400', 26, 'DEF', '2009-06-21', 0, 0, '7', -2, 0, 0, 1);
-INSERT INTO `0_stock_moves` VALUES(35, 5, '102', 13, 'DEF', '2009-06-21', 0, 50, 'auto', -1, 0, 10, 1);
-INSERT INTO `0_stock_moves` VALUES(36, 3, '102', 11, 'DEF', '2009-06-21', 0, 37.68, 'Return Ex Inv: 18', 1, 0, 10, 0);
+INSERT INTO `0_stock_moves` VALUES(1, 1, '102', 25, 'DEF', '2014-06-21', 2, 10, '', 100, 0, 10, 1);
+INSERT INTO `0_stock_moves` VALUES(2, 1, '103', 25, 'DEF', '2014-06-21', 2, 11, '', 100, 0, 11, 1);
+INSERT INTO `0_stock_moves` VALUES(3, 1, '104', 25, 'DEF', '2014-06-21', 2, 12, '', 100, 0, 12, 1);
+INSERT INTO `0_stock_moves` VALUES(4, 1, '102', 26, 'DEF', '2014-06-21', 0, 0, '1', -10, 0, 0, 1);
+INSERT INTO `0_stock_moves` VALUES(5, 1, '103', 26, 'DEF', '2014-06-21', 0, 0, '1', -10, 0, 0, 1);
+INSERT INTO `0_stock_moves` VALUES(6, 1, '104', 26, 'DEF', '2014-06-21', 0, 0, '1', -10, 0, 0, 1);
+INSERT INTO `0_stock_moves` VALUES(7, 1, '3400', 26, 'DEF', '2014-06-21', 0, 0, '1', 10, 0, 0, 1);
+INSERT INTO `0_stock_moves` VALUES(8, 2, '102', 13, 'DEF', '2014-06-21', 0, 30.4, '1', -2, 0, 10, 1);
+INSERT INTO `0_stock_moves` VALUES(9, 3, '102', 13, 'DEF', '2014-06-21', 0, 50, 'auto', -1, 0, 10, 1);
+INSERT INTO `0_stock_moves` VALUES(10, 4, '102', 13, 'DEF', '2014-06-21', 0, 35.89, 'auto', -1, 0, 10, 1);
+INSERT INTO `0_stock_moves` VALUES(11, 3, '102', 26, 'DEF', '2014-06-21', 0, 0, '3', -2, 0, 0, 1);
+INSERT INTO `0_stock_moves` VALUES(12, 3, '103', 26, 'DEF', '2014-06-21', 0, 0, '3', -2, 0, 0, 1);
+INSERT INTO `0_stock_moves` VALUES(13, 3, '104', 26, 'DEF', '2014-06-21', 0, 0, '3', -2, 0, 0, 1);
+INSERT INTO `0_stock_moves` VALUES(14, 3, '3400', 26, 'DEF', '2014-06-21', 0, 0, '3', 2, 0, 0, 1);
+INSERT INTO `0_stock_moves` VALUES(15, 4, '102', 26, 'DEF', '2014-06-21', 0, 0, '4', -4, 0, 0, 1);
+INSERT INTO `0_stock_moves` VALUES(16, 4, '103', 26, 'DEF', '2014-06-21', 0, 0, '4', -4, 0, 0, 1);
+INSERT INTO `0_stock_moves` VALUES(17, 4, '104', 26, 'DEF', '2014-06-21', 0, 0, '4', -4, 0, 0, 1);
+INSERT INTO `0_stock_moves` VALUES(18, 4, '3400', 26, 'DEF', '2014-06-21', 0, 0, '4', 4, 0, 0, 1);
+INSERT INTO `0_stock_moves` VALUES(19, 2, '102', 26, 'DEF', '2014-06-21', 0, 0, '', -2, 0, 0, 1);
+INSERT INTO `0_stock_moves` VALUES(20, 2, '103', 26, 'DEF', '2014-06-21', 0, 0, '', -2, 0, 0, 1);
+INSERT INTO `0_stock_moves` VALUES(21, 2, '104', 26, 'DEF', '2014-06-21', 0, 0, '', -2, 0, 0, 1);
+INSERT INTO `0_stock_moves` VALUES(22, 1, '3400', 29, 'DEF', '2014-06-21', 0, 0, '', 2, 0, 0, 1);
+INSERT INTO `0_stock_moves` VALUES(23, 5, '102', 26, 'DEF', '2014-06-21', 0, 0, '5', -5, 0, 0, 1);
+INSERT INTO `0_stock_moves` VALUES(24, 5, '103', 26, 'DEF', '2014-06-21', 0, 0, '5', -5, 0, 0, 1);
+INSERT INTO `0_stock_moves` VALUES(25, 5, '104', 26, 'DEF', '2014-06-21', 0, 0, '5', -5, 0, 0, 1);
+INSERT INTO `0_stock_moves` VALUES(26, 5, '3400', 26, 'DEF', '2014-06-21', 0, 0, '5', 5, 0, 0, 1);
+INSERT INTO `0_stock_moves` VALUES(27, 6, '102', 26, 'DEF', '2014-06-21', 0, 0, '6', 5, 0, 0, 1);
+INSERT INTO `0_stock_moves` VALUES(28, 6, '103', 26, 'DEF', '2014-06-21', 0, 0, '6', 5, 0, 0, 1);
+INSERT INTO `0_stock_moves` VALUES(29, 6, '104', 26, 'DEF', '2014-06-21', 0, 0, '6', 5, 0, 0, 1);
+INSERT INTO `0_stock_moves` VALUES(30, 6, '3400', 26, 'DEF', '2014-06-21', 0, 0, '6', -5, 0, 0, 1);
+INSERT INTO `0_stock_moves` VALUES(31, 7, '102', 26, 'DEF', '2014-06-21', 0, 0, '7', 2, 0, 0, 1);
+INSERT INTO `0_stock_moves` VALUES(32, 7, '103', 26, 'DEF', '2014-06-21', 0, 0, '7', 2, 0, 0, 1);
+INSERT INTO `0_stock_moves` VALUES(33, 7, '104', 26, 'DEF', '2014-06-21', 0, 0, '7', 2, 0, 0, 1);
+INSERT INTO `0_stock_moves` VALUES(34, 7, '3400', 26, 'DEF', '2014-06-21', 0, 0, '7', -2, 0, 0, 1);
+INSERT INTO `0_stock_moves` VALUES(35, 5, '102', 13, 'DEF', '2014-06-21', 0, 50, 'auto', -1, 0, 10, 1);
+INSERT INTO `0_stock_moves` VALUES(36, 3, '102', 11, 'DEF', '2014-06-21', 0, 37.68, 'Return Ex Inv: 18', 1, 0, 10, 0);
 
 -- --------------------------------------------------------
 
@@ -1937,7 +1931,7 @@ CREATE TABLE IF NOT EXISTS `0_supp_allocations` (
 -- Dumping data for table `0_supp_allocations`
 --
 
-INSERT INTO `0_supp_allocations` VALUES(1, 3465, '2009-06-21', 4, 22, 7, 20);
+INSERT INTO `0_supp_allocations` VALUES(1, 3465, '2014-06-21', 4, 22, 7, 20);
 
 -- --------------------------------------------------------
 
@@ -1996,7 +1990,9 @@ CREATE TABLE IF NOT EXISTS `0_supp_trans` (
   `tax_included` tinyint(1) NOT NULL default '0',
   `tax_algorithm` tinyint(1) NOT NULL default '1',
   PRIMARY KEY  (`type`,`trans_no`),
-  KEY `supplier_id` (`supplier_id`,`supp_reference`),
+  KEY `supplier_id` (`supplier_id`),
+  KEY `SupplierID_2` (`supplier_id`,`supp_reference`),
+  KEY `type` (`type`),
   KEY `tran_date` (`tran_date`)
 ) ENGINE=InnoDB;
 
@@ -2004,9 +2000,9 @@ CREATE TABLE IF NOT EXISTS `0_supp_trans` (
 -- Dumping data for table `0_supp_trans`
 --
 
-INSERT INTO `0_supp_trans` VALUES(7, 20, 2, '1', '5t', '2009-06-21', '2009-07-01', 3300, 0, 165, 1, 3465, 0, 1);
-INSERT INTO `0_supp_trans` VALUES(8, 20, 2, '2', 'cc', '2009-06-21', '2009-07-01', 20, 0, 0, 1, 0, 0, 1);
-INSERT INTO `0_supp_trans` VALUES(4, 22, 2, '1', '', '2009-06-21', '2009-06-21', -3465, 0, 0, 1, 3465, 0, 1);
+INSERT INTO `0_supp_trans` VALUES(7, 20, 2, '1', '5t', '2014-06-21', '2014-07-01', 3300, 0, 165, 1, 3465, 0, 1);
+INSERT INTO `0_supp_trans` VALUES(8, 20, 2, '2', 'cc', '2014-06-21', '2014-07-01', 20, 0, 0, 1, 0, 0, 1);
+INSERT INTO `0_supp_trans` VALUES(4, 22, 2, '1', '', '2014-06-21', '2014-06-21', -3465, 0, 0, 1, 3465, 0, 1);
 
 -- --------------------------------------------------------
 
@@ -2042,7 +2038,7 @@ INSERT INTO `0_sys_prefs` VALUES('coy_logo', 'setup.company', 'varchar', 100, 'l
 INSERT INTO `0_sys_prefs` VALUES('domicile', 'setup.company', 'varchar', 55, '');
 INSERT INTO `0_sys_prefs` VALUES('curr_default', 'setup.company', 'char', 3, 'USD');
 INSERT INTO `0_sys_prefs` VALUES('use_dimension', 'setup.company', 'tinyint', 1, '1');
-INSERT INTO `0_sys_prefs` VALUES('f_year', 'setup.company', 'int', 11, '6');
+INSERT INTO `0_sys_prefs` VALUES('f_year', 'setup.company', 'int', 11, '2');
 INSERT INTO `0_sys_prefs` VALUES('no_item_list', 'setup.company', 'tinyint', 1, '0');
 INSERT INTO `0_sys_prefs` VALUES('no_customer_list', 'setup.company', 'tinyint', 1, '0');
 INSERT INTO `0_sys_prefs` VALUES('no_supplier_list', 'setup.company', 'tinyint', 1, '0');
@@ -2260,17 +2256,17 @@ CREATE TABLE IF NOT EXISTS `0_trans_tax_details` (
 -- Dumping data for table `0_trans_tax_details`
 --
 
-INSERT INTO `0_trans_tax_details` VALUES(1, 20, 7, '2009-06-21', 1, 5, 1, 0, 3300, 165, '5t');
-INSERT INTO `0_trans_tax_details` VALUES(2, 13, 3, '2009-06-21', 1, 5, 1, 0, 50, 2.5, 'auto');
-INSERT INTO `0_trans_tax_details` VALUES(3, 10, 17, '2009-06-21', 1, 5, 1, 0, 50, 2.5, '1');
-INSERT INTO `0_trans_tax_details` VALUES(4, 13, 4, '2009-06-21', 1, 5, 1.3932, 0, 35.89, 1.7945, 'auto');
-INSERT INTO `0_trans_tax_details` VALUES(5, 10, 18, '2009-06-21', 1, 5, 1.3932, 0, 35.89, 1.7945, '2');
-INSERT INTO `0_trans_tax_details` VALUES(6, 2, 5, '2009-06-21', 1, 5, 1, 0, 95.2, 4.76, '');
-INSERT INTO `0_trans_tax_details` VALUES(7, 1, 8, '2009-06-21', 1, 5, 1, 0, -47.6, -2.38, '');
-INSERT INTO `0_trans_tax_details` VALUES(8, 20, 8, '2009-06-21', 1, 5, 1, 0, -19, -0.95, 'cc');
-INSERT INTO `0_trans_tax_details` VALUES(9, 13, 5, '2009-06-21', 1, 5, 1, 1, 47.619047619048, 2.3809523809524, 'auto');
-INSERT INTO `0_trans_tax_details` VALUES(10, 10, 19, '2009-06-21', 1, 5, 1, 1, 47.619047619048, 2.3809523809524, '3');
-INSERT INTO `0_trans_tax_details` VALUES(11, 11, 3, '2009-06-21', 1, 5, 1.3932, 0, 35.89, 1.7945, '1');
+INSERT INTO `0_trans_tax_details` VALUES(1, 20, 7, '2014-06-21', 1, 5, 1, 0, 3300, 165, '5t');
+INSERT INTO `0_trans_tax_details` VALUES(2, 13, 3, '2014-06-21', 1, 5, 1, 0, 50, 2.5, 'auto');
+INSERT INTO `0_trans_tax_details` VALUES(3, 10, 17, '2014-06-21', 1, 5, 1, 0, 50, 2.5, '1');
+INSERT INTO `0_trans_tax_details` VALUES(4, 13, 4, '2014-06-21', 1, 5, 1.3932, 0, 35.89, 1.7945, 'auto');
+INSERT INTO `0_trans_tax_details` VALUES(5, 10, 18, '2014-06-21', 1, 5, 1.3932, 0, 35.89, 1.7945, '2');
+INSERT INTO `0_trans_tax_details` VALUES(6, 2, 5, '2014-06-21', 1, 5, 1, 0, 95.2, 4.76, '');
+INSERT INTO `0_trans_tax_details` VALUES(7, 1, 8, '2014-06-21', 1, 5, 1, 0, -47.6, -2.38, '');
+INSERT INTO `0_trans_tax_details` VALUES(8, 20, 8, '2014-06-21', 1, 5, 1, 0, -19, -0.95, 'cc');
+INSERT INTO `0_trans_tax_details` VALUES(9, 13, 5, '2014-06-21', 1, 5, 1, 1, 47.619047619048, 2.3809523809524, 'auto');
+INSERT INTO `0_trans_tax_details` VALUES(10, 10, 19, '2014-06-21', 1, 5, 1, 1, 47.619047619048, 2.3809523809524, '3');
+INSERT INTO `0_trans_tax_details` VALUES(11, 11, 3, '2014-06-21', 1, 5, 1.3932, 0, 35.89, 1.7945, '1');
 
 -- --------------------------------------------------------
 
@@ -2324,10 +2320,10 @@ CREATE TABLE IF NOT EXISTS `0_users` (
   `show_codes` tinyint(1) NOT NULL default '0',
   `show_hints` tinyint(1) NOT NULL default '0',
   `last_visit_date` datetime default NULL,
-  `query_size` tinyint(1) unsigned default '10',
+  `query_size` tinyint(1) unsigned NOT NULL default '10',
   `graphic_links` tinyint(1) default '1',
   `pos` smallint(6) default '1',
-  `print_profile` varchar(30) NOT NULL default '1',
+  `print_profile` varchar(30) NOT NULL default '',
   `rep_popup` tinyint(1) default '1',
   `sticky_doc_date` tinyint(1) default '0',
   `startup_tab` varchar(20) NOT NULL default '',
@@ -2341,8 +2337,8 @@ CREATE TABLE IF NOT EXISTS `0_users` (
 -- Dumping data for table `0_users`
 --
 
-INSERT INTO `0_users` VALUES(1, 'admin', '5f4dcc3b5aa765d61d8327deb882cf99', 'Administrator', 2, '', 'adm@adm.com', 'en_US', 0, 0, 0, 0, 'default', 'Letter', 2, 2, 4, 1, 1, 0, 0, '2010-05-11 23:27:46', 10, 1, 1, '1', 1, 0, 'orders', 30, 0);
-INSERT INTO `0_users` VALUES(2, 'demouser', '5f4dcc3b5aa765d61d8327deb882cf99', 'Demo User', 9, '999-999-999', 'demo@demo.nu', 'en_US', 0, 0, 0, 0, 'default', 'Letter', 2, 2, 3, 1, 1, 0, 0, '2008-02-06 19:02:35', 10, 1, 1, '1', 1, 0, 'orders', 30, 0);
+INSERT INTO `0_users` VALUES(1, 'admin', '5f4dcc3b5aa765d61d8327deb882cf99', 'Administrator', 2, '', 'adm@adm.com', 'en_US', 0, 0, 0, 0, 'default', 'Letter', 2, 2, 4, 1, 1, 0, 0, '2014-05-11 23:27:46', 10, 1, 1, '1', 1, 0, 'orders', 30, 0);
+INSERT INTO `0_users` VALUES(2, 'demouser', '5f4dcc3b5aa765d61d8327deb882cf99', 'Demo User', 9, '999-999-999', 'demo@demo.nu', 'en_US', 0, 0, 0, 0, 'default', 'Letter', 2, 2, 3, 1, 1, 0, 0, '2014-02-06 19:02:35', 10, 1, 1, '1', 1, 0, 'orders', 30, 0);
 
 -- --------------------------------------------------------
 
@@ -2415,13 +2411,13 @@ CREATE TABLE IF NOT EXISTS `0_workorders` (
 -- Dumping data for table `0_workorders`
 --
 
-INSERT INTO `0_workorders` VALUES(1, '1', 'DEF', 10, '3400', '2009-06-21', 0, '2009-06-21', '2009-06-21', 10, 1, 1, 10);
-INSERT INTO `0_workorders` VALUES(2, '2', 'DEF', 3, '3400', '2009-06-21', 2, '2009-07-11', '2009-06-21', 2, 0, 1, 0);
-INSERT INTO `0_workorders` VALUES(3, '3', 'DEF', 2, '3400', '2009-06-21', 0, '2009-06-21', '2009-06-21', 2, 1, 1, 0);
-INSERT INTO `0_workorders` VALUES(4, '4', 'DEF', 4, '3400', '2009-06-21', 0, '2009-06-21', '2009-06-21', 4, 1, 1, 0);
-INSERT INTO `0_workorders` VALUES(5, '5', 'DEF', 5, '3400', '2009-06-21', 0, '2009-06-21', '2009-06-21', 5, 1, 1, 10);
-INSERT INTO `0_workorders` VALUES(6, '6', 'DEF', -5, '3400', '2009-06-21', 1, '2009-06-21', '2009-06-21', -5, 1, 1, 0);
-INSERT INTO `0_workorders` VALUES(7, '7', 'DEF', -2, '3400', '2009-06-21', 1, '2009-06-21', '2009-06-21', -2, 1, 1, 10);
+INSERT INTO `0_workorders` VALUES(1, '1', 'DEF', 10, '3400', '2014-06-21', 0, '2014-06-21', '2014-06-21', 10, 1, 1, 10);
+INSERT INTO `0_workorders` VALUES(2, '2', 'DEF', 3, '3400', '2014-06-21', 2, '2014-07-11', '2014-06-21', 2, 0, 1, 0);
+INSERT INTO `0_workorders` VALUES(3, '3', 'DEF', 2, '3400', '2014-06-21', 0, '2014-06-21', '2014-06-21', 2, 1, 1, 0);
+INSERT INTO `0_workorders` VALUES(4, '4', 'DEF', 4, '3400', '2014-06-21', 0, '2014-06-21', '2014-06-21', 4, 1, 1, 0);
+INSERT INTO `0_workorders` VALUES(5, '5', 'DEF', 5, '3400', '2014-06-21', 0, '2014-06-21', '2014-06-21', 5, 1, 1, 10);
+INSERT INTO `0_workorders` VALUES(6, '6', 'DEF', -5, '3400', '2014-06-21', 1, '2014-06-21', '2014-06-21', -5, 1, 1, 0);
+INSERT INTO `0_workorders` VALUES(7, '7', 'DEF', -2, '3400', '2014-06-21', 1, '2014-06-21', '2014-06-21', -2, 1, 1, 10);
 
 -- --------------------------------------------------------
 
@@ -2509,7 +2505,7 @@ CREATE TABLE IF NOT EXISTS `0_wo_manufacture` (
 -- Dumping data for table `0_wo_manufacture`
 --
 
-INSERT INTO `0_wo_manufacture` VALUES(1, '1', 2, 2, '2009-06-21');
+INSERT INTO `0_wo_manufacture` VALUES(1, '1', 2, 2, '2014-06-21');
 
 -- --------------------------------------------------------
 
index ad688605856da3d494262de8eb91f1ad46a26072..7e77cb89eef20422155ce72bf8101b6dbcd34bc5 100644 (file)
@@ -3,7 +3,7 @@
 -- http://www.phpmyadmin.net
 --
 -- Host: localhost
--- Generation Time: May 11, 2010 at 11:37 PM
+-- Generation Time: Sep 26, 2014 at 11:37 AM
 -- Server version: 5.0.51
 -- PHP Version: 5.2.6-1+lenny2
 
@@ -576,6 +576,7 @@ CREATE TABLE IF NOT EXISTS `0_cust_branch` (
   `bank_account` varchar(60) DEFAULT NULL,
   `inactive` tinyint(1) NOT NULL default '0',
   PRIMARY KEY  (`branch_code`,`debtor_no`),
+  KEY `branch_code` (`branch_code`),
   KEY `branch_ref` (`branch_ref`),
   KEY `group_no` (`group_no`)
 ) ENGINE=MyISAM AUTO_INCREMENT=1 ;
@@ -755,18 +756,14 @@ CREATE TABLE IF NOT EXISTS `0_fiscal_year` (
   PRIMARY KEY  (`id`),
   UNIQUE KEY `begin` (`begin`),
   UNIQUE KEY `end` (`end`)
-) ENGINE=InnoDB  AUTO_INCREMENT=4 ;
+) ENGINE=InnoDB  AUTO_INCREMENT=3 ;
 
 --
 -- Dumping data for table `0_fiscal_year`
 --
 
-INSERT INTO `0_fiscal_year` VALUES(1, '2008-01-01', '2008-12-31', 0);
-INSERT INTO `0_fiscal_year` VALUES(2, '2009-01-01', '2009-12-31', 0);
-INSERT INTO `0_fiscal_year` VALUES(3, '2010-01-01', '2010-12-31', 0);
-INSERT INTO `0_fiscal_year` VALUES(4, '2011-01-01', '2011-12-31', 0);
-INSERT INTO `0_fiscal_year` VALUES(5, '2012-01-01', '2012-12-31', 0);
-INSERT INTO `0_fiscal_year` VALUES(6, '2013-01-01', '2013-12-31', 0);
+INSERT INTO `0_fiscal_year` VALUES(1, '2013-01-01', '2013-12-31', 0);
+INSERT INTO `0_fiscal_year` VALUES(2, '2014-01-01', '2014-12-31', 0);
 
 --
 -- Table structure for table `0_gl_trans`
@@ -812,7 +809,6 @@ CREATE TABLE IF NOT EXISTS `0_grn_batch` (
   `reference` varchar(60) NOT NULL default '',
   `delivery_date` date NOT NULL default '0000-00-00',
   `loc_code` varchar(5) default NULL,
-  `rate` double NOT NULL default '1',
   PRIMARY KEY  (`id`),
   KEY `delivery_date` (`delivery_date`),
   KEY `purch_order_no` (`purch_order_no`)
@@ -956,7 +952,8 @@ CREATE TABLE IF NOT EXISTS `0_item_units` (
 -- Dumping data for table `0_item_units`
 --
 
-INSERT INTO `0_item_units` VALUES('ea.', 'Each', 0, 0);
+INSERT INTO `0_item_units` VALUES('each', 'Each', 0, 0);
+INSERT INTO `0_item_units` VALUES('hr', 'Hours', 0, 0);
 
 -- --------------------------------------------------------
 
@@ -1568,8 +1565,7 @@ CREATE TABLE IF NOT EXISTS `0_stock_category` (
 INSERT INTO `0_stock_category` VALUES(1, 'Components', 1, 'each', 'B', '4010', '5010', '1510', '5040', '1530', 0, 0, 0, 0, 0);
 INSERT INTO `0_stock_category` VALUES(2, 'Charges', 1, 'each', 'D', '4010', '5010', '1510', '5040', '1530', 0, 0, 0, 0, 0);
 INSERT INTO `0_stock_category` VALUES(3, 'Systems', 1, 'each', 'M', '4010', '5010', '1510', '5040', '1530', 0, 0, 0, 0, 0);
-INSERT INTO `0_stock_category` VALUES(4, 'Services', 1, 'hrs', 'D', '4010', '5010', '1510', '5040', '1530', 0, 0, 0, 0, 0);
-
+INSERT INTO `0_stock_category` VALUES(4, 'Services', 1, 'hr', 'D', '4010', '5010', '1510', '5040', '1530', 0, 0, 0, 0, 0);
 -- --------------------------------------------------------
 
 --
@@ -1758,7 +1754,9 @@ CREATE TABLE IF NOT EXISTS `0_supp_trans` (
   `tax_included` tinyint(1) NOT NULL default '0',
   `tax_algorithm` tinyint(1) NOT NULL default '1',
   PRIMARY KEY  (`type`,`trans_no`),
-  KEY `supplier_id` (`supplier_id`,`supp_reference`),
+  KEY `supplier_id` (`supplier_id`),
+  KEY `SupplierID_2` (`supplier_id`,`supp_reference`),
+  KEY `type` (`type`),
   KEY `tran_date` (`tran_date`)
 ) ENGINE=InnoDB;
 
@@ -1801,7 +1799,7 @@ INSERT INTO `0_sys_prefs` VALUES('coy_logo', 'setup.company', 'varchar', 100, ''
 INSERT INTO `0_sys_prefs` VALUES('domicile', 'setup.company', 'varchar', 55, '');
 INSERT INTO `0_sys_prefs` VALUES('curr_default', 'setup.company', 'char', 3, 'USD');
 INSERT INTO `0_sys_prefs` VALUES('use_dimension', 'setup.company', 'tinyint', 1, '1');
-INSERT INTO `0_sys_prefs` VALUES('f_year', 'setup.company', 'int', 11, '6');
+INSERT INTO `0_sys_prefs` VALUES('f_year', 'setup.company', 'int', 11, '2');
 INSERT INTO `0_sys_prefs` VALUES('no_item_list', 'setup.company', 'tinyint', 1, '0');
 INSERT INTO `0_sys_prefs` VALUES('no_customer_list', 'setup.company', 'tinyint', 1, '0');
 INSERT INTO `0_sys_prefs` VALUES('no_supplier_list', 'setup.company', 'tinyint', 1, '0');
@@ -2072,10 +2070,10 @@ CREATE TABLE IF NOT EXISTS `0_users` (
   `show_codes` tinyint(1) NOT NULL default '0',
   `show_hints` tinyint(1) NOT NULL default '0',
   `last_visit_date` datetime default NULL,
-  `query_size` tinyint(1) unsigned default '10',
+  `query_size` tinyint(1) unsigned NOT NULL default '10',
   `graphic_links` tinyint(1) default '1',
   `pos` smallint(6) default '1',
-  `print_profile` varchar(30) NOT NULL default '1',
+  `print_profile` varchar(30) NOT NULL default '',
   `rep_popup` tinyint(1) default '1',
   `sticky_doc_date` tinyint(1) default '0',
   `startup_tab` varchar(20) NOT NULL default '',
index 3b3596a30aec30e05549d3788a394d1d6184c266..e558bfcdc431e511405cf5f5a335c2c21a632c12 100644 (file)
@@ -43,7 +43,7 @@ input, select {
 }
 
 select {
-    max-width: 200px;
+    max-width: 230px;
 }
 
 option.inactive {
index aad3058aecf1e1f9e453becd1ada71fdf3c92e24..c37e539b5d64ff6c91c34132c277dba2bd518f6f 100644 (file)
@@ -43,7 +43,7 @@ input, select {
 }
 
 select {
-    max-width: 200px;
+    max-width: 230px;
 }
 
 option.inactive {
index c21a8486e16c71cd7763bdedc0c66f8526060e5a..535412e4f0baa4b5e75a3b5d6bc99b6cbe66fb0e 100644 (file)
@@ -43,7 +43,7 @@ input, select {
 }
 
 select {
-    max-width: 200px;
+    max-width: 230px;
 }
 
 option.inactive {
index de7eaa6502d6c6345322b9d74eb782d0a69ad41f..fd0d0fd386cb66b044be8c7aa39a3d843b4951c5 100644 (file)
@@ -1,14 +1,61 @@
 <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
 <html><head>\r
+\r
+\r
+\r
+\r
+\r
 <meta http-equiv="CONTENT-TYPE" content="text/html; charset=iso-8859-1"><title>FrontAccounting Update</title>\r
 \r
 <meta name="GENERATOR" content="OpenOffice.org 2.4 (Linux)">\r
 <meta name="CREATED" content="0;0">\r
-<meta name="CHANGED" content="20100902;19041400"></head>\r
-<body style="direction: ltr;" lang="en-US">\r
+<meta name="CHANGED" content="20100902;19041400"></head><body style="direction: ltr;" lang="en-US">\r
 <h4><strong><font color="#cc6600"><font style="font-size: 20pt;" size="5"><i>Front</i></font></font></strong><strong><font style="font-size: 20pt;" size="5">Accounting\r
 Update</font></strong></h4>\r
-<h2>Important Notes for release 2.3.16.</h2>\r
+<h2>Important Notes for release 2.3.22.</h2>\r
+\r
+\r
+<h4>New global flags in config.php (config-default.php):</h4>\r
+/* Show average costed values instead of fixed standard cost */ In Enventory Valuation Report.<br>\r
+<span style="font-weight: bold;">$use_costed_values = 0;</span><br>\r
+<br>\r
+/* Print Item Images on Sales Quotations. Set to 1 if so. */<br>\r
+<span style="font-weight: bold;">$print_item_images_on_quote = 0;</span><br>\r
+<h2>Important Notes for release 2.3.21.</h2>\r
+\r
+\r
+\r
+\r
+<h4>Crucial security patches:</h4>\r
+\r
+This version consists of crucial security patches and this applies especially to all publicly available servers, <br>\r
+&nbsp;f.i. installations which are run in not fully trusted environment like public demos, shared accounts or SAAS.<br>\r
+<h4>New global flags in config.php (config-default.php):</h4>\r
+/* Whether to allow sending new password by e-mail */<br>\r
+<span style="font-weight: bold;">$allow_password_reset = false</span><h2>Important Notes for release 2.3.20.</h2>\r
+\r
+\r
+<h4>Crucial security patches:</h4>\r
+This version consists of crucial security patches and all guest FA\r
+installations (I mean whenever FA is run in not fully trusted\r
+environment) should be updtaed.<br>\r
+<h2>Important Notes for release 2.3.17.</h2>\r
+\r
+<h4>New global flags in config.php (config-default.php):</h4>\r
+/*<br>\r
+&nbsp;&nbsp;&nbsp; Choose Exchange Rate Provider<br>\r
+&nbsp;&nbsp;&nbsp; Default is ECB for backwards compatibility<br>\r
+*/<br>\r
+<span style="font-weight: bold;">$xr_providers = array("ECB", "YAHOO", "GOOGLE", "BLOOMBERG");<br>\r
+$dflt_xr_provider = 0;<br>\r
+<br>\r
+</span>/*<br>\r
+&nbsp;&nbsp;&nbsp; Set to true when remote service is authoritative\r
+source of exchange rates, and can be stored automatically without<br>\r
+&nbsp;&nbsp;&nbsp; manual edition. Otherwise exrate is stored on first new currency transaction of the day.<br>\r
+*/<br>\r
+<span style="font-weight: bold;">$xr_provider_authoritative = false;<br>\r
+</span><h2>Important Notes for release 2.3.16.</h2>\r
 <h4>New global flags in config.php (config-default.php):</h4><span style="font-weight: bold;">/*<br>&nbsp;&nbsp; </span>&nbsp;Optional sorting new sales documents lines according to item code<span style="font-weight: bold;"><br>*/<br>$sort_sales_items = false;<br><br>/*<br>&nbsp;&nbsp; &nbsp;</span>Trial Balance opening balance presentation option.<br>&nbsp;&nbsp; &nbsp;When set to true past years part of opening balance is cleared.<span style="font-weight: bold;"><br>*/<br>$clear_trial_balance_opening = false;</span><h2>Important Notes for release 2.3.14.</h2>\r
 <h4>New global flags in config.php (config-default.php):</h4>\r
 /* default print orientation. 0 = Portrait, 1 = Landscape */<br>\r
@@ -84,8 +131,8 @@ considered as a site admin who have granted access to potentially
 dangerous setup options, like Setup/Software Upgrade.</p>\r
 <p>In the following description sections related to older FA\r
 versions are\r
-prefixed with <span style="background: rgb(235, 97, 61) none repeat scroll 0% 50%; -moz-background-clip: initial; -moz-background-origin: initial; -moz-background-inline-policy: initial;">[color\r
-tags]</span><span style="background: transparent none repeat scroll 0% 50%; -moz-background-clip: initial; -moz-background-origin: initial; -moz-background-inline-policy: initial;">\r
+prefixed with <span style="background: rgb(235, 97, 61) none repeat scroll 0% 50%; -moz-background-clip: -moz-initial; -moz-background-origin: -moz-initial; -moz-background-inline-policy: -moz-initial;">[color\r
+tags]</span><span style="background: transparent none repeat scroll 0% 50%; -moz-background-clip: -moz-initial; -moz-background-origin: -moz-initial; -moz-background-inline-policy: -moz-initial;">\r
 . Y</span>ou can skip tagged fragment safely if currently FA\r
 application is newer than the version in tag.</p>\r
 <p>Upgrade process consists of up to four stages, some of them\r
@@ -135,7 +182,7 @@ old
 add all n</span></span></strong><strong><span style="">ew\r
 settings (if any). </span></strong>\r
 </p>\r
-<p><strong><span style=""><span style="background: rgb(235, 97, 61) none repeat scroll 0% 50%; -moz-background-clip: initial; -moz-background-origin: initial; -moz-background-inline-policy: initial;">[&lt;FA\r
+<p><strong><span style=""><span style="background: rgb(235, 97, 61) none repeat scroll 0% 50%; -moz-background-clip: -moz-initial; -moz-background-origin: -moz-initial; -moz-background-inline-policy: -moz-initial;">[&lt;FA\r
 2.2beta]</span></span></strong></p>\r
 <p><strong> <span style="">$show_users_online\r
 = 0;</span></strong></p>\r
@@ -145,12 +192,12 @@ settings (if any). </span></strong>
 <p><strong><span style="">$dflt_date_sep=0;</span></strong></p>\r
 <p><strong><span style="">$table_style,table_style2\r
 changed</span></strong></p>\r
-<p><strong><span style=""><span style="background: rgb(235, 97, 61) none repeat scroll 0% 50%; -moz-background-clip: initial; -moz-background-origin: initial; -moz-background-inline-policy: initial;">[&lt;FA\r
+<p><strong><span style=""><span style="background: rgb(235, 97, 61) none repeat scroll 0% 50%; -moz-background-clip: -moz-initial; -moz-background-origin: -moz-initial; -moz-background-inline-policy: -moz-initial;">[&lt;FA\r
 2.3beta]</span></span></strong></p>\r
 <p><strong> <span style="">$alternative_tax_include_on_doc=0;</span></strong></p>\r
 <p><strong><span style="">$suppress_tax_rates\r
 = 0;</span></strong></p>\r
-<p><strong><span style=""><span style="background: rgb(235, 97, 61) none repeat scroll 0% 50%; -moz-background-clip: initial; -moz-background-origin: initial; -moz-background-inline-policy: initial;">[&lt;FA\r
+<p><strong><span style=""><span style="background: rgb(235, 97, 61) none repeat scroll 0% 50%; -moz-background-clip: -moz-initial; -moz-background-origin: -moz-initial; -moz-background-inline-policy: -moz-initial;">[&lt;FA\r
 2.3RC1]</span></span></strong><strong> </strong>\r
 </p>\r
 <p><strong><span style="">Application version\r
@@ -161,12 +208,12 @@ application version displayed in footer is defined in $version
 variable unless this is set in config.php file. If you want current\r
 release version to be displayed on every FA update just remove or\r
 comment out $version variable in </span></strong><strong><span style="font-style: normal;"><span style="">config.php</span></span></strong><strong><span style="">.</span></strong></p>\r
-<p><strong><span style=""><span style="background: rgb(235, 97, 61) none repeat scroll 0% 50%; -moz-background-clip: initial; -moz-background-origin: initial; -moz-background-inline-policy: initial;">[&lt;FA\r
+<p><strong><span style=""><span style="background: rgb(235, 97, 61) none repeat scroll 0% 50%; -moz-background-clip: -moz-initial; -moz-background-origin: -moz-initial; -moz-background-inline-policy: -moz-initial;">[&lt;FA\r
 2.3RC2]</span></span></strong></p>\r
 <p><strong> <span style="">$save_report_selections\r
 &nbsp;= 0; &nbsp;// A value &gt; 0 means days to save the\r
 report selections.</span></strong></p>\r
-<p><strong><span style=""><span style="background: rgb(235, 97, 61) none repeat scroll 0% 50%; -moz-background-clip: initial; -moz-background-origin: initial; -moz-background-inline-policy: initial;">[&lt;FA\r
+<p><strong><span style=""><span style="background: rgb(235, 97, 61) none repeat scroll 0% 50%; -moz-background-clip: -moz-initial; -moz-background-origin: -moz-initial; -moz-background-inline-policy: -moz-initial;">[&lt;FA\r
 2.3]</span></span></strong></p>\r
 <p><strong> <span style="">$save_po_item_codes\r
 &nbsp;= 0; &nbsp;//&nbsp; show item codes on purchase\r
@@ -178,7 +225,7 @@ order&nbsp;</span></strong></p>
 included</span></strong></p>\r
 <p><strong><span style="">$suppress_tax_rates\r
 = 0; // &nbsp;suppress tax rates on documents. 0 = no, 1 = yes.</span></strong></p>\r
-<strong><span style=""><span style="background: rgb(235, 97, 61) none repeat scroll 0% 50%; -moz-background-clip: initial; -moz-background-origin: initial; -moz-background-inline-policy: initial;"></span></span></strong><strong><span style=""><span style="background: rgb(235, 97, 61) none repeat scroll 0% 50%; -moz-background-clip: initial; -moz-background-origin: initial; -moz-background-inline-policy: initial;"></span></span></strong>\r
+<strong><span style=""><span style="background: rgb(235, 97, 61) none repeat scroll 0% 50%; -moz-background-clip: -moz-initial; -moz-background-origin: -moz-initial; -moz-background-inline-policy: -moz-initial;"></span></span></strong><strong><span style=""><span style="background: rgb(235, 97, 61) none repeat scroll 0% 50%; -moz-background-clip: -moz-initial; -moz-background-origin: -moz-initial; -moz-background-inline-policy: -moz-initial;"></span></span></strong>\r
 <h2><strong><b>2. Database upgrade</b></strong></h2>\r
 <p><strong><span style="">This step can be\r
 skipped\r
@@ -212,11 +259,11 @@ be removed from </span></span><i><b>config.php</b></i><span style="font-style: n
 file.</span></span></p>\r
 <p style="margin-top: 0.42cm; page-break-after: avoid;"><font face="Liberation Sans, sans-serif"><font size="4">a.\r
 Source files cleanup</font></font></p>\r
-<p><strong><span style=""><span style="background: rgb(235, 97, 61) none repeat scroll 0% 50%; -moz-background-clip: initial; -moz-background-origin: initial; -moz-background-inline-policy: initial;">[&lt;FA\r
+<p><strong><span style=""><span style="background: rgb(235, 97, 61) none repeat scroll 0% 50%; -moz-background-clip: -moz-initial; -moz-background-origin: -moz-initial; -moz-background-inline-policy: -moz-initial;">[&lt;FA\r
 2.2beta]</span></span></strong></p>\r
-<p><strong><span style=""><span style="background: transparent none repeat scroll 0% 50%; -moz-background-clip: initial; -moz-background-origin: initial; -moz-background-inline-policy: initial;">/includes/reserved.inc\r
+<p><strong><span style=""><span style="background: transparent none repeat scroll 0% 50%; -moz-background-clip: -moz-initial; -moz-background-origin: -moz-initial; -moz-background-inline-policy: -moz-initial;">/includes/reserved.inc\r
 &#8211; removed.</span></span></strong></p>\r
-<p><strong><span style=""><span style="background: rgb(235, 97, 61) none repeat scroll 0% 50%; -moz-background-clip: initial; -moz-background-origin: initial; -moz-background-inline-policy: initial;">[&lt;FA\r
+<p><strong><span style=""><span style="background: rgb(235, 97, 61) none repeat scroll 0% 50%; -moz-background-clip: -moz-initial; -moz-background-origin: -moz-initial; -moz-background-inline-policy: -moz-initial;">[&lt;FA\r
 2.1]</span></span></strong><strong> </strong>\r
 </p>\r
 <p><strong><span style="">/admin/db/v_banktrans.inc\r
@@ -224,7 +271,7 @@ Source files cleanup</font></font></p>
 <p style="margin-top: 0.42cm; page-break-after: avoid;"><font face="Liberation Sans, sans-serif"><font size="4"><span style="font-style: normal;"><span style="">b.\r
 Config.php cleanup </span></span></font></font>\r
 </p>\r
-<p><strong><span style=""><span style="background: rgb(235, 97, 61) none repeat scroll 0% 50%; -moz-background-clip: initial; -moz-background-origin: initial; -moz-background-inline-policy: initial;">[&lt;FA\r
+<p><strong><span style=""><span style="background: rgb(235, 97, 61) none repeat scroll 0% 50%; -moz-background-clip: -moz-initial; -moz-background-origin: -moz-initial; -moz-background-inline-policy: -moz-initial;">[&lt;FA\r
 2.2RC1]</span></span></strong><strong> </strong>\r
 </p>\r
 <p><strong><span style="">$security_headings,\r