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:

SL/DB/MetaSetup/Default.pm
33 33
  company                                  => { type => 'text' },
34 34
  currency_id                              => { type => 'integer', not_null => 1 },
35 35
  customer_hourly_rate                     => { type => 'numeric', precision => 8, scale => 2 },
36
  customer_projects_only_in_sales          => { type => 'boolean', default => 'false', not_null => 1 },
36 37
  customernumber                           => { type => 'text' },
37 38
  datev_check_on_ap_transaction            => { type => 'boolean', default => 'true' },
38 39
  datev_check_on_ar_transaction            => { type => 'boolean', default => 'true' },
bin/mozilla/do.pl
30 30
# Delivery orders
31 31
#======================================================================
32 32

  
33
use List::MoreUtils qw(uniq);
33 34
use List::Util qw(max sum);
34 35
use POSIX qw(strftime);
35 36
use YAML;
......
259 260
  $form->{employee_id} = $form->{old_employee_id} if $form->{old_employee_id};
260 261
  $form->{salesman_id} = $form->{old_salesman_id} if $form->{old_salesman_id};
261 262

  
262
  my @old_project_ids = ($form->{"globalproject_id"});
263
  map({ push(@old_project_ids, $form->{"project_id_$_"})
264
          if ($form->{"project_id_$_"}); } (1..$form->{"rowcount"}));
265

  
266 263
  my $vc = $form->{vc} eq "customer" ? "customers" : "vendors";
