Commit all views for ITSA

This commit is contained in:
AzureAD\SylvainDUVERNAY
2026-03-24 14:40:53 +01:00
parent 091bd4ce00
commit 832a142e87
62 changed files with 2397 additions and 0 deletions

View File

@@ -0,0 +1,21 @@
CREATE OR REPLACE VIEW public.vw_utility_instructed_lots AS
WITH stock_move AS (
SELECT DISTINCT mvt_1."intLotId",
mvt_1."intShipmentId",
mvt_1."dblQuantity",
mvt_1."strUnit",
mvt_1."dblQuantityKg"
FROM vw_utility_stock_movements mvt_1
WHERE ((1 = 1) AND (mvt_1."strMovementType" = ANY (ARRAY['Inbound'::text, 'Dropship'::text])))
)
SELECT mvt."intLotId",
mvt."intShipmentId",
lot."intPurchaseLineId",
mvt."dblQuantity",
mvt."strUnit",
mvt."dblQuantityKg",
lot."intSaleLineId"
FROM ((stock_move mvt
JOIN vw_utility_shipment_in spt ON ((mvt."intShipmentId" = spt."intShipmentId")))
JOIN vw_utility_lot lot ON ((mvt."intLotId" = lot."intLotId")))
WHERE ((1 = 1) AND ((spt."strState")::text = 'draft'::text));;