feat(lstv2 move): moved lstv2 into this app to keep them combined and easier to maintain

This commit is contained in:
2025-09-19 22:22:05 -05:00
parent caf2315191
commit e4477402ad
847 changed files with 165801 additions and 0 deletions

View File

@@ -0,0 +1,27 @@
export const bulkOrderArticleInfo = `
SELECT
x.HumanReadableId as av
,x.Name
,Alias
,CustomerDescription
,CustomerArticleNumber
,LoadingUnitPieces
,LoadingUnitsPerTruck
,LoadingUnitPieces * LoadingUnitsPerTruck as totalTruckLoad
FROM [test1_AlplaPROD2.0_Read].[masterData].[Article] (nolock) as x
--get the sales price stuff
left join
(select * from (select *
,ROW_NUMBER() OVER (PARTITION BY articleId ORDER BY validAfter DESC) as rn
from [test1_AlplaPROD2.0_Read].[masterData].[SalesPrice] (nolock))as b
where rn = 1) as s on
x.id = s.ArticleId
-- link pkg info
left join
[test1_AlplaPROD2.0_Read].[masterData].[PackagingInstruction] (nolock) as p on
s.PackagingId = p.id
where x.HumanReadableId in ([articles])
`;

View File

@@ -0,0 +1,15 @@
export const invoiceAddress = `
SELECT deliveryAddress.humanreadableid as deliveryAddress
,invoice.HumanReadableId as invoiceAddress
,[Default]
FROM [test1_AlplaPROD2.0_Read].[masterData].[InvoiceAddress] (nolock) as d
join
[test1_AlplaPROD2.0_Read].[masterData].[Address] deliveryAddress (nolock) on deliveryAddress.id = d.AddressId
join
[test1_AlplaPROD2.0_Read].[masterData].[Address] invoice (nolock) on invoice.id = d.InvoiceAddressId
where [Default] = 1
`;

View File

@@ -0,0 +1,26 @@
export const orderState = `
SELECT top(10000)
CustomerOrderNumber
,r.CustomerReleaseNumber
, OrderState
, r.ReleaseState
, h.CreatedByEdi
--, *
FROM [test1_AlplaPROD2.0_Read].[order].[Header] (nolock) h
/* get the line items to link to the headers */
left join
[test1_AlplaPROD2.0_Read].[order].[LineItem] (nolock) l on
l.HeaderId = h.id
/* get the releases to link to the headers */
left join
[test1_AlplaPROD2.0_Read].[order].[Release] (nolock) r on
r.LineItemId = l.id
where
--h.CreatedByEdi = 1
r.ReleaseState > 0
--and CustomerOrderNumber in ( '2358392')
`;