use of edu.cornell.kfs.pmw.batch.businessobject.PaymentWorksVendor in project cu-kfs by CU-CommunityApps.
the class PaymentWorksBatchUtilityServiceImpl method registerKfsPvenApprovalForKfsEnteredVendor.
@Override
public void registerKfsPvenApprovalForKfsEnteredVendor(String kfsVendorDocumentNumber, VendorDetail vendorDetail) {
if (isDomesticVendor(vendorDetail) && isDisbursementVoucherVendor(vendorDetail)) {
PaymentWorksVendor pmwVendor = populateKfsEnteredPaymentWorksVendor(kfsVendorDocumentNumber, vendorDetail, PaymentWorksConstants.KFSVendorProcessingStatus.VENDOR_APPROVED);
LOG.info("registerKfsPvenApprovalForKfsEnteredVendor: Approving KFS originating vendor '" + vendorDetail.getVendorHeaderGeneratedIdentifier() + "-" + vendorDetail.getVendorDetailAssignedIdentifier() + "' with kfsVendorDocumentNumber '" + kfsVendorDocumentNumber + "'");
PaymentWorksVendor savedPmwVendor = getBusinessObjectService().save(pmwVendor);
} else {
LOG.error("registerKfsPvenApprovalForKfsEnteredVendor: Vendor '" + vendorDetail.getVendorHeaderGeneratedIdentifier() + "-" + vendorDetail.getVendorDetailAssignedIdentifier() + "' with KFS document number '" + kfsVendorDocumentNumber + "' was not inserted into PaymentWorks table because of either it's KFS vendorCorpCitizenCode being '" + vendorDetail.getVendorHeader().getVendorCorpCitizenCode() + "' or its KFS vendorTypeCode being '" + vendorDetail.getVendorHeader().getVendorTypeCode() + "'.");
}
}
use of edu.cornell.kfs.pmw.batch.businessobject.PaymentWorksVendor in project cu-kfs by CU-CommunityApps.
the class PaymentWorksDtoToPaymentWorksVendorConversionServiceImpl method createPaymentWorksVendorFromPaymentWorksNewVendorRequestDetailDTO.
@Override
public PaymentWorksVendor createPaymentWorksVendorFromPaymentWorksNewVendorRequestDetailDTO(PaymentWorksNewVendorRequestDetailDTO pmwNewVendorRequestDetailDTO, PaymentWorksNewVendorRequestsBatchReportData reportData) {
PaymentWorksVendor stgVendor = new PaymentWorksVendor();
if (newVendorDetailExists(pmwNewVendorRequestDetailDTO)) {
stgVendor.setPmwVendorRequestId(pmwNewVendorRequestDetailDTO.getId());
populateNewVendorRequestingCompanyAttributes(stgVendor, pmwNewVendorRequestDetailDTO);
extractCustomFields(stgVendor, pmwNewVendorRequestDetailDTO, reportData);
} else {
reportData.getPendingPaymentWorksVendorsThatCouldNotBeProcessed().incrementRecordCount();
reportData.addPmwVendorsThatCouldNotBeProcessed(new PaymentWorksBatchReportRawDataItem(pmwNewVendorRequestDetailDTO.toString(), MessageFormat.format(getConfigurationService().getPropertyValueAsString(PaymentWorksKeyConstants.NEW_VENDOR_DETAIL_WAS_NOT_FOUND_ERROR_MESSAGE), pmwNewVendorRequestDetailDTO.getId())));
}
return stgVendor;
}
use of edu.cornell.kfs.pmw.batch.businessobject.PaymentWorksVendor in project cu-kfs by CU-CommunityApps.
the class PaymentWorksNewVendorRequestsServiceImpl method pmwPendingNewVendorRequestInitialSaveToKfsStagingTable.
private PaymentWorksVendor pmwPendingNewVendorRequestInitialSaveToKfsStagingTable(PaymentWorksVendor pmwVendor) {
LOG.info("pmwPendingNewVendorRequestSavesToKfsStagingTableSuccessful: entered");
pmwVendor = setStatusValuesForPaymentWorksPendingNewVendorRequestedInKfs(pmwVendor);
PaymentWorksVendor savedNewVendorRequestedDetail = null;
savedNewVendorRequestedDetail = savePaymentWorksVendorToStagingTable(pmwVendor);
return savedNewVendorRequestedDetail;
}
use of edu.cornell.kfs.pmw.batch.businessobject.PaymentWorksVendor in project cu-kfs by CU-CommunityApps.
the class PaymentWorksNewVendorRequestsServiceImpl method processEachPaymentWorksNewVendorRequestIntoKFS.
private void processEachPaymentWorksNewVendorRequestIntoKFS(List<String> identifiersForPendingNewVendorsToProcess) {
PaymentWorksNewVendorRequestsBatchReportData reportData = new PaymentWorksNewVendorRequestsBatchReportData();
reportData.getPendingNewVendorsFoundInPmw().setRecordCount(identifiersForPendingNewVendorsToProcess.size());
for (String pmwNewVendorRequestId : identifiersForPendingNewVendorsToProcess) {
LOG.info("processEachPaymentWorksNewVendorRequestIntoKFS: Processing started for PMW-vendor-id=" + pmwNewVendorRequestId);
PaymentWorksVendor stgNewVendorRequestDetailToProcess = getPaymentWorksWebServiceCallsService().obtainPmwNewVendorRequestDetailForPmwIdentifier(pmwNewVendorRequestId, reportData);
if (canPaymentWorksNewVendorRequestProcessingContinueForVendor(stgNewVendorRequestDetailToProcess, reportData)) {
PaymentWorksVendor savedStgNewVendorRequestDetailToProcess = pmwPendingNewVendorRequestInitialSaveToKfsStagingTable(stgNewVendorRequestDetailToProcess);
if (pmwNewVendorSaveToStagingTableWasSuccessful(savedStgNewVendorRequestDetailToProcess, reportData)) {
if (pmwNewVendorRequestProcessingIntoKfsWasSuccessful(savedStgNewVendorRequestDetailToProcess, reportData)) {
getPaymentWorksWebServiceCallsService().sendApprovedStatusToPaymentWorksForNewVendor(savedStgNewVendorRequestDetailToProcess.getPmwVendorRequestId());
} else {
getPaymentWorksWebServiceCallsService().sendRejectedStatusToPaymentWorksForNewVendor(savedStgNewVendorRequestDetailToProcess.getPmwVendorRequestId());
}
} else {
// save of pmw data to staging table failed for some reason, cannot process or track request
getPaymentWorksWebServiceCallsService().sendRejectedStatusToPaymentWorksForNewVendor(savedStgNewVendorRequestDetailToProcess.getPmwVendorRequestId());
}
} else {
// either duplicate request or data issue exists preventing save to staging table
getPaymentWorksWebServiceCallsService().sendRejectedStatusToPaymentWorksForNewVendor(stgNewVendorRequestDetailToProcess.getPmwVendorRequestId());
}
}
getPaymentWorksNewVendorRequestsReportService().generateAndEmailProcessingReport(reportData);
}
use of edu.cornell.kfs.pmw.batch.businessobject.PaymentWorksVendor in project cu-kfs by CU-CommunityApps.
the class PaymentWorksWebServiceCallsServiceImpl method obtainPmwNewVendorRequestDetailForPmwIdentifier.
@Override
public PaymentWorksVendor obtainPmwNewVendorRequestDetailForPmwIdentifier(String pmwNewVendorRequestId, PaymentWorksNewVendorRequestsBatchReportData reportData) {
PaymentWorksNewVendorRequestDetailDTO pmwDetailForSpecificVendorDTO = retrieveAllPaymentWorksDetailsForRequestedVendor(buildPaymentWorksPendingNewVendorRequestDetailURI(pmwNewVendorRequestId));
PaymentWorksVendor pmwDetailForSpecificVendor = getPaymentWorksDtoToPaymentWorksVendorConversionService().createPaymentWorksVendorFromPaymentWorksNewVendorRequestDetailDTO(pmwDetailForSpecificVendorDTO, reportData);
return pmwDetailForSpecificVendor;
}
Aggregations