fix: 修复替身合同结算实际重量不对 (#1509)

Reviewed-on: daoyoucloud/tachybase#1509
Reviewed-by: sealday <zhanglin@daoyoucloud.com>
Co-authored-by: wjh <wwwjh0710@163.com>
Co-committed-by: wjh <wwwjh0710@163.com>
This commit is contained in:
wjh 2024-09-04 16:34:23 +08:00 committed by sealday
parent da8df6ea63
commit 8a4bce3add

View File

@ -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;