16 lines
1 KiB
MySQL
16 lines
1 KiB
MySQL
|
|
-- Aynı ihaledeki teklif talepleri. BaseId açık belgedir: teklif talebinde ihalenin diğer belgeleri,
|
|||
|
|
-- satınalma siparişinde kaynak teklifin ihalesindeki bütün belgeler.
|
|||
|
|
CREATE OR REPLACE VIEW public."Prc_V_PurchaseRfqAlternative" AS
|
|||
|
|
SELECT b."Id" AS "BaseId", x."Id", x."TenantId", x."RfqNo", x."SupplierId", x."Status", x."SupplierResponse",
|
|||
|
|
x."OrderDeadline", x."ExpectedArrival", x."UntaxedAmount", x."TotalAmount", x."CurrencyId", x."IsDeleted"
|
|||
|
|
FROM "Prc_T_PurchaseRfq" b
|
|||
|
|
INNER JOIN "Prc_T_PurchaseRfq" x ON x."TenderGroupId" = b."TenderGroupId" AND x."Id" <> b."Id"
|
|||
|
|
WHERE b."IsDeleted" = false
|
|||
|
|
UNION ALL
|
|||
|
|
SELECT o."Id", x."Id", x."TenantId", x."RfqNo", x."SupplierId", x."Status", x."SupplierResponse",
|
|||
|
|
x."OrderDeadline", x."ExpectedArrival", x."UntaxedAmount", x."TotalAmount", x."CurrencyId", x."IsDeleted"
|
|||
|
|
FROM "Prc_T_PurchaseOrder" o
|
|||
|
|
INNER JOIN "Prc_T_PurchaseRfq" s ON s."Id" = o."PurchaseRfqId"
|
|||
|
|
INNER JOIN "Prc_T_PurchaseRfq" x ON x."TenderGroupId" = s."TenderGroupId"
|
|||
|
|
WHERE o."IsDeleted" = false;
|