use POSIX qw(strftime);
-use Test::More tests => 87;
+use Test::More tests => 91;
use Koha::Database;
BEGIN {
);
ok( $basket = GetBasket($basketno), "GetBasket($basketno) returns $basket" );
+my $bpid=AddBudgetPeriod({
+ budget_period_startdate => '2008-01-01'
+ , budget_period_enddate => '2008-12-31'
+ , budget_period_active => 1
+ , budget_period_description => "MAPERI"
+});
+
my $budgetid = C4::Budgets::AddBudget(
{
budget_code => "budget_code_test_getordersbybib",
budget_name => "budget_name_test_getordersbybib",
+ budget_period_id => $bpid,
}
);
my $budget = C4::Budgets::GetBudget($budgetid);
gstrate
discount
budget_id
- budgetgroup_id
budgetdate
sort1
sort2
publicationyear
collectiontitle
invoiceid
- budgetgroup_id
place
issn
quantityreceived
title
closedate
basketname
- budgetgroup_id
invoiceid
author
parent_ordernumber
ok((not defined GetBiblio($order4->{biblionumber})), "biblio does not exist anymore");
# End of tests for DelOrder
+# Budget reports
+my $all_count = scalar GetBudgetsReport();
+ok($all_count >= 1, "GetBudgetReport OK");
+
+my $active_count = scalar GetBudgetsReport(1);
+ok($active_count >= 1 , "GetBudgetsReport(1) OK");
+
+is($all_count, scalar GetBudgetsReport(), "GetBudgetReport returns inactive budget period acquisitions.");
+ok($active_count >= scalar GetBudgetsReport(1), "GetBudgetReport doesn't return inactive budget period acquisitions.");
+
$schema->storage->txn_rollback();