|
|
@ -71,9 +71,11 @@ namespace ICSSoft.FromERP |
|
|
|
var beginPeriod = "2023-06-01";// Dates.AddMonths(-1).AddDays(-Dates.Day + 1).ToString("yyyy-MM-dd");//"2023-06-01";
|
|
|
|
var endPeriod = "2023-07-01";// Dates.AddDays(-Dates.Day + 1).ToString("yyyy-MM-dd");//"2023-07-01";
|
|
|
|
string sqls = @"select
|
|
|
|
convert(nvarchar(10),getdate(),112) IF_STD_DATE, |
|
|
|
IF_STD_DATE,INVOICE_DATE,ITEM_CD,ITEM_NM,SKU_PAYMT_QTY_UOM,SALES_SITE_CD,SALES_SITE_NM,CREATE_BY,COUNT(*) OVER (PARTITION BY getdate()) GEN_ROW_CNT |
|
|
|
,SUM(SKU_PAYMT_QTY) SKU_PAYMT_QTY,SUM(PAYMT_PRICE) PAYMT_PRICE |
|
|
|
from ( |
|
|
|
select convert(nvarchar(10),getdate(),112) IF_STD_DATE, |
|
|
|
convert(nvarchar(10),a.dDate,111) INVOICE_DATE, |
|
|
|
dDate ACNTNG_DATE, |
|
|
|
b.cInvCode ITEM_CD, |
|
|
|
c.cInvName ITEM_NM, |
|
|
|
CAST(iQuantity AS INT) SKU_PAYMT_QTY, |
|
|
@ -83,14 +85,14 @@ namespace ICSSoft.FromERP |
|
|
|
dcreatesystime CREATE_DTTM, |
|
|
|
b.iNatSum PAYMT_PRICE, |
|
|
|
cMaker CREATE_BY, |
|
|
|
dmodifysystime MODIFY_DTTM, |
|
|
|
cmodifier MODIFY_BY, |
|
|
|
COUNT(*) OVER (PARTITION BY getdate()) GEN_ROW_CNT |
|
|
|
dmodifysystime MODIFY_DTTM |
|
|
|
from dbo.SO_SOMain a left join dbo.SO_SODetails b on a.ID=b.ID |
|
|
|
left join dbo.Inventory c on b.cInvCode=c.cInvCode |
|
|
|
left join dbo.ComputationUnit d on c.cComUnitCode=d.cComunitCode |
|
|
|
left join dbo.Customer e on a.cCusCode=e.cCusCode |
|
|
|
WHERE 1 = 1 and dcreatesystime > '{0}' and dcreatesystime < '{1}'";//
|
|
|
|
WHERE 1 = 1 and dcreatesystime >= '{0}' and dcreatesystime < '{1}' |
|
|
|
) a |
|
|
|
group by IF_STD_DATE,INVOICE_DATE,ITEM_CD,ITEM_NM,SKU_PAYMT_QTY_UOM,SALES_SITE_CD,SALES_SITE_NM,CREATE_BY";//
|
|
|
|
|
|
|
|
sqls = string.Format(sqls, beginPeriod, endPeriod); |
|
|
|
log.Info("YERP_012 sql:" + sqls); |
|
|
|