This commit is contained in:
2025-07-18 14:11:14 +08:00
parent a8909d9268
commit 4e4c9f04ff
3 changed files with 102 additions and 69 deletions

View File

@@ -93,7 +93,7 @@ namespace Pilot.Report.Exploitation.AccountsReceivableStatements
header.AddChild("PPBillingDate", new LocaleValue("普票开票日期"), SqlStorageType.Sqlvarchar);
header.AddChild("PPBillingAmount", new LocaleValue("普票开票金额"), SqlStorageType.SqlDecimal);
header.AddChild("ZPBillingDate", new LocaleValue("专票开票日期"), SqlStorageType.Sqlvarchar);
header.AddChild("ZPBillingAmount", new LocaleValue("专票开票金额"), SqlStorageType.Sqlvarchar);
header.AddChild("ZPBillingAmount", new LocaleValue("专票开票金额"), SqlStorageType.SqlDecimal);
header.AddChild("BillingAmount", new LocaleValue("开票金额"), SqlStorageType.SqlDecimal);
header.AddChild("PaymentDate", new LocaleValue("回款日期"), SqlStorageType.Sqlvarchar);
header.AddChild("PaymentAmount", new LocaleValue("回款金额"), SqlStorageType.SqlDecimal);
@@ -163,26 +163,29 @@ namespace Pilot.Report.Exploitation.AccountsReceivableStatements
", FSDate,fDate,ZZFID,fClient,XSYFID,ZZHTH);
sql += string.Format(@"/*dialect*/
INSERT INTO YingShouZhanKuanMX_GZTH(NUMBER,FQTY,FTAXPRICE,FALLAMOUNT,OrderAmount,ShipmentsNum,ShipmentsAmount,
ReturnNum,ReturnAmount,BillingAmount,PaymentAmount,ShippedDebt,InvoicedDebt,OwedTickets)
SELECT
'合计',
SUM(FQTY),
SUM(FTAXPRICE),
SUM(FALLAMOUNT),
SUM(OrderAmount),
SUM(ShipmentsNum),
SUM(ShipmentsAmount),
SUM(ReturnNum),
SUM(ReturnAmount),
SUM(BillingAmount),
SUM(PaymentAmount),
SUM(ShippedDebt),
SUM(InvoicedDebt),
SUM(OwedTickets)
FROM
YingShouZhanKuanMX_GZTH
where 1=1
INSERT INTO YingShouZhanKuanMX_GZTH(NUMBER,FQTY,FTAXPRICE,FALLAMOUNT,OrderAmount,ShipmentsNum,ShipmentsAmount,
ReturnNum,ReturnAmount,BillingAmount,PaymentAmount,ShippedDebt,InvoicedDebt,OwedTickets,[K3退货金额],PPBillingAmount,ZPBillingAmount,[星空退货金额],[星空发货金额])
SELECT
'合计',
SUM(FQTY),
SUM(FTAXPRICE),
SUM(FALLAMOUNT),
SUM(OrderAmount),
SUM(ShipmentsNum),
SUM(ShipmentsAmount),
SUM(ReturnNum),
SUM(ReturnAmount),
SUM(BillingAmount),
SUM(PaymentAmount),
SUM(ShippedDebt),
SUM(InvoicedDebt),
SUM(OwedTickets),sum(K3退货金额) ,
SUM(PPBillingAmount),
SUM(ZPBillingAmount),
sum(星空退货金额),SUM(星空发货金额)
FROM
YingShouZhanKuanMX_GZTH
where 1=1
");
if (fGROUP == "2")
{
@@ -190,12 +193,12 @@ namespace Pilot.Report.Exploitation.AccountsReceivableStatements
}
sql += string.Format(@"
SELECT
ROW_NUMBER() OVER (ORDER BY [FID]) AS FIDENTITYID,
ROW_NUMBER() OVER (ORDER BY [FID],OrderAmount desc) AS FIDENTITYID,
*
INTO {0}
FROM YingShouZhanKuanMX_GZTH
WHERE 1=1
",tableName);
", tableName);
if (fGROUP == "2")
{
sql += string.Format("AND FID IN (SELECT FID FROM YingShouZhanKuanMX_GZTH WHERE IsEnded = '未完结')");