Skip to content

Commit ca63b1b

Browse files
committed
Merge branch 'release/1.2.7'
2 parents b3ef194 + ca1dd47 commit ca63b1b

File tree

11 files changed

+6851
-59
lines changed

11 files changed

+6851
-59
lines changed

README.md

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -3,11 +3,11 @@
33
**Donate Link:** http://tareq.co/donate/
44
**Tags:** WooCommerce POS, point of sale, free pos, pos plugin, woocommerce point of sale
55
**Requires at least:** 5.4
6-
**Tested up to:** 6.1.1
6+
**Tested up to:** 6.4.2
77
**WC requires at least:** 5.0.0
8-
**WC tested up to:** 7.2.2
8+
**WC tested up to:** 8.4.0
99
**Requires PHP:** 7.2
10-
**Stable tag:** 1.2.6
10+
**Stable tag:** 1.2.7
1111
**License:** GPLv2 or later
1212
**License URI:** http://www.gnu.org/licenses/gpl-2.0.html
1313

@@ -60,6 +60,9 @@ No FAQ
6060

6161
## Changelog ##
6262

63+
### v1.2.7 -> 27 December, 2023 ###
64+
- **Enhancement:** Tax calculation implementation based on discounts and fees instead of base price of products
65+
6366
### v1.2.6 -> 30 December, 2022 ###
6467
- **New:** Integrated Vue date range picker, select2 and Vue chart JS packages
6568
- **New:** Added helper methods for getting day JS and date range picker date formats

assets/js/admin.js

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

assets/js/admin.min.js

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

assets/js/frontend.js

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

assets/js/frontend.min.js

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

assets/src/utils/store/modules/Cart.module.js

Lines changed: 22 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -53,28 +53,37 @@ export default {
5353
return taxLineTotal;
5454
},
5555
getTotalTax( state ) {
56-
var self = this,
56+
let self = this,
5757
taxLineTotal = 0,
5858
taxFeeTotal = 0;
5959
weLo_.forEach( state.cartdata.line_items, function( item, key ) {
6060
taxLineTotal += Math.abs( item.tax_amount * item.quantity );
61-
});
61+
} );
6262

6363
if ( state.settings.woo_tax != undefined && state.settings.woo_tax.wc_tax_display_cart == 'incl' ) {
6464
taxLineTotal = 0;
6565
}
6666

6767
weLo_.forEach( state.cartdata.fee_lines, function( item, key ) {
68-
if ( item.type == 'fee' ) {
69-
if ( item.tax_status == 'taxable' ) {
70-
var itemTaxClass = item.tax_class === '' ? 'standard' : item.tax_class;
71-
var taxClass = weLo_.find( state.availableTax, { 'class' : itemTaxClass.toString() } );
72-
if ( taxClass !== undefined ) {
73-
taxFeeTotal += ( Math.abs(item.total)*Math.abs( taxClass.rate ) )/100;
74-
}
75-
}
68+
if ( item.tax_status !== 'taxable' ) {
69+
return;
7670
}
77-
});
71+
72+
let itemTaxClass = item.tax_class === '' ? 'standard' : item.tax_class;
73+
let taxClass = weLo_.find( state.availableTax, { 'class' : itemTaxClass.toString() } );
74+
75+
if ( ! taxClass ) {
76+
return;
77+
}
78+
79+
if ( item.type === 'discount' ) {
80+
taxLineTotal += item.total / taxClass.rate;
81+
}
82+
83+
if ( item.type === 'fee' ) {
84+
taxFeeTotal += ( Math.abs( item.total ) * Math.abs( taxClass.rate ) ) / 100;
85+
}
86+
} );
7887

7988
return taxLineTotal + taxFeeTotal;
8089
},
@@ -170,7 +179,7 @@ export default {
170179
value: discountData.value.toString(),
171180
isEdit: false,
172181
discount_type: discountData.type,
173-
tax_status: 'none',
182+
tax_status: 'taxable',
174183
tax_class: '',
175184
total: 0
176185
});
@@ -183,7 +192,7 @@ export default {
183192
value: feeData.value.toString(),
184193
isEdit: false,
185194
fee_type: feeData.type,
186-
tax_status: 'none',
195+
tax_status: 'taxable',
187196
tax_class: '',
188197
total: 0
189198
});

languages/wepos.pot

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,14 +1,14 @@
1-
# Copyright (C) 2022 weDevs
1+
# Copyright (C) 2023 weDevs
22
# This file is distributed under the GPL2.
33
msgid ""
44
msgstr ""
5-
"Project-Id-Version: wePOS - Point Of Sale (POS) for WooCommerce 1.2.6\n"
5+
"Project-Id-Version: wePOS - Point Of Sale (POS) for WooCommerce 1.2.7\n"
66
"Report-Msgid-Bugs-To: https://wordpress.org/support/plugin/wepos\n"
7-
"POT-Creation-Date: 2022-12-30 09:08:57+00:00\n"
7+
"POT-Creation-Date: 2023-12-27 04:21:05+00:00\n"
88
"MIME-Version: 1.0\n"
99
"Content-Type: text/plain; charset=utf-8\n"
1010
"Content-Transfer-Encoding: 8bit\n"
11-
"PO-Revision-Date: 2022-MO-DA HO:MI+ZONE\n"
11+
"PO-Revision-Date: 2023-MO-DA HO:MI+ZONE\n"
1212
"Last-Translator: FULL NAME <EMAIL@ADDRESS>\n"
1313
"Language-Team: LANGUAGE <[email protected]>\n"
1414
"X-Generator: wp-vue-i18n 1.1.4\n"

0 commit comments

Comments
 (0)