-- View: public.vw_utility_lot

-- DROP VIEW public.vw_utility_lot;

CREATE OR REPLACE VIEW public.vw_utility_lot AS
 SELECT id AS "intLotId",
    COALESCE(lot_container, ''::character varying) AS "strContainer",
    COALESCE(lot_name, ''::character varying) AS "strLotName",
    COALESCE(lot_status, ''::character varying) AS "strStatus",
    COALESCE(lot_type, ''::character varying) AS "strType",
    COALESCE(lot_av, ''::character varying) AS "strAvailability",
    line AS "intPurchaseLineId",
    sale_line AS "intSaleLineId",
    lot_product AS "intProductId",
    lot_state AS "intLotStateId",
    lot_unit AS "intUnitId",
    lot_unit_line AS "intUnitLineId",
    lot_qt AS "dblQuantity",
    invoice_line AS "intInvoiceLineId",
    invoice_line_prov AS "intInvoiceLineProvId",
    COALESCE(lot_pur_inv_state, ''::character varying) AS "strPurchaseInvoiceState",
    COALESCE(lot_sale_inv_state, ''::character varying) AS "strSaleInvoiceState",
    lot_shipment_in AS "intShipmentInId",
    lot_shipment_internal AS "intShipmentInternalId",
    lot_shipment_out AS "intShipmentOutId",
    sale_invoice_line AS "intSaleInvoiceLineId",
    sale_invoice_line_prov AS "intSaleInvoiceLineProvId"
   FROM lot_lot lot
  WHERE 1 = 1;

ALTER TABLE public.vw_utility_lot
    OWNER TO postgres;
