Files
lstV2/server/services/sqlServer/querys/psiReport/planningNumbersByAv.ts

34 lines
1.1 KiB
TypeScript

export const planningNumbersByAVDate = `
use AlplaPROD_test1
declare @start_date nvarchar(30) = [startDate] --'2025-01-01'
declare @end_date nvarchar(30) = [endDate] --'2025-08-09'
/*
articles will need to be passed over as well as the date structure we want to see
*/
-- planned lots in planning
select V_ProdLosProduktionJeProdTag_PLANNING.IdArtikelvarianten As Article,
ProduktionAlias as Description,
standort as MachineId,
MaschinenBezeichnung as MachineName,
--MaschZyklus as PlanningCycleTime,
V_ProdLosProduktionJeProdTag_PLANNING.IdProdPlanung as LotNumber,
FORMAT(ProdTag, 'MM/dd/yyyy') as ProductionDay,
V_ProdLosProduktionJeProdTag_PLANNING.planMenge as TotalPlanned,
ProduktionMenge as QTYPerDay,
round(ProduktionMengeVPK, 2) PalDay,
Status as finished
--MaschStdAuslastung as nee
from dbo.V_ProdLosProduktionJeProdTag_PLANNING (nolock)
left join
dbo.V_ProdPlanung (nolock) on
V_ProdLosProduktionJeProdTag_PLANNING .IdProdPlanung = V_ProdPlanung.IdProdPlanung
where V_ProdLosProduktionJeProdTag_PLANNING.IdArtikelvarianten in ([articles]) and ProdTag between @start_date and @end_date --and IdProdPlanung = 18442
order by ProdTag
`;