X-Git-Url: http://wagnertech.de/git?a=blobdiff_plain;f=bin%2Fmozilla%2Fic.pl;h=5b3e6656359ce1d1f4799139d299687d01a78bc9;hb=8af39a65f18765dc26b93a8b25bfdd21dad5812c;hp=f7985cf04d7ca5bd49c24cb910480bb6022ca0c3;hpb=0185267ee634095b8c6e247357dafe1207f97996;p=kivitendo-erp.git diff --git a/bin/mozilla/ic.pl b/bin/mozilla/ic.pl index f7985cf04..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(); @@ -1032,6 +1025,7 @@ sub generate_report { 'bin' => { 'text' => $locale->text('Bin'), }, 'deliverydate' => { 'text' => $locale->text('deliverydate'), }, 'description' => { 'text' => $locale->text('Part Description'), }, + 'notes' => { 'text' => $locale->text('Notes'), }, 'drawing' => { 'text' => $locale->text('Drawing'), }, 'ean' => { 'text' => $locale->text('EAN'), }, 'image' => { 'text' => $locale->text('Image'), }, @@ -1214,7 +1208,7 @@ sub generate_report { IC->all_parts(\%myconfig, \%$form); my @columns = qw( - partnumber description partsgroup bin onhand rop soldtotal unit listprice + partnumber description notes partsgroup bin onhand rop soldtotal unit listprice linetotallistprice sellprice linetotalsellprice lastcost linetotallastcost priceupdate weight image drawing microfiche invnumber ordnumber quonumber transdate name serialnumber deliverydate ean projectnumber projectdescription @@ -1331,11 +1325,11 @@ sub generate_report { $row->{description}->{link} = $edit_link; foreach (qw(sellprice listprice lastcost)) { - $row->{$_}{data} = $form->format_amount(\%myconfig, $ref->{$_}, -2); + $row->{$_}{data} = $form->format_amount(\%myconfig, $ref->{$_}, 2); $row->{"linetotal$_"}{data} = $form->format_amount(\%myconfig, $ref->{onhand} * $ref->{$_}, 2); } foreach ( @pricegroup_columns ) { - $row->{$_}{data} = $form->format_amount(\%myconfig, $ref->{"$_"}, -2); + $row->{$_}{data} = $form->format_amount(\%myconfig, $ref->{"$_"}, 2); }; @@ -1592,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; @@ -1600,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}); @@ -1696,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 @@ -1716,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||, @@ -1724,9 +1723,14 @@ sub assembly_row { } push @row_hiddens, qw(unit description partnumber partsgroup); $row{unit}{data} = $form->{"unit_$i"}; - $row{description}{data} = $form->{"description_$i"}; - $row{partsgroup}{data} = $form->{"partsgroup_$i"}; - $row{bom}{align} = 'center'; + #Bei der Artikelbeschreibung und Warengruppe können Sonderzeichen verwendet + #werden, die den HTML Code stören. Daher sollen diese im Template escaped werden + #dies geschieht, wenn die Variable escape gesetzt ist + $row{description}{data} = $form->{"description_$i"}; + $row{description}{escape} = 1; + $row{partsgroup}{data} = $form->{"partsgroup_$i"}; + $row{partsgroup}{escape} = 1; + $row{bom}{align} = 'center'; } $row{lastcost}{data} = $line_purchase_price; @@ -1836,7 +1840,6 @@ sub save { $form->error($locale->text('Partnumber must not be set to empty!')) if $form->{id} && !$form->{partnumber}; # save part - $lxdebug->message($LXDebug::DEBUG1, "ic.pl: sellprice in save = $form->{sellprice}\n"); if (IC->save(\%myconfig, \%$form) == 3) { $form->error($locale->text('Partnumber not unique!')); } @@ -1873,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"}; @@ -1904,8 +1911,6 @@ sub save { $form->{"sellprice_$i"} /= $form->{exchangerate}; } - $lxdebug->message($LXDebug::DEBUG1, qq|sellprice_$i in previousform 2 = | . $form->{"sellprice_$i"} . qq|\n|); - map { $form->{"taxaccounts_$i"} .= "$_ " } split / /, $newform{taxaccount}; chop $form->{"taxaccounts_$i"}; foreach my $item (qw(description rate taxnumber)) { @@ -1954,7 +1959,6 @@ sub save { } $form->{callback} = $callback; } - $lxdebug->message($LXDebug::DEBUG1, qq|ic.pl: sellprice_$i nach sub save = | . $form->{"sellprice_$i"} . qq|\n|); # redirect $form->redirect;
$form->{title}