From d08928071dfd6a6bb8769456081744f58512ab55 Mon Sep 17 00:00:00 2001 From: maniamartial Date: Tue, 21 May 2024 17:33:24 +0300 Subject: [PATCH] Activity mapper, workspace under payrol --- nl_piece_rate_pay/hooks.py | 3 +++ .../client_scripts/activity_type_mapper.js | 10 ++++++++++ .../casual_activity_item/casual_activity_item.json | 6 +++--- .../casual_payment_record.json | 2 +- .../casual_payroll_payout.json | 2 +- .../casual_payroll_payout_employee.json | 2 +- .../casual_payroll_payout_item.json | 2 +- .../casual_piece_rate/casual_piece_rate.json | 13 +++++++------ 8 files changed, 27 insertions(+), 13 deletions(-) create mode 100644 nl_piece_rate_pay/nl_piece_rate_pay/client_scripts/activity_type_mapper.js diff --git a/nl_piece_rate_pay/hooks.py b/nl_piece_rate_pay/hooks.py index 27a4f19..3130804 100644 --- a/nl_piece_rate_pay/hooks.py +++ b/nl_piece_rate_pay/hooks.py @@ -20,6 +20,9 @@ }, ] + +doctype_js = {"Activity Type" : "nl_piece_rate_pay/client_scripts/activity_type_mapper.js"} + # Includes in # ------------------ diff --git a/nl_piece_rate_pay/nl_piece_rate_pay/client_scripts/activity_type_mapper.js b/nl_piece_rate_pay/nl_piece_rate_pay/client_scripts/activity_type_mapper.js new file mode 100644 index 0000000..24e95b3 --- /dev/null +++ b/nl_piece_rate_pay/nl_piece_rate_pay/client_scripts/activity_type_mapper.js @@ -0,0 +1,10 @@ + +frappe.ui.form.on('Activity Type', { + refresh: function(frm) { + + frm.add_custom_button(__("Casual Item Cost"), function () { + frappe.route_options = { activity_type: frm.doc.name }; + frappe.set_route("List", "Casual Activity Item"); + }); + } +}); diff --git a/nl_piece_rate_pay/nl_piece_rate_pay/doctype/casual_activity_item/casual_activity_item.json b/nl_piece_rate_pay/nl_piece_rate_pay/doctype/casual_activity_item/casual_activity_item.json index d35969c..06dba8a 100644 --- a/nl_piece_rate_pay/nl_piece_rate_pay/doctype/casual_activity_item/casual_activity_item.json +++ b/nl_piece_rate_pay/nl_piece_rate_pay/doctype/casual_activity_item/casual_activity_item.json @@ -57,7 +57,7 @@ }, { "default": "0", - "description": "per day", + "description": "per item", "fieldname": "costing_rate", "fieldtype": "Currency", "label": "Costing Rate" @@ -76,9 +76,9 @@ } ], "links": [], - "modified": "2024-04-23 07:58:13.804557", + "modified": "2024-05-21 17:23:40.990331", "modified_by": "Administrator", - "module": "CSF KE", + "module": "NL Piece Rate Pay", "name": "Casual Activity Item", "naming_rule": "Expression (old style)", "owner": "Administrator", diff --git a/nl_piece_rate_pay/nl_piece_rate_pay/doctype/casual_payment_record/casual_payment_record.json b/nl_piece_rate_pay/nl_piece_rate_pay/doctype/casual_payment_record/casual_payment_record.json index 11bbab6..f597872 100644 --- a/nl_piece_rate_pay/nl_piece_rate_pay/doctype/casual_payment_record/casual_payment_record.json +++ b/nl_piece_rate_pay/nl_piece_rate_pay/doctype/casual_payment_record/casual_payment_record.json @@ -37,7 +37,7 @@ "links": [], "modified": "2024-04-28 08:27:43.330454", "modified_by": "Administrator", - "module": "CSF KE", + "module": "NL Piece Rate Pay", "name": "Casual Payment Record", "owner": "Administrator", "permissions": [], diff --git a/nl_piece_rate_pay/nl_piece_rate_pay/doctype/casual_payroll_payout/casual_payroll_payout.json b/nl_piece_rate_pay/nl_piece_rate_pay/doctype/casual_payroll_payout/casual_payroll_payout.json index ffd5b24..eaef700 100644 --- a/nl_piece_rate_pay/nl_piece_rate_pay/doctype/casual_payroll_payout/casual_payroll_payout.json +++ b/nl_piece_rate_pay/nl_piece_rate_pay/doctype/casual_payroll_payout/casual_payroll_payout.json @@ -150,7 +150,7 @@ "links": [], "modified": "2024-04-24 12:56:07.842413", "modified_by": "Administrator", - "module": "CSF KE", + "module": "NL Piece Rate Pay", "name": "Casual Payroll Payout", "naming_rule": "Expression", "owner": "Administrator", diff --git a/nl_piece_rate_pay/nl_piece_rate_pay/doctype/casual_payroll_payout_employee/casual_payroll_payout_employee.json b/nl_piece_rate_pay/nl_piece_rate_pay/doctype/casual_payroll_payout_employee/casual_payroll_payout_employee.json index 433d094..75066cc 100644 --- a/nl_piece_rate_pay/nl_piece_rate_pay/doctype/casual_payroll_payout_employee/casual_payroll_payout_employee.json +++ b/nl_piece_rate_pay/nl_piece_rate_pay/doctype/casual_payroll_payout_employee/casual_payroll_payout_employee.json @@ -71,7 +71,7 @@ "links": [], "modified": "2024-04-24 12:54:32.929154", "modified_by": "Administrator", - "module": "CSF KE", + "module": "NL Piece Rate Pay", "name": "Casual Payroll Payout Employee", "owner": "Administrator", "permissions": [], diff --git a/nl_piece_rate_pay/nl_piece_rate_pay/doctype/casual_payroll_payout_item/casual_payroll_payout_item.json b/nl_piece_rate_pay/nl_piece_rate_pay/doctype/casual_payroll_payout_item/casual_payroll_payout_item.json index 97a8e61..fb49dd5 100644 --- a/nl_piece_rate_pay/nl_piece_rate_pay/doctype/casual_payroll_payout_item/casual_payroll_payout_item.json +++ b/nl_piece_rate_pay/nl_piece_rate_pay/doctype/casual_payroll_payout_item/casual_payroll_payout_item.json @@ -64,7 +64,7 @@ "links": [], "modified": "2024-04-22 12:42:45.132037", "modified_by": "Administrator", - "module": "CSF KE", + "module": "NL Piece Rate Pay", "name": "Casual Payroll Payout Item", "owner": "Administrator", "permissions": [], diff --git a/nl_piece_rate_pay/nl_piece_rate_pay/workspace/casual_piece_rate/casual_piece_rate.json b/nl_piece_rate_pay/nl_piece_rate_pay/workspace/casual_piece_rate/casual_piece_rate.json index f70b1e7..a649253 100644 --- a/nl_piece_rate_pay/nl_piece_rate_pay/workspace/casual_piece_rate/casual_piece_rate.json +++ b/nl_piece_rate_pay/nl_piece_rate_pay/workspace/casual_piece_rate/casual_piece_rate.json @@ -1,7 +1,7 @@ { "charts": [], - "content": "[{\"id\":\"TFGWHXtT34\",\"type\":\"header\",\"data\":{\"text\":\"Casual Piece Rate\",\"col\":12}},{\"id\":\"SIfGwCveBT\",\"type\":\"shortcut\",\"data\":{\"shortcut_name\":\"Casual Activity Item\",\"col\":3}},{\"id\":\"CeZ63AmI5-\",\"type\":\"shortcut\",\"data\":{\"shortcut_name\":\"Casual Salary Structure Assignment Tool\",\"col\":3}},{\"id\":\"Z5YADe8s5V\",\"type\":\"shortcut\",\"data\":{\"shortcut_name\":\"Casual Payroll Payout\",\"col\":3}}]", - "creation": "2024-05-20 09:37:30.945724", + "content": "[{\"id\":\"9HGm55y889\",\"type\":\"header\",\"data\":{\"text\":\"Casual Piece Rate\",\"col\":12}},{\"id\":\"TIbQgaOmvH\",\"type\":\"shortcut\",\"data\":{\"shortcut_name\":\"Casual Activity Item\",\"col\":4}},{\"id\":\"RlDQdF5EOc\",\"type\":\"shortcut\",\"data\":{\"shortcut_name\":\"Casual Salary Structure Assignment Tool\",\"col\":4}},{\"id\":\"JCgieJP-fC\",\"type\":\"shortcut\",\"data\":{\"shortcut_name\":\"Casual Daily Payroll Payout\",\"col\":4}}]", + "creation": "2024-05-21 17:19:45.641814", "custom_blocks": [], "docstatus": 0, "doctype": "Workspace", @@ -9,20 +9,21 @@ "hide_custom": 0, "icon": "money-coins-1", "idx": 0, + "indicator_color": "green", "is_hidden": 0, "label": "Casual Piece Rate", "links": [], - "modified": "2024-05-20 09:39:21.348316", + "modified": "2024-05-21 17:21:49.926551", "modified_by": "Administrator", "module": "NL Piece Rate Pay", "name": "Casual Piece Rate", "number_cards": [], "owner": "Administrator", - "parent_page": "", + "parent_page": "Payroll", "public": 1, "quick_lists": [], "roles": [], - "sequence_id": 58.0, + "sequence_id": 46.0, "shortcuts": [ { "color": "Grey", @@ -43,7 +44,7 @@ { "color": "Grey", "doc_view": "List", - "label": "Casual Payroll Payout", + "label": "Casual Daily Payroll Payout", "link_to": "Casual Payroll Payout", "stats_filter": "[]", "type": "DocType"