mirror of
https://github.com/frappe/erpnext.git
synced 2026-06-07 15:12:51 +00:00
Set default taxes and charges while creating quotation from opportunity
This commit is contained in:
@@ -178,6 +178,7 @@ def get_item_details(item_code):
|
|||||||
@frappe.whitelist()
|
@frappe.whitelist()
|
||||||
def make_quotation(source_name, target_doc=None):
|
def make_quotation(source_name, target_doc=None):
|
||||||
def set_missing_values(source, target):
|
def set_missing_values(source, target):
|
||||||
|
from erpnext.controllers.accounts_controller import get_default_taxes_and_charges
|
||||||
quotation = frappe.get_doc(target)
|
quotation = frappe.get_doc(target)
|
||||||
|
|
||||||
company_currency = frappe.db.get_value("Company", quotation.company, "default_currency")
|
company_currency = frappe.db.get_value("Company", quotation.company, "default_currency")
|
||||||
@@ -194,6 +195,10 @@ def make_quotation(source_name, target_doc=None):
|
|||||||
|
|
||||||
quotation.conversion_rate = exchange_rate
|
quotation.conversion_rate = exchange_rate
|
||||||
|
|
||||||
|
# get default taxes
|
||||||
|
taxes = get_default_taxes_and_charges("Sales Taxes and Charges Template")
|
||||||
|
quotation.extend("taxes", taxes)
|
||||||
|
|
||||||
quotation.run_method("set_missing_values")
|
quotation.run_method("set_missing_values")
|
||||||
quotation.run_method("calculate_taxes_and_totals")
|
quotation.run_method("calculate_taxes_and_totals")
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user