Projekt

Allgemein

Profil

« Zurück | Weiter » 

Revision 4a19c3d4

Von Udo Spallek vor etwa 17 Jahren hinzugefügt

  • ID 4a19c3d4287ccc276008fd78e63db25930d68f41
  • Vorgänger 900dff5f
  • Nachfolger ee3ab257

Verkauf->Berichte: Auftrag und Angebot Suche nach Salesman implementiert.

Unterschiede anzeigen:

SL/OE.pm
72 72
    qq|  o.marge_total, o.marge_percent, | .
73 73
    qq|  ex.$rate AS exchangerate, | .
74 74
    qq|  pr.projectnumber AS globalprojectnumber, | .
75
    qq|  e.name AS employee | .
75
    qq|  e.name AS employee, s.name AS salesman | .
76 76
    qq|FROM oe o | .
77 77
    qq|JOIN $vc ct ON (o.${vc}_id = ct.id) | .
78 78
    qq|LEFT JOIN employee e ON (o.employee_id = e.id) | .
79
    qq|LEFT JOIN employee s ON (o.salesman_id = s.id) | .
79 80
    qq|LEFT JOIN exchangerate ex ON (ex.curr = o.curr | .
80 81
    qq|  AND ex.transdate = o.transdate) | .
81 82
    qq|LEFT JOIN project pr ON (o.globalproject_id = pr.id) | .
......
109 110
    $query .= " AND o.employee_id = ?";
110 111
    push @values, conv_i($form->{employee_id});
111 112
  }
113
  
114
  if ($form->{salesman_id}) {
115
    $query .= " AND o.salesman_id = ?";
116
    push @values, conv_i($form->{salesman_id});
117
  }
112 118

  
113 119
  if (!$form->{open} && !$form->{closed}) {
114 120
    $query .= " AND o.id = 0";
......
151 157
     "quonumber" => "o.quonumber",
152 158
     "name" => "ct.name",
153 159
     "employee" => "e.name",
160
     "salesman" => "e.name",
154 161
     "shipvia" => "o.shipvia",
155 162
     "transaction_description" => "o.transaction_description");
156 163
  if ($form->{sort} && grep($form->{sort}, keys(%allowed_sort_columns))) {
bin/mozilla/oe.pl
1307 1307

  
1308 1308
  my $vc = $form->{vc} eq "customer" ? "customers" : "vendors";
1309 1309

  
1310
  $form->get_lists("projects" => { "key" => "ALL_PROJECTS",
1311
                                   "all" => 1 },
1310
  $form->get_lists("projects"  => { "key" => "ALL_PROJECTS",
1311
                                    "all" => 1 },
1312 1312
                   "employees" => "ALL_EMPLOYEES",
1313
                   $vc => "ALL_" . uc($vc));
1313
                   "salesmen"  => "ALL_SALESMEN",
1314
                   $vc         => "ALL_" . uc($vc)
1315
                  );
1314 1316

  
1315 1317
  my %labels = ();
1316 1318
  my @values = ("");
......
1329 1331
    push(@values, $item->{"id"});
1330 1332
    $labels{$item->{"id"}} = $item->{"name"} ne "" ? $item->{"name"} : $item->{"login"};
1331 1333
  }
1334
  
1335
  #salesmen
1336
  my %labels_salesmen = ();
1337
  my @values_salesmen = ('');
1338
  foreach my $item (@{ $form->{"ALL_SALESMEN"} }) {
1339
    push(@values_salesmen, $item->{"id"});
1340
    $labels_salesmen{$item->{"id"}} = $item->{"name"} ne "" ? $item->{"name"} : $item->{"login"};
1341
  }
1332 1342

  
1333 1343
  my $employee_block = qq|
1334 1344
    <tr>
......
1338 1348
                             '-values' => \@values,
1339 1349
                             '-labels' => \%labels)) . qq|
1340 1350
      </td>
1351
    </tr>
1352
    <tr>
1353
      <th align="right">| . $locale->text('Salesman') . qq|</th>
1354
      <td>| .
1355
        NTI($cgi->popup_menu('-name'   => 'salesman_id',
1356
                             '-values' => \@values_salesmen,
1357
                             '-labels' => \%labels_salesmen)) . qq|
1358
      </td>
1341 1359
    </tr>|;
1342 1360

  
1343 1361
  %labels = ();
......
1420 1438
	      <tr>
1421 1439
	        <td><input name="l_name" class=checkbox type=checkbox value=Y checked> $vc_label</td>
1422 1440
	        <td><input name="l_employee" class=checkbox type=checkbox value=Y checked> $employee</td>
1441
	        
1423 1442
		<td><input name="l_shipvia" class=checkbox type=checkbox value=Y> |
1424 1443
    . $locale->text('Ship via') . qq|</td>
1425 1444
	      </tr>
......
1446 1465
	      <tr>
1447 1466
	        <td><input name="l_subtotal" class=checkbox type=checkbox value=Y> |
1448 1467
    . $locale->text('Subtotal') . qq|</td>
1468
                <td><input name="l_salesman" class="checkbox" type="checkbox" value="Y"> |
1469
    . $locale->text('Salesman') . qq|</td>
1449 1470
	      </tr>
1450 1471
	    </table>
1451 1472
          </td>
......
1513 1534
    "name",                    "netamount",
1514 1535
    "tax",                     "amount",
1515 1536
    "curr",                    "employee",
1537
    "salesman",
1516 1538
    "shipvia",                 "globalprojectnumber",
1517 1539
    "transaction_description", "open",
1518 1540
    "delivered", "marge_total", "marge_percent"
......
1551 1573

  
1552 1574
  my @hidden_variables = map { "l_${_}" } @columns;
1553 1575
  push @hidden_variables, "l_subtotal", $form->{vc}, qw(l_closed l_notdelivered open closed delivered notdelivered ordnumber quonumber
1554
                                                        transaction_description transdatefrom transdateto type vc employee_id);
1576
                                                        transaction_description transdatefrom transdateto type vc employee_id salesman_id);
1555 1577

  
1556 1578
  my $href = build_std_url('action=orders', grep { $form->{$_} } @hidden_variables);
1557 1579

  
......
1567 1589
    'tax'                     => { 'text' => $locale->text('Tax'), },
1568 1590
    'amount'                  => { 'text' => $locale->text('Total'), },
1569 1591
    'curr'                    => { 'text' => $locale->text('Curr'), },
1570
    'employee'                => { 'text' => $locale->text('Salesperson'), },
1592
    'employee'                => { 'text' => $locale->text('Employee'), },
1593
    'salesman'                => { 'text' => $locale->text('Salesman'), },
1571 1594
    'shipvia'                 => { 'text' => $locale->text('Ship via'), },
1572 1595
    'globalprojectnumber'     => { 'text' => $locale->text('Project Number'), },
1573 1596
    'transaction_description' => { 'text' => $locale->text('Transaction description'), },
......
1577 1600
    'marge_percent'           => { 'text' => $locale->text('Ertrag prozentual'), }
1578 1601
  );
1579 1602

  
1580
  foreach my $name (qw(id transdate reqdate quonumber ordnumber name employee shipvia)) {
1603
  foreach my $name (qw(id transdate reqdate quonumber ordnumber name employee salesman shipvia)) {
1581 1604
    $column_defs{$name}->{link} = $href . "&sort=$name";
1582 1605
  }
1583 1606

  

Auch abrufbar als: Unified diff