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
}
);
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};
last unless $balance_remaining > 0;
}
- $account_type ||=
+ $credit_type ||=
$type eq 'writeoff'
? 'W'
: '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,
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,
}
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(
date => \'NOW()',
amount => $amount,
description => $description,
- accounttype => $account_type,
+ credit_type_code => $credit_type,
amountoutstanding => $amount,
payment_type => $payment_type,
note => $note,
amount => $amount,
description => $description,
amountoutstanding => $amount,
- accounttype => $account_type,
+ credit_type_code => $credit_type,
note => $note,
itemnumber => $item_id,
manager_id => $user_id,
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,
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',
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',
[%- BLOCK account_type_description -%]
<span>
- [%- 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
[%- 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 -%]
<td>[% loopresul.branchname | html %]</td>
<td>[% loopresul.date | $KohaDates %]</td>
<td>
- [% IF loopresul.accounttype == "ACT" %]
+ [% IF loopresul.credit_type == "ACT" %]
<span>All payments to the library</span>
[% ELSE %]
[%- PROCESS account_type_description account=loopresul -%]
[%- BLOCK account_type_description -%]
<span>
- [%- 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
[%- 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 -%]
if ($transaction_type eq 'ALL') { #All Transactons
$whereTType = q{};
} elsif ($transaction_type eq 'ACT') { #Active
- $whereTType = q{ AND accounttype IN ('Pay','C') };
+ $whereTType = q{ AND credit_type_code IN ('Pay','C') };
} elsif ($transaction_type eq 'FORW') {
- $whereTType = q{ AND accounttype IN ('FOR','W') };
+ $whereTType = q{ AND credit_type_code IN ('FOR','W') };
} else {
if ( any { $transaction_type eq $_->code } @debit_types ) {
$whereTType = q{ AND debit_type_code = ? };
push @extra_params, $transaction_type;
} else {
- $whereTType = q{ AND accounttype = ? };
+ $whereTType = q{ AND credit_type_code = ? };
push @extra_params, $transaction_type;
}
}
SELECT round(amount,2) AS amount, description,
bo.surname AS bsurname, bo.firstname AS bfirstname, m.surname AS msurname, m.firstname AS mfirstname,
bo.cardnumber, br.branchname, bo.borrowernumber,
- al.borrowernumber, DATE(al.date) as date, al.accounttype, al.debit_type_code, al.amountoutstanding, al.note,
+ al.borrowernumber, DATE(al.date) as date, al.credit_type_code, al.debit_type_code, al.amountoutstanding, al.note,
bi.title, bi.biblionumber, i.barcode, i.itype
FROM accountlines al
LEFT JOIN borrowers bo ON (al.borrowernumber = bo.borrowernumber)
$row->{date} = dt_from_string($row->{date}, 'sql');
push (@loopresult, $row);
- if($transaction_type eq 'ACT' && ($row->{accounttype} !~ /^C$|^CR$|^Pay$/)){
+ if($transaction_type eq 'ACT' && ($row->{credit_type_code} !~ /^C$|^CR$|^Pay$/)){
pop @loopresult;
next;
}
- if($row->{accounttype} =~ /^C$|^CR$/){
+ if($row->{credit_type_code} =~ /^C$|^CR$/){
$grantotal -= abs($row->{amount});
$row->{amount} = '-' . $row->{amount};
- }elsif($row->{accounttype} eq 'FORW' || $row->{accounttype} eq 'W'){
+ }elsif($row->{credit_type_code} eq 'FORW' || $row->{credit_type_code} eq 'W'){
}else{
$grantotal += abs($row->{amount});
}
$row->{bfirstname} . ' ' . $row->{bsurname},
$row->{branchname},
$row->{date},
- $row->{accounttype},
+ $row->{credit_type},
$row->{debit_type},
$row->{note},
$row->{amount},