$::form->{id} = $self->order->id; # this is used in SL::Mailer to create a linked record to the mail
$::form->send_email(\%::myconfig, 'pdf');
- # internal notes
- my $intnotes = $self->order->intnotes;
- $intnotes .= "\n\n" if $self->order->intnotes;
- $intnotes .= t8('[email]') . "\n";
- $intnotes .= t8('Date') . ": " . $::locale->format_date_object(DateTime->now_local, precision => 'seconds') . "\n";
- $intnotes .= t8('To (email)') . ": " . $::form->{email} . "\n";
- $intnotes .= t8('Cc') . ": " . $::form->{cc} . "\n" if $::form->{cc};
- $intnotes .= t8('Bcc') . ": " . $::form->{bcc} . "\n" if $::form->{bcc};
- $intnotes .= t8('Subject') . ": " . $::form->{subject} . "\n\n";
- $intnotes .= t8('Message') . ": " . $::form->{message};
-
- $self->order->update_attributes(intnotes => $intnotes);
+ # internal notes unless no email journal
+ unless ($::instance_conf->get_email_journal) {
+
+ my $intnotes = $self->order->intnotes;
+ $intnotes .= "\n\n" if $self->order->intnotes;
+ $intnotes .= t8('[email]') . "\n";
+ $intnotes .= t8('Date') . ": " . $::locale->format_date_object(DateTime->now_local, precision => 'seconds') . "\n";
+ $intnotes .= t8('To (email)') . ": " . $::form->{email} . "\n";
+ $intnotes .= t8('Cc') . ": " . $::form->{cc} . "\n" if $::form->{cc};
+ $intnotes .= t8('Bcc') . ": " . $::form->{bcc} . "\n" if $::form->{bcc};
+ $intnotes .= t8('Subject') . ": " . $::form->{subject} . "\n\n";
+ $intnotes .= t8('Message') . ": " . $::form->{message};
+
+ $self->order->update_attributes(intnotes => $intnotes);
+ }
$self->save_history('MAILED');
stock_info => $yaml,
stock_qty => $stock_qty,
};
-
$self->render(\ SL::JSON::to_json($response), { layout => 0, type => 'json', process => 0 });
}
$units_by_name{$_->{unit}}->convert_to($_->{qty}, $units_by_name{$unit})
} @$stock_info;
- my $content = _format_number($sum, 2);
+ my $content = _format_number($sum, 2) . ' ' . $unit;
return $content;
}