Administrator 3 years ago
parent
commit
3aa3072120
  1. 2
      src/Modules/SettleAccount/src/SettleAccount.Application.Contracts/Entities/BT_Car/BT_Car_PlatformDto.cs
  2. 4
      src/Modules/SettleAccount/src/SettleAccount.Application.Contracts/Entities/BT_Car/BT_Car_PlatformExportDto.cs
  3. 4
      src/Modules/SettleAccount/src/SettleAccount.Application.Contracts/Entities/BT_Car/BT_Car_PlatformImportDto.cs
  4. 2
      src/Modules/SettleAccount/src/SettleAccount.Application.Contracts/Entities/HQ_H/HQ_H_PlatformDto.cs
  5. 2
      src/Modules/SettleAccount/src/SettleAccount.Application.Contracts/Entities/HQ_H/HQ_H_PlatformExportDto.cs
  6. 2
      src/Modules/SettleAccount/src/SettleAccount.Application.Contracts/Entities/HQ_H/HQ_H_PlatformImportDto.cs
  7. 2
      src/Modules/SettleAccount/src/SettleAccount.Application.Contracts/Entities/UnHQSettleAccounts/UnHQSettleDto.cs
  8. 4
      src/Modules/SettleAccount/src/SettleAccount.Domain/Entities/BT_Car/BT_Car_Platform.cs
  9. 2
      src/Modules/SettleAccount/src/SettleAccount.Domain/Entities/HQ_F/HQ_F_Platform.cs
  10. 2
      src/Modules/SettleAccount/src/SettleAccount.Domain/Entities/HQ_H/HQ_H_Platform.cs
  11. 2
      src/Modules/SettleAccount/src/SettleAccount.Domain/Entities/UnHQSettleAccounts/UnHQSettleAccount.cs
  12. 10
      src/Modules/SettleAccount/src/SettleAccount.EntityFrameworkCore/Repository/SettleAccountJob/Report/HQCarSettledDetailDapperRepository.cs
  13. 155
      src/Modules/SettleAccount/src/SettleAccount.EntityFrameworkCore/Repository/SettleAccountJob/Report/HQFactorySettledDetailDapperRepository.cs
  14. 307
      src/Modules/SettleAccount/src/SettleAccount.EntityFrameworkCore/Repository/SettleAccountJob/Report/HQHSettledDetailDapperRepository.cs
  15. 72
      src/Modules/SettleAccount/src/SettleAccount.EntityFrameworkCore/Repository/SettleAccountJob/Report/SettleSparePartDapperReportRepository.cs
  16. 25
      src/Modules/SettleAccount/src/SettleAccount.Job/Services/Report/HQHSettledDetailDiffExportService.cs

2
src/Modules/SettleAccount/src/SettleAccount.Application.Contracts/Entities/BT_Car/BT_Car_PlatformDto.cs

@ -14,7 +14,7 @@ namespace Win.Sfs.SettleAccount.Entities.BT_Car
/// </summary>
public string Factory { get; set; }
/// <summary>
///外部验收单号
///外部单号
/// </summary>
public string ExternalKanbanNumber { get; set; }
/// <summary>

4
src/Modules/SettleAccount/src/SettleAccount.Application.Contracts/Entities/BT_Car/BT_Car_PlatformExportDto.cs

@ -15,9 +15,9 @@ namespace Win.Sfs.SettleAccount.Entities.BT_Car
[ExporterHeader(DisplayName = "工厂")]
public string Factory { get; set; }
/// <summary>
///外部验收单号
///外部单号
/// </summary>
[ExporterHeader(DisplayName = "外部验收单号")]
[ExporterHeader(DisplayName = "外部单号")]
public string ExternalKanbanNumber { get; set; }
/// <summary>
///看板编号

4
src/Modules/SettleAccount/src/SettleAccount.Application.Contracts/Entities/BT_Car/BT_Car_PlatformImportDto.cs

@ -15,9 +15,9 @@ namespace Win.Sfs.SettleAccount.Entities.BT_Car
[ImporterHeader(Name = "工厂")]
public string Factory { get; set; }
/// <summary>
///外部看板编
///外部
/// </summary>
[ImporterHeader(Name = "外部验收单号")]
[ImporterHeader(Name = "外部单号")]
public string ExternalKanbanNumber { get; set; }
/// <summary>
///看板编号

2
src/Modules/SettleAccount/src/SettleAccount.Application.Contracts/Entities/HQ_H/HQ_H_PlatformDto.cs

@ -15,7 +15,7 @@ namespace Win.Sfs.SettleAccount.Entities.HQ_H
/// </summary>
public string Factory { get; set; }
/// <summary>
///外部看板编
///外部
/// </summary>
public string ExternalKanbanNumber { get; set; }
/// <summary>

2
src/Modules/SettleAccount/src/SettleAccount.Application.Contracts/Entities/HQ_H/HQ_H_PlatformExportDto.cs

@ -17,7 +17,7 @@ namespace Win.Sfs.SettleAccount.Entities.HQ_H
/// <summary>
///外部单号
/// </summary>
[ExporterHeader(DisplayName = "外部看板编号")]
[ExporterHeader(DisplayName = "外部号")]
public string ExternalKanbanNumber { get; set; }
/// <summary>
///看板编号

2
src/Modules/SettleAccount/src/SettleAccount.Application.Contracts/Entities/HQ_H/HQ_H_PlatformImportDto.cs

@ -17,7 +17,7 @@ namespace Win.Sfs.SettleAccount.Entities.HQ_H
/// <summary>
///外部单号
/// </summary>
[ImporterHeader(Name = "外部看板编号")]
[ImporterHeader(Name = "外部号")]
public string ExternalKanbanNumber { get; set; }
/// <summary>
///看板编号

2
src/Modules/SettleAccount/src/SettleAccount.Application.Contracts/Entities/UnHQSettleAccounts/UnHQSettleDto.cs

@ -14,7 +14,7 @@ namespace Win.Sfs.SettleAccount.Entities.UnHQSettleAccounts
/// </summary>
public string Factory { get; set; }
/// <summary>
///外部看板编
///外部
/// </summary>
public string ExternalKanbanNumber { get; set; }
/// <summary>

4
src/Modules/SettleAccount/src/SettleAccount.Domain/Entities/BT_Car/BT_Car_Platform.cs

@ -57,9 +57,9 @@ namespace Win.Sfs.SettleAccount.Entities.BT_Car
[Display(Name = "工厂")]
public string Factory { get; set; }
/// <summary>
///外部验收单号
///外部单号
/// </summary>
[Display(Name = "外部验收单号")]
[Display(Name = "外部单号")]
public string ExternalKanbanNumber { get; set; }
/// <summary>
///看板编号

2
src/Modules/SettleAccount/src/SettleAccount.Domain/Entities/HQ_F/HQ_F_Platform.cs

@ -69,7 +69,7 @@ namespace Win.Sfs.SettleAccount.Entities.HQ_F
/// <summary>
///外部看板编号
/// </summary>
[Display(Name = "外部看板编号")]
[Display(Name = "外部号")]
public string ExternalKanbanNumber { get; set; }
/// <summary>
///看板编号

2
src/Modules/SettleAccount/src/SettleAccount.Domain/Entities/HQ_H/HQ_H_Platform.cs

@ -70,7 +70,7 @@ namespace Win.Sfs.SettleAccount.Entities.HQ_H
/// <summary>
///外部看板编号
/// </summary>
[Display(Name = "外部看板编号")]
[Display(Name = "外部号")]
public string ExternalKanbanNumber { get; set; }
/// <summary>
///看板编号

