Projekt

Allgemein

Profil

« Zurück | Weiter » 

Revision 29bed1cf

Von Bernd Bleßmann vor etwa 4 Jahren hinzugefügt

Buchungsjournal: auch globale Projektnummer im Bericht mit anzeigen

Unterschiede anzeigen:

SL/GL.pm
328 328
    push(@apvalues, $project_id, $project_id);
329 329
  }
330 330

  
331
  my ($project_columns, $project_join);
331
  my ($project_columns,            $project_join);
332
  my ($arap_globalproject_columns, $arap_globalproject_join);
333
  my ($gl_globalproject_columns);
332 334
  if ($form->{"l_projectnumbers"}) {
333
    $project_columns = qq|, ac.project_id, pr.projectnumber|;
334
    $project_join = qq|LEFT JOIN project pr ON (ac.project_id = pr.id)|;
335
    $project_columns            = qq|, ac.project_id, pr.projectnumber|;
336
    $project_join               = qq|LEFT JOIN project pr ON (ac.project_id = pr.id)|;
337
    $arap_globalproject_columns = qq|, a.globalproject_id, globalpr.projectnumber AS globalprojectnumber|;
338
    $arap_globalproject_join    = qq|LEFT JOIN project globalpr ON (a.globalproject_id = globalpr.id)|;
339
    $gl_globalproject_columns   = qq|, NULL AS globalproject_id, '' AS globalprojectnumber|;
335 340
  }
336 341

  
337 342
  if ($form->{accno}) {
......
384 389
        ac.amount, c.accno, g.notes, t.chart_id,
385 390
        d.description AS department,
386 391
        CASE WHEN (COALESCE(e.name, '') = '') THEN e.login ELSE e.name END AS employee
387
        $project_columns
392
        $project_columns $gl_globalproject_columns
388 393
        $columns_for_sorting{gl}
389 394
      FROM gl g
390 395
      LEFT JOIN employee e ON (g.employee_id = e.id)
......
402 407
        ac.amount, c.accno, a.notes, t.chart_id,
403 408
        d.description AS department,
404 409
        CASE WHEN (COALESCE(e.name, '') = '') THEN e.login ELSE e.name END AS employee
405
        $project_columns
410
        $project_columns $arap_globalproject_columns
406 411
        $columns_for_sorting{arap}
407 412
      FROM ar a
408 413
      LEFT JOIN employee e ON (a.employee_id = e.id)
409
      LEFT JOIN department d ON (a.department_id = d.id),
414
      LEFT JOIN department d ON (a.department_id = d.id)
415
      $arap_globalproject_join,
410 416
      acc_trans ac $project_join, customer ct, chart c
411 417
      LEFT JOIN tax t ON (t.chart_id=c.id)
412 418
      WHERE $arwhere
......
421 427
        ac.amount, c.accno, a.notes, t.chart_id,
422 428
        d.description AS department,
423 429
        CASE WHEN (COALESCE(e.name, '') = '') THEN e.login ELSE e.name END AS employee
424
        $project_columns
430
        $project_columns $arap_globalproject_columns
425 431
        $columns_for_sorting{arap}
426 432
      FROM ap a
427 433
      LEFT JOIN employee e ON (a.employee_id = e.id)
428
      LEFT JOIN department d ON (a.department_id = d.id),
434
      LEFT JOIN department d ON (a.department_id = d.id)
435
      $arap_globalproject_join,
429 436
      acc_trans ac $project_join, vendor ct, chart c
430 437
      LEFT JOIN tax t ON (t.chart_id=c.id)
431 438
      WHERE $apwhere
......
491 498
      }
492 499

  
493 500
      $ref->{"projectnumbers"} = {};
494
      $ref->{"projectnumbers"}->{$ref->{"projectnumber"}} = 1 if ($ref->{"projectnumber"});
501
      $ref->{"projectnumbers"}->{$ref->{"projectnumber"}}       = 1 if ($ref->{"projectnumber"});
502
      $ref->{"projectnumbers"}->{$ref->{"globalprojectnumber"}} = 1 if ($ref->{"globalprojectnumber"});
495 503

  
496 504
      $balance = $ref->{amount};
497 505

  
......
547 555
      $balance =
548 556
        (int($balance * 100000) + int(100000 * $ref2->{amount})) / 100000;
549 557

  
550
      $ref->{"projectnumbers"}->{$ref2->{"projectnumber"}} = 1 if ($ref2->{"projectnumber"});
558
      $ref->{"projectnumbers"}->{$ref2->{"projectnumber"}}       = 1 if ($ref2->{"projectnumber"});
559
      $ref->{"projectnumbers"}->{$ref2->{"globalprojectnumber"}} = 1 if ($ref2->{"globalprojectnumber"});
551 560

  
552 561
      if ($ref2->{chart_id} > 0) { # all tax accounts, following lines
553 562
        if ($ref2->{amount} < 0) {

Auch abrufbar als: Unified diff