if ($::form->{cp_id}) {
$email = SL::DB::Contact->load_cached($::form->{cp_id})->cp_email;
}
-
+ my $invoice_mail;
+ if ($::form->{type} eq 'invoice' && !$email) {
+ # check for invoice_mail
+ $email = SL::DB::Customer->load_cached($::form->{vc_id})->invoice_mail;
+ $invoice_mail = 1 if $email;
+ }
if (!$email && $::form->{vc} && $::form->{vc_id}) {
$email = SL::DB::Customer->load_cached($::form->{vc_id})->email if 'customer' eq $::form->{vc};
$email = SL::DB::Vendor ->load_cached($::form->{vc_id})->email if 'vendor' eq $::form->{vc};
show_bcc => $::auth->assert('email_bcc', 'may fail'),
FILES => \%files,
is_customer => $::form->{vc} eq 'customer',
+ is_invoice_mail => $invoice_mail,
});
print $::form->ajax_response_header, $html;
'Invoice for fees' => 'Rechnung über Gebühren',
'Invoice has already been storno\'d!' => 'Diese Rechnung wurde bereits storniert.',
'Invoice number' => 'Rechnungsnummer',
+ 'Invoice to:' => 'Rechnung an:',
'Invoice total' => 'Die Rechnungssumme',
'Invoice total less discount' => 'Rechnungssumme abzüglich Skonto',
'Invoice with Storno (abbreviation)' => 'R(S)',
<tbody>
<tr>
<th align="right" nowrap>
- [% LxERP.t8("Recipients") %]
+ [% IF is_invoice_mail %]
+ [% LxERP.t8("Invoice to:") %]
+ [% ELSE %]
+ [% LxERP.t8("Recipients") %]
+ [% END %]
</th>
<td>
- [% L.input_tag("email_form.to", email_form.to, size="80") %]
+ [% L.input_tag("email_form.to", email_form.to, size="80",readonly=is_invoice_mail ) %]
<span class="interactive cursor-pointer" onclick="$('[data-toggle-recipients=1]').toggle()" data-toggle-recipients="1">[+]</span>
<span class="interactive cursor-pointer hidden" onclick="$('[data-toggle-recipients=1]').toggle()" data-toggle-recipients="1">[-]</span>
</td>
<td>[% L.checkbox_tag("send_email", onclick => "toggle_send_email_ctrl()", checked=config.send_email) %]</td>
</tr>
<tr>
- <th align="right">[%- LxERP.t8("Invoicing mail address") %]</th>
+ <th align="right">[%- LxERP.t8("Email of the invoice recipient") %]</th>
<td>[% email_recipient_invoice_address %]</td>
</tr>
<tr>