|
|
@ -165,7 +165,7 @@ namespace Win.Sfs.SettleAccount.Repository.SettleAccountJob.Report |
|
|
|
" temp1.发货数量,\n" + |
|
|
|
" temp1.发货与开票差异,\n" + |
|
|
|
" ISNULL( temp1.发货数量, 0 ) - ISNULL( temp3.Qty, 0 ) 实际交货数量,\n" + |
|
|
|
" ISNULL( temp1.发货数量, 0 ) - ISNULL( temp1.开票数量, 0 ) - ISNULL( temp3.Qty, 0 ) AS 实际交货与开票差异,\n" + |
|
|
|
" ISNULL( temp1.发货数量, 0 ) - ISNULL( temp1.开票数量, 0 ) - ISNULL( temp3.Qty, 0 )-ISNULL( TEMP5.Qty, 0 ) AS 实际交货与开票差异,\n" + |
|
|
|
" ISNULL( temp3.Qty, 0 ) 退货数量,\n" + |
|
|
|
" ISNULL( TEMP5.Qty, 0 ) 往期已结 \n" + |
|
|
|
" FROM\n" + |
|
|
@ -422,6 +422,43 @@ namespace Win.Sfs.SettleAccount.Repository.SettleAccountJob.Report |
|
|
|
|
|
|
|
var list12 = DbConnection.Query<CompareExtend1>(string.Format(sql11, version)); |
|
|
|
|
|
|
|
//看板号为空的情况下,取外部单号的值
|
|
|
|
// var sql12 = " SELECT DISTINCT \n" +
|
|
|
|
//" t1.* \n" +
|
|
|
|
//" FROM \n" +
|
|
|
|
//" ( \n" +
|
|
|
|
//" SELECT \n" +
|
|
|
|
//" a.ExternalKanbanNumber AS ExternalKanbanNumber, \n" +
|
|
|
|
//" a.KanbanNumber AS KanbanNumber, \n" +
|
|
|
|
//" CONVERT ( VARCHAR ( 100 ), a.AcceptanceDate, 23 ) AS AcceptanceDate, \n" +
|
|
|
|
//" HQHKanBan, \n" +
|
|
|
|
//" b2.MaterialCode \n" +
|
|
|
|
//" FROM \n" +
|
|
|
|
//" Set_UnHQSettleAccount a \n" +
|
|
|
|
//" LEFT JOIN Set_material b2 ON a.MaterialCode = b2.CustomerPartCode \n" +
|
|
|
|
//" WHERE \n" +
|
|
|
|
//" Version = '{0}' \n" +
|
|
|
|
//" AND HQHKanBan is null \n" +
|
|
|
|
//" ) t1 \n" +
|
|
|
|
//" LEFT JOIN ( \n" +
|
|
|
|
//" SELECT \n" +
|
|
|
|
//" HQHKanBan, \n" +
|
|
|
|
//" MaterialCode \n" +
|
|
|
|
//" FROM \n" +
|
|
|
|
//" Set_UnHQSettleAccount a \n" +
|
|
|
|
//" WHERE \n" +
|
|
|
|
//" Version = '{0}' \n" +
|
|
|
|
//" AND HQHKanBan is null \n" +
|
|
|
|
//" GROUP BY \n" +
|
|
|
|
//" HQHKanBan, \n" +
|
|
|
|
//" MaterialCode \n" +
|
|
|
|
//" HAVING \n" +
|
|
|
|
//" COUNT ( * ) > 1 \n" +
|
|
|
|
//" ) t2 ON t1.HQHKanBan = t2.HQHKanBan \n" +
|
|
|
|
//" AND t1.MaterialCode = t2.MaterialCode ";
|
|
|
|
|
|
|
|
// var list13 = DbConnection.Query<CompareExtend1>(string.Format(sql12, version));
|
|
|
|
|
|
|
|
|
|
|
|
List<CompareExtend1> _lscopy = new List<CompareExtend1>(); |
|
|
|
|
|
|
@ -753,7 +790,7 @@ namespace Win.Sfs.SettleAccount.Repository.SettleAccountJob.Report |
|
|
|
|
|
|
|
/// <summary>
|
|
|
|
/// 大众备件未结(带单号),包含有发货有结算(条件:发货数量大于结算数据)也整合到大众备件未结中
|
|
|
|
/// 用于--寄售未结比对WMS库存
|
|
|
|
/// 用于--寄售未结比对WMS库存(因为日期传参问题,单独拿出)
|
|
|
|
/// </summary>
|
|
|
|
/// <param name="purchaseOrderNo"></param>
|
|
|
|
/// <param name="version"></param>
|
|
|
@ -1203,6 +1240,7 @@ namespace Win.Sfs.SettleAccount.Repository.SettleAccountJob.Report |
|
|
|
|
|
|
|
/// <summary>
|
|
|
|
/// 大众备件未结(带单号),包含有发货有结算(条件:发货数量大于结算数据)也整合到大众备件未结中
|
|
|
|
/// 用于备件未结统计
|
|
|
|
/// </summary>
|
|
|
|
/// <param name="purchaseOrderNo"></param>
|
|
|
|
/// <param name="version"></param>
|
|
|
@ -1250,13 +1288,13 @@ namespace Win.Sfs.SettleAccount.Repository.SettleAccountJob.Report |
|
|
|
" temp1.物料代码,\n" + |
|
|
|
" temp1.物料描述,\n" + |
|
|
|
" temp1.发货数量,\n" + |
|
|
|
" temp1.开票数量,\n" + |
|
|
|
" temp1.已结数量,\n" + |
|
|
|
" temp1.收货与交货差异,\n" + |
|
|
|
" ISNULL( temp3.Qty, 0 ) 退货数量,\n" + |
|
|
|
" ISNULL( temp1.发货数量, 0 ) - ISNULL( temp3.Qty, 0 ) 未结数量,\n" + |
|
|
|
" ISNULL( temp1.发货数量, 0 ) - ISNULL( temp3.Qty, 0 ) - ISNULL( temp1.开票数量, 0 ) 实际发货数量,\n" + |
|
|
|
" ISNULL( temp1.发货数量, 0 ) - ISNULL( temp3.Qty, 0 ) - ISNULL( temp1.已结数量, 0 ) 实际发货数量,\n" + |
|
|
|
" ISNULL( TEMP2.Price, 0 ) AS 定价,\n" + |
|
|
|
" ISNULL( TEMP2.Price, 0 ) * ( ISNULL( temp1.发货数量, 0 ) - ISNULL( temp3.Qty, 0 ) - ISNULL( temp1.开票数量, 0 ) ) 实际发货总金额 \n" + |
|
|
|
" ISNULL( TEMP2.Price, 0 ) * ( ISNULL( temp1.发货数量, 0 ) - ISNULL( temp3.Qty, 0 ) - ISNULL( temp1.已结数量, 0 ) ) 实际发货总金额 \n" + |
|
|
|
" FROM\n" + |
|
|
|
" (\n" + |
|
|
|
" SELECT\n" + |
|
|
@ -1264,11 +1302,11 @@ namespace Win.Sfs.SettleAccount.Repository.SettleAccountJob.Report |
|
|
|
" NULL AS 交货日期,\n" + |
|
|
|
" a.PurchaseOrderNo AS 采购订单号,\n" + |
|
|
|
" c.MaterialCode AS SAP编码,\n" + |
|
|
|
" c.CustomerPartCode AS 物料代码,\n" + |
|
|
|
" a.MaterialCode AS 物料代码,\n" + |
|
|
|
" c.MaterialDesc AS 物料描述,\n" + |
|
|
|
" c.EstimateTypeDesc AS 物料组,\n" + |
|
|
|
" ISNULL( a.ReceiptQty, 0 ) AS 发货数量,\n" + |
|
|
|
" ISNULL( b.Qty, 0 ) AS 开票数量,\n" + |
|
|
|
" ISNULL( b.Qty, 0 ) AS 已结数量,\n" + |
|
|
|
" ( ISNULL( a.ReceiptQty, 0 ) - ISNULL( b.Qty, 0 ) ) AS 收货与交货差异 \n" + |
|
|
|
" FROM\n" + |
|
|
|
" (\n" + |
|
|
@ -1308,13 +1346,13 @@ namespace Win.Sfs.SettleAccount.Repository.SettleAccountJob.Report |
|
|
|
" temp1.物料代码,\n" + |
|
|
|
" temp1.物料描述,\n" + |
|
|
|
" temp1.发货数量,\n" + |
|
|
|
" temp1.开票数量,\n" + |
|
|
|
" temp1.已结数量,\n" + |
|
|
|
" temp1.收货与交货差异,\n" + |
|
|
|
" ISNULL( temp3.Qty, 0 ) 退货数量,\n" + |
|
|
|
" ISNULL( temp1.发货数量, 0 ) - ISNULL( temp3.Qty, 0 ) 未结数量,\n" + |
|
|
|
" ISNULL( temp1.发货数量, 0 ) - ISNULL( temp3.Qty, 0 ) - ISNULL( temp1.开票数量, 0 ) 实际发货数量,\n" + |
|
|
|
" ISNULL( temp1.发货数量, 0 ) - ISNULL( temp3.Qty, 0 ) - ISNULL( temp1.已结数量, 0 ) 实际发货数量,\n" + |
|
|
|
" ISNULL( TEMP2.Price, 0 ) AS 定价,\n" + |
|
|
|
" ISNULL( TEMP2.Price, 0 ) * (ISNULL( temp1.发货数量, 0 ) - ISNULL( temp3.Qty, 0 ) - ISNULL( temp1.开票数量, 0 ) ) 实际发货总金额 \n" + |
|
|
|
" ISNULL( TEMP2.Price, 0 ) * (ISNULL( temp1.发货数量, 0 ) - ISNULL( temp3.Qty, 0 ) - ISNULL( temp1.已结数量, 0 ) ) 实际发货总金额 \n" + |
|
|
|
" FROM\n" + |
|
|
|
" (\n" + |
|
|
|
" SELECT\n" + |
|
|
@ -1322,11 +1360,11 @@ namespace Win.Sfs.SettleAccount.Repository.SettleAccountJob.Report |
|
|
|
" NULL AS 交货日期,\n" + |
|
|
|
" a.PurchaseOrderNo AS 采购订单号,\n" + |
|
|
|
" c.MaterialCode AS SAP编码,\n" + |
|
|
|
" c.CustomerPartCode AS 物料代码,\n" + |
|
|
|
" a.MaterialCode AS 物料代码,\n" + |
|
|
|
" c.MaterialDesc AS 物料描述,\n" + |
|
|
|
" c.EstimateTypeDesc AS 物料组,\n" + |
|
|
|
" ISNULL( a.ReceiptQty, 0 ) AS 发货数量,\n" + |
|
|
|
" ISNULL( b.ReceiptQty, 0 ) AS 开票数量,\n" + |
|
|
|
" ISNULL( b.ReceiptQty, 0 ) AS 已结数量,\n" + |
|
|
|
" ( ISNULL( b.ReceiptQty, 0 ) - ISNULL( a.ReceiptQty, 0 ) ) AS 收货与交货差异 \n" + |
|
|
|
" FROM\n" + |
|
|
|
" (\n" + |
|
|
@ -1652,6 +1690,8 @@ namespace Win.Sfs.SettleAccount.Repository.SettleAccountJob.Report |
|
|
|
[ExporterHeader(DisplayName = "发货数量")] |
|
|
|
public decimal 发货数量 { set; get; } |
|
|
|
|
|
|
|
[ExporterHeader(DisplayName = "往期已结")] |
|
|
|
public decimal 往期已结 { set; get; } |
|
|
|
|
|
|
|
[ExporterHeader(DisplayName = "开票数量")] |
|
|
|
public decimal 开票数量 { set; get; } |
|
|
@ -1719,8 +1759,8 @@ namespace Win.Sfs.SettleAccount.Repository.SettleAccountJob.Report |
|
|
|
[ExporterHeader(DisplayName = "发货数量")] |
|
|
|
public decimal 发货数量 { set; get; } |
|
|
|
|
|
|
|
[ExporterHeader(DisplayName = "开票数量", IsIgnore = true)] |
|
|
|
public decimal 开票数量 { set; get; } |
|
|
|
[ExporterHeader(DisplayName = "已结数量")] |
|
|
|
public decimal 已结数量 { set; get; } |
|
|
|
|
|
|
|
|
|
|
|
[ExporterHeader(DisplayName = "收货与交货差异", IsIgnore = true)] |
|
|
|