use MIME::Lite;
use Mail::Sendmail;
+use C4::Koha qw(GetAuthorisedValueByCode);
use C4::Members;
use C4::Members::Attributes qw(GetBorrowerAttributes);
use C4::Branch;
sub getletter {
my ( $module, $code, $branchcode ) = @_;
- $branchcode ||= '';
if ( C4::Context->preference('IndependentBranches')
and $branchcode
$branchcode = C4::Context->userenv->{'branch'};
}
+ $branchcode //= '';
if ( my $l = $letter{$module}{$code}{$branchcode} ) {
return { %$l }; # deep copy
if ( $table eq 'reserves' && $values->{'waitingdate'} ) {
my @waitingdate = split /-/, $values->{'waitingdate'};
- my $dt = dt_from_string();
- $dt->add( days => C4::Context->preference('ReservesMaxPickUpDelay') || 0);
- $values->{'expirationdate'} = output_pref({ dt => $dt, dateonly => 1 });
+ $values->{'expirationdate'} = '';
+ if( C4::Context->preference('ExpireReservesMaxPickUpDelay') &&
+ C4::Context->preference('ReservesMaxPickUpDelay') ) {
+ my $dt = dt_from_string();
+ $dt->add( days => C4::Context->preference('ReservesMaxPickUpDelay') );
+ $values->{'expirationdate'} = output_pref({ dt => $dt, dateonly => 1 });
+ }
$values->{'waitingdate'} = output_pref({ dt => dt_from_string( $values->{'waitingdate'} ), dateonly => 1 });
#Therefore adding the test on biblio. This includes biblioitems,
#but excludes items. Removed unneeded global and lookahead.
+ $val = GetAuthorisedValueByCode ('ROADTYPE', $val, 0) if $table=~/^borrowers$/ && $field=~/^streettype$/;
my $replacedby = defined ($val) ? $val : '';
($letter->{title} ) and do {
$letter->{title} =~ s/$replacetablefield/$replacedby/g;