Compare commits

..

2 Commits

Author SHA1 Message Date
liqionghai
6640015719 Merge branch 'main' of http://8.130.121.29:3000/Develop/PiolotTH_ReportFrom 2025-11-03 14:19:29 +08:00
liqionghai
1917d69c4a 1 2025-09-18 10:15:46 +08:00
3 changed files with 18 additions and 12 deletions

View File

@ -190,7 +190,7 @@ def BuilderReportSqlAndTempTable(Filter,tableName):
SELECT SELECT
T1.Fid,T1.XiaoShouFid,T1.ShouKuanFid,T1.ShouKuanBillNo T1.Fid,T1.XiaoShouFid,T1.ShouKuanFid,T1.ShouKuanBillNo
,CAST(ISNULL(T2.分摊比例,0)AS decimal(10,2)) AS '分摊比例' ,CAST(ISNULL(T2.分摊比例,0)AS decimal(10,2)) AS '分摊比例'
,ROW_NUMBER() OVER(PARTITION BY T1.ShouKuanFid ORDER BY T1.ShouKuanFid,XiaoShouFid) AS '分摊序号' ,ROW_NUMBER() OVER(PARTITION BY T1.ShouKuanFid ORDER BY T1.ShouKuanFid,ShouKuanFDate,XiaoShouFid) AS '分摊序号'
,FORMAT(T1.ShouKuanFDate,'yyyy-MM-dd') AS '业务日期' ,FORMAT(T1.ShouKuanFDate,'yyyy-MM-dd') AS '业务日期'
,CAST('' AS VARCHAR(500)) AS '收款明细' ,CAST('' AS VARCHAR(500)) AS '收款明细'
,CAST('' AS VARCHAR(500)) AS '日期' ,CAST('' AS VARCHAR(500)) AS '日期'
@ -237,7 +237,7 @@ def BuilderReportSqlAndTempTable(Filter,tableName):
,0 AS '金额' ,0 AS '金额'
,ISNULL(T1.FRECAMOUNT,0)-(ISNULL(T1.F_AMOUNT,0)*ISNULL(T1.FEXCHANGERATE,0)) AS '分摊金额' ,ISNULL(T1.FRECAMOUNT,0)-(ISNULL(T1.F_AMOUNT,0)*ISNULL(T1.FEXCHANGERATE,0)) AS '分摊金额'
,'' AS '付款名称' ,'' AS '付款名称'
,T3.FNAME AS '合同名称' ,ISNULL(T3.FNAME,'') AS '合同名称'
,0 AS '款到发货' ,0 AS '款到发货'
,0 AS '一至六个月' ,0 AS '一至六个月'
,0 AS '七至十二个月' ,0 AS '七至十二个月'

View File

