refactor(ti import): made a change to look at the loading date vs the delivery date

This commit is contained in:
2025-05-20 13:41:36 -05:00
parent 2559706510
commit fb603e74dc
2 changed files with 5 additions and 2 deletions

View File

@@ -1,6 +1,7 @@
export let getHeaders = `
select AuftragsNummer as header,
IdAuftragsAbruf as releaseNumber,
AbrufLadeDatum AS LoadingDate,
AbrufLiefertermin as delDate
FROM alplaprod_test1.dbo.V_TrackerAuftragsAbrufe (nolock) b
@@ -19,7 +20,8 @@ on x.IdLieferkondition = c.IdLieferkondition
on b.IdAdresse = x.addressID
WHERE AbrufStatus = 1 and
AbrufLiefertermin between DATEADD(HOUR, -[from], GETDATE()) and DATEADD(HOUR, [to], GETDATE()) -- this number will be grabbed from the db with a default of 24hours
--AbrufLiefertermin between DATEADD(HOUR, -15, GETDATE()) and DATEADD(HOUR, 36, GETDATE()) -- this number will be grabbed from the db with a default of 24hours
AbrufLadeDatum between DATEADD(HOUR, -15, GETDATE()) and DATEADD(HOUR, 36, GETDATE()) -- this number will be grabbed from the db with a default of 24hours
and x.Abbreviation not in ('exw')
and IdAuftragsAbruf not in ([exclude])
`;

View File

@@ -139,7 +139,8 @@ on
ac.pkgId = pkg.pkgId
WHERE AbrufStatus = 1
and AbrufLiefertermin between DATEADD(HOUR, -[from], getdate()) and DATEADD(HOUR, [to], getdate())-- this number will be grabbed from the db with a default of 24hours
--and AbrufLiefertermin between DATEADD(HOUR, -[from], getdate()) and DATEADD(HOUR, [to], getdate())-- this number will be grabbed from the db with a default of 24hours
and AbrufLadeDatum between DATEADD(HOUR, -[from], getdate()) and DATEADD(HOUR, [to], getdate())-- this number will be grabbed from the db with a default of 24hours
and deliveryContionAbv not in ('EXW')
--ORDER BY AbrufLiefertermin)