qq|SELECT a.id, a.ordnumber, a.invoice, a.transdate, a.invnumber, a.amount,
ct.name AS customername, ct.id AS customer_id, a.duedate, da.fee,
da.interest, dn.dunning_description, da.transdate AS dunning_date,
- da.duedate AS dunning_duedate, da.dunning_id, da.dunning_config_id
+ da.duedate AS dunning_duedate, da.dunning_id, da.dunning_config_id,
+ e2.name AS salesman
FROM ar a
- JOIN customer ct ON (a.customer_id = ct.id), dunning da
+ JOIN customer ct ON (a.customer_id = ct.id)
+ LEFT JOIN employee e2 ON (a.salesman_id = e2.id), dunning da
LEFT JOIN dunning_config dn ON (da.dunning_config_id = dn.id)
$where
ORDER BY $sortorder|;
$main::auth->assert('dunning_edit');
my @filter_field_list = qw(customer_id customer dunning_level department_id invnumber ordnumber
- transdatefrom transdateto dunningfrom dunningto notes showold);
+ transdatefrom transdateto dunningfrom dunningto notes showold salesman);
report_generator_set_default_sort('customername', 1);
'interest' => { 'text' => $locale->text('Interest') },
);
+ if ($form->{l_salesman}) {
+ # Show salesman column
+ $column_defs{'salesman'} = ( { 'text' => $locale->text('Salesperson') } );
+ }
+
$report->set_columns(%column_defs);
$report->set_column_order(qw(checkbox dunning_description customername invnumber transdate
- duedate amount dunning_date dunning_duedate fee interest));
+ duedate amount dunning_date dunning_duedate fee interest salesman));
$report->set_sort_indicator($form->{sort}, $form->{sortdir});
my $edit_url = build_std_url('script=is.pl', 'action=edit', 'callback') . '&id=';
my $print_url = build_std_url('action=print_dunning', 'format=pdf', 'media=screen') . '&dunning_id=';
my $sort_url = build_std_url('action=show_dunning', grep { $form->{$_} } @filter_field_list);
- foreach my $name (qw(dunning_description customername invnumber transdate duedate dunning_date dunning_duedate)) {
+ foreach my $name (qw(dunning_description customername invnumber transdate duedate dunning_date dunning_duedate salesman)) {
my $sortdir = $form->{sort} eq $name ? 1 - $form->{sortdir} : $form->{sortdir};
$column_defs{$name}->{link} = $sort_url . "&sort=$name&sortdir=$sortdir";
}
- my %alignment = map { $_ => 'right' } qw(transdate duedate amount dunning_date dunning_duedate fee interest);
+ my %alignment = map { $_ => 'right' } qw(transdate duedate amount dunning_date dunning_duedate fee interest salesman);
my ($current_dunning_rows, $previous_dunning_id, $first_row_for_dunning);
'SAVED FOR DUNNING' => 'Gespeichert',
'SCREENED' => 'Angezeigt',
'Sales Invoice' => 'Rechnung',
+ 'Salesperson' => 'Verkäufer/in',
'Sales Order' => 'Kundenauftrag',
'Sales quotation' => 'Angebot',
'Screen' => 'Bildschirm',
'SCREENED' => 'SCREENED',
'Sales Invoice' => 'Sales Invoice',
'Sales Order' => 'Sales Order',
+ 'Salesperson' => 'Salesperson',
'Sales quotation' => 'Sales quotation',
'Screen' => 'Screen',
'Select a Customer' => 'Select a Customer',
<tr>
<th align="right" nowrap>Alte Mahnungen anzeigen</th>
<td><input type="checkbox" value="1" name="showold"></td>
+ <th align="right" nowrap>Verkäufer anzeigen</th>
+ <td><input type="checkbox" value="1" name="l_salesman"></td>
</tr>
</table>
</td>