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

Invoice approval fails if a voucherNumberPrefix isn't configured

    XMLWordPrintable

Details

    • ACQ Sprint 84
    • 1
    • Thunderjet

    Description

      Overview

      This was discovered while testing MODFISTO-91. When approving an invoice, you get a generic error if a voucherNumberPrefix is not configured. (Settings -> Invoices -> Voucher number -> Prefix).

      It was determined that this is the result of a NullPointerException in InvoiceHandler.

      Caused by: java.lang.NullPointerException
      	at java.util.Objects.requireNonNull(Objects.java:203) ~[?:1.8.0_222]
      	at java.util.Optional.<init>(Optional.java:96) ~[?:1.8.0_222]
      	at java.util.Optional.of(Optional.java:108) ~[?:1.8.0_222]
      	at java.util.stream.FindOps$FindSink$OfRef.get(FindOps.java:193) ~[?:1.8.0_222]
      	at java.util.stream.FindOps$FindSink$OfRef.get(FindOps.java:190) ~[?:1.8.0_222]
      	at java.util.stream.FindOps$FindOp.evaluateSequential(FindOps.java:152) ~[?:1.8.0_222]
      	at java.util.stream.AbstractPipeline.evaluate(AbstractPipeline.java:234) ~[?:1.8.0_222]
      	at java.util.stream.ReferencePipeline.findFirst(ReferencePipeline.java:531) ~[?:1.8.0_222]
      	at org.folio.rest.impl.InvoiceHelper.getVoucherNumberPrefix(InvoiceHelper.java:652) ~[mod-invoice-fat.jar:?]
      	at org.folio.rest.impl.InvoiceHelper.getVoucherNumberWithPrefix(InvoiceHelper.java:634) ~[mod-invoice-fat.jar:?]
      	at org.folio.rest.impl.InvoiceHelper.buildNewVoucher(InvoiceHelper.java:629) ~[mod-invoice-fat.jar:?]
      	at org.folio.rest.impl.InvoiceHelper.lambda$54(InvoiceHelper.java:589) ~[mod-invoice-fat.jar:?]
      	at java.util.concurrent.CompletableFuture.uniCompose(CompletableFuture.java:952) ~[?:1.8.0_222]
      	... 71 more
      

      Expected

      The invoice is approved

      Actual

      A generic error is returned

      See the comments section of MODFISTO-91 for additional details.

      Acceptance Criteria

      • The bug is fixed
      • Unit tests are updated to cover this scenario
      • A bugfix release is created for inclusion in Fameflower

      TestRail: Results

        Attachments

          1. mod-invoice (1).log
            917 kB
          2. MODINVOICE-147.mp4
            7.86 MB
          3. MODINVOICE-147-2.mp4
            9.14 MB

          Issue Links

            Activity

              People

                aliaksandr_pautau Aliaksandr Pautau
                cmcnally Craig McNally
                Aliaksandr Pautau Aliaksandr Pautau
                Votes:
                0 Vote for this issue
                Watchers:
                2 Start watching this issue

                Dates

                  Created:
                  Updated:
                  Resolved:

                  TestRail: Runs

                    TestRail: Cases