1
This commit is contained in:
parent
ba5ff140bd
commit
1917d69c4a
@ -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,XiaoShouFid) AS '分摊序号'
|
||||
,ROW_NUMBER() OVER(PARTITION BY T1.ShouKuanFid ORDER BY T1.ShouKuanFid,ShouKuanFDate,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 '付款名称'
|
||||
,T3.FNAME AS '合同名称'
|
||||
,ISNULL(T3.FNAME,'') AS '合同名称'
|
||||
,0 AS '款到发货'
|
||||
,0 AS '一至六个月'
|
||||
,0 AS '七至十二个月'
|
||||
|
||||
@ -328,15 +328,16 @@ 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() == "合计")
|
||||
|
||||
@ -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,6 +282,11 @@ 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
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user