@pisell/pisellos 1.0.117 → 1.0.118

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.
@@ -78,6 +78,7 @@ export var WalletPassEvaluator = /*#__PURE__*/function () {
78
78
  var _item$strategyResult2;
79
79
  return _objectSpread(_objectSpread({}, item.voucher), {}, {
80
80
  config: _objectSpread({}, item === null || item === void 0 || (_item$strategyResult2 = item.strategyResult) === null || _item$strategyResult2 === void 0 ? void 0 : _item$strategyResult2.config.metadata.custom),
81
+ _unified_available_status: 0,
81
82
  reason: item.reason,
82
83
  reasonCode: item.reasonCode
83
84
  });
@@ -62,6 +62,7 @@ export interface Product {
62
62
  main_product_attached_bundle_tax_fee?: number;
63
63
  main_product_attached_bundle_surcharge_fee?: number;
64
64
  surcharge_rounding_remainder?: number;
65
+ tax_fee_rounding_remainder?: number;
65
66
  main_product_selling_price: number;
66
67
  };
67
68
  is_price_include_tax: 0 | 1;
@@ -79,6 +80,7 @@ export interface Product {
79
80
  metadata: {
80
81
  surcharge_fee: number;
81
82
  surcharge_rounding_remainder?: number;
83
+ tax_fee_rounding_remainder?: number;
82
84
  };
83
85
  }[];
84
86
  }
@@ -804,7 +804,7 @@ export function recalculateVouchers(allVouchers, selectedVouchers, orderTotalAmo
804
804
  * @returns 商品价格
805
805
  */
806
806
  export var getMainProductPrice = function getMainProductPrice(product, isDeductTaxAndFee) {
807
- var _product$metadata, _product$metadata2, _product$metadata3, _product$metadata4;
807
+ var _product$metadata, _product$metadata2, _product$metadata3, _product$metadata4, _product$metadata5;
808
808
  var mainProductPrice = new Decimal((product === null || product === void 0 ? void 0 : product.main_product_selling_price) || ((_product$metadata = product.metadata) === null || _product$metadata === void 0 ? void 0 : _product$metadata.main_product_selling_price) || 0);
809
809
  var _iterator6 = _createForOfIteratorHelper((product === null || product === void 0 ? void 0 : product.product_bundle) || []),
810
810
  _step6;
@@ -824,14 +824,14 @@ export var getMainProductPrice = function getMainProductPrice(product, isDeductT
824
824
  } finally {
825
825
  _iterator6.f();
826
826
  }
827
- var taxFee = new Decimal((product === null || product === void 0 ? void 0 : product.tax_fee) || (product === null || product === void 0 || (_product$metadata2 = product.metadata) === null || _product$metadata2 === void 0 ? void 0 : _product$metadata2.main_product_attached_bundle_tax_fee) || 0);
827
+ var taxFee = new Decimal((product === null || product === void 0 ? void 0 : product.tax_fee) || (product === null || product === void 0 || (_product$metadata2 = product.metadata) === null || _product$metadata2 === void 0 ? void 0 : _product$metadata2.main_product_attached_bundle_tax_fee) || 0).add((product === null || product === void 0 || (_product$metadata3 = product.metadata) === null || _product$metadata3 === void 0 ? void 0 : _product$metadata3.tax_fee_rounding_remainder) || 0);
828
828
  if (product.is_price_include_tax === 1) {
829
829
  taxFee = new Decimal(0);
830
830
  }
831
831
 
832
832
  // 税费
833
833
  // 附加费
834
- var surchargeFee = new Decimal((product === null || product === void 0 || (_product$metadata3 = product.metadata) === null || _product$metadata3 === void 0 ? void 0 : _product$metadata3.main_product_attached_bundle_surcharge_fee) || 0).add((product === null || product === void 0 || (_product$metadata4 = product.metadata) === null || _product$metadata4 === void 0 ? void 0 : _product$metadata4.surcharge_rounding_remainder) || 0);
834
+ var surchargeFee = new Decimal((product === null || product === void 0 || (_product$metadata4 = product.metadata) === null || _product$metadata4 === void 0 ? void 0 : _product$metadata4.main_product_attached_bundle_surcharge_fee) || 0).add((product === null || product === void 0 || (_product$metadata5 = product.metadata) === null || _product$metadata5 === void 0 ? void 0 : _product$metadata5.surcharge_rounding_remainder) || 0);
835
835
 
836
836
  // 税费附加费总额
837
837
  var taxAndFeeTotal = taxFee.add(surchargeFee);
@@ -87,6 +87,7 @@ var WalletPassEvaluator = class {
87
87
  config: {
88
88
  ...(_b = item == null ? void 0 : item.strategyResult) == null ? void 0 : _b.config.metadata.custom
89
89
  },
90
+ _unified_available_status: 0,
90
91
  reason: item.reason,
91
92
  reasonCode: item.reasonCode
92
93
  };
@@ -62,6 +62,7 @@ export interface Product {
62
62
  main_product_attached_bundle_tax_fee?: number;
63
63
  main_product_attached_bundle_surcharge_fee?: number;
64
64
  surcharge_rounding_remainder?: number;
65
+ tax_fee_rounding_remainder?: number;
65
66
  main_product_selling_price: number;
66
67
  };
67
68
  is_price_include_tax: 0 | 1;
@@ -79,6 +80,7 @@ export interface Product {
79
80
  metadata: {
80
81
  surcharge_fee: number;
81
82
  surcharge_rounding_remainder?: number;
83
+ tax_fee_rounding_remainder?: number;
82
84
  };
83
85
  }[];
84
86
  }
@@ -547,7 +547,7 @@ function recalculateVouchers(allVouchers, selectedVouchers, orderTotalAmount, pr
547
547
  };
548
548
  }
