From e693ab76fac16d8890fdcaac61bb5fccac6f7129 Mon Sep 17 00:00:00 2001 From: Rohit Waghchaure Date: Wed, 6 Aug 2025 16:41:39 +0530 Subject: [PATCH 01/12] fix: timeout while submitting purchase receipt (cherry picked from commit c433943c466f91486aba333947c05be3ccd1795c) --- erpnext/stock/doctype/purchase_receipt/purchase_receipt.json | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/erpnext/stock/doctype/purchase_receipt/purchase_receipt.json b/erpnext/stock/doctype/purchase_receipt/purchase_receipt.json index f275779ecc2..cef346a6d85 100755 --- a/erpnext/stock/doctype/purchase_receipt/purchase_receipt.json +++ b/erpnext/stock/doctype/purchase_receipt/purchase_receipt.json @@ -1084,7 +1084,8 @@ "no_copy": 1, "options": "Delivery Note", "print_hide": 1, - "read_only": 1 + "read_only": 1, + "search_index": 1 }, { "fieldname": "scan_barcode", @@ -1291,7 +1292,7 @@ "idx": 261, "is_submittable": 1, "links": [], - "modified": "2025-08-04 19:18:47.754957", + "modified": "2025-08-06 16:41:02.690658", "modified_by": "Administrator", "module": "Stock", "name": "Purchase Receipt", From 849f646bd28dc1ebbb288132914fb96f1303e1f0 Mon Sep 17 00:00:00 2001 From: Rohit Waghchaure Date: Wed, 6 Aug 2025 17:07:51 +0530 Subject: [PATCH 02/12] fix: stock reservation Delivered Qty against the batch --- erpnext/stock/doctype/delivery_note/delivery_note.py | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/erpnext/stock/doctype/delivery_note/delivery_note.py b/erpnext/stock/doctype/delivery_note/delivery_note.py index cbd7a1d7f57..762664bd566 100644 --- a/erpnext/stock/doctype/delivery_note/delivery_note.py +++ b/erpnext/stock/doctype/delivery_note/delivery_note.py @@ -452,8 +452,6 @@ class DeliveryNote(SellingController): self.update_prevdoc_status() self.update_billing_status() - self.update_stock_reservation_entries() - if not self.is_return: self.check_credit_limit() elif self.issue_credit_note: @@ -467,6 +465,7 @@ class DeliveryNote(SellingController): self.make_bundle_using_old_serial_batch_fields(table_name) self.validate_standalone_serial_nos_customer() + self.update_stock_reservation_entries() # Updating stock ledger should always be called after updating prevdoc status, # because updating reserved qty in bin depends upon updated delivered qty in SO From 24ca7bb64ff6bfb3d9c107f7e8b38794fbd0a0e5 Mon Sep 17 00:00:00 2001 From: diptanilsaha Date: Thu, 7 Aug 2025 01:37:33 +0530 Subject: [PATCH 03/12] fix: nonetype error on applying presentation_currency filter on financial statements and trial balance report (cherry picked from commit d7e22de44c23582a606144a258d82d2931c8c157) --- erpnext/accounts/report/utils.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/erpnext/accounts/report/utils.py b/erpnext/accounts/report/utils.py index 523fa0e0ee3..bf604a36db0 100644 --- a/erpnext/accounts/report/utils.py +++ b/erpnext/accounts/report/utils.py @@ -118,7 +118,7 @@ def convert_to_presentation_currency(gl_entries, currency_info, filters=None): len(account_currencies) == 1 and account_currency == presentation_currency and not exchange_gain_or_loss - ) and not filters.get("show_amount_in_company_currency"): + ) and not (filters and filters.get("show_amount_in_company_currency")): entry["debit"] = debit_in_account_currency entry["credit"] = credit_in_account_currency else: From 36cb5b65891666c231867e0b027828f5bfbe6ec4 Mon Sep 17 00:00:00 2001 From: Jeba Jebas Date: Tue, 1 Jul 2025 10:11:37 +0530 Subject: [PATCH 04/12] feat: added chart of accounts and tax template for australian localisation (#48208) * Add Australian Localisation Setup * feat: added chart of accounts and tax template for australian localisation * chore: linter fix --------- Co-authored-by: ruthra kumar (cherry picked from commit bb62a01c0dd0deb4921288a93e98407da6a976f4) --- .../au_standard_chart_of_accounts.json | 817 ++++++++++++++++++ erpnext/regional/australia/setup.py | 86 ++ .../setup_wizard/data/country_wise_tax.json | 153 +++- 3 files changed, 1052 insertions(+), 4 deletions(-) create mode 100644 erpnext/accounts/doctype/account/chart_of_accounts/verified/au_standard_chart_of_accounts.json create mode 100644 erpnext/regional/australia/setup.py diff --git a/erpnext/accounts/doctype/account/chart_of_accounts/verified/au_standard_chart_of_accounts.json b/erpnext/accounts/doctype/account/chart_of_accounts/verified/au_standard_chart_of_accounts.json new file mode 100644 index 00000000000..515a1e4de9d --- /dev/null +++ b/erpnext/accounts/doctype/account/chart_of_accounts/verified/au_standard_chart_of_accounts.json @@ -0,0 +1,817 @@ +{ + "country_code": "au", + "name": "Australia - Chart of Accounts with Account Numbers", + "tree": { + "Assets": { + "Current Assets": { + "Cash On Hand": { + "Cash On Hand": { + "account_number": "11010", + "account_type": "Cash" + }, + "account_number": "110", + "is_group": 1 + }, + "Cash at Bank": { + "Every Day Bank Account": { + "account_number": "11510", + "account_type": "Bank" + }, + "Business Savings Account": { + "account_number": "11520" + }, + "Business Term Deposit": { + "account_number": "11530" + }, + "account_number": "115", + "is_group": 1 + }, + "Trade Receivables": { + "Trade Debtors": { + "account_number": "12010", + "account_type": "Receivable" + }, + "Provision for Doubtful Debts": { + "account_number": "12020" + }, + "Sundry Debtors": { + "account_number": "12030" + }, + "Debtor Refund": { + "account_number": "12040" + }, + "account_number": "120", + "is_group": 1 + }, + "Inventory": { + "Stock On Hand": { + "account_number": "13010", + "account_type": "Stock" + }, + "WIP - Work In Progress - Manufacturing": { + "account_number": "13020" + }, + "account_number": "130", + "is_group": 1 + }, + "Prepayments": { + "Prepayments": { + "account_number": "14010" + }, + "Provisional Tax Paid": { + "account_number": "14020" + }, + "account_number": "140", + "is_group": 1 + }, + "account_number": "11", + "is_group": 1 + }, + "Non Current Assets": { + "Plant & Equipment": { + "Plant & Equipment": { + "account_number": "16010", + "account_type": "Fixed Asset" + }, + "Accumulated Depreciation Plant & Equipment": { + "account_number": "16020", + "account_type": "Accumulated Depreciation" + }, + "account_number": "160", + "is_group": 1 + }, + "Motor Vehicle": { + "Motor Vehicle": { + "account_number": "16110", + "account_type": "Fixed Asset" + }, + "Accumulated Depreciation Motor Vehicle": { + "account_number": "16120", + "account_type": "Accumulated Depreciation" + }, + "account_number": "161", + "is_group": 1 + }, + "Office Equipment": { + "Office Furniture & Equipment": { + "account_number": "16210", + "account_type": "Fixed Asset" + }, + "Accumulated Depreciation Office Furniture & Equipment": { + "account_number": "16220", + "account_type": "Accumulated Depreciation" + }, + "account_number": "162", + "is_group": 1 + }, + "Computer Equipment": { + "Computer Equipment": { + "account_number": "16310", + "account_type": "Fixed Asset" + }, + "Accumulated Depreciation Computer Equipment": { + "account_number": "16320", + "account_type": "Accumulated Depreciation" + }, + "account_number": "163", + "is_group": 1 + }, + "Building": { + "Buildings": { + "account_number": "16410", + "account_type": "Fixed Asset" + }, + "Accumulated Depreciation Buildings": { + "account_number": "16420", + "account_type": "Accumulated Depreciation" + }, + "CWIP - Construction Work In Progress": { + "account_number": "16430", + "account_type": "Capital Work in Progress" + }, + "Accumulated Depreciation - Others": { + "account_number": "16440", + "account_type": "Accumulated Depreciation" + }, + "account_number": "164", + "is_group": 1 + }, + "Related Party": { + "Loan to Party 1": { + "account_number": "17010" + }, + "account_number": "170", + "is_group": 1 + }, + "Investments & Unlisted Entities": { + "Investment - Entity 1": { + "account_number": "17510" + }, + "account_number": "175", + "is_group": 1 + }, + "Intagible Assets": { + "Goodwill": { + "account_number": "18010" + }, + "Opening Balance Temporary ": { + "account_number": "18090", + "account_type": "Temporary" + }, + "account_number": "180", + "is_group": 1 + }, + "account_number": "16", + "is_group": 1 + }, + "account_number": "1", + "root_type": "Asset" + }, + "Liabilities": { + "Current Liabilities": { + "Trade Payables - Current": { + "Trade Creditors": { + "account_number": "21010", + "account_type": "Payable" + }, + "Goods Received Not Invoiced": { + "account_number": "21050", + "account_type": "Stock Received But Not Billed" + }, + "Service Received Not Invoiced": { + "account_number": "21060" + }, + "Asset Received Not Invoiced": { + "account_number": "21070", + "account_type": "Asset Received But Not Billed" + }, + "account_number": "210", + "is_group": 1 + }, + "Other Payables - Current": { + "Accrued Expenses": { + "account_number": "21510" + }, + "Payroll - Wages Clearing": { + "account_number": "21550" + }, + "Payroll - Superannuation Deductions": { + "account_number": "21555" + }, + "Payroll - Misc Deductions": { + "account_number": "21560" + }, + "Payroll - Withholding Tax Payable": { + "account_number": "21565" + }, + "account_number": "215", + "is_group": 1 + }, + "GST": { + "GST Payments to ATO": { + "account_number": "22030" + }, + "Provision for PAYG Tax": { + "account_number": "22040" + }, + "account_number": "220", + "account_type": "Tax", + "is_group": 1 + }, + "Interest & Non Bearing Liabilities - Current": { + "Credit Card - VISA": { + "account_number": "22510" + }, + "account_number": "225", + "is_group": 1 + }, + "Bank Overdraft": { + "Bank Overdraft Cash at Bank": { + "account_number": "23010" + }, + "account_number": "230", + "is_group": 1 + }, + "Trade Finance": { + "Trade Finance": { + "account_number": "23510" + }, + "account_number": "235", + "is_group": 1 + }, + "Lease Liabilities": { + "Finance Lease - Current": { + "account_number": "24010" + }, + "account_number": "240", + "is_group": 1 + }, + "Provisions": { + "Provision for Long Service Leave": { + "account_number": "24510" + }, + "Provision for Holiday Pay": { + "account_number": "24520" + }, + "account_number": "245", + "is_group": 1 + }, + "account_number": "21", + "is_group": 1 + }, + "Non Current Liabilities": { + "Trade & Other Payables - Non Current": { + "Loan Account - Party 1": { + "account_number": "25010" + }, + "account_number": "250", + "is_group": 1 + }, + "Interest & Non Bearing Liabilities - Non Current": { + "Non Current Liability - Director Loan": { + "account_number": "25510" + }, + "account_number": "255", + "is_group": 1 + }, + "Bank Loans - Non Current": { + "Bank Loan 1 - Non Current": { + "account_number": "26010" + }, + "account_number": "260", + "is_group": 1 + }, + "Lease Liabilities - Non Current": { + "Finance Lease - Non Current": { + "account_number": "27010" + }, + "account_number": "270", + "is_group": 1 + }, + "Provisions - Non Current": { + "Provision for Long Service Leave": { + "account_number": "27510" + }, + "Provision for Holiday Pay": { + "account_number": "27520" + }, + "account_number": "275", + "is_group": 1 + }, + "account_number": "25", + "is_group": 1 + }, + "account_number": "2", + "root_type": "Liability" + }, + "Equity": { + "Equity": { + "Owner's/Shareholder's Equity": { + "Owner's/Shareholders Capital": { + "account_number": "31010", + "account_type": "Equity" + }, + "Owner's/Shareholders Drawings": { + "account_number": "31020", + "account_type": "Equity" + }, + "account_number": "310", + "is_group": 1 + }, + "Earnings": { + "Current Year Earnings": { + "account_number": "35010", + "account_type": "Equity" + }, + "Retained Earnings": { + "account_number": "35020", + "account_type": "Equity" + }, + "account_number": "350", + "is_group": 1 + }, + "account_number": "31", + "is_group": 1 + }, + "account_number": "3", + "root_type": "Equity" + }, + "Revenue": { + "Revenue": { + "Sales Revenue": { + "Sales Income": { + "account_number": "41010", + "account_type": "Income Account" + }, + "Freight Income": { + "account_number": "41020", + "account_type": "Income Account" + }, + "Other Income": { + "account_number": "41030", + "account_type": "Income Account" + }, + "Service Income": { + "account_number": "41040", + "account_type": "Income Account" + }, + "account_number": "410", + "is_group": 1 + }, + "Other Revenue": { + "Commission Received": { + "account_number": "42010" + }, + "Discounts Received": { + "account_number": "42020" + }, + "Interest received": { + "account_number": "42030" + }, + "Profit/Loss on Sales of Assets": { + "account_number": "42040" + }, + "Rent Received": { + "account_number": "42050" + }, + "Sundry Income": { + "account_number": "42060" + }, + "account_number": "420", + "is_group": 1 + }, + "account_number": "41", + "is_group": 1 + }, + "account_number": "4", + "root_type": "Income" + }, + "Cost of Goods": { + "Cost of Goods": { + "Cost of Goods Sold": { + "Cost of Goods Sold": { + "account_number": "51010", + "account_type": "Cost of Goods Sold" + }, + "Freight Expenses (sales related)": { + "account_number": "51020" + }, + "Discounts Given": { + "account_number": "51030" + }, + "Subcontracting Charges": { + "account_number": "51040" + }, + "account_number": "510", + "is_group": 1 + }, + "Other COGS": { + "Purchases - Miscellaneous": { + "account_number": "52010" + }, + "Duty & Customs Fees": { + "account_number": "52020", + "account_type": "Tax" + }, + "Freight Inwards": { + "account_number": "52030", + "account_type": "Chargeable" + }, + "Stock Adjustment": { + "account_number": "52040", + "account_type": "Stock Adjustment" + }, + "Stock Wirte Off": { + "account_number": "52050", + "account_type": "Stock Adjustment" + }, + "Stock Valuation Expenses": { + "account_number": "52060", + "account_type": "Expenses Included In Valuation" + }, + "Asset Valuation Expenses": { + "account_number": "52070", + "account_type": "Expenses Included In Asset Valuation" + }, + "account_number": "520", + "is_group": 1 + }, + "account_number": "51", + "is_group": 1 + }, + "account_number": "5", + "root_type": "Expense" + }, + "Expenses": { + "Fixed Expenses": { + "Payroll & Related Expenses": { + "Salaries & Wages": { + "account_number": "61010" + }, + "Superannuation": { + "account_number": "61015" + }, + "Staff Amenities - GST Paid": { + "account_number": "61020" + }, + "Staff Amenities - GST Free": { + "account_number": "61025" + }, + "Staff Recruitment": { + "account_number": "61030" + }, + "Staff Training": { + "account_number": "61035" + }, + "Fringe Benefits Tax": { + "account_number": "61040" + }, + "Payroll Tax": { + "account_number": "61045" + }, + "Workers Compensation": { + "account_number": "61050" + }, + "Long Service Leave": { + "account_number": "61060" + }, + "Mileage Reimbursement": { + "account_number": "61070" + }, + "Overtime": { + "account_number": "61080" + }, + "Worksafe Insurance": { + "account_number": "61090" + }, + "account_number": "610", + "is_group": 1 + }, + "Depreciation Expenses": { + "Depreciation - Plant & Equipment": { + "account_number": "62010", + "account_type": "Depreciation" + }, + "Depreciation - Motor Vehicle": { + "account_number": "62020", + "account_type": "Depreciation" + }, + "Depreciation - Office Equipment": { + "account_number": "62030", + "account_type": "Depreciation" + }, + "Depreciation - Computer Equipment": { + "account_number": "62040", + "account_type": "Depreciation" + }, + "Depreciation - Building": { + "account_number": "62050", + "account_type": "Depreciation" + }, + "Depreciation - Others": { + "account_number": "62510", + "account_type": "Depreciation" + }, + "account_number": "620", + "is_group": 1 + }, + "account_number": "61", + "is_group": 1 + }, + "Accrued Expenses": { + "Accrued Expenses": { + "Accrued Expenses - Salaries & Wages": { + "account_number": "63010" + }, + "Accrued Expenses - Interest": { + "account_number": "63020" + }, + "account_number": "630", + "is_group": 1 + }, + "account_number": "63", + "is_group": 1 + }, + "Operating Expenses": { + "General and Administrative Expenses": { + "Low Value Assets less than $300": { + "account_number": "64010" + }, + "Office Supplies": { + "account_number": "64020" + }, + "Postage & Courier": { + "account_number": "64025" + }, + "Printing & Stationery": { + "account_number": "64030" + }, + "Registration Fees / Filing Fees": { + "account_number": "64040" + }, + "Travel & Accommodation - Local": { + "account_number": "64050" + }, + "Travel & Accommodation - Overseas": { + "account_number": "64060" + }, + "Relocation Costs": { + "account_number": "64070" + }, + "Hire Charges": { + "account_number": "64080" + }, + "Repairs & Maintenance": { + "account_number": "64210" + }, + "Cleaning Expenses": { + "account_number": "64215" + }, + "Uniforms": { + "account_number": "64220" + }, + "Security": { + "account_number": "64225" + }, + "Subscriptions & Licences": { + "account_number": "64510" + }, + "Software Expenses": { + "account_number": "64515" + }, + "Marketing Expenses": { + "account_number": "64520" + }, + "Advertising Expenses": { + "account_number": "64525" + }, + "Website Hosting & Domain Expenses": { + "account_number": "64530" + }, + "Computer Repairs / Supplies": { + "account_number": "64540" + }, + "Conferences": { + "account_number": "64550" + }, + "Consultancy /Contract Services": { + "account_number": "64560" + }, + "Training Services": { + "account_number": "64570" + }, + "Workshop Supplies": { + "account_number": "64580" + }, + "Consumables": { + "account_number": "64585" + }, + "Entertainment Expenses - Deductible": { + "account_number": "64810" + }, + "Entertainment Expenses - Non Deductible": { + "account_number": "64820" + }, + "Amortisation Of Goodwill": { + "account_number": "64910" + }, + "General / Miscellaneous Expenses": { + "account_number": "64915", + "account_type": "Chargeable" + }, + "Donations": { + "account_number": "64920" + }, + "Client Gifts": { + "account_number": "64930" + }, + "Employee Gifts": { + "account_number": "64935" + }, + "account_number": "640", + "is_group": 1 + }, + "Occupancy Expenses": { + "Rental Expenses": { + "account_number": "65010" + }, + "Property Insurance": { + "account_number": "65020" + }, + "Electricity Expenses": { + "account_number": "65030" + }, + "Water Rates": { + "account_number": "65040" + }, + "Gas Expenses": { + "account_number": "65050" + }, + "Property Taxes": { + "account_number": "65060" + }, + "Rates": { + "account_number": "65070" + }, + "account_number": "650", + "is_group": 1 + }, + "Communication & Vehicle Expenses": { + "Internet Expenses": { + "account_number": "66010" + }, + "Mobile Telephone": { + "account_number": "66020" + }, + "Telephone Expenses": { + "account_number": "66030" + }, + "Motor Vehicle - Fuel Expenses": { + "account_number": "66040" + }, + "Motor Vehicle - Parking & Tolls": { + "account_number": "66050" + }, + "Motor Vehicle - Registration & Insurance": { + "account_number": "66060" + }, + "Motor Vehicle - Service & Repairs": { + "account_number": "66070" + }, + "Taxi": { + "account_number": "66080" + }, + "account_number": "660", + "is_group": 1 + }, + "account_number": "64", + "is_group": 1 + }, + "Non-Operating Expenses": { + "Finance Costs": { + "Interest - Bank Loans": { + "account_number": "67010" + }, + "Interest - Finance Leases": { + "account_number": "67020" + }, + "Interest - Other Loans": { + "account_number": "67025" + }, + "Insurance": { + "account_number": "67030" + }, + "Bank Charges": { + "account_number": "67050" + }, + "Rounding off": { + "account_number": "67055", + "account_type": "Round Off" + }, + "Audit Fees": { + "account_number": "67060" + }, + "Accounting Fees": { + "account_number": "67070" + }, + "Legal Fees": { + "account_number": "67080" + }, + "Management Fees": { + "account_number": "67090" + }, + "account_number": "670", + "is_group": 1 + }, + "Other Costs": { + "Doubtful Debts": { + "account_number": "67510" + }, + "Fines": { + "account_number": "67520" + }, + "Debt Collection": { + "account_number": "67530" + }, + "Bad Debts": { + "account_number": "67540" + }, + "account_number": "675", + "is_group": 1 + }, + "account_number": "67", + "is_group": 1 + }, + "Variable Expenses": { + "Variable Expenses": { + "Bonus & Commissions Paid": { + "account_number": "68010" + }, + "Bonus & Commissions To be Paid": { + "account_number": "68020" + }, + "Warranty Claims": { + "account_number": "68030" + }, + "account_number": "680", + "is_group": 1 + }, + "account_number": "68", + "is_group": 1 + }, + "account_number": "6", + "root_type": "Expense" + }, + "Other Income": { + "Other Income": { + "Interest Income": { + "Interest Income": { + "account_number": "71010" + }, + "account_number": "710", + "is_group": 1 + }, + "Asset Disposal Income": { + "Gain on Asset Disposal": { + "account_number": "73010" + }, + "account_number": "730", + "is_group": 1 + }, + "account_number": "71", + "is_group": 1 + }, + "account_number": "7", + "root_type": "Income" + }, + "Other Expenses": { + "Other Expenses": { + "Income Tax Expenses": { + "Income Tax Expenses": { + "account_number": "81010" + }, + "account_number": "810", + "is_group": 1 + }, + "Foreign Exchange Gain/Loss": { + "Exchange Loss/Gain - Realized": { + "account_number": "82010" + }, + "account_number": "820", + "is_group": 1 + }, + "Asset Disposal Expenses": { + "Loss on Asset Disposal": { + "account_number": "83010" + }, + "account_number": "830", + "is_group": 1 + }, + "account_number": "81", + "is_group": 1 + }, + "account_number": "8", + "root_type": "Expense" + } + } +} \ No newline at end of file diff --git a/erpnext/regional/australia/setup.py b/erpnext/regional/australia/setup.py new file mode 100644 index 00000000000..55549690f72 --- /dev/null +++ b/erpnext/regional/australia/setup.py @@ -0,0 +1,86 @@ +import frappe +from frappe.desk.page.setup_wizard.setup_wizard import make_records + + +def setup(company=None, patch=True): + pass + + +def update_regional_tax_settings(country=None, company=None): + # tax rules + records = [ + { + "doctype": "Tax Rule", + "tax_type": "Purchase", + "purchase_tax_template": frappe.db.get_value( + "Purchase Taxes and Charges Template", + {"title": "AU Capital Purchase - GST", "company": company}, + ), + "use_for_shopping_cart": "1", + "tax_category": "Capital Goods Supplier", + "priority": "10", + "company": company, + }, + { + "doctype": "Tax Rule", + "tax_type": "Purchase", + "purchase_tax_template": frappe.db.get_value( + "Purchase Taxes and Charges Template", + {"title": "Import & GST-Free Purchase", "company": company}, + ), + "use_for_shopping_cart": "1", + "tax_category": "Import / GST Free Supplier", + "priority": "20", + "company": company, + }, + { + "doctype": "Tax Rule", + "tax_type": "Purchase", + "purchase_tax_template": frappe.db.get_value( + "Purchase Taxes and Charges Template", + {"title": "AU Non Capital Purchase - GST", "company": company}, + ), + "use_for_shopping_cart": "1", + "tax_category": "Domestic GST Supplier", + "priority": "30", + "company": company, + }, + { + "doctype": "Tax Rule", + "tax_type": "Sales", + "sales_tax_template": frappe.db.get_value( + "Sales Taxes and Charges Template", + {"title": "AU Sales - GST", "company": company}, + ), + "use_for_shopping_cart": "1", + "tax_category": "Domestic GST Customer", + "priority": "30", + "company": company, + }, + { + "doctype": "Tax Rule", + "tax_type": "Sales", + "sales_tax_template": frappe.db.get_value( + "Sales Taxes and Charges Template", + {"title": "Export Sales - GST Free", "company": company}, + ), + "use_for_shopping_cart": "1", + "tax_category": "Export Customer", + "priority": "20", + "company": company, + }, + { + "doctype": "Tax Rule", + "tax_type": "Sales", + "sales_tax_template": frappe.db.get_value( + "Sales Taxes and Charges Template", + {"title": "AU Sales - GST Free", "company": company}, + ), + "use_for_shopping_cart": "1", + "tax_category": "GST Free Customer", + "priority": "10", + "company": company, + }, + ] + + make_records(records) diff --git a/erpnext/setup/setup_wizard/data/country_wise_tax.json b/erpnext/setup/setup_wizard/data/country_wise_tax.json index 9f10785dac1..e82daeb7c72 100644 --- a/erpnext/setup/setup_wizard/data/country_wise_tax.json +++ b/erpnext/setup/setup_wizard/data/country_wise_tax.json @@ -60,10 +60,155 @@ }, "Australia": { - "Australia GST": { - "account_name": "GST 10%", - "tax_rate": 10.00, - "default": 1 + "tax_categories" :[ + { + "title" : "Domestic GST Supplier" + }, + { + "title" : "Domestic GST Customer" + }, + { + "title" : "Export Customer" + }, + { + "title" : "GST Free Customer" + }, + { + "title" : "Capital Goods Supplier" + }, + { + "title" : "Import / GST Free Supplier" + } + ], + "chart_of_accounts": { + "Australia - Chart of Accounts with Account Numbers": { + "sales_tax_templates": [ + { + "title": "AU Sales - GST", + "taxes": [ + { + "account_head": { + "account_name": "GST Collected (Payable)", + "account_number": "22010", + "account_type": "Tax", + "tax_rate": "10" + }, + "is_default" : 1, + "description": "GST Collected (Payable)", + "rate": 10 + } + ] + }, + { + "title": "Export Sales - GST Free", + "taxes": [ + { + "account_head": { + "account_name": "GST Collected (Payable)", + "account_number": "22010", + "account_type": "Tax", + "tax_rate": "10" + }, + "description": "GST Collected (Payable)", + "rate": 0 + } + ] + }, + { + "title": "AU Sales - GST Free", + "taxes": [ + { + "account_head": { + "account_name": "GST Collected (Payable)", + "account_number": "22010", + "account_type": "Tax", + "tax_rate": "10" + }, + "description": "GST Collected (Payable)", + "rate": 0 + } + ] + } + ], + "purchase_tax_templates": [ + { + "title": "AU Capital Purchase - GST", + "taxes": [ + { + "account_head": { + "account_name": "GST Paid (Receivable)", + "account_number": "22020", + "account_type": "Tax", + "tax_rate": "10" + }, + "description": "GST Paid (Receivable)", + "rate": 10 + } + ] + }, + { + "title": "Import & GST-Free Purchase", + "taxes": [ + { + "account_head": { + "account_name": "GST Paid (Receivable)", + "account_number": "22020", + "account_type": "Tax", + "tax_rate": "10" + }, + "description": "GST Paid (Receivable)", + "rate": 0 + } + ] + }, + { + "title": "AU Non Capital Purchase - GST", + "taxes": [ + { + "account_head": { + "account_name": "GST Paid (Receivable)", + "account_number": "22020", + "account_type": "Tax", + "tax_rate": "10" + }, + "description": "GST Paid (Receivable)", + "is_default" :1, + "rate": 10 + } + ] + } + ], + "item_tax_templates": [ + { + "title": "GST Exempt Sales", + "taxes": [ + { + "tax_type": { + "account_name": "GST Collected (Payable)", + "account_number": "22010", + "root_type": "Liability", + "tax_rate": "10" + }, + "tax_rate": 0 + } + ] + }, + { + "title" : "GST Exempt Purchase", + "taxes": [ + { + "tax_type": { + "account_name": "GST Paid (Receivable)", + "account_number": "22020", + "root_type": "Liability", + "tax_rate": "10" + }, + "tax_rate": 0 + } + ] + } + ] + } } }, From 90a08730448d165ba6a8f89ae5aacb686781f755 Mon Sep 17 00:00:00 2001 From: Rohit Waghchaure Date: Thu, 7 Aug 2025 00:50:56 +0530 Subject: [PATCH 05/12] fix: zero valuation rate for the batch (cherry picked from commit c8410cb5ca6a03f25b06688cadb491a36c755cc0) # Conflicts: # erpnext/accounts/doctype/sales_invoice/test_sales_invoice.py --- .../sales_invoice/test_sales_invoice.py | 155 ++++++++++++++++++ erpnext/stock/serial_batch_bundle.py | 9 + 2 files changed, 164 insertions(+) diff --git a/erpnext/accounts/doctype/sales_invoice/test_sales_invoice.py b/erpnext/accounts/doctype/sales_invoice/test_sales_invoice.py index 70d09ab70ed..a693f314cec 100644 --- a/erpnext/accounts/doctype/sales_invoice/test_sales_invoice.py +++ b/erpnext/accounts/doctype/sales_invoice/test_sales_invoice.py @@ -7,8 +7,13 @@ import json import frappe from frappe import qb from frappe.model.dynamic_links import get_dynamic_link_map +<<<<<<< HEAD from frappe.tests.utils import FrappeTestCase, change_settings from frappe.utils import add_days, flt, format_date, getdate, nowdate, today +======= +from frappe.tests import IntegrationTestCase, change_settings +from frappe.utils import add_days, cint, flt, format_date, getdate, nowdate, today +>>>>>>> c8410cb5ca (fix: zero valuation rate for the batch) import erpnext from erpnext.accounts.doctype.account.test_account import create_account, get_inventory_account @@ -4575,6 +4580,155 @@ class TestSalesInvoice(FrappeTestCase): self.assertEqual(stock_ledger_entry.qty, 2.0) self.assertEqual(stock_ledger_entry.stock_value_difference, 0.0) +<<<<<<< HEAD +======= + def test_system_generated_exchange_gain_or_loss_je_after_repost(self): + from erpnext.accounts.doctype.payment_entry.payment_entry import get_payment_entry + from erpnext.accounts.doctype.repost_accounting_ledger.test_repost_accounting_ledger import ( + update_repost_settings, + ) + + update_repost_settings() + + si = create_sales_invoice( + customer="_Test Customer USD", + debit_to="_Test Receivable USD - _TC", + currency="USD", + conversion_rate=80, + ) + + pe = get_payment_entry("Sales Invoice", si.name) + pe.reference_no = "10" + pe.reference_date = nowdate() + pe.paid_from_account_currency = si.currency + pe.paid_to_account_currency = "INR" + pe.source_exchange_rate = 85 + pe.target_exchange_rate = 1 + pe.paid_amount = si.outstanding_amount + pe.insert() + pe.submit() + + ral = frappe.new_doc("Repost Accounting Ledger") + ral.company = si.company + ral.append("vouchers", {"voucher_type": si.doctype, "voucher_no": si.name}) + ral.save() + ral.submit() + + je = frappe.qb.DocType("Journal Entry") + jea = frappe.qb.DocType("Journal Entry Account") + q = ( + ( + frappe.qb.from_(je) + .join(jea) + .on(je.name == jea.parent) + .select(je.docstatus) + .where( + (je.voucher_type == "Exchange Gain Or Loss") + & (jea.reference_name == si.name) + & (jea.reference_type == "Sales Invoice") + & (je.is_system_generated == 1) + ) + ) + .limit(1) + .run() + ) + + self.assertEqual(q[0][0], 1) + + def test_non_batchwise_valuation_for_moving_average(self): + from erpnext.stock.doctype.item.test_item import make_item + + item_code = "_Test Item for Non Batchwise Valuation" + make_item_for_si( + item_code, + { + "is_stock_item": 1, + "has_batch_no": 1, + "create_new_batch": 1, + "batch_number_series": "TBATCH-TCNV.####", + "valuation_method": "Moving Average", + }, + ) + + doc = frappe.get_doc("Stock Settings") + original_value = cint(doc.do_not_use_batchwise_valuation) + + doc.db_set("do_not_use_batchwise_valuation", 1) + + se = make_stock_entry( + item_code=item_code, + qty=10, + target="_Test Warehouse - _TC", + rate=13.02, + valuation_method="Moving Average", + use_serial_batch_fields=True, + ) + + se_batch = get_batch_from_bundle(se.items[0].serial_and_batch_bundle) + + # without use serial and batch fields + si = create_sales_invoice( + item=item_code, + qty=1, + rate=120, + update_stock=1, + use_serial_batch_fields=False, + warehouse="_Test Warehouse - _TC", + ) + + si.reload() + si_batch = get_batch_from_bundle(si.items[0].serial_and_batch_bundle) + + self.assertEqual(se_batch, si_batch) + self.assertEqual(si.items[0].use_serial_batch_fields, 0) + + serial_and_batch_bundle = si.items[0].serial_and_batch_bundle + change_in_value = frappe.db.get_value( + "Stock Ledger Entry", + { + "voucher_type": "Sales Invoice", + "voucher_no": si.name, + "item_code": item_code, + "warehouse": "_Test Warehouse - _TC", + "serial_and_batch_bundle": serial_and_batch_bundle, + }, + "stock_value_difference", + ) + + self.assertEqual(change_in_value, 13.02 * -1) + + # with use serial and batch fields + si = create_sales_invoice( + item=item_code, + qty=1, + rate=120, + update_stock=1, + use_serial_batch_fields=True, + warehouse="_Test Warehouse - _TC", + ) + + si.reload() + + self.assertEqual(si.items[0].use_serial_batch_fields, 1) + + serial_and_batch_bundle = si.items[0].serial_and_batch_bundle + change_in_value = frappe.db.get_value( + "Stock Ledger Entry", + { + "voucher_type": "Sales Invoice", + "voucher_no": si.name, + "item_code": item_code, + "warehouse": "_Test Warehouse - _TC", + "serial_and_batch_bundle": serial_and_batch_bundle, + }, + "stock_value_difference", + ) + + self.assertEqual(change_in_value, 13.02 * -1) + + doc.db_set("do_not_use_batchwise_valuation", original_value) + +>>>>>>> c8410cb5ca (fix: zero valuation rate for the batch) def make_item_for_si(item_code, properties=None): from erpnext.stock.doctype.item.test_item import make_item @@ -4690,6 +4844,7 @@ def create_sales_invoice(**args): "incoming_rate": args.incoming_rate or 0, "serial_and_batch_bundle": bundle_id, "allow_zero_valuation_rate": args.allow_zero_valuation_rate or 0, + "use_serial_batch_fields": args.use_serial_batch_fields or 0, }, ) diff --git a/erpnext/stock/serial_batch_bundle.py b/erpnext/stock/serial_batch_bundle.py index 3e3f2bcdf69..203340a9ff5 100644 --- a/erpnext/stock/serial_batch_bundle.py +++ b/erpnext/stock/serial_batch_bundle.py @@ -112,6 +112,7 @@ class SerialBatchBundle: "company": self.company, "is_rejected": self.is_rejected_entry(), "make_bundle_from_sle": 1, + "sle": self.sle, } ).make_serial_and_batch_bundle() @@ -1004,6 +1005,14 @@ class SerialBatchCreation: if not hasattr(self, "do_not_submit") or not self.do_not_submit: doc.flags.ignore_voucher_validation = True + if self.get("sle"): + doc.flags.ignore_validate = True + doc.save() + self.sle.db_set("serial_and_batch_bundle", doc.name, update_modified=False) + + if doc.flags.ignore_validate: + doc.flags.ignore_validate = False + doc.submit() else: doc.save() From 105838091eb57963180f016c4ce80891b248fb33 Mon Sep 17 00:00:00 2001 From: rohitwaghchaure Date: Thu, 7 Aug 2025 14:10:21 +0530 Subject: [PATCH 06/12] chore: fix conflicts --- .../sales_invoice/test_sales_invoice.py | 61 ------------------- 1 file changed, 61 deletions(-) diff --git a/erpnext/accounts/doctype/sales_invoice/test_sales_invoice.py b/erpnext/accounts/doctype/sales_invoice/test_sales_invoice.py index a693f314cec..39faa24c16a 100644 --- a/erpnext/accounts/doctype/sales_invoice/test_sales_invoice.py +++ b/erpnext/accounts/doctype/sales_invoice/test_sales_invoice.py @@ -7,13 +7,8 @@ import json import frappe from frappe import qb from frappe.model.dynamic_links import get_dynamic_link_map -<<<<<<< HEAD from frappe.tests.utils import FrappeTestCase, change_settings -from frappe.utils import add_days, flt, format_date, getdate, nowdate, today -======= -from frappe.tests import IntegrationTestCase, change_settings from frappe.utils import add_days, cint, flt, format_date, getdate, nowdate, today ->>>>>>> c8410cb5ca (fix: zero valuation rate for the batch) import erpnext from erpnext.accounts.doctype.account.test_account import create_account, get_inventory_account @@ -4580,61 +4575,6 @@ class TestSalesInvoice(FrappeTestCase): self.assertEqual(stock_ledger_entry.qty, 2.0) self.assertEqual(stock_ledger_entry.stock_value_difference, 0.0) -<<<<<<< HEAD -======= - def test_system_generated_exchange_gain_or_loss_je_after_repost(self): - from erpnext.accounts.doctype.payment_entry.payment_entry import get_payment_entry - from erpnext.accounts.doctype.repost_accounting_ledger.test_repost_accounting_ledger import ( - update_repost_settings, - ) - - update_repost_settings() - - si = create_sales_invoice( - customer="_Test Customer USD", - debit_to="_Test Receivable USD - _TC", - currency="USD", - conversion_rate=80, - ) - - pe = get_payment_entry("Sales Invoice", si.name) - pe.reference_no = "10" - pe.reference_date = nowdate() - pe.paid_from_account_currency = si.currency - pe.paid_to_account_currency = "INR" - pe.source_exchange_rate = 85 - pe.target_exchange_rate = 1 - pe.paid_amount = si.outstanding_amount - pe.insert() - pe.submit() - - ral = frappe.new_doc("Repost Accounting Ledger") - ral.company = si.company - ral.append("vouchers", {"voucher_type": si.doctype, "voucher_no": si.name}) - ral.save() - ral.submit() - - je = frappe.qb.DocType("Journal Entry") - jea = frappe.qb.DocType("Journal Entry Account") - q = ( - ( - frappe.qb.from_(je) - .join(jea) - .on(je.name == jea.parent) - .select(je.docstatus) - .where( - (je.voucher_type == "Exchange Gain Or Loss") - & (jea.reference_name == si.name) - & (jea.reference_type == "Sales Invoice") - & (je.is_system_generated == 1) - ) - ) - .limit(1) - .run() - ) - - self.assertEqual(q[0][0], 1) - def test_non_batchwise_valuation_for_moving_average(self): from erpnext.stock.doctype.item.test_item import make_item @@ -4728,7 +4668,6 @@ class TestSalesInvoice(FrappeTestCase): doc.db_set("do_not_use_batchwise_valuation", original_value) ->>>>>>> c8410cb5ca (fix: zero valuation rate for the batch) def make_item_for_si(item_code, properties=None): from erpnext.stock.doctype.item.test_item import make_item From 8a3fdb4ec2d98e8f110663d410e8d2e567eaf124 Mon Sep 17 00:00:00 2001 From: Asmita Hase Date: Thu, 7 Aug 2025 17:31:36 +0530 Subject: [PATCH 07/12] fix: added a flag on journal entry to ignore party account type validation if required (cherry picked from commit 0665d13fd35c18d4b22843f6e963fed1e74c1309) --- erpnext/accounts/doctype/journal_entry/journal_entry.py | 1 + 1 file changed, 1 insertion(+) diff --git a/erpnext/accounts/doctype/journal_entry/journal_entry.py b/erpnext/accounts/doctype/journal_entry/journal_entry.py index 4341aef9a6a..0b8cefa48d8 100644 --- a/erpnext/accounts/doctype/journal_entry/journal_entry.py +++ b/erpnext/accounts/doctype/journal_entry/journal_entry.py @@ -552,6 +552,7 @@ class JournalEntry(AccountsController): elif ( d.party_type and frappe.db.get_value("Party Type", d.party_type, "account_type") != account_type + and (not self.flags.ignore_party_account_validation) ): frappe.throw( _("Row {0}: Account {1} and Party Type {2} have different account types").format( From b060cdb4f56b80fb09adba670ee93defbd682562 Mon Sep 17 00:00:00 2001 From: mithili Date: Mon, 28 Jul 2025 17:10:46 +0530 Subject: [PATCH 08/12] fix(purchase invoice): filter only enabled account (cherry picked from commit c3111db6e2d9135c01f93d6f94c1c459b1ee7b37) --- .../accounts/doctype/purchase_invoice/purchase_invoice.js | 5 ++++- erpnext/controllers/queries.py | 1 + 2 files changed, 5 insertions(+), 1 deletion(-) diff --git a/erpnext/accounts/doctype/purchase_invoice/purchase_invoice.js b/erpnext/accounts/doctype/purchase_invoice/purchase_invoice.js index c3935029670..5bf15ac325b 100644 --- a/erpnext/accounts/doctype/purchase_invoice/purchase_invoice.js +++ b/erpnext/accounts/doctype/purchase_invoice/purchase_invoice.js @@ -35,7 +35,10 @@ erpnext.accounts.PurchaseInvoice = class PurchaseInvoice extends erpnext.buying. this.frm.set_query("expense_account", "items", function () { return { query: "erpnext.controllers.queries.get_expense_account", - filters: { company: doc.company }, + filters: { + company: doc.company, + disabled: 0, + }, }; }); } diff --git a/erpnext/controllers/queries.py b/erpnext/controllers/queries.py index b4610337ceb..8810e3595b2 100644 --- a/erpnext/controllers/queries.py +++ b/erpnext/controllers/queries.py @@ -695,6 +695,7 @@ def get_expense_account(doctype, txt, searchfield, start, page_len, filters): condition = "" if filters.get("company"): condition += "and tabAccount.company = %(company)s" + condition += f"and tabAccount.disabled = {filters.get('disabled', 0)}" return frappe.db.sql( f"""select tabAccount.name from `tabAccount` From 0d47eb1fa070dd8bffe880cbf3c9bead9cd3d21c Mon Sep 17 00:00:00 2001 From: mithili Date: Wed, 30 Jul 2025 11:19:23 +0530 Subject: [PATCH 09/12] fix: add condition to fetch active accounts (cherry picked from commit 7c8dd86a35ee3029404943542358ec66430edec1) --- erpnext/accounts/doctype/purchase_invoice/purchase_invoice.js | 1 - erpnext/controllers/queries.py | 3 +-- 2 files changed, 1 insertion(+), 3 deletions(-) diff --git a/erpnext/accounts/doctype/purchase_invoice/purchase_invoice.js b/erpnext/accounts/doctype/purchase_invoice/purchase_invoice.js index 5bf15ac325b..f23e3b33d49 100644 --- a/erpnext/accounts/doctype/purchase_invoice/purchase_invoice.js +++ b/erpnext/accounts/doctype/purchase_invoice/purchase_invoice.js @@ -37,7 +37,6 @@ erpnext.accounts.PurchaseInvoice = class PurchaseInvoice extends erpnext.buying. query: "erpnext.controllers.queries.get_expense_account", filters: { company: doc.company, - disabled: 0, }, }; }); diff --git a/erpnext/controllers/queries.py b/erpnext/controllers/queries.py index 8810e3595b2..17141751ca1 100644 --- a/erpnext/controllers/queries.py +++ b/erpnext/controllers/queries.py @@ -695,14 +695,13 @@ def get_expense_account(doctype, txt, searchfield, start, page_len, filters): condition = "" if filters.get("company"): condition += "and tabAccount.company = %(company)s" - condition += f"and tabAccount.disabled = {filters.get('disabled', 0)}" return frappe.db.sql( f"""select tabAccount.name from `tabAccount` where (tabAccount.report_type = "Profit and Loss" or tabAccount.account_type in ("Expense Account", "Fixed Asset", "Temporary", "Asset Received But Not Billed", "Capital Work in Progress")) and tabAccount.is_group=0 - and tabAccount.docstatus!=2 + and tabAccount.disabled = 0 and tabAccount.{searchfield} LIKE %(txt)s {condition} {get_match_cond(doctype)}""", {"company": filters.get("company", ""), "txt": "%" + txt + "%"}, From 90e583db1983cb4af3e9f88b53d53217a44b243c Mon Sep 17 00:00:00 2001 From: mithili Date: Mon, 4 Aug 2025 18:48:48 +0530 Subject: [PATCH 10/12] chore: add back filter (cherry picked from commit 23308f6d10e1e804c969cca928ca110de03c52b2) --- erpnext/accounts/doctype/purchase_invoice/purchase_invoice.js | 1 + 1 file changed, 1 insertion(+) diff --git a/erpnext/accounts/doctype/purchase_invoice/purchase_invoice.js b/erpnext/accounts/doctype/purchase_invoice/purchase_invoice.js index f23e3b33d49..5bf15ac325b 100644 --- a/erpnext/accounts/doctype/purchase_invoice/purchase_invoice.js +++ b/erpnext/accounts/doctype/purchase_invoice/purchase_invoice.js @@ -37,6 +37,7 @@ erpnext.accounts.PurchaseInvoice = class PurchaseInvoice extends erpnext.buying. query: "erpnext.controllers.queries.get_expense_account", filters: { company: doc.company, + disabled: 0, }, }; }); From 5f2725f61f7d9522e98a14eb78fffaf8a1126b2d Mon Sep 17 00:00:00 2001 From: Asmita Hase Date: Fri, 8 Aug 2025 12:18:36 +0530 Subject: [PATCH 11/12] chore: trigger create_advance_payment_ledger_records patch (cherry picked from commit 6d908f44a53b2829990d673404edebcaa4a4bd9d) --- erpnext/patches.txt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/erpnext/patches.txt b/erpnext/patches.txt index 197596daa8d..74b899555c0 100644 --- a/erpnext/patches.txt +++ b/erpnext/patches.txt @@ -361,7 +361,7 @@ erpnext.patches.v14_0.create_accounting_dimensions_in_reconciliation_tool erpnext.patches.v14_0.update_flag_for_return_invoices #2024-03-22 erpnext.patches.v15_0.create_accounting_dimensions_in_payment_request erpnext.patches.v14_0.update_pos_return_ledger_entries #2024-08-16 -erpnext.patches.v15_0.create_advance_payment_ledger_records #2025-07-04 +erpnext.patches.v15_0.create_advance_payment_ledger_records #2025-07-08 # below migration patch should always run last erpnext.patches.v14_0.migrate_gl_to_payment_ledger erpnext.stock.doctype.delivery_note.patches.drop_unused_return_against_index # 2023-12-20 From d3dde833f717e73daf4606b418e12974f3270274 Mon Sep 17 00:00:00 2001 From: Asmita Hase Date: Fri, 8 Aug 2025 12:58:06 +0530 Subject: [PATCH 12/12] fix: dont validate account type in for employee party type (cherry picked from commit e7a2ff1884ca74c3dddb80508c87be8149561904) --- erpnext/accounts/doctype/journal_entry/journal_entry.py | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/erpnext/accounts/doctype/journal_entry/journal_entry.py b/erpnext/accounts/doctype/journal_entry/journal_entry.py index 0b8cefa48d8..a54bae9fb96 100644 --- a/erpnext/accounts/doctype/journal_entry/journal_entry.py +++ b/erpnext/accounts/doctype/journal_entry/journal_entry.py @@ -552,7 +552,8 @@ class JournalEntry(AccountsController): elif ( d.party_type and frappe.db.get_value("Party Type", d.party_type, "account_type") != account_type - and (not self.flags.ignore_party_account_validation) + and d.party_type + != "Employee" # making an excpetion for employee since they can be both payable and receivable ): frappe.throw( _("Row {0}: Account {1} and Party Type {2} have different account types").format(