use of edu.cornell.kfs.module.purap.document.service.CuPaymentRequestService in project cu-kfs by CU-CommunityApps.
the class PaymentRequestView method getNotes.
/**
* @see org.kuali.kfs.module.purap.businessobject.AbstractRelatedView#getNotes()j
* This is overriden to prevent duplicate fetching of the object id needed to fetch notes
* which becomes a problem when you have a lot of associated payment requests with a
* given purchase order
*/
@Override
public List<Note> getNotes() {
List<Note> notes = new ArrayList<Note>();
// reverse the order of notes only when anything exists in it..
NoteService noteService = SpringContext.getBean(NoteService.class);
// ==== CU Customization: Use a CU-specific PREQ service method to get the note target object ID, instead of always using the doc header one. ====
CuPaymentRequestService cuPaymentRequestService = SpringContext.getBean(CuPaymentRequestService.class);
List<Note> tmpNotes = noteService.getByRemoteObjectId(cuPaymentRequestService.getPaymentRequestNoteTargetObjectId(getDocumentNumber()));
notes.clear();
// reverse the order of notes retrieved so that newest note is in the front
for (int i = tmpNotes.size() - 1; i >= 0; i--) {
Note note = tmpNotes.get(i);
notes.add(note);
}
return notes;
}
Aggregations