From fa329b5ad1de4cf40175648e8859ef10fc016ac2 Mon Sep 17 00:00:00 2001 From: Administrator Date: Sat, 22 Jan 2022 15:59:10 +0800 Subject: [PATCH] =?UTF-8?q?=E6=9B=B4=E6=96=B0=E7=89=88=E6=9C=AC?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../Report/InvoiceSettledDetailDiffDapperRepository.cs | 2 +- .../SettleAccountJob/Report/UnSettleDiffDapperRepository.cs | 2 +- .../Report/UnSettledDetailDapperRepository.cs | 2 +- .../Services/Report/UnSettleDiffExportService.cs | 6 +++--- 4 files changed, 6 insertions(+), 6 deletions(-) diff --git a/src/Modules/SettleAccount/src/SettleAccount.EntityFrameworkCore/Repository/SettleAccountJob/Report/InvoiceSettledDetailDiffDapperRepository.cs b/src/Modules/SettleAccount/src/SettleAccount.EntityFrameworkCore/Repository/SettleAccountJob/Report/InvoiceSettledDetailDiffDapperRepository.cs index f8fb6449..b926fc3c 100644 --- a/src/Modules/SettleAccount/src/SettleAccount.EntityFrameworkCore/Repository/SettleAccountJob/Report/InvoiceSettledDetailDiffDapperRepository.cs +++ b/src/Modules/SettleAccount/src/SettleAccount.EntityFrameworkCore/Repository/SettleAccountJob/Report/InvoiceSettledDetailDiffDapperRepository.cs @@ -264,7 +264,7 @@ namespace Win.Sfs.SettleAccount.Repository.SettleAccountJob.Report " AND b.MaterialCode = a.ItemCode\n" + " LEFT JOIN ( SELECT SUM( amt )/ SUM( Qty ) InvoicePrice, MaterialCode FROM set_invoice WHERE version = '{0}' GROUP BY materialcode ) c ON a.ItemCode = c.MaterialCode\n" + " LEFT JOIN set_material d ON a.ItemCode = d.CustomerPartCode\n" + -" LEFT JOIN (select max(CreationTime) CreateTime,MaterialCode,MaterialDesc from Set_material group by MaterialCode,MaterialDesc) e ON a.ErpMaterialCode = e.MaterialCode {1} \n" + +" LEFT JOIN (select max(Id) Id,MaterialCode,MaterialDesc from Set_material group by MaterialCode,MaterialDesc) e ON a.ErpMaterialCode = e.MaterialCode {1} \n" + " ) TEMP1\n" + " LEFT JOIN (\n" + " SELECT\n" + diff --git a/src/Modules/SettleAccount/src/SettleAccount.EntityFrameworkCore/Repository/SettleAccountJob/Report/UnSettleDiffDapperRepository.cs b/src/Modules/SettleAccount/src/SettleAccount.EntityFrameworkCore/Repository/SettleAccountJob/Report/UnSettleDiffDapperRepository.cs index 71dde7ac..ba247cce 100644 --- a/src/Modules/SettleAccount/src/SettleAccount.EntityFrameworkCore/Repository/SettleAccountJob/Report/UnSettleDiffDapperRepository.cs +++ b/src/Modules/SettleAccount/src/SettleAccount.EntityFrameworkCore/Repository/SettleAccountJob/Report/UnSettleDiffDapperRepository.cs @@ -206,7 +206,7 @@ namespace Win.Sfs.SettleAccount.Repository.SettleAccountJob.Report " AND a.KENNCode = b.KENNCode\n" + " LEFT JOIN Set_material c ON a.MaterialCode = c.CustomerPartCode {0}\n" + " ) temp1\n" + -" LEFT JOIN Set_material temp2 ON temp1.ParentSapMaterialCode = temp2.MaterialCode \n" + +" LEFT JOIN (select max(Id) Id,MaterialCode,MaterialDesc from Set_material group by MaterialCode,MaterialDesc) temp2 ON temp1.ParentSapMaterialCode = temp2.MaterialCode \n" + " ) t1\n" + " LEFT JOIN (\n" + " SELECT\n" + diff --git a/src/Modules/SettleAccount/src/SettleAccount.EntityFrameworkCore/Repository/SettleAccountJob/Report/UnSettledDetailDapperRepository.cs b/src/Modules/SettleAccount/src/SettleAccount.EntityFrameworkCore/Repository/SettleAccountJob/Report/UnSettledDetailDapperRepository.cs index 9c6b8400..cdcc7eb6 100644 --- a/src/Modules/SettleAccount/src/SettleAccount.EntityFrameworkCore/Repository/SettleAccountJob/Report/UnSettledDetailDapperRepository.cs +++ b/src/Modules/SettleAccount/src/SettleAccount.EntityFrameworkCore/Repository/SettleAccountJob/Report/UnSettledDetailDapperRepository.cs @@ -118,7 +118,7 @@ namespace Win.Sfs.SettleAccount.Repository.SettleAccountJob.Report " left join (select * from Set_Unsettle where version='{1}') f \n" + " on a.MaterialCode=f.MaterialCode and a.KENNCode2=f.KENNCode and a.ChassisNumber2=f.ChassisNumber \n"+ " LEFT JOIN Set_material B ON a.MaterialCode = b.CustomerPartCode \n" + -" LEFT JOIN Set_material d ON a.ParentSapMaterialCode = d.MaterialCode \n" + +" LEFT JOIN (select max(Id) Id,MaterialCode,MaterialDesc from Set_material group by MaterialCode,MaterialDesc) d ON a.ParentSapMaterialCode = d.MaterialCode \n" + " ) temp1\n" + " LEFT JOIN ( SELECT Price, MaterialCode FROM Set_PriceList WHERE version = ( SELECT Max( Version ) FROM Set_PriceList ) ) temp2 ON temp1.SapMaterialCode = temp2.MaterialCode"; diff --git a/src/Modules/SettleAccount/src/SettleAccount.Job/Services/Report/UnSettleDiffExportService.cs b/src/Modules/SettleAccount/src/SettleAccount.Job/Services/Report/UnSettleDiffExportService.cs index 20e95681..1200b501 100644 --- a/src/Modules/SettleAccount/src/SettleAccount.Job/Services/Report/UnSettleDiffExportService.cs +++ b/src/Modules/SettleAccount/src/SettleAccount.Job/Services/Report/UnSettleDiffExportService.cs @@ -111,9 +111,9 @@ namespace SettleAccount.Job.Services.Report Price = itm1.Price, Amt = itm1.Amt, Qty = 1, - UNSettleQty = !string.IsNullOrEmpty(tm1.ParentSapMaterialCode) ? 1 : 0, - DiffQty = !string.IsNullOrEmpty(tm1.ParentSapMaterialCode) ? 0 : -1, - DiffAmt = !string.IsNullOrEmpty(tm1.ParentSapMaterialCode) ? 0 : Math.Round(itm1.Qty * itm1.Price) + UNSettleQty = tm1!=null ? 1 : 0, + DiffQty = tm1!=null ? 0 : -1, + DiffAmt = tm1!=null ? 0 : Math.Round(itm1.Qty * itm1.Price) }; rangeList = query.ToList();