if ($::form->{customer_id}) {
$::form->{ALL_CONTACTS} = SL::DB::Manager::Contact->get_all_sorted(where => [ cp_cv_id => $::form->{customer_id} ]);
- $::form->{email_recipient_invoice_address} = SL::DB::Manager::Customer->find_by(id => $::form->{customer_id})->invoice_mail;
+ my $customer_object = SL::DB::Manager::Customer->find_by(id => $::form->{customer_id});
+ $::form->{postal_invoice} = $customer_object->postal_invoice;
+ $::form->{email_recipient_invoice_address} = $::form->{postal_invoice} ? '' : $customer_object->invoice_mail;
+ $config->send_email(0) if $::form->{postal_invoice};
}
$self->render('oe/edit_periodic_invoices_config', { layout => 0 },
order_lock => { type => 'boolean', default => 'false' },
payment_id => { type => 'integer' },
phone => { type => 'text' },
+ postal_invoice => { type => 'boolean', default => 'false' },
pricegroup_id => { type => 'integer' },
salesman_id => { type => 'integer' },
street => { type => 'text' },
action => [ t8('E Mail'),
call => [ 'kivi.SalesPurchase.show_email_dialog' ],
checks => [ 'kivi.validate_form' ],
- disabled => !$may_edit_create ? t8('You must not print this invoice.')
- : !$form->{id} ? t8('This invoice has not been posted yet.')
+ disabled => !$may_edit_create ? t8('You must not print this invoice.')
+ : !$form->{id} ? t8('This invoice has not been posted yet.')
+ : $form->{postal_invoice} ? t8('This customer wants a postal invoices.')
: undef,
],
], # end of combobox "Export"
$TMPL_VAR{customer_obj} = SL::DB::Customer->load_cached($form->{customer_id}) if $form->{customer_id};
$TMPL_VAR{invoice_obj} = SL::DB::Invoice->load_cached($form->{id}) if $form->{id};
+ # only print, no mail
+ $form->{postal_invoice} = $TMPL_VAR{customer_obj}->postal_invoice if ref $TMPL_VAR{customer_obj} eq 'SL::DB::Customer';
+
my $current_employee = SL::DB::Manager::Employee->current;
$form->{employee_id} = $form->{old_employee_id} if $form->{old_employee_id};
$form->{salesman_id} = $form->{old_salesman_id} if $form->{old_salesman_id};
'Post Payment' => 'Zahlung buchen',
'Post payments' => 'Zahlungen buchen',
'Post payments for selected invoices' => 'Zahlungen für ausgewählten Rechnungen buchen',
+ 'Postal Invoice' => 'Rechnung per Post',
'Posting Configuration' => 'Buchungskonfiguration',
'Posting Key' => 'BU-Schlüssel',
'Posting Text' => 'Buchungstext',
'This could have happened for two reasons:' => 'Dies kann aus zwei Gründen geschehen sein:',
'This customer has already been added.' => 'Für diesen Kunden ist bereits ein Preis hinzugefügt.',
'This customer number is already in use.' => 'Diese Kundennummer wird bereits verwendet.',
+ 'This customer wants a postal invoices.' => 'Dieser Kunde möchte Rechnungen nur per Post.',
'This discount has since gone down' => 'Dieser Rabatt ist mittlerweile niedriger',
'This discount has since gone up' => 'Dieser Rabatt ist mittlerweile höher',
'This discount is only valid for business #1' => 'Dieser Rabatt ist nur für Kunden-/Lieferantentyp #1 gültig',
'Post Payment' => '',
'Post payments' => '',
'Post payments for selected invoices' => '',
+ 'Postal Invoice' => '',
'Posting Configuration' => '',
'Posting Key' => '',
'Posting Text' => '',
'This could have happened for two reasons:' => '',
'This customer has already been added.' => '',
'This customer number is already in use.' => '',
+ 'This customer wants a postal invoices.' => '',
'This discount has since gone down' => '',
'This discount has since gone up' => '',
'This discount is only valid for business #1' => '',
--- /dev/null
+-- @tag: customer_vendor_add_postal_invoice
+-- @description: neue Spalte für "Rechnungsempfang nur per Post" bei Kunden
+-- @depends: release_3_5_6_1
+
+ALTER TABLE customer ADD COLUMN postal_invoice BOOLEAN DEFAULT FALSE;
[% IF ( SELF.is_customer() ) %]
<tr>
<th align="right">[% 'Email of the invoice recipient' | $T8 %]</th>
- <td>[% L.input_tag('cv.invoice_mail', SELF.cv.invoice_mail, size = 45) %]</td>
+ <td>[% L.input_tag('cv.invoice_mail', SELF.cv.invoice_mail, size = 30) %] <label for="cv_postal_invoice">[% 'Postal Invoice' | $T8 %]</label>
+ [% L.checkbox_tag('cv.postal_invoice', checked = SELF.cv.postal_invoice, for_submit=1) %]</td>
</tr>
<tr>
<th align="right">[% 'Email of the delivery order recipient' | $T8 %]</th>
<tr class="rule-before">
<th align="right">[%- LxERP.t8("Send invoice via email") %]</th>
- <td>[% L.checkbox_tag("send_email", onclick => "toggle_send_email_ctrl()", checked=config.send_email) %]</td>
+ <td>[% L.checkbox_tag("send_email", onclick => "toggle_send_email_ctrl()", checked=config.send_email, disabled=postal_invoice) %]</td>
</tr>
<tr>
<th align="right">[%- LxERP.t8("Email of the invoice recipient") %]</th>