Bugzilla – Attachment 168546 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.15 KB, created by
Pedro Amorim
on 2024-07-05 13:11:38 UTC
(
hide
)
Description:
Bug 35044: Update: Manual invoices, manual credits and accountlines
Filename:
MIME Type:
Creator:
Pedro Amorim
Created:
2024-07-05 13:11:38 UTC
Size:
10.15 KB
patch
obsolete
>From 0d8baf96060ff423746cd259d05b4574b0ef2b55 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 548937f3d0..558a9d5066 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 >@@ -68,7 +68,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 %] >@@ -84,8 +83,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> >@@ -135,16 +134,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 4370a043ed..f8f9eb3168 100644 >--- a/koha-tmpl/intranet-tmpl/prog/en/modules/members/mancredit.tt >+++ b/koha-tmpl/intranet-tmpl/prog/en/modules/members/mancredit.tt >@@ -136,6 +136,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 b64dfb26ad..a85f756a5b 100644 >--- a/koha-tmpl/intranet-tmpl/prog/en/modules/members/maninvoice.tt >+++ b/koha-tmpl/intranet-tmpl/prog/en/modules/members/maninvoice.tt >@@ -130,6 +130,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 2f70b35ebb..d072f5ab30 100644 >--- a/koha-tmpl/intranet-tmpl/prog/en/modules/members/paycollect.tt >+++ b/koha-tmpl/intranet-tmpl/prog/en/modules/members/paycollect.tt >@@ -418,6 +418,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 b798ef9647..d4044e8674 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 f58dbc1585..84c1f6eea5 100755 >--- a/members/mancredit.pl >+++ b/members/mancredit.pl >@@ -102,12 +102,12 @@ if ( $op eq 'cud-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 18d44af307..9aa8cc1542 100755 >--- a/members/maninvoice.pl >+++ b/members/maninvoice.pl >@@ -164,12 +164,12 @@ if ( $op eq 'cud-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 ddea7cb4cd..89cb9e1d32 100755 >--- a/members/paycollect.pl >+++ b/members/paycollect.pl >@@ -173,12 +173,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) { >@@ -251,12 +251,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.39.2
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