12 lines
904 B
MySQL
12 lines
904 B
MySQL
|
|
CREATE OR REPLACE VIEW public."Prc_V_MaterialRequestLine"
|
|||
|
|
AS
|
|||
|
|
-- Tüm Talepler listesinin kaynağı: talep başlığı × kalem, her kalem bir satır. Kalemi olmayan talep de
|
|||
|
|
-- listeden düşmesin diye LEFT JOIN; o satırın anahtarı talebin kendi Id'sidir.
|
|||
|
|
SELECT COALESCE(i."Id", r."Id") AS "Id", r."Id" AS "MaterialRequestId", r."TenantId", r."IsDeleted",
|
|||
|
|
r."RequestNo", r."Priority", r."RequesterUserId", r."DepartmentId", r."WarehouseId", r."LocationId", r."RequestDate",
|
|||
|
|
r."Description", r."ApprovalStatus", r."ApprovalUserName", r."ApprovalDate", r."ApprovalDescription",
|
|||
|
|
i."ProductId", i."Quantity", i."UomId", i."FulfillmentMethod", i."DueDate", i."RequestReason", i."DeliveredQuantity",
|
|||
|
|
i."PurchaseResponsibleUserId", i."LineStatus"
|
|||
|
|
FROM "Prc_T_MaterialRequest" r
|
|||
|
|
LEFT JOIN "Prc_T_MaterialRequestItem" i ON i."MaterialRequestId" = r."Id" AND i."IsDeleted" = FALSE;
|