X-Git-Url: http://wagnertech.de/git?a=blobdiff_plain;f=bin%2Fmozilla%2Fdo.pl;h=1bcf20985a8d771c6b634a95bc0494a9dcce24c8;hb=6881b4bd6a669dd991b227ecf41c3e8662806595;hp=37353dccabc536427219f8d5963db355658965aa;hpb=15f021a67aa7e26458a3fbac8efe89ef9c0b0657;p=kivitendo-erp.git diff --git a/bin/mozilla/do.pl b/bin/mozilla/do.pl index 37353dcca..1bcf20985 100644 --- a/bin/mozilla/do.pl +++ b/bin/mozilla/do.pl @@ -258,29 +258,37 @@ sub form_header { # use JavaScript Calendar or not $form->{jsscript} = 1; - #write Trigger - my $jsscript = Form->write_trigger(\%myconfig, "2", "transdate", "BL", "trigger1", "reqdate", "BL", "trigger2"); - my @old_project_ids = ($form->{"globalproject_id"}); map({ push(@old_project_ids, $form->{"project_id_$_"}) if ($form->{"project_id_$_"}); } (1..$form->{"rowcount"})); my $vc = $form->{vc} eq "customer" ? "customers" : "vendors"; - $form->get_lists("contacts" => "ALL_CONTACTS", - "shipto" => "ALL_SHIPTO", - "projects" => { + $form->get_lists("projects" => { "key" => "ALL_PROJECTS", "all" => 0, "old_id" => \@old_project_ids }, - "employees" => "ALL_EMPLOYEES", - "salesmen" => "ALL_SALESMEN", $vc => "ALL_VC", "price_factors" => "ALL_PRICE_FACTORS", "departments" => "ALL_DEPARTMENTS", "business_types" => "ALL_BUSINESS_TYPES", ); + $::form->{ALL_EMPLOYEES} = SL::DB::Manager::Employee->get_all(query => [ or => [ id => $::form->{employee_id}, deleted => 0 ] ]); + $::form->{ALL_SALESMEN} = SL::DB::Manager::Employee->get_all(query => [ or => [ id => $::form->{salesman_id}, deleted => 0 ] ]); + $::form->{ALL_SHIPTO} = SL::DB::Manager::Shipto->get_all(query => [ + or => [ trans_id => $::form->{"$::form->{vc}_id"} * 1, and => [ shipto_id => $::form->{shipto_id} * 1, trans_id => undef ] ] + ]); + $::form->{ALL_CONTACTS} = SL::DB::Manager::Contact->get_all(query => [ + or => [ + cp_cv_id => $::form->{"$::form->{vc}_id"} * 1, + and => [ + cp_cv_id => undef, + cp_id => $::form->{cp_id} * 1 + ] + ] + ]); + map { $_->{value} = "$_->{description}--$_->{id}" } @{ $form->{ALL_DEPARTMENTS} }; map { $_->{value} = "$_->{name}--$_->{id}" } @{ $form->{ALL_VC} }; @@ -299,6 +307,11 @@ sub form_header { $form->{onload} .= "document.do.submit();" } + my $follow_up_vc = $form->{ $form->{vc} eq 'customer' ? 'customer' : 'vendor' }; + $follow_up_vc =~ s/--\d*\s*$//; + + $form->{follow_up_trans_info} = $form->{donumber} .'('. $follow_up_vc .')'; + $form->header(); # Fix für Bug 1082 Erwartet wird: 'abteilungsNAME--abteilungsID' # und Erweiterung für Bug 1760: @@ -440,9 +453,8 @@ sub search { $form->get_lists("projects" => { "key" => "ALL_PROJECTS", "all" => 1 }, - "employees" => "ALL_EMPLOYEES", - "salesmen" => "ALL_SALESMEN", "$form->{vc}s" => "ALL_VC"); + $form->{ALL_EMPLOYEES} = SL::DB::Manager::Employee->get_all(query => [ deleted => 0 ]); $form->{SHOW_VC_DROP_DOWN} = $myconfig{vclimit} > scalar @{ $form->{ALL_VC} }; $form->{jsscript} = 1; @@ -476,7 +488,7 @@ sub orders { my @columns = qw( ids transdate id donumber - ordnumber + ordnumber customernumber name employee salesman shipvia globalprojectnumber transaction_description @@ -504,6 +516,7 @@ sub orders { 'id' => { 'text' => $locale->text('ID'), }, 'donumber' => { 'text' => $locale->text('Delivery Order'), }, 'ordnumber' => { 'text' => $locale->text('Order'), }, + 'customernumber' => { 'text' => $locale->text('Customer Number'), }, 'name' => { 'text' => $form->{vc} eq 'customer' ? $locale->text('Customer') : $locale->text('Vendor'), }, 'employee' => { 'text' => $locale->text('Employee'), }, 'salesman' => { 'text' => $locale->text('Salesman'), }, @@ -605,8 +618,7 @@ sub orders { }; $row->{donumber}->{link} = $edit_url . "&id=" . E($dord->{id}) . "&callback=${callback}"; - $row->{ordnumber}->{link} = $edit_order_url . "&id=" . E($dord->{oe_id}) . "&callback=${callback}"; - + $row->{ordnumber}->{link} = $edit_order_url . "&id=" . E($dord->{oe_id}) . "&callback=${callback}" if $dord->{oe_id}; $report->add_data($row); $idx++; @@ -831,7 +843,7 @@ sub invoice { # show pricegroup in newly loaded invoice when creating invoice from delivery order for my $i (1 .. $form->{rowcount}) { - $form->{"sellprice_pg_$i"} = join /--/, $form->{"sellprice_$i"}, $form->{"pricegroup_id_$i"}; + $form->{"sellprice_pg_$i"} = join '--', $form->{"sellprice_$i"}, $form->{"pricegroup_id_$i"}; } IS->get_pricegroups_for_parts(\%myconfig, \%$form); set_pricegroup($_) for 1 .. $form->{rowcount}; @@ -937,7 +949,7 @@ sub invoice_multi { # show pricegroup in newly loaded invoice when creating invoice from delivery order for my $i (1 .. $form->{rowcount}) { - $form->{"sellprice_pg_$i"} = join /--/, $form->{"sellprice_$i"}, $form->{"pricegroup_id_$i"}; + $form->{"sellprice_pg_$i"} = join '--', $form->{"sellprice_$i"}, $form->{"pricegroup_id_$i"}; } IS->get_pricegroups_for_parts(\%myconfig, \%$form); set_pricegroup($_) for 1 .. $form->{rowcount};