2
src/Modules/SettleAccount/src/SettleAccount.Domain/Entities/UnHQSettleAccounts/UnHQSettleAccount.cs

@ -73,7 +73,7 @@ namespace Win.Sfs.SettleAccount.Entities.UnHQSettleAccounts
/// <summary>
///外部看板编号
/// </summary>
[Display(Name = "外部看板编号")]
[Display(Name = "外部号")]
public string ExternalKanbanNumber { get; set; }
/// <summary>
///看板编号

10
src/Modules/SettleAccount/src/SettleAccount.EntityFrameworkCore/Repository/SettleAccountJob/Report/HQCarSettledDetailDapperRepository.cs

@ -89,7 +89,7 @@ namespace Win.Sfs.SettleAccount.Repository.SettleAccountJob.Report
" C.EstimateTypeDesc 物料组,\n" +
" C.MaterialDesc 物料描述,\n" +
" CONVERT ( VARCHAR ( 100 ), A.AcceptanceDate, 23 ) 验收单日期,\n" +
" a.[ExternalKanbanNumber] AS 外部验收单号,\n" +
" a.[ExternalKanbanNumber] AS 外部单号,\n" +
" ISNULL( A.Price, 0 ) 结算单价,\n" +
" ISNULL( A.Qty, 0 ) 结算数量,\n" +
" ISNULL( A.Price, 0 ) * ISNULL( A.Qty, 0 ) 结算金额,\n" +
@ -230,7 +230,7 @@ namespace Win.Sfs.SettleAccount.Repository.SettleAccountJob.Report
" C.EstimateTypeDesc 物料组,\n" +
" C.MaterialDesc 物料描述,\n" +
" CONVERT ( VARCHAR ( 100 ), A.AcceptanceDate, 23 ) 验收单日期,\n" +
" a.[ExternalKanbanNumber] AS 外部验收单号,\n" +
" a.[ExternalKanbanNumber] AS 外部单号,\n" +
" ISNULL( A.Price, 0 ) 结算单价,\n" +
" ISNULL( A.Qty, 0 ) 结算数量,\n" +
" ISNULL( A.Price, 0 ) * ISNULL( A.Qty, 0 ) 结算金额,\n" +
@ -356,7 +356,7 @@ namespace Win.Sfs.SettleAccount.Repository.SettleAccountJob.Report
= qty;
= settleprice;
= metarialGroup;
= externalKanbanNumber;
= externalKanbanNumber;
= acceptanceDate;
}
@ -380,8 +380,8 @@ namespace Win.Sfs.SettleAccount.Repository.SettleAccountJob.Report
[ExporterHeader(DisplayName = "结算验收单号",IsIgnore =true)]
public string { set; get; }
[ExporterHeader(DisplayName = "外部验收单号")]
public string { set; get; }
[ExporterHeader(DisplayName = "外部单号")]
public string { set; get; }
[ExporterHeader(DisplayName = "物料组")]
public string { set; get; }

155
src/Modules/SettleAccount/src/SettleAccount.EntityFrameworkCore/Repository/SettleAccountJob/Report/HQFactorySettledDetailDapperRepository.cs

