fix(notify): fixed to plantto plant that would cause multiple emails to be sent and never update

This commit is contained in:
2026-03-11 15:30:53 -05:00
parent ea92422bb1
commit dcfa56bdb9
7 changed files with 46 additions and 21 deletions

View File

@@ -1,4 +1,4 @@
use [test3_AlplaPROD2.0_Read]
use [test1_AlplaPROD2.0_Read]
select
humanreadableId as addressId

View File

@@ -36,8 +36,8 @@ x.idjournal = e.idjournal
where idjournalStatus = 62
--and idadressen = 270
--and a.bezeichnung like '%Alpla%' -- we only want to monitor for addresses that are linked to alpla.
and a.bezeichnung like '%Alpla%' -- we only want to monitor for addresses that are linked to alpla.
and JournalDatum > DATEADD(MINUTE, -[timeCheck], GETDATE())
and e.idjournal not in ([ignoreBols])
and e.journalNummer not in ([ignoreBols])
and idauftrag > 1 -- this will ignore all incoming goodsv as we are really only looking for outbound deliveries
order by JournalDatum desc

View File

@@ -17,7 +17,7 @@ use AlplaPROD_test1
,av.articlehumanreadableid as article
,av.ArticleDescription as alias
--,[SSCC_ReserveZiffer]
,ROW_NUMBER() OVER (PARTITION BY p.[LfdNrJeArtikelKunde] ORDER BY p.upd_date DESC) AS RowNum
--,ROW_NUMBER() OVER (PARTITION BY p.[LfdNrJeArtikelKunde] ORDER BY p.upd_date DESC) AS RowNum
--,*
FROM [dbo].[T_EAIJournalLieferPosition] as p (nolock)
@@ -27,10 +27,11 @@ use AlplaPROD_test1
-- l.IdProdPlanung = p.Beleg
left join
[test3_AlplaPROD2.0_Read].labelling.InternalLabel as av on
[test1_AlplaPROD2.0_Read].labelling.InternalLabel as av on
av.RunningNumber = p.[LfdNrJeArtikelKunde]
) as a
where idladeplanung in ([palLinkedToBol]) and RowNum = 1
where idladeplanung in ([palLinkedToBol])
--and RowNum = 1
order by runningNr