use of org.kuali.kfs.krad.bo.Note in project cu-kfs by CU-CommunityApps.
the class CuCreditMemoServiceImpl method addHoldOnCreditMemo.
@Override
public VendorCreditMemoDocument addHoldOnCreditMemo(VendorCreditMemoDocument cmDocument, String note) throws Exception {
// save the note
Note noteObj = documentService.createNoteFromDocument(cmDocument, note);
cmDocument.addNote(noteObj);
noteService.save(noteObj);
// retrieve and save with hold indicator set to true
VendorCreditMemoDocument cmDoc = getCreditMemoDocumentById(cmDocument.getPurapDocumentIdentifier());
cmDoc.setHoldIndicator(true);
cmDoc.setLastActionPerformedByPersonId(GlobalVariables.getUserSession().getPerson().getPrincipalId());
purapService.saveDocumentNoValidation(cmDoc);
// force reindexing
reIndexDocument(cmDoc);
// must also save it on the incoming document
cmDocument.setHoldIndicator(true);
cmDocument.setLastActionPerformedByPersonId(GlobalVariables.getUserSession().getPerson().getPrincipalId());
// force reindexing
reIndexDocument(cmDocument);
return cmDoc;
}
use of org.kuali.kfs.krad.bo.Note in project cu-kfs by CU-CommunityApps.
the class CuPaymentRequestServiceImpl method requestCancelOnPaymentRequest.
@Override
@NonTransactional
public void requestCancelOnPaymentRequest(PaymentRequestDocument document, String note) throws Exception {
// save the note
Note noteObj = documentService.createNoteFromDocument(document, note);
document.addNote(noteObj);
noteService.save(noteObj);
document.setPaymentRequestedCancelIndicator(true);
document.setLastActionPerformedByPersonId(GlobalVariables.getUserSession().getPerson().getPrincipalId());
document.setAccountsPayableRequestCancelIdentifier(GlobalVariables.getUserSession().getPerson().getPrincipalId());
purapService.saveDocumentNoValidation(document);
// force reindexing
reIndexDocument(document);
}
use of org.kuali.kfs.krad.bo.Note in project cu-kfs by CU-CommunityApps.
the class CuPaymentRequestServiceImpl method removeHoldOnPaymentRequest.
/**
* @see org.kuali.kfs.module.purap.document.service.PaymentRequestService#removeHoldOnPaymentRequest(org.kuali.kfs.module.purap.document.PaymentRequestDocument)
*/
@Override
@NonTransactional
public PaymentRequestDocument removeHoldOnPaymentRequest(PaymentRequestDocument document, String note) throws Exception {
// save the note
Note noteObj = documentService.createNoteFromDocument(document, note);
document.addNote(noteObj);
noteService.save(noteObj);
document.setHoldIndicator(false);
document.setLastActionPerformedByPersonId(null);
purapService.saveDocumentNoValidation(document);
// force reindexing
reIndexDocument(document);
return document;
}
use of org.kuali.kfs.krad.bo.Note in project cu-kfs by CU-CommunityApps.
the class CuPurchaseOrderServiceImpl method completeB2BPurchaseOrderAmendment.
protected boolean completeB2BPurchaseOrderAmendment(PurchaseOrderDocument poa) {
String errors = b2bPurchaseOrderService.sendPurchaseOrder(poa);
if (StringUtils.isEmpty(errors)) {
// POA sent successfully; change status to OPEN
LOG.info("Setting poa document id " + poa.getDocumentNumber() + " status from '" + poa.getApplicationDocumentStatus() + "' to '" + PurchaseOrderStatuses.APPDOC_OPEN + "'");
// purapService.updateStatus(poa, PurchaseOrderStatuses.OPEN);
poa.setPurchaseOrderLastTransmitTimestamp(dateTimeService.getCurrentTimestamp());
return true;
} else {
// POA transmission failed; record errors and change status to "cxml failed"
try {
Note note = documentService.createNoteFromDocument(poa, "Unable to transmit the PO for the following reasons:\n" + errors);
poa.addNote(note);
} catch (Exception e) {
throw new RuntimeException(e);
}
// purapService.updateStatus(poa, PurchaseOrderStatuses.CXML_ERROR);
return false;
}
}
use of org.kuali.kfs.krad.bo.Note in project cu-kfs by CU-CommunityApps.
the class CuPurchaseOrderServiceImpl method getPurchaseOrderNotes.
// mjmc end
/**
* Overridden to use the PO's note target object ID to retrieve the notes, instead of always using the doc header as the target.
*
* @see org.kuali.kfs.module.purap.document.service.impl.PurchaseOrderServiceImpl#getPurchaseOrderNotes(java.lang.Integer)
*/
@Override
public List<Note> getPurchaseOrderNotes(Integer id) {
List<Note> notes = new ArrayList<>();
PurchaseOrderDocument po = getPurchaseOrderByDocumentNumber(purchaseOrderDao.getOldestPurchaseOrderDocumentNumber(id));
if (ObjectUtils.isNotNull(po)) {
// ==== CU Customization: Use the PO's actual note target instead of assuming that the doc header is the target. ====
notes = noteService.getByRemoteObjectId(po.getNoteTarget().getObjectId());
}
return notes;
}
Aggregations