From 525900c5c198cbfd5a2af651e114218302610222 Mon Sep 17 00:00:00 2001 From: Rohit Waghchaure Date: Wed, 7 Sep 2016 15:01:08 +0530 Subject: [PATCH 1/3] [Fix] Item level taxes are not getting calculated in POS --- erpnext/accounts/page/pos/pos.js | 1 + 1 file changed, 1 insertion(+) diff --git a/erpnext/accounts/page/pos/pos.js b/erpnext/accounts/page/pos/pos.js index 5947bde878..9a121267b4 100644 --- a/erpnext/accounts/page/pos/pos.js +++ b/erpnext/accounts/page/pos/pos.js @@ -614,6 +614,7 @@ erpnext.pos.PointOfSale = erpnext.taxes_and_totals.extend({ this.child.batch_no = this.item_batch_no[this.child.item_code]; this.child.serial_no = (this.item_serial_no[this.child.item_code] ? this.item_serial_no[this.child.item_code][0] : ''); + this.child.item_tax_rate = this.items[0].taxes; }, update_paid_amount_status: function(update_paid_amount){ From 23147ff8817f88236189f8f8a333985a95ad0151 Mon Sep 17 00:00:00 2001 From: Nabin Hait Date: Wed, 7 Sep 2016 16:31:26 +0530 Subject: [PATCH 2/3] Patch fixed --- .../payment_entry_reference.json | 2 +- .../v7_0/convert_timelog_to_timesheet.py | 4 ++- .../v7_0/migrate_mode_of_payments_v6_to_v7.py | 25 +++++++++++++------ 3 files changed, 21 insertions(+), 10 deletions(-) diff --git a/erpnext/accounts/doctype/payment_entry_reference/payment_entry_reference.json b/erpnext/accounts/doctype/payment_entry_reference/payment_entry_reference.json index 64417481ff..4dd08b67f6 100644 --- a/erpnext/accounts/doctype/payment_entry_reference/payment_entry_reference.json +++ b/erpnext/accounts/doctype/payment_entry_reference/payment_entry_reference.json @@ -171,7 +171,7 @@ "ignore_user_permissions": 0, "ignore_xss_filter": 0, "in_filter": 0, - "in_list_view": 0, + "in_list_view": 1, "label": "Allocated", "length": 0, "no_copy": 0, diff --git a/erpnext/patches/v7_0/convert_timelog_to_timesheet.py b/erpnext/patches/v7_0/convert_timelog_to_timesheet.py index a176a8f349..89af095754 100644 --- a/erpnext/patches/v7_0/convert_timelog_to_timesheet.py +++ b/erpnext/patches/v7_0/convert_timelog_to_timesheet.py @@ -4,8 +4,10 @@ from erpnext.manufacturing.doctype.production_order.production_order \ def execute(): frappe.reload_doc('projects', 'doctype', 'timesheet') + if not frappe.db.table_exists("Time Log"): + return - for data in frappe.get_all('Time Log', fields=["*"], filters = [["docstatus", "<", "2"]]): + for data in frappe.db.sql("select * from `tabTime Log` where where docstatus < 2", as_dict=1): if data.task: company = frappe.db.get_value("Task", data.task, "company") elif data.production_order: diff --git a/erpnext/patches/v7_0/migrate_mode_of_payments_v6_to_v7.py b/erpnext/patches/v7_0/migrate_mode_of_payments_v6_to_v7.py index 03f0afba18..8de92b7f59 100644 --- a/erpnext/patches/v7_0/migrate_mode_of_payments_v6_to_v7.py +++ b/erpnext/patches/v7_0/migrate_mode_of_payments_v6_to_v7.py @@ -4,11 +4,14 @@ import frappe def execute(): frappe.reload_doc('accounts', 'doctype', 'sales_invoice_timesheet') frappe.reload_doc('accounts', 'doctype', 'sales_invoice_payment') - + frappe.reload_doc('accounts', 'doctype', 'mode_of_payment') + + count = 0 for data in frappe.db.sql("""select name, mode_of_payment, cash_bank_account, paid_amount, company - from `tabSales Invoice` - where is_pos = 1 and docstatus < 2 - and cash_bank_account is not null and cash_bank_account != ''""", as_dict=1): + from `tabSales Invoice` si + where si.is_pos = 1 and si.docstatus < 2 + and si.cash_bank_account is not null and si.cash_bank_account != '' + and not exists(select name from `tabSales Invoice Payment` where parent=si.name)""", as_dict=1): if not data.mode_of_payment and not frappe.db.exists("Mode of Payment", "Cash"): mop = frappe.new_doc("Mode of Payment") @@ -17,13 +20,19 @@ def execute(): mop.save() si_doc = frappe.get_doc('Sales Invoice', data.name) - si_doc.append('payments', { + row = si_doc.append('payments', { 'mode_of_payment': data.mode_of_payment or 'Cash', 'account': data.cash_bank_account, 'type': frappe.db.get_value('Mode of Payment', data.mode_of_payment, 'type') or 'Cash', 'amount': data.paid_amount }) - + row.db_update() + si_doc.set_paid_amount() - si_doc.flags.ignore_validate_update_after_submit = True - si_doc.save() \ No newline at end of file + si_doc.db_set("paid_amount", si_doc.paid_amount) + si_doc.db_set("base_paid_amount", si_doc.base_paid_amount) + + count +=1 + + if count % 200 == 0: + frappe.db.commit() \ No newline at end of file From 094d3adba3b6d35734ed9d3cdd287947f743d801 Mon Sep 17 00:00:00 2001 From: Nabin Hait Date: Wed, 7 Sep 2016 17:31:17 +0600 Subject: [PATCH 3/3] bumped to version 7.0.41 --- erpnext/__init__.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/erpnext/__init__.py b/erpnext/__init__.py index 7e94a34634..958957ca77 100644 --- a/erpnext/__init__.py +++ b/erpnext/__init__.py @@ -2,7 +2,7 @@ from __future__ import unicode_literals import frappe -__version__ = '7.0.40' +__version__ = '7.0.41' def get_default_company(user=None): '''Get default company for user'''