Created attachment 48347 [details] [review] Bug 15906 - Remove use of makepayment in paycollect.pl Test plan: 1) Apply this patch 2) Make a payment in full using the "Pay" button 3) Note payment succeeds
Created attachment 52135 [details] [review] Bug 15906 - Remove use of makepayment in paycollect.pl Test plan: 1) Apply this patch 2) Make a payment in full using the "Pay" button 3) Note payment succeeds
Created attachment 52148 [details] [review] Bug 15906 - Remove use of makepayment in paycollect.pl Test plan: 1) Apply this patch 2) Make a payment in full using the "Pay" button 3) Note payment succeeds
In a user account some reasons for payments were created. Then a click on "Make payment" shows these individual fines & charges. One ist selected, then the button "Pay" is clicked. The payment does not work. Instead the following message appears: Software error: Can't locate object method "new" via package "Koha::Account" at /home/koha/src/members/paycollect.pl line 114.
Created attachment 54172 [details] [review] [SIGNED-OFF] Bug 15906 - Remove use of makepayment in paycollect.pl Test plan: 1) Apply this patch 2) Make a payment in full using the "Pay" button 3) Note payment succeeds Signed-off-by: Owen Leonard <oleonard@myacpl.org>
In a user account some reasons for payments were created. In the leftside-tab "Details" I click on "Make payment" and the individual fines & charges are shown. One is selected, then the button "Pay" on the right is clicked. Now the system asks for confirmation but still the following error message does appear and nothing is paid: Software error: Can't locate object method "new" via package "Koha::Account" at /home/sandbox1/src/members/paycollect.pl line 114. The buttons "Pay amount" and "Pay selected" at the bottom work all right, though. But not the "Pay" button.
(In reply to Michael Kuhn from comment #6) > In a user account some reasons for payments were created. In the > leftside-tab "Details" I click on "Make payment" and the individual fines & > charges are shown. One is selected, then the button "Pay" on the right is > clicked. Now the system asks for confirmation but still the following error > message does appear and nothing is paid: > > Software error: Can't locate object method "new" via package "Koha::Account" > at /home/sandbox1/src/members/paycollect.pl line 114. > > The buttons "Pay amount" and "Pay selected" at the bottom work all right, > though. But not the "Pay" button. Cannot reproduce this error with the Pay button. Note various warnings like this in the log: [Fri Oct 28 08:34:25 2016] paycollect.pl: Argument "\\x{33}\\x{30}..." isn't numeric in sprintf at /usr/lib/perl5/Template/Filters.pm line 467
When paying partial amounts via Pay and via Pay amount, the amount is positive via Pay and negative via Pay amount: +-------------+-----------+-------------------+---------------+---------------------+ | accounttype | amount | amountoutstanding | lastincrement | timestamp | +-------------+-----------+-------------------+---------------+---------------------+ | F | 30.000000 | 14.000000 | NULL | 2016-10-28 08:38:42 | | Pay | 10.000000 | 0.000000 | NULL | 2016-10-28 08:34:25 | | Pay | -1.000000 | 0.000000 | NULL | 2016-10-28 08:37:04 | | Pay | 2.000000 | 0.000000 | NULL | 2016-10-28 08:38:15 | | Pay | -3.000000 | 0.000000 | NULL | 2016-10-28 08:38:42 | +-------------+-----------+-------------------+---------------+---------------------+ Does not look good to me.
I succesfully applied patches 15896 and 15906. In a user account some reasons for payments were created. In the leftside-tab "Details" I click on "Make payment" and the individual fines & charges are shown. One is selected, then the button "Pay" on the right is clicked. Now the system asks for confirmation and the amount is paid. (So I can't reproduce the message "Software error: ..." from 2016-07-30 anymore and evyerything looks alright). I made another paymont via button "Pay amount" and this works also as I expect it. I then created a fee of 7, table "accountlines" looks as follows. mysql> select accounttype, amount, amountoutstanding, lastincrement, timestamp from accountlines; +-------------+------------+-------------------+---------------+---------------------+ | accounttype | amount | amountoutstanding | lastincrement | timestamp | +-------------+------------+-------------------+---------------+---------------------+ | N | 7.000000 | 7.000000 | NULL | 2016-10-29 12:33:03 | +-------------+------------+-------------------+---------------+---------------------+ Out of 7 I pay only 4. Now table "accountlines" looks as follows - the original line (N) changes in fields "amountoutstanding" and "timestamp" and another line (Pay) is added. This looks as I expect ist. +-------------+------------+-------------------+---------------+---------------------+ | accounttype | amount | amountoutstanding | lastincrement | timestamp | +-------------+------------+-------------------+---------------+---------------------+ | N | 7.000000 | 3.000000 | NULL | 2016-10-29 12:33:42 | | Pay | 4.000000 | 0.000000 | NULL | 2016-10-29 12:33:42 | +-------------+------------+-------------------+---------------+---------------------+ However, as already reported by M. de Rooy the logfile shows a lot of warnings like the following for every Pay action: [Sat Oct 29 12:33:43.008191 2016] [cgi:error] [pid 3382] [client 10.0.2.2:44132] AH01215: [Sat Oct 29 12:33:43 2016] paycollect.pl: Argument "7.00&descr..." isn't numeric in sprintf at /usr/lib/x86_64-linux-gnu/perl5/5.20/Template/Filters.pm line 467., referer: http://localhost:8081/cgi-bin/koha/members/paycollect.pl?borrowernumber=52&pay_individual=1&accounttype=N&amount=7.00&amountoutstanding=7.00%26description%3DN%26title%3D¬ify_id=1¬ify_level=0&accountlines_id=13&remote_user=
Create manual invoice: 20 Pay button: 1 Pay amount button: 2 Results in the following records in accountlines (still a negative amount with Pay amount): | 1513 | NULL | 1 | 1 | NULL | 2016-11-04 | 20.000000 | F | NULL | F | 17.000000 | NULL | 2016-11-04 09:14:33 | 1 | 0 | test411 | 1 | | 1514 | NULL | 1 | 2 | NULL | 2016-11-04 | 1.000000 | | NULL | Pay | 0.000000 | NULL | 2016-11-04 09:13:45 | 0 | 0 | | 1 | | 1515 | NULL | 1 | 2 | NULL | 2016-11-04 | -2.000000 | | NULL | Pay | 0.000000 | NULL | 2016-11-04 09:14:33 | 0 | 0 | | 1 |
OK Looking further: I must conclude that the actual error that I discover is in makepartialpayment, not included in this change. Adding a follow-up.
Created attachment 57168 [details] [review] Bug 15906 - Remove use of makepayment in paycollect.pl Test plan: 1) Apply this patch 2) Make a payment in full using the "Pay" button 3) Note payment succeeds Signed-off-by: Owen Leonard <oleonard@myacpl.org> Signed-off-by: Marcel de Rooy <m.de.rooy@rijksmuseum.nl>
Created attachment 57169 [details] [review] Bug 15906: [QA Follow-up] Correct a partial payment The amount in accountlines should be saved as a negative amount, but amount outstanding is correct. Note: This routine is actually used only once (in paycollect.pl). And is only cosmetically tested in Accounts.t. Test plan: [1] Create a manual invoice, Fine, say 20. [2] Click on the Pay button next to this fine, and pay 1. [3] Pay again, using 'Pay amount' button, and pay 2. [4] Pay again, using 'Pay' on the same line, the full remaining amount. [5] Verify that you see -1, -2 and -17 on the Accounts tab. [6] Run t/db_dependent/Accounts.t Signed-off-by: Marcel de Rooy <m.de.rooy@rijksmuseum.nl>
QA: Still working here
The simple test scenario works. But if we add another fine, the situation changes little bit: If I have fine1==20 and fine2==30, and I do individual payment on the second fine, the first fine will be paid first. Not really a big problem, but it is not what you expect. This is not caused by this patch set, but should be solved by bug 15896. So I am labeling this patch with "push together". Passed QA
Pushed to master for 17.05, thanks Marcel!
This won't get backported to 16.11.x as it is an enhancement.