DocumentIndexer oIdx = getSession().getDocumentIndexer();
oIdx.setMaximumNumberOfDocumentReturned(iMaxRows);
if (sBillNote.length()>0) {
aLst = new QueryResultSet<Ticket>();
aLst.addAll(new BillNote(oDms, sBillNote).tickets(getSession()));
} else if (sEmployee.length()>0) {
Employee oEmpl = new TaxPayer(oDms, sTaxPayer).employees(getSession()).seek(getSession(), sEmployee);
if (null!=oEmpl)
aLst = oEmpl.queryTickets(getSession(), bProcessed, bHasMistakes, bOnlyOpen, aAmountRange, aMonthsRange, aYearsRange, sBiller, sSearchStr, iMaxRows, iOffset);
else
aLst = new QueryResultSet<Ticket>();
} else {
aLst = new TaxPayer(oDms, sTaxPayer).queryTickets(getSession(), bProcessed, bHasMistakes, bOnlyOpen, aAmountRange, aMonthsRange, aYearsRange, sBiller, sConcept, sSearchStr, iMaxRows, iOffset);
}
for (Ticket i : aLst) {
if (!i.isNull("biller_taxpayer")) {
if (!oCompanies.containsKey(i.getString("biller_taxpayer")))
oCompanies.put(i.getBillerTaxPayer(), i.biller(getSession()));
}
if (!i.isNull("taxpayer")) {
if (!oCompanies.containsKey(i.getString("taxpayer")))
oCompanies.put(i.getTaxPayer(), i.taxPayer(oDms));
}
if (i.getStringNull("employee_uuid","").length()>0) {
if (!oEmployees.containsKey(i.getString("employee_uuid")))
oEmployees.put(i.getString("employee_uuid"), i.employee(getSession()));
}
if (!oBillNotes.containsKey(i.parentId())) {
oBillNotes.put(i.parentId(), new BillNote(oDms,i.parentId()));
}
}
disconnect();
} catch (Exception xcpt) {
Log.out.error("QueryTickets "+sNickN+" "+xcpt.getClass()+" "+xcpt.getMessage());