Bugzilla – Attachment 121969 Details for
Bug 22435
Clarify account_offset types by converting them to clear codes
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Help
|
New Account
|
Log In
[x]
|
Forgot Password
Login:
[x]
[patch]
Bug 22435: Update accountline-details page to show all history
Bug-22435-Update-accountline-details-page-to-show-.patch (text/plain), 10.96 KB, created by
Victor Grousset/tuxayo
on 2021-06-15 07:33:40 UTC
(
hide
)
Description:
Bug 22435: Update accountline-details page to show all history
Filename:
MIME Type:
Creator:
Victor Grousset/tuxayo
Created:
2021-06-15 07:33:40 UTC
Size:
10.96 KB
patch
obsolete
>From c42ba5d8a5739d5a6e53d0e00ac286e6e05ea9b0 Mon Sep 17 00:00:00 2001 >From: Martin Renvoize <martin.renvoize@ptfs-europe.com> >Date: Fri, 14 May 2021 15:39:03 +0100 >Subject: [PATCH] Bug 22435: Update accountline-details page to show all > history > >The accountline-details page took a simplistic approach to displaying >the history of an accountline. This patch drops the now defunct >offset_type_description template block from it's respective include >files, and then updates the accountline-details teplate and controller >to show a full history of what's happend to the accountlines passed, >including creation, increment/decrement, payments, cancellation and >voids. > >Test plan >1/ Create some credits and debits and apply them to each other in >various combinations >2/ View the 'Details' page for some of the debit/credits >3/ Compare before patch and after for the Details page. > >Signed-off-by: Victor Grousset/tuxayo <victor@tuxayo.net> >--- > .../prog/en/includes/accounts.inc | 14 ---- > .../en/modules/members/accountline-details.tt | 78 +++++++++---------- > .../bootstrap/en/includes/accounts.inc | 14 ---- > members/accountline-details.pl | 17 ++-- > 4 files changed, 47 insertions(+), 76 deletions(-) > >diff --git a/koha-tmpl/intranet-tmpl/prog/en/includes/accounts.inc b/koha-tmpl/intranet-tmpl/prog/en/includes/accounts.inc >index 6c5450b0de..e57195717c 100644 >--- a/koha-tmpl/intranet-tmpl/prog/en/includes/accounts.inc >+++ b/koha-tmpl/intranet-tmpl/prog/en/includes/accounts.inc >@@ -56,17 +56,3 @@ > [%- CASE -%] > [%- END -%] > [%- END -%] >- >-[%- BLOCK offset_type_description -%] >- [%- SWITCH account_offset.type -%] >- [%- CASE 'Credit Applied' -%]<span>Credit applied</span> >- [%- CASE 'Payment' -%]<span>Payment</span> >- [%- CASE 'Manual Credit' -%]<span>Manual credit</span> >- [%- CASE 'Manual Debit' -%]<span>Manual invoice</span> >- [%- CASE 'Lost Item' -%]<span>Lost item returned</span> >- [%- CASE 'Writeoff' -%]<span>Writeoff</span> >- [%- CASE 'Void Payment' -%]<span>Void payment</span> >- [%- CASE 'CANCELLATION' -%]<span>Cancelled charge</span> >- [%- CASE -%][% account_offset.type | html %] >- [%- END -%] >-[%- END -%] >diff --git a/koha-tmpl/intranet-tmpl/prog/en/modules/members/accountline-details.tt b/koha-tmpl/intranet-tmpl/prog/en/modules/members/accountline-details.tt >index c8d50f0a5e..ba4ce08a52 100644 >--- a/koha-tmpl/intranet-tmpl/prog/en/modules/members/accountline-details.tt >+++ b/koha-tmpl/intranet-tmpl/prog/en/modules/members/accountline-details.tt >@@ -60,9 +60,9 @@ > [% INCLUDE 'members-toolbar.inc' borrowernumber=patron.borrowernumber %] > > [% IF accountline %] >- [% IF type == 'credit' %] >+ [% IF accountline.credit_type_code %] > <h2>Details of payment</h2> >- [% ELSIF type == 'debit' %] >+ [% ELSIF accountline.debit_type_code %] > <h2>Details of fee</h2> > [% END %] > >@@ -134,63 +134,61 @@ > </tbody> > </table> > >- >- [% IF type == 'credit' %] >- <h3>Fees paid</h3> >- [% ELSIF type == 'debit' %] >- <h3>Payments</h3> >- [% END %] >- >+ <h3>History</h3> > <table class="accountline-offsets-table" id="accountline-debits-table"> > <thead> > <tr> >- <th>Date created</th> >- <th>Date updated</th> >- <th>Amount</th> >- <th>Amount outstanding</th> >- <th>Type</th> >- <th>Note</th> >+ <th>Date</th> >+ <th>Change amount</th> >+ <th>Change type</th> > <th>Transacting librarian</th> >- <th>Date/time of change</th> >- <th>Amount of change</th> >- <th>Type of change</th> >+ <th>Note</th> > <th> </th> > </tr> > </thead> > > <tbody> > [% FOREACH ao IN account_offsets %] >- [% IF type == 'credit' %] >- [% SET offset_accountline = ao.debit %] >- [% ELSIF type == 'debit' %] >- [% SET offset_accountline = ao.credit %] >- [% END %] >+ [% IF ao.credit_id == accountline.accountlines_id %] >+ [% SET offset_accountline = ao.debit %] >+ [% ELSIF ao.debit_id == accountline.accountlines_id %] >+ [% SET offset_accountline = ao.credit %] >+ [% END %] >+ >+ [%- BLOCK ao_description -%] >+ [%- SWITCH ao.type -%] >+ [%- CASE 'CREATE' -%]<span>Created</span> >+ [%- CASE 'OVERDUE_INCREASE' -%]<span>Increase</span> >+ [%- CASE 'OVERDUE_DECREASE' -%]<span>Decrease</span> >+ [%- CASE 'APPLY' -%]<span>Applied</span> >+ [%- CASE 'VOID' -%]<span>Reversed</span> >+ [%- END -%] >+ [%- END -%] > >- [% IF offset_accountline %] > <tr> >- <td>[% offset_accountline.date | $KohaDates %]</td> >- <td>[% offset_accountline.timestamp | $KohaDates with_hours => 1 %]</td> >- <td>[% offset_accountline.amount | $Price %]</td> >- <td>[% offset_accountline.amountoutstanding | $Price %]</td> >- <td>[% PROCESS account_type_description account=offset_accountline %]</td> >- <td>[% offset_accountline.note | html %]</td> >- <td>[% IF offset_accountline.manager_id %]<a href="moremember.pl?borrowernumber=[% offset_accountline.manager_id | uri %]">[% offset_accountline.manager_id | html %]</a>[% END %]</td> >- <td>[% ao.created_on | $KohaDates with_hours => 1 %]</td> >+ <td>[% ao.created_on | $KohaDates with_hours => 1%]</td> > <td>[% ao.amount | $Price %]</td> >- <td>[% PROCESS offset_type_description account_offset=ao %]</td> >- <td><a href="accountline-details.pl?accountlines_id=[% offset_accountline.id | uri %]" class="btn btn-default btn-xs"><i class="fa fa-list"></i> Details</a></td> >+ <td> >+ [%- IF offset_accountline -%] >+ [% PROCESS account_type_description account=offset_accountline %] ([% PROCESS ao_description ao=ao %]) >+ [%- ELSE -%] >+ [% PROCESS ao_description ao=ao %] >+ [%- END -%] >+ </td> >+ <td>[% IF offset_accountline.manager_id %]<a href="moremember.pl?borrowernumber=[% offset_accountline.manager_id | uri %]">[% offset_accountline.manager_id | html %]</a>[% END %]</td> >+ <td>[% offset_accountline.note | html %]</td> >+ <td> >+ [%- IF offset_accountline -%] >+ <a href="accountline-details.pl?accountlines_id=[% offset_accountline.id | uri %]" class="btn btn-default btn-xs"><i class="fa fa-list"></i> Details</a> >+ [%- END -%] >+ </td> > </tr> >- [% END %] > [% END %] > </tbody> > </table> > [% ELSE %] > <div class="dialog message"> >- [% IF type == 'credit' %] >- Payment not found >- [% ELSIF type == 'debit' %] >- Fee not found >- [% END %] >+ Account not found > </div> > [% END %] > >diff --git a/koha-tmpl/opac-tmpl/bootstrap/en/includes/accounts.inc b/koha-tmpl/opac-tmpl/bootstrap/en/includes/accounts.inc >index 6c5450b0de..e57195717c 100644 >--- a/koha-tmpl/opac-tmpl/bootstrap/en/includes/accounts.inc >+++ b/koha-tmpl/opac-tmpl/bootstrap/en/includes/accounts.inc >@@ -56,17 +56,3 @@ > [%- CASE -%] > [%- END -%] > [%- END -%] >- >-[%- BLOCK offset_type_description -%] >- [%- SWITCH account_offset.type -%] >- [%- CASE 'Credit Applied' -%]<span>Credit applied</span> >- [%- CASE 'Payment' -%]<span>Payment</span> >- [%- CASE 'Manual Credit' -%]<span>Manual credit</span> >- [%- CASE 'Manual Debit' -%]<span>Manual invoice</span> >- [%- CASE 'Lost Item' -%]<span>Lost item returned</span> >- [%- CASE 'Writeoff' -%]<span>Writeoff</span> >- [%- CASE 'Void Payment' -%]<span>Void payment</span> >- [%- CASE 'CANCELLATION' -%]<span>Cancelled charge</span> >- [%- CASE -%][% account_offset.type | html %] >- [%- END -%] >-[%- END -%] >diff --git a/members/accountline-details.pl b/members/accountline-details.pl >index a5c37079aa..ee2b9fc758 100755 >--- a/members/accountline-details.pl >+++ b/members/accountline-details.pl >@@ -45,20 +45,21 @@ my $accountlines_id = $input->param('accountlines_id'); > my $accountline = Koha::Account::Lines->find($accountlines_id); > > if ($accountline) { >- my $type = $accountline->amount < 0 ? 'credit' : 'debit'; >- my $column = $type eq 'credit' ? 'credit_id' : 'debit_id'; >- > my $account_offsets = Koha::Account::Offsets->search( >- { $column => $accountlines_id }, >- { order_by => 'created_on' }, >+ [ >+ { >+ credit_id => $accountline->accountlines_id >+ }, >+ { >+ debit_id => $accountline->accountlines_id >+ } >+ ], >+ { order_by => 'created_on' } > ); > > $template->param( >- type => $type, > accountline => $accountline, > account_offsets => $account_offsets, >- >- finesview => 1, > ); > > my $patron = Koha::Patrons->find( $accountline->borrowernumber ); >-- >2.32.0
You cannot view the attachment while viewing its details because your browser does not support IFRAMEs.
View the attachment on a separate page
.
View Attachment As Diff
View Attachment As Raw
Actions:
View
|
Diff
|
Splinter Review
Attachments on
bug 22435
:
118340
|
118341
|
118541
|
118542
|
118543
|
118544
|
118545
|
118546
|
118547
|
120040
|
120041
|
120042
|
120043
|
120044
|
120045
|
120046
|
120963
|
120964
|
120965
|
120966
|
120967
|
120968
|
120969
|
120970
|
120979
|
120980
|
120981
|
120982
|
120983
|
120984
|
120985
|
120986
|
120987
|
120988
|
120989
|
120990
|
120991
|
121004
|
121005
|
121006
|
121007
|
121008
|
121009
|
121010
|
121011
|
121012
|
121013
|
121014
|
121015
|
121016
|
121028
|
121757
|
121758
|
121759
|
121760
|
121761
|
121762
|
121763
|
121764
|
121765
|
121766
|
121767
|
121768
|
121769
|
121960
|
121961
|
121962
|
121963
|
121964
|
121965
|
121966
|
121967
|
121968
|
121969
|
121970
|
121971
|
121972
|
122148
|
122149
|
122150
|
122151
|
122152
|
122153
|
122154
|
122155
|
122156
|
122157
|
122158
|
122159
|
122160
|
122161
|
122235
|
122236
|
122237
|
122238
|
122239
|
122240
|
122241
|
122242
|
122243
|
122244
|
122245
|
122246
|
122247
|
122248
|
122249
|
122250
|
122251
|
122252
|
122253
|
122256
|
122257
|
122258
|
122259
|
122260
|
122261
|
122262
|
122263
|
122264
|
122265
|
122266
|
122267
|
122268
|
122269
|
122270
|
122271
|
122272
|
122273
|
122274
|
122553
|
122554
|
122555
|
122556
|
122557
|
122558
|
122559
|
122560
|
122561
|
122562
|
122563
|
122564
|
122565
|
122566
|
122567
|
122568
|
122569
|
122570
|
122571
|
122586
|
122899
|
122900
|
122901
|
122902
|
122903
|
122904
|
122905
|
122906
|
122907
|
122908
|
122909
|
122910
|
122911
|
122912
|
122913
|
122914
|
122915
|
122916
|
122917
|
122918
|
122937
|
123423
|
123424
|
123425
|
123426
|
123427
|
123428
|
123429
|
123430
|
123431
|
123432
|
123433
|
123434
|
123435
|
123436
|
123437
|
123438
|
123439
|
123440
|
123441
|
123442
|
123443