Point of Sale mailing list archives

pos@odoo-community.org

Avatar

Re: [OCA/pos] [12.0] ADD pos_product_multi_price: Make pricelists based on product_multi_price work in point of sale (#541)

by "Lorenzo Battistini" <notifications@github.com> - 08/04/2021 17:06:26

@eLBati commented on this pull request.


In pos_product_multi_price/static/src/js/models.js:

> +        _.find(pricelist_items, function (rule) {
+            if (rule.min_quantity && quantity < rule.min_quantity) {
+                return false;
+            }
+            if (rule.base === 'multi_price' && rule.compute_price == 'formula') {
+                _.forEach(price_ids_json, function (multi_price) {
+                    if (multi_price.price_id == rule.multi_price_name[0]) {
+                        price = multi_price.price;
+                        var price_limit = price;
+                        price = price - (price * (rule.price_discount / 100));
+                        if (rule.price_round) {
+                            price = round_pr(price, rule.price_round);
+                        }
+                        if (rule.price_surcharge) {
+                            price += rule.price_surcharge;
+                        }
+                        if (rule.price_min_margin) {
+                            price = Math.max(price, price_limit + rule.price_min_margin);
+                        }
+                        if (rule.price_max_margin) {
+                            price = Math.min(price, price_limit + rule.price_max_margin);
+                        }
+                        return true;
+                    }
+                });
+            }
+            return false
+        });

Doesn't the same happen with product_multi_price?


You are receiving this because you are on a team that was mentioned.
Reply to this email directly, view it on GitHub, or unsubscribe.