On the basket editing screen, the links to add orders to a basket are
hidden unless a valid fund is available.
Signed-off-by: Katrin Fischer <Katrin.Fischer.83@web.de>
Signed-off-by: Paul Poulain <paul.poulain@biblibre.com>
Signed-off-by: Chris Cormack <chrisc@catalyst.net.nz>
+=head2 GetChildBudgetsSpent
- &GetBudgets($filter, $order_by);
+ &GetChildBudgetsSpent($budget-id);
+gets the total spent of the level and sublevels of $budget_id
-=head2 GetChildBudgetsSpent
- &GetChildBudgetsSpent($budget-id);
+ &GetBudgets($filter, $order_by);
-gets the total spent of the level and sublevels of $budget_id
my $contract = &GetContract($basket->{contractnumber});
my @orders = GetOrders($basketno);
my $contract = &GetContract($basket->{contractnumber});
my @orders = GetOrders($basketno);
+
+ my $borrower= GetMember('borrowernumber' => $loggedinuser);
+ my $budgets = GetBudgetHierarchy(q{},$borrower->{branchcode},$borrower->{borrowernumber});
+ my $has_budgets = 0;
+ foreach my $r (@{$budgets}) {
+ if (!defined $r->{budget_amount} || $r->{budget_amount} == 0) {
+ next;
+ }
+ $has_budgets = 1;
+ last;
+ }
+
$template->param(
basketno => $basketno,
basketname => $basket->{'basketname'},
$template->param(
basketno => $basketno,
basketname => $basket->{'basketname'},
basketgroups => $basketgroups,
grouped => $basket->{basketgroupid},
unclosable => @orders ? 0 : 1,
basketgroups => $basketgroups,
grouped => $basket->{basketgroupid},
unclosable => @orders ? 0 : 1,
+ has_budgets => $has_budgets,
my $input = new CGI;
my $booksellerid = $input->param('booksellerid'); # FIXME: else ERROR!
my $input = new CGI;
my $booksellerid = $input->param('booksellerid'); # FIXME: else ERROR!
-my $budget_id = $input->param('budget_id') || 0; # FIXME: else ERROR!
+my $budget_id = $input->param('budget_id') || 0;
my $title = $input->param('title');
my $author = $input->param('author');
my $publicationyear = $input->param('publicationyear');
my $title = $input->param('title');
my $author = $input->param('author');
my $publicationyear = $input->param('publicationyear');