diff --git a/.changeset/pre.json b/.changeset/pre.json index 197a7ca4d..4fd8106a7 100644 --- a/.changeset/pre.json +++ b/.changeset/pre.json @@ -103,6 +103,7 @@ "six-dolphins-mix", "slimy-sloths-repeat", "smart-jokes-whisper", + "tricky-eyes-knock", "unlucky-dolls-hope" ] } diff --git a/.changeset/tricky-eyes-knock.md b/.changeset/tricky-eyes-knock.md new file mode 100644 index 000000000..bca0a0faf --- /dev/null +++ b/.changeset/tricky-eyes-knock.md @@ -0,0 +1,5 @@ +--- +"@hera/plugin-rental": patch +--- + +报价单pdf报价不显示异常 diff --git a/packages/plugins/@hera/plugin-rental/package.json b/packages/plugins/@hera/plugin-rental/package.json index b14a9e9ff..3be7429e6 100644 --- a/packages/plugins/@hera/plugin-rental/package.json +++ b/packages/plugins/@hera/plugin-rental/package.json @@ -1,7 +1,7 @@ { "name": "@hera/plugin-rental", "displayName": "professional construction materials rental system - customized based on hera", - "version": "1.7.6-alpha.8", + "version": "1.7.6-alpha.9", "description": "Offering a standardized leasing management system, encompassing comprehensive administration from materials to contracts to labor personnel, while providing a robust financial management mechanism, and real-time monitoring of the operational capacity of the leasing system.", "keywords": [ "System management" diff --git a/packages/plugins/@hera/plugin-rental/src/server/services/record-pdf-service.ts b/packages/plugins/@hera/plugin-rental/src/server/services/record-pdf-service.ts index 21f7e8685..c0981b167 100644 --- a/packages/plugins/@hera/plugin-rental/src/server/services/record-pdf-service.ts +++ b/packages/plugins/@hera/plugin-rental/src/server/services/record-pdf-service.ts @@ -42,8 +42,13 @@ export class RecordPdfService { data['count'] = item.count; data['unit'] = item.unit; } else if (item.conversion_logic_id === ConversionLogics.Product) { - if (item.convertible) (data['count'] = item.count * item.ratio), (data['unit'] = item.conversion_unit); - else (data['count'] = item.count), (data['unit'] = item.unit); + if (item.convertible) { + data['count'] = item.count * item.ratio; + data['unit'] = item.conversion_unit; + } else { + data['count'] = item.count; + data['unit'] = item.unit; + } } else if (item.conversion_logic_id === ConversionLogics.ProductWeight) { data['count'] = item.count * item.weight; data['unit'] = 'KG'; @@ -102,16 +107,24 @@ export class RecordPdfService { data['total'] = lease.count; data['conversion_unit'] = lease.unit; } else if (lease.conversion_logic_id === ConversionLogics.Product) { - if (lease.convertible) - (data['total'] = lease.count * lease.ratio), (data['conversion_unit'] = lease.conversion_unit); - else (data['total'] = lease.count), (data['conversion_unit'] = lease.unit); + if (lease.convertible) { + data['total'] = lease.count * lease.ratio; + data['conversion_unit'] = lease.conversion_unit; + } else { + data['total'] = lease.count; + data['conversion_unit'] = lease.unit; + } } else if (lease.conversion_logic_id === ConversionLogics.ProductWeight) { data['total'] = lease.count * lease.weight; data['conversion_unit'] = 'KG'; } else if (lease.conversion_logic_id === ConversionLogics.ActualWeight) { - if (lease.convertible) - (data['total'] = lease.count * lease.ratio), (data['conversion_unit'] = lease.conversion_unit); - else (data['total'] = lease.count), (data['conversion_unit'] = lease.unit); + if (lease.convertible) { + data['total'] = lease.count * lease.ratio; + data['conversion_unit'] = lease.conversion_unit; + } else { + data['total'] = lease.count; + data['conversion_unit'] = lease.unit; + } } else { data['conversion_unit'] = 'KG'; if (lease.wr?.conversion_logic_id === ConversionLogics.Keep) { @@ -135,8 +148,9 @@ export class RecordPdfService { recordData.category === RecordCategory.purchase || recordData.category === RecordCategory.staging || recordData.category === RecordCategory.inventory - ) + ) { return; + } // 人工录入没有数量 if (item.count_source === SourcesType.staff && !item.fee_count) return; // 出库单,计数为入库量 @@ -156,8 +170,11 @@ export class RecordPdfService { if (item.conversion_logic_id === ConversionLogics.Keep) { data['total'] = data.count1; } else if (item.conversion_logic_id === ConversionLogics.Product) { - if (item.convertible) data['total'] = data.count1 * item.product_ratio; - else data['total'] = data.count1; + if (item.convertible) { + data['total'] = data.count1 * item.product_ratio; + } else { + data['total'] = data.count1; + } } else if (item.conversion_logic_id === ConversionLogics.ProductWeight) { data['total'] = data.count1 * item.product_weight; } else if (item.conversion_logic_id === ConversionLogics.ActualWeight) { diff --git a/packages/plugins/@hera/plugin-rental/src/server/sqls/pdf_record_lease.sql b/packages/plugins/@hera/plugin-rental/src/server/sqls/pdf_record_lease.sql index d44afa8ee..78c7e1078 100644 --- a/packages/plugins/@hera/plugin-rental/src/server/sqls/pdf_record_lease.sql +++ b/packages/plugins/@hera/plugin-rental/src/server/sqls/pdf_record_lease.sql @@ -2,16 +2,24 @@ SELECT r.category, ri.comment AS item_comment, - ri.*, - p.*, - pc.*, + ri.count, + ri.product_id, + p.label, + p.ratio, + p.weight, + p.category_id, pc.name AS product_category_name, - lr.*, + pc.unit, + pc.convertible, + pc.conversion_unit, lr.unit_price AS price_price, vp."label" AS price_label, lr."comment" AS price_comment, - cpli.*, - rwi.*, + rwi.product_category_id, + CASE + WHEN r.category = '0' THEN cpli.conversion_logic_id + ELSE lr.conversion_logic_id + END AS conversion_logic_id, CASE WHEN ucl.id > 4 AND c.id IS NOT NULL THEN (