Compare commits

..

No commits in common. "66400157198d03f5c9beff3415a36c91e5819995" and "27a39836e558340e9cf262655d2b8c1acccb759b" have entirely different histories.

3 changed files with 12 additions and 18 deletions

View File

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

View File

@ -328,16 +328,15 @@ namespace Pilot.Report.Exploitation.AccountsReceivable
//{
// continue;
//}
DateTime dateTime;
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 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];
//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);
//if (list[i]["Number"].ToString() == "合计")

View File

@ -227,12 +227,12 @@ WHERE B.
WHERE A.[K3数据] = 0
GROUP BY FID
--UPDATE A
--SET --A.ShippedDebt = B.[],-- A.InvoicedDebt = B.[已开票欠款],--A.OwedTickets = B.[欠票],
--A.IsEnded = B.[]
--FROM YingShouZhanKuanMX_GZTH A
--INNER JOIN #TEMP4 B ON A.FID = B.FID
--WHERE A.[K3数据] = 0
UPDATE A
SET --A.ShippedDebt = B.[],-- A.InvoicedDebt = B.[已开票欠款],--A.OwedTickets = B.[欠票],
A.IsEnded = B.[]
FROM YingShouZhanKuanMX_GZTH A
INNER JOIN #TEMP4 B ON A.FID = B.FID
WHERE A.[K3数据] = 0
--,
UPDATE A
@ -282,11 +282,6 @@ WHERE B.
FROM YingShouZhanKuanMX_GZTH GROUP BY FID) B ON A.FID = B.FID
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 #TEMP4