report.title(cmp.text("Agencia "+ Shared.getConfig("storeName") + "\nCorrespondiente al " + toks[2] + "-"+ toks[1] + "-" + toks[0] + "\n\n" +
"Total ventas del día (B): "
//+ Constants.df.format(ConnectionDrivers.getTotalDeclared(myDay) * (Shared.getIva() + 100.0) / 100.0)
+ total
+ " Bs" + "\n\nFondos de Caja (A)").setStyle(Templates.bold12CenteredStyle));
TextColumnBuilder tcb = col.column("Monto", "2", type.bigDecimalType());
report.addColumn(col.column("Caja", "0", type.stringType()));
report.addColumn(col.column("Fecha", "1", type.stringType()));
report.addColumn(tcb);
/*} catch (SQLException ex) {
Logger.getLogger(CreateClosingDayReport.class.getName()).log(Level.SEVERE, null, ex);
}*/
}else if ( masterRowNumber == 2 ){
report.title(cmp.text("Gastos (C)").setStyle(Templates.bold12CenteredStyle));
TextColumnBuilder tcb = col.column("Monto", "2", type.bigDecimalType());
report.addColumn(col.column("Tipo de Gasto", "0", type.stringType()));
report.addColumn(col.column("Observaciones", "1", type.stringType()));
report.addColumn(tcb);
report.subtotalsAtSummary((AggregationSubtotalBuilder<BigDecimal>)sbt.sum(tcb).setLabel("Total Egresos"));
} else if ( masterRowNumber == 3 ){
report.title(cmp.text("Depositos (D)").setStyle(Templates.bold12CenteredStyle));
TextColumnBuilder tcb = col.column("Monto", "3", type.bigDecimalType());
report.addColumn(col.column("Tipo de Ingreso", "0", type.stringType()));
report.addColumn(col.column("Nombre del Banco", "1", type.stringType()));
report.addColumn(col.column("Lote", "2", type.stringType()));
report.addColumn(tcb);
report.subtotalsAtSummary((AggregationSubtotalBuilder<BigDecimal>)sbt.sum(tcb).setLabel("Total Ingresos"));
} else if ( masterRowNumber == 4 ) {
try {
Double receiptTotal = ConnectionDrivers.getSumTotalWithIva(myDay,"factura","Facturada", true , null) - ConnectionDrivers.getSumTotalWithIva(myDay,"nota_de_credito","Nota",false, null);
Double income = ConnectionDrivers.getTotalIncomming(myDay);
System.out.println(income);
Double amc = ConnectionDrivers.getTotalAMinusC(myDay);
/*System.out.println(ConnectionDrivers.getTotalDeclared(myDay) * (Shared.getIva() + 100.0) / 100.0);
System.out.println(ConnectionDrivers.getTotalPrinters(myDay));*/
report.title(cmp.text(
Shared.formatIt("Cuadre de Cajas (B-D):",Shared.df.format(Shared.round(total-income,2))) + "\n" +
Shared.formatIt("Cuadre de Cajas del Día (A+B-C-D): ",Shared.df.format(total-income+amc)) + "\n"
+ Shared.formatIt("Diff entre Impresoras Fiscales y Sistema (B-E) ", Shared.df.format(total - ConnectionDrivers.getTotalPrinters(myDay)))+
"\n\nObservaciones: Cantidad de Notas de Créditos: " +
ConnectionDrivers.getQuantCN(myDay) + " Monto: " +
Shared.df.format((ConnectionDrivers.getTotalCN(myDay) *(Shared.getIva()+100.0)/100.0))
+ "\n" + note
+ "\nImpresoras Fiscales (E)").setStyle(Templates.bold12CenteredStyle));
TextColumnBuilder tcb = col.column("Monto", "2", type.bigDecimalType());
report.addColumn(col.column("Maquina Fiscal Nro", "0", type.stringType()));
report.addColumn(col.column("Numero Z", "1", type.stringType()));
report.addColumn(tcb);
report.subtotalsAtSummary((AggregationSubtotalBuilder<BigDecimal>) sbt.sum(tcb).setLabel("Total Ingresos"));
} catch (SQLException ex) {