@ -101,7 +101,7 @@ namespace Win.Sfs.SettleAccount.Repository.SettleAccountJob.Report
" temp1.物料组,\n" +
" temp1.零件中文名称,\n" +
" temp1.发货数量,\n" +
" temp1.外部验收单号,\n" +
" temp1.外部单号,\n" +
" temp1.结算数量,\n" +
" isnull( TEMP2.Price, 0 ) AS 发货定价,\n" +
" isnull( temp1.发货数量, 0 ) * isnull( TEMP2.Price, 0 ) AS 发货总金额,\n" +
@ -117,7 +117,7 @@ namespace Win.Sfs.SettleAccount.Repository.SettleAccountJob.Report
" c.CustomerPartCode 客户物料号,\n" +
" c.MaterialDesc AS 零件中文名称,\n" +
" isnull( a.Qty, 0 ) AS 发货数量,\n" +
" '' AS 外部验收单号,\n" +
" '' AS 外部单号,\n" +
" isnull( b.Qty, 0 ) AS 结算数量,\n" +
" C.EstimateTypeDesc AS 物料组 \n" +
" FROM\n" +
@ -147,7 +147,7 @@ namespace Win.Sfs.SettleAccount.Repository.SettleAccountJob.Report
" temp1.物料组,\n" +
" temp1.零件中文名称,\n" +
" temp1.发货数量,\n" +
" temp1.外部验收单号,\n" +
" temp1.外部单号,\n" +
" temp1.结算数量,\n" +
" isnull( TEMP2.Price, 0 ) AS 发货定价,\n" +
" isnull( temp1.发货数量, 0 ) * isnull( TEMP2.Price, 0 ) AS 发货总金额,\n" +
@ -163,7 +163,7 @@ namespace Win.Sfs.SettleAccount.Repository.SettleAccountJob.Report
" c.CustomerPartCode 客户物料号,\n" +
" c.MaterialDesc AS 零件中文名称,\n" +
" isnull( a.Qty, 0 ) AS 发货数量,\n" +
" '' AS 外部验收单号,\n" +
" '' AS 外部单号,\n" +
" isnull( b.Qty, 0 ) AS 结算数量,\n" +
" C.EstimateTypeDesc AS 物料组 \n" +
" FROM\n" +
@ -394,7 +394,7 @@ namespace Win.Sfs.SettleAccount.Repository.SettleAccountJob.Report
{
//itm1.看板编号 = itmcopy.KanbanNumber;
//itm1.验收单日期 = itmcopy.AcceptanceDate;
itm1. = itmcopy.ExternalKanbanNumber;
itm1. = itmcopy.ExternalKanbanNumber;
}
}
@ -404,93 +404,7 @@ namespace Win.Sfs.SettleAccount.Repository.SettleAccountJob.Report
}
#region old
//string str = "SELECT\n" +
//" temp3.StorageLocation 收货仓库,\n" +
//" temp3.StorageLocationDesc 收货仓库描述,\n" +
//" temp3.HQHKanBan 订货看板编号,\n" +
//" temp3.ExternalKanbanNumber 外部验收单号,\n" +
//" temp3.AcceptanceDate 验收单日期,\n" +
//" temp3.MaterialCode Sap编码,\n" +
//" temp3.hqMaterialCode 客户物料号,\n" +
//" temp3.EstimateTypeDesc 物料组,\n" +
//" temp3.MaterialDesc 零件中文名称,\n" +
//" isnull( TEMP2.Price, 0 ) AS 发货定价,\n" +
//" temp3.UnHQAmt 金额,\n" +
//" temp3.系统未结数量,\n" +
//" temp3.UnHQQty 红旗未结数量,\n" +
//" ( ISNULL( temp3.系统未结数量, 0 ) - ISNULL( temp3.UnHQQty, 0 ) ) 差异 \n" +
//"FROM\n" +
//" (\n" +
//" SELECT\n" +
//" * \n" +
//" FROM\n" +
//" (\n" +
//" SELECT\n" +
//" h.StorageLocation,\n" +
//" h.StorageLocationDesc,\n" +
//" h.HQHKanBan,\n" +
//" h.ExternalKanbanNumber,\n" +
//" CONVERT ( VARCHAR ( 100 ), h.AcceptanceDate, 23 ) AcceptanceDate,\n" +
//" m.MaterialCode,\n" +
//" h.MaterialCode hqMaterialCode,\n" +
//" m.CustomerPartCode,\n" +
//" m.MaterialDesc,\n" +
//" m.EstimateTypeDesc,\n" +
//" ISNULL( h.Qty, 0 ) AS UnHQQty,\n" +
//" ISNULL( h.Amt, 0 ) AS UnHQAmt \n" +
//" FROM\n" +
//" (\n" +
//" SELECT SUM\n" +
//" ( Qty ) Qty,\n" +
//" Amt,\n" +
//" HQHKanBan,\n" +
//" StorageLocation,\n" +
//" StorageLocationDesc,\n" +
//" ExternalKanbanNumber,\n" +
//" MaterialCode,\n" +
//" AcceptanceDate \n" +
//" FROM\n" +
//" Set_UnHQSettleAccount \n" +
//" GROUP BY\n" +
//" HQHKanBan,\n" +
//" StorageLocation,\n" +
//" StorageLocationDesc,\n" +
//" ExternalKanbanNumber,\n" +
//" Amt,\n" +
//" MaterialCode,\n" +
//" AcceptanceDate \n" +
//" ) AS h\n" +
//" LEFT JOIN Set_material AS m ON h.MaterialCode = m.CustomerPartCode \n" +
//" ) AS unhq\n" +
//" LEFT JOIN (\n" +
//" SELECT\n" +
//" a.Kanban AS 订货看板编号,\n" +
//" b.MaterialCode AS 订货零件号,\n" +
//" c.MaterialCode Sap编码,\n" +
//" c.CustomerPartCode 客户物料号,\n" +
//" c.MaterialDesc AS 零件中文名称,\n" +
//" isnull( a.Qty, 0 ) AS 系统未结数量,\n" +
//" b.ExternalKanbanNumber AS 外部验收单号,\n" +
//" C.EstimateTypeDesc AS 物料组 \n" +
//" FROM\n" +
//" ( SELECT SUM ( Qty ) Qty, Kanban, MaterialCode FROM Set_HQ_H_Kanban GROUP BY Kanban, MaterialCode ) AS a\n" +
//" LEFT OUTER JOIN ( SELECT * FROM Set_HQ_H_Platform WHERE HQHKanBan <> 'BJ' ) AS b ON a.Kanban = b.HQHKanBan \n" +
//" AND a.MaterialCode = b.MaterialCode\n" +
//" LEFT OUTER JOIN Set_material AS c ON a.MaterialCode = c.CustomerPartCode \n" +
//" WHERE\n" +
//" b.HQHKanBan IS NULL \n" +
//" AND b.MaterialCode IS NULL \n" +
//" ) AS temp1 ON unhq.HQHKanBan = temp1.[订货看板编号] \n" +
//" AND unhq.CustomerPartCode= temp1.客户物料号 -- WHERE\n" +
//"-- temp1.[订货看板编号] IS NULL\n" +
//"-- AND temp1.客户物料号 IS NULL\n" +
//" \n" +
//" ) temp3\n" +
//" LEFT OUTER JOIN ( SELECT Price, MaterialCode FROM Set_PriceList WHERE Version = '202110' ) AS TEMP2 ON temp3.MaterialCode = TEMP2.MaterialCode";
#endregion
/// <summary>
/// 红旗系统未对比对红旗主机厂未结,其中红旗系统未结数据中还包括有发货有结算中发货数量大于结算的也要整合到未结当中
/// </summary>
@ -527,55 +441,14 @@ namespace Win.Sfs.SettleAccount.Repository.SettleAccountJob.Report
{
contion += " WHERE 1=1 ";
}
//按照客户财务要求 去掉结算验收单号换成外部验收单号
//string str = "SELECT\n" +
//" temp1.交货单号,\n" +
//" temp1.交货时间,\n" +
//" temp1.收货仓库,\n" +
//" temp1.收货仓库描述,\n" +
//" temp1.订货看板编号,\n" +
//" temp1.外部验收单号,\n" +
//" temp1.Sap编码,\n" +
//" temp1.[客户物料号],\n" +
//" temp1.物料组,\n" +
//" temp1.零件中文名称,\n" +
//" isnull( TEMP2.Price, 0 ) AS 发货定价,\n" +
//" ISNULL( temp1.系统未结数量, 0 ) 系统未结数量,\n" +
//" isnull( temp3.Qty, 0 ) AS 红旗未结数量,\n" +
//" ( ISNULL( temp1.系统未结数量, 0 ) - ISNULL( temp3.Qty, 0 ) ) 差异 \n" +
//"FROM\n" +
//" (\n" +
//" SELECT\n" +
//" a.WmsBillNum [交货单号],\n" +
//" CONVERT ( VARCHAR ( 100 ), a.LastModificationTime, 23 ) 交货时间,\n" +
//" b.StorageLocation AS 收货仓库,\n" +
//" b.StorageLocationDesc AS 收货仓库描述,\n" +
//" a.Kanban AS 订货看板编号,\n" +
//" c.MaterialCode Sap编码,\n" +
//" c.CustomerPartCode 客户物料号,\n" +
//" c.MaterialDesc AS 零件中文名称,\n" +
//" isnull( a.Qty, 0 ) AS 系统未结数量,\n" +
//" b.ExternalKanbanNumber AS 外部验收单号,\n" +
//" C.EstimateTypeDesc AS 物料组 \n" +
//" FROM\n" +
//" ( SELECT SUM ( Qty ) AS Qty, Kanban, MaterialCode, WmsBillNum, LastModificationTime FROM Set_HQ_H_Kanban GROUP BY Kanban, MaterialCode, WmsBillNum, LastModificationTime ) AS a\n" +
//" LEFT OUTER JOIN ( SELECT * FROM Set_HQ_H_Platform WHERE HQHKanBan <> 'BJ' ) AS b ON a.Kanban = b.HQHKanBan \n" +
//" AND a.MaterialCode = b.MaterialCode\n" +
//" LEFT OUTER JOIN Set_material AS c ON a.MaterialCode = c.CustomerPartCode \n" +
//" WHERE\n" +
//" b.HQHKanBan IS NULL \n" +
//" AND b.MaterialCode IS NULL {0}\n" +
//" ) AS temp1\n" +
//" LEFT OUTER JOIN ( SELECT Price, MaterialCode FROM Set_PriceList WHERE ( Version = ( SELECT MAX ( Version ) FROM Set_PriceList ) ) ) AS TEMP2 ON temp1.Sap编码 = TEMP2.MaterialCode\n" +
//" LEFT JOIN ( SELECT SUM ( Qty ) Qty, HQHKanBan, MaterialCode FROM Set_UnHQSettleAccount GROUP BY HQHKanBan, MaterialCode ) temp3 ON temp1.[订货看板编号] = temp3.HQHKanBan \n" +
//" AND temp1.[客户物料号] = temp3.MaterialCode";
string str = "SELECT\n" +
" temp.交货单号,\n" +
" temp.交货时间,\n" +
" temp.订货看板编号,\n" +
" temp.外部验收单号,\n" +
" temp.外部单号,\n" +
" temp.Sap编码,\n" +
" temp.[客户物料号],\n" +
" temp.物料组,\n" +
@ -603,7 +476,7 @@ namespace Win.Sfs.SettleAccount.Repository.SettleAccountJob.Report
" temp1.物料组,\n" +
" temp1.零件中文名称,\n" +
" temp1.发货数量,\n" +
" temp1.外部验收单号,\n" +
" temp1.外部单号,\n" +
" temp1.结算数量,\n" +
" isnull( TEMP2.Price, 0 ) AS 发货定价,\n" +
" isnull( temp1.发货数量, 0 ) * isnull( TEMP2.Price, 0 ) AS 发货总金额,\n" +
@ -619,7 +492,7 @@ namespace Win.Sfs.SettleAccount.Repository.SettleAccountJob.Report
" c.CustomerPartCode 客户物料号,\n" +
" c.MaterialDesc AS 零件中文名称,\n" +
" isnull( a.Qty, 0 ) AS 发货数量,\n" +
" '' AS 外部验收单号,\n" +
" '' AS 外部单号,\n" +
" isnull( b.Qty, 0 ) AS 结算数量,\n" +
" C.EstimateTypeDesc AS 物料组 \n" +
" FROM\n" +
@ -649,7 +522,7 @@ namespace Win.Sfs.SettleAccount.Repository.SettleAccountJob.Report
" temp1.物料组,\n" +
" temp1.零件中文名称,\n" +
" temp1.发货数量,\n" +
" temp1.外部验收单号,\n" +
" temp1.外部单号,\n" +
" temp1.结算数量,\n" +
" isnull( TEMP2.Price, 0 ) AS 发货定价,\n" +
" isnull( temp1.发货数量, 0 ) * isnull( TEMP2.Price, 0 ) AS 发货总金额,\n" +
@ -665,7 +538,7 @@ namespace Win.Sfs.SettleAccount.Repository.SettleAccountJob.Report
" c.CustomerPartCode 客户物料号,\n" +
" c.MaterialDesc AS 零件中文名称,\n" +
" isnull( a.Qty, 0 ) AS 发货数量,\n" +
" '' AS 外部验收单号,\n" +
" '' AS 外部单号,\n" +
" isnull( b.Qty, 0 ) AS 结算数量,\n" +
" C.EstimateTypeDesc AS 物料组 \n" +
" FROM\n" +
@ -823,8 +696,8 @@ namespace Win.Sfs.SettleAccount.Repository.SettleAccountJob.Report
[ExporterHeader(DisplayName = "结算验收单号", IsIgnore = true)]
public string { set; get; }
[ExporterHeader(DisplayName = "外部验收单号")]
public string { set; get; }
[ExporterHeader(DisplayName = "外部单号")]
public string { set; get; }
[ExporterHeader(DisplayName = "Sap编码")]
public string Sap编码 { set; get; }

