&ModBudget
&DelBudget
&GetBudgetSpent
+ &GetBudgetOrdered
&GetPeriodsCount
&GetBudgetPeriod
my ($budget_id) = @_;
my $dbh = C4::Context->dbh;
my $sth = $dbh->prepare(qq|
- SELECT SUM(ecost * quantity ) AS sum FROM aqorders
+ SELECT SUM(ecost * quantity) AS sum FROM aqorders
WHERE budget_id = ? AND
- datecancellationprinted IS NULL
+ quantityreceived > 0 AND
+ datecancellationprinted IS NULL
+ |);
+
+ $sth->execute($budget_id);
+ my $sum = $sth->fetchrow_array;
+ return $sum;
+}
+
+# -------------------------------------------------------------------
+sub GetBudgetOrdered {
+ my ($budget_id) = @_;
+ my $dbh = C4::Context->dbh;
+ my $sth = $dbh->prepare(qq|
+ SELECT SUM(ecost * quantity) AS sum FROM aqorders
+ WHERE budget_id = ? AND
+ quantityreceived = 0 AND
+ datecancellationprinted IS NULL
|);
$sth->execute($budget_id);
return $rc;
}
-=back
-
=head2 FUNCTIONS ABOUT BUDGETS
=over 2
=cut
+=back
+
=head3 GetBudget
=over 4
return ( $price / $cur );
}
-=item
+=head3 _columns
+
returns an array containing fieldname followed by PRI as value if PRIMARY Key
+
=cut
+
sub _columns(;$) {
my $tablename=shift||"aqbudgets";
return @{C4::Context->dbh->selectcol_arrayref("SHOW columns from $tablename",{Columns=>[1,4]})};
1;
__END__
-=back
-
=head1 AUTHOR
Koha Developement team <info@koha.org>