Uecko_ERP/docs/customer-invoices/sql/validate-proforma-archive.sql

15 lines
411 B
SQL

SELECT id, proforma_reference, status, archived_at
FROM proformas
WHERE archived_at IS NOT NULL
AND status NOT IN ('draft', 'rejected');
SELECT id, proforma_reference, status, archived_at, deleted_at
FROM proformas
WHERE archived_at IS NOT NULL
AND deleted_at IS NOT NULL;
SELECT id, proforma_reference, status, archived_at, deleted_at
FROM proformas
WHERE deleted_at IS NOT NULL
AND status <> 'draft';