307
src/Modules/SettleAccount/src/SettleAccount.EntityFrameworkCore/Repository/SettleAccountJob/Report/HQHSettledDetailDapperRepository.cs

@ -70,101 +70,98 @@ namespace Win.Sfs.SettleAccount.Repository.SettleAccountJob.Report
string str = "SELECT\n" +
" isnull( temp1.交货单号, '' ) 交货单号,\n" +
" temp1.交货时间,\n" +
" isnull( temp1.手工或自动, '' ) 手工或自动,\n" +
" temp1.[工厂],\n" +
" temp1.收货仓库,\n" +
" temp1.收货仓库描述,\n" +
" temp1.订货看板编号,\n" +
" temp1.订货零件号,\n" +
" temp1.验收单日期,\n" +
" temp1.Sap编码,\n" +
" temp1.看板编号,\n" +
" temp1.物料组,\n" +
" temp1.零件中文名称,\n" +
" temp1.发货数量,\n" +
" temp1.发货状态,\n" +
" temp1.外部验收单号,\n" +
" temp1.结算数量,\n" +
" temp3.Price AS 结算单价,\n" +
" ( temp1.[结算数量] * ISNULL( temp3.Price, 0 ) ) AS 结算金额,\n" +
" isnull( TEMP2.Price, 0 ) AS 发货定价,\n" +
" isnull( temp1.发货数量, 0 ) * isnull( TEMP2.Price, 0 ) AS 发货总金额,\n" +
" ( isnull( temp1.发货数量, 0 ) - isnull( temp1.[结算数量], 0 ) - ISNULL( temp4.Qty, 0 ) ) AS 数量差异,\n" +
" ISNULL( temp3.Price, 0 ) - ISNULL( TEMP2.Price, 0 ) AS 单价差异,\n" +
" ( ISNULL( temp3.Price, 0 ) - ISNULL( TEMP2.Price, 0 ) ) * temp1.结算数量 AS 差异总金额 ,\n" +
" temp4.Qty 退货数量 \n" +
"FROM\n" +
" (\n" +
" SELECT\n" +
" '' AS 交货单号,\n" +
" NULL AS 交货时间,\n" +
" '' AS 手工或自动,\n" +
" a.StorageLocation AS 收货仓库,\n" +
" a.StorageLocationDesc AS 收货仓库描述,\n" +
" a.HQHKanBan AS 订货看板编号,\n" +
" a.MaterialCode AS 订货零件号,\n" +
" c.MaterialCode Sap编码,\n" +
" a.MaterialCode 结算物料代码,\n" +
" c.MaterialDesc AS 零件中文名称,\n" +
" isnull( b.Qty, 0 ) AS 发货数量,\n" +
" 2 AS 发货状态,\n" +
" a.[ExternalKanbanNumber] AS 外部验收单号,\n" +
" isnull( a.Qty, 0 ) AS 结算数量,\n" +
" C.EstimateTypeDesc AS 物料组,\n" +
" a.Factory AS 工厂,\n" +
" '' AS 看板编号,\n" +
" '' AS 验收单日期 \n" +
" FROM\n" +
" (\n" +
" SELECT SUM\n" +
" ( Qty ) AS Qty,\n" +
" HQHKanBan,\n" +
" MaterialCode,\n" +
" Version,\n" +
" StorageLocation,\n" +
" StorageLocationDesc,\n" +
" Factory,\n" +
" ExternalKanbanNumber \n" +
" FROM\n" +
" Set_HQ_H_Platform \n" +
" GROUP BY\n" +
" HQHKanBan,\n" +
" MaterialCode,\n" +
" Version,\n" +
" StorageLocation,\n" +
" StorageLocationDesc,\n" +
" Factory,\n" +
" ExternalKanbanNumber \n" +
" ) AS a\n" +
" INNER JOIN ( SELECT SUM ( Qty ) AS Qty, Kanban, MaterialCode FROM Set_HQ_H_Kanban GROUP BY Kanban, MaterialCode ) AS b ON a.HQHKanBan = b.Kanban \n" +
" AND a.MaterialCode = b.MaterialCode\n" +
" LEFT OUTER JOIN Set_material AS c ON a.MaterialCode = c.CustomerPartCode \n" +
" WHERE\n" +
" ( a.Version= '{0}' AND a.HQHKanBan IS NOT NULL ) \n" +
" AND a.HQHKanBan <> 'BJ' \n" +
" ) AS temp1\n" +
" LEFT OUTER JOIN ( SELECT Price, MaterialCode FROM Set_PriceList WHERE Version = '202110' ) AS TEMP2 ON temp1.Sap编码 = TEMP2.MaterialCode\n" +
" LEFT JOIN (\n" +
" SELECT\n" +
" ROUND( SUM ( Amt ) / SUM ( Qty ), 4 ) price,\n" +
" HQHKanBan,\n" +
" MaterialCode,\n" +
" Version \n" +
" FROM\n" +
" Set_HQ_H_Platform \n" +
" WHERE\n" +
" Version = '{0}' \n" +
" AND HQHKanBan <> 'BJ' \n" +
" GROUP BY\n" +
" HQHKanBan,\n" +
" MaterialCode,\n" +
" Version \n" +
" ) AS TEMP3 ON temp1.[结算物料代码] = TEMP3.MaterialCode \n" +
" AND temp1.订货看板编号 = TEMP3.HQHKanBan\n" +
" LEFT JOIN set_backQty temp4 ON temp1.订货看板编号 = temp4.Code \n" +
" AND temp1.Sap编码= temp4.MaterialCode";
" isnull( temp1.交货单号, '' ) 交货单号,\n" +
" temp1.交货时间,\n" +
" temp1.[工厂],\n" +
" temp1.收货仓库,\n" +
" temp1.收货仓库描述,\n" +
" temp1.订货看板编号,\n" +
" temp1.订货零件号,\n" +
" temp1.验收单日期,\n" +
" temp1.Sap编码,\n" +
" temp1.看板编号,\n" +
" temp1.物料组,\n" +
" temp1.零件中文名称,\n" +
" temp1.发货数量,\n" +
" temp1.外部单号,\n" +
" temp1.结算数量,\n" +
" temp3.Price AS 结算单价,\n" +
" ( temp1.[结算数量] * ISNULL( temp3.Price, 0 ) ) AS 结算金额,\n" +
" isnull( TEMP2.Price, 0 ) AS 发货定价,\n" +
" isnull( temp1.发货数量, 0 ) - ISNULL( temp4.Qty, 0 ) AS 实际发货数量,\n" +
" ( isnull( temp1.发货数量, 0 ) - ISNULL( temp4.Qty, 0 ) ) * isnull( TEMP2.Price, 0 ) AS 实际发货总金额,\n" +
" ( isnull( temp1.发货数量, 0 ) - ISNULL( temp4.Qty, 0 ) - isnull( temp1.[结算数量], 0 ) ) AS 量差,\n" +
" ISNULL( temp3.Price, 0 ) - ISNULL( TEMP2.Price, 0 ) AS 单价差异,\n" +
" ( ISNULL( temp3.Price, 0 ) - ISNULL( TEMP2.Price, 0 ) ) * temp1.结算数量 AS 差异总金额 ,\n" +
" temp4.Qty 退货数量 \n" +
"FROM\n" +
" (\n" +
" SELECT\n" +
" '' AS 交货单号,\n" +
" NULL AS 交货时间,\n" +
" a.StorageLocation AS 收货仓库,\n" +
" a.StorageLocationDesc AS 收货仓库描述,\n" +
" a.HQHKanBan AS 订货看板编号,\n" +
" a.MaterialCode AS 订货零件号,\n" +
" c.MaterialCode Sap编码,\n" +
" a.MaterialCode 结算物料代码,\n" +
" c.MaterialDesc AS 零件中文名称,\n" +
" isnull( b.Qty, 0 ) AS 发货数量,\n" +
" a.[ExternalKanbanNumber] AS 外部单号,\n" +
" isnull( a.Qty, 0 ) AS 结算数量,\n" +
" C.EstimateTypeDesc AS 物料组,\n" +
" a.Factory AS 工厂,\n" +
" '' AS 看板编号,\n" +
" '' AS 验收单日期 \n" +
" FROM\n" +
" (\n" +
" SELECT SUM\n" +
" ( Qty ) AS Qty,\n" +
" HQHKanBan,\n" +
" MaterialCode,\n" +
" Version,\n" +
" StorageLocation,\n" +
" StorageLocationDesc,\n" +
" Factory,\n" +
" ExternalKanbanNumber \n" +
" FROM\n" +
" Set_HQ_H_Platform \n" +
" GROUP BY\n" +
" HQHKanBan,\n" +
" MaterialCode,\n" +
" Version,\n" +
" StorageLocation,\n" +
" StorageLocationDesc,\n" +
" Factory,\n" +
" ExternalKanbanNumber \n" +
" ) AS a\n" +
" INNER JOIN ( SELECT SUM ( Qty ) AS Qty, Kanban, MaterialCode FROM Set_HQ_H_Kanban GROUP BY Kanban, MaterialCode ) AS b ON a.HQHKanBan = b.Kanban \n" +
" AND a.MaterialCode = b.MaterialCode\n" +
" LEFT OUTER JOIN Set_material AS c ON a.MaterialCode = c.CustomerPartCode \n" +
" WHERE\n" +
" ( a.Version= '{0}' AND a.HQHKanBan IS NOT NULL ) \n" +
" AND a.HQHKanBan <> 'BJ' \n" +
" ) AS temp1\n" +
" LEFT OUTER JOIN ( SELECT Price, MaterialCode FROM Set_PriceList WHERE Version = '202110' ) AS TEMP2 ON temp1.Sap编码 = TEMP2.MaterialCode\n" +
" LEFT JOIN (\n" +
" SELECT\n" +
" ROUND( SUM ( Amt ) / SUM ( Qty ), 4 ) price,\n" +
" HQHKanBan,\n" +
" MaterialCode,\n" +
" Version \n" +
" FROM\n" +
" Set_HQ_H_Platform \n" +
" WHERE\n" +
" Version = '{0}' \n" +
" AND HQHKanBan <> 'BJ' \n" +
" GROUP BY\n" +
" HQHKanBan,\n" +
" MaterialCode,\n" +
" Version \n" +
" ) AS TEMP3 ON temp1.[结算物料代码] = TEMP3.MaterialCode \n" +
" AND temp1.订货看板编号 = TEMP3.HQHKanBan\n" +
" LEFT JOIN set_backQty temp4 ON temp1.订货看板编号 = temp4.Code \n" +
" AND temp1.Sap编码= temp4.MaterialCode";
@ -368,7 +365,7 @@ namespace Win.Sfs.SettleAccount.Repository.SettleAccountJob.Report
{
itm1. = itmcopy.KanbanNumber;
itm1. = itmcopy.AcceptanceDate;
itm1. = itmcopy.ExternalKanbanNumber;
itm1. = itmcopy.ExternalKanbanNumber;
}
}
@ -398,7 +395,6 @@ namespace Win.Sfs.SettleAccount.Repository.SettleAccountJob.Report
" (\n" +
" SELECT\n" +
" temp1.交货时间,\n" +
" isnull( temp1.手工或自动, '' ) 手工或自动,\n" +
" isnull( temp1.交货单号, '' ) 交货单号,\n" +
" temp1.[工厂],\n" +
" temp1.收货仓库,\n" +
@ -412,7 +408,7 @@ namespace Win.Sfs.SettleAccount.Repository.SettleAccountJob.Report
" temp1.零件中文名称,\n" +
" temp1.发货数量,\n" +
" temp1.发货状态,\n" +
" temp1.外部验收单号,\n" +
" temp1.外部单号,\n" +
" temp1.结算数量,\n" +
" temp1.结算单价,\n" +
" temp1.结算金额,\n" +
@ -426,7 +422,6 @@ namespace Win.Sfs.SettleAccount.Repository.SettleAccountJob.Report
" SELECT\n" +
" b.WmsBillNum AS 交货单号,\n" +
" CONVERT ( VARCHAR ( 100 ), b.LastModificationTime, 23 ) AS 交货时间,\n" +
" b.IsAuto AS 手工或自动,\n" +
" a.StorageLocation AS 收货仓库,\n" +
" a.StorageLocationDesc AS 收货仓库描述,\n" +
" a.HQHKanBan AS 订货看板编号,\n" +
@ -435,7 +430,7 @@ namespace Win.Sfs.SettleAccount.Repository.SettleAccountJob.Report
" c.MaterialDesc AS 零件中文名称,\n" +
" isnull( b.Qty, 0 ) AS 发货数量,\n" +
" isnull( b.State, 0 ) AS 发货状态,\n" +
" a.ExternalKanbanNumber AS 外部验收单号,\n" +
" a.ExternalKanbanNumber AS 外部单号,\n" +
" isnull( a.Qty, 0 ) AS 结算数量,\n" +
" isnull( a.Price, 0 ) AS 结算单价,\n" +
" isnull( a.Amt, 0 ) AS 结算金额 ,\n" +
@ -461,7 +456,6 @@ namespace Win.Sfs.SettleAccount.Repository.SettleAccountJob.Report
" SELECT\n" +
" isnull( temp1.交货单号, '' ) 交货单号,\n" +
" temp1.交货时间,\n" +
" isnull( temp1.手工或自动, '' ) 手工或自动,\n" +
" temp1.[工厂],\n" +
" temp1.收货仓库,\n" +
" temp1.收货仓库描述,\n" +
@ -474,7 +468,7 @@ namespace Win.Sfs.SettleAccount.Repository.SettleAccountJob.Report
" temp1.零件中文名称,\n" +
" temp1.发货数量,\n" +
" temp1.发货状态,\n" +
" temp1.外部验收单号,\n" +
" temp1.外部单号,\n" +
" temp1.结算数量,\n" +
" temp3.Price AS 结算单价,\n" +
" ( temp1.[结算数量] * ISNULL( temp3.Price, 0 ) ) AS 结算金额,\n" +
@ -488,7 +482,6 @@ namespace Win.Sfs.SettleAccount.Repository.SettleAccountJob.Report
" SELECT\n" +
" '' AS 交货单号,\n" +
" NULL AS 交货时间,\n" +
" '' AS 手工或自动,\n" +
" a.StorageLocation AS 收货仓库,\n" +
" a.StorageLocationDesc AS 收货仓库描述,\n" +
" '' AS 订货看板编号,\n" +
@ -498,7 +491,7 @@ namespace Win.Sfs.SettleAccount.Repository.SettleAccountJob.Report
" c.MaterialDesc AS 零件中文名称,\n" +
" 0 AS 发货数量,\n" +
" 0 AS 发货状态,\n" +
" a.ExternalKanbanNumber AS 外部验收单号,\n" +
" a.ExternalKanbanNumber AS 外部单号,\n" +
" isnull( a.Qty, 0 ) AS 结算数量,\n" +
" C.EstimateTypeDesc AS 物料组,\n" +
" a.Factory AS 工厂,\n" +
@ -512,7 +505,8 @@ namespace Win.Sfs.SettleAccount.Repository.SettleAccountJob.Report
" Version,\n" +
" StorageLocation,\n" +
" StorageLocationDesc,\n" +
" Factory,ExternalKanbanNumber \n" +
" Factory,\n" +
" ExternalKanbanNumber \n" +
" FROM\n" +
" Set_HQ_H_Platform \n" +
" WHERE\n" +
@ -522,7 +516,8 @@ namespace Win.Sfs.SettleAccount.Repository.SettleAccountJob.Report
" Version,\n" +
" StorageLocation,\n" +
" StorageLocationDesc,\n" +
" Factory,ExternalKanbanNumber \n" +
" Factory,\n" +
" ExternalKanbanNumber \n" +
" ) AS a\n" +
" LEFT OUTER JOIN Set_material AS c ON a.MaterialCode = c.CustomerPartCode \n" +
" WHERE\n" +
@ -605,7 +600,7 @@ namespace Win.Sfs.SettleAccount.Repository.SettleAccountJob.Report
" temp1.物料组,\n" +
" temp1.零件中文名称,\n" +
" temp1.发货数量,\n" +
" temp1.外部验收单号,\n" +
" temp1.外部单号,\n" +
" temp1.结算数量,\n" +
" temp1.结算单价,\n" +
" temp1.结算金额,\n" +
@ -613,6 +608,7 @@ namespace Win.Sfs.SettleAccount.Repository.SettleAccountJob.Report
" isnull( temp1.发货数量, 0 ) * isnull( TEMP2.Price, 0 ) AS 发货总金额,\n" +
" isnull( tt.Qty, 0 ) 退货数量,\n" +
" isnull( temp1.发货数量, 0 ) - isnull( tt.Qty, 0 ) AS 实际发货数量,\n" +
" isnull( temp1.发货数量, 0 ) - isnull( temp1.结算数量, 0 ) - isnull( tt.Qty, 0 ) AS 未结数量,\n" +
" temp1.结算单价 - ISNULL( TEMP2.Price, 0 ) AS 单价差异,\n" +
" ISNULL( TEMP2.Price, 0 ) * ( isnull( temp1.发货数量, 0 ) - isnull( tt.Qty, 0 ) ) AS 实际发货总金额 \n" +
" FROM\n" +
@ -625,7 +621,7 @@ namespace Win.Sfs.SettleAccount.Repository.SettleAccountJob.Report
" c.CustomerPartCode 客户物料号,\n" +
" c.MaterialDesc AS 零件中文名称,\n" +
" isnull( a.Qty, 0 ) AS 发货数量,\n" +
" '' AS 外部验收单号,\n" +
" '' AS 外部单号,\n" +
" isnull( b.Qty, 0 ) AS 结算数量,\n" +
" 0 AS 结算单价,\n" +
" 0 AS 结算金额 ,\n" +
@ -656,16 +652,17 @@ namespace Win.Sfs.SettleAccount.Repository.SettleAccountJob.Report
" temp1.物料组,\n" +
" temp1.零件中文名称,\n" +
" temp1.发货数量,\n" +
" temp1.外部验收单号,\n" +
" temp1.外部单号,\n" +
" temp1.结算数量,\n" +
" temp1.结算单价,\n" +
" temp1.结算金额,\n" +
" isnull( TEMP2.Price, 0 ) AS 发货定价,\n" +
" isnull( temp1.发货数量, 0 ) * isnull( TEMP2.Price, 0 ) AS 发货总金额,\n" +
" isnull( tt.Qty, 0 ) 退货数量,\n" +
" isnull( temp1.发货数量, 0 ) - isnull( temp1.结算数量, 0 )- isnull( tt.Qty, 0 ) AS 实际发货数量,\n" +
" isnull( temp1.发货数量, 0 ) - isnull( tt.Qty, 0 ) AS 实际发货数量,\n" +
" isnull( temp1.发货数量, 0 ) - isnull( temp1.结算数量, 0 ) - isnull( tt.Qty, 0 ) AS 未结数量,\n" +
" temp1.结算单价 - ISNULL( TEMP2.Price, 0 ) AS 单价差异,\n" +
" ISNULL( TEMP2.Price, 0 ) * ( isnull( temp1.发货数量, 0 ) - isnull( temp1.结算数量, 0 ) - isnull( tt.Qty, 0 ) ) AS 实际发货总金额 \n" +
" ISNULL( TEMP2.Price, 0 ) * ( isnull( temp1.发货数量, 0 ) - isnull( tt.Qty, 0 ) ) AS 实际发货总金额 \n" +
" FROM\n" +
" (\n" +
" SELECT\n" +
@ -676,7 +673,7 @@ namespace Win.Sfs.SettleAccount.Repository.SettleAccountJob.Report
" c.CustomerPartCode 客户物料号,\n" +
" c.MaterialDesc AS 零件中文名称,\n" +
" isnull( a.Qty, 0 ) AS 发货数量,\n" +
" '' AS 外部验收单号,\n" +
" '' AS 外部单号,\n" +
" isnull( b.Qty, 0 ) AS 结算数量,\n" +
" isnull( b.Price, 0 ) AS 结算单价,\n" +
" isnull( b.Qty, 0 ) * isnull( b.Price, 0 ) AS 结算金额 ,\n" +
@ -991,7 +988,7 @@ namespace Win.Sfs.SettleAccount.Repository.SettleAccountJob.Report
" temp1.零件中文名称,\n" +
" temp1.发货数量,\n" +
" temp1.发货状态,\n" +
" temp1.外部验收单号,\n" +
" temp1.外部单号,\n" +
" temp1.结算数量,\n" +
" temp1.结算单价,\n" +
" temp1.结算金额,\n" +
@ -1015,7 +1012,7 @@ namespace Win.Sfs.SettleAccount.Repository.SettleAccountJob.Report
" c.MaterialDesc AS 零件中文名称,\n" +
" isnull( a.Qty, 0 ) AS 发货数量,\n" +
" isnull( a.State, 0 ) AS 发货状态,\n" +
" b.ExternalKanbanNumber AS 外部验收单号,\n" +
" b.ExternalKanbanNumber AS 外部单号,\n" +
" isnull( b.Qty, 0 ) AS 结算数量,\n" +
" isnull( b.Price, 0 ) AS 结算单价,\n" +
" isnull( b.Amt, 0 ) AS 结算金额 ,\n" +
@ -1093,7 +1090,7 @@ namespace Win.Sfs.SettleAccount.Repository.SettleAccountJob.Report
" temp1.物料组,\n" +
" temp1.零件中文名称,\n" +
" temp1.发货数量,\n" +
" temp1.外部验收单号,\n" +
" temp1.外部单号,\n" +
" temp1.结算数量,\n" +
" temp1.结算单价,\n" +
" temp1.结算金额,\n" +
@ -1114,7 +1111,7 @@ namespace Win.Sfs.SettleAccount.Repository.SettleAccountJob.Report
" c.CustomerPartCode 客户物料号,\n" +
" c.MaterialDesc AS 零件中文名称,\n" +
" isnull( a.Qty, 0 ) AS 发货数量,\n" +
" '' AS 外部验收单号,\n" +
" '' AS 外部单号,\n" +
" isnull( b.Qty, 0 ) AS 结算数量,\n" +
" 0 AS 结算单价,\n" +
" 0 AS 结算金额 ,\n" +
@ -1203,7 +1200,7 @@ namespace Win.Sfs.SettleAccount.Repository.SettleAccountJob.Report
" C.EstimateTypeDesc 物料组,\n" +
" C.MaterialCode Sap编码,\n" +
" C.MaterialDesc 零件中文名称,\n" +
" a.[ExternalKanbanNumber] AS 外部验收单号,\n" +
" a.[ExternalKanbanNumber] AS 外部单号,\n" +
" a.Factory AS 工厂,\n" +
" a.HQHKanBan AS 订货看板编号,\n" +
" a.AcceptanceDate 验收单日期,\n" +
@ -1428,74 +1425,64 @@ namespace Win.Sfs.SettleAccount.Repository.SettleAccountJob.Report
public string { set; get; }
[ExporterHeader(DisplayName = "交货时间")]
public string { set; get; }
[ExporterHeader(DisplayName = "手工或自动")]
public string { set; get; }
[ExporterHeader(DisplayName = "工厂")]
public string { set; get; }
[ExporterHeader(DisplayName = "外部单号")]
public string { set; get; }
[ExporterHeader(DisplayName = "验收单日期")]
public string { set; get; }
[ExporterHeader(DisplayName = "收货仓库")]
public string { set; get; }
[ExporterHeader(DisplayName = "收货仓库描述")]
public string { set; get; }
[ExporterHeader(DisplayName = "物料组(车型)")]
public string { set; get; }
[ExporterHeader(DisplayName = "订货看板编号")]
public string { set; get; }
[ExporterHeader(DisplayName = "订货零件号")]
public string { set; get; }
[ExporterHeader(DisplayName = "发货零件号")]
public string { set; get; }
[ExporterHeader(DisplayName = "零件中文名称")]
public string { set; get; }
[ExporterHeader(DisplayName = "Sap编码")]
public string Sap编码 { set; get; }
[ExporterHeader(DisplayName = "物料组(车型)")]
public string { set; get; }
[ExporterHeader(DisplayName = "客户物料号")]
public string { set; get; }
[ExporterHeader(DisplayName = "零件中文名称")]
public string { set; get; }
[ExporterHeader(DisplayName = "发货数量")]
public decimal { set; get; }
[ExporterHeader(DisplayName = "发货状态")]
public string { set; get; }
[ExporterHeader(DisplayName = "结算验收单号",IsIgnore =true)]
public string { set; get; }
[ExporterHeader(DisplayName = "退货数量")]
public string 退 { set; get; }
[ExporterHeader(DisplayName = "外部验收单号")]
public string { set; get; }
[ExporterHeader(DisplayName = "实际发货数量")]
public decimal { set; get; }
[ExporterHeader(DisplayName = "结算数量")]
public decimal { set; get; }
[ExporterHeader(DisplayName = "结算单价")]
public decimal { set; get; }
[ExporterHeader(DisplayName = "结算金额")]
public decimal { set; get; }
[ExporterHeader(DisplayName = "销售单价")]
public decimal { set; get; }
[ExporterHeader(DisplayName = "发货定价")]
public decimal { set; get; }
[ExporterHeader(DisplayName = "发货总金额")]
public decimal { set; get; }
[ExporterHeader(DisplayName = "数量差异")]
public decimal { set; get; }
[ExporterHeader(DisplayName = "实际发货总金额")]
public decimal { set; get; }
[ExporterHeader(DisplayName = "量差(实际发货-结算)")]
public decimal { set; get; }
[ExporterHeader(DisplayName = "单价差异")]
public decimal { set; get; }
[ExporterHeader(DisplayName = "差异总金额")]
public decimal { set; get; }
[ExporterHeader(DisplayName = "工厂")]
public string { set; get; }
[ExporterHeader(DisplayName = "看板编号")]
public string { set; get; }
[ExporterHeader(DisplayName = "验收单日期")]
public string { set; get; }
[ExporterHeader(DisplayName = "退货数量")]
public string 退 { set; get; }
}
@ -1530,8 +1517,8 @@ namespace Win.Sfs.SettleAccount.Repository.SettleAccountJob.Report
[ExporterHeader(DisplayName = "结算验收单号",IsIgnore =true)]
public string { set; get; }
[ExporterHeader(DisplayName = "外部验收单号")]
public string { set; get; }
[ExporterHeader(DisplayName = "外部单号")]
public string { set; get; }
[ExporterHeader(DisplayName = "发货数量")]
public decimal { set; get; }
@ -1602,12 +1589,18 @@ 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; }
[ExporterHeader(DisplayName = "实际发货数量")]
public decimal { set; get; }
[ExporterHeader(DisplayName = "未结数量")]
public decimal { set; get; }
[ExporterHeader(DisplayName = "发货定价")]
public decimal { set; get; }

