feat(notification): plant to plant edi
This commit is contained in:
@@ -0,0 +1,14 @@
|
||||
use [test3_AlplaPROD2.0_Read]
|
||||
|
||||
select
|
||||
humanreadableId as addressId
|
||||
,ContactEmail as email
|
||||
,ContactName
|
||||
,ContactPhoneNumber
|
||||
,Name
|
||||
,Street
|
||||
,City
|
||||
,ZipCode
|
||||
--,*
|
||||
from [masterData].[Address] (nolock)
|
||||
where humanreadableid = [customerAddress]
|
||||
@@ -0,0 +1,43 @@
|
||||
use AlplaPROD_test1
|
||||
|
||||
|
||||
/**
|
||||
check if we have any new alpla bols that were created
|
||||
*/
|
||||
|
||||
SELECT
|
||||
x.idladeplanung
|
||||
,e.idjournal
|
||||
,e.journalNummer as bol
|
||||
,e.idjournalstatus
|
||||
,e.ladeDatum as loadDate
|
||||
,e.bemerkung
|
||||
,e.ereporting_idwerk
|
||||
,e.journalDatum
|
||||
,a.idadressen as addressId
|
||||
,a.bezeichnung as addressDescription
|
||||
,a.strasse as streetAddress
|
||||
,a.ort as cityState
|
||||
,a.plz as zipcode
|
||||
,idauftrag as releaseNumber
|
||||
--,*
|
||||
FROM [dbo].[T_EAIJournal] as e with (nolock)
|
||||
|
||||
|
||||
-- pull in the address so we only pull in florence data
|
||||
left join
|
||||
[dbo].[T_EAIJournalAdresse] as a with (nolock) on
|
||||
a.[IdJournalAdresse] = [IdJournalKundenAdresse]
|
||||
|
||||
-- get the table to link the pallets to the bol
|
||||
left join
|
||||
[dbo].[T_EAIJournalPosition] as x with (nolock) on
|
||||
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 JournalDatum > DATEADD(MINUTE, -[timeCheck], GETDATE())
|
||||
and e.idjournal 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
|
||||
@@ -0,0 +1,36 @@
|
||||
use AlplaPROD_test1
|
||||
|
||||
select * from (SELECT
|
||||
p.[IdLadePlanung]
|
||||
,p.[Beleg] as lotNumber
|
||||
,p.[LfdNrJeArtikelKunde] as runningNr
|
||||
,p.[Barcode]
|
||||
,p.[ProduktionsDatum] as productionDate
|
||||
,p.[Add_User] as scanDate
|
||||
,p.[Add_Date]
|
||||
,p.[Upd_User]
|
||||
,p.[Upd_Date]
|
||||
,p.[IdJournalWarenPosition]
|
||||
,p.[LieferMenge] as qty
|
||||
-- ,av.IdArtikelvarianten as article
|
||||
-- ,av.Bezeichnung as alias
|
||||
,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
|
||||
--,*
|
||||
|
||||
FROM [dbo].[T_EAIJournalLieferPosition] as p (nolock)
|
||||
|
||||
-- left join
|
||||
-- dbo.T_ProdPlanung as l on
|
||||
-- l.IdProdPlanung = p.Beleg
|
||||
|
||||
left join
|
||||
[test3_AlplaPROD2.0_Read].labelling.InternalLabel as av on
|
||||
av.RunningNumber = p.[LfdNrJeArtikelKunde]
|
||||
) as a
|
||||
|
||||
where idladeplanung in ([palLinkedToBol]) and RowNum = 1
|
||||
|
||||
order by runningNr
|
||||
Reference in New Issue
Block a user