Created
December 12, 2025 13:11
-
-
Save gmdias727/3a0ad1382f1a810db8e0b6ec3a2c892d to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| SELECT | |
| i.invoice_id, | |
| CONCAT(u.first_name, ' ', u.middle_name, ' ', u.last_name) AS "Nome Completo", | |
| u.id_document AS "CPF", | |
| u.phone_number AS "Telefone", | |
| a.email AS "Email", | |
| est.establishment_name AS "Nome da Loja", | |
| i.establishment_doc AS "CNPJ da Loja", | |
| i.invoice_number AS "Número da Nota", | |
| i.invoice_series AS "Série da Nota", | |
| i.nfse_verification_code AS "Código de Verificação NFSE", | |
| TO_CHAR(i.invoice_date, 'DD/MM/YYYY') AS "Data da Nota", | |
| i.invoice_amount AS "Valor da Nota", | |
| TO_CHAR(i.created_at, 'DD/MM/YYYY HH24:MI:SS') AS "Registrada Em" | |
| FROM | |
| invoices i | |
| INNER JOIN users u | |
| ON u.user_uuid = i.user_uuid | |
| INNER JOIN auth a | |
| ON a.uuid = u.auth_uuid | |
| INNER JOIN establishments est | |
| ON est.establishment_uuid = i.establishment_uuid | |
| WHERE | |
| i.created_at BETWEEN '2025-10-19' AND '2025-12-31' AND | |
| i.invoice_date > '2025-11-01' | |
| AND | |
| i.invoice_status = 'ACCEPTED' | |
| ORDER BY | |
| i.created_at ASC, | |
| u.first_name ASC |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment