diff --git a/packages/plugins/@hera/plugin-rental/src/server/pdf-documents/records-documentV2.tsx b/packages/plugins/@hera/plugin-rental/src/server/pdf-documents/records-documentV2.tsx index 9140165ab..7e9447ecc 100644 --- a/packages/plugins/@hera/plugin-rental/src/server/pdf-documents/records-documentV2.tsx +++ b/packages/plugins/@hera/plugin-rental/src/server/pdf-documents/records-documentV2.tsx @@ -456,7 +456,9 @@ const PreviewDocument = ({ record.map((item) => ( {item.name} - {!item.count ? '' : formatQuantity(item.count, 2) + item.unit} + + {!item.count || item.isFee ? '' : formatQuantity(item.count, 2) + item.unit} + {(printSetup === PrintSetup.Display && !item.product_id && !item.isTotal) || (printSetup === PrintSetup.Manual && !item.product_id && !item.isTotal) @@ -515,7 +517,7 @@ const PreviewDocument = ({ {item.left_name} - {!item.left_count ? '' : formatQuantity(item.left_count, 2) + item.left_unit} + {!item.left_count || item.left_isFee ? '' : formatQuantity(item.left_count, 2) + item.left_unit} {(printSetup === PrintSetup.Display && !item.left_product_id && !item.left_isTotal) || @@ -535,7 +537,7 @@ const PreviewDocument = ({ {item.right_name} - {!item.right_count ? '' : formatQuantity(item.right_count, 2) + item.right_unit} + {!item.right_count || item.right_isFee ? '' : formatQuantity(item.right_count, 2) + item.right_unit} {(printSetup === PrintSetup.Display && !item.right_product_id && !item.right_isTotal) || diff --git a/packages/plugins/@hera/plugin-rental/src/server/services/record-service.ts b/packages/plugins/@hera/plugin-rental/src/server/services/record-service.ts index bdf19c34b..b83bfedea 100644 --- a/packages/plugins/@hera/plugin-rental/src/server/services/record-service.ts +++ b/packages/plugins/@hera/plugin-rental/src/server/services/record-service.ts @@ -76,7 +76,7 @@ export class RecordService { async _checkPlateNumber(record: MagicAttributeModel, options: CreateOptions) { const { transaction, context } = options; if (record.dataValues?.vehicles) { - const ids = record.dataValues.vehicles.join(','); + const ids = record.dataValues.vehicles.filter((item) => typeof item === 'number').join(','); const vehicles = await this.db.sequelize.query(`select * from vehicles where id in (${ids})`, { transaction, });