Bugzilla – Attachment 26065 Details for
Bug 7288
Invoice improvements - Show only subscriptions
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Help
|
New Account
|
Log In
[x]
|
Forgot Password
Login:
[x]
[patch]
Bug 7288: Set a boolean if the invoice if linked to subscriptions
Bug-7288-Set-a-boolean-if-the-invoice-if-linked-to.patch (text/plain), 3.85 KB, created by
Jonathan Druart
on 2014-03-11 10:18:45 UTC
(
hide
)
Description:
Bug 7288: Set a boolean if the invoice if linked to subscriptions
Filename:
MIME Type:
Creator:
Jonathan Druart
Created:
2014-03-11 10:18:45 UTC
Size:
3.85 KB
patch
obsolete
>From 29c61dfd4f29e3247322675e27bf964f65653d21 Mon Sep 17 00:00:00 2001 >From: Jonathan Druart <jonathan.druart@biblibre.com> >Date: Tue, 11 Mar 2014 11:17:18 +0100 >Subject: [PATCH] Bug 7288: Set a boolean if the invoice if linked to > subscriptions > >If an invoice is linked to subscription, we need to set a boolean to >true in order to filter them in the interface. >--- > C4/Acquisition.pm | 7 +++++++ > koha-tmpl/intranet-tmpl/prog/en/modules/acqui/invoices.tt | 5 ++--- > t/db_dependent/Acquisition/Invoices.t | 7 +++++++ > 3 files changed, 16 insertions(+), 3 deletions(-) > >diff --git a/C4/Acquisition.pm b/C4/Acquisition.pm >index 4027e0a..c1dce1b 100644 >--- a/C4/Acquisition.pm >+++ b/C4/Acquisition.pm >@@ -2489,6 +2489,13 @@ sub GetInvoices { > NULL > ) > ) AS receivedbiblios, >+ COUNT( >+ DISTINCT IF( >+ aqorders.subscriptionid IS NOT NULL, >+ aqorders.subscriptionid, >+ NULL >+ ) >+ ) AS is_linked_to_subscriptions, > SUM(aqorders.quantityreceived) AS receiveditems > FROM aqinvoices > LEFT JOIN aqbooksellers ON aqbooksellers.id = aqinvoices.booksellerid >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 21625a5..8f0c21d 100644 >--- a/koha-tmpl/intranet-tmpl/prog/en/modules/acqui/invoices.tt >+++ b/koha-tmpl/intranet-tmpl/prog/en/modules/acqui/invoices.tt >@@ -12,7 +12,6 @@ $(document).ready(function() { > var resultst = $("#resultst").dataTable($.extend(true, {}, dataTablesDefaults, { > sDom: "t", > bPaginate: false, >- bFilter: false, > bInfo: false, > "aoColumns": [ > null,null,null,{ "sType": "title-string" },null,null,null,null >@@ -27,7 +26,7 @@ $(document).ready(function() { > > $("#show_only_subscription").click(function(){ > if ( $(this).attr("checked") ) { >- resultst.fnFilter( "[0-9]+", 0, true ); >+ resultst.fnFilter( "1", 0, true ); > } else { > resultst.fnFilter( '', 0 ); > } >@@ -121,7 +120,7 @@ $(document).ready(function() { > <tbody> > [% FOREACH invoice IN invoices %] > <tr data-invoiceid="[% invoice.invoiceid %]" data-booksellerid="[% invoice.booksellerid %]" data-shipmentdate="[% invoice.shipmentdate | $KohaDates %]" data-billingdate="[% invoice.billingdate | $KohaDates %]" data-shipmentcost="[% invoice.shipmentcost %]" data-shipment_budgetid="[% invoice.shipmentcost_budgetid %]" data-closedate="[% invoice.closedate | $KohaDates %]"> >- <td>[% invoice.subscriptionid %]</td> >+ <td>[% invoice.is_linked_to_subscriptions %]</td> > <td><input type="checkbox" class="select-invoice" value="[% invoice.invoiceid %]"></input></td> > <td><a href="/cgi-bin/koha/acqui/invoice.pl?invoiceid=[% invoice.invoiceid %]">[% invoice.invoicenumber %]</a></td> > <td><a href="/cgi-bin/koha/acqui/supplier.pl?booksellerid=[% invoice.booksellerid %]">[% invoice.suppliername %]</a></td> >diff --git a/t/db_dependent/Acquisition/Invoices.t b/t/db_dependent/Acquisition/Invoices.t >index 78b7cfb..3e11a56 100644 >--- a/t/db_dependent/Acquisition/Invoices.t >+++ b/t/db_dependent/Acquisition/Invoices.t >@@ -177,6 +177,13 @@ DelInvoice($invoiceid3); > is(scalar @invoices, $invoicecount - 1, 'DelInvoice deletes invoice'); > is(GetInvoice($invoiceid3), undef, 'DelInvoice deleted correct invoice'); > >+my @invoices_linked_to_subscriptions = map{ >+ $_->{linked_to_subscriptions} >+ ? $_ >+ : () >+} @invoices; >+is_deeply( \@invoices_linked_to_subscriptions, [], "GetInvoices return linked_to_subscriptions: there is no invoices linked to subscriptions yet" ) >+ > END { > $dbh and $dbh->rollback; > } >-- >1.7.10.4
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 7288
:
13246
|
18537
|
21996
|
22048
|
22473
|
22516
|
23815
| 26065