Projekt

Allgemein

Profil

« Zurück | Weiter » 

Revision 41adf433

Von Moritz Bunkus vor mehr als 10 Jahren hinzugefügt

  • ID 41adf4334b0ed75b3c0ff35facc5fcfe1c5167e3
  • Vorgänger a2b2aea8
  • Nachfolger 2ea1a379

Verkaufsbelege: optional nur Projekte des Kunden anbieten

Auch dieses Feature kann über die Mandantenkonfiguration eingeschaltet
werden.

Unterschiede anzeigen:

bin/mozilla/oe.pl
44 44
use SL::MoreCommon qw(ary_diff);
45 45
use SL::PE;
46 46
use SL::ReportGenerator;
47
use List::MoreUtils qw(any none);
47
use List::MoreUtils qw(uniq any none);
48 48
use List::Util qw(min max reduce sum);
49 49
use Data::Dumper;
50 50

  
......
349 349
                        $form->{"closed"}    ? "checked" : "",  $locale->text('Closed')    if $form->{id};
350 350
  $TMPL_VAR{openclosed} = sprintf qq|<tr><td colspan=%d align=center>%s</td></tr>\n|, 2 * scalar @tmp, join "\n", @tmp if @tmp;
351 351

  
352
  # project ids
353
  my @old_project_ids = ($form->{"globalproject_id"}, grep { $_ } map { $form->{"project_id_$_"} } 1..$form->{"rowcount"});
354

  
355 352
  my $vc = $form->{vc} eq "customer" ? "customers" : "vendors";
356
  $form->get_lists("projects"      => { "key"      => "ALL_PROJECTS",
357
                                        "all"      => 0,
358
                                        "old_id"   => \@old_project_ids },
359
                   "taxzones"      => "ALL_TAXZONES",
353

  
354
  # project ids
355
  $form->get_lists("taxzones"      => "ALL_TAXZONES",
360 356
                   "payments"      => "ALL_PAYMENTS",
361 357
                   "currencies"    => "ALL_CURRENCIES",
362 358
                   "departments"   => "ALL_DEPARTMENTS",
......
364 360
                                        limit => $myconfig{vclimit} + 1 },
365 361
                   "price_factors" => "ALL_PRICE_FACTORS");
366 362

  
363
  # Projects
364
  my @old_project_ids = uniq grep { $_ } map { $_ * 1 } ($form->{"globalproject_id"}, map { $form->{"project_id_$_"} } 1..$form->{"rowcount"});
365
  my @old_ids_cond    = @old_project_ids ? (id => \@old_project_ids) : ();
366
  my @customer_cond;
367
  if (($vc eq 'customers') && $::instance_conf->get_customer_projects_only_in_sales) {
368
    @customer_cond = (
369
      or => [
370
        customer_id          => $::form->{customer_id},
371
        billable_customer_id => $::form->{customer_id},
372
      ]);
373
  }
374
  my @conditions = (
375
    or => [
376
      and => [ active => 1, @customer_cond ],
377
      @old_ids_cond,
378
    ]);
379

  
380
  $TMPL_VAR{ALL_PROJECTS}          = SL::DB::Manager::Project->get_all(query => \@conditions);
381

  
367 382
  # label subs
368 383
  my $employee_list_query_gen      = sub { $::form->{$_[0]} ? [ or => [ id => $::form->{$_[0]}, deleted => 0 ] ] : [ deleted => 0 ] };
369 384
  $TMPL_VAR{ALL_EMPLOYEES}         = SL::DB::Manager::Employee->get_all_sorted(query => $employee_list_query_gen->('employee_id'));

Auch abrufbar als: Unified diff