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

(-)a/t/db_dependent/Koha/MarcOrder.t (-9 / +26 lines)
Lines 242-247 subtest 'add_items_from_import_record() - addorderiso2709.pl' => sub { Link Here
242
242
243
    $schema->storage->txn_begin;
243
    $schema->storage->txn_begin;
244
244
245
    my $branch     = $builder->build_object( { class => 'Koha::Libraries' } );
246
    my $branchcode = $branch->branchcode;
247
245
    my $bpid = C4::Budgets::AddBudgetPeriod(
248
    my $bpid = C4::Budgets::AddBudgetPeriod(
246
        {
249
        {
247
            budget_period_startdate => '2008-01-01', budget_period_enddate => '2008-12-31'
250
            budget_period_startdate => '2008-01-01', budget_period_enddate => '2008-12-31'
Lines 271-277 subtest 'add_items_from_import_record() - addorderiso2709.pl' => sub { Link Here
271
    my $sample_import_batch = {
274
    my $sample_import_batch = {
272
        matcher_id     => 1,
275
        matcher_id     => 1,
273
        template_id    => 1,
276
        template_id    => 1,
274
        branchcode     => 'CPL',
277
        branchcode     => $branchcode,
275
        overlay_action => 'create_new',
278
        overlay_action => 'create_new',
276
        nomatch_action => 'create_new',
279
        nomatch_action => 'create_new',
277
        item_action    => 'always_add',
280
        item_action    => 'always_add',
Lines 317-322 subtest 'add_items_from_import_record() - addorderiso2709.pl' => sub { Link Here
317
        }
320
        }
318
    )->store;
321
    )->store;
319
322
323
    my $basket = $builder->build_object(
324
        {
325
            class => "Koha::Acquisition::Baskets",
326
            value => {
327
                booksellerid => $bookseller->id,
328
                create_items => 'ordering',
329
                is_standing  => 0,
330
                closedate    => undef
331
            }
332
        }
333
    );
334
320
    my $client_item_fields = {
335
    my $client_item_fields = {
321
        'notforloans' => [
336
        'notforloans' => [
322
            '',
337
            '',
Lines 349-364 subtest 'add_items_from_import_record() - addorderiso2709.pl' => sub { Link Here
349
            ''
364
            ''
350
        ],
365
        ],
351
        'homebranches' => [
366
        'homebranches' => [
352
            'CPL',
367
            $branchcode,
353
            'CPL'
368
            $branchcode
354
        ],
369
        ],
355
        'copynos' => [
370
        'copynos' => [
356
            '',
371
            '',
357
            ''
372
            ''
358
        ],
373
        ],
359
        'holdingbranches' => [
374
        'holdingbranches' => [
360
            'CPL',
375
            $branchcode,
361
            'CPL'
376
            $branchcode
362
        ],
377
        ],
363
        'ccodes' => [
378
        'ccodes' => [
364
            '',
379
            '',
Lines 389-395 subtest 'add_items_from_import_record() - addorderiso2709.pl' => sub { Link Here
389
    my $itemnumbers = Koha::MarcOrder::add_items_from_import_record(
404
    my $itemnumbers = Koha::MarcOrder::add_items_from_import_record(
390
        {
405
        {
391
            record_result      => $result->{record_result},
406
            record_result      => $result->{record_result},
392
            basket_id          => 1,
407
            basket_id          => $basket->basketno,
393
            vendor             => $bookseller,
408
            vendor             => $bookseller,
394
            budget_id          => $budgetid,
409
            budget_id          => $budgetid,
395
            agent              => 'client',
410
            agent              => 'client',
Lines 397-410 subtest 'add_items_from_import_record() - addorderiso2709.pl' => sub { Link Here
397
        }
412
        }
398
    );
413
    );
399
414
400
    my $orders = Koha::Acquisition::Orders->search()->unblessed;
415
    my $orders =
416
        Koha::Acquisition::Orders->search( { biblionumber => $result->{record_result}->{biblionumber} } )->unblessed;
401
417
402
    is(
418
    is(
403
        @{$orders}[0]->{rrp} + 0, '10',
419
        @{$orders}[0]->{rrp} + 0, '10',
404
        "Price has been read correctly"
420
        "Price has been read correctly"
405
    );
421
    );
422
423
    my $active_currency = Koha::Acquisition::Currencies->get_active;
406
    is(
424
    is(
407
        @{$orders}[0]->{listprice} + 0, '10',
425
        sprintf( "%.6f", @{$orders}[0]->{listprice} + 0 ), sprintf( "%.6f", 10 / $active_currency->rate + 0 ),
408
        "Listprice has been created successfully"
426
        "Listprice has been created successfully"
409
    );
427
    );
410
    is(
428
    is(
411
- 

Return to bug 35026