Revision 61cea27c
Von Jan Büren vor etwa 2 Jahren hinzugefügt
SL/Controller/PayPostingImport.pm | ||
---|---|---|
17 | 17 |
my ($self, %params) = @_; |
18 | 18 |
|
19 | 19 |
$self->setup_pay_posting_action_bar; |
20 |
$self->render('pay_posting_import/form', title => $::locale->text('Import Pay Postings')); |
|
20 |
|
|
21 |
# new closedto |
|
22 |
my $today = DateTime->now(); |
|
23 |
$today->subtract(months => 1); |
|
24 |
|
|
25 |
my $dt = DateTime->last_day_of_month(year => $today->year, month => $today->month); |
|
26 |
|
|
27 |
my $new_closedto = $dt->to_kivitendo(); |
|
28 |
$self->render('pay_posting_import/form', title => $::locale->text('Import Pay Postings'), closedto => $new_closedto); |
|
21 | 29 |
} |
22 | 30 |
|
23 | 31 |
sub action_import_datev_pay_postings { |
... | ... | |
39 | 47 |
if (parse_and_import($self)) { |
40 | 48 |
flash_later('info', t8("All pay postings successfully imported.")); |
41 | 49 |
} |
50 |
if ($::form->{set_closedto} && _set_closedto($self)) { |
|
51 |
flash_later('info', t8("Books closed until:") . ' ' . $::form->{closedto}); |
|
52 |
} |
|
42 | 53 |
$self->setup_pay_posting_action_bar; |
43 | 54 |
$self->render('pay_posting_import/form', title => $::locale->text('Imported Pay Postings')); |
44 | 55 |
} |
... | ... | |
124 | 135 |
}) or do { die t8("Cannot add Booking, reason: #1 DB: #2 ", $@, SL::DB->client->error) }; |
125 | 136 |
} |
126 | 137 |
|
138 |
|
|
139 |
sub _set_closedto { |
|
140 |
my $self = shift; |
|
141 |
die "no date:" . $::form->{closedto} unless $::form->{closedto}; |
|
142 |
|
|
143 |
my $defaults = SL::DB::Default->get; |
|
144 |
|
|
145 |
$defaults->closedto(DateTime->from_kivitendo($::form->{closedto})); |
|
146 |
$defaults->save || die "Cannot save closedto!"; |
|
147 |
|
|
148 |
return 1; |
|
149 |
} |
|
150 |
|
|
127 | 151 |
sub check_auth { |
128 | 152 |
$::auth->assert('general_ledger'); |
129 | 153 |
} |
locale/de/all | ||
---|---|---|
523 | 523 |
'Booking needs at least one debit and one credit booking!' => 'Die Buchung benötigt mindestens eine Buchung im Soll eine im Haben!', |
524 | 524 |
'Bookinggroup/Tax' => 'Buchungsgruppe/Steuer', |
525 | 525 |
'Books are open' => 'Die Bücher sind geöffnet.', |
526 |
'Books closed until:' => 'Bücher abgeschlossen bis:', |
|
526 | 527 |
'Books closed up to' => 'Bücher abgeschlossen bis zum', |
527 | 528 |
'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.', |
528 | 529 |
'Both' => 'Beide', |
templates/webpages/pay_posting_import/form.html | ||
---|---|---|
32 | 32 |
</table> |
33 | 33 |
<div> |
34 | 34 |
[% END %] |
35 |
|
|
36 | 35 |
<p> |
37 | 36 |
[% "Import a File:" | $T8 %] |
38 | 37 |
</p> |
39 | 38 |
<form method="post" action="controller.pl" enctype="multipart/form-data" id="form"> |
40 | 39 |
[% L.input_tag('file', '', type => 'file', accept => '.csv') %] |
40 |
<p>[% L.checkbox_tag('set_closedto', value => 1, checked => 1, class => 'checkbox') %] [% 'Close Books up to' | $T8 %]:</p> |
|
41 |
[% L.date_tag('closedto', closedto) %] |
|
41 | 42 |
</form> |
Auch abrufbar als: Unified diff
closedto direkt beim Lohnbuchhaltungsimport auf den letzten Tag des Vormonats setzen