X-Git-Url: http://wagnertech.de/gitweb/gitweb.cgi/mfinanz.git/blobdiff_plain/663a36435a60b53b894ab688f99c54d587d71795..0cb6e3af8457c1b10c356a1749269b16c5cd3328:/bin/mozilla/io.pl diff --git a/bin/mozilla/io.pl b/bin/mozilla/io.pl index 7fc1ef1b8..3c6c087da 100644 --- a/bin/mozilla/io.pl +++ b/bin/mozilla/io.pl @@ -47,9 +47,11 @@ use SL::CT; use SL::IC; use SL::IO; +use SL::DB::Customer; use SL::DB::Default; use SL::DB::Language; use SL::DB::Printer; +use SL::DB::Vendor; use SL::Helper::CreatePDF; use SL::Helper::Flash; @@ -869,8 +871,6 @@ sub order { } $form->{script} = 'oe.pl'; - $form->{shipto} = 1; - $form->{rowcount}--; $form->{cp_id} *= 1; @@ -935,8 +935,6 @@ sub quotation { $form->{script} = 'oe.pl'; - $form->{shipto} = 1; - $form->{rowcount}--; require "bin/mozilla/$form->{script}"; @@ -1417,28 +1415,6 @@ sub print_form { $form->get_shipto(\%myconfig); } - my @a = qw(name department_1 department_2 street zipcode city country contact phone fax email); - - my $shipto = 1; - - # if there is no shipto fill it in from billto - foreach my $item (@a) { - if ($form->{"shipto$item"}) { - $shipto = 0; - last; - } - } - - if ($shipto) { - if ( $form->{formname} eq 'purchase_order' - || $form->{formname} eq 'request_quotation') { - $form->{shiptoname} = $defaults->company; - $form->{shiptostreet} = $defaults->address; - } else { - map { $form->{"shipto$_"} = $form->{$_} } @a; - } - } - $form->{notes} =~ s/^\s+//g; delete $form->{printer_command}; @@ -1739,8 +1715,11 @@ sub ship_to { $::form->{title} = $::locale->text('Ship to'); $::form->header; + my $vc_obj = ($::form->{vc} eq 'customer' ? "SL::DB::Customer" : "SL::DB::Vendor")->new(id => $::form->{$::form->{vc} . "_id"})->load; + print $::form->parse_html_template('io/ship_to', { previousform => $previous_form, nextsub => $::form->{display_form} || 'display_form', + vc_obj => $vc_obj, }); $main::lxdebug->leave_sub(); @@ -1886,16 +1865,18 @@ sub _render_custom_variables_inputs { foreach my $cvar (@{ $form->{CVAR_CONFIGS}->{IC} }) { $cvar->{valid} = $params{part_id} && $valid->($cvar->{id}); + my $show = 0; my $description = ''; if ($cvar->{flag_editable} && $cvar->{valid}) { $num_visible_cvars++; $description = $cvar->{description} . ' '; + $show = 1; } my $form_key = "ic_cvar_" . $cvar->{name} . "_$params{row}"; push @{ $params{ROW2} }, { - line_break => $num_visible_cvars == 1, + line_break => $show && !(($num_visible_cvars - 1) % ($::myconfig{form_cvars_nr_cols}*1 || 3)), description => $description, cvar => 1, render_options => {