1
This commit is contained in:
parent
a81583fe4b
commit
a8c575b958
@ -155,12 +155,22 @@ namespace Pilot.Report.Exploitation.AccountsReceivableStatements
|
|||||||
EXEC UpdateYSDZBJY_GZTH
|
EXEC UpdateYSDZBJY_GZTH
|
||||||
", FSDate, fDate, ZZFID, fClient,XSYFID,ZZHTH,SFQJFWDZ);
|
", FSDate, fDate, ZZFID, fClient,XSYFID,ZZHTH,SFQJFWDZ);
|
||||||
|
|
||||||
sql += string.Format(@"
|
sql += string.Format($@"
|
||||||
|
INSERT INTO YingShouZhanKuanJY_GZTH(FID,NUMBER,PaymentAmount,ShippedDebt,InvoicedDebt)
|
||||||
|
Select 999998,'待核销'
|
||||||
|
,Sum((FRECAMOUNTFOR-F_AMOUNT)*FEXCHANGERATE) AS DHXJE
|
||||||
|
,-Sum((FRECAMOUNTFOR-F_AMOUNT)*FEXCHANGERATE) AS YCHQK
|
||||||
|
,-Sum((FRECAMOUNTFOR-F_AMOUNT)*FEXCHANGERATE) AS YKPQK
|
||||||
|
From T_AR_RECEIVEBILL T1
|
||||||
|
Where 1=1
|
||||||
|
And FDOCUMENTSTATUS = 'C'
|
||||||
|
And FCONTACTUNIT ={fClient}
|
||||||
|
|
||||||
INSERT INTO YingShouZhanKuanJY_GZTH(FID,Number,OrderAmount,ShipmentsAmount,FBillAllAmount,
|
INSERT INTO YingShouZhanKuanJY_GZTH(FID,Number,OrderAmount,ShipmentsAmount,FBillAllAmount,
|
||||||
FALLAmountFor,PaymentAmount,ShippedDebt,InvoicedDebt,OwedTickets
|
FALLAmountFor,PaymentAmount,ShippedDebt,InvoicedDebt,OwedTickets
|
||||||
,[K3发货数量],[K3发货金额],[K3退货数量],[K3退货金额],[星空发货数量],[星空发货金额],[星空退货数量],[星空退货金额],PPFALLAmountFor,ZPFALLAmountFor,[K3专票金额],[K3普票金额])
|
,[K3发货数量],[K3发货金额],[K3退货数量],[K3退货金额],[星空发货数量],[星空发货金额],[星空退货数量],[星空退货金额],PPFALLAmountFor,ZPFALLAmountFor,[K3专票金额],[K3普票金额])
|
||||||
Select
|
Select
|
||||||
999998,
|
999999,
|
||||||
'合计',
|
'合计',
|
||||||
SUM(OrderAmount) as OrderAmount,
|
SUM(OrderAmount) as OrderAmount,
|
||||||
SUM(ShipmentsAmount) as ShipmentsAmount,
|
SUM(ShipmentsAmount) as ShipmentsAmount,
|
||||||
@ -191,7 +201,7 @@ namespace Pilot.Report.Exploitation.AccountsReceivableStatements
|
|||||||
}
|
}
|
||||||
sql += string.Format(@"
|
sql += string.Format(@"
|
||||||
SELECT
|
SELECT
|
||||||
ROW_NUMBER() OVER (ORDER BY [FID]) AS FIDENTITYID,
|
ROW_NUMBER() OVER (ORDER BY [DATE] DESC,[FID]) AS FIDENTITYID,
|
||||||
*
|
*
|
||||||
INTO {0}
|
INTO {0}
|
||||||
FROM YingShouZhanKuanJY_GZTH
|
FROM YingShouZhanKuanJY_GZTH
|
||||||
|
|||||||
@ -164,11 +164,22 @@ namespace Pilot.Report.Exploitation.AccountsReceivableStatements
|
|||||||
|
|
||||||
", FSDate,fDate,ZZFID,fClient,XSYFID,ZZHTH,SFQJFWDZ);
|
", FSDate,fDate,ZZFID,fClient,XSYFID,ZZHTH,SFQJFWDZ);
|
||||||
sql += string.Format($@"/*dialect*/
|
sql += string.Format($@"/*dialect*/
|
||||||
|
INSERT INTO YingShouZhanKuanMX_GZTH(FID,NUMBER,PaymentAmount,ShippedDebt,InvoicedDebt)
|
||||||
|
Select 999998,'待核销'
|
||||||
|
,Sum((FRECAMOUNTFOR-F_AMOUNT)*FEXCHANGERATE) AS DHXJE
|
||||||
|
,-Sum((FRECAMOUNTFOR-F_AMOUNT)*FEXCHANGERATE) AS YCHQK
|
||||||
|
,-Sum((FRECAMOUNTFOR-F_AMOUNT)*FEXCHANGERATE) AS YKPQK
|
||||||
|
From T_AR_RECEIVEBILL T1
|
||||||
|
Where 1=1
|
||||||
|
And FDOCUMENTSTATUS = 'C'
|
||||||
|
And FCONTACTUNIT ={fClient}
|
||||||
|
|
||||||
|
|
||||||
INSERT INTO YingShouZhanKuanMX_GZTH(FID,NUMBER,FQTY,FALLAMOUNT,OrderAmount,ShipmentsNum,ShipmentsAmount,
|
INSERT INTO YingShouZhanKuanMX_GZTH(FID,NUMBER,FQTY,FALLAMOUNT,OrderAmount,ShipmentsNum,ShipmentsAmount,
|
||||||
ReturnNum,ReturnAmount,BillingAmount,PaymentAmount,ShippedDebt,InvoicedDebt,OwedTickets,[K3退货金额],PPBillingAmount,ZPBillingAmount,[星空退货金额],[星空发货金额]
|
ReturnNum,ReturnAmount,BillingAmount,PaymentAmount,ShippedDebt,InvoicedDebt,OwedTickets,[K3退货金额],PPBillingAmount,ZPBillingAmount,[星空退货金额],[星空发货金额]
|
||||||
,[K3发货数量],[K3发货金额],[星空发货数量],[K3退货数量],[星空退货数量],[K3专票金额],[K3普票金额])
|
,[K3发货数量],[K3发货金额],[星空发货数量],[K3退货数量],[星空退货数量],[K3专票金额],[K3普票金额])
|
||||||
SELECT
|
SELECT
|
||||||
999998,
|
999999,
|
||||||
'合计',
|
'合计',
|
||||||
SUM(FQTY),
|
SUM(FQTY),
|
||||||
SUM(FALLAMOUNT),
|
SUM(FALLAMOUNT),
|
||||||
@ -190,12 +201,7 @@ namespace Pilot.Report.Exploitation.AccountsReceivableStatements
|
|||||||
YingShouZhanKuanMX_GZTH
|
YingShouZhanKuanMX_GZTH
|
||||||
where 1=1
|
where 1=1
|
||||||
|
|
||||||
INSERT INTO YingShouZhanKuanMX_GZTH(FID,NUMBER,PaymentAmount)
|
|
||||||
Select 999999,'待核销',Sum((FRECAMOUNTFOR-F_AMOUNT)*FEXCHANGERATE) AS DHXJE
|
|
||||||
From T_AR_RECEIVEBILL T1
|
|
||||||
Where 1=1
|
|
||||||
And FDOCUMENTSTATUS = 'C'
|
|
||||||
And FCONTACTUNIT ={fClient}
|
|
||||||
");
|
");
|
||||||
if (fGROUP == "2")
|
if (fGROUP == "2")
|
||||||
{
|
{
|
||||||
|
|||||||
@ -290,7 +290,7 @@ namespace Pilot.Report.Exploitation.AccountsReceivable
|
|||||||
//将新创建或获取的单元格的值修改
|
//将新创建或获取的单元格的值修改
|
||||||
cell22.SetCellValue("");
|
cell22.SetCellValue("");
|
||||||
var YFHpriceSumZW = ToChineseNumber(YFHpriceSum, Context);
|
var YFHpriceSumZW = ToChineseNumber(YFHpriceSum, Context);
|
||||||
cell3.SetCellValue("贵公司截至 " + (string.IsNullOrWhiteSpace(fDate)? DateTime.Now.ToString("yyyy-MM-dd") : fDate) + " 共欠我公司货款金额为:" + YFHpriceSum.ToString("N") + "元(大写:"+ YFHpriceSumZW + ")");
|
cell3.SetCellValue("贵公司截至 " + (string.IsNullOrWhiteSpace(fDate)? DateTime.Now.AddDays(-1).ToString("yyyy-MM-dd") : fDate) + " 共欠我公司货款金额为:" + YFHpriceSum.ToString("N") + "元(大写:"+ YFHpriceSumZW + ")");
|
||||||
//将新创建或获取的单元格的值修改
|
//将新创建或获取的单元格的值修改
|
||||||
cell.SetCellValue("尊敬的 " + fClient + " 客户您好,我公司已根据合同/订单的要求向贵公司交付相关产品并请验收确认,鉴于我公司对贵公司已通知发货部分的交付义务已完成,");
|
cell.SetCellValue("尊敬的 " + fClient + " 客户您好,我公司已根据合同/订单的要求向贵公司交付相关产品并请验收确认,鉴于我公司对贵公司已通知发货部分的交付义务已完成,");
|
||||||
cell2.SetCellValue(fClient);
|
cell2.SetCellValue(fClient);
|
||||||
@ -318,16 +318,16 @@ namespace Pilot.Report.Exploitation.AccountsReceivable
|
|||||||
|
|
||||||
for (var i = 0; i < list.Count; i++)
|
for (var i = 0; i < list.Count; i++)
|
||||||
{
|
{
|
||||||
//不导出待核销
|
////不导出待核销
|
||||||
if (list[i]["Number"].ToString() == "待核销")
|
//if (list[i]["Number"].ToString() == "待核销")
|
||||||
{
|
//{
|
||||||
continue;
|
// continue;
|
||||||
}
|
//}
|
||||||
|
|
||||||
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")).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")).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];
|
||||||
@ -340,7 +340,7 @@ namespace Pilot.Report.Exploitation.AccountsReceivable
|
|||||||
// j = 12;
|
// j = 12;
|
||||||
//}
|
//}
|
||||||
ICell c1 = rowi.CreateCell(0);
|
ICell c1 = rowi.CreateCell(0);
|
||||||
if (list[i]["Number"].ToString() == "合计")
|
if (list[i]["Number"].ToString() == "合计" || list[i]["Number"].ToString() == "待核销")
|
||||||
{
|
{
|
||||||
c1.SetCellValue(list[i]["Number"].ToString());
|
c1.SetCellValue(list[i]["Number"].ToString());
|
||||||
}
|
}
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user