mirror of
https://github.com/frappe/erpnext.git
synced 2026-03-20 07:22:13 +00:00
fix: promotional scheme doctype fields in consitency with pricing rule (#42432)
* fix: add "round_free_qty" check box in promotional scheme * fix: add `add_for_price_list` field * fix: set_query in setup for promotional scheme --------- (cherry picked from commit8624aeca54) # Conflicts: # erpnext/accounts/doctype/promotional_scheme_price_discount/promotional_scheme_price_discount.json # erpnext/accounts/doctype/promotional_scheme_product_discount/promotional_scheme_product_discount.json (cherry picked from commit87d8603d1d)
This commit is contained in:
@@ -2,6 +2,18 @@
|
|||||||
// For license information, please see license.txt
|
// For license information, please see license.txt
|
||||||
|
|
||||||
frappe.ui.form.on("Promotional Scheme", {
|
frappe.ui.form.on("Promotional Scheme", {
|
||||||
|
setup: function (frm) {
|
||||||
|
frm.set_query("for_price_list", "price_discount_slabs", (doc) => {
|
||||||
|
return {
|
||||||
|
filters: {
|
||||||
|
selling: doc.selling,
|
||||||
|
buying: doc.buying,
|
||||||
|
currency: doc.currency,
|
||||||
|
},
|
||||||
|
};
|
||||||
|
});
|
||||||
|
},
|
||||||
|
|
||||||
refresh: function (frm) {
|
refresh: function (frm) {
|
||||||
frm.trigger("set_options_for_applicable_for");
|
frm.trigger("set_options_for_applicable_for");
|
||||||
frm.trigger("toggle_reqd_apply_on");
|
frm.trigger("toggle_reqd_apply_on");
|
||||||
|
|||||||
@@ -51,6 +51,7 @@ price_discount_fields = [
|
|||||||
"discount_percentage",
|
"discount_percentage",
|
||||||
"validate_applied_rule",
|
"validate_applied_rule",
|
||||||
"apply_multiple_pricing_rules",
|
"apply_multiple_pricing_rules",
|
||||||
|
"for_price_list",
|
||||||
]
|
]
|
||||||
|
|
||||||
product_discount_fields = [
|
product_discount_fields = [
|
||||||
@@ -63,6 +64,7 @@ product_discount_fields = [
|
|||||||
"recurse_for",
|
"recurse_for",
|
||||||
"apply_recursion_over",
|
"apply_recursion_over",
|
||||||
"apply_multiple_pricing_rules",
|
"apply_multiple_pricing_rules",
|
||||||
|
"round_free_qty",
|
||||||
]
|
]
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
@@ -21,6 +21,7 @@
|
|||||||
"rate",
|
"rate",
|
||||||
"discount_amount",
|
"discount_amount",
|
||||||
"discount_percentage",
|
"discount_percentage",
|
||||||
|
"for_price_list",
|
||||||
"section_break_11",
|
"section_break_11",
|
||||||
"warehouse",
|
"warehouse",
|
||||||
"threshold_percentage",
|
"threshold_percentage",
|
||||||
@@ -120,6 +121,13 @@
|
|||||||
"fieldtype": "Float",
|
"fieldtype": "Float",
|
||||||
"label": "Discount Percentage"
|
"label": "Discount Percentage"
|
||||||
},
|
},
|
||||||
|
{
|
||||||
|
"depends_on": "eval:doc.rate_or_discount!=\"Rate\"",
|
||||||
|
"fieldname": "for_price_list",
|
||||||
|
"fieldtype": "Link",
|
||||||
|
"label": "For Price List",
|
||||||
|
"options": "Price List"
|
||||||
|
},
|
||||||
{
|
{
|
||||||
"fieldname": "section_break_11",
|
"fieldname": "section_break_11",
|
||||||
"fieldtype": "Section Break"
|
"fieldtype": "Section Break"
|
||||||
@@ -169,7 +177,11 @@
|
|||||||
"index_web_pages_for_search": 1,
|
"index_web_pages_for_search": 1,
|
||||||
"istable": 1,
|
"istable": 1,
|
||||||
"links": [],
|
"links": [],
|
||||||
|
<<<<<<< HEAD
|
||||||
"modified": "2021-11-16 00:25:33.843996",
|
"modified": "2021-11-16 00:25:33.843996",
|
||||||
|
=======
|
||||||
|
"modified": "2024-07-23 12:33:46.574950",
|
||||||
|
>>>>>>> 8624aeca54 (fix: promotional scheme doctype fields in consitency with pricing rule (#42432))
|
||||||
"modified_by": "Administrator",
|
"modified_by": "Administrator",
|
||||||
"module": "Accounts",
|
"module": "Accounts",
|
||||||
"name": "Promotional Scheme Price Discount",
|
"name": "Promotional Scheme Price Discount",
|
||||||
|
|||||||
@@ -19,6 +19,7 @@ class PromotionalSchemePriceDiscount(Document):
|
|||||||
disable: DF.Check
|
disable: DF.Check
|
||||||
discount_amount: DF.Currency
|
discount_amount: DF.Currency
|
||||||
discount_percentage: DF.Float
|
discount_percentage: DF.Float
|
||||||
|
for_price_list: DF.Link | None
|
||||||
max_amount: DF.Currency
|
max_amount: DF.Currency
|
||||||
max_qty: DF.Float
|
max_qty: DF.Float
|
||||||
min_amount: DF.Currency
|
min_amount: DF.Currency
|
||||||
|
|||||||
@@ -22,6 +22,7 @@
|
|||||||
"column_break_9",
|
"column_break_9",
|
||||||
"free_item_uom",
|
"free_item_uom",
|
||||||
"free_item_rate",
|
"free_item_rate",
|
||||||
|
"round_free_qty",
|
||||||
"section_break_12",
|
"section_break_12",
|
||||||
"warehouse",
|
"warehouse",
|
||||||
"threshold_percentage",
|
"threshold_percentage",
|
||||||
@@ -181,12 +182,22 @@
|
|||||||
"fieldtype": "Float",
|
"fieldtype": "Float",
|
||||||
"label": "Apply Recursion Over (As Per Transaction UOM)",
|
"label": "Apply Recursion Over (As Per Transaction UOM)",
|
||||||
"mandatory_depends_on": "is_recursive"
|
"mandatory_depends_on": "is_recursive"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"default": "0",
|
||||||
|
"fieldname": "round_free_qty",
|
||||||
|
"fieldtype": "Check",
|
||||||
|
"label": "Round Free Qty"
|
||||||
}
|
}
|
||||||
],
|
],
|
||||||
"index_web_pages_for_search": 1,
|
"index_web_pages_for_search": 1,
|
||||||
"istable": 1,
|
"istable": 1,
|
||||||
"links": [],
|
"links": [],
|
||||||
|
<<<<<<< HEAD
|
||||||
"modified": "2024-03-12 12:53:58.199108",
|
"modified": "2024-03-12 12:53:58.199108",
|
||||||
|
=======
|
||||||
|
"modified": "2024-07-22 17:25:07.880984",
|
||||||
|
>>>>>>> 8624aeca54 (fix: promotional scheme doctype fields in consitency with pricing rule (#42432))
|
||||||
"modified_by": "Administrator",
|
"modified_by": "Administrator",
|
||||||
"module": "Accounts",
|
"module": "Accounts",
|
||||||
"name": "Promotional Scheme Product Discount",
|
"name": "Promotional Scheme Product Discount",
|
||||||
@@ -195,4 +206,4 @@
|
|||||||
"sort_field": "modified",
|
"sort_field": "modified",
|
||||||
"sort_order": "DESC",
|
"sort_order": "DESC",
|
||||||
"states": []
|
"states": []
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -53,6 +53,7 @@ class PromotionalSchemeProductDiscount(Document):
|
|||||||
"20",
|
"20",
|
||||||
]
|
]
|
||||||
recurse_for: DF.Float
|
recurse_for: DF.Float
|
||||||
|
round_free_qty: DF.Check
|
||||||
rule_description: DF.SmallText
|
rule_description: DF.SmallText
|
||||||
same_item: DF.Check
|
same_item: DF.Check
|
||||||
threshold_percentage: DF.Percent
|
threshold_percentage: DF.Percent
|
||||||
|
|||||||
Reference in New Issue
Block a user