Revision 61cea27c
Von Jan Büren vor mehr als 2 Jahren hinzugefügt
SL/Controller/PayPostingImport.pm | ||
---|---|---|
my ($self, %params) = @_;
|
||
|
||
$self->setup_pay_posting_action_bar;
|
||
$self->render('pay_posting_import/form', title => $::locale->text('Import Pay Postings'));
|
||
|
||
# new closedto
|
||
my $today = DateTime->now();
|
||
$today->subtract(months => 1);
|
||
|
||
my $dt = DateTime->last_day_of_month(year => $today->year, month => $today->month);
|
||
|
||
my $new_closedto = $dt->to_kivitendo();
|
||
$self->render('pay_posting_import/form', title => $::locale->text('Import Pay Postings'), closedto => $new_closedto);
|
||
}
|
||
|
||
sub action_import_datev_pay_postings {
|
||
... | ... | |
if (parse_and_import($self)) {
|
||
flash_later('info', t8("All pay postings successfully imported."));
|
||
}
|
||
if ($::form->{set_closedto} && _set_closedto($self)) {
|
||
flash_later('info', t8("Books closed until:") . ' ' . $::form->{closedto});
|
||
}
|
||
$self->setup_pay_posting_action_bar;
|
||
$self->render('pay_posting_import/form', title => $::locale->text('Imported Pay Postings'));
|
||
}
|
||
... | ... | |
}) or do { die t8("Cannot add Booking, reason: #1 DB: #2 ", $@, SL::DB->client->error) };
|
||
}
|
||
|
||
|
||
sub _set_closedto {
|
||
my $self = shift;
|
||
die "no date:" . $::form->{closedto} unless $::form->{closedto};
|
||
|
||
my $defaults = SL::DB::Default->get;
|
||
|
||
$defaults->closedto(DateTime->from_kivitendo($::form->{closedto}));
|
||
$defaults->save || die "Cannot save closedto!";
|
||
|
||
return 1;
|
||
}
|
||
|
||
sub check_auth {
|
||
$::auth->assert('general_ledger');
|
||
}
|
locale/de/all | ||
---|---|---|
'Booking needs at least one debit and one credit booking!' => 'Die Buchung benötigt mindestens eine Buchung im Soll eine im Haben!',
|
||
'Bookinggroup/Tax' => 'Buchungsgruppe/Steuer',
|
||
'Books are open' => 'Die Bücher sind geöffnet.',
|
||
'Books closed until:' => 'Bücher abgeschlossen bis:',
|
||
'Books closed up to' => 'Bücher abgeschlossen bis zum',
|
||
'Boolean variables: If the default value is non-empty then the checkbox will be checked by default and unchecked otherwise.' => 'Ja/Nein-Variablen: Wenn der Standardwert nicht leer ist, so wird die Checkbox standardmäßig angehakt.',
|
||
'Both' => 'Beide',
|
templates/webpages/pay_posting_import/form.html | ||
---|---|---|
</table>
|
||
<div>
|
||
[% END %]
|
||
|
||
<p>
|
||
[% "Import a File:" | $T8 %]
|
||
</p>
|
||
<form method="post" action="controller.pl" enctype="multipart/form-data" id="form">
|
||
[% L.input_tag('file', '', type => 'file', accept => '.csv') %]
|
||
<p>[% L.checkbox_tag('set_closedto', value => 1, checked => 1, class => 'checkbox') %] [% 'Close Books up to' | $T8 %]:</p>
|
||
[% L.date_tag('closedto', closedto) %]
|
||
</form>
|
Auch abrufbar als: Unified diff
closedto direkt beim Lohnbuchhaltungsimport auf den letzten Tag des Vormonats setzen