diff --git a/Koha/Account/Credit.pm b/Koha/Account/Credit.pm index e3ffa39244..aed89932e2 100644 --- a/Koha/Account/Credit.pm +++ b/Koha/Account/Credit.pm @@ -48,6 +48,7 @@ sub to_api_mapping { borrowernumber => 'patron_id', branchcode => 'library_id', issue_id => undef, + old_issue_id => undef, itemnumber => undef, manager_id => 'user_id', note => 'internal_note', diff --git a/Koha/Account/Debit.pm b/Koha/Account/Debit.pm index e48cd2bffa..b113003bda 100644 --- a/Koha/Account/Debit.pm +++ b/Koha/Account/Debit.pm @@ -48,6 +48,7 @@ sub to_api_mapping { borrowernumber => 'patron_id', branchcode => 'library_id', issue_id => 'checkout_id', + old_issue_id => 'old_checkout_id', itemnumber => 'item_id', manager_id => 'user_id', note => 'internal_note', diff --git a/Koha/Account/Line.pm b/Koha/Account/Line.pm index 16752ff032..a82ad43414 100644 --- a/Koha/Account/Line.pm +++ b/Koha/Account/Line.pm @@ -982,6 +982,7 @@ sub to_api_mapping { borrowernumber => 'patron_id', branchcode => 'library_id', issue_id => 'checkout_id', + old_issue_id => 'old_checkout_id', itemnumber => 'item_id', manager_id => 'user_id', note => 'internal_note', diff --git a/api/v1/swagger/definitions/account_line.yaml b/api/v1/swagger/definitions/account_line.yaml index cbf71f22b0..1fe078417c 100644 --- a/api/v1/swagger/definitions/account_line.yaml +++ b/api/v1/swagger/definitions/account_line.yaml @@ -24,6 +24,11 @@ properties: - integer - "null" description: Internal identifier for the checkout the account line is related to + old_checkout_id: + type: + - integer + - "null" + description: Internal identifier for the old checkout the account line is related to credit_number: type: - string diff --git a/api/v1/swagger/definitions/debit.yaml b/api/v1/swagger/definitions/debit.yaml index c3cc06096f..07ea7d7884 100644 --- a/api/v1/swagger/definitions/debit.yaml +++ b/api/v1/swagger/definitions/debit.yaml @@ -23,6 +23,11 @@ properties: - integer - "null" description: Internal identifier for the checkout the account line is related to + old_checkout_id: + type: + - integer + - "null" + description: Internal identifier for the old checkout the account line is related to date: type: string format: date-time diff --git a/t/db_dependent/api/v1/patrons_accounts.t b/t/db_dependent/api/v1/patrons_accounts.t index 6fbb726b7d..31d395ace6 100755 --- a/t/db_dependent/api/v1/patrons_accounts.t +++ b/t/db_dependent/api/v1/patrons_accounts.t @@ -90,7 +90,7 @@ subtest 'get_balance() tests' => sub { $debit_2->discard_changes; $t->get_ok("//$userid:$password@/api/v1/patrons/$patron_id/account") - ->status_is(200)->json_is( + ->status_is(200)->or(sub { diag $t->tx->res->body } )->json_is( { balance => 100.01, outstanding_debits => {