From 4b3886b07255ab31cce916f592a7cc90b4c90a78 Mon Sep 17 00:00:00 2001 From: "hello@lv" <2256334253@qq.com> Date: Thu, 18 Apr 2024 15:36:30 +0800 Subject: [PATCH] fix_contract_no_products_assfees (#759) Co-authored-by: lyx <2027667395@qq.com> Co-authored-by: sealday Reviewed-on: https://git.daoyoucloud.com/daoyoucloud/tachybase/pulls/759 Reviewed-by: sealday Co-authored-by: hello@lv <2256334253@qq.com> Co-committed-by: hello@lv <2256334253@qq.com> --- .changeset/old-readers-look.md | 5 +++++ .../src/server/services/contract-rule-service.ts | 2 +- 2 files changed, 6 insertions(+), 1 deletion(-) create mode 100644 .changeset/old-readers-look.md diff --git a/.changeset/old-readers-look.md b/.changeset/old-readers-look.md new file mode 100644 index 000000000..271ae4972 --- /dev/null +++ b/.changeset/old-readers-look.md @@ -0,0 +1,5 @@ +--- +"@hera/plugin-rental": patch +--- + +合同费用校验(无产品关联先跳过) diff --git a/packages/plugins/@hera/plugin-rental/src/server/services/contract-rule-service.ts b/packages/plugins/@hera/plugin-rental/src/server/services/contract-rule-service.ts index 9b71a4646..4370fe8c5 100644 --- a/packages/plugins/@hera/plugin-rental/src/server/services/contract-rule-service.ts +++ b/packages/plugins/@hera/plugin-rental/src/server/services/contract-rule-service.ts @@ -111,7 +111,7 @@ export class ContractRuleService { // const feeProduct = plan.fee_items.filter((item) => item.lease_item_id === options.values.lease_product.id // 确定options.values.lease_product是否为数组格式) } else { const add = options.values.fee_product; - if (!add) return; + if (!Array.isArray(add)) return; const feeData = plan.fee_items.filter((item) => !item.lease_item_id).map((item) => item.fee_product); feeData.forEach((item) => { const isHas = add.find((p) => p.id === item.id);