Skip to content

Commit

Permalink
fix: promotional scheme doctype fields in consitency with pricing rule (
Browse files Browse the repository at this point in the history
#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 commit 8624aec)

# 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
  • Loading branch information
ljain112 authored and mergify[bot] committed Jul 31, 2024
1 parent 7dc68ca commit 87d8603
Show file tree
Hide file tree
Showing 6 changed files with 40 additions and 1 deletion.
12 changes: 12 additions & 0 deletions erpnext/accounts/doctype/promotional_scheme/promotional_scheme.js
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,18 @@
// For license information, please see license.txt

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) {
frm.trigger("set_options_for_applicable_for");
frm.trigger("toggle_reqd_apply_on");
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -51,6 +51,7 @@
"discount_percentage",
"validate_applied_rule",
"apply_multiple_pricing_rules",
"for_price_list",
]

product_discount_fields = [
Expand All @@ -63,6 +64,7 @@
"recurse_for",
"apply_recursion_over",
"apply_multiple_pricing_rules",
"round_free_qty",
]


Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,7 @@
"rate",
"discount_amount",
"discount_percentage",
"for_price_list",
"section_break_11",
"warehouse",
"threshold_percentage",
Expand Down Expand Up @@ -120,6 +121,13 @@
"fieldtype": "Float",
"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",
"fieldtype": "Section Break"
Expand Down Expand Up @@ -169,7 +177,11 @@
"index_web_pages_for_search": 1,
"istable": 1,
"links": [],
<<<<<<< HEAD
"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",
"module": "Accounts",
"name": "Promotional Scheme Price Discount",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,7 @@ class PromotionalSchemePriceDiscount(Document):
disable: DF.Check
discount_amount: DF.Currency
discount_percentage: DF.Float
for_price_list: DF.Link | None
max_amount: DF.Currency
max_qty: DF.Float
min_amount: DF.Currency
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,7 @@
"column_break_9",
"free_item_uom",
"free_item_rate",
"round_free_qty",
"section_break_12",
"warehouse",
"threshold_percentage",
Expand Down Expand Up @@ -181,12 +182,22 @@
"fieldtype": "Float",
"label": "Apply Recursion Over (As Per Transaction UOM)",
"mandatory_depends_on": "is_recursive"
},
{
"default": "0",
"fieldname": "round_free_qty",
"fieldtype": "Check",
"label": "Round Free Qty"
}
],
"index_web_pages_for_search": 1,
"istable": 1,
"links": [],
<<<<<<< HEAD
"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",
"module": "Accounts",
"name": "Promotional Scheme Product Discount",
Expand All @@ -195,4 +206,4 @@
"sort_field": "modified",
"sort_order": "DESC",
"states": []
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -53,6 +53,7 @@ class PromotionalSchemeProductDiscount(Document):
"20",
]
recurse_for: DF.Float
round_free_qty: DF.Check
rule_description: DF.SmallText
same_item: DF.Check
threshold_percentage: DF.Percent
Expand Down

0 comments on commit 87d8603

Please sign in to comment.