267
  $form->get_lists("projects"       => {
268
                     "key"          => "ALL_PROJECTS",
269
                     "all"          => 0,
270
                     "old_id"       => \@old_project_ids
271
                   },
272
                   $vc              => "ALL_VC",
264
  $form->get_lists($vc              => "ALL_VC",
273 265
                   "price_factors"  => "ALL_PRICE_FACTORS",
274 266
                   "departments"    => "ALL_DEPARTMENTS",
275 267
                   "business_types" => "ALL_BUSINESS_TYPES",
276 268
    );
277 269

  
270
  # Projects
271
  my @old_project_ids = uniq grep { $_ } map { $_ * 1 } ($form->{"globalproject_id"}, map { $form->{"project_id_$_"} } 1..$form->{"rowcount"});
272
  my @old_ids_cond    = @old_project_ids ? (id => \@old_project_ids) : ();
273
  my @customer_cond;
274
  if (($vc eq 'customers') && $::instance_conf->get_customer_projects_only_in_sales) {
275
    @customer_cond = (
276
      or => [
277
        customer_id          => $::form->{customer_id},
278
        billable_customer_id => $::form->{customer_id},
279
      ]);
280
  }
281
  my @conditions = (
282
    or => [
283
      and => [ active => 1, @customer_cond ],
284
      @old_ids_cond,
285
    ]);
286

  
287
  $::form->{ALL_PROJECTS}          = SL::DB::Manager::Project->get_all(query => \@conditions);
278 288
  $::form->{ALL_EMPLOYEES}         = SL::DB::Manager::Employee->get_all_sorted(query => [ or => [ id => $::form->{employee_id},  deleted => 0 ] ]);
279 289
  $::form->{ALL_SALESMEN}          = SL::DB::Manager::Employee->get_all_sorted(query => [ or => [ id => $::form->{salesman_id},  deleted => 0 ] ]);
280 290
  $::form->{ALL_SHIPTO}            = SL::DB::Manager::Shipto->get_all_sorted(query => [
bin/mozilla/is.pl
37 37
use SL::OE;
38 38
use Data::Dumper;
39 39
use DateTime;
40
use List::MoreUtils qw(uniq);
40 41
use List::Util qw(max sum);
41 42

  
42 43
use SL::DB::Default;
......
305 306

  
306 307
  $form->{defaultcurrency} = $form->get_default_currency(\%myconfig);
307 308

  
308
  my @old_project_ids = ($form->{"globalproject_id"});
309
  map { push @old_project_ids, $form->{"project_id_$_"} if $form->{"project_id_$_"}; } 1..$form->{"rowcount"};
310

  
311
  $form->get_lists("projects"      => { "key"    => "ALL_PROJECTS",
312
                                        "all"    => 0,
313
                                        "old_id" => \@old_project_ids },
314
                   "taxzones"      => "ALL_TAXZONES",
309
  $form->get_lists("taxzones"      => "ALL_TAXZONES",
315 310
                   "currencies"    => "ALL_CURRENCIES",
316 311
                   "customers"     => "ALL_CUSTOMERS",
317 312
                   "departments"   => "all_departments",
318 313
                   "price_factors" => "ALL_PRICE_FACTORS");
319 314

  
315
  # Projects
316
  my @old_project_ids = uniq grep { $_ } map { $_ * 1 } ($form->{"globalproject_id"}, map { $form->{"project_id_$_"} } 1..$form->{"rowcount"});
317
  my @old_ids_cond    = @old_project_ids ? (id => \@old_project_ids) : ();
318
  my @customer_cond;
319
  if ($::instance_conf->get_customer_projects_only_in_sales) {
320
    @customer_cond = (
321
      or => [
322
        customer_id          => $::form->{customer_id},
323
        billable_customer_id => $::form->{customer_id},
324
      ]);
325
  }
326
  my @conditions = (
327
    or => [
328
      and => [ active => 1, @customer_cond ],
329
      @old_ids_cond,
330
    ]);
331

  
332
  $TMPL_VAR{ALL_PROJECTS}          = SL::DB::Manager::Project->get_all(query => \@conditions);
320 333
  $TMPL_VAR{ALL_EMPLOYEES}         = SL::DB::Manager::Employee->get_all_sorted(query => [ or => [ id => $::form->{employee_id},  deleted => 0 ] ]);
321 334
  $TMPL_VAR{ALL_SALESMEN}          = SL::DB::Manager::Employee->get_all_sorted(query => [ or => [ id => $::form->{salesman_id},  deleted => 0 ] ]);
322 335
  $TMPL_VAR{ALL_SHIPTO}            = SL::DB::Manager::Shipto->get_all_sorted(query => [
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'));
locale/de/all
1203 1203
  'If disabled purchase invoices can only be created by conversion from existing requests for quotations, purchase orders and purchase delivery orders.' => 'Falls deaktiviert, so können Einkaufsrechnungen nur durch Umwandlung aus bestehenden Preisanfragen, Lieferantenaufträgen und Einkaufslieferscheinen angelegt werden.',
1204 1204
  'If disabled sales orders cannot be converted into sales invoices directly.' => 'Falls deaktiviert, so können Verkaufsangebote nicht direkt in Verkaufsrechnungen umgewandelt werden.',
1205 1205
  'If disabled sales quotations cannot be converted into sales invoices directly.' => 'Falls deaktiviert, so können Verkaufsauträge nicht direkt in Verkaufsrechnungen umgewandelt werden.',
1206
  'If enabled only those projects that are assigned to the currently selected customer are offered for selection in sales records.' => 'Wenn eingeschaltet, so werden in Verkaufsbelegen nur diejenigen Projekte zur Auswahl angeboten, die dem aktuell ausgewählten Kunden zugewiesen wurden.',
1206 1207
  'If enabled purchase and sales records cannot be saved if no transaction description has been entered.' => 'Wenn angeschaltet, so können Einkaufs- und Verkaufsbelege nicht gespeichert werden, solange keine Vorgangsbezeichnung eingegeben wurde.',
1207 1208
  'If missing then the start date will be used.' => 'Falls es fehlt, so wird die erste Rechnung für das Startdatum erzeugt.',
1208 1209
  'If the article type is set to \'mixed\' then a column called \'type\' must be present.' => 'Falls der Artikeltyp auf \'gemischt\' gestellt wird, muss eine Spalte namens \'type\' vorhanden sein.',
......
1612 1613
  'Only Warnings and Errors'    => 'Nur Warnungen und Fehler',
1613 1614
  'Only due follow-ups'         => 'Nur f&auml;llige Wiedervorlagen',
1614 1615
  'Only groups that have been configured for the client the user logs in to will be considered.' => 'Allerdings werden nur diejenigen Gruppen herangezogen, die für den Mandanten konfiguriert sind.',
1616
  'Only list customer\'s projects in sales records' => 'Nur Projekte des Kunden in Verkaufsbelegen anzeigen',
1615 1617
  'Only shown in item mode'     => 'werden nur im Artikelmodus angezeigt',
1616 1618
  'Oops. No valid action found to dispatch. Please report this case to the kivitendo team.' => 'Ups. Es wurde keine gültige Funktion zum Aufrufen gefunden. Bitte berichten Sie diesen Fall den kivitendo-Entwicklern.',
1617 1619
  'Open'                        => 'Offen',
......
1627 1629
  'Options'                     => 'Optionen',
1628 1630
  'Or download the whole Installation Documentation as PDF (350kB) for off-line study (currently in German Language): ' => 'Oder laden Sie die komplette Installationsbeschreibung als PDF (350kB) herunter: ',
1629 1631
  'Order'                       => 'Auftrag',
1630
  'Order Date missing!'         => 'Auftragsdatum fehlt!',
1631 1632
  'Order Date'                  => 'Auftragsdatum',
1632
  'Order Number missing!'       => 'Auftragsnummer fehlt!',
1633
  'Order Date missing!'         => 'Auftragsdatum fehlt!',
1633 1634
  'Order Number'                => 'Auftragsnummer',
1635
  'Order Number missing!'       => 'Auftragsnummer fehlt!',
1634 1636
  'Order amount'                => 'Auftragswert',
1635 1637
  'Order deleted!'              => 'Auftrag gelöscht!',
1636
  'Order probability & expected billing date' => 'Auftragswahrscheinlichkeit & vorrauss. Abrechnungsdatum',
1637 1638
  'Order probability'           => 'Auftragswahrscheinlichkeit',
1639
  'Order probability & expected billing date' => 'Auftragswahrscheinlichkeit & vorrauss. Abrechnungsdatum',
1638 1640
  'Order/Item row name'         => 'Name der Auftrag-/Positions-Zeilen',
1639 1641
  'OrderItem'                   => 'Position',
1640
  'Ordered'                     => 'Vom Kunde bestellt',
1641 1642
  'Ordered'                     => 'Von Kunden bestellt',
1642 1643
  'Orders'                      => 'Aufträge',
1643 1644
  'Orders / Delivery Orders deleteable' => 'Aufträge / Lieferscheine löschbar',
sql/Pg-upgrade2/defaults_only_customer_projects_in_sales.sql
1
-- @tag: defaults_only_customer_projects_in_sales
2
-- @description: Mandantenkonfiguration: in Verkaufsbelegen nur Projekte des ausgewählten Kunden anbieten
3
-- @depends: release_3_1_0
4
ALTER TABLE defaults ADD COLUMN customer_projects_only_in_sales BOOLEAN;
5
UPDATE defaults SET customer_projects_only_in_sales = FALSE;
6
ALTER TABLE defaults
7
  ALTER COLUMN customer_projects_only_in_sales SET DEFAULT FALSE,
8
  ALTER COLUMN customer_projects_only_in_sales SET NOT NULL;
templates/webpages/client_config/_features.html
65 65
   <td>[% LxERP.t8('If enabled purchase and sales records cannot be saved if no transaction description has been entered.') %]</td>
66 66
  </tr>
67 67

  
68
  <tr>
69
   <td align="right">[% LxERP.t8("Only list customer's projects in sales records") %]</td>
70
   <td>[% L.yes_no_tag("defaults.customer_projects_only_in_sales", SELF.defaults.customer_projects_only_in_sales) %]</td>
71
   <td>[% LxERP.t8("If enabled only those projects that are assigned to the currently selected customer are offered for selection in sales records.") %]</td>
72
  </tr>
73

  
68 74
  <tr>
69 75
   <td align="right">[% LxERP.t8('Allow conversion from sales quotations to sales invoices') %]</td>
70 76
   <td>[% L.yes_no_tag('defaults.allow_sales_invoice_from_sales_quotation', SELF.defaults.allow_sales_invoice_from_sales_quotation) %]</td>

Auch abrufbar als: Unified diff