final int nTickets = getTicketIds().size();
Log.out.debug(String.valueOf(nTickets)+" tickets found");
Log.out.debug(String.valueOf(getBillers().size())+" billers found");
for (int t=0; t<nTickets; t++) {
Log.out.debug("Updating Ticket "+getTicketIds().get(t));
Ticket oTck = new Ticket(oDms, getTicketIds().get(t));
if (getTicketNumbers().size()>t)
if (getTicketNumbers().get(t)==null)
oTck.remove("ticket_number");
else
oTck.put("ticket_number", getTicketNumbers().get(t));
else
oTck.remove("ticket_number");
if (getAccounts().get(t).length()==0) {
oTck.remove("accounting_uuid");
oTck.remove("accounting_code");
oTck.remove("accounting_desc");
} else {
AccountingAccount oAcc = new AccountingAccount(oDms,getAccounts().get(t));
oTck.put("accounting_uuid", oAcc.getUuid());
oTck.put("accounting_code", oAcc.getCode());
oTck.put("accounting_desc", oAcc.getDescription());
}
if (getBillers().size()>t) {
Log.out.debug("Ticket biller is "+getBillers().get(t));
if (getBillers().get(t)!=null)
if (getBillers().get(t).id()!=null)
oTck.setBillerTaxPayer(getBillers().get(t).id());
else
oTck.setBillerTaxPayer("");
else
oTck.setBillerTaxPayer("");
} else {
oTck.setBillerTaxPayer("");
}
Log.out.debug("Ticket base amount "+getBaseAmounts().get(t));
if (getBaseAmounts().get(t)!=null)
oTck.setBaseAmount(getBaseAmounts().get(t));
if (getTotalAmounts().get(t)!=null)
oTck.setTotalAmount(getTotalAmounts().get(t));
if (getVats().get(t)!=null)
oTck.setVat(getVats().get(t));
if (getVatPcts().get(t)!=null)
oTck.setVatPct(getVatPcts().get(t));
if (bSettle) {
oTck.isOpen(false);
oTck.isProcessed(true);
}
oTck.save(getSession());
}
Log.out.debug("Updating Bill Note");
BillNote oBln = new BillNote(oDms, getId());
oBln.setProcessDate(new Date());
if (bSettle) {