Search in sources :

Example 1 with NonTransactional

use of org.kuali.kfs.sys.service.NonTransactional in project cu-kfs by CU-CommunityApps.

the class CuPaymentRequestServiceImpl method resetExtractedPaymentRequest.

/**
 * @see org.kuali.kfs.module.purap.document.service.PaymentRequestService#resetExtractedPaymentRequest(org.kuali.kfs.module.purap.document.PaymentRequestDocument,
 *      java.lang.String)
 */
@Override
@NonTransactional
public void resetExtractedPaymentRequest(PaymentRequestDocument paymentRequest, String note) {
    LOG.debug("resetExtractedPaymentRequest() started");
    if (PaymentRequestStatuses.CANCELLED_STATUSES.contains(paymentRequest.getApplicationDocumentStatus())) {
        LOG.debug("resetExtractedPaymentRequest() ended");
        return;
    }
    paymentRequest.setExtractedTimestamp(null);
    paymentRequest.setPaymentPaidTimestamp(null);
    String noteText = "This Payment Request is being reset for extraction by PDP " + note;
    try {
        Note resetNote = documentService.createNoteFromDocument(paymentRequest, noteText);
        paymentRequest.addNote(resetNote);
        noteService.save(resetNote);
    } catch (Exception e) {
        throw new RuntimeException(PurapConstants.REQ_UNABLE_TO_CREATE_NOTE + " " + e);
    }
    purapService.saveDocumentNoValidation(paymentRequest);
    if (LOG.isDebugEnabled()) {
        LOG.debug("resetExtractedPaymentRequest() PREQ " + paymentRequest.getPurapDocumentIdentifier() + " Reset from Extracted status");
    }
    // force reindexing
    reIndexDocument(paymentRequest);
}
Also used : Note(org.kuali.kfs.krad.bo.Note) NonTransactional(org.kuali.kfs.sys.service.NonTransactional)

Example 2 with NonTransactional

use of org.kuali.kfs.sys.service.NonTransactional in project cu-kfs by CU-CommunityApps.

the class CuPaymentRequestServiceImpl method removeRequestCancelOnPaymentRequest.

/**
 * @see org.kuali.kfs.module.purap.document.service.PaymentRequestService#removeHoldOnPaymentRequest(org.kuali.kfs.module.purap.document.PaymentRequestDocument)
 */
@Override
@NonTransactional
public void removeRequestCancelOnPaymentRequest(PaymentRequestDocument document, String note) throws Exception {
    // save the note
    Note noteObj = documentService.createNoteFromDocument(document, note);
    document.addNote(noteObj);
    noteService.save(noteObj);
    clearRequestCancelFields(document);
    purapService.saveDocumentNoValidation(document);
    // force reindexing
    reIndexDocument(document);
}
Also used : Note(org.kuali.kfs.krad.bo.Note) NonTransactional(org.kuali.kfs.sys.service.NonTransactional)

Example 3 with NonTransactional

use of org.kuali.kfs.sys.service.NonTransactional in project cu-kfs by CU-CommunityApps.

the class CuPaymentRequestServiceImpl method cancelExtractedPaymentRequest.

@Override
@NonTransactional
public void cancelExtractedPaymentRequest(PaymentRequestDocument paymentRequest, String note) {
    LOG.debug("cancelExtractedPaymentRequest() started");
    if (PaymentRequestStatuses.CANCELLED_STATUSES.contains(paymentRequest.getApplicationDocumentStatus())) {
        LOG.debug("cancelExtractedPaymentRequest() ended");
        return;
    }
    try {
        Note cancelNote = documentService.createNoteFromDocument(paymentRequest, note);
        paymentRequest.addNote(cancelNote);
        noteService.save(cancelNote);
    } catch (Exception e) {
        throw new RuntimeException(PurapConstants.REQ_UNABLE_TO_CREATE_NOTE, e);
    }
    // cancel extracted should not reopen PO
    paymentRequest.setReopenPurchaseOrderIndicator(false);
    // Performs save, so
    getAccountsPayableService().cancelAccountsPayableDocument(paymentRequest, "");
    // is necessary
    if (LOG.isDebugEnabled()) {
        LOG.debug("cancelExtractedPaymentRequest() PREQ " + paymentRequest.getPurapDocumentIdentifier() + " Cancelled Without Workflow");
        LOG.debug("cancelExtractedPaymentRequest() ended");
    }
    // force reindexing
    reIndexDocument(paymentRequest);
}
Also used : Note(org.kuali.kfs.krad.bo.Note) NonTransactional(org.kuali.kfs.sys.service.NonTransactional)

Example 4 with NonTransactional

