Commit 8c470aae by Damien Moulard

better detection of meal voucher payment lines

parent 87ebf8c9
...@@ -42,13 +42,13 @@ odoo.define("pos_meal_voucher.models", function (require) { ...@@ -42,13 +42,13 @@ odoo.define("pos_meal_voucher.models", function (require) {
var paymentlines = []; var paymentlines = [];
// Add fork&knife symbol on pos ticket for product with meal voucher allowed & when meal voucher is used // Add fork&knife symbol on pos ticket for products with meal voucher allowed & when meal voucher is used
var meal_voucher_used = false; var meal_voucher_used = false;
this.paymentlines.each(function(paymentline){ this.paymentlines.each(function(paymentline){
var line = paymentline.export_for_printing(); var line = paymentline.export_for_printing();
paymentlines.push(line); paymentlines.push(line);
if (line.journal.toLowerCase().includes("dej") || line.journal.toLowerCase().includes("déj")) { if (paymentline.is_meal_voucher()) {
meal_voucher_used = true; meal_voucher_used = true;
} }
}); });
......
...@@ -168,8 +168,7 @@ odoo.define("pos_meal_voucher.screens", function (require) { ...@@ -168,8 +168,7 @@ odoo.define("pos_meal_voucher.screens", function (require) {
// Add fork&knife symbol on pos ticket for product with meal voucher allowed & when meal voucher is used // Add fork&knife symbol on pos ticket for product with meal voucher allowed & when meal voucher is used
var meal_voucher_used = false; var meal_voucher_used = false;
for (var i = 0; i < paymentlines.length; i++) { for (var i = 0; i < paymentlines.length; i++) {
var line = paymentlines[i].export_for_printing(); if (paymentlines[i].is_meal_voucher()) {
if (line.journal.toLowerCase().includes("dej") || line.journal.toLowerCase().includes("déj")) {
meal_voucher_used = true; meal_voucher_used = true;
break; break;
} }
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment