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

(-)a/C4/SIP/Sip/MsgType.pm (-1 / +8 lines)
Lines 21-26 use C4::Auth qw(&check_api_auth); Link Here
21
use Koha::Patrons;
21
use Koha::Patrons;
22
use Koha::Patron::Attributes;
22
use Koha::Patron::Attributes;
23
use Koha::Items;
23
use Koha::Items;
24
use Koha::DateUtils qw( output_pref );
24
25
25
use UNIVERSAL::can;
26
use UNIVERSAL::can;
26
27
Lines 562-568 sub handle_checkout { Link Here
562
        $resp .= add_field( FID_ITEM_ID,   $item_id, $server );
563
        $resp .= add_field( FID_ITEM_ID,   $item_id, $server );
563
        $resp .= add_field( FID_TITLE_ID,  $item->title_id, $server );
564
        $resp .= add_field( FID_TITLE_ID,  $item->title_id, $server );
564
        if ( $item->due_date ) {
565
        if ( $item->due_date ) {
565
            $resp .= add_field( FID_DUE_DATE, timestamp( $item->due_date ), $server );
566
            my $due_date;
567
            if( $account->{format_due_date} ){
568
                $due_date = output_pref({ str => $item->due_date, as_due_date => 1 });
569
            } else {
570
                $due_date = timestamp( $item->due_date );
571
            }
572
            $resp .= add_field( FID_DUE_DATE, $due_date, $server );
566
        } else {
573
        } else {
567
            $resp .= add_field( FID_DUE_DATE, q{}, $server );
574
            $resp .= add_field( FID_DUE_DATE, q{}, $server );
568
        }
575
        }
(-)a/t/db_dependent/SIP/Message.t (-2 / +10 lines)
Lines 71-77 subtest 'Testing Patron Info Request V2' => sub { Link Here
71
subtest 'Checkout V2' => sub {
71
subtest 'Checkout V2' => sub {
72
    my $schema = Koha::Database->new->schema;
72
    my $schema = Koha::Database->new->schema;
73
    $schema->storage->txn_begin;
73
    $schema->storage->txn_begin;
74
    plan tests => 3;
74
    plan tests => 5;
75
    $C4::SIP::Sip::protocol_version = 2;
75
    $C4::SIP::Sip::protocol_version = 2;
76
    test_checkout_v2();
76
    test_checkout_v2();
77
    $schema->storage->txn_rollback;
77
    $schema->storage->txn_rollback;
Lines 614-619 sub test_checkout_v2 { Link Here
614
    $msg->handle_checkout( $server );
614
    $msg->handle_checkout( $server );
615
    $respcode = substr( $response, 0, 2 );
615
    $respcode = substr( $response, 0, 2 );
616
    is( Koha::Checkouts->search({ itemnumber => $item_object->id })->count, 1, "Item was checked out (prevcheckout_block_checkout disabled)");
616
    is( Koha::Checkouts->search({ itemnumber => $item_object->id })->count, 1, "Item was checked out (prevcheckout_block_checkout disabled)");
617
618
    $msg->handle_checkout( $server );
619
    ok( $response =~ m/AH\d{8}    \d{6}/, "Found AH field as timestamp in response");
620
    $server->{account}->{format_due_date} = 1;
621
    t::lib::Mocks::mock_preference( 'dateFormat',  'sql' );
622
    undef $response;
623
    $msg->handle_checkout( $server );
624
    ok( $response =~ m/AH\d{4}-\d{2}-\d{2}/, "Found AH field as SQL date in response");
625
617
}
626
}
618
627
619
sub test_checkin_v2 {
628
sub test_checkin_v2 {
620
- 

Return to bug 28730