use of org.kuali.kfs.sys.service.NonTransactional in project cu-kfs by CU-CommunityApps.

the class CuPaymentRequestServiceImpl method addHoldOnPaymentRequest.

@Override
@NonTransactional
public PaymentRequestDocument addHoldOnPaymentRequest(PaymentRequestDocument document, String note) throws Exception {
    // save the note
    Note noteObj = documentService.createNoteFromDocument(document, note);
    document.addNote(noteObj);
    noteService.save(noteObj);
    document.setHoldIndicator(true);
    document.setLastActionPerformedByPersonId(GlobalVariables.getUserSession().getPerson().getPrincipalId());
    purapService.saveDocumentNoValidation(document);
    // force reindexing
    reIndexDocument(document);
    return document;
}
Also used : Note(org.kuali.kfs.krad.bo.Note) NonTransactional(org.kuali.kfs.sys.service.NonTransactional)

Example 5 with NonTransactional

use of org.kuali.kfs.sys.service.NonTransactional in project cu-kfs by CU-CommunityApps.

the class GlLineServiceImpl method createAssetGlobalDocument.

/**
 * @see GlLineService#createAssetGlobalDocument(List,
 * GeneralLedgerEntry)
 */
@Override
@NonTransactional
public Document createAssetGlobalDocument(GeneralLedgerEntry primary, Integer capitalAssetLineNumber) throws WorkflowException {
    // initiate a new document
    MaintenanceDocument document = (MaintenanceDocument) documentService.getNewDocument(DocumentTypeName.ASSET_ADD_GLOBAL);
    // create asset global
    AssetGlobal assetGlobal = createAssetGlobal(primary, document);
    assetGlobal.setCapitalAssetBuilderOriginIndicator(true);
    assetGlobal.setAcquisitionTypeCode(assetGlobalService.getNewAcquisitionTypeCode());
    updatePreTagInformation(primary, document, assetGlobal, capitalAssetLineNumber);
    assetGlobal.getAssetPaymentDetails().addAll(createAssetPaymentDetails(primary, document, 0, capitalAssetLineNumber));
    // save the document
    document.getNewMaintainableObject().setMaintenanceAction(KRADConstants.MAINTENANCE_NEW_ACTION);
    document.getDocumentHeader().setDocumentDescription(CAB_DESC_PREFIX + primary.getDocumentNumber());
    document.getNewMaintainableObject().setBusinessObject(assetGlobal);
    document.getNewMaintainableObject().setBoClass(assetGlobal.getClass());
    documentService.saveDocument(document);
    // mark the capital asset as processed..
    markCapitalAssetProcessed(primary, capitalAssetLineNumber);
    deactivateGLEntries(primary, document, capitalAssetLineNumber);
    return document;
}
Also used : MaintenanceDocument(org.kuali.kfs.kns.document.MaintenanceDocument) AssetGlobal(org.kuali.kfs.module.cam.businessobject.AssetGlobal) NonTransactional(org.kuali.kfs.sys.service.NonTransactional)

Aggregations

NonTransactional (org.kuali.kfs.sys.service.NonTransactional)16 Note (org.kuali.kfs.krad.bo.Note)6 HashMap (java.util.HashMap)4 CapitalAssetInformation (org.kuali.kfs.fp.businessobject.CapitalAssetInformation)3 CuPaymentRequestDocument (edu.cornell.kfs.module.purap.document.CuPaymentRequestDocument)2 ArrayList (java.util.ArrayList)2 Map (java.util.Map)2 CuElectronicInvoiceRejectDocument (edu.cornell.kfs.module.purap.document.CuElectronicInvoiceRejectDocument)1 CUBankService (edu.cornell.kfs.sys.service.CUBankService)1 Timestamp (java.sql.Timestamp)1 Calendar (java.util.Calendar)1 List (java.util.List)1 MaintenanceDocument (org.kuali.kfs.kns.document.MaintenanceDocument)1 AssetGlobal (org.kuali.kfs.module.cam.businessobject.AssetGlobal)1 AssetPaymentAssetDetail (org.kuali.kfs.module.cam.businessobject.AssetPaymentAssetDetail)1 AssetPaymentDocument (org.kuali.kfs.module.cam.document.AssetPaymentDocument)1 ElectronicInvoiceRejectReason (org.kuali.kfs.module.purap.businessobject.ElectronicInvoiceRejectReason)1 PaymentRequestDocument (org.kuali.kfs.module.purap.document.PaymentRequestDocument)1 CustomerProfile (org.kuali.kfs.pdp.businessobject.CustomerProfile)1 PaymentDetail (org.kuali.kfs.pdp.businessobject.PaymentDetail)1