@posx/core 5.5.352 → 5.5.357

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/build/index.js CHANGED
@@ -3304,7 +3304,8 @@ var InvoiceBaseService = class extends AppRemoteService {
3304
3304
  invoice.service_chargeable_subtotal = 0;
3305
3305
  }
3306
3306
  this.calculateInvoiceCharges(invoice, CalcFlow.AfterSubtotal);
3307
- invoice.service_chargeable_subtotal = preciseRound(Math.max(0, invoice.service_chargeable_subtotal - invoice.discount_amount));
3307
+ const serviceChargeableDiscountRatio = invoice.discountable_subtotal > 0 ? invoice.service_chargeable_subtotal / invoice.discountable_subtotal : 0;
3308
+ invoice.service_chargeable_subtotal = preciseRound(Math.max(0, invoice.service_chargeable_subtotal - invoice.discount_amount * serviceChargeableDiscountRatio));
3308
3309
  const serviceChargeRate = appConfig.config.charges.service_charge ? appConfig.config.charges.service_charge_rate : 0;
3309
3310
  this.calculateServiceCharge(invoice, serviceChargeRate);
3310
3311
  this.calculateDiscount(invoice, CalcFlow.AfterServiceCharge);
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@posx/core",
3
- "version": "5.5.352",
3
+ "version": "5.5.357",
4
4
  "description": "POSX core libraries",
5
5
  "main": "./build/index.js",
6
6
  "author": "Steven Lee",
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@posx/core",
3
- "version": "5.5.352",
3
+ "version": "5.5.357",
4
4
  "description": "POSX core libraries",
5
5
  "type": "module",
6
6
  "main": "./build/index.js",