Bugzilla – Attachment 41464 Details for
Bug 11371
Add a new report : Orders by budget
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Help
|
New Account
|
Log In
[x]
|
Forgot Password
Login:
[x]
[patch]
Bug11371 - QA fix
Bug11371---QA-fix.patch (text/plain), 10.41 KB, created by
Rémi Mayrand-Provencher
on 2015-08-12 14:32:02 UTC
(
hide
)
Description:
Bug11371 - QA fix
Filename:
MIME Type:
Creator:
Rémi Mayrand-Provencher
Created:
2015-08-12 14:32:02 UTC
Size:
10.41 KB
patch
obsolete
>From 0cf37008b03b05b93fb7542ff75053c6b30f141e Mon Sep 17 00:00:00 2001 >From: simith <simith@inlibro.com> >Date: Fri, 6 Mar 2015 08:59:13 -0500 >Subject: [PATCH] Bug11371 - QA fix > >http://bugs.koha-community.org/show_bug.cgi?id=11371 > >Signed-off-by: Nicole Engard <nengard@bywatersolutions.com> >--- > C4/Budgets.pm | 8 +++-- > .../prog/en/modules/reports/orders_by_budget.tt | 32 +++++++++++++++++--- > .../prog/en/modules/reports/reports-home.tt | 2 +- > reports/{orders_by_budget.pl => orders_by_fund.pl} | 9 +++--- > t/db_dependent/Budgets.t | 9 ++---- > 5 files changed, 41 insertions(+), 19 deletions(-) > rename reports/{orders_by_budget.pl => orders_by_fund.pl} (96%) > >diff --git a/C4/Budgets.pm b/C4/Budgets.pm >index 911d288..6c2cff0 100644 >--- a/C4/Budgets.pm >+++ b/C4/Budgets.pm >@@ -82,7 +82,6 @@ BEGIN { > > # ----------------------------BUDGETS.PM-----------------------------"; > >- > =head1 FUNCTIONS ABOUT BUDGETS > > =cut >@@ -463,6 +462,7 @@ sub GetBudgetPeriod { > } > > # ------------------------------------------------------------------- >+ > =head2 GetBudgetPeriodDescription > > $description = GetBudgetPeriodDescription($budget_id); >@@ -474,6 +474,7 @@ sub GetBudgetPeriod { > Description is fetched from aqbudgetperiods, id is compared aqbudgets. (INNER JOIN on budget_period_id) > > =cut >+ > sub GetBudgetPeriodDescription { > my ($budget_id) = @_; > my $dbh = C4::Context->dbh; >@@ -638,6 +639,7 @@ sub DelBudget { > > > # ------------------------------------------------------------------- >+ > =head2 GetBudget > > &GetBudget($budget_id); >@@ -750,6 +752,7 @@ sub GetBudgetsByActivity { > return @results; > } > # -------------------------------------------------------------------- >+ > =head2 GetBudgetsReport > > &GetBudgetsReport( [$activity] ); >@@ -1151,7 +1154,6 @@ sub ConvertCurrency { > return ( $price / $cur ); > } > >- > =head2 CloneBudgetPeriod > > my $new_budget_period_id = CloneBudgetPeriod({ >@@ -1383,4 +1385,4 @@ __END__ > > Koha Development Team <http://koha-community.org/> > >-=cut >+=cut >\ No newline at end of file >diff --git a/koha-tmpl/intranet-tmpl/prog/en/modules/reports/orders_by_budget.tt b/koha-tmpl/intranet-tmpl/prog/en/modules/reports/orders_by_budget.tt >index c2e1089..88371b9 100644 >--- a/koha-tmpl/intranet-tmpl/prog/en/modules/reports/orders_by_budget.tt >+++ b/koha-tmpl/intranet-tmpl/prog/en/modules/reports/orders_by_budget.tt >@@ -6,7 +6,14 @@ > [% INCLUDE 'header.inc' %] > [% INCLUDE 'cat-search.inc' %] > >-<div id="breadcrumbs"><a href="/cgi-bin/koha/mainpage.pl">Home</a> › <a href="/cgi-bin/koha/reports/reports-home.pl">Reports</a>[% IF ( get_orders ) %] › <a href="/cgi-bin/koha/reports/orders_by_budget.pl">Orders by fund</a> › Results[% ELSE %] › Orders by fund[% END %]</div> >+<link rel="stylesheet" type="text/css" href="[% themelang %]/css/datatables.css" /> >+[% INCLUDE 'datatables.inc' %] >+<script type="text/javascript"> >+ $(document).ready( function () { >+ $('#funds').DataTable($.extend(true, {}, dataTablesDefaults,{"sPaginationType": "full_numbers"})); >+ } ); >+</script> >+<div id="breadcrumbs"><a href="/cgi-bin/koha/mainpage.pl">Home</a> › <a href="/cgi-bin/koha/reports/reports-home.pl">Reports</a>[% IF ( get_orders ) %] › <a href="/cgi-bin/koha/reports/orders_by_fund.pl">Orders by fund</a> › Results[% ELSE %] › Orders by fund[% END %]</div> > > <div id="doc3" class="yui-t2"> > >@@ -29,10 +36,12 @@ > [% END %] > </div> > >- [% IF ( ordersloop ) %]<table> >+ [% IF ( ordersloop ) %]<table id="funds"> >+ <thead> > <tr> > <th>Fund</th> > <th>Basket</th> >+ <th>Basket Name</th> > <th>Basket By</th> > <th>Title</th> > <th>Currency</th> >@@ -46,6 +55,8 @@ > <th>Date Received</th> > <th>Notes</th> > </tr> >+ </thead> >+ <tbody> > [% FOREACH ordersloo IN ordersloop %] > [% UNLESS ( loop.odd ) %] > <tr class="highlight"> >@@ -56,6 +67,7 @@ > <td><a href="/cgi-bin/koha/acqui/basket.pl?basketno=[% ordersloo.basketno %]"> > [% ordersloo.basketno |html %] > </a></td> >+ <td>[% ordersloo.basketname |html %]</td> > <td>[% ordersloo.authorisedbyname %]</td> > <td><a href="/cgi-bin/koha/catalogue/detail.pl?biblionumber=[% ordersloo.biblionumber %]"> > [% ordersloo.title |html %] >@@ -72,12 +84,15 @@ > <td>[% ordersloo.notes |html %]</td> > </tr> > [% END %] >- <tr><th>TOTAL</th><th></th><th></th><th></th><th></th><th></th><th></th><th></th><th>[% total_quantity %]</th><th>[% total_rrp %]</th><th>[% total_ecost %]</th><th></th><th></th><th></th></tr> >+ </tbody> >+ <tfoot> >+ <tr><th>TOTAL</th><th></th><th></th><th></th><th></th><th></th><th></th><th></th><th></th><th>[% total_quantity %]</th><th>[% total_rrp %]</th><th>[% total_ecost %]</th><th></th><th></th><th></th></tr> >+ </tfoot> > </table> > [% END %] > [% ELSE %] > >- <form name="f" action="/cgi-bin/koha/reports/orders_by_budget.pl" method="post"> >+ <form name="f" action="/cgi-bin/koha/reports/orders_by_fund.pl" method="post"> > <fieldset class="rows"> > <legend>Filters</legend> > <ol><li><label for="budgetfilter">Fund (Budget): </label><select name="budgetfilter" id="budgetfilter"> >@@ -104,7 +119,14 @@ > </select> > <select id='sep' name='sep' size='1'> > [% FOREACH delimiterloo IN delimiterloop %] >- <option value="[% delimiterloo %]">[% delimiterloo %]</option> >+ [% IF delimiterloo == delimiterPreference %] >+ <option value="[% delimiterloo %]">[% delimiterloo %]</option> >+ [% END %] >+ [% END %] >+ [% FOREACH delimiterloo IN delimiterloop %] >+ [% IF delimiterloo != delimiterPreference %] >+ <option value="[% delimiterloo %]">[% delimiterloo %]</option> >+ [% END %] > [% END %] > </select> > </li></ol> >diff --git a/koha-tmpl/intranet-tmpl/prog/en/modules/reports/reports-home.tt b/koha-tmpl/intranet-tmpl/prog/en/modules/reports/reports-home.tt >index e19178b..05f7f8d 100644 >--- a/koha-tmpl/intranet-tmpl/prog/en/modules/reports/reports-home.tt >+++ b/koha-tmpl/intranet-tmpl/prog/en/modules/reports/reports-home.tt >@@ -61,7 +61,7 @@ > <h2>Other</h2> > <ul> > <li><a href="/cgi-bin/koha/reports/itemslost.pl">Items lost</a></li> >- <li><a href="/cgi-bin/koha/reports/orders_by_budget.pl">Orders by fund</a></li> >+ <li><a href="/cgi-bin/koha/reports/orders_by_fund.pl">Orders by fund</a></li> > <li><a href="/cgi-bin/koha/reports/manager.pl?report_name=itemtypes">Catalog by itemtype</a></li> > <li><a href="/cgi-bin/koha/reports/issues_avg_stats.pl">Average loan time</a></li> > <li><a href="http://schema.koha-community.org/" target="blank">Koha database schema</a></li> >diff --git a/reports/orders_by_budget.pl b/reports/orders_by_fund.pl >similarity index 96% >rename from reports/orders_by_budget.pl >rename to reports/orders_by_fund.pl >index e31bb2d..a8fc2a7 100755 >--- a/reports/orders_by_budget.pl >+++ b/reports/orders_by_fund.pl >@@ -35,7 +35,6 @@ use C4::Budgets; > use C4::Biblio; > use C4::Reports; > use C4::Dates qw/format_date/; >-use C4::SQLHelper qw<:all>; > use C4::Acquisition; #GetBasket() > > >@@ -103,6 +102,7 @@ if ( $get_orders ) { > my $biblio = C4::Biblio::GetBiblio($order->{'biblionumber'}); > my $basket = C4::Acquisition::GetBasket($order->{'basketno'}); > >+ $order->{'basketname'} = $basket->{'basketname'}; > $order->{'authorisedbyname'} = $basket->{'authorisedbyname'}; > > $order->{'title'} = $biblio->{'title'} || $order->{'biblionumber'}; >@@ -164,6 +164,7 @@ if ( $get_orders ) { > my @row; > push(@row, _surround($order->{'budget_name'})); > push(@row, _surround($order->{'basketno'})); >+ push(@row, _surround($order->{'basketname'})); > push(@row, _surround($order->{'authorisedbyname'})); > push(@row, _surround($order->{'biblionumber'})); > push(@row, _surround($order->{'title'})); >@@ -196,7 +197,7 @@ if ( $get_orders ) { > else { > # Set file export choices > my @outputFormats = ('CSV'); >- my @CSVdelimiters = qw(; tabulation , \\ / #); >+ my @CSVdelimiters =(',','#',qw(; tabulation \\ /)); > > # getting all budgets > # active budgets >@@ -222,10 +223,10 @@ else { > ); > push @budgetsloop, \%row; > } >- > $template->param( budgetsloop => \@budgetsloop, > outputFormatloop => \@outputFormats, >- delimiterloop => \@CSVdelimiters >+ delimiterloop => \@CSVdelimiters, >+ delimiterPreference => C4::Context->preference('delimiter') > ); > } > >diff --git a/t/db_dependent/Budgets.t b/t/db_dependent/Budgets.t >index e5800a4..aae15ac 100755 >--- a/t/db_dependent/Budgets.t >+++ b/t/db_dependent/Budgets.t >@@ -1,3 +1,4 @@ >+#!/usr/bin/perl > use Modern::Perl; > use Test::More tests => 120; > >@@ -432,23 +433,20 @@ ok($bpid=AddBudgetPeriod( > { budget_period_startdate =>'01-01-2008' > , budget_period_enddate =>'31-12-2008' > , budget_period_description =>"MAPERI" >- , budget_period_active =>1 >- , budget_description =>"MAPERI"}), >+ , budget_period_active =>1}), > "AddBudgetPeriod returned $bpid"); > } elsif (C4::Context->preference('dateformat') eq "us"){ > ok($bpid=AddBudgetPeriod( > { budget_period_startdate =>'01-01-2008' > , budget_period_enddate =>'12-31-2008' > , budget_period_description =>"MAPERI" >- , budget_period_active =>1 >- , budget_description =>"MAPERI"}), >+ , budget_period_active =>1}), > "AddBudgetPeriod returned $bpid"); > } > else{ > ok($bpid=AddBudgetPeriod( > {budget_period_startdate=>'2008-01-01' > ,budget_period_enddate =>'2008-12-31' >- ,budget_description =>"MAPERI" > ,budget_period_active =>1 > ,budget_period_description =>"MAPERI" > }), >@@ -497,7 +495,6 @@ ok($second_budget_id=AddBudget( > budget_amount => "500.00", > budget_name => "Art", > budget_notes => "This is a note", >- budget_description=> "Art", > budget_active => 1, > budget_period_id => $bpid, > } >-- >1.7.9.5
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 11371
:
23381
|
25397
|
25913
|
25915
|
30545
|
30546
|
35385
|
36620
|
36707
|
37010
|
37011
|
41463
|
41464
|
45243
|
45244
|
45245
|
45288
|
45338
|
45887
|
45890
|
45981
|
45982
|
50230
|
50231
|
50233
|
50466
|
50468
|
50769