X-Git-Url: http://wagnertech.de/git?a=blobdiff_plain;f=bin%2Fmozilla%2Fic.pl;h=b86623b5103673b15198e6e6175311474ea90998;hb=947583f50e01c950349274b6707702293f6c495a;hp=249c99ea083192125729ce34c0f791858797897d;hpb=8470071b1eea86117e6cece01bb5952c29a0cbc6;p=kivitendo-erp.git diff --git a/bin/mozilla/ic.pl b/bin/mozilla/ic.pl index 249c99ea0..b86623b51 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); }; @@ -1401,7 +1395,7 @@ sub generate_report { $idx++; } - if ($form->{"l_linetotal"}) { + if ($form->{"l_linetotal"} && !$form->{report_generator_csv_options_for_import}) { my $row = { map { $_ => { 'class' => 'listtotal', } } @columns }; map { $row->{"linetotal$_"}->{data} = $form->format_amount(\%myconfig, $totals{$_}, 2) } @subtotal_columns; @@ -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 (!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}); @@ -1724,9 +1722,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; @@ -1752,8 +1755,11 @@ sub update { # parse pricegroups. and no, don't rely on check_form for this... map { $form->{"price_$_"} = $form->parse_amount(\%myconfig, $form->{"price_$_"}) } 1 .. $form->{price_rows}; - # same for lastcosts - map { $form->{"lastcost_$_"} = $form->parse_amount(\%myconfig, $form->{"lastcost_$_"}) } 1 .. $form->{"makemodel_rows"}; + # same for makemodel lastcosts + # but parse_amount not necessary for assembly component lastcosts + unless ($form->{item} eq "assembly") { + map { $form->{"lastcost_$_"} = $form->parse_amount(\%myconfig, $form->{"lastcost_$_"}) } 1 .. $form->{"makemodel_rows"}; + }; if ($form->{item} eq "assembly") { my $i = $form->{assembly_rows}; @@ -1833,7 +1839,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!')); } @@ -1901,8 +1906,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)) { @@ -1951,7 +1954,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}