diff --git a/erpnext/__init__.py b/erpnext/__init__.py index ccd8a19cf3..bae7915e31 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.59' +__version__ = '10.1.60' def get_default_company(user=None): '''Get default company for user''' diff --git a/erpnext/accounts/report/accounts_receivable/accounts_receivable.html b/erpnext/accounts/report/accounts_receivable/accounts_receivable.html index 0a21181399..7f663d8ded 100644 --- a/erpnext/accounts/report/accounts_receivable/accounts_receivable.html +++ b/erpnext/accounts/report/accounts_receivable/accounts_receivable.html @@ -167,7 +167,7 @@
{{ __("Printed On ") }}{%= dateutil.str_to_user(dateutil.get_datetime_as_string()) %}
\ No newline at end of file +{{ __("Printed On ") }}{%= dateutil.str_to_user(dateutil.get_datetime_as_string()) %}
diff --git a/erpnext/manufacturing/doctype/bom/bom.py b/erpnext/manufacturing/doctype/bom/bom.py index 7a2aa8a06b..0af7a86b93 100644 --- a/erpnext/manufacturing/doctype/bom/bom.py +++ b/erpnext/manufacturing/doctype/bom/bom.py @@ -354,7 +354,8 @@ class BOM(WebsiteGenerator): bom_list = self.traverse_tree(bom_list) for bom in bom_list: bom_obj = frappe.get_doc("BOM", bom) - bom_obj.on_update() + bom_obj.check_recursion() + bom_obj.update_exploded_items() return bom_list diff --git a/erpnext/manufacturing/doctype/bom_update_tool/bom_update_tool.py b/erpnext/manufacturing/doctype/bom_update_tool/bom_update_tool.py index 3f6cb44c49..59861ceba3 100644 --- a/erpnext/manufacturing/doctype/bom_update_tool/bom_update_tool.py +++ b/erpnext/manufacturing/doctype/bom_update_tool/bom_update_tool.py @@ -62,7 +62,7 @@ class BOMUpdateTool(Document): bom_list.append(d[0]) self.get_parent_boms(d[0], bom_list) - return bom_list + return list(set(bom_list)) @frappe.whitelist() def enqueue_replace_bom(args): diff --git a/erpnext/selling/report/sales_person_wise_transaction_summary/sales_person_wise_transaction_summary.py b/erpnext/selling/report/sales_person_wise_transaction_summary/sales_person_wise_transaction_summary.py index ae2cf8c550..345d608fef 100644 --- a/erpnext/selling/report/sales_person_wise_transaction_summary/sales_person_wise_transaction_summary.py +++ b/erpnext/selling/report/sales_person_wise_transaction_summary/sales_person_wise_transaction_summary.py @@ -5,6 +5,7 @@ from __future__ import unicode_literals import frappe from frappe import msgprint, _ from frappe.utils import flt +from erpnext import get_company_currency def execute(filters=None): if not filters: filters = {} @@ -14,12 +15,14 @@ def execute(filters=None): item_details = get_item_details() data = [] + company_currency = get_company_currency(filters["company"]) + for d in entries: if d.stock_qty > 0 or filters.get('show_return_entries', 0): data.append([ d.name, d.customer, d.territory, d.posting_date, d.item_code, item_details.get(d.item_code, {}).get("item_group"), item_details.get(d.item_code, {}).get("brand"), - d.stock_qty, d.base_net_amount, d.sales_person, d.allocated_percentage, d.contribution_amt + d.stock_qty, d.base_net_amount, d.sales_person, d.allocated_percentage, d.contribution_amt, company_currency ]) if data: @@ -32,12 +35,105 @@ def get_columns(filters): if not filters.get("doc_type"): msgprint(_("Please select the document type first"), raise_exception=1) - return [filters["doc_type"] + ":Link/" + filters["doc_type"] + ":140", - _("Customer") + ":Link/Customer:140", _("Territory") + ":Link/Territory:100", _("Posting Date") + ":Date:100", - _("Item Code") + ":Link/Item:120", _("Item Group") + ":Link/Item Group:120", - _("Brand") + ":Link/Brand:120", _("Qty") + ":Float:100", _("Amount") + ":Currency:120", - _("Sales Person") + ":Link/Sales Person:140", _("Contribution %") + "::110", - _("Contribution Amount") + ":Currency:140"] + columns = [ + { + "label": _(filters["doc_type"]), + "options": filters["doc_type"], + "fieldname": frappe.scrub(filters['doc_type']), + "fieldtype": "Link", + "width": 140 + }, + { + "label": _("Customer"), + "options": "Customer", + "fieldname": "customer", + "fieldtype": "Link", + "width": 140 + }, + { + "label": _("Territory"), + "options": "Territory", + "fieldname": "territory", + "fieldtype": "Link", + "width": 140 + }, + { + "label": _("Warehouse"), + "options": "Warehouse", + "fieldname": "warehouse", + "fieldtype": "Link", + "width": 140 + }, + { + "label": _("Posting Date"), + "fieldname": "posting_date", + "fieldtype": "Date", + "width": 140 + }, + { + "label": _("Item Code"), + "options": "Item", + "fieldname": "item_code", + "fieldtype": "Link", + "width": 140 + }, + { + "label": _("Item Group"), + "options": "Item Group", + "fieldname": "item_group", + "fieldtype": "Link", + "width": 140 + }, + { + "label": _("Brand"), + "options": "Brand", + "fieldname": "brand", + "fieldtype": "Link", + "width": 140 + }, + { + "label": _("Qty"), + "fieldname": "qty", + "fieldtype": "Float", + "width": 140 + }, + { + "label": _("Amount"), + "options": "currency", + "fieldname": "amount", + "fieldtype": "Currency", + "width": 140 + }, + { + "label": _("Sales Person"), + "options": "Sales Person", + "fieldname": "sales_person", + "fieldtype": "Link", + "width": 140 + }, + { + "label": _("Contribution %"), + "fieldname": "contribution", + "fieldtype": "Float", + "width": 140 + }, + { + "label": _("Contribution Amount"), + "options": "currency", + "fieldname": "contribution_amt", + "fieldtype": "Currency", + "width": 140 + }, + { + "label":_("Currency"), + "options": "Currency", + "fieldname":"currency", + "fieldtype":"Link", + "hidden" : 1 + } + ] + + return columns def get_entries(filters): date_field = filters["doc_type"] == "Sales Order" and "transaction_date" or "posting_date" diff --git a/erpnext/stock/doctype/delivery_note/delivery_note.js b/erpnext/stock/doctype/delivery_note/delivery_note.js index e0ee3708f4..d6a3c0ea0c 100644 --- a/erpnext/stock/doctype/delivery_note/delivery_note.js +++ b/erpnext/stock/doctype/delivery_note/delivery_note.js @@ -255,13 +255,13 @@ erpnext.stock.delivery_note.set_print_hide = function(doc, cdt, cdn){ var dn_item_fields = frappe.meta.docfield_map['Delivery Note Item']; var dn_fields_copy = dn_fields; var dn_item_fields_copy = dn_item_fields; - if (doc.print_without_amount) { dn_fields['currency'].print_hide = 1; dn_item_fields['rate'].print_hide = 1; dn_item_fields['discount_percentage'].print_hide = 1; dn_item_fields['price_list_rate'].print_hide = 1; dn_item_fields['amount'].print_hide = 1; + dn_item_fields['discount_amount'].print_hide = 1; dn_fields['taxes'].print_hide = 1; } else { if (dn_fields_copy['currency'].print_hide != 1) @@ -270,6 +270,8 @@ erpnext.stock.delivery_note.set_print_hide = function(doc, cdt, cdn){ dn_item_fields['rate'].print_hide = 0; if (dn_item_fields_copy['amount'].print_hide != 1) dn_item_fields['amount'].print_hide = 0; + if (dn_item_fields_copy['discount_amount'].print_hide != 1) + dn_item_fields['discount_amount'].print_hide = 0; if (dn_fields_copy['taxes'].print_hide != 1) dn_fields['taxes'].print_hide = 0; } diff --git a/erpnext/stock/doctype/delivery_note/delivery_note.py b/erpnext/stock/doctype/delivery_note/delivery_note.py index 70a061208f..ccc6da4031 100644 --- a/erpnext/stock/doctype/delivery_note/delivery_note.py +++ b/erpnext/stock/doctype/delivery_note/delivery_note.py @@ -75,7 +75,7 @@ class DeliveryNote(SellingController): item_meta = frappe.get_meta("Delivery Note Item") print_hide_fields = { "parent": ["grand_total", "rounded_total", "in_words", "currency", "total", "taxes"], - "items": ["rate", "amount", "price_list_rate", "discount_percentage"] + "items": ["rate", "amount", "discount_amount", "price_list_rate", "discount_percentage"] } for key, fieldname in print_hide_fields.items(): diff --git a/erpnext/stock/report/item_price_stock/item_price_stock.py b/erpnext/stock/report/item_price_stock/item_price_stock.py index ed010cd17a..3a72697b04 100644 --- a/erpnext/stock/report/item_price_stock/item_price_stock.py +++ b/erpnext/stock/report/item_price_stock/item_price_stock.py @@ -13,12 +13,18 @@ def execute(filters=None): def get_columns(): return [ { - "label": _("Item Name"), - "fieldname": "item_name", + "label": _("Item Code"), + "fieldname": "item_code", "fieldtype": "Link", "options": "Item", "width": 120 }, + { + "label": _("Item Name"), + "fieldname": "item_name", + "fieldtype": "Data", + "width": 120 + }, { "label": _("Warehouse"), "fieldname": "warehouse", @@ -70,7 +76,7 @@ def get_item_price_qty_data(filters): if filters.get("item_code"): conditions += "where a.item_code=%(item_code)s" - item_results = frappe.db.sql("""select a.item_code as item_name, a.name as price_list_name, + item_results = frappe.db.sql("""select a.item_code, a.item_name, a.name as price_list_name, b.warehouse as warehouse, b.actual_qty as actual_qty from `tabItem Price` a left join `tabBin` b ON a.item_code = b.item_code @@ -86,6 +92,7 @@ def get_item_price_qty_data(filters): if item_results: for item_dict in item_results: data = { + 'item_code': item_dict.item_code, 'item_name': item_dict.item_name, 'warehouse': item_dict.warehouse, 'stock_available': item_dict.actual_qty or 0,