use of org.kuali.kfs.vnd.document.service.VendorService in project cu-kfs by CU-CommunityApps.
the class VendorDetailInquiryPresentationController method getConditionallyHiddenPropertyNames.
/**
* Implement this method to hide fields based on specific data in the record being inquired into
*
* @return Set of property names that should be hidden
*/
@Override
public Set<String> getConditionallyHiddenPropertyNames(BusinessObject businessObject) {
Set<String> retVal = new HashSet<String>();
IdentityManagementService idService = SpringContext.getBean(IdentityManagementService.class);
UserSession uSession = GlobalVariables.getUserSession();
Map<String, String> permissionDetails = new HashMap<String, String>();
permissionDetails.put(KewApiConstants.DOCUMENT_TYPE_NAME_DETAIL, "PVEN");
boolean canViewAttachments = idService.isAuthorizedByTemplateName(uSession.getPrincipalId(), KRADConstants.KNS_NAMESPACE, KimConstants.PermissionTemplateNames.VIEW_NOTE_ATTACHMENT, permissionDetails, null);
if (!canViewAttachments) {
VendorDetail detail = (VendorDetail) businessObject;
VendorService vendorService = SpringContext.getBean(VendorService.class);
List<Note> boNotes = vendorService.getVendorNotes(detail);
for (int i = 0; i < boNotes.size(); i++) retVal.add("boNotes[" + i + "].attachmentLink");
}
return retVal;
}
use of org.kuali.kfs.vnd.document.service.VendorService in project cu-kfs by CU-CommunityApps.
the class PurchaseOrderDocument method isVendorEmployeeOrNonResidentAlien.
protected boolean isVendorEmployeeOrNonResidentAlien() {
if (ObjectUtils.isNull(this.getVendorHeaderGeneratedIdentifier())) {
// no vendor header id so can't check for proper tax routing
return false;
}
String vendorHeaderGeneratedId = this.getVendorHeaderGeneratedIdentifier().toString();
VendorService vendorService = SpringContext.getBean(VendorService.class);
boolean routeDocumentAsEmployeeVendor = vendorService.isVendorInstitutionEmployee(Integer.valueOf(vendorHeaderGeneratedId));
boolean routeDocumentAsForeignVendor = vendorService.isVendorForeign(Integer.valueOf(vendorHeaderGeneratedId));
if ((!routeDocumentAsEmployeeVendor) && (!routeDocumentAsForeignVendor)) {
// no need to route
return false;
}
return true;
}
use of org.kuali.kfs.vnd.document.service.VendorService in project cu-kfs by CU-CommunityApps.
the class PurchasingAccountsPayableDocumentBase method buildDocumentTitle.
/**
* build document title based on the properties of current document
*
* @param the default document title
* @return the combine information of the given title and additional payment indicators
*/
protected String buildDocumentTitle(String title) {
if (this.getVendorDetail() == null) {
return title;
}
Integer vendorHeaderGeneratedIdentifier = this.getVendorDetail().getVendorHeaderGeneratedIdentifier();
VendorService vendorService = SpringContext.getBean(VendorService.class);
Object[] indicators = new String[2];
boolean isEmployeeVendor = vendorService.isVendorInstitutionEmployee(vendorHeaderGeneratedIdentifier);
indicators[0] = isEmployeeVendor ? AdHocPaymentIndicator.EMPLOYEE_VENDOR : AdHocPaymentIndicator.OTHER;
boolean isVendorForeign = vendorService.isVendorForeign(vendorHeaderGeneratedIdentifier);
indicators[1] = isVendorForeign ? AdHocPaymentIndicator.ALIEN_VENDOR : AdHocPaymentIndicator.OTHER;
for (Object indicator : indicators) {
if (!AdHocPaymentIndicator.OTHER.equals(indicator)) {
String titlePattern = title + " [{0}:{1}]";
return MessageFormat.format(titlePattern, indicators);
}
}
return title;
}
Aggregations