use of org.kuali.kfs.krad.rules.rule.event.ApproveDocumentEvent in project cu-kfs by CU-CommunityApps.
the class PurchasingDocumentBase method prepareForSave.
/**
* Overrides the method in PurchasingAccountsPayableDocumentBase to remove the
* purchasingCapitalAssetSystem when the system type is either ONE or MULT.
*/
@Override
public void prepareForSave(KualiDocumentEvent event) {
super.prepareForSave(event);
if (StringUtils.isNotBlank(this.getCapitalAssetSystemTypeCode())) {
if (this.getCapitalAssetSystemTypeCode().equals(PurapConstants.CapitalAssetSystemTypes.ONE_SYSTEM) || this.getCapitalAssetSystemTypeCode().equals(PurapConstants.CapitalAssetSystemTypes.MULTIPLE)) {
// If the system state is ONE or MULT, we have to remove all the systems on the items because it's not applicable.
for (PurchasingCapitalAssetItem camsItem : this.getPurchasingCapitalAssetItems()) {
camsItem.setPurchasingCapitalAssetSystem(null);
}
}
}
if (event instanceof RouteDocumentEvent || event instanceof ApproveDocumentEvent) {
boolean defaultUseTaxIndicatorValue = SpringContext.getBean(PurchasingService.class).getDefaultUseTaxIndicatorValue(this);
SpringContext.getBean(PurapService.class).updateUseTaxIndicator(this, defaultUseTaxIndicatorValue);
}
// KFSUPGRADE-583
checkForFederalAccount();
}
Aggregations