dunning_ar => { type => 'integer' },
dunning_ar_amount_fee => { type => 'integer' },
dunning_ar_amount_interest => { type => 'integer' },
+ dunning_creator => { type => 'enum', check_in => [ 'current_employee', 'invoice_employee' ], db_type => 'dunning_creator', default => 'current_employee' },
duns => { type => 'text' },
email_journal => { type => 'integer', default => 2 },
expense_accno_id => { type => 'integer' },
use SL::Common;
use SL::DBUtils;
use SL::DB::Default;
+use SL::DB::Employee;
use SL::GenericTranslations;
use SL::IS;
use SL::Mailer;
}
$query =
- qq|SELECT dunning_ar_amount_fee, dunning_ar_amount_interest, dunning_ar
+ qq|SELECT dunning_ar_amount_fee, dunning_ar_amount_interest, dunning_ar, dunning_creator
FROM defaults|;
- ($form->{AR_amount_fee}, $form->{AR_amount_interest}, $form->{AR}) = selectrow_query($form, $dbh, $query);
+ ($form->{AR_amount_fee}, $form->{AR_amount_interest}, $form->{AR}, $form->{dunning_creator})
+ = selectrow_query($form, $dbh, $query);
$main::lxdebug->leave_sub();
}
}
}
- $query = qq|UPDATE defaults SET dunning_ar_amount_fee = ?, dunning_ar_amount_interest = ?, dunning_ar = ?|;
- @values = (conv_i($form->{AR_amount_fee}), conv_i($form->{AR_amount_interest}), conv_i($form->{AR}));
+ $query = qq|UPDATE defaults SET dunning_ar_amount_fee = ?, dunning_ar_amount_interest = ?, dunning_ar = ?,
+ dunning_creator = ?|;
+ @values = (conv_i($form->{AR_amount_fee}), conv_i($form->{AR_amount_interest}), conv_i($form->{AR}),
+ $form->{dunning_creator});
do_query($form, $dbh, $query, @values);
return 1;
push @{ $form->{DUNNING_PDFS_EMAIL} }, { 'path' => "${spool}/$filename",
'name' => $form->get_formname_translation('dunning') . "_${dunning_id}.pdf" };
- $form->get_employee_data('prefix' => 'employee', 'id' => $form->{employee_id});
+ my $employee_id = ($::instance_conf->get_dunning_creator eq 'invoice_employee') ?
+ $form->{employee_id} :
+ SL::DB::Manager::Employee->current->id;
+
+ $form->get_employee_data('prefix' => 'employee', 'id' => $employee_id);
$form->get_employee_data('prefix' => 'salesman', 'id' => $form->{salesman_id});
$form->{attachment_type} = "dunning";
'Currency names must not be empty.' => 'Währungsnamen dürfen nicht leer sein.',
'Current / Next Level' => 'Aktuelles / Nächstes Mahnlevel',
'Current Earnings' => 'Gewinn',
+ 'Current Employee' => 'Aktuelle Mitarbeiter',
'Current assets account' => 'Konto für Umlaufvermögen',
'Current filter' => 'Aktueller Filter',
'Current picture' => 'Aktuelles Bild',
'Dunned open amount: #1' => 'Angemahnter, offener Betrag: #1',
'Dunning' => 'Mahnung',
'Dunning Amount' => 'gemahnter Betrag',
+ 'Dunning Creator' => 'Mahnungsersteller',
'Dunning Date' => 'Mahndatum',
'Dunning Date from' => 'Mahnungen von',
'Dunning Description' => 'Mahnstufenbeschreibung',
'Employee' => 'Bearbeiter',
'Employee #1 saved!' => 'Benutzer #1 gespeichert!',
'Employee (database ID)' => 'Bearbeiter (Datenbank-ID)',
+ 'Employee from the original invoice' => 'Mitarbeiter der Ursprungs-Rechnung',
'Employees' => 'Benutzer',
'Empty selection for warehouse will not be added, even if the old bin is still visible (use back and forth to edit again).' => 'Leere Lager-Auswahl wird ignoriert, selbst wenn noch ein Lagerplatz ausgewählt ist. Alle Daten können durch zurück und vorwärts korrigiert werden.',
'Empty transaction!' => 'Buchung ist leer!',
--- /dev/null
+-- @tag: defaults_set_dunning_creator
+-- @description: Ersteller der Mahnungen konfigurierbar machen
+-- @depends: release_3_5_3
+
+CREATE TYPE dunning_creator AS ENUM ('current_employee', 'invoice_employee');
+ALTER TABLE defaults ADD COLUMN dunning_creator dunning_creator default 'current_employee';
+
[%- USE T8 %]
[%- USE HTML %]
+[%- USE LxERP -%][%- USE L -%]
<h1>[% title %]</h1>
<script type="text/javascript" src="js/common.js"></script>
</select>
</td>
</tr>
+ <tr>
+ <th align="right">[% 'Dunning Creator' | $T8 %]</th>
+ <td>[% L.select_tag('dunning_creator', [ [ 'current_employee', LxERP.t8('Current Employee') ],[ 'invoice_employee', LxERP.t8('Employee from the original invoice') ] ], default=dunning_creator) %]
+ </td>
+ </tr>
</table>
<input type="hidden" name="callback" value="[% HTML.escape(callback) %]">