Revision 2f6e7625
Von Jan Büren vor etwa 12 Jahren hinzugefügt
SL/DATEV.pm | ||
---|---|---|
|
||
my $query =
|
||
qq|SELECT ac.acc_trans_id, ac.transdate, ac.trans_id,ar.id, ac.amount, ac.taxkey,
|
||
ar.invnumber, ar.duedate, ar.amount as umsatz,
|
||
ar.invnumber, ar.duedate, ar.amount as umsatz, ar.deliverydate,
|
||
ct.name,
|
||
c.accno, c.taxkey_id as charttax, c.datevautomatik, c.id, ac.chart_link AS link,
|
||
ar.invoice
|
||
... | ... | |
UNION ALL
|
||
|
||
SELECT ac.acc_trans_id, ac.transdate, ac.trans_id,ap.id, ac.amount, ac.taxkey,
|
||
ap.invnumber, ap.duedate, ap.amount as umsatz,
|
||
ap.invnumber, ap.duedate, ap.amount as umsatz, ap.deliverydate,
|
||
ct.name,
|
||
c.accno, c.taxkey_id as charttax, c.datevautomatik, c.id, ac.chart_link AS link,
|
||
ap.invoice
|
||
... | ... | |
UNION ALL
|
||
|
||
SELECT ac.acc_trans_id, ac.transdate, ac.trans_id,gl.id, ac.amount, ac.taxkey,
|
||
gl.reference AS invnumber, gl.transdate AS duedate, ac.amount as umsatz,
|
||
gl.reference AS invnumber, gl.transdate AS duedate, ac.amount as umsatz, NULL as deliverydate,
|
||
gl.description AS name,
|
||
c.accno, c.taxkey_id as charttax, c.datevautomatik, c.id, ac.chart_link AS link,
|
||
FALSE AS invoice
|
||
... | ... | |
push @{ $self->{DATEV} }, [ \%new_trans, $trans->[$j] ];
|
||
|
||
} elsif (($j != $notsplitindex) && !$trans->[$j]->{is_tax}) {
|
||
my %tax_info = $taxkeys->get_full_tax_info('transdate' => $trans->[$j]->{transdate});
|
||
my %tax_info = $taxkeys->get_full_tax_info('transdate' => $trans->[$j]->{transdate},
|
||
'deliverydate' => $trans->[$j]->{deliverydate});
|
||
|
||
my %new_trans = ();
|
||
map { $new_trans{$_} = $trans->[$notsplitindex]->{$_}; } keys %{ $trans->[$notsplitindex] };
|
SL/IC.pm | ||
---|---|---|
# if credit_note has a deliverydate, use this instead of invdate
|
||
# useful for credit_notes of invoices from an old period with different tax
|
||
# if there is no deliverydate then invdate is used, old default (see next elsif)
|
||
# Falls hier der Stichtag für Steuern anders bestimmt wird,
|
||
# entsprechend auch bei Taxkeys.pm anpassen
|
||
$transdate = $form->{deliverydate};
|
||
} elsif (($form->{type} eq "credit_note") || ($form->{script} eq 'ir.pl')) {
|
||
$transdate = $form->{invdate};
|
SL/IS.pm | ||
---|---|---|
}
|
||
|
||
$project_id = conv_i($form->{"globalproject_id"});
|
||
|
||
# entsprechend auch beim Bestimmen des Steuerschlüssels in Taxkey.pm berücksichtigen
|
||
my $taxdate = $form->{deliverydate} ? $form->{deliverydate} : $form->{invdate};
|
||
|
||
foreach my $trans_id (keys %{ $form->{amount_cogs} }) {
|
SL/Taxkeys.pm | ||
---|---|---|
}
|
||
|
||
my $sth = $self->{handles}->{get_tax_info};
|
||
do_statement($form, $sth, $self->{queries}->{get_tax_info}, $params{taxkey}, $params{transdate});
|
||
# Lieferdatum (deliverydate) ist entscheidend für den Steuersatz
|
||
do_statement($form, $sth, $self->{queries}->{get_tax_info}, $params{taxkey}, $params{deliverydate} || $params{transdate});
|
||
|
||
my $ref = $sth->fetchrow_hashref() || { };
|
||
|
||
... | ... | |
my @all_taxkeys = map { $_->{taxkey} } (selectall_hashref_query($form, $form->get_standard_dbh(), qq|SELECT DISTINCT taxkey FROM tax WHERE taxkey IS NOT NULL|));
|
||
|
||
foreach my $taxkey (@all_taxkeys) {
|
||
my $ref = $self->get_tax_info('transdate' => $params{transdate}, 'taxkey' => $taxkey);
|
||
my $ref = $self->get_tax_info('transdate' => $params{transdate}, 'taxkey' => $taxkey, 'deliverydate' => $params{deliverydate});
|
||
|
||
$tax_info{taxkeys}->{$taxkey} = $ref;
|
||
$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.