From d62077be592cef1b71e186fdd6f9a181721ea169 Mon Sep 17 00:00:00 2001 From: Glen Whitney Date: Tue, 17 Nov 2020 06:01:06 +0000 Subject: [PATCH] feat: Add first two doctypes --- .../doctype/__init__.py | 0 .../doctype/jw_account_mapping/__init__.py | 0 .../jw_account_mapping/jw_account_mapping.js | 8 + .../jw_account_mapping.json | 97 ++++++++++++ .../jw_account_mapping/jw_account_mapping.py | 10 ++ .../test_jw_account_mapping.py | 10 ++ .../jw_employee_allocation/__init__.py | 0 .../jw_employee_allocation.js | 8 + .../jw_employee_allocation.json | 143 ++++++++++++++++++ .../jw_employee_allocation.py | 10 ++ .../test_jw_employee_allocation.py | 10 ++ 11 files changed, 296 insertions(+) create mode 100644 justworks_erpnext/justworks_erpnext_connector/doctype/__init__.py create mode 100644 justworks_erpnext/justworks_erpnext_connector/doctype/jw_account_mapping/__init__.py create mode 100644 justworks_erpnext/justworks_erpnext_connector/doctype/jw_account_mapping/jw_account_mapping.js create mode 100644 justworks_erpnext/justworks_erpnext_connector/doctype/jw_account_mapping/jw_account_mapping.json create mode 100644 justworks_erpnext/justworks_erpnext_connector/doctype/jw_account_mapping/jw_account_mapping.py create mode 100644 justworks_erpnext/justworks_erpnext_connector/doctype/jw_account_mapping/test_jw_account_mapping.py create mode 100644 justworks_erpnext/justworks_erpnext_connector/doctype/jw_employee_allocation/__init__.py create mode 100644 justworks_erpnext/justworks_erpnext_connector/doctype/jw_employee_allocation/jw_employee_allocation.js create mode 100644 justworks_erpnext/justworks_erpnext_connector/doctype/jw_employee_allocation/jw_employee_allocation.json create mode 100644 justworks_erpnext/justworks_erpnext_connector/doctype/jw_employee_allocation/jw_employee_allocation.py create mode 100644 justworks_erpnext/justworks_erpnext_connector/doctype/jw_employee_allocation/test_jw_employee_allocation.py diff --git a/justworks_erpnext/justworks_erpnext_connector/doctype/__init__.py b/justworks_erpnext/justworks_erpnext_connector/doctype/__init__.py new file mode 100644 index 0000000..e69de29 diff --git a/justworks_erpnext/justworks_erpnext_connector/doctype/jw_account_mapping/__init__.py b/justworks_erpnext/justworks_erpnext_connector/doctype/jw_account_mapping/__init__.py new file mode 100644 index 0000000..e69de29 diff --git a/justworks_erpnext/justworks_erpnext_connector/doctype/jw_account_mapping/jw_account_mapping.js b/justworks_erpnext/justworks_erpnext_connector/doctype/jw_account_mapping/jw_account_mapping.js new file mode 100644 index 0000000..11fbf40 --- /dev/null +++ b/justworks_erpnext/justworks_erpnext_connector/doctype/jw_account_mapping/jw_account_mapping.js @@ -0,0 +1,8 @@ +// Copyright (c) 2020, Studio Infinity and contributors +// For license information, please see license.txt + +frappe.ui.form.on('JW Account Mapping', { + // refresh: function(frm) { + + // } +}); diff --git a/justworks_erpnext/justworks_erpnext_connector/doctype/jw_account_mapping/jw_account_mapping.json b/justworks_erpnext/justworks_erpnext_connector/doctype/jw_account_mapping/jw_account_mapping.json new file mode 100644 index 0000000..313632d --- /dev/null +++ b/justworks_erpnext/justworks_erpnext_connector/doctype/jw_account_mapping/jw_account_mapping.json @@ -0,0 +1,97 @@ +{ + "actions": [], + "allow_import": 1, + "allow_rename": 1, + "autoname": "format:{charge_type} - {charge_subtype}", + "creation": "2020-11-16 23:00:45.241794", + "description": "Each JW Account Mapping document specifies the ERPNext Account to be used for a line in a Justworks invoice that is being imported as an ERPNext Journal Entry. If the Map to Account field is left empty, then lines with the give Charge (type and subtype) will be ignored.", + "doctype": "DocType", + "document_type": "Setup", + "editable_grid": 1, + "engine": "InnoDB", + "field_order": [ + "charge_type", + "charge_subtype", + "map_to_account" + ], + "fields": [ + { + "description": "The value of the \"Charge type\" column in a Justworks invoice that this mapping should apply to. Wild card characters ? (to match any single character in the value) and * (to match any sequence of characters in the value) are allowed.", + "fieldname": "charge_type", + "fieldtype": "Data", + "in_list_view": 1, + "in_standard_filter": 1, + "label": "Charge Type", + "reqd": 1 + }, + { + "bold": 1, + "description": "The value of the \"Charge subtype\" column in a Justworks invoice that this mapping should apply to. Wild card characters ? (to match any single character in the value) and * (to match any sequence of characters in the value) are allowed.", + "fieldname": "charge_subtype", + "fieldtype": "Data", + "in_list_view": 1, + "in_standard_filter": 1, + "label": "Charge Subtype", + "reqd": 1 + }, + { + "allow_in_quick_entry": 1, + "bold": 1, + "description": "The ERPNext account that the specified Charge (type and subtype) should map to.", + "fieldname": "map_to_account", + "fieldtype": "Link", + "in_list_view": 1, + "in_standard_filter": 1, + "label": "Map to Account", + "options": "Account" + } + ], + "index_web_pages_for_search": 1, + "links": [], + "modified": "2020-11-17 00:08:38.932239", + "modified_by": "Administrator", + "module": "Justworks ERPNext Connector", + "name": "JW Account Mapping", + "owner": "Administrator", + "permissions": [ + { + "create": 1, + "delete": 1, + "email": 1, + "export": 1, + "print": 1, + "read": 1, + "report": 1, + "role": "System Manager", + "share": 1, + "write": 1 + }, + { + "create": 1, + "email": 1, + "export": 1, + "print": 1, + "read": 1, + "report": 1, + "role": "Accounts User", + "share": 1 + }, + { + "create": 1, + "delete": 1, + "email": 1, + "export": 1, + "print": 1, + "read": 1, + "report": 1, + "role": "Accounts Manager", + "share": 1, + "write": 1 + } + ], + "quick_entry": 1, + "show_name_in_global_search": 1, + "sort_field": "modified", + "sort_order": "DESC", + "track_changes": 1 +} \ No newline at end of file diff --git a/justworks_erpnext/justworks_erpnext_connector/doctype/jw_account_mapping/jw_account_mapping.py b/justworks_erpnext/justworks_erpnext_connector/doctype/jw_account_mapping/jw_account_mapping.py new file mode 100644 index 0000000..025b058 --- /dev/null +++ b/justworks_erpnext/justworks_erpnext_connector/doctype/jw_account_mapping/jw_account_mapping.py @@ -0,0 +1,10 @@ +# -*- coding: utf-8 -*- +# Copyright (c) 2020, Studio Infinity and contributors +# For license information, please see license.txt + +from __future__ import unicode_literals +# import frappe +from frappe.model.document import Document + +class JWAccountMapping(Document): + pass diff --git a/justworks_erpnext/justworks_erpnext_connector/doctype/jw_account_mapping/test_jw_account_mapping.py b/justworks_erpnext/justworks_erpnext_connector/doctype/jw_account_mapping/test_jw_account_mapping.py new file mode 100644 index 0000000..c5cde97 --- /dev/null +++ b/justworks_erpnext/justworks_erpnext_connector/doctype/jw_account_mapping/test_jw_account_mapping.py @@ -0,0 +1,10 @@ +# -*- coding: utf-8 -*- +# Copyright (c) 2020, Studio Infinity and Contributors +# See license.txt +from __future__ import unicode_literals + +# import frappe +import unittest + +class TestJWAccountMapping(unittest.TestCase): + pass diff --git a/justworks_erpnext/justworks_erpnext_connector/doctype/jw_employee_allocation/__init__.py b/justworks_erpnext/justworks_erpnext_connector/doctype/jw_employee_allocation/__init__.py new file mode 100644 index 0000000..e69de29 diff --git a/justworks_erpnext/justworks_erpnext_connector/doctype/jw_employee_allocation/jw_employee_allocation.js b/justworks_erpnext/justworks_erpnext_connector/doctype/jw_employee_allocation/jw_employee_allocation.js new file mode 100644 index 0000000..0d06895 --- /dev/null +++ b/justworks_erpnext/justworks_erpnext_connector/doctype/jw_employee_allocation/jw_employee_allocation.js @@ -0,0 +1,8 @@ +// Copyright (c) 2020, Studio Infinity and contributors +// For license information, please see license.txt + +frappe.ui.form.on('JW Employee Allocation', { + // refresh: function(frm) { + + // } +}); diff --git a/justworks_erpnext/justworks_erpnext_connector/doctype/jw_employee_allocation/jw_employee_allocation.json b/justworks_erpnext/justworks_erpnext_connector/doctype/jw_employee_allocation/jw_employee_allocation.json new file mode 100644 index 0000000..a109746 --- /dev/null +++ b/justworks_erpnext/justworks_erpnext_connector/doctype/jw_employee_allocation/jw_employee_allocation.json @@ -0,0 +1,143 @@ +{ + "actions": [], + "allow_import": 1, + "allow_rename": 1, + "autoname": "format:{employee_name}_{####}", + "creation": "2020-11-17 00:49:16.498573", + "description": "Each JW Employee Allocation document represents a portion of the charges related to a given employee in a Justworks invoice that will be allocated to the accounting dimensions specified. The total percentage of all of the allocations active on a given date (i.e., the given date is between the Start Date and End Date of the record) must sum to 100%.", + "doctype": "DocType", + "editable_grid": 1, + "engine": "InnoDB", + "field_order": [ + "employee", + "employee_name", + "start_date", + "end_date", + "percentage", + "accounting_dimensions_section", + "cost_center", + "dimension_col_break", + "amended_from" + ], + "fields": [ + { + "fieldname": "employee", + "fieldtype": "Link", + "label": "Employee", + "options": "Employee", + "reqd": 1 + }, + { + "default": "employee.employee_name", + "fieldname": "employee_name", + "fieldtype": "Data", + "in_list_view": 1, + "label": "Employee Name", + "read_only": 1 + }, + { + "default": "Today", + "description": "The initial date this allocation is valid", + "fieldname": "start_date", + "fieldtype": "Date", + "in_list_view": 1, + "label": "Start Date", + "reqd": 1 + }, + { + "allow_on_submit": 1, + "description": "The final date this allocation is valid. Leave blank for currently valid allocations.", + "fieldname": "end_date", + "fieldtype": "Date", + "in_list_view": 1, + "label": "End Date" + }, + { + "description": "What percent of the employee's costs go to this allocation", + "fieldname": "percentage", + "fieldtype": "Percent", + "in_list_view": 1, + "label": "Percentage", + "reqd": 1 + }, + { + "fieldname": "accounting_dimensions_section", + "fieldtype": "Section Break", + "label": "Accounting Dimensions" + }, + { + "fieldname": "cost_center", + "fieldtype": "Link", + "in_list_view": 1, + "label": "Cost Center", + "options": "Cost Center", + "reqd": 1 + }, + { + "fieldname": "dimension_col_break", + "fieldtype": "Column Break" + }, + { + "fieldname": "amended_from", + "fieldtype": "Link", + "label": "Amended From", + "no_copy": 1, + "options": "JW Employee Allocation", + "print_hide": 1, + "read_only": 1 + } + ], + "index_web_pages_for_search": 1, + "is_submittable": 1, + "links": [], + "modified": "2020-11-17 00:49:16.498573", + "modified_by": "Administrator", + "module": "Justworks ERPNext Connector", + "name": "JW Employee Allocation", + "owner": "Administrator", + "permissions": [ + { + "cancel": 1, + "create": 1, + "delete": 1, + "email": 1, + "export": 1, + "print": 1, + "read": 1, + "report": 1, + "role": "System Manager", + "share": 1, + "submit": 1, + "write": 1 + }, + { + "cancel": 1, + "create": 1, + "delete": 1, + "email": 1, + "export": 1, + "print": 1, + "read": 1, + "report": 1, + "role": "Accounts Manager", + "share": 1, + "submit": 1, + "write": 1 + }, + { + "create": 1, + "email": 1, + "export": 1, + "print": 1, + "read": 1, + "report": 1, + "role": "Accounts User", + "share": 1, + "submit": 1, + "write": 1 + } + ], + "sort_field": "modified", + "sort_order": "DESC", + "track_changes": 1 +} \ No newline at end of file diff --git a/justworks_erpnext/justworks_erpnext_connector/doctype/jw_employee_allocation/jw_employee_allocation.py b/justworks_erpnext/justworks_erpnext_connector/doctype/jw_employee_allocation/jw_employee_allocation.py new file mode 100644 index 0000000..8b966d5 --- /dev/null +++ b/justworks_erpnext/justworks_erpnext_connector/doctype/jw_employee_allocation/jw_employee_allocation.py @@ -0,0 +1,10 @@ +# -*- coding: utf-8 -*- +# Copyright (c) 2020, Studio Infinity and contributors +# For license information, please see license.txt + +from __future__ import unicode_literals +# import frappe +from frappe.model.document import Document + +class JWEmployeeAllocation(Document): + pass diff --git a/justworks_erpnext/justworks_erpnext_connector/doctype/jw_employee_allocation/test_jw_employee_allocation.py b/justworks_erpnext/justworks_erpnext_connector/doctype/jw_employee_allocation/test_jw_employee_allocation.py new file mode 100644 index 0000000..afa6c5f --- /dev/null +++ b/justworks_erpnext/justworks_erpnext_connector/doctype/jw_employee_allocation/test_jw_employee_allocation.py @@ -0,0 +1,10 @@ +# -*- coding: utf-8 -*- +# Copyright (c) 2020, Studio Infinity and Contributors +# See license.txt +from __future__ import unicode_literals + +# import frappe +import unittest + +class TestJWEmployeeAllocation(unittest.TestCase): + pass