From 7324815fdb87da9246fc213fdccea8435913b914 Mon Sep 17 00:00:00 2001 From: Nabin Hait Date: Thu, 28 Jun 2018 23:11:12 +0530 Subject: [PATCH] map payment terms template from SO to SI --- .../report/bom_stock_calculated/bom_stock_calculated.py | 6 +++--- erpnext/selling/doctype/sales_order/sales_order.py | 3 ++- 2 files changed, 5 insertions(+), 4 deletions(-) diff --git a/erpnext/manufacturing/report/bom_stock_calculated/bom_stock_calculated.py b/erpnext/manufacturing/report/bom_stock_calculated/bom_stock_calculated.py index 79da23b871..304e0b6792 100644 --- a/erpnext/manufacturing/report/bom_stock_calculated/bom_stock_calculated.py +++ b/erpnext/manufacturing/report/bom_stock_calculated/bom_stock_calculated.py @@ -19,7 +19,7 @@ def execute(filters=None): last_pur_price = frappe.db.get_value("Item", rows[0], "last_purchase_rate") if rows[4] > 0: diff_qty = rows[4] - reqd_qty - summ_data.append([rows[0], rows[1], item_map[rows[0]]["manufacturer"], item_map[rows[0]]["manufacturer_part_no"], rows[3], rows[4], reqd_qty, diff_qty, last_pur_price]) + summ_data.append([rows[0], rows[1], item_map[rows[0]]["manufacturer"], item_map[rows[0]]["manufacturer_part_no"], rows[3], rows[4], reqd_qty, diff_qty, last_pur_price]) else: diff_qty = 0 - reqd_qty summ_data.append([rows[0], rows[1], item_map[rows[0]]["manufacturer"], item_map[rows[0]]["manufacturer_part_no"], rows[3], "0.000", reqd_qty, diff_qty, last_pur_price]) @@ -86,6 +86,6 @@ def get_bom_stock(filters): GROUP BY bom_item.item_code""".format(qty_field=qty_field, table=table, conditions=conditions, bom=bom)) def get_item_details(item_code): - items = frappe.db.sql("""select it.item_group, it.item_name, it.stock_uom, it.name, it.brand, it.description, it.manufacturer_part_no, it.manufacturer from tabItem it where it.item_code = %s""", item_code, as_dict=1) + items = frappe.db.sql("""select it.item_group, it.item_name, it.stock_uom, it.name, it.brand, it.description, it.manufacturer_part_no, it.manufacturer from tabItem it where it.item_code = %s""", item_code, as_dict=1) - return dict((d.name, d) for d in items) + return dict((d.name, d) for d in items) diff --git a/erpnext/selling/doctype/sales_order/sales_order.py b/erpnext/selling/doctype/sales_order/sales_order.py index 1252c1df31..c03bda6845 100755 --- a/erpnext/selling/doctype/sales_order/sales_order.py +++ b/erpnext/selling/doctype/sales_order/sales_order.py @@ -573,7 +573,8 @@ def make_sales_invoice(source_name, target_doc=None, ignore_permissions=False): "Sales Order": { "doctype": "Sales Invoice", "field_map": { - "party_account_currency": "party_account_currency" + "party_account_currency": "party_account_currency", + "payment_terms_template": "payment_terms_template" }, "validation": { "docstatus": ["=", 1]