Revision 134ecd71
Von Moritz Bunkus vor fast 18 Jahren hinzugefügt
SL/GL.pm | ||
---|---|---|
201 | 201 |
if ($tax != 0) { |
202 | 202 |
# add taxentry |
203 | 203 |
$query = qq|INSERT INTO acc_trans (trans_id, chart_id, amount, transdate, |
204 |
source, memo, taxkey) |
|
204 |
source, memo, project_id, taxkey)
|
|
205 | 205 |
VALUES |
206 | 206 |
($form->{id}, (SELECT t.chart_id |
207 | 207 |
FROM tax t |
... | ... | |
300 | 300 |
$apwhere .= |
301 | 301 |
" AND ap.id in (SELECT trans_id FROM acc_trans ac2 WHERE ac2.chart_id IN (SELECT id FROM chart c2 WHERE c2.category = '$form->{category}'))"; |
302 | 302 |
} |
303 |
if ($form->{project_id}) { |
|
304 |
$glwhere .= " AND g.id IN (SELECT DISTINCT trans_id FROM acc_trans WHERE project_id = " . conv_i($form->{project_id}, 'NULL') . ")"; |
|
305 |
$arwhere .= |
|
306 |
" AND ((a.globalproject_id = " . conv_i($form->{project_id}, 'NULL') . ") OR " . |
|
307 |
" (a.id IN (SELECT DISTINCT trans_id FROM acc_trans WHERE project_id = " . conv_i($form->{project_id}, 'NULL') . ")))"; |
|
308 |
$apwhere .= |
|
309 |
" AND ((a.globalproject_id = " . conv_i($form->{project_id}, 'NULL') . ") OR " . |
|
310 |
" (a.id IN (SELECT DISTINCT trans_id FROM acc_trans WHERE project_id = " . conv_i($form->{project_id}, 'NULL') . ")))"; |
|
311 |
} |
|
312 |
|
|
313 |
my ($project_columns, %project_join); |
|
314 |
if ($form->{"l_projectnumbers"}) { |
|
315 |
$project_columns = ", ac.project_id, pr.projectnumber"; |
|
316 |
$project_join = "LEFT JOIN project pr ON (ac.project_id = pr.id)"; |
|
317 |
} |
|
303 | 318 |
|
304 | 319 |
if ($form->{accno}) { |
305 | 320 |
|
... | ... | |
375 | 390 |
qq|SELECT ac.oid AS acoid, g.id, 'gl' AS type, $false AS invoice, g.reference, ac.taxkey, c.link, |
376 | 391 |
g.description, ac.transdate, ac.source, ac.trans_id, |
377 | 392 |
ac.amount, c.accno, c.gifi_accno, g.notes, t.chart_id, ac.oid |
378 |
FROM gl g, acc_trans ac, chart c LEFT JOIN tax t ON |
|
393 |
$project_columns |
|
394 |
FROM gl g, acc_trans ac $project_join, chart c LEFT JOIN tax t ON |
|
379 | 395 |
(t.chart_id=c.id) |
380 | 396 |
WHERE $glwhere |
381 | 397 |
AND ac.chart_id = c.id |
... | ... | |
384 | 400 |
SELECT ac.oid AS acoid, a.id, 'ar' AS type, a.invoice, a.invnumber, ac.taxkey, c.link, |
385 | 401 |
ct.name, ac.transdate, ac.source, ac.trans_id, |
386 | 402 |
ac.amount, c.accno, c.gifi_accno, a.notes, t.chart_id, ac.oid |
387 |
FROM ar a, acc_trans ac, customer ct, chart c LEFT JOIN tax t ON |
|
403 |
$project_columns |
|
404 |
FROM ar a, acc_trans ac $project_join, customer ct, chart c LEFT JOIN tax t ON |
|
388 | 405 |
(t.chart_id=c.id) |
389 | 406 |
WHERE $arwhere |
390 | 407 |
AND ac.chart_id = c.id |
... | ... | |
394 | 411 |
SELECT ac.oid AS acoid, a.id, 'ap' AS type, a.invoice, a.invnumber, ac.taxkey, c.link, |
395 | 412 |
ct.name, ac.transdate, ac.source, ac.trans_id, |
396 | 413 |
ac.amount, c.accno, c.gifi_accno, a.notes, t.chart_id, ac.oid |
397 |
FROM ap a, acc_trans ac, vendor ct, chart c LEFT JOIN tax t ON |
|
414 |
$project_columns |
|
415 |
FROM ap a, acc_trans ac $project_join, vendor ct, chart c LEFT JOIN tax t ON |
|
398 | 416 |
(t.chart_id=c.id) |
399 | 417 |
WHERE $apwhere |
400 | 418 |
AND ac.chart_id = c.id |
... | ... | |
447 | 465 |
$ref->{module} = "ar"; |
448 | 466 |
} |
449 | 467 |
} |
450 |
|
|
468 |
|
|
469 |
$ref->{"projectnumbers"} = {}; |
|
470 |
$ref->{"projectnumbers"}->{$ref->{"projectnumber"}} = 1 if ($ref->{"projectnumber"}); |
|
471 |
|
|
451 | 472 |
$balance = $ref->{amount}; |
452 | 473 |
|
453 | 474 |
# Linenumbers of General Ledger |
... | ... | |
503 | 524 |
$balance = |
504 | 525 |
(int($balance * 100000) + int(100000 * $ref2->{amount})) / 100000; |
505 | 526 |
|
527 |
$ref->{"projectnumbers"}->{$ref2->{"projectnumber"}} = 1 if ($ref2->{"projectnumber"}); |
|
506 | 528 |
|
507 | 529 |
if ($ref2->{chart_id} > 0) { # all tax accounts, following lines |
508 | 530 |
if ($ref2->{amount} < 0) { |
Auch abrufbar als: Unified diff
Buchungsjournal: Filtermöglichkeit nach Projekten sowie das Anzeigen von Projektnummern implementiert.