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

(-)a/t/db_dependent/Acquisition.t (-11 / +19 lines)
Lines 19-25 use Modern::Perl; Link Here
19
19
20
use POSIX qw(strftime);
20
use POSIX qw(strftime);
21
21
22
use Test::More tests => 66;
22
use Test::More tests => 70;
23
use t::lib::Mocks;
23
use t::lib::Mocks;
24
use Koha::Database;
24
use Koha::Database;
25
use Koha::DateUtils qw(dt_from_string output_pref);
25
use Koha::DateUtils qw(dt_from_string output_pref);
Lines 173-179 my ( $biblionumber5, $biblioitemnumber5 ) = AddBiblio( MARC::Record->new, '' ); Link Here
173
173
174
174
175
175
176
# Prepare 5 orders, and make distinction beween fields to be tested with eq and with ==
176
# Prepare 6 orders, and make distinction beween fields to be tested with eq and with ==
177
# Ex : a price of 50.1 will be stored internally as 5.100000
177
# Ex : a price of 50.1 will be stored internally as 5.100000
178
178
179
my @order_content = (
179
my @order_content = (
Lines 183-190 my @order_content = ( Link Here
183
            biblionumber   => $biblionumber1,
183
            biblionumber   => $biblionumber1,
184
            budget_id      => $budget->{budget_id},
184
            budget_id      => $budget->{budget_id},
185
            uncertainprice => 0,
185
            uncertainprice => 0,
186
            order_internalnote => "internal note",
186
            order_internalnote => "internal note foo",
187
            order_vendornote   => "vendor note",
187
            order_vendornote   => "vendor note bar",
188
            ordernumber => '',
188
            ordernumber => '',
189
        },
189
        },
190
        num => {
190
        num => {
Lines 209-216 my @order_content = ( Link Here
209
            biblionumber   => $biblionumber2,
209
            biblionumber   => $biblionumber2,
210
            budget_id      => $budget->{budget_id},
210
            budget_id      => $budget->{budget_id},
211
            uncertainprice => 0,
211
            uncertainprice => 0,
212
            order_internalnote => "internal note",
212
            order_internalnote => "internal note foo",
213
            order_vendornote   => "vendor note"
213
            order_vendornote   => "vendor note bar"
214
        },
214
        },
215
        num => {
215
        num => {
216
            quantity  => 4,
216
            quantity  => 4,
Lines 246-253 my @order_content = ( Link Here
246
            basketno     => $basketno,
246
            basketno     => $basketno,
247
            biblionumber => $biblionumber4,
247
            biblionumber => $biblionumber4,
248
            budget_id    => $budget->{budget_id},
248
            budget_id    => $budget->{budget_id},
249
            order_internalnote => "internal note",
249
            order_internalnote => "internal note bar",
250
            order_vendornote   => "vendor note"
250
            order_vendornote   => "vendor note foo"
251
        },
251
        },
252
        num => {
252
        num => {
253
            quantity       => 1,
253
            quantity       => 1,
Lines 281-287 my @order_content = ( Link Here
281
    }
281
    }
282
);
282
);
283
283
284
# Create 5 orders in database
284
# Create 6 orders in database
285
for ( 0 .. 5 ) {
285
for ( 0 .. 5 ) {
286
    my %ocontent;
286
    my %ocontent;
287
    @ocontent{ keys %{ $order_content[$_]->{num} } } =
287
    @ocontent{ keys %{ $order_content[$_]->{num} } } =
Lines 444-450 is( $order2->{order_internalnote}, "my notes", Link Here
444
my $order1 = GetOrder( $ordernumbers[0] );
444
my $order1 = GetOrder( $ordernumbers[0] );
445
is(
445
is(
446
    $order1->{order_internalnote},
446
    $order1->{order_internalnote},
447
    "internal note",
447
    "internal note foo",
448
    "ModReceiveOrder only changes the supplied orders internal notes"
448
    "ModReceiveOrder only changes the supplied orders internal notes"
449
);
449
);
450
450
Lines 466-471 is( scalar( @$orders ), 1, 'GetHistory with a given ordernumbers returns 1 order Link Here
466
$orders = GetHistory( ordernumbers => \@ordernumbers );
466
$orders = GetHistory( ordernumbers => \@ordernumbers );
467
is( scalar( @$orders ), scalar( @ordernumbers ) - 1, 'GetHistory with a list of ordernumbers returns N-1 orders (was has been deleted [3])' );
467
is( scalar( @$orders ), scalar( @ordernumbers ) - 1, 'GetHistory with a list of ordernumbers returns N-1 orders (was has been deleted [3])' );
468
468
469
$orders = GetHistory( internalnote => 'internal note foo' );
470
is( scalar( @$orders ), 2, 'GetHistory returns correctly a search for internalnote' );
471
$orders = GetHistory( vendornote => 'vendor note bar' );
472
is( scalar( @$orders ), 2, 'GetHistory returns correctly a search for vendornote' );
473
$orders = GetHistory( internalnote => 'internal note bar' );
474
is( scalar( @$orders ), 1, 'GetHistory returns correctly a search for internalnote' );
475
$orders = GetHistory( vendornote => 'vendor note foo' );
476
is( scalar( @$orders ), 1, 'GetHistory returns correctly a search for vendornote' );
477
469
478
470
# Test GetHistory() with and without SearchWithISBNVariations
479
# Test GetHistory() with and without SearchWithISBNVariations
471
# The ISBN passed as a param is the ISBN-10 version of the 13-digit ISBN in the sample record declared in $marcxml
480
# The ISBN passed as a param is the ISBN-10 version of the 13-digit ISBN in the sample record declared in $marcxml
472
- 

Return to bug 27287