Forum - Unable to change price and quantity from Create Invoice Line API

Tagged: ,

Viewing 5 posts - 1 through 5 (of 5 total)
  • Author
    Posts
  • #53052
    Dan Michael Heggø
    Participant

    We’re trying to create a script that creates invoices and invoice lines using the API. We’re following the recipe in https://developers.exlibrisgroup.com/blog/creating-an-invoice-using-apis/. Everything works, except that the price and quantity in the invoice lines are not changed, but defaults to the PO Line value. Here’s an example XML we use with the Create Invoice Line API:

    <invoice_line>
    <type>REGULAR</type>
    <number>11</number>
    <price>200</price>
    <quantity>1</quantity>
    <po_line>POL-70285</po_line>
    <reporting_code>PRINTBOOK</reporting_code>
    </invoice_line>

    When POST-ing it, we get the following response:

    <?xml version=”1.0″ encoding=”UTF-8″ standalone=”yes”?>
    <invoice_line>
    <id>9396098380002204</id>
    <type desc=”Regular”>REGULAR</type>
    <number>11</number>
    <status desc=”In-Review”>INREVIEW</status>
    <po_line>POL-70285</po_line>
    <price>300</price>
    <price_note/>
    <total_price>300.0</total_price>
    <quantity>3</quantity>
    <vat_note>Approximately 0.00 included in line Total Price.</vat_note>
    <check_subscription_date_overlap>true</check_subscription_date_overlap>
    <fully_invoiced>false</fully_invoiced>
    <additional_info/>
    <release_remaining_encumbrance>false</release_remaining_encumbrance>
    <reporting_code desc=”Printed Book”>PRINTBOOK</reporting_code>
    <secondary_reporting_code/>
    <tertiary_reporting_code/>
    <note/>
    <invoice_line_vat>
    <vat_code/>
    <percentage>0.0</percentage>
    <vat_amount>0</vat_amount>
    </invoice_line_vat>
    <fund_distributions>
    <fund_distribution>
    <fund_code desc=”Antropologi”>uhs-antr</fund_code>
    <percent>300.00</percent>
    <amount>900</amount>
    </fund_distribution>
    </fund_distributions>
    </invoice_line>

    The invoice line is created and there is no error message, but the price and quantity are not set to the values from the XML, but rather to the default values from the PO Line. Changing the reporting_code or price_note works, however. 😕

    #53190
    Tami Fuches
    Moderator

    Hi,
    This issue will be fixed as part of the Alma September release. The behavior will be as following:
    1. If po_line field was supplied, the following fields will be taken by default from the POL:
    • price
    • quantity
    • reporting codes
    • funding

    2. However, if they were supplied as part of the payload – the values from the payload should be used.

    3. This is similar to the behavior in UI for manually creating invoice line: after selecting a pol this fields are automatically populated. However they can be changed by the user.

    Thanks,
    Tamar

    #53194
    Dan Michael Heggø
    Participant

    Thanks, that would be exactly what we would expect from the API.

    #61598
    Dan Michael Heggø
    Participant

    Couldn’t find any info about this in the September release notes. Was it postponed for October?

    #62024
    Tami Fuches
    Moderator

    Hi Dan,
    The fix is part of the September release.
    It was not included in the list of resolved defects by a mistake. We will add it.

    Thanks,
    Tamar

Viewing 5 posts - 1 through 5 (of 5 total)
  • You must be logged in to reply to this topic.