Projekt

Allgemein

Profil

« Zurück | Weiter » 

Revision 72eaa1a7

Von Moritz Bunkus vor fast 18 Jahren hinzugefügt

  • ID 72eaa1a75c2b38a91ae8eeaf98319da9de3eac3a
  • Vorgänger cfc6a60d
  • Nachfolger a4b22a8f

Bei Berichtsfunktion nach Projekten suchen und sich Projekte ausgeben lassen (bisher nur OE; IR und IS folgen).

Unterschiede anzeigen:

SL/OE.pm
52 52
  my ($null, $department_id) = split /--/, $form->{department};
53 53

  
54 54
  my $department = " AND o.department_id = $department_id" if $department_id;
55
  my @values;
56

  
57
  if ($form->{"project_id"}) {
58
    $department .=
59
      qq|AND ((globalproject_id = ?) OR EXISTS | .
60
      qq|  (SELECT * FROM orderitems oi | .
61
      qq|   WHERE oi.project_id = ? AND oi.trans_id = o.id))|;
62
    push(@values, $form->{"project_id"}, $form->{"project_id"});
63
  }
55 64

  
56 65
  my $rate = ($form->{vc} eq 'customer') ? 'buy' : 'sell';
57 66

  
......
65 74

  
66 75
  my $query = qq|SELECT o.id, o.ordnumber, o.transdate, o.reqdate,
67 76
                 o.amount, ct.name, o.netamount, o.$form->{vc}_id,
77
                 o.globalproject_id, pr.projectnumber AS globalprojectnumber,
68 78
		 ex.$rate AS exchangerate,
69 79
		 o.closed, o.delivered, o.quonumber, o.shippingpoint, o.shipvia,
70 80
		 e.name AS employee
......
73 83
	         LEFT JOIN employee e ON (o.employee_id = e.id)
74 84
	         LEFT JOIN exchangerate ex ON (ex.curr = o.curr
75 85
		                               AND ex.transdate = o.transdate)
86
                 LEFT JOIN project pr ON o.globalproject_id = pr.id
76 87
	         WHERE o.quotation = '$quotation'
77 88
		 $department|;
78 89

  
......
107 118
  $query .= " ORDER by $sortorder";
108 119

  
109 120
  my $sth = $dbh->prepare($query);
110
  $sth->execute || $form->dberror($query);
121
  $sth->execute(@values) ||
122
    $form->dberror($query . " (" . join(", ", @values) . ")");
123

  
124
  dump_query(0, "laqje", $query, @values);
111 125

  
112 126
  my %id = ();
113 127
  while (my $ref = $sth->fetchrow_hashref(NAME_lc)) {
bin/mozilla/oe.pl
1375 1375
                              <td><input name=transdateto id=transdateto size=11 title="$myconfig{dateformat}"></td>|;
1376 1376
  }
1377 1377

  
1378
  $form->get_lists("projects" => { "key" => "ALL_PROJECTS",
1379
                                   "all" => 1 });
1380

  
1381
  my %labels = ();
1382
  my @values = ("");
1383
  foreach my $item (@{ $form->{"ALL_PROJECTS"} }) {
1384
    push(@values, $item->{"id"});
1385
    $labels{$item->{"id"}} = $item->{"projectnumber"};
1386
  }
1387
  my $projectnumber =
1388
    NTI($cgi->popup_menu('-name' => 'project_id', '-values' => \@values,
1389
                         '-labels' => \%labels));
1390

  
1378 1391
  $form->header;
1379 1392

  
1380 1393
  print qq|
......
1399 1412
          <th align=right>$ordlabel</th>
1400 1413
          <td colspan=3><input name="$ordnumber" size=20></td>
1401 1414
        </tr>
1415
        <tr>
1416
          <th align="right">| . $locale->text("Project Number") . qq|</th>
1417
          <td colspan="3">$projectnumber</td>
1418
        </tr>
1402 1419
        <tr>
1403 1420
          <th align=right>| . $locale->text('From') . qq|</th>
1404 1421
          $button1
......
1426 1443
	        <td><input name="l_employee" class=checkbox type=checkbox value=Y checked> $employee</td>
1427 1444
		<td><input name="l_shipvia" class=checkbox type=checkbox value=Y> |
1428 1445
    . $locale->text('Ship via') . qq|</td>
1446
	        <td><input name="l_employee" class=checkbox type=checkbox value=Y checked> $employee</td>
1429 1447
	      </tr>
1430 1448
	      <tr>
1431 1449
		<td><input name="l_netamount" class=checkbox type=checkbox value=Y> |
......
1434 1452
    . $locale->text('Tax') . qq|</td>
1435 1453
		<td><input name="l_amount" class=checkbox type=checkbox value=Y checked> |
1436 1454
    . $locale->text('Total') . qq|</td>
1455
          <td><input name="l_globalprojectnumber" class=checkbox type=checkbox value=Y> |
1456
          . $locale->text('Project Number') . qq|</td>
1437 1457
	      </tr>
1438 1458
	      <tr>
1439 1459
	        <td><input name="l_subtotal" class=checkbox type=checkbox value=Y> |
......
1499 1519
  @columns =
1500 1520
    $form->sort_columns("transdate", "reqdate",   "id",      "$ordnumber",
1501 1521
                        "name",      "netamount", "tax",     "amount",
1502
                        "curr",      "employee",  "shipvia", "open",
1503
                        "closed",    "delivered");
1522
                        "curr",      "employee",  "shipvia", "globalprojectnumber",
1523
                        "open",      "closed",    "delivered");
1504 1524

  
1505 1525
  $form->{l_open} = $form->{l_closed} = "Y"
1506 1526
    if ($form->{open} && $form->{closed});
......
1584 1604
      qq|<th><a class=listheading href=$href&sort=shipvia>|
1585 1605
    . $locale->text('Ship via')
1586 1606
    . qq|</a></th>|;
1607
  $column_header{globalprojectnumber} =
1608
    qq|<th class="listheading">| . $locale->text('Project Number') . qq|</th>|;
1587 1609
  $column_header{open} =
1588 1610
    qq|<th class=listheading>| . $locale->text('O') . qq|</th>|;
1589 1611
  $column_header{closed} =
......
1700 1722

  
1701 1723
    $column_data{employee} = "<td>$oe->{employee}&nbsp;</td>";
1702 1724
    $column_data{shipvia}  = "<td>$oe->{shipvia}&nbsp;</td>";
1725
    $column_data{globalprojectnumber}  = "<td>" . H($oe->{globalprojectnumber}) . "</td>";
1703 1726

  
1704 1727
    if ($oe->{closed}) {
1705 1728
      $column_data{closed} = "<td align=center>X</td>";

Auch abrufbar als: Unified diff