@ -328,15 +328,16 @@ namespace Pilot.Report.Exploitation.AccountsReceivable
//{ //{
// continue; // continue;
//} //}
DateTime dateTime;
string date = string.IsNullOrWhiteSpace(list[i]["DATE"].ToString()) ? "" : Convert.ToDateTime(list[i]["DATE"].ToString().Split(' ')[0]).ToString("yyyy/M/d"); string date = string.IsNullOrWhiteSpace(list[i]["DATE"].ToString()) ? "" : Convert.ToDateTime(list[i]["DATE"].ToString().Split(' ')[0]).ToString("yyyy/M/d");
string ShipmentsDate = string.IsNullOrWhiteSpace(list[i]["ShipmentsDate"].ToString()) ? "" : string.Join(",",list[i]["ShipmentsDate"].ToString().Split(' ')[0].Split(',').Select(p=>Convert.ToDateTime(p).ToString("yyyy/M/d")).Distinct().ToList()); //string ShipmentsDate = string.IsNullOrWhiteSpace(list[i]["ShipmentsDate"].ToString()) ? "" : string.Join(",",list[i]["ShipmentsDate"].ToString().Split(' ')[0].Split(',').Select(p=> Convert.ToDateTime(p).ToString("yyyy/M/d")).Distinct().ToList());
string PaymentDate = string.IsNullOrWhiteSpace(list[i]["PaymentDate"].ToString()) ? "" : list[i]["PaymentDate"].ToString().Split(' ')[0]; string PaymentDate = string.IsNullOrWhiteSpace(list[i]["PaymentDate"].ToString()) ? "" : list[i]["PaymentDate"].ToString().Split(' ')[0];
string BillingDate = string.IsNullOrWhiteSpace(list[i]["ZPBillingDate"].ToString()) ? "" : string.Join(",", list[i]["ZPBillingDate"].ToString().Split(' ')[0].Split(',').Select(p => Convert.ToDateTime(p).ToString("yyyy/M/d")).Distinct().ToList()); //string BillingDate = string.IsNullOrWhiteSpace(list[i]["ZPBillingDate"].ToString()) ? "" : string.Join(",", list[i]["ZPBillingDate"].ToString().Split(' ')[0].Split(',').Select(p => Convert.ToDateTime(p).ToString("yyyy/M/d")).Distinct().ToList());
string ReturnDate = string.IsNullOrWhiteSpace(list[i]["ReturnDate"].ToString()) ? "" : list[i]["ReturnDate"].ToString().Split(' ')[0]; string ReturnDate = string.IsNullOrWhiteSpace(list[i]["ReturnDate"].ToString()) ? "" : list[i]["ReturnDate"].ToString().Split(' ')[0];
//BillingDate += string.IsNullOrWhiteSpace(list[i]["PPBillingDate"].ToString()) ? "" : (string.IsNullOrWhiteSpace(BillingDate) ?"":",")+list[i]["PPBillingDate"].ToString().Split(' ')[0]; //BillingDate += string.IsNullOrWhiteSpace(list[i]["PPBillingDate"].ToString()) ? "" : (string.IsNullOrWhiteSpace(BillingDate) ?"":",")+list[i]["PPBillingDate"].ToString().Split(' ')[0];
string ShipmentsDate = string.IsNullOrWhiteSpace(list[i]["ShipmentsDate"].ToString()) ? "" : string.Join(",", list[i]["ShipmentsDate"].ToString().Split(' ')[0].Split(',').Select(p => DateTime.TryParse(p,out dateTime) ? Convert.ToDateTime(p).ToString("yyyy/M/d"): p).Distinct().ToList());
string BillingDate = string.IsNullOrWhiteSpace(list[i]["ZPBillingDate"].ToString()) ? "" : string.Join(",", list[i]["ZPBillingDate"].ToString().Split(' ')[0].Split(',').Select(p => DateTime.TryParse(p, out dateTime) ? Convert.ToDateTime(p).ToString("yyyy/M/d") : p).Distinct().ToList());
//将合计行放到最下方 //将合计行放到最下方
IRow rowi = sheet.CreateRow(j + i); IRow rowi = sheet.CreateRow(j + i);
//if (list[i]["Number"].ToString() == "合计") //if (list[i]["Number"].ToString() == "合计")

View File

@ -227,12 +227,12 @@ WHERE B.
WHERE A.[K3数据] = 0 WHERE A.[K3数据] = 0
GROUP BY FID GROUP BY FID
UPDATE A --UPDATE A
SET --A.ShippedDebt = B.[],-- A.InvoicedDebt = B.[已开票欠款],--A.OwedTickets = B.[欠票], --SET --A.ShippedDebt = B.[],-- A.InvoicedDebt = B.[已开票欠款],--A.OwedTickets = B.[欠票],
A.IsEnded = B.[] --A.IsEnded = B.[]
FROM YingShouZhanKuanMX_GZTH A --FROM YingShouZhanKuanMX_GZTH A
INNER JOIN #TEMP4 B ON A.FID = B.FID --INNER JOIN #TEMP4 B ON A.FID = B.FID
WHERE A.[K3数据] = 0 --WHERE A.[K3数据] = 0
--, --,
UPDATE A UPDATE A
@ -282,6 +282,11 @@ WHERE B.
FROM YingShouZhanKuanMX_GZTH GROUP BY FID) B ON A.FID = B.FID FROM YingShouZhanKuanMX_GZTH GROUP BY FID) B ON A.FID = B.FID
WHERE A.[K3数据] = 0 AND A.row_num = 1 WHERE A.[K3数据] = 0 AND A.row_num = 1
UPDATE A
SET A.IsEnded = CASE WHEN A.OwedTickets = 0 AND A.InvoicedDebt = 0 AND A.ShippedDebt = 0 AND A.OrderAmount = A.ShipmentsAmount THEN '已完结' ELSE '未完结' END
FROM YingShouZhanKuanMX_GZTH A
WHERE A.[K3数据] = 0 AND A.row_num = 1
DROP TABLE #TEMP3 DROP TABLE #TEMP3
DROP TABLE #TEMP4 DROP TABLE #TEMP4