From 06c20400eeaa94fb37c2d10fecf49d7cc0b504f7 Mon Sep 17 00:00:00 2001 From: deepeshgarg007 Date: Mon, 22 Apr 2019 12:25:14 +0530 Subject: [PATCH 01/73] feat: Track purchase receipt status in Material Request --- .../doctype/purchase_order/purchase_order.py | 4 +- erpnext/controllers/status_updater.py | 3 +- .../material_request/material_request.json | 216 +- .../material_request/material_request_list.js | 4 +- .../material_request_item.json | 76 +- .../purchase_receipt/purchase_receipt.py | 11 + .../purchase_receipt_item.json | 5282 +++++++++-------- 7 files changed, 2900 insertions(+), 2696 deletions(-) diff --git a/erpnext/buying/doctype/purchase_order/purchase_order.py b/erpnext/buying/doctype/purchase_order/purchase_order.py index 6a4c818b5b..1c3469ec58 100644 --- a/erpnext/buying/doctype/purchase_order/purchase_order.py +++ b/erpnext/buying/doctype/purchase_order/purchase_order.py @@ -364,7 +364,9 @@ def make_purchase_receipt(source_name, target_doc=None): "field_map": { "name": "purchase_order_item", "parent": "purchase_order", - "bom": "bom" + "bom": "bom", + "material_request": "material_request", + "material_request_item": "material_request_item" }, "postprocess": update_item, "condition": lambda doc: abs(doc.received_qty) < abs(doc.qty) and doc.delivered_by_supplier!=1 diff --git a/erpnext/controllers/status_updater.py b/erpnext/controllers/status_updater.py index 77d941c98e..ddfd8b398c 100644 --- a/erpnext/controllers/status_updater.py +++ b/erpnext/controllers/status_updater.py @@ -96,7 +96,8 @@ status_map = { ["Partially Ordered", "eval:self.status != 'Stopped' and self.per_ordered < 100 and self.per_ordered > 0 and self.docstatus == 1"], ["Ordered", "eval:self.status != 'Stopped' and self.per_ordered == 100 and self.docstatus == 1 and self.material_request_type == 'Purchase'"], ["Transferred", "eval:self.status != 'Stopped' and self.per_ordered == 100 and self.docstatus == 1 and self.material_request_type == 'Material Transfer'"], - ["Issued", "eval:self.status != 'Stopped' and self.per_ordered == 100 and self.docstatus == 1 and self.material_request_type == 'Material Issue'"] + ["Issued", "eval:self.status != 'Stopped' and self.per_ordered == 100 and self.docstatus == 1 and self.material_request_type == 'Material Issue'"], + ["Received", "eval:self.status != 'Stopped' and self.per_received == 100 and self.docstatus == 1 and self.material_request_type == 'Purchase'"] ] } diff --git a/erpnext/stock/doctype/material_request/material_request.json b/erpnext/stock/doctype/material_request/material_request.json index d50404eb78..63628f4a5d 100644 --- a/erpnext/stock/doctype/material_request/material_request.json +++ b/erpnext/stock/doctype/material_request/material_request.json @@ -1,17 +1,17 @@ { - "allow_copy": 0, - "allow_events_in_timeline": 0, - "allow_guest_to_view": 0, - "allow_import": 1, - "allow_rename": 0, - "autoname": "naming_series:", - "beta": 0, - "creation": "2013-03-07 14:48:38", - "custom": 0, - "docstatus": 0, - "doctype": "DocType", - "document_type": "Document", - "editable_grid": 0, + "allow_copy": 0, + "allow_events_in_timeline": 0, + "allow_guest_to_view": 0, + "allow_import": 1, + "allow_rename": 0, + "autoname": "naming_series:", + "beta": 0, + "creation": "2013-03-07 14:48:38", + "custom": 0, + "docstatus": 0, + "doctype": "DocType", + "document_type": "Document", + "editable_grid": 0, "fields": [ { "allow_bulk_edit": 0, @@ -20,6 +20,7 @@ "bold": 0, "collapsible": 0, "columns": 0, + "fetch_if_empty": 0, "fieldname": "type_section", "fieldtype": "Section Break", "hidden": 0, @@ -53,6 +54,7 @@ "collapsible": 0, "columns": 0, "default": "", + "fetch_if_empty": 0, "fieldname": "naming_series", "fieldtype": "Select", "hidden": 0, @@ -88,6 +90,7 @@ "collapsible": 0, "columns": 0, "default": "{material_request_type}", + "fetch_if_empty": 0, "fieldname": "title", "fieldtype": "Data", "hidden": 1, @@ -120,6 +123,7 @@ "bold": 0, "collapsible": 0, "columns": 0, + "fetch_if_empty": 0, "fieldname": "material_request_type", "fieldtype": "Select", "hidden": 0, @@ -153,6 +157,7 @@ "collapsible": 0, "columns": 0, "depends_on": "eval:doc.material_request_type==\"Customer Provided\"", + "fetch_if_empty": 0, "fieldname": "customer", "fieldtype": "Link", "hidden": 0, @@ -186,6 +191,7 @@ "bold": 0, "collapsible": 0, "columns": 0, + "fetch_if_empty": 0, "fieldname": "column_break_2", "fieldtype": "Column Break", "hidden": 0, @@ -216,6 +222,7 @@ "bold": 0, "collapsible": 0, "columns": 0, + "fetch_if_empty": 0, "fieldname": "schedule_date", "fieldtype": "Date", "hidden": 0, @@ -249,6 +256,7 @@ "collapsible": 0, "columns": 0, "description": "", + "fetch_if_empty": 0, "fieldname": "company", "fieldtype": "Link", "hidden": 0, @@ -285,6 +293,7 @@ "bold": 0, "collapsible": 0, "columns": 0, + "fetch_if_empty": 0, "fieldname": "amended_from", "fieldtype": "Link", "hidden": 0, @@ -321,6 +330,7 @@ "bold": 0, "collapsible": 0, "columns": 0, + "fetch_if_empty": 0, "fieldname": "items_section", "fieldtype": "Section Break", "hidden": 0, @@ -348,69 +358,71 @@ "unique": 0 }, { - "allow_bulk_edit": 0, - "allow_in_quick_entry": 0, - "allow_on_submit": 0, - "bold": 0, - "collapsible": 0, - "columns": 0, - "fieldname": "scan_barcode", - "fieldtype": "Data", - "hidden": 0, - "ignore_user_permissions": 0, - "ignore_xss_filter": 0, - "in_filter": 0, - "in_global_search": 0, - "in_list_view": 0, - "in_standard_filter": 0, - "label": "Scan Barcode", - "length": 0, - "no_copy": 0, - "permlevel": 0, - "precision": "", - "print_hide": 0, - "print_hide_if_no_value": 0, - "read_only": 0, - "remember_last_selected_value": 0, - "report_hide": 0, - "reqd": 0, - "search_index": 0, - "set_only_once": 0, - "translatable": 0, + "allow_bulk_edit": 0, + "allow_in_quick_entry": 0, + "allow_on_submit": 0, + "bold": 0, + "collapsible": 0, + "columns": 0, + "fetch_if_empty": 0, + "fieldname": "scan_barcode", + "fieldtype": "Data", + "hidden": 0, + "ignore_user_permissions": 0, + "ignore_xss_filter": 0, + "in_filter": 0, + "in_global_search": 0, + "in_list_view": 0, + "in_standard_filter": 0, + "label": "Scan Barcode", + "length": 0, + "no_copy": 0, + "permlevel": 0, + "precision": "", + "print_hide": 0, + "print_hide_if_no_value": 0, + "read_only": 0, + "remember_last_selected_value": 0, + "report_hide": 0, + "reqd": 0, + "search_index": 0, + "set_only_once": 0, + "translatable": 0, "unique": 0 - }, + }, { - "allow_bulk_edit": 1, - "allow_in_quick_entry": 0, - "allow_on_submit": 0, - "bold": 0, - "collapsible": 0, - "columns": 0, - "fieldname": "items", - "fieldtype": "Table", - "hidden": 0, - "ignore_user_permissions": 0, - "ignore_xss_filter": 0, - "in_filter": 0, - "in_global_search": 0, - "in_list_view": 0, - "in_standard_filter": 0, - "label": "Items", - "length": 0, - "no_copy": 0, - "oldfieldname": "indent_details", - "oldfieldtype": "Table", - "options": "Material Request Item", - "permlevel": 0, - "print_hide": 0, - "print_hide_if_no_value": 0, - "read_only": 0, - "remember_last_selected_value": 0, - "report_hide": 0, - "reqd": 1, - "search_index": 0, - "set_only_once": 0, - "translatable": 0, + "allow_bulk_edit": 1, + "allow_in_quick_entry": 0, + "allow_on_submit": 0, + "bold": 0, + "collapsible": 0, + "columns": 0, + "fetch_if_empty": 0, + "fieldname": "items", + "fieldtype": "Table", + "hidden": 0, + "ignore_user_permissions": 0, + "ignore_xss_filter": 0, + "in_filter": 0, + "in_global_search": 0, + "in_list_view": 0, + "in_standard_filter": 0, + "label": "Items", + "length": 0, + "no_copy": 0, + "oldfieldname": "indent_details", + "oldfieldtype": "Table", + "options": "Material Request Item", + "permlevel": 0, + "print_hide": 0, + "print_hide_if_no_value": 0, + "read_only": 0, + "remember_last_selected_value": 0, + "report_hide": 0, + "reqd": 1, + "search_index": 0, + "set_only_once": 0, + "translatable": 0, "unique": 0 }, { @@ -420,6 +432,7 @@ "bold": 0, "collapsible": 1, "columns": 0, + "fetch_if_empty": 0, "fieldname": "more_info", "fieldtype": "Section Break", "hidden": 0, @@ -453,6 +466,7 @@ "bold": 0, "collapsible": 0, "columns": 0, + "fetch_if_empty": 0, "fieldname": "requested_by", "fieldtype": "Data", "hidden": 0, @@ -485,6 +499,7 @@ "collapsible": 0, "columns": 0, "default": "Today", + "fetch_if_empty": 0, "fieldname": "transaction_date", "fieldtype": "Date", "hidden": 0, @@ -520,6 +535,7 @@ "bold": 0, "collapsible": 0, "columns": 0, + "fetch_if_empty": 0, "fieldname": "column_break2", "fieldtype": "Column Break", "hidden": 0, @@ -553,6 +569,7 @@ "bold": 0, "collapsible": 0, "columns": 0, + "fetch_if_empty": 0, "fieldname": "status", "fieldtype": "Select", "hidden": 0, @@ -590,6 +607,7 @@ "collapsible": 0, "columns": 0, "description": "", + "fetch_if_empty": 0, "fieldname": "per_ordered", "fieldtype": "Percent", "hidden": 0, @@ -616,6 +634,39 @@ "translatable": 0, "unique": 0 }, + { + "allow_bulk_edit": 0, + "allow_in_quick_entry": 0, + "allow_on_submit": 0, + "bold": 0, + "collapsible": 0, + "columns": 0, + "fetch_if_empty": 0, + "fieldname": "per_received", + "fieldtype": "Percent", + "hidden": 0, + "ignore_user_permissions": 0, + "ignore_xss_filter": 0, + "in_filter": 0, + "in_global_search": 0, + "in_list_view": 0, + "in_standard_filter": 0, + "label": "% Received", + "length": 0, + "no_copy": 1, + "permlevel": 0, + "precision": "", + "print_hide": 1, + "print_hide_if_no_value": 0, + "read_only": 1, + "remember_last_selected_value": 0, + "report_hide": 0, + "reqd": 0, + "search_index": 0, + "set_only_once": 0, + "translatable": 0, + "unique": 0 + }, { "allow_bulk_edit": 0, "allow_in_quick_entry": 0, @@ -623,6 +674,7 @@ "bold": 0, "collapsible": 1, "columns": 0, + "fetch_if_empty": 0, "fieldname": "printing_details", "fieldtype": "Section Break", "hidden": 0, @@ -655,6 +707,7 @@ "bold": 0, "collapsible": 0, "columns": 0, + "fetch_if_empty": 0, "fieldname": "letter_head", "fieldtype": "Link", "hidden": 0, @@ -689,6 +742,7 @@ "bold": 0, "collapsible": 0, "columns": 0, + "fetch_if_empty": 0, "fieldname": "select_print_heading", "fieldtype": "Link", "hidden": 0, @@ -722,6 +776,7 @@ "collapsible": 1, "collapsible_depends_on": "terms", "columns": 0, + "fetch_if_empty": 0, "fieldname": "terms_section_break", "fieldtype": "Section Break", "hidden": 0, @@ -755,6 +810,7 @@ "bold": 0, "collapsible": 0, "columns": 0, + "fetch_if_empty": 0, "fieldname": "tc_name", "fieldtype": "Link", "hidden": 0, @@ -789,6 +845,7 @@ "bold": 0, "collapsible": 0, "columns": 0, + "fetch_if_empty": 0, "fieldname": "terms", "fieldtype": "Text Editor", "hidden": 0, @@ -822,6 +879,7 @@ "bold": 0, "collapsible": 1, "columns": 0, + "fetch_if_empty": 0, "fieldname": "reference", "fieldtype": "Section Break", "hidden": 0, @@ -854,6 +912,7 @@ "bold": 0, "collapsible": 0, "columns": 0, + "fetch_if_empty": 0, "fieldname": "job_card", "fieldtype": "Link", "hidden": 0, @@ -882,18 +941,16 @@ } ], "has_web_view": 0, - "hide_heading": 0, "hide_toolbar": 0, "icon": "fa fa-ticket", "idx": 70, - "image_view": 0, "in_create": 0, "is_submittable": 1, "issingle": 0, "istable": 0, "max_attachments": 0, - "menu_index": 0, - "modified": "2018-10-24 10:38:28.377919", + "menu_index": 0, + "modified": "2019-04-22 11:36:36.493445", "modified_by": "Administrator", "module": "Stock", "name": "Material Request", @@ -978,7 +1035,6 @@ ], "quick_entry": 1, "read_only": 0, - "read_only_onload": 1, "search_fields": "status,transaction_date", "show_name_in_global_search": 1, "sort_field": "modified", @@ -987,4 +1043,4 @@ "track_changes": 0, "track_seen": 0, "track_views": 0 -} +} \ No newline at end of file diff --git a/erpnext/stock/doctype/material_request/material_request_list.js b/erpnext/stock/doctype/material_request/material_request_list.js index e16e7d50a0..15aa31e7f0 100644 --- a/erpnext/stock/doctype/material_request/material_request_list.js +++ b/erpnext/stock/doctype/material_request/material_request_list.js @@ -8,7 +8,9 @@ frappe.listview_settings['Material Request'] = { } else if(doc.docstatus==1 && flt(doc.per_ordered, 2) < 100) { return [__("Partially ordered"), "yellow", "per_ordered,<,100"]; } else if(doc.docstatus==1 && flt(doc.per_ordered, 2) == 100) { - if (doc.material_request_type == "Purchase") { + if (doc.material_request_type == "Purchase" && flt(doc.per_received, 2) == 100){ + return [__("Received"), "green", "per_received,=,100"]; + } else if (doc.material_request_type == "Purchase") { return [__("Ordered"), "green", "per_ordered,=,100"]; } else if (doc.material_request_type == "Material Transfer") { return [__("Transfered"), "green", "per_ordered,=,100"]; diff --git a/erpnext/stock/doctype/material_request_item/material_request_item.json b/erpnext/stock/doctype/material_request_item/material_request_item.json index 954dd0bb0a..3e7ff4bac9 100644 --- a/erpnext/stock/doctype/material_request_item/material_request_item.json +++ b/erpnext/stock/doctype/material_request_item/material_request_item.json @@ -21,6 +21,7 @@ "bold": 1, "collapsible": 0, "columns": 3, + "fetch_if_empty": 0, "fieldname": "item_code", "fieldtype": "Link", "hidden": 0, @@ -57,6 +58,7 @@ "bold": 0, "collapsible": 0, "columns": 0, + "fetch_if_empty": 0, "fieldname": "col_break1", "fieldtype": "Column Break", "hidden": 0, @@ -87,6 +89,7 @@ "bold": 0, "collapsible": 0, "columns": 0, + "fetch_if_empty": 0, "fieldname": "item_name", "fieldtype": "Data", "hidden": 0, @@ -122,6 +125,7 @@ "bold": 0, "collapsible": 1, "columns": 0, + "fetch_if_empty": 0, "fieldname": "section_break_4", "fieldtype": "Section Break", "hidden": 0, @@ -154,6 +158,7 @@ "bold": 0, "collapsible": 0, "columns": 0, + "fetch_if_empty": 0, "fieldname": "description", "fieldtype": "Text Editor", "hidden": 0, @@ -189,6 +194,7 @@ "bold": 0, "collapsible": 0, "columns": 0, + "fetch_if_empty": 0, "fieldname": "column_break_6", "fieldtype": "Column Break", "hidden": 0, @@ -220,6 +226,7 @@ "bold": 0, "collapsible": 0, "columns": 0, + "fetch_if_empty": 0, "fieldname": "image", "fieldtype": "Attach Image", "hidden": 0, @@ -252,6 +259,7 @@ "bold": 0, "collapsible": 0, "columns": 0, + "fetch_if_empty": 0, "fieldname": "quantity_and_warehouse", "fieldtype": "Section Break", "hidden": 0, @@ -283,6 +291,7 @@ "bold": 0, "collapsible": 0, "columns": 1, + "fetch_if_empty": 0, "fieldname": "qty", "fieldtype": "Float", "hidden": 0, @@ -318,6 +327,7 @@ "bold": 0, "collapsible": 0, "columns": 1, + "fetch_if_empty": 0, "fieldname": "uom", "fieldtype": "Link", "hidden": 0, @@ -354,6 +364,7 @@ "bold": 0, "collapsible": 0, "columns": 0, + "fetch_if_empty": 0, "fieldname": "conversion_factor", "fieldtype": "Float", "hidden": 0, @@ -386,6 +397,7 @@ "bold": 0, "collapsible": 0, "columns": 0, + "fetch_if_empty": 0, "fieldname": "stock_uom", "fieldtype": "Link", "hidden": 0, @@ -419,6 +431,7 @@ "bold": 0, "collapsible": 0, "columns": 3, + "fetch_if_empty": 0, "fieldname": "warehouse", "fieldtype": "Link", "hidden": 0, @@ -455,6 +468,7 @@ "bold": 0, "collapsible": 0, "columns": 0, + "fetch_if_empty": 0, "fieldname": "col_break2", "fieldtype": "Column Break", "hidden": 0, @@ -486,6 +500,7 @@ "collapsible": 0, "columns": 2, "default": "", + "fetch_if_empty": 0, "fieldname": "schedule_date", "fieldtype": "Date", "hidden": 0, @@ -521,6 +536,7 @@ "bold": 0, "collapsible": 0, "columns": 0, + "fetch_if_empty": 0, "fieldname": "rate", "fieldtype": "Currency", "hidden": 0, @@ -553,6 +569,7 @@ "bold": 0, "collapsible": 0, "columns": 0, + "fetch_if_empty": 0, "fieldname": "amount", "fieldtype": "Currency", "hidden": 0, @@ -585,6 +602,7 @@ "bold": 0, "collapsible": 0, "columns": 0, + "fetch_if_empty": 0, "fieldname": "stock_qty", "fieldtype": "Float", "hidden": 0, @@ -617,6 +635,40 @@ "bold": 0, "collapsible": 0, "columns": 0, + "fetch_if_empty": 0, + "fieldname": "received_qty", + "fieldtype": "Data", + "hidden": 0, + "ignore_user_permissions": 0, + "ignore_xss_filter": 0, + "in_filter": 0, + "in_global_search": 0, + "in_list_view": 0, + "in_standard_filter": 0, + "label": "Received Quantity", + "length": 0, + "no_copy": 0, + "permlevel": 0, + "precision": "", + "print_hide": 0, + "print_hide_if_no_value": 0, + "read_only": 1, + "remember_last_selected_value": 0, + "report_hide": 0, + "reqd": 0, + "search_index": 0, + "set_only_once": 0, + "translatable": 0, + "unique": 0 + }, + { + "allow_bulk_edit": 0, + "allow_in_quick_entry": 0, + "allow_on_submit": 0, + "bold": 0, + "collapsible": 0, + "columns": 0, + "fetch_if_empty": 0, "fieldname": "more_info", "fieldtype": "Section Break", "hidden": 0, @@ -649,6 +701,7 @@ "collapsible": 0, "columns": 0, "description": "", + "fetch_if_empty": 0, "fieldname": "item_group", "fieldtype": "Link", "hidden": 0, @@ -683,6 +736,7 @@ "bold": 0, "collapsible": 0, "columns": 0, + "fetch_if_empty": 0, "fieldname": "brand", "fieldtype": "Link", "hidden": 0, @@ -719,6 +773,7 @@ "bold": 0, "collapsible": 0, "columns": 0, + "fetch_if_empty": 0, "fieldname": "lead_time_date", "fieldtype": "Date", "hidden": 0, @@ -752,6 +807,7 @@ "bold": 0, "collapsible": 0, "columns": 0, + "fetch_if_empty": 0, "fieldname": "sales_order", "fieldtype": "Link", "hidden": 0, @@ -784,6 +840,7 @@ "bold": 0, "collapsible": 0, "columns": 0, + "fetch_if_empty": 0, "fieldname": "sales_order_item", "fieldtype": "Data", "hidden": 1, @@ -816,6 +873,7 @@ "bold": 0, "collapsible": 0, "columns": 0, + "fetch_if_empty": 0, "fieldname": "project", "fieldtype": "Link", "hidden": 0, @@ -849,6 +907,7 @@ "bold": 0, "collapsible": 0, "columns": 0, + "fetch_if_empty": 0, "fieldname": "production_plan", "fieldtype": "Link", "hidden": 0, @@ -882,6 +941,7 @@ "bold": 0, "collapsible": 0, "columns": 0, + "fetch_if_empty": 0, "fieldname": "material_request_plan_item", "fieldtype": "Data", "hidden": 0, @@ -914,6 +974,7 @@ "bold": 0, "collapsible": 0, "columns": 0, + "fetch_if_empty": 0, "fieldname": "col_break3", "fieldtype": "Column Break", "hidden": 0, @@ -944,6 +1005,7 @@ "bold": 0, "collapsible": 0, "columns": 0, + "fetch_if_empty": 0, "fieldname": "min_order_qty", "fieldtype": "Float", "hidden": 0, @@ -979,6 +1041,7 @@ "bold": 0, "collapsible": 0, "columns": 0, + "fetch_if_empty": 0, "fieldname": "projected_qty", "fieldtype": "Float", "hidden": 0, @@ -1014,6 +1077,7 @@ "bold": 0, "collapsible": 0, "columns": 0, + "fetch_if_empty": 0, "fieldname": "actual_qty", "fieldtype": "Float", "hidden": 0, @@ -1046,6 +1110,7 @@ "bold": 0, "collapsible": 0, "columns": 0, + "fetch_if_empty": 0, "fieldname": "ordered_qty", "fieldtype": "Float", "hidden": 0, @@ -1079,6 +1144,7 @@ "bold": 0, "collapsible": 0, "columns": 0, + "fetch_if_empty": 0, "fieldname": "accounting_details", "fieldtype": "Section Break", "hidden": 0, @@ -1111,6 +1177,7 @@ "bold": 0, "collapsible": 0, "columns": 0, + "fetch_if_empty": 0, "fieldname": "expense_account", "fieldtype": "Link", "hidden": 0, @@ -1144,6 +1211,7 @@ "bold": 0, "collapsible": 0, "columns": 0, + "fetch_if_empty": 0, "fieldname": "column_break_35", "fieldtype": "Column Break", "hidden": 0, @@ -1175,6 +1243,7 @@ "bold": 0, "collapsible": 0, "columns": 0, + "fetch_if_empty": 0, "fieldname": "cost_center", "fieldtype": "Link", "hidden": 0, @@ -1208,6 +1277,7 @@ "bold": 0, "collapsible": 0, "columns": 0, + "fetch_if_empty": 0, "fieldname": "page_break", "fieldtype": "Check", "hidden": 0, @@ -1236,16 +1306,15 @@ } ], "has_web_view": 0, - "hide_heading": 0, "hide_toolbar": 0, "idx": 1, - "image_view": 0, "in_create": 0, "is_submittable": 0, "issingle": 0, "istable": 1, "max_attachments": 0, - "modified": "2019-01-07 16:57:19.927892", + "menu_index": 0, + "modified": "2019-04-22 10:49:17.793446", "modified_by": "Administrator", "module": "Stock", "name": "Material Request Item", @@ -1253,7 +1322,6 @@ "permissions": [], "quick_entry": 0, "read_only": 0, - "read_only_onload": 0, "show_name_in_global_search": 0, "sort_order": "DESC", "track_changes": 1, diff --git a/erpnext/stock/doctype/purchase_receipt/purchase_receipt.py b/erpnext/stock/doctype/purchase_receipt/purchase_receipt.py index 71cf1dab79..361137ecd2 100644 --- a/erpnext/stock/doctype/purchase_receipt/purchase_receipt.py +++ b/erpnext/stock/doctype/purchase_receipt/purchase_receipt.py @@ -35,6 +35,17 @@ class PurchaseReceipt(BuyingController): 'percent_join_field': 'purchase_order', 'overflow_type': 'receipt' }, + { + 'source_dt': 'Purchase Receipt Item', + 'target_dt': 'Material Request Item', + 'join_field': 'material_request_item', + 'target_field': 'received_qty', + 'target_parent_dt': 'Material Request', + 'target_parent_field': 'per_received', + 'target_ref_field': 'qty', + 'source_field': 'qty', + 'percent_join_field': 'material_request' + }, { 'source_dt': 'Purchase Receipt Item', 'target_dt': 'Purchase Order Item', diff --git a/erpnext/stock/doctype/purchase_receipt_item/purchase_receipt_item.json b/erpnext/stock/doctype/purchase_receipt_item/purchase_receipt_item.json index 7c50d8fea6..2cb7890ff3 100644 --- a/erpnext/stock/doctype/purchase_receipt_item/purchase_receipt_item.json +++ b/erpnext/stock/doctype/purchase_receipt_item/purchase_receipt_item.json @@ -1,2774 +1,2838 @@ { - "allow_copy": 0, - "allow_events_in_timeline": 0, - "allow_guest_to_view": 0, - "allow_import": 0, - "allow_rename": 0, - "autoname": "hash", - "beta": 0, - "creation": "2013-05-24 19:29:10", - "custom": 0, - "docstatus": 0, - "doctype": "DocType", - "document_type": "Document", - "editable_grid": 1, + "allow_copy": 0, + "allow_events_in_timeline": 0, + "allow_guest_to_view": 0, + "allow_import": 0, + "allow_rename": 0, + "autoname": "hash", + "beta": 0, + "creation": "2013-05-24 19:29:10", + "custom": 0, + "docstatus": 0, + "doctype": "DocType", + "document_type": "Document", + "editable_grid": 1, "fields": [ { - "allow_bulk_edit": 0, - "allow_in_quick_entry": 0, - "allow_on_submit": 0, - "bold": 0, - "collapsible": 0, - "columns": 0, - "fetch_if_empty": 0, - "fieldname": "barcode", - "fieldtype": "Data", - "hidden": 0, - "ignore_user_permissions": 0, - "ignore_xss_filter": 0, - "in_filter": 0, - "in_global_search": 0, - "in_list_view": 0, - "in_standard_filter": 0, - "label": "Barcode", - "length": 0, - "no_copy": 0, - "permlevel": 0, - "precision": "", - "print_hide": 0, - "print_hide_if_no_value": 0, - "read_only": 0, - "remember_last_selected_value": 0, - "report_hide": 0, - "reqd": 0, - "search_index": 0, - "set_only_once": 0, - "translatable": 0, + "allow_bulk_edit": 0, + "allow_in_quick_entry": 0, + "allow_on_submit": 0, + "bold": 0, + "collapsible": 0, + "columns": 0, + "fetch_if_empty": 0, + "fieldname": "barcode", + "fieldtype": "Data", + "hidden": 0, + "ignore_user_permissions": 0, + "ignore_xss_filter": 0, + "in_filter": 0, + "in_global_search": 0, + "in_list_view": 0, + "in_standard_filter": 0, + "label": "Barcode", + "length": 0, + "no_copy": 0, + "permlevel": 0, + "precision": "", + "print_hide": 0, + "print_hide_if_no_value": 0, + "read_only": 0, + "remember_last_selected_value": 0, + "report_hide": 0, + "reqd": 0, + "search_index": 0, + "set_only_once": 0, + "translatable": 0, "unique": 0 - }, + }, { - "allow_bulk_edit": 0, - "allow_in_quick_entry": 0, - "allow_on_submit": 0, - "bold": 0, - "collapsible": 0, - "columns": 0, - "fetch_if_empty": 0, - "fieldname": "section_break_2", - "fieldtype": "Section Break", - "hidden": 0, - "ignore_user_permissions": 0, - "ignore_xss_filter": 0, - "in_filter": 0, - "in_global_search": 0, - "in_list_view": 0, - "in_standard_filter": 0, - "length": 0, - "no_copy": 0, - "permlevel": 0, - "precision": "", - "print_hide": 0, - "print_hide_if_no_value": 0, - "read_only": 0, - "remember_last_selected_value": 0, - "report_hide": 0, - "reqd": 0, - "search_index": 0, - "set_only_once": 0, - "translatable": 0, + "allow_bulk_edit": 0, + "allow_in_quick_entry": 0, + "allow_on_submit": 0, + "bold": 0, + "collapsible": 0, + "columns": 0, + "fetch_if_empty": 0, + "fieldname": "section_break_2", + "fieldtype": "Section Break", + "hidden": 0, + "ignore_user_permissions": 0, + "ignore_xss_filter": 0, + "in_filter": 0, + "in_global_search": 0, + "in_list_view": 0, + "in_standard_filter": 0, + "length": 0, + "no_copy": 0, + "permlevel": 0, + "precision": "", + "print_hide": 0, + "print_hide_if_no_value": 0, + "read_only": 0, + "remember_last_selected_value": 0, + "report_hide": 0, + "reqd": 0, + "search_index": 0, + "set_only_once": 0, + "translatable": 0, "unique": 0 - }, + }, { - "allow_bulk_edit": 0, - "allow_in_quick_entry": 0, - "allow_on_submit": 0, - "bold": 1, - "collapsible": 0, - "columns": 3, - "fetch_if_empty": 0, - "fieldname": "item_code", - "fieldtype": "Link", - "hidden": 0, - "ignore_user_permissions": 0, - "ignore_xss_filter": 0, - "in_filter": 0, - "in_global_search": 1, - "in_list_view": 1, - "in_standard_filter": 0, - "label": "Item Code", - "length": 0, - "no_copy": 0, - "oldfieldname": "item_code", - "oldfieldtype": "Link", - "options": "Item", - "permlevel": 0, - "print_hide": 0, - "print_hide_if_no_value": 0, - "print_width": "100px", - "read_only": 0, - "remember_last_selected_value": 0, - "report_hide": 0, - "reqd": 1, - "search_index": 1, - "set_only_once": 0, - "translatable": 0, - "unique": 0, + "allow_bulk_edit": 0, + "allow_in_quick_entry": 0, + "allow_on_submit": 0, + "bold": 1, + "collapsible": 0, + "columns": 3, + "fetch_if_empty": 0, + "fieldname": "item_code", + "fieldtype": "Link", + "hidden": 0, + "ignore_user_permissions": 0, + "ignore_xss_filter": 0, + "in_filter": 0, + "in_global_search": 1, + "in_list_view": 1, + "in_standard_filter": 0, + "label": "Item Code", + "length": 0, + "no_copy": 0, + "oldfieldname": "item_code", + "oldfieldtype": "Link", + "options": "Item", + "permlevel": 0, + "print_hide": 0, + "print_hide_if_no_value": 0, + "print_width": "100px", + "read_only": 0, + "remember_last_selected_value": 0, + "report_hide": 0, + "reqd": 1, + "search_index": 1, + "set_only_once": 0, + "translatable": 0, + "unique": 0, "width": "100px" - }, + }, { - "allow_bulk_edit": 0, - "allow_in_quick_entry": 0, - "allow_on_submit": 0, - "bold": 0, - "collapsible": 0, - "columns": 0, - "fetch_if_empty": 0, - "fieldname": "supplier_part_no", - "fieldtype": "Data", - "hidden": 1, - "ignore_user_permissions": 0, - "ignore_xss_filter": 0, - "in_filter": 0, - "in_global_search": 0, - "in_list_view": 0, - "in_standard_filter": 0, - "label": "Supplier Part Number", - "length": 0, - "no_copy": 0, - "permlevel": 0, - "precision": "", - "print_hide": 0, - "print_hide_if_no_value": 0, - "read_only": 1, - "remember_last_selected_value": 0, - "report_hide": 0, - "reqd": 0, - "search_index": 0, - "set_only_once": 0, - "translatable": 0, + "allow_bulk_edit": 0, + "allow_in_quick_entry": 0, + "allow_on_submit": 0, + "bold": 0, + "collapsible": 0, + "columns": 0, + "fetch_if_empty": 0, + "fieldname": "supplier_part_no", + "fieldtype": "Data", + "hidden": 1, + "ignore_user_permissions": 0, + "ignore_xss_filter": 0, + "in_filter": 0, + "in_global_search": 0, + "in_list_view": 0, + "in_standard_filter": 0, + "label": "Supplier Part Number", + "length": 0, + "no_copy": 0, + "permlevel": 0, + "precision": "", + "print_hide": 0, + "print_hide_if_no_value": 0, + "read_only": 1, + "remember_last_selected_value": 0, + "report_hide": 0, + "reqd": 0, + "search_index": 0, + "set_only_once": 0, + "translatable": 0, "unique": 0 - }, + }, { - "allow_bulk_edit": 0, - "allow_in_quick_entry": 0, - "allow_on_submit": 0, - "bold": 0, - "collapsible": 0, - "columns": 0, - "fetch_if_empty": 0, - "fieldname": "column_break_2", - "fieldtype": "Column Break", - "hidden": 0, - "ignore_user_permissions": 0, - "ignore_xss_filter": 0, - "in_filter": 0, - "in_global_search": 0, - "in_list_view": 0, - "in_standard_filter": 0, - "length": 0, - "no_copy": 0, - "permlevel": 0, - "precision": "", - "print_hide": 0, - "print_hide_if_no_value": 0, - "read_only": 0, - "remember_last_selected_value": 0, - "report_hide": 0, - "reqd": 0, - "search_index": 0, - "set_only_once": 0, - "translatable": 0, + "allow_bulk_edit": 0, + "allow_in_quick_entry": 0, + "allow_on_submit": 0, + "bold": 0, + "collapsible": 0, + "columns": 0, + "fetch_if_empty": 0, + "fieldname": "column_break_2", + "fieldtype": "Column Break", + "hidden": 0, + "ignore_user_permissions": 0, + "ignore_xss_filter": 0, + "in_filter": 0, + "in_global_search": 0, + "in_list_view": 0, + "in_standard_filter": 0, + "length": 0, + "no_copy": 0, + "permlevel": 0, + "precision": "", + "print_hide": 0, + "print_hide_if_no_value": 0, + "read_only": 0, + "remember_last_selected_value": 0, + "report_hide": 0, + "reqd": 0, + "search_index": 0, + "set_only_once": 0, + "translatable": 0, "unique": 0 - }, + }, { - "allow_bulk_edit": 0, - "allow_in_quick_entry": 0, - "allow_on_submit": 0, - "bold": 0, - "collapsible": 0, - "columns": 0, - "fetch_if_empty": 0, - "fieldname": "item_name", - "fieldtype": "Data", - "hidden": 0, - "ignore_user_permissions": 0, - "ignore_xss_filter": 0, - "in_filter": 0, - "in_global_search": 1, - "in_list_view": 0, - "in_standard_filter": 0, - "label": "Item Name", - "length": 0, - "no_copy": 0, - "oldfieldname": "item_name", - "oldfieldtype": "Data", - "permlevel": 0, - "print_hide": 1, - "print_hide_if_no_value": 0, - "read_only": 0, - "remember_last_selected_value": 0, - "report_hide": 0, - "reqd": 1, - "search_index": 0, - "set_only_once": 0, - "translatable": 0, + "allow_bulk_edit": 0, + "allow_in_quick_entry": 0, + "allow_on_submit": 0, + "bold": 0, + "collapsible": 0, + "columns": 0, + "fetch_if_empty": 0, + "fieldname": "item_name", + "fieldtype": "Data", + "hidden": 0, + "ignore_user_permissions": 0, + "ignore_xss_filter": 0, + "in_filter": 0, + "in_global_search": 1, + "in_list_view": 0, + "in_standard_filter": 0, + "label": "Item Name", + "length": 0, + "no_copy": 0, + "oldfieldname": "item_name", + "oldfieldtype": "Data", + "permlevel": 0, + "print_hide": 1, + "print_hide_if_no_value": 0, + "read_only": 0, + "remember_last_selected_value": 0, + "report_hide": 0, + "reqd": 1, + "search_index": 0, + "set_only_once": 0, + "translatable": 0, "unique": 0 - }, + }, { - "allow_bulk_edit": 0, - "allow_in_quick_entry": 0, - "allow_on_submit": 0, - "bold": 0, - "collapsible": 1, - "columns": 0, - "fetch_if_empty": 0, - "fieldname": "section_break_4", - "fieldtype": "Section Break", - "hidden": 0, - "ignore_user_permissions": 0, - "ignore_xss_filter": 0, - "in_filter": 0, - "in_global_search": 0, - "in_list_view": 0, - "in_standard_filter": 0, - "label": "Description", - "length": 0, - "no_copy": 0, - "permlevel": 0, - "precision": "", - "print_hide": 0, - "print_hide_if_no_value": 0, - "read_only": 0, - "remember_last_selected_value": 0, - "report_hide": 0, - "reqd": 0, - "search_index": 0, - "set_only_once": 0, - "translatable": 0, + "allow_bulk_edit": 0, + "allow_in_quick_entry": 0, + "allow_on_submit": 0, + "bold": 0, + "collapsible": 1, + "columns": 0, + "fetch_if_empty": 0, + "fieldname": "section_break_4", + "fieldtype": "Section Break", + "hidden": 0, + "ignore_user_permissions": 0, + "ignore_xss_filter": 0, + "in_filter": 0, + "in_global_search": 0, + "in_list_view": 0, + "in_standard_filter": 0, + "label": "Description", + "length": 0, + "no_copy": 0, + "permlevel": 0, + "precision": "", + "print_hide": 0, + "print_hide_if_no_value": 0, + "read_only": 0, + "remember_last_selected_value": 0, + "report_hide": 0, + "reqd": 0, + "search_index": 0, + "set_only_once": 0, + "translatable": 0, "unique": 0 - }, + }, { - "allow_bulk_edit": 0, - "allow_in_quick_entry": 0, - "allow_on_submit": 0, - "bold": 0, - "collapsible": 0, - "columns": 0, - "fetch_if_empty": 0, - "fieldname": "description", - "fieldtype": "Text Editor", - "hidden": 0, - "ignore_user_permissions": 0, - "ignore_xss_filter": 0, - "in_filter": 0, - "in_global_search": 0, - "in_list_view": 0, - "in_standard_filter": 0, - "label": "Description", - "length": 0, - "no_copy": 0, - "oldfieldname": "description", - "oldfieldtype": "Text", - "permlevel": 0, - "print_hide": 0, - "print_hide_if_no_value": 0, - "print_width": "300px", - "read_only": 0, - "remember_last_selected_value": 0, - "report_hide": 0, - "reqd": 1, - "search_index": 0, - "set_only_once": 0, - "translatable": 0, - "unique": 0, + "allow_bulk_edit": 0, + "allow_in_quick_entry": 0, + "allow_on_submit": 0, + "bold": 0, + "collapsible": 0, + "columns": 0, + "fetch_if_empty": 0, + "fieldname": "description", + "fieldtype": "Text Editor", + "hidden": 0, + "ignore_user_permissions": 0, + "ignore_xss_filter": 0, + "in_filter": 0, + "in_global_search": 0, + "in_list_view": 0, + "in_standard_filter": 0, + "label": "Description", + "length": 0, + "no_copy": 0, + "oldfieldname": "description", + "oldfieldtype": "Text", + "permlevel": 0, + "print_hide": 0, + "print_hide_if_no_value": 0, + "print_width": "300px", + "read_only": 0, + "remember_last_selected_value": 0, + "report_hide": 0, + "reqd": 1, + "search_index": 0, + "set_only_once": 0, + "translatable": 0, + "unique": 0, "width": "300px" - }, + }, { - "allow_bulk_edit": 0, - "allow_in_quick_entry": 0, - "allow_on_submit": 0, - "bold": 0, - "collapsible": 0, - "columns": 0, - "fetch_if_empty": 0, - "fieldname": "col_break1", - "fieldtype": "Column Break", - "hidden": 0, - "ignore_user_permissions": 0, - "ignore_xss_filter": 0, - "in_filter": 0, - "in_global_search": 0, - "in_list_view": 0, - "in_standard_filter": 0, - "length": 0, - "no_copy": 0, - "permlevel": 0, - "print_hide": 0, - "print_hide_if_no_value": 0, - "read_only": 0, - "remember_last_selected_value": 0, - "report_hide": 0, - "reqd": 0, - "search_index": 0, - "set_only_once": 0, - "translatable": 0, + "allow_bulk_edit": 0, + "allow_in_quick_entry": 0, + "allow_on_submit": 0, + "bold": 0, + "collapsible": 0, + "columns": 0, + "fetch_if_empty": 0, + "fieldname": "col_break1", + "fieldtype": "Column Break", + "hidden": 0, + "ignore_user_permissions": 0, + "ignore_xss_filter": 0, + "in_filter": 0, + "in_global_search": 0, + "in_list_view": 0, + "in_standard_filter": 0, + "length": 0, + "no_copy": 0, + "permlevel": 0, + "print_hide": 0, + "print_hide_if_no_value": 0, + "read_only": 0, + "remember_last_selected_value": 0, + "report_hide": 0, + "reqd": 0, + "search_index": 0, + "set_only_once": 0, + "translatable": 0, "unique": 0 - }, + }, { - "allow_bulk_edit": 0, - "allow_in_quick_entry": 0, - "allow_on_submit": 0, - "bold": 0, - "collapsible": 0, - "columns": 0, - "fetch_if_empty": 0, - "fieldname": "image", - "fieldtype": "Attach", - "hidden": 1, - "ignore_user_permissions": 0, - "ignore_xss_filter": 0, - "in_filter": 0, - "in_global_search": 0, - "in_list_view": 0, - "in_standard_filter": 0, - "label": "Image", - "length": 0, - "no_copy": 0, - "permlevel": 0, - "precision": "", - "print_hide": 0, - "print_hide_if_no_value": 0, - "read_only": 0, - "remember_last_selected_value": 0, - "report_hide": 0, - "reqd": 0, - "search_index": 0, - "set_only_once": 0, - "translatable": 0, + "allow_bulk_edit": 0, + "allow_in_quick_entry": 0, + "allow_on_submit": 0, + "bold": 0, + "collapsible": 0, + "columns": 0, + "fetch_if_empty": 0, + "fieldname": "image", + "fieldtype": "Attach", + "hidden": 1, + "ignore_user_permissions": 0, + "ignore_xss_filter": 0, + "in_filter": 0, + "in_global_search": 0, + "in_list_view": 0, + "in_standard_filter": 0, + "label": "Image", + "length": 0, + "no_copy": 0, + "permlevel": 0, + "precision": "", + "print_hide": 0, + "print_hide_if_no_value": 0, + "read_only": 0, + "remember_last_selected_value": 0, + "report_hide": 0, + "reqd": 0, + "search_index": 0, + "set_only_once": 0, + "translatable": 0, "unique": 0 - }, + }, { - "allow_bulk_edit": 0, - "allow_in_quick_entry": 0, - "allow_on_submit": 0, - "bold": 0, - "collapsible": 0, - "columns": 0, - "fetch_if_empty": 0, - "fieldname": "image_view", - "fieldtype": "Image", - "hidden": 0, - "ignore_user_permissions": 0, - "ignore_xss_filter": 0, - "in_filter": 0, - "in_global_search": 0, - "in_list_view": 0, - "in_standard_filter": 0, - "label": "Image View", - "length": 0, - "no_copy": 0, - "options": "image", - "permlevel": 0, - "precision": "", - "print_hide": 1, - "print_hide_if_no_value": 0, - "read_only": 0, - "remember_last_selected_value": 0, - "report_hide": 0, - "reqd": 0, - "search_index": 0, - "set_only_once": 0, - "translatable": 0, + "allow_bulk_edit": 0, + "allow_in_quick_entry": 0, + "allow_on_submit": 0, + "bold": 0, + "collapsible": 0, + "columns": 0, + "fetch_if_empty": 0, + "fieldname": "image_view", + "fieldtype": "Image", + "hidden": 0, + "ignore_user_permissions": 0, + "ignore_xss_filter": 0, + "in_filter": 0, + "in_global_search": 0, + "in_list_view": 0, + "in_standard_filter": 0, + "label": "Image View", + "length": 0, + "no_copy": 0, + "options": "image", + "permlevel": 0, + "precision": "", + "print_hide": 1, + "print_hide_if_no_value": 0, + "read_only": 0, + "remember_last_selected_value": 0, + "report_hide": 0, + "reqd": 0, + "search_index": 0, + "set_only_once": 0, + "translatable": 0, "unique": 0 - }, + }, { - "allow_bulk_edit": 0, - "allow_in_quick_entry": 0, - "allow_on_submit": 0, - "bold": 0, - "collapsible": 0, - "columns": 0, - "fetch_if_empty": 0, - "fieldname": "received_and_accepted", - "fieldtype": "Section Break", - "hidden": 0, - "ignore_user_permissions": 0, - "ignore_xss_filter": 0, - "in_filter": 0, - "in_global_search": 0, - "in_list_view": 0, - "in_standard_filter": 0, - "label": "Received and Accepted", - "length": 0, - "no_copy": 0, - "permlevel": 0, - "print_hide": 0, - "print_hide_if_no_value": 0, - "read_only": 0, - "remember_last_selected_value": 0, - "report_hide": 0, - "reqd": 0, - "search_index": 0, - "set_only_once": 0, - "translatable": 0, + "allow_bulk_edit": 0, + "allow_in_quick_entry": 0, + "allow_on_submit": 0, + "bold": 0, + "collapsible": 0, + "columns": 0, + "fetch_if_empty": 0, + "fieldname": "received_and_accepted", + "fieldtype": "Section Break", + "hidden": 0, + "ignore_user_permissions": 0, + "ignore_xss_filter": 0, + "in_filter": 0, + "in_global_search": 0, + "in_list_view": 0, + "in_standard_filter": 0, + "label": "Received and Accepted", + "length": 0, + "no_copy": 0, + "permlevel": 0, + "print_hide": 0, + "print_hide_if_no_value": 0, + "read_only": 0, + "remember_last_selected_value": 0, + "report_hide": 0, + "reqd": 0, + "search_index": 0, + "set_only_once": 0, + "translatable": 0, "unique": 0 - }, + }, { - "allow_bulk_edit": 0, - "allow_in_quick_entry": 0, - "allow_on_submit": 0, - "bold": 1, - "collapsible": 0, - "columns": 0, - "fetch_if_empty": 0, - "fieldname": "received_qty", - "fieldtype": "Float", - "hidden": 0, - "ignore_user_permissions": 0, - "ignore_xss_filter": 0, - "in_filter": 0, - "in_global_search": 0, - "in_list_view": 0, - "in_standard_filter": 0, - "label": "Received Quantity", - "length": 0, - "no_copy": 0, - "oldfieldname": "received_qty", - "oldfieldtype": "Currency", - "permlevel": 0, - "print_hide": 1, - "print_hide_if_no_value": 0, - "print_width": "100px", - "read_only": 0, - "remember_last_selected_value": 0, - "report_hide": 0, - "reqd": 1, - "search_index": 0, - "set_only_once": 0, - "translatable": 0, - "unique": 0, + "allow_bulk_edit": 0, + "allow_in_quick_entry": 0, + "allow_on_submit": 0, + "bold": 1, + "collapsible": 0, + "columns": 0, + "fetch_if_empty": 0, + "fieldname": "received_qty", + "fieldtype": "Float", + "hidden": 0, + "ignore_user_permissions": 0, + "ignore_xss_filter": 0, + "in_filter": 0, + "in_global_search": 0, + "in_list_view": 0, + "in_standard_filter": 0, + "label": "Received Quantity", + "length": 0, + "no_copy": 0, + "oldfieldname": "received_qty", + "oldfieldtype": "Currency", + "permlevel": 0, + "print_hide": 1, + "print_hide_if_no_value": 0, + "print_width": "100px", + "read_only": 0, + "remember_last_selected_value": 0, + "report_hide": 0, + "reqd": 1, + "search_index": 0, + "set_only_once": 0, + "translatable": 0, + "unique": 0, "width": "100px" - }, + }, { - "allow_bulk_edit": 0, - "allow_in_quick_entry": 0, - "allow_on_submit": 0, - "bold": 0, - "collapsible": 0, - "columns": 2, - "fetch_if_empty": 0, - "fieldname": "qty", - "fieldtype": "Float", - "hidden": 0, - "ignore_user_permissions": 0, - "ignore_xss_filter": 0, - "in_filter": 0, - "in_global_search": 0, - "in_list_view": 1, - "in_standard_filter": 0, - "label": "Accepted Quantity", - "length": 0, - "no_copy": 0, - "oldfieldname": "qty", - "oldfieldtype": "Currency", - "permlevel": 0, - "print_hide": 0, - "print_hide_if_no_value": 0, - "print_width": "100px", - "read_only": 0, - "remember_last_selected_value": 0, - "report_hide": 0, - "reqd": 0, - "search_index": 0, - "set_only_once": 0, - "translatable": 0, - "unique": 0, + "allow_bulk_edit": 0, + "allow_in_quick_entry": 0, + "allow_on_submit": 0, + "bold": 0, + "collapsible": 0, + "columns": 2, + "fetch_if_empty": 0, + "fieldname": "qty", + "fieldtype": "Float", + "hidden": 0, + "ignore_user_permissions": 0, + "ignore_xss_filter": 0, + "in_filter": 0, + "in_global_search": 0, + "in_list_view": 1, + "in_standard_filter": 0, + "label": "Accepted Quantity", + "length": 0, + "no_copy": 0, + "oldfieldname": "qty", + "oldfieldtype": "Currency", + "permlevel": 0, + "print_hide": 0, + "print_hide_if_no_value": 0, + "print_width": "100px", + "read_only": 0, + "remember_last_selected_value": 0, + "report_hide": 0, + "reqd": 0, + "search_index": 0, + "set_only_once": 0, + "translatable": 0, + "unique": 0, "width": "100px" - }, + }, { - "allow_bulk_edit": 0, - "allow_in_quick_entry": 0, - "allow_on_submit": 0, - "bold": 0, - "collapsible": 0, - "columns": 0, - "fetch_if_empty": 0, - "fieldname": "rejected_qty", - "fieldtype": "Float", - "hidden": 0, - "ignore_user_permissions": 0, - "ignore_xss_filter": 0, - "in_filter": 0, - "in_global_search": 0, - "in_list_view": 0, - "in_standard_filter": 0, - "label": "Rejected Quantity", - "length": 0, - "no_copy": 0, - "oldfieldname": "rejected_qty", - "oldfieldtype": "Currency", - "permlevel": 0, - "print_hide": 1, - "print_hide_if_no_value": 0, - "print_width": "100px", - "read_only": 0, - "remember_last_selected_value": 0, - "report_hide": 0, - "reqd": 0, - "search_index": 0, - "set_only_once": 0, - "translatable": 0, - "unique": 0, + "allow_bulk_edit": 0, + "allow_in_quick_entry": 0, + "allow_on_submit": 0, + "bold": 0, + "collapsible": 0, + "columns": 0, + "fetch_if_empty": 0, + "fieldname": "rejected_qty", + "fieldtype": "Float", + "hidden": 0, + "ignore_user_permissions": 0, + "ignore_xss_filter": 0, + "in_filter": 0, + "in_global_search": 0, + "in_list_view": 0, + "in_standard_filter": 0, + "label": "Rejected Quantity", + "length": 0, + "no_copy": 0, + "oldfieldname": "rejected_qty", + "oldfieldtype": "Currency", + "permlevel": 0, + "print_hide": 1, + "print_hide_if_no_value": 0, + "print_width": "100px", + "read_only": 0, + "remember_last_selected_value": 0, + "report_hide": 0, + "reqd": 0, + "search_index": 0, + "set_only_once": 0, + "translatable": 0, + "unique": 0, "width": "100px" - }, + }, { - "allow_bulk_edit": 0, - "allow_in_quick_entry": 0, - "allow_on_submit": 0, - "bold": 0, - "collapsible": 0, - "columns": 0, - "fetch_if_empty": 0, - "fieldname": "col_break2", - "fieldtype": "Column Break", - "hidden": 0, - "ignore_user_permissions": 0, - "ignore_xss_filter": 0, - "in_filter": 0, - "in_global_search": 0, - "in_list_view": 0, - "in_standard_filter": 0, - "length": 0, - "no_copy": 0, - "permlevel": 0, - "precision": "", - "print_hide": 1, - "print_hide_if_no_value": 0, - "read_only": 0, - "remember_last_selected_value": 0, - "report_hide": 0, - "reqd": 0, - "search_index": 0, - "set_only_once": 0, - "translatable": 0, + "allow_bulk_edit": 0, + "allow_in_quick_entry": 0, + "allow_on_submit": 0, + "bold": 0, + "collapsible": 0, + "columns": 0, + "fetch_if_empty": 0, + "fieldname": "col_break2", + "fieldtype": "Column Break", + "hidden": 0, + "ignore_user_permissions": 0, + "ignore_xss_filter": 0, + "in_filter": 0, + "in_global_search": 0, + "in_list_view": 0, + "in_standard_filter": 0, + "length": 0, + "no_copy": 0, + "permlevel": 0, + "precision": "", + "print_hide": 1, + "print_hide_if_no_value": 0, + "read_only": 0, + "remember_last_selected_value": 0, + "report_hide": 0, + "reqd": 0, + "search_index": 0, + "set_only_once": 0, + "translatable": 0, "unique": 0 - }, + }, { - "allow_bulk_edit": 0, - "allow_in_quick_entry": 0, - "allow_on_submit": 0, - "bold": 0, - "collapsible": 0, - "columns": 0, - "fetch_if_empty": 0, - "fieldname": "uom", - "fieldtype": "Link", - "hidden": 0, - "ignore_user_permissions": 0, - "ignore_xss_filter": 0, - "in_filter": 0, - "in_global_search": 0, - "in_list_view": 0, - "in_standard_filter": 0, - "label": "UOM", - "length": 0, - "no_copy": 0, - "oldfieldname": "uom", - "oldfieldtype": "Link", - "options": "UOM", - "permlevel": 0, - "precision": "", - "print_hide": 1, - "print_hide_if_no_value": 0, - "print_width": "100px", - "read_only": 0, - "remember_last_selected_value": 0, - "report_hide": 0, - "reqd": 1, - "search_index": 0, - "set_only_once": 0, - "translatable": 0, - "unique": 0, + "allow_bulk_edit": 0, + "allow_in_quick_entry": 0, + "allow_on_submit": 0, + "bold": 0, + "collapsible": 0, + "columns": 0, + "fetch_if_empty": 0, + "fieldname": "uom", + "fieldtype": "Link", + "hidden": 0, + "ignore_user_permissions": 0, + "ignore_xss_filter": 0, + "in_filter": 0, + "in_global_search": 0, + "in_list_view": 0, + "in_standard_filter": 0, + "label": "UOM", + "length": 0, + "no_copy": 0, + "oldfieldname": "uom", + "oldfieldtype": "Link", + "options": "UOM", + "permlevel": 0, + "precision": "", + "print_hide": 1, + "print_hide_if_no_value": 0, + "print_width": "100px", + "read_only": 0, + "remember_last_selected_value": 0, + "report_hide": 0, + "reqd": 1, + "search_index": 0, + "set_only_once": 0, + "translatable": 0, + "unique": 0, "width": "100px" - }, + }, { - "allow_bulk_edit": 0, - "allow_in_quick_entry": 0, - "allow_on_submit": 0, - "bold": 0, - "collapsible": 0, - "columns": 0, - "fetch_if_empty": 0, - "fieldname": "stock_uom", - "fieldtype": "Link", - "hidden": 0, - "ignore_user_permissions": 0, - "ignore_xss_filter": 0, - "in_filter": 0, - "in_global_search": 0, - "in_list_view": 0, - "in_standard_filter": 0, - "label": "Stock UOM", - "length": 0, - "no_copy": 0, - "oldfieldname": "stock_uom", - "oldfieldtype": "Data", - "options": "UOM", - "permlevel": 0, - "print_hide": 1, - "print_hide_if_no_value": 0, - "print_width": "100px", - "read_only": 1, - "remember_last_selected_value": 0, - "report_hide": 0, - "reqd": 1, - "search_index": 0, - "set_only_once": 0, - "translatable": 0, - "unique": 0, + "allow_bulk_edit": 0, + "allow_in_quick_entry": 0, + "allow_on_submit": 0, + "bold": 0, + "collapsible": 0, + "columns": 0, + "fetch_if_empty": 0, + "fieldname": "stock_uom", + "fieldtype": "Link", + "hidden": 0, + "ignore_user_permissions": 0, + "ignore_xss_filter": 0, + "in_filter": 0, + "in_global_search": 0, + "in_list_view": 0, + "in_standard_filter": 0, + "label": "Stock UOM", + "length": 0, + "no_copy": 0, + "oldfieldname": "stock_uom", + "oldfieldtype": "Data", + "options": "UOM", + "permlevel": 0, + "print_hide": 1, + "print_hide_if_no_value": 0, + "print_width": "100px", + "read_only": 1, + "remember_last_selected_value": 0, + "report_hide": 0, + "reqd": 1, + "search_index": 0, + "set_only_once": 0, + "translatable": 0, + "unique": 0, "width": "100px" - }, + }, { - "allow_bulk_edit": 0, - "allow_in_quick_entry": 0, - "allow_on_submit": 0, - "bold": 0, - "collapsible": 0, - "columns": 0, - "fetch_if_empty": 0, - "fieldname": "conversion_factor", - "fieldtype": "Float", - "hidden": 0, - "ignore_user_permissions": 0, - "ignore_xss_filter": 0, - "in_filter": 0, - "in_global_search": 0, - "in_list_view": 0, - "in_standard_filter": 0, - "label": "Conversion Factor", - "length": 0, - "no_copy": 0, - "oldfieldname": "conversion_factor", - "oldfieldtype": "Currency", - "permlevel": 0, - "precision": "", - "print_hide": 1, - "print_hide_if_no_value": 0, - "print_width": "100px", - "read_only": 0, - "remember_last_selected_value": 0, - "report_hide": 0, - "reqd": 1, - "search_index": 0, - "set_only_once": 0, - "translatable": 0, - "unique": 0, + "allow_bulk_edit": 0, + "allow_in_quick_entry": 0, + "allow_on_submit": 0, + "bold": 0, + "collapsible": 0, + "columns": 0, + "fetch_if_empty": 0, + "fieldname": "conversion_factor", + "fieldtype": "Float", + "hidden": 0, + "ignore_user_permissions": 0, + "ignore_xss_filter": 0, + "in_filter": 0, + "in_global_search": 0, + "in_list_view": 0, + "in_standard_filter": 0, + "label": "Conversion Factor", + "length": 0, + "no_copy": 0, + "oldfieldname": "conversion_factor", + "oldfieldtype": "Currency", + "permlevel": 0, + "precision": "", + "print_hide": 1, + "print_hide_if_no_value": 0, + "print_width": "100px", + "read_only": 0, + "remember_last_selected_value": 0, + "report_hide": 0, + "reqd": 1, + "search_index": 0, + "set_only_once": 0, + "translatable": 0, + "unique": 0, "width": "100px" - }, + }, { - "allow_bulk_edit": 0, - "allow_in_quick_entry": 0, - "allow_on_submit": 0, - "bold": 0, - "collapsible": 0, - "columns": 0, - "fetch_from": "item_code.retain_sample", - "fetch_if_empty": 0, - "fieldname": "retain_sample", - "fieldtype": "Check", - "hidden": 0, - "ignore_user_permissions": 0, - "ignore_xss_filter": 0, - "in_filter": 0, - "in_global_search": 0, - "in_list_view": 0, - "in_standard_filter": 0, - "label": "Retain Sample", - "length": 0, - "no_copy": 0, - "options": "", - "permlevel": 0, - "precision": "", - "print_hide": 0, - "print_hide_if_no_value": 0, - "read_only": 1, - "remember_last_selected_value": 0, - "report_hide": 0, - "reqd": 0, - "search_index": 0, - "set_only_once": 0, - "translatable": 0, + "allow_bulk_edit": 0, + "allow_in_quick_entry": 0, + "allow_on_submit": 0, + "bold": 0, + "collapsible": 0, + "columns": 0, + "fetch_from": "item_code.retain_sample", + "fetch_if_empty": 0, + "fieldname": "retain_sample", + "fieldtype": "Check", + "hidden": 0, + "ignore_user_permissions": 0, + "ignore_xss_filter": 0, + "in_filter": 0, + "in_global_search": 0, + "in_list_view": 0, + "in_standard_filter": 0, + "label": "Retain Sample", + "length": 0, + "no_copy": 0, + "options": "", + "permlevel": 0, + "precision": "", + "print_hide": 0, + "print_hide_if_no_value": 0, + "read_only": 1, + "remember_last_selected_value": 0, + "report_hide": 0, + "reqd": 0, + "search_index": 0, + "set_only_once": 0, + "translatable": 0, "unique": 0 - }, + }, { - "allow_bulk_edit": 0, - "allow_in_quick_entry": 0, - "allow_on_submit": 0, - "bold": 0, - "collapsible": 0, - "columns": 0, - "depends_on": "retain_sample", - "fetch_from": "item_code.sample_quantity", - "fetch_if_empty": 0, - "fieldname": "sample_quantity", - "fieldtype": "Int", - "hidden": 0, - "ignore_user_permissions": 0, - "ignore_xss_filter": 0, - "in_filter": 0, - "in_global_search": 0, - "in_list_view": 0, - "in_standard_filter": 0, - "label": "Sample Quantity", - "length": 0, - "no_copy": 0, - "options": "", - "permlevel": 0, - "precision": "", - "print_hide": 0, - "print_hide_if_no_value": 0, - "read_only": 0, - "remember_last_selected_value": 0, - "report_hide": 0, - "reqd": 0, - "search_index": 0, - "set_only_once": 0, - "translatable": 0, + "allow_bulk_edit": 0, + "allow_in_quick_entry": 0, + "allow_on_submit": 0, + "bold": 0, + "collapsible": 0, + "columns": 0, + "depends_on": "retain_sample", + "fetch_from": "item_code.sample_quantity", + "fetch_if_empty": 0, + "fieldname": "sample_quantity", + "fieldtype": "Int", + "hidden": 0, + "ignore_user_permissions": 0, + "ignore_xss_filter": 0, + "in_filter": 0, + "in_global_search": 0, + "in_list_view": 0, + "in_standard_filter": 0, + "label": "Sample Quantity", + "length": 0, + "no_copy": 0, + "options": "", + "permlevel": 0, + "precision": "", + "print_hide": 0, + "print_hide_if_no_value": 0, + "read_only": 0, + "remember_last_selected_value": 0, + "report_hide": 0, + "reqd": 0, + "search_index": 0, + "set_only_once": 0, + "translatable": 0, "unique": 0 - }, + }, { - "allow_bulk_edit": 0, - "allow_in_quick_entry": 0, - "allow_on_submit": 0, - "bold": 0, - "collapsible": 0, - "columns": 0, - "fetch_if_empty": 0, - "fieldname": "rate_and_amount", - "fieldtype": "Section Break", - "hidden": 0, - "ignore_user_permissions": 0, - "ignore_xss_filter": 0, - "in_filter": 0, - "in_global_search": 0, - "in_list_view": 0, - "in_standard_filter": 0, - "label": "Rate and Amount", - "length": 0, - "no_copy": 0, - "permlevel": 0, - "print_hide": 0, - "print_hide_if_no_value": 0, - "read_only": 0, - "remember_last_selected_value": 0, - "report_hide": 0, - "reqd": 0, - "search_index": 0, - "set_only_once": 0, - "translatable": 0, + "allow_bulk_edit": 0, + "allow_in_quick_entry": 0, + "allow_on_submit": 0, + "bold": 0, + "collapsible": 0, + "columns": 0, + "fetch_if_empty": 0, + "fieldname": "rate_and_amount", + "fieldtype": "Section Break", + "hidden": 0, + "ignore_user_permissions": 0, + "ignore_xss_filter": 0, + "in_filter": 0, + "in_global_search": 0, + "in_list_view": 0, + "in_standard_filter": 0, + "label": "Rate and Amount", + "length": 0, + "no_copy": 0, + "permlevel": 0, + "print_hide": 0, + "print_hide_if_no_value": 0, + "read_only": 0, + "remember_last_selected_value": 0, + "report_hide": 0, + "reqd": 0, + "search_index": 0, + "set_only_once": 0, + "translatable": 0, "unique": 0 - }, + }, { - "allow_bulk_edit": 0, - "allow_in_quick_entry": 0, - "allow_on_submit": 0, - "bold": 0, - "collapsible": 0, - "columns": 0, - "fetch_if_empty": 0, - "fieldname": "price_list_rate", - "fieldtype": "Currency", - "hidden": 0, - "ignore_user_permissions": 0, - "ignore_xss_filter": 0, - "in_filter": 0, - "in_global_search": 0, - "in_list_view": 0, - "in_standard_filter": 0, - "label": "Price List Rate", - "length": 0, - "no_copy": 0, - "options": "currency", - "permlevel": 0, - "print_hide": 1, - "print_hide_if_no_value": 0, - "read_only": 0, - "remember_last_selected_value": 0, - "report_hide": 0, - "reqd": 0, - "search_index": 0, - "set_only_once": 0, - "translatable": 0, + "allow_bulk_edit": 0, + "allow_in_quick_entry": 0, + "allow_on_submit": 0, + "bold": 0, + "collapsible": 0, + "columns": 0, + "fetch_if_empty": 0, + "fieldname": "price_list_rate", + "fieldtype": "Currency", + "hidden": 0, + "ignore_user_permissions": 0, + "ignore_xss_filter": 0, + "in_filter": 0, + "in_global_search": 0, + "in_list_view": 0, + "in_standard_filter": 0, + "label": "Price List Rate", + "length": 0, + "no_copy": 0, + "options": "currency", + "permlevel": 0, + "print_hide": 1, + "print_hide_if_no_value": 0, + "read_only": 0, + "remember_last_selected_value": 0, + "report_hide": 0, + "reqd": 0, + "search_index": 0, + "set_only_once": 0, + "translatable": 0, "unique": 0 - }, + }, { - "allow_bulk_edit": 0, - "allow_in_quick_entry": 0, - "allow_on_submit": 0, - "bold": 0, - "collapsible": 0, - "columns": 0, - "depends_on": "price_list_rate", - "fetch_if_empty": 0, - "fieldname": "discount_percentage", - "fieldtype": "Percent", - "hidden": 0, - "ignore_user_permissions": 0, - "ignore_xss_filter": 0, - "in_filter": 0, - "in_global_search": 0, - "in_list_view": 0, - "in_standard_filter": 0, - "label": "Discount on Price List Rate (%)", - "length": 0, - "no_copy": 0, - "permlevel": 0, - "print_hide": 1, - "print_hide_if_no_value": 0, - "read_only": 0, - "remember_last_selected_value": 0, - "report_hide": 0, - "reqd": 0, - "search_index": 0, - "set_only_once": 0, - "translatable": 0, + "allow_bulk_edit": 0, + "allow_in_quick_entry": 0, + "allow_on_submit": 0, + "bold": 0, + "collapsible": 0, + "columns": 0, + "depends_on": "price_list_rate", + "fetch_if_empty": 0, + "fieldname": "discount_percentage", + "fieldtype": "Percent", + "hidden": 0, + "ignore_user_permissions": 0, + "ignore_xss_filter": 0, + "in_filter": 0, + "in_global_search": 0, + "in_list_view": 0, + "in_standard_filter": 0, + "label": "Discount on Price List Rate (%)", + "length": 0, + "no_copy": 0, + "permlevel": 0, + "print_hide": 1, + "print_hide_if_no_value": 0, + "read_only": 0, + "remember_last_selected_value": 0, + "report_hide": 0, + "reqd": 0, + "search_index": 0, + "set_only_once": 0, + "translatable": 0, "unique": 0 - }, + }, { - "allow_bulk_edit": 0, - "allow_in_quick_entry": 0, - "allow_on_submit": 0, - "bold": 0, - "collapsible": 0, - "columns": 0, - "depends_on": "price_list_rate", - "fetch_if_empty": 0, - "fieldname": "discount_amount", - "fieldtype": "Currency", - "hidden": 0, - "ignore_user_permissions": 0, - "ignore_xss_filter": 0, - "in_filter": 0, - "in_global_search": 0, - "in_list_view": 0, - "in_standard_filter": 0, - "label": "Discount Amount", - "length": 0, - "no_copy": 0, - "options": "currency", - "permlevel": 0, - "precision": "", - "print_hide": 0, - "print_hide_if_no_value": 0, - "read_only": 0, - "remember_last_selected_value": 0, - "report_hide": 0, - "reqd": 0, - "search_index": 0, - "set_only_once": 0, - "translatable": 0, + "allow_bulk_edit": 0, + "allow_in_quick_entry": 0, + "allow_on_submit": 0, + "bold": 0, + "collapsible": 0, + "columns": 0, + "depends_on": "price_list_rate", + "fetch_if_empty": 0, + "fieldname": "discount_amount", + "fieldtype": "Currency", + "hidden": 0, + "ignore_user_permissions": 0, + "ignore_xss_filter": 0, + "in_filter": 0, + "in_global_search": 0, + "in_list_view": 0, + "in_standard_filter": 0, + "label": "Discount Amount", + "length": 0, + "no_copy": 0, + "options": "currency", + "permlevel": 0, + "precision": "", + "print_hide": 0, + "print_hide_if_no_value": 0, + "read_only": 0, + "remember_last_selected_value": 0, + "report_hide": 0, + "reqd": 0, + "search_index": 0, + "set_only_once": 0, + "translatable": 0, "unique": 0 - }, + }, { - "allow_bulk_edit": 0, - "allow_in_quick_entry": 0, - "allow_on_submit": 0, - "bold": 0, - "collapsible": 0, - "columns": 0, - "depends_on": "", - "fetch_if_empty": 0, - "fieldname": "col_break3", - "fieldtype": "Column Break", - "hidden": 0, - "ignore_user_permissions": 0, - "ignore_xss_filter": 0, - "in_filter": 0, - "in_global_search": 0, - "in_list_view": 0, - "in_standard_filter": 0, - "length": 0, - "no_copy": 0, - "permlevel": 0, - "print_hide": 0, - "print_hide_if_no_value": 0, - "read_only": 0, - "remember_last_selected_value": 0, - "report_hide": 0, - "reqd": 0, - "search_index": 0, - "set_only_once": 0, - "translatable": 0, + "allow_bulk_edit": 0, + "allow_in_quick_entry": 0, + "allow_on_submit": 0, + "bold": 0, + "collapsible": 0, + "columns": 0, + "depends_on": "", + "fetch_if_empty": 0, + "fieldname": "col_break3", + "fieldtype": "Column Break", + "hidden": 0, + "ignore_user_permissions": 0, + "ignore_xss_filter": 0, + "in_filter": 0, + "in_global_search": 0, + "in_list_view": 0, + "in_standard_filter": 0, + "length": 0, + "no_copy": 0, + "permlevel": 0, + "print_hide": 0, + "print_hide_if_no_value": 0, + "read_only": 0, + "remember_last_selected_value": 0, + "report_hide": 0, + "reqd": 0, + "search_index": 0, + "set_only_once": 0, + "translatable": 0, "unique": 0 - }, + }, { - "allow_bulk_edit": 0, - "allow_in_quick_entry": 0, - "allow_on_submit": 0, - "bold": 0, - "collapsible": 0, - "columns": 0, - "depends_on": "", - "fetch_if_empty": 0, - "fieldname": "base_price_list_rate", - "fieldtype": "Currency", - "hidden": 0, - "ignore_user_permissions": 0, - "ignore_xss_filter": 0, - "in_filter": 0, - "in_global_search": 0, - "in_list_view": 0, - "in_standard_filter": 0, - "label": "Price List Rate (Company Currency)", - "length": 0, - "no_copy": 0, - "options": "Company:company:default_currency", - "permlevel": 0, - "print_hide": 1, - "print_hide_if_no_value": 0, - "read_only": 1, - "remember_last_selected_value": 0, - "report_hide": 0, - "reqd": 0, - "search_index": 0, - "set_only_once": 0, - "translatable": 0, + "allow_bulk_edit": 0, + "allow_in_quick_entry": 0, + "allow_on_submit": 0, + "bold": 0, + "collapsible": 0, + "columns": 0, + "depends_on": "", + "fetch_if_empty": 0, + "fieldname": "base_price_list_rate", + "fieldtype": "Currency", + "hidden": 0, + "ignore_user_permissions": 0, + "ignore_xss_filter": 0, + "in_filter": 0, + "in_global_search": 0, + "in_list_view": 0, + "in_standard_filter": 0, + "label": "Price List Rate (Company Currency)", + "length": 0, + "no_copy": 0, + "options": "Company:company:default_currency", + "permlevel": 0, + "print_hide": 1, + "print_hide_if_no_value": 0, + "read_only": 1, + "remember_last_selected_value": 0, + "report_hide": 0, + "reqd": 0, + "search_index": 0, + "set_only_once": 0, + "translatable": 0, "unique": 0 - }, + }, { - "allow_bulk_edit": 0, - "allow_in_quick_entry": 0, - "allow_on_submit": 0, - "bold": 0, - "collapsible": 0, - "columns": 0, - "depends_on": "", - "fetch_if_empty": 0, - "fieldname": "sec_break1", - "fieldtype": "Section Break", - "hidden": 0, - "ignore_user_permissions": 0, - "ignore_xss_filter": 0, - "in_filter": 0, - "in_global_search": 0, - "in_list_view": 0, - "in_standard_filter": 0, - "length": 0, - "no_copy": 0, - "permlevel": 0, - "print_hide": 0, - "print_hide_if_no_value": 0, - "read_only": 0, - "remember_last_selected_value": 0, - "report_hide": 0, - "reqd": 0, - "search_index": 0, - "set_only_once": 0, - "translatable": 0, + "allow_bulk_edit": 0, + "allow_in_quick_entry": 0, + "allow_on_submit": 0, + "bold": 0, + "collapsible": 0, + "columns": 0, + "depends_on": "", + "fetch_if_empty": 0, + "fieldname": "sec_break1", + "fieldtype": "Section Break", + "hidden": 0, + "ignore_user_permissions": 0, + "ignore_xss_filter": 0, + "in_filter": 0, + "in_global_search": 0, + "in_list_view": 0, + "in_standard_filter": 0, + "length": 0, + "no_copy": 0, + "permlevel": 0, + "print_hide": 0, + "print_hide_if_no_value": 0, + "read_only": 0, + "remember_last_selected_value": 0, + "report_hide": 0, + "reqd": 0, + "search_index": 0, + "set_only_once": 0, + "translatable": 0, "unique": 0 - }, + }, { - "allow_bulk_edit": 0, - "allow_in_quick_entry": 0, - "allow_on_submit": 0, - "bold": 1, - "collapsible": 0, - "columns": 3, - "fetch_if_empty": 0, - "fieldname": "rate", - "fieldtype": "Currency", - "hidden": 0, - "ignore_user_permissions": 0, - "ignore_xss_filter": 0, - "in_filter": 0, - "in_global_search": 0, - "in_list_view": 1, - "in_standard_filter": 0, - "label": "Rate", - "length": 0, - "no_copy": 0, - "oldfieldname": "import_rate", - "oldfieldtype": "Currency", - "options": "currency", - "permlevel": 0, - "print_hide": 0, - "print_hide_if_no_value": 0, - "print_width": "100px", - "read_only": 0, - "remember_last_selected_value": 0, - "report_hide": 0, - "reqd": 0, - "search_index": 0, - "set_only_once": 0, - "translatable": 0, - "unique": 0, + "allow_bulk_edit": 0, + "allow_in_quick_entry": 0, + "allow_on_submit": 0, + "bold": 1, + "collapsible": 0, + "columns": 3, + "fetch_if_empty": 0, + "fieldname": "rate", + "fieldtype": "Currency", + "hidden": 0, + "ignore_user_permissions": 0, + "ignore_xss_filter": 0, + "in_filter": 0, + "in_global_search": 0, + "in_list_view": 1, + "in_standard_filter": 0, + "label": "Rate", + "length": 0, + "no_copy": 0, + "oldfieldname": "import_rate", + "oldfieldtype": "Currency", + "options": "currency", + "permlevel": 0, + "print_hide": 0, + "print_hide_if_no_value": 0, + "print_width": "100px", + "read_only": 0, + "remember_last_selected_value": 0, + "report_hide": 0, + "reqd": 0, + "search_index": 0, + "set_only_once": 0, + "translatable": 0, + "unique": 0, "width": "100px" - }, + }, { - "allow_bulk_edit": 0, - "allow_in_quick_entry": 0, - "allow_on_submit": 0, - "bold": 0, - "collapsible": 0, - "columns": 0, - "fetch_if_empty": 0, - "fieldname": "amount", - "fieldtype": "Currency", - "hidden": 0, - "ignore_user_permissions": 0, - "ignore_xss_filter": 0, - "in_filter": 0, - "in_global_search": 0, - "in_list_view": 1, - "in_standard_filter": 0, - "label": "Amount", - "length": 0, - "no_copy": 0, - "oldfieldname": "import_amount", - "oldfieldtype": "Currency", - "options": "currency", - "permlevel": 0, - "print_hide": 0, - "print_hide_if_no_value": 0, - "read_only": 1, - "remember_last_selected_value": 0, - "report_hide": 0, - "reqd": 0, - "search_index": 0, - "set_only_once": 0, - "translatable": 0, + "allow_bulk_edit": 0, + "allow_in_quick_entry": 0, + "allow_on_submit": 0, + "bold": 0, + "collapsible": 0, + "columns": 0, + "fetch_if_empty": 0, + "fieldname": "amount", + "fieldtype": "Currency", + "hidden": 0, + "ignore_user_permissions": 0, + "ignore_xss_filter": 0, + "in_filter": 0, + "in_global_search": 0, + "in_list_view": 1, + "in_standard_filter": 0, + "label": "Amount", + "length": 0, + "no_copy": 0, + "oldfieldname": "import_amount", + "oldfieldtype": "Currency", + "options": "currency", + "permlevel": 0, + "print_hide": 0, + "print_hide_if_no_value": 0, + "read_only": 1, + "remember_last_selected_value": 0, + "report_hide": 0, + "reqd": 0, + "search_index": 0, + "set_only_once": 0, + "translatable": 0, "unique": 0 - }, + }, { - "allow_bulk_edit": 0, - "allow_in_quick_entry": 0, - "allow_on_submit": 0, - "bold": 0, - "collapsible": 0, - "columns": 0, - "fetch_if_empty": 0, - "fieldname": "col_break4", - "fieldtype": "Column Break", - "hidden": 0, - "ignore_user_permissions": 0, - "ignore_xss_filter": 0, - "in_filter": 0, - "in_global_search": 0, - "in_list_view": 0, - "in_standard_filter": 0, - "length": 0, - "no_copy": 0, - "permlevel": 0, - "print_hide": 0, - "print_hide_if_no_value": 0, - "read_only": 0, - "remember_last_selected_value": 0, - "report_hide": 0, - "reqd": 0, - "search_index": 0, - "set_only_once": 0, - "translatable": 0, + "allow_bulk_edit": 0, + "allow_in_quick_entry": 0, + "allow_on_submit": 0, + "bold": 0, + "collapsible": 0, + "columns": 0, + "fetch_if_empty": 0, + "fieldname": "col_break4", + "fieldtype": "Column Break", + "hidden": 0, + "ignore_user_permissions": 0, + "ignore_xss_filter": 0, + "in_filter": 0, + "in_global_search": 0, + "in_list_view": 0, + "in_standard_filter": 0, + "length": 0, + "no_copy": 0, + "permlevel": 0, + "print_hide": 0, + "print_hide_if_no_value": 0, + "read_only": 0, + "remember_last_selected_value": 0, + "report_hide": 0, + "reqd": 0, + "search_index": 0, + "set_only_once": 0, + "translatable": 0, "unique": 0 - }, + }, { - "allow_bulk_edit": 0, - "allow_in_quick_entry": 0, - "allow_on_submit": 0, - "bold": 0, - "collapsible": 0, - "columns": 0, - "fetch_if_empty": 0, - "fieldname": "base_rate", - "fieldtype": "Currency", - "hidden": 0, - "ignore_user_permissions": 0, - "ignore_xss_filter": 0, - "in_filter": 0, - "in_global_search": 0, - "in_list_view": 0, - "in_standard_filter": 0, - "label": "Rate (Company Currency)", - "length": 0, - "no_copy": 0, - "oldfieldname": "purchase_rate", - "oldfieldtype": "Currency", - "options": "Company:company:default_currency", - "permlevel": 0, - "print_hide": 1, - "print_hide_if_no_value": 0, - "print_width": "100px", - "read_only": 1, - "remember_last_selected_value": 0, - "report_hide": 0, - "reqd": 1, - "search_index": 0, - "set_only_once": 0, - "translatable": 0, - "unique": 0, + "allow_bulk_edit": 0, + "allow_in_quick_entry": 0, + "allow_on_submit": 0, + "bold": 0, + "collapsible": 0, + "columns": 0, + "fetch_if_empty": 0, + "fieldname": "base_rate", + "fieldtype": "Currency", + "hidden": 0, + "ignore_user_permissions": 0, + "ignore_xss_filter": 0, + "in_filter": 0, + "in_global_search": 0, + "in_list_view": 0, + "in_standard_filter": 0, + "label": "Rate (Company Currency)", + "length": 0, + "no_copy": 0, + "oldfieldname": "purchase_rate", + "oldfieldtype": "Currency", + "options": "Company:company:default_currency", + "permlevel": 0, + "print_hide": 1, + "print_hide_if_no_value": 0, + "print_width": "100px", + "read_only": 1, + "remember_last_selected_value": 0, + "report_hide": 0, + "reqd": 1, + "search_index": 0, + "set_only_once": 0, + "translatable": 0, + "unique": 0, "width": "100px" - }, + }, { - "allow_bulk_edit": 0, - "allow_in_quick_entry": 0, - "allow_on_submit": 0, - "bold": 0, - "collapsible": 0, - "columns": 0, - "fetch_if_empty": 0, - "fieldname": "base_amount", - "fieldtype": "Currency", - "hidden": 0, - "ignore_user_permissions": 0, - "ignore_xss_filter": 0, - "in_filter": 0, - "in_global_search": 0, - "in_list_view": 0, - "in_standard_filter": 0, - "label": "Amount (Company Currency)", - "length": 0, - "no_copy": 0, - "oldfieldname": "amount", - "oldfieldtype": "Currency", - "options": "Company:company:default_currency", - "permlevel": 0, - "print_hide": 1, - "print_hide_if_no_value": 0, - "print_width": "100px", - "read_only": 1, - "remember_last_selected_value": 0, - "report_hide": 0, - "reqd": 0, - "search_index": 0, - "set_only_once": 0, - "translatable": 0, - "unique": 0, + "allow_bulk_edit": 0, + "allow_in_quick_entry": 0, + "allow_on_submit": 0, + "bold": 0, + "collapsible": 0, + "columns": 0, + "fetch_if_empty": 0, + "fieldname": "base_amount", + "fieldtype": "Currency", + "hidden": 0, + "ignore_user_permissions": 0, + "ignore_xss_filter": 0, + "in_filter": 0, + "in_global_search": 0, + "in_list_view": 0, + "in_standard_filter": 0, + "label": "Amount (Company Currency)", + "length": 0, + "no_copy": 0, + "oldfieldname": "amount", + "oldfieldtype": "Currency", + "options": "Company:company:default_currency", + "permlevel": 0, + "print_hide": 1, + "print_hide_if_no_value": 0, + "print_width": "100px", + "read_only": 1, + "remember_last_selected_value": 0, + "report_hide": 0, + "reqd": 0, + "search_index": 0, + "set_only_once": 0, + "translatable": 0, + "unique": 0, "width": "100px" - }, + }, { - "allow_bulk_edit": 0, - "allow_in_quick_entry": 0, - "allow_on_submit": 0, - "bold": 0, - "collapsible": 0, - "columns": 0, - "fetch_if_empty": 0, - "fieldname": "pricing_rules", - "fieldtype": "Small Text", - "hidden": 1, - "ignore_user_permissions": 0, - "ignore_xss_filter": 0, - "in_filter": 0, - "in_global_search": 0, - "in_list_view": 0, - "in_standard_filter": 0, - "label": "Pricing Rules", - "length": 0, - "no_copy": 0, - "permlevel": 0, - "precision": "", - "print_hide": 1, - "print_hide_if_no_value": 0, - "read_only": 1, - "remember_last_selected_value": 0, - "report_hide": 0, - "reqd": 0, - "search_index": 0, - "set_only_once": 0, - "translatable": 0, + "allow_bulk_edit": 0, + "allow_in_quick_entry": 0, + "allow_on_submit": 0, + "bold": 0, + "collapsible": 0, + "columns": 0, + "fetch_if_empty": 0, + "fieldname": "pricing_rules", + "fieldtype": "Small Text", + "hidden": 1, + "ignore_user_permissions": 0, + "ignore_xss_filter": 0, + "in_filter": 0, + "in_global_search": 0, + "in_list_view": 0, + "in_standard_filter": 0, + "label": "Pricing Rules", + "length": 0, + "no_copy": 0, + "permlevel": 0, + "precision": "", + "print_hide": 1, + "print_hide_if_no_value": 0, + "read_only": 1, + "remember_last_selected_value": 0, + "report_hide": 0, + "reqd": 0, + "search_index": 0, + "set_only_once": 0, + "translatable": 0, "unique": 0 - }, + }, { - "allow_bulk_edit": 0, - "allow_in_quick_entry": 0, - "allow_on_submit": 0, - "bold": 0, - "collapsible": 0, - "columns": 0, - "fetch_if_empty": 0, - "fieldname": "is_free_item", - "fieldtype": "Check", - "hidden": 0, - "ignore_user_permissions": 0, - "ignore_xss_filter": 0, - "in_filter": 0, - "in_global_search": 0, - "in_list_view": 0, - "in_standard_filter": 0, - "label": "Is Free Item", - "length": 0, - "no_copy": 0, - "permlevel": 0, - "precision": "", - "print_hide": 1, - "print_hide_if_no_value": 0, - "read_only": 1, - "remember_last_selected_value": 0, - "report_hide": 0, - "reqd": 0, - "search_index": 0, - "set_only_once": 0, - "translatable": 0, + "allow_bulk_edit": 0, + "allow_in_quick_entry": 0, + "allow_on_submit": 0, + "bold": 0, + "collapsible": 0, + "columns": 0, + "fetch_if_empty": 0, + "fieldname": "is_free_item", + "fieldtype": "Check", + "hidden": 0, + "ignore_user_permissions": 0, + "ignore_xss_filter": 0, + "in_filter": 0, + "in_global_search": 0, + "in_list_view": 0, + "in_standard_filter": 0, + "label": "Is Free Item", + "length": 0, + "no_copy": 0, + "permlevel": 0, + "precision": "", + "print_hide": 1, + "print_hide_if_no_value": 0, + "read_only": 1, + "remember_last_selected_value": 0, + "report_hide": 0, + "reqd": 0, + "search_index": 0, + "set_only_once": 0, + "translatable": 0, "unique": 0 - }, + }, { - "allow_bulk_edit": 0, - "allow_in_quick_entry": 0, - "allow_on_submit": 0, - "bold": 0, - "collapsible": 0, - "columns": 0, - "fetch_if_empty": 0, - "fieldname": "section_break_29", - "fieldtype": "Section Break", - "hidden": 0, - "ignore_user_permissions": 0, - "ignore_xss_filter": 0, - "in_filter": 0, - "in_global_search": 0, - "in_list_view": 0, - "in_standard_filter": 0, - "length": 0, - "no_copy": 0, - "permlevel": 0, - "precision": "", - "print_hide": 0, - "print_hide_if_no_value": 0, - "read_only": 0, - "remember_last_selected_value": 0, - "report_hide": 0, - "reqd": 0, - "search_index": 0, - "set_only_once": 0, - "translatable": 0, + "allow_bulk_edit": 0, + "allow_in_quick_entry": 0, + "allow_on_submit": 0, + "bold": 0, + "collapsible": 0, + "columns": 0, + "fetch_if_empty": 0, + "fieldname": "section_break_29", + "fieldtype": "Section Break", + "hidden": 0, + "ignore_user_permissions": 0, + "ignore_xss_filter": 0, + "in_filter": 0, + "in_global_search": 0, + "in_list_view": 0, + "in_standard_filter": 0, + "length": 0, + "no_copy": 0, + "permlevel": 0, + "precision": "", + "print_hide": 0, + "print_hide_if_no_value": 0, + "read_only": 0, + "remember_last_selected_value": 0, + "report_hide": 0, + "reqd": 0, + "search_index": 0, + "set_only_once": 0, + "translatable": 0, "unique": 0 - }, + }, { - "allow_bulk_edit": 0, - "allow_in_quick_entry": 0, - "allow_on_submit": 0, - "bold": 0, - "collapsible": 0, - "columns": 0, - "fetch_if_empty": 0, - "fieldname": "net_rate", - "fieldtype": "Currency", - "hidden": 0, - "ignore_user_permissions": 0, - "ignore_xss_filter": 0, - "in_filter": 0, - "in_global_search": 0, - "in_list_view": 0, - "in_standard_filter": 0, - "label": "Net Rate", - "length": 0, - "no_copy": 0, - "options": "currency", - "permlevel": 0, - "precision": "", - "print_hide": 1, - "print_hide_if_no_value": 0, - "read_only": 1, - "remember_last_selected_value": 0, - "report_hide": 0, - "reqd": 0, - "search_index": 0, - "set_only_once": 0, - "translatable": 0, + "allow_bulk_edit": 0, + "allow_in_quick_entry": 0, + "allow_on_submit": 0, + "bold": 0, + "collapsible": 0, + "columns": 0, + "fetch_if_empty": 0, + "fieldname": "net_rate", + "fieldtype": "Currency", + "hidden": 0, + "ignore_user_permissions": 0, + "ignore_xss_filter": 0, + "in_filter": 0, + "in_global_search": 0, + "in_list_view": 0, + "in_standard_filter": 0, + "label": "Net Rate", + "length": 0, + "no_copy": 0, + "options": "currency", + "permlevel": 0, + "precision": "", + "print_hide": 1, + "print_hide_if_no_value": 0, + "read_only": 1, + "remember_last_selected_value": 0, + "report_hide": 0, + "reqd": 0, + "search_index": 0, + "set_only_once": 0, + "translatable": 0, "unique": 0 - }, + }, { - "allow_bulk_edit": 0, - "allow_in_quick_entry": 0, - "allow_on_submit": 0, - "bold": 0, - "collapsible": 0, - "columns": 2, - "fetch_if_empty": 0, - "fieldname": "net_amount", - "fieldtype": "Currency", - "hidden": 0, - "ignore_user_permissions": 0, - "ignore_xss_filter": 0, - "in_filter": 0, - "in_global_search": 0, - "in_list_view": 1, - "in_standard_filter": 0, - "label": "Net Amount", - "length": 0, - "no_copy": 0, - "options": "currency", - "permlevel": 0, - "precision": "", - "print_hide": 1, - "print_hide_if_no_value": 0, - "read_only": 1, - "remember_last_selected_value": 0, - "report_hide": 0, - "reqd": 0, - "search_index": 0, - "set_only_once": 0, - "translatable": 0, + "allow_bulk_edit": 0, + "allow_in_quick_entry": 0, + "allow_on_submit": 0, + "bold": 0, + "collapsible": 0, + "columns": 2, + "fetch_if_empty": 0, + "fieldname": "net_amount", + "fieldtype": "Currency", + "hidden": 0, + "ignore_user_permissions": 0, + "ignore_xss_filter": 0, + "in_filter": 0, + "in_global_search": 0, + "in_list_view": 1, + "in_standard_filter": 0, + "label": "Net Amount", + "length": 0, + "no_copy": 0, + "options": "currency", + "permlevel": 0, + "precision": "", + "print_hide": 1, + "print_hide_if_no_value": 0, + "read_only": 1, + "remember_last_selected_value": 0, + "report_hide": 0, + "reqd": 0, + "search_index": 0, + "set_only_once": 0, + "translatable": 0, "unique": 0 - }, + }, { - "allow_bulk_edit": 0, - "allow_in_quick_entry": 0, - "allow_on_submit": 0, - "bold": 0, - "collapsible": 0, - "columns": 0, - "fetch_if_empty": 0, - "fieldname": "column_break_32", - "fieldtype": "Column Break", - "hidden": 0, - "ignore_user_permissions": 0, - "ignore_xss_filter": 0, - "in_filter": 0, - "in_global_search": 0, - "in_list_view": 0, - "in_standard_filter": 0, - "length": 0, - "no_copy": 0, - "permlevel": 0, - "precision": "", - "print_hide": 0, - "print_hide_if_no_value": 0, - "read_only": 0, - "remember_last_selected_value": 0, - "report_hide": 0, - "reqd": 0, - "search_index": 0, - "set_only_once": 0, - "translatable": 0, + "allow_bulk_edit": 0, + "allow_in_quick_entry": 0, + "allow_on_submit": 0, + "bold": 0, + "collapsible": 0, + "columns": 0, + "fetch_if_empty": 0, + "fieldname": "column_break_32", + "fieldtype": "Column Break", + "hidden": 0, + "ignore_user_permissions": 0, + "ignore_xss_filter": 0, + "in_filter": 0, + "in_global_search": 0, + "in_list_view": 0, + "in_standard_filter": 0, + "length": 0, + "no_copy": 0, + "permlevel": 0, + "precision": "", + "print_hide": 0, + "print_hide_if_no_value": 0, + "read_only": 0, + "remember_last_selected_value": 0, + "report_hide": 0, + "reqd": 0, + "search_index": 0, + "set_only_once": 0, + "translatable": 0, "unique": 0 - }, + }, { - "allow_bulk_edit": 0, - "allow_in_quick_entry": 0, - "allow_on_submit": 0, - "bold": 0, - "collapsible": 0, - "columns": 0, - "fetch_if_empty": 0, - "fieldname": "base_net_rate", - "fieldtype": "Currency", - "hidden": 0, - "ignore_user_permissions": 0, - "ignore_xss_filter": 0, - "in_filter": 0, - "in_global_search": 0, - "in_list_view": 0, - "in_standard_filter": 0, - "label": "Net Rate (Company Currency)", - "length": 0, - "no_copy": 0, - "options": "Company:company:default_currency", - "permlevel": 0, - "precision": "", - "print_hide": 1, - "print_hide_if_no_value": 0, - "read_only": 1, - "remember_last_selected_value": 0, - "report_hide": 0, - "reqd": 0, - "search_index": 0, - "set_only_once": 0, - "translatable": 0, + "allow_bulk_edit": 0, + "allow_in_quick_entry": 0, + "allow_on_submit": 0, + "bold": 0, + "collapsible": 0, + "columns": 0, + "fetch_if_empty": 0, + "fieldname": "base_net_rate", + "fieldtype": "Currency", + "hidden": 0, + "ignore_user_permissions": 0, + "ignore_xss_filter": 0, + "in_filter": 0, + "in_global_search": 0, + "in_list_view": 0, + "in_standard_filter": 0, + "label": "Net Rate (Company Currency)", + "length": 0, + "no_copy": 0, + "options": "Company:company:default_currency", + "permlevel": 0, + "precision": "", + "print_hide": 1, + "print_hide_if_no_value": 0, + "read_only": 1, + "remember_last_selected_value": 0, + "report_hide": 0, + "reqd": 0, + "search_index": 0, + "set_only_once": 0, + "translatable": 0, "unique": 0 - }, + }, { - "allow_bulk_edit": 0, - "allow_in_quick_entry": 0, - "allow_on_submit": 0, - "bold": 0, - "collapsible": 0, - "columns": 0, - "fetch_if_empty": 0, - "fieldname": "base_net_amount", - "fieldtype": "Currency", - "hidden": 0, - "ignore_user_permissions": 0, - "ignore_xss_filter": 0, - "in_filter": 0, - "in_global_search": 0, - "in_list_view": 0, - "in_standard_filter": 0, - "label": "Net Amount (Company Currency)", - "length": 0, - "no_copy": 0, - "options": "Company:company:default_currency", - "permlevel": 0, - "precision": "", - "print_hide": 1, - "print_hide_if_no_value": 0, - "read_only": 1, - "remember_last_selected_value": 0, - "report_hide": 0, - "reqd": 0, - "search_index": 0, - "set_only_once": 0, - "translatable": 0, + "allow_bulk_edit": 0, + "allow_in_quick_entry": 0, + "allow_on_submit": 0, + "bold": 0, + "collapsible": 0, + "columns": 0, + "fetch_if_empty": 0, + "fieldname": "base_net_amount", + "fieldtype": "Currency", + "hidden": 0, + "ignore_user_permissions": 0, + "ignore_xss_filter": 0, + "in_filter": 0, + "in_global_search": 0, + "in_list_view": 0, + "in_standard_filter": 0, + "label": "Net Amount (Company Currency)", + "length": 0, + "no_copy": 0, + "options": "Company:company:default_currency", + "permlevel": 0, + "precision": "", + "print_hide": 1, + "print_hide_if_no_value": 0, + "read_only": 1, + "remember_last_selected_value": 0, + "report_hide": 0, + "reqd": 0, + "search_index": 0, + "set_only_once": 0, + "translatable": 0, "unique": 0 - }, + }, { - "allow_bulk_edit": 0, - "allow_in_quick_entry": 0, - "allow_on_submit": 0, - "bold": 0, - "collapsible": 1, - "columns": 0, - "fetch_if_empty": 0, - "fieldname": "item_weight_details", - "fieldtype": "Section Break", - "hidden": 0, - "ignore_user_permissions": 0, - "ignore_xss_filter": 0, - "in_filter": 0, - "in_global_search": 0, - "in_list_view": 0, - "in_standard_filter": 0, - "label": "Item Weight Details", - "length": 0, - "no_copy": 0, - "permlevel": 0, - "precision": "", - "print_hide": 0, - "print_hide_if_no_value": 0, - "read_only": 0, - "remember_last_selected_value": 0, - "report_hide": 0, - "reqd": 0, - "search_index": 0, - "set_only_once": 0, - "translatable": 0, + "allow_bulk_edit": 0, + "allow_in_quick_entry": 0, + "allow_on_submit": 0, + "bold": 0, + "collapsible": 1, + "columns": 0, + "fetch_if_empty": 0, + "fieldname": "item_weight_details", + "fieldtype": "Section Break", + "hidden": 0, + "ignore_user_permissions": 0, + "ignore_xss_filter": 0, + "in_filter": 0, + "in_global_search": 0, + "in_list_view": 0, + "in_standard_filter": 0, + "label": "Item Weight Details", + "length": 0, + "no_copy": 0, + "permlevel": 0, + "precision": "", + "print_hide": 0, + "print_hide_if_no_value": 0, + "read_only": 0, + "remember_last_selected_value": 0, + "report_hide": 0, + "reqd": 0, + "search_index": 0, + "set_only_once": 0, + "translatable": 0, "unique": 0 - }, + }, { - "allow_bulk_edit": 0, - "allow_in_quick_entry": 0, - "allow_on_submit": 0, - "bold": 0, - "collapsible": 0, - "columns": 0, - "fetch_if_empty": 0, - "fieldname": "weight_per_unit", - "fieldtype": "Float", - "hidden": 0, - "ignore_user_permissions": 0, - "ignore_xss_filter": 0, - "in_filter": 0, - "in_global_search": 0, - "in_list_view": 0, - "in_standard_filter": 0, - "label": "Weight Per Unit", - "length": 0, - "no_copy": 0, - "permlevel": 0, - "precision": "", - "print_hide": 0, - "print_hide_if_no_value": 0, - "read_only": 0, - "remember_last_selected_value": 0, - "report_hide": 0, - "reqd": 0, - "search_index": 0, - "set_only_once": 0, - "translatable": 0, + "allow_bulk_edit": 0, + "allow_in_quick_entry": 0, + "allow_on_submit": 0, + "bold": 0, + "collapsible": 0, + "columns": 0, + "fetch_if_empty": 0, + "fieldname": "weight_per_unit", + "fieldtype": "Float", + "hidden": 0, + "ignore_user_permissions": 0, + "ignore_xss_filter": 0, + "in_filter": 0, + "in_global_search": 0, + "in_list_view": 0, + "in_standard_filter": 0, + "label": "Weight Per Unit", + "length": 0, + "no_copy": 0, + "permlevel": 0, + "precision": "", + "print_hide": 0, + "print_hide_if_no_value": 0, + "read_only": 0, + "remember_last_selected_value": 0, + "report_hide": 0, + "reqd": 0, + "search_index": 0, + "set_only_once": 0, + "translatable": 0, "unique": 0 - }, + }, { - "allow_bulk_edit": 0, - "allow_in_quick_entry": 0, - "allow_on_submit": 0, - "bold": 0, - "collapsible": 0, - "columns": 0, - "fetch_if_empty": 0, - "fieldname": "total_weight", - "fieldtype": "Float", - "hidden": 0, - "ignore_user_permissions": 0, - "ignore_xss_filter": 0, - "in_filter": 0, - "in_global_search": 0, - "in_list_view": 0, - "in_standard_filter": 0, - "label": "Total Weight", - "length": 0, - "no_copy": 0, - "permlevel": 0, - "precision": "", - "print_hide": 0, - "print_hide_if_no_value": 0, - "read_only": 1, - "remember_last_selected_value": 0, - "report_hide": 0, - "reqd": 0, - "search_index": 0, - "set_only_once": 0, - "translatable": 0, + "allow_bulk_edit": 0, + "allow_in_quick_entry": 0, + "allow_on_submit": 0, + "bold": 0, + "collapsible": 0, + "columns": 0, + "fetch_if_empty": 0, + "fieldname": "total_weight", + "fieldtype": "Float", + "hidden": 0, + "ignore_user_permissions": 0, + "ignore_xss_filter": 0, + "in_filter": 0, + "in_global_search": 0, + "in_list_view": 0, + "in_standard_filter": 0, + "label": "Total Weight", + "length": 0, + "no_copy": 0, + "permlevel": 0, + "precision": "", + "print_hide": 0, + "print_hide_if_no_value": 0, + "read_only": 1, + "remember_last_selected_value": 0, + "report_hide": 0, + "reqd": 0, + "search_index": 0, + "set_only_once": 0, + "translatable": 0, "unique": 0 - }, + }, { - "allow_bulk_edit": 0, - "allow_in_quick_entry": 0, - "allow_on_submit": 0, - "bold": 0, - "collapsible": 0, - "columns": 0, - "fetch_if_empty": 0, - "fieldname": "column_break_41", - "fieldtype": "Column Break", - "hidden": 0, - "ignore_user_permissions": 0, - "ignore_xss_filter": 0, - "in_filter": 0, - "in_global_search": 0, - "in_list_view": 0, - "in_standard_filter": 0, - "length": 0, - "no_copy": 0, - "permlevel": 0, - "precision": "", - "print_hide": 0, - "print_hide_if_no_value": 0, - "read_only": 0, - "remember_last_selected_value": 0, - "report_hide": 0, - "reqd": 0, - "search_index": 0, - "set_only_once": 0, - "translatable": 0, + "allow_bulk_edit": 0, + "allow_in_quick_entry": 0, + "allow_on_submit": 0, + "bold": 0, + "collapsible": 0, + "columns": 0, + "fetch_if_empty": 0, + "fieldname": "column_break_41", + "fieldtype": "Column Break", + "hidden": 0, + "ignore_user_permissions": 0, + "ignore_xss_filter": 0, + "in_filter": 0, + "in_global_search": 0, + "in_list_view": 0, + "in_standard_filter": 0, + "length": 0, + "no_copy": 0, + "permlevel": 0, + "precision": "", + "print_hide": 0, + "print_hide_if_no_value": 0, + "read_only": 0, + "remember_last_selected_value": 0, + "report_hide": 0, + "reqd": 0, + "search_index": 0, + "set_only_once": 0, + "translatable": 0, "unique": 0 - }, + }, { - "allow_bulk_edit": 0, - "allow_in_quick_entry": 0, - "allow_on_submit": 0, - "bold": 0, - "collapsible": 0, - "columns": 0, - "fetch_if_empty": 0, - "fieldname": "weight_uom", - "fieldtype": "Link", - "hidden": 0, - "ignore_user_permissions": 0, - "ignore_xss_filter": 0, - "in_filter": 0, - "in_global_search": 0, - "in_list_view": 0, - "in_standard_filter": 0, - "label": "Weight UOM", - "length": 0, - "no_copy": 0, - "options": "UOM", - "permlevel": 0, - "precision": "", - "print_hide": 0, - "print_hide_if_no_value": 0, - "read_only": 0, - "remember_last_selected_value": 0, - "report_hide": 0, - "reqd": 0, - "search_index": 0, - "set_only_once": 0, - "translatable": 0, + "allow_bulk_edit": 0, + "allow_in_quick_entry": 0, + "allow_on_submit": 0, + "bold": 0, + "collapsible": 0, + "columns": 0, + "fetch_if_empty": 0, + "fieldname": "weight_uom", + "fieldtype": "Link", + "hidden": 0, + "ignore_user_permissions": 0, + "ignore_xss_filter": 0, + "in_filter": 0, + "in_global_search": 0, + "in_list_view": 0, + "in_standard_filter": 0, + "label": "Weight UOM", + "length": 0, + "no_copy": 0, + "options": "UOM", + "permlevel": 0, + "precision": "", + "print_hide": 0, + "print_hide_if_no_value": 0, + "read_only": 0, + "remember_last_selected_value": 0, + "report_hide": 0, + "reqd": 0, + "search_index": 0, + "set_only_once": 0, + "translatable": 0, "unique": 0 - }, + }, { - "allow_bulk_edit": 0, - "allow_in_quick_entry": 0, - "allow_on_submit": 0, - "bold": 0, - "collapsible": 0, - "columns": 0, - "fetch_if_empty": 0, - "fieldname": "warehouse_and_reference", - "fieldtype": "Section Break", - "hidden": 0, - "ignore_user_permissions": 0, - "ignore_xss_filter": 0, - "in_filter": 0, - "in_global_search": 0, - "in_list_view": 0, - "in_standard_filter": 0, - "label": "Warehouse and Reference", - "length": 0, - "no_copy": 0, - "permlevel": 0, - "print_hide": 0, - "print_hide_if_no_value": 0, - "read_only": 0, - "remember_last_selected_value": 0, - "report_hide": 0, - "reqd": 0, - "search_index": 0, - "set_only_once": 0, - "translatable": 0, + "allow_bulk_edit": 0, + "allow_in_quick_entry": 0, + "allow_on_submit": 0, + "bold": 0, + "collapsible": 0, + "columns": 0, + "fetch_if_empty": 0, + "fieldname": "warehouse_and_reference", + "fieldtype": "Section Break", + "hidden": 0, + "ignore_user_permissions": 0, + "ignore_xss_filter": 0, + "in_filter": 0, + "in_global_search": 0, + "in_list_view": 0, + "in_standard_filter": 0, + "label": "Warehouse and Reference", + "length": 0, + "no_copy": 0, + "permlevel": 0, + "print_hide": 0, + "print_hide_if_no_value": 0, + "read_only": 0, + "remember_last_selected_value": 0, + "report_hide": 0, + "reqd": 0, + "search_index": 0, + "set_only_once": 0, + "translatable": 0, "unique": 0 - }, + }, { - "allow_bulk_edit": 0, - "allow_in_quick_entry": 0, - "allow_on_submit": 0, - "bold": 1, - "collapsible": 0, - "columns": 0, - "fetch_if_empty": 0, - "fieldname": "warehouse", - "fieldtype": "Link", - "hidden": 0, - "ignore_user_permissions": 0, - "ignore_xss_filter": 0, - "in_filter": 0, - "in_global_search": 0, - "in_list_view": 1, - "in_standard_filter": 0, - "label": "Accepted Warehouse", - "length": 0, - "no_copy": 0, - "oldfieldname": "warehouse", - "oldfieldtype": "Link", - "options": "Warehouse", - "permlevel": 0, - "print_hide": 1, - "print_hide_if_no_value": 0, - "print_width": "100px", - "read_only": 0, - "remember_last_selected_value": 0, - "report_hide": 0, - "reqd": 0, - "search_index": 0, - "set_only_once": 0, - "translatable": 0, - "unique": 0, + "allow_bulk_edit": 0, + "allow_in_quick_entry": 0, + "allow_on_submit": 0, + "bold": 1, + "collapsible": 0, + "columns": 0, + "fetch_if_empty": 0, + "fieldname": "warehouse", + "fieldtype": "Link", + "hidden": 0, + "ignore_user_permissions": 0, + "ignore_xss_filter": 0, + "in_filter": 0, + "in_global_search": 0, + "in_list_view": 1, + "in_standard_filter": 0, + "label": "Accepted Warehouse", + "length": 0, + "no_copy": 0, + "oldfieldname": "warehouse", + "oldfieldtype": "Link", + "options": "Warehouse", + "permlevel": 0, + "print_hide": 1, + "print_hide_if_no_value": 0, + "print_width": "100px", + "read_only": 0, + "remember_last_selected_value": 0, + "report_hide": 0, + "reqd": 0, + "search_index": 0, + "set_only_once": 0, + "translatable": 0, + "unique": 0, "width": "100px" - }, + }, { - "allow_bulk_edit": 0, - "allow_in_quick_entry": 0, - "allow_on_submit": 0, - "bold": 0, - "collapsible": 0, - "columns": 0, - "fetch_if_empty": 0, - "fieldname": "rejected_warehouse", - "fieldtype": "Link", - "hidden": 0, - "ignore_user_permissions": 0, - "ignore_xss_filter": 0, - "in_filter": 0, - "in_global_search": 0, - "in_list_view": 0, - "in_standard_filter": 0, - "label": "Rejected Warehouse", - "length": 0, - "no_copy": 1, - "oldfieldname": "rejected_warehouse", - "oldfieldtype": "Link", - "options": "Warehouse", - "permlevel": 0, - "print_hide": 1, - "print_hide_if_no_value": 0, - "print_width": "100px", - "read_only": 0, - "remember_last_selected_value": 0, - "report_hide": 0, - "reqd": 0, - "search_index": 0, - "set_only_once": 0, - "translatable": 0, - "unique": 0, + "allow_bulk_edit": 0, + "allow_in_quick_entry": 0, + "allow_on_submit": 0, + "bold": 0, + "collapsible": 0, + "columns": 0, + "fetch_if_empty": 0, + "fieldname": "rejected_warehouse", + "fieldtype": "Link", + "hidden": 0, + "ignore_user_permissions": 0, + "ignore_xss_filter": 0, + "in_filter": 0, + "in_global_search": 0, + "in_list_view": 0, + "in_standard_filter": 0, + "label": "Rejected Warehouse", + "length": 0, + "no_copy": 1, + "oldfieldname": "rejected_warehouse", + "oldfieldtype": "Link", + "options": "Warehouse", + "permlevel": 0, + "print_hide": 1, + "print_hide_if_no_value": 0, + "print_width": "100px", + "read_only": 0, + "remember_last_selected_value": 0, + "report_hide": 0, + "reqd": 0, + "search_index": 0, + "set_only_once": 0, + "translatable": 0, + "unique": 0, "width": "100px" - }, + }, { - "allow_bulk_edit": 0, - "allow_in_quick_entry": 0, - "allow_on_submit": 0, - "bold": 0, - "collapsible": 0, - "columns": 0, - "depends_on": "eval:!doc.__islocal", - "fetch_if_empty": 0, - "fieldname": "quality_inspection", - "fieldtype": "Link", - "hidden": 0, - "ignore_user_permissions": 0, - "ignore_xss_filter": 0, - "in_filter": 0, - "in_global_search": 0, - "in_list_view": 0, - "in_standard_filter": 0, - "label": "Quality Inspection", - "length": 0, - "no_copy": 1, - "oldfieldname": "qa_no", - "oldfieldtype": "Link", - "options": "Quality Inspection", - "permlevel": 0, - "print_hide": 1, - "print_hide_if_no_value": 0, - "read_only": 0, - "remember_last_selected_value": 0, - "report_hide": 0, - "reqd": 0, - "search_index": 0, - "set_only_once": 0, - "translatable": 0, + "allow_bulk_edit": 0, + "allow_in_quick_entry": 0, + "allow_on_submit": 0, + "bold": 0, + "collapsible": 0, + "columns": 0, + "depends_on": "eval:!doc.__islocal", + "fetch_if_empty": 0, + "fieldname": "quality_inspection", + "fieldtype": "Link", + "hidden": 0, + "ignore_user_permissions": 0, + "ignore_xss_filter": 0, + "in_filter": 0, + "in_global_search": 0, + "in_list_view": 0, + "in_standard_filter": 0, + "label": "Quality Inspection", + "length": 0, + "no_copy": 1, + "oldfieldname": "qa_no", + "oldfieldtype": "Link", + "options": "Quality Inspection", + "permlevel": 0, + "print_hide": 1, + "print_hide_if_no_value": 0, + "read_only": 0, + "remember_last_selected_value": 0, + "report_hide": 0, + "reqd": 0, + "search_index": 0, + "set_only_once": 0, + "translatable": 0, "unique": 0 - }, + }, { - "allow_bulk_edit": 0, - "allow_in_quick_entry": 0, - "allow_on_submit": 0, - "bold": 0, - "collapsible": 0, - "columns": 0, - "fetch_if_empty": 0, - "fieldname": "column_break_40", - "fieldtype": "Column Break", - "hidden": 0, - "ignore_user_permissions": 0, - "ignore_xss_filter": 0, - "in_filter": 0, - "in_global_search": 0, - "in_list_view": 0, - "in_standard_filter": 0, - "length": 0, - "no_copy": 0, - "permlevel": 0, - "precision": "", - "print_hide": 0, - "print_hide_if_no_value": 0, - "read_only": 0, - "remember_last_selected_value": 0, - "report_hide": 0, - "reqd": 0, - "search_index": 0, - "set_only_once": 0, - "translatable": 0, + "allow_bulk_edit": 0, + "allow_in_quick_entry": 0, + "allow_on_submit": 0, + "bold": 0, + "collapsible": 0, + "columns": 0, + "fetch_if_empty": 0, + "fieldname": "column_break_40", + "fieldtype": "Column Break", + "hidden": 0, + "ignore_user_permissions": 0, + "ignore_xss_filter": 0, + "in_filter": 0, + "in_global_search": 0, + "in_list_view": 0, + "in_standard_filter": 0, + "length": 0, + "no_copy": 0, + "permlevel": 0, + "precision": "", + "print_hide": 0, + "print_hide_if_no_value": 0, + "read_only": 0, + "remember_last_selected_value": 0, + "report_hide": 0, + "reqd": 0, + "search_index": 0, + "set_only_once": 0, + "translatable": 0, "unique": 0 - }, + }, { - "allow_bulk_edit": 0, - "allow_in_quick_entry": 0, - "allow_on_submit": 0, - "bold": 0, - "collapsible": 0, - "columns": 0, - "fetch_if_empty": 0, - "fieldname": "is_fixed_asset", - "fieldtype": "Check", - "hidden": 1, - "ignore_user_permissions": 0, - "ignore_xss_filter": 0, - "in_filter": 0, - "in_global_search": 0, - "in_list_view": 0, - "in_standard_filter": 0, - "label": "Is Fixed Asset", - "length": 0, - "no_copy": 1, - "permlevel": 0, - "precision": "", - "print_hide": 1, - "print_hide_if_no_value": 0, - "read_only": 1, - "remember_last_selected_value": 0, - "report_hide": 0, - "reqd": 0, - "search_index": 0, - "set_only_once": 0, - "translatable": 0, + "allow_bulk_edit": 0, + "allow_in_quick_entry": 0, + "allow_on_submit": 0, + "bold": 0, + "collapsible": 0, + "columns": 0, + "fetch_if_empty": 0, + "fieldname": "is_fixed_asset", + "fieldtype": "Check", + "hidden": 1, + "ignore_user_permissions": 0, + "ignore_xss_filter": 0, + "in_filter": 0, + "in_global_search": 0, + "in_list_view": 0, + "in_standard_filter": 0, + "label": "Is Fixed Asset", + "length": 0, + "no_copy": 1, + "permlevel": 0, + "precision": "", + "print_hide": 1, + "print_hide_if_no_value": 0, + "read_only": 1, + "remember_last_selected_value": 0, + "report_hide": 0, + "reqd": 0, + "search_index": 0, + "set_only_once": 0, + "translatable": 0, "unique": 0 - }, + }, { - "allow_bulk_edit": 0, - "allow_in_quick_entry": 0, - "allow_on_submit": 0, - "bold": 0, - "collapsible": 0, - "columns": 0, - "depends_on": "is_fixed_asset", - "fetch_if_empty": 0, - "fieldname": "asset", - "fieldtype": "Link", - "hidden": 0, - "ignore_user_permissions": 0, - "ignore_xss_filter": 0, - "in_filter": 0, - "in_global_search": 0, - "in_list_view": 0, - "in_standard_filter": 0, - "label": "Asset", - "length": 0, - "no_copy": 1, - "options": "Asset", - "permlevel": 0, - "precision": "", - "print_hide": 0, - "print_hide_if_no_value": 0, - "read_only": 0, - "remember_last_selected_value": 0, - "report_hide": 0, - "reqd": 0, - "search_index": 0, - "set_only_once": 0, - "translatable": 0, + "allow_bulk_edit": 0, + "allow_in_quick_entry": 0, + "allow_on_submit": 0, + "bold": 0, + "collapsible": 0, + "columns": 0, + "depends_on": "is_fixed_asset", + "fetch_if_empty": 0, + "fieldname": "asset", + "fieldtype": "Link", + "hidden": 0, + "ignore_user_permissions": 0, + "ignore_xss_filter": 0, + "in_filter": 0, + "in_global_search": 0, + "in_list_view": 0, + "in_standard_filter": 0, + "label": "Asset", + "length": 0, + "no_copy": 1, + "options": "Asset", + "permlevel": 0, + "precision": "", + "print_hide": 0, + "print_hide_if_no_value": 0, + "read_only": 0, + "remember_last_selected_value": 0, + "report_hide": 0, + "reqd": 0, + "search_index": 0, + "set_only_once": 0, + "translatable": 0, "unique": 0 - }, + }, { - "allow_bulk_edit": 0, - "allow_in_quick_entry": 0, - "allow_on_submit": 0, - "bold": 0, - "collapsible": 0, - "columns": 0, - "depends_on": "is_fixed_asset", - "fetch_if_empty": 0, - "fieldname": "asset_location", - "fieldtype": "Link", - "hidden": 0, - "ignore_user_permissions": 0, - "ignore_xss_filter": 0, - "in_filter": 0, - "in_global_search": 0, - "in_list_view": 0, - "in_standard_filter": 0, - "label": "Asset Location", - "length": 0, - "no_copy": 0, - "options": "Location", - "permlevel": 0, - "precision": "", - "print_hide": 0, - "print_hide_if_no_value": 0, - "read_only": 0, - "remember_last_selected_value": 0, - "report_hide": 0, - "reqd": 0, - "search_index": 0, - "set_only_once": 0, - "translatable": 0, + "allow_bulk_edit": 0, + "allow_in_quick_entry": 0, + "allow_on_submit": 0, + "bold": 0, + "collapsible": 0, + "columns": 0, + "depends_on": "is_fixed_asset", + "fetch_if_empty": 0, + "fieldname": "asset_location", + "fieldtype": "Link", + "hidden": 0, + "ignore_user_permissions": 0, + "ignore_xss_filter": 0, + "in_filter": 0, + "in_global_search": 0, + "in_list_view": 0, + "in_standard_filter": 0, + "label": "Asset Location", + "length": 0, + "no_copy": 0, + "options": "Location", + "permlevel": 0, + "precision": "", + "print_hide": 0, + "print_hide_if_no_value": 0, + "read_only": 0, + "remember_last_selected_value": 0, + "report_hide": 0, + "reqd": 0, + "search_index": 0, + "set_only_once": 0, + "translatable": 0, "unique": 0 - }, + }, { - "allow_bulk_edit": 0, - "allow_in_quick_entry": 0, - "allow_on_submit": 0, - "bold": 0, - "collapsible": 0, - "columns": 0, - "fetch_if_empty": 0, - "fieldname": "purchase_order", - "fieldtype": "Link", - "hidden": 0, - "ignore_user_permissions": 0, - "ignore_xss_filter": 0, - "in_filter": 0, - "in_global_search": 0, - "in_list_view": 0, - "in_standard_filter": 0, - "label": "Purchase Order", - "length": 0, - "no_copy": 1, - "oldfieldname": "prevdoc_docname", - "oldfieldtype": "Link", - "options": "Purchase Order", - "permlevel": 0, - "print_hide": 1, - "print_hide_if_no_value": 0, - "print_width": "150px", - "read_only": 1, - "remember_last_selected_value": 0, - "report_hide": 0, - "reqd": 0, - "search_index": 1, - "set_only_once": 0, - "translatable": 0, - "unique": 0, + "allow_bulk_edit": 0, + "allow_in_quick_entry": 0, + "allow_on_submit": 0, + "bold": 0, + "collapsible": 0, + "columns": 0, + "fetch_if_empty": 0, + "fieldname": "purchase_order", + "fieldtype": "Link", + "hidden": 0, + "ignore_user_permissions": 0, + "ignore_xss_filter": 0, + "in_filter": 0, + "in_global_search": 0, + "in_list_view": 0, + "in_standard_filter": 0, + "label": "Purchase Order", + "length": 0, + "no_copy": 1, + "oldfieldname": "prevdoc_docname", + "oldfieldtype": "Link", + "options": "Purchase Order", + "permlevel": 0, + "print_hide": 1, + "print_hide_if_no_value": 0, + "print_width": "150px", + "read_only": 1, + "remember_last_selected_value": 0, + "report_hide": 0, + "reqd": 0, + "search_index": 1, + "set_only_once": 0, + "translatable": 0, + "unique": 0, "width": "150px" - }, + }, { - "allow_bulk_edit": 0, - "allow_in_quick_entry": 0, - "allow_on_submit": 0, - "bold": 0, - "collapsible": 0, - "columns": 0, - "fetch_if_empty": 0, - "fieldname": "schedule_date", - "fieldtype": "Date", - "hidden": 0, - "ignore_user_permissions": 0, - "ignore_xss_filter": 0, - "in_filter": 0, - "in_global_search": 0, - "in_list_view": 0, - "in_standard_filter": 0, - "label": "Required By", - "length": 0, - "no_copy": 0, - "oldfieldname": "schedule_date", - "oldfieldtype": "Date", - "permlevel": 0, - "print_hide": 1, - "print_hide_if_no_value": 0, - "read_only": 1, - "remember_last_selected_value": 0, - "report_hide": 0, - "reqd": 0, - "search_index": 0, - "set_only_once": 0, - "translatable": 0, + "allow_bulk_edit": 0, + "allow_in_quick_entry": 0, + "allow_on_submit": 0, + "bold": 0, + "collapsible": 0, + "columns": 0, + "fetch_if_empty": 0, + "fieldname": "material_request", + "fieldtype": "Link", + "hidden": 0, + "ignore_user_permissions": 0, + "ignore_xss_filter": 0, + "in_filter": 0, + "in_global_search": 0, + "in_list_view": 0, + "in_standard_filter": 0, + "label": "Material Request", + "length": 0, + "no_copy": 1, + "options": "Material Request", + "permlevel": 0, + "precision": "", + "print_hide": 1, + "print_hide_if_no_value": 0, + "read_only": 1, + "remember_last_selected_value": 0, + "report_hide": 0, + "reqd": 0, + "search_index": 1, + "set_only_once": 0, + "translatable": 0, "unique": 0 - }, + }, { - "allow_bulk_edit": 0, - "allow_in_quick_entry": 0, - "allow_on_submit": 0, - "bold": 0, - "collapsible": 0, - "columns": 0, - "fetch_if_empty": 0, - "fieldname": "stock_qty", - "fieldtype": "Float", - "hidden": 0, - "ignore_user_permissions": 0, - "ignore_xss_filter": 0, - "in_filter": 0, - "in_global_search": 0, - "in_list_view": 0, - "in_standard_filter": 0, - "label": "Qty as per Stock UOM", - "length": 0, - "no_copy": 0, - "oldfieldname": "stock_qty", - "oldfieldtype": "Currency", - "permlevel": 0, - "print_hide": 1, - "print_hide_if_no_value": 0, - "print_width": "100px", - "read_only": 1, - "remember_last_selected_value": 0, - "report_hide": 0, - "reqd": 0, - "search_index": 0, - "set_only_once": 0, - "translatable": 0, - "unique": 0, + "allow_bulk_edit": 0, + "allow_in_quick_entry": 0, + "allow_on_submit": 0, + "bold": 0, + "collapsible": 0, + "columns": 0, + "fetch_if_empty": 0, + "fieldname": "schedule_date", + "fieldtype": "Date", + "hidden": 0, + "ignore_user_permissions": 0, + "ignore_xss_filter": 0, + "in_filter": 0, + "in_global_search": 0, + "in_list_view": 0, + "in_standard_filter": 0, + "label": "Required By", + "length": 0, + "no_copy": 0, + "oldfieldname": "schedule_date", + "oldfieldtype": "Date", + "permlevel": 0, + "print_hide": 1, + "print_hide_if_no_value": 0, + "read_only": 1, + "remember_last_selected_value": 0, + "report_hide": 0, + "reqd": 0, + "search_index": 0, + "set_only_once": 0, + "translatable": 0, + "unique": 0 + }, + { + "allow_bulk_edit": 0, + "allow_in_quick_entry": 0, + "allow_on_submit": 0, + "bold": 0, + "collapsible": 0, + "columns": 0, + "fetch_if_empty": 0, + "fieldname": "stock_qty", + "fieldtype": "Float", + "hidden": 0, + "ignore_user_permissions": 0, + "ignore_xss_filter": 0, + "in_filter": 0, + "in_global_search": 0, + "in_list_view": 0, + "in_standard_filter": 0, + "label": "Qty as per Stock UOM", + "length": 0, + "no_copy": 0, + "oldfieldname": "stock_qty", + "oldfieldtype": "Currency", + "permlevel": 0, + "print_hide": 1, + "print_hide_if_no_value": 0, + "print_width": "100px", + "read_only": 1, + "remember_last_selected_value": 0, + "report_hide": 0, + "reqd": 0, + "search_index": 0, + "set_only_once": 0, + "translatable": 0, + "unique": 0, "width": "100px" - }, + }, { - "allow_bulk_edit": 0, - "allow_in_quick_entry": 0, - "allow_on_submit": 0, - "bold": 0, - "collapsible": 0, - "columns": 0, - "fetch_if_empty": 0, - "fieldname": "section_break_45", - "fieldtype": "Section Break", - "hidden": 0, - "ignore_user_permissions": 0, - "ignore_xss_filter": 0, - "in_filter": 0, - "in_global_search": 0, - "in_list_view": 0, - "in_standard_filter": 0, - "length": 0, - "no_copy": 0, - "permlevel": 0, - "precision": "", - "print_hide": 0, - "print_hide_if_no_value": 0, - "read_only": 0, - "remember_last_selected_value": 0, - "report_hide": 0, - "reqd": 0, - "search_index": 0, - "set_only_once": 0, - "translatable": 0, + "allow_bulk_edit": 0, + "allow_in_quick_entry": 0, + "allow_on_submit": 0, + "bold": 0, + "collapsible": 0, + "columns": 0, + "fetch_if_empty": 0, + "fieldname": "section_break_45", + "fieldtype": "Section Break", + "hidden": 0, + "ignore_user_permissions": 0, + "ignore_xss_filter": 0, + "in_filter": 0, + "in_global_search": 0, + "in_list_view": 0, + "in_standard_filter": 0, + "length": 0, + "no_copy": 0, + "permlevel": 0, + "precision": "", + "print_hide": 0, + "print_hide_if_no_value": 0, + "read_only": 0, + "remember_last_selected_value": 0, + "report_hide": 0, + "reqd": 0, + "search_index": 0, + "set_only_once": 0, + "translatable": 0, "unique": 0 - }, + }, { - "allow_bulk_edit": 0, - "allow_in_quick_entry": 0, - "allow_on_submit": 0, - "bold": 0, - "collapsible": 0, - "columns": 0, - "fetch_if_empty": 0, - "fieldname": "serial_no", - "fieldtype": "Small Text", - "hidden": 0, - "ignore_user_permissions": 0, - "ignore_xss_filter": 0, - "in_filter": 0, - "in_global_search": 0, - "in_list_view": 1, - "in_standard_filter": 0, - "label": "Serial No", - "length": 0, - "no_copy": 1, - "oldfieldname": "serial_no", - "oldfieldtype": "Text", - "permlevel": 0, - "print_hide": 0, - "print_hide_if_no_value": 0, - "read_only": 0, - "remember_last_selected_value": 0, - "report_hide": 0, - "reqd": 0, - "search_index": 0, - "set_only_once": 0, - "translatable": 0, + "allow_bulk_edit": 0, + "allow_in_quick_entry": 0, + "allow_on_submit": 0, + "bold": 0, + "collapsible": 0, + "columns": 0, + "fetch_if_empty": 0, + "fieldname": "serial_no", + "fieldtype": "Small Text", + "hidden": 0, + "ignore_user_permissions": 0, + "ignore_xss_filter": 0, + "in_filter": 0, + "in_global_search": 0, + "in_list_view": 1, + "in_standard_filter": 0, + "label": "Serial No", + "length": 0, + "no_copy": 1, + "oldfieldname": "serial_no", + "oldfieldtype": "Text", + "permlevel": 0, + "print_hide": 0, + "print_hide_if_no_value": 0, + "read_only": 0, + "remember_last_selected_value": 0, + "report_hide": 0, + "reqd": 0, + "search_index": 0, + "set_only_once": 0, + "translatable": 0, "unique": 0 - }, + }, { - "allow_bulk_edit": 0, - "allow_in_quick_entry": 0, - "allow_on_submit": 0, - "bold": 0, - "collapsible": 0, - "columns": 0, - "fetch_if_empty": 0, - "fieldname": "batch_no", - "fieldtype": "Link", - "hidden": 0, - "ignore_user_permissions": 0, - "ignore_xss_filter": 0, - "in_filter": 0, - "in_global_search": 0, - "in_list_view": 1, - "in_standard_filter": 0, - "label": "Batch No", - "length": 0, - "no_copy": 1, - "oldfieldname": "batch_no", - "oldfieldtype": "Link", - "options": "Batch", - "permlevel": 0, - "print_hide": 1, - "print_hide_if_no_value": 0, - "read_only": 0, - "remember_last_selected_value": 0, - "report_hide": 0, - "reqd": 0, - "search_index": 0, - "set_only_once": 0, - "translatable": 0, + "allow_bulk_edit": 0, + "allow_in_quick_entry": 0, + "allow_on_submit": 0, + "bold": 0, + "collapsible": 0, + "columns": 0, + "fetch_if_empty": 0, + "fieldname": "batch_no", + "fieldtype": "Link", + "hidden": 0, + "ignore_user_permissions": 0, + "ignore_xss_filter": 0, + "in_filter": 0, + "in_global_search": 0, + "in_list_view": 1, + "in_standard_filter": 0, + "label": "Batch No", + "length": 0, + "no_copy": 1, + "oldfieldname": "batch_no", + "oldfieldtype": "Link", + "options": "Batch", + "permlevel": 0, + "print_hide": 1, + "print_hide_if_no_value": 0, + "read_only": 0, + "remember_last_selected_value": 0, + "report_hide": 0, + "reqd": 0, + "search_index": 0, + "set_only_once": 0, + "translatable": 0, "unique": 0 - }, + }, { - "allow_bulk_edit": 0, - "allow_in_quick_entry": 0, - "allow_on_submit": 0, - "bold": 0, - "collapsible": 0, - "columns": 0, - "fetch_if_empty": 0, - "fieldname": "column_break_48", - "fieldtype": "Column Break", - "hidden": 0, - "ignore_user_permissions": 0, - "ignore_xss_filter": 0, - "in_filter": 0, - "in_global_search": 0, - "in_list_view": 0, - "in_standard_filter": 0, - "label": "", - "length": 0, - "no_copy": 0, - "permlevel": 0, - "precision": "", - "print_hide": 0, - "print_hide_if_no_value": 0, - "read_only": 0, - "remember_last_selected_value": 0, - "report_hide": 0, - "reqd": 0, - "search_index": 0, - "set_only_once": 0, - "translatable": 0, + "allow_bulk_edit": 0, + "allow_in_quick_entry": 0, + "allow_on_submit": 0, + "bold": 0, + "collapsible": 0, + "columns": 0, + "fetch_if_empty": 0, + "fieldname": "column_break_48", + "fieldtype": "Column Break", + "hidden": 0, + "ignore_user_permissions": 0, + "ignore_xss_filter": 0, + "in_filter": 0, + "in_global_search": 0, + "in_list_view": 0, + "in_standard_filter": 0, + "label": "", + "length": 0, + "no_copy": 0, + "permlevel": 0, + "precision": "", + "print_hide": 0, + "print_hide_if_no_value": 0, + "read_only": 0, + "remember_last_selected_value": 0, + "report_hide": 0, + "reqd": 0, + "search_index": 0, + "set_only_once": 0, + "translatable": 0, "unique": 0 - }, + }, { - "allow_bulk_edit": 0, - "allow_in_quick_entry": 0, - "allow_on_submit": 0, - "bold": 0, - "collapsible": 0, - "columns": 0, - "fetch_if_empty": 0, - "fieldname": "rejected_serial_no", - "fieldtype": "Small Text", - "hidden": 0, - "ignore_user_permissions": 0, - "ignore_xss_filter": 0, - "in_filter": 0, - "in_global_search": 0, - "in_list_view": 0, - "in_standard_filter": 0, - "label": "Rejected Serial No", - "length": 0, - "no_copy": 1, - "permlevel": 0, - "print_hide": 1, - "print_hide_if_no_value": 0, - "read_only": 0, - "remember_last_selected_value": 0, - "report_hide": 0, - "reqd": 0, - "search_index": 0, - "set_only_once": 0, - "translatable": 0, + "allow_bulk_edit": 0, + "allow_in_quick_entry": 0, + "allow_on_submit": 0, + "bold": 0, + "collapsible": 0, + "columns": 0, + "fetch_if_empty": 0, + "fieldname": "rejected_serial_no", + "fieldtype": "Small Text", + "hidden": 0, + "ignore_user_permissions": 0, + "ignore_xss_filter": 0, + "in_filter": 0, + "in_global_search": 0, + "in_list_view": 0, + "in_standard_filter": 0, + "label": "Rejected Serial No", + "length": 0, + "no_copy": 1, + "permlevel": 0, + "print_hide": 1, + "print_hide_if_no_value": 0, + "read_only": 0, + "remember_last_selected_value": 0, + "report_hide": 0, + "reqd": 0, + "search_index": 0, + "set_only_once": 0, + "translatable": 0, "unique": 0 - }, + }, { - "allow_bulk_edit": 0, - "allow_in_quick_entry": 0, - "allow_on_submit": 0, - "bold": 0, - "collapsible": 0, - "columns": 0, - "fetch_if_empty": 0, - "fieldname": "section_break_50", - "fieldtype": "Section Break", - "hidden": 0, - "ignore_user_permissions": 0, - "ignore_xss_filter": 0, - "in_filter": 0, - "in_global_search": 0, - "in_list_view": 0, - "in_standard_filter": 0, - "length": 0, - "no_copy": 0, - "permlevel": 0, - "precision": "", - "print_hide": 0, - "print_hide_if_no_value": 0, - "read_only": 0, - "remember_last_selected_value": 0, - "report_hide": 0, - "reqd": 0, - "search_index": 0, - "set_only_once": 0, - "translatable": 0, + "allow_bulk_edit": 0, + "allow_in_quick_entry": 0, + "allow_on_submit": 0, + "bold": 0, + "collapsible": 0, + "columns": 0, + "fetch_if_empty": 0, + "fieldname": "section_break_50", + "fieldtype": "Section Break", + "hidden": 0, + "ignore_user_permissions": 0, + "ignore_xss_filter": 0, + "in_filter": 0, + "in_global_search": 0, + "in_list_view": 0, + "in_standard_filter": 0, + "length": 0, + "no_copy": 0, + "permlevel": 0, + "precision": "", + "print_hide": 0, + "print_hide_if_no_value": 0, + "read_only": 0, + "remember_last_selected_value": 0, + "report_hide": 0, + "reqd": 0, + "search_index": 0, + "set_only_once": 0, + "translatable": 0, "unique": 0 - }, + }, { - "allow_bulk_edit": 0, - "allow_in_quick_entry": 0, - "allow_on_submit": 0, - "bold": 0, - "collapsible": 0, - "columns": 0, - "fetch_if_empty": 0, - "fieldname": "item_tax_template", - "fieldtype": "Link", - "hidden": 0, - "ignore_user_permissions": 0, - "ignore_xss_filter": 0, - "in_filter": 0, - "in_global_search": 0, - "in_list_view": 0, - "in_standard_filter": 0, - "label": "Item Tax Template", - "length": 0, - "no_copy": 0, - "options": "Item Tax Template", - "permlevel": 0, - "precision": "", - "print_hide": 1, - "print_hide_if_no_value": 0, - "read_only": 0, - "remember_last_selected_value": 0, - "report_hide": 0, - "reqd": 0, - "search_index": 0, - "set_only_once": 0, - "translatable": 0, + "allow_bulk_edit": 0, + "allow_in_quick_entry": 0, + "allow_on_submit": 0, + "bold": 0, + "collapsible": 0, + "columns": 0, + "fetch_if_empty": 0, + "fieldname": "item_tax_template", + "fieldtype": "Link", + "hidden": 0, + "ignore_user_permissions": 0, + "ignore_xss_filter": 0, + "in_filter": 0, + "in_global_search": 0, + "in_list_view": 0, + "in_standard_filter": 0, + "label": "Item Tax Template", + "length": 0, + "no_copy": 0, + "options": "Item Tax Template", + "permlevel": 0, + "precision": "", + "print_hide": 1, + "print_hide_if_no_value": 0, + "read_only": 0, + "remember_last_selected_value": 0, + "report_hide": 0, + "reqd": 0, + "search_index": 0, + "set_only_once": 0, + "translatable": 0, "unique": 0 - }, + }, { - "allow_bulk_edit": 0, - "allow_in_quick_entry": 0, - "allow_on_submit": 0, - "bold": 0, - "collapsible": 0, - "columns": 0, - "fetch_if_empty": 0, - "fieldname": "project", - "fieldtype": "Link", - "hidden": 0, - "ignore_user_permissions": 0, - "ignore_xss_filter": 0, - "in_filter": 0, - "in_global_search": 0, - "in_list_view": 0, - "in_standard_filter": 0, - "label": "Project", - "length": 0, - "no_copy": 0, - "options": "Project", - "permlevel": 0, - "print_hide": 1, - "print_hide_if_no_value": 0, - "read_only": 0, - "remember_last_selected_value": 0, - "report_hide": 0, - "reqd": 0, - "search_index": 0, - "set_only_once": 0, - "translatable": 0, + "allow_bulk_edit": 0, + "allow_in_quick_entry": 0, + "allow_on_submit": 0, + "bold": 0, + "collapsible": 0, + "columns": 0, + "fetch_if_empty": 0, + "fieldname": "project", + "fieldtype": "Link", + "hidden": 0, + "ignore_user_permissions": 0, + "ignore_xss_filter": 0, + "in_filter": 0, + "in_global_search": 0, + "in_list_view": 0, + "in_standard_filter": 0, + "label": "Project", + "length": 0, + "no_copy": 0, + "options": "Project", + "permlevel": 0, + "print_hide": 1, + "print_hide_if_no_value": 0, + "read_only": 0, + "remember_last_selected_value": 0, + "report_hide": 0, + "reqd": 0, + "search_index": 0, + "set_only_once": 0, + "translatable": 0, "unique": 0 - }, + }, { - "allow_bulk_edit": 0, - "allow_in_quick_entry": 0, - "allow_on_submit": 0, - "bold": 0, - "collapsible": 0, - "columns": 0, - "default": ":Company", - "depends_on": "eval:cint(erpnext.is_perpetual_inventory_enabled(parent.company))", - "fetch_if_empty": 0, - "fieldname": "cost_center", - "fieldtype": "Link", - "hidden": 0, - "ignore_user_permissions": 0, - "ignore_xss_filter": 0, - "in_filter": 0, - "in_global_search": 0, - "in_list_view": 0, - "in_standard_filter": 0, - "label": "Cost Center", - "length": 0, - "no_copy": 0, - "options": "Cost Center", - "permlevel": 0, - "print_hide": 1, - "print_hide_if_no_value": 0, - "read_only": 0, - "remember_last_selected_value": 0, - "report_hide": 0, - "reqd": 0, - "search_index": 0, - "set_only_once": 0, - "translatable": 0, + "allow_bulk_edit": 0, + "allow_in_quick_entry": 0, + "allow_on_submit": 0, + "bold": 0, + "collapsible": 0, + "columns": 0, + "default": ":Company", + "depends_on": "eval:cint(erpnext.is_perpetual_inventory_enabled(parent.company))", + "fetch_if_empty": 0, + "fieldname": "cost_center", + "fieldtype": "Link", + "hidden": 0, + "ignore_user_permissions": 0, + "ignore_xss_filter": 0, + "in_filter": 0, + "in_global_search": 0, + "in_list_view": 0, + "in_standard_filter": 0, + "label": "Cost Center", + "length": 0, + "no_copy": 0, + "options": "Cost Center", + "permlevel": 0, + "print_hide": 1, + "print_hide_if_no_value": 0, + "read_only": 0, + "remember_last_selected_value": 0, + "report_hide": 0, + "reqd": 0, + "search_index": 0, + "set_only_once": 0, + "translatable": 0, "unique": 0 - }, + }, { - "allow_bulk_edit": 0, - "allow_in_quick_entry": 0, - "allow_on_submit": 0, - "bold": 0, - "collapsible": 0, - "columns": 0, - "fetch_if_empty": 0, - "fieldname": "purchase_order_item", - "fieldtype": "Data", - "hidden": 1, - "ignore_user_permissions": 0, - "ignore_xss_filter": 0, - "in_filter": 0, - "in_global_search": 0, - "in_list_view": 0, - "in_standard_filter": 0, - "label": "Purchase Order Item", - "length": 0, - "no_copy": 1, - "oldfieldname": "prevdoc_detail_docname", - "oldfieldtype": "Data", - "permlevel": 0, - "print_hide": 1, - "print_hide_if_no_value": 0, - "print_width": "150px", - "read_only": 1, - "remember_last_selected_value": 0, - "report_hide": 0, - "reqd": 0, - "search_index": 1, - "set_only_once": 0, - "translatable": 0, - "unique": 0, + "allow_bulk_edit": 0, + "allow_in_quick_entry": 0, + "allow_on_submit": 0, + "bold": 0, + "collapsible": 0, + "columns": 0, + "fetch_if_empty": 0, + "fieldname": "purchase_order_item", + "fieldtype": "Data", + "hidden": 1, + "ignore_user_permissions": 0, + "ignore_xss_filter": 0, + "in_filter": 0, + "in_global_search": 0, + "in_list_view": 0, + "in_standard_filter": 0, + "label": "Purchase Order Item", + "length": 0, + "no_copy": 1, + "oldfieldname": "prevdoc_detail_docname", + "oldfieldtype": "Data", + "permlevel": 0, + "print_hide": 1, + "print_hide_if_no_value": 0, + "print_width": "150px", + "read_only": 1, + "remember_last_selected_value": 0, + "report_hide": 0, + "reqd": 0, + "search_index": 1, + "set_only_once": 0, + "translatable": 0, + "unique": 0, "width": "150px" - }, + }, { - "allow_bulk_edit": 0, - "allow_in_quick_entry": 0, - "allow_on_submit": 0, - "bold": 0, - "collapsible": 0, - "columns": 0, - "fetch_if_empty": 0, - "fieldname": "col_break5", - "fieldtype": "Column Break", - "hidden": 0, - "ignore_user_permissions": 0, - "ignore_xss_filter": 0, - "in_filter": 0, - "in_global_search": 0, - "in_list_view": 0, - "in_standard_filter": 0, - "length": 0, - "no_copy": 0, - "permlevel": 0, - "print_hide": 0, - "print_hide_if_no_value": 0, - "read_only": 0, - "remember_last_selected_value": 0, - "report_hide": 0, - "reqd": 0, - "search_index": 0, - "set_only_once": 0, - "translatable": 0, + "allow_bulk_edit": 0, + "allow_in_quick_entry": 0, + "allow_on_submit": 0, + "bold": 0, + "collapsible": 0, + "columns": 0, + "fetch_if_empty": 0, + "fieldname": "material_request_item", + "fieldtype": "Data", + "hidden": 1, + "ignore_user_permissions": 0, + "ignore_xss_filter": 0, + "in_filter": 0, + "in_global_search": 0, + "in_list_view": 0, + "in_standard_filter": 0, + "label": "Material Request Item", + "length": 0, + "no_copy": 1, + "permlevel": 0, + "precision": "", + "print_hide": 1, + "print_hide_if_no_value": 0, + "read_only": 1, + "remember_last_selected_value": 0, + "report_hide": 0, + "reqd": 0, + "search_index": 1, + "set_only_once": 0, + "translatable": 0, "unique": 0 - }, + }, { - "allow_bulk_edit": 0, - "allow_in_quick_entry": 0, - "allow_on_submit": 0, - "bold": 0, - "collapsible": 0, - "columns": 0, - "fetch_if_empty": 0, - "fieldname": "allow_zero_valuation_rate", - "fieldtype": "Check", - "hidden": 0, - "ignore_user_permissions": 0, - "ignore_xss_filter": 0, - "in_filter": 0, - "in_global_search": 0, - "in_list_view": 0, - "in_standard_filter": 0, - "label": "Allow Zero Valuation Rate", - "length": 0, - "no_copy": 1, - "permlevel": 0, - "precision": "", - "print_hide": 1, - "print_hide_if_no_value": 0, - "read_only": 0, - "remember_last_selected_value": 0, - "report_hide": 0, - "reqd": 0, - "search_index": 0, - "set_only_once": 0, - "translatable": 0, + "allow_bulk_edit": 0, + "allow_in_quick_entry": 0, + "allow_on_submit": 0, + "bold": 0, + "collapsible": 0, + "columns": 0, + "fetch_if_empty": 0, + "fieldname": "col_break5", + "fieldtype": "Column Break", + "hidden": 0, + "ignore_user_permissions": 0, + "ignore_xss_filter": 0, + "in_filter": 0, + "in_global_search": 0, + "in_list_view": 0, + "in_standard_filter": 0, + "length": 0, + "no_copy": 0, + "permlevel": 0, + "print_hide": 0, + "print_hide_if_no_value": 0, + "read_only": 0, + "remember_last_selected_value": 0, + "report_hide": 0, + "reqd": 0, + "search_index": 0, + "set_only_once": 0, + "translatable": 0, "unique": 0 - }, + }, { - "allow_bulk_edit": 0, - "allow_in_quick_entry": 0, - "allow_on_submit": 0, - "bold": 0, - "collapsible": 0, - "columns": 0, - "fetch_if_empty": 0, - "fieldname": "bom", - "fieldtype": "Link", - "hidden": 0, - "ignore_user_permissions": 0, - "ignore_xss_filter": 0, - "in_filter": 0, - "in_global_search": 0, - "in_list_view": 0, - "in_standard_filter": 0, - "label": "BOM", - "length": 0, - "no_copy": 1, - "options": "BOM", - "permlevel": 0, - "precision": "", - "print_hide": 1, - "print_hide_if_no_value": 0, - "read_only": 0, - "remember_last_selected_value": 0, - "report_hide": 0, - "reqd": 0, - "search_index": 0, - "set_only_once": 0, - "translatable": 0, + "allow_bulk_edit": 0, + "allow_in_quick_entry": 0, + "allow_on_submit": 0, + "bold": 0, + "collapsible": 0, + "columns": 0, + "fetch_if_empty": 0, + "fieldname": "allow_zero_valuation_rate", + "fieldtype": "Check", + "hidden": 0, + "ignore_user_permissions": 0, + "ignore_xss_filter": 0, + "in_filter": 0, + "in_global_search": 0, + "in_list_view": 0, + "in_standard_filter": 0, + "label": "Allow Zero Valuation Rate", + "length": 0, + "no_copy": 1, + "permlevel": 0, + "precision": "", + "print_hide": 1, + "print_hide_if_no_value": 0, + "read_only": 0, + "remember_last_selected_value": 0, + "report_hide": 0, + "reqd": 0, + "search_index": 0, + "set_only_once": 0, + "translatable": 0, "unique": 0 - }, + }, { - "allow_bulk_edit": 0, - "allow_in_quick_entry": 0, - "allow_on_submit": 0, - "bold": 0, - "collapsible": 0, - "columns": 0, - "depends_on": "eval:parent.is_subcontracted == 'Yes'", - "fetch_if_empty": 0, - "fieldname": "include_exploded_items", - "fieldtype": "Check", - "hidden": 0, - "ignore_user_permissions": 0, - "ignore_xss_filter": 0, - "in_filter": 0, - "in_global_search": 0, - "in_list_view": 0, - "in_standard_filter": 0, - "label": "Include Exploded Items", - "length": 0, - "no_copy": 0, - "permlevel": 0, - "precision": "", - "print_hide": 0, - "print_hide_if_no_value": 0, - "read_only": 1, - "remember_last_selected_value": 0, - "report_hide": 0, - "reqd": 0, - "search_index": 0, - "set_only_once": 0, - "translatable": 0, + "allow_bulk_edit": 0, + "allow_in_quick_entry": 0, + "allow_on_submit": 0, + "bold": 0, + "collapsible": 0, + "columns": 0, + "fetch_if_empty": 0, + "fieldname": "bom", + "fieldtype": "Link", + "hidden": 0, + "ignore_user_permissions": 0, + "ignore_xss_filter": 0, + "in_filter": 0, + "in_global_search": 0, + "in_list_view": 0, + "in_standard_filter": 0, + "label": "BOM", + "length": 0, + "no_copy": 1, + "options": "BOM", + "permlevel": 0, + "precision": "", + "print_hide": 1, + "print_hide_if_no_value": 0, + "read_only": 0, + "remember_last_selected_value": 0, + "report_hide": 0, + "reqd": 0, + "search_index": 0, + "set_only_once": 0, + "translatable": 0, "unique": 0 - }, + }, { - "allow_bulk_edit": 0, - "allow_in_quick_entry": 0, - "allow_on_submit": 0, - "bold": 0, - "collapsible": 0, - "columns": 0, - "fetch_if_empty": 0, - "fieldname": "billed_amt", - "fieldtype": "Currency", - "hidden": 0, - "ignore_user_permissions": 0, - "ignore_xss_filter": 0, - "in_filter": 0, - "in_global_search": 0, - "in_list_view": 0, - "in_standard_filter": 0, - "label": "Billed Amt", - "length": 0, - "no_copy": 1, - "options": "currency", - "permlevel": 0, - "precision": "", - "print_hide": 1, - "print_hide_if_no_value": 0, - "read_only": 1, - "remember_last_selected_value": 0, - "report_hide": 0, - "reqd": 0, - "search_index": 0, - "set_only_once": 0, - "translatable": 0, + "allow_bulk_edit": 0, + "allow_in_quick_entry": 0, + "allow_on_submit": 0, + "bold": 0, + "collapsible": 0, + "columns": 0, + "depends_on": "eval:parent.is_subcontracted == 'Yes'", + "fetch_if_empty": 0, + "fieldname": "include_exploded_items", + "fieldtype": "Check", + "hidden": 0, + "ignore_user_permissions": 0, + "ignore_xss_filter": 0, + "in_filter": 0, + "in_global_search": 0, + "in_list_view": 0, + "in_standard_filter": 0, + "label": "Include Exploded Items", + "length": 0, + "no_copy": 0, + "permlevel": 0, + "precision": "", + "print_hide": 0, + "print_hide_if_no_value": 0, + "read_only": 1, + "remember_last_selected_value": 0, + "report_hide": 0, + "reqd": 0, + "search_index": 0, + "set_only_once": 0, + "translatable": 0, "unique": 0 - }, + }, { - "allow_bulk_edit": 0, - "allow_in_quick_entry": 0, - "allow_on_submit": 1, - "bold": 0, - "collapsible": 0, - "columns": 0, - "fetch_if_empty": 0, - "fieldname": "landed_cost_voucher_amount", - "fieldtype": "Currency", - "hidden": 0, - "ignore_user_permissions": 0, - "ignore_xss_filter": 0, - "in_filter": 0, - "in_global_search": 0, - "in_list_view": 0, - "in_standard_filter": 0, - "label": "Landed Cost Voucher Amount", - "length": 0, - "no_copy": 1, - "options": "Company:company:default_currency", - "permlevel": 0, - "print_hide": 1, - "print_hide_if_no_value": 0, - "read_only": 1, - "remember_last_selected_value": 0, - "report_hide": 0, - "reqd": 0, - "search_index": 0, - "set_only_once": 0, - "translatable": 0, + "allow_bulk_edit": 0, + "allow_in_quick_entry": 0, + "allow_on_submit": 0, + "bold": 0, + "collapsible": 0, + "columns": 0, + "fetch_if_empty": 0, + "fieldname": "billed_amt", + "fieldtype": "Currency", + "hidden": 0, + "ignore_user_permissions": 0, + "ignore_xss_filter": 0, + "in_filter": 0, + "in_global_search": 0, + "in_list_view": 0, + "in_standard_filter": 0, + "label": "Billed Amt", + "length": 0, + "no_copy": 1, + "options": "currency", + "permlevel": 0, + "precision": "", + "print_hide": 1, + "print_hide_if_no_value": 0, + "read_only": 1, + "remember_last_selected_value": 0, + "report_hide": 0, + "reqd": 0, + "search_index": 0, + "set_only_once": 0, + "translatable": 0, "unique": 0 - }, + }, { - "allow_bulk_edit": 0, - "allow_in_quick_entry": 0, - "allow_on_submit": 0, - "bold": 0, - "collapsible": 0, - "columns": 0, - "fetch_if_empty": 0, - "fieldname": "brand", - "fieldtype": "Link", - "hidden": 1, - "ignore_user_permissions": 0, - "ignore_xss_filter": 0, - "in_filter": 0, - "in_global_search": 0, - "in_list_view": 0, - "in_standard_filter": 0, - "label": "Brand", - "length": 0, - "no_copy": 0, - "oldfieldname": "brand", - "oldfieldtype": "Link", - "options": "Brand", - "permlevel": 0, - "print_hide": 1, - "print_hide_if_no_value": 0, - "read_only": 1, - "remember_last_selected_value": 0, - "report_hide": 0, - "reqd": 0, - "search_index": 0, - "set_only_once": 0, - "translatable": 0, + "allow_bulk_edit": 0, + "allow_in_quick_entry": 0, + "allow_on_submit": 1, + "bold": 0, + "collapsible": 0, + "columns": 0, + "fetch_if_empty": 0, + "fieldname": "landed_cost_voucher_amount", + "fieldtype": "Currency", + "hidden": 0, + "ignore_user_permissions": 0, + "ignore_xss_filter": 0, + "in_filter": 0, + "in_global_search": 0, + "in_list_view": 0, + "in_standard_filter": 0, + "label": "Landed Cost Voucher Amount", + "length": 0, + "no_copy": 1, + "options": "Company:company:default_currency", + "permlevel": 0, + "print_hide": 1, + "print_hide_if_no_value": 0, + "read_only": 1, + "remember_last_selected_value": 0, + "report_hide": 0, + "reqd": 0, + "search_index": 0, + "set_only_once": 0, + "translatable": 0, "unique": 0 - }, + }, { - "allow_bulk_edit": 0, - "allow_in_quick_entry": 0, - "allow_on_submit": 0, - "bold": 0, - "collapsible": 0, - "columns": 0, - "description": "", - "fetch_if_empty": 0, - "fieldname": "item_group", - "fieldtype": "Link", - "hidden": 1, - "ignore_user_permissions": 0, - "ignore_xss_filter": 0, - "in_filter": 0, - "in_global_search": 0, - "in_list_view": 0, - "in_standard_filter": 0, - "label": "Item Group", - "length": 0, - "no_copy": 0, - "oldfieldname": "item_group", - "oldfieldtype": "Link", - "options": "Item Group", - "permlevel": 0, - "print_hide": 1, - "print_hide_if_no_value": 0, - "read_only": 1, - "remember_last_selected_value": 0, - "report_hide": 0, - "reqd": 0, - "search_index": 0, - "set_only_once": 0, - "translatable": 0, + "allow_bulk_edit": 0, + "allow_in_quick_entry": 0, + "allow_on_submit": 0, + "bold": 0, + "collapsible": 0, + "columns": 0, + "fetch_if_empty": 0, + "fieldname": "brand", + "fieldtype": "Link", + "hidden": 1, + "ignore_user_permissions": 0, + "ignore_xss_filter": 0, + "in_filter": 0, + "in_global_search": 0, + "in_list_view": 0, + "in_standard_filter": 0, + "label": "Brand", + "length": 0, + "no_copy": 0, + "oldfieldname": "brand", + "oldfieldtype": "Link", + "options": "Brand", + "permlevel": 0, + "print_hide": 1, + "print_hide_if_no_value": 0, + "read_only": 1, + "remember_last_selected_value": 0, + "report_hide": 0, + "reqd": 0, + "search_index": 0, + "set_only_once": 0, + "translatable": 0, "unique": 0 - }, + }, { - "allow_bulk_edit": 0, - "allow_in_quick_entry": 0, - "allow_on_submit": 0, - "bold": 0, - "collapsible": 0, - "columns": 0, - "fetch_if_empty": 0, - "fieldname": "rm_supp_cost", - "fieldtype": "Currency", - "hidden": 1, - "ignore_user_permissions": 0, - "ignore_xss_filter": 0, - "in_filter": 0, - "in_global_search": 0, - "in_list_view": 0, - "in_standard_filter": 0, - "label": "Raw Materials Supplied Cost", - "length": 0, - "no_copy": 1, - "oldfieldname": "rm_supp_cost", - "oldfieldtype": "Currency", - "options": "Company:company:default_currency", - "permlevel": 0, - "print_hide": 1, - "print_hide_if_no_value": 0, - "print_width": "150px", - "read_only": 1, - "remember_last_selected_value": 0, - "report_hide": 0, - "reqd": 0, - "search_index": 0, - "set_only_once": 0, - "translatable": 0, - "unique": 0, + "allow_bulk_edit": 0, + "allow_in_quick_entry": 0, + "allow_on_submit": 0, + "bold": 0, + "collapsible": 0, + "columns": 0, + "description": "", + "fetch_if_empty": 0, + "fieldname": "item_group", + "fieldtype": "Link", + "hidden": 1, + "ignore_user_permissions": 0, + "ignore_xss_filter": 0, + "in_filter": 0, + "in_global_search": 0, + "in_list_view": 0, + "in_standard_filter": 0, + "label": "Item Group", + "length": 0, + "no_copy": 0, + "oldfieldname": "item_group", + "oldfieldtype": "Link", + "options": "Item Group", + "permlevel": 0, + "print_hide": 1, + "print_hide_if_no_value": 0, + "read_only": 1, + "remember_last_selected_value": 0, + "report_hide": 0, + "reqd": 0, + "search_index": 0, + "set_only_once": 0, + "translatable": 0, + "unique": 0 + }, + { + "allow_bulk_edit": 0, + "allow_in_quick_entry": 0, + "allow_on_submit": 0, + "bold": 0, + "collapsible": 0, + "columns": 0, + "fetch_if_empty": 0, + "fieldname": "rm_supp_cost", + "fieldtype": "Currency", + "hidden": 1, + "ignore_user_permissions": 0, + "ignore_xss_filter": 0, + "in_filter": 0, + "in_global_search": 0, + "in_list_view": 0, + "in_standard_filter": 0, + "label": "Raw Materials Supplied Cost", + "length": 0, + "no_copy": 1, + "oldfieldname": "rm_supp_cost", + "oldfieldtype": "Currency", + "options": "Company:company:default_currency", + "permlevel": 0, + "print_hide": 1, + "print_hide_if_no_value": 0, + "print_width": "150px", + "read_only": 1, + "remember_last_selected_value": 0, + "report_hide": 0, + "reqd": 0, + "search_index": 0, + "set_only_once": 0, + "translatable": 0, + "unique": 0, "width": "150px" - }, + }, { - "allow_bulk_edit": 0, - "allow_in_quick_entry": 0, - "allow_on_submit": 0, - "bold": 0, - "collapsible": 0, - "columns": 0, - "fetch_if_empty": 0, - "fieldname": "item_tax_amount", - "fieldtype": "Currency", - "hidden": 1, - "ignore_user_permissions": 0, - "ignore_xss_filter": 0, - "in_filter": 0, - "in_global_search": 0, - "in_list_view": 0, - "in_standard_filter": 0, - "label": "Item Tax Amount", - "length": 0, - "no_copy": 1, - "oldfieldname": "item_tax_amount", - "oldfieldtype": "Currency", - "options": "Company:company:default_currency", - "permlevel": 0, - "print_hide": 1, - "print_hide_if_no_value": 0, - "print_width": "150px", - "read_only": 1, - "remember_last_selected_value": 0, - "report_hide": 0, - "reqd": 0, - "search_index": 0, - "set_only_once": 0, - "translatable": 0, - "unique": 0, + "allow_bulk_edit": 0, + "allow_in_quick_entry": 0, + "allow_on_submit": 0, + "bold": 0, + "collapsible": 0, + "columns": 0, + "fetch_if_empty": 0, + "fieldname": "item_tax_amount", + "fieldtype": "Currency", + "hidden": 1, + "ignore_user_permissions": 0, + "ignore_xss_filter": 0, + "in_filter": 0, + "in_global_search": 0, + "in_list_view": 0, + "in_standard_filter": 0, + "label": "Item Tax Amount", + "length": 0, + "no_copy": 1, + "oldfieldname": "item_tax_amount", + "oldfieldtype": "Currency", + "options": "Company:company:default_currency", + "permlevel": 0, + "print_hide": 1, + "print_hide_if_no_value": 0, + "print_width": "150px", + "read_only": 1, + "remember_last_selected_value": 0, + "report_hide": 0, + "reqd": 0, + "search_index": 0, + "set_only_once": 0, + "translatable": 0, + "unique": 0, "width": "150px" - }, + }, { - "allow_bulk_edit": 0, - "allow_in_quick_entry": 0, - "allow_on_submit": 1, - "bold": 0, - "collapsible": 0, - "columns": 0, - "fetch_if_empty": 0, - "fieldname": "valuation_rate", - "fieldtype": "Currency", - "hidden": 1, - "ignore_user_permissions": 0, - "ignore_xss_filter": 0, - "in_filter": 0, - "in_global_search": 0, - "in_list_view": 0, - "in_standard_filter": 0, - "label": "Valuation Rate", - "length": 0, - "no_copy": 1, - "oldfieldname": "valuation_rate", - "oldfieldtype": "Currency", - "options": "Company:company:default_currency", - "permlevel": 0, - "print_hide": 1, - "print_hide_if_no_value": 0, - "print_width": "80px", - "read_only": 1, - "remember_last_selected_value": 0, - "report_hide": 0, - "reqd": 0, - "search_index": 0, - "set_only_once": 0, - "translatable": 0, - "unique": 0, + "allow_bulk_edit": 0, + "allow_in_quick_entry": 0, + "allow_on_submit": 1, + "bold": 0, + "collapsible": 0, + "columns": 0, + "fetch_if_empty": 0, + "fieldname": "valuation_rate", + "fieldtype": "Currency", + "hidden": 1, + "ignore_user_permissions": 0, + "ignore_xss_filter": 0, + "in_filter": 0, + "in_global_search": 0, + "in_list_view": 0, + "in_standard_filter": 0, + "label": "Valuation Rate", + "length": 0, + "no_copy": 1, + "oldfieldname": "valuation_rate", + "oldfieldtype": "Currency", + "options": "Company:company:default_currency", + "permlevel": 0, + "print_hide": 1, + "print_hide_if_no_value": 0, + "print_width": "80px", + "read_only": 1, + "remember_last_selected_value": 0, + "report_hide": 0, + "reqd": 0, + "search_index": 0, + "set_only_once": 0, + "translatable": 0, + "unique": 0, "width": "80px" - }, + }, { - "allow_bulk_edit": 0, - "allow_in_quick_entry": 0, - "allow_on_submit": 0, - "bold": 0, - "collapsible": 0, - "columns": 0, - "description": "Tax detail table fetched from item master as a string and stored in this field.\nUsed for Taxes and Charges", - "fetch_if_empty": 0, - "fieldname": "item_tax_rate", - "fieldtype": "Code", - "hidden": 1, - "ignore_user_permissions": 0, - "ignore_xss_filter": 0, - "in_filter": 0, - "in_global_search": 0, - "in_list_view": 0, - "in_standard_filter": 0, - "label": "Item Tax Rate", - "length": 0, - "no_copy": 0, - "oldfieldname": "item_tax_rate", - "oldfieldtype": "Small Text", - "permlevel": 0, - "print_hide": 1, - "print_hide_if_no_value": 0, - "read_only": 1, - "remember_last_selected_value": 0, - "report_hide": 1, - "reqd": 0, - "search_index": 0, - "set_only_once": 0, - "translatable": 0, + "allow_bulk_edit": 0, + "allow_in_quick_entry": 0, + "allow_on_submit": 0, + "bold": 0, + "collapsible": 0, + "columns": 0, + "description": "Tax detail table fetched from item master as a string and stored in this field.\nUsed for Taxes and Charges", + "fetch_if_empty": 0, + "fieldname": "item_tax_rate", + "fieldtype": "Code", + "hidden": 1, + "ignore_user_permissions": 0, + "ignore_xss_filter": 0, + "in_filter": 0, + "in_global_search": 0, + "in_list_view": 0, + "in_standard_filter": 0, + "label": "Item Tax Rate", + "length": 0, + "no_copy": 0, + "oldfieldname": "item_tax_rate", + "oldfieldtype": "Small Text", + "permlevel": 0, + "print_hide": 1, + "print_hide_if_no_value": 0, + "read_only": 1, + "remember_last_selected_value": 0, + "report_hide": 1, + "reqd": 0, + "search_index": 0, + "set_only_once": 0, + "translatable": 0, "unique": 0 - }, + }, { - "allow_bulk_edit": 0, - "allow_in_quick_entry": 0, - "allow_on_submit": 1, - "bold": 0, - "collapsible": 0, - "columns": 0, - "fetch_if_empty": 0, - "fieldname": "page_break", - "fieldtype": "Check", - "hidden": 0, - "ignore_user_permissions": 0, - "ignore_xss_filter": 0, - "in_filter": 0, - "in_global_search": 0, - "in_list_view": 0, - "in_standard_filter": 0, - "label": "Page Break", - "length": 0, - "no_copy": 0, - "oldfieldname": "page_break", - "oldfieldtype": "Check", - "permlevel": 0, - "print_hide": 1, - "print_hide_if_no_value": 0, - "read_only": 0, - "remember_last_selected_value": 0, - "report_hide": 0, - "reqd": 0, - "search_index": 0, - "set_only_once": 0, - "translatable": 0, + "allow_bulk_edit": 0, + "allow_in_quick_entry": 0, + "allow_on_submit": 1, + "bold": 0, + "collapsible": 0, + "columns": 0, + "fetch_if_empty": 0, + "fieldname": "page_break", + "fieldtype": "Check", + "hidden": 0, + "ignore_user_permissions": 0, + "ignore_xss_filter": 0, + "in_filter": 0, + "in_global_search": 0, + "in_list_view": 0, + "in_standard_filter": 0, + "label": "Page Break", + "length": 0, + "no_copy": 0, + "oldfieldname": "page_break", + "oldfieldtype": "Check", + "permlevel": 0, + "print_hide": 1, + "print_hide_if_no_value": 0, + "read_only": 0, + "remember_last_selected_value": 0, + "report_hide": 0, + "reqd": 0, + "search_index": 0, + "set_only_once": 0, + "translatable": 0, "unique": 0 } - ], - "has_web_view": 0, - "hide_heading": 0, - "hide_toolbar": 0, - "idx": 1, - "image_view": 0, - "in_create": 0, - "is_submittable": 0, - "issingle": 0, - "istable": 1, - "max_attachments": 0, - "modified": "2019-03-19 03:02:05.086119", - "modified_by": "Administrator", - "module": "Stock", - "name": "Purchase Receipt Item", - "owner": "Administrator", - "permissions": [], - "quick_entry": 1, - "read_only": 0, - "read_only_onload": 0, - "show_name_in_global_search": 0, - "sort_field": "modified", - "sort_order": "DESC", - "track_changes": 0, - "track_seen": 0, + ], + "has_web_view": 0, + "hide_toolbar": 0, + "idx": 1, + "in_create": 0, + "is_submittable": 0, + "issingle": 0, + "istable": 1, + "max_attachments": 0, + "modified": "2019-04-22 10:36:03.329588", + "modified_by": "Administrator", + "module": "Stock", + "name": "Purchase Receipt Item", + "owner": "Administrator", + "permissions": [], + "quick_entry": 1, + "read_only": 0, + "show_name_in_global_search": 0, + "sort_field": "modified", + "sort_order": "DESC", + "track_changes": 0, + "track_seen": 0, "track_views": 0 } \ No newline at end of file From 425699d9f20f1d94372da10bac98309b6fd5c3e8 Mon Sep 17 00:00:00 2001 From: deepeshgarg007 Date: Mon, 22 Apr 2019 16:54:52 +0530 Subject: [PATCH 02/73] fix: Material request list_view status fixes --- erpnext/stock/doctype/material_request/material_request_list.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/erpnext/stock/doctype/material_request/material_request_list.js b/erpnext/stock/doctype/material_request/material_request_list.js index 15aa31e7f0..a915a1a63b 100644 --- a/erpnext/stock/doctype/material_request/material_request_list.js +++ b/erpnext/stock/doctype/material_request/material_request_list.js @@ -1,5 +1,5 @@ frappe.listview_settings['Material Request'] = { - add_fields: ["material_request_type", "status", "per_ordered"], + add_fields: ["material_request_type", "status", "per_ordered", "per_received"], get_indicator: function(doc) { if(doc.status=="Stopped") { return [__("Stopped"), "red", "status,=,Stopped"]; From 69909c0f51a7d8759de85d00247ea804329481f0 Mon Sep 17 00:00:00 2001 From: Mangesh-Khairnar Date: Fri, 29 Mar 2019 20:44:23 +0530 Subject: [PATCH 03/73] feat: create procurement tracker report --- .../report/procurement_tracker/__init__.py | 0 .../procurement_tracker.js | 9 + .../procurement_tracker.json | 20 +++ .../procurement_tracker.py | 167 ++++++++++++++++++ 4 files changed, 196 insertions(+) create mode 100644 erpnext/buying/report/procurement_tracker/__init__.py create mode 100644 erpnext/buying/report/procurement_tracker/procurement_tracker.js create mode 100644 erpnext/buying/report/procurement_tracker/procurement_tracker.json create mode 100644 erpnext/buying/report/procurement_tracker/procurement_tracker.py diff --git a/erpnext/buying/report/procurement_tracker/__init__.py b/erpnext/buying/report/procurement_tracker/__init__.py new file mode 100644 index 0000000000..e69de29bb2 diff --git a/erpnext/buying/report/procurement_tracker/procurement_tracker.js b/erpnext/buying/report/procurement_tracker/procurement_tracker.js new file mode 100644 index 0000000000..7096b9f9f8 --- /dev/null +++ b/erpnext/buying/report/procurement_tracker/procurement_tracker.js @@ -0,0 +1,9 @@ +// Copyright (c) 2016, Frappe Technologies Pvt. Ltd. and contributors +// For license information, please see license.txt +/* eslint-disable */ + +frappe.query_reports["Procurement Tracker"] = { + "filters": [ + + ] +} diff --git a/erpnext/buying/report/procurement_tracker/procurement_tracker.json b/erpnext/buying/report/procurement_tracker/procurement_tracker.json new file mode 100644 index 0000000000..028736c7c4 --- /dev/null +++ b/erpnext/buying/report/procurement_tracker/procurement_tracker.json @@ -0,0 +1,20 @@ +{ + "add_total_row": 1, + "creation": "2019-03-29 17:05:45.196949", + "disable_prepared_report": 0, + "disabled": 0, + "docstatus": 0, + "doctype": "Report", + "idx": 0, + "is_standard": "Yes", + "modified": "2019-03-29 17:18:06.678728", + "modified_by": "Administrator", + "module": "Buying", + "name": "Procurement Tracker", + "owner": "Administrator", + "prepared_report": 0, + "ref_doctype": "Purchase Order", + "report_name": "Procurement Tracker", + "report_type": "Script Report", + "roles": [] +} \ No newline at end of file diff --git a/erpnext/buying/report/procurement_tracker/procurement_tracker.py b/erpnext/buying/report/procurement_tracker/procurement_tracker.py new file mode 100644 index 0000000000..ee6fd2d0fb --- /dev/null +++ b/erpnext/buying/report/procurement_tracker/procurement_tracker.py @@ -0,0 +1,167 @@ +# Copyright (c) 2013, Frappe Technologies Pvt. Ltd. and contributors +# For license information, please see license.txt + +from __future__ import unicode_literals +import frappe +from frappe import _ +from frappe.utils import cint,cstr + +def execute(filters=None): + columns = get_columns() + data = get_data() + return columns, data + +def get_columns(): + columns = [ + { + "label": _("Date Requisition Received in Procurement "), + "fieldname": "date_requisition_received_in_procurement", + "fieldtype": "Date", + "width": 140 + }, + { + "label": _("Date Requisition was Raised"), + "fieldname": "date_requisition_was_raised", + "fieldtype": "Date", + "width": 140 + }, + { + "label": _("Sector/Project"), + "options": "Cost Center", + "fieldname": "sector/project", + "fieldtype": "Link", + "width": 140 + }, + { + "label": _("Requesting Site"), + "options": "Warehouse", + "fieldname": "requesting_site", + "fieldtype": "Link", + "width": 140 + }, + { + "label": _("Requestor"), + "options": "Employee", + "fieldname": "requestor", + "fieldtype": "Link", + "width": 140 + }, + { + "label": _("Budget Code"), + "options": "Budget", + "fieldname": "budget_code", + "fieldtype": "Link", + "width": 140 + }, + { + "label": _("Requisition Line"), + "options": "Item", + "fieldname": "requisition_line", + "fieldtype": "Link", + "width": 140 + }, + { + "label": _("Description"), + "fieldname": "description", + "fieldtype": "Data", + "width": 200 + }, + { + "label": _("Quantity"), + "fieldname": "quantity", + "fieldtype": "Int", + "width": 140 + }, + { + "label": _("Unit of Measure"), + "options": "UOM", + "fieldname": "unit_of_measurement", + "fieldtype": "Link", + "width": 140 + }, + { + "label": _("Status"), + "fieldname": "status", + "fieldtype": "data", + "width": 140 + }, + { + "label": _("Purchase Order Date"), + "fieldname": "purchase_order_date", + "fieldtype": "Date", + "width": 140 + }, + { + "label": _("Purchase Order"), + "options": "Purchase Order", + "fieldname": "purchase_order", + "fieldtype": "Link", + "width": 140 + }, + { + "label": _("Supplier"), + "options": "Supplier", + "fieldname": "supplier", + "fieldtype": "Link", + "width": 140 + }, + { + "label": _("Estimated Cost"), + "fieldname": "estimated_cost", + "fieldtype": "Float", + "width": 140 + }, + { + "label": _("Actual Cost"), + "fieldname": "actual_cost", + "fieldtype": "Float", + "width": 140 + }, + { + "label": _("Purchase Order Amount"), + "fieldname": "purchase_order_amount", + "fieldtype": "Float", + "width": 140 + }, + { + "label": _("Purchase Order Amount(USD)"), + "fieldname": "purchase_order_amount_usd", + "fieldtype": "Float", + "width": 140 + }, + { + "label": _("Expected Delivery Date"), + "fieldname": "expected_delivery_date", + "fieldtype": "Date", + "width": 140 + }, + { + "label": _("Actual Delivery Date"), + "fieldname": "actual_delivery_date", + "fieldtype": "Date", + "width": 140 + }, + ] + return columns + +def get_data(): + purchase_order_entry = frappe.db.sql(""" + SELECT + po_item.item_code, + po_item.item_name, + po_item.description, + po.name, + po.transaction_date, + po.customer, + po.territory, + sum(po_item.qty) as net_qty, + po.company + FROM `tabPurchase Order` po, `tabPurchase Order Item` po_item + WHERE + po.docstatus = 1 + and po.name = po_item.parent + and po.status not in ("Closed","Completed","Cancelled") + GROUP BY + po.name,po_item.item_code + """, as_dict = 1) + return data \ No newline at end of file From 5de08f71c5b0ca0764cb94b4d7a589c62d0eca33 Mon Sep 17 00:00:00 2001 From: Mangesh-Khairnar Date: Mon, 1 Apr 2019 21:14:05 +0530 Subject: [PATCH 04/73] feat: fetch all required fields from po --- .../procurement_tracker.py | 29 +++++++++++++++---- 1 file changed, 24 insertions(+), 5 deletions(-) diff --git a/erpnext/buying/report/procurement_tracker/procurement_tracker.py b/erpnext/buying/report/procurement_tracker/procurement_tracker.py index ee6fd2d0fb..0b6799c489 100644 --- a/erpnext/buying/report/procurement_tracker/procurement_tracker.py +++ b/erpnext/buying/report/procurement_tracker/procurement_tracker.py @@ -149,13 +149,22 @@ def get_data(): SELECT po_item.item_code, po_item.item_name, + po_item.cost_center, + po_item.project, + po_item.warehouse, + po_item.material_request, po_item.description, + po_item.stock_uom, + po_item.qty, + po_item.net_amount, + po_item.base_amount, + po_item.schedule_date, + po_item.expected_delivery_date, po.name, po.transaction_date, - po.customer, - po.territory, - sum(po_item.qty) as net_qty, - po.company + po.supplier, + po.status, + po.owner FROM `tabPurchase Order` po, `tabPurchase Order Item` po_item WHERE po.docstatus = 1 @@ -164,4 +173,14 @@ def get_data(): GROUP BY po.name,po_item.item_code """, as_dict = 1) - return data \ No newline at end of file + + mr_records = frappe._dict(frappe.db.sql(""" + SELECT + name, + transaction_date + FROM `tabMaterial Request` + WHERE + per_ordered = 100 + and docstatus = 1 + """)) + return purchase_order_entry \ No newline at end of file From 46b9204e9d4aa682e1bef345251bcf9d658fa5d7 Mon Sep 17 00:00:00 2001 From: Mangesh-Khairnar Date: Wed, 3 Apr 2019 19:45:08 +0530 Subject: [PATCH 05/73] feat: fetch data from budget records for cost estimation --- .../procurement_tracker.py | 32 +++++++++++++++++-- 1 file changed, 29 insertions(+), 3 deletions(-) diff --git a/erpnext/buying/report/procurement_tracker/procurement_tracker.py b/erpnext/buying/report/procurement_tracker/procurement_tracker.py index 0b6799c489..901f19604f 100644 --- a/erpnext/buying/report/procurement_tracker/procurement_tracker.py +++ b/erpnext/buying/report/procurement_tracker/procurement_tracker.py @@ -168,8 +168,8 @@ def get_data(): FROM `tabPurchase Order` po, `tabPurchase Order Item` po_item WHERE po.docstatus = 1 - and po.name = po_item.parent - and po.status not in ("Closed","Completed","Cancelled") + AND po.name = po_item.parent + AND po.status not in ("Closed","Completed","Cancelled") GROUP BY po.name,po_item.item_code """, as_dict = 1) @@ -181,6 +181,32 @@ def get_data(): FROM `tabMaterial Request` WHERE per_ordered = 100 - and docstatus = 1 + AND docstatus = 1 """)) + + supplier_quotation_records = frappe._dict(frappe.db.sql(""" + SELECT + name, + base_amount + FROM `tabSupplier Quotation Item` + WHERE + per_ordered = 100 + AND docstatus = 1 + """)) + + budget_records = frappe.db.sql(""" + SELECT + budget.name, + budget.project, + budget.cost_center, + budget_account.account, + budget_account.budget_amount + FROM `tabBudget` budget, `tabBudget Account` budget_account + WHERE + budget.project IS NOT NULL + AND budget.name = budget_account.parent + AND budget.cost_center IS NOT NULL + AND budget.docstatus = 1 + """, as_dict = 1) + return purchase_order_entry \ No newline at end of file From fcd0edf4153a63e217384577820ce8a7675a6328 Mon Sep 17 00:00:00 2001 From: Mangesh-Khairnar Date: Fri, 19 Apr 2019 17:22:54 +0530 Subject: [PATCH 06/73] test: compare expected data to generated data --- .../test_procurement_tracker.py | 44 +++++++++++++++++++ 1 file changed, 44 insertions(+) create mode 100644 erpnext/buying/report/procurement_tracker/test_procurement_tracker.py diff --git a/erpnext/buying/report/procurement_tracker/test_procurement_tracker.py b/erpnext/buying/report/procurement_tracker/test_procurement_tracker.py new file mode 100644 index 0000000000..1da601d4b6 --- /dev/null +++ b/erpnext/buying/report/procurement_tracker/test_procurement_tracker.py @@ -0,0 +1,44 @@ +# Copyright (c) 2013, Frappe Technologies Pvt. Ltd. and contributors +# For license information, please see license.txt + +from __future__ import unicode_literals +import unittest +from frappe.utils import nowdate, add_months +from apps.erpnext.erpnext.buying.report.procurement_tracker.procurement_tracker import execute +from erpnext.stock.doctype.material_request.test_material_request import make_material_request +from erpnext.stock.doctype.material_request.material_request import make_purchase_order +from erpnext.accounts.doctype.budget.test_budget import make_budget + +class TestProcurementTracker(unittest.TestCase): + def test_result_for_procurement_tracker(self): + mr = make_material_request() + + po = make_purchase_order(mr.name) + po.get("Items")[0].cost_center = "_Test Cost Center - _TC" + po.get("Items")[0].amount = 1000 + po.submit() + + report = execute() + expected_data = { + "material_request_date": nowdate(), + "cost_center": "_Test Cost Center - _TC", + "project": '', + "requesting_site": "_Test Warehouse - _TC", + "requestor": "Administrator", + "material_request_no": mr.name, + "description": '', + "quantity": 10, + "unit_of_measurement": "_Test UOM", + "status": "To Receive and Bill", + "purchase_order_date": nowdate(), + "purchase_order": po.name, + "supplier": '', + "estimated_cost": '', + "actual_cost": '', + "purchase_order_amt": 1000, + "purchase_order_amt_usd": 1000, + "expected_delivery_date": nowdate(), + "actual_delivery_date": '' + } + length = len(report[1]) + self.assertEqual(expected_data, report[length]) \ No newline at end of file From 438fa620b0e553d4774ace72606f0c67a2958051 Mon Sep 17 00:00:00 2001 From: Mangesh-Khairnar Date: Sun, 21 Apr 2019 23:44:21 +0530 Subject: [PATCH 07/73] feat: fetch purchase invoice and purchase receipt records for actual cost calculation --- .../procurement_tracker.py | 132 +++++++++++------- .../test_procurement_tracker.py | 3 +- 2 files changed, 82 insertions(+), 53 deletions(-) diff --git a/erpnext/buying/report/procurement_tracker/procurement_tracker.py b/erpnext/buying/report/procurement_tracker/procurement_tracker.py index 901f19604f..3bfae4d508 100644 --- a/erpnext/buying/report/procurement_tracker/procurement_tracker.py +++ b/erpnext/buying/report/procurement_tracker/procurement_tracker.py @@ -4,7 +4,6 @@ from __future__ import unicode_literals import frappe from frappe import _ -from frappe.utils import cint,cstr def execute(filters=None): columns = get_columns() @@ -14,21 +13,22 @@ def execute(filters=None): def get_columns(): columns = [ { - "label": _("Date Requisition Received in Procurement "), - "fieldname": "date_requisition_received_in_procurement", + "label": _("Material Request Date"), + "fieldname": "material_request_date", "fieldtype": "Date", "width": 140 }, { - "label": _("Date Requisition was Raised"), - "fieldname": "date_requisition_was_raised", - "fieldtype": "Date", - "width": 140 - }, - { - "label": _("Sector/Project"), + "label": _("Cost Center"), "options": "Cost Center", - "fieldname": "sector/project", + "fieldname": "cost_center", + "fieldtype": "Link", + "width": 140 + }, + { + "label": _("Project"), + "options": "Project", + "fieldname": "project", "fieldtype": "Link", "width": 140 }, @@ -47,16 +47,16 @@ def get_columns(): "width": 140 }, { - "label": _("Budget Code"), - "options": "Budget", - "fieldname": "budget_code", + "label": _("Material Request No"), + "options": "Material Request", + "fieldname": "material_request_no", "fieldtype": "Link", "width": 140 }, { - "label": _("Requisition Line"), - "options": "Item", - "fieldname": "requisition_line", + "label": _("Budget Code"), + "options": "Budget", + "fieldname": "budget_code", "fieldtype": "Link", "width": 140 }, @@ -119,13 +119,13 @@ def get_columns(): }, { "label": _("Purchase Order Amount"), - "fieldname": "purchase_order_amount", + "fieldname": "purchase_order_amt", "fieldtype": "Float", "width": 140 }, { - "label": _("Purchase Order Amount(USD)"), - "fieldname": "purchase_order_amount_usd", + "label": _("Purchase Order Amount(Company Currency)"), + "fieldname": "purchase_order_amt_usd", "fieldtype": "Float", "width": 140 }, @@ -147,20 +147,19 @@ def get_columns(): def get_data(): purchase_order_entry = frappe.db.sql(""" SELECT - po_item.item_code, - po_item.item_name, + po_item.name, + po_item.parent, po_item.cost_center, po_item.project, po_item.warehouse, po_item.material_request, + po_item.material_request_item, po_item.description, po_item.stock_uom, po_item.qty, - po_item.net_amount, + po_item.amount, po_item.base_amount, po_item.schedule_date, - po_item.expected_delivery_date, - po.name, po.transaction_date, po.supplier, po.status, @@ -172,41 +171,72 @@ def get_data(): AND po.status not in ("Closed","Completed","Cancelled") GROUP BY po.name,po_item.item_code - """, as_dict = 1) + """, as_dict=1) - mr_records = frappe._dict(frappe.db.sql(""" + mr_details = frappe.db.sql(""" SELECT - name, - transaction_date - FROM `tabMaterial Request` + mr.transaction_date, + mr_item.name, + mr_item.parent, + mr_item.amount + FROM `tabMaterial Request` mr, `tabMaterial Request Item` mr_item WHERE - per_ordered = 100 - AND docstatus = 1 - """)) + per_ordered > 0 + AND mr.name = mr_item.parent + AND mr.docstatus = 1 + """, as_dict=1) - supplier_quotation_records = frappe._dict(frappe.db.sql(""" + pi_records = frappe._dict(frappe.db.sql(""" SELECT - name, + po_detail, base_amount - FROM `tabSupplier Quotation Item` + FROM `tabPurchase Invoice Item` WHERE - per_ordered = 100 - AND docstatus = 1 + docstatus=1 + AND po_detail IS NOT NULL """)) - budget_records = frappe.db.sql(""" + pr_records = frappe._dict(frappe.db.sql(""" SELECT - budget.name, - budget.project, - budget.cost_center, - budget_account.account, - budget_account.budget_amount - FROM `tabBudget` budget, `tabBudget Account` budget_account + pr_item.purchase_order_item, + pr.posting_date + FROM `tabPurchase Receipt` pr, `tabPurchase Receipt Item` pr_item WHERE - budget.project IS NOT NULL - AND budget.name = budget_account.parent - AND budget.cost_center IS NOT NULL - AND budget.docstatus = 1 - """, as_dict = 1) + pr.docstatus=1 + AND pr.name=pr_item.parent + AND pr_item.purchase_order_item IS NOT NULL + """)) - return purchase_order_entry \ No newline at end of file + + mr_records = {} + for record in mr_details: + mr_records.setdefault(record.name, []).append(frappe._dict(record)) + + procurement_record=[] + for po in purchase_order_entry: + # fetch material records linked to the purchase order item + mr_record = mr_records.get(po.material_request_item, [{}])[0] + + procurement_detail = { + "material_request_date": mr_record.get('transaction_date', ''), + "cost_center": po.cost_center, + "project": po.project, + "requesting_site": po.warehouse, + "requestor": po.owner, + "material_request_no": po.material_request, + "description": po.description, + "quantity": po.qty, + "unit_of_measurement": po.stock_uom, + "status": po.status, + "purchase_order_date": po.transaction_date, + "purchase_order": po.parent, + "supplier": po.supplier, + "estimated_cost": mr_record.get('amount'), + "actual_cost": pi_records.get(po.name, ''), + "purchase_order_amt": po.amount, + "purchase_order_amt_in_company_currency": po.base_amount, + "expected_delivery_date": po.schedule_date, + "actual_delivery_date": pr_records.get(po.name, {}) + } + procurement_record.append(procurement_detail) + return procurement_record \ No newline at end of file diff --git a/erpnext/buying/report/procurement_tracker/test_procurement_tracker.py b/erpnext/buying/report/procurement_tracker/test_procurement_tracker.py index 1da601d4b6..7faf48deb0 100644 --- a/erpnext/buying/report/procurement_tracker/test_procurement_tracker.py +++ b/erpnext/buying/report/procurement_tracker/test_procurement_tracker.py @@ -4,10 +4,9 @@ from __future__ import unicode_literals import unittest from frappe.utils import nowdate, add_months -from apps.erpnext.erpnext.buying.report.procurement_tracker.procurement_tracker import execute +from erpnext.buying.report.procurement_tracker.procurement_tracker import execute from erpnext.stock.doctype.material_request.test_material_request import make_material_request from erpnext.stock.doctype.material_request.material_request import make_purchase_order -from erpnext.accounts.doctype.budget.test_budget import make_budget class TestProcurementTracker(unittest.TestCase): def test_result_for_procurement_tracker(self): From 869544c0bc8af7fa4e2fa92b29a175d0da9db919 Mon Sep 17 00:00:00 2001 From: Mangesh-Khairnar Date: Fri, 26 Apr 2019 01:29:36 +0530 Subject: [PATCH 08/73] fix: add mapped records as functions --- .../procurement_tracker.py | 169 ++++++++++-------- 1 file changed, 95 insertions(+), 74 deletions(-) diff --git a/erpnext/buying/report/procurement_tracker/procurement_tracker.py b/erpnext/buying/report/procurement_tracker/procurement_tracker.py index 3bfae4d508..cf3ac7d0d7 100644 --- a/erpnext/buying/report/procurement_tracker/procurement_tracker.py +++ b/erpnext/buying/report/procurement_tracker/procurement_tracker.py @@ -18,6 +18,13 @@ def get_columns(): "fieldtype": "Date", "width": 140 }, + { + "label": _("Material Request No"), + "options": "Material Request", + "fieldname": "material_request_no", + "fieldtype": "Link", + "width": 140 + }, { "label": _("Cost Center"), "options": "Cost Center", @@ -46,13 +53,6 @@ def get_columns(): "fieldtype": "Link", "width": 140 }, - { - "label": _("Material Request No"), - "options": "Material Request", - "fieldname": "material_request_no", - "fieldtype": "Link", - "width": 140 - }, { "label": _("Budget Code"), "options": "Budget", @@ -145,74 +145,14 @@ def get_columns(): return columns def get_data(): - purchase_order_entry = frappe.db.sql(""" - SELECT - po_item.name, - po_item.parent, - po_item.cost_center, - po_item.project, - po_item.warehouse, - po_item.material_request, - po_item.material_request_item, - po_item.description, - po_item.stock_uom, - po_item.qty, - po_item.amount, - po_item.base_amount, - po_item.schedule_date, - po.transaction_date, - po.supplier, - po.status, - po.owner - FROM `tabPurchase Order` po, `tabPurchase Order Item` po_item - WHERE - po.docstatus = 1 - AND po.name = po_item.parent - AND po.status not in ("Closed","Completed","Cancelled") - GROUP BY - po.name,po_item.item_code - """, as_dict=1) - - mr_details = frappe.db.sql(""" - SELECT - mr.transaction_date, - mr_item.name, - mr_item.parent, - mr_item.amount - FROM `tabMaterial Request` mr, `tabMaterial Request Item` mr_item - WHERE - per_ordered > 0 - AND mr.name = mr_item.parent - AND mr.docstatus = 1 - """, as_dict=1) - - pi_records = frappe._dict(frappe.db.sql(""" - SELECT - po_detail, - base_amount - FROM `tabPurchase Invoice Item` - WHERE - docstatus=1 - AND po_detail IS NOT NULL - """)) - - pr_records = frappe._dict(frappe.db.sql(""" - SELECT - pr_item.purchase_order_item, - pr.posting_date - FROM `tabPurchase Receipt` pr, `tabPurchase Receipt Item` pr_item - WHERE - pr.docstatus=1 - AND pr.name=pr_item.parent - AND pr_item.purchase_order_item IS NOT NULL - """)) - - - mr_records = {} - for record in mr_details: - mr_records.setdefault(record.name, []).append(frappe._dict(record)) + purchase_order_entry = get_po_entries() + mr_records, procurement_record_against_mr = get_mapped_mr_details() + pr_records = get_mapped_pr_records() + pi_records = get_mapped_pi_records() procurement_record=[] + if procurement_record_against_mr: + procurement_record += procurement_record_against_mr for po in purchase_order_entry: # fetch material records linked to the purchase order item mr_record = mr_records.get(po.material_request_item, [{}])[0] @@ -239,4 +179,85 @@ def get_data(): "actual_delivery_date": pr_records.get(po.name, {}) } procurement_record.append(procurement_detail) - return procurement_record \ No newline at end of file + return procurement_record + +def get_mapped_mr_details(): + mr_records = {} + mr_details = frappe.db.sql(""" + SELECT + mr.transaction_date, + mr.per_ordered, + mr_item.name, + mr_item.parent, + mr_item.amount + FROM `tabMaterial Request` mr, `tabMaterial Request Item` mr_item + WHERE + mr.per_ordered>=0 + AND mr.name=mr_item.parent + AND mr.docstatus=1 + """, as_dict=1) + + procurement_record_against_mr = [] + for record in mr_details: + if record.per_ordered: + mr_records.setdefault(record.name, []).append(frappe._dict(record)) + else: + procurement_record_details = dict( + material_request_date=record.transaction_date, + material_request_no=record.parent, + estimated_cost=record.amount + ) + procurement_record_against_mr.append(procurement_record_details) + return mr_records, procurement_record_against_mr + +def get_mapped_pi_records(): + return frappe._dict(frappe.db.sql(""" + SELECT + po_detail, + base_amount + FROM `tabPurchase Invoice Item` + WHERE + docstatus=1 + AND po_detail IS NOT NULL + """)) + +def get_mapped_pr_records(): + return frappe._dict(frappe.db.sql(""" + SELECT + pr_item.purchase_order_item, + pr.posting_date + FROM `tabPurchase Receipt` pr, `tabPurchase Receipt Item` pr_item + WHERE + pr.docstatus=1 + AND pr.name=pr_item.parent + AND pr_item.purchase_order_item IS NOT NULL + """)) + +def get_po_entries(): + return frappe.db.sql(""" + SELECT + po_item.name, + po_item.parent, + po_item.cost_center, + po_item.project, + po_item.warehouse, + po_item.material_request, + po_item.material_request_item, + po_item.description, + po_item.stock_uom, + po_item.qty, + po_item.amount, + po_item.base_amount, + po_item.schedule_date, + po.transaction_date, + po.supplier, + po.status, + po.owner + FROM `tabPurchase Order` po, `tabPurchase Order Item` po_item + WHERE + po.docstatus = 1 + AND po.name = po_item.parent + AND po.status not in ("Closed","Completed","Cancelled") + GROUP BY + po.name,po_item.item_code + """, as_dict=1) \ No newline at end of file From da7b1673c30217ed2d424cc2b7761f5cf16d4425 Mon Sep 17 00:00:00 2001 From: Mangesh-Khairnar Date: Fri, 26 Apr 2019 01:31:05 +0530 Subject: [PATCH 09/73] test: track pi and pr changes --- .../test_procurement_tracker.py | 25 ++++++++++++------- 1 file changed, 16 insertions(+), 9 deletions(-) diff --git a/erpnext/buying/report/procurement_tracker/test_procurement_tracker.py b/erpnext/buying/report/procurement_tracker/test_procurement_tracker.py index 7faf48deb0..32975e8910 100644 --- a/erpnext/buying/report/procurement_tracker/test_procurement_tracker.py +++ b/erpnext/buying/report/procurement_tracker/test_procurement_tracker.py @@ -7,15 +7,22 @@ from frappe.utils import nowdate, add_months from erpnext.buying.report.procurement_tracker.procurement_tracker import execute from erpnext.stock.doctype.material_request.test_material_request import make_material_request from erpnext.stock.doctype.material_request.material_request import make_purchase_order +from erpnext.buying.doctype.purchase_order.purchase_order import make_purchase_receipt, make_purchase_invoice class TestProcurementTracker(unittest.TestCase): def test_result_for_procurement_tracker(self): mr = make_material_request() - + mr.submit() po = make_purchase_order(mr.name) - po.get("Items")[0].cost_center = "_Test Cost Center - _TC" - po.get("Items")[0].amount = 1000 + po.supplier = "_Test Supplier" + po.get("items")[0].cost_center = "_Test Cost Center - _TC" + po.get("items")[0].amount = 1000 + po.get("items")[0].base_amount = 1000 po.submit() + pr = make_purchase_receipt(po.name) + pr.submit() + pi = make_purchase_invoice(po.name) + pi.submit() report = execute() expected_data = { @@ -25,19 +32,19 @@ class TestProcurementTracker(unittest.TestCase): "requesting_site": "_Test Warehouse - _TC", "requestor": "Administrator", "material_request_no": mr.name, - "description": '', + "description": '_Test Item 1', "quantity": 10, "unit_of_measurement": "_Test UOM", "status": "To Receive and Bill", "purchase_order_date": nowdate(), "purchase_order": po.name, - "supplier": '', - "estimated_cost": '', - "actual_cost": '', + "supplier": "_Test Supplier", + "estimated_cost": 0.0, + "actual_cost": 1000, "purchase_order_amt": 1000, "purchase_order_amt_usd": 1000, "expected_delivery_date": nowdate(), - "actual_delivery_date": '' + "actual_delivery_date": nowdate() } length = len(report[1]) - self.assertEqual(expected_data, report[length]) \ No newline at end of file + self.assertEqual(expected_data, report[1][length-1]) \ No newline at end of file From 9cd9671bb5952d2d6aacb1d923c9ad36ae8dd4b9 Mon Sep 17 00:00:00 2001 From: Mangesh-Khairnar Date: Fri, 26 Apr 2019 16:02:25 +0530 Subject: [PATCH 10/73] fix: minor changes --- .../procurement_tracker.py | 7 ++--- .../test_procurement_tracker.py | 31 +++++++++---------- 2 files changed, 18 insertions(+), 20 deletions(-) diff --git a/erpnext/buying/report/procurement_tracker/procurement_tracker.py b/erpnext/buying/report/procurement_tracker/procurement_tracker.py index cf3ac7d0d7..18a6660534 100644 --- a/erpnext/buying/report/procurement_tracker/procurement_tracker.py +++ b/erpnext/buying/report/procurement_tracker/procurement_tracker.py @@ -156,7 +156,6 @@ def get_data(): for po in purchase_order_entry: # fetch material records linked to the purchase order item mr_record = mr_records.get(po.material_request_item, [{}])[0] - procurement_detail = { "material_request_date": mr_record.get('transaction_date', ''), "cost_center": po.cost_center, @@ -172,11 +171,11 @@ def get_data(): "purchase_order": po.parent, "supplier": po.supplier, "estimated_cost": mr_record.get('amount'), - "actual_cost": pi_records.get(po.name, ''), + "actual_cost": pi_records.get(po.name), "purchase_order_amt": po.amount, "purchase_order_amt_in_company_currency": po.base_amount, "expected_delivery_date": po.schedule_date, - "actual_delivery_date": pr_records.get(po.name, {}) + "actual_delivery_date": pr_records.get(po.name) } procurement_record.append(procurement_detail) return procurement_record @@ -207,7 +206,7 @@ def get_mapped_mr_details(): material_request_no=record.parent, estimated_cost=record.amount ) - procurement_record_against_mr.append(procurement_record_details) + procurement_record_against_mr.append(procurement_record_details) return mr_records, procurement_record_against_mr def get_mapped_pi_records(): diff --git a/erpnext/buying/report/procurement_tracker/test_procurement_tracker.py b/erpnext/buying/report/procurement_tracker/test_procurement_tracker.py index 32975e8910..7d8e750c4b 100644 --- a/erpnext/buying/report/procurement_tracker/test_procurement_tracker.py +++ b/erpnext/buying/report/procurement_tracker/test_procurement_tracker.py @@ -3,48 +3,47 @@ from __future__ import unicode_literals import unittest -from frappe.utils import nowdate, add_months +from datetime import datetime +import frappe from erpnext.buying.report.procurement_tracker.procurement_tracker import execute from erpnext.stock.doctype.material_request.test_material_request import make_material_request from erpnext.stock.doctype.material_request.material_request import make_purchase_order from erpnext.buying.doctype.purchase_order.purchase_order import make_purchase_receipt, make_purchase_invoice class TestProcurementTracker(unittest.TestCase): + maxDiff = None def test_result_for_procurement_tracker(self): mr = make_material_request() - mr.submit() po = make_purchase_order(mr.name) po.supplier = "_Test Supplier" po.get("items")[0].cost_center = "_Test Cost Center - _TC" - po.get("items")[0].amount = 1000 - po.get("items")[0].base_amount = 1000 po.submit() pr = make_purchase_receipt(po.name) pr.submit() - pi = make_purchase_invoice(po.name) - pi.submit() + frappe.db.commit() + date_obj = datetime.date(datetime.now()) report = execute() expected_data = { - "material_request_date": nowdate(), + "material_request_date": date_obj, "cost_center": "_Test Cost Center - _TC", - "project": '', + "project": None, "requesting_site": "_Test Warehouse - _TC", "requestor": "Administrator", "material_request_no": mr.name, "description": '_Test Item 1', - "quantity": 10, + "quantity": 10.0, "unit_of_measurement": "_Test UOM", - "status": "To Receive and Bill", - "purchase_order_date": nowdate(), + "status": "To Bill", + "purchase_order_date": date_obj, "purchase_order": po.name, "supplier": "_Test Supplier", "estimated_cost": 0.0, - "actual_cost": 1000, - "purchase_order_amt": 1000, - "purchase_order_amt_usd": 1000, - "expected_delivery_date": nowdate(), - "actual_delivery_date": nowdate() + "actual_cost": None, + "purchase_order_amt": 0.0, + "purchase_order_amt_in_company_currency": 0.0, + "expected_delivery_date": date_obj, + "actual_delivery_date": date_obj } length = len(report[1]) self.assertEqual(expected_data, report[1][length-1]) \ No newline at end of file From 96661ba847fd457e972e0d5eb298793cfb324ee5 Mon Sep 17 00:00:00 2001 From: Mangesh-Khairnar Date: Sun, 28 Apr 2019 17:11:02 +0530 Subject: [PATCH 11/73] feat: add filters for multiple company operation --- .../procurement_tracker.js | 23 +++++++++++- .../procurement_tracker.py | 37 +++++++++++++------ .../test_procurement_tracker.py | 31 +++++++++++++--- .../material_request/test_material_request.py | 3 +- 4 files changed, 75 insertions(+), 19 deletions(-) diff --git a/erpnext/buying/report/procurement_tracker/procurement_tracker.js b/erpnext/buying/report/procurement_tracker/procurement_tracker.js index 7096b9f9f8..0013666ce8 100644 --- a/erpnext/buying/report/procurement_tracker/procurement_tracker.js +++ b/erpnext/buying/report/procurement_tracker/procurement_tracker.js @@ -4,6 +4,27 @@ frappe.query_reports["Procurement Tracker"] = { "filters": [ - + { + fieldname: "company", + label: __("Company"), + fieldtype: "Link", + options: "Company", + default: frappe.defaults.get_user_default("Company"), + reqd: 1 + }, + { + fieldname: "cost_center", + label: __("Cost Center"), + fieldtype: "Link", + options: "Cost Center", + reqd: 1 + }, + { + fieldname: "project", + label: __("Project"), + fieldtype: "Link", + options: "Project", + reqd: 1 + } ] } diff --git a/erpnext/buying/report/procurement_tracker/procurement_tracker.py b/erpnext/buying/report/procurement_tracker/procurement_tracker.py index 18a6660534..e3361a4c3f 100644 --- a/erpnext/buying/report/procurement_tracker/procurement_tracker.py +++ b/erpnext/buying/report/procurement_tracker/procurement_tracker.py @@ -6,11 +6,11 @@ import frappe from frappe import _ def execute(filters=None): - columns = get_columns() - data = get_data() + columns = get_columns(filters) + data = get_data(filters) return columns, data -def get_columns(): +def get_columns(filters): columns = [ { "label": _("Material Request Date"), @@ -144,9 +144,22 @@ def get_columns(): ] return columns -def get_data(): - purchase_order_entry = get_po_entries() - mr_records, procurement_record_against_mr = get_mapped_mr_details() +def get_conditions(filters): + conditions = "" + + if filters.get("company"): + conditions += " AND company='%s'"% filters.get('company') + if filters.get("cost_center") or filters.get("project"): + conditions += """ + AND (cost_center='%s' + OR project='%s') + """% (filters.get('cost_center'), filters.get('project')) + return conditions + +def get_data(filters): + conditions = get_conditions(filters) + purchase_order_entry = get_po_entries(conditions) + mr_records, procurement_record_against_mr = get_mapped_mr_details(conditions) pr_records = get_mapped_pr_records() pi_records = get_mapped_pi_records() @@ -157,7 +170,7 @@ def get_data(): # fetch material records linked to the purchase order item mr_record = mr_records.get(po.material_request_item, [{}])[0] procurement_detail = { - "material_request_date": mr_record.get('transaction_date', ''), + "material_request_date": mr_record.get('transaction_date'), "cost_center": po.cost_center, "project": po.project, "requesting_site": po.warehouse, @@ -180,7 +193,7 @@ def get_data(): procurement_record.append(procurement_detail) return procurement_record -def get_mapped_mr_details(): +def get_mapped_mr_details(conditions): mr_records = {} mr_details = frappe.db.sql(""" SELECT @@ -194,7 +207,8 @@ def get_mapped_mr_details(): mr.per_ordered>=0 AND mr.name=mr_item.parent AND mr.docstatus=1 - """, as_dict=1) + {conditions} + """.format(conditions=conditions), as_dict=1) #nosec procurement_record_against_mr = [] for record in mr_details: @@ -232,7 +246,7 @@ def get_mapped_pr_records(): AND pr_item.purchase_order_item IS NOT NULL """)) -def get_po_entries(): +def get_po_entries(conditions): return frappe.db.sql(""" SELECT po_item.name, @@ -257,6 +271,7 @@ def get_po_entries(): po.docstatus = 1 AND po.name = po_item.parent AND po.status not in ("Closed","Completed","Cancelled") + {conditions} GROUP BY po.name,po_item.item_code - """, as_dict=1) \ No newline at end of file + """.format(conditions=conditions), as_dict=1) #nosec \ No newline at end of file diff --git a/erpnext/buying/report/procurement_tracker/test_procurement_tracker.py b/erpnext/buying/report/procurement_tracker/test_procurement_tracker.py index 7d8e750c4b..418396fb92 100644 --- a/erpnext/buying/report/procurement_tracker/test_procurement_tracker.py +++ b/erpnext/buying/report/procurement_tracker/test_procurement_tracker.py @@ -8,12 +8,33 @@ import frappe from erpnext.buying.report.procurement_tracker.procurement_tracker import execute from erpnext.stock.doctype.material_request.test_material_request import make_material_request from erpnext.stock.doctype.material_request.material_request import make_purchase_order -from erpnext.buying.doctype.purchase_order.purchase_order import make_purchase_receipt, make_purchase_invoice +from erpnext.buying.doctype.purchase_order.purchase_order import make_purchase_receipt +from erpnext.stock.doctype.warehouse.test_warehouse import create_warehouse class TestProcurementTracker(unittest.TestCase): maxDiff = None def test_result_for_procurement_tracker(self): - mr = make_material_request() + filters = { + 'company': '_Test Procurement Company', + 'cost_center': '_Test Cost Center - _TC' + } + expected_data = self.generate_expected_data() + report = execute(filters) + + length = len(report[1]) + self.assertEqual(expected_data, report[1][length-1]) + + def generate_expected_data(self): + if not frappe.db.exists("Company", "_Test Procurement Company"): + frappe.get_doc(dict( + doctype="Company", + company_name="_Test Procurement Company", + abbr="_TPC", + default_currency="INR", + country="India" + )).insert() + warehouse = create_warehouse("_Test Procurement Warehouse", company="_Test Procurement Company") + mr = make_material_request(company="_Test Procurement Company", warehouse=warehouse) po = make_purchase_order(mr.name) po.supplier = "_Test Supplier" po.get("items")[0].cost_center = "_Test Cost Center - _TC" @@ -23,12 +44,11 @@ class TestProcurementTracker(unittest.TestCase): frappe.db.commit() date_obj = datetime.date(datetime.now()) - report = execute() expected_data = { "material_request_date": date_obj, "cost_center": "_Test Cost Center - _TC", "project": None, - "requesting_site": "_Test Warehouse - _TC", + "requesting_site": "_Test Procurement Warehouse - _TPC", "requestor": "Administrator", "material_request_no": mr.name, "description": '_Test Item 1', @@ -45,5 +65,4 @@ class TestProcurementTracker(unittest.TestCase): "expected_delivery_date": date_obj, "actual_delivery_date": date_obj } - length = len(report[1]) - self.assertEqual(expected_data, report[1][length-1]) \ No newline at end of file + return expected_data \ No newline at end of file diff --git a/erpnext/stock/doctype/material_request/test_material_request.py b/erpnext/stock/doctype/material_request/test_material_request.py index 7dc54d0e33..79cdc1ad18 100644 --- a/erpnext/stock/doctype/material_request/test_material_request.py +++ b/erpnext/stock/doctype/material_request/test_material_request.py @@ -629,7 +629,8 @@ def make_material_request(**args): "item_code": args.item_code or "_Test Item", "qty": args.qty or 10, "schedule_date": args.schedule_date or today(), - "warehouse": args.warehouse or "_Test Warehouse - _TC" + "warehouse": args.warehouse or "_Test Warehouse - _TC", + "cost_center": args.cost_center or "_Test Cost Center - _TC" }) mr.insert() if not args.do_not_submit: From f2fb0e03e6c808cd90d1a877cad22b06e9eb7403 Mon Sep 17 00:00:00 2001 From: deepeshgarg007 Date: Mon, 29 Apr 2019 21:42:48 +0530 Subject: [PATCH 12/73] fix: Add status for partial received --- erpnext/controllers/status_updater.py | 3 +- .../material_request/material_request.json | 1304 ++++------------- .../material_request/material_request_list.js | 4 +- 3 files changed, 309 insertions(+), 1002 deletions(-) diff --git a/erpnext/controllers/status_updater.py b/erpnext/controllers/status_updater.py index ddfd8b398c..3107c9274f 100644 --- a/erpnext/controllers/status_updater.py +++ b/erpnext/controllers/status_updater.py @@ -97,7 +97,8 @@ status_map = { ["Ordered", "eval:self.status != 'Stopped' and self.per_ordered == 100 and self.docstatus == 1 and self.material_request_type == 'Purchase'"], ["Transferred", "eval:self.status != 'Stopped' and self.per_ordered == 100 and self.docstatus == 1 and self.material_request_type == 'Material Transfer'"], ["Issued", "eval:self.status != 'Stopped' and self.per_ordered == 100 and self.docstatus == 1 and self.material_request_type == 'Material Issue'"], - ["Received", "eval:self.status != 'Stopped' and self.per_received == 100 and self.docstatus == 1 and self.material_request_type == 'Purchase'"] + ["Received", "eval:self.status != 'Stopped' and self.per_received == 100 and self.docstatus == 1 and self.material_request_type == 'Purchase'"], + ["Partially Received", "eval:self.status != 'Stopped' and self.per_received > 0 and self.per_received < 100 and self.docstatus == 1 and self.material_request_type == 'Purchase'"] ] } diff --git a/erpnext/stock/doctype/material_request/material_request.json b/erpnext/stock/doctype/material_request/material_request.json index 63628f4a5d..d0025d12ab 100644 --- a/erpnext/stock/doctype/material_request/material_request.json +++ b/erpnext/stock/doctype/material_request/material_request.json @@ -1,1046 +1,350 @@ { - "allow_copy": 0, - "allow_events_in_timeline": 0, - "allow_guest_to_view": 0, - "allow_import": 1, - "allow_rename": 0, - "autoname": "naming_series:", - "beta": 0, - "creation": "2013-03-07 14:48:38", - "custom": 0, - "docstatus": 0, - "doctype": "DocType", - "document_type": "Document", - "editable_grid": 0, + "allow_import": 1, + "autoname": "naming_series:", + "creation": "2013-03-07 14:48:38", + "doctype": "DocType", + "document_type": "Document", + "field_order": [ + "type_section", + "naming_series", + "title", + "material_request_type", + "customer", + "column_break_2", + "schedule_date", + "company", + "amended_from", + "items_section", + "scan_barcode", + "items", + "more_info", + "requested_by", + "transaction_date", + "column_break2", + "status", + "per_ordered", + "per_received", + "printing_details", + "letter_head", + "select_print_heading", + "terms_section_break", + "tc_name", + "terms", + "reference", + "job_card" + ], "fields": [ { - "allow_bulk_edit": 0, - "allow_in_quick_entry": 0, - "allow_on_submit": 0, - "bold": 0, - "collapsible": 0, - "columns": 0, - "fetch_if_empty": 0, - "fieldname": "type_section", - "fieldtype": "Section Break", - "hidden": 0, - "ignore_user_permissions": 0, - "ignore_xss_filter": 0, - "in_filter": 0, - "in_global_search": 0, - "in_list_view": 0, - "in_standard_filter": 0, - "label": "", - "length": 0, - "no_copy": 0, - "options": "fa fa-pushpin", - "permlevel": 0, - "print_hide": 0, - "print_hide_if_no_value": 0, - "read_only": 0, - "remember_last_selected_value": 0, - "report_hide": 0, - "reqd": 0, - "search_index": 0, - "set_only_once": 0, - "translatable": 0, - "unique": 0 - }, + "fieldname": "type_section", + "fieldtype": "Section Break", + "options": "fa fa-pushpin" + }, { - "allow_bulk_edit": 0, - "allow_in_quick_entry": 0, - "allow_on_submit": 0, - "bold": 0, - "collapsible": 0, - "columns": 0, - "default": "", - "fetch_if_empty": 0, - "fieldname": "naming_series", - "fieldtype": "Select", - "hidden": 0, - "ignore_user_permissions": 0, - "ignore_xss_filter": 0, - "in_filter": 0, - "in_global_search": 0, - "in_list_view": 0, - "in_standard_filter": 0, - "label": "Series", - "length": 0, - "no_copy": 1, - "oldfieldname": "naming_series", - "oldfieldtype": "Select", - "options": "MAT-MR-.YYYY.-", - "permlevel": 0, - "print_hide": 1, - "print_hide_if_no_value": 0, - "read_only": 0, - "remember_last_selected_value": 0, - "report_hide": 0, - "reqd": 1, - "search_index": 0, - "set_only_once": 1, - "translatable": 0, - "unique": 0 - }, + "fieldname": "naming_series", + "fieldtype": "Select", + "label": "Series", + "no_copy": 1, + "oldfieldname": "naming_series", + "oldfieldtype": "Select", + "options": "MAT-MR-.YYYY.-", + "print_hide": 1, + "reqd": 1, + "set_only_once": 1 + }, { - "allow_bulk_edit": 0, - "allow_in_quick_entry": 0, - "allow_on_submit": 1, - "bold": 0, - "collapsible": 0, - "columns": 0, - "default": "{material_request_type}", - "fetch_if_empty": 0, - "fieldname": "title", - "fieldtype": "Data", - "hidden": 1, - "ignore_user_permissions": 0, - "ignore_xss_filter": 0, - "in_filter": 0, - "in_global_search": 0, - "in_list_view": 0, - "in_standard_filter": 0, - "label": "Title", - "length": 0, - "no_copy": 1, - "permlevel": 0, - "precision": "", - "print_hide": 1, - "print_hide_if_no_value": 0, - "read_only": 0, - "remember_last_selected_value": 0, - "report_hide": 0, - "reqd": 0, - "search_index": 0, - "set_only_once": 0, - "translatable": 0, - "unique": 0 - }, + "allow_on_submit": 1, + "default": "{material_request_type}", + "fieldname": "title", + "fieldtype": "Data", + "hidden": 1, + "label": "Title", + "no_copy": 1, + "print_hide": 1 + }, { - "allow_bulk_edit": 0, - "allow_in_quick_entry": 0, - "allow_on_submit": 0, - "bold": 0, - "collapsible": 0, - "columns": 0, - "fetch_if_empty": 0, - "fieldname": "material_request_type", - "fieldtype": "Select", - "hidden": 0, - "ignore_user_permissions": 0, - "ignore_xss_filter": 0, - "in_filter": 0, - "in_global_search": 0, - "in_list_view": 1, - "in_standard_filter": 1, - "label": "Type", - "length": 0, - "no_copy": 0, - "options": "Purchase\nMaterial Transfer\nMaterial Issue\nManufacture\nCustomer Provided", - "permlevel": 0, - "print_hide": 0, - "print_hide_if_no_value": 0, - "read_only": 0, - "remember_last_selected_value": 0, - "report_hide": 0, - "reqd": 1, - "search_index": 0, - "set_only_once": 0, - "translatable": 0, - "unique": 0 - }, + "fieldname": "material_request_type", + "fieldtype": "Select", + "in_list_view": 1, + "in_standard_filter": 1, + "label": "Type", + "options": "Purchase\nMaterial Transfer\nMaterial Issue\nManufacture\nCustomer Provided", + "reqd": 1 + }, { - "allow_bulk_edit": 0, - "allow_in_quick_entry": 0, - "allow_on_submit": 0, - "bold": 0, - "collapsible": 0, - "columns": 0, - "depends_on": "eval:doc.material_request_type==\"Customer Provided\"", - "fetch_if_empty": 0, - "fieldname": "customer", - "fieldtype": "Link", - "hidden": 0, - "ignore_user_permissions": 0, - "ignore_xss_filter": 0, - "in_filter": 0, - "in_global_search": 0, - "in_list_view": 0, - "in_standard_filter": 0, - "label": "Customer", - "length": 0, - "no_copy": 0, - "options": "Customer", - "permlevel": 0, - "precision": "", - "print_hide": 0, - "print_hide_if_no_value": 0, - "read_only": 0, - "remember_last_selected_value": 0, - "report_hide": 0, - "reqd": 0, - "search_index": 0, - "set_only_once": 0, - "translatable": 0, - "unique": 0 - }, + "depends_on": "eval:doc.material_request_type==\"Customer Provided\"", + "fieldname": "customer", + "fieldtype": "Link", + "label": "Customer", + "options": "Customer" + }, { - "allow_bulk_edit": 0, - "allow_in_quick_entry": 0, - "allow_on_submit": 0, - "bold": 0, - "collapsible": 0, - "columns": 0, - "fetch_if_empty": 0, - "fieldname": "column_break_2", - "fieldtype": "Column Break", - "hidden": 0, - "ignore_user_permissions": 0, - "ignore_xss_filter": 0, - "in_filter": 0, - "in_global_search": 0, - "in_list_view": 0, - "in_standard_filter": 0, - "length": 0, - "no_copy": 0, - "permlevel": 0, - "print_hide": 0, - "print_hide_if_no_value": 0, - "read_only": 0, - "remember_last_selected_value": 0, - "report_hide": 0, - "reqd": 0, - "search_index": 0, - "set_only_once": 0, - "translatable": 0, - "unique": 0 - }, + "fieldname": "column_break_2", + "fieldtype": "Column Break" + }, { - "allow_bulk_edit": 0, - "allow_in_quick_entry": 0, - "allow_on_submit": 1, - "bold": 0, - "collapsible": 0, - "columns": 0, - "fetch_if_empty": 0, - "fieldname": "schedule_date", - "fieldtype": "Date", - "hidden": 0, - "ignore_user_permissions": 0, - "ignore_xss_filter": 0, - "in_filter": 0, - "in_global_search": 0, - "in_list_view": 0, - "in_standard_filter": 0, - "label": "Required Date", - "length": 0, - "no_copy": 0, - "permlevel": 0, - "precision": "", - "print_hide": 0, - "print_hide_if_no_value": 0, - "read_only": 0, - "remember_last_selected_value": 0, - "report_hide": 0, - "reqd": 0, - "search_index": 0, - "set_only_once": 0, - "translatable": 0, - "unique": 0 - }, + "allow_on_submit": 1, + "fieldname": "schedule_date", + "fieldtype": "Date", + "label": "Required Date" + }, { - "allow_bulk_edit": 0, - "allow_in_quick_entry": 0, - "allow_on_submit": 0, - "bold": 0, - "collapsible": 0, - "columns": 0, - "description": "", - "fetch_if_empty": 0, - "fieldname": "company", - "fieldtype": "Link", - "hidden": 0, - "ignore_user_permissions": 0, - "ignore_xss_filter": 0, - "in_filter": 0, - "in_global_search": 0, - "in_list_view": 1, - "in_standard_filter": 1, - "label": "Company", - "length": 0, - "no_copy": 0, - "oldfieldname": "company", - "oldfieldtype": "Link", - "options": "Company", - "permlevel": 0, - "print_hide": 1, - "print_hide_if_no_value": 0, - "print_width": "150px", - "read_only": 0, - "remember_last_selected_value": 1, - "report_hide": 0, - "reqd": 1, - "search_index": 1, - "set_only_once": 0, - "translatable": 0, - "unique": 0, + "fieldname": "company", + "fieldtype": "Link", + "in_list_view": 1, + "in_standard_filter": 1, + "label": "Company", + "oldfieldname": "company", + "oldfieldtype": "Link", + "options": "Company", + "print_hide": 1, + "print_width": "150px", + "remember_last_selected_value": 1, + "reqd": 1, + "search_index": 1, "width": "150px" - }, + }, { - "allow_bulk_edit": 0, - "allow_in_quick_entry": 0, - "allow_on_submit": 0, - "bold": 0, - "collapsible": 0, - "columns": 0, - "fetch_if_empty": 0, - "fieldname": "amended_from", - "fieldtype": "Link", - "hidden": 0, - "ignore_user_permissions": 1, - "ignore_xss_filter": 0, - "in_filter": 0, - "in_global_search": 0, - "in_list_view": 0, - "in_standard_filter": 0, - "label": "Amended From", - "length": 0, - "no_copy": 1, - "oldfieldname": "amended_from", - "oldfieldtype": "Data", - "options": "Material Request", - "permlevel": 0, - "print_hide": 1, - "print_hide_if_no_value": 0, - "print_width": "150px", - "read_only": 1, - "remember_last_selected_value": 0, - "report_hide": 0, - "reqd": 0, - "search_index": 0, - "set_only_once": 0, - "translatable": 0, - "unique": 0, + "fieldname": "amended_from", + "fieldtype": "Link", + "ignore_user_permissions": 1, + "label": "Amended From", + "no_copy": 1, + "oldfieldname": "amended_from", + "oldfieldtype": "Data", + "options": "Material Request", + "print_hide": 1, + "print_width": "150px", + "read_only": 1, "width": "150px" - }, + }, { - "allow_bulk_edit": 0, - "allow_in_quick_entry": 0, - "allow_on_submit": 0, - "bold": 0, - "collapsible": 0, - "columns": 0, - "fetch_if_empty": 0, - "fieldname": "items_section", - "fieldtype": "Section Break", - "hidden": 0, - "ignore_user_permissions": 0, - "ignore_xss_filter": 0, - "in_filter": 0, - "in_global_search": 0, - "in_list_view": 0, - "in_standard_filter": 0, - "label": "", - "length": 0, - "no_copy": 0, - "oldfieldtype": "Section Break", - "options": "fa fa-shopping-cart", - "permlevel": 0, - "print_hide": 0, - "print_hide_if_no_value": 0, - "read_only": 0, - "remember_last_selected_value": 0, - "report_hide": 0, - "reqd": 0, - "search_index": 0, - "set_only_once": 0, - "translatable": 0, - "unique": 0 - }, + "fieldname": "items_section", + "fieldtype": "Section Break", + "oldfieldtype": "Section Break", + "options": "fa fa-shopping-cart" + }, { - "allow_bulk_edit": 0, - "allow_in_quick_entry": 0, - "allow_on_submit": 0, - "bold": 0, - "collapsible": 0, - "columns": 0, - "fetch_if_empty": 0, - "fieldname": "scan_barcode", - "fieldtype": "Data", - "hidden": 0, - "ignore_user_permissions": 0, - "ignore_xss_filter": 0, - "in_filter": 0, - "in_global_search": 0, - "in_list_view": 0, - "in_standard_filter": 0, - "label": "Scan Barcode", - "length": 0, - "no_copy": 0, - "permlevel": 0, - "precision": "", - "print_hide": 0, - "print_hide_if_no_value": 0, - "read_only": 0, - "remember_last_selected_value": 0, - "report_hide": 0, - "reqd": 0, - "search_index": 0, - "set_only_once": 0, - "translatable": 0, - "unique": 0 - }, + "fieldname": "scan_barcode", + "fieldtype": "Data", + "label": "Scan Barcode" + }, { - "allow_bulk_edit": 1, - "allow_in_quick_entry": 0, - "allow_on_submit": 0, - "bold": 0, - "collapsible": 0, - "columns": 0, - "fetch_if_empty": 0, - "fieldname": "items", - "fieldtype": "Table", - "hidden": 0, - "ignore_user_permissions": 0, - "ignore_xss_filter": 0, - "in_filter": 0, - "in_global_search": 0, - "in_list_view": 0, - "in_standard_filter": 0, - "label": "Items", - "length": 0, - "no_copy": 0, - "oldfieldname": "indent_details", - "oldfieldtype": "Table", - "options": "Material Request Item", - "permlevel": 0, - "print_hide": 0, - "print_hide_if_no_value": 0, - "read_only": 0, - "remember_last_selected_value": 0, - "report_hide": 0, - "reqd": 1, - "search_index": 0, - "set_only_once": 0, - "translatable": 0, - "unique": 0 - }, + "allow_bulk_edit": 1, + "fieldname": "items", + "fieldtype": "Table", + "label": "Items", + "oldfieldname": "indent_details", + "oldfieldtype": "Table", + "options": "Material Request Item", + "reqd": 1 + }, { - "allow_bulk_edit": 0, - "allow_in_quick_entry": 0, - "allow_on_submit": 0, - "bold": 0, - "collapsible": 1, - "columns": 0, - "fetch_if_empty": 0, - "fieldname": "more_info", - "fieldtype": "Section Break", - "hidden": 0, - "ignore_user_permissions": 0, - "ignore_xss_filter": 0, - "in_filter": 0, - "in_global_search": 0, - "in_list_view": 0, - "in_standard_filter": 0, - "label": "More Information", - "length": 0, - "no_copy": 0, - "oldfieldtype": "Section Break", - "options": "fa fa-file-text", - "permlevel": 0, - "print_hide": 0, - "print_hide_if_no_value": 0, - "read_only": 0, - "remember_last_selected_value": 0, - "report_hide": 0, - "reqd": 0, - "search_index": 0, - "set_only_once": 0, - "translatable": 0, - "unique": 0 - }, + "collapsible": 1, + "fieldname": "more_info", + "fieldtype": "Section Break", + "label": "More Information", + "oldfieldtype": "Section Break", + "options": "fa fa-file-text" + }, { - "allow_bulk_edit": 0, - "allow_in_quick_entry": 0, - "allow_on_submit": 0, - "bold": 0, - "collapsible": 0, - "columns": 0, - "fetch_if_empty": 0, - "fieldname": "requested_by", - "fieldtype": "Data", - "hidden": 0, - "ignore_user_permissions": 0, - "ignore_xss_filter": 0, - "in_filter": 0, - "in_global_search": 0, - "in_list_view": 0, - "in_standard_filter": 1, - "label": "Requested For", - "length": 0, - "no_copy": 0, - "permlevel": 0, - "print_hide": 0, - "print_hide_if_no_value": 0, - "read_only": 0, - "remember_last_selected_value": 0, - "report_hide": 0, - "reqd": 0, - "search_index": 0, - "set_only_once": 0, - "translatable": 0, - "unique": 0 - }, + "fieldname": "requested_by", + "fieldtype": "Data", + "in_standard_filter": 1, + "label": "Requested For", + "options": "Email" + }, { - "allow_bulk_edit": 0, - "allow_in_quick_entry": 0, - "allow_on_submit": 0, - "bold": 0, - "collapsible": 0, - "columns": 0, - "default": "Today", - "fetch_if_empty": 0, - "fieldname": "transaction_date", - "fieldtype": "Date", - "hidden": 0, - "ignore_user_permissions": 0, - "ignore_xss_filter": 0, - "in_filter": 0, - "in_global_search": 0, - "in_list_view": 1, - "in_standard_filter": 0, - "label": "Transaction Date", - "length": 0, - "no_copy": 1, - "oldfieldname": "transaction_date", - "oldfieldtype": "Date", - "permlevel": 0, - "print_hide": 0, - "print_hide_if_no_value": 0, - "print_width": "100px", - "read_only": 0, - "remember_last_selected_value": 0, - "report_hide": 0, - "reqd": 1, - "search_index": 1, - "set_only_once": 0, - "translatable": 0, - "unique": 0, + "default": "Today", + "fieldname": "transaction_date", + "fieldtype": "Date", + "in_list_view": 1, + "label": "Transaction Date", + "no_copy": 1, + "oldfieldname": "transaction_date", + "oldfieldtype": "Date", + "print_width": "100px", + "reqd": 1, + "search_index": 1, "width": "100px" - }, + }, { - "allow_bulk_edit": 0, - "allow_in_quick_entry": 0, - "allow_on_submit": 0, - "bold": 0, - "collapsible": 0, - "columns": 0, - "fetch_if_empty": 0, - "fieldname": "column_break2", - "fieldtype": "Column Break", - "hidden": 0, - "ignore_user_permissions": 0, - "ignore_xss_filter": 0, - "in_filter": 0, - "in_global_search": 0, - "in_list_view": 0, - "in_standard_filter": 0, - "length": 0, - "no_copy": 0, - "oldfieldtype": "Column Break", - "permlevel": 0, - "print_hide": 0, - "print_hide_if_no_value": 0, - "print_width": "50%", - "read_only": 0, - "remember_last_selected_value": 0, - "report_hide": 0, - "reqd": 0, - "search_index": 0, - "set_only_once": 0, - "translatable": 0, - "unique": 0, + "fieldname": "column_break2", + "fieldtype": "Column Break", + "oldfieldtype": "Column Break", + "print_width": "50%", "width": "50%" - }, + }, { - "allow_bulk_edit": 0, - "allow_in_quick_entry": 0, - "allow_on_submit": 0, - "bold": 0, - "collapsible": 0, - "columns": 0, - "fetch_if_empty": 0, - "fieldname": "status", - "fieldtype": "Select", - "hidden": 0, - "ignore_user_permissions": 0, - "ignore_xss_filter": 0, - "in_filter": 0, - "in_global_search": 0, - "in_list_view": 0, - "in_standard_filter": 1, - "label": "Status", - "length": 0, - "no_copy": 1, - "oldfieldname": "status", - "oldfieldtype": "Select", - "options": "\nDraft\nSubmitted\nStopped\nCancelled\nPending\nPartially Ordered\nOrdered\nIssued\nTransferred\nReceived", - "permlevel": 0, - "print_hide": 1, - "print_hide_if_no_value": 0, - "print_width": "100px", - "read_only": 1, - "remember_last_selected_value": 0, - "report_hide": 0, - "reqd": 0, - "search_index": 1, - "set_only_once": 0, - "translatable": 0, - "unique": 0, + "fieldname": "status", + "fieldtype": "Select", + "in_standard_filter": 1, + "label": "Status", + "no_copy": 1, + "oldfieldname": "status", + "oldfieldtype": "Select", + "options": "\nDraft\nSubmitted\nStopped\nCancelled\nPending\nPartially Ordered\nOrdered\nIssued\nTransferred\nReceived", + "print_hide": 1, + "print_width": "100px", + "read_only": 1, + "search_index": 1, "width": "100px" - }, + }, { - "allow_bulk_edit": 0, - "allow_in_quick_entry": 0, - "allow_on_submit": 0, - "bold": 0, - "collapsible": 0, - "columns": 0, - "description": "", - "fetch_if_empty": 0, - "fieldname": "per_ordered", - "fieldtype": "Percent", - "hidden": 0, - "ignore_user_permissions": 0, - "ignore_xss_filter": 0, - "in_filter": 0, - "in_global_search": 0, - "in_list_view": 0, - "in_standard_filter": 0, - "label": "% Ordered", - "length": 0, - "no_copy": 1, - "oldfieldname": "per_ordered", - "oldfieldtype": "Currency", - "permlevel": 0, - "print_hide": 1, - "print_hide_if_no_value": 0, - "read_only": 1, - "remember_last_selected_value": 0, - "report_hide": 0, - "reqd": 0, - "search_index": 0, - "set_only_once": 0, - "translatable": 0, - "unique": 0 - }, + "fieldname": "per_ordered", + "fieldtype": "Percent", + "label": "% Ordered", + "no_copy": 1, + "oldfieldname": "per_ordered", + "oldfieldtype": "Currency", + "print_hide": 1, + "read_only": 1 + }, { - "allow_bulk_edit": 0, - "allow_in_quick_entry": 0, - "allow_on_submit": 0, - "bold": 0, - "collapsible": 0, - "columns": 0, - "fetch_if_empty": 0, - "fieldname": "per_received", - "fieldtype": "Percent", - "hidden": 0, - "ignore_user_permissions": 0, - "ignore_xss_filter": 0, - "in_filter": 0, - "in_global_search": 0, - "in_list_view": 0, - "in_standard_filter": 0, - "label": "% Received", - "length": 0, - "no_copy": 1, - "permlevel": 0, - "precision": "", - "print_hide": 1, - "print_hide_if_no_value": 0, - "read_only": 1, - "remember_last_selected_value": 0, - "report_hide": 0, - "reqd": 0, - "search_index": 0, - "set_only_once": 0, - "translatable": 0, - "unique": 0 - }, + "fieldname": "per_received", + "fieldtype": "Percent", + "label": "% Received", + "no_copy": 1, + "print_hide": 1, + "read_only": 1 + }, { - "allow_bulk_edit": 0, - "allow_in_quick_entry": 0, - "allow_on_submit": 0, - "bold": 0, - "collapsible": 1, - "columns": 0, - "fetch_if_empty": 0, - "fieldname": "printing_details", - "fieldtype": "Section Break", - "hidden": 0, - "ignore_user_permissions": 0, - "ignore_xss_filter": 0, - "in_filter": 0, - "in_global_search": 0, - "in_list_view": 0, - "in_standard_filter": 0, - "label": "Printing Details", - "length": 0, - "no_copy": 0, - "permlevel": 0, - "precision": "", - "print_hide": 0, - "print_hide_if_no_value": 0, - "read_only": 0, - "remember_last_selected_value": 0, - "report_hide": 0, - "reqd": 0, - "search_index": 0, - "set_only_once": 0, - "translatable": 0, - "unique": 0 - }, + "collapsible": 1, + "fieldname": "printing_details", + "fieldtype": "Section Break", + "label": "Printing Details" + }, { - "allow_bulk_edit": 0, - "allow_in_quick_entry": 0, - "allow_on_submit": 1, - "bold": 0, - "collapsible": 0, - "columns": 0, - "fetch_if_empty": 0, - "fieldname": "letter_head", - "fieldtype": "Link", - "hidden": 0, - "ignore_user_permissions": 0, - "ignore_xss_filter": 0, - "in_filter": 0, - "in_global_search": 0, - "in_list_view": 0, - "in_standard_filter": 0, - "label": "Letter Head", - "length": 0, - "no_copy": 0, - "oldfieldname": "letter_head", - "oldfieldtype": "Select", - "options": "Letter Head", - "permlevel": 0, - "print_hide": 1, - "print_hide_if_no_value": 0, - "read_only": 0, - "remember_last_selected_value": 0, - "report_hide": 0, - "reqd": 0, - "search_index": 0, - "set_only_once": 0, - "translatable": 0, - "unique": 0 - }, + "allow_on_submit": 1, + "fieldname": "letter_head", + "fieldtype": "Link", + "label": "Letter Head", + "oldfieldname": "letter_head", + "oldfieldtype": "Select", + "options": "Letter Head", + "print_hide": 1 + }, { - "allow_bulk_edit": 0, - "allow_in_quick_entry": 0, - "allow_on_submit": 1, - "bold": 0, - "collapsible": 0, - "columns": 0, - "fetch_if_empty": 0, - "fieldname": "select_print_heading", - "fieldtype": "Link", - "hidden": 0, - "ignore_user_permissions": 0, - "ignore_xss_filter": 0, - "in_filter": 0, - "in_global_search": 0, - "in_list_view": 0, - "in_standard_filter": 0, - "label": "Print Heading", - "length": 0, - "no_copy": 0, - "options": "Print Heading", - "permlevel": 0, - "print_hide": 1, - "print_hide_if_no_value": 0, - "read_only": 0, - "remember_last_selected_value": 0, - "report_hide": 0, - "reqd": 0, - "search_index": 0, - "set_only_once": 0, - "translatable": 0, - "unique": 0 - }, + "allow_on_submit": 1, + "fieldname": "select_print_heading", + "fieldtype": "Link", + "label": "Print Heading", + "options": "Print Heading", + "print_hide": 1 + }, { - "allow_bulk_edit": 0, - "allow_in_quick_entry": 0, - "allow_on_submit": 0, - "bold": 0, - "collapsible": 1, - "collapsible_depends_on": "terms", - "columns": 0, - "fetch_if_empty": 0, - "fieldname": "terms_section_break", - "fieldtype": "Section Break", - "hidden": 0, - "ignore_user_permissions": 0, - "ignore_xss_filter": 0, - "in_filter": 0, - "in_global_search": 0, - "in_list_view": 0, - "in_standard_filter": 0, - "label": "Terms and Conditions", - "length": 0, - "no_copy": 0, - "oldfieldtype": "Section Break", - "options": "fa fa-legal", - "permlevel": 0, - "print_hide": 0, - "print_hide_if_no_value": 0, - "read_only": 0, - "remember_last_selected_value": 0, - "report_hide": 0, - "reqd": 0, - "search_index": 0, - "set_only_once": 0, - "translatable": 0, - "unique": 0 - }, + "collapsible": 1, + "collapsible_depends_on": "terms", + "fieldname": "terms_section_break", + "fieldtype": "Section Break", + "label": "Terms and Conditions", + "oldfieldtype": "Section Break", + "options": "fa fa-legal" + }, { - "allow_bulk_edit": 0, - "allow_in_quick_entry": 0, - "allow_on_submit": 0, - "bold": 0, - "collapsible": 0, - "columns": 0, - "fetch_if_empty": 0, - "fieldname": "tc_name", - "fieldtype": "Link", - "hidden": 0, - "ignore_user_permissions": 0, - "ignore_xss_filter": 0, - "in_filter": 0, - "in_global_search": 0, - "in_list_view": 0, - "in_standard_filter": 0, - "label": "Terms", - "length": 0, - "no_copy": 0, - "oldfieldname": "tc_name", - "oldfieldtype": "Link", - "options": "Terms and Conditions", - "permlevel": 0, - "print_hide": 1, - "print_hide_if_no_value": 0, - "read_only": 0, - "remember_last_selected_value": 0, - "report_hide": 1, - "reqd": 0, - "search_index": 0, - "set_only_once": 0, - "translatable": 0, - "unique": 0 - }, + "fieldname": "tc_name", + "fieldtype": "Link", + "label": "Terms", + "oldfieldname": "tc_name", + "oldfieldtype": "Link", + "options": "Terms and Conditions", + "print_hide": 1, + "report_hide": 1 + }, { - "allow_bulk_edit": 0, - "allow_in_quick_entry": 0, - "allow_on_submit": 0, - "bold": 0, - "collapsible": 0, - "columns": 0, - "fetch_if_empty": 0, - "fieldname": "terms", - "fieldtype": "Text Editor", - "hidden": 0, - "ignore_user_permissions": 0, - "ignore_xss_filter": 0, - "in_filter": 0, - "in_global_search": 0, - "in_list_view": 0, - "in_standard_filter": 0, - "label": "Terms and Conditions Content", - "length": 0, - "no_copy": 0, - "oldfieldname": "terms", - "oldfieldtype": "Text Editor", - "permlevel": 0, - "print_hide": 0, - "print_hide_if_no_value": 0, - "read_only": 0, - "remember_last_selected_value": 0, - "report_hide": 0, - "reqd": 0, - "search_index": 0, - "set_only_once": 0, - "translatable": 0, - "unique": 0 - }, + "fieldname": "terms", + "fieldtype": "Text Editor", + "label": "Terms and Conditions Content", + "oldfieldname": "terms", + "oldfieldtype": "Text Editor" + }, { - "allow_bulk_edit": 0, - "allow_in_quick_entry": 0, - "allow_on_submit": 0, - "bold": 0, - "collapsible": 1, - "columns": 0, - "fetch_if_empty": 0, - "fieldname": "reference", - "fieldtype": "Section Break", - "hidden": 0, - "ignore_user_permissions": 0, - "ignore_xss_filter": 0, - "in_filter": 0, - "in_global_search": 0, - "in_list_view": 0, - "in_standard_filter": 0, - "label": "Reference", - "length": 0, - "no_copy": 0, - "permlevel": 0, - "precision": "", - "print_hide": 0, - "print_hide_if_no_value": 0, - "read_only": 0, - "remember_last_selected_value": 0, - "report_hide": 0, - "reqd": 0, - "search_index": 0, - "set_only_once": 0, - "translatable": 0, - "unique": 0 - }, + "collapsible": 1, + "fieldname": "reference", + "fieldtype": "Section Break", + "label": "Reference" + }, { - "allow_bulk_edit": 0, - "allow_in_quick_entry": 0, - "allow_on_submit": 0, - "bold": 0, - "collapsible": 0, - "columns": 0, - "fetch_if_empty": 0, - "fieldname": "job_card", - "fieldtype": "Link", - "hidden": 0, - "ignore_user_permissions": 0, - "ignore_xss_filter": 0, - "in_filter": 0, - "in_global_search": 0, - "in_list_view": 0, - "in_standard_filter": 0, - "label": "Job Card", - "length": 0, - "no_copy": 0, - "options": "Job Card", - "permlevel": 0, - "precision": "", - "print_hide": 1, - "print_hide_if_no_value": 0, - "read_only": 1, - "remember_last_selected_value": 0, - "report_hide": 0, - "reqd": 0, - "search_index": 0, - "set_only_once": 0, - "translatable": 0, - "unique": 0 + "fieldname": "job_card", + "fieldtype": "Link", + "label": "Job Card", + "options": "Job Card", + "print_hide": 1, + "read_only": 1 } - ], - "has_web_view": 0, - "hide_toolbar": 0, - "icon": "fa fa-ticket", - "idx": 70, - "in_create": 0, - "is_submittable": 1, - "issingle": 0, - "istable": 0, - "max_attachments": 0, - "menu_index": 0, - "modified": "2019-04-22 11:36:36.493445", - "modified_by": "Administrator", - "module": "Stock", - "name": "Material Request", - "owner": "Administrator", + ], + "icon": "fa fa-ticket", + "idx": 70, + "is_submittable": 1, + "modified": "2019-04-29 11:45:07.570292", + "modified_by": "Administrator", + "module": "Stock", + "name": "Material Request", + "owner": "Administrator", "permissions": [ { - "amend": 1, - "cancel": 1, - "create": 1, - "delete": 1, - "email": 1, - "export": 1, - "if_owner": 0, - "import": 1, - "permlevel": 0, - "print": 1, - "read": 1, - "report": 1, - "role": "Purchase Manager", - "set_user_permissions": 1, - "share": 1, - "submit": 1, + "amend": 1, + "cancel": 1, + "create": 1, + "delete": 1, + "email": 1, + "export": 1, + "import": 1, + "print": 1, + "read": 1, + "report": 1, + "role": "Purchase Manager", + "set_user_permissions": 1, + "share": 1, + "submit": 1, "write": 1 - }, + }, { - "amend": 1, - "cancel": 1, - "create": 1, - "delete": 1, - "email": 1, - "export": 0, - "if_owner": 0, - "import": 0, - "permlevel": 0, - "print": 1, - "read": 1, - "report": 1, - "role": "Stock Manager", - "set_user_permissions": 0, - "share": 1, - "submit": 1, + "amend": 1, + "cancel": 1, + "create": 1, + "delete": 1, + "email": 1, + "print": 1, + "read": 1, + "report": 1, + "role": "Stock Manager", + "share": 1, + "submit": 1, "write": 1 - }, + }, { - "amend": 1, - "cancel": 1, - "create": 1, - "delete": 1, - "email": 1, - "export": 0, - "if_owner": 0, - "import": 0, - "permlevel": 0, - "print": 1, - "read": 1, - "report": 1, - "role": "Stock User", - "set_user_permissions": 0, - "share": 1, - "submit": 1, + "amend": 1, + "cancel": 1, + "create": 1, + "delete": 1, + "email": 1, + "print": 1, + "read": 1, + "report": 1, + "role": "Stock User", + "share": 1, + "submit": 1, "write": 1 - }, + }, { - "amend": 1, - "cancel": 1, - "create": 1, - "delete": 1, - "email": 1, - "export": 0, - "if_owner": 0, - "import": 0, - "permlevel": 0, - "print": 1, - "read": 1, - "report": 1, - "role": "Purchase User", - "set_user_permissions": 0, - "share": 1, - "submit": 1, + "amend": 1, + "cancel": 1, + "create": 1, + "delete": 1, + "email": 1, + "print": 1, + "read": 1, + "report": 1, + "role": "Purchase User", + "share": 1, + "submit": 1, "write": 1 } - ], - "quick_entry": 1, - "read_only": 0, - "search_fields": "status,transaction_date", - "show_name_in_global_search": 1, - "sort_field": "modified", - "sort_order": "DESC", - "title_field": "title", - "track_changes": 0, - "track_seen": 0, - "track_views": 0 + ], + "quick_entry": 1, + "search_fields": "status,transaction_date", + "show_name_in_global_search": 1, + "sort_field": "modified", + "sort_order": "DESC", + "title_field": "title" } \ No newline at end of file diff --git a/erpnext/stock/doctype/material_request/material_request_list.js b/erpnext/stock/doctype/material_request/material_request_list.js index a915a1a63b..1cf971ff44 100644 --- a/erpnext/stock/doctype/material_request/material_request_list.js +++ b/erpnext/stock/doctype/material_request/material_request_list.js @@ -8,7 +8,9 @@ frappe.listview_settings['Material Request'] = { } else if(doc.docstatus==1 && flt(doc.per_ordered, 2) < 100) { return [__("Partially ordered"), "yellow", "per_ordered,<,100"]; } else if(doc.docstatus==1 && flt(doc.per_ordered, 2) == 100) { - if (doc.material_request_type == "Purchase" && flt(doc.per_received, 2) == 100){ + if (doc.material_request_type == "Purchase" && flt(doc.per_received, 2) < 100 && flt(doc.per_received, 2) > 0) { + return [__("Partially Received"), "yellow", "per_received,<,100"]; + } else if (doc.material_request_type == "Purchase" && flt(doc.per_received, 2) == 100) { return [__("Received"), "green", "per_received,=,100"]; } else if (doc.material_request_type == "Purchase") { return [__("Ordered"), "green", "per_ordered,=,100"]; From cc8e2b6aca38719fafa9e84d0af6dc49052e6990 Mon Sep 17 00:00:00 2001 From: Mangesh-Khairnar Date: Wed, 1 May 2019 10:03:57 +0530 Subject: [PATCH 13/73] test: pass filters to execute --- .../report/procurement_tracker/procurement_tracker.py | 7 ------- .../report/procurement_tracker/test_procurement_tracker.py | 5 ++--- 2 files changed, 2 insertions(+), 10 deletions(-) diff --git a/erpnext/buying/report/procurement_tracker/procurement_tracker.py b/erpnext/buying/report/procurement_tracker/procurement_tracker.py index e3361a4c3f..064bf6fb73 100644 --- a/erpnext/buying/report/procurement_tracker/procurement_tracker.py +++ b/erpnext/buying/report/procurement_tracker/procurement_tracker.py @@ -53,13 +53,6 @@ def get_columns(filters): "fieldtype": "Link", "width": 140 }, - { - "label": _("Budget Code"), - "options": "Budget", - "fieldname": "budget_code", - "fieldtype": "Link", - "width": 140 - }, { "label": _("Description"), "fieldname": "description", diff --git a/erpnext/buying/report/procurement_tracker/test_procurement_tracker.py b/erpnext/buying/report/procurement_tracker/test_procurement_tracker.py index 418396fb92..4a13f385bb 100644 --- a/erpnext/buying/report/procurement_tracker/test_procurement_tracker.py +++ b/erpnext/buying/report/procurement_tracker/test_procurement_tracker.py @@ -12,7 +12,6 @@ from erpnext.buying.doctype.purchase_order.purchase_order import make_purchase_r from erpnext.stock.doctype.warehouse.test_warehouse import create_warehouse class TestProcurementTracker(unittest.TestCase): - maxDiff = None def test_result_for_procurement_tracker(self): filters = { 'company': '_Test Procurement Company', @@ -60,8 +59,8 @@ class TestProcurementTracker(unittest.TestCase): "supplier": "_Test Supplier", "estimated_cost": 0.0, "actual_cost": None, - "purchase_order_amt": 0.0, - "purchase_order_amt_in_company_currency": 0.0, + "purchase_order_amt": 5000.0, + "purchase_order_amt_in_company_currency": 300000.0, "expected_delivery_date": date_obj, "actual_delivery_date": date_obj } From c5e68869376fcbfc665d8953fd4cf7f902287280 Mon Sep 17 00:00:00 2001 From: deepeshgarg007 Date: Wed, 1 May 2019 18:03:40 +0530 Subject: [PATCH 14/73] feat: Notification for material request receipt --- .../manufacturing/notification/__init__.py | 0 .../__init__.py | 0 ...material_request_receipt_notification.json | 29 +++++++++++++++++++ .../material_request_receipt_notification.md | 19 ++++++++++++ .../material_request_receipt_notification.py | 7 +++++ 5 files changed, 55 insertions(+) create mode 100644 erpnext/manufacturing/notification/__init__.py create mode 100644 erpnext/manufacturing/notification/material_request_receipt_notification/__init__.py create mode 100644 erpnext/manufacturing/notification/material_request_receipt_notification/material_request_receipt_notification.json create mode 100644 erpnext/manufacturing/notification/material_request_receipt_notification/material_request_receipt_notification.md create mode 100644 erpnext/manufacturing/notification/material_request_receipt_notification/material_request_receipt_notification.py diff --git a/erpnext/manufacturing/notification/__init__.py b/erpnext/manufacturing/notification/__init__.py new file mode 100644 index 0000000000..e69de29bb2 diff --git a/erpnext/manufacturing/notification/material_request_receipt_notification/__init__.py b/erpnext/manufacturing/notification/material_request_receipt_notification/__init__.py new file mode 100644 index 0000000000..e69de29bb2 diff --git a/erpnext/manufacturing/notification/material_request_receipt_notification/material_request_receipt_notification.json b/erpnext/manufacturing/notification/material_request_receipt_notification/material_request_receipt_notification.json new file mode 100644 index 0000000000..5391a31497 --- /dev/null +++ b/erpnext/manufacturing/notification/material_request_receipt_notification/material_request_receipt_notification.json @@ -0,0 +1,29 @@ +{ + "attach_print": 0, + "channel": "Email", + "condition": "doc.status == \"Received\" or doc.status == \"Partially Received\"", + "creation": "2019-04-29 11:53:23.981418", + "days_in_advance": 0, + "docstatus": 0, + "doctype": "Notification", + "document_type": "Material Request", + "enabled": 1, + "event": "Value Change", + "idx": 0, + "is_standard": 1, + "message": "Material Request Type: {{ doc.material_request_type }}
\nCompany: {{ doc.company }}\n\n

Order Summary

\n\n\n \n \n \n \n {% for item in doc.items %}\n {% if frappe.utils.flt(item.received_qty, 2) > 0.0 %}\n \n \n \n \n {% endif %}\n {% endfor %}\n
Item NameReceived Quantity
{{ item.item_code }}{{ frappe.utils.flt(item.received_qty, 2) }}
", + "method": "", + "modified": "2019-05-01 18:02:51.090037", + "modified_by": "Administrator", + "module": "Manufacturing", + "name": "Material Request Receipt Notification", + "owner": "Administrator", + "recipients": [ + { + "email_by_document_field": "requested_by" + } + ], + "sender_email": "", + "subject": "{{ doc.name }} has been received", + "value_changed": "status" +} \ No newline at end of file diff --git a/erpnext/manufacturing/notification/material_request_receipt_notification/material_request_receipt_notification.md b/erpnext/manufacturing/notification/material_request_receipt_notification/material_request_receipt_notification.md new file mode 100644 index 0000000000..e6feee971d --- /dev/null +++ b/erpnext/manufacturing/notification/material_request_receipt_notification/material_request_receipt_notification.md @@ -0,0 +1,19 @@ +Material Request Type: {{ doc.material_request_type }}
+Company: {{ doc.company }} + +

Order Summary

+ + + + + + + {% for item in doc.items %} + {% if frappe.utils.flt(item.received_qty, 2) > 0.0 %} + + + + + {% endif %} + {% endfor %} +
Item NameReceived Quantity
{{ item.item_code }}{{ frappe.utils.flt(item.received_qty, 2) }}
\ No newline at end of file diff --git a/erpnext/manufacturing/notification/material_request_receipt_notification/material_request_receipt_notification.py b/erpnext/manufacturing/notification/material_request_receipt_notification/material_request_receipt_notification.py new file mode 100644 index 0000000000..2334f8b26d --- /dev/null +++ b/erpnext/manufacturing/notification/material_request_receipt_notification/material_request_receipt_notification.py @@ -0,0 +1,7 @@ +from __future__ import unicode_literals + +import frappe + +def get_context(context): + # do your magic here + pass From cb03bb1c00d665180bb90e2f54233d6b1d8ccf49 Mon Sep 17 00:00:00 2001 From: Faris Ansari Date: Fri, 3 May 2019 13:41:50 +0530 Subject: [PATCH 15/73] fix: Allow variant attributes to be optional --- erpnext/controllers/item_variant.py | 12 ++---------- erpnext/portal/product_configurator/utils.py | 3 +++ erpnext/public/js/utils/item_quick_entry.js | 9 --------- erpnext/stock/doctype/item/item.js | 3 ++- erpnext/stock/doctype/item/item.py | 8 +++++--- 5 files changed, 12 insertions(+), 23 deletions(-) diff --git a/erpnext/controllers/item_variant.py b/erpnext/controllers/item_variant.py index e0acd73edf..d0d893a38b 100644 --- a/erpnext/controllers/item_variant.py +++ b/erpnext/controllers/item_variant.py @@ -124,16 +124,8 @@ def find_variant(template, args, variant_item_code=None): conditions = " or ".join(conditions) - # use approximate match and shortlist possible variant matches - # it is approximate because we are matching using OR condition - # and it need not be exact match at this stage - # this uses a simpler query instead of using multiple exists conditions - possible_variants = frappe.db.sql_list("""select name from `tabItem` item - where variant_of=%s and exists ( - select name from `tabItem Variant Attribute` iv_attribute - where iv_attribute.parent=item.name - and ({conditions}) and parent != %s - )""".format(conditions=conditions), (template, cstr(variant_item_code))) + from erpnext.portal.product_configurator.utils import get_item_codes_by_attributes + possible_variants = [i for i in get_item_codes_by_attributes(args, template) if i != variant_item_code] for variant in possible_variants: variant = frappe.get_doc("Item", variant) diff --git a/erpnext/portal/product_configurator/utils.py b/erpnext/portal/product_configurator/utils.py index 405a6d8c31..ae47e8bc4c 100644 --- a/erpnext/portal/product_configurator/utils.py +++ b/erpnext/portal/product_configurator/utils.py @@ -102,6 +102,9 @@ def get_item_codes_by_attributes(attribute_filters, template_item_code=None): for attribute, values in attribute_filters.items(): attribute_values = values + if isinstance(attribute_values, frappe.string_types): + attribute_values = [attribute_values] + if not attribute_values: continue wheres = [] diff --git a/erpnext/public/js/utils/item_quick_entry.js b/erpnext/public/js/utils/item_quick_entry.js index 62b82ac012..2947d5b98e 100644 --- a/erpnext/public/js/utils/item_quick_entry.js +++ b/erpnext/public/js/utils/item_quick_entry.js @@ -390,15 +390,6 @@ frappe.ui.form.ItemQuickEntryForm = frappe.ui.form.QuickEntryForm.extend({ } }) - if (mandatory.length) { - frappe.msgprint({ - title: __('Missing Values Required'), - message: __('Following fields have missing values:') + '

  • ' + mandatory.join('
  • ') + '
', - indicator: 'orange' - }); - return {}; - } - if (this.is_manufacturer) { $.each(this.manufacturer_fields, function(index, field) { attribute[field.fieldname] = me.dialog.fields_dict[field.fieldname].input.value; diff --git a/erpnext/stock/doctype/item/item.js b/erpnext/stock/doctype/item/item.js index 6c30d00d23..42c84da933 100644 --- a/erpnext/stock/doctype/item/item.js +++ b/erpnext/stock/doctype/item/item.js @@ -585,7 +585,7 @@ $.extend(erpnext.item, { "label": row.attribute, "fieldname": row.attribute, "fieldtype": fieldtype, - "reqd": 1, + "reqd": 0, "description": desc }) } @@ -600,6 +600,7 @@ $.extend(erpnext.item, { if(!args) return; frappe.call({ method:"erpnext.controllers.item_variant.get_variant", + btn: d.get_primary_btn(), args: { "template": frm.doc.name, "args": d.get_values() diff --git a/erpnext/stock/doctype/item/item.py b/erpnext/stock/doctype/item/item.py index ed02cee3a4..7bf0be09d0 100644 --- a/erpnext/stock/doctype/item/item.py +++ b/erpnext/stock/doctype/item/item.py @@ -800,10 +800,12 @@ class Item(WebsiteGenerator): def validate_variant_attributes(self): if self.is_new() and self.variant_of and self.variant_based_on == 'Item Attribute': + # remove attributes with no attribute_value set + self.attributes = [d for d in self.attributes if cstr(d.attribute_value).strip()] + args = {} - for d in self.attributes: - if cstr(d.attribute_value).strip() == '': - frappe.throw(_("Please specify Attribute Value for attribute {0}").format(d.attribute)) + for i, d in enumerate(self.attributes): + d.idx = i + 1 args[d.attribute] = d.attribute_value variant = get_variant(self.variant_of, args, self.name) From ab14892fc5ab2138135ec508b35ee62433006b6d Mon Sep 17 00:00:00 2001 From: Faris Ansari Date: Fri, 3 May 2019 13:57:20 +0530 Subject: [PATCH 16/73] fix: Variant naming if optional attributes --- erpnext/controllers/item_variant.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/erpnext/controllers/item_variant.py b/erpnext/controllers/item_variant.py index d0d893a38b..631f7751b4 100644 --- a/erpnext/controllers/item_variant.py +++ b/erpnext/controllers/item_variant.py @@ -309,7 +309,7 @@ def make_variant_item_code(template_item_code, template_item_name, variant): }, as_dict=True) if not item_attribute: - return + continue # frappe.throw(_('Invalid attribute {0} {1}').format(frappe.bold(attr.attribute), # frappe.bold(attr.attribute_value)), title=_('Invalid Attribute'), # exc=InvalidItemAttributeValueError) From d0cdb4a1e9d64a484d9f4a073a6dd61579071710 Mon Sep 17 00:00:00 2001 From: Anurag Mishra Date: Fri, 3 May 2019 14:05:29 +0530 Subject: [PATCH 17/73] feat: subcontracting report --- .../__init__.py | 0 .../subcontracted_item_to_be_received.js | 29 ++++ .../subcontracted_item_to_be_received.json | 30 ++++ .../subcontracted_item_to_be_received.py | 105 ++++++++++++++ .../__init__.py | 0 ...tracted_raw_materials_to_be_transferred.js | 29 ++++ ...acted_raw_materials_to_be_transferred.json | 30 ++++ ...tracted_raw_materials_to_be_transferred.py | 133 ++++++++++++++++++ 8 files changed, 356 insertions(+) create mode 100644 erpnext/buying/report/subcontracted_item_to_be_received/__init__.py create mode 100644 erpnext/buying/report/subcontracted_item_to_be_received/subcontracted_item_to_be_received.js create mode 100644 erpnext/buying/report/subcontracted_item_to_be_received/subcontracted_item_to_be_received.json create mode 100644 erpnext/buying/report/subcontracted_item_to_be_received/subcontracted_item_to_be_received.py create mode 100644 erpnext/buying/report/subcontracted_raw_materials_to_be_transferred/__init__.py create mode 100644 erpnext/buying/report/subcontracted_raw_materials_to_be_transferred/subcontracted_raw_materials_to_be_transferred.js create mode 100644 erpnext/buying/report/subcontracted_raw_materials_to_be_transferred/subcontracted_raw_materials_to_be_transferred.json create mode 100644 erpnext/buying/report/subcontracted_raw_materials_to_be_transferred/subcontracted_raw_materials_to_be_transferred.py diff --git a/erpnext/buying/report/subcontracted_item_to_be_received/__init__.py b/erpnext/buying/report/subcontracted_item_to_be_received/__init__.py new file mode 100644 index 0000000000..e69de29bb2 diff --git a/erpnext/buying/report/subcontracted_item_to_be_received/subcontracted_item_to_be_received.js b/erpnext/buying/report/subcontracted_item_to_be_received/subcontracted_item_to_be_received.js new file mode 100644 index 0000000000..fc58b6aaaf --- /dev/null +++ b/erpnext/buying/report/subcontracted_item_to_be_received/subcontracted_item_to_be_received.js @@ -0,0 +1,29 @@ +// Copyright (c) 2016, Frappe Technologies Pvt. Ltd. and contributors +// For license information, please see license.txt +/* eslint-disable */ + +frappe.query_reports["Subcontracted Item To Be Received"] = { + "filters": [ + { + fieldname: "supplier", + label: __("Supplier"), + fieldtype: "Link", + options: "Supplier", + reqd: 1 + }, + { + fieldname:"from_date", + label: __("From Date"), + fieldtype: "Date", + default: frappe.datetime.add_months(frappe.datetime.month_start(), -1), + reqd: 1 + }, + { + fieldname:"to_date", + label: __("To Date"), + fieldtype: "Date", + default: frappe.datetime.add_days(frappe.datetime.month_start(),-1), + reqd: 1 + }, + ] +}; diff --git a/erpnext/buying/report/subcontracted_item_to_be_received/subcontracted_item_to_be_received.json b/erpnext/buying/report/subcontracted_item_to_be_received/subcontracted_item_to_be_received.json new file mode 100644 index 0000000000..fdf6cf702d --- /dev/null +++ b/erpnext/buying/report/subcontracted_item_to_be_received/subcontracted_item_to_be_received.json @@ -0,0 +1,30 @@ +{ + "add_total_row": 1, + "creation": "2019-05-03 11:25:03.685247", + "disable_prepared_report": 0, + "disabled": 0, + "docstatus": 0, + "doctype": "Report", + "idx": 0, + "is_standard": "Yes", + "modified": "2019-05-03 11:25:03.685247", + "modified_by": "Administrator", + "module": "Buying", + "name": "Subcontracted Item To Be Received", + "owner": "Administrator", + "prepared_report": 0, + "ref_doctype": "Purchase Order", + "report_name": "Subcontracted Item To Be Received", + "report_type": "Script Report", + "roles": [ + { + "role": "Stock User" + }, + { + "role": "Purchase Manager" + }, + { + "role": "Purchase User" + } + ] +} \ No newline at end of file diff --git a/erpnext/buying/report/subcontracted_item_to_be_received/subcontracted_item_to_be_received.py b/erpnext/buying/report/subcontracted_item_to_be_received/subcontracted_item_to_be_received.py new file mode 100644 index 0000000000..fc2ed715c9 --- /dev/null +++ b/erpnext/buying/report/subcontracted_item_to_be_received/subcontracted_item_to_be_received.py @@ -0,0 +1,105 @@ +# Copyright (c) 2013, Frappe Technologies Pvt. Ltd. and contributors +# For license information, please see license.txt + +from __future__ import unicode_literals +import frappe +from frappe import _ + +def execute(filters=None): + if filters.from_date >= filters.to_date: + frappe.msgprint(_("To Date must be greater than From Date")) + + data = [] + columns = get_columns() + get_data(data , filters) + return columns, data + +def get_columns(): + return [ + { + "label": _("Purchase Order"), + "fieldtype": "Link", + "fieldname": "purchase_order", + "options": "Purchase Order", + "width": 150 + }, + { + "label": _("Date"), + "fieldtype": "Date", + "fieldname": "date", + "hidden": 1, + "width": 150 + }, + { + "label": _("Supplier"), + "fieldtype": "Link", + "fieldname": "supplier", + "options": "Supplier", + "width": 150 + }, + { + "label": _("Finished Good Item Code"), + "fieldtype": "Data", + "fieldname": "fg_item_code", + "width": 100 + }, + { + "label": _("Item name"), + "fieldtype": "Data", + "fieldname": "item_name", + "width": 100 + }, + { + "label": _("Required Quantity"), + "fieldtype": "Float", + "fieldname": "r_qty", + "width": 100 + }, + { + "label": _("Received Quantity"), + "fieldtype": "Float", + "fieldname": "received_qty", + "width": 100 + }, + { + "label": _("Pending Quantity"), + "fieldtype": "Float", + "fieldname": "p_qty", + "width": 100 + } + ] + +def get_data(data, filters): + po = get_po(filters) + po_name = [v.name for v in po] + print(po_name) + sub_items = get_purchase_order_item_supplied(po_name) + for item in sub_items: + for order in po: + if order.name == item.parent and item.received_qty < item.qty: + row ={ + 'purchase_order': item.parent, + 'date': order.transaction_date, + 'supplier': order.supplier, + 'fg_item_code': item.item_code, + 'item_name': item.item_name, + 'r_qty': item.qty, + 'received_qty':item.received_qty, + 'p_qty':item.qty - item.received_qty + } + data.append(row) + +def get_po(filters): + record_filters = [ + ["is_subcontracted", "=", "Yes"], + ["supplier", "=", filters.supplier], + ["transaction_date", "<=", filters.to_date], + ["transaction_date", ">=", filters.from_date], + ["docstatus", "=", 1] + ] + return frappe.get_all("Purchase Order", filters=record_filters, fields=["name", "transaction_date", "supplier"]) + +def get_purchase_order_item_supplied(po): + return frappe.get_all("Purchase Order Item", filters=[ + ('parent', 'IN', po) + ], fields=["parent", "item_code", "item_name", "qty", "received_qty"]) diff --git a/erpnext/buying/report/subcontracted_raw_materials_to_be_transferred/__init__.py b/erpnext/buying/report/subcontracted_raw_materials_to_be_transferred/__init__.py new file mode 100644 index 0000000000..e69de29bb2 diff --git a/erpnext/buying/report/subcontracted_raw_materials_to_be_transferred/subcontracted_raw_materials_to_be_transferred.js b/erpnext/buying/report/subcontracted_raw_materials_to_be_transferred/subcontracted_raw_materials_to_be_transferred.js new file mode 100644 index 0000000000..0853afd657 --- /dev/null +++ b/erpnext/buying/report/subcontracted_raw_materials_to_be_transferred/subcontracted_raw_materials_to_be_transferred.js @@ -0,0 +1,29 @@ +// Copyright (c) 2016, Frappe Technologies Pvt. Ltd. and contributors +// For license information, please see license.txt +/* eslint-disable */ + +frappe.query_reports["Subcontracted Raw Materials To Be Transferred"] = { + "filters": [ + { + fieldname: "supplier", + label: __("Supplier"), + fieldtype: "Link", + options: "Supplier", + reqd: 1 + }, + { + fieldname:"from_date", + label: __("From Date"), + fieldtype: "Date", + default: frappe.datetime.add_months(frappe.datetime.month_start(), -1), + reqd: 1 + }, + { + fieldname:"to_date", + label: __("To Date"), + fieldtype: "Date", + default: frappe.datetime.add_days(frappe.datetime.month_start(),-1), + reqd: 1 + }, + ] +} diff --git a/erpnext/buying/report/subcontracted_raw_materials_to_be_transferred/subcontracted_raw_materials_to_be_transferred.json b/erpnext/buying/report/subcontracted_raw_materials_to_be_transferred/subcontracted_raw_materials_to_be_transferred.json new file mode 100644 index 0000000000..c7cee5e20b --- /dev/null +++ b/erpnext/buying/report/subcontracted_raw_materials_to_be_transferred/subcontracted_raw_materials_to_be_transferred.json @@ -0,0 +1,30 @@ +{ + "add_total_row": 1, + "creation": "2019-05-03 12:04:14.438345", + "disable_prepared_report": 0, + "disabled": 0, + "docstatus": 0, + "doctype": "Report", + "idx": 0, + "is_standard": "Yes", + "modified": "2019-05-03 12:04:24.203721", + "modified_by": "Administrator", + "module": "Buying", + "name": "Subcontracted Raw Materials To Be Transferred", + "owner": "Administrator", + "prepared_report": 0, + "ref_doctype": "Purchase Order", + "report_name": "Subcontracted Raw Materials To Be Transferred", + "report_type": "Script Report", + "roles": [ + { + "role": "Stock User" + }, + { + "role": "Purchase Manager" + }, + { + "role": "Purchase User" + } + ] +} \ No newline at end of file diff --git a/erpnext/buying/report/subcontracted_raw_materials_to_be_transferred/subcontracted_raw_materials_to_be_transferred.py b/erpnext/buying/report/subcontracted_raw_materials_to_be_transferred/subcontracted_raw_materials_to_be_transferred.py new file mode 100644 index 0000000000..441fbcb26b --- /dev/null +++ b/erpnext/buying/report/subcontracted_raw_materials_to_be_transferred/subcontracted_raw_materials_to_be_transferred.py @@ -0,0 +1,133 @@ +# Copyright (c) 2013, Frappe Technologies Pvt. Ltd. and contributors +# For license information, please see license.txt + +from __future__ import unicode_literals +import frappe +from frappe import _ +import itertools + +def execute(filters=None): + if filters.from_date >= filters.to_date: + frappe.msgprint(_("To Date must be greater than From Date")) + + data = [] + columns = get_columns() + get_data(data , filters) + return columns, data + +def get_columns(): + return [ + { + "label": _("Purchase Order"), + "fieldtype": "Link", + "fieldname": "purchase_order", + "options": "Purchase Order", + "width": 150 + }, + { + "label": _("Date"), + "fieldtype": "Date", + "fieldname": "date", + "hidden": 1, + "width": 150 + }, + { + "label": _("Supplier"), + "fieldtype": "Link", + "fieldname": "supplier", + "options": "Supplier", + "width": 150 + }, + { + "label": _("Item Code"), + "fieldtype": "Data", + "fieldname": "rm_item_code", + "width": 100 + }, + { + "label": _("Required Quantity"), + "fieldtype": "Float", + "fieldname": "r_qty", + "width": 100 + }, + { + "label": _("Transferred Quantity"), + "fieldtype": "Float", + "fieldname": "t_qty", + "width": 100 + }, + { + "label": _("Pending Quantity"), + "fieldtype": "Float", + "fieldname": "p_qty", + "width": 100 + } + ] + +def get_data(data, filters): + po = get_po(filters) + po_transferred_qty_map = frappe._dict(get_transferred_quantity([v.name for v in po])) + sub_items = get_purchase_order_item_supplied([v.name for v in po]) + + for order in po: + for item in sub_items: + if order.name == item.parent and item.required_qty != po_transferred_qty_map.get(order.name).get(item.rm_item_code): + row ={ + 'purchase_order': item.parent, + 'date': order.transaction_date, + 'supplier': order.supplier, + 'rm_item_code': item.rm_item_code, + 'r_qty': item.required_qty, + 't_qty':po_transferred_qty_map.get(order.name).get(item.rm_item_code), + 'p_qty':item.required_qty - po_transferred_qty_map.get(order.name).get(item.rm_item_code) + } + + data.append(row) + + return(data) + +def get_po(filters): + record_filters = [ + ["is_subcontracted", "=", "Yes"], + ["supplier", "=", filters.supplier], + ["transaction_date", "<=", filters.to_date], + ["transaction_date", ">=", filters.from_date], + ["docstatus", "=", 1] + ] + return frappe.get_all("Purchase Order", filters=record_filters, fields=["name", "transaction_date", "supplier"]) + +def get_transferred_quantity(po_name): + stock_entries = get_stock_entry(po_name) + stock_entries_detail = get_stock_entry_detail([v.name for v in stock_entries]) + po_transferred_qty_map = {} + + for entry in stock_entries: + for details in stock_entries_detail: + if details.parent == entry.name: + details["Purchase_order"] = entry.purchase_order + if entry.purchase_order not in po_transferred_qty_map: + po_transferred_qty_map[entry.purchase_order] = {} + po_transferred_qty_map[entry.purchase_order][details.item_code] = details.qty + else: + po_transferred_qty_map[entry.purchase_order][details.item_code] = po_transferred_qty_map[entry.purchase_order].get(details.item_code, 0) + details.qty + + return po_transferred_qty_map + + +def get_stock_entry(po): + return frappe.get_all("Stock Entry", filters=[ + ('purchase_order', 'IN', po), + ('stock_entry_type', '=', 'Send to Subcontractor'), + ('docstatus', '=', 1) + ], fields=["name", "purchase_order"]) + +def get_stock_entry_detail(se): + return frappe.get_all("Stock Entry Detail", filters=[ + ["parent", "in", se] + ], + fields=["parent", "item_code", "qty"]) + +def get_purchase_order_item_supplied(po): + return frappe.get_all("Purchase Order Item Supplied", filters=[ + ('parent', 'IN', po) + ], fields=['parent', 'rm_item_code', 'required_qty']) From 13d393247a59b01e94060c807b541d64cbd2c611 Mon Sep 17 00:00:00 2001 From: Mangesh-Khairnar Date: Fri, 3 May 2019 16:00:02 +0530 Subject: [PATCH 18/73] feat: add date range filters --- .../procurement_tracker/procurement_tracker.js | 17 +++++++++++++---- .../procurement_tracker/procurement_tracker.py | 8 ++++++++ 2 files changed, 21 insertions(+), 4 deletions(-) diff --git a/erpnext/buying/report/procurement_tracker/procurement_tracker.js b/erpnext/buying/report/procurement_tracker/procurement_tracker.js index 0013666ce8..283d56c946 100644 --- a/erpnext/buying/report/procurement_tracker/procurement_tracker.js +++ b/erpnext/buying/report/procurement_tracker/procurement_tracker.js @@ -10,21 +10,30 @@ frappe.query_reports["Procurement Tracker"] = { fieldtype: "Link", options: "Company", default: frappe.defaults.get_user_default("Company"), - reqd: 1 }, { fieldname: "cost_center", label: __("Cost Center"), fieldtype: "Link", options: "Cost Center", - reqd: 1 }, { fieldname: "project", label: __("Project"), fieldtype: "Link", options: "Project", - reqd: 1 - } + }, + { + fieldname: "from_date", + label: __("From Date"), + fieldtype: "Date", + default: frappe.defaults.get_user_default("year_start_date"), + }, + { + fieldname:"to_date", + label: __("To Date"), + fieldtype: "Date", + default: frappe.defaults.get_user_default("year_end_date"), + }, ] } diff --git a/erpnext/buying/report/procurement_tracker/procurement_tracker.py b/erpnext/buying/report/procurement_tracker/procurement_tracker.py index 064bf6fb73..7889d95a19 100644 --- a/erpnext/buying/report/procurement_tracker/procurement_tracker.py +++ b/erpnext/buying/report/procurement_tracker/procurement_tracker.py @@ -142,11 +142,19 @@ def get_conditions(filters): if filters.get("company"): conditions += " AND company='%s'"% filters.get('company') + if filters.get("cost_center") or filters.get("project"): conditions += """ AND (cost_center='%s' OR project='%s') """% (filters.get('cost_center'), filters.get('project')) + + if filters.get("from_date"): + conditions.append("transaction_date>=%s", filters.get('from_date')) + + if filters.get("to_date"): + conditions.append("transaction_date<=%s", filters.get('to_date') + return conditions def get_data(filters): From e003cc881293219affef084ad72f76f7f8e4d26e Mon Sep 17 00:00:00 2001 From: Mangesh-Khairnar Date: Fri, 3 May 2019 16:41:04 +0530 Subject: [PATCH 19/73] fix: filter out completed purchase receipt --- .../procurement_tracker/procurement_tracker.py | 16 ++++++++-------- 1 file changed, 8 insertions(+), 8 deletions(-) diff --git a/erpnext/buying/report/procurement_tracker/procurement_tracker.py b/erpnext/buying/report/procurement_tracker/procurement_tracker.py index 7889d95a19..2654cd4965 100644 --- a/erpnext/buying/report/procurement_tracker/procurement_tracker.py +++ b/erpnext/buying/report/procurement_tracker/procurement_tracker.py @@ -150,11 +150,10 @@ def get_conditions(filters): """% (filters.get('cost_center'), filters.get('project')) if filters.get("from_date"): - conditions.append("transaction_date>=%s", filters.get('from_date')) + conditions.append("AND transaction_date>=%s", filters.get('from_date')) if filters.get("to_date"): - conditions.append("transaction_date<=%s", filters.get('to_date') - + conditions.append("AND transaction_date<=%s", filters.get('to_date') return conditions def get_data(filters): @@ -227,12 +226,12 @@ def get_mapped_mr_details(conditions): def get_mapped_pi_records(): return frappe._dict(frappe.db.sql(""" SELECT - po_detail, - base_amount - FROM `tabPurchase Invoice Item` + pi_item.po_detail, + pi_item.base_amount + FROM `tabPurchase Invoice` pi, `tabPurchase Invoice Item` pi_item WHERE - docstatus=1 - AND po_detail IS NOT NULL + pi.docstatus=1 + AND pi_item.po_detail IS NOT NULL """)) def get_mapped_pr_records(): @@ -245,6 +244,7 @@ def get_mapped_pr_records(): pr.docstatus=1 AND pr.name=pr_item.parent AND pr_item.purchase_order_item IS NOT NULL + AND pr.status not in ("Closed","Completed","Cancelled") """)) def get_po_entries(conditions): From 09d4933edbe6427ddab608d6307de4fbbb7f21a6 Mon Sep 17 00:00:00 2001 From: Mangesh-Khairnar Date: Mon, 6 May 2019 12:53:52 +0530 Subject: [PATCH 20/73] fix: filter pi item based on po completeion --- .../procurement_tracker/procurement_tracker.py | 12 ++++++++---- 1 file changed, 8 insertions(+), 4 deletions(-) diff --git a/erpnext/buying/report/procurement_tracker/procurement_tracker.py b/erpnext/buying/report/procurement_tracker/procurement_tracker.py index 2654cd4965..d3ee447545 100644 --- a/erpnext/buying/report/procurement_tracker/procurement_tracker.py +++ b/erpnext/buying/report/procurement_tracker/procurement_tracker.py @@ -150,10 +150,10 @@ def get_conditions(filters): """% (filters.get('cost_center'), filters.get('project')) if filters.get("from_date"): - conditions.append("AND transaction_date>=%s", filters.get('from_date')) + conditions += "AND transaction_date>=%s"% filters.get('from_date') if filters.get("to_date"): - conditions.append("AND transaction_date<=%s", filters.get('to_date') + conditions += "AND transaction_date<=%s"% filters.get('to_date') return conditions def get_data(filters): @@ -162,6 +162,7 @@ def get_data(filters): mr_records, procurement_record_against_mr = get_mapped_mr_details(conditions) pr_records = get_mapped_pr_records() pi_records = get_mapped_pi_records() + print(pi_records) procurement_record=[] if procurement_record_against_mr: @@ -228,9 +229,12 @@ def get_mapped_pi_records(): SELECT pi_item.po_detail, pi_item.base_amount - FROM `tabPurchase Invoice` pi, `tabPurchase Invoice Item` pi_item + FROM `tabPurchase Invoice Item` as pi_item + INNER JOIN `tabPurchase Order` as po + ON pi_item.`purchase_order` = po.`name` WHERE - pi.docstatus=1 + pi_item.docstatus = 1 + AND po.status not in ("Closed","Completed","Cancelled") AND pi_item.po_detail IS NOT NULL """)) From fde4fa7b60eac42abd6b75538148fafd8612a02e Mon Sep 17 00:00:00 2001 From: Faris Ansari Date: Tue, 7 May 2019 13:29:00 +0530 Subject: [PATCH 21/73] fix(test): Convert values to list --- erpnext/portal/product_configurator/utils.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/erpnext/portal/product_configurator/utils.py b/erpnext/portal/product_configurator/utils.py index ae47e8bc4c..53643a5b7f 100644 --- a/erpnext/portal/product_configurator/utils.py +++ b/erpnext/portal/product_configurator/utils.py @@ -102,7 +102,7 @@ def get_item_codes_by_attributes(attribute_filters, template_item_code=None): for attribute, values in attribute_filters.items(): attribute_values = values - if isinstance(attribute_values, frappe.string_types): + if not isinstance(attribute_values, list): attribute_values = [attribute_values] if not attribute_values: continue From 9acb2bf28fb8f255bd4a21276efef900eb468273 Mon Sep 17 00:00:00 2001 From: Anurag Mishra Date: Mon, 6 May 2019 16:30:52 +0530 Subject: [PATCH 22/73] test: for subcontracting item be received --- .../subcontracted_item_to_be_received.py | 9 +++-- .../test_subcontracted_item_to_be_received.py | 36 +++++++++++++++++++ ...tracted_raw_materials_to_be_transferred.py | 4 ++- 3 files changed, 43 insertions(+), 6 deletions(-) create mode 100644 erpnext/buying/report/subcontracted_item_to_be_received/test_subcontracted_item_to_be_received.py diff --git a/erpnext/buying/report/subcontracted_item_to_be_received/subcontracted_item_to_be_received.py b/erpnext/buying/report/subcontracted_item_to_be_received/subcontracted_item_to_be_received.py index fc2ed715c9..2da53d726b 100644 --- a/erpnext/buying/report/subcontracted_item_to_be_received/subcontracted_item_to_be_received.py +++ b/erpnext/buying/report/subcontracted_item_to_be_received/subcontracted_item_to_be_received.py @@ -52,7 +52,7 @@ def get_columns(): { "label": _("Required Quantity"), "fieldtype": "Float", - "fieldname": "r_qty", + "fieldname": "required_qty", "width": 100 }, { @@ -64,7 +64,7 @@ def get_columns(): { "label": _("Pending Quantity"), "fieldtype": "Float", - "fieldname": "p_qty", + "fieldname": "pending_qty", "width": 100 } ] @@ -72,7 +72,6 @@ def get_columns(): def get_data(data, filters): po = get_po(filters) po_name = [v.name for v in po] - print(po_name) sub_items = get_purchase_order_item_supplied(po_name) for item in sub_items: for order in po: @@ -83,9 +82,9 @@ def get_data(data, filters): 'supplier': order.supplier, 'fg_item_code': item.item_code, 'item_name': item.item_name, - 'r_qty': item.qty, + 'required_qty': item.qty, 'received_qty':item.received_qty, - 'p_qty':item.qty - item.received_qty + 'pending_qty':item.qty - item.received_qty } data.append(row) diff --git a/erpnext/buying/report/subcontracted_item_to_be_received/test_subcontracted_item_to_be_received.py b/erpnext/buying/report/subcontracted_item_to_be_received/test_subcontracted_item_to_be_received.py new file mode 100644 index 0000000000..d8de701bf6 --- /dev/null +++ b/erpnext/buying/report/subcontracted_item_to_be_received/test_subcontracted_item_to_be_received.py @@ -0,0 +1,36 @@ +# Python bytecode 2.7 (62211) +# Embedded file name: /Users/anuragmishra/frappe-develop/apps/erpnext/erpnext/buying/report/subcontracted_item_to_be_received/test_subcontracted_item_to_be_received.py +# Compiled at: 2019-05-06 09:51:46 +# Decompiled by https://python-decompiler.com +from __future__ import unicode_literals +from erpnext.buying.doctype.purchase_order.test_purchase_order import create_purchase_order +from erpnext.buying.doctype.purchase_order.purchase_order import make_purchase_receipt +from erpnext.stock.doctype.stock_entry.test_stock_entry import make_stock_entry +from erpnext.buying.report.subcontracted_item_to_be_received.subcontracted_item_to_be_received import execute +import frappe, unittest +from pprint import pprint + +class TestSubcontractedItemToBeReceived(unittest.TestCase): + + def test_pending_and_received_qty(self): + po = create_purchase_order(item_code='_Test FG Item', is_subcontracted='Yes') + transfer_param = [] + make_stock_entry(item_code='_Test Item', target='_Test Warehouse 1 - _TC', qty=100, basic_rate=100) + make_stock_entry(item_code='_Test Item Home Desktop 100', target='_Test Warehouse 1 - _TC', qty=100, basic_rate=100) + make_purchase_receipt_against_po(po.name) + po.reload() + col, data = execute(filters=frappe._dict({'supplier': po.supplier, + 'from_date': frappe.utils.get_datetime(frappe.utils.add_to_date(po.transaction_date, days=-10)), + 'to_date': frappe.utils.get_datetime(frappe.utils.add_to_date(po.transaction_date, days=10))})) + self.assertEqual(data[0]['pending_qty'], 5) + self.assertEqual(data[0]['received_qty'], 5) + self.assertEqual(data[0]['purchase_order'], po.name) + self.assertEqual(data[0]['supplier'], po.supplier) + + +def make_purchase_receipt_against_po(po, quantity=5): + pr = make_purchase_receipt(po) + pr.items[0].qty = quantity + pr.supplier_warehouse = '_Test Warehouse 1 - _TC' + pr.insert() + pr.submit() \ No newline at end of file diff --git a/erpnext/buying/report/subcontracted_raw_materials_to_be_transferred/subcontracted_raw_materials_to_be_transferred.py b/erpnext/buying/report/subcontracted_raw_materials_to_be_transferred/subcontracted_raw_materials_to_be_transferred.py index 441fbcb26b..e0bc7ad815 100644 --- a/erpnext/buying/report/subcontracted_raw_materials_to_be_transferred/subcontracted_raw_materials_to_be_transferred.py +++ b/erpnext/buying/report/subcontracted_raw_materials_to_be_transferred/subcontracted_raw_materials_to_be_transferred.py @@ -100,7 +100,8 @@ def get_transferred_quantity(po_name): stock_entries = get_stock_entry(po_name) stock_entries_detail = get_stock_entry_detail([v.name for v in stock_entries]) po_transferred_qty_map = {} - + from pprint import pprint + pprint(stock_entries) for entry in stock_entries: for details in stock_entries_detail: if details.parent == entry.name: @@ -115,6 +116,7 @@ def get_transferred_quantity(po_name): def get_stock_entry(po): + print(po) return frappe.get_all("Stock Entry", filters=[ ('purchase_order', 'IN', po), ('stock_entry_type', '=', 'Send to Subcontractor'), From 58bd2df834df15a4a2cc8fdf27d358041adda5db Mon Sep 17 00:00:00 2001 From: Anurag Mishra Date: Tue, 7 May 2019 17:42:22 +0530 Subject: [PATCH 23/73] fix: code refactor --- ...contracted_raw_materials_to_be_transferred.py | 16 +++++++++------- 1 file changed, 9 insertions(+), 7 deletions(-) diff --git a/erpnext/buying/report/subcontracted_raw_materials_to_be_transferred/subcontracted_raw_materials_to_be_transferred.py b/erpnext/buying/report/subcontracted_raw_materials_to_be_transferred/subcontracted_raw_materials_to_be_transferred.py index e0bc7ad815..de2ae8fc73 100644 --- a/erpnext/buying/report/subcontracted_raw_materials_to_be_transferred/subcontracted_raw_materials_to_be_transferred.py +++ b/erpnext/buying/report/subcontracted_raw_materials_to_be_transferred/subcontracted_raw_materials_to_be_transferred.py @@ -4,7 +4,6 @@ from __future__ import unicode_literals import frappe from frappe import _ -import itertools def execute(filters=None): if filters.from_date >= filters.to_date: @@ -67,19 +66,23 @@ def get_columns(): def get_data(data, filters): po = get_po(filters) po_transferred_qty_map = frappe._dict(get_transferred_quantity([v.name for v in po])) + sub_items = get_purchase_order_item_supplied([v.name for v in po]) for order in po: for item in sub_items: - if order.name == item.parent and item.required_qty != po_transferred_qty_map.get(order.name).get(item.rm_item_code): + if order.name == item.parent and order.name in po_transferred_qty_map and \ + item.required_qty != po_transferred_qty_map.get(order.name).get(item.rm_item_code): + transferred_qty = po_transferred_qty_map.get(order.name).get(item.rm_item_code) \ + if po_transferred_qty_map.get(order.name).get(item.rm_item_code) else 0 row ={ 'purchase_order': item.parent, 'date': order.transaction_date, 'supplier': order.supplier, 'rm_item_code': item.rm_item_code, 'r_qty': item.required_qty, - 't_qty':po_transferred_qty_map.get(order.name).get(item.rm_item_code), - 'p_qty':item.required_qty - po_transferred_qty_map.get(order.name).get(item.rm_item_code) + 't_qty':transferred_qty, + 'p_qty':item.required_qty - transferred_qty } data.append(row) @@ -100,8 +103,8 @@ def get_transferred_quantity(po_name): stock_entries = get_stock_entry(po_name) stock_entries_detail = get_stock_entry_detail([v.name for v in stock_entries]) po_transferred_qty_map = {} - from pprint import pprint - pprint(stock_entries) + + for entry in stock_entries: for details in stock_entries_detail: if details.parent == entry.name: @@ -116,7 +119,6 @@ def get_transferred_quantity(po_name): def get_stock_entry(po): - print(po) return frappe.get_all("Stock Entry", filters=[ ('purchase_order', 'IN', po), ('stock_entry_type', '=', 'Send to Subcontractor'), From c3dcf027843245bf3dc5f3303ccea2a7d87cd9e2 Mon Sep 17 00:00:00 2001 From: Anurag Mishra Date: Tue, 7 May 2019 17:43:48 +0530 Subject: [PATCH 24/73] test: subcontracted raw materials to be recieved --- ...tracted_raw_materials_to_be_transferred.py | 44 +++++++++++++++++++ 1 file changed, 44 insertions(+) create mode 100644 erpnext/buying/report/subcontracted_raw_materials_to_be_transferred/test_subcontracted_raw_materials_to_be_transferred.py diff --git a/erpnext/buying/report/subcontracted_raw_materials_to_be_transferred/test_subcontracted_raw_materials_to_be_transferred.py b/erpnext/buying/report/subcontracted_raw_materials_to_be_transferred/test_subcontracted_raw_materials_to_be_transferred.py new file mode 100644 index 0000000000..6900938236 --- /dev/null +++ b/erpnext/buying/report/subcontracted_raw_materials_to_be_transferred/test_subcontracted_raw_materials_to_be_transferred.py @@ -0,0 +1,44 @@ +# Python bytecode 2.7 (62211) +# Embedded file name: /Users/anuragmishra/frappe-develop/apps/erpnext/erpnext/buying/report/subcontracted_raw_materials_to_be_transferred/test_subcontracted_raw_materials_to_be_transferred.py +# Compiled at: 2019-05-06 10:24:35 +# Decompiled by https://python-decompiler.com +from __future__ import unicode_literals +from erpnext.buying.doctype.purchase_order.test_purchase_order import create_purchase_order +from erpnext.buying.doctype.purchase_order.purchase_order import make_rm_stock_entry +from erpnext.stock.doctype.stock_entry.test_stock_entry import make_stock_entry +from erpnext.buying.report.subcontracted_raw_materials_to_be_transferred.subcontracted_raw_materials_to_be_transferred import execute +import json, frappe, unittest + +class TestSubcontractedItemToBeReceived(unittest.TestCase): + + def test_pending_and_received_qty(self): + po = create_purchase_order(item_code='_Test FG Item', is_subcontracted='Yes') + make_stock_entry(item_code='_Test Item', target='_Test Warehouse 1 - _TC', qty=100, basic_rate=100) + make_stock_entry(item_code='_Test Item Home Desktop 100', target='_Test Warehouse 1 - _TC', qty=100, basic_rate=100) + transfer_subcontracted_raw_materials(po.name) + col, data = execute(filters=frappe._dict({'supplier': po.supplier, + 'from_date': frappe.utils.get_datetime(frappe.utils.add_to_date(po.transaction_date, days=-10)), + 'to_date': frappe.utils.get_datetime(frappe.utils.add_to_date(po.transaction_date, days=10))})) + self.assertEqual(data[0]['purchase_order'], po.name) + self.assertIn(data[0]['rm_item_code'], ['_Test Item', '_Test Item Home Desktop 100']) + self.assertIn(data[0]['p_qty'], [9, 18]) + self.assertIn(data[0]['t_qty'], [1, 2]) + + self.assertEqual(data[1]['purchase_order'], po.name) + self.assertIn(data[1]['rm_item_code'], ['_Test Item', '_Test Item Home Desktop 100']) + self.assertIn(data[1]['p_qty'], [9, 18]) + self.assertIn(data[1]['t_qty'], [1, 2]) + + +def transfer_subcontracted_raw_materials(po): + rm_item = [ + {'item_code': '_Test Item', 'rm_item_code': '_Test Item', 'item_name': '_Test Item', 'qty': 1, + 'warehouse': '_Test Warehouse - _TC', 'rate': 100, 'amount': 100, 'stock_uom': 'Nos'}, + {'item_code': '_Test Item Home Desktop 100', 'rm_item_code': '_Test Item Home Desktop 100', 'item_name': '_Test Item Home Desktop 100', 'qty': 2, + 'warehouse': '_Test Warehouse - _TC', 'rate': 100, 'amount': 200, 'stock_uom': 'Nos'}] + rm_item_string = json.dumps(rm_item) + se = frappe.get_doc(make_rm_stock_entry(po, rm_item_string)) + se.to_warehouse = '_Test Warehouse 1 - _TC' + se.stock_entry_type = 'Send to Subcontractor' + se.save() + se.submit() \ No newline at end of file From 321124aa72d765831947d3cb407f8ec309d71474 Mon Sep 17 00:00:00 2001 From: deepeshgarg007 Date: Wed, 8 May 2019 10:33:08 +0530 Subject: [PATCH 25/73] fix: Resolve merge conflict in json files --- .../material_request_item.json | 8 +++++++- .../purchase_receipt_item.json | 15 ++++++++++++++- 2 files changed, 21 insertions(+), 2 deletions(-) diff --git a/erpnext/stock/doctype/material_request_item/material_request_item.json b/erpnext/stock/doctype/material_request_item/material_request_item.json index 965c6fe844..7514805783 100644 --- a/erpnext/stock/doctype/material_request_item/material_request_item.json +++ b/erpnext/stock/doctype/material_request_item/material_request_item.json @@ -38,6 +38,7 @@ "projected_qty", "actual_qty", "ordered_qty", + "received_qty", "accounting_details", "expense_account", "column_break_35", @@ -364,11 +365,16 @@ { "fieldname": "section_break_37", "fieldtype": "Section Break" + }, + { + "fieldname": "received_qty", + "fieldtype": "Data", + "label": "Received Quantity" } ], "idx": 1, "istable": 1, - "modified": "2019-05-01 17:48:12.361976", + "modified": "2019-05-08 10:27:25.008801", "modified_by": "Administrator", "module": "Stock", "name": "Material Request Item", diff --git a/erpnext/stock/doctype/purchase_receipt_item/purchase_receipt_item.json b/erpnext/stock/doctype/purchase_receipt_item/purchase_receipt_item.json index f45d14836d..b3e75ac91a 100644 --- a/erpnext/stock/doctype/purchase_receipt_item/purchase_receipt_item.json +++ b/erpnext/stock/doctype/purchase_receipt_item/purchase_receipt_item.json @@ -64,7 +64,9 @@ "rejected_warehouse", "quality_inspection", "purchase_order", + "material_request", "purchase_order_item", + "material_request_item", "column_break_40", "is_fixed_asset", "asset", @@ -753,11 +755,22 @@ "fieldname": "image_section", "fieldtype": "Section Break", "label": "Image" + }, + { + "fieldname": "material_request", + "fieldtype": "Link", + "label": "Material Request", + "options": "Material Request" + }, + { + "fieldname": "material_request_item", + "fieldtype": "Data", + "label": "Material Request Item" } ], "idx": 1, "istable": 1, - "modified": "2019-05-01 17:45:17.447900", + "modified": "2019-05-08 10:25:27.157675", "modified_by": "Administrator", "module": "Stock", "name": "Purchase Receipt Item", From 0cb7024e55e29c665785292cfe1a0843ed893963 Mon Sep 17 00:00:00 2001 From: Rohit Waghchaure Date: Wed, 8 May 2019 14:49:11 +0530 Subject: [PATCH 26/73] fix: job card issue, added validation in the stock entry --- erpnext/stock/doctype/stock_entry/stock_entry.py | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/erpnext/stock/doctype/stock_entry/stock_entry.py b/erpnext/stock/doctype/stock_entry/stock_entry.py index f8d91a7642..d106ed126f 100644 --- a/erpnext/stock/doctype/stock_entry/stock_entry.py +++ b/erpnext/stock/doctype/stock_entry/stock_entry.py @@ -129,6 +129,10 @@ class StockEntry(StockController): if self.purpose not in valid_purposes: frappe.throw(_("Purpose must be one of {0}").format(comma_or(valid_purposes))) + if self.job_card and self.purpose != 'Material Transfer for Manufacture': + frappe.throw(_("For job card {0}, you can only make the 'Material Transfer for Manufacture' type stock entry") + .format(self.job_card)) + def set_transfer_qty(self): for item in self.get("items"): if not flt(item.qty): From 1d6f2c3b5d49957f4a434f9fa9c98e4f15b7937f Mon Sep 17 00:00:00 2001 From: Rohit Waghchaure Date: Tue, 23 Apr 2019 18:33:01 +0530 Subject: [PATCH 27/73] feat: Get invoiced item's gross margin using API --- .../report/gross_profit/gross_profit.js | 6 ++++++ .../report/gross_profit/gross_profit.py | 6 ++++++ erpnext/accounts/report/utils.py | 19 +++++++++++++++++++ 3 files changed, 31 insertions(+) diff --git a/erpnext/accounts/report/gross_profit/gross_profit.js b/erpnext/accounts/report/gross_profit/gross_profit.js index 1f7d24db1e..ba17a94e8d 100644 --- a/erpnext/accounts/report/gross_profit/gross_profit.js +++ b/erpnext/accounts/report/gross_profit/gross_profit.js @@ -23,6 +23,12 @@ frappe.query_reports["Gross Profit"] = { "fieldtype": "Date", "default": frappe.defaults.get_user_default("year_end_date") }, + { + "fieldname":"sales_invoice", + "label": __("Sales Invoice"), + "fieldtype": "Link", + "options": "Sales Invoice" + }, { "fieldname":"group_by", "label": __("Group By"), diff --git a/erpnext/accounts/report/gross_profit/gross_profit.py b/erpnext/accounts/report/gross_profit/gross_profit.py index a5859e31b0..9a02d1b8e8 100644 --- a/erpnext/accounts/report/gross_profit/gross_profit.py +++ b/erpnext/accounts/report/gross_profit/gross_profit.py @@ -302,6 +302,12 @@ class GrossProfitGenerator(object): sales_person_cols = "" sales_team_table = "" + if self.filters.get("sales_invoice"): + conditions += " and `tabSales Invoice`.name = %(sales_invoice)s" + + if self.filters.get("item_code"): + conditions += " and `tabSales Invoice Item`.item_code = %(item_code)s" + self.si_list = frappe.db.sql(""" select `tabSales Invoice Item`.parenttype, `tabSales Invoice Item`.parent, diff --git a/erpnext/accounts/report/utils.py b/erpnext/accounts/report/utils.py index 8500aea415..0b17c8f964 100644 --- a/erpnext/accounts/report/utils.py +++ b/erpnext/accounts/report/utils.py @@ -135,3 +135,22 @@ def get_appropriate_company(filters): company = get_default_company() return company + +@frappe.whitelist() +def get_invoiced_item_gross_margin(sales_invoice=None, item_code=None, company=None): + from erpnext.accounts.report.gross_profit.gross_profit import GrossProfitGenerator + + sales_invoice = sales_invoice or frappe.form_dict.get('sales_invoice') + item_code = item_code or frappe.form_dict.get('item_code') + company = company or frappe.get_cached_value("Sales Invoice", sales_invoice, 'company') + + filters = { + 'sales_invoice': sales_invoice, + 'item_code': item_code, + 'company': company, + 'group_by': 'Invoice' + } + + gross_profit_data = GrossProfitGenerator(filters) + + return gross_profit_data.grouped_data From 7bee502d72fac8eb5fd96679db0ce4b7880867b3 Mon Sep 17 00:00:00 2001 From: Rohit Waghchaure Date: Wed, 8 May 2019 15:31:29 +0530 Subject: [PATCH 28/73] fix: get totals of gross profit amount on call of the method get_invoiced_item_gross_margin --- erpnext/accounts/report/utils.py | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/erpnext/accounts/report/utils.py b/erpnext/accounts/report/utils.py index 0b17c8f964..4a9af490cf 100644 --- a/erpnext/accounts/report/utils.py +++ b/erpnext/accounts/report/utils.py @@ -137,7 +137,7 @@ def get_appropriate_company(filters): return company @frappe.whitelist() -def get_invoiced_item_gross_margin(sales_invoice=None, item_code=None, company=None): +def get_invoiced_item_gross_margin(sales_invoice=None, item_code=None, company=None, with_item_data=False): from erpnext.accounts.report.gross_profit.gross_profit import GrossProfitGenerator sales_invoice = sales_invoice or frappe.form_dict.get('sales_invoice') @@ -152,5 +152,8 @@ def get_invoiced_item_gross_margin(sales_invoice=None, item_code=None, company=N } gross_profit_data = GrossProfitGenerator(filters) + result = gross_profit_data.grouped_data + if not with_item_data: + result = sum([d.gross_profit for d in result]) - return gross_profit_data.grouped_data + return result From 374999b048896cd0f08656b0e1fd0d4fc49028c3 Mon Sep 17 00:00:00 2001 From: Shivam Mishra Date: Wed, 8 May 2019 17:30:08 +0530 Subject: [PATCH 29/73] feat: Password protected salary slips (#17380) * feat: Added check for encrypting salary slips and password policy field * feat: make password policy mandatory if encrypt option is selected * feat: added password logic to email_salary_slip * fix: import error * chore: Minor enhancement to validations in salary slip * fix: travis patch * feat: Modified email body for password protected salary slips --- erpnext/hr/doctype/hr_settings/hr_settings.js | 13 ++ .../hr/doctype/hr_settings/hr_settings.json | 116 +++++++++++++++++- erpnext/hr/doctype/hr_settings/hr_settings.py | 10 ++ erpnext/hr/doctype/salary_slip/salary_slip.py | 15 ++- erpnext/patches.txt | 1 + .../v11_0/set_default_email_template_in_hr.py | 1 - 6 files changed, 147 insertions(+), 9 deletions(-) diff --git a/erpnext/hr/doctype/hr_settings/hr_settings.js b/erpnext/hr/doctype/hr_settings/hr_settings.js index 6ab523eb76..58ce4226e9 100644 --- a/erpnext/hr/doctype/hr_settings/hr_settings.js +++ b/erpnext/hr/doctype/hr_settings/hr_settings.js @@ -4,5 +4,18 @@ frappe.ui.form.on('HR Settings', { refresh: function(frm) { + }, + + encrypt_salary_slips_in_emails: function(frm) { + let encrypt_state = frm.doc.encrypt_salary_slips_in_emails; + frm.set_df_property('password_policy', 'reqd', encrypt_state); + }, + + validate: function(frm) { + let policy = frm.doc.password_policy; + if (policy.includes(' ') || policy.includes('--')) { + frappe.msgprint("Password policy cannot contain spaces or simultaneous hyphens. The format will be restructured automatically"); + } + frm.set_value('password_policy', policy.split(new RegExp(" |-", 'g')).filter((token) => token).join('-')); } }); diff --git a/erpnext/hr/doctype/hr_settings/hr_settings.json b/erpnext/hr/doctype/hr_settings/hr_settings.json index 225785d305..5502ce81e3 100644 --- a/erpnext/hr/doctype/hr_settings/hr_settings.json +++ b/erpnext/hr/doctype/hr_settings/hr_settings.json @@ -1,5 +1,6 @@ { "allow_copy": 0, + "allow_events_in_timeline": 0, "allow_guest_to_view": 0, "allow_import": 0, "allow_rename": 0, @@ -13,10 +14,12 @@ "fields": [ { "allow_bulk_edit": 0, + "allow_in_quick_entry": 0, "allow_on_submit": 0, "bold": 0, "collapsible": 0, "columns": 0, + "fetch_if_empty": 0, "fieldname": "employee_settings", "fieldtype": "Section Break", "hidden": 0, @@ -43,12 +46,14 @@ }, { "allow_bulk_edit": 0, + "allow_in_quick_entry": 0, "allow_on_submit": 0, "bold": 0, "collapsible": 0, "columns": 0, "default": "", "description": "Enter retirement age in years", + "fetch_if_empty": 0, "fieldname": "retirement_age", "fieldtype": "Data", "hidden": 0, @@ -76,12 +81,14 @@ }, { "allow_bulk_edit": 0, + "allow_in_quick_entry": 0, "allow_on_submit": 0, "bold": 0, "collapsible": 0, "columns": 0, "default": "Naming Series", "description": "Employee record is created using selected field. ", + "fetch_if_empty": 0, "fieldname": "emp_created_by", "fieldtype": "Select", "hidden": 0, @@ -109,11 +116,13 @@ }, { "allow_bulk_edit": 0, + "allow_in_quick_entry": 0, "allow_on_submit": 0, "bold": 0, "collapsible": 0, "columns": 0, "default": "", + "fetch_if_empty": 0, "fieldname": "leave_approval_notification_template", "fieldtype": "Link", "hidden": 0, @@ -142,10 +151,12 @@ }, { "allow_bulk_edit": 0, + "allow_in_quick_entry": 0, "allow_on_submit": 0, "bold": 0, "collapsible": 0, "columns": 0, + "fetch_if_empty": 0, "fieldname": "leave_status_notification_template", "fieldtype": "Link", "hidden": 0, @@ -174,10 +185,12 @@ }, { "allow_bulk_edit": 0, + "allow_in_quick_entry": 0, "allow_on_submit": 0, "bold": 0, "collapsible": 0, "columns": 0, + "fetch_if_empty": 0, "fieldname": "column_break_4", "fieldtype": "Column Break", "hidden": 0, @@ -204,11 +217,13 @@ }, { "allow_bulk_edit": 0, + "allow_in_quick_entry": 0, "allow_on_submit": 0, "bold": 0, "collapsible": 0, "columns": 0, "description": "Don't send Employee Birthday Reminders", + "fetch_if_empty": 0, "fieldname": "stop_birthday_reminders", "fieldtype": "Check", "hidden": 0, @@ -235,10 +250,12 @@ }, { "allow_bulk_edit": 0, + "allow_in_quick_entry": 0, "allow_on_submit": 0, "bold": 0, "collapsible": 0, "columns": 0, + "fetch_if_empty": 0, "fieldname": "maintain_bill_work_hours_same", "fieldtype": "Check", "hidden": 0, @@ -266,11 +283,13 @@ }, { "allow_bulk_edit": 0, + "allow_in_quick_entry": 0, "allow_on_submit": 0, "bold": 0, "collapsible": 0, "columns": 0, "default": "1", + "fetch_if_empty": 0, "fieldname": "leave_approver_mandatory_in_leave_application", "fieldtype": "Check", "hidden": 0, @@ -298,11 +317,13 @@ }, { "allow_bulk_edit": 0, + "allow_in_quick_entry": 0, "allow_on_submit": 0, "bold": 0, "collapsible": 0, "columns": 0, "default": "1", + "fetch_if_empty": 0, "fieldname": "expense_approver_mandatory_in_expense_claim", "fieldtype": "Check", "hidden": 0, @@ -330,10 +351,13 @@ }, { "allow_bulk_edit": 0, + "allow_in_quick_entry": 0, "allow_on_submit": 0, "bold": 0, "collapsible": 0, "columns": 0, + "depends_on": "", + "fetch_if_empty": 0, "fieldname": "payroll_settings", "fieldtype": "Section Break", "hidden": 0, @@ -360,11 +384,13 @@ }, { "allow_bulk_edit": 0, + "allow_in_quick_entry": 0, "allow_on_submit": 0, "bold": 0, "collapsible": 0, "columns": 0, "description": "If checked, Total no. of Working Days will include holidays, and this will reduce the value of Salary Per Day", + "fetch_if_empty": 0, "fieldname": "include_holidays_in_total_working_days", "fieldtype": "Check", "hidden": 0, @@ -391,12 +417,14 @@ }, { "allow_bulk_edit": 0, + "allow_in_quick_entry": 0, "allow_on_submit": 0, "bold": 0, "collapsible": 0, "columns": 0, "default": "1", "description": "Emails salary slip to employee based on preferred email selected in Employee", + "fetch_if_empty": 0, "fieldname": "email_salary_slip_to_employee", "fieldtype": "Check", "hidden": 0, @@ -424,10 +452,82 @@ }, { "allow_bulk_edit": 0, + "allow_in_quick_entry": 0, "allow_on_submit": 0, "bold": 0, "collapsible": 0, "columns": 0, + "depends_on": "eval: doc.email_salary_slip_to_employee == 1;", + "description": "The salary slip emailed to the employee will be password protected, the password will be generated based on the password policy.", + "fetch_if_empty": 0, + "fieldname": "encrypt_salary_slips_in_emails", + "fieldtype": "Check", + "hidden": 0, + "ignore_user_permissions": 0, + "ignore_xss_filter": 0, + "in_filter": 0, + "in_global_search": 0, + "in_list_view": 0, + "in_standard_filter": 0, + "label": "Encrypt Salary Slips in Emails", + "length": 0, + "no_copy": 0, + "permlevel": 0, + "precision": "", + "print_hide": 0, + "print_hide_if_no_value": 0, + "read_only": 0, + "remember_last_selected_value": 0, + "report_hide": 0, + "reqd": 0, + "search_index": 0, + "set_only_once": 0, + "translatable": 0, + "unique": 0 + }, + { + "allow_bulk_edit": 0, + "allow_in_quick_entry": 0, + "allow_on_submit": 0, + "bold": 0, + "collapsible": 0, + "columns": 0, + "depends_on": "eval: doc.encrypt_salary_slips_in_emails == 1", + "description": "Example: SAL-{first_name}-{date_of_birth.year}
This will generate a password like SAL-Jane-1972", + "fetch_if_empty": 0, + "fieldname": "password_policy", + "fieldtype": "Data", + "hidden": 0, + "ignore_user_permissions": 0, + "ignore_xss_filter": 0, + "in_filter": 0, + "in_global_search": 0, + "in_list_view": 1, + "in_standard_filter": 0, + "label": "Password Policy", + "length": 0, + "no_copy": 0, + "permlevel": 0, + "precision": "", + "print_hide": 0, + "print_hide_if_no_value": 0, + "read_only": 0, + "remember_last_selected_value": 0, + "report_hide": 0, + "reqd": 0, + "search_index": 0, + "set_only_once": 0, + "translatable": 0, + "unique": 0 + }, + { + "allow_bulk_edit": 0, + "allow_in_quick_entry": 0, + "allow_on_submit": 0, + "bold": 0, + "collapsible": 0, + "columns": 0, + "fetch_if_empty": 0, "fieldname": "max_working_hours_against_timesheet", "fieldtype": "Float", "hidden": 0, @@ -455,10 +555,12 @@ }, { "allow_bulk_edit": 0, + "allow_in_quick_entry": 0, "allow_on_submit": 0, "bold": 0, "collapsible": 0, "columns": 0, + "fetch_if_empty": 0, "fieldname": "leave_settings", "fieldtype": "Section Break", "hidden": 0, @@ -481,14 +583,17 @@ "reqd": 0, "search_index": 0, "set_only_once": 0, + "translatable": 0, "unique": 0 }, { "allow_bulk_edit": 0, + "allow_in_quick_entry": 0, "allow_on_submit": 0, "bold": 0, "collapsible": 0, "columns": 0, + "fetch_if_empty": 0, "fieldname": "show_leaves_of_all_department_members_in_calendar", "fieldtype": "Check", "hidden": 0, @@ -511,22 +616,21 @@ "reqd": 0, "search_index": 0, "set_only_once": 0, + "translatable": 0, "unique": 0 } ], "has_web_view": 0, - "hide_heading": 0, "hide_toolbar": 0, "icon": "fa fa-cog", "idx": 1, - "image_view": 0, "in_create": 0, "is_submittable": 0, "issingle": 1, "istable": 0, "max_attachments": 0, - "modified": "2018-05-03 15:36:13.015466", - "modified_by": "Administrator", + "modified": "2019-04-25 15:08:12.983571", + "modified_by": "shivam@example.com", "module": "HR", "name": "HR Settings", "owner": "Administrator", @@ -553,9 +657,9 @@ ], "quick_entry": 0, "read_only": 0, - "read_only_onload": 0, "show_name_in_global_search": 0, "sort_order": "ASC", "track_changes": 0, - "track_seen": 0 + "track_seen": 0, + "track_views": 0 } \ No newline at end of file diff --git a/erpnext/hr/doctype/hr_settings/hr_settings.py b/erpnext/hr/doctype/hr_settings/hr_settings.py index 964eaee7ed..78095b3086 100644 --- a/erpnext/hr/doctype/hr_settings/hr_settings.py +++ b/erpnext/hr/doctype/hr_settings/hr_settings.py @@ -5,11 +5,21 @@ from __future__ import unicode_literals import frappe +from frappe import _ from frappe.model.document import Document class HRSettings(Document): def validate(self): + self.set_naming_series() + self.validate_password_policy() + + def set_naming_series(self): from erpnext.setup.doctype.naming_series.naming_series import set_by_naming_series set_by_naming_series("Employee", "employee_number", self.get("emp_created_by")=="Naming Series", hide_name_field=True) + + def validate_password_policy(self): + if self.email_salary_slip_to_employee and self.encrypt_salary_slips_in_emails: + if not self.password_policy: + frappe.throw(_("Password policy for Salary Slips is not set")) \ No newline at end of file diff --git a/erpnext/hr/doctype/salary_slip/salary_slip.py b/erpnext/hr/doctype/salary_slip/salary_slip.py index fbfa3af6cd..5f6ddfc8fc 100644 --- a/erpnext/hr/doctype/salary_slip/salary_slip.py +++ b/erpnext/hr/doctype/salary_slip/salary_slip.py @@ -520,13 +520,20 @@ class SalarySlip(TransactionBase): def email_salary_slip(self): receiver = frappe.db.get_value("Employee", self.employee, "prefered_email") + hr_settings = frappe.get_single("HR Settings") + message = "Please see attachment" + password = None + if hr_settings.encrypt_salary_slips_in_emails: + password = generate_password_for_pdf(hr_settings.password_policy, self.employee) + message += """
Note: Your salary slip is password protected, + the password to unlock the PDF is of the format {0}. """.format(hr_settings.password_policy) if receiver: email_args = { "recipients": [receiver], - "message": _("Please see attachment"), + "message": _(message), "subject": 'Salary Slip - from {0} to {1}'.format(self.start_date, self.end_date), - "attachments": [frappe.attach_print(self.doctype, self.name, file_name=self.name)], + "attachments": [frappe.attach_print(self.doctype, self.name, file_name=self.name, password=password)], "reference_doctype": self.doctype, "reference_name": self.name } @@ -843,3 +850,7 @@ def unlink_ref_doc_from_salary_slip(ref_no): for ss in linked_ss: ss_doc = frappe.get_doc("Salary Slip", ss) frappe.db.set_value("Salary Slip", ss_doc.name, "journal_entry", "") + +def generate_password_for_pdf(policy_template, employee): + employee = frappe.get_doc("Employee", employee) + return policy_template.format(**employee.as_dict()) diff --git a/erpnext/patches.txt b/erpnext/patches.txt index 01270e4779..bdc1ed4f10 100644 --- a/erpnext/patches.txt +++ b/erpnext/patches.txt @@ -512,6 +512,7 @@ erpnext.patches.v11_0.rename_employee_loan_to_loan erpnext.patches.v11_0.move_leave_approvers_from_employee #13-06-2018 erpnext.patches.v11_0.update_department_lft_rgt erpnext.patches.v11_0.add_default_email_template_for_leave +execute:frappe.reload_doc("HR", "doctype", "HR Settings") erpnext.patches.v11_0.set_default_email_template_in_hr #08-06-2018 erpnext.patches.v11_0.uom_conversion_data #30-06-2018 erpnext.patches.v10_0.taxes_issue_with_pos diff --git a/erpnext/patches/v11_0/set_default_email_template_in_hr.py b/erpnext/patches/v11_0/set_default_email_template_in_hr.py index e895eaeb65..14954fbeb3 100644 --- a/erpnext/patches/v11_0/set_default_email_template_in_hr.py +++ b/erpnext/patches/v11_0/set_default_email_template_in_hr.py @@ -2,7 +2,6 @@ from __future__ import unicode_literals import frappe def execute(): - hr_settings = frappe.get_single("HR Settings") hr_settings.leave_approval_notification_template = "Leave Approval Notification" hr_settings.leave_status_notification_template = "Leave Status Notification" From 2097916d9e189b5ec3aac75bf6a4efe8a9e630e6 Mon Sep 17 00:00:00 2001 From: deepeshgarg007 Date: Thu, 9 May 2019 12:15:29 +0530 Subject: [PATCH 30/73] fix: Invoice type fixes in gstr-1 report --- erpnext/regional/report/gstr_1/gstr_1.py | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/erpnext/regional/report/gstr_1/gstr_1.py b/erpnext/regional/report/gstr_1/gstr_1.py index a29d5b48a9..f6c4782e24 100644 --- a/erpnext/regional/report/gstr_1/gstr_1.py +++ b/erpnext/regional/report/gstr_1/gstr_1.py @@ -29,10 +29,10 @@ class Gstr1Report(object): place_of_supply, ecommerce_gstin, reverse_charge, - gst_category, + invoice_type, return_against, is_return, - gst_category, + invoice_type, export_type, port_code, shipping_bill_number, @@ -324,8 +324,8 @@ class Gstr1Report(object): "fieldtype": "Data" }, { - "fieldname": "gst_category", - "label": "GST Category", + "fieldname": "invoice_type", + "label": "Invoice Type", "fieldtype": "Data" }, { @@ -577,7 +577,7 @@ def get_json(): download_json_file(report_name, filters["type_of_business"], gst_json) def get_b2b_json(res, gstin): - inv_type, out = {"Registered Regular": "R", "Deemed Export": "DE", "URD": "URD", "SEZ": "SEZ"}, [] + inv_type, out = {"Regular": "R", "Deemed Export": "DE", "URD": "URD", "SEZ": "SEZ"}, [] for gst_in in res: b2b_item, inv = {"ctin": gst_in, "inv": []}, [] if not gst_in: continue @@ -586,7 +586,7 @@ def get_b2b_json(res, gstin): inv_item = get_basic_invoice_detail(invoice[0]) inv_item["pos"] = "%02d" % int(invoice[0]["place_of_supply"].split('-')[0]) inv_item["rchrg"] = invoice[0]["reverse_charge"] - inv_item["inv_typ"] = inv_type.get(invoice[0].get("gst_category", ""),"") + inv_item["inv_typ"] = inv_type.get(invoice[0].get("invoice_type", ""),"") if inv_item["pos"]=="00": continue inv_item["itms"] = [] From 19c88029717371748c69c5706611835818620c0d Mon Sep 17 00:00:00 2001 From: deepeshgarg007 Date: Thu, 9 May 2019 12:15:56 +0530 Subject: [PATCH 31/73] fix: Precision fixes in gstr3b-report --- .../doctype/gstr_3b_report/gstr_3b_report.py | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/erpnext/regional/doctype/gstr_3b_report/gstr_3b_report.py b/erpnext/regional/doctype/gstr_3b_report/gstr_3b_report.py index 7faabf43ec..01da810d76 100644 --- a/erpnext/regional/doctype/gstr_3b_report/gstr_3b_report.py +++ b/erpnext/regional/doctype/gstr_3b_report/gstr_3b_report.py @@ -227,18 +227,18 @@ class GSTR3BReport(Document): for d in inter_state_supply.get("Unregistered", []): self.report_dict["inter_sup"]["unreg_details"].append(d) - self.report_dict["sup_details"]["osup_det"]["txval"] += d["txval"] - self.report_dict["sup_details"]["osup_det"]["iamt"] += d["iamt"] + self.report_dict["sup_details"]["osup_det"]["txval"] += flt(d["txval"], 2) + self.report_dict["sup_details"]["osup_det"]["iamt"] += flt(d["iamt"], 2) for d in inter_state_supply.get("Registered Composition", []): self.report_dict["inter_sup"]["comp_details"].append(d) - self.report_dict["sup_details"]["osup_det"]["txval"] += d["txval"] - self.report_dict["sup_details"]["osup_det"]["iamt"] += d["iamt"] + self.report_dict["sup_details"]["osup_det"]["txval"] += flt(d["txval"], 2) + self.report_dict["sup_details"]["osup_det"]["iamt"] += flt(d["iamt"], 2) for d in inter_state_supply.get("UIN Holders", []): self.report_dict["inter_sup"]["uin_details"].append(d) - self.report_dict["sup_details"]["osup_det"]["txval"] += d["txval"] - self.report_dict["sup_details"]["osup_det"]["iamt"] += d["iamt"] + self.report_dict["sup_details"]["osup_det"]["txval"] += flt(d["txval"], 2) + self.report_dict["sup_details"]["osup_det"]["iamt"] += flt(d["iamt"], 2) def get_total_taxable_value(self, doctype, reverse_charge): From 73e281d3396cfc6cf201108e942538247ec66898 Mon Sep 17 00:00:00 2001 From: Sahil Khan Date: Thu, 9 May 2019 14:32:15 +0530 Subject: [PATCH 32/73] feat(sync_site): return more data in level --- erpnext/utilities/activation.py | 49 ++++++++++++--------------------- 1 file changed, 17 insertions(+), 32 deletions(-) diff --git a/erpnext/utilities/activation.py b/erpnext/utilities/activation.py index 5f261fac13..63c36b35d1 100644 --- a/erpnext/utilities/activation.py +++ b/erpnext/utilities/activation.py @@ -5,50 +5,35 @@ from __future__ import unicode_literals import frappe, erpnext from frappe import _ +from six import iteritems def get_level(): activation_level = 0 + sales_data = [] + min_count = 0 + doctypes = {"Item": 5, "Customer": 5, "Sales Order": 2, "Sales Invoice": 2, "Purchase Order": 2, "Employee": 3, "Lead": 3, "Quotation": 3, + "Payment Entry": 2, "User": 5, "Student": 5, "Instructor": 5, "BOM": 3, "Journal Entry": 3, "Stock Entry": 3} + for doctype, min_count in iteritems(doctypes): + count = frappe.db.count(doctype) + if count > min_count: + activation_level += 1 + sales_data.append({doctype: count}) + if frappe.db.get_single_value('System Settings', 'setup_complete'): - activation_level = 1 - - if frappe.db.count('Item') > 5: activation_level += 1 - if frappe.db.count('Customer') > 5: - activation_level += 1 - - if frappe.db.count('Sales Order') > 2: - activation_level += 1 - - if frappe.db.count('Purchase Order') > 2: - activation_level += 1 - - if frappe.db.count('Employee') > 3: - activation_level += 1 - - if frappe.db.count('Lead') > 3: - activation_level += 1 - - if frappe.db.count('Payment Entry') > 2: - activation_level += 1 - - if frappe.db.count('Communication', dict(communication_medium='Email')) > 10: - activation_level += 1 - - if frappe.db.count('User') > 5: - activation_level += 1 - - if frappe.db.count('Student') > 5: - activation_level += 1 - - if frappe.db.count('Instructor') > 5: + communication_number = frappe.db.count('Communication', dict(communication_medium='Email')) + if communication_number > 10: activation_level += 1 + sales_data.append({"Communication": communication_number}) # recent login if frappe.db.sql('select name from tabUser where last_login > date_sub(now(), interval 2 day) limit 1'): activation_level += 1 - return activation_level + level = {"activation_level": activation_level, "sales_data": sales_data} + + return level def get_help_messages(): '''Returns help messages to be shown on Desktop''' From 6b9543b21315e0bdc3457cad80d2335ef27c1241 Mon Sep 17 00:00:00 2001 From: Rohit Waghchaure Date: Thu, 9 May 2019 19:04:58 +0530 Subject: [PATCH 33/73] fix: project update status emails sent frequently --- erpnext/projects/doctype/project/project.py | 17 +++++++++++------ 1 file changed, 11 insertions(+), 6 deletions(-) diff --git a/erpnext/projects/doctype/project/project.py b/erpnext/projects/doctype/project/project.py index 61db3e118a..148b7015eb 100644 --- a/erpnext/projects/doctype/project/project.py +++ b/erpnext/projects/doctype/project/project.py @@ -485,16 +485,17 @@ def daily_reminder(): projects = get_projects_for_collect_progress("Daily", fields) for project in projects: - if not check_project_update_exists(project.name, project.get("daily_time_to_send")): + if allow_to_make_project_update(project.name, project.get("daily_time_to_send"), "Daily"): send_project_update_email_to_users(project.name) def twice_daily_reminder(): fields = ["first_email", "second_email"] projects = get_projects_for_collect_progress("Twice Daily", fields) + fields.remove("name") for project in projects: for d in fields: - if not check_project_update_exists(project.name, project.get(d)): + if allow_to_make_project_update(project.name, project.get(d), "Twicely"): send_project_update_email_to_users(project.name) def weekly_reminder(): @@ -506,14 +507,18 @@ def weekly_reminder(): if current_day != project.day_to_send: continue - if not check_project_update_exists(project.name, project.get("weekly_time_to_send")): + if allow_to_make_project_update(project.name, project.get("weekly_time_to_send"), "Weekly"): send_project_update_email_to_users(project.name) -def check_project_update_exists(project, time): +def allow_to_make_project_update(project, time, frequency): data = frappe.db.sql(""" SELECT name from `tabProject Update` - WHERE project = %s and date = %s and time >= %s """, (project, today(), time)) + WHERE project = %s and date = %s """, (project, today())) - return True if data and data[0][0] else False + if data and (frequency in ['Daily', 'Weekly'] or len(data) > 1): + return False + + if get_time(nowtime()) >= get_time(time): + return True def get_projects_for_collect_progress(frequency, fields): fields.extend(["name"]) From 2df91addd7f1bbe007ecfadaaad1914aa4acb114 Mon Sep 17 00:00:00 2001 From: Suraj Shetty Date: Thu, 9 May 2019 18:49:57 +0530 Subject: [PATCH 34/73] perf: Index show_in_website field for faster item search --- erpnext/stock/doctype/item/item.json | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/erpnext/stock/doctype/item/item.json b/erpnext/stock/doctype/item/item.json index 9d0bd9d506..07063444a1 100644 --- a/erpnext/stock/doctype/item/item.json +++ b/erpnext/stock/doctype/item/item.json @@ -3552,7 +3552,7 @@ "remember_last_selected_value": 0, "report_hide": 0, "reqd": 0, - "search_index": 0, + "search_index": 1, "set_only_once": 0, "translatable": 0, "unique": 0 @@ -3585,7 +3585,7 @@ "remember_last_selected_value": 0, "report_hide": 0, "reqd": 0, - "search_index": 0, + "search_index": 1, "set_only_once": 0, "translatable": 0, "unique": 0 @@ -4272,7 +4272,7 @@ "issingle": 0, "istable": 0, "max_attachments": 1, - "modified": "2019-04-08 11:47:59.269724", + "modified": "2019-05-09 18:47:30.475833", "modified_by": "Administrator", "module": "Stock", "name": "Item", From 4a267b9340e39fb83bd8839371bb486ca732309b Mon Sep 17 00:00:00 2001 From: Rohit Waghchaure Date: Thu, 9 May 2019 19:50:00 +0530 Subject: [PATCH 35/73] fix: incorrect payment amount in the payment terms if the sales invoice has the advance amount --- erpnext/controllers/accounts_controller.py | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/erpnext/controllers/accounts_controller.py b/erpnext/controllers/accounts_controller.py index 155a996a15..0672b2d0cc 100644 --- a/erpnext/controllers/accounts_controller.py +++ b/erpnext/controllers/accounts_controller.py @@ -787,6 +787,9 @@ class AccountsController(TransactionBase): if self.doctype in ("Sales Invoice", "Purchase Invoice"): grand_total = grand_total - flt(self.write_off_amount) + if self.get("total_advance"): + grand_total -= self.get("total_advance") + if not self.get("payment_schedule"): if self.get("payment_terms_template"): data = get_payment_terms(self.payment_terms_template, posting_date, grand_total) @@ -832,6 +835,9 @@ class AccountsController(TransactionBase): total = flt(total, self.precision("grand_total")) grand_total = flt(self.get("rounded_total") or self.grand_total, self.precision('grand_total')) + if self.get("total_advance"): + grand_total -= self.get("total_advance") + if self.doctype in ("Sales Invoice", "Purchase Invoice"): grand_total = grand_total - flt(self.write_off_amount) if total != grand_total: From 490411ba28236a2f69b8320414ae189e342633b0 Mon Sep 17 00:00:00 2001 From: rohitwaghchaure Date: Fri, 10 May 2019 12:03:20 +0530 Subject: [PATCH 36/73] Update project.py --- erpnext/projects/doctype/project/project.py | 1 + 1 file changed, 1 insertion(+) diff --git a/erpnext/projects/doctype/project/project.py b/erpnext/projects/doctype/project/project.py index 148b7015eb..a66fac31c5 100644 --- a/erpnext/projects/doctype/project/project.py +++ b/erpnext/projects/doctype/project/project.py @@ -514,6 +514,7 @@ def allow_to_make_project_update(project, time, frequency): data = frappe.db.sql(""" SELECT name from `tabProject Update` WHERE project = %s and date = %s """, (project, today())) + # len(data) > 1 condition is checked for twicely frequency if data and (frequency in ['Daily', 'Weekly'] or len(data) > 1): return False From 5c27791382d5cea5731e6e0564ca944a6d6d5c42 Mon Sep 17 00:00:00 2001 From: Rohit Waghchaure Date: Fri, 10 May 2019 13:42:38 +0530 Subject: [PATCH 37/73] fix: test cases --- .../doctype/purchase_invoice/test_purchase_invoice.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/erpnext/accounts/doctype/purchase_invoice/test_purchase_invoice.py b/erpnext/accounts/doctype/purchase_invoice/test_purchase_invoice.py index dde12d79c7..b4d584fbde 100644 --- a/erpnext/accounts/doctype/purchase_invoice/test_purchase_invoice.py +++ b/erpnext/accounts/doctype/purchase_invoice/test_purchase_invoice.py @@ -402,9 +402,9 @@ class TestPurchaseInvoice(unittest.TestCase): pi.save() pi.submit() - self.assertEqual(pi.payment_schedule[0].payment_amount, 756.15) + self.assertEqual(pi.payment_schedule[0].payment_amount, 606.15) self.assertEqual(pi.payment_schedule[0].due_date, pi.posting_date) - self.assertEqual(pi.payment_schedule[1].payment_amount, 756.15) + self.assertEqual(pi.payment_schedule[1].payment_amount, 606.15) self.assertEqual(pi.payment_schedule[1].due_date, add_days(pi.posting_date, 30)) pi.load_from_db() From 699f132d053aaa9d3a1a08f84400192683556029 Mon Sep 17 00:00:00 2001 From: Suraj Shetty Date: Thu, 9 May 2019 14:16:49 +0530 Subject: [PATCH 38/73] fix: Show "Merge Account" button only to users with write access --- erpnext/accounts/doctype/account/account.js | 17 ++++++++--------- 1 file changed, 8 insertions(+), 9 deletions(-) diff --git a/erpnext/accounts/doctype/account/account.js b/erpnext/accounts/doctype/account/account.js index bb059f673c..f7f1a5fb15 100644 --- a/erpnext/accounts/doctype/account/account.js +++ b/erpnext/accounts/doctype/account/account.js @@ -42,15 +42,14 @@ frappe.ui.form.on('Account', { // show / hide convert buttons frm.trigger('add_toolbar_buttons'); } - frm.add_custom_button(__('Update Account Name / Number'), function () { - frm.trigger("update_account_number"); - }); - } - - if(!frm.doc.__islocal) { - frm.add_custom_button(__('Merge Account'), function () { - frm.trigger("merge_account"); - }); + if (frm.has_perm('write')) { + frm.add_custom_button(__('Update Account Name / Number'), function () { + frm.trigger("update_account_number"); + }); + frm.add_custom_button(__('Merge Account'), function () { + frm.trigger("merge_account"); + }); + } } }, account_type: function (frm) { From b68ae15dec42413e47a985d031e90f5dd8b4b9ba Mon Sep 17 00:00:00 2001 From: Suraj Shetty Date: Thu, 9 May 2019 14:18:41 +0530 Subject: [PATCH 39/73] fix: Check permissions before renaming the account --- erpnext/accounts/doctype/account/account.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/erpnext/accounts/doctype/account/account.py b/erpnext/accounts/doctype/account/account.py index ecf67dd1db..68efe37719 100644 --- a/erpnext/accounts/doctype/account/account.py +++ b/erpnext/accounts/doctype/account/account.py @@ -268,7 +268,7 @@ def update_account_number(name, account_name, account_number=None): new_name = get_account_autoname(account_number, account_name, account.company) if name != new_name: - frappe.rename_doc("Account", name, new_name, ignore_permissions=1) + frappe.rename_doc("Account", name, new_name, force=1) return new_name @frappe.whitelist() @@ -287,7 +287,7 @@ def merge_account(old, new, is_group, root_type, company): frappe.db.set_value("Account", new, "parent_account", frappe.db.get_value("Account", old, "parent_account")) - frappe.rename_doc("Account", old, new, merge=1, ignore_permissions=1) + frappe.rename_doc("Account", old, new, merge=1, force=1) return new From 9778ff8ab3a47e35c079fb8efff3dab31cb92540 Mon Sep 17 00:00:00 2001 From: Rohan Bansal Date: Fri, 10 May 2019 15:48:14 +0530 Subject: [PATCH 40/73] feat(crm): Allow leads to be imported without person name --- erpnext/crm/doctype/lead/lead.js | 50 +++++++++++++++--------------- erpnext/crm/doctype/lead/lead.json | 9 +++--- erpnext/crm/doctype/lead/lead.py | 8 +++-- 3 files changed, 36 insertions(+), 31 deletions(-) diff --git a/erpnext/crm/doctype/lead/lead.js b/erpnext/crm/doctype/lead/lead.js index 208b1f55fa..8c1ab2f38f 100644 --- a/erpnext/crm/doctype/lead/lead.js +++ b/erpnext/crm/doctype/lead/lead.js @@ -5,29 +5,32 @@ frappe.provide("erpnext"); cur_frm.email_field = "email_id"; erpnext.LeadController = frappe.ui.form.Controller.extend({ - setup: function() { - this.frm.fields_dict.customer.get_query = function(doc, cdt, cdn) { - return { query: "erpnext.controllers.queries.customer_query" } } + setup: function () { + this.frm.fields_dict.customer.get_query = function (doc, cdt, cdn) { + return { query: "erpnext.controllers.queries.customer_query" } + } + + this.frm.toggle_reqd("lead_name", !this.frm.doc.organization_lead); }, - onload: function() { - - if(cur_frm.fields_dict.lead_owner.df.options.match(/^User/)) { - cur_frm.fields_dict.lead_owner.get_query = function(doc, cdt, cdn) { + onload: function () { + if (cur_frm.fields_dict.lead_owner.df.options.match(/^User/)) { + cur_frm.fields_dict.lead_owner.get_query = function (doc, cdt, cdn) { return { query: "frappe.core.doctype.user.user.user_query" } } } - if(cur_frm.fields_dict.contact_by.df.options.match(/^User/)) { - cur_frm.fields_dict.contact_by.get_query = function(doc, cdt, cdn) { - return { query: "frappe.core.doctype.user.user.user_query" } } + if (cur_frm.fields_dict.contact_by.df.options.match(/^User/)) { + cur_frm.fields_dict.contact_by.get_query = function (doc, cdt, cdn) { + return { query: "frappe.core.doctype.user.user.user_query" } + } } }, - refresh: function() { + refresh: function () { var doc = this.frm.doc; erpnext.toggle_naming_series(); - frappe.dynamic_link = {doc: doc, fieldname: 'name', doctype: 'Lead'} + frappe.dynamic_link = { doc: doc, fieldname: 'name', doctype: 'Lead' } if(!doc.__islocal && doc.__onload && !doc.__onload.is_customer) { this.frm.add_custom_button(__("Customer"), this.create_customer, __('Create')); @@ -35,49 +38,46 @@ erpnext.LeadController = frappe.ui.form.Controller.extend({ this.frm.add_custom_button(__("Quotation"), this.make_quotation, __('Create')); } - if(!this.frm.doc.__islocal) { + if (!this.frm.doc.__islocal) { frappe.contacts.render_address_and_contact(cur_frm); } else { frappe.contacts.clear_address_and_contact(cur_frm); } }, - create_customer: function() { + create_customer: function () { frappe.model.open_mapped_doc({ method: "erpnext.crm.doctype.lead.lead.make_customer", frm: cur_frm }) }, - create_opportunity: function() { + create_opportunity: function () { frappe.model.open_mapped_doc({ method: "erpnext.crm.doctype.lead.lead.make_opportunity", frm: cur_frm }) }, - make_quotation: function() { + make_quotation: function () { frappe.model.open_mapped_doc({ method: "erpnext.crm.doctype.lead.lead.make_quotation", frm: cur_frm }) }, - organization_lead: function() { - if (this.frm.doc.organization_lead == 1) { - this.frm.set_df_property('company_name', 'reqd', 1); - } else { - this.frm.set_df_property('company_name', 'reqd', 0); - } + organization_lead: function () { + this.frm.toggle_reqd("lead_name", !this.frm.doc.organization_lead); + this.frm.toggle_reqd("company_name", this.frm.doc.organization_lead); }, - company_name: function() { + company_name: function () { if (this.frm.doc.organization_lead == 1) { this.frm.set_value("lead_name", this.frm.doc.company_name); } }, - contact_date: function() { + contact_date: function () { if (this.frm.doc.contact_date) { let d = moment(this.frm.doc.contact_date); d.add(1, "hours"); @@ -86,4 +86,4 @@ erpnext.LeadController = frappe.ui.form.Controller.extend({ } }); -$.extend(cur_frm.cscript, new erpnext.LeadController({frm: cur_frm})); +$.extend(cur_frm.cscript, new erpnext.LeadController({ frm: cur_frm })); diff --git a/erpnext/crm/doctype/lead/lead.json b/erpnext/crm/doctype/lead/lead.json index f1c2a9b4f1..600e070b7c 100644 --- a/erpnext/crm/doctype/lead/lead.json +++ b/erpnext/crm/doctype/lead/lead.json @@ -145,7 +145,7 @@ "read_only": 0, "remember_last_selected_value": 0, "report_hide": 0, - "reqd": 1, + "reqd": 0, "search_index": 1, "set_only_once": 0, "translatable": 0, @@ -268,7 +268,7 @@ "ignore_xss_filter": 0, "in_filter": 0, "in_global_search": 0, - "in_list_view": 0, + "in_list_view": 1, "in_standard_filter": 0, "label": "Lead Owner", "length": 0, @@ -1419,17 +1419,18 @@ } ], "has_web_view": 0, + "hide_heading": 0, "hide_toolbar": 0, "icon": "fa fa-user", "idx": 5, "image_field": "image", + "image_view": 0, "in_create": 0, "is_submittable": 0, "issingle": 0, "istable": 0, "max_attachments": 0, - "menu_index": 0, - "modified": "2019-04-11 22:12:50.029368", + "modified": "2019-05-10 03:22:57.283628", "modified_by": "Administrator", "module": "CRM", "name": "Lead", diff --git a/erpnext/crm/doctype/lead/lead.py b/erpnext/crm/doctype/lead/lead.py index d42502dc3b..6e98ebb6c0 100644 --- a/erpnext/crm/doctype/lead/lead.py +++ b/erpnext/crm/doctype/lead/lead.py @@ -109,7 +109,11 @@ class Lead(SellingController): def set_lead_name(self): if not self.lead_name: - frappe.db.set_value("Lead", self.name, "lead_name", self.company_name) + # Check for leads being created through data import + if not self.company_name: + frappe.throw(_("A Lead requires either a person's name or an organization's name")) + + self.lead_name = self.company_name @frappe.whitelist() def make_customer(source_name, target_doc=None): @@ -225,4 +229,4 @@ def make_lead_from_communication(communication, ignore_communication_links=False lead_name = lead.name link_communication_to_document(doc, "Lead", lead_name, ignore_communication_links) - return lead_name \ No newline at end of file + return lead_name From b4e8128fdb2f9a2fba64c8616172b1fb1f41b58c Mon Sep 17 00:00:00 2001 From: Mangesh-Khairnar Date: Sat, 11 May 2019 23:26:47 +0530 Subject: [PATCH 41/73] feat: validate training event period --- erpnext/hr/doctype/training_event/training_event.py | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/erpnext/hr/doctype/training_event/training_event.py b/erpnext/hr/doctype/training_event/training_event.py index 1b13b70f5b..5064f03308 100644 --- a/erpnext/hr/doctype/training_event/training_event.py +++ b/erpnext/hr/doctype/training_event/training_event.py @@ -5,9 +5,19 @@ from __future__ import unicode_literals import frappe from frappe.model.document import Document +from frappe import _ +from frappe.utils import time_diff_in_seconds from erpnext.hr.doctype.employee.employee import get_employee_emails class TrainingEvent(Document): def validate(self): + self.set_employee_emails() + self.validate_period() + + def set_employee_emails(self): self.employee_emails = ', '.join(get_employee_emails([d.employee for d in self.employees])) + + def validate_period(self): + if time_diff_in_seconds(self.end_time, self.start_time) <= 0: + frappe.throw(_('End time cannot be before start time')) \ No newline at end of file From 7c12cfcb635017d45fe869859036dd01f14953fe Mon Sep 17 00:00:00 2001 From: deepeshgarg007 Date: Sat, 11 May 2019 21:12:51 +0530 Subject: [PATCH 42/73] fix: Show all territories and items in inactive sales item report --- .../inactive_sales_items.js | 6 +++ .../inactive_sales_items.py | 54 +++++++++++-------- 2 files changed, 37 insertions(+), 23 deletions(-) diff --git a/erpnext/accounts/report/inactive_sales_items/inactive_sales_items.js b/erpnext/accounts/report/inactive_sales_items/inactive_sales_items.js index 36bd29efeb..29db227612 100644 --- a/erpnext/accounts/report/inactive_sales_items/inactive_sales_items.js +++ b/erpnext/accounts/report/inactive_sales_items/inactive_sales_items.js @@ -4,6 +4,12 @@ frappe.query_reports["Inactive Sales Items"] = { "filters": [ + { + fieldname: "territory", + label: __("Territory"), + fieldtype: "Link", + options: "Territory" + }, { fieldname: "item", label: __("Item"), diff --git a/erpnext/accounts/report/inactive_sales_items/inactive_sales_items.py b/erpnext/accounts/report/inactive_sales_items/inactive_sales_items.py index fd169f8f70..31e4471165 100644 --- a/erpnext/accounts/report/inactive_sales_items/inactive_sales_items.py +++ b/erpnext/accounts/report/inactive_sales_items/inactive_sales_items.py @@ -7,13 +7,11 @@ from frappe.utils import getdate, add_days, today, cint from frappe import _ def execute(filters=None): - columns = get_columns() data = get_data(filters) return columns, data def get_columns(): - columns = [ { "fieldname": "territory", @@ -74,36 +72,37 @@ def get_columns(): def get_data(filters): - data = [] items = get_items(filters) + territories = get_territories(filters) sales_invoice_data = get_sales_details(filters) - for item in items: - row = { - "item_group": item.item_group, - "item": item.name, - "item_name": item.item_name - } + for territory in territories: + for item in items: + row = { + "territory": territory.name, + "item_group": item.item_group, + "item": item.name, + "item_name": item.item_name + } - if sales_invoice_data.get(item.name): - item_obj = sales_invoice_data[item.name] - if item_obj.days_since_last_order > cint(filters['days']): - row.update({ - "territory": item_obj.territory, - "customer": item_obj.customer, - "last_order_date": item_obj.last_order_date, - "qty": item_obj.qty, - "days_since_last_order": item_obj.days_since_last_order - }) + if sales_invoice_data.get((territory.name,item.name)): + item_obj = sales_invoice_data[(territory.name,item.name)] + if item_obj.days_since_last_order > cint(filters['days']): + row.update({ + "territory": item_obj.territory, + "customer": item_obj.customer, + "last_order_date": item_obj.last_order_date, + "qty": item_obj.qty, + "days_since_last_order": item_obj.days_since_last_order + }) - data.append(row) + data.append(row) return data def get_sales_details(filters): - data = [] item_details_map = {} @@ -118,12 +117,21 @@ def get_sales_details(filters): .format(date_field = date_field, doctype = filters['based_on']), as_dict=1) for d in sales_data: - item_details_map.setdefault(d.item_name, d) + item_details_map.setdefault((d.territory,d.item_name), d) return item_details_map -def get_items(filters): +def get_territories(filters): + filter_dict = {} + if filters.get("territory"): + filter_dict.update({'name': filters['territory']}) + + territories = frappe.get_all("Territory", fields=["name"], filters=filter_dict) + + return territories + +def get_items(filters): filters_dict = { "disabled": 0, "is_stock_item": 1 From 0c874d915bcde7d8a1e0667b5133b07b33cb8d74 Mon Sep 17 00:00:00 2001 From: deepeshgarg007 Date: Sun, 12 May 2019 18:27:52 +0530 Subject: [PATCH 43/73] fix: Indentation fixes --- .../report/inactive_sales_items/inactive_sales_items.py | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/erpnext/accounts/report/inactive_sales_items/inactive_sales_items.py b/erpnext/accounts/report/inactive_sales_items/inactive_sales_items.py index 31e4471165..42761a58b9 100644 --- a/erpnext/accounts/report/inactive_sales_items/inactive_sales_items.py +++ b/erpnext/accounts/report/inactive_sales_items/inactive_sales_items.py @@ -80,10 +80,10 @@ def get_data(filters): for territory in territories: for item in items: row = { - "territory": territory.name, - "item_group": item.item_group, - "item": item.name, - "item_name": item.item_name + "territory": territory.name, + "item_group": item.item_group, + "item": item.name, + "item_name": item.item_name } if sales_invoice_data.get((territory.name,item.name)): From cb8374285900f1ead594e950101ee07d4fe4a897 Mon Sep 17 00:00:00 2001 From: Rushabh Mehta Date: Mon, 13 May 2019 14:19:09 +0530 Subject: [PATCH 44/73] fix: remove link to feedback trigger --- erpnext/config/settings.py | 6 ------ 1 file changed, 6 deletions(-) diff --git a/erpnext/config/settings.py b/erpnext/config/settings.py index a97e8ce5d7..323683a3e6 100644 --- a/erpnext/config/settings.py +++ b/erpnext/config/settings.py @@ -90,12 +90,6 @@ def get_data(): "label": _("Email"), "icon": "fa fa-envelope", "items": [ - { - "type": "doctype", - "name": "Feedback Trigger", - "label": _("Feedback Trigger"), - "description": _("Automatically triggers the feedback request based on conditions.") - }, { "type": "doctype", "name": "Email Digest", From 09bafc6d1040a1adf54186f24077705ebaea51c2 Mon Sep 17 00:00:00 2001 From: Basawaraj Savalagi Date: Mon, 13 May 2019 14:59:19 +0530 Subject: [PATCH 45/73] feat: Added Link to Blanket Orded in Selling Module Page --- erpnext/config/selling.py | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/erpnext/config/selling.py b/erpnext/config/selling.py index 400f6be826..63e7ad965d 100644 --- a/erpnext/config/selling.py +++ b/erpnext/config/selling.py @@ -10,7 +10,7 @@ def get_data(): { "type": "doctype", "name": "Customer", - "description": _("Customer database."), + "description": _("Customer Database."), "onboard": 1, }, { @@ -34,6 +34,13 @@ def get_data(): "onboard": 1, "dependencies": ["Item", "Customer"], }, + { + "type": "doctype", + "name": "Blanket Order", + "description": _("Blanket Orders from Costumers."), + "onboard": 1, + "dependencies": ["Item", "Customer"], + }, { "type": "doctype", "name": "Sales Partner", From 73706f85aabc36f8af282d675d9a3204d78cb8de Mon Sep 17 00:00:00 2001 From: Anurag Mishra <32095923+Anurag810@users.noreply.github.com> Date: Mon, 13 May 2019 19:03:21 +0530 Subject: [PATCH 46/73] feat: Bank remittance report for tracking payroll-entry transactions (#17013) * feat: Bank remittance report for tracking payroll-entry transactions * feat: show Company bank account and bank name * feat: Added Permissions to view report * feat: Validated report only if debit account is present * fix: query optimisation * feat: Added From date and To date filters * fix: code optimisation * fix: requested changes * fix: requested changes and refactor * style: indentation * style: Formatting * fix: added parameter filters --- .../doctype/payroll_entry/payroll_entry.json | 44 ++++- erpnext/hr/report/bank_remittance/__init__.py | 0 .../report/bank_remittance/bank_remittance.js | 28 ++++ .../bank_remittance/bank_remittance.json | 25 +++ .../report/bank_remittance/bank_remittance.py | 154 ++++++++++++++++++ 5 files changed, 246 insertions(+), 5 deletions(-) create mode 100644 erpnext/hr/report/bank_remittance/__init__.py create mode 100644 erpnext/hr/report/bank_remittance/bank_remittance.js create mode 100644 erpnext/hr/report/bank_remittance/bank_remittance.json create mode 100644 erpnext/hr/report/bank_remittance/bank_remittance.py diff --git a/erpnext/hr/doctype/payroll_entry/payroll_entry.json b/erpnext/hr/doctype/payroll_entry/payroll_entry.json index 562b999b82..d51684f651 100644 --- a/erpnext/hr/doctype/payroll_entry/payroll_entry.json +++ b/erpnext/hr/doctype/payroll_entry/payroll_entry.json @@ -21,6 +21,7 @@ "bold": 0, "collapsible": 0, "columns": 0, + "fetch_if_empty": 0, "fieldname": "section_break0", "fieldtype": "Section Break", "hidden": 0, @@ -53,6 +54,7 @@ "bold": 0, "collapsible": 0, "columns": 0, + "fetch_if_empty": 0, "fieldname": "column_break0", "fieldtype": "Column Break", "hidden": 0, @@ -86,6 +88,7 @@ "collapsible": 0, "columns": 0, "default": "Today", + "fetch_if_empty": 0, "fieldname": "posting_date", "fieldtype": "Date", "hidden": 0, @@ -120,6 +123,7 @@ "columns": 0, "default": "", "depends_on": "eval:doc.salary_slip_based_on_timesheet == 0", + "fetch_if_empty": 0, "fieldname": "payroll_frequency", "fieldtype": "Select", "hidden": 0, @@ -153,6 +157,7 @@ "bold": 0, "collapsible": 0, "columns": 0, + "fetch_if_empty": 0, "fieldname": "column_break1", "fieldtype": "Column Break", "hidden": 0, @@ -186,6 +191,7 @@ "collapsible": 0, "columns": 0, "default": "", + "fetch_if_empty": 0, "fieldname": "company", "fieldtype": "Link", "hidden": 0, @@ -220,6 +226,7 @@ "collapsible": 0, "collapsible_depends_on": "", "columns": 0, + "fetch_if_empty": 0, "fieldname": "section_break_8", "fieldtype": "Section Break", "hidden": 0, @@ -252,6 +259,7 @@ "bold": 0, "collapsible": 0, "columns": 0, + "fetch_if_empty": 0, "fieldname": "branch", "fieldtype": "Link", "hidden": 0, @@ -285,6 +293,7 @@ "bold": 0, "collapsible": 0, "columns": 0, + "fetch_if_empty": 0, "fieldname": "department", "fieldtype": "Link", "hidden": 0, @@ -318,6 +327,7 @@ "bold": 0, "collapsible": 0, "columns": 0, + "fetch_if_empty": 0, "fieldname": "column_break_10", "fieldtype": "Column Break", "hidden": 0, @@ -349,6 +359,7 @@ "bold": 0, "collapsible": 0, "columns": 0, + "fetch_if_empty": 0, "fieldname": "designation", "fieldtype": "Link", "hidden": 0, @@ -382,6 +393,7 @@ "bold": 0, "collapsible": 0, "columns": 0, + "fetch_if_empty": 0, "fieldname": "number_of_employees", "fieldtype": "Int", "hidden": 0, @@ -414,6 +426,7 @@ "bold": 0, "collapsible": 0, "columns": 0, + "fetch_if_empty": 0, "fieldname": "sec_break20", "fieldtype": "Section Break", "hidden": 0, @@ -445,6 +458,7 @@ "bold": 0, "collapsible": 0, "columns": 0, + "fetch_if_empty": 0, "fieldname": "employees", "fieldtype": "Table", "hidden": 0, @@ -478,6 +492,7 @@ "bold": 0, "collapsible": 0, "columns": 0, + "fetch_if_empty": 0, "fieldname": "section_break_13", "fieldtype": "Section Break", "hidden": 0, @@ -509,6 +524,7 @@ "bold": 0, "collapsible": 0, "columns": 0, + "fetch_if_empty": 0, "fieldname": "validate_attendance", "fieldtype": "Check", "hidden": 0, @@ -541,6 +557,7 @@ "bold": 0, "collapsible": 0, "columns": 0, + "fetch_if_empty": 0, "fieldname": "attendance_detail_html", "fieldtype": "HTML", "hidden": 0, @@ -572,6 +589,7 @@ "bold": 0, "collapsible": 0, "columns": 0, + "fetch_if_empty": 0, "fieldname": "section_break_12", "fieldtype": "Section Break", "hidden": 0, @@ -604,6 +622,7 @@ "collapsible": 0, "columns": 0, "default": "0", + "fetch_if_empty": 0, "fieldname": "salary_slip_based_on_timesheet", "fieldtype": "Check", "hidden": 0, @@ -637,6 +656,7 @@ "bold": 0, "collapsible": 0, "columns": 0, + "fetch_if_empty": 0, "fieldname": "select_payroll_period", "fieldtype": "Section Break", "hidden": 0, @@ -670,6 +690,7 @@ "collapsible": 0, "columns": 0, "default": "", + "fetch_if_empty": 0, "fieldname": "start_date", "fieldtype": "Date", "hidden": 0, @@ -703,6 +724,7 @@ "collapsible": 0, "columns": 0, "default": "", + "fetch_if_empty": 0, "fieldname": "end_date", "fieldtype": "Date", "hidden": 0, @@ -735,6 +757,7 @@ "bold": 0, "collapsible": 0, "columns": 0, + "fetch_if_empty": 0, "fieldname": "column_break_11", "fieldtype": "Column Break", "hidden": 0, @@ -766,6 +789,7 @@ "bold": 0, "collapsible": 0, "columns": 0, + "fetch_if_empty": 0, "fieldname": "deduct_tax_for_unclaimed_employee_benefits", "fieldtype": "Check", "hidden": 0, @@ -798,6 +822,7 @@ "bold": 0, "collapsible": 0, "columns": 0, + "fetch_if_empty": 0, "fieldname": "deduct_tax_for_unsubmitted_tax_exemption_proof", "fieldtype": "Check", "hidden": 0, @@ -830,6 +855,7 @@ "bold": 0, "collapsible": 0, "columns": 0, + "fetch_if_empty": 0, "fieldname": "section_break_16", "fieldtype": "Section Break", "hidden": 0, @@ -864,6 +890,7 @@ "columns": 0, "default": ":Company", "fetch_from": "", + "fetch_if_empty": 0, "fieldname": "cost_center", "fieldtype": "Link", "hidden": 0, @@ -897,6 +924,7 @@ "bold": 0, "collapsible": 0, "columns": 0, + "fetch_if_empty": 0, "fieldname": "column_break_18", "fieldtype": "Column Break", "hidden": 0, @@ -928,6 +956,7 @@ "bold": 0, "collapsible": 0, "columns": 0, + "fetch_if_empty": 0, "fieldname": "project", "fieldtype": "Link", "hidden": 0, @@ -961,6 +990,7 @@ "bold": 0, "collapsible": 0, "columns": 0, + "fetch_if_empty": 0, "fieldname": "column_break2", "fieldtype": "Column Break", "hidden": 0, @@ -993,6 +1023,7 @@ "bold": 0, "collapsible": 0, "columns": 0, + "fetch_if_empty": 0, "fieldname": "account", "fieldtype": "Section Break", "hidden": 0, @@ -1026,6 +1057,7 @@ "collapsible": 0, "columns": 0, "description": "Select Payment Account to make Bank Entry", + "fetch_if_empty": 0, "fieldname": "payment_account", "fieldtype": "Link", "hidden": 0, @@ -1059,6 +1091,7 @@ "bold": 0, "collapsible": 0, "columns": 0, + "fetch_if_empty": 0, "fieldname": "section_break2", "fieldtype": "Section Break", "hidden": 0, @@ -1090,6 +1123,7 @@ "bold": 0, "collapsible": 0, "columns": 0, + "fetch_if_empty": 0, "fieldname": "amended_from", "fieldtype": "Link", "hidden": 0, @@ -1122,6 +1156,7 @@ "bold": 0, "collapsible": 0, "columns": 0, + "fetch_if_empty": 0, "fieldname": "salary_slips_created", "fieldtype": "Check", "hidden": 1, @@ -1154,6 +1189,7 @@ "bold": 0, "collapsible": 0, "columns": 0, + "fetch_if_empty": 0, "fieldname": "salary_slips_submitted", "fieldtype": "Check", "hidden": 1, @@ -1181,17 +1217,16 @@ } ], "has_web_view": 0, - "hide_heading": 0, "hide_toolbar": 0, "icon": "fa fa-cog", "idx": 0, - "image_view": 0, "in_create": 0, "is_submittable": 1, "issingle": 0, "istable": 0, "max_attachments": 0, - "modified": "2019-02-05 10:41:08.865842", + "menu_index": 0, + "modified": "2019-03-26 16:55:04.158800", "modified_by": "Administrator", "module": "HR", "name": "Payroll Entry", @@ -1210,7 +1245,7 @@ "permlevel": 0, "print": 0, "read": 1, - "report": 0, + "report": 1, "role": "HR Manager", "set_user_permissions": 0, "share": 1, @@ -1220,7 +1255,6 @@ ], "quick_entry": 0, "read_only": 0, - "read_only_onload": 0, "show_name_in_global_search": 0, "sort_field": "modified", "sort_order": "DESC", diff --git a/erpnext/hr/report/bank_remittance/__init__.py b/erpnext/hr/report/bank_remittance/__init__.py new file mode 100644 index 0000000000..e69de29bb2 diff --git a/erpnext/hr/report/bank_remittance/bank_remittance.js b/erpnext/hr/report/bank_remittance/bank_remittance.js new file mode 100644 index 0000000000..1e10f24301 --- /dev/null +++ b/erpnext/hr/report/bank_remittance/bank_remittance.js @@ -0,0 +1,28 @@ +// Copyright (c) 2016, Frappe Technologies Pvt. Ltd. and contributors +// For license information, please see license.txt +/* eslint-disable */ + +frappe.query_reports["Bank Remittance"] = { + "filters": [ + { + "fieldname":"company", + "label": __("Company"), + "fieldtype": "Link", + "options": "Company", + "default": frappe.defaults.get_user_default("Company"), + "reqd": 1 + }, + { + fieldname:"from_date", + label: __("From Date"), + fieldtype: "Date", + }, + { + fieldname:"to_date", + label: __("To Date"), + fieldtype: "Date", + }, + + ] +} + diff --git a/erpnext/hr/report/bank_remittance/bank_remittance.json b/erpnext/hr/report/bank_remittance/bank_remittance.json new file mode 100644 index 0000000000..5a6228e398 --- /dev/null +++ b/erpnext/hr/report/bank_remittance/bank_remittance.json @@ -0,0 +1,25 @@ +{ + "add_total_row": 0, + "creation": "2019-03-26 16:57:52.558895", + "disable_prepared_report": 0, + "disabled": 0, + "docstatus": 0, + "doctype": "Report", + "idx": 0, + "is_standard": "Yes", + "letter_head": "Gadgets International", + "modified": "2019-03-26 16:57:52.558895", + "modified_by": "Administrator", + "module": "HR", + "name": "Bank Remittance", + "owner": "Administrator", + "prepared_report": 0, + "ref_doctype": "Payroll Entry", + "report_name": "Bank Remittance", + "report_type": "Script Report", + "roles": [ + { + "role": "HR Manager" + } + ] +} \ No newline at end of file diff --git a/erpnext/hr/report/bank_remittance/bank_remittance.py b/erpnext/hr/report/bank_remittance/bank_remittance.py new file mode 100644 index 0000000000..b2d2c53024 --- /dev/null +++ b/erpnext/hr/report/bank_remittance/bank_remittance.py @@ -0,0 +1,154 @@ +# Copyright (c) 2013, Frappe Technologies Pvt. Ltd. and contributors +# For license information, please see license.txt + +from __future__ import unicode_literals +import frappe +from frappe.utils import formatdate +import itertools +from frappe import _, get_all + +def execute(filters=None): + columns = [ + { + "label": _("Payroll Number"), + "fieldtype": "Link", + "fieldname": "payroll_no", + "options": "Payroll Entry", + "width": 150 + }, + { + "label": _("Debit A/C Number"), + "fieldtype": "Int", + "fieldname": "debit_account", + "hidden": 1, + "width": 200 + }, + { + "label": _("Payment Date"), + "fieldtype": "Data", + "fieldname": "payment_date", + "width": 100 + }, + { + "label": _("Employee Name"), + "fieldtype": "Link", + "fieldname": "employee_name", + "options": "Employee", + "width": 200 + }, + { + "label": _("Bank Name"), + "fieldtype": "Data", + "fieldname": "bank_name", + "width": 50 + }, + { + "label": _("Employee A/C Number"), + "fieldtype": "Int", + "fieldname": "employee_account_no", + "width": 50 + }, + { + "label": _("IFSC Code"), + "fieldtype": "Data", + "fieldname": "bank_code", + "width": 100 + }, + { + "label": _("Currency"), + "fieldtype": "Data", + "fieldname": "currency", + "width": 50 + }, + { + "label": _("Net Salary Amount"), + "fieldtype": "Currency", + "options": "currency", + "fieldname": "amount", + "width": 100 + } + ] + data = [] + + accounts = get_bank_accounts() + payroll_entries = get_payroll_entries(accounts, filters) + salary_slips = get_salary_slips(payroll_entries) + get_emp_bank_ifsc_code(salary_slips) + + for salary in salary_slips: + if salary.bank_name and salary.bank_account_no and salary.debit_acc_no and salary.status in ["Submitted", "Paid"]: + row = { + "payroll_no": salary.payroll_entry, + "debit_account": salary.debit_acc_no, + "payment_date": frappe.utils.formatdate(salary.modified.strftime('%Y-%m-%d')), + "bank_name": salary.bank_name, + "employee_account_no": salary.bank_account_no, + "bank_code": salary.ifsc_code, + "employee_name": salary.employee+": " + salary.employee_name, + "currency": frappe.get_cached_value('Company', filters.company, 'default_currency'), + "amount": salary.net_pay, + } + data.append(row) + return columns, data + +def get_bank_accounts(): + accounts = [d.name for d in get_all("Account", filters={"account_type": "Bank"})] + return accounts + +def get_payroll_entries(accounts, filters): + payroll_filter = [ + ('payment_account', 'IN', accounts), + ('number_of_employees', '>', 0), + ('Company', '=', filters.company) + ] + if filters.to_date: + payroll_filter.append(('posting_date', '<', filters.to_date)) + + if filters.from_date: + payroll_filter.append(('posting_date', '>', filters.from_date)) + + entries = get_all("Payroll Entry", payroll_filter, ["name", "payment_account"]) + + payment_accounts = [d.payment_account for d in entries] + set_company_account(payment_accounts, entries) + return entries + +def get_salary_slips(payroll_entries): + payroll = [d.name for d in payroll_entries] + salary_slips = get_all("Salary Slip", filters = [("payroll_entry", "IN", payroll)], + fields = ["modified", "net_pay", "bank_name", "bank_account_no", "payroll_entry", "employee", "employee_name", "status"] + ) + + payroll_entry_map = {} + for entry in payroll_entries: + payroll_entry_map[entry.name] = entry + + # appending company debit accounts + for slip in salary_slips: + slip["debit_acc_no"] = payroll_entry_map[slip.payroll_entry]['company_account'] + + return salary_slips + +def get_emp_bank_ifsc_code(salary_slips): + emp_names = [d.employee for d in salary_slips] + ifsc_codes = get_all("Employee", [("name", "IN", emp_names)], ["ifsc_code", "name"]) + + ifsc_codes_map = {} + for code in ifsc_codes: + ifsc_codes_map[code.name] = code + + for slip in salary_slips: + slip["ifsc_code"] = ifsc_codes_map[code.name]['ifsc_code'] + + return salary_slips + +def set_company_account(payment_accounts, payroll_entries): + company_accounts = get_all("Bank Account", [("account", "in", payment_accounts)], ["account", "bank_account_no"]) + company_accounts_map = {} + for acc in company_accounts: + company_accounts_map[acc.account] = acc + + for entry in payroll_entries: + entry["company_account"] = company_accounts_map[entry.payment_account]['bank_account_no'] + + return payroll_entries From 4dcba49b5f851f46b53676d20cd4385d5b506a6c Mon Sep 17 00:00:00 2001 From: deepeshgarg007 Date: Tue, 14 May 2019 08:49:24 +0530 Subject: [PATCH 47/73] fix: Do not append row if item is sold within days since last order --- .../report/inactive_sales_items/inactive_sales_items.py | 2 ++ 1 file changed, 2 insertions(+) diff --git a/erpnext/accounts/report/inactive_sales_items/inactive_sales_items.py b/erpnext/accounts/report/inactive_sales_items/inactive_sales_items.py index 42761a58b9..b670e6e91f 100644 --- a/erpnext/accounts/report/inactive_sales_items/inactive_sales_items.py +++ b/erpnext/accounts/report/inactive_sales_items/inactive_sales_items.py @@ -96,6 +96,8 @@ def get_data(filters): "qty": item_obj.qty, "days_since_last_order": item_obj.days_since_last_order }) + else: + continue data.append(row) From 51b6fe2b8d5836f944e2f71e3ed4ee8a02a505be Mon Sep 17 00:00:00 2001 From: Shivam Mishra Date: Tue, 14 May 2019 10:22:15 +0530 Subject: [PATCH 48/73] feat: Allow disbaling LMS (#17587) --- .../education_settings.json | 430 ++---------------- .../education_settings/education_settings.py | 3 + erpnext/hooks.py | 2 +- erpnext/www/lms.html | 29 ++ 4 files changed, 70 insertions(+), 394 deletions(-) diff --git a/erpnext/education/doctype/education_settings/education_settings.json b/erpnext/education/doctype/education_settings/education_settings.json index 3be4988d21..32b5fb8198 100644 --- a/erpnext/education/doctype/education_settings/education_settings.json +++ b/erpnext/education/doctype/education_settings/education_settings.json @@ -1,492 +1,136 @@ { - "allow_copy": 0, - "allow_events_in_timeline": 0, - "allow_guest_to_view": 0, - "allow_import": 0, - "allow_rename": 0, - "beta": 0, "creation": "2017-04-05 13:33:04.519313", - "custom": 0, - "docstatus": 0, "doctype": "DocType", - "document_type": "", "editable_grid": 1, "engine": "InnoDB", + "field_order": [ + "current_academic_year", + "current_academic_term", + "attendance_freeze_date", + "column_break_4", + "validate_batch", + "validate_course", + "academic_term_reqd", + "section_break_7", + "instructor_created_by", + "web_academy_settings_section", + "enable_lms", + "portal_title", + "description" + ], "fields": [ { - "allow_bulk_edit": 0, - "allow_in_quick_entry": 0, - "allow_on_submit": 0, - "bold": 0, - "collapsible": 0, - "columns": 0, "fieldname": "current_academic_year", "fieldtype": "Link", - "hidden": 0, - "ignore_user_permissions": 0, - "ignore_xss_filter": 0, - "in_filter": 0, - "in_global_search": 0, - "in_list_view": 0, - "in_standard_filter": 0, "label": "Current Academic Year", - "length": 0, - "no_copy": 0, - "options": "Academic Year", - "permlevel": 0, - "precision": "", - "print_hide": 0, - "print_hide_if_no_value": 0, - "read_only": 0, - "remember_last_selected_value": 0, - "report_hide": 0, - "reqd": 0, - "search_index": 0, - "set_only_once": 0, - "translatable": 0, - "unique": 0 + "options": "Academic Year" }, { - "allow_bulk_edit": 0, - "allow_in_quick_entry": 0, - "allow_on_submit": 0, - "bold": 0, - "collapsible": 0, - "columns": 0, "fieldname": "current_academic_term", "fieldtype": "Link", - "hidden": 0, - "ignore_user_permissions": 0, - "ignore_xss_filter": 0, - "in_filter": 0, - "in_global_search": 0, - "in_list_view": 0, - "in_standard_filter": 0, "label": "Current Academic Term", - "length": 0, - "no_copy": 0, - "options": "Academic Term", - "permlevel": 0, - "precision": "", - "print_hide": 0, - "print_hide_if_no_value": 0, - "read_only": 0, - "remember_last_selected_value": 0, - "report_hide": 0, - "reqd": 0, - "search_index": 0, - "set_only_once": 0, - "translatable": 0, - "unique": 0 + "options": "Academic Term" }, { - "allow_bulk_edit": 0, - "allow_in_quick_entry": 0, - "allow_on_submit": 0, - "bold": 0, - "collapsible": 0, - "columns": 0, "fieldname": "attendance_freeze_date", "fieldtype": "Date", - "hidden": 0, - "ignore_user_permissions": 0, - "ignore_xss_filter": 0, - "in_filter": 0, - "in_global_search": 0, - "in_list_view": 0, - "in_standard_filter": 0, - "label": "Attendance Freeze Date", - "length": 0, - "no_copy": 0, - "permlevel": 0, - "precision": "", - "print_hide": 0, - "print_hide_if_no_value": 0, - "read_only": 0, - "remember_last_selected_value": 0, - "report_hide": 0, - "reqd": 0, - "search_index": 0, - "set_only_once": 0, - "translatable": 0, - "unique": 0 + "label": "Attendance Freeze Date" }, { - "allow_bulk_edit": 0, - "allow_in_quick_entry": 0, - "allow_on_submit": 0, - "bold": 0, - "collapsible": 0, - "columns": 0, "fieldname": "column_break_4", - "fieldtype": "Column Break", - "hidden": 0, - "ignore_user_permissions": 0, - "ignore_xss_filter": 0, - "in_filter": 0, - "in_global_search": 0, - "in_list_view": 0, - "in_standard_filter": 0, - "length": 0, - "no_copy": 0, - "permlevel": 0, - "precision": "", - "print_hide": 0, - "print_hide_if_no_value": 0, - "read_only": 0, - "remember_last_selected_value": 0, - "report_hide": 0, - "reqd": 0, - "search_index": 0, - "set_only_once": 0, - "translatable": 0, - "unique": 0 + "fieldtype": "Column Break" }, { - "allow_bulk_edit": 0, - "allow_in_quick_entry": 0, - "allow_on_submit": 0, - "bold": 0, - "collapsible": 0, - "columns": 0, "description": "For Batch based Student Group, the Student Batch will be validated for every Student from the Program Enrollment.", "fieldname": "validate_batch", "fieldtype": "Check", - "hidden": 0, - "ignore_user_permissions": 0, - "ignore_xss_filter": 0, - "in_filter": 0, - "in_global_search": 0, - "in_list_view": 0, - "in_standard_filter": 0, - "label": "Validate Batch for Students in Student Group", - "length": 0, - "no_copy": 0, - "permlevel": 0, - "precision": "", - "print_hide": 0, - "print_hide_if_no_value": 0, - "read_only": 0, - "remember_last_selected_value": 0, - "report_hide": 0, - "reqd": 0, - "search_index": 0, - "set_only_once": 0, - "translatable": 0, - "unique": 0 + "label": "Validate Batch for Students in Student Group" }, { - "allow_bulk_edit": 0, - "allow_in_quick_entry": 0, - "allow_on_submit": 0, - "bold": 0, - "collapsible": 0, - "columns": 0, "description": "For Course based Student Group, the Course will be validated for every Student from the enrolled Courses in Program Enrollment.", "fieldname": "validate_course", "fieldtype": "Check", - "hidden": 0, - "ignore_user_permissions": 0, - "ignore_xss_filter": 0, - "in_filter": 0, - "in_global_search": 0, - "in_list_view": 0, - "in_standard_filter": 0, - "label": "Validate Enrolled Course for Students in Student Group", - "length": 0, - "no_copy": 0, - "permlevel": 0, - "precision": "", - "print_hide": 0, - "print_hide_if_no_value": 0, - "read_only": 0, - "remember_last_selected_value": 0, - "report_hide": 0, - "reqd": 0, - "search_index": 0, - "set_only_once": 0, - "translatable": 0, - "unique": 0 + "label": "Validate Enrolled Course for Students in Student Group" }, { - "allow_bulk_edit": 0, - "allow_in_quick_entry": 0, - "allow_on_submit": 0, - "bold": 0, - "collapsible": 0, - "columns": 0, "default": "0", "description": "If enabled, field Academic Term will be Mandatory in Program Enrollment Tool.", "fieldname": "academic_term_reqd", "fieldtype": "Check", - "hidden": 0, - "ignore_user_permissions": 0, - "ignore_xss_filter": 0, - "in_filter": 0, - "in_global_search": 0, - "in_list_view": 0, - "in_standard_filter": 0, - "label": "Make Academic Term Mandatory", - "length": 0, - "no_copy": 0, - "permlevel": 0, - "precision": "", - "print_hide": 0, - "print_hide_if_no_value": 0, - "read_only": 0, - "remember_last_selected_value": 0, - "report_hide": 0, - "reqd": 0, - "search_index": 0, - "set_only_once": 0, - "translatable": 0, - "unique": 0 + "label": "Make Academic Term Mandatory" }, { - "allow_bulk_edit": 0, - "allow_in_quick_entry": 0, - "allow_on_submit": 0, - "bold": 0, - "collapsible": 0, - "columns": 0, "fieldname": "section_break_7", - "fieldtype": "Section Break", - "hidden": 0, - "ignore_user_permissions": 0, - "ignore_xss_filter": 0, - "in_filter": 0, - "in_global_search": 0, - "in_list_view": 0, - "in_standard_filter": 0, - "length": 0, - "no_copy": 0, - "permlevel": 0, - "precision": "", - "print_hide": 0, - "print_hide_if_no_value": 0, - "read_only": 0, - "remember_last_selected_value": 0, - "report_hide": 0, - "reqd": 0, - "search_index": 0, - "set_only_once": 0, - "translatable": 0, - "unique": 0 + "fieldtype": "Section Break" }, { - "allow_bulk_edit": 0, - "allow_in_quick_entry": 0, - "allow_on_submit": 0, - "bold": 0, - "collapsible": 0, - "columns": 0, "default": "Full Name", "fieldname": "instructor_created_by", "fieldtype": "Select", - "hidden": 0, - "ignore_user_permissions": 0, - "ignore_xss_filter": 0, - "in_filter": 0, - "in_global_search": 0, - "in_list_view": 0, - "in_standard_filter": 0, "label": "Instructor Records to be created by", - "length": 0, - "no_copy": 0, - "options": "Full Name\nNaming Series\nEmployee Number", - "permlevel": 0, - "precision": "", - "print_hide": 0, - "print_hide_if_no_value": 0, - "read_only": 0, - "remember_last_selected_value": 0, - "report_hide": 0, - "reqd": 0, - "search_index": 0, - "set_only_once": 0, - "translatable": 0, - "unique": 0 + "options": "Full Name\nNaming Series\nEmployee Number" }, { - "allow_bulk_edit": 0, - "allow_in_quick_entry": 0, - "allow_on_submit": 0, - "bold": 0, - "collapsible": 0, - "columns": 0, "fieldname": "web_academy_settings_section", "fieldtype": "Section Break", - "hidden": 0, - "ignore_user_permissions": 0, - "ignore_xss_filter": 0, - "in_filter": 0, - "in_global_search": 0, - "in_list_view": 0, - "in_standard_filter": 0, - "label": "LMS Settings", - "length": 0, - "no_copy": 0, - "permlevel": 0, - "precision": "", - "print_hide": 0, - "print_hide_if_no_value": 0, - "read_only": 0, - "remember_last_selected_value": 0, - "report_hide": 0, - "reqd": 0, - "search_index": 0, - "set_only_once": 0, - "translatable": 0, - "unique": 0 + "label": "LMS Settings" }, { - "allow_bulk_edit": 0, - "allow_in_quick_entry": 0, - "allow_on_submit": 0, - "bold": 0, - "collapsible": 0, - "columns": 0, + "depends_on": "eval: doc.enable_lms", "fieldname": "portal_title", "fieldtype": "Data", - "hidden": 0, - "ignore_user_permissions": 0, - "ignore_xss_filter": 0, - "in_filter": 0, - "in_global_search": 0, - "in_list_view": 0, - "in_standard_filter": 0, - "label": "Portal Title", - "length": 0, - "no_copy": 0, - "permlevel": 0, - "precision": "", - "print_hide": 0, - "print_hide_if_no_value": 0, - "read_only": 0, - "remember_last_selected_value": 0, - "report_hide": 0, - "reqd": 0, - "search_index": 0, - "set_only_once": 0, - "translatable": 0, - "unique": 0 + "label": "LMS Title" }, { - "allow_bulk_edit": 0, - "allow_in_quick_entry": 0, - "allow_on_submit": 0, - "bold": 0, - "collapsible": 0, - "columns": 0, + "depends_on": "eval: doc.enable_lms", "fieldname": "description", "fieldtype": "Small Text", - "hidden": 0, - "ignore_user_permissions": 0, - "ignore_xss_filter": 0, - "in_filter": 0, - "in_global_search": 0, - "in_list_view": 0, - "in_standard_filter": 0, - "label": "Description", - "length": 0, - "no_copy": 0, - "permlevel": 0, - "precision": "", - "print_hide": 0, - "print_hide_if_no_value": 0, - "read_only": 0, - "remember_last_selected_value": 0, - "report_hide": 0, - "reqd": 0, - "search_index": 0, - "set_only_once": 0, - "translatable": 0, - "unique": 0 + "label": "Description" + }, + { + "fieldname": "enable_lms", + "fieldtype": "Check", + "label": "Enable LMS" } ], - "has_web_view": 0, - "hide_heading": 0, - "hide_toolbar": 0, - "idx": 0, - "image_view": 0, - "in_create": 0, - "is_submittable": 0, "issingle": 1, - "istable": 0, - "max_attachments": 0, - "modified": "2018-12-11 15:49:15.045116", + "modified": "2019-05-13 18:36:13.127563", "modified_by": "Administrator", "module": "Education", "name": "Education Settings", - "name_case": "", "owner": "Administrator", "permissions": [ { - "amend": 0, - "cancel": 0, "create": 1, "delete": 1, "email": 1, - "export": 0, - "if_owner": 0, - "import": 0, - "permlevel": 0, "print": 1, "read": 1, - "report": 0, "role": "System Manager", - "set_user_permissions": 0, "share": 1, - "submit": 0, "write": 1 }, { - "amend": 0, - "cancel": 0, "create": 1, "delete": 1, "email": 1, - "export": 0, - "if_owner": 0, - "import": 0, - "permlevel": 0, "print": 1, "read": 1, - "report": 0, "role": "Education Manager", - "set_user_permissions": 0, "share": 1, - "submit": 0, "write": 1 }, { - "amend": 0, - "cancel": 0, - "create": 0, - "delete": 0, "email": 1, - "export": 0, - "if_owner": 0, - "import": 0, - "permlevel": 0, "print": 1, "read": 1, - "report": 0, "role": "Guest", - "set_user_permissions": 0, - "share": 1, - "submit": 0, - "write": 0 + "share": 1 } ], "quick_entry": 1, - "read_only": 0, - "read_only_onload": 0, "restrict_to_domain": "Education", - "show_name_in_global_search": 0, "sort_field": "modified", "sort_order": "DESC", - "track_changes": 1, - "track_seen": 0, - "track_views": 0 + "track_changes": 1 } \ No newline at end of file diff --git a/erpnext/education/doctype/education_settings/education_settings.py b/erpnext/education/doctype/education_settings/education_settings.py index 9286efa7c4..a85d3e70f3 100644 --- a/erpnext/education/doctype/education_settings/education_settings.py +++ b/erpnext/education/doctype/education_settings/education_settings.py @@ -34,3 +34,6 @@ class EducationSettings(Document): make_property_setter('Instructor', "naming_series", "hidden", 0, "Check") else: make_property_setter('Instructor', "naming_series", "hidden", 1, "Check") + +def update_website_context(context): + context["lms_enabled"] = frappe.get_doc("Education Settings").enable_lms \ No newline at end of file diff --git a/erpnext/hooks.py b/erpnext/hooks.py index 8ae9267b64..53da013f8d 100644 --- a/erpnext/hooks.py +++ b/erpnext/hooks.py @@ -50,7 +50,7 @@ on_logout = "erpnext.shopping_cart.utils.clear_cart_count" treeviews = ['Account', 'Cost Center', 'Warehouse', 'Item Group', 'Customer Group', 'Sales Person', 'Territory', 'Assessment Group'] # website -update_website_context = "erpnext.shopping_cart.utils.update_website_context" +update_website_context = ["erpnext.shopping_cart.utils.update_website_context", "erpnext.education.doctype.education_settings.education_settings.update_website_context"] my_account_context = "erpnext.shopping_cart.utils.update_my_account_context" email_append_to = ["Job Applicant", "Lead", "Opportunity", "Issue"] diff --git a/erpnext/www/lms.html b/erpnext/www/lms.html index 1796194585..aa76ca06e7 100644 --- a/erpnext/www/lms.html +++ b/erpnext/www/lms.html @@ -5,6 +5,35 @@ {% block navbar %}{% endblock %} {% block content %} +{% if lms_enabled %}
+{% else %} + + +
+
+ {{_("Page Missing or Moved")}} +
+

{{_("The page you are looking for is missing. This could be because it is moved or there is a typo in the link.")}}

+ +
+

{{ _("Error Code: {0}").format('404') }}

+ +{% endif %} {% endblock %} \ No newline at end of file From d2c4af154b6e45cd385de78cc043b892a93721cc Mon Sep 17 00:00:00 2001 From: Shivam Mishra Date: Tue, 14 May 2019 11:16:13 +0530 Subject: [PATCH 49/73] fix: Video not found bug --- .../course_enrollment/course_enrollment.py | 5 +- erpnext/education/doctype/topic/topic.py | 2 +- .../doctype/topic_content/topic_content.json | 116 ++---------------- 3 files changed, 15 insertions(+), 108 deletions(-) diff --git a/erpnext/education/doctype/course_enrollment/course_enrollment.py b/erpnext/education/doctype/course_enrollment/course_enrollment.py index 9508636d2f..6f2bb0db1f 100644 --- a/erpnext/education/doctype/course_enrollment/course_enrollment.py +++ b/erpnext/education/doctype/course_enrollment/course_enrollment.py @@ -21,7 +21,10 @@ class CourseEnrollment(Document): progress = [] for topic in topics: progress.append(student.get_topic_progress(self.name, topic)) - return reduce(lambda x,y: x+y, progress) # Flatten out the List + if progress: + return reduce(lambda x,y: x+y, progress) # Flatten out the List + else: + return [] def validate_duplication(self): enrollment = frappe.get_all("Course Enrollment", filters={ diff --git a/erpnext/education/doctype/topic/topic.py b/erpnext/education/doctype/topic/topic.py index 339fc7d887..7e5da329eb 100644 --- a/erpnext/education/doctype/topic/topic.py +++ b/erpnext/education/doctype/topic/topic.py @@ -9,7 +9,7 @@ from frappe.model.document import Document class Topic(Document): def get_contents(self): try: - topic_content_list = self.get_all_children() + topic_content_list = self.topic_content content_data = [frappe.get_doc(topic_content.content_type, topic_content.content) for topic_content in topic_content_list] except Exception as e: frappe.log_error(frappe.get_traceback()) diff --git a/erpnext/education/doctype/topic_content/topic_content.json b/erpnext/education/doctype/topic_content/topic_content.json index 52207882e0..444fd1d07c 100644 --- a/erpnext/education/doctype/topic_content/topic_content.json +++ b/erpnext/education/doctype/topic_content/topic_content.json @@ -1,140 +1,44 @@ { - "allow_copy": 0, - "allow_events_in_timeline": 0, - "allow_guest_to_view": 0, - "allow_import": 0, - "allow_rename": 0, - "beta": 0, "creation": "2018-12-12 11:42:57.987434", - "custom": 0, - "docstatus": 0, "doctype": "DocType", - "document_type": "", "editable_grid": 1, "engine": "InnoDB", + "field_order": [ + "content_type", + "column_break_2", + "content" + ], "fields": [ { - "allow_bulk_edit": 0, - "allow_in_quick_entry": 0, - "allow_on_submit": 0, - "bold": 0, - "collapsible": 0, - "columns": 0, "fieldname": "content_type", "fieldtype": "Select", - "hidden": 0, - "ignore_user_permissions": 0, - "ignore_xss_filter": 0, - "in_filter": 0, - "in_global_search": 0, "in_list_view": 1, - "in_standard_filter": 0, "label": "Content Type", - "length": 0, - "no_copy": 0, "options": "\nArticle\nVideo\nQuiz", - "permlevel": 0, - "precision": "", - "print_hide": 0, - "print_hide_if_no_value": 0, - "read_only": 0, - "remember_last_selected_value": 0, - "report_hide": 0, - "reqd": 0, - "search_index": 0, - "set_only_once": 0, - "translatable": 0, - "unique": 0 + "reqd": 1 }, { - "allow_bulk_edit": 0, - "allow_in_quick_entry": 0, - "allow_on_submit": 0, - "bold": 0, - "collapsible": 0, - "columns": 0, "fieldname": "column_break_2", - "fieldtype": "Column Break", - "hidden": 0, - "ignore_user_permissions": 0, - "ignore_xss_filter": 0, - "in_filter": 0, - "in_global_search": 0, - "in_list_view": 0, - "in_standard_filter": 0, - "length": 0, - "no_copy": 0, - "permlevel": 0, - "precision": "", - "print_hide": 0, - "print_hide_if_no_value": 0, - "read_only": 0, - "remember_last_selected_value": 0, - "report_hide": 0, - "reqd": 0, - "search_index": 0, - "set_only_once": 0, - "translatable": 0, - "unique": 0 + "fieldtype": "Column Break" }, { - "allow_bulk_edit": 0, - "allow_in_quick_entry": 0, - "allow_on_submit": 0, - "bold": 0, - "collapsible": 0, - "columns": 0, "fieldname": "content", "fieldtype": "Dynamic Link", - "hidden": 0, - "ignore_user_permissions": 0, - "ignore_xss_filter": 0, - "in_filter": 0, - "in_global_search": 0, "in_list_view": 1, - "in_standard_filter": 0, "label": "Content", - "length": 0, - "no_copy": 0, "options": "content_type", - "permlevel": 0, - "precision": "", - "print_hide": 0, - "print_hide_if_no_value": 0, - "read_only": 0, - "remember_last_selected_value": 0, - "report_hide": 0, - "reqd": 0, - "search_index": 0, - "set_only_once": 0, - "translatable": 0, - "unique": 0 + "reqd": 1 } ], - "has_web_view": 0, - "hide_heading": 0, - "hide_toolbar": 0, - "idx": 0, - "image_view": 0, - "in_create": 0, - "is_submittable": 0, - "issingle": 0, "istable": 1, - "max_attachments": 0, - "modified": "2018-12-12 11:46:46.112018", + "modified": "2019-05-14 11:12:49.153771", "modified_by": "Administrator", "module": "Education", "name": "Topic Content", - "name_case": "", "owner": "Administrator", "permissions": [], "quick_entry": 1, - "read_only": 0, - "read_only_onload": 0, - "show_name_in_global_search": 0, "sort_field": "modified", "sort_order": "DESC", - "track_changes": 1, - "track_seen": 0, - "track_views": 0 + "track_changes": 1 } \ No newline at end of file From f2d62195b00dd0de0cc9f8e4098c826693c7b7cc Mon Sep 17 00:00:00 2001 From: Shivam Mishra Date: Tue, 14 May 2019 11:16:48 +0530 Subject: [PATCH 50/73] chore: Minor code improvements --- erpnext/education/doctype/course/course.py | 10 +++++----- erpnext/education/doctype/program/program.py | 2 +- erpnext/education/doctype/student/student.py | 15 ++++++++------- 3 files changed, 14 insertions(+), 13 deletions(-) diff --git a/erpnext/education/doctype/course/course.py b/erpnext/education/doctype/course/course.py index 987823a01e..0747a22f8d 100644 --- a/erpnext/education/doctype/course/course.py +++ b/erpnext/education/doctype/course/course.py @@ -20,9 +20,9 @@ class Course(Document): frappe.throw(_("Total Weightage of all Assessment Criteria must be 100%")) def get_topics(self): - try: - topic_list = self.get_all_children() - topic_data = [frappe.get_doc("Topic", topic.topic) for topic in topic_list] - except frappe.DoesNotExistError: - return None + topic_data= [] + for topic in self.topics: + topic_doc = frappe.get_doc("Topic", topic.topic) + if topic_doc.topic_content: + topic_data.append(topic_doc) return topic_data \ No newline at end of file diff --git a/erpnext/education/doctype/program/program.py b/erpnext/education/doctype/program/program.py index dbeda40775..d24df5d614 100644 --- a/erpnext/education/doctype/program/program.py +++ b/erpnext/education/doctype/program/program.py @@ -9,6 +9,6 @@ from frappe.model.document import Document class Program(Document): def get_course_list(self): - program_course_list = self.get_all_children() + program_course_list = self.courses course_list = [frappe.get_doc("Course", program_course.course) for program_course in program_course_list] return course_list \ No newline at end of file diff --git a/erpnext/education/doctype/student/student.py b/erpnext/education/doctype/student/student.py index cf8407c4ea..529f78d4f5 100644 --- a/erpnext/education/doctype/student/student.py +++ b/erpnext/education/doctype/student/student.py @@ -90,13 +90,14 @@ class Student(Document): """ contents = topic.get_contents() progress = [] - for content in contents: - if content.doctype in ('Article', 'Video'): - status = check_content_completion(content.name, content.doctype, course_enrollment_name) - progress.append({'content': content.name, 'content_type': content.doctype, 'is_complete': status}) - elif content.doctype == 'Quiz': - status, score, result = check_quiz_completion(content, course_enrollment_name) - progress.append({'content': content.name, 'content_type': content.doctype, 'is_complete': status, 'score': score, 'result': result}) + if contents: + for content in contents: + if content.doctype in ('Article', 'Video'): + status = check_content_completion(content.name, content.doctype, course_enrollment_name) + progress.append({'content': content.name, 'content_type': content.doctype, 'is_complete': status}) + elif content.doctype == 'Quiz': + status, score, result = check_quiz_completion(content, course_enrollment_name) + progress.append({'content': content.name, 'content_type': content.doctype, 'is_complete': status, 'score': score, 'result': result}) return progress def enroll_in_program(self, program_name): From 2430fd3a4cf5801f0ebc852f8655aabbf696df23 Mon Sep 17 00:00:00 2001 From: Shivam Mishra Date: Tue, 14 May 2019 11:17:03 +0530 Subject: [PATCH 51/73] chore: show description on course card --- erpnext/public/js/education/lms/components/CourseCard.vue | 7 +------ 1 file changed, 1 insertion(+), 6 deletions(-) diff --git a/erpnext/public/js/education/lms/components/CourseCard.vue b/erpnext/public/js/education/lms/components/CourseCard.vue index 16f8873bd1..dff896f6f9 100644 --- a/erpnext/public/js/education/lms/components/CourseCard.vue +++ b/erpnext/public/js/education/lms/components/CourseCard.vue @@ -8,12 +8,7 @@
{{ course.course_name }}
- Topics -
    -
  • -
    {{ topic.topic_name }}
    -
  • -
+ {{ course.course_intro }}
From f82d0a607402e7aeb6dff66566a3ef666c9a3d74 Mon Sep 17 00:00:00 2001 From: Shivam Mishra Date: Tue, 14 May 2019 12:02:08 +0530 Subject: [PATCH 52/73] fix: show video duration and publish date only if data exists --- erpnext/public/js/education/lms/components/Video.vue | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/erpnext/public/js/education/lms/components/Video.vue b/erpnext/public/js/education/lms/components/Video.vue index 27f922f487..ec7b0c08b0 100644 --- a/erpnext/public/js/education/lms/components/Video.vue +++ b/erpnext/public/js/education/lms/components/Video.vue @@ -6,8 +6,7 @@

{{ contentData.name }}

- {{ contentData.duration }} Mins - — Published on {{ contentData.publish_date }}. + {{ contentData.duration }} Mins — Published on {{ contentData.publish_date }}.
From 776d891b19b0b8c0a93519521243b450be274f41 Mon Sep 17 00:00:00 2001 From: Shivam Mishra Date: Tue, 14 May 2019 14:16:50 +0530 Subject: [PATCH 53/73] fix: test for course --- erpnext/education/doctype/course/test_course.py | 3 +++ 1 file changed, 3 insertions(+) diff --git a/erpnext/education/doctype/course/test_course.py b/erpnext/education/doctype/course/test_course.py index a24ba8a527..4667ac45a2 100644 --- a/erpnext/education/doctype/course/test_course.py +++ b/erpnext/education/doctype/course/test_course.py @@ -3,6 +3,7 @@ # See license.txt from __future__ import unicode_literals from erpnext.education.doctype.topic.test_topic import make_topic +from erpnext.education.doctype.topic.test_topic import make_topic_and_linked_content import frappe import unittest @@ -11,6 +12,8 @@ import unittest class TestCourse(unittest.TestCase): def setUp(self): + make_topic_and_linked_content("_Test Topic 1", [{"type":"Article", "name": "_Test Article 1"}]) + make_topic_and_linked_content("_Test Topic 2", [{"type":"Article", "name": "_Test Article 2"}]) make_course_and_linked_topic("_Test Course 1", ["_Test Topic 1", "_Test Topic 2"]) def test_get_topics(self): From d9a22726f10d587188cf9b13f9152d460a179e81 Mon Sep 17 00:00:00 2001 From: deepeshgarg007 Date: Tue, 14 May 2019 14:32:36 +0530 Subject: [PATCH 54/73] fix: Make territory filter mandatory --- .../report/inactive_sales_items/inactive_sales_items.js | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/erpnext/accounts/report/inactive_sales_items/inactive_sales_items.js b/erpnext/accounts/report/inactive_sales_items/inactive_sales_items.js index 29db227612..7908c07a0a 100644 --- a/erpnext/accounts/report/inactive_sales_items/inactive_sales_items.js +++ b/erpnext/accounts/report/inactive_sales_items/inactive_sales_items.js @@ -8,7 +8,8 @@ frappe.query_reports["Inactive Sales Items"] = { fieldname: "territory", label: __("Territory"), fieldtype: "Link", - options: "Territory" + options: "Territory", + reqd: 1, }, { fieldname: "item", From ec7b064528dc524b0a7b999c882c04a4d4c3cd70 Mon Sep 17 00:00:00 2001 From: Faris Ansari Date: Tue, 14 May 2019 16:21:09 +0530 Subject: [PATCH 55/73] fix: Clear messages during setup fixtures --- erpnext/regional/india/setup.py | 4 ++-- erpnext/setup/setup_wizard/operations/install_fixtures.py | 7 ++++++- 2 files changed, 8 insertions(+), 3 deletions(-) diff --git a/erpnext/regional/india/setup.py b/erpnext/regional/india/setup.py index e1aa233559..04841c345c 100644 --- a/erpnext/regional/india/setup.py +++ b/erpnext/regional/india/setup.py @@ -362,9 +362,9 @@ def make_fixtures(company=None): doc.flags.ignore_permissions = True doc.insert() except frappe.NameError: - pass + frappe.clear_messages() except frappe.DuplicateEntryError: - pass + frappe.clear_messages() # create records for Tax Withholding Category set_tax_withholding_category(company) diff --git a/erpnext/setup/setup_wizard/operations/install_fixtures.py b/erpnext/setup/setup_wizard/operations/install_fixtures.py index 66871dbd5a..89f4e3036e 100644 --- a/erpnext/setup/setup_wizard/operations/install_fixtures.py +++ b/erpnext/setup/setup_wizard/operations/install_fixtures.py @@ -363,7 +363,12 @@ def add_sale_stages(): def install_company(args): records = [ # Fiscal Year - { "doctype": "Fiscal Year", 'year': get_fy_details(args.fy_start_date, args.fy_end_date), 'year_start_date': args.fy_start_date, 'year_end_date': args.fy_end_date }, + { + 'doctype': "Fiscal Year", + 'year': get_fy_details(args.fy_start_date, args.fy_end_date), + 'year_start_date': args.fy_start_date, + 'year_end_date': args.fy_end_date + }, # Company { From abcb6aea00cc3d0573b69955dfd983e59a12dc77 Mon Sep 17 00:00:00 2001 From: Himanshu Date: Wed, 15 May 2019 01:37:53 +0530 Subject: [PATCH 56/73] fix: do not remove assignment when closed (#17613) --- erpnext/support/doctype/issue/issue.py | 4 ---- 1 file changed, 4 deletions(-) diff --git a/erpnext/support/doctype/issue/issue.py b/erpnext/support/doctype/issue/issue.py index d626def665..dca06d4537 100644 --- a/erpnext/support/doctype/issue/issue.py +++ b/erpnext/support/doctype/issue/issue.py @@ -32,10 +32,6 @@ class Issue(Document): self.update_status() self.set_lead_contact(self.raised_by) - if self.status == "Closed": - from frappe.desk.form.assign_to import clear - clear(self.doctype, self.name) - def on_update(self): # Add a communication in the issue timeline if self.flags.create_communication and self.via_customer_portal: From 32d91b2c00be6c2f66c696cf149b5fd5dfdbff43 Mon Sep 17 00:00:00 2001 From: rohitwaghchaure Date: Wed, 15 May 2019 07:41:44 +0530 Subject: [PATCH 57/73] fix: not able to create the sales invoice without item code (#17612) --- erpnext/accounts/doctype/sales_invoice/sales_invoice.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/erpnext/accounts/doctype/sales_invoice/sales_invoice.py b/erpnext/accounts/doctype/sales_invoice/sales_invoice.py index 31a9c66f6f..06e1e58008 100644 --- a/erpnext/accounts/doctype/sales_invoice/sales_invoice.py +++ b/erpnext/accounts/doctype/sales_invoice/sales_invoice.py @@ -506,8 +506,8 @@ class SalesInvoice(SellingController): for i in dic: if frappe.db.get_single_value('Selling Settings', dic[i][0]) == 'Yes': for d in self.get('items'): - if frappe.get_cached_value('Item', d.item_code, 'is_stock_item') == 1 \ - and not d.get(i.lower().replace(' ','_')) and not self.get(dic[i][1]): + if (d.item_code and frappe.get_cached_value('Item', d.item_code, 'is_stock_item') == 1 + and not d.get(i.lower().replace(' ','_')) and not self.get(dic[i][1])): msgprint(_("{0} is mandatory for Item {1}").format(i,d.item_code), raise_exception=1) From d07a3e1de25d0dbb94f21c8571116c1c28b828b1 Mon Sep 17 00:00:00 2001 From: rohitwaghchaure Date: Wed, 15 May 2019 07:46:28 +0530 Subject: [PATCH 58/73] fix: limit offset was missing in the get_delivery_notes_to_be_billed method (#17611) --- erpnext/controllers/queries.py | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/erpnext/controllers/queries.py b/erpnext/controllers/queries.py index 1bf03ec803..22846693d1 100644 --- a/erpnext/controllers/queries.py +++ b/erpnext/controllers/queries.py @@ -253,11 +253,13 @@ def get_delivery_notes_to_be_billed(doctype, txt, searchfield, start, page_len, and return_against in (select name from `tabDelivery Note` where per_billed < 100) ) ) - %(mcond)s order by `tabDelivery Note`.`%(key)s` asc + %(mcond)s order by `tabDelivery Note`.`%(key)s` asc limit %(start)s, %(page_len)s """ % { "key": searchfield, "fcond": get_filters_cond(doctype, filters, []), "mcond": get_match_cond(doctype), + "start": start, + "page_len": page_len, "txt": "%(txt)s" }, {"txt": ("%%%s%%" % txt)}, as_dict=as_dict) From c3779851e493344556220c8ed9e37ad2d27d67ca Mon Sep 17 00:00:00 2001 From: Karthikeyan S Date: Wed, 15 May 2019 11:38:20 +0530 Subject: [PATCH 59/73] fix(HR Settings): Unable to save HR Settings (#17608) --- erpnext/hr/doctype/hr_settings/hr_settings.js | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/erpnext/hr/doctype/hr_settings/hr_settings.js b/erpnext/hr/doctype/hr_settings/hr_settings.js index 58ce4226e9..d8be46bee7 100644 --- a/erpnext/hr/doctype/hr_settings/hr_settings.js +++ b/erpnext/hr/doctype/hr_settings/hr_settings.js @@ -13,9 +13,11 @@ frappe.ui.form.on('HR Settings', { validate: function(frm) { let policy = frm.doc.password_policy; - if (policy.includes(' ') || policy.includes('--')) { - frappe.msgprint("Password policy cannot contain spaces or simultaneous hyphens. The format will be restructured automatically"); + if (policy) { + if (policy.includes(' ') || policy.includes('--')) { + frappe.msgprint("Password policy cannot contain spaces or simultaneous hyphens. The format will be restructured automatically"); + } + frm.set_value('password_policy', policy.split(new RegExp(" |-", 'g')).filter((token) => token).join('-')); } - frm.set_value('password_policy', policy.split(new RegExp(" |-", 'g')).filter((token) => token).join('-')); } }); From 4c0f754a964c4dc3ab3504d8c13fcb8a2948899b Mon Sep 17 00:00:00 2001 From: Mohamed Al Zubaidi Date: Wed, 15 May 2019 10:08:56 +0400 Subject: [PATCH 60/73] Fix typos (#17601) --- .../ae_uae_chart_template_standard.json | 22 +++++++++---------- 1 file changed, 11 insertions(+), 11 deletions(-) diff --git a/erpnext/accounts/doctype/account/chart_of_accounts/verified/ae_uae_chart_template_standard.json b/erpnext/accounts/doctype/account/chart_of_accounts/verified/ae_uae_chart_template_standard.json index cae4c3c9b8..8856c8cc90 100644 --- a/erpnext/accounts/doctype/account/chart_of_accounts/verified/ae_uae_chart_template_standard.json +++ b/erpnext/accounts/doctype/account/chart_of_accounts/verified/ae_uae_chart_template_standard.json @@ -12,7 +12,7 @@ "Accrued Rebates Due from Suppliers": { "account_type": "Receivable" }, - "Accured Income from Suppliers": { + "Accrued Income from Suppliers": { "account_type": "Receivable" }, "Other Debtors": { @@ -54,7 +54,7 @@ } }, "Petty Cash": { - "Petty Cash - Admininistration": { + "Petty Cash - Administration": { "account_type": "Cash" }, "Petty Cash - Others": { @@ -85,13 +85,13 @@ "Handling Difference in Inventory": { "account_type": "Stock Adjustment" }, - "Items Delivered to Customs on temprary Base": {} + "Items Delivered to Customs on temporary Base": {} }, "Stock in Hand": { "account_type": "Stock" } }, - "Perliminary and Preoperating Expenses": { + "Preliminary and Preoperating Expenses": { "Preoperating Expenses": {} }, "Prepayments & Deposits": { @@ -150,16 +150,16 @@ "account_type": "Fixed Asset" }, "Leasehold Improvement": {}, - "Motor Vehicules": { + "Motor Vehicles": { "account_type": "Fixed Asset" }, - "Work In Progrees": {}, + "Work In Progress": {}, "account_type": "Fixed Asset" } }, "Intangible Assets": { "Computer Card Renewal": {}, - "Dispoal of Outlets": {}, + "Disposal of Outlets": {}, "Registration of Trademarks": {} }, "Intercompany Accounts": {}, @@ -218,7 +218,7 @@ }, "MISC Charges": { "Other Charges": { - "Captial Loss": { + "Capital Loss": { "Disposal of Business Branch": {}, "Loss On Fixed Assets Disposal": {}, "Loss on Difference on Exchange": {} @@ -253,14 +253,14 @@ "Other Bank Charges": {} }, "Communications": { - "Courrier": {}, + "Courier": {}, "Others - Communication": {}, "Telephone": {}, "Web Site Hosting Fees": {} }, "Office & Various Expenses": { "Cleaning": {}, - "Convoyance Expenses": {}, + "Conveyance Expenses": {}, "Gifts & Donations": {}, "Insurance": {}, "Kitchen and Buffet Expenses": {}, @@ -325,7 +325,7 @@ "Current Liabilities": { "Accounts Payable": { "Payables": { - "Advance Paybale to Suppliers": { + "Advance Payable to Suppliers": { "account_type": "Payable" }, "Consigned Payable": { From 9da57d79b57e8e07f67d4e2983ceaa088cc982aa Mon Sep 17 00:00:00 2001 From: Saurabh Date: Wed, 15 May 2019 11:39:41 +0530 Subject: [PATCH 61/73] fix: reload docs before creating custom fields (#17586) --- .../create_department_records_for_each_company.py | 2 +- erpnext/patches/v11_0/inter_state_field_for_gst.py | 11 +++++++++++ erpnext/patches/v8_7/sync_india_custom_fields.py | 3 +++ 3 files changed, 15 insertions(+), 1 deletion(-) diff --git a/erpnext/patches/v11_0/create_department_records_for_each_company.py b/erpnext/patches/v11_0/create_department_records_for_each_company.py index b5a7bd91bd..f09c5b2c5d 100644 --- a/erpnext/patches/v11_0/create_department_records_for_each_company.py +++ b/erpnext/patches/v11_0/create_department_records_for_each_company.py @@ -70,7 +70,7 @@ def update_instructors(comp_dict): emp_details = frappe.get_all("Employee", fields=["name", "company"]) for employee in emp_details: - records = comp_dict[employee.company] + records = comp_dict[employee.company] if employee.company else [] for department in records: when_then.append(''' diff --git a/erpnext/patches/v11_0/inter_state_field_for_gst.py b/erpnext/patches/v11_0/inter_state_field_for_gst.py index 232d44256f..48249c9bbf 100644 --- a/erpnext/patches/v11_0/inter_state_field_for_gst.py +++ b/erpnext/patches/v11_0/inter_state_field_for_gst.py @@ -8,6 +8,17 @@ def execute(): return frappe.reload_doc("hr", "doctype", "Employee Tax Exemption Declaration") frappe.reload_doc("hr", "doctype", "Employee Tax Exemption Proof Submission") + frappe.reload_doc("hr", "doctype", "Employee Grade") + frappe.reload_doc("hr", "doctype", "Leave Policy") + + frappe.reload_doc("accounts", "doctype", "Bank Account") + frappe.reload_doc("accounts", "doctype", "Tax Withholding Category") + frappe.reload_doc("accounts", "doctype", "Allowed To Transact With") + frappe.reload_doc("accounts", "doctype", "Finance Book") + frappe.reload_doc("accounts", "doctype", "Loyalty Program") + + frappe.reload_doc("stock", "doctype", "Item Barcode") + make_custom_fields() frappe.reload_doc("accounts", "doctype", "sales_taxes_and_charges") diff --git a/erpnext/patches/v8_7/sync_india_custom_fields.py b/erpnext/patches/v8_7/sync_india_custom_fields.py index c684b24b2b..e1ae0b738a 100644 --- a/erpnext/patches/v8_7/sync_india_custom_fields.py +++ b/erpnext/patches/v8_7/sync_india_custom_fields.py @@ -7,6 +7,9 @@ def execute(): if not company: return + frappe.reload_doc('hr', 'doctype', 'payroll_period') + frappe.reload_doc('hr', 'doctype', 'employee_tax_exemption_declaration_category') + frappe.reload_doc('hr', 'doctype', 'employee_tax_exemption_proof_submission_detail') frappe.reload_doc('hr', 'doctype', 'employee_tax_exemption_declaration') frappe.reload_doc('hr', 'doctype', 'employee_tax_exemption_proof_submission') From 0ae1c293d3d4d217d9fbcdd3457d8079ca35443a Mon Sep 17 00:00:00 2001 From: Deepesh Garg <42651287+deepeshgarg007@users.noreply.github.com> Date: Wed, 15 May 2019 12:23:24 +0530 Subject: [PATCH 62/73] fix: Status updater fixes in PO and SO and test coverage for return (#17491) * fix: Status updator fixes in sales and purchase cycle * fix: Test cases for return in so and po * fix: Resolve conflicts --- .../purchase_invoice/purchase_invoice.py | 44 ++++++------ .../doctype/sales_invoice/sales_invoice.py | 31 ++++---- .../purchase_order/test_purchase_order.py | 70 +++++++++++++++++++ .../doctype/sales_order/test_sales_order.py | 38 ++++++++++ .../doctype/delivery_note/delivery_note.py | 22 +++--- .../purchase_receipt/purchase_receipt.py | 19 ++++- 6 files changed, 176 insertions(+), 48 deletions(-) diff --git a/erpnext/accounts/doctype/purchase_invoice/purchase_invoice.py b/erpnext/accounts/doctype/purchase_invoice/purchase_invoice.py index 95d49a4421..97ad0ead3f 100644 --- a/erpnext/accounts/doctype/purchase_invoice/purchase_invoice.py +++ b/erpnext/accounts/doctype/purchase_invoice/purchase_invoice.py @@ -100,6 +100,7 @@ class PurchaseInvoice(BuyingController): self.validate_fixed_asset() self.create_remarks() self.set_status() + self.validate_purchase_receipt_if_update_stock() validate_inter_company_party(self.doctype, self.supplier, self.company, self.inter_company_invoice_reference) def validate_release_date(self): @@ -284,7 +285,7 @@ class PurchaseInvoice(BuyingController): def update_status_updater_args(self): if cint(self.update_stock): - self.status_updater.extend([{ + self.status_updater.append({ 'source_dt': 'Purchase Invoice Item', 'target_dt': 'Purchase Order Item', 'join_field': 'po_detail', @@ -292,28 +293,29 @@ class PurchaseInvoice(BuyingController): 'target_parent_dt': 'Purchase Order', 'target_parent_field': 'per_received', 'target_ref_field': 'qty', - 'source_field': 'qty', + 'source_field': 'received_qty', + 'second_source_dt': 'Purchase Receipt Item', + 'second_source_field': 'received_qty', + 'second_join_field': 'purchase_order_item', 'percent_join_field':'purchase_order', - # 'percent_join_field': 'prevdoc_docname', 'overflow_type': 'receipt', 'extra_cond': """ and exists(select name from `tabPurchase Invoice` where name=`tabPurchase Invoice Item`.parent and update_stock = 1)""" - }, - { - 'source_dt': 'Purchase Invoice Item', - 'target_dt': 'Purchase Order Item', - 'join_field': 'po_detail', - 'target_field': 'returned_qty', - 'target_parent_dt': 'Purchase Order', - # 'target_parent_field': 'per_received', - # 'target_ref_field': 'qty', - 'source_field': '-1 * qty', - # 'percent_join_field': 'prevdoc_docname', - # 'overflow_type': 'receipt', - 'extra_cond': """ and exists (select name from `tabPurchase Invoice` - where name=`tabPurchase Invoice Item`.parent and update_stock=1 and is_return=1)""" - } - ]) + }) + if cint(self.is_return): + self.status_updater.append({ + 'source_dt': 'Purchase Invoice Item', + 'target_dt': 'Purchase Order Item', + 'join_field': 'po_detail', + 'target_field': 'returned_qty', + 'source_field': '-1 * qty', + 'second_source_dt': 'Purchase Receipt Item', + 'second_source_field': '-1 * qty', + 'second_join_field': 'purchase_order_item', + 'overflow_type': 'receipt', + 'extra_cond': """ and exists (select name from `tabPurchase Invoice` + where name=`tabPurchase Invoice Item`.parent and update_stock=1 and is_return=1)""" + }) def validate_purchase_receipt_if_update_stock(self): if self.update_stock: @@ -327,13 +329,13 @@ class PurchaseInvoice(BuyingController): self.check_prev_docstatus() self.update_status_updater_args() + self.update_prevdoc_status() frappe.get_doc('Authorization Control').validate_approving_authority(self.doctype, self.company, self.base_grand_total) if not self.is_return: self.update_against_document_in_jv() - self.update_prevdoc_status() self.update_billing_status_for_zero_amount_refdoc("Purchase Order") self.update_billing_status_in_pr() @@ -763,9 +765,9 @@ class PurchaseInvoice(BuyingController): self.check_on_hold_or_closed_status() self.update_status_updater_args() + self.update_prevdoc_status() if not self.is_return: - self.update_prevdoc_status() self.update_billing_status_for_zero_amount_refdoc("Purchase Order") self.update_billing_status_in_pr() diff --git a/erpnext/accounts/doctype/sales_invoice/sales_invoice.py b/erpnext/accounts/doctype/sales_invoice/sales_invoice.py index 06e1e58008..dd5f8fd4a1 100644 --- a/erpnext/accounts/doctype/sales_invoice/sales_invoice.py +++ b/erpnext/accounts/doctype/sales_invoice/sales_invoice.py @@ -254,7 +254,7 @@ class SalesInvoice(SellingController): def update_status_updater_args(self): if cint(self.update_stock): - self.status_updater.extend([{ + self.status_updater.append({ 'source_dt':'Sales Invoice Item', 'target_dt':'Sales Order Item', 'target_parent_dt':'Sales Order', @@ -272,21 +272,20 @@ class SalesInvoice(SellingController): 'overflow_type': 'delivery', 'extra_cond': """ and exists(select name from `tabSales Invoice` where name=`tabSales Invoice Item`.parent and update_stock = 1)""" - }, - { - 'source_dt': 'Sales Invoice Item', - 'target_dt': 'Sales Order Item', - 'join_field': 'so_detail', - 'target_field': 'returned_qty', - 'target_parent_dt': 'Sales Order', - # 'target_parent_field': 'per_delivered', - # 'target_ref_field': 'qty', - 'source_field': '-1 * qty', - # 'percent_join_field': 'sales_order', - # 'overflow_type': 'delivery', - 'extra_cond': """ and exists (select name from `tabSales Invoice` where name=`tabSales Invoice Item`.parent and update_stock=1 and is_return=1)""" - } - ]) + }) + if cint(self.is_return): + self.status_updater.append({ + 'source_dt': 'Sales Invoice Item', + 'target_dt': 'Sales Order Item', + 'join_field': 'so_detail', + 'target_field': 'returned_qty', + 'target_parent_dt': 'Sales Order', + 'source_field': '-1 * qty', + 'second_source_dt': 'Delivery Note Item', + 'second_source_field': '-1 * qty', + 'second_join_field': 'so_detail', + 'extra_cond': """ and exists (select name from `tabSales Invoice` where name=`tabSales Invoice Item`.parent and update_stock=1 and is_return=1)""" + }) def check_credit_limit(self): from erpnext.selling.doctype.customer.customer import check_credit_limit diff --git a/erpnext/buying/doctype/purchase_order/test_purchase_order.py b/erpnext/buying/doctype/purchase_order/test_purchase_order.py index 812aad8ea5..820c93c8b7 100644 --- a/erpnext/buying/doctype/purchase_order/test_purchase_order.py +++ b/erpnext/buying/doctype/purchase_order/test_purchase_order.py @@ -108,6 +108,69 @@ class TestPurchaseOrder(unittest.TestCase): self.assertEqual(po.get("items")[0].amount, 1400) self.assertEqual(get_ordered_qty(), existing_ordered_qty + 3) + def test_update_qty(self): + po = create_purchase_order() + + make_pr_against_po(po.name, 6) + + po.load_from_db() + self.assertEqual(po.get("items")[0].received_qty, 6) + + # Check received_qty after make_purchase_invoice without update_stock checked + pi1 = make_purchase_invoice(po.name) + pi1.get("items")[0].qty = 6 + pi1.insert() + pi1.submit() + + po.load_from_db() + self.assertEqual(po.get("items")[0].received_qty, 6) + + # Check received_qty after make_purchase_invoice with update_stock checked + pi2 = make_purchase_invoice(po.name) + pi2.set("update_stock", 1) + pi2.get("items")[0].qty = 3 + pi2.insert() + pi2.submit() + + po.load_from_db() + self.assertEqual(po.get("items")[0].received_qty, 9) + + def test_return_against_purchase_order(self): + po = create_purchase_order() + + pr = make_pr_against_po(po.name, 6) + + po.load_from_db() + self.assertEqual(po.get("items")[0].received_qty, 6) + + pi2 = make_purchase_invoice(po.name) + pi2.set("update_stock", 1) + pi2.get("items")[0].qty = 3 + pi2.insert() + pi2.submit() + + po.load_from_db() + self.assertEqual(po.get("items")[0].received_qty, 9) + + # Make return purchase receipt, purchase invoice and check quantity + from erpnext.stock.doctype.purchase_receipt.test_purchase_receipt \ + import make_purchase_receipt as make_purchase_receipt_return + from erpnext.accounts.doctype.purchase_invoice.test_purchase_invoice \ + import make_purchase_invoice as make_purchase_invoice_return + + pr1 = make_purchase_receipt_return(is_return=1, return_against=pr.name, qty=-3, do_not_submit=True) + pr1.items[0].purchase_order = po.name + pr1.items[0].purchase_order_item = po.items[0].name + pr1.submit() + + pi1= make_purchase_invoice_return(is_return=1, return_against=pi2.name, qty=-1, update_stock=1, do_not_submit=True) + pi1.items[0].purchase_order = po.name + pi1.items[0].po_detail = po.items[0].name + pi1.submit() + + + po.load_from_db() + self.assertEqual(po.get("items")[0].received_qty, 5) def test_make_purchase_invoice(self): po = create_purchase_order(do_not_submit=True) @@ -510,6 +573,13 @@ class TestPurchaseOrder(unittest.TestCase): frappe.db.set_value("Accounts Settings", "Accounts Settings", "unlink_advance_payment_on_cancelation_of_order", 0) +def make_pr_against_po(po, received_qty=0): + pr = make_purchase_receipt(po) + pr.get("items")[0].qty = received_qty or 5 + pr.insert() + pr.submit() + return pr + def make_subcontracted_item(item_code): from erpnext.manufacturing.doctype.production_plan.test_production_plan import make_bom diff --git a/erpnext/selling/doctype/sales_order/test_sales_order.py b/erpnext/selling/doctype/sales_order/test_sales_order.py index 4fca15b707..e7697e2b0e 100644 --- a/erpnext/selling/doctype/sales_order/test_sales_order.py +++ b/erpnext/selling/doctype/sales_order/test_sales_order.py @@ -124,6 +124,44 @@ class TestSalesOrder(unittest.TestCase): so.load_from_db() self.assertEqual(so.get("items")[0].delivered_qty, 9) + def test_return_against_sales_order(self): + so = make_sales_order() + + dn = create_dn_against_so(so.name, 6) + + so.load_from_db() + self.assertEqual(so.get("items")[0].delivered_qty, 6) + + # Check delivered_qty after make_sales_invoice with update_stock checked + si2 = make_sales_invoice(so.name) + si2.set("update_stock", 1) + si2.get("items")[0].qty = 3 + si2.insert() + si2.submit() + + so.load_from_db() + + self.assertEqual(so.get("items")[0].delivered_qty, 9) + + # Make return deliver note, sales invoice and check quantity + from erpnext.stock.doctype.delivery_note.test_delivery_note import create_delivery_note + from erpnext.accounts.doctype.sales_invoice.test_sales_invoice import create_sales_invoice + + dn1 = create_delivery_note(is_return=1, return_against=dn.name, qty=-3, do_not_submit=True) + dn1.items[0].against_sales_order = so.name + dn1.items[0].so_detail = so.items[0].name + dn1.submit() + + si1 = create_sales_invoice(is_return=1, return_against=si2.name, qty=-1, update_stock=1, do_not_submit=True) + si1.items[0].sales_order = so.name + si1.items[0].so_detail = so.items[0].name + si1.submit() + + + so.load_from_db() + self.assertEqual(so.get("items")[0].delivered_qty, 5) + + def test_reserved_qty_for_partial_delivery(self): make_stock_entry(target="_Test Warehouse - _TC", qty=10, rate=100) existing_reserved_qty = get_reserved_qty() diff --git a/erpnext/stock/doctype/delivery_note/delivery_note.py b/erpnext/stock/doctype/delivery_note/delivery_note.py index b8c46045cd..1e1030c540 100644 --- a/erpnext/stock/doctype/delivery_note/delivery_note.py +++ b/erpnext/stock/doctype/delivery_note/delivery_note.py @@ -52,16 +52,20 @@ class DeliveryNote(SellingController): 'percent_join_field': 'against_sales_invoice', 'overflow_type': 'delivery', 'no_tolerance': 1 - }, - { - 'source_dt': 'Delivery Note Item', - 'target_dt': 'Sales Order Item', - 'join_field': 'so_detail', - 'target_field': 'returned_qty', - 'target_parent_dt': 'Sales Order', - 'source_field': '-1 * qty', - 'extra_cond': """ and exists (select name from `tabDelivery Note` where name=`tabDelivery Note Item`.parent and is_return=1)""" }] + if cint(self.is_return): + self.status_updater.append({ + 'source_dt': 'Delivery Note Item', + 'target_dt': 'Sales Order Item', + 'join_field': 'so_detail', + 'target_field': 'returned_qty', + 'target_parent_dt': 'Sales Order', + 'source_field': '-1 * qty', + 'second_source_dt': 'Sales Invoice Item', + 'second_source_field': '-1 * qty', + 'second_join_field': 'so_detail', + 'extra_cond': """ and exists (select name from `tabDelivery Note` where name=`tabDelivery Note Item`.parent and is_return=1)""" + }) def before_print(self): def toggle_print_hide(meta, fieldname): diff --git a/erpnext/stock/doctype/purchase_receipt/purchase_receipt.py b/erpnext/stock/doctype/purchase_receipt/purchase_receipt.py index 1bd55f812f..54a414c4db 100644 --- a/erpnext/stock/doctype/purchase_receipt/purchase_receipt.py +++ b/erpnext/stock/doctype/purchase_receipt/purchase_receipt.py @@ -24,14 +24,17 @@ class PurchaseReceipt(BuyingController): def __init__(self, *args, **kwargs): super(PurchaseReceipt, self).__init__(*args, **kwargs) self.status_updater = [{ - 'source_dt': 'Purchase Receipt Item', 'target_dt': 'Purchase Order Item', 'join_field': 'purchase_order_item', 'target_field': 'received_qty', 'target_parent_dt': 'Purchase Order', 'target_parent_field': 'per_received', 'target_ref_field': 'qty', - 'source_field': 'qty', + 'source_dt': 'Purchase Receipt Item', + 'source_field': 'received_qty', + 'second_source_dt': 'Purchase Invoice Item', + 'second_source_field': 'received_qty', + 'second_join_field': 'po_detail', 'percent_join_field': 'purchase_order', 'overflow_type': 'receipt' }, @@ -58,6 +61,18 @@ class PurchaseReceipt(BuyingController): # 'overflow_type': 'receipt', 'extra_cond': """ and exists (select name from `tabPurchase Receipt` where name=`tabPurchase Receipt Item`.parent and is_return=1)""" }] + if cint(self.is_return): + self.status_updater.append({ + 'source_dt': 'Purchase Receipt Item', + 'target_dt': 'Purchase Order Item', + 'join_field': 'purchase_order_item', + 'target_field': 'returned_qty', + 'source_field': '-1 * qty', + 'second_source_dt': 'Purchase Invoice Item', + 'second_source_field': '-1 * qty', + 'second_join_field': 'po_detail', + 'extra_cond': """ and exists (select name from `tabPurchase Receipt` where name=`tabPurchase Receipt Item`.parent and is_return=1)""" + }) def validate(self): self.validate_posting_time() From 067d3c0c09ce368f312b6f86b66c2c44dc349e6b Mon Sep 17 00:00:00 2001 From: Prasad Ramesh Date: Thu, 16 May 2019 10:18:02 +0530 Subject: [PATCH 63/73] fix: made Sales Partner Comission report visible in Selling module (#17602) --- erpnext/config/selling.py | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/erpnext/config/selling.py b/erpnext/config/selling.py index 63e7ad965d..9209ca96aa 100644 --- a/erpnext/config/selling.py +++ b/erpnext/config/selling.py @@ -299,6 +299,12 @@ def get_data(): "name": "Customers Without Any Sales Transactions", "doctype": "Customer" }, + { + "type": "report", + "is_query_report": True, + "name": "Sales Partners Commission", + "doctype": "Customer" + } ] }, { From fd6ae67b1615d242111cbce6219752a42289b6f4 Mon Sep 17 00:00:00 2001 From: Rushabh Mehta Date: Thu, 16 May 2019 10:25:27 +0530 Subject: [PATCH 64/73] fix: link preview for item and task --- erpnext/projects/doctype/task/task.json | 4 +- erpnext/stock/doctype/item/item.json | 3884 ++--------------------- 2 files changed, 266 insertions(+), 3622 deletions(-) diff --git a/erpnext/projects/doctype/task/task.json b/erpnext/projects/doctype/task/task.json index 905fd4a6e4..269d417800 100644 --- a/erpnext/projects/doctype/task/task.json +++ b/erpnext/projects/doctype/task/task.json @@ -196,6 +196,7 @@ { "fieldname": "description", "fieldtype": "Text Editor", + "in_preview": 1, "label": "Task Description", "oldfieldname": "description", "oldfieldtype": "Text Editor", @@ -351,7 +352,7 @@ "icon": "fa fa-check", "idx": 1, "max_attachments": 5, - "modified": "2019-05-01 13:30:29.458916", + "modified": "2019-05-16 09:51:15.599416", "modified_by": "Administrator", "module": "Projects", "name": "Task", @@ -371,6 +372,7 @@ ], "search_fields": "subject", "show_name_in_global_search": 1, + "show_preview_popup": 1, "sort_order": "DESC", "timeline_field": "project", "title_field": "subject", diff --git a/erpnext/stock/doctype/item/item.json b/erpnext/stock/doctype/item/item.json index 07063444a1..5a287b12f7 100644 --- a/erpnext/stock/doctype/item/item.json +++ b/erpnext/stock/doctype/item/item.json @@ -1,4446 +1,1088 @@ { - "allow_copy": 0, - "allow_events_in_timeline": 0, "allow_guest_to_view": 1, "allow_import": 1, "allow_rename": 1, "autoname": "field:item_code", - "beta": 0, "creation": "2013-05-03 10:45:46", - "custom": 0, - "default_print_format": "", "description": "A Product or a Service that is bought, sold or kept in stock.", - "docstatus": 0, "doctype": "DocType", "document_type": "Setup", "editable_grid": 1, "engine": "InnoDB", + "field_order": [ + "name_and_description_section", + "naming_series", + "item_code", + "variant_of", + "item_name", + "item_group", + "is_item_from_hub", + "stock_uom", + "column_break0", + "disabled", + "allow_alternative_item", + "is_stock_item", + "include_item_in_manufacturing", + "opening_stock", + "valuation_rate", + "standard_rate", + "is_fixed_asset", + "asset_category", + "asset_naming_series", + "tolerance", + "image", + "section_break_11", + "brand", + "description", + "sb_barcodes", + "barcodes", + "inventory_section", + "shelf_life_in_days", + "end_of_life", + "default_material_request_type", + "valuation_method", + "column_break1", + "warranty_period", + "weight_per_unit", + "weight_uom", + "reorder_section", + "reorder_levels", + "unit_of_measure_conversion", + "uoms", + "serial_nos_and_batches", + "has_batch_no", + "create_new_batch", + "batch_number_series", + "has_expiry_date", + "retain_sample", + "sample_quantity", + "column_break_37", + "has_serial_no", + "serial_no_series", + "variants_section", + "has_variants", + "variant_based_on", + "attributes", + "defaults", + "item_defaults", + "purchase_details", + "is_purchase_item", + "purchase_uom", + "min_order_qty", + "safety_stock", + "purchase_details_cb", + "lead_time_days", + "last_purchase_rate", + "is_customer_provided_item", + "customer", + "supplier_details", + "delivered_by_supplier", + "manufacturer", + "manufacturer_part_no", + "column_break2", + "supplier_items", + "foreign_trade_details", + "country_of_origin", + "column_break_59", + "customs_tariff_number", + "sales_details", + "sales_uom", + "is_sales_item", + "column_break3", + "max_discount", + "deferred_revenue", + "deferred_revenue_account", + "enable_deferred_revenue", + "column_break_85", + "no_of_months", + "deferred_expense_section", + "deferred_expense_account", + "enable_deferred_expense", + "column_break_88", + "no_of_months_exp", + "customer_details", + "customer_items", + "item_tax_section_break", + "taxes", + "inspection_criteria", + "inspection_required_before_purchase", + "inspection_required_before_delivery", + "quality_inspection_template", + "manufacturing", + "default_bom", + "is_sub_contracted_item", + "column_break_74", + "customer_code", + "website_section", + "show_in_website", + "show_variant_in_website", + "route", + "weightage", + "slideshow", + "website_image", + "thumbnail", + "cb72", + "website_warehouse", + "website_item_groups", + "set_meta_tags", + "sb72", + "copy_from_item_group", + "website_specifications", + "web_long_description", + "website_content", + "total_projected_qty", + "hub_publishing_sb", + "publish_in_hub", + "hub_category_to_publish", + "hub_warehouse", + "synced_with_hub" + ], "fields": [ { - "allow_bulk_edit": 0, - "allow_in_quick_entry": 0, - "allow_on_submit": 0, - "bold": 0, - "collapsible": 0, - "columns": 0, "fieldname": "name_and_description_section", "fieldtype": "Section Break", - "hidden": 0, - "ignore_user_permissions": 0, - "ignore_xss_filter": 0, - "in_filter": 0, - "in_global_search": 0, - "in_list_view": 0, - "in_standard_filter": 0, - "label": "", - "length": 0, - "no_copy": 0, "oldfieldtype": "Section Break", - "options": "fa fa-flag", - "permlevel": 0, - "precision": "", - "print_hide": 0, - "print_hide_if_no_value": 0, - "read_only": 0, - "remember_last_selected_value": 0, - "report_hide": 0, - "reqd": 0, - "search_index": 0, - "set_only_once": 0, - "translatable": 0, - "unique": 0 + "options": "fa fa-flag" }, { - "allow_bulk_edit": 0, - "allow_in_quick_entry": 0, - "allow_on_submit": 0, - "bold": 0, - "collapsible": 0, - "columns": 0, "fieldname": "naming_series", "fieldtype": "Select", - "hidden": 0, - "ignore_user_permissions": 0, - "ignore_xss_filter": 0, - "in_filter": 0, - "in_global_search": 0, - "in_list_view": 0, - "in_standard_filter": 0, "label": "Series", - "length": 0, - "no_copy": 0, "options": "STO-ITEM-.YYYY.-", - "permlevel": 0, - "precision": "", - "print_hide": 0, - "print_hide_if_no_value": 0, - "read_only": 0, - "remember_last_selected_value": 0, - "report_hide": 0, - "reqd": 0, - "search_index": 0, - "set_only_once": 1, - "translatable": 0, - "unique": 0 + "set_only_once": 1 }, { - "allow_bulk_edit": 0, - "allow_in_quick_entry": 0, - "allow_on_submit": 0, "bold": 1, - "collapsible": 0, - "columns": 0, - "description": "", "fieldname": "item_code", "fieldtype": "Data", - "hidden": 0, - "ignore_user_permissions": 0, - "ignore_xss_filter": 0, - "in_filter": 0, "in_global_search": 1, - "in_list_view": 0, - "in_standard_filter": 0, "label": "Item Code", - "length": 0, - "no_copy": 0, "oldfieldname": "item_code", "oldfieldtype": "Data", - "permlevel": 0, - "precision": "", - "print_hide": 0, - "print_hide_if_no_value": 0, - "read_only": 0, - "remember_last_selected_value": 0, - "report_hide": 0, - "reqd": 0, - "search_index": 0, - "set_only_once": 0, - "translatable": 0, "unique": 1 }, { - "allow_bulk_edit": 0, - "allow_in_quick_entry": 0, - "allow_on_submit": 0, - "bold": 0, - "collapsible": 0, - "columns": 0, "depends_on": "variant_of", "description": "If item is a variant of another item then description, image, pricing, taxes etc will be set from the template unless explicitly specified", "fieldname": "variant_of", "fieldtype": "Link", - "hidden": 0, "ignore_user_permissions": 1, - "ignore_xss_filter": 0, - "in_filter": 0, - "in_global_search": 0, - "in_list_view": 0, "in_standard_filter": 1, "label": "Variant Of", - "length": 0, - "no_copy": 0, "options": "Item", - "permlevel": 0, - "precision": "", - "print_hide": 0, - "print_hide_if_no_value": 0, "read_only": 1, - "remember_last_selected_value": 0, - "report_hide": 0, - "reqd": 0, "search_index": 1, - "set_only_once": 1, - "translatable": 0, - "unique": 0 + "set_only_once": 1 }, { - "allow_bulk_edit": 0, - "allow_in_quick_entry": 0, - "allow_on_submit": 0, "bold": 1, - "collapsible": 0, - "columns": 0, "fieldname": "item_name", "fieldtype": "Data", - "hidden": 0, - "ignore_user_permissions": 0, - "ignore_xss_filter": 0, - "in_filter": 0, "in_global_search": 1, - "in_list_view": 0, - "in_standard_filter": 0, "label": "Item Name", - "length": 0, - "no_copy": 0, "oldfieldname": "item_name", "oldfieldtype": "Data", - "permlevel": 0, - "precision": "", - "print_hide": 0, - "print_hide_if_no_value": 0, - "read_only": 0, - "remember_last_selected_value": 0, - "report_hide": 0, - "reqd": 0, - "search_index": 1, - "set_only_once": 0, - "translatable": 0, - "unique": 0 + "search_index": 1 }, { - "allow_bulk_edit": 0, - "allow_in_quick_entry": 0, - "allow_on_submit": 0, - "bold": 0, - "collapsible": 0, - "columns": 0, - "description": "", "fieldname": "item_group", "fieldtype": "Link", - "hidden": 0, - "ignore_user_permissions": 0, - "ignore_xss_filter": 0, - "in_filter": 0, - "in_global_search": 0, "in_list_view": 1, + "in_preview": 1, "in_standard_filter": 1, "label": "Item Group", - "length": 0, - "no_copy": 0, "oldfieldname": "item_group", "oldfieldtype": "Link", "options": "Item Group", - "permlevel": 0, - "precision": "", - "print_hide": 0, - "print_hide_if_no_value": 0, - "read_only": 0, - "remember_last_selected_value": 0, - "report_hide": 0, "reqd": 1, - "search_index": 1, - "set_only_once": 0, - "translatable": 0, - "unique": 0 + "search_index": 1 }, { - "allow_bulk_edit": 0, - "allow_in_quick_entry": 0, - "allow_on_submit": 0, - "bold": 0, - "collapsible": 0, - "columns": 0, "fieldname": "is_item_from_hub", "fieldtype": "Check", - "hidden": 0, - "ignore_user_permissions": 0, - "ignore_xss_filter": 0, - "in_filter": 0, - "in_global_search": 0, - "in_list_view": 0, - "in_standard_filter": 0, "label": "Is Item from Hub", - "length": 0, - "no_copy": 0, - "permlevel": 0, - "precision": "", - "print_hide": 0, - "print_hide_if_no_value": 0, - "read_only": 1, - "remember_last_selected_value": 0, - "report_hide": 0, - "reqd": 0, - "search_index": 0, - "set_only_once": 0, - "translatable": 0, - "unique": 0 + "read_only": 1 }, { - "allow_bulk_edit": 0, - "allow_in_quick_entry": 0, - "allow_on_submit": 0, - "bold": 0, - "collapsible": 0, - "columns": 0, - "description": "", "fieldname": "stock_uom", "fieldtype": "Link", - "hidden": 0, "ignore_user_permissions": 1, - "ignore_xss_filter": 0, - "in_filter": 0, - "in_global_search": 0, - "in_list_view": 0, - "in_standard_filter": 0, "label": "Default Unit of Measure", - "length": 0, - "no_copy": 0, "oldfieldname": "stock_uom", "oldfieldtype": "Link", "options": "UOM", - "permlevel": 0, - "precision": "", - "print_hide": 0, - "print_hide_if_no_value": 0, - "read_only": 0, - "remember_last_selected_value": 0, - "report_hide": 0, - "reqd": 1, - "search_index": 0, - "set_only_once": 0, - "translatable": 0, - "unique": 0 + "reqd": 1 }, { - "allow_bulk_edit": 0, - "allow_in_quick_entry": 0, - "allow_on_submit": 0, - "bold": 0, - "collapsible": 0, - "columns": 0, "fieldname": "column_break0", - "fieldtype": "Column Break", - "hidden": 0, - "ignore_user_permissions": 0, - "ignore_xss_filter": 0, - "in_filter": 0, - "in_global_search": 0, - "in_list_view": 0, - "in_standard_filter": 0, - "length": 0, - "no_copy": 0, - "permlevel": 0, - "precision": "", - "print_hide": 0, - "print_hide_if_no_value": 0, - "read_only": 0, - "remember_last_selected_value": 0, - "report_hide": 0, - "reqd": 0, - "search_index": 0, - "set_only_once": 0, - "translatable": 0, - "unique": 0 + "fieldtype": "Column Break" }, { - "allow_bulk_edit": 0, - "allow_in_quick_entry": 0, - "allow_on_submit": 0, - "bold": 0, - "collapsible": 0, - "columns": 0, "fieldname": "disabled", "fieldtype": "Check", - "hidden": 0, - "ignore_user_permissions": 0, - "ignore_xss_filter": 0, - "in_filter": 0, - "in_global_search": 0, - "in_list_view": 0, - "in_standard_filter": 0, - "label": "Disabled", - "length": 0, - "no_copy": 0, - "permlevel": 0, - "precision": "", - "print_hide": 0, - "print_hide_if_no_value": 0, - "read_only": 0, - "remember_last_selected_value": 0, - "report_hide": 0, - "reqd": 0, - "search_index": 0, - "set_only_once": 0, - "translatable": 0, - "unique": 0 + "label": "Disabled" }, { - "allow_bulk_edit": 0, - "allow_in_quick_entry": 0, - "allow_on_submit": 0, - "bold": 0, - "collapsible": 0, - "columns": 0, "fieldname": "allow_alternative_item", "fieldtype": "Check", - "hidden": 0, - "ignore_user_permissions": 0, - "ignore_xss_filter": 0, - "in_filter": 0, - "in_global_search": 0, - "in_list_view": 0, - "in_standard_filter": 0, - "label": "Allow Alternative Item", - "length": 0, - "no_copy": 0, - "permlevel": 0, - "precision": "", - "print_hide": 0, - "print_hide_if_no_value": 0, - "read_only": 0, - "remember_last_selected_value": 0, - "report_hide": 0, - "reqd": 0, - "search_index": 0, - "set_only_once": 0, - "translatable": 0, - "unique": 0 + "label": "Allow Alternative Item" }, { - "allow_bulk_edit": 0, - "allow_in_quick_entry": 0, - "allow_on_submit": 0, "bold": 1, - "collapsible": 0, - "columns": 0, "default": "1", - "description": "", "fieldname": "is_stock_item", "fieldtype": "Check", - "hidden": 0, - "ignore_user_permissions": 0, - "ignore_xss_filter": 0, - "in_filter": 0, - "in_global_search": 0, - "in_list_view": 0, - "in_standard_filter": 0, "label": "Maintain Stock", - "length": 0, - "no_copy": 0, "oldfieldname": "is_stock_item", - "oldfieldtype": "Select", - "options": "", - "permlevel": 0, - "precision": "", - "print_hide": 0, - "print_hide_if_no_value": 0, - "read_only": 0, - "remember_last_selected_value": 0, - "report_hide": 0, - "reqd": 0, - "search_index": 0, - "set_only_once": 0, - "translatable": 0, - "unique": 0 + "oldfieldtype": "Select" }, { - "allow_bulk_edit": 0, - "allow_in_quick_entry": 0, - "allow_on_submit": 0, - "bold": 0, - "collapsible": 0, - "columns": 0, "default": "1", "fieldname": "include_item_in_manufacturing", "fieldtype": "Check", - "hidden": 0, - "ignore_user_permissions": 0, - "ignore_xss_filter": 0, - "in_filter": 0, - "in_global_search": 0, - "in_list_view": 0, - "in_standard_filter": 0, - "label": "Include Item In Manufacturing", - "length": 0, - "no_copy": 0, - "permlevel": 0, - "precision": "", - "print_hide": 0, - "print_hide_if_no_value": 0, - "read_only": 0, - "remember_last_selected_value": 0, - "report_hide": 0, - "reqd": 0, - "search_index": 0, - "set_only_once": 0, - "translatable": 0, - "unique": 0 + "label": "Include Item In Manufacturing" }, { - "allow_bulk_edit": 0, - "allow_in_quick_entry": 0, - "allow_on_submit": 0, "bold": 1, - "collapsible": 0, - "columns": 0, "depends_on": "eval:(doc.__islocal&&doc.is_stock_item && !doc.has_serial_no && !doc.has_batch_no)", "fieldname": "opening_stock", "fieldtype": "Float", - "hidden": 0, - "ignore_user_permissions": 0, - "ignore_xss_filter": 0, - "in_filter": 0, - "in_global_search": 0, - "in_list_view": 0, - "in_standard_filter": 0, - "label": "Opening Stock", - "length": 0, - "no_copy": 0, - "permlevel": 0, - "precision": "", - "print_hide": 0, - "print_hide_if_no_value": 0, - "read_only": 0, - "remember_last_selected_value": 0, - "report_hide": 0, - "reqd": 0, - "search_index": 0, - "set_only_once": 0, - "translatable": 0, - "unique": 0 + "label": "Opening Stock" }, { - "allow_bulk_edit": 0, - "allow_in_quick_entry": 0, - "allow_on_submit": 0, - "bold": 0, - "collapsible": 0, - "columns": 0, "depends_on": "is_stock_item", "fieldname": "valuation_rate", "fieldtype": "Currency", - "hidden": 0, - "ignore_user_permissions": 0, - "ignore_xss_filter": 0, - "in_filter": 0, - "in_global_search": 0, - "in_list_view": 0, - "in_standard_filter": 0, - "label": "Valuation Rate", - "length": 0, - "no_copy": 0, - "permlevel": 0, - "precision": "", - "print_hide": 0, - "print_hide_if_no_value": 0, - "read_only": 0, - "remember_last_selected_value": 0, - "report_hide": 0, - "reqd": 0, - "search_index": 0, - "set_only_once": 0, - "translatable": 0, - "unique": 0 + "label": "Valuation Rate" }, { - "allow_bulk_edit": 0, - "allow_in_quick_entry": 0, - "allow_on_submit": 0, "bold": 1, - "collapsible": 0, - "columns": 0, "depends_on": "eval:doc.__islocal", "fieldname": "standard_rate", "fieldtype": "Currency", - "hidden": 0, - "ignore_user_permissions": 0, - "ignore_xss_filter": 0, - "in_filter": 0, - "in_global_search": 0, - "in_list_view": 0, - "in_standard_filter": 0, - "label": "Standard Selling Rate", - "length": 0, - "no_copy": 0, - "permlevel": 0, - "precision": "", - "print_hide": 0, - "print_hide_if_no_value": 0, - "read_only": 0, - "remember_last_selected_value": 0, - "report_hide": 0, - "reqd": 0, - "search_index": 0, - "set_only_once": 0, - "translatable": 0, - "unique": 0 + "label": "Standard Selling Rate" }, { - "allow_bulk_edit": 0, - "allow_in_quick_entry": 0, - "allow_on_submit": 0, - "bold": 0, - "collapsible": 0, - "columns": 0, "fieldname": "is_fixed_asset", "fieldtype": "Check", - "hidden": 0, - "ignore_user_permissions": 0, - "ignore_xss_filter": 0, - "in_filter": 0, - "in_global_search": 0, - "in_list_view": 0, - "in_standard_filter": 0, "label": "Is Fixed Asset", - "length": 0, - "no_copy": 0, - "permlevel": 0, - "precision": "", - "print_hide": 0, - "print_hide_if_no_value": 0, - "read_only": 0, - "remember_last_selected_value": 0, - "report_hide": 0, - "reqd": 0, - "search_index": 0, - "set_only_once": 1, - "translatable": 0, - "unique": 0 + "set_only_once": 1 }, { - "allow_bulk_edit": 0, - "allow_in_quick_entry": 0, - "allow_on_submit": 0, - "bold": 0, - "collapsible": 0, - "columns": 0, "depends_on": "is_fixed_asset", "fieldname": "asset_category", "fieldtype": "Link", - "hidden": 0, - "ignore_user_permissions": 0, - "ignore_xss_filter": 0, - "in_filter": 0, - "in_global_search": 0, - "in_list_view": 0, - "in_standard_filter": 0, "label": "Asset Category", - "length": 0, - "no_copy": 0, - "options": "Asset Category", - "permlevel": 0, - "precision": "", - "print_hide": 0, - "print_hide_if_no_value": 0, - "read_only": 0, - "remember_last_selected_value": 0, - "report_hide": 0, - "reqd": 0, - "search_index": 0, - "set_only_once": 0, - "translatable": 0, - "unique": 0 + "options": "Asset Category" }, { - "allow_bulk_edit": 0, - "allow_in_quick_entry": 0, - "allow_on_submit": 0, - "bold": 0, - "collapsible": 0, - "columns": 0, "depends_on": "is_fixed_asset", "fieldname": "asset_naming_series", "fieldtype": "Select", - "hidden": 0, - "ignore_user_permissions": 0, - "ignore_xss_filter": 0, - "in_filter": 0, - "in_global_search": 0, - "in_list_view": 0, - "in_standard_filter": 0, - "label": "Asset Naming Series", - "length": 0, - "no_copy": 0, - "permlevel": 0, - "precision": "", - "print_hide": 0, - "print_hide_if_no_value": 0, - "read_only": 0, - "remember_last_selected_value": 0, - "report_hide": 0, - "reqd": 0, - "search_index": 0, - "set_only_once": 0, - "translatable": 0, - "unique": 0 + "label": "Asset Naming Series" }, { - "allow_bulk_edit": 0, - "allow_in_quick_entry": 0, - "allow_on_submit": 0, - "bold": 0, - "collapsible": 0, - "columns": 0, "depends_on": "eval:!doc.__islocal", - "description": "", "fieldname": "tolerance", "fieldtype": "Float", - "hidden": 0, - "ignore_user_permissions": 0, - "ignore_xss_filter": 0, - "in_filter": 0, - "in_global_search": 0, - "in_list_view": 0, - "in_standard_filter": 0, "label": "Allow over delivery or receipt upto this percent", - "length": 0, - "no_copy": 0, "oldfieldname": "tolerance", - "oldfieldtype": "Currency", - "permlevel": 0, - "precision": "", - "print_hide": 0, - "print_hide_if_no_value": 0, - "read_only": 0, - "remember_last_selected_value": 0, - "report_hide": 0, - "reqd": 0, - "search_index": 0, - "set_only_once": 0, - "translatable": 0, - "unique": 0 + "oldfieldtype": "Currency" }, { - "allow_bulk_edit": 0, - "allow_in_quick_entry": 0, - "allow_on_submit": 0, - "bold": 0, - "collapsible": 0, - "columns": 0, "fieldname": "image", "fieldtype": "Attach Image", "hidden": 1, - "ignore_user_permissions": 0, - "ignore_xss_filter": 0, - "in_filter": 0, - "in_global_search": 0, - "in_list_view": 0, - "in_standard_filter": 0, + "in_preview": 1, "label": "Image", - "length": 0, - "no_copy": 0, "options": "image", - "permlevel": 0, - "precision": "", - "print_hide": 1, - "print_hide_if_no_value": 0, - "read_only": 0, - "remember_last_selected_value": 0, - "report_hide": 0, - "reqd": 0, - "search_index": 0, - "set_only_once": 0, - "translatable": 0, - "unique": 0 + "print_hide": 1 }, { - "allow_bulk_edit": 0, - "allow_in_quick_entry": 0, - "allow_on_submit": 0, - "bold": 0, "collapsible": 1, - "columns": 0, "fieldname": "section_break_11", "fieldtype": "Section Break", - "hidden": 0, - "ignore_user_permissions": 0, - "ignore_xss_filter": 0, - "in_filter": 0, - "in_global_search": 0, - "in_list_view": 0, - "in_standard_filter": 0, - "label": "Description", - "length": 0, - "no_copy": 0, - "permlevel": 0, - "precision": "", - "print_hide": 0, - "print_hide_if_no_value": 0, - "read_only": 0, - "remember_last_selected_value": 0, - "report_hide": 0, - "reqd": 0, - "search_index": 0, - "set_only_once": 0, - "translatable": 0, - "unique": 0 + "label": "Description" }, { - "allow_bulk_edit": 0, - "allow_in_quick_entry": 0, - "allow_on_submit": 0, - "bold": 0, - "collapsible": 0, - "columns": 0, "fieldname": "brand", "fieldtype": "Link", - "hidden": 0, - "ignore_user_permissions": 0, - "ignore_xss_filter": 0, - "in_filter": 0, - "in_global_search": 0, - "in_list_view": 0, - "in_standard_filter": 0, "label": "Brand", - "length": 0, - "no_copy": 0, "oldfieldname": "brand", "oldfieldtype": "Link", "options": "Brand", - "permlevel": 0, - "precision": "", - "print_hide": 1, - "print_hide_if_no_value": 0, - "read_only": 0, - "remember_last_selected_value": 0, - "report_hide": 0, - "reqd": 0, - "search_index": 0, - "set_only_once": 0, - "translatable": 0, - "unique": 0 + "print_hide": 1 }, { - "allow_bulk_edit": 0, - "allow_in_quick_entry": 0, - "allow_on_submit": 0, - "bold": 0, - "collapsible": 0, - "columns": 0, "fieldname": "description", "fieldtype": "Text Editor", - "hidden": 0, - "ignore_user_permissions": 0, - "ignore_xss_filter": 0, - "in_filter": 0, - "in_global_search": 0, - "in_list_view": 0, - "in_standard_filter": 0, + "in_preview": 1, "label": "Description", - "length": 0, - "no_copy": 0, "oldfieldname": "description", - "oldfieldtype": "Text", - "permlevel": 0, - "precision": "", - "print_hide": 0, - "print_hide_if_no_value": 0, - "read_only": 0, - "remember_last_selected_value": 0, - "report_hide": 0, - "reqd": 0, - "search_index": 0, - "set_only_once": 0, - "translatable": 0, - "unique": 0 + "oldfieldtype": "Text" }, { - "allow_bulk_edit": 0, - "allow_in_quick_entry": 0, - "allow_on_submit": 0, - "bold": 0, - "collapsible": 0, - "columns": 0, "fieldname": "sb_barcodes", "fieldtype": "Section Break", - "hidden": 0, - "ignore_user_permissions": 0, - "ignore_xss_filter": 0, - "in_filter": 0, - "in_global_search": 0, - "in_list_view": 0, - "in_standard_filter": 0, - "label": "Barcodes", - "length": 0, - "no_copy": 0, - "permlevel": 0, - "precision": "", - "print_hide": 0, - "print_hide_if_no_value": 0, - "read_only": 0, - "remember_last_selected_value": 0, - "report_hide": 0, - "reqd": 0, - "search_index": 0, - "set_only_once": 0, - "translatable": 0, - "unique": 0 + "label": "Barcodes" }, { - "allow_bulk_edit": 0, - "allow_in_quick_entry": 0, - "allow_on_submit": 0, - "bold": 0, - "collapsible": 0, - "columns": 0, "fieldname": "barcodes", "fieldtype": "Table", - "hidden": 0, - "ignore_user_permissions": 0, - "ignore_xss_filter": 0, - "in_filter": 0, - "in_global_search": 0, - "in_list_view": 0, - "in_standard_filter": 0, "label": "Barcodes", - "length": 0, - "no_copy": 0, - "options": "Item Barcode", - "permlevel": 0, - "precision": "", - "print_hide": 0, - "print_hide_if_no_value": 0, - "read_only": 0, - "remember_last_selected_value": 0, - "report_hide": 0, - "reqd": 0, - "search_index": 0, - "set_only_once": 0, - "translatable": 0, - "unique": 0 + "options": "Item Barcode" }, { - "allow_bulk_edit": 0, - "allow_in_quick_entry": 0, - "allow_on_submit": 0, - "bold": 0, "collapsible": 1, "collapsible_depends_on": "is_stock_item", - "columns": 0, "depends_on": "is_stock_item", "fieldname": "inventory_section", "fieldtype": "Section Break", - "hidden": 0, - "ignore_user_permissions": 0, - "ignore_xss_filter": 0, - "in_filter": 0, - "in_global_search": 0, - "in_list_view": 0, - "in_standard_filter": 0, "label": "Inventory", - "length": 0, - "no_copy": 0, "oldfieldtype": "Section Break", - "options": "fa fa-truck", - "permlevel": 0, - "precision": "", - "print_hide": 0, - "print_hide_if_no_value": 0, - "read_only": 0, - "remember_last_selected_value": 0, - "report_hide": 0, - "reqd": 0, - "search_index": 0, - "set_only_once": 0, - "translatable": 0, - "unique": 0 + "options": "fa fa-truck" }, { - "allow_bulk_edit": 0, - "allow_in_quick_entry": 0, - "allow_on_submit": 0, - "bold": 0, - "collapsible": 0, - "columns": 0, "fieldname": "shelf_life_in_days", "fieldtype": "Int", - "hidden": 0, - "ignore_user_permissions": 0, - "ignore_xss_filter": 0, - "in_filter": 0, - "in_global_search": 0, - "in_list_view": 0, - "in_standard_filter": 0, - "label": "Shelf Life In Days", - "length": 0, - "no_copy": 0, - "permlevel": 0, - "precision": "", - "print_hide": 0, - "print_hide_if_no_value": 0, - "read_only": 0, - "remember_last_selected_value": 0, - "report_hide": 0, - "reqd": 0, - "search_index": 0, - "set_only_once": 0, - "translatable": 0, - "unique": 0 + "label": "Shelf Life In Days" }, { - "allow_bulk_edit": 0, - "allow_in_quick_entry": 0, - "allow_on_submit": 0, - "bold": 0, - "collapsible": 0, - "columns": 0, "default": "2099-12-31", "depends_on": "is_stock_item", "fieldname": "end_of_life", "fieldtype": "Date", - "hidden": 0, - "ignore_user_permissions": 0, - "ignore_xss_filter": 0, - "in_filter": 0, - "in_global_search": 0, - "in_list_view": 0, - "in_standard_filter": 0, "label": "End of Life", - "length": 0, - "no_copy": 0, "oldfieldname": "end_of_life", - "oldfieldtype": "Date", - "permlevel": 0, - "precision": "", - "print_hide": 0, - "print_hide_if_no_value": 0, - "read_only": 0, - "remember_last_selected_value": 0, - "report_hide": 0, - "reqd": 0, - "search_index": 0, - "set_only_once": 0, - "translatable": 0, - "unique": 0 + "oldfieldtype": "Date" }, { - "allow_bulk_edit": 0, - "allow_in_quick_entry": 0, - "allow_on_submit": 0, - "bold": 0, - "collapsible": 0, - "columns": 0, "default": "Purchase", "fieldname": "default_material_request_type", "fieldtype": "Select", - "hidden": 0, - "ignore_user_permissions": 0, - "ignore_xss_filter": 0, - "in_filter": 0, - "in_global_search": 0, - "in_list_view": 0, - "in_standard_filter": 0, "label": "Default Material Request Type", - "length": 0, - "no_copy": 0, - "options": "Purchase\nMaterial Transfer\nMaterial Issue\nManufacture\nCustomer Provided", - "permlevel": 0, - "precision": "", - "print_hide": 0, - "print_hide_if_no_value": 0, - "read_only": 0, - "remember_last_selected_value": 0, - "report_hide": 0, - "reqd": 0, - "search_index": 0, - "set_only_once": 0, - "translatable": 0, - "unique": 0 + "options": "Purchase\nMaterial Transfer\nMaterial Issue\nManufacture\nCustomer Provided" }, { - "allow_bulk_edit": 0, - "allow_in_quick_entry": 0, - "allow_on_submit": 0, - "bold": 0, - "collapsible": 0, - "columns": 0, "depends_on": "is_stock_item", "fieldname": "valuation_method", "fieldtype": "Select", - "hidden": 0, - "ignore_user_permissions": 0, - "ignore_xss_filter": 0, - "in_filter": 0, - "in_global_search": 0, - "in_list_view": 0, - "in_standard_filter": 0, "label": "Valuation Method", - "length": 0, - "no_copy": 0, "options": "\nFIFO\nMoving Average", - "permlevel": 0, - "precision": "", - "print_hide": 0, - "print_hide_if_no_value": 0, - "read_only": 0, - "remember_last_selected_value": 0, - "report_hide": 0, - "reqd": 0, - "search_index": 0, - "set_only_once": 1, - "translatable": 0, - "unique": 0 + "set_only_once": 1 }, { - "allow_bulk_edit": 0, - "allow_in_quick_entry": 0, - "allow_on_submit": 0, - "bold": 0, - "collapsible": 0, - "columns": 0, "depends_on": "is_stock_item", "fieldname": "column_break1", "fieldtype": "Column Break", - "hidden": 0, - "ignore_user_permissions": 0, - "ignore_xss_filter": 0, - "in_filter": 0, - "in_global_search": 0, - "in_list_view": 0, - "in_standard_filter": 0, - "length": 0, - "no_copy": 0, "oldfieldtype": "Column Break", - "permlevel": 0, - "precision": "", - "print_hide": 0, - "print_hide_if_no_value": 0, - "read_only": 0, - "remember_last_selected_value": 0, - "report_hide": 0, - "reqd": 0, - "search_index": 0, - "set_only_once": 0, - "translatable": 0, - "unique": 0, "width": "50%" }, { - "allow_bulk_edit": 0, - "allow_in_quick_entry": 0, - "allow_on_submit": 0, - "bold": 0, - "collapsible": 0, - "columns": 0, "depends_on": "eval:doc.is_stock_item", "fieldname": "warranty_period", "fieldtype": "Data", - "hidden": 0, - "ignore_user_permissions": 0, - "ignore_xss_filter": 0, - "in_filter": 0, - "in_global_search": 0, - "in_list_view": 0, - "in_standard_filter": 0, "label": "Warranty Period (in days)", - "length": 0, - "no_copy": 0, "oldfieldname": "warranty_period", - "oldfieldtype": "Data", - "permlevel": 0, - "precision": "", - "print_hide": 0, - "print_hide_if_no_value": 0, - "read_only": 0, - "remember_last_selected_value": 0, - "report_hide": 0, - "reqd": 0, - "search_index": 0, - "set_only_once": 0, - "translatable": 0, - "unique": 0 + "oldfieldtype": "Data" }, { - "allow_bulk_edit": 0, - "allow_in_quick_entry": 0, - "allow_on_submit": 0, - "bold": 0, - "collapsible": 0, - "columns": 0, "depends_on": "is_stock_item", - "description": "", "fieldname": "weight_per_unit", "fieldtype": "Float", - "hidden": 0, - "ignore_user_permissions": 0, - "ignore_xss_filter": 0, - "in_filter": 0, - "in_global_search": 0, - "in_list_view": 0, - "in_standard_filter": 0, - "label": "Weight Per Unit", - "length": 0, - "no_copy": 0, - "permlevel": 0, - "precision": "", - "print_hide": 0, - "print_hide_if_no_value": 0, - "read_only": 0, - "remember_last_selected_value": 0, - "report_hide": 0, - "reqd": 0, - "search_index": 0, - "set_only_once": 0, - "translatable": 0, - "unique": 0 + "label": "Weight Per Unit" }, { - "allow_bulk_edit": 0, - "allow_in_quick_entry": 0, - "allow_on_submit": 0, - "bold": 0, - "collapsible": 0, - "columns": 0, "depends_on": "eval:doc.is_stock_item", "fieldname": "weight_uom", "fieldtype": "Link", - "hidden": 0, "ignore_user_permissions": 1, - "ignore_xss_filter": 0, - "in_filter": 0, - "in_global_search": 0, - "in_list_view": 0, - "in_standard_filter": 0, "label": "Weight UOM", - "length": 0, - "no_copy": 0, - "options": "UOM", - "permlevel": 0, - "precision": "", - "print_hide": 0, - "print_hide_if_no_value": 0, - "read_only": 0, - "remember_last_selected_value": 0, - "report_hide": 0, - "reqd": 0, - "search_index": 0, - "set_only_once": 0, - "translatable": 0, - "unique": 0 + "options": "UOM" }, { - "allow_bulk_edit": 0, - "allow_in_quick_entry": 0, - "allow_on_submit": 0, - "bold": 0, "collapsible": 1, - "columns": 0, "depends_on": "is_stock_item", - "description": "", "fieldname": "reorder_section", "fieldtype": "Section Break", - "hidden": 0, - "ignore_user_permissions": 0, - "ignore_xss_filter": 0, - "in_filter": 0, - "in_global_search": 0, - "in_list_view": 0, - "in_standard_filter": 0, "label": "Auto re-order", - "length": 0, - "no_copy": 0, - "options": "fa fa-rss", - "permlevel": 0, - "precision": "", - "print_hide": 0, - "print_hide_if_no_value": 0, - "read_only": 0, - "remember_last_selected_value": 0, - "report_hide": 0, - "reqd": 0, - "search_index": 0, - "set_only_once": 0, - "translatable": 0, - "unique": 0 + "options": "fa fa-rss" }, { - "allow_bulk_edit": 0, - "allow_in_quick_entry": 0, - "allow_on_submit": 0, - "bold": 0, - "collapsible": 0, - "columns": 0, - "depends_on": "", "description": "Will also apply for variants unless overrridden", "fieldname": "reorder_levels", "fieldtype": "Table", - "hidden": 0, - "ignore_user_permissions": 0, - "ignore_xss_filter": 0, - "in_filter": 0, - "in_global_search": 0, - "in_list_view": 0, - "in_standard_filter": 0, "label": "Reorder level based on Warehouse", - "length": 0, - "no_copy": 0, - "options": "Item Reorder", - "permlevel": 0, - "precision": "", - "print_hide": 0, - "print_hide_if_no_value": 0, - "read_only": 0, - "remember_last_selected_value": 0, - "report_hide": 0, - "reqd": 0, - "search_index": 0, - "set_only_once": 0, - "translatable": 0, - "unique": 0 + "options": "Item Reorder" }, { - "allow_bulk_edit": 0, - "allow_in_quick_entry": 0, - "allow_on_submit": 0, - "bold": 0, "collapsible": 1, - "columns": 0, - "depends_on": "", "fieldname": "unit_of_measure_conversion", "fieldtype": "Section Break", - "hidden": 0, - "ignore_user_permissions": 0, - "ignore_xss_filter": 0, - "in_filter": 0, - "in_global_search": 0, - "in_list_view": 0, - "in_standard_filter": 0, - "label": "Units of Measure", - "length": 0, - "no_copy": 0, - "permlevel": 0, - "precision": "", - "print_hide": 0, - "print_hide_if_no_value": 0, - "read_only": 0, - "remember_last_selected_value": 0, - "report_hide": 0, - "reqd": 0, - "search_index": 0, - "set_only_once": 0, - "translatable": 0, - "unique": 0 + "label": "Units of Measure" }, { - "allow_bulk_edit": 0, - "allow_in_quick_entry": 0, - "allow_on_submit": 0, - "bold": 0, - "collapsible": 0, - "columns": 0, - "depends_on": "", "description": "Will also apply for variants", "fieldname": "uoms", "fieldtype": "Table", - "hidden": 0, - "ignore_user_permissions": 0, - "ignore_xss_filter": 0, - "in_filter": 0, - "in_global_search": 0, - "in_list_view": 0, - "in_standard_filter": 0, "label": "UOMs", - "length": 0, - "no_copy": 0, "oldfieldname": "uom_conversion_details", "oldfieldtype": "Table", - "options": "UOM Conversion Detail", - "permlevel": 0, - "precision": "", - "print_hide": 0, - "print_hide_if_no_value": 0, - "read_only": 0, - "remember_last_selected_value": 0, - "report_hide": 0, - "reqd": 0, - "search_index": 0, - "set_only_once": 0, - "translatable": 0, - "unique": 0 + "options": "UOM Conversion Detail" }, { - "allow_bulk_edit": 0, - "allow_in_quick_entry": 0, - "allow_on_submit": 0, - "bold": 0, "collapsible": 1, "collapsible_depends_on": "eval:doc.has_batch_no || doc.has_serial_no || doc.is_fixed_asset", - "columns": 0, "depends_on": "eval:doc.is_stock_item || doc.is_fixed_asset", "fieldname": "serial_nos_and_batches", "fieldtype": "Section Break", - "hidden": 0, - "ignore_user_permissions": 0, - "ignore_xss_filter": 0, - "in_filter": 0, - "in_global_search": 0, - "in_list_view": 0, - "in_standard_filter": 0, - "label": "Serial Nos and Batches", - "length": 0, - "no_copy": 0, - "permlevel": 0, - "precision": "", - "print_hide": 0, - "print_hide_if_no_value": 0, - "read_only": 0, - "remember_last_selected_value": 0, - "report_hide": 0, - "reqd": 0, - "search_index": 0, - "set_only_once": 0, - "translatable": 0, - "unique": 0 + "label": "Serial Nos and Batches" }, { - "allow_bulk_edit": 0, - "allow_in_quick_entry": 0, - "allow_on_submit": 0, - "bold": 0, - "collapsible": 0, - "columns": 0, - "default": "", "depends_on": "eval:doc.is_stock_item", "fieldname": "has_batch_no", "fieldtype": "Check", - "hidden": 0, - "ignore_user_permissions": 0, - "ignore_xss_filter": 0, - "in_filter": 0, - "in_global_search": 0, - "in_list_view": 0, - "in_standard_filter": 0, "label": "Has Batch No", - "length": 0, "no_copy": 1, "oldfieldname": "has_batch_no", - "oldfieldtype": "Select", - "options": "", - "permlevel": 0, - "precision": "", - "print_hide": 0, - "print_hide_if_no_value": 0, - "read_only": 0, - "remember_last_selected_value": 0, - "report_hide": 0, - "reqd": 0, - "search_index": 0, - "set_only_once": 0, - "translatable": 0, - "unique": 0 + "oldfieldtype": "Select" }, { - "allow_bulk_edit": 0, - "allow_in_quick_entry": 0, - "allow_on_submit": 0, - "bold": 0, - "collapsible": 0, - "columns": 0, "depends_on": "has_batch_no", - "description": "", "fieldname": "create_new_batch", "fieldtype": "Check", - "hidden": 0, - "ignore_user_permissions": 0, - "ignore_xss_filter": 0, - "in_filter": 0, - "in_global_search": 0, - "in_list_view": 0, - "in_standard_filter": 0, - "label": "Automatically Create New Batch", - "length": 0, - "no_copy": 0, - "permlevel": 0, - "precision": "", - "print_hide": 0, - "print_hide_if_no_value": 0, - "read_only": 0, - "remember_last_selected_value": 0, - "report_hide": 0, - "reqd": 0, - "search_index": 0, - "set_only_once": 0, - "translatable": 0, - "unique": 0 + "label": "Automatically Create New Batch" }, { - "allow_bulk_edit": 0, - "allow_in_quick_entry": 0, - "allow_on_submit": 0, - "bold": 0, - "collapsible": 0, - "columns": 0, "depends_on": "eval:doc.has_batch_no==1 && doc.create_new_batch==1", "description": "Example: ABCD.#####. If series is set and Batch No is not mentioned in transactions, then automatic batch number will be created based on this series. If you always want to explicitly mention Batch No for this item, leave this blank. Note: this setting will take priority over the Naming Series Prefix in Stock Settings.", "fieldname": "batch_number_series", "fieldtype": "Data", - "hidden": 0, - "ignore_user_permissions": 0, - "ignore_xss_filter": 0, - "in_filter": 0, - "in_global_search": 0, - "in_list_view": 0, - "in_standard_filter": 0, "label": "Batch Number Series", - "length": 0, - "no_copy": 0, - "permlevel": 0, - "precision": "", - "print_hide": 0, - "print_hide_if_no_value": 0, - "read_only": 0, - "remember_last_selected_value": 0, - "report_hide": 0, - "reqd": 0, - "search_index": 0, - "set_only_once": 0, - "translatable": 1, - "unique": 0 + "translatable": 1 }, { - "allow_bulk_edit": 0, - "allow_in_quick_entry": 0, - "allow_on_submit": 0, - "bold": 0, - "collapsible": 0, - "columns": 0, "depends_on": "has_batch_no", "fieldname": "has_expiry_date", "fieldtype": "Check", - "hidden": 0, - "ignore_user_permissions": 0, - "ignore_xss_filter": 0, - "in_filter": 0, - "in_global_search": 0, - "in_list_view": 0, - "in_standard_filter": 0, - "label": "Has Expiry Date", - "length": 0, - "no_copy": 0, - "permlevel": 0, - "precision": "", - "print_hide": 0, - "print_hide_if_no_value": 0, - "read_only": 0, - "remember_last_selected_value": 0, - "report_hide": 0, - "reqd": 0, - "search_index": 0, - "set_only_once": 0, - "translatable": 0, - "unique": 0 + "label": "Has Expiry Date" }, { - "allow_bulk_edit": 0, - "allow_in_quick_entry": 0, - "allow_on_submit": 0, - "bold": 0, - "collapsible": 0, - "columns": 0, "depends_on": "has_batch_no", "fieldname": "retain_sample", "fieldtype": "Check", - "hidden": 0, - "ignore_user_permissions": 0, - "ignore_xss_filter": 0, - "in_filter": 0, - "in_global_search": 0, - "in_list_view": 0, - "in_standard_filter": 0, - "label": "Retain Sample", - "length": 0, - "no_copy": 0, - "permlevel": 0, - "precision": "", - "print_hide": 0, - "print_hide_if_no_value": 0, - "read_only": 0, - "remember_last_selected_value": 0, - "report_hide": 0, - "reqd": 0, - "search_index": 0, - "set_only_once": 0, - "translatable": 0, - "unique": 0 + "label": "Retain Sample" }, { - "allow_bulk_edit": 0, - "allow_in_quick_entry": 0, - "allow_on_submit": 0, - "bold": 0, - "collapsible": 0, - "columns": 0, "depends_on": "eval: (doc.retain_sample && doc.has_batch_no)", "description": "Maximum sample quantity that can be retained", "fieldname": "sample_quantity", "fieldtype": "Int", - "hidden": 0, - "ignore_user_permissions": 0, - "ignore_xss_filter": 0, - "in_filter": 0, - "in_global_search": 0, - "in_list_view": 0, - "in_standard_filter": 0, - "label": "Max Sample Quantity", - "length": 0, - "no_copy": 0, - "permlevel": 0, - "precision": "", - "print_hide": 0, - "print_hide_if_no_value": 0, - "read_only": 0, - "remember_last_selected_value": 0, - "report_hide": 0, - "reqd": 0, - "search_index": 0, - "set_only_once": 0, - "translatable": 0, - "unique": 0 + "label": "Max Sample Quantity" }, { - "allow_bulk_edit": 0, - "allow_in_quick_entry": 0, - "allow_on_submit": 0, - "bold": 0, - "collapsible": 0, - "columns": 0, "fieldname": "column_break_37", - "fieldtype": "Column Break", - "hidden": 0, - "ignore_user_permissions": 0, - "ignore_xss_filter": 0, - "in_filter": 0, - "in_global_search": 0, - "in_list_view": 0, - "in_standard_filter": 0, - "length": 0, - "no_copy": 0, - "permlevel": 0, - "precision": "", - "print_hide": 0, - "print_hide_if_no_value": 0, - "read_only": 0, - "remember_last_selected_value": 0, - "report_hide": 0, - "reqd": 0, - "search_index": 0, - "set_only_once": 0, - "translatable": 0, - "unique": 0 + "fieldtype": "Column Break" }, { - "allow_bulk_edit": 0, - "allow_in_quick_entry": 0, - "allow_on_submit": 0, - "bold": 0, - "collapsible": 0, - "columns": 0, - "default": "", "depends_on": "eval:doc.is_stock_item || doc.is_fixed_asset", - "description": "", "fieldname": "has_serial_no", "fieldtype": "Check", - "hidden": 0, - "ignore_user_permissions": 0, - "ignore_xss_filter": 0, - "in_filter": 0, - "in_global_search": 0, - "in_list_view": 0, - "in_standard_filter": 0, "label": "Has Serial No", - "length": 0, "no_copy": 1, "oldfieldname": "has_serial_no", - "oldfieldtype": "Select", - "options": "", - "permlevel": 0, - "precision": "", - "print_hide": 0, - "print_hide_if_no_value": 0, - "read_only": 0, - "remember_last_selected_value": 0, - "report_hide": 0, - "reqd": 0, - "search_index": 0, - "set_only_once": 0, - "translatable": 0, - "unique": 0 + "oldfieldtype": "Select" }, { - "allow_bulk_edit": 0, - "allow_in_quick_entry": 0, - "allow_on_submit": 0, - "bold": 0, - "collapsible": 0, - "columns": 0, "depends_on": "eval:doc.is_stock_item || doc.is_fixed_asset", "description": "Example: ABCD.#####\nIf series is set and Serial No is not mentioned in transactions, then automatic serial number will be created based on this series. If you always want to explicitly mention Serial Nos for this item. leave this blank.", "fieldname": "serial_no_series", "fieldtype": "Data", - "hidden": 0, - "ignore_user_permissions": 0, - "ignore_xss_filter": 0, - "in_filter": 0, - "in_global_search": 0, - "in_list_view": 0, - "in_standard_filter": 0, - "label": "Serial Number Series", - "length": 0, - "no_copy": 0, - "permlevel": 0, - "precision": "", - "print_hide": 0, - "print_hide_if_no_value": 0, - "read_only": 0, - "remember_last_selected_value": 0, - "report_hide": 0, - "reqd": 0, - "search_index": 0, - "set_only_once": 0, - "translatable": 0, - "unique": 0 + "label": "Serial Number Series" }, { - "allow_bulk_edit": 0, - "allow_in_quick_entry": 0, - "allow_on_submit": 0, - "bold": 0, "collapsible": 1, "collapsible_depends_on": "attributes", - "columns": 0, - "depends_on": "", "fieldname": "variants_section", "fieldtype": "Section Break", - "hidden": 0, - "ignore_user_permissions": 0, - "ignore_xss_filter": 0, - "in_filter": 0, - "in_global_search": 0, - "in_list_view": 0, - "in_standard_filter": 0, - "label": "Variants", - "length": 0, - "no_copy": 0, - "permlevel": 0, - "precision": "", - "print_hide": 0, - "print_hide_if_no_value": 0, - "read_only": 0, - "remember_last_selected_value": 0, - "report_hide": 0, - "reqd": 0, - "search_index": 0, - "set_only_once": 0, - "translatable": 0, - "unique": 0 + "label": "Variants" }, { - "allow_bulk_edit": 0, - "allow_in_quick_entry": 0, - "allow_on_submit": 0, - "bold": 0, - "collapsible": 0, - "columns": 0, "default": "0", "depends_on": "eval:!doc.variant_of", "description": "If this item has variants, then it cannot be selected in sales orders etc.", "fieldname": "has_variants", "fieldtype": "Check", - "hidden": 0, - "ignore_user_permissions": 0, - "ignore_xss_filter": 0, - "in_filter": 0, - "in_global_search": 0, - "in_list_view": 0, "in_standard_filter": 1, "label": "Has Variants", - "length": 0, - "no_copy": 1, - "options": "", - "permlevel": 0, - "precision": "", - "print_hide": 0, - "print_hide_if_no_value": 0, - "read_only": 0, - "remember_last_selected_value": 0, - "report_hide": 0, - "reqd": 0, - "search_index": 0, - "set_only_once": 0, - "translatable": 0, - "unique": 0 + "no_copy": 1 }, { - "allow_bulk_edit": 0, - "allow_in_quick_entry": 0, - "allow_on_submit": 0, - "bold": 0, - "collapsible": 0, - "columns": 0, "default": "Item Attribute", "depends_on": "has_variants", "fieldname": "variant_based_on", "fieldtype": "Select", - "hidden": 0, - "ignore_user_permissions": 0, - "ignore_xss_filter": 0, - "in_filter": 0, - "in_global_search": 0, - "in_list_view": 0, - "in_standard_filter": 0, "label": "Variant Based On", - "length": 0, - "no_copy": 0, - "options": "Item Attribute\nManufacturer", - "permlevel": 0, - "precision": "", - "print_hide": 0, - "print_hide_if_no_value": 0, - "read_only": 0, - "remember_last_selected_value": 0, - "report_hide": 0, - "reqd": 0, - "search_index": 0, - "set_only_once": 0, - "translatable": 0, - "unique": 0 + "options": "Item Attribute\nManufacturer" }, { - "allow_bulk_edit": 0, - "allow_in_quick_entry": 0, - "allow_on_submit": 0, - "bold": 0, - "collapsible": 0, - "columns": 0, "depends_on": "eval:(doc.has_variants || doc.variant_of) && doc.variant_based_on==='Item Attribute'", "fieldname": "attributes", "fieldtype": "Table", "hidden": 1, - "ignore_user_permissions": 0, - "ignore_xss_filter": 0, - "in_filter": 0, - "in_global_search": 0, - "in_list_view": 0, - "in_standard_filter": 0, "label": "Attributes", - "length": 0, "no_copy": 1, - "options": "Item Variant Attribute", - "permlevel": 0, - "precision": "", - "print_hide": 0, - "print_hide_if_no_value": 0, - "read_only": 0, - "remember_last_selected_value": 0, - "report_hide": 0, - "reqd": 0, - "search_index": 0, - "set_only_once": 0, - "translatable": 0, - "unique": 0 + "options": "Item Variant Attribute" }, { - "allow_bulk_edit": 0, - "allow_in_quick_entry": 0, - "allow_on_submit": 0, - "bold": 0, - "collapsible": 0, - "columns": 0, "fieldname": "defaults", "fieldtype": "Section Break", - "hidden": 0, - "ignore_user_permissions": 0, - "ignore_xss_filter": 0, - "in_filter": 0, - "in_global_search": 0, - "in_list_view": 0, - "in_standard_filter": 0, - "label": "Sales, Purchase, Accounting Defaults", - "length": 0, - "no_copy": 0, - "permlevel": 0, - "precision": "", - "print_hide": 0, - "print_hide_if_no_value": 0, - "read_only": 0, - "remember_last_selected_value": 0, - "report_hide": 0, - "reqd": 0, - "search_index": 0, - "set_only_once": 0, - "translatable": 0, - "unique": 0 + "label": "Sales, Purchase, Accounting Defaults" }, { - "allow_bulk_edit": 0, - "allow_in_quick_entry": 0, - "allow_on_submit": 0, - "bold": 0, - "collapsible": 0, - "columns": 0, "fieldname": "item_defaults", "fieldtype": "Table", - "hidden": 0, - "ignore_user_permissions": 0, - "ignore_xss_filter": 0, - "in_filter": 0, - "in_global_search": 0, - "in_list_view": 0, - "in_standard_filter": 0, "label": "Item Defaults", - "length": 0, - "no_copy": 0, - "options": "Item Default", - "permlevel": 0, - "precision": "", - "print_hide": 0, - "print_hide_if_no_value": 0, - "read_only": 0, - "remember_last_selected_value": 0, - "report_hide": 0, - "reqd": 0, - "search_index": 0, - "set_only_once": 0, - "translatable": 0, - "unique": 0 + "options": "Item Default" }, { - "allow_bulk_edit": 0, - "allow_in_quick_entry": 0, - "allow_on_submit": 0, - "bold": 0, "collapsible": 1, - "columns": 0, "fieldname": "purchase_details", "fieldtype": "Section Break", - "hidden": 0, - "ignore_user_permissions": 0, - "ignore_xss_filter": 0, - "in_filter": 0, - "in_global_search": 0, - "in_list_view": 0, - "in_standard_filter": 0, "label": "Purchase, Replenishment Details", - "length": 0, - "no_copy": 0, "oldfieldtype": "Section Break", - "options": "fa fa-shopping-cart", - "permlevel": 0, - "precision": "", - "print_hide": 0, - "print_hide_if_no_value": 0, - "read_only": 0, - "remember_last_selected_value": 0, - "report_hide": 0, - "reqd": 0, - "search_index": 0, - "set_only_once": 0, - "translatable": 0, - "unique": 0 + "options": "fa fa-shopping-cart" }, { - "allow_bulk_edit": 0, - "allow_in_quick_entry": 0, - "allow_on_submit": 0, - "bold": 0, - "collapsible": 0, - "columns": 0, "default": "1", "fieldname": "is_purchase_item", "fieldtype": "Check", - "hidden": 0, - "ignore_user_permissions": 0, - "ignore_xss_filter": 0, - "in_filter": 0, - "in_global_search": 0, - "in_list_view": 0, - "in_standard_filter": 0, - "label": "Is Purchase Item", - "length": 0, - "no_copy": 0, - "permlevel": 0, - "precision": "", - "print_hide": 0, - "print_hide_if_no_value": 0, - "read_only": 0, - "remember_last_selected_value": 0, - "report_hide": 0, - "reqd": 0, - "search_index": 0, - "set_only_once": 0, - "translatable": 0, - "unique": 0 + "label": "Is Purchase Item" }, { - "allow_bulk_edit": 0, - "allow_in_quick_entry": 0, - "allow_on_submit": 0, - "bold": 0, - "collapsible": 0, - "columns": 0, "fieldname": "purchase_uom", "fieldtype": "Link", - "hidden": 0, - "ignore_user_permissions": 0, - "ignore_xss_filter": 0, - "in_filter": 0, - "in_global_search": 0, - "in_list_view": 0, - "in_standard_filter": 0, "label": "Default Purchase Unit of Measure", - "length": 0, - "no_copy": 0, - "options": "UOM", - "permlevel": 0, - "precision": "", - "print_hide": 0, - "print_hide_if_no_value": 0, - "read_only": 0, - "remember_last_selected_value": 0, - "report_hide": 0, - "reqd": 0, - "search_index": 0, - "set_only_once": 0, - "translatable": 0, - "unique": 0 + "options": "UOM" }, { - "allow_bulk_edit": 0, - "allow_in_quick_entry": 0, - "allow_on_submit": 0, - "bold": 0, - "collapsible": 0, - "columns": 0, "default": "0.00", "depends_on": "is_stock_item", - "description": "", "fieldname": "min_order_qty", "fieldtype": "Float", - "hidden": 0, - "ignore_user_permissions": 0, - "ignore_xss_filter": 0, - "in_filter": 0, - "in_global_search": 0, - "in_list_view": 0, - "in_standard_filter": 0, "label": "Minimum Order Qty", - "length": 0, - "no_copy": 0, "oldfieldname": "min_order_qty", - "oldfieldtype": "Currency", - "permlevel": 0, - "precision": "", - "print_hide": 0, - "print_hide_if_no_value": 0, - "read_only": 0, - "remember_last_selected_value": 0, - "report_hide": 0, - "reqd": 0, - "search_index": 0, - "set_only_once": 0, - "translatable": 0, - "unique": 0 + "oldfieldtype": "Currency" }, { - "allow_bulk_edit": 0, - "allow_in_quick_entry": 0, - "allow_on_submit": 0, - "bold": 0, - "collapsible": 0, - "columns": 0, "fieldname": "safety_stock", "fieldtype": "Float", - "hidden": 0, - "ignore_user_permissions": 0, - "ignore_xss_filter": 0, - "in_filter": 0, - "in_global_search": 0, - "in_list_view": 0, - "in_standard_filter": 0, - "label": "Safety Stock", - "length": 0, - "no_copy": 0, - "permlevel": 0, - "precision": "", - "print_hide": 0, - "print_hide_if_no_value": 0, - "read_only": 0, - "remember_last_selected_value": 0, - "report_hide": 0, - "reqd": 0, - "search_index": 0, - "set_only_once": 0, - "translatable": 0, - "unique": 0 + "label": "Safety Stock" }, { - "allow_bulk_edit": 0, - "allow_in_quick_entry": 0, - "allow_on_submit": 0, - "bold": 0, - "collapsible": 0, - "columns": 0, "fieldname": "purchase_details_cb", - "fieldtype": "Column Break", - "hidden": 0, - "ignore_user_permissions": 0, - "ignore_xss_filter": 0, - "in_filter": 0, - "in_global_search": 0, - "in_list_view": 0, - "in_standard_filter": 0, - "label": "", - "length": 0, - "no_copy": 0, - "permlevel": 0, - "precision": "", - "print_hide": 0, - "print_hide_if_no_value": 0, - "read_only": 0, - "remember_last_selected_value": 0, - "report_hide": 0, - "reqd": 0, - "search_index": 0, - "set_only_once": 0, - "translatable": 0, - "unique": 0 + "fieldtype": "Column Break" }, { - "allow_bulk_edit": 0, - "allow_in_quick_entry": 0, - "allow_on_submit": 0, - "bold": 0, - "collapsible": 0, - "columns": 0, - "depends_on": "", "description": "Average time taken by the supplier to deliver", "fieldname": "lead_time_days", "fieldtype": "Int", - "hidden": 0, - "ignore_user_permissions": 0, - "ignore_xss_filter": 0, - "in_filter": 0, - "in_global_search": 0, - "in_list_view": 0, - "in_standard_filter": 0, "label": "Lead Time in days", - "length": 0, - "no_copy": 0, "oldfieldname": "lead_time_days", - "oldfieldtype": "Int", - "permlevel": 0, - "precision": "", - "print_hide": 0, - "print_hide_if_no_value": 0, - "read_only": 0, - "remember_last_selected_value": 0, - "report_hide": 0, - "reqd": 0, - "search_index": 0, - "set_only_once": 0, - "translatable": 0, - "unique": 0 + "oldfieldtype": "Int" }, { - "allow_bulk_edit": 0, - "allow_in_quick_entry": 0, - "allow_on_submit": 0, - "bold": 0, - "collapsible": 0, - "columns": 0, - "depends_on": "", "fieldname": "last_purchase_rate", "fieldtype": "Float", - "hidden": 0, - "ignore_user_permissions": 0, - "ignore_xss_filter": 0, - "in_filter": 0, - "in_global_search": 0, - "in_list_view": 0, - "in_standard_filter": 0, "label": "Last Purchase Rate", - "length": 0, "no_copy": 1, "oldfieldname": "last_purchase_rate", "oldfieldtype": "Currency", - "permlevel": 0, - "precision": "", - "print_hide": 0, - "print_hide_if_no_value": 0, - "read_only": 1, - "remember_last_selected_value": 0, - "report_hide": 0, - "reqd": 0, - "search_index": 0, - "set_only_once": 0, - "translatable": 0, - "unique": 0 + "read_only": 1 }, { - "allow_bulk_edit": 0, - "allow_in_quick_entry": 0, - "allow_on_submit": 0, - "bold": 0, - "collapsible": 0, - "columns": 0, "fieldname": "is_customer_provided_item", "fieldtype": "Check", - "hidden": 0, - "ignore_user_permissions": 0, - "ignore_xss_filter": 0, - "in_filter": 0, - "in_global_search": 0, - "in_list_view": 0, - "in_standard_filter": 0, - "label": "Is Customer Provided Item", - "length": 0, - "no_copy": 0, - "permlevel": 0, - "precision": "", - "print_hide": 0, - "print_hide_if_no_value": 0, - "read_only": 0, - "remember_last_selected_value": 0, - "report_hide": 0, - "reqd": 0, - "search_index": 0, - "set_only_once": 0, - "translatable": 0, - "unique": 0 + "label": "Is Customer Provided Item" }, { - "allow_bulk_edit": 0, - "allow_in_quick_entry": 0, - "allow_on_submit": 0, - "bold": 0, - "collapsible": 0, - "columns": 0, "depends_on": "eval:doc.is_customer_provided_item==1", "fieldname": "customer", "fieldtype": "Link", - "hidden": 0, - "ignore_user_permissions": 0, - "ignore_xss_filter": 0, - "in_filter": 0, - "in_global_search": 0, - "in_list_view": 0, - "in_standard_filter": 0, "label": "Customer", - "length": 0, - "no_copy": 0, - "options": "Customer", - "permlevel": 0, - "precision": "", - "print_hide": 0, - "print_hide_if_no_value": 0, - "read_only": 0, - "remember_last_selected_value": 0, - "report_hide": 0, - "reqd": 0, - "search_index": 0, - "set_only_once": 0, - "translatable": 0, - "unique": 0 + "options": "Customer" }, { - "allow_bulk_edit": 0, - "allow_in_quick_entry": 0, - "allow_on_submit": 0, - "bold": 0, "collapsible": 1, - "columns": 0, - "depends_on": "", "fieldname": "supplier_details", "fieldtype": "Section Break", - "hidden": 0, - "ignore_user_permissions": 0, - "ignore_xss_filter": 0, - "in_filter": 0, - "in_global_search": 0, - "in_list_view": 0, - "in_standard_filter": 0, - "label": "Supplier Details", - "length": 0, - "no_copy": 0, - "permlevel": 0, - "precision": "", - "print_hide": 0, - "print_hide_if_no_value": 0, - "read_only": 0, - "remember_last_selected_value": 0, - "report_hide": 0, - "reqd": 0, - "search_index": 0, - "set_only_once": 0, - "translatable": 0, - "unique": 0 + "label": "Supplier Details" }, { - "allow_bulk_edit": 0, - "allow_in_quick_entry": 0, - "allow_on_submit": 0, - "bold": 0, - "collapsible": 0, - "columns": 0, "fieldname": "delivered_by_supplier", "fieldtype": "Check", - "hidden": 0, - "ignore_user_permissions": 0, - "ignore_xss_filter": 0, - "in_filter": 0, - "in_global_search": 0, - "in_list_view": 0, - "in_standard_filter": 0, "label": "Delivered by Supplier (Drop Ship)", - "length": 0, - "no_copy": 0, - "permlevel": 0, - "precision": "", - "print_hide": 1, - "print_hide_if_no_value": 0, - "read_only": 0, - "remember_last_selected_value": 0, - "report_hide": 0, - "reqd": 0, - "search_index": 0, - "set_only_once": 0, - "translatable": 0, - "unique": 0 + "print_hide": 1 }, { - "allow_bulk_edit": 0, - "allow_in_quick_entry": 0, - "allow_on_submit": 0, - "bold": 0, - "collapsible": 0, - "columns": 0, - "depends_on": "", "fieldname": "manufacturer", "fieldtype": "Link", - "hidden": 0, - "ignore_user_permissions": 0, - "ignore_xss_filter": 0, - "in_filter": 0, - "in_global_search": 0, - "in_list_view": 0, - "in_standard_filter": 0, "label": "Manufacturer", - "length": 0, - "no_copy": 0, - "options": "Manufacturer", - "permlevel": 0, - "precision": "", - "print_hide": 0, - "print_hide_if_no_value": 0, - "read_only": 0, - "remember_last_selected_value": 0, - "report_hide": 0, - "reqd": 0, - "search_index": 0, - "set_only_once": 0, - "translatable": 0, - "unique": 0 + "options": "Manufacturer" }, { - "allow_bulk_edit": 0, - "allow_in_quick_entry": 0, - "allow_on_submit": 0, - "bold": 0, - "collapsible": 0, - "columns": 0, - "depends_on": "", "fieldname": "manufacturer_part_no", "fieldtype": "Data", - "hidden": 0, - "ignore_user_permissions": 0, - "ignore_xss_filter": 0, - "in_filter": 0, - "in_global_search": 0, - "in_list_view": 0, - "in_standard_filter": 0, - "label": "Manufacturer Part Number", - "length": 0, - "no_copy": 0, - "permlevel": 0, - "precision": "", - "print_hide": 0, - "print_hide_if_no_value": 0, - "read_only": 0, - "remember_last_selected_value": 0, - "report_hide": 0, - "reqd": 0, - "search_index": 0, - "set_only_once": 0, - "translatable": 0, - "unique": 0 + "label": "Manufacturer Part Number" }, { - "allow_bulk_edit": 0, - "allow_in_quick_entry": 0, - "allow_on_submit": 0, - "bold": 0, - "collapsible": 0, - "columns": 0, - "depends_on": "", "fieldname": "column_break2", "fieldtype": "Column Break", - "hidden": 0, - "ignore_user_permissions": 0, - "ignore_xss_filter": 0, - "in_filter": 0, - "in_global_search": 0, - "in_list_view": 0, - "in_standard_filter": 0, "label": "Item Code for Suppliers", - "length": 0, - "no_copy": 0, "oldfieldtype": "Column Break", - "permlevel": 0, - "precision": "", - "print_hide": 0, - "print_hide_if_no_value": 0, - "read_only": 0, - "remember_last_selected_value": 0, - "report_hide": 0, - "reqd": 0, - "search_index": 0, - "set_only_once": 0, - "translatable": 0, - "unique": 0, "width": "50%" }, { - "allow_bulk_edit": 0, - "allow_in_quick_entry": 0, - "allow_on_submit": 0, - "bold": 0, - "collapsible": 0, - "columns": 0, - "depends_on": "", "fieldname": "supplier_items", "fieldtype": "Table", - "hidden": 0, - "ignore_user_permissions": 0, - "ignore_xss_filter": 0, - "in_filter": 0, - "in_global_search": 0, - "in_list_view": 0, - "in_standard_filter": 0, "label": "Supplier Items", - "length": 0, - "no_copy": 0, - "options": "Item Supplier", - "permlevel": 0, - "precision": "", - "print_hide": 0, - "print_hide_if_no_value": 0, - "read_only": 0, - "remember_last_selected_value": 0, - "report_hide": 0, - "reqd": 0, - "search_index": 0, - "set_only_once": 0, - "translatable": 0, - "unique": 0 + "options": "Item Supplier" }, { - "allow_bulk_edit": 0, - "allow_in_quick_entry": 0, - "allow_on_submit": 0, - "bold": 0, "collapsible": 1, - "columns": 0, "fieldname": "foreign_trade_details", "fieldtype": "Section Break", - "hidden": 0, - "ignore_user_permissions": 0, - "ignore_xss_filter": 0, - "in_filter": 0, - "in_global_search": 0, - "in_list_view": 0, - "in_standard_filter": 0, - "label": "Foreign Trade Details", - "length": 0, - "no_copy": 0, - "permlevel": 0, - "precision": "", - "print_hide": 0, - "print_hide_if_no_value": 0, - "read_only": 0, - "remember_last_selected_value": 0, - "report_hide": 0, - "reqd": 0, - "search_index": 0, - "set_only_once": 0, - "translatable": 0, - "unique": 0 + "label": "Foreign Trade Details" }, { - "allow_bulk_edit": 0, - "allow_in_quick_entry": 0, - "allow_on_submit": 0, - "bold": 0, - "collapsible": 0, - "columns": 0, "fieldname": "country_of_origin", "fieldtype": "Link", - "hidden": 0, - "ignore_user_permissions": 0, - "ignore_xss_filter": 0, - "in_filter": 0, - "in_global_search": 0, - "in_list_view": 0, - "in_standard_filter": 0, "label": "Country of Origin", - "length": 0, - "no_copy": 0, - "options": "Country", - "permlevel": 0, - "precision": "", - "print_hide": 0, - "print_hide_if_no_value": 0, - "read_only": 0, - "remember_last_selected_value": 0, - "report_hide": 0, - "reqd": 0, - "search_index": 0, - "set_only_once": 0, - "translatable": 0, - "unique": 0 + "options": "Country" }, { - "allow_bulk_edit": 0, - "allow_in_quick_entry": 0, - "allow_on_submit": 0, - "bold": 0, - "collapsible": 0, - "columns": 0, "fieldname": "column_break_59", - "fieldtype": "Column Break", - "hidden": 0, - "ignore_user_permissions": 0, - "ignore_xss_filter": 0, - "in_filter": 0, - "in_global_search": 0, - "in_list_view": 0, - "in_standard_filter": 0, - "length": 0, - "no_copy": 0, - "permlevel": 0, - "precision": "", - "print_hide": 0, - "print_hide_if_no_value": 0, - "read_only": 0, - "remember_last_selected_value": 0, - "report_hide": 0, - "reqd": 0, - "search_index": 0, - "set_only_once": 0, - "translatable": 0, - "unique": 0 + "fieldtype": "Column Break" }, { - "allow_bulk_edit": 0, - "allow_in_quick_entry": 0, - "allow_on_submit": 0, - "bold": 0, - "collapsible": 0, - "columns": 0, "fieldname": "customs_tariff_number", "fieldtype": "Link", - "hidden": 0, - "ignore_user_permissions": 0, - "ignore_xss_filter": 0, - "in_filter": 0, - "in_global_search": 0, - "in_list_view": 0, - "in_standard_filter": 0, "label": "Customs Tariff Number", - "length": 0, - "no_copy": 0, - "options": "Customs Tariff Number", - "permlevel": 0, - "precision": "", - "print_hide": 0, - "print_hide_if_no_value": 0, - "read_only": 0, - "remember_last_selected_value": 0, - "report_hide": 0, - "reqd": 0, - "search_index": 0, - "set_only_once": 0, - "translatable": 0, - "unique": 0 + "options": "Customs Tariff Number" }, { - "allow_bulk_edit": 0, - "allow_in_quick_entry": 0, - "allow_on_submit": 0, - "bold": 0, "collapsible": 1, - "columns": 0, "fieldname": "sales_details", "fieldtype": "Section Break", - "hidden": 0, - "ignore_user_permissions": 0, - "ignore_xss_filter": 0, - "in_filter": 0, - "in_global_search": 0, - "in_list_view": 0, - "in_standard_filter": 0, "label": "Sales Details", - "length": 0, - "no_copy": 0, "oldfieldtype": "Section Break", - "options": "fa fa-tag", - "permlevel": 0, - "precision": "", - "print_hide": 0, - "print_hide_if_no_value": 0, - "read_only": 0, - "remember_last_selected_value": 0, - "report_hide": 0, - "reqd": 0, - "search_index": 0, - "set_only_once": 0, - "translatable": 0, - "unique": 0 + "options": "fa fa-tag" }, { - "allow_bulk_edit": 0, - "allow_in_quick_entry": 0, - "allow_on_submit": 0, - "bold": 0, - "collapsible": 0, - "columns": 0, "fieldname": "sales_uom", "fieldtype": "Link", - "hidden": 0, - "ignore_user_permissions": 0, - "ignore_xss_filter": 0, - "in_filter": 0, - "in_global_search": 0, - "in_list_view": 0, - "in_standard_filter": 0, "label": "Default Sales Unit of Measure", - "length": 0, - "no_copy": 0, - "options": "UOM", - "permlevel": 0, - "precision": "", - "print_hide": 0, - "print_hide_if_no_value": 0, - "read_only": 0, - "remember_last_selected_value": 0, - "report_hide": 0, - "reqd": 0, - "search_index": 0, - "set_only_once": 0, - "translatable": 0, - "unique": 0 + "options": "UOM" }, { - "allow_bulk_edit": 0, - "allow_in_quick_entry": 0, - "allow_on_submit": 0, - "bold": 0, - "collapsible": 0, - "columns": 0, "default": "1", "fieldname": "is_sales_item", "fieldtype": "Check", - "hidden": 0, - "ignore_user_permissions": 0, - "ignore_xss_filter": 0, - "in_filter": 0, - "in_global_search": 0, - "in_list_view": 0, - "in_standard_filter": 0, - "label": "Is Sales Item", - "length": 0, - "no_copy": 0, - "permlevel": 0, - "precision": "", - "print_hide": 0, - "print_hide_if_no_value": 0, - "read_only": 0, - "remember_last_selected_value": 0, - "report_hide": 0, - "reqd": 0, - "search_index": 0, - "set_only_once": 0, - "translatable": 0, - "unique": 0 + "label": "Is Sales Item" }, { - "allow_bulk_edit": 0, - "allow_in_quick_entry": 0, - "allow_on_submit": 0, - "bold": 0, - "collapsible": 0, - "columns": 0, - "depends_on": "", "fieldname": "column_break3", "fieldtype": "Column Break", - "hidden": 0, - "ignore_user_permissions": 0, - "ignore_xss_filter": 0, - "in_filter": 0, - "in_global_search": 0, - "in_list_view": 0, - "in_standard_filter": 0, - "label": "", - "length": 0, - "no_copy": 0, "oldfieldtype": "Column Break", - "permlevel": 0, - "precision": "", - "print_hide": 0, - "print_hide_if_no_value": 0, - "read_only": 0, - "remember_last_selected_value": 0, - "report_hide": 0, - "reqd": 0, - "search_index": 0, - "set_only_once": 0, - "translatable": 0, - "unique": 0, "width": "50%" }, { - "allow_bulk_edit": 0, - "allow_in_quick_entry": 0, - "allow_on_submit": 0, - "bold": 0, - "collapsible": 0, - "columns": 0, - "depends_on": "", "fieldname": "max_discount", "fieldtype": "Float", - "hidden": 0, - "ignore_user_permissions": 0, - "ignore_xss_filter": 0, - "in_filter": 0, - "in_global_search": 0, - "in_list_view": 0, - "in_standard_filter": 0, "label": "Max Discount (%)", - "length": 0, - "no_copy": 0, "oldfieldname": "max_discount", - "oldfieldtype": "Currency", - "permlevel": 0, - "precision": "", - "print_hide": 0, - "print_hide_if_no_value": 0, - "read_only": 0, - "remember_last_selected_value": 0, - "report_hide": 0, - "reqd": 0, - "search_index": 0, - "set_only_once": 0, - "translatable": 0, - "unique": 0 + "oldfieldtype": "Currency" }, { - "allow_bulk_edit": 0, - "allow_in_quick_entry": 0, - "allow_on_submit": 0, - "bold": 0, "collapsible": 1, - "columns": 0, "fieldname": "deferred_revenue", "fieldtype": "Section Break", - "hidden": 0, - "ignore_user_permissions": 0, - "ignore_xss_filter": 0, - "in_filter": 0, - "in_global_search": 0, - "in_list_view": 0, - "in_standard_filter": 0, - "label": "Deferred Revenue", - "length": 0, - "no_copy": 0, - "permlevel": 0, - "precision": "", - "print_hide": 0, - "print_hide_if_no_value": 0, - "read_only": 0, - "remember_last_selected_value": 0, - "report_hide": 0, - "reqd": 0, - "search_index": 0, - "set_only_once": 0, - "translatable": 0, - "unique": 0 + "label": "Deferred Revenue" }, { - "allow_bulk_edit": 0, - "allow_in_quick_entry": 0, - "allow_on_submit": 0, - "bold": 0, - "collapsible": 0, - "columns": 0, "depends_on": "enable_deferred_revenue", "fieldname": "deferred_revenue_account", "fieldtype": "Link", - "hidden": 0, "ignore_user_permissions": 1, - "ignore_xss_filter": 0, - "in_filter": 0, - "in_global_search": 0, - "in_list_view": 0, - "in_standard_filter": 0, "label": "Deferred Revenue Account", - "length": 0, - "no_copy": 0, - "options": "Account", - "permlevel": 0, - "precision": "", - "print_hide": 0, - "print_hide_if_no_value": 0, - "read_only": 0, - "remember_last_selected_value": 0, - "report_hide": 0, - "reqd": 0, - "search_index": 0, - "set_only_once": 0, - "translatable": 0, - "unique": 0 + "options": "Account" }, { - "allow_bulk_edit": 0, - "allow_in_quick_entry": 0, - "allow_on_submit": 0, - "bold": 0, - "collapsible": 0, - "columns": 0, "fieldname": "enable_deferred_revenue", "fieldtype": "Check", - "hidden": 0, - "ignore_user_permissions": 0, - "ignore_xss_filter": 0, - "in_filter": 0, - "in_global_search": 0, - "in_list_view": 0, - "in_standard_filter": 0, - "label": "Enable Deferred Revenue", - "length": 0, - "no_copy": 0, - "permlevel": 0, - "precision": "", - "print_hide": 0, - "print_hide_if_no_value": 0, - "read_only": 0, - "remember_last_selected_value": 0, - "report_hide": 0, - "reqd": 0, - "search_index": 0, - "set_only_once": 0, - "translatable": 0, - "unique": 0 + "label": "Enable Deferred Revenue" }, { - "allow_bulk_edit": 0, - "allow_in_quick_entry": 0, - "allow_on_submit": 0, - "bold": 0, - "collapsible": 0, - "columns": 0, "fieldname": "column_break_85", - "fieldtype": "Column Break", - "hidden": 0, - "ignore_user_permissions": 0, - "ignore_xss_filter": 0, - "in_filter": 0, - "in_global_search": 0, - "in_list_view": 0, - "in_standard_filter": 0, - "length": 0, - "no_copy": 0, - "permlevel": 0, - "precision": "", - "print_hide": 0, - "print_hide_if_no_value": 0, - "read_only": 0, - "remember_last_selected_value": 0, - "report_hide": 0, - "reqd": 0, - "search_index": 0, - "set_only_once": 0, - "translatable": 0, - "unique": 0 + "fieldtype": "Column Break" }, { - "allow_bulk_edit": 0, - "allow_in_quick_entry": 0, - "allow_on_submit": 0, - "bold": 0, - "collapsible": 0, - "columns": 0, "depends_on": "enable_deferred_revenue", "fieldname": "no_of_months", "fieldtype": "Int", - "hidden": 0, - "ignore_user_permissions": 0, - "ignore_xss_filter": 0, - "in_filter": 0, - "in_global_search": 0, - "in_list_view": 0, - "in_standard_filter": 0, - "label": "No of Months", - "length": 0, - "no_copy": 0, - "permlevel": 0, - "precision": "", - "print_hide": 0, - "print_hide_if_no_value": 0, - "read_only": 0, - "remember_last_selected_value": 0, - "report_hide": 0, - "reqd": 0, - "search_index": 0, - "set_only_once": 0, - "translatable": 0, - "unique": 0 + "label": "No of Months" }, { - "allow_bulk_edit": 0, - "allow_in_quick_entry": 0, - "allow_on_submit": 0, - "bold": 0, "collapsible": 1, - "columns": 0, "fieldname": "deferred_expense_section", "fieldtype": "Section Break", - "hidden": 0, - "ignore_user_permissions": 0, - "ignore_xss_filter": 0, - "in_filter": 0, - "in_global_search": 0, - "in_list_view": 0, - "in_standard_filter": 0, - "label": "Deferred Expense", - "length": 0, - "no_copy": 0, - "permlevel": 0, - "precision": "", - "print_hide": 0, - "print_hide_if_no_value": 0, - "read_only": 0, - "remember_last_selected_value": 0, - "report_hide": 0, - "reqd": 0, - "search_index": 0, - "set_only_once": 0, - "translatable": 0, - "unique": 0 + "label": "Deferred Expense" }, { - "allow_bulk_edit": 0, - "allow_in_quick_entry": 0, - "allow_on_submit": 0, - "bold": 0, - "collapsible": 0, - "columns": 0, "depends_on": "enable_deferred_expense", "fieldname": "deferred_expense_account", "fieldtype": "Link", - "hidden": 0, "ignore_user_permissions": 1, - "ignore_xss_filter": 0, - "in_filter": 0, - "in_global_search": 0, - "in_list_view": 0, - "in_standard_filter": 0, "label": "Deferred Expense Account", - "length": 0, - "no_copy": 0, - "options": "Account", - "permlevel": 0, - "precision": "", - "print_hide": 0, - "print_hide_if_no_value": 0, - "read_only": 0, - "remember_last_selected_value": 0, - "report_hide": 0, - "reqd": 0, - "search_index": 0, - "set_only_once": 0, - "translatable": 0, - "unique": 0 + "options": "Account" }, { - "allow_bulk_edit": 0, - "allow_in_quick_entry": 0, - "allow_on_submit": 0, - "bold": 0, - "collapsible": 0, - "columns": 0, "fieldname": "enable_deferred_expense", "fieldtype": "Check", - "hidden": 0, - "ignore_user_permissions": 0, - "ignore_xss_filter": 0, - "in_filter": 0, - "in_global_search": 0, - "in_list_view": 0, - "in_standard_filter": 0, - "label": "Enable Deferred Expense", - "length": 0, - "no_copy": 0, - "permlevel": 0, - "precision": "", - "print_hide": 0, - "print_hide_if_no_value": 0, - "read_only": 0, - "remember_last_selected_value": 0, - "report_hide": 0, - "reqd": 0, - "search_index": 0, - "set_only_once": 0, - "translatable": 0, - "unique": 0 + "label": "Enable Deferred Expense" }, { - "allow_bulk_edit": 0, - "allow_in_quick_entry": 0, - "allow_on_submit": 0, - "bold": 0, - "collapsible": 0, - "columns": 0, "fieldname": "column_break_88", - "fieldtype": "Column Break", - "hidden": 0, - "ignore_user_permissions": 0, - "ignore_xss_filter": 0, - "in_filter": 0, - "in_global_search": 0, - "in_list_view": 0, - "in_standard_filter": 0, - "length": 0, - "no_copy": 0, - "permlevel": 0, - "precision": "", - "print_hide": 0, - "print_hide_if_no_value": 0, - "read_only": 0, - "remember_last_selected_value": 0, - "report_hide": 0, - "reqd": 0, - "search_index": 0, - "set_only_once": 0, - "translatable": 0, - "unique": 0 + "fieldtype": "Column Break" }, { - "allow_bulk_edit": 0, - "allow_in_quick_entry": 0, - "allow_on_submit": 0, - "bold": 0, - "collapsible": 0, - "columns": 0, "depends_on": "enable_deferred_expense", "fieldname": "no_of_months_exp", "fieldtype": "Int", - "hidden": 0, - "ignore_user_permissions": 0, - "ignore_xss_filter": 0, - "in_filter": 0, - "in_global_search": 0, - "in_list_view": 0, - "in_standard_filter": 0, - "label": "No of Months", - "length": 0, - "no_copy": 0, - "permlevel": 0, - "precision": "", - "print_hide": 0, - "print_hide_if_no_value": 0, - "read_only": 0, - "remember_last_selected_value": 0, - "report_hide": 0, - "reqd": 0, - "search_index": 0, - "set_only_once": 0, - "translatable": 0, - "unique": 0 + "label": "No of Months" }, { - "allow_bulk_edit": 0, - "allow_in_quick_entry": 0, - "allow_on_submit": 0, - "bold": 0, "collapsible": 1, - "columns": 0, "fieldname": "customer_details", "fieldtype": "Section Break", - "hidden": 0, - "ignore_user_permissions": 0, - "ignore_xss_filter": 0, - "in_filter": 0, - "in_global_search": 0, - "in_list_view": 0, - "in_standard_filter": 0, - "label": "Customer Details", - "length": 0, - "no_copy": 0, - "permlevel": 0, - "precision": "", - "print_hide": 0, - "print_hide_if_no_value": 0, - "read_only": 0, - "remember_last_selected_value": 0, - "report_hide": 0, - "reqd": 0, - "search_index": 0, - "set_only_once": 0, - "translatable": 0, - "unique": 0 + "label": "Customer Details" }, { - "allow_bulk_edit": 0, - "allow_in_quick_entry": 0, - "allow_on_submit": 0, - "bold": 0, - "collapsible": 0, - "columns": 0, - "depends_on": "", - "description": "", "fieldname": "customer_items", "fieldtype": "Table", - "hidden": 0, - "ignore_user_permissions": 0, - "ignore_xss_filter": 0, - "in_filter": 0, - "in_global_search": 0, - "in_list_view": 0, - "in_standard_filter": 0, "label": "Customer Items", - "length": 0, - "no_copy": 0, - "options": "Item Customer Detail", - "permlevel": 0, - "precision": "", - "print_hide": 0, - "print_hide_if_no_value": 0, - "read_only": 0, - "remember_last_selected_value": 0, - "report_hide": 0, - "reqd": 0, - "search_index": 0, - "set_only_once": 0, - "translatable": 0, - "unique": 0 + "options": "Item Customer Detail" }, { - "allow_bulk_edit": 0, - "allow_in_quick_entry": 0, - "allow_on_submit": 0, - "bold": 0, "collapsible": 1, "collapsible_depends_on": "taxes", - "columns": 0, "fieldname": "item_tax_section_break", "fieldtype": "Section Break", - "hidden": 0, - "ignore_user_permissions": 0, - "ignore_xss_filter": 0, - "in_filter": 0, - "in_global_search": 0, - "in_list_view": 0, - "in_standard_filter": 0, "label": "Item Tax", - "length": 0, - "no_copy": 0, "oldfieldtype": "Section Break", - "options": "fa fa-money", - "permlevel": 0, - "precision": "", - "print_hide": 0, - "print_hide_if_no_value": 0, - "read_only": 0, - "remember_last_selected_value": 0, - "report_hide": 0, - "reqd": 0, - "search_index": 0, - "set_only_once": 0, - "translatable": 0, - "unique": 0 + "options": "fa fa-money" }, { - "allow_bulk_edit": 0, - "allow_in_quick_entry": 0, - "allow_on_submit": 0, - "bold": 0, - "collapsible": 0, - "columns": 0, "description": "Will also apply for variants", "fieldname": "taxes", "fieldtype": "Table", - "hidden": 0, - "ignore_user_permissions": 0, - "ignore_xss_filter": 0, - "in_filter": 0, - "in_global_search": 0, - "in_list_view": 0, - "in_standard_filter": 0, "label": "Taxes", - "length": 0, - "no_copy": 0, "oldfieldname": "item_tax", "oldfieldtype": "Table", - "options": "Item Tax", - "permlevel": 0, - "precision": "", - "print_hide": 0, - "print_hide_if_no_value": 0, - "read_only": 0, - "remember_last_selected_value": 0, - "report_hide": 0, - "reqd": 0, - "search_index": 0, - "set_only_once": 0, - "translatable": 0, - "unique": 0 + "options": "Item Tax" }, { - "allow_bulk_edit": 0, - "allow_in_quick_entry": 0, - "allow_on_submit": 0, - "bold": 0, "collapsible": 1, - "columns": 0, "fieldname": "inspection_criteria", "fieldtype": "Section Break", - "hidden": 0, - "ignore_user_permissions": 0, - "ignore_xss_filter": 0, - "in_filter": 0, - "in_global_search": 0, - "in_list_view": 0, - "in_standard_filter": 0, "label": "Inspection Criteria", - "length": 0, - "no_copy": 0, "oldfieldtype": "Section Break", - "options": "fa fa-search", - "permlevel": 0, - "precision": "", - "print_hide": 0, - "print_hide_if_no_value": 0, - "read_only": 0, - "remember_last_selected_value": 0, - "report_hide": 0, - "reqd": 0, - "search_index": 0, - "set_only_once": 0, - "translatable": 0, - "unique": 0 + "options": "fa fa-search" }, { - "allow_bulk_edit": 0, - "allow_in_quick_entry": 0, - "allow_on_submit": 0, - "bold": 0, - "collapsible": 0, - "columns": 0, - "default": "", "fieldname": "inspection_required_before_purchase", "fieldtype": "Check", - "hidden": 0, - "ignore_user_permissions": 0, - "ignore_xss_filter": 0, - "in_filter": 0, - "in_global_search": 0, - "in_list_view": 0, - "in_standard_filter": 0, "label": "Inspection Required before Purchase", - "length": 0, - "no_copy": 0, "oldfieldname": "inspection_required", - "oldfieldtype": "Select", - "options": "", - "permlevel": 0, - "precision": "", - "print_hide": 0, - "print_hide_if_no_value": 0, - "read_only": 0, - "remember_last_selected_value": 0, - "report_hide": 0, - "reqd": 0, - "search_index": 0, - "set_only_once": 0, - "translatable": 0, - "unique": 0 + "oldfieldtype": "Select" }, { - "allow_bulk_edit": 0, - "allow_in_quick_entry": 0, - "allow_on_submit": 0, - "bold": 0, - "collapsible": 0, - "columns": 0, "fieldname": "inspection_required_before_delivery", "fieldtype": "Check", - "hidden": 0, - "ignore_user_permissions": 0, - "ignore_xss_filter": 0, - "in_filter": 0, - "in_global_search": 0, - "in_list_view": 0, - "in_standard_filter": 0, - "label": "Inspection Required before Delivery", - "length": 0, - "no_copy": 0, - "permlevel": 0, - "precision": "", - "print_hide": 0, - "print_hide_if_no_value": 0, - "read_only": 0, - "remember_last_selected_value": 0, - "report_hide": 0, - "reqd": 0, - "search_index": 0, - "set_only_once": 0, - "translatable": 0, - "unique": 0 + "label": "Inspection Required before Delivery" }, { - "allow_bulk_edit": 0, - "allow_in_quick_entry": 0, - "allow_on_submit": 0, - "bold": 0, - "collapsible": 0, - "columns": 0, "depends_on": "eval:(doc.inspection_required_before_purchase || doc.inspection_required_before_delivery)", "fieldname": "quality_inspection_template", "fieldtype": "Link", - "hidden": 0, - "ignore_user_permissions": 0, - "ignore_xss_filter": 0, - "in_filter": 0, - "in_global_search": 0, - "in_list_view": 0, - "in_standard_filter": 0, "label": "Quality Inspection Template", - "length": 0, - "no_copy": 0, "options": "Quality Inspection Template", - "permlevel": 0, - "precision": "", - "print_hide": 1, - "print_hide_if_no_value": 0, - "read_only": 0, - "remember_last_selected_value": 0, - "report_hide": 0, - "reqd": 0, - "search_index": 0, - "set_only_once": 0, - "translatable": 0, - "unique": 0 + "print_hide": 1 }, { - "allow_bulk_edit": 0, - "allow_in_quick_entry": 0, - "allow_on_submit": 0, - "bold": 0, "collapsible": 1, - "columns": 0, "depends_on": "is_stock_item", "fieldname": "manufacturing", "fieldtype": "Section Break", - "hidden": 0, - "ignore_user_permissions": 0, - "ignore_xss_filter": 0, - "in_filter": 0, - "in_global_search": 0, - "in_list_view": 0, - "in_standard_filter": 0, "label": "Manufacturing", - "length": 0, - "no_copy": 0, "oldfieldtype": "Section Break", - "options": "fa fa-cogs", - "permlevel": 0, - "precision": "", - "print_hide": 0, - "print_hide_if_no_value": 0, - "read_only": 0, - "remember_last_selected_value": 0, - "report_hide": 0, - "reqd": 0, - "search_index": 0, - "set_only_once": 0, - "translatable": 0, - "unique": 0 + "options": "fa fa-cogs" }, { - "allow_bulk_edit": 0, - "allow_in_quick_entry": 0, - "allow_on_submit": 0, - "bold": 0, - "collapsible": 0, - "columns": 0, - "depends_on": "", "fieldname": "default_bom", "fieldtype": "Link", - "hidden": 0, "ignore_user_permissions": 1, - "ignore_xss_filter": 0, - "in_filter": 0, - "in_global_search": 0, - "in_list_view": 0, - "in_standard_filter": 0, "label": "Default BOM", - "length": 0, "no_copy": 1, "oldfieldname": "default_bom", "oldfieldtype": "Link", "options": "BOM", - "permlevel": 0, - "precision": "", - "print_hide": 0, - "print_hide_if_no_value": 0, - "read_only": 1, - "remember_last_selected_value": 0, - "report_hide": 0, - "reqd": 0, - "search_index": 0, - "set_only_once": 0, - "translatable": 0, - "unique": 0 + "read_only": 1 }, { - "allow_bulk_edit": 0, - "allow_in_quick_entry": 0, - "allow_on_submit": 0, - "bold": 0, - "collapsible": 0, - "columns": 0, - "default": "", "description": "If subcontracted to a vendor", "fieldname": "is_sub_contracted_item", "fieldtype": "Check", - "hidden": 0, - "ignore_user_permissions": 0, - "ignore_xss_filter": 0, - "in_filter": 0, - "in_global_search": 0, - "in_list_view": 0, - "in_standard_filter": 0, "label": "Supply Raw Materials for Purchase", - "length": 0, - "no_copy": 0, "oldfieldname": "is_sub_contracted_item", - "oldfieldtype": "Select", - "options": "", - "permlevel": 0, - "precision": "", - "print_hide": 0, - "print_hide_if_no_value": 0, - "read_only": 0, - "remember_last_selected_value": 0, - "report_hide": 0, - "reqd": 0, - "search_index": 0, - "set_only_once": 0, - "translatable": 0, - "unique": 0 + "oldfieldtype": "Select" }, { - "allow_bulk_edit": 0, - "allow_in_quick_entry": 0, - "allow_on_submit": 0, - "bold": 0, - "collapsible": 0, - "columns": 0, "fieldname": "column_break_74", - "fieldtype": "Column Break", - "hidden": 0, - "ignore_user_permissions": 0, - "ignore_xss_filter": 0, - "in_filter": 0, - "in_global_search": 0, - "in_list_view": 0, - "in_standard_filter": 0, - "length": 0, - "no_copy": 0, - "permlevel": 0, - "precision": "", - "print_hide": 0, - "print_hide_if_no_value": 0, - "read_only": 0, - "remember_last_selected_value": 0, - "report_hide": 0, - "reqd": 0, - "search_index": 0, - "set_only_once": 0, - "translatable": 0, - "unique": 0 + "fieldtype": "Column Break" }, { - "allow_bulk_edit": 0, - "allow_in_quick_entry": 0, - "allow_on_submit": 0, - "bold": 0, - "collapsible": 0, - "columns": 0, "fieldname": "customer_code", "fieldtype": "Data", "hidden": 1, - "ignore_user_permissions": 0, - "ignore_xss_filter": 0, - "in_filter": 0, - "in_global_search": 0, - "in_list_view": 0, - "in_standard_filter": 0, "label": "Customer Code", - "length": 0, "no_copy": 1, - "permlevel": 0, - "precision": "", - "print_hide": 1, - "print_hide_if_no_value": 0, - "read_only": 0, - "remember_last_selected_value": 0, - "report_hide": 0, - "reqd": 0, - "search_index": 0, - "set_only_once": 0, - "translatable": 0, - "unique": 0 + "print_hide": 1 }, { - "allow_bulk_edit": 0, - "allow_in_quick_entry": 0, - "allow_on_submit": 0, - "bold": 0, "collapsible": 1, - "columns": 0, "fieldname": "website_section", "fieldtype": "Section Break", - "hidden": 0, - "ignore_user_permissions": 0, - "ignore_xss_filter": 0, - "in_filter": 0, - "in_global_search": 0, - "in_list_view": 0, - "in_standard_filter": 0, "label": "Website", - "length": 0, - "no_copy": 0, - "options": "fa fa-globe", - "permlevel": 0, - "precision": "", - "print_hide": 0, - "print_hide_if_no_value": 0, - "read_only": 0, - "remember_last_selected_value": 0, - "report_hide": 0, - "reqd": 0, - "search_index": 0, - "set_only_once": 0, - "translatable": 0, - "unique": 0 + "options": "fa fa-globe" }, { - "allow_bulk_edit": 0, - "allow_in_quick_entry": 0, - "allow_on_submit": 0, - "bold": 0, - "collapsible": 0, - "columns": 0, "depends_on": "eval:!doc.variant_of", "fieldname": "show_in_website", "fieldtype": "Check", - "hidden": 0, - "ignore_user_permissions": 0, - "ignore_xss_filter": 0, - "in_filter": 0, - "in_global_search": 0, - "in_list_view": 0, - "in_standard_filter": 0, "label": "Show in Website", - "length": 0, - "no_copy": 0, - "permlevel": 0, - "precision": "", - "print_hide": 0, - "print_hide_if_no_value": 0, - "read_only": 0, - "remember_last_selected_value": 0, - "report_hide": 0, - "reqd": 0, - "search_index": 1, - "set_only_once": 0, - "translatable": 0, - "unique": 0 + "search_index": 1 }, { - "allow_bulk_edit": 0, - "allow_in_quick_entry": 0, - "allow_on_submit": 0, - "bold": 0, - "collapsible": 0, - "columns": 0, "depends_on": "variant_of", "fieldname": "show_variant_in_website", "fieldtype": "Check", - "hidden": 0, - "ignore_user_permissions": 0, - "ignore_xss_filter": 0, - "in_filter": 0, - "in_global_search": 0, - "in_list_view": 0, - "in_standard_filter": 0, "label": "Show in Website (Variant)", - "length": 0, - "no_copy": 0, - "permlevel": 0, - "precision": "", - "print_hide": 0, - "print_hide_if_no_value": 0, - "read_only": 0, - "remember_last_selected_value": 0, - "report_hide": 0, - "reqd": 0, - "search_index": 1, - "set_only_once": 0, - "translatable": 0, - "unique": 0 + "search_index": 1 }, { - "allow_bulk_edit": 0, - "allow_in_quick_entry": 0, - "allow_on_submit": 0, - "bold": 0, - "collapsible": 0, - "columns": 0, "depends_on": "eval: doc.show_in_website || doc.show_variant_in_website", "fieldname": "route", "fieldtype": "Small Text", - "hidden": 0, - "ignore_user_permissions": 0, - "ignore_xss_filter": 0, - "in_filter": 0, - "in_global_search": 0, - "in_list_view": 0, - "in_standard_filter": 0, "label": "Route", - "length": 0, - "no_copy": 1, - "permlevel": 0, - "precision": "", - "print_hide": 0, - "print_hide_if_no_value": 0, - "read_only": 0, - "remember_last_selected_value": 0, - "report_hide": 0, - "reqd": 0, - "search_index": 0, - "set_only_once": 0, - "translatable": 0, - "unique": 0 + "no_copy": 1 }, { - "allow_bulk_edit": 0, - "allow_in_quick_entry": 0, - "allow_on_submit": 0, - "bold": 0, - "collapsible": 0, - "columns": 0, "depends_on": "eval: doc.show_in_website || doc.show_variant_in_website", "description": "Items with higher weightage will be shown higher", "fieldname": "weightage", "fieldtype": "Int", - "hidden": 0, - "ignore_user_permissions": 0, - "ignore_xss_filter": 0, - "in_filter": 0, - "in_global_search": 0, - "in_list_view": 0, - "in_standard_filter": 0, - "label": "Weightage", - "length": 0, - "no_copy": 0, - "permlevel": 0, - "precision": "", - "print_hide": 0, - "print_hide_if_no_value": 0, - "read_only": 0, - "remember_last_selected_value": 0, - "report_hide": 0, - "reqd": 0, - "search_index": 0, - "set_only_once": 0, - "translatable": 0, - "unique": 0 + "label": "Weightage" }, { - "allow_bulk_edit": 0, - "allow_in_quick_entry": 0, - "allow_on_submit": 0, - "bold": 0, - "collapsible": 0, - "columns": 0, "depends_on": "eval: doc.show_in_website || doc.show_variant_in_website", "description": "Show a slideshow at the top of the page", "fieldname": "slideshow", "fieldtype": "Link", - "hidden": 0, - "ignore_user_permissions": 0, - "ignore_xss_filter": 0, - "in_filter": 0, - "in_global_search": 0, - "in_list_view": 0, - "in_standard_filter": 0, "label": "Slideshow", - "length": 0, - "no_copy": 0, - "options": "Website Slideshow", - "permlevel": 0, - "precision": "", - "print_hide": 0, - "print_hide_if_no_value": 0, - "read_only": 0, - "remember_last_selected_value": 0, - "report_hide": 0, - "reqd": 0, - "search_index": 0, - "set_only_once": 0, - "translatable": 0, - "unique": 0 + "options": "Website Slideshow" }, { - "allow_bulk_edit": 0, - "allow_in_quick_entry": 0, - "allow_on_submit": 0, - "bold": 0, - "collapsible": 0, - "columns": 0, "depends_on": "eval: doc.show_in_website || doc.show_variant_in_website", "description": "Item Image (if not slideshow)", "fieldname": "website_image", "fieldtype": "Attach", - "hidden": 0, - "ignore_user_permissions": 0, - "ignore_xss_filter": 0, - "in_filter": 0, - "in_global_search": 0, - "in_list_view": 0, - "in_standard_filter": 0, - "label": "Image", - "length": 0, - "no_copy": 0, - "options": "", - "permlevel": 0, - "precision": "", - "print_hide": 0, - "print_hide_if_no_value": 0, - "read_only": 0, - "remember_last_selected_value": 0, - "report_hide": 0, - "reqd": 0, - "search_index": 0, - "set_only_once": 0, - "translatable": 0, - "unique": 0 + "label": "Image" }, { - "allow_bulk_edit": 0, - "allow_in_quick_entry": 0, - "allow_on_submit": 0, - "bold": 0, - "collapsible": 0, - "columns": 0, "fieldname": "thumbnail", "fieldtype": "Data", - "hidden": 0, - "ignore_user_permissions": 0, - "ignore_xss_filter": 0, - "in_filter": 0, - "in_global_search": 0, - "in_list_view": 0, - "in_standard_filter": 0, "label": "Thumbnail", - "length": 0, - "no_copy": 0, - "permlevel": 0, - "precision": "", - "print_hide": 0, - "print_hide_if_no_value": 0, - "read_only": 1, - "remember_last_selected_value": 0, - "report_hide": 0, - "reqd": 0, - "search_index": 0, - "set_only_once": 0, - "translatable": 0, - "unique": 0 + "read_only": 1 }, { - "allow_bulk_edit": 0, - "allow_in_quick_entry": 0, - "allow_on_submit": 0, - "bold": 0, - "collapsible": 0, - "columns": 0, "fieldname": "cb72", - "fieldtype": "Column Break", - "hidden": 0, - "ignore_user_permissions": 0, - "ignore_xss_filter": 0, - "in_filter": 0, - "in_global_search": 0, - "in_list_view": 0, - "in_standard_filter": 0, - "length": 0, - "no_copy": 0, - "permlevel": 0, - "precision": "", - "print_hide": 0, - "print_hide_if_no_value": 0, - "read_only": 0, - "remember_last_selected_value": 0, - "report_hide": 0, - "reqd": 0, - "search_index": 0, - "set_only_once": 0, - "translatable": 0, - "unique": 0 + "fieldtype": "Column Break" }, { - "allow_bulk_edit": 0, - "allow_in_quick_entry": 0, - "allow_on_submit": 0, - "bold": 0, - "collapsible": 0, - "columns": 0, "depends_on": "eval: doc.show_in_website || doc.show_variant_in_website", "description": "Show \"In Stock\" or \"Not in Stock\" based on stock available in this warehouse.", "fieldname": "website_warehouse", "fieldtype": "Link", - "hidden": 0, "ignore_user_permissions": 1, - "ignore_xss_filter": 0, - "in_filter": 0, - "in_global_search": 0, - "in_list_view": 0, - "in_standard_filter": 0, "label": "Website Warehouse", - "length": 0, - "no_copy": 0, - "options": "Warehouse", - "permlevel": 0, - "precision": "", - "print_hide": 0, - "print_hide_if_no_value": 0, - "read_only": 0, - "remember_last_selected_value": 0, - "report_hide": 0, - "reqd": 0, - "search_index": 0, - "set_only_once": 0, - "translatable": 0, - "unique": 0 + "options": "Warehouse" }, { - "allow_bulk_edit": 0, - "allow_in_quick_entry": 0, - "allow_on_submit": 0, - "bold": 0, - "collapsible": 0, - "columns": 0, "depends_on": "eval: doc.show_in_website || doc.show_variant_in_website", "description": "List this Item in multiple groups on the website.", "fieldname": "website_item_groups", "fieldtype": "Table", - "hidden": 0, - "ignore_user_permissions": 0, - "ignore_xss_filter": 0, - "in_filter": 0, - "in_global_search": 0, - "in_list_view": 0, - "in_standard_filter": 0, "label": "Website Item Groups", - "length": 0, - "no_copy": 0, - "options": "Website Item Group", - "permlevel": 0, - "precision": "", - "print_hide": 0, - "print_hide_if_no_value": 0, - "read_only": 0, - "remember_last_selected_value": 0, - "report_hide": 0, - "reqd": 0, - "search_index": 0, - "set_only_once": 0, - "translatable": 0, - "unique": 0 + "options": "Website Item Group" }, { - "allow_bulk_edit": 0, - "allow_in_quick_entry": 0, - "allow_on_submit": 0, - "bold": 0, - "collapsible": 0, - "columns": 0, "depends_on": "eval: doc.show_in_website || doc.show_variant_in_website", "fieldname": "set_meta_tags", "fieldtype": "Button", - "hidden": 0, - "ignore_user_permissions": 0, - "ignore_xss_filter": 0, - "in_filter": 0, - "in_global_search": 0, - "in_list_view": 0, - "in_standard_filter": 0, - "label": "Set Meta Tags", - "length": 0, - "no_copy": 0, - "permlevel": 0, - "precision": "", - "print_hide": 0, - "print_hide_if_no_value": 0, - "read_only": 0, - "remember_last_selected_value": 0, - "report_hide": 0, - "reqd": 0, - "search_index": 0, - "set_only_once": 0, - "translatable": 0, - "unique": 0 + "label": "Set Meta Tags" }, { - "allow_bulk_edit": 0, - "allow_in_quick_entry": 0, - "allow_on_submit": 0, - "bold": 0, "collapsible": 1, "collapsible_depends_on": "website_specifications", - "columns": 0, "depends_on": "eval: doc.show_in_website || doc.show_variant_in_website", "fieldname": "sb72", "fieldtype": "Section Break", - "hidden": 0, - "ignore_user_permissions": 0, - "ignore_xss_filter": 0, - "in_filter": 0, - "in_global_search": 0, - "in_list_view": 0, - "in_standard_filter": 0, - "label": "Website Specifications", - "length": 0, - "no_copy": 0, - "permlevel": 0, - "precision": "", - "print_hide": 0, - "print_hide_if_no_value": 0, - "read_only": 0, - "remember_last_selected_value": 0, - "report_hide": 0, - "reqd": 0, - "search_index": 0, - "set_only_once": 0, - "translatable": 0, - "unique": 0 + "label": "Website Specifications" }, { - "allow_bulk_edit": 0, - "allow_in_quick_entry": 0, - "allow_on_submit": 0, - "bold": 0, - "collapsible": 0, - "columns": 0, "depends_on": "eval: doc.show_in_website || doc.show_variant_in_website", "fieldname": "copy_from_item_group", "fieldtype": "Button", - "hidden": 0, - "ignore_user_permissions": 0, - "ignore_xss_filter": 0, - "in_filter": 0, - "in_global_search": 0, - "in_list_view": 0, - "in_standard_filter": 0, - "label": "Copy From Item Group", - "length": 0, - "no_copy": 0, - "permlevel": 0, - "precision": "", - "print_hide": 0, - "print_hide_if_no_value": 0, - "read_only": 0, - "remember_last_selected_value": 0, - "report_hide": 0, - "reqd": 0, - "search_index": 0, - "set_only_once": 0, - "translatable": 0, - "unique": 0 + "label": "Copy From Item Group" }, { - "allow_bulk_edit": 0, - "allow_in_quick_entry": 0, - "allow_on_submit": 0, - "bold": 0, - "collapsible": 0, - "columns": 0, "depends_on": "eval: doc.show_in_website || doc.show_variant_in_website", "fieldname": "website_specifications", "fieldtype": "Table", - "hidden": 0, - "ignore_user_permissions": 0, - "ignore_xss_filter": 0, - "in_filter": 0, - "in_global_search": 0, - "in_list_view": 0, - "in_standard_filter": 0, "label": "Website Specifications", - "length": 0, - "no_copy": 0, - "options": "Item Website Specification", - "permlevel": 0, - "precision": "", - "print_hide": 0, - "print_hide_if_no_value": 0, - "read_only": 0, - "remember_last_selected_value": 0, - "report_hide": 0, - "reqd": 0, - "search_index": 0, - "set_only_once": 0, - "translatable": 0, - "unique": 0 + "options": "Item Website Specification" }, { - "allow_bulk_edit": 0, - "allow_in_quick_entry": 0, - "allow_on_submit": 0, - "bold": 0, - "collapsible": 0, - "columns": 0, "depends_on": "eval: doc.show_in_website || doc.show_variant_in_website", "fieldname": "web_long_description", "fieldtype": "Text Editor", - "hidden": 0, - "ignore_user_permissions": 0, - "ignore_xss_filter": 0, - "in_filter": 0, - "in_global_search": 0, - "in_list_view": 0, - "in_standard_filter": 0, - "label": "Website Description", - "length": 0, - "no_copy": 0, - "permlevel": 0, - "precision": "", - "print_hide": 0, - "print_hide_if_no_value": 0, - "read_only": 0, - "remember_last_selected_value": 0, - "report_hide": 0, - "reqd": 0, - "search_index": 0, - "set_only_once": 0, - "translatable": 0, - "unique": 0 + "label": "Website Description" }, { - "allow_bulk_edit": 0, - "allow_in_quick_entry": 0, - "allow_on_submit": 0, - "bold": 0, - "collapsible": 0, - "columns": 0, "description": "You can use any valid Bootstrap 4 markup in this field. It will be shown on your Item Page.", "fieldname": "website_content", "fieldtype": "HTML Editor", - "hidden": 0, - "ignore_user_permissions": 0, - "ignore_xss_filter": 0, - "in_filter": 0, - "in_global_search": 0, - "in_list_view": 0, - "in_standard_filter": 0, - "label": "Website Content", - "length": 0, - "no_copy": 0, - "permlevel": 0, - "precision": "", - "print_hide": 0, - "print_hide_if_no_value": 0, - "read_only": 0, - "remember_last_selected_value": 0, - "report_hide": 0, - "reqd": 0, - "search_index": 0, - "set_only_once": 0, - "translatable": 0, - "unique": 0 + "label": "Website Content" }, { - "allow_bulk_edit": 0, - "allow_in_quick_entry": 0, - "allow_on_submit": 0, - "bold": 0, - "collapsible": 0, - "columns": 0, "fieldname": "total_projected_qty", "fieldtype": "Float", "hidden": 1, - "ignore_user_permissions": 0, - "ignore_xss_filter": 0, - "in_filter": 0, - "in_global_search": 0, - "in_list_view": 0, - "in_standard_filter": 0, "label": "Total Projected Qty", - "length": 0, - "no_copy": 0, - "permlevel": 0, - "precision": "", "print_hide": 1, - "print_hide_if_no_value": 0, - "read_only": 1, - "remember_last_selected_value": 0, - "report_hide": 0, - "reqd": 0, - "search_index": 0, - "set_only_once": 0, - "translatable": 0, - "unique": 0 + "read_only": 1 }, { - "allow_bulk_edit": 0, - "allow_in_quick_entry": 0, - "allow_on_submit": 0, - "bold": 0, - "collapsible": 0, - "columns": 0, "depends_on": "eval:(!doc.is_item_from_hub)", "fieldname": "hub_publishing_sb", "fieldtype": "Section Break", - "hidden": 0, - "ignore_user_permissions": 0, - "ignore_xss_filter": 0, - "in_filter": 0, - "in_global_search": 0, - "in_list_view": 0, - "in_standard_filter": 0, - "label": "Hub Publishing Details", - "length": 0, - "no_copy": 0, - "permlevel": 0, - "precision": "", - "print_hide": 0, - "print_hide_if_no_value": 0, - "read_only": 0, - "remember_last_selected_value": 0, - "report_hide": 0, - "reqd": 0, - "search_index": 0, - "set_only_once": 0, - "translatable": 0, - "unique": 0 + "label": "Hub Publishing Details" }, { - "allow_bulk_edit": 0, - "allow_in_quick_entry": 0, - "allow_on_submit": 0, - "bold": 0, - "collapsible": 0, - "columns": 0, "default": "0", "description": "Publish Item to hub.erpnext.com", "fieldname": "publish_in_hub", "fieldtype": "Check", - "hidden": 0, - "ignore_user_permissions": 0, - "ignore_xss_filter": 0, - "in_filter": 0, - "in_global_search": 0, - "in_list_view": 0, - "in_standard_filter": 0, - "label": "Publish in Hub", - "length": 0, - "no_copy": 0, - "permlevel": 0, - "precision": "", - "print_hide": 0, - "print_hide_if_no_value": 0, - "read_only": 0, - "remember_last_selected_value": 0, - "report_hide": 0, - "reqd": 0, - "search_index": 0, - "set_only_once": 0, - "translatable": 0, - "unique": 0 + "label": "Publish in Hub" }, { - "allow_bulk_edit": 0, - "allow_in_quick_entry": 0, - "allow_on_submit": 0, - "bold": 0, - "collapsible": 0, - "columns": 0, "fieldname": "hub_category_to_publish", "fieldtype": "Data", - "hidden": 0, - "ignore_user_permissions": 0, - "ignore_xss_filter": 0, - "in_filter": 0, - "in_global_search": 0, - "in_list_view": 0, - "in_standard_filter": 0, "label": "Hub Category to Publish", - "length": 0, - "no_copy": 0, - "options": "", - "permlevel": 0, - "precision": "", - "print_hide": 0, - "print_hide_if_no_value": 0, - "read_only": 1, - "remember_last_selected_value": 0, - "report_hide": 0, - "reqd": 0, - "search_index": 0, - "set_only_once": 0, - "translatable": 0, - "unique": 0 + "read_only": 1 }, { - "allow_bulk_edit": 0, - "allow_in_quick_entry": 0, - "allow_on_submit": 0, - "bold": 0, - "collapsible": 0, - "columns": 0, "description": "Publish \"In Stock\" or \"Not in Stock\" on Hub based on stock available in this warehouse.", "fieldname": "hub_warehouse", "fieldtype": "Link", - "hidden": 0, "ignore_user_permissions": 1, - "ignore_xss_filter": 0, - "in_filter": 0, - "in_global_search": 0, - "in_list_view": 0, - "in_standard_filter": 0, "label": "Hub Warehouse", - "length": 0, - "no_copy": 0, - "options": "Warehouse", - "permlevel": 0, - "precision": "", - "print_hide": 0, - "print_hide_if_no_value": 0, - "read_only": 0, - "remember_last_selected_value": 0, - "report_hide": 0, - "reqd": 0, - "search_index": 0, - "set_only_once": 0, - "translatable": 0, - "unique": 0 + "options": "Warehouse" }, { - "allow_bulk_edit": 0, - "allow_in_quick_entry": 0, - "allow_on_submit": 0, - "bold": 0, - "collapsible": 0, - "columns": 0, "default": "0", "fieldname": "synced_with_hub", "fieldtype": "Check", - "hidden": 0, - "ignore_user_permissions": 0, - "ignore_xss_filter": 0, - "in_filter": 0, - "in_global_search": 0, - "in_list_view": 0, - "in_standard_filter": 0, "label": "Synced With Hub", - "length": 0, - "no_copy": 0, - "permlevel": 0, - "precision": "", - "print_hide": 0, - "print_hide_if_no_value": 0, - "read_only": 1, - "remember_last_selected_value": 0, - "report_hide": 0, - "reqd": 0, - "search_index": 0, - "set_only_once": 0, - "translatable": 0, - "unique": 0 + "read_only": 1 } ], "has_web_view": 1, - "hide_heading": 0, - "hide_toolbar": 0, "icon": "fa fa-tag", "idx": 2, "image_field": "image", - "image_view": 0, - "in_create": 0, - "is_submittable": 0, - "issingle": 0, - "istable": 0, "max_attachments": 1, - "modified": "2019-05-09 18:47:30.475833", + "modified": "2019-05-16 09:32:27.056036", "modified_by": "Administrator", "module": "Stock", "name": "Item", - "name_case": "", "owner": "Administrator", "permissions": [ { - "amend": 0, - "cancel": 0, "create": 1, "delete": 1, "email": 1, "export": 1, - "if_owner": 0, "import": 1, - "permlevel": 0, "print": 1, "read": 1, "report": 1, "role": "Item Manager", - "set_user_permissions": 0, "share": 1, - "submit": 0, "write": 1 }, { - "amend": 0, - "cancel": 0, - "create": 0, - "delete": 0, "email": 1, - "export": 0, - "if_owner": 0, - "import": 0, - "permlevel": 0, "print": 1, "read": 1, "report": 1, - "role": "Stock Manager", - "set_user_permissions": 0, - "share": 0, - "submit": 0, - "write": 0 + "role": "Stock Manager" }, { - "amend": 0, - "cancel": 0, - "create": 0, - "delete": 0, "email": 1, - "export": 0, - "if_owner": 0, - "import": 0, - "permlevel": 0, "print": 1, "read": 1, "report": 1, - "role": "Stock User", - "set_user_permissions": 0, - "share": 0, - "submit": 0, - "write": 0 + "role": "Stock User" }, { - "amend": 0, - "cancel": 0, - "create": 0, - "delete": 0, - "email": 0, - "export": 0, - "if_owner": 0, - "import": 0, - "permlevel": 0, - "print": 0, "read": 1, - "report": 0, - "role": "Sales User", - "set_user_permissions": 0, - "share": 0, - "submit": 0, - "write": 0 + "role": "Sales User" }, { - "amend": 0, - "cancel": 0, - "create": 0, - "delete": 0, - "email": 0, - "export": 0, - "if_owner": 0, - "import": 0, - "permlevel": 0, - "print": 0, "read": 1, - "report": 0, - "role": "Purchase User", - "set_user_permissions": 0, - "share": 0, - "submit": 0, - "write": 0 + "role": "Purchase User" }, { - "amend": 0, - "cancel": 0, - "create": 0, - "delete": 0, - "email": 0, - "export": 0, - "if_owner": 0, - "import": 0, - "permlevel": 0, - "print": 0, "read": 1, - "report": 0, - "role": "Maintenance User", - "set_user_permissions": 0, - "share": 0, - "submit": 0, - "write": 0 + "role": "Maintenance User" }, { - "amend": 0, - "cancel": 0, - "create": 0, - "delete": 0, - "email": 0, - "export": 0, - "if_owner": 0, - "import": 0, - "permlevel": 0, - "print": 0, "read": 1, - "report": 0, - "role": "Accounts User", - "set_user_permissions": 0, - "share": 0, - "submit": 0, - "write": 0 + "role": "Accounts User" }, { - "amend": 0, - "cancel": 0, - "create": 0, - "delete": 0, - "email": 0, - "export": 0, - "if_owner": 0, - "import": 0, - "permlevel": 0, - "print": 0, "read": 1, - "report": 0, - "role": "Manufacturing User", - "set_user_permissions": 0, - "share": 0, - "submit": 0, - "write": 0 + "role": "Manufacturing User" } ], "quick_entry": 1, - "read_only": 0, - "read_only_onload": 0, "search_fields": "item_name,description,item_group,customer_code", "show_name_in_global_search": 1, + "show_preview_popup": 1, "sort_field": "idx desc,modified desc", "sort_order": "DESC", "title_field": "item_name", - "track_changes": 1, - "track_seen": 0, - "track_views": 0 + "track_changes": 1 } \ No newline at end of file From 0e31089af69e2d3166631657f3b2b3bba020198e Mon Sep 17 00:00:00 2001 From: Himanshu Date: Thu, 16 May 2019 10:35:02 +0530 Subject: [PATCH 65/73] validate: if additional salary exists (#17529) --- erpnext/hr/doctype/additional_salary/additional_salary.py | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/erpnext/hr/doctype/additional_salary/additional_salary.py b/erpnext/hr/doctype/additional_salary/additional_salary.py index 9ca1260fe0..043f0df78d 100644 --- a/erpnext/hr/doctype/additional_salary/additional_salary.py +++ b/erpnext/hr/doctype/additional_salary/additional_salary.py @@ -9,6 +9,12 @@ from frappe import _ from frappe.utils import getdate, date_diff class AdditionalSalary(Document): + def before_insert(self): + if frappe.db.exists("Additional Salary", {"employee": self.employee, "salary_component": self.salary_component, + "amount": self.amount, "payroll_date": self.payroll_date, "company": self.company}): + + frappe.throw(_("Additional Salary Component Exists.")) + def validate(self): self.validate_dates() if self.amount < 0: From 6b9d64ce1dbe5b861449d3c75c5b4dcf2319f09a Mon Sep 17 00:00:00 2001 From: Nabin Hait Date: Thu, 16 May 2019 11:23:04 +0530 Subject: [PATCH 66/73] refator: Payroll processing and tax calculation (#17617) * refactor: Payroll processing and tax calculation * fix: payroll test cases * fix: Codacy fixes * fix: payroll test cases * fix: removed unwanted code --- .../doctype/bank_guarantee/bank_guarantee.py | 2 - .../accounts_receivable.html | 6 +- .../additional_salary/additional_salary.js | 9 +- .../additional_salary/additional_salary.json | 50 +- .../additional_salary/additional_salary.py | 23 +- .../employee_benefit_application.js | 17 +- .../employee_benefit_application.py | 107 +- .../employee_benefit_claim.py | 39 +- .../employee_tax_exemption_declaration.json | 68 +- .../employee_tax_exemption_declaration.py | 3 +- ...ployee_tax_exemption_proof_submission.json | 68 +- .../hr/doctype/payroll_entry/payroll_entry.py | 5 +- .../doctype/payroll_period/payroll_period.py | 50 +- .../salary_component/salary_component.js | 8 - .../salary_component/salary_component.json | 73 +- .../salary_component/test_records.json | 3 +- .../salary_component/test_salary_component.py | 4 +- .../doctype/salary_detail/salary_detail.json | 105 +- erpnext/hr/doctype/salary_slip/salary_slip.js | 193 +- .../hr/doctype/salary_slip/salary_slip.json | 3693 ++++++++--------- erpnext/hr/doctype/salary_slip/salary_slip.py | 1036 +++-- .../doctype/salary_slip/test_salary_slip.py | 46 +- .../salary_structure/salary_structure.js | 3 +- .../salary_structure/salary_structure.py | 4 +- .../salary_structure/test_salary_structure.py | 9 +- .../report/salary_register/salary_register.py | 4 +- erpnext/hr/utils.py | 12 +- erpnext/regional/india/utils.py | 9 +- erpnext/setup/doctype/company/company.js | 5 - 29 files changed, 2866 insertions(+), 2788 deletions(-) diff --git a/erpnext/accounts/doctype/bank_guarantee/bank_guarantee.py b/erpnext/accounts/doctype/bank_guarantee/bank_guarantee.py index 13ed5b6b94..9aa2ee271a 100644 --- a/erpnext/accounts/doctype/bank_guarantee/bank_guarantee.py +++ b/erpnext/accounts/doctype/bank_guarantee/bank_guarantee.py @@ -22,7 +22,5 @@ class BankGuarantee(Document): @frappe.whitelist() def get_vouchar_detials(column_list, doctype, docname): - print (column_list, doctype, docname) return frappe.db.sql(''' select {columns} from `tab{doctype}` where name=%s''' .format(columns=", ".join(json.loads(column_list)), doctype=doctype), docname, as_dict=1)[0] - diff --git a/erpnext/accounts/report/accounts_receivable/accounts_receivable.html b/erpnext/accounts/report/accounts_receivable/accounts_receivable.html index 1bff93cb77..d7aa0c0d19 100644 --- a/erpnext/accounts/report/accounts_receivable/accounts_receivable.html +++ b/erpnext/accounts/report/accounts_receivable/accounts_receivable.html @@ -111,10 +111,10 @@ {%= __("Age (Days)") %} {% if(report.report_name === "Accounts Receivable" && filters.show_sales_person_in_print) { %} - {%= __("Reference") %} + {%= __("Reference") %} {%= __("Sales Person") %} {% } else { %} - {%= __("Reference") %} + {%= __("Reference") %} {% } %} {% if(!filters.show_pdc_in_print) { %} {%= (filters.customer || filters.supplier) ? __("Remarks"): __("Party") %} @@ -127,7 +127,7 @@ {%= __("Outstanding Amount") %} {% if(filters.show_pdc_in_print) { %} {% if(report.report_name === "Accounts Receivable") { %} - {%= __("Customer LPO No.") %} + {%= __("Customer LPO No.") %} {% } %} {%= __("PDC/LC Ref") %} {%= __("PDC/LC Amount") %} diff --git a/erpnext/hr/doctype/additional_salary/additional_salary.js b/erpnext/hr/doctype/additional_salary/additional_salary.js index a96bb94282..d0f64ab51b 100644 --- a/erpnext/hr/doctype/additional_salary/additional_salary.js +++ b/erpnext/hr/doctype/additional_salary/additional_salary.js @@ -3,13 +3,8 @@ frappe.ui.form.on('Additional Salary', { setup: function(frm) { - frm.set_query("salary_component", function() { - return { - filters: { - is_additional_component: true - } - }; - }); + frm.add_fetch("salary_component", "deduct_full_tax_on_selected_payroll_date", "deduct_full_tax_on_selected_payroll_date"); + frm.set_query("employee", function() { return { filters: { diff --git a/erpnext/hr/doctype/additional_salary/additional_salary.json b/erpnext/hr/doctype/additional_salary/additional_salary.json index 7f9e51b5f9..6768b49e28 100644 --- a/erpnext/hr/doctype/additional_salary/additional_salary.json +++ b/erpnext/hr/doctype/additional_salary/additional_salary.json @@ -1,5 +1,6 @@ { "allow_copy": 0, + "allow_events_in_timeline": 0, "allow_guest_to_view": 0, "allow_import": 1, "allow_rename": 0, @@ -21,6 +22,7 @@ "collapsible": 0, "columns": 0, "default": "", + "fetch_if_empty": 0, "fieldname": "naming_series", "fieldtype": "Select", "hidden": 0, @@ -54,6 +56,7 @@ "bold": 0, "collapsible": 0, "columns": 0, + "fetch_if_empty": 0, "fieldname": "employee", "fieldtype": "Link", "hidden": 0, @@ -87,6 +90,7 @@ "bold": 0, "collapsible": 0, "columns": 0, + "fetch_if_empty": 0, "fieldname": "salary_component", "fieldtype": "Link", "hidden": 0, @@ -120,6 +124,7 @@ "bold": 0, "collapsible": 0, "columns": 0, + "fetch_if_empty": 0, "fieldname": "amount", "fieldtype": "Currency", "hidden": 0, @@ -153,6 +158,7 @@ "collapsible": 0, "columns": 0, "default": "1", + "fetch_if_empty": 0, "fieldname": "overwrite_salary_structure_amount", "fieldtype": "Check", "hidden": 0, @@ -185,6 +191,40 @@ "bold": 0, "collapsible": 0, "columns": 0, + "fetch_if_empty": 0, + "fieldname": "deduct_full_tax_on_selected_payroll_date", + "fieldtype": "Check", + "hidden": 0, + "ignore_user_permissions": 0, + "ignore_xss_filter": 0, + "in_filter": 0, + "in_global_search": 0, + "in_list_view": 0, + "in_standard_filter": 0, + "label": "Deduct Full Tax on Selected Payroll Date", + "length": 0, + "no_copy": 0, + "permlevel": 0, + "precision": "", + "print_hide": 0, + "print_hide_if_no_value": 0, + "read_only": 0, + "remember_last_selected_value": 0, + "report_hide": 0, + "reqd": 0, + "search_index": 0, + "set_only_once": 0, + "translatable": 0, + "unique": 0 + }, + { + "allow_bulk_edit": 0, + "allow_in_quick_entry": 0, + "allow_on_submit": 0, + "bold": 0, + "collapsible": 0, + "columns": 0, + "fetch_if_empty": 0, "fieldname": "column_break_5", "fieldtype": "Column Break", "hidden": 0, @@ -217,6 +257,8 @@ "collapsible": 0, "columns": 0, "default": "", + "description": "Date on which this component is applied", + "fetch_if_empty": 0, "fieldname": "payroll_date", "fieldtype": "Date", "hidden": 0, @@ -250,6 +292,7 @@ "collapsible": 0, "columns": 0, "fetch_from": "employee.employee_name", + "fetch_if_empty": 0, "fieldname": "employee_name", "fieldtype": "Data", "hidden": 0, @@ -284,6 +327,7 @@ "collapsible": 0, "columns": 0, "fetch_from": "employee.department", + "fetch_if_empty": 0, "fieldname": "department", "fieldtype": "Link", "hidden": 0, @@ -317,6 +361,7 @@ "bold": 0, "collapsible": 0, "columns": 0, + "fetch_if_empty": 0, "fieldname": "company", "fieldtype": "Link", "hidden": 0, @@ -350,6 +395,7 @@ "bold": 0, "collapsible": 0, "columns": 0, + "fetch_if_empty": 0, "fieldname": "salary_slip", "fieldtype": "Link", "hidden": 0, @@ -384,6 +430,7 @@ "collapsible": 0, "columns": 0, "fetch_from": "salary_component.type", + "fetch_if_empty": 0, "fieldname": "type", "fieldtype": "Data", "hidden": 0, @@ -417,6 +464,7 @@ "bold": 0, "collapsible": 0, "columns": 0, + "fetch_if_empty": 0, "fieldname": "amended_from", "fieldtype": "Link", "hidden": 0, @@ -453,7 +501,7 @@ "issingle": 0, "istable": 0, "max_attachments": 0, - "modified": "2018-08-21 14:44:22.921926", + "modified": "2019-05-09 19:53:37.475839", "modified_by": "Administrator", "module": "HR", "name": "Additional Salary", diff --git a/erpnext/hr/doctype/additional_salary/additional_salary.py b/erpnext/hr/doctype/additional_salary/additional_salary.py index 043f0df78d..82f2a22e81 100644 --- a/erpnext/hr/doctype/additional_salary/additional_salary.py +++ b/erpnext/hr/doctype/additional_salary/additional_salary.py @@ -41,7 +41,8 @@ class AdditionalSalary(Document): @frappe.whitelist() def get_additional_salary_component(employee, start_date, end_date): additional_components = frappe.db.sql(""" - select salary_component, sum(amount) as amount, overwrite_salary_structure_amount from `tabAdditional Salary` + select salary_component, sum(amount) as amount, overwrite_salary_structure_amount, deduct_full_tax_on_selected_payroll_date + from `tabAdditional Salary` where employee=%(employee)s and docstatus = 1 and payroll_date between %(from_date)s and %(to_date)s @@ -54,16 +55,20 @@ def get_additional_salary_component(employee, start_date, end_date): }, as_dict=1) additional_components_list = [] + component_fields = ["depends_on_payment_days", "salary_component_abbr", "is_tax_applicable", "variable_based_on_taxable_salary", 'type'] for d in additional_components: - component = frappe.get_doc("Salary Component", d.salary_component) - struct_row = {'salary_component': d.salary_component} - for field in ["depends_on_payment_days", "abbr", "is_tax_applicable", "variable_based_on_taxable_salary", "is_additional_component"]: - struct_row[field] = component.get(field) + struct_row = frappe._dict({'salary_component': d.salary_component}) + component = frappe.get_all("Salary Component", filters={'name': d.salary_component}, fields=component_fields) + if component: + struct_row.update(component[0]) - additional_components_list.append({ + struct_row['deduct_full_tax_on_selected_payroll_date'] = d.deduct_full_tax_on_selected_payroll_date + struct_row['is_additional_component'] = 1 + + additional_components_list.append(frappe._dict({ 'amount': d.amount, - 'type': component.type, + 'type': component[0].type, 'struct_row': struct_row, - 'overwrite': d.overwrite_salary_structure_amount - }) + 'overwrite': d.overwrite_salary_structure_amount, + })) return additional_components_list \ No newline at end of file diff --git a/erpnext/hr/doctype/employee_benefit_application/employee_benefit_application.js b/erpnext/hr/doctype/employee_benefit_application/employee_benefit_application.js index 412a08aa9f..e71ce1276b 100644 --- a/erpnext/hr/doctype/employee_benefit_application/employee_benefit_application.js +++ b/erpnext/hr/doctype/employee_benefit_application/employee_benefit_application.js @@ -3,13 +3,18 @@ frappe.ui.form.on('Employee Benefit Application', { setup: function(frm) { - frm.set_query("earning_component", "employee_benefits", function() { - return { - query : "erpnext.hr.doctype.employee_benefit_application.employee_benefit_application.get_earning_components", - filters: {date: frm.doc.date, employee: frm.doc.employee} - }; - }); + if(!frm.doc.employee || !frm.doc.date) { + frappe.throw(__("Please select Employee and Date first")); + } else { + frm.set_query("earning_component", "employee_benefits", function() { + return { + query : "erpnext.hr.doctype.employee_benefit_application.employee_benefit_application.get_earning_components", + filters: {date: frm.doc.date, employee: frm.doc.employee} + }; + }); + } }, + employee: function(frm) { var method, args; if(frm.doc.employee && frm.doc.date && frm.doc.payroll_period){ diff --git a/erpnext/hr/doctype/employee_benefit_application/employee_benefit_application.py b/erpnext/hr/doctype/employee_benefit_application/employee_benefit_application.py index 701ae2465f..fea4246d64 100644 --- a/erpnext/hr/doctype/employee_benefit_application/employee_benefit_application.py +++ b/erpnext/hr/doctype/employee_benefit_application/employee_benefit_application.py @@ -7,7 +7,7 @@ import frappe from frappe import _ from frappe.utils import date_diff, getdate, rounded, add_days, cstr, cint, flt from frappe.model.document import Document -from erpnext.hr.doctype.payroll_period.payroll_period import get_payroll_period_days +from erpnext.hr.doctype.payroll_period.payroll_period import get_payroll_period_days, get_period_factor from erpnext.hr.doctype.salary_structure_assignment.salary_structure_assignment import get_assigned_salary_structure from erpnext.hr.utils import get_sal_slip_total_benefit_given, get_holidays_for_employee, get_previous_claimed_amount @@ -131,7 +131,7 @@ def get_max_benefits_remaining(employee, on_date, payroll_period): salary_component = frappe.get_doc("Salary Component", sal_struct_row.salary_component) if salary_component.depends_on_payment_days == 1 and salary_component.pay_against_benefit_claim != 1: have_depends_on_payment_days = True - benefit_amount = get_benefit_pro_rata_ratio_amount(sal_struct, salary_component.max_benefit_amount) + benefit_amount = get_benefit_amount_based_on_pro_rata(sal_struct, salary_component.max_benefit_amount) amount_per_day = benefit_amount / payroll_period_days per_day_amount_total += amount_per_day @@ -167,16 +167,14 @@ def calculate_lwp(employee, start_date, holidays, working_days): lwp = cint(leave[0][1]) and (lwp + 0.5) or (lwp + 1) return lwp -def get_benefit_component_amount(employee, start_date, end_date, struct_row, sal_struct, period_length, frequency): - payroll_period, period_factor, actual_payroll_days = get_payroll_period_days(start_date, end_date, employee) - +def get_benefit_component_amount(employee, start_date, end_date, salary_component, sal_struct, payroll_frequency, payroll_period): if not payroll_period: - frappe.msgprint(_("Start and end dates not in a valid Payroll Period, cannot calculate {0}.") - .format(struct_row.salary_component)) + frappe.msgprint(_("Start and end dates not in a valid Payroll Period, cannot calculate {0}") + .format(salary_component)) return False # Considering there is only one application for a year - benefit_application_name = frappe.db.sql(""" + benefit_application = frappe.db.sql(""" select name from `tabEmployee Benefit Application` where @@ -185,69 +183,58 @@ def get_benefit_component_amount(employee, start_date, end_date, struct_row, sal and docstatus = 1 """, { 'employee': employee, - 'payroll_period': payroll_period + 'payroll_period': payroll_period.name }) - if frappe.db.get_value("Salary Component", struct_row.salary_component, "depends_on_payment_days") != 1: - if frequency == "Monthly" and actual_payroll_days in range(360, 370): - period_length = 1 - period_factor = 12 + current_benefit_amount = 0.0 + component_max_benefit, depends_on_payment_days = frappe.db.get_value("Salary Component", + salary_component, ["max_benefit_amount", "depends_on_payment_days"]) - if period_factor: - # If there is application for benefit then fetch the amount from the application. - # else Split the max benefits to the pro-rata components with the ratio of their max_benefit_amount - if benefit_application_name: - benefit_application = frappe.get_doc("Employee Benefit Application", benefit_application_name[0][0]) - return get_benefit_amount(benefit_application, struct_row, period_factor, period_length) + if benefit_application: + benefit_amount = frappe.db.get_value("Employee Benefit Application Detail", + {"parent": benefit_application[0][0], "earning_component": salary_component}, "amount") + elif component_max_benefit: + benefit_amount = get_benefit_amount_based_on_pro_rata(sal_struct, component_max_benefit) - # TODO: Check if there is benefit claim for employee then pro-rata divide the rest of amount (Late Benefit Application) - else: - component_max = frappe.db.get_value("Salary Component", struct_row.salary_component, "max_benefit_amount") - if component_max: - benefit_amount = get_benefit_pro_rata_ratio_amount(sal_struct, component_max) - return get_amount(period_factor, benefit_amount, period_length) - return False + current_benefit_amount = 0 + if benefit_amount: + total_sub_periods = get_period_factor(employee, + start_date, end_date, payroll_frequency, payroll_period, depends_on_payment_days)[0] -def get_benefit_pro_rata_ratio_amount(sal_struct, component_max): - total_pro_rata_max = 0 + current_benefit_amount = benefit_amount / total_sub_periods + + return current_benefit_amount + +def get_benefit_amount_based_on_pro_rata(sal_struct, component_max_benefit): + max_benefits_total = 0 benefit_amount = 0 - for sal_struct_row in sal_struct.get("earnings"): - pay_against_benefit_claim, max_benefit_amount = frappe.db.get_value("Salary Component", - sal_struct_row.salary_component, ["pay_against_benefit_claim", "max_benefit_amount"]) - if sal_struct_row.is_flexible_benefit == 1 and pay_against_benefit_claim != 1: - total_pro_rata_max += max_benefit_amount - if total_pro_rata_max > 0: - benefit_amount = component_max * sal_struct.max_benefits / total_pro_rata_max - if benefit_amount > component_max: - benefit_amount = component_max + for d in sal_struct.get("earnings"): + if d.is_flexible_benefit == 1: + component = frappe.db.get_value("Salary Component", d.salary_component, ["max_benefit_amount", "pay_against_benefit_claim"], as_dict=1) + if not component.pay_against_benefit_claim: + max_benefits_total += component.max_benefit_amount + + if max_benefits_total > 0: + benefit_amount = sal_struct.max_benefits * component.max_benefit_amount / max_benefits_total + if benefit_amount > component_max_benefit: + benefit_amount = component_max_benefit + return benefit_amount -def get_benefit_amount(application, struct_row, period_factor, period_length): - amount = 0 - for employee_benefit in application.employee_benefits: - if employee_benefit.earning_component == struct_row.salary_component: - amount += get_amount(period_factor, employee_benefit.amount, period_length) - return amount if amount > 0 else False - -def get_amount(period_factor, amount, period_length): - amount_per_day = amount / period_factor - total_amount = amount_per_day * period_length - return total_amount def get_earning_components(doctype, txt, searchfield, start, page_len, filters): if len(filters) < 2: return {} - employee = filters['employee'] - date = filters['date'] - salary_structure = get_assigned_salary_structure(employee, date) + + salary_structure = get_assigned_salary_structure(filters['employee'], filters['date']) if salary_structure: - query = """select salary_component from `tabSalary Detail` where parent = '{salary_structure}' - and is_flexible_benefit = 1 - order by name""" - - return frappe.db.sql(query.format(**{ - "salary_structure": salary_structure - })) - - return {} + return frappe.db.sql(""" + select salary_component + from `tabSalary Detail` + where parent = %s and is_flexible_benefit = 1 + order by name + """, salary_structure) + else: + frappe.throw(_("Salary Structure not found for employee {0} and date {1}") + .format(filters['employee'], filters['date'])) \ No newline at end of file diff --git a/erpnext/hr/doctype/employee_benefit_claim/employee_benefit_claim.py b/erpnext/hr/doctype/employee_benefit_claim/employee_benefit_claim.py index 8be67a866a..3a80b30365 100644 --- a/erpnext/hr/doctype/employee_benefit_claim/employee_benefit_claim.py +++ b/erpnext/hr/doctype/employee_benefit_claim/employee_benefit_claim.py @@ -5,9 +5,11 @@ from __future__ import unicode_literals import frappe from frappe import _ +from frappe.utils import flt from frappe.model.document import Document from erpnext.hr.doctype.employee_benefit_application.employee_benefit_application import get_max_benefits -from erpnext.hr.utils import get_payroll_period, get_previous_claimed_amount +from erpnext.hr.utils import get_previous_claimed_amount +from erpnext.hr.doctype.payroll_period.payroll_period import get_payroll_period from erpnext.hr.doctype.salary_structure_assignment.salary_structure_assignment import get_assigned_salary_structure class EmployeeBenefitClaim(Document): @@ -97,31 +99,28 @@ def get_benefit_pro_rata_ratio_amount(employee, on_date, sal_struct): benefit_amount_total += benefit_amount return benefit_amount_total -def get_benefit_claim_amount(employee, start_date, end_date, salary_component): - query = """select claimed_amount from `tabEmployee Benefit Claim` - where employee=%(employee)s - and docstatus = 1 and pay_against_benefit_claim = 1 +def get_benefit_claim_amount(employee, start_date, end_date, salary_component=None): + query = """ + select sum(claimed_amount) + from `tabEmployee Benefit Claim` + where + employee=%(employee)s + and docstatus = 1 + and pay_against_benefit_claim = 1 + and claim_date between %(start_date)s and %(end_date)s """ - if not start_date: - query += "and claim_date <= %(end_date)s" - else: - query += "and (claim_date between %(start_date)s and %(end_date)s)" if salary_component: - query += "and earning_component = %(earning_component)s" + query += " and earning_component = %(earning_component)s" - benefit_claim_details = frappe.db.sql(query, { + claimed_amount = flt(frappe.db.sql(query, { 'employee': employee, 'start_date': start_date, 'end_date': end_date, 'earning_component': salary_component - }, as_dict = True) - if benefit_claim_details: - claimed_amount = 0 - for claim_detail in benefit_claim_details: - claimed_amount += claim_detail.claimed_amount - return claimed_amount - return False + })[0][0]) + + return claimed_amount def get_total_benefit_dispensed(employee, sal_struct, sal_slip_start_date, payroll_period): pro_rata_amount = 0 @@ -140,11 +139,11 @@ def get_total_benefit_dispensed(employee, sal_struct, sal_slip_start_date, payro else: pro_rata_amount = get_benefit_pro_rata_ratio_amount(employee, sal_slip_start_date, sal_struct) - claimed_amount += get_benefit_claim_amount(employee, payroll_period.start_date, payroll_period.end_date, False) + claimed_amount += get_benefit_claim_amount(employee, payroll_period.start_date, payroll_period.end_date) return claimed_amount + pro_rata_amount -def get_last_payroll_period_benefits(employee, sal_slip_start_date, sal_slip_end_date, current_flexi_amount, payroll_period, sal_struct): +def get_last_payroll_period_benefits(employee, sal_slip_start_date, sal_slip_end_date, payroll_period, sal_struct): max_benefits = get_max_benefits(employee, payroll_period.end_date) if not max_benefits: max_benefits = 0 diff --git a/erpnext/hr/doctype/employee_tax_exemption_declaration/employee_tax_exemption_declaration.json b/erpnext/hr/doctype/employee_tax_exemption_declaration/employee_tax_exemption_declaration.json index 8891b97a5d..e102ff8d70 100644 --- a/erpnext/hr/doctype/employee_tax_exemption_declaration/employee_tax_exemption_declaration.json +++ b/erpnext/hr/doctype/employee_tax_exemption_declaration/employee_tax_exemption_declaration.json @@ -446,6 +446,72 @@ "set_only_once": 0, "translatable": 0, "unique": 0 + }, + { + "allow_bulk_edit": 0, + "allow_in_quick_entry": 0, + "allow_on_submit": 0, + "bold": 0, + "collapsible": 0, + "columns": 0, + "fetch_if_empty": 0, + "fieldname": "other_incomes_section", + "fieldtype": "Section Break", + "hidden": 0, + "ignore_user_permissions": 0, + "ignore_xss_filter": 0, + "in_filter": 0, + "in_global_search": 0, + "in_list_view": 0, + "in_standard_filter": 0, + "label": "Other Incomes", + "length": 0, + "no_copy": 0, + "permlevel": 0, + "precision": "", + "print_hide": 0, + "print_hide_if_no_value": 0, + "read_only": 0, + "remember_last_selected_value": 0, + "report_hide": 0, + "reqd": 0, + "search_index": 0, + "set_only_once": 0, + "translatable": 0, + "unique": 0 + }, + { + "allow_bulk_edit": 0, + "allow_in_quick_entry": 0, + "allow_on_submit": 0, + "bold": 0, + "collapsible": 0, + "columns": 0, + "fetch_if_empty": 0, + "fieldname": "income_from_other_sources", + "fieldtype": "Currency", + "hidden": 0, + "ignore_user_permissions": 0, + "ignore_xss_filter": 0, + "in_filter": 0, + "in_global_search": 0, + "in_list_view": 0, + "in_standard_filter": 0, + "label": "Income From Other Sources", + "length": 0, + "no_copy": 0, + "permlevel": 0, + "precision": "", + "print_hide": 0, + "print_hide_if_no_value": 0, + "read_only": 0, + "remember_last_selected_value": 0, + "report_hide": 0, + "reqd": 0, + "search_index": 0, + "set_only_once": 0, + "translatable": 0, + "unique": 0 } ], "has_web_view": 0, @@ -458,7 +524,7 @@ "issingle": 0, "istable": 0, "max_attachments": 0, - "modified": "2019-04-25 16:38:05.847925", + "modified": "2019-05-11 16:13:50.472670", "modified_by": "Administrator", "module": "HR", "name": "Employee Tax Exemption Declaration", diff --git a/erpnext/hr/doctype/employee_tax_exemption_declaration/employee_tax_exemption_declaration.py b/erpnext/hr/doctype/employee_tax_exemption_declaration/employee_tax_exemption_declaration.py index cbdfcf8ecd..f2bba7afed 100644 --- a/erpnext/hr/doctype/employee_tax_exemption_declaration/employee_tax_exemption_declaration.py +++ b/erpnext/hr/doctype/employee_tax_exemption_declaration/employee_tax_exemption_declaration.py @@ -25,7 +25,8 @@ class EmployeeTaxExemptionDeclaration(Document): filters = { "employee": self.employee, "payroll_period": self.payroll_period, - "name": ["!=", self.name] + "name": ["!=", self.name], + "docstatus": ["!=", 2] } ) if duplicate: diff --git a/erpnext/hr/doctype/employee_tax_exemption_proof_submission/employee_tax_exemption_proof_submission.json b/erpnext/hr/doctype/employee_tax_exemption_proof_submission/employee_tax_exemption_proof_submission.json index 76c09d6c7b..9792bd1db6 100644 --- a/erpnext/hr/doctype/employee_tax_exemption_proof_submission/employee_tax_exemption_proof_submission.json +++ b/erpnext/hr/doctype/employee_tax_exemption_proof_submission/employee_tax_exemption_proof_submission.json @@ -448,6 +448,72 @@ "translatable": 0, "unique": 0 }, + { + "allow_bulk_edit": 0, + "allow_in_quick_entry": 0, + "allow_on_submit": 0, + "bold": 0, + "collapsible": 0, + "columns": 0, + "fetch_if_empty": 0, + "fieldname": "other_incomes_section", + "fieldtype": "Section Break", + "hidden": 0, + "ignore_user_permissions": 0, + "ignore_xss_filter": 0, + "in_filter": 0, + "in_global_search": 0, + "in_list_view": 0, + "in_standard_filter": 0, + "label": "Other Incomes", + "length": 0, + "no_copy": 0, + "permlevel": 0, + "precision": "", + "print_hide": 0, + "print_hide_if_no_value": 0, + "read_only": 0, + "remember_last_selected_value": 0, + "report_hide": 0, + "reqd": 0, + "search_index": 0, + "set_only_once": 0, + "translatable": 0, + "unique": 0 + }, + { + "allow_bulk_edit": 0, + "allow_in_quick_entry": 0, + "allow_on_submit": 0, + "bold": 0, + "collapsible": 0, + "columns": 0, + "fetch_if_empty": 0, + "fieldname": "income_from_other_sources", + "fieldtype": "Currency", + "hidden": 0, + "ignore_user_permissions": 0, + "ignore_xss_filter": 0, + "in_filter": 0, + "in_global_search": 0, + "in_list_view": 0, + "in_standard_filter": 0, + "label": "Income From Other Sources", + "length": 0, + "no_copy": 0, + "permlevel": 0, + "precision": "", + "print_hide": 0, + "print_hide_if_no_value": 0, + "read_only": 0, + "remember_last_selected_value": 0, + "report_hide": 0, + "reqd": 0, + "search_index": 0, + "set_only_once": 0, + "translatable": 0, + "unique": 0 + }, { "allow_bulk_edit": 0, "allow_in_quick_entry": 0, @@ -558,7 +624,7 @@ "issingle": 0, "istable": 0, "max_attachments": 0, - "modified": "2019-04-25 17:06:36.569549", + "modified": "2019-05-13 12:17:18.045171", "modified_by": "Administrator", "module": "HR", "name": "Employee Tax Exemption Proof Submission", diff --git a/erpnext/hr/doctype/payroll_entry/payroll_entry.py b/erpnext/hr/doctype/payroll_entry/payroll_entry.py index 0961ffc5df..4ce2513bea 100644 --- a/erpnext/hr/doctype/payroll_entry/payroll_entry.py +++ b/erpnext/hr/doctype/payroll_entry/payroll_entry.py @@ -543,14 +543,15 @@ def submit_salary_slips_for_employees(payroll_entry, salary_slips, publish_progr payroll_entry.email_salary_slip(submitted_ss) - payroll_entry.db_set("salary_slips_submitted", 1) - payroll_entry.notify_update() + payroll_entry.db_set("salary_slips_submitted", 1) + payroll_entry.notify_update() if not submitted_ss and not not_submitted_ss: frappe.msgprint(_("No salary slip found to submit for the above selected criteria OR salary slip already submitted")) if not_submitted_ss: frappe.msgprint(_("Could not submit some Salary Slips")) + def get_payroll_entries_for_jv(doctype, txt, searchfield, start, page_len, filters): return frappe.db.sql(""" select name from `tabPayroll Entry` diff --git a/erpnext/hr/doctype/payroll_period/payroll_period.py b/erpnext/hr/doctype/payroll_period/payroll_period.py index 506af99f50..cb4264ba4e 100644 --- a/erpnext/hr/doctype/payroll_period/payroll_period.py +++ b/erpnext/hr/doctype/payroll_period/payroll_period.py @@ -5,7 +5,7 @@ from __future__ import unicode_literals import frappe from frappe import _ -from frappe.utils import date_diff, getdate, formatdate, cint +from frappe.utils import date_diff, getdate, formatdate, cint, month_diff, flt from frappe.model.document import Document from erpnext.hr.utils import get_holidays_for_employee @@ -48,12 +48,13 @@ class PayrollPeriod(Document): def get_payroll_period_days(start_date, end_date, employee): company = frappe.db.get_value("Employee", employee, "company") payroll_period = frappe.db.sql(""" - select name, start_date, end_date from `tabPayroll Period` - where company=%(company)s - and ( - (%(start_date)s between start_date and end_date) - and (%(end_date)s between start_date and end_date) - )""", { + select name, start_date, end_date + from `tabPayroll Period` + where + company=%(company)s + and %(start_date)s between start_date and end_date + and %(end_date)s between start_date and end_date + """, { 'company': company, 'start_date': start_date, 'end_date': end_date @@ -67,3 +68,38 @@ def get_payroll_period_days(start_date, end_date, employee): working_days -= len(holidays) return payroll_period[0][0], working_days, actual_no_of_days return False, False, False + +def get_payroll_period(from_date, to_date, company): + payroll_period = frappe.db.sql(""" + select name, start_date, end_date + from `tabPayroll Period` + where start_date<=%s and end_date>= %s and company=%s + """, (from_date, to_date, company), as_dict=1) + + return payroll_period[0] if payroll_period else None + +def get_period_factor(employee, start_date, end_date, payroll_frequency, payroll_period, depends_on_payment_days=0): + # TODO if both deduct checked update the factor to make tax consistent + period_start, period_end = payroll_period.start_date, payroll_period.end_date + joining_date, relieving_date = frappe.db.get_value("Employee", employee, ["date_of_joining", "relieving_date"]) + + if getdate(joining_date) > getdate(period_start): + period_start = joining_date + if relieving_date and getdate(relieving_date) < getdate(period_end): + period_end = relieving_date + + total_sub_periods, remaining_sub_periods = 0.0, 0.0 + + if payroll_frequency == "Monthly" and not depends_on_payment_days: + total_sub_periods = month_diff(payroll_period.end_date, payroll_period.start_date) + remaining_sub_periods = month_diff(period_end, start_date) + else: + salary_days = date_diff(end_date, start_date) + 1 + + days_in_payroll_period = date_diff(payroll_period.end_date, payroll_period.start_date) + 1 + total_sub_periods = flt(days_in_payroll_period) / flt(salary_days) + + remaining_days_in_payroll_period = date_diff(period_end, start_date) + 1 + remaining_sub_periods = flt(remaining_days_in_payroll_period) / flt(salary_days) + + return total_sub_periods, remaining_sub_periods \ No newline at end of file diff --git a/erpnext/hr/doctype/salary_component/salary_component.js b/erpnext/hr/doctype/salary_component/salary_component.js index f6afd5efeb..c455eb3303 100644 --- a/erpnext/hr/doctype/salary_component/salary_component.js +++ b/erpnext/hr/doctype/salary_component/salary_component.js @@ -24,14 +24,6 @@ frappe.ui.form.on('Salary Component', { is_flexible_benefit: function(frm) { if(frm.doc.is_flexible_benefit){ set_value_for_condition_and_formula(frm); - frm.set_value("is_additional_component", 0); - frm.set_value("formula", ''); - frm.set_value("amount", 0); - } - }, - is_additional_component: function(frm) { - if(frm.doc.is_additional_component){ - frm.set_value("is_flexible_benefit", 0); frm.set_value("formula", ''); frm.set_value("amount", 0); } diff --git a/erpnext/hr/doctype/salary_component/salary_component.json b/erpnext/hr/doctype/salary_component/salary_component.json index 697d224092..ca49ceac00 100644 --- a/erpnext/hr/doctype/salary_component/salary_component.json +++ b/erpnext/hr/doctype/salary_component/salary_component.json @@ -115,40 +115,6 @@ "translatable": 0, "unique": 0 }, - { - "allow_bulk_edit": 0, - "allow_in_quick_entry": 0, - "allow_on_submit": 0, - "bold": 0, - "collapsible": 0, - "columns": 0, - "depends_on": "eval:doc.is_flexible_benefit != 1", - "fetch_if_empty": 0, - "fieldname": "is_additional_component", - "fieldtype": "Check", - "hidden": 0, - "ignore_user_permissions": 0, - "ignore_xss_filter": 0, - "in_filter": 0, - "in_global_search": 0, - "in_list_view": 0, - "in_standard_filter": 0, - "label": "Is Additional Component", - "length": 0, - "no_copy": 0, - "permlevel": 0, - "precision": "", - "print_hide": 0, - "print_hide_if_no_value": 0, - "read_only": 0, - "remember_last_selected_value": 0, - "report_hide": 0, - "reqd": 0, - "search_index": 0, - "set_only_once": 0, - "translatable": 0, - "unique": 0 - }, { "allow_bulk_edit": 0, "allow_in_quick_entry": 0, @@ -285,6 +251,39 @@ "translatable": 0, "unique": 0 }, + { + "allow_bulk_edit": 0, + "allow_in_quick_entry": 0, + "allow_on_submit": 0, + "bold": 0, + "collapsible": 0, + "columns": 0, + "fetch_if_empty": 0, + "fieldname": "deduct_full_tax_on_selected_payroll_date", + "fieldtype": "Check", + "hidden": 0, + "ignore_user_permissions": 0, + "ignore_xss_filter": 0, + "in_filter": 0, + "in_global_search": 0, + "in_list_view": 0, + "in_standard_filter": 0, + "label": "Deduct Full Tax on Selected Payroll Date", + "length": 0, + "no_copy": 0, + "permlevel": 0, + "precision": "", + "print_hide": 0, + "print_hide_if_no_value": 0, + "read_only": 0, + "remember_last_selected_value": 0, + "report_hide": 0, + "reqd": 0, + "search_index": 0, + "set_only_once": 0, + "translatable": 0, + "unique": 0 + }, { "allow_bulk_edit": 0, "allow_in_quick_entry": 0, @@ -424,7 +423,7 @@ "bold": 0, "collapsible": 0, "columns": 0, - "depends_on": "eval:doc.type==\"Earning\" && doc.is_additional_component != 1 && doc.statistical_component!=1", + "depends_on": "eval:doc.type==\"Earning\" && doc.statistical_component!=1", "fetch_if_empty": 0, "fieldname": "flexible_benefits", "fieldtype": "Section Break", @@ -458,7 +457,7 @@ "bold": 0, "collapsible": 0, "columns": 0, - "depends_on": "eval:doc.is_additional_component != 1", + "depends_on": "", "fetch_if_empty": 0, "fieldname": "is_flexible_benefit", "fieldtype": "Check", @@ -1035,7 +1034,7 @@ "issingle": 0, "istable": 0, "max_attachments": 0, - "modified": "2019-04-16 19:08:55.323567", + "modified": "2019-05-13 12:55:55.424370", "modified_by": "Administrator", "module": "HR", "name": "Salary Component", diff --git a/erpnext/hr/doctype/salary_component/test_records.json b/erpnext/hr/doctype/salary_component/test_records.json index 69491bed99..7b22b481f3 100644 --- a/erpnext/hr/doctype/salary_component/test_records.json +++ b/erpnext/hr/doctype/salary_component/test_records.json @@ -35,7 +35,6 @@ "salary_component": "Leave Encashment", "type": "Earning", "is_payable": 1, - "is_tax_applicable": 1, - "is_additional_component": 1 + "is_tax_applicable": 1 } ] \ No newline at end of file diff --git a/erpnext/hr/doctype/salary_component/test_salary_component.py b/erpnext/hr/doctype/salary_component/test_salary_component.py index c13843aca7..965cc9e9ff 100644 --- a/erpnext/hr/doctype/salary_component/test_salary_component.py +++ b/erpnext/hr/doctype/salary_component/test_salary_component.py @@ -19,7 +19,5 @@ def create_salary_component(component_name, **args): "salary_component": component_name, "type": args.get("type") or "Earning", "is_payable": args.get("is_payable") or 1, - "is_tax_applicable": args.get("is_tax_applicable") or 1, - "is_additional_component": args.get("is_additional_component") or 1 + "is_tax_applicable": args.get("is_tax_applicable") or 1 }).insert() - \ No newline at end of file diff --git a/erpnext/hr/doctype/salary_detail/salary_detail.json b/erpnext/hr/doctype/salary_detail/salary_detail.json index 8f2649ad21..edf2786821 100644 --- a/erpnext/hr/doctype/salary_detail/salary_detail.json +++ b/erpnext/hr/doctype/salary_detail/salary_detail.json @@ -218,41 +218,6 @@ "translatable": 0, "unique": 0 }, - { - "allow_bulk_edit": 0, - "allow_in_quick_entry": 0, - "allow_on_submit": 0, - "bold": 0, - "collapsible": 0, - "columns": 0, - "default": "", - "fetch_from": "salary_component.is_additional_component", - "fetch_if_empty": 0, - "fieldname": "is_additional_component", - "fieldtype": "Check", - "hidden": 1, - "ignore_user_permissions": 0, - "ignore_xss_filter": 0, - "in_filter": 0, - "in_global_search": 0, - "in_list_view": 0, - "in_standard_filter": 0, - "label": "Is Additional Component", - "length": 0, - "no_copy": 0, - "permlevel": 0, - "precision": "", - "print_hide": 1, - "print_hide_if_no_value": 0, - "read_only": 1, - "remember_last_selected_value": 0, - "report_hide": 0, - "reqd": 0, - "search_index": 0, - "set_only_once": 0, - "translatable": 0, - "unique": 0 - }, { "allow_bulk_edit": 0, "allow_in_quick_entry": 0, @@ -323,6 +288,39 @@ "translatable": 0, "unique": 0 }, + { + "allow_bulk_edit": 0, + "allow_in_quick_entry": 0, + "allow_on_submit": 0, + "bold": 0, + "collapsible": 0, + "columns": 0, + "fetch_if_empty": 0, + "fieldname": "deduct_full_tax_on_selected_payroll_date", + "fieldtype": "Check", + "hidden": 0, + "ignore_user_permissions": 0, + "ignore_xss_filter": 0, + "in_filter": 0, + "in_global_search": 0, + "in_list_view": 0, + "in_standard_filter": 0, + "label": "Deduct Full Tax on Selected Payroll Date", + "length": 0, + "no_copy": 0, + "permlevel": 0, + "precision": "", + "print_hide": 1, + "print_hide_if_no_value": 0, + "read_only": 1, + "remember_last_selected_value": 0, + "report_hide": 0, + "reqd": 0, + "search_index": 0, + "set_only_once": 0, + "translatable": 0, + "unique": 0 + }, { "allow_bulk_edit": 0, "allow_in_quick_entry": 0, @@ -566,6 +564,41 @@ "translatable": 0, "unique": 0 }, + { + "allow_bulk_edit": 0, + "allow_in_quick_entry": 0, + "allow_on_submit": 0, + "bold": 0, + "collapsible": 0, + "columns": 0, + "default": "", + "fetch_from": "", + "fetch_if_empty": 0, + "fieldname": "additional_amount", + "fieldtype": "Currency", + "hidden": 1, + "ignore_user_permissions": 0, + "ignore_xss_filter": 0, + "in_filter": 0, + "in_global_search": 0, + "in_list_view": 0, + "in_standard_filter": 0, + "label": "Additional Amount", + "length": 0, + "no_copy": 1, + "permlevel": 0, + "precision": "", + "print_hide": 1, + "print_hide_if_no_value": 0, + "read_only": 1, + "remember_last_selected_value": 0, + "report_hide": 0, + "reqd": 0, + "search_index": 0, + "set_only_once": 0, + "translatable": 0, + "unique": 0 + }, { "allow_bulk_edit": 0, "allow_in_quick_entry": 0, @@ -713,7 +746,7 @@ "issingle": 0, "istable": 1, "max_attachments": 0, - "modified": "2019-04-16 19:09:31.726597", + "modified": "2019-05-11 17:33:08.508653", "modified_by": "Administrator", "module": "HR", "name": "Salary Detail", diff --git a/erpnext/hr/doctype/salary_slip/salary_slip.js b/erpnext/hr/doctype/salary_slip/salary_slip.js index 4e9fcce898..f430eeed4e 100644 --- a/erpnext/hr/doctype/salary_slip/salary_slip.js +++ b/erpnext/hr/doctype/salary_slip/salary_slip.js @@ -11,7 +11,7 @@ frappe.ui.form.on("Salary Slip", { {fieldname: 'salary_component', columns: 6}, {fieldname: 'amount', columns: 4} ]; - }) + }); frm.fields_dict["timesheets"].grid.get_field("time_sheet").get_query = function(){ return { @@ -19,31 +19,39 @@ frappe.ui.form.on("Salary Slip", { employee: frm.doc.employee } } - } + }; + frm.set_query("salary_component", "earnings", function() { return { filters: { type: "earning" } } - }) + }); + frm.set_query("salary_component", "deductions", function() { return { filters: { type: "deduction" } } - }) + }); + + frm.set_query("employee", function() { + return{ + query: "erpnext.controllers.queries.employee_query" + } + }); }, - start_date: function(frm, dt, dn){ + start_date: function(frm){ if(frm.doc.start_date){ frm.trigger("set_end_date"); } }, - end_date: function(frm, dt, dn) { - get_emp_and_leave_details(frm.doc, dt, dn); + end_date: function(frm) { + frm.events.get_emp_and_leave_details(frm); }, set_end_date: function(frm){ @@ -70,43 +78,54 @@ frappe.ui.form.on("Salary Slip", { refresh: function(frm) { frm.trigger("toggle_fields") - frm.trigger("toggle_reqd_fields") - var salary_detail_fields = ["formula", "abbr", "statistical_component", "is_tax_applicable", - "is_flexible_benefit", "variable_based_on_taxable_salary", "is_additional_component"] + + var salary_detail_fields = ["formula", "abbr", "statistical_component", "variable_based_on_taxable_salary"]; cur_frm.fields_dict['earnings'].grid.set_column_disp(salary_detail_fields,false); cur_frm.fields_dict['deductions'].grid.set_column_disp(salary_detail_fields,false); }, - salary_slip_based_on_timesheet: function(frm, dt, dn) { + salary_slip_based_on_timesheet: function(frm) { frm.trigger("toggle_fields"); - get_emp_and_leave_details(frm.doc, dt, dn); + frm.events.get_emp_and_leave_details(frm); }, - payroll_frequency: function(frm, dt, dn) { + payroll_frequency: function(frm) { frm.trigger("toggle_fields"); frm.set_value('end_date', ''); }, - employee: function(frm, dt, dn) { - get_emp_and_leave_details(frm.doc, dt, dn); + employee: function(frm) { + frm.events.get_emp_and_leave_details(frm); + }, + + leave_without_pay: function(frm){ + if (frm.doc.employee && frm.doc.start_date && frm.doc.end_date) { + return frappe.call({ + method: 'process_salary_based_on_leave', + doc: frm.doc, + args: {"lwp": frm.doc.leave_without_pay}, + callback: function(r, rt) { + frm.refresh(); + } + }); + } }, toggle_fields: function(frm) { - frm.toggle_display(['hourly_wages', 'timesheets'], - cint(frm.doc.salary_slip_based_on_timesheet)==1); + frm.toggle_display(['hourly_wages', 'timesheets'], cint(frm.doc.salary_slip_based_on_timesheet)===1); frm.toggle_display(['payment_days', 'total_working_days', 'leave_without_pay'], frm.doc.payroll_frequency!=""); - } - -}) - -frappe.ui.form.on('Salary Detail', { - earnings_remove: function(frm, dt, dn) { - calculate_all(frm.doc, dt, dn); }, - deductions_remove: function(frm, dt, dn) { - calculate_all(frm.doc, dt, dn); + + get_emp_and_leave_details: function(frm) { + return frappe.call({ + method: 'get_emp_and_leave_details', + doc: frm.doc, + callback: function(r, rt) { + frm.refresh(); + } + }); } }) @@ -119,133 +138,29 @@ frappe.ui.form.on('Salary Slip Timesheet', { } }); -// Get leave details -//--------------------------------------------------------------------- -var get_emp_and_leave_details = function(doc, dt, dn) { - return frappe.call({ - method: 'get_emp_and_leave_details', - doc: locals[dt][dn], - callback: function(r, rt) { - cur_frm.refresh(); - calculate_all(doc, dt, dn); - } - }); -} - - -cur_frm.cscript.leave_without_pay = function(doc,dt,dn){ - if (doc.employee && doc.start_date && doc.end_date) { - return $c_obj(doc, 'get_leave_details', {"lwp": doc.leave_without_pay}, function(r, rt) { - var doc = locals[dt][dn]; - cur_frm.refresh(); - calculate_all(doc, dt, dn); - }); - } -} - -var calculate_all = function(doc, dt, dn) { - calculate_earning_total(doc, dt, dn); - calculate_ded_total(doc, dt, dn); - calculate_net_pay(doc, dt, dn); -} - -cur_frm.cscript.amount = function(doc,dt,dn){ - var child = locals[dt][dn]; - if(!doc.salary_structure){ - frappe.model.set_value(dt,dn, "default_amount", child.amount) - } - calculate_all(doc, dt, dn); -} - -cur_frm.cscript.depends_on_payment_days = function(doc,dt,dn){ - calculate_earning_total(doc, dt, dn, true); - calculate_ded_total(doc, dt, dn, true); - calculate_net_pay(doc, dt, dn); - refresh_many(['amount','gross_pay', 'rounded_total', 'net_pay', 'loan_repayment']); -}; - -// Calculate earning total -// ------------------------------------------------------------------------ -var calculate_earning_total = function(doc, dt, dn, reset_amount) { - - var tbl = doc.earnings || []; - var total_earn = 0; - for(var i = 0; i < tbl.length; i++){ - if(cint(tbl[i].depends_on_payment_days) == 1) { - tbl[i].amount = Math.round(tbl[i].default_amount)*(flt(doc.payment_days) / - cint(doc.total_working_days)*100)/100; - } else if(reset_amount && tbl[i].default_amount) { - tbl[i].amount = tbl[i].default_amount; - } - if(!tbl[i].do_not_include_in_total) { - total_earn += flt(tbl[i].amount); - - } - } - doc.gross_pay = total_earn; - refresh_many(['earnings', 'amount','gross_pay']); - -} - -// Calculate deduction total -// ------------------------------------------------------------------------ -var calculate_ded_total = function(doc, dt, dn, reset_amount) { - var tbl = doc.deductions || []; - var total_ded = 0; - for(var i = 0; i < tbl.length; i++){ - if(cint(tbl[i].depends_on_payment_days) == 1) { - tbl[i].amount = Math.round(tbl[i].default_amount)*(flt(doc.payment_days)/cint(doc.total_working_days)*100)/100; - } else if(reset_amount && tbl[i].default_amount) { - tbl[i].amount = tbl[i].default_amount; - } - if(!tbl[i].do_not_include_in_total) { - total_ded += flt(tbl[i].amount); - } - } - doc.total_deduction = total_ded; - refresh_many(['deductions', 'total_deduction']); -} - -var calculate_net_pay = function(doc, dt, dn) { - doc.net_pay = flt(doc.gross_pay) - flt(doc.total_deduction); - doc.rounded_total = Math.round(doc.net_pay); - refresh_many(['net_pay', 'rounded_total']); -} - -cur_frm.cscript.validate = function(doc, dt, dn) { - calculate_all(doc, dt, dn); -} - -cur_frm.fields_dict.employee.get_query = function(doc,cdt,cdn) { - return{ - query: "erpnext.controllers.queries.employee_query" - } -} - // calculate total working hours, earnings based on hourly wages and totals -// ------------------------------------------------------------------------ var total_work_hours = function(frm, dt, dn) { - frm.set_value('total_working_hours', 0); - + var total_working_hours = 0.0; $.each(frm.doc["timesheets"] || [], function(i, timesheet) { - frm.doc.total_working_hours += timesheet.working_hours; + total_working_hours += timesheet.working_hours; }); - frm.refresh_field('total_working_hours'); + frm.set_value('total_working_hours', total_working_hours); var wages_amount = frm.doc.total_working_hours * frm.doc.hour_rate; frappe.db.get_value('Salary Structure', {'name': frm.doc.salary_structure}, 'salary_component', (r) => { - frm.set_value('gross_pay', 0); - + var gross_pay = 0.0; $.each(frm.doc["earnings"], function(i, earning) { if (earning.salary_component == r.salary_component) { earning.amount = wages_amount; frm.refresh_fields('earnings'); } - frm.doc.gross_pay += earning.amount; + gross_pay += earning.amount; }); + frm.set_value('gross_pay', gross_pay); - frm.refresh_field('gross_pay'); - calculate_net_pay(frm.doc, dt, dn); + frm.doc.net_pay = flt(frm.doc.gross_pay) - flt(frm.doc.total_deduction); + frm.doc.rounded_total = Math.round(frm.doc.net_pay); + refresh_many(['net_pay', 'rounded_total']); }); } diff --git a/erpnext/hr/doctype/salary_slip/salary_slip.json b/erpnext/hr/doctype/salary_slip/salary_slip.json index c9a5d87281..681b008d02 100644 --- a/erpnext/hr/doctype/salary_slip/salary_slip.json +++ b/erpnext/hr/doctype/salary_slip/salary_slip.json @@ -1,1984 +1,1955 @@ { - "allow_copy": 0, - "allow_events_in_timeline": 0, - "allow_guest_to_view": 0, - "allow_import": 0, - "allow_rename": 0, - "beta": 0, - "creation": "2013-01-10 16:34:15", - "custom": 0, - "default_print_format": "", - "docstatus": 0, - "doctype": "DocType", - "document_type": "Setup", - "editable_grid": 0, + "allow_copy": 0, + "allow_events_in_timeline": 0, + "allow_guest_to_view": 0, + "allow_import": 0, + "allow_rename": 0, + "beta": 0, + "creation": "2013-01-10 16:34:15", + "custom": 0, + "default_print_format": "", + "docstatus": 0, + "doctype": "DocType", + "document_type": "Setup", + "editable_grid": 0, "fields": [ { - "allow_bulk_edit": 0, - "allow_in_quick_entry": 0, - "allow_on_submit": 0, - "bold": 0, - "collapsible": 0, - "columns": 0, - "default": "Today", - "fieldname": "posting_date", - "fieldtype": "Date", - "hidden": 0, - "ignore_user_permissions": 0, - "ignore_xss_filter": 0, - "in_filter": 0, - "in_global_search": 0, - "in_list_view": 1, - "in_standard_filter": 0, - "label": "Posting Date", - "length": 0, - "no_copy": 0, - "permlevel": 0, - "precision": "", - "print_hide": 0, - "print_hide_if_no_value": 0, - "read_only": 0, - "remember_last_selected_value": 0, - "report_hide": 0, - "reqd": 1, - "search_index": 0, - "set_only_once": 0, - "translatable": 0, + "allow_bulk_edit": 0, + "allow_in_quick_entry": 0, + "allow_on_submit": 0, + "bold": 0, + "collapsible": 0, + "columns": 0, + "default": "Today", + "fieldname": "posting_date", + "fieldtype": "Date", + "hidden": 0, + "ignore_user_permissions": 0, + "ignore_xss_filter": 0, + "in_filter": 0, + "in_global_search": 0, + "in_list_view": 1, + "in_standard_filter": 0, + "label": "Posting Date", + "length": 0, + "no_copy": 0, + "permlevel": 0, + "precision": "", + "print_hide": 0, + "print_hide_if_no_value": 0, + "read_only": 0, + "remember_last_selected_value": 0, + "report_hide": 0, + "reqd": 1, + "search_index": 0, + "set_only_once": 0, + "translatable": 0, "unique": 0 - }, + }, { - "allow_bulk_edit": 0, - "allow_in_quick_entry": 0, - "allow_on_submit": 0, - "bold": 0, - "collapsible": 0, - "columns": 0, - "fieldname": "employee", - "fieldtype": "Link", - "hidden": 0, - "ignore_user_permissions": 0, - "ignore_xss_filter": 0, - "in_filter": 0, - "in_global_search": 1, - "in_list_view": 1, - "in_standard_filter": 1, - "label": "Employee", - "length": 0, - "no_copy": 0, - "oldfieldname": "employee", - "oldfieldtype": "Link", - "options": "Employee", - "permlevel": 0, - "print_hide": 0, - "print_hide_if_no_value": 0, - "read_only": 0, - "remember_last_selected_value": 0, - "report_hide": 0, - "reqd": 1, - "search_index": 1, - "set_only_once": 0, - "translatable": 0, + "allow_bulk_edit": 0, + "allow_in_quick_entry": 0, + "allow_on_submit": 0, + "bold": 0, + "collapsible": 0, + "columns": 0, + "fieldname": "employee", + "fieldtype": "Link", + "hidden": 0, + "ignore_user_permissions": 0, + "ignore_xss_filter": 0, + "in_filter": 0, + "in_global_search": 1, + "in_list_view": 1, + "in_standard_filter": 1, + "label": "Employee", + "length": 0, + "no_copy": 0, + "oldfieldname": "employee", + "oldfieldtype": "Link", + "options": "Employee", + "permlevel": 0, + "print_hide": 0, + "print_hide_if_no_value": 0, + "read_only": 0, + "remember_last_selected_value": 0, + "report_hide": 0, + "reqd": 1, + "search_index": 1, + "set_only_once": 0, + "translatable": 0, "unique": 0 - }, + }, { - "allow_bulk_edit": 0, - "allow_in_quick_entry": 0, - "allow_on_submit": 0, - "bold": 0, - "collapsible": 0, - "columns": 0, - "fetch_from": "employee.employee_name", - "fieldname": "employee_name", - "fieldtype": "Read Only", - "hidden": 0, - "ignore_user_permissions": 0, - "ignore_xss_filter": 0, - "in_filter": 0, - "in_global_search": 1, - "in_list_view": 1, - "in_standard_filter": 0, - "label": "Employee Name", - "length": 0, - "no_copy": 0, - "oldfieldname": "employee_name", - "oldfieldtype": "Data", - "options": "", - "permlevel": 0, - "print_hide": 0, - "print_hide_if_no_value": 0, - "read_only": 0, - "remember_last_selected_value": 0, - "report_hide": 0, - "reqd": 1, - "search_index": 0, - "set_only_once": 0, - "translatable": 0, + "allow_bulk_edit": 0, + "allow_in_quick_entry": 0, + "allow_on_submit": 0, + "bold": 0, + "collapsible": 0, + "columns": 0, + "fetch_from": "employee.employee_name", + "fieldname": "employee_name", + "fieldtype": "Read Only", + "hidden": 0, + "ignore_user_permissions": 0, + "ignore_xss_filter": 0, + "in_filter": 0, + "in_global_search": 1, + "in_list_view": 1, + "in_standard_filter": 0, + "label": "Employee Name", + "length": 0, + "no_copy": 0, + "oldfieldname": "employee_name", + "oldfieldtype": "Data", + "options": "", + "permlevel": 0, + "print_hide": 0, + "print_hide_if_no_value": 0, + "read_only": 0, + "remember_last_selected_value": 0, + "report_hide": 0, + "reqd": 1, + "search_index": 0, + "set_only_once": 0, + "translatable": 0, "unique": 0 - }, + }, { - "allow_bulk_edit": 0, - "allow_in_quick_entry": 0, - "allow_on_submit": 0, - "bold": 0, - "collapsible": 0, - "columns": 0, - "fetch_from": "employee.department", - "fieldname": "department", - "fieldtype": "Link", - "hidden": 0, - "ignore_user_permissions": 0, - "ignore_xss_filter": 0, - "in_filter": 0, - "in_global_search": 0, - "in_list_view": 0, - "in_standard_filter": 1, - "label": "Department", - "length": 0, - "no_copy": 0, - "oldfieldname": "department", - "oldfieldtype": "Link", - "options": "Department", - "permlevel": 0, - "print_hide": 0, - "print_hide_if_no_value": 0, - "read_only": 1, - "remember_last_selected_value": 0, - "report_hide": 0, - "reqd": 0, - "search_index": 0, - "set_only_once": 0, - "translatable": 0, + "allow_bulk_edit": 0, + "allow_in_quick_entry": 0, + "allow_on_submit": 0, + "bold": 0, + "collapsible": 0, + "columns": 0, + "fetch_from": "employee.department", + "fieldname": "department", + "fieldtype": "Link", + "hidden": 0, + "ignore_user_permissions": 0, + "ignore_xss_filter": 0, + "in_filter": 0, + "in_global_search": 0, + "in_list_view": 0, + "in_standard_filter": 1, + "label": "Department", + "length": 0, + "no_copy": 0, + "oldfieldname": "department", + "oldfieldtype": "Link", + "options": "Department", + "permlevel": 0, + "print_hide": 0, + "print_hide_if_no_value": 0, + "read_only": 1, + "remember_last_selected_value": 0, + "report_hide": 0, + "reqd": 0, + "search_index": 0, + "set_only_once": 0, + "translatable": 0, "unique": 0 - }, + }, { - "allow_bulk_edit": 0, - "allow_in_quick_entry": 0, - "allow_on_submit": 0, - "bold": 0, - "collapsible": 0, - "columns": 0, - "depends_on": "eval:doc.designation", - "fetch_from": "employee.designation", - "fieldname": "designation", - "fieldtype": "Read Only", - "hidden": 0, - "ignore_user_permissions": 0, - "ignore_xss_filter": 0, - "in_filter": 0, - "in_global_search": 0, - "in_list_view": 0, - "in_standard_filter": 0, - "label": "Designation", - "length": 0, - "no_copy": 0, - "oldfieldname": "designation", - "oldfieldtype": "Link", - "options": "", - "permlevel": 0, - "print_hide": 0, - "print_hide_if_no_value": 0, - "read_only": 0, - "remember_last_selected_value": 0, - "report_hide": 0, - "reqd": 0, - "search_index": 0, - "set_only_once": 0, - "translatable": 0, + "allow_bulk_edit": 0, + "allow_in_quick_entry": 0, + "allow_on_submit": 0, + "bold": 0, + "collapsible": 0, + "columns": 0, + "depends_on": "eval:doc.designation", + "fetch_from": "employee.designation", + "fieldname": "designation", + "fieldtype": "Read Only", + "hidden": 0, + "ignore_user_permissions": 0, + "ignore_xss_filter": 0, + "in_filter": 0, + "in_global_search": 0, + "in_list_view": 0, + "in_standard_filter": 0, + "label": "Designation", + "length": 0, + "no_copy": 0, + "oldfieldname": "designation", + "oldfieldtype": "Link", + "options": "", + "permlevel": 0, + "print_hide": 0, + "print_hide_if_no_value": 0, + "read_only": 0, + "remember_last_selected_value": 0, + "report_hide": 0, + "reqd": 0, + "search_index": 0, + "set_only_once": 0, + "translatable": 0, "unique": 0 - }, + }, { - "allow_bulk_edit": 0, - "allow_in_quick_entry": 0, - "allow_on_submit": 0, - "bold": 0, - "collapsible": 0, - "columns": 0, - "fetch_from": "employee.branch", - "fieldname": "branch", - "fieldtype": "Link", - "hidden": 0, - "ignore_user_permissions": 0, - "ignore_xss_filter": 0, - "in_filter": 0, - "in_global_search": 0, - "in_list_view": 0, - "in_standard_filter": 1, - "label": "Branch", - "length": 0, - "no_copy": 0, - "oldfieldname": "branch", - "oldfieldtype": "Link", - "options": "Branch", - "permlevel": 0, - "print_hide": 0, - "print_hide_if_no_value": 0, - "read_only": 1, - "remember_last_selected_value": 0, - "report_hide": 0, - "reqd": 0, - "search_index": 0, - "set_only_once": 0, - "translatable": 0, + "allow_bulk_edit": 0, + "allow_in_quick_entry": 0, + "allow_on_submit": 0, + "bold": 0, + "collapsible": 0, + "columns": 0, + "fetch_from": "employee.branch", + "fieldname": "branch", + "fieldtype": "Link", + "hidden": 0, + "ignore_user_permissions": 0, + "ignore_xss_filter": 0, + "in_filter": 0, + "in_global_search": 0, + "in_list_view": 0, + "in_standard_filter": 1, + "label": "Branch", + "length": 0, + "no_copy": 0, + "oldfieldname": "branch", + "oldfieldtype": "Link", + "options": "Branch", + "permlevel": 0, + "print_hide": 0, + "print_hide_if_no_value": 0, + "read_only": 1, + "remember_last_selected_value": 0, + "report_hide": 0, + "reqd": 0, + "search_index": 0, + "set_only_once": 0, + "translatable": 0, "unique": 0 - }, + }, { - "allow_bulk_edit": 0, - "allow_in_quick_entry": 0, - "allow_on_submit": 0, - "bold": 0, - "collapsible": 0, - "columns": 0, - "fieldname": "column_break1", - "fieldtype": "Column Break", - "hidden": 0, - "ignore_user_permissions": 0, - "ignore_xss_filter": 0, - "in_filter": 0, - "in_global_search": 0, - "in_list_view": 0, - "in_standard_filter": 0, - "length": 0, - "no_copy": 0, - "oldfieldtype": "Column Break", - "permlevel": 0, - "print_hide": 0, - "print_hide_if_no_value": 0, - "read_only": 0, - "remember_last_selected_value": 0, - "report_hide": 0, - "reqd": 0, - "search_index": 0, - "set_only_once": 0, - "translatable": 0, - "unique": 0, + "allow_bulk_edit": 0, + "allow_in_quick_entry": 0, + "allow_on_submit": 0, + "bold": 0, + "collapsible": 0, + "columns": 0, + "fieldname": "column_break1", + "fieldtype": "Column Break", + "hidden": 0, + "ignore_user_permissions": 0, + "ignore_xss_filter": 0, + "in_filter": 0, + "in_global_search": 0, + "in_list_view": 0, + "in_standard_filter": 0, + "length": 0, + "no_copy": 0, + "oldfieldtype": "Column Break", + "permlevel": 0, + "print_hide": 0, + "print_hide_if_no_value": 0, + "read_only": 0, + "remember_last_selected_value": 0, + "report_hide": 0, + "reqd": 0, + "search_index": 0, + "set_only_once": 0, + "translatable": 0, + "unique": 0, "width": "50%" - }, + }, { - "allow_bulk_edit": 0, - "allow_in_quick_entry": 0, - "allow_on_submit": 0, - "bold": 0, - "collapsible": 0, - "columns": 0, - "fieldname": "status", - "fieldtype": "Select", - "hidden": 0, - "ignore_user_permissions": 0, - "ignore_xss_filter": 0, - "in_filter": 0, - "in_global_search": 0, - "in_list_view": 0, - "in_standard_filter": 0, - "label": "Status", - "length": 0, - "no_copy": 0, - "options": "Draft\nSubmitted\nCancelled", - "permlevel": 0, - "precision": "", - "print_hide": 0, - "print_hide_if_no_value": 0, - "read_only": 1, - "remember_last_selected_value": 0, - "report_hide": 0, - "reqd": 0, - "search_index": 0, - "set_only_once": 0, - "translatable": 0, + "allow_bulk_edit": 0, + "allow_in_quick_entry": 0, + "allow_on_submit": 0, + "bold": 0, + "collapsible": 0, + "columns": 0, + "fieldname": "status", + "fieldtype": "Select", + "hidden": 0, + "ignore_user_permissions": 0, + "ignore_xss_filter": 0, + "in_filter": 0, + "in_global_search": 0, + "in_list_view": 0, + "in_standard_filter": 0, + "label": "Status", + "length": 0, + "no_copy": 0, + "options": "Draft\nSubmitted\nCancelled", + "permlevel": 0, + "precision": "", + "print_hide": 0, + "print_hide_if_no_value": 0, + "read_only": 1, + "remember_last_selected_value": 0, + "report_hide": 0, + "reqd": 0, + "search_index": 0, + "set_only_once": 0, + "translatable": 0, "unique": 0 - }, + }, { - "allow_bulk_edit": 0, - "allow_in_quick_entry": 0, - "allow_on_submit": 0, - "bold": 0, - "collapsible": 0, - "columns": 0, - "fieldname": "journal_entry", - "fieldtype": "Link", - "hidden": 0, - "ignore_user_permissions": 0, - "ignore_xss_filter": 0, - "in_filter": 0, - "in_global_search": 0, - "in_list_view": 0, - "in_standard_filter": 0, - "label": "Journal Entry", - "length": 0, - "no_copy": 0, - "options": "Journal Entry", - "permlevel": 0, - "precision": "", - "print_hide": 0, - "print_hide_if_no_value": 0, - "read_only": 1, - "remember_last_selected_value": 0, - "report_hide": 0, - "reqd": 0, - "search_index": 0, - "set_only_once": 0, - "translatable": 0, + "allow_bulk_edit": 0, + "allow_in_quick_entry": 0, + "allow_on_submit": 0, + "bold": 0, + "collapsible": 0, + "columns": 0, + "fieldname": "journal_entry", + "fieldtype": "Link", + "hidden": 0, + "ignore_user_permissions": 0, + "ignore_xss_filter": 0, + "in_filter": 0, + "in_global_search": 0, + "in_list_view": 0, + "in_standard_filter": 0, + "label": "Journal Entry", + "length": 0, + "no_copy": 0, + "options": "Journal Entry", + "permlevel": 0, + "precision": "", + "print_hide": 0, + "print_hide_if_no_value": 0, + "read_only": 1, + "remember_last_selected_value": 0, + "report_hide": 0, + "reqd": 0, + "search_index": 0, + "set_only_once": 0, + "translatable": 0, "unique": 0 - }, + }, { - "allow_bulk_edit": 0, - "allow_in_quick_entry": 0, - "allow_on_submit": 0, - "bold": 0, - "collapsible": 0, - "columns": 0, - "fieldname": "payroll_entry", - "fieldtype": "Link", - "hidden": 0, - "ignore_user_permissions": 0, - "ignore_xss_filter": 0, - "in_filter": 0, - "in_global_search": 0, - "in_list_view": 0, - "in_standard_filter": 0, - "label": "Payroll Entry", - "length": 0, - "no_copy": 0, - "options": "Payroll Entry", - "permlevel": 0, - "precision": "", - "print_hide": 0, - "print_hide_if_no_value": 0, - "read_only": 1, - "remember_last_selected_value": 0, - "report_hide": 0, - "reqd": 0, - "search_index": 0, - "set_only_once": 0, - "translatable": 0, + "allow_bulk_edit": 0, + "allow_in_quick_entry": 0, + "allow_on_submit": 0, + "bold": 0, + "collapsible": 0, + "columns": 0, + "fieldname": "payroll_entry", + "fieldtype": "Link", + "hidden": 0, + "ignore_user_permissions": 0, + "ignore_xss_filter": 0, + "in_filter": 0, + "in_global_search": 0, + "in_list_view": 0, + "in_standard_filter": 0, + "label": "Payroll Entry", + "length": 0, + "no_copy": 0, + "options": "Payroll Entry", + "permlevel": 0, + "precision": "", + "print_hide": 0, + "print_hide_if_no_value": 0, + "read_only": 1, + "remember_last_selected_value": 0, + "report_hide": 0, + "reqd": 0, + "search_index": 0, + "set_only_once": 0, + "translatable": 0, "unique": 0 - }, + }, { - "allow_bulk_edit": 0, - "allow_in_quick_entry": 0, - "allow_on_submit": 0, - "bold": 0, - "collapsible": 0, - "columns": 0, - "fieldname": "company", - "fieldtype": "Link", - "hidden": 0, - "ignore_user_permissions": 0, - "ignore_xss_filter": 0, - "in_filter": 0, - "in_global_search": 0, - "in_list_view": 1, - "in_standard_filter": 1, - "label": "Company", - "length": 0, - "no_copy": 0, - "options": "Company", - "permlevel": 0, - "print_hide": 0, - "print_hide_if_no_value": 0, - "read_only": 0, - "remember_last_selected_value": 1, - "report_hide": 0, - "reqd": 1, - "search_index": 0, - "set_only_once": 0, - "translatable": 0, + "allow_bulk_edit": 0, + "allow_in_quick_entry": 0, + "allow_on_submit": 0, + "bold": 0, + "collapsible": 0, + "columns": 0, + "fieldname": "company", + "fieldtype": "Link", + "hidden": 0, + "ignore_user_permissions": 0, + "ignore_xss_filter": 0, + "in_filter": 0, + "in_global_search": 0, + "in_list_view": 1, + "in_standard_filter": 1, + "label": "Company", + "length": 0, + "no_copy": 0, + "options": "Company", + "permlevel": 0, + "print_hide": 0, + "print_hide_if_no_value": 0, + "read_only": 0, + "remember_last_selected_value": 1, + "report_hide": 0, + "reqd": 1, + "search_index": 0, + "set_only_once": 0, + "translatable": 0, "unique": 0 - }, + }, { - "allow_bulk_edit": 0, - "allow_in_quick_entry": 0, - "allow_on_submit": 1, - "bold": 0, - "collapsible": 0, - "columns": 0, - "fieldname": "letter_head", - "fieldtype": "Link", - "hidden": 0, - "ignore_user_permissions": 1, - "ignore_xss_filter": 0, - "in_filter": 0, - "in_global_search": 0, - "in_list_view": 0, - "in_standard_filter": 0, - "label": "Letter Head", - "length": 0, - "no_copy": 0, - "options": "Letter Head", - "permlevel": 0, - "print_hide": 1, - "print_hide_if_no_value": 0, - "read_only": 0, - "remember_last_selected_value": 0, - "report_hide": 0, - "reqd": 0, - "search_index": 0, - "set_only_once": 0, - "translatable": 0, + "allow_bulk_edit": 0, + "allow_in_quick_entry": 0, + "allow_on_submit": 1, + "bold": 0, + "collapsible": 0, + "columns": 0, + "fieldname": "letter_head", + "fieldtype": "Link", + "hidden": 0, + "ignore_user_permissions": 1, + "ignore_xss_filter": 0, + "in_filter": 0, + "in_global_search": 0, + "in_list_view": 0, + "in_standard_filter": 0, + "label": "Letter Head", + "length": 0, + "no_copy": 0, + "options": "Letter Head", + "permlevel": 0, + "print_hide": 1, + "print_hide_if_no_value": 0, + "read_only": 0, + "remember_last_selected_value": 0, + "report_hide": 0, + "reqd": 0, + "search_index": 0, + "set_only_once": 0, + "translatable": 0, "unique": 0 - }, + }, { - "allow_bulk_edit": 0, - "allow_in_quick_entry": 0, - "allow_on_submit": 0, - "bold": 0, - "collapsible": 0, - "columns": 0, - "fieldname": "section_break_10", - "fieldtype": "Section Break", - "hidden": 0, - "ignore_user_permissions": 0, - "ignore_xss_filter": 0, - "in_filter": 0, - "in_global_search": 0, - "in_list_view": 0, - "in_standard_filter": 0, - "length": 0, - "no_copy": 0, - "permlevel": 0, - "precision": "", - "print_hide": 0, - "print_hide_if_no_value": 0, - "read_only": 0, - "remember_last_selected_value": 0, - "report_hide": 0, - "reqd": 0, - "search_index": 0, - "set_only_once": 0, - "translatable": 0, + "allow_bulk_edit": 0, + "allow_in_quick_entry": 0, + "allow_on_submit": 0, + "bold": 0, + "collapsible": 0, + "columns": 0, + "fieldname": "section_break_10", + "fieldtype": "Section Break", + "hidden": 0, + "ignore_user_permissions": 0, + "ignore_xss_filter": 0, + "in_filter": 0, + "in_global_search": 0, + "in_list_view": 0, + "in_standard_filter": 0, + "length": 0, + "no_copy": 0, + "permlevel": 0, + "precision": "", + "print_hide": 0, + "print_hide_if_no_value": 0, + "read_only": 0, + "remember_last_selected_value": 0, + "report_hide": 0, + "reqd": 0, + "search_index": 0, + "set_only_once": 0, + "translatable": 0, "unique": 0 - }, + }, { - "allow_bulk_edit": 0, - "allow_in_quick_entry": 0, - "allow_on_submit": 0, - "bold": 0, - "collapsible": 0, - "columns": 0, - "depends_on": "", - "fieldname": "salary_slip_based_on_timesheet", - "fieldtype": "Check", - "hidden": 0, - "ignore_user_permissions": 0, - "ignore_xss_filter": 0, - "in_filter": 0, - "in_global_search": 0, - "in_list_view": 0, - "in_standard_filter": 0, - "label": "Salary Slip Based on Timesheet", - "length": 0, - "no_copy": 0, - "options": "", - "permlevel": 0, - "precision": "", - "print_hide": 0, - "print_hide_if_no_value": 0, - "read_only": 1, - "remember_last_selected_value": 0, - "report_hide": 0, - "reqd": 0, - "search_index": 0, - "set_only_once": 0, - "translatable": 0, + "allow_bulk_edit": 0, + "allow_in_quick_entry": 0, + "allow_on_submit": 0, + "bold": 0, + "collapsible": 0, + "columns": 0, + "depends_on": "", + "fieldname": "salary_slip_based_on_timesheet", + "fieldtype": "Check", + "hidden": 0, + "ignore_user_permissions": 0, + "ignore_xss_filter": 0, + "in_filter": 0, + "in_global_search": 0, + "in_list_view": 0, + "in_standard_filter": 0, + "label": "Salary Slip Based on Timesheet", + "length": 0, + "no_copy": 0, + "options": "", + "permlevel": 0, + "precision": "", + "print_hide": 0, + "print_hide_if_no_value": 0, + "read_only": 1, + "remember_last_selected_value": 0, + "report_hide": 0, + "reqd": 0, + "search_index": 0, + "set_only_once": 0, + "translatable": 0, "unique": 0 - }, + }, { - "allow_bulk_edit": 0, - "allow_in_quick_entry": 0, - "allow_on_submit": 0, - "bold": 0, - "collapsible": 0, - "columns": 0, - "default": "", - "fieldname": "start_date", - "fieldtype": "Date", - "hidden": 0, - "ignore_user_permissions": 0, - "ignore_xss_filter": 0, - "in_filter": 0, - "in_global_search": 0, - "in_list_view": 0, - "in_standard_filter": 0, - "label": "Start Date", - "length": 0, - "no_copy": 0, - "permlevel": 0, - "precision": "", - "print_hide": 0, - "print_hide_if_no_value": 0, - "read_only": 0, - "remember_last_selected_value": 0, - "report_hide": 0, - "reqd": 0, - "search_index": 0, - "set_only_once": 0, - "translatable": 0, + "allow_bulk_edit": 0, + "allow_in_quick_entry": 0, + "allow_on_submit": 0, + "bold": 0, + "collapsible": 0, + "columns": 0, + "default": "", + "fieldname": "start_date", + "fieldtype": "Date", + "hidden": 0, + "ignore_user_permissions": 0, + "ignore_xss_filter": 0, + "in_filter": 0, + "in_global_search": 0, + "in_list_view": 0, + "in_standard_filter": 0, + "label": "Start Date", + "length": 0, + "no_copy": 0, + "permlevel": 0, + "precision": "", + "print_hide": 0, + "print_hide_if_no_value": 0, + "read_only": 0, + "remember_last_selected_value": 0, + "report_hide": 0, + "reqd": 0, + "search_index": 0, + "set_only_once": 0, + "translatable": 0, "unique": 0 - }, + }, { - "allow_bulk_edit": 0, - "allow_in_quick_entry": 0, - "allow_on_submit": 0, - "bold": 0, - "collapsible": 0, - "columns": 0, - "default": "", - "depends_on": "", - "fieldname": "end_date", - "fieldtype": "Date", - "hidden": 0, - "ignore_user_permissions": 0, - "ignore_xss_filter": 0, - "in_filter": 0, - "in_global_search": 0, - "in_list_view": 0, - "in_standard_filter": 0, - "label": "End Date", - "length": 0, - "no_copy": 0, - "permlevel": 0, - "precision": "", - "print_hide": 0, - "print_hide_if_no_value": 0, - "read_only": 0, - "remember_last_selected_value": 0, - "report_hide": 0, - "reqd": 0, - "search_index": 0, - "set_only_once": 0, - "translatable": 0, + "allow_bulk_edit": 0, + "allow_in_quick_entry": 0, + "allow_on_submit": 0, + "bold": 0, + "collapsible": 0, + "columns": 0, + "default": "", + "depends_on": "", + "fieldname": "end_date", + "fieldtype": "Date", + "hidden": 0, + "ignore_user_permissions": 0, + "ignore_xss_filter": 0, + "in_filter": 0, + "in_global_search": 0, + "in_list_view": 0, + "in_standard_filter": 0, + "label": "End Date", + "length": 0, + "no_copy": 0, + "permlevel": 0, + "precision": "", + "print_hide": 0, + "print_hide_if_no_value": 0, + "read_only": 0, + "remember_last_selected_value": 0, + "report_hide": 0, + "reqd": 0, + "search_index": 0, + "set_only_once": 0, + "translatable": 0, "unique": 0 - }, + }, { - "allow_bulk_edit": 0, - "allow_in_quick_entry": 0, - "allow_on_submit": 0, - "bold": 0, - "collapsible": 0, - "columns": 0, - "fieldname": "column_break_15", - "fieldtype": "Column Break", - "hidden": 0, - "ignore_user_permissions": 0, - "ignore_xss_filter": 0, - "in_filter": 0, - "in_global_search": 0, - "in_list_view": 0, - "in_standard_filter": 0, - "length": 0, - "no_copy": 0, - "permlevel": 0, - "precision": "", - "print_hide": 0, - "print_hide_if_no_value": 0, - "read_only": 0, - "remember_last_selected_value": 0, - "report_hide": 0, - "reqd": 0, - "search_index": 0, - "set_only_once": 0, - "translatable": 0, + "allow_bulk_edit": 0, + "allow_in_quick_entry": 0, + "allow_on_submit": 0, + "bold": 0, + "collapsible": 0, + "columns": 0, + "fieldname": "column_break_15", + "fieldtype": "Column Break", + "hidden": 0, + "ignore_user_permissions": 0, + "ignore_xss_filter": 0, + "in_filter": 0, + "in_global_search": 0, + "in_list_view": 0, + "in_standard_filter": 0, + "length": 0, + "no_copy": 0, + "permlevel": 0, + "precision": "", + "print_hide": 0, + "print_hide_if_no_value": 0, + "read_only": 0, + "remember_last_selected_value": 0, + "report_hide": 0, + "reqd": 0, + "search_index": 0, + "set_only_once": 0, + "translatable": 0, "unique": 0 - }, + }, { - "allow_bulk_edit": 0, - "allow_in_quick_entry": 0, - "allow_on_submit": 0, - "bold": 0, - "collapsible": 0, - "columns": 0, - "depends_on": "", - "fieldname": "salary_structure", - "fieldtype": "Link", - "hidden": 0, - "ignore_user_permissions": 0, - "ignore_xss_filter": 0, - "in_filter": 0, - "in_global_search": 0, - "in_list_view": 0, - "in_standard_filter": 0, - "label": "Salary Structure", - "length": 0, - "no_copy": 0, - "options": "Salary Structure", - "permlevel": 0, - "precision": "", - "print_hide": 0, - "print_hide_if_no_value": 0, - "read_only": 1, - "remember_last_selected_value": 0, - "report_hide": 0, - "reqd": 0, - "search_index": 0, - "set_only_once": 0, - "translatable": 0, + "allow_bulk_edit": 0, + "allow_in_quick_entry": 0, + "allow_on_submit": 0, + "bold": 0, + "collapsible": 0, + "columns": 0, + "depends_on": "", + "fieldname": "salary_structure", + "fieldtype": "Link", + "hidden": 0, + "ignore_user_permissions": 0, + "ignore_xss_filter": 0, + "in_filter": 0, + "in_global_search": 0, + "in_list_view": 0, + "in_standard_filter": 0, + "label": "Salary Structure", + "length": 0, + "no_copy": 0, + "options": "Salary Structure", + "permlevel": 0, + "precision": "", + "print_hide": 0, + "print_hide_if_no_value": 0, + "read_only": 1, + "remember_last_selected_value": 0, + "report_hide": 0, + "reqd": 0, + "search_index": 0, + "set_only_once": 0, + "translatable": 0, "unique": 0 - }, + }, { - "allow_bulk_edit": 0, - "allow_in_quick_entry": 0, - "allow_on_submit": 0, - "bold": 0, - "collapsible": 0, - "columns": 0, - "default": "", - "depends_on": "eval:(!doc.salary_slip_based_on_timesheet)", - "fieldname": "payroll_frequency", - "fieldtype": "Select", - "hidden": 0, - "ignore_user_permissions": 0, - "ignore_xss_filter": 0, - "in_filter": 0, - "in_global_search": 0, - "in_list_view": 0, - "in_standard_filter": 0, - "label": "Payroll Frequency", - "length": 0, - "no_copy": 0, - "options": "\nMonthly\nFortnightly\nBimonthly\nWeekly\nDaily", - "permlevel": 0, - "precision": "", - "print_hide": 0, - "print_hide_if_no_value": 0, - "read_only": 0, - "remember_last_selected_value": 0, - "report_hide": 0, - "reqd": 0, - "search_index": 0, - "set_only_once": 0, - "translatable": 0, + "allow_bulk_edit": 0, + "allow_in_quick_entry": 0, + "allow_on_submit": 0, + "bold": 0, + "collapsible": 0, + "columns": 0, + "default": "", + "depends_on": "eval:(!doc.salary_slip_based_on_timesheet)", + "fieldname": "payroll_frequency", + "fieldtype": "Select", + "hidden": 0, + "ignore_user_permissions": 0, + "ignore_xss_filter": 0, + "in_filter": 0, + "in_global_search": 0, + "in_list_view": 0, + "in_standard_filter": 0, + "label": "Payroll Frequency", + "length": 0, + "no_copy": 0, + "options": "\nMonthly\nFortnightly\nBimonthly\nWeekly\nDaily", + "permlevel": 0, + "precision": "", + "print_hide": 0, + "print_hide_if_no_value": 0, + "read_only": 0, + "remember_last_selected_value": 0, + "report_hide": 0, + "reqd": 0, + "search_index": 0, + "set_only_once": 0, + "translatable": 0, "unique": 0 - }, + }, { - "allow_bulk_edit": 0, - "allow_in_quick_entry": 0, - "allow_on_submit": 0, - "bold": 0, - "collapsible": 0, - "columns": 0, - "depends_on": "", - "fieldname": "total_working_days", - "fieldtype": "Float", - "hidden": 0, - "ignore_user_permissions": 0, - "ignore_xss_filter": 0, - "in_filter": 0, - "in_global_search": 0, - "in_list_view": 0, - "in_standard_filter": 0, - "label": "Working Days", - "length": 0, - "no_copy": 0, - "oldfieldname": "total_days_in_month", - "oldfieldtype": "Int", - "permlevel": 0, - "print_hide": 0, - "print_hide_if_no_value": 0, - "read_only": 1, - "remember_last_selected_value": 0, - "report_hide": 0, - "reqd": 1, - "search_index": 0, - "set_only_once": 0, - "translatable": 0, + "allow_bulk_edit": 0, + "allow_in_quick_entry": 0, + "allow_on_submit": 0, + "bold": 0, + "collapsible": 0, + "columns": 0, + "depends_on": "", + "fieldname": "total_working_days", + "fieldtype": "Float", + "hidden": 0, + "ignore_user_permissions": 0, + "ignore_xss_filter": 0, + "in_filter": 0, + "in_global_search": 0, + "in_list_view": 0, + "in_standard_filter": 0, + "label": "Working Days", + "length": 0, + "no_copy": 0, + "oldfieldname": "total_days_in_month", + "oldfieldtype": "Int", + "permlevel": 0, + "print_hide": 0, + "print_hide_if_no_value": 0, + "read_only": 1, + "remember_last_selected_value": 0, + "report_hide": 0, + "reqd": 1, + "search_index": 0, + "set_only_once": 0, + "translatable": 0, "unique": 0 - }, + }, { - "allow_bulk_edit": 0, - "allow_in_quick_entry": 0, - "allow_on_submit": 0, - "bold": 0, - "collapsible": 0, - "columns": 0, - "depends_on": "", - "fieldname": "leave_without_pay", - "fieldtype": "Float", - "hidden": 0, - "ignore_user_permissions": 0, - "ignore_xss_filter": 0, - "in_filter": 0, - "in_global_search": 0, - "in_list_view": 0, - "in_standard_filter": 0, - "label": "Leave Without Pay", - "length": 0, - "no_copy": 0, - "oldfieldname": "leave_without_pay", - "oldfieldtype": "Currency", - "permlevel": 0, - "print_hide": 0, - "print_hide_if_no_value": 0, - "read_only": 0, - "remember_last_selected_value": 0, - "report_hide": 0, - "reqd": 0, - "search_index": 0, - "set_only_once": 0, - "translatable": 0, + "allow_bulk_edit": 0, + "allow_in_quick_entry": 0, + "allow_on_submit": 0, + "bold": 0, + "collapsible": 0, + "columns": 0, + "depends_on": "", + "fieldname": "leave_without_pay", + "fieldtype": "Float", + "hidden": 0, + "ignore_user_permissions": 0, + "ignore_xss_filter": 0, + "in_filter": 0, + "in_global_search": 0, + "in_list_view": 0, + "in_standard_filter": 0, + "label": "Leave Without Pay", + "length": 0, + "no_copy": 0, + "oldfieldname": "leave_without_pay", + "oldfieldtype": "Currency", + "permlevel": 0, + "print_hide": 0, + "print_hide_if_no_value": 0, + "read_only": 0, + "remember_last_selected_value": 0, + "report_hide": 0, + "reqd": 0, + "search_index": 0, + "set_only_once": 0, + "translatable": 0, "unique": 0 - }, + }, { - "allow_bulk_edit": 0, - "allow_in_quick_entry": 0, - "allow_on_submit": 0, - "bold": 0, - "collapsible": 0, - "columns": 0, - "depends_on": "", - "fieldname": "payment_days", - "fieldtype": "Float", - "hidden": 0, - "ignore_user_permissions": 0, - "ignore_xss_filter": 0, - "in_filter": 0, - "in_global_search": 0, - "in_list_view": 0, - "in_standard_filter": 0, - "label": "Payment Days", - "length": 0, - "no_copy": 0, - "oldfieldname": "payment_days", - "oldfieldtype": "Float", - "permlevel": 0, - "print_hide": 0, - "print_hide_if_no_value": 0, - "read_only": 1, - "remember_last_selected_value": 0, - "report_hide": 0, - "reqd": 1, - "search_index": 0, - "set_only_once": 0, - "translatable": 0, + "allow_bulk_edit": 0, + "allow_in_quick_entry": 0, + "allow_on_submit": 0, + "bold": 0, + "collapsible": 0, + "columns": 0, + "depends_on": "", + "fieldname": "payment_days", + "fieldtype": "Float", + "hidden": 0, + "ignore_user_permissions": 0, + "ignore_xss_filter": 0, + "in_filter": 0, + "in_global_search": 0, + "in_list_view": 0, + "in_standard_filter": 0, + "label": "Payment Days", + "length": 0, + "no_copy": 0, + "oldfieldname": "payment_days", + "oldfieldtype": "Float", + "permlevel": 0, + "print_hide": 0, + "print_hide_if_no_value": 0, + "read_only": 1, + "remember_last_selected_value": 0, + "report_hide": 0, + "reqd": 1, + "search_index": 0, + "set_only_once": 0, + "translatable": 0, "unique": 0 - }, + }, { - "allow_bulk_edit": 0, - "allow_in_quick_entry": 0, - "allow_on_submit": 0, - "bold": 0, - "collapsible": 0, - "columns": 0, - "depends_on": "", - "fieldname": "hourly_wages", - "fieldtype": "Section Break", - "hidden": 0, - "ignore_user_permissions": 0, - "ignore_xss_filter": 0, - "in_filter": 0, - "in_global_search": 0, - "in_list_view": 0, - "in_standard_filter": 0, - "label": "", - "length": 0, - "no_copy": 0, - "permlevel": 0, - "precision": "", - "print_hide": 0, - "print_hide_if_no_value": 0, - "read_only": 0, - "remember_last_selected_value": 0, - "report_hide": 0, - "reqd": 0, - "search_index": 0, - "set_only_once": 0, - "translatable": 0, + "allow_bulk_edit": 0, + "allow_in_quick_entry": 0, + "allow_on_submit": 0, + "bold": 0, + "collapsible": 0, + "columns": 0, + "depends_on": "", + "fieldname": "hourly_wages", + "fieldtype": "Section Break", + "hidden": 0, + "ignore_user_permissions": 0, + "ignore_xss_filter": 0, + "in_filter": 0, + "in_global_search": 0, + "in_list_view": 0, + "in_standard_filter": 0, + "label": "", + "length": 0, + "no_copy": 0, + "permlevel": 0, + "precision": "", + "print_hide": 0, + "print_hide_if_no_value": 0, + "read_only": 0, + "remember_last_selected_value": 0, + "report_hide": 0, + "reqd": 0, + "search_index": 0, + "set_only_once": 0, + "translatable": 0, "unique": 0 - }, + }, { - "allow_bulk_edit": 0, - "allow_in_quick_entry": 0, - "allow_on_submit": 0, - "bold": 0, - "collapsible": 0, - "columns": 0, - "depends_on": "", - "fieldname": "timesheets", - "fieldtype": "Table", - "hidden": 0, - "ignore_user_permissions": 0, - "ignore_xss_filter": 0, - "in_filter": 0, - "in_global_search": 0, - "in_list_view": 0, - "in_standard_filter": 0, - "label": "Salary Slip Timesheet", - "length": 0, - "no_copy": 0, - "options": "Salary Slip Timesheet", - "permlevel": 0, - "precision": "", - "print_hide": 0, - "print_hide_if_no_value": 0, - "read_only": 0, - "remember_last_selected_value": 0, - "report_hide": 0, - "reqd": 0, - "search_index": 0, - "set_only_once": 0, - "translatable": 0, + "allow_bulk_edit": 0, + "allow_in_quick_entry": 0, + "allow_on_submit": 0, + "bold": 0, + "collapsible": 0, + "columns": 0, + "depends_on": "", + "fieldname": "timesheets", + "fieldtype": "Table", + "hidden": 0, + "ignore_user_permissions": 0, + "ignore_xss_filter": 0, + "in_filter": 0, + "in_global_search": 0, + "in_list_view": 0, + "in_standard_filter": 0, + "label": "Salary Slip Timesheet", + "length": 0, + "no_copy": 0, + "options": "Salary Slip Timesheet", + "permlevel": 0, + "precision": "", + "print_hide": 0, + "print_hide_if_no_value": 0, + "read_only": 0, + "remember_last_selected_value": 0, + "report_hide": 0, + "reqd": 0, + "search_index": 0, + "set_only_once": 0, + "translatable": 0, "unique": 0 - }, + }, { - "allow_bulk_edit": 0, - "allow_in_quick_entry": 0, - "allow_on_submit": 0, - "bold": 0, - "collapsible": 0, - "columns": 0, - "fieldname": "column_break_20", - "fieldtype": "Column Break", - "hidden": 0, - "ignore_user_permissions": 0, - "ignore_xss_filter": 0, - "in_filter": 0, - "in_global_search": 0, - "in_list_view": 0, - "in_standard_filter": 0, - "length": 0, - "no_copy": 0, - "permlevel": 0, - "precision": "", - "print_hide": 0, - "print_hide_if_no_value": 0, - "read_only": 0, - "remember_last_selected_value": 0, - "report_hide": 0, - "reqd": 0, - "search_index": 0, - "set_only_once": 0, - "translatable": 0, + "allow_bulk_edit": 0, + "allow_in_quick_entry": 0, + "allow_on_submit": 0, + "bold": 0, + "collapsible": 0, + "columns": 0, + "fieldname": "column_break_20", + "fieldtype": "Column Break", + "hidden": 0, + "ignore_user_permissions": 0, + "ignore_xss_filter": 0, + "in_filter": 0, + "in_global_search": 0, + "in_list_view": 0, + "in_standard_filter": 0, + "length": 0, + "no_copy": 0, + "permlevel": 0, + "precision": "", + "print_hide": 0, + "print_hide_if_no_value": 0, + "read_only": 0, + "remember_last_selected_value": 0, + "report_hide": 0, + "reqd": 0, + "search_index": 0, + "set_only_once": 0, + "translatable": 0, "unique": 0 - }, + }, { - "allow_bulk_edit": 0, - "allow_in_quick_entry": 0, - "allow_on_submit": 0, - "bold": 0, - "collapsible": 0, - "columns": 0, - "fieldname": "total_working_hours", - "fieldtype": "Float", - "hidden": 0, - "ignore_user_permissions": 0, - "ignore_xss_filter": 0, - "in_filter": 0, - "in_global_search": 0, - "in_list_view": 0, - "in_standard_filter": 0, - "label": "Total Working Hours", - "length": 0, - "no_copy": 0, - "permlevel": 0, - "precision": "", - "print_hide": 0, - "print_hide_if_no_value": 1, - "read_only": 0, - "remember_last_selected_value": 0, - "report_hide": 0, - "reqd": 0, - "search_index": 0, - "set_only_once": 0, - "translatable": 0, + "allow_bulk_edit": 0, + "allow_in_quick_entry": 0, + "allow_on_submit": 0, + "bold": 0, + "collapsible": 0, + "columns": 0, + "fieldname": "total_working_hours", + "fieldtype": "Float", + "hidden": 0, + "ignore_user_permissions": 0, + "ignore_xss_filter": 0, + "in_filter": 0, + "in_global_search": 0, + "in_list_view": 0, + "in_standard_filter": 0, + "label": "Total Working Hours", + "length": 0, + "no_copy": 0, + "permlevel": 0, + "precision": "", + "print_hide": 0, + "print_hide_if_no_value": 1, + "read_only": 0, + "remember_last_selected_value": 0, + "report_hide": 0, + "reqd": 0, + "search_index": 0, + "set_only_once": 0, + "translatable": 0, "unique": 0 - }, + }, { - "allow_bulk_edit": 0, - "allow_in_quick_entry": 0, - "allow_on_submit": 0, - "bold": 0, - "collapsible": 0, - "columns": 0, - "fieldname": "hour_rate", - "fieldtype": "Currency", - "hidden": 0, - "ignore_user_permissions": 0, - "ignore_xss_filter": 0, - "in_filter": 0, - "in_global_search": 0, - "in_list_view": 0, - "in_standard_filter": 0, - "label": "Hour Rate", - "length": 0, - "no_copy": 0, - "options": "Company:company:default_currency", - "permlevel": 0, - "precision": "", - "print_hide": 0, - "print_hide_if_no_value": 1, - "read_only": 0, - "remember_last_selected_value": 0, - "report_hide": 0, - "reqd": 0, - "search_index": 0, - "set_only_once": 0, - "translatable": 0, + "allow_bulk_edit": 0, + "allow_in_quick_entry": 0, + "allow_on_submit": 0, + "bold": 0, + "collapsible": 0, + "columns": 0, + "fieldname": "hour_rate", + "fieldtype": "Currency", + "hidden": 0, + "ignore_user_permissions": 0, + "ignore_xss_filter": 0, + "in_filter": 0, + "in_global_search": 0, + "in_list_view": 0, + "in_standard_filter": 0, + "label": "Hour Rate", + "length": 0, + "no_copy": 0, + "options": "Company:company:default_currency", + "permlevel": 0, + "precision": "", + "print_hide": 0, + "print_hide_if_no_value": 1, + "read_only": 0, + "remember_last_selected_value": 0, + "report_hide": 0, + "reqd": 0, + "search_index": 0, + "set_only_once": 0, + "translatable": 0, "unique": 0 - }, + }, { - "allow_bulk_edit": 0, - "allow_in_quick_entry": 0, - "allow_on_submit": 0, - "bold": 0, - "collapsible": 0, - "columns": 0, - "depends_on": "", - "fieldname": "section_break_26", - "fieldtype": "Section Break", - "hidden": 0, - "ignore_user_permissions": 0, - "ignore_xss_filter": 0, - "in_filter": 0, - "in_global_search": 0, - "in_list_view": 0, - "in_standard_filter": 0, - "label": "", - "length": 0, - "no_copy": 0, - "permlevel": 0, - "precision": "", - "print_hide": 0, - "print_hide_if_no_value": 0, - "read_only": 0, - "remember_last_selected_value": 0, - "report_hide": 0, - "reqd": 0, - "search_index": 0, - "set_only_once": 0, - "translatable": 0, + "allow_bulk_edit": 0, + "allow_in_quick_entry": 0, + "allow_on_submit": 0, + "bold": 0, + "collapsible": 0, + "columns": 0, + "depends_on": "", + "fieldname": "section_break_26", + "fieldtype": "Section Break", + "hidden": 0, + "ignore_user_permissions": 0, + "ignore_xss_filter": 0, + "in_filter": 0, + "in_global_search": 0, + "in_list_view": 0, + "in_standard_filter": 0, + "label": "", + "length": 0, + "no_copy": 0, + "permlevel": 0, + "precision": "", + "print_hide": 0, + "print_hide_if_no_value": 0, + "read_only": 0, + "remember_last_selected_value": 0, + "report_hide": 0, + "reqd": 0, + "search_index": 0, + "set_only_once": 0, + "translatable": 0, "unique": 0 - }, + }, { - "allow_bulk_edit": 0, - "allow_in_quick_entry": 0, - "allow_on_submit": 0, - "bold": 0, - "collapsible": 0, - "columns": 0, - "fieldname": "bank_name", - "fieldtype": "Data", - "hidden": 0, - "ignore_user_permissions": 0, - "ignore_xss_filter": 0, - "in_filter": 0, - "in_global_search": 0, - "in_list_view": 0, - "in_standard_filter": 0, - "label": "Bank Name", - "length": 0, - "no_copy": 0, - "oldfieldname": "bank_name", - "oldfieldtype": "Data", - "permlevel": 0, - "print_hide": 0, - "print_hide_if_no_value": 0, - "read_only": 1, - "remember_last_selected_value": 0, - "report_hide": 0, - "reqd": 0, - "search_index": 0, - "set_only_once": 0, - "translatable": 0, + "allow_bulk_edit": 0, + "allow_in_quick_entry": 0, + "allow_on_submit": 0, + "bold": 0, + "collapsible": 0, + "columns": 0, + "fieldname": "bank_name", + "fieldtype": "Data", + "hidden": 0, + "ignore_user_permissions": 0, + "ignore_xss_filter": 0, + "in_filter": 0, + "in_global_search": 0, + "in_list_view": 0, + "in_standard_filter": 0, + "label": "Bank Name", + "length": 0, + "no_copy": 0, + "oldfieldname": "bank_name", + "oldfieldtype": "Data", + "permlevel": 0, + "print_hide": 0, + "print_hide_if_no_value": 0, + "read_only": 1, + "remember_last_selected_value": 0, + "report_hide": 0, + "reqd": 0, + "search_index": 0, + "set_only_once": 0, + "translatable": 0, "unique": 0 - }, + }, { - "allow_bulk_edit": 0, - "allow_in_quick_entry": 0, - "allow_on_submit": 0, - "bold": 0, - "collapsible": 0, - "columns": 0, - "fieldname": "bank_account_no", - "fieldtype": "Data", - "hidden": 0, - "ignore_user_permissions": 0, - "ignore_xss_filter": 0, - "in_filter": 0, - "in_global_search": 0, - "in_list_view": 0, - "in_standard_filter": 0, - "label": "Bank Account No.", - "length": 0, - "no_copy": 0, - "oldfieldname": "bank_account_no", - "oldfieldtype": "Data", - "permlevel": 0, - "print_hide": 0, - "print_hide_if_no_value": 0, - "read_only": 1, - "remember_last_selected_value": 0, - "report_hide": 0, - "reqd": 0, - "search_index": 0, - "set_only_once": 0, - "translatable": 0, + "allow_bulk_edit": 0, + "allow_in_quick_entry": 0, + "allow_on_submit": 0, + "bold": 0, + "collapsible": 0, + "columns": 0, + "fieldname": "bank_account_no", + "fieldtype": "Data", + "hidden": 0, + "ignore_user_permissions": 0, + "ignore_xss_filter": 0, + "in_filter": 0, + "in_global_search": 0, + "in_list_view": 0, + "in_standard_filter": 0, + "label": "Bank Account No.", + "length": 0, + "no_copy": 0, + "oldfieldname": "bank_account_no", + "oldfieldtype": "Data", + "permlevel": 0, + "print_hide": 0, + "print_hide_if_no_value": 0, + "read_only": 1, + "remember_last_selected_value": 0, + "report_hide": 0, + "reqd": 0, + "search_index": 0, + "set_only_once": 0, + "translatable": 0, "unique": 0 - }, + }, { - "allow_bulk_edit": 0, - "allow_in_quick_entry": 0, - "allow_on_submit": 0, - "bold": 0, - "collapsible": 0, - "columns": 0, - "fieldname": "column_break_01", - "fieldtype": "Column Break", - "hidden": 0, - "ignore_user_permissions": 0, - "ignore_xss_filter": 0, - "in_filter": 0, - "in_global_search": 0, - "in_list_view": 0, - "in_standard_filter": 0, - "length": 0, - "no_copy": 0, - "permlevel": 0, - "precision": "", - "print_hide": 0, - "print_hide_if_no_value": 0, - "read_only": 0, - "remember_last_selected_value": 0, - "report_hide": 0, - "reqd": 0, - "search_index": 0, - "set_only_once": 0, - "translatable": 0, + "allow_bulk_edit": 0, + "allow_in_quick_entry": 0, + "allow_on_submit": 0, + "bold": 0, + "collapsible": 0, + "columns": 0, + "fetch_if_empty": 0, + "fieldname": "section_break_32", + "fieldtype": "Section Break", + "hidden": 0, + "ignore_user_permissions": 0, + "ignore_xss_filter": 0, + "in_filter": 0, + "in_global_search": 0, + "in_list_view": 0, + "in_standard_filter": 0, + "length": 0, + "no_copy": 0, + "permlevel": 0, + "precision": "", + "print_hide": 0, + "print_hide_if_no_value": 0, + "read_only": 0, + "remember_last_selected_value": 0, + "report_hide": 0, + "reqd": 0, + "search_index": 0, + "set_only_once": 0, + "translatable": 0, "unique": 0 - }, + }, { - "allow_bulk_edit": 0, - "allow_in_quick_entry": 0, - "allow_on_submit": 0, - "bold": 0, - "collapsible": 0, - "columns": 0, - "fieldname": "amended_from", - "fieldtype": "Link", - "hidden": 0, - "ignore_user_permissions": 1, - "ignore_xss_filter": 0, - "in_filter": 0, - "in_global_search": 0, - "in_list_view": 0, - "in_standard_filter": 0, - "label": "Amended From", - "length": 0, - "no_copy": 1, - "oldfieldname": "amended_from", - "oldfieldtype": "Data", - "options": "Salary Slip", - "permlevel": 0, - "print_hide": 1, - "print_hide_if_no_value": 0, - "read_only": 0, - "remember_last_selected_value": 0, - "report_hide": 0, - "reqd": 0, - "search_index": 0, - "set_only_once": 0, - "translatable": 0, + "allow_bulk_edit": 0, + "allow_in_quick_entry": 0, + "allow_on_submit": 0, + "bold": 0, + "collapsible": 0, + "columns": 0, + "fieldname": "deduct_tax_for_unclaimed_employee_benefits", + "fieldtype": "Check", + "hidden": 0, + "ignore_user_permissions": 0, + "ignore_xss_filter": 0, + "in_filter": 0, + "in_global_search": 0, + "in_list_view": 0, + "in_standard_filter": 0, + "label": "Deduct Tax For Unclaimed Employee Benefits", + "length": 0, + "no_copy": 0, + "permlevel": 0, + "precision": "", + "print_hide": 0, + "print_hide_if_no_value": 0, + "read_only": 0, + "remember_last_selected_value": 0, + "report_hide": 0, + "reqd": 0, + "search_index": 0, + "set_only_once": 0, + "translatable": 0, "unique": 0 - }, + }, { - "allow_bulk_edit": 0, - "allow_in_quick_entry": 0, - "allow_on_submit": 0, - "bold": 0, - "collapsible": 0, - "columns": 0, - "fieldname": "section_break_32", - "fieldtype": "Section Break", - "hidden": 0, - "ignore_user_permissions": 0, - "ignore_xss_filter": 0, - "in_filter": 0, - "in_global_search": 0, - "in_list_view": 0, - "in_standard_filter": 0, - "length": 0, - "no_copy": 0, - "permlevel": 0, - "precision": "", - "print_hide": 0, - "print_hide_if_no_value": 0, - "read_only": 0, - "remember_last_selected_value": 0, - "report_hide": 0, - "reqd": 0, - "search_index": 0, - "set_only_once": 0, - "translatable": 0, + "allow_bulk_edit": 0, + "allow_in_quick_entry": 0, + "allow_on_submit": 0, + "bold": 0, + "collapsible": 0, + "columns": 0, + "fieldname": "deduct_tax_for_unsubmitted_tax_exemption_proof", + "fieldtype": "Check", + "hidden": 0, + "ignore_user_permissions": 0, + "ignore_xss_filter": 0, + "in_filter": 0, + "in_global_search": 0, + "in_list_view": 0, + "in_standard_filter": 0, + "label": "Deduct Tax For Unsubmitted Tax Exemption Proof", + "length": 0, + "no_copy": 0, + "permlevel": 0, + "precision": "", + "print_hide": 0, + "print_hide_if_no_value": 0, + "read_only": 0, + "remember_last_selected_value": 0, + "report_hide": 0, + "reqd": 0, + "search_index": 0, + "set_only_once": 0, + "translatable": 0, "unique": 0 - }, + }, { - "allow_bulk_edit": 0, - "allow_in_quick_entry": 0, - "allow_on_submit": 0, - "bold": 0, - "collapsible": 0, - "columns": 0, - "fieldname": "deduct_tax_for_unclaimed_employee_benefits", - "fieldtype": "Check", - "hidden": 0, - "ignore_user_permissions": 0, - "ignore_xss_filter": 0, - "in_filter": 0, - "in_global_search": 0, - "in_list_view": 0, - "in_standard_filter": 0, - "label": "Deduct Tax For Unclaimed Employee Benefits", - "length": 0, - "no_copy": 0, - "permlevel": 0, - "precision": "", - "print_hide": 0, - "print_hide_if_no_value": 0, - "read_only": 0, - "remember_last_selected_value": 0, - "report_hide": 0, - "reqd": 0, - "search_index": 0, - "set_only_once": 0, - "translatable": 0, + "allow_bulk_edit": 0, + "allow_in_quick_entry": 0, + "allow_on_submit": 0, + "bold": 0, + "collapsible": 0, + "columns": 0, + "fieldname": "earning_deduction", + "fieldtype": "Section Break", + "hidden": 0, + "ignore_user_permissions": 0, + "ignore_xss_filter": 0, + "in_filter": 0, + "in_global_search": 0, + "in_list_view": 0, + "in_standard_filter": 0, + "label": "Earning & Deduction", + "length": 0, + "no_copy": 0, + "oldfieldtype": "Section Break", + "permlevel": 0, + "print_hide": 0, + "print_hide_if_no_value": 0, + "read_only": 0, + "remember_last_selected_value": 0, + "report_hide": 0, + "reqd": 0, + "search_index": 0, + "set_only_once": 0, + "translatable": 0, "unique": 0 - }, + }, { - "allow_bulk_edit": 0, - "allow_in_quick_entry": 0, - "allow_on_submit": 0, - "bold": 0, - "collapsible": 0, - "columns": 0, - "fieldname": "deduct_tax_for_unsubmitted_tax_exemption_proof", - "fieldtype": "Check", - "hidden": 0, - "ignore_user_permissions": 0, - "ignore_xss_filter": 0, - "in_filter": 0, - "in_global_search": 0, - "in_list_view": 0, - "in_standard_filter": 0, - "label": "Deduct Tax For Unsubmitted Tax Exemption Proof", - "length": 0, - "no_copy": 0, - "permlevel": 0, - "precision": "", - "print_hide": 0, - "print_hide_if_no_value": 0, - "read_only": 0, - "remember_last_selected_value": 0, - "report_hide": 0, - "reqd": 0, - "search_index": 0, - "set_only_once": 0, - "translatable": 0, - "unique": 0 - }, - { - "allow_bulk_edit": 0, - "allow_in_quick_entry": 0, - "allow_on_submit": 0, - "bold": 0, - "collapsible": 0, - "columns": 0, - "fieldname": "earning_deduction", - "fieldtype": "Section Break", - "hidden": 0, - "ignore_user_permissions": 0, - "ignore_xss_filter": 0, - "in_filter": 0, - "in_global_search": 0, - "in_list_view": 0, - "in_standard_filter": 0, - "label": "Earning & Deduction", - "length": 0, - "no_copy": 0, - "oldfieldtype": "Section Break", - "permlevel": 0, - "print_hide": 0, - "print_hide_if_no_value": 0, - "read_only": 0, - "remember_last_selected_value": 0, - "report_hide": 0, - "reqd": 0, - "search_index": 0, - "set_only_once": 0, - "translatable": 0, - "unique": 0 - }, - { - "allow_bulk_edit": 0, - "allow_in_quick_entry": 0, - "allow_on_submit": 0, - "bold": 0, - "collapsible": 0, - "columns": 0, - "fieldname": "earning", - "fieldtype": "Column Break", - "hidden": 0, - "ignore_user_permissions": 0, - "ignore_xss_filter": 0, - "in_filter": 0, - "in_global_search": 0, - "in_list_view": 0, - "in_standard_filter": 0, - "label": "Earning", - "length": 0, - "no_copy": 0, - "oldfieldtype": "Column Break", - "permlevel": 0, - "print_hide": 0, - "print_hide_if_no_value": 0, - "read_only": 0, - "remember_last_selected_value": 0, - "report_hide": 0, - "reqd": 0, - "search_index": 0, - "set_only_once": 0, - "translatable": 0, - "unique": 0, + "allow_bulk_edit": 0, + "allow_in_quick_entry": 0, + "allow_on_submit": 0, + "bold": 0, + "collapsible": 0, + "columns": 0, + "fieldname": "earning", + "fieldtype": "Column Break", + "hidden": 0, + "ignore_user_permissions": 0, + "ignore_xss_filter": 0, + "in_filter": 0, + "in_global_search": 0, + "in_list_view": 0, + "in_standard_filter": 0, + "label": "Earning", + "length": 0, + "no_copy": 0, + "oldfieldtype": "Column Break", + "permlevel": 0, + "print_hide": 0, + "print_hide_if_no_value": 0, + "read_only": 0, + "remember_last_selected_value": 0, + "report_hide": 0, + "reqd": 0, + "search_index": 0, + "set_only_once": 0, + "translatable": 0, + "unique": 0, "width": "50%" - }, + }, { - "allow_bulk_edit": 0, - "allow_in_quick_entry": 0, - "allow_on_submit": 0, - "bold": 0, - "collapsible": 0, - "columns": 0, - "depends_on": "", - "fieldname": "earnings", - "fieldtype": "Table", - "hidden": 0, - "ignore_user_permissions": 0, - "ignore_xss_filter": 0, - "in_filter": 0, - "in_global_search": 0, - "in_list_view": 0, - "in_standard_filter": 0, - "label": "Earnings", - "length": 0, - "no_copy": 0, - "oldfieldname": "earning_details", - "oldfieldtype": "Table", - "options": "Salary Detail", - "permlevel": 0, - "print_hide": 0, - "print_hide_if_no_value": 0, - "read_only": 0, - "remember_last_selected_value": 0, - "report_hide": 0, - "reqd": 0, - "search_index": 0, - "set_only_once": 0, - "translatable": 0, + "allow_bulk_edit": 0, + "allow_in_quick_entry": 0, + "allow_on_submit": 0, + "bold": 0, + "collapsible": 0, + "columns": 0, + "depends_on": "", + "fieldname": "earnings", + "fieldtype": "Table", + "hidden": 0, + "ignore_user_permissions": 0, + "ignore_xss_filter": 0, + "in_filter": 0, + "in_global_search": 0, + "in_list_view": 0, + "in_standard_filter": 0, + "label": "Earnings", + "length": 0, + "no_copy": 0, + "oldfieldname": "earning_details", + "oldfieldtype": "Table", + "options": "Salary Detail", + "permlevel": 0, + "print_hide": 0, + "print_hide_if_no_value": 0, + "read_only": 0, + "remember_last_selected_value": 0, + "report_hide": 0, + "reqd": 0, + "search_index": 0, + "set_only_once": 0, + "translatable": 0, "unique": 0 - }, + }, { - "allow_bulk_edit": 0, - "allow_in_quick_entry": 0, - "allow_on_submit": 0, - "bold": 0, - "collapsible": 0, - "columns": 0, - "fieldname": "deduction", - "fieldtype": "Column Break", - "hidden": 0, - "ignore_user_permissions": 0, - "ignore_xss_filter": 0, - "in_filter": 0, - "in_global_search": 0, - "in_list_view": 0, - "in_standard_filter": 0, - "label": "Deduction", - "length": 0, - "no_copy": 0, - "oldfieldtype": "Column Break", - "permlevel": 0, - "print_hide": 0, - "print_hide_if_no_value": 0, - "read_only": 0, - "remember_last_selected_value": 0, - "report_hide": 0, - "reqd": 0, - "search_index": 0, - "set_only_once": 0, - "translatable": 0, - "unique": 0, + "allow_bulk_edit": 0, + "allow_in_quick_entry": 0, + "allow_on_submit": 0, + "bold": 0, + "collapsible": 0, + "columns": 0, + "fieldname": "deduction", + "fieldtype": "Column Break", + "hidden": 0, + "ignore_user_permissions": 0, + "ignore_xss_filter": 0, + "in_filter": 0, + "in_global_search": 0, + "in_list_view": 0, + "in_standard_filter": 0, + "label": "Deduction", + "length": 0, + "no_copy": 0, + "oldfieldtype": "Column Break", + "permlevel": 0, + "print_hide": 0, + "print_hide_if_no_value": 0, + "read_only": 0, + "remember_last_selected_value": 0, + "report_hide": 0, + "reqd": 0, + "search_index": 0, + "set_only_once": 0, + "translatable": 0, + "unique": 0, "width": "50%" - }, + }, { - "allow_bulk_edit": 0, - "allow_in_quick_entry": 0, - "allow_on_submit": 0, - "bold": 0, - "collapsible": 0, - "columns": 0, - "fieldname": "deductions", - "fieldtype": "Table", - "hidden": 0, - "ignore_user_permissions": 0, - "ignore_xss_filter": 0, - "in_filter": 0, - "in_global_search": 0, - "in_list_view": 0, - "in_standard_filter": 0, - "label": "Deductions", - "length": 0, - "no_copy": 0, - "oldfieldname": "deduction_details", - "oldfieldtype": "Table", - "options": "Salary Detail", - "permlevel": 0, - "print_hide": 0, - "print_hide_if_no_value": 0, - "read_only": 0, - "remember_last_selected_value": 0, - "report_hide": 0, - "reqd": 0, - "search_index": 0, - "set_only_once": 0, - "translatable": 0, + "allow_bulk_edit": 0, + "allow_in_quick_entry": 0, + "allow_on_submit": 0, + "bold": 0, + "collapsible": 0, + "columns": 0, + "fieldname": "deductions", + "fieldtype": "Table", + "hidden": 0, + "ignore_user_permissions": 0, + "ignore_xss_filter": 0, + "in_filter": 0, + "in_global_search": 0, + "in_list_view": 0, + "in_standard_filter": 0, + "label": "Deductions", + "length": 0, + "no_copy": 0, + "oldfieldname": "deduction_details", + "oldfieldtype": "Table", + "options": "Salary Detail", + "permlevel": 0, + "print_hide": 0, + "print_hide_if_no_value": 0, + "read_only": 0, + "remember_last_selected_value": 0, + "report_hide": 0, + "reqd": 0, + "search_index": 0, + "set_only_once": 0, + "translatable": 0, "unique": 0 - }, + }, { - "allow_bulk_edit": 0, - "allow_in_quick_entry": 0, - "allow_on_submit": 0, - "bold": 0, - "collapsible": 0, - "columns": 0, - "fieldname": "totals", - "fieldtype": "Section Break", - "hidden": 0, - "ignore_user_permissions": 0, - "ignore_xss_filter": 0, - "in_filter": 0, - "in_global_search": 0, - "in_list_view": 0, - "in_standard_filter": 0, - "label": "", - "length": 0, - "no_copy": 0, - "oldfieldtype": "Section Break", - "permlevel": 0, - "print_hide": 0, - "print_hide_if_no_value": 0, - "read_only": 0, - "remember_last_selected_value": 0, - "report_hide": 0, - "reqd": 0, - "search_index": 0, - "set_only_once": 0, - "translatable": 0, + "allow_bulk_edit": 0, + "allow_in_quick_entry": 0, + "allow_on_submit": 0, + "bold": 0, + "collapsible": 0, + "columns": 0, + "fieldname": "totals", + "fieldtype": "Section Break", + "hidden": 0, + "ignore_user_permissions": 0, + "ignore_xss_filter": 0, + "in_filter": 0, + "in_global_search": 0, + "in_list_view": 0, + "in_standard_filter": 0, + "label": "", + "length": 0, + "no_copy": 0, + "oldfieldtype": "Section Break", + "permlevel": 0, + "print_hide": 0, + "print_hide_if_no_value": 0, + "read_only": 0, + "remember_last_selected_value": 0, + "report_hide": 0, + "reqd": 0, + "search_index": 0, + "set_only_once": 0, + "translatable": 0, "unique": 0 - }, + }, { - "allow_bulk_edit": 0, - "allow_in_quick_entry": 0, - "allow_on_submit": 0, - "bold": 0, - "collapsible": 0, - "columns": 0, - "fieldname": "gross_pay", - "fieldtype": "Currency", - "hidden": 0, - "ignore_user_permissions": 0, - "ignore_xss_filter": 0, - "in_filter": 0, - "in_global_search": 0, - "in_list_view": 0, - "in_standard_filter": 0, - "label": "Gross Pay", - "length": 0, - "no_copy": 0, - "oldfieldname": "gross_pay", - "oldfieldtype": "Currency", - "options": "Company:company:default_currency", - "permlevel": 0, - "print_hide": 0, - "print_hide_if_no_value": 0, - "read_only": 1, - "remember_last_selected_value": 0, - "report_hide": 0, - "reqd": 0, - "search_index": 0, - "set_only_once": 0, - "translatable": 0, + "allow_bulk_edit": 0, + "allow_in_quick_entry": 0, + "allow_on_submit": 0, + "bold": 0, + "collapsible": 0, + "columns": 0, + "fieldname": "gross_pay", + "fieldtype": "Currency", + "hidden": 0, + "ignore_user_permissions": 0, + "ignore_xss_filter": 0, + "in_filter": 0, + "in_global_search": 0, + "in_list_view": 0, + "in_standard_filter": 0, + "label": "Gross Pay", + "length": 0, + "no_copy": 0, + "oldfieldname": "gross_pay", + "oldfieldtype": "Currency", + "options": "Company:company:default_currency", + "permlevel": 0, + "print_hide": 0, + "print_hide_if_no_value": 0, + "read_only": 1, + "remember_last_selected_value": 0, + "report_hide": 0, + "reqd": 0, + "search_index": 0, + "set_only_once": 0, + "translatable": 0, "unique": 0 - }, + }, { - "allow_bulk_edit": 0, - "allow_in_quick_entry": 0, - "allow_on_submit": 0, - "bold": 0, - "collapsible": 0, - "columns": 0, - "fieldname": "column_break_25", - "fieldtype": "Column Break", - "hidden": 0, - "ignore_user_permissions": 0, - "ignore_xss_filter": 0, - "in_filter": 0, - "in_global_search": 0, - "in_list_view": 0, - "in_standard_filter": 0, - "length": 0, - "no_copy": 0, - "permlevel": 0, - "print_hide": 0, - "print_hide_if_no_value": 0, - "read_only": 0, - "remember_last_selected_value": 0, - "report_hide": 0, - "reqd": 0, - "search_index": 0, - "set_only_once": 0, - "translatable": 0, + "allow_bulk_edit": 0, + "allow_in_quick_entry": 0, + "allow_on_submit": 0, + "bold": 0, + "collapsible": 0, + "columns": 0, + "fieldname": "column_break_25", + "fieldtype": "Column Break", + "hidden": 0, + "ignore_user_permissions": 0, + "ignore_xss_filter": 0, + "in_filter": 0, + "in_global_search": 0, + "in_list_view": 0, + "in_standard_filter": 0, + "length": 0, + "no_copy": 0, + "permlevel": 0, + "print_hide": 0, + "print_hide_if_no_value": 0, + "read_only": 0, + "remember_last_selected_value": 0, + "report_hide": 0, + "reqd": 0, + "search_index": 0, + "set_only_once": 0, + "translatable": 0, "unique": 0 - }, + }, { - "allow_bulk_edit": 0, - "allow_in_quick_entry": 0, - "allow_on_submit": 0, - "bold": 0, - "collapsible": 0, - "columns": 0, - "fieldname": "total_deduction", - "fieldtype": "Currency", - "hidden": 0, - "ignore_user_permissions": 0, - "ignore_xss_filter": 0, - "in_filter": 0, - "in_global_search": 0, - "in_list_view": 0, - "in_standard_filter": 0, - "label": "Total Deduction", - "length": 0, - "no_copy": 0, - "oldfieldname": "total_deduction", - "oldfieldtype": "Currency", - "options": "Company:company:default_currency", - "permlevel": 0, - "print_hide": 0, - "print_hide_if_no_value": 0, - "read_only": 1, - "remember_last_selected_value": 0, - "report_hide": 0, - "reqd": 0, - "search_index": 0, - "set_only_once": 0, - "translatable": 0, + "allow_bulk_edit": 0, + "allow_in_quick_entry": 0, + "allow_on_submit": 0, + "bold": 0, + "collapsible": 0, + "columns": 0, + "fieldname": "total_deduction", + "fieldtype": "Currency", + "hidden": 0, + "ignore_user_permissions": 0, + "ignore_xss_filter": 0, + "in_filter": 0, + "in_global_search": 0, + "in_list_view": 0, + "in_standard_filter": 0, + "label": "Total Deduction", + "length": 0, + "no_copy": 0, + "oldfieldname": "total_deduction", + "oldfieldtype": "Currency", + "options": "Company:company:default_currency", + "permlevel": 0, + "print_hide": 0, + "print_hide_if_no_value": 0, + "read_only": 1, + "remember_last_selected_value": 0, + "report_hide": 0, + "reqd": 0, + "search_index": 0, + "set_only_once": 0, + "translatable": 0, "unique": 0 - }, + }, { - "allow_bulk_edit": 0, - "allow_in_quick_entry": 0, - "allow_on_submit": 0, - "bold": 0, - "collapsible": 0, - "columns": 0, - "depends_on": "total_loan_repayment", - "fieldname": "loan_repayment", - "fieldtype": "Section Break", - "hidden": 0, - "ignore_user_permissions": 0, - "ignore_xss_filter": 0, - "in_filter": 0, - "in_global_search": 0, - "in_list_view": 0, - "in_standard_filter": 0, - "label": "Loan repayment", - "length": 0, - "no_copy": 0, - "permlevel": 0, - "precision": "", - "print_hide": 0, - "print_hide_if_no_value": 0, - "read_only": 0, - "remember_last_selected_value": 0, - "report_hide": 0, - "reqd": 0, - "search_index": 0, - "set_only_once": 0, - "translatable": 0, + "allow_bulk_edit": 0, + "allow_in_quick_entry": 0, + "allow_on_submit": 0, + "bold": 0, + "collapsible": 0, + "columns": 0, + "depends_on": "total_loan_repayment", + "fieldname": "loan_repayment", + "fieldtype": "Section Break", + "hidden": 0, + "ignore_user_permissions": 0, + "ignore_xss_filter": 0, + "in_filter": 0, + "in_global_search": 0, + "in_list_view": 0, + "in_standard_filter": 0, + "label": "Loan repayment", + "length": 0, + "no_copy": 0, + "permlevel": 0, + "precision": "", + "print_hide": 0, + "print_hide_if_no_value": 0, + "read_only": 0, + "remember_last_selected_value": 0, + "report_hide": 0, + "reqd": 0, + "search_index": 0, + "set_only_once": 0, + "translatable": 0, "unique": 0 - }, + }, { - "allow_bulk_edit": 0, - "allow_in_quick_entry": 0, - "allow_on_submit": 0, - "bold": 0, - "collapsible": 0, - "columns": 0, - "fieldname": "loans", - "fieldtype": "Table", - "hidden": 0, - "ignore_user_permissions": 0, - "ignore_xss_filter": 0, - "in_filter": 0, - "in_global_search": 0, - "in_list_view": 0, - "in_standard_filter": 0, - "label": "Employee Loan", - "length": 0, - "no_copy": 0, - "options": "Salary Slip Loan", - "permlevel": 0, - "precision": "", - "print_hide": 1, - "print_hide_if_no_value": 0, - "read_only": 1, - "remember_last_selected_value": 0, - "report_hide": 0, - "reqd": 0, - "search_index": 0, - "set_only_once": 0, - "translatable": 0, + "allow_bulk_edit": 0, + "allow_in_quick_entry": 0, + "allow_on_submit": 0, + "bold": 0, + "collapsible": 0, + "columns": 0, + "fieldname": "loans", + "fieldtype": "Table", + "hidden": 0, + "ignore_user_permissions": 0, + "ignore_xss_filter": 0, + "in_filter": 0, + "in_global_search": 0, + "in_list_view": 0, + "in_standard_filter": 0, + "label": "Employee Loan", + "length": 0, + "no_copy": 0, + "options": "Salary Slip Loan", + "permlevel": 0, + "precision": "", + "print_hide": 1, + "print_hide_if_no_value": 0, + "read_only": 1, + "remember_last_selected_value": 0, + "report_hide": 0, + "reqd": 0, + "search_index": 0, + "set_only_once": 0, + "translatable": 0, "unique": 0 - }, + }, { - "allow_bulk_edit": 0, - "allow_in_quick_entry": 0, - "allow_on_submit": 0, - "bold": 0, - "collapsible": 0, - "columns": 0, - "fieldname": "section_break_43", - "fieldtype": "Section Break", - "hidden": 0, - "ignore_user_permissions": 0, - "ignore_xss_filter": 0, - "in_filter": 0, - "in_global_search": 0, - "in_list_view": 0, - "in_standard_filter": 0, - "length": 0, - "no_copy": 0, - "permlevel": 0, - "precision": "", - "print_hide": 0, - "print_hide_if_no_value": 0, - "read_only": 0, - "remember_last_selected_value": 0, - "report_hide": 0, - "reqd": 0, - "search_index": 0, - "set_only_once": 0, - "translatable": 0, + "allow_bulk_edit": 0, + "allow_in_quick_entry": 0, + "allow_on_submit": 0, + "bold": 0, + "collapsible": 0, + "columns": 0, + "fieldname": "section_break_43", + "fieldtype": "Section Break", + "hidden": 0, + "ignore_user_permissions": 0, + "ignore_xss_filter": 0, + "in_filter": 0, + "in_global_search": 0, + "in_list_view": 0, + "in_standard_filter": 0, + "length": 0, + "no_copy": 0, + "permlevel": 0, + "precision": "", + "print_hide": 0, + "print_hide_if_no_value": 0, + "read_only": 0, + "remember_last_selected_value": 0, + "report_hide": 0, + "reqd": 0, + "search_index": 0, + "set_only_once": 0, + "translatable": 0, "unique": 0 - }, + }, { - "allow_bulk_edit": 0, - "allow_in_quick_entry": 0, - "allow_on_submit": 0, - "bold": 0, - "collapsible": 0, - "columns": 0, - "default": "0", - "fieldname": "total_principal_amount", - "fieldtype": "Currency", - "hidden": 0, - "ignore_user_permissions": 0, - "ignore_xss_filter": 0, - "in_filter": 0, - "in_global_search": 0, - "in_list_view": 0, - "in_standard_filter": 0, - "label": "Total Principal Amount", - "length": 0, - "no_copy": 0, - "options": "Company:company:default_currency", - "permlevel": 0, - "precision": "", - "print_hide": 0, - "print_hide_if_no_value": 0, - "read_only": 1, - "remember_last_selected_value": 0, - "report_hide": 0, - "reqd": 0, - "search_index": 0, - "set_only_once": 0, - "translatable": 0, + "allow_bulk_edit": 0, + "allow_in_quick_entry": 0, + "allow_on_submit": 0, + "bold": 0, + "collapsible": 0, + "columns": 0, + "default": "0", + "fieldname": "total_principal_amount", + "fieldtype": "Currency", + "hidden": 0, + "ignore_user_permissions": 0, + "ignore_xss_filter": 0, + "in_filter": 0, + "in_global_search": 0, + "in_list_view": 0, + "in_standard_filter": 0, + "label": "Total Principal Amount", + "length": 0, + "no_copy": 0, + "options": "Company:company:default_currency", + "permlevel": 0, + "precision": "", + "print_hide": 0, + "print_hide_if_no_value": 0, + "read_only": 1, + "remember_last_selected_value": 0, + "report_hide": 0, + "reqd": 0, + "search_index": 0, + "set_only_once": 0, + "translatable": 0, "unique": 0 - }, + }, { - "allow_bulk_edit": 0, - "allow_in_quick_entry": 0, - "allow_on_submit": 0, - "bold": 0, - "collapsible": 0, - "columns": 0, - "default": "0", - "fieldname": "total_interest_amount", - "fieldtype": "Currency", - "hidden": 0, - "ignore_user_permissions": 0, - "ignore_xss_filter": 0, - "in_filter": 0, - "in_global_search": 0, - "in_list_view": 0, - "in_standard_filter": 0, - "label": "Total Interest Amount", - "length": 0, - "no_copy": 0, - "options": "Company:company:default_currency", - "permlevel": 0, - "precision": "", - "print_hide": 0, - "print_hide_if_no_value": 0, - "read_only": 1, - "remember_last_selected_value": 0, - "report_hide": 0, - "reqd": 0, - "search_index": 0, - "set_only_once": 0, - "translatable": 0, + "allow_bulk_edit": 0, + "allow_in_quick_entry": 0, + "allow_on_submit": 0, + "bold": 0, + "collapsible": 0, + "columns": 0, + "default": "0", + "fieldname": "total_interest_amount", + "fieldtype": "Currency", + "hidden": 0, + "ignore_user_permissions": 0, + "ignore_xss_filter": 0, + "in_filter": 0, + "in_global_search": 0, + "in_list_view": 0, + "in_standard_filter": 0, + "label": "Total Interest Amount", + "length": 0, + "no_copy": 0, + "options": "Company:company:default_currency", + "permlevel": 0, + "precision": "", + "print_hide": 0, + "print_hide_if_no_value": 0, + "read_only": 1, + "remember_last_selected_value": 0, + "report_hide": 0, + "reqd": 0, + "search_index": 0, + "set_only_once": 0, + "translatable": 0, "unique": 0 - }, + }, { - "allow_bulk_edit": 0, - "allow_in_quick_entry": 0, - "allow_on_submit": 0, - "bold": 0, - "collapsible": 0, - "columns": 0, - "fieldname": "column_break_45", - "fieldtype": "Column Break", - "hidden": 0, - "ignore_user_permissions": 0, - "ignore_xss_filter": 0, - "in_filter": 0, - "in_global_search": 0, - "in_list_view": 0, - "in_standard_filter": 0, - "length": 0, - "no_copy": 0, - "permlevel": 0, - "precision": "", - "print_hide": 0, - "print_hide_if_no_value": 0, - "read_only": 0, - "remember_last_selected_value": 0, - "report_hide": 0, - "reqd": 0, - "search_index": 0, - "set_only_once": 0, - "translatable": 0, + "allow_bulk_edit": 0, + "allow_in_quick_entry": 0, + "allow_on_submit": 0, + "bold": 0, + "collapsible": 0, + "columns": 0, + "fieldname": "column_break_45", + "fieldtype": "Column Break", + "hidden": 0, + "ignore_user_permissions": 0, + "ignore_xss_filter": 0, + "in_filter": 0, + "in_global_search": 0, + "in_list_view": 0, + "in_standard_filter": 0, + "length": 0, + "no_copy": 0, + "permlevel": 0, + "precision": "", + "print_hide": 0, + "print_hide_if_no_value": 0, + "read_only": 0, + "remember_last_selected_value": 0, + "report_hide": 0, + "reqd": 0, + "search_index": 0, + "set_only_once": 0, + "translatable": 0, "unique": 0 - }, + }, { - "allow_bulk_edit": 0, - "allow_in_quick_entry": 0, - "allow_on_submit": 0, - "bold": 0, - "collapsible": 0, - "columns": 0, - "default": "0", - "fieldname": "total_loan_repayment", - "fieldtype": "Currency", - "hidden": 0, - "ignore_user_permissions": 0, - "ignore_xss_filter": 0, - "in_filter": 0, - "in_global_search": 0, - "in_list_view": 0, - "in_standard_filter": 0, - "label": "Total Loan Repayment", - "length": 0, - "no_copy": 0, - "options": "Company:company:default_currency", - "permlevel": 0, - "precision": "", - "print_hide": 0, - "print_hide_if_no_value": 0, - "read_only": 1, - "remember_last_selected_value": 0, - "report_hide": 0, - "reqd": 0, - "search_index": 0, - "set_only_once": 0, - "translatable": 0, + "allow_bulk_edit": 0, + "allow_in_quick_entry": 0, + "allow_on_submit": 0, + "bold": 0, + "collapsible": 0, + "columns": 0, + "default": "0", + "fieldname": "total_loan_repayment", + "fieldtype": "Currency", + "hidden": 0, + "ignore_user_permissions": 0, + "ignore_xss_filter": 0, + "in_filter": 0, + "in_global_search": 0, + "in_list_view": 0, + "in_standard_filter": 0, + "label": "Total Loan Repayment", + "length": 0, + "no_copy": 0, + "options": "Company:company:default_currency", + "permlevel": 0, + "precision": "", + "print_hide": 0, + "print_hide_if_no_value": 0, + "read_only": 1, + "remember_last_selected_value": 0, + "report_hide": 0, + "reqd": 0, + "search_index": 0, + "set_only_once": 0, + "translatable": 0, "unique": 0 - }, + }, { - "allow_bulk_edit": 0, - "allow_in_quick_entry": 0, - "allow_on_submit": 0, - "bold": 0, - "collapsible": 0, - "columns": 0, - "fieldname": "net_pay_info", - "fieldtype": "Section Break", - "hidden": 0, - "ignore_user_permissions": 0, - "ignore_xss_filter": 0, - "in_filter": 0, - "in_global_search": 0, - "in_list_view": 0, - "in_standard_filter": 0, - "label": "net pay info", - "length": 0, - "no_copy": 0, - "permlevel": 0, - "precision": "", - "print_hide": 0, - "print_hide_if_no_value": 0, - "read_only": 0, - "remember_last_selected_value": 0, - "report_hide": 0, - "reqd": 0, - "search_index": 0, - "set_only_once": 0, - "translatable": 0, + "allow_bulk_edit": 0, + "allow_in_quick_entry": 0, + "allow_on_submit": 0, + "bold": 0, + "collapsible": 0, + "columns": 0, + "fieldname": "net_pay_info", + "fieldtype": "Section Break", + "hidden": 0, + "ignore_user_permissions": 0, + "ignore_xss_filter": 0, + "in_filter": 0, + "in_global_search": 0, + "in_list_view": 0, + "in_standard_filter": 0, + "label": "net pay info", + "length": 0, + "no_copy": 0, + "permlevel": 0, + "precision": "", + "print_hide": 0, + "print_hide_if_no_value": 0, + "read_only": 0, + "remember_last_selected_value": 0, + "report_hide": 0, + "reqd": 0, + "search_index": 0, + "set_only_once": 0, + "translatable": 0, "unique": 0 - }, + }, { - "allow_bulk_edit": 0, - "allow_in_quick_entry": 0, - "allow_on_submit": 0, - "bold": 0, - "collapsible": 0, - "columns": 0, - "description": "Gross Pay - Total Deduction - Loan Repayment", - "fieldname": "net_pay", - "fieldtype": "Currency", - "hidden": 0, - "ignore_user_permissions": 0, - "ignore_xss_filter": 0, - "in_filter": 0, - "in_global_search": 0, - "in_list_view": 0, - "in_standard_filter": 0, - "label": "Net Pay", - "length": 0, - "no_copy": 0, - "oldfieldname": "net_pay", - "oldfieldtype": "Currency", - "options": "Company:company:default_currency", - "permlevel": 0, - "print_hide": 0, - "print_hide_if_no_value": 0, - "read_only": 1, - "remember_last_selected_value": 0, - "report_hide": 0, - "reqd": 0, - "search_index": 0, - "set_only_once": 0, - "translatable": 0, + "allow_bulk_edit": 0, + "allow_in_quick_entry": 0, + "allow_on_submit": 0, + "bold": 0, + "collapsible": 0, + "columns": 0, + "description": "Gross Pay - Total Deduction - Loan Repayment", + "fieldname": "net_pay", + "fieldtype": "Currency", + "hidden": 0, + "ignore_user_permissions": 0, + "ignore_xss_filter": 0, + "in_filter": 0, + "in_global_search": 0, + "in_list_view": 0, + "in_standard_filter": 0, + "label": "Net Pay", + "length": 0, + "no_copy": 0, + "oldfieldname": "net_pay", + "oldfieldtype": "Currency", + "options": "Company:company:default_currency", + "permlevel": 0, + "print_hide": 0, + "print_hide_if_no_value": 0, + "read_only": 1, + "remember_last_selected_value": 0, + "report_hide": 0, + "reqd": 0, + "search_index": 0, + "set_only_once": 0, + "translatable": 0, "unique": 0 - }, + }, { - "allow_bulk_edit": 0, - "allow_in_quick_entry": 0, - "allow_on_submit": 0, - "bold": 0, - "collapsible": 0, - "columns": 0, - "fieldname": "column_break_53", - "fieldtype": "Column Break", - "hidden": 0, - "ignore_user_permissions": 0, - "ignore_xss_filter": 0, - "in_filter": 0, - "in_global_search": 0, - "in_list_view": 0, - "in_standard_filter": 0, - "length": 0, - "no_copy": 0, - "permlevel": 0, - "precision": "", - "print_hide": 0, - "print_hide_if_no_value": 0, - "read_only": 0, - "remember_last_selected_value": 0, - "report_hide": 0, - "reqd": 0, - "search_index": 0, - "set_only_once": 0, - "translatable": 0, + "allow_bulk_edit": 0, + "allow_in_quick_entry": 0, + "allow_on_submit": 0, + "bold": 0, + "collapsible": 0, + "columns": 0, + "fieldname": "column_break_53", + "fieldtype": "Column Break", + "hidden": 0, + "ignore_user_permissions": 0, + "ignore_xss_filter": 0, + "in_filter": 0, + "in_global_search": 0, + "in_list_view": 0, + "in_standard_filter": 0, + "length": 0, + "no_copy": 0, + "permlevel": 0, + "precision": "", + "print_hide": 0, + "print_hide_if_no_value": 0, + "read_only": 0, + "remember_last_selected_value": 0, + "report_hide": 0, + "reqd": 0, + "search_index": 0, + "set_only_once": 0, + "translatable": 0, "unique": 0 - }, + }, { - "allow_bulk_edit": 0, - "allow_in_quick_entry": 0, - "allow_on_submit": 0, - "bold": 1, - "collapsible": 0, - "columns": 0, - "fieldname": "rounded_total", - "fieldtype": "Currency", - "hidden": 0, - "ignore_user_permissions": 0, - "ignore_xss_filter": 0, - "in_filter": 0, - "in_global_search": 0, - "in_list_view": 0, - "in_standard_filter": 0, - "label": "Rounded Total", - "length": 0, - "no_copy": 0, - "options": "Company:company:default_currency", - "permlevel": 0, - "print_hide": 0, - "print_hide_if_no_value": 0, - "read_only": 1, - "remember_last_selected_value": 0, - "report_hide": 0, - "reqd": 0, - "search_index": 0, - "set_only_once": 0, - "translatable": 0, + "allow_bulk_edit": 0, + "allow_in_quick_entry": 0, + "allow_on_submit": 0, + "bold": 1, + "collapsible": 0, + "columns": 0, + "fieldname": "rounded_total", + "fieldtype": "Currency", + "hidden": 0, + "ignore_user_permissions": 0, + "ignore_xss_filter": 0, + "in_filter": 0, + "in_global_search": 0, + "in_list_view": 0, + "in_standard_filter": 0, + "label": "Rounded Total", + "length": 0, + "no_copy": 0, + "options": "Company:company:default_currency", + "permlevel": 0, + "print_hide": 0, + "print_hide_if_no_value": 0, + "read_only": 1, + "remember_last_selected_value": 0, + "report_hide": 0, + "reqd": 0, + "search_index": 0, + "set_only_once": 0, + "translatable": 0, "unique": 0 - }, + }, { - "allow_bulk_edit": 0, - "allow_in_quick_entry": 0, - "allow_on_submit": 0, - "bold": 0, - "collapsible": 0, - "columns": 0, - "fieldname": "section_break_55", - "fieldtype": "Section Break", - "hidden": 0, - "ignore_user_permissions": 0, - "ignore_xss_filter": 0, - "in_filter": 0, - "in_global_search": 0, - "in_list_view": 0, - "in_standard_filter": 0, - "length": 0, - "no_copy": 0, - "permlevel": 0, - "precision": "", - "print_hide": 0, - "print_hide_if_no_value": 0, - "read_only": 0, - "remember_last_selected_value": 0, - "report_hide": 0, - "reqd": 0, - "search_index": 0, - "set_only_once": 0, - "translatable": 0, + "allow_bulk_edit": 0, + "allow_in_quick_entry": 0, + "allow_on_submit": 0, + "bold": 0, + "collapsible": 0, + "columns": 0, + "fieldname": "section_break_55", + "fieldtype": "Section Break", + "hidden": 0, + "ignore_user_permissions": 0, + "ignore_xss_filter": 0, + "in_filter": 0, + "in_global_search": 0, + "in_list_view": 0, + "in_standard_filter": 0, + "length": 0, + "no_copy": 0, + "permlevel": 0, + "precision": "", + "print_hide": 0, + "print_hide_if_no_value": 0, + "read_only": 0, + "remember_last_selected_value": 0, + "report_hide": 0, + "reqd": 0, + "search_index": 0, + "set_only_once": 0, + "translatable": 0, "unique": 0 - }, + }, { - "allow_bulk_edit": 0, - "allow_in_quick_entry": 0, - "allow_on_submit": 0, - "bold": 0, - "collapsible": 0, - "columns": 0, - "description": "Net Pay (in words) will be visible once you save the Salary Slip.", - "fieldname": "total_in_words", - "fieldtype": "Data", - "hidden": 0, - "ignore_user_permissions": 0, - "ignore_xss_filter": 0, - "in_filter": 0, - "in_global_search": 0, - "in_list_view": 0, - "in_standard_filter": 0, - "label": "Total in words", - "length": 0, - "no_copy": 0, - "oldfieldname": "net_pay_in_words", - "oldfieldtype": "Data", - "permlevel": 0, - "print_hide": 0, - "print_hide_if_no_value": 0, - "read_only": 1, - "remember_last_selected_value": 0, - "report_hide": 0, - "reqd": 0, - "search_index": 0, - "set_only_once": 0, - "translatable": 0, + "allow_bulk_edit": 0, + "allow_in_quick_entry": 0, + "allow_on_submit": 0, + "bold": 0, + "collapsible": 0, + "columns": 0, + "description": "Net Pay (in words) will be visible once you save the Salary Slip.", + "fieldname": "total_in_words", + "fieldtype": "Data", + "hidden": 0, + "ignore_user_permissions": 0, + "ignore_xss_filter": 0, + "in_filter": 0, + "in_global_search": 0, + "in_list_view": 0, + "in_standard_filter": 0, + "label": "Total in words", + "length": 0, + "no_copy": 0, + "oldfieldname": "net_pay_in_words", + "oldfieldtype": "Data", + "permlevel": 0, + "print_hide": 0, + "print_hide_if_no_value": 0, + "read_only": 1, + "remember_last_selected_value": 0, + "report_hide": 0, + "reqd": 0, + "search_index": 0, + "set_only_once": 0, + "translatable": 0, + "unique": 0 + }, + { + "allow_bulk_edit": 0, + "allow_in_quick_entry": 0, + "allow_on_submit": 0, + "bold": 0, + "collapsible": 0, + "columns": 0, + "fetch_if_empty": 0, + "fieldname": "amended_from", + "fieldtype": "Link", + "hidden": 0, + "ignore_user_permissions": 1, + "ignore_xss_filter": 0, + "in_filter": 0, + "in_global_search": 0, + "in_list_view": 0, + "in_standard_filter": 0, + "label": "Amended From", + "length": 0, + "no_copy": 1, + "oldfieldname": "amended_from", + "oldfieldtype": "Data", + "options": "Salary Slip", + "permlevel": 0, + "print_hide": 1, + "print_hide_if_no_value": 0, + "read_only": 1, + "remember_last_selected_value": 0, + "report_hide": 0, + "reqd": 0, + "search_index": 0, + "set_only_once": 0, + "translatable": 0, "unique": 0 } - ], - "has_web_view": 0, - "hide_heading": 0, - "hide_toolbar": 0, - "icon": "fa fa-file-text", - "idx": 9, - "image_view": 0, - "in_create": 0, - "is_submittable": 1, - "issingle": 0, - "istable": 0, - "max_attachments": 0, - "modified": "2019-02-18 18:54:36.161027", - "modified_by": "Administrator", - "module": "HR", - "name": "Salary Slip", - "owner": "Administrator", + ], + "has_web_view": 0, + "hide_heading": 0, + "hide_toolbar": 0, + "icon": "fa fa-file-text", + "idx": 9, + "image_view": 0, + "in_create": 0, + "is_submittable": 1, + "issingle": 0, + "istable": 0, + "max_attachments": 0, + "modified": "2019-05-13 13:10:14.524119", + "modified_by": "Administrator", + "module": "HR", + "name": "Salary Slip", + "owner": "Administrator", "permissions": [ { - "amend": 0, - "cancel": 0, - "create": 1, - "delete": 0, - "email": 1, - "export": 0, - "if_owner": 0, - "import": 0, - "permlevel": 0, - "print": 1, - "read": 1, - "report": 1, - "role": "HR User", - "set_user_permissions": 0, - "share": 1, - "submit": 1, + "amend": 0, + "cancel": 0, + "create": 1, + "delete": 0, + "email": 1, + "export": 0, + "if_owner": 0, + "import": 0, + "permlevel": 0, + "print": 1, + "read": 1, + "report": 1, + "role": "HR User", + "set_user_permissions": 0, + "share": 1, + "submit": 1, "write": 1 - }, + }, { - "amend": 1, - "cancel": 1, - "create": 1, - "delete": 1, - "email": 1, - "export": 0, - "if_owner": 0, - "import": 0, - "permlevel": 0, - "print": 1, - "read": 1, - "report": 1, - "role": "HR Manager", - "set_user_permissions": 0, - "share": 1, - "submit": 1, + "amend": 1, + "cancel": 1, + "create": 1, + "delete": 1, + "email": 1, + "export": 0, + "if_owner": 0, + "import": 0, + "permlevel": 0, + "print": 1, + "read": 1, + "report": 1, + "role": "HR Manager", + "set_user_permissions": 0, + "share": 1, + "submit": 1, "write": 1 - }, + }, { - "amend": 0, - "cancel": 0, - "create": 0, - "delete": 0, - "email": 0, - "export": 0, - "if_owner": 0, - "import": 0, - "permlevel": 0, - "print": 0, - "read": 1, - "report": 0, - "role": "Employee", - "set_user_permissions": 0, - "share": 0, - "submit": 0, + "amend": 0, + "cancel": 0, + "create": 0, + "delete": 0, + "email": 0, + "export": 0, + "if_owner": 0, + "import": 0, + "permlevel": 0, + "print": 0, + "read": 1, + "report": 0, + "role": "Employee", + "set_user_permissions": 0, + "share": 0, + "submit": 0, "write": 0 } - ], - "quick_entry": 0, - "read_only": 0, - "read_only_onload": 0, - "show_name_in_global_search": 1, - "sort_field": "modified", - "sort_order": "DESC", - "timeline_field": "employee", - "title_field": "employee_name", - "track_changes": 0, - "track_seen": 0, + ], + "quick_entry": 0, + "read_only": 0, + "read_only_onload": 0, + "show_name_in_global_search": 1, + "sort_field": "modified", + "sort_order": "DESC", + "timeline_field": "employee", + "title_field": "employee_name", + "track_changes": 0, + "track_seen": 0, "track_views": 0 } \ No newline at end of file diff --git a/erpnext/hr/doctype/salary_slip/salary_slip.py b/erpnext/hr/doctype/salary_slip/salary_slip.py index 5f6ddfc8fc..125a8ae27c 100644 --- a/erpnext/hr/doctype/salary_slip/salary_slip.py +++ b/erpnext/hr/doctype/salary_slip/salary_slip.py @@ -3,7 +3,7 @@ from __future__ import unicode_literals import frappe, erpnext -import datetime +import datetime, math from frappe.utils import add_days, cint, cstr, flt, getdate, rounded, date_diff, money_in_words, getdate from frappe.model.naming import make_autoname @@ -14,7 +14,7 @@ from erpnext.hr.doctype.employee.employee import get_holiday_list_for_employee from erpnext.utilities.transaction_base import TransactionBase from frappe.utils.background_jobs import enqueue from erpnext.hr.doctype.additional_salary.additional_salary import get_additional_salary_component -from erpnext.hr.utils import get_payroll_period +from erpnext.hr.doctype.payroll_period.payroll_period import get_period_factor, get_payroll_period from erpnext.hr.doctype.employee_benefit_application.employee_benefit_application import get_benefit_component_amount from erpnext.hr.doctype.employee_benefit_claim.employee_benefit_claim import get_benefit_claim_amount, get_last_payroll_period_benefits @@ -47,7 +47,6 @@ class SalarySlip(TransactionBase): else: self.get_leave_details(lwp = self.leave_without_pay) - # if self.salary_slip_based_on_timesheet or not self.net_pay: self.calculate_net_pay() company_currency = erpnext.get_company_currency(self.company) @@ -59,148 +58,57 @@ class SalarySlip(TransactionBase): frappe.msgprint(_("Total working hours should not be greater than max working hours {0}"). format(max_working_hours), alert=True) + def on_submit(self): + if self.net_pay < 0: + frappe.throw(_("Net Pay cannot be less than 0")) + else: + self.set_status() + self.update_status(self.name) + self.update_salary_slip_in_additional_salary() + if (frappe.db.get_single_value("HR Settings", "email_salary_slip_to_employee")) and not frappe.flags.via_payroll_entry: + self.email_salary_slip() + + def on_cancel(self): + self.set_status() + self.update_status() + self.update_salary_slip_in_additional_salary() + + def on_trash(self): + from frappe.model.naming import revert_series_if_last + revert_series_if_last(self.series, self.name) + + def get_status(self): + if self.docstatus == 0: + status = "Draft" + elif self.docstatus == 1: + status = "Submitted" + elif self.docstatus == 2: + status = "Cancelled" + return status + def validate_dates(self): if date_diff(self.end_date, self.start_date) < 0: frappe.throw(_("To date cannot be before From date")) - def calculate_component_amounts(self): - if not getattr(self, '_salary_structure_doc', None): - self._salary_structure_doc = frappe.get_doc('Salary Structure', self.salary_structure) - - data = self.get_data_for_eval() - - for key in ('earnings', 'deductions'): - for struct_row in self._salary_structure_doc.get(key): - amount = self.eval_condition_and_formula(struct_row, data) - if amount and struct_row.statistical_component == 0: - self.update_component_row(struct_row, amount, key) - - if key=="earnings" and struct_row.is_flexible_benefit == 1: - self.add_employee_flexi_benefits(struct_row) - - additional_components = get_additional_salary_component(self.employee, self.start_date, self.end_date) - if additional_components: - for additional_component in additional_components: - additional_component = frappe._dict(additional_component) - amount = additional_component.amount - overwrite = additional_component.overwrite - key = "earnings" - if additional_component.type == "Deduction": - key = "deductions" - self.update_component_row(frappe._dict(additional_component.struct_row), amount, key, overwrite=overwrite) - - self.get_last_payroll_period_benefit() - - # Calculate variable_based_on_taxable_salary after all components updated in salary slip - for struct_row in self._salary_structure_doc.get("deductions"): - if struct_row.variable_based_on_taxable_salary == 1 and not struct_row.formula and not struct_row.amount: - tax_detail = self.calculate_variable_based_on_taxable_salary(struct_row.salary_component) - if tax_detail and tax_detail[1]: - self.update_component_row(frappe._dict(tax_detail[0]), tax_detail[1], "deductions", tax_detail[2], tax_detail[3]) - - def get_last_payroll_period_benefit(self): - payroll_period = get_payroll_period(self.start_date, self.end_date, self.company) - if payroll_period: - # Check for last payroll period - if (getdate(payroll_period.end_date) <= getdate(self.end_date)): - current_flexi_amount = 0 - for d in self.get("earnings"): - if d.is_flexible_benefit == 1: - current_flexi_amount += d.amount - last_benefits = get_last_payroll_period_benefits(self.employee, self.start_date, self.end_date, - current_flexi_amount, payroll_period, self._salary_structure_doc) - if last_benefits: - for last_benefit in last_benefits: - last_benefit = frappe._dict(last_benefit) - amount = last_benefit.amount - self.update_component_row(frappe._dict(last_benefit.struct_row), amount, "earnings") - - def add_employee_flexi_benefits(self, struct_row): - if frappe.db.get_value("Salary Component", struct_row.salary_component, "pay_against_benefit_claim") != 1: - benefit_component_amount = get_benefit_component_amount(self.employee, self.start_date, self.end_date, \ - struct_row, self._salary_structure_doc, self.total_working_days, self.payroll_frequency) - if benefit_component_amount: - self.update_component_row(struct_row, benefit_component_amount, "earnings") + def check_existing(self): + if not self.salary_slip_based_on_timesheet: + ret_exist = frappe.db.sql("""select name from `tabSalary Slip` + where start_date = %s and end_date = %s and docstatus != 2 + and employee = %s and name != %s""", + (self.start_date, self.end_date, self.employee, self.name)) + if ret_exist: + self.employee = '' + frappe.throw(_("Salary Slip of employee {0} already created for this period").format(self.employee)) else: - benefit_claim_amount = get_benefit_claim_amount(self.employee, self.start_date, self.end_date, struct_row.salary_component) - if benefit_claim_amount: - self.update_component_row(struct_row, benefit_claim_amount, "earnings") + for data in self.timesheets: + if frappe.db.get_value('Timesheet', data.time_sheet, 'status') == 'Payrolled': + frappe.throw(_("Salary Slip of employee {0} already created for time sheet {1}").format(self.employee, data.time_sheet)) - def update_component_row(self, struct_row, amount, key, benefit_tax=None, additional_tax=None, overwrite=1): - component_row = None - for d in self.get(key): - if d.salary_component == struct_row.salary_component: - component_row = d - - if not component_row: - self.append(key, { - 'amount': amount, - 'default_amount': amount, - 'depends_on_payment_days' : struct_row.depends_on_payment_days, - 'salary_component' : struct_row.salary_component, - 'abbr' : struct_row.abbr, - 'do_not_include_in_total' : struct_row.do_not_include_in_total, - 'is_tax_applicable': struct_row.is_tax_applicable, - 'is_flexible_benefit': struct_row.is_flexible_benefit, - 'variable_based_on_taxable_salary': struct_row.variable_based_on_taxable_salary, - 'is_additional_component': struct_row.is_additional_component, - 'tax_on_flexible_benefit': benefit_tax, - 'tax_on_additional_salary': additional_tax - }) - else: - if not overwrite: - amount += struct_row.get("default_amount", 0) - - component_row.default_amount = amount - component_row.amount = amount - - component_row.tax_on_flexible_benefit = benefit_tax - component_row.tax_on_additional_salary = additional_tax - - def eval_condition_and_formula(self, d, data): - try: - condition = d.condition.strip() if d.condition else None - if condition: - if not frappe.safe_eval(condition, self.whitelisted_globals, data): - return None - amount = d.amount - if d.amount_based_on_formula: - formula = d.formula.strip() if d.formula else None - if formula: - amount = rounded(frappe.safe_eval(formula, self.whitelisted_globals, data)) - if amount: - data[d.abbr] = amount - - return amount - - except NameError as err: - frappe.throw(_("Name error: {0}".format(err))) - except SyntaxError as err: - frappe.throw(_("Syntax error in formula or condition: {0}".format(err))) - except Exception as e: - frappe.throw(_("Error in formula or condition: {0}".format(e))) - raise - - def get_data_for_eval(self): - '''Returns data for evaluating formula''' - data = frappe._dict() - - data.update(frappe.get_doc("Salary Structure Assignment", - {"employee": self.employee, "salary_structure": self.salary_structure}).as_dict()) - - data.update(frappe.get_doc("Employee", self.employee).as_dict()) - data.update(self.as_dict()) - - # set values for components - salary_components = frappe.get_all("Salary Component", fields=["salary_component_abbr"]) - for sc in salary_components: - data.setdefault(sc.salary_component_abbr, 0) - - for key in ('earnings', 'deductions'): - for d in self.get(key): - data[d.abbr] = d.amount - - return data + def get_date_details(self): + if not self.end_date: + date_details = get_start_end_dates(self.payroll_frequency, self.start_date or self.posting_date) + self.start_date = date_details.start_date + self.end_date = date_details.end_date def get_emp_and_leave_details(self): '''First time, load all the components from salary structure''' @@ -235,12 +143,6 @@ class SalarySlip(TransactionBase): 'working_hours': data.total_hours }) - def get_date_details(self): - if not self.end_date: - date_details = get_start_end_dates(self.payroll_frequency, self.start_date or self.posting_date) - self.start_date = date_details.start_date - self.end_date = date_details.end_date - def check_sal_struct(self, joining_date, relieving_date): cond = """and sa.employee=%(employee)s and (sa.from_date <= %(start_date)s or sa.from_date <= %(end_date)s or sa.from_date <= %(joining_date)s)""" @@ -279,43 +181,18 @@ class SalarySlip(TransactionBase): make_salary_slip(self._salary_structure_doc.name, self) - def process_salary_structure(self): - '''Calculate salary after salary structure details have been updated''' - if not self.salary_slip_based_on_timesheet: - self.get_date_details() - self.pull_emp_details() - self.get_leave_details() - self.calculate_net_pay() - - def add_earning_for_hourly_wages(self, doc, salary_component, amount): - row_exists = False - for row in doc.earnings: - if row.salary_component == salary_component: - row.amount = amount - row_exists = True - break - - if not row_exists: - wages_row = { - "salary_component": salary_component, - "abbr": frappe.db.get_value("Salary Component", salary_component, "salary_component_abbr"), - "amount": self.hour_rate * self.total_working_hours - } - doc.append('earnings', wages_row) - - def pull_emp_details(self): - emp = frappe.db.get_value("Employee", self.employee, ["bank_name", "bank_ac_no"], as_dict=1) - if emp: - self.bank_name = emp.bank_name - self.bank_account_no = emp.bank_ac_no - - def get_leave_details(self, joining_date=None, relieving_date=None, lwp=None): + def get_leave_details(self, joining_date=None, relieving_date=None, lwp=None, for_preview=0): if not joining_date: joining_date, relieving_date = frappe.db.get_value("Employee", self.employee, ["date_of_joining", "relieving_date"]) - holidays = self.get_holidays_for_employee(self.start_date, self.end_date) working_days = date_diff(self.end_date, self.start_date) + 1 + if for_preview: + self.total_working_days = working_days + self.payment_days = working_days + return + + holidays = self.get_holidays_for_employee(self.start_date, self.end_date) actual_lwp = self.calculate_lwp(holidays, working_days) if not cint(frappe.db.get_value("HR Settings", None, "include_holidays_in_total_working_days")): working_days -= len(holidays) @@ -392,21 +269,425 @@ class SalarySlip(TransactionBase): lwp = cint(leave[0][1]) and (lwp + 0.5) or (lwp + 1) return lwp - def check_existing(self): - if not self.salary_slip_based_on_timesheet: - ret_exist = frappe.db.sql("""select name from `tabSalary Slip` - where start_date = %s and end_date = %s and docstatus != 2 - and employee = %s and name != %s""", - (self.start_date, self.end_date, self.employee, self.name)) - if ret_exist: - self.employee = '' - frappe.throw(_("Salary Slip of employee {0} already created for this period").format(self.employee)) - else: - for data in self.timesheets: - if frappe.db.get_value('Timesheet', data.time_sheet, 'status') == 'Payrolled': - frappe.throw(_("Salary Slip of employee {0} already created for time sheet {1}").format(self.employee, data.time_sheet)) + def add_earning_for_hourly_wages(self, doc, salary_component, amount): + row_exists = False + for row in doc.earnings: + if row.salary_component == salary_component: + row.amount = amount + row_exists = True + break - def sum_components(self, component_type, total_field, precision): + if not row_exists: + wages_row = { + "salary_component": salary_component, + "abbr": frappe.db.get_value("Salary Component", salary_component, "salary_component_abbr"), + "amount": self.hour_rate * self.total_working_hours + } + doc.append('earnings', wages_row) + + def calculate_net_pay(self): + if self.salary_structure: + self.calculate_component_amounts() + + self.gross_pay = self.get_component_totals("earnings") + self.total_deduction = self.get_component_totals("deductions") + + self.set_loan_repayment() + + self.net_pay = 0 + if self.total_working_days: + self.net_pay = flt(self.gross_pay) - (flt(self.total_deduction) + flt(self.total_loan_repayment)) + + self.rounded_total = rounded(self.net_pay) + + if self.net_pay < 0: + frappe.throw(_("Net Pay cannnot be negative")) + + def calculate_component_amounts(self): + if not getattr(self, '_salary_structure_doc', None): + self._salary_structure_doc = frappe.get_doc('Salary Structure', self.salary_structure) + + payroll_period = get_payroll_period(self.start_date, self.end_date, self.company) + + self.add_structure_components() + self.add_employee_benefits(payroll_period) + self.add_additional_salary_components() + self.add_tax_components(payroll_period) + + def add_structure_components(self): + data = self.get_data_for_eval() + for key in ('earnings', 'deductions'): + for struct_row in self._salary_structure_doc.get(key): + amount = self.eval_condition_and_formula(struct_row, data) + if amount and struct_row.statistical_component == 0: + self.update_component_row(struct_row, amount, key) + + def get_data_for_eval(self): + '''Returns data for evaluating formula''' + data = frappe._dict() + + data.update(frappe.get_doc("Salary Structure Assignment", + {"employee": self.employee, "salary_structure": self.salary_structure}).as_dict()) + + data.update(frappe.get_doc("Employee", self.employee).as_dict()) + data.update(self.as_dict()) + + # set values for components + salary_components = frappe.get_all("Salary Component", fields=["salary_component_abbr"]) + for sc in salary_components: + data.setdefault(sc.salary_component_abbr, 0) + + for key in ('earnings', 'deductions'): + for d in self.get(key): + data[d.abbr] = d.amount + + return data + + def eval_condition_and_formula(self, d, data): + try: + condition = d.condition.strip() if d.condition else None + if condition: + if not frappe.safe_eval(condition, self.whitelisted_globals, data): + return None + amount = d.amount + if d.amount_based_on_formula: + formula = d.formula.strip() if d.formula else None + if formula: + amount = flt(frappe.safe_eval(formula, self.whitelisted_globals, data), d.precision("amount")) + if amount: + data[d.abbr] = amount + + return amount + + except NameError as err: + frappe.throw(_("Name error: {0}".format(err))) + except SyntaxError as err: + frappe.throw(_("Syntax error in formula or condition: {0}".format(err))) + except Exception as e: + frappe.throw(_("Error in formula or condition: {0}".format(e))) + raise + + def add_employee_benefits(self, payroll_period): + for struct_row in self._salary_structure_doc.get("earnings"): + if struct_row.is_flexible_benefit == 1: + if frappe.db.get_value("Salary Component", struct_row.salary_component, "pay_against_benefit_claim") != 1: + benefit_component_amount = get_benefit_component_amount(self.employee, self.start_date, self.end_date, + struct_row.salary_component, self._salary_structure_doc, self.payroll_frequency, payroll_period) + if benefit_component_amount: + self.update_component_row(struct_row, benefit_component_amount, "earnings") + else: + benefit_claim_amount = get_benefit_claim_amount(self.employee, self.start_date, self.end_date, struct_row.salary_component) + if benefit_claim_amount: + self.update_component_row(struct_row, benefit_claim_amount, "earnings") + + self.adjust_benefits_in_last_payroll_period(payroll_period) + + def adjust_benefits_in_last_payroll_period(self, payroll_period): + if payroll_period: + if (getdate(payroll_period.end_date) <= getdate(self.end_date)): + last_benefits = get_last_payroll_period_benefits(self.employee, self.start_date, self.end_date, + payroll_period, self._salary_structure_doc) + if last_benefits: + for last_benefit in last_benefits: + last_benefit = frappe._dict(last_benefit) + amount = last_benefit.amount + self.update_component_row(frappe._dict(last_benefit.struct_row), amount, "earnings") + + def add_additional_salary_components(self): + additional_components = get_additional_salary_component(self.employee, self.start_date, self.end_date) + if additional_components: + for additional_component in additional_components: + amount = additional_component.amount + overwrite = additional_component.overwrite + key = "earnings" if additional_component.type == "Earning" else "deductions" + self.update_component_row(frappe._dict(additional_component.struct_row), amount, key, overwrite=overwrite) + + def add_tax_components(self, payroll_period): + # Calculate variable_based_on_taxable_salary after all components updated in salary slip + struct_tax_components = [d.salary_component for d in self._salary_structure_doc.get("deductions") + if d.variable_based_on_taxable_salary == 1 and not d.formula and not d.amount] + + if not struct_tax_components: + struct_tax_components = [d.name for d in + frappe.get_all("Salary Component", filters={"variable_based_on_taxable_salary": 1})] + + for d in struct_tax_components: + tax_amount = self.calculate_variable_based_on_taxable_salary(d, payroll_period) + tax_row = self.get_salary_slip_row(d) + self.update_component_row(tax_row, tax_amount, "deductions") + + def update_component_row(self, struct_row, amount, key, overwrite=1): + component_row = None + for d in self.get(key): + if d.salary_component == struct_row.salary_component: + component_row = d + + if not component_row: + if amount: + self.append(key, { + 'amount': amount, + 'default_amount': amount if not struct_row.get("is_additional_component") else 0, + 'depends_on_payment_days' : struct_row.depends_on_payment_days, + 'salary_component' : struct_row.salary_component, + 'abbr' : struct_row.abbr, + 'do_not_include_in_total' : struct_row.do_not_include_in_total, + 'is_tax_applicable': struct_row.is_tax_applicable, + 'is_flexible_benefit': struct_row.is_flexible_benefit, + 'variable_based_on_taxable_salary': struct_row.variable_based_on_taxable_salary, + 'deduct_full_tax_on_selected_payroll_date': struct_row.deduct_full_tax_on_selected_payroll_date, + 'additional_amount': amount if struct_row.get("is_additional_component") else 0 + }) + else: + if struct_row.get("is_additional_component"): + if overwrite: + component_row.additional_amount = amount - component_row.get("default_amount", 0) + else: + component_row.additional_amount = amount + + if not overwrite: + amount += component_row.default_amount + + component_row.amount = amount + component_row.deduct_full_tax_on_selected_payroll_date = struct_row.deduct_full_tax_on_selected_payroll_date + + def calculate_variable_based_on_taxable_salary(self, tax_component, payroll_period): + if not payroll_period: + frappe.msgprint(_("Start and end dates not in a valid Payroll Period, cannot calculate {0}.") + .format(tax_component)) + return + + # Deduct taxes forcefully for unsubmitted tax exemption proof and unclaimed benefits in the last period + if payroll_period.end_date <= getdate(self.end_date): + self.deduct_tax_for_unsubmitted_tax_exemption_proof = 1 + self.deduct_tax_for_unclaimed_employee_benefits = 1 + + return self.calculate_variable_tax(payroll_period, tax_component) + + def calculate_variable_tax(self, payroll_period, tax_component): + # get remaining numbers of sub-period (period for which one salary is processed) + remaining_sub_periods = get_period_factor(self.employee, + self.start_date, self.end_date, self.payroll_frequency, payroll_period)[1] + + # get taxable_earnings, paid_taxes for previous period + previous_taxable_earnings = self.get_taxable_earnings_for_prev_period(payroll_period.start_date, self.start_date) + previous_total_paid_taxes = self.get_tax_paid_in_period(payroll_period.start_date, self.start_date, tax_component) + + # get taxable_earnings for current period (all days) + current_taxable_earnings = self.get_taxable_earnings() + future_structured_taxable_earnings = current_taxable_earnings.taxable_earnings * (math.ceil(remaining_sub_periods) - 1) + + # get taxable_earnings, addition_earnings for current actual payment days + self.set_component_amounts_based_on_payment_days() + current_taxable_earnings_for_payment_days = self.get_taxable_earnings() + current_structured_taxable_earnings = current_taxable_earnings_for_payment_days.taxable_earnings + current_additional_earnings = current_taxable_earnings_for_payment_days.additional_income + current_additional_earnings_with_full_tax = current_taxable_earnings_for_payment_days.additional_income_with_full_tax + + # Get taxable unclaimed benefits + unclaimed_taxable_benefits = 0 + if self.deduct_tax_for_unclaimed_employee_benefits: + unclaimed_taxable_benefits = self.calculate_unclaimed_taxable_benefits(payroll_period) + unclaimed_taxable_benefits += current_taxable_earnings_for_payment_days.flexi_benefits + + # Total exemption amount based on tax exemption declaration + total_exemption_amount, other_incomes = self.get_total_exemption_amount_and_other_incomes(payroll_period) + + # Total taxable earnings including additional and other incomes + total_taxable_earnings = previous_taxable_earnings + current_structured_taxable_earnings + future_structured_taxable_earnings \ + + current_additional_earnings + other_incomes + unclaimed_taxable_benefits - total_exemption_amount + + # Total taxable earnings without additional earnings with full tax + total_taxable_earnings_without_full_tax_addl_components = total_taxable_earnings - current_additional_earnings_with_full_tax + + # Structured tax amount + total_structured_tax_amount = self.calculate_tax_by_tax_slab(payroll_period, total_taxable_earnings_without_full_tax_addl_components) + + current_structured_tax_amount = (total_structured_tax_amount - previous_total_paid_taxes) / remaining_sub_periods + + # Total taxable earnings with additional earnings with full tax + full_tax_on_additional_earnings = 0.0 + if current_additional_earnings_with_full_tax: + total_tax_amount = self.calculate_tax_by_tax_slab(payroll_period, total_taxable_earnings) + full_tax_on_additional_earnings = total_tax_amount - total_structured_tax_amount + + current_tax_amount = current_structured_tax_amount + full_tax_on_additional_earnings + if flt(current_tax_amount) < 0: + current_tax_amount = 0 + + return current_tax_amount + + def get_taxable_earnings_for_prev_period(self, start_date, end_date): + taxable_earnings = frappe.db.sql(""" + select sum(sd.amount) + from + `tabSalary Detail` sd join `tabSalary Slip` ss on sd.parent=ss.name + where + sd.parentfield='earnings' + and sd.is_tax_applicable=1 + and is_flexible_benefit=0 + and ss.docstatus=1 + and ss.employee=%(employee)s + and ss.start_date between %(from_date)s and %(to_date)s + and ss.end_date between %(from_date)s and %(to_date)s + """, { + "employee": self.employee, + "from_date": start_date, + "to_date": end_date + }) + return flt(taxable_earnings[0][0]) if taxable_earnings else 0 + + def get_tax_paid_in_period(self, start_date, end_date, tax_component): + # find total_tax_paid, tax paid for benefit, additional_salary + total_tax_paid = flt(frappe.db.sql(""" + select + sum(sd.amount) + from + `tabSalary Detail` sd join `tabSalary Slip` ss on sd.parent=ss.name + where + sd.parentfield='deductions' + and sd.salary_component=%(salary_component)s + and sd.variable_based_on_taxable_salary=1 + and ss.docstatus=1 + and ss.employee=%(employee)s + and ss.start_date between %(from_date)s and %(to_date)s + and ss.end_date between %(from_date)s and %(to_date)s + """, { + "salary_component": tax_component, + "employee": self.employee, + "from_date": start_date, + "to_date": end_date + })[0][0]) + + return total_tax_paid + + def get_taxable_earnings(self, only_flexi=0): + taxable_earnings = 0 + additional_income = 0 + additional_income_with_full_tax = 0 + flexi_benefits = 0 + + for earning in self.earnings: + if earning.is_tax_applicable: + if flt(earning.additional_amount): + taxable_earnings += (earning.amount - earning.additional_amount) + additional_income += earning.additional_amount + if earning.deduct_full_tax_on_selected_payroll_date: + additional_income_with_full_tax += earning.additional_amount + continue + + if earning.is_flexible_benefit: + flexi_benefits += earning.amount + else: + taxable_earnings += earning.amount + + return frappe._dict({ + "taxable_earnings": taxable_earnings, + "additional_income": additional_income, + "additional_income_with_full_tax": additional_income_with_full_tax, + "flexi_benefits": flexi_benefits + }) + + def calculate_unclaimed_taxable_benefits(self, payroll_period): + # get total sum of benefits paid + total_benefits_paid = flt(frappe.db.sql(""" + select sum(sd.amount) + from `tabSalary Detail` sd join `tabSalary Slip` ss on sd.parent=ss.name + where + sd.parentfield='earnings' + and sd.is_tax_applicable=1 + and is_flexible_benefit=1 + and ss.docstatus=1 + and ss.employee=%(employee)s + and ss.start_date between %(start_date)s and %(end_date)s + and ss.end_date between %(start_date)s and %(end_date)s + """, { + "employee": self.employee, + "start_date": payroll_period.start_date, + "end_date": self.start_date + })[0][0]) + + # get total benefits claimed + total_benefits_claimed = flt(frappe.db.sql(""" + select sum(claimed_amount) + from `tabEmployee Benefit Claim` + where + docstatus=1 + and employee=%s + and claim_date between %s and %s + """, (self.employee, payroll_period.start_date, self.end_date))[0][0]) + + return total_benefits_paid - total_benefits_claimed + + def get_total_exemption_amount_and_other_incomes(self, payroll_period): + total_exemption_amount, other_incomes = 0, 0 + if self.deduct_tax_for_unsubmitted_tax_exemption_proof: + exemption_proof = frappe.db.get_value("Employee Tax Exemption Proof Submission", + {"employee": self.employee, "payroll_period": payroll_period.name, "docstatus": 1}, + ["exemption_amount", "income_from_other_sources"]) + if exemption_proof: + total_exemption_amount, other_incomes = exemption_proof + else: + declaration = frappe.db.get_value("Employee Tax Exemption Declaration", + {"employee": self.employee, "payroll_period": payroll_period.name, "docstatus": 1}, + ["total_exemption_amount", "income_from_other_sources"]) + if declaration: + total_exemption_amount, other_incomes = declaration + + return total_exemption_amount, other_incomes + + def calculate_tax_by_tax_slab(self, payroll_period, annual_taxable_earning): + payroll_period_obj = frappe.get_doc("Payroll Period", payroll_period) + annual_taxable_earning -= flt(payroll_period_obj.standard_tax_exemption_amount) + data = self.get_data_for_eval() + data.update({"annual_taxable_earning": annual_taxable_earning}) + taxable_amount = 0 + for slab in payroll_period_obj.taxable_salary_slabs: + if slab.condition and not self.eval_tax_slab_condition(slab.condition, data): + continue + if not slab.to_amount and annual_taxable_earning > slab.from_amount: + taxable_amount += (annual_taxable_earning - slab.from_amount) * slab.percent_deduction *.01 + continue + if annual_taxable_earning > slab.from_amount and annual_taxable_earning < slab.to_amount: + taxable_amount += (annual_taxable_earning - slab.from_amount) * slab.percent_deduction *.01 + elif annual_taxable_earning > slab.from_amount and annual_taxable_earning > slab.to_amount: + taxable_amount += (slab.to_amount - slab.from_amount) * slab.percent_deduction * .01 + return taxable_amount + + def eval_tax_slab_condition(self, condition, data): + try: + condition = condition.strip() + if condition: + return frappe.safe_eval(condition, self.whitelisted_globals, data) + except NameError as err: + frappe.throw(_("Name error: {0}".format(err))) + except SyntaxError as err: + frappe.throw(_("Syntax error in condition: {0}".format(err))) + except Exception as e: + frappe.throw(_("Error in formula or condition: {0}".format(e))) + raise + + def get_salary_slip_row(self, salary_component): + component = frappe.get_doc("Salary Component", salary_component) + # Data for update_component_row + struct_row = frappe._dict() + struct_row['depends_on_payment_days'] = component.depends_on_payment_days + struct_row['salary_component'] = component.name + struct_row['abbr'] = component.salary_component_abbr + struct_row['do_not_include_in_total'] = component.do_not_include_in_total + struct_row['is_tax_applicable'] = component.is_tax_applicable + struct_row['is_flexible_benefit'] = component.is_flexible_benefit + struct_row['variable_based_on_taxable_salary'] = component.variable_based_on_taxable_salary + return struct_row + + def get_component_totals(self, component_type): + total = 0.0 + for d in self.get(component_type): + if not d.do_not_include_in_total: + d.amount = flt(d.amount, d.precision("amount")) + total += d.amount + return total + + def set_component_amounts_based_on_payment_days(self): joining_date, relieving_date = frappe.db.get_value("Employee", self.employee, ["date_of_joining", "relieving_date"]) @@ -416,51 +697,24 @@ class SalarySlip(TransactionBase): if not joining_date: frappe.throw(_("Please set the Date Of Joining for employee {0}").format(frappe.bold(self.employee_name))) - for d in self.get(component_type): - if (self.salary_structure and - cint(d.depends_on_payment_days) and cint(self.total_working_days) and - (not - self.salary_slip_based_on_timesheet or - getdate(self.start_date) < joining_date or - getdate(self.end_date) > relieving_date - )): + for component_type in ("earnings", "deductions"): + for d in self.get(component_type): + if (self.salary_structure and + cint(d.depends_on_payment_days) and cint(self.total_working_days) and + (not self.salary_slip_based_on_timesheet or + getdate(self.start_date) < joining_date or + getdate(self.end_date) > relieving_date + )): - d.amount = rounded( - (flt(d.default_amount, precision) * flt(self.payment_days) - / cint(self.total_working_days)), self.precision("amount", component_type) - ) + d.amount = flt( + (flt(d.default_amount + d.additional_amount) * flt(self.payment_days) + / cint(self.total_working_days)) + , d.precision("amount")) - elif not self.payment_days and not self.salary_slip_based_on_timesheet and \ - cint(d.depends_on_payment_days): - d.amount = 0 - elif not d.amount: - d.amount = d.default_amount - if not d.do_not_include_in_total: - self.set(total_field, self.get(total_field) + flt(d.amount, precision)) - - def calculate_net_pay(self): - if self.salary_structure: - self.calculate_component_amounts() - - disable_rounded_total = cint(frappe.db.get_value("Global Defaults", None, "disable_rounded_total")) - precision = frappe.defaults.get_global_default("currency_precision") - self.total_deduction = 0 - self.gross_pay = 0 - - self.sum_components('earnings', 'gross_pay', precision) - self.sum_components('deductions', 'total_deduction', precision) - - self.set_loan_repayment() - - self.net_pay = 0 - if self.total_working_days: - self.net_pay = flt(self.gross_pay) - (flt(self.total_deduction) + flt(self.total_loan_repayment)) - - self.rounded_total = rounded(self.net_pay, - self.precision("net_pay") if disable_rounded_total else 0) - - if self.net_pay < 0: - frappe.throw(_("Net Pay cannnot be negative")) + elif not self.payment_days and not self.salary_slip_based_on_timesheet and cint(d.depends_on_payment_days): + d.amount = 0 + elif not d.amount: + d.amount = d.default_amount + d.additional_amount def set_loan_repayment(self): self.set('loans', []) @@ -492,25 +746,6 @@ class SalarySlip(TransactionBase): l.repay_from_salary = 1 and l.docstatus = 1 and l.applicant = %s""", (self.start_date, self.end_date, self.employee), as_dict=True) or [] - def on_submit(self): - if self.net_pay < 0: - frappe.throw(_("Net Pay cannot be less than 0")) - else: - self.set_status() - self.update_status(self.name) - self.update_salary_slip_in_additional_salary() - if (frappe.db.get_single_value("HR Settings", "email_salary_slip_to_employee")) and not frappe.flags.via_payroll_entry: - self.email_salary_slip() - - def on_cancel(self): - self.set_status() - self.update_status() - self.update_salary_slip_in_additional_salary() - - def on_trash(self): - from frappe.model.naming import revert_series_if_last - revert_series_if_last(self.series, self.name) - def update_salary_slip_in_additional_salary(self): salary_slip = self.name if self.docstatus==1 else None frappe.db.sql(""" @@ -559,289 +794,24 @@ class SalarySlip(TransactionBase): status = self.get_status() self.db_set("status", status) - def get_status(self): - if self.docstatus == 0: - status = "Draft" - elif self.docstatus == 1: - status = "Submitted" - elif self.docstatus == 2: - status = "Cancelled" - return status - def calculate_variable_based_on_taxable_salary(self, tax_component): - payroll_period = get_payroll_period(self.start_date, self.end_date, self.company) - if not payroll_period: - frappe.msgprint(_("Start and end dates not in a valid Payroll Period, cannot calculate {0}.") - .format(tax_component)) - return False - if payroll_period.end_date <= getdate(self.end_date): - if not self.deduct_tax_for_unsubmitted_tax_exemption_proof or not\ - self.deduct_tax_for_unclaimed_employee_benefits: - frappe.throw(_("You have to Deduct Tax for Unsubmitted Tax Exemption Proof and Unclaimed \ - Employee Benefits in the last Salary Slip of Payroll Period")) - # calc prorata tax to be applied - return self.calculate_variable_tax(tax_component, payroll_period) + def process_salary_structure(self, for_preview=0): + '''Calculate salary after salary structure details have been updated''' + if not self.salary_slip_based_on_timesheet: + self.get_date_details() + self.pull_emp_details() + self.get_leave_details(for_preview=for_preview) + self.calculate_net_pay() - def calculate_variable_tax(self, tax_component, payroll_period): - annual_taxable_earning, period_factor = 0, 0 - pro_rata_tax_paid, additional_tax_paid, benefit_tax_paid = 0.0, 0.0, 0.0 - unclaimed_earning, unclaimed_benefit, additional_income = 0.0, 0.0, 0.0 + def pull_emp_details(self): + emp = frappe.db.get_value("Employee", self.employee, ["bank_name", "bank_ac_no"], as_dict=1) + if emp: + self.bank_name = emp.bank_name + self.bank_account_no = emp.bank_ac_no - # get taxable_earning, additional_income in this slip - taxable_earning = self.get_taxable_earnings() - if self.deduct_tax_for_unclaimed_employee_benefits: - # get all untaxed benefits till date, pass amount to be taxed by later methods - unclaimed_benefit = self.calculate_unclaimed_taxable_benefit(payroll_period) - # flexi's excluded from monthly tax, add flexis in this slip to unclaimed_benefit - unclaimed_benefit += self.get_taxable_earnings(only_flexi=True)["taxable_earning"] - if self.deduct_tax_for_unsubmitted_tax_exemption_proof: - # do not consider exemption, calc tax to be paid for the period till date - # considering prorata taxes paid and proofs submitted - unclaimed_earning = self.calculate_unclaimed_taxable_earning(payroll_period, tax_component) - earning_in_period = taxable_earning["taxable_earning"] + unclaimed_earning - period_factor = self.get_period_factor(payroll_period.start_date, payroll_period.end_date, - payroll_period.start_date, self.end_date) - annual_taxable_earning = earning_in_period * period_factor - additional_income += self.get_total_additional_income(payroll_period.start_date) - else: - # consider exemption declaration, find annual_earning by monthly taxable salary - period_factor = self.get_period_factor(payroll_period.start_date, payroll_period.end_date) - annual_earning = taxable_earning["taxable_earning"] * period_factor - exemption_amount = 0 - if frappe.db.exists("Employee Tax Exemption Declaration", {"employee": self.employee, - "payroll_period": payroll_period.name, "docstatus": 1}): - exemption_amount = frappe.db.get_value("Employee Tax Exemption Declaration", - {"employee": self.employee, "payroll_period": payroll_period.name, "docstatus": 1}, - "total_exemption_amount") - annual_taxable_earning = annual_earning - exemption_amount - - if self.deduct_tax_for_unclaimed_employee_benefits or self.deduct_tax_for_unsubmitted_tax_exemption_proof: - tax_detail = self.get_tax_paid_in_period(payroll_period, tax_component) - if tax_detail: - pro_rata_tax_paid = tax_detail["total_tax_paid"] - tax_detail["additional_tax"] - tax_detail["benefit_tax"] - additional_tax_paid = tax_detail["additional_tax"] - benefit_tax_paid = tax_detail["benefit_tax"] - - # add any additional income in this slip - additional_income += taxable_earning["additional_income"] - args = { - "payroll_period": payroll_period.name, - "tax_component": tax_component, - "period_factor": period_factor, - "annual_taxable_earning": annual_taxable_earning, - "additional_income": additional_income, - "unclaimed_benefit": unclaimed_benefit, - "pro_rata_tax_paid": pro_rata_tax_paid, - "benefit_tax_paid": benefit_tax_paid, - "additional_tax_paid": additional_tax_paid - } - return self.calculate_tax(args) - - def calculate_unclaimed_taxable_benefit(self, payroll_period): - total_benefit, total_benefit_claim = 0, 0 - - # get total sum of benefits paid - sum_benefit = frappe.db.sql("""select sum(sd.amount) from `tabSalary Detail` sd join - `tabSalary Slip` ss on sd.parent=ss.name where sd.parentfield='earnings' - and sd.is_tax_applicable=1 and is_flexible_benefit=1 and ss.docstatus=1 - and ss.employee='{0}' and ss.start_date between '{1}' and '{2}' and - ss.end_date between '{1}' and '{2}'""".format(self.employee, - payroll_period.start_date, self.start_date)) - if sum_benefit and sum_benefit[0][0]: - total_benefit = sum_benefit[0][0] - - # get total benefits claimed - sum_benefit_claim = frappe.db.sql("""select sum(claimed_amount) from - `tabEmployee Benefit Claim` where docstatus=1 and employee='{0}' and claim_date - between '{1}' and '{2}'""".format(self.employee, payroll_period.start_date, self.end_date)) - if sum_benefit_claim and sum_benefit_claim[0][0]: - total_benefit_claim = sum_benefit_claim[0][0] - return total_benefit - total_benefit_claim - - def calculate_unclaimed_taxable_earning(self, payroll_period, tax_component): - total_taxable_earning, total_exemption_amount = 0, 0 - # calc total taxable amount in period - sum_taxable_earning = frappe.db.sql("""select sum(sd.amount) from `tabSalary Detail` sd join - `tabSalary Slip` ss on sd.parent=ss.name where sd.parentfield='earnings' - and sd.is_tax_applicable=1 and is_additional_component=0 and is_flexible_benefit=0 - and ss.docstatus=1 and ss.employee='{0}' and ss.start_date between '{1}' and '{2}' - and ss.end_date between '{1}' and '{2}'""".format(self.employee, - payroll_period.start_date, self.start_date)) - if sum_taxable_earning and sum_taxable_earning[0][0]: - total_taxable_earning = sum_taxable_earning[0][0] - - # add up total Proof Submission - sum_exemption = frappe.db.sql("""select sum(exemption_amount) from - `tabEmployee Tax Exemption Proof Submission` where docstatus=1 and employee='{0}' and - payroll_period='{1}' and submission_date between '{2}' and '{3}'""".format(self.employee, - payroll_period.name, payroll_period.start_date, self.end_date)) - if sum_exemption and sum_exemption[0][0]: - total_exemption_amount = sum_exemption[0][0] - total_taxable_earning -= total_exemption_amount - return total_taxable_earning - - def get_total_additional_income(self, from_date): - sum_additional_earning = frappe.db.sql(""" - select sum(sd.amount) - from - `tabSalary Detail` sd join `tabSalary Slip` ss on sd.parent=ss.name - where - sd.parentfield='earnings' - and sd.is_tax_applicable=1 and is_additional_component=1 - and is_flexible_benefit=0 and ss.docstatus=1 - and ss.employee=%(employee)s - and ss.start_date between %(from_date)s and %(to_date)s - and ss.end_date between %(from_date)s and %(to_date)s - """, { - "employee": self.employee, - "from_date": from_date, - "to_date": self.start_date - }) - return flt(sum_additional_earning[0][0]) if sum_additional_earning else 0 - - def get_tax_paid_in_period(self, payroll_period, tax_component, only_total=False): - # find total_tax_paid, tax paid for benefit, additional_salary - sum_tax_paid = frappe.db.sql(""" - select - sum(sd.amount), sum(tax_on_flexible_benefit), sum(tax_on_additional_salary) - from - `tabSalary Detail` sd join `tabSalary Slip` ss on sd.parent=ss.name - where - sd.parentfield='deductions' and sd.salary_component=%(salary_component)s - and sd.variable_based_on_taxable_salary=1 - and ss.docstatus=1 and ss.employee=%(employee)s - and ss.start_date between %(from_date)s and %(to_date)s - and ss.end_date between %(from_date)s and %(to_date)s - """, { - "salary_component": tax_component, - "employee": self.employee, - "from_date": payroll_period.start_date, - "to_date": self.start_date - }) - if sum_tax_paid and sum_tax_paid[0][0]: - return { - 'total_tax_paid': sum_tax_paid[0][0], - 'benefit_tax':sum_tax_paid[0][1], - 'additional_tax': sum_tax_paid[0][2] - } - - def get_taxable_earnings(self, include_flexi=0, only_flexi=0): - taxable_earning = 0 - additional_income = 0 - for earning in self.earnings: - if earning.is_tax_applicable: - if earning.is_additional_component: - additional_income += earning.amount - continue - if only_flexi: - if earning.is_flexible_benefit: - taxable_earning += earning.amount - continue - if include_flexi or not earning.is_flexible_benefit: - taxable_earning += earning.amount - return { - "taxable_earning": taxable_earning, - "additional_income": additional_income - } - - def calculate_tax(self, args): - tax_amount, benefit_tax, additional_tax = 0, 0, 0 - annual_taxable_earning = args.get("annual_taxable_earning") - benefit_to_tax = args.get("unclaimed_benefit") - additional_income = args.get("additional_income") - - # Get tax calc by period - annual_tax = self.calculate_tax_by_tax_slab(args.get("payroll_period"), annual_taxable_earning) - - # Calc prorata tax - tax_amount = annual_tax / args.get("period_factor") - - # Benefit is a part of Salary Structure, add the tax diff, update annual_tax - if benefit_to_tax > 0: - annual_taxable_earning += benefit_to_tax - annual_tax_with_benefit_income = self.calculate_tax_by_tax_slab( - args.get("payroll_period"), annual_taxable_earning) - benefit_tax = annual_tax_with_benefit_income - annual_tax - args.get("benefit_tax_paid") - tax_amount += benefit_tax - annual_tax = annual_tax_with_benefit_income - - # find the annual tax diff caused by additional_income, add to tax_amount - if additional_income > 0: - annual_tax_with_additional_income = self.calculate_tax_by_tax_slab( - args.get("payroll_period"), annual_taxable_earning + additional_income) - additional_tax = annual_tax_with_additional_income - annual_tax - args.get("additional_tax_paid") - tax_amount += additional_tax - # less paid taxes - if args.get("pro_rata_tax_paid"): - tax_amount -= args.get("pro_rata_tax_paid") - tax_amount = rounded(tax_amount) - struct_row = self.get_salary_slip_row(args.get("tax_component")) - return [struct_row, tax_amount, benefit_tax, additional_tax] - - def calculate_tax_by_tax_slab(self, payroll_period, annual_taxable_earning): - payroll_period_obj = frappe.get_doc("Payroll Period", payroll_period) - annual_taxable_earning -= flt(payroll_period_obj.standard_tax_exemption_amount) - data = self.get_data_for_eval() - data.update({"annual_taxable_earning": annual_taxable_earning}) - - taxable_amount = 0 - for slab in payroll_period_obj.taxable_salary_slabs: - if slab.condition and not self.eval_tax_slab_condition(slab.condition, data): - continue - if not slab.to_amount and annual_taxable_earning > slab.from_amount: - taxable_amount += (annual_taxable_earning - slab.from_amount) * slab.percent_deduction *.01 - continue - if annual_taxable_earning > slab.from_amount and annual_taxable_earning < slab.to_amount: - taxable_amount += (annual_taxable_earning - slab.from_amount) * slab.percent_deduction *.01 - elif annual_taxable_earning > slab.from_amount and annual_taxable_earning > slab.to_amount: - taxable_amount += (slab.to_amount - slab.from_amount) * slab.percent_deduction * .01 - return taxable_amount - - def eval_tax_slab_condition(self, condition, data): - try: - condition = condition.strip() - if condition: - return frappe.safe_eval(condition, self.whitelisted_globals, data) - except NameError as err: - frappe.throw(_("Name error: {0}".format(err))) - except SyntaxError as err: - frappe.throw(_("Syntax error in condition: {0}".format(err))) - except Exception as e: - frappe.throw(_("Error in formula or condition: {0}".format(e))) - raise - - def get_period_factor(self, period_start, period_end, start_date=None, end_date=None): - # TODO if both deduct checked update the factor to make tax consistent - joining_date, relieving_date = frappe.db.get_value("Employee", self.employee, ["date_of_joining", "relieving_date"]) - if getdate(joining_date) > getdate(period_start): - period_start = joining_date - if relieving_date and getdate(relieving_date) < getdate(period_end): - period_end = relieving_date - - payroll_days = date_diff(period_end, period_start) + 1 - if start_date and end_date: - salary_days = date_diff(end_date, start_date) + 1 - return flt(payroll_days)/flt(salary_days) - - # if period configured for a year and monthly frequency return 12 to make tax calc consistent - if 360 <= payroll_days <= 370 and self.payroll_frequency == "Monthly": - return 12 - - salary_days = date_diff(self.end_date, self.start_date) + 1 - return flt(payroll_days)/flt(salary_days) - - def get_salary_slip_row(self, salary_component): - component = frappe.get_doc("Salary Component", salary_component) - # Data for update_component_row - struct_row = {} - struct_row['depends_on_payment_days'] = component.depends_on_payment_days - struct_row['salary_component'] = component.name - struct_row['abbr'] = component.salary_component_abbr - struct_row['do_not_include_in_total'] = component.do_not_include_in_total - struct_row['is_tax_applicable'] = component.is_tax_applicable - struct_row['is_flexible_benefit'] = component.is_flexible_benefit - struct_row['variable_based_on_taxable_salary'] = component.variable_based_on_taxable_salary - return struct_row + def process_salary_based_on_leave(self, lwp=0): + self.get_leave_details(lwp=lwp) + self.calculate_net_pay() def unlink_ref_doc_from_salary_slip(ref_no): linked_ss = frappe.db.sql_list("""select name from `tabSalary Slip` diff --git a/erpnext/hr/doctype/salary_slip/test_salary_slip.py b/erpnext/hr/doctype/salary_slip/test_salary_slip.py index 75c1e420b8..b7e0782001 100644 --- a/erpnext/hr/doctype/salary_slip/test_salary_slip.py +++ b/erpnext/hr/doctype/salary_slip/test_salary_slip.py @@ -45,12 +45,12 @@ class TestSalarySlip(unittest.TestCase): self.assertEqual(ss.total_working_days, no_of_days[0]) self.assertEqual(ss.payment_days, no_of_days[0]) - self.assertEqual(ss.earnings[0].amount, 25000) + self.assertEqual(ss.earnings[0].amount, 50000) self.assertEqual(ss.earnings[1].amount, 3000) self.assertEqual(ss.deductions[0].amount, 5000) self.assertEqual(ss.deductions[1].amount, 5000) - self.assertEqual(ss.gross_pay, 40500) - self.assertEqual(ss.net_pay, 29918) + self.assertEqual(ss.gross_pay, 78000) + self.assertEqual(ss.net_pay, 67418.0) def test_salary_slip_with_holidays_excluded(self): no_of_days = self.get_no_of_days() @@ -64,13 +64,13 @@ class TestSalarySlip(unittest.TestCase): self.assertEqual(ss.total_working_days, no_of_days[0] - no_of_days[1]) self.assertEqual(ss.payment_days, no_of_days[0] - no_of_days[1]) - self.assertEqual(ss.earnings[0].amount, 25000) - self.assertEqual(ss.earnings[0].default_amount, 25000) + self.assertEqual(ss.earnings[0].amount, 50000) + self.assertEqual(ss.earnings[0].default_amount, 50000) self.assertEqual(ss.earnings[1].amount, 3000) self.assertEqual(ss.deductions[0].amount, 5000) self.assertEqual(ss.deductions[1].amount, 5000) - self.assertEqual(ss.gross_pay, 40500) - self.assertEqual(ss.net_pay, 29918) + self.assertEqual(ss.gross_pay, 78000) + self.assertEqual(ss.net_pay, 67418.0) def test_payment_days(self): no_of_days = self.get_no_of_days() @@ -211,7 +211,7 @@ class TestSalarySlip(unittest.TestCase): tax_paid = get_tax_paid_in_period(employee) # total taxable income 586000, 250000 @ 5%, 86000 @ 20% ie. 12500 + 17200 - annual_tax = 29700 + annual_tax = 113567.79 try: self.assertEqual(tax_paid, annual_tax) except AssertionError: @@ -250,7 +250,7 @@ class TestSalarySlip(unittest.TestCase): # total taxable income 416000, 166000 @ 5% ie. 8300 try: - self.assertEqual(tax_paid, 8300) + self.assertEqual(tax_paid, 88607.79) except AssertionError: print("\nSalary Slip - Tax calculation failed on following case\n", data, "\n") raise @@ -265,7 +265,7 @@ class TestSalarySlip(unittest.TestCase): # total taxable income 566000, 250000 @ 5%, 66000 @ 20%, 12500 + 13200 tax_paid = get_tax_paid_in_period(employee) try: - self.assertEqual(tax_paid, 25700) + self.assertEqual(tax_paid, 121211.48) except AssertionError: print("\nSalary Slip - Tax calculation failed on following case\n", data, "\n") raise @@ -365,7 +365,7 @@ def make_earning_salary_component(setup=False, test_tax=False): "salary_component": 'Basic Salary', "abbr":'BS', "condition": 'base > 10000', - "formula": 'base*.5', + "formula": 'base', "type": "Earning", "amount_based_on_formula": 1 }, @@ -386,7 +386,6 @@ def make_earning_salary_component(setup=False, test_tax=False): { "salary_component": "Leave Encashment", "abbr": 'LE', - "is_additional_component": 1, "type": "Earning" } ] @@ -398,7 +397,8 @@ def make_earning_salary_component(setup=False, test_tax=False): "is_flexible_benefit": 1, "type": "Earning", "pay_against_benefit_claim": 1, - "max_benefit_amount": 100000 + "max_benefit_amount": 100000, + "depends_on_payment_days": 0 }, { "salary_component": "Medical Allowance", @@ -409,9 +409,8 @@ def make_earning_salary_component(setup=False, test_tax=False): "max_benefit_amount": 15000 }, { - "salary_component": "Perfomance Bonus", + "salary_component": "Performance Bonus", "abbr": 'B', - "is_additional_component": 1, "type": "Earning" } ]) @@ -442,7 +441,8 @@ def make_deduction_salary_component(setup=False, test_tax=False): "abbr":'T', "formula": 'base*.1', "type": "Deduction", - "amount_based_on_formula": 1 + "amount_based_on_formula": 1, + "depends_on_payment_days": 0 } ] if not test_tax: @@ -512,21 +512,23 @@ def create_tax_slab(payroll_period): { "from_amount": 250000, "to_amount": 500000, - "percent_deduction": 5 + "percent_deduction": 5.2, + "condition": "annual_taxable_earning > 500000" }, { - "from_amount": 500000, + "from_amount": 500001, "to_amount": 1000000, - "percent_deduction": 20 + "percent_deduction": 20.8 }, { - "from_amount": 1000000, - "percent_deduction": 30 + "from_amount": 1000001, + "percent_deduction": 31.2 } ] payroll_period.taxable_salary_slabs = [] for item in data: payroll_period.append("taxable_salary_slabs", item) + payroll_period.standard_tax_exemption_amount = 52500 payroll_period.save() def create_salary_slips_for_payroll_period(employee, salary_structure, payroll_period, deduct_random=True): @@ -559,7 +561,7 @@ def create_additional_salary(employee, payroll_period, amount): "doctype": "Additional Salary", "employee": employee, "company": erpnext.get_default_company(), - "salary_component": "Perfomance Bonus", + "salary_component": "Performance Bonus", "payroll_date": salary_date, "amount": amount, "type": "Earning" diff --git a/erpnext/hr/doctype/salary_structure/salary_structure.js b/erpnext/hr/doctype/salary_structure/salary_structure.js index e3f37e7105..d56320a073 100755 --- a/erpnext/hr/doctype/salary_structure/salary_structure.js +++ b/erpnext/hr/doctype/salary_structure/salary_structure.js @@ -147,7 +147,8 @@ frappe.ui.form.on('Salary Structure', { source_name: frm.doc.name, employee: values.employee, as_print: 1, - print_format: print_format + print_format: print_format, + for_preview: 1 }, callback: function(r) { var new_window = window.open(); diff --git a/erpnext/hr/doctype/salary_structure/salary_structure.py b/erpnext/hr/doctype/salary_structure/salary_structure.py index 3431d3d4a8..f7d712d3f1 100644 --- a/erpnext/hr/doctype/salary_structure/salary_structure.py +++ b/erpnext/hr/doctype/salary_structure/salary_structure.py @@ -137,7 +137,7 @@ def get_existing_assignments(employees, salary_structure,from_date): return salary_structures_assignments @frappe.whitelist() -def make_salary_slip(source_name, target_doc = None, employee = None, as_print = False, print_format = None): +def make_salary_slip(source_name, target_doc = None, employee = None, as_print = False, print_format = None, for_preview=0): def postprocess(source, target): if employee: employee_details = frappe.db.get_value("Employee", employee, @@ -147,7 +147,7 @@ def make_salary_slip(source_name, target_doc = None, employee = None, as_print = target.branch = employee_details.branch target.designation = employee_details.designation target.department = employee_details.department - target.run_method('process_salary_structure') + target.run_method('process_salary_structure', for_preview=for_preview) doc = get_mapped_doc("Salary Structure", source_name, { "Salary Structure": { diff --git a/erpnext/hr/doctype/salary_structure/test_salary_structure.py b/erpnext/hr/doctype/salary_structure/test_salary_structure.py index 1a660d90ec..848c3df57a 100644 --- a/erpnext/hr/doctype/salary_structure/test_salary_structure.py +++ b/erpnext/hr/doctype/salary_structure/test_salary_structure.py @@ -39,18 +39,19 @@ class TestSalaryStructure(unittest.TestCase): holiday_list.save() def test_amount_totals(self): + frappe.db.set_value("HR Settings", None, "include_holidays_in_total_working_days", 0) sal_slip = frappe.get_value("Salary Slip", {"employee_name":"test_employee_2@salary.com"}) if not sal_slip: sal_slip = make_employee_salary_slip("test_employee_2@salary.com", "Monthly", "Salary Structure Sample") self.assertEqual(sal_slip.get("salary_structure"), 'Salary Structure Sample') - self.assertEqual(sal_slip.get("earnings")[0].amount, 25000) + self.assertEqual(sal_slip.get("earnings")[0].amount, 50000) self.assertEqual(sal_slip.get("earnings")[1].amount, 3000) - self.assertEqual(sal_slip.get("earnings")[2].amount, 12500) - self.assertEqual(sal_slip.get("gross_pay"), 40500) + self.assertEqual(sal_slip.get("earnings")[2].amount, 25000) + self.assertEqual(sal_slip.get("gross_pay"), 78000) self.assertEqual(sal_slip.get("deductions")[0].amount, 5000) self.assertEqual(sal_slip.get("deductions")[1].amount, 5000) self.assertEqual(sal_slip.get("total_deduction"), 10000) - self.assertEqual(sal_slip.get("net_pay"), 30500) + self.assertEqual(sal_slip.get("net_pay"), 68000) def test_whitespaces_in_formula_conditions_fields(self): salary_structure = make_salary_structure("Salary Structure Sample", "Monthly", dont_submit=True) diff --git a/erpnext/hr/report/salary_register/salary_register.py b/erpnext/hr/report/salary_register/salary_register.py index 869ca23139..be4b501c6e 100644 --- a/erpnext/hr/report/salary_register/salary_register.py +++ b/erpnext/hr/report/salary_register/salary_register.py @@ -35,6 +35,8 @@ def execute(filters=None): for d in ded_types: row.append(ss_ded_map.get(ss.name, {}).get(d)) + row.append(ss.total_loan_repayment) + row += [ss.total_deduction, ss.net_pay] data.append(row) @@ -67,7 +69,7 @@ def get_columns(salary_slips): columns = columns + [(e + ":Currency:120") for e in salary_components[_("Earning")]] + \ [_("Gross Pay") + ":Currency:120"] + [(d + ":Currency:120") for d in salary_components[_("Deduction")]] + \ - [_("Total Deduction") + ":Currency:120", _("Net Pay") + ":Currency:120"] + [_("Loan Repayment") + ":Currency:120", _("Total Deduction") + ":Currency:120", _("Net Pay") + ":Currency:120"] return columns, salary_components[_("Earning")], salary_components[_("Deduction")] diff --git a/erpnext/hr/utils.py b/erpnext/hr/utils.py index a600e75884..7357fd0cc1 100644 --- a/erpnext/hr/utils.py +++ b/erpnext/hr/utils.py @@ -126,9 +126,9 @@ def get_employee_fields_label(): fields = [] for df in frappe.get_meta("Employee").get("fields"): if df.fieldname in ["salutation", "user_id", "employee_number", "employment_type", - "holiday_list", "branch", "department", "designation", "grade", - "notice_number_of_days", "reports_to", "leave_policy", "company_email"]: - fields.append({"value": df.fieldname, "label": df.label}) + "holiday_list", "branch", "department", "designation", "grade", + "notice_number_of_days", "reports_to", "leave_policy", "company_email"]: + fields.append({"value": df.fieldname, "label": df.label}) return fields @frappe.whitelist() @@ -263,12 +263,6 @@ def get_leave_period(from_date, to_date, company): if leave_period: return leave_period -def get_payroll_period(from_date, to_date, company): - payroll_period = frappe.db.sql("""select name, start_date, end_date from - `tabPayroll Period` - where start_date<=%s and end_date>= %s and company=%s""", (from_date, to_date, company), as_dict=1) - return payroll_period[0] if payroll_period else None - def allocate_earned_leaves(): '''Allocate earned leaves to Employees''' e_leave_types = frappe.get_all("Leave Type", diff --git a/erpnext/regional/india/utils.py b/erpnext/regional/india/utils.py index f413a8ed4d..fc2fc9658f 100644 --- a/erpnext/regional/india/utils.py +++ b/erpnext/regional/india/utils.py @@ -146,11 +146,9 @@ def calculate_annual_eligible_hra_exemption(doc): hra_component = frappe.get_cached_value('Company', doc.company, "hra_component") if not (basic_component and hra_component): frappe.throw(_("Please mention Basic and HRA component in Company")) - annual_exemption, monthly_exemption, hra_amount = 0, 0, 0 if hra_component and basic_component: assignment = get_salary_assignment(doc.employee, nowdate()) - if assignment: hra_component_exists = frappe.db.exists("Salary Detail", { "parent": assignment.salary_structure, @@ -158,18 +156,19 @@ def calculate_annual_eligible_hra_exemption(doc): "parentfield": "earnings", "parenttype": "Salary Structure" }) + if hra_component_exists: basic_amount, hra_amount = get_component_amt_from_salary_slip(doc.employee, assignment.salary_structure, basic_component, hra_component) if hra_amount: if doc.monthly_house_rent: annual_exemption = calculate_hra_exemption(assignment.salary_structure, - basic_amount, hra_amount, doc.monthly_house_rent, - doc.rented_in_metro_city) + basic_amount, hra_amount, doc.monthly_house_rent, doc.rented_in_metro_city) if annual_exemption > 0: monthly_exemption = annual_exemption / 12 else: annual_exemption = 0 + elif doc.docstatus == 1: frappe.throw(_("Salary Structure must be submitted before submission of Tax Ememption Declaration")) @@ -180,7 +179,7 @@ def calculate_annual_eligible_hra_exemption(doc): }) def get_component_amt_from_salary_slip(employee, salary_structure, basic_component, hra_component): - salary_slip = make_salary_slip(salary_structure, employee=employee) + salary_slip = make_salary_slip(salary_structure, employee=employee, for_preview=1) basic_amt, hra_amt = 0, 0 for earning in salary_slip.earnings: if earning.salary_component == basic_component: diff --git a/erpnext/setup/doctype/company/company.js b/erpnext/setup/doctype/company/company.js index 4ac11c07e5..1e6056ec86 100644 --- a/erpnext/setup/doctype/company/company.js +++ b/erpnext/setup/doctype/company/company.js @@ -11,11 +11,6 @@ frappe.ui.form.on("Company", { filters: {"type": "Earning"} } }); - frm.set_query("arrear_component", function(){ - return { - filters: {"is_additional_component": 1} - } - }); frm.set_query("parent_company", function() { return { From ab1c43dbee9683126a8bcbff8f0044f34aab4a3a Mon Sep 17 00:00:00 2001 From: Nabin Hait Date: Thu, 16 May 2019 13:41:25 +0530 Subject: [PATCH 67/73] fix: To allow creation of sales invoice without customer --- erpnext/accounts/doctype/sales_invoice/sales_invoice.py | 3 +++ 1 file changed, 3 insertions(+) diff --git a/erpnext/accounts/doctype/sales_invoice/sales_invoice.py b/erpnext/accounts/doctype/sales_invoice/sales_invoice.py index 06e1e58008..993ee5c654 100644 --- a/erpnext/accounts/doctype/sales_invoice/sales_invoice.py +++ b/erpnext/accounts/doctype/sales_invoice/sales_invoice.py @@ -1166,6 +1166,9 @@ class SalesInvoice(SellingController): self.set_missing_values(for_validate = True) def validate_inter_company_party(doctype, party, company, inter_company_reference): + if not party: + return + if doctype in ["Sales Invoice", "Sales Order"]: partytype, ref_partytype, internal = "Customer", "Supplier", "is_internal_customer" From b90fc7fc0d677c660f167db79c69647feda45f98 Mon Sep 17 00:00:00 2001 From: Nabin Hait Date: Thu, 16 May 2019 13:42:11 +0530 Subject: [PATCH 68/73] fix: Get bank account on selection of payment mode in Loan --- erpnext/hr/doctype/loan/loan.js | 24 +++++++++++++----------- 1 file changed, 13 insertions(+), 11 deletions(-) diff --git a/erpnext/hr/doctype/loan/loan.js b/erpnext/hr/doctype/loan/loan.js index 7140bea270..e1b41786f4 100644 --- a/erpnext/hr/doctype/loan/loan.js +++ b/erpnext/hr/doctype/loan/loan.js @@ -172,18 +172,20 @@ frappe.ui.form.on('Loan', { }, mode_of_payment: function (frm) { - frappe.call({ - method: "erpnext.accounts.doctype.sales_invoice.sales_invoice.get_bank_cash_account", - args: { - "mode_of_payment": frm.doc.mode_of_payment, - "company": frm.doc.company - }, - callback: function (r, rt) { - if (r.message) { - frm.set_value("payment_account", r.message.account); + if (frm.doc.mode_of_payment && frm.doc.company) { + frappe.call({ + method: "erpnext.accounts.doctype.sales_invoice.sales_invoice.get_bank_cash_account", + args: { + "mode_of_payment": frm.doc.mode_of_payment, + "company": frm.doc.company + }, + callback: function (r, rt) { + if (r.message) { + frm.set_value("payment_account", r.message.account); + } } - } - }); + }); + } }, loan_application: function (frm) { From 2a8c463079f6630194f9c1bd645228ef20a040c1 Mon Sep 17 00:00:00 2001 From: Nabin Hait Date: Thu, 16 May 2019 13:42:55 +0530 Subject: [PATCH 69/73] fix: show tasks in project order by due date and status --- erpnext/projects/doctype/project/project.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/erpnext/projects/doctype/project/project.py b/erpnext/projects/doctype/project/project.py index a66fac31c5..74e70a9276 100644 --- a/erpnext/projects/doctype/project/project.py +++ b/erpnext/projects/doctype/project/project.py @@ -65,7 +65,7 @@ class Project(Document): 'name': ("not in", self.deleted_task_list) }) - return frappe.get_all("Task", "*", filters, order_by="exp_start_date asc") + return frappe.get_all("Task", "*", filters, order_by="exp_start_date asc, status asc") def validate(self): self.validate_weights() From 3fccfaa7ced60fab4cb6e73f2cae370d3b72c7c7 Mon Sep 17 00:00:00 2001 From: Nabin Hait Date: Thu, 16 May 2019 14:48:10 +0530 Subject: [PATCH 70/73] feat: Added 'Add Multiple' options in all sales / purchase transactions --- erpnext/crm/doctype/opportunity/opportunity.js | 12 +++++++++++- .../doctype/blanket_order/blanket_order.js | 4 ++++ erpnext/public/js/controllers/transaction.js | 1 + erpnext/selling/doctype/sales_order/sales_order.js | 4 ---- .../doctype/material_request/material_request.js | 4 ++++ .../doctype/purchase_receipt/purchase_receipt.js | 4 ---- erpnext/stock/doctype/stock_entry/stock_entry.js | 4 +--- 7 files changed, 21 insertions(+), 12 deletions(-) diff --git a/erpnext/crm/doctype/opportunity/opportunity.js b/erpnext/crm/doctype/opportunity/opportunity.js index 7dafa0e120..78ff339da1 100644 --- a/erpnext/crm/doctype/opportunity/opportunity.js +++ b/erpnext/crm/doctype/opportunity/opportunity.js @@ -21,6 +21,17 @@ frappe.ui.form.on("Opportunity", { frm.trigger('set_contact_link'); }, + onload_post_render: function(frm) { + frm.get_field("items").grid.set_multiple_add("item_code", "qty"); + }, + + party_name: function(frm) { + if (frm.doc.opportunity_from == "Customer") { + frm.trigger('set_contact_link'); + erpnext.utils.get_party_details(frm); + } + }, + with_items: function(frm) { frm.trigger('toggle_mandatory'); }, @@ -180,4 +191,3 @@ cur_frm.cscript.lead = function(doc, cdt, cdn) { frm: cur_frm }); } - diff --git a/erpnext/manufacturing/doctype/blanket_order/blanket_order.js b/erpnext/manufacturing/doctype/blanket_order/blanket_order.js index e2967579fa..59c6d5f555 100644 --- a/erpnext/manufacturing/doctype/blanket_order/blanket_order.js +++ b/erpnext/manufacturing/doctype/blanket_order/blanket_order.js @@ -31,5 +31,9 @@ frappe.ui.form.on('Blanket Order', { }); }).addClass("btn-primary"); } + }, + + onload_post_render: function(frm) { + frm.get_field("items").grid.set_multiple_add("item_code", "qty"); } }); diff --git a/erpnext/public/js/controllers/transaction.js b/erpnext/public/js/controllers/transaction.js index 537ca26a95..7de0e62875 100644 --- a/erpnext/public/js/controllers/transaction.js +++ b/erpnext/public/js/controllers/transaction.js @@ -267,6 +267,7 @@ erpnext.TransactionController = erpnext.taxes_and_totals.extend({ } if(frappe.meta.get_docfield(this.frm.doc.doctype + " Item", "item_code")) { this.setup_item_selector(); + this.frm.get_field("items").grid.set_multiple_add("item_code", "qty"); } }, diff --git a/erpnext/selling/doctype/sales_order/sales_order.js b/erpnext/selling/doctype/sales_order/sales_order.js index dc22b5b0fe..1ded58da24 100644 --- a/erpnext/selling/doctype/sales_order/sales_order.js +++ b/erpnext/selling/doctype/sales_order/sales_order.js @@ -79,10 +79,6 @@ frappe.ui.form.on("Sales Order", { if(!d.delivery_date) d.delivery_date = frm.doc.delivery_date; }); refresh_field("items"); - }, - - onload_post_render: function(frm) { - frm.get_field("items").grid.set_multiple_add("item_code", "qty"); } }); diff --git a/erpnext/stock/doctype/material_request/material_request.js b/erpnext/stock/doctype/material_request/material_request.js index 2735f370a0..893701bf16 100644 --- a/erpnext/stock/doctype/material_request/material_request.js +++ b/erpnext/stock/doctype/material_request/material_request.js @@ -38,6 +38,10 @@ frappe.ui.form.on('Material Request', { }; }, + onload_post_render: function(frm) { + frm.get_field("items").grid.set_multiple_add("item_code", "qty"); + }, + refresh: function(frm) { frm.events.make_custom_buttons(frm); frm.toggle_reqd('customer', frm.doc.material_request_type=="Customer Provided"); diff --git a/erpnext/stock/doctype/purchase_receipt/purchase_receipt.js b/erpnext/stock/doctype/purchase_receipt/purchase_receipt.js index 0123101a36..70c39ec53b 100644 --- a/erpnext/stock/doctype/purchase_receipt/purchase_receipt.js +++ b/erpnext/stock/doctype/purchase_receipt/purchase_receipt.js @@ -26,10 +26,6 @@ frappe.ui.form.on("Purchase Receipt", { }); }, - onload_post_render: function(frm) { - frm.get_field("items").grid.set_multiple_add("item_code", "qty"); - }, - refresh: function(frm) { if(frm.doc.company) { frm.trigger("toggle_display_account_head"); diff --git a/erpnext/stock/doctype/stock_entry/stock_entry.js b/erpnext/stock/doctype/stock_entry/stock_entry.js index bfbcb3cf8d..0b023024f9 100644 --- a/erpnext/stock/doctype/stock_entry/stock_entry.js +++ b/erpnext/stock/doctype/stock_entry/stock_entry.js @@ -639,9 +639,7 @@ erpnext.stock.StockEntry = erpnext.stock.StockController.extend({ } }); - // if(!this.item_selector && false) { - // this.item_selector = new erpnext.ItemSelector({frm: this.frm}); - // } + this.frm.get_field("items").grid.set_multiple_add("item_code", "qty"); }, refresh: function() { From 8a976ba8abeed87d1b05b5062638792b1d812567 Mon Sep 17 00:00:00 2001 From: Shivam Mishra Date: Thu, 16 May 2019 16:38:13 +0530 Subject: [PATCH 71/73] feat: LMS is now compatible with Frappe Theme (#17600) * style: UI fixes for frappe_theme compatibility * chore: minor ui fixes --- .../js/education/lms/components/CardList.vue | 20 +++---- .../education/lms/components/CourseCard.vue | 2 +- .../education/lms/components/ProfileInfo.vue | 56 +++++++++---------- .../education/lms/components/ProgramCard.vue | 2 +- .../js/education/lms/components/Video.vue | 8 +-- .../js/education/lms/pages/ContentPage.vue | 5 +- .../js/education/lms/pages/CoursePage.vue | 4 +- .../public/js/education/lms/pages/Home.vue | 2 +- .../js/education/lms/pages/ListPage.vue | 4 +- .../js/education/lms/pages/ProfilePage.vue | 4 +- .../js/education/lms/pages/ProgramPage.vue | 2 +- 11 files changed, 52 insertions(+), 57 deletions(-) diff --git a/erpnext/public/js/education/lms/components/CardList.vue b/erpnext/public/js/education/lms/components/CardList.vue index 298627f757..10f6af096c 100644 --- a/erpnext/public/js/education/lms/components/CardList.vue +++ b/erpnext/public/js/education/lms/components/CardList.vue @@ -1,18 +1,18 @@ diff --git a/erpnext/public/js/education/lms/components/CourseCard.vue b/erpnext/public/js/education/lms/components/CourseCard.vue index dff896f6f9..48a9f591c7 100644 --- a/erpnext/public/js/education/lms/components/CourseCard.vue +++ b/erpnext/public/js/education/lms/components/CourseCard.vue @@ -8,7 +8,7 @@
{{ course.course_name }}
- {{ course.course_intro }} + {{ course.course_intro.substring(0,120) }}
diff --git a/erpnext/public/js/education/lms/components/ProfileInfo.vue b/erpnext/public/js/education/lms/components/ProfileInfo.vue index 6f3e8f1266..5bad713997 100644 --- a/erpnext/public/js/education/lms/components/ProfileInfo.vue +++ b/erpnext/public/js/education/lms/components/ProfileInfo.vue @@ -1,36 +1,34 @@ diff --git a/erpnext/public/js/education/lms/pages/CoursePage.vue b/erpnext/public/js/education/lms/pages/CoursePage.vue index 9aaf8a9858..dc3d13052b 100644 --- a/erpnext/public/js/education/lms/pages/CoursePage.vue +++ b/erpnext/public/js/education/lms/pages/CoursePage.vue @@ -1,9 +1,9 @@