Bug 38765

Summary: Internal server error when merging invoices
Product: Koha Reporter: Emily Lamancusa (emlam) <emily.lamancusa>
Component: AcquisitionsAssignee: Emily Lamancusa (emlam) <emily.lamancusa>
Status: Pushed to main --- QA Contact: Katrin Fischer <katrin.fischer>
Severity: normal    
Priority: P5 - low CC: david
Version: Main   
Hardware: All   
OS: All   
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:
Bug Depends on:    
Bug Blocks: 38766    
Attachments: Bug 38765: Parse dates correctly
Bug 38765: Parse dates correctly

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!