Project

General

Profile

Actions

Tareas #5350

open

Reporte de Documentos de Ventas

Added by Jose Orlando 8 months ago. Updated 8 months ago.

Status:
Resuelta
Priority:
Normal
Assignee:
Start date:
02/18/2025
Due date:
% Done:

0%

Estimated time:

Description

filtro:
org
rango de fechas

select
bp.taxid as ruc,
bp.name as cliente,
concat(dir.address1,coalesce(dir.address2,'')) as direccion,
au.email as email,
case td.SRI_ShortDocType when '01' then 'FACTURA' when '04' then 'NOTA DE CREDITO' ELSE 'ND' END AS tipo_doc,
documentno as num_doc,
dateinvoiced::date as fecha,
SRI_AuthorizationCode as num_autoriz,
totallines baseimponible,
grandtotal - totallines as IVA,
grandtotal total
from c_invoice i
inner join C_DocType td on td.C_DocType_id = i.C_DocTypeTarget_id
inner join c_bpartner bp on bp.c_bpartner_id = i.c_bpartner_id
inner join ad_user au on au.ad_user_id = i.ad_user_id
inner join C_BPartner_Location bpl on bpl.C_BPartner_Location_id = i.C_BPartner_Location_id
inner join c_location dir on dir.c_location_id = bpl.c_location_id
inner join SRI_Authorization aut on aut.SRI_Authorization_id = i.SRI_Authorization_id
where i.ad_client_id = 1000002
and i.ad_org_id = 1000006
and dateinvoiced >= '2024-01-01' and dateinvoiced <= '2024-12-31'
and i.issotrx = 'Y'
and i.docstatus in ('CO','CL')
and td.sri_tipocomprobante_ID is not null
order by dateinvoiced,documentno


Files

clipboard-202502261522-brdbl.png (10.2 KB) clipboard-202502261522-brdbl.png Armando Chuto, 02/26/2025 03:23 PM
Actions

Also available in: Atom PDF