use SL::OE;
use SL::ReportGenerator;
+use SL::DB::Part;
+
use Data::Dumper;
require "bin/mozilla/common.pl";
show_no_warehouses_error() if (!scalar @{ $form->{WAREHOUSES} });
my $units = AM->retrieve_units(\%myconfig, $form);
+
+ my $part = 0;
+ if ( $form->{parts_id} ) {
+ $part = SL::DB::Part->new();
+ $part->id($form->{parts_id});
+ $part->load();
+ }
+
# der zweite Parameter von unit_select_data gibt den default-Namen (selected) vor
- $form->{UNITS} = AM->unit_select_data($units, $form->{unit}, 0, $form->{unit});
+ $form->{UNITS} = AM->unit_select_data($units, $form->{unit}, 0, $part ? $part->unit : 0);
if (scalar @{ $form->{WAREHOUSES} }) {
$form->{warehouse_id} ||= $form->{WAREHOUSES}->[0]->{id};
}
$transfer->{comment} = $form->{comment};
+ $transfer->{change_default_bin} = $form->{change_default_bin};
push @transfers, $transfer;
if (!scalar @{ $parts }) {
new_item(action => "transfer_stock_update_part");
} elsif (scalar @{ $parts } == 1) {
- @{$form}{qw(parts_id partnumber description ean)} = @{$parts->[0]}{qw(id partnumber description ean)};
+ @{$form}{qw(parts_id partnumber description ean warehouse_id bin_id)} = @{$parts->[0]}{qw(id partnumber description ean warehouse_id bin_id)};
transfer_stock_get_partunit();
transfer_warehouse_selection();
my $form = $main::form;
- @{$form}{qw(parts_id partnumber description ean)} = @{$part}{qw(id partnumber description ean)};
+ @{$form}{qw(parts_id partnumber description ean warehouse_id bin_id)} = @{$part}{qw(id partnumber description ean warehouse_id bin_id)};
transfer_stock_get_partunit();
transfer_warehouse_selection();
$form->error($locale->text('The warehouse or the bin is missing.'));
}
- if (!$::lx_office_conf{features}->{show_best_before}) {
+ if (!$::instance_conf->get_show_bestbefore) {
$form->{bestbefore} = '';
}
my @hidden_variables = map { "l_${_}" } @columns;
push @hidden_variables, qw(warehouse_id bin_id partnumber description chargenumber bestbefore qty_op qty qty_unit l_warehousedescription l_bindescription);
- push @hidden_variables, qw(include_empty_bins subtotal include_invalid_warehouses);
+ push @hidden_variables, qw(include_empty_bins subtotal include_invalid_warehouses date);
my %column_defs = (
'warehousedescription' => { 'text' => $locale->text('Warehouse'), },