use SL::Helper::UserPreferences::PartPickerSearch;
use SL::Helper::UserPreferences::TimeRecording;
use SL::Helper::UserPreferences::UpdatePositions;
+use SL::Helper::UserPreferences::ItemInputPosition;
use strict;
my $chart_obj = SL::DB::Manager::Chart->find_by(id => $form->{id}) || die "Can't open chart";
my @chart_fields = qw(accno description charttype category link pos_bilanz
- pos_eur pos_er new_chart_id valid_from pos_bwa datevautomatik);
+ pos_eur pos_er new_chart_id valid_from pos_bwa datevautomatik
+ invalid);
foreach my $cf ( @chart_fields ) {
$form->{"$cf"} = $chart_obj->$cf;
}
my $active_taxkey = $chart_obj->get_active_taxkey;
- $form->{$_} = $active_taxkey->$_ foreach qw(taxkey_id pos_ustva tax_id startdate);
- $form->{tax} = $active_taxkey->tax_id . '--' . $active_taxkey->taxkey_id;
+ if ($active_taxkey) {
+ $form->{$_} = $active_taxkey->$_ foreach qw(taxkey_id pos_ustva tax_id startdate);
+ $form->{tax} = $active_taxkey->tax_id . '--' . $active_taxkey->taxkey_id;
+ }
# check if there are any transactions for this chart
$form->{orphaned} = $chart_obj->has_transaction ? 0 : 1;
pos_er = ?,
new_chart_id = ?,
valid_from = ?,
- datevautomatik = ?
+ datevautomatik = ?,
+ invalid = ?
WHERE id = ?|;
@values = (
conv_i($form->{new_chart_id}),
conv_date($form->{valid_from}),
($form->{datevautomatik} eq 'T') ? 'true':'false',
+ $form->{invalid} ? 'true' : 'false',
$form->{id},
);
SL::Helper::UserPreferences::DisplayPreferences->new()->get_longdescription_dialog_size_percentage();
}
+sub layout_style {
+ SL::Helper::UserPreferences::DisplayPreferences->new()->get_layout_style();
+}
+
+sub part_picker_search_all_as_list_default {
+ SL::Helper::UserPreferences::PartPickerSearch->new()->get_all_as_list_default();
+}
+
+sub order_item_input_position {
+ SL::Helper::UserPreferences::ItemInputPosition->new()->get_order_item_input_position();
+}
+
sub save_preferences {
$main::lxdebug->enter_sub();
if (exists $form->{longdescription_dialog_size_percentage}) {
SL::Helper::UserPreferences::DisplayPreferences->new()->store_longdescription_dialog_size_percentage($form->{longdescription_dialog_size_percentage})
}
+ if (exists $form->{layout_style}) {
+ SL::Helper::UserPreferences::DisplayPreferences->new()->store_layout_style($form->{layout_style})
+ }
+ if (exists $form->{part_picker_search_all_as_list_default}) {
+ SL::Helper::UserPreferences::PartPickerSearch->new()->store_all_as_list_default($form->{part_picker_search_all_as_list_default})
+ }
+ if (exists $form->{order_item_input_position}) {
+ SL::Helper::UserPreferences::ItemInputPosition->new()->store_order_item_input_position($form->{order_item_input_position})
+ }
$main::lxdebug->leave_sub();
UNION
SELECT DISTINCT bin_id, TRUE AS in_use FROM parts
) use ON use.bin_id = b.id
- WHERE b.warehouse_id = ?;
+ WHERE b.warehouse_id = ?
+ ORDER by description;
SQL
$form->{BINS} = selectall_hashref_query($form, $dbh, $query, conv_i($form->{id}));