Revision 960160dc
Von Moritz Bunkus vor fast 18 Jahren hinzugefügt
SL/RP.pm | ||
---|---|---|
918 | 918 |
my $project; |
919 | 919 |
my $where = "1 = 1"; |
920 | 920 |
my $glwhere = ""; |
921 |
my $prwhere = ""; |
|
921 | 922 |
my $subwhere = ""; |
922 | 923 |
my $item; |
923 | 924 |
|
... | ... | |
925 | 926 |
if ($form->{method} eq 'cash') { |
926 | 927 |
$subwhere .= " AND transdate >= '$fromdate'"; |
927 | 928 |
$glwhere = " AND ac.transdate >= '$fromdate'"; |
929 |
$prwhere = " AND ar.transdate >= '$fromdate'"; |
|
928 | 930 |
} else { |
929 | 931 |
$where .= " AND ac.transdate >= '$fromdate'"; |
930 | 932 |
} |
... | ... | |
933 | 935 |
if ($todate) { |
934 | 936 |
$where .= " AND ac.transdate <= '$todate'"; |
935 | 937 |
$subwhere .= " AND transdate <= '$todate'"; |
938 |
$prwhere .= " AND ar.transdate <= '$todate'"; |
|
936 | 939 |
} |
937 | 940 |
|
938 | 941 |
if ($department_id) { |
... | ... | |
1025 | 1028 |
JOIN parts p ON (ac.parts_id = p.id) |
1026 | 1029 |
JOIN chart c on (p.income_accno_id = c.id) |
1027 | 1030 |
$dpt_join |
1028 |
-- use transdate from subwhere |
|
1029 |
WHERE 1 = 1 $subwhere |
|
1031 |
WHERE 1 = 1 $prwhere |
|
1030 | 1032 |
AND c.category = 'I' |
1031 | 1033 |
$dpt_where |
1032 | 1034 |
AND ac.trans_id IN |
... | ... | |
1050 | 1052 |
JOIN parts p ON (ac.parts_id = p.id) |
1051 | 1053 |
JOIN chart c on (p.expense_accno_id = c.id) |
1052 | 1054 |
$dpt_join |
1053 |
WHERE 1 = 1 $subwhere
|
|
1055 |
WHERE 1 = 1 $prwhere
|
|
1054 | 1056 |
AND c.category = 'E' |
1055 | 1057 |
$dpt_where |
1056 | 1058 |
AND ac.trans_id IN |
... | ... | |
1104 | 1106 |
JOIN parts p ON (ac.parts_id = p.id) |
1105 | 1107 |
JOIN chart c on (p.income_accno_id = c.id) |
1106 | 1108 |
$dpt_join |
1107 |
-- use transdate from subwhere |
|
1108 |
WHERE 1 = 1 $subwhere |
|
1109 |
WHERE 1 = 1 $prwhere |
|
1109 | 1110 |
AND c.category = 'I' |
1110 | 1111 |
$dpt_where |
1111 | 1112 |
$project |
... | ... | |
1120 | 1121 |
JOIN parts p ON (ac.parts_id = p.id) |
1121 | 1122 |
JOIN chart c on (p.expense_accno_id = c.id) |
1122 | 1123 |
$dpt_join |
1123 |
WHERE 1 = 1 $subwhere
|
|
1124 |
WHERE 1 = 1 $prwhere
|
|
1124 | 1125 |
AND c.category = 'E' |
1125 | 1126 |
$dpt_where |
1126 | 1127 |
$project |
Auch abrufbar als: Unified diff
Fix für SQL-Fehler, dass transdate mehrdeutig ist, wenn auch nach Projekten gefiltert wird.