From e9f3ee71c7b7c7094cff859b2dd8ebd96833d627 Mon Sep 17 00:00:00 2001 From: Cybrosys Technologies Date: Fri, 6 Jun 2025 15:40:51 +0530 Subject: [PATCH] Jun 06: [FIX] Bug Fixed 'advanced_loyalty_management' --- .../doc/RELEASE_NOTES.md | 7 ++- .../static/src/js/pos_loyalty_card.js | 51 ++++++++++--------- 2 files changed, 32 insertions(+), 26 deletions(-) diff --git a/advanced_loyalty_management/doc/RELEASE_NOTES.md b/advanced_loyalty_management/doc/RELEASE_NOTES.md index 1710b9cf5..63250c6cc 100644 --- a/advanced_loyalty_management/doc/RELEASE_NOTES.md +++ b/advanced_loyalty_management/doc/RELEASE_NOTES.md @@ -14,4 +14,9 @@ #### 08.01.2025 #### Version 17.0.1.0.2 #### ADD -- BUG FIX \ No newline at end of file +- BUG FIX + +#### 03.06.2025 +#### Version 17.0.1.0.2 +#### BUG FIX +- Super was called in the function override. \ No newline at end of file diff --git a/advanced_loyalty_management/static/src/js/pos_loyalty_card.js b/advanced_loyalty_management/static/src/js/pos_loyalty_card.js index 92822a836..4e4473e40 100644 --- a/advanced_loyalty_management/static/src/js/pos_loyalty_card.js +++ b/advanced_loyalty_management/static/src/js/pos_loyalty_card.js @@ -137,6 +137,7 @@ patch(Order.prototype,{ }, export_as_JSON() { + const json = super.export_as_JSON(...arguments); //when change is converted the amount returned is changed var orderLines, paymentLines; orderLines = []; @@ -150,31 +151,31 @@ patch(Order.prototype,{ return paymentLines.push([0, 0, itemAsJson]); } }); - var json = { - name: this.get_name(), - amount_paid: this.get_total_paid() - this.get_change(), - amount_total: this.get_total_with_tax(), - amount_tax: this.get_total_tax(), - amount_return: this.get_total_paid() - this.get_total_with_tax() - this.get_rounding_applied(), - lines: orderLines, - statement_ids: paymentLines, - pos_session_id: this.pos_session_id, - pricelist_id: this.pricelist ? this.pricelist.id : false, - partner_id: this.get_partner() ? this.get_partner().id : false, - user_id: this.pos.user.id, - uid: this.uid, - sequence_number: this.sequence_number, - date_order: serializeDateTime(this.date_order), - fiscal_position_id: this.fiscal_position ? this.fiscal_position.id : false, - server_id: this.server_id ? this.server_id : false, - to_invoice: this.to_invoice ? this.to_invoice : false, - shipping_date: this.shippingDate ? this.shippingDate : false, - is_tipped: this.is_tipped || false, - tip_amount: this.tip_amount || 0, - access_token: this.access_token || "", - last_order_preparation_change: JSON.stringify(this.lastOrderPrepaChange), - ticket_code: this.ticketCode || "", - }; + json.name = this.get_name(); + json.amount_paid = this.get_total_paid() - this.get_change(); + json.amount_total = this.get_total_with_tax(); + json.amount_tax = this.get_total_tax(); + json.amount_return = this.get_total_paid() - this.get_total_with_tax() - this.get_rounding_applied(); + json.lines = orderLines; + json.statement_ids = paymentLines; + json.pos_session_id = this.pos_session_id; + json.pricelist_id = this.pricelist ? this.pricelist.id : false; + json.partner_id = this.get_partner() ? this.get_partner().id : false; + json.user_id = this.pos.user.id; + json.uid = this.uid; + json.sequence_number = this.sequence_number; + json.date_order = serializeDateTime(this.date_order); + json.fiscal_position_id = this.fiscal_position ? this.fiscal_position.id : false; + json.server_id = this.server_id ? this.server_id : false; + json.to_invoice = this.to_invoice ? this.to_invoice : false; + json.shipping_date = this.shippingDate ? this.shippingDate : false; + json.is_tipped = this.is_tipped || false; + json.tip_amount = this.tip_amount || 0; + json.access_token = this.access_token || ""; + json.last_order_preparation_change = JSON.stringify(this.lastOrderPrepaChange); + json.ticket_code = this.ticketCode || ""; + + if (!this.is_paid && this.user_id) { json.user_id = this.user_id; }