72
src/Modules/SettleAccount/src/SettleAccount.EntityFrameworkCore/Repository/SettleAccountJob/Report/SettleSparePartDapperReportRepository.cs

@ -664,11 +664,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( temp1.收货数量, 0 ) - ISNULL( temp3.Qty, 0 ) 实际交货数量,\n" +
" ISNULL( TEMP2.Price, 0 ) AS 定价 \n" +
" ISNULL( temp1.发货数量, 0 ) - ISNULL( temp3.Qty, 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 ) ) 实际发货总金额 \n" +
" FROM\n" +
" (\n" +
" SELECT\n" +
@ -680,11 +682,24 @@ namespace Win.Sfs.SettleAccount.Repository.SettleAccountJob.Report
" 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( a.ReceiptQty, 0 ) - ISNULL( b.ReceiptQty, 0 ) ) AS 收货与交货差异 \n" +
" FROM\n" +
" ( SELECT SUM ( ReceiptQty ) AS ReceiptQty, PurchaseOrderNo, MaterialCode FROM Set_WMSSparePart WHERE PurchaseOrderNo is not null and PurchaseOrderNo!='' GROUP BY PurchaseOrderNo, MaterialCode ) AS a\n" +
" LEFT JOIN ( SELECT SUM ( ReceiptQty ) ReceiptQty, PurchaseOrderNo, MaterialCode FROM Set_SparePart WHERE Extend != 'is90' and PurchaseOrderNo!='NoOrder' GROUP BY PurchaseOrderNo, MaterialCode ) AS b ON a.PurchaseOrderNo= b.PurchaseOrderNo \n" +
" (\n" +
" SELECT SUM\n" +
" ( ReceiptQty ) AS ReceiptQty,\n" +
" PurchaseOrderNo,\n" +
" MaterialCode \n" +
" FROM\n" +
" Set_WMSSparePart \n" +
" WHERE\n" +
" PurchaseOrderNo IS NOT NULL \n" +
" AND PurchaseOrderNo != '' \n" +
" GROUP BY\n" +
" PurchaseOrderNo,\n" +
" MaterialCode \n" +
" ) AS a\n" +
" LEFT JOIN ( SELECT SUM ( InvoicedQty ) ReceiptQty, PurchaseOrderNo, MaterialCode FROM Set_SparePart WHERE Extend != 'is90' AND PurchaseOrderNo != 'NoOrder' GROUP BY PurchaseOrderNo, MaterialCode ) AS b ON a.PurchaseOrderNo= b.PurchaseOrderNo \n" +
" AND a.MaterialCode = b.MaterialCode\n" +
" LEFT OUTER JOIN ( SELECT MAX ( Id ) Id, MaterialCode, CustomerPartCode, MaterialDesc, EstimateTypeDesc FROM Set_material GROUP BY MaterialCode, MaterialDesc, EstimateTypeDesc, CustomerPartCode ) AS c ON a.MaterialCode = c.CustomerPartCode \n" +
" WHERE\n" +
@ -707,11 +722,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( temp1.收货数量, 0 ) - ISNULL( temp3.Qty, 0 ) 实际交货数量,\n" +
" ISNULL( TEMP2.Price, 0 ) AS 定价 \n" +
" ISNULL( temp1.发货数量, 0 ) - ISNULL( temp3.Qty, 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 ) ) 实际发货总金额 \n" +
" FROM\n" +
" (\n" +
" SELECT\n" +
@ -723,11 +740,24 @@ namespace Win.Sfs.SettleAccount.Repository.SettleAccountJob.Report
" 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" +
" ( SELECT SUM ( ReceiptQty ) AS ReceiptQty, PurchaseOrderNo, MaterialCode FROM Set_WMSSparePart WHERE PurchaseOrderNo is not null and PurchaseOrderNo!='' GROUP BY PurchaseOrderNo, MaterialCode ) a\n" +
" INNER JOIN ( SELECT SUM ( ReceiptQty ) ReceiptQty, PurchaseOrderNo, MaterialCode FROM Set_SparePart WHERE Extend != 'is90' and PurchaseOrderNo!='NoOrder' GROUP BY PurchaseOrderNo, MaterialCode ) AS b ON a.PurchaseOrderNo= b.PurchaseOrderNo \n" +
" (\n" +
" SELECT SUM\n" +
" ( ReceiptQty ) AS ReceiptQty,\n" +
" PurchaseOrderNo,\n" +
" MaterialCode \n" +
" FROM\n" +
" Set_WMSSparePart \n" +
" WHERE\n" +
" PurchaseOrderNo IS NOT NULL \n" +
" AND PurchaseOrderNo != '' \n" +
" GROUP BY\n" +
" PurchaseOrderNo,\n" +
" MaterialCode \n" +
" ) a\n" +
" INNER JOIN ( SELECT SUM ( InvoicedQty ) ReceiptQty, PurchaseOrderNo, MaterialCode FROM Set_SparePart WHERE Extend != 'is90' AND PurchaseOrderNo != 'NoOrder' GROUP BY PurchaseOrderNo, MaterialCode ) AS b ON a.PurchaseOrderNo= b.PurchaseOrderNo \n" +
" AND a.MaterialCode = b.MaterialCode\n" +
" LEFT OUTER JOIN ( SELECT MAX ( Id ) Id, MaterialCode, CustomerPartCode, MaterialDesc, EstimateTypeDesc FROM Set_material GROUP BY MaterialCode, MaterialDesc, EstimateTypeDesc, CustomerPartCode ) AS c ON a.MaterialCode = c.CustomerPartCode \n" +
" WHERE\n" +
@ -1031,7 +1061,7 @@ namespace Win.Sfs.SettleAccount.Repository.SettleAccountJob.Report
}
/// <summary>
/// 大众备件未结
/// 大众备件未结明细
/// </summary>
public class UnSettleSparePartExport
{
@ -1060,20 +1090,26 @@ 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; }
[ExporterHeader(DisplayName = "收货与交货差异")]
[ExporterHeader(DisplayName = "收货与交货差异", IsIgnore = true)]
public decimal { set; get; }
[ExporterHeader(DisplayName = "退货数量")]
public string 退 { set; get; }
[ExporterHeader(DisplayName = "实际交货数量")]
public string { set; get; }
[ExporterHeader(DisplayName = "实际发货数量")]
public string { set; get; }
[ExporterHeader(DisplayName = "未结数量")]
public decimal { set; get; }
[ExporterHeader(DisplayName = "定价")]
public decimal { set; get; }
[ExporterHeader(DisplayName = "实际发货总金额")]
public decimal { set; get; }
[ExporterHeader(DisplayName = "寄售库存数量", IsIgnore = true)]
public decimal { set; get; }

