From fa87ca58287a30afe477844f0f047559839d75dc Mon Sep 17 00:00:00 2001 From: Yovan Martinez Date: Sun, 8 May 2022 14:33:31 -0400 Subject: [PATCH] Eliminacion de codigo basura y agregado comentarios --- jdbc/bin/App.class | Bin 7147 -> 0 bytes jdbc/src/App.java | 38 ++------------------------------------ 2 files changed, 2 insertions(+), 36 deletions(-) diff --git a/jdbc/bin/App.class b/jdbc/bin/App.class index a057bef..deaf147 100644 Binary files a/jdbc/bin/App.class and b/jdbc/bin/App.class differ diff --git a/jdbc/src/App.java b/jdbc/src/App.java index e837197..10fe96d 100644 --- a/jdbc/src/App.java +++ b/jdbc/src/App.java @@ -94,6 +94,7 @@ public class App { //DETALLES CON ID DE FACTURA ESPECIFICO System.out.println("*Detalles de factura: "); + //Esta id sera utilizada para guardar el id de la factura especifica que se desea conocer sus detalles int id_factura_especifica = 5; rs = testamento.executeQuery("SELECT factura.fecha_emision, cliente.nombre AS nombre_cliente, cliente.apellido, producto.nombre AS producto, factura_detalle.cantidad,factura_tipo.nombre AS tipo_de_Factura FROM factura JOIN factura_detalle ON factura_detalle.factura_id=factura.id JOIN factura_tipo ON factura.factura_tipo_id=factura_tipo.id JOIN producto ON factura_detalle.producto_id=producto.id JOIN cliente ON factura.cliente_id=cliente.id WHERE factura.id = "+ id_factura_especifica); while (rs.next()) { @@ -110,7 +111,6 @@ public class App { //MONTOS DE FACTURAS ORDENADAS SEGUND TOTALES System.out.println("*Montos de facturas ordenadas segun totales: "); - rs = testamento.executeQuery("SELECT factura_id, TRUNC(SUM(cantidad * precio)) AS total_monto FROM factura_detalle JOIN producto ON factura_detalle.producto_id = producto.id JOIN factura ON factura_detalle.factura_id = factura.id GROUP BY factura_id ORDER BY total_monto DESC"); while (rs.next()) { int factura_id = rs.getInt("factura_id"); @@ -120,8 +120,7 @@ public class App { } System.out.println("--------------------------------------------------------------------------------------------------------"); //MOSTRAR EL IVA 10% DE LOS TOTALES DE MONTOS DE FACTURAS - System.out.println("*Iva 10% del total de monto de cada fatura: "); - + System.out.println("*Iva 10% del total de monto de cada fatura: "); rs = testamento.executeQuery("SELECT factura_id, TRUNC(SUM(cantidad * precio )* 0.1) AS total_monto FROM factura_detalle JOIN producto ON factura_detalle.producto_id = producto.id JOIN factura ON factura_detalle.factura_id = factura.id GROUP BY factura_id ORDER BY total_monto DESC"); while (rs.next()) { int factura_id = rs.getInt("factura_id"); @@ -131,39 +130,6 @@ public class App { } System.out.println("--------------------------------------------------------------------------------------------------------"); - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - rs.close(); testamento.close(); c.close(); -- libgit2 0.26.0