Merge pull request #32272 from deepeshgarg007/internal_transfer_precision_fixes
fix: Incoming rate precision fixes for intra company transfer
diff --git a/.github/workflows/server-tests-mariadb.yml b/.github/workflows/server-tests-mariadb.yml
index e3b92fd..ed731b8 100644
--- a/.github/workflows/server-tests-mariadb.yml
+++ b/.github/workflows/server-tests-mariadb.yml
@@ -120,7 +120,7 @@
FRAPPE_BRANCH: ${{ github.event.inputs.branch }}
- name: Run Tests
- run: cd ~/frappe-bench/ && bench --site test_site run-parallel-tests --app erpnext --use-orchestrator --with-coverage
+ run: 'cd ~/frappe-bench/ && bench --site test_site run-parallel-tests --app erpnext --with-coverage --total-builds 4 --build-number ${{ matrix.container }}'
env:
TYPE: server
CI_BUILD_ID: ${{ github.run_id }}
diff --git a/erpnext/accounts/doctype/pos_invoice/test_pos_invoice.py b/erpnext/accounts/doctype/pos_invoice/test_pos_invoice.py
index 70f128e..3132fdd 100644
--- a/erpnext/accounts/doctype/pos_invoice/test_pos_invoice.py
+++ b/erpnext/accounts/doctype/pos_invoice/test_pos_invoice.py
@@ -495,6 +495,67 @@
self.assertRaises(frappe.ValidationError, pos.submit)
+ def test_value_error_on_serial_no_validation(self):
+ from erpnext.stock.doctype.stock_entry.test_stock_entry import make_serialized_item
+
+ se = make_serialized_item(
+ company="_Test Company",
+ target_warehouse="Stores - _TC",
+ cost_center="Main - _TC",
+ expense_account="Cost of Goods Sold - _TC",
+ )
+ serial_nos = se.get("items")[0].serial_no
+
+ # make a pos invoice
+ pos = create_pos_invoice(
+ company="_Test Company",
+ debit_to="Debtors - _TC",
+ account_for_change_amount="Cash - _TC",
+ warehouse="Stores - _TC",
+ income_account="Sales - _TC",
+ expense_account="Cost of Goods Sold - _TC",
+ cost_center="Main - _TC",
+ item=se.get("items")[0].item_code,
+ rate=1000,
+ qty=1,
+ do_not_save=1,
+ )
+ pos.get("items")[0].has_serial_no = 1
+ pos.get("items")[0].serial_no = serial_nos.split("\n")[0]
+ pos.set("payments", [])
+ pos.append(
+ "payments", {"mode_of_payment": "Cash", "account": "Cash - _TC", "amount": 1000, "default": 1}
+ )
+ pos = pos.save().submit()
+
+ # make a return
+ pos_return = make_sales_return(pos.name)
+ pos_return.paid_amount = pos_return.grand_total
+ pos_return.save()
+ pos_return.submit()
+
+ # set docstatus to 2 for pos to trigger this issue
+ frappe.db.set_value("POS Invoice", pos.name, "docstatus", 2)
+
+ pos2 = create_pos_invoice(
+ company="_Test Company",
+ debit_to="Debtors - _TC",
+ account_for_change_amount="Cash - _TC",
+ warehouse="Stores - _TC",
+ income_account="Sales - _TC",
+ expense_account="Cost of Goods Sold - _TC",
+ cost_center="Main - _TC",
+ item=se.get("items")[0].item_code,
+ rate=1000,
+ qty=1,
+ do_not_save=1,
+ )
+
+ pos2.get("items")[0].has_serial_no = 1
+ pos2.get("items")[0].serial_no = serial_nos.split("\n")[0]
+ # Value error should not be triggered on validation
+ pos2.save()
+
def test_loyalty_points(self):
from erpnext.accounts.doctype.loyalty_program.loyalty_program import (
get_loyalty_program_details_with_points,
diff --git a/erpnext/accounts/doctype/purchase_invoice/purchase_invoice.json b/erpnext/accounts/doctype/purchase_invoice/purchase_invoice.json
index 1e47777..e73d602 100644
--- a/erpnext/accounts/doctype/purchase_invoice/purchase_invoice.json
+++ b/erpnext/accounts/doctype/purchase_invoice/purchase_invoice.json
@@ -12,39 +12,23 @@
"supplier",
"supplier_name",
"tax_id",
- "due_date",
- "tax_withholding_category",
- "column_break1",
"company",
+ "column_break_6",
"posting_date",
"posting_time",
"set_posting_time",
+ "due_date",
+ "column_break1",
"is_paid",
"is_return",
+ "return_against",
"apply_tds",
+ "tax_withholding_category",
"amended_from",
"accounting_dimensions_section",
"cost_center",
"dimension_col_break",
"project",
- "supplier_invoice_details",
- "bill_no",
- "column_break_15",
- "bill_date",
- "returns",
- "return_against",
- "section_addresses",
- "supplier_address",
- "address_display",
- "contact_person",
- "contact_display",
- "contact_mobile",
- "contact_email",
- "col_break_address",
- "shipping_address",
- "shipping_address_display",
- "billing_address",
- "billing_address_display",
"currency_and_price_list",
"currency",
"conversion_rate",
@@ -54,39 +38,33 @@
"plc_conversion_rate",
"ignore_pricing_rule",
"sec_warehouse",
- "set_warehouse",
- "rejected_warehouse",
- "col_break_warehouse",
- "set_from_warehouse",
- "supplier_warehouse",
- "is_subcontracted",
- "items_section",
- "update_stock",
"scan_barcode",
+ "col_break_warehouse",
+ "update_stock",
+ "set_warehouse",
+ "set_from_warehouse",
+ "is_subcontracted",
+ "rejected_warehouse",
+ "supplier_warehouse",
+ "items_section",
"items",
- "pricing_rule_details",
- "pricing_rules",
- "raw_materials_supplied",
- "supplied_items",
"section_break_26",
"total_qty",
+ "total_net_weight",
+ "column_break_50",
"base_total",
"base_net_total",
"column_break_28",
- "total_net_weight",
"total",
"net_total",
"taxes_section",
+ "taxes_and_charges",
+ "column_break_58",
"tax_category",
"column_break_49",
"shipping_rule",
"section_break_51",
- "taxes_and_charges",
"taxes",
- "tax_withheld_vouchers_section",
- "tax_withheld_vouchers",
- "sec_tax_breakup",
- "other_charges_calculation",
"totals",
"base_taxes_and_charges_added",
"base_taxes_and_charges_deducted",
@@ -95,12 +73,6 @@
"taxes_and_charges_added",
"taxes_and_charges_deducted",
"total_taxes_and_charges",
- "section_break_44",
- "apply_discount_on",
- "base_discount_amount",
- "column_break_46",
- "additional_discount_percentage",
- "discount_amount",
"section_break_49",
"base_grand_total",
"base_rounding_adjustment",
@@ -114,24 +86,58 @@
"total_advance",
"outstanding_amount",
"disable_rounded_total",
+ "section_break_44",
+ "apply_discount_on",
+ "base_discount_amount",
+ "additional_discount_account",
+ "column_break_46",
+ "additional_discount_percentage",
+ "discount_amount",
+ "tax_withheld_vouchers_section",
+ "tax_withheld_vouchers",
+ "sec_tax_breakup",
+ "other_charges_calculation",
+ "pricing_rule_details",
+ "pricing_rules",
+ "raw_materials_supplied",
+ "supplied_items",
+ "payments_tab",
"payments_section",
"mode_of_payment",
- "cash_bank_account",
+ "base_paid_amount",
"clearance_date",
"col_br_payments",
+ "cash_bank_account",
"paid_amount",
- "base_paid_amount",
+ "advances_section",
+ "allocate_advances_automatically",
+ "get_advances",
+ "advances",
+ "advance_tax",
"write_off",
"write_off_amount",
"base_write_off_amount",
"column_break_61",
"write_off_account",
"write_off_cost_center",
- "advances_section",
- "allocate_advances_automatically",
- "get_advances",
- "advances",
- "advance_tax",
+ "address_and_contact_tab",
+ "section_addresses",
+ "supplier_address",
+ "address_display",
+ "col_break_address",
+ "contact_person",
+ "contact_display",
+ "contact_mobile",
+ "contact_email",
+ "company_shipping_address_section",
+ "shipping_address",
+ "column_break_126",
+ "shipping_address_display",
+ "company_billing_address_section",
+ "billing_address",
+ "column_break_130",
+ "billing_address_display",
+ "terms_tab",
"payment_schedule_section",
"payment_terms_template",
"ignore_default_payment_terms_template",
@@ -139,23 +145,15 @@
"terms_section_break",
"tc_name",
"terms",
- "printing_settings",
- "letter_head",
- "select_print_heading",
- "column_break_112",
- "group_same_items",
- "language",
- "sb_14",
- "on_hold",
- "release_date",
- "cb_17",
- "hold_comment",
- "more_info",
+ "more_info_tab",
+ "status_section",
"status",
- "inter_company_invoice_reference",
- "represents_company",
- "column_break_147",
- "is_internal_supplier",
+ "column_break_177",
+ "per_received",
+ "supplier_invoice_details",
+ "bill_no",
+ "column_break_15",
+ "bill_date",
"accounting_details_section",
"credit_to",
"party_account_currency",
@@ -163,15 +161,32 @@
"against_expense_account",
"column_break_63",
"unrealized_profit_loss_account",
- "remarks",
"subscription_section",
- "from_date",
- "to_date",
- "column_break_114",
"auto_repeat",
"update_auto_repeat_reference",
- "per_received",
- "is_old_subcontracting_flow"
+ "column_break_114",
+ "from_date",
+ "to_date",
+ "printing_settings",
+ "letter_head",
+ "group_same_items",
+ "column_break_112",
+ "select_print_heading",
+ "language",
+ "sb_14",
+ "on_hold",
+ "release_date",
+ "cb_17",
+ "hold_comment",
+ "additional_info_section",
+ "is_internal_supplier",
+ "represents_company",
+ "column_break_147",
+ "inter_company_invoice_reference",
+ "is_old_subcontracting_flow",
+ "remarks",
+ "connections_tab",
+ "column_break_38"
],
"fields": [
{
@@ -354,7 +369,7 @@
"collapsible_depends_on": "bill_no",
"fieldname": "supplier_invoice_details",
"fieldtype": "Section Break",
- "label": "Supplier Invoice Details"
+ "label": "Supplier Invoice"
},
{
"fieldname": "bill_no",
@@ -379,12 +394,6 @@
},
{
"depends_on": "return_against",
- "fieldname": "returns",
- "fieldtype": "Section Break",
- "label": "Returns"
- },
- {
- "depends_on": "return_against",
"fieldname": "return_against",
"fieldtype": "Link",
"label": "Return Against Purchase Invoice",
@@ -394,10 +403,9 @@
"read_only": 1
},
{
- "collapsible": 1,
"fieldname": "section_addresses",
"fieldtype": "Section Break",
- "label": "Address and Contact"
+ "label": "Supplier Address"
},
{
"fieldname": "supplier_address",
@@ -518,11 +526,12 @@
},
{
"fieldname": "sec_warehouse",
- "fieldtype": "Section Break"
+ "fieldtype": "Section Break",
+ "hide_border": 1,
+ "label": "Items"
},
{
"depends_on": "update_stock",
- "description": "Sets 'Accepted Warehouse' in each row of the items table.",
"fieldname": "set_warehouse",
"fieldtype": "Link",
"label": "Set Accepted Warehouse",
@@ -531,7 +540,6 @@
},
{
"depends_on": "update_stock",
- "description": "Warehouse where you are maintaining stock of rejected items",
"fieldname": "rejected_warehouse",
"fieldtype": "Link",
"label": "Rejected Warehouse",
@@ -554,6 +562,7 @@
{
"fieldname": "items_section",
"fieldtype": "Section Break",
+ "hide_border": 1,
"oldfieldtype": "Section Break",
"options": "fa fa-shopping-cart"
},
@@ -581,6 +590,7 @@
"reqd": 1
},
{
+ "collapsible": 1,
"fieldname": "pricing_rule_details",
"fieldtype": "Section Break",
"label": "Pricing Rules"
@@ -593,6 +603,7 @@
"read_only": 1
},
{
+ "collapsible": 1,
"collapsible_depends_on": "supplied_items",
"fieldname": "raw_materials_supplied",
"fieldtype": "Section Break",
@@ -656,6 +667,7 @@
"read_only": 1
},
{
+ "depends_on": "total_net_weight",
"fieldname": "total_net_weight",
"fieldtype": "Float",
"label": "Total Net Weight",
@@ -665,6 +677,8 @@
{
"fieldname": "taxes_section",
"fieldtype": "Section Break",
+ "hide_border": 1,
+ "label": "Taxes and Charges",
"oldfieldtype": "Section Break",
"options": "fa fa-money"
},
@@ -688,7 +702,8 @@
},
{
"fieldname": "section_break_51",
- "fieldtype": "Section Break"
+ "fieldtype": "Section Break",
+ "hide_border": 1
},
{
"fieldname": "taxes_and_charges",
@@ -792,7 +807,6 @@
},
{
"collapsible": 1,
- "collapsible_depends_on": "discount_amount",
"fieldname": "section_break_44",
"fieldtype": "Section Break",
"label": "Additional Discount"
@@ -832,7 +846,8 @@
},
{
"fieldname": "section_break_49",
- "fieldtype": "Section Break"
+ "fieldtype": "Section Break",
+ "label": "Totals"
},
{
"fieldname": "base_grand_total",
@@ -1003,8 +1018,6 @@
},
{
"collapsible": 1,
- "collapsible_depends_on": "write_off_amount",
- "depends_on": "grand_total",
"fieldname": "write_off",
"fieldtype": "Section Break",
"label": "Write Off"
@@ -1081,7 +1094,6 @@
"print_hide": 1
},
{
- "collapsible": 1,
"collapsible_depends_on": "eval:(!doc.is_return)",
"fieldname": "payment_schedule_section",
"fieldtype": "Section Break",
@@ -1102,8 +1114,6 @@
"print_hide": 1
},
{
- "collapsible": 1,
- "collapsible_depends_on": "terms",
"fieldname": "terms_section_break",
"fieldtype": "Section Break",
"label": "Terms and Conditions",
@@ -1119,13 +1129,13 @@
{
"fieldname": "terms",
"fieldtype": "Text Editor",
- "label": "Terms and Conditions1"
+ "label": "Terms and Conditions"
},
{
"collapsible": 1,
"fieldname": "printing_settings",
"fieldtype": "Section Break",
- "label": "Printing Settings"
+ "label": "Print Settings"
},
{
"allow_on_submit": 1,
@@ -1167,15 +1177,6 @@
"read_only": 1
},
{
- "collapsible": 1,
- "fieldname": "more_info",
- "fieldtype": "Section Break",
- "label": "More Information",
- "oldfieldtype": "Section Break",
- "options": "fa fa-file-text",
- "print_hide": 1
- },
- {
"default": "0",
"fetch_from": "supplier.is_internal_supplier",
"fieldname": "is_internal_supplier",
@@ -1260,7 +1261,7 @@
"collapsible": 1,
"fieldname": "subscription_section",
"fieldtype": "Section Break",
- "label": "Subscription Section",
+ "label": "Subscription",
"print_hide": 1
},
{
@@ -1339,7 +1340,7 @@
},
{
"depends_on": "eval:doc.is_internal_supplier",
- "description": "Unrealized Profit / Loss account for intra-company transfers",
+ "description": "Unrealized Profit/Loss account for intra-company transfers",
"fieldname": "unrealized_profit_loss_account",
"fieldtype": "Link",
"label": "Unrealized Profit / Loss Account",
@@ -1356,7 +1357,6 @@
},
{
"depends_on": "eval:doc.update_stock && doc.is_internal_supplier",
- "description": "Sets 'From Warehouse' in each row of the items table.",
"fieldname": "set_from_warehouse",
"fieldtype": "Link",
"label": "Set From Warehouse",
@@ -1422,6 +1422,7 @@
"read_only": 1
},
{
+ "collapsible_depends_on": "tax_withheld_vouchers",
"fieldname": "tax_withheld_vouchers_section",
"fieldtype": "Section Break",
"label": "Tax Withheld Vouchers"
@@ -1433,13 +1434,92 @@
"no_copy": 1,
"options": "Tax Withheld Vouchers",
"read_only": 1
+ },
+ {
+ "fieldname": "payments_tab",
+ "fieldtype": "Tab Break",
+ "label": "Payments"
+ },
+ {
+ "fieldname": "address_and_contact_tab",
+ "fieldtype": "Tab Break",
+ "label": "Address & Contact"
+ },
+ {
+ "fieldname": "terms_tab",
+ "fieldtype": "Tab Break",
+ "label": "Terms"
+ },
+ {
+ "fieldname": "more_info_tab",
+ "fieldtype": "Tab Break",
+ "label": "More Info"
+ },
+ {
+ "fieldname": "connections_tab",
+ "fieldtype": "Tab Break",
+ "label": "Connections",
+ "show_dashboard": 1
+ },
+ {
+ "fieldname": "column_break_6",
+ "fieldtype": "Column Break"
+ },
+ {
+ "fieldname": "column_break_38",
+ "fieldtype": "Column Break"
+ },
+ {
+ "fieldname": "column_break_50",
+ "fieldtype": "Column Break"
+ },
+ {
+ "fieldname": "column_break_58",
+ "fieldtype": "Column Break"
+ },
+ {
+ "fieldname": "company_shipping_address_section",
+ "fieldtype": "Section Break",
+ "label": "Company Shipping Address"
+ },
+ {
+ "fieldname": "column_break_126",
+ "fieldtype": "Column Break"
+ },
+ {
+ "fieldname": "company_billing_address_section",
+ "fieldtype": "Section Break",
+ "label": "Company Billing Address"
+ },
+ {
+ "fieldname": "column_break_130",
+ "fieldtype": "Column Break"
+ },
+ {
+ "collapsible": 1,
+ "fieldname": "status_section",
+ "fieldtype": "Section Break",
+ "label": "Status"
+ },
+ {
+ "fieldname": "column_break_177",
+ "fieldtype": "Column Break"
+ },
+ {
+ "collapsible": 1,
+ "fieldname": "additional_info_section",
+ "fieldtype": "Section Break",
+ "label": "Additional Info",
+ "oldfieldtype": "Section Break",
+ "options": "fa fa-file-text",
+ "print_hide": 1
}
],
"icon": "fa fa-file-text",
"idx": 204,
"is_submittable": 1,
"links": [],
- "modified": "2022-10-07 14:19:14.214157",
+ "modified": "2022-10-11 13:04:44.304389",
"modified_by": "Administrator",
"module": "Accounts",
"name": "Purchase Invoice",
diff --git a/erpnext/accounts/doctype/purchase_invoice/purchase_invoice.py b/erpnext/accounts/doctype/purchase_invoice/purchase_invoice.py
index 2b633cb..5dbe7eb 100644
--- a/erpnext/accounts/doctype/purchase_invoice/purchase_invoice.py
+++ b/erpnext/accounts/doctype/purchase_invoice/purchase_invoice.py
@@ -705,6 +705,10 @@
)
)
+ credit_amount = item.base_net_amount
+ if self.is_internal_supplier and item.valuation_rate:
+ credit_amount = flt(item.valuation_rate * item.stock_qty)
+
# Intentionally passed negative debit amount to avoid incorrect GL Entry validation
gl_entries.append(
self.get_gl_dict(
@@ -714,7 +718,7 @@
"cost_center": item.cost_center,
"project": item.project or self.project,
"remarks": self.get("remarks") or _("Accounting Entry for Stock"),
- "debit": -1 * flt(item.base_net_amount, item.precision("base_net_amount")),
+ "debit": -1 * flt(credit_amount, item.precision("base_net_amount")),
},
warehouse_account[item.from_warehouse]["account_currency"],
item=item,
diff --git a/erpnext/accounts/doctype/sales_invoice/sales_invoice.json b/erpnext/accounts/doctype/sales_invoice/sales_invoice.json
index 2da5157..97e5f40 100644
--- a/erpnext/accounts/doctype/sales_invoice/sales_invoice.json
+++ b/erpnext/accounts/doctype/sales_invoice/sales_invoice.json
@@ -12,44 +12,29 @@
"customer",
"customer_name",
"tax_id",
- "pos_profile",
- "is_pos",
- "is_consolidated",
- "is_return",
- "is_debit_note",
- "update_billed_amount_in_sales_order",
- "column_break1",
"company",
"company_tax_id",
+ "column_break1",
"posting_date",
"posting_time",
"set_posting_time",
"due_date",
+ "column_break_14",
+ "is_pos",
+ "pos_profile",
+ "is_consolidated",
+ "is_return",
"return_against",
+ "update_billed_amount_in_sales_order",
+ "is_debit_note",
"amended_from",
"accounting_dimensions_section",
- "project",
- "dimension_col_break",
"cost_center",
- "customer_po_details",
- "po_no",
- "column_break_23",
- "po_date",
- "address_and_contact",
- "customer_address",
- "address_display",
- "contact_person",
- "contact_display",
- "contact_mobile",
- "contact_email",
- "territory",
- "col_break4",
- "shipping_address_name",
- "shipping_address",
- "company_address",
- "company_address_display",
- "dispatch_address_name",
- "dispatch_address",
+ "dimension_col_break",
+ "project",
+ "column_break_27",
+ "campaign",
+ "source",
"currency_and_price_list",
"currency",
"conversion_rate",
@@ -58,60 +43,35 @@
"price_list_currency",
"plc_conversion_rate",
"ignore_pricing_rule",
- "sec_warehouse",
- "set_warehouse",
- "column_break_55",
- "set_target_warehouse",
"items_section",
- "update_stock",
"scan_barcode",
+ "update_stock",
+ "column_break_39",
+ "set_warehouse",
+ "set_target_warehouse",
+ "section_break_42",
"items",
- "pricing_rule_details",
- "pricing_rules",
- "packing_list",
- "packed_items",
- "product_bundle_help",
- "time_sheet_list",
- "timesheets",
- "total_billing_amount",
- "total_billing_hours",
"section_break_30",
"total_qty",
+ "total_net_weight",
+ "column_break_32",
"base_total",
"base_net_total",
- "column_break_32",
- "total_net_weight",
+ "column_break_52",
"total",
"net_total",
"taxes_section",
"taxes_and_charges",
"column_break_38",
"shipping_rule",
+ "column_break_55",
"tax_category",
"section_break_40",
"taxes",
- "sec_tax_breakup",
- "other_charges_calculation",
"section_break_43",
"base_total_taxes_and_charges",
"column_break_47",
"total_taxes_and_charges",
- "loyalty_points_redemption",
- "loyalty_points",
- "loyalty_amount",
- "redeem_loyalty_points",
- "column_break_77",
- "loyalty_program",
- "loyalty_redemption_account",
- "loyalty_redemption_cost_center",
- "section_break_49",
- "apply_discount_on",
- "is_cash_or_non_trade_discount",
- "base_discount_amount",
- "additional_discount_account",
- "column_break_51",
- "additional_discount_percentage",
- "discount_amount",
"totals",
"base_grand_total",
"base_rounding_adjustment",
@@ -125,21 +85,28 @@
"total_advance",
"outstanding_amount",
"disable_rounded_total",
- "column_break4",
- "write_off_amount",
- "base_write_off_amount",
- "write_off_outstanding_amount_automatically",
- "column_break_74",
- "write_off_account",
- "write_off_cost_center",
- "advances_section",
- "allocate_advances_automatically",
- "get_advances",
- "advances",
- "payment_schedule_section",
- "ignore_default_payment_terms_template",
- "payment_terms_template",
- "payment_schedule",
+ "section_break_49",
+ "apply_discount_on",
+ "base_discount_amount",
+ "is_cash_or_non_trade_discount",
+ "additional_discount_account",
+ "column_break_51",
+ "additional_discount_percentage",
+ "discount_amount",
+ "sec_tax_breakup",
+ "other_charges_calculation",
+ "pricing_rule_details",
+ "pricing_rules",
+ "packing_list",
+ "packed_items",
+ "product_bundle_help",
+ "time_sheet_list",
+ "timesheets",
+ "section_break_104",
+ "total_billing_hours",
+ "column_break_106",
+ "total_billing_amount",
+ "payments_tab",
"payments_section",
"cash_bank_account",
"payments",
@@ -152,47 +119,95 @@
"column_break_90",
"change_amount",
"account_for_change_amount",
+ "advances_section",
+ "allocate_advances_automatically",
+ "get_advances",
+ "advances",
+ "write_off_section",
+ "write_off_amount",
+ "base_write_off_amount",
+ "write_off_outstanding_amount_automatically",
+ "column_break_74",
+ "write_off_account",
+ "write_off_cost_center",
+ "loyalty_points_redemption",
+ "redeem_loyalty_points",
+ "loyalty_points",
+ "loyalty_amount",
+ "column_break_77",
+ "loyalty_program",
+ "loyalty_redemption_account",
+ "loyalty_redemption_cost_center",
+ "contact_and_address_tab",
+ "address_and_contact",
+ "customer_address",
+ "address_display",
+ "col_break4",
+ "contact_person",
+ "contact_display",
+ "contact_mobile",
+ "contact_email",
+ "territory",
+ "shipping_address_section",
+ "shipping_address_name",
+ "shipping_address",
+ "shipping_addr_col_break",
+ "dispatch_address_name",
+ "dispatch_address",
+ "company_address_section",
+ "company_address",
+ "company_addr_col_break",
+ "company_address_display",
+ "terms_tab",
+ "payment_schedule_section",
+ "ignore_default_payment_terms_template",
+ "payment_terms_template",
+ "payment_schedule",
"terms_section_break",
"tc_name",
"terms",
- "edit_printing_settings",
- "letter_head",
- "group_same_items",
- "select_print_heading",
- "column_break_84",
- "language",
- "more_information",
- "status",
- "inter_company_invoice_reference",
- "represents_company",
- "customer_group",
- "campaign",
- "col_break23",
- "is_internal_customer",
- "is_discounted",
- "source",
+ "more_info_tab",
+ "customer_po_details",
+ "po_no",
+ "column_break_23",
+ "po_date",
"more_info",
"debit_to",
"party_account_currency",
"is_opening",
"column_break8",
"unrealized_profit_loss_account",
- "remarks",
+ "against_income_account",
"sales_team_section_break",
"sales_partner",
- "column_break10",
"amount_eligible_for_commission",
+ "column_break10",
"commission_rate",
"total_commission",
"section_break2",
"sales_team",
+ "edit_printing_settings",
+ "letter_head",
+ "group_same_items",
+ "column_break_84",
+ "select_print_heading",
+ "language",
"subscription_section",
"from_date",
- "to_date",
- "column_break_140",
"auto_repeat",
+ "column_break_140",
+ "to_date",
"update_auto_repeat_reference",
- "against_income_account"
+ "more_information",
+ "status",
+ "inter_company_invoice_reference",
+ "represents_company",
+ "customer_group",
+ "col_break23",
+ "is_internal_customer",
+ "is_discounted",
+ "remarks",
+ "connections_tab"
],
"fields": [
{
@@ -453,12 +468,11 @@
"label": "Customer's Purchase Order Date"
},
{
- "collapsible": 1,
"fieldname": "address_and_contact",
"fieldtype": "Section Break",
"hide_days": 1,
"hide_seconds": 1,
- "label": "Address and Contact"
+ "label": "Billing Address"
},
{
"fieldname": "customer_address",
@@ -560,7 +574,6 @@
{
"fieldname": "company_address_display",
"fieldtype": "Small Text",
- "hidden": 1,
"hide_days": 1,
"hide_seconds": 1,
"label": "Company Address",
@@ -652,13 +665,6 @@
"print_hide": 1
},
{
- "fieldname": "sec_warehouse",
- "fieldtype": "Section Break",
- "hide_days": 1,
- "hide_seconds": 1,
- "label": "Warehouse"
- },
- {
"depends_on": "update_stock",
"fieldname": "set_warehouse",
"fieldtype": "Link",
@@ -671,6 +677,7 @@
{
"fieldname": "items_section",
"fieldtype": "Section Break",
+ "hide_border": 1,
"hide_days": 1,
"hide_seconds": 1,
"label": "Items",
@@ -702,7 +709,6 @@
"fieldtype": "Table",
"hide_days": 1,
"hide_seconds": 1,
- "label": "Items",
"oldfieldname": "entries",
"oldfieldtype": "Table",
"options": "Sales Invoice Item",
@@ -755,9 +761,10 @@
{
"collapsible": 1,
"collapsible_depends_on": "eval:doc.total_billing_amount > 0",
- "depends_on": "eval: !doc.is_return",
+ "depends_on": "eval:!doc.is_return",
"fieldname": "time_sheet_list",
"fieldtype": "Section Break",
+ "hide_border": 1,
"hide_days": 1,
"hide_seconds": 1,
"label": "Time Sheet List"
@@ -845,6 +852,7 @@
"read_only": 1
},
{
+ "depends_on": "total_net_weight",
"fieldname": "total_net_weight",
"fieldtype": "Float",
"hide_days": 1,
@@ -856,8 +864,10 @@
{
"fieldname": "taxes_section",
"fieldtype": "Section Break",
+ "hide_border": 1,
"hide_days": 1,
"hide_seconds": 1,
+ "label": "Taxes and Charges",
"oldfieldtype": "Section Break",
"options": "fa fa-money"
},
@@ -900,6 +910,7 @@
{
"fieldname": "section_break_40",
"fieldtype": "Section Break",
+ "hide_border": 1,
"hide_days": 1,
"hide_seconds": 1
},
@@ -908,7 +919,6 @@
"fieldtype": "Table",
"hide_days": 1,
"hide_seconds": 1,
- "label": "Sales Taxes and Charges",
"oldfieldname": "other_charges",
"oldfieldtype": "Table",
"options": "Sales Taxes and Charges"
@@ -1046,7 +1056,6 @@
},
{
"collapsible": 1,
- "collapsible_depends_on": "discount_amount",
"fieldname": "section_break_49",
"fieldtype": "Section Break",
"hide_days": 1,
@@ -1102,6 +1111,7 @@
"fieldtype": "Section Break",
"hide_days": 1,
"hide_seconds": 1,
+ "label": "Totals",
"oldfieldtype": "Section Break",
"options": "fa fa-money",
"print_hide": 1
@@ -1283,8 +1293,6 @@
"print_hide": 1
},
{
- "collapsible": 1,
- "collapsible_depends_on": "eval:(!doc.is_pos && !doc.is_return)",
"fieldname": "payment_schedule_section",
"fieldtype": "Section Break",
"hide_days": 1,
@@ -1314,7 +1322,9 @@
"print_hide": 1
},
{
- "depends_on": "eval:doc.is_pos===1||(doc.advances && doc.advances.length>0)",
+ "collapsible": 1,
+ "collapsible_depends_on": "eval:!doc.is_pos",
+ "depends_on": "eval:doc.is_pos===1",
"fieldname": "payments_section",
"fieldtype": "Section Break",
"hide_days": 1,
@@ -1352,6 +1362,7 @@
"hide_seconds": 1
},
{
+ "depends_on": "eval: doc.is_pos || doc.redeem_loyalty_points",
"fieldname": "base_paid_amount",
"fieldtype": "Currency",
"hide_days": 1,
@@ -1383,10 +1394,13 @@
"read_only": 1
},
{
+ "collapsible": 1,
+ "depends_on": "is_pos",
"fieldname": "section_break_88",
"fieldtype": "Section Break",
"hide_days": 1,
- "hide_seconds": 1
+ "hide_seconds": 1,
+ "label": "Changes"
},
{
"depends_on": "is_pos",
@@ -1428,17 +1442,6 @@
"print_hide": 1
},
{
- "collapsible": 1,
- "collapsible_depends_on": "write_off_amount",
- "depends_on": "grand_total",
- "fieldname": "column_break4",
- "fieldtype": "Section Break",
- "hide_days": 1,
- "hide_seconds": 1,
- "label": "Write Off",
- "width": "50%"
- },
- {
"fieldname": "write_off_amount",
"fieldtype": "Currency",
"hide_days": 1,
@@ -1495,8 +1498,6 @@
"print_hide": 1
},
{
- "collapsible": 1,
- "collapsible_depends_on": "terms",
"fieldname": "terms_section_break",
"fieldtype": "Section Break",
"hide_days": 1,
@@ -1530,7 +1531,7 @@
"fieldtype": "Section Break",
"hide_days": 1,
"hide_seconds": 1,
- "label": "Printing Settings"
+ "label": "Print Settings"
},
{
"allow_on_submit": 1,
@@ -1591,7 +1592,7 @@
"fieldtype": "Section Break",
"hide_days": 1,
"hide_seconds": 1,
- "label": "More Information"
+ "label": "Additional Info"
},
{
"fieldname": "inter_company_invoice_reference",
@@ -1814,7 +1815,7 @@
"fieldtype": "Section Break",
"hide_days": 1,
"hide_seconds": 1,
- "label": "Subscription Section"
+ "label": "Subscription"
},
{
"allow_on_submit": 1,
@@ -1936,10 +1937,6 @@
"read_only": 1
},
{
- "fieldname": "column_break_55",
- "fieldtype": "Column Break"
- },
- {
"depends_on": "eval: doc.is_internal_customer && doc.update_stock",
"fieldname": "set_target_warehouse",
"fieldtype": "Link",
@@ -2009,6 +2006,97 @@
"fieldname": "is_cash_or_non_trade_discount",
"fieldtype": "Check",
"label": "Is Cash or Non Trade Discount"
+ },
+ {
+ "fieldname": "contact_and_address_tab",
+ "fieldtype": "Tab Break",
+ "label": "Contact & Address"
+ },
+ {
+ "fieldname": "payments_tab",
+ "fieldtype": "Tab Break",
+ "label": "Payments"
+ },
+ {
+ "fieldname": "terms_tab",
+ "fieldtype": "Tab Break",
+ "label": "Terms"
+ },
+ {
+ "fieldname": "more_info_tab",
+ "fieldtype": "Tab Break",
+ "label": "More Info"
+ },
+ {
+ "fieldname": "connections_tab",
+ "fieldtype": "Tab Break",
+ "label": "Connections",
+ "show_dashboard": 1
+ },
+ {
+ "fieldname": "column_break_14",
+ "fieldtype": "Column Break"
+ },
+ {
+ "fieldname": "column_break_39",
+ "fieldtype": "Column Break"
+ },
+ {
+ "fieldname": "section_break_42",
+ "fieldtype": "Section Break",
+ "hide_border": 1,
+ "hide_days": 1,
+ "hide_seconds": 1
+ },
+ {
+ "fieldname": "column_break_55",
+ "fieldtype": "Column Break"
+ },
+ {
+ "fieldname": "shipping_address_section",
+ "fieldtype": "Section Break",
+ "label": "Shipping Address"
+ },
+ {
+ "fieldname": "company_address_section",
+ "fieldtype": "Section Break",
+ "label": "Company Address"
+ },
+ {
+ "fieldname": "shipping_addr_col_break",
+ "fieldtype": "Column Break"
+ },
+ {
+ "fieldname": "company_addr_col_break",
+ "fieldtype": "Column Break"
+ },
+ {
+ "fieldname": "column_break_27",
+ "fieldtype": "Column Break"
+ },
+ {
+ "fieldname": "column_break_52",
+ "fieldtype": "Column Break"
+ },
+ {
+ "depends_on": "eval:(!doc.is_return && doc.total_billing_amount > 0)",
+ "fieldname": "section_break_104",
+ "fieldtype": "Section Break"
+ },
+ {
+ "fieldname": "column_break_106",
+ "fieldtype": "Column Break"
+ },
+ {
+ "collapsible": 1,
+ "collapsible_depends_on": "write_off_amount",
+ "depends_on": "grand_total",
+ "fieldname": "write_off_section",
+ "fieldtype": "Section Break",
+ "hide_days": 1,
+ "hide_seconds": 1,
+ "label": "Write Off",
+ "width": "50%"
}
],
"icon": "fa fa-file-text",
@@ -2021,7 +2109,7 @@
"link_fieldname": "consolidated_invoice"
}
],
- "modified": "2022-09-16 17:44:22.227332",
+ "modified": "2022-10-11 13:07:36.488095",
"modified_by": "Administrator",
"module": "Accounts",
"name": "Sales Invoice",
diff --git a/erpnext/accounts/doctype/sales_invoice/test_sales_invoice.py b/erpnext/accounts/doctype/sales_invoice/test_sales_invoice.py
index b63b9ed..301d3e1 100644
--- a/erpnext/accounts/doctype/sales_invoice/test_sales_invoice.py
+++ b/erpnext/accounts/doctype/sales_invoice/test_sales_invoice.py
@@ -3307,6 +3307,7 @@
"item_name": args.item_name or "_Test Item",
"description": args.description or "_Test Item",
"warehouse": args.warehouse or "_Test Warehouse - _TC",
+ "target_warehouse": args.target_warehouse,
"qty": args.qty or 1,
"uom": args.uom or "Nos",
"stock_uom": args.uom or "Nos",
diff --git a/erpnext/buying/doctype/purchase_order/purchase_order.json b/erpnext/buying/doctype/purchase_order/purchase_order.json
index fb8f25a..2193985 100644
--- a/erpnext/buying/doctype/purchase_order/purchase_order.json
+++ b/erpnext/buying/doctype/purchase_order/purchase_order.json
@@ -12,43 +12,24 @@
"title",
"naming_series",
"supplier",
- "get_items_from_open_material_requests",
"supplier_name",
+ "order_confirmation_no",
+ "order_confirmation_date",
+ "get_items_from_open_material_requests",
+ "column_break_7",
+ "transaction_date",
+ "schedule_date",
+ "column_break1",
+ "company",
"apply_tds",
"tax_withholding_category",
"is_subcontracted",
"supplier_warehouse",
- "column_break1",
- "company",
- "transaction_date",
- "schedule_date",
- "order_confirmation_no",
- "order_confirmation_date",
"amended_from",
"accounting_dimensions_section",
"cost_center",
"dimension_col_break",
"project",
- "drop_ship",
- "customer",
- "customer_name",
- "column_break_19",
- "customer_contact_person",
- "customer_contact_display",
- "customer_contact_mobile",
- "customer_contact_email",
- "section_addresses",
- "supplier_address",
- "address_display",
- "contact_person",
- "contact_display",
- "contact_mobile",
- "contact_email",
- "col_break_address",
- "shipping_address",
- "shipping_address_display",
- "billing_address",
- "billing_address_display",
"currency_and_price_list",
"currency",
"conversion_rate",
@@ -57,7 +38,6 @@
"price_list_currency",
"plc_conversion_rate",
"ignore_pricing_rule",
- "section_break_45",
"before_items_section",
"scan_barcode",
"set_from_warehouse",
@@ -67,10 +47,11 @@
"items",
"sb_last_purchase",
"total_qty",
+ "total_net_weight",
+ "column_break_40",
"base_total",
"base_net_total",
"column_break_26",
- "total_net_weight",
"total",
"net_total",
"section_break_48",
@@ -79,14 +60,13 @@
"set_reserve_warehouse",
"supplied_items",
"taxes_section",
+ "taxes_and_charges",
+ "column_break_53",
"tax_category",
"column_break_50",
"shipping_rule",
"section_break_52",
- "taxes_and_charges",
"taxes",
- "sec_tax_breakup",
- "other_charges_calculation",
"totals",
"base_taxes_and_charges_added",
"base_taxes_and_charges_deducted",
@@ -95,12 +75,6 @@
"taxes_and_charges_added",
"taxes_and_charges_deducted",
"total_taxes_and_charges",
- "discount_section",
- "apply_discount_on",
- "base_discount_amount",
- "column_break_45",
- "additional_discount_percentage",
- "discount_amount",
"totals_section",
"base_grand_total",
"base_rounding_adjustment",
@@ -113,37 +87,73 @@
"disable_rounded_total",
"in_words",
"advance_paid",
+ "discount_section",
+ "apply_discount_on",
+ "base_discount_amount",
+ "column_break_45",
+ "additional_discount_percentage",
+ "discount_amount",
+ "sec_tax_breakup",
+ "other_charges_calculation",
+ "address_and_contact_tab",
+ "section_addresses",
+ "supplier_address",
+ "address_display",
+ "col_break_address",
+ "contact_person",
+ "contact_display",
+ "contact_mobile",
+ "contact_email",
+ "company_shipping_address_section",
+ "shipping_address",
+ "column_break_99",
+ "shipping_address_display",
+ "company_billing_address_section",
+ "billing_address",
+ "column_break_103",
+ "billing_address_display",
+ "drop_ship",
+ "customer",
+ "customer_name",
+ "column_break_19",
+ "customer_contact_person",
+ "customer_contact_display",
+ "customer_contact_mobile",
+ "customer_contact_email",
+ "terms_tab",
"payment_schedule_section",
"payment_terms_template",
"payment_schedule",
+ "terms_section_break",
+ "tc_name",
+ "terms",
+ "more_info_tab",
"tracking_section",
"status",
"column_break_75",
"per_billed",
"per_received",
- "terms_section_break",
- "tc_name",
- "terms",
"column_break5",
"letter_head",
- "select_print_heading",
- "column_break_86",
- "language",
"group_same_items",
+ "column_break_86",
+ "select_print_heading",
+ "language",
"subscription_section",
"from_date",
"to_date",
"column_break_97",
"auto_repeat",
"update_auto_repeat_reference",
- "more_info",
+ "additional_info_section",
+ "is_internal_supplier",
+ "represents_company",
"ref_sq",
"column_break_74",
"party_account_currency",
- "is_internal_supplier",
- "represents_company",
"inter_company_order_reference",
- "is_old_subcontracting_flow"
+ "is_old_subcontracting_flow",
+ "dashboard"
],
"fields": [
{
@@ -267,8 +277,9 @@
"read_only": 1
},
{
+ "depends_on": "eval:doc.customer",
"fieldname": "drop_ship",
- "fieldtype": "Section Break",
+ "fieldtype": "Tab Break",
"label": "Drop Ship"
},
{
@@ -299,7 +310,6 @@
{
"fieldname": "customer_contact_display",
"fieldtype": "Small Text",
- "hidden": 1,
"label": "Customer Contact",
"print_hide": 1
},
@@ -319,10 +329,9 @@
"print_hide": 1
},
{
- "collapsible": 1,
"fieldname": "section_addresses",
"fieldtype": "Section Break",
- "label": "Address and Contact"
+ "label": "Supplier Address"
},
{
"fieldname": "supplier_address",
@@ -445,7 +454,6 @@
"print_hide": 1
},
{
- "description": "Sets 'Warehouse' in each row of the Items table.",
"fieldname": "set_warehouse",
"fieldtype": "Link",
"label": "Set Target Warehouse",
@@ -483,7 +491,6 @@
"allow_bulk_edit": 1,
"fieldname": "items",
"fieldtype": "Table",
- "label": "Items",
"oldfieldname": "po_details",
"oldfieldtype": "Table",
"options": "Purchase Order Item",
@@ -570,6 +577,7 @@
"read_only": 1
},
{
+ "depends_on": "total_net_weight",
"fieldname": "total_net_weight",
"fieldtype": "Float",
"label": "Total Net Weight",
@@ -579,6 +587,8 @@
{
"fieldname": "taxes_section",
"fieldtype": "Section Break",
+ "hide_border": 1,
+ "label": "Taxes and Charges",
"oldfieldtype": "Section Break",
"options": "fa fa-money"
},
@@ -633,7 +643,6 @@
{
"fieldname": "totals",
"fieldtype": "Section Break",
- "label": "Taxes and Charges",
"oldfieldtype": "Section Break",
"options": "fa fa-money"
},
@@ -698,7 +707,6 @@
"read_only": 1
},
{
- "depends_on": "total_taxes_and_charges",
"fieldname": "total_taxes_and_charges",
"fieldtype": "Currency",
"label": "Total Taxes and Charges",
@@ -708,7 +716,6 @@
},
{
"collapsible": 1,
- "collapsible_depends_on": "apply_discount_on",
"fieldname": "discount_section",
"fieldtype": "Section Break",
"label": "Additional Discount"
@@ -773,7 +780,6 @@
"read_only": 1
},
{
- "description": "In Words will be visible once you save the Purchase Order.",
"fieldname": "base_in_words",
"fieldtype": "Data",
"label": "In Words (Company Currency)",
@@ -851,7 +857,6 @@
"read_only": 1
},
{
- "collapsible": 1,
"fieldname": "payment_schedule_section",
"fieldtype": "Section Break",
"label": "Payment Terms"
@@ -871,11 +876,10 @@
"print_hide": 1
},
{
- "collapsible": 1,
"collapsible_depends_on": "terms",
"fieldname": "terms_section_break",
"fieldtype": "Section Break",
- "label": "Terms and Conditions",
+ "label": "Terms & Conditions",
"oldfieldtype": "Section Break",
"options": "fa fa-legal"
},
@@ -896,13 +900,6 @@
"oldfieldtype": "Text Editor"
},
{
- "collapsible": 1,
- "fieldname": "more_info",
- "fieldtype": "Section Break",
- "label": "More Information",
- "oldfieldtype": "Section Break"
- },
- {
"default": "Draft",
"fieldname": "status",
"fieldtype": "Select",
@@ -1023,7 +1020,7 @@
"collapsible": 1,
"fieldname": "subscription_section",
"fieldtype": "Section Break",
- "label": "Subscription Section"
+ "label": "Auto Repeat"
},
{
"allow_on_submit": 1,
@@ -1098,7 +1095,9 @@
},
{
"fieldname": "before_items_section",
- "fieldtype": "Section Break"
+ "fieldtype": "Section Break",
+ "hide_border": 1,
+ "label": "Items"
},
{
"fieldname": "items_col_break",
@@ -1134,10 +1133,6 @@
"options": "Tax Withholding Category"
},
{
- "fieldname": "section_break_45",
- "fieldtype": "Section Break"
- },
- {
"collapsible": 1,
"fieldname": "accounting_dimensions_section",
"fieldtype": "Section Break",
@@ -1173,13 +1168,71 @@
"fieldtype": "Link",
"label": "Set From Warehouse",
"options": "Warehouse"
+ },
+ {
+ "fieldname": "terms_tab",
+ "fieldtype": "Tab Break",
+ "label": "Terms"
+ },
+ {
+ "fieldname": "more_info_tab",
+ "fieldtype": "Tab Break",
+ "label": "More Info"
+ },
+ {
+ "fieldname": "dashboard",
+ "fieldtype": "Tab Break",
+ "label": "Dashboard",
+ "show_dashboard": 1
+ },
+ {
+ "fieldname": "column_break_7",
+ "fieldtype": "Column Break"
+ },
+ {
+ "fieldname": "column_break_40",
+ "fieldtype": "Column Break"
+ },
+ {
+ "fieldname": "column_break_53",
+ "fieldtype": "Column Break"
+ },
+ {
+ "fieldname": "address_and_contact_tab",
+ "fieldtype": "Tab Break",
+ "label": "Address & Contact"
+ },
+ {
+ "fieldname": "company_shipping_address_section",
+ "fieldtype": "Section Break",
+ "label": "Company Shipping Address"
+ },
+ {
+ "fieldname": "company_billing_address_section",
+ "fieldtype": "Section Break",
+ "label": "Company Billing Address"
+ },
+ {
+ "collapsible": 1,
+ "fieldname": "additional_info_section",
+ "fieldtype": "Section Break",
+ "label": "Additional Info",
+ "oldfieldtype": "Section Break"
+ },
+ {
+ "fieldname": "column_break_99",
+ "fieldtype": "Column Break"
+ },
+ {
+ "fieldname": "column_break_103",
+ "fieldtype": "Column Break"
}
],
"icon": "fa fa-file-text",
"idx": 105,
"is_submittable": 1,
"links": [],
- "modified": "2022-09-16 17:45:04.954055",
+ "modified": "2022-10-11 13:01:41.674352",
"modified_by": "Administrator",
"module": "Buying",
"name": "Purchase Order",
diff --git a/erpnext/buying/doctype/supplier_quotation/supplier_quotation.json b/erpnext/buying/doctype/supplier_quotation/supplier_quotation.json
index 8d1939a..1636561 100644
--- a/erpnext/buying/doctype/supplier_quotation/supplier_quotation.json
+++ b/erpnext/buying/doctype/supplier_quotation/supplier_quotation.json
@@ -13,19 +13,13 @@
"naming_series",
"supplier",
"supplier_name",
- "column_break1",
"company",
+ "column_break1",
+ "status",
"transaction_date",
"valid_till",
"quotation_number",
"amended_from",
- "address_section",
- "supplier_address",
- "contact_person",
- "address_display",
- "contact_display",
- "contact_mobile",
- "contact_email",
"currency_and_price_list",
"currency",
"conversion_rate",
@@ -36,25 +30,23 @@
"ignore_pricing_rule",
"items_section",
"items",
- "pricing_rule_details",
- "pricing_rules",
"section_break_22",
"total_qty",
+ "total_net_weight",
+ "column_break_26",
"base_total",
"base_net_total",
"column_break_24",
"total",
"net_total",
- "total_net_weight",
"taxes_section",
+ "taxes_and_charges",
+ "column_break_34",
"tax_category",
"column_break_36",
"shipping_rule",
"section_break_38",
- "taxes_and_charges",
"taxes",
- "tax_breakup",
- "other_charges_calculation",
"totals",
"base_taxes_and_charges_added",
"base_taxes_and_charges_deducted",
@@ -80,24 +72,36 @@
"rounded_total",
"in_words",
"disable_rounded_total",
- "terms_section_break",
+ "tax_breakup",
+ "other_charges_calculation",
+ "pricing_rule_details",
+ "pricing_rules",
+ "address_and_contact_tab",
+ "supplier_address",
+ "address_display",
+ "column_break_72",
+ "contact_person",
+ "contact_display",
+ "contact_mobile",
+ "contact_email",
+ "terms_tab",
"tc_name",
"terms",
+ "more_info_tab",
"printing_settings",
- "select_print_heading",
- "group_same_items",
- "column_break_72",
"letter_head",
+ "group_same_items",
+ "column_break_85",
+ "select_print_heading",
"language",
"subscription_section",
"auto_repeat",
"update_auto_repeat_reference",
"more_info",
- "status",
- "column_break_57",
"is_subcontracted",
- "reference",
- "opportunity"
+ "column_break_57",
+ "opportunity",
+ "connections_tab"
],
"fields": [
{
@@ -146,7 +150,7 @@
"fieldname": "supplier_name",
"fieldtype": "Data",
"in_global_search": 1,
- "label": "Name",
+ "label": "Supplier Name",
"read_only": 1
},
{
@@ -194,12 +198,6 @@
"search_index": 1
},
{
- "collapsible": 1,
- "fieldname": "address_section",
- "fieldtype": "Section Break",
- "label": "Address and Contact"
- },
- {
"fieldname": "supplier_address",
"fieldtype": "Link",
"label": "Supplier Address",
@@ -309,6 +307,8 @@
{
"fieldname": "items_section",
"fieldtype": "Section Break",
+ "hide_border": 1,
+ "label": "Items",
"oldfieldtype": "Section Break",
"options": "fa fa-shopping-cart"
},
@@ -316,7 +316,6 @@
"allow_bulk_edit": 1,
"fieldname": "items",
"fieldtype": "Table",
- "label": "Items",
"oldfieldname": "po_details",
"oldfieldtype": "Table",
"options": "Supplier Quotation Item",
@@ -394,6 +393,7 @@
{
"fieldname": "taxes_section",
"fieldtype": "Section Break",
+ "hide_border": 1,
"label": "Taxes and Charges",
"oldfieldtype": "Section Break",
"options": "fa fa-money"
@@ -417,7 +417,8 @@
},
{
"fieldname": "section_break_38",
- "fieldtype": "Section Break"
+ "fieldtype": "Section Break",
+ "hide_border": 1
},
{
"fieldname": "taxes_and_charges",
@@ -523,7 +524,6 @@
},
{
"collapsible": 1,
- "collapsible_depends_on": "discount_amount",
"fieldname": "section_break_41",
"fieldtype": "Section Break",
"label": "Additional Discount"
@@ -563,7 +563,8 @@
},
{
"fieldname": "section_break_46",
- "fieldtype": "Section Break"
+ "fieldtype": "Section Break",
+ "label": "Totals"
},
{
"fieldname": "base_grand_total",
@@ -655,18 +656,9 @@
"label": "Disable Rounded Total"
},
{
- "collapsible": 1,
- "collapsible_depends_on": "terms",
- "fieldname": "terms_section_break",
- "fieldtype": "Section Break",
- "label": "Terms and Conditions",
- "oldfieldtype": "Section Break",
- "options": "fa fa-legal"
- },
- {
"fieldname": "tc_name",
"fieldtype": "Link",
- "label": "Terms",
+ "label": "Terms Template",
"oldfieldname": "tc_name",
"oldfieldtype": "Link",
"options": "Terms and Conditions",
@@ -729,7 +721,7 @@
{
"fieldname": "subscription_section",
"fieldtype": "Section Break",
- "label": "Auto Repeat Section"
+ "label": "Auto Repeat"
},
{
"fieldname": "auto_repeat",
@@ -751,7 +743,7 @@
"collapsible": 1,
"fieldname": "more_info",
"fieldtype": "Section Break",
- "label": "More Information",
+ "label": "Additional Info",
"oldfieldtype": "Section Break",
"options": "fa fa-file-text"
},
@@ -780,11 +772,6 @@
"print_hide": 1
},
{
- "fieldname": "reference",
- "fieldtype": "Section Break",
- "label": "Reference"
- },
- {
"fieldname": "opportunity",
"fieldtype": "Link",
"label": "Opportunity",
@@ -803,6 +790,39 @@
"fieldname": "quotation_number",
"fieldtype": "Data",
"label": "Quotation Number"
+ },
+ {
+ "fieldname": "address_and_contact_tab",
+ "fieldtype": "Tab Break",
+ "label": "Address & Contact"
+ },
+ {
+ "fieldname": "terms_tab",
+ "fieldtype": "Tab Break",
+ "label": "Terms"
+ },
+ {
+ "fieldname": "more_info_tab",
+ "fieldtype": "Tab Break",
+ "label": "More Info"
+ },
+ {
+ "fieldname": "connections_tab",
+ "fieldtype": "Tab Break",
+ "label": "Connections",
+ "show_dashboard": 1
+ },
+ {
+ "fieldname": "column_break_26",
+ "fieldtype": "Column Break"
+ },
+ {
+ "fieldname": "column_break_34",
+ "fieldtype": "Column Break"
+ },
+ {
+ "fieldname": "column_break_85",
+ "fieldtype": "Column Break"
}
],
"icon": "fa fa-shopping-cart",
@@ -810,7 +830,7 @@
"index_web_pages_for_search": 1,
"is_submittable": 1,
"links": [],
- "modified": "2022-03-14 16:13:20.284572",
+ "modified": "2022-09-27 18:20:09.462037",
"modified_by": "Administrator",
"module": "Buying",
"name": "Supplier Quotation",
diff --git a/erpnext/regional/united_arab_emirates/setup.py b/erpnext/regional/united_arab_emirates/setup.py
index be621bc..36a0795 100644
--- a/erpnext/regional/united_arab_emirates/setup.py
+++ b/erpnext/regional/united_arab_emirates/setup.py
@@ -37,7 +37,7 @@
fieldname="vat_section",
label="VAT Details",
fieldtype="Section Break",
- insert_after="group_same_items",
+ insert_after="language",
print_hide=1,
collapsible=1,
),
diff --git a/erpnext/selling/doctype/quotation/quotation.json b/erpnext/selling/doctype/quotation/quotation.json
index c58a46b..fa64b16 100644
--- a/erpnext/selling/doctype/quotation/quotation.json
+++ b/erpnext/selling/doctype/quotation/quotation.json
@@ -15,26 +15,13 @@
"quotation_to",
"party_name",
"customer_name",
- "column_break1",
- "amended_from",
- "company",
+ "column_break_7",
"transaction_date",
"valid_till",
+ "column_break1",
"order_type",
- "contact_section",
- "customer_address",
- "address_display",
- "contact_person",
- "contact_display",
- "contact_mobile",
- "contact_email",
- "col_break98",
- "shipping_address_name",
- "shipping_address",
- "company_address",
- "company_address_display",
- "customer_group",
- "territory",
+ "company",
+ "amended_from",
"currency_and_price_list",
"currency",
"conversion_rate",
@@ -43,79 +30,105 @@
"price_list_currency",
"plc_conversion_rate",
"ignore_pricing_rule",
- "section_break_33",
- "scan_barcode",
"items_section",
+ "scan_barcode",
"items",
- "bundle_items_section",
- "packed_items",
- "pricing_rule_details",
- "pricing_rules",
"sec_break23",
"total_qty",
+ "total_net_weight",
+ "column_break_28",
"base_total",
"base_net_total",
- "column_break_28",
+ "column_break_31",
"total",
"net_total",
- "total_net_weight",
"taxes_section",
+ "taxes_and_charges",
+ "column_break_36",
"tax_category",
"column_break_34",
"shipping_rule",
"section_break_36",
- "taxes_and_charges",
"taxes",
- "sec_tax_breakup",
- "other_charges_calculation",
"section_break_39",
"base_total_taxes_and_charges",
"column_break_42",
"total_taxes_and_charges",
- "section_break_44",
- "coupon_code",
- "referral_sales_partner",
- "apply_discount_on",
- "base_discount_amount",
- "column_break_46",
- "additional_discount_percentage",
- "discount_amount",
"totals",
"base_grand_total",
"base_rounding_adjustment",
- "base_in_words",
"base_rounded_total",
+ "base_in_words",
"column_break3",
"grand_total",
"rounding_adjustment",
"rounded_total",
"in_words",
+ "section_break_44",
+ "apply_discount_on",
+ "base_discount_amount",
+ "coupon_code",
+ "column_break_46",
+ "additional_discount_percentage",
+ "discount_amount",
+ "referral_sales_partner",
+ "sec_tax_breakup",
+ "other_charges_calculation",
+ "bundle_items_section",
+ "packed_items",
+ "pricing_rule_details",
+ "pricing_rules",
+ "address_and_contact_tab",
+ "billing_address_section",
+ "customer_address",
+ "address_display",
+ "col_break98",
+ "contact_person",
+ "contact_display",
+ "contact_mobile",
+ "contact_email",
+ "shipping_address_section",
+ "shipping_address_name",
+ "column_break_81",
+ "shipping_address",
+ "company_address_section",
+ "company_address",
+ "column_break_87",
+ "company_address_display",
+ "terms_tab",
"payment_schedule_section",
"payment_terms_template",
"payment_schedule",
"terms_section_break",
"tc_name",
"terms",
+ "more_info_tab",
+ "subscription_section",
+ "auto_repeat",
+ "update_auto_repeat_reference",
"print_settings",
"letter_head",
"group_same_items",
"column_break_73",
"select_print_heading",
"language",
- "subscription_section",
- "auto_repeat",
- "update_auto_repeat_reference",
- "more_info",
+ "lost_reasons_section",
+ "lost_reasons",
+ "competitors",
+ "column_break_117",
+ "order_lost_reason",
+ "additional_info_section",
+ "status",
+ "customer_group",
+ "territory",
+ "column_break_108",
"campaign",
"source",
- "order_lost_reason",
"column_break4",
- "status",
- "enq_det",
- "supplier_quotation",
"opportunity",
- "lost_reasons",
- "competitors"
+ "supplier_quotation",
+ "enq_det",
+ "connections_tab"
],
"fields": [
{
@@ -242,14 +255,6 @@
"reqd": 1
},
{
- "collapsible": 1,
- "depends_on": "party_name",
- "fieldname": "contact_section",
- "fieldtype": "Section Break",
- "label": "Address and Contact",
- "options": "fa fa-bullhorn"
- },
- {
"fieldname": "customer_address",
"fieldtype": "Link",
"label": "Customer Address",
@@ -296,7 +301,7 @@
"read_only": 1
},
{
- "depends_on": "eval:doc.quotation_to=='Customer' && doc.party_name",
+ "depends_on": "eval:(doc.quotation_to=='Customer' && doc.party_name)",
"fieldname": "col_break98",
"fieldtype": "Column Break",
"width": "50%"
@@ -316,7 +321,7 @@
"read_only": 1
},
{
- "depends_on": "eval:doc.quotation_to=='Customer' && doc.party_name",
+ "depends_on": "eval:(doc.quotation_to=='Customer' && doc.party_name)",
"fieldname": "customer_group",
"fieldtype": "Link",
"hidden": 1,
@@ -408,6 +413,8 @@
{
"fieldname": "items_section",
"fieldtype": "Section Break",
+ "hide_border": 1,
+ "label": "Items",
"oldfieldtype": "Section Break",
"options": "fa fa-shopping-cart"
},
@@ -415,7 +422,6 @@
"allow_bulk_edit": 1,
"fieldname": "items",
"fieldtype": "Table",
- "label": "Items",
"oldfieldname": "quotation_details",
"oldfieldtype": "Table",
"options": "Quotation Item",
@@ -423,6 +429,7 @@
"width": "40px"
},
{
+ "collapsible": 1,
"fieldname": "pricing_rule_details",
"fieldtype": "Section Break",
"label": "Pricing Rules"
@@ -483,6 +490,7 @@
"read_only": 1
},
{
+ "depends_on": "total_net_weight",
"fieldname": "total_net_weight",
"fieldtype": "Float",
"label": "Total Net Weight",
@@ -492,6 +500,7 @@
{
"fieldname": "taxes_section",
"fieldtype": "Section Break",
+ "hide_border": 1,
"label": "Taxes and Charges",
"oldfieldtype": "Section Break",
"options": "fa fa-money"
@@ -517,7 +526,8 @@
},
{
"fieldname": "section_break_36",
- "fieldtype": "Section Break"
+ "fieldtype": "Section Break",
+ "hide_border": 1
},
{
"fieldname": "taxes_and_charges",
@@ -579,10 +589,9 @@
},
{
"collapsible": 1,
- "collapsible_depends_on": "discount_amount",
"fieldname": "section_break_44",
"fieldtype": "Section Break",
- "label": "Additional Discount and Coupon Code"
+ "label": "Additional Discount"
},
{
"fieldname": "coupon_code",
@@ -632,6 +641,7 @@
{
"fieldname": "totals",
"fieldtype": "Section Break",
+ "label": "Totals",
"oldfieldtype": "Section Break",
"options": "fa fa-money",
"print_hide": 1
@@ -657,7 +667,6 @@
"read_only": 1
},
{
- "description": "In Words will be visible once you save the Quotation.",
"fieldname": "base_in_words",
"fieldtype": "Data",
"label": "In Words (Company Currency)",
@@ -665,8 +674,7 @@
"oldfieldname": "in_words",
"oldfieldtype": "Data",
"print_hide": 1,
- "read_only": 1,
- "width": "200px"
+ "read_only": 1
},
{
"fieldname": "base_rounded_total",
@@ -749,7 +757,6 @@
"print_hide": 1
},
{
- "collapsible": 1,
"collapsible_depends_on": "terms",
"fieldname": "terms_section_break",
"fieldtype": "Section Break",
@@ -824,7 +831,7 @@
{
"fieldname": "subscription_section",
"fieldtype": "Section Break",
- "label": "Auto Repeat Section"
+ "label": "Auto Repeat"
},
{
"fieldname": "auto_repeat",
@@ -837,21 +844,12 @@
},
{
"allow_on_submit": 1,
- "depends_on": "eval: doc.auto_repeat",
+ "depends_on": "eval:doc.auto_repeat",
"fieldname": "update_auto_repeat_reference",
"fieldtype": "Button",
"label": "Update Auto Repeat Reference"
},
{
- "collapsible": 1,
- "fieldname": "more_info",
- "fieldtype": "Section Break",
- "label": "More Information",
- "oldfieldtype": "Section Break",
- "options": "fa fa-file-text",
- "print_hide": 1
- },
- {
"fieldname": "campaign",
"fieldtype": "Link",
"label": "Campaign",
@@ -871,7 +869,7 @@
},
{
"allow_on_submit": 1,
- "depends_on": "eval:doc.status===\"Lost\"",
+ "depends_on": "eval:doc.status=='Lost'",
"fieldname": "order_lost_reason",
"fieldtype": "Small Text",
"label": "Detailed Reason",
@@ -934,7 +932,6 @@
"read_only": 1
},
{
- "depends_on": "packed_items",
"fieldname": "packed_items",
"fieldtype": "Table",
"label": "Bundle Items",
@@ -943,7 +940,6 @@
},
{
"collapsible": 1,
- "collapsible_depends_on": "packed_items",
"depends_on": "packed_items",
"fieldname": "bundle_items_section",
"fieldtype": "Section Break",
@@ -971,21 +967,98 @@
"read_only": 1
},
{
- "fieldname": "section_break_33",
- "fieldtype": "Section Break"
- },
- {
"fieldname": "scan_barcode",
"fieldtype": "Data",
"label": "Scan Barcode",
"options": "Barcode"
+ },
+ {
+ "fieldname": "address_and_contact_tab",
+ "fieldtype": "Tab Break",
+ "label": "Address & Contact"
+ },
+ {
+ "fieldname": "terms_tab",
+ "fieldtype": "Tab Break",
+ "label": "Terms"
+ },
+ {
+ "fieldname": "more_info_tab",
+ "fieldtype": "Tab Break",
+ "label": "More Info"
+ },
+ {
+ "fieldname": "connections_tab",
+ "fieldtype": "Tab Break",
+ "label": "Connections",
+ "show_dashboard": 1
+ },
+ {
+ "fieldname": "column_break_7",
+ "fieldtype": "Column Break"
+ },
+ {
+ "fieldname": "column_break_31",
+ "fieldtype": "Column Break"
+ },
+ {
+ "fieldname": "column_break_36",
+ "fieldtype": "Column Break"
+ },
+ {
+ "fieldname": "billing_address_section",
+ "fieldtype": "Section Break",
+ "label": "Billing Address",
+ "options": "fa fa-bullhorn"
+ },
+ {
+ "fieldname": "shipping_address_section",
+ "fieldtype": "Section Break",
+ "label": "Shipping Address"
+ },
+ {
+ "fieldname": "column_break_81",
+ "fieldtype": "Column Break"
+ },
+ {
+ "fieldname": "company_address_section",
+ "fieldtype": "Section Break",
+ "label": "Company Address"
+ },
+ {
+ "fieldname": "column_break_87",
+ "fieldtype": "Column Break"
+ },
+ {
+ "collapsible": 1,
+ "depends_on": "eval:(doc.lost_reasons || doc.order_lost_reason)",
+ "fieldname": "lost_reasons_section",
+ "fieldtype": "Section Break",
+ "label": "Lost Reasons"
+ },
+ {
+ "fieldname": "column_break_117",
+ "fieldtype": "Column Break"
+ },
+ {
+ "collapsible": 1,
+ "fieldname": "additional_info_section",
+ "fieldtype": "Section Break",
+ "label": "Additional Info",
+ "oldfieldtype": "Section Break",
+ "options": "fa fa-file-text",
+ "print_hide": 1
+ },
+ {
+ "fieldname": "column_break_108",
+ "fieldtype": "Column Break"
}
],
"icon": "fa fa-shopping-cart",
"idx": 82,
"is_submittable": 1,
"links": [],
- "modified": "2022-09-16 17:44:43.221804",
+ "modified": "2022-10-11 13:06:33.479650",
"modified_by": "Administrator",
"module": "Selling",
"name": "Quotation",
@@ -1083,4 +1156,4 @@
"states": [],
"timeline_field": "party_name",
"title_field": "title"
-}
+}
\ No newline at end of file
diff --git a/erpnext/selling/doctype/sales_order/sales_order.json b/erpnext/selling/doctype/sales_order/sales_order.json
index ff269d0..e6ff39d 100644
--- a/erpnext/selling/doctype/sales_order/sales_order.json
+++ b/erpnext/selling/doctype/sales_order/sales_order.json
@@ -15,37 +15,25 @@
"naming_series",
"customer",
"customer_name",
+ "tax_id",
"order_type",
- "skip_delivery_note",
- "column_break1",
- "amended_from",
- "company",
+ "column_break_7",
"transaction_date",
"delivery_date",
+ "column_break1",
"po_no",
"po_date",
- "tax_id",
+ "company",
+ "skip_delivery_note",
+ "amended_from",
"accounting_dimensions_section",
"cost_center",
"dimension_col_break",
"project",
- "contact_info",
- "customer_address",
- "address_display",
- "contact_person",
- "contact_display",
- "contact_phone",
- "contact_mobile",
- "contact_email",
- "company_address",
- "company_address_display",
- "col_break46",
- "shipping_address_name",
- "shipping_address",
- "dispatch_address_name",
- "dispatch_address",
- "customer_group",
- "territory",
+ "column_break_77",
+ "source",
+ "campaign",
+ "custom_dimensions_section",
"currency_and_price_list",
"currency",
"conversion_rate",
@@ -55,46 +43,32 @@
"plc_conversion_rate",
"ignore_pricing_rule",
"sec_warehouse",
+ "scan_barcode",
+ "column_break_28",
"set_warehouse",
"items_section",
- "scan_barcode",
"items",
- "packing_list",
- "packed_items",
- "pricing_rule_details",
- "pricing_rules",
"section_break_31",
- "column_break_33a",
"total_qty",
+ "total_net_weight",
+ "column_break_33",
"base_total",
"base_net_total",
- "column_break_33",
- "total_net_weight",
+ "column_break_33a",
"total",
"net_total",
"taxes_section",
- "tax_category",
+ "taxes_and_charges",
"column_break_38",
+ "tax_category",
+ "column_break_49",
"shipping_rule",
"section_break_40",
- "taxes_and_charges",
"taxes",
- "sec_tax_breakup",
- "other_charges_calculation",
"section_break_43",
"base_total_taxes_and_charges",
"column_break_46",
"total_taxes_and_charges",
- "loyalty_points_redemption",
- "loyalty_points",
- "loyalty_amount",
- "section_break_48",
- "coupon_code",
- "apply_discount_on",
- "base_discount_amount",
- "column_break_50",
- "additional_discount_percentage",
- "discount_amount",
"totals",
"base_grand_total",
"base_rounding_adjustment",
@@ -107,26 +81,49 @@
"in_words",
"advance_paid",
"disable_rounded_total",
+ "section_break_48",
+ "apply_discount_on",
+ "base_discount_amount",
+ "coupon_code",
+ "column_break_50",
+ "additional_discount_percentage",
+ "discount_amount",
+ "sec_tax_breakup",
+ "other_charges_calculation",
+ "packing_list",
+ "packed_items",
+ "pricing_rule_details",
+ "pricing_rules",
+ "contact_info",
+ "billing_address_column",
+ "customer_address",
+ "address_display",
+ "customer_group",
+ "territory",
+ "column_break_84",
+ "contact_person",
+ "contact_display",
+ "contact_phone",
+ "contact_mobile",
+ "contact_email",
+ "shipping_address_column",
+ "shipping_address_name",
+ "shipping_address",
+ "column_break_93",
+ "dispatch_address_name",
+ "dispatch_address",
+ "col_break46",
+ "company_address",
+ "column_break_92",
+ "company_address_display",
"payment_schedule_section",
+ "payment_terms_section",
"payment_terms_template",
"payment_schedule",
"terms_section_break",
"tc_name",
"terms",
"more_info",
- "is_internal_customer",
- "represents_company",
- "inter_company_order_reference",
- "party_account_currency",
- "column_break_77",
- "source",
- "campaign",
- "printing_details",
- "language",
- "letter_head",
- "column_break4",
- "select_print_heading",
- "group_same_items",
"section_break_78",
"status",
"delivery_status",
@@ -143,12 +140,29 @@
"total_commission",
"section_break1",
"sales_team",
+ "loyalty_points_redemption",
+ "loyalty_points",
+ "column_break_116",
+ "loyalty_amount",
"subscription_section",
"from_date",
"to_date",
"column_break_108",
"auto_repeat",
- "update_auto_repeat_reference"
+ "update_auto_repeat_reference",
+ "printing_details",
+ "letter_head",
+ "group_same_items",
+ "column_break4",
+ "select_print_heading",
+ "language",
+ "additional_info_section",
+ "is_internal_customer",
+ "represents_company",
+ "column_break_152",
+ "inter_company_order_reference",
+ "party_account_currency",
+ "connections_tab"
],
"fields": [
{
@@ -334,10 +348,10 @@
"collapsible": 1,
"depends_on": "customer",
"fieldname": "contact_info",
- "fieldtype": "Section Break",
+ "fieldtype": "Tab Break",
"hide_days": 1,
"hide_seconds": 1,
- "label": "Address and Contact",
+ "label": "Address & Contact",
"options": "fa fa-bullhorn"
},
{
@@ -414,9 +428,10 @@
},
{
"fieldname": "col_break46",
- "fieldtype": "Column Break",
+ "fieldtype": "Section Break",
"hide_days": 1,
"hide_seconds": 1,
+ "label": "Company Address",
"width": "50%"
},
{
@@ -550,8 +565,10 @@
{
"fieldname": "sec_warehouse",
"fieldtype": "Section Break",
+ "hide_border": 1,
"hide_days": 1,
- "hide_seconds": 1
+ "hide_seconds": 1,
+ "label": "Items"
},
{
"fieldname": "set_warehouse",
@@ -565,6 +582,7 @@
{
"fieldname": "items_section",
"fieldtype": "Section Break",
+ "hide_border": 1,
"hide_days": 1,
"hide_seconds": 1,
"oldfieldtype": "Section Break",
@@ -675,6 +693,7 @@
"read_only": 1
},
{
+ "depends_on": "total_net_weight",
"fieldname": "total_net_weight",
"fieldtype": "Float",
"hide_days": 1,
@@ -688,7 +707,7 @@
"fieldtype": "Section Break",
"hide_days": 1,
"hide_seconds": 1,
- "label": "Taxes and Charges",
+ "label": "Taxes",
"oldfieldtype": "Section Break",
"options": "fa fa-money"
},
@@ -720,6 +739,7 @@
{
"fieldname": "section_break_40",
"fieldtype": "Section Break",
+ "hide_border": 1,
"hide_days": 1,
"hide_seconds": 1
},
@@ -804,7 +824,7 @@
"hidden": 1,
"hide_days": 1,
"hide_seconds": 1,
- "label": "Loyalty Points Redemption",
+ "label": "Loyalty Points",
"print_hide": 1
},
{
@@ -828,12 +848,11 @@
},
{
"collapsible": 1,
- "collapsible_depends_on": "discount_amount",
"fieldname": "section_break_48",
"fieldtype": "Section Break",
"hide_days": 1,
"hide_seconds": 1,
- "label": "Additional Discount and Coupon Code"
+ "label": "Additional Discount"
},
{
"fieldname": "coupon_code",
@@ -891,6 +910,7 @@
"fieldtype": "Section Break",
"hide_days": 1,
"hide_seconds": 1,
+ "label": "Totals",
"oldfieldtype": "Section Break",
"options": "fa fa-money",
"print_hide": 1
@@ -1045,10 +1065,10 @@
},
{
"fieldname": "payment_schedule_section",
- "fieldtype": "Section Break",
+ "fieldtype": "Tab Break",
"hide_days": 1,
"hide_seconds": 1,
- "label": "Payment Terms"
+ "label": "Terms"
},
{
"fieldname": "payment_terms_template",
@@ -1070,13 +1090,12 @@
"print_hide": 1
},
{
- "collapsible": 1,
"collapsible_depends_on": "terms",
"fieldname": "terms_section_break",
"fieldtype": "Section Break",
"hide_days": 1,
"hide_seconds": 1,
- "label": "Terms and Conditions",
+ "label": "Terms & Conditions",
"oldfieldtype": "Section Break",
"options": "fa fa-legal"
},
@@ -1104,10 +1123,10 @@
"collapsible": 1,
"collapsible_depends_on": "project",
"fieldname": "more_info",
- "fieldtype": "Section Break",
+ "fieldtype": "Tab Break",
"hide_days": 1,
"hide_seconds": 1,
- "label": "More Information",
+ "label": "More Info",
"oldfieldtype": "Section Break",
"options": "fa fa-file-text",
"print_hide": 1
@@ -1122,7 +1141,6 @@
"read_only": 1
},
{
- "description": "Track this Sales Order against any Project",
"fieldname": "project",
"fieldtype": "Link",
"hide_days": 1,
@@ -1240,7 +1258,7 @@
"fieldtype": "Section Break",
"hide_days": 1,
"hide_seconds": 1,
- "label": "Billing and Delivery Status",
+ "label": "Status",
"oldfieldtype": "Column Break",
"print_hide": 1,
"width": "50%"
@@ -1410,7 +1428,7 @@
"fieldtype": "Section Break",
"hide_days": 1,
"hide_seconds": 1,
- "label": "Auto Repeat Section",
+ "label": "Auto Repeat",
"no_copy": 1,
"print_hide": 1,
"read_only": 1
@@ -1542,13 +1560,76 @@
{
"fieldname": "dimension_col_break",
"fieldtype": "Column Break"
+ },
+ {
+ "fieldname": "column_break_7",
+ "fieldtype": "Column Break"
+ },
+ {
+ "fieldname": "column_break_28",
+ "fieldtype": "Column Break"
+ },
+ {
+ "fieldname": "column_break_49",
+ "fieldtype": "Column Break"
+ },
+ {
+ "fieldname": "connections_tab",
+ "fieldtype": "Tab Break",
+ "label": "Connections",
+ "show_dashboard": 1
+ },
+ {
+ "fieldname": "payment_terms_section",
+ "fieldtype": "Section Break",
+ "label": "Payment Terms"
+ },
+ {
+ "fieldname": "column_break_116",
+ "fieldtype": "Column Break"
+ },
+ {
+ "fieldname": "billing_address_column",
+ "fieldtype": "Section Break",
+ "label": "Billing Address"
+ },
+ {
+ "fieldname": "shipping_address_column",
+ "fieldtype": "Section Break",
+ "label": "Shipping Address"
+ },
+ {
+ "fieldname": "column_break_93",
+ "fieldtype": "Column Break"
+ },
+ {
+ "fieldname": "column_break_84",
+ "fieldtype": "Column Break"
+ },
+ {
+ "fieldname": "column_break_92",
+ "fieldtype": "Column Break"
+ },
+ {
+ "fieldname": "custom_dimensions_section",
+ "fieldtype": "Section Break"
+ },
+ {
+ "collapsible": 1,
+ "fieldname": "additional_info_section",
+ "fieldtype": "Section Break",
+ "label": "Additional Info"
+ },
+ {
+ "fieldname": "column_break_152",
+ "fieldtype": "Column Break"
}
],
"icon": "fa fa-file-text",
"idx": 105,
"is_submittable": 1,
"links": [],
- "modified": "2022-09-16 17:43:57.007441",
+ "modified": "2022-10-11 13:06:10.469796",
"modified_by": "Administrator",
"module": "Selling",
"name": "Sales Order",
diff --git a/erpnext/stock/doctype/delivery_note/delivery_note.json b/erpnext/stock/doctype/delivery_note/delivery_note.json
index a8f907e..0ca3e69 100644
--- a/erpnext/stock/doctype/delivery_note/delivery_note.json
+++ b/erpnext/stock/doctype/delivery_note/delivery_note.json
@@ -8,46 +8,29 @@
"document_type": "Document",
"engine": "InnoDB",
"field_order": [
- "delivery_to_section",
- "column_break0",
"title",
"naming_series",
"customer",
+ "tax_id",
"customer_name",
"column_break1",
- "amended_from",
- "company",
"posting_date",
"posting_time",
"set_posting_time",
+ "column_break_10",
+ "company",
+ "amended_from",
"is_return",
"issue_credit_note",
"return_against",
"accounting_dimensions_section",
"cost_center",
- "dimension_col_break",
+ "column_break_18",
"project",
- "customer_po_details",
- "po_no",
- "column_break_17",
- "po_date",
- "section_break_18",
- "pick_list",
- "contact_info",
- "shipping_address_name",
- "shipping_address",
- "dispatch_address_name",
- "dispatch_address",
- "contact_person",
- "contact_display",
- "contact_mobile",
- "contact_email",
- "col_break21",
- "customer_address",
- "tax_id",
- "address_display",
- "company_address",
- "company_address_display",
+ "dimension_col_break",
+ "campaign",
+ "source",
+ "custom_dimensions_section",
"currency_and_price_list",
"currency",
"conversion_rate",
@@ -56,45 +39,35 @@
"price_list_currency",
"plc_conversion_rate",
"ignore_pricing_rule",
- "sec_warehouse",
- "set_warehouse",
- "col_break_warehouse",
- "set_target_warehouse",
"items_section",
"scan_barcode",
+ "pick_list",
+ "col_break_warehouse",
+ "set_warehouse",
+ "set_target_warehouse",
+ "section_break_30",
"items",
- "pricing_rule_details",
- "pricing_rules",
- "packing_list",
- "packed_items",
- "product_bundle_help",
"section_break_31",
"total_qty",
+ "total_net_weight",
+ "column_break_35",
"base_total",
"base_net_total",
"column_break_33",
- "total_net_weight",
"total",
"net_total",
"taxes_section",
+ "taxes_and_charges",
+ "column_break_43",
"tax_category",
"column_break_39",
"shipping_rule",
"section_break_41",
- "taxes_and_charges",
"taxes",
- "sec_tax_breakup",
- "other_charges_calculation",
"section_break_44",
"base_total_taxes_and_charges",
"column_break_47",
"total_taxes_and_charges",
- "section_break_49",
- "apply_discount_on",
- "base_discount_amount",
- "column_break_51",
- "additional_discount_percentage",
- "discount_amount",
"totals",
"base_grand_total",
"base_rounding_adjustment",
@@ -106,9 +79,50 @@
"rounded_total",
"in_words",
"disable_rounded_total",
- "terms_section_break",
+ "section_break_49",
+ "apply_discount_on",
+ "base_discount_amount",
+ "column_break_51",
+ "additional_discount_percentage",
+ "discount_amount",
+ "sec_tax_breakup",
+ "other_charges_calculation",
+ "packing_list",
+ "packed_items",
+ "product_bundle_help",
+ "pricing_rule_details",
+ "pricing_rules",
+ "address_and_contact_tab",
+ "contact_info",
+ "customer_address",
+ "address_display",
+ "col_break21",
+ "contact_person",
+ "contact_display",
+ "contact_mobile",
+ "contact_email",
+ "shipping_address_section",
+ "shipping_address_name",
+ "shipping_address",
+ "column_break_95",
+ "dispatch_address_name",
+ "dispatch_address",
+ "company_address_section",
+ "company_address",
+ "column_break_101",
+ "company_address_display",
+ "terms_tab",
"tc_name",
"terms",
+ "more_info_tab",
+ "section_break_83",
+ "per_billed",
+ "status",
+ "column_break_112",
+ "per_installed",
+ "installation_status",
+ "column_break_89",
+ "per_returned",
"transporter_info",
"transporter",
"driver",
@@ -118,57 +132,41 @@
"transporter_name",
"driver_name",
"lr_date",
- "more_info",
- "campaign",
- "source",
- "column_break5",
- "is_internal_customer",
- "represents_company",
- "inter_company_reference",
- "per_billed",
- "customer_group",
- "territory",
- "printing_details",
- "letter_head",
- "select_print_heading",
- "language",
- "column_break_88",
- "print_without_amount",
- "group_same_items",
- "section_break_83",
- "status",
- "per_installed",
- "installation_status",
- "column_break_89",
- "per_returned",
- "excise_page",
- "instructions",
- "subscription_section",
- "auto_repeat",
+ "customer_po_details",
+ "po_no",
+ "column_break_17",
+ "po_date",
"sales_team_section_break",
"sales_partner",
- "column_break7",
"amount_eligible_for_commission",
+ "column_break7",
"commission_rate",
"total_commission",
"section_break1",
- "sales_team"
+ "sales_team",
+ "subscription_section",
+ "auto_repeat",
+ "printing_details",
+ "letter_head",
+ "print_without_amount",
+ "group_same_items",
+ "column_break_88",
+ "select_print_heading",
+ "language",
+ "more_info",
+ "is_internal_customer",
+ "represents_company",
+ "inter_company_reference",
+ "customer_group",
+ "territory",
+ "column_break5",
+ "excise_page",
+ "instructions",
+ "connections_tab",
+ "column_break_25"
],
"fields": [
{
- "fieldname": "delivery_to_section",
- "fieldtype": "Section Break",
- "label": "Delivery To",
- "options": "fa fa-user"
- },
- {
- "fieldname": "column_break0",
- "fieldtype": "Column Break",
- "oldfieldtype": "Column Break",
- "print_width": "50%",
- "width": "50%"
- },
- {
"allow_on_submit": 1,
"default": "{customer_name}",
"fieldname": "title",
@@ -337,11 +335,10 @@
"width": "100px"
},
{
- "collapsible": 1,
"depends_on": "customer",
"fieldname": "contact_info",
"fieldtype": "Section Break",
- "label": "Address and Contact",
+ "label": "Billing Address",
"options": "fa fa-bullhorn"
},
{
@@ -494,10 +491,6 @@
"print_hide": 1
},
{
- "fieldname": "sec_warehouse",
- "fieldtype": "Section Break"
- },
- {
"fieldname": "set_warehouse",
"fieldtype": "Link",
"label": "Set Source Warehouse",
@@ -511,6 +504,8 @@
{
"fieldname": "items_section",
"fieldtype": "Section Break",
+ "hide_border": 1,
+ "label": "Items",
"oldfieldtype": "Section Break",
"options": "fa fa-shopping-cart"
},
@@ -524,7 +519,6 @@
"allow_bulk_edit": 1,
"fieldname": "items",
"fieldtype": "Table",
- "label": "Items",
"oldfieldname": "delivery_note_details",
"oldfieldtype": "Table",
"options": "Delivery Note Item",
@@ -619,6 +613,7 @@
"read_only": 1
},
{
+ "depends_on": "total_net_weight",
"fieldname": "total_net_weight",
"fieldtype": "Float",
"label": "Total Net Weight",
@@ -628,6 +623,7 @@
{
"fieldname": "taxes_section",
"fieldtype": "Section Break",
+ "hide_border": 1,
"label": "Taxes and Charges",
"oldfieldtype": "Section Break",
"options": "fa fa-money"
@@ -653,10 +649,10 @@
},
{
"fieldname": "section_break_41",
- "fieldtype": "Section Break"
+ "fieldtype": "Section Break",
+ "hide_border": 1
},
{
- "description": "If you have created a standard template in Sales Taxes and Charges Template, select one and click on the button below.",
"fieldname": "taxes_and_charges",
"fieldtype": "Link",
"label": "Sales Taxes and Charges Template",
@@ -668,7 +664,6 @@
{
"fieldname": "taxes",
"fieldtype": "Table",
- "label": "Sales Taxes and Charges",
"oldfieldname": "other_charges",
"oldfieldtype": "Table",
"options": "Sales Taxes and Charges"
@@ -718,7 +713,6 @@
},
{
"collapsible": 1,
- "collapsible_depends_on": "discount_amount",
"fieldname": "section_break_49",
"fieldtype": "Section Break",
"label": "Additional Discount"
@@ -759,6 +753,7 @@
{
"fieldname": "totals",
"fieldtype": "Section Break",
+ "label": "Totals",
"oldfieldtype": "Section Break",
"options": "fa fa-money"
},
@@ -864,15 +859,6 @@
"width": "150px"
},
{
- "collapsible": 1,
- "collapsible_depends_on": "terms",
- "fieldname": "terms_section_break",
- "fieldtype": "Section Break",
- "label": "Terms and Conditions",
- "oldfieldtype": "Section Break",
- "options": "fa fa-legal"
- },
- {
"fieldname": "tc_name",
"fieldtype": "Link",
"label": "Terms",
@@ -965,13 +951,12 @@
"collapsible": 1,
"fieldname": "more_info",
"fieldtype": "Section Break",
- "label": "More Information",
+ "label": "Additional Info",
"oldfieldtype": "Section Break",
"options": "fa fa-file-text",
"print_hide": 1
},
{
- "description": "Track this Delivery Note against any Project",
"fieldname": "project",
"fieldtype": "Link",
"label": "Project",
@@ -1110,7 +1095,6 @@
},
{
"depends_on": "eval:!doc.__islocal",
- "description": "% of materials delivered against this Delivery Note",
"fieldname": "per_installed",
"fieldtype": "Percent",
"in_list_view": 1,
@@ -1238,10 +1222,6 @@
"read_only": 1
},
{
- "fieldname": "section_break_18",
- "fieldtype": "Section Break"
- },
- {
"default": "0",
"fetch_from": "customer.is_internal_customer",
"fieldname": "is_internal_customer",
@@ -1329,13 +1309,85 @@
{
"fieldname": "dimension_col_break",
"fieldtype": "Column Break"
+ },
+ {
+ "fieldname": "address_and_contact_tab",
+ "fieldtype": "Tab Break",
+ "label": "Address & Contact"
+ },
+ {
+ "fieldname": "terms_tab",
+ "fieldtype": "Tab Break",
+ "label": "Terms"
+ },
+ {
+ "fieldname": "more_info_tab",
+ "fieldtype": "Tab Break",
+ "label": "More Info"
+ },
+ {
+ "fieldname": "connections_tab",
+ "fieldtype": "Tab Break",
+ "label": "Connections",
+ "show_dashboard": 1
+ },
+ {
+ "fieldname": "column_break_10",
+ "fieldtype": "Column Break"
+ },
+ {
+ "fieldname": "column_break_25",
+ "fieldtype": "Column Break"
+ },
+ {
+ "fieldname": "section_break_30",
+ "fieldtype": "Section Break",
+ "hide_border": 1
+ },
+ {
+ "fieldname": "column_break_35",
+ "fieldtype": "Column Break"
+ },
+ {
+ "fieldname": "column_break_43",
+ "fieldtype": "Column Break"
+ },
+ {
+ "fieldname": "custom_dimensions_section",
+ "fieldtype": "Section Break"
+ },
+ {
+ "fieldname": "shipping_address_section",
+ "fieldtype": "Section Break",
+ "label": "Shipping Address"
+ },
+ {
+ "fieldname": "column_break_95",
+ "fieldtype": "Column Break"
+ },
+ {
+ "fieldname": "company_address_section",
+ "fieldtype": "Section Break",
+ "label": "Company Address"
+ },
+ {
+ "fieldname": "column_break_101",
+ "fieldtype": "Column Break"
+ },
+ {
+ "fieldname": "column_break_112",
+ "fieldtype": "Column Break"
+ },
+ {
+ "fieldname": "column_break_18",
+ "fieldtype": "Column Break"
}
],
"icon": "fa fa-truck",
"idx": 146,
"is_submittable": 1,
"links": [],
- "modified": "2022-09-16 17:46:17.701904",
+ "modified": "2022-10-11 13:06:58.655635",
"modified_by": "Administrator",
"module": "Stock",
"name": "Delivery Note",
diff --git a/erpnext/stock/doctype/item/item.py b/erpnext/stock/doctype/item/item.py
index c8bb1b9..20bc9d9 100644
--- a/erpnext/stock/doctype/item/item.py
+++ b/erpnext/stock/doctype/item/item.py
@@ -232,10 +232,10 @@
def clear_retain_sample(self):
if not self.has_batch_no:
- self.retain_sample = None
+ self.retain_sample = False
if not self.retain_sample:
- self.sample_quantity = None
+ self.sample_quantity = 0
def add_default_uom_in_conversion_factor_table(self):
if not self.is_new() and self.has_value_changed("stock_uom"):
diff --git a/erpnext/stock/doctype/item/test_item.py b/erpnext/stock/doctype/item/test_item.py
index 31c9919..e1ee938 100644
--- a/erpnext/stock/doctype/item/test_item.py
+++ b/erpnext/stock/doctype/item/test_item.py
@@ -722,8 +722,8 @@
item.has_batch_no = None
item.save()
- self.assertEqual(item.retain_sample, None)
- self.assertEqual(item.sample_quantity, None)
+ self.assertEqual(item.retain_sample, False)
+ self.assertEqual(item.sample_quantity, 0)
item.delete()
def consume_item_code_with_differet_stock_transactions(
diff --git a/erpnext/stock/doctype/material_request/material_request.json b/erpnext/stock/doctype/material_request/material_request.json
index 3593130..413c373 100644
--- a/erpnext/stock/doctype/material_request/material_request.json
+++ b/erpnext/stock/doctype/material_request/material_request.json
@@ -11,34 +11,40 @@
"naming_series",
"title",
"material_request_type",
- "transfer_status",
"customer",
- "status",
+ "company",
"column_break_2",
"transaction_date",
"schedule_date",
- "company",
"amended_from",
"warehouse_section",
+ "scan_barcode",
+ "column_break_13",
"set_from_warehouse",
"column_break5",
"set_warehouse",
"items_section",
- "scan_barcode",
"items",
- "more_info",
- "per_ordered",
- "column_break2",
- "per_received",
- "printing_details",
- "letter_head",
- "select_print_heading",
+ "terms_tab",
"terms_section_break",
"tc_name",
"terms",
+ "more_info_tab",
+ "status_section",
+ "status",
+ "per_ordered",
+ "column_break2",
+ "transfer_status",
+ "per_received",
+ "printing_details",
+ "letter_head",
+ "column_break_31",
+ "select_print_heading",
"reference",
"job_card",
- "work_order"
+ "column_break_35",
+ "work_order",
+ "connections_tab"
],
"fields": [
{
@@ -148,14 +154,6 @@
"reqd": 1
},
{
- "collapsible": 1,
- "fieldname": "more_info",
- "fieldtype": "Section Break",
- "label": "More Information",
- "oldfieldtype": "Section Break",
- "options": "fa fa-file-text"
- },
- {
"default": "Today",
"fieldname": "transaction_date",
"fieldtype": "Date",
@@ -239,7 +237,6 @@
"collapsible_depends_on": "terms",
"fieldname": "terms_section_break",
"fieldtype": "Section Break",
- "label": "Terms and Conditions",
"oldfieldtype": "Section Break",
"options": "fa fa-legal"
},
@@ -277,10 +274,10 @@
{
"fieldname": "warehouse_section",
"fieldtype": "Section Break",
- "label": "Warehouse"
+ "hide_border": 1,
+ "label": "Items"
},
{
- "description": "Sets 'Target Warehouse' in each row of the Items table.",
"fieldname": "set_warehouse",
"fieldtype": "Link",
"in_list_view": 1,
@@ -296,7 +293,6 @@
},
{
"depends_on": "eval:doc.material_request_type == 'Material Transfer'",
- "description": "Sets 'Source Warehouse' in each row of the Items table.",
"fieldname": "set_from_warehouse",
"fieldtype": "Link",
"label": "Set Source Warehouse",
@@ -317,13 +313,49 @@
"label": "Work Order",
"options": "Work Order",
"read_only": 1
+ },
+ {
+ "fieldname": "terms_tab",
+ "fieldtype": "Tab Break",
+ "label": "Terms"
+ },
+ {
+ "fieldname": "more_info_tab",
+ "fieldtype": "Tab Break",
+ "label": "More Info"
+ },
+ {
+ "fieldname": "connections_tab",
+ "fieldtype": "Tab Break",
+ "label": "Connections",
+ "show_dashboard": 1
+ },
+ {
+ "collapsible": 1,
+ "fieldname": "status_section",
+ "fieldtype": "Section Break",
+ "label": "Status",
+ "oldfieldtype": "Section Break",
+ "options": "fa fa-file-text"
+ },
+ {
+ "fieldname": "column_break_31",
+ "fieldtype": "Column Break"
+ },
+ {
+ "fieldname": "column_break_35",
+ "fieldtype": "Column Break"
+ },
+ {
+ "fieldname": "column_break_13",
+ "fieldtype": "Column Break"
}
],
"icon": "fa fa-ticket",
"idx": 70,
"is_submittable": 1,
"links": [],
- "modified": "2022-08-25 11:49:28.155048",
+ "modified": "2022-09-27 17:58:26.366469",
"modified_by": "Administrator",
"module": "Stock",
"name": "Material Request",
diff --git a/erpnext/stock/doctype/purchase_receipt/purchase_receipt.json b/erpnext/stock/doctype/purchase_receipt/purchase_receipt.json
index acaac92..3141212 100755
--- a/erpnext/stock/doctype/purchase_receipt/purchase_receipt.json
+++ b/erpnext/stock/doctype/purchase_receipt/purchase_receipt.json
@@ -17,10 +17,11 @@
"supplier_name",
"supplier_delivery_note",
"column_break1",
- "company",
"posting_date",
"posting_time",
"set_posting_time",
+ "column_break_12",
+ "company",
"apply_putaway_rule",
"is_return",
"return_against",
@@ -28,18 +29,6 @@
"cost_center",
"dimension_col_break",
"project",
- "section_addresses",
- "supplier_address",
- "contact_person",
- "address_display",
- "contact_display",
- "contact_mobile",
- "contact_email",
- "col_break_address",
- "shipping_address",
- "shipping_address_display",
- "billing_address",
- "billing_address_display",
"currency_and_price_list",
"currency",
"conversion_rate",
@@ -49,37 +38,33 @@
"plc_conversion_rate",
"ignore_pricing_rule",
"sec_warehouse",
+ "scan_barcode",
+ "column_break_31",
"set_warehouse",
- "rejected_warehouse",
- "col_break_warehouse",
"set_from_warehouse",
+ "col_break_warehouse",
+ "rejected_warehouse",
"is_subcontracted",
"supplier_warehouse",
"items_section",
- "scan_barcode",
"items",
"section_break0",
"total_qty",
+ "total_net_weight",
+ "column_break_43",
"base_total",
"base_net_total",
"column_break_27",
- "total_net_weight",
"total",
"net_total",
- "pricing_rule_details",
- "pricing_rules",
- "raw_material_details",
- "get_current_stock",
- "supplied_items",
"taxes_charges_section",
- "tax_category",
+ "taxes_and_charges",
"shipping_col",
+ "tax_category",
+ "column_break_53",
"shipping_rule",
"taxes_section",
- "taxes_and_charges",
"taxes",
- "sec_tax_breakup",
- "other_charges_calculation",
"totals",
"base_taxes_and_charges_added",
"base_taxes_and_charges_deducted",
@@ -88,53 +73,81 @@
"taxes_and_charges_added",
"taxes_and_charges_deducted",
"total_taxes_and_charges",
- "section_break_42",
- "apply_discount_on",
- "base_discount_amount",
- "column_break_44",
- "additional_discount_percentage",
- "discount_amount",
"section_break_46",
"base_grand_total",
"base_rounding_adjustment",
- "base_in_words",
"base_rounded_total",
+ "base_in_words",
"column_break_50",
"grand_total",
"rounding_adjustment",
"rounded_total",
"in_words",
"disable_rounded_total",
- "terms_section_break",
+ "section_break_42",
+ "apply_discount_on",
+ "base_discount_amount",
+ "column_break_44",
+ "additional_discount_percentage",
+ "discount_amount",
+ "sec_tax_breakup",
+ "other_charges_calculation",
+ "pricing_rule_details",
+ "pricing_rules",
+ "raw_material_details",
+ "get_current_stock",
+ "supplied_items",
+ "address_and_contact_tab",
+ "section_addresses",
+ "supplier_address",
+ "address_display",
+ "col_break_address",
+ "contact_person",
+ "contact_display",
+ "contact_mobile",
+ "contact_email",
+ "section_break_98",
+ "shipping_address",
+ "column_break_100",
+ "shipping_address_display",
+ "billing_address_section",
+ "billing_address",
+ "column_break_104",
+ "billing_address_display",
+ "terms_tab",
"tc_name",
"terms",
- "more_info",
+ "more_info_tab",
+ "status_section",
"status",
- "amended_from",
- "range",
"column_break4",
"per_billed",
"per_returned",
- "is_internal_supplier",
- "inter_company_reference",
- "represents_company",
"subscription_detail",
"auto_repeat",
"printing_settings",
"letter_head",
- "language",
- "instructions",
+ "group_same_items",
"column_break_97",
"select_print_heading",
- "other_details",
- "remarks",
- "group_same_items",
+ "language",
"transporter_info",
"transporter_name",
"column_break5",
"lr_no",
"lr_date",
- "is_old_subcontracting_flow"
+ "additional_info_section",
+ "instructions",
+ "is_internal_supplier",
+ "represents_company",
+ "inter_company_reference",
+ "column_break_131",
+ "remarks",
+ "range",
+ "amended_from",
+ "is_old_subcontracting_flow",
+ "other_details",
+ "connections_tab"
],
"fields": [
{
@@ -223,7 +236,6 @@
"width": "100px"
},
{
- "description": "Time at which materials were received",
"fieldname": "posting_time",
"fieldtype": "Time",
"label": "Posting Time",
@@ -277,15 +289,14 @@
"read_only": 1
},
{
- "collapsible": 1,
"fieldname": "section_addresses",
"fieldtype": "Section Break",
- "label": "Address and Contact"
+ "label": "Supplier Address"
},
{
"fieldname": "supplier_address",
"fieldtype": "Link",
- "label": "Select Supplier Address",
+ "label": "Supplier Address",
"options": "Address",
"print_hide": 1
},
@@ -330,7 +341,7 @@
{
"fieldname": "shipping_address",
"fieldtype": "Link",
- "label": "Select Shipping Address",
+ "label": "Shipping Address Template",
"options": "Address",
"print_hide": 1
},
@@ -410,10 +421,11 @@
},
{
"fieldname": "sec_warehouse",
- "fieldtype": "Section Break"
+ "fieldtype": "Section Break",
+ "hide_border": 1,
+ "label": "Items"
},
{
- "description": "Sets 'Accepted Warehouse' in each row of the items table.",
"fieldname": "set_warehouse",
"fieldtype": "Link",
"label": "Accepted Warehouse",
@@ -421,7 +433,6 @@
"print_hide": 1
},
{
- "description": "Sets 'Rejected Warehouse' in each row of the items table.",
"fieldname": "rejected_warehouse",
"fieldtype": "Link",
"label": "Rejected Warehouse",
@@ -461,6 +472,7 @@
{
"fieldname": "items_section",
"fieldtype": "Section Break",
+ "hide_border": 1,
"oldfieldtype": "Section Break",
"options": "fa fa-shopping-cart"
},
@@ -571,6 +583,7 @@
"read_only": 1
},
{
+ "depends_on": "total_net_weight",
"fieldname": "total_net_weight",
"fieldtype": "Float",
"label": "Total Net Weight",
@@ -578,11 +591,11 @@
"read_only": 1
},
{
- "description": "Add / Edit Taxes and Charges",
"fieldname": "taxes_charges_section",
"fieldtype": "Section Break",
- "oldfieldtype": "Section Break",
- "options": "fa fa-money"
+ "hide_border": 1,
+ "label": "Taxes and Charges",
+ "oldfieldtype": "Section Break"
},
{
"fieldname": "tax_category",
@@ -603,7 +616,8 @@
},
{
"fieldname": "taxes_section",
- "fieldtype": "Section Break"
+ "fieldtype": "Section Break",
+ "hide_border": 1
},
{
"fieldname": "taxes_and_charges",
@@ -709,7 +723,6 @@
},
{
"collapsible": 1,
- "collapsible_depends_on": "discount_amount",
"fieldname": "section_break_42",
"fieldtype": "Section Break",
"label": "Additional Discount"
@@ -749,7 +762,8 @@
},
{
"fieldname": "section_break_46",
- "fieldtype": "Section Break"
+ "fieldtype": "Section Break",
+ "label": "Totals"
},
{
"fieldname": "base_grand_total",
@@ -842,15 +856,6 @@
"label": "Disable Rounded Total"
},
{
- "collapsible": 1,
- "collapsible_depends_on": "terms",
- "fieldname": "terms_section_break",
- "fieldtype": "Section Break",
- "label": "Terms and Conditions",
- "oldfieldtype": "Section Break",
- "options": "fa fa-legal"
- },
- {
"fieldname": "tc_name",
"fieldtype": "Link",
"label": "Terms",
@@ -867,14 +872,6 @@
"oldfieldtype": "Text Editor"
},
{
- "collapsible": 1,
- "fieldname": "more_info",
- "fieldtype": "Section Break",
- "label": "More Information",
- "oldfieldtype": "Section Break",
- "options": "fa fa-file-text"
- },
- {
"default": "Draft",
"fieldname": "status",
"fieldtype": "Select",
@@ -924,7 +921,6 @@
"width": "50%"
},
{
- "description": "Track this Purchase Receipt against any Project",
"fieldname": "project",
"fieldtype": "Link",
"label": "Project",
@@ -941,7 +937,7 @@
{
"fieldname": "subscription_detail",
"fieldtype": "Section Break",
- "label": "Auto Repeat Detail"
+ "label": "Auto Repeat"
},
{
"fieldname": "auto_repeat",
@@ -1025,7 +1021,7 @@
"collapsible_depends_on": "transporter_name",
"fieldname": "transporter_info",
"fieldtype": "Section Break",
- "label": "Transporter Details",
+ "label": "Transporter",
"options": "fa fa-truck"
},
{
@@ -1087,7 +1083,7 @@
{
"fieldname": "billing_address",
"fieldtype": "Link",
- "label": "Select Billing Address",
+ "label": "Billing Address",
"options": "Address"
},
{
@@ -1113,7 +1109,6 @@
},
{
"depends_on": "eval: doc.is_internal_supplier",
- "description": "Sets 'From Warehouse' in each row of the items table.",
"fieldname": "set_from_warehouse",
"fieldtype": "Link",
"label": "Set From Warehouse",
@@ -1151,13 +1146,85 @@
"hidden": 1,
"label": "Is Old Subcontracting Flow",
"read_only": 1
+ },
+ {
+ "fieldname": "address_and_contact_tab",
+ "fieldtype": "Tab Break",
+ "label": "Address & Contact"
+ },
+ {
+ "fieldname": "terms_tab",
+ "fieldtype": "Tab Break",
+ "label": "Terms"
+ },
+ {
+ "fieldname": "more_info_tab",
+ "fieldtype": "Tab Break",
+ "label": "More Info"
+ },
+ {
+ "fieldname": "connections_tab",
+ "fieldtype": "Tab Break",
+ "label": "Connections",
+ "show_dashboard": 1
+ },
+ {
+ "fieldname": "column_break_12",
+ "fieldtype": "Column Break"
+ },
+ {
+ "fieldname": "column_break_31",
+ "fieldtype": "Column Break"
+ },
+ {
+ "fieldname": "column_break_43",
+ "fieldtype": "Column Break"
+ },
+ {
+ "fieldname": "column_break_53",
+ "fieldtype": "Column Break"
+ },
+ {
+ "fieldname": "section_break_98",
+ "fieldtype": "Section Break",
+ "label": "Company Shipping Address"
+ },
+ {
+ "fieldname": "billing_address_section",
+ "fieldtype": "Section Break",
+ "label": "Company Billing Address"
+ },
+ {
+ "collapsible": 1,
+ "fieldname": "status_section",
+ "fieldtype": "Section Break",
+ "label": "Status",
+ "oldfieldtype": "Section Break",
+ "options": "fa fa-file-text"
+ },
+ {
+ "fieldname": "additional_info_section",
+ "fieldtype": "Section Break",
+ "label": "Additional Info"
+ },
+ {
+ "fieldname": "column_break_131",
+ "fieldtype": "Column Break"
+ },
+ {
+ "fieldname": "column_break_100",
+ "fieldtype": "Column Break"
+ },
+ {
+ "fieldname": "column_break_104",
+ "fieldtype": "Column Break"
}
],
"icon": "fa fa-truck",
"idx": 261,
"is_submittable": 1,
"links": [],
- "modified": "2022-09-16 17:45:58.430132",
+ "modified": "2022-10-11 13:02:31.776256",
"modified_by": "Administrator",
"module": "Stock",
"name": "Purchase Receipt",
diff --git a/erpnext/stock/doctype/purchase_receipt/test_purchase_receipt.py b/erpnext/stock/doctype/purchase_receipt/test_purchase_receipt.py
index 6269724..1f807b8 100644
--- a/erpnext/stock/doctype/purchase_receipt/test_purchase_receipt.py
+++ b/erpnext/stock/doctype/purchase_receipt/test_purchase_receipt.py
@@ -2,6 +2,9 @@
# License: GNU General Public License v3. See license.txt
+from cmath import pi
+from turtle import update
+
import frappe
from frappe.tests.utils import FrappeTestCase, change_settings
from frappe.utils import add_days, cint, cstr, flt, today
@@ -14,6 +17,7 @@
from erpnext.stock.doctype.purchase_receipt.purchase_receipt import make_purchase_invoice
from erpnext.stock.doctype.serial_no.serial_no import SerialNoDuplicateError, get_serial_nos
from erpnext.stock.doctype.warehouse.test_warehouse import create_warehouse
+from erpnext.stock.get_item_details import update_stock
from erpnext.stock.stock_ledger import SerialNoExistsInFutureTransaction
@@ -1199,6 +1203,8 @@
self.assertEqual(pr1.items[0].rate, 100)
pr1.submit()
+ self.assertEqual(pr1.is_internal_supplier, 1)
+
# Backdated purchase receipt entry, the valuation rate should be updated for DN1 and PR1
make_purchase_receipt(
item_code=item_doc.name,
@@ -1241,6 +1247,234 @@
self.assertEqual(query[0].value, 0)
+ def test_backdated_transaction_for_internal_transfer_in_trasit_warehouse_for_purchase_receipt(
+ self,
+ ):
+ from erpnext.stock.doctype.delivery_note.delivery_note import make_inter_company_purchase_receipt
+ from erpnext.stock.doctype.delivery_note.test_delivery_note import create_delivery_note
+
+ prepare_data_for_internal_transfer()
+ customer = "_Test Internal Customer 2"
+ company = "_Test Company with perpetual inventory"
+
+ from_warehouse = create_warehouse("_Test Internal From Warehouse New", company=company)
+ to_warehouse = create_warehouse("_Test Internal To Warehouse New", company=company)
+ item_doc = create_item("Test Internal Transfer Item")
+
+ target_warehouse = create_warehouse("_Test Internal GIT Warehouse New", company=company)
+
+ make_purchase_receipt(
+ item_code=item_doc.name,
+ company=company,
+ posting_date=add_days(today(), -1),
+ warehouse=from_warehouse,
+ qty=1,
+ rate=100,
+ )
+
+ # Keep stock in advance and make sure that systen won't pick this stock while reposting backdated transaction
+ for i in range(1, 4):
+ make_purchase_receipt(
+ item_code=item_doc.name,
+ company=company,
+ posting_date=add_days(today(), -1 * i),
+ warehouse=target_warehouse,
+ qty=1,
+ rate=320 * i,
+ )
+
+ dn1 = create_delivery_note(
+ item_code=item_doc.name,
+ company=company,
+ customer=customer,
+ cost_center="Main - TCP1",
+ expense_account="Cost of Goods Sold - TCP1",
+ qty=1,
+ rate=500,
+ warehouse=from_warehouse,
+ target_warehouse=target_warehouse,
+ )
+
+ self.assertEqual(dn1.items[0].rate, 100)
+
+ pr1 = make_inter_company_purchase_receipt(dn1.name)
+ pr1.items[0].warehouse = to_warehouse
+ self.assertEqual(pr1.items[0].rate, 100)
+ pr1.submit()
+
+ stk_ledger = frappe.db.get_value(
+ "Stock Ledger Entry",
+ {"voucher_type": "Purchase Receipt", "voucher_no": pr1.name, "warehouse": target_warehouse},
+ ["stock_value_difference", "outgoing_rate"],
+ as_dict=True,
+ )
+
+ self.assertEqual(abs(stk_ledger.stock_value_difference), 100)
+ self.assertEqual(stk_ledger.outgoing_rate, 100)
+
+ # Backdated purchase receipt entry, the valuation rate should be updated for DN1 and PR1
+ make_purchase_receipt(
+ item_code=item_doc.name,
+ company=company,
+ posting_date=add_days(today(), -2),
+ warehouse=from_warehouse,
+ qty=1,
+ rate=200,
+ )
+
+ dn_value = frappe.db.get_value(
+ "Stock Ledger Entry",
+ {"voucher_type": "Delivery Note", "voucher_no": dn1.name, "warehouse": target_warehouse},
+ "stock_value_difference",
+ )
+
+ self.assertEqual(abs(dn_value), 200.00)
+
+ pr_value = frappe.db.get_value(
+ "Stock Ledger Entry",
+ {"voucher_type": "Purchase Receipt", "voucher_no": pr1.name, "warehouse": to_warehouse},
+ "stock_value_difference",
+ )
+
+ self.assertEqual(abs(pr_value), 200.00)
+ pr1.load_from_db()
+
+ self.assertEqual(pr1.items[0].valuation_rate, 200)
+ self.assertEqual(pr1.items[0].rate, 100)
+
+ Gl = frappe.qb.DocType("GL Entry")
+
+ query = (
+ frappe.qb.from_(Gl)
+ .select(
+ (fn.Sum(Gl.debit) - fn.Sum(Gl.credit)).as_("value"),
+ )
+ .where((Gl.voucher_type == pr1.doctype) & (Gl.voucher_no == pr1.name))
+ ).run(as_dict=True)
+
+ self.assertEqual(query[0].value, 0)
+
+ def test_backdated_transaction_for_internal_transfer_in_trasit_warehouse_for_purchase_invoice(
+ self,
+ ):
+ from erpnext.accounts.doctype.purchase_invoice.test_purchase_invoice import (
+ make_purchase_invoice as make_purchase_invoice_for_si,
+ )
+ from erpnext.accounts.doctype.sales_invoice.sales_invoice import (
+ make_inter_company_purchase_invoice,
+ )
+ from erpnext.accounts.doctype.sales_invoice.test_sales_invoice import create_sales_invoice
+
+ prepare_data_for_internal_transfer()
+ customer = "_Test Internal Customer 2"
+ company = "_Test Company with perpetual inventory"
+
+ from_warehouse = create_warehouse("_Test Internal From Warehouse New", company=company)
+ to_warehouse = create_warehouse("_Test Internal To Warehouse New", company=company)
+ item_doc = create_item("Test Internal Transfer Item")
+
+ target_warehouse = create_warehouse("_Test Internal GIT Warehouse New", company=company)
+
+ make_purchase_invoice_for_si(
+ item_code=item_doc.name,
+ company=company,
+ posting_date=add_days(today(), -1),
+ warehouse=from_warehouse,
+ qty=1,
+ update_stock=1,
+ expense_account="Cost of Goods Sold - TCP1",
+ cost_center="Main - TCP1",
+ rate=100,
+ )
+
+ # Keep stock in advance and make sure that systen won't pick this stock while reposting backdated transaction
+ for i in range(1, 4):
+ make_purchase_invoice_for_si(
+ item_code=item_doc.name,
+ company=company,
+ posting_date=add_days(today(), -1 * i),
+ warehouse=target_warehouse,
+ update_stock=1,
+ qty=1,
+ expense_account="Cost of Goods Sold - TCP1",
+ cost_center="Main - TCP1",
+ rate=320 * i,
+ )
+
+ si1 = create_sales_invoice(
+ item_code=item_doc.name,
+ company=company,
+ customer=customer,
+ cost_center="Main - TCP1",
+ income_account="Sales - TCP1",
+ qty=1,
+ rate=500,
+ update_stock=1,
+ warehouse=from_warehouse,
+ target_warehouse=target_warehouse,
+ )
+
+ self.assertEqual(si1.items[0].rate, 100)
+
+ pi1 = make_inter_company_purchase_invoice(si1.name)
+ pi1.items[0].warehouse = to_warehouse
+ self.assertEqual(pi1.items[0].rate, 100)
+ pi1.update_stock = 1
+ pi1.save()
+ pi1.submit()
+
+ stk_ledger = frappe.db.get_value(
+ "Stock Ledger Entry",
+ {"voucher_type": pi1.doctype, "voucher_no": pi1.name, "warehouse": target_warehouse},
+ ["stock_value_difference", "outgoing_rate"],
+ as_dict=True,
+ )
+
+ self.assertEqual(abs(stk_ledger.stock_value_difference), 100)
+ self.assertEqual(stk_ledger.outgoing_rate, 100)
+
+ # Backdated purchase receipt entry, the valuation rate should be updated for si1 and pi1
+ make_purchase_receipt(
+ item_code=item_doc.name,
+ company=company,
+ posting_date=add_days(today(), -2),
+ warehouse=from_warehouse,
+ qty=1,
+ rate=200,
+ )
+
+ si_value = frappe.db.get_value(
+ "Stock Ledger Entry",
+ {"voucher_type": si1.doctype, "voucher_no": si1.name, "warehouse": target_warehouse},
+ "stock_value_difference",
+ )
+
+ self.assertEqual(abs(si_value), 200.00)
+
+ pi_value = frappe.db.get_value(
+ "Stock Ledger Entry",
+ {"voucher_type": pi1.doctype, "voucher_no": pi1.name, "warehouse": to_warehouse},
+ "stock_value_difference",
+ )
+
+ self.assertEqual(abs(pi_value), 200.00)
+ pi1.load_from_db()
+
+ self.assertEqual(pi1.items[0].valuation_rate, 200)
+ self.assertEqual(pi1.items[0].rate, 100)
+
+ Gl = frappe.qb.DocType("GL Entry")
+
+ query = (
+ frappe.qb.from_(Gl)
+ .select(
+ (fn.Sum(Gl.debit) - fn.Sum(Gl.credit)).as_("value"),
+ )
+ .where((Gl.voucher_type == pi1.doctype) & (Gl.voucher_no == pi1.name))
+ ).run(as_dict=True)
+
+ self.assertEqual(query[0].value, 0)
+
def test_batch_expiry_for_purchase_receipt(self):
from erpnext.controllers.sales_and_purchase_return import make_return_doc
diff --git a/erpnext/stock/doctype/serial_no/serial_no.py b/erpnext/stock/doctype/serial_no/serial_no.py
index 6042ed4..a2748d0 100644
--- a/erpnext/stock/doctype/serial_no/serial_no.py
+++ b/erpnext/stock/doctype/serial_no/serial_no.py
@@ -846,16 +846,15 @@
pos_transacted_sr_nos = query.run(as_dict=True)
- reserved_sr_nos = []
- returned_sr_nos = []
+ reserved_sr_nos = set()
+ returned_sr_nos = set()
for d in pos_transacted_sr_nos:
if d.is_return == 0:
- reserved_sr_nos += get_serial_nos(d.serial_no)
+ [reserved_sr_nos.add(x) for x in get_serial_nos(d.serial_no)]
elif d.is_return == 1:
- returned_sr_nos += get_serial_nos(d.serial_no)
+ [returned_sr_nos.add(x) for x in get_serial_nos(d.serial_no)]
- for sr_no in returned_sr_nos:
- reserved_sr_nos.remove(sr_no)
+ reserved_sr_nos = list(reserved_sr_nos - returned_sr_nos)
return reserved_sr_nos
diff --git a/erpnext/stock/stock_ledger.py b/erpnext/stock/stock_ledger.py
index 9ca40c3..cdf6e89 100644
--- a/erpnext/stock/stock_ledger.py
+++ b/erpnext/stock/stock_ledger.py
@@ -542,6 +542,14 @@
if not self.args.get("sle_id"):
self.get_dynamic_incoming_outgoing_rate(sle)
+ if (
+ sle.voucher_type in ["Purchase Receipt", "Purchase Invoice"]
+ and sle.voucher_detail_no
+ and sle.actual_qty < 0
+ and frappe.get_cached_value(sle.voucher_type, sle.voucher_no, "is_internal_supplier")
+ ):
+ sle.outgoing_rate = get_incoming_rate_for_inter_company_transfer(sle)
+
if get_serial_nos(sle.serial_no):
self.get_serialized_values(sle)
self.wh_data.qty_after_transaction += flt(sle.actual_qty)
@@ -589,6 +597,7 @@
sle.stock_queue = json.dumps(self.wh_data.stock_queue)
sle.stock_value_difference = stock_value_difference
sle.doctype = "Stock Ledger Entry"
+
frappe.get_doc(sle).db_update()
if not self.args.get("sle_id"):
@@ -652,22 +661,7 @@
and sle.voucher_detail_no
and frappe.get_cached_value(sle.voucher_type, sle.voucher_no, "is_internal_supplier")
):
- field = (
- "delivery_note_item" if sle.voucher_type == "Purchase Receipt" else "sales_invoice_item"
- )
- doctype = (
- "Delivery Note Item" if sle.voucher_type == "Purchase Receipt" else "Sales Invoice Item"
- )
- refernce_name = frappe.get_cached_value(
- sle.voucher_type + " Item", sle.voucher_detail_no, field
- )
-
- if refernce_name:
- rate = frappe.get_cached_value(
- doctype,
- refernce_name,
- "incoming_rate",
- )
+ rate = get_incoming_rate_for_inter_company_transfer(sle)
else:
if sle.voucher_type in ("Purchase Receipt", "Purchase Invoice"):
rate_field = "valuation_rate"
@@ -748,14 +742,12 @@
def update_rate_on_purchase_receipt(self, sle, outgoing_rate):
if frappe.db.exists(sle.voucher_type + " Item", sle.voucher_detail_no):
- frappe.db.set_value(
- sle.voucher_type + " Item",
- sle.voucher_detail_no,
- {
- "base_net_rate": outgoing_rate,
- "valuation_rate": outgoing_rate,
- },
- )
+ if sle.voucher_type in ["Purchase Receipt", "Purchase Invoice"] and frappe.get_cached_value(
+ sle.voucher_type, sle.voucher_no, "is_internal_supplier"
+ ):
+ frappe.db.set_value(
+ f"{sle.voucher_type} Item", sle.voucher_detail_no, "valuation_rate", sle.outgoing_rate
+ )
else:
frappe.db.set_value(
"Purchase Receipt Item Supplied", sle.voucher_detail_no, "rate", outgoing_rate
@@ -1546,3 +1538,25 @@
if item_code and cint(frappe.db.get_value("Item", item_code, "allow_negative_stock", cache=True)):
return True
return False
+
+
+def get_incoming_rate_for_inter_company_transfer(sle) -> float:
+ """
+ For inter company transfer, incoming rate is the average of the outgoing rate
+ """
+ rate = 0.0
+
+ field = "delivery_note_item" if sle.voucher_type == "Purchase Receipt" else "sales_invoice_item"
+
+ doctype = "Delivery Note Item" if sle.voucher_type == "Purchase Receipt" else "Sales Invoice Item"
+
+ reference_name = frappe.get_cached_value(sle.voucher_type + " Item", sle.voucher_detail_no, field)
+
+ if reference_name:
+ rate = frappe.get_cached_value(
+ doctype,
+ reference_name,
+ "incoming_rate",
+ )
+
+ return rate