Revision b3e58871
Von Moritz Bunkus vor fast 9 Jahren hinzugefügt
SL/GL.pm | ||
---|---|---|
41 | 41 |
use Data::Dumper; |
42 | 42 |
use SL::DATEV qw(:CONSTANTS); |
43 | 43 |
use SL::DBUtils; |
44 |
use SL::Util qw(trim); |
|
44 | 45 |
|
45 | 46 |
use strict; |
46 | 47 |
|
... | ... | |
230 | 231 |
$glwhere .= qq| AND g.reference ILIKE ?|; |
231 | 232 |
$arwhere .= qq| AND a.invnumber ILIKE ?|; |
232 | 233 |
$apwhere .= qq| AND a.invnumber ILIKE ?|; |
233 |
push(@glvalues, '%' . $form->{reference} . '%');
|
|
234 |
push(@arvalues, '%' . $form->{reference} . '%');
|
|
235 |
push(@apvalues, '%' . $form->{reference} . '%');
|
|
234 |
push(@glvalues, $::form->like($form->{reference}));
|
|
235 |
push(@arvalues, $::form->like($form->{reference}));
|
|
236 |
push(@apvalues, $::form->like($form->{reference}));
|
|
236 | 237 |
} |
237 | 238 |
|
238 | 239 |
if ($form->{department}) { |
... | ... | |
249 | 250 |
$glwhere .= " AND ac.trans_id IN (SELECT trans_id from acc_trans WHERE source ILIKE ?)"; |
250 | 251 |
$arwhere .= " AND ac.trans_id IN (SELECT trans_id from acc_trans WHERE source ILIKE ?)"; |
251 | 252 |
$apwhere .= " AND ac.trans_id IN (SELECT trans_id from acc_trans WHERE source ILIKE ?)"; |
252 |
push(@glvalues, '%' . $form->{source} . '%');
|
|
253 |
push(@arvalues, '%' . $form->{source} . '%');
|
|
254 |
push(@apvalues, '%' . $form->{source} . '%');
|
|
253 |
push(@glvalues, $::form->like($form->{source}));
|
|
254 |
push(@arvalues, $::form->like($form->{source}));
|
|
255 |
push(@apvalues, $::form->like($form->{source}));
|
|
255 | 256 |
} |
256 | 257 |
|
257 | 258 |
# default Datumseinschränkung falls nicht oder falsch übergeben (sollte nie passieren) |
258 | 259 |
$form->{datesort} = 'transdate' unless $form->{datesort} =~ /^(transdate|gldate)$/; |
259 | 260 |
|
260 |
if ($form->{datefrom}) {
|
|
261 |
if (trim($form->{datefrom})) {
|
|
261 | 262 |
$glwhere .= " AND ac.$form->{datesort} >= ?"; |
262 | 263 |
$arwhere .= " AND ac.$form->{datesort} >= ?"; |
263 | 264 |
$apwhere .= " AND ac.$form->{datesort} >= ?"; |
264 |
push(@glvalues, $form->{datefrom});
|
|
265 |
push(@arvalues, $form->{datefrom});
|
|
266 |
push(@apvalues, $form->{datefrom});
|
|
265 |
push(@glvalues, trim($form->{datefrom}));
|
|
266 |
push(@arvalues, trim($form->{datefrom}));
|
|
267 |
push(@apvalues, trim($form->{datefrom}));
|
|
267 | 268 |
} |
268 | 269 |
|
269 |
if ($form->{dateto}) {
|
|
270 |
if (trim($form->{dateto})) {
|
|
270 | 271 |
$glwhere .= " AND ac.$form->{datesort} <= ?"; |
271 | 272 |
$arwhere .= " AND ac.$form->{datesort} <= ?"; |
272 | 273 |
$apwhere .= " AND ac.$form->{datesort} <= ?"; |
273 |
push(@glvalues, $form->{dateto});
|
|
274 |
push(@arvalues, $form->{dateto});
|
|
275 |
push(@apvalues, $form->{dateto});
|
|
274 |
push(@glvalues, trim($form->{dateto}));
|
|
275 |
push(@arvalues, trim($form->{dateto}));
|
|
276 |
push(@apvalues, trim($form->{dateto}));
|
|
276 | 277 |
} |
277 | 278 |
|
278 |
if ($form->{description}) {
|
|
279 |
if (trim($form->{description})) {
|
|
279 | 280 |
$glwhere .= " AND g.description ILIKE ?"; |
280 | 281 |
$arwhere .= " AND ct.name ILIKE ?"; |
281 | 282 |
$apwhere .= " AND ct.name ILIKE ?"; |
282 |
push(@glvalues, '%' . $form->{description} . '%');
|
|
283 |
push(@arvalues, '%' . $form->{description} . '%');
|
|
284 |
push(@apvalues, '%' . $form->{description} . '%');
|
|
283 |
push(@glvalues, $::form->like($form->{description}));
|
|
284 |
push(@arvalues, $::form->like($form->{description}));
|
|
285 |
push(@apvalues, $::form->like($form->{description}));
|
|
285 | 286 |
} |
286 | 287 |
|
287 | 288 |
if ($form->{employee_id}) { |
... | ... | |
293 | 294 |
push(@apvalues, conv_i($form->{employee_id})); |
294 | 295 |
} |
295 | 296 |
|
296 |
if ($form->{notes}) {
|
|
297 |
if (trim($form->{notes})) {
|
|
297 | 298 |
$glwhere .= " AND g.notes ILIKE ?"; |
298 | 299 |
$arwhere .= " AND a.notes ILIKE ?"; |
299 | 300 |
$apwhere .= " AND a.notes ILIKE ?"; |
300 |
push(@glvalues, '%' . $form->{notes} . '%');
|
|
301 |
push(@arvalues, '%' . $form->{notes} . '%');
|
|
302 |
push(@apvalues, '%' . $form->{notes} . '%');
|
|
301 |
push(@glvalues, $::form->like($form->{notes}));
|
|
302 |
push(@arvalues, $::form->like($form->{notes}));
|
|
303 |
push(@apvalues, $::form->like($form->{notes}));
|
|
303 | 304 |
} |
304 | 305 |
|
305 | 306 |
if ($form->{accno}) { |
Auch abrufbar als: Unified diff
Buchungsjournal: bei Textfeldern führende/anhängende Whitespaces entfernen