From e4166d7dec47f23ae29b4d91393f7ed43cfc67d6 Mon Sep 17 00:00:00 2001 From: "bai.zixv" Date: Mon, 1 Jul 2024 17:31:20 +0800 Subject: [PATCH] fix: invoice, rental sql invoice tax value (#1250) Reviewed-on: https://git.daoyoucloud.com/daoyoucloud/tachybase/pulls/1250 Co-authored-by: bai.zixv Co-committed-by: bai.zixv --- .../plugin-rental/src/server/sqls/view_invoices_tax.sql | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/packages/plugins/@hera/plugin-rental/src/server/sqls/view_invoices_tax.sql b/packages/plugins/@hera/plugin-rental/src/server/sqls/view_invoices_tax.sql index e47345221..a51829290 100644 --- a/packages/plugins/@hera/plugin-rental/src/server/sqls/view_invoices_tax.sql +++ b/packages/plugins/@hera/plugin-rental/src/server/sqls/view_invoices_tax.sql @@ -12,6 +12,10 @@ WITH RECURSIVE category FROM invoice_input + WHERE + "category" = '0' + -- 筛选出进项发票种类为 0-专用发票; 0-专用发票,1-普通发票;只有专用发票计入增值税计算 + -- 完税凭证加入增值税计算 99-完税凭证 UNION ALL SELECT purchaser_id AS company_id, -- 完税凭证,同发票进项字段 @@ -44,7 +48,6 @@ WITH RECURSIVE WHERE "date" >= '2022-01-01' -- 筛选出日期在'2022-01-01'之后的数据 AND "state" = '1' -- 筛选出所有状态为正常的记录, 正常-1,作废-2 - AND "category" = '0' -- 筛选出进项发票种类为 0-专用发票; 0-专用发票,1-普通发票;只有专用发票计入增值税计算 GROUP BY company_id, "MONTH"