sub payment_terms { goto &payment }
sub number { goto &customernumber }
+sub create_zugferd_invoices_for_this_customer {
+ my ($self) = @_;
+
+ no warnings 'once';
+ return $::instance_conf->get_create_zugferd_invoices if $self->create_zugferd_invoices == -1;
+ return $self->create_zugferd_invoices;
+}
+
1;
# <rsm:ExchangedDocumentContext>
$params{xml}->startTag("rsm:ExchangedDocumentContext");
- if ($::instance_conf->get_create_zugferd_invoices == 2) {
+ if ($self->customer->create_zugferd_invoices_for_this_customer == 2) {
$params{xml}->startTag("ram:TestIndicator");
$params{xml}->dataElement("udt:Indicator", "true");
$params{xml}->endTag;
contact => { type => 'text' },
contact_origin => { type => 'text' },
country => { type => 'text' },
+ create_zugferd_invoices => { type => 'integer', default => '-1', not_null => 1 },
creditlimit => { type => 'numeric', default => '0', precision => 15, scale => 5 },
currency_id => { type => 'integer', not_null => 1 },
customernumber => { type => 'text' },
sub _maybe_attach_zugferd_data {
my ($form) = @_;
- return if !$::instance_conf->get_create_zugferd_invoices;
-
my $record = _make_record();
- return if !$record || !$record->can('create_pdf_a_print_options') || !$record->can('create_zugferd_data');
+ return if !$record
+ || !$record->can('customer')
+ || !$record->customer
+ || !$record->can('create_pdf_a_print_options')
+ || !$record->can('create_zugferd_data')
+ || !$record->customer->create_zugferd_invoices_for_this_customer;
eval {
my $xmlfile = File::Temp->new;
'Use fill up when calculating shipped quantities?' => 'Sollen nicht verlinkte Positionen abgeglichen werden?',
'Use linked items' => 'Verknüpfte Positionen verwenden',
'Use master default bin for Default Transfer, if no default bin for the part is configured' => 'Standardlagerplatz für Ein- / Auslagern über Standard-Lagerplatz, falls für die Ware kein expliziter Lagerplatz konfiguriert ist',
+ 'Use settings from client configuration' => 'Einstellungen aus Mandantenkonfiguration folgen',
'Use this storage backend for all generated PDF-Files' => 'Verwende dieses Backend für generierte PDF-Dateien',
'Use this storage backend for all uploaded attachments' => 'Verwende dieses Backend für hochgeladene Dateien',
'Use this storage backend for uploaded images' => 'Verwende dieses Backend für hochgeladene Bilder',
--- /dev/null
+-- @tag: customer_create_zugferd_invoices
+-- @description: Kundenstammdaten: Einstellungen für ZUGFeRD-Rechnungen
+-- @depends: release_3_5_5
+ALTER TABLE customer
+ADD COLUMN create_zugferd_invoices INTEGER;
+
+UPDATE customer
+SET create_zugferd_invoices = -1;
+
+ALTER TABLE customer
+ALTER COLUMN create_zugferd_invoices SET DEFAULT -1,
+ALTER COLUMN create_zugferd_invoices SET NOT NULL;
<td>
[% L.checkbox_tag('cv.order_lock', checked = SELF.cv.order_lock, for_submit=1) %]
</td>
+ <th align="right">[% LxERP.t8("Create sales invoices with ZUGFeRD data") %]</td>
+ <td>[% L.select_tag("cv.create_zugferd_invoices",
+ [ [ -1, LxERP.t8('Use settings from client configuration') ],
+ [ 0, LxERP.t8('Do not create ZUGFeRD invoices') ],
+ [ 1, LxERP.t8('Create ZUGFeRD invoices') ],
+ [ 2, LxERP.t8('Create ZUGFeRD invoices in test mode') ] ],
+ default=SELF.cv.create_zugferd_invoices) %]</td>
</tr>
[% END %]
</table>