fix: set currency and price list before computing quotation totals

This commit is contained in:
ervishnucs
2026-06-28 20:13:53 +05:30
parent e61d299e63
commit 8446be6518

View File

@@ -23,9 +23,6 @@ def make_quotation(source_name: str, target_doc: str | Document | None = None):
)
target_doc.quotation_to = "Customer"
target_doc.run_method("set_missing_values")
target_doc.run_method("set_other_charges")
target_doc.run_method("calculate_taxes_and_totals")
price_list, currency = frappe.db.get_value(
"Customer", {"name": source_name}, ["default_price_list", "default_currency"]
@@ -39,7 +36,9 @@ def make_quotation(source_name: str, target_doc: str | Document | None = None):
target_doc.conversion_rate = get_exchange_rate(
target_doc.currency, company_currency, target_doc.transaction_date, "for_selling"
)
target_doc.run_method("calculate_taxes_and_totals")
target_doc.run_method("set_missing_values")
target_doc.run_method("set_other_charges")
target_doc.run_method("calculate_taxes_and_totals")
return target_doc