use of com.autentia.tnt.businessobject.Collaborator in project TNTConcept by autentia.
the class CommissioningBean method getAllCollaborators.
public List<SelectItem> getAllCollaborators() {
final List<Collaborator> refs = CollaboratorManager.getDefault().getAllEntities(null, new SortCriteria("insertDate"));
final List<SelectItem> ret = new ArrayList<SelectItem>();
for (Collaborator ref : refs) {
ret.add(new SelectItem(ref, ref.getName()));
}
return ret;
}
use of com.autentia.tnt.businessobject.Collaborator in project TNTConcept by autentia.
the class CommissioningBean method addCollaborator.
public String addCollaborator() {
final Collaborator collab = getSelectedCollaborator();
try {
if (!commissioning.getCollaboratorsPaymentData().contains(collab)) {
CommissioningPaymentData newCollab = new CommissioningPaymentData();
newCollab.setCollaborator(collab);
newCollab.setCommissioning(commissioning);
newCollab.setPaymentMode(BillPaymentMode.UNKNOWN);
newCollab.setBillNumber("");
newCollab.setBankAccount("");
commissioning.getCollaboratorsPaymentData().add(newCollab);
// Add to history if commissioning is in a valid STATUS
if (commissioning.getStatus() == CommissioningStatus.CONFIRMED || commissioning.getStatus() == CommissioningStatus.VALIDATED) {
commissioning.getHistory().add(manager.getChange("commissioning.collaborator.add", "", newCollab.getCollaborator().getName(), commissioning));
}
}
} catch (Exception e) {
log.info(e.getCause());
}
return NavigationResults.EDIT;
}
Aggregations