Revision 61cea27c
Von Jan Büren vor mehr als 1 Jahr 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 |
} |
Auch abrufbar als: Unified diff
closedto direkt beim Lohnbuchhaltungsimport auf den letzten Tag des Vormonats setzen