Lines 134-139
sub AddBudgetPeriod {
Link Here
|
134 |
my ($budgetperiod) = @_; |
134 |
my ($budgetperiod) = @_; |
135 |
return unless($budgetperiod->{budget_period_startdate} && $budgetperiod->{budget_period_enddate}); |
135 |
return unless($budgetperiod->{budget_period_startdate} && $budgetperiod->{budget_period_enddate}); |
136 |
|
136 |
|
|
|
137 |
undef $budgetperiod->{budget_period_id}; |
137 |
my $resultset = Koha::Database->new()->schema->resultset('Aqbudgetperiod'); |
138 |
my $resultset = Koha::Database->new()->schema->resultset('Aqbudgetperiod'); |
138 |
return $resultset->create($budgetperiod)->id; |
139 |
return $resultset->create($budgetperiod)->id; |
139 |
} |
140 |
} |
Lines 633-638
sub AddBudget {
Link Here
|
633 |
my ($budget) = @_; |
634 |
my ($budget) = @_; |
634 |
return unless ($budget); |
635 |
return unless ($budget); |
635 |
|
636 |
|
|
|
637 |
undef $budget->{budget_encumb} if $budget->{budget_encumb} eq ''; |
638 |
undef $budget->{budget_owner_id} if $budget->{budget_owner_id} eq ''; |
636 |
my $resultset = Koha::Database->new()->schema->resultset('Aqbudget'); |
639 |
my $resultset = Koha::Database->new()->schema->resultset('Aqbudget'); |
637 |
return $resultset->create($budget)->id; |
640 |
return $resultset->create($budget)->id; |
638 |
} |
641 |
} |
Lines 643-648
sub ModBudget {
Link Here
|
643 |
my $result = Koha::Database->new()->schema->resultset('Aqbudget')->find($budget); |
646 |
my $result = Koha::Database->new()->schema->resultset('Aqbudget')->find($budget); |
644 |
return unless($result); |
647 |
return unless($result); |
645 |
|
648 |
|
|
|
649 |
undef $budget->{budget_encumb} if $budget->{budget_encumb} eq ''; |
650 |
undef $budget->{budget_owner_id} if $budget->{budget_owner_id} eq ''; |
646 |
$result = $result->update($budget); |
651 |
$result = $result->update($budget); |
647 |
return $result->in_storage; |
652 |
return $result->in_storage; |
648 |
} |
653 |
} |
649 |
- |
|
|