Revision 6c7334b3
Von Philip Reetz vor mehr als 15 Jahren hinzugefügt
SL/GL.pm | ||
---|---|---|
221 | 221 |
} |
222 | 222 |
|
223 | 223 |
if ($form->{source}) { |
224 |
$glwhere .= " AND ac.source ILIKE ?";
|
|
225 |
$arwhere .= " AND ac.source ILIKE ?";
|
|
226 |
$apwhere .= " AND ac.source ILIKE ?";
|
|
224 |
$glwhere .= " AND ac.trans_id IN (SELECT trans_id from acc_trans WHERE source ILIKE ?)";
|
|
225 |
$arwhere .= " AND ac.trans_id IN (SELECT trans_id from acc_trans WHERE source ILIKE ?)";
|
|
226 |
$apwhere .= " AND ac.trans_id IN (SELECT trans_id from acc_trans WHERE source ILIKE ?)";
|
|
227 | 227 |
push(@glvalues, '%' . $form->{source} . '%'); |
228 | 228 |
push(@arvalues, '%' . $form->{source} . '%'); |
229 | 229 |
push(@apvalues, '%' . $form->{source} . '%'); |
... | ... | |
321 | 321 |
'id' => [ qw(id) ], |
322 | 322 |
'transdate' => [ qw(transdate id) ], |
323 | 323 |
'reference' => [ qw(lower_reference id) ], |
324 |
'source' => [ qw(lower_source id) ], |
|
325 | 324 |
'description' => [ qw(lower_description id) ], |
326 | 325 |
'accno' => [ qw(accno transdate id) ], |
327 | 326 |
); |
... | ... | |
403 | 402 |
|
404 | 403 |
$trans_id = $ref0->{id}; |
405 | 404 |
|
405 |
my $source = $ref0->{source}; |
|
406 |
undef($ref0->{source}); |
|
407 |
|
|
406 | 408 |
if ($trans_id != $trans_id2) { # first line of a booking |
407 | 409 |
|
408 | 410 |
if ($trans_id2) { |
... | ... | |
447 | 449 |
$i = 0; # Debit Tax # AP_tax # VSt |
448 | 450 |
$j = 0; # Credit Tax # AR_tax # USt |
449 | 451 |
|
450 |
|
|
451 | 452 |
if ($ref->{chart_id} > 0) { # all tax accounts first line, no line increasing |
452 | 453 |
if ($ref->{amount} < 0) { |
453 | 454 |
if ($ref->{link} =~ /AR_tax/) { |
454 | 455 |
$ref->{credit_tax}{$j} = $ref->{amount}; |
455 | 456 |
$ref->{credit_tax_accno}{$j} = $ref->{accno}; |
456 |
}
|
|
457 |
} |
|
457 | 458 |
if ($ref->{link} =~ /AP_tax/) { |
458 | 459 |
$ref->{debit_tax}{$i} = $ref->{amount} * -1; |
459 | 460 |
$ref->{debit_tax_accno}{$i} = $ref->{accno}; |
... | ... | |
469 | 470 |
} |
470 | 471 |
} |
471 | 472 |
} else { #all other accounts first line |
473 |
|
|
472 | 474 |
if ($ref->{amount} < 0) { |
473 | 475 |
$ref->{debit}{$k} = $ref->{amount} * -1; |
474 | 476 |
$ref->{debit_accno}{$k} = $ref->{accno}; |
475 | 477 |
$ref->{debit_taxkey}{$k} = $ref->{taxkey}; |
476 | 478 |
$ref->{ac_transdate}{$k} = $ref->{transdate}; |
477 |
|
|
479 |
$ref->{source}{$k} = $source; |
|
478 | 480 |
} else { |
479 | 481 |
$ref->{credit}{$l} = $ref->{amount} * 1; |
480 | 482 |
$ref->{credit_accno}{$l} = $ref->{accno}; |
481 | 483 |
$ref->{credit_taxkey}{$l} = $ref->{taxkey}; |
482 | 484 |
$ref->{ac_transdate}{$l} = $ref->{transdate}; |
483 |
|
|
484 |
|
|
485 |
$ref->{source}{$l} = $source; |
|
485 | 486 |
} |
486 | 487 |
} |
487 | 488 |
|
... | ... | |
533 | 534 |
if ($ref->{debit_accno}{$k} ne "") { |
534 | 535 |
$k++; |
535 | 536 |
} |
537 |
if ($ref->{source}{$k} ne "") { |
|
538 |
$space = " | "; |
|
539 |
} else { |
|
540 |
$space = ""; |
|
541 |
} |
|
536 | 542 |
$ref->{debit}{$k} = $ref2->{amount} * - 1; |
537 | 543 |
$ref->{debit_accno}{$k} = $ref2->{accno}; |
538 | 544 |
$ref->{debit_taxkey}{$k} = $ref2->{taxkey}; |
539 | 545 |
$ref->{ac_transdate}{$k} = $ref2->{transdate}; |
546 |
$ref->{source}{$k} = $source . $space . $ref->{source}{$k}; |
|
540 | 547 |
} else { |
541 | 548 |
if ($ref->{credit_accno}{$l} ne "") { |
542 | 549 |
$l++; |
543 | 550 |
} |
551 |
if ($ref->{source}{$l} ne "") { |
|
552 |
$space = " | "; |
|
553 |
} else { |
|
554 |
$space = ""; |
|
555 |
} |
|
544 | 556 |
$ref->{credit}{$l} = $ref2->{amount}; |
545 | 557 |
$ref->{credit_accno}{$l} = $ref2->{accno}; |
546 | 558 |
$ref->{credit_taxkey}{$l} = $ref2->{taxkey}; |
547 | 559 |
$ref->{ac_transdate}{$l} = $ref2->{transdate}; |
560 |
$ref->{source}{$l} = $ref->{source}{$l} . $space . $source; |
|
548 | 561 |
} |
549 | 562 |
} |
550 | 563 |
} |
551 | 564 |
} |
565 |
|
|
552 | 566 |
push @{ $form->{GL} }, $ref; |
553 | 567 |
$sth->finish; |
554 | 568 |
|
bin/mozilla/gl.pl | ||
---|---|---|
497 | 497 |
'projectnumbers' => { 'text' => $locale->text('Project Numbers'), }, |
498 | 498 |
); |
499 | 499 |
|
500 |
foreach my $name (qw(id transdate reference source description debit_accno credit_accno debit_tax_accno credit_tax_accno)) {
|
|
500 |
foreach my $name (qw(id transdate reference description debit_accno credit_accno debit_tax_accno credit_tax_accno)) { |
|
501 | 501 |
my $sortname = $name =~ m/accno/ ? 'accno' : $name; |
502 | 502 |
my $sortdir = $sortname eq $form->{sort} ? 1 - $form->{sortdir} : $form->{sortdir}; |
503 | 503 |
$column_defs{$name}->{link} = $callback . "&sort=$sortname&sortdir=$sortdir"; |
... | ... | |
564 | 564 |
} |
565 | 565 |
} |
566 | 566 |
|
567 |
foreach my $key (qw(debit_accno credit_accno debit_tax_accno credit_tax_accno ac_transdate)) { |
|
567 |
foreach my $key (qw(debit_accno credit_accno debit_tax_accno credit_tax_accno ac_transdate source)) {
|
|
568 | 568 |
my $col = $key eq 'ac_transdate' ? 'transdate' : $key; |
569 | 569 |
$rows{$col} = [ map { $ref->{$key}->{$_} } sort keys(%{ $ref->{$key} }) ]; |
570 | 570 |
} |
... | ... | |
575 | 575 |
$row->{balance}->{data} = $form->format_amount(\%myconfig, $form->{balance}, 2); |
576 | 576 |
$row->{projectnumbers}->{data} = join ", ", sort { lc($a) cmp lc($b) } keys %{ $ref->{projectnumbers} }; |
577 | 577 |
|
578 |
map { $row->{$_}->{data} = $ref->{$_} } qw(id reference description source notes);
|
|
578 |
map { $row->{$_}->{data} = $ref->{$_} } qw(id reference description notes); |
|
579 | 579 |
|
580 |
map { $row->{$_}->{data} = \@{ $rows{$_} }; } qw(transdate debit credit debit_accno credit_accno debit_tax_accno credit_tax_accno); |
|
580 |
map { $row->{$_}->{data} = \@{ $rows{$_} }; } qw(transdate debit credit debit_accno credit_accno debit_tax_accno credit_tax_accno source);
|
|
581 | 581 |
|
582 | 582 |
foreach my $col (qw(debit_accno credit_accno debit_tax_accno credit_tax_accno)) { |
583 | 583 |
$row->{$col}->{link} = [ map { "${callback}&accno=" . E($_) } @{ $rows{$col} } ]; |
Auch abrufbar als: Unified diff
Bug #897 behoben: Belege wurden im Buchungsjournal nicht korrekt angezeigt, Zusaetzlich Suchen nach Belegen angepasst, so dass der komplette Buchungssatz ausgegeben wird und Sortierung nach Belegen ausgeschaltet