From 1e1b2364ab532969f8fb9869d44233d47e468ebd Mon Sep 17 00:00:00 2001 From: Nabin Hait Date: Mon, 29 Jan 2018 16:45:43 +0530 Subject: [PATCH 1/6] Optimization: don't update outstanding amount while cancelling payment entry for advance adjustment (#12689) --- erpnext/accounts/general_ledger.py | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/erpnext/accounts/general_ledger.py b/erpnext/accounts/general_ledger.py index c575d59ae7..03a06cc5f2 100644 --- a/erpnext/accounts/general_ledger.py +++ b/erpnext/accounts/general_ledger.py @@ -191,8 +191,9 @@ def delete_gl_entries(gl_entries=None, voucher_type=None, voucher_no=None, for entry in gl_entries: validate_frozen_account(entry["account"], adv_adj) validate_balance_type(entry["account"], adv_adj) - validate_expense_against_budget(entry) + if not adv_adj: + validate_expense_against_budget(entry) - if entry.get("against_voucher") and update_outstanding == 'Yes': + if entry.get("against_voucher") and update_outstanding == 'Yes' and not adv_adj: update_outstanding_amt(entry["account"], entry.get("party_type"), entry.get("party"), entry.get("against_voucher_type"), entry.get("against_voucher"), on_cancel=True) From 5bf77beb83245b49f9287d8ce88d8cdad5e18cfa Mon Sep 17 00:00:00 2001 From: Zarrar Date: Mon, 29 Jan 2018 16:47:52 +0530 Subject: [PATCH 2/6] precision while checking qty (#12688) --- erpnext/stock/doctype/batch/batch.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/erpnext/stock/doctype/batch/batch.py b/erpnext/stock/doctype/batch/batch.py index 760643c4ec..8c8b986ec7 100644 --- a/erpnext/stock/doctype/batch/batch.py +++ b/erpnext/stock/doctype/batch/batch.py @@ -115,8 +115,8 @@ def set_batch_nos(doc, warehouse_field, throw = False): d.batch_no = get_batch_no(d.item_code, warehouse, qty, throw) else: batch_qty = get_batch_qty(batch_no=d.batch_no, warehouse=warehouse) - if flt(batch_qty) < flt(qty): - frappe.throw(_("Row #{0}: The batch {1} has only {2} qty. Please select another batch which has {3} qty available or split the row into multiple rows, to deliver/issue from multiple batches").format(d.idx, d.batch_no, batch_qty, d.qty)) + if flt(batch_qty, d.precision("stock_qty")) < flt(qty, d.precision("stock_qty")): + frappe.throw(_("Row #{0}: The batch {1} has only {2} qty. Please select another batch which has {3} qty available or split the row into multiple rows, to deliver/issue from multiple batches").format(d.idx, d.batch_no, batch_qty, d.stock_qty)) @frappe.whitelist() def get_batch_no(item_code, warehouse, qty=1, throw=False): From 7e033aae11fe1aae0f5d502e630392baa49dfc96 Mon Sep 17 00:00:00 2001 From: Rohit Waghchaure Date: Mon, 29 Jan 2018 16:53:37 +0530 Subject: [PATCH 3/6] [Fix] Subscription send notification issue --- erpnext/accounts/doctype/subscription/subscription.py | 2 ++ 1 file changed, 2 insertions(+) diff --git a/erpnext/accounts/doctype/subscription/subscription.py b/erpnext/accounts/doctype/subscription/subscription.py index 1103b701dc..480abd42ee 100644 --- a/erpnext/accounts/doctype/subscription/subscription.py +++ b/erpnext/accounts/doctype/subscription/subscription.py @@ -232,6 +232,8 @@ def get_next_date(dt, mcount, day=None): def send_notification(new_rv, subscription_doc, print_format='Standard'): """Notify concerned persons about recurring document generation""" print_format = print_format + subject = subscription_doc.subject or '' + message = subscription_doc.message or '' if not subscription_doc.subject: subject = _("New {0}: #{1}").format(new_rv.doctype, new_rv.name) From e1e690541c0d873305209bc1749b57d41a6ca6fa Mon Sep 17 00:00:00 2001 From: Saurabh Date: Mon, 29 Jan 2018 17:39:56 +0530 Subject: [PATCH 4/6] set payment term name in payment_terms (#12693) --- .../patches/v10_0/set_default_payment_terms_based_on_company.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/erpnext/patches/v10_0/set_default_payment_terms_based_on_company.py b/erpnext/patches/v10_0/set_default_payment_terms_based_on_company.py index 1b5963393a..a90e096390 100644 --- a/erpnext/patches/v10_0/set_default_payment_terms_based_on_company.py +++ b/erpnext/patches/v10_0/set_default_payment_terms_based_on_company.py @@ -21,7 +21,7 @@ def execute(): update `tab{0}` set `payment_terms` = %s where name = %s - """.format(dt), (template, d.name)) + """.format(dt), (template.name, d.name)) def create_payment_terms_template(data): if data.credit_days_based_on == "Fixed Days": From 52beb77539c8d9b8ddfcd8353c58381193553000 Mon Sep 17 00:00:00 2001 From: rohitwaghchaure Date: Mon, 29 Jan 2018 17:40:44 +0530 Subject: [PATCH 5/6] Don't validate payment terms for POS (#12692) --- erpnext/public/js/controllers/transaction.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/erpnext/public/js/controllers/transaction.js b/erpnext/public/js/controllers/transaction.js index 31488de237..eb333af1ed 100644 --- a/erpnext/public/js/controllers/transaction.js +++ b/erpnext/public/js/controllers/transaction.js @@ -539,7 +539,7 @@ erpnext.TransactionController = erpnext.taxes_and_totals.extend({ due_date: function() { // due_date is to be changed, payment terms template and/or payment schedule must // be removed as due_date is automatically changed based on payment terms - if (this.frm.doc.due_date && !this.frm.updating_party_details) { + if (this.frm.doc.due_date && !this.frm.updating_party_details && !this.frm.doc.is_pos) { if (this.frm.doc.payment_terms_template || (this.frm.doc.payment_schedule && this.frm.doc.payment_schedule.length)) { var message1 = ""; From 373066e0cacd5f254828469d1fba1761feb988af Mon Sep 17 00:00:00 2001 From: Saurabh Date: Mon, 29 Jan 2018 18:12:37 +0600 Subject: [PATCH 6/6] bumped to version 10.0.16 --- erpnext/__init__.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/erpnext/__init__.py b/erpnext/__init__.py index 029d066c4b..b052d09515 100644 --- a/erpnext/__init__.py +++ b/erpnext/__init__.py @@ -5,7 +5,7 @@ import frappe from erpnext.hooks import regional_overrides from frappe.utils import getdate -__version__ = '10.0.15' +__version__ = '10.0.16' def get_default_company(user=None): '''Get default company for user'''