13 lines
653 B
SQL
13 lines
653 B
SQL
CREATE OR REPLACE VIEW public.vw_utility_matched_lots AS
|
|
SELECT matching.lot_p AS "intPurchaseLotId",
|
|
matching.lot_s AS "intSaleLotId",
|
|
COALESCE(matching.lot_shipment_in, 0) AS "intLotShipmentIn",
|
|
matching.lot_quantity AS "dblQuantity",
|
|
uom.name AS "strUnit",
|
|
matching.lot_av AS "strAvailability",
|
|
matching.lot_status AS "strStatus"
|
|
FROM ((lot_qt matching
|
|
LEFT JOIN vw_utility_shipment_in shipment ON ((matching.lot_shipment_in = shipment."intShipmentId")))
|
|
LEFT JOIN product_uom uom ON ((matching.lot_unit = uom.id)))
|
|
WHERE ((1 = 1) AND (COALESCE(matching.lot_p, 0) > 0) AND (COALESCE(matching.lot_s, 0) > 0));;
|