https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=42425

Pedro Amorim (ammopt) <[email protected]> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
                 CC|                            |[email protected]
                   |                            |k
             Status|Passed QA                   |Failed QA

--- Comment #37 from Pedro Amorim (ammopt) <[email protected]> ---
Hi Tomás, the new accountlines.checkin_id answers one question: "did this
checkin cause this charge?". The upgrade backfill makes it answer yes for
charges the checkin didn't cause.

1) Apply the patches, then: perl installer/data/mysql/updatedatabase.pl &&
restart_all
2) Edit item type 'BK', set 'Rental charge' to 1, click 'Save changes' (so the
checkout creates a charge):
  
http://localhost:8081/cgi-bin/koha/admin/itemtypes.pl?op=add_form&itemtype=BK
3) Check out item 3999900000001 to patron 'koha', then check it in
4) k$ echo "SELECT debit_type_code, checkin_id FROM accountlines WHERE
debit_type_code = 'RENT' ORDER BY accountlines_id DESC LIMIT 1" | koha-mysql
kohadev
   => checkin_id is NULL (correct, the rental fee was charged at checkout)
5) Run the atomicupdate again, as an upgrading site would: perl
installer/data/mysql/updatedatabase.pl
6) Repeat 4) => checkin_id is now set

The checkin now claims it caused a rental fee that was charged at checkout. On
upgrade, historical charges tied to a returned checkout get linked this way
(rental and renewal fees included), and those rows can't be told apart from
correct ones later.

This should be an easy fix now, but hard to fix retroactively later.

-- 
You are receiving this mail because:
You are watching all bug changes.
_______________________________________________
Koha-bugs mailing list -- [email protected]
To unsubscribe send an email to [email protected]
website : http://www.koha-community.org/
git : http://git.koha-community.org/
bugs : http://bugs.koha-community.org/

Reply via email to