@@ -619,6 +666,7 @@ export default {
availableGatewayContent: wepos.hooks.applyFilters( 'wepos_avaialable_gateway_content', [] ),
afterMainContents: wepos.hooks.applyFilters( 'wepos_after_main_content', [] ),
beforCartPanels: wepos.hooks.applyFilters( 'wepos_before_cart_panel', [] ),
+ couponData: {},
}
},
computed: {
@@ -792,6 +840,7 @@ export default {
shipping: this.orderdata.shipping,
line_items: this.cartdata.line_items,
fee_lines: this.cartdata.fee_lines,
+ coupon_lines: this.cartdata.coupon_lines,
customer_id: this.orderdata.customer_id,
customer_note: this.orderdata.customer_note,
payment_method: this.orderdata.payment_method,
@@ -817,6 +866,19 @@ export default {
wepos.api.post( wepos.rest.root + wepos.rest.wcversion + '/orders', orderdata )
.done( response => {
+ const orderResult = response;
+ const totalTaxes = {};
+
+ // Looping through line items and get total tax for each items.
+ orderResult.line_items.forEach( item => {
+ totalTaxes[item.product_id] = item.total_tax
+ } );
+
+ // Preserve total tax amount for each of the line items to the cart.
+ this.cartdata.line_items.forEach( item => {
+ item.total_tax = totalTaxes[ item.product_id ];
+ } );
+
wepos.api.post( wepos.rest.root + wepos.rest.posversion + '/payment/process', response )
.done( data => {
if ( data.result == 'success' ) {
@@ -830,6 +892,7 @@ export default {
this.printdata = wepos.hooks.applyFilters( 'wepos_after_payment_print_data', {
line_items: this.cartdata.line_items,
fee_lines: this.cartdata.fee_lines,
+ coupon_lines: this.cartdata.coupon_lines,
subtotal: this.$store.getters['Cart/getSubtotal'],
taxtotal: this.$store.getters['Cart/getTotalTax'],
ordertotal: this.$store.getters['Cart/getTotal'],
@@ -837,7 +900,7 @@ export default {
id: response.payment_method,
title: response.payment_method_title
},
- order_id: response.id,
+ order_id: response.number,
order_date: response.date_created,
cashamount: this.cashAmount.toString(),
changeamount: this.changeAmount.toString()
@@ -881,7 +944,49 @@ export default {
return ( product.images.length > 0 ) ? product.images[0].name : product.name;
},
setDiscount( value, type ) {
- this.$store.dispatch( 'Cart/addDiscountAction', { title: this.__( 'Discount', 'wepos' ), value: value, type: type } );
+ this.createCoupon( value, type, this.dispatchCoupon );
+ },
+ createCoupon( amount, discount_type, callback ) {
+ let self = this;
+ let id = Date.now();
+ let code = discount_type + id + amount;
+
+ self.couponData = {};
+
+ const discountdata = {
+ code: code,
+ amount: amount,
+ usage_limit: 1,
+ meta_data : [
+ {
+ key: 'wepos_cart_discount',
+ value: 'yes',
+ },
+ ],
+ }
+
+ if ( 'percent' === discount_type ) {
+ discountdata.discount_type = discount_type;
+ }
+
+ wepos.api.post( wepos.rest.root + wepos.rest.posversion + '/coupons', discountdata )
+ .done( data => {
+ self.couponData = data;
+
+ callback( data, discount_type );
+ } ).fail( data => {
+ alert( data.responseJSON.message );
+ } );
+ },
+ dispatchCoupon( couponData, type ) {
+ this.$store.dispatch(
+ 'Cart/addDiscountAction',
+ {
+ title: this.__( 'Discount', 'wepos' ),
+ value: couponData,
+ type
+ }
+ );
},
saveFee( key ) {
this.$store.dispatch( 'Cart/saveFeeValueAction', { key: key, feeData: this.feeData } );
@@ -901,6 +1006,9 @@ export default {
setFee( value, type ) {
this.$store.dispatch( 'Cart/addFeeAction', { title: this.__( 'Fee', 'wepos' ), value: value, type: type } );
},
+ removeCouponLine( key ) {
+ this.$store.dispatch( 'Cart/removeCouponLineItemsAction', key );
+ },
removeFeeLine( key ) {
this.$store.dispatch( 'Cart/removeFeeLineItemsAction', key );
},
diff --git a/assets/src/frontend/components/PrintReceiptHtml.vue b/assets/src/frontend/components/PrintReceiptHtml.vue
index e2860e6e..643d8de1 100644
--- a/assets/src/frontend/components/PrintReceiptHtml.vue
+++ b/assets/src/frontend/components/PrintReceiptHtml.vue
@@ -12,9 +12,12 @@
{{ item.name }}
+ {{ __( 'Tax includes', 'wepos' ) }}: {{ formatPrice( item.total_tax ) }}
- - {{ attribute_item.name }}: {{ attribute_item.option }}
+ -
+ {{ attribute_item.name }}: {{ attribute_item.option }}
+
|
@@ -33,23 +36,21 @@
{{ __( 'Subtotal', 'wepos' ) }}
- {{ __( 'Includes Tax', 'wepos' ) }} {{ formatPrice( $store.getters['Cart/getTotalLineTax'] ) }}
+ {{ __( 'Including Tax', 'wepos' ) }}
|
{{ formatPrice( printdata.subtotal ) }} |
+
+ {{ __( 'Discount', 'wepos' ) }} {{ fee.discount_type == 'percent' ? fee.value + '%' : formatPrice( fee.value ) }} |
+ -{{ formatPrice( Math.abs( fee.total ) ) }} |
+
-
- {{ __( 'Discount', 'wepos' ) }} {{ fee.discount_type == 'percent' ? fee.value + '%' : formatPrice( fee.value ) }} |
- -{{ formatPrice( Math.abs( fee.total ) ) }} |
-
-
- {{ __( 'Fee', 'wepos' ) }} {{ fee.name }} {{ fee.fee_type == 'percent' ? fee.value + '%' : formatPrice( fee.value ) }} |
- -{{ formatPrice( Math.abs( fee.total ) ) }} |
-
+ {{ __( 'Fee', 'wepos' ) }} {{ fee.fee_type == 'percent' ? fee.value + '%' : formatPrice( fee.value ) }} |
+ {{ formatPrice( Math.abs( fee.total ) ) }} |
- {{ __( 'Tax', 'wepos' ) }} |
+ {{ settings.woo_tax.wc_tax_display_cart === 'incl' && settings.wepos_general.enable_fee_tax === 'yes' ? __( 'Fee Tax', 'wepos' ) : __( 'Tax', 'wepos' ) }} |
{{ formatPrice(printdata.taxtotal) }} |
@@ -126,8 +127,8 @@ export default {
}
.wepos-checkout-print-wrapper {
- color: #000;
- font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, "Liberation Mono", "Courier New", monospace;
+ color: #000000;
+ font-family: Helvetica, Verdana, Calibri, Arial, "Franklin Gothic", sans-serif !important;
display: inline-block !important;
}
@@ -166,6 +167,11 @@ export default {
&.name {
width: 60%;
font-weight: bold;
+ .tax-info {
+ display: block;
+ font-size: 13px;
+ font-weight: 400;
+ }
.attribute {
margin-top: 2px;
ul {
diff --git a/assets/src/utils/store/modules/Cart.module.js b/assets/src/utils/store/modules/Cart.module.js
index e243c476..04dbf0e4 100644
--- a/assets/src/utils/store/modules/Cart.module.js
+++ b/assets/src/utils/store/modules/Cart.module.js
@@ -8,6 +8,7 @@ export default {
cartdata : {
line_items: [],
fee_lines: [],
+ coupon_lines: [],
}
},
getters: {
@@ -26,18 +27,14 @@ export default {
getTotalFee( state ) {
var fee = 0;
weLo_.forEach( state.cartdata.fee_lines, function( item, key ) {
- if ( item.type == 'fee' ) {
- fee += Math.abs( item.total )
- }
+ fee += Math.abs( item.total );
});
return fee;
},
getTotalDiscount( state ) {
var discount = 0;
- weLo_.forEach( state.cartdata.fee_lines, function( item, key ) {
- if ( item.type == 'discount' ) {
- discount += Number( Math.abs( item.total ) );
- }
+ weLo_.forEach( state.cartdata.coupon_lines, function( item, key ) {
+ discount += Number( Math.abs( item.total ) );
});
return discount;
@@ -52,10 +49,13 @@ export default {
return taxLineTotal;
},
- getTotalTax( state ) {
+ getTotalTax( state, getters ) {
let self = this,
taxLineTotal = 0,
- taxFeeTotal = 0;
+ taxFeeTotal = 0,
+ discountPercentage = 0,
+ couponTaxDiscount = 0;
+
weLo_.forEach( state.cartdata.line_items, function( item, key ) {
taxLineTotal += Math.abs( item.tax_amount * item.quantity );
} );
@@ -76,15 +76,28 @@ export default {
return;
}
- if ( item.type === 'discount' ) {
- taxLineTotal += item.total / taxClass.rate;
+ taxFeeTotal += ( Math.abs( item.total ) * Math.abs( taxClass.rate ) ) / 100;
+ } );
+
+ weLo_.forEach( state.cartdata.coupon_lines, function( item, key ) {
+ if ( item.tax_status !== 'taxable' ) {
+ return;
}
- if ( item.type === 'fee' ) {
- taxFeeTotal += ( Math.abs( item.total ) * Math.abs( taxClass.rate ) ) / 100;
+ let itemTaxClass = item.tax_class === '' ? 'standard' : item.tax_class;
+ let taxClass = weLo_.find( state.availableTax, { 'class' : itemTaxClass.toString() } );
+
+ if ( ! taxClass ) {
+ return;
}
+
+ discountPercentage = ( item.total / getters.getSubtotal ) * 100;
+
+ couponTaxDiscount += ( discountPercentage / 100 ) * taxLineTotal;
} );
+ taxLineTotal += couponTaxDiscount;
+
return taxLineTotal + taxFeeTotal;
},
getOrderTotal( state, getters ) {
@@ -111,6 +124,7 @@ export default {
state.cartdata = {
line_items: [],
fee_lines: [],
+ coupon_lines: [],
}
} else {
state.cartdata = Object.assign( {}, cartdata );
@@ -173,15 +187,16 @@ export default {
},
addDiscount( state, discountData ) {
- state.cartdata.fee_lines.push({
+ state.cartdata.coupon_lines.push({
name: discountData.title,
type: 'discount',
- value: discountData.value.toString(),
isEdit: false,
- discount_type: discountData.type,
- tax_status: 'taxable',
+ value: discountData.value.amount,
+ discount_type: discountData.value.discount_type,
+ tax_status: 'incl' !== state.settings.woo_tax.wc_tax_display_shop ? 'taxable' : 'none',
tax_class: '',
- total: 0
+ total: 0,
+ code: discountData.value.code,
});
},
@@ -192,9 +207,9 @@ export default {
value: feeData.value.toString(),
isEdit: false,
fee_type: feeData.type,
- tax_status: 'taxable',
+ tax_status: 'yes' === state.settings.wepos_general.enable_fee_tax ? 'taxable' : 'none',
tax_class: '',
- total: 0
+ total: 0,
});
},
@@ -211,6 +226,10 @@ export default {
state.cartdata.fee_lines[itemKey].isEdit = false;
},
+ removeCouponLineItems( state, itemKey ) {
+ state.cartdata.coupon_lines.splice( itemKey, 1 );
+ },
+
removeFeeLineItems( state, itemKey ) {
state.cartdata.fee_lines.splice( itemKey, 1 );
},
@@ -219,16 +238,17 @@ export default {
state.cartdata = {
line_items: [],
fee_lines: [],
+ coupon_lines: [],
};
},
calculateDiscount( state, payload ) {
- if ( state.cartdata.fee_lines.length > 0 ) {
- weLo_.forEach( state.cartdata.fee_lines, ( item, key ) => {
+ if ( state.cartdata.coupon_lines.length > 0 ) {
+ weLo_.forEach( state.cartdata.coupon_lines, ( item, key ) => {
if ( item.type == "discount" ) {
if ( item.discount_type == 'percent' ) {
- state.cartdata.fee_lines[key].total = '-' + ( payload.getSubtotal*Math.abs( item.value ) )/100;
+ state.cartdata.coupon_lines[key].total = '-' + ( payload.getSubtotal*Math.abs( item.value ) )/100;
} else {
- state.cartdata.fee_lines[key].total = '-' + Math.abs( item.value );
+ state.cartdata.coupon_lines[key].total = '-' + Math.abs( item.value );
}
}
} );
@@ -294,18 +314,20 @@ export default {
addDiscountAction( context, discountData ) {
context.commit( 'addDiscount', discountData );
context.commit( 'calculateDiscount', context.getters );
- context.commit( 'calculateFee', context.getters );
},
addFeeAction( context, feeData ) {
context.commit( 'addFee', feeData );
- context.commit( 'calculateDiscount', context.getters );
context.commit( 'calculateFee', context.getters );
},
+ removeCouponLineItemsAction( context, itemKey ) {
+ context.commit( 'removeCouponLineItems', itemKey );
+ context.commit( 'calculateDiscount', context.getters );
+ },
+
removeFeeLineItemsAction( context, itemKey ) {
context.commit( 'removeFeeLineItems', itemKey );
- context.commit( 'calculateDiscount', context.getters );
context.commit( 'calculateFee', context.getters );
},
diff --git a/composer.json b/composer.json
index 20b14990..4d04fa56 100644
--- a/composer.json
+++ b/composer.json
@@ -11,7 +11,7 @@
],
"minimum-stability": "dev",
"require": {
- "php": ">=7.2",
+ "php": ">=7.4",
"appsero/client": "dev-develop",
"ext-json": "*"
},
@@ -34,7 +34,7 @@
},
"config": {
"platform": {
- "php": "7.2"
+ "php": "7.4"
},
"allow-plugins": {
"dealerdirect/phpcodesniffer-composer-installer": true
diff --git a/includes/Admin/Discounts.php b/includes/Admin/Discounts.php
new file mode 100644
index 00000000..86172e1a
--- /dev/null
+++ b/includes/Admin/Discounts.php
@@ -0,0 +1,135 @@
+is_main_query() ) {
+ return;
+ }
+
+ $meta_query = $query->get( 'meta_query' );
+ $meta_query = ! empty( $meta_query ) ? $meta_query : [];
+
+ $meta_query[][] = [
+ 'relation' => 'AND',
+ [
+ 'key' => $this->discount_type_key,
+ 'compare' => 'NOT EXISTS',
+ 'value' => '',
+ ],
+ ];
+
+ $query->set( 'meta_query', $meta_query );
+ }
+ );
+
+ add_filter(
+ 'wp_count_posts',
+ function ( $counts ) {
+ $coupons = $this->get_discount_coupons();
+ $total = count( $coupons );
+ $counts->publish = $counts->publish - $total;
+
+ return $counts;
+ }
+ );
+ }
+
+ /**
+ * Get Discount Coupons.
+ *
+ * @since WEPOS_SINCE
+ *
+ * @return int[]
+ */
+ private function get_discount_coupons(): array {
+ $query = new WP_Query(
+ [
+ 'fields' => 'ids',
+ 'post_type' => 'shop_coupon',
+ 'post_status' => 'publish',
+ 'posts_per_page' => -1,
+ 'meta_query' => [ // phpcs:ignore
+ 'relation' => 'OR',
+ [
+ 'key' => $this->discount_type_key,
+ 'compare' => '=',
+ 'value' => 'yes',
+ ],
+ ],
+ ]
+ );
+
+ return $query->get_posts();
+ }
+
+ /**
+ * Remove Discount Coupons.
+ *
+ * @since WEPOS_SINCE
+ *
+ * @return void
+ */
+ public function remove_discount_coupons() {
+ $coupons = $this->get_discount_coupons();
+
+ foreach ( $coupons as $coupon_id ) {
+ $coupon = new \WC_Coupon( $coupon_id );
+ $coupon->delete( true );
+ }
+ }
+}
diff --git a/includes/Admin/Updates.php b/includes/Admin/Updates.php
index 328ee53b..70c65a9e 100644
--- a/includes/Admin/Updates.php
+++ b/includes/Admin/Updates.php
@@ -13,8 +13,9 @@ class Updates {
/** @var array DB updates that need to be run */
private static $updates = [
- '1.0.2' => 'upgrade-1.0.2.php',
- '1.0.4' => 'upgrade-1.0.4.php',
+ '1.0.2' => 'upgrade-1.0.2.php',
+ '1.0.4' => 'upgrade-1.0.4.php',
+ '1.2.8' => 'upgrade-1.2.8.php',
];
/**
diff --git a/includes/Admin/Updates/upgrade-1.2.8.php b/includes/Admin/Updates/upgrade-1.2.8.php
new file mode 100644
index 00000000..8eb869c9
--- /dev/null
+++ b/includes/Admin/Updates/upgrade-1.2.8.php
@@ -0,0 +1,29 @@
+queue() ) {
+ return;
+ }
+
+ // Schedule daily cron job.
+ $hook = 'wepos_daily_midnight_cron';
+
+ // Check if we've defined the cron hook.
+ $cron_schedule = as_next_scheduled_action( $hook ); // This method will return false if the hook is not scheduled
+ if ( ! $cron_schedule ) {
+ as_unschedule_all_actions( $hook );
+ }
+
+ // Schedule recurring cron action.
+ $now = wepos_current_datetime()->modify( 'midnight' )->getTimestamp();
+ WC()->queue()->schedule_cron( $now, '0 0 * * *', $hook, [], 'dokan' );
+}
+
+wepos_1_2_8_updates();
diff --git a/includes/Installer.php b/includes/Installer.php
new file mode 100644
index 00000000..dbcae96f
--- /dev/null
+++ b/includes/Installer.php
@@ -0,0 +1,106 @@
+add_version_info();
+ $this->add_user_roles();
+ $this->flush_rewrites();
+ $this->schedule_cron_jobs();
+ }
+
+ /**
+ * Add Version Info.
+ *
+ * @since WEPOS_SINCE
+ *
+ * @return void
+ */
+ private function add_version_info() {
+ $installed = get_option( 'we_pos_installed' );
+
+ if ( ! $installed ) {
+ update_option( 'we_pos_installed', time() );
+ }
+
+ update_option( 'we_pos_version', WEPOS_VERSION );
+ }
+
+ /**
+ * Add User Roles.
+ *
+ * @since WEPOS_SINCE
+ *
+ * @return void
+ */
+ private function add_user_roles() {
+ if ( function_exists( 'dokan' ) ) {
+ $users_query = new \WP_User_Query( [
+ 'role__in' => [ 'seller', 'vendor_staff' ],
+ ] );
+ $users = $users_query->get_results();
+
+ if ( count( $users ) > 0 ) {
+ foreach ( $users as $user ) {
+ $user->add_cap( 'publish_shop_orders' );
+ $user->add_cap( 'list_users' );
+ }
+ }
+ }
+ }
+
+ /**
+ * Flush Rewrites.
+ *
+ * @since WEPOS_SINCE
+ *
+ * @return void
+ */
+ private function flush_rewrites() {
+ set_transient( 'wepos-flush-rewrites', 1 );
+ }
+
+ /**
+ * Schedule Cron Jobs.
+ *
+ * @since WEPOS_SINCE
+ *
+ * @return void
+ */
+ private function schedule_cron_jobs() {
+ if ( ! function_exists( 'WC' ) || ! WC()->queue() ) {
+ return;
+ }
+
+ // Schedule daily cron job.
+ $hook = 'wepos_daily_midnight_cron';
+
+ // Check if we've defined the cron hook.
+ $cron_schedule = as_next_scheduled_action( $hook ); // This method will return false if the hook is not scheduled
+ if ( ! $cron_schedule ) {
+ as_unschedule_all_actions( $hook );
+ }
+
+ // Schedule recurring cron action.
+ $now = wepos_current_datetime()->modify( 'midnight' )->getTimestamp();
+ WC()->queue()->schedule_cron( $now, '0 0 * * *', $hook, [], 'dokan' );
+ }
+}
diff --git a/includes/REST/CouponController.php b/includes/REST/CouponController.php
new file mode 100644
index 00000000..e3b93458
--- /dev/null
+++ b/includes/REST/CouponController.php
@@ -0,0 +1,51 @@
+ '\WeDevs\WePOS\REST\SettingController',
WEPOS_INCLUDES . '/REST/TaxController.php' => '\WeDevs\WePOS\REST\TaxController',
WEPOS_INCLUDES . '/REST/CustomerController.php' => '\WeDevs\WePOS\REST\CustomerController',
- WEPOS_INCLUDES . '/REST/ProductController.php' => '\WeDevs\WePOS\REST\ProductController'
+ WEPOS_INCLUDES . '/REST/ProductController.php' => '\WeDevs\WePOS\REST\ProductController',
+ WEPOS_INCLUDES . '/REST/CouponController.php' => '\WeDevs\WePOS\REST\CouponController',
) );
// Init REST API routes.
@@ -185,4 +186,4 @@ public function validate_item_stock_before_order( $order, $request, $creating )
return $order;
}
-}
\ No newline at end of file
+}
diff --git a/includes/functions.php b/includes/functions.php
index 1461ff53..1ab6bba1 100644
--- a/includes/functions.php
+++ b/includes/functions.php
@@ -284,3 +284,63 @@ function wepos_get_product_price( $product ) {
return apply_filters( 'woocommerce_cart_product_subtotal', $product_subtotal, $product, $quantity, $this );
}
+
+/**
+ * Function current_datetime() compatibility for wp version < 5.3
+ *
+ * @since WEPOS_SINCE
+ *
+ * @return DateTimeImmutable
+ */
+function wepos_current_datetime() {
+ if ( function_exists( 'current_datetime' ) ) {
+ return current_datetime();
+ }
+
+ return new DateTimeImmutable( 'now', wepos_wp_timezone() );
+}
+
+/**
+ * Function wp_timezone() compatibility for wp version < 5.3
+ *
+ * @since WEPOS_SINCE
+ *
+ * @return DateTimeZone
+ */
+function wepos_wp_timezone() {
+ if ( function_exists( 'wp_timezone' ) ) {
+ return wp_timezone();
+ }
+
+ return new DateTimeZone( wepos_wp_timezone_string() );
+}
+
+/**
+ * Function wp_timezone_string() compatibility for wp version < 5.3
+ *
+ * @since WEPOS_SINCE
+ *
+ * @return string
+ */
+function wepos_wp_timezone_string() {
+ if ( function_exists( 'wp_timezone_string' ) ) {
+ return wp_timezone_string();
+ }
+
+ $timezone_string = get_option( 'timezone_string' );
+
+ if ( $timezone_string ) {
+ return $timezone_string;
+ }
+
+ $offset = (float) get_option( 'gmt_offset' );
+ $hours = (int) $offset;
+ $minutes = ( $offset - $hours );
+
+ $sign = ( $offset < 0 ) ? '-' : '+';
+ $abs_hour = abs( $hours );
+ $abs_mins = abs( $minutes * 60 );
+ $tz_offset = sprintf( '%s%02d:%02d', $sign, $abs_hour, $abs_mins );
+
+ return $tz_offset;
+}
diff --git a/languages/wepos.php b/languages/wepos.php
index 4f09d3e3..1ac84953 100644
--- a/languages/wepos.php
+++ b/languages/wepos.php
@@ -49,7 +49,7 @@
__( 'Price', 'wepos' ),
__( 'Quantity', 'wepos' ),
__( 'Subtotal', 'wepos' ),
- __( 'Includes Tax', 'wepos' ),
+ __( 'Including Tax', 'wepos' ),
__( 'Discount', 'wepos' ),
__( 'Fee Name', 'wepos' ),
__( 'Total', 'wepos' ),
@@ -57,6 +57,7 @@
__( 'Apply', 'wepos' ),
__( 'Cancel', 'wepos' ),
__( 'Fee', 'wepos' ),
+ __( 'Fee Tax', 'wepos' ),
__( 'Tax', 'wepos' ),
__( 'Pay Now', 'wepos' ),
__( 'Sale Completed', 'wepos' ),
@@ -88,6 +89,7 @@
__( 'Product is out of stock!', 'wepos-pro' ),
__( 'Order ID', 'wepos' ),
__( 'Order Date', 'wepos' ),
+ __( 'Tax includes', 'wepos' ),
__( 'Payment method', 'wepos' ),
__( 'Cash Given', 'wepos' ),
__( 'Change Money', 'wepos' ),
diff --git a/languages/wepos.pot b/languages/wepos.pot
index 12dadbde..0b2f0445 100644
--- a/languages/wepos.pot
+++ b/languages/wepos.pot
@@ -1,14 +1,14 @@
-# Copyright (C) 2023 weDevs
+# Copyright (C) 2024 weDevs
# This file is distributed under the GPL2.
msgid ""
msgstr ""
-"Project-Id-Version: wePOS - Point Of Sale (POS) for WooCommerce 1.2.7\n"
+"Project-Id-Version: wePOS - Point Of Sale (POS) for WooCommerce 1.2.8\n"
"Report-Msgid-Bugs-To: https://wordpress.org/support/plugin/wepos\n"
-"POT-Creation-Date: 2023-12-27 04:21:05+00:00\n"
+"POT-Creation-Date: 2024-06-05 10:56:15+00:00\n"
"MIME-Version: 1.0\n"
"Content-Type: text/plain; charset=utf-8\n"
"Content-Transfer-Encoding: 8bit\n"
-"PO-Revision-Date: 2023-MO-DA HO:MI+ZONE\n"
+"PO-Revision-Date: 2024-MO-DA HO:MI+ZONE\n"
"Last-Translator: FULL NAME \n"
"Language-Team: LANGUAGE \n"
"X-Generator: wp-vue-i18n 1.1.4\n"
@@ -218,175 +218,189 @@ msgid "Quantity"
msgstr ""
#: assets/src/frontend/components/Home.vue:248
-#: assets/src/frontend/components/Home.vue:444
-#: assets/src/frontend/components/PrintReceiptHtml.vue:34
+#: assets/src/frontend/components/Home.vue:477
+#: assets/src/frontend/components/PrintReceiptHtml.vue:37
msgid "Subtotal"
msgstr ""
#: assets/src/frontend/components/Home.vue:250
-#: assets/src/frontend/components/Home.vue:446
-#: assets/src/frontend/components/PrintReceiptHtml.vue:36
-msgid "Includes Tax"
-msgstr ""
-
-#: assets/src/frontend/components/Home.vue:259
-#: assets/src/frontend/components/Home.vue:294
-#: assets/src/frontend/components/Home.vue:454
-#: assets/src/frontend/components/Home.vue:884
-#: assets/src/frontend/components/PrintReceiptHtml.vue:43
+#: assets/src/frontend/components/Home.vue:479
+#: assets/src/frontend/components/PrintReceiptHtml.vue:39
+msgid "Including Tax"
+msgstr ""
+
+#: assets/src/frontend/components/Home.vue:260
+#: assets/src/frontend/components/Home.vue:292
+#: assets/src/frontend/components/Home.vue:327
+#: assets/src/frontend/components/Home.vue:488
+#: assets/src/frontend/components/Home.vue:501
+#: assets/src/frontend/components/Home.vue:985
+#: assets/src/frontend/components/PrintReceiptHtml.vue:45
msgid "Discount"
msgstr ""
-#: assets/src/frontend/components/Home.vue:266
+#: assets/src/frontend/components/Home.vue:267
+#: assets/src/frontend/components/Home.vue:299
msgid "Fee Name"
msgstr ""
-#: assets/src/frontend/components/Home.vue:267
+#: assets/src/frontend/components/Home.vue:268
+#: assets/src/frontend/components/Home.vue:300
msgid "Total"
msgstr ""
-#: assets/src/frontend/components/Home.vue:269
+#: assets/src/frontend/components/Home.vue:270
+#: assets/src/frontend/components/Home.vue:302
msgid "Taxable"
msgstr ""
-#: assets/src/frontend/components/Home.vue:274
+#: assets/src/frontend/components/Home.vue:275
+#: assets/src/frontend/components/Home.vue:307
msgid "Apply"
msgstr ""
-#: assets/src/frontend/components/Home.vue:275
+#: assets/src/frontend/components/Home.vue:276
+#: assets/src/frontend/components/Home.vue:308
msgid "Cancel"
msgstr ""
-#: assets/src/frontend/components/Home.vue:280
-#: assets/src/frontend/components/Home.vue:295
-#: assets/src/frontend/components/Home.vue:458
-#: assets/src/frontend/components/Home.vue:902
-#: assets/src/frontend/components/PrintReceiptHtml.vue:47
+#: assets/src/frontend/components/Home.vue:281
+#: assets/src/frontend/components/Home.vue:313
+#: assets/src/frontend/components/Home.vue:328
+#: assets/src/frontend/components/Home.vue:492
+#: assets/src/frontend/components/Home.vue:505
+#: assets/src/frontend/components/Home.vue:1007
+#: assets/src/frontend/components/PrintReceiptHtml.vue:49
msgid "Fee"
msgstr ""
-#: assets/src/frontend/components/Home.vue:288
-#: assets/src/frontend/components/Home.vue:464
-#: assets/src/frontend/components/PrintReceiptHtml.vue:52
+#: assets/src/frontend/components/Home.vue:321
+#: assets/src/frontend/components/PrintReceiptHtml.vue:53
+msgid "Fee Tax"
+msgstr ""
+
+#: assets/src/frontend/components/Home.vue:321
+#: assets/src/frontend/components/Home.vue:511
+#: assets/src/frontend/components/PrintReceiptHtml.vue:53
msgid "Tax"
msgstr ""
-#: assets/src/frontend/components/Home.vue:306
+#: assets/src/frontend/components/Home.vue:339
msgid "Pay Now"
msgstr ""
-#: assets/src/frontend/components/Home.vue:322
+#: assets/src/frontend/components/Home.vue:355
msgid "Sale Completed"
msgstr ""
-#: assets/src/frontend/components/Home.vue:329
+#: assets/src/frontend/components/Home.vue:362
msgid "New Sale"
msgstr ""
-#: assets/src/frontend/components/Home.vue:339
+#: assets/src/frontend/components/Home.vue:372
msgid "Shortcut Keys"
msgstr ""
-#: assets/src/frontend/components/Home.vue:343
+#: assets/src/frontend/components/Home.vue:376
msgid "Search Product"
msgstr ""
-#: assets/src/frontend/components/Home.vue:347
+#: assets/src/frontend/components/Home.vue:380
msgid "Scan Product"
msgstr ""
-#: assets/src/frontend/components/Home.vue:351
+#: assets/src/frontend/components/Home.vue:384
msgid "Toggle Product View"
msgstr ""
-#: assets/src/frontend/components/Home.vue:355
+#: assets/src/frontend/components/Home.vue:388
msgid "Add Fee in cart"
msgstr ""
-#: assets/src/frontend/components/Home.vue:359
+#: assets/src/frontend/components/Home.vue:392
msgid "Add Discount in cart"
msgstr ""
-#: assets/src/frontend/components/Home.vue:363
+#: assets/src/frontend/components/Home.vue:396
msgid "Add Customer note"
msgstr ""
-#: assets/src/frontend/components/Home.vue:367
+#: assets/src/frontend/components/Home.vue:400
msgid "Customer Search"
msgstr ""
-#: assets/src/frontend/components/Home.vue:371
+#: assets/src/frontend/components/Home.vue:404
msgid "Add new Customer"
msgstr ""
-#: assets/src/frontend/components/Home.vue:375
+#: assets/src/frontend/components/Home.vue:408
msgid "Create New Sale"
msgstr ""
-#: assets/src/frontend/components/Home.vue:379
+#: assets/src/frontend/components/Home.vue:412
msgid "Empty your cart"
msgstr ""
-#: assets/src/frontend/components/Home.vue:383
+#: assets/src/frontend/components/Home.vue:416
msgid "Go to payment receipt"
msgstr ""
-#: assets/src/frontend/components/Home.vue:387
-#: assets/src/frontend/components/Home.vue:532
+#: assets/src/frontend/components/Home.vue:420
+#: assets/src/frontend/components/Home.vue:579
msgid "Process Payment"
msgstr ""
-#: assets/src/frontend/components/Home.vue:391
+#: assets/src/frontend/components/Home.vue:424
#: assets/src/frontend/components/PrintReceipt.vue:5
msgid "Print Receipt"
msgstr ""
-#: assets/src/frontend/components/Home.vue:395
+#: assets/src/frontend/components/Home.vue:428
msgid "Show/Close(Toggle) Help"
msgstr ""
-#: assets/src/frontend/components/Home.vue:399
+#: assets/src/frontend/components/Home.vue:432
msgid "Close anything"
msgstr ""
-#: assets/src/frontend/components/Home.vue:411
+#: assets/src/frontend/components/Home.vue:444
msgid "Sale Summary"
msgstr ""
-#: assets/src/frontend/components/Home.vue:468
-#: assets/src/frontend/components/PrintReceiptHtml.vue:56
+#: assets/src/frontend/components/Home.vue:515
+#: assets/src/frontend/components/PrintReceiptHtml.vue:57
msgid "Order Total"
msgstr ""
-#: assets/src/frontend/components/Home.vue:472
-#: assets/src/frontend/components/Home.vue:480
+#: assets/src/frontend/components/Home.vue:519
+#: assets/src/frontend/components/Home.vue:527
msgid "Pay"
msgstr ""
-#: assets/src/frontend/components/Home.vue:500
+#: assets/src/frontend/components/Home.vue:547
msgid "No gateway found"
msgstr ""
-#: assets/src/frontend/components/Home.vue:508 includes/Gateways/Cash.php:36
+#: assets/src/frontend/components/Home.vue:555 includes/Gateways/Cash.php:36
#: includes/Gateways/Cash.php:58
msgid "Cash"
msgstr ""
-#: assets/src/frontend/components/Home.vue:516
+#: assets/src/frontend/components/Home.vue:563
msgid "Change money"
msgstr ""
-#: assets/src/frontend/components/Home.vue:703
-#: assets/src/frontend/components/Home.vue:1074
-#: assets/src/frontend/components/Home.vue:1102
+#: assets/src/frontend/components/Home.vue:751
+#: assets/src/frontend/components/Home.vue:1182
+#: assets/src/frontend/components/Home.vue:1210
msgid "All categories"
msgstr ""
-#: assets/src/frontend/components/Home.vue:997
+#: assets/src/frontend/components/Home.vue:1105
msgid "This product is out of stock."
msgstr ""
-#: assets/src/frontend/components/Home.vue:1013
+#: assets/src/frontend/components/Home.vue:1121
msgid "Product is out of stock!"
msgstr ""
@@ -398,15 +412,19 @@ msgstr ""
msgid "Order Date"
msgstr ""
-#: assets/src/frontend/components/PrintReceiptHtml.vue:63
+#: assets/src/frontend/components/PrintReceiptHtml.vue:15
+msgid "Tax includes"
+msgstr ""
+
+#: assets/src/frontend/components/PrintReceiptHtml.vue:64
msgid "Payment method"
msgstr ""
-#: assets/src/frontend/components/PrintReceiptHtml.vue:68
+#: assets/src/frontend/components/PrintReceiptHtml.vue:69
msgid "Cash Given"
msgstr ""
-#: assets/src/frontend/components/PrintReceiptHtml.vue:72
+#: assets/src/frontend/components/PrintReceiptHtml.vue:73
msgid "Change Money"
msgstr ""
@@ -475,19 +493,19 @@ msgstr ""
msgid "Setting has been saved successfully."
msgstr ""
-#: includes/Admin/Updates.php:73
+#: includes/Admin/Updates.php:74
msgid "WePOS Data Update Required"
msgstr ""
-#: includes/Admin/Updates.php:73
+#: includes/Admin/Updates.php:74
msgid "We need to update your install to the latest version"
msgstr ""
-#: includes/Admin/Updates.php:74
+#: includes/Admin/Updates.php:75
msgid "Run the updater"
msgstr ""
-#: includes/Admin/Updates.php:79
+#: includes/Admin/Updates.php:80
msgid ""
"It is strongly recommended that you backup your database before proceeding. "
"Are you sure you wish to run the updater now?"
@@ -573,7 +591,7 @@ msgstr ""
msgid "Sorry, you are not allowed view this resource."
msgstr ""
-#: includes/REST/Manager.php:182
+#: includes/REST/Manager.php:183
msgid "The item %s already out of stock. Please remove this from cart"
msgstr ""
diff --git a/package-lock.json b/package-lock.json
index ac8dc3cb..9554f8ce 100644
--- a/package-lock.json
+++ b/package-lock.json
@@ -1,12 +1,12 @@
{
"name": "wepos",
- "version": "1.2.7",
+ "version": "1.2.8",
"lockfileVersion": 2,
"requires": true,
"packages": {
"": {
"name": "wepos",
- "version": "1.2.7",
+ "version": "1.2.8",
"license": "GPLv2",
"dependencies": {
"@mathieustan/vue-datepicker": "^0.2.11",
diff --git a/package.json b/package.json
index 08241924..6e5144ba 100644
--- a/package.json
+++ b/package.json
@@ -1,6 +1,6 @@
{
"name": "wepos",
- "version": "1.2.7",
+ "version": "1.2.8",
"description": "Point of Sale plugin for WooCommerce",
"author": "weDevs ",
"license": "GPLv2",
diff --git a/readme.txt b/readme.txt
index e1d1c0f8..ef7fb489 100644
--- a/readme.txt
+++ b/readme.txt
@@ -3,11 +3,11 @@ Contributors: tareq1988, wedevs, nizamuddinbabu
Donate Link: http://tareq.co/donate/
Tags: WooCommerce POS, point of sale, free pos, pos plugin, woocommerce point of sale
Requires at least: 5.4
-Tested up to: 6.4.2
+Tested up to: 6.5.3
WC requires at least: 5.0.0
-WC tested up to: 8.4.0
-Requires PHP: 7.2
-Stable tag: 1.2.7
+WC tested up to: 8.9.2
+Requires PHP: 7.4
+Stable tag: 1.2.8
License: GPLv2 or later
License URI: http://www.gnu.org/licenses/gpl-2.0.html
@@ -60,6 +60,12 @@ No FAQ
== Changelog ==
+= v1.2.7 -> 5th June, 2024 =
+-----------------------------
+- **Feature:** WooCommerce Coupon API integration for cart discount
+- **Enhancement:** Added support for WooCommerce customised order numbers by third-party plugins
+- **Fix:** Blurry numbers on print receipt
+
= v1.2.7 -> 27th December, 2023 =
- **Enhancement:** Tax calculation implementation based on discounts and fees instead of base price of products
diff --git a/wepos.php b/wepos.php
index 0cb2377a..ed83bb69 100644
--- a/wepos.php
+++ b/wepos.php
@@ -3,13 +3,13 @@
Plugin Name: wePOS - Point Of Sale (POS) for WooCommerce
Plugin URI: https://wedevs.com/wepos
Description: A beautiful and fast Point of Sale (POS) system for WooCommerce
-Version: 1.2.7
+Version: 1.2.8
Author: weDevs
Author URI: https://wedevs.com/
Text Domain: wepos
Domain Path: /languages
WC requires at least: 5.0.0
-WC tested up to: 8.4.0
+WC tested up to: 8.9.2
License: GPL2
License URI: https://www.gnu.org/licenses/gpl-2.0.html
*/
@@ -57,7 +57,7 @@ final class WePOS {
*
* @var string
*/
- public $version = '1.2.7';
+ public $version = '1.2.8';
/**
* Holds various class instances
@@ -76,6 +76,7 @@ public function __construct() {
require_once __DIR__ . '/vendor/autoload.php';
$this->define_constants();
+ $this->includes();
register_activation_hook( __FILE__, [ $this, 'activate' ] );
register_deactivation_hook( __FILE__, [ $this, 'deactivate' ] );
@@ -130,8 +131,6 @@ public function woocommerce_not_loaded() {
if ( did_action( 'woocommerce_loaded' ) || ! is_admin() ) {
return;
}
-
- require_once WEPOS_INCLUDES . '/functions.php';
}
/**
@@ -258,7 +257,6 @@ public function define_constants() {
* @return void
*/
public function init_plugin() {
- $this->includes();
$this->init_hooks();
do_action( 'wepos_loaded' );
@@ -272,28 +270,9 @@ public function init_plugin() {
* @return void
*/
public function activate() {
- $installed = get_option( 'we_pos_installed' );
-
- if ( ! $installed ) {
- update_option( 'we_pos_installed', time() );
- }
-
- if ( function_exists( 'dokan' ) ) {
- $users_query = new WP_User_Query( [
- 'role__in' => [ 'seller', 'vendor_staff' ]
- ] );
- $users = $users_query->get_results();
-
- if ( count( $users ) > 0 ) {
- foreach ( $users as $user ) {
- $user->add_cap( 'publish_shop_orders' );
- $user->add_cap( 'list_users' );
- }
- }
- }
+ $installer = new WeDevs\WePOS\Installer();
- update_option( 'we_pos_version', WEPOS_VERSION );
- set_transient( 'wepos-flush-rewrites', 1 );
+ $installer->run();
}
/**
@@ -349,6 +328,7 @@ public function init_classes() {
new WeDevs\WePOS\Admin\Products();
new WeDevs\WePOS\Admin\Updates();
new WeDevs\WePOS\Admin\LimitedTimePromotion();
+ new WeDevs\WePOS\Admin\Discounts();
} else {
$this->container['frontend'] = new WeDevs\WePOS\Frontend();
}