feat(materials per day): more work on materials per day

This commit is contained in:
2025-11-15 16:22:52 -06:00
parent 7b630d5c0b
commit 564f0b5add
5 changed files with 177 additions and 4 deletions

View File

@@ -113,3 +113,21 @@ ORDER BY
n.ProductionLotHumanReadableId
OPTION (MAXRECURSION 0);
`;
export const materialPurchasesPerDay = `
use AlplaPROD_test1
declare @startDate nvarchar(max) = '[startDate]'
declare @endDate nvarchar(max) = '[endDate]'
SELECT
[IdBestellung] as purhcaseOrder
,[IdArtikelVarianten]
,convert(date, [BestellDatum], 120) as orderDate
,convert(date, [Lieferdatum], 120) as deliveryDate
,[BestellMenge] as qty
,[BestellMengeVPK] as pallets
FROM [dbo].[T_Bestellpositionen]
where PositionsStatus = 2 and convert(date, [Lieferdatum], 120) between @startDate and @endDate --and IdBestellung in( 5535,5534,5513)
`;