Bugzilla – Attachment 160186 Details for
Bug 35044
Additional fields: Allow for repeatable fields
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Help
|
New Account
|
Log In
[x]
|
Forgot Password
Login:
[x]
[patch]
Bug 35044: Update: Manual invoices, manual credits and accountlines
Bug-35044-Update-Manual-invoices-manual-credits-an.patch (text/plain), 10.14 KB, created by
Martin Renvoize (ashimema)
on 2023-12-21 10:28:47 UTC
(
hide
)
Description:
Bug 35044: Update: Manual invoices, manual credits and accountlines
Filename:
MIME Type:
Creator:
Martin Renvoize (ashimema)
Created:
2023-12-21 10:28:47 UTC
Size:
10.14 KB
patch
obsolete
>From df9eb74edec078cc1b54f4d568be0a52f073f5ea Mon Sep 17 00:00:00 2001 >From: Pedro Amorim <pedro.amorim@ptfs-europe.com> >Date: Tue, 17 Oct 2023 13:02:22 +0000 >Subject: [PATCH] Bug 35044: Update: Manual invoices, manual credits and > accountlines > >Test plan, k-t-d: > >Preparation: Create additional fields for table 'accountlines:credit', visit: >/cgi-bin/koha/admin/additional-fields.pl?tablename=accountlines%3Acredit > >2 text fields, one repeatable, one not-repeatable >2 AV fields, one repeatable, one not-repeatable > >1) Add a new manual credit for admin borrower: >/cgi-bin/koha/members/mancredit.pl?borrowernumber=51 >2) Set the mandatory "Amount" input (e.g. '5'). Click the 'Next' and press 'Ok' on the alert box. >3) Fill in all additional fields, click the '+New' and 'Clear' links, hit 'Save' >4) On the table, click "Details" for the for account line we just created. >5) Notice the additional fields are there, repeated fields are comma separated. >6) Repeat the above test plan, but for accountlines:debit instead, visit: >/cgi-bin/koha/admin/additional-fields.pl?tablename=accountlines%3Adebit >7) To add a manual invoice, visit: >/cgi-bin/koha/members/maninvoice.pl?borrowernumber=51 > >Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com> >--- > .../en/modules/members/accountline-details.tt | 16 +++------------- > .../prog/en/modules/members/mancredit.tt | 1 + > .../prog/en/modules/members/maninvoice.tt | 1 + > .../prog/en/modules/members/paycollect.tt | 1 + > members/accountline-details.pl | 3 +++ > members/mancredit.pl | 8 ++++---- > members/maninvoice.pl | 8 ++++---- > members/paycollect.pl | 16 ++++++++-------- > 8 files changed, 25 insertions(+), 29 deletions(-) > >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 ef20e355ab6..45f0f65473e 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 >@@ -67,7 +67,6 @@ > [% IF accountline %] > > <div class="page-section"> >- [% af_values = accountline.additional_field_values %] > [% IF accountline.credit_type_code %] > <h2>Details of credit</h2> > [% ELSIF accountline.debit_type_code %] >@@ -83,8 +82,8 @@ > <th>Due date</th> > <th>Return date</th> > <th>Note</th> >- [% FOREACH value IN af_values %] >- <th>[% value.field.name | html %]</th> >+ [% FOREACH field IN available_additional_fields %] >+ <th>[% field.name | html %]</th> > [% END %] > <th>Amount</th> > <th>Outstanding</th> >@@ -134,16 +133,7 @@ > <td> > [% accountline.note | html_line_break %] > </td> >- >- [% FOREACH value IN af_values %] >- <td> >- [% IF value.field.authorised_value_category %] >- [% AuthorisedValues.GetByCode( value.field.authorised_value_category, value.value ) | html %] >- [% ELSE %] >- [% value.value | html %] >- [% END %] >- </td> >- [% END %] >+ [% INCLUDE 'additional-fields-display.inc' available=available_additional_fields values=additional_field_values value_only=1 is_table_cell=1 %] > > <td> > [% accountline.amount | $Price %] >diff --git a/koha-tmpl/intranet-tmpl/prog/en/modules/members/mancredit.tt b/koha-tmpl/intranet-tmpl/prog/en/modules/members/mancredit.tt >index 7493987d219..0d8086000b1 100644 >--- a/koha-tmpl/intranet-tmpl/prog/en/modules/members/mancredit.tt >+++ b/koha-tmpl/intranet-tmpl/prog/en/modules/members/mancredit.tt >@@ -134,6 +134,7 @@ > [% MACRO jsinclude BLOCK %] > [% INCLUDE 'str/members-menu.inc' %] > [% Asset.js("js/members-menu.js") | $raw %] >+ [% Asset.js("js/additional-fields-entry.js") | $raw %] > <script> > $(document).ready(function(){ > $('#mancredit').preventDoubleFormSubmit(); >diff --git a/koha-tmpl/intranet-tmpl/prog/en/modules/members/maninvoice.tt b/koha-tmpl/intranet-tmpl/prog/en/modules/members/maninvoice.tt >index c278c7596ba..0a5f2b657cb 100644 >--- a/koha-tmpl/intranet-tmpl/prog/en/modules/members/maninvoice.tt >+++ b/koha-tmpl/intranet-tmpl/prog/en/modules/members/maninvoice.tt >@@ -128,6 +128,7 @@ > [% MACRO jsinclude BLOCK %] > [% INCLUDE 'str/members-menu.inc' %] > [% Asset.js("js/members-menu.js") | $raw %] >+ [% Asset.js("js/additional-fields-entry.js") | $raw %] > <script> > var type_fees = {}; > [% FOREACH debit_type IN debit_types %] >diff --git a/koha-tmpl/intranet-tmpl/prog/en/modules/members/paycollect.tt b/koha-tmpl/intranet-tmpl/prog/en/modules/members/paycollect.tt >index 0c67b299ad6..85dba553ac6 100644 >--- a/koha-tmpl/intranet-tmpl/prog/en/modules/members/paycollect.tt >+++ b/koha-tmpl/intranet-tmpl/prog/en/modules/members/paycollect.tt >@@ -407,6 +407,7 @@ > [% MACRO jsinclude BLOCK %] > [% INCLUDE 'str/members-menu.inc' %] > [% Asset.js("js/members-menu.js") | $raw %] >+ [% Asset.js("js/additional-fields-entry.js") | $raw %] > <script> > $(document).ready(function() { > [% IF payment_id && Koha.Preference('FinePaymentAutoPopup') %] >diff --git a/members/accountline-details.pl b/members/accountline-details.pl >index b798ef96477..d4044e86740 100755 >--- a/members/accountline-details.pl >+++ b/members/accountline-details.pl >@@ -60,6 +60,9 @@ if ($accountline) { > $template->param( > accountline => $accountline, > account_offsets => $account_offsets, >+ additional_field_values => $accountline->get_additional_field_values_for_template, >+ available_additional_fields => Koha::AdditionalFields->search( >+ { tablename => $accountline->credit_type_code ? 'accountlines:credit' : 'accountlines:debit' } ), > ); > > my $patron = Koha::Patrons->find( $accountline->borrowernumber ); >diff --git a/members/mancredit.pl b/members/mancredit.pl >index e77c82defc9..a1c0dc4a0ee 100755 >--- a/members/mancredit.pl >+++ b/members/mancredit.pl >@@ -111,12 +111,12 @@ if ($add) { > my @additional_fields; > my $accountline_fields = Koha::AdditionalFields->search({ tablename => 'accountlines:credit' }); > while ( my $field = $accountline_fields->next ) { >- my $value = $input->param('additional_field_' . $field->id); >- if (defined $value) { >+ my @field_values = $input->param( 'additional_field_' . $field->id ); >+ foreach my $value (@field_values) { > push @additional_fields, { >- id => $field->id, >+ id => $field->id, > value => $value, >- }; >+ } if $value; > } > } > if (@additional_fields) { >diff --git a/members/maninvoice.pl b/members/maninvoice.pl >index 01464cf3a44..da45940e2ba 100755 >--- a/members/maninvoice.pl >+++ b/members/maninvoice.pl >@@ -169,12 +169,12 @@ if ($add) { > my @additional_fields; > my $accountline_fields = Koha::AdditionalFields->search({ tablename => 'accountlines:debit' }); > while ( my $field = $accountline_fields->next ) { >- my $value = $input->param('additional_field_' . $field->id); >- if (defined $value) { >+ my @field_values = $input->param( 'additional_field_' . $field->id ); >+ foreach my $value (@field_values) { > push @additional_fields, { >- id => $field->id, >+ id => $field->id, > value => $value, >- }; >+ } if $value; > } > } > if (@additional_fields) { >diff --git a/members/paycollect.pl b/members/paycollect.pl >index b189107f25b..02b09ab97cc 100755 >--- a/members/paycollect.pl >+++ b/members/paycollect.pl >@@ -175,12 +175,12 @@ if ( $total_paid and $total_paid ne '0.00' ) { > my @additional_fields; > my $accountline_fields = Koha::AdditionalFields->search({ tablename => 'accountlines:credit' }); > while ( my $field = $accountline_fields->next ) { >- my $value = $input->param('additional_field_' . $field->id); >- if (defined $value) { >+ my @field_values = $input->param( 'additional_field_' . $field->id ); >+ foreach my $value (@field_values) { > push @additional_fields, { >- id => $field->id, >+ id => $field->id, > value => $value, >- }; >+ } if $value; > } > } > if (@additional_fields) { >@@ -235,12 +235,12 @@ if ( $total_paid and $total_paid ne '0.00' ) { > my @additional_fields; > my $accountline_fields = Koha::AdditionalFields->search({ tablename => 'accountlines:credit' }); > while ( my $field = $accountline_fields->next ) { >- my $value = $input->param('additional_field_' . $field->id); >- if (defined $value) { >+ my @field_values = $input->param( 'additional_field_' . $field->id ); >+ foreach my $value (@field_values) { > push @additional_fields, { >- id => $field->id, >+ id => $field->id, > value => $value, >- }; >+ } if $value; > } > } > if (@additional_fields) { >-- >2.43.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 35044
:
157324
|
157325
|
157326
|
157327
|
157328
|
157329
|
157330
|
157331
|
157332
|
157333
|
157334
|
158113
|
158498
|
158499
|
158500
|
158501
|
158502
|
158503
|
158504
|
158505
|
158506
|
158507
|
158508
|
158857
|
158858
|
158859
|
158860
|
158861
|
158862
|
158863
|
158864
|
158865
|
158866
|
158867
|
158868
|
159268
|
160177
|
160178
|
160179
|
160180
|
160181
|
160182
|
160183
|
160184
|
160185
|
160186
|
160187
|
160188
|
160189
|
164162
|
164163
|
164164
|
164165
|
164166
|
164167
|
164168
|
164169
|
164170
|
164171
|
164172
|
164173
|
164174
|
167690
|
168537
|
168538
|
168539
|
168540
|
168541
|
168542
|
168543
|
168544
|
168545
|
168546
|
168547
|
168548
|
169545
|
169546
|
169547
|
169603
|
169604
|
169605
|
169606
|
169607
|
169643
|
169644
|
169645
|
169646
|
169647
|
169648
|
169649
|
169650
|
169651
|
169652
|
169653
|
169654
|
169655
|
169656
|
169657
|
169658
|
169659
|
169660
|
169661
|
169662
|
169663
|
169664
|
169665
|
169666
|
169667
|
169668
|
169669
|
169670
|
169671
|
169672
|
169673
|
169674
|
169675
|
169676
|
169677
|
169678
|
169679
|
169680
|
169681
|
169682
|
169683
|
169684
|
169697
|
170501