@pisell/pisellos 0.0.347 → 0.0.348

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.
@@ -49,5 +49,5 @@ export declare class Product extends BaseModule implements Module {
49
49
  getCategories(): ProductCategory[];
50
50
  setOtherParams(key: string, value: any): void;
51
51
  getOtherParams(): any;
52
- getProductType(): "duration" | "session" | "normal";
52
+ getProductType(): "normal" | "duration" | "session";
53
53
  }
@@ -3191,8 +3191,11 @@ export var CheckoutImpl = /*#__PURE__*/function (_BaseModule) {
3191
3191
  depositPaidAmount = paymentItems.filter(function (item) {
3192
3192
  return item.order_payment_type === 'deposit' && item.status !== 'voided';
3193
3193
  }).reduce(function (sum, item) {
3194
- // 如果是 wallet,并且还没同步到后端,则不计入这一部分金额
3195
- if (item.voucher_id && !item.isSynced) {
3194
+ // 如果是 wallet,并且还没同步到后端,且此时还没有其他类型的支付项(现金,eftpos,标记支付),不计入已付金额
3195
+ // 如果有其他支付项了,代表此时处于马上要同步的状态,所以计入
3196
+ if (item.voucher_id && !item.isSynced && paymentItems.filter(function (item) {
3197
+ return !item.voucher_id;
3198
+ }).length === 0) {
3196
3199
  return sum;
3197
3200
  }
3198
3201
  var amount = new Decimal(item.amount || '0');
@@ -49,5 +49,5 @@ export declare class Product extends BaseModule implements Module {
49
49
  getCategories(): ProductCategory[];
50
50
  setOtherParams(key: string, value: any): void;
51
51
  getOtherParams(): any;
52
- getProductType(): "duration" | "session" | "normal";
52
+ getProductType(): "normal" | "duration" | "session";
53
53
  }
@@ -1967,7 +1967,7 @@ var CheckoutImpl = class extends import_BaseModule.BaseModule {
1967
1967
  const depositPaidAmount = paymentItems.filter(
1968
1968
  (item) => item.order_payment_type === "deposit" && item.status !== "voided"
1969
1969
  ).reduce((sum, item) => {
1970
- if (item.voucher_id && !item.isSynced) {
1970
+ if (item.voucher_id && !item.isSynced && paymentItems.filter((item2) => !item2.voucher_id).length === 0) {
1971
1971
  return sum;
1972
1972
  }
1973
1973
  const amount = new import_decimal.default(item.amount || "0");
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "private": false,
3
3
  "name": "@pisell/pisellos",
4
- "version": "0.0.347",
4
+ "version": "0.0.348",
5
5
  "description": "一个可扩展的前端模块化SDK框架,支持插件系统",
6
6
  "main": "dist/index.js",
7
7
  "types": "dist/index.d.ts",