From 9759d2e9bd4ffcd99ba2b9f21895c20bdc6dcfdb Mon Sep 17 00:00:00 2001 From: Enrique Barcelli Date: Fri, 3 Dec 2021 19:19:07 +0800 Subject: [PATCH] Add rest of json structure --- .../openbravo/kikobar/intfactsunat/query.sql | 55 +++++++++++++++---- 1 file changed, 44 insertions(+), 11 deletions(-) diff --git a/src/org/openbravo/kikobar/intfactsunat/query.sql b/src/org/openbravo/kikobar/intfactsunat/query.sql index d7aa6cc..711d916 100644 --- a/src/org/openbravo/kikobar/intfactsunat/query.sql +++ b/src/org/openbravo/kikobar/intfactsunat/query.sql @@ -139,30 +139,63 @@ select ) ) ) - - || jsonb_build_object( - 'encabezado', jsonb_agg( + 'adicionalDetalle','' + ) + || + jsonb_build_object( + 'tributos', jsonb_agg(DISTINCT jsonb_build_object( - 'factura',ventas.documentno, - 'terminopago',ventas.paymentterm, - 'organizacion',ventas.organisation, - 'parent',ventas.parentorg + 'invoiceid',c_invoice_id, + 'ideTributo','1000', + 'nomTributo','IGV', + 'codTipTributo','VAT', + 'mtoBaseImponible','100.00', + 'mtoTributo','18.00' ) ) ) || jsonb_build_object( - 'lineas', jsonb_agg( + 'leyendas', jsonb_build_object( + 'codLeyenda','1000', + 'desLeyenda','CIENTO DIECIOCHO SOLES' + ) + ) + || + jsonb_build_object( + 'relacionados','' + ) + || + jsonb_build_object( + 'variablesGlobales','' + ) + || + jsonb_build_object( + 'datoPago', jsonb_build_object( + 'formaPago','Credito', + 'mtoNetoPendientePago','118.00', + 'tipMonedaMtoNetoPendientePago','PEN' + ) + ) + || + jsonb_build_object( + 'detallePago', jsonb_agg(DISTINCT jsonb_build_object( - 'dias',ventas.netdays, - 'unidad',ventas.uom + 'mtoCuotaPago','100.00', + 'fecCuotaPago','2021-11-30', + 'tipMonedaCuotaPago','PEN' ) ) ) || jsonb_build_object( - 'manual','creado a mano' + 'retencion', jsonb_build_object( + 'impOperacion','118.00', + 'porRetencion','0.00', + 'impRetencion','0.00' + ) ) + from ventas; \ No newline at end of file