Revision 2f6e7625
Von Jan Büren vor mehr als 11 Jahren hinzugefügt
SL/DATEV.pm | ||
---|---|---|
353 | 353 |
|
354 | 354 |
my $query = |
355 | 355 |
qq|SELECT ac.acc_trans_id, ac.transdate, ac.trans_id,ar.id, ac.amount, ac.taxkey, |
356 |
ar.invnumber, ar.duedate, ar.amount as umsatz, |
|
356 |
ar.invnumber, ar.duedate, ar.amount as umsatz, ar.deliverydate,
|
|
357 | 357 |
ct.name, |
358 | 358 |
c.accno, c.taxkey_id as charttax, c.datevautomatik, c.id, ac.chart_link AS link, |
359 | 359 |
ar.invoice |
... | ... | |
368 | 368 |
UNION ALL |
369 | 369 |
|
370 | 370 |
SELECT ac.acc_trans_id, ac.transdate, ac.trans_id,ap.id, ac.amount, ac.taxkey, |
371 |
ap.invnumber, ap.duedate, ap.amount as umsatz, |
|
371 |
ap.invnumber, ap.duedate, ap.amount as umsatz, ap.deliverydate,
|
|
372 | 372 |
ct.name, |
373 | 373 |
c.accno, c.taxkey_id as charttax, c.datevautomatik, c.id, ac.chart_link AS link, |
374 | 374 |
ap.invoice |
... | ... | |
383 | 383 |
UNION ALL |
384 | 384 |
|
385 | 385 |
SELECT ac.acc_trans_id, ac.transdate, ac.trans_id,gl.id, ac.amount, ac.taxkey, |
386 |
gl.reference AS invnumber, gl.transdate AS duedate, ac.amount as umsatz, |
|
386 |
gl.reference AS invnumber, gl.transdate AS duedate, ac.amount as umsatz, NULL as deliverydate,
|
|
387 | 387 |
gl.description AS name, |
388 | 388 |
c.accno, c.taxkey_id as charttax, c.datevautomatik, c.id, ac.chart_link AS link, |
389 | 389 |
FALSE AS invoice |
... | ... | |
528 | 528 |
push @{ $self->{DATEV} }, [ \%new_trans, $trans->[$j] ]; |
529 | 529 |
|
530 | 530 |
} elsif (($j != $notsplitindex) && !$trans->[$j]->{is_tax}) { |
531 |
my %tax_info = $taxkeys->get_full_tax_info('transdate' => $trans->[$j]->{transdate}); |
|
531 |
my %tax_info = $taxkeys->get_full_tax_info('transdate' => $trans->[$j]->{transdate}, |
|
532 |
'deliverydate' => $trans->[$j]->{deliverydate}); |
|
532 | 533 |
|
533 | 534 |
my %new_trans = (); |
534 | 535 |
map { $new_trans{$_} = $trans->[$notsplitindex]->{$_}; } keys %{ $trans->[$notsplitindex] }; |
SL/IC.pm | ||
---|---|---|
1497 | 1497 |
# if credit_note has a deliverydate, use this instead of invdate |
1498 | 1498 |
# useful for credit_notes of invoices from an old period with different tax |
1499 | 1499 |
# if there is no deliverydate then invdate is used, old default (see next elsif) |
1500 |
# Falls hier der Stichtag für Steuern anders bestimmt wird, |
|
1501 |
# entsprechend auch bei Taxkeys.pm anpassen |
|
1500 | 1502 |
$transdate = $form->{deliverydate}; |
1501 | 1503 |
} elsif (($form->{type} eq "credit_note") || ($form->{script} eq 'ir.pl')) { |
1502 | 1504 |
$transdate = $form->{invdate}; |
SL/IS.pm | ||
---|---|---|
821 | 821 |
} |
822 | 822 |
|
823 | 823 |
$project_id = conv_i($form->{"globalproject_id"}); |
824 |
|
|
824 |
# entsprechend auch beim Bestimmen des Steuerschlüssels in Taxkey.pm berücksichtigen |
|
825 | 825 |
my $taxdate = $form->{deliverydate} ? $form->{deliverydate} : $form->{invdate}; |
826 | 826 |
|
827 | 827 |
foreach my $trans_id (keys %{ $form->{amount_cogs} }) { |
SL/Taxkeys.pm | ||
---|---|---|
78 | 78 |
} |
79 | 79 |
|
80 | 80 |
my $sth = $self->{handles}->{get_tax_info}; |
81 |
do_statement($form, $sth, $self->{queries}->{get_tax_info}, $params{taxkey}, $params{transdate}); |
|
81 |
# Lieferdatum (deliverydate) ist entscheidend für den Steuersatz |
|
82 |
do_statement($form, $sth, $self->{queries}->{get_tax_info}, $params{taxkey}, $params{deliverydate} || $params{transdate}); |
|
82 | 83 |
|
83 | 84 |
my $ref = $sth->fetchrow_hashref() || { }; |
84 | 85 |
|
... | ... | |
106 | 107 |
my @all_taxkeys = map { $_->{taxkey} } (selectall_hashref_query($form, $form->get_standard_dbh(), qq|SELECT DISTINCT taxkey FROM tax WHERE taxkey IS NOT NULL|)); |
107 | 108 |
|
108 | 109 |
foreach my $taxkey (@all_taxkeys) { |
109 |
my $ref = $self->get_tax_info('transdate' => $params{transdate}, 'taxkey' => $taxkey); |
|
110 |
my $ref = $self->get_tax_info('transdate' => $params{transdate}, 'taxkey' => $taxkey, 'deliverydate' => $params{deliverydate});
|
|
110 | 111 |
|
111 | 112 |
$tax_info{taxkeys}->{$taxkey} = $ref; |
112 | 113 |
$tax_info{accnos}->{$ref->{taxchart_id}} = $ref if ($ref->{taxchart_id}); |
Auch abrufbar als: Unified diff
Beim DATEV-Export Lieferdatum als entscheidenden Tag zur Bestimmung der Steuer berücksichtigen
Analog wie bei Einkaufs- und Verkaufsbelegen wird jetzt auch beim DATEV-Export
das Lieferdatum der Transaktion verwendet.