Merge pull request #13808 from mntechnique/cost-center-number
Cost center number
diff --git a/erpnext/accounts/doctype/account/account.json b/erpnext/accounts/doctype/account/account.json
index 7e118f0..668164c 100644
--- a/erpnext/accounts/doctype/account/account.json
+++ b/erpnext/accounts/doctype/account/account.json
@@ -1,711 +1,738 @@
{
- "allow_copy": 1,
- "allow_guest_to_view": 0,
- "allow_import": 1,
- "allow_rename": 1,
- "beta": 0,
- "creation": "2013-01-30 12:49:46",
- "custom": 0,
- "description": "Heads (or groups) against which Accounting Entries are made and balances are maintained.",
- "docstatus": 0,
- "doctype": "DocType",
- "document_type": "Setup",
- "editable_grid": 0,
+ "allow_copy": 1,
+ "allow_guest_to_view": 0,
+ "allow_import": 1,
+ "allow_rename": 1,
+ "beta": 0,
+ "creation": "2013-01-30 12:49:46",
+ "custom": 0,
+ "description": "Heads (or groups) against which Accounting Entries are made and balances are maintained.",
+ "docstatus": 0,
+ "doctype": "DocType",
+ "document_type": "Setup",
+ "editable_grid": 0,
"fields": [
{
- "allow_bulk_edit": 0,
- "allow_on_submit": 0,
- "bold": 0,
- "collapsible": 0,
- "columns": 0,
- "fieldname": "properties",
- "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_on_submit": 0,
+ "bold": 0,
+ "collapsible": 0,
+ "columns": 0,
+ "fieldname": "properties",
+ "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_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,
- "print_hide": 0,
- "print_hide_if_no_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_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,
+ "print_hide": 0,
+ "print_hide_if_no_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_on_submit": 0,
- "bold": 0,
- "collapsible": 0,
- "columns": 0,
- "fieldname": "account_name",
- "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": "Account Name",
- "length": 0,
- "no_copy": 1,
- "oldfieldname": "account_name",
- "oldfieldtype": "Data",
- "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_on_submit": 0,
+ "bold": 0,
+ "collapsible": 0,
+ "columns": 0,
+ "fieldname": "account_name",
+ "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": "Account Name",
+ "length": 0,
+ "no_copy": 1,
+ "oldfieldname": "account_name",
+ "oldfieldtype": "Data",
+ "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_on_submit": 0,
- "bold": 0,
- "collapsible": 0,
- "columns": 0,
- "fieldname": "account_number",
- "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": 1,
- "label": "Account 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_on_submit": 0,
+ "bold": 0,
+ "collapsible": 0,
+ "columns": 0,
+ "fieldname": "account_number",
+ "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": 1,
+ "label": "Account 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_on_submit": 0,
- "bold": 0,
- "collapsible": 0,
- "columns": 0,
- "default": "0",
- "fieldname": "is_group",
- "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 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,
+ "allow_bulk_edit": 0,
+ "allow_on_submit": 0,
+ "bold": 0,
+ "collapsible": 0,
+ "columns": 0,
+ "default": "0",
+ "fieldname": "is_group",
+ "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 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
- },
+ },
{
- "allow_bulk_edit": 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": 0,
- "in_standard_filter": 1,
- "label": "Company",
- "length": 0,
- "no_copy": 0,
- "oldfieldname": "company",
- "oldfieldtype": "Link",
- "options": "Company",
- "permlevel": 0,
- "print_hide": 0,
- "print_hide_if_no_value": 0,
- "read_only": 1,
- "remember_last_selected_value": 1,
- "report_hide": 0,
- "reqd": 1,
- "search_index": 0,
- "set_only_once": 0,
- "translatable": 0,
+ "allow_bulk_edit": 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": 0,
+ "in_standard_filter": 1,
+ "label": "Company",
+ "length": 0,
+ "no_copy": 0,
+ "oldfieldname": "company",
+ "oldfieldtype": "Link",
+ "options": "Company",
+ "permlevel": 0,
+ "print_hide": 0,
+ "print_hide_if_no_value": 0,
+ "read_only": 1,
+ "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_on_submit": 0,
- "bold": 0,
- "collapsible": 0,
- "columns": 0,
- "fieldname": "root_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": 1,
- "label": "Root Type",
- "length": 0,
- "no_copy": 0,
- "options": "\nAsset\nLiability\nIncome\nExpense\nEquity",
- "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_on_submit": 0,
+ "bold": 0,
+ "collapsible": 0,
+ "columns": 0,
+ "fieldname": "root_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": 1,
+ "label": "Root Type",
+ "length": 0,
+ "no_copy": 0,
+ "options": "\nAsset\nLiability\nIncome\nExpense\nEquity",
+ "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_on_submit": 0,
- "bold": 0,
- "collapsible": 0,
- "columns": 0,
- "fieldname": "report_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": 1,
- "label": "Report Type",
- "length": 0,
- "no_copy": 0,
- "options": "\nBalance Sheet\nProfit and Loss",
- "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_on_submit": 0,
+ "bold": 0,
+ "collapsible": 0,
+ "columns": 0,
+ "fieldname": "report_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": 1,
+ "label": "Report Type",
+ "length": 0,
+ "no_copy": 0,
+ "options": "\nBalance Sheet\nProfit and Loss",
+ "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_on_submit": 0,
- "bold": 0,
- "collapsible": 0,
- "columns": 0,
- "depends_on": "eval:doc.is_group==0",
- "fieldname": "account_currency",
- "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": "Currency",
- "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_on_submit": 0,
+ "bold": 0,
+ "collapsible": 0,
+ "columns": 0,
+ "depends_on": "eval:doc.is_group==0",
+ "fieldname": "account_currency",
+ "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": "Currency",
+ "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_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,
- "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_on_submit": 0,
+ "bold": 0,
+ "collapsible": 0,
+ "columns": 0,
+ "default": "0",
+ "fieldname": "inter_company_account",
+ "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": "Inter Company Account",
+ "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_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,
+ "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_on_submit": 0,
- "bold": 0,
- "collapsible": 0,
- "columns": 0,
- "fieldname": "parent_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": "Parent Account",
- "length": 0,
- "no_copy": 0,
- "oldfieldname": "parent_account",
- "oldfieldtype": "Link",
- "options": "Account",
- "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_on_submit": 0,
+ "bold": 0,
+ "collapsible": 0,
+ "columns": 0,
+ "fieldname": "parent_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": "Parent Account",
+ "length": 0,
+ "no_copy": 0,
+ "oldfieldname": "parent_account",
+ "oldfieldtype": "Link",
+ "options": "Account",
+ "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_on_submit": 0,
- "bold": 0,
- "collapsible": 0,
- "columns": 0,
- "description": "Setting Account Type helps in selecting this Account in transactions.",
- "fieldname": "account_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": 1,
- "label": "Account Type",
- "length": 0,
- "no_copy": 0,
- "oldfieldname": "account_type",
- "oldfieldtype": "Select",
- "options": "\nAccumulated Depreciation\nBank\nCash\nChargeable\nCost of Goods Sold\nDepreciation\nEquity\nExpense Account\nExpenses Included In Valuation\nFixed Asset\nIncome Account\nPayable\nReceivable\nRound Off\nStock\nStock Adjustment\nStock Received But Not Billed\nTax\nTemporary",
- "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_on_submit": 0,
+ "bold": 0,
+ "collapsible": 0,
+ "columns": 0,
+ "description": "Setting Account Type helps in selecting this Account in transactions.",
+ "fieldname": "account_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": 1,
+ "label": "Account Type",
+ "length": 0,
+ "no_copy": 0,
+ "oldfieldname": "account_type",
+ "oldfieldtype": "Select",
+ "options": "\nAccumulated Depreciation\nBank\nCash\nChargeable\nCost of Goods Sold\nDepreciation\nEquity\nExpense Account\nExpenses Included In Valuation\nFixed Asset\nIncome Account\nPayable\nReceivable\nRound Off\nStock\nStock Adjustment\nStock Received But Not Billed\nTax\nTemporary",
+ "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_on_submit": 0,
- "bold": 0,
- "collapsible": 0,
- "columns": 0,
- "description": "Rate at which this tax is applied",
- "fieldname": "tax_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": "Rate",
- "length": 0,
- "no_copy": 0,
- "oldfieldname": "tax_rate",
- "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_on_submit": 0,
+ "bold": 0,
+ "collapsible": 0,
+ "columns": 0,
+ "description": "Rate at which this tax is applied",
+ "fieldname": "tax_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": "Rate",
+ "length": 0,
+ "no_copy": 0,
+ "oldfieldname": "tax_rate",
+ "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_on_submit": 0,
- "bold": 0,
- "collapsible": 0,
- "columns": 0,
- "description": "If the account is frozen, entries are allowed to restricted users.",
- "fieldname": "freeze_account",
- "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": "Frozen",
- "length": 0,
- "no_copy": 0,
- "oldfieldname": "freeze_account",
- "oldfieldtype": "Select",
- "options": "No\nYes",
- "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_on_submit": 0,
+ "bold": 0,
+ "collapsible": 0,
+ "columns": 0,
+ "description": "If the account is frozen, entries are allowed to restricted users.",
+ "fieldname": "freeze_account",
+ "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": "Frozen",
+ "length": 0,
+ "no_copy": 0,
+ "oldfieldname": "freeze_account",
+ "oldfieldtype": "Select",
+ "options": "No\nYes",
+ "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_on_submit": 0,
- "bold": 0,
- "collapsible": 0,
- "columns": 0,
- "fieldname": "balance_must_be",
- "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": "Balance must be",
- "length": 0,
- "no_copy": 0,
- "options": "\nDebit\nCredit",
- "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_on_submit": 0,
+ "bold": 0,
+ "collapsible": 0,
+ "columns": 0,
+ "fieldname": "balance_must_be",
+ "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": "Balance must be",
+ "length": 0,
+ "no_copy": 0,
+ "options": "\nDebit\nCredit",
+ "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_on_submit": 0,
- "bold": 0,
- "collapsible": 0,
- "columns": 0,
- "fieldname": "lft",
- "fieldtype": "Int",
- "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": "Lft",
- "length": 0,
- "no_copy": 0,
- "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": 1,
- "set_only_once": 0,
- "translatable": 0,
+ "allow_bulk_edit": 0,
+ "allow_on_submit": 0,
+ "bold": 0,
+ "collapsible": 0,
+ "columns": 0,
+ "fieldname": "lft",
+ "fieldtype": "Int",
+ "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": "Lft",
+ "length": 0,
+ "no_copy": 0,
+ "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": 1,
+ "set_only_once": 0,
+ "translatable": 0,
"unique": 0
- },
+ },
{
- "allow_bulk_edit": 0,
- "allow_on_submit": 0,
- "bold": 0,
- "collapsible": 0,
- "columns": 0,
- "fieldname": "rgt",
- "fieldtype": "Int",
- "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": "Rgt",
- "length": 0,
- "no_copy": 0,
- "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": 1,
- "set_only_once": 0,
- "translatable": 0,
+ "allow_bulk_edit": 0,
+ "allow_on_submit": 0,
+ "bold": 0,
+ "collapsible": 0,
+ "columns": 0,
+ "fieldname": "rgt",
+ "fieldtype": "Int",
+ "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": "Rgt",
+ "length": 0,
+ "no_copy": 0,
+ "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": 1,
+ "set_only_once": 0,
+ "translatable": 0,
"unique": 0
- },
+ },
{
- "allow_bulk_edit": 0,
- "allow_on_submit": 0,
- "bold": 0,
- "collapsible": 0,
- "columns": 0,
- "fieldname": "old_parent",
- "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": "Old Parent",
- "length": 0,
- "no_copy": 0,
- "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_on_submit": 0,
+ "bold": 0,
+ "collapsible": 0,
+ "columns": 0,
+ "fieldname": "old_parent",
+ "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": "Old Parent",
+ "length": 0,
+ "no_copy": 0,
+ "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-money",
- "idx": 1,
- "image_view": 0,
- "in_create": 0,
- "is_submittable": 0,
- "issingle": 0,
- "istable": 0,
- "max_attachments": 0,
- "modified": "2018-04-04 03:23:20.011949",
- "modified_by": "Administrator",
- "module": "Accounts",
- "name": "Account",
- "owner": "Administrator",
+ ],
+ "has_web_view": 0,
+ "hide_heading": 0,
+ "hide_toolbar": 0,
+ "icon": "fa fa-money",
+ "idx": 1,
+ "image_view": 0,
+ "in_create": 0,
+ "is_submittable": 0,
+ "issingle": 0,
+ "istable": 0,
+ "max_attachments": 0,
+ "modified": "2018-05-02 11:00:34.108490",
+ "modified_by": "Administrator",
+ "module": "Accounts",
+ "name": "Account",
+ "owner": "Administrator",
"permissions": [
{
- "amend": 0,
- "apply_user_permissions": 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": "Accounts User",
- "set_user_permissions": 0,
- "share": 1,
- "submit": 0,
+ "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": "Accounts User",
+ "set_user_permissions": 0,
+ "share": 1,
+ "submit": 0,
"write": 1
- },
+ },
{
- "amend": 0,
- "apply_user_permissions": 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": "Auditor",
- "set_user_permissions": 0,
- "share": 0,
- "submit": 0,
+ "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": "Auditor",
+ "set_user_permissions": 0,
+ "share": 0,
+ "submit": 0,
"write": 0
- },
+ },
{
- "amend": 0,
- "apply_user_permissions": 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": "Sales User",
- "set_user_permissions": 0,
- "share": 0,
- "submit": 0,
+ "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": "Sales User",
+ "set_user_permissions": 0,
+ "share": 0,
+ "submit": 0,
"write": 0
- },
+ },
{
- "amend": 0,
- "apply_user_permissions": 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": "Purchase User",
- "set_user_permissions": 0,
- "share": 0,
- "submit": 0,
+ "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": "Purchase User",
+ "set_user_permissions": 0,
+ "share": 0,
+ "submit": 0,
"write": 0
- },
+ },
{
- "amend": 0,
- "apply_user_permissions": 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": "Accounts Manager",
- "set_user_permissions": 1,
- "share": 1,
- "submit": 0,
+ "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": "Accounts Manager",
+ "set_user_permissions": 1,
+ "share": 1,
+ "submit": 0,
"write": 1
}
- ],
- "quick_entry": 0,
- "read_only": 0,
- "read_only_onload": 0,
- "search_fields": "account_number",
- "show_name_in_global_search": 1,
- "sort_order": "ASC",
- "track_changes": 1,
+ ],
+ "quick_entry": 0,
+ "read_only": 0,
+ "read_only_onload": 0,
+ "search_fields": "account_number",
+ "show_name_in_global_search": 1,
+ "sort_order": "ASC",
+ "track_changes": 1,
"track_seen": 0
}
\ No newline at end of file
diff --git a/erpnext/hr/doctype/employee_lifecycle_activity/__init__.py b/erpnext/accounts/doctype/allowed_to_transact_with/__init__.py
similarity index 100%
rename from erpnext/hr/doctype/employee_lifecycle_activity/__init__.py
rename to erpnext/accounts/doctype/allowed_to_transact_with/__init__.py
diff --git a/erpnext/accounts/doctype/allowed_to_transact_with/allowed_to_transact_with.json b/erpnext/accounts/doctype/allowed_to_transact_with/allowed_to_transact_with.json
new file mode 100644
index 0000000..f85bc52
--- /dev/null
+++ b/erpnext/accounts/doctype/allowed_to_transact_with/allowed_to_transact_with.json
@@ -0,0 +1,74 @@
+{
+ "allow_copy": 0,
+ "allow_guest_to_view": 0,
+ "allow_import": 0,
+ "allow_rename": 0,
+ "beta": 0,
+ "creation": "2018-04-16 21:50:05.860195",
+ "custom": 0,
+ "docstatus": 0,
+ "doctype": "DocType",
+ "document_type": "",
+ "editable_grid": 1,
+ "engine": "InnoDB",
+ "fields": [
+ {
+ "allow_bulk_edit": 0,
+ "allow_on_submit": 0,
+ "bold": 0,
+ "collapsible": 0,
+ "columns": 0,
+ "default": "",
+ "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": 0,
+ "label": "Company",
+ "length": 0,
+ "no_copy": 0,
+ "options": "Company",
+ "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
+ }
+ ],
+ "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-04-20 14:00:46.014502",
+ "modified_by": "Administrator",
+ "module": "Accounts",
+ "name": "Allowed To Transact With",
+ "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
+}
\ No newline at end of file
diff --git a/erpnext/hr/doctype/employee_lifecycle_process/employee_lifecycle_process.py b/erpnext/accounts/doctype/allowed_to_transact_with/allowed_to_transact_with.py
similarity index 79%
copy from erpnext/hr/doctype/employee_lifecycle_process/employee_lifecycle_process.py
copy to erpnext/accounts/doctype/allowed_to_transact_with/allowed_to_transact_with.py
index 8f05118..a3e4bbc 100644
--- a/erpnext/hr/doctype/employee_lifecycle_process/employee_lifecycle_process.py
+++ b/erpnext/accounts/doctype/allowed_to_transact_with/allowed_to_transact_with.py
@@ -3,8 +3,7 @@
# For license information, please see license.txt
from __future__ import unicode_literals
-import frappe
from frappe.model.document import Document
-class EmployeeLifecycleProcess(Document):
+class AllowedToTransactWith(Document):
pass
diff --git a/erpnext/accounts/doctype/exchange_rate_revaluation/exchange_rate_revaluation.js b/erpnext/accounts/doctype/exchange_rate_revaluation/exchange_rate_revaluation.js
index 9302a24..dd44450 100644
--- a/erpnext/accounts/doctype/exchange_rate_revaluation/exchange_rate_revaluation.js
+++ b/erpnext/accounts/doctype/exchange_rate_revaluation/exchange_rate_revaluation.js
@@ -3,6 +3,97 @@
frappe.ui.form.on('Exchange Rate Revaluation', {
refresh: function(frm) {
+ if(frm.doc.docstatus==1) {
+ frm.add_custom_button(__('Make Journal Entry'), function() {
+ return frm.events.make_jv(frm);
+ });
+ }
+ },
+ get_entries: function(frm) {
+ frappe.call({
+ method: "get_accounts_data",
+ doc: cur_frm.doc,
+ callback: function(r){
+ frappe.model.clear_table(frm.doc, "accounts");
+ if(r.message) {
+ r.message.forEach((d) => {
+ cur_frm.add_child("accounts",d);
+ });
+ frm.events.get_total_gain_loss(frm);
+ refresh_field("accounts");
+ }
+ }
+ });
+ },
+
+ get_total_gain_loss: function(frm) {
+ if(!(frm.doc.accounts && frm.doc.accounts.length)) return;
+
+ let total_gain_loss = 0;
+ frm.doc.accounts.forEach((d) => {
+ d.gain_loss = flt(d.new_balance_in_base_currency, precision("new_balance_in_base_currency", d)) - flt(d.balance_in_base_currency, precision("balance_in_base_currency", d));
+ total_gain_loss += flt(d.gain_loss, precision("gain_loss", d));
+ });
+
+ frm.set_value("total_gain_loss", flt(total_gain_loss, precision("total_gain_loss")));
+ frm.refresh_fields();
+ },
+
+ make_jv : function(frm) {
+ frappe.call({
+ method: "make_jv_entry",
+ doc: frm.doc,
+ callback: function(r){
+ if (r.message)
+ var doc = frappe.model.sync(r.message)[0];
+ frappe.set_route("Form", doc.doctype, doc.name);
+ }
+ });
}
});
+
+frappe.ui.form.on("Exchange Rate Revaluation Account", {
+ new_exchange_rate: function(frm, cdt, cdn) {
+ var row = frappe.get_doc(cdt, cdn);
+ row.new_balance_in_base_currency = flt(row.new_exchange_rate * flt(row.balance_in_account_currency),
+ precision("new_balance_in_base_currency", row));
+ row.gain_loss = row.new_balance_in_base_currency - flt(row.balance_in_base_currency);
+ refresh_field("accounts");
+ frm.events.get_total_gain_loss(frm);
+ },
+
+ account: function(frm, cdt, cdn) {
+ get_account_details(frm, cdt, cdn);
+ },
+
+ party: function(frm, cdt, cdn) {
+ get_account_details(frm, cdt, cdn);
+ },
+
+ accounts_remove: function(frm) {
+ frm.events.get_total_gain_loss(frm);
+ }
+});
+
+var get_account_details = function(frm, cdt, cdn) {
+ var row = frappe.get_doc(cdt, cdn);
+ if(!frm.doc.company || !frm.doc.posting_date) {
+ frappe.throw(__("Please select Company and Posting Date to getting entries"));
+ }
+ frappe.call({
+ method: "erpnext.accounts.doctype.exchange_rate_revaluation.exchange_rate_revaluation.get_account_details",
+ args:{
+ account: row.account,
+ company: frm.doc.company,
+ posting_date: frm.doc.posting_date,
+ party_type: row.party_type,
+ party: row.party
+ },
+ callback: function(r){
+ $.extend(row, r.message);
+ refresh_field("accounts");
+ frm.events.get_total_gain_loss(frm);
+ }
+ });
+};
\ No newline at end of file
diff --git a/erpnext/accounts/doctype/exchange_rate_revaluation/exchange_rate_revaluation.json b/erpnext/accounts/doctype/exchange_rate_revaluation/exchange_rate_revaluation.json
index 3d30292..b37c67e 100644
--- a/erpnext/accounts/doctype/exchange_rate_revaluation/exchange_rate_revaluation.json
+++ b/erpnext/accounts/doctype/exchange_rate_revaluation/exchange_rate_revaluation.json
@@ -19,6 +19,7 @@
"bold": 0,
"collapsible": 0,
"columns": 0,
+ "default": "Today",
"fieldname": "posting_date",
"fieldtype": "Date",
"hidden": 0,
@@ -173,7 +174,7 @@
"bold": 0,
"collapsible": 0,
"columns": 0,
- "fieldname": "exchange_rate_revaluation_account",
+ "fieldname": "accounts",
"fieldtype": "Table",
"hidden": 0,
"ignore_user_permissions": 0,
@@ -184,7 +185,7 @@
"in_standard_filter": 0,
"label": "Exchange Rate Revaluation Account",
"length": 0,
- "no_copy": 0,
+ "no_copy": 1,
"options": "Exchange Rate Revaluation Account",
"permlevel": 0,
"precision": "",
@@ -302,7 +303,7 @@
"issingle": 0,
"istable": 0,
"max_attachments": 0,
- "modified": "2018-04-13 19:19:01.029331",
+ "modified": "2018-05-05 17:50:56.352167",
"modified_by": "Administrator",
"module": "Accounts",
"name": "Exchange Rate Revaluation",
diff --git a/erpnext/accounts/doctype/exchange_rate_revaluation/exchange_rate_revaluation.py b/erpnext/accounts/doctype/exchange_rate_revaluation/exchange_rate_revaluation.py
index 46abddc..aa19a9e 100644
--- a/erpnext/accounts/doctype/exchange_rate_revaluation/exchange_rate_revaluation.py
+++ b/erpnext/accounts/doctype/exchange_rate_revaluation/exchange_rate_revaluation.py
@@ -3,8 +3,168 @@
# For license information, please see license.txt
from __future__ import unicode_literals
-import frappe
+import frappe, erpnext
+from frappe import _
+from frappe.utils import flt
from frappe.model.document import Document
+from frappe.model.meta import get_field_precision
+from erpnext.setup.utils import get_exchange_rate
+from erpnext.accounts.doctype.journal_entry.journal_entry import get_balance_on
class ExchangeRateRevaluation(Document):
- pass
+ def validate(self):
+ self.set_total_gain_loss()
+
+ def set_total_gain_loss(self):
+ total_gain_loss = 0
+ for d in self.accounts:
+ d.gain_loss = flt(d.new_balance_in_base_currency, d.precision("new_balance_in_base_currency")) \
+ - flt(d.balance_in_base_currency, d.precision("balance_in_base_currency"))
+ total_gain_loss += flt(d.gain_loss, d.precision("gain_loss"))
+ self.total_gain_loss = flt(total_gain_loss, self.precision("total_gain_loss"))
+
+ def validate_mandatory(self):
+ if not (self.company and self.posting_date):
+ frappe.throw(_("Please select Company and Posting Date to getting entries"))
+
+ def get_accounts_data(self, account=None):
+ accounts = []
+ self.validate_mandatory()
+ company_currency = erpnext.get_company_currency(self.company)
+ precision = get_field_precision(frappe.get_meta("Exchange Rate Revaluation Account")
+ .get_field("new_balance_in_base_currency"), company_currency)
+ for d in self.get_accounts_from_gle():
+
+ current_exchange_rate = d.balance / d.balance_in_account_currency \
+ if d.balance_in_account_currency else 0
+ new_exchange_rate = get_exchange_rate(d.account_currency, company_currency, self.posting_date)
+ new_balance_in_base_currency = flt(d.balance_in_account_currency * new_exchange_rate)
+ gain_loss = flt(new_balance_in_base_currency, precision) - flt(d.balance, precision)
+ if gain_loss:
+ accounts.append({
+ "account": d.account,
+ "party_type": d.party_type,
+ "party": d.party,
+ "account_currency": d.account_currency,
+ "balance_in_base_currency": d.balance,
+ "balance_in_account_currency": d.balance_in_account_currency,
+ "current_exchange_rate": current_exchange_rate,
+ "new_exchange_rate": new_exchange_rate,
+ "new_balance_in_base_currency": new_balance_in_base_currency
+ })
+ return accounts
+
+ def get_accounts_from_gle(self):
+ company_currency = erpnext.get_company_currency(self.company)
+ accounts = frappe.db.sql_list("""
+ select name
+ from tabAccount
+ where is_group = 0
+ and report_type = 'Balance Sheet'
+ and root_type in ('Asset', 'Liability', 'Equity')
+ and account_type != 'Stock'
+ and company=%s
+ and account_currency != %s
+ order by name""",(self.company, company_currency))
+
+ account_details = frappe.db.sql("""
+ select
+ account, party_type, party, account_currency,
+ sum(debit_in_account_currency) - sum(credit_in_account_currency) as balance_in_account_currency,
+ sum(debit) - sum(credit) as balance
+ from `tabGL Entry`
+ where account in (%s)
+ group by account, party_type, party
+ having sum(debit) != sum(credit)
+ order by account
+ """ % ', '.join(['%s']*len(accounts)), tuple(accounts), as_dict=1)
+
+ return account_details
+
+ def make_jv_entry(self):
+ if self.total_gain_loss == 0:
+ return
+
+ unrealized_exchange_gain_loss_account = frappe.db.get_value("Company", self.company,
+ "unrealized_exchange_gain_loss_account")
+ if not unrealized_exchange_gain_loss_account:
+ frappe.throw(_("Please set Unrealized Exchange Gain/Loss Account in Company {0}")
+ .format(self.company))
+
+ journal_entry = frappe.new_doc('Journal Entry')
+ journal_entry.voucher_type = 'Exchange Rate Revaluation'
+ journal_entry.company = self.company
+ journal_entry.posting_date = self.posting_date
+ journal_entry.multi_currency = 1
+
+ journal_entry_accounts = []
+ for d in self.accounts:
+ dr_or_cr = "debit_in_account_currency" \
+ if d.get("balance_in_account_currency") > 0 else "credit_in_account_currency"
+
+ reverse_dr_or_cr = "debit_in_account_currency" \
+ if dr_or_cr=="credit_in_account_currency" else "credit_in_account_currency"
+
+ journal_entry_accounts.append({
+ "account": d.get("account"),
+ "party_type": d.get("party_type"),
+ "party": d.get("party"),
+ "account_currency": d.get("account_currency"),
+ "balance": d.get("balance_in_account_currency"),
+ dr_or_cr: abs(d.get("balance_in_account_currency")),
+ "exchange_rate":d.get("new_exchange_rate"),
+ "reference_type": "Exchange Rate Revaluation",
+ "reference_name": self.name,
+ })
+ journal_entry_accounts.append({
+ "account": d.get("account"),
+ "party_type": d.get("party_type"),
+ "party": d.get("party"),
+ "account_currency": d.get("account_currency"),
+ "balance": d.get("balance_in_account_currency"),
+ reverse_dr_or_cr: abs(d.get("balance_in_account_currency")),
+ "exchange_rate": d.get("current_exchange_rate"),
+ "reference_type": "Exchange Rate Revaluation",
+ "reference_name": self.name
+ })
+
+ journal_entry_accounts.append({
+ "account": unrealized_exchange_gain_loss_account,
+ "balance": get_balance_on(unrealized_exchange_gain_loss_account),
+ "debit_in_account_currency": abs(self.total_gain_loss) if self.total_gain_loss < 0 else 0,
+ "credit_in_account_currency": self.total_gain_loss if self.total_gain_loss > 0 else 0,
+ "exchange_rate": 1,
+ "reference_type": "Exchange Rate Revaluation",
+ "reference_name": self.name,
+ })
+
+ journal_entry.set("accounts", journal_entry_accounts)
+ journal_entry.set_amounts_in_company_currency()
+ journal_entry.set_total_debit_credit()
+ return journal_entry.as_dict()
+
+@frappe.whitelist()
+def get_account_details(account, company, posting_date, party_type=None, party=None):
+ account_currency, account_type = frappe.db.get_value("Account", account,
+ ["account_currency", "account_type"])
+ if account_type in ["Receivable", "Payable"] and not (party_type and party):
+ frappe.throw(_("Party Type and Party is mandatory for {0} account").format(account_type))
+
+ account_details = {}
+ company_currency = erpnext.get_company_currency(company)
+ balance = get_balance_on(account, party_type=party_type, party=party, in_account_currency=False)
+ if balance:
+ balance_in_account_currency = get_balance_on(account, party_type=party_type, party=party)
+ current_exchange_rate = balance / balance_in_account_currency if balance_in_account_currency else 0
+ new_exchange_rate = get_exchange_rate(account_currency, company_currency, posting_date)
+ new_balance_in_base_currency = balance_in_account_currency * new_exchange_rate
+ account_details = {
+ "account_currency": account_currency,
+ "balance_in_base_currency": balance,
+ "balance_in_account_currency": balance_in_account_currency,
+ "current_exchange_rate": current_exchange_rate,
+ "new_exchange_rate": new_exchange_rate,
+ "new_balance_in_base_currency": new_balance_in_base_currency
+ }
+
+ return account_details
\ No newline at end of file
diff --git a/erpnext/accounts/doctype/exchange_rate_revaluation_account/exchange_rate_revaluation_account.json b/erpnext/accounts/doctype/exchange_rate_revaluation_account/exchange_rate_revaluation_account.json
index 66561a0..e834266 100644
--- a/erpnext/accounts/doctype/exchange_rate_revaluation_account/exchange_rate_revaluation_account.json
+++ b/erpnext/accounts/doctype/exchange_rate_revaluation_account/exchange_rate_revaluation_account.json
@@ -50,16 +50,142 @@
"bold": 0,
"collapsible": 0,
"columns": 0,
- "fieldname": "balance_in_base_currency",
+ "fieldname": "party_type",
+ "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": "Party Type",
+ "length": 0,
+ "no_copy": 0,
+ "options": "DocType",
+ "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_on_submit": 0,
+ "bold": 0,
+ "collapsible": 0,
+ "columns": 0,
+ "fieldname": "party",
+ "fieldtype": "Dynamic 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": "Party",
+ "length": 0,
+ "no_copy": 0,
+ "options": "party_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
+ },
+ {
+ "allow_bulk_edit": 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
+ },
+ {
+ "allow_bulk_edit": 0,
+ "allow_on_submit": 0,
+ "bold": 0,
+ "collapsible": 0,
+ "columns": 0,
+ "fieldname": "account_currency",
+ "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": "Account Currency",
+ "length": 0,
+ "no_copy": 0,
+ "options": "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_on_submit": 0,
+ "bold": 0,
+ "collapsible": 0,
+ "columns": 0,
+ "fieldname": "balance_in_account_currency",
"fieldtype": "Currency",
"hidden": 0,
"ignore_user_permissions": 0,
"ignore_xss_filter": 0,
"in_filter": 0,
"in_global_search": 0,
- "in_list_view": 1,
+ "in_list_view": 0,
"in_standard_filter": 0,
- "label": "Balance In Base Currency",
+ "label": "Balance In Account Currency",
"length": 0,
"no_copy": 0,
"permlevel": 0,
@@ -81,8 +207,8 @@
"bold": 0,
"collapsible": 0,
"columns": 0,
- "fieldname": "balance_in_alternate_currency",
- "fieldtype": "Currency",
+ "fieldname": "balances",
+ "fieldtype": "Section Break",
"hidden": 0,
"ignore_user_permissions": 0,
"ignore_xss_filter": 0,
@@ -90,14 +216,14 @@
"in_global_search": 0,
"in_list_view": 0,
"in_standard_filter": 0,
- "label": "Balance In Alternate Currency",
+ "label": "",
"length": 0,
"no_copy": 0,
"permlevel": 0,
"precision": "",
"print_hide": 0,
"print_hide_if_no_value": 0,
- "read_only": 1,
+ "read_only": 0,
"remember_last_selected_value": 0,
"report_hide": 0,
"reqd": 0,
@@ -143,6 +269,67 @@
"bold": 0,
"collapsible": 0,
"columns": 0,
+ "fieldname": "balance_in_base_currency",
+ "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": "Balance In Base Currency",
+ "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_on_submit": 0,
+ "bold": 0,
+ "collapsible": 0,
+ "columns": 0,
+ "fieldname": "column_break_9",
+ "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_on_submit": 0,
+ "bold": 0,
+ "collapsible": 0,
+ "columns": 0,
"fieldname": "new_exchange_rate",
"fieldtype": "Float",
"hidden": 0,
@@ -205,7 +392,7 @@
"bold": 0,
"collapsible": 0,
"columns": 0,
- "fieldname": "difference",
+ "fieldname": "gain_loss",
"fieldtype": "Currency",
"hidden": 0,
"ignore_user_permissions": 0,
@@ -214,7 +401,7 @@
"in_global_search": 0,
"in_list_view": 1,
"in_standard_filter": 0,
- "label": "Difference",
+ "label": "Gain/Loss",
"length": 0,
"no_copy": 0,
"permlevel": 0,
@@ -241,7 +428,7 @@
"issingle": 0,
"istable": 1,
"max_attachments": 0,
- "modified": "2018-04-13 18:30:57.531401",
+ "modified": "2018-05-05 17:03:03.512559",
"modified_by": "Administrator",
"module": "Accounts",
"name": "Exchange Rate Revaluation Account",
diff --git a/erpnext/hr/doctype/employee_lifecycle_activity/__init__.py b/erpnext/accounts/doctype/finance_book/__init__.py
similarity index 100%
copy from erpnext/hr/doctype/employee_lifecycle_activity/__init__.py
copy to erpnext/accounts/doctype/finance_book/__init__.py
diff --git a/erpnext/hr/doctype/employee_lifecycle_process/employee_lifecycle_process.js b/erpnext/accounts/doctype/finance_book/finance_book.js
similarity index 75%
rename from erpnext/hr/doctype/employee_lifecycle_process/employee_lifecycle_process.js
rename to erpnext/accounts/doctype/finance_book/finance_book.js
index 406436e..71191bb 100644
--- a/erpnext/hr/doctype/employee_lifecycle_process/employee_lifecycle_process.js
+++ b/erpnext/accounts/doctype/finance_book/finance_book.js
@@ -1,7 +1,7 @@
// Copyright (c) 2018, Frappe Technologies Pvt. Ltd. and contributors
// For license information, please see license.txt
-frappe.ui.form.on('Employee Lifecycle Process', {
+frappe.ui.form.on('Finance Book', {
refresh: function(frm) {
}
diff --git a/erpnext/hr/doctype/employee_lifecycle_activity_type/employee_lifecycle_activity_type.json b/erpnext/accounts/doctype/finance_book/finance_book.json
similarity index 63%
rename from erpnext/hr/doctype/employee_lifecycle_activity_type/employee_lifecycle_activity_type.json
rename to erpnext/accounts/doctype/finance_book/finance_book.json
index 793b79a..c9fb843 100644
--- a/erpnext/hr/doctype/employee_lifecycle_activity_type/employee_lifecycle_activity_type.json
+++ b/erpnext/accounts/doctype/finance_book/finance_book.json
@@ -1,15 +1,15 @@
{
"allow_copy": 0,
"allow_guest_to_view": 0,
- "allow_import": 0,
+ "allow_import": 1,
"allow_rename": 0,
- "autoname": "ELAT.#####",
+ "autoname": "field:finance_book_name",
"beta": 0,
- "creation": "2018-04-13 17:34:21.728815",
+ "creation": "2018-04-13 17:42:43.252224",
"custom": 0,
"docstatus": 0,
"doctype": "DocType",
- "document_type": "",
+ "document_type": "Document",
"editable_grid": 1,
"engine": "InnoDB",
"fields": [
@@ -19,40 +19,8 @@
"bold": 0,
"collapsible": 0,
"columns": 0,
- "fieldname": "activity_type",
- "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": "Activity Type",
- "length": 0,
- "no_copy": 0,
- "options": "Activity 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": 1,
- "search_index": 0,
- "set_only_once": 0,
- "translatable": 0,
- "unique": 0
- },
- {
- "allow_bulk_edit": 0,
- "allow_on_submit": 0,
- "bold": 0,
- "collapsible": 0,
- "columns": 0,
- "fieldname": "before_employee_creation",
- "fieldtype": "Check",
+ "fieldname": "finance_book_name",
+ "fieldtype": "Data",
"hidden": 0,
"ignore_user_permissions": 0,
"ignore_xss_filter": 0,
@@ -60,7 +28,7 @@
"in_global_search": 0,
"in_list_view": 0,
"in_standard_filter": 0,
- "label": "Before Employee Creation",
+ "label": "Name",
"length": 0,
"no_copy": 0,
"permlevel": 0,
@@ -80,6 +48,7 @@
"has_web_view": 0,
"hide_heading": 0,
"hide_toolbar": 0,
+ "icon": "fa fa-book",
"idx": 0,
"image_view": 0,
"in_create": 0,
@@ -87,10 +56,10 @@
"issingle": 0,
"istable": 0,
"max_attachments": 0,
- "modified": "2018-04-13 19:02:22.731902",
+ "modified": "2018-05-09 14:55:01.394387",
"modified_by": "Administrator",
- "module": "HR",
- "name": "Employee Lifecycle Activity Type",
+ "module": "Accounts",
+ "name": "Finance Book",
"name_case": "",
"owner": "Administrator",
"permissions": [
@@ -107,7 +76,7 @@
"print": 1,
"read": 1,
"report": 1,
- "role": "Employee",
+ "role": "Accounts User",
"set_user_permissions": 0,
"share": 1,
"submit": 0,
@@ -126,7 +95,7 @@
"print": 1,
"read": 1,
"report": 1,
- "role": "HR Manager",
+ "role": "Accounts Manager",
"set_user_permissions": 0,
"share": 1,
"submit": 0,
@@ -135,7 +104,7 @@
{
"amend": 0,
"cancel": 0,
- "create": 1,
+ "create": 0,
"delete": 0,
"email": 1,
"export": 1,
@@ -145,19 +114,20 @@
"print": 1,
"read": 1,
"report": 1,
- "role": "HR User",
+ "role": "Auditor",
"set_user_permissions": 0,
"share": 1,
"submit": 0,
- "write": 1
+ "write": 0
}
],
"quick_entry": 1,
"read_only": 0,
"read_only_onload": 0,
+ "search_fields": "finance_book_name",
"show_name_in_global_search": 0,
"sort_field": "modified",
"sort_order": "DESC",
"track_changes": 1,
- "track_seen": 0
+ "track_seen": 1
}
\ No newline at end of file
diff --git a/erpnext/hr/doctype/employee_lifecycle_process/employee_lifecycle_process.py b/erpnext/accounts/doctype/finance_book/finance_book.py
similarity index 84%
rename from erpnext/hr/doctype/employee_lifecycle_process/employee_lifecycle_process.py
rename to erpnext/accounts/doctype/finance_book/finance_book.py
index 8f05118..bc9fce2 100644
--- a/erpnext/hr/doctype/employee_lifecycle_process/employee_lifecycle_process.py
+++ b/erpnext/accounts/doctype/finance_book/finance_book.py
@@ -6,5 +6,5 @@
import frappe
from frappe.model.document import Document
-class EmployeeLifecycleProcess(Document):
+class FinanceBook(Document):
pass
diff --git a/erpnext/hr/doctype/employee_lifecycle_process/test_employee_lifecycle_process.js b/erpnext/accounts/doctype/finance_book/test_finance_book.js
similarity index 66%
rename from erpnext/hr/doctype/employee_lifecycle_process/test_employee_lifecycle_process.js
rename to erpnext/accounts/doctype/finance_book/test_finance_book.js
index cd892d9..9fb7d4f 100644
--- a/erpnext/hr/doctype/employee_lifecycle_process/test_employee_lifecycle_process.js
+++ b/erpnext/accounts/doctype/finance_book/test_finance_book.js
@@ -2,15 +2,15 @@
// rename this file from _test_[name] to test_[name] to activate
// and remove above this line
-QUnit.test("test: Employee Lifecycle Process", function (assert) {
+QUnit.test("test: Finance Book", function (assert) {
let done = assert.async();
// number of asserts
assert.expect(1);
frappe.run_serially([
- // insert a new Employee Lifecycle Process
- () => frappe.tests.make('Employee Lifecycle Process', [
+ // insert a new Finance Book
+ () => frappe.tests.make('Finance Book', [
// values to be set
{key: 'value'}
]),
diff --git a/erpnext/hr/doctype/employee_lifecycle_activity/test_employee_lifecycle_activity.py b/erpnext/accounts/doctype/finance_book/test_finance_book.py
similarity index 76%
rename from erpnext/hr/doctype/employee_lifecycle_activity/test_employee_lifecycle_activity.py
rename to erpnext/accounts/doctype/finance_book/test_finance_book.py
index e90de0f..771e813 100644
--- a/erpnext/hr/doctype/employee_lifecycle_activity/test_employee_lifecycle_activity.py
+++ b/erpnext/accounts/doctype/finance_book/test_finance_book.py
@@ -6,5 +6,5 @@
import frappe
import unittest
-class TestEmployeeLifecycleActivity(unittest.TestCase):
+class TestFinanceBook(unittest.TestCase):
pass
diff --git a/erpnext/accounts/doctype/gl_entry/gl_entry.json b/erpnext/accounts/doctype/gl_entry/gl_entry.json
index 4412661..4b33968 100644
--- a/erpnext/accounts/doctype/gl_entry/gl_entry.json
+++ b/erpnext/accounts/doctype/gl_entry/gl_entry.json
@@ -41,6 +41,7 @@
"reqd": 0,
"search_index": 1,
"set_only_once": 0,
+ "translatable": 0,
"unique": 0
},
{
@@ -72,6 +73,7 @@
"reqd": 0,
"search_index": 0,
"set_only_once": 0,
+ "translatable": 0,
"unique": 0
},
{
@@ -104,6 +106,7 @@
"reqd": 0,
"search_index": 1,
"set_only_once": 0,
+ "translatable": 0,
"unique": 0
},
{
@@ -134,6 +137,7 @@
"reqd": 0,
"search_index": 0,
"set_only_once": 0,
+ "translatable": 0,
"unique": 0
},
{
@@ -164,6 +168,7 @@
"reqd": 0,
"search_index": 1,
"set_only_once": 0,
+ "translatable": 0,
"unique": 0
},
{
@@ -196,6 +201,7 @@
"reqd": 0,
"search_index": 0,
"set_only_once": 0,
+ "translatable": 0,
"unique": 0
},
{
@@ -229,6 +235,7 @@
"reqd": 0,
"search_index": 0,
"set_only_once": 0,
+ "translatable": 0,
"unique": 0
},
{
@@ -262,6 +269,7 @@
"reqd": 0,
"search_index": 0,
"set_only_once": 0,
+ "translatable": 0,
"unique": 0
},
{
@@ -293,6 +301,7 @@
"reqd": 0,
"search_index": 0,
"set_only_once": 0,
+ "translatable": 0,
"unique": 0
},
{
@@ -324,6 +333,7 @@
"reqd": 0,
"search_index": 0,
"set_only_once": 0,
+ "translatable": 0,
"unique": 0
},
{
@@ -355,6 +365,7 @@
"reqd": 0,
"search_index": 0,
"set_only_once": 0,
+ "translatable": 0,
"unique": 0
},
{
@@ -386,6 +397,7 @@
"reqd": 0,
"search_index": 0,
"set_only_once": 0,
+ "translatable": 0,
"unique": 0
},
{
@@ -418,6 +430,7 @@
"reqd": 0,
"search_index": 0,
"set_only_once": 0,
+ "translatable": 0,
"unique": 0
},
{
@@ -450,6 +463,7 @@
"reqd": 0,
"search_index": 1,
"set_only_once": 0,
+ "translatable": 0,
"unique": 0
},
{
@@ -482,6 +496,7 @@
"reqd": 0,
"search_index": 0,
"set_only_once": 0,
+ "translatable": 0,
"unique": 0
},
{
@@ -514,6 +529,7 @@
"reqd": 0,
"search_index": 1,
"set_only_once": 0,
+ "translatable": 0,
"unique": 0
},
{
@@ -545,6 +561,7 @@
"reqd": 0,
"search_index": 0,
"set_only_once": 0,
+ "translatable": 0,
"unique": 0
},
{
@@ -576,6 +593,7 @@
"reqd": 0,
"search_index": 0,
"set_only_once": 0,
+ "translatable": 0,
"unique": 0
},
{
@@ -608,6 +626,7 @@
"reqd": 0,
"search_index": 0,
"set_only_once": 0,
+ "translatable": 0,
"unique": 0
},
{
@@ -640,6 +659,7 @@
"reqd": 0,
"search_index": 0,
"set_only_once": 0,
+ "translatable": 0,
"unique": 0
},
{
@@ -672,6 +692,7 @@
"reqd": 0,
"search_index": 0,
"set_only_once": 0,
+ "translatable": 0,
"unique": 0
},
{
@@ -704,6 +725,39 @@
"reqd": 0,
"search_index": 0,
"set_only_once": 0,
+ "translatable": 0,
+ "unique": 0
+ },
+ {
+ "allow_bulk_edit": 0,
+ "allow_on_submit": 0,
+ "bold": 0,
+ "collapsible": 0,
+ "columns": 0,
+ "fieldname": "finance_book",
+ "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": "Finance Book",
+ "length": 0,
+ "no_copy": 0,
+ "options": "Finance Book",
+ "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
}
],
@@ -718,7 +772,7 @@
"issingle": 0,
"istable": 0,
"max_attachments": 0,
- "modified": "2017-12-20 12:40:09.611951",
+ "modified": "2018-04-23 02:15:22.297509",
"modified_by": "Administrator",
"module": "Accounts",
"name": "GL Entry",
@@ -726,7 +780,6 @@
"permissions": [
{
"amend": 0,
- "apply_user_permissions": 0,
"cancel": 0,
"create": 0,
"delete": 0,
@@ -746,7 +799,6 @@
},
{
"amend": 0,
- "apply_user_permissions": 0,
"cancel": 0,
"create": 0,
"delete": 0,
@@ -766,7 +818,6 @@
},
{
"amend": 0,
- "apply_user_permissions": 0,
"cancel": 0,
"create": 0,
"delete": 0,
@@ -794,4 +845,4 @@
"sort_order": "DESC",
"track_changes": 0,
"track_seen": 0
-}
+}
\ No newline at end of file
diff --git a/erpnext/accounts/doctype/journal_entry/journal_entry.js b/erpnext/accounts/doctype/journal_entry/journal_entry.js
index 98f68d5..9aa8de1 100644
--- a/erpnext/accounts/doctype/journal_entry/journal_entry.js
+++ b/erpnext/accounts/doctype/journal_entry/journal_entry.js
@@ -37,6 +37,55 @@
// hide /unhide fields based on currency
erpnext.journal_entry.toggle_fields_based_on_currency(frm);
+
+ if ((frm.doc.voucher_type == "Inter Company Journal Entry") && (frm.doc.docstatus == 1) && (!frm.doc.inter_company_journal_entry_reference)) {
+ frm.add_custom_button(__("Make Inter Company Journal Entry"),
+ function() {
+ frm.trigger("make_inter_company_journal_entry");
+ }
+ );
+ }
+ },
+
+ make_inter_company_journal_entry: function(frm) {
+ var d = new frappe.ui.Dialog({
+ title: __("Select Company"),
+ fields: [
+ {
+ 'fieldname': 'company',
+ 'fieldtype': 'Link',
+ 'label': __('Company'),
+ 'options': 'Company',
+ "get_query": function () {
+ return {
+ filters: [
+ ["Company", "name", "!=", frm.doc.company]
+ ]
+ };
+ },
+ 'reqd': 1
+ }
+ ],
+ });
+ d.set_primary_action(__("Make"), function() {
+ d.hide();
+ var args = d.get_values();
+ frappe.call({
+ args: {
+ "name": frm.doc.name,
+ "voucher_type": frm.doc.voucher_type,
+ "company": args.company
+ },
+ method: "erpnext.accounts.doctype.journal_entry.journal_entry.make_inter_company_journal_entry",
+ callback: function (r) {
+ if (r.message) {
+ var doc = frappe.model.sync(r.message)[0];
+ frappe.set_route("Form", doc.doctype, doc.name);
+ }
+ }
+ });
+ });
+ d.show();
},
multi_currency: function(frm) {
@@ -549,9 +598,15 @@
},
account_query: function(frm) {
+ var inter_company = 0;
+ if (frm.doc.voucher_type == "Inter Company Journal Entry") {
+ inter_company = 1;
+ }
+
var filters = {
company: frm.doc.company,
- is_group: 0
+ is_group: 0,
+ inter_company_account: inter_company
};
if(!frm.doc.multi_currency) {
$.extend(filters, {
diff --git a/erpnext/accounts/doctype/journal_entry/journal_entry.json b/erpnext/accounts/doctype/journal_entry/journal_entry.json
index 2ae085d..a975aa0 100644
--- a/erpnext/accounts/doctype/journal_entry/journal_entry.json
+++ b/erpnext/accounts/doctype/journal_entry/journal_entry.json
@@ -96,7 +96,7 @@
"no_copy": 0,
"oldfieldname": "voucher_type",
"oldfieldtype": "Select",
- "options": "Journal Entry\nBank Entry\nCash Entry\nCredit Card Entry\nDebit Note\nCredit Note\nContra Entry\nExcise Entry\nWrite Off Entry\nOpening Entry\nDepreciation Entry",
+ "options": "Journal Entry\nInter Company Journal Entry\nBank Entry\nCash Entry\nCredit Card Entry\nDebit Note\nCredit Note\nContra Entry\nExcise Entry\nWrite Off Entry\nOpening Entry\nDepreciation Entry\nExchange Rate Revaluation",
"permlevel": 0,
"print_hide": 0,
"print_hide_if_no_value": 0,
@@ -244,6 +244,38 @@
"bold": 0,
"collapsible": 0,
"columns": 0,
+ "fieldname": "finance_book",
+ "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": "Finance Book",
+ "length": 0,
+ "no_copy": 0,
+ "options": "Finance Book",
+ "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_on_submit": 0,
+ "bold": 0,
+ "collapsible": 0,
+ "columns": 0,
"fieldname": "2_add_edit_gl_entries",
"fieldtype": "Section Break",
"hidden": 0,
@@ -830,7 +862,7 @@
"no_copy": 0,
"permlevel": 0,
"precision": "",
- "print_hide": 0,
+ "print_hide": 1,
"print_hide_if_no_value": 0,
"read_only": 0,
"remember_last_selected_value": 0,
@@ -847,6 +879,39 @@
"bold": 0,
"collapsible": 0,
"columns": 0,
+ "depends_on": "eval:doc.voucher_type== \"Inter Company Journal Entry\"",
+ "fieldname": "inter_company_journal_entry_reference",
+ "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": "Inter Company Journal Entry Reference",
+ "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_on_submit": 0,
+ "bold": 0,
+ "collapsible": 0,
+ "columns": 0,
"fieldname": "column_break98",
"fieldtype": "Column Break",
"hidden": 0,
@@ -1520,7 +1585,7 @@
"istable": 0,
"max_attachments": 0,
"menu_index": 0,
- "modified": "2018-04-16 17:34:38.429196",
+ "modified": "2018-05-09 14:56:08.687994",
"modified_by": "Administrator",
"module": "Accounts",
"name": "Journal Entry",
diff --git a/erpnext/accounts/doctype/journal_entry/journal_entry.py b/erpnext/accounts/doctype/journal_entry/journal_entry.py
index 2e4dd83..51308e50 100644
--- a/erpnext/accounts/doctype/journal_entry/journal_entry.py
+++ b/erpnext/accounts/doctype/journal_entry/journal_entry.py
@@ -3,7 +3,7 @@
from __future__ import unicode_literals
import frappe, erpnext, json
-from frappe.utils import cstr, flt, fmt_money, formatdate, getdate
+from frappe.utils import cstr, flt, fmt_money, formatdate, getdate, nowdate
from frappe import msgprint, _, scrub
from erpnext.controllers.accounts_controller import AccountsController
from erpnext.accounts.utils import get_balance_on, get_account_currency
@@ -40,15 +40,17 @@
self.validate_credit_debit_note()
self.validate_empty_accounts_table()
self.set_account_and_party_balance()
+ self.validate_inter_company_accounts()
if not self.title:
self.title = self.get_title()
def on_submit(self):
self.check_credit_limit()
self.make_gl_entries()
- self.update_loan()
self.update_advance_paid()
self.update_expense_claim()
+ self.update_loan()
+ self.update_inter_company_jv()
def get_title(self):
return self.pay_to_recd_from or self.accounts[0].account
@@ -64,6 +66,20 @@
for voucher_no in list(set(order_list)):
frappe.get_doc(voucher_type, voucher_no).set_total_advance_paid()
+ def validate_inter_company_accounts(self):
+ if self.voucher_type == "Inter Company Journal Entry" and self.inter_company_journal_entry_reference:
+ doc = frappe.get_doc("Journal Entry", self.inter_company_journal_entry_reference)
+ account_currency = frappe.db.get_value("Company", self.company, "default_currency")
+ previous_account_currency = frappe.db.get_value("Company", doc.company, "default_currency")
+ if account_currency == previous_account_currency:
+ if self.total_credit != doc.total_debit or self.total_debit != doc.total_credit:
+ frappe.throw(_("Total Credit/ Debit Amount should be same as linked Journal Entry"))
+
+ def update_inter_company_jv(self):
+ if self.voucher_type == "Inter Company Journal Entry" and self.inter_company_journal_entry_reference:
+ frappe.db.set_value("Journal Entry", self.inter_company_journal_entry_reference,\
+ "inter_company_journal_entry_reference", self.name)
+
def on_cancel(self):
from erpnext.accounts.utils import unlink_ref_doc_from_payment_entries
from erpnext.hr.doctype.salary_slip.salary_slip import unlink_ref_doc_from_salary_slip
@@ -75,6 +91,7 @@
self.update_loan()
self.unlink_advance_entry_reference()
self.unlink_asset_reference()
+ self.unlink_inter_company_jv()
def unlink_advance_entry_reference(self):
for d in self.get("accounts"):
@@ -97,6 +114,13 @@
asset.db_set("value_after_depreciation", asset.value_after_depreciation)
asset.set_status()
+ def unlink_inter_company_jv(self):
+ if self.voucher_type == "Inter Company Journal Entry" and self.inter_company_journal_entry_reference:
+ frappe.db.set_value("Journal Entry", self.inter_company_journal_entry_reference,\
+ "inter_company_journal_entry_reference", "")
+ frappe.db.set_value("Journal Entry", self.name,\
+ "inter_company_journal_entry_reference", "")
+
def validate_party(self):
for d in self.get("accounts"):
account_type = frappe.db.get_value("Account", d.account, "account_type")
@@ -127,7 +151,7 @@
if (d.party_type == 'Customer' and flt(d.credit) > 0) or \
(d.party_type == 'Supplier' and flt(d.debit) > 0):
if d.is_advance=="No":
- msgprint(_("Row {0}: Please check 'Is Advance' against Account {1} if this is an advance entry.").format(d.idx, d.account))
+ msgprint(_("Row {0}: Please check 'Is Advance' against Account {1} if this is an advance entry.").format(d.idx, d.account), alert=True)
elif d.reference_type in ("Sales Order", "Purchase Order") and d.is_advance != "Yes":
frappe.throw(_("Row {0}: Payment against Sales/Purchase Order should always be marked as advance").format(d.idx))
@@ -436,7 +460,8 @@
"against_voucher": d.reference_name,
"remarks": self.remark,
"cost_center": d.cost_center,
- "project": d.project
+ "project": d.project,
+ "finance_book": self.finance_book
})
)
@@ -907,4 +932,13 @@
bank_balance_in_company_currency = get_balance_on(account, in_account_currency=False)
exchange_rate = bank_balance_in_company_currency / bank_balance_in_account_currency
- return exchange_rate
\ No newline at end of file
+ return exchange_rate
+
+@frappe.whitelist()
+def make_inter_company_journal_entry(name, voucher_type, company):
+ journal_entry = frappe.new_doc('Journal Entry')
+ journal_entry.voucher_type = voucher_type
+ journal_entry.company = company
+ journal_entry.posting_date = nowdate()
+ journal_entry.inter_company_journal_entry_reference = name
+ return journal_entry.as_dict()
\ No newline at end of file
diff --git a/erpnext/accounts/doctype/journal_entry_account/journal_entry_account.json b/erpnext/accounts/doctype/journal_entry_account/journal_entry_account.json
index 98a2a29..eddcd5e 100644
--- a/erpnext/accounts/doctype/journal_entry_account/journal_entry_account.json
+++ b/erpnext/accounts/doctype/journal_entry_account/journal_entry_account.json
@@ -44,6 +44,7 @@
"reqd": 1,
"search_index": 1,
"set_only_once": 0,
+ "translatable": 0,
"unique": 0,
"width": "250px"
},
@@ -75,6 +76,7 @@
"reqd": 0,
"search_index": 0,
"set_only_once": 0,
+ "translatable": 0,
"unique": 0
},
{
@@ -107,6 +109,7 @@
"reqd": 0,
"search_index": 0,
"set_only_once": 0,
+ "translatable": 0,
"unique": 0
},
{
@@ -142,6 +145,7 @@
"reqd": 0,
"search_index": 0,
"set_only_once": 0,
+ "translatable": 0,
"unique": 0,
"width": "180px"
},
@@ -171,6 +175,7 @@
"reqd": 0,
"search_index": 0,
"set_only_once": 0,
+ "translatable": 0,
"unique": 0
},
{
@@ -201,6 +206,7 @@
"reqd": 0,
"search_index": 0,
"set_only_once": 0,
+ "translatable": 0,
"unique": 0
},
{
@@ -231,6 +237,7 @@
"reqd": 0,
"search_index": 0,
"set_only_once": 0,
+ "translatable": 0,
"unique": 0
},
{
@@ -262,6 +269,7 @@
"reqd": 0,
"search_index": 0,
"set_only_once": 0,
+ "translatable": 0,
"unique": 0
},
{
@@ -294,6 +302,7 @@
"reqd": 0,
"search_index": 0,
"set_only_once": 0,
+ "translatable": 0,
"unique": 0
},
{
@@ -325,6 +334,7 @@
"reqd": 0,
"search_index": 0,
"set_only_once": 0,
+ "translatable": 0,
"unique": 0
},
{
@@ -354,6 +364,7 @@
"reqd": 0,
"search_index": 0,
"set_only_once": 0,
+ "translatable": 0,
"unique": 0
},
{
@@ -384,6 +395,7 @@
"reqd": 0,
"search_index": 0,
"set_only_once": 0,
+ "translatable": 0,
"unique": 0
},
{
@@ -413,6 +425,7 @@
"reqd": 0,
"search_index": 0,
"set_only_once": 0,
+ "translatable": 0,
"unique": 0
},
{
@@ -444,6 +457,7 @@
"reqd": 0,
"search_index": 0,
"set_only_once": 0,
+ "translatable": 0,
"unique": 0
},
{
@@ -477,6 +491,7 @@
"reqd": 0,
"search_index": 0,
"set_only_once": 0,
+ "translatable": 0,
"unique": 0
},
{
@@ -505,6 +520,7 @@
"reqd": 0,
"search_index": 0,
"set_only_once": 0,
+ "translatable": 0,
"unique": 0
},
{
@@ -536,6 +552,7 @@
"reqd": 0,
"search_index": 0,
"set_only_once": 0,
+ "translatable": 0,
"unique": 0
},
{
@@ -569,6 +586,7 @@
"reqd": 0,
"search_index": 0,
"set_only_once": 0,
+ "translatable": 0,
"unique": 0
},
{
@@ -598,6 +616,7 @@
"reqd": 0,
"search_index": 0,
"set_only_once": 0,
+ "translatable": 0,
"unique": 0
},
{
@@ -618,7 +637,7 @@
"label": "Reference Type",
"length": 0,
"no_copy": 0,
- "options": "\nSales Invoice\nPurchase Invoice\nJournal Entry\nSales Order\nPurchase Order\nExpense Claim\nAsset\nLoan\nPayroll Entry\nEmployee Advance",
+ "options": "\nSales Invoice\nPurchase Invoice\nJournal Entry\nSales Order\nPurchase Order\nExpense Claim\nAsset\nLoan\nPayroll Entry\nEmployee Advance\nExchange Rate Revaluation",
"permlevel": 0,
"precision": "",
"print_hide": 0,
@@ -629,6 +648,7 @@
"reqd": 0,
"search_index": 0,
"set_only_once": 0,
+ "translatable": 0,
"unique": 0
},
{
@@ -660,8 +680,42 @@
"reqd": 0,
"search_index": 0,
"set_only_once": 0,
+ "translatable": 0,
"unique": 0
- },
+ },
+ {
+ "allow_bulk_edit": 0,
+ "allow_on_submit": 0,
+ "bold": 0,
+ "collapsible": 0,
+ "columns": 0,
+ "depends_on": "eval:doc.reference_type&&!in_list(doc.reference_type, ['Expense Claim', 'Asset', 'Employee Loan', 'Employee Advance'])",
+ "fieldname": "reference_due_date",
+ "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": "Reference Due Date",
+ "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_on_submit": 0,
@@ -691,6 +745,7 @@
"reqd": 0,
"search_index": 0,
"set_only_once": 0,
+ "translatable": 0,
"unique": 0
},
{
@@ -719,6 +774,7 @@
"reqd": 0,
"search_index": 0,
"set_only_once": 0,
+ "translatable": 0,
"unique": 0
},
{
@@ -751,6 +807,7 @@
"reqd": 0,
"search_index": 0,
"set_only_once": 0,
+ "translatable": 0,
"unique": 0
},
{
@@ -782,6 +839,7 @@
"reqd": 0,
"search_index": 0,
"set_only_once": 0,
+ "translatable": 0,
"unique": 0
}
],
@@ -795,7 +853,7 @@
"issingle": 0,
"istable": 1,
"max_attachments": 0,
- "modified": "2017-12-07 19:54:19.851534",
+ "modified": "2018-05-05 17:50:25.961397",
"modified_by": "Administrator",
"module": "Accounts",
"name": "Journal Entry Account",
diff --git a/erpnext/accounts/doctype/purchase_invoice/purchase_invoice.js b/erpnext/accounts/doctype/purchase_invoice/purchase_invoice.js
index 39f8039..e7fdd64 100644
--- a/erpnext/accounts/doctype/purchase_invoice/purchase_invoice.js
+++ b/erpnext/accounts/doctype/purchase_invoice/purchase_invoice.js
@@ -92,8 +92,21 @@
})
}, __("Get items from"));
}
-
this.frm.toggle_reqd("supplier_warehouse", this.frm.doc.is_subcontracted==="Yes");
+
+ var me = this;
+ if (doc.docstatus == 1 && !doc.inter_company_invoice_reference) {
+ frappe.model.with_doc("Supplier", me.frm.doc.supplier, function() {
+ var supplier = frappe.model.get_doc("Supplier", me.frm.doc.supplier);
+ var internal = supplier.is_internal_supplier;
+ var disabled = supplier.disabled;
+ if (internal == 1 && disabled == 0) {
+ me.frm.add_custom_button("Inter Company Invoice", function() {
+ me.make_inter_company_invoice(me.frm);
+ }, __("Make"));
+ }
+ });
+ }
},
supplier: function() {
@@ -133,6 +146,13 @@
}
},
+ make_inter_company_invoice: function(frm) {
+ frappe.model.open_mapped_doc({
+ method: "erpnext.accounts.doctype.purchase_invoice.purchase_invoice.make_inter_company_sales_invoice",
+ frm: frm
+ });
+ },
+
is_paid: function() {
hide_fields(this.frm.doc);
if(cint(this.frm.doc.is_paid)) {
diff --git a/erpnext/accounts/doctype/purchase_invoice/purchase_invoice.json b/erpnext/accounts/doctype/purchase_invoice/purchase_invoice.json
index d707436..e136a1d 100755
--- a/erpnext/accounts/doctype/purchase_invoice/purchase_invoice.json
+++ b/erpnext/accounts/doctype/purchase_invoice/purchase_invoice.json
@@ -41,6 +41,7 @@
"reqd": 0,
"search_index": 0,
"set_only_once": 0,
+ "translatable": 0,
"unique": 0
},
{
@@ -73,6 +74,7 @@
"reqd": 1,
"search_index": 0,
"set_only_once": 1,
+ "translatable": 0,
"unique": 0
},
{
@@ -105,6 +107,7 @@
"reqd": 0,
"search_index": 1,
"set_only_once": 0,
+ "translatable": 0,
"unique": 0
},
{
@@ -138,6 +141,7 @@
"reqd": 0,
"search_index": 0,
"set_only_once": 0,
+ "translatable": 0,
"unique": 0
},
{
@@ -169,6 +173,7 @@
"reqd": 0,
"search_index": 0,
"set_only_once": 0,
+ "translatable": 0,
"unique": 0
},
{
@@ -200,6 +205,7 @@
"reqd": 0,
"search_index": 0,
"set_only_once": 0,
+ "translatable": 0,
"unique": 0
},
{
@@ -230,6 +236,7 @@
"reqd": 0,
"search_index": 0,
"set_only_once": 0,
+ "translatable": 0,
"unique": 0
},
{
@@ -259,6 +266,7 @@
"reqd": 0,
"search_index": 0,
"set_only_once": 0,
+ "translatable": 0,
"unique": 0,
"width": "50%"
},
@@ -290,6 +298,7 @@
"reqd": 0,
"search_index": 0,
"set_only_once": 0,
+ "translatable": 0,
"unique": 0
},
{
@@ -322,6 +331,7 @@
"reqd": 1,
"search_index": 1,
"set_only_once": 0,
+ "translatable": 0,
"unique": 0
},
{
@@ -353,6 +363,7 @@
"reqd": 0,
"search_index": 0,
"set_only_once": 0,
+ "translatable": 0,
"unique": 0,
"width": "100px"
},
@@ -385,6 +396,7 @@
"reqd": 0,
"search_index": 0,
"set_only_once": 0,
+ "translatable": 0,
"unique": 0
},
{
@@ -417,6 +429,7 @@
"reqd": 0,
"search_index": 0,
"set_only_once": 0,
+ "translatable": 0,
"unique": 0
},
{
@@ -448,6 +461,7 @@
"reqd": 0,
"search_index": 0,
"set_only_once": 0,
+ "translatable": 0,
"unique": 0
},
{
@@ -480,6 +494,7 @@
"reqd": 0,
"search_index": 0,
"set_only_once": 0,
+ "translatable": 0,
"unique": 0
},
{
@@ -509,6 +524,7 @@
"reqd": 0,
"search_index": 0,
"set_only_once": 0,
+ "translatable": 0,
"unique": 0
},
{
@@ -540,6 +556,7 @@
"reqd": 0,
"search_index": 0,
"set_only_once": 0,
+ "translatable": 0,
"unique": 0
},
{
@@ -571,6 +588,7 @@
"reqd": 0,
"search_index": 0,
"set_only_once": 0,
+ "translatable": 0,
"unique": 0
},
{
@@ -602,6 +620,7 @@
"reqd": 0,
"search_index": 0,
"set_only_once": 0,
+ "translatable": 0,
"unique": 0
},
{
@@ -634,6 +653,7 @@
"reqd": 0,
"search_index": 0,
"set_only_once": 0,
+ "translatable": 0,
"unique": 0
},
{
@@ -664,6 +684,7 @@
"reqd": 0,
"search_index": 0,
"set_only_once": 0,
+ "translatable": 0,
"unique": 0
},
{
@@ -694,6 +715,7 @@
"reqd": 0,
"search_index": 0,
"set_only_once": 0,
+ "translatable": 0,
"unique": 0
},
{
@@ -724,6 +746,7 @@
"reqd": 0,
"search_index": 0,
"set_only_once": 0,
+ "translatable": 0,
"unique": 0
},
{
@@ -754,6 +777,7 @@
"reqd": 0,
"search_index": 0,
"set_only_once": 0,
+ "translatable": 0,
"unique": 0
},
{
@@ -783,6 +807,7 @@
"reqd": 0,
"search_index": 0,
"set_only_once": 0,
+ "translatable": 0,
"unique": 0
},
{
@@ -812,6 +837,7 @@
"reqd": 0,
"search_index": 0,
"set_only_once": 0,
+ "translatable": 0,
"unique": 0
},
{
@@ -841,6 +867,7 @@
"reqd": 0,
"search_index": 0,
"set_only_once": 0,
+ "translatable": 0,
"unique": 0
},
{
@@ -870,6 +897,7 @@
"reqd": 0,
"search_index": 0,
"set_only_once": 0,
+ "translatable": 0,
"unique": 0
},
{
@@ -902,6 +930,7 @@
"reqd": 0,
"search_index": 0,
"set_only_once": 0,
+ "translatable": 0,
"unique": 0
},
{
@@ -932,6 +961,7 @@
"reqd": 0,
"search_index": 0,
"set_only_once": 0,
+ "translatable": 0,
"unique": 0
},
{
@@ -962,6 +992,7 @@
"reqd": 0,
"search_index": 0,
"set_only_once": 0,
+ "translatable": 0,
"unique": 0
},
{
@@ -994,6 +1025,7 @@
"reqd": 0,
"search_index": 0,
"set_only_once": 0,
+ "translatable": 0,
"unique": 0
},
{
@@ -1027,6 +1059,7 @@
"reqd": 0,
"search_index": 0,
"set_only_once": 0,
+ "translatable": 0,
"unique": 0
},
{
@@ -1055,6 +1088,7 @@
"reqd": 0,
"search_index": 0,
"set_only_once": 0,
+ "translatable": 0,
"unique": 0
},
{
@@ -1085,6 +1119,7 @@
"reqd": 0,
"search_index": 0,
"set_only_once": 0,
+ "translatable": 0,
"unique": 0
},
{
@@ -1115,6 +1150,7 @@
"reqd": 0,
"search_index": 0,
"set_only_once": 0,
+ "translatable": 0,
"unique": 0
},
{
@@ -1145,6 +1181,7 @@
"reqd": 0,
"search_index": 0,
"set_only_once": 0,
+ "translatable": 0,
"unique": 0
},
{
@@ -1174,6 +1211,7 @@
"reqd": 0,
"search_index": 0,
"set_only_once": 0,
+ "translatable": 0,
"unique": 0
},
{
@@ -1205,6 +1243,7 @@
"reqd": 0,
"search_index": 0,
"set_only_once": 0,
+ "translatable": 0,
"unique": 0
},
{
@@ -1236,6 +1275,7 @@
"reqd": 0,
"search_index": 0,
"set_only_once": 0,
+ "translatable": 0,
"unique": 0
},
{
@@ -1268,6 +1308,7 @@
"reqd": 1,
"search_index": 0,
"set_only_once": 0,
+ "translatable": 0,
"unique": 0
},
{
@@ -1296,6 +1337,7 @@
"reqd": 0,
"search_index": 0,
"set_only_once": 0,
+ "translatable": 0,
"unique": 0
},
{
@@ -1327,6 +1369,7 @@
"reqd": 0,
"search_index": 0,
"set_only_once": 0,
+ "translatable": 0,
"unique": 0
},
{
@@ -1360,6 +1403,7 @@
"reqd": 0,
"search_index": 0,
"set_only_once": 0,
+ "translatable": 0,
"unique": 0
},
{
@@ -1388,6 +1432,7 @@
"reqd": 0,
"search_index": 0,
"set_only_once": 0,
+ "translatable": 0,
"unique": 0
},
{
@@ -1419,6 +1464,7 @@
"reqd": 0,
"search_index": 0,
"set_only_once": 0,
+ "translatable": 0,
"unique": 0
},
{
@@ -1451,6 +1497,7 @@
"reqd": 0,
"search_index": 0,
"set_only_once": 0,
+ "translatable": 0,
"unique": 0
},
{
@@ -1481,6 +1528,7 @@
"reqd": 0,
"search_index": 0,
"set_only_once": 0,
+ "translatable": 0,
"unique": 0
},
{
@@ -1512,6 +1560,7 @@
"reqd": 0,
"search_index": 0,
"set_only_once": 0,
+ "translatable": 0,
"unique": 0
},
{
@@ -1544,6 +1593,7 @@
"reqd": 0,
"search_index": 0,
"set_only_once": 0,
+ "translatable": 0,
"unique": 0
},
{
@@ -1573,6 +1623,7 @@
"reqd": 0,
"search_index": 0,
"set_only_once": 0,
+ "translatable": 0,
"unique": 0
},
{
@@ -1604,6 +1655,7 @@
"reqd": 0,
"search_index": 0,
"set_only_once": 0,
+ "translatable": 0,
"unique": 0
},
{
@@ -1633,6 +1685,7 @@
"reqd": 0,
"search_index": 0,
"set_only_once": 0,
+ "translatable": 0,
"unique": 0
},
{
@@ -1665,6 +1718,7 @@
"reqd": 0,
"search_index": 0,
"set_only_once": 0,
+ "translatable": 0,
"unique": 0
},
{
@@ -1695,6 +1749,7 @@
"reqd": 0,
"search_index": 0,
"set_only_once": 0,
+ "translatable": 0,
"unique": 0
},
{
@@ -1725,6 +1780,7 @@
"reqd": 0,
"search_index": 0,
"set_only_once": 0,
+ "translatable": 0,
"unique": 0
},
{
@@ -1756,6 +1812,7 @@
"reqd": 0,
"search_index": 0,
"set_only_once": 0,
+ "translatable": 0,
"unique": 0
},
{
@@ -1788,6 +1845,7 @@
"reqd": 0,
"search_index": 0,
"set_only_once": 0,
+ "translatable": 0,
"unique": 0
},
{
@@ -1820,6 +1878,7 @@
"reqd": 0,
"search_index": 0,
"set_only_once": 0,
+ "translatable": 0,
"unique": 0
},
{
@@ -1852,6 +1911,7 @@
"reqd": 0,
"search_index": 0,
"set_only_once": 0,
+ "translatable": 0,
"unique": 0
},
{
@@ -1881,6 +1941,7 @@
"reqd": 0,
"search_index": 0,
"set_only_once": 0,
+ "translatable": 0,
"unique": 0
},
{
@@ -1913,6 +1974,7 @@
"reqd": 0,
"search_index": 0,
"set_only_once": 0,
+ "translatable": 0,
"unique": 0
},
{
@@ -1945,6 +2007,7 @@
"reqd": 0,
"search_index": 0,
"set_only_once": 0,
+ "translatable": 0,
"unique": 0
},
{
@@ -1976,6 +2039,7 @@
"reqd": 0,
"search_index": 0,
"set_only_once": 0,
+ "translatable": 0,
"unique": 0
},
{
@@ -2007,6 +2071,7 @@
"reqd": 0,
"search_index": 0,
"set_only_once": 0,
+ "translatable": 0,
"unique": 0
},
{
@@ -2039,6 +2104,7 @@
"reqd": 0,
"search_index": 0,
"set_only_once": 0,
+ "translatable": 0,
"unique": 0
},
{
@@ -2070,6 +2136,7 @@
"reqd": 0,
"search_index": 0,
"set_only_once": 0,
+ "translatable": 0,
"unique": 0
},
{
@@ -2099,6 +2166,7 @@
"reqd": 0,
"search_index": 0,
"set_only_once": 0,
+ "translatable": 0,
"unique": 0
},
{
@@ -2129,6 +2197,7 @@
"reqd": 0,
"search_index": 0,
"set_only_once": 0,
+ "translatable": 0,
"unique": 0
},
{
@@ -2160,6 +2229,7 @@
"reqd": 0,
"search_index": 0,
"set_only_once": 0,
+ "translatable": 0,
"unique": 0
},
{
@@ -2189,6 +2259,7 @@
"reqd": 0,
"search_index": 0,
"set_only_once": 0,
+ "translatable": 0,
"unique": 0
},
{
@@ -2221,6 +2292,7 @@
"reqd": 0,
"search_index": 0,
"set_only_once": 0,
+ "translatable": 0,
"unique": 0
},
{
@@ -2252,6 +2324,7 @@
"reqd": 0,
"search_index": 0,
"set_only_once": 0,
+ "translatable": 0,
"unique": 0
},
{
@@ -2284,6 +2357,7 @@
"reqd": 0,
"search_index": 0,
"set_only_once": 0,
+ "translatable": 0,
"unique": 0
},
{
@@ -2316,6 +2390,7 @@
"reqd": 0,
"search_index": 0,
"set_only_once": 0,
+ "translatable": 0,
"unique": 0
},
{
@@ -2345,6 +2420,7 @@
"reqd": 0,
"search_index": 0,
"set_only_once": 0,
+ "translatable": 0,
"unique": 0,
"width": "50%"
},
@@ -2378,6 +2454,7 @@
"reqd": 0,
"search_index": 0,
"set_only_once": 0,
+ "translatable": 0,
"unique": 0
},
{
@@ -2409,6 +2486,7 @@
"reqd": 0,
"search_index": 0,
"set_only_once": 0,
+ "translatable": 0,
"unique": 0
},
{
@@ -2441,6 +2519,7 @@
"reqd": 0,
"search_index": 0,
"set_only_once": 0,
+ "translatable": 0,
"unique": 0
},
{
@@ -2472,6 +2551,7 @@
"reqd": 0,
"search_index": 0,
"set_only_once": 0,
+ "translatable": 0,
"unique": 0
},
{
@@ -2504,6 +2584,7 @@
"reqd": 0,
"search_index": 0,
"set_only_once": 0,
+ "translatable": 0,
"unique": 0
},
{
@@ -2536,6 +2617,7 @@
"reqd": 0,
"search_index": 0,
"set_only_once": 0,
+ "translatable": 0,
"unique": 0
},
{
@@ -2567,6 +2649,7 @@
"reqd": 0,
"search_index": 0,
"set_only_once": 0,
+ "translatable": 0,
"unique": 0
},
{
@@ -2599,6 +2682,7 @@
"reqd": 0,
"search_index": 0,
"set_only_once": 0,
+ "translatable": 0,
"unique": 0
},
{
@@ -2630,6 +2714,7 @@
"reqd": 0,
"search_index": 0,
"set_only_once": 0,
+ "translatable": 0,
"unique": 0
},
{
@@ -2661,6 +2746,7 @@
"reqd": 0,
"search_index": 0,
"set_only_once": 0,
+ "translatable": 0,
"unique": 0
},
{
@@ -2690,6 +2776,7 @@
"reqd": 0,
"search_index": 0,
"set_only_once": 0,
+ "translatable": 0,
"unique": 0
},
{
@@ -2722,6 +2809,7 @@
"reqd": 0,
"search_index": 0,
"set_only_once": 0,
+ "translatable": 0,
"unique": 0
},
{
@@ -2753,6 +2841,7 @@
"reqd": 0,
"search_index": 0,
"set_only_once": 0,
+ "translatable": 0,
"unique": 0
},
{
@@ -2785,6 +2874,7 @@
"reqd": 0,
"search_index": 0,
"set_only_once": 0,
+ "translatable": 0,
"unique": 0
},
{
@@ -2815,6 +2905,7 @@
"reqd": 0,
"search_index": 0,
"set_only_once": 0,
+ "translatable": 0,
"unique": 0
},
{
@@ -2846,6 +2937,7 @@
"reqd": 0,
"search_index": 0,
"set_only_once": 0,
+ "translatable": 0,
"unique": 0
},
{
@@ -2875,6 +2967,7 @@
"reqd": 0,
"search_index": 0,
"set_only_once": 0,
+ "translatable": 0,
"unique": 0
},
{
@@ -2906,6 +2999,7 @@
"reqd": 0,
"search_index": 0,
"set_only_once": 0,
+ "translatable": 0,
"unique": 0
},
{
@@ -2937,6 +3031,7 @@
"reqd": 0,
"search_index": 0,
"set_only_once": 0,
+ "translatable": 0,
"unique": 0
},
{
@@ -2969,6 +3064,7 @@
"reqd": 0,
"search_index": 0,
"set_only_once": 0,
+ "translatable": 0,
"unique": 0
},
{
@@ -3000,6 +3096,7 @@
"reqd": 0,
"search_index": 0,
"set_only_once": 0,
+ "translatable": 0,
"unique": 0
},
{
@@ -3032,6 +3129,7 @@
"reqd": 0,
"search_index": 0,
"set_only_once": 0,
+ "translatable": 0,
"unique": 0
},
{
@@ -3063,6 +3161,7 @@
"reqd": 0,
"search_index": 0,
"set_only_once": 0,
+ "translatable": 0,
"unique": 0
},
{
@@ -3094,6 +3193,7 @@
"reqd": 0,
"search_index": 0,
"set_only_once": 0,
+ "translatable": 0,
"unique": 0
},
{
@@ -3125,6 +3225,7 @@
"reqd": 0,
"search_index": 0,
"set_only_once": 0,
+ "translatable": 0,
"unique": 0
},
{
@@ -3156,6 +3257,7 @@
"reqd": 0,
"search_index": 0,
"set_only_once": 0,
+ "translatable": 0,
"unique": 0
},
{
@@ -3186,6 +3288,7 @@
"reqd": 0,
"search_index": 0,
"set_only_once": 0,
+ "translatable": 0,
"unique": 0
},
{
@@ -3215,6 +3318,7 @@
"reqd": 0,
"search_index": 0,
"set_only_once": 0,
+ "translatable": 0,
"unique": 0
},
{
@@ -3245,6 +3349,7 @@
"reqd": 0,
"search_index": 0,
"set_only_once": 0,
+ "translatable": 0,
"unique": 0
},
{
@@ -3277,6 +3382,7 @@
"reqd": 0,
"search_index": 0,
"set_only_once": 0,
+ "translatable": 0,
"unique": 0
},
{
@@ -3309,6 +3415,7 @@
"reqd": 0,
"search_index": 0,
"set_only_once": 0,
+ "translatable": 0,
"unique": 0,
"width": "50px"
},
@@ -3341,6 +3448,7 @@
"reqd": 0,
"search_index": 0,
"set_only_once": 0,
+ "translatable": 0,
"unique": 0
},
{
@@ -3371,6 +3479,7 @@
"reqd": 0,
"search_index": 0,
"set_only_once": 0,
+ "translatable": 0,
"unique": 0
},
{
@@ -3402,6 +3511,7 @@
"reqd": 0,
"search_index": 0,
"set_only_once": 0,
+ "translatable": 0,
"unique": 0
},
{
@@ -3434,6 +3544,7 @@
"reqd": 0,
"search_index": 0,
"set_only_once": 0,
+ "translatable": 0,
"unique": 0
},
{
@@ -3464,6 +3575,7 @@
"reqd": 0,
"search_index": 0,
"set_only_once": 0,
+ "translatable": 0,
"unique": 0
},
{
@@ -3495,6 +3607,7 @@
"reqd": 0,
"search_index": 0,
"set_only_once": 0,
+ "translatable": 0,
"unique": 0
},
{
@@ -3528,6 +3641,7 @@
"reqd": 1,
"search_index": 1,
"set_only_once": 0,
+ "translatable": 0,
"unique": 0
},
{
@@ -3559,6 +3673,7 @@
"reqd": 0,
"search_index": 0,
"set_only_once": 0,
+ "translatable": 0,
"unique": 0
},
{
@@ -3593,6 +3708,7 @@
"reqd": 0,
"search_index": 0,
"set_only_once": 0,
+ "translatable": 0,
"unique": 0
},
{
@@ -3624,6 +3740,7 @@
"reqd": 0,
"search_index": 0,
"set_only_once": 0,
+ "translatable": 0,
"unique": 0
},
{
@@ -3652,6 +3769,7 @@
"reqd": 0,
"search_index": 0,
"set_only_once": 0,
+ "translatable": 0,
"unique": 0
},
{
@@ -3684,6 +3802,39 @@
"reqd": 0,
"search_index": 0,
"set_only_once": 0,
+ "translatable": 0,
+ "unique": 0
+ },
+ {
+ "allow_bulk_edit": 0,
+ "allow_on_submit": 0,
+ "bold": 0,
+ "collapsible": 0,
+ "columns": 0,
+ "fieldname": "inter_company_invoice_reference",
+ "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": "Inter Company Invoice Reference",
+ "length": 0,
+ "no_copy": 0,
+ "options": "Sales Invoice",
+ "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
},
{
@@ -3715,6 +3866,7 @@
"reqd": 0,
"search_index": 0,
"set_only_once": 0,
+ "translatable": 0,
"unique": 0
},
{
@@ -3747,6 +3899,7 @@
"reqd": 0,
"search_index": 0,
"set_only_once": 0,
+ "translatable": 0,
"unique": 0
},
{
@@ -3777,6 +3930,7 @@
"reqd": 0,
"search_index": 0,
"set_only_once": 0,
+ "translatable": 0,
"unique": 0
},
{
@@ -3808,6 +3962,7 @@
"reqd": 0,
"search_index": 0,
"set_only_once": 0,
+ "translatable": 0,
"unique": 0
},
{
@@ -3839,6 +3994,7 @@
"reqd": 0,
"search_index": 0,
"set_only_once": 0,
+ "translatable": 0,
"unique": 0
},
{
@@ -3868,6 +4024,7 @@
"reqd": 0,
"search_index": 0,
"set_only_once": 0,
+ "translatable": 0,
"unique": 0
},
{
@@ -3899,6 +4056,7 @@
"reqd": 0,
"search_index": 0,
"set_only_once": 0,
+ "translatable": 0,
"unique": 0
}
],
@@ -3914,7 +4072,7 @@
"istable": 0,
"max_attachments": 0,
"menu_index": 0,
- "modified": "2018-01-11 14:44:22.982512",
+ "modified": "2018-04-19 15:48:29.457594",
"modified_by": "Administrator",
"module": "Accounts",
"name": "Purchase Invoice",
@@ -3923,7 +4081,6 @@
"permissions": [
{
"amend": 1,
- "apply_user_permissions": 0,
"cancel": 1,
"create": 1,
"delete": 0,
@@ -3943,7 +4100,6 @@
},
{
"amend": 0,
- "apply_user_permissions": 0,
"cancel": 0,
"create": 0,
"delete": 0,
@@ -3963,7 +4119,6 @@
},
{
"amend": 1,
- "apply_user_permissions": 0,
"cancel": 1,
"create": 1,
"delete": 1,
@@ -3983,7 +4138,6 @@
},
{
"amend": 0,
- "apply_user_permissions": 0,
"cancel": 0,
"create": 0,
"delete": 0,
@@ -4003,7 +4157,6 @@
},
{
"amend": 0,
- "apply_user_permissions": 0,
"cancel": 0,
"create": 0,
"delete": 0,
diff --git a/erpnext/accounts/doctype/purchase_invoice/purchase_invoice.py b/erpnext/accounts/doctype/purchase_invoice/purchase_invoice.py
index d7e14e1..67b41a3 100644
--- a/erpnext/accounts/doctype/purchase_invoice/purchase_invoice.py
+++ b/erpnext/accounts/doctype/purchase_invoice/purchase_invoice.py
@@ -17,6 +17,8 @@
from erpnext.buying.utils import check_for_closed_status
from erpnext.accounts.general_ledger import get_round_off_account_and_cost_center
from frappe.model.mapper import get_mapped_doc
+from erpnext.accounts.doctype.sales_invoice.sales_invoice import validate_inter_company_party, update_linked_invoice,\
+ unlink_inter_company_invoice
form_grid_templates = {
"items": "templates/form_grid/item_grid.html"
@@ -73,6 +75,7 @@
self.validate_fixed_asset_account()
self.create_remarks()
self.set_status()
+ validate_inter_company_party(self.doctype, self.supplier, self.company, self.inter_company_invoice_reference)
def validate_cash(self):
if not self.cash_bank_account and flt(self.paid_amount):
@@ -303,6 +306,7 @@
self.update_project()
self.update_fixed_asset()
+ update_linked_invoice(self.doctype, self.name, self.inter_company_invoice_reference)
def update_fixed_asset(self):
for d in self.get("items"):
@@ -635,6 +639,8 @@
self.update_fixed_asset()
frappe.db.set(self, 'status', 'Cancelled')
+ unlink_inter_company_invoice(self.doctype, self.name, self.inter_company_invoice_reference)
+
def update_project(self):
project_list = []
for d in self.items:
@@ -733,4 +739,9 @@
}
}, target_doc)
- return doc
\ No newline at end of file
+ return doc
+
+@frappe.whitelist()
+def make_inter_company_sales_invoice(source_name, target_doc=None):
+ from erpnext.accounts.doctype.sales_invoice.sales_invoice import make_inter_company_invoice
+ return make_inter_company_invoice("Purchase Invoice", source_name, target_doc)
\ No newline at end of file
diff --git a/erpnext/accounts/doctype/sales_invoice/sales_invoice.js b/erpnext/accounts/doctype/sales_invoice/sales_invoice.js
index 2fcca75..77babf4 100644
--- a/erpnext/accounts/doctype/sales_invoice/sales_invoice.js
+++ b/erpnext/accounts/doctype/sales_invoice/sales_invoice.js
@@ -101,6 +101,19 @@
}
this.set_default_print_format();
+ var me = this;
+ if (doc.docstatus == 1 && !doc.inter_company_invoice_reference) {
+ frappe.model.with_doc("Customer", me.frm.doc.customer, function() {
+ var customer = frappe.model.get_doc("Customer", me.frm.doc.customer);
+ var internal = customer.is_internal_customer;
+ var disabled = customer.disabled;
+ if (internal == 1 && disabled == 0) {
+ me.frm.add_custom_button("Inter Company Invoice", function() {
+ me.make_inter_company_invoice();
+ }, __("Make"));
+ }
+ });
+ }
},
on_submit: function(doc, dt, dn) {
@@ -213,11 +226,9 @@
tc_name: function() {
this.get_terms();
},
-
customer: function() {
var me = this;
if(this.frm.updating_party_details) return;
-
erpnext.utils.get_party_details(this.frm,
"erpnext.accounts.party.get_party_details", {
posting_date: this.frm.doc.posting_date,
@@ -230,6 +241,13 @@
})
},
+ make_inter_company_invoice: function() {
+ frappe.model.open_mapped_doc({
+ method: "erpnext.accounts.doctype.sales_invoice.sales_invoice.make_inter_company_purchase_invoice",
+ frm: me.frm
+ });
+ },
+
debit_to: function() {
var me = this;
if(this.frm.doc.debit_to) {
@@ -633,4 +651,3 @@
refresh_field('total_billing_amount')
}
-
diff --git a/erpnext/accounts/doctype/sales_invoice/sales_invoice.json b/erpnext/accounts/doctype/sales_invoice/sales_invoice.json
index cfcc341..8fe63b4 100644
--- a/erpnext/accounts/doctype/sales_invoice/sales_invoice.json
+++ b/erpnext/accounts/doctype/sales_invoice/sales_invoice.json
@@ -15,1263 +15,1304 @@
"engine": "InnoDB",
"fields": [
{
- "allow_bulk_edit": 0,
- "allow_on_submit": 0,
- "bold": 0,
- "collapsible": 0,
- "columns": 0,
- "fieldname": "customer_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-user",
- "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,
+ "allow_bulk_edit": 0,
+ "allow_on_submit": 0,
+ "bold": 0,
+ "collapsible": 0,
+ "columns": 0,
+ "fieldname": "customer_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-user",
+ "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_on_submit": 1,
- "bold": 0,
- "collapsible": 0,
- "columns": 0,
- "default": "{customer_name}",
- "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,
+ "allow_bulk_edit": 0,
+ "allow_on_submit": 1,
+ "bold": 0,
+ "collapsible": 0,
+ "columns": 0,
+ "default": "{customer_name}",
+ "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_bulk_edit": 0,
- "allow_on_submit": 0,
- "bold": 1,
- "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": 1,
- "oldfieldname": "naming_series",
- "oldfieldtype": "Select",
- "options": "SINV-\nSINV-RET-",
- "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,
+ "allow_bulk_edit": 0,
+ "allow_on_submit": 0,
+ "bold": 1,
+ "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": 1,
+ "oldfieldname": "naming_series",
+ "oldfieldtype": "Select",
+ "options": "SINV-\nSINV-RET-",
+ "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
- },
+ },
{
- "allow_bulk_edit": 0,
- "allow_on_submit": 0,
- "bold": 1,
- "collapsible": 0,
- "columns": 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": 1,
- "label": "Customer",
- "length": 0,
- "no_copy": 0,
- "oldfieldname": "customer",
- "oldfieldtype": "Link",
- "options": "Customer",
- "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": 1,
- "set_only_once": 0,
+ "allow_bulk_edit": 0,
+ "allow_on_submit": 0,
+ "bold": 1,
+ "collapsible": 0,
+ "columns": 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": 1,
+ "label": "Customer",
+ "length": 0,
+ "no_copy": 0,
+ "oldfieldname": "customer",
+ "oldfieldtype": "Link",
+ "options": "Customer",
+ "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": 1,
+ "set_only_once": 0,
+ "translatable": 0,
"unique": 0
- },
+ },
{
- "allow_bulk_edit": 0,
- "allow_on_submit": 0,
- "bold": 1,
- "collapsible": 0,
- "columns": 0,
- "depends_on": "customer",
- "fieldname": "customer_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": "Customer Name",
- "length": 0,
- "no_copy": 0,
- "oldfieldname": "customer_name",
- "oldfieldtype": "Data",
- "options": "customer.customer_name",
- "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,
+ "allow_bulk_edit": 0,
+ "allow_on_submit": 0,
+ "bold": 1,
+ "collapsible": 0,
+ "columns": 0,
+ "depends_on": "customer",
+ "fieldname": "customer_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": "Customer Name",
+ "length": 0,
+ "no_copy": 0,
+ "oldfieldname": "customer_name",
+ "oldfieldtype": "Data",
+ "options": "customer.customer_name",
+ "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_on_submit": 0,
- "bold": 0,
- "collapsible": 0,
- "columns": 0,
- "fieldname": "tax_id",
- "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": "Tax Id",
- "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,
+ "allow_bulk_edit": 0,
+ "allow_on_submit": 0,
+ "bold": 0,
+ "collapsible": 0,
+ "columns": 0,
+ "fieldname": "tax_id",
+ "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": "Tax Id",
+ "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_on_submit": 0,
- "bold": 0,
- "collapsible": 0,
- "columns": 0,
- "fieldname": "project",
- "fieldtype": "Link",
- "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": "Project",
- "length": 0,
- "no_copy": 0,
- "oldfieldname": "project_name",
- "oldfieldtype": "Link",
- "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,
+ "allow_bulk_edit": 0,
+ "allow_on_submit": 0,
+ "bold": 0,
+ "collapsible": 0,
+ "columns": 0,
+ "fieldname": "project",
+ "fieldtype": "Link",
+ "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": "Project",
+ "length": 0,
+ "no_copy": 0,
+ "oldfieldname": "project_name",
+ "oldfieldtype": "Link",
+ "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_on_submit": 0,
- "bold": 0,
- "collapsible": 0,
- "columns": 0,
- "fieldname": "is_pos",
- "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 Payment (POS)",
- "length": 0,
- "no_copy": 0,
- "oldfieldname": "is_pos",
- "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,
+ "allow_bulk_edit": 0,
+ "allow_on_submit": 0,
+ "bold": 0,
+ "collapsible": 0,
+ "columns": 0,
+ "fieldname": "is_pos",
+ "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 Payment (POS)",
+ "length": 0,
+ "no_copy": 0,
+ "oldfieldname": "is_pos",
+ "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
- },
+ },
{
- "allow_bulk_edit": 0,
- "allow_on_submit": 0,
- "bold": 0,
- "collapsible": 0,
- "columns": 0,
- "depends_on": "is_pos",
- "fieldname": "pos_profile",
- "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": "POS Profile",
- "length": 0,
- "no_copy": 0,
- "options": "POS Profile",
- "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,
+ "allow_bulk_edit": 0,
+ "allow_on_submit": 0,
+ "bold": 0,
+ "collapsible": 0,
+ "columns": 0,
+ "depends_on": "is_pos",
+ "fieldname": "pos_profile",
+ "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": "POS Profile",
+ "length": 0,
+ "no_copy": 0,
+ "options": "POS Profile",
+ "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_on_submit": 0,
- "bold": 0,
- "collapsible": 0,
- "columns": 0,
- "fieldname": "offline_pos_name",
- "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": "Offline POS Name",
- "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,
+ "allow_bulk_edit": 0,
+ "allow_on_submit": 0,
+ "bold": 0,
+ "collapsible": 0,
+ "columns": 0,
+ "fieldname": "offline_pos_name",
+ "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": "Offline POS Name",
+ "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_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,
+ "allow_bulk_edit": 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_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": 0,
- "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,
- "read_only": 0,
- "remember_last_selected_value": 1,
- "report_hide": 0,
- "reqd": 1,
- "search_index": 0,
- "set_only_once": 0,
+ "allow_bulk_edit": 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": 0,
+ "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,
+ "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_on_submit": 0,
- "bold": 1,
- "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": 0,
- "in_standard_filter": 0,
- "label": "Date",
- "length": 0,
- "no_copy": 1,
- "oldfieldname": "posting_date",
- "oldfieldtype": "Date",
- "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,
+ "allow_bulk_edit": 0,
+ "allow_on_submit": 0,
+ "bold": 1,
+ "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": 0,
+ "in_standard_filter": 0,
+ "label": "Date",
+ "length": 0,
+ "no_copy": 1,
+ "oldfieldname": "posting_date",
+ "oldfieldtype": "Date",
+ "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_on_submit": 0,
- "bold": 0,
- "collapsible": 0,
- "columns": 0,
- "fieldname": "posting_time",
- "fieldtype": "Time",
- "hidden": 0,
- "ignore_user_permissions": 0,
- "ignore_xss_filter": 0,
- "in_filter": 0,
- "in_global_search": 0,
- "in_list_view": 0,
- "in_standard_filter": 0,
- "label": "Posting Time",
- "length": 0,
- "no_copy": 1,
- "oldfieldname": "posting_time",
- "oldfieldtype": "Time",
- "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,
+ "allow_bulk_edit": 0,
+ "allow_on_submit": 0,
+ "bold": 0,
+ "collapsible": 0,
+ "columns": 0,
+ "fieldname": "posting_time",
+ "fieldtype": "Time",
+ "hidden": 0,
+ "ignore_user_permissions": 0,
+ "ignore_xss_filter": 0,
+ "in_filter": 0,
+ "in_global_search": 0,
+ "in_list_view": 0,
+ "in_standard_filter": 0,
+ "label": "Posting Time",
+ "length": 0,
+ "no_copy": 1,
+ "oldfieldname": "posting_time",
+ "oldfieldtype": "Time",
+ "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_on_submit": 0,
- "bold": 0,
- "collapsible": 0,
- "columns": 0,
- "depends_on": "eval:doc.docstatus==0",
- "fieldname": "set_posting_time",
- "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": "Edit Posting Date and Time",
- "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,
+ "allow_bulk_edit": 0,
+ "allow_on_submit": 0,
+ "bold": 0,
+ "collapsible": 0,
+ "columns": 0,
+ "depends_on": "eval:doc.docstatus==0",
+ "fieldname": "set_posting_time",
+ "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": "Edit Posting Date and Time",
+ "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_on_submit": 0,
- "bold": 0,
- "collapsible": 0,
- "columns": 0,
- "fieldname": "due_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": "Payment Due Date",
- "length": 0,
- "no_copy": 1,
- "oldfieldname": "due_date",
- "oldfieldtype": "Date",
- "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,
+ "allow_bulk_edit": 0,
+ "allow_on_submit": 0,
+ "bold": 0,
+ "collapsible": 0,
+ "columns": 0,
+ "fieldname": "due_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": "Payment Due Date",
+ "length": 0,
+ "no_copy": 1,
+ "oldfieldname": "due_date",
+ "oldfieldtype": "Date",
+ "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_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": "Link",
- "options": "Sales Invoice",
- "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,
+ "allow_bulk_edit": 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": "Link",
+ "options": "Sales Invoice",
+ "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_on_submit": 0,
- "bold": 0,
- "collapsible": 0,
- "columns": 0,
- "depends_on": "is_return",
- "fieldname": "returns",
- "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": "Returns",
- "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,
+ "allow_bulk_edit": 0,
+ "allow_on_submit": 0,
+ "bold": 0,
+ "collapsible": 0,
+ "columns": 0,
+ "depends_on": "is_return",
+ "fieldname": "returns",
+ "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": "Returns",
+ "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_on_submit": 0,
- "bold": 0,
- "collapsible": 0,
- "columns": 0,
- "depends_on": "is_return",
- "fieldname": "is_return",
- "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 Return",
- "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,
+ "allow_bulk_edit": 0,
+ "allow_on_submit": 0,
+ "bold": 0,
+ "collapsible": 0,
+ "columns": 0,
+ "depends_on": "is_return",
+ "fieldname": "is_return",
+ "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 Return",
+ "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_on_submit": 0,
- "bold": 0,
- "collapsible": 0,
- "columns": 0,
- "depends_on": "is_return",
- "fieldname": "return_against",
- "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": "Return Against Sales Invoice",
- "length": 0,
- "no_copy": 1,
- "options": "Sales Invoice",
- "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,
+ "allow_bulk_edit": 0,
+ "allow_on_submit": 0,
+ "bold": 0,
+ "collapsible": 0,
+ "columns": 0,
+ "depends_on": "is_return",
+ "fieldname": "return_against",
+ "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": "Return Against Sales Invoice",
+ "length": 0,
+ "no_copy": 1,
+ "options": "Sales Invoice",
+ "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_on_submit": 0,
- "bold": 0,
- "collapsible": 1,
- "collapsible_depends_on": "po_no",
- "columns": 0,
- "fieldname": "customer_po_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 PO 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,
+ "allow_bulk_edit": 0,
+ "allow_on_submit": 0,
+ "bold": 0,
+ "collapsible": 1,
+ "collapsible_depends_on": "po_no",
+ "columns": 0,
+ "fieldname": "customer_po_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 PO 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_on_submit": 1,
- "bold": 0,
- "collapsible": 0,
- "columns": 0,
- "fieldname": "po_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": "Customer's Purchase Order",
- "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,
+ "allow_bulk_edit": 0,
+ "allow_on_submit": 1,
+ "bold": 0,
+ "collapsible": 0,
+ "columns": 0,
+ "fieldname": "po_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": "Customer's Purchase Order",
+ "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_on_submit": 0,
- "bold": 0,
- "collapsible": 0,
- "columns": 0,
- "fieldname": "column_break_23",
- "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,
+ "allow_bulk_edit": 0,
+ "allow_on_submit": 0,
+ "bold": 0,
+ "collapsible": 0,
+ "columns": 0,
+ "fieldname": "column_break_23",
+ "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_on_submit": 1,
- "bold": 0,
- "collapsible": 0,
- "columns": 0,
- "fieldname": "po_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": "Customer's Purchase Order 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,
+ "allow_bulk_edit": 0,
+ "allow_on_submit": 1,
+ "bold": 0,
+ "collapsible": 0,
+ "columns": 0,
+ "fieldname": "po_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": "Customer's Purchase Order 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_on_submit": 0,
- "bold": 0,
- "collapsible": 1,
- "columns": 0,
- "depends_on": "",
- "fieldname": "address_and_contact",
- "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": "Address and Contact",
- "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,
+ "allow_bulk_edit": 0,
+ "allow_on_submit": 0,
+ "bold": 0,
+ "collapsible": 1,
+ "columns": 0,
+ "depends_on": "",
+ "fieldname": "address_and_contact",
+ "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": "Address and Contact",
+ "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_on_submit": 0,
- "bold": 0,
- "collapsible": 0,
- "columns": 0,
- "fieldname": "customer_address",
- "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 Address",
- "length": 0,
- "no_copy": 0,
- "options": "Address",
- "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,
+ "allow_bulk_edit": 0,
+ "allow_on_submit": 0,
+ "bold": 0,
+ "collapsible": 0,
+ "columns": 0,
+ "fieldname": "customer_address",
+ "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 Address",
+ "length": 0,
+ "no_copy": 0,
+ "options": "Address",
+ "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_on_submit": 0,
- "bold": 0,
- "collapsible": 0,
- "columns": 0,
- "fieldname": "address_display",
- "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": "Address",
- "length": 0,
- "no_copy": 0,
- "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,
+ "allow_bulk_edit": 0,
+ "allow_on_submit": 0,
+ "bold": 0,
+ "collapsible": 0,
+ "columns": 0,
+ "fieldname": "address_display",
+ "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": "Address",
+ "length": 0,
+ "no_copy": 0,
+ "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_on_submit": 0,
- "bold": 0,
- "collapsible": 0,
- "columns": 0,
- "fieldname": "contact_person",
- "fieldtype": "Link",
- "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": "Contact Person",
- "length": 0,
- "no_copy": 0,
- "options": "Contact",
- "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,
+ "allow_bulk_edit": 0,
+ "allow_on_submit": 0,
+ "bold": 0,
+ "collapsible": 0,
+ "columns": 0,
+ "fieldname": "contact_person",
+ "fieldtype": "Link",
+ "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": "Contact Person",
+ "length": 0,
+ "no_copy": 0,
+ "options": "Contact",
+ "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_on_submit": 0,
- "bold": 0,
- "collapsible": 0,
- "columns": 0,
- "fieldname": "contact_display",
- "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": "Contact",
- "length": 0,
- "no_copy": 0,
- "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,
+ "allow_bulk_edit": 0,
+ "allow_on_submit": 0,
+ "bold": 0,
+ "collapsible": 0,
+ "columns": 0,
+ "fieldname": "contact_display",
+ "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": "Contact",
+ "length": 0,
+ "no_copy": 0,
+ "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_on_submit": 0,
- "bold": 0,
- "collapsible": 0,
- "columns": 0,
- "fieldname": "contact_mobile",
- "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": "Mobile No",
- "length": 0,
- "no_copy": 0,
- "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,
+ "allow_bulk_edit": 0,
+ "allow_on_submit": 0,
+ "bold": 0,
+ "collapsible": 0,
+ "columns": 0,
+ "fieldname": "contact_mobile",
+ "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": "Mobile No",
+ "length": 0,
+ "no_copy": 0,
+ "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_on_submit": 0,
- "bold": 0,
- "collapsible": 0,
- "columns": 0,
- "fieldname": "contact_email",
- "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": "Contact Email",
- "length": 0,
- "no_copy": 0,
- "options": "Email",
- "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,
+ "allow_bulk_edit": 0,
+ "allow_on_submit": 0,
+ "bold": 0,
+ "collapsible": 0,
+ "columns": 0,
+ "fieldname": "contact_email",
+ "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": "Contact Email",
+ "length": 0,
+ "no_copy": 0,
+ "options": "Email",
+ "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_on_submit": 0,
- "bold": 0,
- "collapsible": 0,
- "columns": 0,
- "fieldname": "territory",
- "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": "Territory",
- "length": 0,
- "no_copy": 0,
- "options": "Territory",
- "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,
+ "allow_bulk_edit": 0,
+ "allow_on_submit": 0,
+ "bold": 0,
+ "collapsible": 0,
+ "columns": 0,
+ "fieldname": "territory",
+ "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": "Territory",
+ "length": 0,
+ "no_copy": 0,
+ "options": "Territory",
+ "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_on_submit": 0,
- "bold": 0,
- "collapsible": 0,
- "columns": 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,
- "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,
+ "allow_bulk_edit": 0,
+ "allow_on_submit": 0,
+ "bold": 0,
+ "collapsible": 0,
+ "columns": 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,
+ "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_on_submit": 0,
- "bold": 0,
- "collapsible": 0,
- "columns": 0,
- "fieldname": "shipping_address_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": "Shipping Address Name",
- "length": 0,
- "no_copy": 0,
- "options": "Address",
- "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,
+ "allow_bulk_edit": 0,
+ "allow_on_submit": 0,
+ "bold": 0,
+ "collapsible": 0,
+ "columns": 0,
+ "fieldname": "shipping_address_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": "Shipping Address Name",
+ "length": 0,
+ "no_copy": 0,
+ "options": "Address",
+ "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_on_submit": 0,
- "bold": 0,
- "collapsible": 0,
- "columns": 0,
- "fieldname": "shipping_address",
- "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": "Shipping Address",
- "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,
+ "allow_bulk_edit": 0,
+ "allow_on_submit": 0,
+ "bold": 0,
+ "collapsible": 0,
+ "columns": 0,
+ "fieldname": "shipping_address",
+ "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": "Shipping Address",
+ "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_on_submit": 0,
- "bold": 0,
- "collapsible": 0,
- "columns": 0,
- "fieldname": "company_address",
- "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": "Company Address Name",
- "length": 0,
- "no_copy": 0,
- "options": "Address",
- "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,
+ "allow_bulk_edit": 0,
+ "allow_on_submit": 0,
+ "bold": 0,
+ "collapsible": 0,
+ "columns": 0,
+ "fieldname": "company_address",
+ "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": "Company Address Name",
+ "length": 0,
+ "no_copy": 0,
+ "options": "Address",
+ "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_on_submit": 0,
- "bold": 0,
- "collapsible": 0,
- "columns": 0,
- "fieldname": "company_address_display",
- "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": "Company Address",
- "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,
+ "allow_bulk_edit": 0,
+ "allow_on_submit": 0,
+ "bold": 0,
+ "collapsible": 0,
+ "columns": 0,
+ "fieldname": "company_address_display",
+ "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": "Company Address",
+ "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_on_submit": 0,
- "bold": 0,
- "collapsible": 1,
- "columns": 0,
- "depends_on": "customer",
- "fieldname": "currency_and_price_list",
- "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": "Currency and Price List",
- "length": 0,
- "no_copy": 0,
- "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,
+ "allow_bulk_edit": 0,
+ "allow_on_submit": 0,
+ "bold": 0,
+ "collapsible": 1,
+ "columns": 0,
+ "depends_on": "customer",
+ "fieldname": "currency_and_price_list",
+ "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": "Currency and Price List",
+ "length": 0,
+ "no_copy": 0,
+ "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_on_submit": 0,
- "bold": 0,
- "collapsible": 0,
- "columns": 0,
- "fieldname": "currency",
- "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": "Currency",
- "length": 0,
- "no_copy": 0,
- "oldfieldname": "currency",
- "oldfieldtype": "Select",
- "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": 1,
- "search_index": 0,
- "set_only_once": 0,
+ "allow_bulk_edit": 0,
+ "allow_on_submit": 0,
+ "bold": 0,
+ "collapsible": 0,
+ "columns": 0,
+ "fieldname": "currency",
+ "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": "Currency",
+ "length": 0,
+ "no_copy": 0,
+ "oldfieldname": "currency",
+ "oldfieldtype": "Select",
+ "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": 1,
+ "search_index": 0,
+ "set_only_once": 0,
+ "translatable": 0,
"unique": 0
- },
+ },
{
- "allow_bulk_edit": 0,
- "allow_on_submit": 0,
- "bold": 0,
- "collapsible": 0,
- "columns": 0,
- "description": "Rate at which Customer Currency is converted to customer's base currency",
- "fieldname": "conversion_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": "Exchange Rate",
- "length": 0,
- "no_copy": 0,
- "oldfieldname": "conversion_rate",
- "oldfieldtype": "Currency",
- "permlevel": 0,
- "precision": "9",
- "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,
+ "allow_bulk_edit": 0,
+ "allow_on_submit": 0,
+ "bold": 0,
+ "collapsible": 0,
+ "columns": 0,
+ "description": "Rate at which Customer Currency is converted to customer's base currency",
+ "fieldname": "conversion_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": "Exchange Rate",
+ "length": 0,
+ "no_copy": 0,
+ "oldfieldname": "conversion_rate",
+ "oldfieldtype": "Currency",
+ "permlevel": 0,
+ "precision": "9",
+ "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_on_submit": 0,
- "bold": 0,
- "collapsible": 0,
- "columns": 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,
- "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,
- "unique": 0,
+ "allow_bulk_edit": 0,
+ "allow_on_submit": 0,
+ "bold": 0,
+ "collapsible": 0,
+ "columns": 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,
+ "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%"
},
{
@@ -1304,6 +1345,7 @@
"reqd": 1,
"search_index": 0,
"set_only_once": 0,
+ "translatable": 0,
"unique": 0
},
{
@@ -1334,6 +1376,7 @@
"reqd": 1,
"search_index": 0,
"set_only_once": 0,
+ "translatable": 0,
"unique": 0
},
{
@@ -1365,6 +1408,7 @@
"reqd": 1,
"search_index": 0,
"set_only_once": 0,
+ "translatable": 0,
"unique": 0
},
{
@@ -1394,6 +1438,7 @@
"reqd": 0,
"search_index": 0,
"set_only_once": 0,
+ "translatable": 0,
"unique": 0
},
{
@@ -1425,6 +1470,7 @@
"reqd": 0,
"search_index": 0,
"set_only_once": 0,
+ "translatable": 0,
"unique": 0
},
{
@@ -1456,6 +1502,7 @@
"reqd": 0,
"search_index": 0,
"set_only_once": 0,
+ "translatable": 0,
"unique": 0
},
{
@@ -1488,6 +1535,7 @@
"reqd": 1,
"search_index": 0,
"set_only_once": 0,
+ "translatable": 0,
"unique": 0
},
{
@@ -1518,6 +1566,7 @@
"reqd": 0,
"search_index": 0,
"set_only_once": 0,
+ "translatable": 0,
"unique": 0
},
{
@@ -1548,6 +1597,7 @@
"reqd": 0,
"search_index": 0,
"set_only_once": 0,
+ "translatable": 0,
"unique": 0
},
{
@@ -1577,6 +1627,7 @@
"reqd": 0,
"search_index": 0,
"set_only_once": 0,
+ "translatable": 0,
"unique": 0
},
{
@@ -1609,6 +1660,7 @@
"reqd": 0,
"search_index": 0,
"set_only_once": 0,
+ "translatable": 0,
"unique": 0
},
{
@@ -1640,6 +1692,7 @@
"reqd": 0,
"search_index": 0,
"set_only_once": 0,
+ "translatable": 0,
"unique": 0
},
{
@@ -1671,6 +1724,7 @@
"reqd": 0,
"search_index": 0,
"set_only_once": 0,
+ "translatable": 0,
"unique": 0
},
{
@@ -1699,6 +1753,7 @@
"reqd": 0,
"search_index": 0,
"set_only_once": 0,
+ "translatable": 0,
"unique": 0
},
{
@@ -1730,6 +1785,7 @@
"reqd": 0,
"search_index": 0,
"set_only_once": 0,
+ "translatable": 0,
"unique": 0
},
{
@@ -1762,6 +1818,7 @@
"reqd": 1,
"search_index": 0,
"set_only_once": 0,
+ "translatable": 0,
"unique": 0
},
{
@@ -1790,6 +1847,7 @@
"reqd": 0,
"search_index": 0,
"set_only_once": 0,
+ "translatable": 0,
"unique": 0
},
{
@@ -1821,6 +1879,7 @@
"reqd": 0,
"search_index": 0,
"set_only_once": 0,
+ "translatable": 0,
"unique": 0
},
{
@@ -1851,6 +1910,7 @@
"reqd": 0,
"search_index": 0,
"set_only_once": 0,
+ "translatable": 0,
"unique": 0
},
{
@@ -1881,6 +1941,7 @@
"reqd": 0,
"search_index": 0,
"set_only_once": 0,
+ "translatable": 0,
"unique": 0
},
{
@@ -1912,6 +1973,7 @@
"reqd": 0,
"search_index": 0,
"set_only_once": 0,
+ "translatable": 0,
"unique": 0
},
{
@@ -1944,6 +2006,7 @@
"reqd": 0,
"search_index": 0,
"set_only_once": 0,
+ "translatable": 0,
"unique": 0
},
{
@@ -1972,6 +2035,7 @@
"reqd": 0,
"search_index": 0,
"set_only_once": 0,
+ "translatable": 0,
"unique": 0
},
{
@@ -2003,6 +2067,7 @@
"reqd": 0,
"search_index": 0,
"set_only_once": 0,
+ "translatable": 0,
"unique": 0
},
{
@@ -2031,6 +2096,7 @@
"reqd": 0,
"search_index": 0,
"set_only_once": 0,
+ "translatable": 0,
"unique": 0
},
{
@@ -2063,6 +2129,7 @@
"reqd": 0,
"search_index": 0,
"set_only_once": 0,
+ "translatable": 0,
"unique": 0
},
{
@@ -2093,6 +2160,7 @@
"reqd": 0,
"search_index": 0,
"set_only_once": 0,
+ "translatable": 0,
"unique": 0
},
{
@@ -2123,6 +2191,7 @@
"reqd": 0,
"search_index": 0,
"set_only_once": 0,
+ "translatable": 0,
"unique": 0
},
{
@@ -2151,6 +2220,7 @@
"reqd": 0,
"search_index": 0,
"set_only_once": 0,
+ "translatable": 0,
"unique": 0
},
{
@@ -2183,6 +2253,7 @@
"reqd": 0,
"search_index": 0,
"set_only_once": 0,
+ "translatable": 0,
"unique": 0
},
{
@@ -2212,6 +2283,7 @@
"reqd": 0,
"search_index": 0,
"set_only_once": 0,
+ "translatable": 0,
"unique": 0
},
{
@@ -2242,6 +2314,7 @@
"reqd": 0,
"search_index": 0,
"set_only_once": 0,
+ "translatable": 0,
"unique": 0
},
{
@@ -2273,6 +2346,7 @@
"reqd": 0,
"search_index": 0,
"set_only_once": 0,
+ "translatable": 0,
"unique": 0
},
{
@@ -2305,6 +2379,7 @@
"reqd": 0,
"search_index": 0,
"set_only_once": 0,
+ "translatable": 0,
"unique": 0
},
{
@@ -2336,6 +2411,7 @@
"reqd": 0,
"search_index": 0,
"set_only_once": 0,
+ "translatable": 0,
"unique": 0
},
{
@@ -2364,6 +2440,7 @@
"reqd": 0,
"search_index": 0,
"set_only_once": 0,
+ "translatable": 0,
"unique": 0
},
{
@@ -2394,6 +2471,7 @@
"reqd": 0,
"search_index": 0,
"set_only_once": 0,
+ "translatable": 0,
"unique": 0
},
{
@@ -2424,6 +2502,7 @@
"reqd": 0,
"search_index": 0,
"set_only_once": 0,
+ "translatable": 0,
"unique": 0
},
{
@@ -2455,6 +2534,7 @@
"reqd": 0,
"search_index": 0,
"set_only_once": 0,
+ "translatable": 0,
"unique": 0
},
{
@@ -2487,6 +2567,7 @@
"reqd": 1,
"search_index": 0,
"set_only_once": 0,
+ "translatable": 0,
"unique": 0
},
{
@@ -2518,6 +2599,7 @@
"reqd": 0,
"search_index": 0,
"set_only_once": 0,
+ "translatable": 0,
"unique": 0
},
{
@@ -2550,6 +2632,7 @@
"reqd": 0,
"search_index": 0,
"set_only_once": 0,
+ "translatable": 0,
"unique": 0
},
{
@@ -2582,6 +2665,7 @@
"reqd": 0,
"search_index": 0,
"set_only_once": 0,
+ "translatable": 0,
"unique": 0
},
{
@@ -2611,6 +2695,7 @@
"reqd": 0,
"search_index": 0,
"set_only_once": 0,
+ "translatable": 0,
"unique": 0,
"width": "50%"
},
@@ -2644,6 +2729,7 @@
"reqd": 1,
"search_index": 0,
"set_only_once": 0,
+ "translatable": 0,
"unique": 0
},
{
@@ -2675,6 +2761,7 @@
"reqd": 0,
"search_index": 0,
"set_only_once": 0,
+ "translatable": 0,
"unique": 0
},
{
@@ -2707,6 +2794,7 @@
"reqd": 0,
"search_index": 0,
"set_only_once": 0,
+ "translatable": 0,
"unique": 0
},
{
@@ -2738,6 +2826,7 @@
"reqd": 0,
"search_index": 0,
"set_only_once": 0,
+ "translatable": 0,
"unique": 0
},
{
@@ -2770,6 +2859,7 @@
"reqd": 0,
"search_index": 0,
"set_only_once": 0,
+ "translatable": 0,
"unique": 0
},
{
@@ -2802,6 +2892,7 @@
"reqd": 0,
"search_index": 0,
"set_only_once": 0,
+ "translatable": 0,
"unique": 0
},
{
@@ -2834,6 +2925,7 @@
"reqd": 0,
"search_index": 0,
"set_only_once": 0,
+ "translatable": 0,
"unique": 0
},
{
@@ -2865,6 +2957,7 @@
"reqd": 0,
"search_index": 0,
"set_only_once": 0,
+ "translatable": 0,
"unique": 0
},
{
@@ -2897,6 +2990,7 @@
"reqd": 0,
"search_index": 0,
"set_only_once": 0,
+ "translatable": 0,
"unique": 0
},
{
@@ -2928,6 +3022,7 @@
"reqd": 0,
"search_index": 0,
"set_only_once": 0,
+ "translatable": 0,
"unique": 0
},
{
@@ -2960,6 +3055,7 @@
"reqd": 0,
"search_index": 0,
"set_only_once": 0,
+ "translatable": 0,
"unique": 0
},
{
@@ -2992,6 +3088,7 @@
"reqd": 0,
"search_index": 0,
"set_only_once": 0,
+ "translatable": 0,
"unique": 0
},
{
@@ -3024,6 +3121,7 @@
"reqd": 0,
"search_index": 0,
"set_only_once": 0,
+ "translatable": 0,
"unique": 0
},
{
@@ -3057,6 +3155,7 @@
"reqd": 0,
"search_index": 0,
"set_only_once": 0,
+ "translatable": 0,
"unique": 0
},
{
@@ -3089,6 +3188,7 @@
"reqd": 0,
"search_index": 0,
"set_only_once": 0,
+ "translatable": 0,
"unique": 0
},
{
@@ -3118,6 +3218,7 @@
"reqd": 0,
"search_index": 0,
"set_only_once": 0,
+ "translatable": 0,
"unique": 0
},
{
@@ -3149,6 +3250,7 @@
"reqd": 0,
"search_index": 0,
"set_only_once": 0,
+ "translatable": 0,
"unique": 0
},
{
@@ -3178,6 +3280,7 @@
"reqd": 0,
"search_index": 0,
"set_only_once": 0,
+ "translatable": 0,
"unique": 0
},
{
@@ -3211,6 +3314,7 @@
"reqd": 0,
"search_index": 0,
"set_only_once": 0,
+ "translatable": 0,
"unique": 0
},
{
@@ -3240,6 +3344,7 @@
"reqd": 0,
"search_index": 0,
"set_only_once": 0,
+ "translatable": 0,
"unique": 0
},
{
@@ -3272,6 +3377,7 @@
"reqd": 0,
"search_index": 0,
"set_only_once": 0,
+ "translatable": 0,
"unique": 0
},
{
@@ -3301,6 +3407,7 @@
"reqd": 0,
"search_index": 0,
"set_only_once": 0,
+ "translatable": 0,
"unique": 0
},
{
@@ -3333,6 +3440,7 @@
"reqd": 0,
"search_index": 0,
"set_only_once": 0,
+ "translatable": 0,
"unique": 0
},
{
@@ -3365,6 +3473,7 @@
"reqd": 0,
"search_index": 0,
"set_only_once": 0,
+ "translatable": 0,
"unique": 0
},
{
@@ -3396,6 +3505,7 @@
"reqd": 0,
"search_index": 0,
"set_only_once": 0,
+ "translatable": 0,
"unique": 0,
"width": "50%"
},
@@ -3428,6 +3538,7 @@
"reqd": 0,
"search_index": 0,
"set_only_once": 0,
+ "translatable": 0,
"unique": 0
},
{
@@ -3459,6 +3570,7 @@
"reqd": 0,
"search_index": 0,
"set_only_once": 0,
+ "translatable": 0,
"unique": 0
},
{
@@ -3489,6 +3601,7 @@
"reqd": 0,
"search_index": 0,
"set_only_once": 0,
+ "translatable": 0,
"unique": 0
},
{
@@ -3519,6 +3632,7 @@
"reqd": 0,
"search_index": 0,
"set_only_once": 0,
+ "translatable": 0,
"unique": 0
},
{
@@ -3550,6 +3664,7 @@
"reqd": 0,
"search_index": 0,
"set_only_once": 0,
+ "translatable": 0,
"unique": 0
},
{
@@ -3581,6 +3696,7 @@
"reqd": 0,
"search_index": 0,
"set_only_once": 0,
+ "translatable": 0,
"unique": 0
},
{
@@ -3613,6 +3729,7 @@
"reqd": 0,
"search_index": 0,
"set_only_once": 0,
+ "translatable": 0,
"unique": 0
},
{
@@ -3645,6 +3762,7 @@
"reqd": 0,
"search_index": 0,
"set_only_once": 0,
+ "translatable": 0,
"unique": 0
},
{
@@ -3676,6 +3794,7 @@
"reqd": 0,
"search_index": 0,
"set_only_once": 0,
+ "translatable": 0,
"unique": 0
},
{
@@ -3706,6 +3825,7 @@
"reqd": 0,
"search_index": 0,
"set_only_once": 0,
+ "translatable": 0,
"unique": 0
},
{
@@ -3738,6 +3858,7 @@
"reqd": 0,
"search_index": 0,
"set_only_once": 0,
+ "translatable": 0,
"unique": 0
},
{
@@ -3768,6 +3889,7 @@
"reqd": 0,
"search_index": 0,
"set_only_once": 0,
+ "translatable": 0,
"unique": 0
},
{
@@ -3797,6 +3919,7 @@
"reqd": 0,
"search_index": 0,
"set_only_once": 0,
+ "translatable": 0,
"unique": 0
},
{
@@ -3829,6 +3952,7 @@
"reqd": 0,
"search_index": 0,
"set_only_once": 0,
+ "translatable": 0,
"unique": 0
},
{
@@ -3860,6 +3984,39 @@
"reqd": 0,
"search_index": 0,
"set_only_once": 0,
+ "translatable": 0,
+ "unique": 0
+ },
+ {
+ "allow_bulk_edit": 0,
+ "allow_on_submit": 0,
+ "bold": 0,
+ "collapsible": 0,
+ "columns": 0,
+ "fieldname": "inter_company_invoice_reference",
+ "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": "Inter Company Invoice Reference",
+ "length": 0,
+ "no_copy": 0,
+ "options": "Purchase Invoice",
+ "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
},
{
@@ -3891,6 +4048,7 @@
"reqd": 0,
"search_index": 0,
"set_only_once": 0,
+ "translatable": 0,
"unique": 0
},
{
@@ -3924,6 +4082,7 @@
"reqd": 0,
"search_index": 0,
"set_only_once": 0,
+ "translatable": 0,
"unique": 0
},
{
@@ -3952,6 +4111,7 @@
"reqd": 0,
"search_index": 0,
"set_only_once": 0,
+ "translatable": 0,
"unique": 0,
"width": "50%"
},
@@ -3985,6 +4145,7 @@
"reqd": 0,
"search_index": 0,
"set_only_once": 0,
+ "translatable": 0,
"unique": 0
},
{
@@ -4017,6 +4178,7 @@
"reqd": 0,
"search_index": 0,
"set_only_once": 0,
+ "translatable": 0,
"unique": 0
},
{
@@ -4048,6 +4210,7 @@
"reqd": 0,
"search_index": 0,
"set_only_once": 0,
+ "translatable": 0,
"unique": 0
},
{
@@ -4081,6 +4244,7 @@
"reqd": 1,
"search_index": 1,
"set_only_once": 0,
+ "translatable": 0,
"unique": 0
},
{
@@ -4112,6 +4276,7 @@
"reqd": 0,
"search_index": 0,
"set_only_once": 0,
+ "translatable": 0,
"unique": 0
},
{
@@ -4146,6 +4311,7 @@
"reqd": 0,
"search_index": 0,
"set_only_once": 0,
+ "translatable": 0,
"unique": 0
},
{
@@ -4176,6 +4342,7 @@
"reqd": 0,
"search_index": 0,
"set_only_once": 0,
+ "translatable": 0,
"unique": 0
},
{
@@ -4206,6 +4373,7 @@
"reqd": 0,
"search_index": 0,
"set_only_once": 0,
+ "translatable": 0,
"unique": 0
},
{
@@ -4235,6 +4403,7 @@
"reqd": 0,
"search_index": 0,
"set_only_once": 0,
+ "translatable": 0,
"unique": 0
},
{
@@ -4266,6 +4435,7 @@
"reqd": 0,
"search_index": 0,
"set_only_once": 0,
+ "translatable": 0,
"unique": 0
},
{
@@ -4298,6 +4468,7 @@
"reqd": 0,
"search_index": 0,
"set_only_once": 0,
+ "translatable": 0,
"unique": 0
},
{
@@ -4330,6 +4501,7 @@
"reqd": 0,
"search_index": 0,
"set_only_once": 0,
+ "translatable": 0,
"unique": 0
},
{
@@ -4359,6 +4531,7 @@
"reqd": 0,
"search_index": 0,
"set_only_once": 0,
+ "translatable": 0,
"unique": 0,
"width": "50%"
},
@@ -4391,6 +4564,7 @@
"reqd": 0,
"search_index": 0,
"set_only_once": 0,
+ "translatable": 0,
"unique": 0
},
{
@@ -4423,6 +4597,7 @@
"reqd": 0,
"search_index": 0,
"set_only_once": 0,
+ "translatable": 0,
"unique": 0
},
{
@@ -4453,6 +4628,7 @@
"reqd": 0,
"search_index": 0,
"set_only_once": 0,
+ "translatable": 0,
"unique": 0
},
{
@@ -4485,6 +4661,7 @@
"reqd": 0,
"search_index": 0,
"set_only_once": 0,
+ "translatable": 0,
"unique": 0
},
{
@@ -4515,6 +4692,7 @@
"reqd": 0,
"search_index": 0,
"set_only_once": 0,
+ "translatable": 0,
"unique": 0
},
{
@@ -4546,6 +4724,7 @@
"reqd": 0,
"search_index": 0,
"set_only_once": 0,
+ "translatable": 0,
"unique": 0
},
{
@@ -4577,6 +4756,7 @@
"reqd": 0,
"search_index": 0,
"set_only_once": 0,
+ "translatable": 0,
"unique": 0
},
{
@@ -4606,6 +4786,7 @@
"reqd": 0,
"search_index": 0,
"set_only_once": 0,
+ "translatable": 0,
"unique": 0
},
{
@@ -4637,6 +4818,7 @@
"reqd": 0,
"search_index": 0,
"set_only_once": 0,
+ "translatable": 0,
"unique": 0
},
{
@@ -4668,6 +4850,7 @@
"reqd": 0,
"search_index": 0,
"set_only_once": 0,
+ "translatable": 0,
"unique": 0
},
{
@@ -4698,6 +4881,7 @@
"reqd": 0,
"search_index": 0,
"set_only_once": 0,
+ "translatable": 0,
"unique": 0
}
],
@@ -4713,7 +4897,7 @@
"istable": 0,
"max_attachments": 0,
"menu_index": 0,
- "modified": "2018-03-16 15:19:54.711885",
+ "modified": "2018-04-19 15:46:45.766533",
"modified_by": "Administrator",
"module": "Accounts",
"name": "Sales Invoice",
@@ -4722,7 +4906,6 @@
"permissions": [
{
"amend": 1,
- "apply_user_permissions": 0,
"cancel": 1,
"create": 1,
"delete": 1,
@@ -4742,7 +4925,6 @@
},
{
"amend": 1,
- "apply_user_permissions": 0,
"cancel": 0,
"create": 1,
"delete": 0,
@@ -4762,7 +4944,6 @@
},
{
"amend": 0,
- "apply_user_permissions": 0,
"cancel": 0,
"create": 0,
"delete": 0,
@@ -4782,7 +4963,6 @@
},
{
"amend": 0,
- "apply_user_permissions": 0,
"cancel": 0,
"create": 0,
"delete": 0,
@@ -4812,4 +4992,4 @@
"title_field": "title",
"track_changes": 1,
"track_seen": 1
-}
+}
\ No newline at end of file
diff --git a/erpnext/accounts/doctype/sales_invoice/sales_invoice.py b/erpnext/accounts/doctype/sales_invoice/sales_invoice.py
index 78dcee9..f27d377 100644
--- a/erpnext/accounts/doctype/sales_invoice/sales_invoice.py
+++ b/erpnext/accounts/doctype/sales_invoice/sales_invoice.py
@@ -73,6 +73,7 @@
self.validate_account_for_change_amount()
self.validate_fixed_asset()
self.set_income_account_for_fixed_assets()
+ validate_inter_company_party(self.doctype, self.customer, self.company, self.inter_company_invoice_reference)
if cint(self.is_pos):
self.validate_pos()
@@ -146,6 +147,7 @@
update_company_current_month_sales(self.company)
self.update_project()
+ update_linked_invoice(self.doctype, self.name, self.inter_company_invoice_reference)
def validate_pos_paid_amount(self):
if len(self.payments) == 0 and self.is_pos:
@@ -186,6 +188,8 @@
update_company_current_month_sales(self.company)
self.update_project()
+ unlink_inter_company_invoice(self.doctype, self.name, self.inter_company_invoice_reference)
+
def update_status_updater_args(self):
if cint(self.update_stock):
self.status_updater.extend([{
@@ -336,7 +340,7 @@
for item in self.get("items"):
if item.get('item_code'):
for fname, val in get_pos_profile_item_details(pos,
- frappe._dict(item.as_dict()), pos, True).items():
+ frappe._dict(item.as_dict()), pos).items():
if (not for_validate) or (for_validate and not item.get(fname)):
item.set(fname, val)
@@ -907,11 +911,48 @@
project.update_billed_amount()
project.save()
+
def verify_payment_amount_is_positive(self):
for entry in self.payments:
if entry.amount < 0:
frappe.throw(_("Row #{0} (Payment Table): Amount must be positive").format(entry.idx))
+def validate_inter_company_party(doctype, party, company, inter_company_invoice_reference):
+ if doctype == "Sales Invoice":
+ partytype, ref_partytype, internal = "Customer", "Supplier", "is_internal_customer"
+ ref_doc = "Purchase Invoice"
+ else:
+ partytype, ref_partytype, internal = "Supplier", "Customer", "is_internal_supplier"
+ ref_doc = "Sales Invoice"
+
+ if inter_company_invoice_reference:
+ doc = frappe.get_doc(ref_doc, inter_company_invoice_reference)
+ ref_party = doc.supplier if doctype == "Sales Invoice" else doc.customer
+ if not frappe.db.get_value(partytype, {"represents_company": doc.company}, "name") == party:
+ frappe.throw(_("Invalid {0} for Inter Company Invoice.").format(partytype))
+ if not frappe.db.get_value(ref_partytype, {"name": ref_party}, "represents_company") == company:
+ frappe.throw(_("Invalid Company for Inter Company Invoice."))
+
+ elif frappe.db.get_value(partytype, {"name": party, internal: 1}, "name") == party:
+ companies = frappe.db.sql("""select company from `tabAllowed To Transact With`
+ where parenttype = '{0}' and parent = '{1}'""".format(partytype, party), as_list = 1)
+ companies = [d[0] for d in companies]
+ if not company in companies:
+ frappe.throw(_("{0} not allowed to transact with {1}. Please change the Company.").format(partytype, company))
+
+def update_linked_invoice(doctype, name, inter_company_invoice_reference):
+ if inter_company_invoice_reference:
+ frappe.db.set_value(doctype, inter_company_invoice_reference,\
+ "inter_company_invoice_reference", name)
+
+def unlink_inter_company_invoice(doctype, name, inter_company_invoice_reference):
+ ref_doc = "Purchase Invoice" if doctype == "Sales Invoice" else "Sales Invoice"
+ if inter_company_invoice_reference:
+ frappe.db.set_value(doctype, name,\
+ "inter_company_invoice_reference", "")
+ frappe.db.set_value(ref_doc, inter_company_invoice_reference,\
+ "inter_company_invoice_reference", "")
+
def get_list_context(context=None):
from erpnext.controllers.website_list_for_contact import get_list_context
list_context = get_list_context(context)
@@ -992,3 +1033,88 @@
for data in self.payments:
if not data.account:
data.account = get_bank_cash_account(data.mode_of_payment, self.company).get("account")
+
+def get_inter_company_details(doc, doctype):
+ if doctype == "Sales Invoice":
+ party = frappe.db.get_value("Supplier", {"disabled": 0, "is_internal_supplier": 1, "represents_company": doc.company}, "name")
+ company = frappe.db.get_value("Customer", {"name": doc.customer}, "represents_company")
+ else:
+ party = frappe.db.get_value("Customer", {"disabled": 0, "is_internal_customer": 1, "represents_company": doc.company}, "name")
+ company = frappe.db.get_value("Supplier", {"name": doc.supplier}, "represents_company")
+
+ return {
+ "party": party,
+ "company": company
+ }
+
+
+def validate_inter_company_invoice(doc, doctype):
+
+ details = get_inter_company_details(doc, doctype)
+ price_list = doc.selling_price_list if doctype == "Sales Invoice" else doc.buying_price_list
+ valid_price_list = frappe.db.get_value("Price List", {"name": price_list, "buying": 1, "selling": 1})
+ if not valid_price_list:
+ frappe.throw(_("Selected Price List should have buying and selling fields checked."))
+
+ party = details.get("party")
+ if not party:
+ partytype = "Supplier" if doctype == "Sales Invoice" else "Customer"
+ frappe.throw(_("No {0} found for Inter Company Transactions.").format(partytype))
+
+ company = details.get("company")
+ default_currency = frappe.db.get_value("Company", company, "default_currency")
+ if default_currency != doc.currency:
+ frappe.throw(_("Company currencies of both the companies should match for Inter Company Transactions."))
+
+ return
+
+@frappe.whitelist()
+def make_inter_company_purchase_invoice(source_name, target_doc=None):
+ return make_inter_company_invoice("Sales Invoice", source_name, target_doc)
+
+def make_inter_company_invoice(doctype, source_name, target_doc=None):
+ if doctype == "Sales Invoice":
+ source_doc = frappe.get_doc("Sales Invoice", source_name)
+ target_doctype = "Purchase Invoice"
+ else:
+ source_doc = frappe.get_doc("Purchase Invoice", source_name)
+ target_doctype = "Sales Invoice"
+
+ validate_inter_company_invoice(source_doc, doctype)
+ details = get_inter_company_details(source_doc, doctype)
+
+ def set_missing_values(source, target):
+ target.run_method("set_missing_values")
+
+ def update_details(source_doc, target_doc, source_parent):
+ target_doc.inter_company_invoice_reference = source_doc.name
+ if target_doc.doctype == "Purchase Invoice":
+ target_doc.company = details.get("company")
+ target_doc.supplier = details.get("party")
+ target_doc.buying_price_list = source_doc.selling_price_list
+ else:
+ target_doc.company = details.get("company")
+ target_doc.customer = details.get("party")
+ target_doc.selling_price_list = source_doc.buying_price_list
+
+ doclist = get_mapped_doc(doctype, source_name, {
+ doctype: {
+ "doctype": target_doctype,
+ "postprocess": update_details,
+ "field_no_map": [
+ "taxes_and_charges"
+ ]
+ },
+ doctype +" Item": {
+ "doctype": target_doctype + " Item",
+ "field_no_map": [
+ "income_account",
+ "expense_account",
+ "cost_center",
+ "warehouse"
+ ]
+ }
+
+ }, target_doc, set_missing_values)
+
+ return doclist
diff --git a/erpnext/accounts/report/accounts_payable/accounts_payable.js b/erpnext/accounts/report/accounts_payable/accounts_payable.js
index 63ef832..f39df3d 100644
--- a/erpnext/accounts/report/accounts_payable/accounts_payable.js
+++ b/erpnext/accounts/report/accounts_payable/accounts_payable.js
@@ -11,6 +11,12 @@
"default": frappe.defaults.get_user_default("Company")
},
{
+ "fieldname":"finance_book",
+ "label": __("Finance Book"),
+ "fieldtype": "Link",
+ "options": "Finance Book"
+ },
+ {
"fieldname":"supplier",
"label": __("Supplier"),
"fieldtype": "Link",
diff --git a/erpnext/accounts/report/accounts_receivable/accounts_receivable.js b/erpnext/accounts/report/accounts_receivable/accounts_receivable.js
index ec1e9f9..2caf359 100644
--- a/erpnext/accounts/report/accounts_receivable/accounts_receivable.js
+++ b/erpnext/accounts/report/accounts_receivable/accounts_receivable.js
@@ -11,6 +11,12 @@
"default": frappe.defaults.get_user_default("Company")
},
{
+ "fieldname":"finance_book",
+ "label": __("Finance Book"),
+ "fieldtype": "Link",
+ "options": "Finance Book"
+ },
+ {
"fieldname":"customer",
"label": __("Customer"),
"fieldtype": "Link",
diff --git a/erpnext/accounts/report/accounts_receivable/accounts_receivable.py b/erpnext/accounts/report/accounts_receivable/accounts_receivable.py
index 6109683..fc76be4 100644
--- a/erpnext/accounts/report/accounts_receivable/accounts_receivable.py
+++ b/erpnext/accounts/report/accounts_receivable/accounts_receivable.py
@@ -321,6 +321,13 @@
conditions.append("company=%s")
values.append(self.filters.company)
+ if self.filters.finance_book:
+ conditions.append("finance_book in (%s, '')")
+ values.append(self.filters.finance_book)
+ else:
+ conditions.append("ifnull(finance_book,'')=%s")
+ values.append('')
+
if self.filters.get(party_type_field):
conditions.append("party=%s")
values.append(self.filters.get(party_type_field))
diff --git a/erpnext/accounts/report/financial_statements.py b/erpnext/accounts/report/financial_statements.py
index dd47ca0..ea22bac 100644
--- a/erpnext/accounts/report/financial_statements.py
+++ b/erpnext/accounts/report/financial_statements.py
@@ -375,6 +375,12 @@
additional_conditions.append("project = '%s'" % (frappe.db.escape(filters.get("project"))))
if filters.get("cost_center"):
additional_conditions.append(get_cost_center_cond(filters.get("cost_center")))
+ if filters.get("finance_book"):
+ additional_conditions.append("finance_book in ('%s', '')" %
+ frappe.db.escape(filters.get("finance_book")))
+ else:
+ additional_conditions.append("ifnull(finance_book, '') = ''")
+
return " and {}".format(" and ".join(additional_conditions)) if additional_conditions else ""
diff --git a/erpnext/accounts/report/general_ledger/general_ledger.html b/erpnext/accounts/report/general_ledger/general_ledger.html
index 9a2205a..40469ae 100644
--- a/erpnext/accounts/report/general_ledger/general_ledger.html
+++ b/erpnext/accounts/report/general_ledger/general_ledger.html
@@ -2,7 +2,7 @@
<h4 class="text-center">
{% if (filters.party_name) { %}
{%= filters.party_name %}
- {% } else if (filters.party) { %}
+ {% } else if (filters.party && filters.show_name) { %}
{%= filters.party %}
{% } else if (filters.account) { %}
{%= filters.account %}
diff --git a/erpnext/accounts/report/general_ledger/general_ledger.js b/erpnext/accounts/report/general_ledger/general_ledger.js
index 6438263..9a774ce 100644
--- a/erpnext/accounts/report/general_ledger/general_ledger.js
+++ b/erpnext/accounts/report/general_ledger/general_ledger.js
@@ -12,6 +12,12 @@
"reqd": 1
},
{
+ "fieldname":"finance_book",
+ "label": __("Finance Book"),
+ "fieldtype": "Link",
+ "options": "Finance Book"
+ },
+ {
"fieldname":"from_date",
"label": __("From Date"),
"fieldtype": "Date",
@@ -72,31 +78,60 @@
{
"fieldname":"party",
"label": __("Party"),
- "fieldtype": "Dynamic Link",
- "get_options": function() {
+ "fieldtype": "MultiSelect",
+ get_data: function() {
+ if(!frappe.query_report_filters_by_name) return;
+
var party_type = frappe.query_report_filters_by_name.party_type.get_value();
- var party = frappe.query_report_filters_by_name.party.get_value();
- if(party && !party_type) {
+ var parties = frappe.query_report_filters_by_name.party.get_value();
+ if(!party_type) {
frappe.throw(__("Please select Party Type first"));
}
- return party_type;
+
+ const values = parties.split(/\s*,\s*/).filter(d => d);
+ const txt = parties.match(/[^,\s*]*$/)[0] || '';
+ let data = [];
+
+ frappe.call({
+ type: "GET",
+ method:'frappe.desk.search.search_link',
+ async: false,
+ no_spinner: true,
+ args: {
+ doctype: frappe.query_report_filters_by_name.party_type.get_value(),
+ txt: txt,
+ filters: {
+ "name": ["not in", values]
+ }
+ },
+ callback: function(r) {
+ data = r.results;
+ }
+ });
+ return data;
},
on_change: function() {
var party_type = frappe.query_report_filters_by_name.party_type.get_value();
- var party = frappe.query_report_filters_by_name.party.get_value();
- if(!party_type || !party) {
- frappe.query_report_filters_by_name.party_name.set_value("");
- return;
- }
- var fieldname = erpnext.utils.get_party_name(party_type) || "name";
- frappe.db.get_value(party_type, party, fieldname, function(value) {
- frappe.query_report_filters_by_name.party_name.set_value(value[fieldname]);
- });
+ var parties = frappe.query_report_filters_by_name.party.get_value();
+ const values = parties.split(/\s*,\s*/).filter(d => d);
- if (party_type === "Customer" || party_type === "Supplier") {
- frappe.db.get_value(party_type, party, "tax_id", function(value) {
- frappe.query_report_filters_by_name.tax_id.set_value(value["tax_id"]);
+ if(!party_type || !parties || values.length>1) {
+ frappe.query_report_filters_by_name.party_name.set_value("");
+ frappe.query_report_filters_by_name.tax_id.set_value("");
+ return;
+ } else {
+ var party = values[0];
+ frappe.query_report_filters_by_name.show_name = true;
+ var fieldname = erpnext.utils.get_party_name(party_type) || "name";
+ frappe.db.get_value(party_type, party, fieldname, function(value) {
+ frappe.query_report_filters_by_name.party_name.set_value(value[fieldname]);
});
+
+ if (party_type === "Customer" || party_type === "Supplier") {
+ frappe.db.get_value(party_type, party, "tax_id", function(value) {
+ frappe.query_report_filters_by_name.tax_id.set_value(value["tax_id"]);
+ });
+ }
}
}
},
diff --git a/erpnext/accounts/report/general_ledger/general_ledger.py b/erpnext/accounts/report/general_ledger/general_ledger.py
index d6972b9..2d0bd52 100644
--- a/erpnext/accounts/report/general_ledger/general_ledger.py
+++ b/erpnext/accounts/report/general_ledger/general_ledger.py
@@ -20,6 +20,10 @@
for acc in frappe.db.sql("""select name, is_group from tabAccount""", as_dict=1):
account_details.setdefault(acc.name, acc)
+ if filters.get('party'):
+ parties = str(filters.get("party")).strip()
+ filters.party = [d.strip() for d in parties.split(',') if d]
+
validate_filters(filters, account_details)
validate_party(filters)
@@ -57,14 +61,13 @@
if party:
if not party_type:
frappe.throw(_("To filter based on Party, select Party Type first"))
- elif not frappe.db.exists(party_type, party):
- frappe.throw(_("Invalid {0}: {1}").format(party_type, party))
-
+ else:
+ for d in party:
+ if not frappe.db.exists(party_type, d):
+ frappe.throw(_("Invalid {0}: {1}").format(party_type, d))
def set_account_currency(filters):
- if not (filters.get("account") or filters.get("party")):
- return filters
- else:
+ if filters.get("account") or (filters.get('party') and len(filters.party) == 1):
filters["company_currency"] = frappe.db.get_value("Company", filters.company, "default_currency")
account_currency = None
@@ -73,7 +76,7 @@
elif filters.get("party"):
gle_currency = frappe.db.get_value(
"GL Entry", {
- "party_type": filters.party_type, "party": filters.party, "company": filters.company
+ "party_type": filters.party_type, "party": filters.party[0], "company": filters.company
},
"account_currency"
)
@@ -82,14 +85,14 @@
account_currency = gle_currency
else:
account_currency = None if filters.party_type in ["Employee", "Student", "Shareholder"] else \
- frappe.db.get_value(filters.party_type, filters.party, "default_currency")
+ frappe.db.get_value(filters.party_type, filters.party[0], "default_currency")
filters["account_currency"] = account_currency or filters.company_currency
if filters.account_currency != filters.company_currency:
filters["show_in_account_currency"] = 1
- return filters
+ return filters
def get_result(filters, account_details):
gl_entries = get_gl_entries(filters)
@@ -151,7 +154,7 @@
conditions.append("party_type=%(party_type)s")
if filters.get("party"):
- conditions.append("party=%(party)s")
+ conditions.append("party in %(party)s")
if not (filters.get("account") or filters.get("party") or
filters.get("group_by") in ["Group by Account", "Group by Party"]):
@@ -161,6 +164,11 @@
if filters.get("project"):
conditions.append("project=%(project)s")
+ if filters.get("finance_book"):
+ conditions.append("finance_book in (%(finance_book)s, '')")
+ else:
+ conditions.append("ifnull(finance_book, '')=''")
+
from frappe.desk.reportview import build_match_conditions
match_conditions = build_match_conditions("GL Entry")
diff --git a/erpnext/assets/doctype/asset/asset.js b/erpnext/assets/doctype/asset/asset.js
index 236c4f9..f4a01ae 100644
--- a/erpnext/assets/doctype/asset/asset.js
+++ b/erpnext/assets/doctype/asset/asset.js
@@ -23,6 +23,14 @@
}
};
});
+
+ frm.set_query("department", function() {
+ return {
+ "filters": {
+ "company": frm.doc.company,
+ }
+ };
+ });
},
refresh: function(frm) {
diff --git a/erpnext/buying/doctype/supplier/supplier.json b/erpnext/buying/doctype/supplier/supplier.json
index e64dcb7..afb8899 100644
--- a/erpnext/buying/doctype/supplier/supplier.json
+++ b/erpnext/buying/doctype/supplier/supplier.json
@@ -180,6 +180,71 @@
"bold": 0,
"collapsible": 0,
"columns": 0,
+ "default": "0",
+ "fieldname": "is_internal_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": "Is Internal Supplier",
+ "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_on_submit": 0,
+ "bold": 0,
+ "collapsible": 0,
+ "columns": 0,
+ "depends_on": "is_internal_supplier",
+ "fieldname": "represents_company",
+ "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": "Represents Company",
+ "length": 0,
+ "no_copy": 0,
+ "options": "Company",
+ "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": 1
+ },
+ {
+ "allow_bulk_edit": 0,
+ "allow_on_submit": 0,
+ "bold": 0,
+ "collapsible": 0,
+ "columns": 0,
"fieldname": "image",
"fieldtype": "Attach Image",
"hidden": 1,
@@ -460,6 +525,71 @@
"allow_bulk_edit": 0,
"allow_on_submit": 0,
"bold": 0,
+ "collapsible": 0,
+ "columns": 0,
+ "depends_on": "represents_company",
+ "fieldname": "allowed_to_transact_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": "Allowed To Transact With",
+ "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_on_submit": 0,
+ "bold": 0,
+ "collapsible": 0,
+ "columns": 0,
+ "depends_on": "represents_company",
+ "fieldname": "companies",
+ "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": "Allowed To Transact With",
+ "length": 0,
+ "no_copy": 0,
+ "options": "Allowed To Transact With",
+ "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_on_submit": 0,
+ "bold": 0,
"collapsible": 1,
"columns": 0,
"fieldname": "section_break_7",
@@ -1033,7 +1163,7 @@
"issingle": 0,
"istable": 0,
"max_attachments": 0,
- "modified": "2018-04-13 18:45:44.023746",
+ "modified": "2018-04-19 12:19:52.519026",
"modified_by": "Administrator",
"module": "Buying",
"name": "Supplier",
diff --git a/erpnext/config/hr.py b/erpnext/config/hr.py
index fb00529..4e9e91e 100644
--- a/erpnext/config/hr.py
+++ b/erpnext/config/hr.py
@@ -25,6 +25,10 @@
},
{
"type": "doctype",
+ "name": "Attendance Request",
+ },
+ {
+ "type": "doctype",
"name": "Upload Attendance",
"hide_count": True
}
@@ -192,6 +196,36 @@
{
"type": "doctype",
"name": "Employee Promotion",
+ }
+ ]
+ },
+ {
+ "label": _("Recruitment"),
+ "items": [
+ {
+ "type": "doctype",
+ "name": "Job Applicant",
+ },
+ {
+ "type": "doctype",
+ "name": "Job Opening",
+ },
+ {
+ "type": "doctype",
+ "name": "Job Offer",
+ },
+ ]
+ },
+ {
+ "label": _("Employee Lifecycle"),
+ "items": [
+ {
+ "type": "doctype",
+ "name": "Employee Transfer",
+ },
+ {
+ "type": "doctype",
+ "name": "Employee Promotion",
},
{
"type": "doctype",
diff --git a/erpnext/demo/user/hr.py b/erpnext/demo/user/hr.py
index 6c6a7d4..b801686 100644
--- a/erpnext/demo/user/hr.py
+++ b/erpnext/demo/user/hr.py
@@ -105,10 +105,9 @@
and docstatus != 2""")
if sal_struct:
employees = frappe.db.sql("""
- select employee from `tabSalary Structure Employee`
- where parent IN %(sal_struct)s""", {"sal_struct": sal_struct}, as_dict=True)
+ select employee from `tabSalary Structure Assignment`
+ where salary_structure IN %(sal_struct)s""", {"sal_struct": sal_struct}, as_dict=True)
return employees
-
else:
return []
diff --git a/erpnext/docs/assets/img/accounts/exchange-rate-revaluation/exchange-rate-revaluation-submit.png b/erpnext/docs/assets/img/accounts/exchange-rate-revaluation/exchange-rate-revaluation-submit.png
new file mode 100644
index 0000000..98f629f
--- /dev/null
+++ b/erpnext/docs/assets/img/accounts/exchange-rate-revaluation/exchange-rate-revaluation-submit.png
Binary files differ
diff --git a/erpnext/docs/assets/img/accounts/exchange-rate-revaluation/exchange-rate-revaluation.png b/erpnext/docs/assets/img/accounts/exchange-rate-revaluation/exchange-rate-revaluation.png
new file mode 100644
index 0000000..fbd584b
--- /dev/null
+++ b/erpnext/docs/assets/img/accounts/exchange-rate-revaluation/exchange-rate-revaluation.png
Binary files differ
diff --git a/erpnext/docs/assets/img/accounts/exchange-rate-revaluation/field_set_company.png b/erpnext/docs/assets/img/accounts/exchange-rate-revaluation/field_set_company.png
new file mode 100644
index 0000000..94484f6
--- /dev/null
+++ b/erpnext/docs/assets/img/accounts/exchange-rate-revaluation/field_set_company.png
Binary files differ
diff --git a/erpnext/docs/assets/img/accounts/exchange-rate-revaluation/journal-entry.png b/erpnext/docs/assets/img/accounts/exchange-rate-revaluation/journal-entry.png
new file mode 100644
index 0000000..cf204bb
--- /dev/null
+++ b/erpnext/docs/assets/img/accounts/exchange-rate-revaluation/journal-entry.png
Binary files differ
diff --git a/erpnext/docs/assets/img/accounts/inter-company-jv-submit.png b/erpnext/docs/assets/img/accounts/inter-company-jv-submit.png
new file mode 100644
index 0000000..bde53da
--- /dev/null
+++ b/erpnext/docs/assets/img/accounts/inter-company-jv-submit.png
Binary files differ
diff --git a/erpnext/docs/assets/img/accounts/inter-company-jv.png b/erpnext/docs/assets/img/accounts/inter-company-jv.png
new file mode 100644
index 0000000..c8041fb
--- /dev/null
+++ b/erpnext/docs/assets/img/accounts/inter-company-jv.png
Binary files differ
diff --git a/erpnext/docs/assets/img/accounts/internal-account.png b/erpnext/docs/assets/img/accounts/internal-account.png
new file mode 100644
index 0000000..eb990ac
--- /dev/null
+++ b/erpnext/docs/assets/img/accounts/internal-account.png
Binary files differ
diff --git a/erpnext/docs/assets/img/accounts/linked-jv.png b/erpnext/docs/assets/img/accounts/linked-jv.png
new file mode 100644
index 0000000..9f44486
--- /dev/null
+++ b/erpnext/docs/assets/img/accounts/linked-jv.png
Binary files differ
diff --git a/erpnext/docs/assets/img/accounts/select-company-jv.png b/erpnext/docs/assets/img/accounts/select-company-jv.png
new file mode 100644
index 0000000..d005658
--- /dev/null
+++ b/erpnext/docs/assets/img/accounts/select-company-jv.png
Binary files differ
diff --git a/erpnext/docs/assets/img/human-resources/employee_promotion.png b/erpnext/docs/assets/img/human-resources/employee_promotion.png
new file mode 100644
index 0000000..d9ca321
--- /dev/null
+++ b/erpnext/docs/assets/img/human-resources/employee_promotion.png
Binary files differ
diff --git a/erpnext/docs/assets/img/human-resources/employee_promotion_1.png b/erpnext/docs/assets/img/human-resources/employee_promotion_1.png
new file mode 100644
index 0000000..a0bc9cc
--- /dev/null
+++ b/erpnext/docs/assets/img/human-resources/employee_promotion_1.png
Binary files differ
diff --git a/erpnext/docs/assets/img/human-resources/employee_transfer.png b/erpnext/docs/assets/img/human-resources/employee_transfer.png
new file mode 100644
index 0000000..edc641e
--- /dev/null
+++ b/erpnext/docs/assets/img/human-resources/employee_transfer.png
Binary files differ
diff --git a/erpnext/docs/assets/img/human-resources/employee_transfer_1.png b/erpnext/docs/assets/img/human-resources/employee_transfer_1.png
new file mode 100644
index 0000000..f9f87e6
--- /dev/null
+++ b/erpnext/docs/assets/img/human-resources/employee_transfer_1.png
Binary files differ
diff --git a/erpnext/docs/assets/img/human-resources/shift-assignment-calendar.png b/erpnext/docs/assets/img/human-resources/shift-assignment-calendar.png
new file mode 100644
index 0000000..7c8ec77
--- /dev/null
+++ b/erpnext/docs/assets/img/human-resources/shift-assignment-calendar.png
Binary files differ
diff --git a/erpnext/docs/assets/img/human-resources/shift-assignment.png b/erpnext/docs/assets/img/human-resources/shift-assignment.png
new file mode 100644
index 0000000..39c2857
--- /dev/null
+++ b/erpnext/docs/assets/img/human-resources/shift-assignment.png
Binary files differ
diff --git a/erpnext/docs/assets/img/human-resources/shift-request.png b/erpnext/docs/assets/img/human-resources/shift-request.png
new file mode 100644
index 0000000..77a7ad5
--- /dev/null
+++ b/erpnext/docs/assets/img/human-resources/shift-request.png
Binary files differ
diff --git a/erpnext/docs/assets/img/human-resources/shift-type.png b/erpnext/docs/assets/img/human-resources/shift-type.png
new file mode 100644
index 0000000..e03e45c
--- /dev/null
+++ b/erpnext/docs/assets/img/human-resources/shift-type.png
Binary files differ
diff --git a/erpnext/docs/user/manual/en/accounts/exchange-rate-revaluation.md b/erpnext/docs/user/manual/en/accounts/exchange-rate-revaluation.md
new file mode 100644
index 0000000..d4887d0
--- /dev/null
+++ b/erpnext/docs/user/manual/en/accounts/exchange-rate-revaluation.md
@@ -0,0 +1,35 @@
+# Exchange Rate Revaluation
+
+In ERPNext, you can make accounting entries in multiple currency. For example, if you have a bank account in foreign currency, you can make transactions in that currency and system will show bank balance in that specific currency only.
+
+## Setup
+
+To get started with multi-currency accounting, you need to assign accounting currency in Account record. You can define Currency from Chart of Accounts while creating Account.
+
+<img class="screenshot" alt="Set Currency from Chart of Accounts" src="{{docs_base_url}}/assets/img/accounts/multi-currency/chart-of-accounts.png">
+
+You can also assign / modify the currency by opening specific Account record for existing Accounts.
+
+<img class="screenshot" alt="Modify Account Currency" src="{{docs_base_url}}/assets/img/accounts/multi-currency/account.png">
+
+### Exchange Rate Revaluation
+
+Exchange Rate Revaluation feature is for dealing the situation when you have a multiple currency accounts in one company's chart of accounts
+
+Steps :
+
+1. Set the 'Unrealized Exchange / Gain Loss Account' field in Company DocType. This aacount is to balance the difference of total credit and total debit.
+
+<img class="screenshot" alt="Field Set for Comapny" src="{{docs_base_url}}/assets/img/accounts/exchange-rate-revaluation/field_set_company.png">
+
+2. Select the Company.
+
+3. Click the Get Entries button. It shows the accounts which having different currency as compare to 'Default Currency' in Company DocType. It will fetch the new exchange rate automatically if not set in Currency Exchange DocType for that currency else it will fetch the 'Exchange Rate' from Currency Exchange DocType
+
+<img class="screenshot" alt="Exchange Rate Revaluation" src="{{docs_base_url}}/assets/img/accounts/exchange-rate-revaluation/exchange-rate-revaluation.png">
+
+4. On Submitting, 'Make Journal Entry' button will appear. This will create a journal entry for the Exchange Rate Revaluation.
+
+<img class="screenshot" alt="Exchange Rate Revaluation Submitting" src="{{docs_base_url}}/assets/img/accounts/exchange-rate-revaluation/exchange-rate-revaluation-submit.png">
+
+<img class="screenshot" alt="Journal Entry" src="{{docs_base_url}}/assets/img/accounts/exchange-rate-revaluation/journal-entry.png">
\ No newline at end of file
diff --git a/erpnext/docs/user/manual/en/accounts/index.txt b/erpnext/docs/user/manual/en/accounts/index.txt
index 41cb243..a7e27cd 100644
--- a/erpnext/docs/user/manual/en/accounts/index.txt
+++ b/erpnext/docs/user/manual/en/accounts/index.txt
@@ -5,6 +5,7 @@
purchase-invoice
payments
journal-entry
+inter-company-journal-entry
payment-entry
subscription
multi-currency-accounting
diff --git a/erpnext/docs/user/manual/en/accounts/inter-company-journal-entry.md b/erpnext/docs/user/manual/en/accounts/inter-company-journal-entry.md
new file mode 100644
index 0000000..6bc2e5b
--- /dev/null
+++ b/erpnext/docs/user/manual/en/accounts/inter-company-journal-entry.md
@@ -0,0 +1,45 @@
+# Inter Company Journal Entry
+
+You can also create Inter Company Journal Entry if you are making transactions with multiple Companies.
+You can select the Accounts which you wish to use in the Inter Company transactions.
+Just go to,
+
+> Accounts > Company and Accounts > Chart Of Accounts
+
+Select the Account which you would like to set as an Internal Account for the transaction, and check the **Inter Company Account** checkbox. It can now be used for Inter Company Journal Entry Transactions.
+
+<img class="screenshot" alt="Internal Account" src="{{docs_base_url}}/assets/img/accounts/internal-account.png">
+
+You need to do the same for all the Companies' Accounts which you want to use for Inter Company Journal Entry transactions.
+
+Now, to create an Inter Company Journal Entry go to:
+
+> Accounts > Company and Accounts > Journal Entry > New
+
+<img class="screenshot" alt="Inter Company Journal Entry" src="{{docs_base_url}}/assets/img/accounts/inter-company-jv.png">
+
+In the Journal Entry, you must select,
+
+* Type of Voucher - **Inter Company Journal Entry**.
+* Add rows for the individual accounting entries. In each row, you must specify:
+ * The Internal account that will be affected.
+ * The amount to Debit or Credit.
+ * The Cost Center (If it is an Income or Expense).
+
+On submitting the Journal Entry, you will find a button on the top right corner, **Make Inter Company Journal Entry**.
+
+<img class="screenshot" alt="Submitted Inter Company Journal Entry" src="{{docs_base_url}}/assets/img/accounts/inter-company-jv-submit.png">
+
+Click on the button, you will be asked to select the Company against which you wish to create the linked Journal Entry.
+
+<img class="screenshot" alt="Select Company" src="{{docs_base_url}}/assets/img/accounts/select-company-jv.png">
+
+On selecting the Company, you will be routed to another Journal Entry where the relevant fields will be mapped, i.e. Company, Voucher Type, Inter Company Journal Entry Reference etc.
+
+<img class="screenshot" alt="Linked Journal Entry" src="{{docs_base_url}}/assets/img/accounts/linked-jv.png">
+
+Select the Internal accounts for the Company selected and submit the Journal Entry, make sure the total Debit and Credit Amounts are same as the previously created Journal Entry's total Credit and Debit Amounts respectively.
+
+You can also find the reference link at the bottom, which will be added in both the linked Journal Entries and will be removed if any of the Journal Entries are cancelled.
+
+{next}
diff --git a/erpnext/docs/user/manual/en/human-resources/employee_promption.md b/erpnext/docs/user/manual/en/human-resources/employee_promption.md
new file mode 100644
index 0000000..a3f1c2d
--- /dev/null
+++ b/erpnext/docs/user/manual/en/human-resources/employee_promption.md
@@ -0,0 +1,15 @@
+# Employee Promotion
+
+You can manage Employee Promotions using this document.
+
+To record an Employee Promotion go to
+
+> Human Resource > Employee Promotion > New Employee Promotion
+
+Select Employee and add all details to be updated to Promotion Details table.
+
+<img class="screenshot" alt="Employee Promotion" src="{{docs_base_url}}/assets/img/human-resources/employee_promotion.png">
+
+Promotion document can be submitted on or after Promotion Date. Once submitted all the changes added to Promotion Details table will applied to Employee.
+
+<img class="screenshot" alt="Employee Promotion" src="{{docs_base_url}}/assets/img/human-resources/employee_promotion_1.png">
diff --git a/erpnext/docs/user/manual/en/human-resources/employee_transfer.md b/erpnext/docs/user/manual/en/human-resources/employee_transfer.md
new file mode 100644
index 0000000..307f9b9
--- /dev/null
+++ b/erpnext/docs/user/manual/en/human-resources/employee_transfer.md
@@ -0,0 +1,17 @@
+# Employee Transfer
+
+You can transfer Employees to different Company or Department by using Employee Transfer.
+
+To reocord an Employee Transfer go to
+
+> Human Resource > Employee Transfer > New Employee Transfer
+
+Select Employee and add all details to be updated to Transfer Details table.
+
+<img class="screenshot" alt="Employee Transfer" src="{{docs_base_url}}/assets/img/human-resources/employee_transfer.png">
+
+Transfer document can be submitted on or after Transfer Date. Once submitted all the changes added to Transfer Details table will applied to Employee.
+
+<img class="screenshot" alt="Employee Transfer" src="{{docs_base_url}}/assets/img/human-resources/employee_transfer_1.png">
+
+> Note : If Create New Employee ID is checked, a new Employee will be created with property changes in Transfer Details table and old Employee will be marked as releived. Leave allocations for the new Employee has to be manually created from Leave Period.
diff --git a/erpnext/docs/user/manual/en/human-resources/index.txt b/erpnext/docs/user/manual/en/human-resources/index.txt
index 479e2dd..758cdaa 100644
--- a/erpnext/docs/user/manual/en/human-resources/index.txt
+++ b/erpnext/docs/user/manual/en/human-resources/index.txt
@@ -18,4 +18,6 @@
daily-work-summary
fleet-management
loan-management
+employee-promotion
+employee-transfer
articles
diff --git a/erpnext/docs/user/manual/en/human-resources/shift-management.md b/erpnext/docs/user/manual/en/human-resources/shift-management.md
new file mode 100644
index 0000000..2279538
--- /dev/null
+++ b/erpnext/docs/user/manual/en/human-resources/shift-management.md
@@ -0,0 +1,44 @@
+# Shift Management
+
+Shift Management section of Human Resources helps your Organization manage shifts of your employees.
+
+To use Shift Management in ERPNext,
+
+ 1. Set Up a Shift Type.
+ 2. Enter Shift Request.
+ 3. View and Manage Shift Assignments.
+
+### Shift Type
+
+The Shift Type Set Up allows you to define the different types of Shifts in your Organization.
+
+To create a new Shift Type go to:
+
+Human Resources > Shift Management > Shift Type
+
+* Enter Shift Type, Start Time and End Time for quick entry.
+
+ <img class="screenshot" alt="Shift Type" src="{{docs_base_url}}/assets/img/human-resources/shift-type.png">
+
+### Shift Request
+
+Shift Request is used by an employee to request for a particular Shift Type.
+
+To create a new Shift Request Log go to:
+
+Human Resources > Shift Management > Shift Request
+
+* Enter Shift Type, Employee, Company, From Date and To Date.
+
+ <img class="screenshot" alt="Shift Request" src="{{docs_base_url}}/assets/img/human-resources/shift-request.png">
+
+### Shift Assignment
+
+* Once the Shift Request is submitted it automatically creates the Shift Assignments for an Employee.
+
+ <img class="screenshot" alt="Shift Assignment" src="{{docs_base_url}}/assets/img/human-resources/shift-assignment.png">
+
+* You can also view Calendar view of Shift Assignments.
+
+ <img class="screenshot" alt="Shift Assignment Calendar"
+ src="{{docs_base_url}}/assets/img/human-resources/shift-assignment-calendar.png">
\ No newline at end of file
diff --git a/erpnext/education/doctype/instructor/instructor.js b/erpnext/education/doctype/instructor/instructor.js
index 62d73b3..f9c7a2a 100644
--- a/erpnext/education/doctype/instructor/instructor.js
+++ b/erpnext/education/doctype/instructor/instructor.js
@@ -1,31 +1,53 @@
cur_frm.add_fetch("employee", "department", "department");
cur_frm.add_fetch("employee", "image", "image");
-frappe.ui.form.on("Instructor", "refresh", function(frm) {
- if(!frm.doc.__islocal) {
- frm.add_custom_button(__("Student Group"), function() {
- frappe.route_options = {
- instructor: frm.doc.name
- }
- frappe.set_route("List", "Student Group");
+frappe.ui.form.on("Instructor", {
+ employee: function(frm) {
+ if(!frm.doc.employee) return;
+ frappe.db.get_value('Employee', {name: frm.doc.employee}, 'company', (company) => {
+ frm.set_query("department", function() {
+ return {
+ "filters": {
+ "company": company,
+ }
+ };
+ });
+
+ frm.set_query("department", "instructor_log", function() {
+ return {
+ "filters": {
+ "company": company,
+ }
+ };
+ });
});
- frm.add_custom_button(__("Course Schedule"), function() {
- frappe.route_options = {
- instructor: frm.doc.name
- }
- frappe.set_route("List", "Course Schedule");
- });
- frm.add_custom_button(__("As Examiner"), function() {
- frappe.route_options = {
- examiner: frm.doc.name
- }
- frappe.set_route("List", "Assessment Plan");
- }, __("Assessment Plan"));
- frm.add_custom_button(__("As Supervisor"), function() {
- frappe.route_options = {
- supervisor: frm.doc.name
- }
- frappe.set_route("List", "Assessment Plan");
- }, __("Assessment Plan"));
+ },
+ refresh: function(frm) {
+ if(!frm.doc.__islocal) {
+ frm.add_custom_button(__("Student Group"), function() {
+ frappe.route_options = {
+ instructor: frm.doc.name
+ }
+ frappe.set_route("List", "Student Group");
+ });
+ frm.add_custom_button(__("Course Schedule"), function() {
+ frappe.route_options = {
+ instructor: frm.doc.name
+ }
+ frappe.set_route("List", "Course Schedule");
+ });
+ frm.add_custom_button(__("As Examiner"), function() {
+ frappe.route_options = {
+ examiner: frm.doc.name
+ }
+ frappe.set_route("List", "Assessment Plan");
+ }, __("Assessment Plan"));
+ frm.add_custom_button(__("As Supervisor"), function() {
+ frappe.route_options = {
+ supervisor: frm.doc.name
+ }
+ frappe.set_route("List", "Assessment Plan");
+ }, __("Assessment Plan"));
+ }
}
});
diff --git a/erpnext/hr/doctype/compensatory_leave_request/compensatory_leave_request.py b/erpnext/hr/doctype/compensatory_leave_request/compensatory_leave_request.py
index 90d482a..b51b46c 100644
--- a/erpnext/hr/doctype/compensatory_leave_request/compensatory_leave_request.py
+++ b/erpnext/hr/doctype/compensatory_leave_request/compensatory_leave_request.py
@@ -7,6 +7,6 @@
from frappe.model.document import Document
class CompensatoryLeaveRequest(Document):
+
def validate_present(self):
pass
-
diff --git a/erpnext/hr/doctype/compensatory_leave_request/test_compensatory_leave_request.py b/erpnext/hr/doctype/compensatory_leave_request/test_compensatory_leave_request.py
index ea73ca9..f062325 100644
--- a/erpnext/hr/doctype/compensatory_leave_request/test_compensatory_leave_request.py
+++ b/erpnext/hr/doctype/compensatory_leave_request/test_compensatory_leave_request.py
@@ -38,4 +38,4 @@
self.assertRaises(MaxLeavesLimitCrossed, compensatory_leave_request.submit)
frappe.db.set_value('Leave Type', compensatory_leave_request.leave_type, 'max_leaves_allowed', 10)
-
\ No newline at end of file
+
diff --git a/erpnext/hr/doctype/department/department.json b/erpnext/hr/doctype/department/department.json
index a1c8dc1..664679d 100644
--- a/erpnext/hr/doctype/department/department.json
+++ b/erpnext/hr/doctype/department/department.json
@@ -3,7 +3,7 @@
"allow_guest_to_view": 0,
"allow_import": 1,
"allow_rename": 1,
- "autoname": "field:department_name",
+ "autoname": "",
"beta": 0,
"creation": "2013-02-05 11:48:26",
"custom": 0,
@@ -434,7 +434,7 @@
"issingle": 0,
"istable": 0,
"max_attachments": 0,
- "modified": "2018-04-18 12:02:42.572599",
+ "modified": "2018-05-11 12:18:18.839182",
"modified_by": "Administrator",
"module": "HR",
"name": "Department",
diff --git a/erpnext/hr/doctype/department/department.py b/erpnext/hr/doctype/department/department.py
index fda1b69..19994ae 100644
--- a/erpnext/hr/doctype/department/department.py
+++ b/erpnext/hr/doctype/department/department.py
@@ -10,6 +10,10 @@
class Department(NestedSet):
nsm_parent_field = 'parent_department'
+ def autoname(self):
+ abbr = frappe.db.get_value('Company', self.company, 'abbr')
+ self.name = '{0} - {1}'.format(self.department_name, abbr)
+
def update_nsm_model(self):
frappe.utils.nestedset.update_nsm(self)
@@ -21,4 +25,23 @@
delete_events(self.doctype, self.name)
def on_doctype_update():
- frappe.db.add_index("Department", ["lft", "rgt"])
\ No newline at end of file
+ frappe.db.add_index("Department", ["lft", "rgt"])
+
+@frappe.whitelist()
+def get_children(doctype, parent=None, company=None, is_root=False):
+ condition = ''
+ if company == parent:
+ condition = 'name="All Departments"'
+ elif company:
+ condition = "parent_department='{0}' and company='{1}'".format(parent, company)
+ else:
+ condition = "parent_department = '{0}'".format(parent)
+
+ return frappe.db.sql("""
+ select
+ name as value,
+ is_group as expandable
+ from `tab{doctype}`
+ where
+ {condition}
+ order by name""".format(doctype=doctype, condition=condition), as_dict=1)
diff --git a/erpnext/hr/doctype/department/department_tree.js b/erpnext/hr/doctype/department/department_tree.js
index 5652ad6..1f891fd 100644
--- a/erpnext/hr/doctype/department/department_tree.js
+++ b/erpnext/hr/doctype/department/department_tree.js
@@ -1,3 +1,27 @@
frappe.treeview_settings["Department"] = {
- ignore_fields:["parent_department"]
+ ignore_fields:["parent_department"],
+ get_tree_nodes: 'erpnext.hr.doctype.department.department.get_children',
+ filters: [
+ {
+ fieldname: "company",
+ fieldtype:"Link",
+ options: "Company",
+ label: __("Company"),
+ },
+ ],
+ breadcrumb: "HR",
+ root_label: "All Departments",
+ get_tree_root: true,
+ menu_items: [
+ {
+ label: __("New Department"),
+ action: function() {
+ frappe.new_doc("Department", true);
+ },
+ condition: 'frappe.boot.user.can_create.indexOf("Department") !== -1'
+ }
+ ],
+ onload: function(treeview) {
+ treeview.make_tree();
+ }
};
\ No newline at end of file
diff --git a/erpnext/hr/doctype/employee/employee.js b/erpnext/hr/doctype/employee/employee.js
index 240411d..6f6873a 100755
--- a/erpnext/hr/doctype/employee/employee.js
+++ b/erpnext/hr/doctype/employee/employee.js
@@ -37,6 +37,15 @@
});
frappe.ui.form.on('Employee',{
+ onload:function(frm) {
+ frm.set_query("department", function() {
+ return {
+ "filters": {
+ "company": frm.doc.company,
+ }
+ };
+ });
+ },
prefered_contact_email:function(frm){
frm.events.update_contact(frm)
},
diff --git a/erpnext/hr/doctype/employee/employee.json b/erpnext/hr/doctype/employee/employee.json
index 2d76dcf..ef2c75d 100644
--- a/erpnext/hr/doctype/employee/employee.json
+++ b/erpnext/hr/doctype/employee/employee.json
@@ -1268,6 +1268,38 @@
"bold": 0,
"collapsible": 0,
"columns": 0,
+ "fieldname": "leave_policy",
+ "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": "Leave Policy",
+ "length": 0,
+ "no_copy": 0,
+ "options": "Leave Policy",
+ "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_on_submit": 0,
+ "bold": 0,
+ "collapsible": 0,
+ "columns": 0,
"fieldname": "contact_details",
"fieldtype": "Section Break",
"hidden": 0,
diff --git a/erpnext/hr/doctype/employee/employee.py b/erpnext/hr/doctype/employee/employee.py
index 0f11639..4cf28a1 100755
--- a/erpnext/hr/doctype/employee/employee.py
+++ b/erpnext/hr/doctype/employee/employee.py
@@ -156,6 +156,9 @@
def on_trash(self):
self.update_nsm_model()
delete_events(self.doctype, self.name)
+ if frappe.db.exists("Employee Transfer", {'new_employee_id': self.name, 'docstatus': 1}):
+ emp_transfer = frappe.get_doc("Employee Transfer", {'new_employee_id': self.name, 'docstatus': 1})
+ emp_transfer.db_set("new_employee_id", '')
def validate_preferred_email(self):
if self.prefered_contact_email and not self.get(scrub(self.prefered_contact_email)):
diff --git a/erpnext/hr/doctype/employee/employee_dashboard.py b/erpnext/hr/doctype/employee/employee_dashboard.py
index be92074..e1e1fce 100644
--- a/erpnext/hr/doctype/employee/employee_dashboard.py
+++ b/erpnext/hr/doctype/employee/employee_dashboard.py
@@ -12,7 +12,7 @@
},
{
'label': _('Payroll'),
- 'items': ['Salary Structure', 'Salary Slip', 'Timesheet']
+ 'items': ['Salary Slip', 'Timesheet']
},
{
'label': _('Training Events/Results'),
@@ -25,6 +25,10 @@
{
'label': _('Evaluation'),
'items': ['Appraisal']
+ },
+ {
+ 'label': _('Employee Lifecycle'),
+ 'items': ['Employee Transfer', 'Employee Promotion']
}
]
}
\ No newline at end of file
diff --git a/erpnext/hr/doctype/employee_benefit_claim/employee_benefit_claim.json b/erpnext/hr/doctype/employee_benefit_claim/employee_benefit_claim.json
index 5e2b34b..00d5159 100644
--- a/erpnext/hr/doctype/employee_benefit_claim/employee_benefit_claim.json
+++ b/erpnext/hr/doctype/employee_benefit_claim/employee_benefit_claim.json
@@ -460,4 +460,4 @@
"title_field": "employee_name",
"track_changes": 1,
"track_seen": 0
-}
\ No newline at end of file
+}
\ No newline at end of file
diff --git a/erpnext/hr/doctype/employee_lifecycle_activity/employee_lifecycle_activity.js b/erpnext/hr/doctype/employee_lifecycle_activity/employee_lifecycle_activity.js
deleted file mode 100644
index 4cd5f0f..0000000
--- a/erpnext/hr/doctype/employee_lifecycle_activity/employee_lifecycle_activity.js
+++ /dev/null
@@ -1,8 +0,0 @@
-// Copyright (c) 2018, Frappe Technologies Pvt. Ltd. and contributors
-// For license information, please see license.txt
-
-frappe.ui.form.on('Employee Lifecycle Activity', {
- refresh: function(frm) {
-
- }
-});
diff --git a/erpnext/hr/doctype/employee_lifecycle_activity/employee_lifecycle_activity.json b/erpnext/hr/doctype/employee_lifecycle_activity/employee_lifecycle_activity.json
deleted file mode 100644
index 28b22fd..0000000
--- a/erpnext/hr/doctype/employee_lifecycle_activity/employee_lifecycle_activity.json
+++ /dev/null
@@ -1,227 +0,0 @@
-{
- "allow_copy": 0,
- "allow_guest_to_view": 0,
- "allow_import": 0,
- "allow_rename": 0,
- "autoname": "prompt",
- "beta": 0,
- "creation": "2018-04-13 17:58:34.106717",
- "custom": 0,
- "docstatus": 0,
- "doctype": "DocType",
- "document_type": "",
- "editable_grid": 1,
- "engine": "InnoDB",
- "fields": [
- {
- "allow_bulk_edit": 0,
- "allow_on_submit": 0,
- "bold": 0,
- "collapsible": 0,
- "columns": 0,
- "fieldname": "activity_type",
- "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": "Activity Type",
- "length": 0,
- "no_copy": 0,
- "options": "Activity 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": 1,
- "search_index": 0,
- "set_only_once": 0,
- "translatable": 0,
- "unique": 0
- },
- {
- "allow_bulk_edit": 0,
- "allow_on_submit": 0,
- "bold": 0,
- "collapsible": 0,
- "columns": 0,
- "fieldname": "employee_lifecycle_process",
- "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": "Employee Lifecycle Process",
- "length": 0,
- "no_copy": 0,
- "options": "Employee Lifecycle Process",
- "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_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": "Pending\nCompleted",
- "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_on_submit": 0,
- "bold": 0,
- "collapsible": 0,
- "columns": 0,
- "fieldname": "amended_from",
- "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": "Amended From",
- "length": 0,
- "no_copy": 1,
- "options": "Employee Lifecycle Activity",
- "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,
- "idx": 0,
- "image_view": 0,
- "in_create": 0,
- "is_submittable": 1,
- "issingle": 0,
- "istable": 0,
- "max_attachments": 0,
- "modified": "2018-04-13 18:48:06.800183",
- "modified_by": "Administrator",
- "module": "HR",
- "name": "Employee Lifecycle Activity",
- "name_case": "",
- "owner": "Administrator",
- "permissions": [
- {
- "amend": 0,
- "cancel": 0,
- "create": 0,
- "delete": 0,
- "email": 1,
- "export": 1,
- "if_owner": 0,
- "import": 0,
- "permlevel": 0,
- "print": 1,
- "read": 1,
- "report": 1,
- "role": "Employee",
- "set_user_permissions": 0,
- "share": 1,
- "submit": 0,
- "write": 0
- },
- {
- "amend": 0,
- "cancel": 0,
- "create": 1,
- "delete": 0,
- "email": 1,
- "export": 1,
- "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": 1,
- "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
- }
- ],
- "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
-}
\ No newline at end of file
diff --git a/erpnext/hr/doctype/employee_lifecycle_activity/employee_lifecycle_activity.py b/erpnext/hr/doctype/employee_lifecycle_activity/employee_lifecycle_activity.py
deleted file mode 100644
index a877031..0000000
--- a/erpnext/hr/doctype/employee_lifecycle_activity/employee_lifecycle_activity.py
+++ /dev/null
@@ -1,10 +0,0 @@
-# -*- coding: utf-8 -*-
-# Copyright (c) 2018, Frappe Technologies Pvt. Ltd. and contributors
-# For license information, please see license.txt
-
-from __future__ import unicode_literals
-import frappe
-from frappe.model.document import Document
-
-class EmployeeLifecycleActivity(Document):
- pass
diff --git a/erpnext/hr/doctype/employee_lifecycle_activity/test_employee_lifecycle_activity.js b/erpnext/hr/doctype/employee_lifecycle_activity/test_employee_lifecycle_activity.js
deleted file mode 100644
index 64a28d9..0000000
--- a/erpnext/hr/doctype/employee_lifecycle_activity/test_employee_lifecycle_activity.js
+++ /dev/null
@@ -1,23 +0,0 @@
-/* eslint-disable */
-// rename this file from _test_[name] to test_[name] to activate
-// and remove above this line
-
-QUnit.test("test: Employee Lifecycle Activity", function (assert) {
- let done = assert.async();
-
- // number of asserts
- assert.expect(1);
-
- frappe.run_serially([
- // insert a new Employee Lifecycle Activity
- () => frappe.tests.make('Employee Lifecycle Activity', [
- // values to be set
- {key: 'value'}
- ]),
- () => {
- assert.equal(cur_frm.doc.key, 'value');
- },
- () => done()
- ]);
-
-});
diff --git a/erpnext/hr/doctype/employee_lifecycle_activity_type/__init__.py b/erpnext/hr/doctype/employee_lifecycle_activity_type/__init__.py
deleted file mode 100644
index e69de29..0000000
--- a/erpnext/hr/doctype/employee_lifecycle_activity_type/__init__.py
+++ /dev/null
diff --git a/erpnext/hr/doctype/employee_lifecycle_activity_type/employee_lifecycle_activity_type.js b/erpnext/hr/doctype/employee_lifecycle_activity_type/employee_lifecycle_activity_type.js
deleted file mode 100644
index 7935e4f..0000000
--- a/erpnext/hr/doctype/employee_lifecycle_activity_type/employee_lifecycle_activity_type.js
+++ /dev/null
@@ -1,8 +0,0 @@
-// Copyright (c) 2018, Frappe Technologies Pvt. Ltd. and contributors
-// For license information, please see license.txt
-
-frappe.ui.form.on('Employee Lifecycle Activity Type', {
- refresh: function(frm) {
-
- }
-});
diff --git a/erpnext/hr/doctype/employee_lifecycle_activity_type/employee_lifecycle_activity_type.py b/erpnext/hr/doctype/employee_lifecycle_activity_type/employee_lifecycle_activity_type.py
deleted file mode 100644
index aca6bd4..0000000
--- a/erpnext/hr/doctype/employee_lifecycle_activity_type/employee_lifecycle_activity_type.py
+++ /dev/null
@@ -1,10 +0,0 @@
-# -*- coding: utf-8 -*-
-# Copyright (c) 2018, Frappe Technologies Pvt. Ltd. and contributors
-# For license information, please see license.txt
-
-from __future__ import unicode_literals
-import frappe
-from frappe.model.document import Document
-
-class EmployeeLifecycleActivityType(Document):
- pass
diff --git a/erpnext/hr/doctype/employee_lifecycle_activity_type/test_employee_lifecycle_activity_type.js b/erpnext/hr/doctype/employee_lifecycle_activity_type/test_employee_lifecycle_activity_type.js
deleted file mode 100644
index b775086..0000000
--- a/erpnext/hr/doctype/employee_lifecycle_activity_type/test_employee_lifecycle_activity_type.js
+++ /dev/null
@@ -1,23 +0,0 @@
-/* eslint-disable */
-// rename this file from _test_[name] to test_[name] to activate
-// and remove above this line
-
-QUnit.test("test: Employee Lifecycle Activity Type", function (assert) {
- let done = assert.async();
-
- // number of asserts
- assert.expect(1);
-
- frappe.run_serially([
- // insert a new Employee Lifecycle Activity Type
- () => frappe.tests.make('Employee Lifecycle Activity Type', [
- // values to be set
- {key: 'value'}
- ]),
- () => {
- assert.equal(cur_frm.doc.key, 'value');
- },
- () => done()
- ]);
-
-});
diff --git a/erpnext/hr/doctype/employee_lifecycle_activity_type/test_employee_lifecycle_activity_type.py b/erpnext/hr/doctype/employee_lifecycle_activity_type/test_employee_lifecycle_activity_type.py
deleted file mode 100644
index ff3e2c7..0000000
--- a/erpnext/hr/doctype/employee_lifecycle_activity_type/test_employee_lifecycle_activity_type.py
+++ /dev/null
@@ -1,10 +0,0 @@
-# -*- coding: utf-8 -*-
-# Copyright (c) 2018, Frappe Technologies Pvt. Ltd. and Contributors
-# See license.txt
-from __future__ import unicode_literals
-
-import frappe
-import unittest
-
-class TestEmployeeLifecycleActivityType(unittest.TestCase):
- pass
diff --git a/erpnext/hr/doctype/employee_lifecycle_process/__init__.py b/erpnext/hr/doctype/employee_lifecycle_process/__init__.py
deleted file mode 100644
index e69de29..0000000
--- a/erpnext/hr/doctype/employee_lifecycle_process/__init__.py
+++ /dev/null
diff --git a/erpnext/hr/doctype/employee_lifecycle_process/employee_lifecycle_process.json b/erpnext/hr/doctype/employee_lifecycle_process/employee_lifecycle_process.json
deleted file mode 100644
index 86b0158..0000000
--- a/erpnext/hr/doctype/employee_lifecycle_process/employee_lifecycle_process.json
+++ /dev/null
@@ -1,320 +0,0 @@
-{
- "allow_copy": 0,
- "allow_guest_to_view": 0,
- "allow_import": 0,
- "allow_rename": 0,
- "autoname": "ELP.#####",
- "beta": 0,
- "creation": "2018-04-13 17:55:47.341454",
- "custom": 0,
- "docstatus": 0,
- "doctype": "DocType",
- "document_type": "",
- "editable_grid": 1,
- "engine": "InnoDB",
- "fields": [
- {
- "allow_bulk_edit": 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": 0,
- "in_list_view": 1,
- "in_standard_filter": 0,
- "label": "Employee",
- "length": 0,
- "no_copy": 0,
- "options": "Employee",
- "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_on_submit": 0,
- "bold": 0,
- "collapsible": 0,
- "columns": 0,
- "fieldname": "job_applicant",
- "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 Applicant",
- "length": 0,
- "no_copy": 0,
- "options": "Job Applicant",
- "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_on_submit": 0,
- "bold": 0,
- "collapsible": 0,
- "columns": 0,
- "fieldname": "column_break_3",
- "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_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": "Pending\nComplated",
- "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_on_submit": 0,
- "bold": 0,
- "collapsible": 0,
- "columns": 0,
- "fieldname": "lifecycle_process_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": "Lifecycle Process 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_on_submit": 0,
- "bold": 0,
- "collapsible": 0,
- "columns": 0,
- "fieldname": "process_section",
- "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 Lifecycle Process Template Detail",
- "length": 0,
- "no_copy": 0,
- "options": "Employee Lifecycle Process Template 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": 1,
- "search_index": 0,
- "set_only_once": 0,
- "translatable": 0,
- "unique": 0
- },
- {
- "allow_bulk_edit": 0,
- "allow_on_submit": 0,
- "bold": 0,
- "collapsible": 0,
- "columns": 0,
- "fieldname": "amended_from",
- "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": "Amended From",
- "length": 0,
- "no_copy": 1,
- "options": "Employee Lifecycle Process",
- "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,
- "idx": 0,
- "image_view": 0,
- "in_create": 0,
- "is_submittable": 1,
- "issingle": 0,
- "istable": 0,
- "max_attachments": 0,
- "modified": "2018-04-13 19:00:17.008613",
- "modified_by": "Administrator",
- "module": "HR",
- "name": "Employee Lifecycle Process",
- "name_case": "",
- "owner": "Administrator",
- "permissions": [
- {
- "amend": 0,
- "cancel": 0,
- "create": 0,
- "delete": 0,
- "email": 1,
- "export": 1,
- "if_owner": 0,
- "import": 0,
- "permlevel": 0,
- "print": 1,
- "read": 1,
- "report": 1,
- "role": "Employee",
- "set_user_permissions": 0,
- "share": 1,
- "submit": 0,
- "write": 0
- },
- {
- "amend": 0,
- "cancel": 0,
- "create": 1,
- "delete": 0,
- "email": 1,
- "export": 1,
- "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": 1,
- "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
- }
- ],
- "quick_entry": 0,
- "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
-}
\ No newline at end of file
diff --git a/erpnext/hr/doctype/employee_lifecycle_process/test_employee_lifecycle_process.py b/erpnext/hr/doctype/employee_lifecycle_process/test_employee_lifecycle_process.py
deleted file mode 100644
index f680311..0000000
--- a/erpnext/hr/doctype/employee_lifecycle_process/test_employee_lifecycle_process.py
+++ /dev/null
@@ -1,10 +0,0 @@
-# -*- coding: utf-8 -*-
-# Copyright (c) 2018, Frappe Technologies Pvt. Ltd. and Contributors
-# See license.txt
-from __future__ import unicode_literals
-
-import frappe
-import unittest
-
-class TestEmployeeLifecycleProcess(unittest.TestCase):
- pass
diff --git a/erpnext/hr/doctype/employee_lifecycle_process_template/__init__.py b/erpnext/hr/doctype/employee_lifecycle_process_template/__init__.py
deleted file mode 100644
index e69de29..0000000
--- a/erpnext/hr/doctype/employee_lifecycle_process_template/__init__.py
+++ /dev/null
diff --git a/erpnext/hr/doctype/employee_lifecycle_process_template/employee_lifecycle_process_template.js b/erpnext/hr/doctype/employee_lifecycle_process_template/employee_lifecycle_process_template.js
deleted file mode 100644
index c9ce3d1..0000000
--- a/erpnext/hr/doctype/employee_lifecycle_process_template/employee_lifecycle_process_template.js
+++ /dev/null
@@ -1,8 +0,0 @@
-// Copyright (c) 2018, Frappe Technologies Pvt. Ltd. and contributors
-// For license information, please see license.txt
-
-frappe.ui.form.on('Employee Lifecycle Process Template', {
- refresh: function(frm) {
-
- }
-});
diff --git a/erpnext/hr/doctype/employee_lifecycle_process_template/employee_lifecycle_process_template.json b/erpnext/hr/doctype/employee_lifecycle_process_template/employee_lifecycle_process_template.json
deleted file mode 100644
index 582a94f..0000000
--- a/erpnext/hr/doctype/employee_lifecycle_process_template/employee_lifecycle_process_template.json
+++ /dev/null
@@ -1,194 +0,0 @@
-{
- "allow_copy": 0,
- "allow_guest_to_view": 0,
- "allow_import": 0,
- "allow_rename": 0,
- "autoname": "ELCP.#####",
- "beta": 0,
- "creation": "2018-04-13 17:40:38.806266",
- "custom": 0,
- "docstatus": 0,
- "doctype": "DocType",
- "document_type": "",
- "editable_grid": 1,
- "engine": "InnoDB",
- "fields": [
- {
- "allow_bulk_edit": 0,
- "allow_on_submit": 0,
- "bold": 0,
- "collapsible": 0,
- "columns": 0,
- "fieldname": "process_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": "Lifecycle Process 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_on_submit": 0,
- "bold": 0,
- "collapsible": 0,
- "columns": 0,
- "fieldname": "process_details",
- "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 Lifecycle Process Template Detail",
- "length": 0,
- "no_copy": 0,
- "options": "Employee Lifecycle Process Template Activity",
- "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_on_submit": 0,
- "bold": 0,
- "collapsible": 0,
- "columns": 0,
- "fieldname": "amended_from",
- "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": "Amended From",
- "length": 0,
- "no_copy": 1,
- "options": "Employee Lifecycle Process Template",
- "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,
- "idx": 0,
- "image_view": 0,
- "in_create": 0,
- "is_submittable": 1,
- "issingle": 0,
- "istable": 0,
- "max_attachments": 0,
- "modified": "2018-04-14 11:35:19.465613",
- "modified_by": "Administrator",
- "module": "HR",
- "name": "Employee Lifecycle Process Template",
- "name_case": "",
- "owner": "Administrator",
- "permissions": [
- {
- "amend": 0,
- "cancel": 0,
- "create": 0,
- "delete": 0,
- "email": 1,
- "export": 1,
- "if_owner": 0,
- "import": 0,
- "permlevel": 0,
- "print": 1,
- "read": 1,
- "report": 1,
- "role": "Employee",
- "set_user_permissions": 0,
- "share": 1,
- "submit": 0,
- "write": 0
- },
- {
- "amend": 0,
- "cancel": 0,
- "create": 1,
- "delete": 0,
- "email": 1,
- "export": 1,
- "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": 1,
- "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
- }
- ],
- "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
-}
\ No newline at end of file
diff --git a/erpnext/hr/doctype/employee_lifecycle_process_template/employee_lifecycle_process_template.py b/erpnext/hr/doctype/employee_lifecycle_process_template/employee_lifecycle_process_template.py
deleted file mode 100644
index b6f3a43..0000000
--- a/erpnext/hr/doctype/employee_lifecycle_process_template/employee_lifecycle_process_template.py
+++ /dev/null
@@ -1,10 +0,0 @@
-# -*- coding: utf-8 -*-
-# Copyright (c) 2018, Frappe Technologies Pvt. Ltd. and contributors
-# For license information, please see license.txt
-
-from __future__ import unicode_literals
-import frappe
-from frappe.model.document import Document
-
-class EmployeeLifecycleProcessTemplate(Document):
- pass
diff --git a/erpnext/hr/doctype/employee_lifecycle_process_template/test_employee_lifecycle_process_template.js b/erpnext/hr/doctype/employee_lifecycle_process_template/test_employee_lifecycle_process_template.js
deleted file mode 100644
index 607ccd5..0000000
--- a/erpnext/hr/doctype/employee_lifecycle_process_template/test_employee_lifecycle_process_template.js
+++ /dev/null
@@ -1,23 +0,0 @@
-/* eslint-disable */
-// rename this file from _test_[name] to test_[name] to activate
-// and remove above this line
-
-QUnit.test("test: Employee Lifecycle Process Template", function (assert) {
- let done = assert.async();
-
- // number of asserts
- assert.expect(1);
-
- frappe.run_serially([
- // insert a new Employee Lifecycle Process Template
- () => frappe.tests.make('Employee Lifecycle Process Template', [
- // values to be set
- {key: 'value'}
- ]),
- () => {
- assert.equal(cur_frm.doc.key, 'value');
- },
- () => done()
- ]);
-
-});
diff --git a/erpnext/hr/doctype/employee_lifecycle_process_template/test_employee_lifecycle_process_template.py b/erpnext/hr/doctype/employee_lifecycle_process_template/test_employee_lifecycle_process_template.py
deleted file mode 100644
index 916cfe1..0000000
--- a/erpnext/hr/doctype/employee_lifecycle_process_template/test_employee_lifecycle_process_template.py
+++ /dev/null
@@ -1,10 +0,0 @@
-# -*- coding: utf-8 -*-
-# Copyright (c) 2018, Frappe Technologies Pvt. Ltd. and Contributors
-# See license.txt
-from __future__ import unicode_literals
-
-import frappe
-import unittest
-
-class TestEmployeeLifecycleProcessTemplate(unittest.TestCase):
- pass
diff --git a/erpnext/hr/doctype/employee_lifecycle_process_template_activity/__init__.py b/erpnext/hr/doctype/employee_lifecycle_process_template_activity/__init__.py
deleted file mode 100644
index e69de29..0000000
--- a/erpnext/hr/doctype/employee_lifecycle_process_template_activity/__init__.py
+++ /dev/null
diff --git a/erpnext/hr/doctype/employee_lifecycle_process_template_activity/employee_lifecycle_process_template_activity.json b/erpnext/hr/doctype/employee_lifecycle_process_template_activity/employee_lifecycle_process_template_activity.json
deleted file mode 100644
index 6d3c96c..0000000
--- a/erpnext/hr/doctype/employee_lifecycle_process_template_activity/employee_lifecycle_process_template_activity.json
+++ /dev/null
@@ -1,137 +0,0 @@
-{
- "allow_copy": 0,
- "allow_guest_to_view": 0,
- "allow_import": 0,
- "allow_rename": 0,
- "beta": 0,
- "creation": "2018-04-14 11:34:30.508196",
- "custom": 0,
- "docstatus": 0,
- "doctype": "DocType",
- "document_type": "",
- "editable_grid": 1,
- "engine": "InnoDB",
- "fields": [
- {
- "allow_bulk_edit": 0,
- "allow_on_submit": 0,
- "bold": 0,
- "collapsible": 0,
- "columns": 0,
- "fieldname": "employee_lifecycle_activity_type",
- "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": "Employee Lifecycle Activity Type ",
- "length": 0,
- "no_copy": 0,
- "options": "Employee Lifecycle Activity 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": 1,
- "search_index": 0,
- "set_only_once": 0,
- "translatable": 0,
- "unique": 0
- },
- {
- "allow_bulk_edit": 0,
- "allow_on_submit": 0,
- "bold": 0,
- "collapsible": 0,
- "columns": 0,
- "fieldname": "role",
- "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": "Role",
- "length": 0,
- "no_copy": 0,
- "options": "Role",
- "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_on_submit": 0,
- "bold": 0,
- "collapsible": 0,
- "columns": 0,
- "fieldname": "user",
- "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": "User",
- "length": 0,
- "no_copy": 0,
- "options": "User",
- "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,
- "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-04-14 11:34:30.508196",
- "modified_by": "Administrator",
- "module": "HR",
- "name": "Employee Lifecycle Process Template Activity",
- "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
-}
\ No newline at end of file
diff --git a/erpnext/hr/doctype/employee_lifecycle_process_template_activity/employee_lifecycle_process_template_activity.py b/erpnext/hr/doctype/employee_lifecycle_process_template_activity/employee_lifecycle_process_template_activity.py
deleted file mode 100644
index eeea236..0000000
--- a/erpnext/hr/doctype/employee_lifecycle_process_template_activity/employee_lifecycle_process_template_activity.py
+++ /dev/null
@@ -1,10 +0,0 @@
-# -*- coding: utf-8 -*-
-# Copyright (c) 2018, Frappe Technologies Pvt. Ltd. and contributors
-# For license information, please see license.txt
-
-from __future__ import unicode_literals
-import frappe
-from frappe.model.document import Document
-
-class EmployeeLifecycleProcessTemplateActivity(Document):
- pass
diff --git a/erpnext/hr/doctype/employee_promotion/employee_promotion.js b/erpnext/hr/doctype/employee_promotion/employee_promotion.js
index c1bb788..54e06f4 100644
--- a/erpnext/hr/doctype/employee_promotion/employee_promotion.js
+++ b/erpnext/hr/doctype/employee_promotion/employee_promotion.js
@@ -1,6 +1,8 @@
// Copyright (c) 2018, Frappe Technologies Pvt. Ltd. and contributors
// For license information, please see license.txt
+{% include 'erpnext/hr/employee_property_update.js' %}
+
frappe.ui.form.on('Employee Promotion', {
refresh: function(frm) {
diff --git a/erpnext/hr/doctype/employee_promotion/employee_promotion.json b/erpnext/hr/doctype/employee_promotion/employee_promotion.json
index a7d49bc..1e3081a 100644
--- a/erpnext/hr/doctype/employee_promotion/employee_promotion.json
+++ b/erpnext/hr/doctype/employee_promotion/employee_promotion.json
@@ -83,6 +83,36 @@
"bold": 0,
"collapsible": 0,
"columns": 0,
+ "fieldname": "column_break_3",
+ "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_on_submit": 0,
+ "bold": 0,
+ "collapsible": 0,
+ "columns": 0,
"fieldname": "promotion_date",
"fieldtype": "Date",
"hidden": 0,
@@ -102,7 +132,7 @@
"read_only": 0,
"remember_last_selected_value": 0,
"report_hide": 0,
- "reqd": 0,
+ "reqd": 1,
"search_index": 0,
"set_only_once": 0,
"translatable": 0,
@@ -189,7 +219,7 @@
"label": "Employee Promotion Detail",
"length": 0,
"no_copy": 0,
- "options": "Employee Promotion Detail",
+ "options": "Employee Property History",
"permlevel": 0,
"precision": "",
"print_hide": 0,
@@ -245,7 +275,7 @@
"issingle": 0,
"istable": 0,
"max_attachments": 0,
- "modified": "2018-04-14 15:42:49.452085",
+ "modified": "2018-04-27 17:31:26.902394",
"modified_by": "Administrator",
"module": "HR",
"name": "Employee Promotion",
diff --git a/erpnext/hr/doctype/employee_promotion/employee_promotion.py b/erpnext/hr/doctype/employee_promotion/employee_promotion.py
index 564f1ad..5fcceed 100644
--- a/erpnext/hr/doctype/employee_promotion/employee_promotion.py
+++ b/erpnext/hr/doctype/employee_promotion/employee_promotion.py
@@ -4,7 +4,27 @@
from __future__ import unicode_literals
import frappe
+from frappe import _
from frappe.model.document import Document
+from frappe.utils import getdate
+from erpnext.hr.utils import update_employee
class EmployeePromotion(Document):
- pass
+ def validate(self):
+ if frappe.get_value("Employee", self.employee, "status") == "Left":
+ frappe.throw(_("Cannot promote Employee with status Left"))
+
+ def before_submit(self):
+ if getdate(self.promotion_date) > getdate():
+ frappe.throw(_("Employee Promotion cannot be submitted before Promotion Date "),
+ frappe.DocstatusTransitionError)
+
+ def on_submit(self):
+ employee = frappe.get_doc("Employee", self.employee)
+ employee = update_employee(employee, self.promotion_details)
+ employee.save()
+
+ def on_cancel(self):
+ employee = frappe.get_doc("Employee", self.employee)
+ employee = update_employee(employee, self.promotion_details, True)
+ employee.save()
diff --git a/erpnext/hr/doctype/employee_promotion/test_employee_promotion.py b/erpnext/hr/doctype/employee_promotion/test_employee_promotion.py
index 8b668e7..420bbe6 100644
--- a/erpnext/hr/doctype/employee_promotion/test_employee_promotion.py
+++ b/erpnext/hr/doctype/employee_promotion/test_employee_promotion.py
@@ -5,6 +5,31 @@
import frappe
import unittest
+from frappe.utils import getdate, add_days
+from erpnext.hr.doctype.salary_structure.test_salary_structure import make_employee
class TestEmployeePromotion(unittest.TestCase):
- pass
+ def setUp(self):
+ self.employee = make_employee("employee@promotions.com")
+ frappe.db.sql("""delete from `tabEmployee Promotion`""")
+
+ def test_submit_before_promotion_date(self):
+ promotion_obj = frappe.get_doc({
+ "doctype": "Employee Promotion",
+ "employee": self.employee,
+ "promotion_details" :[
+ {
+ "property": "Designation",
+ "current": "Software Developer",
+ "new": "Project Manager",
+ "fieldname": "designation"
+ }
+ ]
+ })
+ promotion_obj.promotion_date = add_days(getdate(), 1)
+ promotion_obj.save()
+ self.assertRaises(frappe.DocstatusTransitionError, promotion_obj.submit)
+ promotion = frappe.get_doc("Employee Promotion", promotion_obj.name)
+ promotion.promotion_date = getdate()
+ promotion.submit()
+ self.assertEqual(promotion.docstatus, 1)
diff --git a/erpnext/hr/doctype/employee_property_history/employee_property_history.json b/erpnext/hr/doctype/employee_property_history/employee_property_history.json
index 7a416b2..0a51579 100644
--- a/erpnext/hr/doctype/employee_property_history/employee_property_history.json
+++ b/erpnext/hr/doctype/employee_property_history/employee_property_history.json
@@ -34,13 +34,12 @@
"precision": "",
"print_hide": 0,
"print_hide_if_no_value": 0,
- "read_only": 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
},
{
@@ -65,13 +64,12 @@
"precision": "",
"print_hide": 0,
"print_hide_if_no_value": 0,
- "read_only": 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
},
{
@@ -96,13 +94,42 @@
"precision": "",
"print_hide": 0,
"print_hide_if_no_value": 0,
- "read_only": 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_on_submit": 0,
+ "bold": 0,
+ "collapsible": 0,
+ "columns": 0,
+ "fieldname": "fieldname",
+ "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": "Field Name",
+ "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,
"unique": 0
}
],
@@ -116,7 +143,7 @@
"issingle": 0,
"istable": 1,
"max_attachments": 0,
- "modified": "2018-04-14 11:44:36.458039",
+ "modified": "2018-05-02 18:19:54.436391",
"modified_by": "Administrator",
"module": "HR",
"name": "Employee Property History",
diff --git a/erpnext/hr/doctype/employee_transfer/employee_transfer.js b/erpnext/hr/doctype/employee_transfer/employee_transfer.js
index 1d694bd..af751a7 100644
--- a/erpnext/hr/doctype/employee_transfer/employee_transfer.js
+++ b/erpnext/hr/doctype/employee_transfer/employee_transfer.js
@@ -1,6 +1,8 @@
// Copyright (c) 2018, Frappe Technologies Pvt. Ltd. and contributors
// For license information, please see license.txt
+{% include 'erpnext/hr/employee_property_update.js' %}
+
frappe.ui.form.on('Employee Transfer', {
refresh: function(frm) {
diff --git a/erpnext/hr/doctype/employee_transfer/employee_transfer.json b/erpnext/hr/doctype/employee_transfer/employee_transfer.json
index 55fa073..ace9f93 100644
--- a/erpnext/hr/doctype/employee_transfer/employee_transfer.json
+++ b/erpnext/hr/doctype/employee_transfer/employee_transfer.json
@@ -42,7 +42,6 @@
"reqd": 1,
"search_index": 0,
"set_only_once": 0,
- "translatable": 0,
"unique": 0
},
{
@@ -74,7 +73,6 @@
"reqd": 0,
"search_index": 0,
"set_only_once": 0,
- "translatable": 0,
"unique": 0
},
{
@@ -102,10 +100,38 @@
"read_only": 0,
"remember_last_selected_value": 0,
"report_hide": 0,
+ "reqd": 1,
+ "search_index": 0,
+ "set_only_once": 0,
+ "unique": 0
+ },
+ {
+ "allow_bulk_edit": 0,
+ "allow_on_submit": 0,
+ "bold": 0,
+ "collapsible": 0,
+ "columns": 0,
+ "fieldname": "column_break_3",
+ "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
},
{
@@ -137,7 +163,6 @@
"reqd": 0,
"search_index": 0,
"set_only_once": 0,
- "translatable": 0,
"unique": 0
},
{
@@ -169,7 +194,6 @@
"reqd": 0,
"search_index": 0,
"set_only_once": 0,
- "translatable": 0,
"unique": 0
},
{
@@ -200,7 +224,6 @@
"reqd": 0,
"search_index": 0,
"set_only_once": 0,
- "translatable": 0,
"unique": 0
},
{
@@ -221,7 +244,7 @@
"label": "Employee Transfer Detail",
"length": 0,
"no_copy": 0,
- "options": "Employee Transfer Detail",
+ "options": "Employee Property History",
"permlevel": 0,
"precision": "",
"print_hide": 0,
@@ -232,7 +255,6 @@
"reqd": 1,
"search_index": 0,
"set_only_once": 0,
- "translatable": 0,
"unique": 0
},
{
@@ -243,7 +265,7 @@
"columns": 0,
"fieldname": "reallocate_leaves",
"fieldtype": "Check",
- "hidden": 0,
+ "hidden": 1,
"ignore_user_permissions": 0,
"ignore_xss_filter": 0,
"in_filter": 0,
@@ -263,7 +285,6 @@
"reqd": 0,
"search_index": 0,
"set_only_once": 0,
- "translatable": 0,
"unique": 0
},
{
@@ -294,7 +315,37 @@
"reqd": 0,
"search_index": 0,
"set_only_once": 0,
- "translatable": 0,
+ "unique": 0
+ },
+ {
+ "allow_bulk_edit": 0,
+ "allow_on_submit": 1,
+ "bold": 0,
+ "collapsible": 0,
+ "columns": 0,
+ "fieldname": "new_employee_id",
+ "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": "New Employee ID",
+ "length": 0,
+ "no_copy": 0,
+ "options": "Employee",
+ "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,
"unique": 0
},
{
@@ -325,7 +376,6 @@
"reqd": 0,
"search_index": 0,
"set_only_once": 0,
- "translatable": 0,
"unique": 0
}
],
@@ -339,7 +389,7 @@
"issingle": 0,
"istable": 0,
"max_attachments": 0,
- "modified": "2018-04-14 15:42:31.098910",
+ "modified": "2018-05-05 13:10:32.660537",
"modified_by": "Administrator",
"module": "HR",
"name": "Employee Transfer",
@@ -348,6 +398,7 @@
"permissions": [
{
"amend": 0,
+ "apply_user_permissions": 0,
"cancel": 0,
"create": 0,
"delete": 0,
@@ -367,6 +418,7 @@
},
{
"amend": 0,
+ "apply_user_permissions": 0,
"cancel": 0,
"create": 1,
"delete": 0,
@@ -386,6 +438,7 @@
},
{
"amend": 1,
+ "apply_user_permissions": 0,
"cancel": 1,
"create": 1,
"delete": 1,
diff --git a/erpnext/hr/doctype/employee_transfer/employee_transfer.py b/erpnext/hr/doctype/employee_transfer/employee_transfer.py
index 96645c4..b58d334 100644
--- a/erpnext/hr/doctype/employee_transfer/employee_transfer.py
+++ b/erpnext/hr/doctype/employee_transfer/employee_transfer.py
@@ -4,7 +4,63 @@
from __future__ import unicode_literals
import frappe
+from frappe import _
from frappe.model.document import Document
+from frappe.utils import getdate
+from erpnext.hr.utils import update_employee
class EmployeeTransfer(Document):
- pass
+ def validate(self):
+ if frappe.get_value("Employee", self.employee, "status") == "Left":
+ frappe.throw(_("Cannot transfer Employee with status Left"))
+ if self.new_company and self.company == self.new_company:
+ frappe.throw_("New Company must be different from current company")
+
+ def before_submit(self):
+ if getdate(self.transfer_date) > getdate():
+ frappe.throw(_("Employee Transfer cannot be submitted before Transfer Date "),
+ frappe.DocstatusTransitionError)
+
+ def on_submit(self):
+ employee = frappe.get_doc("Employee", self.employee)
+ if self.create_new_employee_id:
+ new_employee = frappe.copy_doc(employee)
+ new_employee.name = None
+ new_employee.employee_number = None
+ new_employee = update_employee(new_employee, self.transfer_details)
+ if self.new_company:
+ new_employee.company = self.new_company
+ #move user_id to new employee before insert
+ if employee.user_id and not self.validate_user_in_details():
+ new_employee.user_id = employee.user_id
+ employee.db_set("user_id", "")
+ new_employee.insert()
+ self.db_set("new_employee_id", new_employee.name)
+ #relieve the old employee
+ employee.db_set("relieving_date", self.transfer_date)
+ employee.db_set("status", "Left")
+ else:
+ employee = update_employee(employee, self.transfer_details)
+ if self.new_company:
+ employee.company = self.new_company
+ employee.save()
+
+ def on_cancel(self):
+ employee = frappe.get_doc("Employee", self.employee)
+ if self.create_new_employee_id:
+ if self.new_employee_id:
+ frappe.throw(_("Please delete the Employee <a href='#Form/Employee/{0}'>{0}</a>\
+ to cancel this document").format(self.new_employee_id))
+ #mark the employee as active
+ employee.status = "Active"
+ employee.relieving_date = ''
+ employee.save()
+ else:
+ employee = update_employee(employee, self.transfer_details, True)
+ employee.save()
+
+ def validate_user_in_details(self):
+ for item in self.transfer_details:
+ if item.fieldname == "user_id" and item.new != item.current:
+ return True
+ return False
diff --git a/erpnext/hr/doctype/employee_transfer/test_employee_transfer.py b/erpnext/hr/doctype/employee_transfer/test_employee_transfer.py
index 049273e..3dae1a9 100644
--- a/erpnext/hr/doctype/employee_transfer/test_employee_transfer.py
+++ b/erpnext/hr/doctype/employee_transfer/test_employee_transfer.py
@@ -5,6 +5,52 @@
import frappe
import unittest
+from frappe.utils import getdate, add_days
+from erpnext.hr.doctype.salary_structure.test_salary_structure import make_employee
class TestEmployeeTransfer(unittest.TestCase):
- pass
+ def setUp(self):
+ make_employee("employee2@transfers.com")
+ make_employee("employee3@transfers.com")
+ frappe.db.sql("""delete from `tabEmployee Transfer`""")
+
+ def test_submit_before_transfer_date(self):
+ transfer_obj = frappe.get_doc({
+ "doctype": "Employee Transfer",
+ "employee": frappe.get_value("Employee", {"user_id":"employee2@transfers.com"}, "name"),
+ "transfer_details" :[
+ {
+ "property": "Designation",
+ "current": "Software Developer",
+ "new": "Project Manager",
+ "fieldname": "designation"
+ }
+ ]
+ })
+ transfer_obj.transfer_date = add_days(getdate(), 1)
+ transfer_obj.save()
+ self.assertRaises(frappe.DocstatusTransitionError, transfer_obj.submit)
+ transfer = frappe.get_doc("Employee Transfer", transfer_obj.name)
+ transfer.transfer_date = getdate()
+ transfer.submit()
+ self.assertEqual(transfer.docstatus, 1)
+
+ def test_new_employee_creation(self):
+ transfer = frappe.get_doc({
+ "doctype": "Employee Transfer",
+ "employee": frappe.get_value("Employee", {"user_id":"employee3@transfers.com"}, "name"),
+ "create_new_employee_id": 1,
+ "transfer_date": getdate(),
+ "transfer_details" :[
+ {
+ "property": "Designation",
+ "current": "Software Developer",
+ "new": "Project Manager",
+ "fieldname": "designation"
+ }
+ ]
+ }).insert()
+ transfer.submit()
+ self.assertTrue(transfer.new_employee_id)
+ self.assertEqual(frappe.get_value("Employee", transfer.new_employee_id, "status"), "Active")
+ self.assertEqual(frappe.get_value("Employee", transfer.employee, "status"), "Left")
diff --git a/erpnext/hr/doctype/job_opening/job_opening.js b/erpnext/hr/doctype/job_opening/job_opening.js
index e69de29..7b0e447 100644
--- a/erpnext/hr/doctype/job_opening/job_opening.js
+++ b/erpnext/hr/doctype/job_opening/job_opening.js
@@ -0,0 +1,47 @@
+// Copyright (c) 2018, Frappe Technologies Pvt. Ltd. and contributors
+// For license information, please see license.txt
+
+frappe.ui.form.on('Job Opening', {
+ onload: function(frm) {
+ frm.set_query("department", function() {
+ return {
+ "filters": {
+ "company": frm.doc.company,
+ }
+ };
+ });
+ },
+ designation: function(frm) {
+ if(frm.doc.designation && frm.doc.company){
+ frappe.call({
+ "method": "erpnext.hr.doctype.staffing_plan.staffing_plan.get_active_staffing_plan_and_vacancies",
+ args: {
+ company: frm.doc.company,
+ designation: frm.doc.designation,
+ department: frm.doc.department,
+ date: frappe.datetime.now_date() // ToDo - Date in Job Opening?
+ },
+ callback: function (data) {
+ if(data.message){
+ frm.set_value('staffing_plan', data.message[0]);
+ frm.set_value('planned_vacancies', data.message[1]);
+ } else {
+ frm.set_value('staffing_plan', "");
+ frm.set_value('planned_vacancies', 0);
+ frappe.show_alert({
+ indicator: 'orange',
+ message: __('No Staffing Plans found for this Designation')
+ });
+ }
+ }
+ });
+ }
+ else{
+ frm.set_value('staffing_plan', "");
+ frm.set_value('planned_vacancies', 0);
+ }
+ },
+ company: function(frm) {
+ frm.set_value('designation', "");
+ }
+});
diff --git a/erpnext/hr/doctype/job_opening/job_opening.json b/erpnext/hr/doctype/job_opening/job_opening.json
index de15114..7906439 100644
--- a/erpnext/hr/doctype/job_opening/job_opening.json
+++ b/erpnext/hr/doctype/job_opening/job_opening.json
@@ -41,7 +41,6 @@
"reqd": 1,
"search_index": 0,
"set_only_once": 0,
- "translatable": 0,
"unique": 0
},
{
@@ -73,7 +72,6 @@
"reqd": 1,
"search_index": 0,
"set_only_once": 0,
- "translatable": 0,
"unique": 0
},
{
@@ -104,7 +102,6 @@
"reqd": 0,
"search_index": 0,
"set_only_once": 0,
- "translatable": 0,
"unique": 0
},
{
@@ -134,7 +131,6 @@
"reqd": 0,
"search_index": 0,
"set_only_once": 0,
- "translatable": 0,
"unique": 0
},
{
@@ -166,7 +162,6 @@
"reqd": 0,
"search_index": 0,
"set_only_once": 0,
- "translatable": 0,
"unique": 0
},
{
@@ -198,7 +193,6 @@
"reqd": 0,
"search_index": 0,
"set_only_once": 0,
- "translatable": 0,
"unique": 0
},
{
@@ -224,13 +218,43 @@
"precision": "",
"print_hide": 0,
"print_hide_if_no_value": 0,
- "read_only": 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_on_submit": 0,
+ "bold": 0,
+ "collapsible": 0,
+ "columns": 0,
+ "depends_on": "staffing_plan",
+ "fieldname": "planned_vacancies",
+ "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": "Planned number of Positions",
+ "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,
"unique": 0
},
{
@@ -260,7 +284,6 @@
"reqd": 0,
"search_index": 0,
"set_only_once": 0,
- "translatable": 0,
"unique": 0
},
{
@@ -291,7 +314,6 @@
"reqd": 0,
"search_index": 0,
"set_only_once": 0,
- "translatable": 0,
"unique": 0
},
{
@@ -323,7 +345,6 @@
"reqd": 0,
"search_index": 0,
"set_only_once": 0,
- "translatable": 0,
"unique": 1
},
{
@@ -354,7 +375,6 @@
"reqd": 0,
"search_index": 0,
"set_only_once": 0,
- "translatable": 0,
"unique": 0
}
],
@@ -369,7 +389,7 @@
"issingle": 0,
"istable": 0,
"max_attachments": 0,
- "modified": "2018-04-13 18:52:56.109392",
+ "modified": "2018-05-07 14:16:50.300247",
"modified_by": "Administrator",
"module": "HR",
"name": "Job Opening",
@@ -377,6 +397,7 @@
"permissions": [
{
"amend": 0,
+ "apply_user_permissions": 0,
"cancel": 0,
"create": 1,
"delete": 1,
@@ -396,6 +417,7 @@
},
{
"amend": 0,
+ "apply_user_permissions": 0,
"cancel": 0,
"create": 0,
"delete": 0,
diff --git a/erpnext/hr/doctype/job_opening/job_opening.py b/erpnext/hr/doctype/job_opening/job_opening.py
index 60c911a..b579d6f 100644
--- a/erpnext/hr/doctype/job_opening/job_opening.py
+++ b/erpnext/hr/doctype/job_opening/job_opening.py
@@ -8,6 +8,7 @@
from frappe.website.website_generator import WebsiteGenerator
from frappe import _
+from erpnext.hr.doctype.staffing_plan.staffing_plan import get_current_employee_count, get_active_staffing_plan_and_vacancies
class JobOpening(WebsiteGenerator):
website = frappe._dict(
@@ -19,6 +20,33 @@
def validate(self):
if not self.route:
self.route = frappe.scrub(self.job_title).replace('_', '-')
+ self.validate_current_vacancies()
+
+ def validate_current_vacancies(self):
+ if not self.staffing_plan:
+ vacancies = get_active_staffing_plan_and_vacancies(self.company,
+ self.designation, self.department)
+ if vacancies:
+ self.staffing_plan = vacancies[0]
+ self.planned_vacancies = vacancies[1]
+ elif not self.planned_vacancies:
+ planned_vacancies = frappe.db.sql("""
+ select vacancies from `tabStaffing Plan Detail`
+ where parent=%s and designation=%s""", (self.staffing_plan, self.designation))
+ self.planned_vacancies = planned_vacancies[0][0] if planned_vacancies else None
+
+ if self.staffing_plan and self.planned_vacancies:
+ staffing_plan_company = frappe.db.get_value("Staffing Plan", self.staffing_plan, "company")
+ lft, rgt = frappe.db.get_value("Company", staffing_plan_company, ["lft", "rgt"])
+
+ current_count = get_current_employee_count(self.designation, staffing_plan_company)
+ current_count+= frappe.db.sql("""select count(*) from `tabJob Opening` \
+ where designation=%s and status='Open'
+ and company in (select name from tabCompany where lft>=%s and rgt<=%s)
+ """, (self.designation, lft, rgt))[0][0]
+
+ if self.planned_vacancies <= current_count:
+ frappe.throw(_("Job Openings for designation {0} and company {1} already opened or hiring completed as per Staffing Plan {2}".format(self.designation, staffing_plan_company, self.staffing_plan)))
def get_context(self, context):
context.parents = [{'route': 'jobs', 'title': _('All Jobs') }]
diff --git a/erpnext/hr/doctype/leave_application/leave_application.py b/erpnext/hr/doctype/leave_application/leave_application.py
index b33bd54..23514e1 100755
--- a/erpnext/hr/doctype/leave_application/leave_application.py
+++ b/erpnext/hr/doctype/leave_application/leave_application.py
@@ -5,8 +5,8 @@
import frappe
from frappe import _
from frappe.utils import cint, cstr, date_diff, flt, formatdate, getdate, get_link_to_form, \
- comma_or, get_fullname
-from erpnext.hr.utils import set_employee_name
+ comma_or, get_fullname, add_days
+from erpnext.hr.utils import set_employee_name, get_leave_period
from erpnext.hr.doctype.leave_block_list.leave_block_list import get_applicable_block_dates
from erpnext.hr.doctype.employee.employee import get_holiday_list_for_employee
@@ -15,6 +15,7 @@
class InvalidLeaveApproverError(frappe.ValidationError): pass
class LeaveApproverIdentityError(frappe.ValidationError): pass
class AttendanceAlreadyMarkedError(frappe.ValidationError): pass
+class NotAnOptionalHoliday(frappe.ValidationError): pass
from frappe.model.document import Document
class LeaveApplication(Document):
@@ -31,6 +32,8 @@
self.validate_block_days()
self.validate_salary_processed_days()
self.validate_attendance()
+ if frappe.db.get_value("Leave Type", self.leave_type, 'is_optional_leave'):
+ self.validate_optional_leave()
def on_update(self):
if self.status == "Open" and self.docstatus < 1:
@@ -207,6 +210,19 @@
frappe.throw(_("Attendance for employee {0} is already marked for this day").format(self.employee),
AttendanceAlreadyMarkedError)
+ def validate_optional_leave(self):
+ leave_period = get_leave_period(self.from_date, self.to_date, self.company)
+ if not leave_period:
+ frappe.throw(_("Cannot find active Leave Period"))
+ optional_holiday_list = frappe.db.get_value("Leave Period", leave_period[0]["name"], "optional_holiday_list")
+ if not optional_holiday_list:
+ frappe.throw(_("Optional Holiday List not set for leave period {0}").format(leave_period[0]["name"]))
+ day = getdate(self.from_date)
+ while day <= getdate(self.to_date):
+ if not frappe.db.exists({"doctype": "Holiday", "parent": optional_holiday_list, "holiday_date": day}):
+ frappe.throw(_("{0} is not in Optional Holiday List").format(formatdate(day)), NotAnOptionalHoliday)
+ day = add_days(day, 1)
+
def notify_employee(self):
employee = frappe.get_doc("Employee", self.employee)
if not employee.user_id:
diff --git a/erpnext/hr/doctype/leave_application/test_leave_application.py b/erpnext/hr/doctype/leave_application/test_leave_application.py
index 424da90..e71357c 100644
--- a/erpnext/hr/doctype/leave_application/test_leave_application.py
+++ b/erpnext/hr/doctype/leave_application/test_leave_application.py
@@ -5,8 +5,9 @@
import frappe
import unittest
-from erpnext.hr.doctype.leave_application.leave_application import LeaveDayBlockedError, OverlapError
+from erpnext.hr.doctype.leave_application.leave_application import LeaveDayBlockedError, OverlapError, NotAnOptionalHoliday, get_leave_balance_on
from frappe.permissions import clear_user_permissions_for_doctype
+from frappe.utils import add_days, nowdate
test_dependencies = ["Leave Allocation", "Leave Block List"]
@@ -225,55 +226,54 @@
frappe.db.set_value("Leave Block List", "_Test Leave Block List",
"applies_to_all_departments", 0)
-
+
def test_optional_leave(self):
- ''''''
leave_period = get_leave_period()
- today = get_today()
-
+ today = nowdate()
+ from datetime import date
holiday_list = frappe.get_doc(dict(
doctype = 'Holiday List',
- name = 'test holiday list for optional holiday',
- from_date = year_start_date(),
- to_date = year_end_date(),
+ holiday_list_name = 'test holiday list for optional holiday',
+ from_date = date(date.today().year, 1, 1),
+ to_date = date(date.today().year, 12, 31),
holidays = [
dict(holiday_date = today, description = 'test')
]
- ))
+ )).insert()
employee = get_employee()
-
- frappe.db.set_value('Employee', employee, 'holiday_list', holiday_list)
-
+
+ frappe.db.set_value('Leave Period', leave_period.name, 'optional_holiday_list', holiday_list.name)
+
leave_type = frappe.get_doc(dict(
leave_type_name = 'Test Optional Type',
doctype = 'Leave Type',
- is_optional_leave = 1,
- holiday_list = holiday_list
+ is_optional_leave = 1
)).insert()
-
+
allocate_leaves(employee, leave_period, leave_type.name, 10)
-
- date = get_today() - 1
-
+
+ date = add_days(today, - 1)
+
leave_application = frappe.get_doc(dict(
doctype = 'Leave Application',
- employee = employee,
+ employee = employee.name,
leave_type = leave_type.name,
from_date = date,
to_date = date,
))
-
+
# can only apply on optional holidays
self.assertTrue(NotAnOptionalHoliday, leave_application.insert)
-
+
leave_application.from_date = today
leave_application.to_date = today
+ leave_application.status = "Approved"
leave_application.insert()
leave_application.submit()
-
+
# check leave balance is reduced
- self.assertEqual(get_leave_balance(employee, leave_period, leave_type.name), 9)
-
+ self.assertEqual(get_leave_balance_on(employee.name, leave_type.name, today), 9)
+
def test_leaves_allowed(self):
# TODO: test cannot allocate more than max leaves
pass
@@ -285,7 +285,7 @@
def test_max_continuous_leaves(self):
# TODO: test cannot take continuous leaves more than
pass
-
+
def test_earned_leave(self):
leave_period = get_leave_period()
employee = get_employee()
@@ -297,14 +297,14 @@
earned_leave_frequency = 'Monthly',
rounding = 0.5
)).insert()
-
+
allocate_leaves(employee, leave_period, leave_type.name, 0, eligible_leaves = 12)
-
+
# this method will be called by scheduler
allocate_earned_leaves(leave_type.name, leave_period, as_on = half_of_leave_period)
-
+
self.assertEqual(get_leave_balance(employee, leave_period, leave_type.name), 6)
-
+
def make_allocation_record(employee=None, leave_type=None):
frappe.db.sql("delete from `tabLeave Allocation`")
@@ -319,4 +319,4 @@
})
allocation.insert(ignore_permissions=True)
- allocation.submit()
\ No newline at end of file
+ allocation.submit()
diff --git a/erpnext/hr/doctype/leave_control_panel/leave_control_panel.js b/erpnext/hr/doctype/leave_control_panel/leave_control_panel.js
index 0eb6414..7aeb8ea 100644
--- a/erpnext/hr/doctype/leave_control_panel/leave_control_panel.js
+++ b/erpnext/hr/doctype/leave_control_panel/leave_control_panel.js
@@ -26,6 +26,19 @@
refresh_field('no_of_days');
}
-frappe.ui.form.on("Leave Control Panel", "refresh", function (frm) {
- frm.disable_save();
+frappe.ui.form.on("Leave Control Panel", {
+ company: function(frm) {
+ if(frm.doc.company) {
+ frm.set_query("department", function() {
+ return {
+ "filters": {
+ "company": frm.doc.company,
+ }
+ };
+ });
+ }
+ },
+ refresh: function(frm) {
+ frm.disable_save();
+ }
});
\ No newline at end of file
diff --git a/erpnext/hr/doctype/leave_period/leave_period.js b/erpnext/hr/doctype/leave_period/leave_period.js
index 2a6010e..a54147d 100644
--- a/erpnext/hr/doctype/leave_period/leave_period.js
+++ b/erpnext/hr/doctype/leave_period/leave_period.js
@@ -2,7 +2,13 @@
// For license information, please see license.txt
frappe.ui.form.on('Leave Period', {
- refresh: function(frm) {
-
+ onload: function(frm) {
+ frm.set_query("department", function() {
+ return {
+ "filters": {
+ "company": frm.doc.company,
+ }
+ };
+ });
}
});
diff --git a/erpnext/hr/doctype/leave_period/leave_period.json b/erpnext/hr/doctype/leave_period/leave_period.json
index 946ceec..516d52d 100644
--- a/erpnext/hr/doctype/leave_period/leave_period.json
+++ b/erpnext/hr/doctype/leave_period/leave_period.json
@@ -41,7 +41,6 @@
"reqd": 1,
"search_index": 0,
"set_only_once": 0,
- "translatable": 0,
"unique": 0
},
{
@@ -72,7 +71,6 @@
"reqd": 1,
"search_index": 0,
"set_only_once": 0,
- "translatable": 0,
"unique": 0
},
{
@@ -102,7 +100,6 @@
"reqd": 0,
"search_index": 0,
"set_only_once": 0,
- "translatable": 0,
"unique": 0
},
{
@@ -134,7 +131,6 @@
"reqd": 1,
"search_index": 0,
"set_only_once": 0,
- "translatable": 0,
"unique": 0
},
{
@@ -165,7 +161,37 @@
"reqd": 0,
"search_index": 0,
"set_only_once": 0,
- "translatable": 0,
+ "unique": 0
+ },
+ {
+ "allow_bulk_edit": 0,
+ "allow_on_submit": 0,
+ "bold": 0,
+ "collapsible": 0,
+ "columns": 0,
+ "fieldname": "optional_holiday_list",
+ "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": "Holiday List for Optional Leave",
+ "length": 0,
+ "no_copy": 0,
+ "options": "Holiday List",
+ "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,
"unique": 0
},
{
@@ -196,7 +222,6 @@
"reqd": 0,
"search_index": 0,
"set_only_once": 0,
- "translatable": 0,
"unique": 0
},
{
@@ -227,7 +252,6 @@
"reqd": 0,
"search_index": 0,
"set_only_once": 0,
- "translatable": 0,
"unique": 0
},
{
@@ -259,7 +283,6 @@
"reqd": 0,
"search_index": 0,
"set_only_once": 0,
- "translatable": 0,
"unique": 0
},
{
@@ -291,7 +314,6 @@
"reqd": 0,
"search_index": 0,
"set_only_once": 0,
- "translatable": 0,
"unique": 0
},
{
@@ -323,7 +345,6 @@
"reqd": 0,
"search_index": 0,
"set_only_once": 0,
- "translatable": 0,
"unique": 0
},
{
@@ -355,7 +376,6 @@
"reqd": 0,
"search_index": 0,
"set_only_once": 0,
- "translatable": 0,
"unique": 0
},
{
@@ -386,7 +406,6 @@
"reqd": 0,
"search_index": 0,
"set_only_once": 0,
- "translatable": 0,
"unique": 0
},
{
@@ -416,7 +435,6 @@
"reqd": 0,
"search_index": 0,
"set_only_once": 0,
- "translatable": 0,
"unique": 0
},
{
@@ -447,7 +465,6 @@
"reqd": 0,
"search_index": 0,
"set_only_once": 0,
- "translatable": 0,
"unique": 0
}
],
@@ -461,7 +478,7 @@
"issingle": 0,
"istable": 0,
"max_attachments": 0,
- "modified": "2018-04-14 13:29:57.066314",
+ "modified": "2018-05-04 18:25:06.719932",
"modified_by": "Administrator",
"module": "HR",
"name": "Leave Period",
@@ -470,6 +487,7 @@
"permissions": [
{
"amend": 0,
+ "apply_user_permissions": 0,
"cancel": 0,
"create": 1,
"delete": 1,
@@ -489,6 +507,7 @@
},
{
"amend": 0,
+ "apply_user_permissions": 0,
"cancel": 0,
"create": 1,
"delete": 1,
@@ -508,6 +527,7 @@
},
{
"amend": 0,
+ "apply_user_permissions": 0,
"cancel": 0,
"create": 1,
"delete": 1,
diff --git a/erpnext/hr/doctype/leave_period/test_leave_period.py b/erpnext/hr/doctype/leave_period/test_leave_period.py
index 381fbb2..dcf6293 100644
--- a/erpnext/hr/doctype/leave_period/test_leave_period.py
+++ b/erpnext/hr/doctype/leave_period/test_leave_period.py
@@ -28,4 +28,4 @@
def test_duplicate_grant(self):
leave_period = self.test_leave_grant()
self.assertRaises(DuplicateLeaveGrant, leave_period.grant_leaves)
-
\ No newline at end of file
+
diff --git a/erpnext/hr/doctype/leave_type/leave_type.json b/erpnext/hr/doctype/leave_type/leave_type.json
index 1d1aef20..aad7e7b 100644
--- a/erpnext/hr/doctype/leave_type/leave_type.json
+++ b/erpnext/hr/doctype/leave_type/leave_type.json
@@ -41,7 +41,6 @@
"reqd": 1,
"search_index": 0,
"set_only_once": 0,
- "translatable": 0,
"unique": 0
},
{
@@ -73,7 +72,6 @@
"reqd": 0,
"search_index": 0,
"set_only_once": 0,
- "translatable": 0,
"unique": 0
},
{
@@ -104,7 +102,6 @@
"reqd": 0,
"search_index": 0,
"set_only_once": 0,
- "translatable": 0,
"unique": 0
},
{
@@ -136,7 +133,6 @@
"reqd": 0,
"search_index": 0,
"set_only_once": 0,
- "translatable": 0,
"unique": 0
},
{
@@ -166,7 +162,6 @@
"reqd": 0,
"search_index": 0,
"set_only_once": 0,
- "translatable": 0,
"unique": 0
},
{
@@ -198,7 +193,6 @@
"reqd": 0,
"search_index": 0,
"set_only_once": 0,
- "translatable": 0,
"unique": 0
},
{
@@ -228,7 +222,36 @@
"reqd": 0,
"search_index": 0,
"set_only_once": 0,
- "translatable": 0,
+ "unique": 0
+ },
+ {
+ "allow_bulk_edit": 0,
+ "allow_on_submit": 0,
+ "bold": 0,
+ "collapsible": 0,
+ "columns": 0,
+ "fieldname": "is_optional_leave",
+ "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 Optional Leave",
+ "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,
"unique": 0
},
{
@@ -258,7 +281,6 @@
"reqd": 0,
"search_index": 0,
"set_only_once": 0,
- "translatable": 0,
"unique": 0
},
{
@@ -288,7 +310,6 @@
"reqd": 0,
"search_index": 0,
"set_only_once": 0,
- "translatable": 0,
"unique": 0
},
{
@@ -319,7 +340,6 @@
"reqd": 0,
"search_index": 0,
"set_only_once": 0,
- "translatable": 0,
"unique": 0
},
{
@@ -350,7 +370,6 @@
"reqd": 0,
"search_index": 0,
"set_only_once": 0,
- "translatable": 0,
"unique": 0
},
{
@@ -382,7 +401,6 @@
"reqd": 0,
"search_index": 0,
"set_only_once": 0,
- "translatable": 0,
"unique": 0
},
{
@@ -413,7 +431,6 @@
"reqd": 0,
"search_index": 0,
"set_only_once": 0,
- "translatable": 0,
"unique": 0
},
{
@@ -445,7 +462,6 @@
"reqd": 0,
"search_index": 0,
"set_only_once": 0,
- "translatable": 0,
"unique": 0
},
{
@@ -478,102 +494,6 @@
"reqd": 0,
"search_index": 0,
"set_only_once": 0,
- "translatable": 0,
- "unique": 0
- },
- {
- "allow_bulk_edit": 0,
- "allow_on_submit": 0,
- "bold": 0,
- "collapsible": 1,
- "columns": 0,
- "fieldname": "section_break_13",
- "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": "Optional Leave",
- "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_on_submit": 0,
- "bold": 0,
- "collapsible": 0,
- "columns": 0,
- "fieldname": "is_optional_leave",
- "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 Optional Leave",
- "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_on_submit": 0,
- "bold": 0,
- "collapsible": 0,
- "columns": 0,
- "depends_on": "is_optional_leave",
- "fieldname": "holiday_list",
- "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": "Holiday List",
- "length": 0,
- "no_copy": 0,
- "options": "Holiday List",
- "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
},
{
@@ -604,7 +524,6 @@
"reqd": 0,
"search_index": 0,
"set_only_once": 0,
- "translatable": 0,
"unique": 0
},
{
@@ -635,7 +554,6 @@
"reqd": 0,
"search_index": 0,
"set_only_once": 0,
- "translatable": 0,
"unique": 0
},
{
@@ -668,7 +586,6 @@
"reqd": 0,
"search_index": 0,
"set_only_once": 0,
- "translatable": 0,
"unique": 0
},
{
@@ -701,7 +618,6 @@
"reqd": 0,
"search_index": 0,
"set_only_once": 0,
- "translatable": 0,
"unique": 0
}
],
@@ -716,7 +632,7 @@
"issingle": 0,
"istable": 0,
"max_attachments": 0,
- "modified": "2018-04-14 14:36:46.824289",
+ "modified": "2018-05-03 19:42:23.852331",
"modified_by": "Administrator",
"module": "HR",
"name": "Leave Type",
@@ -724,6 +640,7 @@
"permissions": [
{
"amend": 0,
+ "apply_user_permissions": 0,
"cancel": 0,
"create": 1,
"delete": 1,
@@ -743,6 +660,7 @@
},
{
"amend": 0,
+ "apply_user_permissions": 0,
"cancel": 0,
"create": 1,
"delete": 1,
@@ -762,6 +680,7 @@
},
{
"amend": 0,
+ "apply_user_permissions": 0,
"cancel": 0,
"create": 0,
"delete": 0,
diff --git a/erpnext/hr/doctype/payroll_entry/payroll_entry.js b/erpnext/hr/doctype/payroll_entry/payroll_entry.js
index 1e6dc51..d02e1f1 100644
--- a/erpnext/hr/doctype/payroll_entry/payroll_entry.js
+++ b/erpnext/hr/doctype/payroll_entry/payroll_entry.js
@@ -9,6 +9,14 @@
frm.doc.posting_date = frappe.datetime.nowdate();
}
frm.toggle_reqd(['payroll_frequency'], !frm.doc.salary_slip_based_on_timesheet);
+
+ frm.set_query("department", function() {
+ return {
+ "filters": {
+ "company": frm.doc.company,
+ }
+ };
+ });
},
refresh: function(frm) {
diff --git a/erpnext/hr/doctype/payroll_entry/payroll_entry.json b/erpnext/hr/doctype/payroll_entry/payroll_entry.json
index 0af6d5d..54f1e45 100644
--- a/erpnext/hr/doctype/payroll_entry/payroll_entry.json
+++ b/erpnext/hr/doctype/payroll_entry/payroll_entry.json
@@ -588,7 +588,7 @@
"bold": 0,
"collapsible": 0,
"columns": 0,
- "fieldname": "include_unclaimed_employee_benefits",
+ "fieldname": "deduct_tax_for_unclaimed_employee_benefits",
"fieldtype": "Check",
"hidden": 0,
"ignore_user_permissions": 0,
@@ -597,7 +597,7 @@
"in_global_search": 0,
"in_list_view": 0,
"in_standard_filter": 0,
- "label": "Include Unclaimed Employee Benefits",
+ "label": "Deduct Tax For Unclaimed Employee Benefits",
"length": 0,
"no_copy": 0,
"permlevel": 0,
@@ -968,7 +968,7 @@
"issingle": 0,
"istable": 0,
"max_attachments": 0,
- "modified": "2018-04-13 17:28:42.759513",
+ "modified": "2018-04-27 12:42:45.054509",
"modified_by": "Administrator",
"module": "HR",
"name": "Payroll Entry",
diff --git a/erpnext/hr/doctype/payroll_entry/payroll_entry.py b/erpnext/hr/doctype/payroll_entry/payroll_entry.py
index 1025bc7..e1b841f 100644
--- a/erpnext/hr/doctype/payroll_entry/payroll_entry.py
+++ b/erpnext/hr/doctype/payroll_entry/payroll_entry.py
@@ -40,15 +40,16 @@
{"company": self.company, "salary_slip_based_on_timesheet":self.salary_slip_based_on_timesheet})
if sal_struct:
- cond += "and t2.parent IN %(sal_struct)s "
+ cond += "and t2.salary_structure IN %(sal_struct)s "
emp_list = frappe.db.sql("""
select
t1.name as employee, t1.employee_name, t1.department, t1.designation
from
- `tabEmployee` t1, `tabSalary Structure Employee` t2
+ `tabEmployee` t1, `tabSalary Structure Assignment` t2
where
t1.docstatus!=2
and t1.name = t2.employee
+ and t2.docstatus = 1
%s """% cond, {"sal_struct": sal_struct}, as_dict=True)
return emp_list
diff --git a/erpnext/hr/doctype/salary_component/salary_component.json b/erpnext/hr/doctype/salary_component/salary_component.json
index ac8e51d..5f875a9 100644
--- a/erpnext/hr/doctype/salary_component/salary_component.json
+++ b/erpnext/hr/doctype/salary_component/salary_component.json
@@ -144,6 +144,37 @@
"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
+ },
+ {
+ "allow_bulk_edit": 0,
+ "allow_on_submit": 0,
+ "bold": 0,
+ "collapsible": 0,
+ "columns": 0,
"fieldname": "description",
"fieldtype": "Small Text",
"hidden": 0,
@@ -239,8 +270,8 @@
"collapsible": 0,
"columns": 0,
"depends_on": "is_flexible_benefit",
- "fieldname": "is_pro_rata_applicable",
- "fieldtype": "Check",
+ "fieldname": "max_benefit_amount",
+ "fieldtype": "Currency",
"hidden": 0,
"ignore_user_permissions": 0,
"ignore_xss_filter": 0,
@@ -248,7 +279,7 @@
"in_global_search": 0,
"in_list_view": 0,
"in_standard_filter": 0,
- "label": "Is Pro-rata Applicable",
+ "label": "Max Benefit Amount (Yearly)",
"length": 0,
"no_copy": 0,
"permlevel": 0,
@@ -270,6 +301,39 @@
"bold": 0,
"collapsible": 0,
"columns": 0,
+ "depends_on": "is_flexible_benefit",
+ "fieldname": "earning_component_group",
+ "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": "Earning Component Group",
+ "length": 0,
+ "no_copy": 0,
+ "options": "Salary Component",
+ "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_on_submit": 0,
+ "bold": 0,
+ "collapsible": 0,
+ "columns": 0,
"fieldname": "column_break_9",
"fieldtype": "Column Break",
"hidden": 0,
@@ -301,8 +365,8 @@
"collapsible": 0,
"columns": 0,
"depends_on": "is_flexible_benefit",
- "fieldname": "max_benefit",
- "fieldtype": "Currency",
+ "fieldname": "is_pro_rata_applicable",
+ "fieldtype": "Check",
"hidden": 0,
"ignore_user_permissions": 0,
"ignore_xss_filter": 0,
@@ -310,7 +374,7 @@
"in_global_search": 0,
"in_list_view": 0,
"in_standard_filter": 0,
- "label": "Max Benefit (Amount)",
+ "label": "Is Pro-rata Applicable",
"length": 0,
"no_copy": 0,
"permlevel": 0,
@@ -333,8 +397,8 @@
"collapsible": 0,
"columns": 0,
"depends_on": "is_flexible_benefit",
- "fieldname": "earning_component_if_unclaimed",
- "fieldtype": "Link",
+ "fieldname": "only_tax_impact",
+ "fieldtype": "Check",
"hidden": 0,
"ignore_user_permissions": 0,
"ignore_xss_filter": 0,
@@ -342,10 +406,40 @@
"in_global_search": 0,
"in_list_view": 0,
"in_standard_filter": 0,
- "label": "Earning Component If Unclaimed",
+ "label": "Only Tax Impact (Cannot Claim But Part of Taxable Income)",
"length": 0,
"no_copy": 0,
- "options": "Salary Component",
+ "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_on_submit": 0,
+ "bold": 0,
+ "collapsible": 0,
+ "columns": 0,
+ "fieldname": "create_separate_payment_entry_against_benefit_claim",
+ "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": "Create Separate Payment Entry Against Benefit Claim",
+ "length": 0,
+ "no_copy": 0,
"permlevel": 0,
"precision": "",
"print_hide": 0,
@@ -516,6 +610,320 @@
"set_only_once": 0,
"translatable": 0,
"unique": 0
+ },
+ {
+ "allow_bulk_edit": 0,
+ "allow_on_submit": 0,
+ "bold": 0,
+ "collapsible": 1,
+ "columns": 0,
+ "fieldname": "condition_and_formula",
+ "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": "Condition and Formula",
+ "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_on_submit": 0,
+ "bold": 0,
+ "collapsible": 0,
+ "columns": 0,
+ "fieldname": "condition",
+ "fieldtype": "Code",
+ "hidden": 0,
+ "ignore_user_permissions": 0,
+ "ignore_xss_filter": 0,
+ "in_filter": 0,
+ "in_global_search": 0,
+ "in_list_view": 0,
+ "in_standard_filter": 0,
+ "label": "Condition",
+ "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_on_submit": 0,
+ "bold": 0,
+ "collapsible": 0,
+ "columns": 0,
+ "description": "If selected, the value specified or calculated in this component will not contribute to the earnings or deductions. However, it's value can be referenced by other components that can be added or deducted. ",
+ "fieldname": "statistical_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": "Statistical 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_on_submit": 0,
+ "bold": 0,
+ "collapsible": 0,
+ "columns": 0,
+ "fieldname": "depends_on_lwp",
+ "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": "Depends on Leave Without Pay",
+ "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_on_submit": 0,
+ "bold": 0,
+ "collapsible": 0,
+ "columns": 0,
+ "fieldname": "do_not_include_in_total",
+ "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": "Do not include in total",
+ "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_on_submit": 0,
+ "bold": 0,
+ "collapsible": 0,
+ "columns": 0,
+ "default": "1",
+ "fieldname": "amount_based_on_formula",
+ "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": "Amount based on formula",
+ "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_on_submit": 0,
+ "bold": 0,
+ "collapsible": 0,
+ "columns": 0,
+ "depends_on": "eval:doc.amount_based_on_formula!==0",
+ "fieldname": "formula",
+ "fieldtype": "Code",
+ "hidden": 0,
+ "ignore_user_permissions": 0,
+ "ignore_xss_filter": 0,
+ "in_filter": 0,
+ "in_global_search": 0,
+ "in_list_view": 0,
+ "in_standard_filter": 0,
+ "label": "Formula",
+ "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_on_submit": 0,
+ "bold": 0,
+ "collapsible": 0,
+ "columns": 0,
+ "depends_on": "eval:doc.amount_based_on_formula!==1",
+ "fieldname": "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",
+ "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_on_submit": 0,
+ "bold": 0,
+ "collapsible": 0,
+ "columns": 0,
+ "fieldname": "column_break_28",
+ "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_on_submit": 0,
+ "bold": 0,
+ "collapsible": 0,
+ "columns": 0,
+ "fieldname": "help",
+ "fieldtype": "HTML",
+ "hidden": 0,
+ "ignore_user_permissions": 0,
+ "ignore_xss_filter": 0,
+ "in_filter": 0,
+ "in_global_search": 0,
+ "in_list_view": 0,
+ "in_standard_filter": 0,
+ "label": "Help",
+ "length": 0,
+ "no_copy": 0,
+ "options": "<h3>Help</h3>\n\n<p>Notes:</p>\n\n<ol>\n<li>Use field <code>base</code> for using base salary of the Employee</li>\n<li>Use Salary Component abbreviations in conditions and formulas. <code>BS = Basic Salary</code></li>\n<li>Use field name for employee details in conditions and formulas. <code>Employment Type = employment_type</code><code>Branch = branch</code></li>\n<li>Use field name from Salary Slip in conditions and formulas. <code>Payment Days = payment_days</code><code>Leave without pay = leave_without_pay</code></li>\n<li>Direct Amount can also be entered based on Condtion. See example 3</li></ol>\n\n<h4>Examples</h4>\n<ol>\n<li>Calculating Basic Salary based on <code>base</code>\n<pre><code>Condition: base < 10000</code></pre>\n<pre><code>Formula: base * .2</code></pre></li>\n<li>Calculating HRA based on Basic Salary<code>BS</code> \n<pre><code>Condition: BS > 2000</code></pre>\n<pre><code>Formula: BS * .1</code></pre></li>\n<li>Calculating TDS based on Employment Type<code>employment_type</code> \n<pre><code>Condition: employment_type==\"Intern\"</code></pre>\n<pre><code>Amount: 1000</code></pre></li>\n</ol>",
+ "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,
@@ -529,7 +937,7 @@
"issingle": 0,
"istable": 0,
"max_attachments": 0,
- "modified": "2018-04-13 20:10:20.771538",
+ "modified": "2018-05-09 17:35:11.073733",
"modified_by": "Administrator",
"module": "HR",
"name": "Salary Component",
diff --git a/erpnext/hr/doctype/salary_slip/salary_slip.json b/erpnext/hr/doctype/salary_slip/salary_slip.json
index 240e3cf..6f524f2 100644
--- a/erpnext/hr/doctype/salary_slip/salary_slip.json
+++ b/erpnext/hr/doctype/salary_slip/salary_slip.json
@@ -1044,7 +1044,7 @@
"bold": 0,
"collapsible": 0,
"columns": 0,
- "fieldname": "include_unclaimed_employee_benefits",
+ "fieldname": "deduct_tax_for_unclaimed_employee_benefits",
"fieldtype": "Check",
"hidden": 0,
"ignore_user_permissions": 0,
@@ -1053,7 +1053,7 @@
"in_global_search": 0,
"in_list_view": 0,
"in_standard_filter": 0,
- "label": "Include Unclaimed Employee Benefits",
+ "label": "Deduct Tax For Unclaimed Employee Benefits",
"length": 0,
"no_copy": 0,
"permlevel": 0,
@@ -1435,7 +1435,7 @@
"in_global_search": 0,
"in_list_view": 0,
"in_standard_filter": 0,
- "label": "Loan",
+ "label": "Employee Loan",
"length": 0,
"no_copy": 0,
"options": "Salary Slip Loan",
@@ -1812,7 +1812,7 @@
"issingle": 0,
"istable": 0,
"max_attachments": 0,
- "modified": "2018-04-13 20:14:23.105069",
+ "modified": "2018-04-27 12:42:21.278360",
"modified_by": "Administrator",
"module": "HR",
"name": "Salary Slip",
@@ -1835,7 +1835,6 @@
"set_user_permissions": 0,
"share": 1,
"submit": 1,
- "user_permission_doctypes": "[\"Branch\",\"Company\",\"Department\",\"Designation\",\"Fiscal Year\",\"Salary Slip\"]",
"write": 1
},
{
@@ -1874,7 +1873,6 @@
"set_user_permissions": 0,
"share": 0,
"submit": 0,
- "user_permission_doctypes": "[\"Employee\"]",
"write": 0
}
],
diff --git a/erpnext/hr/doctype/salary_slip/salary_slip.py b/erpnext/hr/doctype/salary_slip/salary_slip.py
index 75eb73b..99de580 100644
--- a/erpnext/hr/doctype/salary_slip/salary_slip.py
+++ b/erpnext/hr/doctype/salary_slip/salary_slip.py
@@ -104,8 +104,8 @@
'''Returns data for evaluating formula'''
data = frappe._dict()
- data.update(frappe.get_doc("Salary Structure Employee",
- {"employee": self.employee, "parent": self.salary_structure}).as_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())
@@ -166,10 +166,10 @@
if self.payroll_frequency:
cond = """and payroll_frequency = '%(payroll_frequency)s'""" % {"payroll_frequency": self.payroll_frequency}
- st_name = frappe.db.sql("""select parent from `tabSalary Structure Employee`
+ st_name = frappe.db.sql("""select salary_structure from `tabSalary Structure Assignment`
where employee=%s and (from_date <= %s or from_date <= %s)
and (to_date is null or to_date >= %s or to_date >= %s)
- and parent in (select name from `tabSalary Structure`
+ and salary_structure in (select name from `tabSalary Structure`
where is_active = 'Yes'%s)
"""% ('%s', '%s', '%s','%s','%s', cond),(self.employee, self.start_date, joining_date, self.end_date, relieving_date))
@@ -327,7 +327,7 @@
def sum_components(self, component_type, total_field):
joining_date, relieving_date = frappe.db.get_value("Employee", self.employee,
["date_of_joining", "relieving_date"])
-
+
if not relieving_date:
relieving_date = getdate(self.end_date)
@@ -463,4 +463,4 @@
if linked_ss:
for ss in linked_ss:
ss_doc = frappe.get_doc("Salary Slip", ss)
- frappe.db.set_value("Salary Slip", ss_doc.name, "journal_entry", "")
\ No newline at end of file
+ frappe.db.set_value("Salary Slip", ss_doc.name, "journal_entry", "")
diff --git a/erpnext/hr/doctype/salary_slip/test_salary_slip.py b/erpnext/hr/doctype/salary_slip/test_salary_slip.py
index cced29d..ae58298 100644
--- a/erpnext/hr/doctype/salary_slip/test_salary_slip.py
+++ b/erpnext/hr/doctype/salary_slip/test_salary_slip.py
@@ -7,6 +7,7 @@
import erpnext
import calendar
from erpnext.accounts.utils import get_fiscal_year
+from frappe.utils.make_random import get_random
from frappe.utils import getdate, nowdate, add_days, add_months, flt
from erpnext.hr.doctype.salary_structure.salary_structure import make_salary_slip
from erpnext.hr.doctype.payroll_entry.test_payroll_entry import get_salary_component_account
@@ -272,33 +273,31 @@
frappe.get_doc({
"doctype": "Salary Structure",
"name": sal_struct,
- "company": erpnext.get_default_company(),
- "employees": get_employee_details(employee),
+ "company": "_Test Company",
"earnings": get_earnings_component(),
"deductions": get_deductions_component(),
"payroll_frequency": payroll_frequency,
- "payment_account": frappe.get_value('Account', {'account_type': 'Cash', 'company': erpnext.get_default_company(),'is_group':0}, "name")
+ "payment_account": get_random("Account")
}).insert()
- elif not frappe.db.get_value("Salary Structure Employee",{'parent':sal_struct, 'employee':employee},'name'):
+ create_salary_structure_assignment(employee, sal_struct)
+
+ elif not frappe.db.get_value("Salary Structure Assignment",{'salary_structure':sal_struct, 'employee':employee},'name'):
sal_struct = frappe.get_doc("Salary Structure", sal_struct)
- sal_struct.append("employees", {"employee": employee,
- "employee_name": employee,
- "base": 32000,
- "variable": 3200,
- "from_date": add_months(nowdate(),-1)
- })
- sal_struct.save()
+ create_salary_structure_assignment(employee, sal_struct)
sal_struct = sal_struct.name
return sal_struct
-def get_employee_details(employee):
- return [{"employee": employee,
- "base": 50000,
- "variable": 5000,
- "from_date": add_months(nowdate(),-1)
- }
- ]
+def create_salary_structure_assignment(employee, salary_structure):
+ salary_structure_assignment = frappe.new_doc("Salary Structure Assignment")
+ salary_structure_assignment.employee = employee
+ salary_structure_assignment.base = 50000
+ salary_structure_assignment.variable = 5000
+ salary_structure_assignment.from_date = add_months(nowdate(), -1)
+ salary_structure_assignment.salary_structure = salary_structure
+ salary_structure_assignment.company = erpnext.get_default_company()
+ salary_structure_assignment.save(ignore_permissions=True)
+ return salary_structure_assignment
def get_earnings_component():
return [
@@ -353,4 +352,4 @@
"formula": 'base*.1',
"idx": 3
}
- ]
\ No newline at end of file
+ ]
diff --git a/erpnext/hr/doctype/salary_structure/salary_structure.js b/erpnext/hr/doctype/salary_structure/salary_structure.js
index 8e5f8e6..6f5c923 100755
--- a/erpnext/hr/doctype/salary_structure/salary_structure.js
+++ b/erpnext/hr/doctype/salary_structure/salary_structure.js
@@ -47,8 +47,18 @@
frm.fields_dict['earnings'].grid.set_column_disp("default_amount", false);
frm.fields_dict['deductions'].grid.set_column_disp("default_amount", false);
- frm.add_custom_button(__("Preview Salary Slip"),
- function() { frm.trigger('preview_salary_slip'); }, "fa fa-sitemap", "btn-default");
+ frm.add_custom_button(__("Preview Salary Slip"), function() {
+ frm.trigger('preview_salary_slip');
+ });
+
+ if(frm.doc.docstatus==1) {
+ frm.add_custom_button(__("Assign Salary Structure"), function() {
+ var doc = frappe.model.get_new_doc('Salary Structure Assignment');
+ doc.salary_structure = frm.doc.name;
+ doc.company = frm.doc.company;
+ frappe.set_route('Form', 'Salary Structure Assignment', doc.name);
+ });
+ }
},
salary_slip_based_on_timesheet: function(frm) {
@@ -155,5 +165,46 @@
deductions_remove: function(frm) {
calculate_totals(frm.doc);
+ },
+
+ salary_component: function(frm, cdt, cdn) {
+ var child = locals[cdt][cdn];
+ if(child.salary_component){
+ frappe.call({
+ method: "frappe.client.get",
+ args: {
+ doctype: "Salary Component",
+ name: child.salary_component
+ },
+ callback: function(data) {
+ if(data.message){
+ var result = data.message;
+ frappe.model.set_value(cdt, cdn, 'condition',result.condition);
+ frappe.model.set_value(cdt, cdn, 'amount_based_on_formula',result.amount_based_on_formula);
+ if(result.amount_based_on_formula == 1){
+ frappe.model.set_value(cdt, cdn, 'formula',result.formula);
+ }
+ else{
+ frappe.model.set_value(cdt, cdn, 'amount',result.amount);
+ }
+ frappe.model.set_value(cdt, cdn, 'statistical_component',result.statistical_component);
+ frappe.model.set_value(cdt, cdn, 'depends_on_lwp',result.depends_on_lwp);
+ frappe.model.set_value(cdt, cdn, 'do_not_include_in_total',result.do_not_include_in_total);
+ refresh_field("earnings");
+ refresh_field("deductions");
+ }
+ }
+ });
+ }
+ },
+
+ amount_based_on_formula: function(frm, cdt, cdn) {
+ var child = locals[cdt][cdn];
+ if(child.amount_based_on_formula == 1){
+ frappe.model.set_value(cdt, cdn, 'amount', null);
+ }
+ else{
+ frappe.model.set_value(cdt, cdn, 'formula', null);
+ }
}
})
diff --git a/erpnext/hr/doctype/salary_structure_assignment/salary_structure_assignment.js b/erpnext/hr/doctype/salary_structure_assignment/salary_structure_assignment.js
index e7c6598..af4ca3a 100644
--- a/erpnext/hr/doctype/salary_structure_assignment/salary_structure_assignment.js
+++ b/erpnext/hr/doctype/salary_structure_assignment/salary_structure_assignment.js
@@ -11,9 +11,36 @@
}
}
});
+ frm.set_query("salary_structure", function() {
+ return {
+ filters: {
+ company: frm.doc.company,
+ is_active: "Yes",
+ docstatus: 1
+ }
+ }
+ });
},
-
- refresh: function(frm) {
-
+ employee: function(frm) {
+ if(frm.doc.employee){
+ frappe.call({
+ method: "frappe.client.get_value",
+ args:{
+ doctype: "Employee",
+ fieldname: "company",
+ filters:{
+ name: frm.doc.employee
+ }
+ },
+ callback: function(data) {
+ if(data.message){
+ frm.set_value("company", data.message.company);
+ }
+ }
+ });
+ }
+ else{
+ frm.set_value("company", null);
+ }
}
});
diff --git a/erpnext/hr/doctype/salary_structure_assignment/salary_structure_assignment.py b/erpnext/hr/doctype/salary_structure_assignment/salary_structure_assignment.py
index c9269d7..ee2920b 100644
--- a/erpnext/hr/doctype/salary_structure_assignment/salary_structure_assignment.py
+++ b/erpnext/hr/doctype/salary_structure_assignment/salary_structure_assignment.py
@@ -11,6 +11,7 @@
class SalaryStructureAssignment(Document):
def validate(self):
self.validate_dates()
+ self.validate_duplicate_assignments()
def validate_dates(self):
joining_date, relieving_date = frappe.db.get_value("Employee", self.employee,
@@ -33,10 +34,14 @@
.format(self.to_date, relieving_date))
def validate_duplicate_assignments(self):
+ if not self.name:
+ # hack! if name is null, it could cause problems with !=
+ self.name = "New "+self.doctype
assignment = frappe.db.sql("""
select name from `tabSalary Structure Assignment`
where employee=%(employee)s
- and name != %(salary_struct)s
+ and name != %(name)s
+ and docstatus != 2
and (
(%(from_date)s between from_date and ifnull(to_date, '2199-12-31'))
or (%(to_date)s between from_date and ifnull(to_date, '2199-12-31'))
@@ -45,8 +50,8 @@
'employee': self.employee,
'from_date': self.from_date,
'to_date': (self.to_date or '2199-12-31'),
- 'salary_struct': self.salary_struct
+ 'name': self.name
})
if assignment:
- frappe.throw(_("Active Salary Structure Assignment {0} found for employee {1} for the given dates").format(assignment[0][0], self.employee))
\ No newline at end of file
+ frappe.throw(_("Active Salary Structure Assignment {0} found for employee {1} for the given dates").format(assignment[0][0], self.employee))
diff --git a/erpnext/hr/doctype/shift_request/test_shift_request.py b/erpnext/hr/doctype/shift_request/test_shift_request.py
index 0b8bcb8..d32443a 100644
--- a/erpnext/hr/doctype/shift_request/test_shift_request.py
+++ b/erpnext/hr/doctype/shift_request/test_shift_request.py
@@ -5,6 +5,24 @@
import frappe
import unittest
+from frappe.utils import nowdate
class TestShiftRequest(unittest.TestCase):
- pass
+ def test_make_shift_request(self):
+ shift_request = frappe.get_doc({
+ "doctype": "Shift Request",
+ "shift_type": "Day Shift",
+ "company": "_Test Company",
+ "employee": "_T-Employee-00001",
+ "employee_name": "_Test Employee",
+ "start_date": nowdate(),
+ "end_date": nowdate()
+ })
+ shift_request.insert()
+ shift_request.submit()
+ shift_assignment = frappe.db.sql("""select employee
+ from `tabShift Assignment`
+ where shift_request = %s""", shift_request.name)
+ if shift_assignment:
+ employee = shift_assignment[0][0]
+ self.assertEqual(shift_request.employee, employee)
\ No newline at end of file
diff --git a/erpnext/hr/doctype/shift_type/test_shift_type.py b/erpnext/hr/doctype/shift_type/test_shift_type.py
index bc4f0ea..d5afdf5 100644
--- a/erpnext/hr/doctype/shift_type/test_shift_type.py
+++ b/erpnext/hr/doctype/shift_type/test_shift_type.py
@@ -7,4 +7,11 @@
import unittest
class TestShiftType(unittest.TestCase):
- pass
+ def test_make_shift_type(self):
+ shift_type = frappe.get_doc({
+ "doctype": "Shift Type",
+ "name": "Day Shift",
+ "start_time": "9:00:00",
+ "end_time": "18:00:00"
+ })
+ shift_type.insert()
diff --git a/erpnext/hr/doctype/staffing_plan/staffing_plan.js b/erpnext/hr/doctype/staffing_plan/staffing_plan.js
index 3cadfc5..ca57d9f 100644
--- a/erpnext/hr/doctype/staffing_plan/staffing_plan.js
+++ b/erpnext/hr/doctype/staffing_plan/staffing_plan.js
@@ -2,7 +2,100 @@
// For license information, please see license.txt
frappe.ui.form.on('Staffing Plan', {
- refresh: function(frm) {
+ setup: function(frm) {
+ frm.set_query("designation", "staffing_details", function() {
+ let designations = [];
+ $.each(frm.doc.staffing_details, function(index, staff_detail) {
+ if(staff_detail.designation){
+ designations.push(staff_detail.designation)
+ }
+ })
+ // Filter out designations already selected in Staffing Plan Detail
+ return {
+ filters: [
+ ['Designation', 'name', 'not in', designations],
+ ]
+ }
+ });
+ frm.set_query("department", function() {
+ return {
+ "filters": {
+ "company": frm.doc.company,
+ }
+ };
+ });
}
});
+
+frappe.ui.form.on('Staffing Plan Detail', {
+ designation: function(frm, cdt, cdn) {
+ let child = locals[cdt][cdn]
+ if(frm.doc.company && child.designation){
+ frappe.call({
+ "method": "erpnext.hr.doctype.staffing_plan.staffing_plan.get_current_employee_count",
+ args: {
+ designation: child.designation,
+ company: frm.doc.company
+ },
+ callback: function (data) {
+ if(data.message){
+ frappe.model.set_value(cdt, cdn, 'current_count', data.message);
+ }
+ else{ // No employees for this designation
+ frappe.model.set_value(cdt, cdn, 'current_count', 0);
+ }
+ }
+ });
+ }
+ },
+
+ number_of_positions: function(frm, cdt, cdn) {
+ set_vacancies(frm, cdt, cdn);
+ },
+
+ current_count: function(frm, cdt, cdn) {
+ set_vacancies(frm, cdt, cdn);
+ },
+
+ estimated_cost_per_position: function(frm, cdt, cdn) {
+ let child = locals[cdt][cdn];
+ set_total_estimated_cost(frm, cdt, cdn);
+ }
+
+});
+
+var set_vacancies = function(frm, cdt, cdn) {
+ let child = locals[cdt][cdn]
+ if(child.number_of_positions) {
+ frappe.model.set_value(cdt, cdn, 'vacancies', child.number_of_positions - child.current_count);
+ }
+ else{
+ frappe.model.set_value(cdt, cdn, 'vacancies', 0);
+ }
+ set_total_estimated_cost(frm, cdt, cdn);
+}
+
+// Note: Estimated Cost is calculated on number of Vacancies
+var set_total_estimated_cost = function(frm, cdt, cdn) {
+ let child = locals[cdt][cdn]
+ if(child.number_of_positions && child.estimated_cost_per_position) {
+ frappe.model.set_value(cdt, cdn, 'total_estimated_cost', child.vacancies * child.estimated_cost_per_position);
+ }
+ else {
+ frappe.model.set_value(cdt, cdn, 'total_estimated_cost', 0);
+ }
+ set_total_estimated_budget(frm);
+};
+
+var set_total_estimated_budget = function(frm) {
+ let estimated_budget = 0.0
+ if(frm.doc.staffing_details) {
+ $.each(frm.doc.staffing_details, function(index, staff_detail) {
+ if(staff_detail.total_estimated_cost){
+ estimated_budget += staff_detail.total_estimated_cost
+ }
+ })
+ frm.set_value('total_estimated_budget', estimated_budget);
+ }
+}
diff --git a/erpnext/hr/doctype/staffing_plan/staffing_plan.json b/erpnext/hr/doctype/staffing_plan/staffing_plan.json
index a5d26e6..229cc05 100644
--- a/erpnext/hr/doctype/staffing_plan/staffing_plan.json
+++ b/erpnext/hr/doctype/staffing_plan/staffing_plan.json
@@ -268,6 +268,7 @@
"bold": 0,
"collapsible": 0,
"columns": 0,
+ "default": "0.00",
"fieldname": "total_estimated_budget",
"fieldtype": "Currency",
"hidden": 0,
@@ -284,7 +285,7 @@
"precision": "",
"print_hide": 0,
"print_hide_if_no_value": 0,
- "read_only": 0,
+ "read_only": 1,
"remember_last_selected_value": 0,
"report_hide": 0,
"reqd": 0,
@@ -335,7 +336,7 @@
"issingle": 0,
"istable": 0,
"max_attachments": 0,
- "modified": "2018-04-13 18:45:16.729979",
+ "modified": "2018-04-18 19:10:34.394249",
"modified_by": "Administrator",
"module": "HR",
"name": "Staffing Plan",
diff --git a/erpnext/hr/doctype/staffing_plan/staffing_plan.py b/erpnext/hr/doctype/staffing_plan/staffing_plan.py
index 510d2dc..37ff5cb 100644
--- a/erpnext/hr/doctype/staffing_plan/staffing_plan.py
+++ b/erpnext/hr/doctype/staffing_plan/staffing_plan.py
@@ -5,6 +5,62 @@
from __future__ import unicode_literals
import frappe
from frappe.model.document import Document
+from frappe import _
+from frappe.utils import getdate, nowdate
class StaffingPlan(Document):
- pass
+ def validate(self):
+ # Validate Dates
+ if self.from_date and self.to_date and self.from_date > self.to_date:
+ frappe.throw(_("From Date cannot be greater than To Date"))
+
+ # Validate if any submitted Staffing Plan exist for Designations in this plan
+ # and spd.vacancies>0 ?
+ for detail in self.get("staffing_details"):
+ overlap = (frappe.db.sql("""select spd.parent \
+ from `tabStaffing Plan Detail` spd join `tabStaffing Plan` sp on spd.parent=sp.name \
+ where spd.designation='{0}' and sp.docstatus=1 \
+ and sp.to_date >= '{1}' and sp.from_date <='{2}'"""
+ .format(detail.designation, self.from_date, self.to_date)))
+
+ if overlap and overlap [0][0]:
+ frappe.throw(_("Staffing Plan {0} already exist for designation {1}"
+ .format(overlap[0][0], detail.designation)))
+
+@frappe.whitelist()
+def get_current_employee_count(designation, company):
+ if not designation:
+ return False
+
+ lft, rgt = frappe.db.get_value("Company", company, ["lft", "rgt"])
+ employee_count = frappe.db.sql("""select count(*) from `tabEmployee`
+ where designation = %s and status='Active'
+ and company in (select name from tabCompany where lft>=%s and rgt<=%s)
+ """, (designation, lft, rgt))[0][0]
+ return employee_count
+
+def get_active_staffing_plan_and_vacancies(company, designation, department=None, date=getdate(nowdate())):
+ if not company or not designation:
+ frappe.throw(_("Please select Company and Designation"))
+
+ conditions = ""
+ if(department): #Department is an optional field
+ conditions += " and sp.department='{0}'".format(frappe.db.escape(department))
+
+ if(date): #ToDo: Date should be mandatory?
+ conditions += " and '{0}' between sp.from_date and sp.to_date".format(date)
+
+ staffing_plan = frappe.db.sql("""
+ select sp.name, spd.vacancies
+ from `tabStaffing Plan Detail` spd join `tabStaffing Plan` sp on spd.parent=sp.name
+ where company=%s and spd.designation=%s and sp.docstatus=1 {0}
+ """.format(conditions), (company, designation))
+
+ if not staffing_plan:
+ parent_company = frappe.db.get_value("Company", company, "parent_company")
+ if parent_company:
+ staffing_plan = get_active_staffing_plan_and_vacancies(parent_company,
+ designation, department, date)
+
+ # Only a signle staffing plan can be active for a designation on given date
+ return staffing_plan[0] if staffing_plan else None
diff --git a/erpnext/hr/doctype/staffing_plan_detail/staffing_plan_detail.json b/erpnext/hr/doctype/staffing_plan_detail/staffing_plan_detail.json
index 7c39564..eb77b43 100644
--- a/erpnext/hr/doctype/staffing_plan_detail/staffing_plan_detail.json
+++ b/erpnext/hr/doctype/staffing_plan_detail/staffing_plan_detail.json
@@ -81,68 +81,6 @@
"bold": 0,
"collapsible": 0,
"columns": 0,
- "fieldname": "current_count",
- "fieldtype": "Int",
- "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": "Current Count",
- "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_on_submit": 0,
- "bold": 0,
- "collapsible": 0,
- "columns": 0,
- "fieldname": "vacancies",
- "fieldtype": "Int",
- "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": "Vacancies",
- "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_on_submit": 0,
- "bold": 0,
- "collapsible": 0,
- "columns": 0,
"fieldname": "estimated_cost_per_position",
"fieldtype": "Currency",
"hidden": 0,
@@ -190,6 +128,36 @@
"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_on_submit": 0,
+ "bold": 0,
+ "collapsible": 0,
+ "columns": 0,
+ "fieldname": "column_break_5",
+ "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,
@@ -198,6 +166,68 @@
"set_only_once": 0,
"translatable": 0,
"unique": 0
+ },
+ {
+ "allow_bulk_edit": 0,
+ "allow_on_submit": 0,
+ "bold": 0,
+ "collapsible": 0,
+ "columns": 0,
+ "fieldname": "current_count",
+ "fieldtype": "Int",
+ "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": "Current Count",
+ "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_on_submit": 0,
+ "bold": 0,
+ "collapsible": 0,
+ "columns": 0,
+ "fieldname": "vacancies",
+ "fieldtype": "Int",
+ "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": "Vacancies",
+ "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
}
],
"has_web_view": 0,
@@ -210,7 +240,7 @@
"issingle": 0,
"istable": 1,
"max_attachments": 0,
- "modified": "2018-04-13 18:39:52.783341",
+ "modified": "2018-04-15 16:09:12.622186",
"modified_by": "Administrator",
"module": "HR",
"name": "Staffing Plan Detail",
diff --git a/erpnext/hr/employee_property_update.js b/erpnext/hr/employee_property_update.js
new file mode 100644
index 0000000..473916c
--- /dev/null
+++ b/erpnext/hr/employee_property_update.js
@@ -0,0 +1,147 @@
+frappe.ui.form.on(cur_frm.doctype, {
+ setup: function(frm) {
+ frm.set_query("employee", function() {
+ return {
+ filters: {
+ "status": "Active"
+ }
+ };
+ });
+ },
+ onload: function(frm){
+ if(frm.doc.__islocal){
+ if(frm.doctype == "Employee Promotion"){
+ frm.doc.promotion_details = [];
+ }else if (frm.doctype == "Employee Transfer") {
+ frm.doc.transfer_details = [];
+ }
+ }
+ },
+ employee: function(frm) {
+ frm.add_fetch("employee", "company", "company");
+ },
+ refresh: function(frm) {
+ var table;
+ if(frm.doctype == "Employee Promotion"){
+ table = "promotion_details";
+ }else if (frm.doctype == "Employee Transfer") {
+ table = "transfer_details";
+ }
+ if(!table){return;}
+ cur_frm.fields_dict[table].grid.wrapper.find('.grid-add-row').hide();
+ cur_frm.fields_dict[table].grid.add_custom_button(__('Add Row'), () => {
+ if(!frm.doc.employee){
+ frappe.msgprint(__("Please select Employee"));
+ return;
+ }
+ frappe.call({
+ method: 'erpnext.hr.utils.get_employee_fields_label',
+ callback: function(r) {
+ if(r.message){
+ show_dialog(frm, table, r.message);
+ }
+ }
+ });
+ });
+ }
+});
+
+var show_dialog = function(frm, table, field_labels) {
+ var d = new frappe.ui.Dialog({
+ title: "Update Property",
+ fields: [
+ {fieldname: "property", label: __('Select Property'), fieldtype:"Select", options: field_labels},
+ {fieldname: "current", fieldtype: "Data", label:__('Current'), read_only: true},
+ {fieldname: "field_html", fieldtype: "HTML"}
+ ],
+ primary_action_label: __('Add to Details'),
+ primary_action: () => {
+ d.get_primary_btn().attr('disabled', true);
+ if(d.data){
+ add_to_details(frm, d, table);
+ }
+ }
+ });
+ d.fields_dict["property"].df.onchange = () => {
+ let property = d.get_values().property;
+ d.data.fieldname = property;
+ if(!property){return;}
+ frappe.call({
+ method: 'erpnext.hr.utils.get_employee_field_property',
+ args: {employee: frm.doc.employee, fieldname: property},
+ callback: function(r) {
+ if(r.message){
+ d.data.current = r.message.value;
+ d.data.property = r.message.label;
+ d.fields_dict.field_html.$wrapper.html("");
+ d.set_value('current', r.message.value);
+ render_dynamic_field(d, r.message.datatype, r.message.options, property);
+ d.get_primary_btn().attr('disabled', false);
+ }
+ }
+ });
+ };
+ d.get_primary_btn().attr('disabled', true);
+ d.data = {};
+ d.show();
+};
+
+var render_dynamic_field = function(d, fieldtype, options, fieldname) {
+ d.data.new = null;
+ var dynamic_field = frappe.ui.form.make_control({
+ df: {
+ "fieldtype": fieldtype,
+ "fieldname": fieldname,
+ "options": options || ''
+ },
+ parent: d.fields_dict.field_html.wrapper,
+ only_input: false
+ });
+ dynamic_field.make_input();
+ $(dynamic_field.label_area).text(__("New"));
+ dynamic_field.$input.on("change", function(e) {
+ d.data.new = e.target.value;
+ }).on("awesomplete-close", function(e) {
+ d.data.new = e.target.value;
+ });
+};
+
+var add_to_details = function(frm, d, table) {
+ let data = d.data;
+ if(data.fieldname){
+ if(validate_duplicate(frm, table, data.fieldname)){
+ frappe.show_alert({message:__("Property already added"), indicator:'orange'});
+ return false;
+ }
+ if(data.current == data.new){
+ frappe.show_alert({message:__("Nothing to change"), indicator:'orange'});
+ d.get_primary_btn().attr('disabled', false);
+ return false;
+ }
+ frm.add_child(table, {
+ fieldname: data.fieldname,
+ property: data.property,
+ current: data.current,
+ new: data.new
+ });
+ frm.refresh_field(table);
+ d.fields_dict.field_html.$wrapper.html("");
+ d.set_value("property", "");
+ d.set_value('current', "");
+ frappe.show_alert({message:__("Added to details"),indicator:'green'});
+ d.data = {};
+ }else {
+ frappe.show_alert({message:__("Value missing"),indicator:'red'});
+ }
+};
+
+var validate_duplicate = function(frm, table, fieldname){
+ let duplicate = false;
+ $.each(frm.doc[table], function(i, detail) {
+ if(detail.fieldname === fieldname){
+ duplicate = true;
+ return;
+ }
+ });
+ return duplicate;
+};
diff --git a/erpnext/hr/utils.py b/erpnext/hr/utils.py
index aa456aa..686f791 100644
--- a/erpnext/hr/utils.py
+++ b/erpnext/hr/utils.py
@@ -4,7 +4,65 @@
from __future__ import unicode_literals
import frappe
from frappe import _
+from frappe.utils import formatdate, format_datetime
+from frappe.utils import getdate, get_datetime
def set_employee_name(doc):
if doc.employee and not doc.employee_name:
doc.employee_name = frappe.db.get_value("Employee", doc.employee, "employee_name")
+
+@frappe.whitelist()
+def get_employee_fields_label():
+ fields = []
+ for df in frappe.get_meta("Employee").get("fields"):
+ if df.fieldtype in ["Data", "Date", "Datetime", "Float", "Int",
+ "Link", "Percent", "Select", "Small Text"] and df.fieldname not in ["lft", "rgt", "old_parent"]:
+ fields.append({"value": df.fieldname, "label": df.label})
+ return fields
+
+@frappe.whitelist()
+def get_employee_field_property(employee, fieldname):
+ if employee and fieldname:
+ field = frappe.get_meta("Employee").get_field(fieldname)
+ value = frappe.db.get_value("Employee", employee, fieldname)
+ options = field.options
+ if field.fieldtype == "Date":
+ value = formatdate(value)
+ elif field.fieldtype == "Datetime":
+ value = format_datetime(value)
+ return {
+ "value" : value,
+ "datatype" : field.fieldtype,
+ "label" : field.label,
+ "options" : options
+ }
+ else:
+ return False
+
+def update_employee(employee, details, cancel=False):
+ for item in details:
+ fieldtype = frappe.get_meta("Employee").get_field(item.fieldname).fieldtype
+ new_data = item.new if not cancel else item.current
+ if fieldtype == "Date" and new_data:
+ new_data = getdate(new_data)
+ elif fieldtype =="Datetime" and new_data:
+ new_data = get_datetime(new_data)
+ setattr(employee, item.fieldname, new_data)
+ return employee
+
+def get_leave_period(from_date, to_date, company):
+ leave_period = frappe.db.sql("""
+ select name, from_date, to_date
+ from `tabLeave Period`
+ where company=%(company)s and is_active=1
+ and (from_date between %(from_date)s and %(to_date)s
+ or to_date between %(from_date)s and %(to_date)s
+ or (from_date < %(from_date)s and to_date > %(to_date)s))
+ """, {
+ "from_date": from_date,
+ "to_date": to_date,
+ "company": company
+ }, as_dict=1)
+
+ if leave_period:
+ return leave_period
diff --git a/erpnext/patches.txt b/erpnext/patches.txt
index 3fffade..4bbb3e9 100644
--- a/erpnext/patches.txt
+++ b/erpnext/patches.txt
@@ -527,3 +527,4 @@
erpnext.patches.v11_0.create_salary_structure_assignments
erpnext.patches.v11_0.rename_health_insurance
erpnext.patches.v11_0.rebuild_tree_for_company
+erpnext.patches.v11_0.create_department_records_for_each_company
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
new file mode 100644
index 0000000..9407185
--- /dev/null
+++ b/erpnext/patches/v11_0/create_department_records_for_each_company.py
@@ -0,0 +1,73 @@
+import frappe
+from frappe.utils.nestedset import rebuild_tree
+
+def execute():
+ frappe.reload_doc("hr", "doctype", "department")
+ companies = frappe.db.get_all("Company", fields=["name", "abbr"])
+ departments = frappe.db.get_all("Department")
+ comp_dict = {}
+
+ # create a blank list for each company
+ for company in companies:
+ comp_dict[company.name] = {}
+
+ for department in departments:
+ # skip root node
+ if department.name == "All Departments":
+ continue
+
+ # for each company, create a copy of the doc
+ department_doc = frappe.get_doc("Department", department)
+ for company in companies:
+ copy_doc = frappe.copy_doc(department_doc)
+ copy_doc.update({"company": company.name})
+ copy_doc.insert()
+
+ # append list of new department for each company
+ comp_dict[company.name][department.name] = copy_doc.name
+
+ rebuild_tree('Department', 'parent_department')
+ doctypes = ["Asset", "Employee", "Leave Period", "Payroll Entry", "Staffing Plan", "Job Opening"]
+
+ for d in doctypes:
+ update_records(d, comp_dict)
+
+ update_instructors(comp_dict)
+
+def update_records(doctype, comp_dict):
+ when_then = []
+ for company in comp_dict:
+ records = comp_dict[company]
+
+ for department in records:
+ when_then.append('''
+ WHEN company = "%s" and department = "%s"
+ THEN "%s"
+ '''%(company, department, records[department]))
+
+ frappe.db.sql("""
+ update
+ `tab%s`
+ set
+ department = CASE %s END
+ """%(doctype, " ".join(when_then)))
+
+def update_instructors(comp_dict):
+ when_then = []
+ emp_details = frappe.get_all("Employee", fields=["name", "company"])
+
+ for employee in emp_details:
+ records = comp_dict[employee.company]
+
+ for department in records:
+ when_then.append('''
+ WHEN employee = "%s" and department = "%s"
+ THEN "%s"
+ '''%(employee.name, department, records[department]))
+
+ frappe.db.sql("""
+ update
+ `tabInstructor`
+ set
+ department = CASE %s END
+ """%(" ".join(when_then)))
diff --git a/erpnext/patches/v11_0/create_salary_structure_assignments.py b/erpnext/patches/v11_0/create_salary_structure_assignments.py
index fc3a431..289554e 100644
--- a/erpnext/patches/v11_0/create_salary_structure_assignments.py
+++ b/erpnext/patches/v11_0/create_salary_structure_assignments.py
@@ -9,7 +9,6 @@
for d in frappe.db.sql("""
select sse.*, ss.company from `tabSalary Structure Employee` sse, `tabSalary Structure` ss
where ss.name = sse.parent""", as_dict=1):
- print(d)
s = frappe.new_doc("Salary Structure Assignment")
s.employee = d.employee
s.employee_name = d.employee_name
diff --git a/erpnext/patches/v11_0/make_quality_inspection_template.py b/erpnext/patches/v11_0/make_quality_inspection_template.py
index 67755e8..9720af4 100644
--- a/erpnext/patches/v11_0/make_quality_inspection_template.py
+++ b/erpnext/patches/v11_0/make_quality_inspection_template.py
@@ -5,8 +5,8 @@
import frappe
def execute():
- frappe.reload_doc('stock', 'doctype', 'item')
frappe.reload_doc('stock', 'doctype', 'quality_inspection_template')
+ frappe.reload_doc('stock', 'doctype', 'item')
for data in frappe.get_all('Item Quality Inspection Parameter',
fields = ["distinct parent"], filters = {'parenttype': 'Item'}):
diff --git a/erpnext/projects/doctype/timesheet/test_timesheet.py b/erpnext/projects/doctype/timesheet/test_timesheet.py
index 2458db0..d2017c5 100644
--- a/erpnext/projects/doctype/timesheet/test_timesheet.py
+++ b/erpnext/projects/doctype/timesheet/test_timesheet.py
@@ -118,30 +118,21 @@
def make_salary_structure(employee):
- name = frappe.db.get_value('Salary Structure Employee', {'employee': employee}, 'parent')
+ name = frappe.db.get_value('Salary Structure Assignment', {'employee': employee}, 'salary_structure')
if name:
salary_structure = frappe.get_doc('Salary Structure', name)
else:
salary_structure = frappe.new_doc("Salary Structure")
salary_structure.name = "Timesheet Salary Structure Test"
salary_structure.salary_slip_based_on_timesheet = 1
- salary_structure.from_date = add_days(nowdate(), -30)
salary_structure.salary_component = "Basic"
salary_structure.hour_rate = 50.0
salary_structure.company = "_Test Company"
salary_structure.payment_account = get_random("Account")
- salary_structure.set('employees', [])
salary_structure.set('earnings', [])
salary_structure.set('deductions', [])
- es = salary_structure.append('employees', {
- "employee": employee,
- "base": 1200,
- "from_date": add_months(nowdate(),-1)
- })
-
-
es = salary_structure.append('earnings', {
"salary_component": "_Test Allowance",
"amount": 100
@@ -154,6 +145,14 @@
salary_structure.save(ignore_permissions=True)
+ salary_structure_assignment = frappe.new_doc("Salary Structure Assignment")
+ salary_structure_assignment.employee = employee
+ salary_structure_assignment.base = 1200
+ salary_structure_assignment.from_date = add_months(nowdate(), -1)
+ salary_structure_assignment.salary_structure = salary_structure.name
+ salary_structure_assignment.company = "_Test Company"
+ salary_structure_assignment.save(ignore_permissions=True)
+
return salary_structure
def make_timesheet(employee, simulate=False, billable = 0, activity_type="_Test Activity Type", project=None, task=None, company=None):
diff --git a/erpnext/public/js/financial_statements.js b/erpnext/public/js/financial_statements.js
index 29e3999..7e31c57 100644
--- a/erpnext/public/js/financial_statements.js
+++ b/erpnext/public/js/financial_statements.js
@@ -71,6 +71,12 @@
"reqd": 1
},
{
+ "fieldname":"finance_book",
+ "label": __("Finance Book"),
+ "fieldtype": "Link",
+ "options": "Finance Book"
+ },
+ {
"fieldname":"from_fiscal_year",
"label": __("Start Year"),
"fieldtype": "Link",
diff --git a/erpnext/selling/doctype/customer/customer.json b/erpnext/selling/doctype/customer/customer.json
index d43de10..e38f6b3 100644
--- a/erpnext/selling/doctype/customer/customer.json
+++ b/erpnext/selling/doctype/customer/customer.json
@@ -43,6 +43,7 @@
"reqd": 0,
"search_index": 0,
"set_only_once": 0,
+ "translatable": 0,
"unique": 0
},
{
@@ -73,6 +74,7 @@
"reqd": 0,
"search_index": 0,
"set_only_once": 1,
+ "translatable": 0,
"unique": 0
},
{
@@ -105,6 +107,7 @@
"reqd": 0,
"search_index": 0,
"set_only_once": 0,
+ "translatable": 0,
"unique": 0
},
{
@@ -136,6 +139,7 @@
"reqd": 1,
"search_index": 1,
"set_only_once": 0,
+ "translatable": 0,
"unique": 0
},
{
@@ -168,6 +172,7 @@
"reqd": 0,
"search_index": 0,
"set_only_once": 0,
+ "translatable": 0,
"unique": 0
},
{
@@ -201,6 +206,7 @@
"reqd": 1,
"search_index": 0,
"set_only_once": 0,
+ "translatable": 0,
"unique": 0
},
{
@@ -233,6 +239,7 @@
"reqd": 0,
"search_index": 0,
"set_only_once": 0,
+ "translatable": 0,
"unique": 0
},
{
@@ -263,6 +270,7 @@
"reqd": 0,
"search_index": 0,
"set_only_once": 0,
+ "translatable": 0,
"unique": 0
},
{
@@ -291,6 +299,7 @@
"reqd": 0,
"search_index": 0,
"set_only_once": 0,
+ "translatable": 0,
"unique": 0,
"width": "50%"
},
@@ -325,6 +334,7 @@
"reqd": 1,
"search_index": 1,
"set_only_once": 0,
+ "translatable": 0,
"unique": 0
},
{
@@ -358,6 +368,7 @@
"reqd": 1,
"search_index": 0,
"set_only_once": 0,
+ "translatable": 0,
"unique": 0
},
{
@@ -388,6 +399,7 @@
"reqd": 0,
"search_index": 0,
"set_only_once": 0,
+ "translatable": 0,
"unique": 0
},
{
@@ -419,6 +431,137 @@
"reqd": 0,
"search_index": 0,
"set_only_once": 0,
+ "translatable": 0,
+ "unique": 0
+ },
+ {
+ "allow_bulk_edit": 0,
+ "allow_on_submit": 0,
+ "bold": 0,
+ "collapsible": 0,
+ "columns": 0,
+ "default": "0",
+ "fieldname": "is_internal_customer",
+ "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 Internal Customer",
+ "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_on_submit": 0,
+ "bold": 0,
+ "collapsible": 0,
+ "columns": 0,
+ "depends_on": "is_internal_customer",
+ "fieldname": "represents_company",
+ "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": "Represents Company",
+ "length": 0,
+ "no_copy": 0,
+ "options": "Company",
+ "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": 1
+ },
+ {
+ "allow_bulk_edit": 0,
+ "allow_on_submit": 0,
+ "bold": 0,
+ "collapsible": 0,
+ "columns": 0,
+ "depends_on": "represents_company",
+ "fieldname": "allowed_to_transact_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": "Allowed To Transact With",
+ "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_on_submit": 0,
+ "bold": 0,
+ "collapsible": 0,
+ "columns": 0,
+ "depends_on": "represents_company",
+ "fieldname": "companies",
+ "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": "Allowed To Transact With",
+ "length": 0,
+ "no_copy": 0,
+ "options": "Allowed To Transact With",
+ "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
},
{
@@ -449,6 +592,7 @@
"reqd": 0,
"search_index": 0,
"set_only_once": 0,
+ "translatable": 0,
"unique": 0
},
{
@@ -479,6 +623,7 @@
"reqd": 0,
"search_index": 0,
"set_only_once": 0,
+ "translatable": 0,
"unique": 0
},
{
@@ -509,6 +654,7 @@
"reqd": 0,
"search_index": 0,
"set_only_once": 0,
+ "translatable": 0,
"unique": 0
},
{
@@ -538,6 +684,7 @@
"reqd": 0,
"search_index": 0,
"set_only_once": 0,
+ "translatable": 0,
"unique": 0
},
{
@@ -569,6 +716,7 @@
"reqd": 0,
"search_index": 0,
"set_only_once": 0,
+ "translatable": 0,
"unique": 0
},
{
@@ -600,6 +748,7 @@
"reqd": 0,
"search_index": 0,
"set_only_once": 0,
+ "translatable": 0,
"unique": 0
},
{
@@ -629,6 +778,7 @@
"reqd": 0,
"search_index": 0,
"set_only_once": 0,
+ "translatable": 0,
"unique": 0
},
{
@@ -658,6 +808,7 @@
"reqd": 0,
"search_index": 0,
"set_only_once": 0,
+ "translatable": 0,
"unique": 0
},
{
@@ -686,6 +837,7 @@
"reqd": 0,
"search_index": 0,
"set_only_once": 0,
+ "translatable": 0,
"unique": 0,
"width": "50%"
},
@@ -717,6 +869,7 @@
"reqd": 0,
"search_index": 0,
"set_only_once": 0,
+ "translatable": 0,
"unique": 0
},
{
@@ -748,6 +901,7 @@
"reqd": 0,
"search_index": 0,
"set_only_once": 0,
+ "translatable": 0,
"unique": 0
},
{
@@ -780,6 +934,7 @@
"reqd": 0,
"search_index": 0,
"set_only_once": 0,
+ "translatable": 0,
"unique": 0
},
{
@@ -811,6 +966,7 @@
"reqd": 0,
"search_index": 0,
"set_only_once": 0,
+ "translatable": 0,
"unique": 0
},
{
@@ -842,6 +998,7 @@
"reqd": 0,
"search_index": 0,
"set_only_once": 0,
+ "translatable": 0,
"unique": 0
},
{
@@ -871,6 +1028,7 @@
"reqd": 0,
"search_index": 0,
"set_only_once": 0,
+ "translatable": 0,
"unique": 0
},
{
@@ -903,6 +1061,7 @@
"reqd": 0,
"search_index": 0,
"set_only_once": 0,
+ "translatable": 0,
"unique": 0
},
{
@@ -935,6 +1094,7 @@
"reqd": 0,
"search_index": 0,
"set_only_once": 0,
+ "translatable": 0,
"unique": 0
},
{
@@ -965,6 +1125,7 @@
"reqd": 0,
"search_index": 0,
"set_only_once": 0,
+ "translatable": 0,
"unique": 0
},
{
@@ -997,6 +1158,7 @@
"reqd": 0,
"search_index": 0,
"set_only_once": 0,
+ "translatable": 0,
"unique": 0
},
{
@@ -1027,6 +1189,7 @@
"reqd": 0,
"search_index": 0,
"set_only_once": 0,
+ "translatable": 0,
"unique": 0,
"width": ""
},
@@ -1060,6 +1223,7 @@
"reqd": 0,
"search_index": 0,
"set_only_once": 0,
+ "translatable": 0,
"unique": 0
},
{
@@ -1091,6 +1255,7 @@
"reqd": 0,
"search_index": 0,
"set_only_once": 0,
+ "translatable": 0,
"unique": 0
},
{
@@ -1120,6 +1285,7 @@
"reqd": 0,
"search_index": 0,
"set_only_once": 0,
+ "translatable": 0,
"unique": 0
},
{
@@ -1152,6 +1318,7 @@
"reqd": 0,
"search_index": 0,
"set_only_once": 0,
+ "translatable": 0,
"unique": 0
},
{
@@ -1184,6 +1351,7 @@
"reqd": 0,
"search_index": 0,
"set_only_once": 0,
+ "translatable": 0,
"unique": 0
},
{
@@ -1216,6 +1384,7 @@
"reqd": 0,
"search_index": 0,
"set_only_once": 0,
+ "translatable": 0,
"unique": 0
},
{
@@ -1246,6 +1415,7 @@
"reqd": 0,
"search_index": 0,
"set_only_once": 0,
+ "translatable": 0,
"unique": 0
},
{
@@ -1278,6 +1448,7 @@
"reqd": 0,
"search_index": 0,
"set_only_once": 0,
+ "translatable": 0,
"unique": 0
},
{
@@ -1310,6 +1481,7 @@
"reqd": 0,
"search_index": 0,
"set_only_once": 0,
+ "translatable": 0,
"unique": 0
},
{
@@ -1341,6 +1513,7 @@
"reqd": 0,
"search_index": 0,
"set_only_once": 0,
+ "translatable": 0,
"unique": 0
},
{
@@ -1372,6 +1545,7 @@
"reqd": 0,
"search_index": 0,
"set_only_once": 0,
+ "translatable": 0,
"unique": 0
},
{
@@ -1404,6 +1578,7 @@
"reqd": 0,
"search_index": 0,
"set_only_once": 0,
+ "translatable": 0,
"unique": 0
},
{
@@ -1434,6 +1609,7 @@
"reqd": 0,
"search_index": 0,
"set_only_once": 0,
+ "translatable": 0,
"unique": 0
}
],
@@ -1449,7 +1625,7 @@
"issingle": 0,
"istable": 0,
"max_attachments": 0,
- "modified": "2018-02-09 10:44:35.801716",
+ "modified": "2018-04-19 12:19:35.311509",
"modified_by": "Administrator",
"module": "Selling",
"name": "Customer",
@@ -1458,7 +1634,6 @@
"permissions": [
{
"amend": 0,
- "apply_user_permissions": 0,
"cancel": 0,
"create": 1,
"delete": 0,
@@ -1478,7 +1653,6 @@
},
{
"amend": 0,
- "apply_user_permissions": 0,
"cancel": 0,
"create": 0,
"delete": 0,
@@ -1498,7 +1672,6 @@
},
{
"amend": 0,
- "apply_user_permissions": 0,
"cancel": 0,
"create": 0,
"delete": 0,
@@ -1518,7 +1691,6 @@
},
{
"amend": 0,
- "apply_user_permissions": 0,
"cancel": 0,
"create": 1,
"delete": 1,
@@ -1538,7 +1710,6 @@
},
{
"amend": 0,
- "apply_user_permissions": 0,
"cancel": 0,
"create": 0,
"delete": 0,
@@ -1558,7 +1729,6 @@
},
{
"amend": 0,
- "apply_user_permissions": 0,
"cancel": 0,
"create": 0,
"delete": 0,
@@ -1578,7 +1748,6 @@
},
{
"amend": 0,
- "apply_user_permissions": 0,
"cancel": 0,
"create": 0,
"delete": 0,
@@ -1598,7 +1767,6 @@
},
{
"amend": 0,
- "apply_user_permissions": 0,
"cancel": 0,
"create": 0,
"delete": 0,
@@ -1618,7 +1786,6 @@
},
{
"amend": 0,
- "apply_user_permissions": 0,
"cancel": 0,
"create": 0,
"delete": 0,
diff --git a/erpnext/selling/doctype/customer/customer.py b/erpnext/selling/doctype/customer/customer.py
index 78f892b..239b532 100644
--- a/erpnext/selling/doctype/customer/customer.py
+++ b/erpnext/selling/doctype/customer/customer.py
@@ -7,7 +7,7 @@
from frappe import _, msgprint, throw
import frappe.defaults
from frappe.utils import flt, cint, cstr
-from frappe.desk.reportview import build_match_conditions
+from frappe.desk.reportview import build_match_conditions, get_filters_cond
from erpnext.utilities.transaction_base import TransactionBase
from erpnext.accounts.party import validate_party_accounts, get_dashboard_info, get_timeline_data # keep this
from frappe.contacts.address_and_contact import load_address_and_contact, delete_contact_and_address
@@ -179,7 +179,7 @@
frappe.db.set(self, "customer_name", newdn)
-def get_customer_list(doctype, txt, searchfield, start, page_len, filters):
+def get_customer_list(doctype, txt, searchfield, start, page_len, filters=None):
if frappe.db.get_default("cust_master_name") == "Customer Name":
fields = ["name", "customer_group", "territory"]
else:
@@ -188,6 +188,10 @@
match_conditions = build_match_conditions("Customer")
match_conditions = "and {}".format(match_conditions) if match_conditions else ""
+ if filters:
+ filter_conditions = get_filters_cond(doctype, filters, [])
+ match_conditions += "{}".format(filter_conditions)
+
return frappe.db.sql("""select %s from `tabCustomer` where docstatus < 2
and (%s like %s or customer_name like %s)
{match_conditions}
diff --git a/erpnext/setup/doctype/company/company.js b/erpnext/setup/doctype/company/company.js
index 7c060d8..e164d69 100644
--- a/erpnext/setup/doctype/company/company.js
+++ b/erpnext/setup/doctype/company/company.js
@@ -197,6 +197,7 @@
["round_off_account", {"root_type": "Expense"}],
["write_off_account", {"root_type": "Expense"}],
["exchange_gain_loss_account", {"root_type": "Expense"}],
+ ["unrealized_exchange_gain_loss_account", {"root_type": "Expense"}],
["accumulated_depreciation_account",
{"root_type": "Asset", "account_type": "Accumulated Depreciation"}],
["depreciation_expense_account", {"root_type": "Expense", "account_type": "Depreciation"}],
diff --git a/erpnext/setup/doctype/company/company.json b/erpnext/setup/doctype/company/company.json
index 1a21887..d236dda 100644
--- a/erpnext/setup/doctype/company/company.json
+++ b/erpnext/setup/doctype/company/company.json
@@ -42,6 +42,7 @@
"reqd": 0,
"search_index": 0,
"set_only_once": 0,
+ "translatable": 0,
"unique": 0
},
{
@@ -73,6 +74,7 @@
"reqd": 1,
"search_index": 0,
"set_only_once": 0,
+ "translatable": 0,
"unique": 0
},
{
@@ -105,6 +107,7 @@
"reqd": 1,
"search_index": 0,
"set_only_once": 0,
+ "translatable": 0,
"unique": 0
},
{
@@ -135,6 +138,7 @@
"reqd": 0,
"search_index": 0,
"set_only_once": 0,
+ "translatable": 0,
"unique": 0
},
{
@@ -165,6 +169,7 @@
"reqd": 0,
"search_index": 0,
"set_only_once": 0,
+ "translatable": 0,
"unique": 0
},
{
@@ -193,6 +198,7 @@
"reqd": 0,
"search_index": 0,
"set_only_once": 0,
+ "translatable": 0,
"unique": 0
},
{
@@ -223,6 +229,7 @@
"reqd": 0,
"search_index": 0,
"set_only_once": 0,
+ "translatable": 0,
"unique": 0
},
{
@@ -254,6 +261,7 @@
"reqd": 0,
"search_index": 0,
"set_only_once": 0,
+ "translatable": 0,
"unique": 0
},
{
@@ -284,6 +292,7 @@
"reqd": 0,
"search_index": 0,
"set_only_once": 0,
+ "translatable": 0,
"unique": 0
},
{
@@ -314,6 +323,7 @@
"reqd": 0,
"search_index": 0,
"set_only_once": 0,
+ "translatable": 0,
"unique": 0
},
{
@@ -345,6 +355,7 @@
"reqd": 0,
"search_index": 0,
"set_only_once": 0,
+ "translatable": 0,
"unique": 0
},
{
@@ -374,6 +385,7 @@
"reqd": 0,
"search_index": 0,
"set_only_once": 0,
+ "translatable": 0,
"unique": 0
},
{
@@ -405,6 +417,7 @@
"reqd": 0,
"search_index": 0,
"set_only_once": 0,
+ "translatable": 0,
"unique": 0
},
{
@@ -434,6 +447,7 @@
"reqd": 0,
"search_index": 0,
"set_only_once": 0,
+ "translatable": 0,
"unique": 0
},
{
@@ -442,7 +456,38 @@
"bold": 0,
"collapsible": 0,
"columns": 0,
- "fieldname": "default_letter_head",
+ "fieldname": "default_currency",
+ "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 Currency",
+ "length": 0,
+ "no_copy": 0,
+ "options": "Currency",
+ "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_on_submit": 0,
+ "bold": 0,
+ "collapsible": 0,
+ "columns": 0,
+ "fieldname": "default_letter_head",
"fieldtype": "Link",
"hidden": 0,
"ignore_user_permissions": 0,
@@ -451,10 +496,10 @@
"in_global_search": 0,
"in_list_view": 0,
"in_standard_filter": 0,
- "label": "Default Letter Head",
+ "label": "Default Letter Head",
"length": 0,
"no_copy": 0,
- "options": "Letter Head",
+ "options": "Letter Head",
"permlevel": 0,
"precision": "",
"print_hide": 0,
@@ -465,6 +510,7 @@
"reqd": 0,
"search_index": 0,
"set_only_once": 0,
+ "translatable": 0,
"unique": 0
},
{
@@ -473,7 +519,7 @@
"bold": 0,
"collapsible": 0,
"columns": 0,
- "fieldname": "default_holiday_list",
+ "fieldname": "default_holiday_list",
"fieldtype": "Link",
"hidden": 0,
"ignore_user_permissions": 0,
@@ -482,12 +528,12 @@
"in_global_search": 0,
"in_list_view": 0,
"in_standard_filter": 0,
- "label": "Default Holiday List",
+ "label": "Default Holiday List",
"length": 0,
"no_copy": 0,
- "options": "Holiday List",
+ "options": "Holiday List",
"permlevel": 0,
- "precision": "",
+ "precision": "",
"print_hide": 0,
"print_hide_if_no_value": 0,
"read_only": 0,
@@ -496,6 +542,7 @@
"reqd": 0,
"search_index": 0,
"set_only_once": 0,
+ "translatable": 0,
"unique": 0
},
{
@@ -504,58 +551,29 @@
"bold": 0,
"collapsible": 0,
"columns": 0,
- "fieldname": "default_terms",
+ "fieldname": "default_terms",
"fieldtype": "Link",
"hidden": 0,
- "ignore_user_permissions": 0,
+ "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 Terms",
+ "label": "Default Terms",
"length": 0,
"no_copy": 0,
- "options": "Terms and Conditions",
+ "options": "Terms and Conditions",
"permlevel": 0,
"print_hide": 0,
"print_hide_if_no_value": 0,
"read_only": 0,
"remember_last_selected_value": 0,
"report_hide": 0,
- "reqd": 0,
+ "reqd": 0,
"search_index": 0,
"set_only_once": 0,
- "unique": 0
- },
- {
- "allow_bulk_edit": 0,
- "allow_on_submit": 0,
- "bold": 0,
- "collapsible": 0,
- "columns": 0,
- "fieldname": "default_currency",
- "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 Currency",
- "length": 0,
- "no_copy": 0,
- "options": "Currency",
- "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
},
{
@@ -585,6 +603,7 @@
"reqd": 0,
"search_index": 0,
"set_only_once": 0,
+ "translatable": 0,
"unique": 0
},
{
@@ -615,6 +634,7 @@
"reqd": 1,
"search_index": 0,
"set_only_once": 0,
+ "translatable": 0,
"unique": 0
},
{
@@ -646,6 +666,7 @@
"reqd": 0,
"search_index": 0,
"set_only_once": 0,
+ "translatable": 0,
"unique": 0
},
{
@@ -678,6 +699,7 @@
"reqd": 0,
"search_index": 0,
"set_only_once": 0,
+ "translatable": 0,
"unique": 0
},
{
@@ -710,6 +732,7 @@
"reqd": 0,
"search_index": 0,
"set_only_once": 0,
+ "translatable": 0,
"unique": 0
},
{
@@ -740,6 +763,7 @@
"reqd": 0,
"search_index": 0,
"set_only_once": 0,
+ "translatable": 0,
"unique": 0
},
{
@@ -770,6 +794,7 @@
"reqd": 0,
"search_index": 0,
"set_only_once": 0,
+ "translatable": 0,
"unique": 0
},
{
@@ -800,6 +825,7 @@
"reqd": 0,
"search_index": 0,
"set_only_once": 0,
+ "translatable": 0,
"unique": 0
},
{
@@ -833,6 +859,7 @@
"reqd": 0,
"search_index": 0,
"set_only_once": 0,
+ "translatable": 0,
"unique": 0
},
{
@@ -864,6 +891,7 @@
"reqd": 0,
"search_index": 0,
"set_only_once": 0,
+ "translatable": 0,
"unique": 0
},
{
@@ -897,6 +925,7 @@
"reqd": 0,
"search_index": 0,
"set_only_once": 0,
+ "translatable": 0,
"unique": 0
},
{
@@ -928,6 +957,7 @@
"reqd": 0,
"search_index": 0,
"set_only_once": 0,
+ "translatable": 0,
"unique": 0
},
{
@@ -959,6 +989,7 @@
"reqd": 0,
"search_index": 0,
"set_only_once": 0,
+ "translatable": 0,
"unique": 0
},
{
@@ -990,6 +1021,39 @@
"reqd": 0,
"search_index": 0,
"set_only_once": 0,
+ "translatable": 0,
+ "unique": 0
+ },
+ {
+ "allow_bulk_edit": 0,
+ "allow_on_submit": 0,
+ "bold": 0,
+ "collapsible": 0,
+ "columns": 0,
+ "fieldname": "unrealized_exchange_gain_loss_account",
+ "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": "Unrealized Exchange Gain/Loss 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
},
{
@@ -1019,6 +1083,7 @@
"reqd": 0,
"search_index": 0,
"set_only_once": 0,
+ "translatable": 0,
"unique": 0,
"width": "50%"
},
@@ -1053,6 +1118,7 @@
"reqd": 0,
"search_index": 0,
"set_only_once": 0,
+ "translatable": 0,
"unique": 0
},
{
@@ -1084,6 +1150,7 @@
"reqd": 0,
"search_index": 0,
"set_only_once": 0,
+ "translatable": 0,
"unique": 0
},
{
@@ -1115,6 +1182,7 @@
"reqd": 0,
"search_index": 0,
"set_only_once": 0,
+ "translatable": 0,
"unique": 0
},
{
@@ -1146,6 +1214,7 @@
"reqd": 0,
"search_index": 0,
"set_only_once": 0,
+ "translatable": 0,
"unique": 0
},
{
@@ -1178,6 +1247,7 @@
"reqd": 0,
"search_index": 0,
"set_only_once": 0,
+ "translatable": 0,
"unique": 0
},
{
@@ -1209,6 +1279,7 @@
"reqd": 0,
"search_index": 0,
"set_only_once": 0,
+ "translatable": 0,
"unique": 0
},
{
@@ -1238,6 +1309,7 @@
"reqd": 0,
"search_index": 0,
"set_only_once": 0,
+ "translatable": 0,
"unique": 0
},
{
@@ -1269,6 +1341,7 @@
"reqd": 0,
"search_index": 0,
"set_only_once": 0,
+ "translatable": 0,
"unique": 0
},
{
@@ -1298,6 +1371,7 @@
"reqd": 0,
"search_index": 0,
"set_only_once": 0,
+ "translatable": 0,
"unique": 0
},
{
@@ -1331,6 +1405,7 @@
"reqd": 0,
"search_index": 0,
"set_only_once": 0,
+ "translatable": 0,
"unique": 0
},
{
@@ -1363,6 +1438,7 @@
"reqd": 0,
"search_index": 0,
"set_only_once": 0,
+ "translatable": 0,
"unique": 0
},
{
@@ -1393,6 +1469,7 @@
"reqd": 0,
"search_index": 0,
"set_only_once": 0,
+ "translatable": 0,
"unique": 0
},
{
@@ -1424,6 +1501,7 @@
"reqd": 0,
"search_index": 0,
"set_only_once": 0,
+ "translatable": 0,
"unique": 0
},
{
@@ -1455,6 +1533,7 @@
"reqd": 0,
"search_index": 0,
"set_only_once": 0,
+ "translatable": 0,
"unique": 0
},
{
@@ -1485,6 +1564,7 @@
"reqd": 0,
"search_index": 0,
"set_only_once": 0,
+ "translatable": 0,
"unique": 0
},
{
@@ -1514,6 +1594,7 @@
"reqd": 0,
"search_index": 0,
"set_only_once": 0,
+ "translatable": 0,
"unique": 0
},
{
@@ -1544,6 +1625,7 @@
"reqd": 0,
"search_index": 0,
"set_only_once": 0,
+ "translatable": 0,
"unique": 0
},
{
@@ -1574,6 +1656,7 @@
"reqd": 0,
"search_index": 0,
"set_only_once": 0,
+ "translatable": 0,
"unique": 0
},
{
@@ -1604,6 +1687,7 @@
"reqd": 0,
"search_index": 0,
"set_only_once": 0,
+ "translatable": 0,
"unique": 0
},
{
@@ -1635,6 +1719,7 @@
"reqd": 0,
"search_index": 0,
"set_only_once": 0,
+ "translatable": 0,
"unique": 0
},
{
@@ -1666,6 +1751,7 @@
"reqd": 0,
"search_index": 0,
"set_only_once": 0,
+ "translatable": 0,
"unique": 0
},
{
@@ -1696,6 +1782,7 @@
"reqd": 0,
"search_index": 0,
"set_only_once": 0,
+ "translatable": 0,
"unique": 0
},
{
@@ -1725,6 +1812,7 @@
"reqd": 0,
"search_index": 0,
"set_only_once": 0,
+ "translatable": 0,
"unique": 0
},
{
@@ -1756,6 +1844,7 @@
"reqd": 0,
"search_index": 0,
"set_only_once": 0,
+ "translatable": 0,
"unique": 0
},
{
@@ -1787,6 +1876,7 @@
"reqd": 0,
"search_index": 0,
"set_only_once": 0,
+ "translatable": 0,
"unique": 0
},
{
@@ -1817,6 +1907,7 @@
"reqd": 0,
"search_index": 0,
"set_only_once": 0,
+ "translatable": 0,
"unique": 0
},
{
@@ -1847,6 +1938,7 @@
"reqd": 0,
"search_index": 0,
"set_only_once": 0,
+ "translatable": 0,
"unique": 0
},
{
@@ -1876,6 +1968,7 @@
"reqd": 0,
"search_index": 0,
"set_only_once": 0,
+ "translatable": 0,
"unique": 0
},
{
@@ -1905,6 +1998,7 @@
"reqd": 0,
"search_index": 0,
"set_only_once": 0,
+ "translatable": 0,
"unique": 0,
"width": "50%"
},
@@ -1937,6 +2031,7 @@
"reqd": 0,
"search_index": 0,
"set_only_once": 0,
+ "translatable": 0,
"unique": 0
},
{
@@ -1969,6 +2064,7 @@
"reqd": 0,
"search_index": 0,
"set_only_once": 0,
+ "translatable": 0,
"unique": 0
},
{
@@ -2001,6 +2097,7 @@
"reqd": 0,
"search_index": 0,
"set_only_once": 0,
+ "translatable": 0,
"unique": 0
},
{
@@ -2033,6 +2130,7 @@
"reqd": 0,
"search_index": 0,
"set_only_once": 0,
+ "translatable": 0,
"unique": 0
},
{
@@ -2064,6 +2162,7 @@
"reqd": 0,
"search_index": 0,
"set_only_once": 0,
+ "translatable": 0,
"unique": 0
},
{
@@ -2095,6 +2194,7 @@
"reqd": 0,
"search_index": 0,
"set_only_once": 0,
+ "translatable": 0,
"unique": 0,
"width": "50%"
},
@@ -2128,6 +2228,7 @@
"reqd": 0,
"search_index": 0,
"set_only_once": 0,
+ "translatable": 0,
"unique": 0
},
{
@@ -2158,6 +2259,7 @@
"reqd": 0,
"search_index": 0,
"set_only_once": 0,
+ "translatable": 0,
"unique": 0
},
{
@@ -2188,6 +2290,7 @@
"reqd": 0,
"search_index": 0,
"set_only_once": 0,
+ "translatable": 0,
"unique": 0
},
{
@@ -2218,6 +2321,7 @@
"reqd": 0,
"search_index": 1,
"set_only_once": 0,
+ "translatable": 0,
"unique": 0
},
{
@@ -2248,6 +2352,7 @@
"reqd": 0,
"search_index": 1,
"set_only_once": 0,
+ "translatable": 0,
"unique": 0
},
{
@@ -2278,6 +2383,7 @@
"reqd": 0,
"search_index": 0,
"set_only_once": 0,
+ "translatable": 0,
"unique": 0
}
],
@@ -2294,7 +2400,7 @@
"istable": 0,
"max_attachments": 0,
"menu_index": 0,
- "modified": "2018-04-18 19:45:22.357643",
+ "modified": "2018-05-05 13:08:07.351655",
"modified_by": "Administrator",
"module": "Setup",
"name": "Company",
@@ -2302,7 +2408,6 @@
"permissions": [
{
"amend": 0,
- "apply_user_permissions": 0,
"cancel": 0,
"create": 1,
"delete": 1,
@@ -2322,7 +2427,6 @@
},
{
"amend": 0,
- "apply_user_permissions": 0,
"cancel": 0,
"create": 0,
"delete": 0,
@@ -2342,7 +2446,6 @@
},
{
"amend": 0,
- "apply_user_permissions": 0,
"cancel": 0,
"create": 0,
"delete": 0,
@@ -2362,7 +2465,6 @@
},
{
"amend": 0,
- "apply_user_permissions": 0,
"cancel": 0,
"create": 0,
"delete": 0,
@@ -2382,7 +2484,6 @@
},
{
"amend": 0,
- "apply_user_permissions": 0,
"cancel": 0,
"create": 0,
"delete": 0,
@@ -2402,7 +2503,6 @@
},
{
"amend": 0,
- "apply_user_permissions": 0,
"cancel": 0,
"create": 0,
"delete": 0,
@@ -2422,7 +2522,6 @@
},
{
"amend": 0,
- "apply_user_permissions": 0,
"cancel": 0,
"create": 0,
"delete": 0,
diff --git a/erpnext/stock/doctype/item/item.json b/erpnext/stock/doctype/item/item.json
index caa44ac..21900ad 100644
--- a/erpnext/stock/doctype/item/item.json
+++ b/erpnext/stock/doctype/item/item.json
@@ -3717,7 +3717,7 @@
"issingle": 0,
"istable": 0,
"max_attachments": 1,
- "modified": "2018-04-11 12:21:48.715529",
+ "modified": "2018-04-30 12:21:48.715529",
"modified_by": "Administrator",
"module": "Stock",
"name": "Item",