From 285701d9f104400ef90c8e7ef8e3513b6c3dee21 Mon Sep 17 00:00:00 2001 From: deepeshgarg007 Date: Wed, 10 Jul 2019 22:22:14 +0530 Subject: [PATCH 1/7] fix: Add missing Cost Center filter in cash flow statement --- .../accounts/report/cash_flow/cash_flow.js | 24 ++++++++++--------- 1 file changed, 13 insertions(+), 11 deletions(-) diff --git a/erpnext/accounts/report/cash_flow/cash_flow.js b/erpnext/accounts/report/cash_flow/cash_flow.js index 0422111093..03940f4b24 100644 --- a/erpnext/accounts/report/cash_flow/cash_flow.js +++ b/erpnext/accounts/report/cash_flow/cash_flow.js @@ -8,17 +8,19 @@ frappe.require("assets/erpnext/js/financial_statements.js", function() { // The last item in the array is the definition for Presentation Currency // filter. It won't be used in cash flow for now so we pop it. Please take // of this if you are working here. - frappe.query_reports["Cash Flow"]["filters"].pop(); - frappe.query_reports["Cash Flow"]["filters"].push({ - "fieldname": "accumulated_values", - "label": __("Accumulated Values"), - "fieldtype": "Check" - }); + frappe.query_reports["Cash Flow"]["filters"].splice(5, 1); - frappe.query_reports["Cash Flow"]["filters"].push({ - "fieldname": "include_default_book_entries", - "label": __("Include Default Book Entries"), - "fieldtype": "Check" - }); + frappe.query_reports["Cash Flow"]["filters"].push( + { + "fieldname": "accumulated_values", + "label": __("Accumulated Values"), + "fieldtype": "Check" + }, + { + "fieldname": "include_default_book_entries", + "label": __("Include Default Book Entries"), + "fieldtype": "Check" + } + ); }); \ No newline at end of file From 4870e95b834c72664b5f138ec91e806968c0129a Mon Sep 17 00:00:00 2001 From: rohitwaghchaure Date: Thu, 11 Jul 2019 10:03:35 +0530 Subject: [PATCH 2/7] fix: po, rate set as zero against the item (#18242) --- erpnext/public/js/controllers/buying.js | 3 +++ 1 file changed, 3 insertions(+) diff --git a/erpnext/public/js/controllers/buying.js b/erpnext/public/js/controllers/buying.js index 824b8d98d2..750900e3be 100644 --- a/erpnext/public/js/controllers/buying.js +++ b/erpnext/public/js/controllers/buying.js @@ -141,6 +141,7 @@ erpnext.buying.BuyingController = erpnext.TransactionController.extend({ price_list_rate: function(doc, cdt, cdn) { var item = frappe.get_doc(cdt, cdn); + frappe.model.round_floats_in(item, ["price_list_rate", "discount_percentage"]); let item_rate = item.price_list_rate; @@ -154,6 +155,8 @@ erpnext.buying.BuyingController = erpnext.TransactionController.extend({ if (item.discount_amount) { item.rate = flt((item.price_list_rate) - (item.discount_amount), precision('rate', item)); + } else { + item.rate = item_rate; } this.calculate_taxes_and_totals(); From bfcc84789f0e170e6dd1c11453fd8c05b2aec2e3 Mon Sep 17 00:00:00 2001 From: Mangesh-Khairnar Date: Thu, 11 Jul 2019 10:04:46 +0530 Subject: [PATCH 3/7] fix(sales-invoice): get items from quotation (#18237) --- .../accounts/doctype/sales_invoice/sales_invoice.js | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) diff --git a/erpnext/accounts/doctype/sales_invoice/sales_invoice.js b/erpnext/accounts/doctype/sales_invoice/sales_invoice.js index 07494a27d6..c3c3e2643e 100644 --- a/erpnext/accounts/doctype/sales_invoice/sales_invoice.js +++ b/erpnext/accounts/doctype/sales_invoice/sales_invoice.js @@ -187,9 +187,13 @@ erpnext.accounts.SalesInvoiceController = erpnext.selling.SellingController.exte method: "erpnext.selling.doctype.quotation.quotation.make_sales_invoice", source_doctype: "Quotation", target: me.frm, - setters: { - customer: me.frm.doc.customer || undefined, - }, + setters: [{ + fieldtype: 'Link', + label: __('Customer'), + options: 'Customer', + fieldname: 'party_name', + default: me.frm.doc.customer, + }], get_query_filters: { docstatus: 1, status: ["!=", "Lost"], From c6c6b05522bc3f3b97276df3ad7f820684817397 Mon Sep 17 00:00:00 2001 From: Suraj Shetty <13928957+surajshetty3416@users.noreply.github.com> Date: Thu, 11 Jul 2019 10:42:37 +0530 Subject: [PATCH 4/7] fix: update_due_date_in_gle patch (#18248) --- erpnext/patches/v12_0/update_due_date_in_gle.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/erpnext/patches/v12_0/update_due_date_in_gle.py b/erpnext/patches/v12_0/update_due_date_in_gle.py index 4c47a82dcc..34848725ce 100644 --- a/erpnext/patches/v12_0/update_due_date_in_gle.py +++ b/erpnext/patches/v12_0/update_due_date_in_gle.py @@ -13,5 +13,5 @@ def execute(): WHERE `tabGL Entry`.voucher_no = `tab{doctype}`.name and `tabGL Entry`.party is not null and `tabGL Entry`.voucher_type in ('Sales Invoice', 'Purchase Invoice', 'Journal Entry') - and account in (select name from `tabAccount` where account_type in ('Receivable', 'Payable') )""" #nosec + and `tabGL Entry`.account in (select name from `tabAccount` where account_type in ('Receivable', 'Payable'))""" #nosec .format(doctype=doctype)) From bc2ff785f14b144d531568abb0cdac6c594ff4c7 Mon Sep 17 00:00:00 2001 From: Suraj Shetty <13928957+surajshetty3416@users.noreply.github.com> Date: Thu, 11 Jul 2019 10:43:40 +0530 Subject: [PATCH 5/7] fix: Restore "allow delivery" condition checks (#18246) * fix: Remove `allow_delivery` flag - User was not able to create delivery note because allow_delivery flag was false and it never used to get updated * fix: Restore allow_delivery condition checks --- erpnext/selling/doctype/sales_order/sales_order.js | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/erpnext/selling/doctype/sales_order/sales_order.js b/erpnext/selling/doctype/sales_order/sales_order.js index 26ca7c6e22..39dda92e3e 100644 --- a/erpnext/selling/doctype/sales_order/sales_order.js +++ b/erpnext/selling/doctype/sales_order/sales_order.js @@ -107,7 +107,7 @@ erpnext.selling.SalesOrderController = erpnext.selling.SellingController.extend( refresh: function(doc, dt, dn) { var me = this; this._super(); - var allow_delivery = false; + let allow_delivery = false; if(doc.docstatus==1) { if(this.frm.has_perm("submit")) { @@ -132,6 +132,8 @@ erpnext.selling.SalesOrderController = erpnext.selling.SellingController.extend( if(doc.status !== 'Closed') { if(doc.status !== 'On Hold') { + allow_delivery = this.frm.doc.items.some(item => item.delivered_by_supplier === 0 && item.qty > flt(item.delivered_qty)) + if (this.frm.has_perm("submit")) { if(flt(doc.per_delivered, 6) < 100 || flt(doc.per_billed) < 100) { // hold From 523d0ab0d4f0ca700967237b3a6894b9f7de1dc5 Mon Sep 17 00:00:00 2001 From: Himanshu Warekar Date: Thu, 11 Jul 2019 13:24:28 +0530 Subject: [PATCH 6/7] fix: resolution by indicator --- erpnext/support/doctype/issue/issue.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/erpnext/support/doctype/issue/issue.js b/erpnext/support/doctype/issue/issue.js index 9d93f37af7..2d9650c5a4 100644 --- a/erpnext/support/doctype/issue/issue.js +++ b/erpnext/support/doctype/issue/issue.js @@ -136,7 +136,7 @@ function set_time_to_resolve_and_response(frm) { var time_to_resolve = get_status(frm.doc.resolution_by_variance); if (!frm.doc.resolution_date && frm.doc.agreement_fulfilled === "Ongoing") { - time_to_resolve = get_time_left(frm.doc.response_by, frm.doc.agreement_fulfilled); + time_to_resolve = get_time_left(frm.doc.resolution_by, frm.doc.agreement_fulfilled); } frm.dashboard.set_headline_alert( From fca86c48c8f2062a2b6e03ed5ecc746e58ca308d Mon Sep 17 00:00:00 2001 From: Nabin Hait Date: Thu, 11 Jul 2019 14:39:24 +0530 Subject: [PATCH 7/7] fix: Revert #frappe/erpnext/17896 (#18251) --- erpnext/public/js/utils.js | 23 ----------------------- 1 file changed, 23 deletions(-) diff --git a/erpnext/public/js/utils.js b/erpnext/public/js/utils.js index cf48be4128..0cd648ea11 100755 --- a/erpnext/public/js/utils.js +++ b/erpnext/public/js/utils.js @@ -573,7 +573,6 @@ erpnext.utils.map_current_doc = function(opts) { if(!r.exc) { var doc = frappe.model.sync(r.message); cur_frm.dirty(); - erpnext.utils.clear_duplicates(); cur_frm.refresh(); } } @@ -604,28 +603,6 @@ erpnext.utils.map_current_doc = function(opts) { } } -erpnext.utils.clear_duplicates = function() { - if(!cur_frm.doc.items) return; - const unique_items = new Map(); - /* - Create a Map of items with - item_code => [qty, warehouse, batch_no] - */ - let items = []; - - for (let item of cur_frm.doc.items) { - if (!(unique_items.has(item.item_code) && unique_items.get(item.item_code)[0] === item.qty && - unique_items.get(item.item_code)[1] === item.warehouse && unique_items.get(item.item_code)[2] === item.batch_no && - unique_items.get(item.item_code)[3] === item.delivery_date && unique_items.get(item.item_code)[4] === item.required_date && - unique_items.get(item.item_code)[5] === item.rate)) { - - unique_items.set(item.item_code, [item.qty, item.warehouse, item.batch_no, item.delivery_date, item.required_date, item.rate]); - items.push(item); - } - } - cur_frm.doc.items = items; -} - frappe.form.link_formatters['Item'] = function(value, doc) { if(doc && doc.item_name && doc.item_name !== value) { return value? value + ': ' + doc.item_name: doc.item_name;