Browse Source

chore: clean up sales invoice form

develop
Saqib Ansari 4 years ago
parent
commit
cee3670167
  1. 13
      erpnext/accounts/doctype/pos_closing_entry/pos_closing_entry.json
  2. 52
      erpnext/accounts/doctype/pos_invoice/pos_invoice.json
  3. 38
      erpnext/accounts/doctype/pos_profile/pos_profile.json
  4. 14
      erpnext/accounts/doctype/pos_profile/pos_profile_dashboard.py
  5. 57
      erpnext/accounts/doctype/sales_invoice/sales_invoice.json
  6. 3
      erpnext/controllers/taxes_and_totals.py
  7. 2
      erpnext/patches/v13_0/update_pos_closing_entry_in_merge_log.py
  8. 2
      erpnext/regional/italy/setup.py

13
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",

52
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",

38
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",

14
erpnext/accounts/doctype/pos_profile/pos_profile_dashboard.py

@ -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']
}
]
}

57
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",

3
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

2
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

2
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"),

Loading…
Cancel
Save