diff --git a/packages/plugins/@hera/plugin-rental/src/server/services/settlement-service.ts b/packages/plugins/@hera/plugin-rental/src/server/services/settlement-service.ts index adbeaac2c..b80fc66f8 100644 --- a/packages/plugins/@hera/plugin-rental/src/server/services/settlement-service.ts +++ b/packages/plugins/@hera/plugin-rental/src/server/services/settlement-service.ts @@ -485,7 +485,12 @@ export class SettlementService { data.count += item.weight_items.length ? item.weight_items.length ? item.weight_items.reduce((sum, curr) => { - return sum + curr.weight; + const weight = isRuleRecord.filter( + (productItem) => productItem.product.category_id === curr.product_category_id, + ).length + ? curr.weight + : 0; + return sum + weight; }, 0) : 0 : item.weight; @@ -530,7 +535,12 @@ export class SettlementService { data.count += item.weight_items.length ? item.weight_items.length ? item.weight_items.reduce((sum, curr) => { - return sum + curr.weight; + const weight = isRuleRecord.filter( + (productItem) => productItem.product.category_id === curr.product_category_id, + ).length + ? curr.weight + : 0; + return sum + weight; }, 0) : 0 : item.weight;