Search in sources :

Example 16 with SortCriteria

use of com.autentia.tnt.dao.SortCriteria in project TNTConcept by autentia.

the class BillBean method getRectifiedBillCategory.

public List<SelectItem> getRectifiedBillCategory() {
    ArrayList<SelectItem> ret = new ArrayList<>();
    List<RectifiedBillCategory> refs = RectifiedBillCategoryManager.getDefault().getAllEntities(new SortCriteria("id"));
    for (RectifiedBillCategory ref : refs) {
        ret.add(new SelectItem(ref, ref.getCode() + " - " + ref.getName()));
    }
    return ret;
}
Also used : SortCriteria(com.autentia.tnt.dao.SortCriteria) SelectItem(javax.faces.model.SelectItem) ArrayList(java.util.ArrayList)

Example 17 with SortCriteria

use of com.autentia.tnt.dao.SortCriteria in project TNTConcept by autentia.

the class BillBean method getIVAType.

public List<SelectItem> getIVAType() {
    ArrayList<SelectItem> ret = new ArrayList<>();
    List<IVAType> refs = IVATypeManager.getDefault().getAllEntities(new SortCriteria("id"));
    for (IVAType ref : refs) {
        ret.add(new SelectItem(ref.getIva(), ref.getIva().toString() + " - " + ref.getName()));
    }
    return ret;
}
Also used : SortCriteria(com.autentia.tnt.dao.SortCriteria) SelectItem(javax.faces.model.SelectItem) ArrayList(java.util.ArrayList)

Example 18 with SortCriteria

use of com.autentia.tnt.dao.SortCriteria in project TNTConcept by autentia.

the class NOFBean method getAllNOFIssuedCreditTitle.

/**
 * Recover a list of issued credit titles that has to be paid in the period
 */
public List<GenericNOF> getAllNOFIssuedCreditTitle() {
    int years = ConfigurationUtil.getDefault().getYearsBackSearchNotPaidBillsNOF();
    creditTitleSearch.setCreditTitleType(CreditTitleType.ISSUED);
    creditTitleSearch.setCreditTitleState(CreditTitleState.EMITTED);
    creditTitleSearch.setStartExpirationDate(calculateStartEndByPassedYear(years));
    List<CreditTitle> creditTitles = creditTitleManager.getAllEntities(creditTitleSearch, new SortCriteria("issueDate", true), new GregorianCalendar(1900, 1, 1).getTime(), getEndDate());
    return convertFromCreditTitleToGenericNOF(creditTitles);
}
Also used : SortCriteria(com.autentia.tnt.dao.SortCriteria) GregorianCalendar(java.util.GregorianCalendar) CreditTitle(com.autentia.tnt.businessobject.CreditTitle)

Example 19 with SortCriteria

use of com.autentia.tnt.dao.SortCriteria in project TNTConcept by autentia.

the class NOFBean method getAllNOFReceivedBills.

public List<GenericNOF> getAllNOFReceivedBills() {
    /**
     ** Facturas emitidas impagadas que vencen en el periodo ***
     */
    /**
     ** Facturas emitidas impagadas ya vencidas ***
     */
    /**
     ** Facturas recibidas impagadas que vencen en el periodo ***
     */
    /**
     ** Facturas recibidas impagadas ya vencidas ***
     */
    int years = ConfigurationUtil.getDefault().getYearsBackSearchNotPaidBillsNOF();
    List<BillType> billTypes = new ArrayList<BillType>();
    billTypes.add(BillType.RECIEVED);
    billSearch.setBillTypes(billTypes);
    billSearch.setState(BillState.EMITTED);
    billSearch.setStartEndBillDate(calculateStartEndByPassedYear(years));
    List<Bill> total = billManager.getAllEntities(billSearch, new SortCriteria("creationDate", true), new GregorianCalendar(1900, 1, 1).getTime(), getEndDate());
    return convertFromBillToGenericNOF(total);
}
Also used : BillType(com.autentia.tnt.businessobject.BillType) SortCriteria(com.autentia.tnt.dao.SortCriteria) ArrayList(java.util.ArrayList) Bill(com.autentia.tnt.businessobject.Bill) GregorianCalendar(java.util.GregorianCalendar)

Example 20 with SortCriteria

use of com.autentia.tnt.dao.SortCriteria in project TNTConcept by autentia.

the class PeriodicalAccountEntryBean method getOrganizations.

/**
 * Get the list of all organizations
 * @return the list of all organizations
 */
public List<SelectItem> getOrganizations() {
    ArrayList<SelectItem> ret = new ArrayList<SelectItem>();
    List<Organization> refs = OrganizationManager.getDefault().getAllEntities(null, new SortCriteria("name"));
    ret.add(new SelectItem(null, FacesUtils.formatMessage("organization.unknown")));
    for (Organization ref : refs) {
        ret.add(new SelectItem(ref, ref.getName()));
    }
    return ret;
}
Also used : SortCriteria(com.autentia.tnt.dao.SortCriteria) Organization(com.autentia.tnt.businessobject.Organization) SelectItem(javax.faces.model.SelectItem) ArrayList(java.util.ArrayList)

Aggregations

SortCriteria (com.autentia.tnt.dao.SortCriteria)136 ArrayList (java.util.ArrayList)114 SelectItem (javax.faces.model.SelectItem)107 Organization (com.autentia.tnt.businessobject.Organization)15 User (com.autentia.tnt.businessobject.User)15 Department (com.autentia.tnt.businessobject.Department)9 Project (com.autentia.tnt.businessobject.Project)9 Position (com.autentia.tnt.businessobject.Position)7 Calendar (java.util.Calendar)7 GregorianCalendar (java.util.GregorianCalendar)7 Activity (com.autentia.tnt.businessobject.Activity)6 ProjectRole (com.autentia.tnt.businessobject.ProjectRole)6 ActivitySearch (com.autentia.tnt.dao.search.ActivitySearch)6 PositionSearch (com.autentia.tnt.dao.search.PositionSearch)6 Account (com.autentia.tnt.businessobject.Account)5 Contact (com.autentia.tnt.businessobject.Contact)5 Bill (com.autentia.tnt.businessobject.Bill)4 Inventary (com.autentia.tnt.businessobject.Inventary)4 AccountEntryType (com.autentia.tnt.businessobject.AccountEntryType)3 ExternalActivity (com.autentia.tnt.businessobject.ExternalActivity)3