From 5ba438af809d8a843b856fc2a6a077b736a4d688 Mon Sep 17 00:00:00 2001 From: Himanshu Warekar Date: Wed, 3 Apr 2019 16:53:19 +0530 Subject: [PATCH 01/15] fix: fetch payment terms --- erpnext/buying/doctype/purchase_order/purchase_order.py | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/erpnext/buying/doctype/purchase_order/purchase_order.py b/erpnext/buying/doctype/purchase_order/purchase_order.py index 720160676f2..a669238689b 100644 --- a/erpnext/buying/doctype/purchase_order/purchase_order.py +++ b/erpnext/buying/doctype/purchase_order/purchase_order.py @@ -416,6 +416,10 @@ def make_purchase_invoice(source_name, target_doc=None): "Purchase Taxes and Charges": { "doctype": "Purchase Taxes and Charges", "add_if_empty": True + }, + "Payment Schedule": { + "doctype": "Payment Schedule", + "add_if_empty": True } }, target_doc, postprocess) From 44d8224a3b29955c7e4a8a5d71769fe708220a27 Mon Sep 17 00:00:00 2001 From: Himanshu Warekar Date: Thu, 4 Apr 2019 15:40:36 +0530 Subject: [PATCH 02/15] fix: test case fix --- .../buying/doctype/purchase_order/test_purchase_order.py | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/erpnext/buying/doctype/purchase_order/test_purchase_order.py b/erpnext/buying/doctype/purchase_order/test_purchase_order.py index f1507364dfb..2962f0ce3ad 100644 --- a/erpnext/buying/doctype/purchase_order/test_purchase_order.py +++ b/erpnext/buying/doctype/purchase_order/test_purchase_order.py @@ -6,7 +6,7 @@ import unittest import frappe import frappe.defaults from erpnext.accounts.doctype.payment_entry.payment_entry import get_payment_entry -from frappe.utils import flt, add_days, nowdate +from frappe.utils import flt, add_days, nowdate, getdate from erpnext.stock.doctype.item.test_item import make_item from erpnext.buying.doctype.purchase_order.purchase_order import (make_purchase_receipt, make_purchase_invoice, make_rm_stock_entry as make_subcontract_transfer_entry) from erpnext.stock.doctype.material_request.test_material_request import make_material_request @@ -133,7 +133,7 @@ class TestPurchaseOrder(unittest.TestCase): po.submit() self.assertEqual(po.payment_schedule[0].payment_amount, 2500.0) - self.assertEqual(po.payment_schedule[0].due_date, po.transaction_date) + self.assertEqual(po.payment_schedule[0].due_date, getdate(po.transaction_date)) self.assertEqual(po.payment_schedule[1].payment_amount, 2500.0) self.assertEqual(po.payment_schedule[1].due_date, add_days(po.transaction_date, 30)) pi = make_purchase_invoice(po.name) @@ -143,7 +143,7 @@ class TestPurchaseOrder(unittest.TestCase): self.assertEqual(len(pi.get("items", [])), 1) self.assertEqual(pi.payment_schedule[0].payment_amount, 2500.0) - self.assertEqual(pi.payment_schedule[0].due_date, po.transaction_date) + self.assertEqual(pi.payment_schedule[0].due_date, getdate(po.transaction_date)) self.assertEqual(pi.payment_schedule[1].payment_amount, 2500.0) self.assertEqual(pi.payment_schedule[1].due_date, add_days(po.transaction_date, 30)) From 9f2847e86c9ff8d8e2d2c3ace114545624cb9d75 Mon Sep 17 00:00:00 2001 From: Himanshu Warekar Date: Fri, 5 Apr 2019 11:40:37 +0530 Subject: [PATCH 03/15] fix: test case fixes for travis --- .../doctype/purchase_order/test_purchase_order.py | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/erpnext/buying/doctype/purchase_order/test_purchase_order.py b/erpnext/buying/doctype/purchase_order/test_purchase_order.py index 2962f0ce3ad..8a472700f58 100644 --- a/erpnext/buying/doctype/purchase_order/test_purchase_order.py +++ b/erpnext/buying/doctype/purchase_order/test_purchase_order.py @@ -133,9 +133,9 @@ class TestPurchaseOrder(unittest.TestCase): po.submit() self.assertEqual(po.payment_schedule[0].payment_amount, 2500.0) - self.assertEqual(po.payment_schedule[0].due_date, getdate(po.transaction_date)) + self.assertEqual(getdate(po.payment_schedule[0].due_date), getdate(po.transaction_date)) self.assertEqual(po.payment_schedule[1].payment_amount, 2500.0) - self.assertEqual(po.payment_schedule[1].due_date, add_days(po.transaction_date, 30)) + self.assertEqual(getdate(po.payment_schedule[1].due_date), add_days(getdate(po.transaction_date), 30)) pi = make_purchase_invoice(po.name) pi.save() @@ -143,9 +143,9 @@ class TestPurchaseOrder(unittest.TestCase): self.assertEqual(len(pi.get("items", [])), 1) self.assertEqual(pi.payment_schedule[0].payment_amount, 2500.0) - self.assertEqual(pi.payment_schedule[0].due_date, getdate(po.transaction_date)) + self.assertEqual(getdate(pi.payment_schedule[0].due_date), getdate(po.transaction_date)) self.assertEqual(pi.payment_schedule[1].payment_amount, 2500.0) - self.assertEqual(pi.payment_schedule[1].due_date, add_days(po.transaction_date, 30)) + self.assertEqual(getdate(pi.payment_schedule[1].due_date), add_days(getdate(po.transaction_date), 30)) def test_subcontracting(self): po = create_purchase_order(item_code="_Test FG Item", is_subcontracted="Yes") @@ -276,7 +276,7 @@ class TestPurchaseOrder(unittest.TestCase): pi = make_purchase_invoice(po.name) - self.assertFalse(pi.get('payment_schedule')) + self.assertTrue(pi.get('payment_schedule')) def test_terms_copied(self): po = create_purchase_order(do_not_save=1) From 7df8c0ef82d72920aba342623dc10c5c14b1d8f8 Mon Sep 17 00:00:00 2001 From: Saurabh Date: Tue, 16 Apr 2019 15:57:21 +0530 Subject: [PATCH 04/15] fix: woocommerce settings patch --- .../patches/v11_1/woocommerce_set_creation_user.py | 13 +++++++------ 1 file changed, 7 insertions(+), 6 deletions(-) diff --git a/erpnext/patches/v11_1/woocommerce_set_creation_user.py b/erpnext/patches/v11_1/woocommerce_set_creation_user.py index e50d5ae711b..5ccdec6d262 100644 --- a/erpnext/patches/v11_1/woocommerce_set_creation_user.py +++ b/erpnext/patches/v11_1/woocommerce_set_creation_user.py @@ -1,10 +1,11 @@ from __future__ import unicode_literals import frappe +from frappe.utils import cint def execute(): - woocommerce_setting_enable_sync = frappe.db.sql("SELECT t.value FROM tabSingles t WHERE doctype = 'Woocommerce Settings' AND field = 'enable_sync'", as_dict=True) - if len(woocommerce_setting_enable_sync) and woocommerce_setting_enable_sync[0].value == '1': - frappe.db.sql("""UPDATE tabSingles - SET value = (SELECT t.value FROM tabSingles t WHERE doctype = 'Woocommerce Settings' AND field = 'modified_by') - WHERE doctype = 'Woocommerce Settings' - AND field = 'creation_user';""") \ No newline at end of file + frappe.reload_doc("erpnext_integrations", "doctype","woocommerce_settings") + doc = frappe.get_doc("Woocommerce Settings") + + if cint(doc.enable_sync): + doc.creation_user = doc.modified_by + doc.save(ignore_permissions=True) \ No newline at end of file From 64980fed5971d7af28c0714b6ec6529d91279039 Mon Sep 17 00:00:00 2001 From: Himanshu Warekar Date: Tue, 16 Apr 2019 16:29:13 +0530 Subject: [PATCH 05/15] fix: validate percentage total --- erpnext/selling/doctype/customer/customer.js | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/erpnext/selling/doctype/customer/customer.js b/erpnext/selling/doctype/customer/customer.js index 3b0e75ff6ca..89811656eed 100644 --- a/erpnext/selling/doctype/customer/customer.js +++ b/erpnext/selling/doctype/customer/customer.js @@ -123,5 +123,11 @@ frappe.ui.form.on("Customer", { }, validate: function(frm) { if(frm.doc.lead_name) frappe.model.clear_doc("Lead", frm.doc.lead_name); + + var total = 0; + for (var idx in frm.doc.sales_team) { + total += frm.doc.sales_team[idx].allocated_percentage; + if (total > 100) frappe.throw(__("Total contribution percentage can't exceed 100")); + } }, }); \ No newline at end of file From d6757b7af6bcfd64406d8d11ba5e0eb2ec9ad088 Mon Sep 17 00:00:00 2001 From: Anurag Mishra Date: Tue, 16 Apr 2019 17:32:45 +0530 Subject: [PATCH 06/15] fix: total error arissing due to blank link field --- erpnext/projects/report/billing_summary.py | 16 ---------------- .../employee_billing_summary.json | 4 ++-- .../project_billing_summary.json | 4 ++-- 3 files changed, 4 insertions(+), 20 deletions(-) diff --git a/erpnext/projects/report/billing_summary.py b/erpnext/projects/report/billing_summary.py index 4906ba9d997..d2a229315fd 100644 --- a/erpnext/projects/report/billing_summary.py +++ b/erpnext/projects/report/billing_summary.py @@ -54,9 +54,6 @@ def get_data(filters): data = [] record = get_records(filters) - billable_hours_worked = 0 - hours_worked = 0 - working_cost = 0 for entries in record: total_hours = 0 total_billable_hours = 0 @@ -81,11 +78,6 @@ def get_data(filters): total_hours, total_billable_hours, total_amount = get_billable_and_total_hours(activity, time_end, time_start, total_hours, total_billable_hours, total_amount) - - hours_worked += total_hours - billable_hours_worked += total_billable_hours - working_cost += total_amount - row = { "employee": entries.employee, "employee_name": entries.employee_name, @@ -97,14 +89,6 @@ def get_data(filters): if entries_exists: data.append(row) entries_exists = False - - total = { - "total_billable_hours": billable_hours_worked, - "total_hours": hours_worked, - "amount": working_cost - } - if billable_hours_worked !=0 or hours_worked !=0 or working_cost !=0: - data.append(total) return data def get_records(filters): 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 433ebac5ddf..cab8db251c8 100644 --- a/erpnext/projects/report/employee_billing_summary/employee_billing_summary.json +++ b/erpnext/projects/report/employee_billing_summary/employee_billing_summary.json @@ -1,5 +1,5 @@ { - "add_total_row": 0, + "add_total_row": 1, "creation": "2019-03-08 15:08:19.929728", "disable_prepared_report": 0, "disabled": 0, @@ -7,7 +7,7 @@ "doctype": "Report", "idx": 0, "is_standard": "Yes", - "modified": "2019-03-08 15:08:19.929728", + "modified": "2019-04-16 17:29:18.376932", "modified_by": "Administrator", "module": "Projects", "name": "Employee Billing Summary", 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 a3f91c802d5..c65053e85be 100644 --- a/erpnext/projects/report/project_billing_summary/project_billing_summary.json +++ b/erpnext/projects/report/project_billing_summary/project_billing_summary.json @@ -1,5 +1,5 @@ { - "add_total_row": 0, + "add_total_row": 1, "creation": "2019-03-11 16:22:39.460524", "disable_prepared_report": 0, "disabled": 0, @@ -7,7 +7,7 @@ "doctype": "Report", "idx": 0, "is_standard": "Yes", - "modified": "2019-03-11 16:22:39.460524", + "modified": "2019-04-16 17:28:32.749633", "modified_by": "Administrator", "module": "Projects", "name": "Project Billing Summary", From 82e76b2c0c7c223ca01287e34e269acc0342c435 Mon Sep 17 00:00:00 2001 From: Kenneth Sequeira <33246109+kennethsequeira@users.noreply.github.com> Date: Tue, 16 Apr 2019 18:00:21 +0530 Subject: [PATCH 07/15] Improve Validation Message in BOM Update following validation message: "Price not found for item {0} and price list {1}" to "Price not found for item {0} in price list {1}" --- erpnext/manufacturing/doctype/bom/bom.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/erpnext/manufacturing/doctype/bom/bom.py b/erpnext/manufacturing/doctype/bom/bom.py index c65693bddf6..b04ba7c4fb0 100644 --- a/erpnext/manufacturing/doctype/bom/bom.py +++ b/erpnext/manufacturing/doctype/bom/bom.py @@ -201,7 +201,7 @@ class BOM(WebsiteGenerator): if not rate: if self.rm_cost_as_per == "Price List": - frappe.msgprint(_("Price not found for item {0} and price list {1}") + frappe.msgprint(_("Price not found for item {0} in price list {1}") .format(arg["item_code"], self.buying_price_list), alert=True) else: frappe.msgprint(_("{0} not found for item {1}") From 15c7a058799cd7e18dd85dd4061af6d39e16ecb6 Mon Sep 17 00:00:00 2001 From: Rohit Waghchaure Date: Tue, 16 Apr 2019 19:16:14 +0530 Subject: [PATCH 08/15] fix: If finance book filter is not set then show all the entries --- .../accounts_receivable.py | 7 +------ .../asset_depreciation_ledger.py | 5 +---- .../consolidated_financial_statement.py | 19 +++++++------------ .../customer_ledger_summary.py | 8 ++------ .../accounts/report/financial_statements.py | 10 ++-------- .../report/general_ledger/general_ledger.py | 6 +----- 6 files changed, 14 insertions(+), 41 deletions(-) diff --git a/erpnext/accounts/report/accounts_receivable/accounts_receivable.py b/erpnext/accounts/report/accounts_receivable/accounts_receivable.py index d49a33bd016..b7154550297 100755 --- a/erpnext/accounts/report/accounts_receivable/accounts_receivable.py +++ b/erpnext/accounts/report/accounts_receivable/accounts_receivable.py @@ -487,13 +487,8 @@ class ReceivablePayableReport(object): conditions.append("company=%s") values.append(self.filters.company) - company_finance_book = erpnext.get_default_finance_book(self.filters.company) - - if not self.filters.finance_book or (self.filters.finance_book == company_finance_book): + if self.filters.finance_book: conditions.append("ifnull(finance_book,'') in (%s, '')") - values.append(company_finance_book) - elif self.filters.finance_book: - conditions.append("ifnull(finance_book,'') = %s") values.append(self.filters.finance_book) if self.filters.get(party_type_field): diff --git a/erpnext/accounts/report/asset_depreciation_ledger/asset_depreciation_ledger.py b/erpnext/accounts/report/asset_depreciation_ledger/asset_depreciation_ledger.py index 36131319101..16bef565252 100644 --- a/erpnext/accounts/report/asset_depreciation_ledger/asset_depreciation_ledger.py +++ b/erpnext/accounts/report/asset_depreciation_ledger/asset_depreciation_ledger.py @@ -31,11 +31,8 @@ def get_data(filters): filters_data.append(["against_voucher", "in", assets]) - company_finance_book = erpnext.get_default_finance_book(filters.get("company")) - if (not filters.get('finance_book') or (filters.get('finance_book') == company_finance_book)): + if filters.get("finance_book"): filters_data.append(["finance_book", "in", ['', filters.get('finance_book')]]) - elif filters.get("finance_book"): - filters_data.append(["finance_book", "=", filters.get('finance_book')]) gl_entries = frappe.get_all('GL Entry', filters= filters_data, diff --git a/erpnext/accounts/report/consolidated_financial_statement/consolidated_financial_statement.py b/erpnext/accounts/report/consolidated_financial_statement/consolidated_financial_statement.py index b9aebd83f93..1bb8580f644 100644 --- a/erpnext/accounts/report/consolidated_financial_statement/consolidated_financial_statement.py +++ b/erpnext/accounts/report/consolidated_financial_statement/consolidated_financial_statement.py @@ -101,7 +101,7 @@ def get_income_expense_data(companies, fiscal_year, filters): net_profit_loss = get_net_profit_loss(income, expense, companies, filters.company, company_currency, True) return income, expense, net_profit_loss - + def get_cash_flow_data(fiscal_year, companies, filters): cash_flow_accounts = get_cash_flow_accounts() @@ -123,7 +123,7 @@ def get_cash_flow_data(fiscal_year, companies, filters): # add first net income in operations section if net_profit_loss: net_profit_loss.update({ - "indent": 1, + "indent": 1, "parent_account": cash_flow_accounts[0]['section_header'] }) data.append(net_profit_loss) @@ -327,7 +327,7 @@ def set_gl_entries_by_account(from_date, to_date, root_lft, root_rgt, filters, g accounts_by_name, ignore_closing_entries=False): """Returns a dict like { "account": [gl entries], ... }""" - company_lft, company_rgt = frappe.get_cached_value('Company', + company_lft, company_rgt = frappe.get_cached_value('Company', filters.get('company'), ["lft", "rgt"]) additional_conditions = get_additional_conditions(from_date, ignore_closing_entries, filters) @@ -354,7 +354,8 @@ def set_gl_entries_by_account(from_date, to_date, root_lft, root_rgt, filters, g "to_date": to_date, "lft": root_lft, "rgt": root_rgt, - "company": d.name + "company": d.name, + "finance_book": filters.get("finance_book") }, as_dict=True) @@ -384,14 +385,8 @@ def get_additional_conditions(from_date, ignore_closing_entries, filters): if from_date: additional_conditions.append("gl.posting_date >= %(from_date)s") - company_finance_book = erpnext.get_default_finance_book(filters.get("company")) - - if not filters.get('finance_book') or (filters.get('finance_book') == company_finance_book): - additional_conditions.append("ifnull(finance_book, '') in ('%s', '')" % - frappe.db.escape(company_finance_book)) - elif filters.get("finance_book"): - additional_conditions.append("ifnull(finance_book, '') = '%s' " % - frappe.db.escape(filters.get("finance_book"))) + if filters.get("finance_book"): + additional_conditions.append("ifnull(finance_book, '') in (%(finance_book)s, '')") return " and {}".format(" and ".join(additional_conditions)) if additional_conditions else "" diff --git a/erpnext/accounts/report/customer_ledger_summary/customer_ledger_summary.py b/erpnext/accounts/report/customer_ledger_summary/customer_ledger_summary.py index 23b963b759e..7872dbe7b16 100644 --- a/erpnext/accounts/report/customer_ledger_summary/customer_ledger_summary.py +++ b/erpnext/accounts/report/customer_ledger_summary/customer_ledger_summary.py @@ -184,12 +184,8 @@ class PartyLedgerSummaryReport(object): if self.filters.company: conditions.append("gle.company=%(company)s") - self.filters.company_finance_book = erpnext.get_default_finance_book(self.filters.company) - - if not self.filters.finance_book or (self.filters.finance_book == self.filters.company_finance_book): - conditions.append("ifnull(finance_book,'') in (%(company_finance_book)s, '')") - elif self.filters.finance_book: - conditions.append("ifnull(finance_book,'') = %(finance_book)s") + if self.filters.finance_book: + conditions.append("ifnull(finance_book,'') in (%(finance_book)s, '')") if self.filters.get("party"): conditions.append("party=%(party)s") diff --git a/erpnext/accounts/report/financial_statements.py b/erpnext/accounts/report/financial_statements.py index e9aecfb394e..52056ef2193 100644 --- a/erpnext/accounts/report/financial_statements.py +++ b/erpnext/accounts/report/financial_statements.py @@ -392,14 +392,8 @@ def get_additional_conditions(from_date, ignore_closing_entries, filters): filters.cost_center = get_cost_centers_with_children(filters.cost_center) additional_conditions.append("cost_center in %(cost_center)s") - company_finance_book = erpnext.get_default_finance_book(filters.get("company")) - - if not filters.get('finance_book') or (filters.get('finance_book') == company_finance_book): - additional_conditions.append("ifnull(finance_book, '') in ('%s', '')" % - frappe.db.escape(company_finance_book)) - elif filters.get("finance_book"): - additional_conditions.append("ifnull(finance_book, '') = '%s' " % - frappe.db.escape(filters.get("finance_book"))) + if filters.get("finance_book"): + additional_conditions.append("ifnull(finance_book, '') in (%(finance_book)s, '')") return " and {}".format(" and ".join(additional_conditions)) if additional_conditions else "" diff --git a/erpnext/accounts/report/general_ledger/general_ledger.py b/erpnext/accounts/report/general_ledger/general_ledger.py index ecb18f78b18..44ca8d3549a 100644 --- a/erpnext/accounts/report/general_ledger/general_ledger.py +++ b/erpnext/accounts/report/general_ledger/general_ledger.py @@ -186,12 +186,8 @@ def get_conditions(filters): if filters.get("project"): conditions.append("project in %(project)s") - company_finance_book = erpnext.get_default_finance_book(filters.get("company")) - if not filters.get("finance_book") or (filters.get("finance_book") == company_finance_book): - filters['finance_book'] = company_finance_book + if filters.get("finance_book"): conditions.append("ifnull(finance_book, '') in (%(finance_book)s, '')") - elif filters.get("finance_book"): - conditions.append("ifnull(finance_book, '') = %(finance_book)s") from frappe.desk.reportview import build_match_conditions match_conditions = build_match_conditions("GL Entry") From 4bccd692e5afb1c167ed273e1b5cd46a7937ad5d Mon Sep 17 00:00:00 2001 From: deepeshgarg007 Date: Tue, 16 Apr 2019 20:50:46 +0530 Subject: [PATCH 09/15] fix: GSTR1 B2C report fix --- erpnext/regional/report/gstr_1/gstr_1.py | 49 +++++++++++++++++++----- 1 file changed, 40 insertions(+), 9 deletions(-) diff --git a/erpnext/regional/report/gstr_1/gstr_1.py b/erpnext/regional/report/gstr_1/gstr_1.py index 0c7d066216a..aba12dc09ee 100644 --- a/erpnext/regional/report/gstr_1/gstr_1.py +++ b/erpnext/regional/report/gstr_1/gstr_1.py @@ -38,7 +38,6 @@ class Gstr1Report(object): shipping_bill_date, reason_for_issuing_document """ - self.customer_type = "Company" if self.filters.get("type_of_business") == "B2B" else "Individual" def run(self): self.get_columns() @@ -54,18 +53,50 @@ class Gstr1Report(object): return self.columns, self.data def get_data(self): + + if self.filters.get("type_of_business") == "B2C Small": + self.get_b2cs_data() + 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) + + if self.filters.get("type_of_business") == "CDNR": + row.append("Y" if invoice_details.posting_date <= date(2017, 7, 1) else "N") + row.append("C" if invoice_details.return_against else "R") + + self.data.append(row) + + def get_b2cs_data(self): + b2cs_output = {} + 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) - if self.filters.get("type_of_business") == "B2C Small": - row.append("E" if invoice_details.ecommerce_gstin else "OE") + place_of_supply = invoice_details.get("place_of_supply") + ecommerce_gstin = invoice_details.get("ecommerce_gstin") - if self.filters.get("type_of_business") == "CDNR": - row.append("Y" if invoice_details.posting_date <= date(2017, 7, 1) else "N") - row.append("C" if invoice_details.return_against else "R") + b2cs_output.setdefault((rate, place_of_supply, ecommerce_gstin),{ + "place_of_supply": "", + "ecommerce_gstin": "", + "rate": "", + "taxable_value": 0, + "cess_amount": 0, + "type": 0 + }) - self.data.append(row) + row = b2cs_output.get((rate, place_of_supply, ecommerce_gstin)) + row["place_of_supply"] = place_of_supply + row["ecommerce_gstin"] = ecommerce_gstin + row["rate"] = rate + row["taxable_value"] += sum([abs(net_amount) + for item_code, net_amount in self.invoice_items.get(inv).items() if item_code in items]) + row["type"] = "E" if ecommerce_gstin else "OE" + + for key, value in iteritems(b2cs_output): + self.data.append(value) def get_row_data_for_invoice(self, invoice, invoice_details, tax_rate, items): row = [] @@ -113,7 +144,7 @@ class Gstr1Report(object): if self.filters.get(opts[0]): conditions += opts[1] - customers = frappe.get_all("Customer", filters={"customer_type": self.customer_type}) + customers = frappe.get_all("Customer", filters={"disabled": 0}) if self.filters.get("type_of_business") == "B2B": conditions += """ and ifnull(invoice_type, '') != 'Export' and is_return != 1 From 97bf12734a9126fba9e1de7552810c2e28faa12e Mon Sep 17 00:00:00 2001 From: Nabin Hait Date: Tue, 16 Apr 2019 22:11:22 +0530 Subject: [PATCH 10/15] fix: Pull items from PR to PI --- erpnext/controllers/accounts_controller.py | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/erpnext/controllers/accounts_controller.py b/erpnext/controllers/accounts_controller.py index bb088cfe118..ca24cd670bd 100644 --- a/erpnext/controllers/accounts_controller.py +++ b/erpnext/controllers/accounts_controller.py @@ -30,9 +30,8 @@ class AccountsController(TransactionBase): return self.__company_currency def onload(self): - if self.get("__onload"): - self.get("__onload").make_payment_via_journal_entry \ - = frappe.db.get_single_value('Accounts Settings', 'make_payment_via_journal_entry') + self.set_onload("make_payment_via_journal_entry", + frappe.db.get_single_value('Accounts Settings', 'make_payment_via_journal_entry')) if self.is_new(): relevant_docs = ("Quotation", "Purchase Order", "Sales Order", From 7be07361547b8ff05b3642d9350db08f7031d148 Mon Sep 17 00:00:00 2001 From: Nabin Hait Date: Tue, 16 Apr 2019 23:05:39 +0530 Subject: [PATCH 11/15] fix: removed debug --- erpnext/projects/doctype/project/project.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/erpnext/projects/doctype/project/project.py b/erpnext/projects/doctype/project/project.py index f52d8fde35c..ebb15997962 100644 --- a/erpnext/projects/doctype/project/project.py +++ b/erpnext/projects/doctype/project/project.py @@ -241,7 +241,7 @@ class Project(Document): from_expense_claim = frappe.db.sql("""select sum(total_sanctioned_amount) as total_sanctioned_amount from `tabExpense Claim` where project = %s - and docstatus = 1""", self.name, as_dict=1, debug=1)[0] + and docstatus = 1""", self.name, as_dict=1)[0] self.actual_start_date = from_time_sheet.start_date self.actual_end_date = from_time_sheet.end_date From ba47f897026a11d5c4d1c845213d8228c81724a1 Mon Sep 17 00:00:00 2001 From: Himanshu Warekar Date: Wed, 17 Apr 2019 11:24:04 +0530 Subject: [PATCH 12/15] fix: added a single value to fetch payment terms --- .../doctype/fetch_payment_terms/__init__.py | 0 .../fetch_payment_terms.js | 8 ++ .../fetch_payment_terms.json | 96 +++++++++++++++++++ .../fetch_payment_terms.py | 10 ++ .../test_fetch_payment_terms.js | 23 +++++ .../test_fetch_payment_terms.py | 10 ++ .../doctype/purchase_order/purchase_order.py | 16 ++-- erpnext/config/accounts.py | 8 +- 8 files changed, 164 insertions(+), 7 deletions(-) create mode 100644 erpnext/accounts/doctype/fetch_payment_terms/__init__.py create mode 100644 erpnext/accounts/doctype/fetch_payment_terms/fetch_payment_terms.js create mode 100644 erpnext/accounts/doctype/fetch_payment_terms/fetch_payment_terms.json create mode 100644 erpnext/accounts/doctype/fetch_payment_terms/fetch_payment_terms.py create mode 100644 erpnext/accounts/doctype/fetch_payment_terms/test_fetch_payment_terms.js create mode 100644 erpnext/accounts/doctype/fetch_payment_terms/test_fetch_payment_terms.py diff --git a/erpnext/accounts/doctype/fetch_payment_terms/__init__.py b/erpnext/accounts/doctype/fetch_payment_terms/__init__.py new file mode 100644 index 00000000000..e69de29bb2d diff --git a/erpnext/accounts/doctype/fetch_payment_terms/fetch_payment_terms.js b/erpnext/accounts/doctype/fetch_payment_terms/fetch_payment_terms.js new file mode 100644 index 00000000000..faa011c9fe3 --- /dev/null +++ b/erpnext/accounts/doctype/fetch_payment_terms/fetch_payment_terms.js @@ -0,0 +1,8 @@ +// Copyright (c) 2019, Frappe Technologies Pvt. Ltd. and contributors +// For license information, please see license.txt + +frappe.ui.form.on('Fetch Payment Terms', { + refresh: function(frm) { + + } +}); diff --git a/erpnext/accounts/doctype/fetch_payment_terms/fetch_payment_terms.json b/erpnext/accounts/doctype/fetch_payment_terms/fetch_payment_terms.json new file mode 100644 index 00000000000..c1f83459f81 --- /dev/null +++ b/erpnext/accounts/doctype/fetch_payment_terms/fetch_payment_terms.json @@ -0,0 +1,96 @@ +{ + "allow_copy": 0, + "allow_events_in_timeline": 0, + "allow_guest_to_view": 0, + "allow_import": 0, + "allow_rename": 0, + "beta": 0, + "creation": "2019-04-17 11:00:32.823034", + "custom": 0, + "docstatus": 0, + "doctype": "DocType", + "document_type": "", + "editable_grid": 0, + "engine": "InnoDB", + "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": "fetch_payment_terms", + "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": "Always Fetch Payment Terms", + "length": 0, + "no_copy": 0, + "permlevel": 0, + "precision": "", + "print_hide": 0, + "print_hide_if_no_value": 0, + "read_only": 0, + "remember_last_selected_value": 0, + "report_hide": 0, + "reqd": 0, + "search_index": 0, + "set_only_once": 0, + "translatable": 0, + "unique": 0 + } + ], + "has_web_view": 0, + "hide_heading": 0, + "hide_toolbar": 0, + "idx": 0, + "image_view": 0, + "in_create": 0, + "is_submittable": 0, + "issingle": 1, + "istable": 0, + "max_attachments": 0, + "modified": "2019-04-17 11:06:02.216048", + "modified_by": "Administrator", + "module": "Accounts", + "name": "Fetch Payment Terms", + "name_case": "", + "owner": "Administrator", + "permissions": [ + { + "amend": 0, + "cancel": 0, + "create": 1, + "delete": 1, + "email": 1, + "export": 0, + "if_owner": 0, + "import": 0, + "permlevel": 0, + "print": 1, + "read": 1, + "report": 0, + "role": "System Manager", + "set_user_permissions": 0, + "share": 1, + "submit": 0, + "write": 1 + } + ], + "quick_entry": 1, + "read_only": 0, + "read_only_onload": 0, + "show_name_in_global_search": 0, + "sort_field": "modified", + "sort_order": "ASC", + "track_changes": 1, + "track_seen": 0, + "track_views": 0 +} \ No newline at end of file diff --git a/erpnext/accounts/doctype/fetch_payment_terms/fetch_payment_terms.py b/erpnext/accounts/doctype/fetch_payment_terms/fetch_payment_terms.py new file mode 100644 index 00000000000..c7bdd177e7e --- /dev/null +++ b/erpnext/accounts/doctype/fetch_payment_terms/fetch_payment_terms.py @@ -0,0 +1,10 @@ +# -*- coding: utf-8 -*- +# Copyright (c) 2019, Frappe Technologies Pvt. Ltd. and contributors +# For license information, please see license.txt + +from __future__ import unicode_literals +import frappe +from frappe.model.document import Document + +class FetchPaymentTerms(Document): + pass diff --git a/erpnext/accounts/doctype/fetch_payment_terms/test_fetch_payment_terms.js b/erpnext/accounts/doctype/fetch_payment_terms/test_fetch_payment_terms.js new file mode 100644 index 00000000000..80fd8e34f02 --- /dev/null +++ b/erpnext/accounts/doctype/fetch_payment_terms/test_fetch_payment_terms.js @@ -0,0 +1,23 @@ +/* eslint-disable */ +// rename this file from _test_[name] to test_[name] to activate +// and remove above this line + +QUnit.test("test: Fetch Payment Terms", function (assert) { + let done = assert.async(); + + // number of asserts + assert.expect(1); + + frappe.run_serially([ + // insert a new Fetch Payment Terms + () => frappe.tests.make('Fetch Payment Terms', [ + // values to be set + {key: 'value'} + ]), + () => { + assert.equal(cur_frm.doc.key, 'value'); + }, + () => done() + ]); + +}); diff --git a/erpnext/accounts/doctype/fetch_payment_terms/test_fetch_payment_terms.py b/erpnext/accounts/doctype/fetch_payment_terms/test_fetch_payment_terms.py new file mode 100644 index 00000000000..771a44c208e --- /dev/null +++ b/erpnext/accounts/doctype/fetch_payment_terms/test_fetch_payment_terms.py @@ -0,0 +1,10 @@ +# -*- coding: utf-8 -*- +# Copyright (c) 2019, Frappe Technologies Pvt. Ltd. and Contributors +# See license.txt +from __future__ import unicode_literals + +import frappe +import unittest + +class TestFetchPaymentTerms(unittest.TestCase): + pass diff --git a/erpnext/buying/doctype/purchase_order/purchase_order.py b/erpnext/buying/doctype/purchase_order/purchase_order.py index a669238689b..27bce5b828a 100644 --- a/erpnext/buying/doctype/purchase_order/purchase_order.py +++ b/erpnext/buying/doctype/purchase_order/purchase_order.py @@ -393,7 +393,7 @@ def make_purchase_invoice(source_name, target_doc=None): or item.get("buying_cost_center") or item_group.get("buying_cost_center")) - doc = get_mapped_doc("Purchase Order", source_name, { + fields = { "Purchase Order": { "doctype": "Purchase Invoice", "field_map": { @@ -416,12 +416,16 @@ def make_purchase_invoice(source_name, target_doc=None): "Purchase Taxes and Charges": { "doctype": "Purchase Taxes and Charges", "add_if_empty": True - }, - "Payment Schedule": { - "doctype": "Payment Schedule", - "add_if_empty": True } - }, target_doc, postprocess) + } + + if frappe.get_single("Fetch Payment Terms").fetch_payment_terms == 1: + fields["Payment Schedule"] = { + "doctype": "Payment Schedule", + "add_if_empty": True + } + + doc = get_mapped_doc("Purchase Order", source_name, fields, target_doc, postprocess) return doc diff --git a/erpnext/config/accounts.py b/erpnext/config/accounts.py index 42d0df0a06f..f3cf8a28880 100644 --- a/erpnext/config/accounts.py +++ b/erpnext/config/accounts.py @@ -297,7 +297,13 @@ def get_data(): "name": "C-Form", "description": _("C-Form records"), "country": "India" - } + }, + { + "type": "doctype", + "name": "Fetch Payment Terms", + "label": _("Fetch Payment Terms"), + "description": _("Fetch Payment Terms") + }, ] }, { From 2b54cee4aaf7ec95032b90c1e4357937e7ec2d07 Mon Sep 17 00:00:00 2001 From: Himanshu Warekar Date: Wed, 17 Apr 2019 12:09:19 +0530 Subject: [PATCH 13/15] fix: test case --- .../buying/doctype/purchase_order/test_purchase_order.py | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/erpnext/buying/doctype/purchase_order/test_purchase_order.py b/erpnext/buying/doctype/purchase_order/test_purchase_order.py index 8a472700f58..c7401faeb2d 100644 --- a/erpnext/buying/doctype/purchase_order/test_purchase_order.py +++ b/erpnext/buying/doctype/purchase_order/test_purchase_order.py @@ -276,7 +276,7 @@ class TestPurchaseOrder(unittest.TestCase): pi = make_purchase_invoice(po.name) - self.assertTrue(pi.get('payment_schedule')) + self.assertFalse(pi.get('payment_schedule')) def test_terms_copied(self): po = create_purchase_order(do_not_save=1) @@ -294,6 +294,10 @@ class TestPurchaseOrder(unittest.TestCase): make_stock_entry(target="_Test Warehouse - _TC", qty=10, basic_rate=100) make_stock_entry(target="_Test Warehouse - _TC", item_code="_Test Item Home Desktop 100", qty=20, basic_rate=100) + make_stock_entry(target="_Test Warehouse 1 - _TC", item_code="_Test Item", + qty=30, basic_rate=100) + make_stock_entry(target="_Test Warehouse 1 - _TC", item_code="_Test Item Home Desktop 100", + qty=30, basic_rate=100) bin1 = frappe.db.get_value("Bin", filters={"warehouse": "_Test Warehouse - _TC", "item_code": "_Test Item"}, From 308ae1f15584bb62f0e097f1a4afae3851f42a0f Mon Sep 17 00:00:00 2001 From: Himanshu Warekar Date: Wed, 17 Apr 2019 12:42:00 +0530 Subject: [PATCH 14/15] fix: codacy fixes --- .../doctype/fetch_payment_terms/fetch_payment_terms.js | 3 --- .../doctype/fetch_payment_terms/fetch_payment_terms.py | 1 - .../doctype/fetch_payment_terms/test_fetch_payment_terms.py | 1 - erpnext/buying/doctype/purchase_order/purchase_order.py | 6 +++--- 4 files changed, 3 insertions(+), 8 deletions(-) diff --git a/erpnext/accounts/doctype/fetch_payment_terms/fetch_payment_terms.js b/erpnext/accounts/doctype/fetch_payment_terms/fetch_payment_terms.js index faa011c9fe3..d16535a2d8c 100644 --- a/erpnext/accounts/doctype/fetch_payment_terms/fetch_payment_terms.js +++ b/erpnext/accounts/doctype/fetch_payment_terms/fetch_payment_terms.js @@ -2,7 +2,4 @@ // For license information, please see license.txt frappe.ui.form.on('Fetch Payment Terms', { - refresh: function(frm) { - - } }); diff --git a/erpnext/accounts/doctype/fetch_payment_terms/fetch_payment_terms.py b/erpnext/accounts/doctype/fetch_payment_terms/fetch_payment_terms.py index c7bdd177e7e..fb2b1467c9b 100644 --- a/erpnext/accounts/doctype/fetch_payment_terms/fetch_payment_terms.py +++ b/erpnext/accounts/doctype/fetch_payment_terms/fetch_payment_terms.py @@ -3,7 +3,6 @@ # For license information, please see license.txt from __future__ import unicode_literals -import frappe from frappe.model.document import Document class FetchPaymentTerms(Document): diff --git a/erpnext/accounts/doctype/fetch_payment_terms/test_fetch_payment_terms.py b/erpnext/accounts/doctype/fetch_payment_terms/test_fetch_payment_terms.py index 771a44c208e..86d500466f1 100644 --- a/erpnext/accounts/doctype/fetch_payment_terms/test_fetch_payment_terms.py +++ b/erpnext/accounts/doctype/fetch_payment_terms/test_fetch_payment_terms.py @@ -3,7 +3,6 @@ # See license.txt from __future__ import unicode_literals -import frappe import unittest class TestFetchPaymentTerms(unittest.TestCase): diff --git a/erpnext/buying/doctype/purchase_order/purchase_order.py b/erpnext/buying/doctype/purchase_order/purchase_order.py index 27bce5b828a..78113d7dad3 100644 --- a/erpnext/buying/doctype/purchase_order/purchase_order.py +++ b/erpnext/buying/doctype/purchase_order/purchase_order.py @@ -421,9 +421,9 @@ def make_purchase_invoice(source_name, target_doc=None): if frappe.get_single("Fetch Payment Terms").fetch_payment_terms == 1: fields["Payment Schedule"] = { - "doctype": "Payment Schedule", - "add_if_empty": True - } + "doctype": "Payment Schedule", + "add_if_empty": True + } doc = get_mapped_doc("Purchase Order", source_name, fields, target_doc, postprocess) From 1865e0df7c0f2f7af7009d0901554e81ecbecf28 Mon Sep 17 00:00:00 2001 From: Himanshu Warekar Date: Wed, 17 Apr 2019 15:35:43 +0530 Subject: [PATCH 15/15] refactor: fetch payment terms in account settings --- .../accounts_settings/accounts_settings.json | 1384 +++++++++-------- .../doctype/fetch_payment_terms/__init__.py | 0 .../fetch_payment_terms.js | 5 - .../fetch_payment_terms.json | 96 -- .../fetch_payment_terms.py | 9 - .../test_fetch_payment_terms.js | 23 - .../test_fetch_payment_terms.py | 9 - .../doctype/purchase_order/purchase_order.py | 2 +- erpnext/config/accounts.py | 8 +- 9 files changed, 720 insertions(+), 816 deletions(-) delete mode 100644 erpnext/accounts/doctype/fetch_payment_terms/__init__.py delete mode 100644 erpnext/accounts/doctype/fetch_payment_terms/fetch_payment_terms.js delete mode 100644 erpnext/accounts/doctype/fetch_payment_terms/fetch_payment_terms.json delete mode 100644 erpnext/accounts/doctype/fetch_payment_terms/fetch_payment_terms.py delete mode 100644 erpnext/accounts/doctype/fetch_payment_terms/test_fetch_payment_terms.js delete mode 100644 erpnext/accounts/doctype/fetch_payment_terms/test_fetch_payment_terms.py diff --git a/erpnext/accounts/doctype/accounts_settings/accounts_settings.json b/erpnext/accounts/doctype/accounts_settings/accounts_settings.json index 1fc226575f3..5ace0dc6fe6 100644 --- a/erpnext/accounts/doctype/accounts_settings/accounts_settings.json +++ b/erpnext/accounts/doctype/accounts_settings/accounts_settings.json @@ -1,717 +1,769 @@ { - "allow_copy": 0, - "allow_events_in_timeline": 0, - "allow_guest_to_view": 0, - "allow_import": 0, - "allow_rename": 0, - "beta": 0, - "creation": "2013-06-24 15:49:57", - "custom": 0, - "description": "Settings for Accounts", - "docstatus": 0, - "doctype": "DocType", - "document_type": "Other", - "editable_grid": 1, - "engine": "InnoDB", + "allow_copy": 0, + "allow_events_in_timeline": 0, + "allow_guest_to_view": 0, + "allow_import": 0, + "allow_rename": 0, + "beta": 0, + "creation": "2013-06-24 15:49:57", + "custom": 0, + "description": "Settings for Accounts", + "docstatus": 0, + "doctype": "DocType", + "document_type": "Other", + "editable_grid": 1, + "engine": "InnoDB", "fields": [ { - "allow_bulk_edit": 0, - "allow_in_quick_entry": 0, - "allow_on_submit": 0, - "bold": 0, - "collapsible": 0, - "columns": 0, - "default": "1", - "description": "If enabled, the system will post accounting entries for inventory automatically.", - "fieldname": "auto_accounting_for_stock", - "fieldtype": "Check", - "hidden": 1, - "ignore_user_permissions": 0, - "ignore_xss_filter": 0, - "in_filter": 0, - "in_global_search": 0, - "in_list_view": 1, - "in_standard_filter": 0, - "label": "Make Accounting Entry For Every Stock Movement", - "length": 0, - "no_copy": 0, - "permlevel": 0, - "print_hide": 0, - "print_hide_if_no_value": 0, - "read_only": 0, - "remember_last_selected_value": 0, - "report_hide": 0, - "reqd": 0, - "search_index": 0, - "set_only_once": 0, - "translatable": 0, + "allow_bulk_edit": 0, + "allow_in_quick_entry": 0, + "allow_on_submit": 0, + "bold": 0, + "collapsible": 0, + "columns": 0, + "default": "1", + "description": "If enabled, the system will post accounting entries for inventory automatically.", + "fetch_if_empty": 0, + "fieldname": "auto_accounting_for_stock", + "fieldtype": "Check", + "hidden": 1, + "ignore_user_permissions": 0, + "ignore_xss_filter": 0, + "in_filter": 0, + "in_global_search": 0, + "in_list_view": 1, + "in_standard_filter": 0, + "label": "Make Accounting Entry For Every Stock Movement", + "length": 0, + "no_copy": 0, + "permlevel": 0, + "print_hide": 0, + "print_hide_if_no_value": 0, + "read_only": 0, + "remember_last_selected_value": 0, + "report_hide": 0, + "reqd": 0, + "search_index": 0, + "set_only_once": 0, + "translatable": 0, "unique": 0 - }, + }, { - "allow_bulk_edit": 0, - "allow_in_quick_entry": 0, - "allow_on_submit": 0, - "bold": 0, - "collapsible": 0, - "columns": 0, - "description": "Accounting entry frozen up to this date, nobody can do / modify entry except role specified below.", - "fieldname": "acc_frozen_upto", - "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": "Accounts Frozen Upto", - "length": 0, - "no_copy": 0, - "permlevel": 0, - "print_hide": 0, - "print_hide_if_no_value": 0, - "read_only": 0, - "remember_last_selected_value": 0, - "report_hide": 0, - "reqd": 0, - "search_index": 0, - "set_only_once": 0, - "translatable": 0, + "allow_bulk_edit": 0, + "allow_in_quick_entry": 0, + "allow_on_submit": 0, + "bold": 0, + "collapsible": 0, + "columns": 0, + "description": "Accounting entry frozen up to this date, nobody can do / modify entry except role specified below.", + "fetch_if_empty": 0, + "fieldname": "acc_frozen_upto", + "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": "Accounts Frozen Upto", + "length": 0, + "no_copy": 0, + "permlevel": 0, + "print_hide": 0, + "print_hide_if_no_value": 0, + "read_only": 0, + "remember_last_selected_value": 0, + "report_hide": 0, + "reqd": 0, + "search_index": 0, + "set_only_once": 0, + "translatable": 0, "unique": 0 - }, + }, { - "allow_bulk_edit": 0, - "allow_in_quick_entry": 0, - "allow_on_submit": 0, - "bold": 0, - "collapsible": 0, - "columns": 0, - "description": "Users with this role are allowed to set frozen accounts and create / modify accounting entries against frozen accounts", - "fieldname": "frozen_accounts_modifier", - "fieldtype": "Link", - "hidden": 0, - "ignore_user_permissions": 0, - "ignore_xss_filter": 0, - "in_filter": 0, - "in_global_search": 0, - "in_list_view": 1, - "in_standard_filter": 0, - "label": "Role Allowed to Set Frozen Accounts & Edit Frozen Entries", - "length": 0, - "no_copy": 0, - "options": "Role", - "permlevel": 0, - "print_hide": 0, - "print_hide_if_no_value": 0, - "read_only": 0, - "remember_last_selected_value": 0, - "report_hide": 0, - "reqd": 0, - "search_index": 0, - "set_only_once": 0, - "translatable": 0, + "allow_bulk_edit": 0, + "allow_in_quick_entry": 0, + "allow_on_submit": 0, + "bold": 0, + "collapsible": 0, + "columns": 0, + "description": "Users with this role are allowed to set frozen accounts and create / modify accounting entries against frozen accounts", + "fetch_if_empty": 0, + "fieldname": "frozen_accounts_modifier", + "fieldtype": "Link", + "hidden": 0, + "ignore_user_permissions": 0, + "ignore_xss_filter": 0, + "in_filter": 0, + "in_global_search": 0, + "in_list_view": 1, + "in_standard_filter": 0, + "label": "Role Allowed to Set Frozen Accounts & Edit Frozen Entries", + "length": 0, + "no_copy": 0, + "options": "Role", + "permlevel": 0, + "print_hide": 0, + "print_hide_if_no_value": 0, + "read_only": 0, + "remember_last_selected_value": 0, + "report_hide": 0, + "reqd": 0, + "search_index": 0, + "set_only_once": 0, + "translatable": 0, "unique": 0 - }, + }, { - "allow_bulk_edit": 0, - "allow_in_quick_entry": 0, - "allow_on_submit": 0, - "bold": 0, - "collapsible": 0, - "columns": 0, - "fieldname": "column_break_4", - "fieldtype": "Column Break", - "hidden": 0, - "ignore_user_permissions": 0, - "ignore_xss_filter": 0, - "in_filter": 0, - "in_global_search": 0, - "in_list_view": 0, - "in_standard_filter": 0, - "length": 0, - "no_copy": 0, - "permlevel": 0, - "precision": "", - "print_hide": 0, - "print_hide_if_no_value": 0, - "read_only": 0, - "remember_last_selected_value": 0, - "report_hide": 0, - "reqd": 0, - "search_index": 0, - "set_only_once": 0, - "translatable": 0, + "allow_bulk_edit": 0, + "allow_in_quick_entry": 0, + "allow_on_submit": 0, + "bold": 0, + "collapsible": 0, + "columns": 0, + "fetch_if_empty": 0, + "fieldname": "column_break_4", + "fieldtype": "Column Break", + "hidden": 0, + "ignore_user_permissions": 0, + "ignore_xss_filter": 0, + "in_filter": 0, + "in_global_search": 0, + "in_list_view": 0, + "in_standard_filter": 0, + "length": 0, + "no_copy": 0, + "permlevel": 0, + "precision": "", + "print_hide": 0, + "print_hide_if_no_value": 0, + "read_only": 0, + "remember_last_selected_value": 0, + "report_hide": 0, + "reqd": 0, + "search_index": 0, + "set_only_once": 0, + "translatable": 0, "unique": 0 - }, + }, { - "allow_bulk_edit": 0, - "allow_in_quick_entry": 0, - "allow_on_submit": 0, - "bold": 0, - "collapsible": 0, - "columns": 0, - "description": "Role that is allowed to submit transactions that exceed credit limits set.", - "fieldname": "credit_controller", - "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": "Credit Controller", - "length": 0, - "no_copy": 0, - "options": "Role", - "permlevel": 0, - "print_hide": 0, - "print_hide_if_no_value": 0, - "read_only": 0, - "remember_last_selected_value": 0, - "report_hide": 0, - "reqd": 0, - "search_index": 0, - "set_only_once": 0, - "translatable": 0, + "allow_bulk_edit": 0, + "allow_in_quick_entry": 0, + "allow_on_submit": 0, + "bold": 0, + "collapsible": 0, + "columns": 0, + "description": "Role that is allowed to submit transactions that exceed credit limits set.", + "fetch_if_empty": 0, + "fieldname": "credit_controller", + "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": "Credit Controller", + "length": 0, + "no_copy": 0, + "options": "Role", + "permlevel": 0, + "print_hide": 0, + "print_hide_if_no_value": 0, + "read_only": 0, + "remember_last_selected_value": 0, + "report_hide": 0, + "reqd": 0, + "search_index": 0, + "set_only_once": 0, + "translatable": 0, "unique": 0 - }, + }, { - "allow_bulk_edit": 0, - "allow_in_quick_entry": 0, - "allow_on_submit": 0, - "bold": 0, - "collapsible": 0, - "columns": 0, - "fieldname": "check_supplier_invoice_uniqueness", - "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": "Check Supplier Invoice Number Uniqueness", - "length": 0, - "no_copy": 0, - "permlevel": 0, - "precision": "", - "print_hide": 0, - "print_hide_if_no_value": 0, - "read_only": 0, - "remember_last_selected_value": 0, - "report_hide": 0, - "reqd": 0, - "search_index": 0, - "set_only_once": 0, - "translatable": 0, + "allow_bulk_edit": 0, + "allow_in_quick_entry": 0, + "allow_on_submit": 0, + "bold": 0, + "collapsible": 0, + "columns": 0, + "fetch_if_empty": 0, + "fieldname": "check_supplier_invoice_uniqueness", + "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": "Check Supplier Invoice Number Uniqueness", + "length": 0, + "no_copy": 0, + "permlevel": 0, + "precision": "", + "print_hide": 0, + "print_hide_if_no_value": 0, + "read_only": 0, + "remember_last_selected_value": 0, + "report_hide": 0, + "reqd": 0, + "search_index": 0, + "set_only_once": 0, + "translatable": 0, "unique": 0 - }, + }, { - "allow_bulk_edit": 0, - "allow_in_quick_entry": 0, - "allow_on_submit": 0, - "bold": 0, - "collapsible": 0, - "columns": 0, - "fieldname": "make_payment_via_journal_entry", - "fieldtype": "Check", - "hidden": 0, - "ignore_user_permissions": 0, - "ignore_xss_filter": 0, - "in_filter": 0, - "in_global_search": 0, - "in_list_view": 0, - "in_standard_filter": 0, - "label": "Make Payment via 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, + "allow_bulk_edit": 0, + "allow_in_quick_entry": 0, + "allow_on_submit": 0, + "bold": 0, + "collapsible": 0, + "columns": 0, + "fetch_if_empty": 0, + "fieldname": "make_payment_via_journal_entry", + "fieldtype": "Check", + "hidden": 0, + "ignore_user_permissions": 0, + "ignore_xss_filter": 0, + "in_filter": 0, + "in_global_search": 0, + "in_list_view": 0, + "in_standard_filter": 0, + "label": "Make Payment via 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 - }, + }, { - "allow_bulk_edit": 0, - "allow_in_quick_entry": 0, - "allow_on_submit": 0, - "bold": 0, - "collapsible": 0, - "columns": 0, - "default": "1", - "fieldname": "unlink_payment_on_cancellation_of_invoice", - "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": "Unlink Payment on Cancellation of Invoice", - "length": 0, - "no_copy": 0, - "permlevel": 0, - "precision": "", - "print_hide": 0, - "print_hide_if_no_value": 0, - "read_only": 0, - "remember_last_selected_value": 0, - "report_hide": 0, - "reqd": 0, - "search_index": 0, - "set_only_once": 0, - "translatable": 0, + "allow_bulk_edit": 0, + "allow_in_quick_entry": 0, + "allow_on_submit": 0, + "bold": 0, + "collapsible": 0, + "columns": 0, + "default": "1", + "fetch_if_empty": 0, + "fieldname": "unlink_payment_on_cancellation_of_invoice", + "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": "Unlink Payment on Cancellation of Invoice", + "length": 0, + "no_copy": 0, + "permlevel": 0, + "precision": "", + "print_hide": 0, + "print_hide_if_no_value": 0, + "read_only": 0, + "remember_last_selected_value": 0, + "report_hide": 0, + "reqd": 0, + "search_index": 0, + "set_only_once": 0, + "translatable": 0, "unique": 0 - }, + }, { - "allow_bulk_edit": 0, - "allow_in_quick_entry": 0, - "allow_on_submit": 0, - "bold": 0, - "collapsible": 0, - "columns": 0, - "default": "1", - "fieldname": "book_asset_depreciation_entry_automatically", - "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": "Book Asset Depreciation Entry Automatically", - "length": 0, - "no_copy": 0, - "permlevel": 0, - "precision": "", - "print_hide": 0, - "print_hide_if_no_value": 0, - "read_only": 0, - "remember_last_selected_value": 0, - "report_hide": 0, - "reqd": 0, - "search_index": 0, - "set_only_once": 0, - "translatable": 0, + "allow_bulk_edit": 0, + "allow_in_quick_entry": 0, + "allow_on_submit": 0, + "bold": 0, + "collapsible": 0, + "columns": 0, + "default": "1", + "fetch_if_empty": 0, + "fieldname": "book_asset_depreciation_entry_automatically", + "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": "Book Asset Depreciation Entry Automatically", + "length": 0, + "no_copy": 0, + "permlevel": 0, + "precision": "", + "print_hide": 0, + "print_hide_if_no_value": 0, + "read_only": 0, + "remember_last_selected_value": 0, + "report_hide": 0, + "reqd": 0, + "search_index": 0, + "set_only_once": 0, + "translatable": 0, "unique": 0 - }, + }, { - "allow_bulk_edit": 0, - "allow_in_quick_entry": 0, - "allow_on_submit": 0, - "bold": 0, - "collapsible": 0, - "columns": 0, - "fieldname": "allow_cost_center_in_entry_of_bs_account", - "fieldtype": "Check", - "hidden": 0, - "ignore_user_permissions": 0, - "ignore_xss_filter": 0, - "in_filter": 0, - "in_global_search": 0, - "in_list_view": 0, - "in_standard_filter": 0, - "label": "Allow Cost Center In Entry of Balance Sheet Account", - "length": 0, - "no_copy": 0, - "permlevel": 0, - "precision": "", - "print_hide": 0, - "print_hide_if_no_value": 0, - "read_only": 0, - "remember_last_selected_value": 0, - "report_hide": 0, - "reqd": 0, - "search_index": 0, - "set_only_once": 0, - "translatable": 0, + "allow_bulk_edit": 0, + "allow_in_quick_entry": 0, + "allow_on_submit": 0, + "bold": 0, + "collapsible": 0, + "columns": 0, + "fetch_if_empty": 0, + "fieldname": "allow_cost_center_in_entry_of_bs_account", + "fieldtype": "Check", + "hidden": 0, + "ignore_user_permissions": 0, + "ignore_xss_filter": 0, + "in_filter": 0, + "in_global_search": 0, + "in_list_view": 0, + "in_standard_filter": 0, + "label": "Allow Cost Center In Entry of Balance Sheet Account", + "length": 0, + "no_copy": 0, + "permlevel": 0, + "precision": "", + "print_hide": 0, + "print_hide_if_no_value": 0, + "read_only": 0, + "remember_last_selected_value": 0, + "report_hide": 0, + "reqd": 0, + "search_index": 0, + "set_only_once": 0, + "translatable": 0, "unique": 0 - }, + }, { - "allow_bulk_edit": 0, - "allow_in_quick_entry": 0, - "allow_on_submit": 0, - "bold": 0, - "collapsible": 0, - "columns": 0, - "fieldname": "print_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": "Print 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, + "allow_bulk_edit": 0, + "allow_in_quick_entry": 0, + "allow_on_submit": 0, + "bold": 0, + "collapsible": 0, + "columns": 0, + "fetch_if_empty": 0, + "fieldname": "automatically_fetch_payment_terms", + "fieldtype": "Check", + "hidden": 0, + "ignore_user_permissions": 0, + "ignore_xss_filter": 0, + "in_filter": 0, + "in_global_search": 0, + "in_list_view": 0, + "in_standard_filter": 0, + "label": "Automatically Fetch Payment Terms", + "length": 0, + "no_copy": 0, + "permlevel": 0, + "precision": "", + "print_hide": 0, + "print_hide_if_no_value": 0, + "read_only": 0, + "remember_last_selected_value": 0, + "report_hide": 0, + "reqd": 0, + "search_index": 0, + "set_only_once": 0, + "translatable": 0, "unique": 0 - }, + }, { - "allow_bulk_edit": 0, - "allow_in_quick_entry": 0, - "allow_on_submit": 0, - "bold": 0, - "collapsible": 0, - "columns": 0, - "fieldname": "show_inclusive_tax_in_print", - "fieldtype": "Check", - "hidden": 0, - "ignore_user_permissions": 0, - "ignore_xss_filter": 0, - "in_filter": 0, - "in_global_search": 0, - "in_list_view": 0, - "in_standard_filter": 0, - "label": "Show Inclusive Tax In Print", - "length": 0, - "no_copy": 0, - "permlevel": 0, - "precision": "", - "print_hide": 0, - "print_hide_if_no_value": 0, - "read_only": 0, - "remember_last_selected_value": 0, - "report_hide": 0, - "reqd": 0, - "search_index": 0, - "set_only_once": 0, - "translatable": 0, + "allow_bulk_edit": 0, + "allow_in_quick_entry": 0, + "allow_on_submit": 0, + "bold": 0, + "collapsible": 0, + "columns": 0, + "fetch_if_empty": 0, + "fieldname": "print_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": "Print 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 - }, + }, { - "allow_bulk_edit": 0, - "allow_in_quick_entry": 0, - "allow_on_submit": 0, - "bold": 0, - "collapsible": 0, - "columns": 0, - "fieldname": "column_break_12", - "fieldtype": "Column Break", - "hidden": 0, - "ignore_user_permissions": 0, - "ignore_xss_filter": 0, - "in_filter": 0, - "in_global_search": 0, - "in_list_view": 0, - "in_standard_filter": 0, - "length": 0, - "no_copy": 0, - "permlevel": 0, - "precision": "", - "print_hide": 0, - "print_hide_if_no_value": 0, - "read_only": 0, - "remember_last_selected_value": 0, - "report_hide": 0, - "reqd": 0, - "search_index": 0, - "set_only_once": 0, - "translatable": 0, + "allow_bulk_edit": 0, + "allow_in_quick_entry": 0, + "allow_on_submit": 0, + "bold": 0, + "collapsible": 0, + "columns": 0, + "fetch_if_empty": 0, + "fieldname": "show_inclusive_tax_in_print", + "fieldtype": "Check", + "hidden": 0, + "ignore_user_permissions": 0, + "ignore_xss_filter": 0, + "in_filter": 0, + "in_global_search": 0, + "in_list_view": 0, + "in_standard_filter": 0, + "label": "Show Inclusive Tax In Print", + "length": 0, + "no_copy": 0, + "permlevel": 0, + "precision": "", + "print_hide": 0, + "print_hide_if_no_value": 0, + "read_only": 0, + "remember_last_selected_value": 0, + "report_hide": 0, + "reqd": 0, + "search_index": 0, + "set_only_once": 0, + "translatable": 0, "unique": 0 - }, + }, { - "allow_bulk_edit": 0, - "allow_in_quick_entry": 0, - "allow_on_submit": 0, - "bold": 0, - "collapsible": 0, - "columns": 0, - "fieldname": "show_payment_schedule_in_print", - "fieldtype": "Check", - "hidden": 0, - "ignore_user_permissions": 0, - "ignore_xss_filter": 0, - "in_filter": 0, - "in_global_search": 0, - "in_list_view": 0, - "in_standard_filter": 0, - "label": "Show Payment Schedule in Print", - "length": 0, - "no_copy": 0, - "permlevel": 0, - "precision": "", - "print_hide": 0, - "print_hide_if_no_value": 0, - "read_only": 0, - "remember_last_selected_value": 0, - "report_hide": 0, - "reqd": 0, - "search_index": 0, - "set_only_once": 0, - "translatable": 0, + "allow_bulk_edit": 0, + "allow_in_quick_entry": 0, + "allow_on_submit": 0, + "bold": 0, + "collapsible": 0, + "columns": 0, + "fetch_if_empty": 0, + "fieldname": "column_break_12", + "fieldtype": "Column Break", + "hidden": 0, + "ignore_user_permissions": 0, + "ignore_xss_filter": 0, + "in_filter": 0, + "in_global_search": 0, + "in_list_view": 0, + "in_standard_filter": 0, + "length": 0, + "no_copy": 0, + "permlevel": 0, + "precision": "", + "print_hide": 0, + "print_hide_if_no_value": 0, + "read_only": 0, + "remember_last_selected_value": 0, + "report_hide": 0, + "reqd": 0, + "search_index": 0, + "set_only_once": 0, + "translatable": 0, "unique": 0 - }, + }, { - "allow_bulk_edit": 0, - "allow_in_quick_entry": 0, - "allow_on_submit": 0, - "bold": 0, - "collapsible": 0, - "columns": 0, - "fieldname": "currency_exchange_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": "Currency Exchange 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, + "allow_bulk_edit": 0, + "allow_in_quick_entry": 0, + "allow_on_submit": 0, + "bold": 0, + "collapsible": 0, + "columns": 0, + "fetch_if_empty": 0, + "fieldname": "show_payment_schedule_in_print", + "fieldtype": "Check", + "hidden": 0, + "ignore_user_permissions": 0, + "ignore_xss_filter": 0, + "in_filter": 0, + "in_global_search": 0, + "in_list_view": 0, + "in_standard_filter": 0, + "label": "Show Payment Schedule in Print", + "length": 0, + "no_copy": 0, + "permlevel": 0, + "precision": "", + "print_hide": 0, + "print_hide_if_no_value": 0, + "read_only": 0, + "remember_last_selected_value": 0, + "report_hide": 0, + "reqd": 0, + "search_index": 0, + "set_only_once": 0, + "translatable": 0, "unique": 0 - }, + }, { - "allow_bulk_edit": 0, - "allow_in_quick_entry": 0, - "allow_on_submit": 0, - "bold": 0, - "collapsible": 0, - "columns": 0, - "default": "1", - "fieldname": "allow_stale", - "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": "Allow Stale Exchange Rates", - "length": 0, - "no_copy": 0, - "permlevel": 0, - "precision": "", - "print_hide": 0, - "print_hide_if_no_value": 0, - "read_only": 0, - "remember_last_selected_value": 0, - "report_hide": 0, - "reqd": 0, - "search_index": 0, - "set_only_once": 0, - "translatable": 0, + "allow_bulk_edit": 0, + "allow_in_quick_entry": 0, + "allow_on_submit": 0, + "bold": 0, + "collapsible": 0, + "columns": 0, + "fetch_if_empty": 0, + "fieldname": "currency_exchange_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": "Currency Exchange 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 - }, + }, { - "allow_bulk_edit": 0, - "allow_in_quick_entry": 0, - "allow_on_submit": 0, - "bold": 0, - "collapsible": 0, - "columns": 0, - "default": "1", - "depends_on": "eval:doc.allow_stale==0", - "fieldname": "stale_days", - "fieldtype": "Int", - "hidden": 0, - "ignore_user_permissions": 0, - "ignore_xss_filter": 0, - "in_filter": 0, - "in_global_search": 0, - "in_list_view": 0, - "in_standard_filter": 0, - "label": "Stale Days", - "length": 0, - "no_copy": 0, - "permlevel": 0, - "precision": "", - "print_hide": 0, - "print_hide_if_no_value": 0, - "read_only": 0, - "remember_last_selected_value": 0, - "report_hide": 0, - "reqd": 0, - "search_index": 0, - "set_only_once": 0, - "translatable": 0, + "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": "allow_stale", + "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": "Allow Stale Exchange Rates", + "length": 0, + "no_copy": 0, + "permlevel": 0, + "precision": "", + "print_hide": 0, + "print_hide_if_no_value": 0, + "read_only": 0, + "remember_last_selected_value": 0, + "report_hide": 0, + "reqd": 0, + "search_index": 0, + "set_only_once": 0, + "translatable": 0, "unique": 0 - }, + }, { - "allow_bulk_edit": 0, - "allow_in_quick_entry": 0, - "allow_on_submit": 0, - "bold": 0, - "collapsible": 0, - "columns": 0, - "fieldname": "report_settings_sb", - "fieldtype": "Section Break", - "hidden": 0, - "ignore_user_permissions": 0, - "ignore_xss_filter": 0, - "in_filter": 0, - "in_global_search": 0, - "in_list_view": 0, - "in_standard_filter": 0, - "label": "Report 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, + "allow_bulk_edit": 0, + "allow_in_quick_entry": 0, + "allow_on_submit": 0, + "bold": 0, + "collapsible": 0, + "columns": 0, + "default": "1", + "depends_on": "eval:doc.allow_stale==0", + "fetch_if_empty": 0, + "fieldname": "stale_days", + "fieldtype": "Int", + "hidden": 0, + "ignore_user_permissions": 0, + "ignore_xss_filter": 0, + "in_filter": 0, + "in_global_search": 0, + "in_list_view": 0, + "in_standard_filter": 0, + "label": "Stale Days", + "length": 0, + "no_copy": 0, + "permlevel": 0, + "precision": "", + "print_hide": 0, + "print_hide_if_no_value": 0, + "read_only": 0, + "remember_last_selected_value": 0, + "report_hide": 0, + "reqd": 0, + "search_index": 0, + "set_only_once": 0, + "translatable": 0, "unique": 0 - }, + }, { - "allow_bulk_edit": 0, - "allow_in_quick_entry": 0, - "allow_on_submit": 0, - "bold": 0, - "collapsible": 0, - "columns": 0, - "default": "0", - "description": "Only select if you have setup Cash Flow Mapper documents", - "fieldname": "use_custom_cash_flow", - "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": "Use Custom Cash Flow Format", - "length": 0, - "no_copy": 0, - "permlevel": 0, - "precision": "", - "print_hide": 0, - "print_hide_if_no_value": 0, - "read_only": 0, - "remember_last_selected_value": 0, - "report_hide": 0, - "reqd": 0, - "search_index": 0, - "set_only_once": 0, - "translatable": 0, + "allow_bulk_edit": 0, + "allow_in_quick_entry": 0, + "allow_on_submit": 0, + "bold": 0, + "collapsible": 0, + "columns": 0, + "fetch_if_empty": 0, + "fieldname": "report_settings_sb", + "fieldtype": "Section Break", + "hidden": 0, + "ignore_user_permissions": 0, + "ignore_xss_filter": 0, + "in_filter": 0, + "in_global_search": 0, + "in_list_view": 0, + "in_standard_filter": 0, + "label": "Report 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 + }, + { + "allow_bulk_edit": 0, + "allow_in_quick_entry": 0, + "allow_on_submit": 0, + "bold": 0, + "collapsible": 0, + "columns": 0, + "default": "0", + "description": "Only select if you have setup Cash Flow Mapper documents", + "fetch_if_empty": 0, + "fieldname": "use_custom_cash_flow", + "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": "Use Custom Cash Flow Format", + "length": 0, + "no_copy": 0, + "permlevel": 0, + "precision": "", + "print_hide": 0, + "print_hide_if_no_value": 0, + "read_only": 0, + "remember_last_selected_value": 0, + "report_hide": 0, + "reqd": 0, + "search_index": 0, + "set_only_once": 0, + "translatable": 0, "unique": 0 } - ], - "has_web_view": 0, - "hide_heading": 0, - "hide_toolbar": 0, - "icon": "icon-cog", - "idx": 1, - "image_view": 0, - "in_create": 0, - "is_submittable": 0, - "issingle": 1, - "istable": 0, - "max_attachments": 0, - "modified": "2019-01-07 16:52:03.869199", - "modified_by": "Administrator", - "module": "Accounts", - "name": "Accounts Settings", - "owner": "Administrator", + ], + "has_web_view": 0, + "hide_heading": 0, + "hide_toolbar": 0, + "icon": "icon-cog", + "idx": 1, + "image_view": 0, + "in_create": 0, + "is_submittable": 0, + "issingle": 1, + "istable": 0, + "max_attachments": 0, + "modified": "2019-04-17 05:58:23.012494", + "modified_by": "Administrator", + "module": "Accounts", + "name": "Accounts Settings", + "owner": "Administrator", "permissions": [ { - "amend": 0, - "cancel": 0, - "create": 1, - "delete": 0, - "email": 1, - "export": 0, - "if_owner": 0, - "import": 0, - "permlevel": 0, - "print": 1, - "read": 1, - "report": 0, - "role": "Accounts Manager", - "set_user_permissions": 0, - "share": 1, - "submit": 0, + "amend": 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": "Accounts Manager", + "set_user_permissions": 0, + "share": 1, + "submit": 0, "write": 1 - }, + }, { - "amend": 0, - "cancel": 0, - "create": 0, - "delete": 0, - "email": 0, - "export": 0, - "if_owner": 0, - "import": 0, - "permlevel": 0, - "print": 0, - "read": 1, - "report": 0, - "role": "Sales User", - "set_user_permissions": 0, - "share": 0, - "submit": 0, + "amend": 0, + "cancel": 0, + "create": 0, + "delete": 0, + "email": 0, + "export": 0, + "if_owner": 0, + "import": 0, + "permlevel": 0, + "print": 0, + "read": 1, + "report": 0, + "role": "Sales User", + "set_user_permissions": 0, + "share": 0, + "submit": 0, "write": 0 - }, + }, { - "amend": 0, - "cancel": 0, - "create": 0, - "delete": 0, - "email": 0, - "export": 0, - "if_owner": 0, - "import": 0, - "permlevel": 0, - "print": 0, - "read": 1, - "report": 0, - "role": "Purchase User", - "set_user_permissions": 0, - "share": 0, - "submit": 0, + "amend": 0, + "cancel": 0, + "create": 0, + "delete": 0, + "email": 0, + "export": 0, + "if_owner": 0, + "import": 0, + "permlevel": 0, + "print": 0, + "read": 1, + "report": 0, + "role": "Purchase User", + "set_user_permissions": 0, + "share": 0, + "submit": 0, "write": 0 } - ], - "quick_entry": 1, - "read_only": 0, - "read_only_onload": 0, - "show_name_in_global_search": 0, - "sort_order": "ASC", - "track_changes": 1, - "track_seen": 0, + ], + "quick_entry": 1, + "read_only": 0, + "read_only_onload": 0, + "show_name_in_global_search": 0, + "sort_order": "ASC", + "track_changes": 1, + "track_seen": 0, "track_views": 0 } \ No newline at end of file diff --git a/erpnext/accounts/doctype/fetch_payment_terms/__init__.py b/erpnext/accounts/doctype/fetch_payment_terms/__init__.py deleted file mode 100644 index e69de29bb2d..00000000000 diff --git a/erpnext/accounts/doctype/fetch_payment_terms/fetch_payment_terms.js b/erpnext/accounts/doctype/fetch_payment_terms/fetch_payment_terms.js deleted file mode 100644 index d16535a2d8c..00000000000 --- a/erpnext/accounts/doctype/fetch_payment_terms/fetch_payment_terms.js +++ /dev/null @@ -1,5 +0,0 @@ -// Copyright (c) 2019, Frappe Technologies Pvt. Ltd. and contributors -// For license information, please see license.txt - -frappe.ui.form.on('Fetch Payment Terms', { -}); diff --git a/erpnext/accounts/doctype/fetch_payment_terms/fetch_payment_terms.json b/erpnext/accounts/doctype/fetch_payment_terms/fetch_payment_terms.json deleted file mode 100644 index c1f83459f81..00000000000 --- a/erpnext/accounts/doctype/fetch_payment_terms/fetch_payment_terms.json +++ /dev/null @@ -1,96 +0,0 @@ -{ - "allow_copy": 0, - "allow_events_in_timeline": 0, - "allow_guest_to_view": 0, - "allow_import": 0, - "allow_rename": 0, - "beta": 0, - "creation": "2019-04-17 11:00:32.823034", - "custom": 0, - "docstatus": 0, - "doctype": "DocType", - "document_type": "", - "editable_grid": 0, - "engine": "InnoDB", - "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": "fetch_payment_terms", - "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": "Always Fetch Payment Terms", - "length": 0, - "no_copy": 0, - "permlevel": 0, - "precision": "", - "print_hide": 0, - "print_hide_if_no_value": 0, - "read_only": 0, - "remember_last_selected_value": 0, - "report_hide": 0, - "reqd": 0, - "search_index": 0, - "set_only_once": 0, - "translatable": 0, - "unique": 0 - } - ], - "has_web_view": 0, - "hide_heading": 0, - "hide_toolbar": 0, - "idx": 0, - "image_view": 0, - "in_create": 0, - "is_submittable": 0, - "issingle": 1, - "istable": 0, - "max_attachments": 0, - "modified": "2019-04-17 11:06:02.216048", - "modified_by": "Administrator", - "module": "Accounts", - "name": "Fetch Payment Terms", - "name_case": "", - "owner": "Administrator", - "permissions": [ - { - "amend": 0, - "cancel": 0, - "create": 1, - "delete": 1, - "email": 1, - "export": 0, - "if_owner": 0, - "import": 0, - "permlevel": 0, - "print": 1, - "read": 1, - "report": 0, - "role": "System Manager", - "set_user_permissions": 0, - "share": 1, - "submit": 0, - "write": 1 - } - ], - "quick_entry": 1, - "read_only": 0, - "read_only_onload": 0, - "show_name_in_global_search": 0, - "sort_field": "modified", - "sort_order": "ASC", - "track_changes": 1, - "track_seen": 0, - "track_views": 0 -} \ No newline at end of file diff --git a/erpnext/accounts/doctype/fetch_payment_terms/fetch_payment_terms.py b/erpnext/accounts/doctype/fetch_payment_terms/fetch_payment_terms.py deleted file mode 100644 index fb2b1467c9b..00000000000 --- a/erpnext/accounts/doctype/fetch_payment_terms/fetch_payment_terms.py +++ /dev/null @@ -1,9 +0,0 @@ -# -*- coding: utf-8 -*- -# Copyright (c) 2019, Frappe Technologies Pvt. Ltd. and contributors -# For license information, please see license.txt - -from __future__ import unicode_literals -from frappe.model.document import Document - -class FetchPaymentTerms(Document): - pass diff --git a/erpnext/accounts/doctype/fetch_payment_terms/test_fetch_payment_terms.js b/erpnext/accounts/doctype/fetch_payment_terms/test_fetch_payment_terms.js deleted file mode 100644 index 80fd8e34f02..00000000000 --- a/erpnext/accounts/doctype/fetch_payment_terms/test_fetch_payment_terms.js +++ /dev/null @@ -1,23 +0,0 @@ -/* eslint-disable */ -// rename this file from _test_[name] to test_[name] to activate -// and remove above this line - -QUnit.test("test: Fetch Payment Terms", function (assert) { - let done = assert.async(); - - // number of asserts - assert.expect(1); - - frappe.run_serially([ - // insert a new Fetch Payment Terms - () => frappe.tests.make('Fetch Payment Terms', [ - // values to be set - {key: 'value'} - ]), - () => { - assert.equal(cur_frm.doc.key, 'value'); - }, - () => done() - ]); - -}); diff --git a/erpnext/accounts/doctype/fetch_payment_terms/test_fetch_payment_terms.py b/erpnext/accounts/doctype/fetch_payment_terms/test_fetch_payment_terms.py deleted file mode 100644 index 86d500466f1..00000000000 --- a/erpnext/accounts/doctype/fetch_payment_terms/test_fetch_payment_terms.py +++ /dev/null @@ -1,9 +0,0 @@ -# -*- coding: utf-8 -*- -# Copyright (c) 2019, Frappe Technologies Pvt. Ltd. and Contributors -# See license.txt -from __future__ import unicode_literals - -import unittest - -class TestFetchPaymentTerms(unittest.TestCase): - pass diff --git a/erpnext/buying/doctype/purchase_order/purchase_order.py b/erpnext/buying/doctype/purchase_order/purchase_order.py index 78113d7dad3..6e452350de6 100644 --- a/erpnext/buying/doctype/purchase_order/purchase_order.py +++ b/erpnext/buying/doctype/purchase_order/purchase_order.py @@ -419,7 +419,7 @@ def make_purchase_invoice(source_name, target_doc=None): } } - if frappe.get_single("Fetch Payment Terms").fetch_payment_terms == 1: + if frappe.get_single("Accounts Settings").automatically_fetch_payment_terms == 1: fields["Payment Schedule"] = { "doctype": "Payment Schedule", "add_if_empty": True diff --git a/erpnext/config/accounts.py b/erpnext/config/accounts.py index f3cf8a28880..42d0df0a06f 100644 --- a/erpnext/config/accounts.py +++ b/erpnext/config/accounts.py @@ -297,13 +297,7 @@ def get_data(): "name": "C-Form", "description": _("C-Form records"), "country": "India" - }, - { - "type": "doctype", - "name": "Fetch Payment Terms", - "label": _("Fetch Payment Terms"), - "description": _("Fetch Payment Terms") - }, + } ] }, {