From a9a7e848730bb531391e628057b0dbebe71c355c Mon Sep 17 00:00:00 2001 From: Suraj Shetty <13928957+surajshetty3416@users.noreply.github.com> Date: Wed, 18 Sep 2019 20:01:54 +0530 Subject: [PATCH 1/8] fix: Permission issue in Total Stock Summary report (#19103) Data in "Total Stock Summary" report were not getting filtered based on applied user permissions because some link fields had wrong options --- .../stock/report/total_stock_summary/total_stock_summary.py | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/erpnext/stock/report/total_stock_summary/total_stock_summary.py b/erpnext/stock/report/total_stock_summary/total_stock_summary.py index fafc1694533..41e2f86f29d 100644 --- a/erpnext/stock/report/total_stock_summary/total_stock_summary.py +++ b/erpnext/stock/report/total_stock_summary/total_stock_summary.py @@ -15,8 +15,8 @@ def execute(filters=None): def get_columns(): columns = [ - _("Company") + ":Link/Item:250", - _("Warehouse") + ":Link/Item:150", + _("Company") + ":Link/Company:250", + _("Warehouse") + ":Link/Warehouse:150", _("Item") + ":Link/Item:150", _("Description") + "::300", _("Current Qty") + ":Float:100", @@ -31,7 +31,7 @@ def get_total_stock(filters): if filters.get("group_by") == "Warehouse": if filters.get("company"): conditions += " AND warehouse.company = '%s'" % frappe.db.escape(filters.get("company"), percent=False) - + conditions += " GROUP BY ledger.warehouse, item.item_code" columns += "'' as company, ledger.warehouse" else: From 80973bb8de651adb105597d10b15d13e356cb8c2 Mon Sep 17 00:00:00 2001 From: rohitwaghchaure Date: Wed, 18 Sep 2019 20:03:30 +0530 Subject: [PATCH 2/8] fix: not able to export accounts receivable summary report in excel (#19099) --- .../accounts_receivable_summary/accounts_receivable_summary.py | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/erpnext/accounts/report/accounts_receivable_summary/accounts_receivable_summary.py b/erpnext/accounts/report/accounts_receivable_summary/accounts_receivable_summary.py index 350e0819577..86f001cba4e 100644 --- a/erpnext/accounts/report/accounts_receivable_summary/accounts_receivable_summary.py +++ b/erpnext/accounts/report/accounts_receivable_summary/accounts_receivable_summary.py @@ -40,7 +40,8 @@ class AccountsReceivableSummary(ReceivablePayableReport): row.party = party if self.party_naming_by == "Naming Series": - row.party_name = frappe.get_cached_value(self.party_type, party, [self.party_type + "_name"]) + row.party_name = frappe.get_cached_value(self.party_type, + party, frappe.scrub(self.party_type) + "_name") row.update(party_dict) From 0d19139acfa758173556e43400c8ab987ea0d050 Mon Sep 17 00:00:00 2001 From: Rohan Date: Wed, 18 Sep 2019 20:06:48 +0530 Subject: [PATCH 3/8] fix: only set times if job card is filled (#19106) --- erpnext/manufacturing/doctype/job_card/job_card.py | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/erpnext/manufacturing/doctype/job_card/job_card.py b/erpnext/manufacturing/doctype/job_card/job_card.py index a8faa132412..9d2e620e584 100644 --- a/erpnext/manufacturing/doctype/job_card/job_card.py +++ b/erpnext/manufacturing/doctype/job_card/job_card.py @@ -105,7 +105,6 @@ class JobCard(Document): for_quantity, time_in_mins = 0, 0 from_time_list, to_time_list = [], [] - for d in frappe.get_all('Job Card', filters = {'docstatus': 1, 'operation_id': self.operation_id}): doc = frappe.get_doc('Job Card', d.name) @@ -125,8 +124,8 @@ class JobCard(Document): if data.name == self.operation_id: data.completed_qty = for_quantity data.actual_operation_time = time_in_mins - data.actual_start_time = min(from_time_list) - data.actual_end_time = max(to_time_list) + data.actual_start_time = min(from_time_list) if from_time_list else None + data.actual_end_time = max(to_time_list) if to_time_list else None wo.flags.ignore_validate_update_after_submit = True wo.update_operation_status() From c719f842bc8bd02ecc9131bf16aae36c8981007a Mon Sep 17 00:00:00 2001 From: rohitwaghchaure Date: Thu, 19 Sep 2019 11:16:19 +0530 Subject: [PATCH 4/8] fix: set stock adjustment account for the raw materials instead of COGS (#19089) --- erpnext/manufacturing/doctype/bom/bom.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/erpnext/manufacturing/doctype/bom/bom.py b/erpnext/manufacturing/doctype/bom/bom.py index 3cc884135f9..3ad16e5b65d 100644 --- a/erpnext/manufacturing/doctype/bom/bom.py +++ b/erpnext/manufacturing/doctype/bom/bom.py @@ -648,7 +648,7 @@ def get_bom_items_as_dict(bom, company, qty=1, fetch_exploded=1, fetch_scrap_ite item_dict[key] = item for item, item_details in item_dict.items(): - for d in [["Account", "expense_account", "default_expense_account"], + for d in [["Account", "expense_account", "stock_adjustment_account"], ["Cost Center", "cost_center", "cost_center"], ["Warehouse", "default_warehouse", ""]]: company_in_record = frappe.db.get_value(d[0], item_details.get(d[1]), "company") if not item_details.get(d[1]) or (company_in_record and company != company_in_record): From 737a504a357bd34916201f8deac2e56cf69d6e21 Mon Sep 17 00:00:00 2001 From: Rohit Waghchaure Date: Thu, 19 Sep 2019 17:01:26 +0530 Subject: [PATCH 5/8] fix: get_bin_details_and_serial_nos() takes at least 3 arguments (4 given) --- erpnext/selling/sales_common.js | 2 +- erpnext/stock/get_item_details.py | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/erpnext/selling/sales_common.js b/erpnext/selling/sales_common.js index b1b64a3e4ec..623ada1445e 100644 --- a/erpnext/selling/sales_common.js +++ b/erpnext/selling/sales_common.js @@ -209,7 +209,7 @@ erpnext.selling.SellingController = erpnext.TransactionController.extend({ args: { item_code: item.item_code, warehouse: item.warehouse, - has_batch_no: has_batch_no, + has_batch_no: has_batch_no || 0, stock_qty: item.stock_qty, serial_no: item.serial_no || "", }, diff --git a/erpnext/stock/get_item_details.py b/erpnext/stock/get_item_details.py index 0828a5ca543..55cd6f956b1 100644 --- a/erpnext/stock/get_item_details.py +++ b/erpnext/stock/get_item_details.py @@ -724,7 +724,7 @@ def get_serial_no_details(item_code, warehouse, stock_qty, serial_no): return {'serial_no': serial_no} @frappe.whitelist() -def get_bin_details_and_serial_nos(item_code, warehouse, has_batch_no, stock_qty=None, serial_no=None): +def get_bin_details_and_serial_nos(item_code, warehouse, has_batch_no=None, stock_qty=None, serial_no=None): bin_details_and_serial_nos = {} bin_details_and_serial_nos.update(get_bin_details(item_code, warehouse)) if flt(stock_qty) > 0: From 02cb668f22d5621988ca4ab7b40b608604fb2218 Mon Sep 17 00:00:00 2001 From: Anurag Mishra <32095923+Anurag810@users.noreply.github.com> Date: Thu, 19 Sep 2019 18:12:57 +0530 Subject: [PATCH 6/8] fix: dashboard + button not working (#19095) --- erpnext/buying/doctype/purchase_order/purchase_order.js | 3 ++- erpnext/selling/doctype/sales_order/sales_order.js | 3 ++- 2 files changed, 4 insertions(+), 2 deletions(-) diff --git a/erpnext/buying/doctype/purchase_order/purchase_order.js b/erpnext/buying/doctype/purchase_order/purchase_order.js index 7b90b2b2a6f..0cb001cb507 100644 --- a/erpnext/buying/doctype/purchase_order/purchase_order.js +++ b/erpnext/buying/doctype/purchase_order/purchase_order.js @@ -10,7 +10,8 @@ frappe.ui.form.on("Purchase Order", { frm.custom_make_buttons = { 'Purchase Receipt': 'Receipt', 'Purchase Invoice': 'Invoice', - 'Stock Entry': 'Material to Supplier' + 'Stock Entry': 'Material to Supplier', + 'Payment Entry': 'Payment' } frm.set_query("reserve_warehouse", "supplied_items", function() { diff --git a/erpnext/selling/doctype/sales_order/sales_order.js b/erpnext/selling/doctype/sales_order/sales_order.js index 247c9e11d5d..98d62369ff2 100644 --- a/erpnext/selling/doctype/sales_order/sales_order.js +++ b/erpnext/selling/doctype/sales_order/sales_order.js @@ -10,7 +10,8 @@ frappe.ui.form.on("Sales Order", { 'Sales Invoice': 'Invoice', 'Material Request': 'Material Request', 'Purchase Order': 'Purchase Order', - 'Project': 'Project' + 'Project': 'Project', + 'Payment Entry': "Payment" } frm.add_fetch('customer', 'tax_id', 'tax_id'); From 1c26623f225a4adc9b492ca82efc755a27b0fd2e Mon Sep 17 00:00:00 2001 From: Marica Date: Fri, 20 Sep 2019 11:40:17 +0530 Subject: [PATCH 7/8] fix: Report 'Payment Period based On Invoice Date' (#19124) --- .../accounts_receivable.py | 4 +++ .../payment_period_based_on_invoice_date.py | 29 ++++++++++++++----- 2 files changed, 25 insertions(+), 8 deletions(-) diff --git a/erpnext/accounts/report/accounts_receivable/accounts_receivable.py b/erpnext/accounts/report/accounts_receivable/accounts_receivable.py index 4aec8c2ea53..f7cc99a1527 100755 --- a/erpnext/accounts/report/accounts_receivable/accounts_receivable.py +++ b/erpnext/accounts/report/accounts_receivable/accounts_receivable.py @@ -445,6 +445,10 @@ class ReceivablePayableReport(object): row.age = (getdate(self.age_as_on) - getdate(entry_date)).days or 0 index = None + + if not (self.filters.range1 and self.filters.range2 and self.filters.range3 and self.filters.range4): + self.filters.range1, self.filters.range2, self.filters.range3, self.filters.range4 = 30, 60, 90, 120 + for i, days in enumerate([self.filters.range1, self.filters.range2, self.filters.range3, self.filters.range4]): if row.age <= days: index = i diff --git a/erpnext/accounts/report/payment_period_based_on_invoice_date/payment_period_based_on_invoice_date.py b/erpnext/accounts/report/payment_period_based_on_invoice_date/payment_period_based_on_invoice_date.py index 24b5d87b5b9..8a28a13e525 100644 --- a/erpnext/accounts/report/payment_period_based_on_invoice_date/payment_period_based_on_invoice_date.py +++ b/erpnext/accounts/report/payment_period_based_on_invoice_date/payment_period_based_on_invoice_date.py @@ -4,11 +4,13 @@ from __future__ import unicode_literals import frappe from frappe import _ -from erpnext.accounts.report.accounts_receivable.accounts_receivable import get_ageing_data +from erpnext.accounts.report.accounts_receivable.accounts_receivable import ReceivablePayableReport from frappe.utils import getdate, flt def execute(filters=None): - if not filters: filters = {} + if not filters: + filters = {} + validate_filters(filters) columns = get_columns(filters) @@ -19,18 +21,29 @@ def execute(filters=None): for d in entries: invoice = invoice_details.get(d.against_voucher) or frappe._dict() - if d.reference_type=="Purchase Invoice": + if d.reference_type == "Purchase Invoice": payment_amount = flt(d.debit) or -1 * flt(d.credit) + else: payment_amount = flt(d.credit) or -1 * flt(d.debit) - row = [d.voucher_type, d.voucher_no, d.party_type, d.party, d.posting_date, d.against_voucher, - invoice.posting_date, invoice.due_date, d.debit, d.credit, d.remarks] + d.update({ + "range1": 0, + "range2": 0, + "range3": 0, + "range4": 0, + "outstanding": payment_amount + }) if d.against_voucher: - row += get_ageing_data(30, 60, 90, 120, d.posting_date, invoice.posting_date, payment_amount) - else: - row += ["", "", "", "", ""] + ReceivablePayableReport(filters).get_ageing_data(invoice.posting_date, d) + + row = [ + d.voucher_type, d.voucher_no, d.party_type, d.party, d.posting_date, d.against_voucher, + invoice.posting_date, invoice.due_date, d.debit, d.credit, d.remarks, + d.age, d.range1, d.range2, d.range3, d.range4 + ] + if invoice.due_date: row.append((getdate(d.posting_date) - getdate(invoice.due_date)).days or 0) From d3afecd1d9e24bb0368e22b79cdc8576b0ac35f0 Mon Sep 17 00:00:00 2001 From: Sahil Khan Date: Fri, 20 Sep 2019 15:33:04 +0550 Subject: [PATCH 8/8] bumped to version 11.1.63 --- erpnext/__init__.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/erpnext/__init__.py b/erpnext/__init__.py index 1dfe47dd711..71a87b1a706 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__ = '11.1.62' +__version__ = '11.1.63' def get_default_company(user=None): '''Get default company for user'''