X-Git-Url: http://wagnertech.de/git?a=blobdiff_plain;f=bin%2Fmozilla%2Fio.pl;h=926098188f923d54b2e0f4418cf59a6d9107dde1;hb=6b935d522a38e1a20802c25ed51a15e0cd292c1d;hp=94d536cbdf88e3db42da0fecff34ee5259c8bf16;hpb=7dd8ee369c041cbcd772bb27de8fdacb21166626;p=kivitendo-erp.git diff --git a/bin/mozilla/io.pl b/bin/mozilla/io.pl index 94d536cbd..926098188 100644 --- a/bin/mozilla/io.pl +++ b/bin/mozilla/io.pl @@ -151,7 +151,7 @@ sub display_row { { id => 'serialnr', width => 10, value => $locale->text('Serial No.'), display => 0, }, { id => 'projectnr', width => 10, value => $locale->text('Project'), display => 0, }, { id => 'sellprice', width => 15, value => $locale->text('Price'), display => !$is_delivery_order, }, - { id => 'sellprice_pg', width => 8, value => $locale->text('Pricegroup'), display => ($form->{type} =~ /^(sales_|invoice)/) && !$is_delivery_order, }, + { id => 'sellprice_pg', width => 8, value => $locale->text('Pricegroup'), display => !$is_delivery_order && !$is_purchase, }, { id => 'discount', width => 5, value => $locale->text('Discount'), display => !$is_delivery_order, }, { id => 'linetotal', width => 10, value => $locale->text('Extended'), display => !$is_delivery_order, }, { id => 'bin', width => 10, value => $locale->text('Bin'), display => 0, }, @@ -229,7 +229,6 @@ sub display_row { } my $this_unit = $form->{"unit_$i"}; $this_unit = $form->{"selected_unit_$i"} if AM->convert_unit($this_unit, $form->{"selected_unit_$i"}, $all_units); - $this_unit ||= "kg"; if (0 < scalar @{ $form->{ALL_PRICE_FACTORS} }) { my @values = ('', map { $_->{id} } @{ $form->{ALL_PRICE_FACTORS} }); @@ -811,7 +810,7 @@ sub remove_emptied_rows { sellprice_pg pricegroup_old price_old price_new unit_old ordnumber transdate longdescription basefactor marge_total marge_percent marge_price_factor lastcost price_factor_id partnotes - stock_out stock_in has_sernumber); + stock_out stock_in has_sernumber reqdate); my $ic_cvar_configs = CVar->get_configs(module => 'IC'); push @flds, map { "ic_cvar_$_->{name}" } @{ $ic_cvar_configs }; @@ -1041,9 +1040,9 @@ sub edit_e_mail { $form->{email} = $form->{shiptoemail} if $form->{shiptoemail} && $form->{formname} =~ /(pick|packing|bin)_list/; - if ($form->{"cp_id"} && !$form->{"email"}) { + if ($form->{"cp_id"}) { CT->get_contact(\%myconfig, $form); - $form->{"email"} = $form->{"cp_email"}; + $form->{"email"} = $form->{"cp_email"} if $form->{"cp_email"}; } my $title = $locale->text('E-mail') . " " . $form->get_formname_translation(); @@ -1152,7 +1151,6 @@ sub print_options { ) : undef, ($form->{type} eq 'invoice' && $form->{storno}) ? ( opthash("storno_invoice", $form->{PD}{storno_invoice}, $locale->text('Storno Invoice')), - opthash("storno_packing_list", $form->{PD}{storno_packing_list}, $locale->text('Storno Packing List')) ) : undef, ($form->{type} =~ /_delivery_order$/) ? ( opthash($form->{type}, $form->{PD}{$form->{type}}, $locale->text('Delivery Order')), @@ -1166,7 +1164,7 @@ sub print_options { push @MEDIA, grep $_, opthash("screen", $form->{OP}{screen}, $locale->text('Screen')), - (scalar @{ $form->{printers} } && $main::latex_templates) ? + ($form->{printers} && scalar @{ $form->{printers} } && $main::latex_templates) ? opthash("printer", $form->{OP}{printer}, $locale->text('Printer')) : undef, ($main::latex_templates && !$options{no_queue}) ? opthash("queue", $form->{OP}{queue}, $locale->text('Queue')) : undef @@ -1265,6 +1263,7 @@ sub print { &save(); $form->{formname} = $formname; &edit(); + $::lxdebug->leave_sub(); ::end_of_request(); } @@ -1298,11 +1297,6 @@ sub print_form { if ($form->{formname} eq "invoice") { $form->{label} = $locale->text('Invoice'); } - if ($form->{formname} eq "packing_list") { - - # this is from an invoice - $form->{label} = $locale->text('Packing List'); - } if ($form->{formname} eq 'sales_order') { $inv = "ord"; $due = "req"; @@ -1332,17 +1326,6 @@ sub print_form { $order = 1; } - if ($form->{formname} eq 'packing_list' && $form->{type} ne 'invoice') { - - # we use the same packing list as from an invoice - $inv = "ord"; - $due = "req"; - $form->{invdate} = $form->{"${inv}date"} = $form->{transdate}; - $form->{label} = $locale->text('Packing List'); - $order = 1; - # set invnumber for template packing_list - $form->{invnumber} = $form->{ordnumber}; - } if ($form->{formname} eq 'purchase_order') { $inv = "ord"; $due = "req"; @@ -1403,8 +1386,6 @@ sub print_form { # $locale->text('Invoice Number missing!') # $locale->text('Invoice Date missing!') - # $locale->text('Packing List Number missing!') - # $locale->text('Packing List Date missing!') # $locale->text('Order Number missing!') # $locale->text('Order Date missing!') # $locale->text('Quotation Number missing!') @@ -1781,7 +1762,7 @@ sub ship_to { my @shipto_vars = qw(shiptoname shiptostreet shiptozipcode shiptocity shiptocountry - shiptocontact shiptophone shiptofax shiptoemail + shiptocontact shiptocp_gender shiptophone shiptofax shiptoemail shiptodepartment_1 shiptodepartment_2); my @addr_vars = @@ -1796,6 +1777,19 @@ sub ship_to { ? $locale->text('Customer Number') : $locale->text('Vendor Number'); + # sieht nicht nett aus, funktioniert aber + # das vorausgewählte select-feld wird über shiptocp_gender + # entsprechend vorbelegt + my $selected_m=''; + my $selected_f=''; + if ($form->{shiptocp_gender} eq 'm') { + $selected_m='selected'; + $selected_f=''; + } elsif ($form->{shiptocp_gender} eq 'f') { + $selected_m=''; + $selected_f='selected'; + } + # get pricegroups for parts IS->get_pricegroups_for_parts(\%myconfig, \%$form); @@ -1868,6 +1862,15 @@ sub ship_to { $form->{contact} + + | . $locale->text('Gender') . qq| + + + + | . $locale->text('Phone') . qq| $form->{phone} @@ -1977,11 +1980,7 @@ sub relink_accounts { } $form->{"taxaccounts"} = ""; - for (my $i = 1; $i <= $form->{"rowcount"}; $i++) { - if ($form->{"id_$i"}) { - IC->retrieve_accounts(\%myconfig, $form, $form->{"id_$i"}, $i, 1); - } - } + IC->retrieve_accounts(\%myconfig, $form, map { $_ => $form->{"id_$_"} } 1 .. $form->{rowcount}); $main::lxdebug->leave_sub(); } @@ -2076,8 +2075,8 @@ sub _update_custom_variables { my $form = $main::form; - $form->{CVAR_CONFIGS} ||= { }; - $form->{CVAR_CONFIGS}->{IC} = CVar->get_configs(module => 'IC'); + $form->{CVAR_CONFIGS} = { } unless ref $form->{CVAR_CONFIGS} eq 'HASH'; + $form->{CVAR_CONFIGS}->{IC} ||= CVar->get_configs(module => 'IC'); $main::lxdebug->leave_sub(); } @@ -2094,10 +2093,11 @@ sub _render_custom_variables_inputs { return; } + my $valid = CVar->custom_variables_validity_by_trans_id(trans_id => $params{part_id}); + my $num_visible_cvars = 0; foreach my $cvar (@{ $form->{CVAR_CONFIGS}->{IC} }) { - $cvar->{valid} = $params{part_id} && - CVar->get_custom_variables_validity(config_id => $cvar->{id}, trans_id => $params{part_id}); + $cvar->{valid} = $params{part_id} && $valid->($cvar->{id}); my $description = ''; if ($cvar->{flag_editable} && $cvar->{valid}) {