Revision 00b6dc22
Von Sven Schöling vor etwa 8 Jahren hinzugefügt
SL/Controller/Gdpdu.pm | ||
---|---|---|
12 | 12 |
use SL::Helper::Flash; |
13 | 13 |
|
14 | 14 |
use Rose::Object::MakeMethods::Generic ( |
15 |
'scalar --get_set_init' => [ qw(from to tables) ],
|
|
15 |
'scalar --get_set_init' => [ qw(from to) ], |
|
16 | 16 |
); |
17 | 17 |
|
18 | 18 |
__PACKAGE__->run_before('check_auth'); |
... | ... | |
39 | 39 |
location => $::instance_conf->get_address, |
40 | 40 |
from => $self->from, |
41 | 41 |
to => $self->to, |
42 |
tables => $self->tables, |
|
43 |
all_tables => !@{ $self->tables } && $::form->{all_tables}, |
|
42 |
all_tables => $::form->{all_tables}, |
|
44 | 43 |
); |
45 | 44 |
|
46 | 45 |
my $filename = $gdpdu->generate_export; |
... | ... | |
57 | 56 |
|
58 | 57 |
my $error = 0; |
59 | 58 |
|
60 |
if ($::form->{tables}) { |
|
61 |
$self->tables([ keys %{ $::form->{tables} } ]); |
|
62 |
# theese three get inferred |
|
63 |
push @{ $self->tables }, 'invoice' if $::form->{tables}{ar} || $::form->{tables}{ap}; |
|
64 |
push @{ $self->tables }, 'orderitems' if $::form->{tables}{oe}; |
|
65 |
push @{ $self->tables }, 'delivery_order_items' if $::form->{tables}{delivery_orders}; |
|
66 |
} |
|
67 |
|
|
68 |
if (!@{ $self->tables } && !$::form->{all_tables}) { |
|
69 |
flash('error', t8('No, I really do need checked tables to export.')); |
|
70 |
$error = 1; |
|
71 |
} |
|
72 |
|
|
73 | 59 |
if (!$::form->{from}) { |
74 | 60 |
my $epoch = DateTime->new(day => 1, month => 1, year => 1900); |
75 | 61 |
flash('info', t8('No start date given, setting to #1', $epoch->to_kivitendo)); |
... | ... | |
86 | 72 |
|
87 | 73 |
sub init_from { DateTime->from_kivitendo($::form->{from}) } |
88 | 74 |
sub init_to { DateTime->from_kivitendo($::form->{to}) } |
89 |
sub init_tables { [ ] } |
|
90 | 75 |
|
91 | 76 |
1; |
Auch abrufbar als: Unified diff
GDPDU: DATEV-ähnlicher Buchungsexport Rohversion