Commit fa87ca58 by Yovan Martinez

Eliminacion de codigo basura y agregado comentarios

parent d6014c58
No preview for this file type
......@@ -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();
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment