Search in sources :

Example 1 with AttributedSaveDocumentEvent

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;
}
Also used : AttributedSaveDocumentEvent(org.kuali.kfs.sys.document.validation.event.AttributedSaveDocumentEvent) InvoiceGeneralDetail(org.kuali.kfs.module.ar.businessobject.InvoiceGeneralDetail)

Aggregations

InvoiceGeneralDetail (org.kuali.kfs.module.ar.businessobject.InvoiceGeneralDetail)1 AttributedSaveDocumentEvent (org.kuali.kfs.sys.document.validation.event.AttributedSaveDocumentEvent)1