mirror of
https://github.com/frappe/erpnext.git
synced 2026-08-12 06:01:46 +00:00
Merge pull request #56334 from mihir-kandoi/pg-irs1099-payer-tiebreak
fix(regional): deterministic IRS-1099 payer-address pick across engines
This commit is contained in:
@@ -131,6 +131,7 @@ def get_payer_address_html(company):
|
||||
.where(address.is_your_company_address == 1)
|
||||
.orderby(Case().when(address.address_type == "Postal", 1).else_(0), order=frappe.qb.desc)
|
||||
.orderby(Case().when(address.address_type == "Billing", 1).else_(0), order=frappe.qb.desc)
|
||||
.orderby(address.name) # deterministic LIMIT-1 tie-break across engines
|
||||
.limit(1)
|
||||
.run(as_dict=True)
|
||||
)
|
||||
|
||||
Reference in New Issue
Block a user