Browse Source

Jun 06: [FIX] Bug Fixed 'advanced_loyalty_management'

pull/313/merge
Cybrosys Technologies 3 weeks ago
parent
commit
e9f3ee71c7
  1. 7
      advanced_loyalty_management/doc/RELEASE_NOTES.md
  2. 51
      advanced_loyalty_management/static/src/js/pos_loyalty_card.js

7
advanced_loyalty_management/doc/RELEASE_NOTES.md

@ -14,4 +14,9 @@
#### 08.01.2025 #### 08.01.2025
#### Version 17.0.1.0.2 #### Version 17.0.1.0.2
#### ADD #### ADD
- BUG FIX - BUG FIX
#### 03.06.2025
#### Version 17.0.1.0.2
#### BUG FIX
- Super was called in the function override.

51
advanced_loyalty_management/static/src/js/pos_loyalty_card.js

@ -137,6 +137,7 @@ patch(Order.prototype,{
}, },
export_as_JSON() { export_as_JSON() {
const json = super.export_as_JSON(...arguments);
//when change is converted the amount returned is changed //when change is converted the amount returned is changed
var orderLines, paymentLines; var orderLines, paymentLines;
orderLines = []; orderLines = [];
@ -150,31 +151,31 @@ patch(Order.prototype,{
return paymentLines.push([0, 0, itemAsJson]); return paymentLines.push([0, 0, itemAsJson]);
} }
}); });
var json = { json.name = this.get_name();
name: this.get_name(), json.amount_paid = this.get_total_paid() - this.get_change();
amount_paid: this.get_total_paid() - this.get_change(), json.amount_total = this.get_total_with_tax();
amount_total: this.get_total_with_tax(), json.amount_tax = this.get_total_tax();
amount_tax: this.get_total_tax(), json.amount_return = this.get_total_paid() - this.get_total_with_tax() - this.get_rounding_applied();
amount_return: this.get_total_paid() - this.get_total_with_tax() - this.get_rounding_applied(), json.lines = orderLines;
lines: orderLines, json.statement_ids = paymentLines;
statement_ids: paymentLines, json.pos_session_id = this.pos_session_id;
pos_session_id: this.pos_session_id, json.pricelist_id = this.pricelist ? this.pricelist.id : false;
pricelist_id: this.pricelist ? this.pricelist.id : false, json.partner_id = this.get_partner() ? this.get_partner().id : false;
partner_id: this.get_partner() ? this.get_partner().id : false, json.user_id = this.pos.user.id;
user_id: this.pos.user.id, json.uid = this.uid;
uid: this.uid, json.sequence_number = this.sequence_number;
sequence_number: this.sequence_number, json.date_order = serializeDateTime(this.date_order);
date_order: serializeDateTime(this.date_order), json.fiscal_position_id = this.fiscal_position ? this.fiscal_position.id : false;
fiscal_position_id: this.fiscal_position ? this.fiscal_position.id : false, json.server_id = this.server_id ? this.server_id : false;
server_id: this.server_id ? this.server_id : false, json.to_invoice = this.to_invoice ? this.to_invoice : false;
to_invoice: this.to_invoice ? this.to_invoice : false, json.shipping_date = this.shippingDate ? this.shippingDate : false;
shipping_date: this.shippingDate ? this.shippingDate : false, json.is_tipped = this.is_tipped || false;
is_tipped: this.is_tipped || false, json.tip_amount = this.tip_amount || 0;
tip_amount: this.tip_amount || 0, json.access_token = this.access_token || "";
access_token: this.access_token || "", json.last_order_preparation_change = JSON.stringify(this.lastOrderPrepaChange);
last_order_preparation_change: JSON.stringify(this.lastOrderPrepaChange), json.ticket_code = this.ticketCode || "";
ticket_code: this.ticketCode || "",
};
if (!this.is_paid && this.user_id) { if (!this.is_paid && this.user_id) {
json.user_id = this.user_id; json.user_id = this.user_id;
} }

Loading…
Cancel
Save