# --------------------------------------------------------------------
sub transfer_warehouse_selection {
# --------------------------------------------------------------------
sub transfer_warehouse_selection {
show_no_warehouses_error() if (!scalar @{ $form->{WAREHOUSES} });
my $units = AM->retrieve_units(\%myconfig, $form);
show_no_warehouses_error() if (!scalar @{ $form->{WAREHOUSES} });
my $units = AM->retrieve_units(\%myconfig, $form);
- $form->{UNITS} = AM->unit_select_data($units, $form->{unit}, 0, $form->{partunit});
+ # der zweite Parameter von unit_select_data gibt den default-Namen (selected) vor
+ $form->{UNITS} = AM->unit_select_data($units, $form->{partunit}, 0, $form->{partunit});
$form->{sort} = 'bindescription';
my @contents = WH->get_warehouse_report("warehouse_id" => $form->{warehouse_id},
"bin_id" => $form->{bin_id},
"chargenumber" => $form->{chargenumber},
$form->{sort} = 'bindescription';
my @contents = WH->get_warehouse_report("warehouse_id" => $form->{warehouse_id},
"bin_id" => $form->{bin_id},
"chargenumber" => $form->{chargenumber},
- "partnumber" => $form->{partnumber},
- "ean" => $form->{ean},
+ "bestbefore" => $form->{bestbefore},
+ "partnumber" => $form->{partnumber},
+ "ean" => $form->{ean},
$form->{sort} = 'bindescription';
my @contents = WH->get_warehouse_report("warehouse_id" => $form->{warehouse_id});
$form->{sort} = 'bindescription';
my @contents = WH->get_warehouse_report("warehouse_id" => $form->{warehouse_id});
if (!scalar @transfers) {
$form->show_generic_information($locale->text('Nothing has been selected for transfer.'));
if (!scalar @transfers) {
$form->show_generic_information($locale->text('Nothing has been selected for transfer.'));
# --------------------------------------------------------------------
sub transfer_stock_update_part {
# --------------------------------------------------------------------
sub transfer_stock_update_part {
$form->{trans_type} = 'stock';
$form->{qty} = $form->parse_amount(\%myconfig, $form->{qty});
$form->{trans_type} = 'stock';
$form->{qty} = $form->parse_amount(\%myconfig, $form->{qty});
- $form->{no_services} = 1;
- $form->{no_assemblies} = 0; # assemblies duerfen eingelagert werden (z.B. bei retouren)
+# $form->{no_services} = 1; # services may now be transfered. fix for Bug 1383.
+ $form->{no_assemblies} = 0; # assemblies duerfen eingelagert werden (z.B. bei retouren)
my $parts = Common->retrieve_parts(\%myconfig, $form, 'description', 1);
my $parts = Common->retrieve_parts(\%myconfig, $form, 'description', 1);
# --------------------------------------------------------------------
sub transfer_assembly_update_part {
# --------------------------------------------------------------------
sub transfer_assembly_update_part {
$form->{trans_type} = 'assembly';
$form->{qty} = $form->parse_amount(\%myconfig, $form->{qty});
$form->{trans_type} = 'assembly';
$form->{qty} = $form->parse_amount(\%myconfig, $form->{qty});
# hier die oben benannte idee
# my $maxcreate = Common->check_assembly_max_create(assembly_id => $form->{parts_id}, dbh => $my_dbh);
# hier die oben benannte idee
# my $maxcreate = Common->check_assembly_max_create(assembly_id => $form->{parts_id}, dbh => $my_dbh);
@{$form}{qw(parts_id partnumber description ean)} = @{$part}{qw(id partnumber description ean)};
transfer_stock_get_partunit();
transfer_warehouse_selection();
@{$form}{qw(parts_id partnumber description ean)} = @{$part}{qw(id partnumber description ean)};
transfer_stock_get_partunit();
transfer_warehouse_selection();
if ($form->{parts_id}) {
my $part_info = IC->get_basic_part_info('id' => $form->{parts_id});
$form->{partunit} = $part_info->{unit};
}
if ($form->{parts_id}) {
my $part_info = IC->get_basic_part_info('id' => $form->{parts_id});
$form->{partunit} = $part_info->{unit};
}
$form->{qty} = $form->parse_amount(\%myconfig, $form->{qty});
if ($form->{qty} <= 0) {
$form->show_generic_error($locale->text('Invalid quantity.'), 'back_button' => 1);
}
# TODO Es wäre schön, hier schon die maximale Anzahl der zu fertigenden Erzeugnisse zu haben
$form->{qty} = $form->parse_amount(\%myconfig, $form->{qty});
if ($form->{qty} <= 0) {
$form->show_generic_error($locale->text('Invalid quantity.'), 'back_button' => 1);
}
# TODO Es wäre schön, hier schon die maximale Anzahl der zu fertigenden Erzeugnisse zu haben
- #else { if ($form->{qty} > $maxcreate) { #s.o.
- # $form->show_generic_error($locale->text('Can not create that quantity with current stock'), 'back_button' => 1);
- # $form->show_generic_error('Maximale Stückzahl' . $maxcreate , 'back_button' => 1);
- # }
+ #else { if ($form->{qty} > $maxcreate) { #s.o.
+ # $form->show_generic_error($locale->text('Can not create that quantity with current stock'), 'back_button' => 1);
+ # $form->show_generic_error('Maximale Stückzahl' . $maxcreate , 'back_button' => 1);
+ # }
# }
if (!$form->{warehouse_id} || !$form->{bin_id}) {
$form->error($locale->text('The warehouse or the bin is missing.'));
}
# }
if (!$form->{warehouse_id} || !$form->{bin_id}) {
$form->error($locale->text('The warehouse or the bin is missing.'));
}
# WIESO war das nicht vorher schon ein %HASH?? ein hash ist ein hash! das hat mich mehr als eine Stunde gekostet herauszufinden. grr. jb 3.3.2009
# Anm. jb 18.3. vielleicht auch nur meine unwissenheit in perl-datenstrukturen
my %TRANSFER = (
'transfer_type' => 'assembly',
# WIESO war das nicht vorher schon ein %HASH?? ein hash ist ein hash! das hat mich mehr als eine Stunde gekostet herauszufinden. grr. jb 3.3.2009
# Anm. jb 18.3. vielleicht auch nur meine unwissenheit in perl-datenstrukturen
my %TRANSFER = (
'transfer_type' => 'assembly',
'dst_warehouse_id' => $form->{warehouse_id},
'dst_bin_id' => $form->{bin_id},
'chargenumber' => $form->{chargenumber},
'dst_warehouse_id' => $form->{warehouse_id},
'dst_bin_id' => $form->{bin_id},
'chargenumber' => $form->{chargenumber},
$form->{saved_message} = $locale->text('The assembly has been created.');
$form->{trans_type} = 'assembly';
transfer_warehouse_selection();
$form->{saved_message} = $locale->text('The assembly has been created.');
$form->{trans_type} = 'assembly';
transfer_warehouse_selection();
'dst_warehouse_id' => $form->{warehouse_id},
'dst_bin_id' => $form->{bin_id},
'chargenumber' => $form->{chargenumber},
'dst_warehouse_id' => $form->{warehouse_id},
'dst_bin_id' => $form->{bin_id},
'chargenumber' => $form->{chargenumber},
$form->{saved_message} = $locale->text('The parts have been stocked.');
$form->{trans_type} = 'stock';
transfer_warehouse_selection();
$form->{saved_message} = $locale->text('The parts have been stocked.');
$form->{trans_type} = 'stock';
transfer_warehouse_selection();
$form->{sort} = 'bindescription';
my @contents = WH->get_warehouse_report("warehouse_id" => $form->{warehouse_id});
$form->{sort} = 'bindescription';
my @contents = WH->get_warehouse_report("warehouse_id" => $form->{warehouse_id});
if (!scalar @transfers) {
$form->show_generic_information($locale->text('Nothing has been selected for removal.'));
if (!scalar @transfers) {
$form->show_generic_information($locale->text('Nothing has been selected for removal.'));
$form->header();
print $form->parse_html_template("wh/journal_filter", { "UNITS" => AM->unit_select_data(AM->retrieve_units(\%myconfig, $form)) });
$form->header();
print $form->parse_html_template("wh/journal_filter", { "UNITS" => AM->unit_select_data(AM->retrieve_units(\%myconfig, $form)) });
- $form->isblank(qty, $locale->text('Quantity missing.'));
- $form->isblank(qty_unit, $locale->text('Unit missing.'));
+ $form->isblank("qty", $locale->text('Quantity missing.'));
+ $form->isblank("qty_unit", $locale->text('Unit missing.'));
my $report = SL::ReportGenerator->new(\%myconfig, $form);
my @hidden_variables = map { "l_${_}" } @columns;
my $report = SL::ReportGenerator->new(\%myconfig, $form);
my @hidden_variables = map { "l_${_}" } @columns;
'bin_from' => { 'text' => $locale->text('Bin From'), },
'bin_to' => { 'text' => $locale->text('Bin To'), },
'partnumber' => { 'text' => $locale->text('Part Number'), },
'bin_from' => { 'text' => $locale->text('Bin From'), },
'bin_to' => { 'text' => $locale->text('Bin To'), },
'partnumber' => { 'text' => $locale->text('Part Number'), },
'qty' => { 'text' => $locale->text('Qty'), },
'employee' => { 'text' => $locale->text('Employee'), },
'projectnumber' => { 'text' => $locale->text('Project Number'), },
'qty' => { 'text' => $locale->text('Qty'), },
'employee' => { 'text' => $locale->text('Employee'), },
'projectnumber' => { 'text' => $locale->text('Project Number'), },
'title' => $form->{title},
'attachment_basename' => strftime($locale->text('warehouse_journal_list') . '_%Y%m%d', localtime time));
$report->set_options_from_form();
'title' => $form->{title},
'attachment_basename' => strftime($locale->text('warehouse_journal_list') . '_%Y%m%d', localtime time));
$report->set_options_from_form();
my $all_units = AM->retrieve_units(\%myconfig, $form);
my @contents = WH->get_warehouse_journal(%filter);
my $all_units = AM->retrieve_units(\%myconfig, $form);
my @contents = WH->get_warehouse_journal(%filter);
$entry->{qty} = $form->format_amount_units('amount' => $entry->{qty},
'part_unit' => $entry->{partunit},
'conv_units' => 'convertible');
$entry->{qty} = $form->format_amount_units('amount' => $entry->{qty},
'part_unit' => $entry->{partunit},
'conv_units' => 'convertible');
$row->{$column} = {
'data' => $entry->{$column},
'align' => $column_alignment{$column},
};
}
$row->{$column} = {
'data' => $entry->{$column},
'align' => $column_alignment{$column},
};
}
$form->get_lists('warehouses' => { 'key' => 'WAREHOUSES',
'bins' => 'BINS', });
show_no_warehouses_error() if (!scalar @{ $form->{WAREHOUSES} });
$form->get_lists('warehouses' => { 'key' => 'WAREHOUSES',
'bins' => 'BINS', });
show_no_warehouses_error() if (!scalar @{ $form->{WAREHOUSES} });
- $form->{fokus} = "partnumber";
- $form->{onload} .= "focus();";
- $form->{title} = $locale->text("Report about wareouse contents");
+ $form->{jsscript} = 1;
+
+# $form->{fokus} = "partnumber";
+# $form->{onload} .= "focus();";
+ $form->{title} = $locale->text("Report about warehouse contents");
"WAREHOUSES" => $form->{WAREHOUSES},
"UNITS" => AM->unit_select_data(AM->retrieve_units(\%myconfig, $form)) });
"WAREHOUSES" => $form->{WAREHOUSES},
"UNITS" => AM->unit_select_data(AM->retrieve_units(\%myconfig, $form)) });
- $form->isblank(qty, $locale->text('Quantity missing.'));
- $form->isblank(qty_unit, $locale->text('Unit missing.'));
+ $form->isblank("qty", $locale->text('Quantity missing.'));
+ $form->isblank("qty_unit", $locale->text('Unit missing.'));
my $report = SL::ReportGenerator->new(\%myconfig, $form);
my @hidden_variables = map { "l_${_}" } @columns;
my $report = SL::ReportGenerator->new(\%myconfig, $form);
my @hidden_variables = map { "l_${_}" } @columns;
push @hidden_variables, qw(include_empty_bins subtotal);
my %column_defs = (
'warehousedescription' => { 'text' => $locale->text('Warehouse'), },
'bindescription' => { 'text' => $locale->text('Bin'), },
'partnumber' => { 'text' => $locale->text('Part Number'), },
push @hidden_variables, qw(include_empty_bins subtotal);
my %column_defs = (
'warehousedescription' => { 'text' => $locale->text('Warehouse'), },
'bindescription' => { 'text' => $locale->text('Bin'), },
'partnumber' => { 'text' => $locale->text('Part Number'), },
'qty' => { 'text' => $locale->text('Qty'), },
'stock_value' => { 'text' => $locale->text('Stock value'), },
);
'qty' => { 'text' => $locale->text('Qty'), },
'stock_value' => { 'text' => $locale->text('Stock value'), },
);
'title' => $form->{title},
'attachment_basename' => strftime($locale->text('warehouse_report_list') . '_%Y%m%d', localtime time));
$report->set_options_from_form();
'title' => $form->{title},
'attachment_basename' => strftime($locale->text('warehouse_report_list') . '_%Y%m%d', localtime time));
$report->set_options_from_form();
my $all_units = AM->retrieve_units(\%myconfig, $form);
my @contents = WH->get_warehouse_report(%filter);
my $all_units = AM->retrieve_units(\%myconfig, $form);
my @contents = WH->get_warehouse_report(%filter);
map { $subtotals{$_} += $entry->{$_} } @subtotals_columns;
$total_stock_value += $entry->{stock_value} * 1;
map { $subtotals{$_} += $entry->{$_} } @subtotals_columns;
$total_stock_value += $entry->{stock_value} * 1;
'conv_units' => 'convertible');
$entry->{stock_value} = $form->format_amount(\%myconfig, $entry->{stock_value} * 1, 2);
'conv_units' => 'convertible');
$entry->{stock_value} = $form->format_amount(\%myconfig, $entry->{stock_value} * 1, 2);
# --------------------------------------------------------------------
sub show_no_warehouses_error {
# --------------------------------------------------------------------
sub show_no_warehouses_error {
$msg .= $locale->text('You can create warehouses and bins via the menu "System -> Warehouses".');
} else {
$msg .= $locale->text('Please ask your administrator to create warehouses and bins.');
$msg .= $locale->text('You can create warehouses and bins via the menu "System -> Warehouses".');
} else {
$msg .= $locale->text('Please ask your administrator to create warehouses and bins.');
for (my $i = 0; $i < scalar @{$form->{WAREHOUSES}}; $i++) {
return $i if ($form->{WAREHOUSES}->[$i]->{id} == $warehouse_id);
}
for (my $i = 0; $i < scalar @{$form->{WAREHOUSES}}; $i++) {
return $i if ($form->{WAREHOUSES}->[$i]->{id} == $warehouse_id);
}
# change callback
$form->{old_callback} = $form->escape($form->{callback}, 1);
$form->{callback} = $form->escape("$form->{script}?action=$params{action}", 1);
# save all form variables except action in a previousform variable
my $previousform = join '&', map { my $value = $form->{$_}; $value =~ s/&/%26/; "$_=$value" } grep { !/action/ } keys %$form;
# change callback
$form->{old_callback} = $form->escape($form->{callback}, 1);
$form->{callback} = $form->escape("$form->{script}?action=$params{action}", 1);
# save all form variables except action in a previousform variable
my $previousform = join '&', map { my $value = $form->{$_}; $value =~ s/&/%26/; "$_=$value" } grep { !/action/ } keys %$form;
# push @HIDDENS, { 'name' => 'previousform', 'value' => $form->escape($previousform, 1) };
push @HIDDENS, map +{ 'name' => $_, 'value' => $form->{$_} }, qw(partnumber description unit vc sellprice ean);
# push @HIDDENS, { 'name' => 'previousform', 'value' => $form->escape($previousform, 1) };
push @HIDDENS, map +{ 'name' => $_, 'value' => $form->{$_} }, qw(partnumber description unit vc sellprice ean);