fix: 個人費用彙整表及扣繳明細排除已作廢領據

This commit is contained in:
2026-09-14 13:32:22 +08:00
parent 95e8109fbd
commit 6ad64ee268
@@ -310,9 +310,10 @@ namespace Education
, ISNULL(B.合計金額, 0) - ISNULL(B.應扣繳稅額, 0) - ISNULL(B.服務費, 0) + ISNULL(C.合計, 0) 付款金額 , ISNULL(B.合計金額, 0) - ISNULL(B.應扣繳稅額, 0) - ISNULL(B.服務費, 0) + ISNULL(C.合計, 0) 付款金額
, row_number() over (order by A.領款人姓名) as rowid , row_number() over (order by A.領款人姓名) as rowid
from 領據 A from 領據 A
left join 勞務費 B on A.編號 = B.領據編號 and B.編號 is not NULL and B.編號 <> '' left join 勞務費 B on A.編號 = B.領據編號 and B.編號 is not NULL and B.編號 <> '' and ISNULL(B.作廢, 0) <> 1
left join 差旅費 C on A.編號 = C.領據編號 and C.編號 is not NULL and C.編號 <> '' left join 差旅費 C on A.編號 = C.領據編號 and C.編號 is not NULL and C.編號 <> '' and ISNULL(C.作廢, 0) <> 1
where 1=1 where 1=1
and ISNULL(A.作廢, 0) <> 1
"; ";
AddWhere(cmdSelect, ref noInput, , , , null, null, null, null, null, ); AddWhere(cmdSelect, ref noInput, , , , null, null, null, null, null, );
@@ -411,7 +412,9 @@ namespace Education
, row_number() over (order by A.領款人姓名) as rowid , row_number() over (order by A.領款人姓名) as rowid
from 領據 A from 領據 A
join 勞務費 B on A.編號 = B.領據編號 and B.編號 is not NULL and B.編號 <> '' join 勞務費 B on A.編號 = B.領據編號 and B.編號 is not NULL and B.編號 <> ''
where 1=1"; where 1=1
and ISNULL(A.作廢, 0) <> 1
and ISNULL(B.作廢, 0) <> 1";
List<WhereItem> wheres = new List<WhereItem>(); List<WhereItem> wheres = new List<WhereItem>();
if ( != null && != null) if ( != null && != null)