4 use Test::More tests => 4;
9 my $dbh = C4::Context->dbh;
10 $dbh->{AutoCommit} = 0;
11 $dbh->{RaiseError} = 1;
13 my $supplierlist=eval{GetSuppliersWithLateIssues()};
14 ok(length($@)==0,"No SQL problem in GetSuppliersWithLateIssues");
18 my $bpid = AddBudgetPeriod({
19 budget_period_startdate => '01-01-2015',
20 budget_period_enddate => '31-12-2015',
21 budget_description => "budget desc"
24 my $budget_id = AddBudget({
25 budget_code => "ABCD",
26 budget_amount => "123.132",
27 budget_name => "Périodiques",
28 budget_notes => "This is a note",
29 budget_description => "Serials",
31 budget_period_id => $bpid
34 my $subscriptionid = NewSubscription(
35 undef, "", undef, undef, $budget_id, $biblionumber, '01-01-2013',undef,
36 undef, undef, undef, undef, undef, undef, undef, undef,
37 undef, undef, undef, undef, undef, undef, undef, undef,
38 undef, undef, undef, undef, undef, undef, undef, 1,
39 "notes", undef, undef, undef, undef, undef, undef, 0,
40 "intnotes", 0, undef, undef, 0, undef, '31-12-2013',
42 die unless $subscriptionid;
44 # Can edit a subscription
56 C4::Context->_new_userenv ('DUMMY_SESSION_ID');
57 C4::Context->set_userenv ( @USERENV );
58 my $userenv = C4::Context->userenv;
60 my $subscription = GetSubscription( $subscriptionid );
62 is( C4::Serials::can_edit_subscription($subscription), 1, "User can edit a subscription with an empty branchcode");
63 #TODO add UT when C4::Auth->set_permissions (or setuserflags) will exist.