25
src/Modules/SettleAccount/src/SettleAccount.Job/Services/Report/HQHSettledDetailDiffExportService.cs

@ -67,16 +67,17 @@ namespace SettleAccount.Job.Services.Report
//var _reversels = _dapperRepository.GetReverseSettledDetailDiffReportList(version, materialCode, begin, end, materialGroup);
var _lst = _dapperRepository.GetDiffQtyList(version);
foreach (var itm in _lst)
{
var _first = _ls.FirstOrDefault(p => p. == itm. && p. == itm.);
if (_first != null)
{
_first. = _first. + itm.;
_first. = itm.;
}
}
//var _lst = _dapperRepository.GetDiffQtyList(version);
//foreach (var itm in _lst)
//{
// var _first = _ls.FirstOrDefault(p => p.订货看板编号 == itm.看板号 && p.订货零件号 == itm.客户物料号);
// if (_first != null)
// {
// _first.结算数量 = _first.发货数量 + itm.差异数量;
// _first.数量差异 = itm.差异数量;
// }
//}
//订货看板编号
if (!string.IsNullOrEmpty(kanban))
{
@ -114,13 +115,13 @@ namespace SettleAccount.Job.Services.Report
_ls = _ls.Where(p => _groupList.Contains(p.)).ToList();
}
}
//货零件号
//货零件号
if (!string.IsNullOrEmpty(materialCode))
{
var _groupList = materialCode.Split(new char[] { '\n' }).Distinct().ToList();
if (_groupList.Count() > 0)
{
_ls = _ls.Where(p => _groupList.Contains(p.)).ToList();
_ls = _ls.Where(p => _groupList.Contains(p.)).ToList();
}
}
//厂内物料号

Loading…
Cancel
Save