use of org.kuali.kfs.sys.document.validation.event.AttributedSaveDocumentEvent in project cu-kfs by CU-CommunityApps.
the class ContractsGrantsInvoiceDocumentValidation method hasTemplate.
private boolean hasTemplate(AttributedDocumentEvent event) {
InvoiceGeneralDetail invoiceGeneralDetail = contractsGrantsInvoiceDocument.getInvoiceGeneralDetail();
if (StringUtils.isBlank(invoiceGeneralDetail.getCustomerInvoiceTemplateCode())) {
if (event instanceof AttributedSaveDocumentEvent) {
GlobalVariables.getMessageMap().putWarning("document.invoiceGeneralDetail.customerInvoiceTemplateCode", ArKeyConstants.ContractsGrantsInvoiceConstants.ERROR_TEMPLATE_REQUIRED);
} else {
GlobalVariables.getMessageMap().putError("document.invoiceGeneralDetail.customerInvoiceTemplateCode", ArKeyConstants.ContractsGrantsInvoiceConstants.ERROR_TEMPLATE_REQUIRED);
GlobalVariables.getMessageMap().getWarningMessages().remove("document.invoiceGeneralDetail.customerInvoiceTemplateCode");
return false;
}
}
return true;
}
Aggregations