Projekt

Allgemein

Profil

« Zurück | Weiter » 

Revision 134ecd71

Von Moritz Bunkus vor fast 18 Jahren hinzugefügt

  • ID 134ecd713fae927536c69259fbd3489f0925fc3f
  • Vorgänger 960160dc
  • Nachfolger d4651135

Buchungsjournal: Filtermöglichkeit nach Projekten sowie das Anzeigen von Projektnummern implementiert.

Unterschiede anzeigen:

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) {
bin/mozilla/gl.pl
227 227
	</tr>
228 228
| if $form->{selectdepartment};
229 229

  
230
  $form->get_lists("projects" => { "key" => "ALL_PROJECTS",
231
                                   "all" => 1 });
232

  
233
  my %project_labels = ();
234
  my @project_values = ("");
235
  foreach my $item (@{ $form->{"ALL_PROJECTS"} }) {
236
    push(@project_values, $item->{"id"});
237
    $project_labels{$item->{"id"}} = $item->{"projectnumber"};
238
  }
239

  
240
  my $projectnumber =
241
    NTI($cgi->popup_menu('-name' => "project_id",
242
                         '-values' => \@project_values,
243
                         '-labels' => \%project_labels));
244

  
230 245
  # use JavaScript Calendar or not
231 246
  $form->{jsscript} = $jscalendar;
232 247
  $jsscript = "";
......
289 304
	  <th align=right>| . $locale->text('Notes') . qq|</th>
290 305
	  <td colspan=3><input name=notes size=40></td>
291 306
	</tr>
307
	<tr>
308
	  <th align=right>| . $locale->text('Project Number') . qq|</th>
309
	  <td colspan=3>$projectnumber</td>
310
	</tr>
292 311
	<tr>
293 312
	  <th align=right>| . $locale->text('From') . qq|</th>
294 313
          $button1
......
342 361
		  <tr>
343 362
		    <td align=right><input name="l_subtotal" class=checkbox type=checkbox value=Y></td>
344 363
		    <td>| . $locale->text('Subtotal') . qq|</td>
364
		    <td align=right><input name="l_projectnumbers" class=checkbox type=checkbox value=Y></td>
365
		    <td>| . $locale->text('Project Number') . qq|</td>
345 366
		  </tr>
346 367
		</table>
347 368
	      </tr>
......
447 468
    $option   .= "\n<br>" if $option;
448 469
    $option   .= $locale->text('Notes') . " : $form->{notes}";
449 470
  }
471
 if ($form->{project_id}) {
472
    $href     .= "&project_id=" . $form->escape($form->{project_id});
473
    $callback .= "&project_id=" . $form->escape($form->{project_id});
474
  }
450 475

  
451 476
  if ($form->{datefrom}) {
452 477
    $href     .= "&datefrom=$form->{datefrom}";
......
469 494
      . $locale->date(\%myconfig, $form->{dateto}, 1);
470 495
  }
471 496

  
472
  @columns = $form->sort_columns(
473
    qw(transdate id reference description notes source debit debit_accno credit credit_accno debit_tax debit_tax_accno credit_tax credit_tax_accno accno gifi_accno)
474
  );
497
  @columns =
498
    qw(transdate id reference description notes source debit debit_accno credit
499
       credit_accno debit_tax debit_tax_accno credit_tax credit_tax_accno accno
500
       gifi_accno projectnumbers);
475 501

  
476 502
  if ($form->{accno} || $form->{gifi_accno}) {
477 503
    @columns = grep !/(accno|gifi_accno)/, @columns;
......
560 586
    . $locale->text('GIFI')
561 587
    . "</a></th>";
562 588
  $column_header{balance} = "<th>" . $locale->text('Balance') . "</th>";
589
  $column_header{projectnumbers} =
590
      "<th class=listheading>"  . $locale->text('Project Numbers') . "</th>";
563 591

  
564 592
  $form->{landscape} = 1;
565 593

  
......
789 817
    $column_data{balance} =
790 818
      "<td align=right>"
791 819
      . $form->format_amount(\%myconfig, $form->{balance}, 2, 0) . "</td>";
820
    $column_data{projectnumbers} =
821
      "<td>" . join(", ", sort({ lc($a) cmp lc($b) } keys(%{ $ref->{projectnumbers} }))) . "</td>";
792 822

  
793 823
    $i++;
794 824
    $i %= 2;
locale/de/all
804 804
  'Project'                     => 'Projekt',
805 805
  'Project Number'              => 'Projektnummer',
806 806
  'Project Number missing!'     => 'Projektnummer fehlt!',
807
  'Project Numbers'             => 'Projektnummern',
807 808
  'Project Transactions'        => 'Projektbuchungen',
808 809
  'Project deleted!'            => 'Projekt gel?scht!',
809 810
  'Project description'         => 'Projektbeschreibung',
locale/de/gl
78 78
  'Post'                        => 'Buchen',
79 79
  'Post as new'                 => 'Neu buchen',
80 80
  'Project Number'              => 'Projektnummer',
81
  'Project Numbers'             => 'Projektnummern',
81 82
  'Project not on file!'        => 'Dieses Projekt ist nicht in der Datenbank!',
82 83
  'Reference'                   => 'Referenz',
83 84
  'Reference missing!'          => 'Referenz fehlt!',

Auch abrufbar als: Unified diff