private javax.swing.JButton updateButton;
// End of variables declaration//GEN-END:variables
private IXMLElement createCobranzas() {
System.out.println("[" + Shared.now() + "] " + this.getClass().getName() + " " + Shared.lineNumber() + " Creando XMl para cobranzas");
IXMLElement xml = new XMLElement("Cobranza");
// BANKS
for ( int i = 0 ; i < bankTable.getRowCount() ; i++ ){
IXMLElement child = xml.createElement("I");
xml.addChild(child);
child.setAttribute("waerks", Shared.getConfig("waerks"));
child.setAttribute("simbo", (bankTable.getValueAt(i, 0).toString().split("-")[0]).trim());
if ( bankTable.getValueAt(i, 2).equals(Shared.getConfig("creditPaymentName")) ){
child.setAttribute("mpago", "B");
}else if ( bankTable.getValueAt(i, 2).equals(Shared.getConfig("debitPaymentName")) ){
child.setAttribute("mpago", "D");
}else if ( bankTable.getValueAt(i, 2).equals(Shared.getConfig("americanExpressPaymentName")) ){
child.setAttribute("mpago", "A");
}else{
System.out.println("Banco desconocido... agregando E");
child.setAttribute("mpago", "E");
}
child.setAttribute("bpago", (bankTable.getValueAt(i, 0).toString().split("-")[0]).trim());
child.setAttribute("lote", (String)bankTable.getValueAt(i, 1));
child.setAttribute("monto", ((Double)bankTable.getValueAt(i, 4))+"");
child.setAttribute("text", "");
}
System.out.println("[" + Shared.now() + "] " + this.getClass().getName() + " " + Shared.lineNumber() + " Creando XML para gastos");
// EXPENSES
for ( int i = 0 ; i < expenseTable.getRowCount() ; i++ ){
IXMLElement child = xml.createElement("I");
xml.addChild(child);
child.setAttribute("waerks", Shared.getConfig("waerks"));
child.setAttribute("simbo", Shared.getConfig("genericBank"));
String tmp = expenseTable.getValueAt(i, 0).toString().split("-")[0];
child.setAttribute("mpago", tmp.substring(0, tmp.length() - 1));
child.setAttribute("bpago", Shared.getConfig("genericBank"));
child.setAttribute("lote", i+"");
child.setAttribute("monto", ((String)expenseTable.getValueAt(i, 1)).replace(',', '.'));
child.setAttribute("text", (String)expenseTable.getValueAt(i, 2));
}
System.out.println("[" + Shared.now() + "] " + this.getClass().getName() + " " + Shared.lineNumber() + " Creando XML para efectivo");
// CASH
for ( int i = 0 ; i < depositTable.getRowCount() ; i++ ){
IXMLElement child = xml.createElement("I");
xml.addChild(child);
child.setAttribute("waerks", Shared.getConfig("waerks"));
String bancoId = ((String)depositTable.getValueAt(i, 0)).split("-")[0].trim();
child.setAttribute("simbo", bancoId);
child.setAttribute("mpago", "E");
child.setAttribute("bpago", bancoId);
child.setAttribute("lote", ((String)depositTable.getValueAt(i, 1)));
child.setAttribute("monto", ((String)depositTable.getValueAt(i, 2)).replace(',','.'));
child.setAttribute("text", "");
}
System.out.println("[" + Shared.now() + "] " + this.getClass().getName() + " " + Shared.lineNumber() + " XML Creados satisfactoriamente");
return xml;
}