@@ -, +, @@ credit_type_code --- Koha/Account.pm | 18 +++++++++--------- Koha/Account/Line.pm | 2 +- Koha/REST/V1/Patrons/Account.pm | 4 ++-- .../prog/en/includes/accounts.inc | 6 +++--- .../en/modules/reports/cash_register_stats.tt | 2 +- .../bootstrap/en/includes/account-table.inc | 6 +++--- reports/cash_register_stats.pl | 16 ++++++++-------- 7 files changed, 27 insertions(+), 27 deletions(-) --- a/Koha/Account.pm +++ a/Koha/Account.pm @@ -60,8 +60,8 @@ Koha::Account->new( { patron_id => $borrowernumber } )->pay( note => $note, description => $description, library_id => $branchcode, - lines => $lines, # Arrayref of Koha::Account::Line objects to pay - account_type => $type, # accounttype code + lines => $lines, # Arrayref of Koha::Account::Line objects to pay + credit_type => $type, # credit_type_code code offset_type => $offset_type, # offset type code } ); @@ -78,7 +78,7 @@ sub pay { my $lines = $params->{lines}; my $type = $params->{type} || 'payment'; my $payment_type = $params->{payment_type} || undef; - my $account_type = $params->{account_type}; + my $credit_type = $params->{credit_type}; my $offset_type = $params->{offset_type} || $type eq 'writeoff' ? 'Writeoff' : 'Payment'; my $cash_register = $params->{cash_register}; @@ -215,7 +215,7 @@ sub pay { last unless $balance_remaining > 0; } - $account_type ||= + $credit_type ||= $type eq 'writeoff' ? 'W' : 'Pay'; @@ -228,7 +228,7 @@ sub pay { date => dt_from_string(), amount => 0 - $amount, description => $description, - accounttype => $account_type, + credit_type_code => $credit_type, payment_type => $payment_type, amountoutstanding => 0 - $balance_remaining, manager_id => $manager_id, @@ -263,7 +263,7 @@ sub pay { borrowernumber => $self->{patron_id}, amount => 0 - $amount, amountoutstanding => 0 - $balance_remaining, - accounttype => $account_type, + credit_type_code => $credit_type, accountlines_paid => \@fines_paid, manager_id => $manager_id, } @@ -360,7 +360,7 @@ sub add_credit { my $schema = Koha::Database->new->schema; - my $account_type = $Koha::Account::account_type_credit->{$type}; + my $credit_type = $Koha::Account::account_type_credit->{$type}; my $line; $schema->txn_do( @@ -372,7 +372,7 @@ sub add_credit { date => \'NOW()', amount => $amount, description => $description, - accounttype => $account_type, + credit_type_code => $credit_type, amountoutstanding => $amount, payment_type => $payment_type, note => $note, @@ -410,7 +410,7 @@ sub add_credit { amount => $amount, description => $description, amountoutstanding => $amount, - accounttype => $account_type, + credit_type_code => $credit_type, note => $note, itemnumber => $item_id, manager_id => $user_id, --- a/Koha/Account/Line.pm +++ a/Koha/Account/Line.pm @@ -150,7 +150,7 @@ sub void { amount => $self->amount, amountoutstanding => $self->amountoutstanding, description => $self->description, - accounttype => $self->accounttype, + credit_type_code => $self->credit_type_code, payment_type => $self->payment_type, note => $self->note, itemnumber => $self->itemnumber, --- a/Koha/REST/V1/Patrons/Account.pm +++ a/Koha/REST/V1/Patrons/Account.pm @@ -227,7 +227,7 @@ sub _to_model { our $to_api_mapping = { accountlines_id => 'account_line_id', - accounttype => 'account_type', + credit_type_code => 'credit_type', debit_type_code => 'debit_type', amountoutstanding => 'amount_outstanding', borrowernumber => 'patron_id', @@ -244,7 +244,7 @@ our $to_api_mapping = { our $to_model_mapping = { account_line_id => 'accountlines_id', - account_type => 'accounttype', + credit_type => 'credit_type_code', debit_type => 'debit_type_code', amount_outstanding => 'amountoutstanding', checkout_id => 'issue_id', --- a/koha-tmpl/intranet-tmpl/prog/en/includes/accounts.inc +++ a/koha-tmpl/intranet-tmpl/prog/en/includes/accounts.inc @@ -1,7 +1,7 @@ [%- BLOCK account_type_description -%] - [%- IF account.accounttype -%] - [%- SWITCH account.accounttype -%] + [%- IF account.credit_type_code -%] + [%- SWITCH account.credit_type_code -%] [%- CASE 'Pay' -%]Payment [%- CASE 'W' -%]Writeoff [%- CASE 'FOR' -%]Forgiven @@ -9,7 +9,7 @@ [%- CASE 'WO' -%]Writeoff [%- CASE 'C' -%]Credit [%- CASE 'LOST_RETURN' -%]Lost item fee refund - [%- CASE -%][% account.accounttype | html %] + [%- CASE -%][% account.credit_type.description | html %] [%- END -%] [%- ELSIF account.debit_type_code -%] [%- SWITCH account.debit_type_code -%] --- a/koha-tmpl/intranet-tmpl/prog/en/modules/reports/cash_register_stats.tt +++ a/koha-tmpl/intranet-tmpl/prog/en/modules/reports/cash_register_stats.tt @@ -159,7 +159,7 @@