Bugzilla – Attachment 169649 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: Invoices
Bug-35044-Update-Invoices.patch (text/plain), 5.87 KB, created by
Julian Maurice
on 2024-07-26 07:49:28 UTC
(
hide
)
Description:
Bug 35044: Update: Invoices
Filename:
MIME Type:
Creator:
Julian Maurice
Created:
2024-07-26 07:49:28 UTC
Size:
5.87 KB
patch
obsolete
>From 721b2094f8716388096b17df17641f5d78622a35 Mon Sep 17 00:00:00 2001 >From: Pedro Amorim <pedro.amorim@ptfs-europe.com> >Date: Mon, 16 Oct 2023 14:34:51 +0000 >Subject: [PATCH] Bug 35044: Update: Invoices > >Added fixme comment to invoices.tt, the search works so nothing to do >here, but the code is not DRY > >Test plan, k-t-d: > >Preparation: Create additional fields for table 'aqinvoices': >2 text fields, one repeatable, one not-repeatable >2 AV fields, one repeatable, one not-repeatable > >1) Add a new invoice for an existing vendor, visit: >/cgi-bin/koha/acqui/parcels.pl?booksellerid=1 >2) Input something in the mandatory "Vendor invoice" field. >3) Fill in all additional fields, click the '+New' and 'Clear' links, > hit 'Save' >4) Search for invoices, visit: >http://localhost:8081/cgi-bin/koha/acqui/invoices.pl >5) Click "Search" on the left column of the page >6) Click the invoice we just created. Verify all the fields show > correctly. >7) Go back to the additional fields configuration, set all additional > fields as "searchable" >8) Return to http://localhost:8081/cgi-bin/koha/acqui/invoices.pl >9) Perform some searches using the additional fields values. > >Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com> >Signed-off-by: Julian Maurice <julian.maurice@biblibre.com> > >https://bugs.koha-community.org/show_bug.cgi?id=25044 >--- > acqui/invoice.pl | 16 ++++++++-------- > acqui/parcels.pl | 6 +++--- > .../prog/en/modules/acqui/invoice.tt | 1 + > .../prog/en/modules/acqui/invoices.tt | 1 + > .../prog/en/modules/acqui/parcels.tt | 1 + > 5 files changed, 14 insertions(+), 11 deletions(-) > >diff --git a/acqui/invoice.pl b/acqui/invoice.pl >index 2c88908086..8627944617 100755 >--- a/acqui/invoice.pl >+++ b/acqui/invoice.pl >@@ -131,11 +131,13 @@ elsif ( $op && $op eq 'cud-mod' ) { > my @additional_fields; > my $invoice_fields = Koha::AdditionalFields->search({ tablename => 'aqinvoices' }); > while ( my $field = $invoice_fields->next ) { >- my $value = $input->param('additional_field_' . $field->id); >- push @additional_fields, { >- id => $field->id, >- value => $value, >- }; >+ my @field_values = $input->param( 'additional_field_' . $field->id ); >+ foreach my $value (@field_values) { >+ push @additional_fields, { >+ id => $field->id, >+ value => $value, >+ } if $value; >+ } > } > Koha::Acquisition::Invoices->find($invoiceid)->set_additional_fields(\@additional_fields); > >@@ -320,9 +322,7 @@ if ( $adjustments ) { $template->param( adjustments => $adjustments ); } > my $invoice = Koha::Acquisition::Invoices->find($invoiceid); > $template->param( > available_additional_fields => Koha::AdditionalFields->search( { tablename => 'aqinvoices' } ), >- additional_field_values => { map { >- $_->field->id => $_->value >- } $invoice->additional_field_values->as_list }, >+ additional_field_values => $invoice->get_additional_field_values_for_template, > ); > > $template->param( >diff --git a/acqui/parcels.pl b/acqui/parcels.pl >index 0cbc6d7671..5bead818a9 100755 >--- a/acqui/parcels.pl >+++ b/acqui/parcels.pl >@@ -134,12 +134,12 @@ if ($op and $op eq 'cud-confirm') { > my @additional_fields; > my $invoice_fields = Koha::AdditionalFields->search({ tablename => 'aqinvoices' }); > while ( my $field = $invoice_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, > value => $value, >- }; >+ } if $value; > } > } > if (@additional_fields) { >diff --git a/koha-tmpl/intranet-tmpl/prog/en/modules/acqui/invoice.tt b/koha-tmpl/intranet-tmpl/prog/en/modules/acqui/invoice.tt >index e4e2dd561c..049784047e 100644 >--- a/koha-tmpl/intranet-tmpl/prog/en/modules/acqui/invoice.tt >+++ b/koha-tmpl/intranet-tmpl/prog/en/modules/acqui/invoice.tt >@@ -542,6 +542,7 @@ > [% Asset.js("js/form-submit.js") | $raw %] > [% Asset.js("lib/jquery/plugins/humanmsg.js") | $raw %] > [% Asset.js("js/acq.js") | $raw %] >+ [% Asset.js("js/additional-fields-entry.js") | $raw %] > [% INCLUDE 'calendar.inc' %] > [% INCLUDE 'datatables.inc' %] > <script> >diff --git a/koha-tmpl/intranet-tmpl/prog/en/modules/acqui/invoices.tt b/koha-tmpl/intranet-tmpl/prog/en/modules/acqui/invoices.tt >index 6f9901bf71..3796039fdf 100644 >--- a/koha-tmpl/intranet-tmpl/prog/en/modules/acqui/invoices.tt >+++ b/koha-tmpl/intranet-tmpl/prog/en/modules/acqui/invoices.tt >@@ -385,6 +385,7 @@ > [% PROCESS options_for_libraries libraries => Branches.all( selected => branch, unfiltered => 1 ) %] > </select> > </li> >+ [%# FIXME additional-fields.entry.inc should/could be considered here %] > [% FOR field IN additional_fields_for_invoice %] > <li> > <label for="additional_field_[% field.id | html %]ID"> [% field.name | html %]: </label> >diff --git a/koha-tmpl/intranet-tmpl/prog/en/modules/acqui/parcels.tt b/koha-tmpl/intranet-tmpl/prog/en/modules/acqui/parcels.tt >index 703227a53d..5e169a3455 100644 >--- a/koha-tmpl/intranet-tmpl/prog/en/modules/acqui/parcels.tt >+++ b/koha-tmpl/intranet-tmpl/prog/en/modules/acqui/parcels.tt >@@ -244,6 +244,7 @@ > > [% MACRO jsinclude BLOCK %] > [% Asset.js("js/acquisitions-menu.js") | $raw %] >+ [% Asset.js("js/additional-fields-entry.js") | $raw %] > [% INCLUDE 'calendar.inc' %] > [% INCLUDE 'datatables.inc' %] > <script> >-- >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