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

Calculate and persist totals upon invoice creation/update/get

    XMLWordPrintable

    Details

    • Type: Story
    • Status: Closed (View Workflow)
    • Priority: P3
    • Resolution: Done
    • Affects Version/s: None
    • Fix Version/s: 2.0.0
    • Labels:
      None
    • Template:
    • Sprint:
      ACQ Sprint 69, ACQ Sprint 70
    • Story Points:
      3
    • Development Team:
      Thunderjet

      Description

      Overview

      In MODINVOICE-52 we implemented calculation of the invoice totals. These currently happen "on the fly", so the totals are never persisted. This works great if you're using GET by ID to retrieve invoices, but it means that the totals are not present in search results.

      Having these totals appear in the invoice search resutls is apparently needed, so we need to change this behavior.

      Approach

      • Calculate the totals upon invoice and invoiceLine creation/update and persist the values.
      • It might make sense to do some of this asynchronously via the eventBus like we've done in other places (po/pol)
      • In order to mitigate the possibility of the invoice/invoiceLine totals getting out of sync (e.g. if the call fails to update one but not the other), we should re-calculate the invoice totals upon GET by ID as well, and if different from what we just got from the DB, update them.
      • Once an invoice is "Approved", the totals should be read-only and the values should not be recalculated but used as is in DB (see Acquisitions Interface Fields - Invoice)

      Acceptance Criteria

      • adjustmentTotal, and total appear in the invoices retrieved via GET by Query and GET by ID.
      • Unit tests are updated
      • API tests are updated
      • Sample data is updated as needed (may or may not be)

      NOTE: It may make sense to do this before implementing prorated adjustments (MODINVOICE-54)

        TestRail: Results

          Attachments

            Issue Links

              Activity

                People

                Assignee:
                cmcnally Craig McNally
                Reporter:
                cmcnally Craig McNally
                Tester Assignee:
                Craig McNally Craig McNally
                Votes:
                0 Vote for this issue
                Watchers:
                2 Start watching this issue

                  Dates

                  Created:
                  Updated:
                  Resolved:

                    TestRail: Runs

                      TestRail: Cases