From 0bebc9b303562c63779e189fe1f167df14f5a10d Mon Sep 17 00:00:00 2001 From: Yousef Date: Sat, 17 Jun 2023 22:40:56 +0200 Subject: [PATCH] fix: item qty format --- .../js/posapp/components/payments/Pay.vue | 6 ----- .../js/posapp/components/pos/Invoice.vue | 2 +- .../posapp/components/pos/ItemsSelector.vue | 6 ----- .../js/posapp/components/pos/Payments.vue | 6 ----- .../public/js/posapp/components/pos/Pos.vue | 2 +- posawesome/public/js/posapp/format.js | 22 ++++++++++++++----- 6 files changed, 19 insertions(+), 25 deletions(-) diff --git a/posawesome/public/js/posapp/components/payments/Pay.vue b/posawesome/public/js/posapp/components/payments/Pay.vue index 8d22f5a7..a24ab90d 100644 --- a/posawesome/public/js/posapp/components/payments/Pay.vue +++ b/posawesome/public/js/posapp/components/payments/Pay.vue @@ -354,8 +354,6 @@ export default { customer_name: '', customer_info: '', company: '', - float_precision: 2, - currency_precision: 2, singleSelect: false, invoices_loading: false, unallocated_payments_loading: false, @@ -777,10 +775,6 @@ export default { mounted: function () { this.$nextTick(function () { - this.float_precision = - frappe.defaults.get_default('float_precision') || 2; - this.currency_precision = - frappe.defaults.get_default('currency_precision') || 2; this.check_opening_entry(); evntBus.$on('update_customer', (customer_name) => { this.clear_all(true); diff --git a/posawesome/public/js/posapp/components/pos/Invoice.vue b/posawesome/public/js/posapp/components/pos/Invoice.vue index 7d57994d..32863463 100644 --- a/posawesome/public/js/posapp/components/pos/Invoice.vue +++ b/posawesome/public/js/posapp/components/pos/Invoice.vue @@ -243,7 +243,7 @@ :value="formtFloat(item.qty)" @change=" [ - setFormatedCurrency(item, 'qty', null, false, $event), + setFormatedFloat(item, 'qty', null, false, $event), calc_stock_qty(item, $event), ] " diff --git a/posawesome/public/js/posapp/components/pos/ItemsSelector.vue b/posawesome/public/js/posapp/components/pos/ItemsSelector.vue index ee3a4036..9a35104a 100644 --- a/posawesome/public/js/posapp/components/pos/ItemsSelector.vue +++ b/posawesome/public/js/posapp/components/pos/ItemsSelector.vue @@ -188,8 +188,6 @@ export default { couponsCount: 0, appliedCouponsCount: 0, customer_price_list: null, - float_precision: 2, - currency_precision: 2, new_line: false, qty: 1, }), @@ -610,10 +608,6 @@ export default { this.pos_profile = data.pos_profile; this.get_items(); this.get_items_groups(); - this.float_precision = - frappe.defaults.get_default('float_precision') || 2; - this.currency_precision = - frappe.defaults.get_default('currency_precision') || 2; this.items_view = this.pos_profile.posa_default_card_view ? 'card' : 'list'; diff --git a/posawesome/public/js/posapp/components/pos/Payments.vue b/posawesome/public/js/posapp/components/pos/Payments.vue index 2f56dff0..9490bf2c 100644 --- a/posawesome/public/js/posapp/components/pos/Payments.vue +++ b/posawesome/public/js/posapp/components/pos/Payments.vue @@ -715,8 +715,6 @@ export default { pos_settings: '', customer_info: '', mpesa_modes: [], - float_precision: 2, - currency_precision: 2, }), methods: { @@ -1311,10 +1309,6 @@ export default { evntBus.$on('register_pos_profile', (data) => { this.pos_profile = data.pos_profile; this.get_mpesa_modes(); - this.float_precision = - frappe.defaults.get_default('float_precision') || 2; - this.currency_precision = - frappe.defaults.get_default('currency_precision') || 2; }); evntBus.$on('add_the_new_address', (data) => { this.addresses.push(data); diff --git a/posawesome/public/js/posapp/components/pos/Pos.vue b/posawesome/public/js/posapp/components/pos/Pos.vue index 10521c3d..fc3e9128 100644 --- a/posawesome/public/js/posapp/components/pos/Pos.vue +++ b/posawesome/public/js/posapp/components/pos/Pos.vue @@ -1,5 +1,5 @@