Bugzilla – Attachment 155473 Details for
Bug 28449
Link from basket summary to invoice for an order line
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Help
|
New Account
|
Log In
[x]
|
Forgot Password
Login:
[x]
[patch]
Bug 28449: Add column with invoice number to basket summary page
Bug-28449-Add-column-with-invoice-number-to-basket.patch (text/plain), 8.91 KB, created by
Katrin Fischer
on 2023-09-11 08:34:39 UTC
(
hide
)
Description:
Bug 28449: Add column with invoice number to basket summary page
Filename:
MIME Type:
Creator:
Katrin Fischer
Created:
2023-09-11 08:34:39 UTC
Size:
8.91 KB
patch
obsolete
>From 0d302d3ca4170ae6330d465bcabec09f729fa0cf Mon Sep 17 00:00:00 2001 >From: Katrin Fischer <katrin.fischer@bsz-bw.de> >Date: Fri, 8 Sep 2023 15:34:33 +0000 >Subject: [PATCH] Bug 28449: Add column with invoice number to basket summary > page > >At the moment it's quite a lot of clicks to get from the basket >summary to the invoice something was received in. This adds a nice >shortcut by creating a new column for the invoicenumber in the basket >summary table. > >To test: >* Make sure you have a basket with some received and unreceived > order lines >* Verify that the (received) shows for your received lines >* Verify no invoice number or link to it in sight >* Apply patch >* Verify that there is now a column for the Invoice containing > the invoice number as a link to the invoice >* Test with a staff patron, that doesn't have edit_invoices permission >* Verify that now instead of a link you see the invoice number as text > >Be happy, sign off ;) > >Note: this doesn't change the CSV export. The way the CSV is built is >quite different to the summary table, so it would be better handled >in a separate bug/patch. The columns are already quite different! > >Sponsored-by: The Research University in the Helmholtz Association (KIT) > >Signed-off-by: Laura Escamilla <laura.escamilla@bywatersolutions.com> >Signed-off-by: Michaela Sieber <michaela.sieber@kit.edu> >--- > acqui/basket.pl | 39 +++++++++++-------- > admin/columns_settings.yml | 2 + > .../prog/en/modules/acqui/basket.tt | 12 +++++- > 3 files changed, 35 insertions(+), 18 deletions(-) > >diff --git a/acqui/basket.pl b/acqui/basket.pl >index 80c633cf56..d7f2d76a99 100755 >--- a/acqui/basket.pl >+++ b/acqui/basket.pl >@@ -473,27 +473,32 @@ sub get_order_infos { > my $biblio = Koha::Biblios->find( $biblionumber ); > my $countbiblio = $biblio->active_orders->count; > >- my $ordernumber = $order->{'ordernumber'}; >+ my $ordernumber = $order->{'ordernumber'}; > my $cnt_subscriptions = $biblio->subscriptions->count; >- my $itemcount = $biblio->items->count; >- my $holds_count = $biblio->holds->count; >- my $order = Koha::Acquisition::Orders->find($ordernumber); # FIXME We should certainly do that at the beginning of this sub >- my $items = $order->items; >+ my $itemcount = $biblio->items->count; >+ my $holds_count = $biblio->holds->count; >+ my $order = Koha::Acquisition::Orders->find($ordernumber); # FIXME We should certainly do that at the beginning of this sub >+ my $items = $order->items; >+ my $invoice = $order->invoice; >+ > my $itemholds = $biblio->holds->search({ itemnumber => { -in => [ $items->get_column('itemnumber') ] } })->count; > > # if the biblio is not in other orders and if there is no items elsewhere and no subscriptions and no holds we can then show the link "Delete order and Biblio" see bug 5680 >- $line{can_del_bib} = 1 if $countbiblio <= 1 && $itemcount == $items->count && !($cnt_subscriptions) && !($holds_count); >- $line{items} = $itemcount - $items->count; >- $line{left_item} = 1 if $line{items} >= 1; >- $line{left_biblio} = 1 if $countbiblio > 1; >- $line{biblios} = $countbiblio - 1; >- $line{left_subscription} = 1 if $cnt_subscriptions; >- $line{subscriptions} = $cnt_subscriptions; >- ($holds_count >= 1) ? $line{left_holds} = 1 : $line{left_holds} = 0; >- $line{left_holds_on_order} = 1 if $line{left_holds}==1 && ($line{items} == 0 || $itemholds ); >- $line{holds} = $holds_count; >- $line{holds_on_order} = $itemholds?$itemholds:$holds_count if $line{left_holds_on_order}; >- $line{order_object} = $order; >+ $line{can_del_bib} = 1 >+ if $countbiblio <= 1 && $itemcount == $items->count && !($cnt_subscriptions) && !($holds_count); >+ $line{items} = $itemcount - $items->count; >+ $line{left_item} = 1 if $line{items} >= 1; >+ $line{left_biblio} = 1 if $countbiblio > 1; >+ $line{biblios} = $countbiblio - 1; >+ $line{left_subscription} = 1 if $cnt_subscriptions; >+ $line{subscriptions} = $cnt_subscriptions; >+ ( $holds_count >= 1 ) ? $line{left_holds} = 1 : $line{left_holds} = 0; >+ $line{left_holds_on_order} = 1 if $line{left_holds} == 1 && ( $line{items} == 0 || $itemholds ); >+ $line{holds} = $holds_count; >+ $line{holds_on_order} = $itemholds ? $itemholds : $holds_count if $line{left_holds_on_order}; >+ $line{order_object} = $order; >+ $line{invoice_object} = $invoice; >+ > } > > my $suggestion = GetSuggestionInfoFromBiblionumber($line{biblionumber}); >diff --git a/admin/columns_settings.yml b/admin/columns_settings.yml >index 9bd0580766..916f52e451 100644 >--- a/admin/columns_settings.yml >+++ b/admin/columns_settings.yml >@@ -158,6 +158,8 @@ modules: > - > columnname: statistic2 > is_hidden: 1 >+ - >+ columnname: invoice > - > columnname: supplier_report > - >diff --git a/koha-tmpl/intranet-tmpl/prog/en/modules/acqui/basket.tt b/koha-tmpl/intranet-tmpl/prog/en/modules/acqui/basket.tt >index 3e30015fd4..3a68132d9a 100644 >--- a/koha-tmpl/intranet-tmpl/prog/en/modules/acqui/basket.tt >+++ b/koha-tmpl/intranet-tmpl/prog/en/modules/acqui/basket.tt >@@ -478,6 +478,7 @@ > <th>Estimated delivery date</th> > <th>Statistic 1</th> > <th>Statistic 2</th> >+ <th>Invoice</th> > [% IF Koha.Preference('EDIFACT') && ediaccount %] > <th>Supplier report</th> > [% END %] >@@ -510,6 +511,7 @@ > <th> </th> > <th> </th> > <th> </th> >+ <th> </th> > [% IF Koha.Preference('EDIFACT') && ediaccount %] > <th> </th> > [% END %] >@@ -540,6 +542,7 @@ > <th> </th> > <th> </th> > <th> </th> >+ <th> </th> > [% IF Koha.Preference('EDIFACT') && ediaccount %] > <th> </th> > [% END %] >@@ -662,6 +665,13 @@ > </td> > <td>[% books_loo.sort1 | html %]</td> > <td>[% books_loo.sort2 | html %]</td> >+ <td> >+ [% IF CAN_user_acquisition_edit_invoices %] >+ <a href="/cgi-bin/koha/acqui/invoice.pl?invoiceid=[% books_loo.invoice_object.invoiceid | url %]" class="invoice">[% books_loo.invoice_object.invoicenumber | html %]</a> >+ [% ELSE %] >+ [% books_loo.invoice_object.invoicenumber | html %] >+ [% END %] >+ </td> > [% IF Koha.Preference('EDIFACT') && ediaccount %] > <td>[% books_loo.suppliers_report | html %]</td> > [% END %] >@@ -1092,7 +1102,7 @@ > KohaTable("orders", { > "sPaginationType": "full", > "autoWidth": false, >- "exportColumns": [0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17[% IF (Koha.Preference('EDIFACT') && ediaccount) %],18[% END %]], >+ "exportColumns": [0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18[% IF (Koha.Preference('EDIFACT') && ediaccount) %],19[% END %]], > }, table_settings); > > var cancelledorderst = $("#cancelledorderst").dataTable($.extend(true, {}, dataTablesDefaults, { >-- >2.30.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 28449
:
155442
|
155443
|
155452
|
155454
|
155473
|
155477
|
155570