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

(-)a/C4/Circulation.pm (-3 / +3 lines)
Lines 1552-1562 sub AddIssue { Link Here
1552
                    biblio_id => $item_object->biblionumber,
1552
                    biblio_id => $item_object->biblionumber,
1553
                    borrowernumber => $borrower->{'borrowernumber'},
1553
                    borrowernumber => $borrower->{'borrowernumber'},
1554
                    completed => undef,
1554
                    completed => undef,
1555
                    date_due => { '!=', undef },
1555
                    due_date => { '!=', undef },
1556
                })->next;
1556
                })->next;
1557
1557
1558
                if ( $ill_request and length( $ill_request->date_due ) > 0 ) {
1558
                if ( $ill_request and length( $ill_request->due_date ) > 0 ) {
1559
                    my $ill_dt = dt_from_string( $ill_request->date_due );
1559
                    my $ill_dt = dt_from_string( $ill_request->due_date );
1560
                    $ill_dt->set_hour(23);
1560
                    $ill_dt->set_hour(23);
1561
                    $ill_dt->set_minute(59);
1561
                    $ill_dt->set_minute(59);
1562
                    $datedue = $ill_dt;
1562
                    $datedue = $ill_dt;
(-)a/installer/data/mysql/atomicupdate/bug_24239-add_date_due_to_illrequests.pl (-2 / +2 lines)
Lines 2-15 use Modern::Perl; Link Here
2
2
3
return {
3
return {
4
    bug_number => "24239",
4
    bug_number => "24239",
5
    description => "Add date_due to illrequests",
5
    description => "Add due_date to illrequests",
6
    up => sub {
6
    up => sub {
7
        my ($args) = @_;
7
        my ($args) = @_;
8
        my ($dbh, $out) = @$args{qw(dbh out)};
8
        my ($dbh, $out) = @$args{qw(dbh out)};
9
        # Do you stuffs here
9
        # Do you stuffs here
10
        $dbh->do(q{
10
        $dbh->do(q{
11
            ALTER TABLE `illrequests`
11
            ALTER TABLE `illrequests`
12
            ADD `date_due` datetime DEFAULT NULL AFTER `biblio_id`
12
            ADD `due_date` datetime DEFAULT NULL AFTER `biblio_id`
13
        });
13
        });
14
    },
14
    },
15
};
15
};
(-)a/installer/data/mysql/kohastructure.sql (-1 / +1 lines)
Lines 2792-2798 CREATE TABLE `illrequests` ( Link Here
2792
  `illrequest_id` bigint(20) unsigned NOT NULL AUTO_INCREMENT COMMENT 'ILL request number',
2792
  `illrequest_id` bigint(20) unsigned NOT NULL AUTO_INCREMENT COMMENT 'ILL request number',
2793
  `borrowernumber` int(11) DEFAULT NULL COMMENT 'Patron associated with request',
2793
  `borrowernumber` int(11) DEFAULT NULL COMMENT 'Patron associated with request',
2794
  `biblio_id` int(11) DEFAULT NULL COMMENT 'Potential bib linked to request',
2794
  `biblio_id` int(11) DEFAULT NULL COMMENT 'Potential bib linked to request',
2795
  `date_due` datetime DEFAULT NULL COMMENT 'Custom date due specified by backend, leave NULL for default date_due calculation',
2795
  `due_date` datetime DEFAULT NULL COMMENT 'Custom date due specified by backend, leave NULL for default date_due calculation',
2796
  `branchcode` varchar(50) COLLATE utf8mb4_unicode_ci NOT NULL COMMENT 'The branch associated with the request',
2796
  `branchcode` varchar(50) COLLATE utf8mb4_unicode_ci NOT NULL COMMENT 'The branch associated with the request',
2797
  `status` varchar(50) COLLATE utf8mb4_unicode_ci DEFAULT NULL COMMENT 'Current Koha status of request',
2797
  `status` varchar(50) COLLATE utf8mb4_unicode_ci DEFAULT NULL COMMENT 'Current Koha status of request',
2798
  `status_alias` varchar(80) COLLATE utf8mb4_unicode_ci DEFAULT NULL COMMENT 'Foreign key to relevant authorised_values.authorised_value',
2798
  `status_alias` varchar(80) COLLATE utf8mb4_unicode_ci DEFAULT NULL COMMENT 'Foreign key to relevant authorised_values.authorised_value',
(-)a/t/db_dependent/Circulation.t (-4 / +3 lines)
Lines 2151-2157 subtest 'AddIssue | recalls' => sub { Link Here
2151
    AddReturn( $item->barcode, $item->homebranch );
2151
    AddReturn( $item->barcode, $item->homebranch );
2152
};
2152
};
2153
2153
2154
subtest 'AddIssue & illrequests.date_due' => sub {
2154
subtest 'AddIssue & illrequests.due_date' => sub {
2155
    plan tests => 2;
2155
    plan tests => 2;
2156
2156
2157
    t::lib::Mocks::mock_preference( 'ILLModule', 1 );
2157
    t::lib::Mocks::mock_preference( 'ILLModule', 1 );
Lines 2167-2173 subtest 'AddIssue & illrequests.date_due' => sub { Link Here
2167
        borrowernumber => $patron->borrowernumber,
2167
        borrowernumber => $patron->borrowernumber,
2168
        biblio_id => $item->biblionumber,
2168
        biblio_id => $item->biblionumber,
2169
        branchcode => $library->{'branchcode'},
2169
        branchcode => $library->{'branchcode'},
2170
        date_due => $custom_date_due,
2170
        due_date => $custom_date_due,
2171
    })->store;
2171
    })->store;
2172
2172
2173
    my $issue = AddIssue( $patron->unblessed, $item->barcode );
2173
    my $issue = AddIssue( $patron->unblessed, $item->barcode );
Lines 2181-2187 subtest 'AddIssue & illrequests.date_due' => sub { Link Here
2181
        borrowernumber => $patron->borrowernumber,
2181
        borrowernumber => $patron->borrowernumber,
2182
        biblio_id => $item->biblionumber,
2182
        biblio_id => $item->biblionumber,
2183
        branchcode => $library->{'branchcode'},
2183
        branchcode => $library->{'branchcode'},
2184
        date_due => $custom_date_due,
2184
        due_date => $custom_date_due,
2185
    })->store;
2185
    })->store;
2186
2186
2187
    $issue = AddIssue( $patron->unblessed, $item->barcode );
2187
    $issue = AddIssue( $patron->unblessed, $item->barcode );
2188
- 

Return to bug 24239