From 7de05ae8f3beeb90561ba3ac9b395556be68c664 Mon Sep 17 00:00:00 2001 From: deepeshgarg007 Date: Thu, 23 May 2019 11:29:39 +0530 Subject: [PATCH 01/69] fix: Dashboards for doctypes in accounting module --- .../accounts/doctype/bank/bank_dashboard.py | 19 +++++++++ .../bank_account/bank_account_dashboard.py | 32 +++++++++++++++ .../doctype/c_form/c_form_dashboard.py | 18 +++++++++ .../finance_book/finance_book_dashboard.py | 27 +++++++++++++ .../fiscal_year/fiscal_year_dashboard.py | 23 +++++++++++ .../item_tax_template_dashboard.py | 27 +++++++++++++ .../doctype/journal_entry/journal_entry.js | 7 ++-- .../journal_entry/journal_entry_dashboard.py | 26 +++++++++++++ .../loyalty_program_dashboard.py | 19 +++++++++ .../payment_gateway_account_dashboard.py | 22 +++++++++++ .../payment_term/payment_term_dashboard.py | 19 +++++++++ .../payment_terms_template_dashboard.py | 0 .../pos_profile/pos_profile_dashboard.py | 19 +++++++++ .../share_type/share_type_dashboard.py | 15 +++++++ .../shareholder/shareholder_dashboard.py | 18 +++++++++ .../shipping_rule/shipping_rule_dashboard.py | 26 +++++++++++++ .../subscription_plan_dashboard.py | 24 ++++++++++++ .../tax_category/tax_category_dashboard.py | 39 +++++++++++++++++++ .../tax_withholding_category_dashboard.py | 15 +++++++ 19 files changed, 391 insertions(+), 4 deletions(-) create mode 100644 erpnext/accounts/doctype/bank/bank_dashboard.py create mode 100644 erpnext/accounts/doctype/bank_account/bank_account_dashboard.py create mode 100644 erpnext/accounts/doctype/c_form/c_form_dashboard.py create mode 100644 erpnext/accounts/doctype/finance_book/finance_book_dashboard.py create mode 100644 erpnext/accounts/doctype/fiscal_year/fiscal_year_dashboard.py create mode 100644 erpnext/accounts/doctype/item_tax_template/item_tax_template_dashboard.py create mode 100644 erpnext/accounts/doctype/journal_entry/journal_entry_dashboard.py create mode 100644 erpnext/accounts/doctype/loyalty_program/loyalty_program_dashboard.py create mode 100644 erpnext/accounts/doctype/payment_gateway_account/payment_gateway_account_dashboard.py create mode 100644 erpnext/accounts/doctype/payment_term/payment_term_dashboard.py create mode 100644 erpnext/accounts/doctype/payment_terms_template/payment_terms_template_dashboard.py create mode 100644 erpnext/accounts/doctype/pos_profile/pos_profile_dashboard.py create mode 100644 erpnext/accounts/doctype/share_type/share_type_dashboard.py create mode 100644 erpnext/accounts/doctype/shareholder/shareholder_dashboard.py create mode 100644 erpnext/accounts/doctype/shipping_rule/shipping_rule_dashboard.py create mode 100644 erpnext/accounts/doctype/subscription_plan/subscription_plan_dashboard.py create mode 100644 erpnext/accounts/doctype/tax_category/tax_category_dashboard.py create mode 100644 erpnext/accounts/doctype/tax_withholding_category/tax_withholding_category_dashboard.py diff --git a/erpnext/accounts/doctype/bank/bank_dashboard.py b/erpnext/accounts/doctype/bank/bank_dashboard.py new file mode 100644 index 0000000000..dcc6669043 --- /dev/null +++ b/erpnext/accounts/doctype/bank/bank_dashboard.py @@ -0,0 +1,19 @@ +from __future__ import unicode_literals + +from frappe import _ + + +def get_data(): + return { + 'fieldname': 'bank', + 'transactions': [ + { + 'label': _('Bank Deatils'), + 'items': ['Bank Account', 'Bank Statement Transaction Entry', 'Bank Guarantee'] + }, + { + 'label': _('Payments'), + 'items': ['Payment Order'] + } + ] + } diff --git a/erpnext/accounts/doctype/bank_account/bank_account_dashboard.py b/erpnext/accounts/doctype/bank_account/bank_account_dashboard.py new file mode 100644 index 0000000000..8339cb5937 --- /dev/null +++ b/erpnext/accounts/doctype/bank_account/bank_account_dashboard.py @@ -0,0 +1,32 @@ +from __future__ import unicode_literals + +from frappe import _ + + +def get_data(): + return { + 'fieldname': 'bank_account', + 'non_standard_fieldnames': { + 'Customer': 'default_bank_account', + 'Supplier': 'default_bank_account', + 'Journal Entry': 'bank_account_no' + }, + 'transactions': [ + { + 'label': _('Payments'), + 'items': ['Payment Entry', 'Payment Request', 'Payment Order'] + }, + { + 'label': _('Party'), + 'items': ['Customer', 'Supplier'] + }, + { + 'label': _('Banking'), + 'items': ['Bank Guarantee'] + }, + { + 'label': _('Journal Entries'), + 'items': ['Journal Entry'] + } + ] + } \ No newline at end of file diff --git a/erpnext/accounts/doctype/c_form/c_form_dashboard.py b/erpnext/accounts/doctype/c_form/c_form_dashboard.py new file mode 100644 index 0000000000..97af2bc5b6 --- /dev/null +++ b/erpnext/accounts/doctype/c_form/c_form_dashboard.py @@ -0,0 +1,18 @@ +from __future__ import unicode_literals + +from frappe import _ + + +def get_data(): + return { + 'fieldname': 'c_form', + 'non_standard_fieldnames': { + 'Sales Invoice': 'c_form_no' + }, + 'transactions': [ + { + 'label': _('Sales Invoice'), + 'items': ['Sales Invoice'] + } + ] + } diff --git a/erpnext/accounts/doctype/finance_book/finance_book_dashboard.py b/erpnext/accounts/doctype/finance_book/finance_book_dashboard.py new file mode 100644 index 0000000000..4d3b42e911 --- /dev/null +++ b/erpnext/accounts/doctype/finance_book/finance_book_dashboard.py @@ -0,0 +1,27 @@ +from __future__ import unicode_literals + +from frappe import _ + + +def get_data(): + return { + 'fieldname': 'finance_book', + 'non_standard_fieldnames': { + 'Asset': 'default_finance_book', + 'Company': 'default_finance_book' + }, + 'transactions': [ + { + 'label': _('Assets'), + 'items': ['Asset', 'Asset Value Adjustment'] + }, + { + 'label': _('Companies'), + 'items': ['Company'] + }, + { + 'label': _('Journal Entries'), + 'items': ['Journal Entry'] + } + ] + } diff --git a/erpnext/accounts/doctype/fiscal_year/fiscal_year_dashboard.py b/erpnext/accounts/doctype/fiscal_year/fiscal_year_dashboard.py new file mode 100644 index 0000000000..c7604ec7cc --- /dev/null +++ b/erpnext/accounts/doctype/fiscal_year/fiscal_year_dashboard.py @@ -0,0 +1,23 @@ +from __future__ import unicode_literals + +from frappe import _ + + +def get_data(): + return { + 'fieldname': 'fiscal_year', + 'transactions': [ + { + 'label': _('Budgets'), + 'items': ['Budget'] + }, + { + 'label': _('References'), + 'items': ['Period Closing Voucher', 'Request for Quotation', 'Tax Withholding Category'] + }, + { + 'label': _('Target Details'), + 'items': ['Sales Person', 'Sales Partner', 'Territory', 'Monthly Distribution'] + } + ] + } diff --git a/erpnext/accounts/doctype/item_tax_template/item_tax_template_dashboard.py b/erpnext/accounts/doctype/item_tax_template/item_tax_template_dashboard.py new file mode 100644 index 0000000000..674ad83a58 --- /dev/null +++ b/erpnext/accounts/doctype/item_tax_template/item_tax_template_dashboard.py @@ -0,0 +1,27 @@ +from __future__ import unicode_literals + +from frappe import _ + + +def get_data(): + return { + 'fieldname': 'item_tax_template', + 'transactions': [ + { + 'label': _('Pre Sales'), + 'items': ['Quotation', 'Supplier Quotation'] + }, + { + 'label': _('Sales'), + 'items': ['Sales Invoice', 'Sales Order', 'Delivery Note'] + }, + { + 'label': _('Purchase'), + 'items': ['Purchase Invoice', 'Purchase Order', 'Purchase Receipt'] + }, + { + 'label': _('Item Tax'), + 'items': ['Item'] + } + ] + } diff --git a/erpnext/accounts/doctype/journal_entry/journal_entry.js b/erpnext/accounts/doctype/journal_entry/journal_entry.js index 3ac677e50a..6973a46cc7 100644 --- a/erpnext/accounts/doctype/journal_entry/journal_entry.js +++ b/erpnext/accounts/doctype/journal_entry/journal_entry.js @@ -25,13 +25,13 @@ frappe.ui.form.on("Journal Entry", { "group_by_voucher": 0 }; frappe.set_route("query-report", "General Ledger"); - }, "fa fa-table"); + }, __('View')); } if(frm.doc.docstatus==1) { frm.add_custom_button(__('Reverse Journal Entry'), function() { return erpnext.journal_entry.reverse_journal_entry(frm); - }); + }, __('Make')); } if (frm.doc.__islocal) { @@ -47,8 +47,7 @@ frappe.ui.form.on("Journal Entry", { frm.add_custom_button(__("Create Inter Company Journal Entry"), function() { frm.trigger("make_inter_company_journal_entry"); - } - ); + }, __('Make')); } }, diff --git a/erpnext/accounts/doctype/journal_entry/journal_entry_dashboard.py b/erpnext/accounts/doctype/journal_entry/journal_entry_dashboard.py new file mode 100644 index 0000000000..ba2641940a --- /dev/null +++ b/erpnext/accounts/doctype/journal_entry/journal_entry_dashboard.py @@ -0,0 +1,26 @@ +from __future__ import unicode_literals + +from frappe import _ + + +def get_data(): + return { + 'fieldname': 'journal_entry', + 'non_standard_fieldnames': { + 'Stock Entry': 'credit_note', + }, + 'transactions': [ + { + 'label': _('Assets'), + 'items': ['Asset', 'Asset Value Adjustment'] + }, + { + 'label': _('Stock'), + 'items': ['Stock Entry'] + }, + { + 'label': _('Salaries'), + 'items': ['Salary Slip'] + } + ] + } diff --git a/erpnext/accounts/doctype/loyalty_program/loyalty_program_dashboard.py b/erpnext/accounts/doctype/loyalty_program/loyalty_program_dashboard.py new file mode 100644 index 0000000000..3fab11bf85 --- /dev/null +++ b/erpnext/accounts/doctype/loyalty_program/loyalty_program_dashboard.py @@ -0,0 +1,19 @@ +from __future__ import unicode_literals + +from frappe import _ + + +def get_data(): + return { + 'fieldname': 'loyalty_program', + 'transactions': [ + { + 'label': _('Sales Invoice'), + 'items': ['Sales Invoice'] + }, + { + 'label': _('Customers'), + 'items': ['Customer'] + } + ] + } diff --git a/erpnext/accounts/doctype/payment_gateway_account/payment_gateway_account_dashboard.py b/erpnext/accounts/doctype/payment_gateway_account/payment_gateway_account_dashboard.py new file mode 100644 index 0000000000..210593e550 --- /dev/null +++ b/erpnext/accounts/doctype/payment_gateway_account/payment_gateway_account_dashboard.py @@ -0,0 +1,22 @@ +from __future__ import unicode_literals + +from frappe import _ + + +def get_data(): + return { + 'fieldname': 'payment_gateway_account', + 'non_standard_fieldnames': { + 'Subscription Plan': 'payment_gateway' + }, + 'transactions': [ + { + 'label': _('Payments'), + 'items': ['Payment Request'] + }, + { + 'label': _('Subscription Plans'), + 'items': ['Subscription Plan'] + } + ] + } diff --git a/erpnext/accounts/doctype/payment_term/payment_term_dashboard.py b/erpnext/accounts/doctype/payment_term/payment_term_dashboard.py new file mode 100644 index 0000000000..fafbb71976 --- /dev/null +++ b/erpnext/accounts/doctype/payment_term/payment_term_dashboard.py @@ -0,0 +1,19 @@ +from __future__ import unicode_literals + +from frappe import _ + + +def get_data(): + return { + 'fieldname': 'payment_term', + 'transactions': [ + { + 'label': _('Invoices and Orders'), + 'items': ['Sales Invoice', 'Sales Order', 'Purchase Invoice', 'Purchase Order', 'Quotation'] + }, + { + 'label': _('Payment Terms Template'), + 'items': ['Payment Terms Template'] + } + ] + } diff --git a/erpnext/accounts/doctype/payment_terms_template/payment_terms_template_dashboard.py b/erpnext/accounts/doctype/payment_terms_template/payment_terms_template_dashboard.py new file mode 100644 index 0000000000..e69de29bb2 diff --git a/erpnext/accounts/doctype/pos_profile/pos_profile_dashboard.py b/erpnext/accounts/doctype/pos_profile/pos_profile_dashboard.py new file mode 100644 index 0000000000..c0a3636cc6 --- /dev/null +++ b/erpnext/accounts/doctype/pos_profile/pos_profile_dashboard.py @@ -0,0 +1,19 @@ +from __future__ import unicode_literals + +from frappe import _ + + +def get_data(): + return { + 'fieldname': 'pos_profile', + 'transactions': [ + { + 'label': _('Sales Invoices'), + 'items': ['Sales Invoice'] + }, + { + 'label': _('POS Closing Vouchers'), + 'items': ['POS Closing Voucher'] + } + ] + } diff --git a/erpnext/accounts/doctype/share_type/share_type_dashboard.py b/erpnext/accounts/doctype/share_type/share_type_dashboard.py new file mode 100644 index 0000000000..455b022577 --- /dev/null +++ b/erpnext/accounts/doctype/share_type/share_type_dashboard.py @@ -0,0 +1,15 @@ +from __future__ import unicode_literals + +from frappe import _ + + +def get_data(): + return { + 'fieldname': 'share_type', + 'transactions': [ + { + 'label': _('References'), + 'items': ['Share Transfer', 'Shareholder'] + } + ] + } diff --git a/erpnext/accounts/doctype/shareholder/shareholder_dashboard.py b/erpnext/accounts/doctype/shareholder/shareholder_dashboard.py new file mode 100644 index 0000000000..1a64c94d22 --- /dev/null +++ b/erpnext/accounts/doctype/shareholder/shareholder_dashboard.py @@ -0,0 +1,18 @@ +from __future__ import unicode_literals + +from frappe import _ + + +def get_data(): + return { + 'fieldname': 'shareholder', + 'non_standard_fieldnames': { + 'Share Transfer': 'to_shareholder' + }, + 'transactions': [ + { + 'label': _('Share Transfers'), + 'items': ['Share Transfer'] + } + ] + } diff --git a/erpnext/accounts/doctype/shipping_rule/shipping_rule_dashboard.py b/erpnext/accounts/doctype/shipping_rule/shipping_rule_dashboard.py new file mode 100644 index 0000000000..636ee5788d --- /dev/null +++ b/erpnext/accounts/doctype/shipping_rule/shipping_rule_dashboard.py @@ -0,0 +1,26 @@ +from __future__ import unicode_literals + +from frappe import _ + + +def get_data(): + return { + 'fieldname': 'shipping_rule', + 'non_standard_fieldnames': { + 'Payment Entry': 'party_name' + }, + 'transactions': [ + { + 'label': _('Pre Sales'), + 'items': ['Quotation', 'Supplier Quotation'] + }, + { + 'label': _('Sales'), + 'items': ['Sales Order', 'Delivery Note', 'Sales Invoice'] + }, + { + 'label': _('Purchase'), + 'items': ['Purchase Invoice', 'Purchase Order', 'Purchase Receipt'] + } + ] + } diff --git a/erpnext/accounts/doctype/subscription_plan/subscription_plan_dashboard.py b/erpnext/accounts/doctype/subscription_plan/subscription_plan_dashboard.py new file mode 100644 index 0000000000..e28b127529 --- /dev/null +++ b/erpnext/accounts/doctype/subscription_plan/subscription_plan_dashboard.py @@ -0,0 +1,24 @@ +from __future__ import unicode_literals + +from frappe import _ + + +def get_data(): + return { + 'fieldname': 'subscription_plan', + 'non_standard_fieldnames': { + 'Payment Request': 'plan', + 'Subscription': 'plan' + + }, + 'transactions': [ + { + 'label': _('Payments'), + 'items': ['Payment Request'] + }, + { + 'label': _('Subscriptions'), + 'items': ['Subscription'] + } + ] + } diff --git a/erpnext/accounts/doctype/tax_category/tax_category_dashboard.py b/erpnext/accounts/doctype/tax_category/tax_category_dashboard.py new file mode 100644 index 0000000000..5c5d32c9c4 --- /dev/null +++ b/erpnext/accounts/doctype/tax_category/tax_category_dashboard.py @@ -0,0 +1,39 @@ +from __future__ import unicode_literals + +from frappe import _ + + +def get_data(): + return { + 'fieldname': 'tax_category', + 'non_standard_fieldnames': { + 'Payment Entry': 'party_name' + }, + 'internal_links': { + 'Purchase Order': ['items', 'purchase_order'], + 'Project': ['items', 'project'], + 'Quality Inspection': ['items', 'quality_inspection'], + }, + 'transactions': [ + { + 'label': _('Pre Sales'), + 'items': ['Quotation', 'Supplier Quotation'] + }, + { + 'label': _('Sales'), + 'items': ['Sales Invoice', 'Delivery Note', 'Sales Order'] + }, + { + 'label': _('Purchase'), + 'items': ['Purchase Invoice', 'Purchase Receipt'] + }, + { + 'label': _('Party'), + 'items': ['Customer', 'Supplier'] + }, + { + 'label': _('Taxes'), + 'items': ['Item', 'Tax Rule'] + } + ] + } diff --git a/erpnext/accounts/doctype/tax_withholding_category/tax_withholding_category_dashboard.py b/erpnext/accounts/doctype/tax_withholding_category/tax_withholding_category_dashboard.py new file mode 100644 index 0000000000..3c8ae98d3d --- /dev/null +++ b/erpnext/accounts/doctype/tax_withholding_category/tax_withholding_category_dashboard.py @@ -0,0 +1,15 @@ +from __future__ import unicode_literals + +from frappe import _ + + +def get_data(): + return { + 'fieldname': 'tax_withholding_category', + 'transactions': [ + { + 'label': _('Suppliers'), + 'items': ['Supplier'] + } + ] + } From 8f3a6c1596cd8ab6c38759c21e1935050bc37d2c Mon Sep 17 00:00:00 2001 From: deepeshgarg007 Date: Thu, 30 May 2019 11:53:12 +0530 Subject: [PATCH 02/69] fix: Dashboards for doctypes in accounting modules --- .../monthly_distribution_dashboard.py | 24 ++++++++++++++ .../payment_terms_template_dashboard.py | 33 +++++++++++++++++++ ...se_taxes_and_charges_template_dashboard.py | 26 +++++++++++++++ ...es_taxes_and_charges_template_dashboard.py | 28 ++++++++++++++++ 4 files changed, 111 insertions(+) create mode 100644 erpnext/accounts/doctype/monthly_distribution/monthly_distribution_dashboard.py create mode 100644 erpnext/accounts/doctype/purchase_taxes_and_charges_template/purchase_taxes_and_charges_template_dashboard.py create mode 100644 erpnext/accounts/doctype/sales_taxes_and_charges_template/sales_taxes_and_charges_template_dashboard.py diff --git a/erpnext/accounts/doctype/monthly_distribution/monthly_distribution_dashboard.py b/erpnext/accounts/doctype/monthly_distribution/monthly_distribution_dashboard.py new file mode 100644 index 0000000000..d307fd5732 --- /dev/null +++ b/erpnext/accounts/doctype/monthly_distribution/monthly_distribution_dashboard.py @@ -0,0 +1,24 @@ +from __future__ import unicode_literals + +from frappe import _ + + +def get_data(): + return { + 'fieldname': 'monthly_distribution', + 'non_standard_fieldnames': { + 'Sales Person': 'distribution_id', + 'Territory': 'distribution_id', + 'Sales Partner': 'distribution_id', + }, + 'transactions': [ + { + 'label': _('Target Details'), + 'items': ['Sales Person', 'Territory', 'Sales Partner'] + }, + { + 'label': _('References'), + 'items': ['Budget'] + } + ] + } \ No newline at end of file diff --git a/erpnext/accounts/doctype/payment_terms_template/payment_terms_template_dashboard.py b/erpnext/accounts/doctype/payment_terms_template/payment_terms_template_dashboard.py index e69de29bb2..c705097ac6 100644 --- a/erpnext/accounts/doctype/payment_terms_template/payment_terms_template_dashboard.py +++ b/erpnext/accounts/doctype/payment_terms_template/payment_terms_template_dashboard.py @@ -0,0 +1,33 @@ +from __future__ import unicode_literals + +from frappe import _ + + +def get_data(): + return { + 'fieldname': 'payment_terms_template', + 'non_standard_fieldnames': { + 'Customer Group': 'payment_terms', + 'Supplier Group': 'payment_terms', + 'Supplier': 'payment_terms', + 'Customer': 'payment_terms' + }, + 'transactions': [ + { + 'label': _('Sales'), + 'items': ['Sales Invoice', 'Sales Order', 'Quotation'] + }, + { + 'label': _('Purchase'), + 'items': ['Purchase Invoice', 'Purchase Order'] + }, + { + 'label': _('Party'), + 'items': ['Customer', 'Supplier'] + }, + { + 'label': _('Group'), + 'items': ['Customer Group', 'Supplier Group'] + } + ] + } \ No newline at end of file diff --git a/erpnext/accounts/doctype/purchase_taxes_and_charges_template/purchase_taxes_and_charges_template_dashboard.py b/erpnext/accounts/doctype/purchase_taxes_and_charges_template/purchase_taxes_and_charges_template_dashboard.py new file mode 100644 index 0000000000..0953a98fa2 --- /dev/null +++ b/erpnext/accounts/doctype/purchase_taxes_and_charges_template/purchase_taxes_and_charges_template_dashboard.py @@ -0,0 +1,26 @@ +from __future__ import unicode_literals + +from frappe import _ + + +def get_data(): + return { + 'fieldname': 'taxes_and_charges', + 'non_standard_fieldnames': { + 'Tax Rule': 'purchase_tax_template', + }, + 'transactions': [ + { + 'label': _('Transactions'), + 'items': ['Purchase Invoice', 'Purchase Order', 'Purchase Receipt'] + }, + { + 'label': _('Supplier Quotations'), + 'items': ['Supplier Quotation'] + }, + { + 'label': _('Tax Rules'), + 'items': ['Tax Rule'] + } + ] + } \ No newline at end of file diff --git a/erpnext/accounts/doctype/sales_taxes_and_charges_template/sales_taxes_and_charges_template_dashboard.py b/erpnext/accounts/doctype/sales_taxes_and_charges_template/sales_taxes_and_charges_template_dashboard.py new file mode 100644 index 0000000000..9deb5b6b9e --- /dev/null +++ b/erpnext/accounts/doctype/sales_taxes_and_charges_template/sales_taxes_and_charges_template_dashboard.py @@ -0,0 +1,28 @@ +from __future__ import unicode_literals + +from frappe import _ + + +def get_data(): + return { + 'fieldname': 'taxes_and_charges', + 'non_standard_fieldnames': { + 'Tax Rule': 'sales_tax_template', + 'Subscription': 'tax_template', + 'Restaurant': 'default_tax_template' + }, + 'transactions': [ + { + 'label': _('Transactions'), + 'items': ['Sales Invoice', 'Sales Order', 'Delivery Note'] + }, + { + 'label': _('References'), + 'items': ['POS Profile', 'Subscription', 'Restaurant'] + }, + { + 'label': _('Tax Rules'), + 'items': ['Tax Rule'] + } + ] + } \ No newline at end of file From e233708754d208bd0a5a95e701bd7eb4c0ea5d5a Mon Sep 17 00:00:00 2001 From: deepeshgarg007 Date: Thu, 30 May 2019 12:14:16 +0530 Subject: [PATCH 03/69] fix: Tax category dashboard --- .../doctype/tax_category/tax_category_dashboard.py | 8 -------- 1 file changed, 8 deletions(-) diff --git a/erpnext/accounts/doctype/tax_category/tax_category_dashboard.py b/erpnext/accounts/doctype/tax_category/tax_category_dashboard.py index 5c5d32c9c4..d643efb090 100644 --- a/erpnext/accounts/doctype/tax_category/tax_category_dashboard.py +++ b/erpnext/accounts/doctype/tax_category/tax_category_dashboard.py @@ -6,14 +6,6 @@ from frappe import _ def get_data(): return { 'fieldname': 'tax_category', - 'non_standard_fieldnames': { - 'Payment Entry': 'party_name' - }, - 'internal_links': { - 'Purchase Order': ['items', 'purchase_order'], - 'Project': ['items', 'project'], - 'Quality Inspection': ['items', 'quality_inspection'], - }, 'transactions': [ { 'label': _('Pre Sales'), From a9b2e4e4a89547c7061bc6d03c6be8e6a8c9441d Mon Sep 17 00:00:00 2001 From: deepeshgarg007 Date: Thu, 30 May 2019 12:18:10 +0530 Subject: [PATCH 04/69] fix: White space in subscription plan dashboard --- .../doctype/subscription_plan/subscription_plan_dashboard.py | 1 - 1 file changed, 1 deletion(-) diff --git a/erpnext/accounts/doctype/subscription_plan/subscription_plan_dashboard.py b/erpnext/accounts/doctype/subscription_plan/subscription_plan_dashboard.py index e28b127529..b118e582a2 100644 --- a/erpnext/accounts/doctype/subscription_plan/subscription_plan_dashboard.py +++ b/erpnext/accounts/doctype/subscription_plan/subscription_plan_dashboard.py @@ -9,7 +9,6 @@ def get_data(): 'non_standard_fieldnames': { 'Payment Request': 'plan', 'Subscription': 'plan' - }, 'transactions': [ { From 290847df4655dc32f773eef0da7cc01a7ed36668 Mon Sep 17 00:00:00 2001 From: deepeshgarg007 Date: Sun, 2 Jun 2019 19:35:18 +0530 Subject: [PATCH 05/69] fix: Fixes in accounting doctype dashboards --- .../accounts/doctype/bank/bank_dashboard.py | 1 - .../bank_account/bank_account_dashboard.py | 2 -- .../doctype/c_form/c_form_dashboard.py | 18 ------------- .../finance_book/finance_book_dashboard.py | 2 -- .../item_tax_template_dashboard.py | 1 - .../journal_entry/journal_entry_dashboard.py | 26 ------------------- .../loyalty_program_dashboard.py | 7 +---- .../monthly_distribution_dashboard.py | 1 - .../payment_gateway_account_dashboard.py | 2 -- .../payment_term/payment_term_dashboard.py | 9 ++++--- .../pos_profile/pos_profile_dashboard.py | 7 +---- ...se_taxes_and_charges_template_dashboard.py | 8 ++---- ...es_taxes_and_charges_template_dashboard.py | 6 +---- .../shareholder/shareholder_dashboard.py | 1 - .../subscription_plan_dashboard.py | 8 ++---- .../tax_withholding_category_dashboard.py | 1 - 16 files changed, 13 insertions(+), 87 deletions(-) delete mode 100644 erpnext/accounts/doctype/c_form/c_form_dashboard.py delete mode 100644 erpnext/accounts/doctype/journal_entry/journal_entry_dashboard.py diff --git a/erpnext/accounts/doctype/bank/bank_dashboard.py b/erpnext/accounts/doctype/bank/bank_dashboard.py index dcc6669043..230613c5b3 100644 --- a/erpnext/accounts/doctype/bank/bank_dashboard.py +++ b/erpnext/accounts/doctype/bank/bank_dashboard.py @@ -12,7 +12,6 @@ def get_data(): 'items': ['Bank Account', 'Bank Statement Transaction Entry', 'Bank Guarantee'] }, { - 'label': _('Payments'), 'items': ['Payment Order'] } ] diff --git a/erpnext/accounts/doctype/bank_account/bank_account_dashboard.py b/erpnext/accounts/doctype/bank_account/bank_account_dashboard.py index 8339cb5937..3d149eb334 100644 --- a/erpnext/accounts/doctype/bank_account/bank_account_dashboard.py +++ b/erpnext/accounts/doctype/bank_account/bank_account_dashboard.py @@ -21,11 +21,9 @@ def get_data(): 'items': ['Customer', 'Supplier'] }, { - 'label': _('Banking'), 'items': ['Bank Guarantee'] }, { - 'label': _('Journal Entries'), 'items': ['Journal Entry'] } ] diff --git a/erpnext/accounts/doctype/c_form/c_form_dashboard.py b/erpnext/accounts/doctype/c_form/c_form_dashboard.py deleted file mode 100644 index 97af2bc5b6..0000000000 --- a/erpnext/accounts/doctype/c_form/c_form_dashboard.py +++ /dev/null @@ -1,18 +0,0 @@ -from __future__ import unicode_literals - -from frappe import _ - - -def get_data(): - return { - 'fieldname': 'c_form', - 'non_standard_fieldnames': { - 'Sales Invoice': 'c_form_no' - }, - 'transactions': [ - { - 'label': _('Sales Invoice'), - 'items': ['Sales Invoice'] - } - ] - } diff --git a/erpnext/accounts/doctype/finance_book/finance_book_dashboard.py b/erpnext/accounts/doctype/finance_book/finance_book_dashboard.py index 4d3b42e911..c2ebea6e8f 100644 --- a/erpnext/accounts/doctype/finance_book/finance_book_dashboard.py +++ b/erpnext/accounts/doctype/finance_book/finance_book_dashboard.py @@ -16,11 +16,9 @@ def get_data(): 'items': ['Asset', 'Asset Value Adjustment'] }, { - 'label': _('Companies'), 'items': ['Company'] }, { - 'label': _('Journal Entries'), 'items': ['Journal Entry'] } ] diff --git a/erpnext/accounts/doctype/item_tax_template/item_tax_template_dashboard.py b/erpnext/accounts/doctype/item_tax_template/item_tax_template_dashboard.py index 674ad83a58..acc308e0e6 100644 --- a/erpnext/accounts/doctype/item_tax_template/item_tax_template_dashboard.py +++ b/erpnext/accounts/doctype/item_tax_template/item_tax_template_dashboard.py @@ -20,7 +20,6 @@ def get_data(): 'items': ['Purchase Invoice', 'Purchase Order', 'Purchase Receipt'] }, { - 'label': _('Item Tax'), 'items': ['Item'] } ] diff --git a/erpnext/accounts/doctype/journal_entry/journal_entry_dashboard.py b/erpnext/accounts/doctype/journal_entry/journal_entry_dashboard.py deleted file mode 100644 index ba2641940a..0000000000 --- a/erpnext/accounts/doctype/journal_entry/journal_entry_dashboard.py +++ /dev/null @@ -1,26 +0,0 @@ -from __future__ import unicode_literals - -from frappe import _ - - -def get_data(): - return { - 'fieldname': 'journal_entry', - 'non_standard_fieldnames': { - 'Stock Entry': 'credit_note', - }, - 'transactions': [ - { - 'label': _('Assets'), - 'items': ['Asset', 'Asset Value Adjustment'] - }, - { - 'label': _('Stock'), - 'items': ['Stock Entry'] - }, - { - 'label': _('Salaries'), - 'items': ['Salary Slip'] - } - ] - } diff --git a/erpnext/accounts/doctype/loyalty_program/loyalty_program_dashboard.py b/erpnext/accounts/doctype/loyalty_program/loyalty_program_dashboard.py index 3fab11bf85..189004f5ec 100644 --- a/erpnext/accounts/doctype/loyalty_program/loyalty_program_dashboard.py +++ b/erpnext/accounts/doctype/loyalty_program/loyalty_program_dashboard.py @@ -8,12 +8,7 @@ def get_data(): 'fieldname': 'loyalty_program', 'transactions': [ { - 'label': _('Sales Invoice'), - 'items': ['Sales Invoice'] - }, - { - 'label': _('Customers'), - 'items': ['Customer'] + 'items': ['Sales Invoice', 'Customer'] } ] } diff --git a/erpnext/accounts/doctype/monthly_distribution/monthly_distribution_dashboard.py b/erpnext/accounts/doctype/monthly_distribution/monthly_distribution_dashboard.py index d307fd5732..a679499815 100644 --- a/erpnext/accounts/doctype/monthly_distribution/monthly_distribution_dashboard.py +++ b/erpnext/accounts/doctype/monthly_distribution/monthly_distribution_dashboard.py @@ -17,7 +17,6 @@ def get_data(): 'items': ['Sales Person', 'Territory', 'Sales Partner'] }, { - 'label': _('References'), 'items': ['Budget'] } ] diff --git a/erpnext/accounts/doctype/payment_gateway_account/payment_gateway_account_dashboard.py b/erpnext/accounts/doctype/payment_gateway_account/payment_gateway_account_dashboard.py index 210593e550..08982296f3 100644 --- a/erpnext/accounts/doctype/payment_gateway_account/payment_gateway_account_dashboard.py +++ b/erpnext/accounts/doctype/payment_gateway_account/payment_gateway_account_dashboard.py @@ -11,11 +11,9 @@ def get_data(): }, 'transactions': [ { - 'label': _('Payments'), 'items': ['Payment Request'] }, { - 'label': _('Subscription Plans'), 'items': ['Subscription Plan'] } ] diff --git a/erpnext/accounts/doctype/payment_term/payment_term_dashboard.py b/erpnext/accounts/doctype/payment_term/payment_term_dashboard.py index fafbb71976..d146fcdee3 100644 --- a/erpnext/accounts/doctype/payment_term/payment_term_dashboard.py +++ b/erpnext/accounts/doctype/payment_term/payment_term_dashboard.py @@ -8,11 +8,14 @@ def get_data(): 'fieldname': 'payment_term', 'transactions': [ { - 'label': _('Invoices and Orders'), - 'items': ['Sales Invoice', 'Sales Order', 'Purchase Invoice', 'Purchase Order', 'Quotation'] + 'label': _('Sales'), + 'items': ['Sales Invoice', 'Sales Order', 'Quotation'] + }, + { + 'label': _('Purchase'), + 'items': ['Purchase Invoice', 'Purchase Order'] }, { - 'label': _('Payment Terms Template'), 'items': ['Payment Terms Template'] } ] diff --git a/erpnext/accounts/doctype/pos_profile/pos_profile_dashboard.py b/erpnext/accounts/doctype/pos_profile/pos_profile_dashboard.py index c0a3636cc6..e28bf73075 100644 --- a/erpnext/accounts/doctype/pos_profile/pos_profile_dashboard.py +++ b/erpnext/accounts/doctype/pos_profile/pos_profile_dashboard.py @@ -8,12 +8,7 @@ def get_data(): 'fieldname': 'pos_profile', 'transactions': [ { - 'label': _('Sales Invoices'), - 'items': ['Sales Invoice'] - }, - { - 'label': _('POS Closing Vouchers'), - 'items': ['POS Closing Voucher'] + 'items': ['Sales Invoice', 'POS Closing Voucher'] } ] } diff --git a/erpnext/accounts/doctype/purchase_taxes_and_charges_template/purchase_taxes_and_charges_template_dashboard.py b/erpnext/accounts/doctype/purchase_taxes_and_charges_template/purchase_taxes_and_charges_template_dashboard.py index 0953a98fa2..11c220bf2d 100644 --- a/erpnext/accounts/doctype/purchase_taxes_and_charges_template/purchase_taxes_and_charges_template_dashboard.py +++ b/erpnext/accounts/doctype/purchase_taxes_and_charges_template/purchase_taxes_and_charges_template_dashboard.py @@ -15,12 +15,8 @@ def get_data(): 'items': ['Purchase Invoice', 'Purchase Order', 'Purchase Receipt'] }, { - 'label': _('Supplier Quotations'), - 'items': ['Supplier Quotation'] - }, - { - 'label': _('Tax Rules'), - 'items': ['Tax Rule'] + 'label': _('References'), + 'items': ['Supplier Quotation', 'Tax Rule'] } ] } \ No newline at end of file diff --git a/erpnext/accounts/doctype/sales_taxes_and_charges_template/sales_taxes_and_charges_template_dashboard.py b/erpnext/accounts/doctype/sales_taxes_and_charges_template/sales_taxes_and_charges_template_dashboard.py index 9deb5b6b9e..0e9c808608 100644 --- a/erpnext/accounts/doctype/sales_taxes_and_charges_template/sales_taxes_and_charges_template_dashboard.py +++ b/erpnext/accounts/doctype/sales_taxes_and_charges_template/sales_taxes_and_charges_template_dashboard.py @@ -18,11 +18,7 @@ def get_data(): }, { 'label': _('References'), - 'items': ['POS Profile', 'Subscription', 'Restaurant'] - }, - { - 'label': _('Tax Rules'), - 'items': ['Tax Rule'] + 'items': ['POS Profile', 'Subscription', 'Restaurant', 'Tax Rule'] } ] } \ No newline at end of file diff --git a/erpnext/accounts/doctype/shareholder/shareholder_dashboard.py b/erpnext/accounts/doctype/shareholder/shareholder_dashboard.py index 1a64c94d22..3b77fd51b5 100644 --- a/erpnext/accounts/doctype/shareholder/shareholder_dashboard.py +++ b/erpnext/accounts/doctype/shareholder/shareholder_dashboard.py @@ -11,7 +11,6 @@ def get_data(): }, 'transactions': [ { - 'label': _('Share Transfers'), 'items': ['Share Transfer'] } ] diff --git a/erpnext/accounts/doctype/subscription_plan/subscription_plan_dashboard.py b/erpnext/accounts/doctype/subscription_plan/subscription_plan_dashboard.py index b118e582a2..df3023335a 100644 --- a/erpnext/accounts/doctype/subscription_plan/subscription_plan_dashboard.py +++ b/erpnext/accounts/doctype/subscription_plan/subscription_plan_dashboard.py @@ -12,12 +12,8 @@ def get_data(): }, 'transactions': [ { - 'label': _('Payments'), - 'items': ['Payment Request'] - }, - { - 'label': _('Subscriptions'), - 'items': ['Subscription'] + 'label': _('References'), + 'items': ['Payment Request', 'Subscription'] } ] } diff --git a/erpnext/accounts/doctype/tax_withholding_category/tax_withholding_category_dashboard.py b/erpnext/accounts/doctype/tax_withholding_category/tax_withholding_category_dashboard.py index 3c8ae98d3d..d51ba65b13 100644 --- a/erpnext/accounts/doctype/tax_withholding_category/tax_withholding_category_dashboard.py +++ b/erpnext/accounts/doctype/tax_withholding_category/tax_withholding_category_dashboard.py @@ -8,7 +8,6 @@ def get_data(): 'fieldname': 'tax_withholding_category', 'transactions': [ { - 'label': _('Suppliers'), 'items': ['Supplier'] } ] From 1831844fcf60100568d317e9a73887477d34385a Mon Sep 17 00:00:00 2001 From: deepeshgarg007 Date: Mon, 3 Jun 2019 21:53:58 +0530 Subject: [PATCH 06/69] fix: Dashboard for cost center --- erpnext/accounts/doctype/bank/bank_dashboard.py | 2 +- .../doctype/cost_center/cost_center_dashboard.py | 15 +++++++++++++++ 2 files changed, 16 insertions(+), 1 deletion(-) create mode 100644 erpnext/accounts/doctype/cost_center/cost_center_dashboard.py diff --git a/erpnext/accounts/doctype/bank/bank_dashboard.py b/erpnext/accounts/doctype/bank/bank_dashboard.py index 230613c5b3..432404155d 100644 --- a/erpnext/accounts/doctype/bank/bank_dashboard.py +++ b/erpnext/accounts/doctype/bank/bank_dashboard.py @@ -9,7 +9,7 @@ def get_data(): 'transactions': [ { 'label': _('Bank Deatils'), - 'items': ['Bank Account', 'Bank Statement Transaction Entry', 'Bank Guarantee'] + 'items': ['Bank Account', 'Bank Guarantee'] }, { 'items': ['Payment Order'] diff --git a/erpnext/accounts/doctype/cost_center/cost_center_dashboard.py b/erpnext/accounts/doctype/cost_center/cost_center_dashboard.py new file mode 100644 index 0000000000..788ac8be83 --- /dev/null +++ b/erpnext/accounts/doctype/cost_center/cost_center_dashboard.py @@ -0,0 +1,15 @@ +from __future__ import unicode_literals + +from frappe import _ + + +def get_data(): + return { + 'fieldname': 'cost_center', + 'reports': [ + { + 'label': _('Reports'), + 'items': ['Budget Variance Report', 'General Ledger'] + } + ] + } \ No newline at end of file From fd19678bc7d2e3ae428fb5179dee042da3040245 Mon Sep 17 00:00:00 2001 From: Anurag Mishra Date: Thu, 6 Jun 2019 18:37:10 +0530 Subject: [PATCH 07/69] fix: show cost center in print fromat of report trial balance --- erpnext/accounts/report/financial_statements.html | 1 + 1 file changed, 1 insertion(+) diff --git a/erpnext/accounts/report/financial_statements.html b/erpnext/accounts/report/financial_statements.html index cb853fd1dc..1087c28b81 100644 --- a/erpnext/accounts/report/financial_statements.html +++ b/erpnext/accounts/report/financial_statements.html @@ -23,6 +23,7 @@ {% } %}

{%= __(report.report_name) %}

{%= filters.company %}

+

{%= filters.cost_center %}

{%= filters.fiscal_year %}

{%= __("Currency") %} : {%= filters.presentation_currency || erpnext.get_currency(filters.company) %}
{% if (filters.from_date) { %} From 72264697be0a770147bded3d231b7016622a7707 Mon Sep 17 00:00:00 2001 From: Rohit Waghchaure Date: Fri, 7 Jun 2019 11:44:51 +0530 Subject: [PATCH 08/69] fix: Not able to save salary slip --- erpnext/hr/doctype/salary_slip/salary_slip.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/erpnext/hr/doctype/salary_slip/salary_slip.py b/erpnext/hr/doctype/salary_slip/salary_slip.py index 6bba0c54d8..7b2fa36258 100644 --- a/erpnext/hr/doctype/salary_slip/salary_slip.py +++ b/erpnext/hr/doctype/salary_slip/salary_slip.py @@ -446,7 +446,7 @@ class SalarySlip(TransactionBase): else: component_row.additional_amount = amount - if not overwrite: + if not overwrite and component_row.default_amount: amount += component_row.default_amount component_row.amount = amount From 04d61717bcc23715a118844694c16c0d36c16615 Mon Sep 17 00:00:00 2001 From: Shivam Mishra Date: Fri, 7 Jun 2019 13:03:46 +0530 Subject: [PATCH 09/69] fix: lms card hero image no visible --- erpnext/www/lms/course.html | 2 +- erpnext/www/lms/macros/card.html | 2 +- erpnext/www/lms/program.html | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/erpnext/www/lms/course.html b/erpnext/www/lms/course.html index 0bfd059013..84cad36f9d 100644 --- a/erpnext/www/lms/course.html +++ b/erpnext/www/lms/course.html @@ -45,7 +45,7 @@
{% endif %} {% if topic.hero_image %} -
+
{% else %}
diff --git a/erpnext/www/lms/macros/card.html b/erpnext/www/lms/macros/card.html index f227355832..9964d2df34 100644 --- a/erpnext/www/lms/macros/card.html +++ b/erpnext/www/lms/macros/card.html @@ -3,7 +3,7 @@
{% if program.hero_image %} -
+
{% else %}
diff --git a/erpnext/www/lms/program.html b/erpnext/www/lms/program.html index d1227788b8..b6d696653b 100644 --- a/erpnext/www/lms/program.html +++ b/erpnext/www/lms/program.html @@ -42,7 +42,7 @@
{% if course.hero_image %} -
+
{% else %}
From 449f2611280025fba48aa918f9e6a4ac88b9bc12 Mon Sep 17 00:00:00 2001 From: Shivam Mishra Date: Thu, 6 Jun 2019 18:33:58 +0530 Subject: [PATCH 11/69] feat: show signup dialog for Guest --- erpnext/www/lms/course.html | 21 ++++++++++++++++++++- erpnext/www/lms/topic.html | 2 +- 2 files changed, 21 insertions(+), 2 deletions(-) diff --git a/erpnext/www/lms/course.html b/erpnext/www/lms/course.html index 84cad36f9d..f8618e08ec 100644 --- a/erpnext/www/lms/course.html +++ b/erpnext/www/lms/course.html @@ -42,7 +42,7 @@ {% if has_access %} {% else %} -
+
{% endif %} {% if topic.hero_image %}
@@ -103,4 +103,23 @@
+{% endblock %} + +{% block script %} + {% endblock %} \ No newline at end of file diff --git a/erpnext/www/lms/topic.html b/erpnext/www/lms/topic.html index 3a777765a1..3bbfbd0936 100644 --- a/erpnext/www/lms/topic.html +++ b/erpnext/www/lms/topic.html @@ -17,7 +17,7 @@
-
{{ content.content_type or '' }}
+
{{ content.content_type or '' }}
{{ content.content.name }}
{% if has_access %} From 9a792c2eedb3c3bc545328c4d82058f4fbda1e55 Mon Sep 17 00:00:00 2001 From: Rohit Waghchaure Date: Wed, 15 May 2019 12:42:37 +0530 Subject: [PATCH 12/69] stock_entry: set COGS for material issue only --- .../stock/doctype/stock_entry/stock_entry.py | 34 +++++++++---------- erpnext/stock/get_item_details.py | 10 ++++-- 2 files changed, 25 insertions(+), 19 deletions(-) diff --git a/erpnext/stock/doctype/stock_entry/stock_entry.py b/erpnext/stock/doctype/stock_entry/stock_entry.py index 9de639402f..96c856651a 100644 --- a/erpnext/stock/doctype/stock_entry/stock_entry.py +++ b/erpnext/stock/doctype/stock_entry/stock_entry.py @@ -676,35 +676,36 @@ class StockEntry(StockController): ret = frappe._dict({ 'uom' : item.stock_uom, - 'stock_uom' : item.stock_uom, + 'stock_uom' : item.stock_uom, 'description' : item.description, - 'image' : item.image, + 'image' : item.image, 'item_name' : item.item_name, - 'expense_account' : args.get("expense_account"), - 'cost_center' : get_default_cost_center(args, item, item_group_defaults, brand_defaults), - 'qty' : args.get("qty"), + 'cost_center' : get_default_cost_center(args, item, item_group_defaults, brand_defaults, self.company), + 'qty' : args.get("qty"), 'transfer_qty' : args.get('qty'), 'conversion_factor' : 1, - 'batch_no' : '', + 'batch_no' : '', 'actual_qty' : 0, 'basic_rate' : 0, - 'serial_no' : '', + 'serial_no' : '', 'has_serial_no' : item.has_serial_no, 'has_batch_no' : item.has_batch_no, 'sample_quantity' : item.sample_quantity }) - for d in [["Account", "expense_account", "default_expense_account"], - ["Cost Center", "cost_center", "cost_center"]]: - company = frappe.db.get_value(d[0], ret.get(d[1]), "company") - if not ret[d[1]] or (company and self.company != company): - ret[d[1]] = frappe.get_cached_value('Company', self.company, d[2]) if d[2] else None # update uom if args.get("uom") and for_update: ret.update(get_uom_details(args.get('item_code'), args.get('uom'), args.get('qty'))) - if not ret["expense_account"]: - ret["expense_account"] = frappe.get_cached_value('Company', self.company, "stock_adjustment_account") + if self.purpose == 'Material Issue': + ret["expense_account"] = (item.get("expense_account") or + item_group_defaults.get("expense_account") or + frappe.get_cached_value('Company', self.company, "default_expense_account")) + + for company_field, field in {'stock_adjustment_account': 'expense_account', + 'cost_center': 'cost_center'}.items(): + if not ret.get(field): + ret[field] = frappe.get_cached_value('Company', self.company, company_field) args['posting_date'] = self.posting_date args['posting_time'] = self.posting_time @@ -1084,8 +1085,7 @@ class StockEntry(StockController): return item_dict def add_to_stock_entry_detail(self, item_dict, bom_no=None): - expense_account, cost_center = frappe.db.get_values("Company", self.company, \ - ["default_expense_account", "cost_center"])[0] + cost_center = frappe.db.get_value("Company", self.company, 'cost_center') for d in item_dict: stock_uom = item_dict[d].get("stock_uom") or frappe.db.get_value("Item", d, "stock_uom") @@ -1099,7 +1099,7 @@ class StockEntry(StockController): se_child.uom = item_dict[d]["uom"] if item_dict[d].get("uom") else stock_uom se_child.stock_uom = stock_uom se_child.qty = flt(item_dict[d]["qty"], se_child.precision("qty")) - se_child.expense_account = item_dict[d].get("expense_account") or expense_account + se_child.expense_account = item_dict[d].get("expense_account") se_child.cost_center = item_dict[d].get("cost_center") or cost_center se_child.allow_alternative_item = item_dict[d].get("allow_alternative_item", 0) se_child.subcontracted_item = item_dict[d].get("main_item_code") diff --git a/erpnext/stock/get_item_details.py b/erpnext/stock/get_item_details.py index f694af8481..59fd9231d5 100644 --- a/erpnext/stock/get_item_details.py +++ b/erpnext/stock/get_item_details.py @@ -414,7 +414,7 @@ def get_default_deferred_account(args, item, fieldname=None): else: return None -def get_default_cost_center(args, item, item_group, brand): +def get_default_cost_center(args, item, item_group, brand, company=None): cost_center = None if args.get('project'): cost_center = frappe.db.get_value("Project", args.get("project"), "cost_center", cache=True) @@ -425,7 +425,13 @@ def get_default_cost_center(args, item, item_group, brand): else: cost_center = item.get('buying_cost_center') or item_group.get('buying_cost_center') or brand.get('buying_cost_center') - return cost_center or args.get("cost_center") + cost_center = cost_center or args.get("cost_center") + + if (company and cost_center + and frappe.get_cached_value("Cost Center", cost_center, "company") != company): + return None + + return cost_center def get_default_supplier(args, item, item_group, brand): return (item.get("default_supplier") From 9510e69910a14a829e676011b5fdcf7b5f96d7ae Mon Sep 17 00:00:00 2001 From: Shivam Mishra Date: Mon, 10 Jun 2019 10:53:25 +0530 Subject: [PATCH 13/69] fix (lms): null cards visible on xs --- erpnext/www/lms/macros/card.html | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/erpnext/www/lms/macros/card.html b/erpnext/www/lms/macros/card.html index 9964d2df34..076061d41b 100644 --- a/erpnext/www/lms/macros/card.html +++ b/erpnext/www/lms/macros/card.html @@ -28,7 +28,7 @@ {% macro null_card() %}
-
+
{% endmacro %} \ No newline at end of file From b9102bba48ee879c795da5d982814c63a3c0dc00 Mon Sep 17 00:00:00 2001 From: Deepesh Garg <42651287+deepeshgarg007@users.noreply.github.com> Date: Mon, 10 Jun 2019 17:39:23 +0530 Subject: [PATCH 14/69] fix: GSTR-1 Report fixes (#17885) --- erpnext/regional/report/gstr_1/gstr_1.py | 20 ++++++++++++-------- 1 file changed, 12 insertions(+), 8 deletions(-) diff --git a/erpnext/regional/report/gstr_1/gstr_1.py b/erpnext/regional/report/gstr_1/gstr_1.py index 5aa2441ee6..a6de94a9da 100644 --- a/erpnext/regional/report/gstr_1/gstr_1.py +++ b/erpnext/regional/report/gstr_1/gstr_1.py @@ -60,8 +60,11 @@ class Gstr1Report(object): else: for inv, items_based_on_rate in self.items_based_on_tax_rate.items(): invoice_details = self.invoices.get(inv) - for rate, items in items_based_on_rate.items(): - row, taxable_value = self.get_row_data_for_invoice(inv, invoice_details, rate, items) + for key, items in items_based_on_rate.items(): + rate = key[0] + account = key[1] + + row, taxable_value = self.get_row_data_for_invoice(inv, invoice_details, rate, account, items) if self.filters.get("type_of_business") == "CDNR": row.append("Y" if invoice_details.posting_date <= date(2017, 7, 1) else "N") @@ -100,7 +103,7 @@ class Gstr1Report(object): for key, value in iteritems(b2cs_output): self.data.append(value) - def get_row_data_for_invoice(self, invoice, invoice_details, tax_rate, items): + def get_row_data_for_invoice(self, invoice, invoice_details, tax_rate, account, items): row = [] for fieldname in self.invoice_fields: if self.filters.get("type_of_business") == "CDNR" and fieldname == "invoice_value": @@ -117,8 +120,10 @@ class Gstr1Report(object): taxable_value = 0 for item_code, net_amount in self.invoice_items.get(invoice).items(): if item_code in items: - if self.item_tax_rate.get(invoice) and tax_rate == self.item_tax_rate.get(invoice, {}).get(item_code): - taxable_value += abs(net_amount) + if self.item_tax_rate.get(invoice) and self.item_tax_rate.get(invoice, {}).get(item_code): + item_tax_rate = self.item_tax_rate.get(invoice, {}).get(item_code) + if account in item_tax_rate and tax_rate == item_tax_rate.get(account): + taxable_value += abs(net_amount) elif not self.item_tax_rate.get(invoice): taxable_value += abs(net_amount) @@ -207,8 +212,7 @@ class Gstr1Report(object): item_tax_rate = json.loads(d.item_tax_rate) if item_tax_rate: - for account, rate in item_tax_rate.items(): - self.item_tax_rate.setdefault(d.parent, {}).setdefault(d.item_code, rate) + self.item_tax_rate.setdefault(d.parent, {}).setdefault(d.item_code, item_tax_rate) def get_items_based_on_tax_rate(self): self.tax_details = frappe.db.sql(""" @@ -248,7 +252,7 @@ class Gstr1Report(object): tax_rate *= 2 rate_based_dict = self.items_based_on_tax_rate\ - .setdefault(parent, {}).setdefault(tax_rate, []) + .setdefault(parent, {}).setdefault((tax_rate, account), []) if item_code not in rate_based_dict: rate_based_dict.append(item_code) except ValueError: From 3720126ee9e6153adc39528391926a1926ba065c Mon Sep 17 00:00:00 2001 From: sahil28297 <37302950+sahil28297@users.noreply.github.com> Date: Mon, 10 Jun 2019 17:39:42 +0530 Subject: [PATCH 15/69] fix(patch): escape illegal characters to avoid SQL syntax error (#17890) --- erpnext/patches/v11_0/update_total_qty_field.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/erpnext/patches/v11_0/update_total_qty_field.py b/erpnext/patches/v11_0/update_total_qty_field.py index 992454ac7c..51358e9545 100644 --- a/erpnext/patches/v11_0/update_total_qty_field.py +++ b/erpnext/patches/v11_0/update_total_qty_field.py @@ -40,7 +40,7 @@ def execute(): # This is probably never used anywhere else as of now, but should be values = [] for d in batch_transactions: - values.append("('{}', {})".format(d.parent, d.qty)) + values.append("('{}', {})".format(frappe.db.escape(d.parent), d.qty)) conditions = ",".join(values) frappe.db.sql(""" INSERT INTO `tab{}` (name, total_qty) VALUES {} From ebeafa55ca8ac4636159f3c2669ce8ef724068e6 Mon Sep 17 00:00:00 2001 From: Deepesh Garg <42651287+deepeshgarg007@users.noreply.github.com> Date: Mon, 10 Jun 2019 17:42:52 +0530 Subject: [PATCH 16/69] fix: Total Amount fix in journal entry (#17880) --- erpnext/accounts/doctype/journal_entry/journal_entry.py | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/erpnext/accounts/doctype/journal_entry/journal_entry.py b/erpnext/accounts/doctype/journal_entry/journal_entry.py index 26fbc23b4c..d082b60211 100644 --- a/erpnext/accounts/doctype/journal_entry/journal_entry.py +++ b/erpnext/accounts/doctype/journal_entry/journal_entry.py @@ -458,8 +458,9 @@ class JournalEntry(AccountsController): pay_to_recd_from = frappe.db.get_value(d.party_type, d.party, "customer_name" if d.party_type=="Customer" else "supplier_name") - party_amount += (d.debit_in_account_currency or d.credit_in_account_currency) - party_account_currency = d.account_currency + if pay_to_recd_from and pay_to_recd_from == d.party: + party_amount += (d.debit_in_account_currency or d.credit_in_account_currency) + party_account_currency = d.account_currency elif frappe.db.get_value("Account", d.account, "account_type") in ["Bank", "Cash"]: bank_amount += (d.debit_in_account_currency or d.credit_in_account_currency) From 30f7e7be87bb6ab998ff0986bd5fd8133eec1efc Mon Sep 17 00:00:00 2001 From: deepeshgarg007 Date: Mon, 10 Jun 2019 17:33:36 +0530 Subject: [PATCH 17/69] fix: Available qty not shown in item batch selector for batch --- .../js/utils/serial_no_batch_selector.js | 60 ++++++++++--------- 1 file changed, 31 insertions(+), 29 deletions(-) diff --git a/erpnext/public/js/utils/serial_no_batch_selector.js b/erpnext/public/js/utils/serial_no_batch_selector.js index a28d42b567..76aa6dc745 100644 --- a/erpnext/public/js/utils/serial_no_batch_selector.js +++ b/erpnext/public/js/utils/serial_no_batch_selector.js @@ -268,26 +268,27 @@ erpnext.SerialNoBatchSelector = Class.extend({ {fieldname: 'batches', fieldtype: 'Table', label: __('Batch Entries'), fields: [ { - fieldtype:'Link', - fieldname:'batch_no', - options: 'Batch', - label: __('Select Batch'), - in_list_view:1, - get_query: function() { + 'fieldtype': 'Link', + 'read_only': 0, + 'fieldname': 'batch_no', + 'options': 'Batch', + 'label': __('Select Batch'), + 'in_list_view': 1, + get_query: function () { return { - filters: {item: me.item_code }, - query: 'erpnext.controllers.queries.get_batch_numbers' - }; + filters: { item: me.item_code }, + query: 'erpnext.controllers.queries.get_batch_numbers' + }; }, - onchange: function(e) { + change: function (e) { let val = this.get_value(); - if(val.length === 0) { + if (val.length === 0) { this.grid_row.on_grid_fields_dict .available_qty.set_value(0); return; } let selected_batches = this.grid.grid_rows.map((row) => { - if(row === this.grid_row) { + if (row === this.grid_row) { return ""; } @@ -295,12 +296,12 @@ erpnext.SerialNoBatchSelector = Class.extend({ return row.on_grid_fields_dict.batch_no.get_value(); } }); - if(selected_batches.includes(val)) { + if (selected_batches.includes(val)) { this.set_value(""); frappe.throw(__(`Batch ${val} already selected.`)); return; } - if(me.warehouse_details.name) { + if (me.warehouse_details.name) { frappe.call({ method: 'erpnext.stock.doctype.batch.batch.get_batch_qty', args: { @@ -323,31 +324,32 @@ erpnext.SerialNoBatchSelector = Class.extend({ } }, { - fieldtype:'Float', - read_only:1, - fieldname:'available_qty', - label: __('Available'), - in_list_view:1, - default: 0, - onchange: function() { + 'fieldtype': 'Float', + 'read_only': 1, + 'fieldname': 'available_qty', + 'label': __('Available'), + 'in_list_view': 1, + 'default': 0, + change: function () { this.grid_row.on_grid_fields_dict.selected_qty.set_value('0'); } }, { - fieldtype:'Float', - fieldname:'selected_qty', - label: __('Qty'), - in_list_view:1, + 'fieldtype': 'Float', + 'read_only': 0, + 'fieldname': 'selected_qty', + 'label': __('Qty'), + 'in_list_view': 1, 'default': 0, - onchange: function(e) { + change: function (e) { var batch_no = this.grid_row.on_grid_fields_dict.batch_no.get_value(); var available_qty = this.grid_row.on_grid_fields_dict.available_qty.get_value(); var selected_qty = this.grid_row.on_grid_fields_dict.selected_qty.get_value(); - if(batch_no.length === 0 && parseInt(selected_qty)!==0) { + if (batch_no.length === 0 && parseInt(selected_qty) !== 0) { frappe.throw(__("Please select a batch")); } - if(me.warehouse_details.type === 'Source Warehouse' && + if (me.warehouse_details.type === 'Source Warehouse' && parseFloat(available_qty) < parseFloat(selected_qty)) { this.set_value('0'); @@ -363,7 +365,7 @@ erpnext.SerialNoBatchSelector = Class.extend({ ], in_place_edit: true, data: this.data, - get_data: function() { + get_data: function () { return this.data; }, } From 92978298046dcbe399f8c1544372473bea51ca5e Mon Sep 17 00:00:00 2001 From: deepeshgarg007 Date: Mon, 10 Jun 2019 17:50:52 +0530 Subject: [PATCH 18/69] fix: Codacy --- erpnext/public/js/utils/serial_no_batch_selector.js | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/erpnext/public/js/utils/serial_no_batch_selector.js b/erpnext/public/js/utils/serial_no_batch_selector.js index 76aa6dc745..7da747856a 100644 --- a/erpnext/public/js/utils/serial_no_batch_selector.js +++ b/erpnext/public/js/utils/serial_no_batch_selector.js @@ -280,7 +280,7 @@ erpnext.SerialNoBatchSelector = Class.extend({ query: 'erpnext.controllers.queries.get_batch_numbers' }; }, - change: function (e) { + change: function () { let val = this.get_value(); if (val.length === 0) { this.grid_row.on_grid_fields_dict @@ -341,7 +341,7 @@ erpnext.SerialNoBatchSelector = Class.extend({ 'label': __('Qty'), 'in_list_view': 1, 'default': 0, - change: function (e) { + change: function () { var batch_no = this.grid_row.on_grid_fields_dict.batch_no.get_value(); var available_qty = this.grid_row.on_grid_fields_dict.available_qty.get_value(); var selected_qty = this.grid_row.on_grid_fields_dict.selected_qty.get_value(); From 5f41a3333bd6c6b0c64e8711edfa74b9ff038e76 Mon Sep 17 00:00:00 2001 From: Rohit Waghchaure Date: Mon, 10 Jun 2019 17:21:34 +0530 Subject: [PATCH 19/69] fix: accounts receivable for PDC not showing 120 days column --- .../accounts_receivable.html | 18 +++++++++++++++--- 1 file changed, 15 insertions(+), 3 deletions(-) diff --git a/erpnext/accounts/report/accounts_receivable/accounts_receivable.html b/erpnext/accounts/report/accounts_receivable/accounts_receivable.html index d7aa0c0d19..192b6d7be3 100644 --- a/erpnext/accounts/report/accounts_receivable/accounts_receivable.html +++ b/erpnext/accounts/report/accounts_receivable/accounts_receivable.html @@ -46,6 +46,8 @@ var range2 = report.columns[12].label; var range3 = report.columns[13].label; var range4 = report.columns[14].label; + var range5 = report.columns[15].label; + var range6 = report.columns[16].label; %} {% if(balance_row) { %} @@ -56,8 +58,10 @@ - - + + + + @@ -67,16 +71,20 @@ + + - + + + @@ -86,6 +94,8 @@ + + @@ -95,6 +105,8 @@ + + From ef5dd879281975c7f9a7f5ceb31a03283d9503d4 Mon Sep 17 00:00:00 2001 From: Rohit Waghchaure Date: Mon, 10 Jun 2019 18:31:41 +0530 Subject: [PATCH 20/69] fix: debit and credit showing in the same row if the group by is set as group by voucher (consolidated) --- erpnext/accounts/report/general_ledger/general_ledger.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/erpnext/accounts/report/general_ledger/general_ledger.py b/erpnext/accounts/report/general_ledger/general_ledger.py index 492df4bbb6..307b72d4e8 100644 --- a/erpnext/accounts/report/general_ledger/general_ledger.py +++ b/erpnext/accounts/report/general_ledger/general_ledger.py @@ -128,7 +128,7 @@ def get_gl_entries(filters): order_by_statement = "order by posting_date, voucher_type, voucher_no" if filters.get("group_by") == _("Group by Voucher (Consolidated)"): - group_by_statement = "group by voucher_type, voucher_no, account, cost_center" + group_by_statement = "group by voucher_type, voucher_no, account, cost_center, against_voucher" select_fields = """, sum(debit) as debit, sum(credit) as credit, sum(debit_in_account_currency) as debit_in_account_currency, sum(credit_in_account_currency) as credit_in_account_currency""" From 9e0ce99615f588e8f73f80338fdf3e922f8b58c4 Mon Sep 17 00:00:00 2001 From: Nikita Sobolev Date: Mon, 10 Jun 2019 20:19:40 +0300 Subject: [PATCH 21/69] Improves README.md with svg badge --- README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/README.md b/README.md index 4d468be107..cf3804f830 100644 --- a/README.md +++ b/README.md @@ -5,7 +5,7 @@

ERP made simple

-[![Build Status](https://travis-ci.com/frappe/erpnext.png)](https://travis-ci.com/frappe/erpnext) +[![Build Status](https://travis-ci.com/frappe/erpnext.svg)](https://travis-ci.com/frappe/erpnext) [![Open Source Helpers](https://www.codetriage.com/frappe/erpnext/badges/users.svg)](https://www.codetriage.com/frappe/erpnext) [![Coverage Status](https://coveralls.io/repos/github/frappe/erpnext/badge.svg?branch=develop)](https://coveralls.io/github/frappe/erpnext?branch=develop) From acae7a903b5fcf4309c6da07bda63cbcd14260db Mon Sep 17 00:00:00 2001 From: Anurag Mishra Date: Tue, 11 Jun 2019 11:12:28 +0530 Subject: [PATCH 22/69] fix: requested changes --- erpnext/accounts/report/financial_statements.html | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/erpnext/accounts/report/financial_statements.html b/erpnext/accounts/report/financial_statements.html index 1087c28b81..4081723bf0 100644 --- a/erpnext/accounts/report/financial_statements.html +++ b/erpnext/accounts/report/financial_statements.html @@ -23,7 +23,9 @@ {% } %}

{%= __(report.report_name) %}

{%= filters.company %}

-

{%= filters.cost_center %}

+{% if 'cost_center' in filters %} +

{%= filters.cost_center %}

+{% endif %}

{%= filters.fiscal_year %}

{%= __("Currency") %} : {%= filters.presentation_currency || erpnext.get_currency(filters.company) %}
{% if (filters.from_date) { %} From 44ac3580d9e696dcd3d5037180248bbc135b0645 Mon Sep 17 00:00:00 2001 From: deepeshgarg007 Date: Tue, 11 Jun 2019 18:35:01 +0530 Subject: [PATCH 23/69] fix: Fix breaking patch on develop branch --- erpnext/patches/v11_0/update_total_qty_field.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/erpnext/patches/v11_0/update_total_qty_field.py b/erpnext/patches/v11_0/update_total_qty_field.py index 51358e9545..9407256acf 100644 --- a/erpnext/patches/v11_0/update_total_qty_field.py +++ b/erpnext/patches/v11_0/update_total_qty_field.py @@ -40,7 +40,7 @@ def execute(): # This is probably never used anywhere else as of now, but should be values = [] for d in batch_transactions: - values.append("('{}', {})".format(frappe.db.escape(d.parent), d.qty)) + values.append("({0}, {1})".format(frappe.db.escape(d.parent), d.qty)) conditions = ",".join(values) frappe.db.sql(""" INSERT INTO `tab{}` (name, total_qty) VALUES {} From add002bb0f3983fca70877a5249cf50154583f3e Mon Sep 17 00:00:00 2001 From: Kenneth Sequeira <33246109+kennethsequeira@users.noreply.github.com> Date: Wed, 12 Jun 2019 12:25:48 +0530 Subject: [PATCH 24/69] fix: Make Travel Request Document Submittable (#17874) * make travel request submittable * add patch * remove patch --- erpnext/hr/doctype/travel_request/travel_request.json | 10 ++++++++++ erpnext/patches.txt | 2 +- 2 files changed, 11 insertions(+), 1 deletion(-) diff --git a/erpnext/hr/doctype/travel_request/travel_request.json b/erpnext/hr/doctype/travel_request/travel_request.json index 31dfe96734..c1c6524af3 100644 --- a/erpnext/hr/doctype/travel_request/travel_request.json +++ b/erpnext/hr/doctype/travel_request/travel_request.json @@ -192,6 +192,15 @@ "fieldtype": "Text", "label": "Other Details" }, + { + "fieldname": "amended_from", + "fieldtype": "Link", + "label": "Amended From", + "no_copy": 1, + "options": "Travel Request", + "print_hide": 1, + "read_only": 1 + }, { "collapsible": 1, "fieldname": "accounting_dimensions_section", @@ -203,6 +212,7 @@ "fieldtype": "Column Break" } ], + "is_submittable": 1, "modified": "2019-05-25 23:15:00.609186", "modified_by": "Administrator", "module": "HR", diff --git a/erpnext/patches.txt b/erpnext/patches.txt index 56c51b102c..15fd82ea72 100644 --- a/erpnext/patches.txt +++ b/erpnext/patches.txt @@ -604,4 +604,4 @@ execute:frappe.delete_doc("Report", "Inactive Items") erpnext.patches.v11_1.delete_scheduling_tool erpnext.patches.v12_0.make_custom_fields_for_bank_remittance execute:frappe.delete_doc_if_exists("Page", "support-analytics") -erpnext.patches.v12_0.make_item_manufacturer +erpnext.patches.v12_0.make_item_manufacturer \ No newline at end of file From a9508862b2ed69a3cb93328245b03dd2535d5201 Mon Sep 17 00:00:00 2001 From: Shivam Mishra Date: Wed, 12 Jun 2019 12:39:12 +0530 Subject: [PATCH 25/69] refactor: doctype settings for lms --- .../education/doctype/article/article.json | 175 ++---------------- erpnext/education/doctype/course/course.json | 38 +--- .../education/doctype/program/program.json | 52 +++--- erpnext/education/doctype/quiz/quiz.json | 4 +- .../doctype/quiz_question/quiz_question.json | 138 ++++---------- erpnext/education/doctype/topic/topic.json | 26 +-- erpnext/education/doctype/video/video.json | 20 +- 7 files changed, 103 insertions(+), 350 deletions(-) diff --git a/erpnext/education/doctype/article/article.json b/erpnext/education/doctype/article/article.json index c30cd189d6..2fad5af8d3 100644 --- a/erpnext/education/doctype/article/article.json +++ b/erpnext/education/doctype/article/article.json @@ -1,230 +1,81 @@ { - "allow_copy": 0, - "allow_events_in_timeline": 0, - "allow_guest_to_view": 0, "allow_import": 1, - "allow_rename": 0, + "allow_rename": 1, "autoname": "field:title", - "beta": 0, "creation": "2018-10-17 05:45:38.471670", - "custom": 0, - "docstatus": 0, "doctype": "DocType", - "document_type": "", "editable_grid": 1, "engine": "InnoDB", + "field_order": [ + "title", + "author", + "content", + "publish_date" + ], "fields": [ { - "allow_bulk_edit": 0, - "allow_in_quick_entry": 0, - "allow_on_submit": 0, - "bold": 0, - "collapsible": 0, - "columns": 0, "fieldname": "title", "fieldtype": "Data", - "hidden": 0, - "ignore_user_permissions": 0, - "ignore_xss_filter": 0, - "in_filter": 0, - "in_global_search": 0, - "in_list_view": 0, - "in_standard_filter": 0, "label": "Title", - "length": 0, - "no_copy": 0, - "permlevel": 0, - "precision": "", - "print_hide": 0, - "print_hide_if_no_value": 0, - "read_only": 0, - "remember_last_selected_value": 0, - "report_hide": 0, - "reqd": 0, - "search_index": 0, - "set_only_once": 0, - "translatable": 0, "unique": 1 }, { - "allow_bulk_edit": 0, - "allow_in_quick_entry": 0, - "allow_on_submit": 0, - "bold": 0, - "collapsible": 0, - "columns": 0, "fieldname": "author", "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": "Author", - "length": 0, - "no_copy": 0, - "permlevel": 0, - "precision": "", - "print_hide": 0, - "print_hide_if_no_value": 0, - "read_only": 0, - "remember_last_selected_value": 0, - "report_hide": 0, - "reqd": 0, - "search_index": 0, - "set_only_once": 0, - "translatable": 0, - "unique": 0 + "label": "Author" }, { - "allow_bulk_edit": 0, - "allow_in_quick_entry": 0, - "allow_on_submit": 0, - "bold": 0, - "collapsible": 0, - "columns": 0, "fieldname": "content", "fieldtype": "Text Editor", - "hidden": 0, - "ignore_user_permissions": 0, - "ignore_xss_filter": 0, - "in_filter": 0, - "in_global_search": 0, - "in_list_view": 0, - "in_standard_filter": 0, - "label": "Content", - "length": 0, - "no_copy": 0, - "permlevel": 0, - "precision": "", - "print_hide": 0, - "print_hide_if_no_value": 0, - "read_only": 0, - "remember_last_selected_value": 0, - "report_hide": 0, - "reqd": 0, - "search_index": 0, - "set_only_once": 0, - "translatable": 0, - "unique": 0 + "label": "Content" }, { - "allow_bulk_edit": 0, - "allow_in_quick_entry": 0, - "allow_on_submit": 0, - "bold": 0, - "collapsible": 0, - "columns": 0, "fieldname": "publish_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": "Publish Date", - "length": 0, - "no_copy": 0, - "permlevel": 0, - "precision": "", - "print_hide": 0, - "print_hide_if_no_value": 0, - "read_only": 0, - "remember_last_selected_value": 0, - "report_hide": 0, - "reqd": 0, - "search_index": 0, - "set_only_once": 0, - "translatable": 0, - "unique": 0 + "label": "Publish Date" } ], - "has_web_view": 0, - "hide_heading": 0, - "hide_toolbar": 0, - "idx": 0, - "image_view": 0, - "in_create": 0, - "is_submittable": 0, - "issingle": 0, - "istable": 0, - "max_attachments": 0, - "modified": "2018-11-25 19:06:56.016865", + "modified": "2019-06-12 12:36:58.740340", "modified_by": "Administrator", "module": "Education", "name": "Article", - "name_case": "", "owner": "Administrator", "permissions": [ { - "amend": 0, - "cancel": 0, "create": 1, "delete": 1, "email": 1, "export": 1, - "if_owner": 0, - "import": 0, - "permlevel": 0, "print": 1, "read": 1, "report": 1, "role": "Academics User", - "set_user_permissions": 0, "share": 1, - "submit": 0, "write": 1 }, { - "amend": 0, - "cancel": 0, "create": 1, "delete": 1, "email": 1, "export": 1, - "if_owner": 0, - "import": 0, - "permlevel": 0, "print": 1, "read": 1, "report": 1, "role": "Instructor", - "set_user_permissions": 0, "share": 1, - "submit": 0, "write": 1 }, { - "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": "LMS User", - "set_user_permissions": 0, - "share": 1, - "submit": 0, - "write": 0 + "share": 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, - "track_views": 0 + "track_changes": 1 } \ No newline at end of file diff --git a/erpnext/education/doctype/course/course.json b/erpnext/education/doctype/course/course.json index 7d8b07397e..68426c36be 100644 --- a/erpnext/education/doctype/course/course.json +++ b/erpnext/education/doctype/course/course.json @@ -1,17 +1,13 @@ { "allow_import": 1, "allow_rename": 1, - "autoname": "field:course_code", + "autoname": "field:course_name", "creation": "2015-09-07 12:39:55.181893", "doctype": "DocType", "engine": "InnoDB", "field_order": [ "course_name", "department", - "parent_course", - "column_break_3", - "course_code", - "course_abbreviation", "section_break_6", "topics", "description", @@ -26,7 +22,8 @@ "fieldtype": "Data", "in_list_view": 1, "label": "Course Name", - "reqd": 1 + "reqd": 1, + "unique": 1 }, { "fieldname": "department", @@ -36,31 +33,10 @@ "label": "Department", "options": "Department" }, - { - "fieldname": "parent_course", - "fieldtype": "Data", - "label": "Parent Course (Leave blank, if this isn't part of Parent Course)" - }, - { - "fieldname": "column_break_3", - "fieldtype": "Column Break" - }, - { - "fieldname": "course_code", - "fieldtype": "Data", - "label": "Course Code", - "reqd": 1, - "unique": 1 - }, - { - "fieldname": "course_abbreviation", - "fieldtype": "Data", - "in_list_view": 1, - "label": "Course Abbreviation" - }, { "fieldname": "section_break_6", - "fieldtype": "Section Break" + "fieldtype": "Section Break", + "label": "Portal Settings" }, { "fieldname": "topics", @@ -71,6 +47,7 @@ { "fieldname": "hero_image", "fieldtype": "Attach Image", + "hidden": 1, "label": "Hero Image" }, { @@ -96,7 +73,8 @@ "label": "Description" } ], - "modified": "2019-06-05 18:39:11.870605", + "image_field": "hero_image", + "modified": "2019-06-12 12:34:23.748157", "modified_by": "Administrator", "module": "Education", "name": "Course", diff --git a/erpnext/education/doctype/program/program.json b/erpnext/education/doctype/program/program.json index a0a2aa2e2b..2dfe50b2f0 100644 --- a/erpnext/education/doctype/program/program.json +++ b/erpnext/education/doctype/program/program.json @@ -1,7 +1,7 @@ { "allow_import": 1, "allow_rename": 1, - "autoname": "field:program_code", + "autoname": "field:program_name", "creation": "2015-09-07 12:54:03.609282", "doctype": "DocType", "engine": "InnoDB", @@ -9,18 +9,17 @@ "program_name", "department", "column_break_3", - "program_code", "program_abbreviation", - "section_break_5", + "section_break_courses", "courses", - "section_break_9", - "description", + "section_break_5", + "is_published", + "allow_self_enroll", + "is_featured", + "column_break_11", "intro_video", "hero_image", - "column_break_11", - "is_published", - "is_featured", - "allow_self_enroll" + "description" ], "fields": [ { @@ -28,7 +27,8 @@ "fieldtype": "Data", "in_list_view": 1, "label": "Program Name", - "reqd": 1 + "reqd": 1, + "unique": 1 }, { "fieldname": "department", @@ -42,13 +42,6 @@ "fieldname": "column_break_3", "fieldtype": "Column Break" }, - { - "fieldname": "program_code", - "fieldtype": "Data", - "label": "Program Code", - "reqd": 1, - "unique": 1 - }, { "fieldname": "program_abbreviation", "fieldtype": "Data", @@ -67,16 +60,13 @@ "options": "Program Course" }, { - "fieldname": "section_break_9", - "fieldtype": "Section Break", - "label": "LMS Settings" - }, - { + "depends_on": "is_published", "fieldname": "description", "fieldtype": "Small Text", "label": "Description" }, { + "depends_on": "is_published", "fieldname": "intro_video", "fieldtype": "Data", "label": "Intro Video" @@ -84,12 +74,9 @@ { "fieldname": "hero_image", "fieldtype": "Attach Image", + "hidden": 1, "label": "Hero Image" }, - { - "fieldname": "column_break_11", - "fieldtype": "Column Break" - }, { "default": "0", "fieldname": "is_published", @@ -106,13 +93,22 @@ { "default": "0", "depends_on": "eval: doc.is_published == 1", - "description": "Allow students to enroll themselves from the portal", "fieldname": "allow_self_enroll", "fieldtype": "Check", "label": "Allow Self Enroll" + }, + { + "fieldname": "section_break_courses", + "fieldtype": "Section Break", + "label": "Courses" + }, + { + "fieldname": "column_break_11", + "fieldtype": "Column Break" } ], - "modified": "2019-06-05 17:47:26.877296", + "image_field": "hero_image", + "modified": "2019-06-12 12:31:14.999346", "modified_by": "Administrator", "module": "Education", "name": "Program", diff --git a/erpnext/education/doctype/quiz/quiz.json b/erpnext/education/doctype/quiz/quiz.json index b4903fc285..569c281f4c 100644 --- a/erpnext/education/doctype/quiz/quiz.json +++ b/erpnext/education/doctype/quiz/quiz.json @@ -1,4 +1,6 @@ { + "allow_import": 1, + "allow_rename": 1, "autoname": "field:title", "creation": "2018-10-17 05:52:50.149904", "doctype": "DocType", @@ -58,7 +60,7 @@ "options": "Latest Highest Score\nLatest Attempt" } ], - "modified": "2019-05-30 18:50:54.218571", + "modified": "2019-06-12 12:23:57.020508", "modified_by": "Administrator", "module": "Education", "name": "Quiz", diff --git a/erpnext/education/doctype/quiz_question/quiz_question.json b/erpnext/education/doctype/quiz_question/quiz_question.json index 3857c5ca8d..0564482516 100644 --- a/erpnext/education/doctype/quiz_question/quiz_question.json +++ b/erpnext/education/doctype/quiz_question/quiz_question.json @@ -1,110 +1,40 @@ { - "allow_copy": 0, - "allow_events_in_timeline": 0, - "allow_guest_to_view": 0, - "allow_import": 0, - "allow_rename": 0, - "beta": 0, - "creation": "2018-10-17 06:13:00.098883", - "custom": 0, - "docstatus": 0, - "doctype": "DocType", - "document_type": "", - "editable_grid": 1, - "engine": "InnoDB", + "allow_rename": 1, + "creation": "2018-10-17 06:13:00.098883", + "doctype": "DocType", + "editable_grid": 1, + "engine": "InnoDB", + "field_order": [ + "question_link", + "question" + ], "fields": [ { - "allow_bulk_edit": 0, - "allow_in_quick_entry": 0, - "allow_on_submit": 0, - "bold": 0, - "collapsible": 0, - "columns": 0, - "fieldname": "question_link", - "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": "Question Link", - "length": 0, - "no_copy": 0, - "options": "Question", - "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 - }, + "fieldname": "question_link", + "fieldtype": "Link", + "in_list_view": 1, + "label": "Question Link", + "options": "Question", + "reqd": 1 + }, { - "allow_bulk_edit": 0, - "allow_in_quick_entry": 0, - "allow_on_submit": 0, - "bold": 0, - "collapsible": 0, - "columns": 0, - "fetch_from": "question_link.question", - "fieldname": "question", - "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": "Question", - "length": 0, - "no_copy": 0, - "options": "", - "permlevel": 0, - "precision": "", - "print_hide": 0, - "print_hide_if_no_value": 0, - "read_only": 1, - "remember_last_selected_value": 0, - "report_hide": 0, - "reqd": 0, - "search_index": 0, - "set_only_once": 0, - "translatable": 0, - "unique": 0 + "fetch_from": "question_link.question", + "fieldname": "question", + "fieldtype": "Data", + "in_list_view": 1, + "label": "Question", + "read_only": 1 } - ], - "has_web_view": 0, - "hide_heading": 0, - "hide_toolbar": 0, - "idx": 0, - "image_view": 0, - "in_create": 0, - "is_submittable": 0, - "issingle": 0, - "istable": 1, - "max_attachments": 0, - "modified": "2018-10-18 15:35:12.195250", - "modified_by": "Administrator", - "module": "Education", - "name": "Quiz Question", - "name_case": "", - "owner": "Administrator", - "permissions": [], - "quick_entry": 1, - "read_only": 0, - "read_only_onload": 0, - "show_name_in_global_search": 0, - "sort_field": "modified", - "sort_order": "DESC", - "track_changes": 1, - "track_seen": 0, - "track_views": 0 + ], + "istable": 1, + "modified": "2019-06-12 12:24:02.312577", + "modified_by": "Administrator", + "module": "Education", + "name": "Quiz Question", + "owner": "Administrator", + "permissions": [], + "quick_entry": 1, + "sort_field": "modified", + "sort_order": "DESC", + "track_changes": 1 } \ No newline at end of file diff --git a/erpnext/education/doctype/topic/topic.json b/erpnext/education/doctype/topic/topic.json index 6e748fddce..305458bf67 100644 --- a/erpnext/education/doctype/topic/topic.json +++ b/erpnext/education/doctype/topic/topic.json @@ -1,14 +1,13 @@ { - "autoname": "field:topic_code", + "allow_import": 1, + "allow_rename": 1, + "autoname": "field:topic_name", "creation": "2018-12-12 11:37:39.917760", "doctype": "DocType", "editable_grid": 1, "engine": "InnoDB", "field_order": [ "topic_name", - "column_break_2", - "topic_code", - "section_break_4", "topic_content", "description", "hero_image" @@ -19,24 +18,9 @@ "fieldtype": "Data", "in_list_view": 1, "label": "Name", - "reqd": 1 - }, - { - "fieldname": "column_break_2", - "fieldtype": "Column Break" - }, - { - "fieldname": "topic_code", - "fieldtype": "Data", - "in_list_view": 1, - "label": "Code", "reqd": 1, "unique": 1 }, - { - "fieldname": "section_break_4", - "fieldtype": "Section Break" - }, { "fieldname": "topic_content", "fieldtype": "Table", @@ -46,6 +30,7 @@ { "fieldname": "hero_image", "fieldtype": "Attach Image", + "hidden": 1, "label": "Hero Image" }, { @@ -54,7 +39,8 @@ "label": "Description" } ], - "modified": "2019-06-05 18:38:44.029711", + "image_field": "hero_image", + "modified": "2019-06-12 12:34:49.911300", "modified_by": "Administrator", "module": "Education", "name": "Topic", diff --git a/erpnext/education/doctype/video/video.json b/erpnext/education/doctype/video/video.json index 3d11bd256f..e912eb32cb 100644 --- a/erpnext/education/doctype/video/video.json +++ b/erpnext/education/doctype/video/video.json @@ -1,5 +1,6 @@ { "allow_import": 1, + "allow_rename": 1, "autoname": "field:title", "creation": "2018-10-17 05:47:13.087395", "doctype": "DocType", @@ -7,11 +8,13 @@ "engine": "InnoDB", "field_order": [ "title", - "description", - "duration", "provider", "url", - "publish_date" + "column_break_4", + "publish_date", + "duration", + "section_break_7", + "description" ], "fields": [ { @@ -53,9 +56,17 @@ "label": "Provider", "options": "YouTube\nVimeo", "reqd": 1 + }, + { + "fieldname": "column_break_4", + "fieldtype": "Column Break" + }, + { + "fieldname": "section_break_7", + "fieldtype": "Section Break" } ], - "modified": "2019-05-20 15:11:53.075093", + "modified": "2019-06-12 12:36:48.753092", "modified_by": "Administrator", "module": "Education", "name": "Video", @@ -95,7 +106,6 @@ "share": 1 } ], - "quick_entry": 1, "sort_field": "modified", "sort_order": "DESC", "track_changes": 1 From d9e68c9f69c8a3c67b537be2248cd3593aa7e089 Mon Sep 17 00:00:00 2001 From: Shivam Mishra Date: Wed, 12 Jun 2019 12:43:22 +0530 Subject: [PATCH 26/69] refactor: remove course name field from ProgramCourse --- .../program_course/program_course.json | 196 +++--------------- 1 file changed, 33 insertions(+), 163 deletions(-) diff --git a/erpnext/education/doctype/program_course/program_course.json b/erpnext/education/doctype/program_course/program_course.json index 79ef7173bc..3465040415 100644 --- a/erpnext/education/doctype/program_course/program_course.json +++ b/erpnext/education/doctype/program_course/program_course.json @@ -1,169 +1,39 @@ { - "allow_copy": 0, - "allow_guest_to_view": 0, - "allow_import": 0, - "allow_rename": 0, - "beta": 0, - "creation": "2015-09-07 14:37:01.886859", - "custom": 0, - "docstatus": 0, - "doctype": "DocType", - "document_type": "", - "editable_grid": 1, - "engine": "InnoDB", + "creation": "2015-09-07 14:37:01.886859", + "doctype": "DocType", + "editable_grid": 1, + "engine": "InnoDB", + "field_order": [ + "course", + "required" + ], "fields": [ { - "allow_bulk_edit": 0, - "allow_on_submit": 0, - "bold": 0, - "collapsible": 0, - "columns": 0, - "fieldname": "course", - "fieldtype": "Link", - "hidden": 0, - "ignore_user_permissions": 0, - "ignore_xss_filter": 0, - "in_filter": 0, - "in_global_search": 1, - "in_list_view": 1, - "in_standard_filter": 0, - "label": "Course", - "length": 0, - "no_copy": 0, - "options": "Course", - "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 - }, + "fieldname": "course", + "fieldtype": "Link", + "in_global_search": 1, + "in_list_view": 1, + "label": "Course", + "options": "Course", + "reqd": 1 + }, { - "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, - "fetch_from": "course.course_name", - "fieldname": "course_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": "Course Name", - "length": 0, - "no_copy": 0, - "options": "", - "permlevel": 0, - "precision": "", - "print_hide": 0, - "print_hide_if_no_value": 0, - "read_only": 1, - "remember_last_selected_value": 0, - "report_hide": 0, - "reqd": 0, - "search_index": 0, - "set_only_once": 0, - "translatable": 0, - "unique": 0 - }, - { - "allow_bulk_edit": 0, - "allow_on_submit": 0, - "bold": 0, - "collapsible": 0, - "columns": 0, - "fieldname": "required", - "fieldtype": "Check", - "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": "Mandatory", - "length": 0, - "no_copy": 0, - "permlevel": 0, - "precision": "", - "print_hide": 0, - "print_hide_if_no_value": 0, - "read_only": 0, - "remember_last_selected_value": 0, - "report_hide": 0, - "reqd": 0, - "search_index": 0, - "set_only_once": 0, - "translatable": 0, - "unique": 0 + "default": "0", + "fieldname": "required", + "fieldtype": "Check", + "in_list_view": 1, + "label": "Mandatory" } - ], - "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, - "menu_index": 0, - "modified": "2018-05-16 22:42:58.326734", - "modified_by": "Administrator", - "module": "Education", - "name": "Program Course", - "name_case": "", - "owner": "Administrator", - "permissions": [], - "quick_entry": 0, - "read_only": 0, - "read_only_onload": 0, - "restrict_to_domain": "Education", - "show_name_in_global_search": 0, - "sort_field": "modified", - "sort_order": "DESC", - "track_changes": 1, - "track_seen": 0 + ], + "istable": 1, + "modified": "2019-06-12 12:42:12.845972", + "modified_by": "Administrator", + "module": "Education", + "name": "Program Course", + "owner": "Administrator", + "permissions": [], + "restrict_to_domain": "Education", + "sort_field": "modified", + "sort_order": "DESC", + "track_changes": 1 } \ No newline at end of file From 8df7e1c21514c5d5df1706b2f7656403c4b23630 Mon Sep 17 00:00:00 2001 From: Shivam Mishra Date: Wed, 12 Jun 2019 12:50:38 +0530 Subject: [PATCH 27/69] fix: templates for cards --- erpnext/www/lms/course.html | 2 +- erpnext/www/lms/index.html | 2 +- erpnext/www/lms/program.html | 2 +- erpnext/www/lms/topic.html | 6 +++--- 4 files changed, 6 insertions(+), 6 deletions(-) diff --git a/erpnext/www/lms/course.html b/erpnext/www/lms/course.html index f8618e08ec..250c39d498 100644 --- a/erpnext/www/lms/course.html +++ b/erpnext/www/lms/course.html @@ -96,7 +96,7 @@ {{ card(topic) }} {% endfor %} {% if topics %} - {% for n in range(3 - ((topics|length)%3)) %} + {% for n in range(((topics|length)%3)) %} {{ null_card() }} {% endfor %} {% endif %} diff --git a/erpnext/www/lms/index.html b/erpnext/www/lms/index.html index 3e107ac608..0114235370 100644 --- a/erpnext/www/lms/index.html +++ b/erpnext/www/lms/index.html @@ -55,7 +55,7 @@ {{ program_card(program.program, program.has_access) }} {% endfor %} {% if featured_programs %} - {% for n in range(3 - ((featured_programs|length)%3)) %} + {% for n in range((featured_programs|length)%3) %} {{ null_card() }} {% endfor %} {% endif %} diff --git a/erpnext/www/lms/program.html b/erpnext/www/lms/program.html index b6d696653b..6c144d4641 100644 --- a/erpnext/www/lms/program.html +++ b/erpnext/www/lms/program.html @@ -77,7 +77,7 @@ {{ card(course) }} {% endfor %} {% if courses %} - {% for n in range(3 - ((courses|length)%3)) %} + {% for n in range((courses|length)%3) %} {{ null_card() }} {% endfor %} {% endif %} diff --git a/erpnext/www/lms/topic.html b/erpnext/www/lms/topic.html index 3bbfbd0936..3e439fca23 100644 --- a/erpnext/www/lms/topic.html +++ b/erpnext/www/lms/topic.html @@ -1,5 +1,5 @@ {% extends "templates/base.html" %} -{% block title %}Topic Title{% endblock %} +{% block title %}{{ topic.name }}{% endblock %} {% from "www/lms/macros/hero.html" import hero %} {% from "www/lms/macros/card.html" import null_card %} @@ -13,7 +13,7 @@ {% macro card(content, index, length) %} -
+
@@ -48,7 +48,7 @@ {{ card(content, loop.index, topic.contents|length) }} {% endfor %} {% if contents %} - {% for n in range(3 - ((contents|length)%3)) %} + {% for n in range((contents|length)%3) %} {{ null_card() }} {% endfor %} {% endif %} From a99d3a844f1194c6a6f7ac12f0df4103c74f5b60 Mon Sep 17 00:00:00 2001 From: Shivam Mishra Date: Wed, 12 Jun 2019 14:32:27 +0530 Subject: [PATCH 28/69] test: fix fixtures for program and course --- erpnext/education/doctype/course/test_records.json | 9 +++------ erpnext/education/doctype/program/test_records.json | 6 ++---- 2 files changed, 5 insertions(+), 10 deletions(-) diff --git a/erpnext/education/doctype/course/test_records.json b/erpnext/education/doctype/course/test_records.json index ec57dc73a1..1e7467aed2 100644 --- a/erpnext/education/doctype/course/test_records.json +++ b/erpnext/education/doctype/course/test_records.json @@ -1,17 +1,14 @@ [ { - "course_name": "_Test Course", - "course_code": "TC100", + "course_name": "TC100", "course_abbreviation": "TC" }, { - "course_name": "_Test Course 1", - "course_code": "TC101", + "course_name": "TC101", "course_abbreviation": "TC1" }, { - "course_name": "_Test Course 2", - "course_code": "TC102", + "course_name": "TC102", "course_abbreviation": "TC2" } ] \ No newline at end of file diff --git a/erpnext/education/doctype/program/test_records.json b/erpnext/education/doctype/program/test_records.json index 7901db3225..4013695896 100644 --- a/erpnext/education/doctype/program/test_records.json +++ b/erpnext/education/doctype/program/test_records.json @@ -1,13 +1,11 @@ [ { - "program_name": "_Test Program 1", - "program_code": "_TP1", + "program_name": "_TP1", "description": "Test Description", "program_abbreviation": "TP1" }, { - "program_name": "_Test Program 2", - "program_code": "_TP2", + "program_name": "_TP2", "description": "Test Description", "program_abbreviation": "TP2" } From 278ef4bf732d339d904082da0ecd7dc0da2e18ee Mon Sep 17 00:00:00 2001 From: Shivam Mishra Date: Wed, 12 Jun 2019 14:53:00 +0530 Subject: [PATCH 29/69] fix: template fix for null_card --- erpnext/www/lms/course.html | 2 +- erpnext/www/lms/index.html | 2 +- erpnext/www/lms/program.html | 2 +- erpnext/www/lms/topic.html | 2 +- 4 files changed, 4 insertions(+), 4 deletions(-) diff --git a/erpnext/www/lms/course.html b/erpnext/www/lms/course.html index 250c39d498..c86ac9c11f 100644 --- a/erpnext/www/lms/course.html +++ b/erpnext/www/lms/course.html @@ -96,7 +96,7 @@ {{ card(topic) }} {% endfor %} {% if topics %} - {% for n in range(((topics|length)%3)) %} + {% for n in range( (3 - (topics|length)) %3) %} {{ null_card() }} {% endfor %} {% endif %} diff --git a/erpnext/www/lms/index.html b/erpnext/www/lms/index.html index 0114235370..ffb4419f36 100644 --- a/erpnext/www/lms/index.html +++ b/erpnext/www/lms/index.html @@ -55,7 +55,7 @@ {{ program_card(program.program, program.has_access) }} {% endfor %} {% if featured_programs %} - {% for n in range((featured_programs|length)%3) %} + {% for n in range( (3 - (featured_programs|length)) %3) %} {{ null_card() }} {% endfor %} {% endif %} diff --git a/erpnext/www/lms/program.html b/erpnext/www/lms/program.html index 6c144d4641..271b7813bb 100644 --- a/erpnext/www/lms/program.html +++ b/erpnext/www/lms/program.html @@ -77,7 +77,7 @@ {{ card(course) }} {% endfor %} {% if courses %} - {% for n in range((courses|length)%3) %} + {% for n in range( (3 - (courses|length)) %3) %} {{ null_card() }} {% endfor %} {% endif %} diff --git a/erpnext/www/lms/topic.html b/erpnext/www/lms/topic.html index 3e439fca23..1f0d187664 100644 --- a/erpnext/www/lms/topic.html +++ b/erpnext/www/lms/topic.html @@ -48,7 +48,7 @@ {{ card(content, loop.index, topic.contents|length) }} {% endfor %} {% if contents %} - {% for n in range((contents|length)%3) %} + {% for n in range( (3 - (contents|length)) %3) %} {{ null_card() }} {% endfor %} {% endif %} From 8af1e87e838be79a803cbfea117e6ff1ec31bdd4 Mon Sep 17 00:00:00 2001 From: Shivam Mishra Date: Wed, 12 Jun 2019 15:16:26 +0530 Subject: [PATCH 30/69] fix: card imqge not visible for courses --- erpnext/www/lms/course.html | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/erpnext/www/lms/course.html b/erpnext/www/lms/course.html index c86ac9c11f..7f7a31128a 100644 --- a/erpnext/www/lms/course.html +++ b/erpnext/www/lms/course.html @@ -45,7 +45,7 @@
{% endif %} {% if topic.hero_image %} -
+
{% else %}
From 44f98a9a4beab52a0ab112028dbcc66c2c40da66 Mon Sep 17 00:00:00 2001 From: Shivam Mishra Date: Wed, 12 Jun 2019 15:22:42 +0530 Subject: [PATCH 31/69] fix: back to course button --- erpnext/www/lms/content.html | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/erpnext/www/lms/content.html b/erpnext/www/lms/content.html index 9b8c45cb9b..5607c0814d 100644 --- a/erpnext/www/lms/content.html +++ b/erpnext/www/lms/content.html @@ -58,7 +58,7 @@ {% macro title() %}
From 3264822c1c4eead89f6824fb853ca67222c72765 Mon Sep 17 00:00:00 2001 From: Shivam Mishra Date: Wed, 12 Jun 2019 15:43:36 +0530 Subject: [PATCH 32/69] test: fixed unknown column course_name --- .../education/doctype/program_enrollment/program_enrollment.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/erpnext/education/doctype/program_enrollment/program_enrollment.py b/erpnext/education/doctype/program_enrollment/program_enrollment.py index d232e47245..d5348ffd06 100644 --- a/erpnext/education/doctype/program_enrollment/program_enrollment.py +++ b/erpnext/education/doctype/program_enrollment/program_enrollment.py @@ -66,7 +66,7 @@ class ProgramEnrollment(Document): msgprint(_("Fee Records Created - {0}").format(comma_and(fee_list))) def get_courses(self): - return frappe.db.sql('''select course, course_name from `tabProgram Course` where parent = %s and required = 1''', (self.program), as_dict=1) + return frappe.db.sql('''select course from `tabProgram Course` where parent = %s and required = 1''', (self.program), as_dict=1) def create_course_enrollments(self): student = frappe.get_doc("Student", self.student) From 147d5d9bf2128291d46fa539e81d3f4e8d8c178b Mon Sep 17 00:00:00 2001 From: Shivam Mishra Date: Wed, 12 Jun 2019 16:01:02 +0530 Subject: [PATCH 33/69] fix: redirect to lms home if query params not set --- erpnext/www/lms/course.py | 11 +++++++++-- erpnext/www/lms/program.py | 10 ++++++++-- erpnext/www/lms/topic.py | 10 +++++++--- 3 files changed, 24 insertions(+), 7 deletions(-) diff --git a/erpnext/www/lms/course.py b/erpnext/www/lms/course.py index e7ed2e3ed6..c18d64e507 100644 --- a/erpnext/www/lms/course.py +++ b/erpnext/www/lms/course.py @@ -5,9 +5,16 @@ import frappe no_cache = 1 def get_context(context): + try: + program = frappe.form_dict['program'] + course_name = frappe.form_dict['name'] + except KeyError: + frappe.local.flags.redirect_location = '/lms' + raise frappe.Redirect + context.education_settings = frappe.get_single("Education Settings") - course = frappe.get_doc('Course', frappe.form_dict['name']) - context.program = frappe.form_dict['program'] + course = frappe.get_doc('Course', course_name) + context.program = program context.course = course context.topics = course.get_topics() diff --git a/erpnext/www/lms/program.py b/erpnext/www/lms/program.py index 1fcb3d3028..7badedcc85 100644 --- a/erpnext/www/lms/program.py +++ b/erpnext/www/lms/program.py @@ -6,10 +6,16 @@ from frappe import _ no_cache = 1 def get_context(context): + try: + program = frappe.form_dict['program'] + except KeyError: + frappe.local.flags.redirect_location = '/lms' + raise frappe.Redirect + context.education_settings = frappe.get_single("Education Settings") - context.program = get_program(frappe.form_dict['program']) + context.program = get_program(program) context.courses = [frappe.get_doc("Course", course.course) for course in context.program.courses] - context.has_access = utils.allowed_program_access(frappe.form_dict['program']) + context.has_access = utils.allowed_program_access(program) context.progress = get_course_progress(context.courses, context.program) def get_program(program_name): diff --git a/erpnext/www/lms/topic.py b/erpnext/www/lms/topic.py index 0af0778312..f75ae8e9b6 100644 --- a/erpnext/www/lms/topic.py +++ b/erpnext/www/lms/topic.py @@ -5,9 +5,13 @@ import frappe no_cache = 1 def get_context(context): - course = frappe.form_dict['course'] - program = frappe.form_dict['program'] - topic = frappe.form_dict['topic'] + try: + course = frappe.form_dict['course'] + program = frappe.form_dict['program'] + topic = frappe.form_dict['topic'] + except KeyError: + frappe.local.flags.redirect_location = '/lms' + raise frappe.Redirect context.program = program context.course = course From b94b1febee7181594e64f58e79f1c72cf6f6d8b7 Mon Sep 17 00:00:00 2001 From: Shivam Mishra Date: Wed, 12 Jun 2019 17:20:33 +0530 Subject: [PATCH 34/69] refactor: topic card redirects to login --- erpnext/www/lms/course.html | 23 ++--------------------- 1 file changed, 2 insertions(+), 21 deletions(-) diff --git a/erpnext/www/lms/course.html b/erpnext/www/lms/course.html index 7f7a31128a..f2fd9363e8 100644 --- a/erpnext/www/lms/course.html +++ b/erpnext/www/lms/course.html @@ -42,7 +42,7 @@ {% if has_access %} {% else %} - {% else %} -
+ {% endif %}
@@ -103,23 +103,4 @@
-{% endblock %} - -{% block script %} - {% endblock %} \ No newline at end of file From bbe2c4fb012cecdba71bf83d1871916a1a291469 Mon Sep 17 00:00:00 2001 From: Anurag Mishra Date: Wed, 12 Jun 2019 19:09:51 +0530 Subject: [PATCH 35/69] fix: fetch item on the base of item group --- erpnext/controllers/queries.py | 3 +++ erpnext/stock/report/stock_balance/stock_balance.js | 5 ++++- 2 files changed, 7 insertions(+), 1 deletion(-) diff --git a/erpnext/controllers/queries.py b/erpnext/controllers/queries.py index 22846693d1..0ff329b128 100644 --- a/erpnext/controllers/queries.py +++ b/erpnext/controllers/queries.py @@ -152,6 +152,9 @@ def tax_account_query(doctype, txt, searchfield, start, page_len, filters): def item_query(doctype, txt, searchfield, start, page_len, filters, as_dict=False): conditions = [] + if not filters["item_group"]: + filters.pop("item_group", None) + description_cond = '' if frappe.db.count('Item', cache=True) < 50000: # scan description only if items are less than 50000 diff --git a/erpnext/stock/report/stock_balance/stock_balance.js b/erpnext/stock/report/stock_balance/stock_balance.js index 07e5f4b3d7..120f879f20 100644 --- a/erpnext/stock/report/stock_balance/stock_balance.js +++ b/erpnext/stock/report/stock_balance/stock_balance.js @@ -40,7 +40,10 @@ frappe.query_reports["Stock Balance"] = { "options": "Item", "get_query": function() { return { - query: "erpnext.controllers.queries.item_query" + query: "erpnext.controllers.queries.item_query", + filters: { + "item_group": frappe.query_report.get_filter_value("item_group") + } } } }, From 02ae934d5c00c738847b291aa8d9b52eae902512 Mon Sep 17 00:00:00 2001 From: Rohit Waghchaure Date: Thu, 13 Jun 2019 11:58:38 +0530 Subject: [PATCH 36/69] feat: added cost center in the opening invoice creation tool --- .../opening_invoice_creation_tool.js | 21 + .../opening_invoice_creation_tool.json | 302 +++--------- .../opening_invoice_creation_tool.py | 5 +- .../opening_invoice_creation_tool_item.json | 456 ++++-------------- 4 files changed, 190 insertions(+), 594 deletions(-) diff --git a/erpnext/accounts/doctype/opening_invoice_creation_tool/opening_invoice_creation_tool.js b/erpnext/accounts/doctype/opening_invoice_creation_tool/opening_invoice_creation_tool.js index c742e64f1e..4d8da37efe 100644 --- a/erpnext/accounts/doctype/opening_invoice_creation_tool/opening_invoice_creation_tool.js +++ b/erpnext/accounts/doctype/opening_invoice_creation_tool/opening_invoice_creation_tool.js @@ -10,6 +10,22 @@ frappe.ui.form.on('Opening Invoice Creation Tool', { } }; }); + + frm.set_query('cost_center', 'invoices', function(doc, cdt, cdn) { + return { + filters: { + 'company': doc.company + } + }; + }); + + frm.set_query('cost_center', function(doc) { + return { + filters: { + 'company': doc.company + } + }; + }); }, refresh: function(frm) { @@ -84,6 +100,11 @@ frappe.ui.form.on('Opening Invoice Creation Tool', { if (!row.temporary_opening_account) { row.temporary_opening_account = frm.doc.__onload.temporary_opening_account; } + + if(!row.cost_center) { + row.cost_center = frm.doc.cost_center; + } + row.party_type = frm.doc.invoice_type == "Sales"? "Customer": "Supplier"; }); } diff --git a/erpnext/accounts/doctype/opening_invoice_creation_tool/opening_invoice_creation_tool.json b/erpnext/accounts/doctype/opening_invoice_creation_tool/opening_invoice_creation_tool.json index dca07fff1d..7d2d5a11a8 100644 --- a/erpnext/accounts/doctype/opening_invoice_creation_tool/opening_invoice_creation_tool.json +++ b/erpnext/accounts/doctype/opening_invoice_creation_tool/opening_invoice_creation_tool.json @@ -1,244 +1,86 @@ { - "allow_copy": 1, - "allow_guest_to_view": 0, - "allow_import": 0, - "allow_rename": 0, - "beta": 1, - "creation": "2017-08-29 02:22:54.947711", - "custom": 0, - "docstatus": 0, - "doctype": "DocType", - "document_type": "", - "editable_grid": 1, - "engine": "InnoDB", + "allow_copy": 1, + "beta": 1, + "creation": "2017-08-29 02:22:54.947711", + "doctype": "DocType", + "editable_grid": 1, + "engine": "InnoDB", + "field_order": [ + "company", + "create_missing_party", + "column_break_3", + "invoice_type", + "cost_center", + "section_break_4", + "invoices" + ], "fields": [ { - "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": 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, - "unique": 0 - }, + "fieldname": "company", + "fieldtype": "Link", + "in_list_view": 1, + "label": "Company", + "options": "Company", + "reqd": 1 + }, { - "allow_bulk_edit": 0, - "allow_on_submit": 0, - "bold": 0, - "collapsible": 0, - "columns": 0, - "description": "Create missing customer or supplier.", - "fieldname": "create_missing_party", - "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 Missing Party", - "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 - }, + "default": "0", + "description": "Create missing customer or supplier.", + "fieldname": "create_missing_party", + "fieldtype": "Check", + "label": "Create Missing Party" + }, { - "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, - "unique": 0 - }, + "fieldname": "column_break_3", + "fieldtype": "Column Break" + }, { - "allow_bulk_edit": 0, - "allow_on_submit": 0, - "bold": 0, - "collapsible": 0, - "columns": 0, - "fieldname": "invoice_type", - "fieldtype": "Select", - "hidden": 0, - "ignore_user_permissions": 0, - "ignore_xss_filter": 0, - "in_filter": 0, - "in_global_search": 0, - "in_list_view": 1, - "in_standard_filter": 0, - "label": "Invoice Type", - "length": 0, - "no_copy": 0, - "options": "Sales\nPurchase", - "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, - "unique": 0 - }, + "fieldname": "invoice_type", + "fieldtype": "Select", + "in_list_view": 1, + "label": "Invoice Type", + "options": "Sales\nPurchase", + "reqd": 1 + }, { - "allow_bulk_edit": 0, - "allow_on_submit": 0, - "bold": 0, - "collapsible": 0, - "columns": 0, - "fieldname": "section_break_4", - "fieldtype": "Section Break", - "hidden": 0, - "ignore_user_permissions": 0, - "ignore_xss_filter": 0, - "in_filter": 0, - "in_global_search": 0, - "in_list_view": 0, - "in_standard_filter": 0, - "label": "Invoices", - "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 - }, + "fieldname": "section_break_4", + "fieldtype": "Section Break", + "label": "Invoices" + }, { - "allow_bulk_edit": 1, - "allow_on_submit": 0, - "bold": 0, - "collapsible": 0, - "columns": 0, - "fieldname": "invoices", - "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, - "length": 0, - "no_copy": 0, - "options": "Opening Invoice Creation Tool Item", - "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, - "unique": 0 + "allow_bulk_edit": 1, + "fieldname": "invoices", + "fieldtype": "Table", + "options": "Opening Invoice Creation Tool Item", + "reqd": 1 + }, + { + "fieldname": "cost_center", + "fieldtype": "Link", + "label": "Cost Center", + "options": "Cost Center" } - ], - "has_web_view": 0, - "hide_heading": 0, - "hide_toolbar": 1, - "idx": 0, - "image_view": 0, - "in_create": 0, - "is_submittable": 0, - "issingle": 1, - "istable": 0, - "max_attachments": 0, - "modified": "2018-02-14 17:59:35.269118", - "modified_by": "Administrator", - "module": "Accounts", - "name": "Opening Invoice Creation Tool", - "name_case": "", - "owner": "Administrator", + ], + "hide_toolbar": 1, + "issingle": 1, + "modified": "2019-06-13 11:45:31.405267", + "modified_by": "Administrator", + "module": "Accounts", + "name": "Opening Invoice Creation Tool", + "owner": "Administrator", "permissions": [ { - "amend": 0, - "apply_user_permissions": 0, - "cancel": 0, - "create": 1, - "delete": 0, - "email": 1, - "export": 0, - "if_owner": 0, - "import": 0, - "permlevel": 0, - "print": 1, - "read": 1, - "report": 0, - "role": "System Manager", - "set_user_permissions": 0, - "share": 1, - "submit": 0, + "create": 1, + "email": 1, + "print": 1, + "read": 1, + "role": "System Manager", + "share": 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 + ], + "quick_entry": 1, + "sort_field": "modified", + "sort_order": "DESC", + "track_changes": 1 } \ No newline at end of file diff --git a/erpnext/accounts/doctype/opening_invoice_creation_tool/opening_invoice_creation_tool.py b/erpnext/accounts/doctype/opening_invoice_creation_tool/opening_invoice_creation_tool.py index b2c31ce377..5fa7b48c09 100644 --- a/erpnext/accounts/doctype/opening_invoice_creation_tool/opening_invoice_creation_tool.py +++ b/erpnext/accounts/doctype/opening_invoice_creation_tool/opening_invoice_creation_tool.py @@ -129,7 +129,9 @@ class OpeningInvoiceCreationTool(Document): def get_invoice_dict(self, row=None): def get_item_dict(): default_uom = frappe.db.get_single_value("Stock Settings", "stock_uom") or _("Nos") - cost_center = frappe.get_cached_value('Company', self.company, "cost_center") + cost_center = row.get('cost_center') or frappe.get_cached_value('Company', + self.company, "cost_center") + if not cost_center: frappe.throw( _("Please set the Default Cost Center in {0} company.").format(frappe.bold(self.company)) @@ -163,6 +165,7 @@ class OpeningInvoiceCreationTool(Document): "is_opening": "Yes", "set_posting_time": 1, "company": self.company, + "cost_center": self.cost_center, "due_date": row.due_date, "posting_date": row.posting_date, frappe.scrub(party_type): row.party, diff --git a/erpnext/accounts/doctype/opening_invoice_creation_tool_item/opening_invoice_creation_tool_item.json b/erpnext/accounts/doctype/opening_invoice_creation_tool_item/opening_invoice_creation_tool_item.json index 83dcffc57a..afa7229e53 100644 --- a/erpnext/accounts/doctype/opening_invoice_creation_tool_item/opening_invoice_creation_tool_item.json +++ b/erpnext/accounts/doctype/opening_invoice_creation_tool_item/opening_invoice_creation_tool_item.json @@ -1,378 +1,108 @@ { - "allow_copy": 0, - "allow_guest_to_view": 0, - "allow_import": 0, - "allow_rename": 0, - "beta": 0, - "creation": "2017-08-29 04:26:36.159247", - "custom": 0, - "docstatus": 0, - "doctype": "DocType", - "document_type": "", - "editable_grid": 1, - "engine": "InnoDB", + "creation": "2017-08-29 04:26:36.159247", + "doctype": "DocType", + "editable_grid": 1, + "engine": "InnoDB", + "field_order": [ + "party_type", + "party", + "temporary_opening_account", + "column_break_3", + "posting_date", + "due_date", + "section_break_5", + "item_name", + "outstanding_amount", + "column_break_4", + "qty", + "cost_center" + ], "fields": [ { - "allow_bulk_edit": 0, - "allow_on_submit": 0, - "bold": 0, - "collapsible": 0, - "columns": 0, - "fieldname": "party_type", - "fieldtype": "Link", - "hidden": 1, - "ignore_user_permissions": 0, - "ignore_xss_filter": 0, - "in_filter": 0, - "in_global_search": 0, - "in_list_view": 0, - "in_standard_filter": 0, - "label": "Party Type", - "length": 0, - "no_copy": 0, - "options": "DocType", - "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 - }, + "fieldname": "party_type", + "fieldtype": "Link", + "hidden": 1, + "label": "Party Type", + "options": "DocType", + "read_only": 1 + }, { - "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": 1, - "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": 1, - "search_index": 0, - "set_only_once": 0, - "unique": 0 - }, + "fieldname": "party", + "fieldtype": "Dynamic Link", + "in_list_view": 1, + "label": "Party", + "options": "party_type", + "reqd": 1 + }, { - "allow_bulk_edit": 0, - "allow_on_submit": 0, - "bold": 0, - "collapsible": 0, - "columns": 0, - "fieldname": "temporary_opening_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": "Temporary Opening 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, - "unique": 0 - }, + "fieldname": "temporary_opening_account", + "fieldtype": "Link", + "label": "Temporary Opening Account", + "options": "Account" + }, { - "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, - "unique": 0 - }, + "fieldname": "column_break_3", + "fieldtype": "Column Break" + }, { - "allow_bulk_edit": 0, - "allow_on_submit": 0, - "bold": 0, - "collapsible": 0, - "columns": 0, - "default": "Today", - "fieldname": "posting_date", - "fieldtype": "Date", - "hidden": 0, - "ignore_user_permissions": 0, - "ignore_xss_filter": 0, - "in_filter": 0, - "in_global_search": 0, - "in_list_view": 1, - "in_standard_filter": 0, - "label": "Posting Date", - "length": 0, - "no_copy": 0, - "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, - "unique": 0 - }, + "default": "Today", + "fieldname": "posting_date", + "fieldtype": "Date", + "in_list_view": 1, + "label": "Posting Date" + }, { - "allow_bulk_edit": 0, - "allow_on_submit": 0, - "bold": 0, - "collapsible": 0, - "columns": 0, - "default": "Today", - "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": 1, - "in_standard_filter": 0, - "label": "Due 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, - "unique": 0 - }, + "default": "Today", + "fieldname": "due_date", + "fieldtype": "Date", + "in_list_view": 1, + "label": "Due Date" + }, { - "allow_bulk_edit": 0, - "allow_on_submit": 0, - "bold": 0, - "collapsible": 0, - "columns": 0, - "fieldname": "section_break_5", - "fieldtype": "Section Break", - "hidden": 0, - "ignore_user_permissions": 0, - "ignore_xss_filter": 0, - "in_filter": 0, - "in_global_search": 0, - "in_list_view": 0, - "in_standard_filter": 0, - "length": 0, - "no_copy": 0, - "permlevel": 0, - "precision": "", - "print_hide": 0, - "print_hide_if_no_value": 0, - "read_only": 0, - "remember_last_selected_value": 0, - "report_hide": 0, - "reqd": 0, - "search_index": 0, - "set_only_once": 0, - "unique": 0 - }, + "fieldname": "section_break_5", + "fieldtype": "Section Break" + }, { - "allow_bulk_edit": 0, - "allow_on_submit": 0, - "bold": 0, - "collapsible": 0, - "columns": 0, - "default": "Opening Invoice Item", - "fieldname": "item_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": "Item Name", - "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, - "unique": 0 - }, + "default": "Opening Invoice Item", + "fieldname": "item_name", + "fieldtype": "Data", + "in_list_view": 1, + "label": "Item Name" + }, { - "allow_bulk_edit": 0, - "allow_on_submit": 0, - "bold": 0, - "collapsible": 0, - "columns": 0, - "default": "0", - "fieldname": "outstanding_amount", - "fieldtype": "Currency", - "hidden": 0, - "ignore_user_permissions": 0, - "ignore_xss_filter": 0, - "in_filter": 0, - "in_global_search": 0, - "in_list_view": 1, - "in_standard_filter": 0, - "label": "Outstanding 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": 1, - "search_index": 0, - "set_only_once": 0, - "unique": 0 - }, + "default": "0", + "fieldname": "outstanding_amount", + "fieldtype": "Currency", + "in_list_view": 1, + "label": "Outstanding Amount", + "reqd": 1 + }, { - "allow_bulk_edit": 0, - "allow_on_submit": 0, - "bold": 0, - "collapsible": 0, - "columns": 0, - "fieldname": "column_break_4", - "fieldtype": "Column Break", - "hidden": 0, - "ignore_user_permissions": 0, - "ignore_xss_filter": 0, - "in_filter": 0, - "in_global_search": 0, - "in_list_view": 0, - "in_standard_filter": 0, - "length": 0, - "no_copy": 0, - "permlevel": 0, - "precision": "", - "print_hide": 0, - "print_hide_if_no_value": 0, - "read_only": 0, - "remember_last_selected_value": 0, - "report_hide": 0, - "reqd": 0, - "search_index": 0, - "set_only_once": 0, - "unique": 0 - }, + "fieldname": "column_break_4", + "fieldtype": "Column Break" + }, { - "allow_bulk_edit": 0, - "allow_on_submit": 0, - "bold": 0, - "collapsible": 0, - "columns": 0, - "default": "1", - "fieldname": "qty", - "fieldtype": "Data", - "hidden": 0, - "ignore_user_permissions": 0, - "ignore_xss_filter": 0, - "in_filter": 0, - "in_global_search": 0, - "in_list_view": 0, - "in_standard_filter": 0, - "label": "Quantity", - "length": 0, - "no_copy": 0, - "permlevel": 0, - "precision": "", - "print_hide": 0, - "print_hide_if_no_value": 0, - "read_only": 0, - "remember_last_selected_value": 0, - "report_hide": 0, - "reqd": 0, - "search_index": 0, - "set_only_once": 0, - "unique": 0 + "default": "1", + "fieldname": "qty", + "fieldtype": "Data", + "label": "Quantity" + }, + { + "fieldname": "cost_center", + "fieldtype": "Link", + "label": "Cost Center", + "options": "Cost Center" } - ], - "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": "2017-12-19 05:07:01.549918", - "modified_by": "Administrator", - "module": "Accounts", - "name": "Opening Invoice Creation Tool Item", - "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 + ], + "istable": 1, + "modified": "2019-06-13 11:48:08.324063", + "modified_by": "Administrator", + "module": "Accounts", + "name": "Opening Invoice Creation Tool Item", + "owner": "Administrator", + "permissions": [], + "quick_entry": 1, + "sort_field": "modified", + "sort_order": "DESC", + "track_changes": 1 } \ No newline at end of file From 00578ba6329c3f4681b40cb12801bf085d8c2b45 Mon Sep 17 00:00:00 2001 From: Faris Ansari Date: Thu, 13 Jun 2019 13:30:39 +0530 Subject: [PATCH 37/69] fix: Show product page even if cart is not enabled --- erpnext/shopping_cart/product_info.py | 5 ++++- erpnext/templates/generators/item/item_details.html | 8 +++++++- 2 files changed, 11 insertions(+), 2 deletions(-) diff --git a/erpnext/shopping_cart/product_info.py b/erpnext/shopping_cart/product_info.py index f9a45ce578..d69b5e3a21 100644 --- a/erpnext/shopping_cart/product_info.py +++ b/erpnext/shopping_cart/product_info.py @@ -13,8 +13,11 @@ from erpnext.utilities.product import get_price, get_qty_in_stock def get_product_info_for_website(item_code): """get product price / stock info for website""" - cart_quotation = _get_cart_quotation() cart_settings = get_shopping_cart_settings() + if not cart_settings.enabled: + return frappe._dict() + + cart_quotation = _get_cart_quotation() price = get_price( item_code, diff --git a/erpnext/templates/generators/item/item_details.html b/erpnext/templates/generators/item/item_details.html index 4f8f8c21a5..8e560333ae 100644 --- a/erpnext/templates/generators/item/item_details.html +++ b/erpnext/templates/generators/item/item_details.html @@ -9,7 +9,13 @@

- {{ doc.web_long_description or doc.description or _("No description given") | safe }} +{% if frappe.utils.strip_html(doc.web_long_description) %} + {{ doc.web_long_description | safe }} +{% elif frappe.utils.strip_html(doc.description) %} + {{ doc.description | safe }} +{% else %} + {{ _("No description given") }} +{% endif %}
{% if has_variants %} From b2f266ad1016d59202e0b5ea9aa892260a1fbedd Mon Sep 17 00:00:00 2001 From: Mangesh-Khairnar Date: Thu, 13 Jun 2019 14:28:46 +0530 Subject: [PATCH 38/69] fix: get bom item when company is not passed --- erpnext/stock/doctype/material_request/material_request.js | 1 + 1 file changed, 1 insertion(+) diff --git a/erpnext/stock/doctype/material_request/material_request.js b/erpnext/stock/doctype/material_request/material_request.js index 893701bf16..5351f32186 100644 --- a/erpnext/stock/doctype/material_request/material_request.js +++ b/erpnext/stock/doctype/material_request/material_request.js @@ -192,6 +192,7 @@ frappe.ui.form.on('Material Request', { var values = d.get_values(); if(!values) return; values["company"] = frm.doc.company; + if(!frm.doc.company) frappe.throw(__("Company field is required")); frappe.call({ method: "erpnext.manufacturing.doctype.bom.bom.get_bom_items", args: values, From 033ed93586c7d8ffcef23484a91307626194406b Mon Sep 17 00:00:00 2001 From: Rohit Waghchaure Date: Thu, 13 Jun 2019 15:42:13 +0530 Subject: [PATCH 39/69] fix: taxes are not overriding after changing the taxes template --- erpnext/accounts/doctype/sales_invoice/sales_invoice.js | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/erpnext/accounts/doctype/sales_invoice/sales_invoice.js b/erpnext/accounts/doctype/sales_invoice/sales_invoice.js index f21fbd9794..07494a27d6 100644 --- a/erpnext/accounts/doctype/sales_invoice/sales_invoice.js +++ b/erpnext/accounts/doctype/sales_invoice/sales_invoice.js @@ -384,6 +384,10 @@ erpnext.accounts.SalesInvoiceController = erpnext.selling.SellingController.exte me.frm.pos_print_format = r.message.print_format; } me.frm.script_manager.trigger("update_stock"); + if(me.frm.doc.taxes_and_charges) { + me.frm.script_manager.trigger("taxes_and_charges"); + } + frappe.model.set_default_values(me.frm.doc); me.set_dynamic_labels(); me.calculate_taxes_and_totals(); From 05c17a505c7e21bf05a9a92bd606515d01a67649 Mon Sep 17 00:00:00 2001 From: Anurag Mishra Date: Thu, 13 Jun 2019 16:08:01 +0530 Subject: [PATCH 40/69] fix: column sequence and add total --- erpnext/projects/report/billing_summary.py | 16 +++---- .../employee_billing_summary.json | 42 +++++++++---------- .../project_billing_summary.json | 42 +++++++++---------- 3 files changed, 50 insertions(+), 50 deletions(-) diff --git a/erpnext/projects/report/billing_summary.py b/erpnext/projects/report/billing_summary.py index 929a13f668..76379f1de2 100644 --- a/erpnext/projects/report/billing_summary.py +++ b/erpnext/projects/report/billing_summary.py @@ -30,23 +30,23 @@ def get_columns(): "options": "Timesheet", "width": 150 }, - { - "label": _("Billable Hours"), - "fieldtype": "Float", - "fieldname": "total_billable_hours", - "width": 50 - }, { "label": _("Working Hours"), "fieldtype": "Float", "fieldname": "total_hours", - "width": 50 + "width": 150 + }, + { + "label": _("Billable Hours"), + "fieldtype": "Float", + "fieldname": "total_billable_hours", + "width": 150 }, { "label": _("Billing Amount"), "fieldtype": "Currency", "fieldname": "amount", - "width": 100 + "width": 150 } ] diff --git a/erpnext/projects/report/employee_billing_summary/employee_billing_summary.json b/erpnext/projects/report/employee_billing_summary/employee_billing_summary.json index 433ebac5dd..e5626a0206 100644 --- a/erpnext/projects/report/employee_billing_summary/employee_billing_summary.json +++ b/erpnext/projects/report/employee_billing_summary/employee_billing_summary.json @@ -1,34 +1,34 @@ { - "add_total_row": 0, - "creation": "2019-03-08 15:08:19.929728", - "disable_prepared_report": 0, - "disabled": 0, - "docstatus": 0, - "doctype": "Report", - "idx": 0, - "is_standard": "Yes", - "modified": "2019-03-08 15:08:19.929728", - "modified_by": "Administrator", - "module": "Projects", - "name": "Employee Billing Summary", - "owner": "Administrator", - "prepared_report": 0, - "ref_doctype": "Timesheet", - "report_name": "Employee Billing Summary", - "report_type": "Script Report", + "add_total_row": 1, + "creation": "2019-03-08 15:08:19.929728", + "disable_prepared_report": 0, + "disabled": 0, + "docstatus": 0, + "doctype": "Report", + "idx": 0, + "is_standard": "Yes", + "modified": "2019-06-13 15:54:49.213973", + "modified_by": "Administrator", + "module": "Projects", + "name": "Employee Billing Summary", + "owner": "Administrator", + "prepared_report": 0, + "ref_doctype": "Timesheet", + "report_name": "Employee Billing Summary", + "report_type": "Script Report", "roles": [ { "role": "Projects User" - }, + }, { "role": "HR User" - }, + }, { "role": "Manufacturing User" - }, + }, { "role": "Employee" - }, + }, { "role": "Accounts User" } diff --git a/erpnext/projects/report/project_billing_summary/project_billing_summary.json b/erpnext/projects/report/project_billing_summary/project_billing_summary.json index a3f91c802d..817d0cdb66 100644 --- a/erpnext/projects/report/project_billing_summary/project_billing_summary.json +++ b/erpnext/projects/report/project_billing_summary/project_billing_summary.json @@ -1,34 +1,34 @@ { - "add_total_row": 0, - "creation": "2019-03-11 16:22:39.460524", - "disable_prepared_report": 0, - "disabled": 0, - "docstatus": 0, - "doctype": "Report", - "idx": 0, - "is_standard": "Yes", - "modified": "2019-03-11 16:22:39.460524", - "modified_by": "Administrator", - "module": "Projects", - "name": "Project Billing Summary", - "owner": "Administrator", - "prepared_report": 0, - "ref_doctype": "Timesheet", - "report_name": "Project Billing Summary", - "report_type": "Script Report", + "add_total_row": 1, + "creation": "2019-03-11 16:22:39.460524", + "disable_prepared_report": 0, + "disabled": 0, + "docstatus": 0, + "doctype": "Report", + "idx": 0, + "is_standard": "Yes", + "modified": "2019-06-13 15:54:55.255947", + "modified_by": "Administrator", + "module": "Projects", + "name": "Project Billing Summary", + "owner": "Administrator", + "prepared_report": 0, + "ref_doctype": "Timesheet", + "report_name": "Project Billing Summary", + "report_type": "Script Report", "roles": [ { "role": "Projects User" - }, + }, { "role": "HR User" - }, + }, { "role": "Manufacturing User" - }, + }, { "role": "Employee" - }, + }, { "role": "Accounts User" } From a2caf884fe038e2a7e04e5b2275152b4a33d883d Mon Sep 17 00:00:00 2001 From: Nabin Hait Date: Thu, 13 Jun 2019 19:43:47 +0530 Subject: [PATCH 41/69] fix: salary slip amount calculation based on formula --- erpnext/hr/doctype/salary_slip/salary_slip.py | 2 ++ 1 file changed, 2 insertions(+) diff --git a/erpnext/hr/doctype/salary_slip/salary_slip.py b/erpnext/hr/doctype/salary_slip/salary_slip.py index 125a8ae27c..11eb696481 100644 --- a/erpnext/hr/doctype/salary_slip/salary_slip.py +++ b/erpnext/hr/doctype/salary_slip/salary_slip.py @@ -446,6 +446,8 @@ class SalarySlip(TransactionBase): if not overwrite: amount += component_row.default_amount + else: + component_row.default_amount = amount component_row.amount = amount component_row.deduct_full_tax_on_selected_payroll_date = struct_row.deduct_full_tax_on_selected_payroll_date From 88cd502841349d51d9bf1d83a757b6d63c697ce3 Mon Sep 17 00:00:00 2001 From: Anurag Mishra <32095923+Anurag810@users.noreply.github.com> Date: Fri, 14 Jun 2019 11:26:29 +0530 Subject: [PATCH 42/69] fix: company form (#17939) --- erpnext/setup/doctype/company/company.json | 2865 ++------------------ 1 file changed, 190 insertions(+), 2675 deletions(-) diff --git a/erpnext/setup/doctype/company/company.json b/erpnext/setup/doctype/company/company.json index 06779e0563..fcccf5a973 100644 --- a/erpnext/setup/doctype/company/company.json +++ b/erpnext/setup/doctype/company/company.json @@ -1,3244 +1,759 @@ { - "allow_copy": 0, - "allow_events_in_timeline": 0, - "allow_guest_to_view": 0, "allow_import": 1, "allow_rename": 1, "autoname": "field:company_name", - "beta": 0, "creation": "2013-04-10 08:35:39", - "custom": 0, "description": "Legal Entity / Subsidiary with a separate Chart of Accounts belonging to the Organization.", - "docstatus": 0, "doctype": "DocType", "document_type": "Setup", - "editable_grid": 0, "engine": "InnoDB", + "field_order": [ + "details", + "company_name", + "abbr", + "change_abbr", + "is_group", + "cb0", + "domain", + "parent_company", + "charts_section", + "default_currency", + "default_letter_head", + "default_holiday_list", + "default_finance_book", + "standard_working_hours", + "default_terms", + "column_break_10", + "country", + "create_chart_of_accounts_based_on", + "chart_of_accounts", + "existing_company", + "tax_id", + "date_of_establishment", + "sales_settings", + "monthly_sales_target", + "sales_monthly_history", + "column_break_goals", + "transactions_annual_history", + "total_monthly_sales", + "default_settings", + "default_bank_account", + "default_cash_account", + "default_receivable_account", + "round_off_account", + "round_off_cost_center", + "write_off_account", + "discount_allowed_account", + "discount_received_account", + "exchange_gain_loss_account", + "unrealized_exchange_gain_loss_account", + "column_break0", + "allow_account_creation_against_child_company", + "default_payable_account", + "default_employee_advance_account", + "default_expense_account", + "default_income_account", + "default_deferred_revenue_account", + "default_deferred_expense_account", + "default_payroll_payable_account", + "default_expense_claim_payable_account", + "section_break_22", + "cost_center", + "column_break_26", + "credit_limit", + "payment_terms", + "auto_accounting_for_stock_settings", + "enable_perpetual_inventory", + "default_inventory_account", + "stock_adjustment_account", + "column_break_32", + "stock_received_but_not_billed", + "expenses_included_in_valuation", + "fixed_asset_depreciation_settings", + "accumulated_depreciation_account", + "depreciation_expense_account", + "series_for_depreciation_entry", + "expenses_included_in_asset_valuation", + "column_break_40", + "disposal_account", + "depreciation_cost_center", + "capital_work_in_progress_account", + "asset_received_but_not_billed", + "budget_detail", + "exception_budget_approver_role", + "company_info", + "company_logo", + "date_of_incorporation", + "address_html", + "date_of_commencement", + "phone_no", + "fax", + "email", + "website", + "column_break1", + "company_description", + "registration_info", + "registration_details", + "delete_company_transactions", + "lft", + "rgt", + "old_parent" + ], "fields": [ { - "allow_bulk_edit": 0, - "allow_in_quick_entry": 0, - "allow_on_submit": 0, - "bold": 0, - "collapsible": 0, - "columns": 0, - "fetch_if_empty": 0, "fieldname": "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": "", - "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 + "oldfieldtype": "Section Break" }, { - "allow_bulk_edit": 0, - "allow_in_quick_entry": 0, - "allow_on_submit": 0, - "bold": 0, - "collapsible": 0, - "columns": 0, - "fetch_if_empty": 0, "fieldname": "company_name", "fieldtype": "Data", - "hidden": 0, - "ignore_user_permissions": 0, - "ignore_xss_filter": 0, - "in_filter": 0, - "in_global_search": 0, - "in_list_view": 0, - "in_standard_filter": 0, "label": "Company", - "length": 0, - "no_copy": 0, "oldfieldname": "company_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": 1 }, { - "allow_bulk_edit": 0, - "allow_in_quick_entry": 0, - "allow_on_submit": 0, - "bold": 0, - "collapsible": 0, - "columns": 0, - "description": "", - "fetch_if_empty": 0, "fieldname": "abbr", "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": "Abbr", - "length": 0, - "no_copy": 0, "oldfieldname": "abbr", "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 + "reqd": 1 }, { - "allow_bulk_edit": 0, - "allow_in_quick_entry": 0, - "allow_on_submit": 0, - "bold": 0, - "collapsible": 0, - "columns": 0, "depends_on": "eval:!doc.__islocal && in_list(frappe.user_roles, \"System Manager\")", - "fetch_if_empty": 0, "fieldname": "change_abbr", "fieldtype": "Button", - "hidden": 0, - "ignore_user_permissions": 0, - "ignore_xss_filter": 0, - "in_filter": 0, - "in_global_search": 0, - "in_list_view": 0, - "in_standard_filter": 0, - "label": "Change Abbreviation", - "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 + "label": "Change Abbreviation" }, { - "allow_bulk_edit": 0, - "allow_in_quick_entry": 0, - "allow_on_submit": 0, "bold": 1, - "collapsible": 0, - "columns": 0, - "fetch_if_empty": 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 + "label": "Is Group" }, { - "allow_bulk_edit": 0, - "allow_in_quick_entry": 0, - "allow_on_submit": 0, - "bold": 0, - "collapsible": 0, - "columns": 0, - "fetch_if_empty": 0, "fieldname": "default_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": "Default 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 + "options": "Finance Book" }, { - "allow_bulk_edit": 0, - "allow_in_quick_entry": 0, - "allow_on_submit": 0, - "bold": 0, - "collapsible": 0, - "columns": 0, - "fetch_if_empty": 0, "fieldname": "cb0", - "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 + "fieldtype": "Column Break" }, { - "allow_bulk_edit": 0, - "allow_in_quick_entry": 0, - "allow_on_submit": 0, - "bold": 0, - "collapsible": 0, - "columns": 0, - "fetch_if_empty": 0, "fieldname": "domain", "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": "Domain", - "length": 0, - "no_copy": 0, - "options": "Domain", - "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 + "options": "Domain" }, { - "allow_bulk_edit": 0, - "allow_in_quick_entry": 0, - "allow_on_submit": 0, - "bold": 0, - "collapsible": 0, - "columns": 0, - "fetch_if_empty": 0, "fieldname": "parent_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": "Parent 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": 0, - "search_index": 0, - "set_only_once": 0, - "translatable": 0, - "unique": 0 + "options": "Company" }, { - "allow_bulk_edit": 0, - "allow_in_quick_entry": 0, - "allow_on_submit": 0, - "bold": 0, - "collapsible": 0, - "columns": 0, - "fetch_if_empty": 0, - "fieldname": "sb_about", - "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": "About the Company", - "length": 0, - "no_copy": 0, - "permlevel": 0, - "precision": "", - "print_hide": 0, - "print_hide_if_no_value": 0, - "read_only": 0, - "remember_last_selected_value": 0, - "report_hide": 0, - "reqd": 0, - "search_index": 0, - "set_only_once": 0, - "translatable": 0, - "unique": 0 - }, - { - "allow_bulk_edit": 0, - "allow_in_quick_entry": 0, - "allow_on_submit": 0, - "bold": 0, - "collapsible": 0, - "columns": 0, - "fetch_if_empty": 0, "fieldname": "company_logo", "fieldtype": "Attach Image", - "hidden": 0, - "ignore_user_permissions": 0, - "ignore_xss_filter": 0, - "in_filter": 0, - "in_global_search": 0, - "in_list_view": 0, - "in_standard_filter": 0, - "label": "Company Logo", - "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 + "hidden": 1, + "label": "Company Logo" }, { - "allow_bulk_edit": 0, - "allow_in_quick_entry": 0, - "allow_on_submit": 0, - "bold": 0, - "collapsible": 0, - "columns": 0, - "fetch_if_empty": 0, "fieldname": "company_description", "fieldtype": "Text Editor", - "hidden": 0, - "ignore_user_permissions": 0, - "ignore_xss_filter": 0, - "in_filter": 0, - "in_global_search": 0, - "in_list_view": 0, - "in_standard_filter": 0, - "label": "Company Description", - "length": 0, - "no_copy": 0, - "permlevel": 0, - "precision": "", - "print_hide": 0, - "print_hide_if_no_value": 0, - "read_only": 0, - "remember_last_selected_value": 0, - "report_hide": 0, - "reqd": 0, - "search_index": 0, - "set_only_once": 0, - "translatable": 0, - "unique": 0 + "label": "Company Description" }, { - "allow_bulk_edit": 0, - "allow_in_quick_entry": 0, - "allow_on_submit": 0, - "bold": 0, - "collapsible": 0, - "columns": 0, - "fetch_if_empty": 0, "fieldname": "sales_settings", "fieldtype": "Section Break", - "hidden": 0, - "ignore_user_permissions": 0, - "ignore_xss_filter": 0, - "in_filter": 0, - "in_global_search": 0, - "in_list_view": 0, - "in_standard_filter": 0, - "label": "Sales", - "length": 0, - "no_copy": 0, - "permlevel": 0, - "precision": "", - "print_hide": 0, - "print_hide_if_no_value": 0, - "read_only": 0, - "remember_last_selected_value": 0, - "report_hide": 0, - "reqd": 0, - "search_index": 0, - "set_only_once": 0, - "translatable": 0, - "unique": 0 + "label": "Sales" }, { - "allow_bulk_edit": 0, - "allow_in_quick_entry": 0, - "allow_on_submit": 0, - "bold": 0, - "collapsible": 0, - "columns": 0, - "fetch_if_empty": 0, "fieldname": "sales_monthly_history", "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": "Sales Monthly History", - "length": 0, "no_copy": 1, - "permlevel": 0, - "precision": "", - "print_hide": 0, - "print_hide_if_no_value": 0, - "read_only": 1, - "remember_last_selected_value": 0, - "report_hide": 0, - "reqd": 0, - "search_index": 0, - "set_only_once": 0, - "translatable": 0, - "unique": 0 + "read_only": 1 }, { - "allow_bulk_edit": 0, - "allow_in_quick_entry": 0, - "allow_on_submit": 0, - "bold": 0, - "collapsible": 0, - "columns": 0, - "fetch_if_empty": 0, "fieldname": "transactions_annual_history", "fieldtype": "Code", "hidden": 1, - "ignore_user_permissions": 0, - "ignore_xss_filter": 0, - "in_filter": 0, - "in_global_search": 0, - "in_list_view": 0, - "in_standard_filter": 0, "label": "Transactions Annual History", - "length": 0, "no_copy": 1, - "permlevel": 0, - "precision": "", - "print_hide": 0, - "print_hide_if_no_value": 0, - "read_only": 1, - "remember_last_selected_value": 0, - "report_hide": 0, - "reqd": 0, - "search_index": 0, - "set_only_once": 0, - "translatable": 0, - "unique": 0 + "read_only": 1 }, { - "allow_bulk_edit": 0, - "allow_in_quick_entry": 0, - "allow_on_submit": 0, - "bold": 0, - "collapsible": 0, - "columns": 0, - "fetch_if_empty": 0, "fieldname": "monthly_sales_target", "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": "Monthly Sales Target", - "length": 0, - "no_copy": 0, - "options": "default_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 + "options": "default_currency" }, { - "allow_bulk_edit": 0, - "allow_in_quick_entry": 0, - "allow_on_submit": 0, - "bold": 0, - "collapsible": 0, - "columns": 0, - "fetch_if_empty": 0, "fieldname": "column_break_goals", - "fieldtype": "Column Break", - "hidden": 0, - "ignore_user_permissions": 0, - "ignore_xss_filter": 0, - "in_filter": 0, - "in_global_search": 0, - "in_list_view": 0, - "in_standard_filter": 0, - "length": 0, - "no_copy": 0, - "permlevel": 0, - "precision": "", - "print_hide": 0, - "print_hide_if_no_value": 0, - "read_only": 0, - "remember_last_selected_value": 0, - "report_hide": 0, - "reqd": 0, - "search_index": 0, - "set_only_once": 0, - "translatable": 0, - "unique": 0 + "fieldtype": "Column Break" }, { - "allow_bulk_edit": 0, - "allow_in_quick_entry": 0, - "allow_on_submit": 0, - "bold": 0, - "collapsible": 0, - "columns": 0, - "fetch_if_empty": 0, "fieldname": "total_monthly_sales", "fieldtype": "Currency", - "hidden": 0, - "ignore_user_permissions": 0, - "ignore_xss_filter": 0, - "in_filter": 0, - "in_global_search": 0, - "in_list_view": 0, - "in_standard_filter": 0, "label": "Total Monthly Sales", - "length": 0, "no_copy": 1, "options": "default_currency", - "permlevel": 0, - "precision": "", - "print_hide": 0, - "print_hide_if_no_value": 0, - "read_only": 1, - "remember_last_selected_value": 0, - "report_hide": 0, - "reqd": 0, - "search_index": 0, - "set_only_once": 0, - "translatable": 0, - "unique": 0 + "read_only": 1 }, { - "allow_bulk_edit": 0, - "allow_in_quick_entry": 0, - "allow_on_submit": 0, - "bold": 0, - "collapsible": 0, - "columns": 0, - "fetch_if_empty": 0, "fieldname": "charts_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": "Default Values", - "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 + "label": "Default Values" }, { - "allow_bulk_edit": 0, - "allow_in_quick_entry": 0, - "allow_on_submit": 0, - "bold": 0, - "collapsible": 0, - "columns": 0, - "fetch_if_empty": 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 + "reqd": 1 }, { - "allow_bulk_edit": 0, - "allow_in_quick_entry": 0, - "allow_on_submit": 0, - "bold": 0, - "collapsible": 0, - "columns": 0, - "fetch_if_empty": 0, "fieldname": "default_letter_head", "fieldtype": "Link", - "hidden": 0, - "ignore_user_permissions": 0, - "ignore_xss_filter": 0, - "in_filter": 0, - "in_global_search": 0, - "in_list_view": 0, - "in_standard_filter": 0, "label": "Default Letter Head", - "length": 0, - "no_copy": 0, - "options": "Letter Head", - "permlevel": 0, - "precision": "", - "print_hide": 0, - "print_hide_if_no_value": 0, - "read_only": 0, - "remember_last_selected_value": 0, - "report_hide": 0, - "reqd": 0, - "search_index": 0, - "set_only_once": 0, - "translatable": 0, - "unique": 0 + "options": "Letter Head" }, { - "allow_bulk_edit": 0, - "allow_in_quick_entry": 0, - "allow_on_submit": 0, - "bold": 0, - "collapsible": 0, - "columns": 0, - "fetch_if_empty": 0, "fieldname": "default_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": "Default 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 + "options": "Holiday List" }, { - "allow_bulk_edit": 0, - "allow_in_quick_entry": 0, - "allow_on_submit": 0, - "bold": 0, - "collapsible": 0, - "columns": 0, - "fetch_if_empty": 0, "fieldname": "standard_working_hours", "fieldtype": "Float", - "hidden": 0, - "ignore_user_permissions": 0, - "ignore_xss_filter": 0, - "in_filter": 0, - "in_global_search": 0, - "in_list_view": 0, - "in_standard_filter": 0, - "label": "Standard Working Hours", - "length": 0, - "no_copy": 0, - "permlevel": 0, - "precision": "", - "print_hide": 0, - "print_hide_if_no_value": 0, - "read_only": 0, - "remember_last_selected_value": 0, - "report_hide": 0, - "reqd": 0, - "search_index": 0, - "set_only_once": 0, - "translatable": 0, - "unique": 0 + "label": "Standard Working Hours" }, { - "allow_bulk_edit": 0, - "allow_in_quick_entry": 0, - "allow_on_submit": 0, - "bold": 0, - "collapsible": 0, - "columns": 0, - "fetch_if_empty": 0, "fieldname": "default_terms", "fieldtype": "Link", - "hidden": 0, - "ignore_user_permissions": 0, - "ignore_xss_filter": 0, - "in_filter": 0, - "in_global_search": 0, - "in_list_view": 0, - "in_standard_filter": 0, "label": "Default Terms", - "length": 0, - "no_copy": 0, - "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, - "search_index": 0, - "set_only_once": 0, - "translatable": 0, - "unique": 0 + "options": "Terms and Conditions" }, { - "allow_bulk_edit": 0, - "allow_in_quick_entry": 0, - "allow_on_submit": 0, - "bold": 0, - "collapsible": 0, - "columns": 0, - "fetch_if_empty": 0, "fieldname": "column_break_10", - "fieldtype": "Column Break", - "hidden": 0, - "ignore_user_permissions": 0, - "ignore_xss_filter": 0, - "in_filter": 0, - "in_global_search": 0, - "in_list_view": 0, - "in_standard_filter": 0, - "length": 0, - "no_copy": 0, - "permlevel": 0, - "precision": "", - "print_hide": 0, - "print_hide_if_no_value": 0, - "read_only": 0, - "remember_last_selected_value": 0, - "report_hide": 0, - "reqd": 0, - "search_index": 0, - "set_only_once": 0, - "translatable": 0, - "unique": 0 + "fieldtype": "Column Break" }, { - "allow_bulk_edit": 0, - "allow_in_quick_entry": 0, - "allow_on_submit": 0, - "bold": 0, - "collapsible": 0, - "columns": 0, - "fetch_if_empty": 0, "fieldname": "country", "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": "Country", - "length": 0, - "no_copy": 0, "options": "Country", - "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 + "reqd": 1 }, { - "allow_bulk_edit": 0, - "allow_in_quick_entry": 0, - "allow_on_submit": 0, - "bold": 0, - "collapsible": 0, - "columns": 0, - "fetch_if_empty": 0, "fieldname": "create_chart_of_accounts_based_on", "fieldtype": "Select", - "hidden": 0, - "ignore_user_permissions": 0, - "ignore_xss_filter": 0, - "in_filter": 0, - "in_global_search": 0, - "in_list_view": 0, - "in_standard_filter": 0, "label": "Create Chart Of Accounts Based On", - "length": 0, - "no_copy": 0, - "options": "\nStandard Template\nExisting 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": 0, - "search_index": 0, - "set_only_once": 0, - "translatable": 0, - "unique": 0 + "options": "\nStandard Template\nExisting Company" }, { - "allow_bulk_edit": 0, - "allow_in_quick_entry": 0, - "allow_on_submit": 0, - "bold": 0, - "collapsible": 0, - "columns": 0, "depends_on": "eval:doc.create_chart_of_accounts_based_on===\"Standard Template\"", - "fetch_if_empty": 0, "fieldname": "chart_of_accounts", "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": "Chart Of Accounts Template", - "length": 0, - "no_copy": 1, - "options": "", - "permlevel": 0, - "precision": "", - "print_hide": 0, - "print_hide_if_no_value": 0, - "read_only": 0, - "remember_last_selected_value": 0, - "report_hide": 0, - "reqd": 0, - "search_index": 0, - "set_only_once": 0, - "translatable": 0, - "unique": 0 + "no_copy": 1 }, { - "allow_bulk_edit": 0, - "allow_in_quick_entry": 0, - "allow_on_submit": 0, - "bold": 0, - "collapsible": 0, - "columns": 0, "depends_on": "eval:doc.create_chart_of_accounts_based_on===\"Existing Company\"", - "fetch_if_empty": 0, "fieldname": "existing_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": "Existing Company ", - "length": 0, "no_copy": 1, - "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": 0, - "search_index": 0, - "set_only_once": 0, - "translatable": 0, - "unique": 0 + "options": "Company" }, { - "allow_bulk_edit": 0, - "allow_in_quick_entry": 0, - "allow_on_submit": 0, - "bold": 0, - "collapsible": 0, - "columns": 0, - "fetch_if_empty": 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": 0, - "print_hide_if_no_value": 0, - "read_only": 0, - "remember_last_selected_value": 0, - "report_hide": 0, - "reqd": 0, - "search_index": 0, - "set_only_once": 0, - "translatable": 0, - "unique": 0 + "label": "Tax ID" }, { - "allow_bulk_edit": 0, - "allow_in_quick_entry": 0, - "allow_on_submit": 0, - "bold": 0, - "collapsible": 0, - "columns": 0, - "fetch_if_empty": 0, "fieldname": "date_of_establishment", "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 of Establishment", - "length": 0, - "no_copy": 0, - "permlevel": 0, - "precision": "", - "print_hide": 0, - "print_hide_if_no_value": 0, - "read_only": 0, - "remember_last_selected_value": 0, - "report_hide": 0, - "reqd": 0, - "search_index": 0, - "set_only_once": 0, - "translatable": 0, - "unique": 0 + "label": "Date of Establishment" }, { - "allow_bulk_edit": 0, - "allow_in_quick_entry": 0, - "allow_on_submit": 0, - "bold": 0, - "collapsible": 0, - "columns": 0, - "fetch_if_empty": 0, "fieldname": "default_settings", "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": "Accounts Settings", - "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 + "oldfieldtype": "Section Break" }, { - "allow_bulk_edit": 0, - "allow_in_quick_entry": 0, - "allow_on_submit": 0, - "bold": 0, - "collapsible": 0, - "columns": 0, "depends_on": "eval:!doc.__islocal", - "fetch_if_empty": 0, "fieldname": "default_bank_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": "Default Bank Account", - "length": 0, "no_copy": 1, "oldfieldname": "default_bank_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": 0, - "search_index": 0, - "set_only_once": 0, - "translatable": 0, - "unique": 0 + "options": "Account" }, { - "allow_bulk_edit": 0, - "allow_in_quick_entry": 0, - "allow_on_submit": 0, - "bold": 0, - "collapsible": 0, - "columns": 0, "depends_on": "eval:!doc.__islocal", - "fetch_if_empty": 0, "fieldname": "default_cash_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": "Default Cash Account", - "length": 0, "no_copy": 1, - "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": 0, - "search_index": 0, - "set_only_once": 0, - "translatable": 0, - "unique": 0 + "options": "Account" }, { - "allow_bulk_edit": 0, - "allow_in_quick_entry": 0, - "allow_on_submit": 0, - "bold": 0, - "collapsible": 0, - "columns": 0, "depends_on": "eval:!doc.__islocal", - "fetch_if_empty": 0, "fieldname": "default_receivable_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": "Default Receivable Account", - "length": 0, "no_copy": 1, "oldfieldname": "receivables_group", "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": 0, - "search_index": 0, - "set_only_once": 0, - "translatable": 0, - "unique": 0 + "options": "Account" }, { - "allow_bulk_edit": 0, - "allow_in_quick_entry": 0, - "allow_on_submit": 0, - "bold": 0, - "collapsible": 0, - "columns": 0, - "fetch_if_empty": 0, "fieldname": "round_off_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": "Round Off Account", - "length": 0, - "no_copy": 0, - "options": "Account", - "permlevel": 0, - "precision": "", - "print_hide": 0, - "print_hide_if_no_value": 0, - "read_only": 0, - "remember_last_selected_value": 0, - "report_hide": 0, - "reqd": 0, - "search_index": 0, - "set_only_once": 0, - "translatable": 0, - "unique": 0 + "options": "Account" }, { - "allow_bulk_edit": 0, - "allow_in_quick_entry": 0, - "allow_on_submit": 0, - "bold": 0, - "collapsible": 0, - "columns": 0, - "fetch_if_empty": 0, "fieldname": "round_off_cost_center", "fieldtype": "Link", - "hidden": 0, - "ignore_user_permissions": 0, - "ignore_xss_filter": 0, - "in_filter": 0, - "in_global_search": 0, - "in_list_view": 0, - "in_standard_filter": 0, "label": "Round Off Cost Center", - "length": 0, - "no_copy": 0, - "options": "Cost Center", - "permlevel": 0, - "precision": "", - "print_hide": 0, - "print_hide_if_no_value": 0, - "read_only": 0, - "remember_last_selected_value": 0, - "report_hide": 0, - "reqd": 0, - "search_index": 0, - "set_only_once": 0, - "translatable": 0, - "unique": 0 + "options": "Cost Center" }, { - "allow_bulk_edit": 0, - "allow_in_quick_entry": 0, - "allow_on_submit": 0, - "bold": 0, - "collapsible": 0, - "columns": 0, - "fetch_if_empty": 0, "fieldname": "write_off_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": "Write Off Account", - "length": 0, - "no_copy": 0, - "options": "Account", - "permlevel": 0, - "precision": "", - "print_hide": 0, - "print_hide_if_no_value": 0, - "read_only": 0, - "remember_last_selected_value": 0, - "report_hide": 0, - "reqd": 0, - "search_index": 0, - "set_only_once": 0, - "translatable": 0, - "unique": 0 + "options": "Account" }, { - "allow_bulk_edit": 0, - "allow_in_quick_entry": 0, - "allow_on_submit": 0, - "bold": 0, - "collapsible": 0, - "columns": 0, - "fetch_if_empty": 0, "fieldname": "discount_allowed_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": "Discount Allowed Account", - "length": 0, - "no_copy": 0, - "options": "Account", - "permlevel": 0, - "precision": "", - "print_hide": 0, - "print_hide_if_no_value": 0, - "read_only": 0, - "remember_last_selected_value": 0, - "report_hide": 0, - "reqd": 0, - "search_index": 0, - "set_only_once": 0, - "translatable": 0, - "unique": 0 + "options": "Account" }, { - "allow_bulk_edit": 0, - "allow_in_quick_entry": 0, - "allow_on_submit": 0, - "bold": 0, - "collapsible": 0, - "columns": 0, - "fetch_if_empty": 0, "fieldname": "discount_received_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": "Discount Received Account", - "length": 0, - "no_copy": 0, - "options": "Account", - "permlevel": 0, - "precision": "", - "print_hide": 0, - "print_hide_if_no_value": 0, - "read_only": 0, - "remember_last_selected_value": 0, - "report_hide": 0, - "reqd": 0, - "search_index": 0, - "set_only_once": 0, - "translatable": 0, - "unique": 0 + "options": "Account" }, { - "allow_bulk_edit": 0, - "allow_in_quick_entry": 0, - "allow_on_submit": 0, - "bold": 0, - "collapsible": 0, - "columns": 0, - "fetch_if_empty": 0, "fieldname": "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": "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 + "options": "Account" }, { - "allow_bulk_edit": 0, - "allow_in_quick_entry": 0, - "allow_on_submit": 0, - "bold": 0, - "collapsible": 0, - "columns": 0, - "fetch_if_empty": 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 + "options": "Account" }, { - "allow_bulk_edit": 0, - "allow_in_quick_entry": 0, - "allow_on_submit": 0, - "bold": 0, - "collapsible": 0, - "columns": 0, - "fetch_if_empty": 0, "fieldname": "column_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, "oldfieldtype": "Column Break", - "permlevel": 0, - "print_hide": 0, - "print_hide_if_no_value": 0, - "read_only": 0, - "remember_last_selected_value": 0, - "report_hide": 0, - "reqd": 0, - "search_index": 0, - "set_only_once": 0, - "translatable": 0, - "unique": 0, "width": "50%" }, { - "allow_bulk_edit": 0, - "allow_in_quick_entry": 0, - "allow_on_submit": 0, - "bold": 0, - "collapsible": 0, - "columns": 0, + "default": "0", "depends_on": "eval:doc.parent_company", - "fetch_if_empty": 0, "fieldname": "allow_account_creation_against_child_company", "fieldtype": "Check", - "hidden": 0, - "ignore_user_permissions": 0, - "ignore_xss_filter": 0, - "in_filter": 0, - "in_global_search": 0, - "in_list_view": 0, - "in_standard_filter": 0, - "label": "Allow Account Creation Against Child Company", - "length": 0, - "no_copy": 0, - "permlevel": 0, - "precision": "", - "print_hide": 0, - "print_hide_if_no_value": 0, - "read_only": 0, - "remember_last_selected_value": 0, - "report_hide": 0, - "reqd": 0, - "search_index": 0, - "set_only_once": 0, - "translatable": 0, - "unique": 0 + "label": "Allow Account Creation Against Child Company" }, { - "allow_bulk_edit": 0, - "allow_in_quick_entry": 0, - "allow_on_submit": 0, - "bold": 0, - "collapsible": 0, - "columns": 0, "depends_on": "eval:!doc.__islocal", - "fetch_if_empty": 0, "fieldname": "default_payable_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": "Default Payable Account", - "length": 0, "no_copy": 1, "oldfieldname": "payables_group", "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": 0, - "search_index": 0, - "set_only_once": 0, - "translatable": 0, - "unique": 0 + "options": "Account" }, { - "allow_bulk_edit": 0, - "allow_in_quick_entry": 0, - "allow_on_submit": 0, - "bold": 0, - "collapsible": 0, - "columns": 0, - "fetch_if_empty": 0, "fieldname": "default_employee_advance_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": "Default Employee Advance Account", - "length": 0, "no_copy": 1, - "options": "Account", - "permlevel": 0, - "precision": "", - "print_hide": 0, - "print_hide_if_no_value": 0, - "read_only": 0, - "remember_last_selected_value": 0, - "report_hide": 0, - "reqd": 0, - "search_index": 0, - "set_only_once": 0, - "translatable": 0, - "unique": 0 + "options": "Account" }, { - "allow_bulk_edit": 0, - "allow_in_quick_entry": 0, - "allow_on_submit": 0, - "bold": 0, - "collapsible": 0, - "columns": 0, "depends_on": "eval:!doc.__islocal", - "fetch_if_empty": 0, "fieldname": "default_expense_account", "fieldtype": "Link", - "hidden": 0, "ignore_user_permissions": 1, - "ignore_xss_filter": 0, - "in_filter": 0, - "in_global_search": 0, - "in_list_view": 0, - "in_standard_filter": 0, "label": "Default Cost of Goods Sold Account", - "length": 0, "no_copy": 1, - "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": 0, - "search_index": 0, - "set_only_once": 0, - "translatable": 0, - "unique": 0 + "options": "Account" }, { - "allow_bulk_edit": 0, - "allow_in_quick_entry": 0, - "allow_on_submit": 0, - "bold": 0, - "collapsible": 0, - "columns": 0, "depends_on": "eval:!doc.__islocal", - "fetch_if_empty": 0, "fieldname": "default_income_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": "Default Income Account", - "length": 0, "no_copy": 1, - "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": 0, - "search_index": 0, - "set_only_once": 0, - "translatable": 0, - "unique": 0 + "options": "Account" }, { - "allow_bulk_edit": 0, - "allow_in_quick_entry": 0, - "allow_on_submit": 0, - "bold": 0, - "collapsible": 0, - "columns": 0, "depends_on": "eval:!doc.__islocal", - "fetch_if_empty": 0, "fieldname": "default_deferred_revenue_account", "fieldtype": "Link", - "hidden": 0, "ignore_user_permissions": 1, - "ignore_xss_filter": 0, - "in_filter": 0, - "in_global_search": 0, - "in_list_view": 0, - "in_standard_filter": 0, "label": "Default Deferred Revenue Account", - "length": 0, "no_copy": 1, - "options": "Account", - "permlevel": 0, - "precision": "", - "print_hide": 0, - "print_hide_if_no_value": 0, - "read_only": 0, - "remember_last_selected_value": 0, - "report_hide": 0, - "reqd": 0, - "search_index": 0, - "set_only_once": 0, - "translatable": 0, - "unique": 0 + "options": "Account" }, { - "allow_bulk_edit": 0, - "allow_in_quick_entry": 0, - "allow_on_submit": 0, - "bold": 0, - "collapsible": 0, - "columns": 0, "depends_on": "eval:!doc.__islocal", - "fetch_if_empty": 0, "fieldname": "default_deferred_expense_account", "fieldtype": "Link", - "hidden": 0, "ignore_user_permissions": 1, - "ignore_xss_filter": 0, - "in_filter": 0, - "in_global_search": 0, - "in_list_view": 0, - "in_standard_filter": 0, "label": "Default Deferred Expense Account", - "length": 0, "no_copy": 1, - "options": "Account", - "permlevel": 0, - "precision": "", - "print_hide": 0, - "print_hide_if_no_value": 0, - "read_only": 0, - "remember_last_selected_value": 0, - "report_hide": 0, - "reqd": 0, - "search_index": 0, - "set_only_once": 0, - "translatable": 0, - "unique": 0 + "options": "Account" }, { - "allow_bulk_edit": 0, - "allow_in_quick_entry": 0, - "allow_on_submit": 0, - "bold": 0, - "collapsible": 0, - "columns": 0, "depends_on": "eval:!doc.__islocal", - "fetch_if_empty": 0, "fieldname": "default_payroll_payable_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": "Default Payroll Payable Account", - "length": 0, "no_copy": 1, - "options": "Account", - "permlevel": 0, - "precision": "", - "print_hide": 0, - "print_hide_if_no_value": 0, - "read_only": 0, - "remember_last_selected_value": 0, - "report_hide": 0, - "reqd": 0, - "search_index": 0, - "set_only_once": 0, - "translatable": 0, - "unique": 0 + "options": "Account" }, { - "allow_bulk_edit": 0, - "allow_in_quick_entry": 0, - "allow_on_submit": 0, - "bold": 0, - "collapsible": 0, - "columns": 0, "depends_on": "eval:!doc.__islocal", - "fetch_if_empty": 0, "fieldname": "default_expense_claim_payable_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": "Default Expense Claim Payable Account", - "length": 0, "no_copy": 1, - "options": "Account", - "permlevel": 0, - "precision": "", - "print_hide": 0, - "print_hide_if_no_value": 0, - "read_only": 0, - "remember_last_selected_value": 0, - "report_hide": 0, - "reqd": 0, - "search_index": 0, - "set_only_once": 0, - "translatable": 0, - "unique": 0 + "options": "Account" }, { - "allow_bulk_edit": 0, - "allow_in_quick_entry": 0, - "allow_on_submit": 0, - "bold": 0, - "collapsible": 0, - "columns": 0, - "fetch_if_empty": 0, "fieldname": "section_break_22", - "fieldtype": "Section Break", - "hidden": 0, - "ignore_user_permissions": 0, - "ignore_xss_filter": 0, - "in_filter": 0, - "in_global_search": 0, - "in_list_view": 0, - "in_standard_filter": 0, - "length": 0, - "no_copy": 0, - "permlevel": 0, - "precision": "", - "print_hide": 0, - "print_hide_if_no_value": 0, - "read_only": 0, - "remember_last_selected_value": 0, - "report_hide": 0, - "reqd": 0, - "search_index": 0, - "set_only_once": 0, - "translatable": 0, - "unique": 0 + "fieldtype": "Section Break" }, { - "allow_bulk_edit": 0, - "allow_in_quick_entry": 0, - "allow_on_submit": 0, - "bold": 0, - "collapsible": 0, - "columns": 0, "depends_on": "eval:!doc.__islocal", - "fetch_if_empty": 0, "fieldname": "cost_center", "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 Cost Center", - "length": 0, "no_copy": 1, - "options": "Cost Center", - "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 + "options": "Cost Center" }, { - "allow_bulk_edit": 0, - "allow_in_quick_entry": 0, - "allow_on_submit": 0, - "bold": 0, - "collapsible": 0, - "columns": 0, - "fetch_if_empty": 0, "fieldname": "column_break_26", - "fieldtype": "Column Break", - "hidden": 0, - "ignore_user_permissions": 0, - "ignore_xss_filter": 0, - "in_filter": 0, - "in_global_search": 0, - "in_list_view": 0, - "in_standard_filter": 0, - "length": 0, - "no_copy": 0, - "permlevel": 0, - "precision": "", - "print_hide": 0, - "print_hide_if_no_value": 0, - "read_only": 0, - "remember_last_selected_value": 0, - "report_hide": 0, - "reqd": 0, - "search_index": 0, - "set_only_once": 0, - "translatable": 0, - "unique": 0 + "fieldtype": "Column Break" }, { - "allow_bulk_edit": 0, - "allow_in_quick_entry": 0, - "allow_on_submit": 0, - "bold": 0, - "collapsible": 0, - "columns": 0, "depends_on": "eval:!doc.__islocal", - "fetch_if_empty": 0, "fieldname": "credit_limit", "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": "Credit Limit", - "length": 0, - "no_copy": 0, "oldfieldname": "credit_limit", "oldfieldtype": "Currency", - "options": "default_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 + "options": "default_currency" }, { - "allow_bulk_edit": 0, - "allow_in_quick_entry": 0, - "allow_on_submit": 0, - "bold": 0, - "collapsible": 0, - "columns": 0, - "depends_on": "", - "fetch_if_empty": 0, "fieldname": "payment_terms", "fieldtype": "Link", - "hidden": 0, - "ignore_user_permissions": 0, - "ignore_xss_filter": 0, - "in_filter": 0, - "in_global_search": 0, - "in_list_view": 0, - "in_standard_filter": 0, "label": "Default Payment Terms Template", - "length": 0, - "no_copy": 0, - "options": "Payment Terms Template", - "permlevel": 0, - "precision": "", - "print_hide": 0, - "print_hide_if_no_value": 0, - "read_only": 0, - "remember_last_selected_value": 0, - "report_hide": 0, - "reqd": 0, - "search_index": 0, - "set_only_once": 0, - "translatable": 0, - "unique": 0 + "options": "Payment Terms Template" }, { - "allow_bulk_edit": 0, - "allow_in_quick_entry": 0, - "allow_on_submit": 0, - "bold": 0, - "collapsible": 0, - "columns": 0, "depends_on": "eval:!doc.__islocal", - "fetch_if_empty": 0, "fieldname": "auto_accounting_for_stock_settings", "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": "Stock Settings", - "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 + "label": "Stock Settings" }, { - "allow_bulk_edit": 0, - "allow_in_quick_entry": 0, - "allow_on_submit": 0, - "bold": 0, - "collapsible": 0, - "columns": 0, "default": "1", - "fetch_if_empty": 0, "fieldname": "enable_perpetual_inventory", "fieldtype": "Check", - "hidden": 0, - "ignore_user_permissions": 0, - "ignore_xss_filter": 0, - "in_filter": 0, - "in_global_search": 0, - "in_list_view": 0, - "in_standard_filter": 0, - "label": "Enable Perpetual Inventory", - "length": 0, - "no_copy": 0, - "permlevel": 0, - "precision": "", - "print_hide": 0, - "print_hide_if_no_value": 0, - "read_only": 0, - "remember_last_selected_value": 0, - "report_hide": 0, - "reqd": 0, - "search_index": 0, - "set_only_once": 0, - "translatable": 0, - "unique": 0 + "label": "Enable Perpetual Inventory" }, { - "allow_bulk_edit": 0, - "allow_in_quick_entry": 0, - "allow_on_submit": 0, - "bold": 0, - "collapsible": 0, - "columns": 0, - "fetch_if_empty": 0, "fieldname": "default_inventory_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": "Default Inventory Account", - "length": 0, - "no_copy": 0, - "options": "Account", - "permlevel": 0, - "precision": "", - "print_hide": 0, - "print_hide_if_no_value": 0, - "read_only": 0, - "remember_last_selected_value": 0, - "report_hide": 0, - "reqd": 0, - "search_index": 0, - "set_only_once": 0, - "translatable": 0, - "unique": 0 + "options": "Account" }, { - "allow_bulk_edit": 0, - "allow_in_quick_entry": 0, - "allow_on_submit": 0, - "bold": 0, - "collapsible": 0, - "columns": 0, - "fetch_if_empty": 0, "fieldname": "stock_adjustment_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": "Stock Adjustment Account", - "length": 0, "no_copy": 1, - "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": 0, - "search_index": 0, - "set_only_once": 0, - "translatable": 0, - "unique": 0 + "options": "Account" }, { - "allow_bulk_edit": 0, - "allow_in_quick_entry": 0, - "allow_on_submit": 0, - "bold": 0, - "collapsible": 0, - "columns": 0, - "fetch_if_empty": 0, "fieldname": "column_break_32", - "fieldtype": "Column Break", - "hidden": 0, - "ignore_user_permissions": 0, - "ignore_xss_filter": 0, - "in_filter": 0, - "in_global_search": 0, - "in_list_view": 0, - "in_standard_filter": 0, - "length": 0, - "no_copy": 0, - "permlevel": 0, - "precision": "", - "print_hide": 0, - "print_hide_if_no_value": 0, - "read_only": 0, - "remember_last_selected_value": 0, - "report_hide": 0, - "reqd": 0, - "search_index": 0, - "set_only_once": 0, - "translatable": 0, - "unique": 0 + "fieldtype": "Column Break" }, { - "allow_bulk_edit": 0, - "allow_in_quick_entry": 0, - "allow_on_submit": 0, - "bold": 0, - "collapsible": 0, - "columns": 0, - "fetch_if_empty": 0, "fieldname": "stock_received_but_not_billed", "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": "Stock Received But Not Billed", - "length": 0, "no_copy": 1, - "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": 0, - "search_index": 0, - "set_only_once": 0, - "translatable": 0, - "unique": 0 + "options": "Account" }, { - "allow_bulk_edit": 0, - "allow_in_quick_entry": 0, - "allow_on_submit": 0, - "bold": 0, - "collapsible": 0, - "columns": 0, - "fetch_if_empty": 0, "fieldname": "expenses_included_in_valuation", "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": "Expenses Included In Valuation", - "length": 0, "no_copy": 1, - "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": 0, - "search_index": 0, - "set_only_once": 0, - "translatable": 0, - "unique": 0 + "options": "Account" }, { - "allow_bulk_edit": 0, - "allow_in_quick_entry": 0, - "allow_on_submit": 0, - "bold": 0, - "collapsible": 0, - "columns": 0, - "fetch_if_empty": 0, "fieldname": "fixed_asset_depreciation_settings", "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": "Fixed Asset Depreciation Settings", - "length": 0, - "no_copy": 0, - "permlevel": 0, - "precision": "", - "print_hide": 0, - "print_hide_if_no_value": 0, - "read_only": 0, - "remember_last_selected_value": 0, - "report_hide": 0, - "reqd": 0, - "search_index": 0, - "set_only_once": 0, - "translatable": 0, - "unique": 0 + "label": "Fixed Asset Depreciation Settings" }, { - "allow_bulk_edit": 0, - "allow_in_quick_entry": 0, - "allow_on_submit": 0, - "bold": 0, - "collapsible": 0, - "columns": 0, - "fetch_if_empty": 0, "fieldname": "accumulated_depreciation_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": "Accumulated Depreciation Account", - "length": 0, "no_copy": 1, - "options": "Account", - "permlevel": 0, - "precision": "", - "print_hide": 0, - "print_hide_if_no_value": 0, - "read_only": 0, - "remember_last_selected_value": 0, - "report_hide": 0, - "reqd": 0, - "search_index": 0, - "set_only_once": 0, - "translatable": 0, - "unique": 0 + "options": "Account" }, { - "allow_bulk_edit": 0, - "allow_in_quick_entry": 0, - "allow_on_submit": 0, - "bold": 0, - "collapsible": 0, - "columns": 0, - "fetch_if_empty": 0, "fieldname": "depreciation_expense_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": "Depreciation Expense Account", - "length": 0, "no_copy": 1, - "options": "Account", - "permlevel": 0, - "precision": "", - "print_hide": 0, - "print_hide_if_no_value": 0, - "read_only": 0, - "remember_last_selected_value": 0, - "report_hide": 0, - "reqd": 0, - "search_index": 0, - "set_only_once": 0, - "translatable": 0, - "unique": 0 + "options": "Account" }, { - "allow_bulk_edit": 0, - "allow_in_quick_entry": 0, - "allow_on_submit": 0, - "bold": 0, - "collapsible": 0, - "columns": 0, - "fetch_if_empty": 0, "fieldname": "series_for_depreciation_entry", "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": "Series for Asset Depreciation Entry (Journal Entry)", - "length": 0, - "no_copy": 0, - "permlevel": 0, - "precision": "", - "print_hide": 0, - "print_hide_if_no_value": 0, - "read_only": 0, - "remember_last_selected_value": 0, - "report_hide": 0, - "reqd": 0, - "search_index": 0, - "set_only_once": 0, - "translatable": 0, - "unique": 0 + "label": "Series for Asset Depreciation Entry (Journal Entry)" }, { - "allow_bulk_edit": 0, - "allow_in_quick_entry": 0, - "allow_on_submit": 0, - "bold": 0, - "collapsible": 0, - "columns": 0, - "fetch_if_empty": 0, "fieldname": "expenses_included_in_asset_valuation", "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": "Expenses Included In Asset Valuation", - "length": 0, - "no_copy": 0, - "options": "Account", - "permlevel": 0, - "precision": "", - "print_hide": 0, - "print_hide_if_no_value": 0, - "read_only": 0, - "remember_last_selected_value": 0, - "report_hide": 0, - "reqd": 0, - "search_index": 0, - "set_only_once": 0, - "translatable": 0, - "unique": 0 + "options": "Account" }, { - "allow_bulk_edit": 0, - "allow_in_quick_entry": 0, - "allow_on_submit": 0, - "bold": 0, - "collapsible": 0, - "columns": 0, - "fetch_if_empty": 0, "fieldname": "column_break_40", - "fieldtype": "Column Break", - "hidden": 0, - "ignore_user_permissions": 0, - "ignore_xss_filter": 0, - "in_filter": 0, - "in_global_search": 0, - "in_list_view": 0, - "in_standard_filter": 0, - "length": 0, - "no_copy": 0, - "permlevel": 0, - "precision": "", - "print_hide": 0, - "print_hide_if_no_value": 0, - "read_only": 0, - "remember_last_selected_value": 0, - "report_hide": 0, - "reqd": 0, - "search_index": 0, - "set_only_once": 0, - "translatable": 0, - "unique": 0 + "fieldtype": "Column Break" }, { - "allow_bulk_edit": 0, - "allow_in_quick_entry": 0, - "allow_on_submit": 0, - "bold": 0, - "collapsible": 0, - "columns": 0, - "fetch_if_empty": 0, "fieldname": "disposal_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": "Gain/Loss Account on Asset Disposal", - "length": 0, "no_copy": 1, - "options": "Account", - "permlevel": 0, - "precision": "", - "print_hide": 0, - "print_hide_if_no_value": 0, - "read_only": 0, - "remember_last_selected_value": 0, - "report_hide": 0, - "reqd": 0, - "search_index": 0, - "set_only_once": 0, - "translatable": 0, - "unique": 0 + "options": "Account" }, { - "allow_bulk_edit": 0, - "allow_in_quick_entry": 0, - "allow_on_submit": 0, - "bold": 0, - "collapsible": 0, - "columns": 0, - "fetch_if_empty": 0, "fieldname": "depreciation_cost_center", "fieldtype": "Link", - "hidden": 0, - "ignore_user_permissions": 0, - "ignore_xss_filter": 0, - "in_filter": 0, - "in_global_search": 0, - "in_list_view": 0, - "in_standard_filter": 0, "label": "Asset Depreciation Cost Center", - "length": 0, "no_copy": 1, - "options": "Cost Center", - "permlevel": 0, - "precision": "", - "print_hide": 0, - "print_hide_if_no_value": 0, - "read_only": 0, - "remember_last_selected_value": 0, - "report_hide": 0, - "reqd": 0, - "search_index": 0, - "set_only_once": 0, - "translatable": 0, - "unique": 0 + "options": "Cost Center" }, { - "allow_bulk_edit": 0, - "allow_in_quick_entry": 0, - "allow_on_submit": 0, - "bold": 0, - "collapsible": 0, - "columns": 0, - "fetch_if_empty": 0, "fieldname": "capital_work_in_progress_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": "Capital Work In Progress Account", - "length": 0, - "no_copy": 0, - "options": "Account", - "permlevel": 0, - "precision": "", - "print_hide": 0, - "print_hide_if_no_value": 0, - "read_only": 0, - "remember_last_selected_value": 0, - "report_hide": 0, - "reqd": 0, - "search_index": 0, - "set_only_once": 0, - "translatable": 0, - "unique": 0 + "options": "Account" }, { - "allow_bulk_edit": 0, - "allow_in_quick_entry": 0, - "allow_on_submit": 0, - "bold": 0, - "collapsible": 0, - "columns": 0, - "fetch_if_empty": 0, "fieldname": "asset_received_but_not_billed", "fieldtype": "Link", - "hidden": 0, - "ignore_user_permissions": 0, - "ignore_xss_filter": 0, - "in_filter": 0, - "in_global_search": 0, - "in_list_view": 0, - "in_standard_filter": 0, "label": "Asset Received But Not Billed", - "length": 0, - "no_copy": 0, - "options": "Account", - "permlevel": 0, - "precision": "", - "print_hide": 0, - "print_hide_if_no_value": 0, - "read_only": 0, - "remember_last_selected_value": 0, - "report_hide": 0, - "reqd": 0, - "search_index": 0, - "set_only_once": 0, - "translatable": 0, - "unique": 0 + "options": "Account" }, { - "allow_bulk_edit": 0, - "allow_in_quick_entry": 0, - "allow_on_submit": 0, - "bold": 0, "collapsible": 1, - "columns": 0, - "fetch_if_empty": 0, "fieldname": "budget_detail", "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": "Budget Detail", - "length": 0, - "no_copy": 0, - "permlevel": 0, - "precision": "", - "print_hide": 0, - "print_hide_if_no_value": 0, - "read_only": 0, - "remember_last_selected_value": 0, - "report_hide": 0, - "reqd": 0, - "search_index": 0, - "set_only_once": 0, - "translatable": 0, - "unique": 0 + "label": "Budget Detail" }, { - "allow_bulk_edit": 0, - "allow_in_quick_entry": 0, - "allow_on_submit": 0, - "bold": 0, - "collapsible": 0, - "columns": 0, - "fetch_if_empty": 0, "fieldname": "exception_budget_approver_role", "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": "Exception Budget Approver 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 + "options": "Role" }, { - "allow_bulk_edit": 0, - "allow_in_quick_entry": 0, - "allow_on_submit": 0, - "bold": 0, - "collapsible": 0, - "columns": 0, "description": "For reference only.", - "fetch_if_empty": 0, "fieldname": "company_info", "fieldtype": "Section Break", - "hidden": 0, - "ignore_user_permissions": 0, - "ignore_xss_filter": 0, - "in_filter": 0, - "in_global_search": 0, - "in_list_view": 0, - "in_standard_filter": 0, - "label": "Company Info", - "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 + "label": "Company Info" }, { - "allow_bulk_edit": 0, - "allow_in_quick_entry": 0, - "allow_on_submit": 0, - "bold": 0, - "collapsible": 0, - "columns": 0, - "fetch_if_empty": 0, "fieldname": "date_of_incorporation", "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 of Incorporation", - "length": 0, - "no_copy": 0, - "permlevel": 0, - "precision": "", - "print_hide": 0, - "print_hide_if_no_value": 0, - "read_only": 0, - "remember_last_selected_value": 0, - "report_hide": 0, - "reqd": 0, - "search_index": 0, - "set_only_once": 0, - "translatable": 0, - "unique": 0 + "label": "Date of Incorporation" }, { - "allow_bulk_edit": 0, - "allow_in_quick_entry": 0, - "allow_on_submit": 0, - "bold": 0, - "collapsible": 0, - "columns": 0, - "fetch_if_empty": 0, "fieldname": "address_html", - "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, - "length": 0, - "no_copy": 0, - "permlevel": 0, - "precision": "", - "print_hide": 0, - "print_hide_if_no_value": 0, - "read_only": 0, - "remember_last_selected_value": 0, - "report_hide": 0, - "reqd": 0, - "search_index": 0, - "set_only_once": 0, - "translatable": 0, - "unique": 0 + "fieldtype": "HTML" }, { - "allow_bulk_edit": 0, - "allow_in_quick_entry": 0, - "allow_on_submit": 0, - "bold": 0, - "collapsible": 0, - "columns": 0, - "fetch_if_empty": 0, "fieldname": "column_break1", "fieldtype": "Column Break", - "hidden": 0, - "ignore_user_permissions": 0, - "ignore_xss_filter": 0, - "in_filter": 0, - "in_global_search": 0, - "in_list_view": 0, - "in_standard_filter": 0, - "length": 0, - "no_copy": 0, "oldfieldtype": "Column Break", - "permlevel": 0, - "print_hide": 0, - "print_hide_if_no_value": 0, - "read_only": 0, - "remember_last_selected_value": 0, - "report_hide": 0, - "reqd": 0, - "search_index": 0, - "set_only_once": 0, - "translatable": 0, - "unique": 0, "width": "50%" }, { - "allow_bulk_edit": 0, - "allow_in_quick_entry": 0, - "allow_on_submit": 0, - "bold": 0, - "collapsible": 0, - "columns": 0, "depends_on": "eval:doc.date_of_incorporation", - "fetch_if_empty": 0, "fieldname": "date_of_commencement", "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 of Commencement", - "length": 0, - "no_copy": 0, - "permlevel": 0, - "precision": "", - "print_hide": 0, - "print_hide_if_no_value": 0, - "read_only": 0, - "remember_last_selected_value": 0, - "report_hide": 0, - "reqd": 0, - "search_index": 0, - "set_only_once": 0, - "translatable": 0, - "unique": 0 + "label": "Date of Commencement" }, { - "allow_bulk_edit": 0, - "allow_in_quick_entry": 0, - "allow_on_submit": 0, - "bold": 0, - "collapsible": 0, - "columns": 0, - "fetch_if_empty": 0, "fieldname": "phone_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": "Phone No", - "length": 0, - "no_copy": 0, "oldfieldname": "phone_no", "oldfieldtype": "Data", - "options": "Phone", - "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 + "options": "Phone" }, { - "allow_bulk_edit": 0, - "allow_in_quick_entry": 0, - "allow_on_submit": 0, - "bold": 0, - "collapsible": 0, - "columns": 0, - "fetch_if_empty": 0, "fieldname": "fax", "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": "Fax", - "length": 0, - "no_copy": 0, "oldfieldname": "fax", "oldfieldtype": "Data", - "options": "Phone", - "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 + "options": "Phone" }, { - "allow_bulk_edit": 0, - "allow_in_quick_entry": 0, - "allow_on_submit": 0, - "bold": 0, - "collapsible": 0, - "columns": 0, - "fetch_if_empty": 0, "fieldname": "email", "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": "Email", - "length": 0, - "no_copy": 0, "oldfieldname": "email", "oldfieldtype": "Data", - "options": "Email", - "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 + "options": "Email" }, { - "allow_bulk_edit": 0, - "allow_in_quick_entry": 0, - "allow_on_submit": 0, - "bold": 0, - "collapsible": 0, - "columns": 0, - "fetch_if_empty": 0, "fieldname": "website", "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": "Website", - "length": 0, - "no_copy": 0, "oldfieldname": "website", - "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": 0, - "search_index": 0, - "set_only_once": 0, - "translatable": 0, - "unique": 0 + "oldfieldtype": "Data" }, { - "allow_bulk_edit": 0, - "allow_in_quick_entry": 0, - "allow_on_submit": 0, - "bold": 0, - "collapsible": 0, - "columns": 0, - "description": "", - "fetch_if_empty": 0, "fieldname": "registration_info", "fieldtype": "Section Break", - "hidden": 0, - "ignore_user_permissions": 0, - "ignore_xss_filter": 0, - "in_filter": 0, - "in_global_search": 0, - "in_list_view": 0, - "in_standard_filter": 0, - "label": "", - "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, "width": "50%" }, { - "allow_bulk_edit": 0, - "allow_in_quick_entry": 0, - "allow_on_submit": 0, - "bold": 0, - "collapsible": 0, - "columns": 0, "description": "Company registration numbers for your reference. Tax numbers etc.", - "fetch_if_empty": 0, "fieldname": "registration_details", "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": "Registration Details", - "length": 0, - "no_copy": 0, "oldfieldname": "registration_details", - "oldfieldtype": "Code", - "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 + "oldfieldtype": "Code" }, { - "allow_bulk_edit": 0, - "allow_in_quick_entry": 0, - "allow_on_submit": 0, - "bold": 0, - "collapsible": 0, - "columns": 0, - "fetch_if_empty": 0, "fieldname": "delete_company_transactions", "fieldtype": "Button", - "hidden": 0, - "ignore_user_permissions": 0, - "ignore_xss_filter": 0, - "in_filter": 0, - "in_global_search": 0, - "in_list_view": 0, - "in_standard_filter": 0, - "label": "Delete Company Transactions", - "length": 0, - "no_copy": 0, - "permlevel": 0, - "precision": "", - "print_hide": 0, - "print_hide_if_no_value": 0, - "read_only": 0, - "remember_last_selected_value": 0, - "report_hide": 0, - "reqd": 0, - "search_index": 0, - "set_only_once": 0, - "translatable": 0, - "unique": 0 + "label": "Delete Company Transactions" }, { - "allow_bulk_edit": 0, - "allow_in_quick_entry": 0, - "allow_on_submit": 0, - "bold": 0, - "collapsible": 0, - "columns": 0, - "fetch_if_empty": 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, - "precision": "", "print_hide": 1, - "print_hide_if_no_value": 0, "read_only": 1, - "remember_last_selected_value": 0, - "report_hide": 0, - "reqd": 0, - "search_index": 1, - "set_only_once": 0, - "translatable": 0, - "unique": 0 + "search_index": 1 }, { - "allow_bulk_edit": 0, - "allow_in_quick_entry": 0, - "allow_on_submit": 0, - "bold": 0, - "collapsible": 0, - "columns": 0, - "fetch_if_empty": 0, "fieldname": "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, - "precision": "", "print_hide": 1, - "print_hide_if_no_value": 0, "read_only": 1, - "remember_last_selected_value": 0, - "report_hide": 0, - "reqd": 0, - "search_index": 1, - "set_only_once": 0, - "translatable": 0, - "unique": 0 + "search_index": 1 }, { - "allow_bulk_edit": 0, - "allow_in_quick_entry": 0, - "allow_on_submit": 0, - "bold": 0, - "collapsible": 0, - "columns": 0, - "fetch_if_empty": 0, "fieldname": "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, - "precision": "", "print_hide": 1, - "print_hide_if_no_value": 0, - "read_only": 1, - "remember_last_selected_value": 0, - "report_hide": 0, - "reqd": 0, - "search_index": 0, - "set_only_once": 0, - "translatable": 0, - "unique": 0 + "read_only": 1 } ], - "has_web_view": 0, - "hide_heading": 0, - "hide_toolbar": 0, "icon": "fa fa-building", "idx": 1, "image_field": "company_logo", - "image_view": 0, - "in_create": 0, - "is_submittable": 0, - "issingle": 0, - "istable": 0, - "max_attachments": 0, - "menu_index": 0, - "modified": "2019-05-21 17:15:50.390548", + "modified": "2019-06-13 18:03:14.764423", "modified_by": "Administrator", "module": "Setup", "name": "Company", "owner": "Administrator", "permissions": [ { - "amend": 0, - "cancel": 0, "create": 1, "delete": 1, "email": 1, - "export": 0, - "if_owner": 0, - "import": 0, - "permlevel": 0, "print": 1, "read": 1, "report": 1, "role": "System Manager", - "set_user_permissions": 0, "share": 1, - "submit": 0, "write": 1 }, { - "amend": 0, - "cancel": 0, - "create": 0, - "delete": 0, "email": 1, - "export": 0, - "if_owner": 0, - "import": 0, - "permlevel": 0, "print": 1, "read": 1, - "report": 0, - "role": "Accounts User", - "set_user_permissions": 0, - "share": 0, - "submit": 0, - "write": 0 + "role": "Accounts User" }, { - "amend": 0, - "cancel": 0, - "create": 0, - "delete": 0, - "email": 0, - "export": 0, - "if_owner": 0, - "import": 0, - "permlevel": 0, - "print": 0, "read": 1, - "report": 0, - "role": "Employee", - "set_user_permissions": 0, - "share": 0, - "submit": 0, - "write": 0 + "role": "Employee" }, { - "amend": 0, - "cancel": 0, - "create": 0, - "delete": 0, - "email": 0, - "export": 0, - "if_owner": 0, - "import": 0, - "permlevel": 0, - "print": 0, "read": 1, - "report": 0, - "role": "Sales User", - "set_user_permissions": 0, - "share": 0, - "submit": 0, - "write": 0 + "role": "Sales User" }, { - "amend": 0, - "cancel": 0, - "create": 0, - "delete": 0, - "email": 0, - "export": 0, - "if_owner": 0, - "import": 0, - "permlevel": 0, - "print": 0, "read": 1, - "report": 0, - "role": "Purchase User", - "set_user_permissions": 0, - "share": 0, - "submit": 0, - "write": 0 + "role": "Purchase User" }, { - "amend": 0, - "cancel": 0, - "create": 0, - "delete": 0, - "email": 0, - "export": 0, - "if_owner": 0, - "import": 0, - "permlevel": 0, - "print": 0, "read": 1, - "report": 0, - "role": "Stock User", - "set_user_permissions": 0, - "share": 0, - "submit": 0, - "write": 0 + "role": "Stock User" }, { - "amend": 0, - "cancel": 0, - "create": 0, - "delete": 0, - "email": 0, - "export": 0, - "if_owner": 0, - "import": 0, - "permlevel": 0, - "print": 0, "read": 1, - "report": 0, - "role": "Projects User", - "set_user_permissions": 0, - "share": 0, - "submit": 0, - "write": 0 + "role": "Projects User" } ], - "quick_entry": 0, - "read_only": 0, - "read_only_onload": 0, "show_name_in_global_search": 1, + "sort_field": "modified", "sort_order": "ASC", - "track_changes": 1, - "track_seen": 0, - "track_views": 0 + "track_changes": 1 } \ No newline at end of file From 122cdaf87bb3468f9006249cf793ad7c55dbb9c8 Mon Sep 17 00:00:00 2001 From: Anurag Mishra <32095923+Anurag810@users.noreply.github.com> Date: Fri, 14 Jun 2019 11:29:18 +0530 Subject: [PATCH 43/69] fix: column width (#17935) --- .../budget_variance_report/budget_variance_report.py | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/erpnext/accounts/report/budget_variance_report/budget_variance_report.py b/erpnext/accounts/report/budget_variance_report/budget_variance_report.py index 4511ace225..146c10c222 100644 --- a/erpnext/accounts/report/budget_variance_report/budget_variance_report.py +++ b/erpnext/accounts/report/budget_variance_report/budget_variance_report.py @@ -60,7 +60,7 @@ def validate_filters(filters): frappe.throw(_("Filter based on Cost Center is only applicable if Budget Against is selected as Cost Center")) def get_columns(filters): - columns = [_(filters.get("budget_against")) + ":Link/%s:80"%(filters.get("budget_against")), _("Account") + ":Link/Account:80"] + columns = [_(filters.get("budget_against")) + ":Link/%s:150"%(filters.get("budget_against")), _("Account") + ":Link/Account:150"] group_months = False if filters["period"] == "Monthly" else True @@ -71,7 +71,7 @@ def get_columns(filters): if filters["period"] == "Yearly": labels = [_("Budget") + " " + str(year[0]), _("Actual ") + " " + str(year[0]), _("Varaiance ") + " " + str(year[0])] for label in labels: - columns.append(label+":Float:80") + columns.append(label+":Float:150") else: for label in [_("Budget") + " (%s)" + " " + str(year[0]), _("Actual") + " (%s)" + " " + str(year[0]), _("Variance") + " (%s)" + " " + str(year[0])]: if group_months: @@ -79,11 +79,11 @@ def get_columns(filters): else: label = label % formatdate(from_date, format_string="MMM") - columns.append(label+":Float:80") + columns.append(label+":Float:150") if filters["period"] != "Yearly" : - return columns + [_("Total Budget") + ":Float:80", _("Total Actual") + ":Float:80", - _("Total Variance") + ":Float:80"] + return columns + [_("Total Budget") + ":Float:150", _("Total Actual") + ":Float:150", + _("Total Variance") + ":Float:150"] else: return columns From a030138df87155435352157d95747a7651b53f15 Mon Sep 17 00:00:00 2001 From: rohitwaghchaure Date: Fri, 14 Jun 2019 11:57:14 +0530 Subject: [PATCH 44/69] fix: trial balance opening balance not showing in the debit side for the liability account (#17944) --- .../report/trial_balance/trial_balance.py | 57 +++++++++---------- 1 file changed, 26 insertions(+), 31 deletions(-) diff --git a/erpnext/accounts/report/trial_balance/trial_balance.py b/erpnext/accounts/report/trial_balance/trial_balance.py index 6b18c5d873..b5f0186d4d 100644 --- a/erpnext/accounts/report/trial_balance/trial_balance.py +++ b/erpnext/accounts/report/trial_balance/trial_balance.py @@ -180,20 +180,28 @@ def calculate_values(accounts, gl_entries_by_account, opening_balances, filters, if d["root_type"] == "Asset" or d["root_type"] == "Equity" or d["root_type"] == "Expense": d["opening_debit"] -= d["opening_credit"] - d["opening_credit"] = 0.0 - total_row["opening_debit"] += d["opening_debit"] + d["closing_debit"] -= d["closing_credit"] + + # For opening + check_opening_closing_has_negative_value(d, "opening_debit", "opening_credit") + + # For closing + check_opening_closing_has_negative_value(d, "closing_debit", "closing_credit") + if d["root_type"] == "Liability" or d["root_type"] == "Income": d["opening_credit"] -= d["opening_debit"] - d["opening_debit"] = 0.0 - total_row["opening_credit"] += d["opening_credit"] - if d["root_type"] == "Asset" or d["root_type"] == "Equity" or d["root_type"] == "Expense": - d["closing_debit"] -= d["closing_credit"] - d["closing_credit"] = 0.0 - total_row["closing_debit"] += d["closing_debit"] - if d["root_type"] == "Liability" or d["root_type"] == "Income": d["closing_credit"] -= d["closing_debit"] - d["closing_debit"] = 0.0 - total_row["closing_credit"] += d["closing_credit"] + + # For opening + check_opening_closing_has_negative_value(d, "opening_credit", "opening_debit") + + # For closing + check_opening_closing_has_negative_value(d, "closing_credit", "closing_debit") + + total_row["opening_debit"] += d["opening_debit"] + total_row["closing_debit"] += d["closing_debit"] + total_row["opening_credit"] += d["opening_credit"] + total_row["closing_credit"] += d["closing_credit"] return total_row @@ -219,8 +227,6 @@ def prepare_data(accounts, filters, total_row, parent_children_map, company_curr if d.account_number else d.account_name) } - prepare_opening_and_closing(d) - for key in value_fields: row[key] = flt(d.get(key, 0.0), 3) @@ -295,22 +301,11 @@ def get_columns(): } ] -def prepare_opening_and_closing(d): - d["closing_debit"] = d["opening_debit"] + d["debit"] - d["closing_credit"] = d["opening_credit"] + d["credit"] +def check_opening_closing_has_negative_value(d, dr_or_cr, switch_to_column): + # If opening debit has negetive value then move it to opening credit and vice versa. - if d["root_type"] == "Asset" or d["root_type"] == "Equity" or d["root_type"] == "Expense": - d["opening_debit"] -= d["opening_credit"] - d["opening_credit"] = 0.0 - - if d["root_type"] == "Liability" or d["root_type"] == "Income": - d["opening_credit"] -= d["opening_debit"] - d["opening_debit"] = 0.0 - - if d["root_type"] == "Asset" or d["root_type"] == "Equity" or d["root_type"] == "Expense": - d["closing_debit"] -= d["closing_credit"] - d["closing_credit"] = 0.0 - - if d["root_type"] == "Liability" or d["root_type"] == "Income": - d["closing_credit"] -= d["closing_debit"] - d["closing_debit"] = 0.0 + if d[dr_or_cr] < 0: + d[switch_to_column] = abs(d[dr_or_cr]) + d[dr_or_cr] = 0.0 + else: + d[switch_to_column] = 0.0 From 35bb7b8761afa765a3e84c0286899bc26ee09d55 Mon Sep 17 00:00:00 2001 From: Rushabh Mehta Date: Fri, 14 Jun 2019 11:49:20 +0530 Subject: [PATCH 45/69] Merge pull request #17369 from alyf-de/datev_report feat(regional): Report for German tax consultants (DATEV) --- erpnext/regional/report/datev/__init__.py | 0 erpnext/regional/report/datev/datev.js | 32 ++ erpnext/regional/report/datev/datev.json | 29 ++ erpnext/regional/report/datev/datev.py | 373 ++++++++++++++++++++++ 4 files changed, 434 insertions(+) create mode 100644 erpnext/regional/report/datev/__init__.py create mode 100644 erpnext/regional/report/datev/datev.js create mode 100644 erpnext/regional/report/datev/datev.json create mode 100644 erpnext/regional/report/datev/datev.py diff --git a/erpnext/regional/report/datev/__init__.py b/erpnext/regional/report/datev/__init__.py new file mode 100644 index 0000000000..e69de29bb2 diff --git a/erpnext/regional/report/datev/datev.js b/erpnext/regional/report/datev/datev.js new file mode 100644 index 0000000000..1e000b673e --- /dev/null +++ b/erpnext/regional/report/datev/datev.js @@ -0,0 +1,32 @@ +frappe.query_reports["DATEV"] = { + "filters": [ + { + "fieldname": "company", + "label": __("Company"), + "fieldtype": "Link", + "options": "Company", + "default": frappe.defaults.get_user_default("Company") || frappe.defaults.get_global_default("Company"), + "reqd": 1 + }, + { + "fieldname": "from_date", + "label": __("From Date"), + "default": frappe.datetime.month_start(), + "fieldtype": "Date", + "reqd": 1 + }, + { + "fieldname": "to_date", + "label": __("To Date"), + "default": frappe.datetime.now_date(), + "fieldtype": "Date", + "reqd": 1 + } + ], + onload: function(query_report) { + query_report.page.add_inner_button("Download DATEV Export", () => { + const filters = JSON.stringify(query_report.get_values()); + window.open(`/api/method/erpnext.regional.report.datev.datev.download_datev_csv?filters=${filters}`); + }); + } +}; diff --git a/erpnext/regional/report/datev/datev.json b/erpnext/regional/report/datev/datev.json new file mode 100644 index 0000000000..80a866cbf5 --- /dev/null +++ b/erpnext/regional/report/datev/datev.json @@ -0,0 +1,29 @@ +{ + "add_total_row": 0, + "apply_user_permissions": 0, + "creation": "2019-04-24 08:45:16.650129", + "disabled": 0, + "icon": "octicon octicon-repo-pull", + "color": "#4CB944", + "docstatus": 0, + "doctype": "Report", + "idx": 0, + "is_standard": "Yes", + "module": "Regional", + "name": "DATEV", + "owner": "Administrator", + "ref_doctype": "GL Entry", + "report_name": "DATEV", + "report_type": "Script Report", + "roles": [ + { + "role": "Accounts User" + }, + { + "role": "Accounts Manager" + }, + { + "role": "Auditor" + } + ] +} diff --git a/erpnext/regional/report/datev/datev.py b/erpnext/regional/report/datev/datev.py new file mode 100644 index 0000000000..50aed084ab --- /dev/null +++ b/erpnext/regional/report/datev/datev.py @@ -0,0 +1,373 @@ +# coding: utf-8 +""" +Provide a report and downloadable CSV according to the German DATEV format. + +- Query report showing only the columns that contain data, formatted nicely for + dispay to the user. +- CSV download functionality `download_datev_csv` that provides a CSV file with + all required columns. Used to import the data into the DATEV Software. +""" +from __future__ import unicode_literals +import json +from six import string_types +import frappe +from frappe import _ +import pandas as pd + + +def execute(filters=None): + """Entry point for frappe.""" + validate_filters(filters) + result = get_gl_entries(filters, as_dict=0) + columns = get_columns() + + return columns, result + + +def validate_filters(filters): + """Make sure all mandatory filters are present.""" + if not filters.get('company'): + frappe.throw(_('{0} is mandatory').format(_('Company'))) + + if not filters.get('from_date'): + frappe.throw(_('{0} is mandatory').format(_('From Date'))) + + if not filters.get('to_date'): + frappe.throw(_('{0} is mandatory').format(_('To Date'))) + + +def get_columns(): + """Return the list of columns that will be shown in query report.""" + columns = [ + { + "label": "Umsatz (ohne Soll/Haben-Kz)", + "fieldname": "Umsatz (ohne Soll/Haben-Kz)", + "fieldtype": "Currency", + }, + { + "label": "Soll/Haben-Kennzeichen", + "fieldname": "Soll/Haben-Kennzeichen", + "fieldtype": "Data", + }, + { + "label": "Kontonummer", + "fieldname": "Kontonummer", + "fieldtype": "Data", + }, + { + "label": "Gegenkonto (ohne BU-Schlüssel)", + "fieldname": "Gegenkonto (ohne BU-Schlüssel)", + "fieldtype": "Data", + }, + { + "label": "Belegdatum", + "fieldname": "Belegdatum", + "fieldtype": "Date", + }, + { + "label": "Buchungstext", + "fieldname": "Buchungstext", + "fieldtype": "Text", + }, + { + "label": "Beleginfo - Art 1", + "fieldname": "Beleginfo - Art 1", + "fieldtype": "Data", + }, + { + "label": "Beleginfo - Inhalt 1", + "fieldname": "Beleginfo - Inhalt 1", + "fieldtype": "Data", + }, + { + "label": "Beleginfo - Art 2", + "fieldname": "Beleginfo - Art 2", + "fieldtype": "Data", + }, + { + "label": "Beleginfo - Inhalt 2", + "fieldname": "Beleginfo - Inhalt 2", + "fieldtype": "Data", + } + ] + + return columns + + +def get_gl_entries(filters, as_dict): + """ + Get a list of accounting entries. + + Select GL Entries joined with Account and Party Account in order to get the + account numbers. Returns a list of accounting entries. + + Arguments: + filters -- dict of filters to be passed to the sql query + as_dict -- return as list of dicts [0,1] + """ + gl_entries = frappe.db.sql(""" + select + + /* either debit or credit amount; always positive */ + case gl.debit when 0 then gl.credit else gl.debit end as 'Umsatz (ohne Soll/Haben-Kz)', + + /* 'H' when credit, 'S' when debit */ + case gl.debit when 0 then 'H' else 'S' end as 'Soll/Haben-Kennzeichen', + + /* account number or, if empty, party account number */ + coalesce(acc.account_number, acc_pa.account_number) as 'Kontonummer', + + /* against number or, if empty, party against number */ + coalesce(acc_against.account_number, acc_against_pa.account_number) as 'Gegenkonto (ohne BU-Schlüssel)', + + gl.posting_date as 'Belegdatum', + gl.remarks as 'Buchungstext', + gl.voucher_type as 'Beleginfo - Art 1', + gl.voucher_no as 'Beleginfo - Inhalt 1', + gl.against_voucher_type as 'Beleginfo - Art 2', + gl.against_voucher as 'Beleginfo - Inhalt 2' + + from `tabGL Entry` gl + + /* Statistisches Konto (Debitoren/Kreditoren) */ + left join `tabParty Account` pa + on gl.against = pa.parent + and gl.company = pa.company + + /* Kontonummer */ + left join `tabAccount` acc + on gl.account = acc.name + + /* Gegenkonto-Nummer */ + left join `tabAccount` acc_against + on gl.against = acc_against.name + + /* Statistische Kontonummer */ + left join `tabAccount` acc_pa + on pa.account = acc_pa.name + + /* Statistische Gegenkonto-Nummer */ + left join `tabAccount` acc_against_pa + on pa.account = acc_against_pa.name + + where gl.company = %(company)s + and DATE(gl.posting_date) >= %(from_date)s + and DATE(gl.posting_date) <= %(to_date)s + order by 'Belegdatum', gl.voucher_no""", filters, as_dict=as_dict) + + return gl_entries + + +def get_datev_csv(data): + """ + Fill in missing columns and return a CSV in DATEV Format. + + Arguments: + data -- array of dictionaries + """ + columns = [ + # All possible columns must tbe listed here, because DATEV requires them to + # be present in the CSV. + # --- + # Umsatz + "Umsatz (ohne Soll/Haben-Kz)", + "Soll/Haben-Kennzeichen", + "WKZ Umsatz", + "Kurs", + "Basis-Umsatz", + "WKZ Basis-Umsatz", + # Konto/Gegenkonto + "Kontonummer", + "Gegenkonto (ohne BU-Schlüssel)", + "BU-Schlüssel", + # Datum + "Belegdatum", + # Belegfelder + "Belegfeld 1", + "Belegfeld 2", + # Weitere Felder + "Skonto", + "Buchungstext", + # OPOS-Informationen + "Postensperre", + "Diverse Adressnummer", + "Geschäftspartnerbank", + "Sachverhalt", + "Zinssperre", + # Digitaler Beleg + "Beleglink", + # Beleginfo + "Beleginfo - Art 1", + "Beleginfo - Inhalt 1", + "Beleginfo - Art 2", + "Beleginfo - Inhalt 2", + "Beleginfo - Art 3", + "Beleginfo - Inhalt 3", + "Beleginfo - Art 4", + "Beleginfo - Inhalt 4", + "Beleginfo - Art 5", + "Beleginfo - Inhalt 5", + "Beleginfo - Art 6", + "Beleginfo - Inhalt 6", + "Beleginfo - Art 7", + "Beleginfo - Inhalt 7", + "Beleginfo - Art 8", + "Beleginfo - Inhalt 8", + # Kostenrechnung + "Kost 1 - Kostenstelle", + "Kost 2 - Kostenstelle", + "Kost-Menge", + # Steuerrechnung + "EU-Land u. UStID", + "EU-Steuersatz", + "Abw. Versteuerungsart", + # L+L Sachverhalt + "Sachverhalt L+L", + "Funktionsergänzung L+L", + # Funktion Steuerschlüssel 49 + "BU 49 Hauptfunktionstyp", + "BU 49 Hauptfunktionsnummer", + "BU 49 Funktionsergänzung", + # Zusatzinformationen + "Zusatzinformation - Art 1", + "Zusatzinformation - Inhalt 1", + "Zusatzinformation - Art 2", + "Zusatzinformation - Inhalt 2", + "Zusatzinformation - Art 3", + "Zusatzinformation - Inhalt 3", + "Zusatzinformation - Art 4", + "Zusatzinformation - Inhalt 4", + "Zusatzinformation - Art 5", + "Zusatzinformation - Inhalt 5", + "Zusatzinformation - Art 6", + "Zusatzinformation - Inhalt 6", + "Zusatzinformation - Art 7", + "Zusatzinformation - Inhalt 7", + "Zusatzinformation - Art 8", + "Zusatzinformation - Inhalt 8", + "Zusatzinformation - Art 9", + "Zusatzinformation - Inhalt 9", + "Zusatzinformation - Art 10", + "Zusatzinformation - Inhalt 10", + "Zusatzinformation - Art 11", + "Zusatzinformation - Inhalt 11", + "Zusatzinformation - Art 12", + "Zusatzinformation - Inhalt 12", + "Zusatzinformation - Art 13", + "Zusatzinformation - Inhalt 13", + "Zusatzinformation - Art 14", + "Zusatzinformation - Inhalt 14", + "Zusatzinformation - Art 15", + "Zusatzinformation - Inhalt 15", + "Zusatzinformation - Art 16", + "Zusatzinformation - Inhalt 16", + "Zusatzinformation - Art 17", + "Zusatzinformation - Inhalt 17", + "Zusatzinformation - Art 18", + "Zusatzinformation - Inhalt 18", + "Zusatzinformation - Art 19", + "Zusatzinformation - Inhalt 19", + "Zusatzinformation - Art 20", + "Zusatzinformation - Inhalt 20", + # Mengenfelder LuF + "Stück", + "Gewicht", + # Forderungsart + "Zahlweise", + "Forderungsart", + "Veranlagungsjahr", + "Zugeordnete Fälligkeit", + # Weitere Felder + "Skontotyp", + # Anzahlungen + "Auftragsnummer", + "Buchungstyp", + "USt-Schlüssel (Anzahlungen)", + "EU-Land (Anzahlungen)", + "Sachverhalt L+L (Anzahlungen)", + "EU-Steuersatz (Anzahlungen)", + "Erlöskonto (Anzahlungen)", + # Stapelinformationen + "Herkunft-Kz", + # Technische Identifikation + "Buchungs GUID", + # Kostenrechnung + "Kost-Datum", + # OPOS-Informationen + "SEPA-Mandatsreferenz", + "Skontosperre", + # Gesellschafter und Sonderbilanzsachverhalt + "Gesellschaftername", + "Beteiligtennummer", + "Identifikationsnummer", + "Zeichnernummer", + # OPOS-Informationen + "Postensperre bis", + # Gesellschafter und Sonderbilanzsachverhalt + "Bezeichnung SoBil-Sachverhalt", + "Kennzeichen SoBil-Buchung", + # Stapelinformationen + "Festschreibung", + # Datum + "Leistungsdatum", + "Datum Zuord. Steuerperiode", + # OPOS-Informationen + "Fälligkeit", + # Konto/Gegenkonto + "Generalumkehr (GU)", + # Steuersatz für Steuerschlüssel + "Steuersatz", + "Land" + ] + + empty_df = pd.DataFrame(columns=columns) + data_df = pd.DataFrame.from_records(data) + + result = empty_df.append(data_df) + result["Belegdatum"] = pd.to_datetime(result["Belegdatum"]) + + return result.to_csv( + sep=b';', + # European decimal seperator + decimal=',', + # Windows "ANSI" encoding + encoding='latin_1', + # format date as DDMM + date_format='%d%m', + # Windows line terminator + line_terminator=b'\r\n', + # Do not number rows + index=False, + # Use all columns defined above + columns=columns + ) + + +@frappe.whitelist() +def download_datev_csv(filters=None): + """ + Provide accounting entries for download in DATEV format. + + Validate the filters, get the data, produce the CSV file and provide it for + download. Can be called like this: + + GET /api/method/erpnext.regional.report.datev.datev.download_datev_csv + + Arguments / Params: + filters -- dict of filters to be passed to the sql query + """ + if isinstance(filters, string_types): + filters = json.loads(filters) + + validate_filters(filters) + data = get_gl_entries(filters, as_dict=1) + + filename = 'DATEV_Buchungsstapel_{}-{}_bis_{}'.format( + filters.get('company'), + filters.get('from_date'), + filters.get('to_date') + ) + + frappe.response['result'] = get_datev_csv(data) + frappe.response['doctype'] = filename + frappe.response['type'] = 'csv' From 459155fae16e3e0c371a391ad383dda0ac1c6da1 Mon Sep 17 00:00:00 2001 From: Deepesh Garg <42651287+deepeshgarg007@users.noreply.github.com> Date: Fri, 14 Jun 2019 12:01:34 +0530 Subject: [PATCH 46/69] fix: GST Validation for UIN and OIDAR (#17866) * fix: GST Validation for UIN and OIDAR * fix: Define GST category * fix: Get gst category only for Customer and Supplier * fix: GST validation * fix: GST validation fixes --- erpnext/regional/india/utils.py | 48 +++++++++++++++++++++------------ 1 file changed, 31 insertions(+), 17 deletions(-) diff --git a/erpnext/regional/india/utils.py b/erpnext/regional/india/utils.py index 8893cab2fd..19022e18fa 100644 --- a/erpnext/regional/india/utils.py +++ b/erpnext/regional/india/utils.py @@ -14,6 +14,15 @@ def validate_gstin_for_india(doc, method): if not hasattr(doc, 'gstin') or not doc.gstin: return + gst_category = [] + + if len(doc.links): + link_doctype = doc.links[0].get("link_doctype") + link_name = doc.links[0].get("link_name") + + if link_doctype in ["Customer", "Supplier"]: + gst_category = frappe.db.get_value(link_doctype, {'name': link_name}, ['gst_category']) + doc.gstin = doc.gstin.upper().strip() if not doc.gstin or doc.gstin == 'NA': return @@ -21,26 +30,31 @@ def validate_gstin_for_india(doc, method): if len(doc.gstin) != 15: frappe.throw(_("Invalid GSTIN! A GSTIN must have 15 characters.")) - p = re.compile("^[0-9]{2}[A-Z]{4}[0-9A-Z]{1}[0-9]{4}[A-Z]{1}[1-9A-Z]{1}[1-9A-Z]{1}[0-9A-Z]{1}$") - if not p.match(doc.gstin): - frappe.throw(_("Invalid GSTIN! The input you've entered doesn't match the format of GSTIN.")) + if gst_category and gst_category == 'UIN Holders': + p = re.compile("^[0-9]{4}[A-Z]{3}[0-9]{5}[0-9A-Z]{3}") + if not p.match(doc.gstin): + frappe.throw(_("Invalid GSTIN! The input you've entered doesn't match the GSTIN format for UIN Holders or Non-Resident OIDAR Service Providers")) + else: + p = re.compile("^[0-9]{2}[A-Z]{4}[0-9A-Z]{1}[0-9]{4}[A-Z]{1}[1-9A-Z]{1}[1-9A-Z]{1}[0-9A-Z]{1}$") + if not p.match(doc.gstin): + frappe.throw(_("Invalid GSTIN! The input you've entered doesn't match the format of GSTIN.")) - validate_gstin_check_digit(doc.gstin) + validate_gstin_check_digit(doc.gstin) - if not doc.gst_state: - if not doc.state: - return - state = doc.state.lower() - states_lowercase = {s.lower():s for s in states} - if state in states_lowercase: - doc.gst_state = states_lowercase[state] - else: - return + if not doc.gst_state: + if not doc.state: + return + state = doc.state.lower() + states_lowercase = {s.lower():s for s in states} + if state in states_lowercase: + doc.gst_state = states_lowercase[state] + else: + return - doc.gst_state_number = state_numbers[doc.gst_state] - if doc.gst_state_number != doc.gstin[:2]: - frappe.throw(_("Invalid GSTIN! First 2 digits of GSTIN should match with State number {0}.") - .format(doc.gst_state_number)) + doc.gst_state_number = state_numbers[doc.gst_state] + if doc.gst_state_number != doc.gstin[:2]: + frappe.throw(_("Invalid GSTIN! First 2 digits of GSTIN should match with State number {0}.") + .format(doc.gst_state_number)) def validate_gstin_check_digit(gstin): ''' Function to validate the check digit of the GSTIN.''' From b095d0a0c51844eec9d84fddb95813969b83a3a2 Mon Sep 17 00:00:00 2001 From: Deepesh Garg <42651287+deepeshgarg007@users.noreply.github.com> Date: Fri, 14 Jun 2019 12:02:36 +0530 Subject: [PATCH 47/69] fix: GSTR-2 Report fixes (#17903) --- erpnext/regional/report/gstr_1/gstr_1.py | 5 ++++- erpnext/regional/report/gstr_2/gstr_2.py | 7 +++++-- 2 files changed, 9 insertions(+), 3 deletions(-) diff --git a/erpnext/regional/report/gstr_1/gstr_1.py b/erpnext/regional/report/gstr_1/gstr_1.py index a6de94a9da..9d8fa2ae53 100644 --- a/erpnext/regional/report/gstr_1/gstr_1.py +++ b/erpnext/regional/report/gstr_1/gstr_1.py @@ -209,7 +209,10 @@ class Gstr1Report(object): sum(i.get('base_net_amount', 0) for i in items if i.item_code == d.item_code and i.parent == d.parent)) - item_tax_rate = json.loads(d.item_tax_rate) + item_tax_rate = {} + + if d.item_tax_rate: + item_tax_rate = json.loads(d.item_tax_rate) if item_tax_rate: self.item_tax_rate.setdefault(d.parent, {}).setdefault(d.item_code, item_tax_rate) diff --git a/erpnext/regional/report/gstr_2/gstr_2.py b/erpnext/regional/report/gstr_2/gstr_2.py index a362269007..d9cab63fef 100644 --- a/erpnext/regional/report/gstr_2/gstr_2.py +++ b/erpnext/regional/report/gstr_2/gstr_2.py @@ -43,8 +43,11 @@ class Gstr2Report(Gstr1Report): self.get_igst_invoices() for inv, items_based_on_rate in self.items_based_on_tax_rate.items(): invoice_details = self.invoices.get(inv) - for rate, items in items_based_on_rate.items(): - row, taxable_value = self.get_row_data_for_invoice(inv, invoice_details, rate, items) + for key, items in items_based_on_rate.items(): + rate = key[0] + account = key[1] + + row, taxable_value = self.get_row_data_for_invoice(inv, invoice_details, rate, account, items) tax_amount = taxable_value * rate / 100 if inv in self.igst_invoices: row += [tax_amount, 0, 0] From 4c1639305f2c39da83a2bbc50634543464f7f674 Mon Sep 17 00:00:00 2001 From: Anurag Mishra Date: Fri, 14 Jun 2019 12:11:23 +0530 Subject: [PATCH 48/69] feat: creating stock entry against purchase receipt --- erpnext/controllers/queries.py | 3 --- .../doctype/work_order/work_order.js | 7 +++--- .../purchase_receipt/purchase_receipt.js | 9 +++++++ .../purchase_receipt/purchase_receipt.py | 22 ++++++++++++++++ .../stock_entry_detail.json | 25 ++++++++++++++----- .../report/stock_balance/stock_balance.js | 3 --- 6 files changed, 54 insertions(+), 15 deletions(-) diff --git a/erpnext/controllers/queries.py b/erpnext/controllers/queries.py index 0dcf077c47..ccd334ffba 100644 --- a/erpnext/controllers/queries.py +++ b/erpnext/controllers/queries.py @@ -152,9 +152,6 @@ def tax_account_query(doctype, txt, searchfield, start, page_len, filters): def item_query(doctype, txt, searchfield, start, page_len, filters, as_dict=False): conditions = [] - if not filters["item_group"]: - filters.pop("item_group", None) - description_cond = '' if frappe.db.count('Item', cache=True) < 50000: # scan description only if items are less than 50000 diff --git a/erpnext/manufacturing/doctype/work_order/work_order.js b/erpnext/manufacturing/doctype/work_order/work_order.js index 580243fce8..22613cc8a4 100644 --- a/erpnext/manufacturing/doctype/work_order/work_order.js +++ b/erpnext/manufacturing/doctype/work_order/work_order.js @@ -72,9 +72,10 @@ frappe.ui.form.on("Work Order", { frm.set_query("production_item", function() { return { query: "erpnext.controllers.queries.item_query", - filters:{ - 'is_stock_item': 1, - } + filters:[ + ['is_stock_item', '=',1], + ['default_bom', '!=', ''] + ] } }); diff --git a/erpnext/stock/doctype/purchase_receipt/purchase_receipt.js b/erpnext/stock/doctype/purchase_receipt/purchase_receipt.js index 21513640ed..e82aa2c63e 100644 --- a/erpnext/stock/doctype/purchase_receipt/purchase_receipt.js +++ b/erpnext/stock/doctype/purchase_receipt/purchase_receipt.js @@ -107,6 +107,8 @@ erpnext.stock.PurchaseReceiptController = erpnext.buying.BuyingController.extend cur_frm.add_custom_button(__('Return'), this.make_purchase_return, __('Create')); + cur_frm.add_custom_button(__('Make Stock Entry'), cur_frm.cscript['Make Stock Entry'], __('Create')); + if(flt(this.frm.doc.per_billed) < 100) { cur_frm.add_custom_button(__('Invoice'), this.make_purchase_invoice, __('Create')); } @@ -249,6 +251,13 @@ frappe.ui.form.on('Purchase Receipt Item', { }, }); +cur_frm.cscript['Make Stock Entry'] = function() { + frappe.model.open_mapped_doc({ + method: "erpnext.stock.doctype.purchase_receipt.purchase_receipt.make_stock_entry", + frm: cur_frm, + }) +} + var validate_sample_quantity = function(frm, cdt, cdn) { var d = locals[cdt][cdn]; if (d.sample_quantity) { diff --git a/erpnext/stock/doctype/purchase_receipt/purchase_receipt.py b/erpnext/stock/doctype/purchase_receipt/purchase_receipt.py index 1a469c5218..cdca44d60b 100644 --- a/erpnext/stock/doctype/purchase_receipt/purchase_receipt.py +++ b/erpnext/stock/doctype/purchase_receipt/purchase_receipt.py @@ -12,6 +12,7 @@ from frappe.utils import getdate from erpnext.controllers.buying_controller import BuyingController from erpnext.accounts.utils import get_account_currency from frappe.desk.notifications import clear_doctype_notifications +from frappe.model.mapper import get_mapped_doc from erpnext.buying.utils import check_on_hold_or_closed_status from erpnext.assets.doctype.asset.asset import get_asset_account, is_cwip_accounting_disabled from six import iteritems @@ -530,3 +531,24 @@ def make_purchase_return(source_name, target_doc=None): def update_purchase_receipt_status(docname, status): pr = frappe.get_doc("Purchase Receipt", docname) pr.update_status(status) + +@frappe.whitelist() +def make_stock_entry(source_name,target_doc=None): + def set_missing_values(source, target): + target.stock_entry_type = "Material Transfer" + target.purpose = "Material Transfer" + + doclist = get_mapped_doc("Purchase Receipt", source_name,{ + "Purchase Receipt": { + "doctype": "Stock Entry", + }, + "Purchase Receipt Item": { + "doctype": "Stock Entry Detail", + "field_map": { + "warehouse": "s_warehouse", + "parent": "reference_purchase_receipt" + }, + }, + }, target_doc, set_missing_values) + + return doclist diff --git a/erpnext/stock/doctype/stock_entry_detail/stock_entry_detail.json b/erpnext/stock/doctype/stock_entry_detail/stock_entry_detail.json index 8834035776..5933700457 100644 --- a/erpnext/stock/doctype/stock_entry_detail/stock_entry_detail.json +++ b/erpnext/stock/doctype/stock_entry_detail/stock_entry_detail.json @@ -13,6 +13,7 @@ "t_warehouse", "sec_break1", "item_code", + "item_group", "col_break2", "item_name", "section_break_8", @@ -59,7 +60,8 @@ "against_stock_entry", "ste_detail", "column_break_51", - "transferred_qty" + "transferred_qty", + "reference_purchase_receipt" ], "fields": [ { @@ -72,7 +74,6 @@ "fieldtype": "Section Break" }, { - "columns": 2, "fieldname": "s_warehouse", "fieldtype": "Link", "in_list_view": 1, @@ -86,7 +87,6 @@ "fieldtype": "Column Break" }, { - "columns": 2, "fieldname": "t_warehouse", "fieldtype": "Link", "in_list_view": 1, @@ -101,7 +101,6 @@ }, { "bold": 1, - "columns": 3, "fieldname": "item_code", "fieldtype": "Link", "in_global_search": 1, @@ -164,7 +163,6 @@ }, { "bold": 1, - "columns": 3, "fieldname": "qty", "fieldtype": "Float", "in_list_view": 1, @@ -460,15 +458,30 @@ { "fieldname": "dimension_col_break", "fieldtype": "Column Break" + }, + { + "fetch_from": "item_code.item_group", + "fieldname": "item_group", + "fieldtype": "Data", + "in_list_view": 1, + "label": "Item Group" + }, + { + "fieldname": "reference_purchase_receipt", + "fieldtype": "Link", + "label": "Reference Purchase Receipt", + "options": "Purchase Receipt", + "read_only": 1 } ], "idx": 1, "istable": 1, - "modified": "2019-05-25 22:51:00.802226", + "modified": "2019-06-14 11:58:41.958144", "modified_by": "Administrator", "module": "Stock", "name": "Stock Entry Detail", "owner": "Administrator", "permissions": [], + "sort_field": "modified", "sort_order": "ASC" } \ No newline at end of file diff --git a/erpnext/stock/report/stock_balance/stock_balance.js b/erpnext/stock/report/stock_balance/stock_balance.js index 120f879f20..3829d6a5b4 100644 --- a/erpnext/stock/report/stock_balance/stock_balance.js +++ b/erpnext/stock/report/stock_balance/stock_balance.js @@ -41,9 +41,6 @@ frappe.query_reports["Stock Balance"] = { "get_query": function() { return { query: "erpnext.controllers.queries.item_query", - filters: { - "item_group": frappe.query_report.get_filter_value("item_group") - } } } }, From 8f04f6c631e3abc921ff48bc7200db0822d80a90 Mon Sep 17 00:00:00 2001 From: deepeshgarg007 Date: Fri, 14 Jun 2019 13:08:09 +0530 Subject: [PATCH 49/69] fix: GSTR-3b Report fixes --- .../doctype/gstr_3b_report/gstr_3b_report.py | 36 ++++++++++--------- 1 file changed, 20 insertions(+), 16 deletions(-) diff --git a/erpnext/regional/doctype/gstr_3b_report/gstr_3b_report.py b/erpnext/regional/doctype/gstr_3b_report/gstr_3b_report.py index 01da810d76..946650bd4e 100644 --- a/erpnext/regional/doctype/gstr_3b_report/gstr_3b_report.py +++ b/erpnext/regional/doctype/gstr_3b_report/gstr_3b_report.py @@ -138,14 +138,15 @@ class GSTR3BReport(Document): outward_supply_tax_amounts = self.get_tax_amounts("Sales Invoice") inward_supply_tax_amounts = self.get_tax_amounts("Purchase Invoice", reverse_charge="Y") itc_details = self.get_itc_details() - inter_state_supplies = self.get_inter_state_supplies(self.gst_details.get("gst_state")) - inward_nil_exempt = self.get_inward_nil_exempt(self.gst_details.get("gst_state")) self.prepare_data("Sales Invoice", outward_supply_tax_amounts, "sup_details", "osup_det", ["Registered Regular"]) self.prepare_data("Sales Invoice", outward_supply_tax_amounts, "sup_details", "osup_zero", ["SEZ", "Deemed Export", "Overseas"]) self.prepare_data("Purchase Invoice", inward_supply_tax_amounts, "sup_details", "isup_rev", ["Registered Regular"], reverse_charge="Y") self.report_dict["sup_details"]["osup_nil_exmp"]["txval"] = flt(self.get_nil_rated_supply_value(), 2) self.set_itc_details(itc_details) + + inter_state_supplies = self.get_inter_state_supplies(self.gst_details.get("gst_state_number")) + inward_nil_exempt = self.get_inward_nil_exempt(self.gst_details.get("gst_state")) self.set_inter_state_supply(inter_state_supplies) self.set_inward_nil_exempt(inward_nil_exempt) @@ -221,7 +222,7 @@ class GSTR3BReport(Document): for k, v in iteritems(account_map): txval -= self.report_dict.get(supply_type, {}).get(supply_category, {}).get(v, 0) - self.report_dict[supply_type][supply_category]["txval"] = flt(txval, 2) + self.report_dict[supply_type][supply_category]["txval"] += flt(txval, 2) def set_inter_state_supply(self, inter_state_supply): @@ -283,15 +284,13 @@ class GSTR3BReport(Document): and s.company = %s and s.company_gstin = %s""", (self.month_no, self.year, self.company, self.gst_details.get("gstin")), as_dict=1)[0].total - def get_inter_state_supplies(self, state): + def get_inter_state_supplies(self, state_number): - inter_state_supply = frappe.db.sql(""" select sum(s.grand_total) as total, t.tax_amount, a.gst_state, s.gst_category - from `tabSales Invoice` s, `tabSales Taxes and Charges` t, `tabAddress` a - where t.parent = s.name and s.customer_address = a.name and - s.docstatus = 1 and month(s.posting_date) = %s and year(s.posting_date) = %s and - a.gst_state <> %s and s.company = %s and s.company_gstin = %s and - s.gst_category in ('Unregistered', 'Registered Composition', 'UIN Holders') - group by s.gst_category, a.state""", (self.month_no, self.year, state, self.company, self.gst_details.get("gstin")), as_dict=1) + inter_state_supply = frappe.db.sql(""" select sum(s.net_total) as total, sum(t.tax_amount) as tax_amount, s.place_of_supply, s.gst_category + from `tabSales Invoice` s, `tabSales Taxes and Charges` t + where t.parent = s.name and s.docstatus = 1 and month(s.posting_date) = %s and year(s.posting_date) = %s + and s.company = %s and s.company_gstin = %s and s.gst_category in ('Unregistered', 'Registered Composition', 'UIN Holders') + group by s.gst_category, s.place_of_supply""", (self.month_no, self.year, self.company, self.gst_details.get("gstin")), as_dict=1, debug=1) inter_state_supply_details = {} @@ -300,11 +299,16 @@ class GSTR3BReport(Document): d.gst_category, [] ) - inter_state_supply_details[d.gst_category].append({ - "pos": get_state_code(d.gst_state), - "txval": d.total - d.tax_amount, - "iamt": d.tax_amount - }) + if state_number != d.place_of_supply.split("-")[0]: + inter_state_supply_details[d.gst_category].append({ + "pos": d.place_of_supply, + "txval": d.total, + "iamt": d.tax_amount + }) + else: + self.report_dict["sup_details"]["osup_det"]["txval"] += flt(d.total/2, 2) + self.report_dict["sup_details"]["osup_det"]["camt"] += flt(d.tax_amount/2, 2) + self.report_dict["sup_details"]["osup_det"]["samt"] += flt(d.tax_amount/2, 2) return inter_state_supply_details From e6dd55d9f2e612d8bf09f4bc9890da5ec69f8d90 Mon Sep 17 00:00:00 2001 From: Anurag Mishra Date: Mon, 3 Jun 2019 17:48:39 +0530 Subject: [PATCH 50/69] feat: dashboards for HR module --- .../appraisal_template_dashboard.py | 12 ++++++++ .../hr/doctype/employee/employee_dashboard.py | 22 +++++++++----- .../employee_onboarding_template_dashboard.py | 12 ++++++++ .../employee_separation_template_dashboard.py | 12 ++++++++ .../holiday_list/holiday_list_dashboard.py | 3 ++ .../job_applicant/job_applicant_dashboard.py | 16 ++++++++++ .../job_opening/job_opening_dashboard.py | 12 ++++++++ .../leave_allocation_dashboard.py | 15 ++++++++++ .../loan_application_dashboard.py | 12 ++++++++ .../doctype/loan_type/loan_type_dashboard.py | 12 ++++++++ .../payroll_period_dashboard.py | 13 ++++++++ .../salary_structure_dashboard.py | 10 +++++-- .../shift_request/shift_request_dashboard.py | 12 ++++++++ .../shift_type/shift_type_dashboard.py | 12 ++++++++ .../staffing_plan/staffing_plan_dashboard.py | 12 ++++++++ .../training_event_dashboard.py | 13 ++++++++ .../hr/doctype/vehicle/vehicle_dashboard.py | 30 ++++++++++++------- 17 files changed, 210 insertions(+), 20 deletions(-) create mode 100644 erpnext/hr/doctype/appraisal_template/appraisal_template_dashboard.py create mode 100644 erpnext/hr/doctype/employee_onboarding_template/employee_onboarding_template_dashboard.py create mode 100644 erpnext/hr/doctype/employee_separation_template/employee_separation_template_dashboard.py create mode 100644 erpnext/hr/doctype/job_applicant/job_applicant_dashboard.py create mode 100644 erpnext/hr/doctype/job_opening/job_opening_dashboard.py create mode 100644 erpnext/hr/doctype/leave_allocation/leave_allocation_dashboard.py create mode 100644 erpnext/hr/doctype/loan_application/loan_application_dashboard.py create mode 100644 erpnext/hr/doctype/loan_type/loan_type_dashboard.py create mode 100644 erpnext/hr/doctype/payroll_period/payroll_period_dashboard.py create mode 100644 erpnext/hr/doctype/shift_request/shift_request_dashboard.py create mode 100644 erpnext/hr/doctype/shift_type/shift_type_dashboard.py create mode 100644 erpnext/hr/doctype/staffing_plan/staffing_plan_dashboard.py create mode 100644 erpnext/hr/doctype/training_event/training_event_dashboard.py diff --git a/erpnext/hr/doctype/appraisal_template/appraisal_template_dashboard.py b/erpnext/hr/doctype/appraisal_template/appraisal_template_dashboard.py new file mode 100644 index 0000000000..309427e30c --- /dev/null +++ b/erpnext/hr/doctype/appraisal_template/appraisal_template_dashboard.py @@ -0,0 +1,12 @@ +from __future__ import unicode_literals +from frappe import _ + +def get_data(): + return { + 'fieldname': 'kra_template', + 'transactions': [ + { + 'items': ['Appraisal'] + }, + ], + } \ No newline at end of file diff --git a/erpnext/hr/doctype/employee/employee_dashboard.py b/erpnext/hr/doctype/employee/employee_dashboard.py index 46461da1a5..14fa466845 100644 --- a/erpnext/hr/doctype/employee/employee_dashboard.py +++ b/erpnext/hr/doctype/employee/employee_dashboard.py @@ -13,23 +13,31 @@ def get_data(): }, { 'label': _('Payroll'), - 'items': ['Salary Structure Assignment', 'Salary Slip', 'Timesheet'] + 'items': ['Salary Structure Assignment', 'Salary Slip', 'Additional Salary', 'Timesheet'] + }, + { + 'label': _('Shift'), + 'items': ['Shift Request', 'Shift Assignment'] }, { 'label': _('Expense'), - 'items': ['Expense Claim'] + 'items': ['Expense Claim', 'Travel Request'] }, { 'label': _('Evaluation'), 'items': ['Appraisal'] }, - { - 'label': _('Training'), - 'items': ['Training Event', 'Training Result'] - }, { 'label': _('Lifecycle'), 'items': ['Employee Transfer', 'Employee Promotion', 'Employee Separation'] - } + }, + { + 'label': _('Benefit'), + 'items': ['Employee Incentive', 'Retention Bonus','Employee Benefit Application', 'Employee Benefit Claim'] + }, + { + 'label': _('Training'), + 'items': ['Training Event', 'Training Result', 'Training Feedback', 'Employee Skill Map'] + }, ] } \ No newline at end of file diff --git a/erpnext/hr/doctype/employee_onboarding_template/employee_onboarding_template_dashboard.py b/erpnext/hr/doctype/employee_onboarding_template/employee_onboarding_template_dashboard.py new file mode 100644 index 0000000000..837da53016 --- /dev/null +++ b/erpnext/hr/doctype/employee_onboarding_template/employee_onboarding_template_dashboard.py @@ -0,0 +1,12 @@ +from __future__ import unicode_literals +from frappe import _ + +def get_data(): + return { + 'fieldname': 'employee_onboarding_template', + 'transactions': [ + { + 'items': ['Employee Onboarding'] + }, + ], + } \ No newline at end of file diff --git a/erpnext/hr/doctype/employee_separation_template/employee_separation_template_dashboard.py b/erpnext/hr/doctype/employee_separation_template/employee_separation_template_dashboard.py new file mode 100644 index 0000000000..39345f0766 --- /dev/null +++ b/erpnext/hr/doctype/employee_separation_template/employee_separation_template_dashboard.py @@ -0,0 +1,12 @@ +from __future__ import unicode_literals +from frappe import _ + +def get_data(): + return { + 'fieldname': 'employee_separation_template', + 'transactions': [ + { + 'items': ['Employee Separation'] + }, + ], + } \ No newline at end of file diff --git a/erpnext/hr/doctype/holiday_list/holiday_list_dashboard.py b/erpnext/hr/doctype/holiday_list/holiday_list_dashboard.py index d1599a4f47..22e1de0c34 100644 --- a/erpnext/hr/doctype/holiday_list/holiday_list_dashboard.py +++ b/erpnext/hr/doctype/holiday_list/holiday_list_dashboard.py @@ -13,6 +13,9 @@ def get_data(): }, { 'items': ['Leave Period', 'Shift Type'] + }, + { + 'items': ['Service Level', 'Service Level Agreement'] } ] } \ No newline at end of file diff --git a/erpnext/hr/doctype/job_applicant/job_applicant_dashboard.py b/erpnext/hr/doctype/job_applicant/job_applicant_dashboard.py new file mode 100644 index 0000000000..2478a6395a --- /dev/null +++ b/erpnext/hr/doctype/job_applicant/job_applicant_dashboard.py @@ -0,0 +1,16 @@ +from __future__ import unicode_literals +from frappe import _ + +def get_data(): + return { + 'fieldname': 'job_applicant', + 'transactions': [ + { + 'label': _('Employee'), + 'items': ['Employee', 'Employee Onboarding'] + }, + { + 'items': ['Job Offer'] + }, + ], + } \ No newline at end of file diff --git a/erpnext/hr/doctype/job_opening/job_opening_dashboard.py b/erpnext/hr/doctype/job_opening/job_opening_dashboard.py new file mode 100644 index 0000000000..c0890b4f57 --- /dev/null +++ b/erpnext/hr/doctype/job_opening/job_opening_dashboard.py @@ -0,0 +1,12 @@ +from __future__ import unicode_literals +from frappe import _ + +def get_data(): + return { + 'fieldname': 'job_title', + 'transactions': [ + { + 'items': ['Job Applicant'] + } + ], + } \ No newline at end of file diff --git a/erpnext/hr/doctype/leave_allocation/leave_allocation_dashboard.py b/erpnext/hr/doctype/leave_allocation/leave_allocation_dashboard.py new file mode 100644 index 0000000000..72a1b7c194 --- /dev/null +++ b/erpnext/hr/doctype/leave_allocation/leave_allocation_dashboard.py @@ -0,0 +1,15 @@ +from __future__ import unicode_literals +from frappe import _ + +def get_data(): + return { + 'fieldname': 'leave_allocation', + 'transactions': [ + { + 'items': ['Compensatory Leave Request'] + }, + { + 'items': ['Leave Encashment'] + } + ], + } \ No newline at end of file diff --git a/erpnext/hr/doctype/loan_application/loan_application_dashboard.py b/erpnext/hr/doctype/loan_application/loan_application_dashboard.py new file mode 100644 index 0000000000..232c6e3c5b --- /dev/null +++ b/erpnext/hr/doctype/loan_application/loan_application_dashboard.py @@ -0,0 +1,12 @@ +from __future__ import unicode_literals +from frappe import _ + +def get_data(): + return { + 'fieldname': 'loan_application', + 'transactions': [ + { + 'items': ['Loan'] + }, + ], + } \ No newline at end of file diff --git a/erpnext/hr/doctype/loan_type/loan_type_dashboard.py b/erpnext/hr/doctype/loan_type/loan_type_dashboard.py new file mode 100644 index 0000000000..07b11fe627 --- /dev/null +++ b/erpnext/hr/doctype/loan_type/loan_type_dashboard.py @@ -0,0 +1,12 @@ +from __future__ import unicode_literals +from frappe import _ + +def get_data(): + return { + 'fieldname': 'loan_type', + 'transactions': [ + { + 'items': ['Loan Application'] + }, + ], + } \ No newline at end of file diff --git a/erpnext/hr/doctype/payroll_period/payroll_period_dashboard.py b/erpnext/hr/doctype/payroll_period/payroll_period_dashboard.py new file mode 100644 index 0000000000..d524861e4b --- /dev/null +++ b/erpnext/hr/doctype/payroll_period/payroll_period_dashboard.py @@ -0,0 +1,13 @@ +from __future__ import unicode_literals +from frappe import _ + +def get_data(): + return { + 'fieldname': 'payroll_period', + 'transactions': [ + { + 'label': _('Employee Tax Exemption'), + 'items': ['Employee Tax Exemption Proof Submission', 'Employee Tax Exemption Declaration'] + }, + ], + } \ No newline at end of file diff --git a/erpnext/hr/doctype/salary_structure/salary_structure_dashboard.py b/erpnext/hr/doctype/salary_structure/salary_structure_dashboard.py index 3803c1d3ea..547f2b81be 100644 --- a/erpnext/hr/doctype/salary_structure/salary_structure_dashboard.py +++ b/erpnext/hr/doctype/salary_structure/salary_structure_dashboard.py @@ -4,9 +4,15 @@ from frappe import _ def get_data(): return { 'fieldname': 'salary_structure', + 'non_standard_fieldnames': { + 'Employee Grade': 'default_salary_structure' + }, 'transactions': [ { - 'items': ['Salary Structure Assignment'] - } + 'items': ['Salary Structure Assignment', 'Salary Slip'] + }, + { + 'items': ['Employee Grade'] + }, ] } \ No newline at end of file diff --git a/erpnext/hr/doctype/shift_request/shift_request_dashboard.py b/erpnext/hr/doctype/shift_request/shift_request_dashboard.py new file mode 100644 index 0000000000..e3bf5df949 --- /dev/null +++ b/erpnext/hr/doctype/shift_request/shift_request_dashboard.py @@ -0,0 +1,12 @@ +from __future__ import unicode_literals +from frappe import _ + +def get_data(): + return { + 'fieldname': 'shift_request', + 'transactions': [ + { + 'items': ['Shift Assignment'] + }, + ], + } \ No newline at end of file diff --git a/erpnext/hr/doctype/shift_type/shift_type_dashboard.py b/erpnext/hr/doctype/shift_type/shift_type_dashboard.py new file mode 100644 index 0000000000..91dfbad7b1 --- /dev/null +++ b/erpnext/hr/doctype/shift_type/shift_type_dashboard.py @@ -0,0 +1,12 @@ +from __future__ import unicode_literals +from frappe import _ + +def get_data(): + return { + 'fieldname': 'shift_type', + 'transactions': [ + { + 'items': ['Shift Request', 'Shift Assignment'] + } + ], + } \ No newline at end of file diff --git a/erpnext/hr/doctype/staffing_plan/staffing_plan_dashboard.py b/erpnext/hr/doctype/staffing_plan/staffing_plan_dashboard.py new file mode 100644 index 0000000000..35a303f0fb --- /dev/null +++ b/erpnext/hr/doctype/staffing_plan/staffing_plan_dashboard.py @@ -0,0 +1,12 @@ +from __future__ import unicode_literals +from frappe import _ + +def get_data(): + return { + 'fieldname': 'staffing_plan', + 'transactions': [ + { + 'items': ['Job Opening'] + } + ], + } \ No newline at end of file diff --git a/erpnext/hr/doctype/training_event/training_event_dashboard.py b/erpnext/hr/doctype/training_event/training_event_dashboard.py new file mode 100644 index 0000000000..663832d45f --- /dev/null +++ b/erpnext/hr/doctype/training_event/training_event_dashboard.py @@ -0,0 +1,13 @@ +from __future__ import unicode_literals +from frappe import _ + +def get_data(): + return { + 'fieldname': 'training_event', + 'transactions': [ + { + 'label': _('Result And Feedback'), + 'items': ['Training Result', 'Training Feedback'] + }, + ], + } \ No newline at end of file diff --git a/erpnext/hr/doctype/vehicle/vehicle_dashboard.py b/erpnext/hr/doctype/vehicle/vehicle_dashboard.py index d27c7ac009..00f1baf859 100644 --- a/erpnext/hr/doctype/vehicle/vehicle_dashboard.py +++ b/erpnext/hr/doctype/vehicle/vehicle_dashboard.py @@ -1,14 +1,22 @@ from __future__ import unicode_literals from frappe import _ -data = { - 'heatmap': True, - 'heatmap_message': _('This is based on logs against this Vehicle. See timeline below for details'), - 'fieldname': 'license_plate', - 'transactions': [ - { - 'label': _('Logs'), - 'items': ['Vehicle Log'] - } - ] -} \ No newline at end of file +def get_data(): + return { + 'heatmap': True, + 'heatmap_message': _('This is based on logs against this Vehicle. See timeline below for details'), + 'fieldname': 'license_plate', + 'non_standard_fieldnames':{ + 'Delivery Trip': 'vehicle' + }, + 'transactions': [ + { + 'label': _('Logs'), + 'items': ['Vehicle Log'] + }, + { + 'label': _('Trip'), + 'items': ['Delivery Trip'] + } + ] + } \ No newline at end of file From 0ae6cbdd01dd155b8d5fefef9dd7ad9e17309ca5 Mon Sep 17 00:00:00 2001 From: Anurag Mishra Date: Thu, 13 Jun 2019 19:47:11 +0530 Subject: [PATCH 51/69] fix: requested Changes --- erpnext/hr/doctype/job_applicant/job_applicant_dashboard.py | 1 - erpnext/hr/doctype/payroll_period/payroll_period_dashboard.py | 1 - erpnext/hr/doctype/training_event/training_event_dashboard.py | 1 - erpnext/hr/doctype/vehicle/vehicle_dashboard.py | 2 -- 4 files changed, 5 deletions(-) diff --git a/erpnext/hr/doctype/job_applicant/job_applicant_dashboard.py b/erpnext/hr/doctype/job_applicant/job_applicant_dashboard.py index 2478a6395a..7f131151e1 100644 --- a/erpnext/hr/doctype/job_applicant/job_applicant_dashboard.py +++ b/erpnext/hr/doctype/job_applicant/job_applicant_dashboard.py @@ -6,7 +6,6 @@ def get_data(): 'fieldname': 'job_applicant', 'transactions': [ { - 'label': _('Employee'), 'items': ['Employee', 'Employee Onboarding'] }, { diff --git a/erpnext/hr/doctype/payroll_period/payroll_period_dashboard.py b/erpnext/hr/doctype/payroll_period/payroll_period_dashboard.py index d524861e4b..4e9c7c9e7c 100644 --- a/erpnext/hr/doctype/payroll_period/payroll_period_dashboard.py +++ b/erpnext/hr/doctype/payroll_period/payroll_period_dashboard.py @@ -6,7 +6,6 @@ def get_data(): 'fieldname': 'payroll_period', 'transactions': [ { - 'label': _('Employee Tax Exemption'), 'items': ['Employee Tax Exemption Proof Submission', 'Employee Tax Exemption Declaration'] }, ], diff --git a/erpnext/hr/doctype/training_event/training_event_dashboard.py b/erpnext/hr/doctype/training_event/training_event_dashboard.py index 663832d45f..1c1645c766 100644 --- a/erpnext/hr/doctype/training_event/training_event_dashboard.py +++ b/erpnext/hr/doctype/training_event/training_event_dashboard.py @@ -6,7 +6,6 @@ def get_data(): 'fieldname': 'training_event', 'transactions': [ { - 'label': _('Result And Feedback'), 'items': ['Training Result', 'Training Feedback'] }, ], diff --git a/erpnext/hr/doctype/vehicle/vehicle_dashboard.py b/erpnext/hr/doctype/vehicle/vehicle_dashboard.py index 00f1baf859..761c70182b 100644 --- a/erpnext/hr/doctype/vehicle/vehicle_dashboard.py +++ b/erpnext/hr/doctype/vehicle/vehicle_dashboard.py @@ -11,11 +11,9 @@ def get_data(): }, 'transactions': [ { - 'label': _('Logs'), 'items': ['Vehicle Log'] }, { - 'label': _('Trip'), 'items': ['Delivery Trip'] } ] From e87ebcaf046f9c70c5285f53b39e7b1aabea1ac4 Mon Sep 17 00:00:00 2001 From: Anurag Mishra Date: Fri, 14 Jun 2019 14:10:38 +0530 Subject: [PATCH 52/69] fix: upadated employee dashboard --- .../hr/doctype/employee/employee_dashboard.py | 16 ++++++++-------- 1 file changed, 8 insertions(+), 8 deletions(-) diff --git a/erpnext/hr/doctype/employee/employee_dashboard.py b/erpnext/hr/doctype/employee/employee_dashboard.py index 14fa466845..e3cc33d142 100644 --- a/erpnext/hr/doctype/employee/employee_dashboard.py +++ b/erpnext/hr/doctype/employee/employee_dashboard.py @@ -12,8 +12,8 @@ def get_data(): 'items': ['Attendance', 'Attendance Request', 'Leave Application', 'Leave Allocation'] }, { - 'label': _('Payroll'), - 'items': ['Salary Structure Assignment', 'Salary Slip', 'Additional Salary', 'Timesheet'] + 'label': _('Lifecycle'), + 'items': ['Employee Transfer', 'Employee Promotion', 'Employee Separation'] }, { 'label': _('Shift'), @@ -23,17 +23,17 @@ def get_data(): 'label': _('Expense'), 'items': ['Expense Claim', 'Travel Request'] }, + { + 'label': _('Benefit'), + 'items': ['Employee Benefit Application', 'Employee Benefit Claim'] + }, { 'label': _('Evaluation'), 'items': ['Appraisal'] }, { - 'label': _('Lifecycle'), - 'items': ['Employee Transfer', 'Employee Promotion', 'Employee Separation'] - }, - { - 'label': _('Benefit'), - 'items': ['Employee Incentive', 'Retention Bonus','Employee Benefit Application', 'Employee Benefit Claim'] + 'label': _('Payroll'), + 'items': ['Salary Structure Assignment', 'Salary Slip', 'Additional Salary', 'Timesheet','Employee Incentive', 'Retention Bonus'] }, { 'label': _('Training'), From 37a717aa98950b5a3733bca444f7400ed94e77b4 Mon Sep 17 00:00:00 2001 From: deepeshgarg007 Date: Fri, 14 Jun 2019 14:30:36 +0530 Subject: [PATCH 53/69] fix: Seperate queries for Taxable value and tax amounts --- .../doctype/gstr_3b_report/gstr_3b_report.py | 25 +++++++++++++------ 1 file changed, 17 insertions(+), 8 deletions(-) diff --git a/erpnext/regional/doctype/gstr_3b_report/gstr_3b_report.py b/erpnext/regional/doctype/gstr_3b_report/gstr_3b_report.py index 946650bd4e..6569833659 100644 --- a/erpnext/regional/doctype/gstr_3b_report/gstr_3b_report.py +++ b/erpnext/regional/doctype/gstr_3b_report/gstr_3b_report.py @@ -286,15 +286,24 @@ class GSTR3BReport(Document): def get_inter_state_supplies(self, state_number): - inter_state_supply = frappe.db.sql(""" select sum(s.net_total) as total, sum(t.tax_amount) as tax_amount, s.place_of_supply, s.gst_category + inter_state_supply_taxable_value = frappe.db.sql(""" select sum(s.net_total) as total, s.place_of_supply, s.gst_category + from `tabSales Invoice` s where s.docstatus = 1 and month(s.posting_date) = %s and year(s.posting_date) = %s + and s.company = %s and s.company_gstin = %s and s.gst_category in ('Unregistered', 'Registered Composition', 'UIN Holders') + group by s.gst_category, s.place_of_supply""", (self.month_no, self.year, self.company, self.gst_details.get("gstin")), as_dict=1) + + inter_state_supply_tax = frappe.db.sql(""" select sum(t.tax_amount) as tax_amount, s.place_of_supply, s.gst_category from `tabSales Invoice` s, `tabSales Taxes and Charges` t where t.parent = s.name and s.docstatus = 1 and month(s.posting_date) = %s and year(s.posting_date) = %s and s.company = %s and s.company_gstin = %s and s.gst_category in ('Unregistered', 'Registered Composition', 'UIN Holders') - group by s.gst_category, s.place_of_supply""", (self.month_no, self.year, self.company, self.gst_details.get("gstin")), as_dict=1, debug=1) + group by s.gst_category, s.place_of_supply""", (self.month_no, self.year, self.company, self.gst_details.get("gstin")), as_dict=1) + inter_state_supply_tax_mapping={} inter_state_supply_details = {} - for d in inter_state_supply: + for d in inter_state_supply_tax: + inter_state_supply_tax_mapping.setdefault(d.place_of_supply, d.tax_amount) + + for d in inter_state_supply_taxable_value: inter_state_supply_details.setdefault( d.gst_category, [] ) @@ -302,13 +311,13 @@ class GSTR3BReport(Document): if state_number != d.place_of_supply.split("-")[0]: inter_state_supply_details[d.gst_category].append({ "pos": d.place_of_supply, - "txval": d.total, - "iamt": d.tax_amount + "txval": flt(d.total, 2), + "iamt": flt(inter_state_supply_tax_mapping.get(d.place_of_supply), 2) }) else: - self.report_dict["sup_details"]["osup_det"]["txval"] += flt(d.total/2, 2) - self.report_dict["sup_details"]["osup_det"]["camt"] += flt(d.tax_amount/2, 2) - self.report_dict["sup_details"]["osup_det"]["samt"] += flt(d.tax_amount/2, 2) + self.report_dict["sup_details"]["osup_det"]["txval"] += flt(d.total, 2) + self.report_dict["sup_details"]["osup_det"]["camt"] += flt(inter_state_supply_tax_mapping.get(d.place_of_supply)/2, 2) + self.report_dict["sup_details"]["osup_det"]["samt"] += flt(inter_state_supply_tax_mapping.get(d.place_of_supply)/2, 2) return inter_state_supply_details From a5527225b694c6b95b5b4506df601b40388283e9 Mon Sep 17 00:00:00 2001 From: Anurag Mishra Date: Fri, 14 Jun 2019 15:25:57 +0530 Subject: [PATCH 54/69] fix: requested changes --- erpnext/patches.txt | 2 +- erpnext/regional/india/setup.py | 2 +- erpnext/setup/doctype/company/company.json | 7 +++++-- 3 files changed, 7 insertions(+), 4 deletions(-) diff --git a/erpnext/patches.txt b/erpnext/patches.txt index 15fd82ea72..747177a3a7 100644 --- a/erpnext/patches.txt +++ b/erpnext/patches.txt @@ -602,6 +602,6 @@ erpnext.patches.v11_1.set_salary_details_submittable erpnext.patches.v11_1.rename_depends_on_lwp execute:frappe.delete_doc("Report", "Inactive Items") erpnext.patches.v11_1.delete_scheduling_tool -erpnext.patches.v12_0.make_custom_fields_for_bank_remittance +erpnext.patches.v12_0.make_custom_fields_for_bank_remittance #14-06-2019 execute:frappe.delete_doc_if_exists("Page", "support-analytics") erpnext.patches.v12_0.make_item_manufacturer \ No newline at end of file diff --git a/erpnext/regional/india/setup.py b/erpnext/regional/india/setup.py index f69c17e0c8..26fdb1a904 100644 --- a/erpnext/regional/india/setup.py +++ b/erpnext/regional/india/setup.py @@ -275,7 +275,7 @@ def make_custom_fields(update=True): ], 'Company': [ dict(fieldname='hra_section', label='HRA Settings', - fieldtype='Section Break', insert_after='asset_received_but_not_billed'), + fieldtype='Section Break', insert_after='asset_received_but_not_billed', collapsible=1), dict(fieldname='basic_component', label='Basic Component', fieldtype='Link', options='Salary Component', insert_after='hra_section'), dict(fieldname='hra_component', label='HRA Component', diff --git a/erpnext/setup/doctype/company/company.json b/erpnext/setup/doctype/company/company.json index fcccf5a973..d85fc45b46 100644 --- a/erpnext/setup/doctype/company/company.json +++ b/erpnext/setup/doctype/company/company.json @@ -170,9 +170,10 @@ "label": "Company Description" }, { + "collapsible": 1, "fieldname": "sales_settings", "fieldtype": "Section Break", - "label": "Sales" + "label": "Sales Settings" }, { "fieldname": "sales_monthly_history", @@ -530,6 +531,7 @@ "options": "Account" }, { + "collapsible": 1, "fieldname": "fixed_asset_depreciation_settings", "fieldtype": "Section Break", "label": "Fixed Asset Depreciation Settings" @@ -602,6 +604,7 @@ "options": "Role" }, { + "collapsible": 1, "description": "For reference only.", "fieldname": "company_info", "fieldtype": "Section Break", @@ -708,7 +711,7 @@ "icon": "fa fa-building", "idx": 1, "image_field": "company_logo", - "modified": "2019-06-13 18:03:14.764423", + "modified": "2019-06-14 14:36:11.363309", "modified_by": "Administrator", "module": "Setup", "name": "Company", From f472a49cf69990581599e79984f559fcd6d1b882 Mon Sep 17 00:00:00 2001 From: Faris Ansari Date: Fri, 14 Jun 2019 16:32:21 +0530 Subject: [PATCH 55/69] fix: Remove Specifications label --- erpnext/templates/generators/item/item_specifications.html | 2 -- 1 file changed, 2 deletions(-) diff --git a/erpnext/templates/generators/item/item_specifications.html b/erpnext/templates/generators/item/item_specifications.html index a12a074fa9..469a45fd7d 100644 --- a/erpnext/templates/generators/item/item_specifications.html +++ b/erpnext/templates/generators/item/item_specifications.html @@ -1,8 +1,6 @@ {% if doc.website_specifications -%}
-
{{ _("Specifications") }}
-
{%= __(range2) %} {%= __(range3) %} {%= __(range4) %}{%= __(range5) %}{%= __(range6) %} {%= __("Total") %}
{%= __("Total Outstanding") %}{%= format_currency(balance_row[range1]) %}{%= format_number(balance_row[range1], null, 2) %} {%= format_currency(balance_row[range2]) %} {%= format_currency(balance_row[range3]) %} {%= format_currency(balance_row[range4]) %}{%= format_currency(balance_row[range5]) %}{%= format_currency(balance_row[range6]) %} {%= format_currency(flt(balance_row[("outstanding_amount")]), data[data.length-1]["currency"]) %} {%= format_currency(flt(balance_row[("pdc/lc_amount")]), data[data.length-1]["currency"]) %} {%= format_currency(flt(balance_row[("outstanding_amount")]-balance_row[("pdc/lc_amount")]), data[data.length-1]["currency"]) %}
{% for d in doc.website_specifications -%} From 1ecc78266c793a0c0b405485d80039da54c8efa0 Mon Sep 17 00:00:00 2001 From: Rohit Waghchaure Date: Fri, 14 Jun 2019 17:29:26 +0530 Subject: [PATCH 56/69] fix: added promotional scheme in selling and buying module page --- erpnext/config/buying.py | 7 ++++++- erpnext/config/selling.py | 5 +++++ 2 files changed, 11 insertions(+), 1 deletion(-) diff --git a/erpnext/config/buying.py b/erpnext/config/buying.py index 264f88f9c1..d1b0d91728 100644 --- a/erpnext/config/buying.py +++ b/erpnext/config/buying.py @@ -70,11 +70,16 @@ def get_data(): "link": "Tree/Item Group", "description": _("Tree of Item Groups."), }, + { + "type": "doctype", + "name": "Promotional Scheme", + "description": _("Rules for applying different promotional schemes.") + }, { "type": "doctype", "name": "Pricing Rule", "description": _("Rules for applying pricing and discount.") - }, + } ] }, { diff --git a/erpnext/config/selling.py b/erpnext/config/selling.py index 9209ca96aa..b31eb02cf7 100644 --- a/erpnext/config/selling.py +++ b/erpnext/config/selling.py @@ -111,6 +111,11 @@ def get_data(): "description": _("Bundle items at time of sale."), "dependencies": ["Item"], }, + { + "type": "doctype", + "name": "Promotional Scheme", + "description": _("Rules for applying different promotional schemes.") + }, { "type": "doctype", "name": "Pricing Rule", From 22642a5f45a4fa92a33d973bcfb9014dd273d15d Mon Sep 17 00:00:00 2001 From: Faris Ansari Date: Fri, 14 Jun 2019 18:15:40 +0530 Subject: [PATCH 57/69] fix: Homepage products styling (#17912) --- erpnext/templates/pages/home.html | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/erpnext/templates/pages/home.html b/erpnext/templates/pages/home.html index b67a4651db..2ef9c10534 100644 --- a/erpnext/templates/pages/home.html +++ b/erpnext/templates/pages/home.html @@ -33,7 +33,7 @@ {% for item in homepage.products %}
-
+
{{ item.item_name }}
{{ _('More details') }} From b2ab1031e35acfee35816dcf4cc68d4d441707e4 Mon Sep 17 00:00:00 2001 From: Faris Ansari Date: Fri, 14 Jun 2019 18:16:14 +0530 Subject: [PATCH 58/69] fix: Show Clear filters when attribute filters are set --- erpnext/www/all-products/index.html | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/erpnext/www/all-products/index.html b/erpnext/www/all-products/index.html index ade72a25ce..f09021412b 100644 --- a/erpnext/www/all-products/index.html +++ b/erpnext/www/all-products/index.html @@ -42,7 +42,7 @@
- {% if frappe.form_dict.start or frappe.form_dict.field_filters or frappe.form_dict.search %} + {% if frappe.form_dict.start or frappe.form_dict.field_filters or frappe.form_dict.attribute_filters or frappe.form_dict.search %} {{ _('Clear filters') }} {% endif %} From 8e99aaf6050afdf258343397c5e70109e89b56ea Mon Sep 17 00:00:00 2001 From: Faris Ansari Date: Fri, 14 Jun 2019 20:06:54 +0530 Subject: [PATCH 59/69] fix: Add erpnext website theme import --- erpnext/public/js/website_theme.js | 15 ++++++--------- 1 file changed, 6 insertions(+), 9 deletions(-) diff --git a/erpnext/public/js/website_theme.js b/erpnext/public/js/website_theme.js index 6c7edfa655..84de2f5b51 100644 --- a/erpnext/public/js/website_theme.js +++ b/erpnext/public/js/website_theme.js @@ -2,16 +2,13 @@ // MIT License. See license.txt frappe.ui.form.on('Website Theme', { - apply_custom_theme(frm) { - let custom_theme = frm.doc.custom_theme; - custom_theme = custom_theme.split('\n'); - if ( - frm.doc.apply_custom_theme - && custom_theme.length === 2 - && custom_theme[1].includes('frappe/public/scss/website') + validate(frm) { + let theme_scss = frm.doc.theme_scss; + if (theme_scss.includes('frappe/public/scss/website') + && !theme_scss.includes('erpnext/public/scss/website') ) { - frm.set_value('custom_theme', - `$primary: #7575ff;\n@import "frappe/public/scss/website";\n@import "erpnext/public/scss/website";`); + frm.set_value('theme_scss', + `${frm.doc.theme_scss}\n@import "erpnext/public/scss/website";`); } } }); From b821af44b6af3d9d1bfd12a2ae371711873f6801 Mon Sep 17 00:00:00 2001 From: Rohit Waghchaure Date: Mon, 17 Jun 2019 07:40:21 +0530 Subject: [PATCH 60/69] fix: revert group by voucher general ledger changes --- erpnext/accounts/report/general_ledger/general_ledger.py | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/erpnext/accounts/report/general_ledger/general_ledger.py b/erpnext/accounts/report/general_ledger/general_ledger.py index 307b72d4e8..d9f395b895 100644 --- a/erpnext/accounts/report/general_ledger/general_ledger.py +++ b/erpnext/accounts/report/general_ledger/general_ledger.py @@ -128,7 +128,8 @@ def get_gl_entries(filters): order_by_statement = "order by posting_date, voucher_type, voucher_no" if filters.get("group_by") == _("Group by Voucher (Consolidated)"): - group_by_statement = "group by voucher_type, voucher_no, account, cost_center, against_voucher" + group_by_statement = "group by voucher_type, voucher_no, account, cost_center" + select_fields = """, sum(debit) as debit, sum(credit) as credit, sum(debit_in_account_currency) as debit_in_account_currency, sum(credit_in_account_currency) as credit_in_account_currency""" From 7e3a98ba334b0f5c965459848d6b79892ddec970 Mon Sep 17 00:00:00 2001 From: deepeshgarg007 Date: Mon, 17 Jun 2019 12:44:49 +0530 Subject: [PATCH 61/69] fix: Is group filter fixes in dimensions --- erpnext/public/js/utils/dimension_tree_filter.js | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) diff --git a/erpnext/public/js/utils/dimension_tree_filter.js b/erpnext/public/js/utils/dimension_tree_filter.js index 16c1d4d248..f31b578b0b 100644 --- a/erpnext/public/js/utils/dimension_tree_filter.js +++ b/erpnext/public/js/utils/dimension_tree_filter.js @@ -14,9 +14,13 @@ erpnext.doctypes_with_dimensions.forEach((doctype) => { onload: function(frm) { dimension_filters.then((dimensions) => { dimensions.forEach((dimension) => { - frm.set_query(dimension['fieldname'],{ - "is_group": 0 - }); + frappe.model.with_doctype(dimension['document_type'], () => { + if (frappe.meta.has_field(dimension['document_type'], 'is_group')) { + frm.set_query(dimension['fieldname'],{ + "is_group": 0 + }); + } + }) }); }); } From d1e0f42fea2937d95e595534d023b9cc4a4914cd Mon Sep 17 00:00:00 2001 From: deepeshgarg007 Date: Mon, 17 Jun 2019 12:47:39 +0530 Subject: [PATCH 62/69] fix: Styling fix --- erpnext/public/js/utils/dimension_tree_filter.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/erpnext/public/js/utils/dimension_tree_filter.js b/erpnext/public/js/utils/dimension_tree_filter.js index f31b578b0b..ccca04df26 100644 --- a/erpnext/public/js/utils/dimension_tree_filter.js +++ b/erpnext/public/js/utils/dimension_tree_filter.js @@ -16,7 +16,7 @@ erpnext.doctypes_with_dimensions.forEach((doctype) => { dimensions.forEach((dimension) => { frappe.model.with_doctype(dimension['document_type'], () => { if (frappe.meta.has_field(dimension['document_type'], 'is_group')) { - frm.set_query(dimension['fieldname'],{ + frm.set_query(dimension['fieldname'], { "is_group": 0 }); } From 725f56faca7795fb74451cb8495a14b6cc7ec648 Mon Sep 17 00:00:00 2001 From: Rohit Waghchaure Date: Mon, 17 Jun 2019 12:50:44 +0530 Subject: [PATCH 63/69] feat: delayed order reports --- .../report/delayed_item_report/__init__.py | 0 .../delayed_item_report.js | 62 +++++++ .../delayed_item_report.json | 37 ++++ .../delayed_item_report.py | 168 ++++++++++++++++++ .../report/delayed_order_report/__init__.py | 0 .../delayed_order_report.js | 62 +++++++ .../delayed_order_report.json | 37 ++++ .../delayed_order_report.py | 83 +++++++++ 8 files changed, 449 insertions(+) create mode 100644 erpnext/stock/report/delayed_item_report/__init__.py create mode 100644 erpnext/stock/report/delayed_item_report/delayed_item_report.js create mode 100644 erpnext/stock/report/delayed_item_report/delayed_item_report.json create mode 100644 erpnext/stock/report/delayed_item_report/delayed_item_report.py create mode 100644 erpnext/stock/report/delayed_order_report/__init__.py create mode 100644 erpnext/stock/report/delayed_order_report/delayed_order_report.js create mode 100644 erpnext/stock/report/delayed_order_report/delayed_order_report.json create mode 100644 erpnext/stock/report/delayed_order_report/delayed_order_report.py diff --git a/erpnext/stock/report/delayed_item_report/__init__.py b/erpnext/stock/report/delayed_item_report/__init__.py new file mode 100644 index 0000000000..e69de29bb2 diff --git a/erpnext/stock/report/delayed_item_report/delayed_item_report.js b/erpnext/stock/report/delayed_item_report/delayed_item_report.js new file mode 100644 index 0000000000..5d160b1519 --- /dev/null +++ b/erpnext/stock/report/delayed_item_report/delayed_item_report.js @@ -0,0 +1,62 @@ +// Copyright (c) 2016, Frappe Technologies Pvt. Ltd. and contributors +// For license information, please see license.txt +/* eslint-disable */ + +frappe.query_reports["Delayed Item Report"] = { + "filters": [ + { + fieldname: "company", + label: __("Company"), + fieldtype: "Link", + options: "Company", + default: frappe.defaults.get_default("company"), + reqd: 1 + }, + { + fieldname:"from_date", + label: __("From Date"), + fieldtype: "Date", + default: frappe.datetime.month_start(), + reqd: 1 + }, + { + fieldname:"to_date", + label: __("To Date"), + fieldtype: "Date", + default: frappe.datetime.now_date(), + reqd: 1 + }, + { + fieldname:"sales_order", + label: __("Sales Order"), + fieldtype: "Link", + options: "Sales Order", + }, + { + fieldname:"customer", + label: __("Customer"), + fieldtype: "Link", + options: "Customer", + }, + { + fieldname:"customer_group", + label: __("Customer Group"), + fieldtype: "Link", + options: "Customer Group", + }, + { + fieldname:"item_group", + label: __("Item Group"), + fieldtype: "Link", + options: "Item Group", + }, + { + fieldname:"based_on", + label: __("Based On"), + fieldtype: "Select", + options: ["Delivery Note", "Sales Invoice"], + default: "Delivery Note", + reqd: 1 + }, + ] +} \ No newline at end of file diff --git a/erpnext/stock/report/delayed_item_report/delayed_item_report.json b/erpnext/stock/report/delayed_item_report/delayed_item_report.json new file mode 100644 index 0000000000..f336cecf20 --- /dev/null +++ b/erpnext/stock/report/delayed_item_report/delayed_item_report.json @@ -0,0 +1,37 @@ +{ + "add_total_row": 0, + "creation": "2019-06-17 12:45:07.324014", + "disable_prepared_report": 0, + "disabled": 0, + "docstatus": 0, + "doctype": "Report", + "idx": 0, + "is_standard": "Yes", + "letter_head": "Gadgets International", + "modified": "2019-06-17 12:45:07.324014", + "modified_by": "Administrator", + "module": "Stock", + "name": "Delayed Item Report", + "owner": "Administrator", + "prepared_report": 0, + "ref_doctype": "Delivery Note", + "report_name": "Delayed Item Report", + "report_type": "Script Report", + "roles": [ + { + "role": "Accounts User" + }, + { + "role": "Sales User" + }, + { + "role": "Stock Manager" + }, + { + "role": "Stock User" + }, + { + "role": "Maintenance User" + } + ] +} \ No newline at end of file diff --git a/erpnext/stock/report/delayed_item_report/delayed_item_report.py b/erpnext/stock/report/delayed_item_report/delayed_item_report.py new file mode 100644 index 0000000000..7b968b89a7 --- /dev/null +++ b/erpnext/stock/report/delayed_item_report/delayed_item_report.py @@ -0,0 +1,168 @@ +# Copyright (c) 2013, Frappe Technologies Pvt. Ltd. and contributors +# For license information, please see license.txt + +from __future__ import unicode_literals +import frappe +from frappe import _ +from frappe.utils import date_diff + +def execute(filters=None, consolidated = False): + data, columns = DelayedItemReport(filters).run() + + return data, columns + +class DelayedItemReport(object): + def __init__(self, filters=None): + self.filters = frappe._dict(filters or {}) + + def run(self): + return self.get_columns(), self.get_data() or [] + + def get_data(self, consolidated=False): + conditions = "" + + doctype = self.filters.get("based_on") + child_doc= "%s Item" % doctype + + if doctype == "Sales Invoice": + conditions = " and `tabSales Invoice`.update_stock = 1 and `tabSales Invoice`.is_pos = 0" + + if self.filters.get("item_group"): + conditions += " and `tab%s`.item_group = %s" % (child_doc, + frappe.db.escape(self.filters.get("item_group"))) + + for field in ["customer", "customer_group", "company"]: + if self.filters.get(field): + conditions += " and `tab%s`.%s = %s" % (doctype, + field, frappe.db.escape(self.filters.get(field))) + + sales_order_field = "against_sales_order" + if doctype == "Sales Invoice": + sales_order_field = "sales_order" + + if self.filters.get("sales_order"): + conditions = " and `tab%s`.%s = '%s'" %(child_doc, sales_order_field, self.filters.get("sales_order")) + + self.transactions = frappe.db.sql(""" SELECT `tab{child_doc}`.item_code, `tab{child_doc}`.item_name, + `tab{child_doc}`.item_group, `tab{child_doc}`.qty, `tab{child_doc}`.rate, `tab{child_doc}`.amount, + `tab{child_doc}`.so_detail, `tab{child_doc}`.{so_field} as sales_order, + `tab{doctype}`.customer, `tab{doctype}`.posting_date, `tab{doctype}`.name, `tab{doctype}`.grand_total + FROM `tab{child_doc}`, `tab{doctype}` + WHERE + `tab{child_doc}`.parent = `tab{doctype}`.name and `tab{doctype}`.docstatus = 1 and + `tab{doctype}`.posting_date between %(from_date)s and %(to_date)s and + `tab{child_doc}`.{so_field} is not null and `tab{child_doc}`.{so_field} != '' {cond} + """.format(cond=conditions, doctype=doctype, child_doc=child_doc, so_field=sales_order_field), { + 'from_date': self.filters.get('from_date'), + 'to_date': self.filters.get('to_date') + }, as_dict=1) + + if self.transactions: + self.filter_transactions_data(consolidated) + + return self.transactions + + def filter_transactions_data(self, consolidated=False): + sales_orders = [d.sales_order for d in self.transactions] + doctype = "Sales Order" + filters = {'name': ('in', sales_orders)} + + if not consolidated: + sales_order_items = [d.so_detail for d in self.transactions] + doctype = "Sales Order Item" + filters = {'parent': ('in', sales_orders), 'name': ('in', sales_order_items)} + + so_data = {} + for d in frappe.get_all(doctype, filters = filters, + fields = ["delivery_date", "parent", "name"]): + key = d.name if consolidated else (d.parent, d.name) + if key not in so_data: + so_data.setdefault(key, d.delivery_date) + + for row in self.transactions: + key = row.sales_order if consolidated else (row.sales_order, row.so_detail) + row.update({ + 'delivery_date': so_data.get(key), + 'delayed_days': date_diff(row.posting_date, so_data.get(key)) + }) + + return self.transactions + + def get_columns(self): + based_on = self.filters.get("based_on") + + return [{ + "label": _(based_on), + "fieldname": "name", + "fieldtype": "Link", + "options": based_on, + "width": 100 + },{ + "label": _("Customer"), + "fieldname": "customer", + "fieldtype": "Link", + "options": "Customer", + "width": 100 + }, + { + "label": _("Expected Delivery Date"), + "fieldname": "delivery_date", + "fieldtype": "Date", + "width": 100 + }, + { + "label": _("Actual Delivery Date"), + "fieldname": "posting_date", + "fieldtype": "Date", + "width": 100 + }, + { + "label": _("Item Code"), + "fieldname": "item_code", + "fieldtype": "Link", + "options": "Item", + "width": 100 + }, + { + "label": _("Item Name"), + "fieldname": "item_name", + "fieldtype": "Data", + "width": 100 + }, + { + "label": _("Quantity"), + "fieldname": "qty", + "fieldtype": "Float", + "width": 100 + }, + { + "label": _("Rate"), + "fieldname": "rate", + "fieldtype": "Currency", + "width": 100 + }, + { + "label": _("Amount"), + "fieldname": "amount", + "fieldtype": "Currency", + "width": 100 + }, + { + "label": _("Delayed Days"), + "fieldname": "delayed_days", + "fieldtype": "Int", + "width": 100 + }, + { + "label": _("Sales Order"), + "fieldname": "sales_order", + "fieldtype": "Link", + "options": "Sales Order", + "width": 100 + }, + { + "label": _("Customer PO"), + "fieldname": "po_no", + "fieldtype": "Data", + "width": 100 + }] \ No newline at end of file diff --git a/erpnext/stock/report/delayed_order_report/__init__.py b/erpnext/stock/report/delayed_order_report/__init__.py new file mode 100644 index 0000000000..e69de29bb2 diff --git a/erpnext/stock/report/delayed_order_report/delayed_order_report.js b/erpnext/stock/report/delayed_order_report/delayed_order_report.js new file mode 100644 index 0000000000..11752ae9fb --- /dev/null +++ b/erpnext/stock/report/delayed_order_report/delayed_order_report.js @@ -0,0 +1,62 @@ +// Copyright (c) 2016, Frappe Technologies Pvt. Ltd. and contributors +// For license information, please see license.txt +/* eslint-disable */ + +frappe.query_reports["Delayed Order Report"] = { + "filters": [ + { + fieldname: "company", + label: __("Company"), + fieldtype: "Link", + options: "Company", + default: frappe.defaults.get_default("company"), + reqd: 1 + }, + { + fieldname:"from_date", + label: __("From Date"), + fieldtype: "Date", + default: frappe.datetime.month_start(), + reqd: 1 + }, + { + fieldname:"to_date", + label: __("To Date"), + fieldtype: "Date", + default: frappe.datetime.now_date(), + reqd: 1 + }, + { + fieldname:"sales_order", + label: __("Sales Order"), + fieldtype: "Link", + options: "Sales Order", + }, + { + fieldname:"customer", + label: __("Customer"), + fieldtype: "Link", + options: "Customer", + }, + { + fieldname:"customer_group", + label: __("Customer Group"), + fieldtype: "Link", + options: "Customer Group", + }, + { + fieldname:"item_group", + label: __("Item Group"), + fieldtype: "Link", + options: "Item Group", + }, + { + fieldname:"based_on", + label: __("Based On"), + fieldtype: "Select", + options: ["Delivery Note", "Sales Invoice"], + default: "Delivery Note", + reqd: 1 + }, + ] +} \ No newline at end of file diff --git a/erpnext/stock/report/delayed_order_report/delayed_order_report.json b/erpnext/stock/report/delayed_order_report/delayed_order_report.json new file mode 100644 index 0000000000..29c27cb1a6 --- /dev/null +++ b/erpnext/stock/report/delayed_order_report/delayed_order_report.json @@ -0,0 +1,37 @@ +{ + "add_total_row": 0, + "creation": "2019-06-17 12:45:56.359322", + "disable_prepared_report": 0, + "disabled": 0, + "docstatus": 0, + "doctype": "Report", + "idx": 0, + "is_standard": "Yes", + "letter_head": "Gadgets International", + "modified": "2019-06-17 12:45:56.359322", + "modified_by": "Administrator", + "module": "Stock", + "name": "Delayed Order Report", + "owner": "Administrator", + "prepared_report": 0, + "ref_doctype": "Delivery Note", + "report_name": "Delayed Order Report", + "report_type": "Script Report", + "roles": [ + { + "role": "Accounts User" + }, + { + "role": "Sales User" + }, + { + "role": "Stock Manager" + }, + { + "role": "Stock User" + }, + { + "role": "Maintenance User" + } + ] +} \ No newline at end of file diff --git a/erpnext/stock/report/delayed_order_report/delayed_order_report.py b/erpnext/stock/report/delayed_order_report/delayed_order_report.py new file mode 100644 index 0000000000..d2a1a30d9e --- /dev/null +++ b/erpnext/stock/report/delayed_order_report/delayed_order_report.py @@ -0,0 +1,83 @@ +# Copyright (c) 2013, Frappe Technologies Pvt. Ltd. and contributors +# For license information, please see license.txt + +from __future__ import unicode_literals +from frappe import _ +from erpnext.stock.report.delayed_item_report.delayed_item_report import DelayedItemReport + +def execute(filters=None): + columns, data = [], [] + + columns, data = DelayedOrderReport(filters).run() + + return columns, data + +class DelayedOrderReport(DelayedItemReport): + def run(self): + return self.get_columns(), self.get_data(consolidated=True) or [] + + def get_data(self, consolidated=False): + data = super(DelayedOrderReport, self).get_data(consolidated) or [] + + so_list = [] + result = [] + for d in data: + if d.sales_order not in so_list: + so_list.append(d.sales_order) + result.append(d) + + return result + + def get_columns(self): + based_on = self.filters.get("based_on") + + return [{ + "label": _(based_on), + "fieldname": "name", + "fieldtype": "Link", + "options": based_on, + "width": 100 + },{ + "label": _("Customer"), + "fieldname": "customer", + "fieldtype": "Link", + "options": "Customer", + "width": 100 + }, + { + "label": _("Expected Delivery Date"), + "fieldname": "delivery_date", + "fieldtype": "Date", + "width": 100 + }, + { + "label": _("Actual Delivery Date"), + "fieldname": "posting_date", + "fieldtype": "Date", + "width": 100 + }, + { + "label": _("Amount"), + "fieldname": "grand_total", + "fieldtype": "Currency", + "width": 100 + }, + { + "label": _("Delayed Days"), + "fieldname": "delayed_days", + "fieldtype": "Int", + "width": 100 + }, + { + "label": _("Sales Order"), + "fieldname": "sales_order", + "fieldtype": "Link", + "options": "Sales Order", + "width": 100 + }, + { + "label": _("Customer PO"), + "fieldname": "po_no", + "fieldtype": "Data", + "width": 100 + }] \ No newline at end of file From 7efeffa66a391d70f871c5267dcc4ae310c34e1e Mon Sep 17 00:00:00 2001 From: Rohit Waghchaure Date: Mon, 17 Jun 2019 16:19:23 +0530 Subject: [PATCH 64/69] fix: allow edit is enabled in the pos profile still user not able to edit the rates --- .../page/point_of_sale/point_of_sale.js | 21 +++++++++++++++++++ 1 file changed, 21 insertions(+) diff --git a/erpnext/selling/page/point_of_sale/point_of_sale.js b/erpnext/selling/page/point_of_sale/point_of_sale.js index 1218dd3bb4..d233b41787 100644 --- a/erpnext/selling/page/point_of_sale/point_of_sale.js +++ b/erpnext/selling/page/point_of_sale/point_of_sale.js @@ -779,6 +779,17 @@ class POSCart { const customer = this.frm.doc.customer; this.customer_field.set_value(customer); + + if (this.numpad) { + const disable_btns = this.disable_numpad_control() + const enable_btns = [__('Rate'), __('Disc')] + + if (disable_btns) { + enable_btns.filter(btn => !disable_btns.includes(btn)) + } + + this.numpad.enable_buttons(enable_btns); + } } get_grand_total() { @@ -1551,6 +1562,16 @@ class NumberPad { } } + enable_buttons(btns) { + btns.forEach((btn) => { + const $btn = this.get_btn(btn); + $btn.prop("disabled", false) + $btn.hover(() => { + $btn.css('cursor','pointer'); + }) + }) + } + set_class() { for (const btn in this.add_class) { const class_name = this.add_class[btn]; From 803f78435102745c71ff88a81937d06c9b66329b Mon Sep 17 00:00:00 2001 From: Rushabh Mehta Date: Mon, 17 Jun 2019 17:33:04 +0530 Subject: [PATCH 65/69] fix(minor): format date in user format for accounting dashboard --- .../account_balance_timeline/account_balance_timeline.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/erpnext/accounts/dashboard_chart_source/account_balance_timeline/account_balance_timeline.py b/erpnext/accounts/dashboard_chart_source/account_balance_timeline/account_balance_timeline.py index f2abb81dbb..648cc68dac 100644 --- a/erpnext/accounts/dashboard_chart_source/account_balance_timeline/account_balance_timeline.py +++ b/erpnext/accounts/dashboard_chart_source/account_balance_timeline/account_balance_timeline.py @@ -3,7 +3,7 @@ from __future__ import unicode_literals import frappe, json -from frappe.utils import add_to_date, date_diff, getdate, nowdate, get_last_day +from frappe.utils import add_to_date, date_diff, getdate, nowdate, get_last_day, formatdate from erpnext.accounts.report.general_ledger.general_ledger import execute from frappe.core.page.dashboard.dashboard import cache_source, get_from_date_from_timespan from frappe.desk.doctype.dashboard_chart.dashboard_chart import get_period_ending @@ -37,7 +37,7 @@ def get(chart_name=None, from_date = None, to_date = None): result = build_result(account, dates, gl_entries) return { - "labels": [r[0].strftime('%Y-%m-%d') for r in result], + "labels": [formatdate(r[0].strftime('%Y-%m-%d')) for r in result], "datasets": [{ "name": account, "values": [r[1] for r in result] From 4803e817e9efbcaf910e60b37ff38d43a3ad48a3 Mon Sep 17 00:00:00 2001 From: Rohit Waghchaure Date: Mon, 17 Jun 2019 14:57:05 +0530 Subject: [PATCH 66/69] fix: bank guarantee, not able to select the purchase order --- erpnext/accounts/doctype/bank_guarantee/bank_guarantee.js | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/erpnext/accounts/doctype/bank_guarantee/bank_guarantee.js b/erpnext/accounts/doctype/bank_guarantee/bank_guarantee.js index 2a44cb3b52..0acbe2009f 100644 --- a/erpnext/accounts/doctype/bank_guarantee/bank_guarantee.js +++ b/erpnext/accounts/doctype/bank_guarantee/bank_guarantee.js @@ -43,8 +43,13 @@ frappe.ui.form.on('Bank Guarantee', { reference_docname: function(frm) { if (frm.doc.reference_docname && frm.doc.reference_doctype) { - let fields_to_fetch = ["project", "grand_total"]; + let fields_to_fetch = ["grand_total"]; let party_field = frm.doc.reference_doctype == "Sales Order" ? "customer" : "supplier"; + + if (frm.doc.reference_doctype == "Sales Order") { + fields_to_fetch.push("project"); + } + fields_to_fetch.push(party_field); frappe.call({ method: "erpnext.accounts.doctype.bank_guarantee.bank_guarantee.get_vouchar_detials", From 3d47a6dbb5a7d36559edcff41529934f851fbe6b Mon Sep 17 00:00:00 2001 From: Anurag Mishra <32095923+Anurag810@users.noreply.github.com> Date: Mon, 17 Jun 2019 17:49:04 +0530 Subject: [PATCH 67/69] fix: Company filters in Total Stock Summary Report (#17965) --- .../total_stock_summary.js | 19 +++++++++++++++++-- 1 file changed, 17 insertions(+), 2 deletions(-) diff --git a/erpnext/stock/report/total_stock_summary/total_stock_summary.js b/erpnext/stock/report/total_stock_summary/total_stock_summary.js index b7461c485f..90648f1b24 100644 --- a/erpnext/stock/report/total_stock_summary/total_stock_summary.js +++ b/erpnext/stock/report/total_stock_summary/total_stock_summary.js @@ -10,8 +10,23 @@ frappe.query_reports["Total Stock Summary"] = { "fieldtype": "Select", "width": "80", "reqd": 1, - "options": ["","Warehouse", "Company"], - "default": "Warehouse" + "options": ["", "Warehouse", "Company"], + "change": function() { + let group_by = frappe.query_report.get_filter_value("group_by") + let company_filter = frappe.query_report.get_filter("company") + if (group_by == "Company") { + company_filter.df.reqd = 0; + company_filter.df.hidden = 1; + frappe.query_report.set_filter_value("company", ""); + company_filter.refresh(); + } + else { + company_filter.df.reqd = 1; + company_filter.df.hidden = 0; + company_filter.refresh(); + frappe.query_report.refresh(); + } + } }, { "fieldname": "company", From 946eefe039c46f0add94f6d88178e6cba0c2e892 Mon Sep 17 00:00:00 2001 From: deepeshgarg007 Date: Mon, 17 Jun 2019 23:10:36 +0530 Subject: [PATCH 68/69] fix: Codacy fixes --- erpnext/public/js/utils/dimension_tree_filter.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/erpnext/public/js/utils/dimension_tree_filter.js b/erpnext/public/js/utils/dimension_tree_filter.js index ccca04df26..fef450795b 100644 --- a/erpnext/public/js/utils/dimension_tree_filter.js +++ b/erpnext/public/js/utils/dimension_tree_filter.js @@ -20,7 +20,7 @@ erpnext.doctypes_with_dimensions.forEach((doctype) => { "is_group": 0 }); } - }) + }); }); }); } From 2632107129bc8726a7dcd6d70c1d6df7d4bd8eab Mon Sep 17 00:00:00 2001 From: Faris Ansari Date: Wed, 19 Jun 2019 12:15:37 +0530 Subject: [PATCH 69/69] fix: User MultiSelectList control for Party filter (#17943) * fix: User MultiSelectList control for Party filter The comma based filter wouldn't work for values that had comma in them * fix: Replace with MultiSelectList in reports * fix: Parse json instead of string split --- .../accounts/report/financial_statements.py | 4 +- .../report/general_ledger/general_ledger.js | 92 +++---------------- .../report/general_ledger/general_ledger.py | 9 +- .../gross_and_net_profit_report.js | 30 +----- .../profit_and_loss_statement.js | 30 +----- erpnext/public/js/financial_statements.js | 31 +------ 6 files changed, 31 insertions(+), 165 deletions(-) diff --git a/erpnext/accounts/report/financial_statements.py b/erpnext/accounts/report/financial_statements.py index 41205ae2b0..c06856aa75 100644 --- a/erpnext/accounts/report/financial_statements.py +++ b/erpnext/accounts/report/financial_statements.py @@ -390,8 +390,8 @@ def get_additional_conditions(from_date, ignore_closing_entries, filters): if filters: if filters.get("project"): if not isinstance(filters.get("project"), list): - projects = frappe.safe_encode(filters.get("project")) - filters.project = [d.strip() for d in projects.strip().split(',') if d] + filters.project = frappe.parse_json(filters.get("project")) + additional_conditions.append("project in %(project)s") if filters.get("cost_center"): diff --git a/erpnext/accounts/report/general_ledger/general_ledger.js b/erpnext/accounts/report/general_ledger/general_ledger.js index 4235b7f60d..5c98b249db 100644 --- a/erpnext/accounts/report/general_ledger/general_ledger.js +++ b/erpnext/accounts/report/general_ledger/general_ledger.js @@ -72,46 +72,25 @@ frappe.query_reports["General Ledger"] = { { "fieldname":"party", "label": __("Party"), - "fieldtype": "MultiSelect", - get_data: function() { + "fieldtype": "MultiSelectList", + get_data: function(txt) { if (!frappe.query_report.filters) return; - var party_type = frappe.query_report.get_filter_value('party_type'); - var parties = frappe.query_report.get_filter_value('party'); - if(!party_type) return; - const values = parties.split(/\s*,\s*/).filter(d => d); - const txt = parties.match(/[^,\s*]*$/)[0] || ''; - let data = []; + let party_type = frappe.query_report.get_filter_value('party_type'); + if (!party_type) return; - frappe.call({ - type: "GET", - method:'frappe.desk.search.search_link', - async: false, - no_spinner: true, - args: { - doctype: frappe.query_report.get_filter_value('party_type'), - txt: txt, - filters: { - "name": ["not in", values] - } - }, - callback: function(r) { - data = r.results; - } - }); - return data; + return frappe.db.get_link_options(party_type, txt); }, on_change: function() { var party_type = frappe.query_report.get_filter_value('party_type'); var parties = frappe.query_report.get_filter_value('party'); - const values = parties.split(/\s*,\s*/).filter(d => d); - if(!party_type || !parties || values.length>1) { + if(!party_type || parties.length === 0 || parties.length > 1) { frappe.query_report.set_filter_value('party_name', ""); frappe.query_report.set_filter_value('tax_id', ""); return; } else { - var party = values[0]; + var party = parties[0]; var fieldname = erpnext.utils.get_party_name(party_type) || "name"; frappe.db.get_value(party_type, party, fieldname, function(value) { frappe.query_report.set_filter_value('party_name', value[fieldname]); @@ -154,62 +133,17 @@ frappe.query_reports["General Ledger"] = { { "fieldname":"cost_center", "label": __("Cost Center"), - "fieldtype": "MultiSelect", - get_data: function() { - var cost_centers = frappe.query_report.get_filter_value("cost_center") || ""; - - const values = cost_centers.split(/\s*,\s*/).filter(d => d); - const txt = cost_centers.match(/[^,\s*]*$/)[0] || ''; - let data = []; - - frappe.call({ - type: "GET", - method:'frappe.desk.search.search_link', - async: false, - no_spinner: true, - args: { - doctype: "Cost Center", - txt: txt, - filters: { - "company": frappe.query_report.get_filter_value("company"), - "name": ["not in", values] - } - }, - callback: function(r) { - data = r.results; - } - }); - return data; + "fieldtype": "MultiSelectList", + get_data: function(txt) { + return frappe.db.get_link_options('Cost Center', txt); } }, { "fieldname":"project", "label": __("Project"), - "fieldtype": "MultiSelect", - get_data: function() { - var projects = frappe.query_report.get_filter_value("project") || ""; - - const values = projects.split(/\s*,\s*/).filter(d => d); - const txt = projects.match(/[^,\s*]*$/)[0] || ''; - let data = []; - - frappe.call({ - type: "GET", - method:'frappe.desk.search.search_link', - async: false, - no_spinner: true, - args: { - doctype: "Project", - txt: txt, - filters: { - "name": ["not in", values] - } - }, - callback: function(r) { - data = r.results; - } - }); - return data; + "fieldtype": "MultiSelectList", + get_data: function(txt) { + return frappe.db.get_link_options('Project', txt); } }, { diff --git a/erpnext/accounts/report/general_ledger/general_ledger.py b/erpnext/accounts/report/general_ledger/general_ledger.py index d9f395b895..1c5e089534 100644 --- a/erpnext/accounts/report/general_ledger/general_ledger.py +++ b/erpnext/accounts/report/general_ledger/general_ledger.py @@ -26,8 +26,7 @@ def execute(filters=None): account_details.setdefault(acc.name, acc) if filters.get('party'): - parties = cstr(filters.get("party")).strip() - filters.party = [d.strip() for d in parties.split(',') if d] + filters.party = frappe.parse_json(filters.get("party")) validate_filters(filters, account_details) @@ -61,12 +60,10 @@ def validate_filters(filters, account_details): frappe.throw(_("From Date must be before To Date")) if filters.get('project'): - projects = cstr(filters.get("project")).strip() - filters.project = [d.strip() for d in projects.split(',') if d] + filters.project = frappe.parse_json(filters.get('project')) if filters.get('cost_center'): - cost_centers = cstr(filters.get("cost_center")).strip() - filters.cost_center = [d.strip() for d in cost_centers.split(',') if d] + filters.cost_center = frappe.parse_json(filters.get('cost_center')) def validate_party(filters): diff --git a/erpnext/accounts/report/gross_and_net_profit_report/gross_and_net_profit_report.js b/erpnext/accounts/report/gross_and_net_profit_report/gross_and_net_profit_report.js index 63ac281cdb..8dc5ab36dd 100644 --- a/erpnext/accounts/report/gross_and_net_profit_report/gross_and_net_profit_report.js +++ b/erpnext/accounts/report/gross_and_net_profit_report/gross_and_net_profit_report.js @@ -13,33 +13,11 @@ frappe.require("assets/erpnext/js/financial_statements.js", function() { frappe.query_reports["Gross and Net Profit Report"]["filters"].push( { - "fieldname":"project", + "fieldname": "project", "label": __("Project"), - "fieldtype": "MultiSelect", - get_data: function() { - var projects = frappe.query_report.get_filter_value("project") || ""; - - const values = projects.split(/\s*,\s*/).filter(d => d); - const txt = projects.match(/[^,\s*]*$/)[0] || ''; - let data = []; - - frappe.call({ - type: "GET", - method:'frappe.desk.search.search_link', - async: false, - no_spinner: true, - args: { - doctype: "Project", - txt: txt, - filters: { - "name": ["not in", values] - } - }, - callback: function(r) { - data = r.results; - } - }); - return data; + "fieldtype": "MultiSelectList", + get_data: function(txt) { + return frappe.db.get_link_options('Project', txt); } }, { diff --git a/erpnext/accounts/report/profit_and_loss_statement/profit_and_loss_statement.js b/erpnext/accounts/report/profit_and_loss_statement/profit_and_loss_statement.js index 250e516d7d..df5c982258 100644 --- a/erpnext/accounts/report/profit_and_loss_statement/profit_and_loss_statement.js +++ b/erpnext/accounts/report/profit_and_loss_statement/profit_and_loss_statement.js @@ -8,33 +8,11 @@ frappe.require("assets/erpnext/js/financial_statements.js", function() { frappe.query_reports["Profit and Loss Statement"]["filters"].push( { - "fieldname":"project", + "fieldname": "project", "label": __("Project"), - "fieldtype": "MultiSelect", - get_data: function() { - var projects = frappe.query_report.get_filter_value("project") || ""; - - const values = projects.split(/\s*,\s*/).filter(d => d); - const txt = projects.match(/[^,\s*]*$/)[0] || ''; - let data = []; - - frappe.call({ - type: "GET", - method:'frappe.desk.search.search_link', - async: false, - no_spinner: true, - args: { - doctype: "Project", - txt: txt, - filters: { - "name": ["not in", values] - } - }, - callback: function(r) { - data = r.results; - } - }); - return data; + "fieldtype": "MultiSelectList", + get_data: function(txt) { + return frappe.db.get_link_options('Project', txt); } }, { diff --git a/erpnext/public/js/financial_statements.js b/erpnext/public/js/financial_statements.js index 73e04c0ff0..d1113a4ca4 100644 --- a/erpnext/public/js/financial_statements.js +++ b/erpnext/public/js/financial_statements.js @@ -118,34 +118,13 @@ function get_filters(){ "options": erpnext.get_presentation_currency_list() }, { - "fieldname":"cost_center", + "fieldname": "cost_center", "label": __("Cost Center"), - "fieldtype": "MultiSelect", - get_data: function() { - var cost_centers = frappe.query_report.get_filter_value("cost_center") || ""; - - const values = cost_centers.split(/\s*,\s*/).filter(d => d); - const txt = cost_centers.match(/[^,\s*]*$/)[0] || ''; - let data = []; - - frappe.call({ - type: "GET", - method:'frappe.desk.search.search_link', - async: false, - no_spinner: true, - args: { - doctype: "Cost Center", - txt: txt, - filters: { - "company": frappe.query_report.get_filter_value("company"), - "name": ["not in", values] - } - }, - callback: function(r) { - data = r.results; - } + "fieldtype": "MultiSelectList", + get_data: function(txt) { + return frappe.db.get_link_options('Cost Center', txt, { + company: frappe.query_report.get_filter_value("company") }); - return data; } } ]