diff --git a/erpnext/accounts/doctype/accounts_settings/accounts_settings.json b/erpnext/accounts/doctype/accounts_settings/accounts_settings.json index 55db06f8ca7..e68b1e58007 100644 --- a/erpnext/accounts/doctype/accounts_settings/accounts_settings.json +++ b/erpnext/accounts/doctype/accounts_settings/accounts_settings.json @@ -64,10 +64,6 @@ "role_allowed_to_over_bill", "credit_controller", "make_payment_via_journal_entry", - "pos_tab", - "pos_setting_section", - "post_change_gl_entries", - "column_break_xrnd", "assets_tab", "asset_settings_section", "calculate_depr_using_total_days", @@ -282,13 +278,6 @@ "fieldname": "column_break_19", "fieldtype": "Column Break" }, - { - "default": "1", - "description": "If enabled, ledger entries will be posted for change amount in POS transactions", - "fieldname": "post_change_gl_entries", - "fieldtype": "Check", - "label": "Create Ledger Entries for Change Amount" - }, { "default": "0", "description": "Learn about Common Party", @@ -329,11 +318,6 @@ "fieldtype": "Tab Break", "label": "Accounts Closing" }, - { - "fieldname": "pos_setting_section", - "fieldtype": "Section Break", - "label": "POS Setting" - }, { "fieldname": "invoice_and_billing_tab", "fieldtype": "Tab Break", @@ -348,11 +332,6 @@ "fieldname": "column_break_17", "fieldtype": "Column Break" }, - { - "fieldname": "pos_tab", - "fieldtype": "Tab Break", - "label": "POS" - }, { "default": "0", "description": "Enabling this will allow creation of multi-currency invoices against single party account in company currency", @@ -536,10 +515,6 @@ "label": "Posting Date Inheritance for Exchange Gain / Loss", "options": "Invoice\nPayment\nReconciliation Date" }, - { - "fieldname": "column_break_xrnd", - "fieldtype": "Column Break" - }, { "default": "Buffered Cursor", "fieldname": "receivable_payable_fetch_method", @@ -665,7 +640,7 @@ "index_web_pages_for_search": 1, "issingle": 1, "links": [], - "modified": "2026-01-02 18:17:18.994348", + "modified": "2026-01-09 17:38:04.250917", "modified_by": "Administrator", "module": "Accounts", "name": "Accounts Settings", diff --git a/erpnext/accounts/doctype/accounts_settings/accounts_settings.py b/erpnext/accounts/doctype/accounts_settings/accounts_settings.py index 73d51000a5b..dbe86f6d7b2 100644 --- a/erpnext/accounts/doctype/accounts_settings/accounts_settings.py +++ b/erpnext/accounts/doctype/accounts_settings/accounts_settings.py @@ -57,7 +57,6 @@ class AccountsSettings(Document): make_payment_via_journal_entry: DF.Check merge_similar_account_heads: DF.Check over_billing_allowance: DF.Currency - post_change_gl_entries: DF.Check receivable_payable_fetch_method: DF.Literal["Buffered Cursor", "UnBuffered Cursor", "Raw SQL"] receivable_payable_remarks_length: DF.Int reconciliation_queue_size: DF.Int diff --git a/erpnext/accounts/doctype/pos_settings/pos_settings.json b/erpnext/accounts/doctype/pos_settings/pos_settings.json index ac0b884b3d7..7afc19423d8 100644 --- a/erpnext/accounts/doctype/pos_settings/pos_settings.json +++ b/erpnext/accounts/doctype/pos_settings/pos_settings.json @@ -6,6 +6,8 @@ "engine": "InnoDB", "field_order": [ "invoice_type", + "column_break_vwwt", + "post_change_gl_entries", "section_break_gyos", "invoice_fields", "pos_search_fields" @@ -34,12 +36,24 @@ { "fieldname": "section_break_gyos", "fieldtype": "Section Break" + }, + { + "fieldname": "column_break_vwwt", + "fieldtype": "Column Break" + }, + { + "default": "0", + "description": "If enabled, ledger entries will be posted for change amount in POS transactions", + "fieldname": "post_change_gl_entries", + "fieldtype": "Check", + "label": "Create Ledger Entries for Change Amount", + "options": "1" } ], "hide_toolbar": 1, "issingle": 1, "links": [], - "modified": "2026-01-02 18:18:17.586225", + "modified": "2026-01-09 17:30:41.476806", "modified_by": "Administrator", "module": "Accounts", "name": "POS Settings", diff --git a/erpnext/accounts/doctype/pos_settings/pos_settings.py b/erpnext/accounts/doctype/pos_settings/pos_settings.py index 4865262b83a..4f57326a528 100644 --- a/erpnext/accounts/doctype/pos_settings/pos_settings.py +++ b/erpnext/accounts/doctype/pos_settings/pos_settings.py @@ -23,6 +23,7 @@ class POSSettings(Document): invoice_fields: DF.Table[POSField] invoice_type: DF.Literal["Sales Invoice", "POS Invoice"] pos_search_fields: DF.Table[POSSearchFields] + post_change_gl_entries: DF.Check # end: auto-generated types def validate(self): diff --git a/erpnext/accounts/doctype/sales_invoice/sales_invoice.py b/erpnext/accounts/doctype/sales_invoice/sales_invoice.py index 18a86434ef9..cad1a597386 100644 --- a/erpnext/accounts/doctype/sales_invoice/sales_invoice.py +++ b/erpnext/accounts/doctype/sales_invoice/sales_invoice.py @@ -1726,7 +1726,7 @@ class SalesInvoice(SellingController): def make_pos_gl_entries(self, gl_entries): if cint(self.is_pos): skip_change_gl_entries = not cint( - frappe.get_single_value("Accounts Settings", "post_change_gl_entries") + frappe.get_single_value("POS Settings", "post_change_gl_entries") ) for payment_mode in self.payments: diff --git a/erpnext/accounts/doctype/sales_invoice/test_sales_invoice.py b/erpnext/accounts/doctype/sales_invoice/test_sales_invoice.py index 67dae79d083..13eb0f6ae18 100644 --- a/erpnext/accounts/doctype/sales_invoice/test_sales_invoice.py +++ b/erpnext/accounts/doctype/sales_invoice/test_sales_invoice.py @@ -1173,7 +1173,7 @@ class TestSalesInvoice(ERPNextTestSuite): self.assertEqual(expected, res) def test_pos_with_no_gl_entry_for_change_amount(self): - frappe.db.set_single_value("Accounts Settings", "post_change_gl_entries", 0) + frappe.db.set_single_value("POS Settings", "post_change_gl_entries", 0) make_pos_profile( company="_Test Company with perpetual inventory", @@ -1221,7 +1221,7 @@ class TestSalesInvoice(ERPNextTestSuite): self.validate_pos_gl_entry(pos, pos, 60, validate_without_change_gle=True) - frappe.db.set_single_value("Accounts Settings", "post_change_gl_entries", 1) + frappe.db.set_single_value("POS Settings", "post_change_gl_entries", 1) def validate_pos_gl_entry(self, si, pos, cash_amount, validate_without_change_gle=False): if validate_without_change_gle: diff --git a/erpnext/patches.txt b/erpnext/patches.txt index ce466bc94cd..00448f197b0 100644 --- a/erpnext/patches.txt +++ b/erpnext/patches.txt @@ -456,3 +456,4 @@ erpnext.patches.v16_0.update_tax_withholding_field_in_payment_entry erpnext.patches.v16_0.migrate_tax_withholding_data erpnext.patches.v16_0.update_corrected_cancelled_status erpnext.patches.v16_0.fix_barcode_typo +erpnext.patches.v16_0.set_post_change_gl_entries_on_pos_settings \ No newline at end of file diff --git a/erpnext/patches/v16_0/set_post_change_gl_entries_on_pos_settings.py b/erpnext/patches/v16_0/set_post_change_gl_entries_on_pos_settings.py new file mode 100644 index 00000000000..9e051859157 --- /dev/null +++ b/erpnext/patches/v16_0/set_post_change_gl_entries_on_pos_settings.py @@ -0,0 +1,14 @@ +import frappe + + +def execute(): + Singles = frappe.qb.DocType("Singles") + query = ( + frappe.qb.from_(Singles) + .select("value") + .where((Singles.doctype == "Accounts Settings") & (Singles.field == "post_change_gl_entries")) + ) + result = query.run(as_dict=1) + if result: + post_change_gl_entries = int(result[0].get("value", 1)) + frappe.db.set_single_value("POS Settings", "post_change_gl_entries", post_change_gl_entries)