use SL::DB::Buchungsgruppe;
use SL::DB::CsvImportProfile;
+use SL::DB::Unit;
use SL::Helper::Flash;
use SL::SessionFile;
use SL::Controller::CsvImport::Contact;
use Rose::Object::MakeMethods::Generic
(
- scalar => [ qw(type profile file all_profiles all_charsets sep_char all_sep_chars quote_char all_quote_chars escape_char all_escape_chars all_buchungsgruppen
+ scalar => [ qw(type profile file all_profiles all_charsets sep_char all_sep_chars quote_char all_quote_chars escape_char all_escape_chars all_buchungsgruppen all_units
import_status errors headers raw_data_headers info_headers data num_imported num_importable displayable_columns) ],
);
if ($self->{type} eq 'parts') {
$self->all_buchungsgruppen(SL::DB::Manager::Buchungsgruppe->get_all_sorted);
+ $self->all_units(SL::DB::Manager::Unit->get_all_sorted);
}
$self->setup_help;
return { map { ( $_ => $self->controller->profile->get($_) ) } qw(apply_buchungsgruppe default_buchungsgruppe article_number_policy
sellprice_places sellprice_adjustment sellprice_adjustment_type
- shoparticle_if_missing parts_type) };
+ shoparticle_if_missing parts_type default_unit) };
}
sub init_all_cvar_configs {
my $object = $entry->{object};
+ $object->unit($self->settings->{default_unit}) unless $object->unit;
+
# Check whether or unit is valid.
if (!$self->units_by->{name}->{ $object->unit }) {
push @{ $entry->{errors} }, $::locale->text('Error: Unit missing or invalid');
{ name => 'sellprice', description => $::locale->text('Sellprice') },
{ name => 'shop', description => $::locale->text('Shopartikel') },
{ name => 'type', description => $::locale->text('Article type (see below)') },
- { name => 'unit', description => $::locale->text('Unit') },
+ { name => 'unit', description => $::locale->text('Unit (if missing or empty default unit will be used)') },
{ name => 've', description => $::locale->text('Verrechnungseinheit') },
{ name => 'weight', description => $::locale->text('Weight') },
);
'Default output medium' => 'Standardausgabekanal',
'Default printer' => 'Standarddrucker',
'Default template format' => 'Standardvorlagenformat',
+ 'Default unit' => 'Standardeinheit',
'Default value' => 'Standardwert',
'Defaults saved.' => 'Die Standardeinstellungen wurden gespeichert.',
'Delete' => 'Löschen',
'Unchecked custom variables will not appear in orders and invoices.' => 'Unmarkierte Variablen werden für diesen Artikel nicht in Aufträgen und Rechnungen angezeigt.',
'Unfinished follow-ups' => 'Nicht erledigte Wiedervorlagen',
'Unit' => 'Einheit',
+ 'Unit (if missing or empty default unit will be used)' => 'Einheit (falls nicht vorhanden oder leer wird die Standardeinheit benutzt)',
'Unit missing.' => 'Die Einheit fehlt.',
'Unit of measure' => 'Maßeinheit',
'Units marked for deletion will be deleted upon saving.' => 'Einheiten, die zum Löschen markiert sind, werden beim Speichern gelöscht.',
'month' => 'Monatliche Abgabe',
'monthly' => 'monatlich',
'new Window' => 'neues Fenster',
- 'next' => 'Nächste',
'no' => 'nein',
'no bestbefore' => 'keine Mindesthaltbarkeit',
'no chargenumber' => 'keine Chargennummer',
'pos_eur' => 'E/ÜR',
'pos_ustva' => 'UStVA',
'posted!' => 'gebucht',
- 'prev' => 'Vorherige',
'print' => 'drucken',
'proforma' => 'Proforma',
'project_list' => 'projektliste',
[% L.select_tag('settings.apply_buchungsgruppe', L.options_for_select(opts, default => SELF.profile.get('apply_buchungsgruppe')), style => 'width: 300px') %]
</td>
</tr>
+
+<tr>
+ <th align="right" valign="top">[%- LxERP.t8('Default unit') %]:</th>
+ <td colspan="10" valign="top">
+ [% opts = L.options_for_select(SELF.all_units, title => 'name', value => 'name', default => SELF.profile.get('default_unit')) %]
+ [% L.select_tag('settings.default_unit', opts, style => 'width: 300px') %]
+ </td>
+</tr>