# first make sure the borrower hasn't already been charged for this item (for this issuance)
my $existing_charges = $account->lines->search(
{
- itemnumber => $itemnumber,
- accounttype => 'LOST',
- issue_id => $issue_id
+ itemnumber => $itemnumber,
+ debit_type_code => 'LOST',
+ issue_id => $issue_id
}
)->count();
date => \'NOW()',
amount => $amount,
description => $desc,
- accounttype => $type,
+ debit_type_code => $type,
amountoutstanding => $amountleft,
itemnumber => $itemnum || undef,
issue_id => $issue_id,
borrowernumber => $borrowernumber,
amount => $amount,
description => $desc,
- accounttype => $type,
+ debit_type_code => $type,
amountoutstanding => $amountleft,
note => $note,
itemnumber => $itemnum,