Uploaded image for project: 'mod-invoice'
  1. mod-invoice
  2. MODINVOICE-360

Unrelease auto-released encumbrances when cancelling an invoice

    XMLWordPrintable

Details

    • ACQ Sprint 134
    • 2
    • Thunderjet
    • Lotus R1 2022
    • Incomplete/missing requirements

    Description

      Purpose/Overview:

      Encumbrances that have been released when an invoice was approved need to be unreleased when the invoice is cancelled.

      Requirements/Scope:

      1. This only applies to invoice lines with releaseEncumbrance=true
      2. This should only be done if Orders are in the status "Open" and POL payment status is Awaiting payment, Partially paid or Fully paid.
      3. Update encumbrances to change their status to Unreleased (by calling mod-finance, which should update the budgets accordingly)

      Approach:

      • Update InvoiceCancelService to unrelease encumbrances at the end of the cancelling process.
      • Select all unique po line ids from invoice lines with releaseEncumbrance=true.
      • Get the related order lines and orders, filter order lines based on order workflowStatus and order line paymentStatus.
      • Use baseTransactionService.getEncumbrancesByPoLineIds to get the encumbrances.
      • Change encumbrances status to Unreleased.
      • For each order, update order transaction summaries  and use baseTransactionService.updateTransactions().
      • If an error occurs while doing this, return an error message saying there was an error while unreleasing the encumbrance after cancelling the invoice and include the initial error message.

      Acceptance criteria:

      • Unit tests updated
      • Cross-module integration test cancel-invoice-linked-to-order from MODFISTO-284 updated

      TestRail: Results

        Attachments

          1. MODINVOICE-360.PNG
            113 kB
            Artsem Churakou
          2. MODINVOICE-360(2).PNG
            114 kB
            Artsem Churakou

          Issue Links

            Activity

              People

                artsem_churakou Artsem Churakou
                damieng Damien Guillaume
                Votes:
                0 Vote for this issue
                Watchers:
                2 Start watching this issue

                Dates

                  Created:
                  Updated:
                  Resolved:

                  TestRail: Runs

                    TestRail: Cases