4 use Test::More tests => 4;
9 my $supplierlist=eval{GetSuppliersWithLateIssues()};
10 ok(length($@)==0,"No SQL problem in GetSuppliersWithLateIssues");
14 my $bpid = AddBudgetPeriod({
15 budget_period_startdate => '01-01-2015',
16 budget_period_enddate => '31-12-2015',
17 budget_description => "budget desc"
20 my $budget_id = AddBudget({
21 budget_code => "ABCD",
22 budget_amount => "123.132",
23 budget_name => "Périodiques",
24 budget_notes => "This is a note",
25 budget_description => "Serials",
27 budget_period_id => $bpid
30 my $subscriptionid = NewSubscription(
31 undef, "", undef, undef, $budget_id, $biblionumber, '01-01-2013',undef,
32 undef, undef, undef, undef, undef, undef, undef, undef,
33 undef, undef, undef, undef, undef, undef, undef, undef,
34 undef, undef, undef, undef, undef, undef, undef, 1,
35 "notes", undef, undef, undef, undef, undef, undef, 0,
36 "intnotes", 0, undef, undef, 0, undef, '31-12-2013',
38 die unless $subscriptionid;
40 # Can edit a subscription
52 C4::Context->_new_userenv ('DUMMY_SESSION_ID');
53 C4::Context->set_userenv ( @USERENV );
54 my $userenv = C4::Context->userenv;
56 my $subscription = GetSubscription( $subscriptionid );
58 is( C4::Serials::can_edit_subscription($subscription), 1, "User can edit a subscription with an empty branchcode");
59 #TODO add UT when C4::Auth->set_permissions (or setuserflags) will exist.
63 DelSubscription( $subscription->{subscriptionid} );
64 DelBudgetPeriod($bpid);
65 DelBudget($budget_id);