feat(standard orders in): multi customer orders in plus ignore already started
This commit is contained in:
27
server/services/sqlServer/querys/dm/bulkOrderArticleInfo.ts
Normal file
27
server/services/sqlServer/querys/dm/bulkOrderArticleInfo.ts
Normal 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])
|
||||
`;
|
||||
15
server/services/sqlServer/querys/dm/invoiceAddress.ts
Normal file
15
server/services/sqlServer/querys/dm/invoiceAddress.ts
Normal 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
|
||||
`;
|
||||
8
server/services/sqlServer/querys/dm/orderState.ts
Normal file
8
server/services/sqlServer/querys/dm/orderState.ts
Normal file
@@ -0,0 +1,8 @@
|
||||
export const orderState = `
|
||||
SELECT top(500)
|
||||
CustomerOrderNumber
|
||||
, OrderState
|
||||
--, *
|
||||
FROM [test1_AlplaPROD2.0_Read].[order].[Header] (nolock)
|
||||
where OrderState = 0
|
||||
`;
|
||||
Reference in New Issue
Block a user