|
Lines 28-33
use Koha::Database;
Link Here
|
| 28 |
use Koha::DateUtils qw( dt_from_string ); |
28 |
use Koha::DateUtils qw( dt_from_string ); |
| 29 |
use Koha::Exceptions::Account; |
29 |
use Koha::Exceptions::Account; |
| 30 |
use Koha::Patron::Debarments; |
30 |
use Koha::Patron::Debarments; |
|
|
31 |
use C4::Letters; |
| 31 |
|
32 |
|
| 32 |
use base qw(Koha::Object Koha::Object::Mixin::AdditionalFields); |
33 |
use base qw(Koha::Object Koha::Object::Mixin::AdditionalFields); |
| 33 |
|
34 |
|
|
Lines 1097-1102
sub store {
Link Here
|
| 1097 |
} |
1098 |
} |
| 1098 |
} |
1099 |
} |
| 1099 |
|
1100 |
|
|
|
1101 |
#if there is a matching debit description letter, pull that content and render it for the accountline.description |
| 1102 |
if ( $self->is_debit && !$self->in_storage && !$self->description ) { |
| 1103 |
my $debit_type = $self->debit_type; |
| 1104 |
if ($debit_type) { |
| 1105 |
my $letter = C4::Letters::GetPreparedLetter( |
| 1106 |
module => 'debit_description', |
| 1107 |
letter_code => $debit_type->code, |
| 1108 |
tables => { |
| 1109 |
borrowers => $self->borrowernumber, |
| 1110 |
branches => $self->branchcode, |
| 1111 |
accountline => $self, |
| 1112 |
}, |
| 1113 |
); |
| 1114 |
|
| 1115 |
if ( $letter && $letter->{content} ) { |
| 1116 |
$self->description( $letter->{content} ); |
| 1117 |
} |
| 1118 |
} |
| 1119 |
} |
| 1120 |
|
| 1100 |
return $self->SUPER::store(); |
1121 |
return $self->SUPER::store(); |
| 1101 |
} |
1122 |
} |
| 1102 |
|
1123 |
|