From cee3670167d80f0c5dedc70ed43095f5709ed570 Mon Sep 17 00:00:00 2001 From: Saqib Ansari Date: Mon, 1 Feb 2021 15:45:26 +0530 Subject: [PATCH 1/3] chore: clean up sales invoice form --- .../pos_closing_entry/pos_closing_entry.json | 13 ++++- .../doctype/pos_invoice/pos_invoice.json | 52 ++++------------- .../doctype/pos_profile/pos_profile.json | 38 +++++++++---- .../pos_profile/pos_profile_dashboard.py | 14 ----- .../doctype/sales_invoice/sales_invoice.json | 57 ++++--------------- erpnext/controllers/taxes_and_totals.py | 3 - .../update_pos_closing_entry_in_merge_log.py | 2 +- erpnext/regional/italy/setup.py | 2 +- 8 files changed, 60 insertions(+), 121 deletions(-) delete mode 100644 erpnext/accounts/doctype/pos_profile/pos_profile_dashboard.py diff --git a/erpnext/accounts/doctype/pos_closing_entry/pos_closing_entry.json b/erpnext/accounts/doctype/pos_closing_entry/pos_closing_entry.json index 18d430f59f..a9b91e02a9 100644 --- a/erpnext/accounts/doctype/pos_closing_entry/pos_closing_entry.json +++ b/erpnext/accounts/doctype/pos_closing_entry/pos_closing_entry.json @@ -6,6 +6,7 @@ "editable_grid": 1, "engine": "InnoDB", "field_order": [ + "period_details_section", "period_start_date", "period_end_date", "column_break_3", @@ -65,7 +66,8 @@ }, { "fieldname": "section_break_5", - "fieldtype": "Section Break" + "fieldtype": "Section Break", + "label": "User Details" }, { "fieldname": "company", @@ -121,7 +123,7 @@ "collapsible_depends_on": "eval:doc.docstatus==0", "fieldname": "section_break_13", "fieldtype": "Section Break", - "label": "Details" + "label": "Totals" }, { "default": "0", @@ -196,6 +198,11 @@ "options": "Draft\nSubmitted\nQueued\nCancelled", "print_hide": 1, "read_only": 1 + }, + { + "fieldname": "period_details_section", + "fieldtype": "Section Break", + "label": "Period Details" } ], "is_submittable": 1, @@ -205,7 +212,7 @@ "link_fieldname": "pos_closing_entry" } ], - "modified": "2021-01-12 12:21:05.388650", + "modified": "2021-02-01 13:47:20.722104", "modified_by": "Administrator", "module": "Accounts", "name": "POS Closing Entry", diff --git a/erpnext/accounts/doctype/pos_invoice/pos_invoice.json b/erpnext/accounts/doctype/pos_invoice/pos_invoice.json index 5bc57b4a84..7459c11d4d 100644 --- a/erpnext/accounts/doctype/pos_invoice/pos_invoice.json +++ b/erpnext/accounts/doctype/pos_invoice/pos_invoice.json @@ -13,11 +13,11 @@ "customer", "customer_name", "tax_id", - "is_pos", "pos_profile", - "offline_pos_name", - "is_return", "consolidated_invoice", + "is_pos", + "is_return", + "update_billed_amount_in_sales_order", "column_break1", "company", "posting_date", @@ -25,10 +25,7 @@ "set_posting_time", "due_date", "amended_from", - "returns", "return_against", - "column_break_21", - "update_billed_amount_in_sales_order", "accounting_dimensions_section", "project", "dimension_col_break", @@ -183,8 +180,7 @@ "column_break_140", "auto_repeat", "update_auto_repeat_reference", - "against_income_account", - "pos_total_qty" + "against_income_account" ], "fields": [ { @@ -265,14 +261,6 @@ "options": "POS Profile", "print_hide": 1 }, - { - "fieldname": "offline_pos_name", - "fieldtype": "Data", - "hidden": 1, - "label": "Offline POS Name", - "print_hide": 1, - "read_only": 1 - }, { "allow_on_submit": 1, "default": "0", @@ -348,26 +336,16 @@ "print_hide": 1, "read_only": 1 }, - { - "depends_on": "return_against", - "fieldname": "returns", - "fieldtype": "Section Break", - "label": "Returns" - }, { "depends_on": "return_against", "fieldname": "return_against", "fieldtype": "Link", - "label": "Return Against POS Invoice", + "label": "Return Against", "no_copy": 1, "options": "POS Invoice", "print_hide": 1, "read_only": 1 }, - { - "fieldname": "column_break_21", - "fieldtype": "Column Break" - }, { "default": "0", "depends_on": "eval: doc.is_return && doc.return_against", @@ -587,19 +565,21 @@ }, { "fieldname": "sec_warehouse", - "fieldtype": "Section Break" + "fieldtype": "Section Break", + "label": "Warehouse" }, { "depends_on": "update_stock", "fieldname": "set_warehouse", "fieldtype": "Link", - "label": "Set Source Warehouse", + "label": "Source Warehouse", "options": "Warehouse", "print_hide": 1 }, { "fieldname": "items_section", "fieldtype": "Section Break", + "label": "Items", "oldfieldtype": "Section Break", "options": "fa fa-shopping-cart" }, @@ -1501,7 +1481,7 @@ "allow_on_submit": 1, "fieldname": "sales_team", "fieldtype": "Table", - "label": "Sales Team1", + "label": "Sales Team", "oldfieldname": "sales_team", "oldfieldtype": "Table", "options": "Sales Team", @@ -1560,15 +1540,6 @@ "print_hide": 1, "report_hide": 1 }, - { - "fieldname": "pos_total_qty", - "fieldtype": "Float", - "hidden": 1, - "label": "Total Qty", - "print_hide": 1, - "print_hide_if_no_value": 1, - "read_only": 1 - }, { "allow_on_submit": 1, "fieldname": "consolidated_invoice", @@ -1581,7 +1552,7 @@ "icon": "fa fa-file-text", "is_submittable": 1, "links": [], - "modified": "2020-10-30 13:56:51.056083", + "modified": "2021-02-01 15:03:33.800707", "modified_by": "Administrator", "module": "Accounts", "name": "POS Invoice", @@ -1626,7 +1597,6 @@ "role": "All" } ], - "quick_entry": 1, "search_fields": "posting_date, due_date, customer, base_grand_total, outstanding_amount", "show_name_in_global_search": 1, "sort_field": "modified", diff --git a/erpnext/accounts/doctype/pos_profile/pos_profile.json b/erpnext/accounts/doctype/pos_profile/pos_profile.json index 4b69f6e2ef..8afa0abd36 100644 --- a/erpnext/accounts/doctype/pos_profile/pos_profile.json +++ b/erpnext/accounts/doctype/pos_profile/pos_profile.json @@ -6,11 +6,10 @@ "doctype": "DocType", "engine": "InnoDB", "field_order": [ - "disabled", - "section_break_2", - "customer", "company", + "customer", "country", + "disabled", "column_break_9", "warehouse", "campaign", @@ -61,10 +60,6 @@ "fieldtype": "Check", "label": "Disabled" }, - { - "fieldname": "section_break_2", - "fieldtype": "Section Break" - }, { "fieldname": "customer", "fieldtype": "Link", @@ -348,9 +343,9 @@ "label": "Allow User to Edit Discount" }, { - "collapsible": 1, "fieldname": "section_break_23", - "fieldtype": "Section Break" + "fieldtype": "Section Break", + "label": "Filters" }, { "fieldname": "column_break_25", @@ -360,8 +355,29 @@ "icon": "icon-cog", "idx": 1, "index_web_pages_for_search": 1, - "links": [], - "modified": "2021-01-06 14:42:41.713864", + "links": [ + { + "group": "Invoices", + "link_doctype": "Sales Invoice", + "link_fieldname": "pos_profile" + }, + { + "group": "Invoices", + "link_doctype": "POS Invoice", + "link_fieldname": "pos_profile" + }, + { + "group": "Opening & Closing", + "link_doctype": "POS Opening Entry", + "link_fieldname": "pos_profile" + }, + { + "group": "Opening & Closing", + "link_doctype": "POS Closing Entry", + "link_fieldname": "pos_profile" + } + ], + "modified": "2021-02-01 13:52:51.081311", "modified_by": "Administrator", "module": "Accounts", "name": "POS Profile", diff --git a/erpnext/accounts/doctype/pos_profile/pos_profile_dashboard.py b/erpnext/accounts/doctype/pos_profile/pos_profile_dashboard.py deleted file mode 100644 index 2e4632a8d5..0000000000 --- a/erpnext/accounts/doctype/pos_profile/pos_profile_dashboard.py +++ /dev/null @@ -1,14 +0,0 @@ -from __future__ import unicode_literals - -from frappe import _ - - -def get_data(): - return { - 'fieldname': 'pos_profile', - 'transactions': [ - { - 'items': ['Sales Invoice', 'POS Closing Entry', 'POS Opening Entry'] - } - ] - } diff --git a/erpnext/accounts/doctype/sales_invoice/sales_invoice.json b/erpnext/accounts/doctype/sales_invoice/sales_invoice.json index 018bc7e641..720a9175e6 100644 --- a/erpnext/accounts/doctype/sales_invoice/sales_invoice.json +++ b/erpnext/accounts/doctype/sales_invoice/sales_invoice.json @@ -12,11 +12,11 @@ "customer", "customer_name", "tax_id", + "pos_profile", "is_pos", "is_consolidated", - "pos_profile", - "offline_pos_name", "is_return", + "update_billed_amount_in_sales_order", "column_break1", "company", "company_tax_id", @@ -24,11 +24,8 @@ "posting_time", "set_posting_time", "due_date", - "amended_from", - "returns", "return_against", - "column_break_21", - "update_billed_amount_in_sales_order", + "amended_from", "accounting_dimensions_section", "project", "dimension_col_break", @@ -188,8 +185,7 @@ "column_break_140", "auto_repeat", "update_auto_repeat_reference", - "against_income_account", - "pos_total_qty" + "against_income_account" ], "fields": [ { @@ -296,16 +292,6 @@ "options": "POS Profile", "print_hide": 1 }, - { - "fieldname": "offline_pos_name", - "fieldtype": "Data", - "hidden": 1, - "hide_days": 1, - "hide_seconds": 1, - "label": "Offline POS Name", - "print_hide": 1, - "read_only": 1 - }, { "default": "0", "fieldname": "is_return", @@ -404,33 +390,19 @@ "print_hide": 1, "read_only": 1 }, - { - "depends_on": "return_against", - "fieldname": "returns", - "fieldtype": "Section Break", - "hide_days": 1, - "hide_seconds": 1, - "label": "Returns" - }, { "depends_on": "return_against", "fieldname": "return_against", "fieldtype": "Link", "hide_days": 1, "hide_seconds": 1, - "label": "Return Against Sales Invoice", + "label": "Return Against", "no_copy": 1, "options": "Sales Invoice", "print_hide": 1, "read_only": 1, "search_index": 1 }, - { - "fieldname": "column_break_21", - "fieldtype": "Column Break", - "hide_days": 1, - "hide_seconds": 1 - }, { "default": "0", "depends_on": "eval: doc.is_return && doc.return_against", @@ -678,7 +650,8 @@ "fieldname": "sec_warehouse", "fieldtype": "Section Break", "hide_days": 1, - "hide_seconds": 1 + "hide_seconds": 1, + "label": "Warehouse" }, { "depends_on": "update_stock", @@ -686,7 +659,7 @@ "fieldtype": "Link", "hide_days": 1, "hide_seconds": 1, - "label": "Set Source Warehouse", + "label": "Source Warehouse", "options": "Warehouse", "print_hide": 1 }, @@ -695,6 +668,7 @@ "fieldtype": "Section Break", "hide_days": 1, "hide_seconds": 1, + "label": "Items", "oldfieldtype": "Section Break", "options": "fa fa-shopping-cart" }, @@ -1904,17 +1878,6 @@ "print_hide": 1, "report_hide": 1 }, - { - "fieldname": "pos_total_qty", - "fieldtype": "Float", - "hidden": 1, - "hide_days": 1, - "hide_seconds": 1, - "label": "Total Qty", - "print_hide": 1, - "print_hide_if_no_value": 1, - "read_only": 1 - }, { "collapsible": 1, "fieldname": "accounting_dimensions_section", @@ -1995,7 +1958,7 @@ "link_fieldname": "consolidated_invoice" } ], - "modified": "2021-01-12 12:16:15.192520", + "modified": "2021-02-01 15:42:26.261540", "modified_by": "Administrator", "module": "Accounts", "name": "Sales Invoice", diff --git a/erpnext/controllers/taxes_and_totals.py b/erpnext/controllers/taxes_and_totals.py index fd744a779d..77ba06e549 100644 --- a/erpnext/controllers/taxes_and_totals.py +++ b/erpnext/controllers/taxes_and_totals.py @@ -239,9 +239,6 @@ class calculate_taxes_and_totals(object): self.doc.round_floats_in(self.doc, ["total", "base_total", "net_total", "base_net_total"]) - if self.doc.doctype == 'Sales Invoice' and self.doc.is_pos: - self.doc.pos_total_qty = self.doc.total_qty - def calculate_taxes(self): self.doc.rounding_adjustment = 0 # maintain actual tax rate based on idx diff --git a/erpnext/patches/v13_0/update_pos_closing_entry_in_merge_log.py b/erpnext/patches/v13_0/update_pos_closing_entry_in_merge_log.py index 42bca7c53a..262e38dd05 100644 --- a/erpnext/patches/v13_0/update_pos_closing_entry_in_merge_log.py +++ b/erpnext/patches/v13_0/update_pos_closing_entry_in_merge_log.py @@ -15,7 +15,7 @@ def execute(): log.pos_closing_entry = ( SELECT clo_ref.parent FROM `tabPOS Invoice Reference` clo_ref WHERE clo_ref.pos_invoice = log_ref.pos_invoice - AND clo_ref.parenttype = 'POS Closing Entry' + AND clo_ref.parenttype = 'POS Closing Entry' LIMIT 1 ) WHERE log_ref.parent = log.name diff --git a/erpnext/regional/italy/setup.py b/erpnext/regional/italy/setup.py index 6ab73413df..217d623a8d 100644 --- a/erpnext/regional/italy/setup.py +++ b/erpnext/regional/italy/setup.py @@ -127,7 +127,7 @@ def make_custom_fields(update=True): options="\n".join(map(lambda x: frappe.safe_decode(x, encoding='utf-8'), vat_collectability_options)), fetch_from="company.vat_collectability"), dict(fieldname='sb_e_invoicing_reference', label='E-Invoicing', - fieldtype='Section Break', insert_after='pos_total_qty', print_hide=1), + fieldtype='Section Break', insert_after='against_income_account', print_hide=1), dict(fieldname='company_tax_id', label='Company Tax ID', fieldtype='Data', insert_after='sb_e_invoicing_reference', print_hide=1, read_only=1, fetch_from="company.tax_id"), From 7863118994613b753b5bf3e8b61b05aca92588d8 Mon Sep 17 00:00:00 2001 From: prssanna Date: Mon, 1 Feb 2021 18:57:30 +0530 Subject: [PATCH 2/3] fix: docs link for store page in shopping cart settings --- .../shopping_cart_settings/shopping_cart_settings.js | 12 ++++++++++++ .../shopping_cart_settings.json | 8 +++++++- 2 files changed, 19 insertions(+), 1 deletion(-) diff --git a/erpnext/shopping_cart/doctype/shopping_cart_settings/shopping_cart_settings.js b/erpnext/shopping_cart/doctype/shopping_cart_settings/shopping_cart_settings.js index 20c6342d6c..b38828e0d7 100644 --- a/erpnext/shopping_cart/doctype/shopping_cart_settings/shopping_cart_settings.js +++ b/erpnext/shopping_cart/doctype/shopping_cart_settings/shopping_cart_settings.js @@ -12,6 +12,18 @@ frappe.ui.form.on("Shopping Cart Settings", { return { 'filters': { 'payment_channel': "Email" } }; }); }, + refresh: function(frm) { + if (frm.doc.enabled) { + frm.get_field('store_page_docs').$wrapper.removeClass('hide-control').html( + `
${__("Follow these steps to create a landing page for your store")}: + + docs/store-landing-page + +
` + ); + } + }, enabled: function(frm) { if (frm.doc.enabled === 1) { frm.set_value('enable_variants', 1); diff --git a/erpnext/shopping_cart/doctype/shopping_cart_settings/shopping_cart_settings.json b/erpnext/shopping_cart/doctype/shopping_cart_settings/shopping_cart_settings.json index 9d61e7d0ec..702583aead 100644 --- a/erpnext/shopping_cart/doctype/shopping_cart_settings/shopping_cart_settings.json +++ b/erpnext/shopping_cart/doctype/shopping_cart_settings/shopping_cart_settings.json @@ -7,6 +7,7 @@ "engine": "InnoDB", "field_order": [ "enabled", + "store_page_docs", "display_settings", "show_attachments", "show_price", @@ -174,13 +175,18 @@ "fieldname": "save_quotations_as_draft", "fieldtype": "Check", "label": "Save Quotations as Draft" + }, + { + "depends_on": "doc.enabled", + "fieldname": "store_page_docs", + "fieldtype": "HTML" } ], "icon": "fa fa-shopping-cart", "idx": 1, "issingle": 1, "links": [], - "modified": "2020-09-24 16:28:07.192525", + "modified": "2021-02-01 18:18:54.606535", "modified_by": "Administrator", "module": "Shopping Cart", "name": "Shopping Cart Settings", From 1d346702ed44b418e29613358f4fd1fae0c4d673 Mon Sep 17 00:00:00 2001 From: prssanna Date: Mon, 1 Feb 2021 19:07:32 +0530 Subject: [PATCH 3/3] chore: add .stylelintrc file --- erpnext/.stylelintrc | 9 +++++++++ 1 file changed, 9 insertions(+) create mode 100644 erpnext/.stylelintrc diff --git a/erpnext/.stylelintrc b/erpnext/.stylelintrc new file mode 100644 index 0000000000..1e05d1fb41 --- /dev/null +++ b/erpnext/.stylelintrc @@ -0,0 +1,9 @@ +{ + "extends": ["stylelint-config-recommended"], + "plugins": ["stylelint-scss"], + "rules": { + "at-rule-no-unknown": null, + "scss/at-rule-no-unknown": true, + "no-descending-specificity": null + } +} \ No newline at end of file