X-Git-Url: http://wagnertech.de/git?a=blobdiff_plain;f=bin%2Fmozilla%2Fic.pl;h=f01b5afcbd34b837de7d7947b432ad73f0a4f6b6;hb=980dc53321ae6c2d3e448b6ca2a0c7d11a65ee8c;hp=f7985cf04d7ca5bd49c24cb910480bb6022ca0c3;hpb=0185267ee634095b8c6e247357dafe1207f97996;p=kivitendo-erp.git diff --git a/bin/mozilla/ic.pl b/bin/mozilla/ic.pl index f7985cf04..f01b5afcb 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 @@ -1244,8 +1238,14 @@ sub generate_report { map { $column_defs{$_}->{visible} ||= $form->{"l_$_"} ? 1 : 0 } @columns; map { $column_defs{$_}->{align} = 'right' } qw(onhand sellprice listprice lastcost linetotalsellprice linetotallastcost linetotallistprice rop weight soldtotal), @pricegroup_columns; - my @hidden_variables = (qw(l_subtotal l_linetotal searchitems itemstatus bom l_pricegroups), @itemstatus_keys, @callback_keys, - map({ "cvar_$_->{name}" } @searchable_custom_variables), map { "l_$_" } @columns); + my @hidden_variables = ( + qw(l_subtotal l_linetotal searchitems itemstatus bom l_pricegroups), + @itemstatus_keys, + @callback_keys, + map({ "cvar_$_->{name}" } @searchable_custom_variables), + map({'cvar_'. $_->{name} .'_qtyop'} grep({$_->{type} eq 'number'} @searchable_custom_variables)), + map({ "l_$_" } @columns), + ); my $callback = build_std_url('action=generate_report', grep { $form->{$_} } @hidden_variables); @@ -1331,11 +1331,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 +1592,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 +1604,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 +1700,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 +1720,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 +1729,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 +1846,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 +1882,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 +1917,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 +1965,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}