X-Git-Url: http://wagnertech.de/git?a=blobdiff_plain;f=bin%2Fmozilla%2Fic.pl;h=5b3e6656359ce1d1f4799139d299687d01a78bc9;hb=8af39a65f18765dc26b93a8b25bfdd21dad5812c;hp=2dc3366d6c4aa2d410c41d7afda19a94233f0234;hpb=35ca31c0901ccfde86d6935d63f86ecc309b6807;p=kivitendo-erp.git diff --git a/bin/mozilla/ic.pl b/bin/mozilla/ic.pl index 2dc3366d6..5b3e66563 100644 --- a/bin/mozilla/ic.pl +++ b/bin/mozilla/ic.pl @@ -38,6 +38,7 @@ use List::MoreUtils qw(any); use SL::AM; use SL::CVar; use SL::IC; +use SL::Helper::Flash; use SL::ReportGenerator; #use SL::PE; @@ -288,7 +289,6 @@ sub update_prices { # $form->header; # # print qq| -# #
# # @@ -388,8 +388,6 @@ sub update_prices { # . $locale->text('TOP100') . qq|"> # # -# -# #|; # $lxdebug->leave_sub(); #} #end list() @@ -725,8 +723,6 @@ sub addtop100 { my $colspan = $#column_index + 1; print qq| - -
@@ -981,9 +977,6 @@ sub addtop100 { . $locale->text('choice') . qq|"> - - - |; $lxdebug->leave_sub(); @@ -1593,6 +1586,10 @@ sub form_header { IC->retrieve_buchungsgruppen(\%myconfig, $form); @{ $form->{BUCHUNGSGRUPPEN} } = grep { $_->{id} eq $form->{buchungsgruppen_id} || ($form->{id} && $form->{orphaned}) || !$form->{id} } @{ $form->{BUCHUNGSGRUPPEN} }; + if (($form->{partnumber} ne '') && !SL::TransNumber->new(number => $form->{partnumber}, type => $form->{item}, id => $form->{id})->is_unique) { + flash('info', $::locale->text('This partnumber is not unique. You should change it.')); + } + # use JavaScript Calendar or not (yes!) $form->{jsscript} = 1; @@ -1601,7 +1598,7 @@ sub form_header { $form->{defaults} = AM->get_defaults(); - $form->{fokus} = "ic.partnumber"; + $::request->{layout}->focus("#partnumber"); $form->{CUSTOM_VARIABLES} = CVar->get_custom_variables('module' => 'IC', 'trans_id' => $form->{id}); @@ -1697,7 +1694,7 @@ sub assembly_row { $form->{"qty_$i"} = $form->format_amount(\%myconfig, $form->{"qty_$i"}); $linetotal = $form->format_amount(\%myconfig, $linetotal, 2); $line_purchase_price = $form->format_amount(\%myconfig, $line_purchase_price, 2); - $href = qq|$form->{script}?action=edit&id=$form->{"id_$i"}&rowcount=$i&previousform=$previousform|; + $href = build_std_url("action=edit", qq|id=$form->{"id_$i"}|, "rowcount=$numrows", "currow=$i", "previousform=$previousform"); map { $row{$_}{data} = "" } qw(qty unit partnumber description bom partsgroup runningnumber); # last row @@ -1717,7 +1714,8 @@ sub assembly_row { $row{bom}{data} = $form->{"bom_$i"} ? "x" : " "; $row{qty}{align} = 'right'; } else { - $row{partnumber}{data} = qq|$form->{"partnumber_$i"}|; + $row{partnumber}{data} = qq|$form->{"partnumber_$i"}|; + $row{partnumber}{link} = $href; $row{qty}{data} = qq||; $row{runningnumber}{data} = qq||; $row{bom}{data} = sprintf qq||, @@ -1878,7 +1876,11 @@ sub save { qw(weight listprice sellprice rop); $form->{assembly_rows}--; - $i = $form->{assembly_rows}; + if ($newform{currow}) { + $i = $newform{currow}; + } else { + $i = $form->{assembly_rows}; + } $form->{"qty_$i"} = 1 unless ($form->{"qty_$i"}); $form->{sellprice} -= $form->{"sellprice_$i"} * $form->{"qty_$i"};
$form->{title}