Revision 8dc4cef2
Von Bernd Bleßmann vor etwa 9 Jahren hinzugefügt
SL/CT.pm | ||
---|---|---|
76 | 76 |
"city" => "ct.city", |
77 | 77 |
"country" => "ct.country", |
78 | 78 |
"discount" => "ct.discount", |
79 |
"insertdate" => "ct.itime", |
|
79 | 80 |
"salesman" => "e.name", |
80 | 81 |
"payment" => "pt.description" |
81 | 82 |
); |
... | ... | |
92 | 93 |
} |
93 | 94 |
my $sortdir = !defined $form->{sortdir} ? 'ASC' : $form->{sortdir} ? 'ASC' : 'DESC'; |
94 | 95 |
|
95 |
if ($sortorder !~ /(business|id|discount)/ && !$join_records) { |
|
96 |
if ($sortorder !~ /(business|id|discount|itime)/ && !$join_records) {
|
|
96 | 97 |
$sortorder = "lower($sortorder) ${sortdir}"; |
97 | 98 |
} else { |
98 | 99 |
$sortorder .= " ${sortdir}"; |
... | ... | |
176 | 177 |
push(@values, conv_i($form->{salesman_id})); |
177 | 178 |
} |
178 | 179 |
|
180 |
if($form->{insertdatefrom}) { |
|
181 |
$where .= qq| AND (ct.itime::DATE >= ?)|; |
|
182 |
push@values, conv_date($form->{insertdatefrom}); |
|
183 |
} |
|
184 |
|
|
185 |
if($form->{insertdateto}) { |
|
186 |
$where .= qq| AND (ct.itime::DATE <= ?)|; |
|
187 |
push @values, conv_date($form->{insertdateto}); |
|
188 |
} |
|
189 |
|
|
179 | 190 |
# Nur Kunden finden, bei denen ich selber der Verkäufer bin |
180 | 191 |
# Gilt nicht für Lieferanten |
181 | 192 |
if ($cv eq 'customer' && !$main::auth->assert('customer_vendor_all_edit', 1)) { |
... | ... | |
203 | 214 |
} |
204 | 215 |
|
205 | 216 |
my $query = |
206 |
qq|SELECT ct.*, b.description AS business, e.name as salesman, |.
|
|
217 |
qq|SELECT ct.*, ct.itime::DATE AS insertdate, b.description AS business, e.name as salesman, | .
|
|
207 | 218 |
qq| pt.description as payment | . |
208 | 219 |
(qq|, NULL AS invnumber, NULL AS ordnumber, NULL AS quonumber, NULL AS invid, NULL AS module, NULL AS formtype, NULL AS closed | x!! $join_records) . |
209 | 220 |
qq|FROM $cv ct | . |
... | ... | |
223 | 234 |
push(@values, @saved_values); |
224 | 235 |
$query .= |
225 | 236 |
qq| UNION | . |
226 |
qq|SELECT ct.*, b.description AS business, e.name as salesman, |.
|
|
237 |
qq|SELECT ct.*, ct.itime::DATE AS insertdate, b.description AS business, e.name as salesman, | .
|
|
227 | 238 |
qq| pt.description as payment, | . |
228 | 239 |
qq| a.invnumber, a.ordnumber, a.quonumber, a.id AS invid, | . |
229 | 240 |
qq| '$module' AS module, 'invoice' AS formtype, | . |
... | ... | |
240 | 251 |
push(@values, @saved_values); |
241 | 252 |
$query .= |
242 | 253 |
qq| UNION | . |
243 |
qq|SELECT ct.*, b.description AS business, e.name as salesman, |.
|
|
254 |
qq|SELECT ct.*, ct.itime::DATE AS insertdate, b.description AS business, e.name as salesman, | .
|
|
244 | 255 |
qq| pt.description as payment, | . |
245 | 256 |
qq| ' ' AS invnumber, o.ordnumber, o.quonumber, o.id AS invid, | . |
246 | 257 |
qq| 'oe' AS module, 'order' AS formtype, o.closed | . |
... | ... | |
256 | 267 |
push(@values, @saved_values); |
257 | 268 |
$query .= |
258 | 269 |
qq| UNION | . |
259 |
qq|SELECT ct.*, b.description AS business, e.name as salesman, | . |
|
270 |
qq|SELECT ct.*, ct.itime::DATE AS insertdate, b.description AS business, e.name as salesman, | .
|
|
260 | 271 |
qq| pt.description as payment, | . |
261 | 272 |
qq| ' ' AS invnumber, o.ordnumber, o.quonumber, o.id AS invid, | . |
262 | 273 |
qq| 'oe' AS module, 'quotation' AS formtype, o.closed | . |
Auch abrufbar als: Unified diff
surplus: Erfassungsdatum bei Stammdatensuche Kunden/Lieferanten ...
... im Bericht anzeigen und danach filtern.
Conflicts:
Übernahme aus Kundenprojekt.