mirror of
https://github.com/frappe/erpnext.git
synced 2026-04-21 07:38:29 +00:00
feat(selling-settings): add checkbox to recalculate payment date
(cherry picked from commit 70b401e610)
This commit is contained in:
committed by
Mergify
parent
f428663f0d
commit
f7dd730bc3
@@ -7,7 +7,7 @@ import json
|
|||||||
import frappe
|
import frappe
|
||||||
from frappe import _
|
from frappe import _
|
||||||
from frappe.model.mapper import get_mapped_doc
|
from frappe.model.mapper import get_mapped_doc
|
||||||
from frappe.utils import flt, getdate, nowdate
|
from frappe.utils import cint, flt, getdate, nowdate
|
||||||
|
|
||||||
from erpnext.controllers.selling_controller import SellingController
|
from erpnext.controllers.selling_controller import SellingController
|
||||||
|
|
||||||
@@ -462,13 +462,19 @@ def _make_sales_order(source_name, target_doc=None, ignore_permissions=False, ar
|
|||||||
},
|
},
|
||||||
"Sales Taxes and Charges": {"doctype": "Sales Taxes and Charges", "reset_value": True},
|
"Sales Taxes and Charges": {"doctype": "Sales Taxes and Charges", "reset_value": True},
|
||||||
"Sales Team": {"doctype": "Sales Team", "add_if_empty": True},
|
"Sales Team": {"doctype": "Sales Team", "add_if_empty": True},
|
||||||
"Payment Schedule": {"doctype": "Payment Schedule", "add_if_empty": True},
|
|
||||||
},
|
},
|
||||||
target_doc,
|
target_doc,
|
||||||
set_missing_values,
|
set_missing_values,
|
||||||
ignore_permissions=ignore_permissions,
|
ignore_permissions=ignore_permissions,
|
||||||
)
|
)
|
||||||
|
|
||||||
|
automatically_fetch_payment_terms = cint(
|
||||||
|
frappe.get_single_value("Selling Settings", "automatically_fetch_payment_terms_from_quotation")
|
||||||
|
)
|
||||||
|
|
||||||
|
if automatically_fetch_payment_terms:
|
||||||
|
doclist.set_payment_schedule()
|
||||||
|
|
||||||
return doclist
|
return doclist
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
@@ -41,6 +41,7 @@
|
|||||||
"allow_zero_qty_in_quotation",
|
"allow_zero_qty_in_quotation",
|
||||||
"allow_zero_qty_in_sales_order",
|
"allow_zero_qty_in_sales_order",
|
||||||
"set_zero_rate_for_expired_batch",
|
"set_zero_rate_for_expired_batch",
|
||||||
|
"automatically_fetch_payment_terms_from_quotation",
|
||||||
"section_break_avhb",
|
"section_break_avhb",
|
||||||
"enable_utm",
|
"enable_utm",
|
||||||
"experimental_section",
|
"experimental_section",
|
||||||
@@ -320,6 +321,12 @@
|
|||||||
"fieldname": "enable_utm",
|
"fieldname": "enable_utm",
|
||||||
"fieldtype": "Check",
|
"fieldtype": "Check",
|
||||||
"label": "Enable UTM"
|
"label": "Enable UTM"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"default": "0",
|
||||||
|
"fieldname": "automatically_fetch_payment_terms_from_quotation",
|
||||||
|
"fieldtype": "Check",
|
||||||
|
"label": "Automatically Fetch Payment Terms from Quotation"
|
||||||
}
|
}
|
||||||
],
|
],
|
||||||
"grid_page_length": 50,
|
"grid_page_length": 50,
|
||||||
|
|||||||
@@ -38,6 +38,7 @@ class SellingSettings(Document):
|
|||||||
allow_sales_order_creation_for_expired_quotation: DF.Check
|
allow_sales_order_creation_for_expired_quotation: DF.Check
|
||||||
allow_zero_qty_in_quotation: DF.Check
|
allow_zero_qty_in_quotation: DF.Check
|
||||||
allow_zero_qty_in_sales_order: DF.Check
|
allow_zero_qty_in_sales_order: DF.Check
|
||||||
|
automatically_fetch_payment_terms_from_quotation: DF.Check
|
||||||
blanket_order_allowance: DF.Float
|
blanket_order_allowance: DF.Float
|
||||||
cust_master_name: DF.Literal["Customer Name", "Naming Series", "Auto Name"]
|
cust_master_name: DF.Literal["Customer Name", "Naming Series", "Auto Name"]
|
||||||
customer_group: DF.Link | None
|
customer_group: DF.Link | None
|
||||||
|
|||||||
Reference in New Issue
Block a user