Bug 38765 - Internal server error when merging invoices
Summary: Internal server error when merging invoices
Status: Pushed to main
Alias: None
Product: Koha
Classification: Unclassified
Component: Acquisitions (show other bugs)
Version: Main
Hardware: All All
: P5 - low normal
Assignee: Emily Lamancusa (emlam)
QA Contact: Katrin Fischer
URL:
Keywords:
Depends on:
Blocks: 38766
  Show dependency treegraph
 
Reported: 2024-12-20 15:09 UTC by Emily Lamancusa (emlam)
Modified: 2025-01-01 00:14 UTC (History)
1 user (show)

See Also:
Change sponsored?: ---
Patch complexity: ---
Documentation contact:
Documentation submission:
Text to go in the release notes:
This fixes merging of invoices (Acquisitions > Invoices > [select invoices from search results] > Merge selected invoices > Merge). Previously, clicking "Merge" caused an internal server error with the message "The given date <date> does not match the date format (iso)...".
Version(s) released in:
25.05.00
Circulation function:


Attachments
Bug 38765: Parse dates correctly (3.96 KB, patch)
2024-12-20 17:23 UTC, Emily Lamancusa (emlam)
Details | Diff | Splinter Review
Bug 38765: Parse dates correctly (4.01 KB, patch)
2024-12-20 20:26 UTC, Brendan Lawlor
Details | Diff | Splinter Review

Note You need to log in before you can comment on or make changes to this bug.
Description Emily Lamancusa (emlam) 2024-12-20 15:09:24 UTC

    
Comment 1 Emily Lamancusa (emlam) 2024-12-20 17:23:45 UTC
Created attachment 175849 [details] [review]
Bug 38765: Parse dates correctly

Some dates in invoices.tt are being formatted to the system DateFormat
when they are not being displayed, which causes processing errors when
the code expects ISO format. Dates should be formatted for local format
only when they are being displayed.

To test:
1. Go to Acquisitions and create some invoices
    i. Search for a vendor (can submit a blank search box)
    ii. Click on vendor name
    iii. Click "Receive shipments" button
    iv. In the "Receive a new shipment" section, enter any value in the
        "Vendor invoice" field and click "Next"
    v. Click the "My Vendor" breadcrumb and repeat iii-iv a few times
2. Go to Acquisitions > Invoices
3. Search for some invoices (can submit with all blank filters)
4. Select the checkboxes by two or more invoices
5. Click "Merge selected invoices"
6. Click "Merge" without editing the input data at all
--> Internal server error! "The given date <date> does not match the
    date format (iso)"
7. Apply patch
8. Repeat steps 2-6
--> The invoices are merged successfully!
Comment 2 Brendan Lawlor 2024-12-20 20:26:14 UTC
Created attachment 175855 [details] [review]
Bug 38765: Parse dates correctly

Some dates in invoices.tt are being formatted to the system DateFormat
when they are not being displayed, which causes processing errors when
the code expects ISO format. Dates should be formatted for local format
only when they are being displayed.

To test:
1. Go to Acquisitions and create some invoices
    i. Search for a vendor (can submit a blank search box)
    ii. Click on vendor name
    iii. Click "Receive shipments" button
    iv. In the "Receive a new shipment" section, enter any value in the
        "Vendor invoice" field and click "Next"
    v. Click the "My Vendor" breadcrumb and repeat iii-iv a few times
2. Go to Acquisitions > Invoices
3. Search for some invoices (can submit with all blank filters)
4. Select the checkboxes by two or more invoices
5. Click "Merge selected invoices"
6. Click "Merge" without editing the input data at all
--> Internal server error! "The given date <date> does not match the
    date format (iso)"
7. Apply patch
8. Repeat steps 2-6
--> The invoices are merged successfully!

Signed-off-by: Brendan Lawlor <blawlor@clamsnet.org>
Comment 3 Katrin Fischer 2024-12-27 16:02:35 UTC
QA by RM - thanks Emily!
Comment 4 Katrin Fischer 2024-12-27 16:36:59 UTC
Pushed for 25.05!

Well done everyone, thank you!