View | Details | Raw Unified | Return to bug 8037
Collapse All | Expand All

(-)a/C4/Reserves.pm (-2 / +1 lines)
Lines 257-263 sub GetReservesFromBiblionumber { Link Here
257
    my ($biblionumber) = shift or return (0, []);
257
    my ($biblionumber) = shift or return (0, []);
258
    my ($all_dates) = shift;
258
    my ($all_dates) = shift;
259
    my ($itemnumber) = shift;
259
    my ($itemnumber) = shift;
260
    warn "ITEMNUMBER: $itemnumber";
261
    my $dbh   = C4::Context->dbh;
260
    my $dbh   = C4::Context->dbh;
262
261
263
    # Find the desired items in the reserves
262
    # Find the desired items in the reserves
Lines 281-287 sub GetReservesFromBiblionumber { Link Here
281
        WHERE biblionumber = ? ";
280
        WHERE biblionumber = ? ";
282
    push( @params, $biblionumber );
281
    push( @params, $biblionumber );
283
    unless ( $all_dates ) {
282
    unless ( $all_dates ) {
284
        $query .= " AND reservedate <= CURRENT_DATE() ";
283
        $query .= " AND reservedate <= CAST(NOW() AS DATE) ";
285
    }
284
    }
286
    if ( $itemnumber ) {
285
    if ( $itemnumber ) {
287
        $query .= " AND ( itemnumber IS NULL OR itemnumber = ? )";
286
        $query .= " AND ( itemnumber IS NULL OR itemnumber = ? )";
(-)a/t/db_dependent/Budgets.t (-3 / +5 lines)
Lines 1-6 Link Here
1
use strict;
1
use strict;
2
use warnings;
2
use warnings;
3
use Test::More tests=>17;
3
use Test::More tests=>18;
4
4
5
BEGIN {use_ok('C4::Budgets') }
5
BEGIN {use_ok('C4::Budgets') }
6
use C4::Budgets;
6
use C4::Budgets;
Lines 86-91 ok($budget_id=AddBudget( Link Here
86
#| budget_owner_id        | int(11)       | YES  |     | NULL              |       | 
86
#| budget_owner_id        | int(11)       | YES  |     | NULL              |       | 
87
#| budget_permission      | int(1)        | YES  |     | 0                 |       | 
87
#| budget_permission      | int(1)        | YES  |     | 0                 |       | 
88
88
89
C4::Context::dbh->do('INSERT INTO aqorders ( ordernumber, budget_id ) VALUES ( 987654321, ? )', {}, ( $budget_id ) );
90
ok( GetBudgetByOrderNumber( '987654321' )->{'budget_id'} eq $budget_id, "GetBudgetByOrderNumber returns valid data" );
91
C4::Context::dbh->do('DELETE FROM aqorders WHERE ordernumber = 987654321');
92
89
my $budget;
93
my $budget;
90
ok($budget=GetBudget($budget_id) ,"GetBudget OK");
94
ok($budget=GetBudget($budget_id) ,"GetBudget OK");
91
$$budget{budget_permission}=1;
95
$$budget{budget_permission}=1;
Lines 102-105 ok(GetBudgets({budget_period_id=>GetBudgetPeriod($bpid)->{budget_period_id}},[{" Link Here
102
ok($del_status=DelBudget($budget_id),
106
ok($del_status=DelBudget($budget_id),
103
	"DelBudget returned $del_status");
107
	"DelBudget returned $del_status");
104
108
105
106
- 

Return to bug 8037