From ace68cd283e5ca7a39951ded1e0137f4e3fa7219 Mon Sep 17 00:00:00 2001 From: Rohit Waghchaure Date: Wed, 28 Mar 2018 15:25:12 +0530 Subject: [PATCH 1/6] [Fix] Alignment and date issue in PDC report --- .../accounts_receivable.html | 22 +++++++++++++++---- .../accounts_receivable.py | 16 ++++++++------ 2 files changed, 27 insertions(+), 11 deletions(-) diff --git a/erpnext/accounts/report/accounts_receivable/accounts_receivable.html b/erpnext/accounts/report/accounts_receivable/accounts_receivable.html index 78015b40c8..3d8aedcdcc 100644 --- a/erpnext/accounts/report/accounts_receivable/accounts_receivable.html +++ b/erpnext/accounts/report/accounts_receivable/accounts_receivable.html @@ -4,12 +4,21 @@ .print-format { padding: 8mm; margin:4mm; - font-size:10px; + font-size: 10.0pt !important; font-family: Tahoma, sans-serif; } } {% } %} + +

{%= __(report.report_name) %}

{%= filters.customer || filters.supplier %}

@@ -126,9 +135,14 @@ {% if(report.report_name === "Accounts Receivable" || report.report_name === "Accounts Payable") { %} {% if(data[i][__("Customer")] || data[i][__("Supplier")]) { %} {%= dateutil.str_to_user(data[i]["posting_date"]) %} - {%= data[i]["voucher_type"] %} -
{%= data[i]["voucher_no"] %} - {% if(!filters.show_pdc_in_print) { %} + + {% if(!filters.show_pdc_in_print) { %} + {%= data[i]["voucher_type"] %} +
+ {% } %} + {%= data[i]["voucher_no"] %} + + {% if(!filters.show_pdc_in_print) { %} {% if(!(filters.customer || filters.supplier)) { %} {%= data[i][__("Customer")] || data[i][__("Supplier")] %} diff --git a/erpnext/accounts/report/accounts_receivable/accounts_receivable.py b/erpnext/accounts/report/accounts_receivable/accounts_receivable.py index b971327abb..f722e7f743 100644 --- a/erpnext/accounts/report/accounts_receivable/accounts_receivable.py +++ b/erpnext/accounts/report/accounts_receivable/accounts_receivable.py @@ -136,7 +136,7 @@ class ReceivablePayableReport(object): return_entries = self.get_return_entries(args.get("party_type")) data = [] - pdc_details = get_pdc_details(args.get("party_type")) + pdc_details = get_pdc_details(args.get("party_type"), self.filters.report_date) for gle in self.get_entries_till(self.filters.report_date, args.get("party_type")): if self.is_receivable_or_payable(gle, dr_or_cr, future_vouchers): @@ -182,6 +182,7 @@ class ReceivablePayableReport(object): row.append(company_currency) pdc = pdc_details.get((gle.voucher_no, gle.party), {}) + remaining_balance = outstanding_amount - flt(pdc.get("pdc_amount")) row += [pdc.get("pdc_date"), pdc.get("pdc_ref"), flt(pdc.get("pdc_amount")), remaining_balance] @@ -398,7 +399,7 @@ def get_ageing_data(first_range, second_range, third_range, age_as_on, entry_dat return [age] + outstanding_range -def get_pdc_details(party_type): +def get_pdc_details(party_type, report_date): pdc_details = frappe._dict() for pdc in frappe.db.sql(""" @@ -411,13 +412,14 @@ def get_pdc_details(party_type): on (pref.parent = pent.name) where - pent.docstatus < 2 and pent.reference_date >= pent.posting_date + pent.docstatus < 2 and pent.reference_date >= %s and pent.party_type = %s - group by pent.party, pref.reference_name""", party_type, as_dict=1): + group by pent.party, pref.reference_name""", (report_date, party_type), as_dict=1): pdc_details.setdefault((pdc.invoice_no, pdc.party), pdc) if scrub(party_type): - amount_field = "jea.debit_in_account_currency + jea.credit_in_account_currency" + amount_field = ("jea.debit_in_account_currency" + if party_type == 'Supplier' else "jea.credit_in_account_currency") else: amount_field = "jea.debit + jea.credit" @@ -431,9 +433,9 @@ def get_pdc_details(party_type): on (jea.parent = je.name) where - je.docstatus < 2 and je.cheque_date >= je.posting_date + je.docstatus < 2 and je.cheque_date >= %s and jea.party_type = %s - group by jea.party, jea.reference_name""".format(amount_field), party_type, as_dict=1): + group by jea.party, jea.reference_name""".format(amount_field), (report_date, party_type), as_dict=1): if (pdc.invoice_no, pdc.party) in pdc_details: pdc_details[(pdc.invoice_no, pdc.party)]["pdc_amount"] += pdc.pdc_amount else: From 94769d81a8d307fd25a768a290906076414a6572 Mon Sep 17 00:00:00 2001 From: Manas Solanki Date: Thu, 29 Mar 2018 11:15:05 +0530 Subject: [PATCH 2/6] Update get_item_details.py --- erpnext/stock/get_item_details.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/erpnext/stock/get_item_details.py b/erpnext/stock/get_item_details.py index a0f7f43413..cafa4bc4c7 100644 --- a/erpnext/stock/get_item_details.py +++ b/erpnext/stock/get_item_details.py @@ -319,7 +319,7 @@ def get_price_list_rate(args, item_doc, out): out.price_list_rate = flt(price_list_rate) * flt(args.plc_conversion_rate) \ / flt(args.conversion_rate) if not args.price_list_uom_dependant: - out.price_list_rate = flt(out.price_list_rate * (args.conversion_factor or 1.0)) + out.price_list_rate = flt(out.price_list_rate * (flt(args.conversion_factor) or 1.0)) if not out.price_list_rate and args.transaction_type=="buying": from erpnext.stock.doctype.item.item import get_last_purchase_details From c5d222253a8dd374f3f5b74af55e932c70ea1925 Mon Sep 17 00:00:00 2001 From: Ameya Shenoy Date: Thu, 29 Mar 2018 12:45:15 +0530 Subject: [PATCH 3/6] Permisssion fixes for child table Related to commit 595929eb2432140a27dc262d4d78aca4ec5455c3 frappe.client.[get_list, get, get_value] when called on child table needs parent as an argument or it throws an error by default --- erpnext/public/js/utils/item_quick_entry.js | 3 ++- erpnext/stock/doctype/item/item.js | 6 ++++-- 2 files changed, 6 insertions(+), 3 deletions(-) diff --git a/erpnext/public/js/utils/item_quick_entry.js b/erpnext/public/js/utils/item_quick_entry.js index ebb92dac8f..b2e0b85556 100644 --- a/erpnext/public/js/utils/item_quick_entry.js +++ b/erpnext/public/js/utils/item_quick_entry.js @@ -319,7 +319,8 @@ frappe.ui.form.ItemQuickEntryForm = frappe.ui.form.QuickEntryForm.extend({ ["parent", "=", $(e.target).attr("data-fieldname")], ["attribute_value", "like", e.target.value + "%"] ], - fields: ["attribute_value"] + fields: ["attribute_value"], + parent: "Item" }, callback: function(r) { if (r.message) { diff --git a/erpnext/stock/doctype/item/item.js b/erpnext/stock/doctype/item/item.js index 90921764c5..86594a2a26 100644 --- a/erpnext/stock/doctype/item/item.js +++ b/erpnext/stock/doctype/item/item.js @@ -457,7 +457,8 @@ $.extend(erpnext.item, { ], fields: ["attribute_value"], limit_start: 0, - limit_page_length: 500 + limit_page_length: 500, + parent: "Item" } }).then((r) => { if(r.message) { @@ -577,7 +578,8 @@ $.extend(erpnext.item, { ["parent","=", i], ["attribute_value", "like", term + "%"] ], - fields: ["attribute_value"] + fields: ["attribute_value"], + parent: "Item" }, callback: function(r) { if (r.message) { From ef770b593ac2bd88293ffe54cedd065ab04ec82f Mon Sep 17 00:00:00 2001 From: Manas Solanki Date: Thu, 29 Mar 2018 13:25:00 +0530 Subject: [PATCH 4/6] fix the item varint details --- .../report/item_variant_details/item_variant_details.py | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/erpnext/stock/report/item_variant_details/item_variant_details.py b/erpnext/stock/report/item_variant_details/item_variant_details.py index f1488f8eff..7379eb4e50 100644 --- a/erpnext/stock/report/item_variant_details/item_variant_details.py +++ b/erpnext/stock/report/item_variant_details/item_variant_details.py @@ -14,10 +14,15 @@ def get_data(item): if not item: return [] item_dicts = [] + variants = None variant_results = frappe.db.sql("""select name from `tabItem` where variant_of = %s""", item, as_dict=1) - variants = ",".join(['"' + frappe.db.escape(variant['name']) + '"' for variant in variant_results]) + if not variant_results: + frappe.msgprint(_("There isn't any item variant for the selected item")) + return [] + else: + variants = ",".join(['"' + frappe.db.escape(variant['name']) + '"' for variant in variant_results]) order_count_map = get_open_sales_orders_map(variants) stock_details_map = get_stock_details_map(variants) From badc855400dd5a602d0cab528b47830e83e05b4a Mon Sep 17 00:00:00 2001 From: rohitwaghchaure Date: Thu, 29 Mar 2018 13:48:38 +0530 Subject: [PATCH 5/6] [Fix] BOM validation issue for scrap item (#13429) --- erpnext/manufacturing/doctype/bom/bom.py | 3 +++ 1 file changed, 3 insertions(+) diff --git a/erpnext/manufacturing/doctype/bom/bom.py b/erpnext/manufacturing/doctype/bom/bom.py index 862b4ee504..060894c541 100644 --- a/erpnext/manufacturing/doctype/bom/bom.py +++ b/erpnext/manufacturing/doctype/bom/bom.py @@ -602,6 +602,9 @@ def validate_bom_no(item, bom_no): for d in bom.items: if (d.item_code.lower() == item.lower()): rm_item_exists = True + for d in bom.scrap_items: + if (d.item_code.lower() == item.lower()): + rm_item_exists = True if bom.item.lower() == item.lower() or \ bom.item.lower() == cstr(frappe.db.get_value("Item", item, "variant_of")).lower(): rm_item_exists = True From cae2723920ee69e384aa677de97c871644d219a8 Mon Sep 17 00:00:00 2001 From: Nabin Hait Date: Thu, 29 Mar 2018 14:23:00 +0600 Subject: [PATCH 6/6] bumped to version 10.1.18 --- erpnext/__init__.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/erpnext/__init__.py b/erpnext/__init__.py index fe93bc493b..ccb7e8f936 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.1.17' +__version__ = '10.1.18' def get_default_company(user=None): '''Get default company for user'''