549
549
  var getMainProductPrice = (product, isDeductTaxAndFee) => {
550
- var _a, _b, _c, _d;
550
+ var _a, _b, _c, _d, _e;
551
551
  let mainProductPrice = new import_decimal.default((product == null ? void 0 : product.main_product_selling_price) || ((_a = product.metadata) == null ? void 0 : _a.main_product_selling_price) || 0);
552
552
  for (let bundleItem of (product == null ? void 0 : product.product_bundle) || []) {
553
553
  if (getBundleItemIsMarkupOrDiscountPrice(bundleItem)) {
@@ -555,11 +555,11 @@ var getMainProductPrice = (product, isDeductTaxAndFee) => {
555
555
  mainProductPrice = mainProductPrice.add(bundleItemPrice.times(bundleItem.num));
556
556
  }
557
557
  }
558
- let taxFee = new import_decimal.default((product == null ? void 0 : product.tax_fee) || ((_b = product == null ? void 0 : product.metadata) == null ? void 0 : _b.main_product_attached_bundle_tax_fee) || 0);
558
+ let taxFee = new import_decimal.default((product == null ? void 0 : product.tax_fee) || ((_b = product == null ? void 0 : product.metadata) == null ? void 0 : _b.main_product_attached_bundle_tax_fee) || 0).add(((_c = product == null ? void 0 : product.metadata) == null ? void 0 : _c.tax_fee_rounding_remainder) || 0);
559
559
  if (product.is_price_include_tax === 1) {
560
560
  taxFee = new import_decimal.default(0);
561
561
  }
562
- const surchargeFee = new import_decimal.default(((_c = product == null ? void 0 : product.metadata) == null ? void 0 : _c.main_product_attached_bundle_surcharge_fee) || 0).add(((_d = product == null ? void 0 : product.metadata) == null ? void 0 : _d.surcharge_rounding_remainder) || 0);
562
+ const surchargeFee = new import_decimal.default(((_d = product == null ? void 0 : product.metadata) == null ? void 0 : _d.main_product_attached_bundle_surcharge_fee) || 0).add(((_e = product == null ? void 0 : product.metadata) == null ? void 0 : _e.surcharge_rounding_remainder) || 0);
563
563
  const taxAndFeeTotal = taxFee.add(surchargeFee);
564
564
  if (isDeductTaxAndFee) {
565
565
  mainProductPrice = mainProductPrice.add(taxAndFeeTotal);
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "private": false,
3
3
  "name": "@pisell/pisellos",
4
- "version": "1.0.117",
4
+ "version": "1.0.118",
5
5
  "description": "一个可扩展的前端模块化SDK框架,支持插件系统",
6
6
  "main": "dist/index.js",
7
7
  "types": "dist/index.d.ts",