Revision 0c3c9aa1
Von Tamino Steinert vor 7 Monaten hinzugefügt
SL/DB/Order.pm | ||
---|---|---|
|
||
__PACKAGE__->before_save('_before_save_set_ord_quo_number');
|
||
__PACKAGE__->before_save('_before_save_create_new_project');
|
||
__PACKAGE__->before_save('_valid_periodic_invoice_config');
|
||
__PACKAGE__->before_save('_before_save_remove_empty_custom_shipto');
|
||
__PACKAGE__->before_save('_before_save_set_custom_shipto_module');
|
||
__PACKAGE__->after_save('_after_save_link_records');
|
||
... | ... | |
return 1;
|
||
}
|
||
|
||
sub _valid_periodic_invoice_config {
|
||
my ($self) = @_;
|
||
|
||
if ($self->periodic_invoices_config) {
|
||
if ($self->periodic_invoices_config->periodicity eq 'o') {
|
||
my @error_pos;
|
||
foreach my $item (@{$self->items_sorted()}) {
|
||
push @error_pos, $item->position if $item->periodic_invoice_items_config;
|
||
}
|
||
die t8("Periodic invoice config of order set to once. Can not have periodic invoice config for item(s) at position #1.",
|
||
join(', ', @error_pos)
|
||
) if scalar @error_pos;
|
||
} else {
|
||
my $error_string;
|
||
foreach my $item (@{$self->items_sorted()}) {
|
||
my $item_config = $item->periodic_invoice_items_config
|
||
or next;
|
||
$error_string .= t8("Start date before order start date at position #1.", $item->position) . "\n"
|
||
if $item_config->start_date
|
||
&& $item_config->start_date < $self->periodic_invoices_config->start_date;
|
||
$error_string .= t8("Start date after end date at position #1.", $item->position) . "\n"
|
||
if $item_config->start_date && $item_config->end_date
|
||
&& $item_config->start_date > $item_config->end_date;
|
||
}
|
||
die $error_string if $error_string;
|
||
}
|
||
} else {
|
||
my @error_pos;
|
||
foreach my $item (@{$self->items_sorted()}) {
|
||
push @error_pos, $item->position if $item->periodic_invoice_items_config;
|
||
}
|
||
die t8("Periodic invoice config for item(s) at position #1, but no for order.",
|
||
join(', ', @error_pos)
|
||
) if scalar @error_pos;
|
||
}
|
||
|
||
return 1;
|
||
}
|
||
|
||
sub _before_save_remove_empty_custom_shipto {
|
||
my ($self) = @_;
|
locale/de/all | ||
---|---|---|
'Period:' => 'Zeitraum:',
|
||
'Periodic Invoices' => 'Wiederkehrende Rechnungen',
|
||
'Periodic inventory' => 'Aufwandsmethode',
|
||
'Periodic invoice config for item(s) at position #1, but no for order.' => 'Wiederkehrende-Rechnungs-Konfiguration für Artikel von an Position #1, aber keine für Auftrag.',
|
||
'Periodic invoice config of order set to once. Can not have periodic invoice config for item(s) at position #1.' => 'Wiederkehrende-Rechnungs-Konfiguration des Auftrags auf einmalig gesetzt. Kann keine Wiederkehrende-Rechnungs-Konfiguration für Artikel an Position #1 besitzen.',
|
||
'Periodic invoices active' => 'Wiederkehrende Rechnungen aktiv',
|
||
'Periodic invoices inactive' => 'Wiederkehrende Rechnungen inaktiv',
|
||
'Periods' => 'Zeiträume',
|
||
... | ... | |
'Start (verb)' => 'Starten',
|
||
'Start Dunning Process' => 'Mahnprozess starten',
|
||
'Start date' => 'Startdatum',
|
||
'Start date after end date at position #1.' => 'Startdatum nach Enddatum an Position #1.',
|
||
'Start date before order start date at position #1.' => 'Startdatum des Artikels vor Startdatum des Auftras an Position #1.',
|
||
'Start of year' => 'Jahresanfang',
|
||
'Start process' => 'Prozess starten',
|
||
'Start the correction assistant' => 'Korrekturassistenten starten',
|
locale/en/all | ||
---|---|---|
'Period:' => '',
|
||
'Periodic Invoices' => '',
|
||
'Periodic inventory' => '',
|
||
'Periodic invoice config for item(s) at position #1, but no for order.' => '',
|
||
'Periodic invoice config of order set to once. Can not have periodic invoice config for item(s) at position #1.' => '',
|
||
'Periodic invoices active' => '',
|
||
'Periodic invoices inactive' => '',
|
||
'Periods' => '',
|
||
... | ... | |
'Start (verb)' => '',
|
||
'Start Dunning Process' => '',
|
||
'Start date' => '',
|
||
'Start date after end date at position #1.' => '',
|
||
'Start date before order start date at position #1.' => '',
|
||
'Start of year' => '',
|
||
'Start process' => '',
|
||
'Start the correction assistant' => '',
|
Auch abrufbar als: Unified diff
S:D:Order: validiere Konfiguration für Wiederkehrende-Rechnung