projects
/
kivitendo-erp.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
|
inline
| side by side (parent:
dcd79f6
)
Deutliche Beschleunigung der USTVA-Berechnung durch Einschränkung der betrachteten...
author
Moritz Bunkus
<m.bunkus@linet-services.de>
Wed, 10 Oct 2007 13:32:40 +0000
(13:32 +0000)
committer
Moritz Bunkus
<m.bunkus@linet-services.de>
Wed, 10 Oct 2007 13:32:40 +0000
(13:32 +0000)
SL/USTVA.pm
patch
|
blob
|
history
diff --git
a/SL/USTVA.pm
b/SL/USTVA.pm
index
61a6481
..
b10fea6
100644
(file)
--- a/
SL/USTVA.pm
+++ b/
SL/USTVA.pm
@@
-796,6
+796,21
@@
sub get_accounts_ustva {
$ARwhere .= " AND acc.transdate <= '$todate'";
}
$ARwhere .= " AND acc.transdate <= '$todate'";
}
+ my $acc_trans_where = '1=1';
+ if ($fromdate || $todate) {
+ $acc_trans_where = "ac.trans_id IN (SELECT DISTINCT trans_id FROM acc_trans WHERE ";
+
+ if ($fromdate) {
+ $acc_trans_where .= "transdate >= '$fromdate'";
+ }
+ if ($todate) {
+ $acc_trans_where .= " AND " if ($fromdate);
+ $acc_trans_where .= "transdate <= '$todate'";
+ }
+
+ $acc_trans_where .= ")";
+ }
+
############################################
# Method eq 'cash' = IST Versteuerung
############################################
############################################
# Method eq 'cash' = IST Versteuerung
############################################
@@
-843,9
+858,7
@@
sub get_accounts_ustva {
)
)
WHERE
)
)
WHERE
- 1=1
- -- Here no where, please. All Transactions ever should be
- -- testet if they are paied in the USTVA report period.
+ $acc_trans_where
GROUP BY tk.pos_ustva
|;
GROUP BY tk.pos_ustva
|;