If a patron got fines but the total is null (lost items then returned for example), on print summary, there is a table "Account fines and payments" with no lines in it. There should be not table at all
Created attachment 54260 [details] [review] Bug 17100 : Fix "Account fines and payments" diplay on patron's summary print
Test plan : * without patch 1/ find a patron with no lines in accountlines table : print summary shows no "account fines and payments" => OK 2/ find a patron with some lines in accountlines table and the total amount > 0 : print summary shows a table "account fines and payments" with fines to recover => OK 3/ find a patron with some lines in accountlines table but the total amount = 0 : print summary shows a table "account fines and payments" with nothing in it => NOK * with the patch, same cases as before : 1/ same as without patch 2/ same as without patch 3/ print summary does not show "account fines and payments"
Hi Sophie, Your patch did not work for me becuase some more logic is needed in the template file. Additionally, I encountred formatting problems. Alternative patch follows.
Created attachment 54261 [details] [review] Bug 17100: [Alternative patch] Fix issues for on summary print This alternative patch moves logic and formatting to the template file. To test: - Follow test plan in comment #2 - Additionally, verify that formatting follows syspref 'CurrencyFormat' - Verify that amount column is right-aligned
Created attachment 54270 [details] [review] Bug 17100: [Alternative patch] Fix issues for on summary print This alternative patch moves logic and formatting to the template file. To test: - Follow test plan in comment #2 - Additionally, verify that formatting follows syspref 'CurrencyFormat' - Verify that amount column is right-aligned
Created attachment 54312 [details] [review] [SIGNED-OFF] Bug 17100: [Alternative patch] Fix issues for on summary print This alternative patch moves logic and formatting to the template file. To test: - Follow test plan in comment #2 - Additionally, verify that formatting follows syspref 'CurrencyFormat' - Verify that amount column is right-aligned Signed-off-by: Owen Leonard <oleonard@myacpl.org>
Comment on attachment 54312 [details] [review] [SIGNED-OFF] Bug 17100: [Alternative patch] Fix issues for on summary print Review of attachment 54312 [details] [review]: ----------------------------------------------------------------- ::: koha-tmpl/intranet-tmpl/prog/en/modules/members/moremember-print.tt @@ +105,4 @@ > </tr> > > [% FOREACH account IN accounts %] > + [% IF ( account.amountoutstanding < 0 ) || ( account.amountoutstanding > 0 ) %] Marc, why did you replace next if amount == 0 with this lines?
(In reply to Jonathan Druart from comment #7) > Comment on attachment 54312 [details] [review] [review] > [SIGNED-OFF] Bug 17100: [Alternative patch] Fix issues for on summary print > > Review of attachment 54312 [details] [review] [review]: > ----------------------------------------------------------------- > > ::: koha-tmpl/intranet-tmpl/prog/en/modules/members/moremember-print.tt > @@ +105,4 @@ > > </tr> > > > > [% FOREACH account IN accounts %] > > + [% IF ( account.amountoutstanding < 0 ) || ( account.amountoutstanding > 0 ) %] > > Marc, why did you replace > next if amount == 0 > with this lines? It did not work with amount == 0 because the amount comes as '0.00' (not sure how much decimals tough)
Created attachment 54478 [details] [review] Bug 17100: Do not display payments if patron has nothing to pay This alternative patch moves logic and formatting to the template file. To test: * without patch 1/ find a patron with no lines in accountlines table : print summary shows no "account fines and payments" => OK 2/ find a patron with some lines in accountlines table and the total amount > 0 : print summary shows a table "account fines and payments" with fines to recover => OK 3/ find a patron with some lines in accountlines table but the total amount = 0 : print summary shows a table "account fines and payments" with nothing in it => NOK * with the patch, same cases as before : 1/ same as without patch 2/ same as without patch 3/ print summary does not show "account fines and payments" - Additionally, verify that formatting follows syspref 'CurrencyFormat' - Verify that amount column is right-aligned Signed-off-by: Owen Leonard <oleonard@myacpl.org> Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
Created attachment 54479 [details] [review] Bug 17100: Restore previous logic There is no need to change the previous logic here, so let's restore it. Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
(In reply to Marc Véron from comment #8) > (In reply to Jonathan Druart from comment #7) > > Comment on attachment 54312 [details] [review] [review] [review] > > [SIGNED-OFF] Bug 17100: [Alternative patch] Fix issues for on summary print > > > > Review of attachment 54312 [details] [review] [review] [review]: > > ----------------------------------------------------------------- > > > > ::: koha-tmpl/intranet-tmpl/prog/en/modules/members/moremember-print.tt > > @@ +105,4 @@ > > > </tr> > > > > > > [% FOREACH account IN accounts %] > > > + [% IF ( account.amountoutstanding < 0 ) || ( account.amountoutstanding > 0 ) %] > > > > Marc, why did you replace > > next if amount == 0 > > with this lines? > > It did not work with amount == 0 because the amount comes as '0.00' (not > sure how much decimals tough) It's because you compared string "0.00", instead of integer 0.
Pushed to master for 16.11, thanks Marc, Jonathan!
Pushed in 16.05. Will be in 16.05.03.
Pushed to 3.22.x, will be in 3.22.10