Merge pull request #15986 from rohitwaghchaure/added_currency_filter_in_consolidated_report
Added currency filter in consolidated financial statement report
diff --git a/erpnext/hooks.py b/erpnext/hooks.py
index f48b48b..6947c02 100644
--- a/erpnext/hooks.py
+++ b/erpnext/hooks.py
@@ -12,7 +12,7 @@
source_link = "https://github.com/frappe/erpnext"
develop_version = '12.x.x-develop'
-staging_version = '11.0.3-beta.21'
+staging_version = '11.0.3-beta.22'
error_report_email = "support@erpnext.com"
diff --git a/erpnext/manufacturing/doctype/bom/bom.py b/erpnext/manufacturing/doctype/bom/bom.py
index 0eab982..d72f00a 100644
--- a/erpnext/manufacturing/doctype/bom/bom.py
+++ b/erpnext/manufacturing/doctype/bom/bom.py
@@ -108,7 +108,8 @@
"item_code": item.item_code,
"item_name": item.item_name,
"bom_no": item.bom_no,
- "stock_qty": item.stock_qty
+ "stock_qty": item.stock_qty,
+ "allow_transfer_for_manufacture": item.allow_transfer_for_manufacture
})
for r in ret:
if not item.get(r):
@@ -127,6 +128,8 @@
self.validate_rm_item(item)
args['bom_no'] = args['bom_no'] or item and cstr(item[0]['default_bom']) or ''
+ args['transfer_for_manufacture'] = (cstr(args.get('allow_transfer_for_manufacture', '')) or
+ item and item[0].allow_transfer_for_manufacture or 0)
args.update(item[0])
rate = self.get_rm_rate(args)
@@ -142,7 +145,7 @@
'qty' : args.get("qty") or args.get("stock_qty") or 1,
'stock_qty' : args.get("qty") or args.get("stock_qty") or 1,
'base_rate' : rate,
- 'allow_transfer_for_manufacture': item and args['allow_transfer_for_manufacture'] or 0
+ 'allow_transfer_for_manufacture': cint(args['transfer_for_manufacture']) or 0
}
return ret_item
diff --git a/erpnext/patches.txt b/erpnext/patches.txt
index ca25667..f771181 100755
--- a/erpnext/patches.txt
+++ b/erpnext/patches.txt
@@ -572,9 +572,10 @@
execute:frappe.delete_doc("Page", "Purchase Analytics")
execute:frappe.delete_doc("Page", "Stock Analytics")
execute:frappe.delete_doc("Page", "Production Analytics")
-erpnext.patches.v11_0.ewaybill_fields_gst_india
+erpnext.patches.v11_0.ewaybill_fields_gst_india #2018-11-13
erpnext.patches.v11_0.drop_column_max_days_allowed
erpnext.patches.v11_0.change_healthcare_desktop_icons
erpnext.patches.v10_0.update_user_image_in_employee
erpnext.patches.v11_0.update_delivery_trip_status
erpnext.patches.v10_0.repost_gle_for_purchase_receipts_with_rejected_items
+erpnext.patches.v11_0.set_missing_gst_hsn_code
diff --git a/erpnext/patches/v11_0/set_missing_gst_hsn_code.py b/erpnext/patches/v11_0/set_missing_gst_hsn_code.py
new file mode 100644
index 0000000..9d28a4a
--- /dev/null
+++ b/erpnext/patches/v11_0/set_missing_gst_hsn_code.py
@@ -0,0 +1,43 @@
+import frappe
+from erpnext.controllers.taxes_and_totals import get_itemised_tax_breakup_html
+
+def execute():
+ company = frappe.db.sql_list("select name from tabCompany where country = 'India'")
+ if not company:
+ return
+
+ doctypes = ["Quotation", "Sales Order", "Delivery Note", "Sales Invoice",
+ "Supplier Quotation", "Purchase Order", "Purchase Receipt", "Purchase Invoice"]
+
+ for dt in doctypes:
+ date_field = "posting_date"
+ if dt in ["Quotation", "Sales Order", "Supplier Quotation", "Purchase Order"]:
+ date_field = "transaction_date"
+
+ transactions = frappe.db.sql("""
+ select dt.name, dt_item.name as child_name
+ from `tab{dt}` dt, `tab{dt} Item` dt_item
+ where dt.name = dt_item.parent
+ and dt.`{date_field}` > '2018-06-01'
+ and dt.docstatus = 1
+ and ifnull(dt_item.gst_hsn_code, '') = ''
+ and ifnull(dt_item.item_code, '') != ''
+ and dt.company in ({company})
+ """.format(dt=dt, date_field=date_field, company=", ".join(['%s']*len(company))), tuple(company), as_dict=1)
+
+ if not transactions:
+ continue
+
+ transaction_rows_name = [d.child_name for d in transactions]
+
+ frappe.db.sql("""
+ update `tab{dt} Item` dt_item
+ set dt_item.gst_hsn_code = (select gst_hsn_code from tabItem where name=dt_item.item_code)
+ where dt_item.name in ({rows_name})
+ """.format(dt=dt, rows_name=", ".join(['%s']*len(transaction_rows_name))), tuple(transaction_rows_name))
+
+ for t in transactions:
+ print(t.name)
+ trans_doc = frappe.get_doc(dt, t.name)
+ hsnwise_tax = get_itemised_tax_breakup_html(trans_doc)
+ frappe.db.set_value(dt, t.name, "other_charges_calculation", hsnwise_tax, update_modified=False)
\ No newline at end of file
diff --git a/erpnext/regional/india/setup.py b/erpnext/regional/india/setup.py
index c754121..d282f5c 100644
--- a/erpnext/regional/india/setup.py
+++ b/erpnext/regional/india/setup.py
@@ -85,7 +85,7 @@
def make_custom_fields(update=True):
hsn_sac_field = dict(fieldname='gst_hsn_code', label='HSN/SAC',
- fieldtype='Data', options='item_code.gst_hsn_code', insert_after='description',
+ fieldtype='Data', fetch_from='item_code.gst_hsn_code', insert_after='description',
allow_on_submit=1, print_hide=1)
invoice_gst_fields = [
dict(fieldname='gst_section', label='GST Details', fieldtype='Section Break',