Search in sources :

Example 1 with PaymentWorksVendor

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() + "'.");
    }
}
Also used : PaymentWorksVendor(edu.cornell.kfs.pmw.batch.businessobject.PaymentWorksVendor)

Example 2 with PaymentWorksVendor

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;
}
Also used : PaymentWorksVendor(edu.cornell.kfs.pmw.batch.businessobject.PaymentWorksVendor) PaymentWorksBatchReportRawDataItem(edu.cornell.kfs.pmw.batch.report.PaymentWorksBatchReportRawDataItem)

Example 3 with PaymentWorksVendor

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;
}
Also used : PaymentWorksVendor(edu.cornell.kfs.pmw.batch.businessobject.PaymentWorksVendor)

Example 4 with PaymentWorksVendor

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);
}
Also used : PaymentWorksVendor(edu.cornell.kfs.pmw.batch.businessobject.PaymentWorksVendor) PaymentWorksNewVendorRequestsBatchReportData(edu.cornell.kfs.pmw.batch.report.PaymentWorksNewVendorRequestsBatchReportData)

Example 5 with PaymentWorksVendor

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;
}
Also used : PaymentWorksVendor(edu.cornell.kfs.pmw.batch.businessobject.PaymentWorksVendor) PaymentWorksNewVendorRequestDetailDTO(edu.cornell.kfs.pmw.batch.xmlObjects.PaymentWorksNewVendorRequestDetailDTO)

Aggregations

PaymentWorksVendor (edu.cornell.kfs.pmw.batch.businessobject.PaymentWorksVendor)9 PaymentWorksBatchReportRawDataItem (edu.cornell.kfs.pmw.batch.report.PaymentWorksBatchReportRawDataItem)1 PaymentWorksNewVendorRequestsBatchReportData (edu.cornell.kfs.pmw.batch.report.PaymentWorksNewVendorRequestsBatchReportData)1 PaymentWorksNewVendorRequestDetailDTO (edu.cornell.kfs.pmw.batch.xmlObjects.PaymentWorksNewVendorRequestDetailDTO)1 HashMap (java.util.HashMap)1 Map (java.util.Map)1