15 lines
411 B
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';
|